Revision: 6086
http://sourceforge.net/p/jump-pilot/code/6086
Author: edso
Date: 2019-01-17 14:03:09 +0000 (Thu, 17 Jan 2019)
Log Message:
-----------
remove
state=null
to prevent NPE preventing loading datasets after one error occured
Modified Paths:
--------------
core/trunk/src/org/geotools/shapefile/Shapefile.java
Modified: core/trunk/src/org/geotools/shapefile/Shapefile.java
===================================================================
--- core/trunk/src/org/geotools/shapefile/Shapefile.java 2019-01-17
11:10:54 UTC (rev 6085)
+++ core/trunk/src/org/geotools/shapefile/Shapefile.java 2019-01-17
14:03:09 UTC (rev 6086)
@@ -85,16 +85,17 @@
}
private EndianDataInputStream getInputStream() throws IOException {
- try {
+ if (shpInputStream == null && baseURL != null) {
+ try {
URLConnection uc = baseURL.openConnection();
// a 16 kb buffer may be up to 20% faster than the default 2 kb
buffer
- shpInputStream = new BufferedInputStream(uc.getInputStream(),
16*1024);
- }
- catch (Exception e){
+ shpInputStream = new BufferedInputStream(uc.getInputStream(), 16 *
1024);
+ } catch (Exception e) {
Logger.error(e);
- }
- if (shpInputStream == null) {
+ }
+ if (shpInputStream == null) {
throw new IOException("Couldn't make a connection to the URL: " +
baseURL);
+ }
}
return new EndianDataInputStream(shpInputStream);
}
_______________________________________________
Jump-pilot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel