From 31f7c5d9207f606967e8e7a456d3140c81ff9329 Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Fri, 5 Jan 2018 13:48:31 -0500 Subject: [PATCH] Workaround #155. --- .../cuny/hunter/streamrefactoring/core/analysis/Stream.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/edu.cuny.hunter.streamrefactoring.core/src/edu/cuny/hunter/streamrefactoring/core/analysis/Stream.java b/edu.cuny.hunter.streamrefactoring.core/src/edu/cuny/hunter/streamrefactoring/core/analysis/Stream.java index 13a9fda4..8e671f72 100644 --- a/edu.cuny.hunter.streamrefactoring.core/src/edu/cuny/hunter/streamrefactoring/core/analysis/Stream.java +++ b/edu.cuny.hunter.streamrefactoring.core/src/edu/cuny/hunter/streamrefactoring/core/analysis/Stream.java @@ -589,6 +589,12 @@ private void inferInitialOrdering(EclipseProjectAnalysisEngine engi // get the use value number for the stream creation. int valueNumber = getUseValueNumberForCreation(engine); + if (valueNumber < 0) { + LOGGER.warning("Use value number: " + valueNumber + " for stream creation: " + + this.getCreation().getName() + " is invalid. Most likely #155."); + throw new UnhandledCaseException("Encountered unhandled case, most likely an embedded stream."); + } + // get the enclosing method node. CGNode node = null; try {