Skip to content
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

Issue regarding resolution of anonymous inner class #16

Open
diptopol opened this issue Mar 9, 2022 · 0 comments
Open

Issue regarding resolution of anonymous inner class #16

diptopol opened this issue Mar 9, 2022 · 0 comments

Comments

@diptopol
Copy link
Owner

diptopol commented Mar 9, 2022

public static final RenderingHints.Key KEY_SUPPRESS_SHADOW_GENERATION
            = new RenderingHints.Key(0) {
        @Override
        public boolean isCompatibleValue(Object val) {
            return val instanceof Boolean;
        }
    };

We are trying resolve ClassInstanceCreation new RenderingHints.Key(0).
Class Name: org.jfree.chart.JFreeChart
Compiler output: void <init>(int)
API-Finder Output: java.awt.RenderingHints.Key::protected void RenderingHints$Key(int)

Since it's an anonymous class declaration. The original name of the class should be org.jfree.chart.JFreeChart$1.

What we usually do for matching our result with the compiler is that we concatenate the class name (of that method) and the method signature and compare the result with API-Finder's concatenated form of the class name (of the method) and method signature.

JarAnalyzer takes the string representation of ClassInstanceCreation (RenderingHints.Key) and tries to find that method for that. So it has found the class of RenderingHints.Key. Not the inner class.

What should be appropriate as a result for our case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant