Commit Graph

24 Commits

Author SHA1 Message Date
Denis Zharkov fdc6b37264 Obtain default type qualifiers from value parameters too
#KT-20016 In Progress
2017-09-26 16:40:47 +03:00
Denis Zharkov 775d6988e8 Preserve flexibility for Java types annotated with @NonNull(UNKNOWN)
Before this chanhe, these annotations are simply ignored, but they should
preserve flexibility in case of enhanced nullability obtained from
enclosing default qualifier

 #KT-20158 Fixed
2017-09-26 16:40:47 +03:00
Denis Zharkov 02d3d9785c Move JSR-305 tests to one directory and strip common name prefix 2017-09-26 16:40:47 +03:00
Denis Zharkov 8a66919a5c Support @NonNull(when = NEVER) nullability annotation
#KT-20131 Fixed
2017-09-26 16:40:47 +03:00
Denis Zharkov c7812beea4 Fix SOE in SignatureEnhancement::extractNullability
The problem was that `resolveTypeQualifierAnnotation` actually doesn't
guarantee that `typeQualifierAnnotation` is javax.annotation.NonNull
with argument

It could be just any type qualifier (see the test)
2017-09-22 14:15:11 +03:00
Denis Zharkov 2ca220d442 Ignore built-in type qualifier defaults when Jsr305State=IGNORE 2017-09-14 18:05:32 +03:00
Dmitry Jemerov cc8fbf6078 Store third-party annotations in a separate directory 2017-09-13 17:25:20 +02:00
Denis Zharkov 4e4bf31016 Fix loading JSR-305 nicknames for @CheckForNull annotation
For sake of working without jsr305.jar in the classpath `resolveTypeQualifierAnnotation`
may return javax.annotation.CheckForNull (although the latter is nickname itself)

 #KT-19985 Fixed
2017-08-31 15:13:26 +03:00
baratynskiy 67fdd9f76e javac-wrapper: fixes after rebase and review 2017-08-29 18:01:36 +03:00
baratynskiy 01883a41cb javac-wrapper: refactoring, fixes and tests 2017-08-29 18:01:36 +03:00
e5l e315249624 Add tests on jsr305 annotations warnings 2017-08-15 11:01:08 +03:00
Denis Zharkov 8898455352 Add tests on foreign annotations without them in classpath
#KT-19419 Fixed
2017-08-11 10:18:41 +07:00
Denis Zharkov a82e313d14 Minor. Fix wrong target in test data for foreign annotations 2017-08-11 10:18:41 +07: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
Christopher Horner 8df40eaa46 Add support for RxJava's nullability annotations. 2017-04-20 17:20:39 +03:00
Valentin Kipyatkov ec51076355 DescriptorRenderer to render annotations for all types + separate option to render annotation arguments + use it in IdeDescriptorRenderers 2016-10-11 23:38:54 +03:00
Denis Zharkov a644dd3ae9 Create tests for TYPE_USE nullability annotations
- tests and declarations for checkerframework has been moved,
because they only Java 8 targeted
- tests for eclipse annotations has been just copied,
because there are two jars: one for Java 8 and other for earlier versions
2016-03-16 20:22:59 +03:00
Denis Zharkov 3f3c2bb272 Minor. Update eclipse nullability annotation sources
Accordingly to their repository
2016-03-16 20:22:58 +03:00
Jake Wharton f713adc96e Add support for AOSP's nullability annotations.
These are different than 'android.support.annotation' in that they are used on the JVM for projects within AOSP.
2016-02-15 11:32:09 +03:00
Denis Zharkov 11a96ee8c8 Introduce not null type parameter capability
Java nullability annotations may generate types that currently are not denotable in Kotlin:
class Java {
  void <F> foo(@NotNull F f) {}
}

Type of given value parameter should be not nullable under any substitution:
String/String?/String! because of annotation contract.

NB: Currently there is no full analogues for such types in pure kotlin
2016-01-28 08:36:23 +03:00
Denis Zharkov f4613b8db1 Support foreign nullability annotations
#KT-10418 Fixed
 #KT-10594 Fixed
2016-01-14 19:24:10 +03:00