replace with emptyList()
authorAlexey Kudravtsev <cdr@intellij.com>
Fri, 2 Jul 2010 09:58:52 +0000 (13:58 +0400)
committerAlexey Kudravtsev <cdr@intellij.com>
Fri, 2 Jul 2010 10:23:03 +0000 (14:23 +0400)
37 files changed:
platform/lang-impl/src/com/intellij/codeInsight/navigation/GotoImplementationHandler.java
platform/lang-impl/src/com/intellij/semantic/SemServiceImpl.java
platform/lvcs-impl/src/com/intellij/history/integration/ui/views/RevisionsList.java
platform/platform-impl/src/com/intellij/openapi/command/impl/UndoRedo.java
platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsEditorContext.java
platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsTree.java
platform/util/testSrc/com/intellij/util/containers/ContainerUtilTest.java
plugins/InspectionGadgets/src/com/siyeh/ig/naming/ConventionInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/psiutils/WeakestTypeFinder.java
plugins/InspectionGadgets/test/com/siyeh/igtest/encapsulation/ReturnOfCollectionFieldInspection.java
plugins/IntentionPowerPak/src/com/siyeh/ipp/psiutils/VariableAccessUtils.java
plugins/cvs/javacvs-src/org/netbeans/lib/cvsclient/command/FileSystemScanner.java
plugins/cvs/smartcvs-src/org/netbeans/lib/cvsclient/admin/AdminReader.java
plugins/maven/facade-impl/src/org/jetbrains/idea/maven/facade/embedder/MavenModelConverter.java
plugins/maven/facade-impl/test/org/jetbrains/idea/maven/embedder/MavenFacadeEmbedderTest.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/navigator/MavenProjectsNavigator.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProjectsManager.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProjectsTree.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/project/actions/OpenOrCreateSettingsXmlAction.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/wizards/MavenProjectBuilder.java
plugins/maven/src/test/java/org/jetbrains/idea/maven/importing/MavenPerformanceTest.java
plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenIndicesManagerTest.java
plugins/maven/src/test/java/org/jetbrains/idea/maven/navigator/MavenProjectsNavigatorTest.java
plugins/maven/src/test/java/org/jetbrains/idea/maven/project/MavenProjectReaderTest.java
plugins/maven/src/test/java/org/jetbrains/idea/maven/project/MavenProjectsTreeIgnoresTest.java
plugins/svn4idea/src/org/jetbrains/idea/svn/config/SvnConfigureProxiesComponent.java
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/refactoring/introduceParameter/IntroduceParameterProcessor.java
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/util/ParamMatcher.java
plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/HistoryElement.java
plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/search/FindByXPathAction.java
plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/support/jaxen/PsiDocumentNavigator.java
plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/support/jaxen/extensions/XPathFunctionProviderImpl.java
plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/ui/InputExpressionDialog.java
plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/util/HighlighterUtil.java
plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/util/NamespaceCollector.java
xml/dom-impl/src/com/intellij/util/xml/impl/DynamicGenericInfo.java
xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateInstanceDocumentFromSchemaDialog.java

