directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1071347 - /directory/studio/branches/m1/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryDnWizardPage.java
Date Wed, 16 Feb 2011 18:10:47 GMT
Author: elecharny
Date: Wed Feb 16 18:10:47 2011
New Revision: 1071347

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

Modified:
    directory/studio/branches/m1/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryDnWizardPage.java

Modified: directory/studio/branches/m1/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryDnWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/m1/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryDnWizardPage.java?rev=1071347&r1=1071346&r2=1071347&view=diff
==============================================================================
--- directory/studio/branches/m1/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryDnWizardPage.java
(original)
+++ directory/studio/branches/m1/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryDnWizardPage.java
Wed Feb 16 18:10:47 2011
@@ -183,20 +183,13 @@ public class NewEntryDnWizardPage extend
             Collection<AttributeType> atds = SchemaUtils.getAllAttributeTypeDescriptions(
newEntry );
             String[] attributeNames = SchemaUtils.getNames( atds ).toArray( ArrayUtils.EMPTY_STRING_ARRAY
);
 
-            Dn parentDn = null;
-            if ( wizard.getSelectedEntry() != null && newEntry.getDn().equals( wizard.getSelectedEntry().getDn()
)
-                && DnUtils.getParent( newEntry.getDn() ) != null )
-            {
-                parentDn = DnUtils.getParent( newEntry.getDn() );
-            }
-            else if ( wizard.getSelectedEntry() != null )
+            Dn parentDn = newEntry.getDn().getParent();
+            
+            if ( wizard.getSelectedEntry() != null && !Dn.isNullOrEmpty( parentDn
) 
+                && ( !newEntry.getDn().equals( wizard.getSelectedEntry().getDn()
) ) )
             {
                 parentDn = wizard.getSelectedEntry().getDn();
             }
-            else if ( DnUtils.getParent( newEntry.getDn() ) != null )
-            {
-                parentDn = DnUtils.getParent( newEntry.getDn() );
-            }
 
             Rdn rdn = newEntry.getRdn();
 



Mime
View raw message