Boolean is get

22 views
Skip to first unread message

Peeyush Tuli

unread,
Dec 10, 2014, 8:40:48 AM12/10/14
to jmapper-...@googlegroups.com, Pinaki Ashar
Hi,

thanks for a fantastic lib. I had one question. The naming convention for getters in case of both boolean and Boolean is strictly starting with is as I found after checking the sourcecode -

/**
* if clazz is a boolean, this method calls mIs(field), in other cases this method calls the mGet(field)
* @param clazz
* @param field
* @return a get method name of the field
* @see GeneralUtility#mIs(String)
* @see GeneralUtility#mGet(String)
*/
public static String getMethod(Class<?> clazz,String field){
return clazz == boolean.class || Boolean.class ? mIs(field):mGet(field);
}


In our use case we generate entities from hibernate which will create getters starting from get for Boolean entities and I cant seem to overcome that issue while mapping using any config mentioned in the explicit conversion docs. Thus the only likely is remove Boolean.class from the check above and make a custom lib. I understand that there is a reason for the original naming convention but it clashes with the Hibernate one. I am unable to force the hibernate code generator to go from get to is for Boolean so it was easier here.
I ran maven install and it failed on MappedArrayOperationTest. java with or without this change. So my two queries are -
- With a test failing as is, is it a safe version of the code to make a build usable for production? Do i need to go some commits back( I cant find a release note in the svn comments for 1.2.0)
- With your vision do you see a problem with this change?

Thanks,
Peeyush




This e-mail message may contain confidential or legally privileged information and is intended only for the use of the intended recipient(s). Any unauthorized disclosure, dissemination, distribution, copying or the taking of any action in reliance on the information herein is prohibited. E-mails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, or contain viruses. Anyone who communicates with us by e-mail is deemed to have accepted these risks. Company Name is not responsible for errors or omissions in this message and denies any responsibility for any damage arising from the use of e-mail. Any opinion and other statement contained in this message and any attachment are solely those of the author and do not necessarily represent those of the company.

P please consider the environment before printing this e-mail

Alessandro Vurro

unread,
Dec 10, 2014, 12:03:57 PM12/10/14
to jmapper-...@googlegroups.com, Pinaki...@newscyclesolutions.com
Hi Peeyush,

the issue is clear, i will work to fix it. In the meantime you can write the method  "is.." and internally call "get..." just for a runnable code.

Regards
Reply all
Reply to author
Forward
0 new messages