]> source.dussan.org Git - jgit.git/commitdiff
Fix variable name and error message for sideband testing 96/35996/3
authorStefan Beller <sbeller@google.com>
Tue, 11 Nov 2014 02:18:34 +0000 (18:18 -0800)
committerStefan Beller <sbeller@google.com>
Tue, 11 Nov 2014 02:18:34 +0000 (18:18 -0800)
Actually the test only allows a range from [1,255], so let's name the
variable so.

Change-Id: Iecdb8149b83389c67e3cd2f64f4a654c175475be
Signed-off-by: Stefan Beller <sbeller@google.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/SideBandOutputStreamTest.java
org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/SideBandOutputStream.java

index 717a58bcbb157e663d22bac2c926b11e125b787c..e9ae1909ea2468a8514d90790c7cfd65d0742fbc 100644 (file)
@@ -201,21 +201,21 @@ public class SideBandOutputStreamTest {
                        new SideBandOutputStream(-1, MAX_BUF, rawOut);
                        fail("Accepted -1 channel number");
                } catch (IllegalArgumentException e) {
-                       assertEquals("channel -1 must be in range [0, 255]", e.getMessage());
+                       assertEquals("channel -1 must be in range [1, 255]", e.getMessage());
                }
 
                try {
                        new SideBandOutputStream(0, MAX_BUF, rawOut);
                        fail("Accepted 0 channel number");
                } catch (IllegalArgumentException e) {
-                       assertEquals("channel 0 must be in range [0, 255]", e.getMessage());
+                       assertEquals("channel 0 must be in range [1, 255]", e.getMessage());
                }
 
                try {
                        new SideBandOutputStream(256, MAX_BUF, rawOut);
                        fail("Accepted 256 channel number");
                } catch (IllegalArgumentException e) {
-                       assertEquals("channel 256 must be in range [0, 255]", e
+                       assertEquals("channel 256 must be in range [1, 255]", e
                                        .getMessage());
                }
        }
index 524aa3e6acc81696c990ae9ced6e3ef123a8288f..76c709422e7ffaba3bb3ac4cd9e3332e62b6aa15 100644 (file)
@@ -91,7 +91,7 @@ canOnlyRevertCommitsWithOneParent=Cannot revert commit ''{0}'' because it has {1
 commitDoesNotHaveGivenParent=The commit ''{0}'' does not have a parent number {1}.
 cantFindObjectInReversePackIndexForTheSpecifiedOffset=Can''t find object in (reverse) pack index for the specified offset {0}
 cantPassMeATree=Can't pass me a tree!
-channelMustBeInRange0_255=channel {0} must be in range [0, 255]
+channelMustBeInRange1_255=channel {0} must be in range [1, 255]
 characterClassIsNotSupported=The character class {0} is not supported.
 checkoutConflictWithFile=Checkout conflict with file: {0}
 checkoutConflictWithFiles=Checkout conflict with files: {0}
index dd1be0d5f7c0bc699e1e4e0625cf079f72e0ef6b..d1f0deec9d48656572bd96a3a3129bf35f02e2eb 100644 (file)
@@ -150,7 +150,7 @@ public class JGitText extends TranslationBundle {
        /***/ public String commitDoesNotHaveGivenParent;
        /***/ public String cantFindObjectInReversePackIndexForTheSpecifiedOffset;
        /***/ public String cantPassMeATree;
-       /***/ public String channelMustBeInRange0_255;
+       /***/ public String channelMustBeInRange1_255;
        /***/ public String characterClassIsNotSupported;
        /***/ public String checkoutConflictWithFile;
        /***/ public String checkoutConflictWithFiles;
index 770fcbed82060333ceb9da5022728ac57b9a29f0..0303eed9a7230c832cada9a193a25942b32f5c59 100644 (file)
@@ -93,7 +93,7 @@ public class SideBandOutputStream extends OutputStream {
         * @param chan
         *            channel number to prefix all packets with, so the remote side
         *            can demultiplex the stream and get back the original data.
-        *            Must be in the range [0, 255].
+        *            Must be in the range [1, 255].
         * @param sz
         *            maximum size of a data packet within the stream. The remote
         *            side needs to agree to the packet size to prevent buffer
@@ -105,7 +105,7 @@ public class SideBandOutputStream extends OutputStream {
        public SideBandOutputStream(final int chan, final int sz, final OutputStream os) {
                if (chan <= 0 || chan > 255)
                        throw new IllegalArgumentException(MessageFormat.format(
-                                       JGitText.get().channelMustBeInRange0_255,
+                                       JGitText.get().channelMustBeInRange1_255,
                                        Integer.valueOf(chan)));
                if (sz <= HDR_SIZE)
                        throw new IllegalArgumentException(MessageFormat.format(