]> source.dussan.org Git - jgit.git/commitdiff
Remove 86 boxing warnings 93/5893/2
authorKevin Sawicki <kevin@github.com>
Wed, 9 May 2012 04:42:53 +0000 (21:42 -0700)
committerKevin Sawicki <kevin@github.com>
Wed, 9 May 2012 04:42:53 +0000 (21:42 -0700)
Use Integer, Character, and Long valueOf methods when
passing parameters to MessageFormat and other places
that expect objects instead of primitives

Change-Id: I5942fbdbca6a378136c00d951ce61167f2366ca4

32 files changed:
org.eclipse.jgit/src/org/eclipse/jgit/diff/MyersDiff.java
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java
org.eclipse.jgit/src/org/eclipse/jgit/errors/LargeObjectException.java
org.eclipse.jgit/src/org/eclipse/jgit/errors/TooLargeObjectInPackException.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/AbbreviatedObjectId.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectChecker.java
org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedHunkHeader.java
org.eclipse.jgit/src/org/eclipse/jgit/patch/FileHeader.java
org.eclipse.jgit/src/org/eclipse/jgit/patch/HunkHeader.java
org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObjectList.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackIndex.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackIndexWriter.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackReverseIndex.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/SideBandInputStream.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/SideBandOutputStream.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportSftp.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java
org.eclipse.jgit/src/org/eclipse/jgit/util/Base64.java
org.eclipse.jgit/src/org/eclipse/jgit/util/io/InterruptTimer.java
org.eclipse.jgit/src/org/eclipse/jgit/util/io/TimeoutInputStream.java
org.eclipse.jgit/src/org/eclipse/jgit/util/io/TimeoutOutputStream.java

