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

Manjunath Ballur commented on OOZIE-1173:
-----------------------------------------

There are many instances of parameter checking, where we can use 
ParamChecker::notNull():

client/src/main/java/org/apache/oozie/client/OozieClient.java:            throw 
new IllegalArgumentException("reader cannot be null");
client/src/main/java/org/apache/oozie/client/OozieClient.java:            throw 
new IllegalArgumentException("reader cannot be null");
client/src/main/java/org/apache/oozie/client/OozieClient.java:            throw 
new IllegalArgumentException(name + " cannot be null");
client/src/main/java/org/apache/oozie/client/OozieClient.java:            throw 
new IllegalArgumentException(name + " cannot be null");
client/src/main/java/org/apache/oozie/client/XOozieClient.java:           throw 
new IllegalArgumentException("conf cannot be null");
client/src/main/java/org/apache/oozie/client/XOozieClient.java:           throw 
new IllegalArgumentException("scriptFile cannot be null");
client/src/main/java/org/apache/oozie/client/XOozieClient.java:           throw 
new IllegalArgumentException("conf cannot be null");
client/src/main/java/org/apache/oozie/client/XOozieClient.java:           throw 
new IllegalArgumentException("command cannot be null");
client/src/main/java/org/apache/oozie/client/XOozieClient.java:           throw 
new IllegalArgumentException("conf cannot be null");
client/src/main/java/org/apache/oozie/client/XOozieClient.java:           throw 
new IllegalArgumentException("file cannot be null or empty");
client/src/main/java/org/apache/oozie/client/XOozieClient.java:           throw 
new IllegalArgumentException("file cannot be null or empty");
core/src/main/java/org/apache/oozie/action/decision/DecisionActionExecutor.java:
 throw new IllegalStateException("Transition cannot be NULL");
core/src/main/java/org/apache/oozie/util/JobUtils.java:                         
                 throw new IllegalArgumentException("user cannot be null");
core/src/main/java/org/apache/oozie/util/PriorityDelayQueue.java:               
 throw new IllegalArgumentException("element cannot be null");

Also, since OozieClient.java and XOozieClient.java are part of "oozie-client" 
package, we will need to introduce the maven dependency of "oozie-core" in  
"oozie-client"

> Refactor: use ParamChecker inXOozieClient
> -----------------------------------------
>
>                 Key: OOZIE-1173
>                 URL: https://issues.apache.org/jira/browse/OOZIE-1173
>             Project: Oozie
>          Issue Type: Task
>          Components: client
>    Affects Versions: trunk
>            Reporter: jun aoki
>            Priority: Trivial
>              Labels: newbie
>             Fix For: trunk
>
>
> In 
> [XOozieClient.java|http://svn.apache.org/viewvc/oozie/trunk/client/src/main/java/org/apache/oozie/client/XOozieClient.java?revision=1401367&view=markup],
>  you can find a piece of code like this and should be replaced with 
> ParamChecker.
> {code}
>  if (conf == null) {
>             throw new IllegalArgumentException("conf cannot be null");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to