directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1747922 - in /directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/entryeditors: EntryEditorManager.java EntryEditorUtils.java
Date Sat, 11 Jun 2016 18:02:12 GMT
Author: seelmann
Date: Sat Jun 11 18:02:12 2016
New Revision: 1747922

URL: http://svn.apache.org/viewvc?rev=1747922&view=rev
Log:
Fix for DIRSTUDIO-1100: Wait for attribute initialization to avoid race condition

Modified:
    directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorManager.java
    directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorUtils.java

Modified: directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorManager.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorManager.java?rev=1747922&r1=1747921&r2=1747922&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorManager.java
(original)
+++ directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorManager.java
Sat Jun 11 18:02:12 2016
@@ -793,8 +793,8 @@ public class EntryEditorManager
         
         if ( referenceCopy != null )
         {
-            EntryEditorUtils.ensureAttributesInitialized( entry );
             EventRegistry.suspendEventFiringInCurrentThread();
+            EntryEditorUtils.ensureAttributesInitialized( entry );
             new CompoundModification().replaceAttributes( entry, referenceCopy, this );
             EventRegistry.resumeEventFiringInCurrentThread();
             oscSharedReferenceCopies.put( entry, referenceCopy );
@@ -816,9 +816,9 @@ public class EntryEditorManager
 
     private void updateAutoSaveSharedReferenceCopy( IEntry entry )
     {
+        EventRegistry.suspendEventFiringInCurrentThread();
         EntryEditorUtils.ensureAttributesInitialized( entry );
         IEntry workingCopy = autoSaveSharedReferenceCopies.get( entry );
-        EventRegistry.suspendEventFiringInCurrentThread();
         new CompoundModification().replaceAttributes( entry, workingCopy, this );
         EventRegistry.resumeEventFiringInCurrentThread();
     }

Modified: directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorUtils.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorUtils.java?rev=1747922&r1=1747921&r2=1747922&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorUtils.java
(original)
+++ directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorUtils.java
Sat Jun 11 18:02:12 2016
@@ -21,8 +21,8 @@
 package org.apache.directory.studio.entryeditors;
 
 
+import org.apache.directory.studio.connection.ui.RunnableContextRunner;
 import org.apache.directory.studio.ldapbrowser.core.jobs.InitializeAttributesRunnable;
-import org.apache.directory.studio.ldapbrowser.core.jobs.StudioBrowserJob;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.IRootDSE;
 import org.eclipse.core.runtime.IStatus;
@@ -45,17 +45,13 @@ public class EntryEditorUtils
      *      the job associated with the attributes initialization, 
      *      or <code>null</code> if the attributes were already initialized
      */
-    public static StudioBrowserJob ensureAttributesInitialized( IEntry entry )
+    public static void ensureAttributesInitialized( IEntry entry )
     {
         if ( !entry.isAttributesInitialized() )
         {
             InitializeAttributesRunnable runnable = new InitializeAttributesRunnable( entry
);
-            StudioBrowserJob job = new StudioBrowserJob( runnable );
-            job.execute();
-            return job;
+            RunnableContextRunner.execute( runnable, null, true );
         }
-
-        return null;
     }
 
 



Mime
View raw message