Skip to content

Commit

Permalink
feat:clear black list cache (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
leizhiyuan authored Apr 17, 2020
1 parent 97f59f8 commit 5560402
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions src/main/java/com/alipay/hessian/NameBlackListFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,5 +169,8 @@ protected boolean inBlackList(String className) {

public static void setAddBlackPrefixList(List<String> addBlackPrefixList) {
NameBlackListFilter.addBlackPrefixList = addBlackPrefixList;
if (resultOfInBlackList != null) {
resultOfInBlackList.clear();
}
}
}
16 changes: 8 additions & 8 deletions src/main/java/com/caucho/hessian/io/SerializerFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,14 @@ public Deserializer getDeserializer(String type)
if (type == null || type.equals(""))
return null;

if (classNameResolver != null) {
try {
type = classNameResolver.resolve(type);
} catch (Exception e) {
throw new HessianProtocolException(e);
}
}

Deserializer deserializer;

deserializer = (Deserializer) _cachedTypeDeserializerMap.get(type);
Expand All @@ -467,14 +475,6 @@ public Deserializer getDeserializer(String type)
if (deserializer != null)
return deserializer;

if (classNameResolver != null) {
try {
type = classNameResolver.resolve(type);
} catch (Exception e) {
throw new HessianProtocolException(e);
}
}

if (type.startsWith("[")) {
Deserializer subDeserializer = getDeserializer(type.substring(1));
deserializer = new ArrayDeserializer(subDeserializer);
Expand Down

0 comments on commit 5560402

Please sign in to comment.