You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Android: gradle configuration of object-diff : crash when run application #147
Per default java-object-diff uses the java.beans.Introspector to resolve properties and their corresponding getters and setters from the types its trying to compare. It looks like the AndroidRuntime doesn't come with this class. That's something I wasn't aware of. The only way around that would be to implement a custom introspector, which doesn't rely on the java.beans class and either uses something similar from the AndroidRuntime or just plain old reflection.
The StandardIntrospector would be a good starting point. Basically all you'd have to do would be to implement the method TypeInfo introspect(Class<?> type) and populate the TypeInfo with information about the available properties of the given type.
The resulting Introspector can then be configured via ObjectDifferBuilder.
Come to think of it, now that I know that Android doesn't ship with java.beans.Introspector, I think it makes sense to change the default to use regular reflection and perhaps offer alternative implementations for people who rely on the performance advantages of the more advanced introspector. But for now, I'm afraid you have to build your own solution. 😞
changed the title [-]gradle configuration of object-diff : crash when run application [/-][+]Android: gradle configuration of object-diff : crash when run application [/+]on Dec 10, 2015
Activity
SQiShER commentedon Dec 9, 2015
Per default java-object-diff uses the
java.beans.Introspectorto resolve properties and their corresponding getters and setters from the types its trying to compare. It looks like theAndroidRuntimedoesn't come with this class. That's something I wasn't aware of. The only way around that would be to implement a custom introspector, which doesn't rely on thejava.beansclass and either uses something similar from theAndroidRuntimeor just plain old reflection.The
StandardIntrospectorwould be a good starting point. Basically all you'd have to do would be to implement the methodTypeInfo introspect(Class<?> type)and populate theTypeInfowith information about the available properties of the given type.The resulting
Introspectorcan then be configured viaObjectDifferBuilder.Come to think of it, now that I know that Android doesn't ship with
java.beans.Introspector, I think it makes sense to change the default to use regular reflection and perhaps offer alternative implementations for people who rely on the performance advantages of the more advanced introspector. But for now, I'm afraid you have to build your own solution. 😞[-]gradle configuration of object-diff : crash when run application [/-][+]Android: gradle configuration of object-diff : crash when run application [/+]