Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2013-09-05 17:41:03 +0000
committerStephan Herrmann2013-09-05 17:41:03 +0000
commit1538facbe020906d8e9620bcca922106c178a710 (patch)
tree5189bd1597f711822844c229786719ad4bb38c1d
parent87621a357241c8de8ae7bf1f07316036b31e3bf8 (diff)
downloadeclipse.jdt.core-1538facbe020906d8e9620bcca922106c178a710.tar.gz
eclipse.jdt.core-1538facbe020906d8e9620bcca922106c178a710.tar.xz
eclipse.jdt.core-1538facbe020906d8e9620bcca922106c178a710.zip
to nested classes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
index f486b0f24d..13f1227f1e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
@@ -1120,7 +1120,7 @@ void initializeForStaticImports() {
this.scope.buildMethods();
}
-private void initializeNullDefault() {
+private int getNullDefault() {
// ensure nullness defaults are initialized at all enclosing levels:
switch (this.nullnessDefaultInitialized) {
case 0:
@@ -1130,6 +1130,7 @@ private void initializeNullDefault() {
getPackage().isViewedAsDeprecated(); // initialize annotations
this.nullnessDefaultInitialized = 2;
}
+ return this.defaultNullness;
}
/**
@@ -1470,7 +1471,6 @@ public FieldBinding resolveTypeFor(FieldBinding field) {
// enum constants neither have a type declaration nor can they be null
field.tagBits |= TagBits.AnnotationNonNull;
} else {
- initializeNullDefault();
if (hasNonNullDefault()) {
field.fillInDefaultNonNullness(fieldDecl, initializationScope);
}
@@ -1658,7 +1658,7 @@ public MethodBinding resolveTypesFor(MethodBinding method) {
return method;
}
private void createArgumentBindings(MethodBinding method, CompilerOptions compilerOptions) {
- initializeNullDefault();
+ getNullDefault(); // ensure initialized
AbstractMethodDeclaration methodDecl = method.sourceMethod();
if (methodDecl != null) {
// while creating argument bindings we also collect explicit null annotations:
@@ -1728,8 +1728,7 @@ protected void checkRedundantNullnessDefaultRecurse(ASTNode location, Annotation
// return: should caller continue searching?
protected boolean checkRedundantNullnessDefaultOne(ASTNode location, Annotation[] annotations, long annotationTagBits) {
- initializeNullDefault();
- int thisDefault = this.defaultNullness;
+ int thisDefault = getNullDefault();
if (thisDefault == NONNULL_BY_DEFAULT) {
if ((annotationTagBits & TagBits.AnnotationNonNullByDefault) != 0) {
this.scope.problemReporter().nullDefaultAnnotationIsRedundant(location, annotations, this);
@@ -1759,8 +1758,7 @@ boolean hasNonNullDefault() {
case Scope.CLASS_SCOPE:
currentType = ((ClassScope)currentScope).referenceContext.binding;
if (currentType != null) {
- currentType.initializeNullDefault();
- int foundDefaultNullness = currentType.defaultNullness;
+ int foundDefaultNullness = currentType.getNullDefault();
if (foundDefaultNullness != NO_NULL_DEFAULT) {
return foundDefaultNullness == NONNULL_BY_DEFAULT;
}

Back to the top