@@ -40,7 +40,7 @@ DIFF=${DIFF:-diff}
4040JIRACLI=${JIRA:- jira}
4141SED=${SED:- sed}
4242CURL=${CURL:- curl}
43- FINDBUGS_HOME =${FINDBUGS_HOME }
43+ SPOTBUGS_HOME =${SPOTBUGS_HOME }
4444
4545# ##############################################################################
4646printUsage () {
@@ -60,7 +60,7 @@ printUsage() {
6060 echo " --grep-cmd=<cmd> The 'grep' command to use (default 'grep')"
6161 echo " --patch-cmd=<cmd> The 'patch' command to use (default 'patch')"
6262 echo " --diff-cmd=<cmd> The 'diff' command to use (default 'diff')"
63- echo " --findbugs -home=<path> Findbugs home directory (default FINDBUGS_HOME environment variable)"
63+ echo " --spotbugs -home=<path> Spotbugs home directory (default SPOTBUGS_HOME environment variable)"
6464 echo " --dirty-workspace Allow the local git workspace to have uncommitted changes"
6565 echo " --run-tests Run all tests below the base directory"
6666 echo
@@ -115,8 +115,8 @@ parseArgs() {
115115 --jira-password=* )
116116 JIRA_PASSWD=${i#* =}
117117 ;;
118- --findbugs -home=* )
119- FINDBUGS_HOME =${i#* =}
118+ --spotbugs -home=* )
119+ SPOTBUGS_HOME =${i#* =}
120120 ;;
121121 --dirty-workspace)
122122 DIRTY_WORKSPACE=true
@@ -507,7 +507,7 @@ $JIRA_COMMENT_FOOTER"
507507
508508
509509# ##############################################################################
510- # ## Install the new jars so tests and findbugs can find all of the updated jars
510+ # ## Install the new jars so tests and spotbugs can find all of the updated jars
511511buildAndInstall () {
512512 echo " "
513513 echo " "
@@ -525,67 +525,67 @@ buildAndInstall () {
525525
526526
527527# ##############################################################################
528- # ## Check there are no changes in the number of Findbugs warnings
529- checkFindbugsWarnings () {
528+ # ## Check there are no changes in the number of Spotbugs warnings
529+ checkSpotbugsWarnings () {
530530 echo " "
531531 echo " "
532532 echo " ======================================================================"
533533 echo " ======================================================================"
534- echo " Determining number of patched Findbugs warnings."
534+ echo " Determining number of patched Spotbugs warnings."
535535 echo " ======================================================================"
536536 echo " ======================================================================"
537537 echo " "
538538 echo " "
539539
540540 rc=0
541- echo " Running findbugs "
542- echo " $MVN clean test findbugs:findbugs -DskipTests < /dev/null > $PATCH_DIR /patchFindBugsOutput .txt 2>&1"
543- $MVN clean test findbugs:findbugs -DskipTests < /dev/null > $PATCH_DIR /patchFindBugsOutput .txt 2>&1
541+ echo " Running spotbugs "
542+ echo " $MVN clean test spotbugs:spotbugs -DskipTests < /dev/null > $PATCH_DIR /patchSpotBugsOutput .txt 2>&1"
543+ $MVN clean test spotbugs:spotbugs -DskipTests < /dev/null > $PATCH_DIR /patchSpotBugsOutput .txt 2>&1
544544 rc=$?
545- findbugs_version =$( ${AWK} ' match($0, /findbugs -maven-plugin:[^:]*:findbugs /) { print substr($0, RSTART + 22, RLENGTH - 31); exit }' " ${PATCH_DIR} /patchFindBugsOutput .txt" )
545+ spotbugs_version =$( ${AWK} ' match($0, /spotbugs -maven-plugin:[^:]*:spotbugs /) { print substr($0, RSTART + 22, RLENGTH - 31); exit }' " ${PATCH_DIR} /patchSpotBugsOutput .txt" )
546546
547547 if [ $rc != 0 ] ; then
548548 JIRA_COMMENT=" $JIRA_COMMENT
549549
550- {color:red}-1 findbugs {color}. The patch appears to cause Findbugs (version ${findbugs_version } ) to fail."
550+ {color:red}-1 spotbugs {color}. The patch appears to cause Spotbugs (version ${spotbugs_version } ) to fail."
551551 return 1
552552 fi
553553
554- findbugsWarnings =0
555- for file in $( find $BASEDIR -name findbugsXml .xml)
554+ spotbugsWarnings =0
555+ for file in $( find $BASEDIR -name spotbugsXml .xml)
556556 do
557557 relative_file=${file# $BASEDIR / } # strip leading $BASEDIR prefix
558- if [ ! $relative_file == " target/findbugsXml .xml" ]; then
559- module_suffix=${relative_file%/ target/ findbugsXml .xml} # strip trailing path
558+ if [ ! $relative_file == " target/spotbugsXml .xml" ]; then
559+ module_suffix=${relative_file%/ target/ spotbugsXml .xml} # strip trailing path
560560 module_suffix=` basename ${module_suffix} `
561561 fi
562562
563- cp $file $PATCH_DIR /patchFindbugsWarnings ${module_suffix} .xml
564- $FINDBUGS_HOME /bin/setBugDatabaseInfo -timestamp " 01/01/2000" \
565- $PATCH_DIR /patchFindbugsWarnings ${module_suffix} .xml \
566- $PATCH_DIR /patchFindbugsWarnings ${module_suffix} .xml
567- newFindbugsWarnings =` $FINDBUGS_HOME /bin/filterBugs -first " 01/01/2000" $PATCH_DIR /patchFindbugsWarnings ${module_suffix} .xml \
568- $PATCH_DIR /newPatchFindbugsWarnings ${module_suffix} .xml | $AWK ' {print $1}' `
569- echo " Found $newFindbugsWarnings Findbugs warnings ($file )"
570- findbugsWarnings =$(( findbugsWarnings + newFindbugsWarnings ))
571- $FINDBUGS_HOME /bin/convertXmlToText -html \
572- $PATCH_DIR /newPatchFindbugsWarnings ${module_suffix} .xml \
573- $PATCH_DIR /newPatchFindbugsWarnings ${module_suffix} .html
574- if [[ $newFindbugsWarnings > 0 ]] ; then
575- JIRA_COMMENT_FOOTER=" Findbugs warnings: $BUILD_URL /artifact/patchprocess/newPatchFindbugsWarnings ${module_suffix} .html
563+ cp $file $PATCH_DIR /patchSpotbugsWarnings ${module_suffix} .xml
564+ $SPOTBUGS_HOME /bin/setBugDatabaseInfo -timestamp " 01/01/2000" \
565+ $PATCH_DIR /patchSpotbugsWarnings ${module_suffix} .xml \
566+ $PATCH_DIR /patchSpotbugsWarnings ${module_suffix} .xml
567+ newSpotbugsWarnings =` $SPOTBUGS_HOME /bin/filterBugs -first " 01/01/2000" $PATCH_DIR /patchSpotbugsWarnings ${module_suffix} .xml \
568+ $PATCH_DIR /newPatchSpotbugsWarnings ${module_suffix} .xml | $AWK ' {print $1}' `
569+ echo " Found $newSpotbugsWarnings Spotbugs warnings ($file )"
570+ spotbugsWarnings =$(( spotbugsWarnings + newSpotbugsWarnings ))
571+ $SPOTBUGS_HOME /bin/convertXmlToText -html \
572+ $PATCH_DIR /newPatchSpotbugsWarnings ${module_suffix} .xml \
573+ $PATCH_DIR /newPatchSpotbugsWarnings ${module_suffix} .html
574+ if [[ $newSpotbugsWarnings > 0 ]] ; then
575+ JIRA_COMMENT_FOOTER=" Spotbugs warnings: $BUILD_URL /artifact/patchprocess/newPatchSpotbugsWarnings ${module_suffix} .html
576576$JIRA_COMMENT_FOOTER "
577577 fi
578578 done
579579
580- if [[ $findbugsWarnings -gt 0 ]] ; then
580+ if [[ $spotbugsWarnings -gt 0 ]] ; then
581581 JIRA_COMMENT=" $JIRA_COMMENT
582582
583- {color:red}-1 findbugs {color}. The patch appears to introduce $findbugsWarnings new Findbugs (version ${findbugs_version } ) warnings."
583+ {color:red}-1 spotbugs {color}. The patch appears to introduce $spotbugsWarnings new Spotbugs (version ${spotbugs_version } ) warnings."
584584 return 1
585585 fi
586586 JIRA_COMMENT=" $JIRA_COMMENT
587587
588- {color:green}+1 findbugs {color}. The patch does not introduce any new Findbugs (version ${findbugs_version } ) warnings."
588+ {color:green}+1 spotbugs {color}. The patch does not introduce any new Spotbugs (version ${spotbugs_version } ) warnings."
589589 return 0
590590}
591591
805805checkJavadocWarnings
806806(( RESULT = RESULT + $? ))
807807buildAndInstall
808- checkFindbugsWarnings
808+ checkSpotbugsWarnings
809809(( RESULT = RESULT + $? ))
810810checkReleaseAuditWarnings
811811(( RESULT = RESULT + $? ))
0 commit comments