[230291] remove dead code
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AST.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AST.java
index 2a3c080..6de1c8b 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AST.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AST.java
@@ -1431,39 +1431,6 @@
}
/**
- * Creates an unparented enum constant declaration node owned by this AST.
- * The name of the constant is an unspecified, but legal, name;
- * no doc comment; no modifiers or annotations; no arguments;
- * and does not declare an anonymous class.
- *
- * @return a new unparented enum constant declaration node
- * @exception UnsupportedOperationException if this operation is used in
- * a JLS2 AST
- * @since 3.1
- */
- public EnumConstantDeclaration newEnumConstantDeclaration() {
- EnumConstantDeclaration result = new EnumConstantDeclaration(this);
- return result;
- }
-
- /**
- * Creates an unparented enum declaration node owned by this AST.
- * The name of the enum is an unspecified, but legal, name;
- * no doc comment; no modifiers or annotations;
- * no superinterfaces; and empty lists of enum constants
- * and body declarations.
- *
- * @return a new unparented enum declaration node
- * @exception UnsupportedOperationException if this operation is used in
- * a JLS2 AST
- * @since 3.1
- */
- public EnumDeclaration newEnumDeclaration() {
- EnumDeclaration result = new EnumDeclaration(this);
- return result;
- }
-
- /**
* Creates and returns a new unparented type parameter type node with an
* unspecified type variable name and an empty list of type bounds.
*
@@ -1477,36 +1444,6 @@
return result;
}
- /**
- * Creates and returns a new unparented annotation type declaration
- * node for an unspecified, but legal, name; no modifiers; no javadoc;
- * and an empty list of member declarations.
- *
- * @return a new unparented annotation type declaration node
- * @exception UnsupportedOperationException if this operation is used in
- * a JLS2 AST
- * @since 3.1
- */
- public AnnotationTypeDeclaration newAnnotationTypeDeclaration() {
- AnnotationTypeDeclaration result = new AnnotationTypeDeclaration(this);
- return result;
- }
-
- /**
- * Creates and returns a new unparented annotation type
- * member declaration node for an unspecified, but legal,
- * member name and type; no modifiers; no javadoc;
- * and no default value.
- *
- * @return a new unparented annotation type member declaration node
- * @exception UnsupportedOperationException if this operation is used in
- * a JLS2 AST
- * @since 3.1
- */
- public AnnotationTypeMemberDeclaration newAnnotationTypeMemberDeclaration() {
- AnnotationTypeMemberDeclaration result = new AnnotationTypeMemberDeclaration(this);
- return result;
- }
/**
* Creates and returns a new unparented modifier node for the given
@@ -2555,65 +2492,6 @@
return result;
}
- //=============================== ANNOTATIONS ====================
-
- /**
- * Creates and returns a new unparented normal annotation node with
- * an unspecified type name and an empty list of member value
- * pairs.
- *
- * @return a new unparented normal annotation node
- * @exception UnsupportedOperationException if this operation is used in
- * a JLS2 AST
- * @since 3.1
- */
- public NormalAnnotation newNormalAnnotation() {
- NormalAnnotation result = new NormalAnnotation(this);
- return result;
- }
-
- /**
- * Creates and returns a new unparented marker annotation node with
- * an unspecified type name.
- *
- * @return a new unparented marker annotation node
- * @exception UnsupportedOperationException if this operation is used in
- * a JLS2 AST
- * @since 3.1
- */
- public MarkerAnnotation newMarkerAnnotation() {
- MarkerAnnotation result = new MarkerAnnotation(this);
- return result;
- }
-
- /**
- * Creates and returns a new unparented single member annotation node with
- * an unspecified type name and value.
- *
- * @return a new unparented single member annotation node
- * @exception UnsupportedOperationException if this operation is used in
- * a JLS2 AST
- * @since 3.1
- */
- public SingleMemberAnnotation newSingleMemberAnnotation() {
- SingleMemberAnnotation result = new SingleMemberAnnotation(this);
- return result;
- }
-
- /**
- * Creates and returns a new unparented member value pair node with
- * an unspecified member name and value.
- *
- * @return a new unparented member value pair node
- * @exception UnsupportedOperationException if this operation is used in
- * a JLS2 AST
- * @since 3.1
- */
- public MemberValuePair newMemberValuePair() {
- MemberValuePair result = new MemberValuePair(this);
- return result;
- }
-
/**
* Enables the recording of changes to the given compilation
* unit and its descendents. The compilation unit must have
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTConverter.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTConverter.java
index 0dd4793..9dd7508 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTConverter.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTConverter.java
@@ -25,7 +25,6 @@
import org.eclipse.wst.jsdt.core.compiler.InvalidInputException;
import org.eclipse.wst.jsdt.core.dom.Modifier.ModifierKeyword;
import org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration;
-import org.eclipse.wst.jsdt.internal.compiler.ast.AbstractVariableDeclaration;
import org.eclipse.wst.jsdt.internal.compiler.ast.Argument;
import org.eclipse.wst.jsdt.internal.compiler.ast.ForeachStatement;
import org.eclipse.wst.jsdt.internal.compiler.ast.JavadocArgumentExpression;
@@ -37,9 +36,6 @@
import org.eclipse.wst.jsdt.internal.compiler.ast.ParameterizedQualifiedTypeReference;
import org.eclipse.wst.jsdt.internal.compiler.ast.ParameterizedSingleTypeReference;
import org.eclipse.wst.jsdt.internal.compiler.ast.ProgramElement;
-import org.eclipse.wst.jsdt.internal.compiler.ast.QualifiedAllocationExpression;
-import org.eclipse.wst.jsdt.internal.compiler.ast.QualifiedTypeReference;
-import org.eclipse.wst.jsdt.internal.compiler.ast.SingleTypeReference;
import org.eclipse.wst.jsdt.internal.compiler.ast.StringLiteralConcatenation;
import org.eclipse.wst.jsdt.internal.compiler.ast.TypeReference;
import org.eclipse.wst.jsdt.internal.compiler.ast.Wildcard;
@@ -155,7 +151,7 @@
position = nextMethodDeclaration.declarationSourceStart;
nextDeclarationType = 1; // METHOD
}
- }
+ }
if (membersIndex < membersLength) {
nextMemberDeclaration = members[membersIndex];
if (nextMemberDeclaration.declarationSourceStart < position) {
@@ -165,11 +161,7 @@
}
switch (nextDeclarationType) {
case 0 :
- if (nextFieldDeclaration.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) {
- typeDecl.bodyDeclarations().add(convert(nextFieldDeclaration));
- } else {
checkAndAddMultipleFieldDeclaration(fields, fieldsIndex, typeDecl.bodyDeclarations());
- }
fieldsIndex++;
break;
case 1 :
@@ -192,72 +184,6 @@
convert(typeDeclaration.javadoc, typeDecl);
}
- protected void buildBodyDeclarations(org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration enumDeclaration2, EnumDeclaration enumDeclaration) {
- // add body declaration in the lexical order
- org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration[] members = enumDeclaration2.memberTypes;
- org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration[] fields = enumDeclaration2.fields;
- org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration[] methods = enumDeclaration2.methods;
-
- int fieldsLength = fields == null? 0 : fields.length;
- int methodsLength = methods == null? 0 : methods.length;
- int membersLength = members == null ? 0 : members.length;
- int fieldsIndex = 0;
- int methodsIndex = 0;
- int membersIndex = 0;
-
- while ((fieldsIndex < fieldsLength)
- || (membersIndex < membersLength)
- || (methodsIndex < methodsLength)) {
- org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration nextFieldDeclaration = null;
- org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration nextMethodDeclaration = null;
- org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration nextMemberDeclaration = null;
-
- int position = Integer.MAX_VALUE;
- int nextDeclarationType = -1;
- if (fieldsIndex < fieldsLength) {
- nextFieldDeclaration = fields[fieldsIndex];
- if (nextFieldDeclaration.declarationSourceStart < position) {
- position = nextFieldDeclaration.declarationSourceStart;
- nextDeclarationType = 0; // FIELD
- }
- }
- if (methodsIndex < methodsLength) {
- nextMethodDeclaration = methods[methodsIndex];
- if (nextMethodDeclaration.declarationSourceStart < position) {
- position = nextMethodDeclaration.declarationSourceStart;
- nextDeclarationType = 1; // METHOD
- }
- }
- if (membersIndex < membersLength) {
- nextMemberDeclaration = members[membersIndex];
- if (nextMemberDeclaration.declarationSourceStart < position) {
- position = nextMemberDeclaration.declarationSourceStart;
- nextDeclarationType = 2; // MEMBER
- }
- }
- switch (nextDeclarationType) {
- case 0 :
- if (nextFieldDeclaration.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) {
- enumDeclaration.enumConstants().add(convert(nextFieldDeclaration));
- } else {
- checkAndAddMultipleFieldDeclaration(fields, fieldsIndex, enumDeclaration.bodyDeclarations());
- }
- fieldsIndex++;
- break;
- case 1 :
- methodsIndex++;
- if (!nextMethodDeclaration.isDefaultConstructor() && !nextMethodDeclaration.isClinit()) {
- enumDeclaration.bodyDeclarations().add(convert(nextMethodDeclaration));
- }
- break;
- case 2 :
- membersIndex++;
- enumDeclaration.bodyDeclarations().add(convert(nextMemberDeclaration));
- break;
- }
- }
- convert(enumDeclaration2.javadoc, enumDeclaration);
- }
protected void buildBodyDeclarations(org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration expression, AnonymousClassDeclaration anonymousClassDeclaration) {
// add body declaration in the lexical order
@@ -304,11 +230,7 @@
}
switch (nextDeclarationType) {
case 0 :
- if (nextFieldDeclaration.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) {
- anonymousClassDeclaration.bodyDeclarations().add(convert(nextFieldDeclaration));
- } else {
checkAndAddMultipleFieldDeclaration(fields, fieldsIndex, anonymousClassDeclaration.bodyDeclarations());
- }
fieldsIndex++;
break;
case 1 :
@@ -697,60 +619,7 @@
return infixExpression;
}
- public AnnotationTypeDeclaration convertToAnnotationDeclaration(org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration typeDeclaration) {
- checkCanceled();
- AnnotationTypeDeclaration typeDecl = this.ast.newAnnotationTypeDeclaration();
- setModifiers(typeDecl, typeDeclaration);
- final SimpleName typeName = new SimpleName(this.ast);
- typeName.internalSetIdentifier(new String(typeDeclaration.name));
- typeName.setSourceRange(typeDeclaration.sourceStart, typeDeclaration.sourceEnd - typeDeclaration.sourceStart + 1);
- typeDecl.setName(typeName);
- typeDecl.setSourceRange(typeDeclaration.declarationSourceStart, typeDeclaration.bodyEnd - typeDeclaration.declarationSourceStart + 1);
- buildBodyDeclarations(typeDeclaration, typeDecl);
- // The javadoc comment is now got from list store in compilation unit declaration
- if (this.resolveBindings) {
- recordNodes(typeDecl, typeDeclaration);
- recordNodes(typeName, typeDeclaration);
- typeDecl.resolveBinding();
- }
- return typeDecl;
- }
-
- public ASTNode convert(org.eclipse.wst.jsdt.internal.compiler.ast.AnnotationMethodDeclaration annotationTypeMemberDeclaration) {
- checkCanceled();
- if (this.ast.apiLevel == AST.JLS2_INTERNAL) {
- return null;
- }
- AnnotationTypeMemberDeclaration annotationTypeMemberDeclaration2 = new AnnotationTypeMemberDeclaration(this.ast);
- setModifiers(annotationTypeMemberDeclaration2, annotationTypeMemberDeclaration);
- final SimpleName methodName = new SimpleName(this.ast);
- methodName.internalSetIdentifier(new String(annotationTypeMemberDeclaration.selector));
- int start = annotationTypeMemberDeclaration.sourceStart;
- int end = retrieveIdentifierEndPosition(start, annotationTypeMemberDeclaration.sourceEnd);
- methodName.setSourceRange(start, end - start + 1);
- annotationTypeMemberDeclaration2.setName(methodName);
- org.eclipse.wst.jsdt.internal.compiler.ast.TypeReference typeReference = annotationTypeMemberDeclaration.returnType;
- if (typeReference != null) {
- Type returnType = convertType(typeReference);
- setTypeForMethodDeclaration(annotationTypeMemberDeclaration2, returnType, 0);
- }
- int declarationSourceStart = annotationTypeMemberDeclaration.declarationSourceStart;
- int declarationSourceEnd = annotationTypeMemberDeclaration.bodyEnd;
- annotationTypeMemberDeclaration2.setSourceRange(declarationSourceStart, declarationSourceEnd - declarationSourceStart + 1);
- // The javadoc comment is now got from list store in compilation unit declaration
- convert(annotationTypeMemberDeclaration.javadoc, annotationTypeMemberDeclaration2);
- org.eclipse.wst.jsdt.internal.compiler.ast.Expression memberValue = annotationTypeMemberDeclaration.defaultValue;
- if (memberValue != null) {
- annotationTypeMemberDeclaration2.setDefault(convert(memberValue));
- }
- if (this.resolveBindings) {
- recordNodes(annotationTypeMemberDeclaration2, annotationTypeMemberDeclaration);
- recordNodes(methodName, annotationTypeMemberDeclaration);
- annotationTypeMemberDeclaration2.resolveBinding();
- }
- return annotationTypeMemberDeclaration2;
- }
public SingleVariableDeclaration convert(org.eclipse.wst.jsdt.internal.compiler.ast.Argument argument) {
SingleVariableDeclaration variableDecl = new SingleVariableDeclaration(this.ast);
@@ -806,16 +675,6 @@
}
- public Annotation convert(org.eclipse.wst.jsdt.internal.compiler.ast.Annotation annotation) {
- if (annotation instanceof org.eclipse.wst.jsdt.internal.compiler.ast.SingleMemberAnnotation) {
- return convert((org.eclipse.wst.jsdt.internal.compiler.ast.SingleMemberAnnotation) annotation);
- } else if (annotation instanceof org.eclipse.wst.jsdt.internal.compiler.ast.MarkerAnnotation) {
- return convert((org.eclipse.wst.jsdt.internal.compiler.ast.MarkerAnnotation) annotation);
- } else {
- return convert((org.eclipse.wst.jsdt.internal.compiler.ast.NormalAnnotation) annotation);
- }
- }
-
public ArrayCreation convert(org.eclipse.wst.jsdt.internal.compiler.ast.ArrayAllocationExpression expression) {
ArrayCreation arrayCreation = new ArrayCreation(this.ast);
if (this.resolveBindings) {
@@ -1518,55 +1377,6 @@
return emptyExpression;
}
- // field is an enum constant
- public EnumConstantDeclaration convert(org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration enumConstant) {
- checkCanceled();
- EnumConstantDeclaration enumConstantDeclaration = new EnumConstantDeclaration(this.ast);
- final SimpleName typeName = new SimpleName(this.ast);
- typeName.internalSetIdentifier(new String(enumConstant.name));
- typeName.setSourceRange(enumConstant.sourceStart, enumConstant.sourceEnd - enumConstant.sourceStart + 1);
- enumConstantDeclaration.setName(typeName);
- int declarationSourceStart = enumConstant.declarationSourceStart;
- int declarationSourceEnd = enumConstant.declarationSourceEnd;
- final org.eclipse.wst.jsdt.internal.compiler.ast.Expression initialization = enumConstant.initialization;
- if (initialization != null) {
- if (initialization instanceof QualifiedAllocationExpression) {
- org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration anonymousType = ((QualifiedAllocationExpression) initialization).anonymousType;
- if (anonymousType != null) {
- AnonymousClassDeclaration anonymousClassDeclaration = new AnonymousClassDeclaration(this.ast);
- int start = retrieveStartBlockPosition(anonymousType.sourceEnd, anonymousType.bodyEnd);
- int end = retrieveRightBrace(anonymousType.bodyEnd, declarationSourceEnd);
- if (end == -1) end = anonymousType.bodyEnd;
- anonymousClassDeclaration.setSourceRange(start, end - start + 1);
- enumConstantDeclaration.setAnonymousClassDeclaration(anonymousClassDeclaration);
- buildBodyDeclarations(anonymousType, anonymousClassDeclaration);
- if (this.resolveBindings) {
- recordNodes(anonymousClassDeclaration, anonymousType);
- anonymousClassDeclaration.resolveBinding();
- }
- enumConstantDeclaration.setSourceRange(declarationSourceStart, end - declarationSourceStart + 1);
- }
- } else {
- enumConstantDeclaration.setSourceRange(declarationSourceStart, declarationSourceEnd - declarationSourceStart + 1);
- }
- final org.eclipse.wst.jsdt.internal.compiler.ast.Expression[] arguments = ((org.eclipse.wst.jsdt.internal.compiler.ast.AllocationExpression) initialization).arguments;
- if (arguments != null) {
- for (int i = 0, max = arguments.length; i < max; i++) {
- enumConstantDeclaration.arguments().add(convert(arguments[i]));
- }
- }
- } else {
- enumConstantDeclaration.setSourceRange(declarationSourceStart, declarationSourceEnd - declarationSourceStart + 1);
- }
- setModifiers(enumConstantDeclaration, enumConstant);
- if (this.resolveBindings) {
- recordNodes(enumConstantDeclaration, enumConstant);
- recordNodes(typeName, enumConstant);
- enumConstantDeclaration.resolveVariable();
- }
- convert(enumConstant.javadoc, enumConstantDeclaration);
- return enumConstantDeclaration;
- }
public Expression convert(org.eclipse.wst.jsdt.internal.compiler.ast.EqualExpression expression) {
InfixExpression infixExpression = new InfixExpression(this.ast);
@@ -2264,38 +2074,6 @@
return expr;
}
- public MarkerAnnotation convert(org.eclipse.wst.jsdt.internal.compiler.ast.MarkerAnnotation annotation) {
- final MarkerAnnotation markerAnnotation = new MarkerAnnotation(this.ast);
- setTypeNameForAnnotation(annotation, markerAnnotation);
- int start = annotation.sourceStart;
- int end = annotation.declarationSourceEnd;
- markerAnnotation.setSourceRange(start, end - start + 1);
- if (this.resolveBindings) {
- recordNodes(markerAnnotation, annotation);
- markerAnnotation.resolveAnnotationBinding();
- }
- return markerAnnotation;
- }
-
- public MemberValuePair convert(org.eclipse.wst.jsdt.internal.compiler.ast.MemberValuePair memberValuePair) {
- final MemberValuePair pair = new MemberValuePair(this.ast);
- final SimpleName simpleName = new SimpleName(this.ast);
- simpleName.internalSetIdentifier(new String(memberValuePair.name));
- int start = memberValuePair.sourceStart;
- int end = memberValuePair.sourceEnd;
- simpleName.setSourceRange(start, end - start + 1);
- pair.setName(simpleName);
- final Expression value = convert(memberValuePair.value);
- pair.setValue(value);
- start = memberValuePair.sourceStart;
- end = value.getStartPosition() + value.getLength() - 1;
- pair.setSourceRange(start, end - start + 1);
- if (this.resolveBindings) {
- recordNodes(simpleName, memberValuePair);
- recordNodes(pair, memberValuePair);
- }
- return pair;
- }
public Name convert(org.eclipse.wst.jsdt.internal.compiler.ast.NameReference reference) {
if (reference instanceof org.eclipse.wst.jsdt.internal.compiler.ast.QualifiedNameReference) {
@@ -2322,24 +2100,6 @@
return infixExpression;
}
- public NormalAnnotation convert(org.eclipse.wst.jsdt.internal.compiler.ast.NormalAnnotation annotation) {
- final NormalAnnotation normalAnnotation = new NormalAnnotation(this.ast);
- setTypeNameForAnnotation(annotation, normalAnnotation);
- org.eclipse.wst.jsdt.internal.compiler.ast.MemberValuePair[] memberValuePairs = annotation.memberValuePairs;
- if (memberValuePairs != null) {
- for (int i = 0, max = memberValuePairs.length; i < max; i++) {
- normalAnnotation.values().add(convert(memberValuePairs[i]));
- }
- }
- int start = annotation.sourceStart;
- int end = annotation.declarationSourceEnd;
- normalAnnotation.setSourceRange(start, end - start + 1);
- if (this.resolveBindings) {
- recordNodes(normalAnnotation, annotation);
- normalAnnotation.resolveAnnotationBinding();
- }
- return normalAnnotation;
- }
public NullLiteral convert(org.eclipse.wst.jsdt.internal.compiler.ast.NullLiteral expression) {
final NullLiteral literal = new NullLiteral(this.ast);
@@ -2581,20 +2341,6 @@
return returnStatement;
}
- public SingleMemberAnnotation convert(org.eclipse.wst.jsdt.internal.compiler.ast.SingleMemberAnnotation annotation) {
- final SingleMemberAnnotation singleMemberAnnotation = new SingleMemberAnnotation(this.ast);
- setTypeNameForAnnotation(annotation, singleMemberAnnotation);
- singleMemberAnnotation.setValue(convert(annotation.memberValue));
- int start = annotation.sourceStart;
- int end = annotation.declarationSourceEnd;
- singleMemberAnnotation.setSourceRange(start, end - start + 1);
- if (this.resolveBindings) {
- recordNodes(singleMemberAnnotation, annotation);
- singleMemberAnnotation.resolveAnnotationBinding();
- }
- return singleMemberAnnotation;
- }
-
public SimpleName convert(org.eclipse.wst.jsdt.internal.compiler.ast.SingleNameReference nameReference) {
final SimpleName name = new SimpleName(this.ast);
name.internalSetIdentifier(new String(nameReference.token));
@@ -2665,32 +2411,6 @@
if (result == null) {
return createFakeEmptyStatement(statement);
}
- switch(result.getNodeType()) {
- case ASTNode.ENUM_DECLARATION:
- switch(this.ast.apiLevel) {
- case AST.JLS2_INTERNAL :
- return createFakeEmptyStatement(statement);
- case AST.JLS3 :
- final TypeDeclarationStatement typeDeclarationStatement = new TypeDeclarationStatement(this.ast);
- typeDeclarationStatement.setDeclaration((EnumDeclaration) result);
- AbstractTypeDeclaration typeDecl = typeDeclarationStatement.getDeclaration();
- typeDeclarationStatement.setSourceRange(typeDecl.getStartPosition(), typeDecl.getLength());
- return typeDeclarationStatement;
- }
- break;
- case ASTNode.ANNOTATION_TYPE_DECLARATION :
- switch(this.ast.apiLevel) {
- case AST.JLS2_INTERNAL :
- return createFakeEmptyStatement(statement);
- case AST.JLS3 :
- TypeDeclarationStatement typeDeclarationStatement = new TypeDeclarationStatement(this.ast);
- typeDeclarationStatement.setDeclaration((AnnotationTypeDeclaration) result);
- AbstractTypeDeclaration typeDecl = typeDeclarationStatement.getDeclaration();
- typeDeclarationStatement.setSourceRange(typeDecl.getStartPosition(), typeDecl.getLength());
- return typeDeclarationStatement;
- }
- break;
- default:
TypeDeclaration typeDeclaration = (TypeDeclaration) result;
TypeDeclarationStatement typeDeclarationStatement = new TypeDeclarationStatement(this.ast);
typeDeclarationStatement.setDeclaration(typeDeclaration);
@@ -2706,7 +2426,6 @@
}
return typeDeclarationStatement;
- }
}
if (statement instanceof org.eclipse.wst.jsdt.internal.compiler.ast.WhileStatement) {
return convert((org.eclipse.wst.jsdt.internal.compiler.ast.WhileStatement) statement);
@@ -2829,20 +2548,6 @@
public ASTNode convert(org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration typeDeclaration) {
int kind = org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration.kind(typeDeclaration.modifiers);
- switch (kind) {
- case org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration.ENUM_DECL :
- if (this.ast.apiLevel == AST.JLS2_INTERNAL) {
- return null;
- } else {
- return convertToEnumDeclaration(typeDeclaration);
- }
- case org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration.ANNOTATION_TYPE_DECL :
- if (this.ast.apiLevel == AST.JLS2_INTERNAL) {
- return null;
- } else {
- return convertToAnnotationDeclaration(typeDeclaration);
- }
- }
checkCanceled();
TypeDeclaration typeDecl = new TypeDeclaration(this.ast);
@@ -3088,30 +2793,6 @@
return packageDeclaration;
}
- private EnumDeclaration convertToEnumDeclaration(org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration typeDeclaration) {
- checkCanceled();
- final EnumDeclaration enumDeclaration2 = new EnumDeclaration(this.ast);
- setModifiers(enumDeclaration2, typeDeclaration);
- final SimpleName typeName = new SimpleName(this.ast);
- typeName.internalSetIdentifier(new String(typeDeclaration.name));
- typeName.setSourceRange(typeDeclaration.sourceStart, typeDeclaration.sourceEnd - typeDeclaration.sourceStart + 1);
- enumDeclaration2.setName(typeName);
- enumDeclaration2.setSourceRange(typeDeclaration.declarationSourceStart, typeDeclaration.bodyEnd - typeDeclaration.declarationSourceStart + 1);
-
- org.eclipse.wst.jsdt.internal.compiler.ast.TypeReference[] superInterfaces = typeDeclaration.superInterfaces;
- if (superInterfaces != null) {
- for (int index = 0, length = superInterfaces.length; index < length; index++) {
- enumDeclaration2.superInterfaceTypes().add(convertType(superInterfaces[index]));
- }
- }
- buildBodyDeclarations(typeDeclaration, enumDeclaration2);
- if (this.resolveBindings) {
- recordNodes(enumDeclaration2, typeDeclaration);
- recordNodes(typeName, typeDeclaration);
- enumDeclaration2.resolveBinding();
- }
- return enumDeclaration2;
- }
public Expression convertToExpression(org.eclipse.wst.jsdt.internal.compiler.ast.Statement statement) {
if (statement instanceof org.eclipse.wst.jsdt.internal.compiler.ast.Expression) {
return convert((org.eclipse.wst.jsdt.internal.compiler.ast.Expression) statement);
@@ -3876,9 +3557,7 @@
while(!(currentNode instanceof AbstractTypeDeclaration)) {
currentNode = currentNode.getParent();
}
- if (currentNode instanceof TypeDeclaration
- || currentNode instanceof EnumDeclaration
- || currentNode instanceof AnnotationTypeDeclaration) {
+ if (currentNode instanceof TypeDeclaration) {
org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration typeDecl = (org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration) this.ast.getBindingResolver().getCorrespondingNode(currentNode);
if ((initializer.getModifiers() & Modifier.STATIC) != 0) {
return typeDecl.staticInitializerScope;
@@ -3891,9 +3570,7 @@
while(!(currentNode instanceof AbstractTypeDeclaration)) {
currentNode = currentNode.getParent();
}
- if (currentNode instanceof TypeDeclaration
- || currentNode instanceof EnumDeclaration
- || currentNode instanceof AnnotationTypeDeclaration) {
+ if (currentNode instanceof TypeDeclaration) {
org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration typeDecl = (org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration) this.ast.getBindingResolver().getCorrespondingNode(currentNode);
if ((fieldDeclaration.getModifiers() & Modifier.STATIC) != 0) {
return typeDecl.staticInitializerScope;
@@ -4578,16 +4255,6 @@
this.docParser = new DocCommentParser(this.ast, this.scanner, this.insideComments);
}
- protected void setModifiers(AnnotationTypeDeclaration typeDecl, org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration typeDeclaration) {
- this.scanner.resetTo(typeDeclaration.declarationSourceStart, typeDeclaration.sourceStart);
- this.setModifiers(typeDecl, typeDeclaration.annotations);
- }
-
- protected void setModifiers(AnnotationTypeMemberDeclaration annotationTypeMemberDecl, org.eclipse.wst.jsdt.internal.compiler.ast.AnnotationMethodDeclaration annotationTypeMemberDeclaration) {
- this.scanner.resetTo(annotationTypeMemberDeclaration.declarationSourceStart, annotationTypeMemberDeclaration.sourceStart);
- this.setModifiers(annotationTypeMemberDecl, annotationTypeMemberDeclaration.annotations);
- }
-
/**
* @param bodyDeclaration
*/
@@ -4631,14 +4298,6 @@
case TerminalTokens.TokenNamestrictfp:
modifier = createModifier(Modifier.ModifierKeyword.STRICTFP_KEYWORD);
break;
- case TerminalTokens.TokenNameAT :
- // we have an annotation
- if (annotations != null && indexInAnnotations < annotations.length) {
- org.eclipse.wst.jsdt.internal.compiler.ast.Annotation annotation = annotations[indexInAnnotations++];
- modifier = convert(annotation);
- this.scanner.resetTo(annotation.declarationSourceEnd + 1, this.compilationUnitSourceLength);
- }
- break;
case TerminalTokens.TokenNameCOMMENT_BLOCK :
case TerminalTokens.TokenNameCOMMENT_LINE :
case TerminalTokens.TokenNameCOMMENT_JAVADOC :
@@ -4656,25 +4315,6 @@
}
- protected void setModifiers(EnumDeclaration enumDeclaration, org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration enumDeclaration2) {
- this.scanner.resetTo(enumDeclaration2.declarationSourceStart, enumDeclaration2.sourceStart);
- this.setModifiers(enumDeclaration, enumDeclaration2.annotations);
- }
-
- protected void setModifiers(EnumConstantDeclaration enumConstantDeclaration, org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration fieldDeclaration) {
- switch(this.ast.apiLevel) {
- case AST.JLS2_INTERNAL :
- enumConstantDeclaration.internalSetModifiers(fieldDeclaration.modifiers & ExtraCompilerModifiers.AccJustFlag);
- if (fieldDeclaration.annotations != null) {
- enumConstantDeclaration.setFlags(enumConstantDeclaration.getFlags() | ASTNode.MALFORMED);
- }
- break;
- case AST.JLS3 :
- this.scanner.resetTo(fieldDeclaration.declarationSourceStart, fieldDeclaration.sourceStart);
- this.setModifiers(enumConstantDeclaration, fieldDeclaration.annotations);
- }
- }
-
/**
* @param fieldDeclaration
* @param fieldDecl
@@ -4785,14 +4425,6 @@
case TerminalTokens.TokenNamestrictfp:
modifier = createModifier(Modifier.ModifierKeyword.STRICTFP_KEYWORD);
break;
- case TerminalTokens.TokenNameAT :
- // we have an annotation
- if (annotations != null && indexInAnnotations < annotations.length) {
- org.eclipse.wst.jsdt.internal.compiler.ast.Annotation annotation = annotations[indexInAnnotations++];
- modifier = convert(annotation);
- this.scanner.resetTo(annotation.declarationSourceEnd + 1, this.compilationUnitSourceLength);
- }
- break;
case TerminalTokens.TokenNameCOMMENT_BLOCK :
case TerminalTokens.TokenNameCOMMENT_LINE :
case TerminalTokens.TokenNameCOMMENT_JAVADOC :
@@ -4860,14 +4492,6 @@
case TerminalTokens.TokenNamestrictfp:
modifier = createModifier(Modifier.ModifierKeyword.STRICTFP_KEYWORD);
break;
- case TerminalTokens.TokenNameAT :
- // we have an annotation
- if (annotations != null && indexInAnnotations < annotations.length) {
- org.eclipse.wst.jsdt.internal.compiler.ast.Annotation annotation = annotations[indexInAnnotations++];
- modifier = convert(annotation);
- this.scanner.resetTo(annotation.declarationSourceEnd + 1, this.compilationUnitSourceLength);
- }
- break;
case TerminalTokens.TokenNameCOMMENT_BLOCK :
case TerminalTokens.TokenNameCOMMENT_LINE :
case TerminalTokens.TokenNameCOMMENT_JAVADOC :
@@ -4962,14 +4586,6 @@
case TerminalTokens.TokenNamestrictfp:
modifier = createModifier(Modifier.ModifierKeyword.STRICTFP_KEYWORD);
break;
- case TerminalTokens.TokenNameAT :
- // we have an annotation
- if (annotations != null && indexInAnnotations < annotations.length) {
- org.eclipse.wst.jsdt.internal.compiler.ast.Annotation annotation = annotations[indexInAnnotations++];
- modifier = convert(annotation);
- this.scanner.resetTo(annotation.declarationSourceEnd + 1, this.compilationUnitSourceLength);
- }
- break;
case TerminalTokens.TokenNameCOMMENT_BLOCK :
case TerminalTokens.TokenNameCOMMENT_LINE :
case TerminalTokens.TokenNameCOMMENT_JAVADOC :
@@ -5043,14 +4659,6 @@
case TerminalTokens.TokenNamestrictfp:
modifier = createModifier(Modifier.ModifierKeyword.STRICTFP_KEYWORD);
break;
- case TerminalTokens.TokenNameAT :
- // we have an annotation
- if (annotations != null && indexInAnnotations < annotations.length) {
- org.eclipse.wst.jsdt.internal.compiler.ast.Annotation annotation = annotations[indexInAnnotations++];
- modifier = convert(annotation);
- this.scanner.resetTo(annotation.declarationSourceEnd + 1, this.compilationUnitSourceLength);
- }
- break;
case TerminalTokens.TokenNameCOMMENT_BLOCK :
case TerminalTokens.TokenNameCOMMENT_LINE :
case TerminalTokens.TokenNameCOMMENT_JAVADOC :
@@ -5181,28 +4789,6 @@
return qualifiedName;
}
- protected void setTypeNameForAnnotation(org.eclipse.wst.jsdt.internal.compiler.ast.Annotation compilerAnnotation, Annotation annotation) {
- TypeReference typeReference = compilerAnnotation.type;
- if (typeReference instanceof QualifiedTypeReference) {
- QualifiedTypeReference qualifiedTypeReference = (QualifiedTypeReference) typeReference;
- char[][] tokens = qualifiedTypeReference.tokens;
- long[] positions = qualifiedTypeReference.sourcePositions;
- // QualifiedName
- annotation.setTypeName(setQualifiedNameNameAndSourceRanges(tokens, positions, typeReference));
- } else {
- SingleTypeReference singleTypeReference = (SingleTypeReference) typeReference;
- final SimpleName name = new SimpleName(this.ast);
- name.internalSetIdentifier(new String(singleTypeReference.token));
- int start = singleTypeReference.sourceStart;
- int end = singleTypeReference.sourceEnd;
- name.setSourceRange(start, end - start + 1);
- name.index = 1;
- annotation.setTypeName(name);
- if (this.resolveBindings) {
- recordNodes(name, typeReference);
- }
- }
- }
protected void setTypeForField(FieldDeclaration fieldDeclaration, Type type, int extraDimension) {
if (extraDimension != 0) {
@@ -5309,10 +4895,6 @@
}
}
- protected void setTypeForMethodDeclaration(AnnotationTypeMemberDeclaration annotationTypeMemberDeclaration, Type type, int extraDimension) {
- annotationTypeMemberDeclaration.setType(type);
- }
-
protected void setTypeForSingleVariableDeclaration(SingleVariableDeclaration singleVariableDeclaration, Type type, int extraDimension) {
if (extraDimension != 0) {
if (type.isArrayType()) {
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTMatcher.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTMatcher.java
index 2ff9004..ada7d6e 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTMatcher.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTMatcher.java
@@ -163,60 +163,6 @@
return o1.equals(o2);
}
- /**
- * Returns whether the given node and the other object match.
- * <p>
- * The default implementation provided by this class tests whether the
- * other object is a node of the same type with structurally isomorphic
- * child subtrees. Subclasses may override this method as needed.
- * </p>
- *
- * @param node the node
- * @param other the other object, or <code>null</code>
- * @return <code>true</code> if the subtree matches, or
- * <code>false</code> if they do not match or the other object has a
- * different node type or is <code>null</code>
- * @since 3.1
- */
- public boolean match(AnnotationTypeDeclaration node, Object other) {
- if (!(other instanceof AnnotationTypeDeclaration)) {
- return false;
- }
- AnnotationTypeDeclaration o = (AnnotationTypeDeclaration) other;
- // node type added in JLS3 - ignore old JLS2-style modifiers
- return (safeSubtreeMatch(node.getJavadoc(), o.getJavadoc())
- && safeSubtreeListMatch(node.modifiers(), o.modifiers())
- && safeSubtreeMatch(node.getName(), o.getName())
- && safeSubtreeListMatch(node.bodyDeclarations(), o.bodyDeclarations()));
- }
-
- /**
- * Returns whether the given node and the other object match.
- * <p>
- * The default implementation provided by this class tests whether the
- * other object is a node of the same type with structurally isomorphic
- * child subtrees. Subclasses may override this method as needed.
- * </p>
- *
- * @param node the node
- * @param other the other object, or <code>null</code>
- * @return <code>true</code> if the subtree matches, or
- * <code>false</code> if they do not match or the other object has a
- * different node type or is <code>null</code>
- * @since 3.1
- */
- public boolean match(AnnotationTypeMemberDeclaration node, Object other) {
- if (!(other instanceof AnnotationTypeMemberDeclaration)) {
- return false;
- }
- AnnotationTypeMemberDeclaration o = (AnnotationTypeMemberDeclaration) other;
- // node type added in JLS3 - ignore old JLS2-style modifiers
- return (safeSubtreeMatch(node.getJavadoc(), o.getJavadoc())
- && safeSubtreeListMatch(node.modifiers(), o.modifiers())
- && safeSubtreeMatch(node.getType(), o.getType())
- && safeSubtreeMatch(node.getName(), o.getName())
- && safeSubtreeMatch(node.getDefault(), o.getDefault()));
- }
/**
* Returns whether the given node and the other object match.
@@ -774,66 +720,7 @@
&& safeSubtreeMatch(node.getBody(), o.getBody()));
}
- /**
- * Returns whether the given node and the other object match.
- * <p>
- * The default implementation provided by this class tests whether the
- * other object is a node of the same type with structurally isomorphic
- * child subtrees. Subclasses may override this method as needed.
- * </p>
- *
- * @param node the node
- * @param other the other object, or <code>null</code>
- * @return <code>true</code> if the subtree matches, or
- * <code>false</code> if they do not match or the other object has a
- * different node type or is <code>null</code>
- * @since 3.1
- */
- public boolean match(EnumConstantDeclaration node, Object other) {
- if (!(other instanceof EnumConstantDeclaration)) {
- return false;
- }
- EnumConstantDeclaration o = (EnumConstantDeclaration) other;
- return (
- safeSubtreeMatch(node.getJavadoc(), o.getJavadoc())
- && safeSubtreeListMatch(node.modifiers(), o.modifiers())
- && safeSubtreeMatch(node.getName(), o.getName())
- && safeSubtreeListMatch(node.arguments(), o.arguments())
- && safeSubtreeMatch(
- node.getAnonymousClassDeclaration(),
- o.getAnonymousClassDeclaration()));
- }
- /**
- * Returns whether the given node and the other object match.
- * <p>
- * The default implementation provided by this class tests whether the
- * other object is a node of the same type with structurally isomorphic
- * child subtrees. Subclasses may override this method as needed.
- * </p>
- *
- * @param node the node
- * @param other the other object, or <code>null</code>
- * @return <code>true</code> if the subtree matches, or
- * <code>false</code> if they do not match or the other object has a
- * different node type or is <code>null</code>
- * @since 3.1
- */
- public boolean match(EnumDeclaration node, Object other) {
- if (!(other instanceof EnumDeclaration)) {
- return false;
- }
- EnumDeclaration o = (EnumDeclaration) other;
- return (
- safeSubtreeMatch(node.getJavadoc(), o.getJavadoc())
- && safeSubtreeListMatch(node.modifiers(), o.modifiers())
- && safeSubtreeMatch(node.getName(), o.getName())
- && safeSubtreeListMatch(node.superInterfaceTypes(), o.superInterfaceTypes())
- && safeSubtreeListMatch(node.enumConstants(), o.enumConstants())
- && safeSubtreeListMatch(
- node.bodyDeclarations(),
- o.bodyDeclarations()));
- }
/**
* Returns whether the given node and the other object match.
@@ -1228,28 +1115,6 @@
return safeSubtreeListMatch(node.expressions(), o.expressions());
}
- /**
- * Returns whether the given node and the other object match.
- * <p>
- * The default implementation provided by this class tests whether the
- * other object is a node of the same type with structurally isomorphic
- * child subtrees. Subclasses may override this method as needed.
- * </p>
- *
- * @param node the node
- * @param other the other object, or <code>null</code>
- * @return <code>true</code> if the subtree matches, or
- * <code>false</code> if they do not match or the other object has a
- * different node type or is <code>null</code>
- * @since 3.1
- */
- public boolean match(MarkerAnnotation node, Object other) {
- if (!(other instanceof MarkerAnnotation)) {
- return false;
- }
- MarkerAnnotation o = (MarkerAnnotation) other;
- return safeSubtreeMatch(node.getTypeName(), o.getTypeName());
- }
/**
* Returns whether the given node and the other object match.
@@ -1276,29 +1141,6 @@
&& safeSubtreeMatch(node.getName(), o.getName()));
}
- /**
- * Returns whether the given node and the other object match.
- * <p>
- * The default implementation provided by this class tests whether the
- * other object is a node of the same type with structurally isomorphic
- * child subtrees. Subclasses may override this method as needed.
- * </p>
- *
- * @param node the node
- * @param other the other object, or <code>null</code>
- * @return <code>true</code> if the subtree matches, or
- * <code>false</code> if they do not match or the other object has a
- * different node type or is <code>null</code>
- * @since 3.1
- */
- public boolean match(MemberValuePair node, Object other) {
- if (!(other instanceof MemberValuePair)) {
- return false;
- }
- MemberValuePair o = (MemberValuePair) other;
- return (safeSubtreeMatch(node.getName(), o.getName())
- && safeSubtreeMatch(node.getValue(), o.getValue()));
- }
/**
* Returns whether the given node and the other object match.
@@ -1468,29 +1310,6 @@
return (node.getKeyword() == o.getKeyword());
}
- /**
- * Returns whether the given node and the other object match.
- * <p>
- * The default implementation provided by this class tests whether the
- * other object is a node of the same type with structurally isomorphic
- * child subtrees. Subclasses may override this method as needed.
- * </p>
- *
- * @param node the node
- * @param other the other object, or <code>null</code>
- * @return <code>true</code> if the subtree matches, or
- * <code>false</code> if they do not match or the other object has a
- * different node type or is <code>null</code>
- * @since 3.1
- */
- public boolean match(NormalAnnotation node, Object other) {
- if (!(other instanceof NormalAnnotation)) {
- return false;
- }
- NormalAnnotation o = (NormalAnnotation) other;
- return (safeSubtreeMatch(node.getTypeName(), o.getTypeName())
- && safeSubtreeListMatch(node.values(), o.values()));
- }
/**
* Returns whether the given node and the other object match.
@@ -1803,29 +1622,6 @@
return safeSubtreeMatch(node.getName(), o.getName());
}
- /**
- * Returns whether the given node and the other object match.
- * <p>
- * The default implementation provided by this class tests whether the
- * other object is a node of the same type with structurally isomorphic
- * child subtrees. Subclasses may override this method as needed.
- * </p>
- *
- * @param node the node
- * @param other the other object, or <code>null</code>
- * @return <code>true</code> if the subtree matches, or
- * <code>false</code> if they do not match or the other object has a
- * different node type or is <code>null</code>
- * @since 3.1
- */
- public boolean match(SingleMemberAnnotation node, Object other) {
- if (!(other instanceof SingleMemberAnnotation)) {
- return false;
- }
- SingleMemberAnnotation o = (SingleMemberAnnotation) other;
- return (safeSubtreeMatch(node.getTypeName(), o.getTypeName())
- && safeSubtreeMatch(node.getValue(), o.getValue()));
- }
/**
* Returns whether the given node and the other object match.
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTNode.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTNode.java
index 089d842..6232c9e 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTNode.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTNode.java
@@ -649,21 +649,6 @@
*/
public static final int ENHANCED_FOR_STATEMENT = 70;
- /**
- * Node type constant indicating a node of type
- * <code>EnumDeclaration</code>.
- * @see EnumDeclaration
- * @since 3.1
- */
- public static final int ENUM_DECLARATION = 71;
-
- /**
- * Node type constant indicating a node of type
- * <code>EnumConstantDeclaration</code>.
- * @see EnumConstantDeclaration
- * @since 3.1
- */
- public static final int ENUM_CONSTANT_DECLARATION = 72;
/**
* Node type constant indicating a node of type
@@ -697,53 +682,6 @@
*/
public static final int WILDCARD_TYPE = 76;
- /**
- * Node type constant indicating a node of type
- * <code>NormalAnnotation</code>.
- * @see NormalAnnotation
- * @since 3.1
- */
- public static final int NORMAL_ANNOTATION = 77;
-
- /**
- * Node type constant indicating a node of type
- * <code>MarkerAnnotation</code>.
- * @see MarkerAnnotation
- * @since 3.1
- */
- public static final int MARKER_ANNOTATION = 78;
-
- /**
- * Node type constant indicating a node of type
- * <code>SingleMemberAnnotation</code>.
- * @see SingleMemberAnnotation
- * @since 3.1
- */
- public static final int SINGLE_MEMBER_ANNOTATION = 79;
-
- /**
- * Node type constant indicating a node of type
- * <code>MemberValuePair</code>.
- * @see MemberValuePair
- * @since 3.1
- */
- public static final int MEMBER_VALUE_PAIR = 80;
-
- /**
- * Node type constant indicating a node of type
- * <code>AnnotationTypeDeclaration</code>.
- * @see AnnotationTypeDeclaration
- * @since 3.1
- */
- public static final int ANNOTATION_TYPE_DECLARATION = 81;
-
- /**
- * Node type constant indicating a node of type
- * <code>AnnotationTypeMemberDeclaration</code>.
- * @see AnnotationTypeMemberDeclaration
- * @since 3.1
- */
- public static final int ANNOTATION_TYPE_MEMBER_DECLARATION = 82;
public static final int FOR_IN_STATEMENT = 83;
@@ -781,10 +719,6 @@
*/
public static Class nodeClassForType(int nodeType) {
switch (nodeType) {
- case ANNOTATION_TYPE_DECLARATION :
- return AnnotationTypeDeclaration.class;
- case ANNOTATION_TYPE_MEMBER_DECLARATION :
- return AnnotationTypeMemberDeclaration.class;
case ANONYMOUS_CLASS_DECLARATION :
return AnonymousClassDeclaration.class;
case ARRAY_ACCESS :
@@ -829,10 +763,6 @@
return EmptyStatement.class;
case ENHANCED_FOR_STATEMENT :
return EnhancedForStatement.class;
- case ENUM_CONSTANT_DECLARATION :
- return EnumConstantDeclaration.class;
- case ENUM_DECLARATION :
- return EnumDeclaration.class;
case EXPRESSION_STATEMENT :
return ExpressionStatement.class;
case FIELD_ACCESS :
@@ -859,12 +789,8 @@
return LabeledStatement.class;
case LINE_COMMENT :
return LineComment.class;
- case MARKER_ANNOTATION :
- return MarkerAnnotation.class;
case MEMBER_REF :
return MemberRef.class;
- case MEMBER_VALUE_PAIR :
- return MemberValuePair.class;
case FUNCTION_DECLARATION :
return FunctionDeclaration.class;
case FUNCTION_INVOCATION :
@@ -875,8 +801,6 @@
return FunctionRefParameter.class;
case MODIFIER :
return Modifier.class;
- case NORMAL_ANNOTATION :
- return NormalAnnotation.class;
case NULL_LITERAL :
return NullLiteral.class;
case UNDEFINED_LITERAL :
@@ -905,8 +829,6 @@
return SimpleName.class;
case SIMPLE_TYPE :
return SimpleType.class;
- case SINGLE_MEMBER_ANNOTATION :
- return SingleMemberAnnotation.class;
case SINGLE_VARIABLE_DECLARATION :
return SingleVariableDeclaration.class;
case STRING_LITERAL :
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTSyntaxErrorPropagator.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTSyntaxErrorPropagator.java
index 0356b06..9ed9163 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTSyntaxErrorPropagator.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTSyntaxErrorPropagator.java
@@ -120,20 +120,6 @@
/*
* Method declared on ASTVisitor.
*/
- public boolean visit(AnnotationTypeDeclaration node) {
- return checkAndTagAsMalformed(node);
- }
-
- /*
- * Method declared on ASTVisitor.
- */
- public boolean visit(EnumDeclaration node) {
- return checkAndTagAsMalformed(node);
- }
-
- /*
- * Method declared on ASTVisitor.
- */
public boolean visit(TypeDeclaration node) {
return checkAndTagAsMalformed(node);
}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTVisitor.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTVisitor.java
index 69dadd6..5fbdb67 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTVisitor.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTVisitor.java
@@ -178,41 +178,6 @@
* @return <code>true</code> if the children of this node should be
* visited, and <code>false</code> if the children of this node should
* be skipped
- * @since 3.1
- */
- public boolean visit(AnnotationTypeDeclaration node) {
- return true;
- }
-
-
- /**
- * Visits the given type-specific AST node.
- * <p>
- * The default implementation does nothing and return true.
- * Subclasses may reimplement.
- * </p>
- *
- * @param node the node to visit
- * @return <code>true</code> if the children of this node should be
- * visited, and <code>false</code> if the children of this node should
- * be skipped
- * @since 3.1
- */
- public boolean visit(AnnotationTypeMemberDeclaration node) {
- return true;
- }
-
- /**
- * Visits the given type-specific AST node.
- * <p>
- * The default implementation does nothing and return true.
- * Subclasses may reimplement.
- * </p>
- *
- * @param node the node to visit
- * @return <code>true</code> if the children of this node should be
- * visited, and <code>false</code> if the children of this node should
- * be skipped
*/
public boolean visit(AnonymousClassDeclaration node) {
return true;
@@ -577,40 +542,6 @@
* @return <code>true</code> if the children of this node should be
* visited, and <code>false</code> if the children of this node should
* be skipped
- * @since 3.1
- */
- public boolean visit(EnumConstantDeclaration node) {
- return true;
- }
-
- /**
- * Visits the given type-specific AST node.
- * <p>
- * The default implementation does nothing and return true.
- * Subclasses may reimplement.
- * </p>
- *
- * @param node the node to visit
- * @return <code>true</code> if the children of this node should be
- * visited, and <code>false</code> if the children of this node should
- * be skipped
- * @since 3.1
- */
- public boolean visit(EnumDeclaration node) {
- return true;
- }
-
- /**
- * Visits the given type-specific AST node.
- * <p>
- * The default implementation does nothing and return true.
- * Subclasses may reimplement.
- * </p>
- *
- * @param node the node to visit
- * @return <code>true</code> if the children of this node should be
- * visited, and <code>false</code> if the children of this node should
- * be skipped
*/
public boolean visit(ExpressionStatement node) {
return true;
@@ -820,23 +751,6 @@
return true;
}
- /**
- * Visits the given type-specific AST node.
- * <p>
- * The default implementation does nothing and return true.
- * Subclasses may reimplement.
- * </p>
- *
- * @param node the node to visit
- * @return <code>true</code> if the children of this node should be
- * visited, and <code>false</code> if the children of this node should
- * be skipped
- * @since 3.1
- */
- public boolean visit(MarkerAnnotation node) {
- return true;
- }
-
/**
* Visits the given type-specific AST node.
@@ -867,24 +781,6 @@
* @return <code>true</code> if the children of this node should be
* visited, and <code>false</code> if the children of this node should
* be skipped
- * @since 3.1
- */
- public boolean visit(MemberValuePair node) {
- return true;
- }
-
-
- /**
- * Visits the given type-specific AST node.
- * <p>
- * The default implementation does nothing and return true.
- * Subclasses may reimplement.
- * </p>
- *
- * @param node the node to visit
- * @return <code>true</code> if the children of this node should be
- * visited, and <code>false</code> if the children of this node should
- * be skipped
* @since 3.0
*/
public boolean visit(FunctionRef node) {
@@ -972,23 +868,6 @@
* @return <code>true</code> if the children of this node should be
* visited, and <code>false</code> if the children of this node should
* be skipped
- * @since 3.1
- */
- public boolean visit(NormalAnnotation node) {
- return true;
- }
-
- /**
- * Visits the given type-specific AST node.
- * <p>
- * The default implementation does nothing and return true.
- * Subclasses may reimplement.
- * </p>
- *
- * @param node the node to visit
- * @return <code>true</code> if the children of this node should be
- * visited, and <code>false</code> if the children of this node should
- * be skipped
*/
public boolean visit(NullLiteral node) {
return true;
@@ -1194,23 +1073,6 @@
}
- /**
- * Visits the given type-specific AST node.
- * <p>
- * The default implementation does nothing and return true.
- * Subclasses may reimplement.
- * </p>
- *
- * @param node the node to visit
- * @return <code>true</code> if the children of this node should be
- * visited, and <code>false</code> if the children of this node should
- * be skipped
- * @since 3.1
- */
- public boolean visit(SingleMemberAnnotation node) {
- return true;
- }
-
/**
* Visits the given type-specific AST node.
@@ -1568,31 +1430,6 @@
public boolean visit(FunctionExpression node) {
return true;
}
- /**
- * End of visit the given type-specific AST node.
- * <p>
- * The default implementation does nothing. Subclasses may reimplement.
- * </p>
- *
- * @param node the node to visit
- * @since 3.1
- */
- public void endVisit(AnnotationTypeDeclaration node) {
- // default implementation: do nothing
- }
-
- /**
- * End of visit the given type-specific AST node.
- * <p>
- * The default implementation does nothing. Subclasses may reimplement.
- * </p>
- *
- * @param node the node to visit
- * @since 3.1
- */
- public void endVisit(AnnotationTypeMemberDeclaration node) {
- // default implementation: do nothing
- }
/**
* End of visit the given type-specific AST node.
@@ -1875,32 +1712,6 @@
* </p>
*
* @param node the node to visit
- * @since 3.1
- */
- public void endVisit(EnumConstantDeclaration node) {
- // default implementation: do nothing
- }
-
- /**
- * End of visit the given type-specific AST node.
- * <p>
- * The default implementation does nothing. Subclasses may reimplement.
- * </p>
- *
- * @param node the node to visit
- * @since 3.1
- */
- public void endVisit(EnumDeclaration node) {
- // default implementation: do nothing
- }
-
- /**
- * End of visit the given type-specific AST node.
- * <p>
- * The default implementation does nothing. Subclasses may reimplement.
- * </p>
- *
- * @param node the node to visit
*/
public void endVisit(ExpressionStatement node) {
// default implementation: do nothing
@@ -2057,20 +1868,6 @@
public void endVisit(ListExpression node) {
// default implementation: do nothing
}
-
- /**
- * End of visit the given type-specific AST node.
- * <p>
- * The default implementation does nothing. Subclasses may reimplement.
- * </p>
- *
- * @param node the node to visit
- * @since 3.1
- */
- public void endVisit(MarkerAnnotation node) {
- // default implementation: do nothing
- }
-
/**
* End of visit the given type-specific AST node.
* <p>
@@ -2091,19 +1888,6 @@
* </p>
*
* @param node the node to visit
- * @since 3.1
- */
- public void endVisit(MemberValuePair node) {
- // default implementation: do nothing
- }
-
- /**
- * End of visit the given type-specific AST node.
- * <p>
- * The default implementation does nothing. Subclasses may reimplement.
- * </p>
- *
- * @param node the node to visit
* @since 3.0
*/
public void endVisit(FunctionRef node) {
@@ -2167,19 +1951,6 @@
* </p>
*
* @param node the node to visit
- * @since 3.1
- */
- public void endVisit(NormalAnnotation node) {
- // default implementation: do nothing
- }
-
- /**
- * End of visit the given type-specific AST node.
- * <p>
- * The default implementation does nothing. Subclasses may reimplement.
- * </p>
- *
- * @param node the node to visit
*/
public void endVisit(NullLiteral node) {
// default implementation: do nothing
@@ -2342,19 +2113,6 @@
* </p>
*
* @param node the node to visit
- * @since 3.1
- */
- public void endVisit(SingleMemberAnnotation node) {
- // default implementation: do nothing
- }
-
- /**
- * End of visit the given type-specific AST node.
- * <p>
- * The default implementation does nothing. Subclasses may reimplement.
- * </p>
- *
- * @param node the node to visit
*/
public void endVisit(SingleVariableDeclaration node) {
// default implementation: do nothing
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/Annotation.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/Annotation.java
deleted file mode 100644
index d0f30a6..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/Annotation.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.dom;
-
-/**
- * Abstract base class of AST nodes that represent annotations.
- * <p>
- * <pre>
- * Annotation:
- * NormalAnnotation
- * MarkerAnnotation
- * SingleMemberAnnotation
- * </pre>
- * </p>
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- */
-public abstract class Annotation extends Expression implements IExtendedModifier {
-
- /**
- * Returns structural property descriptor for the "typeName" property
- * of this node.
- *
- * @return the property descriptor
- */
- abstract ChildPropertyDescriptor internalTypeNameProperty();
-
- /**
- * Returns structural property descriptor for the "typeName" property
- * of this node.
- *
- * @return the property descriptor
- */
- public final ChildPropertyDescriptor getTypeNameProperty() {
- return internalTypeNameProperty();
- }
-
- /**
- * Creates and returns a structural property descriptor for the
- * "typeName" property declared on the given concrete node type.
- *
- * @return the property descriptor
- */
- static final ChildPropertyDescriptor internalTypeNamePropertyFactory(Class nodeClass) {
- return new ChildPropertyDescriptor(nodeClass, "typeName", Name.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$
- }
-
- /**
- * The annotation type name; lazily initialized; defaults to an unspecified,
- * legal Java identifier.
- */
- Name typeName = null;
-
- /**
- * Creates a new AST node for an annotation node owned by the
- * given AST.
- * <p>
- * N.B. This constructor is package-private.
- * </p>
- *
- * @param ast the AST that is to own this node
- */
- Annotation(AST ast) {
- super(ast);
- }
-
- /**
- * @see IExtendedModifier#isModifier()
- */
- public boolean isModifier() {
- return false;
- }
-
- /**
- * @see IExtendedModifier#isAnnotation()
- */
- public boolean isAnnotation() {
- return true;
- }
-
- /**
- * Returns the annotation type name of this annotation.
- *
- * @return the annotation type name
- */
- public Name getTypeName() {
- if (this.typeName == null) {
- // lazy init must be thread-safe for readers
- synchronized (this) {
- if (this.typeName == null) {
- preLazyInit();
- this.typeName = new SimpleName(this.ast);
- postLazyInit(this.typeName, internalTypeNameProperty());
- }
- }
- }
- return this.typeName;
- }
-
- /**
- * Sets the annotation type name of this annotation.
- *
- * @param typeName the annotation type name
- * @exception IllegalArgumentException if:
- * <ul>
- * <li>the node belongs to a different AST</li>
- * <li>the node already has a parent</li>
- * </ul>
- */
- public void setTypeName(Name typeName) {
- if (typeName == null) {
- throw new IllegalArgumentException();
- }
- ChildPropertyDescriptor p = internalTypeNameProperty();
- ASTNode oldChild = this.typeName;
- preReplaceChild(oldChild, typeName, p);
- this.typeName = typeName;
- postReplaceChild(oldChild, typeName, p);
- }
-
- /**
- * Returns whether this is a normal annotation
- * ({@link NormalAnnotation}).
- *
- * @return <code>true</code> if this is a normal annotation,
- * and <code>false</code> otherwise
- */
- public boolean isNormalAnnotation() {
- return (this instanceof NormalAnnotation);
- }
-
- /**
- * Returns whether this is a marker annotation
- * ({@link MarkerAnnotation}).
- *
- * @return <code>true</code> if this is a marker annotation,
- * and <code>false</code> otherwise
- */
- public boolean isMarkerAnnotation() {
- return (this instanceof MarkerAnnotation);
- }
-
- /**
- * Returns whether this is a single member annotation.
- * ({@link SingleMemberAnnotation}).
- *
- * @return <code>true</code> if this is a single member annotation,
- * and <code>false</code> otherwise
- */
- public boolean isSingleMemberAnnotation() {
- return (this instanceof SingleMemberAnnotation);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- int memSize() {
- return BASE_NODE_SIZE + 1 * 4;
- }
-
- /**
- * Resolves and returns the resolved annotation for this annotation.
- * <p>
- * Note that bindings (which includes resolved annotations) are generally unavailable unless
- * requested when the AST is being built.
- * </p>
- *
- * @return the resolved annotation, or <code>null</code> if the annotation cannot be resolved
- * @since 3.2
- */
- public IAnnotationBinding resolveAnnotationBinding() {
- return this.ast.getBindingResolver().resolveAnnotation(this);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AnnotationBinding.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AnnotationBinding.java
deleted file mode 100644
index 28b8a9d..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AnnotationBinding.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 BEA Systems, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * tyeung@bea.com - initial API and implementation
- * IBM Corporation - implemented methods from IBinding
- * IBM Corporation - renamed from ResolvedAnnotation to AnnotationBinding
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.dom;
-
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.internal.compiler.lookup.ElementValuePair;
-import org.eclipse.wst.jsdt.internal.compiler.lookup.MethodBinding;
-import org.eclipse.wst.jsdt.internal.compiler.lookup.ReferenceBinding;
-import org.eclipse.wst.jsdt.internal.compiler.util.HashtableOfObject;
-
-/**
- * Internal class
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- */
-class AnnotationBinding implements IAnnotationBinding {
- static final AnnotationBinding[] NoAnnotations = new AnnotationBinding[0];
- private org.eclipse.wst.jsdt.internal.compiler.lookup.AnnotationBinding internalAnnotation;
- private BindingResolver bindingResolver;
-
- AnnotationBinding(org.eclipse.wst.jsdt.internal.compiler.lookup.AnnotationBinding annotation, BindingResolver resolver) {
- if (annotation == null)
- throw new IllegalStateException();
- internalAnnotation = annotation;
- bindingResolver = resolver;
- }
-
- public IAnnotationBinding[] getAnnotations() {
- return NoAnnotations;
- }
-
- public ITypeBinding getAnnotationType() {
- ITypeBinding binding = this.bindingResolver.getTypeBinding(this.internalAnnotation.getAnnotationType());
- if (binding == null || !binding.isAnnotation())
- return null;
- return binding;
- }
-
- public IMemberValuePairBinding[] getDeclaredMemberValuePairs() {
- ElementValuePair[] internalPairs = this.internalAnnotation.getElementValuePairs();
- int length = internalPairs.length;
- IMemberValuePairBinding[] pairs = length == 0 ? MemberValuePairBinding.NoPair : new MemberValuePairBinding[length];
- for (int i = 0; i < length; i++)
- pairs[i] = this.bindingResolver.getMemberValuePairBinding(internalPairs[i]);
- return pairs;
- }
-
- public IMemberValuePairBinding[] getAllMemberValuePairs() {
- IMemberValuePairBinding[] pairs = getDeclaredMemberValuePairs();
- ReferenceBinding typeBinding = this.internalAnnotation.getAnnotationType();
- if (typeBinding == null) return pairs;
- MethodBinding[] methods = typeBinding.availableMethods(); // resilience
- int methodLength = methods == null ? 0 : methods.length;
- if (methodLength == 0) return pairs;
-
- int declaredLength = pairs.length;
- if (declaredLength == methodLength)
- return pairs;
-
- HashtableOfObject table = new HashtableOfObject(declaredLength);
- for (int i = 0; i < declaredLength; i++)
- table.put(((MemberValuePairBinding) pairs[i]).internalName(), pairs[i]);
-
- // handle case of more methods than declared members
- IMemberValuePairBinding[] allPairs = new IMemberValuePairBinding[methodLength];
- for (int i = 0; i < methodLength; i++) {
- Object pair = table.get(methods[i].selector);
- allPairs[i] = pair == null ? new DefaultValuePairBinding(methods[i], this.bindingResolver) : (IMemberValuePairBinding) pair;
- }
- return allPairs;
- }
-
- public IJavaScriptElement getJavaElement() {
- ITypeBinding annotationType = getAnnotationType();
- if (annotationType == null)
- return null;
- return annotationType.getJavaElement();
- }
-
- public String getKey() {
- // TODO when implementing, update spec in IBinding
- return null;
- }
-
- public int getKind() {
- return IBinding.ANNOTATION;
- }
-
- public int getModifiers() {
- return Modifier.NONE;
- }
-
- public String getName() {
- ITypeBinding annotationType = getAnnotationType();
- if (annotationType == null) {
- return new String(this.internalAnnotation.getAnnotationType().sourceName());
- } else {
- return annotationType.getName();
- }
- }
-
- public boolean isDeprecated() {
- ReferenceBinding typeBinding = this.internalAnnotation.getAnnotationType();
- if (typeBinding == null) return false;
- return typeBinding.isDeprecated();
- }
-
- public boolean isEqualTo(IBinding binding) {
- if (this == binding)
- return true;
- if (binding.getKind() != IBinding.ANNOTATION)
- return false;
- IAnnotationBinding other = (IAnnotationBinding) binding;
- if (!getAnnotationType().isEqualTo(other.getAnnotationType()))
- return false;
- IMemberValuePairBinding[] memberValuePairs = getDeclaredMemberValuePairs();
- IMemberValuePairBinding[] otherMemberValuePairs = other.getDeclaredMemberValuePairs();
- if (memberValuePairs.length != otherMemberValuePairs.length)
- return false;
- for (int i = 0, length = memberValuePairs.length; i < length; i++) {
- if (!memberValuePairs[i].isEqualTo(otherMemberValuePairs[i]))
- return false;
- }
- return true;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.IBinding#isRecovered()
- */
- public boolean isRecovered() {
- return false;
- }
-
- public boolean isSynthetic() {
- return false;
- }
-
- public String toString() {
- ITypeBinding type = getAnnotationType();
- final StringBuffer buffer = new StringBuffer();
- buffer.append('@');
- if (type != null)
- buffer.append(type.getName());
- buffer.append('(');
- IMemberValuePairBinding[] pairs = getDeclaredMemberValuePairs();
- for (int i = 0, len = pairs.length; i < len; i++) {
- if (i != 0)
- buffer.append(", "); //$NON-NLS-1$
- buffer.append(pairs[i].toString());
- }
- buffer.append(')');
- return buffer.toString();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AnnotationTypeDeclaration.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AnnotationTypeDeclaration.java
deleted file mode 100644
index fdc91e1..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AnnotationTypeDeclaration.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.dom;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Annotation type declaration AST node type (added in JLS3 API).
- * <pre>
- * AnnotationTypeDeclaration:
- * [ Javadoc ] { ExtendedModifier } <b>@</b> <b>interface</b> Identifier
- * <b>{</b> { AnnotationTypeBodyDeclaration | <b>;</b> } <b>}</b>
- * AnnotationTypeBodyDeclaration:
- * AnnotationTypeMemberDeclaration
- * FieldDeclaration
- * TypeDeclaration
- * EnumDeclaration
- * AnnotationTypeDeclaration
- * </pre>
- * <p>
- * The thing to note is that method declaration are replaced
- * by annotation type member declarations in this context.
- * </p>
- * <p>
- * When a Javadoc comment is present, the source
- * range begins with the first character of the "/**" comment delimiter.
- * When there is no Javadoc comment, the source range begins with the first
- * character of the first modifier keyword (if modifiers), or the
- * first character of the "@interface" (if no
- * modifiers). The source range extends through the last character of the "}"
- * token following the body declarations.
- * </p>
- *
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- */
-public class AnnotationTypeDeclaration extends AbstractTypeDeclaration {
-
- /**
- * The "javadoc" structural property of this node type.
- */
- public static final ChildPropertyDescriptor JAVADOC_PROPERTY =
- internalJavadocPropertyFactory(AnnotationTypeDeclaration.class);
-
- /**
- * The "modifiers" structural property of this node type.
- */
- public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY =
- internalModifiers2PropertyFactory(AnnotationTypeDeclaration.class);
-
- /**
- * The "name" structural property of this node type.
- */
- public static final ChildPropertyDescriptor NAME_PROPERTY =
- internalNamePropertyFactory(AnnotationTypeDeclaration.class);
-
- /**
- * The "bodyDeclarations" structural property of this node type.
- */
- public static final ChildListPropertyDescriptor BODY_DECLARATIONS_PROPERTY =
- internalBodyDeclarationPropertyFactory(AnnotationTypeDeclaration.class);
-
- /**
- * A list of property descriptors (element type:
- * {@link StructuralPropertyDescriptor}),
- * or null if uninitialized.
- */
- private static final List PROPERTY_DESCRIPTORS;
-
- static {
- List properyList = new ArrayList(5);
- createPropertyList(AnnotationTypeDeclaration.class, properyList);
- addProperty(JAVADOC_PROPERTY, properyList);
- addProperty(MODIFIERS2_PROPERTY, properyList);
- addProperty(NAME_PROPERTY, properyList);
- addProperty(BODY_DECLARATIONS_PROPERTY, properyList);
- PROPERTY_DESCRIPTORS = reapPropertyList(properyList);
- }
-
- /**
- * Returns a list of structural property descriptors for this node type.
- * Clients must not modify the result.
- *
- * @param apiLevel the API level; one of the
- * <code>AST.JLS*</code> constants
-
- * @return a list of property descriptors (element type:
- * {@link StructuralPropertyDescriptor})
- */
- public static List propertyDescriptors(int apiLevel) {
- return PROPERTY_DESCRIPTORS;
- }
-
- /**
- * Creates a new AST node for an annotation type declaration owned by the given
- * AST. By default, the type declaration is for an annotation
- * type of an unspecified, but legal, name; no modifiers; no javadoc;
- * and an empty list of body declarations.
- * <p>
- * N.B. This constructor is package-private; all subclasses must be
- * declared in the same package; clients are unable to declare
- * additional subclasses.
- * </p>
- *
- * @param ast the AST that is to own this node
- */
- AnnotationTypeDeclaration(AST ast) {
- super(ast);
- unsupportedIn2();
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final List internalStructuralPropertiesForType(int apiLevel) {
- return propertyDescriptors(apiLevel);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) {
- if (property == JAVADOC_PROPERTY) {
- if (get) {
- return getJavadoc();
- } else {
- setJavadoc((JSdoc) child);
- return null;
- }
- }
- if (property == NAME_PROPERTY) {
- if (get) {
- return getName();
- } else {
- setName((SimpleName) child);
- return null;
- }
- }
- // allow default implementation to flag the error
- return super.internalGetSetChildProperty(property, get, child);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final List internalGetChildListProperty(ChildListPropertyDescriptor property) {
- if (property == MODIFIERS2_PROPERTY) {
- return modifiers();
- }
- if (property == BODY_DECLARATIONS_PROPERTY) {
- return bodyDeclarations();
- }
- // allow default implementation to flag the error
- return super.internalGetChildListProperty(property);
- }
-
- /* (omit javadoc for this method)
- * Method declared on BodyDeclaration.
- */
- final ChildPropertyDescriptor internalJavadocProperty() {
- return JAVADOC_PROPERTY;
- }
-
- /* (omit javadoc for this method)
- * Method declared on BodyDeclaration.
- */
- final ChildListPropertyDescriptor internalModifiers2Property() {
- return MODIFIERS2_PROPERTY;
- }
-
- /* (omit javadoc for this method)
- * Method declared on BodyDeclaration.
- */
- final SimplePropertyDescriptor internalModifiersProperty() {
- // this property will not be asked for (node type did not exist in JLS2)
- return null;
- }
-
- /* (omit javadoc for this method)
- * Method declared on AbstractTypeDeclaration.
- */
- final ChildPropertyDescriptor internalNameProperty() {
- return NAME_PROPERTY;
- }
-
- /* (omit javadoc for this method)
- * Method declared on AbstractTypeDeclaration.
- */
- final ChildListPropertyDescriptor internalBodyDeclarationsProperty() {
- return BODY_DECLARATIONS_PROPERTY;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final int getNodeType0() {
- return ANNOTATION_TYPE_DECLARATION;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- ASTNode clone0(AST target) {
- AnnotationTypeDeclaration result = new AnnotationTypeDeclaration(target);
- result.setSourceRange(this.getStartPosition(), this.getLength());
- result.setJavadoc(
- (JSdoc) ASTNode.copySubtree(target, getJavadoc()));
- result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers()));
- result.setName((SimpleName) getName().clone(target));
- result.bodyDeclarations().addAll(ASTNode.copySubtrees(target, bodyDeclarations()));
- return result;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final boolean subtreeMatch0(ASTMatcher matcher, Object other) {
- // dispatch to correct overloaded match method
- return matcher.match(this, other);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- void accept0(ASTVisitor visitor) {
- boolean visitChildren = visitor.visit(this);
- if (visitChildren) {
- // visit children in normal left to right reading order
- acceptChild(visitor, getJavadoc());
- acceptChildren(visitor, this.modifiers);
- acceptChild(visitor, getName());
- acceptChildren(visitor, this.bodyDeclarations);
- }
- visitor.endVisit(this);
- }
-
- /* (omit javadoc for this method)
- * Method declared on AsbtractTypeDeclaration.
- */
- ITypeBinding internalResolveBinding() {
- return this.ast.getBindingResolver().resolveType(this);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- int memSize() {
- return super.memSize();
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- int treeSize() {
- return
- memSize()
- + (this.optionalDocComment == null ? 0 : getJavadoc().treeSize())
- + this.modifiers.listSize()
- + (this.typeName == null ? 0 : getName().treeSize())
- + this.bodyDeclarations.listSize();
- }
-}
-
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AnnotationTypeMemberDeclaration.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AnnotationTypeMemberDeclaration.java
deleted file mode 100644
index 336d6c0..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AnnotationTypeMemberDeclaration.java
+++ /dev/null
@@ -1,419 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.dom;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Annotation type member declaration AST node type (added in JLS3 API).
- * <pre>
- * AnnotationTypeMemberDeclaration:
- * [ Javadoc ] { ExtendedModifier }
- * Type Identifier <b>(</b> <b>)</b> [ <b>default</b> Expression ] <b>;</b>
- * </pre>
- * <p>
- * Note that annotation type member declarations are only meaningful as
- * elements of {@link AnnotationTypeDeclaration#bodyDeclarations()}.
- * </p>
- * <p>
- * When a Javadoc comment is present, the source
- * range begins with the first character of the "/**" comment delimiter.
- * When there is no Javadoc comment, the source range begins with the first
- * character of the first modifier keyword (if modifiers),
- * or the first character of the member type (no modifiers).
- * The source range extends through the last character of the
- * ";" token.
- * </p>
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- */
-public class AnnotationTypeMemberDeclaration extends BodyDeclaration {
-
- /**
- * The "javadoc" structural property of this node type.
- */
- public static final ChildPropertyDescriptor JAVADOC_PROPERTY =
- internalJavadocPropertyFactory(AnnotationTypeMemberDeclaration.class);
-
- /**
- * The "modifiers" structural property of this node type.
- */
- public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY =
- internalModifiers2PropertyFactory(AnnotationTypeMemberDeclaration.class);
-
- /**
- * The "name" structural property of this node type.
- */
- public static final ChildPropertyDescriptor NAME_PROPERTY =
- new ChildPropertyDescriptor(AnnotationTypeMemberDeclaration.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$
-
- /**
- * The "type" structural property of this node type.
- */
- public static final ChildPropertyDescriptor TYPE_PROPERTY =
- new ChildPropertyDescriptor(AnnotationTypeMemberDeclaration.class, "type", Type.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$
-
- /**
- * The "default" structural property of this node type.
- */
- public static final ChildPropertyDescriptor DEFAULT_PROPERTY =
- new ChildPropertyDescriptor(AnnotationTypeMemberDeclaration.class, "default", Expression.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$
-
- /**
- * A list of property descriptors (element type:
- * {@link StructuralPropertyDescriptor}),
- * or null if uninitialized.
- */
- private static final List PROPERTY_DESCRIPTORS;
-
- static {
- List properyList = new ArrayList(6);
- createPropertyList(AnnotationTypeMemberDeclaration.class, properyList);
- addProperty(JAVADOC_PROPERTY, properyList);
- addProperty(MODIFIERS2_PROPERTY, properyList);
- addProperty(NAME_PROPERTY, properyList);
- addProperty(TYPE_PROPERTY, properyList);
- addProperty(DEFAULT_PROPERTY, properyList);
- PROPERTY_DESCRIPTORS = reapPropertyList(properyList);
- }
-
- /**
- * Returns a list of structural property descriptors for this node type.
- * Clients must not modify the result.
- *
- * @param apiLevel the API level; one of the
- * <code>AST.JLS*</code> constants
- * @return a list of property descriptors (element type:
- * {@link StructuralPropertyDescriptor})
- */
- public static List propertyDescriptors(int apiLevel) {
- return PROPERTY_DESCRIPTORS;
- }
-
- /**
- * The member name; lazily initialized; defaults to an unspecified,
- * legal Java identifier.
- */
- private SimpleName memberName = null;
-
- /**
- * The member type; lazily initialized; defaults to int.
- */
- private Type memberType = null;
-
- /**
- * The optional default expression; <code>null</code> for none; defaults to none.
- */
- private Expression optionalDefaultValue = null;
-
- /**
- * Creates a new AST node for an annotation type member declaration owned
- * by the given AST. By default, the declaration is for a member of an
- * unspecified, but legal, name; no modifiers; no javadoc;
- * an unspecified value type; and no default value.
- * <p>
- * N.B. This constructor is package-private; all subclasses must be
- * declared in the same package; clients are unable to declare
- * additional subclasses.
- * </p>
- *
- * @param ast the AST that is to own this node
- */
- AnnotationTypeMemberDeclaration(AST ast) {
- super(ast);
- unsupportedIn2();
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final List internalStructuralPropertiesForType(int apiLevel) {
- return propertyDescriptors(apiLevel);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) {
- if (property == JAVADOC_PROPERTY) {
- if (get) {
- return getJavadoc();
- } else {
- setJavadoc((JSdoc) child);
- return null;
- }
- }
- if (property == NAME_PROPERTY) {
- if (get) {
- return getName();
- } else {
- setName((SimpleName) child);
- return null;
- }
- }
- if (property == NAME_PROPERTY) {
- if (get) {
- return getName();
- } else {
- setName((SimpleName) child);
- return null;
- }
- }
- if (property == TYPE_PROPERTY) {
- if (get) {
- return getType();
- } else {
- setType((Type) child);
- return null;
- }
- }
- if (property == DEFAULT_PROPERTY) {
- if (get) {
- return getDefault();
- } else {
- setDefault((Expression) child);
- return null;
- }
- }
- // allow default implementation to flag the error
- return super.internalGetSetChildProperty(property, get, child);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final List internalGetChildListProperty(ChildListPropertyDescriptor property) {
- if (property == MODIFIERS2_PROPERTY) {
- return modifiers();
- }
- // allow default implementation to flag the error
- return super.internalGetChildListProperty(property);
- }
-
- /* (omit javadoc for this method)
- * Method declared on BodyDeclaration.
- */
- final ChildPropertyDescriptor internalJavadocProperty() {
- return JAVADOC_PROPERTY;
- }
-
- /* (omit javadoc for this method)
- * Method declared on BodyDeclaration.
- */
- final ChildListPropertyDescriptor internalModifiers2Property() {
- return MODIFIERS2_PROPERTY;
- }
-
- /* (omit javadoc for this method)
- * Method declared on BodyDeclaration.
- */
- final SimplePropertyDescriptor internalModifiersProperty() {
- // this property will not be asked for (node type did not exist in JLS2)
- return null;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final int getNodeType0() {
- return ANNOTATION_TYPE_MEMBER_DECLARATION;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- ASTNode clone0(AST target) {
- AnnotationTypeMemberDeclaration result = new AnnotationTypeMemberDeclaration(target);
- result.setSourceRange(this.getStartPosition(), this.getLength());
- result.setJavadoc(
- (JSdoc) ASTNode.copySubtree(target, getJavadoc()));
- result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers()));
- result.setType((Type) ASTNode.copySubtree(target, getType()));
- result.setName((SimpleName) getName().clone(target));
- result.setDefault((Expression) ASTNode.copySubtree(target, getDefault()));
- return result;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final boolean subtreeMatch0(ASTMatcher matcher, Object other) {
- // dispatch to correct overloaded match method
- return matcher.match(this, other);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- void accept0(ASTVisitor visitor) {
- boolean visitChildren = visitor.visit(this);
- if (visitChildren) {
- // visit children in normal left to right reading order
- acceptChild(visitor, getJavadoc());
- acceptChildren(visitor, this.modifiers);
- acceptChild(visitor, getType());
- acceptChild(visitor, getName());
- acceptChild(visitor, getDefault());
- }
- visitor.endVisit(this);
- }
-
- /**
- * Returns the name of the annotation type member declared in this declaration.
- *
- * @return the member name node
- */
- public SimpleName getName() {
- if (this.memberName == null) {
- // lazy init must be thread-safe for readers
- synchronized (this) {
- if (this.memberName == null) {
- preLazyInit();
- this.memberName = new SimpleName(this.ast);
- postLazyInit(this.memberName, NAME_PROPERTY);
- }
- }
- }
- return this.memberName;
- }
-
- /**
- * Sets the name of the annotation type member declared in this declaration to the
- * given name.
- *
- * @param memberName the new member name
- * @exception IllegalArgumentException if:
- * <ul>
- * <li>the node belongs to a different AST</li>
- * <li>the node already has a parent</li>
- * </ul>
- */
- public void setName(SimpleName memberName) {
- if (memberName == null) {
- throw new IllegalArgumentException();
- }
- ASTNode oldChild = this.memberName;
- preReplaceChild(oldChild, memberName, NAME_PROPERTY);
- this.memberName = memberName;
- postReplaceChild(oldChild, memberName, NAME_PROPERTY);
- }
-
- /**
- * Returns the type of the annotation type member declared in this
- * declaration.
- *
- * @return the type of the member
- */
- public Type getType() {
- if (this.memberType == null) {
- // lazy init must be thread-safe for readers
- synchronized (this) {
- if (this.memberType == null) {
- preLazyInit();
- this.memberType = this.ast.newPrimitiveType(PrimitiveType.INT);
- postLazyInit(this.memberType, TYPE_PROPERTY);
- }
- }
- }
- return this.memberType;
- }
-
- /**
- * Sets the type of the annotation type member declared in this declaration
- * to the given type.
- *
- * @param type the new member type
- * @exception IllegalArgumentException if:
- * <ul>
- * <li>the node belongs to a different AST</li>
- * <li>the node already has a parent</li>
- * </ul>
- */
- public void setType(Type type) {
- if (type == null) {
- throw new IllegalArgumentException();
- }
- ASTNode oldChild = this.memberType;
- preReplaceChild(oldChild, type, TYPE_PROPERTY);
- this.memberType = type;
- postReplaceChild(oldChild, type, TYPE_PROPERTY);
- }
-
- /**
- * Returns the default value of this annotation type member, or
- * <code>null</code> if there is none.
- *
- * @return the expression node, or <code>null</code> if there is none
- */
- public Expression getDefault() {
- return this.optionalDefaultValue;
- }
-
- /**
- * Sets or clears the default value of this annotation type member.
- *
- * @param defaultValue the expression node, or <code>null</code> if
- * there is none
- * @exception IllegalArgumentException if:
- * <ul>
- * <li>the node belongs to a different AST</li>
- * <li>the node already has a parent</li>
- * <li>a cycle in would be created</li>
- * </ul>
- */
- public void setDefault(Expression defaultValue) {
- // a AnnotationTypeMemberDeclaration may occur inside an Expression - must check cycles
- ASTNode oldChild = this.optionalDefaultValue;
- preReplaceChild(oldChild, defaultValue, DEFAULT_PROPERTY);
- this.optionalDefaultValue = defaultValue;
- postReplaceChild(oldChild, defaultValue, DEFAULT_PROPERTY);
- }
-
- /**
- * Resolves and returns the binding for the annotation type member declared
- * in this declaration.
- * <p>
- * Note that bindings are generally unavailable unless requested when the
- * AST is being built.
- * </p>
- *
- * @return the binding, or <code>null</code> if the binding cannot be
- * resolved
- */
- public IFunctionBinding resolveBinding() {
- return this.ast.getBindingResolver().resolveMember(this);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- int memSize() {
- return super.memSize() + 3 * 4;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- int treeSize() {
- return
- memSize()
- + (this.optionalDocComment == null ? 0 : getJavadoc().treeSize())
- + this.modifiers.listSize()
- + (this.memberName == null ? 0 : getName().treeSize())
- + (this.memberType == null ? 0 : getType().treeSize())
- + (this.optionalDefaultValue == null ? 0 : getDefault().treeSize());
- }
-}
-
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/BindingResolver.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/BindingResolver.java
index 93b2877..0a57059 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/BindingResolver.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/BindingResolver.java
@@ -101,21 +101,6 @@
}
/**
- * Finds the corresponding AST node from which the given annotation instance originated.
- *
- * The default implementation of this method returns <code>null</code>.
- * Subclasses may reimplement.
- * </p>
- *
- * @param instance the dom annotation
- * @return the corresponding node where the bindings is declared,
- * or <code>null</code> if none
- */
- ASTNode findDeclaringNode(IAnnotationBinding instance) {
- return null;
- }
-
- /**
* Allows the user to get information about the given old/new pair of
* AST nodes.
* <p>
@@ -259,20 +244,6 @@
return null;
}
- /**
- * Return the new annotation corresponding to the given old annotation
- * <p>
- * The default implementation of this method returns <code>null</code>
- * Subclasses may reimplement.
- * </p>
- *
- * @param instance the old annotation
- * @return the new DOM annotation
- */
- IAnnotationBinding getAnnotationInstance(org.eclipse.wst.jsdt.internal.compiler.lookup.AnnotationBinding instance) {
- return null;
- }
-
boolean isResolvedTypeInferredFromExpectedType(FunctionInvocation methodInvocation) {
return false;
}
@@ -407,27 +378,7 @@
IFunctionBinding resolveConstructor(ConstructorInvocation expression) {
return null;
}
- /**
- * Resolves and returns the binding for the constructor being invoked.
- * <p>
- * The implementation of
- * <code>ConstructorInvocation.resolveConstructor</code>
- * forwards to this method. Which constructor is invoked is often a function
- * of the context in which the expression node is embedded as well as
- * the expression subtree itself.
- * </p>
- * <p>
- * The default implementation of this method returns <code>null</code>.
- * Subclasses may reimplement.
- * </p>
- *
- * @param enumConstantDeclaration the enum constant declaration of interest
- * @return the binding for the constructor being invoked, or
- * <code>null</code> if no binding is available
- */
- IFunctionBinding resolveConstructor(EnumConstantDeclaration enumConstantDeclaration) {
- return null;
- }
+
/**
* Resolves and returns the binding for the constructor being invoked.
* <p>
@@ -535,29 +486,6 @@
}
/**
- * Resolves the given annotation type declaration and returns the binding
- * for it.
- * <p>
- * The implementation of <code>AnnotationTypeMemberDeclaration.resolveBinding</code>
- * forwards to this method. How the declaration resolves is often a
- * function of the context in which the declaration node is embedded as well
- * as the declaration subtree itself.
- * </p>
- * <p>
- * The default implementation of this method returns <code>null</code>.
- * Subclasses may reimplement.
- * </p>
- *
- * @param member the annotation type member declaration of interest
- * @return the binding for the given annotation type member declaration, or <code>null</code>
- * if no binding is available
- * @since 3.0
- */
- IFunctionBinding resolveMember(AnnotationTypeMemberDeclaration member) {
- return null;
- }
-
- /**
* Resolves the given method declaration and returns the binding for it.
* <p>
* The implementation of <code>FunctionDeclaration.resolveBinding</code>
@@ -681,27 +609,6 @@
}
/**
- * Resolves the given member value pair and returns the binding for it.
- * <p>
- * The implementation of <code>MemberValuePair.resolveMemberValuePairBinding</code> forwards to
- * this method. How the name resolves is often a function of the context
- * in which the name node is embedded as well as the name itself.
- * </p>
- * <p>
- * The default implementation of this method returns <code>null</code>.
- * Subclasses may reimplement.
- * </p>
- *
- * @param memberValuePair the member value pair of interest
- * @return the binding for the member value pair, or <code>null</code> if no binding is
- * available
- * @since 3.2
- */
- IMemberValuePairBinding resolveMemberValuePair(MemberValuePair memberValuePair) {
- return null;
- }
-
- /**
* Resolves the given reference and returns the binding for it.
* <p>
* The implementation of <code>FunctionRef.resolveBinding</code> forwards to
@@ -723,29 +630,6 @@
}
/**
- * Resolves the given annotation type declaration and returns the binding
- * for it.
- * <p>
- * The implementation of <code>AnnotationTypeDeclaration.resolveBinding</code>
- * forwards to this method. How the declaration resolves is often a
- * function of the context in which the declaration node is embedded as well
- * as the declaration subtree itself.
- * </p>
- * <p>
- * The default implementation of this method returns <code>null</code>.
- * Subclasses may reimplement.
- * </p>
- *
- * @param type the annotation type declaration of interest
- * @return the binding for the given annotation type declaration, or <code>null</code>
- * if no binding is available
- * @since 3.0
- */
- ITypeBinding resolveType(AnnotationTypeDeclaration type) {
- return null;
- }
-
- /**
* Resolves the given anonymous class declaration and returns the binding
* for it.
* <p>
@@ -768,29 +652,6 @@
}
/**
- * Resolves the given enum declaration and returns the binding
- * for it.
- * <p>
- * The implementation of <code>EnumDeclaration.resolveBinding</code>
- * forwards to this method. How the enum declaration resolves is often
- * a function of the context in which the declaration node is embedded
- * as well as the enum declaration subtree itself.
- * </p>
- * <p>
- * The default implementation of this method returns <code>null</code>.
- * Subclasses may reimplement.
- * </p>
- *
- * @param type the enum declaration of interest
- * @return the binding for the given enum declaration, or <code>null</code>
- * if no binding is available
- * @since 3.0
- */
- ITypeBinding resolveType(EnumDeclaration type) {
- return null;
- }
-
- /**
* Resolves the given type and returns the type binding for it.
* <p>
* The implementation of <code>Type.resolveBinding</code>
@@ -863,26 +724,6 @@
return null;
}
- /**
- * Resolves the given enum constant declaration and returns the binding for
- * the field.
- * <p>
- * The implementation of <code>EnumConstantDeclaration.resolveVariable</code>
- * forwards to this method.
- * </p>
- * <p>
- * The default implementation of this method returns <code>null</code>.
- * Subclasses may reimplement.
- * </p>
- *
- * @param enumConstant the enum constant declaration of interest
- * @return the field binding for the given enum constant declaration, or
- * <code>null</code> if no binding is available
- * @since 3.0
- */
- IVariableBinding resolveVariable(EnumConstantDeclaration enumConstant) {
- return null;
- }
/**
* Resolves the given variable declaration and returns the binding for it.
@@ -933,24 +774,6 @@
return null;
}
- /**
- * Resolves the given annotation instance and returns the DOM representation for it.
- * <p>
- * The implementation of {@link Annotation#resolveAnnotationBinding()}
- * forwards to this method.
- * </p>
- * <p>
- * The default implementation of this method returns <code>null</code>.
- * Subclasses may reimplement.
- * </p>
- *
- * @param annotation the annotation ast node of interest
- * @return the DOM annotation representation for the given ast node, or
- * <code>null</code> if none is available
- */
- IAnnotationBinding resolveAnnotation(Annotation annotation) {
- return null;
- }
/**
* Answer an array type binding with the given type binding and the given
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/DefaultASTVisitor.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/DefaultASTVisitor.java
index b196f9c..7bb86f7 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/DefaultASTVisitor.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/DefaultASTVisitor.java
@@ -110,12 +110,6 @@
public void endVisit(EnhancedForStatement node) {
endVisitNode(node);
}
- public void endVisit(EnumConstantDeclaration node) {
- endVisitNode(node);
- }
- public void endVisit(EnumDeclaration node) {
- endVisitNode(node);
- }
public void endVisit(ExpressionStatement node) {
endVisitNode(node);
@@ -168,9 +162,6 @@
public void endVisit(MemberRef node) {
endVisitNode(node);
}
- public void endVisit(MemberValuePair node) {
- endVisitNode(node);
- }
public void endVisit(FunctionDeclaration node) {
endVisitNode(node);
}
@@ -372,12 +363,6 @@
public boolean visit(EnhancedForStatement node) {
return visitNode(node);
}
- public boolean visit(EnumConstantDeclaration node) {
- return visitNode(node);
- }
- public boolean visit(EnumDeclaration node) {
- return visitNode(node);
- }
public boolean visit(ExpressionStatement node) {
return visitNode(node);
}
@@ -433,9 +418,6 @@
public boolean visit(MemberRef node) {
return visitNode(node);
}
- public boolean visit(MemberValuePair node) {
- return visitNode(node);
- }
public boolean visit(FunctionDeclaration node) {
return visitNode(node);
}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/DefaultBindingResolver.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/DefaultBindingResolver.java
index 002d282..e41eb91 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/DefaultBindingResolver.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/DefaultBindingResolver.java
@@ -32,7 +32,6 @@
import org.eclipse.wst.jsdt.internal.compiler.ast.JavadocSingleTypeReference;
import org.eclipse.wst.jsdt.internal.compiler.ast.Literal;
import org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration;
-import org.eclipse.wst.jsdt.internal.compiler.ast.MemberValuePair;
import org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend;
import org.eclipse.wst.jsdt.internal.compiler.ast.ParameterizedQualifiedTypeReference;
import org.eclipse.wst.jsdt.internal.compiler.ast.QualifiedNameReference;
@@ -48,7 +47,6 @@
import org.eclipse.wst.jsdt.internal.compiler.lookup.BlockScope;
import org.eclipse.wst.jsdt.internal.compiler.lookup.CompilationUnitBinding;
import org.eclipse.wst.jsdt.internal.compiler.lookup.CompilationUnitScope;
-import org.eclipse.wst.jsdt.internal.compiler.lookup.ElementValuePair;
import org.eclipse.wst.jsdt.internal.compiler.lookup.FieldBinding;
import org.eclipse.wst.jsdt.internal.compiler.lookup.LocalVariableBinding;
import org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment;
@@ -234,17 +232,6 @@
return null;
}
- synchronized IMemberValuePairBinding getMemberValuePairBinding(ElementValuePair valuePair) {
- if (valuePair == null) return null;
- IMemberValuePairBinding binding =
- (IMemberValuePairBinding) this.bindingTables.compilerBindingsToASTBindings.get(valuePair);
- if (binding != null)
- return binding;
- binding = new MemberValuePairBinding(valuePair, this);
- this.bindingTables.compilerBindingsToASTBindings.put(valuePair, binding);
- return binding;
- }
-
/*
* Method declared on BindingResolver.
*/
@@ -490,17 +477,6 @@
}
- synchronized IAnnotationBinding getAnnotationInstance(org.eclipse.wst.jsdt.internal.compiler.lookup.AnnotationBinding internalInstance) {
- if (internalInstance == null) return null;
- IAnnotationBinding domInstance =
- (IAnnotationBinding) this.bindingTables.compilerBindingsToASTBindings.get(internalInstance);
- if (domInstance != null)
- return domInstance;
- domInstance = new AnnotationBinding(internalInstance, this);
- this.bindingTables.compilerBindingsToASTBindings.put(internalInstance, domInstance);
- return domInstance;
- }
-
/*
* Method declared on BindingResolver.
*/
@@ -591,21 +567,6 @@
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.BindingResolver#resolveConstructor(org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration)
- */
- IFunctionBinding resolveConstructor(EnumConstantDeclaration enumConstantDeclaration) {
- org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode node = (org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode) this.newAstToOldAst.get(enumConstantDeclaration);
- if (node instanceof org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration) {
- org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration fieldDeclaration = (org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration) node;
- if (fieldDeclaration.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT && fieldDeclaration.initialization != null) {
- AllocationExpression allocationExpression = (AllocationExpression) fieldDeclaration.initialization;
- return this.getMethodBinding(allocationExpression.binding);
- }
- }
- return null;
- }
-
/*
* @see BindingResolver#resolveConstructor(SuperConstructorInvocation)
*/
@@ -656,14 +617,6 @@
case ASTNode.FUNCTION_INVOCATION :
case ASTNode.SUPER_METHOD_INVOCATION :
case ASTNode.CONDITIONAL_EXPRESSION :
- case ASTNode.MARKER_ANNOTATION :
- case ASTNode.NORMAL_ANNOTATION :
- case ASTNode.SINGLE_MEMBER_ANNOTATION :
- org.eclipse.wst.jsdt.internal.compiler.ast.Expression compilerExpression = (org.eclipse.wst.jsdt.internal.compiler.ast.Expression) this.newAstToOldAst.get(expression);
- if (compilerExpression != null) {
- return this.getTypeBinding(compilerExpression.resolvedType);
- }
- break;
case ASTNode.STRING_LITERAL :
if (this.scope != null) {
return this.getTypeBinding(this.scope.getJavaLangString());
@@ -791,27 +744,6 @@
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.BindingResolver#resolveMember(org.eclipse.wst.jsdt.core.dom.AnnotationTypeMemberDeclaration)
- */
- IFunctionBinding resolveMember(AnnotationTypeMemberDeclaration declaration) {
- Object oldNode = this.newAstToOldAst.get(declaration);
- if (oldNode instanceof AbstractMethodDeclaration) {
- AbstractMethodDeclaration methodDeclaration = (AbstractMethodDeclaration) oldNode;
- IFunctionBinding methodBinding = this.getMethodBinding(methodDeclaration.binding);
- if (methodBinding == null) {
- return null;
- }
- this.bindingsToAstNodes.put(methodBinding, declaration);
- String key = methodBinding.getKey();
- if (key != null) {
- this.bindingTables.bindingKeysToBindings.put(key, methodBinding);
- }
- return methodBinding;
- }
- return null;
- }
-
/*
* Method declared on BindingResolver.
*/
@@ -1377,15 +1309,6 @@
}
/* (non-Javadoc)
- * @see BindingResolver#resolveMemberValuePair(MemberValuePair)
- * @since 3.2
- */
- synchronized IMemberValuePairBinding resolveMemberValuePair(org.eclipse.wst.jsdt.core.dom.MemberValuePair memberValuePair) {
- MemberValuePair valuePair = (MemberValuePair) this.newAstToOldAst.get(memberValuePair);
- return getMemberValuePairBinding(valuePair.compilerElementPair);
- }
-
- /* (non-Javadoc)
* @see BindingResolver#resolveReference(FunctionRef)
* @since 3.0
*/
@@ -1400,26 +1323,6 @@
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.BindingResolver#resolveType(org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration)
- */
- ITypeBinding resolveType(AnnotationTypeDeclaration type) {
- final Object node = this.newAstToOldAst.get(type);
- if (node instanceof org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration) {
- org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration typeDeclaration = (org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration) node;
- ITypeBinding typeBinding = this.getTypeBinding(typeDeclaration.binding);
- if (typeBinding == null) {
- return null;
- }
- this.bindingsToAstNodes.put(typeBinding, type);
- String key = typeBinding.getKey();
- if (key != null) {
- this.bindingTables.bindingKeysToBindings.put(key, typeBinding);
- }
- return typeBinding;
- }
- return null;
- }
/*
* @see BindingResolver#resolveType(AnonymousClassDeclaration)
*/
@@ -1441,27 +1344,6 @@
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.BindingResolver#resolveType(org.eclipse.wst.jsdt.core.dom.EnumDeclaration)
- */
- ITypeBinding resolveType(EnumDeclaration type) {
- final Object node = this.newAstToOldAst.get(type);
- if (node instanceof org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration) {
- org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration typeDeclaration = (org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration) node;
- ITypeBinding typeBinding = this.getTypeBinding(typeDeclaration.binding);
- if (typeBinding == null) {
- return null;
- }
- this.bindingsToAstNodes.put(typeBinding, type);
- String key = typeBinding.getKey();
- if (key != null) {
- this.bindingTables.bindingKeysToBindings.put(key, typeBinding);
- }
- return typeBinding;
- }
- return null;
- }
-
/*
* Method declared on BindingResolver.
*/
@@ -1590,26 +1472,6 @@
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.BindingResolver#resolveVariable(org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration)
- */
- synchronized IVariableBinding resolveVariable(EnumConstantDeclaration enumConstant) {
- final Object node = this.newAstToOldAst.get(enumConstant);
- if (node instanceof org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration) {
- org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration fieldDeclaration = (org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration) node;
- IVariableBinding variableBinding = this.getVariableBinding(fieldDeclaration.binding);
- if (variableBinding == null) {
- return null;
- }
- this.bindingsToAstNodes.put(variableBinding, enumConstant);
- String key = variableBinding.getKey();
- if (key != null) {
- this.bindingTables.bindingKeysToBindings.put(key, variableBinding);
- }
- return variableBinding;
- }
- return null;
- }
/*
* Method declared on BindingResolver.
*/
@@ -1743,20 +1605,6 @@
return null;
}
- synchronized IAnnotationBinding resolveAnnotation(final Annotation domASTNode) {
- Object oldNode = this.newAstToOldAst.get(domASTNode);
- if (oldNode instanceof org.eclipse.wst.jsdt.internal.compiler.ast.Annotation) {
- org.eclipse.wst.jsdt.internal.compiler.ast.Annotation internalAstNode =
- (org.eclipse.wst.jsdt.internal.compiler.ast.Annotation) oldNode;
-
- IAnnotationBinding domAnnotation = this.getAnnotationInstance(internalAstNode.getCompilerAnnotation());
- if (domAnnotation == null)
- return null;
- this.bindingsToAstNodes.put(domAnnotation, domASTNode);
- return domAnnotation;
- }
- return null;
- }
/*
* Method declared on BindingResolver.
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/DefaultValuePairBinding.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/DefaultValuePairBinding.java
deleted file mode 100644
index 7615cbb..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/DefaultValuePairBinding.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 BEA Systems, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * tyeung@bea.com - initial API and implementation
- * IBM Corporation - implemented methods from IBinding
- * IBM Corporation - renamed from ResolvedDefaultValuePair to DefaultValuePairBinding
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.dom;
-
-
-/**
- * Member value pair which compose of default values.
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- */
-class DefaultValuePairBinding extends MemberValuePairBinding {
-
- private org.eclipse.wst.jsdt.internal.compiler.lookup.MethodBinding method;
-
- DefaultValuePairBinding(org.eclipse.wst.jsdt.internal.compiler.lookup.MethodBinding binding, BindingResolver resolver) {
- super(null, resolver);
- this.method = binding;
- this.value = MemberValuePairBinding.buildDOMValue(binding.getDefaultValue(), resolver);
- }
-
- public IFunctionBinding getMethodBinding() {
- return this.bindingResolver.getMethodBinding(this.method);
- }
-
- public String getName() {
- return new String(this.method.selector);
- }
-
- public Object getValue() {
- return this.value;
- }
-
- public boolean isDefault() {
- return true;
- }
-
- public boolean isDeprecated() {
- return this.method.isDeprecated();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/EnumConstantDeclaration.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/EnumConstantDeclaration.java
deleted file mode 100644
index 2c8d219..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/EnumConstantDeclaration.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.jsdt.core.dom;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Enumeration constant declaration AST node type (added in JLS3 API).
- *
- * <pre>
- * EnumConstantDeclaration:
- * [ Javadoc ] { ExtendedModifier } Identifier
- * [ <b>(</b> [ Expression { <b>,</b> Expression } ] <b>)</b> ]
- * [ AnonymousClassDeclaration ]
- * </pre>
- * <p>
- * When a Javadoc comment is present, the source
- * range begins with the first character of the "/**" comment delimiter.
- * When there is no Javadoc comment, the source range begins with the first
- * character of the identifier. If there are class body declarations, the
- * source range extends through the last character of the last character of
- * the "}" token following the body declarations. If there are arguments but
- * no class body declarations, the source range extends through the last
- * character of the ")" token following the arguments. If there are no
- * arguments and no class body declarations, the source range extends through
- * the last character of the identifier.
- * </p>
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- */
-public class EnumConstantDeclaration extends BodyDeclaration {
-
- /**
- * The "javadoc" structural property of this node type.
- */
- public static final ChildPropertyDescriptor JAVADOC_PROPERTY =
- internalJavadocPropertyFactory(EnumConstantDeclaration.class);
-
- /**
- * The "modifiers" structural property of this node type).
- */
- public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY =
- internalModifiers2PropertyFactory(EnumConstantDeclaration.class);
-
- /**
- * The "name" structural property of this node type.
- */
- public static final ChildPropertyDescriptor NAME_PROPERTY =
- new ChildPropertyDescriptor(EnumConstantDeclaration.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$
-
- /**
- * The "arguments" structural property of this node type.
- */
- public static final ChildListPropertyDescriptor ARGUMENTS_PROPERTY =
- new ChildListPropertyDescriptor(EnumConstantDeclaration.class, "arguments", Expression.class, NO_CYCLE_RISK); //$NON-NLS-1$
-
- /**
- * The "anonymousClassDeclaration" structural property of this node type.
- */
- public static final ChildPropertyDescriptor ANONYMOUS_CLASS_DECLARATION_PROPERTY =
- new ChildPropertyDescriptor(EnumConstantDeclaration.class, "anonymousClassDeclaration", AnonymousClassDeclaration.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$
-
- /**
- * A list of property descriptors (element type:
- * {@link StructuralPropertyDescriptor}),
- * or null if uninitialized.
- */
- private static final List PROPERTY_DESCRIPTORS;
-
- static {
- List properyList = new ArrayList(6);
- createPropertyList(EnumConstantDeclaration.class, properyList);
- addProperty(JAVADOC_PROPERTY, properyList);
- addProperty(MODIFIERS2_PROPERTY, properyList);
- addProperty(NAME_PROPERTY, properyList);
- addProperty(ARGUMENTS_PROPERTY, properyList);
- addProperty(ANONYMOUS_CLASS_DECLARATION_PROPERTY, properyList);
- PROPERTY_DESCRIPTORS = reapPropertyList(properyList);
- }
-
- /**
- * Returns a list of structural property descriptors for this node type.
- * Clients must not modify the result.
- *
- * @param apiLevel the API level; one of the
- * <code>AST.JLS*</code> constants
-
- * @return a list of property descriptors (element type:
- * {@link StructuralPropertyDescriptor})
- */
- public static List propertyDescriptors(int apiLevel) {
- return PROPERTY_DESCRIPTORS;
- }
-
- /**
- * The constant name; lazily initialized; defaults to a unspecified,
- * legal Java class identifier.
- */
- private SimpleName constantName = null;
-
- /**
- * The list of argument expressions (element type:
- * <code>Expression</code>). Defaults to an empty list.
- */
- private ASTNode.NodeList arguments =
- new ASTNode.NodeList(ARGUMENTS_PROPERTY);
-
- /**
- * The optional anonymous class declaration; <code>null</code> for none;
- * defaults to none.
- */
- private AnonymousClassDeclaration optionalAnonymousClassDeclaration = null;
-
- /**
- * Creates a new AST node for an enumeration constants declaration owned by
- * the given AST. By default, the enumeration constant has an unspecified,
- * but legal, name; no javadoc; an empty list of modifiers and annotations;
- * an empty list of arguments; and does not declare an anonymous class.
- * <p>
- * N.B. This constructor is package-private; all subclasses must be
- * declared in the same package; clients are unable to declare
- * additional subclasses.
- * </p>
- *
- * @param ast the AST that is to own this node
- */
- EnumConstantDeclaration(AST ast) {
- super(ast);
- unsupportedIn2();
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final List internalStructuralPropertiesForType(int apiLevel) {
- return propertyDescriptors(apiLevel);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) {
- if (property == JAVADOC_PROPERTY) {
- if (get) {
- return getJavadoc();
- } else {
- setJavadoc((JSdoc) child);
- return null;
- }
- }
- if (property == NAME_PROPERTY) {
- if (get) {
- return getName();
- } else {
- setName((SimpleName) child);
- return null;
- }
- }
- if (property == ANONYMOUS_CLASS_DECLARATION_PROPERTY) {
- if (get) {
- return getAnonymousClassDeclaration();
- } else {
- setAnonymousClassDeclaration((AnonymousClassDeclaration) child);
- return null;
- }
- }
- // allow default implementation to flag the error
- return super.internalGetSetChildProperty(property, get, child);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final List internalGetChildListProperty(ChildListPropertyDescriptor property) {
- if (property == MODIFIERS2_PROPERTY) {
- return modifiers();
- }
- if (property == ARGUMENTS_PROPERTY) {
- return arguments();
- }
- // allow default implementation to flag the error
- return super.internalGetChildListProperty(property);
- }
-
- /* (omit javadoc for this method)
- * Method declared on BodyDeclaration.
- */
- final ChildPropertyDescriptor internalJavadocProperty() {
- return JAVADOC_PROPERTY;
- }
-
- /* (omit javadoc for this method)
- * Method declared on BodyDeclaration.
- */
- final ChildListPropertyDescriptor internalModifiers2Property() {
- return MODIFIERS2_PROPERTY;
- }
-
- /* (omit javadoc for this method)
- * Method declared on BodyDeclaration.
- */
- final SimplePropertyDescriptor internalModifiersProperty() {
- // this property will not be asked for (node type did not exist in JLS2)
- return null;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final int getNodeType0() {
- return ENUM_CONSTANT_DECLARATION;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- ASTNode clone0(AST target) {
- EnumConstantDeclaration result = new EnumConstantDeclaration(target);
- result.setSourceRange(this.getStartPosition(), this.getLength());
- result.setJavadoc(
- (JSdoc) ASTNode.copySubtree(target, getJavadoc()));
- result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers()));
- result.setName((SimpleName) getName().clone(target));
- result.arguments().addAll(ASTNode.copySubtrees(target, arguments()));
- result.setAnonymousClassDeclaration(
- (AnonymousClassDeclaration) ASTNode.copySubtree(target, getAnonymousClassDeclaration()));
- return result;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final boolean subtreeMatch0(ASTMatcher matcher, Object other) {
- // dispatch to correct overloaded match method
- return matcher.match(this, other);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- void accept0(ASTVisitor visitor) {
- boolean visitChildren = visitor.visit(this);
- if (visitChildren) {
- // visit children in normal left to right reading order
- acceptChild(visitor, getJavadoc());
- acceptChildren(visitor, this.modifiers);
- acceptChild(visitor, getName());
- acceptChildren(visitor, this.arguments);
- acceptChild(visitor, getAnonymousClassDeclaration());
- }
- visitor.endVisit(this);
- }
-
- /**
- * Returns the name of the constant declared in this enum declaration.
- *
- * @return the constant name node
- */
- public SimpleName getName() {
- if (this.constantName == null) {
- // lazy init must be thread-safe for readers
- synchronized (this) {
- if (this.constantName == null) {
- preLazyInit();
- this.constantName = new SimpleName(this.ast);
- postLazyInit(this.constantName, NAME_PROPERTY);
- }
- }
- }
- return this.constantName;
- }
-
- /**
- * Sets the name of the constant declared in this enum declaration to the
- * given name.
- *
- * @param constantName the new constant name
- * @exception IllegalArgumentException if:
- * <ul>
- * <li>the node belongs to a different AST</li>
- * <li>the node already has a parent</li>
- * </ul>
- */
- public void setName(SimpleName constantName) {
- if (constantName == null) {
- throw new IllegalArgumentException();
- }
- ASTNode oldChild = this.constantName;
- preReplaceChild(oldChild, constantName, NAME_PROPERTY);
- this.constantName = constantName;
- postReplaceChild(oldChild, constantName, NAME_PROPERTY);
- }
-
- /**
- * Returns the live ordered list of argument expressions in this enumeration
- * constant declaration. Note that an empty list of arguments is equivalent
- * to not explicitly specifying arguments.
- *
- * @return the live list of argument expressions
- * (element type: <code>Expression</code>)
- */
- public List arguments() {
- return this.arguments;
- }
-
- /**
- * Returns the anonymous class declaration introduced by this
- * enum constant declaration, if it has one.
- *
- * @return the anonymous class declaration, or <code>null</code> if none
- */
- public AnonymousClassDeclaration getAnonymousClassDeclaration() {
- return this.optionalAnonymousClassDeclaration;
- }
-
- /**
- * Sets whether this enum constant declaration declares
- * an anonymous class (that is, has class body declarations).
- *
- * @param decl the anonymous class declaration, or <code>null</code>
- * if none
- */
- public void setAnonymousClassDeclaration(AnonymousClassDeclaration decl) {
- ASTNode oldChild = this.optionalAnonymousClassDeclaration;
- preReplaceChild(oldChild, decl, ANONYMOUS_CLASS_DECLARATION_PROPERTY);
- this.optionalAnonymousClassDeclaration = decl;
- postReplaceChild(oldChild, decl, ANONYMOUS_CLASS_DECLARATION_PROPERTY);
- }
-
- /**
- * Resolves and returns the binding for the constructor invoked by this
- * enum constant.
- * <p>
- * Note that bindings are generally unavailable unless requested when the
- * AST is being built.
- * </p>
- *
- * @return the constructor binding, or <code>null</code> if the binding
- * cannot be resolved
- */
- public IFunctionBinding resolveConstructorBinding() {
- return this.ast.getBindingResolver().resolveConstructor(this);
- }
-
- /**
- * Resolves and returns the field binding for this enum constant.
- * <p>
- * Note that bindings are generally unavailable unless requested when the
- * AST is being built.
- * </p>
- *
- * @return the binding, or <code>null</code> if the binding cannot be
- * resolved
- */
- public IVariableBinding resolveVariable() {
- return this.ast.getBindingResolver().resolveVariable(this);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- int memSize() {
- return super.memSize() + 3 * 4;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- int treeSize() {
- return
- memSize()
- + (this.optionalDocComment == null ? 0 : getJavadoc().treeSize())
- + this.modifiers.listSize()
- + (this.constantName == null ? 0 : getName().treeSize())
- + this.arguments.listSize()
- + (this.optionalAnonymousClassDeclaration == null ? 0 : getAnonymousClassDeclaration().treeSize());
- }
-}
-
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/EnumDeclaration.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/EnumDeclaration.java
deleted file mode 100644
index 6b34bfa..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/EnumDeclaration.java
+++ /dev/null
@@ -1,337 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.dom;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Enum declaration AST node type (added in JLS3 API).
- *
- * <pre>
- * EnumDeclaration:
- * [ Javadoc ] { ExtendedModifier } <b>enum</b> Identifier
- * [ <b>implements</b> Type { <b>,</b> Type } ]
- * <b>{</b>
- * [ EnumConstantDeclaration { <b>,</b> EnumConstantDeclaration } ] [ <b>,</b> ]
- * [ <b>;</b> { ClassBodyDeclaration | <b>;</b> } ]
- * <b>}</b>
- * </pre>
- * The {@link #enumConstants()} list holds the enum constant declarations,
- * while the {@link #bodyDeclarations()} list holds the class body declarations
- * that appear after the semicolon.
- * <p>
- * When a Javadoc comment is present, the source
- * range begins with the first character of the "/**" comment delimiter.
- * When there is no Javadoc comment, the source range begins with the first
- * character of the first modifier or annotation (if present), or the
- * first character of the "enum" keyword (if no
- * modifiers or annotations). The source range extends through the last
- * character of the "}" token following the body declarations.
- * </p>
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- */
-public class EnumDeclaration extends AbstractTypeDeclaration {
-
- /**
- * The "javadoc" structural property of this node type.
- */
- public static final ChildPropertyDescriptor JAVADOC_PROPERTY =
- internalJavadocPropertyFactory(EnumDeclaration.class);
-
- /**
- * The "modifiers" structural property of this node type (added in JLS3 API).
- */
- public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY =
- internalModifiers2PropertyFactory(EnumDeclaration.class);
-
- /**
- * The "name" structural property of this node type.
- */
- public static final ChildPropertyDescriptor NAME_PROPERTY =
- internalNamePropertyFactory(EnumDeclaration.class);
-
- /**
- * The "superInterfaceTypes" structural property of this node type.
- */
- public static final ChildListPropertyDescriptor SUPER_INTERFACE_TYPES_PROPERTY =
- new ChildListPropertyDescriptor(EnumDeclaration.class, "superInterfaceTypes", Type.class, NO_CYCLE_RISK); //$NON-NLS-1$
-
- /**
- * The "enumConstants" structural property of this node type.
- */
- public static final ChildListPropertyDescriptor ENUM_CONSTANTS_PROPERTY =
- new ChildListPropertyDescriptor(EnumDeclaration.class, "enumConstants", EnumConstantDeclaration.class, CYCLE_RISK); //$NON-NLS-1$
-
- /**
- * The "bodyDeclarations" structural property of this node type.
- */
- public static final ChildListPropertyDescriptor BODY_DECLARATIONS_PROPERTY =
- internalBodyDeclarationPropertyFactory(EnumDeclaration.class);
-
- /**
- * A list of property descriptors (element type:
- * {@link StructuralPropertyDescriptor}),
- * or null if uninitialized.
- */
- private static final List PROPERTY_DESCRIPTORS;
-
- static {
- List properyList = new ArrayList(6);
- createPropertyList(EnumDeclaration.class, properyList);
- addProperty(JAVADOC_PROPERTY, properyList);
- addProperty(MODIFIERS2_PROPERTY, properyList);
- addProperty(NAME_PROPERTY, properyList);
- addProperty(SUPER_INTERFACE_TYPES_PROPERTY, properyList);
- addProperty(ENUM_CONSTANTS_PROPERTY, properyList);
- addProperty(BODY_DECLARATIONS_PROPERTY, properyList);
- PROPERTY_DESCRIPTORS = reapPropertyList(properyList);
- }
-
- /**
- * Returns a list of structural property descriptors for this node type.
- * Clients must not modify the result.
- *
- * @param apiLevel the API level; one of the
- * <code>AST.JLS*</code> constants
-
- * @return a list of property descriptors (element type:
- * {@link StructuralPropertyDescriptor})
- */
- public static List propertyDescriptors(int apiLevel) {
- return PROPERTY_DESCRIPTORS;
- }
-
- /**
- * The superinterface types (element type: <code>Type</code>).
- * Defaults to an empty list.
- */
- private ASTNode.NodeList superInterfaceTypes =
- new ASTNode.NodeList(SUPER_INTERFACE_TYPES_PROPERTY);
-
- /**
- * The enum constant declarations
- * (element type: <code>EnumConstantDeclaration</code>).
- * Defaults to an empty list.
- */
- private ASTNode.NodeList enumConstants =
- new ASTNode.NodeList(ENUM_CONSTANTS_PROPERTY);
-
- /**
- * Creates a new AST node for an enum declaration owned by the given
- * AST. By default, the enum declaration has an unspecified, but legal,
- * name; no modifiers; no javadoc; no superinterfaces;
- * and empty lists of enum constants and body declarations.
- * <p>
- * N.B. This constructor is package-private; all subclasses must be
- * declared in the same package; clients are unable to declare
- * additional subclasses.
- * </p>
- *
- * @param ast the AST that is to own this node
- */
- EnumDeclaration(AST ast) {
- super(ast);
- unsupportedIn2();
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final List internalStructuralPropertiesForType(int apiLevel) {
- return propertyDescriptors(apiLevel);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) {
- if (property == JAVADOC_PROPERTY) {
- if (get) {
- return getJavadoc();
- } else {
- setJavadoc((JSdoc) child);
- return null;
- }
- }
- if (property == NAME_PROPERTY) {
- if (get) {
- return getName();
- } else {
- setName((SimpleName) child);
- return null;
- }
- }
- // allow default implementation to flag the error
- return super.internalGetSetChildProperty(property, get, child);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final List internalGetChildListProperty(ChildListPropertyDescriptor property) {
- if (property == MODIFIERS2_PROPERTY) {
- return modifiers();
- }
- if (property == SUPER_INTERFACE_TYPES_PROPERTY) {
- return superInterfaceTypes();
- }
- if (property == ENUM_CONSTANTS_PROPERTY) {
- return enumConstants();
- }
- if (property == BODY_DECLARATIONS_PROPERTY) {
- return bodyDeclarations();
- }
- // allow default implementation to flag the error
- return super.internalGetChildListProperty(property);
- }
-
- /* (omit javadoc for this method)
- * Method declared on BodyDeclaration.
- */
- final ChildPropertyDescriptor internalJavadocProperty() {
- return JAVADOC_PROPERTY;
- }
-
- /* (omit javadoc for this method)
- * Method declared on BodyDeclaration.
- */
- final ChildListPropertyDescriptor internalModifiers2Property() {
- return MODIFIERS2_PROPERTY;
- }
-
- /* (omit javadoc for this method)
- * Method declared on BodyDeclaration.
- */
- final SimplePropertyDescriptor internalModifiersProperty() {
- // this property will not be asked for (node type did not exist in JLS2)
- return null;
- }
-
- /* (omit javadoc for this method)
- * Method declared on AbstractTypeDeclaration.
- */
- final ChildPropertyDescriptor internalNameProperty() {
- return NAME_PROPERTY;
- }
-
- /* (omit javadoc for this method)
- * Method declared on AbstractTypeDeclaration.
- */
- final ChildListPropertyDescriptor internalBodyDeclarationsProperty() {
- return BODY_DECLARATIONS_PROPERTY;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final int getNodeType0() {
- return ENUM_DECLARATION;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- ASTNode clone0(AST target) {
- EnumDeclaration result = new EnumDeclaration(target);
- result.setSourceRange(this.getStartPosition(), this.getLength());
- result.setJavadoc(
- (JSdoc) ASTNode.copySubtree(target, getJavadoc()));
- result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers()));
- result.setName((SimpleName) getName().clone(target));
- result.superInterfaceTypes().addAll(
- ASTNode.copySubtrees(target, superInterfaceTypes()));
- result.enumConstants().addAll(
- ASTNode.copySubtrees(target, enumConstants()));
- result.bodyDeclarations().addAll(
- ASTNode.copySubtrees(target, bodyDeclarations()));
- return result;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final boolean subtreeMatch0(ASTMatcher matcher, Object other) {
- // dispatch to correct overloaded match method
- return matcher.match(this, other);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- void accept0(ASTVisitor visitor) {
- boolean visitChildren = visitor.visit(this);
- if (visitChildren) {
- // visit children in normal left to right reading order
- acceptChild(visitor, getJavadoc());
- acceptChildren(visitor, this.modifiers);
- acceptChild(visitor, getName());
- acceptChildren(visitor, this.superInterfaceTypes);
- acceptChildren(visitor, this.enumConstants);
- acceptChildren(visitor, this.bodyDeclarations);
- }
- visitor.endVisit(this);
- }
-
- /**
- * Returns the live ordered list of superinterfaces of this enum
- * declaration.
- *
- * @return the live list of super interface types
- * (element type: <code>Type</code>)
- */
- public List superInterfaceTypes() {
- return this.superInterfaceTypes;
- }
-
- /**
- * Returns the live ordered list of enum constant declarations
- * of this enum declaration.
- *
- * @return the live list of enum constant declarations
- * (element type: {@link EnumConstantDeclaration})
- */
- public List enumConstants() {
- return enumConstants;
- }
-
- /* (omit javadoc for this method)
- * Method declared on AsbtractTypeDeclaration.
- */
- ITypeBinding internalResolveBinding() {
- return this.ast.getBindingResolver().resolveType(this);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- int memSize() {
- return super.memSize() + 2 * 4;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- int treeSize() {
- return memSize()
- + (this.optionalDocComment == null ? 0 : getJavadoc().treeSize())
- + this.modifiers.listSize()
- + (this.typeName == null ? 0 : getName().treeSize())
- + this.superInterfaceTypes.listSize()
- + this.enumConstants.listSize()
- + this.bodyDeclarations.listSize();
- }
-}
-
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/FunctionBinding.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/FunctionBinding.java
index 20d09c0..79003cd 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/FunctionBinding.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/FunctionBinding.java
@@ -37,7 +37,7 @@
/**
* Internal implementation of method bindings.
*/
-class FunctionBinding implements IFunctionBinding {
+class FunctionBinding implements IFunctionBinding {
private static final int VALID_MODIFIERS = Modifier.PUBLIC | Modifier.PROTECTED | Modifier.PRIVATE |
Modifier.ABSTRACT | Modifier.STATIC | Modifier.FINAL | Modifier.SYNCHRONIZED | Modifier.NATIVE |
@@ -53,8 +53,6 @@
private String key;
private ITypeBinding[] typeParameters;
private ITypeBinding[] typeArguments;
- private IAnnotationBinding[] annotations;
- private IAnnotationBinding[] parameterAnnotations;
FunctionBinding(BindingResolver resolver, org.eclipse.wst.jsdt.internal.compiler.lookup.MethodBinding binding) {
this.resolver = resolver;
@@ -105,26 +103,6 @@
return name;
}
- public IAnnotationBinding[] getAnnotations() {
- if (this.annotations != null) {
- return this.annotations;
- }
- org.eclipse.wst.jsdt.internal.compiler.lookup.AnnotationBinding[] annots = this.binding.getAnnotations();
- int length = annots == null ? 0 : annots.length;
- if (length == 0) {
- return this.annotations = AnnotationBinding.NoAnnotations;
- }
- IAnnotationBinding[] domInstances = new AnnotationBinding[length];
- for (int i = 0; i < length; i++) {
- final IAnnotationBinding annotationInstance = this.resolver.getAnnotationInstance(annots[i]);
- if (annotationInstance == null) {
- return this.annotations = AnnotationBinding.NoAnnotations;
- }
- domInstances[i] = annotationInstance;
- }
- return this.annotations = domInstances;
- }
-
/**
* @see IFunctionBinding#getDeclaringClass()
*/
@@ -135,26 +113,6 @@
return declaringClass;
}
- public IAnnotationBinding[] getParameterAnnotations(int index) {
- if (this.parameterAnnotations != null) {
- return this.parameterAnnotations;
- }
- org.eclipse.wst.jsdt.internal.compiler.lookup.AnnotationBinding[] annots = this.binding.getParameterAnnotations(index);
- int length = annots == null ? 0 : annots.length;
- if (length == 0) {
- return this.parameterAnnotations = AnnotationBinding.NoAnnotations;
- }
- IAnnotationBinding[] domInstances =new AnnotationBinding[length];
- for (int i = 0; i < length; i++) {
- final IAnnotationBinding annotationInstance = this.resolver.getAnnotationInstance(annots[i]);
- if (annotationInstance == null) {
- return this.parameterAnnotations = AnnotationBinding.NoAnnotations;
- }
- domInstances[i] = annotationInstance;
- }
- return this.parameterAnnotations = domInstances;
- }
-
/**
* @see IFunctionBinding#getParameterTypes()
*/
@@ -200,8 +158,6 @@
}
public Object getDefaultValue() {
- if (isAnnotationMember())
- return MemberValuePairBinding.buildDOMValue(this.binding.getDefaultValue(), this.resolver);
return null;
}
@@ -275,10 +231,9 @@
return (JavaElement) typeRoot.getFunction(getName(), parameters);
else
return (JavaElement) declaringType.getFunction(getName(), parameters);
- } else {
- // annotation type member declaration
- AnnotationTypeMemberDeclaration typeMemberDeclaration = (AnnotationTypeMemberDeclaration) node;
- return (JavaElement) declaringType.getFunction(typeMemberDeclaration.getName().getIdentifier(), CharOperation.NO_STRINGS); // annotation type members don't have parameters
+ }
+ else {
+ return null;
}
} else {
// case of method not in the created AST, or a binary method
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/IAnnotationBinding.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/IAnnotationBinding.java
deleted file mode 100644
index 773d7b3..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/IAnnotationBinding.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 BEA Systems, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * tyeung@bea.com - initial API and implementation
- * IBM Corporation - changed interface to extend IBinding
- * IBM Corporation - renamed from IResolvedAnnotation to IAnnotationBinding
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.dom;
-
-/**
- * Represents an resolved annotation. Resolved annotation are computed along with other
- * bindings; they correspond to {@link Annotation} nodes.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- *
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- */
-public interface IAnnotationBinding extends IBinding {
-
- /**
- * Returns the complete list of member value pairs for this annotation, including
- * ones explicitly listed in the annotation as well as entries for
- * annotation type members with default values that are implied.
- *
- * @return a possibly empty list of resolved member value pairs
- */
- IMemberValuePairBinding[] getAllMemberValuePairs();
-
- /**
- * Returns the type of the annotation. The resulting type binding will always
- * return <code>true</code> to <code>ITypeBinding.isAnnotation()</code>.
- *
- * @return the type of the annotation
- */
- ITypeBinding getAnnotationType();
-
- /**
- * Returns the list of declared member value pairs for this annotation.
- * Returns an empty list for a {@link MarkerAnnotation}, a one element
- * list for a {@link SingleMemberAnnotation}, and one entry for each
- * of the explicitly listed values in a {@link NormalAnnotation}.
- * <p>
- * Note that the list only includes entries for annotation type members that are
- * explicitly mentioned in the annotation. The list does not include any
- * annotation type members with default values that are merely implied.
- * Use {@link #getAllMemberValuePairs()} to get those as well.
- * </p>
- *
- * @return a possibly empty list of resolved member value pairs
- */
- IMemberValuePairBinding[] getDeclaredMemberValuePairs();
-
- /**
- * Returns the name of the annotation type.
- *
- * @return the name of the annotation type
- */
- public String getName();
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/IBinding.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/IBinding.java
index 80726a4..5ee6a6a 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/IBinding.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/IBinding.java
@@ -71,48 +71,7 @@
*/
public static final int METHOD = 4;
- /**
- * Kind constant (value 5) indicating an annotation binding.
- * Bindings of this kind can be safely cast to <code>IAnnotationBinding</code>.
- *
- * @see #getKind()
- * @see IAnnotationBinding
- * @since 3.2
- */
- public static final int ANNOTATION = 5;
- /**
- * Kind constant (value 6) indicating a member value pair binding.
- * Bindings of this kind can be safely cast to <code>IMemberValuePairBinding</code>.
- *
- * @see #getKind()
- * @see IMemberValuePairBinding
- * @since 3.2
- */
- public static final int MEMBER_VALUE_PAIR = 6;
-
- /**
- * Return the resolved annotations associated with this binding.
- * <ul>
- * <li>Package bindings - these are annotations on a package declaration.
- * </li>
- * <li>Type bindings - these are annotations on a class, interface, enum,
- * or annotation type declaration. The result is the same regardless of
- * whether the type is parameterized.</li>
- * <li>Method bindings - these are annotations on a method or constructor
- * declaration. The result is the same regardless of whether the method is
- * parameterized.</li>
- * <li>Variable bindings - these are annotations on a field, enum constant,
- * or formal parameter declaration.</li>
- * <li>Annotation bindings - an empty array is always returned</li>
- * <li>Member value pair bindings - an empty array is always returned<li>
- * </ul>
- *
- * @return the list of resolved annotations, or the empty list if there are no
- * annotations associated with the object
- * @since 3.2
- */
- public IAnnotationBinding[] getAnnotations();
/**
* Returns the kind of bindings this is. That is one of the kind constants:
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/IFunctionBinding.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/IFunctionBinding.java
index b4c3863..4e1c2d8 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/IFunctionBinding.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/IFunctionBinding.java
@@ -114,19 +114,6 @@
*/
public Object getDefaultValue();
- /**
- * Returns the resolved annotations of a parameter of this method.
- * The result returned is the same regardless of whether
- * this is a parameterized method.
- *
- * @param paramIndex the index of the parameter of interest
- * @return the resolved annotations of the <code>paramIndex</code>th parameter,
- * or an empty list if there are none
- * @throws ArrayIndexOutOfBoundsException if <code>paramIndex</code> is
- * not a valid index
- * @since 3.2
- */
- public IAnnotationBinding[] getParameterAnnotations(int paramIndex);
/**
* Returns a list of type bindings representing the formal parameter types,
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/JavaScriptUnitBinding.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/JavaScriptUnitBinding.java
index b2d50db..a0f8304 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/JavaScriptUnitBinding.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/JavaScriptUnitBinding.java
@@ -68,10 +68,6 @@
return null;
}
- public IAnnotationBinding[] getAnnotations() {
- return AnnotationBinding.NoAnnotations;
- }
-
/*
* @see ITypeBinding#getBinaryName()
* @since 3.0
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/MarkerAnnotation.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/MarkerAnnotation.java
deleted file mode 100644
index 0bd1249..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/MarkerAnnotation.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.dom;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Marker annotation node (added in JLS3 API). The marker annotation
- * "@foo" is equivalent to the normal annotation "@foo()".
- * <p>
- * <pre>
- * MarkerAnnotation:
- * <b>@</b> TypeName
- * </pre>
- * </p>
- *
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- */
-public final class MarkerAnnotation extends Annotation {
-
- /**
- * The "typeName" structural property of this node type.
- */
- public static final ChildPropertyDescriptor TYPE_NAME_PROPERTY =
- internalTypeNamePropertyFactory(MarkerAnnotation.class);
-
- /**
- * A list of property descriptors (element type:
- * {@link StructuralPropertyDescriptor}),
- * or null if uninitialized.
- */
- private static final List PROPERTY_DESCRIPTORS;
-
- static {
- List propertyList = new ArrayList(2);
- createPropertyList(MarkerAnnotation.class, propertyList);
- addProperty(TYPE_NAME_PROPERTY, propertyList);
- PROPERTY_DESCRIPTORS = reapPropertyList(propertyList);
- }
-
- /**
- * Returns a list of structural property descriptors for this node type.
- * Clients must not modify the result.
- *
- * @param apiLevel the API level; one of the AST.JLS* constants
- * @return a list of property descriptors (element type:
- * {@link StructuralPropertyDescriptor})
- */
- public static List propertyDescriptors(int apiLevel) {
- return PROPERTY_DESCRIPTORS;
- }
-
- /**
- * Creates a new unparented marker annotation node owned
- * by the given AST. By default, the annotation has an
- * unspecified type name .
- * <p>
- * N.B. This constructor is package-private.
- * </p>
- *
- * @param ast the AST that is to own this node
- */
- MarkerAnnotation(AST ast) {
- super(ast);
- unsupportedIn2();
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final List internalStructuralPropertiesForType(int apiLevel) {
- return propertyDescriptors(apiLevel);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) {
- if (property == TYPE_NAME_PROPERTY) {
- if (get) {
- return getTypeName();
- } else {
- setTypeName((Name) child);
- return null;
- }
- }
- // allow default implementation to flag the error
- return super.internalGetSetChildProperty(property, get, child);
- }
-
- /* (omit javadoc for this method)
- * Method declared on BodyDeclaration.
- */
- final ChildPropertyDescriptor internalTypeNameProperty() {
- return TYPE_NAME_PROPERTY;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final int getNodeType0() {
- return MARKER_ANNOTATION;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- ASTNode clone0(AST target) {
- MarkerAnnotation result = new MarkerAnnotation(target);
- result.setSourceRange(this.getStartPosition(), this.getLength());
- result.setTypeName((Name) ASTNode.copySubtree(target, getTypeName()));
- return result;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final boolean subtreeMatch0(ASTMatcher matcher, Object other) {
- // dispatch to correct overloaded match method
- return matcher.match(this, other);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- void accept0(ASTVisitor visitor) {
- boolean visitChildren = visitor.visit(this);
- if (visitChildren) {
- // visit children in normal left to right reading order
- acceptChild(visitor, getTypeName());
- }
- visitor.endVisit(this);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- int memSize() {
- return super.memSize();
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- int treeSize() {
- return
- memSize()
- + (this.typeName == null ? 0 : getTypeName().treeSize());
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/MemberValuePair.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/MemberValuePair.java
deleted file mode 100644
index ea1f32c..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/MemberValuePair.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.jsdt.core.dom;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Member value pair node (added in JLS3 API). Member value pairs appear in annotations.
- * <p>
- * <pre>
- * MemberValuePair:
- * SimpleName <b>=</b> Expression
- * </pre>
- * Within annotations, only certain kinds of expressions are meaningful,
- * including other annotations.
- * </p>
- *
- * @see NormalAnnotation
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- */
-public class MemberValuePair extends ASTNode {
-
- /**
- * The "name" structural property of this node type.
- */
- public static final ChildPropertyDescriptor NAME_PROPERTY =
- new ChildPropertyDescriptor(MemberValuePair.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$
-
- /**
- * The "value" structural property of this node type.
- */
- public static final ChildPropertyDescriptor VALUE_PROPERTY =
- new ChildPropertyDescriptor(MemberValuePair.class, "value", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
-
- /**
- * A list of property descriptors (element type:
- * {@link StructuralPropertyDescriptor}),
- * or null if uninitialized.
- */
- private static final List PROPERTY_DESCRIPTORS;
-
- static {
- List propertyList = new ArrayList(3);
- createPropertyList(MemberValuePair.class, propertyList);
- addProperty(NAME_PROPERTY, propertyList);
- addProperty(VALUE_PROPERTY, propertyList);
- PROPERTY_DESCRIPTORS = reapPropertyList(propertyList);
- }
-
- /**
- * Returns a list of structural property descriptors for this node type.
- * Clients must not modify the result.
- *
- * @param apiLevel the API level; one of the AST.JLS* constants
- * @return a list of property descriptors (element type:
- * {@link StructuralPropertyDescriptor})
- */
- public static List propertyDescriptors(int apiLevel) {
- return PROPERTY_DESCRIPTORS;
- }
-
- /**
- * The member name; lazily initialized; defaults to a unspecified,
- * legal name.
- */
- private SimpleName name = null;
-
- /**
- * The value; lazily initialized; defaults to a unspecified,
- * legal expression.
- */
- private Expression value = null;
-
- /**
- * Creates a new AST node for a member value pair owned by the given
- * AST. By default, the node has an unspecified (but legal) member
- * name and value.
- * <p>
- * N.B. This constructor is package-private.
- * </p>
- *
- * @param ast the AST that is to own this node
- */
- MemberValuePair(AST ast) {
- super(ast);
- unsupportedIn2();
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final List internalStructuralPropertiesForType(int apiLevel) {
- return propertyDescriptors(apiLevel);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) {
- if (property == NAME_PROPERTY) {
- if (get) {
- return getName();
- } else {
- setName((SimpleName) child);
- return null;
- }
- }
- if (property == VALUE_PROPERTY) {
- if (get) {
- return getValue();
- } else {
- setValue((Expression) child);
- return null;
- }
- }
- // allow default implementation to flag the error
- return super.internalGetSetChildProperty(property, get, child);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final int getNodeType0() {
- return MEMBER_VALUE_PAIR;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- ASTNode clone0(AST target) {
- MemberValuePair result = new MemberValuePair(target);
- result.setSourceRange(this.getStartPosition(), this.getLength());
- result.setName((SimpleName) ASTNode.copySubtree(target, getName()));
- result.setValue((Expression) ASTNode.copySubtree(target, getValue()));
- return result;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final boolean subtreeMatch0(ASTMatcher matcher, Object other) {
- // dispatch to correct overloaded match method
- return matcher.match(this, other);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- void accept0(ASTVisitor visitor) {
- boolean visitChildren = visitor.visit(this);
- if (visitChildren) {
- // visit children in normal left to right reading order
- acceptChild(visitor, getName());
- acceptChild(visitor, getValue());
- }
- visitor.endVisit(this);
- }
-
- /**
- * Returns the member name.
- *
- * @return the member name node
- */
- public SimpleName getName() {
- if (this.name == null) {
- // lazy init must be thread-safe for readers
- synchronized (this) {
- if (this.name == null) {
- preLazyInit();
- this.name = new SimpleName(this.ast);
- postLazyInit(this.name, NAME_PROPERTY);
- }
- }
- }
- return this.name;
- }
-
- /**
- * Resolves and returns the member value pair binding for this member value pair.
- * <p>
- * Note that bindings are generally unavailable unless requested when the
- * AST is being built.
- * </p>
- *
- * @return the binding, or <code>null</code> if the binding cannot be
- * resolved
- * @since 3.2
- */
- public final IMemberValuePairBinding resolveMemberValuePairBinding() {
- return this.ast.getBindingResolver().resolveMemberValuePair(this);
- }
-
- /**
- * Sets the member name.
- *
- * @param name the member name node
- * @exception IllegalArgumentException if:
- * <ul>
- * <li>the node belongs to a different AST</li>
- * <li>the node already has a parent</li>
- * </ul>
- */
- public void setName(SimpleName name) {
- if (name == null) {
- throw new IllegalArgumentException();
- }
- ASTNode oldChild = this.name;
- preReplaceChild(oldChild, name, NAME_PROPERTY);
- this.name = name;
- postReplaceChild(oldChild, name, NAME_PROPERTY);
- }
-
- /**
- * Returns the value expression.
- *
- * @return the value expression
- */
- public Expression getValue() {
- if (this.value == null) {
- // lazy init must be thread-safe for readers
- synchronized (this) {
- if (this.value == null) {
- preLazyInit();
- this.value= new SimpleName(this.ast);
- postLazyInit(this.value, VALUE_PROPERTY);
- }
- }
- }
- return this.value;
- }
-
- /**
- * Sets the value of this pair.
- *
- * @param value the new value
- * @exception IllegalArgumentException if:
- * <ul>
- * <li>the node belongs to a different AST</li>
- * <li>the node already has a parent</li>
- * <li>a cycle in would be created</li>
- * </ul>
- */
- public void setValue(Expression value) {
- if (value == null) {
- throw new IllegalArgumentException();
- }
- ASTNode oldChild = this.value;
- preReplaceChild(oldChild, value, VALUE_PROPERTY);
- this.value = value;
- postReplaceChild(oldChild, value, VALUE_PROPERTY);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- int memSize() {
- return BASE_NODE_SIZE + 2 * 4;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- int treeSize() {
- return
- memSize()
- + (this.name == null ? 0 : getName().treeSize())
- + (this.value == null ? 0 : getValue().treeSize());
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/MemberValuePairBinding.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/MemberValuePairBinding.java
deleted file mode 100644
index 102e046..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/MemberValuePairBinding.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 BEA Systems, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * tyeung@bea.com - initial API and implementation
- * IBM Corporation - implemented methods from IBinding
- * IBM Corporation - renamed from ResolvedMemberValuePair to MemberValuePairBinding
- * jgarms@bea.com - Fix for IllegalStateException
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.dom;
-
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.internal.compiler.impl.Constant;
-import org.eclipse.wst.jsdt.internal.compiler.lookup.ElementValuePair;
-import org.eclipse.wst.jsdt.internal.compiler.lookup.MethodBinding;
-import org.eclipse.wst.jsdt.internal.compiler.lookup.TypeIds;
-
-/**
- * Internal class.
- */
-class MemberValuePairBinding implements IMemberValuePairBinding {
- static final MemberValuePairBinding[] NoPair = new MemberValuePairBinding[0];
- private static final Object NoValue = new Object();
- private static final Object[] EmptyArray = new Object[0];
-
- private ElementValuePair internalPair;
- protected Object value = null;
- protected BindingResolver bindingResolver;
-
- static void appendValue(Object value, StringBuffer buffer) {
- if (value instanceof Object[]) {
- Object[] values = (Object[]) value;
- buffer.append('{');
- for (int i = 0, l = values.length; i < l; i++) {
- if (i != 0)
- buffer.append(", "); //$NON-NLS-1$
- appendValue(values[i], buffer);
- }
- buffer.append('}');
- } else if (value instanceof ITypeBinding) {
- buffer.append(((ITypeBinding) value).getName());
- buffer.append(".class"); //$NON-NLS-1$
- } else {
- buffer.append(value);
- }
- }
-
- static Object buildDOMValue(final Object internalObject, BindingResolver resolver) {
- if (internalObject == null)
- return null;
-
- if (internalObject instanceof Constant) {
- Constant constant = (Constant) internalObject;
- switch (constant.typeID()) {
- case TypeIds.T_boolean:
- return Boolean.valueOf(constant.booleanValue());
- case TypeIds.T_byte:
- return new Byte(constant.byteValue());
- case TypeIds.T_char:
- return new Character(constant.charValue());
- case TypeIds.T_double:
- return new Double(constant.doubleValue());
- case TypeIds.T_float:
- return new Float(constant.floatValue());
- case TypeIds.T_int:
- return new Integer(constant.intValue());
- case TypeIds.T_long:
- return new Long(constant.longValue());
- case TypeIds.T_short:
- return new Short(constant.shortValue());
- case TypeIds.T_JavaLangString:
- return constant.stringValue();
- }
- } else if (internalObject instanceof org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding) {
- return resolver.getTypeBinding((org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding) internalObject);
- } else if (internalObject instanceof org.eclipse.wst.jsdt.internal.compiler.lookup.AnnotationBinding) {
- return resolver.getAnnotationInstance((org.eclipse.wst.jsdt.internal.compiler.lookup.AnnotationBinding) internalObject);
- } else if (internalObject instanceof org.eclipse.wst.jsdt.internal.compiler.lookup.FieldBinding) {
- return resolver.getVariableBinding((org.eclipse.wst.jsdt.internal.compiler.lookup.FieldBinding) internalObject);
- } else if (internalObject instanceof Object[]) {
- Object[] elements = (Object[]) internalObject;
- int length = elements.length;
- Object[] values = length == 0 ? EmptyArray : new Object[length];
- for (int i = 0; i < length; i++)
- values[i] = buildDOMValue(elements[i], resolver);
- return values;
- }
- return null;
- }
-
- MemberValuePairBinding(ElementValuePair pair, BindingResolver resolver) {
- this.internalPair = pair;
- this.bindingResolver = resolver;
- }
-
- public IAnnotationBinding[] getAnnotations() {
- return AnnotationBinding.NoAnnotations;
- }
-
- public IJavaScriptElement getJavaElement() {
- return null;
- }
-
- public String getKey() {
- // TODO when implementing, update spec in IBinding
- return null;
- }
-
- public int getKind() {
- return IBinding.MEMBER_VALUE_PAIR;
- }
-
- public IFunctionBinding getMethodBinding() {
- return this.bindingResolver.getMethodBinding(this.internalPair.getMethodBinding());
- }
-
- public int getModifiers() {
- return Modifier.NONE;
- }
-
- public String getName() {
- if (this.internalPair == null)
- return null;
- final char[] membername = this.internalPair.getName();
- return membername == null ? null : new String(membername);
- }
-
- public Object getValue() {
- if (value == null)
- init();
- return value == NoValue ? null : this.value;
- }
-
- private void init() {
- this.value = buildDOMValue(this.internalPair.getValue(), this.bindingResolver);
- if (this.value == null)
- this.value = NoValue;
- }
-
- char[] internalName() {
- return this.internalPair == null ? null : this.internalPair.getName();
- }
-
- public boolean isDefault() {
- Object value2 = getValue();
- Object defaultValue = getMethodBinding().getDefaultValue();
- if (value2 instanceof IBinding) {
- if (defaultValue instanceof IBinding) {
- return ((IBinding) value2).isEqualTo((IBinding) defaultValue);
- }
- return false;
- }
- if (defaultValue == null) return false;
- return defaultValue.equals(value2);
- }
-
- public boolean isDeprecated() {
- MethodBinding methodBinding = this.internalPair.getMethodBinding();
- return methodBinding == null ? false : methodBinding.isDeprecated();
- }
-
- public boolean isEqualTo(IBinding binding) {
- if (this == binding)
- return true;
- if (binding.getKind() != IBinding.MEMBER_VALUE_PAIR)
- return false;
- IMemberValuePairBinding other = (IMemberValuePairBinding) binding;
- if (!getMethodBinding().isEqualTo(other.getMethodBinding())) {
- return false;
- }
- Object otherValue = other.getValue();
- Object currentValue = getValue();
- if (currentValue == null) {
- return otherValue == null;
- }
- if (currentValue instanceof IBinding) {
- if (otherValue instanceof IBinding) {
- return ((IBinding) currentValue).isEqualTo((IBinding) otherValue);
- }
- return false;
- }
- return currentValue.equals(otherValue);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.IBinding#isRecovered()
- */
- public boolean isRecovered() {
- return false;
- }
-
- public boolean isSynthetic() {
- return false;
- }
-
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append(getName());
- buffer.append(" = "); //$NON-NLS-1$
- appendValue(getValue(), buffer);
- return buffer.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/NaiveASTFlattener.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/NaiveASTFlattener.java
index a7e8bb1..ddc7a4e 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/NaiveASTFlattener.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/NaiveASTFlattener.java
@@ -133,49 +133,6 @@
}
/*
- * @see ASTVisitor#visit(AnnotationTypeDeclaration)
- * @since 3.1
- */
- public boolean visit(AnnotationTypeDeclaration node) {
- if (node.getJavadoc() != null) {
- node.getJavadoc().accept(this);
- }
- printIndent();
- printModifiers(node.modifiers());
- this.buffer.append("@interface ");//$NON-NLS-1$
- node.getName().accept(this);
- this.buffer.append(" {");//$NON-NLS-1$
- for (Iterator it = node.bodyDeclarations().iterator(); it.hasNext(); ) {
- BodyDeclaration d = (BodyDeclaration) it.next();
- d.accept(this);
- }
- this.buffer.append("}\n");//$NON-NLS-1$
- return false;
- }
-
- /*
- * @see ASTVisitor#visit(AnnotationTypeMemberDeclaration)
- * @since 3.1
- */
- public boolean visit(AnnotationTypeMemberDeclaration node) {
- if (node.getJavadoc() != null) {
- node.getJavadoc().accept(this);
- }
- printIndent();
- printModifiers(node.modifiers());
- node.getType().accept(this);
- this.buffer.append(" ");//$NON-NLS-1$
- node.getName().accept(this);
- this.buffer.append("()");//$NON-NLS-1$
- if (node.getDefault() != null) {
- this.buffer.append(" default ");//$NON-NLS-1$
- node.getDefault().accept(this);
- }
- this.buffer.append(";\n");//$NON-NLS-1$
- return false;
- }
-
- /*
* @see ASTVisitor#visit(AnonymousClassDeclaration)
*/
public boolean visit(AnonymousClassDeclaration node) {
@@ -529,79 +486,7 @@
return false;
}
- /*
- * @see ASTVisitor#visit(EnumConstantDeclaration)
- * @since 3.1
- */
- public boolean visit(EnumConstantDeclaration node) {
- if (node.getJavadoc() != null) {
- node.getJavadoc().accept(this);
- }
- printIndent();
- printModifiers(node.modifiers());
- node.getName().accept(this);
- if (!node.arguments().isEmpty()) {
- this.buffer.append("(");//$NON-NLS-1$
- for (Iterator it = node.arguments().iterator(); it.hasNext(); ) {
- Expression e = (Expression) it.next();
- e.accept(this);
- if (it.hasNext()) {
- this.buffer.append(",");//$NON-NLS-1$
- }
- }
- this.buffer.append(")");//$NON-NLS-1$
- }
- if (node.getAnonymousClassDeclaration() != null) {
- node.getAnonymousClassDeclaration().accept(this);
- }
- return false;
- }
- /*
- * @see ASTVisitor#visit(EnumDeclaration)
- * @since 3.1
- */
- public boolean visit(EnumDeclaration node) {
- if (node.getJavadoc() != null) {
- node.getJavadoc().accept(this);
- }
- printIndent();
- printModifiers(node.modifiers());
- this.buffer.append("enum ");//$NON-NLS-1$
- node.getName().accept(this);
- this.buffer.append(" ");//$NON-NLS-1$
- if (!node.superInterfaceTypes().isEmpty()) {
- this.buffer.append("implements ");//$NON-NLS-1$
- for (Iterator it = node.superInterfaceTypes().iterator(); it.hasNext(); ) {
- Type t = (Type) it.next();
- t.accept(this);
- if (it.hasNext()) {
- this.buffer.append(", ");//$NON-NLS-1$
- }
- }
- this.buffer.append(" ");//$NON-NLS-1$
- }
- this.buffer.append("{");//$NON-NLS-1$
- for (Iterator it = node.enumConstants().iterator(); it.hasNext(); ) {
- EnumConstantDeclaration d = (EnumConstantDeclaration) it.next();
- d.accept(this);
- // enum constant declarations do not include punctuation
- if (it.hasNext()) {
- // enum constant declarations are separated by commas
- this.buffer.append(", ");//$NON-NLS-1$
- }
- }
- if (!node.bodyDeclarations().isEmpty()) {
- this.buffer.append("; ");//$NON-NLS-1$
- for (Iterator it = node.bodyDeclarations().iterator(); it.hasNext(); ) {
- BodyDeclaration d = (BodyDeclaration) it.next();
- d.accept(this);
- // other body declarations include trailing punctuation
- }
- }
- this.buffer.append("}\n");//$NON-NLS-1$
- return false;
- }
/*
* @see ASTVisitor#visit(ExpressionStatement)
@@ -820,16 +705,6 @@
}
/*
- * @see ASTVisitor#visit(MarkerAnnotation)
- * @since 3.1
- */
- public boolean visit(MarkerAnnotation node) {
- this.buffer.append("@");//$NON-NLS-1$
- node.getTypeName().accept(this);
- return false;
- }
-
- /*
* @see ASTVisitor#visit(MemberRef)
* @since 3.0
*/
@@ -842,16 +717,6 @@
return false;
}
- /*
- * @see ASTVisitor#visit(MemberValuePair)
- * @since 3.1
- */
- public boolean visit(MemberValuePair node) {
- node.getName().accept(this);
- this.buffer.append("=");//$NON-NLS-1$
- node.getValue().accept(this);
- return false;
- }
/*
* @see ASTVisitor#visit(FunctionRef)
@@ -1012,25 +877,6 @@
}
/*
- * @see ASTVisitor#visit(NormalAnnotation)
- * @since 3.1
- */
- public boolean visit(NormalAnnotation node) {
- this.buffer.append("@");//$NON-NLS-1$
- node.getTypeName().accept(this);
- this.buffer.append("(");//$NON-NLS-1$
- for (Iterator it = node.values().iterator(); it.hasNext(); ) {
- MemberValuePair p = (MemberValuePair) it.next();
- p.accept(this);
- if (it.hasNext()) {
- this.buffer.append(",");//$NON-NLS-1$
- }
- }
- this.buffer.append(")");//$NON-NLS-1$
- return false;
- }
-
- /*
* @see ASTVisitor#visit(NullLiteral)
*/
public boolean visit(NullLiteral node) {
@@ -1089,11 +935,6 @@
if (node.getJavadoc() != null) {
node.getJavadoc().accept(this);
}
- for (Iterator it = node.annotations().iterator(); it.hasNext(); ) {
- Annotation p = (Annotation) it.next();
- p.accept(this);
- this.buffer.append(" ");//$NON-NLS-1$
- }
}
printIndent();
this.buffer.append("package ");//$NON-NLS-1$
@@ -1206,18 +1047,6 @@
return true;
}
- /*
- * @see ASTVisitor#visit(SingleMemberAnnotation)
- * @since 3.1
- */
- public boolean visit(SingleMemberAnnotation node) {
- this.buffer.append("@");//$NON-NLS-1$
- node.getTypeName().accept(this);
- this.buffer.append("(");//$NON-NLS-1$
- node.getValue().accept(this);
- this.buffer.append(")");//$NON-NLS-1$
- return false;
- }
/*
* @see ASTVisitor#visit(SingleVariableDeclaration)
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/NormalAnnotation.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/NormalAnnotation.java
deleted file mode 100644
index b7c566d..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/NormalAnnotation.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.dom;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Normal annotation node (added in JLS3 API).
- * <p>
- * <pre>
- * NormalAnnotation:
- * <b>@</b> TypeName <b>(</b> [ MemberValuePair { <b>,</b> MemberValuePair } ] <b>)</b>
- * </pre>
- * </p>
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- */
-public final class NormalAnnotation extends Annotation {
-
- /**
- * The "typeName" structural property of this node type.
- */
- public static final ChildPropertyDescriptor TYPE_NAME_PROPERTY =
- internalTypeNamePropertyFactory(NormalAnnotation.class);
-
- /**
- * The "values" structural property of this node type.
- */
- public static final ChildListPropertyDescriptor VALUES_PROPERTY =
- new ChildListPropertyDescriptor(NormalAnnotation.class, "values", MemberValuePair.class, CYCLE_RISK); //$NON-NLS-1$
-
- /**
- * A list of property descriptors (element type:
- * {@link StructuralPropertyDescriptor}),
- * or null if uninitialized.
- */
- private static final List PROPERTY_DESCRIPTORS;
-
- static {
- List propertyList = new ArrayList(3);
- createPropertyList(NormalAnnotation.class, propertyList);
- addProperty(TYPE_NAME_PROPERTY, propertyList);
- addProperty(VALUES_PROPERTY, propertyList);
- PROPERTY_DESCRIPTORS = reapPropertyList(propertyList);
- }
-
- /**
- * Returns a list of structural property descriptors for this node type.
- * Clients must not modify the result.
- *
- * @param apiLevel the API level; one of the AST.JLS* constants
- * @return a list of property descriptors (element type:
- * {@link StructuralPropertyDescriptor})
- */
- public static List propertyDescriptors(int apiLevel) {
- return PROPERTY_DESCRIPTORS;
- }
-
- /**
- * The list of member value pairs (element type:
- * <code MemberValuePair</code>). Defaults to an empty list.
- */
- private ASTNode.NodeList values =
- new ASTNode.NodeList(VALUES_PROPERTY);
-
- /**
- * Creates a new unparented normal annotation node owned
- * by the given AST. By default, the annotation has an
- * unspecified type name and an empty list of member value
- * pairs.
- * <p>
- * N.B. This constructor is package-private.
- * </p>
- *
- * @param ast the AST that is to own this node
- */
- NormalAnnotation(AST ast) {
- super(ast);
- unsupportedIn2();
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final List internalStructuralPropertiesForType(int apiLevel) {
- return propertyDescriptors(apiLevel);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) {
- if (property == TYPE_NAME_PROPERTY) {
- if (get) {
- return getTypeName();
- } else {
- setTypeName((Name) child);
- return null;
- }
- }
- // allow default implementation to flag the error
- return super.internalGetSetChildProperty(property, get, child);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final List internalGetChildListProperty(ChildListPropertyDescriptor property) {
- if (property == VALUES_PROPERTY) {
- return values();
- }
- // allow default implementation to flag the error
- return super.internalGetChildListProperty(property);
- }
-
- /* (omit javadoc for this method)
- * Method declared on BodyDeclaration.
- */
- final ChildPropertyDescriptor internalTypeNameProperty() {
- return TYPE_NAME_PROPERTY;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final int getNodeType0() {
- return NORMAL_ANNOTATION;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- ASTNode clone0(AST target) {
- NormalAnnotation result = new NormalAnnotation(target);
- result.setSourceRange(this.getStartPosition(), this.getLength());
- result.setTypeName((Name) ASTNode.copySubtree(target, getTypeName()));
- result.values().addAll(ASTNode.copySubtrees(target, values()));
- return result;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final boolean subtreeMatch0(ASTMatcher matcher, Object other) {
- // dispatch to correct overloaded match method
- return matcher.match(this, other);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- void accept0(ASTVisitor visitor) {
- boolean visitChildren = visitor.visit(this);
- if (visitChildren) {
- // visit children in normal left to right reading order
- acceptChild(visitor, getTypeName());
- acceptChildren(visitor, this.values);
- }
- visitor.endVisit(this);
- }
-
- /**
- * Returns the live list of member value pairs in this annotation.
- * Adding and removing nodes from this list affects this node
- * dynamically. All nodes in this list must be
- * {@link MemberValuePair}s; attempts to add any other
- * type of node will trigger an exception.
- *
- * @return the live list of member value pairs in this
- * annotation (element type: <code>MemberValuePair</code>)
- */
- public List values() {
- return this.values;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- int memSize() {
- return super.memSize() + 1 * 4;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- int treeSize() {
- return
- memSize()
- + (this.typeName == null ? 0 : getTypeName().treeSize())
- + this.values.listSize();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/PackageBinding.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/PackageBinding.java
index 25b5db3..f1032fc 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/PackageBinding.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/PackageBinding.java
@@ -11,14 +11,7 @@
package org.eclipse.wst.jsdt.core.dom;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IPackageFragment;
-import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.compiler.CharOperation;
import org.eclipse.wst.jsdt.internal.compiler.env.INameEnvironment;
import org.eclipse.wst.jsdt.internal.compiler.util.Util;
@@ -44,80 +37,6 @@
// this.resolver = resolver;
}
- public IAnnotationBinding[] getAnnotations() {
- try {
- INameEnvironment nameEnvironment = this.binding.environment.nameEnvironment;
- if (!(nameEnvironment instanceof SearchableEnvironment))
- return AnnotationBinding.NoAnnotations;
- NameLookup nameLookup = ((SearchableEnvironment) nameEnvironment).nameLookup;
- if (nameLookup == null)
- return AnnotationBinding.NoAnnotations;
- final String pkgName = getName();
- IPackageFragment[] pkgs = nameLookup.findPackageFragments(pkgName, false/*exact match*/);
- if (pkgs == null)
- return AnnotationBinding.NoAnnotations;
-
- for (int i = 0, len = pkgs.length; i < len; i++) {
- int fragType = pkgs[i].getKind();
- switch(fragType) {
- case IPackageFragmentRoot.K_SOURCE:
- String unitName = "package-info.js"; //$NON-NLS-1$
- IJavaScriptUnit unit = pkgs[i].getJavaScriptUnit(unitName);
- if (unit != null) {
- ASTParser p = ASTParser.newParser(AST.JLS3);
- p.setSource(unit);
- p.setResolveBindings(true);
- p.setUnitName(unitName);
- p.setFocalPosition(0);
- p.setKind(ASTParser.K_COMPILATION_UNIT);
- JavaScriptUnit domUnit = (JavaScriptUnit) p.createAST(null);
- PackageDeclaration pkgDecl = domUnit.getPackage();
- if (pkgDecl != null) {
- List annos = pkgDecl.annotations();
- if (annos == null || annos.isEmpty())
- return AnnotationBinding.NoAnnotations;
- IAnnotationBinding[] result = new IAnnotationBinding[annos.size()];
- int index=0;
- for (Iterator it = annos.iterator(); it.hasNext(); index++) {
- result[index] = ((Annotation) it.next()).resolveAnnotationBinding();
- // not resolving bindings
- if (result[index] == null)
- return AnnotationBinding.NoAnnotations;
- }
- return result;
- }
- }
- break;
- case IPackageFragmentRoot.K_BINARY:
-
-// unused code
-// NameEnvironmentAnswer answer =
-// nameEnvironment.findType(TypeConstants.PACKAGE_INFO_NAME, this.binding.compoundName);
-// if (answer != null && answer.isBinaryType()) {
-// IBinaryType type = answer.getBinaryType();
-// IBinaryAnnotation[] binaryAnnotations = type.getAnnotations();
-// org.eclipse.wst.jsdt.internal.compiler.lookup.AnnotationBinding[] binaryInstances =
-// BinaryTypeBinding.createAnnotations(binaryAnnotations, this.binding.environment);
-// org.eclipse.wst.jsdt.internal.compiler.lookup.AnnotationBinding[] allInstances =
-// org.eclipse.wst.jsdt.internal.compiler.lookup.AnnotationBinding.addStandardAnnotations(binaryInstances, type.getTagBits(), this.binding.environment);
-// int total = allInstances.length;
-// IAnnotationBinding[] domInstances = new AnnotationBinding[total];
-// for (int a = 0; a < total; a++) {
-// final IAnnotationBinding annotationInstance = this.resolver.getAnnotationInstance(allInstances[a]);
-// if (annotationInstance == null) {// not resolving binding
-// return AnnotationBinding.NoAnnotations;
-// }
-// domInstances[a] = annotationInstance;
-// }
-// return domInstances;
-// }
- }
- }
- } catch(JavaScriptModelException e) {
- return AnnotationBinding.NoAnnotations;
- }
- return AnnotationBinding.NoAnnotations;
- }
/*
* @see IBinding#getName()
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/PackageDeclaration.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/PackageDeclaration.java
index 2e30096..a34e6e3 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/PackageDeclaration.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/PackageDeclaration.java
@@ -47,13 +47,6 @@
new ChildPropertyDescriptor(PackageDeclaration.class, "javadoc", JSdoc.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$
/**
- * The "annotations" structural property of this node type (added in JLS3 API).
- * @since 3.1
- */
- public static final ChildListPropertyDescriptor ANNOTATIONS_PROPERTY =
- new ChildListPropertyDescriptor(PackageDeclaration.class, "annotations", Annotation.class, CYCLE_RISK); //$NON-NLS-1$
-
- /**
* The "name" structural property of this node type.
* @since 3.0
*/
@@ -85,7 +78,6 @@
propertyList = new ArrayList(4);
createPropertyList(PackageDeclaration.class, propertyList);
addProperty(JAVADOC_PROPERTY, propertyList);
- addProperty(ANNOTATIONS_PROPERTY, propertyList);
addProperty(NAME_PROPERTY, propertyList);
PROPERTY_DESCRIPTORS_3_0 = reapPropertyList(propertyList);
}
@@ -144,9 +136,6 @@
*/
PackageDeclaration(AST ast) {
super(ast);
- if (ast.apiLevel >= AST.JLS3) {
- this.annotations = new ASTNode.NodeList(ANNOTATIONS_PROPERTY);
- }
}
/* (omit javadoc for this method)
@@ -184,9 +173,6 @@
* Method declared on ASTNode.
*/
final List internalGetChildListProperty(ChildListPropertyDescriptor property) {
- if (property == ANNOTATIONS_PROPERTY) {
- return annotations();
- }
// allow default implementation to flag the error
return super.internalGetChildListProperty(property);
}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/RecoveredTypeBinding.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/RecoveredTypeBinding.java
index 991b946..ecf8b50 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/RecoveredTypeBinding.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/RecoveredTypeBinding.java
@@ -488,12 +488,6 @@
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.IBinding#getAnnotations()
- */
- public IAnnotationBinding[] getAnnotations() {
- return AnnotationBinding.NoAnnotations;
- }
/* (non-Javadoc)
* @see org.eclipse.wst.jsdt.core.dom.IBinding#getJavaElement()
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/RecoveredVariableBinding.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/RecoveredVariableBinding.java
index 042125a..f9e1f33 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/RecoveredVariableBinding.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/RecoveredVariableBinding.java
@@ -83,10 +83,6 @@
return this.variableDeclaration instanceof SingleVariableDeclaration;
}
- public IAnnotationBinding[] getAnnotations() {
- return AnnotationBinding.NoAnnotations;
- }
-
public IJavaScriptElement getJavaElement() {
return null;
}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/SimpleName.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/SimpleName.java
index 55594fc..418bb93 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/SimpleName.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/SimpleName.java
@@ -259,21 +259,9 @@
if (parent instanceof VariableDeclarationFragment) {
return (d == VariableDeclarationFragment.NAME_PROPERTY);
}
- if (parent instanceof EnumDeclaration) {
- return (d == EnumDeclaration.NAME_PROPERTY);
- }
- if (parent instanceof EnumConstantDeclaration) {
- return (d == EnumConstantDeclaration.NAME_PROPERTY);
- }
if (parent instanceof TypeParameter) {
return (d == TypeParameter.NAME_PROPERTY);
}
- if (parent instanceof AnnotationTypeDeclaration) {
- return (d == AnnotationTypeDeclaration.NAME_PROPERTY);
- }
- if (parent instanceof AnnotationTypeMemberDeclaration) {
- return (d == AnnotationTypeMemberDeclaration.NAME_PROPERTY);
- }
return false;
}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/SingleMemberAnnotation.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/SingleMemberAnnotation.java
deleted file mode 100644
index 91e5dca..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/SingleMemberAnnotation.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.dom;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Single member annotation node (added in JLS3 API). The single member annotation
- * "@foo(bar)" is equivalent to the normal annotation "@foo(value=bar)".
- * <p>
- * <pre>
- * SingleMemberAnnotation:
- * <b>@</b> TypeName <b>(</b> Expression <b>)</b>
- * </pre>
- * Within annotations, only certain kinds of expressions are meaningful,
- * including other annotations.
- * </p>
- *
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- */
-public final class SingleMemberAnnotation extends Annotation {
-
- /**
- * The "typeName" structural property of this node type.
- */
- public static final ChildPropertyDescriptor TYPE_NAME_PROPERTY =
- internalTypeNamePropertyFactory(SingleMemberAnnotation.class);
-
- /**
- * The "value" structural property of this node type.
- */
- public static final ChildPropertyDescriptor VALUE_PROPERTY =
- new ChildPropertyDescriptor(SingleMemberAnnotation.class, "value", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
-
- /**
- * A list of property descriptors (element type:
- * {@link StructuralPropertyDescriptor}),
- * or null if uninitialized.
- */
- private static final List PROPERTY_DESCRIPTORS;
-
- static {
- List propertyList = new ArrayList(3);
- createPropertyList(SingleMemberAnnotation.class, propertyList);
- addProperty(TYPE_NAME_PROPERTY, propertyList);
- addProperty(VALUE_PROPERTY, propertyList);
- PROPERTY_DESCRIPTORS = reapPropertyList(propertyList);
- }
-
- /**
- * Returns a list of structural property descriptors for this node type.
- * Clients must not modify the result.
- *
- * @param apiLevel the API level; one of the AST.JLS* constants
- * @return a list of property descriptors (element type:
- * {@link StructuralPropertyDescriptor})
- */
- public static List propertyDescriptors(int apiLevel) {
- return PROPERTY_DESCRIPTORS;
- }
-
- /**
- * The value; lazily initialized; defaults to a unspecified, but legal,
- * expression.
- */
- private Expression value = null;
-
- /**
- * Creates a new unparented normal annotation node owned
- * by the given AST. By default, the annotation has an
- * unspecified type name and an unspecified value.
- * <p>
- * N.B. This constructor is package-private.
- * </p>
- *
- * @param ast the AST that is to own this node
- */
- SingleMemberAnnotation(AST ast) {
- super(ast);
- unsupportedIn2();
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final List internalStructuralPropertiesForType(int apiLevel) {
- return propertyDescriptors(apiLevel);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) {
- if (property == TYPE_NAME_PROPERTY) {
- if (get) {
- return getTypeName();
- } else {
- setTypeName((Name) child);
- return null;
- }
- }
- if (property == VALUE_PROPERTY) {
- if (get) {
- return getValue();
- } else {
- setValue((Expression) child);
- return null;
- }
- }
- // allow default implementation to flag the error
- return super.internalGetSetChildProperty(property, get, child);
- }
-
- /* (omit javadoc for this method)
- * Method declared on BodyDeclaration.
- */
- final ChildPropertyDescriptor internalTypeNameProperty() {
- return TYPE_NAME_PROPERTY;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final int getNodeType0() {
- return SINGLE_MEMBER_ANNOTATION;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- ASTNode clone0(AST target) {
- SingleMemberAnnotation result = new SingleMemberAnnotation(target);
- result.setSourceRange(this.getStartPosition(), this.getLength());
- result.setTypeName((Name) ASTNode.copySubtree(target, getTypeName()));
- result.setValue((Expression) ASTNode.copySubtree(target, getValue()));
- return result;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- final boolean subtreeMatch0(ASTMatcher matcher, Object other) {
- // dispatch to correct overloaded match method
- return matcher.match(this, other);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- void accept0(ASTVisitor visitor) {
- boolean visitChildren = visitor.visit(this);
- if (visitChildren) {
- // visit children in normal left to right reading order
- acceptChild(visitor, getTypeName());
- acceptChild(visitor, getValue());
- }
- visitor.endVisit(this);
- }
-
- /**
- * Returns the value of this annotation.
- *
- * @return the value node
- */
- public Expression getValue() {
- if (this.value == null) {
- // lazy init must be thread-safe for readers
- synchronized (this) {
- if (this.value == null) {
- preLazyInit();
- this.value = new SimpleName(this.ast);
- postLazyInit(this.value, VALUE_PROPERTY);
- }
- }
- }
- return this.value;
- }
-
- /**
- * Sets the value of this annotation.
- *
- * @param value the new value
- * @exception IllegalArgumentException if:
- * <ul>
- * <li>the node belongs to a different AST</li>
- * <li>the node already has a parent</li>
- * <li>a cycle in would be created</li>
- * </ul>
- */
- public void setValue(Expression value) {
- if (value == null) {
- throw new IllegalArgumentException();
- }
- ASTNode oldChild = this.value;
- preReplaceChild(oldChild, value, VALUE_PROPERTY);
- this.value = value;
- postReplaceChild(oldChild, value, VALUE_PROPERTY);
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- int memSize() {
- return super.memSize() + 1 * 4;
- }
-
- /* (omit javadoc for this method)
- * Method declared on ASTNode.
- */
- int treeSize() {
- return
- memSize()
- + (this.typeName == null ? 0 : getTypeName().treeSize())
- + (this.value == null ? 0 : getValue().treeSize());
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/TypeBinding.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/TypeBinding.java
index 677659f..4d9afba 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/TypeBinding.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/TypeBinding.java
@@ -18,10 +18,10 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Path;
import org.eclipse.wst.jsdt.core.IClassFile;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
+import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IFunction;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IPackageFragment;
import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
import org.eclipse.wst.jsdt.core.IType;
@@ -70,7 +70,6 @@
private String key;
private BindingResolver resolver;
private IVariableBinding[] fields;
- private IAnnotationBinding[] annotations;
private IFunctionBinding[] methods;
private ITypeBinding[] members;
private ITypeBinding[] interfaces;
@@ -92,29 +91,6 @@
return this.resolver.resolveArrayType(this, dimension);
}
- public IAnnotationBinding[] getAnnotations() {
- if (this.annotations != null) {
- return this.annotations;
- }
- if (this.binding.isAnnotationType() || this.binding.isClass() || this.binding.isEnum() || this.binding.isInterface()) {
- org.eclipse.wst.jsdt.internal.compiler.lookup.ReferenceBinding refType =
- (org.eclipse.wst.jsdt.internal.compiler.lookup.ReferenceBinding) this.binding;
- org.eclipse.wst.jsdt.internal.compiler.lookup.AnnotationBinding[] internalAnnotations = refType.getAnnotations();
- int length = internalAnnotations == null ? 0 : internalAnnotations.length;
- if (length != 0) {
- IAnnotationBinding[] domInstances = new IAnnotationBinding[length];
- for (int i = 0; i < length; i++) {
- final IAnnotationBinding annotationInstance = this.resolver.getAnnotationInstance(internalAnnotations[i]);
- if (annotationInstance == null) {
- return AnnotationBinding.NoAnnotations;
- }
- domInstances[i] = annotationInstance;
- }
- return this.annotations = domInstances;
- }
- }
- return this.annotations = AnnotationBinding.NoAnnotations;
- }
/*
* @see ITypeBinding#getBinaryName()
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/TypeDeclarationStatement.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/TypeDeclarationStatement.java
index 28479c9..ec1ec81 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/TypeDeclarationStatement.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/TypeDeclarationStatement.java
@@ -334,8 +334,6 @@
AbstractTypeDeclaration d = getDeclaration();
if (d instanceof TypeDeclaration) {
return ((TypeDeclaration) d).resolveBinding();
- } else if (d instanceof AnnotationTypeDeclaration) {
- return ((AnnotationTypeDeclaration) d).resolveBinding();
} else {
// shouldn't happen
return null;
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/VariableBinding.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/VariableBinding.java
index 4eb63a7..4a1b404 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/VariableBinding.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/VariableBinding.java
@@ -44,22 +44,6 @@
this.binding = binding;
}
- public IAnnotationBinding[] getAnnotations() {
- org.eclipse.wst.jsdt.internal.compiler.lookup.AnnotationBinding[] internalAnnotations = this.binding.getAnnotations();
- // the variable is not an enum constant nor a field nor an argument.
- int length = internalAnnotations == null ? 0 : internalAnnotations.length;
- IAnnotationBinding[] domInstances =
- length == 0 ? AnnotationBinding.NoAnnotations : new AnnotationBinding[length];
- for (int i = 0; i < length; i++) {
- final IAnnotationBinding annotationInstance = this.resolver.getAnnotationInstance(internalAnnotations[i]);
- if (annotationInstance == null) {// not resolving binding
- return AnnotationBinding.NoAnnotations;
- }
- domInstances[i] = annotationInstance;
- }
- return domInstances;
- }
-
/* (non-Javadoc)
* @see IVariableBinding#getConstantValue()
* @since 3.0
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/CompletionEngine.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/CompletionEngine.java
index e99191f..5424bbe 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/CompletionEngine.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/CompletionEngine.java
@@ -20,8 +20,8 @@
import org.eclipse.wst.jsdt.core.CompletionRequestor;
import org.eclipse.wst.jsdt.core.Flags;
import org.eclipse.wst.jsdt.core.IAccessRule;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
import org.eclipse.wst.jsdt.core.IFunction;
+import org.eclipse.wst.jsdt.core.IJavaScriptProject;
import org.eclipse.wst.jsdt.core.IType;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.Signature;
@@ -50,9 +50,7 @@
import org.eclipse.wst.jsdt.internal.codeassist.complete.CompletionOnJavadocTypeParamReference;
import org.eclipse.wst.jsdt.internal.codeassist.complete.CompletionOnKeyword;
import org.eclipse.wst.jsdt.internal.codeassist.complete.CompletionOnLocalName;
-import org.eclipse.wst.jsdt.internal.codeassist.complete.CompletionOnMarkerAnnotationName;
import org.eclipse.wst.jsdt.internal.codeassist.complete.CompletionOnMemberAccess;
-import org.eclipse.wst.jsdt.internal.codeassist.complete.CompletionOnMemberValueName;
import org.eclipse.wst.jsdt.internal.codeassist.complete.CompletionOnMessageSend;
import org.eclipse.wst.jsdt.internal.codeassist.complete.CompletionOnMessageSendName;
import org.eclipse.wst.jsdt.internal.codeassist.complete.CompletionOnMethodName;
@@ -79,7 +77,6 @@
import org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration;
import org.eclipse.wst.jsdt.internal.compiler.ast.AbstractVariableDeclaration;
import org.eclipse.wst.jsdt.internal.compiler.ast.AllocationExpression;
-import org.eclipse.wst.jsdt.internal.compiler.ast.Annotation;
import org.eclipse.wst.jsdt.internal.compiler.ast.Argument;
import org.eclipse.wst.jsdt.internal.compiler.ast.ArrayInitializer;
import org.eclipse.wst.jsdt.internal.compiler.ast.ArrayReference;
@@ -1996,85 +1993,85 @@
false,
typesFound);
}
- } else if (astNode instanceof CompletionOnMarkerAnnotationName) {
- CompletionOnMarkerAnnotationName annot = (CompletionOnMarkerAnnotationName) astNode;
- CompletionOnAnnotationOfType fakeType = (CompletionOnAnnotationOfType)scope.parent.referenceContext();
- if (fakeType.annotations[0] == annot) {
- // When the completion is inside a method body the annotation cannot be accuratly attached to the correct node by completion recovery.
- // So 'targetedElement' is not computed in this case.
- if (scope.parent.parent == null || !(scope.parent.parent instanceof MethodScope)) {
- this.targetedElement = computeTargetedElement(fakeType);
- }
-
- }
- this.assistNodeIsAnnotation = true;
- if (annot.type instanceof CompletionOnSingleTypeReference) {
- CompletionOnSingleTypeReference type = (CompletionOnSingleTypeReference) annot.type;
- this.completionToken = type.token;
- setSourceRange(type.sourceStart, type.sourceEnd);
-
- findTypesAndPackages(this.completionToken, scope, new ObjectVector());
- } else if (annot.type instanceof CompletionOnQualifiedTypeReference) {
- this.insideQualifiedReference = true;
-
- CompletionOnQualifiedTypeReference type = (CompletionOnQualifiedTypeReference) annot.type;
- this.completionToken = type.completionIdentifier;
- long completionPosition = type.sourcePositions[type.tokens.length];
- if (qualifiedBinding instanceof PackageBinding) {
-
- setSourceRange(astNode.sourceStart, (int) completionPosition);
- // replace to the end of the completion identifier
- findTypesAndSubpackages(this.completionToken, (PackageBinding) qualifiedBinding, scope);
- } else {
- setSourceRange((int) (completionPosition >>> 32), (int) completionPosition);
-
- findMemberTypes(
- this.completionToken,
- (ReferenceBinding) qualifiedBinding,
- scope,
- scope.enclosingSourceType(),
- false,
- false,
- new ObjectVector());
- }
- }
- } else if (astNode instanceof CompletionOnMemberValueName) {
- CompletionOnMemberValueName memberValuePair = (CompletionOnMemberValueName) astNode;
- Annotation annotation = (Annotation) astNodeParent;
-
- this.completionToken = memberValuePair.name;
-
- ReferenceBinding annotationType = (ReferenceBinding)annotation.resolvedType;
-
- if (annotationType != null && annotationType.isAnnotationType()) {
- if (!this.requestor.isIgnored(CompletionProposal.ANNOTATION_ATTRIBUTE_REF)) {
- this.findAnnotationAttributes(this.completionToken, annotation.memberValuePairs(), annotationType);
- }
- if (this.assistNodeCanBeSingleMemberAnnotation) {
- if (this.expectedTypesPtr > -1 && this.expectedTypes[0].isAnnotationType()) {
- findTypesAndPackages(this.completionToken, scope, new ObjectVector());
- } else {
- if (scope instanceof BlockScope && !this.requestor.isIgnored(CompletionProposal.LOCAL_VARIABLE_REF)) {
- char[][] alreadyDefinedName = computeAlreadyDefinedName((BlockScope)scope, FakeInvocationSite);
-
- findUnresolvedReference(
- memberValuePair.sourceStart,
- memberValuePair.sourceEnd,
- (BlockScope)scope,
- alreadyDefinedName);
- }
- findVariablesAndMethods(
- this.completionToken,
- scope,
- FakeInvocationSite,
- scope,
- insideTypeAnnotation,
- true);
- // can be the start of a qualified type name
- findTypesAndPackages(this.completionToken, scope, new ObjectVector());
- }
- }
- }
+// } else if (astNode instanceof CompletionOnMarkerAnnotationName) {
+// CompletionOnMarkerAnnotationName annot = (CompletionOnMarkerAnnotationName) astNode;
+// CompletionOnAnnotationOfType fakeType = (CompletionOnAnnotationOfType)scope.parent.referenceContext();
+// if (fakeType.annotations[0] == annot) {
+// // When the completion is inside a method body the annotation cannot be accuratly attached to the correct node by completion recovery.
+// // So 'targetedElement' is not computed in this case.
+// if (scope.parent.parent == null || !(scope.parent.parent instanceof MethodScope)) {
+// this.targetedElement = computeTargetedElement(fakeType);
+// }
+//
+// }
+// this.assistNodeIsAnnotation = true;
+// if (annot.type instanceof CompletionOnSingleTypeReference) {
+// CompletionOnSingleTypeReference type = (CompletionOnSingleTypeReference) annot.type;
+// this.completionToken = type.token;
+// setSourceRange(type.sourceStart, type.sourceEnd);
+//
+// findTypesAndPackages(this.completionToken, scope, new ObjectVector());
+// } else if (annot.type instanceof CompletionOnQualifiedTypeReference) {
+// this.insideQualifiedReference = true;
+//
+// CompletionOnQualifiedTypeReference type = (CompletionOnQualifiedTypeReference) annot.type;
+// this.completionToken = type.completionIdentifier;
+// long completionPosition = type.sourcePositions[type.tokens.length];
+// if (qualifiedBinding instanceof PackageBinding) {
+//
+// setSourceRange(astNode.sourceStart, (int) completionPosition);
+// // replace to the end of the completion identifier
+// findTypesAndSubpackages(this.completionToken, (PackageBinding) qualifiedBinding, scope);
+// } else {
+// setSourceRange((int) (completionPosition >>> 32), (int) completionPosition);
+//
+// findMemberTypes(
+// this.completionToken,
+// (ReferenceBinding) qualifiedBinding,
+// scope,
+// scope.enclosingSourceType(),
+// false,
+// false,
+// new ObjectVector());
+// }
+// }
+// } else if (astNode instanceof CompletionOnMemberValueName) {
+// CompletionOnMemberValueName memberValuePair = (CompletionOnMemberValueName) astNode;
+// Annotation annotation = (Annotation) astNodeParent;
+//
+// this.completionToken = memberValuePair.name;
+//
+// ReferenceBinding annotationType = (ReferenceBinding)annotation.resolvedType;
+//
+// if (annotationType != null && annotationType.isAnnotationType()) {
+// if (!this.requestor.isIgnored(CompletionProposal.ANNOTATION_ATTRIBUTE_REF)) {
+// this.findAnnotationAttributes(this.completionToken, annotation.memberValuePairs(), annotationType);
+// }
+// if (this.assistNodeCanBeSingleMemberAnnotation) {
+// if (this.expectedTypesPtr > -1 && this.expectedTypes[0].isAnnotationType()) {
+// findTypesAndPackages(this.completionToken, scope, new ObjectVector());
+// } else {
+// if (scope instanceof BlockScope && !this.requestor.isIgnored(CompletionProposal.LOCAL_VARIABLE_REF)) {
+// char[][] alreadyDefinedName = computeAlreadyDefinedName((BlockScope)scope, FakeInvocationSite);
+//
+// findUnresolvedReference(
+// memberValuePair.sourceStart,
+// memberValuePair.sourceEnd,
+// (BlockScope)scope,
+// alreadyDefinedName);
+// }
+// findVariablesAndMethods(
+// this.completionToken,
+// scope,
+// FakeInvocationSite,
+// scope,
+// insideTypeAnnotation,
+// true);
+// // can be the start of a qualified type name
+// findTypesAndPackages(this.completionToken, scope, new ObjectVector());
+// }
+// }
+// }
} else if(astNode instanceof CompletionOnBrankStatementLabel) {
if (!this.requestor.isIgnored(CompletionProposal.LABEL_REF)) {
CompletionOnBrankStatementLabel label = (CompletionOnBrankStatementLabel) astNode;
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ASTNode.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ASTNode.java
index 3127a28..ba4019c 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ASTNode.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ASTNode.java
@@ -14,12 +14,10 @@
import org.eclipse.wst.jsdt.core.ast.IASTNode;
import org.eclipse.wst.jsdt.core.compiler.CharOperation;
-
import org.eclipse.wst.jsdt.internal.compiler.ASTVisitor;
import org.eclipse.wst.jsdt.internal.compiler.DelegateASTVisitor;
import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.wst.jsdt.internal.compiler.env.AccessRestriction;
-import org.eclipse.wst.jsdt.internal.compiler.lookup.AnnotationBinding;
import org.eclipse.wst.jsdt.internal.compiler.lookup.ArrayBinding;
import org.eclipse.wst.jsdt.internal.compiler.lookup.Binding;
import org.eclipse.wst.jsdt.internal.compiler.lookup.BlockScope;
@@ -536,90 +534,90 @@
return output;
}
- /**
- * Resolve annotations, and check duplicates, answers combined tagBits
- * for recognized standard annotations
- */
- public static void resolveAnnotations(BlockScope scope, Annotation[] annotations, Binding recipient) {
- AnnotationBinding[] instances = null;
- int length = annotations == null ? 0 : annotations.length;
- if (recipient != null) {
- switch (recipient.kind()) {
- case Binding.PACKAGE :
- PackageBinding packageBinding = (PackageBinding) recipient;
- if ((packageBinding.tagBits & TagBits.AnnotationResolved) != 0) return;
- packageBinding.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
- break;
- case Binding.TYPE :
- case Binding.GENERIC_TYPE :
- ReferenceBinding type = (ReferenceBinding) recipient;
- if ((type.tagBits & TagBits.AnnotationResolved) != 0) return;
- type.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
- if (length > 0) {
- instances = new AnnotationBinding[length];
- type.setAnnotations(instances);
- }
- break;
- case Binding.METHOD :
- MethodBinding method = (MethodBinding) recipient;
- if ((method.tagBits & TagBits.AnnotationResolved) != 0) return;
- method.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
- if (length > 0) {
- instances = new AnnotationBinding[length];
- method.setAnnotations(instances);
- }
- break;
- case Binding.FIELD :
- FieldBinding field = (FieldBinding) recipient;
- if ((field.tagBits & TagBits.AnnotationResolved) != 0) return;
- field.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
- if (length > 0) {
- instances = new AnnotationBinding[length];
- field.setAnnotations(instances);
- }
- break;
- case Binding.LOCAL :
- LocalVariableBinding local = (LocalVariableBinding) recipient;
- if ((local.tagBits & TagBits.AnnotationResolved) != 0) return;
- local.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
- if (length > 0) {
- instances = new AnnotationBinding[length];
- local.setAnnotations(instances);
- }
- break;
- default :
- return;
- }
- }
- if (annotations == null)
- return;
- TypeBinding[] annotationTypes = new TypeBinding[length];
- for (int i = 0; i < length; i++) {
- Annotation annotation = annotations[i];
- annotation.recipient = recipient;
- annotationTypes[i] = annotation.resolveType(scope);
-
- // null if receiver is a package binding
- if (instances != null)
- instances[i] = annotation.getCompilerAnnotation();
- }
- // check duplicate annotations
- for (int i = 0; i < length; i++) {
- TypeBinding annotationType = annotationTypes[i];
- if (annotationType == null) continue;
- boolean foundDuplicate = false;
- for (int j = i+1; j < length; j++) {
- if (annotationTypes[j] == annotationType) {
- foundDuplicate = true;
- annotationTypes[j] = null; // report it only once
- scope.problemReporter().duplicateAnnotation(annotations[j]);
- }
- }
- if (foundDuplicate) {
- scope.problemReporter().duplicateAnnotation(annotations[i]);
- }
- }
- }
+// /**
+// * Resolve annotations, and check duplicates, answers combined tagBits
+// * for recognized standard annotations
+// */
+// public static void resolveAnnotations(BlockScope scope, Annotation[] annotations, Binding recipient) {
+// AnnotationBinding[] instances = null;
+// int length = annotations == null ? 0 : annotations.length;
+// if (recipient != null) {
+// switch (recipient.kind()) {
+// case Binding.PACKAGE :
+// PackageBinding packageBinding = (PackageBinding) recipient;
+// if ((packageBinding.tagBits & TagBits.AnnotationResolved) != 0) return;
+// packageBinding.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
+// break;
+// case Binding.TYPE :
+// case Binding.GENERIC_TYPE :
+// ReferenceBinding type = (ReferenceBinding) recipient;
+// if ((type.tagBits & TagBits.AnnotationResolved) != 0) return;
+// type.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
+// if (length > 0) {
+// instances = new AnnotationBinding[length];
+// type.setAnnotations(instances);
+// }
+// break;
+// case Binding.METHOD :
+// MethodBinding method = (MethodBinding) recipient;
+// if ((method.tagBits & TagBits.AnnotationResolved) != 0) return;
+// method.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
+// if (length > 0) {
+// instances = new AnnotationBinding[length];
+// method.setAnnotations(instances);
+// }
+// break;
+// case Binding.FIELD :
+// FieldBinding field = (FieldBinding) recipient;
+// if ((field.tagBits & TagBits.AnnotationResolved) != 0) return;
+// field.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
+// if (length > 0) {
+// instances = new AnnotationBinding[length];
+// field.setAnnotations(instances);
+// }
+// break;
+// case Binding.LOCAL :
+// LocalVariableBinding local = (LocalVariableBinding) recipient;
+// if ((local.tagBits & TagBits.AnnotationResolved) != 0) return;
+// local.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
+// if (length > 0) {
+// instances = new AnnotationBinding[length];
+// local.setAnnotations(instances);
+// }
+// break;
+// default :
+// return;
+// }
+// }
+// if (annotations == null)
+// return;
+// TypeBinding[] annotationTypes = new TypeBinding[length];
+// for (int i = 0; i < length; i++) {
+// Annotation annotation = annotations[i];
+// annotation.recipient = recipient;
+// annotationTypes[i] = annotation.resolveType(scope);
+//
+// // null if receiver is a package binding
+// if (instances != null)
+// instances[i] = annotation.getCompilerAnnotation();
+// }
+// // check duplicate annotations
+// for (int i = 0; i < length; i++) {
+// TypeBinding annotationType = annotationTypes[i];
+// if (annotationType == null) continue;
+// boolean foundDuplicate = false;
+// for (int j = i+1; j < length; j++) {
+// if (annotationTypes[j] == annotationType) {
+// foundDuplicate = true;
+// annotationTypes[j] = null; // report it only once
+// scope.problemReporter().duplicateAnnotation(annotations[j]);
+// }
+// }
+// if (foundDuplicate) {
+// scope.problemReporter().duplicateAnnotation(annotations[i]);
+// }
+// }
+// }
/**
* Figures if @Deprecated annotation is specified, do not resolve entire annotations.
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/AbstractMethodDeclaration.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/AbstractMethodDeclaration.java
index 7d5e119..e68c9da 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/AbstractMethodDeclaration.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/AbstractMethodDeclaration.java
@@ -140,12 +140,12 @@
for (int i = 0, length = this.arguments.length; i < length; i++) {
IArgument argument = this.arguments[i];
argument.bind(this.scope, this.binding.parameters[i], used);
- if (argument.getAnnotation() != null) {
- this.binding.tagBits |= TagBits.HasParameterAnnotations;
- if (paramAnnotations == null)
- paramAnnotations = new AnnotationBinding[length][];
- paramAnnotations[i] = argument.getBinding().getAnnotations();
- }
+// if (argument.getAnnotation() != null) {
+// this.binding.tagBits |= TagBits.HasParameterAnnotations;
+// if (paramAnnotations == null)
+// paramAnnotations = new AnnotationBinding[length][];
+// paramAnnotations[i] = argument.getBinding().getAnnotations();
+// }
}
if (paramAnnotations != null)
this.binding.setParameterAnnotations(paramAnnotations);
@@ -376,8 +376,8 @@
if (JavaScriptCore.IS_ECMASCRIPT4)
bindThrownExceptions();
resolveJavadoc();
- if (JavaScriptCore.IS_ECMASCRIPT4)
- resolveAnnotations(scope, this.annotations, this.binding);
+// if (JavaScriptCore.IS_ECMASCRIPT4)
+// resolveAnnotations(scope, this.annotations, this.binding);
resolveStatements();
// check @Deprecated annotation presence
if (this.binding != null
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/Argument.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/Argument.java
index 4282224..872bc89 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/Argument.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/Argument.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.wst.jsdt.internal.compiler.ast;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
import org.eclipse.wst.jsdt.core.ast.IASTNode;
import org.eclipse.wst.jsdt.core.ast.IArgument;
import org.eclipse.wst.jsdt.internal.compiler.ASTVisitor;
@@ -74,8 +73,8 @@
this.binding = new LocalVariableBinding(this, typeBinding, this.modifiers, true);
}
scope.addLocalVariable( this.binding );
- if (JavaScriptCore.IS_ECMASCRIPT4)
- resolveAnnotations(scope, this.annotations, this.binding);
+// if (JavaScriptCore.IS_ECMASCRIPT4)
+// resolveAnnotations(scope, this.annotations, this.binding);
//true stand for argument instead of just local
this.binding.declaration = this;
this.binding.useFlag = used ? LocalVariableBinding.USED : LocalVariableBinding.UNUSED;
@@ -153,7 +152,7 @@
}
this.binding = new LocalVariableBinding(this, exceptionType, modifiers, false); // argument decl, but local var (where isArgument = false)
- resolveAnnotations(scope, this.annotations, this.binding);
+// resolveAnnotations(scope, this.annotations, this.binding);
scope.addLocalVariable(binding);
binding.setConstant(Constant.NotAConstant);
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/CompilationUnitDeclaration.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/CompilationUnitDeclaration.java
index 979c7fa..c087f1c 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/CompilationUnitDeclaration.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/CompilationUnitDeclaration.java
@@ -393,9 +393,9 @@
}
syntheticTypeDeclaration.resolve(this.scope);
// resolve annotations if any
- if (this.currentPackage!= null && this.currentPackage.annotations != null) {
- resolveAnnotations(syntheticTypeDeclaration.staticInitializerScope, this.currentPackage.annotations, this.scope.getDefaultPackage());
- }
+// if (this.currentPackage!= null && this.currentPackage.annotations != null) {
+// resolveAnnotations(syntheticTypeDeclaration.staticInitializerScope, this.currentPackage.annotations, this.scope.getDefaultPackage());
+// }
// resolve javadoc package if any
if (this.javadoc != null) {
this.javadoc.resolve(syntheticTypeDeclaration.staticInitializerScope);
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/FieldDeclaration.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/FieldDeclaration.java
index abaecb0..2a3534c 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/FieldDeclaration.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/FieldDeclaration.java
@@ -168,7 +168,7 @@
initializationScope.initializedField = this.binding;
initializationScope.lastVisibleFieldID = this.binding.id;
- resolveAnnotations(initializationScope, this.annotations, this.binding);
+// resolveAnnotations(initializationScope, this.annotations, this.binding);
// check @Deprecated annotation presence
if ((this.binding.getAnnotationTagBits() & TagBits.AnnotationDeprecated) == 0
&& (this.binding.modifiers & ClassFileConstants.AccDeprecated) != 0
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/LocalDeclaration.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/LocalDeclaration.java
index b1dae4b..b6ca27e 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/LocalDeclaration.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/LocalDeclaration.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.wst.jsdt.internal.compiler.ast;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
import org.eclipse.wst.jsdt.core.ast.IASTNode;
import org.eclipse.wst.jsdt.core.ast.ILocalDeclaration;
import org.eclipse.wst.jsdt.internal.compiler.ASTVisitor;
@@ -298,8 +297,8 @@
}
// only resolve annotation at the end, for constant to be positionned before (96991)
- if (JavaScriptCore.IS_ECMASCRIPT4)
- resolveAnnotations(scope, this.annotations, this.binding);
+// if (JavaScriptCore.IS_ECMASCRIPT4)
+// resolveAnnotations(scope, this.annotations, this.binding);
}
public StringBuffer printStatement(int indent, StringBuffer output) {
if (this.javadoc != null) {
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/TypeDeclaration.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/TypeDeclaration.java
index 38d9f32..5692b4f 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/TypeDeclaration.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/TypeDeclaration.java
@@ -856,12 +856,12 @@
}
try {
boolean old = this.staticInitializerScope.insideTypeAnnotation;
- try {
- this.staticInitializerScope.insideTypeAnnotation = true;
- resolveAnnotations(this.staticInitializerScope, this.annotations, sourceType);
- } finally {
- this.staticInitializerScope.insideTypeAnnotation = old;
- }
+// try {
+// this.staticInitializerScope.insideTypeAnnotation = true;
+// resolveAnnotations(this.staticInitializerScope, this.annotations, sourceType);
+// } finally {
+// this.staticInitializerScope.insideTypeAnnotation = old;
+// }
// check @Deprecated annotation
if ((sourceType.getAnnotationTagBits() & TagBits.AnnotationDeprecated) == 0
&& (sourceType.modifiers & ClassFileConstants.AccDeprecated) != 0
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/ClassScope.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/ClassScope.java
index af58dfb..a6358ec 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/ClassScope.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/ClassScope.java
@@ -291,10 +291,10 @@
MethodBinding[] methodBindings = new MethodBinding[(clinitIndex == -1 ? size : size - 1) + count];
// create special methods for enums
SourceTypeBinding sourceType = getReferenceBinding();
- if (isEnum) {
- methodBindings[0] = sourceType.addSyntheticEnumMethod(TypeConstants.VALUES); // add <EnumType>[] values()
- methodBindings[1] = sourceType.addSyntheticEnumMethod(TypeConstants.VALUEOF); // add <EnumType> valueOf()
- }
+// if (isEnum) {
+// methodBindings[0] = sourceType.addSyntheticEnumMethod(TypeConstants.VALUES); // add <EnumType>[] values()
+// methodBindings[1] = sourceType.addSyntheticEnumMethod(TypeConstants.VALUEOF); // add <EnumType> valueOf()
+// }
// create bindings for source methods
for (int i = 0; i < size; i++) {
if (i != clinitIndex) {
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/FieldBinding.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/FieldBinding.java
index e7bbca5..78ecf4c 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/FieldBinding.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/FieldBinding.java
@@ -13,7 +13,6 @@
import org.eclipse.wst.jsdt.core.JavaScriptCore;
import org.eclipse.wst.jsdt.core.compiler.CharOperation;
import org.eclipse.wst.jsdt.core.infer.InferredAttribute;
-import org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode;
import org.eclipse.wst.jsdt.internal.compiler.ast.AbstractVariableDeclaration;
import org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration;
import org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration;
@@ -39,7 +38,6 @@
super(initialFieldBinding.name, initialFieldBinding.type, initialFieldBinding.modifiers, initialFieldBinding.constant());
this.declaringClass = declaringClass;
this.id = initialFieldBinding.id;
- setAnnotations(initialFieldBinding.getAnnotations());
}
/* API
* Answer the receiver's binding type from Binding.BindingID.
@@ -249,33 +247,25 @@
this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
return 0;
}
- TypeDeclaration typeDecl = scope.referenceContext;
- FieldDeclaration fieldDecl = typeDecl.declarationOf(originalField);
- if (fieldDecl != null) {
- MethodScope initializationScope = isStatic() ? typeDecl.staticInitializerScope : typeDecl.initializerScope;
- FieldBinding previousField = initializationScope.initializedField;
- int previousFieldID = initializationScope.lastVisibleFieldID;
- try {
- initializationScope.initializedField = originalField;
- initializationScope.lastVisibleFieldID = originalField.id;
- ASTNode.resolveAnnotations(initializationScope, fieldDecl.annotations, originalField);
- } finally {
- initializationScope.initializedField = previousField;
- initializationScope.lastVisibleFieldID = previousFieldID;
- }
- }
+// TypeDeclaration typeDecl = scope.referenceContext;
+// FieldDeclaration fieldDecl = typeDecl.declarationOf(originalField);
+// if (fieldDecl != null) {
+// MethodScope initializationScope = isStatic() ? typeDecl.staticInitializerScope : typeDecl.initializerScope;
+// FieldBinding previousField = initializationScope.initializedField;
+// int previousFieldID = initializationScope.lastVisibleFieldID;
+// try {
+// initializationScope.initializedField = originalField;
+// initializationScope.lastVisibleFieldID = originalField.id;
+// ASTNode.resolveAnnotations(initializationScope, fieldDecl.annotations, originalField);
+// } finally {
+// initializationScope.initializedField = previousField;
+// initializationScope.lastVisibleFieldID = previousFieldID;
+// }
+// }
}
return originalField.tagBits;
}
-public AnnotationBinding[] getAnnotations() {
- FieldBinding originalField = this.original();
- ReferenceBinding declaringClassBinding = originalField.declaringClass;
- if (declaringClassBinding == null) {
- return Binding.NO_ANNOTATIONS;
- }
- return declaringClassBinding.retrieveAnnotations(originalField);
-}
/* Answer true if the receiver has default visibility
*/
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/LocalVariableBinding.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/LocalVariableBinding.java
index ca2a711..ee16be2 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/LocalVariableBinding.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/LocalVariableBinding.java
@@ -10,10 +10,8 @@
*******************************************************************************/
package org.eclipse.wst.jsdt.internal.compiler.lookup;
-import org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode;
import org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration;
import org.eclipse.wst.jsdt.internal.compiler.ast.AbstractVariableDeclaration;
-import org.eclipse.wst.jsdt.internal.compiler.ast.Annotation;
import org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration;
import org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration;
import org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration;
@@ -115,51 +113,51 @@
return uniqueKey;
}
- public AnnotationBinding[] getAnnotations() {
- if (this.declaringScope == null) {
- if ((this.tagBits & TagBits.AnnotationResolved) != 0) {
- // annotation are already resolved
- if (this.declaringScope == null)
- if (this.declaration == null) {
- return Binding.NO_ANNOTATIONS;
- }
- Annotation[] annotations = this.declaration.annotations;
- if (annotations != null) {
- int length = annotations.length;
- AnnotationBinding[] annotationBindings = new AnnotationBinding[length];
- for (int i = 0; i < length; i++) {
- AnnotationBinding compilerAnnotation = annotations[i].getCompilerAnnotation();
- if (compilerAnnotation == null) {
- return Binding.NO_ANNOTATIONS;
- }
- annotationBindings[i] = compilerAnnotation;
- }
- return annotationBindings;
- }
- }
- return Binding.NO_ANNOTATIONS;
- }
- SourceTypeBinding sourceType = this.declaringScope.enclosingSourceType();
- if (sourceType == null)
- return Binding.NO_ANNOTATIONS;
-
- AnnotationBinding[] annotations = sourceType.retrieveAnnotations(this);
- if ((this.tagBits & TagBits.AnnotationResolved) == 0) {
- if (((this.tagBits & TagBits.IsArgument) != 0) && this.declaration != null) {
- Annotation[] annotationNodes = declaration.annotations;
- if (annotationNodes != null) {
- int length = annotationNodes.length;
- ASTNode.resolveAnnotations(this.declaringScope, annotationNodes, this);
- annotations = new AnnotationBinding[length];
- for (int i = 0; i < length; i++)
- annotations[i] = new AnnotationBinding(annotationNodes[i]);
- setAnnotations(annotations);
- }
- }
- }
- return annotations;
- }
-
+// public AnnotationBinding[] getAnnotations() {
+// if (this.declaringScope == null) {
+// if ((this.tagBits & TagBits.AnnotationResolved) != 0) {
+// // annotation are already resolved
+// if (this.declaringScope == null)
+// if (this.declaration == null) {
+// return Binding.NO_ANNOTATIONS;
+// }
+// Annotation[] annotations = this.declaration.annotations;
+// if (annotations != null) {
+// int length = annotations.length;
+// AnnotationBinding[] annotationBindings = new AnnotationBinding[length];
+// for (int i = 0; i < length; i++) {
+// AnnotationBinding compilerAnnotation = annotations[i].getCompilerAnnotation();
+// if (compilerAnnotation == null) {
+// return Binding.NO_ANNOTATIONS;
+// }
+// annotationBindings[i] = compilerAnnotation;
+// }
+// return annotationBindings;
+// }
+// }
+// return Binding.NO_ANNOTATIONS;
+// }
+// SourceTypeBinding sourceType = this.declaringScope.enclosingSourceType();
+// if (sourceType == null)
+// return Binding.NO_ANNOTATIONS;
+//
+// AnnotationBinding[] annotations = sourceType.retrieveAnnotations(this);
+// if ((this.tagBits & TagBits.AnnotationResolved) == 0) {
+// if (((this.tagBits & TagBits.IsArgument) != 0) && this.declaration != null) {
+// Annotation[] annotationNodes = declaration.annotations;
+// if (annotationNodes != null) {
+// int length = annotationNodes.length;
+// ASTNode.resolveAnnotations(this.declaringScope, annotationNodes, this);
+// annotations = new AnnotationBinding[length];
+// for (int i = 0; i < length; i++)
+// annotations[i] = new AnnotationBinding(annotationNodes[i]);
+// setAnnotations(annotations);
+// }
+// }
+// }
+// return annotations;
+// }
+//
private void getScopeKey(BlockScope scope, StringBuffer buffer) {
int scopeIndex = scope.scopeIndex();
if (scopeIndex != -1) {
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/MethodBinding.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/MethodBinding.java
index d943496..ac1acf6 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/MethodBinding.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/MethodBinding.java
@@ -11,9 +11,7 @@
package org.eclipse.wst.jsdt.internal.compiler.lookup;
import org.eclipse.wst.jsdt.core.compiler.CharOperation;
-import org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode;
import org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration;
-import org.eclipse.wst.jsdt.internal.compiler.ast.TypeDeclaration;
import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.wst.jsdt.internal.oaametadata.Method;
@@ -440,16 +438,16 @@
MethodBinding originalMethod = this.original();
return originalMethod.declaringClass.retrieveAnnotations(originalMethod);
}
-/**
- * @param index the index of the parameter of interest
- * @return the annotations on the <code>index</code>th parameter
- * @throws ArrayIndexOutOfBoundsException when <code>index</code> is not valid
- */
-public AnnotationBinding[] getParameterAnnotations(int index) {
- MethodBinding originalMethod = this.original();
- AnnotationHolder holder = originalMethod.declaringClass.retrieveAnnotationHolder(originalMethod, true);
- return holder == null ? Binding.NO_ANNOTATIONS : holder.getParameterAnnotations(index);
-}
+///**
+// * @param index the index of the parameter of interest
+// * @return the annotations on the <code>index</code>th parameter
+// * @throws ArrayIndexOutOfBoundsException when <code>index</code> is not valid
+// */
+//public AnnotationBinding[] getParameterAnnotations(int index) {
+// MethodBinding originalMethod = this.original();
+// AnnotationHolder holder = originalMethod.declaringClass.retrieveAnnotationHolder(originalMethod, true);
+// return holder == null ? Binding.NO_ANNOTATIONS : holder.getParameterAnnotations(index);
+//}
public final int getAccessFlags() {
return modifiers & ExtraCompilerModifiers.AccJustFlag;
}
@@ -461,15 +459,15 @@
*/
public long getAnnotationTagBits() {
MethodBinding originalMethod = this.original();
- if ((originalMethod.tagBits & TagBits.AnnotationResolved) == 0 && originalMethod.declaringClass instanceof SourceTypeBinding) {
- ClassScope scope = ((SourceTypeBinding) originalMethod.declaringClass).classScope;
- if (scope != null) {
- TypeDeclaration typeDecl = scope.referenceContext;
- AbstractMethodDeclaration methodDecl = typeDecl.declarationOf(originalMethod);
- if (methodDecl != null)
- ASTNode.resolveAnnotations(methodDecl.scope, methodDecl.annotations, originalMethod);
- }
- }
+// if ((originalMethod.tagBits & TagBits.AnnotationResolved) == 0 && originalMethod.declaringClass instanceof SourceTypeBinding) {
+// ClassScope scope = ((SourceTypeBinding) originalMethod.declaringClass).classScope;
+// if (scope != null) {
+// TypeDeclaration typeDecl = scope.referenceContext;
+// AbstractMethodDeclaration methodDecl = typeDecl.declarationOf(originalMethod);
+// if (methodDecl != null)
+// ASTNode.resolveAnnotations(methodDecl.scope, methodDecl.annotations, originalMethod);
+// }
+// }
return originalMethod.tagBits;
}
/**
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/ReferenceBinding.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/ReferenceBinding.java
index d3c1c65..2117447 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/ReferenceBinding.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/ReferenceBinding.java
@@ -616,12 +616,6 @@
return this.modifiers & ExtraCompilerModifiers.AccJustFlag;
}
/**
- * @return the JSR 175 annotations for this type.
- */
-public AnnotationBinding[] getAnnotations() {
- return retrieveAnnotations(this);
-}
-/**
* @see org.eclipse.wst.jsdt.internal.compiler.lookup.Binding#getAnnotationTagBits()
*/
public long getAnnotationTagBits() {
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/SourceTypeBinding.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/SourceTypeBinding.java
index d4d6233..fb1a2f3 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/SourceTypeBinding.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/SourceTypeBinding.java
@@ -20,7 +20,6 @@
import org.eclipse.wst.jsdt.core.infer.InferredAttribute;
import org.eclipse.wst.jsdt.core.infer.InferredMethod;
import org.eclipse.wst.jsdt.core.infer.InferredType;
-import org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode;
import org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration;
import org.eclipse.wst.jsdt.internal.compiler.ast.Argument;
import org.eclipse.wst.jsdt.internal.compiler.ast.FieldDeclaration;
@@ -832,18 +831,18 @@
* @see org.eclipse.wst.jsdt.internal.compiler.lookup.Binding#getAnnotationTagBits()
*/
public long getAnnotationTagBits() {
- if ((this.tagBits & TagBits.AnnotationResolved) == 0 && this.scope != null) {
- TypeDeclaration typeDecl = this.classScope.referenceContext;
- boolean old = typeDecl.staticInitializerScope.insideTypeAnnotation;
- try {
- typeDecl.staticInitializerScope.insideTypeAnnotation = true;
- ASTNode.resolveAnnotations(typeDecl.staticInitializerScope, typeDecl.annotations, this);
- } finally {
- typeDecl.staticInitializerScope.insideTypeAnnotation = old;
- }
- if ((this.tagBits & TagBits.AnnotationDeprecated) != 0)
- this.modifiers |= ClassFileConstants.AccDeprecated;
- }
+// if ((this.tagBits & TagBits.AnnotationResolved) == 0 && this.scope != null) {
+// TypeDeclaration typeDecl = this.classScope.referenceContext;
+// boolean old = typeDecl.staticInitializerScope.insideTypeAnnotation;
+// try {
+// typeDecl.staticInitializerScope.insideTypeAnnotation = true;
+// ASTNode.resolveAnnotations(typeDecl.staticInitializerScope, typeDecl.annotations, this);
+// } finally {
+// typeDecl.staticInitializerScope.insideTypeAnnotation = old;
+// }
+// if ((this.tagBits & TagBits.AnnotationDeprecated) != 0)
+// this.modifiers |= ClassFileConstants.AccDeprecated;
+// }
return this.tagBits;
}
public MethodBinding[] getDefaultAbstractMethods() {
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/VariableBinding.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/VariableBinding.java
index 2750c3f..f646ec8 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/VariableBinding.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/VariableBinding.java
@@ -34,7 +34,6 @@
return this.constant;
}
- public abstract AnnotationBinding[] getAnnotations();
public final boolean isBlankFinal(){
return (modifiers & ExtraCompilerModifiers.AccBlankFinal) != 0;
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CreateTypeMemberOperation.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CreateTypeMemberOperation.java
index 9f922f2..057d611 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CreateTypeMemberOperation.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CreateTypeMemberOperation.java
@@ -15,20 +15,18 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptModelStatus;
import org.eclipse.wst.jsdt.core.IJavaScriptModelStatusConstants;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IType;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.dom.AST;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ASTParser;
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.SimpleName;
import org.eclipse.wst.jsdt.core.dom.StructuralPropertyDescriptor;
import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
@@ -72,10 +70,6 @@
return JavaScriptUnit.TYPES_PROPERTY;
else
return JavaScriptUnit.STATEMENTS_PROPERTY;
- case ASTNode.ENUM_DECLARATION:
- return EnumDeclaration.BODY_DECLARATIONS_PROPERTY;
- case ASTNode.ANNOTATION_TYPE_DECLARATION:
- return AnnotationTypeDeclaration.BODY_DECLARATIONS_PROPERTY;
default:
return TypeDeclaration.BODY_DECLARATIONS_PROPERTY;
}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SortElementsOperation.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SortElementsOperation.java
index 2abe564..7a2bc2b 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SortElementsOperation.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SortElementsOperation.java
@@ -23,21 +23,18 @@
import org.eclipse.text.edits.TextEdit;
import org.eclipse.text.edits.TextEditGroup;
import org.eclipse.wst.jsdt.core.IBuffer;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptModelStatus;
import org.eclipse.wst.jsdt.core.IJavaScriptModelStatusConstants;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.compiler.CharOperation;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ASTParser;
import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
-import org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.rewrite.ASTRewrite;
import org.eclipse.wst.jsdt.core.dom.rewrite.ListRewrite;
@@ -197,15 +194,6 @@
}
return true;
}
- public boolean visit(AnnotationTypeDeclaration annotationTypeDeclaration) {
- List bodyDeclarations = annotationTypeDeclaration.bodyDeclarations();
- for (Iterator iter = bodyDeclarations.iterator(); iter.hasNext();) {
- BodyDeclaration bodyDeclaration = (BodyDeclaration) iter.next();
- bodyDeclaration.setProperty(JavaScriptUnitSorter.RELATIVE_ORDER, new Integer(bodyDeclaration.getStartPosition()));
- annotationTypeDeclaration.setProperty(CONTAINS_MALFORMED_NODES, Boolean.valueOf(isMalformed(bodyDeclaration)));
- }
- return true;
- }
public boolean visit(AnonymousClassDeclaration anonymousClassDeclaration) {
List bodyDeclarations = anonymousClassDeclaration.bodyDeclarations();
@@ -227,21 +215,6 @@
return true;
}
- public boolean visit(EnumDeclaration enumDeclaration) {
- List bodyDeclarations = enumDeclaration.bodyDeclarations();
- for (Iterator iter = bodyDeclarations.iterator(); iter.hasNext();) {
- BodyDeclaration bodyDeclaration = (BodyDeclaration) iter.next();
- bodyDeclaration.setProperty(JavaScriptUnitSorter.RELATIVE_ORDER, new Integer(bodyDeclaration.getStartPosition()));
- enumDeclaration.setProperty(CONTAINS_MALFORMED_NODES, Boolean.valueOf(isMalformed(bodyDeclaration)));
- }
- List enumConstants = enumDeclaration.enumConstants();
- for (Iterator iter = enumConstants.iterator(); iter.hasNext();) {
- EnumConstantDeclaration enumConstantDeclaration = (EnumConstantDeclaration) iter.next();
- enumConstantDeclaration.setProperty(JavaScriptUnitSorter.RELATIVE_ORDER, new Integer(enumConstantDeclaration.getStartPosition()));
- enumDeclaration.setProperty(CONTAINS_MALFORMED_NODES, Boolean.valueOf(isMalformed(enumConstantDeclaration)));
- }
- return true;
- }
});
final ASTRewrite rewriter= ASTRewrite.create(ast.getAST());
@@ -276,14 +249,6 @@
return true;
}
- public boolean visit(AnnotationTypeDeclaration annotationTypeDeclaration) {
- if (checkMalformedNodes(annotationTypeDeclaration)) {
- return true; // abort sorting of current element
- }
-
- sortElements(annotationTypeDeclaration.bodyDeclarations(), rewriter.getListRewrite(annotationTypeDeclaration, AnnotationTypeDeclaration.BODY_DECLARATIONS_PROPERTY));
- return true;
- }
public boolean visit(AnonymousClassDeclaration anonymousClassDeclaration) {
if (checkMalformedNodes(anonymousClassDeclaration)) {
@@ -303,15 +268,6 @@
return true;
}
- public boolean visit(EnumDeclaration enumDeclaration) {
- if (checkMalformedNodes(enumDeclaration)) {
- return true; // abort sorting of current element
- }
-
- sortElements(enumDeclaration.bodyDeclarations(), rewriter.getListRewrite(enumDeclaration, EnumDeclaration.BODY_DECLARATIONS_PROPERTY));
- sortElements(enumDeclaration.enumConstants(), rewriter.getListRewrite(enumDeclaration, EnumDeclaration.ENUM_CONSTANTS_PROPERTY));
- return true;
- }
});
if (!hasChanges[0])
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceField.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceField.java
index 6746b20..f1c1fe7 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceField.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceField.java
@@ -42,9 +42,6 @@
// For enum constant declaration, we return the node directly
ASTNode node = super.findNode(ast);
if (node == null) return null;
- if (node.getNodeType() == ASTNode.ENUM_CONSTANT_DECLARATION) {
- return node;
- }
return node.getParent();
}
/**
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java
index 422e29e..68c97af 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java
@@ -35,9 +35,6 @@
import org.eclipse.wst.jsdt.core.dom.AST;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
-import org.eclipse.wst.jsdt.core.dom.Annotation;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeMemberDeclaration;
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.wst.jsdt.core.dom.ArrayAccess;
import org.eclipse.wst.jsdt.core.dom.ArrayCreation;
@@ -54,38 +51,33 @@
import org.eclipse.wst.jsdt.core.dom.ChildListPropertyDescriptor;
import org.eclipse.wst.jsdt.core.dom.ChildPropertyDescriptor;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.ConditionalExpression;
import org.eclipse.wst.jsdt.core.dom.ConstructorInvocation;
import org.eclipse.wst.jsdt.core.dom.ContinueStatement;
import org.eclipse.wst.jsdt.core.dom.DoStatement;
import org.eclipse.wst.jsdt.core.dom.EmptyStatement;
import org.eclipse.wst.jsdt.core.dom.EnhancedForStatement;
-import org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
import org.eclipse.wst.jsdt.core.dom.FieldAccess;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
import org.eclipse.wst.jsdt.core.dom.ForInStatement;
import org.eclipse.wst.jsdt.core.dom.ForStatement;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.FunctionExpression;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
+import org.eclipse.wst.jsdt.core.dom.FunctionRef;
+import org.eclipse.wst.jsdt.core.dom.FunctionRefParameter;
import org.eclipse.wst.jsdt.core.dom.IfStatement;
import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
import org.eclipse.wst.jsdt.core.dom.InfixExpression;
import org.eclipse.wst.jsdt.core.dom.Initializer;
import org.eclipse.wst.jsdt.core.dom.InstanceofExpression;
import org.eclipse.wst.jsdt.core.dom.JSdoc;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.LabeledStatement;
import org.eclipse.wst.jsdt.core.dom.ListExpression;
-import org.eclipse.wst.jsdt.core.dom.MarkerAnnotation;
import org.eclipse.wst.jsdt.core.dom.MemberRef;
-import org.eclipse.wst.jsdt.core.dom.MemberValuePair;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
-import org.eclipse.wst.jsdt.core.dom.FunctionRef;
-import org.eclipse.wst.jsdt.core.dom.FunctionRefParameter;
import org.eclipse.wst.jsdt.core.dom.Modifier;
-import org.eclipse.wst.jsdt.core.dom.NormalAnnotation;
import org.eclipse.wst.jsdt.core.dom.NullLiteral;
import org.eclipse.wst.jsdt.core.dom.NumberLiteral;
import org.eclipse.wst.jsdt.core.dom.ObjectLiteral;
@@ -102,7 +94,6 @@
import org.eclipse.wst.jsdt.core.dom.ReturnStatement;
import org.eclipse.wst.jsdt.core.dom.SimpleName;
import org.eclipse.wst.jsdt.core.dom.SimpleType;
-import org.eclipse.wst.jsdt.core.dom.SingleMemberAnnotation;
import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
import org.eclipse.wst.jsdt.core.dom.StringLiteral;
import org.eclipse.wst.jsdt.core.dom.StructuralPropertyDescriptor;
@@ -1277,9 +1268,6 @@
*/
protected String getSeparatorString(int nodeIndex) {
ASTNode curr= getNewNode(nodeIndex);
- if (curr instanceof Annotation) {
- return this.annotationSeparation.getPrefix(getNodeIndent(nodeIndex + 1));
- }
return super.getSeparatorString(nodeIndex);
}
}
@@ -2564,7 +2552,6 @@
}
if (node.getAST().apiLevel() >= AST.JLS3) {
int pos= rewriteJavadoc(node, PackageDeclaration.JAVADOC_PROPERTY);
- rewriteNodeList(node, PackageDeclaration.ANNOTATIONS_PROPERTY, pos, "", " "); //$NON-NLS-1$ //$NON-NLS-2$
}
rewriteRequiredNode(node, PackageDeclaration.NAME_PROPERTY);
@@ -3183,46 +3170,6 @@
}
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration)
- */
- public boolean visit(AnnotationTypeDeclaration node) {
- if (!hasChildrenChanges(node)) {
- return doVisitUnchangedChildren(node);
- }
- int pos= rewriteJavadoc(node, AnnotationTypeDeclaration.JAVADOC_PROPERTY);
- rewriteModifiers2(node, AnnotationTypeDeclaration.MODIFIERS2_PROPERTY, pos);
- pos= rewriteRequiredNode(node, AnnotationTypeDeclaration.NAME_PROPERTY);
-
- int startIndent= getIndent(node.getStartPosition()) + 1;
- int startPos= getPosAfterLeftBrace(pos);
- rewriteParagraphList(node, AnnotationTypeDeclaration.BODY_DECLARATIONS_PROPERTY, startPos, startIndent, -1, 2);
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.AnnotationTypeMemberDeclaration)
- */
- public boolean visit(AnnotationTypeMemberDeclaration node) {
- if (!hasChildrenChanges(node)) {
- return doVisitUnchangedChildren(node);
- }
- int pos= rewriteJavadoc(node, AnnotationTypeMemberDeclaration.JAVADOC_PROPERTY);
- rewriteModifiers2(node, AnnotationTypeMemberDeclaration.MODIFIERS2_PROPERTY, pos);
- rewriteRequiredNode(node, AnnotationTypeMemberDeclaration.TYPE_PROPERTY);
- pos= rewriteRequiredNode(node, AnnotationTypeMemberDeclaration.NAME_PROPERTY);
-
- try {
- int changeKind= getChangeKind(node, AnnotationTypeMemberDeclaration.DEFAULT_PROPERTY);
- if (changeKind == RewriteEvent.INSERTED || changeKind == RewriteEvent.REMOVED) {
- pos= getScanner().getTokenEndOffset(ITerminalSymbols.TokenNameRPAREN, pos);
- }
- rewriteNode(node, AnnotationTypeMemberDeclaration.DEFAULT_PROPERTY, pos, this.formatter.ANNOT_MEMBER_DEFAULT);
- } catch (CoreException e) {
- handleException(e);
- }
- return false;
- }
/* (non-Javadoc)
* @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.EnhancedForStatement)
@@ -3249,120 +3196,6 @@
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration)
- */
- public boolean visit(EnumConstantDeclaration node) {
- if (!hasChildrenChanges(node)) {
- return doVisitUnchangedChildren(node);
- }
- int pos= rewriteJavadoc(node, EnumConstantDeclaration.JAVADOC_PROPERTY);
- rewriteModifiers2(node, EnumConstantDeclaration.MODIFIERS2_PROPERTY, pos);
- pos= rewriteRequiredNode(node, EnumConstantDeclaration.NAME_PROPERTY);
- RewriteEvent argsEvent= getEvent(node, EnumConstantDeclaration.ARGUMENTS_PROPERTY);
- if (argsEvent != null && argsEvent.getChangeKind() != RewriteEvent.UNCHANGED) {
- RewriteEvent[] children= argsEvent.getChildren();
- try {
- int nextTok= getScanner().readNext(pos, true);
- boolean hasParents= (nextTok == ITerminalSymbols.TokenNameLPAREN);
- boolean isAllRemoved= hasParents && isAllOfKind(children, RewriteEvent.REMOVED);
- String prefix= ""; //$NON-NLS-1$
- if (!hasParents) {
- prefix= "("; //$NON-NLS-1$
- } else if (!isAllRemoved) {
- pos= getScanner().getCurrentEndOffset();
- }
- pos= rewriteNodeList(node, EnumConstantDeclaration.ARGUMENTS_PROPERTY, pos, prefix, ", "); //$NON-NLS-1$
-
- if (!hasParents) {
- doTextInsert(pos, ")", getEditGroup(children[children.length - 1])); //$NON-NLS-1$
- } else if (isAllRemoved) {
- int afterClosing= getScanner().getNextEndOffset(pos, true);
- doTextRemove(pos, afterClosing - pos, getEditGroup(children[children.length - 1]));
- pos= afterClosing;
- }
- } catch (CoreException e) {
- handleException(e);
- }
- } else {
- pos= doVisit(node, EnumConstantDeclaration.ARGUMENTS_PROPERTY, pos);
- }
-
- if (isChanged(node, EnumConstantDeclaration.ANONYMOUS_CLASS_DECLARATION_PROPERTY)) {
- int kind= getChangeKind(node, EnumConstantDeclaration.ANONYMOUS_CLASS_DECLARATION_PROPERTY);
- if (kind == RewriteEvent.REMOVED) {
- try {
- // 'pos' can be before brace
- pos= getScanner().getPreviousTokenEndOffset(ITerminalSymbols.TokenNameLBRACE, pos);
- } catch (CoreException e) {
- handleException(e);
- }
- } else {
- pos= node.getStartPosition() + node.getLength(); // insert pos
- }
- rewriteNode(node, EnumConstantDeclaration.ANONYMOUS_CLASS_DECLARATION_PROPERTY, pos, ASTRewriteFormatter.SPACE);
- }
- return false;
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.EnumDeclaration)
- */
- public boolean visit(EnumDeclaration node) {
- if (!hasChildrenChanges(node)) {
- return doVisitUnchangedChildren(node);
- }
- int pos= rewriteJavadoc(node, EnumDeclaration.JAVADOC_PROPERTY);
- rewriteModifiers2(node, EnumDeclaration.MODIFIERS2_PROPERTY, pos);
- pos= rewriteRequiredNode(node, EnumDeclaration.NAME_PROPERTY);
- pos= rewriteNodeList(node, EnumDeclaration.SUPER_INTERFACE_TYPES_PROPERTY, pos, " implements ", ", "); //$NON-NLS-1$ //$NON-NLS-2$
-
- pos= getPosAfterLeftBrace(pos);
-
- String leadString= ""; //$NON-NLS-1$
- RewriteEvent constEvent= getEvent(node, EnumDeclaration.ENUM_CONSTANTS_PROPERTY);
-
- if (constEvent != null && constEvent.getChangeKind() != RewriteEvent.UNCHANGED) {
- RewriteEvent[] events= constEvent.getChildren();
- if (isAllOfKind(events, RewriteEvent.INSERTED)) {
- leadString= this.formatter.FIRST_ENUM_CONST.getPrefix(getIndent(node.getStartPosition()));
- }
- }
- pos= rewriteNodeList(node, EnumDeclaration.ENUM_CONSTANTS_PROPERTY, pos, leadString, ", "); //$NON-NLS-1$
-
- RewriteEvent bodyEvent= getEvent(node, EnumDeclaration.BODY_DECLARATIONS_PROPERTY);
- int indent= 0;
- if (bodyEvent != null && bodyEvent.getChangeKind() != RewriteEvent.UNCHANGED) {
- boolean hasConstants= !((List) getNewValue(node, EnumDeclaration.ENUM_CONSTANTS_PROPERTY)).isEmpty();
-
- RewriteEvent[] children= bodyEvent.getChildren();
- try {
- if (hasConstants) {
- indent= getIndent(pos);
- } else {
- indent= getIndent(node.getStartPosition()) + 1;
- }
- int token= getScanner().readNext(pos, true);
- boolean hasSemicolon= token == ITerminalSymbols.TokenNameSEMICOLON;
- if (!hasSemicolon && isAllOfKind(children, RewriteEvent.INSERTED)) {
- if (!hasConstants) {
- String str= this.formatter.FIRST_ENUM_CONST.getPrefix(indent - 1);
- doTextInsert(pos, str, getEditGroup(children[0]));
- }
- doTextInsert(pos, ";", getEditGroup(children[0])); //$NON-NLS-1$
- } else if (hasSemicolon) {
- int endPos= getScanner().getCurrentEndOffset();
- if (isAllOfKind(children, RewriteEvent.REMOVED)) {
- doTextRemove(pos, endPos - pos, getEditGroup(children[0]));
- }
- pos= endPos;
- }
- } catch (CoreException e) {
- handleException(e);
- }
- }
- rewriteParagraphList(node, EnumDeclaration.BODY_DECLARATIONS_PROPERTY, pos, indent, -1, 2);
- return false;
- }
public boolean visit(ListExpression node) {
if (!hasChildrenChanges(node)) {
@@ -3375,28 +3208,6 @@
}
/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.MarkerAnnotation)
- */
- public boolean visit(MarkerAnnotation node) {
- if (!hasChildrenChanges(node)) {
- return doVisitUnchangedChildren(node);
- }
- rewriteRequiredNode(node, MarkerAnnotation.TYPE_NAME_PROPERTY);
- return false;
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.MemberValuePair)
- */
- public boolean visit(MemberValuePair node) {
- if (!hasChildrenChanges(node)) {
- return doVisitUnchangedChildren(node);
- }
- rewriteRequiredNode(node, MemberValuePair.NAME_PROPERTY);
- rewriteRequiredNode(node, MemberValuePair.VALUE_PROPERTY);
-
- return false;
- }
- /* (non-Javadoc)
* @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.Modifier)
*/
public boolean visit(Modifier node) {
@@ -3409,27 +3220,6 @@
return false;
}
/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.NormalAnnotation)
- */
- public boolean visit(NormalAnnotation node) {
- if (!hasChildrenChanges(node)) {
- return doVisitUnchangedChildren(node);
- }
- int pos= rewriteRequiredNode(node, NormalAnnotation.TYPE_NAME_PROPERTY);
- if (isChanged(node, NormalAnnotation.VALUES_PROPERTY)) {
- // eval position after opening parent
- try {
- int startOffset= getScanner().getTokenEndOffset(ITerminalSymbols.TokenNameLPAREN, pos);
- rewriteNodeList(node, NormalAnnotation.VALUES_PROPERTY, startOffset, "", ", "); //$NON-NLS-1$ //$NON-NLS-2$
- } catch (CoreException e) {
- handleException(e);
- }
- } else {
- voidVisit(node, NormalAnnotation.VALUES_PROPERTY);
- }
- return false;
- }
- /* (non-Javadoc)
* @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.ParameterizedType)
*/
public boolean visit(ParameterizedType node) {
@@ -3461,17 +3251,6 @@
rewriteRequiredNode(node, QualifiedType.NAME_PROPERTY);
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.SingleMemberAnnotation)
- */
- public boolean visit(SingleMemberAnnotation node) {
- if (!hasChildrenChanges(node)) {
- return doVisitUnchangedChildren(node);
- }
- rewriteRequiredNode(node, SingleMemberAnnotation.TYPE_NAME_PROPERTY);
- rewriteRequiredNode(node, SingleMemberAnnotation.VALUE_PROPERTY);
- return false;
- }
public boolean visit(UndefinedLiteral node) {
if (!hasChildrenChanges(node)) {
return doVisitUnchangedChildren(node);
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/dom/rewrite/ASTRewriteFlattener.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/dom/rewrite/ASTRewriteFlattener.java
index b7ab126..1295b3f 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/dom/rewrite/ASTRewriteFlattener.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/dom/rewrite/ASTRewriteFlattener.java
@@ -15,8 +15,6 @@
import org.eclipse.wst.jsdt.core.dom.AST;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeMemberDeclaration;
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.wst.jsdt.core.dom.ArrayAccess;
import org.eclipse.wst.jsdt.core.dom.ArrayCreation;
@@ -34,39 +32,34 @@
import org.eclipse.wst.jsdt.core.dom.ChildListPropertyDescriptor;
import org.eclipse.wst.jsdt.core.dom.ChildPropertyDescriptor;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.ConditionalExpression;
import org.eclipse.wst.jsdt.core.dom.ConstructorInvocation;
import org.eclipse.wst.jsdt.core.dom.ContinueStatement;
import org.eclipse.wst.jsdt.core.dom.DoStatement;
import org.eclipse.wst.jsdt.core.dom.EmptyStatement;
import org.eclipse.wst.jsdt.core.dom.EnhancedForStatement;
-import org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
import org.eclipse.wst.jsdt.core.dom.FieldAccess;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
import org.eclipse.wst.jsdt.core.dom.ForInStatement;
import org.eclipse.wst.jsdt.core.dom.ForStatement;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.FunctionExpression;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
+import org.eclipse.wst.jsdt.core.dom.FunctionRef;
+import org.eclipse.wst.jsdt.core.dom.FunctionRefParameter;
import org.eclipse.wst.jsdt.core.dom.IfStatement;
import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
import org.eclipse.wst.jsdt.core.dom.InfixExpression;
import org.eclipse.wst.jsdt.core.dom.Initializer;
import org.eclipse.wst.jsdt.core.dom.InstanceofExpression;
import org.eclipse.wst.jsdt.core.dom.JSdoc;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.LabeledStatement;
import org.eclipse.wst.jsdt.core.dom.LineComment;
import org.eclipse.wst.jsdt.core.dom.ListExpression;
-import org.eclipse.wst.jsdt.core.dom.MarkerAnnotation;
import org.eclipse.wst.jsdt.core.dom.MemberRef;
-import org.eclipse.wst.jsdt.core.dom.MemberValuePair;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
-import org.eclipse.wst.jsdt.core.dom.FunctionRef;
-import org.eclipse.wst.jsdt.core.dom.FunctionRefParameter;
import org.eclipse.wst.jsdt.core.dom.Modifier;
-import org.eclipse.wst.jsdt.core.dom.NormalAnnotation;
import org.eclipse.wst.jsdt.core.dom.NullLiteral;
import org.eclipse.wst.jsdt.core.dom.NumberLiteral;
import org.eclipse.wst.jsdt.core.dom.ObjectLiteral;
@@ -83,7 +76,6 @@
import org.eclipse.wst.jsdt.core.dom.ReturnStatement;
import org.eclipse.wst.jsdt.core.dom.SimpleName;
import org.eclipse.wst.jsdt.core.dom.SimpleType;
-import org.eclipse.wst.jsdt.core.dom.SingleMemberAnnotation;
import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
import org.eclipse.wst.jsdt.core.dom.StringLiteral;
import org.eclipse.wst.jsdt.core.dom.StructuralPropertyDescriptor;
@@ -822,7 +814,6 @@
if (javadoc != null) {
javadoc.accept(this);
}
- visitList(node, PackageDeclaration.ANNOTATIONS_PROPERTY, String.valueOf(' '));
}
this.result.append("package "); //$NON-NLS-1$
getChildNode(node, PackageDeclaration.NAME_PROPERTY).accept(this);
@@ -1288,46 +1279,6 @@
this.result.append(getAttribute(node, TextElement.TEXT_PROPERTY));
return false;
}
- /*
- * @see ASTVisitor#visit(AnnotationTypeDeclaration)
- * @since 3.0
- */
- public boolean visit(AnnotationTypeDeclaration node) {
- ASTNode javadoc= getChildNode(node, AnnotationTypeDeclaration.JAVADOC_PROPERTY);
- if (javadoc != null) {
- javadoc.accept(this);
- }
- visitList(node, AnnotationTypeDeclaration.MODIFIERS2_PROPERTY, String.valueOf(' '), Util.EMPTY_STRING, String.valueOf(' '));
- this.result.append("@interface ");//$NON-NLS-1$
- getChildNode(node, AnnotationTypeDeclaration.NAME_PROPERTY).accept(this);
- this.result.append('{');
- visitList(node, AnnotationTypeDeclaration.BODY_DECLARATIONS_PROPERTY, Util.EMPTY_STRING);
- this.result.append('}');
- return false;
- }
-
- /*
- * @see ASTVisitor#visit(AnnotationTypeMemberDeclaration)
- * @since 3.0
- */
- public boolean visit(AnnotationTypeMemberDeclaration node) {
- ASTNode javadoc= getChildNode(node, AnnotationTypeMemberDeclaration.JAVADOC_PROPERTY);
- if (javadoc != null) {
- javadoc.accept(this);
- }
- visitList(node, AnnotationTypeMemberDeclaration.MODIFIERS2_PROPERTY, String.valueOf(' '), Util.EMPTY_STRING, String.valueOf(' '));
- getChildNode(node, AnnotationTypeMemberDeclaration.TYPE_PROPERTY).accept(this);
- this.result.append(' ');
- getChildNode(node, AnnotationTypeMemberDeclaration.NAME_PROPERTY).accept(this);
- this.result.append("()");//$NON-NLS-1$
- ASTNode def= getChildNode(node, AnnotationTypeMemberDeclaration.DEFAULT_PROPERTY);
- if (def != null) {
- this.result.append(" default ");//$NON-NLS-1$
- def.accept(this);
- }
- this.result.append(';');
- return false;
- }
/*
* @see ASTVisitor#visit(EnhancedForStatement)
@@ -1343,67 +1294,8 @@
return false;
}
- /*
- * @see ASTVisitor#visit(EnumConstantDeclaration)
- * @since 3.0
- */
- public boolean visit(EnumConstantDeclaration node) {
- ASTNode javadoc= getChildNode(node, EnumConstantDeclaration.JAVADOC_PROPERTY);
- if (javadoc != null) {
- javadoc.accept(this);
- }
- visitList(node, EnumConstantDeclaration.MODIFIERS2_PROPERTY, String.valueOf(' '), Util.EMPTY_STRING, String.valueOf(' '));
- getChildNode(node, EnumConstantDeclaration.NAME_PROPERTY).accept(this);
- visitList(node, EnumConstantDeclaration.ARGUMENTS_PROPERTY, String.valueOf(','), String.valueOf('('), String.valueOf(')'));
- ASTNode classDecl= getChildNode(node, EnumConstantDeclaration.ANONYMOUS_CLASS_DECLARATION_PROPERTY);
- if (classDecl != null) {
- classDecl.accept(this);
- }
- return false;
- }
/*
- * @see ASTVisitor#visit(EnumDeclaration)
- * @since 3.0
- */
- public boolean visit(EnumDeclaration node) {
- ASTNode javadoc= getChildNode(node, EnumDeclaration.JAVADOC_PROPERTY);
- if (javadoc != null) {
- javadoc.accept(this);
- }
- visitList(node, EnumDeclaration.MODIFIERS2_PROPERTY, String.valueOf(' '), Util.EMPTY_STRING, String.valueOf(' '));
- this.result.append("enum ");//$NON-NLS-1$
- getChildNode(node, EnumDeclaration.NAME_PROPERTY).accept(this);
- this.result.append(' ');
- visitList(node, EnumDeclaration.SUPER_INTERFACE_TYPES_PROPERTY, String.valueOf(','), "implements ", Util.EMPTY_STRING); //$NON-NLS-1$
-
- this.result.append('{');
- visitList(node, EnumDeclaration.ENUM_CONSTANTS_PROPERTY, String.valueOf(','), Util.EMPTY_STRING, Util.EMPTY_STRING);
- visitList(node, EnumDeclaration.BODY_DECLARATIONS_PROPERTY, Util.EMPTY_STRING, String.valueOf(';'), Util.EMPTY_STRING);
- this.result.append('}');
- return false;
- }
- /*
- * @see ASTVisitor#visit(MarkerAnnotation)
- * @since 3.0
- */
- public boolean visit(MarkerAnnotation node) {
- this.result.append('@');
- getChildNode(node, MarkerAnnotation.TYPE_NAME_PROPERTY).accept(this);
- return false;
- }
-
- /*
- * @see ASTVisitor#visit(MemberValuePair)
- * @since 3.0
- */
- public boolean visit(MemberValuePair node) {
- getChildNode(node, MemberValuePair.NAME_PROPERTY).accept(this);
- this.result.append('=');
- getChildNode(node, MemberValuePair.VALUE_PROPERTY).accept(this);
- return false;
- }
- /*
* @see ASTVisitor#visit(Modifier)
* @since 3.0
*/
@@ -1413,18 +1305,6 @@
}
/*
- * @see ASTVisitor#visit(NormalAnnotation)
- * @since 3.0
- */
- public boolean visit(NormalAnnotation node) {
- this.result.append('@');
- getChildNode(node, NormalAnnotation.TYPE_NAME_PROPERTY).accept(this);
- this.result.append('(');
- visitList(node, NormalAnnotation.VALUES_PROPERTY, ", "); //$NON-NLS-1$
- this.result.append(')');
- return false;
- }
- /*
* @see ASTVisitor#visit(ParameterizedType)
* @since 3.0
*/
@@ -1447,17 +1327,6 @@
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.SingleMemberAnnotation)
- */
- public boolean visit(SingleMemberAnnotation node) {
- this.result.append('@');
- getChildNode(node, SingleMemberAnnotation.TYPE_NAME_PROPERTY).accept(this);
- this.result.append('(');
- getChildNode(node, SingleMemberAnnotation.VALUE_PROPERTY).accept(this);
- this.result.append(')');
- return false;
- }
/* (non-Javadoc)
* @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.TypeParameter)
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/dom/rewrite/ASTRewriteFormatter.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/dom/rewrite/ASTRewriteFormatter.java
index dbd68e7..21eab1f 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/dom/rewrite/ASTRewriteFormatter.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/dom/rewrite/ASTRewriteFormatter.java
@@ -313,11 +313,6 @@
suffix= ";"; //$NON-NLS-1$
code= CodeFormatter.K_STATEMENTS;
break;
- case ASTNode.MEMBER_VALUE_PAIR:
- prefix= "@Author("; //$NON-NLS-1$
- suffix= ") class x {}"; //$NON-NLS-1$
- code= CodeFormatter.K_JAVASCRIPT_UNIT;
- break;
case ASTNode.MODIFIER:
suffix= " class x {}"; //$NON-NLS-1$
code= CodeFormatter.K_JAVASCRIPT_UNIT;
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/DOMFinder.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/DOMFinder.java
index 50e7f01..4570f28 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/DOMFinder.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/DOMFinder.java
@@ -16,17 +16,13 @@
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeMemberDeclaration;
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
import org.eclipse.wst.jsdt.core.dom.Initializer;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.TypeParameter;
@@ -69,18 +65,6 @@
return this.foundNode;
}
- public boolean visit(AnnotationTypeDeclaration node) {
- if (found(node, node.getName()) && this.resolveBinding)
- this.foundBinding = node.resolveBinding();
- return true;
- }
-
- public boolean visit(AnnotationTypeMemberDeclaration node) {
- if (found(node, node.getName()) && this.resolveBinding)
- this.foundBinding = node.resolveBinding();
- return true;
- }
-
public boolean visit(AnonymousClassDeclaration node) {
ASTNode name;
ASTNode parent = node.getParent();
@@ -88,9 +72,6 @@
case ASTNode.CLASS_INSTANCE_CREATION:
name = ((ClassInstanceCreation) parent).getType();
break;
- case ASTNode.ENUM_CONSTANT_DECLARATION:
- name = ((EnumConstantDeclaration) parent).getName();
- break;
default:
return true;
}
@@ -99,18 +80,6 @@
return true;
}
- public boolean visit(EnumConstantDeclaration node) {
- if (found(node, node.getName()) && this.resolveBinding)
- this.foundBinding = node.resolveVariable();
- return true;
- }
-
- public boolean visit(EnumDeclaration node) {
- if (found(node, node.getName()) && this.resolveBinding)
- this.foundBinding = node.resolveBinding();
- return true;
- }
-
public boolean visit(ImportDeclaration node) {
if (found(node, node) && this.resolveBinding)
this.foundBinding = node.resolveBinding();
diff --git a/bundles/org.eclipse.wst.jsdt.ui/plugin.xml b/bundles/org.eclipse.wst.jsdt.ui/plugin.xml
index db7e723..f5dc683 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/plugin.xml
+++ b/bundles/org.eclipse.wst.jsdt.ui/plugin.xml
@@ -1801,6 +1801,7 @@
class="org.eclipse.wst.jsdt.internal.ui.compare.JavaStructureCreator"
id="org.eclipse.wst.jsdt.internal.ui.compare.JavaStructureCreator">
</structureCreator>
+<!--
<structureCreator
class="org.eclipse.wst.jsdt.internal.ui.compare.PropertiesStructureCreator"
id="org.eclipse.wst.jsdt.internal.ui.compare.PropertiesStructureCreator">
@@ -1809,6 +1810,7 @@
contentTypeId="org.eclipse.wst.jsdt.core.javaProperties"
structureCreatorId="org.eclipse.wst.jsdt.internal.ui.compare.PropertiesStructureCreator">
</contentTypeBinding>
+-->
</extension>
<extension
point="org.eclipse.compare.contentViewers">
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/AddCustomConstructorOperation.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/AddCustomConstructorOperation.java
index 9b12f1b..b692c5e 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/AddCustomConstructorOperation.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/AddCustomConstructorOperation.java
@@ -29,24 +29,19 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.text.edits.TextEdit;
-import org.eclipse.wst.jsdt.core.Flags;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IField;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IMember;
import org.eclipse.wst.jsdt.core.IFunction;
-import org.eclipse.wst.jsdt.core.ISourceReference;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IType;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.rewrite.ListRewrite;
import org.eclipse.wst.jsdt.internal.corext.dom.ASTNodes;
import org.eclipse.wst.jsdt.internal.corext.dom.NodeFinder;
@@ -180,17 +175,6 @@
ListRewrite rewriter= null;
if (fType.isAnonymous()) {
final IJavaScriptElement parent= fType.getParent();
- if (parent instanceof IField && Flags.isEnum(((IMember) parent).getFlags())) {
- final EnumConstantDeclaration constant= (EnumConstantDeclaration) NodeFinder.perform(rewrite.getRoot(), ((ISourceReference) parent).getSourceRange());
- if (constant != null) {
- final AnonymousClassDeclaration declaration= constant.getAnonymousClassDeclaration();
- if (declaration != null) {
- binding= declaration.resolveBinding();
- if (binding != null)
- rewriter= rewrite.getASTRewrite().getListRewrite(declaration, AnonymousClassDeclaration.BODY_DECLARATIONS_PROPERTY);
- }
- }
- } else {
final ClassInstanceCreation creation= (ClassInstanceCreation) ASTNodes.getParent(NodeFinder.perform(rewrite.getRoot(), fType.getNameRange()), ClassInstanceCreation.class);
if (creation != null) {
binding= creation.resolveTypeBinding();
@@ -198,7 +182,6 @@
if (declaration != null)
rewriter= rewrite.getASTRewrite().getListRewrite(declaration, AnonymousClassDeclaration.BODY_DECLARATIONS_PROPERTY);
}
- }
} else {
final AbstractTypeDeclaration declaration= (AbstractTypeDeclaration) ASTNodes.getParent(NodeFinder.perform(rewrite.getRoot(), fType.getNameRange()), AbstractTypeDeclaration.class);
if (declaration != null) {
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/AddDelegateMethodsOperation.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/AddDelegateMethodsOperation.java
index 934fdc6..990fa7c 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/AddDelegateMethodsOperation.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/AddDelegateMethodsOperation.java
@@ -28,23 +28,18 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.text.edits.TextEdit;
-import org.eclipse.wst.jsdt.core.Flags;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IField;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IMember;
import org.eclipse.wst.jsdt.core.IFunction;
-import org.eclipse.wst.jsdt.core.ISourceReference;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IType;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.rewrite.ListRewrite;
import org.eclipse.wst.jsdt.internal.corext.dom.ASTNodes;
import org.eclipse.wst.jsdt.internal.corext.dom.NodeFinder;
@@ -166,17 +161,6 @@
ListRewrite rewriter= null;
if (fType.isAnonymous()) {
final IJavaScriptElement parent= fType.getParent();
- if (parent instanceof IField && Flags.isEnum(((IMember) parent).getFlags())) {
- final EnumConstantDeclaration constant= (EnumConstantDeclaration) NodeFinder.perform(rewrite.getRoot(), ((ISourceReference) parent).getSourceRange());
- if (constant != null) {
- final AnonymousClassDeclaration declaration= constant.getAnonymousClassDeclaration();
- if (declaration != null) {
- binding= declaration.resolveBinding();
- if (binding != null)
- rewriter= rewrite.getASTRewrite().getListRewrite(declaration, AnonymousClassDeclaration.BODY_DECLARATIONS_PROPERTY);
- }
- }
- } else {
final ClassInstanceCreation creation= (ClassInstanceCreation) ASTNodes.getParent(NodeFinder.perform(rewrite.getRoot(), fType.getNameRange()), ClassInstanceCreation.class);
if (creation != null) {
binding= creation.resolveTypeBinding();
@@ -184,7 +168,6 @@
if (declaration != null)
rewriter= rewrite.getASTRewrite().getListRewrite(declaration, AnonymousClassDeclaration.BODY_DECLARATIONS_PROPERTY);
}
- }
} else {
final AbstractTypeDeclaration declaration= (AbstractTypeDeclaration) ASTNodes.getParent(NodeFinder.perform(rewrite.getRoot(), fType.getNameRange()), AbstractTypeDeclaration.class);
if (declaration != null) {
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/AddImportsOperation.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/AddImportsOperation.java
index b858956..9f388ad 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/AddImportsOperation.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/AddImportsOperation.java
@@ -28,19 +28,17 @@
import org.eclipse.text.edits.TextEdit;
import org.eclipse.wst.jsdt.core.Flags;
import org.eclipse.wst.jsdt.core.IBuffer;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.Signature;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.Annotation;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
-import org.eclipse.wst.jsdt.core.dom.MarkerAnnotation;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.Modifier;
import org.eclipse.wst.jsdt.core.dom.Name;
import org.eclipse.wst.jsdt.core.dom.QualifiedName;
@@ -163,9 +161,7 @@
SimpleName nameNode= null;
if (root != null) { // got an AST
ASTNode node= NodeFinder.perform(root, offset, length);
- if (node instanceof MarkerAnnotation) {
- node= ((Annotation) node).getTypeName();
- }
+
if (node instanceof QualifiedName) {
nameNode= ((QualifiedName) node).getName();
} else if (node instanceof SimpleName) {
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/ImportReferencesCollector.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/ImportReferencesCollector.java
index a449485..3227177 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/ImportReferencesCollector.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/ImportReferencesCollector.java
@@ -20,28 +20,25 @@
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ArrayType;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.Expression;
import org.eclipse.wst.jsdt.core.dom.FieldAccess;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
+import org.eclipse.wst.jsdt.core.dom.FunctionRef;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
-import org.eclipse.wst.jsdt.core.dom.MarkerAnnotation;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.MemberRef;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
-import org.eclipse.wst.jsdt.core.dom.FunctionRef;
import org.eclipse.wst.jsdt.core.dom.Modifier;
import org.eclipse.wst.jsdt.core.dom.Name;
-import org.eclipse.wst.jsdt.core.dom.NormalAnnotation;
import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
import org.eclipse.wst.jsdt.core.dom.QualifiedName;
import org.eclipse.wst.jsdt.core.dom.QualifiedType;
import org.eclipse.wst.jsdt.core.dom.SimpleName;
import org.eclipse.wst.jsdt.core.dom.SimpleType;
-import org.eclipse.wst.jsdt.core.dom.SingleMemberAnnotation;
import org.eclipse.wst.jsdt.core.dom.SuperConstructorInvocation;
import org.eclipse.wst.jsdt.core.dom.TagElement;
import org.eclipse.wst.jsdt.core.dom.ThisExpression;
@@ -317,31 +314,7 @@
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.internal.corext.dom.GenericVisitor#visit(org.eclipse.wst.jsdt.core.dom.MarkerAnnotation)
- */
- public boolean visit(MarkerAnnotation node) {
- typeRefFound(node.getTypeName());
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.internal.corext.dom.GenericVisitor#visit(org.eclipse.wst.jsdt.core.dom.MarkerAnnotation)
- */
- public boolean visit(NormalAnnotation node) {
- typeRefFound(node.getTypeName());
- doVisitChildren(node.values());
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.internal.corext.dom.GenericVisitor#visit(org.eclipse.wst.jsdt.core.dom.MarkerAnnotation)
- */
- public boolean visit(SingleMemberAnnotation node) {
- typeRefFound(node.getTypeName());
- doVisitNode(node.getValue());
- return false;
- }
+
/*
* @see ASTVisitor#visit(TypeDeclaration)
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/SortMembersOperation.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/SortMembersOperation.java
index 073d14b..bc4d476 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/SortMembersOperation.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/SortMembersOperation.java
@@ -22,12 +22,10 @@
import org.eclipse.wst.jsdt.core.dom.AST;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeMemberDeclaration;
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
-import org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
-import org.eclipse.wst.jsdt.core.dom.Initializer;
import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.Initializer;
import org.eclipse.wst.jsdt.core.dom.Modifier;
import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
import org.eclipse.wst.jsdt.core.dom.Type;
@@ -95,13 +93,7 @@
return getMemberCategory(MembersOrderPreferenceCache.INIT_INDEX);
}
case ASTNode.TYPE_DECLARATION :
- case ASTNode.ENUM_DECLARATION :
- case ASTNode.ANNOTATION_TYPE_DECLARATION :
return getMemberCategory(MembersOrderPreferenceCache.TYPE_INDEX);
- case ASTNode.ENUM_CONSTANT_DECLARATION :
- return getMemberCategory(MembersOrderPreferenceCache.ENUM_CONSTANTS_INDEX);
- case ASTNode.ANNOTATION_TYPE_MEMBER_DECLARATION:
- return getMemberCategory(MembersOrderPreferenceCache.METHOD_INDEX); // reusing the method index
}
return 0; // should never happen
@@ -198,8 +190,6 @@
return preserveRelativeOrder(bodyDeclaration1, bodyDeclaration2);
}
case ASTNode.TYPE_DECLARATION :
- case ASTNode.ENUM_DECLARATION :
- case ASTNode.ANNOTATION_TYPE_DECLARATION :
{
AbstractTypeDeclaration type1= (AbstractTypeDeclaration) bodyDeclaration1;
AbstractTypeDeclaration type2= (AbstractTypeDeclaration) bodyDeclaration2;
@@ -210,32 +200,6 @@
// typedeclarations are sorted by name
return compareNames(bodyDeclaration1, bodyDeclaration2, name1, name2);
}
- case ASTNode.ENUM_CONSTANT_DECLARATION :
- {
- if (!fDoNotSortFields) {
- EnumConstantDeclaration decl1= (EnumConstantDeclaration) bodyDeclaration1;
- EnumConstantDeclaration decl2= (EnumConstantDeclaration) bodyDeclaration2;
-
- String name1= decl1.getName().getIdentifier();
- String name2= decl2.getName().getIdentifier();
-
- // enum constants declarations are sorted by name
- return compareNames(bodyDeclaration1, bodyDeclaration2, name1, name2);
- } else {
- return preserveRelativeOrder(bodyDeclaration1, bodyDeclaration2);
- }
- }
- case ASTNode.ANNOTATION_TYPE_MEMBER_DECLARATION :
- {
- AnnotationTypeMemberDeclaration decl1= (AnnotationTypeMemberDeclaration) bodyDeclaration1;
- AnnotationTypeMemberDeclaration decl2= (AnnotationTypeMemberDeclaration) bodyDeclaration2;
-
- String name1= decl1.getName().getIdentifier();
- String name2= decl2.getName().getIdentifier();
-
- // enum constants declarations are sorted by name
- return compareNames(bodyDeclaration1, bodyDeclaration2, name1, name2);
- }
}
return 0;
}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/StubUtility2.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/StubUtility2.java
index 5613e3b..2316687 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/StubUtility2.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/codemanipulation/StubUtility2.java
@@ -25,19 +25,18 @@
import org.eclipse.wst.jsdt.core.NamingConventions;
import org.eclipse.wst.jsdt.core.dom.AST;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.Annotation;
import org.eclipse.wst.jsdt.core.dom.Assignment;
import org.eclipse.wst.jsdt.core.dom.Block;
import org.eclipse.wst.jsdt.core.dom.Expression;
import org.eclipse.wst.jsdt.core.dom.FieldAccess;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.IPackageBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
import org.eclipse.wst.jsdt.core.dom.JSdoc;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
import org.eclipse.wst.jsdt.core.dom.Modifier;
import org.eclipse.wst.jsdt.core.dom.ParameterizedType;
import org.eclipse.wst.jsdt.core.dom.PrimitiveType;
@@ -69,11 +68,6 @@
public static void addOverrideAnnotation(ASTRewrite rewrite, FunctionDeclaration decl, IFunctionBinding binding) {
String version= binding.getJavaElement().getJavaScriptProject().getOption(JavaScriptCore.COMPILER_COMPLIANCE, true);
- if (!binding.getDeclaringClass().isInterface() || !JavaModelUtil.isVersionLessThan(version, JavaScriptCore.VERSION_1_6)) {
- final Annotation marker= rewrite.getAST().newMarkerAnnotation();
- marker.setTypeName(rewrite.getAST().newSimpleName("Override")); //$NON-NLS-1$
- rewrite.getListRewrite(decl, FunctionDeclaration.MODIFIERS2_PROPERTY).insertFirst(marker, null);
- }
}
public static FunctionDeclaration createConstructorStub(IJavaScriptUnit unit, ASTRewrite rewrite, ImportRewrite imports, IFunctionBinding binding, String type, int modifiers, boolean omitSuperForDefConst, boolean todo, CodeGenerationSettings settings) throws CoreException {
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/ASTFlattener.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/ASTFlattener.java
index 0b7952d..9d166a1 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/ASTFlattener.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/ASTFlattener.java
@@ -14,7 +14,96 @@
import java.util.List;
import org.eclipse.core.runtime.Assert;
-import org.eclipse.wst.jsdt.core.dom.*;
+import org.eclipse.wst.jsdt.core.dom.AST;
+import org.eclipse.wst.jsdt.core.dom.ASTNode;
+import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
+import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
+import org.eclipse.wst.jsdt.core.dom.ArrayAccess;
+import org.eclipse.wst.jsdt.core.dom.ArrayCreation;
+import org.eclipse.wst.jsdt.core.dom.ArrayInitializer;
+import org.eclipse.wst.jsdt.core.dom.ArrayType;
+import org.eclipse.wst.jsdt.core.dom.AssertStatement;
+import org.eclipse.wst.jsdt.core.dom.Assignment;
+import org.eclipse.wst.jsdt.core.dom.Block;
+import org.eclipse.wst.jsdt.core.dom.BlockComment;
+import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
+import org.eclipse.wst.jsdt.core.dom.BooleanLiteral;
+import org.eclipse.wst.jsdt.core.dom.BreakStatement;
+import org.eclipse.wst.jsdt.core.dom.CastExpression;
+import org.eclipse.wst.jsdt.core.dom.CatchClause;
+import org.eclipse.wst.jsdt.core.dom.CharacterLiteral;
+import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
+import org.eclipse.wst.jsdt.core.dom.ConditionalExpression;
+import org.eclipse.wst.jsdt.core.dom.ConstructorInvocation;
+import org.eclipse.wst.jsdt.core.dom.ContinueStatement;
+import org.eclipse.wst.jsdt.core.dom.DoStatement;
+import org.eclipse.wst.jsdt.core.dom.EmptyStatement;
+import org.eclipse.wst.jsdt.core.dom.EnhancedForStatement;
+import org.eclipse.wst.jsdt.core.dom.Expression;
+import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
+import org.eclipse.wst.jsdt.core.dom.FieldAccess;
+import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
+import org.eclipse.wst.jsdt.core.dom.ForInStatement;
+import org.eclipse.wst.jsdt.core.dom.ForStatement;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionExpression;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
+import org.eclipse.wst.jsdt.core.dom.FunctionRef;
+import org.eclipse.wst.jsdt.core.dom.FunctionRefParameter;
+import org.eclipse.wst.jsdt.core.dom.IfStatement;
+import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
+import org.eclipse.wst.jsdt.core.dom.InfixExpression;
+import org.eclipse.wst.jsdt.core.dom.Initializer;
+import org.eclipse.wst.jsdt.core.dom.InstanceofExpression;
+import org.eclipse.wst.jsdt.core.dom.JSdoc;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
+import org.eclipse.wst.jsdt.core.dom.LabeledStatement;
+import org.eclipse.wst.jsdt.core.dom.LineComment;
+import org.eclipse.wst.jsdt.core.dom.ListExpression;
+import org.eclipse.wst.jsdt.core.dom.MemberRef;
+import org.eclipse.wst.jsdt.core.dom.Modifier;
+import org.eclipse.wst.jsdt.core.dom.Name;
+import org.eclipse.wst.jsdt.core.dom.NullLiteral;
+import org.eclipse.wst.jsdt.core.dom.NumberLiteral;
+import org.eclipse.wst.jsdt.core.dom.ObjectLiteral;
+import org.eclipse.wst.jsdt.core.dom.ObjectLiteralField;
+import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
+import org.eclipse.wst.jsdt.core.dom.ParameterizedType;
+import org.eclipse.wst.jsdt.core.dom.ParenthesizedExpression;
+import org.eclipse.wst.jsdt.core.dom.PostfixExpression;
+import org.eclipse.wst.jsdt.core.dom.PrefixExpression;
+import org.eclipse.wst.jsdt.core.dom.PrimitiveType;
+import org.eclipse.wst.jsdt.core.dom.QualifiedName;
+import org.eclipse.wst.jsdt.core.dom.QualifiedType;
+import org.eclipse.wst.jsdt.core.dom.RegularExpressionLiteral;
+import org.eclipse.wst.jsdt.core.dom.ReturnStatement;
+import org.eclipse.wst.jsdt.core.dom.SimpleName;
+import org.eclipse.wst.jsdt.core.dom.SimpleType;
+import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
+import org.eclipse.wst.jsdt.core.dom.Statement;
+import org.eclipse.wst.jsdt.core.dom.StringLiteral;
+import org.eclipse.wst.jsdt.core.dom.SuperConstructorInvocation;
+import org.eclipse.wst.jsdt.core.dom.SuperFieldAccess;
+import org.eclipse.wst.jsdt.core.dom.SuperMethodInvocation;
+import org.eclipse.wst.jsdt.core.dom.SwitchCase;
+import org.eclipse.wst.jsdt.core.dom.SwitchStatement;
+import org.eclipse.wst.jsdt.core.dom.TagElement;
+import org.eclipse.wst.jsdt.core.dom.TextElement;
+import org.eclipse.wst.jsdt.core.dom.ThisExpression;
+import org.eclipse.wst.jsdt.core.dom.ThrowStatement;
+import org.eclipse.wst.jsdt.core.dom.TryStatement;
+import org.eclipse.wst.jsdt.core.dom.Type;
+import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
+import org.eclipse.wst.jsdt.core.dom.TypeDeclarationStatement;
+import org.eclipse.wst.jsdt.core.dom.TypeLiteral;
+import org.eclipse.wst.jsdt.core.dom.TypeParameter;
+import org.eclipse.wst.jsdt.core.dom.UndefinedLiteral;
+import org.eclipse.wst.jsdt.core.dom.VariableDeclarationExpression;
+import org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment;
+import org.eclipse.wst.jsdt.core.dom.VariableDeclarationStatement;
+import org.eclipse.wst.jsdt.core.dom.WhileStatement;
+import org.eclipse.wst.jsdt.core.dom.WildcardType;
+import org.eclipse.wst.jsdt.core.dom.WithStatement;
/**
*
@@ -124,47 +213,6 @@
}
/*
- * @see ASTVisitor#visit(AnnotationTypeDeclaration)
- * @since 3.0
- */
- public boolean visit(AnnotationTypeDeclaration node) {
- if (node.getJavadoc() != null) {
- node.getJavadoc().accept(this);
- }
- printModifiers(node.modifiers());
- this.fBuffer.append("@interface ");//$NON-NLS-1$
- node.getName().accept(this);
- this.fBuffer.append(" {");//$NON-NLS-1$
- for (Iterator it= node.bodyDeclarations().iterator(); it.hasNext();) {
- BodyDeclaration d= (BodyDeclaration) it.next();
- d.accept(this);
- }
- this.fBuffer.append("}");//$NON-NLS-1$
- return false;
- }
-
- /*
- * @see ASTVisitor#visit(AnnotationTypeMemberDeclaration)
- * @since 3.0
- */
- public boolean visit(AnnotationTypeMemberDeclaration node) {
- if (node.getJavadoc() != null) {
- node.getJavadoc().accept(this);
- }
- printModifiers(node.modifiers());
- node.getType().accept(this);
- this.fBuffer.append(" ");//$NON-NLS-1$
- node.getName().accept(this);
- this.fBuffer.append("()");//$NON-NLS-1$
- if (node.getDefault() != null) {
- this.fBuffer.append(" default ");//$NON-NLS-1$
- node.getDefault().accept(this);
- }
- this.fBuffer.append(";");//$NON-NLS-1$
- return false;
- }
-
- /*
* @see ASTVisitor#visit(AnonymousClassDeclaration)
*/
public boolean visit(AnonymousClassDeclaration node) {
@@ -518,77 +566,6 @@
return false;
}
- /*
- * @see ASTVisitor#visit(EnumConstantDeclaration)
- * @since 3.0
- */
- public boolean visit(EnumConstantDeclaration node) {
- if (node.getJavadoc() != null) {
- node.getJavadoc().accept(this);
- }
- printModifiers(node.modifiers());
- node.getName().accept(this);
- if (!node.arguments().isEmpty()) {
- this.fBuffer.append("(");//$NON-NLS-1$
- for (Iterator it= node.arguments().iterator(); it.hasNext();) {
- Expression e= (Expression) it.next();
- e.accept(this);
- if (it.hasNext()) {
- this.fBuffer.append(",");//$NON-NLS-1$
- }
- }
- this.fBuffer.append(")");//$NON-NLS-1$
- }
- if (node.getAnonymousClassDeclaration() != null) {
- node.getAnonymousClassDeclaration().accept(this);
- }
- return false;
- }
-
- /*
- * @see ASTVisitor#visit(EnumDeclaration)
- * @since 3.0
- */
- public boolean visit(EnumDeclaration node) {
- if (node.getJavadoc() != null) {
- node.getJavadoc().accept(this);
- }
- printModifiers(node.modifiers());
- this.fBuffer.append("enum ");//$NON-NLS-1$
- node.getName().accept(this);
- this.fBuffer.append(" ");//$NON-NLS-1$
- if (!node.superInterfaceTypes().isEmpty()) {
- this.fBuffer.append("implements ");//$NON-NLS-1$
- for (Iterator it= node.superInterfaceTypes().iterator(); it.hasNext();) {
- Type t= (Type) it.next();
- t.accept(this);
- if (it.hasNext()) {
- this.fBuffer.append(", ");//$NON-NLS-1$
- }
- }
- this.fBuffer.append(" ");//$NON-NLS-1$
- }
- this.fBuffer.append("{");//$NON-NLS-1$
- for (Iterator it = node.enumConstants().iterator(); it.hasNext(); ) {
- EnumConstantDeclaration d = (EnumConstantDeclaration) it.next();
- d.accept(this);
- // enum constant declarations do not include punctuation
- if (it.hasNext()) {
- // enum constant declarations are separated by commas
- this.fBuffer.append(", ");//$NON-NLS-1$
- }
- }
- if (!node.bodyDeclarations().isEmpty()) {
- this.fBuffer.append("; ");//$NON-NLS-1$
- for (Iterator it = node.bodyDeclarations().iterator(); it.hasNext(); ) {
- BodyDeclaration d = (BodyDeclaration) it.next();
- d.accept(this);
- // other body declarations include trailing punctuation
- }
- }
- this.fBuffer.append("}");//$NON-NLS-1$
- return false;
- }
/*
* @see ASTVisitor#visit(ExpressionStatement)
@@ -799,15 +776,6 @@
return false;
}
- /*
- * @see ASTVisitor#visit(MarkerAnnotation)
- * @since 3.0
- */
- public boolean visit(MarkerAnnotation node) {
- this.fBuffer.append("@");//$NON-NLS-1$
- node.getTypeName().accept(this);
- return false;
- }
/*
* @see ASTVisitor#visit(MemberRef)
@@ -822,16 +790,6 @@
return false;
}
- /*
- * @see ASTVisitor#visit(MemberValuePair)
- * @since 3.0
- */
- public boolean visit(MemberValuePair node) {
- node.getName().accept(this);
- this.fBuffer.append("=");//$NON-NLS-1$
- node.getValue().accept(this);
- return false;
- }
/*
* @see ASTVisitor#visit(FunctionRef)
@@ -988,24 +946,6 @@
return false;
}
- /*
- * @see ASTVisitor#visit(NormalAnnotation)
- * @since 3.0
- */
- public boolean visit(NormalAnnotation node) {
- this.fBuffer.append("@");//$NON-NLS-1$
- node.getTypeName().accept(this);
- this.fBuffer.append("(");//$NON-NLS-1$
- for (Iterator it= node.values().iterator(); it.hasNext();) {
- MemberValuePair p= (MemberValuePair) it.next();
- p.accept(this);
- if (it.hasNext()) {
- this.fBuffer.append(",");//$NON-NLS-1$
- }
- }
- this.fBuffer.append(")");//$NON-NLS-1$
- return false;
- }
/*
* @see ASTVisitor#visit(NullLiteral)
@@ -1036,11 +976,6 @@
if (node.getJavadoc() != null) {
node.getJavadoc().accept(this);
}
- for (Iterator it= node.annotations().iterator(); it.hasNext();) {
- Annotation p= (Annotation) it.next();
- p.accept(this);
- this.fBuffer.append(" ");//$NON-NLS-1$
- }
}
this.fBuffer.append("package ");//$NON-NLS-1$
node.getName().accept(this);
@@ -1152,19 +1087,6 @@
}
/*
- * @see ASTVisitor#visit(SingleMemberAnnotation)
- * @since 3.0
- */
- public boolean visit(SingleMemberAnnotation node) {
- this.fBuffer.append("@");//$NON-NLS-1$
- node.getTypeName().accept(this);
- this.fBuffer.append("(");//$NON-NLS-1$
- node.getValue().accept(this);
- this.fBuffer.append(")");//$NON-NLS-1$
- return false;
- }
-
- /*
* @see ASTVisitor#visit(SingleVariableDeclaration)
*/
public boolean visit(SingleVariableDeclaration node) {
@@ -1470,17 +1392,6 @@
BodyDeclaration prev= null;
for (Iterator it= node.bodyDeclarations().iterator(); it.hasNext();) {
BodyDeclaration d= (BodyDeclaration) it.next();
- if (prev instanceof EnumConstantDeclaration) {
- // enum constant declarations do not include punctuation
- if (d instanceof EnumConstantDeclaration) {
- // enum constant declarations are separated by commas
- this.fBuffer.append(", ");//$NON-NLS-1$
- } else {
- // semicolon separates last enum constant declaration from
- // first class body declarations
- this.fBuffer.append("; ");//$NON-NLS-1$
- }
- }
d.accept(this);
}
this.fBuffer.append("}");//$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/ASTNodes.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/ASTNodes.java
index 2ec52a1..755aec6 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/ASTNodes.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/ASTNodes.java
@@ -22,11 +22,7 @@
import org.eclipse.core.runtime.Assert;
import org.eclipse.text.edits.TextEdit;
-import org.eclipse.wst.jsdt.core.Flags;
-import org.eclipse.wst.jsdt.core.IField;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IMember;
-import org.eclipse.wst.jsdt.core.ISourceReference;
import org.eclipse.wst.jsdt.core.IType;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.compiler.IProblem;
@@ -39,23 +35,22 @@
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
import org.eclipse.wst.jsdt.core.dom.ChildListPropertyDescriptor;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.DoStatement;
import org.eclipse.wst.jsdt.core.dom.EnhancedForStatement;
-import org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration;
import org.eclipse.wst.jsdt.core.dom.Expression;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
import org.eclipse.wst.jsdt.core.dom.ForInStatement;
import org.eclipse.wst.jsdt.core.dom.ForStatement;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
import org.eclipse.wst.jsdt.core.dom.IfStatement;
import org.eclipse.wst.jsdt.core.dom.InfixExpression;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.Message;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
import org.eclipse.wst.jsdt.core.dom.Modifier;
import org.eclipse.wst.jsdt.core.dom.Name;
import org.eclipse.wst.jsdt.core.dom.ParameterizedType;
@@ -631,8 +626,6 @@
switch (memberType) {
case ASTNode.TYPE_DECLARATION:
- case ASTNode.ENUM_DECLARATION :
- case ASTNode.ANNOTATION_TYPE_DECLARATION :
return store.getCategoryIndex(MembersOrderPreferenceCache.TYPE_INDEX) * 2;
case ASTNode.FIELD_DECLARATION:
if (Modifier.isStatic(modifiers)) {
@@ -648,8 +641,6 @@
return store.getCategoryIndex(MembersOrderPreferenceCache.STATIC_INIT_INDEX) * 2;
}
return store.getCategoryIndex(MembersOrderPreferenceCache.INIT_INDEX) * 2;
- case ASTNode.ANNOTATION_TYPE_MEMBER_DECLARATION:
- return store.getCategoryIndex(MembersOrderPreferenceCache.METHOD_INDEX) * 2;
case ASTNode.FUNCTION_DECLARATION:
if (Modifier.isStatic(modifiers)) {
return store.getCategoryIndex(MembersOrderPreferenceCache.STATIC_METHODS_INDEX) * 2;
@@ -808,18 +799,9 @@
public static ITypeBinding getTypeBinding(JavaScriptUnit root, IType type) throws JavaScriptModelException {
if (type.isAnonymous()) {
final IJavaScriptElement parent= type.getParent();
- if (parent instanceof IField && Flags.isEnum(((IMember) parent).getFlags())) {
- final EnumConstantDeclaration constant= (EnumConstantDeclaration) NodeFinder.perform(root, ((ISourceReference) parent).getSourceRange());
- if (constant != null) {
- final AnonymousClassDeclaration declaration= constant.getAnonymousClassDeclaration();
- if (declaration != null)
- return declaration.resolveBinding();
- }
- } else {
final ClassInstanceCreation creation= (ClassInstanceCreation) getParent(NodeFinder.perform(root, type.getNameRange()), ClassInstanceCreation.class);
if (creation != null)
return creation.resolveTypeBinding();
- }
} else {
final AbstractTypeDeclaration declaration= (AbstractTypeDeclaration) getParent(NodeFinder.perform(root, type.getNameRange()), AbstractTypeDeclaration.class);
if (declaration != null)
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/Bindings.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/Bindings.java
index f392c01..881b792 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/Bindings.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/Bindings.java
@@ -20,10 +20,10 @@
import java.util.Set;
import org.eclipse.core.runtime.Assert;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
+import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IFunction;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IType;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.Signature;
@@ -32,8 +32,6 @@
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.wst.jsdt.core.dom.Assignment;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.Expression;
import org.eclipse.wst.jsdt.core.dom.FieldAccess;
import org.eclipse.wst.jsdt.core.dom.IBinding;
@@ -41,6 +39,7 @@
import org.eclipse.wst.jsdt.core.dom.IPackageBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.Modifier;
import org.eclipse.wst.jsdt.core.dom.QualifiedName;
import org.eclipse.wst.jsdt.core.dom.SimpleName;
@@ -1022,8 +1021,6 @@
AbstractTypeDeclaration decl= (AbstractTypeDeclaration) node;
if (lastLocation == decl.getBodyDeclarationsProperty()) {
return decl.resolveBinding();
- } else if (decl instanceof EnumDeclaration && lastLocation == EnumDeclaration.ENUM_CONSTANTS_PROPERTY) {
- return decl.resolveBinding();
}
} else if (node instanceof AnonymousClassDeclaration) {
return ((AnonymousClassDeclaration) node).resolveBinding();
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/GenericVisitor.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/GenericVisitor.java
index 4be10ca..23c1060 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/GenericVisitor.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/GenericVisitor.java
@@ -12,8 +12,6 @@
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeMemberDeclaration;
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.wst.jsdt.core.dom.ArrayAccess;
import org.eclipse.wst.jsdt.core.dom.ArrayCreation;
@@ -29,39 +27,34 @@
import org.eclipse.wst.jsdt.core.dom.CatchClause;
import org.eclipse.wst.jsdt.core.dom.CharacterLiteral;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.ConditionalExpression;
import org.eclipse.wst.jsdt.core.dom.ConstructorInvocation;
import org.eclipse.wst.jsdt.core.dom.ContinueStatement;
import org.eclipse.wst.jsdt.core.dom.DoStatement;
import org.eclipse.wst.jsdt.core.dom.EmptyStatement;
import org.eclipse.wst.jsdt.core.dom.EnhancedForStatement;
-import org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
import org.eclipse.wst.jsdt.core.dom.FieldAccess;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
import org.eclipse.wst.jsdt.core.dom.ForInStatement;
import org.eclipse.wst.jsdt.core.dom.ForStatement;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.FunctionExpression;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
+import org.eclipse.wst.jsdt.core.dom.FunctionRef;
+import org.eclipse.wst.jsdt.core.dom.FunctionRefParameter;
import org.eclipse.wst.jsdt.core.dom.IfStatement;
import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
import org.eclipse.wst.jsdt.core.dom.InfixExpression;
import org.eclipse.wst.jsdt.core.dom.Initializer;
import org.eclipse.wst.jsdt.core.dom.InstanceofExpression;
import org.eclipse.wst.jsdt.core.dom.JSdoc;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.LabeledStatement;
import org.eclipse.wst.jsdt.core.dom.LineComment;
import org.eclipse.wst.jsdt.core.dom.ListExpression;
-import org.eclipse.wst.jsdt.core.dom.MarkerAnnotation;
import org.eclipse.wst.jsdt.core.dom.MemberRef;
-import org.eclipse.wst.jsdt.core.dom.MemberValuePair;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
-import org.eclipse.wst.jsdt.core.dom.FunctionRef;
-import org.eclipse.wst.jsdt.core.dom.FunctionRefParameter;
import org.eclipse.wst.jsdt.core.dom.Modifier;
-import org.eclipse.wst.jsdt.core.dom.NormalAnnotation;
import org.eclipse.wst.jsdt.core.dom.NullLiteral;
import org.eclipse.wst.jsdt.core.dom.NumberLiteral;
import org.eclipse.wst.jsdt.core.dom.ObjectLiteral;
@@ -78,7 +71,6 @@
import org.eclipse.wst.jsdt.core.dom.ReturnStatement;
import org.eclipse.wst.jsdt.core.dom.SimpleName;
import org.eclipse.wst.jsdt.core.dom.SimpleType;
-import org.eclipse.wst.jsdt.core.dom.SingleMemberAnnotation;
import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
import org.eclipse.wst.jsdt.core.dom.StringLiteral;
import org.eclipse.wst.jsdt.core.dom.SuperConstructorInvocation;
@@ -349,18 +341,6 @@
}
/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration)
- */
- public boolean visit(AnnotationTypeDeclaration node) {
- return visitNode(node);
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.AnnotationTypeMemberDeclaration)
- */
- public boolean visit(AnnotationTypeMemberDeclaration node) {
- return visitNode(node);
- }
- /* (non-Javadoc)
* @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.BlockComment)
*/
public boolean visit(BlockComment node) {
@@ -373,42 +353,18 @@
return visitNode(node);
}
/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration)
- */
- public boolean visit(EnumConstantDeclaration node) {
- return visitNode(node);
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.EnumDeclaration)
- */
- public boolean visit(EnumDeclaration node) {
- return visitNode(node);
- }
- /* (non-Javadoc)
* @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.LineComment)
*/
public boolean visit(LineComment node) {
return visitNode(node);
}
/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.MarkerAnnotation)
- */
- public boolean visit(MarkerAnnotation node) {
- return visitNode(node);
- }
- /* (non-Javadoc)
* @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.MemberRef)
*/
public boolean visit(MemberRef node) {
return visitNode(node);
}
/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.MemberValuePair)
- */
- public boolean visit(MemberValuePair node) {
- return visitNode(node);
- }
- /* (non-Javadoc)
* @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.FunctionRef)
*/
public boolean visit(FunctionRef node) {
@@ -427,12 +383,6 @@
return visitNode(node);
}
/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.NormalAnnotation)
- */
- public boolean visit(NormalAnnotation node) {
- return visitNode(node);
- }
- /* (non-Javadoc)
* @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.ParameterizedType)
*/
public boolean visit(ParameterizedType node) {
@@ -445,12 +395,6 @@
return visitNode(node);
}
/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.SingleMemberAnnotation)
- */
- public boolean visit(SingleMemberAnnotation node) {
- return visitNode(node);
- }
- /* (non-Javadoc)
* @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.TagElement)
*/
public boolean visit(TagElement node) {
@@ -688,18 +632,6 @@
/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration)
- */
- public void endVisit(AnnotationTypeDeclaration node) {
- endVisitNode(node);
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.AnnotationTypeMemberDeclaration)
- */
- public void endVisit(AnnotationTypeMemberDeclaration node) {
- endVisitNode(node);
- }
- /* (non-Javadoc)
* @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.BlockComment)
*/
public void endVisit(BlockComment node) {
@@ -712,42 +644,18 @@
endVisitNode(node);
}
/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration)
- */
- public void endVisit(EnumConstantDeclaration node) {
- endVisitNode(node);
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.EnumDeclaration)
- */
- public void endVisit(EnumDeclaration node) {
- endVisitNode(node);
- }
- /* (non-Javadoc)
* @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.LineComment)
*/
public void endVisit(LineComment node) {
endVisitNode(node);
}
/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.MarkerAnnotation)
- */
- public void endVisit(MarkerAnnotation node) {
- endVisitNode(node);
- }
- /* (non-Javadoc)
* @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.MemberRef)
*/
public void endVisit(MemberRef node) {
endVisitNode(node);
}
/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.MemberValuePair)
- */
- public void endVisit(MemberValuePair node) {
- endVisitNode(node);
- }
- /* (non-Javadoc)
* @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.FunctionRef)
*/
public void endVisit(FunctionRef node) {
@@ -766,12 +674,6 @@
endVisitNode(node);
}
/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.NormalAnnotation)
- */
- public void endVisit(NormalAnnotation node) {
- endVisitNode(node);
- }
- /* (non-Javadoc)
* @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.ParameterizedType)
*/
public void endVisit(ParameterizedType node) {
@@ -784,12 +686,6 @@
endVisitNode(node);
}
/* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.SingleMemberAnnotation)
- */
- public void endVisit(SingleMemberAnnotation node) {
- endVisitNode(node);
- }
- /* (non-Javadoc)
* @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(org.eclipse.wst.jsdt.core.dom.TagElement)
*/
public void endVisit(TagElement node) {
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/HierarchicalASTVisitor.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/HierarchicalASTVisitor.java
index 68c54fc..6bcec87 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/HierarchicalASTVisitor.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/HierarchicalASTVisitor.java
@@ -10,7 +10,98 @@
*******************************************************************************/
package org.eclipse.wst.jsdt.internal.corext.dom;
-import org.eclipse.wst.jsdt.core.dom.*;
+import org.eclipse.wst.jsdt.core.dom.ASTNode;
+import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
+import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
+import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
+import org.eclipse.wst.jsdt.core.dom.ArrayAccess;
+import org.eclipse.wst.jsdt.core.dom.ArrayCreation;
+import org.eclipse.wst.jsdt.core.dom.ArrayInitializer;
+import org.eclipse.wst.jsdt.core.dom.ArrayType;
+import org.eclipse.wst.jsdt.core.dom.AssertStatement;
+import org.eclipse.wst.jsdt.core.dom.Assignment;
+import org.eclipse.wst.jsdt.core.dom.Block;
+import org.eclipse.wst.jsdt.core.dom.BlockComment;
+import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
+import org.eclipse.wst.jsdt.core.dom.BooleanLiteral;
+import org.eclipse.wst.jsdt.core.dom.BreakStatement;
+import org.eclipse.wst.jsdt.core.dom.CastExpression;
+import org.eclipse.wst.jsdt.core.dom.CatchClause;
+import org.eclipse.wst.jsdt.core.dom.CharacterLiteral;
+import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
+import org.eclipse.wst.jsdt.core.dom.Comment;
+import org.eclipse.wst.jsdt.core.dom.ConditionalExpression;
+import org.eclipse.wst.jsdt.core.dom.ConstructorInvocation;
+import org.eclipse.wst.jsdt.core.dom.ContinueStatement;
+import org.eclipse.wst.jsdt.core.dom.DoStatement;
+import org.eclipse.wst.jsdt.core.dom.EmptyStatement;
+import org.eclipse.wst.jsdt.core.dom.EnhancedForStatement;
+import org.eclipse.wst.jsdt.core.dom.Expression;
+import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
+import org.eclipse.wst.jsdt.core.dom.FieldAccess;
+import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
+import org.eclipse.wst.jsdt.core.dom.ForInStatement;
+import org.eclipse.wst.jsdt.core.dom.ForStatement;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionExpression;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
+import org.eclipse.wst.jsdt.core.dom.FunctionRef;
+import org.eclipse.wst.jsdt.core.dom.FunctionRefParameter;
+import org.eclipse.wst.jsdt.core.dom.IfStatement;
+import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
+import org.eclipse.wst.jsdt.core.dom.InfixExpression;
+import org.eclipse.wst.jsdt.core.dom.Initializer;
+import org.eclipse.wst.jsdt.core.dom.InstanceofExpression;
+import org.eclipse.wst.jsdt.core.dom.JSdoc;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
+import org.eclipse.wst.jsdt.core.dom.LabeledStatement;
+import org.eclipse.wst.jsdt.core.dom.LineComment;
+import org.eclipse.wst.jsdt.core.dom.ListExpression;
+import org.eclipse.wst.jsdt.core.dom.MemberRef;
+import org.eclipse.wst.jsdt.core.dom.Modifier;
+import org.eclipse.wst.jsdt.core.dom.Name;
+import org.eclipse.wst.jsdt.core.dom.NullLiteral;
+import org.eclipse.wst.jsdt.core.dom.NumberLiteral;
+import org.eclipse.wst.jsdt.core.dom.ObjectLiteral;
+import org.eclipse.wst.jsdt.core.dom.ObjectLiteralField;
+import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
+import org.eclipse.wst.jsdt.core.dom.ParameterizedType;
+import org.eclipse.wst.jsdt.core.dom.ParenthesizedExpression;
+import org.eclipse.wst.jsdt.core.dom.PostfixExpression;
+import org.eclipse.wst.jsdt.core.dom.PrefixExpression;
+import org.eclipse.wst.jsdt.core.dom.PrimitiveType;
+import org.eclipse.wst.jsdt.core.dom.QualifiedName;
+import org.eclipse.wst.jsdt.core.dom.QualifiedType;
+import org.eclipse.wst.jsdt.core.dom.RegularExpressionLiteral;
+import org.eclipse.wst.jsdt.core.dom.ReturnStatement;
+import org.eclipse.wst.jsdt.core.dom.SimpleName;
+import org.eclipse.wst.jsdt.core.dom.SimpleType;
+import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
+import org.eclipse.wst.jsdt.core.dom.Statement;
+import org.eclipse.wst.jsdt.core.dom.StringLiteral;
+import org.eclipse.wst.jsdt.core.dom.SuperConstructorInvocation;
+import org.eclipse.wst.jsdt.core.dom.SuperFieldAccess;
+import org.eclipse.wst.jsdt.core.dom.SuperMethodInvocation;
+import org.eclipse.wst.jsdt.core.dom.SwitchCase;
+import org.eclipse.wst.jsdt.core.dom.SwitchStatement;
+import org.eclipse.wst.jsdt.core.dom.TagElement;
+import org.eclipse.wst.jsdt.core.dom.TextElement;
+import org.eclipse.wst.jsdt.core.dom.ThisExpression;
+import org.eclipse.wst.jsdt.core.dom.ThrowStatement;
+import org.eclipse.wst.jsdt.core.dom.TryStatement;
+import org.eclipse.wst.jsdt.core.dom.Type;
+import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
+import org.eclipse.wst.jsdt.core.dom.TypeDeclarationStatement;
+import org.eclipse.wst.jsdt.core.dom.TypeLiteral;
+import org.eclipse.wst.jsdt.core.dom.TypeParameter;
+import org.eclipse.wst.jsdt.core.dom.UndefinedLiteral;
+import org.eclipse.wst.jsdt.core.dom.VariableDeclaration;
+import org.eclipse.wst.jsdt.core.dom.VariableDeclarationExpression;
+import org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment;
+import org.eclipse.wst.jsdt.core.dom.VariableDeclarationStatement;
+import org.eclipse.wst.jsdt.core.dom.WhileStatement;
+import org.eclipse.wst.jsdt.core.dom.WildcardType;
+import org.eclipse.wst.jsdt.core.dom.WithStatement;
/**
* <p>This class provides a convenient behaviour-only
@@ -98,19 +189,6 @@
endVisit((BodyDeclaration) node);
}
- public boolean visit(AnnotationTypeDeclaration node) {
- return visit((AbstractTypeDeclaration) node);
- }
- public void endVisit(AnnotationTypeDeclaration node) {
- endVisit((AbstractTypeDeclaration) node);
- }
-
- public boolean visit(EnumDeclaration node) {
- return visit((AbstractTypeDeclaration) node);
- }
- public void endVisit(EnumDeclaration node) {
- endVisit((AbstractTypeDeclaration) node);
- }
public boolean visit(TypeDeclaration node) {
return visit((AbstractTypeDeclaration) node);
@@ -120,19 +198,7 @@
}
//---- End AbstractTypeDeclaration Hierarchy ---------------------------
- public boolean visit(AnnotationTypeMemberDeclaration node) {
- return visit((BodyDeclaration) node);
- }
- public void endVisit(AnnotationTypeMemberDeclaration node) {
- endVisit((BodyDeclaration) node);
- }
-
- public boolean visit(EnumConstantDeclaration node) {
- return visit((BodyDeclaration) node);
- }
- public void endVisit(EnumConstantDeclaration node) {
- endVisit((BodyDeclaration) node);
- }
+
public boolean visit(FieldDeclaration node) {
return visit((BodyDeclaration) node);
@@ -213,36 +279,7 @@
endVisit((ASTNode) node);
}
- //---- Begin Annotation Hierarchy ----------------------------------
- public boolean visit(Annotation node) {
- return visit((Expression) node);
- }
- public void endVisit(Annotation node) {
- endVisit((Expression) node);
- }
-
- public boolean visit(MarkerAnnotation node) {
- return visit((Annotation) node);
- }
- public void endVisit(MarkerAnnotation node) {
- endVisit((Annotation) node);
- }
-
- public boolean visit(NormalAnnotation node) {
- return visit((Annotation) node);
- }
- public void endVisit(NormalAnnotation node) {
- endVisit((Annotation) node);
- }
-
- public boolean visit(SingleMemberAnnotation node) {
- return visit((Annotation) node);
- }
- public void endVisit(SingleMemberAnnotation node) {
- endVisit((Annotation) node);
- }
-
- //---- End Annotation Hierarchy -----------------------------
+
public boolean visit(ArrayAccess node) {
return visit((Expression) node);
@@ -491,12 +528,6 @@
endVisit((ASTNode) node);
}
-public boolean visit(MemberValuePair node) {
- return visit((ASTNode) node);
-}
-public void endVisit(MemberValuePair node) {
- endVisit((ASTNode) node);
-}
public boolean visit(FunctionRef node) {
return visit((ASTNode) node);
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/LinkedNodeFinder.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/LinkedNodeFinder.java
index 97c8a70..3b7d87a 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/LinkedNodeFinder.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/LinkedNodeFinder.java
@@ -16,17 +16,15 @@
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.BreakStatement;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.ContinueStatement;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.LabeledStatement;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.SimpleName;
import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
@@ -248,20 +246,6 @@
return true;
}
- public boolean visit(EnumDeclaration node) {
- if (fBinding.getKind() == IBinding.METHOD) {
- IFunctionBinding binding= (IFunctionBinding) fBinding;
- if (binding.isConstructor() && binding.getDeclaringClass() == node.resolveBinding()) {
- fResult.add(node.getName());
- }
- }
- return true;
- }
-
- public boolean visit(AnnotationTypeDeclaration node) {
- // annotation types can not have a constructor
- return true;
- }
public boolean visit(SimpleName node) {
IBinding binding= node.resolveBinding();
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/ModifierRewrite.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/ModifierRewrite.java
index b76b623..420e6ff 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/ModifierRewrite.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/dom/ModifierRewrite.java
@@ -14,10 +14,6 @@
import org.eclipse.text.edits.TextEditGroup;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeMemberDeclaration;
-import org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.Modifier;
@@ -65,14 +61,6 @@
return rewrite.getListRewrite(declNode, SingleVariableDeclaration.MODIFIERS2_PROPERTY);
case ASTNode.TYPE_DECLARATION:
return rewrite.getListRewrite(declNode, TypeDeclaration.MODIFIERS2_PROPERTY);
- case ASTNode.ENUM_DECLARATION:
- return rewrite.getListRewrite(declNode, EnumDeclaration.MODIFIERS2_PROPERTY);
- case ASTNode.ANNOTATION_TYPE_DECLARATION:
- return rewrite.getListRewrite(declNode, AnnotationTypeDeclaration.MODIFIERS2_PROPERTY);
- case ASTNode.ENUM_CONSTANT_DECLARATION:
- return rewrite.getListRewrite(declNode, EnumConstantDeclaration.MODIFIERS2_PROPERTY);
- case ASTNode.ANNOTATION_TYPE_MEMBER_DECLARATION:
- return rewrite.getListRewrite(declNode, AnnotationTypeMemberDeclaration.MODIFIERS2_PROPERTY);
default:
throw new IllegalArgumentException("node has no modifiers: " + declNode.getClass().getName()); //$NON-NLS-1$
}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/TypeContextChecker.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/TypeContextChecker.java
index bd2c698..ae391a6 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/TypeContextChecker.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/TypeContextChecker.java
@@ -26,9 +26,9 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.eclipse.wst.jsdt.core.Flags;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
import org.eclipse.wst.jsdt.core.IFunction;
+import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IPackageFragment;
import org.eclipse.wst.jsdt.core.ISourceRange;
import org.eclipse.wst.jsdt.core.IType;
@@ -41,19 +41,16 @@
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ASTParser;
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeMemberDeclaration;
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.wst.jsdt.core.dom.ArrayType;
import org.eclipse.wst.jsdt.core.dom.Block;
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.IExtendedModifier;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.Modifier;
import org.eclipse.wst.jsdt.core.dom.Name;
import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
@@ -187,8 +184,6 @@
for (int i= 0; i < parameterCount; i++)
typeNodes[i]= ((SingleVariableDeclaration) parameters.get(i)).getType();
- } else if (method instanceof AnnotationTypeMemberDeclaration) {
- typeNodes[0]= ((AnnotationTypeMemberDeclaration) method).getType();
}
for (int i= 0; i < types.length; i++) {
@@ -598,22 +593,9 @@
List superInterfaces= type.superInterfaceTypes();
appendSuperInterfaces(buf, superInterfaces);
- } else if (decl instanceof AnnotationTypeDeclaration) {
- AnnotationTypeDeclaration annotation= (AnnotationTypeDeclaration) decl;
- buf.append("@interface "); //$NON-NLS-1$
- buf.append(annotation.getName().getIdentifier());
-
- } else if (decl instanceof EnumDeclaration) {
- EnumDeclaration enumDecl= (EnumDeclaration) decl;
- buf.append("enum "); //$NON-NLS-1$
- buf.append(enumDecl.getName().getIdentifier());
- List superInterfaces= enumDecl.superInterfaceTypes();
- appendSuperInterfaces(buf, superInterfaces);
}
buf.append("{\n"); //$NON-NLS-1$
- if (decl instanceof EnumDeclaration)
- buf.append(";\n"); //$NON-NLS-1$
fillWithTypeStubs(bufBefore, bufAfter, focalPosition, decl.bodyDeclarations());
buf= decl.getStartPosition() + decl.getLength() < focalPosition ? bufBefore : bufAfter;
buf.append("}\n"); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/AstMatchingNodeFinder.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/AstMatchingNodeFinder.java
index 6f23db6..31c7d32 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/AstMatchingNodeFinder.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/AstMatchingNodeFinder.java
@@ -16,8 +16,6 @@
import org.eclipse.wst.jsdt.core.dom.ASTMatcher;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeMemberDeclaration;
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.wst.jsdt.core.dom.ArrayAccess;
import org.eclipse.wst.jsdt.core.dom.ArrayCreation;
@@ -33,39 +31,34 @@
import org.eclipse.wst.jsdt.core.dom.CatchClause;
import org.eclipse.wst.jsdt.core.dom.CharacterLiteral;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.ConditionalExpression;
import org.eclipse.wst.jsdt.core.dom.ConstructorInvocation;
import org.eclipse.wst.jsdt.core.dom.ContinueStatement;
import org.eclipse.wst.jsdt.core.dom.DoStatement;
import org.eclipse.wst.jsdt.core.dom.EmptyStatement;
import org.eclipse.wst.jsdt.core.dom.EnhancedForStatement;
-import org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
import org.eclipse.wst.jsdt.core.dom.FieldAccess;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
import org.eclipse.wst.jsdt.core.dom.ForInStatement;
import org.eclipse.wst.jsdt.core.dom.ForStatement;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.FunctionExpression;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
+import org.eclipse.wst.jsdt.core.dom.FunctionRef;
+import org.eclipse.wst.jsdt.core.dom.FunctionRefParameter;
import org.eclipse.wst.jsdt.core.dom.IfStatement;
import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
import org.eclipse.wst.jsdt.core.dom.InfixExpression;
import org.eclipse.wst.jsdt.core.dom.Initializer;
import org.eclipse.wst.jsdt.core.dom.InstanceofExpression;
import org.eclipse.wst.jsdt.core.dom.JSdoc;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.LabeledStatement;
import org.eclipse.wst.jsdt.core.dom.LineComment;
import org.eclipse.wst.jsdt.core.dom.ListExpression;
-import org.eclipse.wst.jsdt.core.dom.MarkerAnnotation;
import org.eclipse.wst.jsdt.core.dom.MemberRef;
-import org.eclipse.wst.jsdt.core.dom.MemberValuePair;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
-import org.eclipse.wst.jsdt.core.dom.FunctionRef;
-import org.eclipse.wst.jsdt.core.dom.FunctionRefParameter;
import org.eclipse.wst.jsdt.core.dom.Modifier;
-import org.eclipse.wst.jsdt.core.dom.NormalAnnotation;
import org.eclipse.wst.jsdt.core.dom.NullLiteral;
import org.eclipse.wst.jsdt.core.dom.NumberLiteral;
import org.eclipse.wst.jsdt.core.dom.ObjectLiteral;
@@ -82,7 +75,6 @@
import org.eclipse.wst.jsdt.core.dom.ReturnStatement;
import org.eclipse.wst.jsdt.core.dom.SimpleName;
import org.eclipse.wst.jsdt.core.dom.SimpleType;
-import org.eclipse.wst.jsdt.core.dom.SingleMemberAnnotation;
import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
import org.eclipse.wst.jsdt.core.dom.StringLiteral;
import org.eclipse.wst.jsdt.core.dom.SuperConstructorInvocation;
@@ -556,18 +548,6 @@
return super.visit(node);
}
- public boolean visit(AnnotationTypeDeclaration node) {
- if (node.subtreeMatch(fMatcher, fNodeToMatch))
- return matches(node);
- return super.visit(node);
- }
-
- public boolean visit(AnnotationTypeMemberDeclaration node) {
- if (node.subtreeMatch(fMatcher, fNodeToMatch))
- return matches(node);
- return super.visit(node);
- }
-
public boolean visit(BlockComment node) {
if (node.subtreeMatch(fMatcher, fNodeToMatch))
return matches(node);
@@ -580,42 +560,18 @@
return super.visit(node);
}
- public boolean visit(EnumConstantDeclaration node) {
- if (node.subtreeMatch(fMatcher, fNodeToMatch))
- return matches(node);
- return super.visit(node);
- }
-
- public boolean visit(EnumDeclaration node) {
- if (node.subtreeMatch(fMatcher, fNodeToMatch))
- return matches(node);
- return super.visit(node);
- }
-
public boolean visit(LineComment node) {
if (node.subtreeMatch(fMatcher, fNodeToMatch))
return matches(node);
return super.visit(node);
}
- public boolean visit(MarkerAnnotation node) {
- if (node.subtreeMatch(fMatcher, fNodeToMatch))
- return matches(node);
- return super.visit(node);
- }
-
public boolean visit(MemberRef node) {
if (node.subtreeMatch(fMatcher, fNodeToMatch))
return matches(node);
return super.visit(node);
}
- public boolean visit(MemberValuePair node) {
- if (node.subtreeMatch(fMatcher, fNodeToMatch))
- return matches(node);
- return super.visit(node);
- }
-
public boolean visit(FunctionRef node) {
if (node.subtreeMatch(fMatcher, fNodeToMatch))
return matches(node);
@@ -634,12 +590,6 @@
return super.visit(node);
}
- public boolean visit(NormalAnnotation node) {
- if (node.subtreeMatch(fMatcher, fNodeToMatch))
- return matches(node);
- return super.visit(node);
- }
-
public boolean visit(ParameterizedType node) {
if (node.subtreeMatch(fMatcher, fNodeToMatch))
return matches(node);
@@ -652,12 +602,6 @@
return super.visit(node);
}
- public boolean visit(SingleMemberAnnotation node) {
- if (node.subtreeMatch(fMatcher, fNodeToMatch))
- return matches(node);
- return super.visit(node);
- }
-
public boolean visit(TagElement node) {
if (node.subtreeMatch(fMatcher, fNodeToMatch))
return matches(node);
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/ExtractMethodRefactoring.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/ExtractMethodRefactoring.java
index d1ea89c..ecb5142 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/ExtractMethodRefactoring.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/ExtractMethodRefactoring.java
@@ -44,31 +44,29 @@
import org.eclipse.text.edits.MultiTextEdit;
import org.eclipse.text.edits.TextEdit;
import org.eclipse.text.edits.TextEditGroup;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.dom.AST;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.wst.jsdt.core.dom.Assignment;
import org.eclipse.wst.jsdt.core.dom.Block;
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
import org.eclipse.wst.jsdt.core.dom.ChildListPropertyDescriptor;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.Expression;
import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
import org.eclipse.wst.jsdt.core.dom.FieldAccess;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
import org.eclipse.wst.jsdt.core.dom.JSdoc;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.Modifier;
import org.eclipse.wst.jsdt.core.dom.QualifiedName;
import org.eclipse.wst.jsdt.core.dom.ReturnStatement;
@@ -194,12 +192,6 @@
public boolean visit(TypeDeclaration node) {
return visitType(node);
}
- public boolean visit(AnnotationTypeDeclaration node) {
- return visitType(node);
- }
- public boolean visit(EnumDeclaration node) {
- return visitType(node);
- }
private boolean visitType(AbstractTypeDeclaration node) {
result.add(node.getName().getIdentifier());
// don't dive into type declaration since they open a new
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/InlineConstantRefactoring.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/InlineConstantRefactoring.java
index 37b1297..4b36263 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/InlineConstantRefactoring.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/InlineConstantRefactoring.java
@@ -38,10 +38,10 @@
import org.eclipse.text.edits.TextEdit;
import org.eclipse.text.edits.TextEditGroup;
import org.eclipse.wst.jsdt.core.Flags;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IField;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.ISourceRange;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.dom.AST;
@@ -54,17 +54,16 @@
import org.eclipse.wst.jsdt.core.dom.ArrayType;
import org.eclipse.wst.jsdt.core.dom.Assignment;
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration;
import org.eclipse.wst.jsdt.core.dom.Expression;
import org.eclipse.wst.jsdt.core.dom.FieldAccess;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.Modifier;
import org.eclipse.wst.jsdt.core.dom.Name;
import org.eclipse.wst.jsdt.core.dom.ParenthesizedExpression;
@@ -616,8 +615,6 @@
return null;
if (node instanceof FieldAccess)
node= ((FieldAccess) node).getName();
- if (node.getParent() instanceof EnumConstantDeclaration)
- return null;
if (!(node instanceof Name))
return null;
Name name= (Name) node;
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/LocalTypeAnalyzer.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/LocalTypeAnalyzer.java
index 050d54f..b2e09b8 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/LocalTypeAnalyzer.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/LocalTypeAnalyzer.java
@@ -17,9 +17,7 @@
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.SimpleName;
@@ -63,14 +61,6 @@
return visitType(node);
}
- public boolean visit(AnnotationTypeDeclaration node) {
- return visitType(node);
- }
-
- public boolean visit(EnumDeclaration node) {
- return visitType(node);
- }
-
private boolean visitType(AbstractTypeDeclaration node) {
int mode= fSelection.getVisitSelectionMode(node);
switch (mode) {
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/SnippetFinder.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/SnippetFinder.java
index 59222e6..81b6c92 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/SnippetFinder.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/SnippetFinder.java
@@ -20,14 +20,12 @@
import org.eclipse.wst.jsdt.core.dom.ASTMatcher;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.wst.jsdt.core.dom.Assignment;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.SimpleName;
import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
import org.eclipse.wst.jsdt.internal.corext.dom.ASTNodes;
@@ -178,28 +176,6 @@
super.endVisit(node);
}
- public boolean visit(EnumDeclaration node) {
- if (++fTypes > 1)
- return false;
- return super.visit(node);
- }
-
- public void endVisit(EnumDeclaration node) {
- --fTypes;
- super.endVisit(node);
- }
-
- public boolean visit(AnnotationTypeDeclaration node) {
- if (++fTypes > 1)
- return false;
- return super.visit(node);
- }
-
- public void endVisit(AnnotationTypeDeclaration node) {
- --fTypes;
- super.endVisit(node);
- }
-
protected boolean visitNode(ASTNode node) {
if (matches(node)) {
return false;
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/SourceAnalyzer.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/SourceAnalyzer.java
index 25efffb..9ef3d0f 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/SourceAnalyzer.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/SourceAnalyzer.java
@@ -29,20 +29,18 @@
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.wst.jsdt.core.dom.ArrayAccess;
import org.eclipse.wst.jsdt.core.dom.Block;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.Expression;
import org.eclipse.wst.jsdt.core.dom.FieldAccess;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
import org.eclipse.wst.jsdt.core.dom.Modifier;
import org.eclipse.wst.jsdt.core.dom.Name;
import org.eclipse.wst.jsdt.core.dom.ReturnStatement;
@@ -93,12 +91,6 @@
}
return true;
}
- public boolean visit(EnumDeclaration node) {
- return false;
- }
- public boolean visit(AnnotationTypeDeclaration node) {
- return false;
- }
public boolean visit(TypeDeclaration node) {
return false;
}
@@ -159,18 +151,6 @@
public void endVisit(TypeDeclaration node) {
fTypeCounter--;
}
- public boolean visit(EnumDeclaration node) {
- return visitType(node);
- }
- public void endVisit(EnumDeclaration node) {
- fTypeCounter--;
- }
- public boolean visit(AnnotationTypeDeclaration node) {
- return visitType(node);
- }
- public void endVisit(AnnotationTypeDeclaration node) {
- fTypeCounter--;
- }
private boolean visitType(AbstractTypeDeclaration node) {
if (fTypeCounter++ == 0) {
addNameReference(node.getName());
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/TargetProvider.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/TargetProvider.java
index 38b7faa..21d2437 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/TargetProvider.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/TargetProvider.java
@@ -24,27 +24,25 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IFunction;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IType;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.dom.AST;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
import org.eclipse.wst.jsdt.core.dom.ConstructorInvocation;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.Initializer;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
import org.eclipse.wst.jsdt.core.dom.SuperMethodInvocation;
import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchConstants;
@@ -264,18 +262,7 @@
public void endVisit(TypeDeclaration node) {
endVisitType();
}
- public boolean visit(EnumDeclaration node) {
- return visitType();
- }
- public void endVisit(EnumDeclaration node) {
- endVisitType();
- }
- public boolean visit(AnnotationTypeDeclaration node) {
- return visitType();
- }
- public void endVisit(AnnotationTypeDeclaration node) {
- endVisitType();
- }
+
private boolean visitType() {
fBodies.add(fCurrent);
fCurrent= null;
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/FlowAnalyzer.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/FlowAnalyzer.java
index f49fe82..dfa5814 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/FlowAnalyzer.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/code/flow/FlowAnalyzer.java
@@ -18,8 +18,6 @@
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Region;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeMemberDeclaration;
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.wst.jsdt.core.dom.ArrayAccess;
import org.eclipse.wst.jsdt.core.dom.ArrayCreation;
@@ -34,21 +32,20 @@
import org.eclipse.wst.jsdt.core.dom.CatchClause;
import org.eclipse.wst.jsdt.core.dom.CharacterLiteral;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.ConditionalExpression;
import org.eclipse.wst.jsdt.core.dom.ConstructorInvocation;
import org.eclipse.wst.jsdt.core.dom.ContinueStatement;
import org.eclipse.wst.jsdt.core.dom.DoStatement;
import org.eclipse.wst.jsdt.core.dom.EmptyStatement;
import org.eclipse.wst.jsdt.core.dom.EnhancedForStatement;
-import org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.Expression;
import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
import org.eclipse.wst.jsdt.core.dom.FieldAccess;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
import org.eclipse.wst.jsdt.core.dom.ForInStatement;
import org.eclipse.wst.jsdt.core.dom.ForStatement;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
@@ -59,14 +56,10 @@
import org.eclipse.wst.jsdt.core.dom.Initializer;
import org.eclipse.wst.jsdt.core.dom.InstanceofExpression;
import org.eclipse.wst.jsdt.core.dom.JSdoc;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.LabeledStatement;
import org.eclipse.wst.jsdt.core.dom.ListExpression;
-import org.eclipse.wst.jsdt.core.dom.MarkerAnnotation;
-import org.eclipse.wst.jsdt.core.dom.MemberValuePair;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
import org.eclipse.wst.jsdt.core.dom.Name;
-import org.eclipse.wst.jsdt.core.dom.NormalAnnotation;
import org.eclipse.wst.jsdt.core.dom.NullLiteral;
import org.eclipse.wst.jsdt.core.dom.NumberLiteral;
import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
@@ -80,7 +73,6 @@
import org.eclipse.wst.jsdt.core.dom.ReturnStatement;
import org.eclipse.wst.jsdt.core.dom.SimpleName;
import org.eclipse.wst.jsdt.core.dom.SimpleType;
-import org.eclipse.wst.jsdt.core.dom.SingleMemberAnnotation;
import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
import org.eclipse.wst.jsdt.core.dom.Statement;
import org.eclipse.wst.jsdt.core.dom.StringLiteral;
@@ -376,20 +368,6 @@
//---- concret endVisit methods ---------------------------------------------------
- public void endVisit(AnnotationTypeDeclaration node) {
- if (skipNode(node))
- return;
- GenericSequentialFlowInfo info= processSequential(node, node.bodyDeclarations());
- info.setNoReturn();
- }
-
- public void endVisit(AnnotationTypeMemberDeclaration node) {
- if (skipNode(node))
- return;
- GenericSequentialFlowInfo info= processSequential(node, node.getType(), node.getDefault());
- info.setNoReturn();
- }
-
public void endVisit(AnonymousClassDeclaration node) {
if (skipNode(node))
return;
@@ -553,21 +531,6 @@
forInfo.removeLabel(null);
}
- public void endVisit(EnumConstantDeclaration node) {
- if (skipNode(node))
- return;
- GenericSequentialFlowInfo info= processSequential(node, node.arguments());
- process(info, node.getAnonymousClassDeclaration());
- }
-
- public void endVisit(EnumDeclaration node) {
- if (skipNode(node))
- return;
- GenericSequentialFlowInfo info= processSequential(node, node.superInterfaceTypes());
- process(info, node.enumConstants());
- process(info, node.bodyDeclarations());
- info.setNoReturn();
- }
public void endVisit(ExpressionStatement node) {
if (skipNode(node))
@@ -664,26 +627,7 @@
processSequential(node, node.expressions());
}
- public void endVisit(MarkerAnnotation node) {
- // nothing to do for marker annotations;
- }
-
- public void endVisit(MemberValuePair node) {
- if (skipNode(node))
- return;
- FlowInfo name= getFlowInfo(node.getName());
- FlowInfo value= getFlowInfo(node.getValue());
- if (name instanceof LocalFlowInfo) {
- LocalFlowInfo llhs= (LocalFlowInfo)name;
- llhs.setWriteAccess(fFlowContext);
- }
- GenericSequentialFlowInfo info= createSequential(node);
- // first process value and then name.
- info.merge(value, fFlowContext);
- info.merge(name, fFlowContext);
-
- }
public void endVisit(FunctionDeclaration node) {
if (skipNode(node))
@@ -697,13 +641,7 @@
public void endVisit(FunctionInvocation node) {
endVisitMethodInvocation(node, node.getExpression(), node.arguments(), getMethodBinding(node.getName()));
}
-
- public void endVisit(NormalAnnotation node) {
- if (skipNode(node))
- return;
- GenericSequentialFlowInfo info= processSequential(node, node.getTypeName());
- process(info, node.values());
- }
+
public void endVisit(NullLiteral node) {
// Leaf node.
@@ -800,11 +738,6 @@
assignFlowInfo(node, node.getName());
}
- public void endVisit(SingleMemberAnnotation node) {
- if (skipNode(node))
- return;
- assignFlowInfo(node, node.getValue());
- }
public void endVisit(SingleVariableDeclaration node) {
if (skipNode(node))
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/RenameTypeParameterProcessor.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/RenameTypeParameterProcessor.java
index 99a1251..3a3e61e 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/RenameTypeParameterProcessor.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/RenameTypeParameterProcessor.java
@@ -22,21 +22,19 @@
import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
import org.eclipse.ltk.core.refactoring.participants.RefactoringArguments;
import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
+import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IMember;
-import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.ISourceRange;
import org.eclipse.wst.jsdt.core.IType;
import org.eclipse.wst.jsdt.core.ITypeParameter;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.SimpleName;
import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
import org.eclipse.wst.jsdt.core.refactoring.IJavaScriptRefactorings;
@@ -118,23 +116,6 @@
return fRewrite.createChange();
}
- public final boolean visit(final AnnotationTypeDeclaration node) {
- final String name= node.getName().getIdentifier();
- if (name.equals(getNewElementName())) {
- fStatus.addError(Messages.format(RefactoringCoreMessages.RenameTypeParameterRefactoring_type_parameter_inner_class_clash, new String[] { name}), JavaStatusContext.create(fTypeParameter.getDeclaringMember().getJavaScriptUnit(), new SourceRange(node)));
- return false;
- }
- return true;
- }
-
- public final boolean visit(final EnumDeclaration node) {
- final String name= node.getName().getIdentifier();
- if (name.equals(getNewElementName())) {
- fStatus.addError(Messages.format(RefactoringCoreMessages.RenameTypeParameterRefactoring_type_parameter_inner_class_clash, new String[] { name}), JavaStatusContext.create(fTypeParameter.getDeclaringMember().getJavaScriptUnit(), new SourceRange(node)));
- return false;
- }
- return true;
- }
public final boolean visit(final SimpleName node) {
final ITypeBinding binding= node.resolveTypeBinding();
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/ASTNodeDeleteUtil.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/ASTNodeDeleteUtil.java
index 5a904f0..ec82343 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/ASTNodeDeleteUtil.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/ASTNodeDeleteUtil.java
@@ -24,23 +24,19 @@
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment;
import org.eclipse.wst.jsdt.core.dom.VariableDeclarationStatement;
import org.eclipse.wst.jsdt.internal.corext.dom.GenericVisitor;
import org.eclipse.wst.jsdt.internal.corext.refactoring.structure.ASTNodeSearchUtil;
import org.eclipse.wst.jsdt.internal.corext.refactoring.structure.CompilationUnitRewrite;
-import org.eclipse.wst.jsdt.internal.corext.util.JdtFlags;
public class ASTNodeDeleteUtil {
private static ASTNode[] getNodesToDelete(IJavaScriptElement element, JavaScriptUnit cuNode) throws JavaScriptModelException {
// fields are different because you don't delete the whole declaration but only a fragment of it
if (element.getElementType() == IJavaScriptElement.FIELD) {
- if (JdtFlags.isEnum((IField) element))
- return new ASTNode[] { ASTNodeSearchUtil.getEnumConstantDeclaration((IField) element, cuNode)};
- else
return new ASTNode[] { ASTNodeSearchUtil.getFieldDeclarationFragmentNode((IField) element, cuNode)};
}
if (element.getElementType() == IJavaScriptElement.TYPE && ((IType) element).isLocal()) {
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/ReorgPolicyFactory.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/ReorgPolicyFactory.java
index 1059ff6..01e6f62 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/ReorgPolicyFactory.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/reorg/ReorgPolicyFactory.java
@@ -56,16 +56,16 @@
import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
import org.eclipse.ltk.core.refactoring.participants.ValidateEditChecker;
import org.eclipse.wst.jsdt.core.IClassFile;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IField;
+import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IImportContainer;
import org.eclipse.wst.jsdt.core.IImportDeclaration;
import org.eclipse.wst.jsdt.core.IInitializer;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptModel;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IMember;
-import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IOpenable;
import org.eclipse.wst.jsdt.core.IPackageDeclaration;
import org.eclipse.wst.jsdt.core.IPackageFragment;
@@ -81,14 +81,11 @@
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
import org.eclipse.wst.jsdt.core.dom.JSdoc;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
-import org.eclipse.wst.jsdt.core.dom.SimpleName;
import org.eclipse.wst.jsdt.core.dom.Type;
import org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment;
import org.eclipse.wst.jsdt.core.dom.rewrite.ASTRewrite;
@@ -2898,9 +2895,6 @@
if (destinationContainer != null) {
ListRewrite listRewrite;
if (destinationContainer instanceof AbstractTypeDeclaration) {
- if (newMember instanceof EnumConstantDeclaration && destinationContainer instanceof EnumDeclaration)
- listRewrite= targetRewriter.getASTRewrite().getListRewrite(destinationContainer, EnumDeclaration.ENUM_CONSTANTS_PROPERTY);
- else
listRewrite= targetRewriter.getASTRewrite().getListRewrite(destinationContainer, ((AbstractTypeDeclaration) destinationContainer).getBodyDeclarationsProperty());
} else
listRewrite= targetRewriter.getASTRewrite().getListRewrite(destinationContainer, AnonymousClassDeclaration.BODY_DECLARATIONS_PROPERTY);
@@ -2991,14 +2985,6 @@
VariableDeclarationFragment copiedFragment= (VariableDeclarationFragment) ASTNode.copySubtree(targetAst, originalFragment);
newDeclaration= targetAst.newFieldDeclaration(copiedFragment);
((FieldDeclaration) newDeclaration).setType((Type) ASTNode.copySubtree(targetAst, fieldDeclaration.getType()));
- } else if (bodyDeclaration instanceof EnumConstantDeclaration) {
- EnumConstantDeclaration constantDeclaration= (EnumConstantDeclaration) bodyDeclaration;
- EnumConstantDeclaration newConstDeclaration= targetAst.newEnumConstantDeclaration();
- newConstDeclaration.setName((SimpleName) ASTNode.copySubtree(targetAst, constantDeclaration.getName()));
- AnonymousClassDeclaration anonymousDeclaration= constantDeclaration.getAnonymousClassDeclaration();
- if (anonymousDeclaration != null)
- newConstDeclaration.setAnonymousClassDeclaration((AnonymousClassDeclaration) rewrite.createStringPlaceholder(document.get(anonymousDeclaration.getStartPosition(), anonymousDeclaration.getLength()), ASTNode.ANONYMOUS_CLASS_DECLARATION));
- newDeclaration= newConstDeclaration;
} else
Assert.isTrue(false);
if (newDeclaration != null) {
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ASTNodeSearchUtil.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ASTNodeSearchUtil.java
index ba510e3..3f11a94 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ASTNodeSearchUtil.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ASTNodeSearchUtil.java
@@ -15,31 +15,27 @@
import org.eclipse.core.runtime.Assert;
import org.eclipse.wst.jsdt.core.IField;
+import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IImportContainer;
import org.eclipse.wst.jsdt.core.IImportDeclaration;
import org.eclipse.wst.jsdt.core.IInitializer;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IMember;
-import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IPackageDeclaration;
import org.eclipse.wst.jsdt.core.ISourceRange;
import org.eclipse.wst.jsdt.core.IType;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeMemberDeclaration;
import org.eclipse.wst.jsdt.core.dom.Block;
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.ConstructorInvocation;
-import org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
import org.eclipse.wst.jsdt.core.dom.Initializer;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
import org.eclipse.wst.jsdt.core.dom.SimpleName;
import org.eclipse.wst.jsdt.core.dom.SuperConstructorInvocation;
@@ -50,7 +46,6 @@
import org.eclipse.wst.jsdt.internal.corext.dom.NodeFinder;
import org.eclipse.wst.jsdt.internal.corext.dom.Selection;
import org.eclipse.wst.jsdt.internal.corext.dom.SelectionAnalyzer;
-import org.eclipse.wst.jsdt.internal.corext.util.JdtFlags;
public class ASTNodeSearchUtil {
@@ -118,10 +113,6 @@
return (FunctionDeclaration)ASTNodes.getParent(getNameNode(iMethod, cuNode), FunctionDeclaration.class);
}
- public static AnnotationTypeMemberDeclaration getAnnotationTypeMemberDeclarationNode(IFunction iMethod, JavaScriptUnit cuNode) throws JavaScriptModelException {
- return (AnnotationTypeMemberDeclaration) ASTNodes.getParent(getNameNode(iMethod, cuNode), AnnotationTypeMemberDeclaration.class);
- }
-
public static BodyDeclaration getMethodOrAnnotationTypeMemberDeclarationNode(IFunction iMethod, JavaScriptUnit cuNode) throws JavaScriptModelException {
// if (JdtFlags.isAnnotation(iMethod.getDeclaringType()))
// return getAnnotationTypeMemberDeclarationNode(iMethod, cuNode);
@@ -140,24 +131,11 @@
return (FieldDeclaration) ASTNodes.getParent(getNameNode(iField, cuNode), FieldDeclaration.class);
}
- public static EnumConstantDeclaration getEnumConstantDeclaration(IField iField, JavaScriptUnit cuNode) throws JavaScriptModelException {
- return (EnumConstantDeclaration) ASTNodes.getParent(getNameNode(iField, cuNode), EnumConstantDeclaration.class);
- }
public static BodyDeclaration getFieldOrEnumConstantDeclaration(IField iField, JavaScriptUnit cuNode) throws JavaScriptModelException {
- if (JdtFlags.isEnum(iField))
- return getEnumConstantDeclaration(iField, cuNode);
- else
return getFieldDeclarationNode(iField, cuNode);
}
- public static EnumDeclaration getEnumDeclarationNode(IType iType, JavaScriptUnit cuNode) throws JavaScriptModelException {
- return (EnumDeclaration) ASTNodes.getParent(getNameNode(iType, cuNode), EnumDeclaration.class);
- }
-
- public static AnnotationTypeDeclaration getAnnotationTypeDeclarationNode(IType iType, JavaScriptUnit cuNode) throws JavaScriptModelException {
- return (AnnotationTypeDeclaration) ASTNodes.getParent(getNameNode(iType, cuNode), AnnotationTypeDeclaration.class);
- }
public static BodyDeclaration getBodyDeclarationNode(IMember iMember, JavaScriptUnit cuNode) throws JavaScriptModelException {
return (BodyDeclaration) ASTNodes.getParent(getNameNode(iMember, cuNode), BodyDeclaration.class);
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ChangeSignatureRefactoring.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ChangeSignatureRefactoring.java
index 759e621..5c6bd20 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ChangeSignatureRefactoring.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ChangeSignatureRefactoring.java
@@ -37,10 +37,10 @@
import org.eclipse.ltk.core.refactoring.participants.RefactoringArguments;
import org.eclipse.text.edits.TextEditGroup;
import org.eclipse.wst.jsdt.core.Flags;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
+import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IFunction;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IType;
import org.eclipse.wst.jsdt.core.ITypeHierarchy;
import org.eclipse.wst.jsdt.core.JavaScriptCore;
@@ -54,20 +54,18 @@
import org.eclipse.wst.jsdt.core.dom.Block;
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.ConstructorInvocation;
-import org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.Expression;
-import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
-import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
-import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
-import org.eclipse.wst.jsdt.core.dom.JSdoc;
-import org.eclipse.wst.jsdt.core.dom.MemberRef;
import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
import org.eclipse.wst.jsdt.core.dom.FunctionRef;
import org.eclipse.wst.jsdt.core.dom.FunctionRefParameter;
+import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
+import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
+import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
+import org.eclipse.wst.jsdt.core.dom.JSdoc;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
+import org.eclipse.wst.jsdt.core.dom.MemberRef;
import org.eclipse.wst.jsdt.core.dom.Modifier;
import org.eclipse.wst.jsdt.core.dom.Name;
import org.eclipse.wst.jsdt.core.dom.PrimitiveType;
@@ -1509,8 +1507,6 @@
private static final boolean BUG_89686= true; //see bug 83693: Search for References to methods/constructors: do ranges include parameter lists?
private OccurrenceUpdate createOccurrenceUpdate(ASTNode node, CompilationUnitRewrite cuRewrite, RefactoringStatus result) {
- if (BUG_89686 && node instanceof SimpleName && node.getParent() instanceof EnumConstantDeclaration)
- node= node.getParent();
if (isReferenceNode(node))
return new ReferenceUpdate(node, cuRewrite, result);
@@ -1535,7 +1531,6 @@
case ASTNode.CLASS_INSTANCE_CREATION :
case ASTNode.CONSTRUCTOR_INVOCATION :
case ASTNode.SUPER_CONSTRUCTOR_INVOCATION :
- case ASTNode.ENUM_CONSTANT_DECLARATION :
return true;
default :
@@ -1780,8 +1775,6 @@
if (fNode instanceof SuperConstructorInvocation)
return getASTRewrite().getListRewrite(fNode, SuperConstructorInvocation.ARGUMENTS_PROPERTY);
- if (fNode instanceof EnumConstantDeclaration)
- return getASTRewrite().getListRewrite(fNode, EnumConstantDeclaration.ARGUMENTS_PROPERTY);
return null;
}
@@ -1839,10 +1832,6 @@
return false; //Constructors don't override -> enclosing has not been changed -> no recursion
}
- if (fNode instanceof EnumConstantDeclaration) {
- return false; //cannot define enum constant inside enum constructor
- }
-
Assert.isTrue(false);
return false;
}
@@ -2350,9 +2339,6 @@
} else if (node instanceof ClassInstanceCreation) {
ClassInstanceCreation cic= (ClassInstanceCreation) node;
return Messages.format(RefactoringCoreMessages.ChangeSignatureRefactoring_anonymous_subclass, new String[]{ASTNodes.asString(cic.getType())});
- } else if (node instanceof EnumConstantDeclaration) {
- EnumDeclaration ed= (EnumDeclaration) node.getParent();
- return Messages.format(RefactoringCoreMessages.ChangeSignatureRefactoring_anonymous_subclass, new String[]{ASTNodes.asString(ed.getName())});
}
}
}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ExtractInterfaceProcessor.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ExtractInterfaceProcessor.java
index 6433886..d53d125 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ExtractInterfaceProcessor.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ExtractInterfaceProcessor.java
@@ -45,12 +45,12 @@
import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
import org.eclipse.text.edits.MalformedTreeException;
import org.eclipse.text.edits.TextEdit;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IField;
+import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IMember;
-import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IPackageFragment;
import org.eclipse.wst.jsdt.core.ISourceReference;
import org.eclipse.wst.jsdt.core.IType;
@@ -62,16 +62,14 @@
import org.eclipse.wst.jsdt.core.dom.ASTParser;
import org.eclipse.wst.jsdt.core.dom.ASTRequestor;
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.Annotation;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.IExtendedModifier;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.Modifier;
import org.eclipse.wst.jsdt.core.dom.ParameterizedType;
import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
@@ -609,7 +607,6 @@
boolean abstractFound= false;
ITypeBinding binding= null;
Modifier modifier= null;
- Annotation annotation= null;
IExtendedModifier extended= null;
for (final Iterator iterator= declaration.modifiers().iterator(); iterator.hasNext();) {
extended= (IExtendedModifier) iterator.next();
@@ -624,11 +621,6 @@
continue;
}
list.remove(modifier, null);
- } else if (extended.isAnnotation()) {
- annotation= (Annotation) extended;
- binding= annotation.resolveTypeBinding();
- if (binding.getQualifiedName().equals("java.lang.Override")) //$NON-NLS-1$
- list.remove(annotation, null);
}
}
final ModifierRewrite rewriter= ModifierRewrite.create(rewrite, declaration);
@@ -687,8 +679,6 @@
final ASTRewrite rewriter= rewrite.getASTRewrite();
if (declaration instanceof TypeDeclaration)
rewriter.getListRewrite(declaration, TypeDeclaration.SUPER_INTERFACE_TYPES_PROPERTY).insertLast(type, rewrite.createCategorizedGroupDescription(RefactoringCoreMessages.ExtractInterfaceProcessor_add_super_interface, SET_EXTRACT_INTERFACE));
- else if (declaration instanceof EnumDeclaration)
- rewriter.getListRewrite(declaration, EnumDeclaration.SUPER_INTERFACE_TYPES_PROPERTY).insertLast(type, rewrite.createCategorizedGroupDescription(RefactoringCoreMessages.ExtractInterfaceProcessor_add_super_interface, SET_EXTRACT_INTERFACE));
monitor.worked(1);
} finally {
monitor.done();
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/HierarchyProcessor.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/HierarchyProcessor.java
index ff17c16..af1902a 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/HierarchyProcessor.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/HierarchyProcessor.java
@@ -34,12 +34,12 @@
import org.eclipse.text.edits.MalformedTreeException;
import org.eclipse.text.edits.TextEdit;
import org.eclipse.wst.jsdt.core.Flags;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IField;
+import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IInitializer;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IMember;
-import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.ISourceRange;
import org.eclipse.wst.jsdt.core.IType;
import org.eclipse.wst.jsdt.core.ITypeHierarchy;
@@ -47,19 +47,16 @@
import org.eclipse.wst.jsdt.core.dom.AST;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
-import org.eclipse.wst.jsdt.core.dom.Annotation;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.Expression;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.IExtendedModifier;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.JSdoc;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.Modifier;
import org.eclipse.wst.jsdt.core.dom.Name;
import org.eclipse.wst.jsdt.core.dom.SimpleName;
@@ -208,8 +205,6 @@
for (int index= 0, n= oldField.modifiers().size(); index < n; index++) {
final IExtendedModifier modifier= (IExtendedModifier) oldField.modifiers().get(index);
final List modifiers= newField.modifiers();
- if (modifier.isAnnotation() && !modifiers.contains(modifier))
- modifiers.add(index, ASTNode.copySubtree(ast, (Annotation) modifier));
}
}
@@ -218,8 +213,6 @@
for (int index= 0, n= oldMethod.modifiers().size(); index < n; index++) {
final IExtendedModifier modifier= (IExtendedModifier) oldMethod.modifiers().get(index);
final List modifiers= newMethod.modifiers();
- if (modifier.isAnnotation() && !modifiers.contains(modifier))
- modifiers.add(index, ASTNode.copySubtree(ast, (Annotation) modifier));
}
}
@@ -334,15 +327,6 @@
final ITrackedNodePosition position= rewriter.track(bodyDeclaration);
bodyDeclaration.accept(new TypeVariableMapper(rewriter, mapping) {
- public final boolean visit(final AnnotationTypeDeclaration node) {
- ModifierRewrite.create(fRewrite, bodyDeclaration).setVisibility(Modifier.PROTECTED, null);
- return true;
- }
-
- public final boolean visit(final EnumDeclaration node) {
- ModifierRewrite.create(fRewrite, bodyDeclaration).setVisibility(Modifier.PROTECTED, null);
- return true;
- }
public final boolean visit(final TypeDeclaration node) {
ModifierRewrite.create(fRewrite, bodyDeclaration).setVisibility(Modifier.PROTECTED, null);
@@ -455,9 +439,6 @@
final IMember member= (IMember) iterator.next();
ASTNode node= null;
if (member instanceof IField) {
- if (Flags.isEnum(member.getFlags()))
- node= ASTNodeSearchUtil.getEnumConstantDeclaration((IField) member, cuNode);
- else
node= ASTNodeSearchUtil.getFieldDeclarationFragmentNode((IField) member, cuNode);
} else if (member instanceof IType)
node= ASTNodeSearchUtil.getAbstractTypeDeclarationNode((IType) member, cuNode);
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/MoveInnerToTopRefactoring.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/MoveInnerToTopRefactoring.java
index 622a2a0..a0fcdd7 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/MoveInnerToTopRefactoring.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/MoveInnerToTopRefactoring.java
@@ -36,11 +36,11 @@
import org.eclipse.text.edits.TextEdit;
import org.eclipse.text.edits.TextEditGroup;
import org.eclipse.wst.jsdt.core.Flags;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IField;
+import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IFunction;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IType;
import org.eclipse.wst.jsdt.core.ITypeHierarchy;
import org.eclipse.wst.jsdt.core.ITypeParameter;
@@ -54,20 +54,19 @@
import org.eclipse.wst.jsdt.core.dom.Assignment;
import org.eclipse.wst.jsdt.core.dom.Block;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.ConstructorInvocation;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.Expression;
import org.eclipse.wst.jsdt.core.dom.FieldAccess;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
import org.eclipse.wst.jsdt.core.dom.JSdoc;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.Modifier;
import org.eclipse.wst.jsdt.core.dom.Name;
import org.eclipse.wst.jsdt.core.dom.ParameterizedType;
@@ -617,8 +616,6 @@
List types= null;
if (declaration instanceof TypeDeclaration)
types= ((TypeDeclaration) declaration).superInterfaceTypes();
- else if (declaration instanceof EnumDeclaration)
- types= ((EnumDeclaration) declaration).superInterfaceTypes();
if (types != null) {
for (final Iterator iterator= types.iterator(); iterator.hasNext();) {
type= (Type) iterator.next();
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/MoveInstanceMethodProcessor.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/MoveInstanceMethodProcessor.java
index 4c6150a..901b98c 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/MoveInstanceMethodProcessor.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/MoveInstanceMethodProcessor.java
@@ -50,11 +50,11 @@
import org.eclipse.text.edits.TextEditGroup;
import org.eclipse.text.edits.TextEditProcessor;
import org.eclipse.wst.jsdt.core.Flags;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IField;
+import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IFunction;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IType;
import org.eclipse.wst.jsdt.core.ITypeHierarchy;
import org.eclipse.wst.jsdt.core.JavaScriptCore;
@@ -63,24 +63,22 @@
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.wst.jsdt.core.dom.Assignment;
import org.eclipse.wst.jsdt.core.dom.Block;
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.Expression;
import org.eclipse.wst.jsdt.core.dom.FieldAccess;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
+import org.eclipse.wst.jsdt.core.dom.FunctionRef;
+import org.eclipse.wst.jsdt.core.dom.FunctionRefParameter;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
import org.eclipse.wst.jsdt.core.dom.JSdoc;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
-import org.eclipse.wst.jsdt.core.dom.FunctionRef;
-import org.eclipse.wst.jsdt.core.dom.FunctionRefParameter;
import org.eclipse.wst.jsdt.core.dom.Modifier;
import org.eclipse.wst.jsdt.core.dom.Name;
import org.eclipse.wst.jsdt.core.dom.NullLiteral;
@@ -829,18 +827,10 @@
*/
public final class SuperReferenceFinder extends AstNodeFinder {
- public final boolean visit(final AnnotationTypeDeclaration node) {
- return false;
- }
-
public final boolean visit(final AnonymousClassDeclaration node) {
return false;
}
- public final boolean visit(final EnumDeclaration node) {
- return false;
- }
-
public final boolean visit(final SuperFieldAccess node) {
Assert.isNotNull(node);
fStatus.merge(RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.MoveInstanceMethodProcessor_uses_super, JavaStatusContext.create(fMethod.getJavaScriptUnit(), node)));
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/MoveStaticMembersProcessor.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/MoveStaticMembersProcessor.java
index 9864462..fee0d88 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/MoveStaticMembersProcessor.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/MoveStaticMembersProcessor.java
@@ -47,28 +47,26 @@
import org.eclipse.text.edits.TextEdit;
import org.eclipse.text.edits.TextEditGroup;
import org.eclipse.wst.jsdt.core.Flags;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IField;
+import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IInitializer;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IMember;
-import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.ISourceRange;
import org.eclipse.wst.jsdt.core.IType;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.Modifier;
import org.eclipse.wst.jsdt.core.dom.SimpleName;
import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
@@ -158,15 +156,6 @@
return true;
}
- public boolean visit(AnnotationTypeDeclaration node) {
- fDefined.add(node.resolveBinding());
- return true;
- }
-
- public boolean visit(EnumDeclaration node) {
- fDefined.add(node.resolveBinding());
- return true;
- }
}
/**
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/PullUpRefactoringProcessor.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/PullUpRefactoringProcessor.java
index 007ca23..f42ae06 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/PullUpRefactoringProcessor.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/PullUpRefactoringProcessor.java
@@ -45,16 +45,15 @@
import org.eclipse.text.edits.MalformedTreeException;
import org.eclipse.text.edits.TextEdit;
import org.eclipse.wst.jsdt.core.Flags;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IField;
+import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IMember;
-import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IType;
import org.eclipse.wst.jsdt.core.ITypeHierarchy;
import org.eclipse.wst.jsdt.core.ITypeParameter;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.Signature;
import org.eclipse.wst.jsdt.core.dom.AST;
@@ -65,17 +64,16 @@
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.wst.jsdt.core.dom.Block;
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.Expression;
import org.eclipse.wst.jsdt.core.dom.FieldAccess;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.JSdoc;
-import org.eclipse.wst.jsdt.core.dom.MarkerAnnotation;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.Modifier;
import org.eclipse.wst.jsdt.core.dom.ReturnStatement;
import org.eclipse.wst.jsdt.core.dom.SimpleName;
@@ -970,11 +968,6 @@
private void createAbstractMethod(final IFunction sourceMethod, final CompilationUnitRewrite sourceRewriter, final JavaScriptUnit declaringCuNode, final AbstractTypeDeclaration destination, final TypeVariableMaplet[] mapping, final CompilationUnitRewrite targetRewrite, final Map adjustments, final IProgressMonitor monitor, final RefactoringStatus status) throws JavaScriptModelException {
final FunctionDeclaration oldMethod= ASTNodeSearchUtil.getMethodDeclarationNode(sourceMethod, declaringCuNode);
- if (JavaModelUtil.is50OrHigher(sourceMethod.getJavaScriptProject()) && (fSettings.overrideAnnotation || JavaScriptCore.ERROR.equals(sourceMethod.getJavaScriptProject().getOption(JavaScriptCore.COMPILER_PB_MISSING_OVERRIDE_ANNOTATION, true)))) {
- final MarkerAnnotation annotation= sourceRewriter.getAST().newMarkerAnnotation();
- annotation.setTypeName(sourceRewriter.getAST().newSimpleName("Override")); //$NON-NLS-1$
- sourceRewriter.getASTRewrite().getListRewrite(oldMethod, FunctionDeclaration.MODIFIERS2_PROPERTY).insertFirst(annotation, sourceRewriter.createCategorizedGroupDescription(RefactoringCoreMessages.PullUpRefactoring_add_override_annotation, SET_PULL_UP));
- }
final FunctionDeclaration newMethod= targetRewrite.getAST().newFunctionDeclaration();
newMethod.setBody(null);
newMethod.setConstructor(false);
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/PushDownRefactoringProcessor.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/PushDownRefactoringProcessor.java
index e5b9c49..4c95f89 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/PushDownRefactoringProcessor.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/PushDownRefactoringProcessor.java
@@ -38,12 +38,12 @@
import org.eclipse.text.edits.MalformedTreeException;
import org.eclipse.text.edits.TextEdit;
import org.eclipse.wst.jsdt.core.Flags;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IField;
+import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IMember;
-import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IType;
import org.eclipse.wst.jsdt.core.ITypeHierarchy;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
@@ -52,11 +52,10 @@
import org.eclipse.wst.jsdt.core.dom.ASTRequestor;
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.Block;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.Expression;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
-import org.eclipse.wst.jsdt.core.dom.MarkerAnnotation;
import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.Modifier;
import org.eclipse.wst.jsdt.core.dom.Type;
import org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment;
@@ -86,13 +85,11 @@
import org.eclipse.wst.jsdt.internal.corext.refactoring.rename.MethodChecks;
import org.eclipse.wst.jsdt.internal.corext.refactoring.util.ResourceUtil;
import org.eclipse.wst.jsdt.internal.corext.refactoring.util.TextEditBasedChangeManager;
-import org.eclipse.wst.jsdt.internal.corext.util.JavaModelUtil;
import org.eclipse.wst.jsdt.internal.corext.util.JdtFlags;
import org.eclipse.wst.jsdt.internal.corext.util.Messages;
import org.eclipse.wst.jsdt.internal.corext.util.SearchUtils;
import org.eclipse.wst.jsdt.internal.corext.util.Strings;
import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
-import org.eclipse.wst.jsdt.internal.ui.preferences.JavaPreferencesSettings;
import org.eclipse.wst.jsdt.ui.JavaScriptElementLabels;
/**
@@ -795,11 +792,6 @@
if (info.copyJavadocToCopiesInSubclasses())
copyJavadocNode(rewrite, method, oldMethod, newMethod);
final IJavaScriptProject project= rewriter.getCu().getJavaScriptProject();
- if (info.isNewMethodToBeDeclaredAbstract() && JavaModelUtil.is50OrHigher(project) && JavaPreferencesSettings.getCodeGenerationSettings(project).overrideAnnotation) {
- final MarkerAnnotation annotation= ast.newMarkerAnnotation();
- annotation.setTypeName(ast.newSimpleName("Override")); //$NON-NLS-1$
- newMethod.modifiers().add(annotation);
- }
copyAnnotations(oldMethod, newMethod);
newMethod.modifiers().addAll(ASTNodeFactory.newModifiers(ast, info.getNewModifiersForCopyInSubclass(oldMethod.getModifiers())));
newMethod.setName(ast.newSimpleName(oldMethod.getName().getIdentifier()));
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ReferenceAnalyzer.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ReferenceAnalyzer.java
index f7af02d..b7704fe 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ReferenceAnalyzer.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/ReferenceAnalyzer.java
@@ -10,18 +10,16 @@
*******************************************************************************/
package org.eclipse.wst.jsdt.internal.corext.refactoring.structure;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.FieldAccess;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
+import org.eclipse.wst.jsdt.core.dom.FunctionRef;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
import org.eclipse.wst.jsdt.core.dom.MemberRef;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
-import org.eclipse.wst.jsdt.core.dom.FunctionRef;
import org.eclipse.wst.jsdt.core.dom.QualifiedName;
import org.eclipse.wst.jsdt.core.dom.SimpleName;
import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
@@ -131,15 +129,4 @@
return false;
}
- public boolean visit(AnnotationTypeDeclaration node) {
- if (isMovedMember(node.resolveBinding()))
- return false;
- return super.visit(node);
- }
-
- public boolean visit(EnumDeclaration node) {
- if (isMovedMember(node.resolveBinding()))
- return false;
- return super.visit(node);
- }
}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/constraints/SuperTypeConstraintsCreator.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/constraints/SuperTypeConstraintsCreator.java
index 35fff85..f75198b 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/constraints/SuperTypeConstraintsCreator.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/structure/constraints/SuperTypeConstraintsCreator.java
@@ -19,7 +19,6 @@
import org.eclipse.core.runtime.Assert;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.wst.jsdt.core.dom.ArrayAccess;
import org.eclipse.wst.jsdt.core.dom.ArrayCreation;
@@ -35,14 +34,14 @@
import org.eclipse.wst.jsdt.core.dom.Expression;
import org.eclipse.wst.jsdt.core.dom.FieldAccess;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
import org.eclipse.wst.jsdt.core.dom.InstanceofExpression;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
import org.eclipse.wst.jsdt.core.dom.Name;
import org.eclipse.wst.jsdt.core.dom.NullLiteral;
import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
@@ -729,12 +728,7 @@
return originals;
}
- /*
- * @see org.eclipse.wst.jsdt.internal.corext.dom.HierarchicalASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration)
- */
- public final boolean visit(final AnnotationTypeDeclaration node) {
- return false;
- }
+
/*
* @see org.eclipse.wst.jsdt.internal.corext.dom.HierarchicalASTVisitor#visit(org.eclipse.wst.jsdt.core.dom.Comment)
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/util/AbstractExceptionAnalyzer.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/util/AbstractExceptionAnalyzer.java
index 154522b..4d4a86c 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/util/AbstractExceptionAnalyzer.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/util/AbstractExceptionAnalyzer.java
@@ -16,13 +16,11 @@
import java.util.Stack;
import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.wst.jsdt.core.dom.CatchClause;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
+import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.ThrowStatement;
import org.eclipse.wst.jsdt.core.dom.TryStatement;
import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
@@ -51,19 +49,6 @@
return true;
}
- public boolean visit(EnumDeclaration node) {
- // Don't dive into a local type.
- if (node.isLocalTypeDeclaration())
- return false;
- return true;
- }
-
- public boolean visit(AnnotationTypeDeclaration node) {
- // Don't dive into a local type.
- if (node.isLocalTypeDeclaration())
- return false;
- return true;
- }
public boolean visit(AnonymousClassDeclaration node) {
// Don't dive into a local type.
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/CodeFormatterUtil.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/CodeFormatterUtil.java
index 61b0afd..2c4f845 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/CodeFormatterUtil.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/CodeFormatterUtil.java
@@ -305,11 +305,6 @@
suffix= ";"; //$NON-NLS-1$
code= CodeFormatter.K_STATEMENTS;
break;
- case ASTNode.MEMBER_VALUE_PAIR:
- prefix= "@Author("; //$NON-NLS-1$
- suffix= ") class x {}"; //$NON-NLS-1$
- code= CodeFormatter.K_JAVASCRIPT_UNIT;
- break;
case ASTNode.MODIFIER:
suffix= " class x {}"; //$NON-NLS-1$
code= CodeFormatter.K_JAVASCRIPT_UNIT;
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/JdtFlags.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/JdtFlags.java
index 1182bbb..e7c29ff 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/JdtFlags.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/JdtFlags.java
@@ -12,12 +12,11 @@
import org.eclipse.core.runtime.Assert;
import org.eclipse.wst.jsdt.core.Flags;
+import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IMember;
-import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IType;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
@@ -205,8 +204,7 @@
private static boolean isInterfaceOrAnnotationMember(BodyDeclaration bodyDeclaration) {
boolean isInterface= (bodyDeclaration.getParent() instanceof TypeDeclaration) &&
((TypeDeclaration)bodyDeclaration.getParent()).isInterface();
- boolean isAnnotation= bodyDeclaration.getParent() instanceof AnnotationTypeDeclaration;
- return isInterface || isAnnotation;
+ return isInterface ;
}
private static boolean isNestedInterfaceOrAnnotation(IMember member) throws JavaScriptModelException{
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/JavaScriptPlugin.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/JavaScriptPlugin.java
index adcb721..0867497 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/JavaScriptPlugin.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/JavaScriptPlugin.java
@@ -74,7 +74,6 @@
import org.eclipse.wst.jsdt.internal.ui.javaeditor.saveparticipant.SaveParticipantRegistry;
import org.eclipse.wst.jsdt.internal.ui.preferences.MembersOrderPreferenceCache;
import org.eclipse.wst.jsdt.internal.ui.preferences.formatter.FormatterProfileStore;
-import org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor.PropertiesFileDocumentProvider;
import org.eclipse.wst.jsdt.internal.ui.text.PreferencesAdapter;
import org.eclipse.wst.jsdt.internal.ui.text.folding.JavaFoldingStructureProviderRegistry;
import org.eclipse.wst.jsdt.internal.ui.text.java.ContentAssistHistory;
@@ -590,18 +589,7 @@
return fCompilationUnitDocumentProvider;
}
- /**
- * Returns the shared document provider for Java properties files
- * used by this plug-in instance.
- *
- * @return the shared document provider for Java properties files
- * @since 3.1
- */
- public synchronized IDocumentProvider getPropertiesFileDocumentProvider() {
- if (fPropertiesFileDocumentProvider == null)
- fPropertiesFileDocumentProvider= new PropertiesFileDocumentProvider();
- return fPropertiesFileDocumentProvider;
- }
+
public synchronized ClassFileDocumentProvider getClassFileDocumentProvider() {
if (fClassFileDocumentProvider == null)
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/CopyQualifiedNameAction.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/CopyQualifiedNameAction.java
index db3df72..61f90ce 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/CopyQualifiedNameAction.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/actions/CopyQualifiedNameAction.java
@@ -31,23 +31,22 @@
import org.eclipse.ui.IWorkbenchSite;
import org.eclipse.ui.part.ResourceTransfer;
import org.eclipse.wst.jsdt.core.IClassFile;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IImportDeclaration;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IMember;
import org.eclipse.wst.jsdt.core.IPackageDeclaration;
import org.eclipse.wst.jsdt.core.IPackageFragment;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.Expression;
-import org.eclipse.wst.jsdt.core.dom.IBinding;
-import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
-import org.eclipse.wst.jsdt.core.dom.MemberRef;
-import org.eclipse.wst.jsdt.core.dom.MemberValuePair;
import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
+import org.eclipse.wst.jsdt.core.dom.IBinding;
+import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
+import org.eclipse.wst.jsdt.core.dom.MemberRef;
import org.eclipse.wst.jsdt.core.dom.Name;
import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
import org.eclipse.wst.jsdt.core.dom.Type;
@@ -55,8 +54,8 @@
import org.eclipse.wst.jsdt.core.dom.TypeParameter;
import org.eclipse.wst.jsdt.core.dom.VariableDeclaration;
import org.eclipse.wst.jsdt.internal.corext.dom.NodeFinder;
-import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
import org.eclipse.wst.jsdt.internal.ui.JavaPluginImages;
+import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
import org.eclipse.wst.jsdt.internal.ui.javaeditor.ASTProvider;
import org.eclipse.wst.jsdt.internal.ui.javaeditor.JavaEditor;
import org.eclipse.wst.jsdt.ui.JavaScriptElementLabels;
@@ -260,8 +259,6 @@
binding= ((ImportDeclaration)node).resolveBinding();
} else if (node instanceof MemberRef) {
binding= ((MemberRef)node).resolveBinding();
- } else if (node instanceof MemberValuePair) {
- binding= ((MemberValuePair)node).resolveMemberValuePairBinding();
} else if (node instanceof PackageDeclaration) {
binding= ((PackageDeclaration)node).resolveBinding();
} else if (node instanceof TypeParameter) {
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaAddElementFromHistoryImpl.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaAddElementFromHistoryImpl.java
index 6e8538f..0214332 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaAddElementFromHistoryImpl.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaAddElementFromHistoryImpl.java
@@ -35,18 +35,15 @@
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorInput;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IMember;
import org.eclipse.wst.jsdt.core.IParent;
import org.eclipse.wst.jsdt.core.IType;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.rewrite.ASTRewrite;
@@ -182,16 +179,11 @@
} else if (parent instanceof IType) {
ASTNode declaration= getBodyContainer(root, (IType)parent);
- if (declaration instanceof TypeDeclaration || declaration instanceof AnnotationTypeDeclaration) {
+ if (declaration instanceof TypeDeclaration) {
List container= ASTNodes.getBodyDeclarations(declaration);
int index= ASTNodes.getInsertionIndex((BodyDeclaration)newNode, container);
ListRewrite lw= rewriter.getListRewrite(declaration, ASTNodes.getBodyDeclarationsProperty(declaration));
lw.insertAt(newNode, index, null);
- } else if (declaration instanceof EnumDeclaration) {
- List container= ((EnumDeclaration)declaration).enumConstants();
- int index= ASTNodes.getInsertionIndex((FieldDeclaration)newNode, container);
- ListRewrite lw= rewriter.getListRewrite(declaration, EnumDeclaration.ENUM_CONSTANTS_PROPERTY);
- lw.insertAt(newNode, index, null);
}
} else {
JavaScriptPlugin.logErrorMessage("JavaAddElementFromHistoryImpl: unknown container " + parent); //$NON-NLS-1$
@@ -267,12 +259,6 @@
case JavaNode.INTERFACE:
return ASTNode.TYPE_DECLARATION;
- case JavaNode.ENUM:
- return ASTNode.ENUM_DECLARATION;
-
- case JavaNode.ANNOTATION:
- return ASTNode.ANNOTATION_TYPE_DECLARATION;
-
case JavaNode.CONSTRUCTOR:
case JavaNode.METHOD:
return ASTNode.FUNCTION_DECLARATION;
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaHistoryActionImpl.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaHistoryActionImpl.java
index cc72fdb..2d35a42 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaHistoryActionImpl.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaHistoryActionImpl.java
@@ -41,18 +41,16 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IMember;
import org.eclipse.wst.jsdt.core.ISourceRange;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.dom.AST;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ASTParser;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.rewrite.ASTRewrite;
import org.eclipse.wst.jsdt.internal.corext.dom.NodeFinder;
@@ -125,7 +123,7 @@
ISourceRange sourceRange= parent.getNameRange();
ASTNode parentNode= NodeFinder.perform(root, sourceRange);
do {
- if (parentNode instanceof TypeDeclaration || parentNode instanceof EnumDeclaration || parentNode instanceof AnnotationTypeDeclaration)
+ if (parentNode instanceof TypeDeclaration )
return parentNode;
parentNode= parentNode.getParent();
} while (parentNode != null);
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaParseTreeBuilder.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaParseTreeBuilder.java
index b45750e..64a25ef 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaParseTreeBuilder.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaParseTreeBuilder.java
@@ -15,15 +15,11 @@
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeMemberDeclaration;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
import org.eclipse.wst.jsdt.core.dom.Initializer;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
import org.eclipse.wst.jsdt.core.dom.SimpleName;
import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
@@ -75,32 +71,9 @@
pop();
}
- public boolean visit(EnumDeclaration node) {
- push(JavaNode.ENUM, node.getName().toString(), node.getStartPosition(), node.getLength());
- return true;
- }
-
- public void endVisit(EnumDeclaration node) {
- pop();
- }
+
- public boolean visit(AnnotationTypeDeclaration node) {
- push(JavaNode.ANNOTATION, node.getName().toString(), node.getStartPosition(), node.getLength());
- return true;
- }
-
- public void endVisit(AnnotationTypeDeclaration node) {
- pop();
- }
- public boolean visit(AnnotationTypeMemberDeclaration node) {
- push(JavaNode.METHOD, getSignature(node), node.getStartPosition(), node.getLength());
- return true;
- }
-
- public void endVisit(AnnotationTypeMemberDeclaration node) {
- pop();
- }
public boolean visit(FunctionDeclaration node) {
String signature= getSignature(node);
@@ -147,15 +120,6 @@
pop();
}
- public boolean visit(EnumConstantDeclaration node) {
- push(JavaNode.FIELD, node.getName().toString(), node.getStartPosition(), node.getLength());
- return false;
- }
-
- public void endVisit(EnumConstantDeclaration node) {
- pop();
- }
-
// private stuff
/**
@@ -230,13 +194,6 @@
return buffer.toString();
}
- private String getSignature(AnnotationTypeMemberDeclaration node) {
- StringBuffer buffer= new StringBuffer();
- buffer.append(node.getName().toString());
- buffer.append('(');
- buffer.append(')');
- return buffer.toString();
- }
private String getType(Type type) {
String name= type.toString();
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaReplaceWithEditionActionImpl.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaReplaceWithEditionActionImpl.java
index 23c707d..74c5605 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaReplaceWithEditionActionImpl.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaReplaceWithEditionActionImpl.java
@@ -34,16 +34,14 @@
import org.eclipse.team.core.TeamException;
import org.eclipse.team.ui.history.ElementLocalHistoryPageSource;
import org.eclipse.team.ui.history.HistoryPageCompareEditorInput;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IMember;
import org.eclipse.wst.jsdt.core.ISourceRange;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.rewrite.ASTRewrite;
import org.eclipse.wst.jsdt.internal.corext.SourceRange;
import org.eclipse.wst.jsdt.internal.corext.dom.ASTNodes;
@@ -183,10 +181,6 @@
length= 1;
ASTNode node2= NodeFinder.perform(root, new SourceRange(nameRange.getOffset(), length));
ASTNode node= ASTNodes.getParent(node2, BodyDeclaration.class);
- if (node == null)
- node= ASTNodes.getParent(node2, AnnotationTypeDeclaration.class);
- if (node == null)
- node= ASTNodes.getParent(node2, EnumDeclaration.class);
//ASTNode node= getBodyContainer(root, input);
if (node == null) {
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaTextBufferNode.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaTextBufferNode.java
index bf2263e..8c10752 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaTextBufferNode.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/JavaTextBufferNode.java
@@ -110,11 +110,6 @@
case JavaNode.INTERFACE:
return ASTNode.TYPE_DECLARATION;
- case JavaNode.ENUM:
- return ASTNode.ENUM_DECLARATION;
-
- case JavaNode.ANNOTATION:
- return ASTNode.ANNOTATION_TYPE_DECLARATION;
case JavaNode.CONSTRUCTOR:
case JavaNode.METHOD:
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/PropertiesFileMergeViewer.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/PropertiesFileMergeViewer.java
deleted file mode 100644
index de31f73..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/PropertiesFileMergeViewer.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.compare;
-
-import org.eclipse.compare.CompareConfiguration;
-import org.eclipse.compare.contentmergeviewer.TextMergeViewer;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jface.text.TextViewer;
-import org.eclipse.jface.text.rules.FastPartitioner;
-import org.eclipse.jface.text.source.SourceViewer;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
-import org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor.IPropertiesFilePartitions;
-import org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor.PropertiesFilePartitionScanner;
-import org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor.PropertiesFileSourceViewerConfiguration;
-import org.eclipse.wst.jsdt.ui.text.JavaScriptTextTools;
-
-/**
- * Properties file merge viewer.
- *
- * @since 3.1
- */
-public class PropertiesFileMergeViewer extends TextMergeViewer {
-
- /**
- * Creates a properties file merge viewer under the given parent control.
- *
- * @param parent the parent control
- * @param configuration the configuration object
- */
- public PropertiesFileMergeViewer(Composite parent, CompareConfiguration configuration) {
- super(parent, SWT.LEFT_TO_RIGHT, configuration);
- }
-
- /*
- * @see org.eclipse.compare.contentmergeviewer.TextMergeViewer#configureTextViewer(org.eclipse.jface.text.TextViewer)
- */
- protected void configureTextViewer(TextViewer textViewer) {
- if (textViewer instanceof SourceViewer) {
- JavaScriptTextTools tools= JavaCompareUtilities.getJavaTextTools();
- if (tools != null)
- ((SourceViewer)textViewer).configure(getSourceViewerConfiguration(tools));
- }
- }
-
- private SourceViewerConfiguration getSourceViewerConfiguration(JavaScriptTextTools textTools) {
- IPreferenceStore store= JavaScriptPlugin.getDefault().getCombinedPreferenceStore();
- return new PropertiesFileSourceViewerConfiguration(textTools.getColorManager(), store, null, getDocumentPartitioning());
- }
-
- /*
- * @see org.eclipse.compare.contentmergeviewer.TextMergeViewer#getDocumentPartitioner()
- */
- protected IDocumentPartitioner getDocumentPartitioner() {
- return new FastPartitioner(new PropertiesFilePartitionScanner(), IPropertiesFilePartitions.PARTITIONS);
- }
-
- /*
- * @see org.eclipse.compare.contentmergeviewer.TextMergeViewer#getDocumentPartitioning()
- * @since 3.3
- */
- protected String getDocumentPartitioning() {
- return IPropertiesFilePartitions.PROPERTIES_FILE_PARTITIONING;
- }
-
- /*
- * @see org.eclipse.compare.contentmergeviewer.ContentMergeViewer#getTitle()
- */
- public String getTitle() {
- return CompareMessages.PropertiesFileMergeViewer_title;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/PropertiesFileMergeViewerCreator.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/PropertiesFileMergeViewerCreator.java
deleted file mode 100644
index 34f166b..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/PropertiesFileMergeViewerCreator.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.compare;
-
-import org.eclipse.compare.CompareConfiguration;
-import org.eclipse.compare.IViewerCreator;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * A factory object for the {@link org.eclipse.wst.jsdt.internal.ui.compare.PropertiesFileMergeViewer}.
- * This indirection is necessary because only objects with a default
- * constructor can be created via an extension point
- * (this precludes Viewers).
- *
- * @since 3.1
- */
-public class PropertiesFileMergeViewerCreator implements IViewerCreator {
-
- public Viewer createViewer(Composite parent, CompareConfiguration mp) {
- return new PropertiesFileMergeViewer(parent, mp);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/PropertiesFileViewer.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/PropertiesFileViewer.java
deleted file mode 100644
index b099bdb..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/PropertiesFileViewer.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.compare;
-
-import org.eclipse.compare.IStreamContentAccessor;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.source.SourceViewer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
-import org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor.IPropertiesFilePartitions;
-import org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor.PropertiesFileSourceViewerConfiguration;
-import org.eclipse.wst.jsdt.ui.text.JavaScriptTextTools;
-
-/**
- * Properties file viewer.
- *
- * @since 3.1
- */
-public class PropertiesFileViewer extends Viewer {
-
- private SourceViewer fSourceViewer;
- private Object fInput;
-
-
- PropertiesFileViewer(Composite parent) {
- fSourceViewer= new SourceViewer(parent, null, SWT.LEFT_TO_RIGHT | SWT.H_SCROLL | SWT.V_SCROLL);
- JavaScriptTextTools tools= JavaCompareUtilities.getJavaTextTools();
- if (tools != null) {
- IPreferenceStore store= JavaScriptPlugin.getDefault().getCombinedPreferenceStore();
- fSourceViewer.configure(new PropertiesFileSourceViewerConfiguration(tools.getColorManager(), store, null, IPropertiesFilePartitions.PROPERTIES_FILE_PARTITIONING));
- }
-
- fSourceViewer.setEditable(false);
-
- String symbolicFontName= PropertiesFileMergeViewer.class.getName();
- Font font= JFaceResources.getFont(symbolicFontName);
- if (font != null)
- fSourceViewer.getTextWidget().setFont(font);
- }
-
- public Control getControl() {
- return fSourceViewer.getControl();
- }
-
- public void setInput(Object input) {
- if (input instanceof IStreamContentAccessor) {
- Document document= new Document(getString(input));
-// JavaCompareUtilities.setupPropertiesFileDocument(document);
- fSourceViewer.setDocument(document);
- }
- fInput= input;
- }
-
- public Object getInput() {
- return fInput;
- }
-
- public ISelection getSelection() {
- return null;
- }
-
- public void setSelection(ISelection s, boolean reveal) {
- }
-
- public void refresh() {
- }
-
- /**
- * A helper method to retrieve the contents of the given object
- * if it implements the IStreamContentAccessor interface.
- */
- private static String getString(Object input) {
-
- if (input instanceof IStreamContentAccessor) {
- IStreamContentAccessor sca= (IStreamContentAccessor) input;
- try {
- return JavaCompareUtilities.readString(sca);
- } catch (CoreException ex) {
- JavaScriptPlugin.log(ex);
- }
- }
- return ""; //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/PropertiesFileViewerCreator.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/PropertiesFileViewerCreator.java
deleted file mode 100644
index b3b28ec..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/PropertiesFileViewerCreator.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.compare;
-
-import org.eclipse.compare.CompareConfiguration;
-import org.eclipse.compare.IViewerCreator;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * A factory object for the {@link org.eclipse.wst.jsdt.internal.ui.compare.PropertiesFileViewer}.
- * This indirection is necessary because only objects with a default
- * constructor can be created via an extension point
- * (this precludes Viewers).
- *
- * @since 3.1
- */
-public class PropertiesFileViewerCreator implements IViewerCreator {
-
- public Viewer createViewer(Composite parent, CompareConfiguration mp) {
- return new PropertiesFileViewer(parent);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/PropertiesStructureCreator.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/PropertiesStructureCreator.java
deleted file mode 100644
index 18cf400..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/compare/PropertiesStructureCreator.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.compare;
-
-import java.io.IOException;
-
-import org.eclipse.compare.CompareUI;
-import org.eclipse.compare.IEditableContent;
-import org.eclipse.compare.ISharedDocumentAdapter;
-import org.eclipse.compare.IStreamContentAccessor;
-import org.eclipse.compare.ITypedElement;
-import org.eclipse.compare.structuremergeviewer.DocumentRangeNode;
-import org.eclipse.compare.structuremergeviewer.IStructureComparator;
-import org.eclipse.compare.structuremergeviewer.StructureCreator;
-import org.eclipse.compare.structuremergeviewer.StructureRootNode;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.rules.FastPartitioner;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
-import org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor.IPropertiesFilePartitions;
-import org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor.PropertiesFilePartitionScanner;
-
-
-public class PropertiesStructureCreator extends StructureCreator {
-
- /**
- * A PropertyNode represents a key/value pair of a Java property file.
- * The text range of a leg/value pair starts with an optional
- * comment and ends right after the value.
- */
- static class PropertyNode extends DocumentRangeNode implements ITypedElement, IAdaptable {
-
- public PropertyNode(DocumentRangeNode parent, int type, String id, String value, IDocument doc, int start, int length) {
- super(parent, type, id, doc, start, length);
- if (parent != null) {
- parent.addChild(this);
- }
- }
-
- /* (non Java doc)
- * see ITypedElement#getName
- */
- public String getName() {
- return getId();
- }
-
- /* (non Java doc)
- * see ITypedElement#getType
- */
- public String getType() {
- return "properties2"; //$NON-NLS-1$
- }
-
- /* (non Java doc)
- * see ITypedElement#getImage
- */
- public Image getImage() {
- return CompareUI.getImage(getType());
- }
- }
-
- private static final String WHITESPACE= " \t\r\n\f"; //$NON-NLS-1$
- private static final String SEPARATORS= "=:"; //$NON-NLS-1$
- private static final String SEPARATORS2= SEPARATORS + WHITESPACE;
-
-
- public PropertiesStructureCreator() {
- }
-
- public String getName() {
- return CompareMessages.PropertyCompareViewer_title;
- }
-
- protected IStructureComparator createStructureComparator(Object input,
- IDocument document, ISharedDocumentAdapter sharedDocumentAdapter,
- IProgressMonitor monitor) throws CoreException {
-
- final boolean isEditable;
- if (input instanceof IEditableContent)
- isEditable= ((IEditableContent) input).isEditable();
- else
- isEditable= false;
-
- DocumentRangeNode root= new StructureRootNode(document, input, this, sharedDocumentAdapter) {
- public boolean isEditable() {
- return isEditable;
- }
- };
-
- try {
- monitor = beginWork(monitor);
- parsePropertyFile(root, document, monitor);
- } catch (IOException ex) {
- if (sharedDocumentAdapter != null)
- sharedDocumentAdapter.disconnect(input);
- throw new CoreException(new Status(IStatus.ERROR, JavaScriptPlugin.getPluginId(), 0, CompareMessages.PropertiesStructureCreator_error_occurred, ex));
- } finally {
- monitor.done();
- }
-
- return root;
- }
-
- public IStructureComparator locate(Object path, Object source) {
- return null;
- }
-
- public String getContents(Object node, boolean ignoreWhitespace) {
- if (node instanceof IStreamContentAccessor) {
- IStreamContentAccessor sca= (IStreamContentAccessor) node;
- try {
- return JavaCompareUtilities.readString(sca);
- } catch (CoreException ex) {
- JavaScriptPlugin.log(ex);
- }
- }
- return null;
- }
-
- private String readLine(int[] args, IDocument doc) {
- int line= args[0]++;
- try {
- IRegion region= doc.getLineInformation(line);
- int start= region.getOffset();
- int length= region.getLength();
-
- try {
- region= doc.getLineInformation(line+1);
- args[1]= region.getOffset();
- } catch (BadLocationException ex) {
- args[1]= doc.getLength();
- }
-
- return doc.get(start, length);
- } catch (BadLocationException ex) {
- // silently ignored
- }
- return null;
- }
-
- private void parsePropertyFile(DocumentRangeNode root, IDocument doc, IProgressMonitor monitor) throws IOException {
-
- int start= -1;
- int lineStart= 0;
-
- int[] args= new int[2];
- args[0]= 0; // here we return the line number
- args[1]= 0; // and here the offset of the first character of the line
-
- for (;;) {
- worked(monitor);
- lineStart= args[1]; // start of current line
- String line= readLine(args, doc);
- if (line == null)
- return;
-
- if (line.length() <= 0)
- continue; // empty line
-
- char firstChar= line.charAt(0);
- if (firstChar == '#' || firstChar == '!') {
- if (start < 0) // comment belongs to next key/value pair
- start= lineStart;
- continue; // comment
- }
-
- // find continuation lines
- while (needNextLine(line)) {
- String nextLine= readLine(args, doc);
- if (nextLine == null)
- nextLine= ""; //$NON-NLS-1$
- String line2= line.substring(0, line.length()-1);
- int startPos= 0;
- for (; startPos < nextLine.length(); startPos++)
- if (WHITESPACE.indexOf(nextLine.charAt(startPos)) == -1)
- break;
- nextLine= nextLine.substring(startPos, nextLine.length());
- line= line2 + nextLine;
- }
-
- // key start
- int len= line.length();
- int keyPos= 0;
- for (; keyPos < len; keyPos++) {
- if (WHITESPACE.indexOf(line.charAt(keyPos)) == -1)
- break;
- }
-
- // key/value separator
- int separatorPos;
- for (separatorPos= keyPos; separatorPos < len; separatorPos++) {
- char c= line.charAt(separatorPos);
- if (c == '\\')
- separatorPos++;
- else if (SEPARATORS2.indexOf(c) != -1)
- break;
- }
-
- int valuePos;
- for (valuePos= separatorPos; valuePos < len; valuePos++)
- if (WHITESPACE.indexOf(line.charAt(valuePos)) == -1)
- break;
-
- if (valuePos < len)
- if (SEPARATORS.indexOf(line.charAt(valuePos)) != -1)
- valuePos++;
-
- while (valuePos < len) {
- if (WHITESPACE.indexOf(line.charAt(valuePos)) == -1)
- break;
- valuePos++;
- }
-
- String key= convert(line.substring(keyPos, separatorPos));
- if (key.length() > 0) {
-
- if (start < 0)
- start= lineStart;
-
- String value= ""; //$NON-NLS-1$
- if (separatorPos < len)
- value= convert(line.substring(valuePos, len));
-
- int length= args[1] - start;
-
- try {
- String s= doc.get(start, length);
- for (int i= s.length()-1; i >= 0; i--) {
- char c= s.charAt(i);
- if (c !='\r' && c != '\n')
- break;
- length--;
- }
- } catch (BadLocationException e) {
- // silently ignored
- }
-
- new PropertyNode(root, 0, key, value, doc, start, length);
- start= -1;
- }
- }
- }
-
- private boolean needNextLine(String line) {
- int slashes= 0;
- int ix= line.length() - 1;
- while ((ix >= 0) && (line.charAt(ix--) == '\\'))
- slashes++;
- return slashes % 2 == 1;
- }
-
- /*
- * Converts escaped characters to Unicode.
- */
- private String convert(String s) {
- int l= s.length();
- StringBuffer buf= new StringBuffer(l);
- int i= 0;
-
- while (i < l) {
- char c= s.charAt(i++);
- if (c == '\\') {
- c= s.charAt(i++);
- if (c == 'u') {
- int v= 0;
- for (int j= 0; j < 4; j++) {
- c= s.charAt(i++);
- switch (c) {
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- v= (v << 4) + (c-'0');
- break;
- case 'a': case 'b': case 'c':
- case 'd': case 'e': case 'f':
- v= (v << 4) + 10+(c-'a');
- break;
- case 'A': case 'B': case 'C':
- case 'D': case 'E': case 'F':
- v= (v << 4) + 10+(c - 'A');
- break;
- default:
- throw new IllegalArgumentException(CompareMessages.PropertyCompareViewer_malformedEncoding);
- }
- }
- buf.append((char)v);
- } else {
- switch (c) {
- case 't':
- c= '\t';
- break;
- case 'r':
- c= '\r';
- break;
- case 'n':
- c= '\n';
- break;
- case 'f':
- c= '\f';
- break;
- }
- buf.append(c);
- }
- } else
- buf.append(c);
- }
- return buf.toString();
- }
-
- protected IDocumentPartitioner getDocumentPartitioner() {
- return new FastPartitioner(new PropertiesFilePartitionScanner(), IPropertiesFilePartitions.PARTITIONS);
- }
-
- protected String getDocumentPartitioning() {
- return IPropertiesFilePartitions.PROPERTIES_FILE_PARTITIONING;
- }
-
- private void worked(IProgressMonitor monitor) {
- if (monitor.isCanceled())
- throw new OperationCanceledException();
- monitor.worked(1);
- }
-
- private IProgressMonitor beginWork(IProgressMonitor monitor) {
- if (monitor == null)
- return new NullProgressMonitor();
- return new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/JavaTextSelection.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/JavaTextSelection.java
index b9e8058..ed1f305 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/JavaTextSelection.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/JavaTextSelection.java
@@ -12,12 +12,11 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.TextSelection;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeMemberDeclaration;
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
@@ -196,10 +195,6 @@
((SingleVariableDeclaration)node).getInitializer() == last) {
fInVariableInitializer= true;
break;
- } else if (nodeType == ASTNode.ANNOTATION_TYPE_MEMBER_DECLARATION &&
- ((AnnotationTypeMemberDeclaration)node).getDefault() == last) {
- fInVariableInitializer= true;
- break;
}
last= node;
node= node.getParent();
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/NLSKeyHyperlink.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/NLSKeyHyperlink.java
index 5ba41d3..1d444e1 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/NLSKeyHyperlink.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/NLSKeyHyperlink.java
@@ -12,28 +12,17 @@
import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.BadPartitioningException;
-import org.eclipse.jface.text.FindReplaceDocumentAdapter;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension3;
import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITypedRegion;
import org.eclipse.jface.text.hyperlink.IHyperlink;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.texteditor.IEditorStatusLine;
-import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.internal.corext.refactoring.nls.AccessorClassReference;
import org.eclipse.wst.jsdt.internal.corext.refactoring.nls.NLSHintHelper;
-import org.eclipse.wst.jsdt.internal.corext.refactoring.nls.PropertyFileDocumentModel;
import org.eclipse.wst.jsdt.internal.corext.util.Messages;
-import org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor.IPropertiesFilePartitions;
-import org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor.PropertyKeyHyperlinkDetector;
/**
@@ -103,60 +92,60 @@
return;
}
- // Reveal the key in the properties file
- if (editor instanceof ITextEditor) {
- IRegion region= null;
- boolean found= false;
-
- // Find key in document
- IEditorInput editorInput= editor.getEditorInput();
- IDocument document= ((ITextEditor)editor).getDocumentProvider().getDocument(editorInput);
- if (document != null) {
- FindReplaceDocumentAdapter finder= new FindReplaceDocumentAdapter(document);
- PropertyKeyHyperlinkDetector detector= new PropertyKeyHyperlinkDetector();
- detector.setContext(editor);
- String key= PropertyFileDocumentModel.unwindEscapeChars(fKeyName);
- int offset= document.getLength() - 1;
- try {
- while (!found && offset >= 0) {
- region= finder.find(offset, key, false, true, false, false);
- if (region == null)
- offset= -1;
- else {
- // test whether it's the key
- IHyperlink[] hyperlinks= detector.detectHyperlinks(null, region, false);
- if (hyperlinks != null) {
- for (int i= 0; i < hyperlinks.length; i++) {
- IRegion hyperlinkRegion= hyperlinks[i].getHyperlinkRegion();
- found= key.equals(document.get(hyperlinkRegion.getOffset(), hyperlinkRegion.getLength()));
- }
- } else if (document instanceof IDocumentExtension3) {
- // Fall back: test using properties file partitioning
- ITypedRegion partition= null;
- partition= ((IDocumentExtension3)document).getPartition(IPropertiesFilePartitions.PROPERTIES_FILE_PARTITIONING, region.getOffset(), false);
- found= IDocument.DEFAULT_CONTENT_TYPE.equals(partition.getType())
- && key.equals(document.get(partition.getOffset(), partition.getLength()).trim());
- }
- // Prevent endless loop (panic code, shouldn't be needed)
- if (offset == region.getOffset())
- offset= -1;
- else
- offset= region.getOffset();
- }
- }
- } catch (BadLocationException ex) {
- found= false;
- } catch (BadPartitioningException e1) {
- found= false;
- }
- }
- if (found)
- EditorUtility.revealInEditor(editor, region);
- else {
- EditorUtility.revealInEditor(editor, 0, 0);
- showErrorInStatusLine(editor, Messages.format(JavaEditorMessages.Editor_OpenPropertiesFile_error_keyNotFound, fKeyName));
- }
- }
+// // Reveal the key in the properties file
+// if (editor instanceof ITextEditor) {
+// IRegion region= null;
+// boolean found= false;
+//
+// // Find key in document
+// IEditorInput editorInput= editor.getEditorInput();
+// IDocument document= ((ITextEditor)editor).getDocumentProvider().getDocument(editorInput);
+// if (document != null) {
+// FindReplaceDocumentAdapter finder= new FindReplaceDocumentAdapter(document);
+// PropertyKeyHyperlinkDetector detector= new PropertyKeyHyperlinkDetector();
+// detector.setContext(editor);
+// String key= PropertyFileDocumentModel.unwindEscapeChars(fKeyName);
+// int offset= document.getLength() - 1;
+// try {
+// while (!found && offset >= 0) {
+// region= finder.find(offset, key, false, true, false, false);
+// if (region == null)
+// offset= -1;
+// else {
+// // test whether it's the key
+// IHyperlink[] hyperlinks= detector.detectHyperlinks(null, region, false);
+// if (hyperlinks != null) {
+// for (int i= 0; i < hyperlinks.length; i++) {
+// IRegion hyperlinkRegion= hyperlinks[i].getHyperlinkRegion();
+// found= key.equals(document.get(hyperlinkRegion.getOffset(), hyperlinkRegion.getLength()));
+// }
+// } else if (document instanceof IDocumentExtension3) {
+// // Fall back: test using properties file partitioning
+// ITypedRegion partition= null;
+// partition= ((IDocumentExtension3)document).getPartition(IPropertiesFilePartitions.PROPERTIES_FILE_PARTITIONING, region.getOffset(), false);
+// found= IDocument.DEFAULT_CONTENT_TYPE.equals(partition.getType())
+// && key.equals(document.get(partition.getOffset(), partition.getLength()).trim());
+// }
+// // Prevent endless loop (panic code, shouldn't be needed)
+// if (offset == region.getOffset())
+// offset= -1;
+// else
+// offset= region.getOffset();
+// }
+// }
+// } catch (BadLocationException ex) {
+// found= false;
+// } catch (BadPartitioningException e1) {
+// found= false;
+// }
+// }
+// if (found)
+// EditorUtility.revealInEditor(editor, region);
+// else {
+// EditorUtility.revealInEditor(editor, 0, 0);
+// showErrorInStatusLine(editor, Messages.format(JavaEditorMessages.Editor_OpenPropertiesFile_error_keyNotFound, fKeyName));
+// }
+// }
}
private void showErrorInStatusLine(IEditorPart editor, final String message) {
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/SemanticHighlightings.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/SemanticHighlightings.java
index 40183fa..c9c27e0 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/SemanticHighlightings.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/SemanticHighlightings.java
@@ -16,12 +16,11 @@
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeMemberDeclaration;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.ObjectLiteral;
import org.eclipse.wst.jsdt.core.dom.ObjectLiteralField;
import org.eclipse.wst.jsdt.core.dom.ParameterizedType;
@@ -473,7 +472,7 @@
*/
public boolean consumes(SemanticToken token) {
StructuralPropertyDescriptor location= token.getNode().getLocationInParent();
- return location == FunctionDeclaration.NAME_PROPERTY || location == AnnotationTypeMemberDeclaration.NAME_PROPERTY;
+ return location == FunctionDeclaration.NAME_PROPERTY ;
}
}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/ArgumentRule.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/ArgumentRule.java
deleted file mode 100644
index 4b2d0c7..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/ArgumentRule.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor;
-
-import org.eclipse.jface.text.rules.ICharacterScanner;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.IWordDetector;
-import org.eclipse.jface.text.rules.WordPatternRule;
-
-/**
- * A specific single line rule for arguments in a property value.
- * <p>
- * An argument is defined as '{', digit, {digit}, '}'
- * </p>
- *
- * @since 3.1
- */
-public final class ArgumentRule extends WordPatternRule {
-
- private static class ArgumentDetector implements IWordDetector {
-
- /*
- * @see IWordDetector#isWordStart
- */
- public boolean isWordStart(char c) {
- return '{' == c;
- }
-
- /*
- * @see IWordDetector#isWordPart
- */
- public boolean isWordPart(char c) {
- return c == '}' || Character.isDigit(c);
- }
- }
-
-
- private int fCount= 0;
-
- /**
- * Creates an argument rule for the given <code>token</code>.
- *
- * @param token the token to be returned on success
- */
- public ArgumentRule(IToken token) {
- super(new ArgumentDetector(), "{", "}", token); //$NON-NLS-1$//$NON-NLS-2$
- }
-
- /*
- * @see org.eclipse.jface.text.rules.WordPatternRule#endSequenceDetected(org.eclipse.jface.text.rules.ICharacterScanner)
- */
- protected boolean endSequenceDetected(ICharacterScanner scanner) {
- fCount++;
-
- if (scanner.read() == '}')
- return fCount > 2;
-
- scanner.unread();
- return super.endSequenceDetected(scanner);
- }
-
- /*
- * @see org.eclipse.jface.text.rules.PatternRule#sequenceDetected(org.eclipse.jface.text.rules.ICharacterScanner, char[], boolean)
- */
- protected boolean sequenceDetected(ICharacterScanner scanner, char[] sequence, boolean eofAllowed) {
- fCount= 0;
- return super.sequenceDetected(scanner, sequence, eofAllowed);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/ConstructedPropertiesFileEditorMessages.properties b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/ConstructedPropertiesFileEditorMessages.properties
deleted file mode 100644
index 260a6db..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/ConstructedPropertiesFileEditorMessages.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2007 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-CorrectionAssistProposal.label=&Quick Fix
-CorrectionAssistProposal.tooltip=Quick Fix
-CorrectionAssistProposal.description=Quick Fix
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/IPropertiesFileEditorActionConstants.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/IPropertiesFileEditorActionConstants.java
deleted file mode 100644
index beaf626..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/IPropertiesFileEditorActionConstants.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor;
-
-/**
- * Defines action IDs for private JavaEditor actions.
- *
- * @since 3.1
- */
-public interface IPropertiesFileEditorActionConstants {
-
- /**
- * ID of the action to toggle smart typing.
- * Value: <code>"smartTyping"</code>
- * @since 3.0
- */
- public static final String TOGGLE_SMART_TYPING= "smartTyping"; //$NON-NLS-1$
-
- /**
- * ID of the smart typing status item
- * Value: <code>"SmartTyping"</code>
- * @since 3.0
- */
- public static final String STATUS_CATEGORY_SMART_TYPING= "SmartTyping"; //$NON-NLS-1$
-
- /**
- * ID of the action to toggle the style of the presentation.
- */
- public static final String TOGGLE_PRESENTATION= "togglePresentation"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/IPropertiesFilePartitions.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/IPropertiesFilePartitions.java
deleted file mode 100644
index 3563ff4..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/IPropertiesFilePartitions.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor;
-
-/**
- * Properties file partitioning definition.
- * <p>
- * A property key is represented by the {@link org.eclipse.jface.text.IDocument#DEFAULT_CONTENT_TYPE default partition}.
- * </p>
- *
- * @since 3.1
- */
-public interface IPropertiesFilePartitions {
-
- /**
- * The name of the properties file partitioning.
- * Value: {@value}
- */
- String PROPERTIES_FILE_PARTITIONING= "___pf_partitioning"; //$NON-NLS-1$
-
- /**
- * The name of a comment partition.
- * Value: {@value}
- */
- String COMMENT= "__pf_comment"; //$NON-NLS-1$
-
- /**
- * The name of a property value partition.
- * <p>
- * Note: The value partition may contain assignment characters at their beginning
- * </p>
- * Value: {@value}
- */
- String PROPERTY_VALUE= "__pf_roperty_value"; //$NON-NLS-1$
-
- /**
- * Array with properties file partitions.
- * Value: {@value}
- */
- String[] PARTITIONS= new String[] { COMMENT, PROPERTY_VALUE };
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/LeadingWhitespacePredicateRule.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/LeadingWhitespacePredicateRule.java
deleted file mode 100644
index 5fc0966..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/LeadingWhitespacePredicateRule.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor;
-
-import org.eclipse.jface.text.rules.ICharacterScanner;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.IWordDetector;
-import org.eclipse.jface.text.rules.WordPatternRule;
-
-
-/**
- * A leading white space predicate rule.
- *
- * @since 3.1
- */
-public final class LeadingWhitespacePredicateRule extends WordPatternRule {
-
-
- private static class DummyDetector implements IWordDetector {
-
- /*
- * @see IWordDetector#isWordStart
- */
- public boolean isWordStart(char c) {
- return false;
- }
-
- /*
- * @see IWordDetector#isWordPart
- */
- public boolean isWordPart(char c) {
- return false;
- }
- }
-
-
- /**
- * Creates a white space rule for the given <code>token</code>.
- *
- * @param token the token to be returned on success
- */
- public LeadingWhitespacePredicateRule(IToken token, String whitespace) {
- super(new DummyDetector(), whitespace, "dummy", token); //$NON-NLS-1$
- setColumnConstraint(0);
- }
-
- /*
- * @see org.eclipse.jface.text.rules.WordPatternRule#endSequenceDetected(org.eclipse.jface.text.rules.ICharacterScanner)
- */
- protected boolean endSequenceDetected(ICharacterScanner scanner) {
- int c;
- do {
- c= scanner.read();
- } while (Character.isWhitespace((char) c));
-
- scanner.unread();
-
- return true;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/OpenAction.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/OpenAction.java
deleted file mode 100644
index 4586e25..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/OpenAction.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.wst.jsdt.ui.actions.SelectionDispatchAction;
-
-/**
- * This action opens a tool (internal editor or view or an external
- * application) for the element at the given location.
- * <p>
- * XXX: This does not work for properties files coming from a JAR due to
- * missing J Core functionality. For details see:
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22376
- * </p>
- * <p>
- * This class may be instantiated; it is not intended to be subclassed.
- * </p>
- *
- * @since 3.1
- */
-public class OpenAction extends SelectionDispatchAction {
-
-
- private PropertiesFileEditor fEditor;
-
-
- /**
- * Creates a new <code>OpenAction</code>.
- *
- * @param editor the Properties file editor which provides the context information for this action
- */
- public OpenAction(PropertiesFileEditor editor) {
- super(editor.getEditorSite());
- fEditor= editor;
- setText(PropertiesFileEditorMessages.OpenAction_label);
- setToolTipText(PropertiesFileEditorMessages.OpenAction_tooltip);
-
- // XXX: Must be removed once support for JARs is available (see class Javadoc for details).
- setEnabled(fEditor.getEditorInput() instanceof IFileEditorInput);
- }
-
- /*
- * @see org.eclipse.wst.jsdt.ui.actions.SelectionDispatchAction#selectionChanged(org.eclipse.jface.text.ITextSelection)
- */
- public void selectionChanged(ITextSelection selection) {
- setEnabled(checkEnabled(selection));
- }
-
- private boolean checkEnabled(ITextSelection selection) {
- if (selection == null || selection.isEmpty())
- return false;
-
- // XXX: Must be changed to IStorageEditorInput once support for JARs is available (see class Javadoc for details)
- return fEditor.getEditorInput() instanceof IFileEditorInput;
- }
-
- public void run(ITextSelection selection) {
-
- if (!checkEnabled(selection))
- return;
-
- IRegion region= new Region(selection.getOffset(), selection.getLength());
- PropertyKeyHyperlinkDetector detector= new PropertyKeyHyperlinkDetector();
- detector.setContext(fEditor);
- IHyperlink[]hyperlinks= detector.detectHyperlinks(fEditor.internalGetSourceViewer(), region, false);
-
- if (hyperlinks != null && hyperlinks.length == 1)
- hyperlinks[0].open();
-
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertiesFileDocumentProvider.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertiesFileDocumentProvider.java
deleted file mode 100644
index fe73ce2..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertiesFileDocumentProvider.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.editors.text.ForwardingDocumentProvider;
-import org.eclipse.ui.editors.text.TextFileDocumentProvider;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-
-
-/**
- * Shared properties file document provider specialized for Java properties files.
- *
- * @since 3.1
- */
-public class PropertiesFileDocumentProvider extends TextFileDocumentProvider {
-
-
- private static final IContentType JAVA_PROPERTIES_FILE_CONTENT_TYPE= Platform.getContentTypeManager().getContentType("org.eclipse.wst.jsdt.core.javaProperties"); //$NON-NLS-1$
-
-
- /**
- * Creates a new properties file document provider and
- * sets up the parent chain.
- */
- public PropertiesFileDocumentProvider() {
- IDocumentProvider provider= new TextFileDocumentProvider();
- provider= new ForwardingDocumentProvider(IPropertiesFilePartitions.PROPERTIES_FILE_PARTITIONING, new PropertiesFileDocumentSetupParticipant(), provider);
- setParentDocumentProvider(provider);
- }
-
- /*
- * @see org.eclipse.ui.editors.text.TextFileDocumentProvider#createFileInfo(java.lang.Object)
- */
- protected FileInfo createFileInfo(Object element) throws CoreException {
- if (JAVA_PROPERTIES_FILE_CONTENT_TYPE == null || !(element instanceof IFileEditorInput))
- return null;
-
- IFileEditorInput input= (IFileEditorInput)element;
-
- IFile file= input.getFile();
- if (file == null || !file.isAccessible())
- return null;
-
- IContentDescription description= file.getContentDescription();
- if (description == null || description.getContentType() == null || !description.getContentType().isKindOf(JAVA_PROPERTIES_FILE_CONTENT_TYPE))
- return null;
-
- return super.createFileInfo(element);
- }
-
- /*
- * @see org.eclipse.ui.editors.text.TextFileDocumentProvider#createSaveOperation(java.lang.Object, org.eclipse.jface.text.IDocument, boolean)
- * @since 3.1
- */
- protected DocumentProviderOperation createSaveOperation(final Object element, final IDocument document, final boolean overwrite) throws CoreException {
- if (getFileInfo(element) == null)
- return null;
-
- return super.createSaveOperation(element, document, overwrite);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertiesFileDocumentSetupParticipant.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertiesFileDocumentSetupParticipant.java
deleted file mode 100644
index 5f39846..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertiesFileDocumentSetupParticipant.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor;
-
-import org.eclipse.core.filebuffers.IDocumentSetupParticipant;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension3;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jface.text.rules.FastPartitioner;
-
-/**
- * The document setup participant for a properties file document.
- *
- * @since 3.1
- */
-public class PropertiesFileDocumentSetupParticipant implements IDocumentSetupParticipant {
-
- /*
- * @see org.eclipse.core.filebuffers.IDocumentSetupParticipant#setup(org.eclipse.jface.text.IDocument)
- */
- public void setup(IDocument document) {
- setupDocument(document);
- }
-
- /**
- * @see org.eclipse.core.filebuffers.IDocumentSetupParticipant#setup(org.eclipse.jface.text.IDocument)
- */
- public static void setupDocument(IDocument document) {
- IDocumentPartitioner partitioner= createDocumentPartitioner();
- if (document instanceof IDocumentExtension3) {
- IDocumentExtension3 extension3= (IDocumentExtension3) document;
- extension3.setDocumentPartitioner(IPropertiesFilePartitions.PROPERTIES_FILE_PARTITIONING, partitioner);
- } else {
- document.setDocumentPartitioner(partitioner);
- }
- partitioner.connect(document);
- }
-
- /**
- * Factory method for creating a properties file document specific document
- * partitioner.
- *
- * @return a newly created properties file document partitioner
- */
- private static IDocumentPartitioner createDocumentPartitioner() {
- return new FastPartitioner(new PropertiesFilePartitionScanner(), IPropertiesFilePartitions.PARTITIONS);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertiesFileEditor.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertiesFileEditor.java
deleted file mode 100644
index d7af86a..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertiesFileEditor.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.editors.text.TextEditor;
-import org.eclipse.ui.part.IShowInTargetList;
-import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
-import org.eclipse.wst.jsdt.ui.JavaScriptUI;
-import org.eclipse.wst.jsdt.ui.actions.IJavaEditorActionDefinitionIds;
-import org.eclipse.wst.jsdt.ui.actions.JdtActionConstants;
-import org.eclipse.wst.jsdt.ui.text.JavaScriptTextTools;
-
-/**
- * Properties file editor.
- *
- * @since 3.1
- */
-public class PropertiesFileEditor extends TextEditor {
-
-
- /** Open action. */
- protected OpenAction fOpenAction;
-
-
- /**
- * Creates a new properties file editor.
- */
- public PropertiesFileEditor() {
- setDocumentProvider(JavaScriptPlugin.getDefault().getPropertiesFileDocumentProvider());
- IPreferenceStore store= JavaScriptPlugin.getDefault().getCombinedPreferenceStore();
- setPreferenceStore(store);
- JavaScriptTextTools textTools= JavaScriptPlugin.getDefault().getJavaTextTools();
- setSourceViewerConfiguration(new PropertiesFileSourceViewerConfiguration(textTools.getColorManager(), store, this, IPropertiesFilePartitions.PROPERTIES_FILE_PARTITIONING));
- }
-
-
- /*
- * @see org.eclipse.ui.editors.text.TextEditor#createActions()
- */
- protected void createActions() {
- super.createActions();
-
- fOpenAction= new OpenAction(this);
- fOpenAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.OPEN_EDITOR);
- setAction(JdtActionConstants.OPEN, fOpenAction);
- }
-
- /*
- * @see AbstractTextEditor#handlePreferenceStoreChanged(PropertyChangeEvent)
- */
- protected void handlePreferenceStoreChanged(PropertyChangeEvent event) {
-
- try {
-
- ISourceViewer sourceViewer= getSourceViewer();
- if (sourceViewer == null)
- return;
-
- ((PropertiesFileSourceViewerConfiguration) getSourceViewerConfiguration()).handlePropertyChangeEvent(event);
-
- } finally {
- super.handlePreferenceStoreChanged(event);
- }
- }
-
- /*
- * @see AbstractTextEditor#affectsTextPresentation(PropertyChangeEvent)
- */
- protected boolean affectsTextPresentation(PropertyChangeEvent event) {
- return ((PropertiesFileSourceViewerConfiguration)getSourceViewerConfiguration()).affectsTextPresentation(event) || super.affectsTextPresentation(event);
- }
-
-
- /*
- * @see org.eclipse.ui.editors.text.TextEditor#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- if (adapter == IShowInTargetList.class) {
- return new IShowInTargetList() {
- public String[] getShowInTargetIds() {
- return new String[] { JavaScriptUI.ID_PACKAGES, IPageLayout.ID_RES_NAV };
- }
-
- };
- }
- return super.getAdapter(adapter);
- }
-
- /*
- * @see org.eclipse.ui.part.WorkbenchPart#getOrientation()
- * @since 3.2
- */
- public int getOrientation() {
- return SWT.LEFT_TO_RIGHT; // properties editors are always left to right by default (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=110986)
- }
-
- /*
- * @see org.eclipse.ui.texteditor.StatusTextEditor#updateStatusField(java.lang.String)
- */
- protected void updateStatusField(String category) {
- super.updateStatusField(category);
- if (getEditorSite() != null) {
- getEditorSite().getActionBars().getStatusLineManager().setMessage(null);
- getEditorSite().getActionBars().getStatusLineManager().setErrorMessage(null);
- }
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AbstractTextEditor#getSourceViewer()
- */
- ISourceViewer internalGetSourceViewer() {
- return getSourceViewer();
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#collectContextMenuPreferencePages()
- * @since 3.1
- */
- protected String[] collectContextMenuPreferencePages() {
- String[] ids= super.collectContextMenuPreferencePages();
- String[] more= new String[ids.length + 1];
- more[0]= "org.eclipse.wst.jsdt.ui.preferences.PropertiesFileEditorPreferencePage"; //$NON-NLS-1$
- System.arraycopy(ids, 0, more, 1, ids.length);
- return more;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertiesFileEditorActionContributor.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertiesFileEditorActionContributor.java
deleted file mode 100644
index 598194f..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertiesFileEditorActionContributor.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor;
-
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.editors.text.TextEditorActionContributor;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.jsdt.ui.actions.JdtActionConstants;
-
-
-/**
- * Action contributor for Properties file editor.
- *
- * @since 3.1
- */
-public class PropertiesFileEditorActionContributor extends TextEditorActionContributor {
-
-
- /*
- * @see EditorActionBarContributor#setActiveEditor(IEditorPart)
- */
- public void setActiveEditor(IEditorPart part) {
- super.setActiveEditor(part);
-
- IActionBars actionBars= getActionBars();
- IStatusLineManager manager= actionBars.getStatusLineManager();
- manager.setMessage(null);
- manager.setErrorMessage(null);
-
- ITextEditor textEditor= null;
- if (part instanceof ITextEditor)
- textEditor= (ITextEditor)part;
-
- actionBars.setGlobalActionHandler(JdtActionConstants.OPEN, getAction(textEditor, JdtActionConstants.OPEN));
- }
-
- /*
- * @see IEditorActionBarContributor#dispose()
- */
- public void dispose() {
- setActiveEditor(null);
- super.dispose();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertiesFileEditorMessages.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertiesFileEditorMessages.java
deleted file mode 100644
index d954572..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertiesFileEditorMessages.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor;
-
-import java.util.ResourceBundle;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Helper class to get NLSed messages.
- *
- * @since 3.1
- */
-final class PropertiesFileEditorMessages extends NLS {
-
- private static final String BUNDLE_FOR_CONSTRUCTED_KEYS= "org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor.ConstructedPropertiesFileEditorMessages";//$NON-NLS-1$
- private static ResourceBundle fgBundleForConstructedKeys= ResourceBundle.getBundle(BUNDLE_FOR_CONSTRUCTED_KEYS);
-
- /**
- * Returns the message bundle which contains constructed keys.
- *
- * @since 3.1
- * @return the message bundle
- */
- public static ResourceBundle getBundleForConstructedKeys() {
- return fgBundleForConstructedKeys;
- }
-
- private static final String BUNDLE_NAME= PropertiesFileEditorMessages.class.getName();
-
- private PropertiesFileEditorMessages() {
- // Do not instantiate
- }
-
- public static String OpenAction_label;
- public static String OpenAction_tooltip;
- public static String OpenAction_error_title;
- public static String OpenAction_error_message;
- public static String OpenAction_error_messageArgs;
- public static String OpenAction_error_messageProblems;
- public static String OpenAction_error_messageErrorSearchingKey;
- public static String OpenAction_error_messageNoResult;
- public static String OpenAction_SelectionDialog_title;
- public static String OpenAction_SelectionDialog_details;
- public static String OpenAction_SelectionDialog_message;
- public static String OpenAction_SelectionDialog_elementLabel;
- public static String OpenAction_SelectionDialog_elementLabelWithMatchCount;
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, PropertiesFileEditorMessages.class);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertiesFileEditorMessages.properties b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertiesFileEditorMessages.properties
deleted file mode 100644
index 5c72fd6..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertiesFileEditorMessages.properties
+++ /dev/null
@@ -1,31 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2007 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-OpenAction_label= &Open
-OpenAction_tooltip= Open an Editor on the Selected Properties Key
-
-OpenAction_error_title= Open
-OpenAction_error_message= Cannot open default editor.
-OpenAction_error_messageArgs= Cannot open default editor on {0}: \n{1}
-OpenAction_error_messageProblems= Problems Opening Editor
-OpenAction_error_messageErrorSearchingKey= Error searching references to the selected properties key
-OpenAction_error_messageNoResult= Found no references to the selected properties key
-
-OpenAction_SelectionDialog_title= Open
-OpenAction_SelectionDialog_details= &Details
-OpenAction_SelectionDialog_message= &Select or enter the file to open (? = any character, * = any String):
-
-# The first argument is the line number and the second is the full file path
-OpenAction_SelectionDialog_elementLabel= Line {0} - {1}
-
-# The first argument is the file name and the second is number of matches in that file
-OpenAction_SelectionDialog_elementLabelWithMatchCount= {0} ({1} matches)
-
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertiesFilePartitionScanner.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertiesFilePartitionScanner.java
deleted file mode 100644
index 3d96fc5..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertiesFilePartitionScanner.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.rules.EndOfLineRule;
-import org.eclipse.jface.text.rules.ICharacterScanner;
-import org.eclipse.jface.text.rules.IPredicateRule;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.IWordDetector;
-import org.eclipse.jface.text.rules.RuleBasedPartitionScanner;
-import org.eclipse.jface.text.rules.SingleLineRule;
-import org.eclipse.jface.text.rules.Token;
-import org.eclipse.jface.text.rules.WordRule;
-
-/**
- * This scanner recognizes the comments, property keys and property values.
- *
- * @since 3.1
- */
-public class PropertiesFilePartitionScanner extends RuleBasedPartitionScanner implements IPropertiesFilePartitions {
-
- /**
- * Detector for empty comments.
- */
- static class EmptyCommentDetector implements IWordDetector {
-
- /*
- * @see IWordDetector#isWordStart
- */
- public boolean isWordStart(char c) {
- return (c == '#');
- }
-
- /*
- * @see IWordDetector#isWordPart
- */
- public boolean isWordPart(char c) {
- return (c == '#');
- }
- }
-
-
- /**
- * Word rule for empty comments.
- */
- static class EmptyCommentRule extends WordRule implements IPredicateRule {
-
- private IToken fSuccessToken;
- /**
- * Constructor for EmptyCommentRule.
- * @param successToken the success token
- */
- public EmptyCommentRule(IToken successToken) {
- super(new EmptyCommentDetector());
- fSuccessToken= successToken;
- addWord("#", fSuccessToken); //$NON-NLS-1$
- }
-
- /*
- * @see IPredicateRule#evaluate(ICharacterScanner, boolean)
- */
- public IToken evaluate(ICharacterScanner scanner, boolean resume) {
- return evaluate(scanner);
- }
-
- /*
- * @see IPredicateRule#getSuccessToken()
- */
- public IToken getSuccessToken() {
- return fSuccessToken;
- }
- }
-
-
- /**
- * Creates the partitioner and sets up the appropriate rules.
- */
- public PropertiesFilePartitionScanner() {
- super();
-
- IToken comment= new Token(COMMENT);
- IToken propertyValue= new Token(PROPERTY_VALUE);
- IToken key= new Token(IDocument.DEFAULT_CONTENT_TYPE);
-
- List rules= new ArrayList();
-
- // Add rule for leading white space.
- rules.add(new LeadingWhitespacePredicateRule(key, "\t")); //$NON-NLS-1$
- rules.add(new LeadingWhitespacePredicateRule(key, " ")); //$NON-NLS-1$
-
- // Add rules for comments.
- rules.add(new EndOfLineRule("#", comment, (char) 0, true)); //$NON-NLS-1$
- rules.add(new EndOfLineRule("!", comment, (char) 0, true)); //$NON-NLS-1$
-
- // Add rules for property values.
- rules.add(new SingleLineRule("=", null, propertyValue, '\\', true, true)); //$NON-NLS-1$
- rules.add(new SingleLineRule(":", null, propertyValue, '\\', true, true)); //$NON-NLS-1$
- rules.add(new SingleLineRule(" ", null, propertyValue, '\\', true, true)); //$NON-NLS-1$
- rules.add(new SingleLineRule("\t", null, propertyValue, '\\', true, true)); //$NON-NLS-1$
-
- // Add special case word rule.
- EmptyCommentRule wordRule= new EmptyCommentRule(comment);
- rules.add(wordRule);
-
- IPredicateRule[] result= new IPredicateRule[rules.size()];
- rules.toArray(result);
- setPredicateRules(result);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertiesFileSourceViewerConfiguration.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertiesFileSourceViewerConfiguration.java
deleted file mode 100644
index 1b3e1c9..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertiesFileSourceViewerConfiguration.java
+++ /dev/null
@@ -1,308 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor;
-
-import java.util.Map;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.wst.jsdt.internal.ui.text.html.HTMLTextPresenter;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.DefaultInformationControl;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IInformationControl;
-import org.eclipse.jface.text.IInformationControlCreator;
-import org.eclipse.jface.text.ITextDoubleClickStrategy;
-import org.eclipse.jface.text.presentation.IPresentationReconciler;
-import org.eclipse.jface.text.presentation.PresentationReconciler;
-import org.eclipse.jface.text.reconciler.IReconciler;
-import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
-import org.eclipse.jface.text.reconciler.MonoReconciler;
-import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
-import org.eclipse.jface.text.rules.RuleBasedScanner;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.IAnnotationHover;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.editors.text.EditorsUI;
-import org.eclipse.ui.editors.text.TextSourceViewerConfiguration;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.spelling.SpellingReconcileStrategy;
-import org.eclipse.ui.texteditor.spelling.SpellingService;
-import org.eclipse.wst.jsdt.internal.ui.text.AbstractJavaScanner;
-import org.eclipse.wst.jsdt.internal.ui.text.HTMLAnnotationHover;
-import org.eclipse.wst.jsdt.internal.ui.text.JavaPresentationReconciler;
-import org.eclipse.wst.jsdt.internal.ui.text.SingleTokenJavaScanner;
-import org.eclipse.wst.jsdt.internal.ui.text.java.JavaStringDoubleClickSelector;
-import org.eclipse.wst.jsdt.ui.PreferenceConstants;
-import org.eclipse.wst.jsdt.ui.text.IColorManager;
-
-/**
- * Configuration for a source viewer which shows a properties file.
- * <p>
- * This class may be instantiated; it is not intended to be subclassed.
- * </p>
- *
- * @since 3.1
- */
-public class PropertiesFileSourceViewerConfiguration extends TextSourceViewerConfiguration {
-
- /** Properties file content type */
- private static final IContentType PROPERTIES_CONTENT_TYPE= Platform.getContentTypeManager().getContentType("org.eclipse.wst.jsdt.core.javaProperties"); //$NON-NLS-1$
-
- /**
- * The text editor.
- */
- private ITextEditor fTextEditor;
- /**
- * The document partitioning.
- */
- private String fDocumentPartitioning;
- /**
- * The property key scanner.
- */
- private AbstractJavaScanner fPropertyKeyScanner;
- /**
- * The comment scanner.
- */
- private AbstractJavaScanner fCommentScanner;
- /**
- * The property value scanner.
- */
- private AbstractJavaScanner fPropertyValueScanner;
- /**
- * The color manager.
- */
- private IColorManager fColorManager;
-
-
- /**
- * Creates a new properties file source viewer configuration for viewers in the given editor
- * using the given preference store, the color manager and the specified document partitioning.
- *
- * @param colorManager the color manager
- * @param preferenceStore the preference store, can be read-only
- * @param editor the editor in which the configured viewer(s) will reside
- * @param partitioning the document partitioning for this configuration
- */
- public PropertiesFileSourceViewerConfiguration(IColorManager colorManager, IPreferenceStore preferenceStore, ITextEditor editor, String partitioning) {
- super(preferenceStore);
- fColorManager= colorManager;
- fTextEditor= editor;
- fDocumentPartitioning= partitioning;
- initializeScanners();
- }
-
- /**
- * Returns the property key scanner for this configuration.
- *
- * @return the property key scanner
- */
- protected RuleBasedScanner getPropertyKeyScanner() {
- return fPropertyKeyScanner;
- }
-
- /**
- * Returns the comment scanner for this configuration.
- *
- * @return the comment scanner
- */
- protected RuleBasedScanner getCommentScanner() {
- return fCommentScanner;
- }
-
- /**
- * Returns the property value scanner for this configuration.
- *
- * @return the property value scanner
- */
- protected RuleBasedScanner getPropertyValueScanner() {
- return fPropertyValueScanner;
- }
-
- /**
- * Returns the color manager for this configuration.
- *
- * @return the color manager
- */
- protected IColorManager getColorManager() {
- return fColorManager;
- }
-
- /**
- * Returns the editor in which the configured viewer(s) will reside.
- *
- * @return the enclosing editor
- */
- protected ITextEditor getEditor() {
- return fTextEditor;
- }
-
- /**
- * Initializes the scanners.
- */
- private void initializeScanners() {
- fPropertyKeyScanner= new SingleTokenJavaScanner(getColorManager(), fPreferenceStore, PreferenceConstants.PROPERTIES_FILE_COLORING_KEY);
- fPropertyValueScanner= new PropertyValueScanner(getColorManager(), fPreferenceStore);
- fCommentScanner= new SingleTokenJavaScanner(getColorManager(), fPreferenceStore, PreferenceConstants.PROPERTIES_FILE_COLORING_COMMENT);
- }
-
- /*
- * @see SourceViewerConfiguration#getPresentationReconciler(ISourceViewer)
- */
- public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
-
- PresentationReconciler reconciler= new JavaPresentationReconciler();
- reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
-
- DefaultDamagerRepairer dr= new DefaultDamagerRepairer(getPropertyKeyScanner());
- reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
- reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
-
- dr= new DefaultDamagerRepairer(getCommentScanner());
- reconciler.setDamager(dr, IPropertiesFilePartitions.COMMENT);
- reconciler.setRepairer(dr, IPropertiesFilePartitions.COMMENT);
-
- dr= new DefaultDamagerRepairer(getPropertyValueScanner());
- reconciler.setDamager(dr, IPropertiesFilePartitions.PROPERTY_VALUE);
- reconciler.setRepairer(dr, IPropertiesFilePartitions.PROPERTY_VALUE);
-
- return reconciler;
- }
-
- /*
- * @see SourceViewerConfiguration#getDoubleClickStrategy(ISourceViewer, String)
- */
- public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) {
- if (IDocument.DEFAULT_CONTENT_TYPE.equals(contentType))
- return new JavaStringDoubleClickSelector(getConfiguredDocumentPartitioning(sourceViewer));
-
- return super.getDoubleClickStrategy(sourceViewer, contentType);
- }
-
- /*
- * @see SourceViewerConfiguration#getConfiguredContentTypes(ISourceViewer)
- */
- public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
- int length= IPropertiesFilePartitions.PARTITIONS.length;
- String[] contentTypes= new String[length + 1];
- contentTypes[0]= IDocument.DEFAULT_CONTENT_TYPE;
- for (int i= 0; i < length; i++)
- contentTypes[i+1]= IPropertiesFilePartitions.PARTITIONS[i];
-
- return contentTypes;
- }
-
- /*
- * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getConfiguredDocumentPartitioning(org.eclipse.jface.text.source.ISourceViewer)
- */
- public String getConfiguredDocumentPartitioning(ISourceViewer sourceViewer) {
- if (fDocumentPartitioning != null)
- return fDocumentPartitioning;
- return super.getConfiguredDocumentPartitioning(sourceViewer);
- }
-
- /**
- * Determines whether the preference change encoded by the given event
- * changes the behavior of one of its contained components.
- *
- * @param event the event to be investigated
- * @return <code>true</code> if event causes a behavioral change
- */
- public boolean affectsTextPresentation(PropertyChangeEvent event) {
- return fPropertyKeyScanner.affectsBehavior(event)
- || fCommentScanner.affectsBehavior(event)
- || fPropertyValueScanner.affectsBehavior(event);
- }
-
- /**
- * Adapts the behavior of the contained components to the change
- * encoded in the given event.
- *
- * @param event the event to which to adapt
- * @see PropertiesFileSourceViewerConfiguration#PropertiesFileSourceViewerConfiguration(IColorManager, IPreferenceStore, ITextEditor, String)
- */
- public void handlePropertyChangeEvent(PropertyChangeEvent event) {
- if (fPropertyKeyScanner.affectsBehavior(event))
- fPropertyKeyScanner.adaptToPreferenceChange(event);
- if (fCommentScanner.affectsBehavior(event))
- fCommentScanner.adaptToPreferenceChange(event);
- if (fPropertyValueScanner.affectsBehavior(event))
- fPropertyValueScanner.adaptToPreferenceChange(event);
- }
-
- /*
- * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getHyperlinkDetectorTargets(org.eclipse.jface.text.source.ISourceViewer)
- * @since 3.3
- */
- protected Map getHyperlinkDetectorTargets(ISourceViewer sourceViewer) {
- Map targets= super.getHyperlinkDetectorTargets(sourceViewer);
- targets.put("org.eclipse.wst.jsdt.ui.PropertiesFileEditor", fTextEditor); //$NON-NLS-1$
- return targets;
- }
-
- /*
- * @see SourceViewerConfiguration#getAnnotationHover(ISourceViewer)
- */
- public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
- return new HTMLAnnotationHover() {
- protected boolean isIncluded(Annotation annotation) {
- return isShowInVerticalRuler(annotation);
- }
- };
- }
-
- /*
- * @see SourceViewerConfiguration#getOverviewRulerAnnotationHover(ISourceViewer)
- */
- public IAnnotationHover getOverviewRulerAnnotationHover(ISourceViewer sourceViewer) {
- return new HTMLAnnotationHover() {
- protected boolean isIncluded(Annotation annotation) {
- return isShowInOverviewRuler(annotation);
- }
- };
- }
-
- /*
- * @see SourceViewerConfiguration#getInformationControlCreator(ISourceViewer)
- */
- public IInformationControlCreator getInformationControlCreator(ISourceViewer sourceViewer) {
- return new IInformationControlCreator() {
- public IInformationControl createInformationControl(Shell parent) {
- return new DefaultInformationControl(parent, SWT.NONE, new HTMLTextPresenter(true));
- }
- };
- }
-
- /*
- * @see org.eclipse.ui.editors.text.TextSourceViewerConfiguration#getReconciler(org.eclipse.jface.text.source.ISourceViewer)
- */
- public IReconciler getReconciler(ISourceViewer sourceViewer) {
- if (!EditorsUI.getPreferenceStore().getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED))
- return null;
-
- IReconcilingStrategy strategy= new SpellingReconcileStrategy(sourceViewer, EditorsUI.getSpellingService()) {
- protected IContentType getContentType() {
- return PROPERTIES_CONTENT_TYPE;
- }
- };
-
- MonoReconciler reconciler= new MonoReconciler(strategy, false);
- reconciler.setIsIncrementalReconciler(false);
- reconciler.setProgressMonitor(new NullProgressMonitor());
- reconciler.setDelay(500);
- return reconciler;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertyKeyHyperlink.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertyKeyHyperlink.java
deleted file mode 100644
index b12ab02..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertyKeyHyperlink.java
+++ /dev/null
@@ -1,509 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.regex.Pattern;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.filebuffers.ITextFileBufferManager;
-import org.eclipse.core.filebuffers.LocationKind;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.search.core.text.TextSearchEngine;
-import org.eclipse.search.core.text.TextSearchMatchAccess;
-import org.eclipse.search.core.text.TextSearchRequestor;
-import org.eclipse.search.core.text.TextSearchScope;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.dialogs.TwoPaneElementSelector;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.ui.texteditor.IEditorStatusLine;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchConstants;
-import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchScope;
-import org.eclipse.wst.jsdt.core.search.SearchEngine;
-import org.eclipse.wst.jsdt.core.search.SearchMatch;
-import org.eclipse.wst.jsdt.core.search.SearchPattern;
-import org.eclipse.wst.jsdt.core.search.SearchRequestor;
-import org.eclipse.wst.jsdt.internal.corext.util.Messages;
-import org.eclipse.wst.jsdt.internal.corext.util.SearchUtils;
-import org.eclipse.wst.jsdt.internal.ui.IJavaStatusConstants;
-import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
-import org.eclipse.wst.jsdt.internal.ui.javaeditor.EditorUtility;
-import org.eclipse.wst.jsdt.internal.ui.util.ExceptionHandler;
-import org.eclipse.wst.jsdt.internal.ui.util.PatternConstructor;
-import org.eclipse.wst.jsdt.ui.JavaScriptUI;
-
-import com.ibm.icu.text.Collator;
-
-
-/**
- * Properties key hyperlink.
- * <p>
- * XXX: This does not work for properties files coming from a JAR due to
- * missing J Core functionality. For details see:
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22376
- * </p>
- *
- * @since 3.1
- */
-public class PropertyKeyHyperlink implements IHyperlink {
-
-
- private static class KeyReference extends PlatformObject implements IWorkbenchAdapter, Comparable {
-
- private static final Collator fgCollator= Collator.getInstance();
-
- private IStorage storage;
- private int offset;
- private int length;
-
-
- private KeyReference(IStorage storage, int offset, int length) {
- Assert.isNotNull(storage);
- this.storage= storage;
- this.offset= offset;
- this.length= length;
- }
-
- /*
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- if (adapter == IWorkbenchAdapter.class)
- return this;
- else
- return super.getAdapter(adapter);
- }
- /*
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
- */
- public Object[] getChildren(Object o) {
- return null;
- }
- /*
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
- */
- public ImageDescriptor getImageDescriptor(Object object) {
- IWorkbenchAdapter wbAdapter= (IWorkbenchAdapter)storage.getAdapter(IWorkbenchAdapter.class);
- if (wbAdapter != null)
- return wbAdapter.getImageDescriptor(storage);
- return null;
- }
- /*
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
- */
- public String getLabel(Object o) {
-
- ITextFileBufferManager manager= FileBuffers.getTextFileBufferManager();
- try {
- manager.connect(storage.getFullPath(), LocationKind.NORMALIZE, null);
- try {
- ITextFileBuffer buffer= manager.getTextFileBuffer(storage.getFullPath(), LocationKind.NORMALIZE);
- IDocument document= buffer.getDocument();
- if (document != null) {
- int line= document.getLineOfOffset(offset) + 1;
- Object[] args= new Object[] { new Integer(line), storage.getFullPath() };
- return Messages.format(PropertiesFileEditorMessages.OpenAction_SelectionDialog_elementLabel, args);
- }
- } finally {
- manager.disconnect(storage.getFullPath(), LocationKind.NORMALIZE, null);
- }
- } catch (CoreException e) {
- JavaScriptPlugin.log(e.getStatus());
- } catch (BadLocationException e) {
- JavaScriptPlugin.log(e);
- }
-
- return storage.getFullPath().toString();
- }
- /*
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object)
- */
- public Object getParent(Object o) {
- return null;
- }
-
- public int compareTo(Object o) {
- KeyReference otherRef= (KeyReference)o;
- String thisPath= storage.getFullPath().toString();
- String otherPath= otherRef.storage.getFullPath().toString();
- int result= fgCollator.compare(thisPath, otherPath);
- if (result != 0)
- return result;
- else
- return offset - otherRef.offset;
- }
- }
-
-
- private static class ResultCollector extends TextSearchRequestor {
-
- private List fResult;
- private boolean fIsKeyDoubleQuoted;
-
- public ResultCollector(List result, boolean isKeyDoubleQuoted) {
- fResult= result;
- fIsKeyDoubleQuoted= isKeyDoubleQuoted;
- }
-
- public boolean acceptPatternMatch(TextSearchMatchAccess matchAccess) throws CoreException {
- int start= matchAccess.getMatchOffset();
- int length= matchAccess.getMatchLength();
-
- if (fIsKeyDoubleQuoted) {
- start= start + 1;
- length= length - 2;
- }
- fResult.add(new KeyReference(matchAccess.getFile(), start, length));
- return true;
- }
- }
-
-
- private IRegion fRegion;
- private String fPropertiesKey;
- private Shell fShell;
- private IStorage fStorage;
- private ITextEditor fEditor;
-
-
- /**
- * Creates a new properties key hyperlink.
- *
- * @param region the region
- * @param key the properties key
- * @param editor the text editor
- */
- public PropertyKeyHyperlink(IRegion region, String key, ITextEditor editor) {
- Assert.isNotNull(region);
- Assert.isNotNull(key);
- Assert.isNotNull(editor);
-
- fRegion= region;
- fPropertiesKey= key;
- fEditor= editor;
- IStorageEditorInput storageEditorInput= (IStorageEditorInput)fEditor.getEditorInput();
- fShell= fEditor.getEditorSite().getShell();
- try {
- fStorage= storageEditorInput.getStorage();
- } catch (CoreException e) {
- fStorage= null;
- }
- }
-
- /*
- * @see org.eclipse.wst.jsdt.internal.ui.javaeditor.IHyperlink#getHyperlinkRegion()
- */
- public IRegion getHyperlinkRegion() {
- return fRegion;
- }
-
- /*
- * @see org.eclipse.wst.jsdt.internal.ui.javaeditor.IHyperlink#open()
- */
- public void open() {
- if (!checkEnabled())
- return;
-
- // Search the key
- IResource resource= (IResource)fStorage;
- KeyReference[] references= null;
- if (resource != null)
- references= search(resource.getProject(), fPropertiesKey);
-
- if (references == null)
- return; // canceled by the user
-
- if (references.length == 0) {
- String message= PropertiesFileEditorMessages.OpenAction_error_messageNoResult;
- showErrorInStatusLine(message);
- return;
- }
-
- open(references);
-
- }
-
- private boolean checkEnabled() {
- // XXX: Can be removed once support for JARs is available (see class Javadoc for details)
- return fStorage instanceof IResource;
- }
-
- private void open(KeyReference[] keyReferences) {
- Assert.isLegal(keyReferences != null && keyReferences.length > 0);
-
- if (keyReferences.length == 1)
- open(keyReferences[0]);
- else
- open(select(keyReferences));
- }
-
- /**
- * Opens a dialog which allows to select a key reference.
- * <p>
- * FIXME: The lower pane is currently not sorted due to https://bugs.eclipse.org/bugs/show_bug.cgi?id=84220
- * </p>
- *
- * @param keyReferences the array of key references
- * @return the selected key reference or <code>null</code> if canceled by the user
- */
- private KeyReference select(final KeyReference[] keyReferences) {
- Arrays.sort(keyReferences);
- final int length= keyReferences.length;
- ILabelProvider labelProvider= new WorkbenchLabelProvider() {
- public String decorateText(String input, Object element) {
- KeyReference keyRef= (KeyReference)element;
- IStorage storage= keyRef.storage;
- String name= storage.getName();
- if (name == null)
- return input;
-
- int count= 0;
- for (int i= 0; i < length; i++) {
- if (keyReferences[i].storage.equals(storage))
- count++;
- }
- if (count > 1) {
- Object[] args= new Object[] { name, new Integer(count) };
- name= Messages.format(PropertiesFileEditorMessages.OpenAction_SelectionDialog_elementLabelWithMatchCount, args);
- }
-
- return name;
- }
- };
-
- TwoPaneElementSelector dialog= new TwoPaneElementSelector(fShell, labelProvider, new WorkbenchLabelProvider());
- dialog.setLowerListLabel(PropertiesFileEditorMessages.OpenAction_SelectionDialog_details);
- dialog.setMultipleSelection(false);
- dialog.setTitle(PropertiesFileEditorMessages.OpenAction_SelectionDialog_title);
- dialog.setMessage(PropertiesFileEditorMessages.OpenAction_SelectionDialog_message);
- dialog.setElements(keyReferences);
-
- if (dialog.open() == Window.OK) {
- Object[] result= dialog.getResult();
- if (result != null && result.length == 1)
- return (KeyReference)result[0];
- }
-
- return null;
- }
-
- private void open(KeyReference keyReference) {
- if (keyReference == null)
- return;
-
- try {
- IEditorPart part= EditorUtility.openInEditor(keyReference.storage, true);
- EditorUtility.revealInEditor(part, keyReference.offset, keyReference.length);
- } catch (JavaScriptModelException e) {
- JavaScriptPlugin.log(new Status(IStatus.ERROR, JavaScriptPlugin.getPluginId(),
- IJavaStatusConstants.INTERNAL_ERROR, PropertiesFileEditorMessages.OpenAction_error_message, e));
-
- ErrorDialog.openError(fShell,
- getErrorDialogTitle(),
- PropertiesFileEditorMessages.OpenAction_error_messageProblems,
- e.getStatus());
-
- } catch (PartInitException x) {
-
- String message= null;
-
- IWorkbenchAdapter wbAdapter= (IWorkbenchAdapter)((IAdaptable)keyReference).getAdapter(IWorkbenchAdapter.class);
- if (wbAdapter != null)
- message= Messages.format(PropertiesFileEditorMessages.OpenAction_error_messageArgs,
- new String[] { wbAdapter.getLabel(keyReference), x.getLocalizedMessage() } );
-
- if (message == null)
- message= Messages.format(PropertiesFileEditorMessages.OpenAction_error_message, x.getLocalizedMessage());
-
- MessageDialog.openError(fShell,
- PropertiesFileEditorMessages.OpenAction_error_messageProblems,
- message);
- }
- }
-
- private String getErrorDialogTitle() {
- return PropertiesFileEditorMessages.OpenAction_error_title;
- }
-
- private void showError(CoreException e) {
- ExceptionHandler.handle(e, fShell, getErrorDialogTitle(), PropertiesFileEditorMessages.OpenAction_error_message);
- }
-
- private void showErrorInStatusLine(final String message) {
- fShell.getDisplay().beep();
- final IEditorStatusLine statusLine= (IEditorStatusLine)fEditor.getAdapter(IEditorStatusLine.class);
- if (statusLine != null) {
- fShell.getDisplay().asyncExec(new Runnable() {
- /*
- * @see java.lang.Runnable#run()
- */
- public void run() {
- statusLine.setMessage(true, message, null);
- }
- });
- }
- }
-
- /**
- * Returns whether we search the key in double-quotes or not.
- * <p>
- * XXX: This is a hack to improve the accuracy of matches, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=81140
- * </p>
- *
- * @return <code>true</code> if we search for double-quoted key
- */
- private boolean useDoubleQuotedKey() {
- if (fStorage == null)
- return false;
-
- String name= fStorage.getName();
-
- return name != null && !"about.properties".equals(name) && !"feature.properties".equals(name) && !"plugin.properties".equals(name); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- /**
- * Searches references to the given key in the given scope.
- *
- * @param scope the scope
- * @param key the properties key
- * @return the references or <code>null</code> if the search has been canceled by the user
- */
- private KeyReference[] search(final IResource scope, String key) {
- if (key == null)
- return new KeyReference[0];
-
- final List result= new ArrayList(5);
- final String searchString;
-
- // XXX: This is a hack to improve the accuracy of matches, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=81140
- final boolean useDoubleQuotedKey= useDoubleQuotedKey();
- if (useDoubleQuotedKey) {
- StringBuffer buf= new StringBuffer("\""); //$NON-NLS-1$
- buf.append(fPropertiesKey);
- buf.append('"');
- searchString= buf.toString();
- } else
- searchString= fPropertiesKey;
-
- try {
- fEditor.getEditorSite().getWorkbenchWindow().getWorkbench().getProgressService().busyCursorWhile(
- new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- if (monitor == null)
- monitor= new NullProgressMonitor();
-
- monitor.beginTask("", 5); //$NON-NLS-1$
- try {
- ResultCollector collector= new ResultCollector(result, useDoubleQuotedKey);
- TextSearchEngine engine= TextSearchEngine.create();
- Pattern searchPattern= PatternConstructor.createPattern(searchString, true, false);
- engine.search(createScope(scope), collector, searchPattern, new SubProgressMonitor(monitor, 4));
-
- if (result.size() == 0 && useDoubleQuotedKey) {
- //Try without, maybe an eclipse style NLS string
- IJavaScriptElement element= JavaScriptCore.create(scope);
- if (element == null)
- return;
-
- int includeMask = IJavaScriptSearchScope.SOURCES | IJavaScriptSearchScope.APPLICATION_LIBRARIES | IJavaScriptSearchScope.REFERENCED_PROJECTS;
- IJavaScriptSearchScope javaSearchScope= SearchEngine.createJavaSearchScope(new IJavaScriptElement[] { element }, includeMask);
-
- SearchPattern pattern= SearchPattern.createPattern(fPropertiesKey, IJavaScriptSearchConstants.FIELD, IJavaScriptSearchConstants.REFERENCES, SearchPattern.R_PATTERN_MATCH | SearchPattern.R_CASE_SENSITIVE);
- try {
- new SearchEngine().search(pattern, SearchUtils.getDefaultSearchParticipants(), javaSearchScope, new SearchRequestor() {
- public void acceptSearchMatch(SearchMatch match) throws CoreException {
- result.add(new KeyReference((IStorage)match.getResource(), match.getOffset(), match.getLength()));
- }
- }, new SubProgressMonitor(monitor, 1));
- } catch (CoreException e) {
- throw new InvocationTargetException(e);
- }
- } else {
- monitor.worked(1);
- }
- } finally {
- monitor.done();
- }
- }
- }
- );
- } catch (InvocationTargetException ex) {
- String message= PropertiesFileEditorMessages.OpenAction_error_messageErrorSearchingKey;
- showError(new CoreException(new Status(IStatus.ERROR, JavaScriptUI.ID_PLUGIN, IStatus.OK, message, ex.getTargetException())));
- } catch (InterruptedException ex) {
- return null; // canceled
- }
-
- return (KeyReference[])result.toArray(new KeyReference[result.size()]);
- }
-
- private static TextSearchScope createScope(IResource scope) {
- ArrayList fileNamePatternStrings= new ArrayList();
-
- // XXX: Should be configurable via preference, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=81117
- String[] javaExtensions= JavaScriptCore.getJavaScriptLikeExtensions();
- for (int i= 0; i < javaExtensions.length; i++)
- fileNamePatternStrings.add("*." + javaExtensions[i]); //$NON-NLS-1$
- fileNamePatternStrings.add("*.xml"); //$NON-NLS-1$
- fileNamePatternStrings.add("*.ini"); //$NON-NLS-1$
-
- String[] allPatternStrings= (String[]) fileNamePatternStrings.toArray(new String[fileNamePatternStrings.size()]);
- Pattern fileNamePattern= PatternConstructor.createPattern(allPatternStrings, false, false);
-
- return TextSearchScope.newSearchScope(new IResource[] { scope }, fileNamePattern, false);
- }
-
- /*
- * @see org.eclipse.wst.jsdt.internal.ui.javaeditor.IHyperlink#getTypeLabel()
- */
- public String getTypeLabel() {
- return null;
- }
-
- /*
- * @see org.eclipse.wst.jsdt.internal.ui.javaeditor.IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertyKeyHyperlinkDetector.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertyKeyHyperlinkDetector.java
deleted file mode 100644
index 97791b8..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertyKeyHyperlinkDetector.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.text.StringCharacterIterator;
-import java.util.Properties;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.BadPartitioningException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension3;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-
-/**
- * Properties key hyperlink detector.
- * <p>
- * XXX: This does not work for properties files coming from a JAR due to
- * missing J Core functionality. For details see:
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22376
- * </p>
- *
- * @since 3.1
- */
-public class PropertyKeyHyperlinkDetector extends AbstractHyperlinkDetector {
-
- /*
- * @see org.eclipse.jface.text.hyperlink.IHyperlinkDetector#detectHyperlinks(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion, boolean)
- */
- public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
- ITextEditor textEditor= (ITextEditor)getAdapter(ITextEditor.class);
- if (region == null || textEditor == null || canShowMultipleHyperlinks)
- return null;
-
- IEditorSite site= textEditor.getEditorSite();
- if (site == null)
- return null;
-
- int offset= region.getOffset();
- if (!checkEnabled(textEditor, offset))
- return null;
-
- ITypedRegion partition= null;
- try {
- IStorageEditorInput storageEditorInput= (IStorageEditorInput)textEditor.getEditorInput();
- IDocument document= textEditor.getDocumentProvider().getDocument(storageEditorInput);
- if (document instanceof IDocumentExtension3)
- partition= ((IDocumentExtension3)document).getPartition(IPropertiesFilePartitions.PROPERTIES_FILE_PARTITIONING, offset, false);
-
- // Check whether it is the correct partition
- if (partition == null || !IDocument.DEFAULT_CONTENT_TYPE.equals(partition.getType())) {
- return null;
- }
-
- // Check whether the partition covers the selection
- if (offset + region.getLength() > partition.getOffset() + partition.getLength()) {
- return null;
- }
-
- // Extract the key from the partition (which contains key and assignment
- String key= document.get(partition.getOffset(), partition.getLength());
-
- String realKey= key.trim();
- int delta= key.indexOf(realKey);
-
- String unicodeKey= getUnicodeString(realKey);
- // Check whether the key is valid
- Properties properties= new Properties();
- properties.load(new ByteArrayInputStream(document.get().getBytes()));
- if (properties.getProperty(unicodeKey) == null) {
- return null;
- }
-
- return new PropertyKeyHyperlink[] {new PropertyKeyHyperlink(new Region(partition.getOffset() + delta, realKey.length()), realKey, textEditor)};
-
- } catch (BadLocationException ex) {
- return null;
- } catch (BadPartitioningException ex) {
- return null;
- } catch (IOException ex) {
- return null;
- }
- }
-
- private String getUnicodeString(String key) {
- StringCharacterIterator iter= new StringCharacterIterator(key);
- StringBuffer result= new StringBuffer();
- while (iter.getIndex() < iter.getEndIndex()) {
- char c= iter.current();
- if (c == '\\') {
- iter.next();
- c= iter.current();
- if (c == 'u') {
- StringBuffer unicode= new StringBuffer();
- unicode.append(iter.next());
- unicode.append(iter.next());
- unicode.append(iter.next());
- unicode.append(iter.next());
- c= (char)Integer.parseInt(unicode.toString(), 16);
- }
- }
- result.append(c);
- iter.next();
- }
- return result.toString();
- }
-
- private boolean checkEnabled(ITextEditor textEditor, int offset) {
- if (offset < 0)
- return false;
-
- // XXX: Must be changed to IStorageEditorInput once support for JARs is available (see class Javadoc for details)
- return textEditor.getEditorInput() instanceof IFileEditorInput;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertyValueScanner.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertyValueScanner.java
deleted file mode 100644
index bb97084..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/propertiesfileeditor/PropertyValueScanner.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.IWordDetector;
-import org.eclipse.jface.text.rules.WhitespaceRule;
-import org.eclipse.jface.text.rules.WordRule;
-import org.eclipse.wst.jsdt.internal.ui.text.AbstractJavaScanner;
-import org.eclipse.wst.jsdt.internal.ui.text.JavaWhitespaceDetector;
-import org.eclipse.wst.jsdt.ui.PreferenceConstants;
-import org.eclipse.wst.jsdt.ui.text.IColorManager;
-
-
-/**
- * A rule based property value scanner.
- *
- * @since 3.1
- */
-public final class PropertyValueScanner extends AbstractJavaScanner {
-
- public class AssignmentDetector implements IWordDetector {
-
- /*
- * @see IWordDetector#isWordStart
- */
- public boolean isWordStart(char c) {
- if ('=' != c && ':' != c || fDocument == null)
- return false;
-
- try {
- // check whether it is the first '='
- IRegion lineInfo= fDocument.getLineInformationOfOffset(fOffset);
- int offset= lineInfo.getOffset();
- String line= fDocument.get(offset, lineInfo.getLength());
- int i= line.indexOf(c);
- return i != -1 && i + lineInfo.getOffset() + 1 == fOffset;
- } catch (BadLocationException ex) {
- return false;
- }
- }
-
- /*
- * @see IWordDetector#isWordPart
- */
- public boolean isWordPart(char c) {
- return false;
- }
- }
-
-
- private static String[] fgTokenProperties= {
- PreferenceConstants.PROPERTIES_FILE_COLORING_VALUE,
- PreferenceConstants.PROPERTIES_FILE_COLORING_ARGUMENT,
- PreferenceConstants.PROPERTIES_FILE_COLORING_ASSIGNMENT
- };
-
-
- /**
- * Creates a property value code scanner
- *
- * @param manager the color manager
- * @param store the preference store
- */
- public PropertyValueScanner(IColorManager manager, IPreferenceStore store) {
- super(manager, store);
- initialize();
- }
-
- /*
- * @see org.eclipse.wst.jsdt.internal.ui.text.AbstractJavaScanner#getTokenProperties()
- */
- protected String[] getTokenProperties() {
- return fgTokenProperties;
- }
-
- /*
- * @see org.eclipse.wst.jsdt.internal.ui.text.AbstractJavaScanner#createRules()
- */
- protected List createRules() {
- setDefaultReturnToken(getToken(PreferenceConstants.PROPERTIES_FILE_COLORING_VALUE));
- List rules= new ArrayList();
-
- // Add rule for arguments.
- IToken token= getToken(PreferenceConstants.PROPERTIES_FILE_COLORING_ARGUMENT);
- rules.add(new ArgumentRule(token));
-
- // Add word rule for assignment operator.
- token= getToken(PreferenceConstants.PROPERTIES_FILE_COLORING_ASSIGNMENT);
- WordRule wordRule= new WordRule(new AssignmentDetector(), token);
- rules.add(wordRule);
-
- // Add generic whitespace rule.
- rules.add(new WhitespaceRule(new JavaWhitespaceDetector()));
-
- return rules;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/code/ExtractMethodInputPage.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/code/ExtractMethodInputPage.java
index 62eee10..0423bf3 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/code/ExtractMethodInputPage.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/code/ExtractMethodInputPage.java
@@ -39,14 +39,13 @@
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration;
import org.eclipse.wst.jsdt.internal.corext.dom.ASTNodes;
import org.eclipse.wst.jsdt.internal.corext.refactoring.ParameterInfo;
import org.eclipse.wst.jsdt.internal.corext.refactoring.code.ExtractMethodRefactoring;
import org.eclipse.wst.jsdt.internal.corext.util.Messages;
import org.eclipse.wst.jsdt.internal.ui.IJavaHelpContextIds;
-import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
import org.eclipse.wst.jsdt.internal.ui.JavaPluginImages;
+import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
import org.eclipse.wst.jsdt.internal.ui.dialogs.TextFieldNavigationHandler;
import org.eclipse.wst.jsdt.internal.ui.javaeditor.JavaSourceViewer;
import org.eclipse.wst.jsdt.internal.ui.preferences.JavaPreferencesSettings;
@@ -236,9 +235,6 @@
return Messages.format(
RefactoringMessages.ExtractMethodInputPage_anonymous_type_label,
ASTNodes.asString(creation.getType()));
- } else if (node.getLocationInParent() == EnumConstantDeclaration.ANONYMOUS_CLASS_DECLARATION_PROPERTY) {
- EnumConstantDeclaration decl= (EnumConstantDeclaration)node.getParent();
- return decl.getName().getIdentifier();
}
}
return "UNKNOWN"; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/PasteAction.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/PasteAction.java
index f476a1f..66d502b 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/PasteAction.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/PasteAction.java
@@ -63,9 +63,9 @@
import org.eclipse.ui.actions.CopyProjectOperation;
import org.eclipse.ui.part.ResourceTransfer;
import org.eclipse.wst.jsdt.core.IIncludePathEntry;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IPackageDeclaration;
import org.eclipse.wst.jsdt.core.IPackageFragment;
import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
@@ -1137,8 +1137,6 @@
private static void insertToType(ASTRewrite rewrite, ASTNode node, AbstractTypeDeclaration typeDeclaration) {
switch (node.getNodeType()) {
- case ASTNode.ANNOTATION_TYPE_DECLARATION:
- case ASTNode.ENUM_DECLARATION:
case ASTNode.TYPE_DECLARATION:
case ASTNode.FUNCTION_DECLARATION:
case ASTNode.FIELD_DECLARATION:
@@ -1153,8 +1151,6 @@
private static void insertToCu(ASTRewrite rewrite, ASTNode node, JavaScriptUnit cuNode) {
switch (node.getNodeType()) {
case ASTNode.TYPE_DECLARATION:
- case ASTNode.ENUM_DECLARATION:
- case ASTNode.ANNOTATION_TYPE_DECLARATION:
rewrite.getListRewrite(cuNode, JavaScriptUnit.TYPES_PROPERTY).insertAt(node, ASTNodes.getInsertionIndex((AbstractTypeDeclaration) node, cuNode.types()), null);
break;
case ASTNode.IMPORT_DECLARATION:
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/MethodExitsFinder.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/MethodExitsFinder.java
index b407178..7b7f7b5 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/MethodExitsFinder.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/search/MethodExitsFinder.java
@@ -17,19 +17,17 @@
import org.eclipse.wst.jsdt.core.dom.AST;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.wst.jsdt.core.dom.Block;
import org.eclipse.wst.jsdt.core.dom.CatchClause;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.ConstructorInvocation;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.Name;
import org.eclipse.wst.jsdt.core.dom.ReturnStatement;
import org.eclipse.wst.jsdt.core.dom.SimpleName;
@@ -141,15 +139,6 @@
return false;
}
- public boolean visit(AnnotationTypeDeclaration node) {
- // Don't dive into a local type.
- return false;
- }
-
- public boolean visit(EnumDeclaration node) {
- // Don't dive into a local type.
- return false;
- }
public boolean visit(ReturnStatement node) {
fResult.add(node);
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ASTResolving.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ASTResolving.java
index 218d04f..fbd4d4b 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ASTResolving.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ASTResolving.java
@@ -24,7 +24,6 @@
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ASTParser;
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.Annotation;
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.wst.jsdt.core.dom.ArrayAccess;
import org.eclipse.wst.jsdt.core.dom.ArrayCreation;
@@ -35,12 +34,13 @@
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
import org.eclipse.wst.jsdt.core.dom.CastExpression;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.ConditionalExpression;
import org.eclipse.wst.jsdt.core.dom.ConstructorInvocation;
import org.eclipse.wst.jsdt.core.dom.Expression;
import org.eclipse.wst.jsdt.core.dom.FieldAccess;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
@@ -48,9 +48,7 @@
import org.eclipse.wst.jsdt.core.dom.InfixExpression;
import org.eclipse.wst.jsdt.core.dom.Initializer;
import org.eclipse.wst.jsdt.core.dom.InstanceofExpression;
-import org.eclipse.wst.jsdt.core.dom.MemberValuePair;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.Modifier;
import org.eclipse.wst.jsdt.core.dom.Name;
import org.eclipse.wst.jsdt.core.dom.ParameterizedType;
@@ -207,12 +205,6 @@
VariableDeclaration varDecl= (VariableDeclaration) initializerParent;
creationType= ASTNodes.getType(varDecl);
dim-= varDecl.getExtraDimensions();
- } else if (initializerParent instanceof MemberValuePair) {
- String name= ((MemberValuePair) initializerParent).getName().getIdentifier();
- IFunctionBinding annotMember= findAnnotationMember((Annotation) initializerParent.getParent(), name);
- if (annotMember != null) {
- return getReducedDimensionBinding(annotMember.getReturnType(), dim);
- }
}
if (creationType != null) {
while ((creationType instanceof ArrayType) && dim > 0) {
@@ -283,21 +275,6 @@
return parent.getAST().resolveWellKnownType("boolean"); //$NON-NLS-1$
}
return parent.getAST().resolveWellKnownType("java.lang.String"); //$NON-NLS-1$
- case ASTNode.SINGLE_MEMBER_ANNOTATION: {
- IFunctionBinding annotMember= findAnnotationMember((Annotation) parent, "value"); //$NON-NLS-1$
- if (annotMember != null) {
- return annotMember.getReturnType();
- }
- break;
- }
- case ASTNode.MEMBER_VALUE_PAIR: {
- String name= ((MemberValuePair) parent).getName().getIdentifier();
- IFunctionBinding annotMember= findAnnotationMember((Annotation) parent.getParent(), name);
- if (annotMember != null) {
- return annotMember.getReturnType();
- }
- break;
- }
default:
// do nothing
}
@@ -305,14 +282,6 @@
return null;
}
- private static IFunctionBinding findAnnotationMember(Annotation annotation, String name) {
- ITypeBinding annotBinding= annotation.resolveTypeBinding();
- if (annotBinding != null) {
- return Bindings.findMethodInType(annotBinding, name, (String[]) null);
- }
- return null;
- }
-
public static Type guessTypeForReference(AST ast, ASTNode node) {
ASTNode parent= node.getParent();
while (parent != null) {
@@ -741,9 +710,6 @@
public static boolean isInsideModifiers(ASTNode node) {
while (node != null && !(node instanceof BodyDeclaration)) {
- if (node instanceof Annotation) {
- return true;
- }
node= node.getParent();
}
return false;
@@ -850,9 +816,6 @@
kind= SimilarElementsRequestor.CLASSES;
}
break;
- case ASTNode.ENUM_DECLARATION:
- kind= SimilarElementsRequestor.INTERFACES;
- break;
case ASTNode.FUNCTION_DECLARATION:
if (node.getLocationInParent() == FunctionDeclaration.THROWN_EXCEPTIONS_PROPERTY) {
kind= SimilarElementsRequestor.CLASSES;
@@ -860,9 +823,6 @@
kind= SimilarElementsRequestor.ALL_TYPES | SimilarElementsRequestor.VOIDTYPE;
}
break;
- case ASTNode.ANNOTATION_TYPE_MEMBER_DECLARATION:
- kind= SimilarElementsRequestor.PRIMITIVETYPES | SimilarElementsRequestor.ANNOTATIONS | SimilarElementsRequestor.ENUMS;
- break;
case ASTNode.INSTANCEOF_EXPRESSION:
kind= SimilarElementsRequestor.REF_TYPES;
break;
@@ -885,11 +845,6 @@
case ASTNode.TAG_ELEMENT:
kind= SimilarElementsRequestor.REF_TYPES;
break;
- case ASTNode.MARKER_ANNOTATION:
- case ASTNode.SINGLE_MEMBER_ANNOTATION:
- case ASTNode.NORMAL_ANNOTATION:
- kind= SimilarElementsRequestor.ANNOTATIONS;
- break;
case ASTNode.TYPE_PARAMETER:
if (((TypeParameter) parent).typeBounds().indexOf(node) > 0) {
kind= SimilarElementsRequestor.INTERFACES;
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/AdvancedQuickAssistProcessor.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/AdvancedQuickAssistProcessor.java
index eca7a7e..1876200 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/AdvancedQuickAssistProcessor.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/AdvancedQuickAssistProcessor.java
@@ -35,19 +35,18 @@
import org.eclipse.wst.jsdt.core.dom.ConstructorInvocation;
import org.eclipse.wst.jsdt.core.dom.ContinueStatement;
import org.eclipse.wst.jsdt.core.dom.DoStatement;
-import org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration;
import org.eclipse.wst.jsdt.core.dom.Expression;
import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
import org.eclipse.wst.jsdt.core.dom.ForInStatement;
import org.eclipse.wst.jsdt.core.dom.ForStatement;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
import org.eclipse.wst.jsdt.core.dom.IfStatement;
import org.eclipse.wst.jsdt.core.dom.InfixExpression;
import org.eclipse.wst.jsdt.core.dom.InstanceofExpression;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
import org.eclipse.wst.jsdt.core.dom.Name;
import org.eclipse.wst.jsdt.core.dom.ParenthesizedExpression;
import org.eclipse.wst.jsdt.core.dom.PostfixExpression;
@@ -1990,7 +1989,6 @@
|| locationInParent == FunctionInvocation.ARGUMENTS_PROPERTY
|| locationInParent == ConstructorInvocation.ARGUMENTS_PROPERTY
|| locationInParent == SuperMethodInvocation.ARGUMENTS_PROPERTY
- || locationInParent == EnumConstantDeclaration.ARGUMENTS_PROPERTY
|| locationInParent == SuperConstructorInvocation.ARGUMENTS_PROPERTY
|| locationInParent == ClassInstanceCreation.ARGUMENTS_PROPERTY
|| locationInParent == ConditionalExpression.EXPRESSION_PROPERTY
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/JavadocTagsSubProcessor.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/JavadocTagsSubProcessor.java
index 386f60c..1d8c9ed 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/JavadocTagsSubProcessor.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/JavadocTagsSubProcessor.java
@@ -28,18 +28,17 @@
import org.eclipse.text.edits.TextEdit;
import org.eclipse.text.edits.TextEditGroup;
import org.eclipse.ui.ISharedImages;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.AST;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
-import org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.JSdoc;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.Name;
import org.eclipse.wst.jsdt.core.dom.PrimitiveType;
import org.eclipse.wst.jsdt.core.dom.SimpleName;
@@ -56,8 +55,8 @@
import org.eclipse.wst.jsdt.internal.corext.dom.ASTNodes;
import org.eclipse.wst.jsdt.internal.corext.dom.Bindings;
import org.eclipse.wst.jsdt.internal.corext.util.Strings;
-import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
import org.eclipse.wst.jsdt.internal.ui.JavaPluginImages;
+import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
import org.eclipse.wst.jsdt.internal.ui.JavaUIStatus;
import org.eclipse.wst.jsdt.ui.CodeGeneration;
import org.eclipse.wst.jsdt.ui.text.java.IInvocationContext;
@@ -403,12 +402,6 @@
String label= CorrectionMessages.JavadocTagsSubProcessor_addjavadoc_field_description;
proposals.add(new AddJavadocCommentProposal(label, cu, 1, declaration.getStartPosition(), comment));
}
- } else if (declaration instanceof EnumConstantDeclaration) {
- EnumConstantDeclaration enumDecl= (EnumConstantDeclaration) declaration;
- String id= enumDecl.getName().getIdentifier();
- String comment= CodeGeneration.getFieldComment(cu, binding.getName(), id, String.valueOf('\n'));
- String label= CorrectionMessages.JavadocTagsSubProcessor_addjavadoc_enumconst_description;
- proposals.add(new AddJavadocCommentProposal(label, cu, 1, declaration.getStartPosition(), comment));
}
}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ModifierCorrectionSubProcessor.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ModifierCorrectionSubProcessor.java
index b319d6f..af2b696 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ModifierCorrectionSubProcessor.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ModifierCorrectionSubProcessor.java
@@ -38,7 +38,6 @@
import org.eclipse.wst.jsdt.core.compiler.IProblem;
import org.eclipse.wst.jsdt.core.dom.AST;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.Annotation;
import org.eclipse.wst.jsdt.core.dom.Assignment;
import org.eclipse.wst.jsdt.core.dom.Block;
import org.eclipse.wst.jsdt.core.dom.CastExpression;
@@ -677,11 +676,6 @@
FunctionDeclaration methodDecl= (FunctionDeclaration) selectedNode;
AST ast= methodDecl.getAST();
ASTRewrite rewrite= ASTRewrite.create(ast);
- if (is50OrHigher) {
- Annotation annot= ast.newMarkerAnnotation();
- annot.setTypeName(ast.newName("Deprecated")); //$NON-NLS-1$
- rewrite.getListRewrite(methodDecl, methodDecl.getModifiersProperty()).insertFirst(annot, null);
- }
JSdoc javadoc= methodDecl.getJavadoc();
if (javadoc != null || !is50OrHigher) {
if (!is50OrHigher) {
@@ -700,24 +694,24 @@
}
public static void removeOverrideAnnotationProposal(IInvocationContext context, IProblemLocation problem, Collection proposals) throws CoreException {
- IJavaScriptUnit cu= context.getCompilationUnit();
-
- ASTNode selectedNode= problem.getCoveringNode(context.getASTRoot());
- if (!(selectedNode instanceof FunctionDeclaration)) {
- return;
- }
- FunctionDeclaration methodDecl= (FunctionDeclaration) selectedNode;
- Annotation annot= findAnnotation("java.lang.Override", methodDecl.modifiers()); //$NON-NLS-1$
- if (annot != null) {
- ASTRewrite rewrite= ASTRewrite.create(annot.getAST());
- rewrite.remove(annot, null);
- String label= CorrectionMessages.ModifierCorrectionSubProcessor_remove_override;
- Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
- ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, cu, rewrite, 6, image);
- proposals.add(proposal);
-
- QuickAssistProcessor.getCreateInSuperClassProposals(context, methodDecl.getName(), proposals);
- }
+// IJavaScriptUnit cu= context.getCompilationUnit();
+//
+// ASTNode selectedNode= problem.getCoveringNode(context.getASTRoot());
+// if (!(selectedNode instanceof FunctionDeclaration)) {
+// return;
+// }
+// FunctionDeclaration methodDecl= (FunctionDeclaration) selectedNode;
+// Annotation annot= findAnnotation("java.lang.Override", methodDecl.modifiers()); //$NON-NLS-1$
+// if (annot != null) {
+// ASTRewrite rewrite= ASTRewrite.create(annot.getAST());
+// rewrite.remove(annot, null);
+// String label= CorrectionMessages.ModifierCorrectionSubProcessor_remove_override;
+// Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
+// ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, cu, rewrite, 6, image);
+// proposals.add(proposal);
+//
+// QuickAssistProcessor.getCreateInSuperClassProposals(context, methodDecl.getName(), proposals);
+// }
}
private static final String KEY_MODIFIER= "modifier"; //$NON-NLS-1$
@@ -808,20 +802,6 @@
return null;
}
- private static Annotation findAnnotation(String qualifiedTypeName, List modifiers) {
- for (int i= 0; i < modifiers.size(); i++) {
- Object curr= modifiers.get(i);
- if (curr instanceof Annotation) {
- Annotation annot= (Annotation) curr;
- ITypeBinding binding= annot.getTypeName().resolveTypeBinding();
- if (binding != null && qualifiedTypeName.equals(binding.getQualifiedName())) {
- return annot;
- }
- }
- }
- return null;
- }
-
private static class ProposalParameter {
public final boolean useSuper;
public final IJavaScriptUnit compilationUnit;
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/NewVariableCompletionProposal.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/NewVariableCompletionProposal.java
index c2f8c65..dcbb8df 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/NewVariableCompletionProposal.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/NewVariableCompletionProposal.java
@@ -27,19 +27,17 @@
import org.eclipse.wst.jsdt.core.dom.Assignment;
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
import org.eclipse.wst.jsdt.core.dom.ChildListPropertyDescriptor;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.Expression;
import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
import org.eclipse.wst.jsdt.core.dom.ForStatement;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.Initializer;
import org.eclipse.wst.jsdt.core.dom.JSdoc;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.Modifier;
import org.eclipse.wst.jsdt.core.dom.QualifiedName;
import org.eclipse.wst.jsdt.core.dom.SimpleName;
@@ -101,8 +99,6 @@
return doAddField(cu);
case LOCAL:
return doAddLocal(cu);
- case ENUM_CONST:
- return doAddEnumConst(cu);
default:
throw new IllegalArgumentException("Unsupported variable kind: " + fVariableKind); //$NON-NLS-1$
}
@@ -493,33 +489,6 @@
return modifiers;
}
- private ASTRewrite doAddEnumConst(JavaScriptUnit astRoot) throws CoreException {
- SimpleName node= fOriginalNode;
-
- ASTNode newTypeDecl= astRoot.findDeclaringNode(fSenderBinding);
- if (newTypeDecl == null) {
- astRoot= ASTResolving.createQuickFixAST(getCompilationUnit(), null);
- newTypeDecl= astRoot.findDeclaringNode(fSenderBinding.getKey());
- }
-
- if (newTypeDecl != null) {
- AST ast= newTypeDecl.getAST();
-
- ASTRewrite rewrite= ASTRewrite.create(ast);
-
- EnumConstantDeclaration constDecl= ast.newEnumConstantDeclaration();
- constDecl.setName(ast.newSimpleName(node.getIdentifier()));
-
- ListRewrite listRewriter= rewrite.getListRewrite(newTypeDecl, EnumDeclaration.ENUM_CONSTANTS_PROPERTY);
- listRewriter.insertLast(constDecl, null);
-
- addLinkedPosition(rewrite.track(constDecl.getName()), false, KEY_NAME);
-
- return rewrite;
- }
- return null;
- }
-
/**
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/QuickFixProcessor.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/QuickFixProcessor.java
index 4d584b4..dac963b 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/QuickFixProcessor.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/QuickFixProcessor.java
@@ -19,7 +19,6 @@
import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.compiler.IProblem;
-import org.eclipse.wst.jsdt.internal.corext.util.JavaModelUtil;
import org.eclipse.wst.jsdt.ui.text.java.IInvocationContext;
import org.eclipse.wst.jsdt.ui.text.java.IJavaCompletionProposal;
import org.eclipse.wst.jsdt.ui.text.java.IProblemLocation;
@@ -187,9 +186,9 @@
case IProblem.UnhandledWarningToken:
return true;
default:
- if (JavaModelUtil.is50OrHigher(cu.getJavaScriptProject())) {
- return SuppressWarningsSubProcessor.hasSuppressWarningsProposal(problemId);
- }
+// if (JavaModelUtil.is50OrHigher(cu.getJavaScriptProject())) {
+// return SuppressWarningsSubProcessor.hasSuppressWarningsProposal(problemId);
+// }
return false;
}
}
@@ -536,13 +535,10 @@
case IProblem.FallthroughCase:
LocalCorrectionsSubProcessor.addFallThroughProposals(context, problem, proposals);
break;
- case IProblem.UnhandledWarningToken:
- SuppressWarningsSubProcessor.addUnknownSuppressWarningProposals(context, problem, proposals);
- break;
default:
}
- if (JavaModelUtil.is50OrHigher(context.getCompilationUnit().getJavaScriptProject())) {
- SuppressWarningsSubProcessor.addSuppressWarningsProposals(context, problem, proposals);
- }
+// if (JavaModelUtil.is50OrHigher(context.getCompilationUnit().getJavaScriptProject())) {
+// SuppressWarningsSubProcessor.addSuppressWarningsProposals(context, problem, proposals);
+// }
}
}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ReturnTypeSubProcessor.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ReturnTypeSubProcessor.java
index f54f94d..4735b17 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ReturnTypeSubProcessor.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/ReturnTypeSubProcessor.java
@@ -22,16 +22,14 @@
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.wst.jsdt.core.dom.Block;
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.Expression;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.JSdoc;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.PrimitiveType;
import org.eclipse.wst.jsdt.core.dom.ReturnStatement;
import org.eclipse.wst.jsdt.core.dom.TagElement;
@@ -94,13 +92,7 @@
return false;
}
- public boolean visit(EnumDeclaration node) {
- return false;
- }
- public boolean visit(AnnotationTypeDeclaration node) {
- return false;
- }
}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/SuppressWarningsSubProcessor.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/SuppressWarningsSubProcessor.java
deleted file mode 100644
index 16a00d7..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/SuppressWarningsSubProcessor.java
+++ /dev/null
@@ -1,308 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.jsdt.internal.ui.text.correction;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.jsdt.core.CorrectionEngine;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.Annotation;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeMemberDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ArrayInitializer;
-import org.eclipse.wst.jsdt.core.dom.ChildListPropertyDescriptor;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
-import org.eclipse.wst.jsdt.core.dom.Expression;
-import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
-import org.eclipse.wst.jsdt.core.dom.Initializer;
-import org.eclipse.wst.jsdt.core.dom.MemberValuePair;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.NormalAnnotation;
-import org.eclipse.wst.jsdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
-import org.eclipse.wst.jsdt.core.dom.StringLiteral;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationStatement;
-import org.eclipse.wst.jsdt.core.dom.rewrite.ASTRewrite;
-import org.eclipse.wst.jsdt.core.dom.rewrite.ListRewrite;
-import org.eclipse.wst.jsdt.internal.corext.util.Messages;
-import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
-import org.eclipse.wst.jsdt.internal.ui.JavaPluginImages;
-import org.eclipse.wst.jsdt.ui.text.java.IInvocationContext;
-import org.eclipse.wst.jsdt.ui.text.java.IProblemLocation;
-
-/**
- *
- */
-public class SuppressWarningsSubProcessor {
-
- private static final String ADD_SUPPRESSWARNINGS_ID= "org.eclipse.wst.jsdt.ui.correction.addSuppressWarnings"; //$NON-NLS-1$
-
- public static final boolean hasSuppressWarningsProposal(int problemId) {
- return CorrectionEngine.getWarningToken(problemId) != null; // Suppress warning annotations
- }
-
-
- public static void addSuppressWarningsProposals(IInvocationContext context, IProblemLocation problem, Collection proposals) {
- if (problem.isError()) {
- return;
- }
- String warningToken= CorrectionEngine.getWarningToken(problem.getProblemId());
- if (warningToken == null) {
- return;
- }
- for (Iterator iter= proposals.iterator(); iter.hasNext();) {
- Object element= iter.next();
- if (element instanceof SuppressWarningsProposal && warningToken.equals(((SuppressWarningsProposal) element).getWarningToken())) {
- return; // only one at a time
- }
- }
-
- ASTNode node= problem.getCoveringNode(context.getASTRoot());
- if (node == null) {
- return;
- }
- if (node.getLocationInParent() == VariableDeclarationFragment.NAME_PROPERTY) {
- ASTNode parent= node.getParent();
- if (parent.getLocationInParent() == VariableDeclarationStatement.FRAGMENTS_PROPERTY) {
- addSuppressWarningsProposal(context.getCompilationUnit(), parent.getParent(), warningToken, -2, proposals);
- return;
- }
- } else if (node.getLocationInParent() == SingleVariableDeclaration.NAME_PROPERTY) {
- addSuppressWarningsProposal(context.getCompilationUnit(), node.getParent(), warningToken, -2, proposals);
- return;
- } else if (node.getLocationInParent() == VariableDeclarationFragment.INITIALIZER_PROPERTY) {
- node= ASTResolving.findParentBodyDeclaration(node);
- if (node instanceof FieldDeclaration) {
- node= node.getParent();
- }
- }
-
- ASTNode target= ASTResolving.findParentBodyDeclaration(node);
- if (target instanceof Initializer) {
- target= ASTResolving.findParentBodyDeclaration(target.getParent());
- }
- if (target != null) {
- addSuppressWarningsProposal(context.getCompilationUnit(), target, warningToken, -3, proposals);
- }
- }
-
- private static String getFirstFragmentName(List fragments) {
- if (fragments.size() > 0) {
- return ((VariableDeclarationFragment) fragments.get(0)).getName().getIdentifier();
- }
- return new String();
- }
-
-
- private static class SuppressWarningsProposal extends ASTRewriteCorrectionProposal {
-
- private final String fWarningToken;
- private final ASTNode fNode;
- private final ChildListPropertyDescriptor fProperty;
-
- public SuppressWarningsProposal(String warningToken, String label, IJavaScriptUnit cu, ASTNode node, ChildListPropertyDescriptor property, int relevance) {
- super(label, cu, null, relevance, JavaPluginImages.get(JavaPluginImages.IMG_OBJS_ANNOTATION));
- fWarningToken= warningToken;
- fNode= node;
- fProperty= property;
- setCommandId(ADD_SUPPRESSWARNINGS_ID);
- }
-
- /**
- * @return Returns the warningToken.
- */
- public String getWarningToken() {
- return fWarningToken;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.internal.ui.text.correction.ASTRewriteCorrectionProposal#getRewrite()
- */
- protected ASTRewrite getRewrite() throws CoreException {
- AST ast= fNode.getAST();
- ASTRewrite rewrite= ASTRewrite.create(ast);
-
- StringLiteral newStringLiteral= ast.newStringLiteral();
- newStringLiteral.setLiteralValue(fWarningToken);
-
- Annotation existing= findExistingAnnotation((List) fNode.getStructuralProperty(fProperty));
- if (existing == null) {
- ListRewrite listRewrite= rewrite.getListRewrite(fNode, fProperty);
-
- SingleMemberAnnotation newAnnot= ast.newSingleMemberAnnotation();
- String importString= createImportRewrite((JavaScriptUnit) fNode.getRoot()).addImport("java.lang.SuppressWarnings"); //$NON-NLS-1$
- newAnnot.setTypeName(ast.newName(importString));
-
- newAnnot.setValue(newStringLiteral);
-
- listRewrite.insertFirst(newAnnot, null);
- } else if (existing instanceof SingleMemberAnnotation) {
- SingleMemberAnnotation annotation= (SingleMemberAnnotation) existing;
- Expression value= annotation.getValue();
- if (!addSuppressArgument(rewrite, value, newStringLiteral)) {
- rewrite.set(existing, SingleMemberAnnotation.VALUE_PROPERTY, newStringLiteral, null);
- }
- } else if (existing instanceof NormalAnnotation) {
- NormalAnnotation annotation= (NormalAnnotation) existing;
- Expression value= findValue(annotation.values());
- if (!addSuppressArgument(rewrite, value, newStringLiteral)) {
- ListRewrite listRewrite= rewrite.getListRewrite(annotation, NormalAnnotation.VALUES_PROPERTY);
- MemberValuePair pair= ast.newMemberValuePair();
- pair.setName(ast.newSimpleName("value")); //$NON-NLS-1$
- pair.setValue(newStringLiteral);
- listRewrite.insertFirst(pair, null);
- }
- }
- return rewrite;
- }
-
- private static boolean addSuppressArgument(ASTRewrite rewrite, Expression value, StringLiteral newStringLiteral) {
- if (value instanceof ArrayInitializer) {
- ListRewrite listRewrite= rewrite.getListRewrite(value, ArrayInitializer.EXPRESSIONS_PROPERTY);
- listRewrite.insertLast(newStringLiteral, null);
- } else if (value instanceof StringLiteral) {
- ArrayInitializer newArr= rewrite.getAST().newArrayInitializer();
- newArr.expressions().add(rewrite.createMoveTarget(value));
- newArr.expressions().add(newStringLiteral);
- rewrite.replace(value, newArr, null);
- } else {
- return false;
- }
- return true;
- }
-
- private static Expression findValue(List keyValues) {
- for (int i= 0, len= keyValues.size(); i < len; i++) {
- MemberValuePair curr= (MemberValuePair) keyValues.get(i);
- if ("value".equals(curr.getName().getIdentifier())) { //$NON-NLS-1$
- return curr.getValue();
- }
- }
- return null;
- }
-
- private static Annotation findExistingAnnotation(List modifiers) {
- for (int i= 0, len= modifiers.size(); i < len; i++) {
- Object curr= modifiers.get(i);
- if (curr instanceof NormalAnnotation || curr instanceof SingleMemberAnnotation) {
- Annotation annotation= (Annotation) curr;
- ITypeBinding typeBinding= annotation.resolveTypeBinding();
- if (typeBinding != null) {
- if ("java.lang.SuppressWarnings".equals(typeBinding.getQualifiedName())) { //$NON-NLS-1$
- return annotation;
- }
- } else {
- String fullyQualifiedName= annotation.getTypeName().getFullyQualifiedName();
- if ("SuppressWarnings".equals(fullyQualifiedName) || "java.lang.SuppressWarnings".equals(fullyQualifiedName)) { //$NON-NLS-1$ //$NON-NLS-2$
- return annotation;
- }
- }
- }
- }
- return null;
- }
- }
-
- private static void addSuppressWarningsProposal(IJavaScriptUnit cu, ASTNode node, String warningToken, int relevance, Collection proposals) {
-
- ChildListPropertyDescriptor property= null;
- String name;
- switch (node.getNodeType()) {
- case ASTNode.SINGLE_VARIABLE_DECLARATION:
- property= SingleVariableDeclaration.MODIFIERS2_PROPERTY;
- name= ((SingleVariableDeclaration) node).getName().getIdentifier();
- break;
- case ASTNode.VARIABLE_DECLARATION_STATEMENT:
- property= VariableDeclarationStatement.MODIFIERS2_PROPERTY;
- name= getFirstFragmentName(((VariableDeclarationStatement) node).fragments());
- break;
- case ASTNode.TYPE_DECLARATION:
- property= TypeDeclaration.MODIFIERS2_PROPERTY;
- name= ((TypeDeclaration) node).getName().getIdentifier();
- break;
- case ASTNode.ANNOTATION_TYPE_DECLARATION:
- property= AnnotationTypeDeclaration.MODIFIERS2_PROPERTY;
- name= ((AnnotationTypeDeclaration) node).getName().getIdentifier();
- break;
- case ASTNode.ENUM_DECLARATION:
- property= EnumDeclaration.MODIFIERS2_PROPERTY;
- name= ((EnumDeclaration) node).getName().getIdentifier();
- break;
- case ASTNode.FIELD_DECLARATION:
- property= FieldDeclaration.MODIFIERS2_PROPERTY;
- name= getFirstFragmentName(((FieldDeclaration) node).fragments());
- break;
- case ASTNode.INITIALIZER:
- property= Initializer.MODIFIERS2_PROPERTY;
- name= CorrectionMessages.SuppressWarningsSubProcessor_suppress_warnings_initializer_label;
- break;
- case ASTNode.FUNCTION_DECLARATION:
- property= FunctionDeclaration.MODIFIERS2_PROPERTY;
- name= ((FunctionDeclaration) node).getName().getIdentifier() + "()"; //$NON-NLS-1$
- break;
- case ASTNode.ANNOTATION_TYPE_MEMBER_DECLARATION:
- property= AnnotationTypeMemberDeclaration.MODIFIERS2_PROPERTY;
- name= ((AnnotationTypeMemberDeclaration) node).getName().getIdentifier() + "()"; //$NON-NLS-1$
- break;
- case ASTNode.ENUM_CONSTANT_DECLARATION:
- property= EnumConstantDeclaration.MODIFIERS2_PROPERTY;
- name= ((EnumConstantDeclaration) node).getName().getIdentifier();
- break;
- default:
- JavaScriptPlugin.logErrorMessage("SuppressWarning quick fix: wrong node kind: " + node.getNodeType()); //$NON-NLS-1$
- return;
- }
-
- String label= Messages.format(CorrectionMessages.SuppressWarningsSubProcessor_suppress_warnings_label, new String[] { warningToken, name });
- ASTRewriteCorrectionProposal proposal= new SuppressWarningsProposal(warningToken, label, cu, node, property, relevance);
-
- proposals.add(proposal);
- }
-
- public static void addUnknownSuppressWarningProposals(IInvocationContext context, IProblemLocation problem, Collection proposals) {
-
- ASTNode coveringNode= context.getCoveringNode();
- if (!(coveringNode instanceof StringLiteral))
- return;
-
- AST ast= coveringNode.getAST();
- StringLiteral literal= (StringLiteral) coveringNode;
-
- String literalValue= literal.getLiteralValue();
- String[] allWarningTokens= CorrectionEngine.getAllWarningTokens();
- for (int i= 0; i < allWarningTokens.length; i++) {
- String curr= allWarningTokens[i];
- if (NameMatcher.isSimilarName(literalValue, curr)) {
- StringLiteral newLiteral= ast.newStringLiteral();
- newLiteral.setLiteralValue(curr);
- ASTRewrite rewrite= ASTRewrite.create(ast);
- rewrite.replace(literal, newLiteral, null);
- String label= Messages.format(CorrectionMessages.SuppressWarningsSubProcessor_fix_suppress_token_label, new String[] { curr });
- Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
- ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, context.getCompilationUnit(), rewrite, 5, image);
- proposals.add(proposal);
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/TypeChangeCompletionProposal.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/TypeChangeCompletionProposal.java
index 0081263..a76ee19 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/TypeChangeCompletionProposal.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/TypeChangeCompletionProposal.java
@@ -17,14 +17,13 @@
import org.eclipse.wst.jsdt.core.dom.AST;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeMemberDeclaration;
import org.eclipse.wst.jsdt.core.dom.Block;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
import org.eclipse.wst.jsdt.core.dom.Type;
import org.eclipse.wst.jsdt.core.dom.VariableDeclarationExpression;
@@ -95,9 +94,6 @@
FunctionDeclaration methodDecl= (FunctionDeclaration) declNode;
rewrite.set(methodDecl, FunctionDeclaration.RETURN_TYPE2_PROPERTY, type, null);
rewrite.set(methodDecl, FunctionDeclaration.EXTRA_DIMENSIONS_PROPERTY, new Integer(0), null);
- } else if (declNode instanceof AnnotationTypeMemberDeclaration) {
- AnnotationTypeMemberDeclaration methodDecl= (AnnotationTypeMemberDeclaration) declNode;
- rewrite.set(methodDecl, AnnotationTypeMemberDeclaration.TYPE_PROPERTY, type, null);
} else if (declNode instanceof VariableDeclarationFragment) {
ASTNode parent= declNode.getParent();
if (parent instanceof FieldDeclaration) {
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/TypeMismatchSubProcessor.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/TypeMismatchSubProcessor.java
index 06e39f7..05677be 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/TypeMismatchSubProcessor.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/TypeMismatchSubProcessor.java
@@ -23,18 +23,16 @@
import org.eclipse.wst.jsdt.core.dom.Assignment;
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
import org.eclipse.wst.jsdt.core.dom.CastExpression;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.Expression;
import org.eclipse.wst.jsdt.core.dom.FieldAccess;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
-import org.eclipse.wst.jsdt.core.dom.MemberValuePair;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.Name;
-import org.eclipse.wst.jsdt.core.dom.SingleMemberAnnotation;
import org.eclipse.wst.jsdt.core.dom.SuperFieldAccess;
import org.eclipse.wst.jsdt.core.dom.SuperMethodInvocation;
import org.eclipse.wst.jsdt.core.dom.Type;
@@ -98,12 +96,6 @@
castTypeBinding= ASTNodes.getType(frag).resolveBinding();
receiverNode= frag.getName();
}
- } else if (parentNodeType == ASTNode.MEMBER_VALUE_PAIR) {
- receiverNode= ((MemberValuePair) selectedNode.getParent()).getName();
- castTypeBinding= ASTResolving.guessBindingForReference(nodeToCast);
- } else if (parentNodeType == ASTNode.SINGLE_MEMBER_ANNOTATION) {
- receiverNode= ((SingleMemberAnnotation) selectedNode.getParent()).getTypeName(); // use the type name
- castTypeBinding= ASTResolving.guessBindingForReference(nodeToCast);
} else {
// try to find the binding corresponding to 'castTypeName'
castTypeBinding= ASTResolving.guessBindingForReference(nodeToCast);
@@ -222,12 +214,6 @@
declaringType= methodBinding.getDeclaringClass().getTypeDeclaration();
callerBindingDecl= methodBinding.getMethodDeclaration();
}
- } else if (callerBinding instanceof ITypeBinding && nodeToCast.getLocationInParent() == SingleMemberAnnotation.TYPE_NAME_PROPERTY) {
- declaringType= (ITypeBinding) callerBinding;
- callerBindingDecl= Bindings.findMethodInType(declaringType, "value", (String[]) null); //$NON-NLS-1$
- if (callerBindingDecl == null) {
- return;
- }
}
if (declaringType != null && declaringType.isFromSource()) {
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/OverrideCompletionProposal.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/OverrideCompletionProposal.java
index 911748f..83b903d 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/OverrideCompletionProposal.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/OverrideCompletionProposal.java
@@ -24,8 +24,8 @@
import org.eclipse.jface.text.contentassist.ICompletionProposalExtension4;
import org.eclipse.text.edits.MalformedTreeException;
import org.eclipse.text.edits.TextEdit;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.AST;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ASTParser;
@@ -33,11 +33,10 @@
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.wst.jsdt.core.dom.ChildListPropertyDescriptor;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.rewrite.ASTRewrite;
import org.eclipse.wst.jsdt.core.dom.rewrite.ITrackedNodePosition;
import org.eclipse.wst.jsdt.core.dom.rewrite.ImportRewrite;
@@ -108,11 +107,6 @@
case ASTNode.CLASS_INSTANCE_CREATION:
binding= ((ClassInstanceCreation) node.getParent()).resolveTypeBinding();
break;
- case ASTNode.ENUM_CONSTANT_DECLARATION:
- IFunctionBinding methodBinding= ((EnumConstantDeclaration) node.getParent()).resolveConstructorBinding();
- if (methodBinding != null) {
- binding= methodBinding.getDeclaringClass();
- }
}
descriptor= AnonymousClassDeclaration.BODY_DECLARATIONS_PROPERTY;
} else if (node instanceof AbstractTypeDeclaration) {
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/DefaultSpellingEngine.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/DefaultSpellingEngine.java
index a99d039..25f99bf 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/DefaultSpellingEngine.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/DefaultSpellingEngine.java
@@ -55,8 +55,8 @@
public DefaultSpellingEngine() {
if (JAVA_CONTENT_TYPE != null)
fEngines.put(JAVA_CONTENT_TYPE, new JavaSpellingEngine());
- if (PROPERTIES_CONTENT_TYPE != null)
- fEngines.put(PROPERTIES_CONTENT_TYPE, new PropertiesFileSpellingEngine());
+// if (PROPERTIES_CONTENT_TYPE != null)
+// fEngines.put(PROPERTIES_CONTENT_TYPE, new PropertiesFileSpellingEngine());
if (TEXT_CONTENT_TYPE != null)
fEngines.put(TEXT_CONTENT_TYPE, new TextSpellingEngine());
}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/PropertiesFileSpellCheckIterator.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/PropertiesFileSpellCheckIterator.java
deleted file mode 100644
index a495040..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/PropertiesFileSpellCheckIterator.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.text.spelling;
-
-import java.util.Locale;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-
-import com.ibm.icu.text.BreakIterator;
-
-
-/**
- * Iterator to spell check Java properties files
- * where '&' is ignored.
- *
- * @since 3.3
- */
-public class PropertiesFileSpellCheckIterator extends SpellCheckIterator {
-
- public PropertiesFileSpellCheckIterator(IDocument document, IRegion region, Locale locale) {
- super(document, region, locale);
- }
-
- /*
- * @see org.eclipse.wst.jsdt.internal.ui.text.spelling.SpellCheckIterator#next()
- */
- public final Object next() {
- int previous= -1;
- String token= nextToken();
- while (fSuccessor != BreakIterator.DONE && (token == null || fContent.charAt(fNext) == '&')) {
- if (token != null) {
- if (previous == -1)
- previous= fPrevious;
- String nextToken= nextToken();
- if (nextToken != null)
- token= token + nextToken.substring(1);
- else
- token= token + '&';
- } else
- token= nextToken();
-
- }
-
- if (previous != -1)
- fPrevious= previous;
-
- if (token != null && token.length() > 1 && token.startsWith("&")) { //$NON-NLS-1$
- token= token.substring(1);
-
- // Add characters in front of '&'
- while (fPrevious > 0 && !Character.isWhitespace(fContent.charAt(fPrevious - 1)) && fContent.charAt(fPrevious - 1) != '=') {
- token= fContent.charAt(fPrevious - 1) + token;
- fPrevious--;
- }
-
- }
-
- fLastToken= token;
-
- return token;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/PropertiesFileSpellingEngine.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/PropertiesFileSpellingEngine.java
deleted file mode 100644
index 71ca1bc..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/spelling/PropertiesFileSpellingEngine.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.jsdt.internal.ui.text.spelling;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Locale;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.text.TypedRegion;
-import org.eclipse.ui.texteditor.spelling.ISpellingProblemCollector;
-import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
-import org.eclipse.wst.jsdt.internal.ui.propertiesfileeditor.IPropertiesFilePartitions;
-import org.eclipse.wst.jsdt.internal.ui.text.spelling.engine.ISpellChecker;
-import org.eclipse.wst.jsdt.internal.ui.text.spelling.engine.ISpellEventListener;
-import org.eclipse.wst.jsdt.ui.PreferenceConstants;
-
-/**
- * Properties file spelling engine
- *
- * @since 3.1
- */
-public class PropertiesFileSpellingEngine extends SpellingEngine {
-
- /*
- * @see org.eclipse.wst.jsdt.internal.ui.text.spelling.SpellingEngine#check(org.eclipse.jface.text.IDocument, org.eclipse.jface.text.IRegion[], org.eclipse.wst.jsdt.internal.ui.text.spelling.engine.ISpellChecker, org.eclipse.ui.texteditor.spelling.ISpellingProblemCollector, org.eclipse.core.runtime.IProgressMonitor)
- */
- protected void check(IDocument document, IRegion[] regions, ISpellChecker checker, ISpellingProblemCollector collector, IProgressMonitor monitor) {
- ISpellEventListener listener= new SpellEventListener(collector, document);
- boolean isIgnoringAmpersand= PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.SPELLING_IGNORE_AMPERSAND_IN_PROPERTIES);
- try {
- checker.addListener(listener);
- List partitionList= new ArrayList();
- for (int i= 0; i < regions.length; i++)
- partitionList.addAll(Arrays.asList(TextUtilities.computePartitioning(document, IPropertiesFilePartitions.PROPERTIES_FILE_PARTITIONING, regions[i].getOffset(), regions[i].getLength(), false)));
- ITypedRegion[] partitions= (ITypedRegion[]) partitionList.toArray(new ITypedRegion[partitionList.size()]);
-
- for (int i= 0; i < partitions.length; i++) {
- ITypedRegion partition= partitions[i];
- if (IPropertiesFilePartitions.COMMENT.equals(partition.getType())) {
- for (; i < partitions.length - 1; i++) {
- ITypedRegion next= partitions[i+1];
- int gapOffset= partition.getOffset() + partition.getLength();
- int gapLength= next.getOffset() - gapOffset;
- if ((IPropertiesFilePartitions.COMMENT.equals(next.getType()) || isWhitespace(document, next.getOffset(), next.getLength())) && isWhitespace(document, gapOffset, gapLength))
- partition= new TypedRegion(partition.getOffset(), next.getOffset() + next.getLength() - partition.getOffset(), partition.getType());
- else
- break;
- }
- }
- String partitionType= partition.getType();
- if (IPropertiesFilePartitions.COMMENT.equals(partitionType) || (!isIgnoringAmpersand && IPropertiesFilePartitions.PROPERTY_VALUE.equals(partitionType))) {
- Locale locale= checker.getLocale();
- checker.execute(new SpellCheckIterator(document, partition, locale));
- } else if (isIgnoringAmpersand && IPropertiesFilePartitions.PROPERTY_VALUE.equals(partitionType)) {
- Locale locale= checker.getLocale();
- checker.execute(new PropertiesFileSpellCheckIterator(document, partition, locale));
- }
- }
- } catch (BadLocationException x) {
- JavaScriptPlugin.log(x);
- } finally {
- checker.removeListener(listener);
- }
- }
-
- /**
- * Returns <code>true</code> iff the given region contains only
- * whitespace.
- *
- * @param document the document
- * @param offset the region's offset
- * @param length the region's length
- * @return <code>true</code> iff the given region contains only
- * whitespace
- */
- private boolean isWhitespace(IDocument document, int offset, int length) {
- try {
- for (int i= 0; i < length; i++)
- if (!Character.isWhitespace(document.getChar(offset + i)))
- return false;
- return true;
- } catch (BadLocationException x) {
- JavaScriptPlugin.log(x);
- return false;
- }
- }
-}