}
/**
+ * Initial logging information helper for various versions output
+ *
+ * @param prefix
+ * @param value
+ * @param defaultValue
+ */
+ private static void appendIfNotNull(StringBuilder sb, String prefix,
+ String value, String suffix, String defaultValue)
+ {
+ if (value == null && defaultValue == null)
+ {
+ return;
+ }
+ String line = prefix + (value != null ? value : defaultValue) + suffix;
+ sb.append(line);
+ }
+
+ /**
*
* @return Jalview version, build details and JVM platform version for console
*/
sb.append("\n");
sb.append(System.getProperty("os.arch") + " " + System.getProperty("os.name") + " " + System.getProperty("os.version"));
sb.append("\n");
- sb.append("Install4j version: "
- + System.getProperty("sys.install4jVersion"));
- sb.append("\n");
- sb.append("Install4j template version: "
- + System.getProperty("installer_template_version"));
- sb.append("\n");
- sb.append(
- "Launcher version: " + System.getProperty("launcher_version"));
- sb.append("\n");
+ appendIfNotNull(sb, "Install4j version: ",
+ System.getProperty("sys.install4jVersion"), "\n", null);
+ appendIfNotNull(sb, "Install4j template version: ",
+ System.getProperty("installer_template_version"), "\n", null);
+ appendIfNotNull(sb, "Launcher version: ",
+ System.getProperty("launcher_version"), "\n", null);
if (jalview.bin.Cache.getDefault("VERSION", "TEST").equals("DEVELOPMENT")) {
- sb.append("Getdown appdir: " + System.getProperty("getdownappdir"));
- sb.append("\n");
- sb.append("Java home: " + System.getProperty("java.home"));
- sb.append("\n");
+ appendIfNotNull(sb, "Getdown appdir: ",
+ System.getProperty("getdownappdir"), "\n", null);
+ appendIfNotNull(sb, "Java home: ", System.getProperty("java.home"),
+ "\n", "unknown");
}
return sb.toString();
}