directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1071336 - /directory/studio/branches/m1/plugins/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/SubtreeSpecificationDialog.java
Date Wed, 16 Feb 2011 18:06:14 GMT
Author: elecharny
Date: Wed Feb 16 18:06:14 2011
New Revision: 1071336

URL: http://svn.apache.org/viewvc?rev=1071336&view=rev
Log:
Used the Dn.getParent() method

Modified:
    directory/studio/branches/m1/plugins/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/SubtreeSpecificationDialog.java

Modified: directory/studio/branches/m1/plugins/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/SubtreeSpecificationDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/m1/plugins/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/SubtreeSpecificationDialog.java?rev=1071336&r1=1071335&r2=1071336&view=diff
==============================================================================
--- directory/studio/branches/m1/plugins/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/SubtreeSpecificationDialog.java
(original)
+++ directory/studio/branches/m1/plugins/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/SubtreeSpecificationDialog.java
Wed Feb 16 18:06:14 2011
@@ -28,8 +28,8 @@ import java.util.Set;
 
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.ldap.model.subtree.BaseSubtreeSpecification;
-import org.apache.directory.shared.ldap.model.subtree.SubtreeSpecificationParser;
 import org.apache.directory.shared.ldap.model.subtree.SubtreeSpecification;
+import org.apache.directory.shared.ldap.model.subtree.SubtreeSpecificationParser;
 import org.apache.directory.studio.aciitemeditor.Activator;
 import org.apache.directory.studio.common.ui.widgets.BaseWidgetUtils;
 import org.apache.directory.studio.connection.core.DnUtils;
@@ -217,7 +217,7 @@ class SubtreeSpecificationDialog extends
         BaseWidgetUtils.createLabel( composite, Messages.getString( "SubtreeValueEditor.label.base"
), 1 ); //$NON-NLS-1$
 
         Dn base = subtreeSpecification.getBase();
-        Dn suffix = subentryDn != null ? DnUtils.getParent(subentryDn) : null;
+        Dn suffix = subentryDn != null ? subentryDn.getParent() : null;
         entryWidget = new EntryWidget( connection, base, suffix, useLocalName );
         entryWidget.createWidget( composite );
         entryWidget.addWidgetModifyListener( new WidgetModifyListener()
@@ -653,10 +653,14 @@ class SubtreeSpecificationDialog extends
     private void addValueExclusionsTable()
     {
         Dn chopBase = subtreeSpecification.getBase();
-        if ( useLocalName && subentryDn != null && DnUtils.getParent(subentryDn)
!= null )
+        if ( useLocalName && ( subentryDn != null ) )
         {
-            Dn suffix = subentryDn != null ? DnUtils.getParent(subentryDn) : null;
-            chopBase = DnUtils.composeDn( chopBase, suffix );
+            Dn suffix = subentryDn.getParent();
+            
+            if ( !Dn.isNullOrEmpty( suffix ) )
+            {
+                chopBase = DnUtils.composeDn( chopBase, suffix );
+            }
         }
 
         ExclusionDialog dialog = new ExclusionDialog( getShell(), connection, chopBase, ""
); //$NON-NLS-1$
@@ -681,10 +685,14 @@ class SubtreeSpecificationDialog extends
         if ( oldValue != null )
         {
             Dn chopBase = subtreeSpecification.getBase();
-            if ( useLocalName && subentryDn != null && DnUtils.getParent(subentryDn)
!= null )
+            if ( useLocalName && ( subentryDn != null ) )
             {
-                Dn suffix = subentryDn != null ? DnUtils.getParent(subentryDn) : null;
-                chopBase = DnUtils.composeDn( chopBase, suffix );
+                Dn suffix = subentryDn.getParent();
+                
+                if ( !Dn.isNullOrEmpty( suffix ) )
+                {
+                    chopBase = DnUtils.composeDn( chopBase, suffix );
+                }
             }
 
             ExclusionDialog dialog = new ExclusionDialog( getShell(), connection, chopBase,
oldValue );



Mime
View raw message