Commit 87cf6a6c authored by Riegel's avatar Riegel
Browse files

Refactor: Extract EPSG-parsing error logger to method

2 merge requests!28Version 3.17.0 Release,!26Add ZIP-archive support
Showing with 10 additions and 17 deletions
+10 -17
...@@ -18,11 +18,7 @@ ...@@ -18,11 +18,7 @@
*/ */
package de.hft.stuttgart.citydoctor2.parser; package de.hft.stuttgart.citydoctor2.parser;
import java.io.BufferedInputStream; import java.io.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
...@@ -71,10 +67,7 @@ import org.locationtech.proj4j.CoordinateReferenceSystem; ...@@ -71,10 +67,7 @@ import org.locationtech.proj4j.CoordinateReferenceSystem;
import org.locationtech.proj4j.ProjCoordinate; import org.locationtech.proj4j.ProjCoordinate;
import org.locationtech.proj4j.proj.Projection; import org.locationtech.proj4j.proj.Projection;
import org.locationtech.proj4j.units.Units; import org.locationtech.proj4j.units.Units;
import org.xml.sax.InputSource; import org.xml.sax.*;
import org.xml.sax.SAXException;
import org.xml.sax.SAXNotRecognizedException;
import org.xml.sax.SAXNotSupportedException;
import org.xmlobjects.schema.SchemaHandler; import org.xmlobjects.schema.SchemaHandler;
import org.xmlobjects.schema.SchemaHandlerException; import org.xmlobjects.schema.SchemaHandlerException;
import org.xmlobjects.stream.XMLReader; import org.xmlobjects.stream.XMLReader;
...@@ -439,16 +432,16 @@ public class CityGmlParser { ...@@ -439,16 +432,16 @@ public class CityGmlParser {
try { try {
parseCoordinateSystem(config, handler); parseCoordinateSystem(config, handler);
} catch (Exception e2) { } catch (Exception e2) {
logger.debug("Exception while parsing for EPSG code", e2); logEpsgParseError(e2);
if (logger.isWarnEnabled()) {
logger.warn(Localization.getText("CityGmlParser.noEPSG"));
}
} }
} catch (Exception e) { } catch (Exception e) {
logger.debug("Exception while parsing for EPSG code", e); logEpsgParseError(e);
if (logger.isWarnEnabled()) { }
logger.warn(Localization.getText("CityGmlParser.noEPSG")); }
} private static void logEpsgParseError(Exception e){
logger.debug("Exception while parsing for EPSG code", e);
if (logger.isWarnEnabled()) {
logger.warn(Localization.getText("CityGmlParser.noEPSG"));
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment