harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r440675 [1/2] - in /incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java: common/javax/security/auth/ common/javax/security/auth/callback/ common/javax/security/auth/kerberos/ common/javax/security/auth/login/ common/javax/s...
Date Wed, 06 Sep 2006 10:03:31 GMT
Author: smishura
Date: Wed Sep  6 03:03:27 2006
New Revision: 440675

URL: http://svn.apache.org/viewvc?view=rev&rev=440675
Log:
Apply patch for HARMONY-1312 ([classlib][internationalization]Internationalization of the auth module)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/AuthPermission.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/Policy.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/PrivateCredentialPermission.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/Subject.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/SubjectDomainCombiner.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/ChoiceCallback.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/ConfirmationCallback.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/NameCallback.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/PasswordCallback.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/TextInputCallback.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/TextOutputCallback.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/DelegationPermission.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/KerberosKey.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/KerberosPrincipal.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/KerberosTicket.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/ServicePermission.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/login/AppConfigurationEntry.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/login/Configuration.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/login/LoginContext.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/x500/X500Principal.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/x500/X500PrivateCredential.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/Sasl.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslException.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/org/apache/harmony/auth/DefaultSubjectPolicy.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/org/apache/harmony/auth/internal/nls/messages.properties
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/org/apache/harmony/auth/login/DefaultConfiguration.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/org/apache/harmony/auth/login/DefaultConfigurationParser.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/org/ietf/jgss/GSSException.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/org/ietf/jgss/GSSManager.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/org/ietf/jgss/Oid.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/linux/org/apache/harmony/auth/UnixNumericGroupPrincipal.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/linux/org/apache/harmony/auth/UnixNumericUserPrincipal.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/linux/org/apache/harmony/auth/UnixPrincipal.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/linux/org/apache/harmony/auth/module/UnixLoginModule.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/linux/org/apache/harmony/auth/module/UnixSystem.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/windows/org/apache/harmony/auth/NTDomainPrincipal.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/windows/org/apache/harmony/auth/NTNumericCredential.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/windows/org/apache/harmony/auth/NTSid.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/windows/org/apache/harmony/auth/NTUserPrincipal.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/windows/org/apache/harmony/auth/module/NTLoginModule.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/windows/org/apache/harmony/auth/module/NTSystem.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/AuthPermission.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/AuthPermission.java?view=diff&rev=440675&r1=440674&r2=440675
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/AuthPermission.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/AuthPermission.java Wed Sep  6 03:03:27 2006
@@ -23,6 +23,8 @@
 
 import java.security.BasicPermission;
 
+import org.apache.harmony.auth.internal.nls.Messages;
+
 /** 
  * @com.intel.drl.spec_ref 
  * 
@@ -35,15 +37,15 @@
      */
     private static final long serialVersionUID = 5806031445061587174L;
 
-    private static final String CREATE_LOGIN_CONTEXT = "createLoginContext";
+    private static final String CREATE_LOGIN_CONTEXT = "createLoginContext"; //$NON-NLS-1$
 
