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.
Summary: | [72cat] Error highlighting seems not to update properly | ||
---|---|---|---|
Product: | java | Reporter: | jmborer <jmborer> |
Component: | Editor | Assignee: | Jan Lahoda <jlahoda> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | mmirilovic, tzezula |
Priority: | P1 | ||
Version: | 7.2 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
Screenshot after other file modification
Screenshot after forced refresh Binary patch against 7.2 to help identify the issue Patch for review |
Created attachment 121737 [details]
Screenshot after forced refresh
Notice the change on line 168 in the screenshots 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 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. 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". 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.
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. 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 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)? 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. Created attachment 121884 [details]
Patch for review
(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? The patch is OK. Applied to release72: http://hg.netbeans.org/releases/rev/0560ac8f1303 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 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 |
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.