Uploaded image for project: 'Commons OGNL (Dormant)'
  1. Commons OGNL (Dormant)
  2. OGNL-85

constructor signature matching problem (int <-> java.lang.Integer)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 2.7
    • 2.7
    • ExpressionCompiler
    • None
    • Tapestry 4.1.2-SNAPSHOT

    Description

      The following page works as expected:

      package test;

      import org.apache.tapestry.annotations.Component;

      import org.apache.tapestry.annotations.InitialValue;

      import org.apache.tapestry.components.Insert;

      import org.apache.tapestry.html.BasePage;

      public abstract class Test extends BasePage

      {

      public static class IntWrapper

      {

      public IntWrapper(int value)

      { this.value = value; }

      private final int value;

      @Override

      public String toString()

      { return Integer.toString(value); }

      }

      @InitialValue("2")

      public abstract int getValue();

      @Component(bindings = "value=new test.Test$IntWrapper(2)")

      public abstract Insert getInsert();

      }

      After the following modification it fails:

      @Component(bindings = "value=new test.Test$IntWrapper(value)")

      The exception:

      Caused by: javassist.CannotCompileException: [source error] cannot find constructor test.Test$IntWrapper(java.lang.Integer)

      at javassist.CtBehavior.setBody(CtBehavior.java:347)

      at javassist.CtBehavior.setBody(CtBehavior.java:316)

      at org.apache.tapestry.enhance.ClassFabImpl.addMethod(ClassFabImpl.java:272)

      ... 84 more

      Caused by: compile error: cannot find constructor test.Test$IntWrapper(java.lang.Integer)

      at javassist.compiler.TypeChecker.atMethodCallCore(TypeChecker.java:716)

      at javassist.compiler.TypeChecker.atNewExpr(TypeChecker.java:148)

      at javassist.compiler.ast.NewExpr.accept(NewExpr.java:72)

      at javassist.compiler.CodeGen.doTypeCheck(CodeGen.java:235)

      at javassist.compiler.CodeGen.compileExpr(CodeGen.java:222)

      at javassist.compiler.CodeGen.atReturnStmnt2(CodeGen.java:591)

      at javassist.compiler.JvstCodeGen.atReturnStmnt(JvstCodeGen.java:424)

      at javassist.compiler.CodeGen.atStmnt(CodeGen.java:356)

      at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)

      at javassist.compiler.CodeGen.atStmnt(CodeGen.java:344)

      at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)

      at javassist.compiler.CodeGen.atMethodBody(CodeGen.java:285)

      at javassist.compiler.Javac.compileBody(Javac.java:212)

      at javassist.CtBehavior.setBody(CtBehavior.java:341)

      ... 86 more

      Regards:

      Norbi

      Attachments

        Activity

          People

            jkuhnert Jesse Kuhnert
            snorbi Norbert Sándor
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: