Skip to content

Commit

Permalink
Def methods from groovy with @PostConstruct annotation will be now ca…
Browse files Browse the repository at this point in the history
…lled
  • Loading branch information
Matej Briskar authored and jharting committed Jan 2, 2014
1 parent c6077fa commit 4dbf34d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions impl/src/main/java/org/jboss/weld/util/BeanMethods.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,16 @@ public void levelStart(Class<? super T> clazz) {

@Override
public void processMethod(EnhancedAnnotatedMethod<?, ? super T> method) {
if (isValidTargetClassLifecycleInterceptorMethod(method)) {
if (methodHasNoParameters(method)) {
if (foundMethod != null) {
duplicateMethod(method);
}
foundMethod = method;
}
}

private boolean isValidTargetClassLifecycleInterceptorMethod(EnhancedAnnotatedMethod<?, ? super T> method) {
// TODO: this method actually duplicates code in InterceptorMetadataUtils.isValidTargetClassLifecycleInterceptorMethod
return Void.TYPE.equals(method.getJavaClass()) && method.getParameterTypesAsArray().length == 0;
private boolean methodHasNoParameters(EnhancedAnnotatedMethod<?, ? super T> method) {
return method.getParameterTypesAsArray().length == 0;
}

@Override
Expand Down

0 comments on commit 4dbf34d

Please sign in to comment.