-    private static final String CREATE_LOGIN_CONTEXT_ANY = "createLoginContext.*";
+    private static final String CREATE_LOGIN_CONTEXT_ANY = "createLoginContext.*"; //$NON-NLS-1$
 
     // inits permission name.  
     private static String init(String name) {
 
         if (name == null) {
-            throw new NullPointerException("name is null");
+            throw new NullPointerException(Messages.getString("auth.13")); //$NON-NLS-1$
         }
 
         if (CREATE_LOGIN_CONTEXT.equals(name)) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/Policy.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/Policy.java?view=diff&rev=440675&r1=440674&r2=440675
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/Policy.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/Policy.java Wed Sep  6 03:03:27 2006
@@ -28,6 +28,7 @@
 
 import org.apache.harmony.security.fortress.PolicyUtils;
 import org.apache.harmony.auth.DefaultSubjectPolicy;
+import org.apache.harmony.auth.internal.nls.Messages;
 
 
 /**
@@ -44,15 +45,15 @@
 {
 
     // Key to security properties, defining default policy provider.
-    private static final String POLICY_PROVIDER = "auth.policy.provider";
+    private static final String POLICY_PROVIDER = "auth.policy.provider"; //$NON-NLS-1$
 
     // The AuthPermission required to set custom Policy.
     private static final AuthPermission SET_POLICY = new AuthPermission(
-            "setPolicy");
+            "setPolicy"); //$NON-NLS-1$
 
     // The AuthPermission required to get current Policy.
     private static final AuthPermission GET_POLICY = new AuthPermission(
-            "getPolicy");
+            "getPolicy"); //$NON-NLS-1$
 
     // the current policy object
     private static Policy activePolicy;
@@ -127,7 +128,7 @@
                             ClassLoader.getSystemClassLoader()).newInstance();
                 } catch (Exception e) {
                     SecurityException se = new SecurityException(
-                            "Failed to load Subject-based policy");
+                            Messages.getString("auth.08")); //$NON-NLS-1$
                     se.initCause(e);
                     throw se;
                 }
@@ -135,7 +136,7 @@
         });
 
         if (!(policy instanceof Policy)) {
-            throw new SecurityException("Failed to load Subject-based policy");
+            throw new SecurityException(Messages.getString("auth.08")); //$NON-NLS-1$
         }
         return (Policy) policy;
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/PrivateCredentialPermission.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/PrivateCredentialPermission.java?view=diff&rev=440675&r1=440674&r2=440675
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/PrivateCredentialPermission.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/PrivateCredentialPermission.java Wed Sep  6 03:03:27 2006
@@ -30,6 +30,8 @@
 import java.util.Iterator;
 import java.util.Set;
 
+import org.apache.harmony.auth.internal.nls.Messages;
+
 /** 
  * @com.intel.drl.spec_ref 
  *
@@ -43,7 +45,7 @@
     private static final long serialVersionUID = 5284372143517237068L;
 
     // allowed action
-    private static final String READ = "read";
+    private static final String READ = "read"; //$NON-NLS-1$
 
     /** 
      * @com.intel.drl.spec_ref 
@@ -70,21 +72,20 @@
     private void initTargetName(String name) {
 
         if (name == null) {
-            throw new NullPointerException("target name is null");
+            throw new NullPointerException(Messages.getString("auth.0E")); //$NON-NLS-1$
         }
 
         // check empty string
         name = name.trim();
         if (name.length() == 0) {
-            throw new IllegalArgumentException("target name has a length of 0");
+            throw new IllegalArgumentException(Messages.getString("auth.0F")); //$NON-NLS-1$
         }
 
         // get CredentialClass
         int beg = name.indexOf(' ');
         if (beg == -1) {
             throw new IllegalArgumentException(
-                    "Target name MUST have the following syntax: "
-                            + "CredentialClass 1*(PrincipalClass \"PrincipalName\")");
+                    Messages.getString("auth.10")); //$NON-NLS-1$
         }
         this.credentialClass = name.substring(0, beg);
 
@@ -98,16 +99,14 @@
 
             if (i == -1 || j == -1 || name.charAt(i + 1) != '"') {
                 throw new IllegalArgumentException(
-                        "Target name MUST have the following syntax: "
-                                + "CredentialClass 1*(PrincipalClass \"PrincipalName\")");
+                        Messages.getString("auth.10")); //$NON-NLS-1$
             }
         }
 
         // name MUST have one pair at least
         if (count < 1) {
             throw new IllegalArgumentException(
-                    "Target name MUST have the following syntax: "
-                            + "CredentialClass 1*(PrincipalClass \"PrincipalName\")");
+                    Messages.getString("auth.10")); //$NON-NLS-1$
         }
 
         beg = name.indexOf(' ');
@@ -157,7 +156,7 @@
         if (READ.equalsIgnoreCase(action)) {
             initTargetName(name);
         } else {
-            throw new IllegalArgumentException("Action must be \"read\" only");
+            throw new IllegalArgumentException(Messages.getString("auth.11")); //$NON-NLS-1$
         }
     }
 
@@ -261,7 +260,7 @@
 
         PrivateCredentialPermission that = (PrivateCredentialPermission) permission;
 
-        if (!("*".equals(this.credentialClass) || this.credentialClass
+        if (!("*".equals(this.credentialClass) || this.credentialClass //$NON-NLS-1$
                 .equals(that.getCredentialClass()))) {
             return false;
         }
@@ -347,18 +346,17 @@
         // Creates a new CredOwner with the specified Principal Class and Principal Name 
         CredOwner(String principalClass, String principalName) {
 
-            if ("*".equals(principalClass)) {
+            if ("*".equals(principalClass)) { //$NON-NLS-1$
                 isClassWildcard = true;
             }
 
-            if ("*".equals(principalName)) {
+            if ("*".equals(principalName)) { //$NON-NLS-1$
                 isPNameWildcard = true;
             }
 
             if (isClassWildcard && !isPNameWildcard) {
                 throw new IllegalArgumentException(
-                        "invalid syntax: Principal Class can not be a wildcard (*)"
-                                + "value if Principal Name is not a wildcard (*) value");
+                        Messages.getString("auth.12")); //$NON-NLS-1$
             }
 
             this.principalClass = principalClass;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/Subject.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/Subject.java?view=diff&rev=440675&r1=440674&r2=440675
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/Subject.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/Subject.java Wed Sep  6 03:03:27 2006
@@ -40,6 +40,8 @@
 import java.util.LinkedList;
 import java.util.Set;
 
+import org.apache.harmony.auth.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  * 
@@ -63,25 +65,25 @@
     // set of public credentials
     private transient SecureSet publicCredentials;
 
-    private static final AuthPermission _AS = new AuthPermission("doAs");
+    private static final AuthPermission _AS = new AuthPermission("doAs"); //$NON-NLS-1$
 
     private static final AuthPermission _AS_PRIVILEGED = new AuthPermission(
-            "doAsPrivileged");
+            "doAsPrivileged"); //$NON-NLS-1$
 
     private static final AuthPermission _SUBJECT = new AuthPermission(
-            "getSubject");
+            "getSubject"); //$NON-NLS-1$
 
     private static final AuthPermission _PRINCIPALS = new AuthPermission(
-            "modifyPrincipals");
+            "modifyPrincipals"); //$NON-NLS-1$
 
     private static final AuthPermission _PRIVATE_CREDENTIALS = new AuthPermission(
-            "modifyPrivateCredentials");
+            "modifyPrivateCredentials"); //$NON-NLS-1$
 
     private static final AuthPermission _PUBLIC_CREDENTIALS = new AuthPermission(
-            "modifyPublicCredentials");
+            "modifyPublicCredentials"); //$NON-NLS-1$
 
     private static final AuthPermission _READ_ONLY = new AuthPermission(
-            "setReadOnly");
+            "setReadOnly"); //$NON-NLS-1$
 
     /**
      * @com.intel.drl.spec_ref
@@ -323,18 +325,18 @@
      */
     public String toString() {
 
-        StringBuffer buf = new StringBuffer("Subject:\n");
+        StringBuffer buf = new StringBuffer("Subject:\n"); //$NON-NLS-1$
 
         Iterator it = principals.iterator();
         while (it.hasNext()) {
-            buf.append("\tPrincipal: ");
+            buf.append("\tPrincipal: "); //$NON-NLS-1$
             buf.append(it.next());
             buf.append('\n');
         }
 
         it = publicCredentials.iterator();
         while (it.hasNext()) {
-            buf.append("\tPublic Credential: ");
+            buf.append("\tPublic Credential: "); //$NON-NLS-1$
             buf.append(it.next());
             buf.append('\n');
         }
@@ -343,13 +345,13 @@
         it = privateCredentials.iterator();
         try {
             while (it.hasNext()) {
-                buf.append("\tPrivate Credential: ");
+                buf.append("\tPrivate Credential: "); //$NON-NLS-1$
                 buf.append(it.next());
                 buf.append('\n');
             }
         } catch (SecurityException e) {
             buf.delete(offset, buf.length());
-            buf.append("\tPrivate Credentials: no accessible information\n");
+            buf.append("\tPrivate Credentials: no accessible information\n"); //$NON-NLS-1$
         }
         return buf.toString();
     }
@@ -379,7 +381,7 @@
     public static Subject getSubject(final AccessControlContext context) {
         checkPermission(_SUBJECT);
         if (context == null) {
-        	throw new NullPointerException("invalid AccessControlContext");
+        	throw new NullPointerException(Messages.getString("auth.09")); //$NON-NLS-1$
         }
         PrivilegedAction action = new PrivilegedAction() {
             public Object run() {
@@ -407,7 +409,7 @@
     // FIXME is used only in two places. remove?
     private void checkState() {
         if (readOnly) {
-            throw new IllegalStateException("Set is read only");
+            throw new IllegalStateException(Messages.getString("auth.0A")); //$NON-NLS-1$
         }
     }
 
@@ -495,7 +497,7 @@
                     && !(java.security.Principal.class.isAssignableFrom(o
                             .getClass()))) {
                 throw new IllegalArgumentException(
-                        "Element is not instance of java.security.Principal");
+                        Messages.getString("auth.0B")); //$NON-NLS-1$
             }
         }
 
@@ -569,8 +571,7 @@
 
                     if (!c.isAssignableFrom(o.getClass())) {
                         throw new IllegalArgumentException(
-                                "Invalid argument class. MUST be instance of "
-                                        + c.getName());
+                                Messages.getString("auth.0C", c.getName())); //$NON-NLS-1$
                     }
 
                     if (elements.contains(o)) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/SubjectDomainCombiner.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/SubjectDomainCombiner.java?view=diff&rev=440675&r1=440674&r2=440675
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/SubjectDomainCombiner.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/SubjectDomainCombiner.java Wed Sep  6 03:03:27 2006
@@ -38,7 +38,7 @@
 
     // permission required to get a subject object
     private static final AuthPermission _GET = new AuthPermission(
-            "getSubjectFromDomainCombiner");
+            "getSubjectFromDomainCombiner"); //$NON-NLS-1$
 
     /**
      * @com.intel.drl.spec_ref

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/ChoiceCallback.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/ChoiceCallback.java?view=diff&rev=440675&r1=440674&r2=440675
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/ChoiceCallback.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/ChoiceCallback.java Wed Sep  6 03:03:27 2006
@@ -23,6 +23,8 @@
 
 import java.io.Serializable;
 
+import org.apache.harmony.auth.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  *
@@ -62,11 +64,11 @@
     // sets the choices.
     private void setChoices(String[] choices) {
         if (choices == null || choices.length == 0){
-            throw new IllegalArgumentException("Invalid choices");
+            throw new IllegalArgumentException(Messages.getString("auth.1C")); //$NON-NLS-1$
         }
         for (int i = 0; i < choices.length; i++) {
             if (choices[i] == null || choices[i].length() == 0) {
-                throw new IllegalArgumentException("Invalid choices");
+                throw new IllegalArgumentException(Messages.getString("auth.1C")); //$NON-NLS-1$
             }
         }
         //FIXME: System.arraycopy(choices, 0 , new String[choices.length], 0, choices.length);
@@ -77,7 +79,7 @@
     // sets the prompt.
     private void setPrompt(String prompt) {
         if (prompt == null || prompt.length() == 0) {
-            throw new IllegalArgumentException("Invalid prompt");
+            throw new IllegalArgumentException(Messages.getString("auth.14")); //$NON-NLS-1$
         }
         this.prompt = prompt;
     }
@@ -85,7 +87,7 @@
     // sets the defaultChoice.
     private void setDefaultChoice(int defaultChoice) {
         if (0 > defaultChoice || defaultChoice >= choices.length) {
-            throw new IllegalArgumentException("Invalid default choices");
+            throw new IllegalArgumentException(Messages.getString("auth.1D")); //$NON-NLS-1$
         }
         this.defaultChoice = defaultChoice;
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/ConfirmationCallback.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/ConfirmationCallback.java?view=diff&rev=440675&r1=440674&r2=440675
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/ConfirmationCallback.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/ConfirmationCallback.java Wed Sep  6 03:03:27 2006
@@ -23,6 +23,8 @@
 
 import java.io.Serializable;
 
+import org.apache.harmony.auth.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  *
@@ -127,28 +129,28 @@
 
         if (messageType > ERROR ||
                 messageType < INFORMATION) {
-            throw new IllegalArgumentException("Invalid message type");
+            throw new IllegalArgumentException(Messages.getString("auth.16")); //$NON-NLS-1$
         }
 
         switch (optionType) {
         case YES_NO_OPTION:
             if (defaultOption != YES && defaultOption != NO) {
-                throw new IllegalArgumentException("invalid defaultOption");
+                throw new IllegalArgumentException(Messages.getString("auth.17")); //$NON-NLS-1$
             }
             break;
         case YES_NO_CANCEL_OPTION:
             if (defaultOption != YES && defaultOption != NO
                     && defaultOption != CANCEL) {
-                throw new IllegalArgumentException("invalid defaultOption");
+                throw new IllegalArgumentException(Messages.getString("auth.17")); //$NON-NLS-1$
             }
             break;
         case OK_CANCEL_OPTION:
             if (defaultOption != OK && defaultOption != CANCEL) {
-                throw new IllegalArgumentException("invalid defaultOption");
+                throw new IllegalArgumentException(Messages.getString("auth.17")); //$NON-NLS-1$
             }
             break;
         default:
-            throw new IllegalArgumentException("Invalid option type");
+            throw new IllegalArgumentException(Messages.getString("auth.18")); //$NON-NLS-1$
         }
         this.messageType = messageType;
         this.optionType = optionType;
@@ -163,19 +165,19 @@
 
         if (messageType > ERROR ||
                 messageType < INFORMATION) {
-            throw new IllegalArgumentException("Invalid message type");
+            throw new IllegalArgumentException(Messages.getString("auth.16")); //$NON-NLS-1$
         }
 
         if (options == null || options.length == 0) {
-            throw new IllegalArgumentException("Invalid options");
+            throw new IllegalArgumentException(Messages.getString("auth.1A")); //$NON-NLS-1$
         }
         for (int i = 0; i < options.length; i++) {
             if (options[i] == null || options[i].length() == 0) {
-                throw new IllegalArgumentException("Invalid options");
+                throw new IllegalArgumentException(Messages.getString("auth.1A")); //$NON-NLS-1$
             }
         }
         if (0 > defaultOption  || defaultOption >= options.length) {
-            throw new IllegalArgumentException("Invalid defaultOption");
+            throw new IllegalArgumentException(Messages.getString("auth.17")); //$NON-NLS-1$
         }
         //FIXME:System.arraycopy(options, 0 , new String[this.options.length], 0, this.options.length);
         this.options = options;
@@ -190,33 +192,33 @@
             int defaultOption) {
 
         if (prompt == null || prompt.length() == 0) {
-            throw new IllegalArgumentException("Invalid prompt");
+            throw new IllegalArgumentException(Messages.getString("auth.14")); //$NON-NLS-1$
         }
         
         if (messageType > ERROR ||
                 messageType < INFORMATION) {
-            throw new IllegalArgumentException("Invalid message type");
+            throw new IllegalArgumentException(Messages.getString("auth.16")); //$NON-NLS-1$
         }
 
         switch (optionType) {
         case YES_NO_OPTION:
             if (defaultOption != YES && defaultOption != NO) {
-                throw new IllegalArgumentException("invalid defaultOption");
+                throw new IllegalArgumentException(Messages.getString("auth.17")); //$NON-NLS-1$
             }
             break;
         case YES_NO_CANCEL_OPTION:
             if (defaultOption != YES && defaultOption != NO
                     && defaultOption != CANCEL) {
-                throw new IllegalArgumentException("invalid defaultOption");
+                throw new IllegalArgumentException(Messages.getString("auth.17")); //$NON-NLS-1$
             }
             break;
         case OK_CANCEL_OPTION:
             if (defaultOption != OK && defaultOption != CANCEL) {
-                throw new IllegalArgumentException("invalid defaultOption");
+                throw new IllegalArgumentException(Messages.getString("auth.17")); //$NON-NLS-1$
             }
             break;
         default:
-            throw new IllegalArgumentException("Invalid option type");
+            throw new IllegalArgumentException(Messages.getString("auth.18")); //$NON-NLS-1$
         }
         this.prompt = prompt;
         this.messageType = messageType;
@@ -231,24 +233,24 @@
             String[] options, int defaultOption) {
 
         if (prompt == null || prompt.length() == 0) {
-            throw new IllegalArgumentException("Invalid prompt");
+            throw new IllegalArgumentException(Messages.getString("auth.14")); //$NON-NLS-1$
         }
 
         if (messageType > ERROR ||
                 messageType < INFORMATION) {
-            throw new IllegalArgumentException("Invalid message type");
+            throw new IllegalArgumentException(Messages.getString("auth.16")); //$NON-NLS-1$
         }
 
         if (options == null || options.length == 0) {
-            throw new IllegalArgumentException("Invalid options");
+            throw new IllegalArgumentException(Messages.getString("auth.1A")); //$NON-NLS-1$
         }
         for (int i = 0; i < options.length; i++) {
             if (options[i] == null || options[i].length() == 0) {
-                throw new IllegalArgumentException("Invalid options");
+                throw new IllegalArgumentException(Messages.getString("auth.1A")); //$NON-NLS-1$
             }
         }
         if (0 > defaultOption  || defaultOption >= options.length) {
-            throw new IllegalArgumentException("Invalid defaultOption");
+            throw new IllegalArgumentException(Messages.getString("auth.17")); //$NON-NLS-1$
         }
         //FIXME:System.arraycopy(options, 0 , new String[this.options.length], 0, this.options.length);
         this.options = options;
@@ -307,24 +309,24 @@
             if ( 0 <= selection && selection <= options.length) {
                 this.selection = selection;
             } else {
-                throw new ArrayIndexOutOfBoundsException("specified selection is out of bounds");
+                throw new ArrayIndexOutOfBoundsException(Messages.getString("auth.1B")); //$NON-NLS-1$
             }
         } else {
             switch (optionType) {
             case YES_NO_OPTION:
                 if (selection != YES && selection != NO) {
-                    throw new IllegalArgumentException("invalid selection");
+                    throw new IllegalArgumentException(Messages.getString("auth.19")); //$NON-NLS-1$
                 }
                 break;
             case YES_NO_CANCEL_OPTION:
                 if (selection != YES && selection != NO
                         && selection != CANCEL) {
-                    throw new IllegalArgumentException("invalid selection");
+                    throw new IllegalArgumentException(Messages.getString("auth.19")); //$NON-NLS-1$
                 }
                 break;
             case OK_CANCEL_OPTION:
                 if (selection != OK && selection != CANCEL) {
-                    throw new IllegalArgumentException("invalid selection");
+                    throw new IllegalArgumentException(Messages.getString("auth.19")); //$NON-NLS-1$
                 }
                 break;
             }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/NameCallback.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/NameCallback.java?view=diff&rev=440675&r1=440674&r2=440675
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/NameCallback.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/NameCallback.java Wed Sep  6 03:03:27 2006
@@ -23,6 +23,8 @@
 
 import java.io.Serializable;
 
+import org.apache.harmony.auth.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  *
@@ -52,7 +54,7 @@
     // sets the prompt
     private void setPrompt(String prompt) {
         if (prompt == null || prompt.length() == 0) {
-            throw new IllegalArgumentException("Invalid prompt");
+            throw new IllegalArgumentException(Messages.getString("auth.14")); //$NON-NLS-1$
         }
         this.prompt = prompt;
     }
@@ -60,7 +62,7 @@
     // sets the default name
     private void setDefaultName(String defaultName) {
         if (defaultName == null || defaultName.length() == 0) {
-            throw new IllegalArgumentException("Invalid default name");
+            throw new IllegalArgumentException(Messages.getString("auth.1E")); //$NON-NLS-1$
         }
         this.defaultName = defaultName;
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/PasswordCallback.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/PasswordCallback.java?view=diff&rev=440675&r1=440674&r2=440675
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/PasswordCallback.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/PasswordCallback.java Wed Sep  6 03:03:27 2006
@@ -24,6 +24,8 @@
 import java.io.Serializable;
 import java.util.Arrays;
 
+import org.apache.harmony.auth.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  *
@@ -53,7 +55,7 @@
     // sets the prompt
     private void setPrompt(String prompt) throws IllegalArgumentException {
         if (prompt == null || prompt.length() == 0) {
-            throw new IllegalArgumentException("Invalid prompt");
+            throw new IllegalArgumentException(Messages.getString("auth.14")); //$NON-NLS-1$
         }
         this.prompt = prompt;
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/TextInputCallback.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/TextInputCallback.java?view=diff&rev=440675&r1=440674&r2=440675
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/TextInputCallback.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/TextInputCallback.java Wed Sep  6 03:03:27 2006
@@ -23,6 +23,8 @@
 
 import java.io.Serializable;
 
+import org.apache.harmony.auth.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  *
@@ -52,7 +54,7 @@
     // sets the prompt
     private void setPrompt(String prompt) {
         if (prompt == null || prompt.length() == 0) {
-            throw new IllegalArgumentException("Invalid prompt");
+            throw new IllegalArgumentException(Messages.getString("auth.14")); //$NON-NLS-1$
         }
         this.prompt = prompt;
     }
@@ -60,7 +62,7 @@
     // sets the default text
     private void setDefaultText(String defaultText) {
         if (defaultText == null || defaultText.length() == 0) {
-            throw new IllegalArgumentException("Invalid default text");
+            throw new IllegalArgumentException(Messages.getString("auth.15")); //$NON-NLS-1$
         }
         this.defaultText = defaultText;
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/TextOutputCallback.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/TextOutputCallback.java?view=diff&rev=440675&r1=440674&r2=440675
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/TextOutputCallback.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/callback/TextOutputCallback.java Wed Sep  6 03:03:27 2006
@@ -23,6 +23,8 @@
 
 import java.io.Serializable;
 
+import org.apache.harmony.auth.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  *
@@ -64,10 +66,10 @@
      */
     public TextOutputCallback(int messageType, String message) {
         if (messageType > ERROR || messageType < INFORMATION) {
-            throw new IllegalArgumentException("Invalid message type");
+            throw new IllegalArgumentException(Messages.getString("auth.16")); //$NON-NLS-1$
         }
         if (message == null || message.length() == 0) {
-            throw new IllegalArgumentException("Invalid message");
+            throw new IllegalArgumentException(Messages.getString("auth.1F")); //$NON-NLS-1$
         }
         this.messageType = messageType;
         this.message = message;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/DelegationPermission.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/DelegationPermission.java?view=diff&rev=440675&r1=440674&r2=440675
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/DelegationPermission.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/DelegationPermission.java Wed Sep  6 03:03:27 2006
@@ -33,6 +33,8 @@
 import java.util.NoSuchElementException;
 import java.util.Vector;
 
+import org.apache.harmony.auth.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  */
@@ -54,7 +56,7 @@
         // length MUST be at least 7 characters
         if (length < 7) {
             throw new IllegalArgumentException(
-                    "Name must have the following syntax: \"subordinate service\" \"target service \"");
+                    Messages.getString("auth.20")); //$NON-NLS-1$
 
         }
 
