[jira] [Assigned] (TAP5-2267) Contributing ExceptionHandlerAssistant instances to RequestExceptionHandler is broken

2013-12-28 Thread Kalle Korhonen (JIRA)

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

Kalle Korhonen reassigned TAP5-2267:


Assignee: Kalle Korhonen

 Contributing ExceptionHandlerAssistant instances to RequestExceptionHandler 
 is broken
 -

 Key: TAP5-2267
 URL: https://issues.apache.org/jira/browse/TAP5-2267
 Project: Tapestry 5
  Issue Type: Bug
  Components: tapestry-core
Affects Versions: 5.4
Reporter: Dragan Sahpaski
Assignee: Kalle Korhonen
Priority: Minor
 Attachments: TAP5-2267.patch


 DefaultRequestExceptionHandler fails with ClassCastException when an instance 
 of ExceptionHandlerAssistant is contributed to RequestExceptionHandler.
 This had been broken accidentally in commit 
 cb3d4c853f47cccf9193c33cfd085d6ca27c8706 when implementing contributions of 
 assistant classes that are autobuilt.
 Although DefaultRequestExceptionHandlerTest covers contributions of 
 ExceptionHandlerAssistant instances, it didn't fail because of an oversight 
 in the test.  
 The patch resolves the bug (trivially) and improves existing tests in 
 DefaultRequestExceptionHandlerTest which now fail without patching 
 DefaultRequestExceptionHandler.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


git commit: FIXED - TAP5-2267: Contributing ExceptionHandlerAssistant instances to RequestExceptionHandler is broken - apply Dragan Sahpaski's patch with test that allows contributing assistant instan

2013-12-28 Thread kaosko
Updated Branches:
  refs/heads/master 549b148f9 - ae473c840


FIXED - TAP5-2267: Contributing ExceptionHandlerAssistant instances to
RequestExceptionHandler is broken 
- apply Dragan Sahpaski's patch with test that allows contributing
assistant instances to the DefautlRequestExceptionHandler


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/ae473c84
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/ae473c84
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/ae473c84

Branch: refs/heads/master
Commit: ae473c840b9f425d8470dd0e8fd44d99e20be1a0
Parents: 549b148
Author: kaosko kao...@apache.org
Authored: Sat Dec 28 23:39:06 2013 -0800
Committer: kaosko kao...@apache.org
Committed: Sat Dec 28 23:39:06 2013 -0800

--
 .../internal/services/DefaultRequestExceptionHandler.java| 2 +-
 .../services/DefaultRequestExceptionHandlerTest.java | 8 +++-
 2 files changed, 8 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ae473c84/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DefaultRequestExceptionHandler.java
--
diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DefaultRequestExceptionHandler.java
 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DefaultRequestExceptionHandler.java
index 897b3b2..62a8708 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DefaultRequestExceptionHandler.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DefaultRequestExceptionHandler.java
@@ -113,7 +113,7 @@ public class DefaultRequestExceptionHandler implements 
RequestExceptionHandler
 throw new IllegalArgumentException(Throwable.class.getName() + 
 is the only allowable key type but  + entry.getKey().getName()
 +  was contributed);
 
-if (ExceptionHandlerAssistant.class.isAssignableFrom((Class) 
entry.getValue()))
+if (entry.getValue() instanceof Class  
ExceptionHandlerAssistant.class.isAssignableFrom((Class) entry.getValue()))
 {
 @SuppressWarnings(unchecked)
 ClassExceptionHandlerAssistant handlerType = 
(ClassExceptionHandlerAssistant) entry.getValue();

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ae473c84/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/DefaultRequestExceptionHandlerTest.java
--
diff --git 
a/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/DefaultRequestExceptionHandlerTest.java
 
b/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/DefaultRequestExceptionHandlerTest.java
index b9bf0c9..d458e1c 100644
--- 
a/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/DefaultRequestExceptionHandlerTest.java
+++ 
b/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/DefaultRequestExceptionHandlerTest.java
@@ -75,6 +75,13 @@ public class DefaultRequestExceptionHandlerTest extends 
InternalBaseTestCase {
 componentClassResolver = mockComponentClassResolver();
 linkSource = mockLinkSource();
 serviceResources = mockServiceResources();
+   mockConfiguration.put(AccessControlException.class, MyPage.class);
+mockConfiguration.put(MyContextAwareException.class, new 
ExceptionHandlerAssistant() {
+ public Object 
handleRequestException(Throwable exception, ListObject exceptionContext)
+ throws IOException {
+ return null;
+ }
+ });
 exceptionHandler = new DefaultRequestExceptionHandler(pageCache, 
renderer, logger, exceptionpage, request, response, componentClassResolver, 
linkSource, serviceResources, mockConfiguration);
 }

@@ -117,7 +124,6 @@ public class DefaultRequestExceptionHandlerTest extends 
InternalBaseTestCase {

@Test
public void handleRequestExceptionWithConfiguredPage() throws 
IOException {
-   mockConfiguration.put(AccessControlException.class, MyPage.class);
train_resolvePageClassNameToPageName(componentClassResolver, 
MyPage.class.getName(), mypage );
Link link = mockLink();
 expect(linkSource.createPageRenderLink(mypage, false, new 
Object[]{accesscontrol})).andReturn(link);



[jira] [Commented] (TAP5-2267) Contributing ExceptionHandlerAssistant instances to RequestExceptionHandler is broken

2013-12-28 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13858272#comment-13858272
 ] 

ASF subversion and git services commented on TAP5-2267:
---

Commit ae473c840b9f425d8470dd0e8fd44d99e20be1a0 in branch refs/heads/master 
from [~kaosko]
[ https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;h=ae473c8 ]

FIXED - TAP5-2267: Contributing ExceptionHandlerAssistant instances to
RequestExceptionHandler is broken 
- apply Dragan Sahpaski's patch with test that allows contributing
assistant instances to the DefautlRequestExceptionHandler


 Contributing ExceptionHandlerAssistant instances to RequestExceptionHandler 
 is broken
 -

 Key: TAP5-2267
 URL: https://issues.apache.org/jira/browse/TAP5-2267
 Project: Tapestry 5
  Issue Type: Bug
  Components: tapestry-core
Affects Versions: 5.4
Reporter: Dragan Sahpaski
Assignee: Kalle Korhonen
Priority: Minor
 Attachments: TAP5-2267.patch


 DefaultRequestExceptionHandler fails with ClassCastException when an instance 
 of ExceptionHandlerAssistant is contributed to RequestExceptionHandler.
 This had been broken accidentally in commit 
 cb3d4c853f47cccf9193c33cfd085d6ca27c8706 when implementing contributions of 
 assistant classes that are autobuilt.
 Although DefaultRequestExceptionHandlerTest covers contributions of 
 ExceptionHandlerAssistant instances, it didn't fail because of an oversight 
 in the test.  
 The patch resolves the bug (trivially) and improves existing tests in 
 DefaultRequestExceptionHandlerTest which now fail without patching 
 DefaultRequestExceptionHandler.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)