Tapestry 5
  1. Tapestry 5
  2. TAP5-1227

Binding a parameter whose type is primitive to null results in a difficult to understand NullPointerException

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.2.0
    • Fix Version/s: 5.3
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      NPE is appropriate, but a blank message is not. The message should be something like:

      "Parameter com.example.components.Layout.section is primitive type int and may not be bound to null. You should convert this parameter to type java.lang.Integer."

      Possibly we could get some similar effect by automatically forcing allowNull to false for primitive type parameters.

        Activity

        Hide
        Hudson added a comment -

        Integrated in tapestry-trunk-freestyle #414 (See https://builds.apache.org/job/tapestry-trunk-freestyle/414/)
        TAP5-1227: Binding a parameter whose type is primitive to null results in a difficult to understand NullPointerException
        TAP5-1227: Add PlasticUtils.isPrimitive()

        hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1144110
        Files :

        • /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/ShowInt.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/NullBindingToPrimitive.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/NullBindingToPrimitive.tml
        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ParameterWorker.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/ParameterTests.groovy

        hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1144109
        Files :

        • /tapestry/tapestry5/trunk/plastic/src/test/groovy/org/apache/tapestry5/internal/plastic/PlasticUtilsTests.groovy
        • /tapestry/tapestry5/trunk/plastic/src/main/java/org/apache/tapestry5/plastic/PlasticUtils.java
        Show
        Hudson added a comment - Integrated in tapestry-trunk-freestyle #414 (See https://builds.apache.org/job/tapestry-trunk-freestyle/414/ ) TAP5-1227 : Binding a parameter whose type is primitive to null results in a difficult to understand NullPointerException TAP5-1227 : Add PlasticUtils.isPrimitive() hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1144110 Files : /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/ShowInt.java /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/NullBindingToPrimitive.java /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java /tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/NullBindingToPrimitive.tml /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ParameterWorker.java /tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/ParameterTests.groovy hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1144109 Files : /tapestry/tapestry5/trunk/plastic/src/test/groovy/org/apache/tapestry5/internal/plastic/PlasticUtilsTests.groovy /tapestry/tapestry5/trunk/plastic/src/main/java/org/apache/tapestry5/plastic/PlasticUtils.java

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Howard M. Lewis Ship
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development