directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r588006 - /directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/BrowserView.java
Date Wed, 24 Oct 2007 20:30:18 GMT
Author: seelmann
Date: Wed Oct 24 13:30:18 2007
New Revision: 588006

URL: http://svn.apache.org/viewvc?rev=588006&view=rev
Log:
Simplified loop.

Modified:
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/BrowserView.java

Modified: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/BrowserView.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/BrowserView.java?rev=588006&r1=588005&r2=588006&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/BrowserView.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/BrowserView.java
Wed Oct 24 13:30:18 2007
@@ -217,24 +217,23 @@
             while ( tempEntry.getParententry() != null )
             {
                 IEntry parentEntry = tempEntry.getParententry();
-                entryList.add( parentEntry );
+                entryList.add( 0, parentEntry );
                 tempEntry = parentEntry;
             }
 
-            IEntry[] parentEntries = ( IEntry[] ) entryList.toArray( new IEntry[0] );
-            for ( int i = parentEntries.length - 1; i >= 0; i-- )
+            for ( IEntry parentEntry : entryList )
             {
-                if ( !parentEntries[i].isChildrenInitialized() )
+                if ( !parentEntry.isChildrenInitialized() )
                 {
-                    parentEntries[i].setChildrenInitialized( true );
-                    parentEntries[i].setHasMoreChildren( true );
+                    parentEntry.setChildrenInitialized( true );
+                    parentEntry.setHasMoreChildren( true );
                 }
                 
                 // force refresh of each parent, beginning from the root
                 // if the entry to select was lazy initialized then the 
                 // JFace model has no knowledge about it so we must
                 // refresh the JFace model from the browser model
-                mainWidget.getViewer().refresh( parentEntries[i], true );
+                mainWidget.getViewer().refresh( parentEntry, true );
             }
 
             objectToSelect = entry;



Mime
View raw message