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

Bug 311112

Summary: @Convert value can get unset
Product: [WebTools] Dali JPA Tools Reporter: Karen Butzke <karenfbutzke>
Component: GeneralAssignee: Karen Butzke <karenfbutzke>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: neil.hauge, paul.fullbright
Version: 2.3Flags: neil.hauge: pmc_approved? (david_williams)
neil.hauge: pmc_approved? (raghunathan.srinivasan)
neil.hauge: pmc_approved? (naci.dai)
deboer: pmc_approved+
neil.hauge: pmc_approved? (neil.hauge)
neil.hauge: pmc_approved? (kaloyan)
Target Milestone: 2.3 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard: PMC_approved
Attachments:
Description Flags
proposed patch against head
none
proposed patch against head none

Description Karen Butzke CLA 2010-04-29 16:56:32 EDT
@Entity
public class Foo {
	@Convert
	@Converter(name = "foo")
	private String foo;
}

Create the above entity with the JPA Details view open.  Type in a value for the @Convert annotation:  @Convert("foo").  After you finish typing this, the java source will be edited out from under you and the Marker annotation is all that will remain.

I also saw similar issues when I already had the @Convert("foo") in the source code.  If I selected that mapping and then selected another basic mapping, the source would be edited out from under me in the same way.
Comment 1 Karen Butzke CLA 2010-05-04 14:36:53 EDT
Created attachment 167011 [details]
proposed patch against head

About a month ago we switched all of our CCombos to Combos.  That change broke this particular use case.  The patch simply removes one unnecessary (as far as I can tell) line of code from ComboModelAdapter.  I am comfortable with this change because the now deleted CComboModelAdapter did not include this line of code.  I have tested multiple locations where we use Combos and have not hit any other issues.
Comment 2 Karen Butzke CLA 2010-05-07 17:22:04 EDT
Created attachment 167582 [details]
proposed patch against head

This patch includes the original fix plug changes to CompositeListValueModel (from Brian) to handle listChangeEvents more gracefully so that the Combo list does not get rebuilt unnecessarily.  These changes only affect a few places in our UI since we usually use more granular change events for our lists rather than just LIST_CHANGED. Converters and Generators are the 2 areas affected and I have tested both of these using this patch.
Comment 3 Neil Hauge CLA 2010-05-10 16:10:52 EDT
* Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. 

Source code (JPA annotation) is removed after typing it in to the Java source editor.

* Is there a work-around? If so, why do you believe the work-around is insufficient? 

No workaround, outside of not having the Dali UI open.

* How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? 

Manually tested and new JUnit tests added in the patch.

* Give a brief technical overview. Who has reviewed this fix? 

See comment 2.  I have reviewed the fix.

* What is the risk associated with this fix? 

Low risk, isolated fix.
Comment 4 Karen Butzke CLA 2010-05-10 17:47:26 EDT
checked in for rc1
Comment 5 Paul Fullbright CLA 2010-05-18 14:18:44 EDT
verified could not reproduce in RC1