harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r642007 - in /harmony/enhanced/classlib/trunk/modules/archive/src/main/java: java/util/jar/InitManifest.java java/util/jar/JarVerifier.java java/util/jar/Manifest.java org/apache/harmony/archive/internal/nls/messages.properties
Date Thu, 27 Mar 2008 22:28:00 GMT
Author: tellison
Date: Thu Mar 27 15:27:56 2008
New Revision: 642007

URL: http://svn.apache.org/viewvc?rev=642007&view=rev
Log:
Change externalized message keys to be consistent with rest of module.

Modified:
    harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/InitManifest.java
    harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/JarVerifier.java
    harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/Manifest.java
    harmony/enhanced/classlib/trunk/modules/archive/src/main/java/org/apache/harmony/archive/internal/nls/messages.properties

Modified: harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/InitManifest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/InitManifest.java?rev=642007&r1=642006&r2=642007&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/InitManifest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/InitManifest.java
Thu Mar 27 15:27:56 2008
@@ -48,7 +48,7 @@
         // check a version attribute
         if (!readHeader() || !name.equals(ver)) {
             throw new IOException(Messages.getString(
-                    "archive.missingVersionAttribute", ver)); //$NON-NLS-1$
+                    "archive.2D", ver)); //$NON-NLS-1$
         }
 
         main.put(name, value);
@@ -63,8 +63,7 @@
         int mark = pos;
         while (readHeader()) {
             if (!Attributes.Name.NAME.equals(name)) {
-                throw new IOException(Messages
-                        .getString("archive.entryIsNotNamed")); //$NON-NLS-1$
+                throw new IOException(Messages.getString("archive.23")); //$NON-NLS-1$
             }
             String entryNameValue = value;
 
@@ -85,8 +84,7 @@
                     // this: either use a list of chunks, or decide on used
                     // signature algorithm in advance and reread the chunks while
                     // updating the signature; for now a defensive error is thrown
-                    throw new IOException(Messages
-                            .getString("archive.verifiableEntryRepeated"));
+                    throw new IOException(Messages.getString("archive.34")); //$NON-NLS-1$
                 }
                 chunks.put(entryNameValue, new Manifest.Chunk(mark, pos));
                 mark = pos;
@@ -140,7 +138,7 @@
 
                 if (buf[pos++] != ' ') {
                     throw new IOException(Messages.getString(
-                            "archive.invalidAttribute", nameBuffer));
+                            "archive.30", nameBuffer)); //$NON-NLS-1$
                 }
 
                 name = new Attributes.Name(nameBuffer);
@@ -149,13 +147,12 @@
 
             if (!((b >= 'a' && b <= 'z') || (b >= 'A' && b <=
'Z') || b == '_'
                     || b == '-' || (b >= '0' && b <= '9'))) {
-                throw new IOException(Messages.getString(
-                        "archive.invalidAttribute", b));
+                throw new IOException(Messages.getString("archive.30", b)); //$NON-NLS-1$
             }
         }
         if (i > 0) {
             throw new IOException(Messages.getString(
-                    "archive.invalidAttribute", wrap(mark, buf.length)));
+                    "archive.30", wrap(mark, buf.length))); //$NON-NLS-1$
         }
     }
 
@@ -173,8 +170,7 @@
 
             switch (next) {
             case 0:
-                throw new IOException(Messages
-                        .getString("archive.nulCharInManifest")); // $NON-NLS-1$
+                throw new IOException(Messages.getString("archive.2F")); //$NON-NLS-1$
             case '\n':
                 if (lastCr) {
                     lastCr = false;

Modified: harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/JarVerifier.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/JarVerifier.java?rev=642007&r1=642006&r2=642007&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/JarVerifier.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/JarVerifier.java
Thu Mar 27 15:27:56 2008
@@ -125,7 +125,7 @@
             byte[] d = digest.digest();
             if (!MessageDigest.isEqual(d, Base64.decode(hash))) {
                 throw new SecurityException(Messages.getString(
-                        "archive.invalidDigest", new Object[] { //$NON-NLS-1$
+                        "archive.32", new Object[] { //$NON-NLS-1$
                         JarFile.MANIFEST_NAME, name, jarName }));
             }
             verifiedEntries.put(name, certificates);
@@ -312,17 +312,17 @@
         } catch (IOException e) {
             return;
         } catch (GeneralSecurityException e) {
-            /* [MSG "archive.30", "{0} failed verification of {1}"] */
+            /* [MSG "archive.31", "{0} failed verification of {1}"] */
             throw new SecurityException(Messages.getString(
-                    "archive.30", jarName, signatureFile)); //$NON-NLS-1$
+                    "archive.31", jarName, signatureFile)); //$NON-NLS-1$
         }
 
         // Verify manifest hash in .sf file
         Attributes attributes = new Attributes();
         HashMap<String, Attributes> entries = new HashMap<String, Attributes>();
         try {
-            InitManifest im = new InitManifest(sfBytes, attributes, Attributes.Name.SIGNATURE_VERSION);
//$NON-NLS-1$
-            im.initEntries(entries, null); //$NON-NLS-1$
+            InitManifest im = new InitManifest(sfBytes, attributes, Attributes.Name.SIGNATURE_VERSION);
+            im.initEntries(entries, null);
         } catch (IOException e) {
             return;
         }
