directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r559498 - in /directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/editors: attributetype/AttributeTypeEditorOverviewPage.java objectclass/ObjectClassEditorOverviewPage.java
Date Wed, 25 Jul 2007 15:50:58 GMT
Author: pamarcelot
Date: Wed Jul 25 08:50:57 2007
New Revision: 559498

URL: http://svn.apache.org/viewvc?view=rev&rev=559498
Log:
Fixed potential NPE when using the first alias of an AT/OC.

Modified:
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/editors/attributetype/AttributeTypeEditorOverviewPage.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/editors/objectclass/ObjectClassEditorOverviewPage.java

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/editors/attributetype/AttributeTypeEditorOverviewPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/editors/attributetype/AttributeTypeEditorOverviewPage.java?view=diff&rev=559498&r1=559497&r2=559498
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/editors/attributetype/AttributeTypeEditorOverviewPage.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/editors/attributetype/AttributeTypeEditorOverviewPage.java
Wed Jul 25 08:50:57 2007
@@ -381,7 +381,16 @@
 
             if ( selectedItem instanceof AttributeTypeImpl )
             {
-                modifiedAttributeType.setSuperiorName( ( ( AttributeTypeImpl ) selectedItem
).getNames()[0] );
+                AttributeTypeImpl at = ( AttributeTypeImpl ) selectedItem;
+                String[] names = at.getNames();
+                if ( ( names != null ) && ( names.length > 0 ) )
+                {
+                    modifiedAttributeType.setSuperiorName( names[0] );
+                }
+                else
+                {
+                    modifiedAttributeType.setSuperiorName( at.getOid() );
+                }
             }
             else if ( selectedItem instanceof NonExistingAttributeType )
             {

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/editors/objectclass/ObjectClassEditorOverviewPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/editors/objectclass/ObjectClassEditorOverviewPage.java?view=diff&rev=559498&r1=559497&r2=559498
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/editors/objectclass/ObjectClassEditorOverviewPage.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/editors/objectclass/ObjectClassEditorOverviewPage.java
Wed Jul 25 08:50:57 2007
@@ -480,7 +480,15 @@
                     newMusts.add( must );
                 }
             }
-            newMusts.add( at.getNames()[0] );
+            String[] names = at.getNames();
+            if ( ( names != null ) && ( names.length > 0 ) )
+            {
+                newMusts.add( names[0] );
+            }
+            else
+            {
+                newMusts.add( at.getOid() );
+            }
             modifiedObjectClass.setMustNamesList( newMusts.toArray( new String[0] ) );
 
             fillInMandatoryAttributesTable();
@@ -621,7 +629,15 @@
                     newMays.add( may );
                 }
             }
-            newMays.add( at.getNames()[0] );
+            String[] names = at.getNames();
+            if ( ( names != null ) && ( names.length > 0 ) )
+            {
+                newMays.add( names[0] );
+            }
+            else
+            {
+                newMays.add( at.getOid() );
+            }
             modifiedObjectClass.setMayNamesList( newMays.toArray( new String[0] ) );
 
             fillInOptionalAttributesTable();
@@ -744,7 +760,15 @@
             {
                 superiors.add( sup );
             }
-            superiors.add( oc.getNames()[0] );
+            String[] names = oc.getNames();
+            if ( ( names != null ) && ( names.length > 0 ) )
+            {
+                superiors.add( names[0] );
+            }
+            else
+            {
+                superiors.add( oc.getOid() );
+            }
             modifiedObjectClass.setSuperClassesNames( superiors.toArray( new String[0] )
);
 
             fillInSuperiorsTable();



Mime
View raw message