Commit Graph

8193 Commits

Author SHA1 Message Date
Nikolay Krasko d257256960 Fix build - remove calling getText()
Call of getText() on class element activated caching for
com.intellij.filetype.decompiler extension point in
KeyedExtensionCollector. This cache wasn't
invalidated on set up JavaWithoutSources tests.
2012-10-09 16:43:33 +04:00
Alexander Udalov e869568196 Generate bridges for property accessors
Use existing FunctionCodegen.generateBridgeIfNeeded() on property getters &
setters

 #KT-2920 Fixed
2012-10-09 16:36:24 +04:00
Andrey Breslav 7d28ee4342 Nullable-specific routines now respect the fact that <T> may be instantiated with a nullable type 2012-10-09 12:58:47 +04:00
James Strachan 8a9485bd5f added a helper method to get the child elements of an Element by name 2012-10-09 09:12:34 +01:00
James Strachan 6a59820de3 added a test case for File.relativePath() along with fixing a bug if you pass the same file as the argument; it should have returned the empty string 2012-10-09 08:36:51 +01:00
Evgeny Gerashchenko 4b5da9dc17 Checking static members in JdkAnnotationsSanityTest. 2012-10-08 22:49:17 +04:00
Evgeny Gerashchenko 543fe8d999 Fixed annotation for Arrays.sort() method and fixed build. 2012-10-08 22:49:17 +04:00
Pavel V. Talanov c609440c2b Move DescriptorSearchRule logic to DescriptorSearchRule class 2012-10-08 21:54:11 +04:00
Pavel V. Talanov 9dd3d584ef Move JavaDescriptorResolverData inner classes to upper level of new data package, remove JavaDescriptorResolverData itself 2012-10-08 21:54:10 +04:00
Pavel V. Talanov ca4ac25819 Move some static fields from JavaDescriptorResolver 2012-10-08 21:54:09 +04:00
Pavel V. Talanov 0b474af1f5 Move namespaceDescriptorCache field to NamespaceResolver from JavaDescriptorResolver 2012-10-08 21:54:08 +04:00
Pavel V. Talanov 3f1f3ba9c1 Move classDescriptorCache field to ClassResolver from JavaDescriptorResolver 2012-10-08 21:54:07 +04:00
Pavel V. Talanov 753247ae3e Get rid of getCompileConstResolver and getAnnotationResolver methods in JavaDescriptorResolver 2012-10-08 21:54:07 +04:00
Pavel V. Talanov fb6fbdfaad Get rid of getClassResolver method in JavaDescriptorResolver 2012-10-08 21:54:06 +04:00
Evgeny Gerashchenko 5bc2422cb0 Failing with compilation error when Java library has wrong @KotlinSignatureAnnotation. 2012-10-08 21:48:54 +04:00
Alexander Udalov 326720afc8 Fix failing build
Add runtime and annotations.jar to classpath when compiling Java in codegen
tests
2012-10-08 21:09:07 +04:00
Nikolay Krasko a145e93ebb Don't repeat full qualified name in error messages for field annotations 2012-10-08 21:07:23 +04:00
Nikolay Krasko d0b41ff153 Check absence of explicit initializer in field annotation 2012-10-08 21:07:22 +04:00
Nikolay Krasko 3a410064be Test for syntax errors in field annotations 2012-10-08 21:07:20 +04:00
Nikolay Krasko 24fc3cc53f More validation checks for field annotations 2012-10-08 21:07:19 +04:00
Nikolay Krasko 6ffd1aceaa Check field signature name 2012-10-08 21:07:19 +04:00
Alexander Udalov c9984c3d06 Generate not-null assertions on method parameters
Intrinsics.checkParameterIsNotNull() gets its caller's class and method names
from the stack trace to render them in an exception message.

