Skip to content

Commit 4fef094

Browse files
committed
add fastjson.asmEnable property config support
1 parent 67b2296 commit 4fef094

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/main/java/com/alibaba/fastjson/JSON.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,19 @@ private static void config(Properties properties) {
113113
}
114114

115115
{
116-
if ("true".equals(properties.getProperty("parser.features.ErrorOnEnumNotMatch"))) {
116+
if ("true".equals(properties.getProperty("parser.features.ErrorOnEnumNotMatch"))
117+
|| "true".equals(properties.getProperty("fastjson.parser.features.ErrorOnEnumNotMatch")))
118+
{
117119
DEFAULT_PARSER_FEATURE |= Feature.ErrorOnEnumNotMatch.getMask();
118120
}
119121
}
122+
123+
{
124+
if ("false".equals(properties.getProperty("fastjson.asmEnable"))) {
125+
ParserConfig.getGlobalInstance().setAsmEnable(false);
126+
SerializeConfig.getGlobalInstance().setAsmEnable(false);
127+
}
128+
}
120129
}
121130

122131
/**

0 commit comments

Comments
 (0)