From 70e250c3564cd9a17479fecc0d58d1700806c056 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Tue, 11 May 2021 18:36:05 +0200 Subject: [PATCH 1/2] Fix formatting which was broken in 00386272 Change-Id: I10a3e2b117e790f64386a8e9e7663db8e59230d9 Signed-off-by: Matthias Sohn --- .../jgit/internal/storage/file/LockFile.java | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java index f57581a29..78262e977 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java @@ -218,14 +218,14 @@ public void copyCurrentContent() throws IOException { int r; while ((r = fis.read(buf)) >= 0) { out.write(buf, 0, r); + } } - } - } catch (FileNotFoundException fnfe) { - if (ref.exists()) { - throw fnfe; - } - // Don't worry about a file that doesn't exist yet, it - // conceptually has no current content to copy. + } catch (FileNotFoundException fnfe) { + if (ref.exists()) { + throw fnfe; + } + // Don't worry about a file that doesn't exist yet, it + // conceptually has no current content to copy. } } catch (IOException | RuntimeException | Error ioe) { unlock(); @@ -322,17 +322,16 @@ private OutputStream get() throws IOException { if (out == null) { os = getStream(); if (fsync) { - out = Channels.newOutputStream(os.getChannel()); + out = Channels.newOutputStream(os.getChannel()); } else { - out = os; + out = os; } } return out; } @Override - public void write(byte[] b, int o, int n) - throws IOException { + public void write(byte[] b, int o, int n) throws IOException { get().write(b, o, n); } @@ -359,10 +358,10 @@ public void close() throws IOException { } if (out != null) { if (fsync) { - os.getChannel().force(true); + os.getChannel().force(true); } - out.close(); - os = null; + out.close(); + os = null; } written = true; } catch (IOException | RuntimeException | Error ioe) { From 37436cc9334ed7bf49bf1d297ae4f90d5f141068 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Tue, 11 May 2021 18:37:37 +0200 Subject: [PATCH 2/2] Remove texts which were added by mistake in 00386272 Change-Id: Iaed25dac0bc9af8f3fda6138a5f9fe553bff5d39 Signed-off-by: Matthias Sohn --- .../resources/org/eclipse/jgit/internal/JGitText.properties | 4 ---- org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java | 4 ---- 2 files changed, 8 deletions(-) diff --git a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties index 1888a87c0..70a0d8095 100644 --- a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties +++ b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties @@ -416,10 +416,6 @@ lockOnNotClosed=Lock on {0} not closed. lockOnNotHeld=Lock on {0} not held. lockStreamClosed=Output to lock on {0} already closed lockStreamMultiple=Output to lock on {0} already opened -logInconsistentFiletimeDiff={}: inconsistent duration from file timestamps on {}, {}: {} > {}, but diff = {}. Aborting measurement at resolution {}. -logLargerFiletimeDiff={}: inconsistent duration from file timestamps on {}, {}: diff = {} > {} (last good value). Aborting measurement. -logSmallerFiletime={}: got smaller file timestamp on {}, {}: {} < {}. Aborting measurement at resolution {}. -logXDGConfigHomeInvalid=Environment variable XDG_CONFIG_HOME contains an invalid path {} maxCountMustBeNonNegative=max count must be >= 0 mergeConflictOnNonNoteEntries=Merge conflict on non-note entries: base = {0}, ours = {1}, theirs = {2} mergeConflictOnNotes=Merge conflict on note {0}. base = {1}, ours = {2}, theirs = {2} diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java index 9d8824467..37a7c7d93 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java @@ -444,10 +444,6 @@ public static JGitText get() { /***/ public String lockOnNotHeld; /***/ public String lockStreamClosed; /***/ public String lockStreamMultiple; - /***/ public String logInconsistentFiletimeDiff; - /***/ public String logLargerFiletimeDiff; - /***/ public String logSmallerFiletime; - /***/ public String logXDGConfigHomeInvalid; /***/ public String maxCountMustBeNonNegative; /***/ public String mergeConflictOnNonNoteEntries; /***/ public String mergeConflictOnNotes;