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 131828 Details for
Bug 271792
Make sure that the comparator errors are reported on the actual jar
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Comparator
Comparator.patch (text/plain), 10.08 KB, created by
Matthew Piggott
on 2009-04-14 15:01:19 EDT
(
hide
)
Description:
Comparator
Filename:
MIME Type:
Creator:
Matthew Piggott
Created:
2009-04-14 15:01:19 EDT
Size:
10.08 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.p2.artifact.repository >Index: src/org/eclipse/equinox/internal/p2/artifact/processors/md5/MD5ArtifactComparator.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/processors/md5/MD5ArtifactComparator.java,v >retrieving revision 1.1 >diff -u -r1.1 MD5ArtifactComparator.java >--- src/org/eclipse/equinox/internal/p2/artifact/processors/md5/MD5ArtifactComparator.java 20 Nov 2008 00:09:50 -0000 1.1 >+++ src/org/eclipse/equinox/internal/p2/artifact/processors/md5/MD5ArtifactComparator.java 14 Apr 2009 19:01:45 -0000 >@@ -9,8 +9,7 @@ > > package org.eclipse.equinox.internal.p2.artifact.processors.md5; > >-import org.eclipse.core.runtime.IStatus; >-import org.eclipse.core.runtime.Status; >+import org.eclipse.core.runtime.*; > import org.eclipse.equinox.internal.p2.artifact.repository.Activator; > import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*; > import org.eclipse.osgi.util.NLS; >@@ -35,6 +34,6 @@ > if (sourceMD5.equals(destMD5)) > return Status.OK_STATUS; > >- return new Status(IStatus.WARNING, Activator.ID, NLS.bind(Messages.warning_differentMD5, new Object[] {source, destination, sourceDescriptor})); >+ return new Status(IStatus.WARNING, Activator.ID, NLS.bind(Messages.warning_differentMD5, new Object[] {URIUtil.toUnencodedString(sourceDescriptor.getRepository().getLocation()), URIUtil.toUnencodedString(destDescriptor.getRepository().getLocation()), sourceDescriptor})); > } > } >Index: src/org/eclipse/equinox/internal/p2/artifact/processors/md5/messages.properties >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/processors/md5/messages.properties,v >retrieving revision 1.3 >diff -u -r1.3 messages.properties >--- src/org/eclipse/equinox/internal/p2/artifact/processors/md5/messages.properties 9 Apr 2009 17:37:56 -0000 1.3 >+++ src/org/eclipse/equinox/internal/p2/artifact/processors/md5/messages.properties 14 Apr 2009 19:01:45 -0000 >@@ -13,7 +13,7 @@ > Error_MD5_unavailable=Could not create MD5 algorithm. > Error_unexpected_hash=MD5 hash is not as expected. Expected: {0} and found {1}. > >-info_noMD5Infomation = No MD5 information available for the artifact {0}. >-info_noMD5InRepository = The repository {0} does not contain MD5 information for {1}. >+info_noMD5Infomation=No MD5 information available for the artifact [{0}]. >+info_noMD5InRepository=The repository {0} does not contain MD5 information for [{1}]. > >-warning_differentMD5 = The respositories {0} and {1} have different MD5 sums for {2}. >\ No newline at end of file >+warning_differentMD5=The repositories {0} and {1} have different MD5 sums for [{2}]. >\ No newline at end of file >#P org.eclipse.equinox.p2.repository.tools >Index: src/org/eclipse/equinox/p2/internal/repository/comparator/messages.properties >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/comparator/messages.properties,v >retrieving revision 1.2 >diff -u -r1.2 messages.properties >--- src/org/eclipse/equinox/p2/internal/repository/comparator/messages.properties 30 Mar 2009 21:45:09 -0000 1.2 >+++ src/org/eclipse/equinox/p2/internal/repository/comparator/messages.properties 14 Apr 2009 19:01:46 -0000 >@@ -8,9 +8,9 @@ > # Contributors: > # IBM Corporation - initial API and implementation > ############################################################################### >-differentNumberOfEntries=Difference: {0} contains {1} files and {2} contains {3} files >-differentEntry=Difference found for {0} within {1} >-missingEntry=Missing {0} withim {1} >+differentNumberOfEntries=Difference in [{0}]: {1} contains {2} files and {3} contains {4} files >+differentEntry=Difference found for {0} within [{1}] from {2} >+missingEntry=Missing {0} within [{1}] from {2} > ioexception=IOException comparing {0} and {1} > ioexceptioninentry=IOException checking {0} within {1} > filenotfoundexception=FileNotFoundException checking {0} within {1} >Index: src/org/eclipse/equinox/p2/internal/repository/comparator/JarComparator.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/comparator/JarComparator.java,v >retrieving revision 1.3 >diff -u -r1.3 JarComparator.java >--- src/org/eclipse/equinox/p2/internal/repository/comparator/JarComparator.java 2 Apr 2009 22:15:04 -0000 1.3 >+++ src/org/eclipse/equinox/p2/internal/repository/comparator/JarComparator.java 14 Apr 2009 19:01:46 -0000 >@@ -36,7 +36,14 @@ > private static final String RSA_EXT = ".rsa"; //$NON-NLS-1$ > private static final String SF_EXT = ".sf"; //$NON-NLS-1$ > >+ private String sourceLocation, destinationLocation, descriptorString; >+ > public IStatus compare(IArtifactRepository source, IArtifactDescriptor sourceDescriptor, IArtifactRepository destination, IArtifactDescriptor destinationDescriptor) { >+ // Cache information for potential error messages >+ sourceLocation = URIUtil.toUnencodedString(sourceDescriptor.getRepository().getLocation()); >+ destinationLocation = URIUtil.toUnencodedString(destinationDescriptor.getRepository().getLocation()); >+ descriptorString = sourceDescriptor.toString(); >+ > String classifier = sourceDescriptor.getArtifactKey().getClassifier(); > if (!OSGI_BUNDLE_CLASSIFIER.equals(classifier)) { > return Status.OK_STATUS; >@@ -71,7 +78,7 @@ > final int firstFileSize = firstFile.size(); > final int secondFileSize = secondFile.size(); > if (firstFileSize != secondFileSize) { >- return newErrorStatus(NLS.bind(Messages.differentNumberOfEntries, new String[] {sourceFile.getName(), Integer.toString(firstFileSize), destinationFile.getName(), Integer.toString(secondFileSize)})); >+ return newErrorStatus(NLS.bind(Messages.differentNumberOfEntries, new String[] {descriptorString, sourceLocation, Integer.toString(firstFileSize), destinationLocation, Integer.toString(secondFileSize)})); > } > for (Enumeration enumeration = firstFile.entries(); enumeration.hasMoreElements();) { > ZipEntry entry = (ZipEntry) enumeration.nextElement(); >@@ -93,7 +100,7 @@ > try { > result = compareClasses(firstStream, entry.getSize(), secondStream, entry2.getSize()); > } catch (ClassFormatException e) { >- return newErrorStatus(NLS.bind(Messages.differentEntry, entryName, sourceFile.getAbsolutePath()), e); >+ return newErrorStatus(NLS.bind(Messages.differentEntry, new String[] {entryName, descriptorString, sourceLocation}), e); > } > } else if (lowerCase.endsWith(JAR_EXTENSION)) { > result = compareNestedJars(firstStream, entry.getSize(), secondStream, entry2.getSize(), entryName); >@@ -105,14 +112,14 @@ > result = compareBytes(firstStream, entry.getSize(), secondStream, entry2.getSize()); > } > if (!result) >- return newErrorStatus(NLS.bind(Messages.differentEntry, entryName, sourceFile.getAbsolutePath())); >+ return newErrorStatus(NLS.bind(Messages.differentEntry, new String[] {entryName, descriptorString, sourceLocation})); > } finally { > Utility.close(firstStream); > Utility.close(secondStream); > } > } else if (!entry.isDirectory()) { > // missing entry, entry2 == null >- return newErrorStatus(NLS.bind(Messages.missingEntry, entryName, sourceFile.getAbsolutePath())); >+ return newErrorStatus(NLS.bind(Messages.missingEntry, new String[] {entryName, descriptorString, sourceLocation})); > } > } > } catch (CoreException e) { >#P org.eclipse.equinox.p2.tests >Index: src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java,v >retrieving revision 1.28 >diff -u -r1.28 ArtifactMirrorApplicationTest.java >--- src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java 10 Apr 2009 18:22:29 -0000 1.28 >+++ src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java 14 Apr 2009 19:01:47 -0000 >@@ -1189,7 +1189,7 @@ > IArtifactDescriptor[] destDescriptors = repo2.getArtifactDescriptors(descriptor2.getArtifactKey()); > assertEquals("Ensuring destination has correct number of descriptors", 1, destDescriptors.length); > assertEquals("Ensuring proper descriptor exists in destination", descriptor2.getProperty(IArtifactDescriptor.DOWNLOAD_MD5), destDescriptors[0].getProperty(IArtifactDescriptor.DOWNLOAD_MD5)); >- String msg = NLS.bind(Messages.warning_differentMD5, new Object[] {repo1, repo2, descriptor1}); >+ String msg = NLS.bind(Messages.warning_differentMD5, new Object[] {URIUtil.toUnencodedString(repo1.getLocation()), URIUtil.toUnencodedString(repo2.getLocation()), descriptor1}); > try { > assertLogContainsLine(TestActivator.getLogFile(), msg); > } catch (Exception e) { >@@ -1266,7 +1266,7 @@ > IArtifactDescriptor[] destDescriptors = destination.getArtifactDescriptors(descriptor2.getArtifactKey()); > assertEquals("Ensuring destination has correct number of descriptors", 1, destDescriptors.length); > assertEquals("Ensuring destination contains the descriptor from the baseline", descriptor2.getProperty(IArtifactDescriptor.DOWNLOAD_MD5), destDescriptors[0].getProperty(IArtifactDescriptor.DOWNLOAD_MD5)); >- String msg = NLS.bind(Messages.warning_differentMD5, new Object[] {baseline, repo, descriptor1}); >+ String msg = NLS.bind(Messages.warning_differentMD5, new Object[] {URIUtil.toUnencodedString(baseline.getLocation()), URIUtil.toUnencodedString(repo.getLocation()), descriptor1}); > try { > assertLogContainsLine(TestActivator.getLogFile(), msg); > } catch (Exception e) {
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
Flags:
pascal
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 271792
:
131827
| 131828