Remove dependency to run in Android

Description

I'm using Hibernat-Validator 4.2.0 Final in an Android project and it fails with the following:

This happens because java.beans.Introspector is not part of Dalvik. Looking at the code it seems only the Introspector is used only in the following line:


which is a very simple String manipulation method.

Proposed soultion
Included a decapitalize method in the ReflectionHelper removing the dependency toward the Introspector.
I tested this solution with some simple valdation constraint and everything worked fine.

Environment

Android 2.x, 4.x

Activity

Show:

Gunnar Morling August 6, 2013 at 12:26 PM

Created PR https://github.com/hibernate/hibernate-validator/pull/269.

@: As discussed we can avoid that particular usage with this change, but we can't guarantee that similar issues won't arise. One way to avoid this kind of issue would actually be to work with Animal Sniffer to make sure that only APIs present on Android are used (we use Animal Sniffer anyways for checking compatability with Java 6).

Unfortunately there are no Sniffer signature files for the Android API, so we can't do this kind of check atm. We might re-consider that if some one would provide the required signature files (of course this also depends on how much effort it would be to provide other possibly missing things).

Gunnar Morling March 25, 2013 at 10:10 AM

Hi, that's an interesting issue. I guess we can address this particular case, but I don't think we can make sure that not similar issues arise in the future, since we don't have a way to check that only APIs existent on Android are used.

Fixed

Details

Assignee

Reporter

Labels

Participants

Andrea Vacondio
Gunnar Morling

Original estimate

Time tracking

No time logged0.03h remaining

Components

Fix versions

Affects versions

Priority

Created March 23, 2013 at 5:36 PM
Updated August 9, 2013 at 10:34 AM
Resolved August 7, 2013 at 9:29 AM