[class-parse] Ignore module-info.class file.#1093
Merged
Conversation
Contributor
|
Commit message: Context: https://repo1.maven.org/maven2/org/jetbrains/annotations/24.0.1/annotations-24.0.1.jar
Context: https://github.com/xamarin/java.interop/issues/1096
Some AndroidX packages contain a file called `module-info.class` that
uses unsupported `.class` constructs. It contains metadata for Java
Modules.

`class-parse` emits this for the file:
<package
name=""
jni-name="">
<class
abstract="false"
deprecated="not deprecated"
final="false"
name="module-info"
jni-signature="Lmodule-info;"
source-file-name="module-info.java"
static="false"
visibility="" />
</package>
When we try to process this `<class/>`, `generator` emits the warning:
warning BG8605: The Java type '' could not be found (are you missing a Java reference jar/aar or a Java binding library NuGet?)
This is neither useful nor actionable.
Ignore this file in `class-parse`, until we can properly parse it.
TODO: Issue #1096 |
jonpryor
reviewed
Apr 10, 2023
| if (entry.Name.EndsWith (".jnilib", StringComparison.OrdinalIgnoreCase)) | ||
| return false; | ||
|
|
||
| using var s = entry.Open (); |
Contributor
There was a problem hiding this comment.
In the context of #1092, should this instead use BufferedStream?
Contributor
Author
There was a problem hiding this comment.
I don't think we want it in this case, as we are reading a single value from the Stream and then closing it. If we use BufferedStream it would need to read xKB into the buffer instead of the single 4 byte read.
jonpryor
pushed a commit
to dotnet/android
that referenced
this pull request
Apr 13, 2023
Changes: dotnet/java-interop@a172402...554d819 * dotnet/java-interop@554d8193: [ci] Automatically retry failed native unit test failures once (dotnet/java-interop#1095) * dotnet/java-interop@71e586b0: [class-parse] Ignore `module-info.class` file. (dotnet/java-interop#1093) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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
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.
Some AndroidX packages contain a file called
module-info.classthat is not a standard.classfile. Rather, this file is a metadata file for Java Modules (documentation).class-parseemit this for the file:When we try to resolve this type,
generatoremits the following warning:This is neither useful nor actionable. Instead, we should ignore this file in
class-parse.