keywords) {
boolean canBeExplicitConstructorCall = false;
- if((this.lastModifiers & ClassFileConstants.AccStatic) == 0) {
+ if((this.lastModifiers & Flags.STATIC) == 0) {
keywords.add(Keywords.SUPER);
keywords.add(Keywords.THIS);
}
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java
index 2e4d00e0d90..45e65177871 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java
@@ -57,7 +57,6 @@
import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
import org.eclipse.jdt.internal.compiler.ast.TypePattern;
import org.eclipse.jdt.internal.compiler.ast.TypeReference;
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.lookup.Binding;
import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
import org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
@@ -74,12 +73,14 @@
import org.eclipse.jdt.internal.compiler.parser.RecoveredUnit;
import org.eclipse.jdt.internal.compiler.problem.AbortCompilation;
import org.eclipse.jdt.internal.compiler.problem.ProblemReporter;
+
+import com.sun.tools.javac.code.Flags;
public abstract class AssistParser extends Parser {
public ASTNode assistNode;
public boolean isOrphanCompletionNode;
private boolean resumedAfterRepair = false;
// last modifiers info
- protected int lastModifiers = ClassFileConstants.AccDefault;
+ protected int lastModifiers = 0;
protected int lastModifiersStart = -1;
/* recovery */
int[] blockStarts = new int[30];
@@ -1136,7 +1137,7 @@ protected void consumeSingleStaticImportDeclarationName() {
length);
/* build specific assist node on import statement */
- ImportReference reference = createAssistImportReference(subset, positions, ClassFileConstants.AccStatic);
+ ImportReference reference = createAssistImportReference(subset, positions, Flags.STATIC);
this.assistNode = reference;
this.lastCheckPoint = reference.sourceEnd + 1;
@@ -1289,7 +1290,7 @@ protected void consumeSingleTypeImportDeclarationName() {
length);
/* build specific assist node on import statement */
- ImportReference reference = createAssistImportReference(subset, positions, ClassFileConstants.AccDefault);
+ ImportReference reference = createAssistImportReference(subset, positions, 0);
this.assistNode = reference;
this.lastCheckPoint = reference.sourceEnd + 1;
@@ -1341,7 +1342,7 @@ protected void consumeStaticImportOnDemandDeclarationName() {
length);
/* build specific assist node on import statement */
- ImportReference reference = createAssistImportReference(subset, positions, ClassFileConstants.AccStatic);
+ ImportReference reference = createAssistImportReference(subset, positions, Flags.STATIC);
reference.bits |= ASTNode.OnDemand;
// star end position
reference.trailingStarPosition = this.intStack[this.intPtr--];
@@ -1477,7 +1478,7 @@ protected void consumeTypeImportOnDemandDeclarationName() {
length);
/* build specific assist node on import statement */
- ImportReference reference = createAssistImportReference(subset, positions, ClassFileConstants.AccDefault);
+ ImportReference reference = createAssistImportReference(subset, positions, 0);
reference.bits |= ASTNode.OnDemand;
// star end position
reference.trailingStarPosition = this.intStack[this.intPtr--];
@@ -2490,7 +2491,7 @@ protected int resumeAfterRecovery() {
this.valueLambdaNestDepth = -1;
- this.modifiers = ClassFileConstants.AccDefault;
+ this.modifiers = 0;
this.modifiersSourceStart = -1;
// if in diet mode, reset the diet counter because we're going to restart outside an initializer.
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java
index 02c6c18ad45..42ba623596b 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/Engine.java
@@ -19,7 +19,6 @@
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.internal.compiler.*;
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.env.*;
import org.eclipse.jdt.internal.compiler.ast.*;
@@ -33,6 +32,8 @@
import org.eclipse.jdt.internal.core.SourceType;
import org.eclipse.jdt.internal.core.SourceTypeElementInfo;
+import com.sun.tools.javac.code.Flags;
+
public abstract class Engine implements ITypeRequestor {
public LookupEnvironment lookupEnvironment;
@@ -247,7 +248,7 @@ protected boolean mustQualifyType(
}
if(CharOperation.equals(fullyQualifiedEnclosingTypeName, importFlatName)) {
if(importBinding.isStatic()) {
- isFound = (modifiers & ClassFileConstants.AccStatic) != 0;
+ isFound = (modifiers & Flags.STATIC) != 0;
} else {
isFound = true;
}
@@ -257,7 +258,7 @@ protected boolean mustQualifyType(
if(enclosingTypeNames == null || enclosingTypeNames.length == 0) {
if(CharOperation.equals(packageName, importFlatName)) {
if(importBinding.isStatic()) {
- isFound = (modifiers & ClassFileConstants.AccStatic) != 0;
+ isFound = (modifiers & Flags.STATIC) != 0;
} else {
isFound = true;
}
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageReference.java
index ef874f0f3a5..e154eb9649c 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageReference.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageReference.java
@@ -33,11 +33,10 @@
*/
import org.eclipse.jdt.internal.compiler.ast.ImportReference;
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
public class SelectionOnPackageReference extends ImportReference {
public SelectionOnPackageReference(char[][] tokens , long[] positions) {
- super(tokens, positions, false, ClassFileConstants.AccDefault);
+ super(tokens, positions, false, 0);
}
@Override
public StringBuffer print(int tab, StringBuffer output, boolean withOnDemand) {
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java
index e12dbe6fcfe..b48eae3c5d3 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java
@@ -1280,7 +1280,7 @@ protected void consumeStaticImportOnDemandDeclarationName() {
length);
/* build specific assist node on import statement */
- ImportReference reference = createAssistImportReference(subset, positions, ClassFileConstants.AccStatic);
+ ImportReference reference = createAssistImportReference(subset, positions, com.sun.tools.javac.code.Flags.STATIC);
reference.bits |= ASTNode.OnDemand;
// star end position
reference.trailingStarPosition = this.intStack[this.intPtr--];
@@ -1383,7 +1383,7 @@ protected void consumeTypeImportOnDemandDeclarationName() {
length);
/* build specific assist node on import statement */
- ImportReference reference = createAssistImportReference(subset, positions, ClassFileConstants.AccDefault);
+ ImportReference reference = createAssistImportReference(subset, positions, 0);
reference.bits |= ASTNode.OnDemand;
// star end position
reference.trailingStarPosition = this.intStack[this.intPtr--];
@@ -1757,7 +1757,7 @@ protected Argument typeElidedArgument() {
identifierName,
namePositions,
null, // elided type
- ClassFileConstants.AccDefault,
+ 0,
true);
argument.declarationSourceStart = (int) (namePositions >>> 32);
this.assistNode = argument;
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java
index a3f17373635..793e7ccd2f8 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java
@@ -75,6 +75,8 @@
import org.eclipse.jdt.internal.core.dom.util.DOMASTUtil;
import org.eclipse.jdt.internal.core.util.Util;
+import com.sun.tools.javac.code.Flags;
+
/**
* Internal class for converting internal compiler ASTs into public ASTs.
*/
@@ -756,10 +758,10 @@ public ASTNode convert(boolean isInterface, org.eclipse.jdt.internal.compiler.as
}
}
if (block != null) {
- if ((methodDeclaration.modifiers & (ClassFileConstants.AccAbstract | ClassFileConstants.AccNative)) != 0
+ if ((methodDeclaration.modifiers & (Flags.ABSTRACT | Flags.NATIVE)) != 0
|| (isInterface && (this.ast.apiLevel < AST.JLS8_INTERNAL ||
- (methodDeclaration.modifiers & (ClassFileConstants.AccStatic | ExtraCompilerModifiers.AccDefaultMethod |
- (this.ast.apiLevel > AST.JLS8_INTERNAL ? ClassFileConstants.AccPrivate : 0))) == 0))) {
+ (methodDeclaration.modifiers & (Flags.STATIC | ExtraCompilerModifiers.AccDefaultMethod |
+ (this.ast.apiLevel > AST.JLS8_INTERNAL ? Flags.PRIVATE : 0))) == 0))) {
methodDecl.setFlags(methodDecl.getFlags() | ASTNode.MALFORMED);
}
}
@@ -3593,13 +3595,13 @@ public ImportDeclaration convertImport(org.eclipse.jdt.internal.compiler.ast.Imp
importDeclaration.setSourceRange(importReference.declarationSourceStart, importReference.declarationEnd - importReference.declarationSourceStart + 1);
importDeclaration.setOnDemand(onDemand);
int modifiers = importReference.modifiers;
- if (modifiers != ClassFileConstants.AccDefault) {
+ if (modifiers != 0) {
switch(this.ast.apiLevel) {
case AST.JLS2_INTERNAL :
importDeclaration.setFlags(importDeclaration.getFlags() | ASTNode.MALFORMED);
break;
default :
- if (modifiers == ClassFileConstants.AccStatic) {
+ if (modifiers == Flags.STATIC) {
importDeclaration.setStatic(true);
} else {
importDeclaration.setFlags(importDeclaration.getFlags() | ASTNode.MALFORMED);
@@ -6175,7 +6177,7 @@ protected void setModifiers(TypeDeclaration typeDecl, org.eclipse.jdt.internal.c
switch(this.ast.apiLevel) {
case AST.JLS2_INTERNAL :
int modifiers = typeDeclaration.modifiers;
- modifiers &= ~ClassFileConstants.AccInterface; // remove AccInterface flags
+ modifiers &= ~Flags.INTERFACE; // remove AccInterface flags
modifiers &= ExtraCompilerModifiers.AccJustFlag;
typeDecl.internalSetModifiers(modifiers);
if (typeDeclaration.annotations != null) {
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BindingComparator.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BindingComparator.java
index 8110b453383..7790e8161d3 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BindingComparator.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BindingComparator.java
@@ -16,7 +16,6 @@
import java.util.HashSet;
import org.eclipse.jdt.core.compiler.CharOperation;
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.lookup.Binding;
import org.eclipse.jdt.internal.compiler.lookup.CaptureBinding;
import org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
@@ -28,6 +27,8 @@
import org.eclipse.jdt.internal.compiler.lookup.VariableBinding;
import org.eclipse.jdt.internal.compiler.lookup.WildcardBinding;
+import com.sun.tools.javac.code.Flags;
+
/**
* Internal helper class for comparing bindings.
*
@@ -221,8 +222,8 @@ static boolean isEqual(org.eclipse.jdt.internal.compiler.lookup.TypeBinding type
ParameterizedTypeBinding parameterizedTypeBinding = (ParameterizedTypeBinding) typeBinding;
ParameterizedTypeBinding parameterizedTypeBinding2 = (ParameterizedTypeBinding) typeBinding2;
return CharOperation.equals(parameterizedTypeBinding.compoundName, parameterizedTypeBinding2.compoundName)
- && (parameterizedTypeBinding.modifiers & (ExtraCompilerModifiers.AccJustFlag | ClassFileConstants.AccInterface | ClassFileConstants.AccEnum | ClassFileConstants.AccAnnotation))
- == (parameterizedTypeBinding2.modifiers & (ExtraCompilerModifiers.AccJustFlag | ClassFileConstants.AccInterface | ClassFileConstants.AccEnum | ClassFileConstants.AccAnnotation))
+ && (parameterizedTypeBinding.modifiers & (ExtraCompilerModifiers.AccJustFlag | Flags.INTERFACE | Flags.ENUM | Flags.ANNOTATION))
+ == (parameterizedTypeBinding2.modifiers & (ExtraCompilerModifiers.AccJustFlag | Flags.INTERFACE | Flags.ENUM | Flags.ANNOTATION))
&& isEqual(parameterizedTypeBinding.arguments, parameterizedTypeBinding2.arguments, visitedTypes)
&& isEqual(parameterizedTypeBinding.enclosingType(), parameterizedTypeBinding2.enclosingType(), visitedTypes);
@@ -281,8 +282,8 @@ && isEqual(typeVariableBinding.superclass(), typeVariableBinding2.superclass(),
ReferenceBinding referenceBinding = (ReferenceBinding) typeBinding;
ReferenceBinding referenceBinding2 = (ReferenceBinding) typeBinding2;
return CharOperation.equals(referenceBinding.compoundName, referenceBinding2.compoundName)
- && (referenceBinding.modifiers & (ExtraCompilerModifiers.AccJustFlag | ClassFileConstants.AccInterface | ClassFileConstants.AccEnum | ClassFileConstants.AccAnnotation))
- == (referenceBinding2.modifiers & (ExtraCompilerModifiers.AccJustFlag | ClassFileConstants.AccInterface | ClassFileConstants.AccEnum | ClassFileConstants.AccAnnotation))
+ && (referenceBinding.modifiers & (ExtraCompilerModifiers.AccJustFlag | Flags.INTERFACE | Flags.ENUM | Flags.ANNOTATION))
+ == (referenceBinding2.modifiers & (ExtraCompilerModifiers.AccJustFlag | Flags.INTERFACE | Flags.ENUM | Flags.ANNOTATION))
&& isEqual(referenceBinding.typeVariables(), referenceBinding2.typeVariables(), visitedTypes)
&& isEqual(referenceBinding.enclosingType(), referenceBinding2.enclosingType(), visitedTypes);
@@ -314,8 +315,8 @@ && isEqual(referenceBinding.typeVariables(), referenceBinding2.typeVariables(),
return CharOperation.equals(referenceBinding.compoundName, referenceBinding2.compoundName)
&& (!referenceBinding2.isGenericType())
&& (referenceBinding.isRawType() == referenceBinding2.isRawType())
- && ((referenceBinding.modifiers & ~ClassFileConstants.AccSuper) & (ExtraCompilerModifiers.AccJustFlag | ClassFileConstants.AccInterface | ClassFileConstants.AccEnum | ClassFileConstants.AccAnnotation))
- == ((referenceBinding2.modifiers & ~ClassFileConstants.AccSuper) & (ExtraCompilerModifiers.AccJustFlag | ClassFileConstants.AccInterface | ClassFileConstants.AccEnum | ClassFileConstants.AccAnnotation))
+ && ((referenceBinding.modifiers & ~Flags.ACC_SUPER) & (ExtraCompilerModifiers.AccJustFlag | Flags.INTERFACE | Flags.ENUM | Flags.ANNOTATION))
+ == ((referenceBinding2.modifiers & ~Flags.ACC_SUPER) & (ExtraCompilerModifiers.AccJustFlag | Flags.INTERFACE | Flags.ENUM | Flags.ANNOTATION))
&& isEqual(referenceBinding.enclosingType(), referenceBinding2.enclosingType(), visitedTypes);
}
}
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodBinding.java
index f807e6d3149..a9645c6c8a8 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodBinding.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodBinding.java
@@ -19,7 +19,6 @@
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.compiler.CharOperation;
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
import org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
import org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding;
@@ -33,6 +32,8 @@
import org.eclipse.jdt.internal.core.JavaElement;
import org.eclipse.jdt.internal.core.util.Util;
+import com.sun.tools.javac.code.Flags;
+
/**
* Internal implementation of method bindings.
*/
@@ -551,7 +552,7 @@ public LambdaMethod(DefaultBindingResolver resolver,
*/
@Override
public int getModifiers() {
- return super.getModifiers() & ~ClassFileConstants.AccAbstract;
+ return super.getModifiers() & ~Flags.ABSTRACT;
}
/**
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java
index b11bc305a54..9e2c0d1c325 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java
@@ -22,7 +22,6 @@
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.internal.compiler.ast.StringLiteral;
import org.eclipse.jdt.internal.compiler.ast.Wildcard;
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.lookup.ArrayBinding;
import org.eclipse.jdt.internal.compiler.lookup.BaseTypeBinding;
import org.eclipse.jdt.internal.compiler.lookup.Binding;
@@ -46,6 +45,8 @@
import org.eclipse.jdt.internal.core.JavaElement;
import org.eclipse.jdt.internal.core.PackageFragment;
+import com.sun.tools.javac.code.Flags;
+
/**
* Internal implementation of type bindings.
*/
@@ -611,17 +612,17 @@ public int getModifiers() {
ReferenceBinding referenceBinding = (ReferenceBinding) this.binding;
final int accessFlags = referenceBinding.getAccessFlags() & VALID_MODIFIERS;
// clear the AccAbstract, AccAnnotation and the AccInterface bits
- return accessFlags & ~(ClassFileConstants.AccAbstract | ClassFileConstants.AccInterface | ClassFileConstants.AccAnnotation);
+ return accessFlags & ~(Flags.ABSTRACT | Flags.INTERFACE | Flags.ANNOTATION);
} else if (isInterface()) {
ReferenceBinding referenceBinding = (ReferenceBinding) this.binding;
final int accessFlags = referenceBinding.getAccessFlags() & VALID_MODIFIERS;
// clear the AccAbstract and the AccInterface bits
- return accessFlags & ~(ClassFileConstants.AccAbstract | ClassFileConstants.AccInterface);
+ return accessFlags & ~(Flags.ABSTRACT | Flags.INTERFACE);
} else if (isEnum()) {
ReferenceBinding referenceBinding = (ReferenceBinding) this.binding;
final int accessFlags = referenceBinding.getAccessFlags() & VALID_MODIFIERS;
// clear the AccEnum bits
- return accessFlags & ~ClassFileConstants.AccEnum;
+ return accessFlags & ~Flags.ENUM;
} else {
return Modifier.NONE;
}
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableBinding.java
index 8924a4fde60..7aa7a7a9166 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableBinding.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableBinding.java
@@ -21,7 +21,6 @@
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.util.IModifierConstants;
import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.impl.Constant;
import org.eclipse.jdt.internal.compiler.impl.ReferenceContext;
import org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
@@ -33,6 +32,8 @@
import org.eclipse.jdt.internal.core.LocalVariable;
import org.eclipse.jdt.internal.core.util.Util;
+import com.sun.tools.javac.code.Flags;
+
/**
* Internal implementation of variable bindings.
*/
@@ -333,7 +334,7 @@ public boolean isDeprecated() {
@Override
public boolean isEnumConstant() {
- return (this.binding.modifiers & ClassFileConstants.AccEnum) != 0;
+ return (this.binding.modifiers & Flags.ENUM) != 0;
}
@Override
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.java
index ca194ed5a15..f8e7ccbf3a7 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.java
@@ -45,6 +45,7 @@
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
import org.eclipse.jdt.internal.compiler.lookup.TypeConstants;
+import com.sun.tools.javac.code.Flags;
import com.sun.tools.javac.jvm.ByteCodes;
public class CodeSnippetAllocationExpression extends AllocationExpression implements ProblemReasons, EvaluationConstants {
@@ -149,7 +150,7 @@ public TypeBinding resolveType(BlockScope scope) {
if (currentType == null) return currentType;
do {
// isStatic() is answering true for toplevel types
- if ((currentType.modifiers & ClassFileConstants.AccStatic) != 0) break checkParameterizedAllocation;
+ if ((currentType.modifiers & Flags.STATIC) != 0) break checkParameterizedAllocation;
if (currentType.isRawType()) break checkParameterizedAllocation;
} while ((currentType = currentType.enclosingType())!= null);
ParameterizedQualifiedTypeReference qRef = (ParameterizedQualifiedTypeReference) this.type;
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.java
index 6d404446652..c51a5f07104 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.java
@@ -34,6 +34,8 @@
import org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding;
import org.eclipse.jdt.internal.compiler.util.Util;
+import com.sun.tools.javac.code.Flags;
+
public class CodeSnippetClassFile extends ClassFile {
/**
* CodeSnippetClassFile constructor comment.
@@ -74,25 +76,25 @@ public CodeSnippetClassFile(
int accessFlags = aType.getAccessFlags();
if (!aType.isInterface()) { // class or enum
- accessFlags |= ClassFileConstants.AccSuper;
+ accessFlags |= Flags.ACC_SUPER;
}
if (aType.isNestedType()) {
if (aType.isStatic()) {
// clear Acc_Static
- accessFlags &= ~ClassFileConstants.AccStatic;
+ accessFlags &= ~Flags.STATIC;
}
if (aType.isPrivate()) {
// clear Acc_Private and Acc_Public
- accessFlags &= ~(ClassFileConstants.AccPrivate | ClassFileConstants.AccPublic);
+ accessFlags &= ~(Flags.PRIVATE | Flags.PUBLIC);
}
if (aType.isProtected()) {
// clear Acc_Protected and set Acc_Public
- accessFlags &= ~ClassFileConstants.AccProtected;
- accessFlags |= ClassFileConstants.AccPublic;
+ accessFlags &= ~Flags.PROTECTED;
+ accessFlags |= Flags.PUBLIC;
}
}
// clear Acc_Strictfp
- accessFlags &= ~ClassFileConstants.AccStrictfp;
+ accessFlags &= ~Flags.STRICTFP;
this.enclosingClassFile = enclosingClassFile;
// now we continue to generate the bytes inside the contents array
@@ -205,7 +207,7 @@ public static void createProblemType(TypeDeclaration typeDeclaration, Compilatio
MethodBinding method = methodDecl.binding;
if (method == null) continue;
if (abstractMethodsOnly) {
- method.modifiers = ClassFileConstants.AccPublic | ClassFileConstants.AccAbstract;
+ method.modifiers = Flags.PUBLIC | Flags.ABSTRACT;
}
if (method.isConstructor()) {
if (typeBinding.isInterface()) continue;
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetScope.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetScope.java
index 1f7426124a7..46ed22e8aae 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetScope.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetScope.java
@@ -18,7 +18,6 @@
package org.eclipse.jdt.internal.eval;
import org.eclipse.jdt.core.compiler.CharOperation;
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.lookup.ArrayBinding;
import org.eclipse.jdt.internal.compiler.lookup.Binding;
import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
@@ -37,6 +36,8 @@
import org.eclipse.jdt.internal.compiler.lookup.TypeConstants;
import org.eclipse.jdt.internal.compiler.lookup.VariableBinding;
+import com.sun.tools.javac.code.Flags;
+
/**
* This scope is used for code snippet lookup to emulate private, protected and default access.
* These accesses inside inner classes are not managed yet.
@@ -392,7 +393,7 @@ public MethodBinding findMethodForArray(ArrayBinding receiverType, char[] select
if (methodBinding != null) {
// handle the method clone() specially... cannot be protected or throw exceptions
if (argumentTypes == Binding.NO_PARAMETERS && CharOperation.equals(selector, TypeConstants.CLONE))
- return new MethodBinding((methodBinding.modifiers & ~ClassFileConstants.AccProtected) | ClassFileConstants.AccPublic, TypeConstants.CLONE, methodBinding.returnType, argumentTypes, null, object);
+ return new MethodBinding((methodBinding.modifiers & ~Flags.PROTECTED) | Flags.PUBLIC, TypeConstants.CLONE, methodBinding.returnType, argumentTypes, null, object);
if (canBeSeenByForCodeSnippet(methodBinding, receiverType, invocationSite, this))
return methodBinding;
}
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.java
index 370ff3e5e41..af75a8f41a0 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.java
@@ -21,7 +21,6 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.compiler.CharOperation;
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.env.IBinaryAnnotation;
import org.eclipse.jdt.internal.compiler.env.IBinaryField;
import org.eclipse.jdt.internal.compiler.env.IBinaryMethod;
@@ -34,6 +33,8 @@
import org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
import org.eclipse.jdt.internal.core.util.Util;
+import com.sun.tools.javac.code.Flags;
+
/**
* The skeleton of the class 'org.eclipse.jdt.internal.eval.target.CodeSnippet'
* used at compile time. Note that the method run() is declared to
@@ -79,7 +80,7 @@ public char[] getMethodDescriptor() {
}
@Override
public int getModifiers() {
- return ClassFileConstants.AccPublic;
+ return Flags.PUBLIC;
}
@Override
public IBinaryAnnotation[] getParameterAnnotations(int index, char[] classFileName) {
@@ -189,7 +190,7 @@ public IBinaryMethod[] getMethods() {
}
@Override
public int getModifiers() {
- return ClassFileConstants.AccPublic;
+ return Flags.PUBLIC;
}
@Override
public char[][][] getMissingTypeNames() {
diff --git a/org.eclipse.jdt.core/jdtCompilerAdapter.jar b/org.eclipse.jdt.core/jdtCompilerAdapter.jar
index 7961778ad41..824eeeac801 100644
Binary files a/org.eclipse.jdt.core/jdtCompilerAdapter.jar and b/org.eclipse.jdt.core/jdtCompilerAdapter.jar differ
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Flags.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Flags.java
index 3f0be8e5f27..5e2cdbc7e4d 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Flags.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Flags.java
@@ -43,77 +43,77 @@ public final class Flags {
* Constant representing the absence of any flag.
* @since 3.0
*/
- public static final int AccDefault = ClassFileConstants.AccDefault;
+ public static final int AccDefault = 0;
/**
* Public access flag. See The Java Virtual Machine Specification for more details.
* @since 2.0
*/
- public static final int AccPublic = ClassFileConstants.AccPublic;
+ public static final int AccPublic = com.sun.tools.javac.code.Flags.PUBLIC;
/**
* Private access flag. See The Java Virtual Machine Specification for more details.
* @since 2.0
*/
- public static final int AccPrivate = ClassFileConstants.AccPrivate;
+ public static final int AccPrivate = com.sun.tools.javac.code.Flags.PRIVATE;
/**
* Protected access flag. See The Java Virtual Machine Specification for more details.
* @since 2.0
*/
- public static final int AccProtected = ClassFileConstants.AccProtected;
+ public static final int AccProtected = com.sun.tools.javac.code.Flags.PROTECTED;
/**
* Static access flag. See The Java Virtual Machine Specification for more details.
* @since 2.0
*/
- public static final int AccStatic = ClassFileConstants.AccStatic;
+ public static final int AccStatic = com.sun.tools.javac.code.Flags.STATIC;
/**
* Final access flag. See The Java Virtual Machine Specification for more details.
* @since 2.0
*/
- public static final int AccFinal = ClassFileConstants.AccFinal;
+ public static final int AccFinal = com.sun.tools.javac.code.Flags.FINAL;
/**
* Synchronized access flag. See The Java Virtual Machine Specification for more details.
* @since 2.0
*/
- public static final int AccSynchronized = ClassFileConstants.AccSynchronized;
+ public static final int AccSynchronized = com.sun.tools.javac.code.Flags.SYNCHRONIZED;
/**
* Volatile property flag. See The Java Virtual Machine Specification for more details.
* @since 2.0
*/
- public static final int AccVolatile = ClassFileConstants.AccVolatile;
+ public static final int AccVolatile = com.sun.tools.javac.code.Flags.VOLATILE;
/**
* Transient property flag. See The Java Virtual Machine Specification for more details.
* @since 2.0
*/
- public static final int AccTransient = ClassFileConstants.AccTransient;
+ public static final int AccTransient = com.sun.tools.javac.code.Flags.TRANSIENT;
/**
* Native property flag. See The Java Virtual Machine Specification for more details.
* @since 2.0
*/
- public static final int AccNative = ClassFileConstants.AccNative;
+ public static final int AccNative = com.sun.tools.javac.code.Flags.NATIVE;
/**
* Interface property flag. See The Java Virtual Machine Specification for more details.
* @since 2.0
*/
- public static final int AccInterface = ClassFileConstants.AccInterface;
+ public static final int AccInterface = com.sun.tools.javac.code.Flags.INTERFACE;
/**
* Abstract property flag. See The Java Virtual Machine Specification for more details.
* @since 2.0
*/
- public static final int AccAbstract = ClassFileConstants.AccAbstract;
+ public static final int AccAbstract = com.sun.tools.javac.code.Flags.ABSTRACT;
/**
* Strictfp property flag. See The Java Virtual Machine Specification for more details.
* @since 2.0
*/
- public static final int AccStrictfp = ClassFileConstants.AccStrictfp;
+ public static final int AccStrictfp = com.sun.tools.javac.code.Flags.STRICTFP;
/**
* Super property flag. See The Java Virtual Machine Specification for more details.
* @since 2.0
*/
- public static final int AccSuper = ClassFileConstants.AccSuper;
+ public static final int AccSuper = com.sun.tools.javac.code.Flags.ACC_SUPER;
/**
* Synthetic property flag. See The Java Virtual Machine Specification for more details.
* @since 2.0
*/
- public static final int AccSynthetic = ClassFileConstants.AccSynthetic;
+ public static final int AccSynthetic = com.sun.tools.javac.code.Flags.SYNTHETIC;
/**
* Deprecated property flag.
*
@@ -130,7 +130,7 @@ public final class Flags {
* See The Java Virtual Machine Specification for more details.
* @since 3.0
*/
- public static final int AccBridge = ClassFileConstants.AccBridge;
+ public static final int AccBridge = com.sun.tools.javac.code.Flags.ACC_BRIDGE;
/**
* Varargs method property flag (added in J2SE 1.5).
@@ -138,21 +138,21 @@ public final class Flags {
* See The Java Virtual Machine Specification for more details.
* @since 3.0
*/
- public static final int AccVarargs = ClassFileConstants.AccVarargs;
+ public static final int AccVarargs = com.sun.tools.javac.code.Flags.ACC_VARARGS;
/**
* Enum property flag (added in J2SE 1.5).
* See The Java Virtual Machine Specification for more details.
* @since 3.0
*/
- public static final int AccEnum = ClassFileConstants.AccEnum;
+ public static final int AccEnum = com.sun.tools.javac.code.Flags.ENUM;
/**
* Annotation property flag (added in J2SE 1.5).
* See The Java Virtual Machine Specification for more details.
* @since 3.0
*/
- public static final int AccAnnotation = ClassFileConstants.AccAnnotation;
+ public static final int AccAnnotation = com.sun.tools.javac.code.Flags.ANNOTATION;
/**
* Default method property flag.
@@ -181,7 +181,7 @@ public final class Flags {
*
* @since 3.14
*/
- public static final int AccModule = ClassFileConstants.AccModule;
+ public static final int AccModule = com.sun.tools.javac.code.Flags.ACC_MODULE;
/**
* Record property flag.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/DocumentElementParser.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/DocumentElementParser.java
index e10a6f1f621..3b068c4df7d 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/DocumentElementParser.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/DocumentElementParser.java
@@ -23,6 +23,8 @@
import org.eclipse.jdt.internal.compiler.problem.*;
import org.eclipse.jdt.internal.compiler.util.Util;
+import com.sun.tools.javac.code.Flags;
+
public class DocumentElementParser extends Parser {
IDocumentElementRequestor requestor;
private int lastFieldEndPosition;
@@ -906,7 +908,7 @@ protected void consumeInterfaceHeaderName1() {
this.intPtr--;
int declSourceStart = this.intStack[this.intPtr--];
typeDecl.modifiersSourceStart = this.intStack[this.intPtr--];
- typeDecl.modifiers = this.intStack[this.intPtr--] | ClassFileConstants.AccInterface;
+ typeDecl.modifiers = this.intStack[this.intPtr--] | Flags.INTERFACE;
if (typeDecl.declarationSourceStart > declSourceStart) {
typeDecl.declarationSourceStart = declSourceStart;
}
@@ -1216,7 +1218,7 @@ protected void consumeSingleStaticImportDeclarationName() {
CharOperation.concatWith(importReference.getImportName(), '.'),
importReference.sourceStart,
false,
- ClassFileConstants.AccStatic);
+ Flags.STATIC);
}
/*
*
@@ -1238,7 +1240,7 @@ protected void consumeSingleTypeImportDeclarationName() {
CharOperation.concatWith(importReference.getImportName(), '.'),
importReference.sourceStart,
false,
- ClassFileConstants.AccDefault);
+ 0);
}
@Override
protected void consumeStaticImportOnDemandDeclarationName() {
@@ -1256,7 +1258,7 @@ protected void consumeStaticImportOnDemandDeclarationName() {
CharOperation.concatWith(importReference.getImportName(), '.'),
importReference.sourceStart,
true,
- ClassFileConstants.AccStatic);
+ Flags.STATIC);
}
/*
*
@@ -1273,7 +1275,7 @@ protected void consumeStaticInitializer() {
initializer.declarationSourceStart,
initializer.declarationSourceEnd,
this.intArrayStack[this.intArrayPtr--],
- ClassFileConstants.AccStatic,
+ Flags.STATIC,
this.intStack[this.intPtr--],
initializer.block.sourceStart,
initializer.declarationSourceEnd);
@@ -1310,7 +1312,7 @@ protected void consumeTypeImportOnDemandDeclarationName() {
CharOperation.concatWith(importReference.getImportName(), '.'),
importReference.sourceStart,
true,
- ClassFileConstants.AccDefault);
+ 0);
}
/*
* Flush javadocs defined prior to a given positions.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/ExtraFlags.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/ExtraFlags.java
index 7c41d65318c..d164845461a 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/ExtraFlags.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/ExtraFlags.java
@@ -16,10 +16,11 @@
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader;
import org.eclipse.jdt.internal.compiler.env.IBinaryNestedType;
+import com.sun.tools.javac.code.Flags;
+
public final class ExtraFlags {
public final static int HasNonPrivateStaticMemberTypes = 0x0001;
public final static int IsMemberType = 0x0002;
@@ -45,7 +46,7 @@ public static int getExtraFlags(ClassFileReader reader) {
done : for (int i = 0; i < memberTypeCounter; i++) {
int modifiers = memberTypes[i].getModifiers();
// if the member type is static and not private
- if ((modifiers & ClassFileConstants.AccStatic) != 0 && (modifiers & ClassFileConstants.AccPrivate) == 0) {
+ if ((modifiers & Flags.STATIC) != 0 && (modifiers & Flags.PRIVATE) == 0) {
extraFlags |= ExtraFlags.HasNonPrivateStaticMemberTypes;
break done;
}
@@ -73,7 +74,7 @@ public static int getExtraFlags(IType type) throws JavaModelException {
done : for (int i = 0; i < memberTypeCounter; i++) {
int flags = memberTypes[i].getFlags();
// if the member type is static and not private
- if ((flags & ClassFileConstants.AccStatic) != 0 && (flags & ClassFileConstants.AccPrivate) == 0 ) {
+ if ((flags & Flags.STATIC) != 0 && (flags & Flags.PRIVATE) == 0 ) {
extraFlags |= ExtraFlags.HasNonPrivateStaticMemberTypes;
break done;
}
@@ -95,7 +96,7 @@ public static int getExtraFlags(TypeDeclaration typeDeclaration) {
done : for (int i = 0; i < memberTypeCounter; i++) {
int modifiers = memberTypes[i].modifiers;
// if the member type is static and not private
- if ((modifiers & ClassFileConstants.AccStatic) != 0 && (modifiers & ClassFileConstants.AccPrivate) == 0) {
+ if ((modifiers & Flags.STATIC) != 0 && (modifiers & Flags.PRIVATE) == 0) {
extraFlags |= ExtraFlags.HasNonPrivateStaticMemberTypes;
break done;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementNotifier.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementNotifier.java
index e530a647263..0b2b1716840 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementNotifier.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementNotifier.java
@@ -56,6 +56,8 @@
import org.eclipse.jdt.internal.compiler.lookup.TypeConstants;
import org.eclipse.jdt.internal.compiler.util.HashtableOfObjectToInt;
+import com.sun.tools.javac.code.Flags;
+
@SuppressWarnings({"rawtypes", "unchecked"})
public class SourceElementNotifier {
/**
@@ -306,7 +308,7 @@ protected void notifySourceElementRequestor(AbstractMethodDeclaration methodDecl
int currentModifiers = methodDeclaration.modifiers;
currentModifiers &= ExtraCompilerModifiers.AccJustFlag | ClassFileConstants.AccDeprecated;
if (isVarArgs)
- currentModifiers |= ClassFileConstants.AccVarargs;
+ currentModifiers |= Flags.ACC_VARARGS;
if (hasDeprecatedAnnotation(methodDeclaration.annotations))
currentModifiers |= ClassFileConstants.AccDeprecated;
@@ -362,7 +364,7 @@ protected void notifySourceElementRequestor(AbstractMethodDeclaration methodDecl
int currentModifiers = methodDeclaration.modifiers;
currentModifiers &= ExtraCompilerModifiers.AccJustFlag | ClassFileConstants.AccDeprecated | ClassFileConstants.AccAnnotationDefault | ExtraCompilerModifiers.AccDefaultMethod;
if (isVarArgs)
- currentModifiers |= ClassFileConstants.AccVarargs;
+ currentModifiers |= Flags.ACC_VARARGS;
if (hasDeprecatedAnnotation(methodDeclaration.annotations))
currentModifiers |= ClassFileConstants.AccDeprecated;
@@ -531,7 +533,7 @@ protected void notifySourceElementRequestor(FieldDeclaration fieldDeclaration, T
if (fieldDeclaration.type == null) {
// enum constant
typeName = declaringType.name;
- currentModifiers |= ClassFileConstants.AccEnum;
+ currentModifiers |= Flags.ENUM;
} else {
// regular field
typeName = CharOperation.concatWith(fieldDeclaration.type.getParameterizedTypeName(), '.');
@@ -696,7 +698,7 @@ protected void notifySourceElementRequestor(TypeDeclaration typeDeclaration, boo
boolean isEnumInit = typeDeclaration.allocation != null && typeDeclaration.allocation.enumConstant != null;
char[] superclassName;
if (isEnumInit) {
- currentModifiers |= ClassFileConstants.AccEnum;
+ currentModifiers |= Flags.ENUM;
superclassName = declaringType.name;
} else {
superclassName = getSuperclassName(typeDeclaration);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementParser.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementParser.java
index a2b76fb20d4..54ebac3be93 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementParser.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementParser.java
@@ -30,6 +30,8 @@
import org.eclipse.jdt.internal.core.util.CommentRecorderParser;
import org.eclipse.jdt.internal.core.util.Messages;
+import com.sun.tools.javac.code.Flags;
+
/**
* A source element parser extracts structural and reference information
* from a piece of source.
@@ -626,9 +628,9 @@ protected void consumeSingleStaticImportDeclarationName() {
long[] positions = new long[length];
System.arraycopy(this.identifierStack, this.identifierPtr + 1, tokens, 0, length);
System.arraycopy(this.identifierPositionStack, this.identifierPtr + 1, positions, 0, length);
- pushOnAstStack(impt = newImportReference(tokens, positions, false, ClassFileConstants.AccStatic));
+ pushOnAstStack(impt = newImportReference(tokens, positions, false, Flags.STATIC));
- this.modifiers = ClassFileConstants.AccDefault;
+ this.modifiers = 0;
this.modifiersSourceStart = -1; // <-- see comment into modifiersFlag(int)
if (this.currentToken == TokenNameSEMICOLON){
@@ -643,7 +645,7 @@ protected void consumeSingleStaticImportDeclarationName() {
if(!this.statementRecoveryActivated &&
this.options.sourceLevel < ClassFileConstants.JDK1_5 &&
this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
- impt.modifiers = ClassFileConstants.AccDefault; // convert the static import reference to a non-static importe reference
+ impt.modifiers = 0; // convert the static import reference to a non-static importe reference
problemReporter().invalidUsageOfStaticImports(impt);
}
@@ -688,7 +690,7 @@ protected void consumeSingleTypeImportDeclarationName() {
long[] positions = new long[length];
System.arraycopy(this.identifierStack, this.identifierPtr + 1, tokens, 0, length);
System.arraycopy(this.identifierPositionStack, this.identifierPtr + 1, positions, 0, length);
- pushOnAstStack(impt = newImportReference(tokens, positions, false, ClassFileConstants.AccDefault));
+ pushOnAstStack(impt = newImportReference(tokens, positions, false, 0));
if (this.currentToken == TokenNameSEMICOLON){
impt.declarationSourceEnd = this.scanner.currentPosition - 1;
@@ -723,11 +725,11 @@ protected void consumeStaticImportOnDemandDeclarationName() {
long[] positions = new long[length];
System.arraycopy(this.identifierStack, this.identifierPtr + 1, tokens, 0, length);
System.arraycopy(this.identifierPositionStack, this.identifierPtr + 1, positions, 0, length);
- pushOnAstStack(impt = new ImportReference(tokens, positions, true, ClassFileConstants.AccStatic));
+ pushOnAstStack(impt = new ImportReference(tokens, positions, true, Flags.STATIC));
// star end position
impt.trailingStarPosition = this.intStack[this.intPtr--];
- this.modifiers = ClassFileConstants.AccDefault;
+ this.modifiers = 0;
this.modifiersSourceStart = -1; // <-- see comment into modifiersFlag(int)
if (this.currentToken == TokenNameSEMICOLON){
@@ -742,7 +744,7 @@ protected void consumeStaticImportOnDemandDeclarationName() {
if(!this.statementRecoveryActivated &&
this.options.sourceLevel < ClassFileConstants.JDK1_5 &&
this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
- impt.modifiers = ClassFileConstants.AccDefault; // convert the static import reference to a non-static importe reference
+ impt.modifiers = 0; // convert the static import reference to a non-static importe reference
problemReporter().invalidUsageOfStaticImports(impt);
}
@@ -770,7 +772,7 @@ protected void consumeTypeImportOnDemandDeclarationName() {
long[] positions = new long[length];
System.arraycopy(this.identifierStack, this.identifierPtr + 1, tokens, 0, length);
System.arraycopy(this.identifierPositionStack, this.identifierPtr + 1, positions, 0, length);
- pushOnAstStack(impt = new ImportReference(tokens, positions, true, ClassFileConstants.AccDefault));
+ pushOnAstStack(impt = new ImportReference(tokens, positions, true, 0));
// star end position
impt.trailingStarPosition = this.intStack[this.intPtr--];
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java
index 42eabf05761..b5e107ce051 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java
@@ -51,6 +51,8 @@
import org.eclipse.jdt.internal.core.*;
import org.eclipse.jdt.internal.core.util.Util;
+import com.sun.tools.javac.code.Flags;
+
public class SourceTypeConverter extends TypeConverter {
/*
@@ -165,7 +167,7 @@ private CompilationUnitDeclaration convert(ISourceType[] sourceTypes, Compilatio
if (packageName.length > 0)
// if its null then it is defined in the default package
this.unit.currentPackage =
- createImportReference(packageName, start, end, false, ClassFileConstants.AccDefault);
+ createImportReference(packageName, start, end, false, 0);
IImportDeclaration[] importDeclarations = topLevelTypeInfo.getHandle().getCompilationUnit().getImports();
int importCount = importDeclarations.length;
this.unit.imports = new ImportReference[importCount];
@@ -217,7 +219,7 @@ private CompilationUnitDeclaration convert(IModule module, CompilationResult com
private Initializer convert(InitializerElementInfo initializerInfo, CompilationResult compilationResult) throws JavaModelException {
Block block = new Block(0);
- Initializer initializer = new Initializer(block, ClassFileConstants.AccDefault);
+ Initializer initializer = new Initializer(block, 0);
int start = initializerInfo.getDeclarationSourceStart();
int end = initializerInfo.getDeclarationSourceEnd();
@@ -292,9 +294,9 @@ private FieldDeclaration convert(SourceField fieldHandle, TypeDeclaration type,
field.declarationSourceStart = fieldInfo.getDeclarationSourceStart();
field.declarationSourceEnd = fieldInfo.getDeclarationSourceEnd();
int modifiers = fieldInfo.getModifiers();
- boolean isEnumConstant = (modifiers & ClassFileConstants.AccEnum) != 0;
+ boolean isEnumConstant = (modifiers & Flags.ENUM) != 0;
if (isEnumConstant) {
- field.modifiers = modifiers & ~ClassFileConstants.AccEnum; // clear AccEnum bit onto AST (binding will add it)
+ field.modifiers = modifiers & ~Flags.ENUM; // clear AccEnum bit onto AST (binding will add it)
} else {
field.modifiers = modifiers;
field.type = createTypeReference(fieldInfo.getTypeName(), start, end);
@@ -344,7 +346,7 @@ private QualifiedAllocationExpression convert(IJavaElement localType, FieldDecla
anonymousLocalTypeDeclaration.superInterfaces = null;
anonymousLocalTypeDeclaration.allocation = expression;
if (enumConstant != null) {
- anonymousLocalTypeDeclaration.modifiers &= ~ClassFileConstants.AccEnum;
+ anonymousLocalTypeDeclaration.modifiers &= ~Flags.ENUM;
expression.enumConstant = enumConstant;
expression.type = null;
}
@@ -425,8 +427,8 @@ private AbstractMethodDeclaration convert(SourceMethod methodHandle, SourceMetho
method = decl;
}
method.selector = methodHandle.getElementName().toCharArray();
- boolean isVarargs = (modifiers & ClassFileConstants.AccVarargs) != 0;
- method.modifiers = modifiers & ~ClassFileConstants.AccVarargs;
+ boolean isVarargs = (modifiers & Flags.ACC_VARARGS) != 0;
+ method.modifiers = modifiers & ~Flags.ACC_VARARGS;
method.sourceStart = start;
method.sourceEnd = end;
method.declarationSourceStart = methodInfo.getDeclarationSourceStart();
@@ -456,7 +458,7 @@ private AbstractMethodDeclaration convert(SourceMethod methodHandle, SourceMetho
argumentNames[i],
position,
typeReference,
- ClassFileConstants.AccDefault);
+ 0);
// do not care whether was final or not
// convert 1.5 specific constructs only if compliance is 1.5 or above
if (this.has1_5Compliance) {
@@ -665,7 +667,7 @@ private TypeDeclaration convert(SourceType typeHandle, CompilationResult compila
SourceMethod sourceMethod = sourceMethods[i];
SourceMethodElementInfo methodInfo = (SourceMethodElementInfo)sourceMethod.getElementInfo();
boolean isConstructor = methodInfo.isConstructor();
- if ((methodInfo.getModifiers() & ClassFileConstants.AccAbstract) != 0) {
+ if ((methodInfo.getModifiers() & Flags.ABSTRACT) != 0) {
hasAbstractMethods = true;
}
if ((isConstructor ? needConstructor : needMethod)) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMethod.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMethod.java
index a955087b896..5e86550ac15 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMethod.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMethod.java
@@ -26,7 +26,6 @@
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.Signature;
import org.eclipse.jdt.core.compiler.CharOperation;
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.env.IBinaryAnnotation;
import org.eclipse.jdt.internal.compiler.env.IBinaryMethod;
import org.eclipse.jdt.internal.compiler.env.IBinaryType;
@@ -207,7 +206,7 @@ public int getElementType() {
public int getFlags() throws JavaModelException {
IBinaryMethod info = (IBinaryMethod) getElementInfo();
int modifiers = info.getModifiers();
- if (((IType) this.getParent()).isInterface() && (modifiers & (ClassFileConstants.AccAbstract | ClassFileConstants.AccStatic)) == 0)
+ if (((IType) this.getParent()).isInterface() && (modifiers & (com.sun.tools.javac.code.Flags.ABSTRACT | com.sun.tools.javac.code.Flags.STATIC)) == 0)
modifiers |= ExtraCompilerModifiers.AccDefaultMethod;
return modifiers;
}
@@ -301,7 +300,7 @@ public String[] getParameterNames() throws JavaModelException {
if (paramCount != 0) {
// don't try to look for javadoc for synthetic methods
int modifiers = getFlags();
- if ((modifiers & ClassFileConstants.AccSynthetic) != 0) {
+ if ((modifiers & com.sun.tools.javac.code.Flags.SYNTHETIC) != 0) {
return this.parameterNames = getRawParameterNames(paramCount);
}
JavadocContents javadocContents = null;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryType.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryType.java
index 07ed1f29de3..e9201262752 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryType.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryType.java
@@ -351,7 +351,7 @@ public boolean isRecordComponent() throws JavaModelException {
@Override
public int getFlags() throws JavaModelException {
IBinaryType info = (IBinaryType) getElementInfo();
- return info.getModifiers() & ~ClassFileConstants.AccSuper;
+ return info.getModifiers() & ~com.sun.tools.javac.code.Flags.ACC_SUPER;
}
@Override
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryTypeConverter.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryTypeConverter.java
index db684d6e3fe..bf0d882491e 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryTypeConverter.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryTypeConverter.java
@@ -35,7 +35,6 @@
import org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference;
import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
import org.eclipse.jdt.internal.compiler.ast.TypeReference;
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader;
import org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
import org.eclipse.jdt.internal.compiler.parser.TypeConverter;
@@ -104,7 +103,7 @@ public TypeDeclaration buildTypeDeclaration(IType type, CompilationUnitDeclarati
char[][] packageName = Util.toCharArrays(pkg.names);
if (packageName.length > 0) {
- compilationUnit.currentPackage = new ImportReference(packageName, new long[]{0}, false, ClassFileConstants.AccDefault);
+ compilationUnit.currentPackage = new ImportReference(packageName, new long[]{0}, false, 0);
}
/* convert type */
@@ -201,7 +200,7 @@ private AbstractMethodDeclaration convert(IMethod method, IType type) throws Jav
argumentNames[i].toCharArray(),
0,
typeReference,
- ClassFileConstants.AccDefault);
+ 0);
// do not care whether was final or not
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFileInfo.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFileInfo.java
index 6fab72a54ef..73734fad127 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFileInfo.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFileInfo.java
@@ -18,7 +18,6 @@
import org.eclipse.jdt.core.*;
import org.eclipse.jdt.core.compiler.CharOperation;
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.env.IBinaryAnnotation;
import org.eclipse.jdt.internal.compiler.env.IBinaryElementValuePair;
import org.eclipse.jdt.internal.compiler.env.IBinaryField;
@@ -168,7 +167,7 @@ private void generateFieldInfos(IType type, IBinaryType typeInfo, HashMap newEle
IBinaryField fieldInfo = fields[i];
// If the type is a record and this is an instance field, it can only be a record component
// Filter out
- if (typeInfo.isRecord() && (fieldInfo.getModifiers() & ClassFileConstants.AccStatic) == 0)
+ if (typeInfo.isRecord() && (fieldInfo.getModifiers() & com.sun.tools.javac.code.Flags.STATIC) == 0)
continue;
BinaryField field = new BinaryField((JavaElement)type, manager.intern(new String(fieldInfo.getName())));
newElements.put(field, fieldInfo);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SelectionRequestor.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SelectionRequestor.java
index ee07cbbb21e..6d20ccc84bd 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SelectionRequestor.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SelectionRequestor.java
@@ -38,7 +38,6 @@
import org.eclipse.jdt.internal.compiler.ast.CastExpression;
import org.eclipse.jdt.internal.compiler.ast.LambdaExpression;
import org.eclipse.jdt.internal.compiler.ast.LocalDeclaration;
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
import org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding;
import org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding;
@@ -187,16 +186,16 @@ public void acceptModule(char[] moduleName, char[] uniqueKey, int start, int end
@Override
public void acceptType(char[] packageName, char[] typeName, int modifiers, boolean isDeclaration, char[] uniqueKey, int start, int end) {
int acceptFlags = 0;
- int kind = modifiers & (ClassFileConstants.AccInterface|ClassFileConstants.AccEnum|ClassFileConstants.AccAnnotation);
+ int kind = modifiers & (com.sun.tools.javac.code.Flags.INTERFACE|com.sun.tools.javac.code.Flags.ENUM|com.sun.tools.javac.code.Flags.ANNOTATION);
switch (kind) {
- case ClassFileConstants.AccAnnotation:
- case ClassFileConstants.AccAnnotation|ClassFileConstants.AccInterface:
+ case com.sun.tools.javac.code.Flags.ANNOTATION:
+ case com.sun.tools.javac.code.Flags.ANNOTATION|com.sun.tools.javac.code.Flags.INTERFACE:
acceptFlags = NameLookup.ACCEPT_ANNOTATIONS;
break;
- case ClassFileConstants.AccEnum:
+ case com.sun.tools.javac.code.Flags.ENUM:
acceptFlags = NameLookup.ACCEPT_ENUMS;
break;
- case ClassFileConstants.AccInterface:
+ case com.sun.tools.javac.code.Flags.INTERFACE:
acceptFlags = NameLookup.ACCEPT_INTERFACES;
break;
default:
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.java
index a0578b84d11..dddec693826 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.java
@@ -20,7 +20,6 @@
import org.eclipse.jdt.core.Signature;
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.env.IBinaryAnnotation;
import org.eclipse.jdt.internal.compiler.env.IBinaryField;
import org.eclipse.jdt.internal.compiler.env.IBinaryMethod;
@@ -33,6 +32,8 @@
import org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.ExternalAnnotationStatus;
import org.eclipse.jdt.internal.core.search.indexing.IIndexConstants;
+import com.sun.tools.javac.code.Flags;
+
public class HierarchyBinaryType implements IBinaryType {
private int modifiers;
private char[] sourceName;
@@ -293,7 +294,7 @@ public char[] sourceFileName() {
@Override
public String toString() {
StringBuilder buffer = new StringBuilder();
- if (this.modifiers == ClassFileConstants.AccPublic) {
+ if (this.modifiers == Flags.PUBLIC) {
buffer.append("public "); //$NON-NLS-1$
}
switch (TypeDeclaration.kind(this.modifiers)) {
diff --git a/org.eclipse.jdt.core/pom.xml b/org.eclipse.jdt.core/pom.xml
index 780da102ec8..a0543741197 100644
--- a/org.eclipse.jdt.core/pom.xml
+++ b/org.eclipse.jdt.core/pom.xml
@@ -34,6 +34,8 @@
false
+ --add-exports
+ jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
--add-exports
jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorDeclarationPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorDeclarationPattern.java
index 6ef6c6e556d..aa6a6e98c5e 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorDeclarationPattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorDeclarationPattern.java
@@ -16,7 +16,8 @@
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.core.search.SearchPattern;
import org.eclipse.jdt.internal.compiler.ExtraFlags;
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
+
+import com.sun.tools.javac.code.Flags;
public class ConstructorDeclarationPattern extends ConstructorPattern {
public int extraFlags;
@@ -126,7 +127,7 @@ public void decodeIndexKey(char[] key) {
this.modifiers = key[last-1] + (key[last]<<16);
} else {
- this.modifiers = ClassFileConstants.AccPublic;
+ this.modifiers = Flags.PUBLIC;
}
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodDeclarationPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodDeclarationPattern.java
index 05f8d172c14..d5e90814b52 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodDeclarationPattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodDeclarationPattern.java
@@ -18,7 +18,8 @@
import org.eclipse.jdt.core.search.SearchPattern;
import org.eclipse.jdt.internal.compiler.ExtraFlags;
import org.eclipse.jdt.internal.compiler.ast.ASTNode;
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
+
+import com.sun.tools.javac.code.Flags;
public class MethodDeclarationPattern extends MethodPattern {
@@ -256,7 +257,7 @@ public void decodeIndexKey(char[] key) {
this.modifiers = key[last-1] + (key[last]<<16);
} else {
- this.modifiers = ClassFileConstants.AccPublic;
+ this.modifiers = Flags.PUBLIC;
}
start = slash + 1;
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.java
index b30a2a3af15..0f2c837e4f1 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.java
@@ -19,10 +19,11 @@
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.core.search.IJavaSearchConstants;
import org.eclipse.jdt.core.search.SearchPattern;
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.core.index.*;
import org.eclipse.jdt.internal.core.search.indexing.IIndexConstants;
+import com.sun.tools.javac.code.Flags;
+
public class TypeDeclarationPattern extends JavaSearchPattern {
public char[] simpleName;
@@ -253,15 +254,15 @@ public void decodeIndexKey(char[] key) {
protected void decodeModifiers() {
// Extract suffix from modifiers instead of index key
- switch (this.modifiers & (ClassFileConstants.AccInterface|ClassFileConstants.AccEnum|ClassFileConstants.AccAnnotation)) {
- case ClassFileConstants.AccAnnotation:
- case ClassFileConstants.AccAnnotation+ClassFileConstants.AccInterface:
+ switch (this.modifiers & (Flags.INTERFACE|Flags.ENUM|Flags.ANNOTATION)) {
+ case Flags.ANNOTATION:
+ case Flags.ANNOTATION+Flags.INTERFACE:
this.typeSuffix = ANNOTATION_TYPE_SUFFIX;
break;
- case ClassFileConstants.AccEnum:
+ case Flags.ENUM:
this.typeSuffix = ENUM_SUFFIX;
break;
- case ClassFileConstants.AccInterface:
+ case Flags.INTERFACE:
this.typeSuffix = INTERFACE_SUFFIX;
break;
default: