fix(TUP-27184): org.talend.core.model.process.INode.getLabel() return

null when use it in javajet
This commit is contained in:
wwang-talend
2020-06-18 11:11:25 +08:00
parent dd06612b88
commit 8ce14c0620

View File

@@ -1233,7 +1233,7 @@ public class NodeUtil {
return true;
}
public String getLabel(INode node) {
public static String getLabel(INode node) {
String label = node.getLabel();
if(label == null) {
return node.getUniqueName();
@@ -1252,19 +1252,20 @@ public class NodeUtil {
return label;
}
private boolean isValidJavaStringLiteral(String value) {
private static boolean isValidJavaStringLiteral(String value) {
boolean escape = false;
for(int i=0;i<value.length();i++) {
char c = value.charAt(i);
if(c == '"' && !escape) {
return false;
}
if(c == '\\') {
escape = !escape;
} else {
escape = false;
}
if(c == '"' && !escape) {
return false;
}
}
return true;