Skip to content
Merged
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public static LocalizedBundleInfo findLocalizedBundleInfo(FileObject sourceDir,
}
if (!bundleFOs.isEmpty()) {
Collections.reverse(bundleFOs);
return LocalizedBundleInfo.load(bundleFOs.toArray(new FileObject[bundleFOs.size()]));
return LocalizedBundleInfo.load(bundleFOs.toArray(new FileObject[0]));
}
}
} catch (IOException e) {
Expand Down Expand Up @@ -264,7 +264,7 @@ public static LocalizedBundleInfo findLocalizedBundleInfoFromJAR(File binaryProj
addBundlesFromJar(main, bundleISs, locBundleResource);
if (!bundleISs.isEmpty()) {
Collections.reverse(bundleISs);
return LocalizedBundleInfo.load(bundleISs.toArray(new InputStream[bundleISs.size()]));
return LocalizedBundleInfo.load(bundleISs.toArray(new InputStream[0]));
}
} finally {
for (InputStream bundleIS : bundleISs) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ private PropertyEvaluator createEvaluator(ModuleList ml) {
String codeNameBase = project.getCodeNameBase();
PropertyEvaluator suiteEval = null;
if (type == NbModuleType.SUITE_COMPONENT) {
suiteEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[providers.size()]));
suiteEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[0]));
}

if (type == NbModuleType.SUITE_COMPONENT) {
Expand All @@ -368,9 +368,9 @@ private PropertyEvaluator createEvaluator(ModuleList ml) {
providers.add(project.getHelper().getPropertyProvider("nbproject/platform.properties")); // NOI18N
}
if (type == NbModuleType.SUITE_COMPONENT || type == NbModuleType.STANDALONE) {
PropertyEvaluator baseEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[providers.size()]));
PropertyEvaluator baseEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[0]));
providers.add(new ApisupportAntUtils.UserPropertiesFileProvider(baseEval, dir));
baseEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[providers.size()]));
baseEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[0]));
providers.add(new DestDirProvider(baseEval));
}
if (type == NbModuleType.NETBEANS_ORG) {
Expand All @@ -380,7 +380,7 @@ private PropertyEvaluator createEvaluator(ModuleList ml) {
providers.add(PropertyUtils.propertiesFilePropertyProvider(new File(nbbuild, "site.build.properties"))); // NOI18N
providers.add(PropertyUtils.propertiesFilePropertyProvider(new File(System.getProperty("user.home"), ".nbbuild.properties"))); // NOI18N
}
PropertyEvaluator baseEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[providers.size()]));
PropertyEvaluator baseEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[0]));
providers.add(new NbJdkProvider(baseEval));
providers.add(privateProperties);
providers.add(projectProperties);
Expand Down Expand Up @@ -445,7 +445,7 @@ private PropertyEvaluator createEvaluator(ModuleList ml) {
}
}

baseEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[providers.size()]));
baseEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[0]));

Map<String,TestClasspath> testsCPs = computeTestingClassPaths(ml, baseEval, testTypes);
testTypes.addAll(testsCPs.keySet());
Expand All @@ -463,7 +463,7 @@ private PropertyEvaluator createEvaluator(ModuleList ml) {
providers.add(PropertyUtils.fixedPropertyProvider(buildDefaults));
}
// skip a bunch of properties irrelevant here - NBM stuff, etc.
return PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[providers.size()]));
return PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[0]));
}

