Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312145 - "Semantic Highlighting Job" gets NPE
Summary: "Semantic Highlighting Job" gets NPE
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.sse (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.2 RC1   Edit
Assignee: Nick Sandonato CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 312099
  Show dependency tree
 
Reported: 2010-05-07 21:58 EDT by Zhongwei Zhao CLA
Modified: 2010-05-12 21:32 EDT (History)
1 user (show)

See Also:
thatnitind: review+


Attachments
patch (4.58 KB, patch)
2010-05-12 17:36 EDT, Nick Sandonato CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zhongwei Zhao CLA 2010-05-07 21:58:39 EDT
There is a user said

When I open a PHP file, a "Semantic Highlighting Job" task appears in the Progress view (if I have "Show sleeping and system operations" turned on).

If I close the file before the job has completed, I get that error. If I wait for the job to complete, I don't.

It doesn't seem to depend on the file's content.


here is the stackprace:

java.lang.NullPointerException
at org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingReconciler.addPosition(SemanticHighlightingReconciler.java:184)
at org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingReconciler.addPosition(SemanticHighlightingReconciler.java:166)
at org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingReconciler.reconcile(SemanticHighlightingReconciler.java:129)
at org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingReconciler$1.run(SemanticHighlightingReconciler.java:279)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)


I think here should synchronized the block and then judge if fPresenter is null.
Comment 1 Nick Sandonato CLA 2010-05-12 17:36:37 EDT
Created attachment 168278 [details]
patch

Cleans up the code to use the fJob* fields as was intended. Also added was some extra checks to make sure we don't continue processing regions after the reconciler's been uninstalled.
Comment 2 Nick Sandonato CLA 2010-05-12 17:38:08 EDT
Nitin, could you review this for RC1? I think the reconciler running after the editor's been shutdown is a performance drag and we should also clean up this NPE to prevent unnecessary log messages.
Comment 3 Nick Sandonato CLA 2010-05-12 21:32:58 EDT
Code checked in for RC1.