cls)
- {
- if (index >= _paramAnnotations.length)
- return null;
-
- return _paramAnnotations[index].get(cls);
- }
-
- /**
- * Returns number of arguments method takes.
- */
- public int getArgumentCount() {
- return _paramTypes.length;
- }
-
- public ResolvedType getArgumentType(int index)
- {
- if (index < 0 || index >= _paramTypes.length) {
- return null;
- }
- return _paramTypes[index];
- }
-}
diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/package-info.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/package-info.java
deleted file mode 100644
index b854566b5..000000000
--- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/members/package-info.java
+++ /dev/null
@@ -1,5 +0,0 @@
-/**
- * Package that contains implementations of various member types
- * (methods, fields, constructors)
- */
-package com.fr.third.com.fasterxml.classmate.members;
diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/package-info.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/package-info.java
deleted file mode 100644
index 820128ab3..000000000
--- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/package-info.java
+++ /dev/null
@@ -1,13 +0,0 @@
-/**
- * Package that contains main public interface of ClassMate
- * package.
- *
- * Most commonly resolution starts with {@link com.fr.third.com.fasterxml.classmate.TypeResolver},
- * using its resolve()
method, which returns a
- * {@link com.fr.third.com.fasterxml.classmate.ResolvedType} instance.
- * These type objects contain all necessary information about type itself;
- * but if type information on members (fields, methods, constructors, static
- * members) is needed, {@link com.fr.third.com.fasterxml.classmate.MemberResolver} can
- * resolve types for members: it takes {@link com.fr.third.com.fasterxml.classmate.ResolvedType}s.
- */
-package com.fr.third.com.fasterxml.classmate;
diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedArrayType.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedArrayType.java
deleted file mode 100644
index 099f9d2c3..000000000
--- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedArrayType.java
+++ /dev/null
@@ -1,108 +0,0 @@
-package com.fr.third.com.fasterxml.classmate.types;
-
-import java.util.*;
-
-import com.fr.third.com.fasterxml.classmate.ResolvedType;
-import com.fr.third.com.fasterxml.classmate.TypeBindings;
-
-public final class ResolvedArrayType extends ResolvedType
-{
- protected final ResolvedType _elementType;
-
- /*
- /**********************************************************************
- /* Life cycle
- /**********************************************************************
- */
-
- public ResolvedArrayType(Class> erased, TypeBindings bindings,
- ResolvedType elementType)
- {
- super(erased, bindings);
- _elementType = elementType;
- }
-
- @Override
- public boolean canCreateSubtypes() {
- return false;
- }
-
- /*
- /**********************************************************************
- /* Accessors for related types
- /**********************************************************************
- */
-
- @Override
- public ResolvedType getParentClass() { return null; }
-
- @Override
- public ResolvedType getSelfReferencedType() { return null; }
-
- @Override
- public List getImplementedInterfaces() {
- return Collections.emptyList();
- }
-
- /*
- /**********************************************************************
- /* Simple property accessors
- /**********************************************************************
- */
-
- @Override
- public boolean isInterface() {
- return false;
- }
-
- @Override
- public boolean isAbstract() { return false; }
-
- @Override
- public ResolvedType getArrayElementType() { return _elementType; }
-
- @Override
- public boolean isArray() { return true; }
-
- @Override
- public boolean isPrimitive() { return false; }
-
- /*
- /**********************************************************************
- /* Accessors for raw (minimally procesed) members
- /**********************************************************************
- */
-
- // defaults are fine (nothing to access)
-
- /*
- /**********************************************************************
- /* String representations
- /**********************************************************************
- */
-
- @Override
- public StringBuilder appendSignature(StringBuilder sb) {
- sb.append('[');
- return _elementType.appendSignature(sb);
- }
-
- @Override
- public StringBuilder appendErasedSignature(StringBuilder sb) {
- sb.append('[');
- return _elementType.appendErasedSignature(sb);
- }
-
- @Override
- public StringBuilder appendBriefDescription(StringBuilder sb)
- {
- sb = _elementType.appendBriefDescription(sb);
- sb.append("[]");
- return sb;
- }
-
- @Override
- public StringBuilder appendFullDescription(StringBuilder sb) {
- return appendBriefDescription(sb);
- }
-}
diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedInterfaceType.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedInterfaceType.java
deleted file mode 100644
index e4c045bfc..000000000
--- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedInterfaceType.java
+++ /dev/null
@@ -1,162 +0,0 @@
-package com.fr.third.com.fasterxml.classmate.types;
-
-import java.util.*;
-
-import com.fr.third.com.fasterxml.classmate.ResolvedType;
-import com.fr.third.com.fasterxml.classmate.TypeBindings;
-import com.fr.third.com.fasterxml.classmate.members.RawField;
-import com.fr.third.com.fasterxml.classmate.members.RawMethod;
-
-public class ResolvedInterfaceType extends ResolvedType
-{
-
- /**
- * List of interfaces this type implements; may be empty but never null
- */
- protected final ResolvedType[] _superInterfaces;
-
- /**
- * Interfaces can have static final (constant) fields.
- */
- protected RawField[] _constantFields;
-
- /**
- * Interface methods are all public and abstract.
- */
- protected RawMethod[] _memberMethods;
-
- /*
- /**********************************************************************
- /* Life cycle
- /**********************************************************************
- */
-
- public ResolvedInterfaceType(Class> erased, TypeBindings bindings,
- ResolvedType[] superInterfaces)
- {
- super(erased, bindings);
- _superInterfaces = (superInterfaces == null ? NO_TYPES : superInterfaces);
- }
-
- @Override
- public boolean canCreateSubtypes() {
- return true;
- }
-
- /*
- /**********************************************************************
- /* Accessors for related types
- /**********************************************************************
- */
-
- @Override
- public ResolvedType getParentClass() {
- // interfaces do not have parent class, just interfaces
- return null;
- }
-
- @Override
- public ResolvedType getSelfReferencedType() { return null; }
-
- @Override
- public List getImplementedInterfaces() {
- return (_superInterfaces.length == 0) ?
- Collections.emptyList() : Arrays.asList(_superInterfaces);
- }
-
- @Override
- public ResolvedType getArrayElementType() { // interfaces are never arrays, so:
- return null;
- }
-
- /*
- /**********************************************************************
- /* Simple property accessors
- /**********************************************************************
- */
-
- @Override
- public boolean isInterface() { return true; }
-
- @Override
- public boolean isAbstract() { return true; }
-
- @Override
- public boolean isArray() { return false; }
-
- @Override
- public boolean isPrimitive() { return false; }
-
- /*
- /**********************************************************************
- /* Accessors for raw (minimally procesed) members
- /**********************************************************************
- */
-
- @Override
- public synchronized List getStaticFields()
- {
- // Interfaces can have static fields, but only as static constants...
- if (_constantFields == null) {
- _constantFields = _getFields(true);
- }
- if (_constantFields.length == 0) {
- return Collections.emptyList();
- }
- return Arrays.asList(_constantFields);
- }
-
- @Override
- public synchronized List getMemberMethods()
- {
- if (_memberMethods == null) {
- _memberMethods = _getMethods(false);
- }
- if (_memberMethods.length == 0) {
- return Collections.emptyList();
- }
- return Arrays.asList(_memberMethods);
- }
-
- /*
- /**********************************************************************
- /* String representations
- /**********************************************************************
- */
-
- @Override
- public StringBuilder appendSignature(StringBuilder sb) {
- return _appendClassSignature(sb);
- }
-
- @Override
- public StringBuilder appendErasedSignature(StringBuilder sb) {
- return _appendErasedClassSignature(sb);
- }
-
- @Override
- public StringBuilder appendBriefDescription(StringBuilder sb) {
- return _appendClassDescription(sb);
- }
-
- @Override
- public StringBuilder appendFullDescription(StringBuilder sb)
- {
- sb = _appendClassDescription(sb);
- // interfaces 'extend' other interfaces...
- int count = _superInterfaces.length;
- if (count > 0) {
- sb.append(" extends ");
- for (int i = 0; i < count; ++i) {
- if (i > 0) {
- sb.append(",");
- }
- sb = _superInterfaces[i].appendBriefDescription(sb);
- }
- }
- return sb;
- }
-}
-
-
-
diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedObjectType.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedObjectType.java
deleted file mode 100644
index d23acee8b..000000000
--- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedObjectType.java
+++ /dev/null
@@ -1,287 +0,0 @@
-package com.fr.third.com.fasterxml.classmate.types;
-
-import java.lang.reflect.Modifier;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import com.fr.third.com.fasterxml.classmate.ResolvedType;
-import com.fr.third.com.fasterxml.classmate.TypeBindings;
-import com.fr.third.com.fasterxml.classmate.members.RawConstructor;
-import com.fr.third.com.fasterxml.classmate.members.RawField;
-import com.fr.third.com.fasterxml.classmate.members.RawMethod;
-
-/**
- * Type implementation for classes that do not represent interfaces,
- * primitive or array types.
- */
-public class ResolvedObjectType extends ResolvedType
-{
- /**
- * While fundamentally super class has to be {@link ResolvedObjectType}
- * (or null for {@link java.lang.Object}), we may need to hold on to
- * a {@link ResolvedRecursiveType} occasionally.
- */
- protected final ResolvedType _superClass;
-
- /**
- * List of interfaces this type implements; may be empty but never null
- */
- protected final ResolvedType[] _superInterfaces;
-
- /**
- * Modifiers of the underlying class.
- */
- protected final int _modifiers;
-
- /**
- * Constructors declared by the resolved Object class.
- */
- protected RawConstructor[] _constructors;
-
- protected RawField[] _memberFields;
- protected RawField[] _staticFields;
-
- protected RawMethod[] _memberMethods;
- protected RawMethod[] _staticMethods;
-
- /*
- /**********************************************************************
- /* Life cycle
- /**********************************************************************
- */
-
- public ResolvedObjectType(Class> erased, TypeBindings bindings,
- ResolvedType superClass, List interfaces)
- {
- this(erased, bindings, superClass,
- (interfaces == null || interfaces.isEmpty()) ? NO_TYPES :
- interfaces.toArray(new ResolvedType[interfaces.size()]));
- }
-
- public ResolvedObjectType(Class> erased, TypeBindings bindings,
- ResolvedType superClass, ResolvedType[] interfaces)
- {
- super(erased, bindings);
- /* 19-Aug-2014, tatu: bit unclean, but has to do for now.
- * Problem is, there is no common super-type, nor can we yet
- * force or coerce recursive types. Rather, they may only get
- * resolved only slightly after construction. So... need to
- * keep a reference.
- */
- if (superClass != null) {
- if (!(superClass instanceof ResolvedObjectType)
- && !(superClass instanceof ResolvedRecursiveType)
- ) {
- throw new IllegalArgumentException("Unexpected parent type for "
- +erased.getName()+": "+superClass.getClass().getName());
- }
- }
-
- _superClass = superClass;
- _superInterfaces = (interfaces == null) ? NO_TYPES : interfaces;
- _modifiers = erased.getModifiers();
- }
-
- @Deprecated // since 1.1; removed from 1.2 -- kept for binary backwards compatibility
- public ResolvedObjectType(Class> erased, TypeBindings bindings,
- ResolvedObjectType superClass, List interfaces)
- {
- this(erased, bindings, (ResolvedType) superClass, interfaces);
- }
-
- @Deprecated // since 1.1; removed from 1.2 -- kept for binary backwards compatibility
- public ResolvedObjectType(Class> erased, TypeBindings bindings,
- ResolvedObjectType superClass, ResolvedType[] interfaces)
- {
- this(erased, bindings, (ResolvedType) superClass, interfaces);
- }
-
- public static ResolvedObjectType create(Class> erased, TypeBindings bindings,
- ResolvedType superClass, List interfaces)
- {
- return new ResolvedObjectType(erased, bindings, superClass, interfaces);
- }
-
- @Override
- public boolean canCreateSubtypes() {
- return true;
- }
-
- /*
- /**********************************************************************
- /* Accessors for related types
- /**********************************************************************
- */
-
- @Override
- public ResolvedObjectType getParentClass() {
-
- /* 19-Aug-2014, tatu: Ugly does it... sigh.
- * But can't be helped because ResolvedRecursiveType is typically only
- * resolved after instances of this type have been constructed.
- * This means that resolution will need to be done somewhat dynamically.
- */
- if (_superClass == null) {
- return null;
- }
- if (_superClass instanceof ResolvedObjectType) {
- return (ResolvedObjectType) _superClass;
- }
- ResolvedType rt = ((ResolvedRecursiveType) _superClass).getSelfReferencedType();
- if (!(rt instanceof ResolvedObjectType)) {
- throw new IllegalStateException("Internal error: self-referential parent type ("
- +_superClass+") does not resolve into proper ResolvedObjectType, but instead to: "
- +rt);
- }
- return (ResolvedObjectType) rt;
- }
-
- @Override
- public ResolvedType getSelfReferencedType() { return null; }
-
- @Override
- public List getImplementedInterfaces() {
- return (_superInterfaces.length == 0) ?
- Collections.emptyList() : Arrays.asList(_superInterfaces);
- }
-
- /*
- /**********************************************************************
- /* Accessors for related types
- /**********************************************************************
- */
-
- @Override
- public final ResolvedType getArrayElementType() { return null; }
-
- /*
- /**********************************************************************
- /* Simple property accessors
- /**********************************************************************
- */
-
- @Override
- public final boolean isInterface() { return false; }
-
- @Override
- public boolean isAbstract() {
- return Modifier.isAbstract(_modifiers);
- }
-
- @Override
- public final boolean isArray() { return false; }
-
- @Override
- public final boolean isPrimitive() { return false; }
-
- /*
- /**********************************************************************
- /* Accessors for raw (minimally procesed) members
- /**********************************************************************
- */
-
- @Override
- public synchronized List getMemberFields()
- {
- if (_memberFields == null) {
- _memberFields = _getFields(false);
- }
- if (_memberFields.length == 0) {
- return Collections.emptyList();
- }
- return Arrays.asList(_memberFields);
- }
-
- @Override
- public synchronized List getStaticFields()
- {
- if (_staticFields == null) {
- _staticFields = _getFields(true);
- }
- if (_staticFields.length == 0) {
- return Collections.emptyList();
- }
- return Arrays.asList(_staticFields);
- }
-
- @Override
- public synchronized List getMemberMethods()
- {
- if (_memberMethods == null) {
- _memberMethods = _getMethods(false);
- }
- if (_memberMethods.length == 0) {
- return Collections.emptyList();
- }
- return Arrays.asList(_memberMethods);
- }
-
- @Override
- public synchronized List getStaticMethods()
- {
- if (_staticMethods == null) {
- _staticMethods = _getMethods(true);
- }
- if (_staticMethods.length == 0) {
- return Collections.emptyList();
- }
- return Arrays.asList(_staticMethods);
- }
-
- @Override
- public List getConstructors()
- {
- if (_constructors == null) {
- _constructors = _getConstructors();
- }
- if (_constructors.length == 0) {
- return Collections.emptyList();
- }
- return Arrays.asList(_constructors);
- }
-
- /*
- /**********************************************************************
- /* String representations
- /**********************************************************************
- */
-
- @Override
- public StringBuilder appendSignature(StringBuilder sb) {
- return _appendClassSignature(sb);
- }
-
- @Override
- public StringBuilder appendErasedSignature(StringBuilder sb) {
- return _appendErasedClassSignature(sb);
- }
-
- @Override
- public StringBuilder appendBriefDescription(StringBuilder sb) {
- return _appendClassDescription(sb);
- }
-
- @Override
- public StringBuilder appendFullDescription(StringBuilder sb)
- {
- sb = _appendClassDescription(sb);
- if (_superClass != null) {
- sb.append(" extends ");
- sb = _superClass.appendBriefDescription(sb);
- }
- // interfaces 'extend' other interfaces...
- int count = _superInterfaces.length;
- if (count > 0) {
- sb.append(" implements ");
- for (int i = 0; i < count; ++i) {
- if (i > 0) {
- sb.append(",");
- }
- sb = _superInterfaces[i].appendBriefDescription(sb);
- }
- }
- return sb;
- }
-}
-
diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedPrimitiveType.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedPrimitiveType.java
deleted file mode 100644
index 34c9e9a91..000000000
--- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedPrimitiveType.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package com.fr.third.com.fasterxml.classmate.types;
-
-import java.util.*;
-
-import com.fr.third.com.fasterxml.classmate.ResolvedType;
-import com.fr.third.com.fasterxml.classmate.TypeBindings;
-
-/**
- * Type used for Java primitive types (which does not include arrays here).
- *
- * Since set of primitive types is bounded, constructor is defined as protected,
- * and class final; that is, new primitive types are not to be constructed
- * by calling applications.
- */
-public final class ResolvedPrimitiveType extends ResolvedType
-{
- private final static ResolvedPrimitiveType VOID = new ResolvedPrimitiveType(Void.TYPE, 'V', "void");
-
- /**
- * Primitive types have single-character Signature, easy and efficient
- * to just store here
- */
- protected final String _signature;
-
- /**
- * Human-readable description should be simple as well
- */
- protected final String _description;
-
- /*
- /**********************************************************************
- /* Life cycle
- /**********************************************************************
- */
-
- protected ResolvedPrimitiveType(Class> erased, char sig, String desc)
- {
- super(erased, TypeBindings.emptyBindings());
- _signature = String.valueOf(sig);
- _description = desc;
- }
-
- public static List all()
- {
- ArrayList all = new ArrayList();
- all.add(new ResolvedPrimitiveType(Boolean.TYPE, 'Z', "boolean"));
- all.add(new ResolvedPrimitiveType(Byte.TYPE, 'B', "byte"));
- all.add(new ResolvedPrimitiveType(Short.TYPE, 'S', "short"));
- all.add(new ResolvedPrimitiveType(Character.TYPE, 'C', "char"));
- all.add(new ResolvedPrimitiveType(Integer.TYPE, 'I', "int"));
- all.add(new ResolvedPrimitiveType(Long.TYPE, 'J', "long"));
- all.add(new ResolvedPrimitiveType(Float.TYPE, 'F', "float"));
- all.add(new ResolvedPrimitiveType(Double.TYPE, 'D', "double"));
- return all;
- }
-
- public static ResolvedPrimitiveType voidType()
- {
- return VOID;
- }
-
- @Override
- public boolean canCreateSubtypes() {
- return false;
- }
-
- /*
- /**********************************************************************
- /* Accessors for related types
- /**********************************************************************
- */
-
- @Override
- public ResolvedType getSelfReferencedType() { return null; }
-
- @Override
- public ResolvedType getParentClass() { return null; }
-
- /*
- /**********************************************************************
- /* Simple property accessors
- /**********************************************************************
- */
-
- @Override
- public boolean isInterface() { return false; }
-
- @Override
- public boolean isAbstract() { return false; }
-
- @Override
- public ResolvedType getArrayElementType() { return null; }
-
- @Override
- public boolean isArray() { return false; }
-
- @Override
- public boolean isPrimitive() { return true; }
-
- @Override
- public List getImplementedInterfaces() {
- return Collections.emptyList();
- }
-
- /*
- /**********************************************************************
- /* Accessors for raw (minimally procesed) members
- /**********************************************************************
- */
-
- // Primitive types are simple; no fields, no methods, no constructors
-
- /*
- /**********************************************************************
- /* String representations
- /**********************************************************************
- */
-
- @Override
- public String getSignature() {
- return _signature;
- }
-
- @Override
- public String getErasedSignature() {
- return _signature;
- }
-
- @Override
- public String getFullDescription() {
- return _description;
- }
-
- @Override
- public StringBuilder appendSignature(StringBuilder sb) {
- sb.append(_signature);
- return sb;
- }
-
- @Override
- public StringBuilder appendErasedSignature(StringBuilder sb) {
- sb.append(_signature);
- return sb;
- }
-
- @Override
- public StringBuilder appendFullDescription(StringBuilder sb) {
- sb.append(_description);
- return sb;
- }
-
- @Override
- public StringBuilder appendBriefDescription(StringBuilder sb) {
- sb.append(_description);
- return sb;
- }
-}
diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedRecursiveType.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedRecursiveType.java
deleted file mode 100644
index f1146ff05..000000000
--- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/ResolvedRecursiveType.java
+++ /dev/null
@@ -1,149 +0,0 @@
-package com.fr.third.com.fasterxml.classmate.types;
-
-import java.lang.reflect.Modifier;
-import java.util.*;
-
-import com.fr.third.com.fasterxml.classmate.ResolvedType;
-import com.fr.third.com.fasterxml.classmate.TypeBindings;
-import com.fr.third.com.fasterxml.classmate.members.RawConstructor;
-import com.fr.third.com.fasterxml.classmate.members.RawField;
-import com.fr.third.com.fasterxml.classmate.members.RawMethod;
-
-/**
- * Specialized type placeholder used in cases where type definition is
- * recursive; to avoid infinite loop, reference that would be "back" in
- * hierarchy is represented by an instance of this class.
- * Underlying information is achievable (for full resolution), but
- * not exposed using super type (parent) accessors; and has special
- * handling when used for constructing descriptions.
- */
-public class ResolvedRecursiveType extends ResolvedType
-{
- /**
- * Actual fully resolved type; assigned once resolution is complete
- */
- protected ResolvedType _referencedType;
-
- /*
- /**********************************************************************
- /* Life cycle
- /**********************************************************************
- */
-
- public ResolvedRecursiveType(Class> erased, TypeBindings bindings)
- {
- super(erased, bindings);
- }
-
- @Override
- public boolean canCreateSubtypes() {
- return _referencedType.canCreateSubtypes();
- }
-
- public void setReference(ResolvedType ref)
- {
- // sanity check; should not be called multiple times
- if (_referencedType != null) {
- throw new IllegalStateException("Trying to re-set self reference; old value = "+_referencedType+", new = "+ref);
- }
- _referencedType = ref;
- }
-
-
- /*
- /**********************************************************************
- /* Accessors for related types
- /**********************************************************************
- */
-
- /**
- * To avoid infinite loops, will return null;
- */
- @Override
- public ResolvedType getParentClass() {
- return null;
- }
-
- @Override
- public ResolvedType getSelfReferencedType() { return _referencedType; }
-
- /**
- * To avoid infinite loops, will return empty list
- */
- @Override
- public List getImplementedInterfaces() {
- return Collections.emptyList();
- }
-
- /**
- * To avoid infinite loops, will return null type
- */
- @Override
- public ResolvedType getArrayElementType() { // interfaces are never arrays, so:
- return null;
- }
-
- /*
- /**********************************************************************
- /* Simple property accessors
- /**********************************************************************
- */
-
- @Override
- public boolean isInterface() { return _erasedType.isInterface(); }
-
- @Override
- public boolean isAbstract() { return Modifier.isAbstract(_erasedType.getModifiers()); }
-
- @Override
- public boolean isArray() { return _erasedType.isArray(); }
-
- @Override
- public boolean isPrimitive() { return false; }
-
- /*
- /**********************************************************************
- /* Accessors for raw (minimally procesed) members
- /**********************************************************************
- */
-
- @Override
- public List getMemberFields() { return _referencedType.getMemberFields(); }
- @Override
- public List getStaticFields() { return _referencedType.getStaticFields(); }
- @Override
- public List getStaticMethods() { return _referencedType.getStaticMethods(); }
- @Override
- public List getMemberMethods() { return _referencedType.getMemberMethods(); }
- @Override
- public List getConstructors() { return _referencedType.getConstructors(); }
-
- /*
- /**********************************************************************
- /* String representations
- /**********************************************************************
- */
-
- @Override
- public StringBuilder appendSignature(StringBuilder sb) {
- // to avoid infinite recursion, only print type erased version
- return appendErasedSignature(sb);
- }
-
- @Override
- public StringBuilder appendErasedSignature(StringBuilder sb) {
- return _appendErasedClassSignature(sb);
- }
-
- @Override
- public StringBuilder appendBriefDescription(StringBuilder sb) {
- return _appendClassDescription(sb);
- }
-
- @Override
- public StringBuilder appendFullDescription(StringBuilder sb)
- {
- // should never get called, but just in case, only print brief description
- return appendBriefDescription(sb);
- }
-}
diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/TypePlaceHolder.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/TypePlaceHolder.java
deleted file mode 100644
index 47157ecb6..000000000
--- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/TypePlaceHolder.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package com.fr.third.com.fasterxml.classmate.types;
-
-import java.util.*;
-
-import com.fr.third.com.fasterxml.classmate.ResolvedType;
-import com.fr.third.com.fasterxml.classmate.TypeBindings;
-
-/**
- * Placeholder used for resolving type assignments to figure out
- * type parameters for subtypes.
- */
-public class TypePlaceHolder extends ResolvedType
-{
- protected final int _ordinal;
-
- /**
- * Type assigned during wildcard resolution
- */
- protected ResolvedType _actualType;
-
- public TypePlaceHolder(int ordinal)
- {
- super(Object.class, TypeBindings.emptyBindings());
- _ordinal = ordinal;
- }
-
- @Override
- public boolean canCreateSubtypes() { return false; }
-
- public ResolvedType actualType() { return _actualType; }
- public void actualType(ResolvedType t) { _actualType = t; }
-
- /*
- /**********************************************************************
- /* Accessors for related types
- /**********************************************************************
- */
-
- @Override
- public ResolvedType getParentClass() { return null; }
-
- @Override
- public ResolvedType getSelfReferencedType() { return null; }
-
- @Override
- public List getImplementedInterfaces() { return Collections.emptyList(); }
-
- @Override
- public ResolvedType getArrayElementType() { return null; }
-
- /*
- /**********************************************************************
- /* Simple property accessors
- /**********************************************************************
- */
-
- @Override
- public boolean isInterface() { return false; }
-
- @Override
- public boolean isAbstract() { return true; }
-
- @Override
- public boolean isArray() { return false; }
-
- @Override
- public boolean isPrimitive() { return false; }
-
- /*
- /**********************************************************************
- /* Accessors for raw (minimally procesed) members
- /**********************************************************************
- */
-
- /*
- /**********************************************************************
- /* String representations
- /**********************************************************************
- */
-
- @Override
- public StringBuilder appendSignature(StringBuilder sb) {
- return _appendClassSignature(sb);
- }
-
- @Override
- public StringBuilder appendErasedSignature(StringBuilder sb) {
- return _appendErasedClassSignature(sb);
- }
-
- @Override
- public StringBuilder appendBriefDescription(StringBuilder sb) {
- sb.append('<').append(_ordinal).append('>');
- return sb;
- }
-
- @Override
- public StringBuilder appendFullDescription(StringBuilder sb) {
- return appendBriefDescription(sb);
- }
-}
diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/package-info.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/package-info.java
deleted file mode 100644
index e8da046d9..000000000
--- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/types/package-info.java
+++ /dev/null
@@ -1,5 +0,0 @@
-/**
- * Package that contains {@link com.fr.third.com.fasterxml.classmate.ResolvedType}
- * implementation classes.
- */
-package com.fr.third.com.fasterxml.classmate.types;
diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/ClassKey.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/ClassKey.java
deleted file mode 100644
index 402c005e0..000000000
--- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/ClassKey.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package com.fr.third.com.fasterxml.classmate.util;
-
-import java.io.Serializable;
-
-/**
- * Helper class used as key when we need efficient Class-to-value lookups.
- */
-@SuppressWarnings("serial")
-public class ClassKey
- implements Comparable, Serializable
-{
- private final String _className;
-
- private final Class> _class;
-
- /**
- * Let's cache hash code straight away, since we are almost certain to need it.
- */
- private final int _hashCode;
-
- public ClassKey(Class> clz)
- {
- _class = clz;
- _className = clz.getName();
- _hashCode = _className.hashCode();
- }
-
- /*
- /**********************************************************************
- /* Comparable
- /**********************************************************************
- */
-
- @Override
- public int compareTo(ClassKey other)
- {
- // Just need to sort by name, ok to collide (unless used in TreeMap/Set!)
- return _className.compareTo(other._className);
- }
-
- /*
- /**********************************************************************
- /* Standard methods
- /**********************************************************************
- */
-
- @Override
- public boolean equals(Object o)
- {
- if (o == this) return true;
- if (o == null) return false;
- if (o.getClass() != getClass()) return false;
- ClassKey other = (ClassKey) o;
-
- /* Is it possible to have different Class object for same name + class loader combo?
- * Let's assume answer is no: if this is wrong, will need to uncomment following functionality
- */
- /*
- return (other._className.equals(_className))
- && (other._class.getClassLoader() == _class.getClassLoader());
- */
- return other._class == _class;
- }
-
- @Override public int hashCode() { return _hashCode; }
-
- @Override public String toString() { return _className; }
-
-}
diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/ClassStack.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/ClassStack.java
deleted file mode 100644
index 4de5a5b09..000000000
--- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/ClassStack.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package com.fr.third.com.fasterxml.classmate.util;
-
-import java.util.ArrayList;
-
-import com.fr.third.com.fasterxml.classmate.ResolvedType;
-import com.fr.third.com.fasterxml.classmate.types.ResolvedRecursiveType;
-
-/**
- * Simple helper class used to keep track of 'call stack' for classes being referenced
- * (as well as unbound variables)
- */
-public final class ClassStack
-{
- protected final ClassStack _parent;
- protected final Class> _current;
-
- private ArrayList _selfRefs;
-
- public ClassStack(Class> rootType) {
- this(null, rootType);
- }
-
- private ClassStack(ClassStack parent, Class> curr) {
- _parent = parent;
- _current = curr;
- }
-
- /**
- * @return New stack frame, if addition is ok; null if not
- */
- public ClassStack child(Class> cls)
- {
- return new ClassStack(this, cls);
- }
-
- /**
- * Method called to indicate that there is a self-reference from
- * deeper down in stack pointing into type this stack frame represents.
- */
- public void addSelfReference(ResolvedRecursiveType ref)
- {
- if (_selfRefs == null) {
- _selfRefs = new ArrayList();
- }
- _selfRefs.add(ref);
- }
-
- /**
- * Method called when type that this stack frame represents is
- * fully resolved, allowing self-references to be completed
- * (if there are any)
- */
- public void resolveSelfReferences(ResolvedType resolved)
- {
- if (_selfRefs != null) {
- for (ResolvedRecursiveType ref : _selfRefs) {
- ref.setReference(resolved);
- }
- }
- }
-
- public ClassStack find(Class> cls)
- {
- if (_current == cls) return this;
- for (ClassStack curr = _parent; curr != null; curr = curr._parent) {
- if (curr._current == cls) {
- return curr;
- }
- }
- return null;
- }
-}
diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/MethodKey.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/MethodKey.java
deleted file mode 100644
index 94b309018..000000000
--- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/MethodKey.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package com.fr.third.com.fasterxml.classmate.util;
-
-import java.io.Serializable;
-
-/**
- * Helper class needed when storing methods in maps.
- * Immutable.
- */
-@SuppressWarnings("serial")
-public class MethodKey implements Serializable
-{
- private static final Class>[] NO_CLASSES = new Class[0];
-
- private final String _name;
-
- private final Class>[] _argumentTypes;
-
- private final int _hashCode;
-
- public MethodKey(String name)
- {
- _name = name;
- _argumentTypes = NO_CLASSES;
- _hashCode = name.hashCode();
- }
-
- public MethodKey(String name, Class>[] argTypes)
- {
- _name = name;
- _argumentTypes = argTypes;
- _hashCode = name.hashCode() + argTypes.length;
- }
-
- /*
- /**********************************************************************
- /* Standard methods
- /**********************************************************************
- */
-
- /**
- * Equality means name is the same and argument type erasures as well.
- */
- @Override public boolean equals(Object o)
- {
- if (o == this) return true;
- if (o == null || o.getClass() != getClass()) return false;
- MethodKey other = (MethodKey) o;
- Class>[] otherArgs = other._argumentTypes;
- int len = _argumentTypes.length;
- if (otherArgs.length != len) return false;
- for (int i = 0; i < len; ++i) {
- if (otherArgs[i] != _argumentTypes[i]) return false;
- }
- return _name.equals(other._name);
- }
-
- @Override public int hashCode() { return _hashCode; }
-
- @Override public String toString()
- {
- StringBuilder sb = new StringBuilder();
- sb.append(_name);
- sb.append('(');
- for (int i = 0, len = _argumentTypes.length; i < len; ++i) {
- if (i > 0) sb.append(',');
- sb.append(_argumentTypes[i].getName());
- }
- sb.append(')');
- return sb.toString();
- }
-}
diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/ResolvedTypeCache.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/ResolvedTypeCache.java
deleted file mode 100644
index 46847944b..000000000
--- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/ResolvedTypeCache.java
+++ /dev/null
@@ -1,141 +0,0 @@
-package com.fr.third.com.fasterxml.classmate.util;
-
-import java.io.Serializable;
-import java.util.*;
-
-import com.fr.third.com.fasterxml.classmate.ResolvedType;
-
-/**
- * Simple LRU cache used for storing up to specified number of most recently accessed
- * {@link ResolvedType} instances.
- * Since usage pattern is such that caller needs synchronization, cache access methods
- * are fully synchronized so that caller need not do explicit synchronization.
- */
-@SuppressWarnings("serial")
-public class ResolvedTypeCache implements Serializable
-{
- protected final CacheMap _map;
-
- public ResolvedTypeCache(int maxEntries) {
- _map = new CacheMap(maxEntries);
- }
-
- /**
- * Helper method for constructing reusable cache keys
- */
- public Key key(Class> simpleType) {
- return new Key(simpleType);
- }
-
- /**
- * Helper method for constructing reusable cache keys
- */
- public Key key(Class> simpleType, ResolvedType[] tp) {
- return new Key(simpleType, tp);
- }
-
- public synchronized ResolvedType find(Key key) {
- return _map.get(key);
- }
-
- public synchronized int size() {
- return _map.size();
- }
-
- public synchronized void put(Key key, ResolvedType type) {
- _map.put(key, type);
- }
-
- /*
- /**********************************************************************
- /* Methods for unit tests
- /**********************************************************************
- */
-
- public void add(ResolvedType type)
- {
- List tp = type.getTypeParameters();
- ResolvedType[] tpa = tp.toArray(new ResolvedType[tp.size()]);
- put(key(type.getErasedType(), tpa), type);
- }
-
- /*
- /**********************************************************************
- /* Helper classes
- /**********************************************************************
- */
-
- /**
- * Key used for type entries.
- */
- public static class Key
- {
- private final Class> _erasedType;
-
- private final ResolvedType[] _typeParameters;
-
- private final int _hashCode;
-
- public Key(Class> simpleType) {
- this(simpleType, null);
- }
-
- public Key(Class> erasedType, ResolvedType[] tp)
- {
- // let's not hold on type empty arrays
- if (tp != null && tp.length == 0) {
- tp = null;
- }
- _erasedType = erasedType;
- _typeParameters = tp;
- int h = erasedType.getName().hashCode();
- if (tp != null) {
- h += tp.length;
- }
- _hashCode = h;
- }
-
- @Override
- public int hashCode() { return _hashCode; }
-
- @Override
- public boolean equals(Object o)
- {
- if (o == this) return true;
- if (o == null || o.getClass() != getClass()) return false;
- Key other = (Key) o;
- if (other._erasedType != _erasedType) return false;
- ResolvedType[] otherTP = other._typeParameters;
- if (_typeParameters == null) {
- return (otherTP == null);
- }
- if (otherTP == null || otherTP.length != _typeParameters.length) {
- return false;
- }
- for (int i = 0, len = _typeParameters.length; i < len; ++i) {
- if (!_typeParameters[i].equals(otherTP[i])) {
- return false;
- }
- }
- return true;
- }
- }
-
- /**
- * Simple sub-class to get LRU cache
- */
- private final static class CacheMap
- extends LinkedHashMap
- {
- protected final int _maxEntries;
-
- public CacheMap(int maxEntries) {
- _maxEntries = maxEntries;
- }
-
- @Override
- protected boolean removeEldestEntry(Map.Entry eldest) {
- return size() > _maxEntries;
- }
- }
-}
diff --git a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/package-info.java b/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/package-info.java
deleted file mode 100644
index e82d06994..000000000
--- a/fine-classmate/src/main/java/com/fr/third/com/fasterxml/classmate/util/package-info.java
+++ /dev/null
@@ -1,4 +0,0 @@
-/**
- * Various utility classes used by ClassMate.
- */
-package com.fr.third.com.fasterxml.classmate.util;
diff --git a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/internal/SessionFactoryBuilderImpl.java b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/internal/SessionFactoryBuilderImpl.java
index 57a874a82..57a755ef9 100644
--- a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/internal/SessionFactoryBuilderImpl.java
+++ b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/internal/SessionFactoryBuilderImpl.java
@@ -483,6 +483,7 @@ public class SessionFactoryBuilderImpl implements SessionFactoryBuilderImplement
private Map querySubstitutions;
private boolean strictJpaQueryLanguageCompliance;
private boolean namedQueryStartupCheckingEnabled;
+ private boolean conventionalJavaConstants;
private final boolean procedureParameterNullPassingEnabled;
private final boolean collectionJoinSubqueryRewriteEnabled;
@@ -600,6 +601,8 @@ public class SessionFactoryBuilderImpl implements SessionFactoryBuilderImplement
this.querySubstitutions = ConfigurationHelper.toMap( QUERY_SUBSTITUTIONS, " ,=;:\n\t\r\f", configurationSettings );
this.strictJpaQueryLanguageCompliance = cfgService.getSetting( JPAQL_STRICT_COMPLIANCE, BOOLEAN, false );
this.namedQueryStartupCheckingEnabled = cfgService.getSetting( QUERY_STARTUP_CHECKING, BOOLEAN, true );
+ this.conventionalJavaConstants = cfgService.getSetting(
+ CONVENTIONAL_JAVA_CONSTANTS, BOOLEAN, true );
this.procedureParameterNullPassingEnabled = cfgService.getSetting( PROCEDURE_NULL_PARAM_PASSING, BOOLEAN, false );
this.collectionJoinSubqueryRewriteEnabled = cfgService.getSetting( COLLECTION_JOIN_SUBQUERY, BOOLEAN, true );
@@ -851,6 +854,11 @@ public class SessionFactoryBuilderImpl implements SessionFactoryBuilderImplement
return namedQueryStartupCheckingEnabled;
}
+ @Override
+ public boolean isConventionalJavaConstants() {
+ return conventionalJavaConstants;
+ }
+
@Override
public boolean isProcedureParameterNullPassingEnabled() {
return procedureParameterNullPassingEnabled;
@@ -1132,6 +1140,10 @@ public class SessionFactoryBuilderImpl implements SessionFactoryBuilderImplement
return options.isNamedQueryStartupCheckingEnabled();
}
+ @Override
+ public boolean isConventionalJavaConstants() {
+ return options.isConventionalJavaConstants();
+ }
@Override
public boolean isProcedureParameterNullPassingEnabled() {
return options.isProcedureParameterNullPassingEnabled();
diff --git a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/internal/SessionFactoryOptionsImpl.java b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/internal/SessionFactoryOptionsImpl.java
index ffaa7a149..f925b5cba 100644
--- a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/internal/SessionFactoryOptionsImpl.java
+++ b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/internal/SessionFactoryOptionsImpl.java
@@ -88,6 +88,9 @@ public class SessionFactoryOptionsImpl implements SessionFactoryOptions {
private final Map querySubstitutions;
private final boolean strictJpaQueryLanguageCompliance;
private final boolean namedQueryStartupCheckingEnabled;
+
+ private final boolean conventionalJavaConstants;
+
private final boolean procedureParameterNullPassingEnabled;
private final boolean collectionJoinSubqueryRewriteEnabled;
@@ -160,6 +163,7 @@ public class SessionFactoryOptionsImpl implements SessionFactoryOptions {
this.querySubstitutions = state.getQuerySubstitutions();
this.strictJpaQueryLanguageCompliance = state.isStrictJpaQueryLanguageCompliance();
this.namedQueryStartupCheckingEnabled = state.isNamedQueryStartupCheckingEnabled();
+ this.conventionalJavaConstants = state.isConventionalJavaConstants();
this.procedureParameterNullPassingEnabled = state.isProcedureParameterNullPassingEnabled();
this.collectionJoinSubqueryRewriteEnabled = state.isCollectionJoinSubqueryRewriteEnabled();
@@ -339,6 +343,11 @@ public class SessionFactoryOptionsImpl implements SessionFactoryOptions {
return namedQueryStartupCheckingEnabled;
}
+ @Override
+ public boolean isConventionalJavaConstants() {
+ return conventionalJavaConstants;
+ }
+
@Override
public boolean isProcedureParameterNullPassingEnabled() {
return procedureParameterNullPassingEnabled;
diff --git a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/internal/SessionFactoryOptionsState.java b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/internal/SessionFactoryOptionsState.java
index c73f94f8b..8835f3453 100644
--- a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/internal/SessionFactoryOptionsState.java
+++ b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/internal/SessionFactoryOptionsState.java
@@ -98,6 +98,8 @@ public interface SessionFactoryOptionsState {
boolean isNamedQueryStartupCheckingEnabled();
+ boolean isConventionalJavaConstants();
+
boolean isProcedureParameterNullPassingEnabled();
boolean isCollectionJoinSubqueryRewriteEnabled();
diff --git a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/spi/AbstractDelegatingSessionFactoryOptions.java b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/spi/AbstractDelegatingSessionFactoryOptions.java
index 3e8a7f603..97d723488 100644
--- a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/spi/AbstractDelegatingSessionFactoryOptions.java
+++ b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/spi/AbstractDelegatingSessionFactoryOptions.java
@@ -198,6 +198,11 @@ public abstract class AbstractDelegatingSessionFactoryOptions implements Session
return delegate.isNamedQueryStartupCheckingEnabled();
}
+ @Override
+ public boolean isConventionalJavaConstants() {
+ return delegate.isConventionalJavaConstants();
+ }
+
@Override
public boolean isProcedureParameterNullPassingEnabled() {
return delegate.isProcedureParameterNullPassingEnabled();
diff --git a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/spi/SessionFactoryOptions.java b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/spi/SessionFactoryOptions.java
index 7872aacb7..6c8972464 100644
--- a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/spi/SessionFactoryOptions.java
+++ b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/boot/spi/SessionFactoryOptions.java
@@ -122,6 +122,8 @@ public interface SessionFactoryOptions {
boolean isNamedQueryStartupCheckingEnabled();
+ boolean isConventionalJavaConstants();
+
boolean isSecondLevelCacheEnabled();
boolean isQueryCacheEnabled();
diff --git a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/cfg/AvailableSettings.java b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/cfg/AvailableSettings.java
index 0ac6a9122..80541d2f1 100644
--- a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/cfg/AvailableSettings.java
+++ b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/cfg/AvailableSettings.java
@@ -564,6 +564,17 @@ public interface AvailableSettings {
*/
String QUERY_STARTUP_CHECKING = "hibernate.query.startup_check";
+ /**
+ * Setting which indicates whether or not Java constant follow the Java Naming conventions.
+ *
+ * Default is {@code true}. Existing applications may want to disable this (set it {@code false}) if non-conventional Java constants are used.
+ * However, there is a significant performance overhead for using non-conventional Java constants since Hibernate cannot determine if aliases
+ * should be treated as Java constants or not.
+ *
+ * @since 5.2
+ */
+ String CONVENTIONAL_JAVA_CONSTANTS = "hibernate.query.conventional_java_constants";
+
/**
* The {@link com.fr.third.org.hibernate.exception.spi.SQLExceptionConverter} to use for converting SQLExceptions
* to Hibernate's JDBCException hierarchy. The default is to use the configured
diff --git a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/ast/QueryTranslatorImpl.java b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/ast/QueryTranslatorImpl.java
index e7968fcca..ab9c923a8 100644
--- a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/ast/QueryTranslatorImpl.java
+++ b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/ast/QueryTranslatorImpl.java
@@ -612,7 +612,7 @@ public class QueryTranslatorImpl implements FilterTranslator {
}
private void handleDotStructure(AST dotStructureRoot) {
final String expression = ASTUtil.getPathText( dotStructureRoot );
- final Object constant = ReflectHelper.getConstantValue( expression, factory.getServiceRegistry().getService( ClassLoaderService.class ) );
+ final Object constant = ReflectHelper.getConstantValue( expression, factory );
if ( constant != null ) {
dotStructureRoot.setFirstChild( null );
dotStructureRoot.setType( HqlTokenTypes.JAVA_CONSTANT );
diff --git a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/ast/tree/JavaConstantNode.java b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/ast/tree/JavaConstantNode.java
index 2f77663fd..5a678968e 100644
--- a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/ast/tree/JavaConstantNode.java
+++ b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/ast/tree/JavaConstantNode.java
@@ -39,7 +39,7 @@ public class JavaConstantNode extends Node implements ExpectedTypeAwareNode, Ses
// this method to get called twice. The first time with an empty string
if ( StringHelper.isNotEmpty( s ) ) {
constantExpression = s;
- constantValue = ReflectHelper.getConstantValue( s, factory.getServiceRegistry().getService( ClassLoaderService.class ) );
+ constantValue = ReflectHelper.getConstantValue( s, factory );
heuristicType = factory.getTypeResolver().heuristicType( constantValue.getClass().getName() );
super.setText( s );
}
diff --git a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/ast/util/LiteralProcessor.java b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/ast/util/LiteralProcessor.java
index c414c847f..6fb54838d 100644
--- a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/ast/util/LiteralProcessor.java
+++ b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/ast/util/LiteralProcessor.java
@@ -107,7 +107,7 @@ public class LiteralProcessor implements HqlSqlTokenTypes {
setSQLValue( node, text, discrim );
}
else {
- Object value = ReflectHelper.getConstantValue( text, walker.getSessionFactoryHelper().getFactory().getServiceRegistry().getService( ClassLoaderService.class ) );
+ Object value = ReflectHelper.getConstantValue( text, walker.getSessionFactoryHelper().getFactory() );
if ( value == null ) {
throw new InvalidPathException( "Invalid path: '" + text + "'" );
}
diff --git a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/classic/WhereParser.java b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/classic/WhereParser.java
index 618950829..7f22b82ee 100644
--- a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/classic/WhereParser.java
+++ b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/hql/internal/classic/WhereParser.java
@@ -419,7 +419,7 @@ public class WhereParser implements Parser {
Object constant;
if (
token.indexOf( '.' ) > -1 &&
- ( constant = ReflectHelper.getConstantValue( token, q.getFactory().getServiceRegistry().getService( ClassLoaderService.class ) ) ) != null
+ ( constant = ReflectHelper.getConstantValue( token, q.getFactory() ) ) != null
) {
Type type;
try {
diff --git a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/internal/util/ReflectHelper.java b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/internal/util/ReflectHelper.java
index bb9d5aa3a..819fc0358 100644
--- a/fine-hibernate/src/main/java/com/fr/third/org/hibernate/internal/util/ReflectHelper.java
+++ b/fine-hibernate/src/main/java/com/fr/third/org/hibernate/internal/util/ReflectHelper.java
@@ -13,12 +13,14 @@ import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Locale;
+import java.util.regex.Pattern;
import com.fr.third.org.hibernate.AssertionFailure;
import com.fr.third.org.hibernate.MappingException;
import com.fr.third.org.hibernate.PropertyNotFoundException;
import com.fr.third.org.hibernate.boot.registry.classloading.spi.ClassLoaderService;
import com.fr.third.org.hibernate.boot.registry.classloading.spi.ClassLoadingException;
+import com.fr.third.org.hibernate.engine.spi.SessionFactoryImplementor;
import com.fr.third.org.hibernate.property.access.internal.PropertyAccessStrategyMixedImpl;
import com.fr.third.org.hibernate.property.access.spi.Getter;
import com.fr.third.org.hibernate.type.PrimitiveType;
@@ -32,6 +34,8 @@ import com.fr.third.org.hibernate.type.Type;
*/
@SuppressWarnings("unchecked")
public final class ReflectHelper {
+ private static final Pattern JAVA_CONSTANT_PATTERN = Pattern.compile(
+ "[a-z\\d]+\\.([A-Z]+[a-z\\d]+)+\\$?([A-Z]{1}[a-z\\d]+)*\\.[A-Z_\\$]+", Pattern.UNICODE_CHARACTER_CLASS);
public static final Class[] NO_PARAM_SIGNATURE = new Class[0];
public static final Object[] NO_PARAMS = new Object[0];
@@ -229,9 +233,15 @@ public final class ReflectHelper {
return PropertyAccessStrategyMixedImpl.INSTANCE.buildPropertyAccess( clazz, name ).getGetter();
}
- public static Object getConstantValue(String name, ClassLoaderService classLoaderService) {
+ public static Object getConstantValue(String name, SessionFactoryImplementor factory) {
+ boolean conventionalJavaConstants = factory.getSessionFactoryOptions().isConventionalJavaConstants();
Class clazz;
try {
+ if ( conventionalJavaConstants &&
+ !JAVA_CONSTANT_PATTERN.matcher( name ).find() ) {
+ return null;
+ }
+ ClassLoaderService classLoaderService = factory.getServiceRegistry().getService( ClassLoaderService.class );
clazz = classLoaderService.classForName( StringHelper.qualifier( name ) );
}
catch ( Throwable t ) {
diff --git a/fine-jboss-logging/.gitignore b/fine-jboss-logging/.gitignore
deleted file mode 100644
index 5d453cd8b..000000000
--- a/fine-jboss-logging/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-*.iml
-.idea/
-.DS_Store
-.project
-.classpath
-*.gradle
\ No newline at end of file
diff --git a/fine-jboss-logging/README.md b/fine-jboss-logging/README.md
deleted file mode 100644
index 167a97c0d..000000000
--- a/fine-jboss-logging/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# fine-jboss-logging
-
-改包名的jboss-logging(3.3.0.Final),以下模块需要依赖该模块:
-
-- fine-hibernate
diff --git a/fine-jboss-logging/lib/jboss-logmanager-1.5.2.Final.jar b/fine-jboss-logging/lib/jboss-logmanager-1.5.2.Final.jar
deleted file mode 100644
index 7661371eb..000000000
Binary files a/fine-jboss-logging/lib/jboss-logmanager-1.5.2.Final.jar and /dev/null differ
diff --git a/fine-jboss-logging/lib/log4j-1.2.17.jar b/fine-jboss-logging/lib/log4j-1.2.17.jar
deleted file mode 100644
index 1d425cf7d..000000000
Binary files a/fine-jboss-logging/lib/log4j-1.2.17.jar and /dev/null differ
diff --git a/fine-jboss-logging/lib/log4j-api-2.5.jar b/fine-jboss-logging/lib/log4j-api-2.5.jar
deleted file mode 100644
index f18c9d063..000000000
Binary files a/fine-jboss-logging/lib/log4j-api-2.5.jar and /dev/null differ
diff --git a/fine-jboss-logging/lib/slf4j-api-1.7.2.jar b/fine-jboss-logging/lib/slf4j-api-1.7.2.jar
deleted file mode 100644
index 1a8870833..000000000
Binary files a/fine-jboss-logging/lib/slf4j-api-1.7.2.jar and /dev/null differ
diff --git a/fine-jboss-logging/pom.xml b/fine-jboss-logging/pom.xml
deleted file mode 100644
index 99db8427d..000000000
--- a/fine-jboss-logging/pom.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
- 4.0.0
-
-
- com.fr.third
- step3
- ${revision}
- ../base-third-project/base-third-step3
-
-
- fine-jboss-logging
- ${revision}
-
-
-
- com.fr.essential
- fine-slf4j-api
- ${essentialVersion}
-
-
- com.fr.essential
- fine-log4j2
- ${essentialVersion}
-
- 以下是lib的本地jar包依赖<-->
-
- com.fr.third
- jboss-logmanager
- local
- system
- ${basedir}/lib/jboss-logmanager-1.5.2.Final.jar
-
-
- com.fr.third
- log4j
- local
- system
- ${basedir}/lib/log4j-1.2.17.jar
-
-
- com.fr.third
- log4j-api
- local
- system
- ${basedir}/lib/log4j-api-2.5.jar
-
-
- com.fr.third
- slf4j-api
- local
- system
- ${basedir}/lib/slf4j-api-1.7.2.jar
-
-
-
\ No newline at end of file
diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/AbstractLoggerProvider.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/AbstractLoggerProvider.java
deleted file mode 100644
index c1012a259..000000000
--- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/AbstractLoggerProvider.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * Copyright 2010 Red Hat, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.fr.third.org.jboss.logging;
-
-import java.util.ArrayDeque;
-
-abstract class AbstractLoggerProvider {
-
- private final ThreadLocal> ndcStack = new ThreadLocal>();
-
- public void clearNdc() {
- ArrayDeque stack = ndcStack.get();
- if (stack != null)
- stack.clear();
- }
-
- public String getNdc() {
- ArrayDeque stack = ndcStack.get();
- return stack == null || stack.isEmpty() ? null : stack.peek().merged;
- }
-
- public int getNdcDepth() {
- ArrayDeque stack = ndcStack.get();
- return stack == null ? 0 : stack.size();
- }
-
- public String peekNdc() {
- ArrayDeque stack = ndcStack.get();
- return stack == null || stack.isEmpty() ? "" : stack.peek().current;
- }
-
- public String popNdc() {
- ArrayDeque stack = ndcStack.get();
- return stack == null || stack.isEmpty() ? "" : stack.pop().current;
- }
-
- public void pushNdc(String message) {
- ArrayDeque stack = ndcStack.get();
- if (stack == null) {
- stack = new ArrayDeque();
- ndcStack.set(stack);
- }
- stack.push(stack.isEmpty() ? new Entry(message) : new Entry(stack.peek(), message));
- }
-
- public void setNdcMaxDepth(int maxDepth) {
- final ArrayDeque stack = ndcStack.get();
- if (stack != null) while (stack.size() > maxDepth) stack.pop();
- }
-
- private static class Entry {
-
- private String merged;
- private String current;
-
- Entry(String current) {
- merged = current;
- this.current = current;
- }
-
- Entry(Entry parent, String current) {
- merged = parent.merged + ' ' + current;
- this.current = current;
- }
- }
-}
diff --git a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/AbstractMdcLoggerProvider.java b/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/AbstractMdcLoggerProvider.java
deleted file mode 100644
index 2935bca9d..000000000
--- a/fine-jboss-logging/src/main/java/com/fr/third/org/jboss/logging/AbstractMdcLoggerProvider.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * Copyright 2010 Red Hat, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.fr.third.org.jboss.logging;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-abstract class AbstractMdcLoggerProvider extends AbstractLoggerProvider {
-
- private final ThreadLocal