Github user kl0u commented on a diff in the pull request: https://github.com/apache/flink/pull/3477#discussion_r105701064 --- Diff: flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/SharedBuffer.java --- @@ -217,23 +217,22 @@ public void prune(long pruningTimestamp) { // use a depth first search to reconstruct the previous relations while (!extractionStates.isEmpty()) { ExtractionState<K, V> extractionState = extractionStates.pop(); - DeweyNumber currentVersion = extractionState.getVersion(); // current path of the depth first search Stack<SharedBufferEntry<K, V>> currentPath = extractionState.getPath(); // termination criterion - if (currentVersion.length() == 1) { - LinkedHashMultimap<K, V> completePath = LinkedHashMultimap.create(); + if (extractionState.getEntry() == null) { + final LinkedHashMultimap<K, V> completePath = LinkedHashMultimap.create(); while(!currentPath.isEmpty()) { - SharedBufferEntry<K, V> currentEntry = currentPath.pop(); + final SharedBufferEntry<K, V> currentEntry = currentPath.pop(); completePath.put(currentEntry.getKey(), currentEntry.getValueTime().getValue()); } result.add(completePath); } else { - SharedBufferEntry<K, V> currentEntry = extractionState.getEntry(); --- End diff -- The `SharedBufferEntry<K, V> currentEntry = extractionState.getEntry();` can be moved outside the for-loop right?
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---