@@ -66,7 +68,7 @@
                 || trName.charAt(index + 2) != '"'
                 || trName.charAt(trName.length() - 1) != '"') {
             throw new IllegalArgumentException(
-                    "Name must have the following syntax: \"subordinate service\" \"target service \"");
+                    Messages.getString("auth.20")); //$NON-NLS-1$
         }
         return trName;
     }
@@ -155,7 +157,7 @@
     private transient int offset;
 
     private static final ObjectStreamField[] serialPersistentFields = { new ObjectStreamField(
-            "permissions", Vector.class) };
+            "permissions", Vector.class) }; //$NON-NLS-1$
 
     //initialization of a collection
     KrbDelegationPermissionCollection() {
@@ -167,12 +169,11 @@
     public void add(Permission permission) {
 
         if (isReadOnly()) {
-            throw new SecurityException("collection is read-only");
+            throw new SecurityException(Messages.getString("auth.21")); //$NON-NLS-1$
         }
 
         if (permission == null || !(permission instanceof DelegationPermission)) {
-            throw new IllegalArgumentException("invalid permission: "
-                    + permission);
+            throw new IllegalArgumentException(Messages.getString("auth.22", permission)); //$NON-NLS-1$
         }
         synchronized (this) {
             if (offset == items.length) {
@@ -231,7 +232,7 @@
             }
         }
         ObjectOutputStream.PutField fields = out.putFields();
-        fields.put("permissions", permissions);
+        fields.put("permissions", permissions); //$NON-NLS-1$
         out.writeFields();
     }
 
@@ -239,12 +240,12 @@
     private void readObject(java.io.ObjectInputStream in) throws IOException,
             ClassNotFoundException {
         ObjectInputStream.GetField fields = in.readFields();
-        Vector permissions = (Vector) fields.get("permissions", null);
+        Vector permissions = (Vector) fields.get("permissions", null); //$NON-NLS-1$
         items = new DelegationPermission[permissions.size() * 2];
         for (offset = 0; offset < items.length / 2;) {
             Object obj = permissions.get(offset);
             if (obj == null || !(obj instanceof DelegationPermission)) {
-                throw new IllegalArgumentException("invalid permission: " + obj);
+                throw new IllegalArgumentException(Messages.getString("auth.22", obj)); //$NON-NLS-1$
             }
             items[offset++] = (DelegationPermission) obj;
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/KerberosKey.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/KerberosKey.java?view=diff&rev=440675&r1=440674&r2=440675
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/KerberosKey.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/KerberosKey.java Wed Sep  6 03:03:27 2006
@@ -34,6 +34,7 @@
 import javax.security.auth.DestroyFailedException;
 import javax.security.auth.Destroyable;
 
+import org.apache.harmony.auth.internal.nls.Messages;
 import org.apache.harmony.security.utils.Array;
 
 /**
@@ -66,7 +67,7 @@
                        int keyType, int versionNumber) {
 
         if (keyBytes == null) {
-            throw new NullPointerException("key is null");
+            throw new NullPointerException(Messages.getString("auth.47")); //$NON-NLS-1$
         }
 
         this.principal = principal;
@@ -154,8 +155,8 @@
     public String toString() {
         checkState();
         StringBuffer sb = new StringBuffer();
-        sb.append("KerberosPrincipal ").append(principal.getName()).append("\n");
-        sb.append("KeyVersion ").append(versionNum).append("\n");
+        sb.append("KerberosPrincipal ").append(principal.getName()).append("\n"); //$NON-NLS-1$ //$NON-NLS-2$
+        sb.append("KeyVersion ").append(versionNum).append("\n"); //$NON-NLS-1$ //$NON-NLS-2$
         sb.append(key.toString());
         return sb.toString();
     } 
@@ -163,7 +164,7 @@
     // if a key is destroyed then IllegalStateException must be thrown 
     private void checkState() {
         if (destroyed) {
-            throw new IllegalStateException ("The key is destroyed");
+            throw new IllegalStateException (Messages.getString("auth.48")); //$NON-NLS-1$
         }
     }
 }
@@ -253,8 +254,8 @@
             throw new NullPointerException();
         }
 
-        if (algorithm != null && "DES".compareTo(algorithm) != 0) {
-            throw new IllegalArgumentException("Unsupported algorithm");
+        if (algorithm != null && "DES".compareTo(algorithm) != 0) { //$NON-NLS-1$
+            throw new IllegalArgumentException(Messages.getString("auth.49")); //$NON-NLS-1$
         }
 
         keyType = 3; // DES algorithm
@@ -304,13 +305,13 @@
 
         // calculate DES-CBC check sum
         try {
-            Cipher cipher = Cipher.getInstance("DES/CBC/NoPadding");
+            Cipher cipher = Cipher.getInstance("DES/CBC/NoPadding"); //$NON-NLS-1$
 
             // use tmp key as IV
             IvParameterSpec IV = new IvParameterSpec(keyBytes);
 
             // do DES encryption 
-            SecretKey secretKey = new SecretKeySpec(keyBytes, "DES");
+            SecretKey secretKey = new SecretKeySpec(keyBytes, "DES"); //$NON-NLS-1$
             cipher.init(Cipher.ENCRYPT_MODE, secretKey, IV);
             byte[] enc = cipher.doFinal(raw);
 
@@ -321,7 +322,7 @@
 
         } catch (Exception e) {
             throw new RuntimeException(
-                    "Failed to generate DES key from password.", e);
+                    Messages.getString("auth.4A"), e); //$NON-NLS-1$
         }
     }
 
@@ -350,9 +351,9 @@
     public final String getAlgorithm() {
         checkState();
         if (keyType == 0) {
-            return "NULL";
+            return "NULL"; //$NON-NLS-1$
         }
-        return "DES";
+        return "DES"; //$NON-NLS-1$
     }
     
     /**
@@ -361,7 +362,7 @@
      */
     public final String getFormat() {
         checkState();
-        return "RAW";
+        return "RAW"; //$NON-NLS-1$
     }
    
     /**
@@ -408,12 +409,12 @@
        StringBuffer sb = new StringBuffer();
        
        if (keyBytes.length == 0) {
-           s_key = "Empty Key";
+           s_key = "Empty Key"; //$NON-NLS-1$
        } else {
-           s_key = Array.toString(keyBytes," ");
+           s_key = Array.toString(keyBytes," "); //$NON-NLS-1$
        }
-       sb.append("EncryptionKey: ").append("KeyType = ").append(keyType);
-       sb.append("KeyBytes (Hex dump) = ").append(s_key);
+       sb.append("EncryptionKey: ").append("KeyType = ").append(keyType); //$NON-NLS-1$ //$NON-NLS-2$
+       sb.append("KeyBytes (Hex dump) = ").append(s_key); //$NON-NLS-1$
        return sb.toString();
    }
    
@@ -422,7 +423,7 @@
     */  
    private void checkState() {
        if (destroyed) {
-           throw new IllegalStateException ("The key is destroyed");
+           throw new IllegalStateException (Messages.getString("auth.48")); //$NON-NLS-1$
        }
    }
 
@@ -436,7 +437,7 @@
    private void writeObject(ObjectOutputStream s) throws IOException {
        
        if(destroyed){
-           throw new IOException("Key was destroyed");
+           throw new IOException(Messages.getString("auth.48")); //$NON-NLS-1$
        }
        s.defaultWriteObject();
    }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/KerberosPrincipal.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/KerberosPrincipal.java?view=diff&rev=440675&r1=440674&r2=440675
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/KerberosPrincipal.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/KerberosPrincipal.java Wed Sep  6 03:03:27 2006
@@ -28,6 +28,7 @@
 import java.util.StringTokenizer;
 
 import org.apache.harmony.auth.internal.kerberos.v5.PrincipalName;
+import org.apache.harmony.auth.internal.nls.Messages;
 import org.apache.harmony.security.asn1.ASN1StringType;
 
 /**
@@ -87,7 +88,7 @@
         // FIXME: correctly implement parsing name according to RFC 1964
         // http://www.ietf.org/rfc/rfc1964.txt
         if (name == null || name.trim().length() == 0) {
-            throw new IllegalArgumentException("Invalid principal name");
+            throw new IllegalArgumentException(Messages.getString("auth.23")); //$NON-NLS-1$
         }
         int pos = name.indexOf('@');
         if (pos != -1) {
@@ -103,7 +104,7 @@
         if (realm.indexOf('/') != -1 || realm.indexOf(':') != -1
                 || realm.indexOf(0) != -1) {
             throw new IllegalArgumentException(
-                    "Illegal character in realm name; one of: '/', ':', null");
+                    Messages.getString("auth.24")); //$NON-NLS-1$
         }
     }
 
@@ -128,7 +129,7 @@
         init(name);
         // TODO: it is gag
         if (type < 0 || type > KRB_NT_UID) {
-            throw new IllegalArgumentException("Invalid name type");
+            throw new IllegalArgumentException(Messages.getString("auth.25")); //$NON-NLS-1$
         }
         this.type = type;
     }
@@ -229,7 +230,7 @@
             //there is only one component in principal name
             nameString = new String[] { str };
         } else {
-            StringTokenizer strTknzr = new StringTokenizer(str, "/");
+            StringTokenizer strTknzr = new StringTokenizer(str, "/"); //$NON-NLS-1$
             nameString = new String[strTknzr.countTokens()];
             for (int i = 0; i < nameString.length; i++) {
                 nameString[i] = strTknzr.nextToken();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/KerberosTicket.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/KerberosTicket.java?view=diff&rev=440675&r1=440674&r2=440675
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/KerberosTicket.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/KerberosTicket.java Wed Sep  6 03:03:27 2006
@@ -31,6 +31,7 @@
 import javax.security.auth.RefreshFailedException;
 import javax.security.auth.Refreshable;
 
+import org.apache.harmony.auth.internal.nls.Messages;
 import org.apache.harmony.security.utils.Array;
 
 
@@ -83,7 +84,7 @@
     private static final int UNUSED = 31; 
 
     // line feed 
-    private static final String LF = "\n";
+    private static final String LF = "\n"; //$NON-NLS-1$
     
     //ASN.1 encoding of the ticket
     private byte[] asn1Encoding;
@@ -130,26 +131,26 @@
 
         if (asn1Encoding == null) {
             throw new IllegalArgumentException(
-                "ASN.1 encoding of this ticket is null");
+                Messages.getString("auth.3B")); //$NON-NLS-1$
         }
         if (client == null) {
-            throw new IllegalArgumentException("client is null");
+            throw new IllegalArgumentException(Messages.getString("auth.3C")); //$NON-NLS-1$
         }
 
         if (server == null) {
-            throw new IllegalArgumentException("server is null");
+            throw new IllegalArgumentException(Messages.getString("auth.3D")); //$NON-NLS-1$
         }
 
         if (keyBytes == null) {
-            throw new IllegalArgumentException("session key is null");
+            throw new IllegalArgumentException(Messages.getString("auth.3E")); //$NON-NLS-1$
         }
 
         if (authTime == null) {
-            throw new IllegalArgumentException("authentication time is null");
+            throw new IllegalArgumentException(Messages.getString("auth.3F")); //$NON-NLS-1$
         }
 
         if (endTime == null) {
-            throw new IllegalArgumentException("expiration time is null");
+            throw new IllegalArgumentException(Messages.getString("auth.40")); //$NON-NLS-1$
         }
 
         this.asn1Encoding = new byte[asn1Encoding.length];
@@ -176,7 +177,7 @@
 
         if (flags[RENEWABLE] && renewTill == null) {
             throw new IllegalArgumentException(
-                "An absolute expiration time can not be null for renewable tickets");
+                Messages.getString("auth.41")); //$NON-NLS-1$
         }
 
         this.renewTill = renewTill;
@@ -189,7 +190,7 @@
         
         if (startTime.getTime() > endTime.getTime()) {
             //TODO: make correct description of the exception  
-            throw new IllegalArgumentException("Incorrect start or end time");
+            throw new IllegalArgumentException(Messages.getString("auth.42")); //$NON-NLS-1$
         }
         
         this.authTime = authTime;
@@ -375,7 +376,7 @@
             this.clientAddresses = null;
             destroyed = true;
         } else {
-            throw new DestroyFailedException("This ticket is already destroyed"); 
+            throw new DestroyFailedException(Messages.getString("auth.43"));  //$NON-NLS-1$
         }
 
     }
@@ -395,12 +396,12 @@
         checkState();
         
         if (!flags[RENEWABLE]) {
-            throw new RefreshFailedException("The ticket is not renewable");
+            throw new RefreshFailedException(Messages.getString("auth.44")); //$NON-NLS-1$
         }
 
         if (System.currentTimeMillis() > this.renewTill.getTime()) {
             throw new RefreshFailedException(
-                "The allowable renew time is passed for this ticket");
+                Messages.getString("auth.45")); //$NON-NLS-1$
         }
         
         //TODO: need access to a KDC server          
@@ -425,32 +426,32 @@
     public String toString() {
         checkState();
         StringBuffer sb = new StringBuffer();
-        sb.append("Ticket = ").append(Array.toString(asn1Encoding,"(hex) ") + LF);
-        sb.append("Client Principal = ").append(client.getName() + LF);
-        sb.append("Server Principal = ").append(server.getName() + LF);
+        sb.append("Ticket = ").append(Array.toString(asn1Encoding,"(hex) ") + LF); //$NON-NLS-1$ //$NON-NLS-2$
+        sb.append("Client Principal = ").append(client.getName() + LF); //$NON-NLS-1$
+        sb.append("Server Principal = ").append(server.getName() + LF); //$NON-NLS-1$
         //TODO: append session key
-        sb.append("Session Key = ").append(sessionKey.toString() + LF);
-        sb.append("Forwardable Ticket = ").append(flags[FORWARDABLE] + LF);
-        sb.append("Forwarded Ticket = ").append(flags[FORWARDED] + LF);
-        sb.append("Proxiable Ticket = ").append(flags[PROXIABLE] + LF);
-        sb.append("Proxy Ticket = ").append(flags[PROXY] + LF);
-        sb.append("Postdated Ticket = ").append(flags[POSTDATED] + LF);
-        sb.append("Renewable Ticket = ").append(flags[RENEWABLE] + LF);
-        sb.append("Initial Ticket = ").append(flags[INITIAL] + LF);
-        sb.append("Auth Time = ").append(this.authTime.toString() + LF);
-        sb.append("Start Time = ").append(this.startTime.toString() + LF);
-        sb.append("End Time = ").append(this.endTime.toString() + LF);
-        sb.append("Renew Till = ").append(this.renewTill.toString() + LF);
-        sb.append("Client Addresses ");
+        sb.append("Session Key = ").append(sessionKey.toString() + LF); //$NON-NLS-1$
+        sb.append("Forwardable Ticket = ").append(flags[FORWARDABLE] + LF); //$NON-NLS-1$
+        sb.append("Forwarded Ticket = ").append(flags[FORWARDED] + LF); //$NON-NLS-1$
+        sb.append("Proxiable Ticket = ").append(flags[PROXIABLE] + LF); //$NON-NLS-1$
+        sb.append("Proxy Ticket = ").append(flags[PROXY] + LF); //$NON-NLS-1$
+        sb.append("Postdated Ticket = ").append(flags[POSTDATED] + LF); //$NON-NLS-1$
+        sb.append("Renewable Ticket = ").append(flags[RENEWABLE] + LF); //$NON-NLS-1$
+        sb.append("Initial Ticket = ").append(flags[INITIAL] + LF); //$NON-NLS-1$
+        sb.append("Auth Time = ").append(this.authTime.toString() + LF); //$NON-NLS-1$
+        sb.append("Start Time = ").append(this.startTime.toString() + LF); //$NON-NLS-1$
+        sb.append("End Time = ").append(this.endTime.toString() + LF); //$NON-NLS-1$
+        sb.append("Renew Till = ").append(this.renewTill.toString() + LF); //$NON-NLS-1$
+        sb.append("Client Addresses "); //$NON-NLS-1$
         if (clientAddresses != null) {
             for (int i = 0; i < clientAddresses.length; i++) {
                 if (clientAddresses[i] == null) {
-                    throw new NullPointerException("InetAddress is null");
+                    throw new NullPointerException(Messages.getString("auth.46")); //$NON-NLS-1$
                 }
-                sb.append("clientAddresses[" + i + "] = ").append(clientAddresses[i].toString() + LF +"\t\t");
+                sb.append("clientAddresses[" + i + "] = ").append(clientAddresses[i].toString() + LF +"\t\t"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
             }
         } else {
-            sb.append("null");
+            sb.append("null"); //$NON-NLS-1$
         }
         
         return sb.toString();
@@ -461,7 +462,7 @@
      */
     private void checkState() {
         if (destroyed) {
-            throw new IllegalStateException("This ticket is destroyed");
+            throw new IllegalStateException(Messages.getString("auth.43")); //$NON-NLS-1$
         }
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/ServicePermission.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/ServicePermission.java?view=diff&rev=440675&r1=440674&r2=440675
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/ServicePermission.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/kerberos/ServicePermission.java Wed Sep  6 03:03:27 2006
@@ -32,6 +32,8 @@
 import java.util.NoSuchElementException;
 import java.util.Vector;
 
+import org.apache.harmony.auth.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  * 
@@ -44,10 +46,10 @@
      */
     private static final long serialVersionUID = -1227585031618624935L;
 
-    private static final String INITIATE = "initiate";
-    private static final String ACCEPT = "accept";
-    private static final String INITIATE_ACCEPT = "initiate,accept";
-    private static final String[] ACTIONS_TABLE = {"", ACCEPT, INITIATE, INITIATE_ACCEPT};
+    private static final String INITIATE = "initiate"; //$NON-NLS-1$
+    private static final String ACCEPT = "accept"; //$NON-NLS-1$
+    private static final String INITIATE_ACCEPT = "initiate,accept"; //$NON-NLS-1$
+    private static final String[] ACTIONS_TABLE = {"", ACCEPT, INITIATE, INITIATE_ACCEPT}; //$NON-NLS-1$
 
     private final static char ACCEPT_MASK = 1;
     private final static char INITIATE_MASK = 2;
@@ -66,7 +68,7 @@
     // initialization of actions
     private void initActions(String actions) {
         if (actions == null || actions.length() < MIN_LEN) {
-            throw new IllegalArgumentException("Invalid actions mask");
+            throw new IllegalArgumentException(Messages.getString("auth.2E")); //$NON-NLS-1$
         }
 
         char[] c_acts = actions.toCharArray();
@@ -89,7 +91,7 @@
             if (ptr > len6) {
                 // expect string "accept" or "initiate", not just white
                 // spaces
-                throw new IllegalArgumentException("Invalid actions mask");
+                throw new IllegalArgumentException(Messages.getString("auth.2E")); //$NON-NLS-1$
             }
 
             //parsing string
@@ -113,7 +115,7 @@
                 result |= INITIATE_MASK;
                 ptr += INITIATE_LEN;
             } else {
-                throw new IllegalArgumentException("Invalid actions mask");
+                throw new IllegalArgumentException(Messages.getString("auth.2E")); //$NON-NLS-1$
             }
 
             //skipping trailing whitespaces
@@ -131,7 +133,7 @@
         } while (c_acts[ptr++] == ',');
 
         // unknown trailing symbol
-        throw new IllegalArgumentException("Invalid actions mask");
+        throw new IllegalArgumentException(Messages.getString("auth.2E")); //$NON-NLS-1$
     }
 
     /**
@@ -143,10 +145,10 @@
         initActions(actions);
 
         if (name == null) {
-            throw new NullPointerException("service principal is null");
+            throw new NullPointerException(Messages.getString("auth.2F")); //$NON-NLS-1$
         }
         if (name.trim().length() == 0) {
-            throw new IllegalArgumentException("service principal is empty");
+            throw new IllegalArgumentException(Messages.getString("auth.30")); //$NON-NLS-1$
         }
     }
 
@@ -234,7 +236,7 @@
     private static final long serialVersionUID = -4118834211490102011L;
 
     private static final ObjectStreamField[] serialPersistentFields = { new ObjectStreamField(
-            "permissions", Vector.class) };
+            "permissions", Vector.class) }; //$NON-NLS-1$
 
     private transient ServicePermission[] items = new ServicePermission[10];
 
@@ -250,12 +252,11 @@
     public void add(Permission permission) {
 
         if (isReadOnly()) {
-            throw new SecurityException("collection is read-only");
+            throw new SecurityException(Messages.getString("auth.21")); //$NON-NLS-1$
         }
 
         if (permission == null || !(permission instanceof ServicePermission)) {
-            throw new IllegalArgumentException("invalid permission: "
-                    + permission);
+            throw new IllegalArgumentException(Messages.getString("auth.22",permission)); //$NON-NLS-1$
         }
         synchronized (this) {
             if (offset == items.length) {
@@ -316,7 +317,7 @@
             }
         }
         ObjectOutputStream.PutField fields = out.putFields();
-        fields.put("permissions", permissions);
+        fields.put("permissions", permissions); //$NON-NLS-1$
         out.writeFields();
     }
 
@@ -324,12 +325,12 @@
     private void readObject(java.io.ObjectInputStream in) throws IOException,
             ClassNotFoundException {
         ObjectInputStream.GetField fields = in.readFields();
-        Vector permissions = (Vector) fields.get("permissions", null);
+        Vector permissions = (Vector) fields.get("permissions", null); //$NON-NLS-1$
         items = new ServicePermission[permissions.size() * 2];
         for (offset = 0; offset < items.length / 2;) {
             Object obj = permissions.get(offset);
             if (obj == null || !(obj instanceof ServicePermission)) {
-                throw new IllegalArgumentException("invalid permission: " + obj);
+                throw new IllegalArgumentException(Messages.getString("auth.22", obj)); //$NON-NLS-1$
             }
             items[offset++] = (ServicePermission) obj;
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/login/AppConfigurationEntry.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/login/AppConfigurationEntry.java?view=diff&rev=440675&r1=440674&r2=440675
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/login/AppConfigurationEntry.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/login/AppConfigurationEntry.java Wed Sep  6 03:03:27 2006
@@ -24,6 +24,8 @@
 import java.util.Collections;
 import java.util.Map;
 
+import org.apache.harmony.auth.internal.nls.Messages;
+
 /** 
  * @com.intel.drl.spec_ref 
  */
@@ -48,15 +50,15 @@
 
         if (loginModuleName == null || loginModuleName.length() == 0) {
             throw new IllegalArgumentException(
-                    "name of the LoginModule is null or has a length of 0");
+                    Messages.getString("auth.26")); //$NON-NLS-1$
         }
 
         if (controlFlag == null) {
-            throw new IllegalArgumentException("invalid control flag");
+            throw new IllegalArgumentException(Messages.getString("auth.27")); //$NON-NLS-1$
         }
 
         if (options == null) {
-            throw new IllegalArgumentException("invalid options");
+            throw new IllegalArgumentException(Messages.getString("auth.1A")); //$NON-NLS-1$
         }
 
         this.loginModuleName = loginModuleName;
@@ -97,25 +99,25 @@
          * @com.intel.drl.spec_ref 
          */
         public static final LoginModuleControlFlag REQUIRED = new LoginModuleControlFlag(
-                "LoginModuleControlFlag: required");
+                "LoginModuleControlFlag: required"); //$NON-NLS-1$
 
         /** 
          * @com.intel.drl.spec_ref 
          */
         public static final LoginModuleControlFlag REQUISITE = new LoginModuleControlFlag(
-                "LoginModuleControlFlag: requisite");
+                "LoginModuleControlFlag: requisite"); //$NON-NLS-1$
 
         /** 
          * @com.intel.drl.spec_ref 
          */
         public static final LoginModuleControlFlag OPTIONAL = new LoginModuleControlFlag(
-                "LoginModuleControlFlag: optional");
+                "LoginModuleControlFlag: optional"); //$NON-NLS-1$
 
         /** 
          * @com.intel.drl.spec_ref 
          */
         public static final LoginModuleControlFlag SUFFICIENT = new LoginModuleControlFlag(
-                "LoginModuleControlFlag: sufficient");
+                "LoginModuleControlFlag: sufficient"); //$NON-NLS-1$
 
         // Creates the LoginModuleControlFlag object with specified a flag
         private LoginModuleControlFlag(String flag) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/login/Configuration.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/login/Configuration.java?view=diff&rev=440675&r1=440674&r2=440675
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/login/Configuration.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/login/Configuration.java Wed Sep  6 03:03:27 2006
@@ -37,14 +37,14 @@
     
     // creates a AuthPermission object with a specify property
     private static final AuthPermission GET_LOGIN_CONFIGURATION = new AuthPermission(
-            "getLoginConfiguration"); 
+            "getLoginConfiguration");  //$NON-NLS-1$
 
     // creates a AuthPermission object with a specify property
     private static final AuthPermission SET_LOGIN_CONFIGURATION = new AuthPermission(
-            "setLoginConfiguration");
+            "setLoginConfiguration"); //$NON-NLS-1$
     
     // Key to security properties, defining default configuration provider.
