Initialization with default values fails for primitive data types
-----------------------------------------------------------------
Key: MUSE-233
URL: https://issues.apache.org/jira/browse/MUSE-233
Project: Muse
Issue Type: Bug
Components: Core Engine - Resource and Capability APIs
Affects Versions: 2.2.0
Environment: Windows XP, Sun Java 5
Reporter: Balan Subramanian
Assignee: Dan Jemiolo
Priority: Critical
Fix For: 2.3.0
When declaring default values (in the RMD) for properties whose type is a
primitive data type, Muse tries to initialize those properties by calling
SimpleResourcePropertyCollection.insertOrUpdate(). Insert or update first does
a getResourceProperty to see if a value already exists. If it does then it does
a update otherwise an insert.
The problem seems to be that updateResourceProperty() actually calls
validateInsert() which will fail if you have defined the cardinality of the
property to be 1.
This happens only for primitive data types because Java will already initialize
them even if you don't. So when Muse calls getResourceProperty() it will see
that a value already exists and try to do an update. For object types, which
automatically get initialized to null, Muse will correctly call insert to add
the new value.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]