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 144855 - [65cat] Debug not picking up code change
Summary: [65cat] Debug not picking up code change
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: Jan Jancura
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-22 13:56 UTC by Unknown
Modified: 2009-02-17 12:47 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Projects RiskDimensions is the Main one (43.31 KB, application/x-gzip)
2008-09-05 14:18 UTC, Unknown
Details
Here's a project that I'm using. You can see the settings, but I can't give all sources (45.45 KB, application/x-gzip)
2008-09-19 13:46 UTC, Unknown
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Unknown 2008-08-22 13:56:44 UTC
[ BUILD # : 200808170243 ]
[ JDK VERSION : 1.6.0_07 ]

Product Version: NetBeans IDE Dev (Build 200808170243)
Java: 1.6.0_07; Java HotSpot(TM) 64-Bit Server VM 10.0-b23
System: Linux version 2.6.26-1.slh.3-sidux-amd64 running on amd64;
UTF-8; en_US (nb)
Userdir: /home/sasbeb/.netbeans/dev
I have a class:
import javax.swing.JFrame;
import javax.swing.JLabel;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author sasbeb
 */
public class NewClass {

   public static void main(String[] args) {
      try {
         JFrame frame = new JFrame("Test 3");
         frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
         frame.add(new JLabel("This is a test"));
         frame.pack();
         frame.setVisible(true);
      } catch (Exception e) {
      }
   }
}

If I alter anything in the try/catch block, say "Test 3" to "Test 4"
and start a debugging session, the session starts without compiling
the change.
Comment 1 Daniel Prusa 2008-08-22 17:03:04 UTC
Not P1, you can compile the changed source file explicitly.
Comment 2 Unknown 2008-08-22 18:49:09 UTC
You can set it to p2, if you like, but the problem is that NB is running a compile that doesn't match the source.
That's a _real_ problem.  I have to be able to trust the IDE.
Comment 3 Tomas Pavek 2008-08-27 09:06:05 UTC
Isn't this issue 143455? Does it work if you wait a moment before starting debugger? BTW issue 143455 is already fixed.
Comment 4 Unknown 2008-08-27 12:17:05 UTC
I don't have compile on save set, so why would waiting help?
Comment 5 Tomas Pavek 2008-08-27 13:51:57 UTC
I didn't know you don't have Compile on Save set. That's why I asked. Without Compile on Save this is likely a 
different bug.
Comment 6 Martin Entlicher 2008-08-27 15:26:52 UTC
Works fine for me.
What kind of project do you have? I've tested with a "Java Application" project type.
The best would be if you can zip the sample project and attach it to this issue. Thanks.
Comment 7 Unknown 2008-08-27 15:29:33 UTC
I used the java class I included in the defect.
Comment 8 Martin Entlicher 2008-08-27 15:33:54 UTC
Yes, I see. But this is not sufficient, the class file is a part of some project. I need the project type at least, or
the whole sample project, if possible.
The compilation before debugging does not depend on the class file, but on the project's build file.
Comment 9 Unknown 2008-09-04 20:15:26 UTC
This is really a problem.
It takes a while to set up a debugging session, then only to find out the debugger things there's a breakpoint on
an invalid line.
This is a project based on existing source.
It is reproducable.  Compile on save is off.
Comment 10 Martin Entlicher 2008-09-05 07:54:59 UTC
O.K. I've tested that on regular Java projects. I'll verify how debugging on projects created from existing sources works.
Comment 11 Peter Pis 2008-09-05 08:52:24 UTC
I've tried both standard j2se project and project with existing sources on Windows and Mac Os. It works fine with
compile on save - switched on and off.
Comment 12 Martin Entlicher 2008-09-05 08:54:53 UTC
For me too.
If it's not possible to provide a complete sample project, please provide at least content of "nbproject" folder of your
project.
Comment 13 Unknown 2008-09-05 14:17:33 UTC
Low memory?
I do notice that (tho no OutOfMemoryErrors are thrown)
Attaching my projects
Comment 14 Unknown 2008-09-05 14:18:54 UTC
Created attachment 69151 [details]
Projects RiskDimensions is the Main one
Comment 15 Unknown 2008-09-05 15:16:49 UTC
Doesn't seem to be low memory.  Still happens when the NB session is new. (after everything has scanned, etc)
Anything to do with the source compatibility flag?
This problem has bitten me twice this morning. (in 1.5 hours) with

Product Version: NetBeans IDE Dev (Build 200809020201)
Java: 1.6.0_07; Java HotSpot(TM) 64-Bit Server VM 10.0-b23
System: Linux version 2.6.26-1.slh.3-sidux-amd64 running on amd64; UTF-8; en_US (nb)
Userdir: /home/sasbeb/.netbeans/dev
Comment 16 Unknown 2008-09-10 15:20:44 UTC
Still happens with:

Product Version: NetBeans IDE Dev (Build 200809071401)
Java: 1.6.0_07; Java HotSpot(TM) 64-Bit Server VM 10.0-b23
System: Linux version 2.6.26-1.slh.3-sidux-amd64 running on amd64; UTF-8; en_US (nb)
Userdir: /home/sasbeb/.netbeans/dev

With new module provided by:

http://www.netbeans.org/issues/show_bug.cgi?id=143234
Comment 17 Marian Mirilovic 2008-09-17 09:57:24 UTC
removing INCOMPLETE - Bryan provided the project
Comment 18 Martin Entlicher 2008-09-18 09:45:33 UTC
Sorry, but the project http://www.netbeans.org/nonav/issues/showattachment.cgi/69151/project.tar.gz can not be used to
reproduce this problem. There are no sources, nothing to debug. Just project files with unresolved dependencies, nothing
real to work with.

Can't you attach a simple project with the NewClass you've provided above?

Do you mean that this can be reproduced also with
http://www.netbeans.org/nonav/issues/showattachment.cgi/69998/MyWebApplication2.ZIP? I'm going to try that...
Comment 19 Martin Entlicher 2008-09-18 10:01:34 UTC
Sorry, but with http://www.netbeans.org/nonav/issues/showattachment.cgi/69998/MyWebApplication2.ZIP all works fine for me.

When I modify index.jsp, the page is updated on the next debug.
When I modify some class file, I can see updated compiled class under build/web/WEB-INF/classes/... after I press debug.
Comment 20 Martin Entlicher 2008-09-18 13:19:04 UTC
I've now compared RiskDimensions-d2rskd52/nbproject/build-impl.xml with a build-impl.xml of Java project created in
NetBeans. All looks fine, there are no differences in the debugging session.

One more question that might indicate something: Does the problem with sources not being compiled happens only when you
run the project under debugger, or also when you run the project via plain "Run"?
Comment 21 Unknown 2008-09-18 14:28:45 UTC
I can't give you my source.
NewClass was just a new java class created in the project I gave you.
It should be self explanatory
Comment 22 Petr Cyhelsky 2008-09-19 13:03:13 UTC
Worksforme on:
Product Version: NetBeans IDE Dev (Build 200809181401)
Java: 1.6.0_07; Java HotSpot(TM) 64-Bit Server VM 10.0-b23
System: Linux version 2.6.25-9.slh.1-sidux-amd64 running on amd64; UTF-8; en_US (nb)
Userdir: /home/tester/.netbeans/dev

I've tried numerous variants:
Changes between debugging sessions / in one debugging session(apply code changes)
with saving / without saving the changes
with compile on save turned on/off
8 variants in total, every time everything worked as expected.
It seems to me the problem must be in some way project-specific.
Closing as worksforme. Please reopen the issue when some reproducible scenario is found(preferably on some simpler 
project). If you can't reproduce it on any other project and can't give any workable sample, maybe you should try 
creating screencast as a last resort to give us at least some idea of what's going on?
Comment 23 Unknown 2008-09-19 13:30:50 UTC
Hold on cowboy;)
I have a fail case for both not picking up changes and Java Result : 1.
I'll post my project and and 2 source files.
Comment 24 Unknown 2008-09-19 13:40:58 UTC
You can't have all my source since it's a commercial app, but I can post my project settings and the 2 source files that
I used to see that the debugger wasn't using my changes.
Comment 25 Unknown 2008-09-19 13:46:09 UTC
Created attachment 70148 [details]
Here's a project that I'm using.  You can see the settings, but I can't give all sources
Comment 26 Unknown 2008-09-19 13:49:22 UTC
You're not going to be able to resolve all the dependencies.  They're sources and libraries I can't give you.
Also, I tried creating a project using the sources in NBTest, but couldn't replicate it in such a small project.
Could there be a problem with starting the debugger before the compile/scan has taken place for large projects?

