mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Cleanup (API)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -30,12 +30,8 @@ import java.util.Collection;
|
||||
* @author max
|
||||
*/
|
||||
public interface JavaFileManager {
|
||||
class SERVICE {
|
||||
private SERVICE() { }
|
||||
|
||||
public static JavaFileManager getInstance(@NotNull Project project) {
|
||||
return ServiceManager.getService(project, JavaFileManager.class);
|
||||
}
|
||||
static JavaFileManager getInstance(@NotNull Project project) {
|
||||
return ServiceManager.getService(project, JavaFileManager.class);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -98,7 +98,7 @@ public class PsiJavaModuleReference extends PsiReferenceBase.Poly<PsiJavaModuleR
|
||||
private static Collection<PsiJavaModule> findModules(PsiFile file, String moduleName, boolean incompleteCode) {
|
||||
Project project = file.getProject();
|
||||
GlobalSearchScope scope = incompleteCode ? GlobalSearchScope.allScope(project) : file.getResolveScope();
|
||||
return JavaFileManager.SERVICE.getInstance(project).findModules(moduleName, scope);
|
||||
return JavaFileManager.getInstance(project).findModules(moduleName, scope);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ class ModuleRenameTest : LightJava9ModulesCodeInsightFixtureTestCase() {
|
||||
|
||||
fun testRename() {
|
||||
myFixture.configureByText("module-info.java", "module M { requires M2; }")
|
||||
val module = JavaFileManager.SERVICE.getInstance(project).findModules("M2", GlobalSearchScope.allScope(project)).first()
|
||||
val module = JavaFileManager.getInstance(project).findModules("M2", GlobalSearchScope.allScope(project)).first()
|
||||
RenameProcessor(project, module, "M2.bis", false, false).run()
|
||||
myFixture.checkResult("module M { requires M2.bis; }")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user