fix setLocation to always map EOFError
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@941554 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/shell/Closure.java b/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/shell/Closure.java
index 6110be1..5fcae56 100644
--- a/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/shell/Closure.java
+++ b/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/shell/Closure.java
@@ -64,7 +64,7 @@
throw setLocation(e);
}
}
-
+
public CommandSessionImpl session()
{
return session;
@@ -81,13 +81,6 @@
{
SyntaxError se = (SyntaxError) e;
loc += se.line() + "." + se.column();
-
- if (e instanceof EOFError)
- { // map to public exception, so interactive clients can provide more input
- EOFException eofe = new EOFException(e.getMessage());
- eofe.initCause(e);
- e = eofe;
- }
}
else if (null != errTok)
{
@@ -102,6 +95,13 @@
}
session.put(LOCATION, location.get());
+
+ if (e instanceof EOFError)
+ { // map to public exception, so interactive clients can provide more input
+ EOFException eofe = new EOFException(e.getMessage());
+ eofe.initCause(e);
+ return eofe;
+ }
return e;
}