Commit Graph

18788 Commits

Author SHA1 Message Date
Alexander Udalov 127cd1295e Disable JSR-305 annotations by default, introduce CLI argument
No package annotations are going to be loaded, and
TypeQualifierDefault/TypeQualifierNickname are no longer recognized by
default. Use the CLI argument "-Xload-jsr305-annotations" to enable this
behavior back

 #KT-10942
2017-07-07 22:08:50 +03:00
Mikhail Glukhikh 1d2017b0fc Cleanup: apply "cascade if..." inspection (+ some others) 2017-07-07 18:15:32 +03:00
Mikhail Glukhikh 9c06739594 Cleanup: apply "lift out..." inspection (+ some others) 2017-07-07 18:15:30 +03:00
takahirom fe9d3f16d3 KT-18501: Fix to find KDoc even if KDoc is in ModifierList 2017-07-07 18:12:19 +03:00
Mikhail Zarechenskiy 039729908d Minor, remove field that never used 2017-07-07 14:20:03 +03:00
Mikhail Zarechenskiy 3fed4e6dc7 Improve diagnostic for unresolved reference when function expected
#KT-10657 Fixed
2017-07-07 14:20:02 +03:00
Mikhail Zarechenskiy c853ac95ad Improve diagnostic message for annotations with @receiver
#KT-14647 Fixed
2017-07-07 14:19:59 +03:00
Mikhail Zarechenskiy f5cd8c7e4d Relax name shadowing warning on parameter names
#KT-17611 Fixed
2017-07-07 14:19:57 +03:00
Mikhail Zarechenskiy daa8521729 Avoid getting descriptors for collection literals from built-ins scope
#KT-18845 Fixed
2017-07-07 14:14:30 +03:00
Vyacheslav Gerasimov 2ec1a4311a Implement Kotlin configurator for GSK
#KT-14965 Fixed
2017-07-07 03:23:17 +03:00
Alexander Udalov 0f15413d47 Minor, do not output stack trace on invalid contents of build file 2017-07-06 17:03:25 +03:00
Alexander Udalov 55468735df Rename -module argument to -Xbuild-file
To prevent confusion with Java 9 module-related arguments

 #KT-18754 Fixed
2017-07-06 17:03:25 +03:00
Alexander Udalov 0b399fe7bb Ignore testAutomaticModuleNames on older Java 9 builds 2017-07-06 13:01:16 +03:00
Alexander Udalov 158afdea2b Improve sorting of compiler messages in GroupingMessageCollector
Ensure that messages reported on a file but with no line information are
reported before diagnostics related to code. This fixes
Java9ModulesIntegrationTest.testSeveralModulesWithTheSameName on some
machines
2017-07-06 13:01:16 +03:00
Alexander Udalov 3808ecbd1e Minor, return a set in JavaModuleGraph.getAllDependencies
To prevent duplicate roots to be added
2017-07-06 13:01:15 +03:00
Alexander Udalov ec6e4f2469 Minor, take List instead of Iterable in convertClasspathRoots
To emphasize that the order is important
2017-07-06 13:01:15 +03:00
Alexander Udalov 0f06140a3d Check 'Multi-Release' manifest attribute value for multi-release jars
See http://openjdk.java.net/jeps/238
2017-07-06 13:01:14 +03:00
Alexander Udalov 7ab018da7b Use ASM 6 API to read class files in IDE
Otherwise ASM throws exceptions trying to read module-info.class

 #KT-13072 Fixed
2017-07-06 13:01:13 +03:00
Alexander Udalov 51fb02b2d5 Report warning for several modules with same name on module path 2017-07-06 13:01:13 +03:00
Alexander Udalov 9199023952 Improve automatic module handling in module graph construction
Add all automatic modules to roots if at least one automatic module is
added, as per
http://cr.openjdk.java.net/~mr/jigsaw/spec/api/java/lang/module/package-summary.html
2017-07-06 13:01:12 +03:00
Alexander Udalov c428505d4d Load automatic module names correctly
Load the Automatic-Module-Name manifest entry value if it's present (see
http://mail.openjdk.java.net/pipermail/jpms-spec-observers/2017-May/000877.html),
otherwise sanitize the name of the .jar file, throwing out all chars
except alphanumeric, duplicate dots and a version qualifier
2017-07-06 12:50:05 +03:00
Alexander Udalov 612e64d8e3 Load module-info.class from multi-release jars' META-INF/versions/ 2017-07-06 12:50:04 +03:00
Alexander Udalov 5b9ee88b52 Remove --add-opens options to workaround Java 9 visibility checks
These options are no longer needed because the problematic code in
intellij-core that was accessing these private APIs has been dealt with
in the 171 branch.

