提交 dea845a6 编写于 作者: W weijun

6987827: security/util/Resources.java needs improvement

Reviewed-by: valeriep
上级 f820c65f
/* /*
* Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -68,7 +68,7 @@ public class NTDomainPrincipal implements Principal, java.io.Serializable { ...@@ -68,7 +68,7 @@ public class NTDomainPrincipal implements Principal, java.io.Serializable {
if (name == null) { if (name == null) {
java.text.MessageFormat form = new java.text.MessageFormat java.text.MessageFormat form = new java.text.MessageFormat
(sun.security.util.ResourcesMgr.getString (sun.security.util.ResourcesMgr.getString
("invalid null input: value", ("invalid.null.input.value",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {"name"}; Object[] source = {"name"};
throw new NullPointerException(form.format(source)); throw new NullPointerException(form.format(source));
...@@ -99,7 +99,7 @@ public class NTDomainPrincipal implements Principal, java.io.Serializable { ...@@ -99,7 +99,7 @@ public class NTDomainPrincipal implements Principal, java.io.Serializable {
public String toString() { public String toString() {
java.text.MessageFormat form = new java.text.MessageFormat java.text.MessageFormat form = new java.text.MessageFormat
(sun.security.util.ResourcesMgr.getString (sun.security.util.ResourcesMgr.getString
("NTDomainPrincipal: name", ("NTDomainPrincipal.name",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {name}; Object[] source = {name};
return form.format(source); return form.format(source);
......
/* /*
* Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -70,7 +70,7 @@ public class NTNumericCredential { ...@@ -70,7 +70,7 @@ public class NTNumericCredential {
public String toString() { public String toString() {
java.text.MessageFormat form = new java.text.MessageFormat java.text.MessageFormat form = new java.text.MessageFormat
(sun.security.util.ResourcesMgr.getString (sun.security.util.ResourcesMgr.getString
("NTNumericCredential: name", ("NTNumericCredential.name",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {Long.toString(impersonationToken)}; Object[] source = {Long.toString(impersonationToken)};
return form.format(source); return form.format(source);
......
/* /*
* Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -73,7 +73,7 @@ public class NTSid implements Principal, java.io.Serializable { ...@@ -73,7 +73,7 @@ public class NTSid implements Principal, java.io.Serializable {
if (stringSid == null) { if (stringSid == null) {
java.text.MessageFormat form = new java.text.MessageFormat java.text.MessageFormat form = new java.text.MessageFormat
(sun.security.util.ResourcesMgr.getString (sun.security.util.ResourcesMgr.getString
("invalid null input: value", ("invalid.null.input.value",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {"stringSid"}; Object[] source = {"stringSid"};
throw new NullPointerException(form.format(source)); throw new NullPointerException(form.format(source));
...@@ -81,7 +81,7 @@ public class NTSid implements Principal, java.io.Serializable { ...@@ -81,7 +81,7 @@ public class NTSid implements Principal, java.io.Serializable {
if (stringSid.length() == 0) { if (stringSid.length() == 0) {
throw new IllegalArgumentException throw new IllegalArgumentException
(sun.security.util.ResourcesMgr.getString (sun.security.util.ResourcesMgr.getString
("Invalid NTSid value", ("Invalid.NTSid.value",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
} }
sid = new String(stringSid); sid = new String(stringSid);
...@@ -108,7 +108,7 @@ public class NTSid implements Principal, java.io.Serializable { ...@@ -108,7 +108,7 @@ public class NTSid implements Principal, java.io.Serializable {
public String toString() { public String toString() {
java.text.MessageFormat form = new java.text.MessageFormat java.text.MessageFormat form = new java.text.MessageFormat
(sun.security.util.ResourcesMgr.getString (sun.security.util.ResourcesMgr.getString
("NTSid: name", ("NTSid.name",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {sid}; Object[] source = {sid};
return form.format(source); return form.format(source);
......
/* /*
* Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -73,7 +73,7 @@ public class NTSidDomainPrincipal extends NTSid { ...@@ -73,7 +73,7 @@ public class NTSidDomainPrincipal extends NTSid {
public String toString() { public String toString() {
java.text.MessageFormat form = new java.text.MessageFormat java.text.MessageFormat form = new java.text.MessageFormat
(sun.security.util.ResourcesMgr.getString (sun.security.util.ResourcesMgr.getString
("NTSidDomainPrincipal: name", ("NTSidDomainPrincipal.name",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {getName()}; Object[] source = {getName()};
return form.format(source); return form.format(source);
......
/* /*
* Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -68,7 +68,7 @@ public class NTSidGroupPrincipal extends NTSid { ...@@ -68,7 +68,7 @@ public class NTSidGroupPrincipal extends NTSid {
public String toString() { public String toString() {
java.text.MessageFormat form = new java.text.MessageFormat java.text.MessageFormat form = new java.text.MessageFormat
(sun.security.util.ResourcesMgr.getString (sun.security.util.ResourcesMgr.getString
("NTSidGroupPrincipal: name", ("NTSidGroupPrincipal.name",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {getName()}; Object[] source = {getName()};
return form.format(source); return form.format(source);
......
/* /*
* Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -70,7 +70,7 @@ public class NTSidPrimaryGroupPrincipal extends NTSid { ...@@ -70,7 +70,7 @@ public class NTSidPrimaryGroupPrincipal extends NTSid {
public String toString() { public String toString() {
java.text.MessageFormat form = new java.text.MessageFormat java.text.MessageFormat form = new java.text.MessageFormat
(sun.security.util.ResourcesMgr.getString (sun.security.util.ResourcesMgr.getString
("NTSidPrimaryGroupPrincipal: name", ("NTSidPrimaryGroupPrincipal.name",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {getName()}; Object[] source = {getName()};
return form.format(source); return form.format(source);
......
/* /*
* Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -67,7 +67,7 @@ public class NTSidUserPrincipal extends NTSid { ...@@ -67,7 +67,7 @@ public class NTSidUserPrincipal extends NTSid {
public String toString() { public String toString() {
java.text.MessageFormat form = new java.text.MessageFormat java.text.MessageFormat form = new java.text.MessageFormat
(sun.security.util.ResourcesMgr.getString (sun.security.util.ResourcesMgr.getString
("NTSidUserPrincipal: name", ("NTSidUserPrincipal.name",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {getName()}; Object[] source = {getName()};
return form.format(source); return form.format(source);
......
/* /*
* Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -64,7 +64,7 @@ public class NTUserPrincipal implements Principal, java.io.Serializable { ...@@ -64,7 +64,7 @@ public class NTUserPrincipal implements Principal, java.io.Serializable {
if (name == null) { if (name == null) {
java.text.MessageFormat form = new java.text.MessageFormat java.text.MessageFormat form = new java.text.MessageFormat
(sun.security.util.ResourcesMgr.getString (sun.security.util.ResourcesMgr.getString
("invalid null input: value", ("invalid.null.input.value",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {"name"}; Object[] source = {"name"};
throw new NullPointerException(form.format(source)); throw new NullPointerException(form.format(source));
...@@ -93,7 +93,7 @@ public class NTUserPrincipal implements Principal, java.io.Serializable { ...@@ -93,7 +93,7 @@ public class NTUserPrincipal implements Principal, java.io.Serializable {
public String toString() { public String toString() {
java.text.MessageFormat form = new java.text.MessageFormat java.text.MessageFormat form = new java.text.MessageFormat
(sun.security.util.ResourcesMgr.getString (sun.security.util.ResourcesMgr.getString
("NTUserPrincipal: name", ("NTUserPrincipal.name",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {name}; Object[] source = {name};
return form.format(source); return form.format(source);
......
/* /*
* Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -490,9 +490,9 @@ public class PolicyFile extends javax.security.auth.Policy { ...@@ -490,9 +490,9 @@ public class PolicyFile extends javax.security.auth.Policy {
} }
} catch (PolicyParser.ParsingException pe) { } catch (PolicyParser.ParsingException pe) {
System.err.println(AUTH_POLICY + System.err.println(AUTH_POLICY +
rb.getString(": error parsing ") + policy); rb.getString(".error.parsing.") + policy);
System.err.println(AUTH_POLICY + System.err.println(AUTH_POLICY +
rb.getString(": ") + rb.getString("COLON") +
pe.getMessage()); pe.getMessage());
if (debug != null) if (debug != null)
pe.printStackTrace(); pe.printStackTrace();
...@@ -635,16 +635,16 @@ public class PolicyFile extends javax.security.auth.Policy { ...@@ -635,16 +635,16 @@ public class PolicyFile extends javax.security.auth.Policy {
} catch (java.lang.reflect.InvocationTargetException ite) { } catch (java.lang.reflect.InvocationTargetException ite) {
System.err.println System.err.println
(AUTH_POLICY + (AUTH_POLICY +
rb.getString(": error adding Permission ") + rb.getString(".error.adding.Permission.") +
pe.permission + pe.permission +
rb.getString(" ") + rb.getString("SPACE") +
ite.getTargetException()); ite.getTargetException());
} catch (Exception e) { } catch (Exception e) {
System.err.println System.err.println
(AUTH_POLICY + (AUTH_POLICY +
rb.getString(": error adding Permission ") + rb.getString(".error.adding.Permission.") +
pe.permission + pe.permission +
rb.getString(" ") + rb.getString("SPACE") +
e); e);
} }
} }
...@@ -652,9 +652,9 @@ public class PolicyFile extends javax.security.auth.Policy { ...@@ -652,9 +652,9 @@ public class PolicyFile extends javax.security.auth.Policy {
} catch (Exception e) { } catch (Exception e) {
System.err.println System.err.println
(AUTH_POLICY + (AUTH_POLICY +
rb.getString(": error adding Entry ") + rb.getString(".error.adding.Entry.") +
ge + ge +
rb.getString(" ") + rb.getString("SPACE") +
e); e);
} }
...@@ -1373,18 +1373,18 @@ public class PolicyFile extends javax.security.auth.Policy { ...@@ -1373,18 +1373,18 @@ public class PolicyFile extends javax.security.auth.Policy {
public String toString(){ public String toString(){
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
sb.append(rb.getString("(")); sb.append(rb.getString("LPARAM"));
sb.append(getCodeSource()); sb.append(getCodeSource());
sb.append("\n"); sb.append("\n");
for (int j = 0; j < permissions.size(); j++) { for (int j = 0; j < permissions.size(); j++) {
Permission p = permissions.elementAt(j); Permission p = permissions.elementAt(j);
sb.append(rb.getString(" ")); sb.append(rb.getString("SPACE"));
sb.append(rb.getString(" ")); sb.append(rb.getString("SPACE"));
sb.append(p); sb.append(p);
sb.append(rb.getString("\n")); sb.append(rb.getString("NEWLINE"));
} }
sb.append(rb.getString(")")); sb.append(rb.getString("RPARAM"));
sb.append(rb.getString("\n")); sb.append(rb.getString("NEWLINE"));
return sb.toString(); return sb.toString();
} }
...@@ -1415,7 +1415,7 @@ class PolicyPermissions extends PermissionCollection { ...@@ -1415,7 +1415,7 @@ class PolicyPermissions extends PermissionCollection {
if (isReadOnly()) if (isReadOnly())
throw new SecurityException throw new SecurityException
(PolicyFile.rb.getString (PolicyFile.rb.getString
("attempt to add a Permission to a readonly PermissionCollection")); ("attempt.to.add.a.Permission.to.a.readonly.PermissionCollection"));
if (perms == null) { if (perms == null) {
if (additionalPerms == null) if (additionalPerms == null)
......
/* /*
* Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -300,7 +300,7 @@ class PolicyParser { ...@@ -300,7 +300,7 @@ class PolicyParser {
keyStoreType = match("quoted string"); keyStoreType = match("quoted string");
} else { } else {
throw new ParsingException(st.lineno(), throw new ParsingException(st.lineno(),
rb.getString("expected keystore type")); rb.getString("expected.keystore.type"));
} }
} }
...@@ -368,8 +368,8 @@ class PolicyParser { ...@@ -368,8 +368,8 @@ class PolicyParser {
"WILDCARD class but no WILDCARD name"); "WILDCARD class but no WILDCARD name");
throw new ParsingException throw new ParsingException
(st.lineno(), (st.lineno(),
rb.getString("can not specify Principal with a ") + rb.getString("can.not.specify.Principal.with.a.") +
rb.getString("wildcard class without a wildcard name")); rb.getString("wildcard.class.without.a.wildcard.name"));
} }
try { try {
...@@ -389,7 +389,7 @@ class PolicyParser { ...@@ -389,7 +389,7 @@ class PolicyParser {
} else { } else {
throw new throw new
ParsingException(st.lineno(), ParsingException(st.lineno(),
rb.getString("expected codeBase or SignedBy")); rb.getString("expected.codeBase.or.SignedBy"));
} }
} }
...@@ -397,7 +397,7 @@ class PolicyParser { ...@@ -397,7 +397,7 @@ class PolicyParser {
if (principals == null) { if (principals == null) {
throw new ParsingException throw new ParsingException
(st.lineno(), (st.lineno(),
rb.getString("only Principal-based grant entries permitted")); rb.getString("only.Principal.based.grant.entries.permitted"));
} }
e.principals = principals; e.principals = principals;
...@@ -416,7 +416,7 @@ class PolicyParser { ...@@ -416,7 +416,7 @@ class PolicyParser {
} else { } else {
throw new throw new
ParsingException(st.lineno(), ParsingException(st.lineno(),
rb.getString("expected permission entry")); rb.getString("expected.permission.entry"));
} }
} }
match("}"); match("}");
...@@ -522,12 +522,12 @@ class PolicyParser { ...@@ -522,12 +522,12 @@ class PolicyParser {
switch (lookahead) { switch (lookahead) {
case StreamTokenizer.TT_NUMBER: case StreamTokenizer.TT_NUMBER:
throw new ParsingException(st.lineno(), expect, throw new ParsingException(st.lineno(), expect,
rb.getString("number ") + rb.getString("number.") +
String.valueOf(st.nval)); String.valueOf(st.nval));
case StreamTokenizer.TT_EOF: case StreamTokenizer.TT_EOF:
throw new ParsingException throw new ParsingException
(rb.getString("expected ") + expect + (rb.getString("expected.") + expect +
rb.getString(", read end of file")); rb.getString(".read.end.of.file"));
case StreamTokenizer.TT_WORD: case StreamTokenizer.TT_WORD:
if (expect.equalsIgnoreCase(st.sval)) { if (expect.equalsIgnoreCase(st.sval)) {
lookahead = st.nextToken(); lookahead = st.nextToken();
...@@ -603,11 +603,11 @@ class PolicyParser { ...@@ -603,11 +603,11 @@ class PolicyParser {
switch (lookahead) { switch (lookahead) {
case StreamTokenizer.TT_NUMBER: case StreamTokenizer.TT_NUMBER:
throw new ParsingException(st.lineno(), ";", throw new ParsingException(st.lineno(), ";",
rb.getString("number ") + rb.getString("number.") +
String.valueOf(st.nval)); String.valueOf(st.nval));
case StreamTokenizer.TT_EOF: case StreamTokenizer.TT_EOF:
throw new ParsingException throw new ParsingException
(rb.getString("expected ';', read end of file")); (rb.getString("expected.read.end.of.file"));
default: default:
lookahead = st.nextToken(); lookahead = st.nextToken();
} }
...@@ -942,13 +942,13 @@ class PolicyParser { ...@@ -942,13 +942,13 @@ class PolicyParser {
} }
public ParsingException(int line, String msg) { public ParsingException(int line, String msg) {
super(rb.getString("line ") + line + rb.getString(": ") + msg); super(rb.getString("line.") + line + rb.getString("COLON") + msg);
} }
public ParsingException(int line, String expect, String actual) { public ParsingException(int line, String expect, String actual) {
super(rb.getString("line ") + line + rb.getString(": expected '") + super(rb.getString("line.") + line + rb.getString(".expected.") +
expect + rb.getString("', found '") + actual + expect + rb.getString(".found.") + actual +
rb.getString("'")); rb.getString("QUOTE"));
} }
} }
......
/* /*
* Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -89,7 +89,7 @@ public class SolarisNumericGroupPrincipal implements ...@@ -89,7 +89,7 @@ public class SolarisNumericGroupPrincipal implements
*/ */
public SolarisNumericGroupPrincipal(String name, boolean primaryGroup) { public SolarisNumericGroupPrincipal(String name, boolean primaryGroup) {
if (name == null) if (name == null)
throw new NullPointerException(rb.getString("provided null name")); throw new NullPointerException(rb.getString("provided.null.name"));
this.name = name; this.name = name;
this.primaryGroup = primaryGroup; this.primaryGroup = primaryGroup;
...@@ -165,9 +165,9 @@ public class SolarisNumericGroupPrincipal implements ...@@ -165,9 +165,9 @@ public class SolarisNumericGroupPrincipal implements
public String toString() { public String toString() {
return((primaryGroup ? return((primaryGroup ?
rb.getString rb.getString
("SolarisNumericGroupPrincipal [Primary Group]: ") + name : ("SolarisNumericGroupPrincipal.Primary.Group.") + name :
rb.getString rb.getString
("SolarisNumericGroupPrincipal [Supplementary Group]: ") + name)); ("SolarisNumericGroupPrincipal.Supplementary.Group.") + name));
} }
/** /**
......
/* /*
* Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -80,7 +80,7 @@ public class SolarisNumericUserPrincipal implements ...@@ -80,7 +80,7 @@ public class SolarisNumericUserPrincipal implements
*/ */
public SolarisNumericUserPrincipal(String name) { public SolarisNumericUserPrincipal(String name) {
if (name == null) if (name == null)
throw new NullPointerException(rb.getString("provided null name")); throw new NullPointerException(rb.getString("provided.null.name"));
this.name = name; this.name = name;
} }
...@@ -134,7 +134,7 @@ public class SolarisNumericUserPrincipal implements ...@@ -134,7 +134,7 @@ public class SolarisNumericUserPrincipal implements
* <code>SolarisNumericUserPrincipal</code>. * <code>SolarisNumericUserPrincipal</code>.
*/ */
public String toString() { public String toString() {
return(rb.getString("SolarisNumericUserPrincipal: ") + name); return(rb.getString("SolarisNumericUserPrincipal.") + name);
} }
/** /**
......
/* /*
* Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -76,7 +76,7 @@ public class SolarisPrincipal implements Principal, java.io.Serializable { ...@@ -76,7 +76,7 @@ public class SolarisPrincipal implements Principal, java.io.Serializable {
*/ */
public SolarisPrincipal(String name) { public SolarisPrincipal(String name) {
if (name == null) if (name == null)
throw new NullPointerException(rb.getString("provided null name")); throw new NullPointerException(rb.getString("provided.null.name"));
this.name = name; this.name = name;
} }
...@@ -100,7 +100,7 @@ public class SolarisPrincipal implements Principal, java.io.Serializable { ...@@ -100,7 +100,7 @@ public class SolarisPrincipal implements Principal, java.io.Serializable {
* @return a string representation of this <code>SolarisPrincipal</code>. * @return a string representation of this <code>SolarisPrincipal</code>.
*/ */
public String toString() { public String toString() {
return(rb.getString("SolarisPrincipal: ") + name); return(rb.getString("SolarisPrincipal.") + name);
} }
/** /**
......
/* /*
* Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -395,7 +395,7 @@ class SubjectCodeSource extends CodeSource implements java.io.Serializable { ...@@ -395,7 +395,7 @@ class SubjectCodeSource extends CodeSource implements java.io.Serializable {
principals.listIterator(); principals.listIterator();
while (li.hasNext()) { while (li.hasNext()) {
PolicyParser.PrincipalEntry pppe = li.next(); PolicyParser.PrincipalEntry pppe = li.next();
returnMe = returnMe + rb.getString("\n") + returnMe = returnMe + rb.getString("NEWLINE") +
pppe.principalClass + " " + pppe.principalClass + " " +
pppe.principalName; pppe.principalName;
} }
......
/* /*
* Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -77,7 +77,7 @@ public class UnixNumericGroupPrincipal implements ...@@ -77,7 +77,7 @@ public class UnixNumericGroupPrincipal implements
if (name == null) { if (name == null) {
java.text.MessageFormat form = new java.text.MessageFormat java.text.MessageFormat form = new java.text.MessageFormat
(sun.security.util.ResourcesMgr.getString (sun.security.util.ResourcesMgr.getString
("invalid null input: value", ("invalid.null.input.value",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {"name"}; Object[] source = {"name"};
throw new NullPointerException(form.format(source)); throw new NullPointerException(form.format(source));
...@@ -159,14 +159,14 @@ public class UnixNumericGroupPrincipal implements ...@@ -159,14 +159,14 @@ public class UnixNumericGroupPrincipal implements
if (primaryGroup) { if (primaryGroup) {
java.text.MessageFormat form = new java.text.MessageFormat java.text.MessageFormat form = new java.text.MessageFormat
(sun.security.util.ResourcesMgr.getString (sun.security.util.ResourcesMgr.getString
("UnixNumericGroupPrincipal [Primary Group]: name", ("UnixNumericGroupPrincipal.Primary.Group.name",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {name}; Object[] source = {name};
return form.format(source); return form.format(source);
} else { } else {
java.text.MessageFormat form = new java.text.MessageFormat java.text.MessageFormat form = new java.text.MessageFormat
(sun.security.util.ResourcesMgr.getString (sun.security.util.ResourcesMgr.getString
("UnixNumericGroupPrincipal [Supplementary Group]: name", ("UnixNumericGroupPrincipal.Supplementary.Group.name",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {name}; Object[] source = {name};
return form.format(source); return form.format(source);
......
/* /*
* Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -67,7 +67,7 @@ public class UnixNumericUserPrincipal implements ...@@ -67,7 +67,7 @@ public class UnixNumericUserPrincipal implements
if (name == null) { if (name == null) {
java.text.MessageFormat form = new java.text.MessageFormat java.text.MessageFormat form = new java.text.MessageFormat
(sun.security.util.ResourcesMgr.getString (sun.security.util.ResourcesMgr.getString
("invalid null input: value", ("invalid.null.input.value",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {"name"}; Object[] source = {"name"};
throw new NullPointerException(form.format(source)); throw new NullPointerException(form.format(source));
...@@ -127,7 +127,7 @@ public class UnixNumericUserPrincipal implements ...@@ -127,7 +127,7 @@ public class UnixNumericUserPrincipal implements
public String toString() { public String toString() {
java.text.MessageFormat form = new java.text.MessageFormat java.text.MessageFormat form = new java.text.MessageFormat
(sun.security.util.ResourcesMgr.getString (sun.security.util.ResourcesMgr.getString
("UnixNumericUserPrincipal: name", ("UnixNumericUserPrincipal.name",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {name}; Object[] source = {name};
return form.format(source); return form.format(source);
......
/* /*
* Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -64,7 +64,7 @@ public class UnixPrincipal implements Principal, java.io.Serializable { ...@@ -64,7 +64,7 @@ public class UnixPrincipal implements Principal, java.io.Serializable {
if (name == null) { if (name == null) {
java.text.MessageFormat form = new java.text.MessageFormat java.text.MessageFormat form = new java.text.MessageFormat
(sun.security.util.ResourcesMgr.getString (sun.security.util.ResourcesMgr.getString
("invalid null input: value", ("invalid.null.input.value",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {"name"}; Object[] source = {"name"};
throw new NullPointerException(form.format(source)); throw new NullPointerException(form.format(source));
...@@ -94,7 +94,7 @@ public class UnixPrincipal implements Principal, java.io.Serializable { ...@@ -94,7 +94,7 @@ public class UnixPrincipal implements Principal, java.io.Serializable {
public String toString() { public String toString() {
java.text.MessageFormat form = new java.text.MessageFormat java.text.MessageFormat form = new java.text.MessageFormat
(sun.security.util.ResourcesMgr.getString (sun.security.util.ResourcesMgr.getString
("UnixPrincipal: name", ("UnixPrincipal.name",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {name}; Object[] source = {name};
return form.format(source); return form.format(source);
......
/* /*
* Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -87,7 +87,7 @@ public class X500Principal implements Principal, java.io.Serializable { ...@@ -87,7 +87,7 @@ public class X500Principal implements Principal, java.io.Serializable {
*/ */
public X500Principal(String name) { public X500Principal(String name) {
if (name == null) if (name == null)
throw new NullPointerException(rb.getString("provided null name")); throw new NullPointerException(rb.getString("provided.null.name"));
try { try {
thisX500Name = new X500Name(name); thisX500Name = new X500Name(name);
......
/* /*
* Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -190,7 +190,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration { ...@@ -190,7 +190,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration {
} catch (PropertyExpander.ExpandException peee) { } catch (PropertyExpander.ExpandException peee) {
MessageFormat form = new MessageFormat MessageFormat form = new MessageFormat
(ResourcesMgr.getString (ResourcesMgr.getString
("Unable to properly expand config", ("Unable.to.properly.expand.config",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {extra_config}; Object[] source = {extra_config};
throw new IOException(form.format(source)); throw new IOException(form.format(source));
...@@ -206,7 +206,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration { ...@@ -206,7 +206,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration {
} else { } else {
MessageFormat form = new MessageFormat MessageFormat form = new MessageFormat
(ResourcesMgr.getString (ResourcesMgr.getString
("extra_config (No such file or directory)", ("extra.config.No.such.file.or.directory.",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {extra_config}; Object[] source = {extra_config};
throw new IOException(form.format(source)); throw new IOException(form.format(source));
...@@ -243,7 +243,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration { ...@@ -243,7 +243,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration {
} catch (PropertyExpander.ExpandException peee) { } catch (PropertyExpander.ExpandException peee) {
MessageFormat form = new MessageFormat MessageFormat form = new MessageFormat
(ResourcesMgr.getString (ResourcesMgr.getString
("Unable to properly expand config", ("Unable.to.properly.expand.config",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {config_url}; Object[] source = {config_url};
throw new IOException(form.format(source)); throw new IOException(form.format(source));
...@@ -286,7 +286,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration { ...@@ -286,7 +286,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration {
debugConfig.println(fnfe.toString()); debugConfig.println(fnfe.toString());
} }
throw new IOException(ResourcesMgr.getString throw new IOException(ResourcesMgr.getString
("Configuration Error:\n\tNo such file or directory", ("Configuration.Error.No.such.file.or.directory",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
} finally { } finally {
if (isr != null) { if (isr != null) {
...@@ -426,7 +426,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration { ...@@ -426,7 +426,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration {
AppConfigurationEntry.LoginModuleControlFlag.OPTIONAL; AppConfigurationEntry.LoginModuleControlFlag.OPTIONAL;
else { else {
MessageFormat form = new MessageFormat(ResourcesMgr.getString MessageFormat form = new MessageFormat(ResourcesMgr.getString
("Configuration Error:\n\tInvalid control flag, flag", ("Configuration.Error.Invalid.control.flag.flag",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {sflag}; Object[] source = {sflag};
throw new IOException(form.format(source)); throw new IOException(form.format(source));
...@@ -474,8 +474,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration { ...@@ -474,8 +474,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration {
// add this configuration entry // add this configuration entry
if (newConfig.containsKey(appName)) { if (newConfig.containsKey(appName)) {
MessageFormat form = new MessageFormat(ResourcesMgr.getString MessageFormat form = new MessageFormat(ResourcesMgr.getString
("Configuration Error:\n\t" + ("Configuration.Error.Can.not.specify.multiple.entries.for.appName",
"Can not specify multiple entries for appName",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {appName}; Object[] source = {appName};
throw new IOException(form.format(source)); throw new IOException(form.format(source));
...@@ -491,8 +490,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration { ...@@ -491,8 +490,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration {
case StreamTokenizer.TT_EOF: case StreamTokenizer.TT_EOF:
MessageFormat form1 = new MessageFormat(ResourcesMgr.getString MessageFormat form1 = new MessageFormat(ResourcesMgr.getString
("Configuration Error:\n\texpected [expect], " + ("Configuration.Error.expected.expect.read.end.of.file.",
"read [end of file]",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source1 = {expect}; Object[] source1 = {expect};
throw new IOException(form1.format(source1)); throw new IOException(form1.format(source1));
...@@ -508,8 +506,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration { ...@@ -508,8 +506,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration {
lookahead = nextToken(); lookahead = nextToken();
} else { } else {
MessageFormat form = new MessageFormat(ResourcesMgr.getString MessageFormat form = new MessageFormat(ResourcesMgr.getString
("Configuration Error:\n\tLine line: " + ("Configuration.Error.Line.line.expected.expect.found.value.",
"expected [expect], found [value]",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {new Integer(linenum), expect, st.sval}; Object[] source = {new Integer(linenum), expect, st.sval};
throw new IOException(form.format(source)); throw new IOException(form.format(source));
...@@ -522,7 +519,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration { ...@@ -522,7 +519,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration {
lookahead = nextToken(); lookahead = nextToken();
} else { } else {
MessageFormat form = new MessageFormat(ResourcesMgr.getString MessageFormat form = new MessageFormat(ResourcesMgr.getString
("Configuration Error:\n\tLine line: expected [expect]", ("Configuration.Error.Line.line.expected.expect.",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {new Integer(linenum), expect, st.sval}; Object[] source = {new Integer(linenum), expect, st.sval};
throw new IOException(form.format(source)); throw new IOException(form.format(source));
...@@ -535,7 +532,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration { ...@@ -535,7 +532,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration {
lookahead = nextToken(); lookahead = nextToken();
} else { } else {
MessageFormat form = new MessageFormat(ResourcesMgr.getString MessageFormat form = new MessageFormat(ResourcesMgr.getString
("Configuration Error:\n\tLine line: expected [expect]", ("Configuration.Error.Line.line.expected.expect.",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {new Integer(linenum), expect, st.sval}; Object[] source = {new Integer(linenum), expect, st.sval};
throw new IOException(form.format(source)); throw new IOException(form.format(source));
...@@ -548,7 +545,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration { ...@@ -548,7 +545,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration {
lookahead = nextToken(); lookahead = nextToken();
} else { } else {
MessageFormat form = new MessageFormat(ResourcesMgr.getString MessageFormat form = new MessageFormat(ResourcesMgr.getString
("Configuration Error:\n\tLine line: expected [expect]", ("Configuration.Error.Line.line.expected.expect.",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {new Integer(linenum), expect, st.sval}; Object[] source = {new Integer(linenum), expect, st.sval};
throw new IOException(form.format(source)); throw new IOException(form.format(source));
...@@ -561,7 +558,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration { ...@@ -561,7 +558,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration {
lookahead = nextToken(); lookahead = nextToken();
} else { } else {
MessageFormat form = new MessageFormat(ResourcesMgr.getString MessageFormat form = new MessageFormat(ResourcesMgr.getString
("Configuration Error:\n\tLine line: expected [expect]", ("Configuration.Error.Line.line.expected.expect.",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {new Integer(linenum), expect, st.sval}; Object[] source = {new Integer(linenum), expect, st.sval};
throw new IOException(form.format(source)); throw new IOException(form.format(source));
...@@ -570,8 +567,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration { ...@@ -570,8 +567,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration {
default: default:
MessageFormat form = new MessageFormat(ResourcesMgr.getString MessageFormat form = new MessageFormat(ResourcesMgr.getString
("Configuration Error:\n\tLine line: " + ("Configuration.Error.Line.line.expected.expect.found.value.",
"expected [expect], found [value]",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {new Integer(linenum), expect, st.sval}; Object[] source = {new Integer(linenum), expect, st.sval};
throw new IOException(form.format(source)); throw new IOException(form.format(source));
...@@ -667,8 +663,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration { ...@@ -667,8 +663,7 @@ public class ConfigFile extends javax.security.auth.login.Configuration {
if (s == null || s.length() == 0) { if (s == null || s.length() == 0) {
MessageFormat form = new MessageFormat(ResourcesMgr.getString MessageFormat form = new MessageFormat(ResourcesMgr.getString
("Configuration Error:\n\tLine line: " + ("Configuration.Error.Line.line.system.property.value.expanded.to.empty.value",
"system property [value] expanded to empty value",
"sun.security.util.AuthResources")); "sun.security.util.AuthResources"));
Object[] source = {new Integer(linenum), value}; Object[] source = {new Integer(linenum), value};
throw new IOException(form.format(source)); throw new IOException(form.format(source));
......
/* /*
* Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -686,9 +686,9 @@ public class JndiLoginModule implements LoginModule { ...@@ -686,9 +686,9 @@ public class JndiLoginModule implements LoginModule {
Callback[] callbacks = new Callback[2]; Callback[] callbacks = new Callback[2];
callbacks[0] = new NameCallback(protocol + " " callbacks[0] = new NameCallback(protocol + " "
+ rb.getString("username: ")); + rb.getString("username."));
callbacks[1] = new PasswordCallback(protocol + " " + callbacks[1] = new PasswordCallback(protocol + " " +
rb.getString("password: "), rb.getString("password."),
false); false);
try { try {
......
/* /*
* Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -150,7 +150,7 @@ public class KeyStoreLoginModule implements LoginModule { ...@@ -150,7 +150,7 @@ public class KeyStoreLoginModule implements LoginModule {
private static final TextOutputCallback bannerCallback = private static final TextOutputCallback bannerCallback =
new TextOutputCallback new TextOutputCallback
(TextOutputCallback.INFORMATION, (TextOutputCallback.INFORMATION,
rb.getString("Please enter keystore information")); rb.getString("Please.enter.keystore.information"));
private final ConfirmationCallback confirmationCallback = private final ConfirmationCallback confirmationCallback =
new ConfirmationCallback new ConfirmationCallback
(ConfirmationCallback.INFORMATION, (ConfirmationCallback.INFORMATION,
...@@ -364,10 +364,10 @@ public class KeyStoreLoginModule implements LoginModule { ...@@ -364,10 +364,10 @@ public class KeyStoreLoginModule implements LoginModule {
NameCallback aliasCallback; NameCallback aliasCallback;
if (keyStoreAlias == null || keyStoreAlias.length() == 0) { if (keyStoreAlias == null || keyStoreAlias.length() == 0) {
aliasCallback = new NameCallback( aliasCallback = new NameCallback(
rb.getString("Keystore alias: ")); rb.getString("Keystore.alias."));
} else { } else {
aliasCallback = aliasCallback =
new NameCallback(rb.getString("Keystore alias: "), new NameCallback(rb.getString("Keystore.alias."),
keyStoreAlias); keyStoreAlias);
} }
...@@ -379,11 +379,11 @@ public class KeyStoreLoginModule implements LoginModule { ...@@ -379,11 +379,11 @@ public class KeyStoreLoginModule implements LoginModule {
break; break;
case NORMAL: case NORMAL:
keyPassCallback = new PasswordCallback keyPassCallback = new PasswordCallback
(rb.getString("Private key password (optional): "), false); (rb.getString("Private.key.password.optional."), false);
// fall thru // fall thru
case TOKEN: case TOKEN:
storePassCallback = new PasswordCallback storePassCallback = new PasswordCallback
(rb.getString("Keystore password: "), false); (rb.getString("Keystore.password."), false);
break; break;
} }
prompt(aliasCallback, storePassCallback, keyPassCallback); prompt(aliasCallback, storePassCallback, keyPassCallback);
......
...@@ -780,7 +780,7 @@ public class Krb5LoginModule implements LoginModule { ...@@ -780,7 +780,7 @@ public class Krb5LoginModule implements LoginModule {
Callback[] callbacks = new Callback[1]; Callback[] callbacks = new Callback[1];
MessageFormat form = new MessageFormat( MessageFormat form = new MessageFormat(
rb.getString( rb.getString(
"Kerberos username [[defUsername]]: ")); "Kerberos.username.defUsername."));
Object[] source = {defUsername}; Object[] source = {defUsername};
callbacks[0] = new NameCallback(form.format(source)); callbacks[0] = new NameCallback(form.format(source));
callbackHandler.handle(callbacks); callbackHandler.handle(callbacks);
...@@ -835,7 +835,7 @@ public class Krb5LoginModule implements LoginModule { ...@@ -835,7 +835,7 @@ public class Krb5LoginModule implements LoginModule {
String userName = krb5PrincName.toString(); String userName = krb5PrincName.toString();
MessageFormat form = new MessageFormat( MessageFormat form = new MessageFormat(
rb.getString( rb.getString(
"Kerberos password for [username]: ")); "Kerberos.password.for.username."));
Object[] source = {userName}; Object[] source = {userName};
callbacks[0] = new PasswordCallback( callbacks[0] = new PasswordCallback(
form.format(source), form.format(source),
......
/* /*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -969,8 +969,8 @@ public class LdapLoginModule implements LoginModule { ...@@ -969,8 +969,8 @@ public class LdapLoginModule implements LoginModule {
"to acquire authentication information from the user"); "to acquire authentication information from the user");
Callback[] callbacks = new Callback[2]; Callback[] callbacks = new Callback[2];
callbacks[0] = new NameCallback(rb.getString("username: ")); callbacks[0] = new NameCallback(rb.getString("username."));
callbacks[1] = new PasswordCallback(rb.getString("password: "), false); callbacks[1] = new PasswordCallback(rb.getString("password."), false);
try { try {
callbackHandler.handle(callbacks); callbackHandler.handle(callbacks);
......
/* /*
* Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -237,7 +237,7 @@ public abstract class Policy { ...@@ -237,7 +237,7 @@ public abstract class Policy {
} catch (Exception e) { } catch (Exception e) {
throw new SecurityException throw new SecurityException
(sun.security.util.ResourcesMgr.getString (sun.security.util.ResourcesMgr.getString
("unable to instantiate Subject-based policy")); ("unable.to.instantiate.Subject.based.policy"));
} }
} }
} }
......
/* /*
* Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -172,7 +172,7 @@ public final class PrivateCredentialPermission extends Permission { ...@@ -172,7 +172,7 @@ public final class PrivateCredentialPermission extends Permission {
if (!"read".equalsIgnoreCase(actions)) if (!"read".equalsIgnoreCase(actions))
throw new IllegalArgumentException throw new IllegalArgumentException
(ResourcesMgr.getString("actions can only be 'read'")); (ResourcesMgr.getString("actions.can.only.be.read."));
init(name); init(name);
} }
...@@ -344,12 +344,11 @@ public final class PrivateCredentialPermission extends Permission { ...@@ -344,12 +344,11 @@ public final class PrivateCredentialPermission extends Permission {
if (tokenizer.hasMoreTokens() == false) { if (tokenizer.hasMoreTokens() == false) {
MessageFormat form = new MessageFormat(ResourcesMgr.getString MessageFormat form = new MessageFormat(ResourcesMgr.getString
("permission name [name] syntax invalid: ")); ("permission.name.name.syntax.invalid."));
Object[] source = {name}; Object[] source = {name};
throw new IllegalArgumentException throw new IllegalArgumentException
(form.format(source) + ResourcesMgr.getString (form.format(source) + ResourcesMgr.getString
("Credential Class not followed by a " + ("Credential.Class.not.followed.by.a.Principal.Class.and.Name"));
"Principal Class and Name"));
} }
while (tokenizer.hasMoreTokens()) { while (tokenizer.hasMoreTokens()) {
...@@ -364,11 +363,11 @@ public final class PrivateCredentialPermission extends Permission { ...@@ -364,11 +363,11 @@ public final class PrivateCredentialPermission extends Permission {
if (tokenizer.hasMoreTokens() == false) { if (tokenizer.hasMoreTokens() == false) {
MessageFormat form = new MessageFormat(ResourcesMgr.getString MessageFormat form = new MessageFormat(ResourcesMgr.getString
("permission name [name] syntax invalid: ")); ("permission.name.name.syntax.invalid."));
Object[] source = {name}; Object[] source = {name};
throw new IllegalArgumentException throw new IllegalArgumentException
(form.format(source) + ResourcesMgr.getString (form.format(source) + ResourcesMgr.getString
("Principal Class not followed by a Principal Name")); ("Principal.Class.not.followed.by.a.Principal.Name"));
} }
// skip delimiter // skip delimiter
...@@ -379,11 +378,11 @@ public final class PrivateCredentialPermission extends Permission { ...@@ -379,11 +378,11 @@ public final class PrivateCredentialPermission extends Permission {
if (!principalName.startsWith("\"")) { if (!principalName.startsWith("\"")) {
MessageFormat form = new MessageFormat(ResourcesMgr.getString MessageFormat form = new MessageFormat(ResourcesMgr.getString
("permission name [name] syntax invalid: ")); ("permission.name.name.syntax.invalid."));
Object[] source = {name}; Object[] source = {name};
throw new IllegalArgumentException throw new IllegalArgumentException
(form.format(source) + ResourcesMgr.getString (form.format(source) + ResourcesMgr.getString
("Principal Name must be surrounded by quotes")); ("Principal.Name.must.be.surrounded.by.quotes"));
} }
if (!principalName.endsWith("\"")) { if (!principalName.endsWith("\"")) {
...@@ -401,11 +400,11 @@ public final class PrivateCredentialPermission extends Permission { ...@@ -401,11 +400,11 @@ public final class PrivateCredentialPermission extends Permission {
if (!principalName.endsWith("\"")) { if (!principalName.endsWith("\"")) {
MessageFormat form = new MessageFormat MessageFormat form = new MessageFormat
(ResourcesMgr.getString (ResourcesMgr.getString
("permission name [name] syntax invalid: ")); ("permission.name.name.syntax.invalid."));
Object[] source = {name}; Object[] source = {name};
throw new IllegalArgumentException throw new IllegalArgumentException
(form.format(source) + ResourcesMgr.getString (form.format(source) + ResourcesMgr.getString
("Principal Name missing end quote")); ("Principal.Name.missing.end.quote"));
} }
} }
...@@ -418,9 +417,7 @@ public final class PrivateCredentialPermission extends Permission { ...@@ -418,9 +417,7 @@ public final class PrivateCredentialPermission extends Permission {
if (principalClass.equals("*") && if (principalClass.equals("*") &&
!principalName.equals("*")) { !principalName.equals("*")) {
throw new IllegalArgumentException(ResourcesMgr.getString throw new IllegalArgumentException(ResourcesMgr.getString
("PrivateCredentialPermission Principal Class " + ("PrivateCredentialPermission.Principal.Class.can.not.be.a.wildcard.value.if.Principal.Name.is.not.a.wildcard.value"));
"can not be a wildcard (*) value if Principal Name " +
"is not a wildcard (*) value"));
} }
if (testing) if (testing)
...@@ -556,8 +553,7 @@ public final class PrivateCredentialPermission extends Permission { ...@@ -556,8 +553,7 @@ public final class PrivateCredentialPermission extends Permission {
public String toString() { public String toString() {
MessageFormat form = new MessageFormat(ResourcesMgr.getString MessageFormat form = new MessageFormat(ResourcesMgr.getString
("CredOwner:\n\tPrincipal Class = class\n\t" + ("CredOwner.Principal.Class.class.Principal.Name.name"));
"Principal Name = name"));
Object[] source = {principalClass, principalName}; Object[] source = {principalClass, principalName};
return (form.format(source)); return (form.format(source));
} }
......
/* /*
* Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -204,7 +204,7 @@ public final class Subject implements java.io.Serializable { ...@@ -204,7 +204,7 @@ public final class Subject implements java.io.Serializable {
pubCredentials == null || pubCredentials == null ||
privCredentials == null) privCredentials == null)
throw new NullPointerException throw new NullPointerException
(ResourcesMgr.getString("invalid null input(s)")); (ResourcesMgr.getString("invalid.null.input.s."));
this.principals = Collections.synchronizedSet(new SecureSet<Principal> this.principals = Collections.synchronizedSet(new SecureSet<Principal>
(this, PRINCIPAL_SET, principals)); (this, PRINCIPAL_SET, principals));
...@@ -289,7 +289,7 @@ public final class Subject implements java.io.Serializable { ...@@ -289,7 +289,7 @@ public final class Subject implements java.io.Serializable {
if (acc == null) { if (acc == null) {
throw new NullPointerException(ResourcesMgr.getString throw new NullPointerException(ResourcesMgr.getString
("invalid null AccessControlContext provided")); ("invalid.null.AccessControlContext.provided"));
} }
// return the Subject from the DomainCombiner of the provided context // return the Subject from the DomainCombiner of the provided context
...@@ -346,7 +346,7 @@ public final class Subject implements java.io.Serializable { ...@@ -346,7 +346,7 @@ public final class Subject implements java.io.Serializable {
} }
if (action == null) if (action == null)
throw new NullPointerException throw new NullPointerException
(ResourcesMgr.getString("invalid null action provided")); (ResourcesMgr.getString("invalid.null.action.provided"));
// set up the new Subject-based AccessControlContext // set up the new Subject-based AccessControlContext
// for doPrivileged // for doPrivileged
...@@ -406,7 +406,7 @@ public final class Subject implements java.io.Serializable { ...@@ -406,7 +406,7 @@ public final class Subject implements java.io.Serializable {
if (action == null) if (action == null)
throw new NullPointerException throw new NullPointerException
(ResourcesMgr.getString("invalid null action provided")); (ResourcesMgr.getString("invalid.null.action.provided"));
// set up the new Subject-based AccessControlContext for doPrivileged // set up the new Subject-based AccessControlContext for doPrivileged
final AccessControlContext currentAcc = AccessController.getContext(); final AccessControlContext currentAcc = AccessController.getContext();
...@@ -460,7 +460,7 @@ public final class Subject implements java.io.Serializable { ...@@ -460,7 +460,7 @@ public final class Subject implements java.io.Serializable {
if (action == null) if (action == null)
throw new NullPointerException throw new NullPointerException
(ResourcesMgr.getString("invalid null action provided")); (ResourcesMgr.getString("invalid.null.action.provided"));
// set up the new Subject-based AccessControlContext // set up the new Subject-based AccessControlContext
// for doPrivileged // for doPrivileged
...@@ -524,7 +524,7 @@ public final class Subject implements java.io.Serializable { ...@@ -524,7 +524,7 @@ public final class Subject implements java.io.Serializable {
if (action == null) if (action == null)
throw new NullPointerException throw new NullPointerException
(ResourcesMgr.getString("invalid null action provided")); (ResourcesMgr.getString("invalid.null.action.provided"));
// set up the new Subject-based AccessControlContext for doPrivileged // set up the new Subject-based AccessControlContext for doPrivileged
final AccessControlContext callerAcc = final AccessControlContext callerAcc =
...@@ -603,7 +603,7 @@ public final class Subject implements java.io.Serializable { ...@@ -603,7 +603,7 @@ public final class Subject implements java.io.Serializable {
if (c == null) if (c == null)
throw new NullPointerException throw new NullPointerException
(ResourcesMgr.getString("invalid null Class provided")); (ResourcesMgr.getString("invalid.null.Class.provided"));
// always return an empty Set instead of null // always return an empty Set instead of null
// so LoginModules can add to the Set if necessary // so LoginModules can add to the Set if necessary
...@@ -697,7 +697,7 @@ public final class Subject implements java.io.Serializable { ...@@ -697,7 +697,7 @@ public final class Subject implements java.io.Serializable {
if (c == null) if (c == null)
throw new NullPointerException throw new NullPointerException
(ResourcesMgr.getString("invalid null Class provided")); (ResourcesMgr.getString("invalid.null.Class.provided"));
// always return an empty Set instead of null // always return an empty Set instead of null
// so LoginModules can add to the Set if necessary // so LoginModules can add to the Set if necessary
...@@ -742,7 +742,7 @@ public final class Subject implements java.io.Serializable { ...@@ -742,7 +742,7 @@ public final class Subject implements java.io.Serializable {
if (c == null) if (c == null)
throw new NullPointerException throw new NullPointerException
(ResourcesMgr.getString("invalid null Class provided")); (ResourcesMgr.getString("invalid.null.Class.provided"));
// always return an empty Set instead of null // always return an empty Set instead of null
// so LoginModules can add to the Set if necessary // so LoginModules can add to the Set if necessary
...@@ -832,15 +832,15 @@ public final class Subject implements java.io.Serializable { ...@@ -832,15 +832,15 @@ public final class Subject implements java.io.Serializable {
*/ */
String toString(boolean includePrivateCredentials) { String toString(boolean includePrivateCredentials) {
String s = ResourcesMgr.getString("Subject:\n"); String s = ResourcesMgr.getString("Subject.");
String suffix = ""; String suffix = "";
synchronized(principals) { synchronized(principals) {
Iterator<Principal> pI = principals.iterator(); Iterator<Principal> pI = principals.iterator();
while (pI.hasNext()) { while (pI.hasNext()) {
Principal p = pI.next(); Principal p = pI.next();
suffix = suffix + ResourcesMgr.getString("\tPrincipal: ") + suffix = suffix + ResourcesMgr.getString(".Principal.") +
p.toString() + ResourcesMgr.getString("\n"); p.toString() + ResourcesMgr.getString("NEWLINE");
} }
} }
...@@ -849,8 +849,8 @@ public final class Subject implements java.io.Serializable { ...@@ -849,8 +849,8 @@ public final class Subject implements java.io.Serializable {
while (pI.hasNext()) { while (pI.hasNext()) {
Object o = pI.next(); Object o = pI.next();
suffix = suffix + suffix = suffix +
ResourcesMgr.getString("\tPublic Credential: ") + ResourcesMgr.getString(".Public.Credential.") +
o.toString() + ResourcesMgr.getString("\n"); o.toString() + ResourcesMgr.getString("NEWLINE");
} }
} }
...@@ -861,12 +861,12 @@ public final class Subject implements java.io.Serializable { ...@@ -861,12 +861,12 @@ public final class Subject implements java.io.Serializable {
try { try {
Object o = pI.next(); Object o = pI.next();
suffix += ResourcesMgr.getString suffix += ResourcesMgr.getString
("\tPrivate Credential: ") + (".Private.Credential.") +
o.toString() + o.toString() +
ResourcesMgr.getString("\n"); ResourcesMgr.getString("NEWLINE");
} catch (SecurityException se) { } catch (SecurityException se) {
suffix += ResourcesMgr.getString suffix += ResourcesMgr.getString
("\tPrivate Credential inaccessible\n"); (".Private.Credential.inaccessible.");
break; break;
} }
} }
...@@ -1036,7 +1036,7 @@ public final class Subject implements java.io.Serializable { ...@@ -1036,7 +1036,7 @@ public final class Subject implements java.io.Serializable {
if (subject.isReadOnly()) { if (subject.isReadOnly()) {
throw new IllegalStateException(ResourcesMgr.getString throw new IllegalStateException(ResourcesMgr.getString
("Subject is read-only")); ("Subject.is.read.only"));
} }
java.lang.SecurityManager sm = System.getSecurityManager(); java.lang.SecurityManager sm = System.getSecurityManager();
...@@ -1062,7 +1062,7 @@ public final class Subject implements java.io.Serializable { ...@@ -1062,7 +1062,7 @@ public final class Subject implements java.io.Serializable {
if (subject.isReadOnly()) { if (subject.isReadOnly()) {
throw new IllegalStateException throw new IllegalStateException
(ResourcesMgr.getString("Subject is read-only")); (ResourcesMgr.getString("Subject.is.read.only"));
} }
java.lang.SecurityManager sm = System.getSecurityManager(); java.lang.SecurityManager sm = System.getSecurityManager();
...@@ -1084,9 +1084,7 @@ public final class Subject implements java.io.Serializable { ...@@ -1084,9 +1084,7 @@ public final class Subject implements java.io.Serializable {
case Subject.PRINCIPAL_SET: case Subject.PRINCIPAL_SET:
if (!(o instanceof Principal)) { if (!(o instanceof Principal)) {
throw new SecurityException(ResourcesMgr.getString throw new SecurityException(ResourcesMgr.getString
("attempting to add an object which is not an " + ("attempting.to.add.an.object.which.is.not.an.instance.of.java.security.Principal.to.a.Subject.s.Principal.Set"));
"instance of java.security.Principal to a " +
"Subject's Principal Set"));
} }
break; break;
default: default:
...@@ -1389,8 +1387,7 @@ public final class Subject implements java.io.Serializable { ...@@ -1389,8 +1387,7 @@ public final class Subject implements java.io.Serializable {
if (!o.getClass().isAssignableFrom(c)) { if (!o.getClass().isAssignableFrom(c)) {
MessageFormat form = new MessageFormat(ResourcesMgr.getString MessageFormat form = new MessageFormat(ResourcesMgr.getString
("attempting to add an object which is not an " + ("attempting.to.add.an.object.which.is.not.an.instance.of.class"));
"instance of class"));
Object[] source = {c.toString()}; Object[] source = {c.toString()};
throw new SecurityException(form.format(source)); throw new SecurityException(form.format(source));
} }
......
/* /*
* Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -167,7 +167,7 @@ public class AppConfigurationEntry { ...@@ -167,7 +167,7 @@ public class AppConfigurationEntry {
*/ */
public String toString() { public String toString() {
return (sun.security.util.ResourcesMgr.getString return (sun.security.util.ResourcesMgr.getString
("LoginModuleControlFlag: ") + controlFlag); ("LoginModuleControlFlag.") + controlFlag);
} }
} }
} }
/* /*
* Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -244,7 +244,7 @@ public class LoginContext { ...@@ -244,7 +244,7 @@ public class LoginContext {
if (name == null) if (name == null)
throw new LoginException throw new LoginException
(ResourcesMgr.getString("Invalid null input: name")); (ResourcesMgr.getString("Invalid.null.input.name"));
// get the Configuration // get the Configuration
if (config == null) { if (config == null) {
...@@ -268,7 +268,7 @@ public class LoginContext { ...@@ -268,7 +268,7 @@ public class LoginContext {
entries = config.getAppConfigurationEntry(OTHER); entries = config.getAppConfigurationEntry(OTHER);
if (entries == null) { if (entries == null) {
MessageFormat form = new MessageFormat(ResourcesMgr.getString MessageFormat form = new MessageFormat(ResourcesMgr.getString
("No LoginModules configured for name")); ("No.LoginModules.configured.for.name"));
Object[] source = {name}; Object[] source = {name};
throw new LoginException(form.format(source)); throw new LoginException(form.format(source));
} }
...@@ -382,7 +382,7 @@ public class LoginContext { ...@@ -382,7 +382,7 @@ public class LoginContext {
init(name); init(name);
if (subject == null) if (subject == null)
throw new LoginException throw new LoginException
(ResourcesMgr.getString("invalid null Subject provided")); (ResourcesMgr.getString("invalid.null.Subject.provided"));
this.subject = subject; this.subject = subject;
subjectProvided = true; subjectProvided = true;
loadDefaultCallbackHandler(); loadDefaultCallbackHandler();
...@@ -418,7 +418,7 @@ public class LoginContext { ...@@ -418,7 +418,7 @@ public class LoginContext {
init(name); init(name);
if (callbackHandler == null) if (callbackHandler == null)
throw new LoginException(ResourcesMgr.getString throw new LoginException(ResourcesMgr.getString
("invalid null CallbackHandler provided")); ("invalid.null.CallbackHandler.provided"));
this.callbackHandler = new SecureCallbackHandler this.callbackHandler = new SecureCallbackHandler
(java.security.AccessController.getContext(), (java.security.AccessController.getContext(),
callbackHandler); callbackHandler);
...@@ -459,7 +459,7 @@ public class LoginContext { ...@@ -459,7 +459,7 @@ public class LoginContext {
this(name, subject); this(name, subject);
if (callbackHandler == null) if (callbackHandler == null)
throw new LoginException(ResourcesMgr.getString throw new LoginException(ResourcesMgr.getString
("invalid null CallbackHandler provided")); ("invalid.null.CallbackHandler.provided"));
this.callbackHandler = new SecureCallbackHandler this.callbackHandler = new SecureCallbackHandler
(java.security.AccessController.getContext(), (java.security.AccessController.getContext(),
callbackHandler); callbackHandler);
...@@ -633,7 +633,7 @@ public class LoginContext { ...@@ -633,7 +633,7 @@ public class LoginContext {
public void logout() throws LoginException { public void logout() throws LoginException {
if (subject == null) { if (subject == null) {
throw new LoginException(ResourcesMgr.getString throw new LoginException(ResourcesMgr.getString
("null subject - logout called before login")); ("null.subject.logout.called.before.login"));
} }
if (configProvided) { if (configProvided) {
...@@ -811,21 +811,20 @@ public class LoginContext { ...@@ -811,21 +811,20 @@ public class LoginContext {
} catch (NoSuchMethodException nsme) { } catch (NoSuchMethodException nsme) {
MessageFormat form = new MessageFormat(ResourcesMgr.getString MessageFormat form = new MessageFormat(ResourcesMgr.getString
("unable to instantiate LoginModule, module, because " + ("unable.to.instantiate.LoginModule.module.because.it.does.not.provide.a.no.argument.constructor"));
"it does not provide a no-argument constructor"));
Object[] source = {moduleStack[i].entry.getLoginModuleName()}; Object[] source = {moduleStack[i].entry.getLoginModuleName()};
throwException(null, new LoginException(form.format(source))); throwException(null, new LoginException(form.format(source)));
} catch (InstantiationException ie) { } catch (InstantiationException ie) {
throwException(null, new LoginException(ResourcesMgr.getString throwException(null, new LoginException(ResourcesMgr.getString
("unable to instantiate LoginModule: ") + ("unable.to.instantiate.LoginModule.") +
ie.getMessage())); ie.getMessage()));
} catch (ClassNotFoundException cnfe) { } catch (ClassNotFoundException cnfe) {
throwException(null, new LoginException(ResourcesMgr.getString throwException(null, new LoginException(ResourcesMgr.getString
("unable to find LoginModule class: ") + ("unable.to.find.LoginModule.class.") +
cnfe.getMessage())); cnfe.getMessage()));
} catch (IllegalAccessException iae) { } catch (IllegalAccessException iae) {
throwException(null, new LoginException(ResourcesMgr.getString throwException(null, new LoginException(ResourcesMgr.getString
("unable to access LoginModule: ") + ("unable.to.access.LoginModule.") +
iae.getMessage())); iae.getMessage()));
} catch (InvocationTargetException ite) { } catch (InvocationTargetException ite) {
...@@ -934,7 +933,7 @@ public class LoginContext { ...@@ -934,7 +933,7 @@ public class LoginContext {
} else if (success == false) { } else if (success == false) {
// no module succeeded -- all modules were IGNORED // no module succeeded -- all modules were IGNORED
throwException(new LoginException throwException(new LoginException
(ResourcesMgr.getString("Login Failure: all modules ignored")), (ResourcesMgr.getString("Login.Failure.all.modules.ignored")),
null); null);
} else { } else {
// success // success
......
/* /*
* Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -155,12 +155,12 @@ public final class X500Principal implements Principal, java.io.Serializable { ...@@ -155,12 +155,12 @@ public final class X500Principal implements Principal, java.io.Serializable {
if (name == null) { if (name == null) {
throw new NullPointerException throw new NullPointerException
(sun.security.util.ResourcesMgr.getString (sun.security.util.ResourcesMgr.getString
("provided null name")); ("provided.null.name"));
} }
if (keywordMap == null) { if (keywordMap == null) {
throw new NullPointerException throw new NullPointerException
(sun.security.util.ResourcesMgr.getString (sun.security.util.ResourcesMgr.getString
("provided null keyword map")); ("provided.null.keyword.map"));
} }
try { try {
...@@ -391,7 +391,7 @@ public final class X500Principal implements Principal, java.io.Serializable { ...@@ -391,7 +391,7 @@ public final class X500Principal implements Principal, java.io.Serializable {
if (oidMap == null) { if (oidMap == null) {
throw new NullPointerException throw new NullPointerException
(sun.security.util.ResourcesMgr.getString (sun.security.util.ResourcesMgr.getString
("provided null OID map")); ("provided.null.OID.map"));
} }
if (format != null) { if (format != null) {
if (format.equalsIgnoreCase(RFC1779)) { if (format.equalsIgnoreCase(RFC1779)) {
......
...@@ -1123,7 +1123,7 @@ public final class SunPKCS11 extends AuthProvider { ...@@ -1123,7 +1123,7 @@ public final class SunPKCS11 extends AuthProvider {
java.text.MessageFormat form = new java.text.MessageFormat java.text.MessageFormat form = new java.text.MessageFormat
(ResourcesMgr.getString (ResourcesMgr.getString
("PKCS11 Token [providerName] Password: ")); ("PKCS11.Token.providerName.Password."));
Object[] source = { getName() }; Object[] source = { getName() };
PasswordCallback pcall = new PasswordCallback(form.format(source), PasswordCallback pcall = new PasswordCallback(form.format(source),
......
/* /*
* Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -653,7 +653,7 @@ public class PolicyFile extends java.security.Policy { ...@@ -653,7 +653,7 @@ public class PolicyFile extends java.security.Policy {
} }
} catch (PolicyParser.ParsingException pe) { } catch (PolicyParser.ParsingException pe) {
MessageFormat form = new MessageFormat(ResourcesMgr.getString MessageFormat form = new MessageFormat(ResourcesMgr.getString
(POLICY + ": error parsing policy:\n\tmessage")); (POLICY + ".error.parsing.policy.message"));
Object[] source = {policy, pe.getLocalizedMessage()}; Object[] source = {policy, pe.getLocalizedMessage()};
System.err.println(form.format(source)); System.err.println(form.format(source));
if (debug != null) if (debug != null)
...@@ -895,7 +895,7 @@ public class PolicyFile extends java.security.Policy { ...@@ -895,7 +895,7 @@ public class PolicyFile extends java.security.Policy {
MessageFormat form = new MessageFormat MessageFormat form = new MessageFormat
(ResourcesMgr.getString (ResourcesMgr.getString
(POLICY + (POLICY +
": error adding Permission, perm:\n\tmessage")); ".error.adding.Permission.perm.message"));
Object[] source = {pe.permission, Object[] source = {pe.permission,
ite.getTargetException().toString()}; ite.getTargetException().toString()};
System.err.println(form.format(source)); System.err.println(form.format(source));
...@@ -903,7 +903,7 @@ public class PolicyFile extends java.security.Policy { ...@@ -903,7 +903,7 @@ public class PolicyFile extends java.security.Policy {
MessageFormat form = new MessageFormat MessageFormat form = new MessageFormat
(ResourcesMgr.getString (ResourcesMgr.getString
(POLICY + (POLICY +
": error adding Permission, perm:\n\tmessage")); ".error.adding.Permission.perm.message"));
Object[] source = {pe.permission, Object[] source = {pe.permission,
e.toString()}; e.toString()};
System.err.println(form.format(source)); System.err.println(form.format(source));
...@@ -915,7 +915,7 @@ public class PolicyFile extends java.security.Policy { ...@@ -915,7 +915,7 @@ public class PolicyFile extends java.security.Policy {
} catch (Exception e) { } catch (Exception e) {
MessageFormat form = new MessageFormat(ResourcesMgr.getString MessageFormat form = new MessageFormat(ResourcesMgr.getString
(POLICY (POLICY
+ ": error adding Entry:\n\tmessage")); + ".error.adding.Entry.message"));
Object[] source = {e.toString()}; Object[] source = {e.toString()};
System.err.println(form.format(source)); System.err.println(form.format(source));
} }
...@@ -1950,7 +1950,7 @@ public class PolicyFile extends java.security.Policy { ...@@ -1950,7 +1950,7 @@ public class PolicyFile extends java.security.Policy {
if (colonIndex == -1) { if (colonIndex == -1) {
MessageFormat form = new MessageFormat MessageFormat form = new MessageFormat
(ResourcesMgr.getString (ResourcesMgr.getString
("alias name not provided (pe.name)")); ("alias.name.not.provided.pe.name."));
Object[] source = {pe.name}; Object[] source = {pe.name};
throw new Exception(form.format(source)); throw new Exception(form.format(source));
} }
...@@ -1958,7 +1958,7 @@ public class PolicyFile extends java.security.Policy { ...@@ -1958,7 +1958,7 @@ public class PolicyFile extends java.security.Policy {
if ((suffix = getDN(suffix, keystore)) == null) { if ((suffix = getDN(suffix, keystore)) == null) {
MessageFormat form = new MessageFormat MessageFormat form = new MessageFormat
(ResourcesMgr.getString (ResourcesMgr.getString
("unable to perform substitution on alias, suffix")); ("unable.to.perform.substitution.on.alias.suffix"));
Object[] source = {value.substring(colonIndex+1)}; Object[] source = {value.substring(colonIndex+1)};
throw new Exception(form.format(source)); throw new Exception(form.format(source));
} }
...@@ -1968,7 +1968,7 @@ public class PolicyFile extends java.security.Policy { ...@@ -1968,7 +1968,7 @@ public class PolicyFile extends java.security.Policy {
} else { } else {
MessageFormat form = new MessageFormat MessageFormat form = new MessageFormat
(ResourcesMgr.getString (ResourcesMgr.getString
("substitution value, prefix, unsupported")); ("substitution.value.prefix.unsupported"));
Object[] source = {prefix}; Object[] source = {prefix};
throw new Exception(form.format(source)); throw new Exception(form.format(source));
} }
...@@ -2127,18 +2127,18 @@ public class PolicyFile extends java.security.Policy { ...@@ -2127,18 +2127,18 @@ public class PolicyFile extends java.security.Policy {
@Override public String toString(){ @Override public String toString(){
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(ResourcesMgr.getString("(")); sb.append(ResourcesMgr.getString("LPARAM"));
sb.append(getCodeSource()); sb.append(getCodeSource());
sb.append("\n"); sb.append("\n");
for (int j = 0; j < permissions.size(); j++) { for (int j = 0; j < permissions.size(); j++) {
Permission p = permissions.get(j); Permission p = permissions.get(j);
sb.append(ResourcesMgr.getString(" ")); sb.append(ResourcesMgr.getString("SPACE"));
sb.append(ResourcesMgr.getString(" ")); sb.append(ResourcesMgr.getString("SPACE"));
sb.append(p); sb.append(p);
sb.append(ResourcesMgr.getString("\n")); sb.append(ResourcesMgr.getString("NEWLINE"));
} }
sb.append(ResourcesMgr.getString(")")); sb.append(ResourcesMgr.getString("RPARAM"));
sb.append(ResourcesMgr.getString("\n")); sb.append(ResourcesMgr.getString("NEWLINE"));
return sb.toString(); return sb.toString();
} }
} }
...@@ -2195,7 +2195,7 @@ public class PolicyFile extends java.security.Policy { ...@@ -2195,7 +2195,7 @@ public class PolicyFile extends java.security.Policy {
super(type); super(type);
if (type == null) { if (type == null) {
throw new NullPointerException throw new NullPointerException
(ResourcesMgr.getString("type can't be null")); (ResourcesMgr.getString("type.can.t.be.null"));
} }
this.type = type; this.type = type;
this.name = name; this.name = name;
......
/* /*
* Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -219,8 +219,7 @@ public class PolicyParser { ...@@ -219,8 +219,7 @@ public class PolicyParser {
if (keyStoreUrlString == null && storePassURL != null) { if (keyStoreUrlString == null && storePassURL != null) {
throw new ParsingException(ResourcesMgr.getString throw new ParsingException(ResourcesMgr.getString
("keystorePasswordURL can not be specified without also " + ("keystorePasswordURL.can.not.be.specified.without.also.specifying.keystore"));
"specifying keystore"));
} }
} }
...@@ -357,7 +356,7 @@ public class PolicyParser { ...@@ -357,7 +356,7 @@ public class PolicyParser {
keyStoreType = match("quoted string"); keyStoreType = match("quoted string");
} else { } else {
throw new ParsingException(st.lineno(), throw new ParsingException(st.lineno(),
ResourcesMgr.getString("expected keystore type")); ResourcesMgr.getString("expected.keystore.type"));
} }
// parse keystore provider // parse keystore provider
...@@ -370,7 +369,7 @@ public class PolicyParser { ...@@ -370,7 +369,7 @@ public class PolicyParser {
keyStoreProvider = match("quoted string"); keyStoreProvider = match("quoted string");
} else { } else {
throw new ParsingException(st.lineno(), throw new ParsingException(st.lineno(),
ResourcesMgr.getString("expected keystore provider")); ResourcesMgr.getString("expected.keystore.provider"));
} }
} }
...@@ -421,7 +420,7 @@ public class PolicyParser { ...@@ -421,7 +420,7 @@ public class PolicyParser {
throw new ParsingException( throw new ParsingException(
st.lineno(), st.lineno(),
ResourcesMgr.getString ResourcesMgr.getString
("multiple Codebase expressions")); ("multiple.Codebase.expressions"));
e.codeBase = match("quoted string"); e.codeBase = match("quoted string");
peekAndMatch(","); peekAndMatch(",");
} else if (peekAndMatch("SignedBy")) { } else if (peekAndMatch("SignedBy")) {
...@@ -429,7 +428,7 @@ public class PolicyParser { ...@@ -429,7 +428,7 @@ public class PolicyParser {
throw new ParsingException( throw new ParsingException(
st.lineno(), st.lineno(),
ResourcesMgr.getString( ResourcesMgr.getString(
"multiple SignedBy expressions")); "multiple.SignedBy.expressions"));
e.signedBy = match("quoted string"); e.signedBy = match("quoted string");
// verify syntax of the aliases // verify syntax of the aliases
...@@ -448,7 +447,7 @@ public class PolicyParser { ...@@ -448,7 +447,7 @@ public class PolicyParser {
throw new ParsingException( throw new ParsingException(
st.lineno(), st.lineno(),
ResourcesMgr.getString( ResourcesMgr.getString(
"SignedBy has empty alias")); "SignedBy.has.empty.alias"));
peekAndMatch(","); peekAndMatch(",");
} else if (peekAndMatch("Principal")) { } else if (peekAndMatch("Principal")) {
...@@ -491,8 +490,7 @@ public class PolicyParser { ...@@ -491,8 +490,7 @@ public class PolicyParser {
throw new ParsingException throw new ParsingException
(st.lineno(), (st.lineno(),
ResourcesMgr.getString ResourcesMgr.getString
("can not specify Principal with a " + ("can.not.specify.Principal.with.a.wildcard.class.without.a.wildcard.name"));
"wildcard class without a wildcard name"));
} }
} }
...@@ -529,8 +527,7 @@ public class PolicyParser { ...@@ -529,8 +527,7 @@ public class PolicyParser {
} else { } else {
throw new ParsingException(st.lineno(), throw new ParsingException(st.lineno(),
ResourcesMgr.getString( ResourcesMgr.getString(
"expected codeBase or SignedBy or " + "expected.codeBase.or.SignedBy.or.Principal"));
"Principal"));
} }
} }
...@@ -554,7 +551,7 @@ public class PolicyParser { ...@@ -554,7 +551,7 @@ public class PolicyParser {
throw new throw new
ParsingException(st.lineno(), ParsingException(st.lineno(),
ResourcesMgr.getString( ResourcesMgr.getString(
"expected permission entry")); "expected.permission.entry"));
} }
} }
match("}"); match("}");
...@@ -727,12 +724,12 @@ public class PolicyParser { ...@@ -727,12 +724,12 @@ public class PolicyParser {
switch (lookahead) { switch (lookahead) {
case StreamTokenizer.TT_NUMBER: case StreamTokenizer.TT_NUMBER:
throw new ParsingException(st.lineno(), expect, throw new ParsingException(st.lineno(), expect,
ResourcesMgr.getString("number ") + ResourcesMgr.getString("number.") +
String.valueOf(st.nval)); String.valueOf(st.nval));
case StreamTokenizer.TT_EOF: case StreamTokenizer.TT_EOF:
MessageFormat form = new MessageFormat( MessageFormat form = new MessageFormat(
ResourcesMgr.getString ResourcesMgr.getString
("expected [expect], read [end of file]")); ("expected.expect.read.end.of.file."));
Object[] source = {expect}; Object[] source = {expect};
throw new ParsingException(form.format(source)); throw new ParsingException(form.format(source));
case StreamTokenizer.TT_WORD: case StreamTokenizer.TT_WORD:
...@@ -809,11 +806,11 @@ public class PolicyParser { ...@@ -809,11 +806,11 @@ public class PolicyParser {
switch (lookahead) { switch (lookahead) {
case StreamTokenizer.TT_NUMBER: case StreamTokenizer.TT_NUMBER:
throw new ParsingException(st.lineno(), ";", throw new ParsingException(st.lineno(), ";",
ResourcesMgr.getString("number ") + ResourcesMgr.getString("number.") +
String.valueOf(st.nval)); String.valueOf(st.nval));
case StreamTokenizer.TT_EOF: case StreamTokenizer.TT_EOF:
throw new ParsingException(ResourcesMgr.getString throw new ParsingException(ResourcesMgr.getString
("expected [;], read [end of file]")); ("expected.read.end.of.file."));
default: default:
lookahead = st.nextToken(); lookahead = st.nextToken();
} }
...@@ -973,7 +970,7 @@ public class PolicyParser { ...@@ -973,7 +970,7 @@ public class PolicyParser {
public PrincipalEntry(String principalClass, String principalName) { public PrincipalEntry(String principalClass, String principalName) {
if (principalClass == null || principalName == null) if (principalClass == null || principalName == null)
throw new NullPointerException(ResourcesMgr.getString( throw new NullPointerException(ResourcesMgr.getString(
"null principalClass or principalName")); "null.principalClass.or.principalName"));
this.principalClass = principalClass; this.principalClass = principalClass;
this.principalName = principalName; this.principalName = principalName;
} }
...@@ -1199,7 +1196,7 @@ public class PolicyParser { ...@@ -1199,7 +1196,7 @@ public class PolicyParser {
public ParsingException(int line, String msg) { public ParsingException(int line, String msg) {
super("line " + line + ": " + msg); super("line " + line + ": " + msg);
MessageFormat form = new MessageFormat MessageFormat form = new MessageFormat
(ResourcesMgr.getString("line number: msg")); (ResourcesMgr.getString("line.number.msg"));
Object[] source = {new Integer(line), msg}; Object[] source = {new Integer(line), msg};
i18nMessage = form.format(source); i18nMessage = form.format(source);
} }
...@@ -1208,7 +1205,7 @@ public class PolicyParser { ...@@ -1208,7 +1205,7 @@ public class PolicyParser {
super("line " + line + ": expected [" + expect + super("line " + line + ": expected [" + expect +
"], found [" + actual + "]"); "], found [" + actual + "]");
MessageFormat form = new MessageFormat(ResourcesMgr.getString MessageFormat form = new MessageFormat(ResourcesMgr.getString
("line number: expected [expect], found [actual]")); ("line.number.expected.expect.found.actual."));
Object[] source = {new Integer(line), expect, actual}; Object[] source = {new Integer(line), expect, actual};
i18nMessage = form.format(source); i18nMessage = form.format(source);
} }
......
/* /*
* Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -40,103 +40,103 @@ public class AuthResources extends java.util.ListResourceBundle { ...@@ -40,103 +40,103 @@ public class AuthResources extends java.util.ListResourceBundle {
private static final Object[][] contents = { private static final Object[][] contents = {
// NT principals // NT principals
{"invalid null input: value", "invalid null input: {0}"}, {"invalid.null.input.value", "invalid null input: {0}"},
{"NTDomainPrincipal: name", "NTDomainPrincipal: {0}"}, {"NTDomainPrincipal.name", "NTDomainPrincipal: {0}"},
{"NTNumericCredential: name", "NTNumericCredential: {0}"}, {"NTNumericCredential.name", "NTNumericCredential: {0}"},
{"Invalid NTSid value", "Invalid NTSid value"}, {"Invalid.NTSid.value", "Invalid NTSid value"},
{"NTSid: name", "NTSid: {0}"}, {"NTSid.name", "NTSid: {0}"},
{"NTSidDomainPrincipal: name", "NTSidDomainPrincipal: {0}"}, {"NTSidDomainPrincipal.name", "NTSidDomainPrincipal: {0}"},
{"NTSidGroupPrincipal: name", "NTSidGroupPrincipal: {0}"}, {"NTSidGroupPrincipal.name", "NTSidGroupPrincipal: {0}"},
{"NTSidPrimaryGroupPrincipal: name", "NTSidPrimaryGroupPrincipal: {0}"}, {"NTSidPrimaryGroupPrincipal.name", "NTSidPrimaryGroupPrincipal: {0}"},
{"NTSidUserPrincipal: name", "NTSidUserPrincipal: {0}"}, {"NTSidUserPrincipal.name", "NTSidUserPrincipal: {0}"},
{"NTUserPrincipal: name", "NTUserPrincipal: {0}"}, {"NTUserPrincipal.name", "NTUserPrincipal: {0}"},
// UnixPrincipals // UnixPrincipals
{"UnixNumericGroupPrincipal [Primary Group]: name", {"UnixNumericGroupPrincipal.Primary.Group.name",
"UnixNumericGroupPrincipal [Primary Group]: {0}"}, "UnixNumericGroupPrincipal [Primary Group]: {0}"},
{"UnixNumericGroupPrincipal [Supplementary Group]: name", {"UnixNumericGroupPrincipal.Supplementary.Group.name",
"UnixNumericGroupPrincipal [Supplementary Group]: {0}"}, "UnixNumericGroupPrincipal [Supplementary Group]: {0}"},
{"UnixNumericUserPrincipal: name", "UnixNumericUserPrincipal: {0}"}, {"UnixNumericUserPrincipal.name", "UnixNumericUserPrincipal: {0}"},
{"UnixPrincipal: name", "UnixPrincipal: {0}"}, {"UnixPrincipal.name", "UnixPrincipal: {0}"},
// com.sun.security.auth.login.ConfigFile // com.sun.security.auth.login.ConfigFile
{"Unable to properly expand config", "Unable to properly expand {0}"}, {"Unable.to.properly.expand.config", "Unable to properly expand {0}"},
{"extra_config (No such file or directory)", {"extra.config.No.such.file.or.directory.",
"{0} (No such file or directory)"}, "{0} (No such file or directory)"},
{"Configuration Error:\n\tNo such file or directory", {"Configuration.Error.No.such.file.or.directory",
"Configuration Error:\n\tNo such file or directory"}, "Configuration Error:\n\tNo such file or directory"},
{"Configuration Error:\n\tInvalid control flag, flag", {"Configuration.Error.Invalid.control.flag.flag",
"Configuration Error:\n\tInvalid control flag, {0}"}, "Configuration Error:\n\tInvalid control flag, {0}"},
{"Configuration Error:\n\tCan not specify multiple entries for appName", {"Configuration.Error.Can.not.specify.multiple.entries.for.appName",
"Configuration Error:\n\tCan not specify multiple entries for {0}"}, "Configuration Error:\n\tCan not specify multiple entries for {0}"},
{"Configuration Error:\n\texpected [expect], read [end of file]", {"Configuration.Error.expected.expect.read.end.of.file.",
"Configuration Error:\n\texpected [{0}], read [end of file]"}, "Configuration Error:\n\texpected [{0}], read [end of file]"},
{"Configuration Error:\n\tLine line: expected [expect], found [value]", {"Configuration.Error.Line.line.expected.expect.found.value.",
"Configuration Error:\n\tLine {0}: expected [{1}], found [{2}]"}, "Configuration Error:\n\tLine {0}: expected [{1}], found [{2}]"},
{"Configuration Error:\n\tLine line: expected [expect]", {"Configuration.Error.Line.line.expected.expect.",
"Configuration Error:\n\tLine {0}: expected [{1}]"}, "Configuration Error:\n\tLine {0}: expected [{1}]"},
{"Configuration Error:\n\tLine line: system property [value] expanded to empty value", {"Configuration.Error.Line.line.system.property.value.expanded.to.empty.value",
"Configuration Error:\n\tLine {0}: system property [{1}] expanded to empty value"}, "Configuration Error:\n\tLine {0}: system property [{1}] expanded to empty value"},
// com.sun.security.auth.module.JndiLoginModule // com.sun.security.auth.module.JndiLoginModule
{"username: ","username: "}, {"username.","username: "},
{"password: ","password: "}, {"password.","password: "},
// com.sun.security.auth.module.KeyStoreLoginModule // com.sun.security.auth.module.KeyStoreLoginModule
{"Please enter keystore information", {"Please.enter.keystore.information",
"Please enter keystore information"}, "Please enter keystore information"},
{"Keystore alias: ","Keystore alias: "}, {"Keystore.alias.","Keystore alias: "},
{"Keystore password: ","Keystore password: "}, {"Keystore.password.","Keystore password: "},
{"Private key password (optional): ", {"Private.key.password.optional.",
"Private key password (optional): "}, "Private key password (optional): "},
// com.sun.security.auth.module.Krb5LoginModule // com.sun.security.auth.module.Krb5LoginModule
{"Kerberos username [[defUsername]]: ", {"Kerberos.username.defUsername.",
"Kerberos username [{0}]: "}, "Kerberos username [{0}]: "},
{"Kerberos password for [username]: ", {"Kerberos.password.for.username.",
"Kerberos password for {0}: "}, "Kerberos password for {0}: "},
/*** EVERYTHING BELOW IS DEPRECATED ***/ /*** EVERYTHING BELOW IS DEPRECATED ***/
// com.sun.security.auth.PolicyFile // com.sun.security.auth.PolicyFile
{": error parsing ", ": error parsing "}, {".error.parsing.", ": error parsing "},
{": ", ": "}, {"COLON", ": "},
{": error adding Permission ", ": error adding Permission "}, {".error.adding.Permission.", ": error adding Permission "},
{" ", " "}, {"SPACE", " "},
{": error adding Entry ", ": error adding Entry "}, {".error.adding.Entry.", ": error adding Entry "},
{"(", "("}, {"LPARAM", "("},
{")", ")"}, {"RPARAM", ")"},
{"attempt to add a Permission to a readonly PermissionCollection", {"attempt.to.add.a.Permission.to.a.readonly.PermissionCollection",
"attempt to add a Permission to a readonly PermissionCollection"}, "attempt to add a Permission to a readonly PermissionCollection"},
// com.sun.security.auth.PolicyParser // com.sun.security.auth.PolicyParser
{"expected keystore type", "expected keystore type"}, {"expected.keystore.type", "expected keystore type"},
{"can not specify Principal with a ", {"can.not.specify.Principal.with.a.",
"can not specify Principal with a "}, "can not specify Principal with a "},
{"wildcard class without a wildcard name", {"wildcard.class.without.a.wildcard.name",
"wildcard class without a wildcard name"}, "wildcard class without a wildcard name"},
{"expected codeBase or SignedBy", "expected codeBase or SignedBy"}, {"expected.codeBase.or.SignedBy", "expected codeBase or SignedBy"},
{"only Principal-based grant entries permitted", {"only.Principal.based.grant.entries.permitted",
"only Principal-based grant entries permitted"}, "only Principal-based grant entries permitted"},
{"expected permission entry", "expected permission entry"}, {"expected.permission.entry", "expected permission entry"},
{"number ", "number "}, {"number.", "number "},
{"expected ", "expected "}, {"expected.", "expected "},
{", read end of file", ", read end of file"}, {".read.end.of.file", ", read end of file"},
{"expected ';', read end of file", "expected ';', read end of file"}, {"expected.read.end.of.file", "expected ';', read end of file"},
{"line ", "line "}, {"line.", "line "},
{": expected '", ": expected '"}, {".expected.", ": expected '"},
{"', found '", "', found '"}, {".found.", "', found '"},
{"'", "'"}, {"QUOTE", "'"},
// SolarisPrincipals // SolarisPrincipals
{"SolarisNumericGroupPrincipal [Primary Group]: ", {"SolarisNumericGroupPrincipal.Primary.Group.",
"SolarisNumericGroupPrincipal [Primary Group]: "}, "SolarisNumericGroupPrincipal [Primary Group]: "},
{"SolarisNumericGroupPrincipal [Supplementary Group]: ", {"SolarisNumericGroupPrincipal.Supplementary.Group.",
"SolarisNumericGroupPrincipal [Supplementary Group]: "}, "SolarisNumericGroupPrincipal [Supplementary Group]: "},
{"SolarisNumericUserPrincipal: ", {"SolarisNumericUserPrincipal.",
"SolarisNumericUserPrincipal: "}, "SolarisNumericUserPrincipal: "},
{"SolarisPrincipal: ", "SolarisPrincipal: "}, {"SolarisPrincipal.", "SolarisPrincipal: "},
{"provided null name", "provided null name"} {"provided.null.name", "provided null name"}
}; };
......
/*
* Copyright (c) 2010, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6987827
* @summary security/util/Resources.java needs improvement
*/
import java.lang.reflect.Method;
import java.util.HashSet;
import java.util.Set;
/**
* This test makes sure that the keys in resources files are using the new
* format and there is no duplication.
*/
public class NewNamesFormat {
public static void main(String[] args) throws Exception {
checkRes("sun.security.util.Resources");
checkRes("sun.security.util.AuthResources");
checkRes("sun.security.tools.JarSignerResources");
}
private static void checkRes(String resName) throws Exception {
System.out.println("Checking " + resName + "...");
Class clazz = Class.forName(resName);
Method m = clazz.getMethod("getContents");
Object[][] contents = (Object[][])m.invoke(clazz.newInstance());
Set<String> keys = new HashSet<String>();
for (Object[] pair: contents) {
String key = (String)pair[0];
if (keys.contains(key)) {
System.out.println("Found dup: " + key);
throw new Exception();
}
checkKey(key);
keys.add(key);
}
}
private static void checkKey(String key) throws Exception {
for (char c: key.toCharArray()) {
if (Character.isLetter(c) || Character.isDigit(c) ||
c == '{' || c == '}' || c == '.') {
// OK
} else {
System.out.println("Illegal char [" + c + "] in key: " + key);
throw new Exception();
}
}
}
}
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册