Skip to content

Instantly share code, notes, and snippets.

Created August 14, 2015 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/04341f3cf9eccd6ea76d to your computer and use it in GitHub Desktop.
Save anonymous/04341f3cf9eccd6ea76d to your computer and use it in GitHub Desktop.
SimpleName newMethodName = invocation.getAST().newSimpleName(“setDisabled”);
astRewrite.set(invocation, MethodInvocation.NAME_PROPERTY, newMethodName, null);
BooleanLiteral booleanLiteral = (BooleanLiteral) invocation.arguments().get(0);
astRewrite.set(booleanLiteral, BooleanLiteral.BOOLEAN_VALUE_PROPERTY,
!booleanLiteral.booleanValue(), null);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment