Don't log "Failed to find OatDexFile" when failure may be expected.
Change-Id: I82b8eac2f90902b2adaca67d97dbf4d601c19122
diff --git a/src/class_linker.cc b/src/class_linker.cc
index 6555070..0dab1ff 100644
--- a/src/class_linker.cc
+++ b/src/class_linker.cc
@@ -638,7 +638,7 @@
for (size_t i = 0; i < oat_files_.size(); i++) {
const OatFile* oat_file = oat_files_[i];
DCHECK(oat_file != NULL);
- if (oat_file->GetOatDexFile(dex_file.GetLocation())) {
+ if (oat_file->GetOatDexFile(dex_file.GetLocation(), false)) {
return oat_file;
}
}
diff --git a/src/oat_file.cc b/src/oat_file.cc
index 55493e8..4804864 100644
--- a/src/oat_file.cc
+++ b/src/oat_file.cc
@@ -130,10 +130,13 @@
return mem_map_->GetLimit();
}
-const OatFile::OatDexFile* OatFile::GetOatDexFile(const std::string& dex_file_location) const {
+const OatFile::OatDexFile* OatFile::GetOatDexFile(const std::string& dex_file_location,
+ bool warn_if_not_found) const {
Table::const_iterator it = oat_dex_files_.find(dex_file_location);
if (it == oat_dex_files_.end()) {
- LOG(WARNING) << "Failed to find OatDexFile for DexFile " << dex_file_location;
+ if (warn_if_not_found) {
+ LOG(WARNING) << "Failed to find OatDexFile for DexFile " << dex_file_location;
+ }
return NULL;
}
return it->second;
diff --git a/src/oat_file.h b/src/oat_file.h
index 0e22719..7bad2a1 100644
--- a/src/oat_file.h
+++ b/src/oat_file.h
@@ -158,7 +158,8 @@
DISALLOW_COPY_AND_ASSIGN(OatDexFile);
};
- const OatDexFile* GetOatDexFile(const std::string& dex_file_location) const;
+ const OatDexFile* GetOatDexFile(const std::string& dex_file_location,
+ bool warn_if_not_found = true) const;
std::vector<const OatDexFile*> GetOatDexFiles() const;
size_t GetSize() const {