This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 57926

Summary: Incorrect source reference
Product: java Reporter: Peter Nabbefeld <epdv>
Component: ProjectAssignee: Tomas Zezula <tzezula>
Status: RESOLVED FIXED    
Severity: blocker CC: jglick
Priority: P3    
Version: 4.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 51545    

Description Peter Nabbefeld 2005-04-15 10:07:58 UTC
I'm currently using netbeans-4_1-daily-bin-200504131930-13_Apr_2005_1930.zip on
W2k with JDK 1.5.0. I've clicked at a link in the output window (from a
stacktrace caused by a running application). Instead of the 1.4.2 source I've
got the 1.5.0 source (e.g. one line after "public synchronized E elementAt(int
index) {" for class Vector).

There has been a similar bug in early builds of NB 4.0 which also has been
difficult to reproduce (debugger was confusing about sources in different
projects with the same name, issue #47372) - might be related.

Probably the source is always shown for the "Default platform".

Setting this to P1, because it makes development of projects with different
platforms nearly impossible.
Comment 1 Milan Kubec 2005-04-15 12:34:28 UTC
Seems to be reproducible, but I would argue that "... it makes development of
projects with different platforms nearly impossible." Looking to JDK sources
throught stack traces is just for reference purposes, you can develop your
project successfully on any selected platform.

Tomas, do you know what's wrong?
Comment 2 Peter Nabbefeld 2005-04-15 12:39:22 UTC
I haven't further investigated the problem. If it is an mdr problem, there will
probably be more hidden problems. If only the links don't take the platform into
account, it will probably be less harmful. However, knowing where exactly an
error occurs is sometimes more specific than just looking at the error messages
- and therefore very helpful.
Comment 3 Tomas Zezula 2005-04-15 13:33:25 UTC
This is definitelly not P1, you can work with platform. I don't know exactly,
j2seproject uses JavaAntLogger for stack traces. But it seems that the output
console has no project context and works on GlobalPathRegistry.
Jesse, am I righ?
Comment 4 Tomas Zezula 2005-04-15 13:34:01 UTC
Adding Jesse to cc list
Comment 5 Tomas Zezula 2005-04-15 13:49:56 UTC
The issue influences only the behaviour of stack traces. Everything else with
platforms works fine.
Comment 6 Tomas Zezula 2005-04-15 14:41:24 UTC
I've found that the JavaAntLogger always uses a default platform if the ant log
level != LOG_VERBOSE. The AntLoger has no project context and it is not able to
find out the JVM on which the application runs if the ant log level != LOG_VERBOSE.
Comment 7 Tomas Zezula 2005-04-15 15:17:38 UTC
Sorry, Tthe last observation was incorrect. 
It seems that the default platform is used because the JAVA_EXECUTABLE =
Pattern.compile("^Executing '(.*)' with arguments:$") patern does not match to line.
The line value is:
"Executing '/usr/java/j2sdk1.4.2_03/bin/java' with
arguments:\n'-classpath'\n'/tmp/JavaApplication2/build/classes'\n'javaapplication2.Main_1'\n\nThe
' characters around the executable and arguments are\nnot part of the command."

Ant has probably changed the format, the "\n" is before arguments
Comment 8 Tomas Zezula 2005-04-15 16:14:41 UTC
The problem was that the pattern for jvm executable did not use MULTILINE flag.

Checking in project/src/org/netbeans/modules/java/project/JavaAntLogger.java;
/cvs/java/project/src/org/netbeans/modules/java/project/JavaAntLogger.java,v 
<--  JavaAntLogger.java
new revision: 1.8; previous revision: 1.7
done
Comment 9 Jesse Glick 2005-04-15 19:15:30 UTC
Looking up the original bug that this corrects the fix of, for reference.