]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.maps.elevation.server/src/org/simantics/maps/elevation/server/TiffInterface.java
Fixed most warnings from district codebase after JavaSE-11 switch
[simantics/district.git] / org.simantics.maps.elevation.server / src / org / simantics / maps / elevation / server / TiffInterface.java
index 60d7e5650a0c20e3addfdb195427922fe9508ee0..c3a27a4f04e754aeddf1f96b89eea85ae02cdef9 100644 (file)
@@ -1,6 +1,7 @@
 package org.simantics.maps.elevation.server;
 
 import java.awt.image.DataBuffer;
+import java.io.Closeable;
 import java.nio.file.Path;
 
 import org.geotools.coverage.grid.GridCoverage2D;
@@ -14,7 +15,7 @@ import org.simantics.maps.elevation.server.prefs.MapsElevationServerPreferences;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class TiffInterface {
+public class TiffInterface implements Closeable {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(TiffInterface.class);
 
@@ -66,21 +67,21 @@ public class TiffInterface {
             case DataBuffer.TYPE_BYTE: {
                 // TODO: if the result is byte how does one subtract the pipeDepth form the value?
                 // Might not be even relevant with this use case 
-                return new Byte(((byte[]) r)[0]);
+                return Byte.valueOf(((byte[]) r)[0]);
             }
             case DataBuffer.TYPE_SHORT:  // Fall through
             case DataBuffer.TYPE_USHORT: // Fall through
             case DataBuffer.TYPE_INT: {
                 int val = ((int[]) r)[0] - pipeDepthUnderGround;
-                return new Integer(val);
+                return Integer.valueOf(val);
             }
             case DataBuffer.TYPE_FLOAT: {
                 float val = ((float[]) r)[0] - pipeDepthUnderGround;
-                return new Float(val);
+                return Float.valueOf(val);
             }
             case DataBuffer.TYPE_DOUBLE: {
                 double val = ((double[]) r)[0] - pipeDepthUnderGround;
-                return new Double(val);
+                return Double.valueOf(val);
             }
             default: return null;
         }