From 114db350a407be5b0aa00d1b8b3baa60aa6911e2 Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 22 Jan 2008 18:48:29 +0000 Subject: [PATCH] bug 203384: getting ontype information from the AST --- .../org/eclipse/jdt/core/dom/AjASTConverter.java | 3 +++ .../jdt/core/dom/InterTypeFieldDeclaration.java | 10 ++++++++++ .../jdt/core/dom/InterTypeMethodDeclaration.java | 10 ++++++++++ 3 files changed, 23 insertions(+) diff --git a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AjASTConverter.java b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AjASTConverter.java index 15e80d339..2f88951b0 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AjASTConverter.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AjASTConverter.java @@ -226,8 +226,10 @@ public class AjASTConverter extends ASTConverter { return convert((InterTypeFieldDeclaration) methodDeclaration); } else if (methodDeclaration instanceof InterTypeMethodDeclaration){ methodDecl = new org.aspectj.org.eclipse.jdt.core.dom.InterTypeMethodDeclaration(this.ast); + ((org.aspectj.org.eclipse.jdt.core.dom.InterTypeMethodDeclaration) methodDecl).setOnType(((InterTypeMethodDeclaration) methodDeclaration).getOnType().toString()); } else if (methodDeclaration instanceof InterTypeConstructorDeclaration){ methodDecl = new org.aspectj.org.eclipse.jdt.core.dom.InterTypeMethodDeclaration(this.ast); + ((org.aspectj.org.eclipse.jdt.core.dom.InterTypeMethodDeclaration) methodDecl).setOnType(((InterTypeConstructorDeclaration) methodDeclaration).getOnType().toString()); methodDecl.setConstructor(true); } else if (methodDeclaration instanceof PointcutDeclaration){ return convert((PointcutDeclaration) methodDeclaration); @@ -507,6 +509,7 @@ public class AjASTConverter extends ASTConverter { if (!(this.resolveBindings && binding == null)) { convert(fieldDecl.javadoc, fieldDeclaration); } + fieldDeclaration.setOnType(fieldDecl.getOnType().toString()); return fieldDeclaration; } public ASTNode convert(PointcutDeclaration pointcutDeclaration) { diff --git a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/InterTypeFieldDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/InterTypeFieldDeclaration.java index 5307c4bef..80859baf3 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/InterTypeFieldDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/InterTypeFieldDeclaration.java @@ -27,9 +27,19 @@ package org.aspectj.org.eclipse.jdt.core.dom; */ public class InterTypeFieldDeclaration extends FieldDeclaration { + private String onType; + InterTypeFieldDeclaration(AST ast) { super(ast); } + + public String getOnType() { + return onType; + } + + public void setOnType(String onType) { + this.onType = onType; + } ASTNode clone0(AST target) { InterTypeFieldDeclaration result = new InterTypeFieldDeclaration(target); diff --git a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/InterTypeMethodDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/InterTypeMethodDeclaration.java index 9daecd31c..9aa4ba978 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/InterTypeMethodDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/InterTypeMethodDeclaration.java @@ -28,10 +28,20 @@ import org.aspectj.org.eclipse.jdt.core.dom.Type; */ public class InterTypeMethodDeclaration extends MethodDeclaration { + private String onType; + InterTypeMethodDeclaration(AST ast) { super(ast); } + public String getOnType() { + return onType; + } + + public void setOnType(String onType) { + this.onType = onType; + } + /* (omit javadoc for this method) * Method declared on ASTNode. */ -- 2.39.5