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 215180 - [72cat] Error highlighting seems not to update properly
Summary: [72cat] Error highlighting seems not to update properly
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.2
Hardware: PC Windows XP
: P1 normal with 2 votes (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-04 14:58 UTC by jmborer
Modified: 2012-07-12 08:17 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot after other file modification (233.07 KB, image/png)
2012-07-04 14:58 UTC, jmborer
Details
Screenshot after forced refresh (233.57 KB, image/png)
2012-07-04 14:58 UTC, jmborer
Details
Binary patch against 7.2 to help identify the issue (326.37 KB, application/java-archive)
2012-07-08 21:15 UTC, Jan Lahoda
Details
Patch for review (861 bytes, patch)
2012-07-10 11:55 UTC, Jan Lahoda
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jmborer 2012-07-04 14:58:14 UTC
Created attachment 121736 [details]
Screenshot after other file modification

I have noticed since several builds that there is a small regression with error highlighting update.

I am using Maven Java projects. Sometimes when I change, say, a signature of a method in a file and come back to another file where the method is still called with the old params, instead of a the error beeing highlighted only the error badge appears in the tab (screenshot1). I need to force a refresh of the indexing of the code by typing an \n and then only the error will highlighting will be displayed (screenshot2).

This starts to happen quite often even though not systematically reproducible.
Comment 1 jmborer 2012-07-04 14:58:42 UTC
Created attachment 121737 [details]
Screenshot after forced refresh
Comment 2 jmborer 2012-07-04 14:59:17 UTC
Notice the change on line 168 in the screenshots
Comment 3 jmborer 2012-07-04 14:59:49 UTC
Product Version: NetBeans IDE 7.2 RC1 (Build 201206272359)
Java: 1.6.0_30; Java HotSpot(TM) Client VM 20.5-b03
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
User directory: H:\projects\.netbeans\dev
Cache directory: H:\projects\.netbeans\dev\cache
Comment 4 jmborer 2012-07-05 11:59:00 UTC
I was able to reproduce it today.

Something I notice is when I change the method signature, the file where the method is used gets the error badge AND the method becomes in italic text but misses the error underline as well as the red marker in the margin on the right hand side of the vertical scrollbar.

I will try to setup a simple scenario to reproduce it.
Comment 5 jmborer 2012-07-05 12:05:39 UTC
Looking in the IDE logs I saw this one:
WARNING [org.netbeans.modules.java.source.parsing.JavacParser]: Javac returned startpos: 137 > endpos: -1

Which is probably the source of the "no update".
Comment 6 Jan Lahoda 2012-07-08 21:15:49 UTC
Created attachment 121811 [details]
Binary patch against 7.2 to help identify the issue

I have a vague idea what might be wrong - hard to say without steps to reproduce if that is actually the problem. Please install this binary patch (should be compatible with recent 7.2 builds) and check whether you can still reproduce.

To install the patch: download this jar and place it into directory: ${NETBEANS_INSTALL_DIR}/ide/modules/patches/org-netbeans-modules-parsing-api
(${NETBEANS_INSTALL_DIR}/ide/modules should exist, patches/org-netbeans-modules-parsing-api must be created). To revert the effects of the patch, delete the jar from the directory.

Also, please try to run the IDE with the following command line options, reproduce the problem and attach the messages.log:
-J-Dorg.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.level=0 -J-Dorg.netbeans.modules.parsing.impl.TaskProcessor.level=0

If the patch wouldn't help, please try to run the IDE with this command line option:
-J-Dorg.netbeans.modules.parsing.impl.TaskProcessor.compatMode=true
and try to reproduce (please don't mix this option with the binary patch, to make sure the results are correct).

Thanks.
Comment 7 jmborer 2012-07-09 08:07:52 UTC
Ok I installed your patch this morning. I'll work the day with it and let you know today or tomorrow if the issue is fixed or not.
Comment 8 jmborer 2012-07-09 13:54:16 UTC
Jan,

With your patch NB indexing and error highlighting seems much more reliable:
Find here some excerpt form my IDE log where the file QGODelegator.java contains the syntax highlights. 


FINE [org.netbeans.modules.parsing.impl.TaskProcessor]: Finished ON_CHANGE Task: Periodic request 13855271 to perform: CancelableTaskWrapper[task: org.netbeans.modules.java.source.tasklist.IncorrectErrorBadges@f14c9b, phase: UP_TO_DATE, priority: 2147483647] on: SourceCache 3883423: QGODelegator.java
FINE [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]: IsScanInProgress: (starting: false | working: true | path are changing: false)
FINE [org.netbeans.modules.parsing.impl.TaskProcessor]: Running Task: Periodic request 25563518 to perform: org.netbeans.modules.java.editor.overridden.ComputeAnnotations@18cf124 on: SourceCache 3883423: QGODelegator.java
FINEST [org.netbeans.modules.parsing.impl.TaskProcessor]: Executed task: class org.netbeans.modules.java.editor.overridden.ComputeAnnotations in 93 ms.
FINE [org.netbeans.modules.parsing.impl.TaskProcessor]: Finished  CANCELED Task: Periodic request 25563518 to perform: org.netbeans.modules.java.editor.overridden.ComputeAnnotations@18cf124 on: SourceCache 3883423: QGODelegator.java
Comment 9 Jan Lahoda 2012-07-09 14:50:11 UTC
Thanks for testing.

(In reply to comment #8)
> Jan,
> 
> With your patch NB indexing and error highlighting seems much more reliable:

What exactly does this mean? Does the problem happen less often or did not happen at all (yet)?
Comment 10 jmborer 2012-07-10 11:33:47 UTC
OK so after almost two days of testing, I did not encounter the bug again with your patch. So I think, your patch should fix the issue or improve the current situation.
Comment 11 Jan Lahoda 2012-07-10 11:55:18 UTC
Created attachment 121884 [details]
Patch for review
Comment 12 Jan Lahoda 2012-07-10 12:01:53 UTC
(In reply to comment #10)
> OK so after almost two days of testing, I did not encounter the bug again with
> your patch. So I think, your patch should fix the issue or improve the current
> situation.

Great! To be precise, the patch I attached originally is not a fix - it was only to find out whether a hypothesis about the cause is reasonable or not. It would have serious performance implications (for non-Java languages, I think - PHP?) The actual proposed patch is attached (based on a chat with tzezula).

Tomas, could you please review the attached patch? I think this is what you talked about - I was considering to make the patch more conservative (keeping the current impl of shouldRefresh and only augmenting it with isTransientUpdate), but seemed so much inferior to me that I dropped the idea.

Marian, I suppose there is no chance this could make it into 7.2, and it will need to wait for an update, right?
Comment 13 Tomas Zezula 2012-07-10 12:48:14 UTC
The patch is OK.
Comment 14 Jan Lahoda 2012-07-10 13:15:28 UTC
Applied to release72:
http://hg.netbeans.org/releases/rev/0560ac8f1303
Comment 15 Jan Lahoda 2012-07-10 13:34:07 UTC
trunk:
http://hg.netbeans.org/jet-main/rev/cd51de70c49b
Comment 16 Quality Engineering 2012-07-10 14:53:06 UTC
Integrated into 'releases', will be available in build *201207101652* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/0560ac8f1303
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #215180: all FileListWorks should do active document refresh unless the work is part of an transient update
Comment 17 Quality Engineering 2012-07-12 08:17:51 UTC
Integrated into 'main-golden', will be available in build *201207120002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/cd51de70c49b
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #215180: all FileListWorks should do active document refresh unless the work is part of an transient update