[Xamarin.Android.Tools.Bytecode] Ignore synthetic ctor params #1091
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #1090
Attempting to parse TensorFlow 1.13.1 with a Debug build of
class-parse
results in an assertion failure:Note: this will only happen for Debug builds of
class-parse
, which we do not ship. Thus, this will only happen if you are using a local build of xamarin/Java.Interop.The assertion occurs when processing the constructor for
org/tensorflow/Session$Runner$Reference.class
, which is a non-static inner class:Note the
MethodParameterInfo.AccessFlags
value for the parameter:AccessFlags=Final, Synthetic
. This differs from theFinal, Mandated
value that is checked for byMethodInfo.UpdateParametersFromMethodParametersAttribute()
:Because the parameter is
Final, Synthetic
and notFinal, Mandated
, the parameter is not skipped, which results in the assertion messageexpected 0, got 1
.@jonpryor does not know how or why
Final, Synthetic
is being used bySession$Runner$Reference.class
, and is unable to reproduce this particular Java bytecode output with the JDK 1.8 and JDK 11 compilers.Update
MethodInfo.UpdateParametersFromMethodParametersAttribute()
to also skipFinal, Synthetic
parameters. This allowsSession$Runner$Reference.class
to be processed without assertions:Additionally, update the assertion message so that it includes the declaring class name, method name, and method descriptor.