private static final RequestProcessor RP = new RequestProcessor(Evaluator.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class NbModuleProviderImpl implements NbModuleProvider {
}
XMLFileSystem xfs = new XMLFileSystem();
try {
xfs.setXmlUrls(otherLayerURLs.toArray(new URL[otherLayerURLs.size()]));
xfs.setXmlUrls(otherLayerURLs.toArray(new URL[0]));
} catch (PropertyVetoException ex) {
assert false : ex;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ public String[] getFriends() {
public String[] getBinaryOrigins() {
Set<String> origins = new LinkedHashSet<String>(getClassPathExtensions().values());
origins.remove(null);
return origins.toArray(new String[origins.size()]);
return origins.toArray(new String[0]);
}

/**
Expand Down Expand Up @@ -981,7 +981,7 @@ public static ManifestManager.PackageExport[] findPublicPackages(final Element c
if (ppEl != null) {
pps.addAll(findAllPackages(ppEl));
}
return pps.isEmpty() ? ManifestManager.EMPTY_EXPORTED_PACKAGES : pps.toArray(new ManifestManager.PackageExport[pps.size()]);
return pps.isEmpty() ? ManifestManager.EMPTY_EXPORTED_PACKAGES : pps.toArray(new ManifestManager.PackageExport[0]);
}

/** Utility method for finding friend. */
Expand All @@ -994,7 +994,7 @@ public static String[] findFriends(final Element confData) {
friends.add(XMLUtil.findText(friendEl));
}
}
return friends.toArray(new String[friends.size()]);
return friends.toArray(new String[0]);
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ public ClassPath[] getProjectClassPaths(String type) {
paths.add(ClassPathSupport.createClassPath(new FileObject[] {root}));
}
}
return paths.toArray(new ClassPath[paths.size()]);
return paths.toArray(new ClassPath[0]);
}

private static final class FilteredClassPathImplementation implements ClassPathImplementation, PropertyChangeListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ private Result findByDashedCNB(final String cnbdashes, final URL[] roots, boolea
}
return new JavadocForBinaryQuery.Result() {
public @Override URL[] getRoots() {
return candidates.toArray(new URL[candidates.size()]);
return candidates.toArray(new URL[0]);
}
public @Override void addChangeListener(ChangeListener l) {}
public @Override void removeChangeListener(ChangeListener l) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public FileObject[] getRoots() {
} catch (IOException ex) {
throw new AssertionError(ex);
}
return candidates.toArray(new FileObject[candidates.size()]);
return candidates.toArray(new FileObject[0]);
}

protected abstract String resolveRelativePath(URL sourceRoot) throws IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public JavadocForBinaryQuery.Result findJavadoc(URL binaryRoot) {
}
}
}
return new R(candidates.toArray(new URL[candidates.size()]));
return new R(candidates.toArray(new URL[0]));
} catch (MalformedURLException e) {
throw new AssertionError(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ protected SourceGroup[] getExtensibleSourceGroups() {
sgs.add(g);
}
}
return sgs.toArray(new SourceGroup[sgs.size()]);
return sgs.toArray(new SourceGroup[0]);
}

protected String[] getExtensibleClassPathTypes(SourceGroup sourceGroup) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ private PropertyEvaluator createEvaluator() {
List<PropertyProvider> providers = new ArrayList<PropertyProvider>();
providers.add(helper.getPropertyProvider("nbproject/private/platform-private.properties")); // NOI18N
providers.add(helper.getPropertyProvider("nbproject/platform.properties")); // NOI18N
PropertyEvaluator baseEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[providers.size()]));
PropertyEvaluator baseEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[0]));
providers.add(new ApisupportAntUtils.UserPropertiesFileProvider(baseEval, dir));
baseEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[providers.size()]));
baseEval = PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[0]));
providers.add(new DestDirProvider(baseEval));
providers.add(helper.getPropertyProvider(AntProjectHelper.PRIVATE_PROPERTIES_PATH));
providers.add(helper.getPropertyProvider(AntProjectHelper.PROJECT_PROPERTIES_PATH));
Expand All @@ -205,7 +205,7 @@ private PropertyEvaluator createEvaluator() {
fixedProps.put("dist.dir", "dist"); // NOI18N
fixedProps.put("test.user.dir", "${suite.build.dir}/testuserdir"); // NOI18N
providers.add(PropertyUtils.fixedPropertyProvider(fixedProps));
return PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[providers.size()]));
return PropertyUtils.sequentialPropertyEvaluator(predefs, providers.toArray(new PropertyProvider[0]));
}

