You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by fm...@apache.org on 2012/10/18 14:50:41 UTC

svn commit: r1399637 - in /felix/trunk/metatype/src: main/java/org/apache/felix/metatype/ main/java/org/apache/felix/metatype/internal/ main/java/org/apache/felix/metatype/internal/l10n/ test/java/org/apache/felix/metatype/

Author: fmeschbe
Date: Thu Oct 18 12:50:41 2012
New Revision: 1399637

URL: http://svn.apache.org/viewvc?rev=1399637&view=rev
Log:
Apply our formatting rules (particularly with respect to opening braces)

Modified:
    felix/trunk/metatype/src/main/java/org/apache/felix/metatype/MetaData.java
    felix/trunk/metatype/src/main/java/org/apache/felix/metatype/MetaDataReader.java
    felix/trunk/metatype/src/main/java/org/apache/felix/metatype/OptionalAttributes.java
    felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/Activator.java
    felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/LocalizedObjectClassDefinition.java
    felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/MetaTypeInformationImpl.java
    felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/MetaTypeServiceImpl.java
    felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/l10n/BundleResources.java
    felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/l10n/Resources.java
    felix/trunk/metatype/src/test/java/org/apache/felix/metatype/MetaDataReaderTest.java

Modified: felix/trunk/metatype/src/main/java/org/apache/felix/metatype/MetaData.java
URL: http://svn.apache.org/viewvc/felix/trunk/metatype/src/main/java/org/apache/felix/metatype/MetaData.java?rev=1399637&r1=1399636&r2=1399637&view=diff
==============================================================================
--- felix/trunk/metatype/src/main/java/org/apache/felix/metatype/MetaData.java (original)
+++ felix/trunk/metatype/src/main/java/org/apache/felix/metatype/MetaData.java Thu Oct 18 12:50:41 2012
@@ -39,6 +39,7 @@ public class MetaData extends OptionalAt
     private Map designates;
     private URL source;
 
