diff --git a/parser/src/main/java/org/dna/mqtt/moquette/messaging/spi/impl/SubscriptionsStore.java b/parser/src/main/java/org/dna/mqtt/moquette/messaging/spi/impl/SubscriptionsStore.java index f1335450..2a041da7 100644 --- a/parser/src/main/java/org/dna/mqtt/moquette/messaging/spi/impl/SubscriptionsStore.java +++ b/parser/src/main/java/org/dna/mqtt/moquette/messaging/spi/impl/SubscriptionsStore.java @@ -78,6 +78,10 @@ public class SubscriptionsStore { //check the matching of the current token //TODO take care of MULTI and SINGLE +// if (m_token == Token.MULTI) { +// matchingSubs.addAll(m_subscriptions); +// return; +// } List matchingChildren = new ArrayList(); for (TreeNode child : m_children) { @@ -86,12 +90,16 @@ public class SubscriptionsStore { } } - if (matchingChildren.isEmpty()) { - return; - } +// if (matchingChildren.isEmpty()) { +// return; +// } for (TreeNode child : matchingChildren) { - child.matches(tokens, matchingSubs); + if (child.getToken() == Token.MULTI) { + matchingSubs.addAll(m_subscriptions); + } else { + child.matches(tokens, matchingSubs); + } } } @@ -165,6 +173,11 @@ public class SubscriptionsStore { } return true; } + + @Override + public String toString() { + return name; + } } // private List subscriptions = new ArrayList();