Skip to main content



      Home
Home » Archived » Sapphire » UniqueValueValidationService init() fails with @NoDuplicates declared on super class property
UniqueValueValidationService init() fails with @NoDuplicates declared on super class property [message #1115531] Tue, 24 September 2013 04:15 Go to next message
Eclipse UserFriend
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 true
property.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 11:03] by Moderator

Re: UniqueValueValidationService init() fails with @NoDuplicates declared on super class property [message #1115580 is a reply to message #1115531] Tue, 24 September 2013 05:38 Go to previous messageGo to next message
Eclipse UserFriend
I was able to fix this locally by doing this: https://github.com/gamerson/sapphire/commit/94ebbb36b62ddb060add868c5b9bd05a4a0ca2c0

Btw, how do we contribute code to sapphire now? I noticed it isn't in gerrit yet. Attaching patches to bugzilla still the best way? I guess its git patches now?
Re: UniqueValueValidationService init() fails with @NoDuplicates declared on super class property [message #1115797 is a reply to message #1115580] Tue, 24 September 2013 11:35 Go to previous messageGo to next message
Eclipse UserFriend
Please open a bug and attach a patch. Sapphire isn't in gerrit yet as there hasn't been much call for that so far.

Eclipse Foundation now requires all contributors to accept the new Contributor License Agreement (CLA). Nothing in the agreement is new. They are just trying to automate the bookkeeping. You can see CLA status next to your name in any bugzilla task. Click on that button and follow the instructions. This needs to be completed before I can merge your fix.
Re: UniqueValueValidationService init() fails with @NoDuplicates declared on super class property [message #1116287 is a reply to message #1115797] Wed, 25 September 2013 03:40 Go to previous message
Eclipse UserFriend
Opened and attached! https://bugs.eclipse.org/bugs/show_bug.cgi?id=417977

I have signed the CLA using the projects portal thing, but it hasn't updated my icon just yet.
Previous Topic:sapphire wizard displaying initial error message
Next Topic:Sapphire 0.7 delayed
Goto Forum:
  


Current Time: Thu May 15 19:00:35 EDT 2025

Powered by FUDForum. Page generated in 0.03181 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top