From 017e1ebe92edaeca6016571409fd9a3530713853 Mon Sep 17 00:00:00 2001 From: zhangduo Date: Wed, 27 Mar 2019 17:03:02 +0800 Subject: [PATCH] HBASE-22100 False positive for error prone warnings in pre commit job --- dev-support/hbase-personality.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dev-support/hbase-personality.sh b/dev-support/hbase-personality.sh index 8dd24be260..39bc34fa39 100755 --- a/dev-support/hbase-personality.sh +++ b/dev-support/hbase-personality.sh @@ -706,6 +706,19 @@ function hbaseanti_patchfile return 0 } +# Override the default javac_logfilter so that we can do a sort before outputing the WARNING/ERROR. +# This is because that the output order of the error prone warnings is not stable, so the diff +# method will report unexpected errors if we do not sort it. Notice that a simple sort will cause +# line number being sorted by lexicographical so the output maybe a bit strange to human but it is +# really hard to sort by file name first and then line number and column number in shell... +function hbase_javac_logfilter +{ + declare input=$1 + declare output=$2 + + ${GREP} -E '\[(ERROR|WARNING)\] /.*\.java:' "${input}" | sort > "${output}" +} + ## This is named so that yetus will check us right after running tests. ## Essentially, we check for normal failures and then we look for zombies. #function hbase_unit_logfilter -- 2.17.1