diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2019-12-09 19:47:59 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-12-09 19:47:59 +0000 |
commit | 995fbdb659f9e0f26c1adf8e4972d665fa46e50a (patch) | |
tree | 46c33fb73b2da7c0949ef8096a93f26962017f3a /tools/aapt2/java/JavaClassGenerator.cpp | |
parent | ec10f333b5d2cbc7f6490d0147425cdde317cfdc (diff) | |
parent | 4e19c48a6e741c96956240e96046d5baaa77be3d (diff) |
Merge "Fix aapt2 JavaClassGenerator Maybe#value() call before check"
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator.cpp')
-rw-r--r-- | tools/aapt2/java/JavaClassGenerator.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/aapt2/java/JavaClassGenerator.cpp b/tools/aapt2/java/JavaClassGenerator.cpp index 6c3bcf039be1..bb541fe2490b 100644 --- a/tools/aapt2/java/JavaClassGenerator.cpp +++ b/tools/aapt2/java/JavaClassGenerator.cpp @@ -304,9 +304,11 @@ void JavaClassGenerator::ProcessStyleable(const ResourceNameRef& name, const Res auto documentation_remove_iter = std::remove_if(documentation_attrs.begin(), documentation_attrs.end(), [&](StyleableAttr entry) -> bool { - StringPiece attr_comment_line = entry.symbol.value().attribute->GetComment(); - return SkipSymbol(entry.symbol) || attr_comment_line.contains("@removed") - || attr_comment_line.contains("@hide"); + if (SkipSymbol(entry.symbol)) { + return true; + } + const StringPiece attr_comment_line = entry.symbol.value().attribute->GetComment(); + return attr_comment_line.contains("@removed") || attr_comment_line.contains("@hide"); }); documentation_attrs.erase(documentation_remove_iter, documentation_attrs.end()); |