<div dir="ltr"><div>Well, I could find only a few places where the Class.forName() with the array parameter is needed. <br>Probably the tip number 6 - Centralize would help with that.<br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">2013/4/16 Mark Proctor <span dir="ltr"><<a href="mailto:mproctor@codehaus.org" target="_blank">mproctor@codehaus.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Some things cause other problems:<div><i style="font-family:Arial,Tahoma,Helvetica,FreeSans,sans-serif;font-size:13px;line-height:18px;background-color:rgb(237,236,232)">"Class.forName is Evil</i><span style="font-family:Arial,Tahoma,Helvetica,FreeSans,sans-serif;font-size:13px;line-height:18px;background-color:rgb(237,236,232)"> - Class.forName will pin classes in memory forever (almost, but long enough to cause problems). If you're forced to do dynamic class loading use ClassLoader.loadClass instead. All variations of the Class.forName suffer from the same problem. See </span><a href="http://blog.bjhargrave.com/2007/09/classforname-caches-defined-class-in.html" style="text-decoration:none;color:rgb(0,67,136);font-family:Arial,Tahoma,Helvetica,FreeSans,sans-serif;font-size:13px;line-height:18px;background-color:rgb(237,236,232)" target="_blank">BJ Hargrave's blog about this</a><span style="font-family:Arial,Tahoma,Helvetica,FreeSans,sans-serif;font-size:13px;line-height:18px;background-color:rgb(237,236,232)">."</span></div>
<div><font face="Arial, Tahoma, Helvetica, FreeSans, sans-serif"><span style="font-size:13px;line-height:18px"><br></span></font></div><div><font face="Arial, Tahoma, Helvetica, FreeSans, sans-serif"><span style="font-size:13px;line-height:18px">There is a bug in JDK which means that serialisation will not work with String[] when using loadClass, and Class.forName must be used:</span></font></div>
<div><a href="http://bugs.sun.com/view_bug.do?bug_id=6434149" target="_blank">http://bugs.sun.com/view_bug.do?bug_id=6434149</a></div><div><br></div><div>We hit this, and had to move all our stuff to Class.forName.</div><div>
<font face="Arial, Tahoma, Helvetica, FreeSans, sans-serif"><span style="font-size:13px;line-height:18px"><br></span></font></div><div><font face="Arial, Tahoma, Helvetica, FreeSans, sans-serif"><span style="font-size:13px;line-height:18px">Mark</span></font></div>
<div><font face="Arial, Tahoma, Helvetica, FreeSans, sans-serif"><span style="font-size:13px;line-height:18px"><br></span></font><div><div><div class="h5"><div>On 16 Apr 2013, at 18:51, Cristiano Gavião <<a href="mailto:cvgaviao@gmail.com" target="_blank">cvgaviao@gmail.com</a>> wrote:</div>
<br></div></div><blockquote type="cite"><div><div class="h5">Would like to share this excellent article with Drools and JBPM <br>developers...<br><br><a href="http://blog.osgi.org/2011/05/what-you-should-know-about-class.html" target="_blank">http://blog.osgi.org/2011/05/what-you-should-know-about-class.html</a><br>
<br>cheers,<br><br>Cristiano<br></div></div>_______________________________________________<br>rules-dev mailing list<br><a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
</blockquote></div><br></div></div><br>_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br></blockquote></div><br><br clear="all"><br>-- <br>"Tudo vale a pena se a alma não é pequena..."
</div>