From 3ee04e35313a4a5cd51bbd73b566d596816c2440 Mon Sep 17 00:00:00 2001 From: Robin Stocker Date: Fri, 8 Mar 2013 18:00:19 +0100 Subject: [PATCH] Include the number of ms in timeout error message Noticed that while analyzing bug 402131. Change-Id: If3fd40b64d5088c4579946271a67346cbd9e6556 --- .../org/eclipse/jgit/internal/JGitText.properties | 4 ++-- .../src/org/eclipse/jgit/util/io/TimeoutInputStream.java | 7 ++++--- .../src/org/eclipse/jgit/util/io/TimeoutOutputStream.java | 7 ++++--- 3 files changed, 10 insertions(+), 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 18f33147c..677f735ce 100644 --- a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties +++ b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties @@ -385,7 +385,7 @@ pushIsNotSupportedForBundleTransport=Push is not supported for bundle transport pushNotPermitted=push not permitted rawLogMessageDoesNotParseAsLogEntry=Raw log message does not parse as log entry readingObjectsFromLocalRepositoryFailed=reading objects from local repository failed: {0} -readTimedOut=Read timed out +readTimedOut=Read timed out after {0} ms receivePackObjectTooLarge1=Object too large, rejecting the pack. Max object size limit is {0} bytes. receivePackObjectTooLarge2=Object too large ({0} bytes), rejecting the pack. Max object size limit is {1} bytes. receivingObjects=Receiving objects @@ -541,7 +541,7 @@ weeksAgo={0} weeks ago windowSizeMustBeLesserThanLimit=Window size must be < limit windowSizeMustBePowerOf2=Window size must be power of 2 writerAlreadyInitialized=Writer already initialized -writeTimedOut=Write timed out +writeTimedOut=Write timed out after {0} ms writingNotPermitted=Writing not permitted writingNotSupported=Writing {0} not supported. writingObjects=Writing objects diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/TimeoutInputStream.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/TimeoutInputStream.java index cda2b59b4..fe452c255 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/TimeoutInputStream.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/TimeoutInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009, Google Inc. + * Copyright (C) 2009, 2013 Google Inc. * and other copyright owners as documented in the project's IP log. * * This program and the accompanying materials are made available @@ -137,7 +137,8 @@ public class TimeoutInputStream extends FilterInputStream { myTimer.end(); } - private static InterruptedIOException readTimedOut() { - return new InterruptedIOException(JGitText.get().readTimedOut); + private InterruptedIOException readTimedOut() { + return new InterruptedIOException(MessageFormat.format( + JGitText.get().readTimedOut, Integer.valueOf(timeout))); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/TimeoutOutputStream.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/TimeoutOutputStream.java index b074396a7..7ca11ca05 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/TimeoutOutputStream.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/TimeoutOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009, Google Inc. + * Copyright (C) 2009, 2013 Google Inc. * and other copyright owners as documented in the project's IP log. * * This program and the accompanying materials are made available @@ -150,7 +150,8 @@ public class TimeoutOutputStream extends OutputStream { myTimer.end(); } - private static InterruptedIOException writeTimedOut() { - return new InterruptedIOException(JGitText.get().writeTimedOut); + private InterruptedIOException writeTimedOut() { + return new InterruptedIOException(MessageFormat.format( + JGitText.get().writeTimedOut, Integer.valueOf(timeout))); } }