Skip to content

Commit

Permalink
Compare paths instead of Strings
Browse files Browse the repository at this point in the history
  • Loading branch information
karoliineh committed Feb 28, 2022
1 parent db670e6 commit f0f0d89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/java/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public static void main(String... args) {
log.info("Unable to launch MagpieBridge.");
} else {
magpieServer.launchOnStdio();
magpieServer.doAnalysis("c", true);
log.info("MagpieBridge server launched.");
magpieServer.doAnalysis("c", true);
}
}
}
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/goblintserver/GoblintServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public class GoblintServer {

private MagpieServer magpieServer;

private File gobPieConf = new File("gobpie.json");
private File goblintSocket = new File("goblint.sock");
private String gobPieConf = "gobpie.json";
private String goblintSocket = "goblint.sock";

private String[] preAnalyzeCommand;
private String[] goblintRunCommand;
Expand Down Expand Up @@ -72,7 +72,8 @@ public boolean startGoblintServer() {
WatchKey key;
while ((key = watchService.take()) != null) {
for (WatchEvent<?> event : key.pollEvents()) {
if (event.context().toString().equals(goblintSocket.toString())) {

if (((Path) event.context()).equals(Paths.get(goblintSocket))) {
log.info("Goblint server started.");
return true;
}
Expand Down Expand Up @@ -173,7 +174,7 @@ private boolean readGobPieConfiguration() {
"--enable", "server.enabled",
"--enable", "server.reparse",
"--set", "server.mode", "unix",
"--set", "server.unix-socket", goblintSocket.getAbsolutePath()}),
"--set", "server.unix-socket", new File(goblintSocket).getAbsolutePath()}),
Arrays.stream(gobpieConfiguration.getFiles()))
.toArray(String[]::new);

Expand Down

0 comments on commit f0f0d89

Please sign in to comment.