cleanup
authorAndreas Müller <a.mueller@bgbm.org>
Thu, 14 Jul 2022 07:35:42 +0000 (09:35 +0200)
committerAndreas Müller <a.mueller@bgbm.org>
Thu, 14 Jul 2022 07:35:42 +0000 (09:35 +0200)
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/view/JsonView.java
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/servlet/DateHeaderFilter.java

index b6dbe62088992fc2b07bd96c9c06b48c64dea727..0e47f4e20975ed14e07d1c1b9291b1133a0beece 100644 (file)
@@ -149,7 +149,7 @@ public class JsonView extends BaseView implements View {
 
             if(type.equals(Type.XML)){
                 XMLSerializer xmlSerializer = new XMLSerializer();
-                if(isCollectionType){
+                if(isCollectionType && entity != null){  //can never be null here but there is an IDE warning otherwise
                     xmlSerializer.setArrayName(entity.getClass().getSimpleName());
                     Class<?> elementType = Object.class;
                     Collection<?> c = (Collection<?>)entity;
index 9c09e16cfb231bf41d7d25ddfe22ba1312eae6b5..03520bb79810ed2f987bfacd51739aa0d9b942ea 100644 (file)
@@ -47,7 +47,7 @@ public class DateHeaderFilter implements Filter {
 
         try {
             OffsetDateTime dateTime = OffsetDateTime.now();
-            // from chain.doFilter() NestedServletExceptions with NPEs may bubble up from
+            // from chain.doFilter() NestedServletExceptions with NPEs may bubble up
             // from controller methods which miss proper handling of not found entities or the like
             // (HTTP 404 : uuid not found)
             // These situations are caught below and logged at info level for debugging purposes