-    private static final String LOGIN_CONFIGURATION_PROVIDER = "login.configuration.provider";
+    private static final String LOGIN_CONFIGURATION_PROVIDER = "login.configuration.provider"; //$NON-NLS-1$
     
     /**
      * @com.intel.drl.spec_ref

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/login/LoginContext.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/login/LoginContext.java?view=diff&rev=440675&r1=440674&r2=440675
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/login/LoginContext.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/login/LoginContext.java Wed Sep  6 03:03:27 2006
@@ -40,13 +40,15 @@
 
 import javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag;
 
+import org.apache.harmony.auth.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  */
 
 public class LoginContext {
 
-    private static final String DEFAULT_CALLBACK_HANDLER_PROPERTY = "auth.login.defaultCallbackHandler";
+    private static final String DEFAULT_CALLBACK_HANDLER_PROPERTY = "auth.login.defaultCallbackHandler"; //$NON-NLS-1$
 
     // Integer constants which serve as a replacement for 
     // the corresponding LoginModuleControlFlag.* constants.
@@ -104,7 +106,7 @@
     public LoginContext(String name, CallbackHandler cbHandler)
             throws LoginException {
         if (cbHandler == null) {
-            throw new LoginException("CallbackHandler can not be null");
+            throw new LoginException(Messages.getString("auth.34")); //$NON-NLS-1$
         }
         init(name, null, cbHandler, null);
     }
@@ -114,7 +116,7 @@
      */
     public LoginContext(String name, Subject subject) throws LoginException {
         if (subject == null) {
-            throw new LoginException("Subject can not be null");
+            throw new LoginException(Messages.getString("auth.03")); //$NON-NLS-1$
         }
         init(name, subject, null, null);
     }
@@ -125,10 +127,10 @@
     public LoginContext(String name, Subject subject, CallbackHandler cbHandler)
             throws LoginException {
         if (subject == null) {
-            throw new LoginException("Subject can not be null");
+            throw new LoginException(Messages.getString("auth.03")); //$NON-NLS-1$
         }
         if (cbHandler == null) {
-            throw new LoginException("CallbackHandler can not be null");
+            throw new LoginException(Messages.getString("auth.34")); //$NON-NLS-1$
         }
         init(name, subject, cbHandler, null);
     }
@@ -155,7 +157,7 @@
         // Set config
         //
         if (name == null) {
-            throw new LoginException("name can not be null");
+            throw new LoginException(Messages.getString("auth.00")); //$NON-NLS-1$
         }
 
         if (config == null) {
@@ -168,7 +170,7 @@
 
         if (sm != null && !userProvidedConfig) {
             sm
-                    .checkPermission(new AuthPermission("createLoginContext."
+                    .checkPermission(new AuthPermission("createLoginContext." //$NON-NLS-1$
                             + name));
         }
 
@@ -176,12 +178,11 @@
         if (entries == null) {
             if (sm != null && !userProvidedConfig) {
                 sm.checkPermission(new AuthPermission(
-                        "createLoginContext.other"));
+                        "createLoginContext.other")); //$NON-NLS-1$
             }
-            entries = config.getAppConfigurationEntry("other");
+            entries = config.getAppConfigurationEntry("other"); //$NON-NLS-1$
             if (entries == null) {
-                throw new LoginException("There is no \"" + name
-                        + "\" in Configuration or it's empty.");
+                throw new LoginException(Messages.getString("auth.35", name)); //$NON-NLS-1$
             }
         }
 
@@ -225,7 +226,7 @@
             });
         } catch (PrivilegedActionException ex) {
             throw (LoginException) new LoginException(
-                    "Could not get default callback handler.").initCause(ex
+                    Messages.getString("auth.36")).initCause(ex //$NON-NLS-1$
                     .getCause());
         }
 
