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:
Oliver Gierke
2017-07-05 18:02:49 +02:00
parent 1fc25727cf
commit 24704fc4de
7 changed files with 86 additions and 77 deletions

View File

@@ -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)) {

View File

@@ -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;

View File

@@ -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<>();