Skip to content

Commit a096580

Browse files
vsairzhouxinyu
authored andcommitted
[ROCKETMQ-351] Add a default value to expressionType and polish the judgement. (apache#214)
1 parent d849e0a commit a096580

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

common/src/main/java/org/apache/rocketmq/common/filter/ExpressionType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public class ExpressionType {
5959
public static final String TAG = "TAG";
6060

6161
public static boolean isTagType(String type) {
62-
if (type == null || TAG.equals(type)) {
62+
if (type == null || "".equals(type) || TAG.equals(type)) {
6363
return true;
6464
}
6565
return false;

common/src/main/java/org/apache/rocketmq/common/protocol/heartbeat/SubscriptionData.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
package org.apache.rocketmq.common.protocol.heartbeat;
2222

2323
import com.alibaba.fastjson.annotation.JSONField;
24+
import org.apache.rocketmq.common.filter.ExpressionType;
25+
2426
import java.util.HashSet;
2527
import java.util.Set;
2628

@@ -32,7 +34,7 @@ public class SubscriptionData implements Comparable<SubscriptionData> {
3234
private Set<String> tagsSet = new HashSet<String>();
3335
private Set<Integer> codeSet = new HashSet<Integer>();
3436
private long subVersion = System.currentTimeMillis();
35-
private String expressionType;
37+
private String expressionType = ExpressionType.TAG;
3638

3739
@JSONField(serialize = false)
3840
private String filterClassSource;

0 commit comments

Comments
 (0)