index 6f04593b8198cdd0ae840206981168dcc883ad02..94acd43257633f909294dfd0eace03a3e41dcd01 100644 (file)
@@ -301,21 +301,21 @@ public class MyersDiff<S extends Sequence> {
                        final int getIndex(int d, int k) {
 // TODO: remove
 if (((d + k - middleK) % 2) != 0)
-       throw new RuntimeException(MessageFormat.format(JGitText.get().unexpectedOddResult, d, k, middleK));
+       throw new RuntimeException(MessageFormat.format(JGitText.get().unexpectedOddResult, Integer.valueOf(d), Integer.valueOf(k), Integer.valueOf(middleK)));
                                return (d + k - middleK) / 2;
                        }
 
                        final int getX(int d, int k) {
 // TODO: remove
 if (k < beginK || k > endK)
-       throw new RuntimeException(MessageFormat.format(JGitText.get().kNotInRange, k, beginK, endK));
+       throw new RuntimeException(MessageFormat.format(JGitText.get().kNotInRange, Integer.valueOf(k), Integer.valueOf(beginK), Integer.valueOf(endK)));
                                return x.get(getIndex(d, k));
                        }
 
                        final long getSnake(int d, int k) {
 // TODO: remove
 if (k < beginK || k > endK)
-       throw new RuntimeException(MessageFormat.format(JGitText.get().kNotInRange, k, beginK, endK));
+       throw new RuntimeException(MessageFormat.format(JGitText.get().kNotInRange, Integer.valueOf(k), Integer.valueOf(beginK), Integer.valueOf(endK)));
                                return snake.get(getIndex(d, k));
                        }
 
index d8afd858b4d4a1488858383398b96107f6283980..f139b0f7f868a419e4d89fdfd9aa086eb7f636bd 100644 (file)
@@ -398,7 +398,8 @@ public class DirCache {
                if (ver == 3)
                        extended = true;
                else if (ver != 2)
-                       throw new CorruptObjectException(MessageFormat.format(JGitText.get().unknownDIRCVersion, ver));
+                       throw new CorruptObjectException(MessageFormat.format(
+                                       JGitText.get().unknownDIRCVersion, Integer.valueOf(ver)));
                entryCnt = NB.decodeInt32(hdr, 8);
                if (entryCnt < 0)
                        throw new CorruptObjectException(JGitText.get().DIRCHasTooManyEntries);
@@ -433,8 +434,9 @@ public class DirCache {
                        switch (NB.decodeInt32(hdr, 0)) {
                        case EXT_TREE: {
                                if (Integer.MAX_VALUE < sz) {
-                                       throw new CorruptObjectException(MessageFormat.format(JGitText.get().DIRCExtensionIsTooLargeAt
-                                                       , formatExtensionName(hdr), sz));
+                                       throw new CorruptObjectException(MessageFormat.format(
+                                                       JGitText.get().DIRCExtensionIsTooLargeAt,
+                                                       formatExtensionName(hdr), Long.valueOf(sz)));
                                }
                                final byte[] raw = new byte[(int) sz];
                                IO.readFully(in, raw, 0, raw.length);
@@ -474,8 +476,10 @@ public class DirCache {
                while (0 < sz) {
                        int n = in.read(b, 0, (int) Math.min(b.length, sz));
                        if (n < 0) {
-                               throw new EOFException(MessageFormat.format(JGitText.get().shortReadOfOptionalDIRCExtensionExpectedAnotherBytes
-                                               , formatExtensionName(hdr), sz));
+                               throw new EOFException(
+                                               MessageFormat.format(
+                                                               JGitText.get().shortReadOfOptionalDIRCExtensionExpectedAnotherBytes,
+                                                               formatExtensionName(hdr), Long.valueOf(sz)));
                        }
                        md.update(b, 0, n);
                        sz -= n;
index f12ec5648805719c693debaf7f3ee1be1f5da325..a69bdc481d41f364b6d0741d586f76dc3b28f4d8 100644 (file)
@@ -157,7 +157,7 @@ public class LargeObjectException extends RuntimeException {
                @Override
                public String getMessage() {
                        return MessageFormat.format(JGitText.get().largeObjectExceedsLimit,
-                                       getObjectName(), limit, size);
+                                       getObjectName(), Long.valueOf(limit), Long.valueOf(size));
                }
        }
 }
index d20cd056a77c0ebae97c54344717fba8db1fda53..79515fcd7cb802c69ad111dfecbb3a14ce26a53d 100644 (file)
@@ -64,7 +64,7 @@ public class TooLargeObjectInPackException extends IOException {
         */
        public TooLargeObjectInPackException(long maxObjectSizeLimit) {
                super(MessageFormat.format(JGitText.get().receivePackObjectTooLarge1,
-                               maxObjectSizeLimit));
+                               Long.valueOf(maxObjectSizeLimit)));
        }
 
        /**
@@ -77,6 +77,6 @@ public class TooLargeObjectInPackException extends IOException {
        public TooLargeObjectInPackException(long objectSize,
                        long maxObjectSizeLimit) {
                super(MessageFormat.format(JGitText.get().receivePackObjectTooLarge2,
-                               objectSize, maxObjectSizeLimit));
+                               Long.valueOf(objectSize), Long.valueOf(maxObjectSizeLimit)));
        }
 }
\ No newline at end of file
index bd9d28e47e8249f87e95bc7d60c11c71b0494c51..44460fe6539e90389b2437c7caa9db295ef9092d 100644 (file)
@@ -101,8 +101,10 @@ public final class AbbreviatedObjectId implements Serializable {
        public static final AbbreviatedObjectId fromString(final byte[] buf,
                        final int offset, final int end) {
                if (end - offset > Constants.OBJECT_ID_STRING_LENGTH)
-                       throw new IllegalArgumentException(MessageFormat.format(JGitText.get().invalidIdLength
-                                       , end - offset, Constants.OBJECT_ID_STRING_LENGTH));
+                       throw new IllegalArgumentException(MessageFormat.format(
+                                       JGitText.get().invalidIdLength,
+                                       Integer.valueOf(end - offset),
+                                       Integer.valueOf(Constants.OBJECT_ID_STRING_LENGTH)));
                return fromHexString(buf, offset, end);
        }
 
index 1619b589c4ddc56aff6a703e01e6aeceb3e3dc82..15bd37e69f5927f377a064e4b2eea1c306445e0b 100644 (file)
@@ -1204,7 +1204,9 @@ public class Config {
                                        value.append('"');
                                        continue;
                                default:
-                                       throw new ConfigInvalidException(MessageFormat.format(JGitText.get().badEscape, ((char) c)));
+                                       throw new ConfigInvalidException(MessageFormat.format(
+                                                       JGitText.get().badEscape,
+                                                       Character.valueOf(((char) c))));
                                }
                        }
 
index 70d63fa1e71593776e2a2b45c2f02349c3e4b8cd..5332ffa711654a7b216ba2774c96460b89ff3ec7 100644 (file)
@@ -375,7 +375,8 @@ public final class Constants {
                case OBJ_TAG:
                        return TYPE_TAG;
                default:
-                       throw new IllegalArgumentException(MessageFormat.format(JGitText.get().badObjectType, typeCode));
+                       throw new IllegalArgumentException(MessageFormat.format(
+                                       JGitText.get().badObjectType, Integer.valueOf(typeCode)));
                }
        }
 
@@ -399,7 +400,8 @@ public final class Constants {
                case OBJ_TAG:
                        return ENCODED_TYPE_TAG;
                default:
-                       throw new IllegalArgumentException(MessageFormat.format(JGitText.get().badObjectType, typeCode));
+                       throw new IllegalArgumentException(MessageFormat.format(
+                                       JGitText.get().badObjectType, Integer.valueOf(typeCode)));
                }
        }
 
index 1b8457883ff2a703abf56d1b6aea6a6c7170d399..5fc1e832528fcee3a97de895175b106eb6ec6b5c 100644 (file)
@@ -127,7 +127,8 @@ public class ObjectChecker {
                        break;
                default:
                        throw new CorruptObjectException(MessageFormat.format(
-                                       JGitText.get().corruptObjectInvalidType2, objType));
+                                       JGitText.get().corruptObjectInvalidType2,
+                                       Integer.valueOf(objType)));
                }
        }
 
index 9955519c7b2587e9b0eff06fb3ee8c939be5ec3c..eb2bfac1b032f8606a2a063368edfae785011aa1 100644 (file)
@@ -186,13 +186,17 @@ public class CombinedHunkHeader extends HunkHeader {
                        if (cmp < o.lineCount) {
                                final int missingCnt = o.lineCount - cmp;
                                script.error(buf, startOffset, MessageFormat.format(
-                                               JGitText.get().truncatedHunkLinesMissingForAncestor, missingCnt, (ancestor + 1)));
+                                               JGitText.get().truncatedHunkLinesMissingForAncestor,
+                                               Integer.valueOf(missingCnt),
+                                               Integer.valueOf(ancestor + 1)));
                        }
                }
 
                if (nContext + nAdded < newLineCount) {
                        final int missingCount = newLineCount - (nContext + nAdded);
-                       script.error(buf, startOffset, MessageFormat.format(JGitText.get().truncatedHunkNewLinesMissing, missingCount));
+                       script.error(buf, startOffset, MessageFormat.format(
+                                       JGitText.get().truncatedHunkNewLinesMissing,
+                                       Integer.valueOf(missingCount)));
                }
 
                return c;
index 3404ef55155795ea23644a01c6e49cc0b6f698cd..ff30a8cbcb5b03545706cdb7b00071c3b437f9f3 100644 (file)
@@ -218,7 +218,9 @@ public class FileHeader extends DiffEntry {
                }
 
                if (charsetGuess != null && charsetGuess.length != getParentCount() + 1)
-                       throw new IllegalArgumentException(MessageFormat.format(JGitText.get().expectedCharacterEncodingGuesses, (getParentCount() + 1)));
+                       throw new IllegalArgumentException(MessageFormat.format(
+                                       JGitText.get().expectedCharacterEncodingGuesses,
+                                       Integer.valueOf(getParentCount() + 1)));
 
                if (trySimpleConversion(charsetGuess)) {
                        Charset cs = charsetGuess != null ? charsetGuess[0] : null;
index 43e7a6f9eb380996937045c8d1534604d6c0eaa2..b7a93933f2a0db616a2943379dafe838dcb468bd 100644 (file)
@@ -300,12 +300,14 @@ public class HunkHeader {
                if (nContext + old.nDeleted < old.lineCount) {
                        final int missingCount = old.lineCount - (nContext + old.nDeleted);
                        script.error(buf, startOffset, MessageFormat.format(
-                                       JGitText.get().truncatedHunkOldLinesMissing, missingCount));
+                                       JGitText.get().truncatedHunkOldLinesMissing,
+                                       Integer.valueOf(missingCount)));
 
                } else if (nContext + old.nAdded < newLineCount) {
                        final int missingCount = newLineCount - (nContext + old.nAdded);
                        script.error(buf, startOffset, MessageFormat.format(
-                                       JGitText.get().truncatedHunkNewLinesMissing, missingCount));
+                                       JGitText.get().truncatedHunkNewLinesMissing,
+                                       Integer.valueOf(missingCount)));
 
                } else if (nContext + old.nDeleted > old.lineCount
                                || nContext + old.nAdded > newLineCount) {
index 2e292fac71d97698e9ffb3c098d724418953c207..3ad56d1846e0b6ab02018108bb47320fb2462a14 100644 (file)
@@ -231,7 +231,7 @@ public class PlotCommitList<L extends PlotLane> extends
                                }
                        if (newPos == -1)
                                newPos = positionsAllocated++;
-                       freePositions.add(commit.lane.getPosition());
+                       freePositions.add(Integer.valueOf(commit.lane.getPosition()));
                        activeLanes.remove(commit.lane);
                        commit.lane.position = newPos;
                        activeLanes.add(commit.lane);
index b539b50d6bd855240ffa33af834e38053c0acdc9..18e26da66a78a9d2280152daa65c7c70ae587f87 100644 (file)
@@ -351,7 +351,8 @@ public class ObjectWalk extends RevWalk {
                                default:
                                        throw new CorruptObjectException(MessageFormat.format(
                                                        JGitText.get().corruptObjectInvalidMode3,
-                                                       String.format("%o", mode), idBuffer.name(),
+                                                       String.format("%o", Integer.valueOf(mode)),
+                                                       idBuffer.name(),
                                                        RawParseUtils.decode(buf, tv.namePtr, tv.nameEnd),
                                                        tv.obj));
                                }
@@ -702,9 +703,10 @@ public class ObjectWalk extends RevWalk {
 
                        default:
                                idBuffer.fromRaw(raw, ptr);
-                               throw new CorruptObjectException(MessageFormat.format(JGitText
-                                               .get().corruptObjectInvalidMode3, String.format("%o",
-                                               mode), idBuffer.name(), "", tree));
+                               throw new CorruptObjectException(MessageFormat.format(
+                                               JGitText.get().corruptObjectInvalidMode3,
+                                               String.format("%o", Integer.valueOf(mode)),
+                                               idBuffer.name(), "", tree));
                        }
                        ptr += ID_SZ;
                }
index 2e63e74b51e10179d81faacb614da9929da0f938..a05cc9046f6baf4f0a31aff08c278177cbefea6e 100644 (file)
@@ -80,7 +80,9 @@ public class RevObjectList<E extends RevObject> extends AbstractList<E> {
 
        public void add(final int index, final E element) {
                if (index != size)
-                       throw new UnsupportedOperationException(MessageFormat.format(JGitText.get().unsupportedOperationNotAddAtEnd, index));
+                       throw new UnsupportedOperationException(MessageFormat.format(
+                                       JGitText.get().unsupportedOperationNotAddAtEnd,
+                                       Integer.valueOf(index)));
                set(index, element);
                size++;
        }
index 9b018f4797bba585f1f52c18f954678610940bad..0ef40d96e43fd6e7b1d60d8ab14a98958268dbf6 100644 (file)
@@ -682,7 +682,8 @@ public class RevWalk implements Iterable<RevCommit> {
                                r = new RevTag(id);
                                break;
                        default:
-                               throw new IllegalArgumentException(MessageFormat.format(JGitText.get().invalidGitType, type));
+                               throw new IllegalArgumentException(MessageFormat.format(
+                                               JGitText.get().invalidGitType, Integer.valueOf(type)));
                        }
                        objects.add(r);
                }
@@ -843,8 +844,8 @@ public class RevWalk implements Iterable<RevCommit> {
                        break;
                }
                default:
-                       throw new IllegalArgumentException(MessageFormat.format(JGitText
-                                       .get().badObjectType, type));
+                       throw new IllegalArgumentException(MessageFormat.format(
+                                       JGitText.get().badObjectType, Integer.valueOf(type)));
                }
                objects.add(r);
                return r;
@@ -1026,7 +1027,8 @@ public class RevWalk implements Iterable<RevCommit> {
        int allocFlag() {
                if (freeFlags == 0)
                        throw new IllegalArgumentException(MessageFormat.format(
-                                       JGitText.get().flagsAlreadyCreated, 32 - RESERVED_FLAGS));
+                                       JGitText.get().flagsAlreadyCreated,
+                                       Integer.valueOf(32 - RESERVED_FLAGS)));
                final int m = Integer.lowestOneBit(freeFlags);
                freeFlags &= ~m;
                return m;
index 95ca4a41f05d8fe606ff23fc64c8de26c56da939..3aa3c8f841029f30d62b938c547365e7f946b15a 100644 (file)
@@ -306,7 +306,9 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> {
                }
 
                if (curs.inflate(this, position, dstbuf, 0) != sz)
-                       throw new EOFException(MessageFormat.format(JGitText.get().shortCompressedStreamAt, position));
+                       throw new EOFException(MessageFormat.format(
+                                       JGitText.get().shortCompressedStreamAt,
+                                       Long.valueOf(position)));
                return dstbuf;
        }
 
@@ -406,7 +408,7 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> {
                                        setCorrupt(src.offset);
                                        throw new CorruptObjectException(MessageFormat.format(
                                                        JGitText.get().objectAtHasBadZlibStream,
-                                                       src.offset, getPackFile()));
+                                                       Long.valueOf(src.offset), getPackFile()));
                                }
                        } else if (validate) {
                                // We don't have a CRC32 code in the index, so compute it
@@ -435,7 +437,7 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> {
                                        setCorrupt(src.offset);
                                        throw new EOFException(MessageFormat.format(
                                                        JGitText.get().shortCompressedStreamAt,
-                                                       src.offset));
+                                                       Long.valueOf(src.offset)));
                                }
                                expectedCRC = crc1.getValue();
                        } else {
@@ -447,7 +449,7 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> {
                        CorruptObjectException corruptObject = new CorruptObjectException(
                                        MessageFormat.format(
                                                        JGitText.get().objectAtHasBadZlibStream,
-                                                       src.offset, getPackFile()));
+                                                       Long.valueOf(src.offset), getPackFile()));
                        corruptObject.initCause(dataFormat);
 
                        StoredObjectRepresentationNotAvailableException gone;
@@ -503,9 +505,9 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> {
                                cnt -= n;
                        }
                        if (validate && crc2.getValue() != expectedCRC) {
-                               throw new CorruptObjectException(MessageFormat.format(JGitText
-                                               .get().objectAtHasBadZlibStream, src.offset,
-                                               getPackFile()));
+                               throw new CorruptObjectException(MessageFormat.format(
+                                               JGitText.get().objectAtHasBadZlibStream,
+                                               Long.valueOf(src.offset), getPackFile()));
                        }
                }
        }
@@ -650,11 +652,14 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> {
                final long vers = NB.decodeUInt32(buf, 4);
                final long packCnt = NB.decodeUInt32(buf, 8);
                if (vers != 2 && vers != 3)
-                       throw new IOException(MessageFormat.format(JGitText.get().unsupportedPackVersion, vers));
+                       throw new IOException(MessageFormat.format(
+                                       JGitText.get().unsupportedPackVersion, Long.valueOf(vers)));
 
                if (packCnt != idx.getObjectCount())
                        throw new PackMismatchException(MessageFormat.format(
-                                       JGitText.get().packObjectCountMismatch, packCnt, idx.getObjectCount(), getPackFile()));
+                                       JGitText.get().packObjectCountMismatch,
+                                       Long.valueOf(packCnt), Long.valueOf(idx.getObjectCount()),
+                                       getPackFile()));
 
                fd.seek(length - 20);
                fd.readFully(buf, 0, 20);
@@ -753,7 +758,8 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> {
 
                                default:
                                        throw new IOException(MessageFormat.format(
-                                                       JGitText.get().unknownObjectType, typeCode));
+                                                       JGitText.get().unknownObjectType,
+                                                       Integer.valueOf(typeCode)));
                                }
                        }
 
@@ -801,8 +807,8 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> {
                } catch (DataFormatException dfe) {
                        CorruptObjectException coe = new CorruptObjectException(
                                        MessageFormat.format(
-                                                       JGitText.get().objectAtHasBadZlibStream, pos,
-                                                       getPackFile()));
+                                                       JGitText.get().objectAtHasBadZlibStream,
+                                                       Long.valueOf(pos), getPackFile()));
                        coe.initCause(dfe);
                        throw coe;
                }
@@ -906,8 +912,9 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> {
                        }
 
                        default:
-                               throw new IOException(MessageFormat.format(
-                                               JGitText.get().unknownObjectType, type));
+                               throw new IOException(
+                                               MessageFormat.format(JGitText.get().unknownObjectType,
+                                                               Integer.valueOf(type)));
                        }
                }
        }
@@ -954,14 +961,15 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> {
 
                default:
                        throw new IOException(MessageFormat.format(
-                                       JGitText.get().unknownObjectType, type));
+                                       JGitText.get().unknownObjectType, Integer.valueOf(type)));
                }
 
                try {
                        return BinaryDelta.getResultSize(getDeltaHeader(curs, deltaAt));
                } catch (DataFormatException e) {
-                       throw new CorruptObjectException(MessageFormat.format(JGitText
-                                       .get().objectAtHasBadZlibStream, pos, getPackFile()));
+                       throw new CorruptObjectException(MessageFormat.format(
+                                       JGitText.get().objectAtHasBadZlibStream, Long.valueOf(pos),
+                                       getPackFile()));
                }
        }
 
@@ -1009,8 +1017,9 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> {
                }
 
                default:
-                       throw new IOException(MessageFormat.format(
-                                       JGitText.get().unknownObjectType, typeCode));
+                       throw new IOException(
+                                       MessageFormat.format(JGitText.get().unknownObjectType,
+                                                       Integer.valueOf(typeCode)));
                }
        }
 
index a39da7935fd2901ed8e7fdd95d1454ab70a3d60d..ef987fa96acf0d0b1028254cdd6c79e511d62c27 100644 (file)
@@ -136,7 +136,9 @@ public abstract class PackIndex implements Iterable<PackIndex.MutableEntry> {
                        case 2:
                                return new PackIndexV2(fd);
                        default:
-                               throw new IOException(MessageFormat.format(JGitText.get().unsupportedPackIndexVersion, v));
+                               throw new IOException(MessageFormat.format(
+                                               JGitText.get().unsupportedPackIndexVersion,
+                                               Integer.valueOf(v)));
                        }
                }
                return new PackIndexV1(fd, hdr);
index da140ae9d531fc7d3931deb6e94825481021f1a2..b78c5ae267616debff88238619de08fec0c69dfd 100644 (file)
@@ -137,7 +137,8 @@ public abstract class PackIndexWriter {
                        return new PackIndexWriterV2(dst);
                default:
                        throw new IllegalArgumentException(MessageFormat.format(
-                                       JGitText.get().unsupportedPackIndexVersion, version));
+                                       JGitText.get().unsupportedPackIndexVersion,
+                                       Integer.valueOf(version)));
                }
        }
 
index 180bf60bfb27f2f4766afa13921b845ea91720b3..990106b9340ea09f2910120bee77d447c93484dd 100644 (file)
@@ -169,9 +169,10 @@ public class PackReverseIndex {
                if (offset <= Integer.MAX_VALUE) {
                        final int i32 = Arrays.binarySearch(offsets32, (int) offset);
                        if (i32 < 0)
-                               throw new CorruptObjectException(MessageFormat.format(
-                                               JGitText.get().cantFindObjectInReversePackIndexForTheSpecifiedOffset
-                                               , offset));
+                               throw new CorruptObjectException(
+                                               MessageFormat.format(
+                                                               JGitText.get().cantFindObjectInReversePackIndexForTheSpecifiedOffset,
+                                                               Long.valueOf(offset)));
 
                        if (i32 + 1 == offsets32.length) {
                                if (offsets64.length > 0)
@@ -182,9 +183,10 @@ public class PackReverseIndex {
                } else {
                        final int i64 = Arrays.binarySearch(offsets64, offset);
                        if (i64 < 0)
-                               throw new CorruptObjectException(MessageFormat.format(
-                                               JGitText.get().cantFindObjectInReversePackIndexForTheSpecifiedOffset
-                                               , offset));
+                               throw new CorruptObjectException(
+                                               MessageFormat.format(
+                                                               JGitText.get().cantFindObjectInReversePackIndexForTheSpecifiedOffset,
+                                                               Long.valueOf(offset)));
 
                        if (i64 + 1 == offsets64.length)
                                return maxOffset;
index 1a056e3c1e7721f839ea5d69fe50aea6611214f3..03cf649a2985368774aa7724e2e1f5065bece11e 100644 (file)
@@ -2185,8 +2185,8 @@ public class PackWriter {
                /** @return formatted message string for display to clients. */
                public String getMessage() {
                        return MessageFormat.format(JGitText.get().packWriterStatistics, //
-                                       totalObjects, totalDeltas, //
-                                       reusedObjects, reusedDeltas);
+                                       Long.valueOf(totalObjects), Long.valueOf(totalDeltas), //
+                                       Long.valueOf(reusedObjects), Long.valueOf(reusedDeltas));
                }
        }
 
index f5934d3b05779ab7a12f9c893682d7f1db56aeab..8a595db336fc1282149f8a426c9e42338b082970 100644 (file)
@@ -510,8 +510,10 @@ public class AmazonS3 {
 
        private IOException error(final String action, final String key,
                        final HttpURLConnection c) throws IOException {
-               final IOException err = new IOException(MessageFormat.format(JGitText.get().amazonS3ActionFailed
-                               , action, key, HttpSupport.response(c), c.getResponseMessage()));
+               final IOException err = new IOException(MessageFormat.format(
+                               JGitText.get().amazonS3ActionFailed, action, key,
+                               Integer.valueOf(HttpSupport.response(c)),
+                               c.getResponseMessage()));
                final InputStream errorStream = c.getErrorStream();
                if (errorStream == null)
                        return err;
@@ -532,8 +534,9 @@ public class AmazonS3 {
        }
 
        private IOException maxAttempts(final String action, final String key) {
-               return new IOException(MessageFormat.format(JGitText.get().amazonS3ActionFailedGivingUp
-                               , action, key, maxAttempts));
+               return new IOException(MessageFormat.format(
+                               JGitText.get().amazonS3ActionFailedGivingUp, action, key,
+                               Integer.valueOf(maxAttempts)));
        }
 
        private HttpURLConnection open(final String method, final String bucket,
index b042dabe9078291fc8bf9cd72a42d85787b31538..8bf030bb8d3dd82e29c83ff88927dd1a6a466142 100644 (file)
@@ -181,7 +181,9 @@ public abstract class BasePackPushConnection extends BasePackConnection implemen
                                        //
                                        int b = in.read();
                                        if (0 <= b)
-                                               throw new TransportException(uri, MessageFormat.format(JGitText.get().expectedEOFReceived, (char) b));
+                                               throw new TransportException(uri, MessageFormat.format(
+                                                               JGitText.get().expectedEOFReceived,
+                                                               Character.valueOf((char) b)));
                                }
                        }
                } catch (TransportException e) {
index 584d9337e12e00bfa78c203f46a38d3afde05e4e..6b4bf2a41e2518041825fc7dd28e1c4dec1017db 100644 (file)
@@ -506,17 +506,17 @@ public abstract class PackParser {
                                resolveDeltas(resolving);
                                if (entryCount < objectCount) {
                                        if (!isAllowThin()) {
-                                               throw new IOException(MessageFormat.format(JGitText
-                                                               .get().packHasUnresolvedDeltas,
-                                                               (objectCount - entryCount)));
+                                               throw new IOException(MessageFormat.format(
+                                                               JGitText.get().packHasUnresolvedDeltas,
+                                                               Long.valueOf(objectCount - entryCount)));
                                        }
 
                                        resolveDeltasWithExternalBases(resolving);
 
                                        if (entryCount < objectCount) {
-                                               throw new IOException(MessageFormat.format(JGitText
-                                                               .get().packHasUnresolvedDeltas,
-                                                               (objectCount - entryCount)));
+                                               throw new IOException(MessageFormat.format(
+                                                               JGitText.get().packHasUnresolvedDeltas,
+                                                               Long.valueOf(objectCount - entryCount)));
                                        }
                                }
                                resolving.endTask();
@@ -573,13 +573,14 @@ public abstract class PackParser {
                        break;
                default:
                        throw new IOException(MessageFormat.format(
-                                       JGitText.get().unknownObjectType, info.type));
+                                       JGitText.get().unknownObjectType,
+                                       Integer.valueOf(info.type)));
                }
 
                if (!checkCRC(oe.getCRC())) {
                        throw new IOException(MessageFormat.format(
-                                       JGitText.get().corruptionDetectedReReadingAt, oe
-                                                       .getOffset()));
+                                       JGitText.get().corruptionDetectedReReadingAt,
+                                       Long.valueOf(oe.getOffset())));
                }
 
                resolveDeltas(visit.next(), info.type, info, progress);
