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) {
return null;
}
- if (cached != null && cached != Collections.EMPTY_LIST) {
+ if (cached != null && cached != Collections.<T>emptyList()) {
if (singleList == null) {
singleList = cached;
continue;
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);
}
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();
myEditor.setState(pair.getState());
return true;
}
-}
\ No newline at end of file
+}
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 {
return result; // TODO: DECIDE IF INNERS SHOULD BE SORTED: sort(result);
}
else {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
}
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);
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) {
private static final int REGEX_COLUMN_COUNT = 25;
public Collection<? extends JComponent> createExtraOptions() {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
@Override
return panel;
}
-}
\ No newline at end of file
+}
final PsiMethod method = (PsiMethod) variableOrMethod;
variableOrMethodType = method.getReturnType();
if (PsiType.VOID.equals(variableOrMethodType)) {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
} else {
throw new IllegalArgumentException(
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();
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);
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 =
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) {
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.
(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();
(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 =
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
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;
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();
}
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);
public List<String> fooBarEmpty()
{
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
public int[] bar()
}
-}
\ No newline at end of file
+}
public static Set<PsiVariable> collectUsedVariables(
PsiElement context) {
if (context == null) {
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
final VariableCollectingVisitor visitor =
new VariableCollectingVisitor();
return usedVariables;
}
}
-}
\ No newline at end of file
+}
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));
return entriesHandler.getEntries().getEntries();
}
catch (FileNotFoundException ex) {
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
}
}
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) {
}
private static Element xppToElement(Xpp3Dom xpp) {
- Element result = null;
+ Element result;
try {
result = new Element(xpp.getName());
}
"<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());
"</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);
"<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);
"</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);
"</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);
"</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"));
"</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"));
"<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());
" <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());
"</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"));
"</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"));
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) {
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);
}
}
});
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);
}
});
}
});
}
- private long getFileTimestamp(VirtualFile file) {
+ private static long getFileTimestamp(VirtualFile file) {
if (file == null || !file.isValid()) return -1;
return file.getTimeStamp();
}
}
}
- public MavenArtifact downloadArtifact(MavenProject mavenProject,
+ public static MavenArtifact downloadArtifact(MavenProject mavenProject,
MavenId id,
MavenEmbeddersManager embeddersManager,
MavenConsole console,
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);
}
}
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) {
}
}
- public static abstract class SimpleVisitor extends Visitor<Object> {
+ public abstract static class SimpleVisitor extends Visitor<Object> {
}
private static class MavenProjectTimestamp {
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
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);
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 {
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)));
}
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");
}
}
assertTrue(actualNames.toString(), actualNames.contains(archetypeId));
}
-}
\ No newline at end of file
+}
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();
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());
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());
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());
assertEquals("ignored: m1 ", myLog);
myLog = "";
- myTree.setIgnoredFilesPatterns(Collections.EMPTY_LIST);
+ myTree.setIgnoredFilesPatterns(Collections.<String>emptyList());
assertEquals("unignored: m1 ", myLog);
myLog = "";
}, ", ");
}
}
-}
\ No newline at end of file
+}
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());
}
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));
usageCount += callsToUpdate.size();
} else {
//noinspection unchecked
- callsToUpdate = Collections.EMPTY_LIST;
+ callsToUpdate = Collections.emptyList();
}
final UsageInfo[] usageInfos = new UsageInfo[usageCount];
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) {
@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) {
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");
}
if (!(contextNode instanceof XmlElement)) {
- return Collections.EMPTY_LIST.iterator();
+ return Collections.emptyList().iterator();
}
return new PsiChildAxisIterator(contextNode);
}
}
if (!(contextNode instanceof XmlElement)) {
- return Collections.EMPTY_LIST.iterator();
+ return Collections.emptyList().iterator();
}
return new NodeIterator((XmlElement)contextNode) {
if (isElement(contextNode)) {
return new AttributeIterator((XmlElement)contextNode);
} else {
- return Collections.EMPTY_LIST.iterator();
+ return Collections.emptyList().iterator();
}
}
return myFunctions;
} else {
//noinspection unchecked
- return Collections.EMPTY_MAP;
+ return Collections.emptyMap();
}
}
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;
n = selectedItem.namespaces;
v = selectedItem.variables;
} else {
- n = Collections.EMPTY_SET;
- v = Collections.EMPTY_SET;
+ n = Collections.emptySet();
+ v = Collections.emptySet();
}
// FIXME
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());
}
if (myNamespaceCache != null) {
return Namespace.makeMap(myNamespaceCache);
} else {
- return Collections.EMPTY_MAP;
+ return Collections.emptyMap();
}
}
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 ?
@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
} else {
n = Collections.singleton(namespace);
//noinspection unchecked
- v = Collections.EMPTY_SET;
+ v = Collections.emptySet();
}
updateContext(n, v);
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);
}
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) {
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;
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;