am 6904e036: Merge "Make CheckApi error messages more consisent and informative." into lmp-mr1-app-dev

* commit '6904e0369dbf0d4875368cc29cea3cdc7d993cba':
  Make CheckApi error messages more consisent and informative.
diff --git a/src/com/google/doclava/ClassInfo.java b/src/com/google/doclava/ClassInfo.java
index a5ee7d4..616cf23 100644
--- a/src/com/google/doclava/ClassInfo.java
+++ b/src/com/google/doclava/ClassInfo.java
@@ -2082,7 +2082,7 @@
         }
         if (mi == null) {
           Errors.error(Errors.REMOVED_METHOD, mInfo.position(), "Removed public method "
-              + mInfo.qualifiedName());
+              + mInfo.prettyQualifiedSignature());
           consistent = false;
         }
       }
@@ -2096,7 +2096,7 @@
         MethodInfo mi = ClassInfo.overriddenMethod(mInfo, this);
         if (mi == null) {
           Errors.error(Errors.ADDED_METHOD, mInfo.position(), "Added public method "
-              + mInfo.qualifiedName());
+              + mInfo.prettyQualifiedSignature());
           consistent = false;
         }
       }
@@ -2109,14 +2109,14 @@
         }
       } else {
         Errors.error(Errors.REMOVED_METHOD, mInfo.position(), "Removed public constructor "
-            + mInfo.prettySignature());
+            + mInfo.prettyQualifiedSignature());
         consistent = false;
       }
     }
     for (MethodInfo mInfo : cl.mApiCheckConstructors.values()) {
       if (!mApiCheckConstructors.containsKey(mInfo.getHashableName())) {
         Errors.error(Errors.ADDED_METHOD, mInfo.position(), "Added public constructor "
-            + mInfo.prettySignature());
+            + mInfo.prettyQualifiedSignature());
         consistent = false;
       }
     }
