You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2019/04/19 17:28:00 UTC
[jira] [Work logged] (CAMEL-13437) ThrowExceptionProcessor should
use 'getConstructor' instead of 'getDeclaredConstructor', so it doesn't
force users to implement the constructors of their exception classes.
[ https://issues.apache.org/jira/browse/CAMEL-13437?focusedWorklogId=230199&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-230199 ]
ASF GitHub Bot logged work on CAMEL-13437:
------------------------------------------
Author: ASF GitHub Bot
Created on: 19/Apr/19 17:27
Start Date: 19/Apr/19 17:27
Worklog Time Spent: 10m
Work Description: DuncanDoyle commented on pull request #2876: Fixes CAMEL-13437: now also looking for constructor in superclasses.
URL: https://github.com/apache/camel/pull/2876
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Issue Time Tracking
-------------------
Worklog Id: (was: 230199)
Time Spent: 10m
Remaining Estimate: 0h
> ThrowExceptionProcessor should use 'getConstructor' instead of 'getDeclaredConstructor', so it doesn't force users to implement the constructors of their exception classes.
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-13437
> URL: https://issues.apache.org/jira/browse/CAMEL-13437
> Project: Camel
> Issue Type: Bug
> Components: camel-core
> Affects Versions: 2.23.2
> Reporter: Duncan Doyle
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> ThrowExceptionProcessor uses this line of code to retrieve the constructor of an Exception class:
> {code:java}
> Constructor<?> constructor = type.getDeclaredConstructor(String.class);{code}
> The problem is that this will only find constructors defined in the actual class itself, not in its superclasses. This forces users to unnecessarily implement a constructor that excepts a {{String}} in their custom exception classes.
> Easy fix, use the following method:
> {code:java}
> Constructor<?> constructor = type.getConstructor(String.class);{code}
> Will fix and create a PR.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)