-
Notifications
You must be signed in to change notification settings - Fork 64
[class-parse] fix class visibility XML output. #83
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
Conversation
|
This results PR results in a unit test failure (yay unit tests!):
The complaint is that visibility went from The test appears to be correct: |
|
Oops, the replacement value was wrong. It should be GetClassVisibility() result for the same argument. |
5bf462b to
63dc5db
Compare
|
I don't understand the bug or the fix. Perhaps we need a new unit test in In particular, consider Consequently, afaict, this change doesn't do anything, since the original method and the new called method both do the same thing. |
|
damn, you're right. My update should have been twofolds: fix regression and fix the actual issue. The latter went away. I'm going to push my fixity fix, but needs more time to understand how the tests are written and built, so without test right now. |
As part of fixing MSBuild test regression[*1], I noticed that class-parse does not generate correct visibility for class/interface elements, which could affect further API metadata processing. It should not generate "private" for nested types when it should be "" (package private). [*1] it should be ported to OSS...
63dc5db to
9434fb9
Compare
|
I don't understand the updated PR. I don't understand why giving |
|
At least current class-parse behavior is a breaking change. For this Java class and nested classes: jar2xml generates this element in api.xml: where class-parse generates visibility="private". |
|
Having said that, jar2xml implemntation is not very logical on that context: The "cleaner" solution would be to discard this change and let class-parse keep current behavior, if we don't mind changes that possibly introduces breakage that could be caused by existing metadata fixup. I tend to say we should accept the change for the right and cleaner solution (discard this PR). |
|
I'll agree that this is a semantic change, but that's in part because jar2xml behavior here is stupid. ;-) (package-private isn't I also don't understand how this change breaks anything. By default, |
|
As my original commit message says, it is about API metadata difference. It is NOT about "breakage" (whatever you think is). |
|
A very possible breakage scenario is, if you have something like this in your Metadata.xml: It will not hit the element anymore in the current class-parse land. |
This is very true. I'm not sure that we should care. I would like I don't think that we should merge this PR, unless we we see that the possible breakage is widespread and/or detrimental. For example, if you're going to set visibility, why query it in the first place? Just set it: |
|
The concern is almost only about existing binding library sources. Your suggestion totally works for newly written libraries. Anyhow I'm totally fine with this decision, everyone should embrace this good change in the new API XML outputs. |
Changes: dotnet/android-tools@36d7fee...f5fcb9f * dotnet/android-tools@f5fcb9f: [Xamarin.Android.Tools.AndroidSdk] Add support for cmdline-tools (dotnet#83) * dotnet/android-tools@f473ff9: [AndroidSdkWindows] Guard against exception checking registry (dotnet#79)
Changes: dotnet/android-tools@36d7fee...f5fcb9f * dotnet/android-tools@f5fcb9f: [Xamarin.Android.Tools.AndroidSdk] Add support for cmdline-tools (#83) * dotnet/android-tools@f473ff9: [AndroidSdkWindows] Guard against exception checking registry (#79)
Changes: dotnet/android-tools@310c5cf...23c4fe0 * dotnet/android-tools@23c4fe0: [Xamarin.Android.Tools.AndroidSdk] Add support for cmdline-tools (#83) * dotnet/android-tools@cf9d325: [AndroidSdkWindows] Guard against exception checking registry (#79)
As part of fixing MSBuild test regression[*1], I noticed that class-parse
does not generate correct visibility for class/interface elements, which
could affect further API metadata processing. It should not generate
"private" for nested types when it should be "" (package private).
[*1] it should be ported to OSS...