Community
Participate
Working Groups
We could use an option -sourcepath {dir..} to be able to specify paths to source files for errors and warnings in binary input. Right now weaver messages for binary input show up with a path composed of the current working directory and the calculated path to the enclosing type, which is rarely correct (but confusingly plausible!).
Created attachment 8592 [details] sourcepath patch Attaching a patch that plumbs -sourcepath from the command line and ajdt/ajbrowser through the weaver, using an interface in util. Patch lacks documentation and tests. It seems to work for what I'm using it for (weaving against 1000+ .class files in ajbrowser), but I have noticed the stack trace below when running from the command line (recent changes?). This might belong in the weaver's public API if we want the weaver to resolve the file references. Conversely, the weaver could deliver its best-guess relative path, and we could have special message handlers that rework the source file if not found. The problem with the latter is that the weaver can use the sourcepath (the source-finder) to identify which of the possible paths calculable by the weaver is the actual one. trace noted (also noted traces being printed twice - hmm): java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.CompilationResult.computePriority(CompilationResult.java:110) at org.eclipse.jdt.internal.compiler.CompilationResult.quickPrioritize(CompilationResult.java:336) at org.eclipse.jdt.internal.compiler.CompilationResult.getProblems(CompilationResult.java:230) at org.eclipse.jdt.internal.compiler.CompilationResult.getAllProblems(CompilationResult.java:118) at org.aspectj.ajdt.internal.core.builder.AjBuildManager$2.acceptResult(AjBuildManager.java:465) at org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.acceptResult(AjCompilerAdapter.java:164) at org.aspectj.ajdt.internal.compiler.WeaverAdapter.finishedWith(WeaverAdapter.java:144) at org.aspectj.ajdt.internal.compiler.WeaverAdapter.weaveCompleted(WeaverAdapter.java:124) at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:511) at org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.weave(AjCompilerAdapter.java:215) at org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.afterCompiling(AjCompilerAdapter.java:107) at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:376) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation(AjBuildManager.java:411) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild(AjBuildManager.java:147) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:81) at org.aspectj.ajdt.ajc.AjdtCommand.doCommand(AjdtCommand.java:104) at org.aspectj.ajdt.ajc.AjdtCommand.runCommand(AjdtCommand.java:53) at org.aspectj.tools.ajc.Main.run(Main.java:231) at org.aspectj.tools.ajc.Main.runMain(Main.java:168) at org.aspectj.tools.ajc.Main.main(Main.java:81)