@@ -598,7 +599,8 @@ public abstract class PackParser {
 
                        default:
                                throw new IOException(MessageFormat.format(
-                                               JGitText.get().unknownObjectType, info.type));
+                                               JGitText.get().unknownObjectType,
+                                               Integer.valueOf(info.type)));
                        }
 
                        byte[] delta = inflateAndReturn(Source.DATABASE, info.size);
@@ -610,7 +612,7 @@ public abstract class PackParser {
                        if (!checkCRC(visit.delta.crc))
                                throw new IOException(MessageFormat.format(
                                                JGitText.get().corruptionDetectedReReadingAt,
-                                               visit.delta.position));
+                                               Long.valueOf(visit.delta.position)));
 
                        objectDigest.update(Constants.encodedTypeString(type));
                        objectDigest.update((byte) ' ');
@@ -649,7 +651,8 @@ public abstract class PackParser {
 
                        default:
                                throw new IOException(MessageFormat.format(
-                                               JGitText.get().unknownObjectType, typeCode));
+                                               JGitText.get().unknownObjectType,
+                                               Integer.valueOf(typeCode)));
                        }
        }
 
@@ -713,7 +716,8 @@ public abstract class PackParser {
 
                default:
                        throw new IOException(MessageFormat.format(
-                                       JGitText.get().unknownObjectType, info.type));
+                                       JGitText.get().unknownObjectType,
+                                       Integer.valueOf(info.type)));
                }
                return info;
        }
