Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/d3v4s/jun.git
Browse files Browse the repository at this point in the history
  • Loading branch information
hxs committed Nov 29, 2019
2 parents 364a056 + a38cb4e commit 5910a4b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions jun/src/jun/Jun.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.io.InputStreamReader;
import java.io.RandomAccessFile;
import java.lang.management.ManagementFactory;
import java.text.MessageFormat;
import java.util.regex.Pattern;

import exception.ApplicationException;
Expand Down Expand Up @@ -92,10 +93,7 @@ public void unlock(String path) {
public void forceLock(String path) throws IOException, FileLockException {
unlock(path);
File file = new File(path);
if (file.exists()) {
String msg = String.format("Unable to delete the lock file: '%s'", file.getAbsolutePath());
throw new FileLockException(msg);
}
if (file.exists()) throw new FileLockException(MessageFormat.format("Unable to delete the lock file: '{0}'", file.getAbsolutePath()));

file.createNewFile();

Expand Down Expand Up @@ -187,7 +185,7 @@ private boolean pidIsJavaRunning(String pid) throws SystemException {
e1.printStackTrace();
}
}
throw new SystemException(String.format("Error while searching PID.\n%s", e.getMessage()));
throw new SystemException(MessageFormat.format("Error while searching PID.\n{0}", e.getMessage()));
} finally {
if (br != null) {
try {
Expand Down

0 comments on commit 5910a4b

Please sign in to comment.