From bfece20395dfd1816e376d6af5b9b2a3e457e38e Mon Sep 17 00:00:00 2001 From: Mike Oertli Date: Thu, 21 Apr 2016 10:26:25 -0600 Subject: [PATCH 1/4] In DTEDRasterReader added check for null AVList before trying to use it, if null create a new empty AVListImpl. --- src/gov/nasa/worldwind/data/DTEDRasterReader.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gov/nasa/worldwind/data/DTEDRasterReader.java b/src/gov/nasa/worldwind/data/DTEDRasterReader.java index e632dfbb64..6ebb2723e6 100644 --- a/src/gov/nasa/worldwind/data/DTEDRasterReader.java +++ b/src/gov/nasa/worldwind/data/DTEDRasterReader.java @@ -43,6 +43,11 @@ protected boolean doCanRead(Object source, AVList params) return false; } + if (null == params) + { + params = new AVListImpl(); + } + // Assume that a proper suffix reliably identifies a DTED file. Otherwise the file will have to be loaded // to determine that, and there are often tens of thousands of DTED files, which causes raster server start-up // times to be excessive. From d0a3cd1f458a19cf2d852d891211eca616eb1471 Mon Sep 17 00:00:00 2001 From: Mike Oertli Date: Mon, 15 Aug 2016 08:35:49 -0600 Subject: [PATCH 2/4] Removed AVList instantiation, changed null check on params No longer instantiating a new AVList, slight tweak to the null check for the params list. --- src/gov/nasa/worldwind/data/DTEDRasterReader.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/gov/nasa/worldwind/data/DTEDRasterReader.java b/src/gov/nasa/worldwind/data/DTEDRasterReader.java index 6ebb2723e6..00339d0348 100644 --- a/src/gov/nasa/worldwind/data/DTEDRasterReader.java +++ b/src/gov/nasa/worldwind/data/DTEDRasterReader.java @@ -43,15 +43,10 @@ protected boolean doCanRead(Object source, AVList params) return false; } - if (null == params) - { - params = new AVListImpl(); - } - // Assume that a proper suffix reliably identifies a DTED file. Otherwise the file will have to be loaded // to determine that, and there are often tens of thousands of DTED files, which causes raster server start-up // times to be excessive. - if (this.canReadSuffix(source)) + if (this.canReadSuffix(source) && null != params) { params.setValue(AVKey.PIXEL_FORMAT, AVKey.ELEVATION); // we know that DTED is elevation data return true; From 821d9c1957446776e454baaa26db9221fa19ddb9 Mon Sep 17 00:00:00 2001 From: Mike Oertli Date: Mon, 15 Aug 2016 08:35:49 -0600 Subject: [PATCH 3/4] Revert "Removed AVList instantiation, changed null check on params" This reverts commit d0a3cd1f458a19cf2d852d891211eca616eb1471. --- src/gov/nasa/worldwind/data/DTEDRasterReader.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gov/nasa/worldwind/data/DTEDRasterReader.java b/src/gov/nasa/worldwind/data/DTEDRasterReader.java index 00339d0348..6ebb2723e6 100644 --- a/src/gov/nasa/worldwind/data/DTEDRasterReader.java +++ b/src/gov/nasa/worldwind/data/DTEDRasterReader.java @@ -43,10 +43,15 @@ protected boolean doCanRead(Object source, AVList params) return false; } + if (null == params) + { + params = new AVListImpl(); + } + // Assume that a proper suffix reliably identifies a DTED file. Otherwise the file will have to be loaded // to determine that, and there are often tens of thousands of DTED files, which causes raster server start-up // times to be excessive. - if (this.canReadSuffix(source) && null != params) + if (this.canReadSuffix(source)) { params.setValue(AVKey.PIXEL_FORMAT, AVKey.ELEVATION); // we know that DTED is elevation data return true; From f90f1d11a715f6ae905d9815ab8f5451abe618af Mon Sep 17 00:00:00 2001 From: Mike Oertli Date: Mon, 15 Aug 2016 08:57:04 -0600 Subject: [PATCH 4/4] Changed null check for params to simplify, removed AVList instantiation. --- src/gov/nasa/worldwind/data/DTEDRasterReader.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/gov/nasa/worldwind/data/DTEDRasterReader.java b/src/gov/nasa/worldwind/data/DTEDRasterReader.java index 6ebb2723e6..00339d0348 100644 --- a/src/gov/nasa/worldwind/data/DTEDRasterReader.java +++ b/src/gov/nasa/worldwind/data/DTEDRasterReader.java @@ -43,15 +43,10 @@ protected boolean doCanRead(Object source, AVList params) return false; } - if (null == params) - { - params = new AVListImpl(); - } - // Assume that a proper suffix reliably identifies a DTED file. Otherwise the file will have to be loaded // to determine that, and there are often tens of thousands of DTED files, which causes raster server start-up // times to be excessive. - if (this.canReadSuffix(source)) + if (this.canReadSuffix(source) && null != params) { params.setValue(AVKey.PIXEL_FORMAT, AVKey.ELEVATION); // we know that DTED is elevation data return true;