@@ -831,7 +835,7 @@ public abstract class PackParser {
                final long vers = NB.decodeUInt32(buf, p + 4);
                if (vers != 2 && vers != 3)
                        throw new IOException(MessageFormat.format(
-                                       JGitText.get().unsupportedPackVersion, vers));
+                                       JGitText.get().unsupportedPackVersion, Long.valueOf(vers)));
                objectCount = NB.decodeUInt32(buf, p + 8);
                use(hdrln);
 
@@ -952,8 +956,9 @@ public abstract class PackParser {
                }
 
                default:
-                       throw new IOException(MessageFormat.format(
-                                       JGitText.get().unknownObjectType, typeCode));
+                       throw new IOException(
+                                       MessageFormat.format(JGitText.get().unknownObjectType,
+                                                       Integer.valueOf(typeCode)));
                }
        }
 
@@ -1038,7 +1043,8 @@ public abstract class PackParser {
 
                        if (info.type != Constants.OBJ_BLOB)
                                throw new IOException(MessageFormat.format(
-                                               JGitText.get().unknownObjectType, info.type));
+                                               JGitText.get().unknownObjectType,
+                                               Integer.valueOf(info.type)));
 
                        ObjectStream cur = readCurs.open(obj, info.type).openStream();
                        try {
index 5feeeaf219687678df74fd56cd9094843b9ed4dc..bc9f649959733728fd74595799a01b1bbc09aef8 100644 (file)
@@ -172,7 +172,9 @@ class SideBandInputStream extends InputStream {
                                eof = true;
                                throw new TransportException(PFX_REMOTE + readString(available));
                        default:
-                               throw new PackProtocolException(MessageFormat.format(JGitText.get().invalidChannel, channel));
+                               throw new PackProtocolException(
+                                               MessageFormat.format(JGitText.get().invalidChannel,
+                                                               Integer.valueOf(channel)));
                        }
                }
        }
