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

Alter when accessor methods are generated. #84

Merged

Conversation

JakeWharton
Copy link
Contributor

@JakeWharton JakeWharton commented Jan 11, 2016

Refs #81 item 1. This removes 561 methods from our app.

Closes #89.

@@ -45,10 +45,16 @@ public void visit(int version, int access, String name, String signature, String

@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
if (isConstructor(name) || isStaticMethod(access)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having the static methods is the mechanism through which I'm going to implement point 2 on #81. By having a list of the private static methods which are synthetic and looking at invokedynamic's to those methods we can remove the private bit on the static method and skip the accessor.

@JakeWharton JakeWharton force-pushed the jw/no-accessor-for-visible-methods branch from d6985da to c06dc84 Compare April 27, 2016 14:08
@JakeWharton JakeWharton changed the title Do not generate accessor method for non-private methods. Alter when accessor methods are generated. Apr 27, 2016
@JakeWharton
Copy link
Contributor Author

I have updated this to address #89 as well.

@JakeWharton JakeWharton force-pushed the jw/no-accessor-for-visible-methods branch from c06dc84 to fb6101a Compare April 27, 2016 14:27
For owned, non-private methods, omit the accessor since the generated class can access the method directly. For non-owned methods, generate the accessor when the method is protected since the generated class will not have access.
@JakeWharton JakeWharton force-pushed the jw/no-accessor-for-visible-methods branch from fb6101a to 52364bc Compare April 28, 2016 02:59
@luontola luontola merged commit 52364bc into luontola:master Apr 30, 2016
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

Successfully merging this pull request may close these issues.

2 participants