clean up
authorEugene Kudelevsky <Eugene.Kudelevsky@jetbrains.com>
Sun, 29 Jan 2012 15:47:34 +0000 (19:47 +0400)
committerEugene Kudelevsky <Eugene.Kudelevsky@jetbrains.com>
Sun, 29 Jan 2012 16:17:27 +0000 (20:17 +0400)
plugins/android/src/org/jetbrains/android/dom/converters/ResourceReferenceConverter.java

index 116d1f5bc56c6dca5f23a7c8bc0531bb6121e817..4708b8ccaa99e9a528cfb609c8973861437b40f2 100644 (file)
@@ -134,13 +134,13 @@ public class ResourceReferenceConverter extends ResolvingConverter<ResourceValue
       if (recommendedTypes.size() == 1) {
         String type = recommendedTypes.iterator().next();
         boolean explicitResourceType = value.startsWith(getTypePrefix(resourcePackage, type)) || myWithExplicitResourceType;
-        addResourceReferenceValuesWithDeps(facet, type, resourcePackage, result, explicitResourceType);
+        addResourceReferenceValues(facet, type, resourcePackage, result, explicitResourceType);
       }
       else {
         for (String type : ResourceManager.REFERABLE_RESOURCE_TYPES) {
           String typePrefix = getTypePrefix(resourcePackage, type);
           if (value.startsWith(typePrefix)) {
-            addResourceReferenceValuesWithDeps(facet, type, resourcePackage, result, true);
+            addResourceReferenceValues(facet, type, resourcePackage, result, true);
           }
           else if (recommendedTypes.contains(type)) {
             result.add(ResourceValue.literal(typePrefix));
@@ -182,20 +182,6 @@ public class ResourceReferenceConverter extends ResolvingConverter<ResourceValue
     return types;
   }
 
-  private void addResourceReferenceValuesWithDeps(@NotNull AndroidFacet facet,
-                                                  @NotNull String type,
-                                                  @Nullable String resPackage,
-                                                  @NotNull Collection<ResourceValue> result,
-                                                  boolean explicitResourceType) {
-    addResourceReferenceValues(facet, type, resPackage, result, explicitResourceType);
-    /*for (Module depModule : ModuleRootManager.getInstance(facet.getModule()).getDependencies()) {
-      AndroidFacet depFacet = AndroidFacet.getInstance(depModule);
-      if (depFacet != null) {
-        addResourceReferenceValues(depFacet, type, resPackage, result, explicitResourceType);
-      }
-    }*/
-  }
-
   private void addResourceReferenceValues(AndroidFacet facet,
                                           String type,
                                           String resPackage,
@@ -310,7 +296,7 @@ public class ResourceReferenceConverter extends ResolvingConverter<ResourceValue
           }
           List<PsiElement> elements = new ArrayList<PsiElement>();
           List<PsiFile> files = new ArrayList<PsiFile>();
-          collectTargetsWithDependencies(facet, resValue, elements, files);
+          collectTargets(facet, resValue, elements, files);
           if (files.size() > 0) {
             return new PsiReference[]{new FileResourceReference(value, files)};
           }
@@ -321,19 +307,6 @@ public class ResourceReferenceConverter extends ResolvingConverter<ResourceValue
     return PsiReference.EMPTY_ARRAY;
   }
 
-  private static void collectTargetsWithDependencies(AndroidFacet facet,
-                                                     ResourceValue resValue,
-                                                     List<PsiElement> elements,
-                                                     List<PsiFile> files) {
-    collectTargets(facet, resValue, elements, files);
-    /*for (Module depModule : ModuleRootManager.getInstance(facet.getModule()).getDependencies()) {
-      AndroidFacet depFacet = AndroidFacet.getInstance(depModule);
-      if (depFacet != null) {
-        collectTargets(depFacet, resValue, elements, files);
-      }
-    }*/
-  }
-
   private static void collectTargets(AndroidFacet facet, ResourceValue resValue, List<PsiElement> elements, List<PsiFile> files) {
     String resType = resValue.getResourceType();
     if (resType == null) {