diff options
Diffstat (limited to 'org.eclipse.jgit.test')
6 files changed, 44 insertions, 41 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java index db2d5d1404..aa65985c55 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java @@ -1259,7 +1259,7 @@ public class AddCommandTest extends RepositoryTestCase { "[git-link-dir, mode:160000]", indexState(0)); Set<String> untrackedFiles = git.status().call().getUntracked(); - assert (untrackedFiles.isEmpty()); + assert untrackedFiles.isEmpty(); } } @@ -1274,7 +1274,7 @@ public class AddCommandTest extends RepositoryTestCase { ConfigConstants.CONFIG_KEY_DIRNOGITLINKS, true); config.save(); - assert (db.getConfig().get(WorkingTreeOptions.KEY).isDirNoGitLinks()); + assert db.getConfig().get(WorkingTreeOptions.KEY).isDirNoGitLinks(); try (Git git = new Git(db)) { git.add().addFilepattern("nested-repo").call(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/TreeWalkAttributeTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/TreeWalkAttributeTest.java index 73abd2d37e..698fdb31a8 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/TreeWalkAttributeTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/TreeWalkAttributeTest.java @@ -791,7 +791,7 @@ public class TreeWalkAttributeTest extends RepositoryTestCase { for (Attribute a : attributes) { ret.add(a); } - return (ret); + return ret; } private File writeAttributesFile(String name, String... rules) diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsPackParserTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsPackParserTest.java index 845d5fcca1..130af27773 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsPackParserTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsPackParserTest.java @@ -46,10 +46,10 @@ public class DfsPackParserTest { .fromString("2e65efe2a145dda7ee51d1741299f848e5bf752e"); pack.header(2); - pack.write((Constants.OBJ_BLOB) << 4 | 1); + pack.write(Constants.OBJ_BLOB << 4 | 1); pack.deflate(new byte[] { 'a' }); - pack.write((Constants.OBJ_REF_DELTA) << 4 | 4); + pack.write(Constants.OBJ_REF_DELTA << 4 | 4); pack.copyRaw(blobA); pack.deflate(new byte[] { 0x1, 0x1, 0x1, 'b' }); pack.digest(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PackParserTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PackParserTest.java index 2fd82e7bdb..6148df99f3 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PackParserTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PackParserTest.java @@ -191,7 +191,7 @@ public class PackParserTest extends RepositoryTestCase { InMemoryPack pack = new InMemoryPack(); pack.header(1); - pack.write((Constants.OBJ_REF_DELTA) << 4 | 4); + pack.write(Constants.OBJ_REF_DELTA << 4 | 4); pack.copyRaw(a); pack.deflate(new byte[] { 0x1, 0x1, 0x1, 'b' }); pack.digest(); @@ -211,7 +211,7 @@ public class PackParserTest extends RepositoryTestCase { InMemoryPack pack = new InMemoryPack(); pack.header(1); - pack.write((Constants.OBJ_BLOB) << 4 | 0x80 | 1); + pack.write(Constants.OBJ_BLOB << 4 | 0x80 | 1); pack.write(1); pack.deflate(data); pack.digest(); @@ -231,9 +231,9 @@ public class PackParserTest extends RepositoryTestCase { InMemoryPack pack = new InMemoryPack(); pack.header(2); - pack.write((Constants.OBJ_BLOB) << 4 | 10); // offset 12 + pack.write(Constants.OBJ_BLOB << 4 | 10); // offset 12 pack.deflate(data); - pack.write((Constants.OBJ_OFS_DELTA) << 4 | 4); // offset 31 + pack.write(Constants.OBJ_OFS_DELTA << 4 | 4); // offset 31 pack.write(19); pack.deflate(new byte[] { 0xA, 0xB, 0x1, 'b' }); pack.digest(); @@ -270,7 +270,7 @@ public class PackParserTest extends RepositoryTestCase { InMemoryPack pack = new InMemoryPack(); pack.header(1); - pack.write((Constants.OBJ_REF_DELTA) << 4 | 4); + pack.write(Constants.OBJ_REF_DELTA << 4 | 4); pack.copyRaw(a); pack.deflate(new byte[] { 0x1, 0x1, 0x1, 'b' }); pack.digest(); @@ -300,7 +300,7 @@ public class PackParserTest extends RepositoryTestCase { InMemoryPack pack = new InMemoryPack(); pack.header(1); - pack.write((Constants.OBJ_BLOB) << 4 | 10); + pack.write(Constants.OBJ_BLOB << 4 | 10); pack.deflate(data); pack.digest(); @@ -333,7 +333,7 @@ public class PackParserTest extends RepositoryTestCase { InMemoryPack pack = new InMemoryPack(); pack.header(1); - pack.write((Constants.OBJ_REF_DELTA) << 4 | 14); + pack.write(Constants.OBJ_REF_DELTA << 4 | 14); pack.copyRaw(a); pack.deflate(new byte[] { 1, 11, 11, 'a', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }); @@ -366,7 +366,7 @@ public class PackParserTest extends RepositoryTestCase { InMemoryPack pack = new InMemoryPack(); pack.header(1); - pack.write((Constants.OBJ_REF_DELTA) << 4 | 4); + pack.write(Constants.OBJ_REF_DELTA << 4 | 4); pack.copyRaw(a); pack.deflate(new byte[] { 10, 11, 1, 'a' }); pack.digest(); @@ -398,7 +398,7 @@ public class PackParserTest extends RepositoryTestCase { InMemoryPack pack = new InMemoryPack(); pack.header(1); - pack.write((Constants.OBJ_REF_DELTA) << 4 | 4); + pack.write(Constants.OBJ_REF_DELTA << 4 | 4); pack.copyRaw(a); pack.deflate(new byte[] { 0x1, 0x1, 0x1, 'b' }); pack.digest(); @@ -439,7 +439,7 @@ public class PackParserTest extends RepositoryTestCase { InMemoryPack pack = new InMemoryPack(); pack.header(1); - pack.write((Constants.OBJ_REF_DELTA) << 4 | 4); + pack.write(Constants.OBJ_REF_DELTA << 4 | 4); pack.copyRaw(a); pack.deflate(new byte[] { 0x1, 0x1, 0x1, 'b' }); pack.digest(); @@ -470,7 +470,7 @@ public class PackParserTest extends RepositoryTestCase { pack.header(objects); for (int i = 0; i < objects; i++) { - pack.write((Constants.OBJ_BLOB) << 4 | 10); + pack.write(Constants.OBJ_BLOB << 4 | 10); pack.deflate(data); } pack.digest(); @@ -508,7 +508,7 @@ public class PackParserTest extends RepositoryTestCase { for (int i = 0; i < offset; i++) sb.append(i); offset = sb.toString().length(); - int lenByte = (Constants.OBJ_BLOB) << 4 | (offset & 0x0F); + int lenByte = Constants.OBJ_BLOB << 4 | (offset & 0x0F); offset >>= 4; if (offset > 0) lenByte |= 1 << 7; @@ -525,7 +525,7 @@ public class PackParserTest extends RepositoryTestCase { for (int i = 0; i < objects; i++) { // The last pack header written falls across the 8192 byte boundary // between [8189:8210] - pack.write((Constants.OBJ_REF_DELTA) << 4 | 4); + pack.write(Constants.OBJ_REF_DELTA << 4 | 4); pack.copyRaw(b); pack.deflate(new byte[] { 0x1, 0x1, 0x1, 'b' }); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackAdvertiseRefsHookTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackAdvertiseRefsHookTest.java index a91bc95c8d..7dac27f612 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackAdvertiseRefsHookTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackAdvertiseRefsHookTest.java @@ -187,10 +187,10 @@ public class ReceivePackAdvertiseRefsHookTest extends LocalDiskRepositoryTestCas TemporaryBuffer.Heap pack = new TemporaryBuffer.Heap(1024); packHeader(pack, 2); - pack.write((Constants.OBJ_BLOB) << 4 | 1); + pack.write(Constants.OBJ_BLOB << 4 | 1); deflate(pack, new byte[] { 'a' }); - pack.write((Constants.OBJ_REF_DELTA) << 4 | 4); + pack.write(Constants.OBJ_REF_DELTA << 4 | 4); a.copyRawTo(pack); deflate(pack, new byte[] { 0x1, 0x1, 0x1, 'b' }); @@ -296,7 +296,7 @@ public class ReceivePackAdvertiseRefsHookTest extends LocalDiskRepositoryTestCas packHeader(pack, 3); copy(pack, src.open(N)); copy(pack, src.open(s.parseBody(N).getTree())); - pack.write((Constants.OBJ_REF_DELTA) << 4 | 4); + pack.write(Constants.OBJ_REF_DELTA << 4 | 4); b.copyRawTo(pack); deflate(pack, delta); digest(pack); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java index 026492f7b6..def73acadd 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java @@ -1800,14 +1800,15 @@ public class UploadPackTest { RevBlob blobHighDepth = remote.blob("hi"); RevTree subtree = remote.tree(remote.file("1", blobHighDepth)); - RevTree rootTree = (new TreeBuilder() { + + RevTree rootTree = new TreeBuilder() { @Override void addElements(DirCacheBuilder dcBuilder) throws Exception { dcBuilder.add(remote.file("1", blobLowDepth)); dcBuilder.addTree(new byte[] {'2'}, DirCacheEntry.STAGE_0, remote.getRevWalk().getObjectReader(), subtree); } - }).build(); + }.build(); RevCommit commit = remote.commit(rootTree); DeepTreePreparator() throws Exception {} @@ -1904,21 +1905,23 @@ public class UploadPackTest { class RepeatedSubtreePreparator { RevBlob foo = remote.blob("foo"); RevTree subtree3 = remote.tree(remote.file("foo", foo)); - RevTree subtree2 = (new TreeBuilder() { + RevTree subtree2 = new TreeBuilder() { @Override void addElements(DirCacheBuilder dcBuilder) throws Exception { dcBuilder.addTree(new byte[] {'b'}, DirCacheEntry.STAGE_0, remote.getRevWalk().getObjectReader(), subtree3); } - }).build(); - RevTree subtree1 = (new TreeBuilder() { + }.build(); + + RevTree subtree1 = new TreeBuilder() { @Override void addElements(DirCacheBuilder dcBuilder) throws Exception { dcBuilder.addTree(new byte[] {'x'}, DirCacheEntry.STAGE_0, remote.getRevWalk().getObjectReader(), subtree2); } - }).build(); - RevTree rootTree = (new TreeBuilder() { + }.build(); + + RevTree rootTree = new TreeBuilder() { @Override void addElements(DirCacheBuilder dcBuilder) throws Exception { dcBuilder.addTree(new byte[] {'a'}, DirCacheEntry.STAGE_0, @@ -1926,7 +1929,7 @@ public class UploadPackTest { dcBuilder.addTree(new byte[] {'x'}, DirCacheEntry.STAGE_0, remote.getRevWalk().getObjectReader(), subtree2); } - }).build(); + }.build(); RevCommit commit = remote.commit(rootTree); RepeatedSubtreePreparator() throws Exception {} @@ -1970,22 +1973,22 @@ public class UploadPackTest { RevTree subtree1 = remote.tree(remote.file("foo", foo)); /** b/foo */ - RevTree subtree2 = (new TreeBuilder() { + RevTree subtree2 = new TreeBuilder() { @Override void addElements(DirCacheBuilder dcBuilder) throws Exception { dcBuilder.addTree(new byte[] {'b'}, DirCacheEntry.STAGE_0, remote.getRevWalk().getObjectReader(), subtree1); } - }).build(); + }.build(); /** x/b/foo */ - RevTree subtree3 = (new TreeBuilder() { + RevTree subtree3 = new TreeBuilder() { @Override void addElements(DirCacheBuilder dcBuilder) throws Exception { dcBuilder.addTree(new byte[] {'x'}, DirCacheEntry.STAGE_0, remote.getRevWalk().getObjectReader(), subtree2); } - }).build(); + }.build(); RevBlob baz = remote.blob("baz"); @@ -1993,33 +1996,33 @@ public class UploadPackTest { RevTree subtree4 = remote.tree(remote.file("baz", baz)); /** c/baz */ - RevTree subtree5 = (new TreeBuilder() { + RevTree subtree5 = new TreeBuilder() { @Override void addElements(DirCacheBuilder dcBuilder) throws Exception { dcBuilder.addTree(new byte[] {'c'}, DirCacheEntry.STAGE_0, remote.getRevWalk().getObjectReader(), subtree4); } - }).build(); + }.build(); /** u/c/baz */ - RevTree subtree6 = (new TreeBuilder() { + RevTree subtree6 = new TreeBuilder() { @Override void addElements(DirCacheBuilder dcBuilder) throws Exception { dcBuilder.addTree(new byte[] {'u'}, DirCacheEntry.STAGE_0, remote.getRevWalk().getObjectReader(), subtree5); } - }).build(); + }.build(); /** v/c/baz */ - RevTree subtree7 = (new TreeBuilder() { + RevTree subtree7 = new TreeBuilder() { @Override void addElements(DirCacheBuilder dcBuilder) throws Exception { dcBuilder.addTree(new byte[] {'v'}, DirCacheEntry.STAGE_0, remote.getRevWalk().getObjectReader(), subtree5); } - }).build(); + }.build(); - RevTree rootTree = (new TreeBuilder() { + RevTree rootTree = new TreeBuilder() { @Override void addElements(DirCacheBuilder dcBuilder) throws Exception { dcBuilder.addTree(new byte[] {'a'}, DirCacheEntry.STAGE_0, @@ -2031,7 +2034,7 @@ public class UploadPackTest { dcBuilder.addTree(new byte[] {'z'}, DirCacheEntry.STAGE_0, remote.getRevWalk().getObjectReader(), subtree7); } - }).build(); + }.build(); RevCommit commit = remote.commit(rootTree); RepeatedSubtreeAtSameLevelPreparator() throws Exception {} |