Bugs item #689026, was opened at 2003-02-18 15:09
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=438935&aid=689026&group_id=44253
Category: DynamicJava
Group: Would be nice if fixed ...
Status: Open
Resolution: None
Priority: 3
Submitted By: Eric E. Allen (eallen)
Assigned to: Nobody/Anonymous (nobody)
Summary: DynamicJava can't handle certain variable names
Initial Comment:
This one is pretty amusing. It's almost certainly not our
fault, but I guess we'll need either a workaround or a fix
from the DynamicJava team:
Define the following class in the Definitions Pane, and
then save and compile:
"public class TestClass {}"
Now define the following variable in the Interactions Pane:
> testClass = new TestClass();
You will get the following error:
java.lang.NoClassDefFoundError: testClass (wrong
name: TestClass)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass
(ClassLoader.java:502)
at java.security.SecureClassLoader.defineClass
(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass
(URLClassLoader.java:250)
at java.net.URLClassLoader.access$100
(URLClassLoader.java:54)
at java.net.URLClassLoader$1.run
(URLClassLoader.java:193)
at java.security.AccessController.doPrivileged(Native
Method)
at java.net.URLClassLoader.findClass
(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass
(ClassLoader.java:299)
at java.lang.ClassLoader.loadClass
(ClassLoader.java:292)
at java.lang.ClassLoader.loadClass
(ClassLoader.java:292)
at java.lang.ClassLoader.loadClass
(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal
(ClassLoader.java:315)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:217)
It looks like you'll get the same error for any variable that
has the same name as its type (modulo capitalization),
_provided that the type is user-defined_. Library classes
such as String, StringBuffer, and Object won't trip the
bug.
Strangely, there are no DynamicJava methods in the
stack trace, but how could this be a bug in Java?
Clearly, Java lets you perform variable assignments like
the one above (in fact, I tripped over this error while
pasting a working unit test into interactions).
-- Eric
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=438935&aid=689026&group_id=44253
|