Skip to content

[JavaTypeSystem] Enable resolving generic types on declaring types. #916

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
merged 1 commit into from
Nov 30, 2021

Conversation

jpobst
Copy link
Contributor

@jpobst jpobst commented Nov 15, 2021

Fixes #815.

Given Java like this:

public class MyClass<T>
{
    public class MyNestedClass<U>
    {
      public void DoT (T value) { }
      public void DoU (U value) { }
    }
}

ApiXmlAdjuster does not look for generic parameter types on parent types, resulting in the method DoT being removed:

api.xml.class-parse : warning BG8605: The Java type 'T' could not be found (are you missing a Java reference jar/aar or a Java binding library NuGet?)

java-resolution-report.log:

==== Cycle 1 ====

The method '[Method] void DoT(T p0)' was removed because the Java parameter type 'T' could not be found.

JavaTypeSystem supports this, but it was initially disabled to help ensure that it was producing the same output as ApiXmlAdjuster for testing purposes. We can now enable it.

@jpobst jpobst marked this pull request as ready for review November 29, 2021 22:52
@jonpryor jonpryor merged commit 7f1a5ab into main Nov 30, 2021
@jonpryor jonpryor deleted the enable-815 branch November 30, 2021 03:16
@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ApiXmlAdjuster fails to resolve parent type parameters for nested types
2 participants