This commit is contained in:
Redkale
2020-06-15 20:57:59 +08:00
parent c43325e402
commit 02d0a06195
2 changed files with 17 additions and 5 deletions

View File

@@ -175,8 +175,9 @@ public final class ClassFilter<T> {
}
if (!r && ors != null) {
for (ClassFilter filter : ors) {
if (filter.accept(property, clazzname)) {
if (filter.accept(filter.conf, clazzname)) {
cf = filter;
property = cf.conf;
break;
}
}
@@ -189,11 +190,11 @@ public final class ClassFilter<T> {
if (property == null) {
property = cf.conf;
} else if (property instanceof DefaultAnyValue) {
((DefaultAnyValue) property).addAll(cf.conf);
((DefaultAnyValue) property).addAllStringSet(cf.conf);
} else {
DefaultAnyValue dav = new DefaultAnyValue();
dav.addAll(property);
dav.addAll(cf.conf);
dav.addAllStringSet(property);
dav.addAllStringSet(cf.conf);
property = dav;
}
}
@@ -243,7 +244,7 @@ public final class ClassFilter<T> {
}
if (!r && ors != null) {
for (ClassFilter filter : ors) {
if (filter.accept(property, classname)) return true;
if (filter.accept(filter.conf, classname)) return true;
}
}
return r;

View File

@@ -129,6 +129,17 @@ public abstract class AnyValue {
return rs;
}
//去重
public DefaultAnyValue addAllStringSet(final AnyValue av) {
if (av == null) return this;
final Entry<String>[] strings = av.getStringEntrys();
if (strings == null) return this;
for (Entry<String> en : strings) {
if (getValue(en.name) == null) this.addValue(en.name, en.value);
}
return this;
}
public DefaultAnyValue addAll(final AnyValue av) {
if (av == null) return this;
if (av instanceof DefaultAnyValue) {