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:
Romain Manni-Bucau 2015-11-27 12:41:31 +00:00
parent 1dd5571047
commit 19c6b4130d
1 changed files with 4 additions and 5 deletions

View File

@ -20,8 +20,7 @@ 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")));
@ -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) {