You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-issues@hadoop.apache.org by "Daniel Templeton (JIRA)" <ji...@apache.org> on 2017/01/03 19:36:58 UTC

[jira] [Commented] (MAPREDUCE-6715) Fix Bad Practices

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

Daniel Templeton commented on MAPREDUCE-6715:
---------------------------------------------

Thanks for the updates.  Just noticed a couple other things:

* {{lastException.getMessage()}} is often empty, so {{lastException.toString()}} is better
* {{ReflectionUtils.newInstance()}} cannot return null, so the added null check is pointless
* {{"Error in last collector was :"}} should be {{"Error in last collector was: "}}
* {code}      String line = in.readLine();
      while (line != null) {
        result.add(line);
        line = in.readLine();
      }{code} can be simplified to: {code}      String line;
      while ((line = in.readLine()) != null) {
        result.add(line);
      }{code}  Your call if that's actually simpler

> Fix Bad Practices
> -----------------
>
>                 Key: MAPREDUCE-6715
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-6715
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>    Affects Versions: 2.9.0
>            Reporter: Yufei Gu
>            Assignee: Yufei Gu
>         Attachments: MAPREDUCE-6715.001.patch, MAPREDUCE-6715.002.patch, MAPREDUCE-6715.003.patch
>
>
> {code}
> Null Dereference        CleanupQueue.java:139
> Weak SecurityManager Check: Overridable Method  LocalDistributedCacheManager.java:229
> Null Dereference        TextOutputFormat.java:137
> Null Dereference        ShuffleSchedulerImpl.java:422
> Null Dereference        MapTask.java:415
> Null Dereference        Pentomino.java:160
> Unreleased Resource: Streams    TeraScheduler.java:77
> Unreleased Resource: Streams    CLI.java:570
> Null Dereference        CLI.java:370
> {code}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: mapreduce-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: mapreduce-issues-help@hadoop.apache.org