Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-2135

@Cache annotation converts thrown checked exceptions into RuntimeExceptions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.3.7
    • 5.4
    • tapestry-core
    • None

    Description

      Method with @Cached annotation throws RuntimeExceptions instead of checked exception.
      This behaviour seems to be a wrong.
      See example below

      Source code:

      package com.mycompany.tapestryproject.pages;
      import java.io.IOException;
      import org.apache.tapestry5.annotations.Cached;

      public class SomePage {

      private String method1() throws IOException

      { throw new IOException(); }

      @Cached
      private String method2() throws IOException { throw new IOException(); }

      public String getResult1() {
      try

      { return method1(); }

      catch (Exception e)

      { return e.getClass().getName(); }
      }

      public String getResult2() {
      try { return method2(); } catch (Exception e) { return e.getClass().getName(); }

      }
      }

      Template:
      <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
      <body>
      <p>Method1 return ${result1}</p>
      <p>Method2 return ${result2}</p>
      </body>
      </html>

      Output:
      Method1 return java.io.IOException
      Method2 return java.lang.RuntimeException

      Attachments

        Activity

          People

            hlship Howard Lewis Ship
             alexlumpov Alex Lumpov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: