Skip to content

Commit

Permalink
Trivial refactoring: extract internal method names
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellansun committed Jan 11, 2025
1 parent 651600b commit 90e8be8
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
* A metaclass for closures generated by the Groovy compiler. These classes
Expand Down Expand Up @@ -372,17 +375,9 @@ private static Object invokeOnDelegationObject(final Class sender, final Object
throw first;
}

private static final Set<String> INTERNAL_METHODS = new HashSet<>(Arrays.asList("curry", "ncurry", "rcurry", "leftShift", "rightShift"));
private static boolean isInternalMethod(final String methodName) {
switch (methodName) {
case "curry":
case "ncurry":
case "rcurry":
case "leftShift":
case "rightShift":
return true;
default:
return false;
}
return INTERNAL_METHODS.contains(methodName);
}

private synchronized void initAttributes() {
Expand Down

0 comments on commit 90e8be8

Please sign in to comment.