asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mb...@apache.org
Subject asterixdb git commit: Workaround JDK-8080094
Date Fri, 14 Oct 2016 00:37:51 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master 4d7899dd8 -> 03e44a573


Workaround JDK-8080094

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

Change-Id: I08b29ec0a219bbcba67cd433f2daea4e67fe5ca9
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1280
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Yingyi Bu <buyingyi@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/03e44a57
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/03e44a57
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/03e44a57

Branch: refs/heads/master
Commit: 03e44a5735d2891e67c0ba7e8e01140de98fc1c1
Parents: 4d7899d
Author: Michael Blow <mblow@apache.org>
Authored: Thu Oct 13 16:37:24 2016 -0400
Committer: Michael Blow <mblow@apache.org>
Committed: Thu Oct 13 17:37:17 2016 -0700

----------------------------------------------------------------------
 .../org/apache/asterix/api/http/servlet/APIServlet.java | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/03e44a57/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/APIServlet.java
----------------------------------------------------------------------
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..4e9bb25 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,17 @@ public class APIServlet extends HttpServlet {
             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) {
+                LOGGER.log(Level.WARNING, "NPE reading resource " + resourcePath
+                        + ", assuming JDK-8080094; returning 404", 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);


Mime
View raw message