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.
I first commented on issue #254986 because I thought it was the same issue, but we now think that the cause could be different. So I'm opening this separate issue with the details of my scenario. Steps to reproduce: 1.- Create a java project with this code: public class JavaApplication { public static void main(String[] args) throws InterruptedException { while (true) { System.out.println("hi!"); Thread.sleep(1000L); } } } 2.- Run the project 3.- Introduce some syntax error in this source (like change "class" by "classs"), or in any other open project. Save the file. Expected: the project view should show an error flag in the file, but it doesn't. If you stop the execution, then the project view will refresh, showing the error flag in this file. It's a showstopper for me, because I can't work with the IDE normally while some project is executing..
Thank you for your report. It's reproducible. I am looking for a culprit.
It does not only affect to error marks... it has also something to do with compilation or dist binaries creation. Steps to reproduce: 1.- Create a "hello world" java app project and run it. 2.- Create a java project with this code: public class JavaApplication { public static void main(String[] args) throws InterruptedException { while (true) { System.out.println("hi!"); Thread.sleep(1000L); } } } 3.- Run this new project 4.- While this new project is running, change "hello world" greeting, for example replace it by "hello universe" and run it. Expected: the app should display "hello universe" now instead of "hello world". But it still displaying "hello world". You can clean, clean and build... If you introduce a syntax error and try to build the project, it will fail. So it's really compiling it, but when you solve the errors and build again, it still showing "hello world"... So you actually you can't develop while a project is running. I think we should elevate the priority for this bug.
As as serious regression from 8.0 this needs to be evaluated properly. Can you Mito or Tomas please take a look at this problem?
FileEventLog succesfully commits changes in document after save, but in RepositoryUpdater.schedule() is called, but getting errors through RepositoryUpdater.Task.run() is blocked since file is in protectedMode. When user java program starts it enters enterProtectedMode() and then only after the program stops it exitProtectedMode(). Sending to parsing for evaluation.
Nothing to do with parsing.api. When the protectedMode is entered no updates are done which is correct.
NbBuilderLogger is responsible for protected mode.
Evaluation:From parsing api perspective everything is correct. The Ant NbBuildLogger enters protected mode and performs build. After the build (execute) the NbBuildLogger leaves protected mode and the parsing api performs the queued tasks (the error icons appears on files).The NbBuildLogger enters protected mode before the build is performed. And leaves it either by the end of the build or when there is no output activity for more then 5 seconds. This can be easily verified by changing the:Thread.sleep(1000L)
Posting again as the bugzilla lost the second part of evaluation ;-) Evaluation: From parsing api perspective everything is correct. The Ant NbBuildLogger enters protected mode and performs build. After the build (execute) the NbBuildLogger leaves protected mode and the parsing api performs the queued tasks (the error icons appears on files). The NbBuildLogger enters protected mode before the build is performed. And leaves it either by the end of the build or when there is no output activity for more then 5 seconds. This can be easily verified by changing the: Thread.sleep(1000L); to: Thread.sleep(6000L); The reason why the builds are entering protected mode is that the build deletes and generate class files, jar files (even transitively) which will cause non needed scanning. The reason why this behaviour was different for NB 8.0 is that there was a Lookup problem breaking the IndexingBridge (issue: https://netbeans.org/bugzilla/show_bug.cgi?id=245453) Probably wontfix.
Probably wontfix? this is really bad news :'( At least, the user should know that no build is actually being performed although he is getting "BUILD SUCCESSFUL" in the output window. I think we can't let it this way.
The problem affects just project which constantly emits some output. But I am thinking about how to resolve the "build" problem, what I think about is that the logger should leaf the protected mode before doing the second build and reenter it when the build starts.
The error badges not being displayed is wontfix as I explained in comment #8. The project run problem is bug, the program should not be executed in older version. The run problem should be fixed in jet-main http://hg.netbeans.org/jet-main/rev/1c5034888fbf
Mario, can you please thoroughly verify this once the fix is available in the next development build? Thanks a lot!
Integrated into 'main-silver', will be available in build *201510240002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/1c5034888fbf User: Tomas Zezula <tzezula@netbeans.org> Log: #255901:Error mark does not disappear after resolving syntax error
*** Bug 256172 has been marked as a duplicate of this bug. ***
See issue #256172 for maven case.
Verified in Build 201510260002: Build problem is fixed. BTW, I think it should be enhanced. More than the error badges not being displayed, if you let the continuous-verbose-app executing and then you create a NEW java project, it will not run (project will found no java main class). 1.- Create a java project with this code: public class JavaApplication { public static void main(String[] args) throws InterruptedException { while (true) { System.out.println("hi!"); Thread.sleep(1000L); } } } 2.- Run the project and leave it executing. 3.- Create a new java project and try to run it. Expected: The new java project should build and execute, but it doesn't. You get a "No main classes found" error displayed. If you stop the execution of the project launched in step 2, the new project will build and execute normally. I agree that it seem to fail only under certain circumstances, so I don't know what else will affect..
transplanted to release81 http://hg.netbeans.org/releases/rev/9d13c0f6db79