Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 114540 Details for
Bug 249996
[artifact] MirrorApplication does not mirror properly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Modifies IArtifactReposiroty, addeds require methods.
249996patch.txt (text/plain), 11.59 KB, created by
Andrew Cattle
on 2008-10-08 08:43:07 EDT
(
hide
)
Description:
Modifies IArtifactReposiroty, addeds require methods.
Filename:
MIME Type:
Creator:
Andrew Cattle
Created:
2008-10-08 08:43:07 EDT
Size:
11.59 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.p2.touchpoint.eclipse >Index: src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/AggregatedBundleRepository.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/AggregatedBundleRepository.java,v >retrieving revision 1.6 >diff -u -r1.6 AggregatedBundleRepository.java >--- src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/AggregatedBundleRepository.java 18 Apr 2008 21:35:23 -0000 1.6 >+++ src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/AggregatedBundleRepository.java 8 Oct 2008 12:33:25 -0000 >@@ -93,6 +93,10 @@ > throw new UnsupportedOperationException(Messages.artifact_retrieval_unsupported); > } > >+ public IStatus getRawArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) { >+ throw new UnsupportedOperationException(Messages.artifact_retrieval_unsupported); >+ } >+ > public IStatus getArtifacts(IArtifactRequest[] requests, IProgressMonitor monitor) { > throw new UnsupportedOperationException(Messages.artifact_retrieval_unsupported); > } >#P org.eclipse.equinox.p2.extensionlocation >Index: src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java,v >retrieving revision 1.17 >diff -u -r1.17 ExtensionLocationArtifactRepository.java >--- src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java 4 Sep 2008 17:55:43 -0000 1.17 >+++ src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java 8 Oct 2008 12:33:25 -0000 >@@ -169,6 +169,11 @@ > return artifactRepository.getArtifact(descriptor, destination, monitor); > } > >+ public IStatus getRawArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) { >+ ensureInitialized(); >+ return artifactRepository.getRawArtifact(descriptor, destination, monitor); >+ } >+ > public IArtifactDescriptor[] getArtifactDescriptors(IArtifactKey key) { > ensureInitialized(); > return artifactRepository.getArtifactDescriptors(key); >#P org.eclipse.equinox.p2.tests >Index: src/org/eclipse/equinox/p2/tests/publisher/TestArtifactRepository.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/TestArtifactRepository.java,v >retrieving revision 1.1 >diff -u -r1.1 TestArtifactRepository.java >--- src/org/eclipse/equinox/p2/tests/publisher/TestArtifactRepository.java 26 Sep 2008 13:47:05 -0000 1.1 >+++ src/org/eclipse/equinox/p2/tests/publisher/TestArtifactRepository.java 8 Oct 2008 12:33:26 -0000 >@@ -157,6 +157,10 @@ > return Status.OK_STATUS; > } > >+ public IStatus getRawArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) { >+ return getArtifact(descriptor, destination, monitor); >+ } >+ > public IArtifactDescriptor[] getArtifactDescriptors(IArtifactKey key) { > Set/*<IArtifactDescriptor>*/result = new HashSet/*<IArtifactDescriptor>*/(); > for (Iterator/*<IArtifactDescriptor>*/iterator = repo.keySet().iterator(); iterator.hasNext();) { >Index: src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java,v >retrieving revision 1.64 >diff -u -r1.64 AbstractProvisioningTest.java >--- src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java 7 Oct 2008 22:55:25 -0000 1.64 >+++ src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java 8 Oct 2008 12:33:26 -0000 >@@ -1006,7 +1006,7 @@ > //this implicitly verifies the keys are present > > IArtifactDescriptor[] sourceDescriptors = sourceRepo.getArtifactDescriptors(sourceKeys[i]); >- assertEquals(message, sourceDescriptors, destinationDescriptors); >+ assertEquals(message, sourceDescriptors, destinationDescriptors, false); //order doesn't matter > } > } > >@@ -1073,4 +1073,49 @@ > assertEquals(message, expected.get(expectedArray[i]), actual.get(expectedArray[i])); > } > } >+ >+ //TODO REMOVE >+ protected static void assertEquals(String message, IArtifactDescriptor[] expected, IArtifactDescriptor[] actual, boolean orderImportant) { >+ // if the order in the array must match exactly, then call the other method >+ if (orderImportant) { >+ assertEquals(message, expected, actual); >+ return; >+ } >+ // otherwise use this method and check that the arrays are equal in any order >+ if (expected == null && actual == null) >+ return; >+ if (expected == actual) >+ return; >+ if (expected == null || actual == null) >+ assertTrue(message + ".1", false); >+ // if (expected.length != actual.length) >+ // assertTrue(message + ".2", false); >+ boolean[] found = (expected.length < actual.length) ? new boolean[expected.length] : new boolean[actual.length]; >+ for (int i = 0; i < expected.length; i++) { >+ for (int j = 0; j < actual.length; j++) { >+ //if (!found[j] && isEqual(expected[i], actual[j])) >+ if (isEqual(expected[i], actual[j])) >+ found[j] = true; >+ } >+ } >+ for (int i = 0; i < found.length; i++) >+ if (!found[i]) >+ assertTrue(message + ".3." + i, false); >+ } >+ >+ //TODO REMOVE >+ protected static boolean isEqual(IArtifactDescriptor expected, IArtifactDescriptor actual) { >+ if (expected == null && actual == null) >+ return true; >+ if (expected == actual) >+ return true; >+ if (expected == null || actual == null) >+ return false; >+ if (!expected.getArtifactKey().equals(actual.getArtifactKey())) >+ return false; >+ // if (!expected.getProperties().equals(actual.getProperties())) >+ // return false; >+ >+ return true; >+ } > } >Index: src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java,v >retrieving revision 1.8 >diff -u -r1.8 TestArtifactRepository.java >--- src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java 18 Apr 2008 21:35:33 -0000 1.8 >+++ src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java 8 Oct 2008 12:33:26 -0000 >@@ -128,6 +128,11 @@ > return Status.OK_STATUS; > } > >+ public IStatus getRawArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) { >+ testhandler.download((String) keysToLocations.get(descriptor.getArtifactKey()), destination, monitor); >+ return Status.OK_STATUS; >+ } >+ > public IArtifactDescriptor[] getArtifactDescriptors(IArtifactKey key) { > if (!contains(key)) > return null; >#P org.eclipse.equinox.p2.directorywatcher >Index: src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java,v >retrieving revision 1.2 >diff -u -r1.2 CachingArtifactRepository.java >--- src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java 21 Aug 2008 02:32:40 -0000 1.2 >+++ src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java 8 Oct 2008 12:33:27 -0000 >@@ -126,6 +126,10 @@ > return innerRepo.getArtifact(descriptor, destination, monitor); > } > >+ public IStatus getRawArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) { >+ return innerRepo.getRawArtifact(descriptor, destination, monitor); >+ } >+ > public IStatus getArtifacts(IArtifactRequest[] requests, IProgressMonitor monitor) { > return Status.OK_STATUS; > } >#P org.eclipse.equinox.p2.artifact.repository >Index: src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactRepository.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactRepository.java,v >retrieving revision 1.5 >diff -u -r1.5 IArtifactRepository.java >--- src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactRepository.java 7 Oct 2008 23:52:31 -0000 1.5 >+++ src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactRepository.java 8 Oct 2008 12:33:27 -0000 >@@ -69,6 +69,11 @@ > public IStatus getArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor); > > /** >+ * Write to the given output stream the bytes represented by the artifact descriptor without processing by the steps of the given descriptor. >+ */ >+ public IStatus getRawArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor); >+ >+ /** > * Return the set of artifact descriptors describing the ways that this repository > * can supply the artifact associated with the given artifact key > * @param key the artifact key to lookup >Index: src/org/eclipse/equinox/internal/p2/artifact/mirror/Mirroring.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/mirror/Mirroring.java,v >retrieving revision 1.2 >diff -u -r1.2 Mirroring.java >--- src/org/eclipse/equinox/internal/p2/artifact/mirror/Mirroring.java 30 Sep 2008 00:09:07 -0000 1.2 >+++ src/org/eclipse/equinox/internal/p2/artifact/mirror/Mirroring.java 8 Oct 2008 12:33:27 -0000 >@@ -54,7 +54,7 @@ > if (repositoryStream == null) > return; > // TODO Is that ok to ignore the result? >- source.getArtifact(descriptor, repositoryStream, new NullProgressMonitor()); >+ source.getRawArtifact(descriptor, repositoryStream, new NullProgressMonitor()); > } finally { > if (repositoryStream != null) > repositoryStream.close(); >Index: src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java,v >retrieving revision 1.63 >diff -u -r1.63 SimpleArtifactRepository.java >--- src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java 26 Sep 2008 19:30:02 -0000 1.63 >+++ src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java 8 Oct 2008 12:33:27 -0000 >@@ -515,6 +515,10 @@ > return downloadArtifact(descriptor, destination, monitor); > } > >+ public IStatus getRawArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) { >+ return downloadArtifact(descriptor, destination, monitor); >+ } >+ > public synchronized IArtifactDescriptor[] getArtifactDescriptors(IArtifactKey key) { > Collection result = (Collection) artifactMap.get(key); > if (result == null)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 249996
:
114472
|
114540
|
114593
|
114594
|
114791
|
115034