switch ToString/Signature for TypeSpecifier
ToString() works with "Dump()" and Signature() is for "comparing" except
AidlTypeSepcifier, which makes hard to read.
For example, AidlMethod::ToString() calls GetType().Signature() while
AidlMethod::Signature() calls GetType().ToString().
Now these two stringifying methods are consistent.
Bug: n/a
Test: aidl_unittests
Change-Id: I165530d8a82ef3a95a06a48d5cbaf2ad604ccaa2
diff --git a/aidl_checkapi.cpp b/aidl_checkapi.cpp
index 3c9654a..9d9387c 100644
--- a/aidl_checkapi.cpp
+++ b/aidl_checkapi.cpp
@@ -62,7 +62,7 @@
vector<string> annotations;
for (const AidlAnnotation& annotation : node.GetAnnotations()) {
if (kIgnoreAnnotations.find(annotation.GetType()) == kIgnoreAnnotations.end()) {
- annotations.push_back(annotation.ToString(AidlConstantValueDecorator));
+ annotations.push_back(annotation.ToString());
}
}
return annotations;
@@ -85,8 +85,9 @@
static bool are_compatible_types(const AidlTypeSpecifier& older, const AidlTypeSpecifier& newer) {
bool compatible = true;
- if (older.ToString() != newer.ToString()) {
- AIDL_ERROR(newer) << "Type changed: " << older.ToString() << " to " << newer.ToString() << ".";
+ if (older.Signature() != newer.Signature()) {
+ AIDL_ERROR(newer) << "Type changed: " << older.Signature() << " to " << newer.Signature()
+ << ".";
compatible = false;
}
compatible &= have_compatible_annotations(older, newer);