It's maddening, and as such, my only choice is to clean/build all in order to make sure the debugging session is using
current sources.

This of course makes NB run out of memory pretty fast.
Comment 27 Petr Cyhelsky 2008-09-19 15:12:03 UTC
Again, in the sample project wjich you sent there is no problem, it is just programmed to throw IAE every time it is run
- if you add:

for (int i = 1; i<6; i++) {
    Foo.Bar b = new Foo.Bar(i,Integer.toString(i)) {};
}

to the beginning of the main class the project would even bypass the exception and do what (i suppose) it is supposed to
do. Again, there is nothing wrong in this project - i can make changes to the code and they are correctly accepted by
debugger. The Riskdimensions project is alas unusable for testing purposes so i can only use the smaller one.
->  Closing as worksforme.
Comment 28 Unknown 2008-09-19 15:24:59 UTC
You can't close this as WORKSFORME when I can clearly replicate the problem.
If you had a project of any size, you'd see it.
Comment 29 Martin Entlicher 2008-09-19 15:41:08 UTC
sasbeb, since you can reproduce the problem, can you please try to do "Run" instead of Debug and see if the changes were
applied? If the same steps that led to unapplied changes can be reproduced with Run? That would at least give us some
hint. Thank you.
Comment 30 Unknown 2008-09-19 15:45:48 UTC
It happens with both run and debug.
Comment 31 Martin Entlicher 2008-09-19 15:50:19 UTC
O.K. Thanks a lot.
Then it can not be a debugger issue.
Moving to ANT for evaluation, since ANT compiles the sources.
Comment 32 Petr Cyhelsky 2008-09-19 15:58:29 UTC
Well, for example I  frequently debug part of netbeans, which is IMHO big enough (true, it is different kind of project,
not java application, but netbeans module, but if the size is the problem this should not matter). Please try to
understand my position:
- We know you have problem on big proprietary project, but we don't have it so we cannot get to the core of the problem.
- We tried every other project you send us on many platforms (now finally even including Debian Sidux on 64-bit AMD)
- We can't reproduce the problem, the changes in code are accepted and it works correctly as it should.
- Unless we are given some reproducible test case we simply can't do anything.