index e00854b7f2456ccc2c4197acb77974dc3c3e0668..07ef55c7dc842965041efc666e2227848913b6ac 100644 (file)
@@ -36,7 +36,8 @@ public class GotoImplementationHandler extends GotoTargetHandler {
     int offset = editor.getCaretModel().getOffset();
     PsiElement source = TargetElementUtilBase.getInstance().findTargetElement(editor, ImplementationSearcher.getFlags(), offset);
     if (source == null) return null;
-    return new GotoData(source, new ImplementationSearcher().searchImplementations(editor, source, offset), Collections.EMPTY_LIST);
+    return new GotoData(source, new ImplementationSearcher().searchImplementations(editor, source, offset),
+                        Collections.<AdditionalAction>emptyList());
   }
 
   protected String getChooserTitle(PsiElement sourceElement, String name, int length) {
index 7049f1e729fbdca9457b285c2806a9ba74c5fb14..547401aeb10d444007eb0db386cd15a3e445c24d 100644 (file)
@@ -215,7 +215,7 @@ public class SemServiceImpl extends SemService{
         return null;
       }
 
-      if (cached != null && cached != Collections.EMPTY_LIST) {
+      if (cached != null && cached != Collections.<T>emptyList()) {
         if (singleList == null) {
           singleList = cached;
           continue;
index c5aa247bfcbc36f1267e093e6887802fdef8aa66..e1942a8c28cdf19d17cfc1e0ada15063ac5c7b38 100644 (file)
@@ -50,7 +50,7 @@ public class RevisionsList {
 
   public RevisionsList(SelectionListener l) {
     table = new JBTable();
-    table.setModel(new MyModel(Collections.EMPTY_LIST, Collections.EMPTY_MAP));
+    table.setModel(new MyModel(Collections.<RevisionItem>emptyList(), Collections.<RevisionItem, Period>emptyMap()));
 
     table.setTableHeader(null);
     table.setShowGrid(false);
index 3ecf06dfcd4f1f9981d3e4f158a5ea2387b1633e..c265c4b2e94ac3db4244cda9424443742c3c6cac 100644 (file)
@@ -71,7 +71,7 @@ abstract class UndoRedo {
   }
 
   private Set<DocumentReference> getDecRefs() {
-    return myEditor == null ? Collections.EMPTY_SET : myManager.getDocumentReferences(myEditor);
+    return myEditor == null ? Collections.<DocumentReference>emptySet() : UndoManagerImpl.getDocumentReferences(myEditor);
   }
 
   protected abstract UndoRedoStacksHolder getStackHolder();
@@ -217,4 +217,4 @@ abstract class UndoRedo {
     myEditor.setState(pair.getState());
     return true;
   }
-}
\ No newline at end of file
+}
index 323c8952a4ca311d9540d5be1c1bf010e7ad2e5c..d6f85b3c6fd1b789f0addac35958dde9333417ab 100644 (file)
@@ -142,7 +142,7 @@ public class OptionsEditorContext {
 
   public Collection<Configurable> getChildren(final Configurable parent) {
     Collection<Configurable> result = myParentToChildrenMap.get(parent);
-    return result == null ? Collections.EMPTY_SET : result;
+    return result == null ? Collections.<Configurable>emptySet() : result;
   }
 
   interface ColleagueAction {
index 36b30d025a662501927aa398a3e2106a01e37d30..8741204fcec7e4774eebe32a7ece5c1fec7caba2 100644 (file)
@@ -490,7 +490,7 @@ public class OptionsTree extends JPanel implements Disposable, OptionsEditorColl
       return result; // TODO: DECIDE IF INNERS SHOULD BE SORTED: sort(result);
     }
     else {
-      return Collections.EMPTY_LIST;
+      return Collections.emptyList();
     }
   }
 
index 29cdef3c8cc0e08cecfee1e886e31ea81d41cb5f..d207334cf58c7a7edca278386f06f7065611df37 100644 (file)
@@ -20,23 +20,20 @@ import com.intellij.openapi.util.Condition;
 
 import java.util.*;
 
-import static org.junit.Assert.assertEquals;
-
 public class ContainerUtilTest extends junit.framework.TestCase {
   public void testFindInstanceOf() {
-    Iterator<Object> iterator = Arrays.asList(new Object[]{new Integer(1), new ArrayList(), "1"}).iterator();
-    String string = (String)com.intellij.util.containers.ContainerUtil
-      .find(iterator, com.intellij.util.containers.FilteringIterator.instanceOf(String.class));
+    Iterator<Object> iterator = Arrays.<Object>asList(new Integer(1), new ArrayList(), "1").iterator();
+    String string = (String)ContainerUtil.find(iterator, FilteringIterator.instanceOf(String.class));
     junit.framework.Assert.assertEquals("1", string);
   }
 
   public void testConcatMulti() {
-    List l = ContainerUtil.concat(Arrays.asList(1, 2), Collections.EMPTY_LIST, Arrays.asList(3, 4));
+    List<Integer> l = ContainerUtil.concat(Arrays.asList(1, 2), Collections.EMPTY_LIST, Arrays.asList(3, 4));
     assertEquals(4, l.size());
-    assertEquals(1, l.get(0));
-    assertEquals(2, l.get(1));
-    assertEquals(3, l.get(2));
-    assertEquals(4, l.get(3));
+    assertEquals(1, (int)l.get(0));
+    assertEquals(2, (int)l.get(1));
+    assertEquals(3, (int)l.get(2));
+    assertEquals(4, (int)l.get(3));
 
     try {
       l.get(-1);
@@ -66,7 +63,7 @@ public class ContainerUtilTest extends junit.framework.TestCase {
     asserIterating(Arrays.asList(4), cond, 4);
   }
 
-  private void asserIterating(List<Integer> collection, Condition<Integer> condition, Integer... expected) {
+  private static void asserIterating(List<Integer> collection, Condition<Integer> condition, Integer... expected) {
     Iterable<Integer> it = ContainerUtil.iterate(collection, condition);
     List<Integer> actual = new ArrayList<Integer>();
     for (Integer each : it) {
index 03ee14449d0063ec76e58b23a047a4e53d8f6e8c..663e1a823236d4339c4776b09215d72197460e28 100644 (file)
@@ -95,7 +95,7 @@ public abstract class ConventionInspection extends BaseInspection {
     private static final int REGEX_COLUMN_COUNT = 25;
 
     public Collection<? extends JComponent> createExtraOptions() {
-        return Collections.EMPTY_LIST;
+        return Collections.emptyList();
     }
 
     @Override
@@ -221,4 +221,4 @@ public abstract class ConventionInspection extends BaseInspection {
 
         return panel;
     }
-}
\ No newline at end of file
+}
index 09d6147ecf0b4387d7f1a8eebf35525090019fb2..280e6c5545c2f5cacdf723bee84621b66d1625e5 100644 (file)
@@ -47,7 +47,7 @@ public class WeakestTypeFinder {
             final PsiMethod method = (PsiMethod) variableOrMethod;
             variableOrMethodType = method.getReturnType();
             if (PsiType.VOID.equals(variableOrMethodType)) {
-                return Collections.EMPTY_LIST;
+                return Collections.emptyList();
             }
         } else {
             throw new IllegalArgumentException(
@@ -55,14 +55,14 @@ public class WeakestTypeFinder {
                             variableOrMethod);
         }
         if (!(variableOrMethodType instanceof PsiClassType)) {
-            return Collections.EMPTY_LIST;
+            return Collections.emptyList();
         }
         final PsiClassType variableOrMethodClassType =
                 (PsiClassType) variableOrMethodType;
         final PsiClass variableOrMethodClass =
                 variableOrMethodClassType.resolve();
         if (variableOrMethodClass == null) {
-            return Collections.EMPTY_LIST;
+            return Collections.emptyList();
         }
         final PsiManager manager = variableOrMethod.getManager();
         final GlobalSearchScope scope = variableOrMethod.getResolveScope();
@@ -72,7 +72,7 @@ public class WeakestTypeFinder {
                 facade.findClass("java.lang.Object", scope);
         if (javaLangObjectClass == null ||
                 variableOrMethodClass.equals(javaLangObjectClass)) {
-            return Collections.EMPTY_LIST;
+            return Collections.emptyList();
         }
         Set<PsiClass> weakestTypeClasses = new HashSet();
         weakestTypeClasses.add(javaLangObjectClass);
@@ -95,21 +95,21 @@ public class WeakestTypeFinder {
             if (referenceParent instanceof PsiExpressionList) {
                 if (!(referenceGrandParent instanceof
                         PsiMethodCallExpression)) {
-                    return Collections.EMPTY_LIST;
+                    return Collections.emptyList();
                 }
                 final PsiMethodCallExpression methodCallExpression =
                         (PsiMethodCallExpression) referenceGrandParent;
                 if (!findWeakestType(referenceElement, methodCallExpression,
                         useParameterizedTypeForCollectionMethods,
                         weakestTypeClasses)) {
-                    return Collections.EMPTY_LIST;
+                    return Collections.emptyList();
                 }
             } else if (referenceGrandParent
                     instanceof PsiMethodCallExpression) {
                 final PsiMethodCallExpression methodCallExpression =
                         (PsiMethodCallExpression) referenceGrandParent;
                 if (!findWeakestType(methodCallExpression, weakestTypeClasses)) {
-                    return Collections.EMPTY_LIST;
+                    return Collections.emptyList();
                 }
             } else if (referenceParent instanceof PsiAssignmentExpression) {
                 final PsiAssignmentExpression assignmentExpression =
@@ -117,24 +117,24 @@ public class WeakestTypeFinder {
                 if (!findWeakestType(referenceElement, assignmentExpression,
                         useRighthandTypeAsWeakestTypeInAssignments,
                         weakestTypeClasses)) {
-                    return Collections.EMPTY_LIST;
+                    return Collections.emptyList();
                 }
             } else if (referenceParent instanceof PsiVariable) {
                 final PsiVariable variable = (PsiVariable)referenceParent;
                 final PsiType type = variable.getType();
                 if (!checkType(type, weakestTypeClasses)) {
-                    return Collections.EMPTY_LIST;
+                    return Collections.emptyList();
                 }
             } else if (referenceParent instanceof PsiForeachStatement) {
                 final PsiForeachStatement foreachStatement =
                         (PsiForeachStatement)referenceParent;
                 if (foreachStatement.getIteratedValue() != referenceElement) {
-                    return Collections.EMPTY_LIST;
+                    return Collections.emptyList();
                 }
                 final PsiClass javaLangIterableClass =
                         facade.findClass("java.lang.Iterable", scope);
                 if (javaLangIterableClass == null) {
-                    return Collections.EMPTY_LIST;
+                    return Collections.emptyList();
                 }
                 checkClass(javaLangIterableClass, weakestTypeClasses);
             } else if (referenceParent instanceof PsiReturnStatement) {
@@ -142,11 +142,11 @@ public class WeakestTypeFinder {
                         PsiTreeUtil.getParentOfType(referenceParent,
                                 PsiMethod.class);
                 if (containingMethod == null) {
-                    return Collections.EMPTY_LIST;
+                    return Collections.emptyList();
                 }
                 final PsiType type = containingMethod.getReturnType();
                 if (!checkType(type, weakestTypeClasses)) {
-                    return Collections.EMPTY_LIST;
+                    return Collections.emptyList();
                 }
             } else if (referenceParent instanceof PsiReferenceExpression) {
                 // field access, method call is handled above.
@@ -154,7 +154,7 @@ public class WeakestTypeFinder {
                         (PsiReferenceExpression)referenceParent;
                 final PsiElement target = referenceExpression.resolve();
                 if (!(target instanceof PsiField)) {
-                    return Collections.EMPTY_LIST;
+                    return Collections.emptyList();
                 }
                 final PsiField field = (PsiField)target;
                 final PsiClass containingClass = field.getContainingClass();
@@ -164,14 +164,14 @@ public class WeakestTypeFinder {
                         (PsiArrayInitializerExpression)referenceParent;
                 if (!findWeakestType(arrayInitializerExpression,
                         weakestTypeClasses)) {
-                    return Collections.EMPTY_LIST;
+                    return Collections.emptyList();
                 }
             } else if (referenceParent instanceof PsiThrowStatement) {
                 final PsiThrowStatement throwStatement =
                         (PsiThrowStatement)referenceParent;
                 if (!findWeakestType(throwStatement, variableOrMethodClass,
                         weakestTypeClasses)) {
-                    return Collections.EMPTY_LIST;
+                    return Collections.emptyList();
                 }
             } else if (referenceParent instanceof PsiConditionalExpression) {
                 final PsiConditionalExpression conditionalExpression =
@@ -179,12 +179,12 @@ public class WeakestTypeFinder {
                 final PsiExpression condition =
                         conditionalExpression.getCondition();
                 if (referenceElement.equals(condition)) {
-                    return Collections.EMPTY_LIST;
+                    return Collections.emptyList();
                 }
                 final PsiType type = ExpectedTypeUtils.findExpectedType(
                         conditionalExpression, true);
                 if (!checkType(type, weakestTypeClasses)) {
-                    return Collections.EMPTY_LIST;
+                    return Collections.emptyList();
                 }
             } else if (referenceParent instanceof PsiBinaryExpression) {
                 // strings only
@@ -193,28 +193,28 @@ public class WeakestTypeFinder {
                 final PsiType type = binaryExpression.getType();
                 if (variableOrMethodType.equals(type)) {
                     if (!checkType(type, weakestTypeClasses)) {
-                        return Collections.EMPTY_LIST;
+                        return Collections.emptyList();
                     }
                 }
             } else if (referenceParent instanceof PsiSwitchStatement) {
                 // only enums and primitives can be a switch expression
-                return Collections.EMPTY_LIST;
+                return Collections.emptyList();
             } else if (referenceParent instanceof PsiPrefixExpression) {
                 // only primitives and boxed types are the target of a prefix
                 // expression
-                return Collections.EMPTY_LIST;
+                return Collections.emptyList();
             } else if (referenceParent instanceof PsiPostfixExpression) {
                 // only primitives and boxed types are the target of a postfix
                 // expression
-                return Collections.EMPTY_LIST;
+                return Collections.emptyList();
             } else if (referenceParent instanceof PsiIfStatement) {
                 // only booleans and boxed Booleans are the condition of an if
                 // statement
-                return Collections.EMPTY_LIST;
+                return Collections.emptyList();
             } else if (referenceParent instanceof PsiForStatement) {
                 // only booleans and boxed Booleans are the condition of an
                 // for statement
-                return Collections.EMPTY_LIST;
+                return Collections.emptyList();
             } else if (referenceParent instanceof PsiNewExpression) {
                 final PsiNewExpression newExpression =
                         (PsiNewExpression)referenceParent;
@@ -222,12 +222,12 @@ public class WeakestTypeFinder {
                 if (qualifier != null) {
                     final PsiType type = newExpression.getType();
                     if (!(type instanceof PsiClassType)) {
-                        return Collections.EMPTY_LIST;
+                        return Collections.emptyList();
                     }
                     final PsiClassType classType = (PsiClassType)type;
                     final PsiClass innerClass = classType.resolve();
                     if (innerClass == null) {
-                        return Collections.EMPTY_LIST;
+                        return Collections.emptyList();
                     }
                     final PsiClass outerClass =
                             innerClass.getContainingClass();
@@ -238,11 +238,11 @@ public class WeakestTypeFinder {
             }
             if (weakestTypeClasses.contains(variableOrMethodClass) ||
                     weakestTypeClasses.isEmpty()) {
-                return Collections.EMPTY_LIST;
+                return Collections.emptyList();
             }
         }
         if (!hasUsages) {
-            return Collections.EMPTY_LIST;
+            return Collections.emptyList();
         }
         weakestTypeClasses =
                 filterAccessibleClasses(weakestTypeClasses, variableOrMethod);
index 9927094ca540f3e034bf58185ef711d1c4b3ebe8..887cf780892b7935c567f4a032b74d125d88b51b 100644 (file)
@@ -30,7 +30,7 @@ public class ReturnOfCollectionFieldInspection
 
     public List<String> fooBarEmpty()
     {
-        return Collections.EMPTY_LIST;
+        return Collections.emptyList();
     }
 
     public int[] bar()
@@ -39,4 +39,4 @@ public class ReturnOfCollectionFieldInspection
     }
 
 
-}
\ No newline at end of file
+}
index 6ccc4aaf0eac8b719c00fe63ab961f994f2e3465..a169b5b30ccbd04fbf4597bb375dd47198b64703 100644 (file)
@@ -158,7 +158,7 @@ public class VariableAccessUtils {
     public static Set<PsiVariable> collectUsedVariables(
             PsiElement context) {
         if (context == null) {
-            return Collections.EMPTY_SET;
+            return Collections.emptySet();
         }
         final VariableCollectingVisitor visitor =
                 new VariableCollectingVisitor();
@@ -187,4 +187,4 @@ public class VariableAccessUtils {
             return usedVariables;
         }
     }
-}
\ No newline at end of file
+}
index 748c98ad188a5a25915c782806d487ac7dfce975..df3e9067db9ccb2206fe8185ab36eb7b286f93c2 100644 (file)
@@ -83,7 +83,7 @@ final class FileSystemScanner {
 
   private List<DirectoryObject> scanDirectory(DirectoryObject directoryObject, CvsFiles cvsFiles) throws IOException {
     if (!clientEnvironment.getLocalFileReader().exists(directoryObject, clientEnvironment.getCvsFileSystem())) {
-      return Collections.EMPTY_LIST;
+      return Collections.emptyList();
     }
 
     cvsFiles.add(CvsFile.createCvsDirectory(directoryObject));
index 8ab3e19ce350a842c8926c9c3e5af082d167c584..cf255569ca1f1e90c34000824a272f4f2bee22d4 100644 (file)
@@ -76,7 +76,7 @@ public final class AdminReader
                        return entriesHandler.getEntries().getEntries();
                }
                catch (FileNotFoundException ex) {
-                       return Collections.EMPTY_SET;
+                       return Collections.emptySet();
                }
        }
 
index 08e033a4ec5d2ac50a8d777101b34745bfee15b2..20cbe56e66afe6a882b56c440685fc1e92e5eeda 100644 (file)
@@ -121,7 +121,7 @@ public class MavenModelConverter {
   }
 
   private static List<String> ensurePatterns(List<String> patterns) {
-    return patterns == null ? Collections.EMPTY_LIST : patterns;
+    return patterns == null ? Collections.<String>emptyList() : patterns;
   }
 
   private static List<MavenRemoteRepository> convertRepositories(List<Repository> repositories) {
@@ -282,7 +282,7 @@ public class MavenModelConverter {
   }
 
   private static Element xppToElement(Xpp3Dom xpp) {
-    Element result = null;
+    Element result;
     try {
       result = new Element(xpp.getName());
     }
index 7163d401f576eec6d67883b32193270dc5ced125..80c44ffdb4733e2cf58edae7a00973ddc6ede8f5 100644 (file)
@@ -83,7 +83,7 @@ public class MavenFacadeEmbedderTest extends MavenImportingTestCase {
                      "<version>1</version>");
 
     myEmbedder.customizeForResolve(new SoutMavenConsole(), EMPTY_MAVEN_PROCESS);
-    MavenWrapperExecutionResult result = myEmbedder.execute(myProjectPom, Collections.EMPTY_LIST, Arrays.asList("compile"));
+    MavenWrapperExecutionResult result = myEmbedder.execute(myProjectPom, Collections.<String>emptyList(), Arrays.asList("compile"));
 
     assertNotNull(result.projectData);
     assertNotNull(new File(getProjectPath(), "target").exists());
@@ -108,7 +108,7 @@ public class MavenFacadeEmbedderTest extends MavenImportingTestCase {
                      "</dependencies>");
 
     myEmbedder.customizeForResolve(new SoutMavenConsole(), EMPTY_MAVEN_PROCESS);
-    MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.EMPTY_LIST);
+    MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.<String>emptyList());
     assertNotNull(result.projectData);
     assertOrderedElementsAreEqual(result.unresolvedArtifacts);
 
@@ -124,7 +124,7 @@ public class MavenFacadeEmbedderTest extends MavenImportingTestCase {
                      "<version>1</version>");
 
     myEmbedder.customizeForResolve(new SoutMavenConsole(), EMPTY_MAVEN_PROCESS);
-    MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.EMPTY_LIST);
+    MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.<String>emptyList());
 
     MavenModel project = result.projectData.mavenModel;
     assertNotNull(project);
@@ -160,7 +160,7 @@ public class MavenFacadeEmbedderTest extends MavenImportingTestCase {
                      "</build>");
 
     myEmbedder.customizeForResolve(new SoutMavenConsole(), EMPTY_MAVEN_PROCESS);
-    MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.EMPTY_LIST);
+    MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.<String>emptyList());
 
     assertNotNull(result.projectData);
     assertOrderedElementsAreEqual(result.unresolvedArtifacts);
@@ -192,7 +192,7 @@ public class MavenFacadeEmbedderTest extends MavenImportingTestCase {
                      "</dependencies>");
 
     myEmbedder.customizeForResolve(new SoutMavenConsole(), EMPTY_MAVEN_PROCESS);
-    MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.EMPTY_LIST);
+    MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.<String>emptyList());
 
     assertNotNull(result.projectData);
     assertOrderedElementsAreEqual(result.unresolvedArtifacts);
@@ -245,7 +245,7 @@ public class MavenFacadeEmbedderTest extends MavenImportingTestCase {
                      "</dependencies>");
 
     myEmbedder.customizeForResolve(new SoutMavenConsole(), EMPTY_MAVEN_PROCESS);
-    MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.EMPTY_LIST);
+    MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.<String>emptyList());
 
     assertNotNull(result.projectData);
     assertOrderedElementsAreEqual(result.unresolvedArtifacts, new MavenId("fff", "zzz", "666"));
@@ -267,7 +267,7 @@ public class MavenFacadeEmbedderTest extends MavenImportingTestCase {
                      "</dependencies>");
 
     myEmbedder.customizeForResolve(new SoutMavenConsole(), EMPTY_MAVEN_PROCESS);
-    MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.EMPTY_LIST);
+    MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.<String>emptyList());
 
     assertNotNull(result.projectData);
     assertOrderedElementsAreEqual(result.unresolvedArtifacts, new MavenId("fff", "zzz", "666"));
@@ -285,7 +285,7 @@ public class MavenFacadeEmbedderTest extends MavenImportingTestCase {
                                     "<version>1</version>" +
                                     "<packaging>pom</packaging>");
     myEmbedder.customizeForResolve(new SoutMavenConsole(), EMPTY_MAVEN_PROCESS);
-    myEmbedder.execute(m, Collections.EMPTY_LIST, Arrays.asList("install"));
+    myEmbedder.execute(m, Collections.<String>emptyList(), Arrays.asList("install"));
     myEmbedder.reset();
     File fooParentFile = new File(repo, "test/foo-parent/1/foo-parent-1.pom");
     assertTrue(fooParentFile.exists());
@@ -300,7 +300,7 @@ public class MavenFacadeEmbedderTest extends MavenImportingTestCase {
                         "  <version>1</version>" +
                         "</parent>");
     myEmbedder.customizeForResolve(new SoutMavenConsole(), EMPTY_MAVEN_PROCESS);
-    myEmbedder.execute(m, Collections.EMPTY_LIST, Arrays.asList("install"));
+    myEmbedder.execute(m, Collections.<String>emptyList(), Arrays.asList("install"));
     myEmbedder.reset();
     assertTrue(new File(repo, "test/foo/1/foo-1.pom").exists());
 
@@ -320,7 +320,7 @@ public class MavenFacadeEmbedderTest extends MavenImportingTestCase {
                      "</dependencies>");
 
     myEmbedder.customizeForResolve(new SoutMavenConsole(), EMPTY_MAVEN_PROCESS);
-    MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.EMPTY_LIST);
+    MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.<String>emptyList());
 
     assertNotNull(result.projectData);
     assertOrderedElementsAreEqual(result.unresolvedArtifacts, new MavenId("test", "foo-parent", "1"));
@@ -342,7 +342,7 @@ public class MavenFacadeEmbedderTest extends MavenImportingTestCase {
                      "</dependencies>");
 
     myEmbedder.customizeForResolve(new SoutMavenConsole(), EMPTY_MAVEN_PROCESS);
-    MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.EMPTY_LIST);
+    MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.<String>emptyList());
 
     assertNotNull(result);
     assertOrderedElementsAreEqual(result.unresolvedArtifacts, new MavenId("fff", "zzz", "666"));
index 2fed5ca3415d9a2296e6e5f44bbf4ec680c00e96..5ca5529e766bc8d2753259fa70b5a4cd00780293 100644 (file)
@@ -351,11 +351,11 @@ public class MavenProjectsNavigator extends SimpleProjectComponent implements Pe
     public void projectResolved(Pair<MavenProject, MavenProjectChanges> projectWithChanges,
                                 NativeMavenProjectHolder nativeMavenProject,
                                 Object message) {
-      scheduleUpdateProjects(Collections.singletonList(projectWithChanges.first), Collections.EMPTY_LIST);
+      scheduleUpdateProjects(Collections.singletonList(projectWithChanges.first), Collections.<MavenProject>emptyList());
     }
 
     public void pluginsResolved(MavenProject project) {
-      scheduleUpdateProjects(Collections.singletonList(project), Collections.EMPTY_LIST);
+      scheduleUpdateProjects(Collections.singletonList(project), Collections.<MavenProject>emptyList());
     }
 
     private void scheduleUpdateProjects(final List<MavenProject> projects, final List<MavenProject> deleted) {
index 2dec57b9a9a0edde1439a94affde50a6c58f52bc..cf60b185d88cf58fbae05e40fb31345a97ae7758 100644 (file)
@@ -640,7 +640,7 @@ public class MavenProjectsManager extends SimpleProjectComponent
           myWatcher.scheduleUpdateAll(force, forceImport);
         }
         else {
-          myWatcher.scheduleUpdate(MavenUtil.collectFiles(projects), Collections.EMPTY_LIST, force, forceImport);
+          myWatcher.scheduleUpdate(MavenUtil.collectFiles(projects), Collections.<VirtualFile>emptyList(), force, forceImport);
         }
       }
     });