index 521aea0d722c8cce987bb5fe596c65239c78f458..8fe78b680cf2ccf79def890143e669907703c8fe 100644 (file)
@@ -102,11 +102,17 @@ 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, chan));
+                       throw new IllegalArgumentException(MessageFormat.format(
+                                       JGitText.get().channelMustBeInRange0_255,
+                                       Integer.valueOf(chan)));
                if (sz <= HDR_SIZE)
-                       throw new IllegalArgumentException(MessageFormat.format(JGitText.get().packetSizeMustBeAtLeast, sz, HDR_SIZE));
+                       throw new IllegalArgumentException(MessageFormat.format(
+                                       JGitText.get().packetSizeMustBeAtLeast,
+                                       Integer.valueOf(sz), Integer.valueOf(HDR_SIZE)));
                else if (MAX_BUF < sz)
-                       throw new IllegalArgumentException(MessageFormat.format(JGitText.get().packetSizeMustBeAtMost, sz, MAX_BUF));
+                       throw new IllegalArgumentException(MessageFormat.format(
+                                       JGitText.get().packetSizeMustBeAtMost, Integer.valueOf(sz),
+                                       Integer.valueOf(MAX_BUF)));
 
                out = os;
                buffer = new byte[sz];
index 862d08307f9ea4e0888abbcd363481883d8dd754..71f5bcb51e548c00b1ddf5058a25be4e19ccfe2d 100644 (file)
@@ -344,7 +344,8 @@ public class TransportHttp extends HttpTransport implements WalkTransport,
 
                        default:
                                throw new TransportException(uri, MessageFormat.format(
-                                               JGitText.get().cannotReadHEAD, status, conn.getResponseMessage()));
+                                               JGitText.get().cannotReadHEAD, Integer.valueOf(status),
+                                               conn.getResponseMessage()));
                        }
                }
 
