You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-issues@hadoop.apache.org by "Robert Kanter (JIRA)" <ji...@apache.org> on 2016/04/13 02:32:25 UTC

[jira] [Commented] (YARN-4366) Fix Lint Warnings in YARN Common

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

Robert Kanter commented on YARN-4366:
-------------------------------------

We should verify that this doesn't break anything.  As explained in [this StackOverflow|http://stackoverflow.com/questions/5401537/i-have-got-this-warning-non-varargs-call-of-varargs-method-with-inexact-argumen], there's a difference between something like {{cls.getMethod(action, null);}} and something like {{cls.getMethod(action);}}.  The latter constructs an empty array while the former is ambiguous if it passes a single {{null}} instance or an array with a single {{null}} element (hence the warning).

Unfortunately, besides being reflection, the code is very generic, so it's not straightforward to track down what it's being called on and what those expect here.

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