-
Bug
-
Resolution: Fixed
-
P4
-
1.4.0, 1.4.2
-
tiger
-
x86
-
windows_98, windows_2000
Name: jl125535 Date: 03/14/2002
FULL PRODUCT VERSION :
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
FULL OPERATING SYSTEM VERSION :
Windows 2000
A DESCRIPTION OF THE PROBLEM :
There are cases when test 'methodname == "get"' returns
false despite the fact that methodname actually
contains "get".
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1.Execute Test
2.
3.
EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected:
Running Statement with a naked string
Running Statement with a constructed String
Actual: (see ERROR MESSAGES/STACK TRACES below)
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Running Statement with a naked string
Running Statement with a constructed String
java.lang.NoSuchMethodException: StringArray0.get(Integer0);
at java.beans.Statement.invoke(Statement.java:489)
at java.beans.Statement.execute(Statement.java:119)
at Test.main(Test.java:19)
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.beans.Statement;
public class Test {
public static void main(String[] args) {
String [] array = {"Philip Milne", "Steve Langley"};
System.out.println("Running Statement with a naked string");
Statement st = new Statement(array, "get",
new Object []{new Integer (0)});
try {
st.execute();
} catch (Exception ex) {
ex.printStackTrace();
}
System.out.println("Running Statement with a constructed String");
st = new Statement(array, new String("get"),
new Object []{new Integer (0)});
try {
st.execute();
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
---------- END SOURCE ----------
(Review ID: 143848)
======================================================================
- duplicates
-
JDK-4906055 java.beans.Statement.invoke() uses incorrect string compare
-
- Closed
-
- relates to
-
JDK-4922835 DOC: Statement javadoc should indicate that target and methodName cannot be null
-
- Resolved
-
-
JDK-6582164 JavaBeans tests should be open source
-
- Resolved
-