Skip to content

Commit

Permalink
Merge pull request #43 from agerlach/isBlank
Browse files Browse the repository at this point in the history
Replace `isBlank` for wider OpenJDK compatibility
  • Loading branch information
VVCAS-Sean committed Jun 18, 2024
2 parents 4183800 + 23d9692 commit 653c564
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/avtas/lmcp/lmcpgen/JuliaMethods.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private static Vector<DependencyContainer> BuildDependencyGraph(MDMInfo[] infos)
for (DependencyContainer dc : missingDependencies) {
StructInfo si = dc.structInfo;

if (!si.extends_name.isBlank()) { //check dependencies on interfaces
if (!si.extends_name.isEmpty()) { //check dependencies on interfaces
DependencyContainer extendsStruct = dc.find(missingDependencies, si.extends_name, si.extends_series);
dc.dependencies.add(extendsStruct);
//System.out.println(String.format("%s depends on %s", si.name, extendsStruct.structInfo.name));
Expand Down Expand Up @@ -96,14 +96,11 @@ public static String typeName(MDMInfo[] infos, MDMInfo info, final File outfile,
return ws + st.name;
}

public static String extends_check(MDMInfo[] infos, MDMInfo info, final File outfile, StructInfo st, EnumInfo en, String ws) throws Exception {
return ws + (st.extends_name.isBlank() ? "LMCP.LmcpBase" : st.extends_name);
}
public static String extends_impl(MDMInfo[] infos, MDMInfo info, final File outfile, StructInfo st, EnumInfo en, String ws) throws Exception {
return ws + (st.extends_name.isBlank() ? "LmcpMessage" : st.extends_name);
return ws + (st.extends_name.isEmpty() ? "LmcpMessage" : st.extends_name);
}
public static String extends_series(MDMInfo[] infos, MDMInfo info, final File outfile, StructInfo st, EnumInfo en, String ws) throws Exception {
return ws + (st.extends_name.isBlank() ? "LMCP." : st.extends_series + ".");
return ws + (st.extends_name.isEmpty() ? "LMCP." : st.extends_series + ".");
}

public static String list_imports(MDMInfo[] infos, MDMInfo info, final File outfile, StructInfo st, EnumInfo en, String ws) throws Exception {
Expand Down Expand Up @@ -327,7 +324,7 @@ else if (f.type.equalsIgnoreCase("string")) {
else {
str += ws + name + "::" + type;
String defaultVal = f.defaultVal;
if (defaultVal.isBlank()) {
if (defaultVal.isEmpty()) {
defaultVal = getDefaultValue(f.type);
}
}
Expand Down Expand Up @@ -539,12 +536,12 @@ else if (f.isStruct) {
}
else if (f.type.equalsIgnoreCase("string")) {
str += ws + name + "::" + type;
str += " = " + (f.defaultVal.isBlank() ? "\"\"" : "\"" + f.defaultVal + "\"");
str += " = " + (f.defaultVal.isEmpty() ? "\"\"" : "\"" + f.defaultVal + "\"");
}
else {
str += ws + name + "::" + type;
String defaultVal = f.defaultVal;
if (defaultVal.isBlank()) {
if (defaultVal.isEmpty()) {
defaultVal = getDefaultValue(f.type);
}
str += " = " + type + "(" + defaultVal + ")";
Expand Down

0 comments on commit 653c564

Please sign in to comment.