@@ -47,8 +47,10 @@ public static void checkParam(String eventName, Map<String, Object> properties)
4747 continue ;
4848 }
4949 }
50- if (property .getValue () == null )
50+ if (property .getValue () == null ){
51+ System .out .println (String .format ("Warn: The property %s value is null." , property .getKey ()));
5152 continue ;
53+ }
5254 try {
5355 if (property != null )
5456 checkParamImpl (eventName , property );
@@ -70,6 +72,7 @@ private static boolean checkParamImpl(String eventName, Map.Entry<String, Object
7072 int valueListLen = 100 ;
7173 String piEventName = "$profile_increment" ;
7274 String paEventName = "$profile_append" ;
75+ String puEventName = "$profile_unset" ;
7376 //key约束 符合java命名规则: 开头约束:字母或者$ 字符类型:大小写字母、数字、下划线和 $ 最大长度125字符
7477 if (property .getKey ().length () > keyLength ) {
7578 System .out .println (String .format ("Warn: The property key %s is too long, max length is %s." , property .getKey (), keyLength ));
@@ -85,8 +88,10 @@ private static boolean checkParamImpl(String eventName, Map.Entry<String, Object
8588 System .out .println (String .format ("Warn: The property %s is not Number, String, Boolean, List<String>." , property .getKey ()));
8689 }
8790 if (property .getValue () instanceof String && property .getValue ().toString ().length () == 0 ) {
91+ if (!puEventName .equals (eventName )) {
8892 System .out .println (String .format ("Warn: The property %s String value is null or empty." , property .getKey ()));
8993 }
94+ }
9095 if (property .getValue () instanceof String && property .getValue ().toString ().length () > valueWarnLength ) {
9196 System .out .println (String .format ("Warn: The property %s String value is too long, max length is %s." , property .getKey (), valueWarnLength ));
9297 }
0 commit comments