-
Enhancement
-
Resolution: Fixed
-
P4
-
1.4.2
-
beta
-
sparc
-
solaris_8
Name: js151677 Date: 04/19/2004
A DESCRIPTION OF THE REQUEST :
The AppConfigurationEntry.LoginModuleControlFlag.toString() API produces items in the form:
LoginModuleControlFlag: <flag value>
The prepending of the "LoginModuleControlFlag: " to this return value is not specified in the Javadoc for that API, and as such caused string comparisons to fail.
JUSTIFICATION :
When doing string comparisons I received failures which i did not expect. This is because the Javadoc did not specify that a string literal would be prepended to the result.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Either:
a) javadoc specifies that a string is prepended to the returned value
or
b) the toString() API only returns the value, ie "required".
ACTUAL -
The toString() API would return "LoginModuleControlFlag: required" if i have a AppConfigurationEntry.LoginModuleControlFlag.REQUIRED value.
---------- BEGIN SOURCE ----------
import javax.security.auth.login.AppConfigurationEntry;
import javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag;
public class Test {
public static void main(String [] args) {
String flag = "REQUIRED";
if (flag.equalsIgnoreCase(AppConfigurationEntry
.LoginModuleControlFlag
.REQUIRED
.toString())) {
System.out.println("Successfull test");
} else {
System.out.println("Failed test");
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Prepend "LoginModuleControlFlag: " to my string that i use in the comparison.
(Incident Review ID: 246396)
======================================================================
A DESCRIPTION OF THE REQUEST :
The AppConfigurationEntry.LoginModuleControlFlag.toString() API produces items in the form:
LoginModuleControlFlag: <flag value>
The prepending of the "LoginModuleControlFlag: " to this return value is not specified in the Javadoc for that API, and as such caused string comparisons to fail.
JUSTIFICATION :
When doing string comparisons I received failures which i did not expect. This is because the Javadoc did not specify that a string literal would be prepended to the result.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Either:
a) javadoc specifies that a string is prepended to the returned value
or
b) the toString() API only returns the value, ie "required".
ACTUAL -
The toString() API would return "LoginModuleControlFlag: required" if i have a AppConfigurationEntry.LoginModuleControlFlag.REQUIRED value.
---------- BEGIN SOURCE ----------
import javax.security.auth.login.AppConfigurationEntry;
import javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag;
public class Test {
public static void main(String [] args) {
String flag = "REQUIRED";
if (flag.equalsIgnoreCase(AppConfigurationEntry
.LoginModuleControlFlag
.REQUIRED
.toString())) {
System.out.println("Successfull test");
} else {
System.out.println("Failed test");
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Prepend "LoginModuleControlFlag: " to my string that i use in the comparison.
(Incident Review ID: 246396)
======================================================================