private final class Info implements ProjectInformation, AntProjectListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private Action[] initActions() {
}
}
}
actionCache = result.toArray(new Action[result.size()]);
actionCache = result.toArray(new Action[0]);
}
return actionCache;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ protected Node[] createNodes(Object key) {
nodes.add(createLibraryPackageViewNode(jar));
}
}
return nodes.toArray(new Node[nodes.size()]);
return nodes.toArray(new Node[0]);
}

private Node createLibraryPackageViewNode(FileObject jfo) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public void refresh() {
supportedActionsSet.add(ActionProvider.COMMAND_MOVE);
supportedActionsSet.add(ActionProvider.COMMAND_COPY);
supportedActionsSet.add(ActionProvider.COMMAND_DELETE);
supportedActions = supportedActionsSet.toArray(new String[supportedActionsSet.size()]);
supportedActions = supportedActionsSet.toArray(new String[0]);
}

public String[] getSupportedActions() {
Expand Down Expand Up @@ -362,7 +362,7 @@ TestSources findTestSourcesForSources(Lookup context) {
if (testFOs.isEmpty()) {
return null;
}
return new TestSources(testFOs.toArray(new FileObject[testFOs.size()]), testType, testSrcDir, null);
return new TestSources(testFOs.toArray(new FileObject[0]), testType, testSrcDir, null);
}
}
}
Expand Down Expand Up @@ -407,7 +407,7 @@ TestSources findTestSourcesForFiles(Lookup context) {
}
}
}
return testFiles.isEmpty() ? null : new TestSources(testFiles.toArray(new FileObject[testFiles.size()]), testType, testRoot, null);
return testFiles.isEmpty() ? null : new TestSources(testFiles.toArray(new FileObject[0]), testType, testRoot, null);
}

@Messages("MSG_no_source=No source to operate on.")
Expand Down Expand Up @@ -441,11 +441,7 @@ public void invokeAction(final String command, final Lookup context) throws Ille
doRun();
} finally {
if (task != null) {
task.addTaskListener(new TaskListener() {
@Override public void taskFinished(Task _) {
listener.finished(task.result() == 0);
}
});
task.addTaskListener((Task t) -> listener.finished(task.result() == 0));
} else {
listener.finished(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ private static URL[] getJavadocRoots(JavaPlatform platform) {
ClassPath.Entry e = it.next();
result.addAll(Arrays.asList(JavadocForBinaryQuery.findJavadoc(e.getURL()).getRoots()));
}
return result.toArray(new URL[result.size()]);
return result.toArray(new URL[0]);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ public String[] getSupportedActions() {
ActionProvider.COMMAND_MOVE,
ActionProvider.COMMAND_DELETE
));
return actions.toArray(new String[actions.size()]);
return actions.toArray(new String[0]);
}

public boolean isActionEnabled(String command, Lookup context) throws IllegalArgumentException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public Void call () throws Exception {
}

});
OpenProjects.getDefault().open(toOpen.toArray(new Project[toOpen.size()]), false);
OpenProjects.getDefault().open(toOpen.toArray(new Project[0]), false);
}
boolean isRename = original.getProjectDirectory().getParent().equals(
suite.getProjectDirectory().getParent());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ private Image getIcon(boolean opened) {
actions.add(new AddJUnit4Action(testType, project));
}
actions.add(new AddUnitTestDependencyAction(testType, project));
return actions.toArray(new Action[actions.size()]);
return actions.toArray(new Action[0]);
}

@Messages("HINT_missing_junit4=Incomplete test libraries. Use context menu to resolve.")
Expand Down Expand Up @@ -326,7 +326,7 @@ private static final class ProjectDependencyNode extends AbstractNode {
result.add(new EditTestDependencyAction(dep, testType, project));
// Remove dependency
result.add(LibrariesChildren.REMOVE_DEPENDENCY_ACTION);
actions = result.toArray(new Action[result.size()]);
actions = result.toArray(new Action[0]);
}
return actions;
}
Expand Down Expand Up @@ -379,7 +379,7 @@ private static final class LibraryDependencyNode extends FilterNode {
}
}
result.add(LibrariesChildren.REMOVE_DEPENDENCY_ACTION);
actions = result.toArray(new Action[result.size()]);
actions = result.toArray(new Action[0]);
}
return actions;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ private void addJarButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-
newPaths.add (path);
}

