提交 78018191 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Move exception handler to top parseEWKB() method

上级 573e605d
...@@ -269,7 +269,11 @@ public final class EWKBUtils { ...@@ -269,7 +269,11 @@ public final class EWKBUtils {
* output target * output target
*/ */
public static void parseEWKB(byte[] ewkb, Target target) { public static void parseEWKB(byte[] ewkb, Target target) {
try {
parseEWKB(new EWKBSource(ewkb), target, 0, 0); parseEWKB(new EWKBSource(ewkb), target, 0, 0);
} catch (ArrayIndexOutOfBoundsException e) {
throw new IllegalArgumentException();
}
} }
/** /**
...@@ -286,7 +290,6 @@ public final class EWKBUtils { ...@@ -286,7 +290,6 @@ public final class EWKBUtils {
* root geometry (will be determined from the EWKB instead) * root geometry (will be determined from the EWKB instead)
*/ */
private static void parseEWKB(EWKBSource source, Target target, int parentType, int parentSrid) { private static void parseEWKB(EWKBSource source, Target target, int parentType, int parentSrid) {
try {
// Read byte order of a next geometry // Read byte order of a next geometry
switch (source.readByte()) { switch (source.readByte()) {
case 0: case 0:
...@@ -398,10 +401,6 @@ public final class EWKBUtils { ...@@ -398,10 +401,6 @@ public final class EWKBUtils {
default: default:
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} }
} catch (ArrayIndexOutOfBoundsException e) {
e.printStackTrace();
throw new IllegalArgumentException();
}
} }
private static void addRing(EWKBSource source, Target target, boolean useZ, boolean useM, int size) { private static void addRing(EWKBSource source, Target target, boolean useZ, boolean useM, int size) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论