You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Alex Lumpov (JIRA)" <ji...@apache.org> on 2013/06/27 17:13:20 UTC

[jira] [Updated] (TAP5-2135) @Cached bug

     [ https://issues.apache.org/jira/browse/TAP5-2135?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alex Lumpov updated TAP5-2135:
------------------------------

    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;

/**
 *
 * @author AlexLumpov
 */
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


  was:
Method with @Cached annotation throws RuntimeExceptions instead of checked exception.
This behaviour seems to be a wrong.

    
> @Cached bug
> -----------
>
>                 Key: TAP5-2135
>                 URL: https://issues.apache.org/jira/browse/TAP5-2135
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.3.7
>            Reporter: Alex Lumpov
>
> 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;
> /**
>  *
>  * @author AlexLumpov
>  */
> 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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira