Merge branch 'cassandra-3.11' into trunk

This commit is contained in:
Alex Petrov 2021-02-25 09:27:32 +01:00
commit 5e2a72d7cc
2 changed files with 8 additions and 3 deletions

View File

@ -659,7 +659,7 @@ public final class JavaBasedUDFunction extends UDFunction
{
EcjTargetClassLoader()
{
super(UDFClassLoader.insecureClassLoader);
super(UDFunction.udfClassLoader);
}
// This map is usually empty.

View File

@ -182,7 +182,7 @@ public abstract class UDFunction extends AbstractFunction implements ScalarFunct
return false;
}
// setup the UDF class loader with no parent class loader so that we have full control about what class/resource UDF uses
// setup the UDF class loader with a context class loader as a parent so that we have full control about what class/resource UDF uses
static final ClassLoader udfClassLoader = new UDFClassLoader();
protected UDFunction(FunctionName name,
@ -738,11 +738,16 @@ public abstract class UDFunction extends AbstractFunction implements ScalarFunct
return Objects.hashCode(name, Functions.typeHashCode(argTypes), Functions.typeHashCode(returnType), returnType, language, body);
}
static class UDFClassLoader extends ClassLoader
private static class UDFClassLoader extends ClassLoader
{
// insecureClassLoader is the C* class loader
static final ClassLoader insecureClassLoader = Thread.currentThread().getContextClassLoader();
private UDFClassLoader()
{
super(insecureClassLoader);
}
public URL getResource(String name)
{
if (!secureResource(name))