@@ -341,9 +341,9 @@
             String digestAttribute = "-Digest-Manifest-Main-Attributes"; //$NON-NLS-1$
             if (!verify(attributes, digestAttribute, manifest, 0,
                     mainAttributesEnd, false, true)) {
-                /* [MSG "archive.30", "{0} failed verification of {1}"] */
+                /* [MSG "archive.31", "{0} failed verification of {1}"] */
                 throw new SecurityException(Messages.getString(
-                        "archive.30", jarName, signatureFile)); //$NON-NLS-1$
+                        "archive.31", jarName, signatureFile)); //$NON-NLS-1$
             }
         }
 
@@ -363,7 +363,7 @@
                 if (!verify(entry.getValue(), "-Digest", manifest, //$NON-NLS-1$
                         chunk.start, chunk.end, createdBySigntool, false)) {
                     throw new SecurityException(Messages.getString(
-                            "archive.invalidDigest", //$NON-NLS-1$
+                            "archive.32", //$NON-NLS-1$
                             new Object[] { signatureFile, entry.getKey(),
                                     jarName }));
                 }

Modified: harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/Manifest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/Manifest.java?rev=642007&r1=642006&r2=642007&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/Manifest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/Manifest.java
Thu Mar 27 15:27:56 2008
@@ -206,7 +206,7 @@
         try {
             buf = org.apache.harmony.luni.util.ByteBuffer.wrap(is);
         } catch (OutOfMemoryError oome) {
-            throw new IOException(Messages.getString("archive.manifestTooLong")); // $NON-NLS-1$
+            throw new IOException(Messages.getString("archive.2E")); //$NON-NLS-1$
         }
         im = new InitManifest(buf, mainAttributes,
                 Attributes.Name.MANIFEST_VERSION);
@@ -313,7 +313,7 @@
         byte[] out = name.getBytes();
         if (out.length > LINE_LENGTH_LIMIT) {
             throw new IOException(Messages.getString(
-                    "archive.headerNameTooLong", name, LINE_LENGTH_LIMIT));
+                    "archive.33", name, LINE_LENGTH_LIMIT)); //$NON-NLS-1$
         }
 
         os.write(out);

Modified: harmony/enhanced/classlib/trunk/modules/archive/src/main/java/org/apache/harmony/archive/internal/nls/messages.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/archive/src/main/java/org/apache/harmony/archive/internal/nls/messages.properties?rev=642007&r1=642006&r2=642007&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/archive/src/main/java/org/apache/harmony/archive/internal/nls/messages.properties
(original)
+++ harmony/enhanced/classlib/trunk/modules/archive/src/main/java/org/apache/harmony/archive/internal/nls/messages.properties
Thu Mar 27 15:27:56 2008
@@ -50,7 +50,7 @@
 archive.20=Crc mismatch
 archive.21=Size mismatch
 archive.22=Cannot read version
-archive.entryIsNotNamed=Entry is not named
+archive.23=Entry is not named
 archive.24=Unable to open\: {0}
 archive.25=Invalid zip file\: {0}
 archive.26=attempt to write after finish
@@ -60,11 +60,11 @@
 archive.2A=Name too long: {0}
 archive.2B=String is too long
 archive.2C=No active entry
-archive.missingVersionAttribute=Missing version attribute\: {0}
-archive.manifestTooLong=Manifest is too long
-archive.nulCharInManifest=NUL character in a manifest
-archive.invalidAttribute=Invalid attribute {0}
-archive.30={0} failed verification of {1}
-archive.invalidDigest={0} has invalid digest for {1} in {2}
-archive.headerNameTooLong=A length of the encoded header name "{1}" exceeded maximum length
{2}
-archive.verifiableEntryRepeated=A jar verifier does not support more than one entry with
the same name  
+archive.2D=Missing version attribute\: {0}
+archive.2E=Manifest is too long
+archive.2F=NUL character in a manifest
+archive.30=Invalid attribute {0}
+archive.31={0} failed verification of {1}
+archive.32={0} has invalid digest for {1} in {2}
+archive.33=A length of the encoded header name "{1}" exceeded maximum length {2}
+archive.34=A jar verifier does not support more than one entry with the same name  



Mime
View raw message