DATACMNS-1097 - Polishing.
Updated Sonargraph architecture description. Polished imports in domain package to avoid unnecessary imports (mostly due to Javadoc references). Removed manually declared constructor in ExampleMatcherAccessor in favor of Lombok's @RequiredArgsConstructor. Removed deprecations in type information subsystem. Moved to different way of class loading to avoid null pointer warnings in ReflectionUtils.
This commit is contained in:
@@ -117,7 +117,6 @@ public class ClassTypeInformation<S> extends TypeDiscoverer<S> {
|
||||
return getTypeVariableMap(type, new HashSet<>());
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private static Map<TypeVariable<?>, Type> getTypeVariableMap(Class<?> type, Collection<Type> visited) {
|
||||
|
||||
if (visited.contains(type)) {
|
||||
|
||||
@@ -60,7 +60,7 @@ public class ReflectionUtils {
|
||||
public static <T> T createInstanceIfPresent(String classname, T defaultInstance) {
|
||||
|
||||
try {
|
||||
Class<?> type = ClassUtils.getDefaultClassLoader().loadClass(classname);
|
||||
Class<?> type = ClassUtils.forName(classname, ClassUtils.getDefaultClassLoader());
|
||||
return (T) BeanUtils.instantiateClass(type);
|
||||
} catch (Exception e) {
|
||||
return defaultInstance;
|
||||
|
||||
@@ -115,7 +115,7 @@ class TypeDiscoverer<S> implements TypeInformation<S> {
|
||||
* @param fieldType must not be {@literal null}.
|
||||
* @return
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unchecked", "deprecation" })
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
protected TypeInformation<?> createInfo(Type fieldType) {
|
||||
|
||||
Assert.notNull(fieldType, "Field type must not be null!");
|
||||
@@ -180,7 +180,7 @@ class TypeDiscoverer<S> implements TypeInformation<S> {
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
@SuppressWarnings({ "unchecked", "rawtypes", "deprecation" })
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
protected Class<S> resolveType(Type type) {
|
||||
|
||||
Map<TypeVariable, Type> map = new HashMap<>();
|
||||
|
||||
Reference in New Issue
Block a user