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

Jakob Homan commented on HADOOP-5917:
-------------------------------------


As part of the recent cleanup, I fixed all of the warnings in the 
TestDataTransferProtcol (HADOOP-5822).  This has been applied to trunk.  To 
test if testpatch is working correctly, I re-introduced a minor javac warning, 
a redundant cast:
{code}
--- src/test/hdfs/org/apache/hadoop/hdfs/TestDataTransferProtocol.java
+++ src/test/hdfs/org/apache/hadoop/hdfs/TestDataTransferProtocol.java
@@ -194,7 +194,7 @@ public class TestDataTransferProtocol extends TestCase {
     sendBuf.reset();
     recvBuf.reset();
     sendOut.writeShort((short)DataTransferProtocol.DATA_TRANSFER_VERSION);
-    sendOut.writeByte(DataTransferProtocol.OP_WRITE_BLOCK);
+    sendOut.writeByte((byte)DataTransferProtocol.OP_WRITE_BLOCK);
     sendOut.writeLong(newBlockId);
     sendOut.writeLong(0);          // generation stamp
     sendOut.writeInt(0);           // targets in pipeline 
{code}
This indeed is flagged as a warning when running with the lint parameter:
{noformat}
    [javac] 
/Users/jhoman/work/git/hadoop/src/test/hdfs/org/apache/hadoop/hdfs/TestDataTransferProtocol.java:197:
 warning: [cast] redundant cast to byte
    [javac]     sendOut.writeByte((byte)DataTransferProtocol.OP_WRITE_BLOCK);
{noformat}

However, testpatch gives this patch a clean bill of health:
{noformat}
     [exec] +1 overall.  
     [exec] 
     [exec]     +1 @author.  The patch does not contain any @author tags.
     [exec] 
     [exec]     +1 tests included.  The patch appears to include 3 new or 
modified tests.
     [exec] 
     [exec]     +1 javadoc.  The javadoc tool did not generate any warning 
messages.
     [exec] 
     [exec]     +1 javac.  The applied patch does not increase the total number 
of javac compiler warnings.
     [exec] 
     [exec]     +1 findbugs.  The patch does not introduce any new Findbugs 
warnings.
     [exec] 
     [exec]     +1 Eclipse classpath. The patch retains Eclipse classpath 
integrity.
     [exec] 
     [exec]     +1 release audit.  The applied patch does not increase the 
total number of release audit warnings.
{noformat}
Perhaps the section of test-patch that calculates the difference in warnings 
got silently broken?  Fixing this will hopefully prevent another round of 
spring cleaning next year.

> Testpatch isn't catching newly introduced javac warnings
> --------------------------------------------------------
>
>                 Key: HADOOP-5917
>                 URL: https://issues.apache.org/jira/browse/HADOOP-5917
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: test
>            Reporter: Jakob Homan
>
> Testpatch doesn't seem to be catching newly introduced javac warnings, as 
> detailed in the results of the experiment below.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to