Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 426135

Summary: Wrong highlighting of changed variables / JDIVariable not threadsafe
Product: [Eclipse Project] JDT Reporter: Soenke Broihan <soenke.broihan>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 4.3.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug
Attachments:
Description Flags
Not threadsafe - fValue supposed to be null but is not
none
Partial highlighting of changed variable none

Description Soenke Broihan CLA 2014-01-20 09:41:47 EST
Created attachment 239146 [details]
Not threadsafe - fValue supposed to be null but is not

I'm not sure if it is the root cause of the wrong / missing variable highlighting but the JDIVariable class is not threadsafe even though it is constantly used by at least 2 different threads as far as I can see (from classes JavaVariableContentProvider and JavaVariableLabelProvider which are called from different jobs).

Therefore you can get in the situation shown in the attachment where fValue gets assigned by another thread after the check for being null was performed which then overrides the actual value of fValue.

So it's kind of likely that the comparison to the previous value is messed up.

Even worse: The label provider uses JDIVariable.getValue() for each column and adopts the background of each cell according to JDIVariable.hasValueChanged(). 

Therefore you can get in the situation in which the columns get different background colors (highlighted and normal) because in between the value seems to have changed.

And another problem (perhaps related to the above):

If you have big arrays which get divided into index packages (more than 100 elements) highlighting does not work also the value is changed. Perhaps threading issues or is it related to class IndexedVariablePartition always yielding "false" on .hasValueChanged()?

For me it is reproducible.
Comment 1 Soenke Broihan CLA 2014-01-20 09:42:18 EST
Created attachment 239147 [details]
Partial highlighting of changed variable
Comment 2 Eclipse Genie CLA 2018-09-26 16:41:34 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.