index 26498d2d8727b047823e0e1c97d2fd539ac09652..dec6a4f40527a0b182a1eabcf595f31d47875200 100644 (file)
@@ -242,7 +242,7 @@ public class TransportSftp extends SshTransport implements WalkTransport {
                                        if (!files.containsKey(in))
                                                continue;
 
-                                       mtimes.put(n, ent.getAttrs().getMTime());
+                                       mtimes.put(n, Integer.valueOf(ent.getAttrs().getMTime()));
                                        packs.add(n);
                                }
 
index ed12937c890397ed275548700587a75c7e801454..f1710bd5c0c26ae0a53d70b71c1bf9adcd7be072 100644 (file)
@@ -638,8 +638,10 @@ class WalkFetchConnection extends BaseFetchConnection {
 
                ObjectId act = inserter.insert(type, raw);
                if (!AnyObjectId.equals(id, act)) {
-                       throw new TransportException(MessageFormat.format(JGitText.get().incorrectHashFor
-                                       , id.name(), act.name(), Constants.typeString(type), compressed.length));
+                       throw new TransportException(MessageFormat.format(
+                                       JGitText.get().incorrectHashFor, id.name(), act.name(),
+                                       Constants.typeString(type),
+                                       Integer.valueOf(compressed.length)));
                }
                inserter.flush();
        }
