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 255901 - Error mark does not disappear after resolving syntax error
Summary: Error mark does not disappear after resolving syntax error
Status: VERIFIED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Infrastructure (show other bugs)
Version: 8.1
Hardware: PC Linux
: P2 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords:
: 256172 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-10-13 13:03 UTC by mperezma
Modified: 2016-02-02 12:46 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mperezma 2015-10-13 13:03:16 UTC
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..
Comment 1 Milutin Kristofic 2015-10-13 14:32:17 UTC
Thank you for your report. It's reproducible. I am looking for a culprit.
Comment 2 mperezma 2015-10-15 15:51:26 UTC
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.
Comment 3 Jiri Kovalsky 2015-10-15 21:11:27 UTC
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?
Comment 4 Milutin Kristofic 2015-10-16 15:07:22 UTC
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.
Comment 5 Tomas Zezula 2015-10-19 13:01:14 UTC
Nothing to do with parsing.api.
When the protectedMode is entered no updates are done which is correct.
Comment 6 Milutin Kristofic 2015-10-19 13:54:54 UTC
NbBuilderLogger is responsible for protected mode.
Comment 7 Tomas Zezula 2015-10-20 09:48:39 UTC
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)
Comment 8 Tomas Zezula 2015-10-20 09:51:08 UTC
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.
Comment 9 mperezma 2015-10-20 10:05:19 UTC
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.
Comment 10 Tomas Zezula 2015-10-20 13:07:04 UTC
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.
Comment 11 Tomas Zezula 2015-10-23 10:55:39 UTC
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
Comment 12 Jiri Kovalsky 2015-10-23 15:33:47 UTC
Mario, can you please thoroughly verify this once the fix is available in the next development build? Thanks a lot!
Comment 13 Quality Engineering 2015-10-24 03:03:21 UTC
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
Comment 14 Tomas Zezula 2015-10-26 08:57:07 UTC
*** Bug 256172 has been marked as a duplicate of this bug. ***
Comment 15 Tomas Zezula 2015-10-26 08:57:33 UTC
See issue #256172 for maven case.
Comment 16 mperezma 2015-10-26 11:44:26 UTC
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..
Comment 17 Tomas Stupka 2015-12-21 12:23:05 UTC
transplanted to release81
http://hg.netbeans.org/releases/rev/9d13c0f6db79