pivot-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roger Whitcomb (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PIVOT-1012) Many places throw IllegalArgumentException during parameter validation, but some are inconsistent
Date Fri, 22 Dec 2017 22:35:00 GMT

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

Roger Whitcomb commented on PIVOT-1012:
---------------------------------------

Many changes to use "Utils" methods for mostly null parameter checks. And many, many changes
to use "forEach" in the ListenerList subclasses for PIVOT-999:
Sending        wtk\src\org\apache\pivot\wtk\CalendarButton.java
Sending        wtk\src\org\apache\pivot\wtk\Clipboard.java
Sending        wtk\src\org\apache\pivot\wtk\ColorChooserButton.java
Sending        wtk\src\org\apache\pivot\wtk\Component.java
Sending        wtk\src\org\apache\pivot\wtk\Container.java
Sending        wtk\src\org\apache\pivot\wtk\DesktopApplicationContext.java
Sending        wtk\src\org\apache\pivot\wtk\Dialog.java
Sending        wtk\src\org\apache\pivot\wtk\FileBrowser.java
Sending        wtk\src\org\apache\pivot\wtk\FileBrowserSheet.java
Sending        wtk\src\org\apache\pivot\wtk\FillPane.java
Sending        wtk\src\org\apache\pivot\wtk\Form.java
Sending        wtk\src\org\apache\pivot\wtk\GridPane.java
Sending        wtk\src\org\apache\pivot\wtk\Label.java
Sending        wtk\src\org\apache\pivot\wtk\ListButton.java
Sending        wtk\src\org\apache\pivot\wtk\ListView.java
Sending        wtk\src\org\apache\pivot\wtk\LocalManifest.java
Sending        wtk\src\org\apache\pivot\wtk\MenuButton.java
Sending        wtk\src\org\apache\pivot\wtk\Meter.java
Sending        wtk\src\org\apache\pivot\wtk\Mouse.java
Sending        wtk\src\org\apache\pivot\wtk\Prompt.java
Sending        wtk\src\org\apache\pivot\wtk\RadioButtonGroup.java
Sending        wtk\src\org\apache\pivot\wtk\ScrollBar.java
Sending        wtk\src\org\apache\pivot\wtk\Sheet.java
Sending        wtk\src\org\apache\pivot\wtk\Slider.java
Sending        wtk\src\org\apache\pivot\wtk\Span.java
Sending        wtk\src\org\apache\pivot\wtk\Spinner.java
Sending        wtk\src\org\apache\pivot\wtk\SplitPane.java
Sending        wtk\src\org\apache\pivot\wtk\TablePane.java
Sending        wtk\src\org\apache\pivot\wtk\TableView.java
Sending        wtk\src\org\apache\pivot\wtk\TableViewHeader.java
Sending        wtk\src\org\apache\pivot\wtk\TextArea.java
Sending        wtk\src\org\apache\pivot\wtk\TextInput.java
Sending        wtk\src\org\apache\pivot\wtk\TextPane.java
Sending        wtk\src\org\apache\pivot\wtk\TreeView.java
Sending        wtk\src\org\apache\pivot\wtk\Viewport.java
Transmitting file data ...................................done
Committing transaction...
Committed revision 1819096.


> 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)

Mime
View raw message