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 164762 - NetBeans works with sources of wrong platform
Summary: NetBeans works with sources of wrong platform
Status: NEW
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker with 1 vote (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-08 11:29 UTC by aekold
Modified: 2010-07-30 11:05 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
example working project (12.01 KB, application/octet-stream)
2009-05-21 12:03 UTC, aekold
Details

Note You need to log in before you can comment on or make changes to this bug.
Description aekold 2009-05-08 11:29:33 UTC
Product Version: NetBeans IDE 6.7 Beta (Build 200904242137)
Java: 1.6.0_13; Java HotSpot(TM) Client VM 11.3-b02
System: Windows XP version 5.1 running on x86; Cp1251; ru_RU (nb)

I am using 1.6.0_13 as default platform, also added jdk-6u14-ea-bin-b05-windows-i586-debug-23_apr_2009.jar to debug 
sources of JDK and understand how it works. JDK is configured properly, including src.zip, and both versions are shown in 
"Go To Type". But when debugging - NetBeans opens sources from src.zip of default platform, but not one choosed in project 
properties.
Comment 1 Martin Entlicher 2009-05-08 12:29:39 UTC
And how do you start debugger? Do you use attach to a running application, or do you just run "Debug" on the project?
The sources are set up in a different way in each case.
Comment 2 aekold 2009-05-08 13:23:27 UTC
Run "Debug" on project or one of Main classes of project. In Process Explorer I can see new process of jdk-6u14.
Comment 3 Martin Entlicher 2009-05-08 14:27:44 UTC
O.K. Thanks, I'll check how it works...
Comment 4 Filip Zamboj 2009-05-15 14:33:07 UTC
@reporter: please, check steps to reproduce and correct me if I am doing something wrong 
i didn't reproduce this on  
Product Version: NetBeans IDE Dev (Build 200905140201)
Java: 1.6.0_13; Java HotSpot(TM) 64-Bit Server VM 11.3-b02
System: Linux version 2.6.28-11-generic running on amd64; UTF-8; en_US (nb)

using these steps:
1. change project's JDK to JDK 1.5.0_17
2. I have only JDK 1.5.0_17 in sources now -> CORRECT 
3. I add JDK 1.6.0_13 to sources 
4. Debug  
result: jdk 1.5.0_17 sources were used to step into JDK sources. 

Did you use other steps? 
Comment 5 aekold 2009-05-15 14:56:40 UTC
Yes, a bit other.

1. Default platform is 1.6.0_13.
2. Open Tools - Java Platforms - Add Platform - folder of jdk-6u14-ea-bin-b05-windows-i586-debug-23_apr_2009.jar.
3. Open Project Properties - Libraries - change Java Platform from default to jdk6-debug.
4. In "Go to Type" window I see both versions.
5. When I am putting breakpoints on java.util.* classes of jdk6-debug sources - they're ignored, and when doing "step 
into" while debug - it opens 1.6.0_13 sources with wrong line numbers (because line numbers are taken from 6u14 version).

The only way to go to correct sources for me - overwrite src.zip of default platform with jdk6-debug.
Comment 6 Martin Entlicher 2009-05-20 20:59:22 UTC
I can not reproduce this as well. For Java projects sources are opened from the correct JDK. Which kind of project do
you have? Is it a regular J2SE project or some kind of free-form project? Can you please provide the zipped project? Or
at least the project metadata?
Comment 7 aekold 2009-05-21 12:02:19 UTC
Another step-by-step:

1. Download and install JDK 6u13 from java.sun.com
2. Download and install NetBeans 6.7 beta using jdk 6u13 as default platform.
3. Download and unpack jdk-6u14-ea-bin-b06-windows-i586-debug-06_may_2009.jar from 
http://download.java.net/jdk6/binaries/ to D:\develop\test_projects\jdk1.6.0_14\ (and move folders inside to remove 
fastdebug folder from path to have D:\develop\test_projects\jdk1.6.0_14\bin\java.exe).
4. Start NetBeans, open Tools - Java Platforms, Add Platform - D:\develop\test_projects\jdk1.6.0_14\ and name it jdk6-
debug.
5. Check src.zip to be present in both 6u13 and 6u14.
6. Create New Project (with main class generation), open Properties - Libraries and change Java Platform to jdk6-debug.
7. Content of main method:
        try {
            UIManager.setLookAndFeel(new NimbusLookAndFeel());
        }
        catch (Exception e) {
            e.printStackTrace();
        }
8. Open UIManager.java from both jdk6-debug and JDK 1.6 (default) to see both of them in NetBeans.
9. Add breakpoint on line 1431 of both UIManagers.
10. Run "Debug" on project and see which of two UIManagers will stop on breakpoint. In my case it will be UIManager from 
JDK 1.6 (default).
11. Add breakpoint on line 1430 in same class and see message in "Debugger Console": "Not able to submit breakpoint 
LineBreakpoint UIManager.java : 1430, reason: No executable location available at line 1430 in class 
javax.swing.UIManager.". It's because line 1430 is not valid breakpoint in UIManager of jdk6-debug.
Comment 8 aekold 2009-05-21 12:03:07 UTC
Created attachment 82539 [details]
example working project
Comment 9 Daniel Prusa 2009-07-23 13:32:44 UTC
Test case provided removing keyword INCOMPLETE.
This could be a duplicate of issue 164201.