jOOQ / jOOR

jOOR - Fluent Reflection in Java jOOR is a very simple fluent API that gives access to your Java Class structures in a more intuitive way. The JDK's reflection APIs are hard and verbose to use. Other languages have much simpler constructs to access type meta information at runtime. Let us make Java reflection better.
http://www.jooq.org/products
Apache License 2.0
2.8k stars 377 forks source link

Rename methods Reflect#on(Class) and Reflect#on(String) to onClass() to avoid ambiguities #78

Closed lukaseder closed 5 years ago

lukaseder commented 5 years ago

The current overloading of Reflect.on() is unfortunate in a few cases where people want to reflect on instances of String or Class, but accidentally bind to the more specific methods that do something quite different from Reflect#on(Object). See e.g. #55

Those methods shouldn't overload the base method, but have an entirely different name. The old methods will stay in place and will be deprecated to document this change.

lukaseder commented 5 years ago

While the change is quite intrusive (lots of deprecations in calling code), it is not backwards incompatible. We'll remove the deprecated methods in jOOR 1.0. When reflecting on String or Class instances, callers still have to cast the arguments in order to bind to the non-deprecated methods.