-
Notifications
You must be signed in to change notification settings - Fork 58
[Xamarin.Android.Tools.Bytecode] Handle null InnerClassInfo values #144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
While processing a version of `cardview-v7.jar`, `class-parse --dump` was throwing a `NullReferenceException`: $ mkdir cardview-v7 $ cd cardview-v7 $ unzip ../cardview-v7.jar $ mono …/class-parse.exe -v --dump android/support/v7/widget/CardView.class >/dev/null class-parse: Unable to read file 'android/support/v7/widget/CardView.class': System.NullReferenceException: Object reference not set to an instance of an object at Xamarin.Android.Tools.Bytecode.InnerClassInfo.ToString () ... The `NullReferenceException` is because one of the `InnerClassInfo` values which `InnerClassInfo.ToString()` references is `null`. After fixing, we see: Attributes Count: 2 0: Unknown[SourceFile](2) 1: InnerClasses(Count=7, InnerClass(InnerClass='android/support/v7/widget/CardView$1', OuterClass='', InnerName='', InnerClassAccessFlags=0), InnerClass(InnerClass='android/R$attr', OuterClass='android/R', InnerName='attr', InnerClassAccessFlags=Public, Static, Final), InnerClass(InnerClass='android/view/View$MeasureSpec', OuterClass='android/view/View', InnerName='MeasureSpec', InnerClassAccessFlags=Public, Static), InnerClass(InnerClass='android/support/v7/cardview/R$styleable', OuterClass='android/support/v7/cardview/R', InnerName='styleable', InnerClassAccessFlags=Public, Static, Final), InnerClass(InnerClass='android/support/v7/cardview/R$style', OuterClass='android/support/v7/cardview/R', InnerName='style', InnerClassAccessFlags=Public, Static, Final), InnerClass(InnerClass='android/support/v7/cardview/R$color', OuterClass='android/support/v7/cardview/R', InnerName='color', InnerClassAccessFlags=Public, Static, Final), InnerClass(InnerClass='android/os/Build$VERSION', OuterClass='android/os/Build', InnerName='VERSION', InnerClassAccessFlags=Public, Static)) I'm not sure why `CardView$1` has no `InnerClassInfo.OuterClass` value -- shouldn't it be `android/support/v7/widget/CardView`? -- but that doesn't really matter; `class-parse --dump` shouldn't fail here.
23cb59a
to
8345576
Compare
atsushieno
approved these changes
Apr 26, 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
jonpryor
added a commit
to jonpryor/java.interop
that referenced
this pull request
Dec 16, 2021
Changes: dotnet/android-tools@34e98e2...db125a7 * dotnet/android-tools@db125a7: [build] Add d17-* as a branch trigger * dotnet/android-tools@f2cbc6a: Add resource dlls to MicroBuild signing. (dotnet#145) * dotnet/android-tools@35c89dd: Update MaximumCompatibleNDKMajorVersion to be 23 (dotnet#144) * dotnet/android-tools@0a22957: [Xamarin.Android.Tools.AndroidSdk] Parse Properties after header (dotnet#143) * dotnet/android-tools@dac3a47: [Xamarin.Android.Tools.AndroidSdk] Add API-31 to KnownVersions (dotnet#141) * dotnet/android-tools@fc976d8: [Xamarin.Android.Tools.AndroidSdk] Add JdkInfo.GetSupportedJdkInfos() (dotnet#142)
jonpryor
added a commit
to jonpryor/java.interop
that referenced
this pull request
Mar 14, 2022
Context: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1397171 Context: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1433453 Changes: http://github.com/xamarin/xamarin-android-tools/compare/34e98e2b65917d105169f868b5648f67e68b6784...f4c44e2ac2d91396226f31e8c200464ecc65f648 * dotnet/android-tools@f4c44e2: [Xamarin.Android.Tools.AndroidSdk] Attributes can be null! (dotnet#158) * dotnet/android-tools@f0b3abd: Revert "[Xamarin.Android.Tools.AndroidSdk] Update SDK component for API-32 (dotnet#156)" * dotnet/android-tools@bbe85df: [Xamarin.Android.Tools.AndroidSdk] Update SDK component for API-32 (dotnet#156) * dotnet/android-tools@a7f4d30: [ci] Mention new NuGet feed and release (dotnet#153) * dotnet/android-tools@85ae77f: Merge pull request dotnet#152 from xamarin/dev/mattnorflus/SigningMigration * dotnet/android-tools@dd34e54: Adding condition to GetFilesToSign to only include files if build configuration is Release * dotnet/android-tools@0e80ea1: Bump LibZipSharp to 2.0.3 (dotnet#151) * dotnet/android-tools@d0ab6ac: Fix Typo in commit 0dcf7172 (dotnet#150) * dotnet/android-tools@0dcf717: Bump LibZipSharp to 2.0.2 (dotnet#149) * dotnet/android-tools@db125a7: [build] Add d17-* as a branch trigger * dotnet/android-tools@f2cbc6a: Add resource dlls to MicroBuild signing. (dotnet#145) * dotnet/android-tools@35c89dd: Update MaximumCompatibleNDKMajorVersion to be 23 (dotnet#144) * dotnet/android-tools@0a22957: [Xamarin.Android.Tools.AndroidSdk] Parse Properties after header (dotnet#143) * dotnet/android-tools@dac3a47: [Xamarin.Android.Tools.AndroidSdk] Add API-31 to KnownVersions (dotnet#141) * dotnet/android-tools@fc976d8: [Xamarin.Android.Tools.AndroidSdk] Add JdkInfo.GetSupportedJdkInfos() (dotnet#142)
jonpryor
added a commit
that referenced
this pull request
Mar 14, 2022
Context: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1397171 Context: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1433453 Changes: http://github.com/xamarin/xamarin-android-tools/compare/34e98e2b65917d105169f868b5648f67e68b6784...f4c44e2ac2d91396226f31e8c200464ecc65f648 * dotnet/android-tools@f4c44e2: [Xamarin.Android.Tools.AndroidSdk] Attributes can be null! (#158) * dotnet/android-tools@f0b3abd: Revert "[Xamarin.Android.Tools.AndroidSdk] Update SDK component for API-32 (#156)" * dotnet/android-tools@bbe85df: [Xamarin.Android.Tools.AndroidSdk] Update SDK component for API-32 (#156) * dotnet/android-tools@a7f4d30: [ci] Mention new NuGet feed and release (#153) * dotnet/android-tools@85ae77f: Merge pull request #152 from xamarin/dev/mattnorflus/SigningMigration * dotnet/android-tools@dd34e54: Adding condition to GetFilesToSign to only include files if build configuration is Release * dotnet/android-tools@0e80ea1: Bump LibZipSharp to 2.0.3 (#151) * dotnet/android-tools@d0ab6ac: Fix Typo in commit 0dcf7172 (#150) * dotnet/android-tools@0dcf717: Bump LibZipSharp to 2.0.2 (#149) * dotnet/android-tools@db125a7: [build] Add d17-* as a branch trigger * dotnet/android-tools@f2cbc6a: Add resource dlls to MicroBuild signing. (#145) * dotnet/android-tools@35c89dd: Update MaximumCompatibleNDKMajorVersion to be 23 (#144) * dotnet/android-tools@0a22957: [Xamarin.Android.Tools.AndroidSdk] Parse Properties after header (#143) * dotnet/android-tools@dac3a47: [Xamarin.Android.Tools.AndroidSdk] Add API-31 to KnownVersions (#141) * dotnet/android-tools@fc976d8: [Xamarin.Android.Tools.AndroidSdk] Add JdkInfo.GetSupportedJdkInfos() (#142)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
While processing a version of
cardview-v7.jar
,class-parse --dump
was throwing aNullReferenceException
:The
NullReferenceException
is because one of theInnerClassInfo
values which
InnerClassInfo.ToString()
references isnull
.After fixing, we see:
I'm not sure why
CardView$1
has noInnerClassInfo.OuterClass
value-- shouldn't it be
android/support/v7/widget/CardView
? -- but thatdoesn't really matter;
class-parse --dump
shouldn't fail here.