Author: hlship Date: Wed Sep 1 00:02:06 2010 New Revision: 991405 URL: http://svn.apache.org/viewvc?rev=991405&view=rev Log: TAP5-1188: Clean up and streamline code, make sure all inner classes (including inner interfaces) are loaded by the reloading class loader
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/AbstractReloadableObjectCreator.java Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/AbstractReloadableObjectCreator.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/AbstractReloadableObjectCreator.java?rev=991405&r1=991404&r2=991405&view=diff ============================================================================== --- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/AbstractReloadableObjectCreator.java (original) +++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/AbstractReloadableObjectCreator.java Wed Sep 1 00:02:06 2010 @@ -232,8 +232,36 @@ public abstract class AbstractReloadable { logger.debug(String.format("BEGIN Analyzing %s", className)); + analyze(pool, className); + + trackClassFileChanges(className); + + logger.debug(String.format(" END Analyzing %s", className)); + } + + private void analyze(ClassPool pool, String className) throws NotFoundException, CannotCompileException + { CtClass ctClass = pool.get(className); + CtClass[] nestedClasses = ctClass.getNestedClasses(); + + for (CtClass nc : nestedClasses) + { + add(nc.getName()); + } + + // CtClass[] interfaces = ctClass.getInterfaces(); + // + // for (CtClass i : interfaces) + // { + // String interfaceName = i.getName(); + // + // if (isInnerClass(interfaceName)) + // { + // add(interfaceName); + // } + // } + ctClass.instrument(new ExprEditor() { public void edit(ConstructorCall c) throws CannotCompileException @@ -256,23 +284,7 @@ public abstract class AbstractReloadable if (url != null && url.getProtocol().equals("file")) add(cn); } - - public void edit(NewExpr e) throws CannotCompileException - { - String newInstanceClassName = e.getClassName(); - - if (classesToLoad.contains(newInstanceClassName)) - return; - - if (isInnerClass(newInstanceClassName)) - add(newInstanceClassName); - } - }); - - trackClassFileChanges(className); - - logger.debug(String.format(" END Analyzing %s", className)); } private void trackClassFileChanges(String className)