@@ -40,7 +40,6 @@ DIFF=${DIFF:-diff}
4040JIRACLI=${JIRA:- jira}
4141SED=${SED:- sed}
4242CURL=${CURL:- curl}
43- FINDBUGS_HOME=${FINDBUGS_HOME}
4443
4544# ##############################################################################
4645printUsage () {
@@ -60,7 +59,7 @@ printUsage() {
6059 echo " --grep-cmd=<cmd> The 'grep' command to use (default 'grep')"
6160 echo " --patch-cmd=<cmd> The 'patch' command to use (default 'patch')"
6261 echo " --diff-cmd=<cmd> The 'diff' command to use (default 'diff')"
63- echo " --findbugs -home=<path> Findbugs home directory (default FINDBUGS_HOME environment variable)"
62+ echo " --spotbugs -home=<path> SpotsBugs home directory (default SPOTBUGS_HOME environment variable)"
6463 echo " --dirty-workspace Allow the local git workspace to have uncommitted changes"
6564 echo " --run-tests Run all tests below the base directory"
6665 echo
@@ -115,8 +114,8 @@ parseArgs() {
115114 --jira-password=* )
116115 JIRA_PASSWD=${i#* =}
117116 ;;
118- --findbugs -home=* )
119- FINDBUGS_HOME =${i#* =}
117+ --spotbugs -home=* )
118+ SPOTBUGS_HOME =${i#* =}
120119 ;;
121120 --dirty-workspace)
122121 DIRTY_WORKSPACE=true
@@ -507,7 +506,7 @@ $JIRA_COMMENT_FOOTER"
507506
508507
509508# ##############################################################################
510- # ## Install the new jars so tests and findbugs can find all of the updated jars
509+ # ## Install the new jars so tests and SpotsBugs can find all of the updated jars
511510buildAndInstall () {
512511 echo " "
513512 echo " "
@@ -525,67 +524,67 @@ buildAndInstall () {
525524
526525
527526# ##############################################################################
528- # ## Check there are no changes in the number of Findbugs warnings
529- checkFindbugsWarnings () {
527+ # ## Check there are no changes in the number of SpotBugs warnings
528+ checkSpotBugsWarnings () {
530529 echo " "
531530 echo " "
532531 echo " ======================================================================"
533532 echo " ======================================================================"
534- echo " Determining number of patched Findbugs warnings."
533+ echo " Determining number of patched SpotBugs warnings."
535534 echo " ======================================================================"
536535 echo " ======================================================================"
537536 echo " "
538537 echo " "
539538
540539 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
540+ echo " Running SpotBugs "
541+ echo " $MVN clean test spotbugs:spotbugs -DskipTests < /dev/null > $PATCH_DIR /patchSpotBugsOutput .txt 2>&1"
542+ $MVN clean test spotbugs:spotbugs -DskipTests < /dev/null > $PATCH_DIR /patchSpotBugsOutput .txt 2>&1
544543 rc=$?
545- findbugs_version =$( ${AWK} ' match($0, /findbugs -maven-plugin:[^:]*:findbugs /) { print substr($0, RSTART + 22, RLENGTH - 31); exit }' " ${PATCH_DIR} /patchFindBugsOutput .txt" )
544+ spotbugs_version =$( ${AWK} ' match($0, /spotbugs -maven-plugin:[^:]*:spotbugs /) { print substr($0, RSTART + 22, RLENGTH - 31); exit }' " ${PATCH_DIR} /patchSpotBugsOutput .txt" )
546545
547546 if [ $rc != 0 ] ; then
548547 JIRA_COMMENT=" $JIRA_COMMENT
549548
550- {color:red}-1 findbugs {color}. The patch appears to cause Findbugs (version ${findbugs_version } ) to fail."
549+ {color:red}-1 spotbugs {color}. The patch appears to cause SpotsBugs (version ${spotbugs_version } ) to fail."
551550 return 1
552551 fi
553552
554- findbugsWarnings =0
555- for file in $( find $BASEDIR -name findbugsXml .xml)
553+ spotbugsWarnings =0
554+ for file in $( find $BASEDIR -name spotbugsXml .xml)
556555 do
557556 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
557+ if [ ! $relative_file == " target/spotbugsXml .xml" ]; then
558+ module_suffix=${relative_file%/ target/ spotbugsXml .xml} # strip trailing path
560559 module_suffix=` basename ${module_suffix} `
561560 fi
562561
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
562+ cp $file $PATCH_DIR /patchSpotbugsWarnings ${module_suffix} .xml
563+ $SPOTBUGS_HOME /bin/setBugDatabaseInfo -timestamp " 01/01/2000" \
564+ $PATCH_DIR /patchSpotbugsWarnings ${module_suffix} .xml \
565+ $PATCH_DIR /patchSpotbugsWarnings ${module_suffix} .xml
566+ newSpotbugsWarnings =` $SPOTBUGS_HOME /bin/filterBugs -first " 01/01/2000" $PATCH_DIR /patchSpotbugsWarnings ${module_suffix} .xml \
567+ $PATCH_DIR /newPatchSpotbugsWarnings ${module_suffix} .xml | $AWK ' {print $1}' `
568+ echo " Found $newSpotbugsWarnings SpotBugs warnings ($file )"
569+ spotbugsWarnings =$(( spotbugsWarnings + newSpotbugsWarnings ))
570+ $SPOTBUGS_HOME /bin/convertXmlToText -html \
571+ $PATCH_DIR /newPatchSpotbugsWarnings ${module_suffix} .xml \
572+ $PATCH_DIR /newPatchSpotbugsWarnings ${module_suffix} .html
573+ if [[ $newSpotbugsWarnings > 0 ]] ; then
574+ JIRA_COMMENT_FOOTER=" SpotBugs warnings: $BUILD_URL /artifact/patchprocess/newPatchSpotbugsWarnings ${module_suffix} .html
576575$JIRA_COMMENT_FOOTER "
577576 fi
578577 done
579578
580- if [[ $findbugsWarnings -gt 0 ]] ; then
579+ if [[ $spotbugsWarnings -gt 0 ]] ; then
581580 JIRA_COMMENT=" $JIRA_COMMENT
582581
583- {color:red}-1 findbugs {color}. The patch appears to introduce $findbugsWarnings new Findbugs (version ${findbugs_version } ) warnings."
582+ {color:red}-1 spotbugs {color}. The patch appears to introduce $spotbugsWarnings new SpotBugs (version ${spotbugs_version } ) warnings."
584583 return 1
585584 fi
586585 JIRA_COMMENT=" $JIRA_COMMENT
587586
588- {color:green}+1 findbugs {color}. The patch does not introduce any new Findbugs (version ${findbugs_version } ) warnings."
587+ {color:green}+1 spotbugs {color}. The patch does not introduce any new SpotBugs (version ${spotbugs_version } ) warnings."
589588 return 0
590589}
591590
805804checkJavadocWarnings
806805(( RESULT = RESULT + $? ))
807806buildAndInstall
808- checkFindbugsWarnings
807+ checkSpotBugsWarnings
809808(( RESULT = RESULT + $? ))
810809checkReleaseAuditWarnings
811810(( RESULT = RESULT + $? ))
0 commit comments