Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public class FunctionInfo {
private final boolean _nullableParameters;

public FunctionInfo(Method method, Class<?> clazz, boolean nullableParameters) {
method.setAccessible(true);
_method = method;
_clazz = clazz;
_nullableParameters = nullableParameters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public FunctionInvoker(FunctionInfo functionInfo) {
Class<?> clazz = functionInfo.getClazz();
try {
Constructor<?> constructor = functionInfo.getClazz().getDeclaredConstructor();
constructor.setAccessible(true);
_instance = constructor.newInstance();
} catch (Exception e) {
throw new IllegalStateException("Caught exception while constructing class: " + clazz, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import com.google.common.base.Preconditions;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -59,6 +60,9 @@ private FunctionRegistry() {
.setScanners(new MethodAnnotationsScanner()));
Set<Method> methodSet = reflections.getMethodsAnnotatedWith(ScalarFunction.class);
for (Method method : methodSet) {
if (!Modifier.isPublic(method.getModifiers())) {
continue;
}
ScalarFunction scalarFunction = method.getAnnotation(ScalarFunction.class);
if (scalarFunction.enabled()) {
// Annotated function names
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ public void testNullReturnedByInbuiltFunctionEvaluatorThatCannotTakeNull() {
}
}

private static class MyFunc {
public static class MyFunc {
String _baseString = "";

String appendToStringAndReturn(String addedString) {
public String appendToStringAndReturn(String addedString) {
_baseString += addedString;
return _baseString;
}
Expand Down