Author: aaime
Date: 2009-07-09 03:06:26 -0400 (Thu, 09 Jul 2009)
New Revision: 33533
Added:
branches/2.5.x/modules/library/render/src/test/java/org/geotools/map/
branches/2.5.x/modules/library/render/src/test/java/org/geotools/map/DefaultMapContextTest.java
Removed:
branches/2.5.x/modules/library/render/src/test/java/org/geotools/map/DefaultMapContextTest.java
Modified:
branches/2.5.x/modules/library/render/
branches/2.5.x/modules/library/render/src/main/java/org/geotools/map/DefaultMapContext.java
Log:
GEOT-2600 NullPointerException if MapLayer.getBounds returns null
Property changes on: branches/2.5.x/modules/library/render
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/modules/library/render:33392,33457,33475
+ /trunk/modules/library/render:33392,33457,33475,33532
Modified: branches/2.5.x/modules/library/render/src/main/java/org/geotools/map/DefaultMapContext.java
===================================================================
--- branches/2.5.x/modules/library/render/src/main/java/org/geotools/map/DefaultMapContext.java 2009-07-09 07:02:51 UTC (rev 33532)
+++ branches/2.5.x/modules/library/render/src/main/java/org/geotools/map/DefaultMapContext.java 2009-07-09 07:06:26 UTC (rev 33533)
@@ -558,12 +558,11 @@
env = new ReferencedEnvelope(fs.getBounds(), sourceCrs);*/
env = layer.getBounds();
- sourceCrs = env.getCoordinateReferenceSystem();
if (env == null) {
continue;
} else {
try {
-
+ sourceCrs = env.getCoordinateReferenceSystem();
if ((sourceCrs != null)
&& (crs != null)
&& !CRS.equalsIgnoreMetadata(sourceCrs,
Deleted: branches/2.5.x/modules/library/render/src/test/java/org/geotools/map/DefaultMapContextTest.java
===================================================================
--- trunk/modules/library/render/src/test/java/org/geotools/map/DefaultMapContextTest.java 2009-07-09 07:02:51 UTC (rev 33532)
+++ branches/2.5.x/modules/library/render/src/test/java/org/geotools/map/DefaultMapContextTest.java 2009-07-09 07:06:26 UTC (rev 33533)
@@ -1,33 +0,0 @@
-package org.geotools.map;
-
-
-import static org.easymock.EasyMock.*;
-
-import java.io.IOException;
-
-import org.geotools.referencing.crs.DefaultGeographicCRS;
-import org.junit.Test;
-
-public class DefaultMapContextTest {
-
- MapLayer mapLayerBoundsNull = createNiceMock(MapLayer.class);
-
- /**
- * if a {@link MapLayer#getBounds()} returns null a NullPointerException will be thrown
- */
- @Test
- public void testNPELayerBounds() {
- expect(mapLayerBoundsNull.getBounds()).andReturn(null);
-
- replay(mapLayerBoundsNull);
-
- DefaultMapContext mapContext = new DefaultMapContext(DefaultGeographicCRS.WGS84);
- try {
- mapContext.addLayer(mapLayerBoundsNull);
- // throws a NullPointerException
- mapContext.getLayerBounds();
- } catch (IOException e) {
- // don't care about is right here
- }
- }
-}
Copied: branches/2.5.x/modules/library/render/src/test/java/org/geotools/map/DefaultMapContextTest.java (from rev 33532, trunk/modules/library/render/src/test/java/org/geotools/map/DefaultMapContextTest.java)
===================================================================
--- branches/2.5.x/modules/library/render/src/test/java/org/geotools/map/DefaultMapContextTest.java (rev 0)
+++ branches/2.5.x/modules/library/render/src/test/java/org/geotools/map/DefaultMapContextTest.java 2009-07-09 07:06:26 UTC (rev 33533)
@@ -0,0 +1,33 @@
+package org.geotools.map;
+
+
+import static org.easymock.EasyMock.*;
+
+import java.io.IOException;
+
+import org.geotools.referencing.crs.DefaultGeographicCRS;
+import org.junit.Test;
+
+public class DefaultMapContextTest {
+
+ MapLayer mapLayerBoundsNull = createNiceMock(MapLayer.class);
+
+ /**
+ * if a {@link MapLayer#getBounds()} returns null a NullPointerException will be thrown
+ */
+ @Test
+ public void testNPELayerBounds() {
+ expect(mapLayerBoundsNull.getBounds()).andReturn(null);
+
+ replay(mapLayerBoundsNull);
+
+ DefaultMapContext mapContext = new DefaultMapContext(DefaultGeographicCRS.WGS84);
+ try {
+ mapContext.addLayer(mapLayerBoundsNull);
+ // throws a NullPointerException
+ mapContext.getLayerBounds();
+ } catch (IOException e) {
+ // don't care about is right here
+ }
+ }
+}
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at:
http://p.sf.net/sfu/Challenge_______________________________________________
GeoTools-commits mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-commits