From 26fcd6d884d664dbe3106788261242697a5c72e8 Mon Sep 17 00:00:00 2001 From: Hardy Ferentschik Date: Fri, 8 Mar 2013 20:02:22 +0100 Subject: [PATCH] HV-740 Disabling around construct callbacks --- .../cdi/interceptor/ValidationInterceptor.java | 10 ++++------ .../validator/integration/cdi/InterceptorTest.java | 2 ++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/engine/src/main/java/org/hibernate/validator/internal/cdi/interceptor/ValidationInterceptor.java b/engine/src/main/java/org/hibernate/validator/internal/cdi/interceptor/ValidationInterceptor.java index 4a3ff3baac..cf94e05583 100644 --- a/engine/src/main/java/org/hibernate/validator/internal/cdi/interceptor/ValidationInterceptor.java +++ b/engine/src/main/java/org/hibernate/validator/internal/cdi/interceptor/ValidationInterceptor.java @@ -23,7 +23,6 @@ import java.util.Set; import javax.annotation.Priority; import javax.inject.Inject; -import javax.interceptor.AroundConstruct; import javax.interceptor.AroundInvoke; import javax.interceptor.Interceptor; import javax.interceptor.InvocationContext; @@ -107,12 +106,10 @@ public Object validateMethodInvocation(InvocationContext ctx) throws Exception { * * @param ctx The context of the intercepted constructor invocation. * - * @return The result of the constructor invocation. - * * @throws Exception Any exception caused by the intercepted constructor invocation. A {@link ConstraintViolationException} * in case at least one constraint violation occurred either during parameter or return value validation. */ - @AroundConstruct +// @AroundConstruct @SuppressWarnings("unchecked") public void validateConstructorInvocation(InvocationContext ctx) throws Exception { ExecutableValidator executableValidator = validator.forExecutables(); @@ -128,11 +125,12 @@ public void validateConstructorInvocation(InvocationContext ctx) throws Exceptio ); } - Object result = ctx.proceed(); + ctx.proceed(); + Object createdObject = ctx.getTarget(); violations = validator.forExecutables().validateConstructorReturnValue( ctx.getConstructor(), - result + createdObject ); if ( !violations.isEmpty() ) { diff --git a/integration/weld/src/test/java/org/hibernate/validator/integration/cdi/InterceptorTest.java b/integration/weld/src/test/java/org/hibernate/validator/integration/cdi/InterceptorTest.java index dfd4fb7bb2..eb4910a761 100644 --- a/integration/weld/src/test/java/org/hibernate/validator/integration/cdi/InterceptorTest.java +++ b/integration/weld/src/test/java/org/hibernate/validator/integration/cdi/InterceptorTest.java @@ -25,6 +25,7 @@ import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @@ -67,6 +68,7 @@ public void testInjection() throws Exception { } @Test + @Ignore public void testInstanceInjection() throws Exception { assertNotNull( repeaterInstance ); try {