Issue Details (XML | Word | Printable)

Key: NUCCORE-610
Type: Bug Bug
Status: Closed Closed
Resolution: Cannot Reproduce
Priority: Testcase Required Testcase Required
Assignee: Unassigned
Reporter: Roshan Dawrani
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
DataNucleus Core

Wrong getXXX() gets picked up as getter method in ClassMetaData with JPA api used

Created: 10/Dec/10 11:21 AM   Updated: 01/Feb/11 08:35 PM   Resolved: 25/Jan/11 02:55 PM
Component/s: MetaData
Affects Version/s: 1.1.5
Fix Version/s: None

Environment: Grails 1.3.5 + App Engine SDK 1.4.0 + datanucleus-core-1.1.5 + datanucleus-jpa-1.1.5


 Description  « Hide
Hi,
I am trying to put a grails based application on Google App Engine and facing issues with entity classes written in Groovy.

Groovy compiler adds a few synthetic methods. two of which are as below:
{code}
Object getProperty(String prop) {...}

void setProperty(String prop, Object value) {...}
{code}

The class org.datanucleus.metadata.ClassMetaData that collects the meta data for members that don't explicitly have been given metadata (in addMetaDataForMembersNotInMetaData()) goes only by method name and not by parameters length and hence wrongly picks up getProperty(String propName) as the getter for property "property" and then later in populateMemberMetaData(), it tries to look for getter/setter for prop and fails with InvalidMetaDataException.

I added the following check in addMetaDataForMembersNotInMetaData() where it identifies the getters, to avoid the above situation and it worked fine for me.
{code}
if ((paramTypes != null) && (paramTypes.length > 0)) continue;
{code}

I haven't seen if this issue has been fixed in newer releases because I am dependent on datanucleus jars that come in App Engine SDK.

It may become a common issue for groovy/grails apps on GAE.

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 10/Dec/10 11:39 AM
Needless to say you're using out-of-date unsupported code there. As DN JIRA front page says, you need to attach a testcase that demonstrates any problem, conforming to
http://www.datanucleus.org/project/problem_jdo_testcase.html

GAE/J is not our responsibility.

Roshan Dawrani added a comment - 10/Dec/10 11:45 AM
Sure, I will attach testcases from now on. New account here. Looks like it is not needed here, if it is not supported by you.

I didn't know that GAE/J was not in your responsibility. From your experience, any idea whether google maintains/fixes those libraries for the issues highlighted?

Andy Jefferson added a comment - 25/Jan/11 02:55 PM
No testcase, so no way of reproducing.

Roshan Dawrani added a comment - 25/Jan/11 03:28 PM
Well, once you say GAE/J is not your responsibility, attaching a testcase doens't make sense then. You could have closed it on the very same day.