@@ -411,7 +412,7 @@
                 throw (LoginException) firstProblem;
             } else {
                 throw (LoginException) new LoginException(
-                        "Login attempt failed.").initCause(firstProblem);
+                        Messages.getString("auth.37")).initCause(firstProblem); //$NON-NLS-1$
             }
         } else {
             loggedIn = true;
@@ -444,7 +445,7 @@
     // appropriate doPrivileged calls in logout().
     private void logoutImpl() throws LoginException {
         if (subject == null) {
-            throw new LoginException("This LoginContext is not logged.");
+            throw new LoginException(Messages.getString("auth.38")); //$NON-NLS-1$
         }
         loggedIn = false;
         Throwable firstProblem = null;
@@ -468,7 +469,7 @@
                 throw (LoginException) firstProblem;
             } else {
                 throw (LoginException) new LoginException(
-                        "Login attempt failed.").initCause(firstProblem);
+                        Messages.getString("auth.37")).initCause(firstProblem); //$NON-NLS-1$
             }
         }
     }
@@ -547,7 +548,7 @@
                     klass = Class.forName(klassName, false, contextClassLoader);
                 } catch (ClassNotFoundException ex) {
                     throw (LoginException) new LoginException(
-                            "Could not load module " + klassName).initCause(ex);
+                            Messages.getString("auth.39", klassName)).initCause(ex); //$NON-NLS-1$
                 }
             }
 
