import org.aspectj.bridge.context.CompilationAndWeavingContext;
import org.aspectj.util.FileUtil;
import org.aspectj.util.LangUtil;
+import org.aspectj.weaver.Dump;
/**
* Programmatic and command-line interface to AspectJ compiler.
try {
// byte[] b = new byte[100000000]; for testing OoME only!
run(args, holder);
- } catch (OutOfMemoryError outOfMemory) {
+ }
+ catch (OutOfMemoryError outOfMemory) {
IMessage outOfMemoryMessage = new Message(OUT_OF_MEMORY_MSG,null,true);
holder.handleMessage(outOfMemoryMessage);
systemExit(holder); // we can't reasonably continue from this point.
+ }
+ finally {
+ CompilationAndWeavingContext.reset();
+ Dump.reset();
}
boolean skipExit = false;
*/
public void testDumpWithWarnings () {
String[] args = new String[] { "src/HelloWorld.java", "src/Pointcuts.aj", "src/DeclareWarning.aj" };
+ Dump.preserveOnNextReset();
CompilationResult result = ajc(baseDir,args);
String fileName = Dump.dump("DumpTestCase.testDumpWithWarnings()");
dumpFile = new File(fileName);