Browse Source

source locations for declare annos (not persisted) and fqname of handles for itds

tags/V1_6_10RC1
aclement 14 years ago
parent
commit
e2dafb1fe9

+ 1
- 1
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/DeclareAnnotationDeclaration.java View File

@@ -35,7 +35,7 @@ public class DeclareAnnotationDeclaration extends DeclareDeclaration {
return; // there is an error that will already be getting reported (e.g. incorrect pattern on decaf/decac)
}
symbolicDeclare.setAnnotationString(annotation.toString());
symbolicDeclare.setAnnotationLocation(annotation.sourceStart, annotation.sourceEnd);
}

public void analyseCode(ClassScope classScope, InitializationFlowContext initializationContext, FlowInfo flowInfo) {

+ 2
- 0
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java View File

@@ -172,6 +172,8 @@ public class AsmElementFormatter {
InterTypeDeclaration itd = (InterTypeDeclaration) methodDeclaration;
String fqname = itd.getOnType().toString();
if (fqname.indexOf(".") != -1) {
// TODO the string handling round here is embarrassing
node.addFullyQualifiedName(fqname + "." + new String(itd.getDeclaredSelector()));
fqname = fqname.substring(fqname.lastIndexOf(".") + 1);
}
String name = fqname + "." + new String(itd.getDeclaredSelector());

+ 15
- 9
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AjASTConverter.java View File

@@ -400,24 +400,32 @@ public class AjASTConverter extends ASTConverter {
declareDeclaration = new DeclareAtTypeDeclaration(this.ast);
((DeclareAtTypeDeclaration) declareDeclaration).setPatternNode(convert(da.getTypePattern()));
SimpleName annotationName = new SimpleName(this.ast);
annotationName.setSourceRange(da.getAnnotationSourceStart(),
da.getAnnotationSourceEnd() - da.getAnnotationSourceStart());
annotationName.internalSetIdentifier(da.getAnnotationString());
((DeclareAtTypeDeclaration) declareDeclaration).setAnnotationName(annotationName);
} else if (da.getKind().equals(DeclareAnnotation.AT_CONSTRUCTOR)) {
declareDeclaration = new DeclareAtConstructorDeclaration(this.ast);
((DeclareAtConstructorDeclaration) declareDeclaration).setPatternNode(convert(da.getSignaturePattern()));
SimpleName annotationName = new SimpleName(this.ast);
annotationName.setSourceRange(da.getAnnotationSourceStart(),
da.getAnnotationSourceEnd() - da.getAnnotationSourceStart());
annotationName.internalSetIdentifier(da.getAnnotationString());
((DeclareAtConstructorDeclaration) declareDeclaration).setAnnotationName(annotationName);
} else if (da.getKind().equals(DeclareAnnotation.AT_FIELD)) {
declareDeclaration = new DeclareAtFieldDeclaration(this.ast);
((DeclareAtFieldDeclaration) declareDeclaration).setPatternNode(convert(da.getSignaturePattern()));
SimpleName annotationName = new SimpleName(this.ast);
annotationName.setSourceRange(da.getAnnotationSourceStart(),
da.getAnnotationSourceEnd() - da.getAnnotationSourceStart());
annotationName.internalSetIdentifier(da.getAnnotationString());
((DeclareAtFieldDeclaration) declareDeclaration).setAnnotationName(annotationName);
} else if (da.getKind().equals(DeclareAnnotation.AT_METHOD)) {
declareDeclaration = new DeclareAtMethodDeclaration(this.ast);
((DeclareAtMethodDeclaration) declareDeclaration).setPatternNode(convert(da.getSignaturePattern()));
SimpleName annotationName = new SimpleName(this.ast);
annotationName.setSourceRange(da.getAnnotationSourceStart(),
da.getAnnotationSourceEnd() - da.getAnnotationSourceStart());
annotationName.internalSetIdentifier(da.getAnnotationString());
((DeclareAtMethodDeclaration) declareDeclaration).setAnnotationName(annotationName);
}
@@ -750,7 +758,7 @@ public class AjASTConverter extends ASTConverter {
// }
// arrayCreation.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1);
// org.aspectj.org.eclipse.jdt.internal.compiler.ast.Expression[] dimensions = expression.dimensions;
//
//
// int dimensionsLength = dimensions.length;
// for (int i = 0; i < dimensionsLength; i++) {
// if (dimensions[i] != null) {
@@ -971,7 +979,7 @@ public class AjASTConverter extends ASTConverter {
// case org.aspectj.org.eclipse.jdt.internal.compiler.ast.OperatorIds.LESS :
// infixExpression.setOperator(InfixExpression.Operator.LESS);
// }
//
//
// if (expression.left instanceof org.aspectj.org.eclipse.jdt.internal.compiler.ast.BinaryExpression
// && ((expression.left.bits & org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode.ParenthesizedMASK) == 0)) {
// // create an extended string literal equivalent => use the extended operands list
@@ -1000,7 +1008,7 @@ public class AjASTConverter extends ASTConverter {
// for (int i = 0; i < size - 1; i++) {
// Expression expr = temp;
// temp = new InfixExpression(this.ast);
//
//
// if (this.resolveBindings) {
// this.recordNodes(temp, expression);
// }
@@ -1559,8 +1567,7 @@ public class AjASTConverter extends ASTConverter {
for (int i = 1; i < initializationsLength; i++) {
variableDeclarationExpression
.fragments()
.add(
convertToVariableDeclarationFragment((org.aspectj.org.eclipse.jdt.internal.compiler.ast.LocalDeclaration) initializations[i]));
.add(convertToVariableDeclarationFragment((org.aspectj.org.eclipse.jdt.internal.compiler.ast.LocalDeclaration) initializations[i]));
}
if (initializationsLength != 1) {
int start = variableDeclarationExpression.getStartPosition();
@@ -2178,8 +2185,7 @@ public class AjASTConverter extends ASTConverter {
if (typeDeclaration.modifiersSourceStart != -1) {
setModifiers(typeDecl, typeDeclaration);
}
typeDecl
.setInterface(org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.kind(typeDeclaration.modifiers) == org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.INTERFACE_DECL);
typeDecl.setInterface(org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.kind(typeDeclaration.modifiers) == org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.INTERFACE_DECL);
final SimpleName typeName = new SimpleName(this.ast);
typeName.internalSetIdentifier(new String(typeDeclaration.name));
typeName.setSourceRange(typeDeclaration.sourceStart, typeDeclaration.sourceEnd - typeDeclaration.sourceStart + 1);
@@ -2350,8 +2356,8 @@ public class AjASTConverter extends ASTConverter {
variableDeclarationExpression.setSourceRange(localDeclaration.declarationSourceStart, localDeclaration.declarationSourceEnd
- localDeclaration.declarationSourceStart + 1);
Type type = convertType(localDeclaration.type);
setTypeForVariableDeclarationExpression(variableDeclarationExpression, type, variableDeclarationFragment
.getExtraDimensions());
setTypeForVariableDeclarationExpression(variableDeclarationExpression, type,
variableDeclarationFragment.getExtraDimensions());
if (localDeclaration.modifiersSourceStart != -1) {
setModifiers(variableDeclarationExpression, localDeclaration);
}

Loading…
Cancel
Save