You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Roger Whitcomb (JIRA)" <ji...@apache.org> on 2018/01/05 17:45:00 UTC

[jira] [Comment Edited] (PIVOT-1012) Many places throw IllegalArgumentException during parameter validation, but some are inconsistent

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

Roger Whitcomb edited comment on PIVOT-1012 at 1/5/18 5:44 PM:
---------------------------------------------------------------

Sending        wtk\src\org\apache\pivot\wtk\content\CalendarDateSpinnerData.java
Sending        wtk\src\org\apache\pivot\wtk\content\TableViewDateCellRenderer.java
Transmitting file data ..done
Committing transaction...
Committed revision 1820334.

Sending        wtk\src\org\apache\pivot\wtk\content\TreeBranch.java
Sending        wtk\src\org\apache\pivot\wtk\effects\TagDecorator.java
Transmitting file data ..done
Committing transaction...
Committed revision 1820335.



was (Author: rwhitcomb):
Sending        wtk\src\org\apache\pivot\wtk\content\CalendarDateSpinnerData.java
Sending        wtk\src\org\apache\pivot\wtk\content\TableViewDateCellRenderer.java
Transmitting file data ..done
Committing transaction...
Committed revision 1820334.

> Many places throw IllegalArgumentException during parameter validation, but some are inconsistent
> -------------------------------------------------------------------------------------------------
>
>                 Key: PIVOT-1012
>                 URL: https://issues.apache.org/jira/browse/PIVOT-1012
>             Project: Pivot
>          Issue Type: Improvement
>          Components: core, wtk, wtk-terra
>         Environment: All
>            Reporter: Roger Whitcomb
>            Assignee: Roger Whitcomb
>            Priority: Minor
>             Fix For: 2.1
>
>
> Primarily the code looks like this currently:
> {code:java}
> if (param == null)
> throw new IllegalArgumentException(param + " is null");
> {code}
> But not all places have the message in the exception, and not all places check the parameters as they should, and not all places have the same message.
> So, regularize this checking everywhere by making common "core" methods to do this null check (or other checks, such as <= 0, etc.) so that the checking and messaging are common.  This also simplifies the code, and with JIT compiling shouldn't affect runtime speed either, as this common method should get compiled and/or inlined as appropriate.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)