From c8d04cf12773e809a14183a4e2919e426d63b168 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 Signed-off-by: Sean Busbey --- dev-support/hbase-personality.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dev-support/hbase-personality.sh b/dev-support/hbase-personality.sh index 8dd24be260a..90d1f77dda2 100755 --- a/dev-support/hbase-personality.sh +++ b/dev-support/hbase-personality.sh @@ -706,6 +706,24 @@ function hbaseanti_patchfile return 0 } +## @description process the javac output for generating WARNING/ERROR +## @audience private +## @stability evolving +## @param input filename +## @param output filename +# 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