@@ -981,7 +981,7 @@ public class MavenProjectsManager extends SimpleProjectComponent
     try {
       MavenUtil.run(myProject, "Downloading dependency...", new MavenTask() {
         public void run(MavenProgressIndicator indicator) throws MavenProcessCanceledException {
-          artifact[0] = myProjectsTree.downloadArtifact(mavenProject, id, myEmbeddersManager, new SoutMavenConsole(), indicator);
+          artifact[0] = MavenProjectsTree.downloadArtifact(mavenProject, id, myEmbeddersManager, new SoutMavenConsole(), indicator);
         }
       });
     }
index 8bfb6b6ea0c36c50f22e5f941e040c57be8324ab..ad302348bb8e518909c7d46905ff66dbb129ce5b 100644 (file)
@@ -671,7 +671,7 @@ public class MavenProjectsTree {
     });
   }
 
-  private long getFileTimestamp(VirtualFile file) {
+  private static long getFileTimestamp(VirtualFile file) {
     if (file == null || !file.isValid()) return -1;
     return file.getTimeStamp();
   }
@@ -1085,7 +1085,7 @@ public class MavenProjectsTree {
     }
   }
 
-  public MavenArtifact downloadArtifact(MavenProject mavenProject,
+  public static MavenArtifact downloadArtifact(MavenProject mavenProject,
                                         MavenId id,
                                         MavenEmbeddersManager embeddersManager,
                                         MavenConsole console,
@@ -1226,13 +1226,13 @@ public class MavenProjectsTree {
 
     public void fireUpdatedIfNecessary(Object message) {
       if (updatedProjectsWithChanges.isEmpty() && deletedProjects.isEmpty()) return;
-      fireProjectsUpdated(updatedProjectsWithChanges.isEmpty()
-                          ? Collections.EMPTY_LIST
-                          : MavenUtil.mapToList(updatedProjectsWithChanges),
-                          deletedProjects.isEmpty()
-                          ? Collections.EMPTY_LIST
-                          : new ArrayList<MavenProject>(deletedProjects),
-                          message);
+      List<MavenProject> mavenProjects = deletedProjects.isEmpty()
+                                         ? Collections.<MavenProject>emptyList()
+                                         : new ArrayList<MavenProject>(deletedProjects);
+      List<Pair<MavenProject, MavenProjectChanges>> updated = updatedProjectsWithChanges.isEmpty()
+                                                              ? Collections.<Pair<MavenProject, MavenProjectChanges>>emptyList()
+                                                              : MavenUtil.mapToList(updatedProjectsWithChanges);
+      fireProjectsUpdated(updated, mavenProjects, message);
     }
   }
 
@@ -1240,7 +1240,7 @@ public class MavenProjectsTree {
     void run(MavenEmbedderWrapper embedder) throws MavenProcessCanceledException;
   }
 
-  public static abstract class Visitor<Result> {
+  public abstract static class Visitor<Result> {
     private Result result;
 
     public boolean shouldVisit(MavenProject project) {
@@ -1265,7 +1265,7 @@ public class MavenProjectsTree {
     }
   }
 
-  public static abstract class SimpleVisitor extends Visitor<Object> {
+  public abstract static class SimpleVisitor extends Visitor<Object> {
   }
 
   private static class MavenProjectTimestamp {
index dc597d2caaf6d0edd20f3f14c4fa2dfa4eb66fca..fcd73f31ec7b8aab279dff8aa8e20bcd4a541258 100644 (file)
@@ -26,7 +26,7 @@ import java.util.List;
 public class OpenOrCreateSettingsXmlAction extends MavenOpenOrCreateFilesAction {
   protected List<File> getFiles(AnActionEvent e) {
     File file = MavenActionUtil.getProjectsManager(e.getDataContext()).getGeneralSettings().getEffectiveUserSettingsIoFile();
-    return file != null ? Collections.singletonList(file) : Collections.EMPTY_LIST;
+    return file != null ? Collections.singletonList(file) : Collections.<File>emptyList();
   }
 
   @Override
index 7d9f2dde754a4b741cf83ea8328d14658d3c66bd..129c2b1d557462584eac0487fd0ce3c1256ff21f 100644 (file)
@@ -155,7 +155,7 @@ public class MavenProjectBuilder extends ProjectImportBuilder<MavenProject> {
     for (VirtualFile f : getParameters().myFiles) {
       MavenProject project = new MavenProject(f);
       process.setText2(ProjectBundle.message("maven.reading.pom", f.getPath()));
-      project.read(generalSettings, Collections.EMPTY_LIST, reader, locator);
+      project.read(generalSettings, Collections.<String>emptyList(), reader, locator);
       uniqueProfiles.addAll(project.getProfilesIds());
     }
     getParameters().myProfiles = new ArrayList<String>(uniqueProfiles);
index e40f2b544b3087600ef1040dd3932a05d8ee2cbf..7dace904c9c72c48ec1f523bcaff474f02d4ae45 100644 (file)
@@ -33,7 +33,7 @@ public abstract class MavenPerformanceTest extends MavenImportingTestCase {
     super.setUp();
     VirtualFile file = LocalFileSystem.getInstance().findFileByPath("C:\\projects\\mvn\\_projects\\geronimo\\pom.xml");
     initProjectsManager(false);
-    myProjectsManager.resetManagedFilesAndProfilesInTests(Collections.singletonList(file), Collections.EMPTY_LIST);
+    myProjectsManager.resetManagedFilesAndProfilesInTests(Collections.singletonList(file), Collections.<String>emptyList());
   }
 
   public void testReading() throws Exception {
index 3948fad04cb4bbcb61c9250c51d60b44c4cb74f5..68f6be2f3fbf89e93cfd4ec0622c1dcdec633b25 100644 (file)
@@ -48,14 +48,18 @@ public class MavenIndicesManagerTest extends MavenIndicesTestCase {
     File dir3 = myIndicesFixture.getRepositoryHelper().getTestData("dir\\foo\\");
     File dir4 = myIndicesFixture.getRepositoryHelper().getTestData("dir/bar");
 
-    List<MavenIndex> indices1 = myIndicesFixture.getIndicesManager().ensureIndicesExist(myProject, dir1, Collections.EMPTY_LIST);
+    List<MavenIndex> indices1 = myIndicesFixture.getIndicesManager().ensureIndicesExist(myProject, dir1,
+                                                                                        Collections.<Pair<String, String>>emptyList());
     assertEquals(1, indices1.size());
     assertTrue(myIndicesFixture.getIndicesManager().getIndices().contains(indices1.get(0)));
 
-    assertEquals(indices1, myIndicesFixture.getIndicesManager().ensureIndicesExist(myProject, dir2, Collections.EMPTY_LIST));
-    assertEquals(indices1, myIndicesFixture.getIndicesManager().ensureIndicesExist(myProject, dir3, Collections.EMPTY_LIST));
+    assertEquals(indices1, myIndicesFixture.getIndicesManager().ensureIndicesExist(myProject, dir2,
+                                                                                   Collections.<Pair<String, String>>emptyList()));
+    assertEquals(indices1, myIndicesFixture.getIndicesManager().ensureIndicesExist(myProject, dir3,
+                                                                                   Collections.<Pair<String, String>>emptyList()));
 
-    List<MavenIndex> indices2 = myIndicesFixture.getIndicesManager().ensureIndicesExist(myProject, dir4, Collections.EMPTY_LIST);
+    List<MavenIndex> indices2 = myIndicesFixture.getIndicesManager().ensureIndicesExist(myProject, dir4,
+                                                                                        Collections.<Pair<String, String>>emptyList());
     assertFalse(indices1.get(0).equals(indices2.get(0)));
   }
 
@@ -81,7 +85,7 @@ public class MavenIndicesManagerTest extends MavenIndicesTestCase {
   public void testIndexedArchetypes() throws Exception {
     myIndicesFixture.getRepositoryHelper().addTestData("archetypes");
     myIndicesFixture.getIndicesManager().ensureIndicesExist(myProject, myIndicesFixture.getRepositoryHelper().getTestData("archetypes"),
-                                                            Collections.EMPTY_LIST);
+                                                            Collections.<Pair<String, String>>emptyList());
 
     assertArchetypeExists("org.apache.maven.archetypes:maven-archetype-foobar:1.0");
   }
@@ -122,4 +126,4 @@ public class MavenIndicesManagerTest extends MavenIndicesTestCase {
     }
     assertTrue(actualNames.toString(), actualNames.contains(archetypeId));
   }
-}
\ No newline at end of file
+}
index 7d277c5c3de67897a7a0d568cd75b0563140e6b4..86a80e0b98e67a37b967a9d4df4e293c3505ab08 100644 (file)
@@ -50,7 +50,7 @@ public class MavenProjectsNavigatorTest extends MavenImportingTestCase {
     createModulePom("m", "<groupId>test</groupId>" +
                          "<artifactId>m</artifactId>" +
                          "<version>1</version>");
-    myProjectsManager.resetManagedFilesAndProfilesInTests(Collections.singletonList(myProjectPom), Collections.EMPTY_LIST);
+    myProjectsManager.resetManagedFilesAndProfilesInTests(Collections.singletonList(myProjectPom), Collections.<String>emptyList());
     waitForReadingCompletion();
 
     myProjectsManager.fireActivatedInTests();
index 9a850e87e675c3dc6db82fa27fbcde1bf89f3424..cbc32728efe4526171cefd498b7f2f45ee79bd9a 100644 (file)
@@ -220,10 +220,10 @@ public class MavenProjectReaderTest extends MavenTestCase {
     assertPathEquals(pathFromBasedir("src/test/java"), p.getBuild().getTestSources().get(0));
     assertEquals(1, p.getBuild().getResources().size());
     assertResource(p.getBuild().getResources().get(0), pathFromBasedir("src/main/resources"),
-                   false, null, Collections.EMPTY_LIST, Collections.EMPTY_LIST);
+                   false, null, Collections.<String>emptyList(), Collections.<String>emptyList());
     assertEquals(1, p.getBuild().getTestResources().size());
     assertResource(p.getBuild().getTestResources().get(0), pathFromBasedir("src/test/resources"),
-                   false, null, Collections.EMPTY_LIST, Collections.EMPTY_LIST);
+                   false, null, Collections.<String>emptyList(), Collections.<String>emptyList());
     assertPathEquals(pathFromBasedir("target"), p.getBuild().getDirectory());
     assertPathEquals(pathFromBasedir("target/classes"), p.getBuild().getOutputDirectory());
     assertPathEquals(pathFromBasedir("target/test-classes"), p.getBuild().getTestOutputDirectory());
@@ -319,7 +319,7 @@ public class MavenProjectReaderTest extends MavenTestCase {
                    true, "dir", Collections.singletonList("**.properties"), Collections.singletonList("**.xml"));
     assertEquals(1, p.getBuild().getTestResources().size());
     assertResource(p.getBuild().getTestResources().get(0), pathFromBasedir("myTestRes"),
-                   false, null, Collections.singletonList("**.properties"), Collections.EMPTY_LIST);
+                   false, null, Collections.singletonList("**.properties"), Collections.<String>emptyList());
     assertPathEquals(pathFromBasedir("myOutput"), p.getBuild().getDirectory());
     assertPathEquals(pathFromBasedir("myClasses"), p.getBuild().getOutputDirectory());
     assertPathEquals(pathFromBasedir("myTestClasses"), p.getBuild().getTestOutputDirectory());
@@ -391,10 +391,10 @@ public class MavenProjectReaderTest extends MavenTestCase {
     assertPathEquals(pathFromBasedir("subDir/myTestSrc"), p.getBuild().getTestSources().get(0));
     assertEquals(1, p.getBuild().getResources().size());
     assertResource(p.getBuild().getResources().get(0), pathFromBasedir("subDir/myRes"),
-                   false, null, Collections.EMPTY_LIST, Collections.EMPTY_LIST);
+                   false, null, Collections.<String>emptyList(), Collections.<String>emptyList());
     assertEquals(1, p.getBuild().getTestResources().size());
     assertResource(p.getBuild().getTestResources().get(0), pathFromBasedir("subDir/myTestRes"),
-                   false, null, Collections.EMPTY_LIST, Collections.EMPTY_LIST);
+                   false, null, Collections.<String>emptyList(), Collections.<String>emptyList());
     assertPathEquals(pathFromBasedir("subDir/myOutput"), p.getBuild().getDirectory());
     assertPathEquals(pathFromBasedir("subDir/myClasses"), p.getBuild().getOutputDirectory());
     assertPathEquals(pathFromBasedir("subDir/myTestClasses"), p.getBuild().getTestOutputDirectory());
index 8beb1809fdd870865802fac7541ad590054f6c0d..51219fc2a07db4fb7afd895dac306a8c02f16478 100644 (file)
@@ -59,7 +59,7 @@ public class MavenProjectsTreeIgnoresTest extends MavenProjectsTreeTestCase {
     assertEquals("ignored: m1 ", myLog);
     myLog = "";
 
-    myTree.setIgnoredFilesPatterns(Collections.EMPTY_LIST);
+    myTree.setIgnoredFilesPatterns(Collections.<String>emptyList());
 
     assertEquals("unignored: m1 ", myLog);
     myLog = "";
@@ -92,4 +92,4 @@ public class MavenProjectsTreeIgnoresTest extends MavenProjectsTreeTestCase {
       }, ", ");
     }
   }
-}
\ No newline at end of file
+}
index a6487bdf07f5011ab8e73636174a1667c7000808..492b007c3ed79e570b9eef55922122adc0d06d8f 100644 (file)
@@ -89,7 +89,7 @@ public class SvnConfigureProxiesComponent extends MasterDetailsComponent {
   private void addGroup(final ProxyGroup template) {
     final ProxyGroup group;
     if (template == null) {
-      group = new ProxyGroup(getNewName(), "", Collections.EMPTY_MAP);
+      group = new ProxyGroup(getNewName(), "", Collections.<String, String>emptyMap());
     } else {
       group = new ProxyGroup(getNewName(), template.getPatterns(), template.getProperties());
     }
@@ -260,7 +260,7 @@ public class SvnConfigureProxiesComponent extends MasterDetailsComponent {
     myRoot.removeAllChildren();
 
     DefaultProxyGroup defaultProxyGroup = myManager.getDefaultGroup();
-    defaultProxyGroup = (defaultProxyGroup == null) ? new DefaultProxyGroup(Collections.EMPTY_MAP) : defaultProxyGroup;
+    defaultProxyGroup = (defaultProxyGroup == null) ? new DefaultProxyGroup(Collections.<String, String>emptyMap()) : defaultProxyGroup;
     final Map<String, ProxyGroup> userGroups = myManager.getGroups();
 
     myRoot.add(createNodeForObject(defaultProxyGroup));
index ff3368f26892ebadd2ae2b428670d0f671ba3098..00c5220e1e7203322123fe4290c36a14bbbd5b90 100644 (file)
@@ -86,7 +86,7 @@ class IntroduceParameterProcessor extends BaseRefactoringProcessor {
             usageCount += callsToUpdate.size();
         } else {
             //noinspection unchecked
-            callsToUpdate = Collections.EMPTY_LIST;
+            callsToUpdate = Collections.emptyList();
         }
 
         final UsageInfo[] usageInfos = new UsageInfo[usageCount];
index 040be39b55e5bb751671bf15dc89683b8815b49f..6547c5394e49dc78c4c19a3ebf46e358cd922575 100644 (file)
@@ -35,7 +35,7 @@ public class ParamMatcher extends BaseMatcher {
     public ParamMatcher(XmlTag parent, String name) {
         myRoot = parent;
         myName = name;
-        myExcludedNames = Collections.EMPTY_SET;
+        myExcludedNames = Collections.emptySet();
     }
 
     public ParamMatcher(XmlTag root, String[] excludedNames, String name) {
index 4e54d3872aa30a446339510ce25bcbe54c20485a..cde2e552745bd7117a8509b7637209e852d2bcdd 100644 (file)
@@ -40,8 +40,8 @@ public final class HistoryElement implements Copyable<HistoryElement> {
     @SuppressWarnings({"unchecked"})
     private HistoryElement() {
         expression = null;
-        variables = Collections.EMPTY_SET;
-        namespaces = Collections.EMPTY_SET;
+        variables = Collections.emptySet();
+        namespaces = Collections.emptySet();
     }
 
     public boolean equals(Object o) {
index 2ec5b86015f251c078d900ac78e7f4a4750feceb..cf7e5fbea943eab317a01c1dfe0b41bc50dc50c4 100644 (file)
@@ -148,7 +148,7 @@ public class FindByXPathAction extends AnAction {
     private static boolean validateExpression(Project project, String expression) {
         try {
             //noinspection unchecked
-            XPathSupport.getInstance().createXPath(null, expression, Collections.EMPTY_LIST);
+            XPathSupport.getInstance().createXPath(null, expression, Collections.<org.intellij.plugins.xpathView.util.Namespace>emptyList());
             return true;
         } catch (XPathSyntaxException e) {
             Messages.showErrorDialog(project, e.getMultilineMessage(), "XPath Syntax Error");
index e9a78e4fdb118db6f304bf98ef28f37e11aed5eb..d01275e1cce32812cace44186f88e8091b89eeda 100644 (file)
@@ -50,7 +50,7 @@ public class PsiDocumentNavigator extends DefaultNavigator {
         }
 
         if (!(contextNode instanceof XmlElement)) {
-            return Collections.EMPTY_LIST.iterator();
+            return Collections.emptyList().iterator();
         }
         return new PsiChildAxisIterator(contextNode);
     }
@@ -62,7 +62,7 @@ public class PsiDocumentNavigator extends DefaultNavigator {
         }
 
         if (!(contextNode instanceof XmlElement)) {
-            return Collections.EMPTY_LIST.iterator();
+            return Collections.emptyList().iterator();
         }
 
         return new NodeIterator((XmlElement)contextNode) {
@@ -183,7 +183,7 @@ public class PsiDocumentNavigator extends DefaultNavigator {
         if (isElement(contextNode)) {
             return new AttributeIterator((XmlElement)contextNode);
         } else {
-            return Collections.EMPTY_LIST.iterator();
+            return Collections.emptyList().iterator();
         }
     }
 
index b7e050cc76c3eb94fe4348da574c603f78e0c68b..b68719d6e198e618b14bf4ec2cbcd8403d5d529c 100644 (file)
@@ -74,7 +74,7 @@ class XPathFunctionProviderImpl extends XPathFunctionProvider {
             return myFunctions;
         } else {
             //noinspection unchecked
-            return Collections.EMPTY_MAP;
+            return Collections.emptyMap();
         }
     }
 
index 1b6d4df97d25feb19b578bb179684c64570fd735..660ce9d011753b00b71a721d07c73291390ea677 100644 (file)
@@ -86,7 +86,7 @@ public abstract class InputExpressionDialog<FormType extends InputForm> extends
     private final ComboBox myComboBox = new ComboBox();
     private JComponent myEditorComponent;
 
-    private @Nullable Set<Namespace> myNamespaceCache;
+    @Nullable private Set<Namespace> myNamespaceCache;
     private InteractiveContextProvider myContextProvider;
     private final PsiFile myXPathFile;
 
@@ -163,8 +163,8 @@ public abstract class InputExpressionDialog<FormType extends InputForm> extends
                     n = selectedItem.namespaces;
                     v = selectedItem.variables;
                 } else {
-                    n = Collections.EMPTY_SET;
-                    v = Collections.EMPTY_SET;
+                    n = Collections.emptySet();
+                    v = Collections.emptySet();
                 }
 
                 // FIXME
@@ -231,7 +231,7 @@ public abstract class InputExpressionDialog<FormType extends InputForm> extends
                     final PsiReference[] references = element.getReferences();
                     for (PsiReference reference : references) {
                         if (reference instanceof PrefixReference) {
-                            final PrefixReference prefixReference = ((PrefixReference)reference);
+                            final PrefixReference prefixReference = (PrefixReference)reference;
                             if (prefixReference.isUnresolved()) {
                                 prefixes.add(prefixReference.getPrefix());
                             }
@@ -378,7 +378,7 @@ public abstract class InputExpressionDialog<FormType extends InputForm> extends
             if (myNamespaceCache != null) {
                 return Namespace.makeMap(myNamespaceCache);
             } else {
-                return Collections.EMPTY_MAP;
+                return Collections.emptyMap();
             }
         }
 
@@ -397,8 +397,8 @@ public abstract class InputExpressionDialog<FormType extends InputForm> extends
     public Context getContext() {
         final HistoryElement context = myModel.getSelectedItem();
         if (context == null || context.expression == null) {
-            final Set<Namespace> cache = myNamespaceCache != null ? myNamespaceCache : Collections.EMPTY_SET;
-            return new Context(new HistoryElement(myDocument.getText(), Collections.EMPTY_SET, cache), getMode());
+            final Set<Namespace> cache = myNamespaceCache != null ? myNamespaceCache : Collections.<Namespace>emptySet();
+            return new Context(new HistoryElement(myDocument.getText(), Collections.<Variable>emptySet(), cache), getMode());
         }
 
         final Collection<Namespace> namespaces = myNamespaceCache != null ?
@@ -536,8 +536,8 @@ public abstract class InputExpressionDialog<FormType extends InputForm> extends
 
         @Nullable
         public String getPrefixForURI(String uri, XmlElement context) {
-            final java.util.List<String> list = myMap.getKeysByValue(uri);
-            return list != null && list.size() > 0 ? list.get(0) : null;
+            final List<String> list = myMap.getKeysByValue(uri);
+            return list != null && !list.isEmpty() ? list.get(0) : null;
         }
 
         @NotNull
@@ -617,7 +617,7 @@ public abstract class InputExpressionDialog<FormType extends InputForm> extends
                 } else {
                     n = Collections.singleton(namespace);
                     //noinspection unchecked
-                    v = Collections.EMPTY_SET;
+                    v = Collections.emptySet();
                 }
 
                 updateContext(n, v);
index 5563906275314584c9afc8dba3b785aba8138fd9..b4bd76a8d5eb6b363f5fc6267e3ed94f1ab42c50 100644 (file)
@@ -112,7 +112,7 @@ public class HighlighterUtil {
     public static List<RangeHighlighter> getHighlighters(Editor editor) {
         if (!hasHighlighters(editor)) {
             //noinspection unchecked
-            return Collections.EMPTY_LIST;
+            return Collections.emptyList();
         } else {
             return editor.getUserData(HIGHLIGHTERS_KEY);
         }
index 2261f530baae47bf68b4fed846e7b377f6df2bb3..ef8132b52c2a0ac6c772b637d2d582abea2a9167 100644 (file)
@@ -125,7 +125,7 @@ public class NamespaceCollector extends XmlRecursiveElementVisitor {
 
     public static CollectedInfo empty() {
         //noinspection unchecked
-        return new CollectedInfo(Collections.EMPTY_SET, Collections.EMPTY_SET, Collections.EMPTY_SET);
+        return new CollectedInfo(Collections.<Namespace>emptySet(), Collections.<QName>emptySet(), Collections.<QName>emptySet());
     }
     
     public static CollectedInfo collectInfo(final XmlFile psiFile) {
index 57df5b00e52c902cc69400d2f86a7e9d33253f63..3d7aa0ff09302c8e22450dabfbe6354cee45abaa 100644 (file)
@@ -112,7 +112,13 @@ public class DynamicGenericInfo extends DomGenericInfoEx {
           if (!collections.isEmpty()) {
             ChildrenDescriptionsHolder<CollectionChildDescriptionImpl> newCollections = new ChildrenDescriptionsHolder<CollectionChildDescriptionImpl>(myStaticGenericInfo.getCollections());
             for (final DomExtensionImpl extension : collections) {
-              newCollections.addDescription(extension.addAnnotations(new CollectionChildDescriptionImpl(extension.getXmlName(), extension.getType(), Collections.EMPTY_LIST, Collections.EMPTY_LIST, Collections.EMPTY_LIST, Collections.EMPTY_LIST, Collections.EMPTY_LIST, Collections.EMPTY_LIST)));
+              newCollections.addDescription(extension.addAnnotations(new CollectionChildDescriptionImpl(extension.getXmlName(), extension.getType(),
+                                                                                                        Collections.<JavaMethod>emptyList(),
+                                                                                                        Collections.<JavaMethod>emptyList(),
+                                                                                                        Collections.<JavaMethod>emptyList(),
+                                                                                                        Collections.<JavaMethod>emptyList(),
+                                                                                                        Collections.<JavaMethod>emptyList(),
+                                                                                                        Collections.<JavaMethod>emptyList())));
             }
             clearSubTags = true;
             myCollections = newCollections;
index a5e10800417ae7a4dd5ff842c3c87f9ce670b050..44ee2ec0485c5384774e66412793441fdeadf556 100644 (file)
@@ -151,14 +151,14 @@ public class GenerateInstanceDocumentFromSchemaDialog extends DialogWrapper {
     List<String> myRootValues;
 
     if (psifile == null) {
-      configureComboBox(rootElementChooser, Collections.EMPTY_LIST);
+      configureComboBox(rootElementChooser, Collections.<String>emptyList());
       return;
     }
 
     final XmlTag rootTag = getRootTag(psifile);
 
     if (rootTag == null) {
-      configureComboBox(rootElementChooser, Collections.EMPTY_LIST);
+      configureComboBox(rootElementChooser, Collections.<String>emptyList());
       rootElementChooser.setSelectedIndex(-1);
       previousUri = uri;
       return;