Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-dev] declare to declaration

We talked about changing the use of "declare" as an identifier to unblock the product tests which use ajc to compile the AspectJ sources. (See bugs 37069 and 41785.) This also blocks a JUnit performance test under development which similarly uses the AspectJ sources to signal significant performance changes.

Since it's just renaming an identifier, I plan to check this in before the next candidate so the tests can complete, unless I hear soon that Mik has done it.

Wes

--- patch
Index: src/org/aspectj/ajdt/internal/compiler/ast/DeclareDeclaration.java
===================================================================
RCS file: /home/technology/org.aspectj/modules/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/DeclareDeclaration.java,v
retrieving revision 1.6
diff -u -r1.6 DeclareDeclaration.java
--- src/org/aspectj/ajdt/internal/compiler/ast/DeclareDeclaration.java 8 Mar 2003 03:02:28 -0000 1.6 +++ src/org/aspectj/ajdt/internal/compiler/ast/DeclareDeclaration.java 4 Sep 2003 21:06:01 -0000
@@ -26,7 +26,7 @@
 import org.eclipse.jdt.internal.compiler.parser.Parser;

 public class DeclareDeclaration extends MethodDeclaration {
-	public Declare declare;
+	public Declare declaration;

 	/**
 	 * Constructor for IntraTypeDeclaration.
@@ -34,12 +34,12 @@
 	static int counter = 0; //XXX evil
public DeclareDeclaration(CompilationResult result, Declare symbolicDeclare) {
 		super(result);
-		this.declare = symbolicDeclare;
-		if (declare != null) {
+		this.declaration = symbolicDeclare;
+		if (declaration != null) {
 			// AMC added init of declarationSourceXXX fields which are used
 			// in AsmBuilder for processing of MethodDeclaration locations.
-			declarationSourceStart = sourceStart = declare.getStart();
-			declarationSourceEnd = sourceEnd = declare.getEnd();
+			declarationSourceStart = sourceStart = declaration.getStart();
+			declarationSourceEnd = sourceEnd = declaration.getEnd();
 		}
 		//??? we might need to set parameters to be empty
 		this.returnType = TypeReference.baseTypeReference(T_void, 0);
@@ -53,7 +53,7 @@
 	 * method.
 	 */
 	public void generateCode(ClassScope classScope, ClassFile classFile) {
- classFile.extraAttributes.add(new EclipseAttributeAdapter(new AjAttribute.DeclareAttribute(declare))); + classFile.extraAttributes.add(new EclipseAttributeAdapter(new AjAttribute.DeclareAttribute(declaration)));
 		return;
 	}

@@ -80,12 +80,12 @@

 	
 	public Declare build(ClassScope classScope) {
-		if (declare == null) return null;
+		if (declaration == null) return null;

EclipseScope scope = new EclipseScope(new FormalBinding[0], classScope);

-        declare.resolve(scope);
-        return declare;
+        declaration.resolve(scope);
+        return declaration;
 	}


@@ -94,7 +94,7 @@


     public String toString(int tab) {
-    	if (declare == null) return tabString(tab) + "<declare>";
-    	else return tabString(tab) + declare.toString();
+    	if (declaration == null) return tabString(tab) + "<declare>";
+    	else return tabString(tab) + declaration.toString();
     }
 }
Index: src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java
===================================================================
RCS file: /home/technology/org.aspectj/modules/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java,v
retrieving revision 1.1
diff -u -r1.1 AsmElementFormatter.java
--- src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java 14 Aug 2003 09:09:25 -0000 1.1 +++ src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java 4 Sep 2003 21:06:04 -0000
@@ -77,10 +77,10 @@
 			setParameters(methodDeclaration, node);
 			
 		} else if (methodDeclaration instanceof DeclareDeclaration) {
-			DeclareDeclaration declare = (DeclareDeclaration)methodDeclaration;
+ DeclareDeclaration declareDeclaration = (DeclareDeclaration)methodDeclaration;
 			String name = DEC_LABEL + " ";
-			if (declare.declare instanceof DeclareErrorOrWarning) {
-				DeclareErrorOrWarning deow = (DeclareErrorOrWarning)declare.declare;
+			if (declareDeclaration.declaration instanceof DeclareErrorOrWarning) {
+ DeclareErrorOrWarning deow = (DeclareErrorOrWarning)declareDeclaration.declaration;
 				
 				if (deow.isError()) {
 					node.setKind( IProgramElement.Kind.DECLARE_ERROR);
@@ -92,21 +92,21 @@
 				node.setName(name) ;
 				node.setDetails("\"" + genDeclareMessage(deow.getMessage()) + "\"");
 				
-			} else if (declare.declare instanceof DeclareParents) {
+			} else if (declareDeclaration.declaration instanceof DeclareParents) {
 				node.setKind( IProgramElement.Kind.DECLARE_PARENTS);
-				DeclareParents dp = (DeclareParents)declare.declare;
+				DeclareParents dp = (DeclareParents)declareDeclaration.declaration;
 				node.setName(name + DECLARE_PARENTS);
 				node.setDetails(genTypePatternLabel(dp.getChild()));	
 				
-			} else if (declare.declare instanceof DeclareSoft) {
+			} else if (declareDeclaration.declaration instanceof DeclareSoft) {
 				node.setKind( IProgramElement.Kind.DECLARE_SOFT);
-				DeclareSoft ds = (DeclareSoft)declare.declare;
+				DeclareSoft ds = (DeclareSoft)declareDeclaration.declaration;
 				node.setName(name + DECLARE_SOFT);
 				node.setDetails(genTypePatternLabel(ds.getException()));
 				
-			} else if (declare.declare instanceof DeclarePrecedence) {
+ } else if (declareDeclaration.declaration instanceof DeclarePrecedence) {
 				node.setKind( IProgramElement.Kind.DECLARE_PRECEDENCE);
-				DeclarePrecedence ds = (DeclarePrecedence)declare.declare;
+ DeclarePrecedence ds = (DeclarePrecedence)declareDeclaration.declaration;
 				node.setName(name + DECLARE_PRECEDENCE);
 				node.setDetails(genPrecedenceListLabel(ds.getPatterns()));
 				








Back to the top