Polishing

This commit is contained in:
Juergen Hoeller
2016-09-26 18:19:04 +02:00
parent f2e1e1b890
commit d04567b99c
4 changed files with 26 additions and 29 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -50,13 +50,10 @@ public abstract class Conventions {
* when searching for the 'primary' interface of a proxy.
*/
private static final Set<Class<?>> IGNORED_INTERFACES;
static {
IGNORED_INTERFACES = Collections.unmodifiableSet(
new HashSet<Class<?>>(Arrays.<Class<?>> asList(
Serializable.class,
Externalizable.class,
Cloneable.class,
Comparable.class)));
IGNORED_INTERFACES = Collections.unmodifiableSet(new HashSet<Class<?>>(Arrays.<Class<?>>asList(
Serializable.class, Externalizable.class, Cloneable.class, Comparable.class)));
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -54,8 +54,8 @@ public class InstanceFilter<T> {
public InstanceFilter(Collection<? extends T> includes,
Collection<? extends T> excludes, boolean matchIfEmpty) {
this.includes = includes != null ? includes : Collections.<T>emptyList();
this.excludes = excludes != null ? excludes : Collections.<T>emptyList();
this.includes = (includes != null ? includes : Collections.<T>emptyList());
this.excludes = (excludes != null ? excludes : Collections.<T>emptyList());
this.matchIfEmpty = matchIfEmpty;
}
@@ -64,7 +64,7 @@ public class InstanceFilter<T> {
* Determine if the specified {code instance} matches this filter.
*/
public boolean match(T instance) {
Assert.notNull(instance, "The instance to match is mandatory");
Assert.notNull(instance, "Instance to match must not be null");
boolean includesSet = !this.includes.isEmpty();
boolean excludesSet = !this.excludes.isEmpty();
@@ -74,11 +74,9 @@ public class InstanceFilter<T> {
boolean matchIncludes = match(instance, this.includes);
boolean matchExcludes = match(instance, this.excludes);
if (!includesSet) {
return !matchExcludes;
}
if (!excludesSet) {
return matchIncludes;
}