The following comment has been added to this issue:
Author: James Carman
Created: Thu, 23 Sep 2004 5:20 AM
Body:
I have a patch which fixes the problem and adds a test case to test for it...
// In TestSmartTranslator.java
public void testStringToObject()
{
Translator t = new SmartTranslator();
Object result = t.translate( null, Object.class, "test", null );
assertEquals( "test", result );
}
This fails with an Exception (with roughly the same stack trace). So, I added
logic into SmartTranslator...
// HIVEMIND-10: Inside JavaWebStart you (strangely) can't rely on
// a PropertyEditor for String (even though it is trivial).
// HIVEMIND-15: When SmartTranslator needs to translate a String to
// an object, it should merely return the original String.
if ( String.class.equals( propertyType ) ||
Object.class.equals( propertyType ) )
{
return inputValue;
}
Please open this back up so that I can attach my patch. We should put this fix
into the 1.0 branch, too.
---------------------------------------------------------------------
View this comment:
http://issues.apache.org/jira/browse/HIVEMIND-15?page=comments#action_53354
---------------------------------------------------------------------
View the issue:
http://issues.apache.org/jira/browse/HIVEMIND-15
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HIVEMIND-15
Summary: hivemind fails on translating a string attribute in a string
Type: Wish
Status: Closed
Priority: Major
Resolution: CANNOT REPRODUCE
Project: HiveMind
Components:
framework
Versions:
1.0
Assignee: Howard M. Lewis Ship
Reporter: Christian Domsch
Created: Fri, 2 Jul 2004 5:46 AM
Updated: Thu, 23 Sep 2004 5:20 AM
Environment: Windows 2000, Eclipse 3.0, j2sdk1.4.2
Description:
I have a configuration-point that builds a list of strings. When I build the
schema for the cp, hivemind expects a translator for an attribute. Since I want
to have Strings in my list, I don't need a translator.
Sadly the SmartTranslator fails on translating a string into a string, so I had
to write my own (very simple implementation :-). Maybe I did something wrong in
my configuration-point:
configuration-point (id=model) {
schema {
element (name=model) {
attribute (name=name required=true)
rules {
push-attribute (attribute=name)
invoke-parent (method=addElement)
}
}
}
}
contribution (configuration-id=model) {
model (name=MyModelName)
}
If this is correct, it would be a great enhancement, if hivemind would be able
to "translate" strings into strings without implementing a custom translator.
This is not very intuitive.
Greetings,
Christian Domsch
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]