HBASE-9295 Allow test-patch.sh to detect TreeMap keyed by byte[] which doesn't use proper comparator

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1539812 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2013-11-07 20:58:09 +00:00
parent 3c55ae85c4
commit d6ab53ce19
1 changed files with 25 additions and 0 deletions

View File

@ -405,6 +405,29 @@ checkHadoop10Compile () {
} }
###############################################################################
### Check against known anti-patterns
checkAntiPatterns () {
echo ""
echo ""
echo "======================================================================"
echo "======================================================================"
echo " Checking against known anti-patterns."
echo "======================================================================"
echo "======================================================================"
echo ""
echo ""
warnings=`$GREP 'new TreeMap<byte.*()' $PATCH_DIR/patch`
if [[ $warnings != "" ]]; then
JIRA_COMMENT="$JIRA_COMMENT
{color:red}-1 Anti-pattern{color}. The patch appears to have anti-pattern where BYTES_COMPARATOR was omitted:
$warnings."
return 1
fi
return 0
}
############################################################################### ###############################################################################
### Check there are no javadoc warnings ### Check there are no javadoc warnings
checkJavadocWarnings () { checkJavadocWarnings () {
@ -868,6 +891,8 @@ if [[ $? != 0 ]] ; then
cleanupAndExit 1 cleanupAndExit 1
fi fi
checkAntiPatterns
(( RESULT = RESULT + $? ))
checkHadoop10Compile checkHadoop10Compile
(( RESULT = RESULT + $? )) (( RESULT = RESULT + $? ))
checkHadoop20Compile checkHadoop20Compile