Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
add whitelist
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed Sep 19, 2019
1 parent 9b88c77 commit 37d4f92
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/main/java/com/alibaba/fastjson/util/TypeUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -1527,6 +1527,14 @@ private static void addBaseClassMappings(){
"org.springframework.security.oauth2.common.DefaultOAuth2AccessToken",
"org.springframework.security.oauth2.common.DefaultOAuth2RefreshToken",
"org.springframework.cache.support.NullValue",
"org.springframework.jdbc.UncategorizedSQLException",
"org.springframework.dao.CannotAcquireLockException",
"org.springframework.dao.DuplicateKeyException",
"org.springframework.dao.QueryTimeoutException",
"org.springframework.dao.TransientDataAccessException",
"org.springframework.dao.TypeMismatchDataAccessException",
"org.springframework.dao.UncategorizedDataAccessException",
"org.springframework.dao.DataAccessResourceFailureException",
};
for(String className : spring){
Class<?> clazz = loadClass(className);
Expand All @@ -1535,6 +1543,18 @@ private static void addBaseClassMappings(){
}
mappings.put(clazz.getName(), clazz);
}

String[] sofa = new String[] {
"com.alipay.sofa.rpc.core.exception.SofaTimeOutException",
};

for(String className : sofa){
Class<?> clazz = loadClass(className);
if(clazz == null){
continue;
}
mappings.put(clazz.getName(), clazz);
}
}

public static void clearClassMapping(){
Expand Down

0 comments on commit 37d4f92

Please sign in to comment.