diff --git a/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/util/ReflectUtils.java b/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/util/ReflectUtils.java index 7aca31f6e13..77e8e0cdcec 100644 --- a/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/util/ReflectUtils.java +++ b/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/util/ReflectUtils.java @@ -25,14 +25,13 @@ import java.lang.reflect.Modifier; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.lang.reflect.TypeVariable; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jetty.websocket.api.InvalidWebSocketException; -import org.eclipse.jetty.websocket.common.DuplicateAnnotationException; +import java.util.regex.Pattern; public class ReflectUtils { + + private static final Pattern JAVAX_CLASSNAME_PATTERN = Pattern.compile("^javax*\\..*"); + private static class GenericRef { // The base class reference lookup started from @@ -370,7 +369,7 @@ public class ReflectUtils Class clazz = (Class) type; // prevent spinning off into Serialization and other parts of the // standard tree that we could care less about - if (clazz.getName().matches("^javax*\\..*")) + if (JAVAX_CLASSNAME_PATTERN.matcher(clazz.getName()).matches()) { return false; }