Fix codegen tests because now it's now allowed to pass null to non-null
argument in tests
2012-10-08 19:13:20 +04:00
Alexander Udalov 753ae9e550 Add a compiler parameter to generate not-null parameter assertions
Enable/disable assertion generation on parameters in the beginning of
methods accessible from Java
2012-10-08 19:03:36 +04:00
Alexander Udalov 12ce447c24 Refactor FunctionCodegen.generateMethod() 2012-10-08 19:03:33 +04:00
Alexander Udalov bf779b4ca5 Generate not-null assertions only for descriptors coming from Java
Introduce BindingContext.IS_DECLARED_IN_JAVA, store that info in
JavaDescriptorResolver
2012-10-08 19:03:29 +04:00
Alexander Udalov 988af8208c Refactor, make CodegenTestCase.generateCommon() static and reusable 2012-10-08 19:03:19 +04:00
Alexander Udalov fcbc95bbb4 Generate not-null assertions after getting a field 2012-10-08 14:11:57 +04:00
Alexander Udalov 27bea0a607 Pass state and property descriptor to StackValue.Property 2012-10-08 14:11:57 +04:00
Alexander Udalov 95ec2448eb Generate not-null assertions after method calls
If a method comes from Java and is annotated as returning NotNull, after
calling it we should check if it actually returned something other than null.
Introduce checkReturnedValueIsNotNull() in jet/runtime/Intrinsics which does
exactly that.

CallableMethod's invoke() and invokeDefault() are now private, use asserted
versions instead
2012-10-08 14:11:56 +04:00
Alexander Udalov 1cf5e92981 Support multi-file tests with Java in CodegenTestCase 2012-10-08 14:11:54 +04:00
Alexander Udalov 19a6a3f390 Add a compiler parameter to generate not-null assertions on method call sites
It is off by default when invoking compiler directly, and on by default when
compiling from IDE
2012-10-08 14:11:52 +04:00
Alexander Udalov 1f3586a151 Minor refactoring in ReplInterpreter
GenerationState is now created with default configuration parameters
2012-10-08 14:11:48 +04:00
Dmitry Jemerov 96fe65bfea delete obsolete generator script 2012-10-08 11:21:44 +02:00
Dmitry Jemerov 572aff8fe4 idea 11 eap -> idea 12 eap 2012-10-08 10:20:56 +02:00
Pavel V. Talanov e72c38aabb Make members in *Resolver classes private where possible and classes themselves final
Overall: very roughly split monster class JavaDescriptorResolver into smaller pieces of functionality represented by *ResolverClasses
It by no means improves abstraction (and no significant changes to the logic has been made) but makes the whole subsystem more structured and easier to understand/modify in the future
2012-10-06 20:39:38 +04:00
Pavel V. Talanov cae349d4f0 Move method from JavaDescriptorResolver to PropertiesResolver and ClassResolver 2012-10-06 20:25:54 +04:00
Pavel V. Talanov 55a60b3296 Move util method from JavaDescriptorResolver to DescriptorResolverUtils 2012-10-06 20:17:37 +04:00
Pavel V. Talanov 086fadc9be Move util method from JavaDescriptorResolver to JavaDescriptorSignatureResolver 2012-10-06 20:16:40 +04:00
Pavel V. Talanov dee9902d64 Move util method from JavaDescriptorResolver to ClassResolver 2012-10-06 20:14:48 +04:00
Pavel V. Talanov 37fd1aebf6 Extract util methods from JavaDescriptorResolver to the new class DescriptorResolverUtils 2012-10-06 20:09:45 +04:00
Pavel V. Talanov b70ba37c34 Extract ValueParameterResolver class from JavaDescriptorResolver 2012-10-06 20:02:29 +04:00
Pavel V. Talanov 471169303a Extract InnerClassResolver class from JavaDescriptorResolver 2012-10-06 19:57:18 +04:00
Pavel V. Talanov e3d631fb63 Move method from JavaDescriptorResolver to FunctionResolver 2012-10-06 19:54:12 +04:00
Pavel V. Talanov bf76fa665e Move method from JavaDescriptorResolver to NamespaceResolver 2012-10-06 19:51:51 +04:00
Pavel V. Talanov f3c707a71f Move methods from JavaDescriptorResolver to ClassResolver 2012-10-06 19:49:59 +04:00
Pavel V. Talanov 913659a58a Move methods from JavaDescriptorResolver to ClassResolver 2012-10-06 19:47:49 +04:00
Pavel V. Talanov a0bcc27ffa Move methods from JavaDescriptorResolver to ClassResolver 2012-10-06 19:43:49 +04:00
Pavel V. Talanov 4f0ac287b3 Move methods from JavaDescriptorResolver to FunctionResolver 2012-10-06 19:31:45 +04:00
Pavel V. Talanov 6424e0fe22 Extract NamespaceResolver class from JavaDescriptorResolver 2012-10-06 19:13:43 +04:00
Pavel V. Talanov 88bd991729 Extract FunctionResolver and AnnotationResolver classes from JavaDescriptorResolver 2012-10-06 19:08:57 +04:00