directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1005810 - /directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/objectclass/
Date Fri, 08 Oct 2010 13:10:41 GMT
Author: pamarcelot
Date: Fri Oct  8 13:10:41 2010
New Revision: 1005810

URL: http://svn.apache.org/viewvc?rev=1005810&view=rev
Log:
Fixed a few NPEs in the Schema Editor due to the new Schema APIs.

Modified:
    directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/objectclass/ObjectClassEditorAttributesTableContentProvider.java
    directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/objectclass/ObjectClassEditorOverviewPage.java
    directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/objectclass/ObjectClassEditorSuperiorsTableContentProvider.java

Modified: directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/objectclass/ObjectClassEditorAttributesTableContentProvider.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/objectclass/ObjectClassEditorAttributesTableContentProvider.java?rev=1005810&r1=1005809&r2=1005810&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/objectclass/ObjectClassEditorAttributesTableContentProvider.java
(original)
+++ directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/objectclass/ObjectClassEditorAttributesTableContentProvider.java
Fri Oct  8 13:10:41 2010
@@ -58,11 +58,11 @@ public class ObjectClassEditorAttributes
      */
     public Object[] getElements( Object inputElement )
     {
-        if ( inputElement instanceof String[] )
+        if ( inputElement instanceof List<?> )
         {
             List<Object> results = new ArrayList<Object>();
 
-            String[] attributes = ( String[] ) inputElement;
+            List<String> attributes = ( List<String> ) inputElement;
             for ( String attribute : attributes )
             {
                 AttributeTypeImpl at = schemaHandler.getAttributeType( attribute );

Modified: directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/objectclass/ObjectClassEditorOverviewPage.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/objectclass/ObjectClassEditorOverviewPage.java?rev=1005810&r1=1005809&r2=1005810&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/objectclass/ObjectClassEditorOverviewPage.java
(original)
+++ directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/objectclass/ObjectClassEditorOverviewPage.java
Fri Oct  8 13:10:41 2010
@@ -1152,7 +1152,10 @@ public class ObjectClassEditorOverviewPa
      */
     private void fillInSuperiorsTable()
     {
-        superiorsTableViewer.setInput( modifiedObjectClass.getSuperiorOids() );
+        if ( modifiedObjectClass.getSuperiorOids() != null )
+        {
+            superiorsTableViewer.setInput( modifiedObjectClass.getSuperiorOids() );
+        }
     }
 
 
@@ -1192,7 +1195,10 @@ public class ObjectClassEditorOverviewPa
      */
     private void fillInMandatoryAttributesTable()
     {
-        mandatoryAttributesTableViewer.setInput( modifiedObjectClass.getMustAttributeTypeOids()
);
+        if ( modifiedObjectClass.getMustAttributeTypeOids() != null )
+        {
+            mandatoryAttributesTableViewer.setInput( modifiedObjectClass.getMustAttributeTypeOids()
);
+        }
     }
 
 
@@ -1201,7 +1207,10 @@ public class ObjectClassEditorOverviewPa
      */
     private void fillInOptionalAttributesTable()
     {
-        optionalAttributesTableViewer.setInput( modifiedObjectClass.getMayAttributeTypeOids()
);
+        if ( modifiedObjectClass.getMayAttributeTypeOids() != null )
+        {
+            optionalAttributesTableViewer.setInput( modifiedObjectClass.getMayAttributeTypeOids()
);
+        }
     }
 
 

Modified: directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/objectclass/ObjectClassEditorSuperiorsTableContentProvider.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/objectclass/ObjectClassEditorSuperiorsTableContentProvider.java?rev=1005810&r1=1005809&r2=1005810&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/objectclass/ObjectClassEditorSuperiorsTableContentProvider.java
(original)
+++ directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/objectclass/ObjectClassEditorSuperiorsTableContentProvider.java
Fri Oct  8 13:10:41 2010
@@ -62,11 +62,11 @@ public class ObjectClassEditorSuperiorsT
      */
     public Object[] getElements( Object inputElement )
     {
-        if ( inputElement instanceof String[] )
+        if ( inputElement instanceof List<?> )
         {
             List<Object> results = new ArrayList<Object>();
 
-            String[] superiors = ( String[] ) inputElement;
+            List<String> superiors = ( List<String> ) inputElement;
             for ( String superior : superiors )
             {
                 ObjectClassImpl oc = schemaHandler.getObjectClass( superior );



Mime
View raw message