You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by st...@apache.org on 2014/06/17 15:47:53 UTC

svn commit: r1603164 - in /sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal: SlingBundleModuleFactory.java SlingContentModuleFactory.java

Author: stefanegli
Date: Tue Jun 17 13:47:53 2014
New Revision: 1603164

URL: http://svn.apache.org/r1603164
Log:
SLING-3663 : adding another potential fix : getModules was caching an empty array, which was likely due to timing issue at project-creation time. now clearing the cache when no modules are found for a project - which should not occur frequently

Modified:
    sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingBundleModuleFactory.java
    sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingContentModuleFactory.java

Modified: sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingBundleModuleFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingBundleModuleFactory.java?rev=1603164&r1=1603163&r2=1603164&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingBundleModuleFactory.java (original)
+++ sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingBundleModuleFactory.java Tue Jun 17 13:47:53 2014
@@ -50,6 +50,19 @@ public class SlingBundleModuleFactory ex
 	private static final IPath[] SETTINGS_PATHS = new IPath[] {new Path(".settings")};
     
     @Override
+    public IModule[] getModules(IProject project) {
+        final IModule[] result = super.getModules(project);
+        if (result!=null && result.length>0) {
+            return result;
+        } else {
+            // try clearing the cache
+            // might fix SLING-3663 which could be due to a synchronization issue at first access time
+            clearCache(project);
+            return super.getModules(project);
+        }
+    }
+    
+    @Override
     protected IPath[] getListenerPaths() {
     	// returning the .settings path instead of null (as done by the parent)
     	// results in clearing the cache on changes to .settings - which in turn

Modified: sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingContentModuleFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingContentModuleFactory.java?rev=1603164&r1=1603163&r2=1603164&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingContentModuleFactory.java (original)
+++ sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingContentModuleFactory.java Tue Jun 17 13:47:53 2014
@@ -30,6 +30,19 @@ public class SlingContentModuleFactory e
     static final String SLING_CONTENT_FACET_ID = "sling.content";
 	private static final IPath[] SETTINGS_PATHS = new IPath[] {new Path(".settings")};
     
+	@Override
+	public IModule[] getModules(IProject project) {
+	    final IModule[] result = super.getModules(project);
+	    if (result!=null && result.length>0) {
+	        return result;
+	    } else {
+	        // try clearing the cache
+	        // might fix SLING-3663 which could be due to a synchronization issue at first access time
+	        clearCache(project);
+	        return super.getModules(project);
+	    }
+	}
+	
     @Override
     protected IPath[] getListenerPaths() {
     	// returning the .settings path instead of null (as done by the parent)