New issue 39 by borut.bo...@gmail.com: CayenneDataTypeAnalyzer
checkLongText throws NPE
http://code.google.com/p/tapestry5-cayenne/issues/detail?id=39
What steps will reproduce the problem?
1. Create new T5 project
2. Include tapestry5-cayenne-server 0.3-SNAPSHOT
3. Create a simple POJO (not a Cayenne entity) to be used in a grid
component which has a String field.
4. Create some pojos and add them to some list.
5. Use the above list in a grid's source attribute.
The page fails to render as there is a NPE in method
checklongText(ent,adapter,dt) when dt equals "text".
Line 105:
ObjAttribute att = (ObjAttribute) ent.getAttribute(adapter.getName());
ent is null
One can not use simple POJOs in T5 Grid if tapestry-cayenne module is part
of the project.
Comment #1 on issue 39 by robert.z...@gmail.com: CayenneDataTypeAnalyzer
checkLongText throws NPE
http://code.google.com/p/tapestry5-cayenne/issues/detail?id=39
Reproduced.
Fixed in trunk.
Hello,
unfortunately something went wrong with 0.3 release I guess. I am looking
at the differeneces between my trunk and the server trunk. I see the changes
//fixes googlecode issue #39: unable to use POJO w/ String properties w/
t5cayenne.
if (ent == null)
return dt;
but when I look at the source code of the released 0.3 version which I
upgraded to yesterday because I wanted to release my project and maven does
not like snapshots when doing mvn release as you know, I still see
String dt = _defaultAnalyzer.identifyDataType(adapter);
if (dt != null && !dt.equals("")) {
return checkLongText(ent,adapter,dt);
}
if (ent == null) {
return null;
}
in identifyDataType method which lead to know NPE, as ent is not checked
for null value before sending it as first parameter to checkLongText method.
Can you please release 0.3.1 with this fix? Thank you very much!
This is resolved in the 0.4 release for sure, which is now available via
the saiwai repository. I'll be uploading artifacts for download shortly, as
well.