aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2012-04-19 14:32:31 -0700
committerTor Norbye <tnorbye@google.com>2012-04-19 14:34:28 -0700
commitb986c2cf24a2542c220f8486cc8546312da3a9fa (patch)
tree0d8058ed2d9f67d92b14ebca3c68927668763a20 /eclipse
parent1f59a8c5333ad020b391dd9d6d065a7ec51164d1 (diff)
downloadsdk-b986c2cf24a2542c220f8486cc8546312da3a9fa.zip
sdk-b986c2cf24a2542c220f8486cc8546312da3a9fa.tar.gz
sdk-b986c2cf24a2542c220f8486cc8546312da3a9fa.tar.bz2
Work around initialization bugs
This bug fixes some bugs related to resource initialization. Note that these are probably not fixing the root cause, but they are making the symptoms less severe. I happened to run into a scenario where I triggered the problem (the editor came up blank, see issue http://code.google.com/p/android/issues/detail?id=21935 for example), and I verified that reopening the editor after these fixes worked. How the resource repository came to be empty to begin with is not clear. In addition to issue 21935 this workaround may also help with issue http://code.google.com/p/android/issues/detail?id=17522 Change-Id: I0166e8c58c790888d53c46ca03348a0d8edc75b0
Diffstat (limited to 'eclipse')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ResourceManager.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ResourceManager.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ResourceManager.java
index edae923..bfa942d 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ResourceManager.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ResourceManager.java
@@ -155,7 +155,14 @@ public final class ResourceManager {
*/
public ProjectResources getProjectResources(IProject project) {
synchronized (mMap) {
- return mMap.get(project);
+ ProjectResources resources = mMap.get(project);
+
+ if (resources == null) {
+ resources = new ProjectResources(project);
+ mMap.put(project, resources);
+ }
+
+ return resources;
}
}