UniqueValueValidationService init() fails with @NoDuplicates declared on super class property [message #1115531] |
Tue, 24 September 2013 08:15  |
Greg Amerson Messages: 119 Registered: March 2010 |
Senior Member |
|
|
Hey guys,
I have a model where a Portlet has a ElementList property for a list of Params, the Param object itself is just a sub-class that inherits from several super interfaces namely, the NameValue element. This NameValue element has a Name property that specifies @NoDuplicates.
This relationship appears to be giving UniqueValueValidationService some problems. Here is the stack trace.
java.lang.IllegalStateException: UniqueValueValidationService data accessed prior to service initialization.
at org.eclipse.sapphire.services.DataService.data(DataService.java:60)
at org.eclipse.sapphire.services.ValidationService.validation(ValidationService.java:49)
at org.eclipse.sapphire.Property.refreshValidation(Property.java:253)
at org.eclipse.sapphire.Property.validation(Property.java:410)
at org.eclipse.sapphire.ui.PropertyEditorPart.computeValidation(PropertyEditorPart.java:646)
at org.eclipse.sapphire.ui.SapphirePart.refreshValidation(SapphirePart.java:454)
at org.eclipse.sapphire.ui.SapphirePart.validation(SapphirePart.java:425)
at org.eclipse.sapphire.ui.FormPart.computeValidation(FormPart.java:157)
at org.eclipse.sapphire.ui.SapphirePart.refreshValidation(SapphirePart.java:454)
at org.eclipse.sapphire.ui.SapphirePart.validation(SapphirePart.java:425)
at org.eclipse.sapphire.ui.form.editors.masterdetails.MasterDetailsContentNode.computeValidation(MasterDetailsContentNode.java:710)
I trace this problem down to this line:
UniqueValueValidationService.java line 54 where is tries to create the index. In the index() method the following must be trueproperty.getModelElementType() == entryType However in my adopter case this isn't true, the property.getModelElementType() is on a super-interface of entryType. However the following expression does evaluate to true in my adopter case: property.getModelElementType().getModelElementClass().isAssignableFrom(entryType.getModelElementClass()) Because in my case property.getModelElementType() is a super element to that of entryType. When the index() call fails, then the overall initValidationService() call fails so the service is never initialized properly and this eventually leads to the error in the UI part saying that validation is happening on a validation service that was never initialized.
Thoughts? Is it valid to add this case to the logic of the ElementList.index() method?
[Updated on: Tue, 24 September 2013 15:03] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02423 seconds