This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push: new bc9f590 Ensure correct exception type for defineFunction with Java 9+ bc9f590 is described below commit bc9f590ecbc6c957f3fe90fada48b1b408d88a9a Author: Mark Thomas <ma...@apache.org> AuthorDate: Thu Oct 3 22:42:49 2019 +0100 Ensure correct exception type for defineFunction with Java 9+ --- java/javax/el/ELProcessor.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/java/javax/el/ELProcessor.java b/java/javax/el/ELProcessor.java index 67b26c7..3827168 100644 --- a/java/javax/el/ELProcessor.java +++ b/java/javax/el/ELProcessor.java @@ -109,11 +109,17 @@ public class ELProcessor { function = sig.getName(); } + // Only returns public methods. Java 9+ access is checked below. Method methods[] = clazz.getMethods(); + JreCompat jreCompat = JreCompat.getInstance(); + for (Method method : methods) { if (!Modifier.isStatic(method.getModifiers())) { continue; } + if (!jreCompat.canAcccess(null, method)) { + continue; + } if (method.getName().equals(sig.getName())) { if (sig.getParamTypeNames() == null) { // Only a name provided, no signature so map the first @@ -184,8 +190,9 @@ public class ELProcessor { int modifiers = method.getModifiers(); - // Check for public method as well as being static - if (!Modifier.isStatic(modifiers) || !Modifier.isPublic(modifiers)) { + // Check for static, public method and module access for Java 9+ + JreCompat jreCompat = JreCompat.getInstance(); + if (!Modifier.isStatic(modifiers) || !jreCompat.canAcccess(null, method)) { throw new NoSuchMethodException(Util.message(context, "elProcessor.defineFunctionInvalidMethod", method.getName(), method.getDeclaringClass().getName())); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org