You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Mathieu Lirzin (JIRA)" <ji...@apache.org> on 2019/04/21 13:37:00 UTC

[jira] [Commented] (OFBIZ-10091) Unnecessary throws clauses in renderer classes?

    [ https://issues.apache.org/jira/browse/OFBIZ-10091?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16822695#comment-16822695 ] 

Mathieu Lirzin commented on OFBIZ-10091:
----------------------------------------

I don't think you overlook anything.

I think it is important to only declare exceptions that are actually thrown even in the case where a method is implementing an interface which declares some exceptions to force the consumer of that interface to handle it.

Are you still interested in working on that?

> Unnecessary throws clauses in renderer classes?
> -----------------------------------------------
>
>                 Key: OFBIZ-10091
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-10091
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: Trunk
>            Reporter: Michael Brohl
>            Priority: Minor
>
> During the refactoring work I found that there are several classes in org.apache.ofbiz.widget.renderer.macro which state in their method declarations that they throw TemplateException and/or IOException.
> In many cases, there is either no evidence of these Exceptions or they are catched inside the methods.
> One example is the MacroFormRenderer constructor which says it throws TemplateException but does not.
> The method declarations in the interfaces of org.apache.ofbiz.widget.renderer all say that IOException is thrown.
> It might be that I overlook something and I did not dig much deeper into the code so I first want to ask what the reasons are or if it would not be reasonable to make a difference in interfaces and implementations and only declare that a method throws a specific exception if it really does?
> Thanks for your help,
> regards,
> Michael



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)