Precompile pattern for checking of classes in javax package in ReflectUtils
Signed-off-by: dreis2211 <christoph.dreis@freenet.de>
This commit is contained in:
parent
75c5793f38
commit
41d4b59c19
|
@ -25,14 +25,13 @@ import java.lang.reflect.Modifier;
|
||||||
import java.lang.reflect.ParameterizedType;
|
import java.lang.reflect.ParameterizedType;
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.lang.reflect.TypeVariable;
|
import java.lang.reflect.TypeVariable;
|
||||||
import java.util.ArrayList;
|
import java.util.regex.Pattern;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.eclipse.jetty.websocket.api.InvalidWebSocketException;
|
|
||||||
import org.eclipse.jetty.websocket.common.DuplicateAnnotationException;
|
|
||||||
|
|
||||||
public class ReflectUtils
|
public class ReflectUtils
|
||||||
{
|
{
|
||||||
|
|
||||||
|
private static final Pattern JAVAX_CLASSNAME_PATTERN = Pattern.compile("^javax*\\..*");
|
||||||
|
|
||||||
private static class GenericRef
|
private static class GenericRef
|
||||||
{
|
{
|
||||||
// The base class reference lookup started from
|
// The base class reference lookup started from
|
||||||
|
@ -370,7 +369,7 @@ public class ReflectUtils
|
||||||
Class<?> clazz = (Class<?>) type;
|
Class<?> clazz = (Class<?>) type;
|
||||||
// prevent spinning off into Serialization and other parts of the
|
// prevent spinning off into Serialization and other parts of the
|
||||||
// standard tree that we could care less about
|
// standard tree that we could care less about
|
||||||
if (clazz.getName().matches("^javax*\\..*"))
|
if (JAVAX_CLASSNAME_PATTERN.matcher(clazz.getName()).matches())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue