We're updating the issue view to help you get more done. 

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:

1 2 03-23 12:15:42.194: E/AndroidRuntime(858): java.lang.NoClassDefFoundError: java.beans.Introspector 03-23 12:15:42.194: E/AndroidRuntime(858): at org.hibernate.validator.util.ReflectionHelper.getPropertyName(ReflectionHelper.java:176)

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:

1 name = Introspector.decapitalize( methodName.substring( prefix.length() ) );


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

Status

Assignee

Gunnar Morling

Reporter

Andrea Vacondio

Worked in

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Community Help Wanted

None

Suitable for new contributors

Yes, likely

Requires Release Note

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Time Tracking

2m

Components

Fix versions

Affects versions

4.2.0.Final

Priority

Trivial