[ 
https://issues.apache.org/jira/browse/YARN-3400?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Kanter updated YARN-3400:
--------------------------------
    Attachment: YARN-3400.patch

Looks like JDK 8 doesn't like that we're throwing {{T extends Throwable}} here, 
because we're not declaring {{throws Throwable}}.  The patch fixes this by 
wrapping the calls to {{instantiateException}} with methods that return more 
specific subclasses of {{Throwable}} that are declared to be thrown.  This 
allows us not to have to declare additional thrown types.  And I couldn't 
replace {{Throwable}} with something more specific ({{Exception}} would 
probably work, but doesn't really get us anything) because {{YarnException}}, 
{{IOException}}, and {{RuntimeException}} don't have a more specific common 
parent.

> [JDK 8] Build Failure due to unreported exceptions in RPCUtil 
> --------------------------------------------------------------
>
>                 Key: YARN-3400
>                 URL: https://issues.apache.org/jira/browse/YARN-3400
>             Project: Hadoop YARN
>          Issue Type: Bug
>            Reporter: Robert Kanter
>            Assignee: Robert Kanter
>         Attachments: YARN-3400.patch
>
>
> When I try compiling Hadoop with JDK 8 like this
> {noformat}
> mvn clean package -Pdist -Dtar -DskipTests -Djavac.version=1.8
> {noformat}
> I get this error:
> {noformat}
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) 
> on project hadoop-yarn-common: Compilation failure: Compilation failure:
> [ERROR] 
> /Users/rkanter/dev/hadoop-common2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/RPCUtil.java:[101,11]
>  unreported exception java.lang.Throwable; must be caught or declared to be 
> thrown
> [ERROR] 
> /Users/rkanter/dev/hadoop-common2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/RPCUtil.java:[104,11]
>  unreported exception java.lang.Throwable; must be caught or declared to be 
> thrown
> [ERROR] 
> /Users/rkanter/dev/hadoop-common2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/RPCUtil.java:[107,11]
>  unreported exception java.lang.Throwable; must be caught or declared to be 
> thrown
> {noformat}



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

Reply via email to