Seam SVN: r9477 - trunk/src/wicket/org/jboss/seam/wicket/ioc.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-31 15:47:18 -0400 (Fri, 31 Oct 2008)
New Revision: 9477
Modified:
trunk/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java
Log:
JBSEAM-3658
Modified: trunk/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java
===================================================================
--- trunk/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java 2008-10-31 19:16:15 UTC (rev 9476)
+++ trunk/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java 2008-10-31 19:47:18 UTC (rev 9477)
@@ -182,7 +182,7 @@
private static String createBody(CtClass clazz, CtMethod method, CtMethod newMethod) throws NotFoundException
{
- String src = "{" + createMethodObject(method) + "if (this.handler != null) this.handler.beforeInvoke(this, method);" + createMethodDelegation(newMethod) + "if (this.handler != null) result = ($r) this.handler.afterInvoke(this, method, ($w) result); return ($r) result;}";
+ String src = "{" + createMethodObject(clazz,method) + "if (this.handler != null) this.handler.beforeInvoke(this, method);" + createMethodDelegation(newMethod) + "if (this.handler != null) result = ($r) this.handler.afterInvoke(this, method, ($w) result); return ($r) result;}";
log.trace("Creating method " + clazz.getName() + "." + newMethod.getName() + "(" + newMethod.getSignature() + ")" + src);
return src;
@@ -218,10 +218,10 @@
return src;
}
- private static String createMethodObject(CtMethod method) throws NotFoundException
+ private static String createMethodObject(CtClass clazz, CtMethod method) throws NotFoundException
{
String src = createParameterTypesArray(method);
- src += "java.lang.reflect.Method method = this.getClass().getDeclaredMethod(\""+ method.getName() + "\", parameterTypes);";
+ src += "java.lang.reflect.Method method = " + clazz.getName() +".class.getDeclaredMethod(\""+ method.getName() + "\", parameterTypes);";
return src;
}
16 years
Seam SVN: r9476 - trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/captcha.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-31 15:16:15 -0400 (Fri, 31 Oct 2008)
New Revision: 9476
Modified:
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/captcha/WikiCaptchaValidator.java
Log:
minor
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/captcha/WikiCaptchaValidator.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/captcha/WikiCaptchaValidator.java 2008-10-31 18:03:41 UTC (rev 9475)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/captcha/WikiCaptchaValidator.java 2008-10-31 19:16:15 UTC (rev 9476)
@@ -8,6 +8,7 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.faces.Validator;
+import org.jboss.seam.annotations.intercept.BypassInterceptors;
import org.jboss.seam.log.Logging;
import org.jboss.seam.log.Log;
import org.jboss.seam.core.Interpolator;
@@ -29,6 +30,7 @@
*/
@Name("wikiCaptchaValidator")
@Validator(id = "wikiCaptchaValidator")
+@BypassInterceptors
public class WikiCaptchaValidator implements javax.faces.validator.Validator, Serializable {
public static final String VERIFICATION_MSG_EXPR = "#{messages['lacewiki.label.VerificationError']}";
16 years
Seam SVN: r9475 - trunk/src/wicket/org/jboss/seam/wicket/ioc.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-31 14:03:41 -0400 (Fri, 31 Oct 2008)
New Revision: 9475
Modified:
trunk/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java
Log:
JBSEAM-3594, instrument abstract classes so abstract constructors are run, thanks to Clint Popetz
Modified: trunk/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java
===================================================================
--- trunk/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java 2008-10-31 17:58:26 UTC (rev 9474)
+++ trunk/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java 2008-10-31 18:03:41 UTC (rev 9475)
@@ -143,7 +143,7 @@
for (CtMethod method : implementation.getDeclaredMethods())
{
- if (!Modifier.isStatic(method.getModifiers()))
+ if (!Modifier.isStatic(method.getModifiers()) && !Modifier.isAbstract(method.getModifiers()))
{
if (!("getHandler".equals(method.getName()) || "getEnclosingInstance".equals(method.getName())))
{
@@ -235,7 +235,7 @@
private static boolean isInstrumentable(CtClass clazz)
{
int modifiers = clazz.getModifiers();
- return !(Modifier.isAbstract(modifiers) || Modifier.isInterface(modifiers) || Modifier.isEnum(modifiers));
+ return !(Modifier.isInterface(modifiers) || Modifier.isEnum(modifiers));
}
}
16 years
Seam SVN: r9474 - trunk/src/wicket/org/jboss/seam/wicket/ioc.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-31 13:58:26 -0400 (Fri, 31 Oct 2008)
New Revision: 9474
Modified:
trunk/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java
Log:
JBSEAM-3594, make delegated synthetic method private, thanks to Clint Popetz
Modified: trunk/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java
===================================================================
--- trunk/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java 2008-10-31 17:57:18 UTC (rev 9473)
+++ trunk/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java 2008-10-31 17:58:26 UTC (rev 9474)
@@ -150,6 +150,7 @@
String newName = implementation.makeUniqueName(method.getName());
CtMethod newMethod = CtNewMethod.copy(method, newName, implementation, null);
+ newMethod.setModifiers(Modifier.PRIVATE);
implementation.addMethod(newMethod);
method.setBody(createBody(implementation, method, newMethod));
log.trace("instrumented method " + method.getName());
16 years
Seam SVN: r9473 - trunk/src/wicket/org/jboss/seam/wicket/ioc.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-31 13:57:18 -0400 (Fri, 31 Oct 2008)
New Revision: 9473
Modified:
trunk/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java
Log:
JBSEAM-3594, refer to class explicitly, thanks to Clint Popetz
Modified: trunk/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java
===================================================================
--- trunk/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java 2008-10-31 17:51:24 UTC (rev 9472)
+++ trunk/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java 2008-10-31 17:57:18 UTC (rev 9473)
@@ -161,7 +161,7 @@
if (constructor.isConstructor())
{
{
- String constructorObject = createConstructorObject(constructor);
+ String constructorObject = createConstructorObject(className,constructor);
constructor.insertBeforeBody(constructorObject + "handler.beforeInvoke(this, constructor);");
constructor.addCatch("{" + constructorObject + "throw new RuntimeException(handler.handleException(this, constructor, e));}", exception, "e");
constructor.insertAfter(constructorObject + "handler.afterInvoke(this, constructor);");
@@ -224,10 +224,10 @@
return src;
}
- private static String createConstructorObject(CtConstructor constructor) throws NotFoundException
+ private static String createConstructorObject(String className, CtConstructor constructor) throws NotFoundException
{
String src = createParameterTypesArray(constructor);
- src += "java.lang.reflect.Constructor constructor = this.getClass().getDeclaredConstructor(parameterTypes);";
+ src += "java.lang.reflect.Constructor constructor = " + className + ".class.getDeclaredConstructor(parameterTypes);";
return src;
}
16 years
Seam SVN: r9472 - trunk/src/wicket/org/jboss/seam/wicket/ioc.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-31 13:51:24 -0400 (Fri, 31 Oct 2008)
New Revision: 9472
Modified:
trunk/src/wicket/org/jboss/seam/wicket/ioc/BijectionInterceptor.java
trunk/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java
Log:
JBSEAM-3594, support fix NPE, thanks to Clint Popetz
Modified: trunk/src/wicket/org/jboss/seam/wicket/ioc/BijectionInterceptor.java
===================================================================
--- trunk/src/wicket/org/jboss/seam/wicket/ioc/BijectionInterceptor.java 2008-10-31 17:36:40 UTC (rev 9471)
+++ trunk/src/wicket/org/jboss/seam/wicket/ioc/BijectionInterceptor.java 2008-10-31 17:51:24 UTC (rev 9472)
@@ -37,7 +37,7 @@
InstrumentedComponent enclosingInstance = invocationContext.getInstrumentedComponent().getEnclosingInstance();
while (enclosingInstance != null)
{
- if (!enclosingInstance.getHandler().isReentrant())
+ if (enclosingInstance.getHandler() != null && !enclosingInstance.getHandler().isReentrant())
{
WicketComponent.getInstance(enclosingInstance.getClass()).inject(enclosingInstance);
enclosingInstance = enclosingInstance.getEnclosingInstance();
@@ -54,7 +54,7 @@
InstrumentedComponent enclosingInstance = invocationContext.getInstrumentedComponent().getEnclosingInstance();
while (enclosingInstance != null)
{
- if (!enclosingInstance.getHandler().isReentrant())
+ if (enclosingInstance.getHandler() != null && !enclosingInstance.getHandler().isReentrant())
{
WicketComponent.getInstance(enclosingInstance.getClass()).disinject(enclosingInstance);
enclosingInstance = enclosingInstance.getEnclosingInstance();
Modified: trunk/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java
===================================================================
--- trunk/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java 2008-10-31 17:36:40 UTC (rev 9471)
+++ trunk/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java 2008-10-31 17:51:24 UTC (rev 9472)
@@ -137,7 +137,7 @@
CtClass instrumentedComponent = classPool.get(InstrumentedComponent.class.getName());
implementation.addInterface(instrumentedComponent);
CtMethod getHandlerMethod = CtNewMethod.getter("getHandler", handlerField);
- CtMethod getEnclosingInstance = CtNewMethod.make("public " + InstrumentedComponent.class.getName() +" getEnclosingInstance() { return handler.getEnclosingInstance(this); }", implementation);
+ CtMethod getEnclosingInstance = CtNewMethod.make("public " + InstrumentedComponent.class.getName() +" getEnclosingInstance() { return handler == null ? null : handler.getEnclosingInstance(this); }", implementation);
implementation.addMethod(getEnclosingInstance);
implementation.addMethod(getHandlerMethod);
@@ -181,7 +181,8 @@
private static String createBody(CtClass clazz, CtMethod method, CtMethod newMethod) throws NotFoundException
{
- String src = "{" + createMethodObject(method) + "handler.beforeInvoke(this, method);" + createMethodDelegation(newMethod) + "return ($r) handler.afterInvoke(this, method, ($w) result);}";
+ String src = "{" + createMethodObject(method) + "if (this.handler != null) this.handler.beforeInvoke(this, method);" + createMethodDelegation(newMethod) + "if (this.handler != null) result = ($r) this.handler.afterInvoke(this, method, ($w) result); return ($r) result;}";
+
log.trace("Creating method " + clazz.getName() + "." + newMethod.getName() + "(" + newMethod.getSignature() + ")" + src);
return src;
}
@@ -203,7 +204,7 @@
private static String wrapInExceptionHandler(String src)
{
- return "try {" + src + "} catch (Exception e) { throw new RuntimeException(handler.handleException(this, method, e)); }";
+ return "try {" + src + "} catch (Exception e) { throw new RuntimeException(this.handler == null ? e : this.handler.handleException(this, method, e)); }";
}
private static String createParameterTypesArray(CtBehavior behavior) throws NotFoundException
16 years
Seam SVN: r9471 - trunk/src/wicket/org/jboss/seam/wicket.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-31 13:36:40 -0400 (Fri, 31 Oct 2008)
New Revision: 9471
Modified:
trunk/src/wicket/org/jboss/seam/wicket/WicketComponent.java
Log:
JBSEAM-3594, support injection in superclasses, thanks to Clint Popetz
Modified: trunk/src/wicket/org/jboss/seam/wicket/WicketComponent.java
===================================================================
--- trunk/src/wicket/org/jboss/seam/wicket/WicketComponent.java 2008-10-31 17:35:14 UTC (rev 9470)
+++ trunk/src/wicket/org/jboss/seam/wicket/WicketComponent.java 2008-10-31 17:36:40 UTC (rev 9471)
@@ -174,18 +174,21 @@
{
Class clazz = type;
scanClassEnclosureHierachy();
- for (Method method : clazz.getDeclaredMethods())
- {
- add(method);
+ while (clazz != Object.class) {
+ for (Method method : clazz.getDeclaredMethods())
+ {
+ add(method);
+ }
+ for (Field field : clazz.getDeclaredFields())
+ {
+ add(field);
+ }
+ for(Constructor<T> constructor : clazz.getDeclaredConstructors())
+ {
+ add(constructor);
+ }
+ clazz = clazz.getSuperclass();
}
- for (Field field : clazz.getDeclaredFields())
- {
- add(field);
- }
- for(Constructor<T> constructor : clazz.getDeclaredConstructors())
- {
- add(constructor);
- }
}
private void scanClassEnclosureHierachy()
16 years
Seam SVN: r9470 - trunk/src/test/ftest/examples/booking.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-31 13:35:14 -0400 (Fri, 31 Oct 2008)
New Revision: 9470
Modified:
trunk/src/test/ftest/examples/booking/
Log:
Add ignores
Property changes on: trunk/src/test/ftest/examples/booking
___________________________________________________________________
Name: svn:ignore
+ test-output
build
16 years
Seam SVN: r9469 - in trunk/src/test/ftest: examples and 1 other directory.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-31 13:01:58 -0400 (Fri, 31 Oct 2008)
New Revision: 9469
Modified:
trunk/src/test/ftest/build.xml
trunk/src/test/ftest/examples/build.xml
Log:
Support main testreport target and add a individual test target
Modified: trunk/src/test/ftest/build.xml
===================================================================
--- trunk/src/test/ftest/build.xml 2008-10-31 16:05:11 UTC (rev 9468)
+++ trunk/src/test/ftest/build.xml 2008-10-31 17:01:58 UTC (rev 9469)
@@ -60,7 +60,18 @@
<antcall target="stop.selenium.server">
</antcall>
</target>
+
+ <target name="test">
+ <antcall target="start.selenium.server">
+ </antcall>
+ <!-- Execute tests for all examples-->
+ <testexample name="${test}" />
+
+ <antcall target="stop.selenium.server">
+ </antcall>
+ </target>
+
<target name="cleanall">
<cleanexample name="booking" />
<cleanexample name="dvdstore" />
Modified: trunk/src/test/ftest/examples/build.xml
===================================================================
--- trunk/src/test/ftest/examples/build.xml 2008-10-31 16:05:11 UTC (rev 9468)
+++ trunk/src/test/ftest/examples/build.xml 2008-10-31 17:01:58 UTC (rev 9469)
@@ -33,7 +33,7 @@
<property name="common.src.dir" value="${ftest.dir}/src/main" />
<property name="build.dir" value="build" />
<property name="classes.dir" value="${build.dir}/classes" />
- <property name="test.output.dir" value="test-output" />
+ <property name="test.output.dir" value="${seam.dir}/test-output" />
<property name="ftest.lib.dir" value="${ftest.dir}/lib" />
<property name="log.dir" value="log" />
<property name="test.report.dir" value="test-report" />
16 years
Seam SVN: r9468 - trunk.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2008-10-31 12:05:11 -0400 (Fri, 31 Oct 2008)
New Revision: 9468
Modified:
trunk/seam.bat
Log:
missing end % in SEAM_HOME variable reference
Modified: trunk/seam.bat
===================================================================
--- trunk/seam.bat 2008-10-31 15:07:02 UTC (rev 9467)
+++ trunk/seam.bat 2008-10-31 16:05:11 UTC (rev 9468)
@@ -15,7 +15,7 @@
if ["%SEAM_HOME%"] == [""] (
set SEAM_HOME=%~dp0
) else (
- if not exist "%SEAM_HOME\seam.bat" (goto noseam)
+ if not exist "%SEAM_HOME%\seam.bat" (goto noseam)
)
if "%SEAM_HOME:~-1%" == "\" (
set SEAM_HOME=%SEAM_HOME:~0,-1%
16 years