@@ -2201,7 +2201,7 @@
     if (!isDeprecated() == cl.isDeprecated()) {
       consistent = false;
       Errors.error(Errors.CHANGED_DEPRECATED, cl.position(), "Class " + cl.qualifiedName()
-          + " has changed deprecation state");
+          + " has changed deprecation state " + isDeprecated() + " --> " + cl.isDeprecated());
     }
 
     if (superclassName() != null) { // java.lang.Object can't have a superclass.
diff --git a/src/com/google/doclava/FieldInfo.java b/src/com/google/doclava/FieldInfo.java
index ce80e9e..83d748a 100644
--- a/src/com/google/doclava/FieldInfo.java
+++ b/src/com/google/doclava/FieldInfo.java
@@ -423,7 +423,7 @@
     boolean consistent = true;
     if (!mType.equals(fInfo.mType)) {
       Errors.error(Errors.CHANGED_TYPE, fInfo.position(), "Field " + fInfo.qualifiedName()
-          + " has changed type");
+          + " has changed type from " + mType + " to " + fInfo.mType);
       consistent = false;
     } else if (!this.valueEquals(fInfo)) {
       Errors.error(Errors.CHANGED_VALUE, fInfo.position(), "Field " + fInfo.qualifiedName()
@@ -467,7 +467,7 @@
 
     if (isDeprecated() != fInfo.isDeprecated()) {
       Errors.error(Errors.CHANGED_DEPRECATED, fInfo.position(), "Field " + fInfo.qualifiedName()
-          + " has changed deprecation state");
+          + " has changed deprecation state " + isDeprecated() + " --> " + fInfo.isDeprecated());
       consistent = false;
     }
 
diff --git a/src/com/google/doclava/MethodInfo.java b/src/com/google/doclava/MethodInfo.java
index cf98d0f..5dc217c 100644
--- a/src/com/google/doclava/MethodInfo.java
+++ b/src/com/google/doclava/MethodInfo.java
@@ -333,6 +333,10 @@
   public String prettySignature() {
     return name() + prettyParameters();
   }
+
+  public String prettyQualifiedSignature() {
+    return qualifiedName() + prettyParameters();
+  }
   
   /**
    * Returns a printable version of the parameters of this method's signature.
@@ -728,6 +732,8 @@
   public String qualifiedName() {
     String parentQName = (containingClass() != null)
         ? (containingClass().qualifiedName() + ".") : "";
+    // TODO: This logic doesn't work well with constructors, as name() for constructors already
+    // contains the containingClass's name, leading to things like A.B.B() being rendered as A.B.A.B()
     return parentQName + name();
   }
 
@@ -776,21 +782,22 @@
       }
 
       if (!consistent) {
-        Errors.error(Errors.CHANGED_TYPE, mInfo.position(), "Method " + mInfo.qualifiedName()
-            + " has changed return type from " + mReturnType + " to " + mInfo.mReturnType);
+        Errors.error(Errors.CHANGED_TYPE, mInfo.position(), "Method "
+            + mInfo.prettyQualifiedSignature() + " has changed return type from " + mReturnType
+            + " to " + mInfo.mReturnType);
       }
     }
 
     if (mIsAbstract != mInfo.mIsAbstract) {
       consistent = false;
-      Errors.error(Errors.CHANGED_ABSTRACT, mInfo.position(), "Method " + mInfo.qualifiedName()
-          + " has changed 'abstract' qualifier");
+      Errors.error(Errors.CHANGED_ABSTRACT, mInfo.position(), "Method "
+          + mInfo.prettyQualifiedSignature() + " has changed 'abstract' qualifier");
     }
 
     if (mIsNative != mInfo.mIsNative) {
       consistent = false;
-      Errors.error(Errors.CHANGED_NATIVE, mInfo.position(), "Method " + mInfo.qualifiedName()
-          + " has changed 'native' qualifier");
+      Errors.error(Errors.CHANGED_NATIVE, mInfo.position(), "Method "
+          + mInfo.prettyQualifiedSignature() + " has changed 'native' qualifier");
     }
 
     if (!mIsStatic) {
@@ -800,30 +807,32 @@
       // and (b) the method is not already inferred to be 'final' by virtue of its class.
       if (!isEffectivelyFinal() && mInfo.isEffectivelyFinal()) {
         consistent = false;
-        Errors.error(Errors.ADDED_FINAL, mInfo.position(), "Method " + mInfo.qualifiedName()
-            + " has added 'final' qualifier");
+        Errors.error(Errors.ADDED_FINAL, mInfo.position(), "Method "
+            + mInfo.prettyQualifiedSignature() + " has added 'final' qualifier");
       } else if (isEffectivelyFinal() && !mInfo.isEffectivelyFinal()) {
         consistent = false;
-        Errors.error(Errors.REMOVED_FINAL, mInfo.position(), "Method " + mInfo.qualifiedName()
-            + " has removed 'final' qualifier");
+        Errors.error(Errors.REMOVED_FINAL, mInfo.position(), "Method "
+            + mInfo.prettyQualifiedSignature() + " has removed 'final' qualifier");
       }
     }
 
     if (mIsStatic != mInfo.mIsStatic) {
       consistent = false;
-      Errors.error(Errors.CHANGED_STATIC, mInfo.position(), "Method " + mInfo.qualifiedName()
-          + " has changed 'static' qualifier");
+      Errors.error(Errors.CHANGED_STATIC, mInfo.position(), "Method "
+          + mInfo.prettyQualifiedSignature() + " has changed 'static' qualifier");
     }
 
     if (!scope().equals(mInfo.scope())) {
       consistent = false;
-      Errors.error(Errors.CHANGED_SCOPE, mInfo.position(), "Method " + mInfo.qualifiedName()
-          + " changed scope from " + scope() + " to " + mInfo.scope());
+      Errors.error(Errors.CHANGED_SCOPE, mInfo.position(), "Method "
+          + mInfo.prettyQualifiedSignature() + " changed scope from " + scope()
+          + " to " + mInfo.scope());
     }
 
     if (!isDeprecated() == mInfo.isDeprecated()) {
-      Errors.error(Errors.CHANGED_DEPRECATED, mInfo.position(), "Method " + mInfo.qualifiedName()
-          + " has changed deprecation state " + isDeprecated() + " --> " + mInfo.isDeprecated());
+      Errors.error(Errors.CHANGED_DEPRECATED, mInfo.position(), "Method "
+          + mInfo.prettyQualifiedSignature() + " has changed deprecation state " + isDeprecated()
+          + " --> " + mInfo.isDeprecated());
       consistent = false;
     }
 
@@ -842,8 +851,9 @@
       if (!mInfo.throwsException(exception)) {
         // exclude 'throws' changes to finalize() overrides with no arguments
         if (!name().equals("finalize") || (!mParameters.isEmpty())) {
-          Errors.error(Errors.CHANGED_THROWS, mInfo.position(), "Method " + mInfo.qualifiedName()
-              + " no longer throws exception " + exception.qualifiedName());
+          Errors.error(Errors.CHANGED_THROWS, mInfo.position(), "Method "
+              + mInfo.prettyQualifiedSignature() + " no longer throws exception "
+              + exception.qualifiedName());
           consistent = false;
         }
       }
@@ -853,8 +863,9 @@
       // exclude 'throws' changes to finalize() overrides with no arguments
       if (!throwsException(exec)) {
         if (!name().equals("finalize") || (!mParameters.isEmpty())) {
-          Errors.error(Errors.CHANGED_THROWS, mInfo.position(), "Method " + mInfo.qualifiedName()
-              + " added thrown exception " + exec.qualifiedName());
+          Errors.error(Errors.CHANGED_THROWS, mInfo.position(), "Method "
+              + mInfo.prettyQualifiedSignature() + " added thrown exception "
+              + exec.qualifiedName());
           consistent = false;
         }
       }