Browse Source

todos and cleaned up warnings

Mike Megally 9 years ago
parent
commit
6cbf60ca4b

+ 1 - 1
frameworks/Java/undertow-jersey/src/main/java/hello/FortunesResource.java

@@ -23,7 +23,7 @@ public class FortunesResource
   public Viewable fortunes()
   public Viewable fortunes()
   {
   {
     final Session session = sessionFactory.openSession();
     final Session session = sessionFactory.openSession();
-    final List fortunes = new ArrayList(
+    final List<Fortune> fortunes = new ArrayList<>(
         session.createCriteria(Fortune.class).list());
         session.createCriteria(Fortune.class).list());
     fortunes.add(new Fortune(0, "Additional fortune added at request time."));
     fortunes.add(new Fortune(0, "Additional fortune added at request time."));
     Collections.sort(fortunes);
     Collections.sort(fortunes);

+ 6 - 3
frameworks/Java/undertow-jersey/src/main/java/hello/undertow/UndertowContainerResponseWriter.java

@@ -24,7 +24,7 @@ public class UndertowContainerResponseWriter
   public OutputStream writeResponseStatusAndHeaders(long contentLength,
   public OutputStream writeResponseStatusAndHeaders(long contentLength,
       ContainerResponse responseContext) throws ContainerException
       ContainerResponse responseContext) throws ContainerException
   {
   {
-    httpServerExchange.setResponseCode(responseContext.getStatus());
+    httpServerExchange.setStatusCode(responseContext.getStatus());
 
 
     for (Map.Entry<String, List<String>> mapEntry : responseContext.getStringHeaders().entrySet())
     for (Map.Entry<String, List<String>> mapEntry : responseContext.getStringHeaders().entrySet())
     {
     {
@@ -40,6 +40,7 @@ public class UndertowContainerResponseWriter
   public boolean suspend(long timeOut, TimeUnit timeUnit,
   public boolean suspend(long timeOut, TimeUnit timeUnit,
       TimeoutHandler timeoutHandler)
       TimeoutHandler timeoutHandler)
   {
   {
+    // TODO implement
     return false;
     return false;
   }
   }
 
 
@@ -47,7 +48,7 @@ public class UndertowContainerResponseWriter
   public void setSuspendTimeout(long timeOut, TimeUnit timeUnit)
   public void setSuspendTimeout(long timeOut, TimeUnit timeUnit)
       throws IllegalStateException
       throws IllegalStateException
   {
   {
-    //        Util.l("suspendtimeout");
+    //TODO implement
   }
   }
 
 
   @Override
   @Override
@@ -59,7 +60,8 @@ public class UndertowContainerResponseWriter
   @Override
   @Override
   public void failure(Throwable error)
   public void failure(Throwable error)
   {
   {
-    httpServerExchange.setResponseCode(500);
+    // TODO don't print out
+    httpServerExchange.setStatusCode(500);
     httpServerExchange.endExchange();
     httpServerExchange.endExchange();
     error.printStackTrace();
     error.printStackTrace();
   }
   }
@@ -67,6 +69,7 @@ public class UndertowContainerResponseWriter
   @Override
   @Override
   public boolean enableResponseBuffering()
   public boolean enableResponseBuffering()
   {
   {
+    // TODO not sure
     return false;
     return false;
   }
   }
 }
 }