summaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
authorjhugunin <jhugunin>2003-04-27 23:29:27 +0000
committerjhugunin <jhugunin>2003-04-27 23:29:27 +0000
commitf236927770b4c1029e4d108c3991870609555dfb (patch)
tree8699d7419bae2ea2d4707788928f497cc1e32d89 /org.aspectj.ajdt.core
parent92f36043baa4059b8707a81429a5e2f79ee7a2ee (diff)
downloadaspectj-f236927770b4c1029e4d108c3991870609555dfb.tar.gz
aspectj-f236927770b4c1029e4d108c3991870609555dfb.zip
fix and test for
Bugzilla Bug 34951 NPE compiling without aspectjrt.jar
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java9
-rw-r--r--org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/BasicCommandTestCase.java21
2 files changed, 30 insertions, 0 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
index a39d4d8a9..b9a1ea588 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
@@ -45,6 +45,7 @@ import org.aspectj.bridge.IProgressListener;
import org.aspectj.bridge.Message;
import org.aspectj.bridge.MessageUtil;
import org.aspectj.bridge.Version;
+import org.aspectj.weaver.ResolvedTypeX;
import org.aspectj.weaver.World;
import org.aspectj.weaver.bcel.BcelWeaver;
import org.aspectj.weaver.bcel.BcelWorld;
@@ -285,6 +286,14 @@ public class AjBuildManager {
File inJar = (File)i.next();
bcelWeaver.addJarFile(inJar, buildConfig.getOutputDir());
}
+
+ //check for org.aspectj.runtime.JoinPoint
+ bcelWorld.resolve("org.aspectj.lang.JoinPoint");
+
+// if () {
+// bcelWorld.showMessage(IMessage.ERROR,
+// "can't find type org.aspectj.lang.JoinPoint on classpath", null, null);
+// }
}
public World getWorld() {
diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/BasicCommandTestCase.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/BasicCommandTestCase.java
index 107921ca0..14736ab99 100644
--- a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/BasicCommandTestCase.java
+++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/BasicCommandTestCase.java
@@ -15,6 +15,10 @@ package org.aspectj.ajdt.internal.compiler.batch;
import java.util.ArrayList;
import java.util.List;
+import org.aspectj.ajdt.ajc.AjdtCommand;
+import org.aspectj.bridge.ICommand;
+import org.aspectj.bridge.MessageHandler;
+
/**
* @author hugunin
*
@@ -96,4 +100,21 @@ public class BasicCommandTestCase extends CommandTestCase {
runCompiler(args, new int[] {2});
}
+ public void testMissingRuntimeError() {
+ List args = new ArrayList();
+
+ args.add("-d");
+ args.add("out");
+
+ args.add("-classpath");
+ args.add("../lib/junit/junit.jar;../testing-client/bin");
+ args.add("testdata/src1/Xlint.java");
+
+ ICommand command = new AjdtCommand();
+ MessageHandler myHandler = new MessageHandler();
+ myHandler.setInterceptor(org.aspectj.tools.ajc.Main.MessagePrinter.TERSE);
+ boolean result = command.runCommand((String[])args.toArray(new String[args.size()]), myHandler);
+
+ assertEquals("error for org.aspectj.lang.JoinPoint not found", 1, myHandler.getErrors().length);
+ }
}