Disallow duplicated classes on boot classpath.
Bug: 111107855
Test: Build (checks for duplicated classes)
Change-Id: Ib3acd36ae57804d6757b90ad109f9c3087da6799
diff --git a/tools/hiddenapi/hiddenapi.cc b/tools/hiddenapi/hiddenapi.cc
index f426d02..cde3d0a 100644
--- a/tools/hiddenapi/hiddenapi.cc
+++ b/tools/hiddenapi/hiddenapi.cc
@@ -127,24 +127,12 @@
inline bool Equals(const DexClass& other) const {
bool equals = strcmp(GetDescriptor(), other.GetDescriptor()) == 0;
+
if (equals) {
- // TODO(dbrazdil): Check that methods/fields match as well once b/111116543 is fixed.
- CHECK_EQ(GetAccessFlags(), other.GetAccessFlags())
- << "Inconsistent access flags of class " << GetDescriptor() << ": "
- << "0x" << std::hex << GetAccessFlags() << std::dec << " (" << dex_file_.GetLocation()
- << ") and 0x" << std::hex << other.GetAccessFlags() << std::dec << " ("
- << other.dex_file_.GetLocation() << ")";
- CHECK_EQ(GetSuperclassDescriptor(), other.GetSuperclassDescriptor())
- << "Inconsistent superclass of class " << GetDescriptor() << ": "
- << GetSuperclassDescriptor() << " (" << dex_file_.GetLocation()
- << ") and " << other.GetSuperclassDescriptor() << " (" << other.dex_file_.GetLocation()
- << ")";
- CHECK(GetInterfaceDescriptors() == other.GetInterfaceDescriptors())
- << "Inconsistent set of interfaces of class " << GetDescriptor() << ": "
- << JoinStringSet(GetInterfaceDescriptors()) << " (" << dex_file_.GetLocation()
- << ") and " << JoinStringSet(other.GetInterfaceDescriptors()) << " ("
- << other.dex_file_.GetLocation() << ")";
+ LOG(FATAL) << "Class duplication: " << GetDescriptor() << " in " << dex_file_.GetLocation()
+ << " and " << other.dex_file_.GetLocation();
}
+
return equals;
}