com.google.http-client
diff --git a/google-http-client-findbugs/src/main/java/com/google/api/client/findbugs/BetaDetector.java b/google-http-client-findbugs/src/main/java/com/google/api/client/findbugs/BetaDetector.java
index 791d37f39..c6f1fdaae 100644
--- a/google-http-client-findbugs/src/main/java/com/google/api/client/findbugs/BetaDetector.java
+++ b/google-http-client-findbugs/src/main/java/com/google/api/client/findbugs/BetaDetector.java
@@ -18,6 +18,9 @@
import edu.umd.cs.findbugs.BugInstance;
import edu.umd.cs.findbugs.BugReporter;
import edu.umd.cs.findbugs.bcel.OpcodeStackDetector;
+import edu.umd.cs.findbugs.visitclass.Constants2;
+import org.apache.bcel.Const;
+import org.apache.bcel.Constants;
import org.apache.bcel.Repository;
import org.apache.bcel.classfile.AnnotationEntry;
import org.apache.bcel.classfile.ConstantClass;
@@ -26,11 +29,11 @@
import org.apache.bcel.classfile.Method;
/**
- * Findbugs plugin detector which detects usage of {@link Beta} in your code.
+ * SpotBugs plugin detector which detects usage of {@link Beta} in your code.
*
* @author Eyal Peled
*/
-public class BetaDetector extends OpcodeStackDetector {
+public class BetaDetector extends OpcodeStackDetector implements Constants, Constants2 {
/** Beta annotation "signature". */
private static final String BETA_ANNOTATION = "Lcom/google/api/client/util/Beta;";
@@ -54,33 +57,25 @@ public BetaDetector(BugReporter bugReporter) {
@Override
public void sawOpcode(int seen) {
switch (seen) {
- case INVOKEINTERFACE:
- case INVOKESTATIC:
- case INVOKESPECIAL:
- case INVOKEVIRTUAL:
+ case Const.INVOKEINTERFACE:
+ case Const.INVOKESTATIC:
+ case Const.INVOKESPECIAL:
+ case Const.INVOKEVIRTUAL:
// Method usage
checkMethod(getNameConstantOperand(), getSigConstantOperand());
break;
- case GETFIELD:
- case GETFIELD_QUICK:
- case GETFIELD_QUICK_W:
- case PUTFIELD:
- case PUTFIELD_QUICK:
- case PUTFIELD_QUICK_W:
- case GETSTATIC:
- case GETSTATIC_QUICK:
- case GETSTATIC2_QUICK:
- case PUTSTATIC:
- case PUTSTATIC_QUICK:
- case PUTSTATIC2_QUICK:
+ case Const.GETFIELD:
+ case Const.PUTFIELD:
+ case Const.GETSTATIC:
+ case Const.PUTSTATIC:
// Field usage
checkField(getNameConstantOperand());
break;
- case LDC:
- case LDC_W:
- case LDC2_W:
+ case Const.LDC:
+ case Const.LDC_W:
+ case Const.LDC2_W:
// Class usage
if (getConstantRefOperand() instanceof ConstantClass) {
// report bug in case it's google api @Beta class
diff --git a/google-http-client-findbugs/src/main/java/com/google/api/client/findbugs/package-info.java b/google-http-client-findbugs/src/main/java/com/google/api/client/findbugs/package-info.java
index 83168807c..cfcc251c2 100644
--- a/google-http-client-findbugs/src/main/java/com/google/api/client/findbugs/package-info.java
+++ b/google-http-client-findbugs/src/main/java/com/google/api/client/findbugs/package-info.java
@@ -13,14 +13,17 @@
*/
/**
- * Findbugs package which supports custom Google APIs Client library findbugs Plugins.
+ * SpotBugs package which supports the custom Google APIs Client Library SpotBugs plugin.
+ *
+ * The artifact ID retains its historical {@code google-http-client-findbugs} name for
+ * compatibility.
*
*
Usage on pom.xml:
*
*
* <plugin>
- * <groupId>org.codehaus.mojo</groupId>
- * <artifactId>findbugs-maven-plugin</artifactId>
+ * <groupId>com.github.spotbugs</groupId>
+ * <artifactId>spotbugs-maven-plugin</artifactId>
* ...
* <configuration>
* <plugins>
diff --git a/google-http-client-findbugs/src/main/resources/messages.xml b/google-http-client-findbugs/src/main/resources/messages.xml
index b6ce0d8b3..ebd2e87a8 100644
--- a/google-http-client-findbugs/src/main/resources/messages.xml
+++ b/google-http-client-findbugs/src/main/resources/messages.xml
@@ -3,7 +3,7 @@
xsi:noNamespaceSchemaLocation="messagecollection.xsd">
- FindBugs Google API's Client library plugin
+ SpotBugs Google APIs Client Library plugin
Provides detectors for Google APIs Client library.
diff --git a/google-http-client/src/main/java/com/google/api/client/util/Beta.java b/google-http-client/src/main/java/com/google/api/client/util/Beta.java
index 87e4f710f..dd92e8102 100644
--- a/google-http-client/src/main/java/com/google/api/client/util/Beta.java
+++ b/google-http-client/src/main/java/com/google/api/client/util/Beta.java
@@ -36,8 +36,9 @@
* used in client applications, and if the wrong version of this library is used, it has the
* potential to break client applications.
*
- * You may use the google-http-client-findbugs plugin to find usages of API bearing this
- * annotation.
+ *
You may use the SpotBugs plugin in the {@code google-http-client-findbugs} artifact to find
+ * usages of API bearing this annotation. The artifact ID retains its historical name for
+ * compatibility.
*
* @since 1.15
* @author Eyal Peled
diff --git a/pom.xml b/pom.xml
index 4155d00a5..69637f902 100644
--- a/pom.xml
+++ b/pom.xml
@@ -366,9 +366,9 @@
3.6.0