Can you please try this on latest NB build if the problem is still there (as we are testing on latest builds) so that we
don't talk apples and oranges.
Comment 33 Unknown 2008-09-19 16:44:57 UTC
This is on today's build.
Product Version: NetBeans IDE Dev (Build 200809181401)
Java: 1.6.0_07; Java HotSpot(TM) 64-Bit Server VM 10.0-b23
System: Linux version 2.6.26-1.slh.3-sidux-amd64 running on amd64; UTF-8; en_US (nb)
Userdir: /home/sasbeb/.netbeans/dev

I can't reproduce it on a small project.  I'll keep trying.

Comment 34 Jesse Glick 2008-09-22 23:16:22 UTC
No known way to reproduce, not affecting others that I know of. Possibly an Ant problem but no clear indication so far
that this is so. Assigning to j2seproject pending a test case.
Comment 35 Unknown 2008-09-22 23:32:04 UTC
Keep in mind that this project was brought forward from 6.0-> 6.1-> 6.5beta/dev
Also that it doesn't fail (Java Result : 1) running with 6.0 or 6.1.
Comment 36 Tomas Zezula 2008-09-23 10:33:19 UTC
There is too many comments but no much info available.
1) The changed java class, which is not up to date, is a part of the main project (the project you called debug on), right?
2) Does turning on Track java dependencies help? Not a solution just a test.
3) If you are able to reproduce it, can you attach the ant debug output, there should be logged which files Ant treats as modified. I will also need to know the 
name of the java file you have changed.
Thanks.
Comment 37 Jan Jancura 2009-02-11 09:06:06 UTC
incomplete for a several months -> closing.
Comment 38 Unknown 2009-02-11 14:07:52 UTC
It's still reproducable (tho not consistently)
Comment 39 Jan Jancura 2009-02-11 14:59:05 UTC
Read http://wiki.netbeans.org/IssueLifeCycle, please.
incomplete for a several months -> closing.
Comment 40 Unknown 2009-02-11 16:10:05 UTC
Bummer.
Should I revert back to 6.0/6.1 where it didn't exist?
If I have 1000+ files in 4 projects (1 main and 3 sub projects) I can't trust the debug session
without a clean/build all.
Comment 41 Jan Jancura 2009-02-17 12:47:07 UTC
Sasbeb,
can you answer tzezula questions, please? We are not able to help you otherwise.