aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
authoraclement <aclement>2004-04-08 10:46:58 +0000
committeraclement <aclement>2004-04-08 10:46:58 +0000
commitb0d32cafba6241023d1efdc343a2744a5e25a00d (patch)
tree5220bad10475b981e35e4756fd1f1ab703d2a0db /org.aspectj.ajdt.core
parent3d8ddd7949c38db87d7b31eac6722bebd92317ae (diff)
downloadaspectj-b0d32cafba6241023d1efdc343a2744a5e25a00d.tar.gz
aspectj-b0d32cafba6241023d1efdc343a2744a5e25a00d.zip
Fix for Bugzilla Bug 57436
Java 1.5 fails to run classes produced by ajc [ Not the perfect fix, but passes all the tests I can find - lets see what the build machine thinks of it...]
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java
index 27db10c3e..36d270870 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java
@@ -23,6 +23,7 @@ import org.eclipse.jdt.internal.compiler.ClassFile;
import org.eclipse.jdt.internal.compiler.CompilationResult;
//import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
import org.eclipse.jdt.internal.compiler.ast.Clinit;
+import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration;
//import org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration;
import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
import org.eclipse.jdt.internal.compiler.codegen.CodeStream;
@@ -294,8 +295,15 @@ public class AspectDeclaration extends TypeDeclaration {
int codeAttributeOffset = classFile.contentsOffset;
classFile.generateCodeAttributeHeader();
CodeStream codeStream = classFile.codeStream;
- codeStream.init(classFile);
- codeStream.initializeMaxLocals(methodBinding);
+
+ // Use reset() rather than init()
+ // XXX We need a scope to keep reset happy, initializerScope is *not* the right one, but it works !
+// codeStream.init(classFile);
+// codeStream.initializeMaxLocals(methodBinding);
+ MethodDeclaration md = AstUtil.makeMethodDeclaration(methodBinding);
+ md.scope = initializerScope;
+ codeStream.reset(md,classFile);
+
// body starts here
gen.generate(codeStream);
// body ends here