mirror of https://github.com/apache/openjpa.git
better whitelist handling
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1716864 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1dd5571047
commit
19c6b4130d
|
@ -20,10 +20,9 @@ package org.apache.openjpa.util;
|
||||||
|
|
||||||
public class BlacklistClassResolver {
|
public class BlacklistClassResolver {
|
||||||
public static final BlacklistClassResolver DEFAULT = new BlacklistClassResolver(
|
public static final BlacklistClassResolver DEFAULT = new BlacklistClassResolver(
|
||||||
toArray(
|
toArray(System.getProperty(
|
||||||
System.getProperty(
|
"openjpa.serialization.class.blacklist",
|
||||||
"openjpa.serialization.class.blacklist",
|
"org.codehaus.groovy.runtime.,org.apache.commons.collections.functors.,org.apache.xalan")),
|
||||||
"org.codehaus.groovy.runtime.,org.apache.commons.collections.functors.,org.apache.xalan")),
|
|
||||||
toArray(System.getProperty("openjpa.serialization.class.whitelist")));
|
toArray(System.getProperty("openjpa.serialization.class.whitelist")));
|
||||||
|
|
||||||
private final String[] blacklist;
|
private final String[] blacklist;
|
||||||
|
@ -35,7 +34,7 @@ public class BlacklistClassResolver {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean isBlacklisted(final String name) {
|
protected boolean isBlacklisted(final String name) {
|
||||||
return !contains(whitelist, name) && contains(blacklist, name);
|
return (whitelist != null && !contains(whitelist, name)) || contains(blacklist, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final String check(final String name) {
|
public final String check(final String name) {
|
||||||
|
|
Loading…
Reference in New Issue