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

Allen Wittenauer commented on HADOOP-12188:
-------------------------------------------

Great catch!  

A nit though:

{code}
 ${GREP} '\[WARNING\]' "${warningfile}" | ${AWK} '{sum+=1} END {print sum}'
{code}

If $warningfile doesn't exist (e.g., maven module was removed in the patch), 
this will throw an error and won't return 0.  That's why this code was placed 
where it was:

{code}
-      # if it was a new module, this won't exist.
-      if [[ -f "${PATCH_DIR}/branch-javac-${fn}.txt" ]]; then
-        ${GREP} '\[WARNING\]' "${PATCH_DIR}/branch-javac-${fn}.txt" \
-          > "${PATCH_DIR}/branch-javac-${fn}-warning.txt"
-      else
-        touch "${PATCH_DIR}/branch-javac-${fn}.txt" \
-          "${PATCH_DIR}/branch-javac-${fn}-warning.txt"
-      fi
{code}

Doing it after the count is too late.

This is also clearly a bug in the (pre-existing) javadoc check. :( So we should 
fix that while we're here.

> javac warning file is always empty on ant-based projects
> --------------------------------------------------------
>
>                 Key: HADOOP-12188
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12188
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: yetus
>            Reporter: Kengo Seki
>            Assignee: Kengo Seki
>         Attachments: HADOOP-12188.HADOOP-12111.01.patch
>
>
> (branch|patch)-javac-root-warning.txt is always empty though there are some 
> warnings on ant-based projects, because check_patch_javac filters warning 
> messages as follows:
> {code}
>       if [[ -f "${PATCH_DIR}/branch-javac-${fn}.txt" ]]; then                 
>                                                                 
>         ${GREP} '\[WARNING\]' "${PATCH_DIR}/branch-javac-${fn}.txt" \         
>                                                                 
>           > "${PATCH_DIR}/branch-javac-${fn}-warning.txt"                     
>                                                                 
>       else                                                                    
>                                                                 
>         touch "${PATCH_DIR}/branch-javac-${fn}.txt" \                         
>                                                                 
>           "${PATCH_DIR}/branch-javac-${fn}-warning.txt"                       
>                                                                 
>       fi                                                                      
>                                                                 
>                                                                               
>                                                                 
>       ${GREP} '\[WARNING\]' "${PATCH_DIR}/patch-javac-${fn}.txt" \            
>                                                                 
>         > "${PATCH_DIR}/patch-javac-${fn}-warning.txt"                        
>                                                                 
> {code}
> But ant's warning output format is as follows:
> {code}
> [javac] 
> /home/sekikn/pig/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/JobControlCompiler.java:64:
>  warning: [deprecation] ComparisonFunc in org.apache.pig has been deprecated
> {code}



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

Reply via email to