-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[class-parse] Ignore module-info.class
file.
#1093
Conversation
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 |
if (entry.Name.EndsWith (".jnilib", StringComparison.OrdinalIgnoreCase)) | ||
return false; | ||
|
||
using var s = entry.Open (); |
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.
In the context of #1092, should this instead use BufferedStream
?
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.
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.
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>
Some AndroidX packages contain a file called
module-info.class
that is not a standard.class
file. Rather, this file is a metadata file for Java Modules (documentation).class-parse
emit this for the file:When we try to resolve this type,
generator
emits the following warning:This is neither useful nor actionable. Instead, we should ignore this file in
class-parse
.