Lines 20-25
Link Here
|
20 |
import org.aspectj.ajdt.internal.compiler.ast.AspectDeclaration; |
20 |
import org.aspectj.ajdt.internal.compiler.ast.AspectDeclaration; |
21 |
import org.aspectj.ajdt.internal.compiler.ast.DeclareDeclaration; |
21 |
import org.aspectj.ajdt.internal.compiler.ast.DeclareDeclaration; |
22 |
import org.aspectj.ajdt.internal.compiler.ast.InterTypeConstructorDeclaration; |
22 |
import org.aspectj.ajdt.internal.compiler.ast.InterTypeConstructorDeclaration; |
|
|
23 |
import org.aspectj.ajdt.internal.compiler.ast.InterTypeDeclaration; |
23 |
import org.aspectj.ajdt.internal.compiler.ast.InterTypeFieldDeclaration; |
24 |
import org.aspectj.ajdt.internal.compiler.ast.InterTypeFieldDeclaration; |
24 |
import org.aspectj.ajdt.internal.compiler.ast.InterTypeMethodDeclaration; |
25 |
import org.aspectj.ajdt.internal.compiler.ast.InterTypeMethodDeclaration; |
25 |
import org.aspectj.ajdt.internal.compiler.ast.PointcutDeclaration; |
26 |
import org.aspectj.ajdt.internal.compiler.ast.PointcutDeclaration; |
Lines 204-210
Link Here
|
204 |
return convert((org.aspectj.org.eclipse.jdt.internal.compiler.ast.AnnotationMethodDeclaration) methodDeclaration); |
205 |
return convert((org.aspectj.org.eclipse.jdt.internal.compiler.ast.AnnotationMethodDeclaration) methodDeclaration); |
205 |
} |
206 |
} |
206 |
MethodDeclaration methodDecl = new MethodDeclaration(this.ast); |
207 |
MethodDeclaration methodDecl = new MethodDeclaration(this.ast); |
207 |
setModifiers(methodDecl, methodDeclaration); |
|
|
208 |
boolean isConstructor = methodDeclaration.isConstructor(); |
208 |
boolean isConstructor = methodDeclaration.isConstructor(); |
209 |
methodDecl.setConstructor(isConstructor); |
209 |
methodDecl.setConstructor(isConstructor); |
210 |
|
210 |
|
Lines 225-236
Link Here
|
225 |
} |
225 |
} |
226 |
///////////////////////// |
226 |
///////////////////////// |
227 |
|
227 |
|
|
|
228 |
// set modifiers after checking whether we're an itd, otherwise |
229 |
// the modifiers are not set on the correct object. |
230 |
setModifiers(methodDecl, methodDeclaration); |
231 |
|
232 |
// for ITD's use the declaredSelector |
228 |
final SimpleName methodName = new SimpleName(this.ast); |
233 |
final SimpleName methodName = new SimpleName(this.ast); |
229 |
methodName.internalSetIdentifier(new String(methodDeclaration.selector)); |
234 |
if (methodDeclaration instanceof InterTypeDeclaration) { |
|
|
235 |
InterTypeDeclaration itd = (InterTypeDeclaration) methodDeclaration; |
236 |
methodName.internalSetIdentifier(new String(itd.getDeclaredSelector())); |
237 |
} else { |
238 |
methodName.internalSetIdentifier(new String(methodDeclaration.selector)); |
239 |
} |
230 |
int start = methodDeclaration.sourceStart; |
240 |
int start = methodDeclaration.sourceStart; |
231 |
int end = retrieveIdentifierEndPosition(start, methodDeclaration.sourceEnd); |
241 |
int end = retrieveIdentifierEndPosition(start, methodDeclaration.sourceEnd); |
232 |
methodName.setSourceRange(start, end - start + 1); |
242 |
methodName.setSourceRange(start, end - start + 1); |
233 |
methodDecl.setName(methodName); |
243 |
methodDecl.setName(methodName); |
|
|
244 |
|
234 |
org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeReference[] thrownExceptions = methodDeclaration.thrownExceptions; |
245 |
org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeReference[] thrownExceptions = methodDeclaration.thrownExceptions; |
235 |
if (thrownExceptions != null) { |
246 |
if (thrownExceptions != null) { |
236 |
int thrownExceptionsLength = thrownExceptions.length; |
247 |
int thrownExceptionsLength = thrownExceptions.length; |
Lines 3580-3586
Link Here
|
3580 |
// ajh02: method added |
3591 |
// ajh02: method added |
3581 |
switch(this.ast.apiLevel) { |
3592 |
switch(this.ast.apiLevel) { |
3582 |
case AST.JLS2_INTERNAL : |
3593 |
case AST.JLS2_INTERNAL : |
3583 |
fieldDeclaration.internalSetModifiers(fieldDecl.modifiers & CompilerModifiers.AccJustFlag); |
3594 |
fieldDeclaration.internalSetModifiers(fieldDecl.declaredModifiers & CompilerModifiers.AccJustFlag); |
3584 |
if (fieldDecl.annotations != null) { |
3595 |
if (fieldDecl.annotations != null) { |
3585 |
fieldDeclaration.setFlags(fieldDeclaration.getFlags() | ASTNode.MALFORMED); |
3596 |
fieldDeclaration.setFlags(fieldDeclaration.getFlags() | ASTNode.MALFORMED); |
3586 |
} |
3597 |
} |
Lines 3615-3621
Link Here
|
3615 |
protected void setModifiers(MethodDeclaration methodDecl, AbstractMethodDeclaration methodDeclaration) { |
3626 |
protected void setModifiers(MethodDeclaration methodDecl, AbstractMethodDeclaration methodDeclaration) { |
3616 |
switch(this.ast.apiLevel) { |
3627 |
switch(this.ast.apiLevel) { |
3617 |
case AST.JLS2_INTERNAL : |
3628 |
case AST.JLS2_INTERNAL : |
3618 |
methodDecl.internalSetModifiers(methodDeclaration.modifiers & CompilerModifiers.AccJustFlag); |
3629 |
if (methodDeclaration instanceof InterTypeDeclaration) { |
|
|
3630 |
methodDecl.internalSetModifiers(((InterTypeDeclaration)methodDeclaration).declaredModifiers & CompilerModifiers.AccJustFlag); |
3631 |
} else { |
3632 |
methodDecl.internalSetModifiers(methodDeclaration.modifiers & CompilerModifiers.AccJustFlag); |
3633 |
} |
3619 |
if (methodDeclaration.annotations != null) { |
3634 |
if (methodDeclaration.annotations != null) { |
3620 |
methodDecl.setFlags(methodDecl.getFlags() | ASTNode.MALFORMED); |
3635 |
methodDecl.setFlags(methodDecl.getFlags() | ASTNode.MALFORMED); |
3621 |
} |
3636 |
} |