index a033d300eab72b5f592fa2829c6960fb887d375b..b59148fc303aec72e47e2721c6b2d9d8bd8b811f 100644 (file)
@@ -284,8 +284,8 @@ public class Base64 {
 
                        } else if (sbiDecode != WHITE_SPACE_DEC)
                                throw new IllegalArgumentException(MessageFormat.format(
-                                               JGitText.get().badBase64InputCharacterAt, i,
-                                               source[i] & 0xff));
+                                               JGitText.get().badBase64InputCharacterAt,
+                                               Integer.valueOf(i), Integer.valueOf(source[i] & 0xff)));
                }
 
                if (outBuff.length == outBuffPosn)
index 5216cc6278cbbcfab63c7aa782636ffaf48f7324..352e23724726b591c74264660a921b77bc41f9f4 100644 (file)
@@ -117,7 +117,8 @@ public final class InterruptTimer {
         */
        public void begin(final int timeout) {
                if (timeout <= 0)
-                       throw new IllegalArgumentException(MessageFormat.format(JGitText.get().invalidTimeout, timeout));
+                       throw new IllegalArgumentException(MessageFormat.format(
+                                       JGitText.get().invalidTimeout, Integer.valueOf(timeout)));
                Thread.interrupted();
                state.begin(timeout);
        }
index f712ca1884bd2b9bb0bed580fe2a6d83f1e31706..cda2b59b4306cf38632c5ed309e522c746bb6465 100644 (file)
@@ -83,7 +83,8 @@ public class TimeoutInputStream extends FilterInputStream {
         */
        public void setTimeout(final int millis) {
                if (millis < 0)
-                       throw new IllegalArgumentException(MessageFormat.format(JGitText.get().invalidTimeout, millis));
+                       throw new IllegalArgumentException(MessageFormat.format(
+                                       JGitText.get().invalidTimeout, Integer.valueOf(millis)));
                timeout = millis;
        }
 
index bed158f7625342138afa22eee641d1d9434409c8..b074396a75e39b7f1c02397c8d0f2e51f28eee6c 100644 (file)
@@ -84,7 +84,8 @@ public class TimeoutOutputStream extends OutputStream {
         */
        public void setTimeout(final int millis) {
                if (millis < 0)
-                       throw new IllegalArgumentException(MessageFormat.format(JGitText.get().invalidTimeout, millis));
+                       throw new IllegalArgumentException(MessageFormat.format(
+                                       JGitText.get().invalidTimeout, Integer.valueOf(millis)));
                timeout = millis;
        }