summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Bull2013-06-03 17:34:31 (EDT)
committerIan Bull2013-06-03 17:42:39 (EDT)
commit9f0bd1e7114cf21e7ee26b5a5600aea9898b171d (patch)
tree15a1d5dbeaa2987ae0dca66700fd7ee693d9bb21
parent27e83832cf2019a24171c2bb76605d3116863ef0 (diff)
downloadrt.equinox.p2-9f0bd1e7114cf21e7ee26b5a5600aea9898b171d.zip
rt.equinox.p2-9f0bd1e7114cf21e7ee26b5a5600aea9898b171d.tar.gz
rt.equinox.p2-9f0bd1e7114cf21e7ee26b5a5600aea9898b171d.tar.bz2
bug 409640: how does o.e.e.p2.ui.sdk.scheduler compile on JDK 1.5?
The scheduler bundle used a Java 1.6 API. Due to a problem with the build, this was not detected. This fix uses the System.arraycopy to avoid the 1.6 API.
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/MigrationSupport.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/MigrationSupport.java b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/MigrationSupport.java
index cda2896..fb49d72 100644
--- a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/MigrationSupport.java
+++ b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/MigrationSupport.java
@@ -62,7 +62,7 @@ public class MigrationSupport {
return false;
reposToMigrate = ((IMetadataRepositoryManager) otherConfigAgent.getService(IMetadataRepositoryManager.SERVICE_NAME)).getKnownRepositories(IRepositoryManager.REPOSITORIES_NON_SYSTEM);
- reposToMigrate = Arrays.copyOf(reposToMigrate, reposToMigrate.length + 1);
+ reposToMigrate = copyOf(reposToMigrate, reposToMigrate.length + 1);
reposToMigrate[reposToMigrate.length - 1] = getURIForProfile(otherConfigAgent, previousProfile);
}
@@ -81,6 +81,13 @@ public class MigrationSupport {
return true;
}
+ private static URI[] copyOf(URI[] original, int newLength) {
+ URI[] copy = new URI[newLength];
+ int copyCount = Math.min(original.length, newLength);
+ System.arraycopy(original, 0, copy, 0, copyCount);
+ return copy;
+ }
+
private URI getURIForProfile(IProvisioningAgent agent, IProfile profile) {
IAgentLocation agentLocation = (IAgentLocation) agent.getService(IAgentLocation.SERVICE_NAME);
return URIUtil.append(agentLocation.getRootLocation(), "org.eclipse.equinox.p2.engine/profileRegistry/" + profile.getProfileId() + ".profile"); //$NON-NLS-1$ //$NON-NLS-2$