The remaining options in "Codegen Tests" run configurations are needed
because of reflection usage on JDK internals in KtUsefulTestCase
2017-07-06 12:50:04 +03:00
Alexander Udalov 40d4eeab4f Do not try to load jrt file system from JDK version < 9
The FileSystems.newFileSystem call failed if the compiler was being run
on Java 9 with -jdk-home $JDK_16
2017-07-06 12:50:03 +03:00
Alexander Udalov 0f4684da67 Fix codegen tests on JDK 9 with jdkKind = FULL_JDK 2017-07-06 11:58:03 +03:00
Nikolay Krasko 6a2f3d8065 Minor: remove let usage 2017-07-05 20:21:13 +03:00
Mikhael Bogdanov 2808e45b89 Enable test in js, native 2017-07-05 11:15:38 +02:00
Alexander Udalov d97fa604e1 Write metadata for suspend function into anonymous coroutine classes
To render nice Kotlin types in toString() of continuation
2017-07-04 19:41:48 +03:00
Vladimir Koshelev 61e52f0bfe Improve a reported message if -jdk-home path does not exist.
Fix KT-18794
2017-07-04 19:40:42 +03:00
Alexey Sedunov 28c5978d81 Light Classes: Fix AIOOBE on KtParameter -> PsiParameter conversion
EA-88058 Fixed
2017-07-04 19:37:54 +03:00
Dmitry Petrov 16505daeea Fix 'equals' for NotNullBasicValue
NotNullBasicValues were merged incorrectly sometimes,
which caused problems with INSTANCEOF checks.

 #KT-18779 Fixed
2017-07-04 12:19:10 +03:00
Mikhael Bogdanov 8121c1d3c4 Update test to support js-backend 2017-07-04 10:12:42 +02:00
Mikhael Bogdanov 8666b95dd2 Delete local variables on default mask expantion
#KT-18792 Fixed
2017-07-03 17:01:06 +02:00
Mikhael Bogdanov 01e2f8e32c Preventively allocate slots for additional default parameters
Otherwise they are corrupted by inline
2017-07-03 17:01:06 +02:00
Denis Zharkov 5453f3067c Load @NonNull(when=UNKNOWN) annotated type as a flexible one 2017-07-03 17:55:37 +03:00
Denis Zharkov e26c210d69 Support TypeQualifierDefault from JSR 305 for nullability qualifiers
#KT-10942 Fixed
2017-07-03 17:55:37 +03:00
Denis Zharkov 57b7b91444 Do not add container annotaions to type artificially
It was only used for type-related nullability/mutability
annotations and it was necessary to remove them
in the descriptor renderer (duplicating their fqnames there).
At the same time they're only needed for types enhancement
where they can be simply restored from type owners' descriptors

The testData changes are more or less correct: this kind of annotations
is bound both to types themselves and their use because of their targets
2017-07-03 17:55:37 +03:00
Denis Zharkov 92f9194112 Support TypeQualifierNickname for nullability annotations
#KT-10942 In Progress
2017-07-03 17:55:37 +03:00
Denis Zharkov 42b2534c46 Remove redundant check in WhenByPlatformEnumChecker
If a type is annotated as not null its upper bound is not nullable
in most cases besides override conflicts, but in the latter case
we should behave consistently with flexibility of this type
2017-07-03 17:55:37 +03:00
Denis Zharkov a0268d23bb Get rid of trivial allowFlexible replacing
As the type is anyway replaced with not-nullable version
explicitly, the only thing that changes is what type is loaded
for String[][].class:
- before it would be Array<Array<String?>?>
- now it's Array<(out) Array<(out) String!>!>

It's both a minor change and new behaviour can be considered
as correct
2017-07-03 17:55:37 +03:00
Denis Zharkov 5c8f2a8ae8 Add resolution for JSR 305 type qualifier nicknames
#KT-10942 In Progress
2017-07-03 17:55:37 +03:00
Denis Zharkov 79e14f88e4 Support package level annotations in Java
#KT-10942 In Progress
2017-07-03 17:55:37 +03:00
Denis Zharkov b7ead75947 Minor. Move BinaryJavaModifierListOwner -> MapBasedJavaAnnotationOwner 2017-07-03 17:55:04 +03:00
Mikhael Bogdanov 49252f6eec Properly process primitive receiver on inlining bound callable references
#KT-18728 Fixed
2017-07-03 10:51:51 +02:00
Alexander Udalov 37982e4bb1 Move SAM-related descriptor classes to module frontend.java
Also move SyntheticMemberDescriptor to module resolution
2017-06-30 21:02:18 +03:00
Valentin Kipyatkov 8fabb6945e Allow slice rewrite in trace when in IDE 2017-06-30 11:21:16 +03:00
Valentin Kipyatkov 61d9a6b9cd Use the same way to check for ProcessCanceledException everywhere 2017-06-30 11:21:16 +03:00
Alexey Sedunov 50a38df8b1 Remove Parentheses: Forbid on call inside a call without argument list
#KT-18699 Fixed
2017-06-29 17:42:17 +03:00
Alexey Sedunov 20969f161c Introduce Parameter: Fix NPE on invalid parameter name or type
EA-95189 Fixed
2017-06-29 17:42:16 +03:00
Mikhail Glukhikh 840847e47c Code cleanup: several inspections applied 2017-06-29 16:25:57 +03:00