Greg Holmberg wrote:
Here’s another regression I found today, which generates uncompilable
code.
I have an <<Enumeration>> Class for Hibernate. All the attributes are
of type datatype.String, public, frozen, classifier scope.
This generates two files:
one under common\target\src (xxx.java generated by the Java cartridge) and
one under core\target\src (xxxEnum.java extends xxx.java implements
Hibernate.UserType, generated by the Spring cartridge).
The file generated by the Spring cartridge
(core\target\src\...\xxxEnum.java) contains:
public void nullSafeSet(PreparedStatement statement, Object value, int
index) throws HibernateException, SQLException
{
if (value == null)
{
statement.setNull(index, Types.VARCHAR);
}
else
{
statement.setObject(index,
java.lang.String.valueOf(*String.valueOf*(value)));
}
}
}
The compiler says:
cannot resolve symbol
symbol : method valueOf (java.lang.Object)
location: class com.inxight.smartsearch.metadata.PropertyType
statement.setObject(index,
java.lang.String.valueOf(String.valueOf(value)));
That's odd, the method does exist on 1.4.2:
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html
What JDK are you compiling with?
^
Oddly, this compiled in other similar .java files from other
<<Enumeration>> Classes. I can’t explain that.
Possible fix: I hand-edited the line to:
statement.setObject(index, java.lang.String.valueOf(value));
And it compiled.
Greg
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Andromda-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/andromda-user