Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.7
-
None
-
None
Description
See issue http://jira.grails.org/browse/GRAILS-10562
Currently in Groovy if you do Class.forName("..") for dynamic dispatch the classloader for the calling class is not used. This completely breaks the semantics of the method as described in the javadoc http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html#forName(java.lang.String)
Given that monkey patching Class.forName("..") is an unbelievably bad idea and the behavior should be the same as Java the recommendation is that all calls to Class.forName("..") are made directly. This has a number of benefits including:
- Same semantics as the original Java method
- Improved performance
- Fewer long explanation as to why this method is broken to users