diff --git a/project.libraries/apichanges.xml b/project.libraries/apichanges.xml --- a/project.libraries/apichanges.xml +++ b/project.libraries/apichanges.xml @@ -107,7 +107,20 @@ - + + + Added a new factory method to create default implementation of LibraryImplementation3 + + + + + + Added a new factory method to create default implementation of LibraryImplementation3. + + + + + Added methods to create a new Library with properties diff --git a/project.libraries/manifest.mf b/project.libraries/manifest.mf --- a/project.libraries/manifest.mf +++ b/project.libraries/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.project.libraries/1 OpenIDE-Module-Layer: org/netbeans/modules/project/libraries/resources/mf-layer.xml -OpenIDE-Module-Specification-Version: 1.38 +OpenIDE-Module-Specification-Version: 1.39 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/libraries/resources/Bundle.properties AutoUpdate-Show-In-Client: false diff --git a/project.libraries/src/org/netbeans/modules/project/libraries/DefaultLibraryImplementation.java b/project.libraries/src/org/netbeans/modules/project/libraries/DefaultLibraryImplementation.java --- a/project.libraries/src/org/netbeans/modules/project/libraries/DefaultLibraryImplementation.java +++ b/project.libraries/src/org/netbeans/modules/project/libraries/DefaultLibraryImplementation.java @@ -77,11 +77,15 @@ /** * Create new LibraryImplementation supporting given library. */ - public DefaultLibraryImplementation (String libraryType, String[] volumeTypes) { - assert libraryType != null && volumeTypes != null; + public DefaultLibraryImplementation ( + @NonNull final String libraryType, + @NonNull final String[] volumeTypes) { + Parameters.notNull("libraryType", libraryType); //NOI18N + Parameters.notNull("volumeTypes", volumeTypes); //NOI18N this.libraryType = libraryType; this.contents = new HashMap>(); for (String vtype : volumeTypes) { + Parameters.notNull("volumeTypes", vtype); //NOI18N this.contents.put(vtype, Collections.emptyList()); } } diff --git a/project.libraries/src/org/netbeans/spi/project/libraries/support/LibrariesSupport.java b/project.libraries/src/org/netbeans/spi/project/libraries/support/LibrariesSupport.java --- a/project.libraries/src/org/netbeans/spi/project/libraries/support/LibrariesSupport.java +++ b/project.libraries/src/org/netbeans/spi/project/libraries/support/LibrariesSupport.java @@ -52,6 +52,7 @@ import org.netbeans.modules.project.libraries.LibraryTypeRegistry; import org.netbeans.spi.project.libraries.LibraryImplementation; import org.netbeans.modules.project.libraries.DefaultLibraryImplementation; +import org.netbeans.spi.project.libraries.LibraryImplementation3; import org.netbeans.spi.project.libraries.LibraryTypeProvider; import org.openide.filesystems.FileObject; import org.openide.filesystems.URLMapper; @@ -68,6 +69,19 @@ private LibrariesSupport () { } + /** + * Creates default {@link LibraryImplementation3} + * @param libraryType type of library + * @param volumeTypes types of supported volumes + * @return LibraryImplementation3 + * @since 1.39 + */ + @NonNull + public static LibraryImplementation3 createLibraryImplementation3 ( + @NonNull final String libraryType, + @NonNull final String[] volumeTypes) { + return new DefaultLibraryImplementation (libraryType, volumeTypes); + } /** * Creates default LibraryImplementation @@ -76,7 +90,7 @@ * @return LibraryImplementation, never return null */ public static LibraryImplementation createLibraryImplementation (String libraryType, String[] volumeTypes) { - return new DefaultLibraryImplementation (libraryType, volumeTypes); + return createLibraryImplementation3(libraryType, volumeTypes); } /**