Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/models/ModelTestCase.java2
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/models/SampleResourceMapping.java2
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/CommitOperationTest.java2
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/PushOperationTest.java2
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/TrackUntrackOperationTest.java4
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/GitProjectSetCapability.java4
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryCache.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCache.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCacheEntry.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/job/RuleUtil.java4
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/CommitFileRevision.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ProjectUtil.java8
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ResourceUtil.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/AddToIndexOperation.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/AssumeUnchangedOperation.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/ConnectProviderOperation.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/DisconnectProviderOperation.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/UntrackOperation.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitLazyResourceVariantTreeSubscriber.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitRemoteFolder.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitResourceVariantTree.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeSubscriber.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/dto/GitSynchronizeDataSet.java2
-rw-r--r--org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/CommitHyperlinkDetector.java2
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java2
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/MockLogicalResourceMapping.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIUtils.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushMenu.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryActionHandler.java8
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchProjectTracker.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCreateProjectViaWizardWizard.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitImportWizard.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitProjectsImportPage.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitProposalProcessor.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitUI.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffEditorPage.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffViewer.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/StashEditorPage.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/CachedCheckboxTreeViewer.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositoryMenuUtil.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositorySelectionPage.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitDocument.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/ProblemLabelDecorator.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CompareTreeView.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/HyperlinkTokenScanner.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitFileDiffViewer.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitMessageViewer.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitSelectionDialog.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/HistoryPageInput.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/merge/GitCompareEditorInput.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/merge/MergeResultDialog.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/operations/GitScopeUtil.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/ConfigurationEditorComponent.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/GlobalConfigurationPreferencePage.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/pull/PullOperationUI.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushTagsPage.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushToGerritPage.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/RefUpdateElement.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryDragAssistant.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryRemotePropertySource.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SynchronizeCommand.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingViewContentProvider.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitModelSynchronize.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitModelSynchronizeParticipant.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitSynchronizeWizardPage.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/ModelAwareGitSynchronizer.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/mapping/GitContainerMapping.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/mapping/GitTreeTraversal.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelRepository.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelRoot.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelTree.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/TreeBuilder.java2
76 files changed, 99 insertions, 99 deletions
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/models/ModelTestCase.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/models/ModelTestCase.java
index 9c602c80b..a66dae237 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/models/ModelTestCase.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/models/ModelTestCase.java
@@ -157,7 +157,7 @@ public abstract class ModelTestCase extends GitTestCase {
}
} while (includedResources.addAll(newResources));
ResourceMapping[] mappings = allMappings
- .toArray(new ResourceMapping[allMappings.size()]);
+ .toArray(new ResourceMapping[0]);
GitSynchronizeData gsd = new GitSynchronizeData(repository, srcRev,
dstRev, true, includedResources);
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/models/SampleResourceMapping.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/models/SampleResourceMapping.java
index b00771fdb..1fe9a8e0f 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/models/SampleResourceMapping.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/models/SampleResourceMapping.java
@@ -58,7 +58,7 @@ public class SampleResourceMapping extends ResourceMapping {
}
}
final IResource[] resourceArray = sampleSiblings
- .toArray(new IResource[sampleSiblings.size()]);
+ .toArray(new IResource[0]);
return new ResourceTraversal[] { new ResourceTraversal(
resourceArray, IResource.DEPTH_ONE, IResource.NONE), };
}
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/CommitOperationTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/CommitOperationTest.java
index 0ff0f3b3f..e3a396821 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/CommitOperationTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/CommitOperationTest.java
@@ -242,7 +242,7 @@ public class CommitOperationTest extends GitTestCase {
ArrayList<String> result = new ArrayList<String>();
for (IFile file:files)
result.add(file.getProjectRelativePath().toString());
- return result.toArray(new String[result.size()]);
+ return result.toArray(new String[0]);
}
@Test
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/PushOperationTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/PushOperationTest.java
index e1296307c..2361b57b5 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/PushOperationTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/PushOperationTest.java
@@ -135,7 +135,7 @@ public class PushOperationTest extends DualRepositoryTestCase {
IFile newFile = testUtils.addFileToProject(proj, "folder2/file2.txt",
"New file");
files.add(newFile);
- IFile[] fileArr = files.toArray(new IFile[files.size()]);
+ IFile[] fileArr = files.toArray(new IFile[0]);
AddToIndexOperation trop = new AddToIndexOperation(files);
trop.execute(null);
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/TrackUntrackOperationTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/TrackUntrackOperationTest.java
index 36c1b9769..57712b857 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/TrackUntrackOperationTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/TrackUntrackOperationTest.java
@@ -81,7 +81,7 @@ public class TrackUntrackOperationTest extends DualRepositoryTestCase {
}
});
- IFile[] fileArr = files.toArray(new IFile[files.size()]);
+ IFile[] fileArr = files.toArray(new IFile[0]);
assertTrackedState(fileArr, false);
@@ -127,7 +127,7 @@ public class TrackUntrackOperationTest extends DualRepositoryTestCase {
}
});
- IFile[] fileArr = files.toArray(new IFile[files.size()]);
+ IFile[] fileArr = files.toArray(new IFile[0]);
assertTrackedState(fileArr, false);
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/GitProjectSetCapability.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/GitProjectSetCapability.java
index 2dc7e149a..91193cd7b 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/GitProjectSetCapability.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/GitProjectSetCapability.java
@@ -57,7 +57,7 @@ public final class GitProjectSetCapability extends ProjectSetCapability {
references.add(reference);
}
}
- return references.toArray(new String[references.size()]);
+ return references.toArray(new String[0]);
}
@Nullable
@@ -127,7 +127,7 @@ public final class GitProjectSetCapability extends ProjectSetCapability {
throw TeamException.asTeamException(e);
}
final IProject[] result = importedProjects
- .toArray(new IProject[importedProjects.size()]);
+ .toArray(new IProject[0]);
return result;
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryCache.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryCache.java
index fce07cd33..1438b6cce 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryCache.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryCache.java
@@ -98,7 +98,7 @@ public class RepositoryCache {
}
}
}
- return repositories.toArray(new Repository[repositories.size()]);
+ return repositories.toArray(new Repository[0]);
}
/**
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCache.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCache.java
index 45f0f387d..8bb7a15ef 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCache.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCache.java
@@ -278,7 +278,7 @@ public class IndexDiffCache {
IndexDiffChangedListener[] tmpListeners;
synchronized (listeners) {
tmpListeners = listeners
- .toArray(new IndexDiffChangedListener[listeners.size()]);
+ .toArray(new IndexDiffChangedListener[0]);
}
for (int i = 0; i < tmpListeners.length; i++) {
try {
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCacheEntry.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCacheEntry.java
index 38acc95c8..b4b8e2b18 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCacheEntry.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCacheEntry.java
@@ -654,7 +654,7 @@ public class IndexDiffCacheEntry {
IndexDiffChangedListener[] tmpListeners;
synchronized (listeners) {
tmpListeners = listeners
- .toArray(new IndexDiffChangedListener[listeners.size()]);
+ .toArray(new IndexDiffChangedListener[0]);
}
for (int i = 0; i < tmpListeners.length; i++)
try {
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/job/RuleUtil.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/job/RuleUtil.java
index fe7896e54..ca2046029 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/job/RuleUtil.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/job/RuleUtil.java
@@ -120,7 +120,7 @@ public class RuleUtil {
if (rules.size() == 0)
return null;
else
- return new MultiRule(rules.toArray(new ISchedulingRule[rules.size()]));
+ return new MultiRule(rules.toArray(new ISchedulingRule[0]));
}
/**
@@ -163,7 +163,7 @@ public class RuleUtil {
result.add(p);
}
}
- return result.toArray(new IProject[result.size()]);
+ return result.toArray(new IProject[0]);
}
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/CommitFileRevision.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/CommitFileRevision.java
index 678de90f4..aa8f4bf37 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/CommitFileRevision.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/CommitFileRevision.java
@@ -127,7 +127,7 @@ public class CommitFileRevision extends GitFileRevision implements
continue;
ret.add(new GitTag(tag.getKey()));
}
- return ret.toArray(new ITag[ret.size()]);
+ return ret.toArray(new ITag[0]);
}
/**
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ProjectUtil.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ProjectUtil.java
index ad01f32f9..5b71eb344 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ProjectUtil.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ProjectUtil.java
@@ -90,7 +90,7 @@ public class ProjectUtil {
result.add(p);
}
}
- return result.toArray(new IProject[result.size()]);
+ return result.toArray(new IProject[0]);
}
/**
@@ -306,7 +306,7 @@ public class ProjectUtil {
result.add(project);
}
}
- return result.toArray(new IProject[result.size()]);
+ return result.toArray(new IProject[0]);
}
/**
@@ -342,7 +342,7 @@ public class ProjectUtil {
}
}
- return result.toArray(new IProject[result.size()]);
+ return result.toArray(new IProject[0]);
}
/**
@@ -427,7 +427,7 @@ public class ProjectUtil {
projects.add(p);
}
}
- return projects.toArray(new IProject[projects.size()]);
+ return projects.toArray(new IProject[0]);
}
/**
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ResourceUtil.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ResourceUtil.java
index 1db64fb97..085e3002d 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ResourceUtil.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ResourceUtil.java
@@ -655,7 +655,7 @@ public class ResourceUtil {
Activator.logError(e.getMessage(), e);
}
}
- return mappings.toArray(new ResourceMapping[mappings.size()]);
+ return mappings.toArray(new ResourceMapping[0]);
}
/**
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/AddToIndexOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/AddToIndexOperation.java
index 7a2df9231..6c8451a5d 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/AddToIndexOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/AddToIndexOperation.java
@@ -88,7 +88,7 @@ public class AddToIndexOperation implements IEGitOperation {
*/
@Override
public ISchedulingRule getSchedulingRule() {
- return RuleUtil.getRuleForRepositories(rsrcList.toArray(new IResource[rsrcList.size()]));
+ return RuleUtil.getRuleForRepositories(rsrcList.toArray(new IResource[0]));
}
private void addToCommand(IResource resource, Map<RepositoryMapping, AddCommand> addCommands) {
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/AssumeUnchangedOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/AssumeUnchangedOperation.java
index 5b4e7aa67..8bc6e90cf 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/AssumeUnchangedOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/AssumeUnchangedOperation.java
@@ -134,7 +134,7 @@ public class AssumeUnchangedOperation implements IEGitOperation {
@Override
public ISchedulingRule getSchedulingRule() {
- return RuleUtil.getRuleForRepositories(rsrcList.toArray(new IResource[rsrcList.size()]));
+ return RuleUtil.getRuleForRepositories(rsrcList.toArray(new IResource[0]));
}
private void assumeValid(final IResource resource) throws CoreException {
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java
index 9787c776a..562f2b69f 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java
@@ -274,6 +274,6 @@ public class BranchOperation extends BaseOperation {
} catch (IOException e) {
return new IProject[0];
}
- return toBeClosed.toArray(new IProject[toBeClosed.size()]);
+ return toBeClosed.toArray(new IProject[0]);
}
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/ConnectProviderOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/ConnectProviderOperation.java
index 74d10b77d..8d9ffdb72 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/ConnectProviderOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/ConnectProviderOperation.java
@@ -305,7 +305,7 @@ public class ConnectProviderOperation implements IEGitOperation {
@Override
public ISchedulingRule getSchedulingRule() {
Set<IProject> projectSet = projects.keySet();
- return new MultiRule(projectSet.toArray(new IProject[projectSet.size()]));
+ return new MultiRule(projectSet.toArray(new IProject[0]));
}
/**
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/DisconnectProviderOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/DisconnectProviderOperation.java
index 84f491977..47a624a5f 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/DisconnectProviderOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/DisconnectProviderOperation.java
@@ -67,7 +67,7 @@ public class DisconnectProviderOperation implements IEGitOperation {
@Override
public ISchedulingRule getSchedulingRule() {
- return new MultiRule(projectList.toArray(new IProject[projectList.size()]));
+ return new MultiRule(projectList.toArray(new IProject[0]));
}
private void unmarkTeamPrivate(final IContainer p) throws CoreException {
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/UntrackOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/UntrackOperation.java
index 3289f44d5..34bc1d35e 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/UntrackOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/UntrackOperation.java
@@ -127,7 +127,7 @@ public class UntrackOperation implements IEGitOperation {
@Override
public ISchedulingRule getSchedulingRule() {
- return RuleUtil.getRuleForRepositories(rsrcList.toArray(new IResource[rsrcList.size()]));
+ return RuleUtil.getRuleForRepositories(rsrcList.toArray(new IResource[0]));
}
private void remove(final IResource resource) throws CoreException {
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitLazyResourceVariantTreeSubscriber.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitLazyResourceVariantTreeSubscriber.java
index 47c9541e0..288bda587 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitLazyResourceVariantTreeSubscriber.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitLazyResourceVariantTreeSubscriber.java
@@ -137,7 +137,7 @@ public class GitLazyResourceVariantTreeSubscriber
} catch (CoreException e) {
Activator.logError(e.getMessage(), e);
}
- return projects.toArray(new IResource[projects.size()]);
+ return projects.toArray(new IResource[0]);
}
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitRemoteFolder.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitRemoteFolder.java
index 98d92dc5c..801b36fae 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitRemoteFolder.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitRemoteFolder.java
@@ -106,7 +106,7 @@ class GitRemoteFolder extends GitRemoteResource {
monitor.done();
}
- return result.toArray(new GitRemoteResource[result.size()]);
+ return result.toArray(new GitRemoteResource[0]);
}
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitResourceVariantTree.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitResourceVariantTree.java
index 5649d11e7..4c9ade911 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitResourceVariantTree.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitResourceVariantTree.java
@@ -65,7 +65,7 @@ abstract class GitResourceVariantTree extends ResourceVariantTree {
for (IResource resource : gsd.getIncludedResources())
roots.add(resource.getProject());
- return roots.toArray(new IResource[roots.size()]);
+ return roots.toArray(new IResource[0]);
}
/**
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeSubscriber.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeSubscriber.java
index 4aa4d10c0..b6f35b057 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeSubscriber.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeSubscriber.java
@@ -181,7 +181,7 @@ public class GitResourceVariantTreeSubscriber extends
throw TeamException.asTeamException(e);
}
- return allMembers.toArray(new IResource[allMembers.size()]);
+ return allMembers.toArray(new IResource[0]);
}
@Override
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/dto/GitSynchronizeDataSet.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/dto/GitSynchronizeDataSet.java
index 3e2139991..b40de828e 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/dto/GitSynchronizeDataSet.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/dto/GitSynchronizeDataSet.java
@@ -130,7 +130,7 @@ public class GitSynchronizeDataSet implements Iterable<GitSynchronizeData> {
for (GitSynchronizeData data : gsdSet) {
resource.addAll(data.getProjects());
}
- return resource.toArray(new IProject[resource.size()]);
+ return resource.toArray(new IProject[0]);
}
/**
diff --git a/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/CommitHyperlinkDetector.java b/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/CommitHyperlinkDetector.java
index bdde07344..5e8614445 100644
--- a/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/CommitHyperlinkDetector.java
+++ b/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/CommitHyperlinkDetector.java
@@ -219,7 +219,7 @@ public class CommitHyperlinkDetector extends AbstractHyperlinkDetector {
if (hyperlinks.isEmpty()) {
return null;
}
- return hyperlinks.toArray(new IHyperlink[hyperlinks.size()]);
+ return hyperlinks.toArray(new IHyperlink[0]);
}
private List<IHyperlink> detectHyperlinks(ITextViewer textViewer,
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java
index a1a698d7a..02bb84488 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java
@@ -572,7 +572,7 @@ public class TestUtil {
if (project.equals(name))
items.add(item);
}
- return items.isEmpty() ? null : items.toArray(new SWTBotTreeItem[items.size()]);
+ return items.isEmpty() ? null : items.toArray(new SWTBotTreeItem[0]);
}
/**
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/MockLogicalResourceMapping.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/MockLogicalResourceMapping.java
index 0a9b90a8f..9a51d6397 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/MockLogicalResourceMapping.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/MockLogicalResourceMapping.java
@@ -95,7 +95,7 @@ public class MockLogicalResourceMapping extends ResourceMapping {
"Exception while computing logical model", e));
}
final IResource[] resourceArray = result
- .toArray(new IResource[result.size()]);
+ .toArray(new IResource[0]);
return new ResourceTraversal[] { new ResourceTraversal(resourceArray,
IResource.DEPTH_ONE, IResource.NONE), };
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIUtils.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIUtils.java
index a2f179f98..8c135d02d 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIUtils.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIUtils.java
@@ -493,7 +493,7 @@ public class UIUtils {
values.remove(values.size() - 1);
settings.put(preferenceKey, values
- .toArray(new String[values.size()]));
+ .toArray(new String[0]));
}
}
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushMenu.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushMenu.java
index 1bf1d9fb9..cdc806193 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushMenu.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushMenu.java
@@ -95,6 +95,6 @@ public class PushMenu extends CompoundContributionItem implements
}
}
}
- return res.toArray(new IContributionItem[res.size()]);
+ return res.toArray(new IContributionItem[0]);
}
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryActionHandler.java
index bd3cc5dde..897c31809 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryActionHandler.java
@@ -106,7 +106,7 @@ abstract class RepositoryActionHandler extends AbstractHandler {
}
ret.addAll(extractProjectsFromMappings(selection));
- return ret.toArray(new IProject[ret.size()]);
+ return ret.toArray(new IProject[0]);
}
private Set<IProject> extractProjectsFromMappings(
@@ -174,7 +174,7 @@ abstract class RepositoryActionHandler extends AbstractHandler {
return new Repository[0];
ret.add(repositoryMapping.getRepository());
}
- return ret.toArray(new Repository[ret.size()]);
+ return ret.toArray(new Repository[0]);
}
/**
@@ -259,7 +259,7 @@ abstract class RepositoryActionHandler extends AbstractHandler {
repos.add(repo);
}
}
- return repos.toArray(new Repository[repos.size()]);
+ return repos.toArray(new Repository[0]);
}
return new Repository[0];
}
@@ -286,7 +286,7 @@ abstract class RepositoryActionHandler extends AbstractHandler {
return new Repository[0];
}
}
- return repos.toArray(new Repository[repos.size()]);
+ return repos.toArray(new Repository[0]);
}
return new Repository[0];
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchProjectTracker.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchProjectTracker.java
index d7c825e50..ad0c4b72a 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchProjectTracker.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchProjectTracker.java
@@ -218,7 +218,7 @@ class BranchProjectTracker {
if (path != null && path.length() > 0)
projects.add(path);
}
- return projects.toArray(new String[projects.size()]);
+ return projects.toArray(new String[0]);
}
/**
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCreateProjectViaWizardWizard.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCreateProjectViaWizardWizard.java
index a57a46a15..0c4f3a82d 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCreateProjectViaWizardWizard.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCreateProjectViaWizardWizard.java
@@ -170,7 +170,7 @@ public class GitCreateProjectViaWizardWizard extends Wizard {
}
});
ProjectUtils.createProjects(projectsToCreate,
- workingSets.toArray(new IWorkingSet[workingSets.size()]),
+ workingSets.toArray(new IWorkingSet[0]),
monitor);
break;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitImportWizard.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitImportWizard.java
index c7a177862..b35734ee6 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitImportWizard.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitImportWizard.java
@@ -254,7 +254,7 @@ public class GitImportWizard extends AbstractGitCloneWizard implements IImportWi
}
});
ProjectUtils.createProjects(projectsToCreate,
- workingSets.toArray(new IWorkingSet[workingSets.size()]),
+ workingSets.toArray(new IWorkingSet[0]),
monitor);
break;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitProjectsImportPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitProjectsImportPage.java
index f056b1c3b..5222a1af0 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitProjectsImportPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitProjectsImportPage.java
@@ -438,7 +438,7 @@ public class GitProjectsImportPage extends WizardPage {
progress.worked(1);
}
selectedProjects = result
- .toArray(new ProjectRecord[result.size()]);
+ .toArray(new ProjectRecord[0]);
if (selectedProjects.length == 0) {
// run in UI thread
@@ -523,7 +523,7 @@ public class GitProjectsImportPage extends WizardPage {
validProjects.add(selectedProjects[i]);
}
}
- return validProjects.toArray(new ProjectRecord[validProjects.size()]);
+ return validProjects.toArray(new ProjectRecord[0]);
}
/**
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitProposalProcessor.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitProposalProcessor.java
index 9352ee245..2e4a62721 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitProposalProcessor.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitProposalProcessor.java
@@ -163,7 +163,7 @@ public abstract class CommitProposalProcessor implements IContentAssistProcessor
for (CommitFile file : files)
proposals.add(file.createProposal(offset, 0));
}
- return proposals.toArray(new ICompletionProposal[proposals.size()]);
+ return proposals.toArray(new ICompletionProposal[0]);
}
/**
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitUI.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitUI.java
index 96493559a..2f4da4c0e 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitUI.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitUI.java
@@ -229,7 +229,7 @@ public class CommitUI {
if (mapping != null && mapping.getRepository() == repo)
ret.add(project);
}
- return ret.toArray(new IProject[ret.size()]);
+ return ret.toArray(new IProject[0]);
}
private void resetState() {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffEditorPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffEditorPage.java
index a44143a29..916bb61b6 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffEditorPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffEditorPage.java
@@ -470,7 +470,7 @@ public class DiffEditorPage extends TextEditor
viewer.getProjectionAnnotationModel().modifyAnnotations(
currentFoldingAnnotations, newAnnotations, null);
currentFoldingAnnotations = newAnnotations.keySet()
- .toArray(new Annotation[newAnnotations.size()]);
+ .toArray(new Annotation[0]);
} else {
viewer.disableProjection();
currentFoldingAnnotations = null;
@@ -519,7 +519,7 @@ public class DiffEditorPage extends TextEditor
}
}
currentOverviewAnnotations = newAnnotations.keySet()
- .toArray(new Annotation[newAnnotations.size()]);
+ .toArray(new Annotation[0]);
}
private FileDiffRegion getFileDiffRange(int widgetOffset) {
@@ -554,7 +554,7 @@ public class DiffEditorPage extends TextEditor
.addAll(asList(new RepositoryCommit(commit.getRepository(),
untrackedCommit).getDiffs()));
}
- FileDiff[] result = diffResult.toArray(new FileDiff[diffResult.size()]);
+ FileDiff[] result = diffResult.toArray(new FileDiff[0]);
Arrays.sort(result, FileDiff.PATH_COMPARATOR);
return result;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffViewer.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffViewer.java
index 4950ebb48..53adaff7e 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffViewer.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffViewer.java
@@ -490,7 +490,7 @@ public class DiffViewer extends HyperlinkSourceViewer {
if (links.isEmpty()) {
return null;
}
- return links.toArray(new IHyperlink[links.size()]);
+ return links.toArray(new IHyperlink[0]);
}
private String getString(IDocument document, int offset, int length) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/StashEditorPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/StashEditorPage.java
index b0cba74ca..9df2df5f7 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/StashEditorPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/StashEditorPage.java
@@ -159,7 +159,7 @@ public class StashEditorPage extends CommitEditorPage {
stagedDiffsResult.addAll(asList(stagedDiffs));
}
return stagedDiffsResult
- .toArray(new FileDiff[stagedDiffsResult.size()]);
+ .toArray(new FileDiff[0]);
}
/**
@@ -182,7 +182,7 @@ public class StashEditorPage extends CommitEditorPage {
unstagedDiffs.addAll(asList(untrackedDiffs));
}
- return unstagedDiffs.toArray(new FileDiff[unstagedDiffs.size()]);
+ return unstagedDiffs.toArray(new FileDiff[0]);
}
private void fillStagedDiffs(FileDiff[] diffs) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/CachedCheckboxTreeViewer.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/CachedCheckboxTreeViewer.java
index aca127fdc..3dd87cd09 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/CachedCheckboxTreeViewer.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/CachedCheckboxTreeViewer.java
@@ -140,7 +140,7 @@ public class CachedCheckboxTreeViewer extends ContainerCheckedTreeViewer {
if (checkState == null) {
return new Object[0];
}
- return checkState.toArray(new Object[checkState.size()]);
+ return checkState.toArray(new Object[0]);
}
/**
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositoryMenuUtil.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositoryMenuUtil.java
index efa5c71c0..3c04ffa22 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositoryMenuUtil.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositoryMenuUtil.java
@@ -130,12 +130,12 @@ public final class RepositoryMenuUtil {
files.add(gitDir);
}
}
- String[] repoNames = repos.keySet().toArray(new String[repos.size()]);
+ String[] repoNames = repos.keySet().toArray(new String[0]);
Arrays.sort(repoNames, CommonUtils.STRING_ASCENDING_COMPARATOR);
List<IAction> result = new ArrayList<>();
for (String repoName : repoNames) {
Set<File> files = repos.get(repoName);
- File[] gitDirs = files.toArray(new File[files.size()]);
+ File[] gitDirs = files.toArray(new File[0]);
Arrays.sort(gitDirs);
for (File f : gitDirs) {
IAction menuItem = new Action(repoName,
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositorySelectionPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositorySelectionPage.java
index 2ec5e1771..41c4df241 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositorySelectionPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositorySelectionPage.java
@@ -265,7 +265,7 @@ public class RepositorySelectionPage extends WizardPage implements IRepositorySe
* @return all protocols
*/
public static Protocol[] values() {
- return protocols.values().toArray(new Protocol[protocols.size()]);
+ return protocols.values().toArray(new Protocol[0]);
}
/**
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitDocument.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitDocument.java
index 3ef42d654..ad676085f 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitDocument.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitDocument.java
@@ -307,7 +307,7 @@ class GitDocument extends Document implements RefsChangedListener {
static void refreshRelevant(final Repository repository) throws IOException {
final Entry[] docs;
synchronized (doc2repo) {
- docs = doc2repo.entrySet().toArray(new Entry[doc2repo.size()]);
+ docs = doc2repo.entrySet().toArray(new Entry[0]);
}
for (Entry doc : docs)
if (doc.getValue() == repository)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/ProblemLabelDecorator.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/ProblemLabelDecorator.java
index e5dd1fa39..a5a3ec302 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/ProblemLabelDecorator.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/ProblemLabelDecorator.java
@@ -149,7 +149,7 @@ public class ProblemLabelDecorator extends BaseLabelProvider implements
private void updateLabels(Set<IPath> changedPaths) {
List<Object> elements = getAffectedElements(changedPaths);
if (!elements.isEmpty()) {
- final Object[] updateElements = elements.toArray(new Object[elements.size()]);
+ final Object[] updateElements = elements.toArray(new Object[0]);
Display display = viewer.getControl().getDisplay();
display.asyncExec(new Runnable() {
@Override
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CompareTreeView.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CompareTreeView.java
index ddc55e1ed..e0f1c9bba 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CompareTreeView.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CompareTreeView.java
@@ -362,7 +362,7 @@ public class CompareTreeView extends ViewPart implements IMenuListener, IShowInS
if (!skip)
resources.add(originalInput);
}
- this.input = resources.toArray(new IResource[resources.size()]);
+ this.input = resources.toArray(new IResource[0]);
} else
this.input = input;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/HyperlinkTokenScanner.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/HyperlinkTokenScanner.java
index 0c1e28055..2a07f4f4b 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/HyperlinkTokenScanner.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/HyperlinkTokenScanner.java
@@ -372,7 +372,7 @@ public class HyperlinkTokenScanner implements ITokenScanner {
break;
}
}
- return allLinks.toArray(new IHyperlink[allLinks.size()]);
+ return allLinks.toArray(new IHyperlink[0]);
} catch (BadLocationException e) {
return null;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitFileDiffViewer.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitFileDiffViewer.java
index 63120ae91..1ef973b3b 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitFileDiffViewer.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitFileDiffViewer.java
@@ -425,7 +425,7 @@ public class CommitFileDiffViewer extends TableViewer {
HistoryPageInput historyPageInput = null;
if (!files.isEmpty()) {
historyPageInput = new HistoryPageInput(repo,
- files.toArray(new File[files.size()]));
+ files.toArray(new File[0]));
}
return new ShowInContext(historyPageInput,
new StructuredSelection(elements));
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitMessageViewer.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitMessageViewer.java
index cf528b3b1..eeaea3697 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitMessageViewer.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitMessageViewer.java
@@ -512,7 +512,7 @@ class CommitMessageViewer extends HyperlinkSourceViewer {
}
}
if (!result.isEmpty()) {
- return result.toArray(new IHyperlink[result.size()]);
+ return result.toArray(new IHyperlink[0]);
}
}
return null;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitSelectionDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitSelectionDialog.java
index 7cf30abf3..b8edd72dc 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitSelectionDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitSelectionDialog.java
@@ -239,7 +239,7 @@ public class CommitSelectionDialog extends TitleAreaDialog {
.toString()));
setMessage(UIText.CommitSelectionDialog_DialogMessage);
table.setInput(highlightFlag, allCommits, allCommits
- .toArray(new SWTCommit[allCommits.size()]), null, true);
+ .toArray(new SWTCommit[0]), null, true);
}
private void markStartAllRefs(RevWalk currentWalk, String prefix)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/HistoryPageInput.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/HistoryPageInput.java
index 02697cdaa..8015ecc4c 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/HistoryPageInput.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/HistoryPageInput.java
@@ -109,14 +109,14 @@ public class HistoryPageInput {
* @return the list provided to our constructor
*/
public IResource[] getItems() {
- return list == null ? null : list.toArray(new IResource[list.size()]);
+ return list == null ? null : list.toArray(new IResource[0]);
}
/**
* @return the list provided to our constructor
*/
public File[] getFileList() {
- return files == null ? null : files.toArray(new File[files.size()]);
+ return files == null ? null : files.toArray(new File[0]);
}
/**
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/merge/GitCompareEditorInput.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/merge/GitCompareEditorInput.java
index 44af908b4..90abbd39a 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/merge/GitCompareEditorInput.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/merge/GitCompareEditorInput.java
@@ -489,7 +489,7 @@ public class GitCompareEditorInput extends CompareEditorInput {
if (!skip)
resourceList.add(originalInput);
}
- return resourceList.toArray(new IResource[resourceList.size()]);
+ return resourceList.toArray(new IResource[0]);
} else
return input;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/merge/MergeResultDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/merge/MergeResultDialog.java
index a2fd565fa..74c9bb0aa 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/merge/MergeResultDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/merge/MergeResultDialog.java
@@ -312,7 +312,7 @@ public class MergeResultDialog extends Dialog {
UIText.MergeResultDialog_couldNotFindCommit,
merge.name()), e);
}
- return commits.toArray(new RepositoryCommit[commits.size()]);
+ return commits.toArray(new RepositoryCommit[0]);
}
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/operations/GitScopeUtil.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/operations/GitScopeUtil.java
index c20f41250..5bce2c081 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/operations/GitScopeUtil.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/operations/GitScopeUtil.java
@@ -135,7 +135,7 @@ public class GitScopeUtil {
List<ResourceMapping> result = new ArrayList<>();
for (IResource resource : resources)
result.add(getResourceMapping(resource));
- return result.toArray(new ResourceMapping[result.size()]);
+ return result.toArray(new ResourceMapping[0]);
}
private static IResource[] findRelatedChanges(final IWorkbenchPart part,
@@ -163,7 +163,7 @@ public class GitScopeUtil {
IProgressService progressService = CommonUtils.getService(part.getSite(), IProgressService.class);
progressService.run(true, true, runnable);
- return relatedChanges.toArray(new IResource[relatedChanges.size()]);
+ return relatedChanges.toArray(new IResource[0]);
}
private static List<IResource> collectRelatedChanges(
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/ConfigurationEditorComponent.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/ConfigurationEditorComponent.java
index 13db1bb41..8de641820 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/ConfigurationEditorComponent.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/ConfigurationEditorComponent.java
@@ -558,7 +558,7 @@ public class ConfigurationEditorComponent {
return o1.name.compareTo(o2.name);
}
});
- children = sections.toArray(new Section[sections.size()]);
+ children = sections.toArray(new Section[0]);
} else
children = new Section[0];
return children;
@@ -721,7 +721,7 @@ public class ConfigurationEditorComponent {
index++));
}
}
- children = entries.toArray(new Entry[entries.size()]);
+ children = entries.toArray(new Entry[0]);
}
return children;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/GlobalConfigurationPreferencePage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/GlobalConfigurationPreferencePage.java
index fb37471ab..046edaac7 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/GlobalConfigurationPreferencePage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/GlobalConfigurationPreferencePage.java
@@ -206,7 +206,7 @@ public class GlobalConfigurationPreferencePage extends PreferencePage implements
// Use array since calling save updates the dirty state which updates
// the set of dirty repositories that is being iterated over
final Repository[] repos = dirtyRepositories
- .toArray(new Repository[dirtyRepositories.size()]);
+ .toArray(new Repository[0]);
for (Repository repository : repos) {
ConfigurationEditorComponent editor = repoConfigEditors.get(repository);
try {
@@ -280,7 +280,7 @@ public class GlobalConfigurationPreferencePage extends PreferencePage implements
if (repoName.length() > 0)
items.add(repoName);
}
- return items.toArray(new String[items.size()]);
+ return items.toArray(new String[0]);
}
private void showRepositoryConfiguration(int index) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/pull/PullOperationUI.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/pull/PullOperationUI.java
index 638677e07..fb31f89db 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/pull/PullOperationUI.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/pull/PullOperationUI.java
@@ -97,7 +97,7 @@ public class PullOperationUI extends JobChangeAdapter {
*/
public PullOperationUI(Map<Repository, PullReferenceConfig> configs) {
this.repositories = configs.keySet()
- .toArray(new Repository[configs.size()]);
+ .toArray(new Repository[0]);
int timeout = Activator.getDefault().getPreferenceStore()
.getInt(UIPreferences.REMOTE_CONNECTION_TIMEOUT);
pullOperation = new PullOperation(configs, timeout);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushTagsPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushTagsPage.java
index 4bd444db2..5f0fcbfbf 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushTagsPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushTagsPage.java
@@ -182,7 +182,7 @@ public class PushTagsPage extends WizardPage {
}
TagNode[] checkedTagsArray = checkedTags
- .toArray(new TagNode[checkedTags.size()]);
+ .toArray(new TagNode[0]);
viewer.setCheckedElements(checkedTagsArray);
if (checkedTagsArray.length > 0) {
// Reveal tags (just using reveal does not work on some platforms)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushToGerritPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushToGerritPage.java
index 2f83481fc..f300a9aa0 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushToGerritPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushToGerritPage.java
@@ -281,7 +281,7 @@ public class PushToGerritPage extends WizardPage {
} else if (isValid) {
topicProposals.put(topic, null);
settings.put(repository + LAST_TOPICS_POSTFIX, topicProposals
- .keySet().toArray(new String[topicProposals.size()]));
+ .keySet().toArray(new String[0]));
}
if (branch != null && !ObjectId.isId(branch)) {
// Don't store on detached HEAD
@@ -493,7 +493,7 @@ public class PushToGerritPage extends WizardPage {
stroke.format()));
}
String[] recentTopics = topicProposals.keySet()
- .toArray(new String[topicProposals.size()]);
+ .toArray(new String[0]);
Arrays.sort(recentTopics, CommonUtils.STRING_ASCENDING_COMPARATOR);
SimpleContentProposalProvider proposalProvider = new SimpleContentProposalProvider(
recentTopics);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/RefUpdateElement.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/RefUpdateElement.java
index 4ba13f026..8dd946344 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/RefUpdateElement.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/RefUpdateElement.java
@@ -177,7 +177,7 @@ class RefUpdateElement extends WorkbenchAdapter {
List<RepositoryCommit> commits = new ArrayList<>();
for (RevCommit commit : walk)
commits.add(new RepositoryCommit(repo, commit));
- return commits.toArray(new RepositoryCommit[commits.size()]);
+ return commits.toArray(new RepositoryCommit[0]);
} catch (IOException e) {
Activator.logError("Error parsing commits from push result", e); //$NON-NLS-1$
return new RepositoryCommit[0];
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java
index 7d907ecdd..b4099512a 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java
@@ -957,7 +957,7 @@ public class RepositoriesView extends CommonNavigator implements IShowInSource,
return null;
}
if (repo != null)
- return new HistoryPageInput(repo, files.toArray(new File[files.size()]));
+ return new HistoryPageInput(repo, files.toArray(new File[0]));
else
return null;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryDragAssistant.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryDragAssistant.java
index 1d5bb42f2..59e4b59cf 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryDragAssistant.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryDragAssistant.java
@@ -55,7 +55,7 @@ public class RepositoryDragAssistant extends CommonDragAdapterAssistant {
if (file != null && file.exists())
files.add(file.getAbsolutePath());
}
- event.data = files.toArray(new String[files.size()]);
+ event.data = files.toArray(new String[0]);
return !files.isEmpty();
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryRemotePropertySource.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryRemotePropertySource.java
index 61db3b1e3..c34838091 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryRemotePropertySource.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryRemotePropertySource.java
@@ -76,7 +76,7 @@ public class RepositoryRemotePropertySource implements IPropertySource {
desc = new PropertyDescriptor(RepositoriesView.PUSH,
UIText.RepositoryRemotePropertySource_PushLabel);
resultList.add(desc);
- return resultList.toArray(new IPropertyDescriptor[resultList.size()]);
+ return resultList.toArray(new IPropertyDescriptor[0]);
}
@Override
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SynchronizeCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SynchronizeCommand.java
index b1e111bdf..a3c9fd2d1 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SynchronizeCommand.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SynchronizeCommand.java
@@ -72,7 +72,7 @@ public class SynchronizeCommand extends
Set<IProject> projects = data.getProjects();
IResource[] resources = projects
- .toArray(new IResource[projects.size()]);
+ .toArray(new IResource[0]);
GitModelSynchronize.launch(data, resources);
} catch (IOException e) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java
index ae179e4c3..cb3bb213e 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java
@@ -161,7 +161,7 @@ public class SelectionUtils {
}
}
}
- return result.toArray(new IPath[result.size()]);
+ return result.toArray(new IPath[0]);
}
/**
@@ -174,7 +174,7 @@ public class SelectionUtils {
public static IResource[] getSelectedResources(
@NonNull IStructuredSelection selection) {
Set<IResource> result = getSelectedResourcesSet(selection);
- return result.toArray(new IResource[result.size()]);
+ return result.toArray(new IResource[0]);
}
/**
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java
index 0cf0d56ee..0e853a63c 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java
@@ -493,7 +493,7 @@ public class StagingView extends ViewPart
}
}
if (!files.isEmpty()) {
- event.data = files.toArray(new String[files.size()]);
+ event.data = files.toArray(new String[0]);
return;
}
// We may still end up with an empty list here if the selection
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingViewContentProvider.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingViewContentProvider.java
index 9c276148c..47d50c8c5 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingViewContentProvider.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingViewContentProvider.java
@@ -363,7 +363,7 @@ public class StagingViewContentProvider extends WorkbenchContentProvider {
setSymlinkFileMode(indexDiff, nodes);
setSubmoduleFileMode(indexDiff, nodes);
- content = nodes.toArray(new StagingEntry[nodes.size()]);
+ content = nodes.toArray(new StagingEntry[0]);
Arrays.sort(content, comparator);
treeRoots = null;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitModelSynchronize.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitModelSynchronize.java
index 854e3688b..c5ad55861 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitModelSynchronize.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitModelSynchronize.java
@@ -104,7 +104,7 @@ public class GitModelSynchronize {
gitMappings.add(mapping);
}
- return gitMappings.toArray(new ResourceMapping[gitMappings.size()]);
+ return gitMappings.toArray(new ResourceMapping[0]);
}
/**
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitModelSynchronizeParticipant.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitModelSynchronizeParticipant.java
index 8c3ae0211..c1e82daab 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitModelSynchronizeParticipant.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitModelSynchronizeParticipant.java
@@ -211,7 +211,7 @@ public class GitModelSynchronizeParticipant extends ModelSynchronizeParticipant
capacity);
providers.add(GitChangeSetModelProvider.getProvider());
- return providers.toArray(new ModelProvider[providers.size()]);
+ return providers.toArray(new ModelProvider[0]);
}
@Override
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitSynchronizeWizardPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitSynchronizeWizardPage.java
index fa3e3cb1a..973931370 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitSynchronizeWizardPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitSynchronizeWizardPage.java
@@ -222,7 +222,7 @@ class GitSynchronizeWizardPage extends WizardPage {
Collections.sort(refs, CommonUtils.STRING_ASCENDING_COMPARATOR);
- branchesEditor.setItems(refs.toArray(new String[refs.size()]));
+ branchesEditor.setItems(refs.toArray(new String[0]));
return branchesEditor;
}
@@ -286,7 +286,7 @@ class GitSynchronizeWizardPage extends WizardPage {
});
treeViewer.setInput(repositoriesList
- .toArray(new Repository[repositoriesList.size()]));
+ .toArray(new Repository[0]));
projectsColumn.getColumn().pack();
Composite buttonsComposite = new Composite(composite, SWT.NONE);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/ModelAwareGitSynchronizer.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/ModelAwareGitSynchronizer.java
index 078524e9f..3dac028fd 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/ModelAwareGitSynchronizer.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/ModelAwareGitSynchronizer.java
@@ -179,14 +179,14 @@ public class ModelAwareGitSynchronizer extends DefaultGitSynchronizer {
// source...
// Synchronize using the local data for now.
final ResourceMapping[] mappings = allMappings
- .toArray(new ResourceMapping[allMappings.size()]);
+ .toArray(new ResourceMapping[0]);
final GitSynchronizeData data = new GitSynchronizeData(
repository, leftRev, rightRev, true, includedResources);
GitModelSynchronize.launch(new GitSynchronizeDataSet(data),
mappings);
} else {
final ResourceMapping[] mappings = allMappings
- .toArray(new ResourceMapping[allMappings.size()]);
+ .toArray(new ResourceMapping[0]);
final GitSynchronizeData data = new GitSynchronizeData(
repository, leftRev, rightRev, includeLocal,
includedResources);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/mapping/GitContainerMapping.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/mapping/GitContainerMapping.java
index a06775c2a..984541892 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/mapping/GitContainerMapping.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/mapping/GitContainerMapping.java
@@ -59,7 +59,7 @@ class GitContainerMapping extends GitObjectMapping {
result.add(createTraversalForFile(child, dataSet));
}
- return result.toArray(new ResourceTraversal[result.size()]);
+ return result.toArray(new ResourceTraversal[0]);
}
private Set<ResourceTraversal> createTraversalForContainer(
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/mapping/GitTreeTraversal.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/mapping/GitTreeTraversal.java
index 28ab4e1eb..1d921691f 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/mapping/GitTreeTraversal.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/mapping/GitTreeTraversal.java
@@ -45,7 +45,7 @@ class GitTreeTraversal extends ResourceTraversal {
result.add(resource);
}
- return result.toArray(new IResource[result.size()]);
+ return result.toArray(new IResource[0]);
}
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelRepository.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelRepository.java
index 798f459d2..1f27a5b05 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelRepository.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelRepository.java
@@ -78,7 +78,7 @@ public class GitModelRepository extends GitModelObjectContainer implements HasPr
result.addAll(getWorkingChanges());
disposeOldChildren();
- children = result.toArray(new GitModelObjectContainer[result.size()]);
+ children = result.toArray(new GitModelObjectContainer[0]);
return children;
}
@@ -150,7 +150,7 @@ public class GitModelRepository extends GitModelObjectContainer implements HasPr
private List<GitModelObjectContainer> getListOfCommit(List<Commit> commitCache) {
Repository repo = gsd.getRepository();
Set<IProject> projectsSet = gsd.getProjects();
- IProject[] projects = projectsSet.toArray(new IProject[projectsSet.size()]);
+ IProject[] projects = projectsSet.toArray(new IProject[0]);
List<GitModelObjectContainer> result = new ArrayList<>();
for (Commit commit : commitCache)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelRoot.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelRoot.java
index 36bcc0be5..af5632c11 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelRoot.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelRoot.java
@@ -73,7 +73,7 @@ public class GitModelRoot {
Activator.logError(e.getMessage(), e);
}
disposeOldChildren();
- children = result.toArray(new GitModelObject[result.size()]);
+ children = result.toArray(new GitModelObject[0]);
return children;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelTree.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelTree.java
index 84ed2b0ad..c4c7734da 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelTree.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelTree.java
@@ -114,7 +114,7 @@ public class GitModelTree extends GitModelObjectContainer {
}
void setChildren(List<GitModelObject> children) {
- this.children = children.toArray(new GitModelObject[children.size()]);
+ this.children = children.toArray(new GitModelObject[0]);
}
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/TreeBuilder.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/TreeBuilder.java
index 9590b5c8e..57a479d2b 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/TreeBuilder.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/TreeBuilder.java
@@ -127,7 +127,7 @@ class TreeBuilder {
tree.setChildren(object.children);
}
- return rootChildren.toArray(new GitModelObject[rootChildren.size()]);
+ return rootChildren.toArray(new GitModelObject[0]);
}
private static class Node {

Back to the top