+
     public String getLocalePrefix()
     {
         return localePrefix;

Modified: felix/trunk/metatype/src/main/java/org/apache/felix/metatype/MetaDataReader.java
URL: http://svn.apache.org/viewvc/felix/trunk/metatype/src/main/java/org/apache/felix/metatype/MetaDataReader.java?rev=1399637&r1=1399636&r2=1399637&view=diff
==============================================================================
--- felix/trunk/metatype/src/main/java/org/apache/felix/metatype/MetaDataReader.java (original)
+++ felix/trunk/metatype/src/main/java/org/apache/felix/metatype/MetaDataReader.java Thu Oct 18 12:50:41 2012
@@ -78,12 +78,18 @@ public class MetaDataReader
     private KXmlParser parser = new KXmlParser();
 
     /** Sets of attributes belonging to XML elements. */
-    private final Set AD_ATTRIBUTES = new HashSet(Arrays.asList(new String[] { "name", "description", "id", "type", "cardinality", "min", "max", "default", "required" }));
-    private final Set ATTRIBUTE_ATTRIBUTES = new HashSet(Arrays.asList(new String[] { "adref", "content" }));
-    private final Set DESIGNATE_ATTRIBUTES = new HashSet(Arrays.asList(new String[] { "pid", "factoryPid", "bundle", "optional", "merge" }));
-    private final Set DESIGNATEOBJECT_ATTRIBUTES = new HashSet(Arrays.asList(new String[] { "ocdref" }));
-    private final Set METADATA_ATTRIBUTES = new HashSet(Arrays.asList(new String[] { "localization" }));
-    private final Set OCD_ATTRIBUTES = new HashSet(Arrays.asList(new String[] { "name", "description", "id" }));
+    private final Set AD_ATTRIBUTES = new HashSet( Arrays.asList( new String[]
+        { "name", "description", "id", "type", "cardinality", "min", "max", "default", "required" } ) );
+    private final Set ATTRIBUTE_ATTRIBUTES = new HashSet( Arrays.asList( new String[]
+        { "adref", "content" } ) );
+    private final Set DESIGNATE_ATTRIBUTES = new HashSet( Arrays.asList( new String[]
+        { "pid", "factoryPid", "bundle", "optional", "merge" } ) );
+    private final Set DESIGNATEOBJECT_ATTRIBUTES = new HashSet( Arrays.asList( new String[]
+        { "ocdref" } ) );
+    private final Set METADATA_ATTRIBUTES = new HashSet( Arrays.asList( new String[]
+        { "localization" } ) );
+    private final Set OCD_ATTRIBUTES = new HashSet( Arrays.asList( new String[]
+        { "name", "description", "id" } ) );
 
 
     /**
@@ -183,7 +189,7 @@ public class MetaDataReader
                 if ( "MetaData".equals( this.parser.getName() ) )
                 {
                     checkMetatypeNamespace();
-                    mti = this.readMetaData( );
+                    mti = this.readMetaData();
                 }
                 else
                 {
@@ -197,15 +203,16 @@ public class MetaDataReader
     }
 
 
-    private void readOptionalAttributes(OptionalAttributes entity, Set attributes) {
+    private void readOptionalAttributes( OptionalAttributes entity, Set attributes )
+    {
         int count = this.parser.getAttributeCount();
-        for (int i = 0; i < count; i++)
+        for ( int i = 0; i < count; i++ )
         {
-            String name = this.parser.getAttributeName(i);
-            if (!attributes.contains(name))
+            String name = this.parser.getAttributeName( i );
+            if ( !attributes.contains( name ) )
             {
-                String value = this.parser.getAttributeValue(i);
-                entity.addOptionalAttribute(name, value);
+                String value = this.parser.getAttributeValue( i );
+                entity.addOptionalAttribute( name, value );
             }
         }
     }
@@ -216,7 +223,7 @@ public class MetaDataReader
         MetaData mti = this.createMetaData();
         mti.setLocalePrefix( this.getOptionalAttribute( "localization" ) );
 
-        readOptionalAttributes(mti, METADATA_ATTRIBUTES);
+        readOptionalAttributes( mti, METADATA_ATTRIBUTES );
 
         int eventType = this.parser.next();
         while ( eventType != XmlPullParser.END_DOCUMENT )
@@ -259,7 +266,7 @@ public class MetaDataReader
         ocd.setName( this.getRequiredAttribute( "name" ) );
         ocd.setDescription( this.getOptionalAttribute( "description" ) );
 
-        readOptionalAttributes(ocd, OCD_ATTRIBUTES);
+        readOptionalAttributes( ocd, OCD_ATTRIBUTES );
 
         int eventType = this.parser.next();
         while ( eventType != XmlPullParser.END_DOCUMENT )
@@ -324,7 +331,7 @@ public class MetaDataReader
         designate.setOptional( this.getOptionalAttribute( "optional", false ) );
         designate.setMerge( this.getOptionalAttribute( "merge", false ) );
 
-        readOptionalAttributes(designate, DESIGNATE_ATTRIBUTES);
+        readOptionalAttributes( designate, DESIGNATE_ATTRIBUTES );
 
         int eventType = this.parser.next();
         while ( eventType != XmlPullParser.END_DOCUMENT )
@@ -369,7 +376,7 @@ public class MetaDataReader
         ad.setDefaultValue( this.getOptionalAttribute( "default" ) );
         ad.setRequired( this.getOptionalAttribute( "required", true ) );
 
-        readOptionalAttributes(ad, AD_ATTRIBUTES);
+        readOptionalAttributes( ad, AD_ATTRIBUTES );
 
         Map options = new LinkedHashMap();
         int eventType = this.parser.next();
@@ -413,7 +420,7 @@ public class MetaDataReader
         DesignateObject oh = this.createDesignateObject();
         oh.setOcdRef( this.getRequiredAttribute( "ocdref" ) );
 
-        readOptionalAttributes(oh, DESIGNATEOBJECT_ATTRIBUTES);
+        readOptionalAttributes( oh, DESIGNATEOBJECT_ATTRIBUTES );
 
         int eventType = this.parser.next();
         while ( eventType != XmlPullParser.END_DOCUMENT )
@@ -450,7 +457,7 @@ public class MetaDataReader
         ah.setAdRef( this.getRequiredAttribute( "adref" ) );
         ah.addContent( this.getOptionalAttribute( "content" ), true );
 
-        readOptionalAttributes(ah, ATTRIBUTE_ATTRIBUTES);
+        readOptionalAttributes( ah, ATTRIBUTE_ATTRIBUTES );
 
         int eventType = this.parser.next();
         while ( eventType != XmlPullParser.END_DOCUMENT )

Modified: felix/trunk/metatype/src/main/java/org/apache/felix/metatype/OptionalAttributes.java
URL: http://svn.apache.org/viewvc/felix/trunk/metatype/src/main/java/org/apache/felix/metatype/OptionalAttributes.java?rev=1399637&r1=1399636&r2=1399637&view=diff
==============================================================================
--- felix/trunk/metatype/src/main/java/org/apache/felix/metatype/OptionalAttributes.java (original)
+++ felix/trunk/metatype/src/main/java/org/apache/felix/metatype/OptionalAttributes.java Thu Oct 18 12:50:41 2012
@@ -18,22 +18,28 @@
  */
 package org.apache.felix.metatype;
 
+
 import java.util.HashMap;
 import java.util.Map;
 
-public class OptionalAttributes {
+
+public class OptionalAttributes
+{
     private Map optionalAttributes;
-    
-    public void addOptionalAttribute(String name, String value)
+
+
+    public void addOptionalAttribute( String name, String value )
     {
-        if (optionalAttributes == null)
+        if ( optionalAttributes == null )
         {
             optionalAttributes = new HashMap();
         }
-        optionalAttributes.put(name, value);
+        optionalAttributes.put( name, value );
     }
-    
-    public Map getOptionalAttributes() {
+
+
+    public Map getOptionalAttributes()
+    {
         return optionalAttributes;
     }
 }

Modified: felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/Activator.java
URL: http://svn.apache.org/viewvc/felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/Activator.java?rev=1399637&r1=1399636&r2=1399637&view=diff
==============================================================================
--- felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/Activator.java (original)
+++ felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/Activator.java Thu Oct 18 12:50:41 2012
@@ -120,6 +120,7 @@ public class Activator implements Bundle
         BundleResources.clearResourcesCache();
     }
 
+
     //---------- Logging Support ----------------------------------------------
     // log to stdout or use LogService
 

Modified: felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/LocalizedObjectClassDefinition.java
URL: http://svn.apache.org/viewvc/felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/LocalizedObjectClassDefinition.java?rev=1399637&r1=1399636&r2=1399637&view=diff
==============================================================================
--- felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/LocalizedObjectClassDefinition.java (original)
+++ felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/LocalizedObjectClassDefinition.java Thu Oct 18 12:50:41 2012
@@ -156,7 +156,7 @@ public class LocalizedObjectClassDefinit
 
         // just create an URL based on the source of the metadata
         // see FELIX2868
-        URL url = new URL(this.ocd.getMetadata().getSource(), iconPath);
+        URL url = new URL( this.ocd.getMetadata().getSource(), iconPath );
         return url.openStream();
     }
 

Modified: felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/MetaTypeInformationImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/MetaTypeInformationImpl.java?rev=1399637&r1=1399636&r2=1399637&view=diff
==============================================================================
--- felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/MetaTypeInformationImpl.java (original)
+++ felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/MetaTypeInformationImpl.java Thu Oct 18 12:50:41 2012
@@ -18,6 +18,7 @@
  */
 package org.apache.felix.metatype.internal;
 
+
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashMap;
@@ -36,6 +37,7 @@ import org.osgi.service.metatype.MetaTyp
 import org.osgi.service.metatype.MetaTypeProvider;
 import org.osgi.service.metatype.ObjectClassDefinition;
 
+
 /**
  * The <code>MetaTypeInformationImpl</code> class implements the
  * <code>MetaTypeInformation</code> interface returned from the
@@ -43,7 +45,8 @@ import org.osgi.service.metatype.ObjectC
  *
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-public class MetaTypeInformationImpl implements MetaTypeInformation {
+public class MetaTypeInformationImpl implements MetaTypeInformation
+{
 
     // also defined in org.osgi.service.cm.ConfigurationAdmin, but copied
     // here to not create a synthetic dependency
@@ -59,68 +62,82 @@ public class MetaTypeInformationImpl imp
 
     private Map metaTypeProviders;
 
-    protected MetaTypeInformationImpl(Bundle bundle) {
+
+    protected MetaTypeInformationImpl( Bundle bundle )
+    {
         this.bundle = bundle;
         this.pids = new TreeSet();
         this.factoryPids = new TreeSet();
         this.metaTypeProviders = new HashMap();
     }
 
+
     /*
      * (non-Javadoc)
      *
      * @see org.osgi.service.metatype.MetaTypeInformation#getBundle()
      */
-    public Bundle getBundle() {
+    public Bundle getBundle()
+    {
         return this.bundle;
     }
 
+
     /*
      * (non-Javadoc)
      *
      * @see org.osgi.service.metatype.MetaTypeInformation#getFactoryPids()
      */
-    public String[] getFactoryPids() {
-        return (String[]) this.factoryPids.toArray(new String[this.factoryPids.size()]);
+    public String[] getFactoryPids()
+    {
+        return ( String[] ) this.factoryPids.toArray( new String[this.factoryPids.size()] );
     }
 
+
     /*
      * (non-Javadoc)
      *
      * @see org.osgi.service.metatype.MetaTypeInformation#getPids()
      */
-    public String[] getPids() {
-        return (String[]) this.pids.toArray(new String[this.pids.size()]);
+    public String[] getPids()
+    {
+        return ( String[] ) this.pids.toArray( new String[this.pids.size()] );
     }
 
+
     /*
      * (non-Javadoc)
      *
      * @see org.osgi.service.metatype.MetaTypeProvider#getLocales()
      */
-    public String[] getLocales() {
-        if (this.locales == null) {
-            synchronized (this) {
+    public String[] getLocales()
+    {
+        if ( this.locales == null )
+        {
+            synchronized ( this )
+            {
                 Set newLocales = new TreeSet();
-                for (Iterator mi = this.metaTypeProviders.values().iterator(); mi.hasNext();) {
-                    MetaTypeProvider mtp = (MetaTypeProvider) mi.next();
-                    this.addValues(newLocales, mtp.getLocales());
+                for ( Iterator mi = this.metaTypeProviders.values().iterator(); mi.hasNext(); )
+                {
+                    MetaTypeProvider mtp = ( MetaTypeProvider ) mi.next();
+                    this.addValues( newLocales, mtp.getLocales() );
                 }
                 this.locales = newLocales;
             }
         }
 
-        return (String[]) this.locales.toArray(new String[this.locales.size()]);
+        return ( String[] ) this.locales.toArray( new String[this.locales.size()] );
     }
 
+
     /*
      * (non-Javadoc)
      *
      * @see org.osgi.service.metatype.MetaTypeProvider#getObjectClassDefinition(java.lang.String,
      *      java.lang.String)
      */
-    public ObjectClassDefinition getObjectClassDefinition(String id,
-            String locale) {
+    public ObjectClassDefinition getObjectClassDefinition( String id, String locale )
+    {
 
         if ( id == null || id.length() == 0 )
         {
@@ -142,6 +159,7 @@ public class MetaTypeInformationImpl imp
         return ocd;
     }
 
+
     // ---------- internal support for metadata -------------------------------
 
     Designate getDesignate( String pid )
@@ -155,27 +173,33 @@ public class MetaTypeInformationImpl imp
         return null;
     }
 
+
     // ---------- setters to fill the values -----------------------------------
 
-    protected void addMetaData(MetaData md) {
-        if (md.getDesignates() != null) {
+    protected void addMetaData( MetaData md )
+    {
+        if ( md.getDesignates() != null )
+        {
             // meta type provide to register by PID
-            DefaultMetaTypeProvider dmtp = new DefaultMetaTypeProvider(this.bundle, md);
+            DefaultMetaTypeProvider dmtp = new DefaultMetaTypeProvider( this.bundle, md );
 
             Iterator designates = md.getDesignates().values().iterator();
-            while (designates.hasNext()) {
-                Designate designate = (Designate) designates.next();
+            while ( designates.hasNext() )
+            {
+                Designate designate = ( Designate ) designates.next();
 
                 // get the OCD reference, ignore the designate if none
                 DesignateObject object = designate.getObject();
-                String ocdRef = (object == null) ? null : object.getOcdRef();
-                if (ocdRef == null) {
+                String ocdRef = ( object == null ) ? null : object.getOcdRef();
+                if ( ocdRef == null )
+                {
                     continue;
                 }
 
                 // get ocd for the reference, ignore designate if none
-                OCD ocd = (OCD) md.getObjectClassDefinitions().get(ocdRef);
-                if (ocd == null) {
+                OCD ocd = ( OCD ) md.getObjectClassDefinitions().get( ocdRef );
+                if ( ocd == null )
+                {
                     continue;
                 }
 
@@ -194,41 +218,58 @@ public class MetaTypeInformationImpl imp
         }
     }
 
-    protected void addPids(String[] pids) {
-        this.addValues(this.pids, pids);
+
+    protected void addPids( String[] pids )
+    {
+        this.addValues( this.pids, pids );
     }
 
-    protected void removePid(String pid) {
-        this.pids.remove(pid);
+
+    protected void removePid( String pid )
+    {
+        this.pids.remove( pid );
     }
 
-    protected void addFactoryPids(String[] factoryPids) {
-        this.addValues(this.factoryPids, factoryPids);
+
+    protected void addFactoryPids( String[] factoryPids )
+    {
+        this.addValues( this.factoryPids, factoryPids );
     }
 
-    protected void removeFactoryPid(String factoryPid) {
-        this.factoryPids.remove(factoryPid);
+
+    protected void removeFactoryPid( String factoryPid )
+    {
+        this.factoryPids.remove( factoryPid );
     }
 
-    protected void addMetaTypeProvider(String key, MetaTypeProvider mtp) {
-        if (key != null && mtp != null) {
-            this.metaTypeProviders.put(key, mtp);
+
+    protected void addMetaTypeProvider( String key, MetaTypeProvider mtp )
+    {
+        if ( key != null && mtp != null )
+        {
+            this.metaTypeProviders.put( key, mtp );
             this.locales = null;
         }
     }
 
-    protected MetaTypeProvider removeMetaTypeProvider(String key) {
-        if (key != null) {
+
+    protected MetaTypeProvider removeMetaTypeProvider( String key )
+    {
+        if ( key != null )
+        {
             this.locales = null;
-            return (MetaTypeProvider) this.metaTypeProviders.remove(key);
+            return ( MetaTypeProvider ) this.metaTypeProviders.remove( key );
         }
 
         return null;
     }
 
-    private void addValues(Collection dest, Object[] values) {
-        if (values != null && values.length > 0) {
-            dest.addAll(Arrays.asList(values));
+
+    private void addValues( Collection dest, Object[] values )
+    {
+        if ( values != null && values.length > 0 )
+        {
+            dest.addAll( Arrays.asList( values ) );
         }
     }
 }

Modified: felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/MetaTypeServiceImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/MetaTypeServiceImpl.java?rev=1399637&r1=1399636&r2=1399637&view=diff
==============================================================================
--- felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/MetaTypeServiceImpl.java (original)
+++ felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/MetaTypeServiceImpl.java Thu Oct 18 12:50:41 2012
@@ -100,7 +100,8 @@ class MetaTypeServiceImpl implements Met
             try
             {
                 MetaData metaData = reader.parse( doc );
-                if (metaData != null) {
+                if ( metaData != null )
+                {
                     cmti.addMetaData( metaData );
                 }
             }

Modified: felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/l10n/BundleResources.java
URL: http://svn.apache.org/viewvc/felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/l10n/BundleResources.java?rev=1399637&r1=1399636&r2=1399637&view=diff
==============================================================================
--- felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/l10n/BundleResources.java (original)
+++ felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/l10n/BundleResources.java Thu Oct 18 12:50:41 2012
@@ -163,13 +163,13 @@ public class BundleResources
 
         Properties props = new Properties( parentProperties );
         URL resURL = bundle.getEntry( resourceName );
-        
+
         // FELIX-607 backwards compatibility, support
         if ( resURL == null )
         {
             resURL = bundle.getEntry( MetaTypeService.METATYPE_DOCUMENTS_LOCATION + "/" + resourceName );
         }
-        
+
         if ( resURL != null )
         {
             InputStream ins = null;

Modified: felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/l10n/Resources.java
URL: http://svn.apache.org/viewvc/felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/l10n/Resources.java?rev=1399637&r1=1399636&r2=1399637&view=diff
==============================================================================
--- felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/l10n/Resources.java (original)
+++ felix/trunk/metatype/src/main/java/org/apache/felix/metatype/internal/l10n/Resources.java Thu Oct 18 12:50:41 2012
@@ -18,8 +18,10 @@
  */
 package org.apache.felix.metatype.internal.l10n;
 
+
 import java.util.Properties;
 
+
 /**
  * The <code>Resources</code> TODO
  *
@@ -30,21 +32,29 @@ public class Resources
 
     private String locale;
     private Properties resources;
-    
-    Resources(String locale, Properties resources) {
+
+
+    Resources( String locale, Properties resources )
+    {
         this.locale = locale;
         this.resources = resources;
     }
-    
-    public String getLocale() {
+
+
+    public String getLocale()
+    {
         return locale;
     }
-    
-    Properties getResources() {
+
+
+    Properties getResources()
+    {
         return resources;
     }
-    
-    public String getResource(String resourceName) {
-        return  resources.getProperty( resourceName, resourceName );
+
+
+    public String getResource( String resourceName )
+    {
+        return resources.getProperty( resourceName, resourceName );
     }
 }

Modified: felix/trunk/metatype/src/test/java/org/apache/felix/metatype/MetaDataReaderTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/metatype/src/test/java/org/apache/felix/metatype/MetaDataReaderTest.java?rev=1399637&r1=1399636&r2=1399637&view=diff
==============================================================================
--- felix/trunk/metatype/src/test/java/org/apache/felix/metatype/MetaDataReaderTest.java (original)
+++ felix/trunk/metatype/src/test/java/org/apache/felix/metatype/MetaDataReaderTest.java Thu Oct 18 12:50:41 2012
@@ -66,6 +66,7 @@ public class MetaDataReaderTest extends 
         assertNull( mti.getObjectClassDefinitions() );
     }
 
+
     public void testOptionalAttributesInMetaData() throws IOException, XmlPullParserException
     {
         String name = "myattribute";
@@ -78,9 +79,10 @@ public class MetaDataReaderTest extends 
         assertNull( mti.getObjectClassDefinitions() );
         assertNotNull( mti.getOptionalAttributes() );
         assertEquals( 1, mti.getOptionalAttributes().size() );
-        assertEquals( value, mti.getOptionalAttributes().get(name) );
+        assertEquals( value, mti.getOptionalAttributes().get( name ) );
     }
 
+
     public void testWithNamespace_1_0_0() throws IOException, XmlPullParserException
     {
         String empty = "<metatype:MetaData xmlns:metatype=\"http://www.osgi.org/xmlns/metatype/v1.0.0\" "