protected void appendNullAnnotation(StringBuffer nameBuffer, CompilerOptions options) { if (options.isAnnotationBasedNullAnalysisEnabled) { if (options.usesNullTypeAnnotations()) { for (AnnotationBinding annotation : this.typeAnnotations) { ReferenceBinding annotationType = annotation.getAnnotationType(); if (annotationType.hasNullBit(TypeIds.BitNonNullAnnotation|TypeIds.BitNullableAnnotation)) { nameBuffer.append('@').append(annotationType.shortReadableName()).append(' '); } } } else { // restore applied null annotation from tagBits: if ((this.tagBits & TagBits.AnnotationNonNull) != 0) { char[][] nonNullAnnotationName = options.nonNullAnnotationName; nameBuffer.append('@').append(nonNullAnnotationName[nonNullAnnotationName.length-1]).append(' '); } if ((this.tagBits & TagBits.AnnotationNullable) != 0) { char[][] nullableAnnotationName = options.nullableAnnotationName; nameBuffer.append('@').append(nullableAnnotationName[nullableAnnotationName.length-1]).append(' '); } } } }
protected void appendNullAnnotation(StringBuffer nameBuffer, CompilerOptions options) { if (options.isAnnotationBasedNullAnalysisEnabled) { if (options.usesNullTypeAnnotations()) { for (AnnotationBinding annotation : this.typeAnnotations) { ReferenceBinding annotationType = annotation.getAnnotationType(); if (annotationType.hasNullBit(TypeIds.BitNonNullAnnotation|TypeIds.BitNullableAnnotation)) { nameBuffer.append('@').append(annotationType.shortReadableName()).append(' '); } } } else { // restore applied null annotation from tagBits: if ((this.tagBits & TagBits.AnnotationNonNull) != 0) { char[][] nonNullAnnotationName = options.nonNullAnnotationName; nameBuffer.append('@').append(nonNullAnnotationName[nonNullAnnotationName.length-1]).append(' '); } if ((this.tagBits & TagBits.AnnotationNullable) != 0) { char[][] nullableAnnotationName = options.nullableAnnotationName; nameBuffer.append('@').append(nullableAnnotationName[nullableAnnotationName.length-1]).append(' '); } } } }
protected void appendNullAnnotation(StringBuffer nameBuffer, CompilerOptions options) { if (options.isAnnotationBasedNullAnalysisEnabled) { if (options.usesNullTypeAnnotations()) { for (AnnotationBinding annotation : this.typeAnnotations) { ReferenceBinding annotationType = annotation.getAnnotationType(); if (annotationType.hasNullBit(TypeIds.BitNonNullAnnotation|TypeIds.BitNullableAnnotation)) { nameBuffer.append('@').append(annotationType.shortReadableName()).append(' '); } } } else { // restore applied null annotation from tagBits: if ((this.tagBits & TagBits.AnnotationNonNull) != 0) { char[][] nonNullAnnotationName = options.nonNullAnnotationName; nameBuffer.append('@').append(nonNullAnnotationName[nonNullAnnotationName.length-1]).append(' '); } if ((this.tagBits & TagBits.AnnotationNullable) != 0) { char[][] nullableAnnotationName = options.nullableAnnotationName; nameBuffer.append('@').append(nullableAnnotationName[nullableAnnotationName.length-1]).append(' '); } } } }
protected void appendNullAnnotation(StringBuffer nameBuffer, CompilerOptions options) { if (options.isAnnotationBasedNullAnalysisEnabled) { if (options.usesNullTypeAnnotations()) { for (AnnotationBinding annotation : this.typeAnnotations) { ReferenceBinding annotationType = annotation.getAnnotationType(); if (annotationType.hasNullBit(TypeIds.BitNonNullAnnotation|TypeIds.BitNullableAnnotation)) { nameBuffer.append('@').append(annotationType.shortReadableName()).append(' '); } } } else { // restore applied null annotation from tagBits: if ((this.tagBits & TagBits.AnnotationNonNull) != 0) { char[][] nonNullAnnotationName = options.nonNullAnnotationName; nameBuffer.append('@').append(nonNullAnnotationName[nonNullAnnotationName.length-1]).append(' '); } if ((this.tagBits & TagBits.AnnotationNullable) != 0) { char[][] nullableAnnotationName = options.nullableAnnotationName; nameBuffer.append('@').append(nullableAnnotationName[nullableAnnotationName.length-1]).append(' '); } } } }
protected void appendNullAnnotation(StringBuffer nameBuffer, CompilerOptions options) { if (options.isAnnotationBasedNullAnalysisEnabled) { if (options.usesNullTypeAnnotations()) { for (AnnotationBinding annotation : this.typeAnnotations) { ReferenceBinding annotationType = annotation.getAnnotationType(); if (annotationType.hasNullBit(TypeIds.BitNonNullAnnotation|TypeIds.BitNullableAnnotation)) { nameBuffer.append('@').append(annotationType.shortReadableName()).append(' '); } } } else { // restore applied null annotation from tagBits: if ((this.tagBits & TagBits.AnnotationNonNull) != 0) { char[][] nonNullAnnotationName = options.nonNullAnnotationName; nameBuffer.append('@').append(nonNullAnnotationName[nonNullAnnotationName.length-1]).append(' '); } if ((this.tagBits & TagBits.AnnotationNullable) != 0) { char[][] nullableAnnotationName = options.nullableAnnotationName; nameBuffer.append('@').append(nullableAnnotationName[nullableAnnotationName.length-1]).append(' '); } } } }
StringBuilder returnType = new StringBuilder(); StringBuilder returnTypeShort = new StringBuilder(); if (this.options.usesNullTypeAnnotations()) {
StringBuilder returnType = new StringBuilder(); StringBuilder returnTypeShort = new StringBuilder(); if (this.options.usesNullTypeAnnotations()) {
StringBuilder returnType = new StringBuilder(); StringBuilder returnTypeShort = new StringBuilder(); if (this.options.usesNullTypeAnnotations()) {
StringBuilder returnType = new StringBuilder(); StringBuilder returnTypeShort = new StringBuilder(); if (this.options.usesNullTypeAnnotations()) {
StringBuilder returnType = new StringBuilder(); StringBuilder returnTypeShort = new StringBuilder(); if (this.options.usesNullTypeAnnotations()) {
public void nullityMismatchIsNull(Expression expression, TypeBinding requiredType) { int problemId = IProblem.RequiredNonNullButProvidedNull; boolean useNullTypeAnnotations = this.options.usesNullTypeAnnotations(); if (useNullTypeAnnotations && requiredType.isTypeVariable() && !requiredType.hasNullTypeAnnotations()) problemId = IProblem.NullNotCompatibleToFreeTypeVariable; if (requiredType instanceof CaptureBinding) { CaptureBinding capture = (CaptureBinding) requiredType; if (capture.wildcard != null) requiredType = capture.wildcard; } String[] arguments; String[] argumentsShort; if (!useNullTypeAnnotations) { arguments = new String[] { annotatedTypeName(requiredType, this.options.nonNullAnnotationName) }; argumentsShort = new String[] { shortAnnotatedTypeName(requiredType, this.options.nonNullAnnotationName) }; } else { if (problemId == IProblem.NullNotCompatibleToFreeTypeVariable) { arguments = new String[] { new String(requiredType.sourceName()) }; // don't show any bounds argumentsShort = new String[] { new String(requiredType.sourceName()) }; } else { arguments = new String[] { new String(requiredType.nullAnnotatedReadableName(this.options, false)) }; argumentsShort = new String[] { new String(requiredType.nullAnnotatedReadableName(this.options, true)) }; } } this.handle(problemId, arguments, argumentsShort, expression.sourceStart, expression.sourceEnd); } public void nullityMismatchSpecdNullable(Expression expression, TypeBinding requiredType, char[][] annotationName) {
public void nullityMismatchIsNull(Expression expression, TypeBinding requiredType) { int problemId = IProblem.RequiredNonNullButProvidedNull; boolean useNullTypeAnnotations = this.options.usesNullTypeAnnotations(); if (useNullTypeAnnotations && requiredType.isTypeVariable() && !requiredType.hasNullTypeAnnotations()) problemId = IProblem.NullNotCompatibleToFreeTypeVariable; if (requiredType instanceof CaptureBinding) { CaptureBinding capture = (CaptureBinding) requiredType; if (capture.wildcard != null) requiredType = capture.wildcard; } String[] arguments; String[] argumentsShort; if (!useNullTypeAnnotations) { arguments = new String[] { annotatedTypeName(requiredType, this.options.nonNullAnnotationName) }; argumentsShort = new String[] { shortAnnotatedTypeName(requiredType, this.options.nonNullAnnotationName) }; } else { if (problemId == IProblem.NullNotCompatibleToFreeTypeVariable) { arguments = new String[] { new String(requiredType.sourceName()) }; // don't show any bounds argumentsShort = new String[] { new String(requiredType.sourceName()) }; } else { arguments = new String[] { new String(requiredType.nullAnnotatedReadableName(this.options, false)) }; argumentsShort = new String[] { new String(requiredType.nullAnnotatedReadableName(this.options, true)) }; } } this.handle(problemId, arguments, argumentsShort, expression.sourceStart, expression.sourceEnd); } public void nullityMismatchSpecdNullable(Expression expression, TypeBinding requiredType, char[][] annotationName) {
public void nullityMismatchIsNull(Expression expression, TypeBinding requiredType) { int problemId = IProblem.RequiredNonNullButProvidedNull; boolean useNullTypeAnnotations = this.options.usesNullTypeAnnotations(); if (useNullTypeAnnotations && requiredType.isTypeVariable() && !requiredType.hasNullTypeAnnotations()) problemId = IProblem.NullNotCompatibleToFreeTypeVariable; if (requiredType instanceof CaptureBinding) { CaptureBinding capture = (CaptureBinding) requiredType; if (capture.wildcard != null) requiredType = capture.wildcard; } String[] arguments; String[] argumentsShort; if (!useNullTypeAnnotations) { arguments = new String[] { annotatedTypeName(requiredType, this.options.nonNullAnnotationName) }; argumentsShort = new String[] { shortAnnotatedTypeName(requiredType, this.options.nonNullAnnotationName) }; } else { if (problemId == IProblem.NullNotCompatibleToFreeTypeVariable) { arguments = new String[] { new String(requiredType.sourceName()) }; // don't show any bounds argumentsShort = new String[] { new String(requiredType.sourceName()) }; } else { arguments = new String[] { new String(requiredType.nullAnnotatedReadableName(this.options, false)) }; argumentsShort = new String[] { new String(requiredType.nullAnnotatedReadableName(this.options, true)) }; } } this.handle(problemId, arguments, argumentsShort, expression.sourceStart, expression.sourceEnd); } public void nullityMismatchSpecdNullable(Expression expression, TypeBinding requiredType, char[][] annotationName) {
public void nullityMismatchIsNull(Expression expression, TypeBinding requiredType) { int problemId = IProblem.RequiredNonNullButProvidedNull; boolean useNullTypeAnnotations = this.options.usesNullTypeAnnotations(); if (useNullTypeAnnotations && requiredType.isTypeVariable() && !requiredType.hasNullTypeAnnotations()) problemId = IProblem.NullNotCompatibleToFreeTypeVariable; if (requiredType instanceof CaptureBinding) { CaptureBinding capture = (CaptureBinding) requiredType; if (capture.wildcard != null) requiredType = capture.wildcard; } String[] arguments; String[] argumentsShort; if (!useNullTypeAnnotations) { arguments = new String[] { annotatedTypeName(requiredType, this.options.nonNullAnnotationName) }; argumentsShort = new String[] { shortAnnotatedTypeName(requiredType, this.options.nonNullAnnotationName) }; } else { if (problemId == IProblem.NullNotCompatibleToFreeTypeVariable) { arguments = new String[] { new String(requiredType.sourceName()) }; // don't show any bounds argumentsShort = new String[] { new String(requiredType.sourceName()) }; } else { arguments = new String[] { new String(requiredType.nullAnnotatedReadableName(this.options, false)) }; argumentsShort = new String[] { new String(requiredType.nullAnnotatedReadableName(this.options, true)) }; } } this.handle(problemId, arguments, argumentsShort, expression.sourceStart, expression.sourceEnd); } public void nullityMismatchSpecdNullable(Expression expression, TypeBinding requiredType, char[][] annotationName) {
public void nullityMismatchIsNull(Expression expression, TypeBinding requiredType) { int problemId = IProblem.RequiredNonNullButProvidedNull; boolean useNullTypeAnnotations = this.options.usesNullTypeAnnotations(); if (useNullTypeAnnotations && requiredType.isTypeVariable() && !requiredType.hasNullTypeAnnotations()) problemId = IProblem.NullNotCompatibleToFreeTypeVariable; if (requiredType instanceof CaptureBinding) { CaptureBinding capture = (CaptureBinding) requiredType; if (capture.wildcard != null) requiredType = capture.wildcard; } String[] arguments; String[] argumentsShort; if (!useNullTypeAnnotations) { arguments = new String[] { annotatedTypeName(requiredType, this.options.nonNullAnnotationName) }; argumentsShort = new String[] { shortAnnotatedTypeName(requiredType, this.options.nonNullAnnotationName) }; } else { if (problemId == IProblem.NullNotCompatibleToFreeTypeVariable) { arguments = new String[] { new String(requiredType.sourceName()) }; // don't show any bounds argumentsShort = new String[] { new String(requiredType.sourceName()) }; } else { arguments = new String[] { new String(requiredType.nullAnnotatedReadableName(this.options, false)) }; argumentsShort = new String[] { new String(requiredType.nullAnnotatedReadableName(this.options, true)) }; } } this.handle(problemId, arguments, argumentsShort, expression.sourceStart, expression.sourceEnd); } public void nullityMismatchSpecdNullable(Expression expression, TypeBinding requiredType, char[][] annotationName) {
return; if (this.options.usesNullTypeAnnotations()) nullityMismatchingTypeAnnotation(expression, providedType, requiredType, NullAnnotationMatching.NULL_ANNOTATIONS_UNCHECKED); else
return; if (this.options.usesNullTypeAnnotations()) nullityMismatchingTypeAnnotation(expression, providedType, requiredType, NullAnnotationMatching.NULL_ANNOTATIONS_UNCHECKED); else
return; if (this.options.usesNullTypeAnnotations()) nullityMismatchingTypeAnnotation(expression, providedType, requiredType, NullAnnotationMatching.NULL_ANNOTATIONS_UNCHECKED); else
return; if (this.options.usesNullTypeAnnotations()) nullityMismatchingTypeAnnotation(expression, providedType, requiredType, NullAnnotationMatching.NULL_ANNOTATIONS_UNCHECKED); else
return; if (this.options.usesNullTypeAnnotations()) nullityMismatchingTypeAnnotation(expression, providedType, requiredType, NullAnnotationMatching.NULL_ANNOTATIONS_UNCHECKED); else