Michael Blow has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/1280

Change subject: Workaround JDK-8080094
......................................................................

Workaround JDK-8080094

NPE enountered if http://<server>:19001/webui is requested

Change-Id: I08b29ec0a219bbcba67cd433f2daea4e67fe5ca9
---
M 
asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/APIServlet.java
1 file changed, 9 insertions(+), 1 deletion(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/80/1280/1

diff --git 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/APIServlet.java
 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/APIServlet.java
index f32e451..860ec6f 100644
--- 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/APIServlet.java
+++ 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/APIServlet.java
@@ -177,7 +177,15 @@
             InputStreamReader isr = new InputStreamReader(is);
             StringBuilder sb = new StringBuilder();
             BufferedReader br = new BufferedReader(isr);
-            String line = br.readLine();
+            String line;
+            try {
+                line = br.readLine();
+            } catch (NullPointerException e) {
+                // workaround lame JDK bug where a broken InputStream is 
returned in case the resourcePath is a
+                // directory; see 
https://bugs.openjdk.java.net/browse/JDK-8080094
+                response.sendError(HttpServletResponse.SC_NOT_FOUND);
+                return;
+            }
 
             while (line != null) {
                 sb.append(line);

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1280
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I08b29ec0a219bbcba67cd433f2daea4e67fe5ca9
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow <mb...@apache.org>

Reply via email to