Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace isBlank for wider OpenJDK compatibility #43

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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