summaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
authoraclement <aclement>2006-03-18 11:59:16 +0000
committeraclement <aclement>2006-03-18 11:59:16 +0000
commit7e4b7dafc0b6d20fb2b17e9bc4a12fd7d8934471 (patch)
tree912f029abebbf3d1219eefd862fba9c554fdbeab /org.aspectj.ajdt.core
parent9dca72e7c63a5623f3d442bf43bb88810368a65a (diff)
downloadaspectj-7e4b7dafc0b6d20fb2b17e9bc4a12fd7d8934471.tar.gz
aspectj-7e4b7dafc0b6d20fb2b17e9bc4a12fd7d8934471.zip
128650: more memory stuff
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java6
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceLocation.java16
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java2
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EclipseSourceContext.java4
4 files changed, 19 insertions, 9 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java
index b00f606fa..df36ecebb 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java
@@ -25,6 +25,7 @@ import java.util.Set;
import org.aspectj.ajdt.internal.compiler.ast.AspectDeclaration;
import org.aspectj.ajdt.internal.compiler.ast.PointcutDeclaration;
+import org.aspectj.asm.AsmManager;
import org.aspectj.bridge.IMessage;
import org.aspectj.bridge.MessageUtil;
import org.aspectj.bridge.WeaveMessage;
@@ -117,6 +118,7 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
//??? duplicates some of super's code
public void completeTypeBindings() {
+ AsmManager.setCompletingTypeBindings(true);
ContextToken completeTypeBindingsToken = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.COMPLETING_TYPE_BINDINGS, "");
// builtInterTypesAndPerClauses = false;
//pendingTypesToWeave = new ArrayList();
@@ -251,8 +253,8 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
stepCompleted = BUILD_FIELDS_AND_METHODS;
lastCompletedUnitIndex = lastUnitIndex;
-
- CompilationAndWeavingContext.leavingPhase(completeTypeBindingsToken);
+ AsmManager.setCompletingTypeBindings(false);
+ CompilationAndWeavingContext.leavingPhase(completeTypeBindingsToken);
}
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceLocation.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceLocation.java
index 2a4329fe5..dd5de8cad 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceLocation.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceLocation.java
@@ -17,15 +17,17 @@ import java.io.File;
import org.aspectj.ajdt.internal.core.builder.EclipseAdapterUtils;
import org.aspectj.bridge.ISourceLocation;
-import org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
import org.aspectj.org.eclipse.jdt.core.compiler.IProblem;
import org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult;
+import org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
import org.aspectj.org.eclipse.jdt.internal.compiler.problem.ProblemHandler;
public class EclipseSourceLocation implements ISourceLocation {
private static String NO_CONTEXT = "USE_NULL--NO_CONTEXT_AVAILABLE";
CompilationResult result;
+// EclipseSourceContext eclipseContext;
int startPos, endPos;
+ String filename;
// lazy but final
File file;
int startLine = -1;
@@ -36,6 +38,7 @@ public class EclipseSourceLocation implements ISourceLocation {
public EclipseSourceLocation(CompilationResult result, int startPos, int endPos) {
super();
this.result = result;
+ if (result!=null && result.fileName!=null) this.filename = new String(result.fileName);
this.startPos = startPos;
this.endPos = endPos;
}
@@ -58,19 +61,20 @@ public class EclipseSourceLocation implements ISourceLocation {
public File getSourceFile() {
if (null == file) {
- if ((null == result)
- || (null == result.fileName)
- || (0 == result.fileName.length)) {
+ if (filename==null) {
+// if ((null == result)
+// || (null == result.fileName)
+// || (0 == result.fileName.length)) {
file = ISourceLocation.NO_FILE;
} else {
- file = new File(new String(result.fileName));
+ file = new File(filename);//new String(result.fileName));
}
}
return file;
}
public int getLine() {
- if (-1 == startLine) {
+ if (-1 == startLine && result!=null) {
startLine = ProblemHandler.searchLineNumber(result.lineSeparatorPositions, startPos);
}
return startLine;
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java
index 1a5cca5bd..b061596b0 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java
@@ -227,7 +227,7 @@ public class AsmElementFormatter {
//TODO AV - could speed up if we could dig only for @Aspect declaring types (or aspect if mixed style allowed)
//??? how to : node.getParent().getKind().equals(IProgramElement.Kind.ASPECT)) {
- if (true && methodDeclaration.annotations != null) {
+ if (true && methodDeclaration!=null && methodDeclaration.annotations != null) {
for (int i = 0; i < methodDeclaration.annotations.length; i++) {
//Note: AV: implicit single advice type support here (should be enforced somewhere as well (APT etc))
Annotation annotation = methodDeclaration.annotations[i];
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EclipseSourceContext.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EclipseSourceContext.java
index 8cdaa333b..5485397a0 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EclipseSourceContext.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EclipseSourceContext.java
@@ -68,5 +68,9 @@ public class EclipseSourceContext implements ISourceContext {
}
return sl;
}
+
+ public void tidy() {
+ result=null;
+ }
}