Return to Snippet

Revision: 12953
at April 2, 2009 04:09 by zhengrenchi


Initial Code
//Before
final ClassLoader loader = new JiveClassLoader(parent, libDir);
Thread.currentThread().setContextClassLoader(loader);
Class sparkClass = loader.loadClass("org.jivesoftware.Spark");
Object instanceOfSpark = sparkClass.newInstance();

//after
final ClassLoader loader = new JiveClassLoader(parent, libDir);
Thread.currentThread().setContextClassLoader(loader);
Class sparkClass = loader.loadClass("org.jivesoftware.Spark");
final Object instanceOfSpark = sparkClass.newInstance();

Initial URL

                                

Initial Description
Because the spark's startup process use a lot time, so add the final to make it faster.

Initial Title
use keyword final to optimize the spark starter

Initial Tags

                                

Initial Language
Java