mirror of https://github.com/apache/cassandra
Merge branch 'cassandra-3.11' into trunk
This commit is contained in:
commit
5e2a72d7cc
|
|
@ -659,7 +659,7 @@ public final class JavaBasedUDFunction extends UDFunction
|
|||
{
|
||||
EcjTargetClassLoader()
|
||||
{
|
||||
super(UDFClassLoader.insecureClassLoader);
|
||||
super(UDFunction.udfClassLoader);
|
||||
}
|
||||
|
||||
// This map is usually empty.
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Reference in New Issue