提交 093f24b5 编写于 作者: S StephanEwen

Fix NullPointer exceptions in SemanticPropsUtil

上级 b31ae3ac
......@@ -80,9 +80,11 @@ public class SemanticPropUtil {
return;
}
for (String s : cf) {
if (s != null) {
readConstantSet(sm, s, inType, outType, 0);
}
}
}
private static void readConstantSet(SemanticProperties sp, String s, TypeInformation<?> inType, TypeInformation<?> outType, int input) {
if (s.equals("*")) {
......@@ -150,9 +152,11 @@ public class SemanticPropUtil {
}
for (String s : cff) {
if (s != null) {
readConstantSet(dm, s, inType, outType, 0);
}
}
}
private static void parseConstantFieldsSecond(String[] cfs, DualInputSemanticProperties dm, TypeInformation<?> inType, TypeInformation<?> outType) {
if (cfs == null) {
......@@ -160,9 +164,11 @@ public class SemanticPropUtil {
}
for (String s : cfs) {
if (s != null) {
readConstantSet(dm, s, inType, outType, 1);
}
}
}
private static void parseConstantFieldsFirstExcept(String[] cffe, DualInputSemanticProperties dm, TypeInformation<?> inType, TypeInformation<?> outType) {
if (cffe == null) {
......@@ -170,6 +176,10 @@ public class SemanticPropUtil {
}
for (String str : cffe) {
if (str == null) {
continue;
}
FieldSet fs = readFieldSetFromString(str, inType, outType);
for (int i = 0; i < outType.getArity(); i++) {
......@@ -186,6 +196,10 @@ public class SemanticPropUtil {
}
for (String str : cfse) {
if (str == null) {
continue;
}
FieldSet fs = readFieldSetFromString(str, inType, outType);
for (int i = 0; i < outType.getArity(); i++) {
......@@ -202,10 +216,12 @@ public class SemanticPropUtil {
}
for (String str : rf) {
if (str != null) {
FieldSet fs = readFieldSetFromString(str, inType, outType);
dm.addReadFields1(fs);
}
}
}
private static void parseReadFieldsSecond(String[] rf, DualInputSemanticProperties dm, TypeInformation<?> inType, TypeInformation<?> outType) {
if (rf == null) {
......@@ -213,10 +229,12 @@ public class SemanticPropUtil {
}
for (String str : rf) {
if (str != null) {
FieldSet fs = readFieldSetFromString(str, inType, outType);
dm.addReadFields2(fs);
}
}
}
private static boolean isValidField(TypeInformation<?> type, int field) {
......@@ -229,6 +247,7 @@ public class SemanticPropUtil {
}
for (String str : cfe) {
if (str != null) {
FieldSet fs = readFieldSetFromString(str, inType, outType);
for (int i = 0; i < outType.getArity(); i++) {
......@@ -238,6 +257,7 @@ public class SemanticPropUtil {
}
}
}
}
private static FieldSet readFieldSetFromString(String s, TypeInformation<?> inType, TypeInformation<?> outType) {
Matcher matcher = FIELD_SET_CHECK_PATTERN.matcher(s);
......@@ -265,10 +285,12 @@ public class SemanticPropUtil {
}
for (String str : rf) {
if (str != null) {
FieldSet fs = readFieldSetFromString(str, inType, outType);
sm.addReadFields(fs);
}
}
}
public static SingleInputSemanticProperties getSemanticPropsSingleFromString(String[] constantSet, String[] constantSetExcept, String[] readSet, TypeInformation<?> inType, TypeInformation<?> outType) {
SingleInputSemanticProperties result = new SingleInputSemanticProperties();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册