Loading tools/aapt2/java/ManifestClassGenerator.cpp +4 −5 Original line number Diff line number Diff line Loading @@ -26,21 +26,20 @@ #include "util/Maybe.h" #include "xml/XmlDom.h" using ::android::StringPiece; using ::aapt::text::IsJavaIdentifier; namespace aapt { static Maybe<StringPiece> ExtractJavaIdentifier(IDiagnostics* diag, const Source& source, static Maybe<std::string> ExtractJavaIdentifier(IDiagnostics* diag, const Source& source, const std::string& value) { StringPiece result = value; std::string result = value; size_t pos = value.rfind('.'); if (pos != std::string::npos) { result = result.substr(pos + 1); } // Normalize only the java identifier, leave the original value unchanged. if (result.contains("-")) { if (result.find("-") != std::string::npos) { result = JavaClassGenerator::TransformToFieldName(result); } Loading @@ -64,7 +63,7 @@ static bool WriteSymbol(const Source& source, IDiagnostics* diag, xml::Element* return false; } Maybe<StringPiece> result = Maybe<std::string> result = ExtractJavaIdentifier(diag, source.WithLine(el->line_number), attr->value); if (!result) { return false; Loading Loading
tools/aapt2/java/ManifestClassGenerator.cpp +4 −5 Original line number Diff line number Diff line Loading @@ -26,21 +26,20 @@ #include "util/Maybe.h" #include "xml/XmlDom.h" using ::android::StringPiece; using ::aapt::text::IsJavaIdentifier; namespace aapt { static Maybe<StringPiece> ExtractJavaIdentifier(IDiagnostics* diag, const Source& source, static Maybe<std::string> ExtractJavaIdentifier(IDiagnostics* diag, const Source& source, const std::string& value) { StringPiece result = value; std::string result = value; size_t pos = value.rfind('.'); if (pos != std::string::npos) { result = result.substr(pos + 1); } // Normalize only the java identifier, leave the original value unchanged. if (result.contains("-")) { if (result.find("-") != std::string::npos) { result = JavaClassGenerator::TransformToFieldName(result); } Loading @@ -64,7 +63,7 @@ static bool WriteSymbol(const Source& source, IDiagnostics* diag, xml::Element* return false; } Maybe<StringPiece> result = Maybe<std::string> result = ExtractJavaIdentifier(diag, source.WithLine(el->line_number), attr->value); if (!result) { return false; Loading