filePaths = newPaths.toArray (new String [newPaths.size ()]);
filePaths = newPaths.toArray (new String [0]);
final DefaultListModel model = getProperties().getWrappedJarsListModel();
int[] newSelection = ClassPathUiSupport.addJarFiles(model,emListComp.getSelectedIndices(),
filePaths, base,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ String[] getAvailableFriends() {
set.add(dep.getModuleEntry().getCodeNameBase());
}
} // else standalone module - leave empty (see the UI spec)
return set.toArray(new String[set.size()]);
return set.toArray(new String[0]);
}

FriendListModel getFriendListModel() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ public void store() {
}

if (oldPlaf) {
getProperties().setEnabledClusters(enabledClusters.toArray(new String[enabledClusters.size()]));
getProperties().setEnabledClusters(enabledClusters.toArray(new String[0]));
} else {
for (ClusterNode e : libChildren.extraNodes()) {
clusterPath.add(e.getClusterInfo());
Expand All @@ -447,7 +447,7 @@ public void store() {
}
getProperties().setClusterPath(clusterPath);
}
getProperties().setDisabledModules(disabledModules.toArray(new String[disabledModules.size()]));
getProperties().setDisabledModules(disabledModules.toArray(new String[0]));
}

/** This method is called from within the constructor to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ public static String[] getArrayProperty(PropertyEvaluator evaluator, String p) {
disabledClusters.add(entry.getClusterDirectory().getName());
}
disabledClusters.removeAll(Arrays.asList(enabledClusters));
separated = disabledClusters.toArray(new String[disabledClusters.size()]);
separated = disabledClusters.toArray(new String[0]);
for (int i = 0; i < separated.length - 1; i++) {
separated[i] = separated[i] + ',';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public NbModuleProject[] run() throws Exception {
}
}
}
return result.toArray(new NbModuleProject[result.size()]);
return result.toArray(new NbModuleProject[0]);
}
});
} catch (MutexException e) {
Expand Down Expand Up @@ -431,7 +431,7 @@ public static String[] getAntProperty(final Collection<String> pieces) {
String piece = it.next() + (it.hasNext() ? ":" : ""); // NOI18N
l.add(piece);
}
return l.toArray(new String[l.size()]);
return l.toArray(new String[0]);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private static NbPlatform[] getSortedPlatforms(NbPlatform extra) {
if (extra != null) {
_platforms.add(extra);
}
NbPlatform[] platforms = _platforms.toArray(new NbPlatform[_platforms.size()]);
NbPlatform[] platforms = _platforms.toArray(new NbPlatform[0]);
Arrays.sort(platforms, new Comparator<NbPlatform>() {
public int compare(NbPlatform p1, NbPlatform p2) {
int res = Collator.getInstance().compare(p1.getLabel(), p2.getLabel());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ abstract class AbstractBinaryEntry extends AbstractEntry {
deps.add(codename.substring(0, slash));
}
}
runDependencies = deps.toArray(new String[deps.size()]);
runDependencies = deps.toArray(new String[0]);
}

public String getNetBeansOrgPath() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public String[] getRunDependencies() {
String cnb = XMLUtil.findText(cnbEl);
deps.add(cnb);
}
return deps.toArray(new String[deps.size()]);
return deps.toArray(new String[0]);
}

public String getSpecificationVersion() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ private static String[] splitBySentence(String text) {
sentences.add(text.substring(start, end));
start = end;
}
return sentences.toArray(new String[sentences.size()]);
return sentences.toArray(new String[0]);
}

public void addPropertyChangeListener(PropertyChangeListener pchl) {
Expand Down
Loading