Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004883 [Resin] minor always 11-29-11 03:01 11-30-11 15:56
Reporter andreaskaltenbach View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version 4.0.23
Summary 0004883: Resin generates uncompilable code for interceptors which contain enum array elements
Description Suppose the following enumeration:

public enum Direction {
    LEFT, MIDDLE, RIGHT;
}

which is used in an annotation @Directions;
@InterceptorBinding
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Directions {
    Direction[] value();
}

Furthermore have we a stateless session bean with an JavaEE interceptor defined:

@Named
@Stateless
@Interceptors(DirectionAware.class)
public class ServiceImpl implements Service {}

If we now annotate a method of the session bean with e.g. @Directions(value = Direction.RIGHT) , Resin will generate invalid Java code for the session bean's proxy class.

Attached, you find a little maven project to reproduce the bug.
Additional Information Example output from a Resin start:
ServiceImpl__StatelessProxy.java:90: illegal start of expression
                                               public com.stendahls.interceptors.MyEnum[] value() { return [Lcom.stendahls.interceptors.MyEnum;@1d1c0f9c; }

The following, uncompilable Java code is generated:
...
_doSomething_AROUND_INVOKE_0_objectIndexChain =
        com.caucho.config.gen.CandiUtil.createInterceptors(
          __caucho_manager,
          __caucho_interceptor_static_beans,
          __caucho_interceptor_beans,
          _doSomething_AROUND_INVOKE_0_objectIndexStaticChain,
          javax.enterprise.inject.spi.InterceptionType.AROUND_INVOKE,
          new javax.enterprise.util.AnnotationLiteral<com.stendahls.interceptors.Directions>() {
            public com.stendahls.interceptors.MyEnum[] value() { return [Lcom.stendahls.interceptors.MyEnum;@734d9f9f; }
          });
...

[Lcom.stendahls.interceptors.MyEnum;@734d9f9f; in this case is unable to compile.
Attached Files  bugreport.zip [^] (20,014 bytes) 11-29-11 03:01

- Relationships

- Notes
(0005647)
ferg
11-30-11 15:56

ioc/0c1f
 

- Issue History
Date Modified Username Field Change
11-29-11 03:01 andreaskaltenbach New Issue
11-29-11 03:01 andreaskaltenbach File Added: bugreport.zip
11-30-11 15:56 ferg Note Added: 0005647
11-30-11 15:56 ferg Assigned To  => ferg
11-30-11 15:56 ferg Status new => closed
11-30-11 15:56 ferg Resolution open => fixed
11-30-11 15:56 ferg Fixed in Version  => 4.0.25


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
30 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker