Small refactoring: add NN and extract variable
This commit is contained in:
@@ -88,7 +88,7 @@ public class ConfigureKotlinInProjectUtils {
|
||||
showConfigureKotlinNotification(project);
|
||||
}
|
||||
|
||||
private static void showConfigureKotlinNotification(final Project project) {
|
||||
private static void showConfigureKotlinNotification(@NotNull final Project project) {
|
||||
Notifications.Bus.notify(
|
||||
new Notification("Configure Kotlin",
|
||||
"Kotlin files found in your project.",
|
||||
|
||||
@@ -77,7 +77,7 @@ public class KotlinMavenConfigurator implements KotlinProjectConfigurator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configure(Project project) {
|
||||
public void configure(@NotNull Project project) {
|
||||
List<Module> nonConfiguredModules = ConfigureKotlinInProjectUtils.getNonConfiguredModules(project, this);
|
||||
|
||||
ConfigureDialogWithModulesAndVersion dialog =
|
||||
|
||||
@@ -12,7 +12,7 @@ public interface KotlinProjectConfigurator {
|
||||
|
||||
boolean isApplicable(@NotNull Module module);
|
||||
|
||||
void configure(Project project);
|
||||
void configure(@NotNull Project project);
|
||||
|
||||
@NotNull String getPresentableText();
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ public abstract class KotlinWithGradleConfigurator implements KotlinProjectConfi
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configure(Project project) {
|
||||
public void configure(@NotNull Project project) {
|
||||
List<Module> nonConfiguredModules = ConfigureKotlinInProjectUtils.getNonConfiguredModules(project, this);
|
||||
|
||||
ConfigureDialogWithModulesAndVersion dialog =
|
||||
|
||||
@@ -211,12 +211,13 @@ public abstract class KotlinWithLibraryConfigurator implements KotlinProjectConf
|
||||
|
||||
private static void addSourcesToLibraryIfNeeded(@NotNull Library library, @NotNull File file) {
|
||||
String[] librarySourceRoots = library.getUrls(OrderRootType.SOURCES);
|
||||
String librarySourceRoot = VfsUtil.getUrlForLibraryRoot(file);
|
||||
for (String sourceRoot : librarySourceRoots) {
|
||||
if (sourceRoot.equals(VfsUtil.getUrlForLibraryRoot(file))) return;
|
||||
if (sourceRoot.equals(librarySourceRoot)) return;
|
||||
}
|
||||
|
||||
final Library.ModifiableModel model = library.getModifiableModel();
|
||||
model.addRoot(VfsUtil.getUrlForLibraryRoot(file), OrderRootType.SOURCES);
|
||||
model.addRoot(librarySourceRoot, OrderRootType.SOURCES);
|
||||
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user