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

Daniel Templeton commented on YARN-4366:
----------------------------------------

It's ambiguous, but not nondeterministic.  If you pass {{null}} as a vararg 
parameter, you will receive a null array in the method.  For the 
{{getMethod()}} method, the explicitly stated behavior is that if you pass null 
for the vararg parameter, it's the same as passing an empty array.  If you need 
further proof of the safeness of this change, consider for a second what it 
would mean to call {{getMethod()}} with a type array that contains a single 
null (the other possible interpretation of the existing code).  It won't match 
anything, because there is no such thing as a null-typed parameter.  (It 
doesn't even match a {{Void}} parameter.)  The obviously intended behavior was 
to pass an empty array.

> Fix Lint Warnings in YARN Common
> --------------------------------
>
>                 Key: YARN-4366
>                 URL: https://issues.apache.org/jira/browse/YARN-4366
>             Project: Hadoop YARN
>          Issue Type: Bug
>          Components: yarn
>    Affects Versions: 2.7.1
>            Reporter: Daniel Templeton
>            Assignee: Daniel Templeton
>         Attachments: YARN-4366.001.patch
>
>
> {noformat}
> [WARNING] 
> /Users/daniel/NetBeansProjects/hadoop/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/Router.java:[100,45]
>  non-varargs call of varargs method with inexact argument type for last 
> parameter;
>   cast to java.lang.Class<?> for a varargs call
>   cast to java.lang.Class<?>[] for a non-varargs call and to suppress this 
> warning
> [WARNING] 
> /Users/daniel/NetBeansProjects/hadoop/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/factory/providers/RpcFactoryProvider.java:[62,46]
>  non-varargs call of varargs method with inexact argument type for last 
> parameter;
>   cast to java.lang.Class<?> for a varargs call
>   cast to java.lang.Class<?>[] for a non-varargs call and to suppress this 
> warning
> [WARNING] 
> /Users/daniel/NetBeansProjects/hadoop/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/factory/providers/RpcFactoryProvider.java:[64,34]
>  non-varargs call of varargs method with inexact argument type for last 
> parameter;
>   cast to java.lang.Object for a varargs call
>   cast to java.lang.Object[] for a non-varargs call and to suppress this 
> warning
> {noformat}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org

Reply via email to