You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by te...@apache.org on 2013/11/07 21:58:09 UTC

svn commit: r1539812 - /hbase/trunk/dev-support/test-patch.sh

Author: tedyu
Date: Thu Nov  7 20:58:09 2013
New Revision: 1539812

URL: http://svn.apache.org/r1539812
Log:
HBASE-9295 Allow test-patch.sh to detect TreeMap keyed by byte[] which doesn't use proper comparator


Modified:
    hbase/trunk/dev-support/test-patch.sh

Modified: hbase/trunk/dev-support/test-patch.sh
URL: http://svn.apache.org/viewvc/hbase/trunk/dev-support/test-patch.sh?rev=1539812&r1=1539811&r2=1539812&view=diff
==============================================================================
--- hbase/trunk/dev-support/test-patch.sh (original)
+++ hbase/trunk/dev-support/test-patch.sh Thu Nov  7 20:58:09 2013
@@ -406,6 +406,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
 checkJavadocWarnings () {
   echo ""
@@ -868,6 +891,8 @@ if [[ $? != 0 ]] ; then
   cleanupAndExit 1
 fi
 
+checkAntiPatterns
+(( RESULT = RESULT + $? ))
 checkHadoop10Compile
 (( RESULT = RESULT + $? ))
 checkHadoop20Compile