diff --git a/platform/lang-impl/src/com/intellij/codeInsight/navigation/GotoImplementationHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/navigation/GotoImplementationHandler.java index e00854b7f245..07ef55c7dc84 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/navigation/GotoImplementationHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/navigation/GotoImplementationHandler.java @@ -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.emptyList()); } protected String getChooserTitle(PsiElement sourceElement, String name, int length) { diff --git a/platform/lang-impl/src/com/intellij/semantic/SemServiceImpl.java b/platform/lang-impl/src/com/intellij/semantic/SemServiceImpl.java index 7049f1e729fb..547401aeb10d 100644 --- a/platform/lang-impl/src/com/intellij/semantic/SemServiceImpl.java +++ b/platform/lang-impl/src/com/intellij/semantic/SemServiceImpl.java @@ -215,7 +215,7 @@ public class SemServiceImpl extends SemService{ return null; } - if (cached != null && cached != Collections.EMPTY_LIST) { + if (cached != null && cached != Collections.emptyList()) { if (singleList == null) { singleList = cached; continue; diff --git a/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/RevisionsList.java b/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/RevisionsList.java index c5aa247bfcbc..e1942a8c28cd 100644 --- a/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/RevisionsList.java +++ b/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/RevisionsList.java @@ -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.emptyList(), Collections.emptyMap())); table.setTableHeader(null); table.setShowGrid(false); diff --git a/platform/platform-impl/src/com/intellij/openapi/command/impl/UndoRedo.java b/platform/platform-impl/src/com/intellij/openapi/command/impl/UndoRedo.java index 3ecf06dfcd4f..c265c4b2e94a 100644 --- a/platform/platform-impl/src/com/intellij/openapi/command/impl/UndoRedo.java +++ b/platform/platform-impl/src/com/intellij/openapi/command/impl/UndoRedo.java @@ -71,7 +71,7 @@ abstract class UndoRedo { } private Set getDecRefs() { - return myEditor == null ? Collections.EMPTY_SET : myManager.getDocumentReferences(myEditor); + return myEditor == null ? Collections.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 +} diff --git a/platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsEditorContext.java b/platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsEditorContext.java index 323c8952a4ca..d6f85b3c6fd1 100644 --- a/platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsEditorContext.java +++ b/platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsEditorContext.java @@ -142,7 +142,7 @@ public class OptionsEditorContext { public Collection getChildren(final Configurable parent) { Collection result = myParentToChildrenMap.get(parent); - return result == null ? Collections.EMPTY_SET : result; + return result == null ? Collections.emptySet() : result; } interface ColleagueAction { diff --git a/platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsTree.java b/platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsTree.java index 36b30d025a66..8741204fcec7 100644 --- a/platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsTree.java +++ b/platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsTree.java @@ -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(); } } diff --git a/platform/util/testSrc/com/intellij/util/containers/ContainerUtilTest.java b/platform/util/testSrc/com/intellij/util/containers/ContainerUtilTest.java index 29cdef3c8cc0..d207334cf58c 100644 --- a/platform/util/testSrc/com/intellij/util/containers/ContainerUtilTest.java +++ b/platform/util/testSrc/com/intellij/util/containers/ContainerUtilTest.java @@ -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 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 iterator = Arrays.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 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 collection, Condition condition, Integer... expected) { + private static void asserIterating(List collection, Condition condition, Integer... expected) { Iterable it = ContainerUtil.iterate(collection, condition); List actual = new ArrayList(); for (Integer each : it) { diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/naming/ConventionInspection.java b/plugins/InspectionGadgets/src/com/siyeh/ig/naming/ConventionInspection.java index 03ee14449d00..663e1a823236 100644 --- a/plugins/InspectionGadgets/src/com/siyeh/ig/naming/ConventionInspection.java +++ b/plugins/InspectionGadgets/src/com/siyeh/ig/naming/ConventionInspection.java @@ -95,7 +95,7 @@ public abstract class ConventionInspection extends BaseInspection { private static final int REGEX_COLUMN_COUNT = 25; public Collection 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 +} diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/psiutils/WeakestTypeFinder.java b/plugins/InspectionGadgets/src/com/siyeh/ig/psiutils/WeakestTypeFinder.java index 09d6147ecf0b..280e6c5545c2 100644 --- a/plugins/InspectionGadgets/src/com/siyeh/ig/psiutils/WeakestTypeFinder.java +++ b/plugins/InspectionGadgets/src/com/siyeh/ig/psiutils/WeakestTypeFinder.java @@ -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 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); diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/encapsulation/ReturnOfCollectionFieldInspection.java b/plugins/InspectionGadgets/test/com/siyeh/igtest/encapsulation/ReturnOfCollectionFieldInspection.java index 9927094ca540..887cf780892b 100644 --- a/plugins/InspectionGadgets/test/com/siyeh/igtest/encapsulation/ReturnOfCollectionFieldInspection.java +++ b/plugins/InspectionGadgets/test/com/siyeh/igtest/encapsulation/ReturnOfCollectionFieldInspection.java @@ -30,7 +30,7 @@ public class ReturnOfCollectionFieldInspection public List fooBarEmpty() { - return Collections.EMPTY_LIST; + return Collections.emptyList(); } public int[] bar() @@ -39,4 +39,4 @@ public class ReturnOfCollectionFieldInspection } -} \ No newline at end of file +} diff --git a/plugins/IntentionPowerPak/src/com/siyeh/ipp/psiutils/VariableAccessUtils.java b/plugins/IntentionPowerPak/src/com/siyeh/ipp/psiutils/VariableAccessUtils.java index 6ccc4aaf0eac..a169b5b30ccb 100644 --- a/plugins/IntentionPowerPak/src/com/siyeh/ipp/psiutils/VariableAccessUtils.java +++ b/plugins/IntentionPowerPak/src/com/siyeh/ipp/psiutils/VariableAccessUtils.java @@ -158,7 +158,7 @@ public class VariableAccessUtils { public static Set 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 +} diff --git a/plugins/cvs/javacvs-src/org/netbeans/lib/cvsclient/command/FileSystemScanner.java b/plugins/cvs/javacvs-src/org/netbeans/lib/cvsclient/command/FileSystemScanner.java index 748c98ad188a..df3e9067db9c 100644 --- a/plugins/cvs/javacvs-src/org/netbeans/lib/cvsclient/command/FileSystemScanner.java +++ b/plugins/cvs/javacvs-src/org/netbeans/lib/cvsclient/command/FileSystemScanner.java @@ -83,7 +83,7 @@ final class FileSystemScanner { private List 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)); diff --git a/plugins/cvs/smartcvs-src/org/netbeans/lib/cvsclient/admin/AdminReader.java b/plugins/cvs/smartcvs-src/org/netbeans/lib/cvsclient/admin/AdminReader.java index 8ab3e19ce350..cf255569ca1f 100644 --- a/plugins/cvs/smartcvs-src/org/netbeans/lib/cvsclient/admin/AdminReader.java +++ b/plugins/cvs/smartcvs-src/org/netbeans/lib/cvsclient/admin/AdminReader.java @@ -76,7 +76,7 @@ public final class AdminReader return entriesHandler.getEntries().getEntries(); } catch (FileNotFoundException ex) { - return Collections.EMPTY_SET; + return Collections.emptySet(); } } diff --git a/plugins/maven/facade-impl/src/org/jetbrains/idea/maven/facade/embedder/MavenModelConverter.java b/plugins/maven/facade-impl/src/org/jetbrains/idea/maven/facade/embedder/MavenModelConverter.java index 08e033a4ec5d..20cbe56e66af 100644 --- a/plugins/maven/facade-impl/src/org/jetbrains/idea/maven/facade/embedder/MavenModelConverter.java +++ b/plugins/maven/facade-impl/src/org/jetbrains/idea/maven/facade/embedder/MavenModelConverter.java @@ -121,7 +121,7 @@ public class MavenModelConverter { } private static List ensurePatterns(List patterns) { - return patterns == null ? Collections.EMPTY_LIST : patterns; + return patterns == null ? Collections.emptyList() : patterns; } private static List convertRepositories(List 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()); } diff --git a/plugins/maven/facade-impl/test/org/jetbrains/idea/maven/embedder/MavenFacadeEmbedderTest.java b/plugins/maven/facade-impl/test/org/jetbrains/idea/maven/embedder/MavenFacadeEmbedderTest.java index 7163d401f576..80c44ffdb473 100644 --- a/plugins/maven/facade-impl/test/org/jetbrains/idea/maven/embedder/MavenFacadeEmbedderTest.java +++ b/plugins/maven/facade-impl/test/org/jetbrains/idea/maven/embedder/MavenFacadeEmbedderTest.java @@ -83,7 +83,7 @@ public class MavenFacadeEmbedderTest extends MavenImportingTestCase { "1"); myEmbedder.customizeForResolve(new SoutMavenConsole(), EMPTY_MAVEN_PROCESS); - MavenWrapperExecutionResult result = myEmbedder.execute(myProjectPom, Collections.EMPTY_LIST, Arrays.asList("compile")); + MavenWrapperExecutionResult result = myEmbedder.execute(myProjectPom, Collections.emptyList(), Arrays.asList("compile")); assertNotNull(result.projectData); assertNotNull(new File(getProjectPath(), "target").exists()); @@ -108,7 +108,7 @@ public class MavenFacadeEmbedderTest extends MavenImportingTestCase { ""); myEmbedder.customizeForResolve(new SoutMavenConsole(), EMPTY_MAVEN_PROCESS); - MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.EMPTY_LIST); + MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.emptyList()); assertNotNull(result.projectData); assertOrderedElementsAreEqual(result.unresolvedArtifacts); @@ -124,7 +124,7 @@ public class MavenFacadeEmbedderTest extends MavenImportingTestCase { "1"); myEmbedder.customizeForResolve(new SoutMavenConsole(), EMPTY_MAVEN_PROCESS); - MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.EMPTY_LIST); + MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.emptyList()); MavenModel project = result.projectData.mavenModel; assertNotNull(project); @@ -160,7 +160,7 @@ public class MavenFacadeEmbedderTest extends MavenImportingTestCase { ""); myEmbedder.customizeForResolve(new SoutMavenConsole(), EMPTY_MAVEN_PROCESS); - MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.EMPTY_LIST); + MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.emptyList()); assertNotNull(result.projectData); assertOrderedElementsAreEqual(result.unresolvedArtifacts); @@ -192,7 +192,7 @@ public class MavenFacadeEmbedderTest extends MavenImportingTestCase { ""); myEmbedder.customizeForResolve(new SoutMavenConsole(), EMPTY_MAVEN_PROCESS); - MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.EMPTY_LIST); + MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.emptyList()); assertNotNull(result.projectData); assertOrderedElementsAreEqual(result.unresolvedArtifacts); @@ -245,7 +245,7 @@ public class MavenFacadeEmbedderTest extends MavenImportingTestCase { ""); myEmbedder.customizeForResolve(new SoutMavenConsole(), EMPTY_MAVEN_PROCESS); - MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.EMPTY_LIST); + MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.emptyList()); assertNotNull(result.projectData); assertOrderedElementsAreEqual(result.unresolvedArtifacts, new MavenId("fff", "zzz", "666")); @@ -267,7 +267,7 @@ public class MavenFacadeEmbedderTest extends MavenImportingTestCase { ""); myEmbedder.customizeForResolve(new SoutMavenConsole(), EMPTY_MAVEN_PROCESS); - MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.EMPTY_LIST); + MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.emptyList()); assertNotNull(result.projectData); assertOrderedElementsAreEqual(result.unresolvedArtifacts, new MavenId("fff", "zzz", "666")); @@ -285,7 +285,7 @@ public class MavenFacadeEmbedderTest extends MavenImportingTestCase { "1" + "pom"); myEmbedder.customizeForResolve(new SoutMavenConsole(), EMPTY_MAVEN_PROCESS); - myEmbedder.execute(m, Collections.EMPTY_LIST, Arrays.asList("install")); + myEmbedder.execute(m, Collections.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 { " 1" + ""); myEmbedder.customizeForResolve(new SoutMavenConsole(), EMPTY_MAVEN_PROCESS); - myEmbedder.execute(m, Collections.EMPTY_LIST, Arrays.asList("install")); + myEmbedder.execute(m, Collections.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 { ""); myEmbedder.customizeForResolve(new SoutMavenConsole(), EMPTY_MAVEN_PROCESS); - MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.EMPTY_LIST); + MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.emptyList()); assertNotNull(result.projectData); assertOrderedElementsAreEqual(result.unresolvedArtifacts, new MavenId("test", "foo-parent", "1")); @@ -342,7 +342,7 @@ public class MavenFacadeEmbedderTest extends MavenImportingTestCase { ""); myEmbedder.customizeForResolve(new SoutMavenConsole(), EMPTY_MAVEN_PROCESS); - MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.EMPTY_LIST); + MavenWrapperExecutionResult result = myEmbedder.resolveProject(myProjectPom, Collections.emptyList()); assertNotNull(result); assertOrderedElementsAreEqual(result.unresolvedArtifacts, new MavenId("fff", "zzz", "666")); diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/navigator/MavenProjectsNavigator.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/navigator/MavenProjectsNavigator.java index 2fed5ca3415d..5ca5529e766b 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/navigator/MavenProjectsNavigator.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/navigator/MavenProjectsNavigator.java @@ -351,11 +351,11 @@ public class MavenProjectsNavigator extends SimpleProjectComponent implements Pe public void projectResolved(Pair projectWithChanges, NativeMavenProjectHolder nativeMavenProject, Object message) { - scheduleUpdateProjects(Collections.singletonList(projectWithChanges.first), Collections.EMPTY_LIST); + scheduleUpdateProjects(Collections.singletonList(projectWithChanges.first), Collections.emptyList()); } public void pluginsResolved(MavenProject project) { - scheduleUpdateProjects(Collections.singletonList(project), Collections.EMPTY_LIST); + scheduleUpdateProjects(Collections.singletonList(project), Collections.emptyList()); } private void scheduleUpdateProjects(final List projects, final List deleted) { diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProjectsManager.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProjectsManager.java index 2dec57b9a9a0..cf60b185d88c 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProjectsManager.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProjectsManager.java @@ -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.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); } }); } diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProjectsTree.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProjectsTree.java index 8bfb6b6ea0c3..ad302348bb8e 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProjectsTree.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProjectsTree.java @@ -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(deletedProjects), - message); + List mavenProjects = deletedProjects.isEmpty() + ? Collections.emptyList() + : new ArrayList(deletedProjects); + List> updated = updatedProjectsWithChanges.isEmpty() + ? Collections.>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 { + public abstract static class Visitor { private Result result; public boolean shouldVisit(MavenProject project) { @@ -1265,7 +1265,7 @@ public class MavenProjectsTree { } } - public static abstract class SimpleVisitor extends Visitor { + public abstract static class SimpleVisitor extends Visitor { } private static class MavenProjectTimestamp { diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/actions/OpenOrCreateSettingsXmlAction.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/actions/OpenOrCreateSettingsXmlAction.java index dc597d2caaf6..fcd73f31ec7b 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/actions/OpenOrCreateSettingsXmlAction.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/actions/OpenOrCreateSettingsXmlAction.java @@ -26,7 +26,7 @@ import java.util.List; public class OpenOrCreateSettingsXmlAction extends MavenOpenOrCreateFilesAction { protected List 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.emptyList(); } @Override diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/wizards/MavenProjectBuilder.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/wizards/MavenProjectBuilder.java index 7d9f2dde754a..129c2b1d5574 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/wizards/MavenProjectBuilder.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/wizards/MavenProjectBuilder.java @@ -155,7 +155,7 @@ public class MavenProjectBuilder extends ProjectImportBuilder { 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.emptyList(), reader, locator); uniqueProfiles.addAll(project.getProfilesIds()); } getParameters().myProfiles = new ArrayList(uniqueProfiles); diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/importing/MavenPerformanceTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/importing/MavenPerformanceTest.java index e40f2b544b30..7dace904c9c7 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/importing/MavenPerformanceTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/importing/MavenPerformanceTest.java @@ -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.emptyList()); } public void testReading() throws Exception { diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenIndicesManagerTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenIndicesManagerTest.java index 3948fad04cb4..68f6be2f3fbf 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenIndicesManagerTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenIndicesManagerTest.java @@ -48,14 +48,18 @@ public class MavenIndicesManagerTest extends MavenIndicesTestCase { File dir3 = myIndicesFixture.getRepositoryHelper().getTestData("dir\\foo\\"); File dir4 = myIndicesFixture.getRepositoryHelper().getTestData("dir/bar"); - List indices1 = myIndicesFixture.getIndicesManager().ensureIndicesExist(myProject, dir1, Collections.EMPTY_LIST); + List indices1 = myIndicesFixture.getIndicesManager().ensureIndicesExist(myProject, dir1, + Collections.>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.>emptyList())); + assertEquals(indices1, myIndicesFixture.getIndicesManager().ensureIndicesExist(myProject, dir3, + Collections.>emptyList())); - List indices2 = myIndicesFixture.getIndicesManager().ensureIndicesExist(myProject, dir4, Collections.EMPTY_LIST); + List indices2 = myIndicesFixture.getIndicesManager().ensureIndicesExist(myProject, dir4, + Collections.>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.>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 +} diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/navigator/MavenProjectsNavigatorTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/navigator/MavenProjectsNavigatorTest.java index 7d277c5c3de6..86a80e0b98e6 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/navigator/MavenProjectsNavigatorTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/navigator/MavenProjectsNavigatorTest.java @@ -50,7 +50,7 @@ public class MavenProjectsNavigatorTest extends MavenImportingTestCase { createModulePom("m", "test" + "m" + "1"); - myProjectsManager.resetManagedFilesAndProfilesInTests(Collections.singletonList(myProjectPom), Collections.EMPTY_LIST); + myProjectsManager.resetManagedFilesAndProfilesInTests(Collections.singletonList(myProjectPom), Collections.emptyList()); waitForReadingCompletion(); myProjectsManager.fireActivatedInTests(); diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/project/MavenProjectReaderTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/project/MavenProjectReaderTest.java index 9a850e87e675..cbc32728efe4 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/project/MavenProjectReaderTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/project/MavenProjectReaderTest.java @@ -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.emptyList(), Collections.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.emptyList(), Collections.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.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.emptyList(), Collections.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.emptyList(), Collections.emptyList()); assertPathEquals(pathFromBasedir("subDir/myOutput"), p.getBuild().getDirectory()); assertPathEquals(pathFromBasedir("subDir/myClasses"), p.getBuild().getOutputDirectory()); assertPathEquals(pathFromBasedir("subDir/myTestClasses"), p.getBuild().getTestOutputDirectory()); diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/project/MavenProjectsTreeIgnoresTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/project/MavenProjectsTreeIgnoresTest.java index 8beb1809fdd8..51219fc2a07d 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/project/MavenProjectsTreeIgnoresTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/project/MavenProjectsTreeIgnoresTest.java @@ -59,7 +59,7 @@ public class MavenProjectsTreeIgnoresTest extends MavenProjectsTreeTestCase { assertEquals("ignored: m1 ", myLog); myLog = ""; - myTree.setIgnoredFilesPatterns(Collections.EMPTY_LIST); + myTree.setIgnoredFilesPatterns(Collections.emptyList()); assertEquals("unignored: m1 ", myLog); myLog = ""; @@ -92,4 +92,4 @@ public class MavenProjectsTreeIgnoresTest extends MavenProjectsTreeTestCase { }, ", "); } } -} \ No newline at end of file +} diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/config/SvnConfigureProxiesComponent.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/config/SvnConfigureProxiesComponent.java index a6487bdf07f5..492b007c3ed7 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/config/SvnConfigureProxiesComponent.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/config/SvnConfigureProxiesComponent.java @@ -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.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.emptyMap()) : defaultProxyGroup; final Map userGroups = myManager.getGroups(); myRoot.add(createNodeForObject(defaultProxyGroup)); diff --git a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/refactoring/introduceParameter/IntroduceParameterProcessor.java b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/refactoring/introduceParameter/IntroduceParameterProcessor.java index ff3368f26892..00c5220e1e72 100644 --- a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/refactoring/introduceParameter/IntroduceParameterProcessor.java +++ b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/refactoring/introduceParameter/IntroduceParameterProcessor.java @@ -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]; diff --git a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/util/ParamMatcher.java b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/util/ParamMatcher.java index 040be39b55e5..6547c5394e49 100644 --- a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/util/ParamMatcher.java +++ b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/util/ParamMatcher.java @@ -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) { diff --git a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/HistoryElement.java b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/HistoryElement.java index 4e54d3872aa3..cde2e552745b 100644 --- a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/HistoryElement.java +++ b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/HistoryElement.java @@ -40,8 +40,8 @@ public final class HistoryElement implements Copyable { @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) { diff --git a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/search/FindByXPathAction.java b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/search/FindByXPathAction.java index 2ec5b86015f2..cf7e5fbea943 100644 --- a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/search/FindByXPathAction.java +++ b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/search/FindByXPathAction.java @@ -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.emptyList()); return true; } catch (XPathSyntaxException e) { Messages.showErrorDialog(project, e.getMultilineMessage(), "XPath Syntax Error"); diff --git a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/support/jaxen/PsiDocumentNavigator.java b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/support/jaxen/PsiDocumentNavigator.java index e9a78e4fdb11..d01275e1cce3 100644 --- a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/support/jaxen/PsiDocumentNavigator.java +++ b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/support/jaxen/PsiDocumentNavigator.java @@ -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(); } } diff --git a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/support/jaxen/extensions/XPathFunctionProviderImpl.java b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/support/jaxen/extensions/XPathFunctionProviderImpl.java index b7e050cc76c3..b68719d6e198 100644 --- a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/support/jaxen/extensions/XPathFunctionProviderImpl.java +++ b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/support/jaxen/extensions/XPathFunctionProviderImpl.java @@ -74,7 +74,7 @@ class XPathFunctionProviderImpl extends XPathFunctionProvider { return myFunctions; } else { //noinspection unchecked - return Collections.EMPTY_MAP; + return Collections.emptyMap(); } } diff --git a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/ui/InputExpressionDialog.java b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/ui/InputExpressionDialog.java index 1b6d4df97d25..660ce9d01175 100644 --- a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/ui/InputExpressionDialog.java +++ b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/ui/InputExpressionDialog.java @@ -86,7 +86,7 @@ public abstract class InputExpressionDialog extends private final ComboBox myComboBox = new ComboBox(); private JComponent myEditorComponent; - private @Nullable Set myNamespaceCache; + @Nullable private Set myNamespaceCache; private InteractiveContextProvider myContextProvider; private final PsiFile myXPathFile; @@ -163,8 +163,8 @@ public abstract class InputExpressionDialog 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 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 extends if (myNamespaceCache != null) { return Namespace.makeMap(myNamespaceCache); } else { - return Collections.EMPTY_MAP; + return Collections.emptyMap(); } } @@ -397,8 +397,8 @@ public abstract class InputExpressionDialog extends public Context getContext() { final HistoryElement context = myModel.getSelectedItem(); if (context == null || context.expression == null) { - final Set cache = myNamespaceCache != null ? myNamespaceCache : Collections.EMPTY_SET; - return new Context(new HistoryElement(myDocument.getText(), Collections.EMPTY_SET, cache), getMode()); + final Set cache = myNamespaceCache != null ? myNamespaceCache : Collections.emptySet(); + return new Context(new HistoryElement(myDocument.getText(), Collections.emptySet(), cache), getMode()); } final Collection namespaces = myNamespaceCache != null ? @@ -536,8 +536,8 @@ public abstract class InputExpressionDialog extends @Nullable public String getPrefixForURI(String uri, XmlElement context) { - final java.util.List list = myMap.getKeysByValue(uri); - return list != null && list.size() > 0 ? list.get(0) : null; + final List list = myMap.getKeysByValue(uri); + return list != null && !list.isEmpty() ? list.get(0) : null; } @NotNull @@ -617,7 +617,7 @@ public abstract class InputExpressionDialog extends } else { n = Collections.singleton(namespace); //noinspection unchecked - v = Collections.EMPTY_SET; + v = Collections.emptySet(); } updateContext(n, v); diff --git a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/util/HighlighterUtil.java b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/util/HighlighterUtil.java index 556390627531..b4bd76a8d5eb 100644 --- a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/util/HighlighterUtil.java +++ b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/util/HighlighterUtil.java @@ -112,7 +112,7 @@ public class HighlighterUtil { public static List getHighlighters(Editor editor) { if (!hasHighlighters(editor)) { //noinspection unchecked - return Collections.EMPTY_LIST; + return Collections.emptyList(); } else { return editor.getUserData(HIGHLIGHTERS_KEY); } diff --git a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/util/NamespaceCollector.java b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/util/NamespaceCollector.java index 2261f530baae..ef8132b52c2a 100644 --- a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/util/NamespaceCollector.java +++ b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/util/NamespaceCollector.java @@ -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.emptySet(), Collections.emptySet(), Collections.emptySet()); } public static CollectedInfo collectInfo(final XmlFile psiFile) { diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DynamicGenericInfo.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DynamicGenericInfo.java index 57df5b00e52c..3d7aa0ff0930 100644 --- a/xml/dom-impl/src/com/intellij/util/xml/impl/DynamicGenericInfo.java +++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DynamicGenericInfo.java @@ -112,7 +112,13 @@ public class DynamicGenericInfo extends DomGenericInfoEx { if (!collections.isEmpty()) { ChildrenDescriptionsHolder newCollections = new ChildrenDescriptionsHolder(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.emptyList(), + Collections.emptyList(), + Collections.emptyList(), + Collections.emptyList(), + Collections.emptyList(), + Collections.emptyList()))); } clearSubTags = true; myCollections = newCollections; diff --git a/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateInstanceDocumentFromSchemaDialog.java b/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateInstanceDocumentFromSchemaDialog.java index a5e10800417a..44ee2ec0485c 100644 --- a/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateInstanceDocumentFromSchemaDialog.java +++ b/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateInstanceDocumentFromSchemaDialog.java @@ -151,14 +151,14 @@ public class GenerateInstanceDocumentFromSchemaDialog extends DialogWrapper { List myRootValues; if (psifile == null) { - configureComboBox(rootElementChooser, Collections.EMPTY_LIST); + configureComboBox(rootElementChooser, Collections.emptyList()); return; } final XmlTag rootTag = getRootTag(psifile); if (rootTag == null) { - configureComboBox(rootElementChooser, Collections.EMPTY_LIST); + configureComboBox(rootElementChooser, Collections.emptyList()); rootElementChooser.setSelectedIndex(-1); previousUri = uri; return;