// For constructors with implicit arguments, we may need to adjust // annotation positions based on whether the implicit parameters are // expected to known and not just a compiler implementation detail. if (method->IsConstructor()) {
StackHandleScope<1> hs(soa.Self()); // If declaring class is a local or an enum, do not pad parameter // annotations, as the implicit constructor parameters are an // implementation detail rather than required by JLS.
Handle<mirror::Class> declaring_class = hs.NewHandle(method->GetDeclaringClass()); if (annotations::GetEnclosingMethod(declaring_class) == nullptr && !declaring_class->IsEnum()) { // Adjust the parameter index if the number of annotations does // not match the number of parameters. if (annotated_parameter_count <= parameter_count) { // Workaround for dexer not inserting annotation state for implicit parameters (b/68033708).
uint32_t skip_count = parameter_count - annotated_parameter_count;
DCHECK_GE(2u, skip_count); if (parameterIndex < static_cast<jint>(skip_count)) { return nullptr;
}
parameterIndex -= skip_count;
} else { // Workaround for Jack erroneously inserting implicit parameter for local classes // (b/68033708).
DCHECK_EQ(1u, annotated_parameter_count - parameter_count);
parameterIndex += static_cast<jint>(annotated_parameter_count - parameter_count);
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.