More fixes for proxies

This commit is contained in:
Christopher Schnick
2022-11-26 16:44:09 +01:00
parent 097d23f306
commit 696dc036ac
8 changed files with 39 additions and 16 deletions

View File

@@ -74,6 +74,13 @@ public class JacksonMapper {
return INSTANCE.copy();
}
public static ObjectMapper getDefault() {
if (!JacksonMapper.isInit()) {
return DEFAULT;
}
return INSTANCE;
}
public static boolean isInit() {
return init;
}

View File

@@ -12,7 +12,7 @@ public class JacksonizedValue {
@SneakyThrows
public final String toString() {
var tree = JacksonMapper.newMapper().valueToTree(this);
var tree = JacksonMapper.getDefault().valueToTree(this);
return tree.toPrettyString();
}
@@ -25,14 +25,14 @@ public class JacksonizedValue {
return false;
}
var tree = JacksonMapper.newMapper().valueToTree(this);
var otherTree = JacksonMapper.newMapper().valueToTree(o);
var tree = JacksonMapper.getDefault().valueToTree(this);
var otherTree = JacksonMapper.getDefault().valueToTree(o);
return tree.equals(otherTree);
}
@Override
public final int hashCode() {
var tree = JacksonMapper.newMapper().valueToTree(this);
var tree = JacksonMapper.getDefault().valueToTree(this);
return tree.hashCode();
}
}

View File

@@ -33,7 +33,7 @@ public class XPipeInstallation {
public static Optional<String> getInstallationExecutable(ShellProcessControl p) throws Exception {
var installation = getDefaultInstallationBasePath(p);
var executable = FileNames.join(installation, getDaemonExecutableInInstallationDirectory(p.getOsType()));
var executable = getDaemonExecutableInInstallationDirectory(p.getOsType());
var file = FileNames.join(installation, executable);
try (CommandProcessControl c =
p.command(p.getShellType().createFileExistsCommand(file)).start()) {