@@ -556,11 +557,11 @@
                     module = (LoginModule) klass.newInstance();
                 } catch (IllegalAccessException ex) {
                     throw (LoginException) new LoginException(
-                            "Could not instantiate module " + klassName)
+                            Messages.getString("auth.3A", klassName)) //$NON-NLS-1$
                             .initCause(ex);
                 } catch (InstantiationException ex) {
                     throw (LoginException) new LoginException(
-                            "Could not instantiate module " + klassName)
+                            Messages.getString("auth.3A", klassName)) //$NON-NLS-1$
                             .initCause(ex);
                 }
                 module.initialize(subject, callbackHandler, sharedState, entry

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/x500/X500Principal.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/x500/X500Principal.java?view=diff&rev=440675&r1=440674&r2=440675
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/x500/X500Principal.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/x500/X500Principal.java Wed Sep  6 03:03:27 2006
@@ -28,6 +28,7 @@
 import java.io.Serializable;
 import java.security.Principal;
 
+import org.apache.harmony.auth.internal.nls.Messages;
 import org.apache.harmony.security.x501.Name;
 
 
@@ -45,18 +46,18 @@
     /**
      * @com.intel.drl.spec_ref
      */
-    public static final String CANONICAL = "CANONICAL";
+    public static final String CANONICAL = "CANONICAL"; //$NON-NLS-1$
 
     /**
      * @com.intel.drl.spec_ref
      */
-    public static final String RFC1779 = "RFC1779";
+    public static final String RFC1779 = "RFC1779"; //$NON-NLS-1$
 
     /**
      * @com.intel.drl.spec_ref
      */
 
-    public static final String RFC2253 = "RFC2253";
+    public static final String RFC2253 = "RFC2253"; //$NON-NLS-1$
 
     //Distinguished Name
     private transient Name dn;
@@ -66,14 +67,14 @@
      */
     public X500Principal(byte[] name) {
         if (name == null) {
-            throw new IllegalArgumentException("Name can not be null");
+            throw new IllegalArgumentException(Messages.getString("auth.00")); //$NON-NLS-1$
         }
         try {
             // FIXME dn = new Name(name);
             dn = (Name) Name.ASN1.decode(name);
         } catch (IOException e) {
             IllegalArgumentException iae = new IllegalArgumentException(
-                    "Incorrect input encoding");
+                    Messages.getString("auth.2B")); //$NON-NLS-1$
             iae.initCause(e);
             throw iae;
         }
@@ -84,14 +85,14 @@
      */
     public X500Principal(InputStream in) {
         if (in == null) {
-            throw new NullPointerException("Input stream can not be null");
+            throw new NullPointerException(Messages.getString("auth.2C")); //$NON-NLS-1$
         }
         try {
             // FIXME dn = new Name(is);
             dn = (Name) Name.ASN1.decode(in);
         } catch (IOException e) {
             IllegalArgumentException iae = new IllegalArgumentException(
-                    "Incorrect input encoding");
+                    Messages.getString("auth.2B")); //$NON-NLS-1$
             iae.initCause(e);
             throw iae;
         }
@@ -102,13 +103,13 @@
      */
     public X500Principal(String name) {
         if (name == null) {
-            throw new NullPointerException("Name can not be null");
+            throw new NullPointerException(Messages.getString("auth.00")); //$NON-NLS-1$
         }
         try {
             dn = new Name(name);
         } catch (IOException e) {
             IllegalArgumentException iae = new IllegalArgumentException(
-                    "Incorrect input name");
+                    Messages.getString("auth.2D")); //$NON-NLS-1$
             iae.initCause(e);
             throw iae;
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/x500/X500PrivateCredential.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/x500/X500PrivateCredential.java?view=diff&rev=440675&r1=440674&r2=440675
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/x500/X500PrivateCredential.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/auth/x500/X500PrivateCredential.java Wed Sep  6 03:03:27 2006
@@ -25,6 +25,8 @@
 import java.security.PrivateKey;
 import javax.security.auth.Destroyable;
 
+import org.apache.harmony.auth.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  */
@@ -44,10 +46,10 @@
      */
     public X500PrivateCredential(X509Certificate cert, PrivateKey key) {
         if (cert == null) {
-            throw new IllegalArgumentException("X509 certificate is null");
+            throw new IllegalArgumentException(Messages.getString("auth.28")); //$NON-NLS-1$
         }
         if (key == null) {
-            throw new IllegalArgumentException("Private key is null");
+            throw new IllegalArgumentException(Messages.getString("auth.29")); //$NON-NLS-1$
         }
         this.cert = cert;
         this.key = key;
@@ -60,7 +62,7 @@
             String alias) {
         this(cert, key);
         if (alias == null) {
-            throw new IllegalArgumentException("Alias is null");
+            throw new IllegalArgumentException(Messages.getString("auth.2A")); //$NON-NLS-1$
         }
         this.alias = alias;
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/Sasl.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/Sasl.java?view=diff&rev=440675&r1=440674&r2=440675
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/Sasl.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/Sasl.java Wed Sep  6 03:03:27 2006
@@ -25,6 +25,8 @@
 import java.security.Security;
 import javax.security.auth.callback.CallbackHandler;
 
+import org.apache.harmony.auth.internal.nls.Messages;
+
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Enumeration;
@@ -40,82 +42,82 @@
  */
 public class Sasl {
     // SaslClientFactory service name
-    private static final String CLIENTFACTORYSRV = "SaslClientFactory";
+    private static final String CLIENTFACTORYSRV = "SaslClientFactory"; //$NON-NLS-1$
 
     // SaslServerFactory service name
-    private static final String SERVERFACTORYSRV = "SaslServerFactory";
+    private static final String SERVERFACTORYSRV = "SaslServerFactory"; //$NON-NLS-1$
 
     /**
      * @com.intel.drl.spec_ref
      *  
      */
-    public static final String POLICY_NOPLAINTEXT = "javax.security.sasl.policy.noplaintext";
+    public static final String POLICY_NOPLAINTEXT = "javax.security.sasl.policy.noplaintext"; //$NON-NLS-1$
 
     /**
      * @com.intel.drl.spec_ref
      *  
      */
-    public static final String POLICY_NOACTIVE = "javax.security.sasl.policy.noactive";
+    public static final String POLICY_NOACTIVE = "javax.security.sasl.policy.noactive"; //$NON-NLS-1$
 
     /**
      * @com.intel.drl.spec_ref
      *  
      */
-    public static final String POLICY_NODICTIONARY = "javax.security.sasl.policy.nodictionary";
+    public static final String POLICY_NODICTIONARY = "javax.security.sasl.policy.nodictionary"; //$NON-NLS-1$
 
     /**
      * @com.intel.drl.spec_ref
      *  
      */
-    public static final String POLICY_NOANONYMOUS = "javax.security.sasl.policy.noanonymous";
+    public static final String POLICY_NOANONYMOUS = "javax.security.sasl.policy.noanonymous"; //$NON-NLS-1$
 
     /**
      * @com.intel.drl.spec_ref
      *  
      */
-    public static final String POLICY_FORWARD_SECRECY = "javax.security.sasl.policy.forward";
+    public static final String POLICY_FORWARD_SECRECY = "javax.security.sasl.policy.forward"; //$NON-NLS-1$
 
     /**
      * @com.intel.drl.spec_ref
      *  
      */
-    public static final String POLICY_PASS_CREDENTIALS = "javax.security.sasl.policy.credentials";
+    public static final String POLICY_PASS_CREDENTIALS = "javax.security.sasl.policy.credentials"; //$NON-NLS-1$
 
     /**
      * @com.intel.drl.spec_ref
      *  
      */
-    public static final String MAX_BUFFER = "javax.security.sasl.maxbuffer";
+    public static final String MAX_BUFFER = "javax.security.sasl.maxbuffer"; //$NON-NLS-1$
 
     /**
      * @com.intel.drl.spec_ref
      *  
      */
-    public static final String RAW_SEND_SIZE = "javax.security.sasl.rawsendsize";
+    public static final String RAW_SEND_SIZE = "javax.security.sasl.rawsendsize"; //$NON-NLS-1$
 
     /**
      * @com.intel.drl.spec_ref
      *  
      */
-    public static final String REUSE = "javax.security.sasl.reuse";
+    public static final String REUSE = "javax.security.sasl.reuse"; //$NON-NLS-1$
 
     /**
      * @com.intel.drl.spec_ref
      *  
      */
-    public static final String QOP = "javax.security.sasl.qop";
+    public static final String QOP = "javax.security.sasl.qop"; //$NON-NLS-1$
 
     /**
      * @com.intel.drl.spec_ref
      *  
      */
-    public static final String STRENGTH = "javax.security.sasl.strength";
+    public static final String STRENGTH = "javax.security.sasl.strength"; //$NON-NLS-1$
 
     /**
      * @com.intel.drl.spec_ref
      *  
      */
-    public static final String SERVER_AUTH = "javax.security.sasl.server.authentication";
+    public static final String SERVER_AUTH = "javax.security.sasl.server.authentication"; //$NON-NLS-1$
 
     // Default public constructor is overridden
     private Sasl() {
@@ -124,7 +126,7 @@
     // Forms new instance of factory
     private static Object newInstance(String factoryName, Provider prv)
             throws SaslException {
-        String msg = "Implementation was not found for: ";
+        String msg = Messages.getString("auth.31"); //$NON-NLS-1$
         Object factory;
         ClassLoader cl = prv.getClass().getClassLoader();
         if (cl == null) {
@@ -204,7 +206,7 @@
             String protocol, String serverName, Map<String,?> prop, CallbackHandler cbh)
             throws SaslException {
         if (mechanism == null) {
-            throw new NullPointerException("mechanism is null");
+            throw new NullPointerException(Messages.getString("auth.32")); //$NON-NLS-1$
         }
         HashSet res = (HashSet) findFactories(SERVERFACTORYSRV);
         if (res.size() == 0) {
@@ -246,7 +248,7 @@
             String authanticationID, String protocol, String serverName,
             Map<String,?> prop, CallbackHandler cbh) throws SaslException {
         if (mechanisms == null) {
-            throw new NullPointerException("mechanisms is null");
+            throw new NullPointerException(Messages.getString("auth.33")); //$NON-NLS-1$
         }
         HashSet res = (HashSet) findFactories(CLIENTFACTORYSRV);
         if (res.size() == 0) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslException.java?view=diff&rev=440675&r1=440674&r2=440675
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslException.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslException.java Wed Sep  6 03:03:27 2006
@@ -89,7 +89,7 @@
             return super.toString();
         } else {
             StringBuffer sb = new StringBuffer(super.toString());
-            sb.append(", caused by: ");
+            sb.append(", caused by: "); //$NON-NLS-1$
             sb.append(_exception.toString());
             return sb.toString();
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/org/apache/harmony/auth/DefaultSubjectPolicy.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/org/apache/harmony/auth/DefaultSubjectPolicy.java?view=diff&rev=440675&r1=440674&r2=440675
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/org/apache/harmony/auth/DefaultSubjectPolicy.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/org/apache/harmony/auth/DefaultSubjectPolicy.java Wed Sep  6 03:03:27 2006
@@ -48,13 +48,13 @@
 public class DefaultSubjectPolicy extends Policy {
 
     private static final AuthPermission REFRESH_POLICY = new AuthPermission(
-            "refreshPolicy");
+            "refreshPolicy"); //$NON-NLS-1$
 
     // System property for dynamically added policy location.
-    private static final String AUTH_SECURITY_POLICY = "java.security.auth.policy";
+    private static final String AUTH_SECURITY_POLICY = "java.security.auth.policy"; //$NON-NLS-1$
 
     // Prefix for numbered Policy locations specified in security.properties.
-    private static final String POLICY_URL_PREFIX = "auth.policy.url.";
+    private static final String POLICY_URL_PREFIX = "auth.policy.url."; //$NON-NLS-1$
 
     // A flag to denote whether this policy object was initialized or not. 
     private boolean isInitialized;
@@ -117,7 +117,7 @@
 
         Properties system = new Properties((Properties) AccessController
                 .doPrivileged(new PolicyUtils.SystemKit()));
-        system.setProperty("/", File.separator);
+        system.setProperty("/", File.separator); //$NON-NLS-1$
         URL[] policyLocations = PolicyUtils.getPolicyURLs(system,
                 AUTH_SECURITY_POLICY, POLICY_URL_PREFIX);
 



Mime
View raw message