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

Kengo Seki commented on YETUS-187:
----------------------------------

I played around with 05, and it seems to work well. Example:

{code}
[sekikn@localhost yetus]$ cat /tmp/hadoop.patch 
diff --git 
a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/IOUtils.java
 
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/IOUtils.java
index e6c00c9..6ea5c5a 100644
--- 
a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/IOUtils.java
+++ 
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/IOUtils.java
@@ -37,6 +37,7 @@
 import org.apache.hadoop.classification.InterfaceStability;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.util.ChunkedArrayList;
+import sun.misc.Unsafe;
 
 /**
  * An utility class for I/O related functionality. 
@@ -349,4 +350,13 @@ public static void writeFully(FileChannel fc, ByteBuffer 
buf,
     }
     return list;
   }
+
+  /**
+   * foo
+   *
+   * @bar
+   */
+  public static void Baz(UTF8 qux) {
+    // Loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong 
line
+  }
 }
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/fs/Hdfs.java 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/fs/Hdfs.java
index 6dd8884..7327f09 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/fs/Hdfs.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/fs/Hdfs.java
@@ -56,6 +56,7 @@
 import org.apache.hadoop.security.token.Token;
 import 
org.apache.hadoop.security.token.delegation.AbstractDelegationTokenIdentifier;
 import org.apache.hadoop.util.Progressable;
+import sun.misc.Unsafe;
 
 @InterfaceAudience.Private
 @InterfaceStability.Evolving
@@ -532,4 +533,9 @@ public void deleteSnapshot(final Path snapshotDir, final 
String snapshotName)
       throws IOException {
     dfs.deleteSnapshot(getUriPath(snapshotDir), snapshotName);
   }
+
+  /**
+   *
+   */
+  public void foo () { }
 }

[sekikn@localhost yetus]$ precommit/test-patch.sh --basedir=../hadoop 
--project=hadoop --resetrepo /tmp/hadoop.patch 

| Vote |      Subsystem |  Runtime   | Comment
============================================================================
|  -1  |         javac  |  12m 56s   | root generated 3 new issues (was 728, 
|      |                |            | now 731).
|  -1  |    checkstyle  |  0m 53s    | Patch generated 8 new checkstyle issues 
|      |                |            | in root (total was 33, now 41).
|  -1  |       javadoc  |  4m 43s    | hadoop-common-project_hadoop-common 
|      |                |            | generated 2 new issues (was 13, now 15).
|  -1  |       javadoc  |  4m 43s    | hadoop-hdfs-project_hadoop-hdfs 
|      |                |            | generated 1 new issues (was 7, now 8).

|| Subsystem || Report/Notes ||
============================================================================
| javac | root: /tmp/yetus-1908.22184/diff-compile-javac-root.txt |
| checkstyle | /tmp/yetus-1908.22184/diff-checkstyle-root.txt |
| javadoc | hadoop-common-project_hadoop-common: 
/tmp/yetus-1908.22184/diff-javadoc-javadoc-hadoop-common-project_hadoop-common.txt
 |
| javadoc | hadoop-hdfs-project_hadoop-hdfs: 
/tmp/yetus-1908.22184/diff-javadoc-javadoc-hadoop-hdfs-project_hadoop-hdfs.txt |

[sekikn@localhost yetus]$ cat /tmp/yetus-1908.22184/diff-compile-javac-root.txt
[WARNING] 
/home/sekikn/hadoop/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/IOUtils.java:[40,15]
 Unsafe is internal proprietary API and may be removed in a future release
[WARNING] 
/home/sekikn/hadoop/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/IOUtils.java:[359,25]
 [deprecation] UTF8 in org.apache.hadoop.io has been deprecated
[WARNING] 
/home/sekikn/hadoop/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/fs/Hdfs.java:[59,15]
 Unsafe is internal proprietary API and may be removed in a future release

[sekikn@localhost yetus]$ cat /tmp/yetus-1908.22184/diff-checkstyle-root.txt
./hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/IOUtils.java:40:import
 sun.misc.Unsafe;:1: Import from illegal package - sun.misc.Unsafe.
./hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/IOUtils.java:40:import
 sun.misc.Unsafe;:8: Unused import - sun.misc.Unsafe.
./hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/IOUtils.java:354:
  /**: First sentence should end with a period.
./hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/IOUtils.java:359:
  public static void Baz(UTF8 qux) {:22: Name 'Baz' must match pattern 
'^[a-z][a-zA-Z0-9]*$'.
./hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/IOUtils.java:360:
    // Loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong 
line: Line is longer than 80 characters (found 81).
./hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/fs/Hdfs.java:59:import
 sun.misc.Unsafe;:1: Import from illegal package - sun.misc.Unsafe.
./hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/fs/Hdfs.java:59:import
 sun.misc.Unsafe;:8: Unused import - sun.misc.Unsafe.
./hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/fs/Hdfs.java:540:
  public void foo () { }:19: '(' is preceded with whitespace.

[sekikn@localhost yetus]$ cat 
/tmp/yetus-1908.22184/diff-javadoc-javadoc-hadoop-common-project_hadoop-common.txt
[WARNING] 
/home/sekikn/hadoop/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/IOUtils.java:40:
 warning: Unsafe is internal proprietary API and may be removed in a future 
release
[WARNING] 
/home/sekikn/hadoop/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/IOUtils.java:359:
 warning - @bar is an unknown tag.

[sekikn@localhost yetus]$ cat 
/tmp/yetus-1908.22184/diff-javadoc-javadoc-hadoop-hdfs-project_hadoop-hdfs.txt
[WARNING] 
/home/sekikn/hadoop/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/fs/Hdfs.java:59:
 warning: Unsafe is internal proprietary API and may be removed in a future 
release

{code}

I did the same check for all modified plugins using pig and found no problem. 
So I'm +1.
If there is no additional comment, I'll commit this in about 24 hours.

> maven javac/javadoc can't use calcdiffs
> ---------------------------------------
>
>                 Key: YETUS-187
>                 URL: https://issues.apache.org/jira/browse/YETUS-187
>             Project: Yetus
>          Issue Type: Bug
>          Components: Test Patch
>    Affects Versions: 0.1.0
>            Reporter: Allen Wittenauer
>            Assignee: Allen Wittenauer
>            Priority: Blocker
>         Attachments: YETUS-187.00.patch, YETUS-187.01.patch, 
> YETUS-187.02.patch, YETUS-187.03.patch, YETUS-187.04.patch, YETUS-187.05.patch
>
>
> calcdiffs works by doing the following:
> * given two files (A, B)
> * from (A,B), pull everything from the last colon(\:) out and into (C,D). 
> This gives us a list of all errors in order without line numbers, columns, or 
> filenames in the way.
> * do a diff of C and D, printing the numbers of the lines that are different 
> from D
> * using the line numbers, pull out the lines from B, restoring the filenames, 
> lines, and columns
> End result will be, the vast majority of the time (but not 100%), the new 
> errors generated by B. The places where this doesn't work is when the 
> surrounding context isn't different enough. e.g., multiple messages with the 
> same text.  There obviously could be some improvement in accuracy here, but 
> experience has shown this works well enough the majority of the time.
> For maven (and maybe other tools?), though, the place where this falls down 
> is the line format:
> {code}
> [WARNING] Endpoint.java:[162,25] [unchecked] Possible heap pollution from 
> parameterized vararg type Map<String,String>
> {code} 
> In this situation, we end up doing the diff with the line numbers and columns 
> in place which means we're very likely to print any pre-existing errors too.



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

Reply via email to