diff --git a/platform/lang-impl/src/com/intellij/openapi/roots/libraries/ui/LibraryRootsComponentDescriptor.java b/platform/lang-impl/src/com/intellij/openapi/roots/libraries/ui/LibraryRootsComponentDescriptor.java index 6632914d5b97..e4309604a0d6 100644 --- a/platform/lang-impl/src/com/intellij/openapi/roots/libraries/ui/LibraryRootsComponentDescriptor.java +++ b/platform/lang-impl/src/com/intellij/openapi/roots/libraries/ui/LibraryRootsComponentDescriptor.java @@ -18,7 +18,6 @@ import com.intellij.openapi.roots.OrderRootType; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Collections; import java.util.List; /** @@ -38,13 +37,12 @@ public abstract class LibraryRootsComponentDescriptor { /** * Provides root detectors for 'Attach Files' button. They will be used to automatically assign {@link OrderRootType}s for selected files. + * Also these detectors are used when a new library is created so the list must not be empty. * - * @return list of {@link RootDetector}'s implementations + * @return non-empty list of {@link RootDetector}'s implementations */ @NotNull - public List getRootDetectors() { - return Collections.emptyList(); - } + public abstract List getRootDetectors(); /** * @return descriptor for the file chooser which will be shown when 'Attach Files' button is pressed diff --git a/platform/lang-impl/src/com/intellij/openapi/roots/libraries/ui/RootDetector.java b/platform/lang-impl/src/com/intellij/openapi/roots/libraries/ui/RootDetector.java index 310bb5ccbf55..f19b7e4aac38 100644 --- a/platform/lang-impl/src/com/intellij/openapi/roots/libraries/ui/RootDetector.java +++ b/platform/lang-impl/src/com/intellij/openapi/roots/libraries/ui/RootDetector.java @@ -31,9 +31,9 @@ import java.util.Collection; * @author nik */ public abstract class RootDetector { - private OrderRootType myRootType; - private boolean myJarDirectory; - private String myPresentableRootTypeName; + private final OrderRootType myRootType; + private final boolean myJarDirectory; + private final String myPresentableRootTypeName; protected RootDetector(OrderRootType rootType, boolean jarDirectory, String presentableRootTypeName) { myRootType = rootType;