Bug 54941 - for errors in binary classes, use sourcepath option
Summary: for errors in binary classes, use sourcepath option
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.1.1   Edit
Hardware: PC Windows XP
: P5 normal (vote)
Target Milestone: ---   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-16 03:56 EST by Wes Isberg CLA
Modified: 2007-10-23 05:58 EDT (History)
1 user (show)

See Also:


Attachments
sourcepath patch (9.05 KB, patch)
2004-03-16 04:03 EST, Wes Isberg CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wes Isberg CLA 2004-03-16 03:56:39 EST
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!).
Comment 1 Wes Isberg CLA 2004-03-16 04:03:53 EST
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)