From 493fdf3e2429ae3147cdc08ab680bb4a5ce972cc Mon Sep 17 00:00:00 2001 From: Sean Mullan Date: Tue, 29 Mar 2011 10:39:00 -0400 Subject: [PATCH] 7019937: Translatability bug - Remove Unused String - String ID , read end of file 7019938: Translatability bug - Remove Unused String - String ID can not specify Principal with a 7019940: Translatability bug - Remove unused string - String ID: provided null name 7019942: Translatability bug - String ID: trustedCertEntry, 7019945: Translatability bug - Translatability issue - String ID: * has NOT been verified! In order to veri 7019947: Translatability bug - Translatability issue - String ID: * The integrity of the information stored i 7019949: Translatability bug - Translatability issue - String ID: * you must provide your keystore password Reviewed-by: weijun, wetmore --- .../com/sun/security/auth/PolicyParser.java | 16 ++++++++------- .../classes/sun/security/tools/JarSigner.java | 2 -- .../security/tools/JarSignerResources.java | 8 +++----- .../classes/sun/security/tools/KeyTool.java | 17 ++++++---------- .../sun/security/util/AuthResources.java | 15 +++++++------- .../classes/sun/security/util/Resources.java | 20 ++++++------------- 6 files changed, 32 insertions(+), 46 deletions(-) diff --git a/jdk/src/share/classes/com/sun/security/auth/PolicyParser.java b/jdk/src/share/classes/com/sun/security/auth/PolicyParser.java index e4168e4072c..aaf061b514f 100644 --- a/jdk/src/share/classes/com/sun/security/auth/PolicyParser.java +++ b/jdk/src/share/classes/com/sun/security/auth/PolicyParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,13 +30,14 @@ import java.lang.RuntimePermission; import java.net.MalformedURLException; import java.net.SocketPermission; import java.net.URL; +import java.security.GeneralSecurityException; +import java.text.MessageFormat; import java.util.Enumeration; import java.util.Hashtable; import java.util.LinkedList; import java.util.ListIterator; import java.util.Vector; import java.util.StringTokenizer; -import java.security.GeneralSecurityException; import sun.security.util.PropertyExpander; /** @@ -368,8 +369,8 @@ class PolicyParser { "WILDCARD class but no WILDCARD name"); throw new ParsingException (st.lineno(), - rb.getString("can.not.specify.Principal.with.a.") + - rb.getString("wildcard.class.without.a.wildcard.name")); + rb.getString("can.not.specify.Principal.with.a." + + "wildcard.class.without.a.wildcard.name")); } try { @@ -525,9 +526,10 @@ class PolicyParser { rb.getString("number.") + String.valueOf(st.nval)); case StreamTokenizer.TT_EOF: - throw new ParsingException - (rb.getString("expected.") + expect + - rb.getString(".read.end.of.file")); + MessageFormat form = new MessageFormat( + rb.getString("expected.expect.read.end.of.file.")); + Object[] source = {expect}; + throw new ParsingException(form.format(source)); case StreamTokenizer.TT_WORD: if (expect.equalsIgnoreCase(st.sval)) { lookahead = st.nextToken(); diff --git a/jdk/src/share/classes/sun/security/tools/JarSigner.java b/jdk/src/share/classes/sun/security/tools/JarSigner.java index 2692a515a83..ca1006a840e 100644 --- a/jdk/src/share/classes/sun/security/tools/JarSigner.java +++ b/jdk/src/share/classes/sun/security/tools/JarSigner.java @@ -1238,8 +1238,6 @@ public class JarSigner { // Provide a helpful message when TSA is beyond a firewall error(rb.getString("unable.to.sign.jar.") + rb.getString("no.response.from.the.Timestamping.Authority.") + - rb.getString("When.connecting.from.behind.a.firewall.an.HTTP.or.HTTPS.proxy.may.need.to.be.specified.") + - rb.getString("Supply.the.following.options.to.jarsigner.") + "\n -J-Dhttp.proxyHost=" + "\n -J-Dhttp.proxyPort=\n" + rb.getString("or") + diff --git a/jdk/src/share/classes/sun/security/tools/JarSignerResources.java b/jdk/src/share/classes/sun/security/tools/JarSignerResources.java index cfa83abe6a0..cea8b253927 100644 --- a/jdk/src/share/classes/sun/security/tools/JarSignerResources.java +++ b/jdk/src/share/classes/sun/security/tools/JarSignerResources.java @@ -181,11 +181,9 @@ public class JarSignerResources extends java.util.ListResourceBundle { {"TSA.location.", "TSA location: "}, {"TSA.certificate.", "TSA certificate: "}, {"no.response.from.the.Timestamping.Authority.", - "no response from the Timestamping Authority. "}, - {"When.connecting.from.behind.a.firewall.an.HTTP.or.HTTPS.proxy.may.need.to.be.specified.", - "When connecting from behind a firewall an HTTP or HTTPS proxy may need to be specified. "}, - {"Supply.the.following.options.to.jarsigner.", - "Supply the following options to jarsigner: "}, + "no response from the Timestamping Authority. When connecting" + + " from behind a firewall an HTTP or HTTPS proxy may need to" + + " be specified. Supply the following options to jarsigner:"}, {"or", "or"}, {"Certificate.not.found.for.alias.alias.must.reference.a.valid.KeyStore.entry.containing.an.X.509.public.key.certificate.for.the", "Certificate not found for: {0}. {1} must reference a valid KeyStore entry containing an X.509 public key certificate for the Timestamping Authority."}, diff --git a/jdk/src/share/classes/sun/security/tools/KeyTool.java b/jdk/src/share/classes/sun/security/tools/KeyTool.java index 50349173a41..d2749f5f8b2 100644 --- a/jdk/src/share/classes/sun/security/tools/KeyTool.java +++ b/jdk/src/share/classes/sun/security/tools/KeyTool.java @@ -1740,16 +1740,19 @@ public final class KeyTool { KeyStore.TrustedCertificateEntry.class)) { // We have a trusted certificate entry Certificate cert = keyStore.getCertificate(alias); + Object[] source = {"trustedCertEntry"}; + String mf = new MessageFormat( + rb.getString("Entry.type.type.")).format(source) + "\n"; if (verbose && (cert instanceof X509Certificate)) { - out.println(rb.getString("Entry.type.trustedCertEntry.")); + out.println(mf); printX509Cert((X509Certificate)cert, out); } else if (rfc) { - out.println(rb.getString("Entry.type.trustedCertEntry.")); + out.println(mf); dumpCert(cert, out); } else if (debug) { out.println(cert.toString()); } else { - out.println(rb.getString("trustedCertEntry.")); + out.println("trustedCertEntry, "); out.println(rb.getString("Certificate.fingerprint.SHA1.") + getCertFingerPrint("SHA1", cert)); } @@ -1836,10 +1839,6 @@ public final class KeyTool { (".WARNING.WARNING.WARNING.")); System.err.println(rb.getString (".The.integrity.of.the.information.stored.in.the.srckeystore.")); - System.err.println(rb.getString - (".has.NOT.been.verified.In.order.to.verify.its.integrity.")); - System.err.println(rb.getString - (".you.must.provide.the.srckeystore.password.")); System.err.println(rb.getString (".WARNING.WARNING.WARNING.")); System.err.println(); @@ -3186,10 +3185,6 @@ public final class KeyTool { (".WARNING.WARNING.WARNING.")); System.err.println(rb.getString (".The.integrity.of.the.information.stored.in.your.keystore.")); - System.err.println(rb.getString - (".has.NOT.been.verified.In.order.to.verify.its.integrity.")); - System.err.println(rb.getString - (".you.must.provide.your.keystore.password.")); System.err.println(rb.getString (".WARNING.WARNING.WARNING.")); System.err.println(); diff --git a/jdk/src/share/classes/sun/security/util/AuthResources.java b/jdk/src/share/classes/sun/security/util/AuthResources.java index 68d8d9edbe2..8821b87988a 100644 --- a/jdk/src/share/classes/sun/security/util/AuthResources.java +++ b/jdk/src/share/classes/sun/security/util/AuthResources.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -111,17 +111,15 @@ public class AuthResources extends java.util.ListResourceBundle { // com.sun.security.auth.PolicyParser {"expected.keystore.type", "expected keystore type"}, - {"can.not.specify.Principal.with.a.", - "can not specify Principal with a "}, - {"wildcard.class.without.a.wildcard.name", - "wildcard class without a wildcard name"}, + {"can.not.specify.Principal.with.a.wildcard.class.without.a.wildcard.name", + "can not specify Principal with a wildcard class without a wildcard name"}, {"expected.codeBase.or.SignedBy", "expected codeBase or SignedBy"}, {"only.Principal.based.grant.entries.permitted", "only Principal-based grant entries permitted"}, {"expected.permission.entry", "expected permission entry"}, {"number.", "number "}, - {"expected.", "expected "}, - {".read.end.of.file", ", read end of file"}, + {"expected.expect.read.end.of.file.", + "expected {0}, read end of file"}, {"expected.read.end.of.file", "expected ';', read end of file"}, {"line.", "line "}, {".expected.", ": expected '"}, @@ -136,6 +134,9 @@ public class AuthResources extends java.util.ListResourceBundle { {"SolarisNumericUserPrincipal.", "SolarisNumericUserPrincipal: "}, {"SolarisPrincipal.", "SolarisPrincipal: "}, + // provided.null.name is the NullPointerException message when a + // developer incorrectly passes a null name to the constructor of + // subclasses of java.security.Principal {"provided.null.name", "provided null name"} }; diff --git a/jdk/src/share/classes/sun/security/util/Resources.java b/jdk/src/share/classes/sun/security/util/Resources.java index 5489c3d9eaa..299facc668a 100644 --- a/jdk/src/share/classes/sun/security/util/Resources.java +++ b/jdk/src/share/classes/sun/security/util/Resources.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -304,8 +304,6 @@ public class Resources extends java.util.ListResourceBundle { {"Certificate.chain.length.", "Certificate chain length: "}, {"Certificate.i.1.", "Certificate[{0,number,integer}]:"}, {"Certificate.fingerprint.SHA1.", "Certificate fingerprint (SHA1): "}, - {"Entry.type.trustedCertEntry.", "Entry type: trustedCertEntry\n"}, - {"trustedCertEntry.", "trustedCertEntry,"}, {"Keystore.type.", "Keystore type: "}, {"Keystore.provider.", "Keystore provider: "}, {"Your.keystore.contains.keyStore.size.entry", @@ -378,21 +376,15 @@ public class Resources extends java.util.ListResourceBundle { {"No.certificate.from.the.SSL.server", "No certificate from the SSL server"}, - // Translators of the following 5 pairs, ATTENTION: - // the next 5 string pairs are meant to be combined into 2 paragraphs, - // 1+3+4 and 2+3+5. make sure your translation also does. {".The.integrity.of.the.information.stored.in.your.keystore.", - "* The integrity of the information stored in your keystore *"}, - {".The.integrity.of.the.information.stored.in.the.srckeystore.", - "* The integrity of the information stored in the srckeystore*"}, - {".has.NOT.been.verified.In.order.to.verify.its.integrity.", - "* has NOT been verified! In order to verify its integrity, *"}, - {".you.must.provide.your.keystore.password.", + "* The integrity of the information stored in your keystore *\n" + + "* has NOT been verified! In order to verify its integrity, *\n" + "* you must provide your keystore password. *"}, - {".you.must.provide.the.srckeystore.password.", + {".The.integrity.of.the.information.stored.in.the.srckeystore.", + "* The integrity of the information stored in the srckeystore*\n" + + "* has NOT been verified! In order to verify its integrity, *\n" + "* you must provide the srckeystore password. *"}, - {"Certificate.reply.does.not.contain.public.key.for.alias.", "Certificate reply does not contain public key for <{0}>"}, {"Incomplete.certificate.chain.in.reply",