Author: cziegeler
Date: Fri Nov 30 11:00:00 2012
New Revision: 1415585

URL: http://svn.apache.org/viewvc?rev=1415585&view=rev
Log:
FELIX-3793 :  Property of type Character must use unicode value 

Modified:
    
felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java

Modified: 
felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java?rev=1415585&r1=1415584&r2=1415585&view=diff
==============================================================================
--- 
felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java
 (original)
+++ 
felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java
 Fri Nov 30 11:00:00 2012
@@ -564,7 +564,13 @@ public class ComponentDescriptorIO {
                         }
 
                         if (attributes.getValue(PROPERTY_ATTR_VALUE) != null) {
-                            
prop.setValue(attributes.getValue(PROPERTY_ATTR_VALUE));
+                            if ( prop.getType() == PropertyType.Char || 
prop.getType() == PropertyType.Character ) {
+                                final int val = 
Integer.valueOf(attributes.getValue(PROPERTY_ATTR_VALUE));
+                                final Character c = 
Character.valueOf((char)val);
+                                prop.setValue(c.toString());
+                            } else {
+                                
prop.setValue(attributes.getValue(PROPERTY_ATTR_VALUE));
+                            }
                             this.currentClass.add(prop);
                         } else {
                             // hold the property pending as we have a multi 
value
@@ -689,6 +695,11 @@ public class ComponentDescriptorIO {
                         int index = 0;
                         while (st.hasMoreTokens()) {
                             values[index] = st.nextToken();
+                            if ( this.pendingProperty.getType() == 
PropertyType.Char || this.pendingProperty.getType() == PropertyType.Character ) 
{
+                                final int val = Integer.valueOf(values[index]);
+                                final Character c = 
Character.valueOf((char)val);
+                                values[index] = c.toString();
+                            }
                             index++;
                         }
                         this.pendingProperty.setMultiValue(values);


Reply via email to