directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r559074 - /directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/io/OpenLdapSchemaFileExporter.java
Date Tue, 24 Jul 2007 15:07:09 GMT
Author: pamarcelot
Date: Tue Jul 24 08:07:08 2007
New Revision: 559074

URL: http://svn.apache.org/viewvc?view=rev&rev=559074
Log:
Fix a bug which caused a NPE when an OC or AT does not have any alias.

Modified:
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/io/OpenLdapSchemaFileExporter.java

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/io/OpenLdapSchemaFileExporter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/io/OpenLdapSchemaFileExporter.java?view=diff&rev=559074&r1=559073&r2=559074
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/io/OpenLdapSchemaFileExporter.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/io/OpenLdapSchemaFileExporter.java
Tue Jul 24 08:07:08 2007
@@ -82,19 +82,22 @@
 
         // NAME(S)
         String[] names = at.getNames();
-        sb.append( "\tNAME " ); //$NON-NLS-1$
-        if ( names.length > 1 )
+        if ( ( names != null ) && ( names.length > 0 ) )
         {
-            sb.append( "( " ); //$NON-NLS-1$
-            for ( String name : names )
+            sb.append( "\tNAME " ); //$NON-NLS-1$
+            if ( names.length > 1 )
             {
-                sb.append( "'" + name + "' " ); //$NON-NLS-1$ //$NON-NLS-2$
+                sb.append( "( " ); //$NON-NLS-1$
+                for ( String name : names )
+                {
+                    sb.append( "'" + name + "' " ); //$NON-NLS-1$ //$NON-NLS-2$
+                }
+                sb.append( ") \n" ); //$NON-NLS-1$
+            }
+            else
+            {
+                sb.append( "'" + names[0] + "' \n" ); //$NON-NLS-1$ //$NON-NLS-2$
             }
-            sb.append( ") \n" ); //$NON-NLS-1$
-        }
-        else
-        {
-            sb.append( "'" + names[0] + "' \n" ); //$NON-NLS-1$ //$NON-NLS-2$
         }
 
         // DESC
@@ -209,19 +212,22 @@
 
         // NAME(S)
         String[] names = oc.getNames();
-        sb.append( "\tNAME " ); //$NON-NLS-1$
-        if ( names.length > 1 )
+        if ( ( names != null ) && ( names.length > 0 ) )
         {
-            sb.append( "( " ); //$NON-NLS-1$
-            for ( String name : names )
+            sb.append( "\tNAME " ); //$NON-NLS-1$
+            if ( names.length > 1 )
             {
-                sb.append( "'" + name + "' " ); //$NON-NLS-1$ //$NON-NLS-2$
+                sb.append( "( " ); //$NON-NLS-1$
+                for ( String name : names )
+                {
+                    sb.append( "'" + name + "' " ); //$NON-NLS-1$ //$NON-NLS-2$
+                }
+                sb.append( ") \n" ); //$NON-NLS-1$
+            }
+            else
+            {
+                sb.append( "'" + names[0] + "' \n" ); //$NON-NLS-1$ //$NON-NLS-2$
             }
-            sb.append( ") \n" ); //$NON-NLS-1$
-        }
-        else
-        {
-            sb.append( "'" + names[0] + "' \n" ); //$NON-NLS-1$ //$NON-NLS-2$
         }
 
         // DESC



Mime
View raw message