Mercurial > hg4j
diff src/org/tmatesoft/hg/internal/FileSystemHelper.java @ 622:4e6179bde4fc
Update to comply with Java 1.5 target
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Mon, 20 May 2013 16:56:40 +0200 |
parents | bd5926e24aa3 |
children | 661e77dc88ba |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/FileSystemHelper.java Sat May 18 22:23:57 2013 +0200 +++ b/src/org/tmatesoft/hg/internal/FileSystemHelper.java Mon May 20 16:56:40 2013 +0200 @@ -63,7 +63,9 @@ try { execHelper.exec(command); } catch (InterruptedException ex) { - throw new IOException(ex); + IOException e = new IOException(); + ex.initCause(ex); // XXX Java 1.5 + throw e; } } @@ -77,7 +79,9 @@ try { execHelper.exec(command); } catch (InterruptedException ex) { - throw new IOException(ex); + IOException e = new IOException(); + ex.initCause(ex); // XXX Java 1.5 + throw e; } } @@ -90,12 +94,14 @@ String result = null; try { result = execHelper.exec(command).toString().trim(); - if (result.isEmpty()) { + if (result.length() == 0) { // XXX Java 1.5 isEmpty() return defaultValue; } return Integer.parseInt(result, 8); } catch (InterruptedException ex) { - throw new IOException(ex); + IOException e = new IOException(); + ex.initCause(ex); // XXX Java 1.5 + throw e; } catch (NumberFormatException ex) { ctx.getLog().dump(getClass(), Warn, ex, String.format("Bad value for access rights:%s", result)); return defaultValue;