LUCENE-5207: Fix a bug in the test and add final to the classloader

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1523464 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2013-09-15 17:24:05 +00:00
parent eecd78f37a
commit 71eacd238c
2 changed files with 3 additions and 3 deletions

View File

@ -73,7 +73,7 @@ import org.objectweb.asm.commons.GeneratorAdapter;
*/
public class JavascriptCompiler {
static class Loader extends ClassLoader {
static final class Loader extends ClassLoader {
Loader(ClassLoader parent) {
super(parent);
}

View File

@ -163,7 +163,7 @@ public class TestCustomFunctions extends LuceneTestCase {
}
/** Classloader that can be used to create a fake static class that has one method returning a static var */
static class Loader extends ClassLoader implements Opcodes {
static final class Loader extends ClassLoader implements Opcodes {
Loader(ClassLoader parent) {
super(parent);
}
@ -227,7 +227,7 @@ public class TestCustomFunctions extends LuceneTestCase {
// use our classloader, not the foreign one, which should fail!
try {
JavascriptCompiler.compile("bar()", functions, thisLoader);
JavascriptCompiler.compile("bar()", mixedFunctions, thisLoader);
fail();
} catch (IllegalArgumentException e) {
assertTrue(e.getMessage().contains("is not declared by a class which is accessible by the given parent ClassLoader"));