id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
35185022_8 | {
"fields": [
{
"declarator": "thrown= ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException thrown= ExpectedException.none();",
"type": "ExpectedException",
"var_name": "thrown"
}
],
"file": "core/src/test/java/co... | {
"body": "@Test\n public void MaxLegalSameCacheSize() {\n VCDiffAddressCacheImpl i = new VCDiffAddressCacheImpl((short) 0, (short) (VCDiffAddressCache.VCD_MAX_MODES - 2));\n i.Init();\n }",
"class_method_signature": "VCDiffAddressCacheTest.MaxLegalSameCacheSize()",
"constructor": false,
"fu... | {
"fields": [
{
"declarator": "VCD_SELF_MODE = (short)0",
"modifier": "public static final",
"original_string": "public static final short VCD_SELF_MODE = (short)0;",
"type": "short",
"var_name": "VCD_SELF_MODE"
},
{
"declarator": "VCD_HERE_MODE = (short)1",
"modi... | {
"body": "public abstract void Init();",
"class_method_signature": "VCDiffAddressCache.Init()",
"constructor": false,
"full_signature": "public abstract void Init()",
"identifier": "Init",
"invocations": [],
"modifiers": "public abstract",
"parameters": "()",
"return": "void",
"signature": "void In... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_67 | {
"fields": [],
"file": "core/src/test/java/com/davidehrmann/vcdiff/engine/VCDiffInstructionMapTest.java",
"identifier": "VCDiffInstructionMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void DefaultMapLookupSecondCopyInvalid() {\n assertEquals(kNoOpcode, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupSecondOpcode((byte) 2, VCD_COPY, (byte) 0, (byte) 0));\n assertEquals(kNoOpcode, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupSecondOpcode((byte) 2, ... | {
"fields": [
{
"declarator": "DEFAULT_INSTRUCTION_MAP = new VCDiffInstructionMap(\n VCDiffCodeTableData.kDefaultCodeTableData, VCDiffAddressCache.DefaultLastMode())",
"modifier": "public static final",
"original_string": "public static final VCDiffInstructionMap DEFAULT_INSTRUCTION_M... | {
"body": "public short LookupSecondOpcode(byte first_opcode, byte inst, byte size, byte mode) {\n return second_instruction_map_.Lookup(first_opcode, inst, size, mode);\n }",
"class_method_signature": "VCDiffInstructionMap.LookupSecondOpcode(byte first_opcode, byte inst, byte size, byte mode)",
"constr... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_88 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testInvalidDelta() throws Exception {\n exit.expectSystemExit();\n\n File invalidDeltaFile = tempFolder.newFile(\"invalid_delta\");\n\n Random random = new Random(42);\n try (FileOutputStream out = new FileOutputStream(invalidDeltaFile)) {\n for... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_30 | {
"fields": [
{
"declarator": "code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone()",
"modifier": "private",
"original_string": "private VCDiffCodeTableData code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone();",
"type": "VCDiffCodeTableData",
"var_nam... | {
"body": "@Test\n public void SecondNoOpWithNonzeroMode() {\n VerifyInstruction(20, VCDiffCodeTableData.VCD_COPY, (byte) 4, (byte) 0);\n Assert.assertEquals(VCDiffCodeTableData.VCD_NOOP, code_table_data_.inst2[20]);\n code_table_data_.mode2[20] = 1;\n Assert.assertFalse(code_table_data... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class);",
"type": "Logger",
"var_name": "LOGGER"
}... | {
"body": "protected boolean Validate(short max_mode) {\n final int kNumberOfTypesAndModes = VCD_LAST_INSTRUCTION_TYPE + max_mode + 1;\n boolean[] hasOpcodeForTypeAndMode = new boolean[VCD_LAST_INSTRUCTION_TYPE + VCDiffAddressCache.VCD_MAX_MODES];\n boolean no_errors_found = true;\n for (i... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_31 | {
"fields": [
{
"declarator": "code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone()",
"modifier": "private",
"original_string": "private VCDiffCodeTableData code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone();",
"type": "VCDiffCodeTableData",
"var_nam... | {
"body": "@Test\n public void SecondNoOpWithNonzeroSize() {\n VerifyInstruction(20, VCDiffCodeTableData.VCD_COPY, (byte) 4, (byte) 0);\n Assert.assertEquals(VCDiffCodeTableData.VCD_NOOP, code_table_data_.inst2[20]);\n code_table_data_.size2[20] = 1;\n Assert.assertFalse(code_table_data... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class);",
"type": "Logger",
"var_name": "LOGGER"
}... | {
"body": "protected boolean Validate(short max_mode) {\n final int kNumberOfTypesAndModes = VCD_LAST_INSTRUCTION_TYPE + max_mode + 1;\n boolean[] hasOpcodeForTypeAndMode = new boolean[VCD_LAST_INSTRUCTION_TYPE + VCDiffAddressCache.VCD_MAX_MODES];\n boolean no_errors_found = true;\n for (i... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_66 | {
"fields": [],
"file": "core/src/test/java/com/davidehrmann/vcdiff/engine/VCDiffInstructionMapTest.java",
"identifier": "VCDiffInstructionMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void DefaultMapLookupSecondCopyMode8() {\n Assert.assertEquals(243, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupSecondOpcode((byte) 2, VCD_COPY, (byte) 4, (byte) 8));\n Assert.assertEquals(244, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupSecondOpcode((byte) 3, ... | {
"fields": [
{
"declarator": "DEFAULT_INSTRUCTION_MAP = new VCDiffInstructionMap(\n VCDiffCodeTableData.kDefaultCodeTableData, VCDiffAddressCache.DefaultLastMode())",
"modifier": "public static final",
"original_string": "public static final VCDiffInstructionMap DEFAULT_INSTRUCTION_M... | {
"body": "public short LookupSecondOpcode(byte first_opcode, byte inst, byte size, byte mode) {\n return second_instruction_map_.Lookup(first_opcode, inst, size, mode);\n }",
"class_method_signature": "VCDiffInstructionMap.LookupSecondOpcode(byte first_opcode, byte inst, byte size, byte mode)",
"constr... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_89 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void missingDictionary() throws Exception {\n exit.expectSystemExit();\n VCDiffFileBasedCoder.main(new String[] {\n \"encode\",\n \"-interleaved\",\n \"-checksum\",\n \"-delta\", deltaFile.getCanonicalPath(),\n ... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_9 | {
"fields": [
{
"declarator": "thrown= ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException thrown= ExpectedException.none();",
"type": "ExpectedException",
"var_name": "thrown"
}
],
"file": "core/src/test/java/co... | {
"body": "@Test\n public void MaxLegalCombinedSizes() {\n VCDiffAddressCacheImpl i = new VCDiffAddressCacheImpl((short) (VCDiffAddressCache.VCD_MAX_MODES / 2 - 1), (short) (VCDiffAddressCache.VCD_MAX_MODES / 2 - 1));\n i.Init();\n }",
"class_method_signature": "VCDiffAddressCacheTest.MaxLegalCo... | {
"fields": [
{
"declarator": "VCD_SELF_MODE = (short)0",
"modifier": "public static final",
"original_string": "public static final short VCD_SELF_MODE = (short)0;",
"type": "short",
"var_name": "VCD_SELF_MODE"
},
{
"declarator": "VCD_HERE_MODE = (short)1",
"modi... | {
"body": "public abstract void Init();",
"class_method_signature": "VCDiffAddressCache.Init()",
"constructor": false,
"full_signature": "public abstract void Init()",
"identifier": "Init",
"invocations": [],
"modifiers": "public abstract",
"parameters": "()",
"return": "void",
"signature": "void In... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_70 | {
"fields": [
{
"declarator": "coder_ = null",
"modifier": "private",
"original_string": "private JSONCodeTableWriter coder_ = null;",
"type": "JSONCodeTableWriter",
"var_name": "coder_"
},
{
"declarator": "writer = null",
"modifier": "private",
"original_st... | {
"body": "@Test\n public void Add() throws IOException {\n coder_.add(\"123\".getBytes(StandardCharsets.US_ASCII), 0, 3);\n coder_.output(writer);\n coder_.finishEncoding(writer);\n assertEquals(\"[\\\"123\\\"]\", writer.toString());\n }",
"class_method_signature": "JSONCodeTableW... | {
"fields": [
{
"declarator": "output = new StringBuilder(1024)",
"modifier": "private",
"original_string": "private StringBuilder output = new StringBuilder(1024);",
"type": "StringBuilder",
"var_name": "output"
},
{
"declarator": "outputCalled = false",
"modifie... | {
"body": "public void add(final byte[] data, final int offset, final int length) {\n if (offset < 0 || offset + length > data.length) {\n throw new IllegalArgumentException();\n }\n\n // add leading comma if this is not the first opcode.\n if (opcodeAdded) {\n output... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_27 | {
"fields": [
{
"declarator": "code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone()",
"modifier": "private",
"original_string": "private VCDiffCodeTableData code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone();",
"type": "VCDiffCodeTableData",
"var_nam... | {
"body": "@Test\n public void BadSecondMode() {\n VerifyInstruction(20, VCDiffCodeTableData.VCD_COPY, (byte) 4, (byte) 0);\n code_table_data_.inst2[20] = VCDiffCodeTableData.VCD_COPY;\n Assert.assertTrue(code_table_data_.Validate());\n code_table_data_.mode2[20] = (byte) (VCDiffAddress... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class);",
"type": "Logger",
"var_name": "LOGGER"
}... | {
"body": "protected boolean Validate(short max_mode) {\n final int kNumberOfTypesAndModes = VCD_LAST_INSTRUCTION_TYPE + max_mode + 1;\n boolean[] hasOpcodeForTypeAndMode = new boolean[VCD_LAST_INSTRUCTION_TYPE + VCDiffAddressCache.VCD_MAX_MODES];\n boolean no_errors_found = true;\n for (i... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_50 | {
"fields": [],
"file": "core/src/test/java/com/davidehrmann/vcdiff/engine/VCDiffInstructionMapTest.java",
"identifier": "VCDiffInstructionMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void DefaultMapLookupFirstCopyMode5() {\n Assert.assertEquals(99, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupFirstOpcode(VCD_COPY, (byte) 0, (byte) 5));\n Assert.assertEquals(100, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupFirstOpcode(VCD_COPY, (byte) 4, (byt... | {
"fields": [
{
"declarator": "DEFAULT_INSTRUCTION_MAP = new VCDiffInstructionMap(\n VCDiffCodeTableData.kDefaultCodeTableData, VCDiffAddressCache.DefaultLastMode())",
"modifier": "public static final",
"original_string": "public static final VCDiffInstructionMap DEFAULT_INSTRUCTION_M... | {
"body": "public short LookupFirstOpcode(byte inst, byte size, byte mode) {\n return first_instruction_map_.Lookup(inst, size, mode);\n }",
"class_method_signature": "VCDiffInstructionMap.LookupFirstOpcode(byte inst, byte size, byte mode)",
"constructor": false,
"full_signature": "public short Lookup... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_11 | {
"fields": [
{
"declarator": "thrown= ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException thrown= ExpectedException.none();",
"type": "ExpectedException",
"var_name": "thrown"
}
],
"file": "core/src/test/java/co... | {
"body": "@Test\n public void EncodeAddressZeroCacheSizes() {\n AtomicInteger encoded_addr = new AtomicInteger();\n VCDiffAddressCacheImpl zero_cache = new VCDiffAddressCacheImpl((short) 0, (short) 0);\n\n assertEquals(VCDiffAddressCache.VCD_SELF_MODE, zero_cache.EncodeAddress(0x0000FFFF, 0x1... | {
"fields": [
{
"declarator": "VCD_SELF_MODE = (short)0",
"modifier": "public static final",
"original_string": "public static final short VCD_SELF_MODE = (short)0;",
"type": "short",
"var_name": "VCD_SELF_MODE"
},
{
"declarator": "VCD_HERE_MODE = (short)1",
"modi... | {
"body": "public abstract short EncodeAddress(int address,\n int here_address,\n AtomicInteger encoded_addr);",
"class_method_signature": "VCDiffAddressCache.EncodeAddress(int address,\n int here_address,\n AtomicInteger encoded_addr)",
"constructor": false,
"full_si... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_46 | {
"fields": [],
"file": "core/src/test/java/com/davidehrmann/vcdiff/engine/VCDiffInstructionMapTest.java",
"identifier": "VCDiffInstructionMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void DefaultMapLookupFirstCopyMode1() {\n Assert.assertEquals(35, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupFirstOpcode(VCD_COPY, (byte) 0, (byte) 1));\n Assert.assertEquals(36, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupFirstOpcode(VCD_COPY, (byte) 4, (byte... | {
"fields": [
{
"declarator": "DEFAULT_INSTRUCTION_MAP = new VCDiffInstructionMap(\n VCDiffCodeTableData.kDefaultCodeTableData, VCDiffAddressCache.DefaultLastMode())",
"modifier": "public static final",
"original_string": "public static final VCDiffInstructionMap DEFAULT_INSTRUCTION_M... | {
"body": "public short LookupFirstOpcode(byte inst, byte size, byte mode) {\n return first_instruction_map_.Lookup(inst, size, mode);\n }",
"class_method_signature": "VCDiffInstructionMap.LookupFirstOpcode(byte inst, byte size, byte mode)",
"constructor": false,
"full_signature": "public short Lookup... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_5 | {
"fields": [
{
"declarator": "random = new Random(42)",
"modifier": "private final",
"original_string": "private final Random random = new Random(42);",
"type": "Random",
"var_name": "random"
},
{
"declarator": "expected = new Adler32()",
"modifier": "private fin... | {
"body": "@Test\n public void testEmpty() {\n assertEquals(0, actual.getValue());\n }",
"class_method_signature": "ZeroInitializedAdler32Test.testEmpty()",
"constructor": false,
"full_signature": "@Test public void testEmpty()",
"identifier": "testEmpty",
"invocations": [
"assertEquals",
... | {
"fields": [
{
"declarator": "ADLER_ZERO = new byte[] {\n -26, 11, -99, -30, 23, -120, -6, -15, 8, 48, -61, 112, 94, 116, -23, 86,\n -30, -112, -118, -90, -85, -36, -69, -29, 124, 98, -120, -62, 106, -80, 56, 33,\n -62, -18, -44, 56, 40, 50, -22, 13, 3, 18, -114, 45, 24, 12... | {
"body": "@Override\n public long getValue() {\n long adler32 = super.getValue();\n int adlerA = (int) adler32 & 0xffff;\n int adlerB = (int) adler32 >>> 16;\n\n int buggyA = (adlerA - 1) % 65521;\n int buggyB = ((adlerB - bytesUpdatedModAdler) % 65521);\n if (buggyB < 0)... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_100 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testVCDiffNoInterleavedAndChecksum() throws Exception {\n // vcdiff with all three arguments. Verify that output file matches target file.\n VCDiffFileBasedCoder.main(new String[] {\n \"encode\",\n \"-dictionary\", dictionaryFile.getCanoni... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_85 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testEmptyDictionary() throws Exception {\n // Using and empty dictionary should work, but (because dictionary is empty)\n // it will not produce a small delta file.\n File emptyDictionary = tempFolder.newFile(\"empty_dictionary\");\n\n // \"vcdiff test\" w... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_93 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testBufferSize() throws Exception {\n VCDiffFileBasedCoder.main(new String[] {\n \"test\",\n \"-interleaved\",\n \"-checksum\",\n \"-target\", targetFile.getCanonicalPath(),\n \"-dictionary\", dictionar... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_20 | {
"fields": [
{
"declarator": "code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone()",
"modifier": "private",
"original_string": "private VCDiffCodeTableData code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone();",
"type": "VCDiffCodeTableData",
"var_nam... | {
"body": "@Test\n public void BadOpcode() {\n VerifyInstruction(0, VCDiffCodeTableData.VCD_RUN, (byte) 0, (byte) 0);\n code_table_data_.inst1[0] = VCDiffCodeTableData.VCD_LAST_INSTRUCTION_TYPE + 1;\n Assert.assertFalse(code_table_data_.Validate());\n code_table_data_.inst1[0] = (byte) ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class);",
"type": "Logger",
"var_name": "LOGGER"
}... | {
"body": "protected boolean Validate(short max_mode) {\n final int kNumberOfTypesAndModes = VCD_LAST_INSTRUCTION_TYPE + max_mode + 1;\n boolean[] hasOpcodeForTypeAndMode = new boolean[VCD_LAST_INSTRUCTION_TYPE + VCDiffAddressCache.VCD_MAX_MODES];\n boolean no_errors_found = true;\n for (i... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_77 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testVCDiffWithStdout() throws Exception {\n // vcdiff with mixed stdin/stdout.\n\n // encode\n PrintStream outBackup = System.out;\n try {\n try (OutputStream deltaOut = new FileOutputStream(deltaFile)) {\n System.setOut(new Print... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_98 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testEncodeMissingDictionary() throws Exception {\n exit.expectSystemExit();\n\n VCDiffFileBasedCoder.main(new String[] {\n \"encode\",\n \"-interleaved\",\n \"-checksum\",\n \"-target\", targetFile.getCanonical... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_61 | {
"fields": [],
"file": "core/src/test/java/com/davidehrmann/vcdiff/engine/VCDiffInstructionMapTest.java",
"identifier": "VCDiffInstructionMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void DefaultMapLookupSecondCopyMode3() {\n Assert.assertEquals(199, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupSecondOpcode((byte) 2, VCD_COPY, (byte) 4, (byte) 3));\n Assert.assertEquals(200, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupSecondOpcode((byte) 2, ... | {
"fields": [
{
"declarator": "DEFAULT_INSTRUCTION_MAP = new VCDiffInstructionMap(\n VCDiffCodeTableData.kDefaultCodeTableData, VCDiffAddressCache.DefaultLastMode())",
"modifier": "public static final",
"original_string": "public static final VCDiffInstructionMap DEFAULT_INSTRUCTION_M... | {
"body": "public short LookupSecondOpcode(byte first_opcode, byte inst, byte size, byte mode) {\n return second_instruction_map_.Lookup(first_opcode, inst, size, mode);\n }",
"class_method_signature": "VCDiffInstructionMap.LookupSecondOpcode(byte first_opcode, byte inst, byte size, byte mode)",
"constr... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_36 | {
"fields": [
{
"declarator": "block_of_first_e = 2",
"modifier": "static final",
"original_string": "static final int block_of_first_e = 2;",
"type": "int",
"var_name": "block_of_first_e"
},
{
"declarator": "block_of_second_e = 16",
"modifier": "static final",
... | {
"body": "@Test\n public void RightNotLimited() throws UnsupportedEncodingException {\n // The number of bytes that match between the original \"we hear is fearsome\"\n // and the altered \"ve hear is fearsome\".\n final int expected_length = (kBlockSize * \"fearsom\".getBytes(StandardCharset... | {
"fields": [
{
"declarator": "kBlockSize = 16",
"modifier": "public static final",
"original_string": "public static final int kBlockSize = 16;",
"type": "int",
"var_name": "kBlockSize"
},
{
"declarator": "kMaxMatchesToCheck = 32 * (32 / kBlockSize)",
"modifier":... | {
"body": "protected static int MatchingBytesToRight(ByteBuffer source_match_end, int source_match_end_offset, byte[] target_match_end, int target_match_end_offset, int max_bytes) {\n int bytes_found = 0;\n while ((bytes_found < max_bytes) && (source_match_end.get(source_match_end_offset) == target_matc... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_94 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testBufferSizeWithStdio() throws Exception {\n InputStream inBackup;\n PrintStream outBackup;\n\n // encode\n inBackup = System.in;\n try {\n outBackup = System.out;\n try (InputStream in = new FileInputStream(targetFile);\n ... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_111 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testAllowVCDTarget() throws Exception {\n VCDiffFileBasedCoder.main(new String[] {\n \"encode\",\n \"-interleaved\",\n \"-checksum\",\n \"-dictionary\", dictionaryFile.getCanonicalPath(),\n \"-target\",... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_82 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testTargetNotFound() throws Exception {\n exit.expectSystemExit();\n VCDiffFileBasedCoder.main(new String[] {\n \"encode\",\n \"-interleaved\",\n \"-checksum\",\n \"-dictionary\", dictionaryFile.getCanonicalPat... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_2 | {
"fields": [],
"file": "core/src/test/java/com/davidehrmann/vcdiff/util/VarIntTest.java",
"identifier": "VarIntTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testNegativeInt2() {\n ByteBuffer buffer = ByteBuffer.allocate(32);\n VarInt.putInt(buffer, -1);\n }",
"class_method_signature": "VarIntTest.testNegativeInt2()",
"constructor": false,
"full_signature": "@Test(expected ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(VarInt.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(VarInt.class);",
"type": "Logger",
"var_name": "LOGGER"
}
],
"file": "core/src/... | {
"body": "public static void putInt(ByteBuffer dest, int val) {\n if (val < 0) {\n throw new IllegalArgumentException(String.format(\"Value (%d) was negative\", val));\n }\n\n for (int shift = 28; shift >= 0; shift -= 7) {\n int v2 = val >> shift;\n if (v2 != 0 |... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_107 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testMaliciousEncodingWithMaxTargetWindowSize() throws Exception {\n exit.expectSystemExit();\n\n PrintStream outBackup = System.out;\n try {\n System.setOut(new PrintStream(nopOutputStream()));\n\n VCDiffFileBasedCoder.main(new String[] {\n ... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_41 | {
"fields": [
{
"declarator": "kBase = RollingHash.RollingHashUtil.kBase",
"modifier": "static final",
"original_string": "static final int kBase = RollingHash.RollingHashUtil.kBase;",
"type": "int",
"var_name": "kBase"
},
{
"declarator": "kUpdateHashTestIterations = 40... | {
"body": "@Test\n public void testAgainstCppResults() {\n // This code was used to generate a file that was run through the C++ version of this code\n Random random = new Random(1);\n byte[] buffer = new byte[4096];\n random.nextBytes(buffer);\n\n CRC32 crc32 = new CRC32();\n ... | {
"fields": [
{
"declarator": "window_size",
"modifier": "private final",
"original_string": "private final int window_size;",
"type": "int",
"var_name": "window_size"
},
{
"declarator": "remove_table",
"modifier": "private final",
"original_string": "privat... | {
"body": "public long Hash(byte[] data, int offset, int length) {\n long h = RollingHashUtil.HashFirstTwoBytes(data, offset);\n for (int i = 2; i < window_size; ++i) {\n h = RollingHashUtil.HashStep(h, data[offset + i]);\n }\n return h;\n }",
"class_method_signature": "Rol... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_16 | {
"fields": [
{
"declarator": "kLastExerciseMode = 4",
"modifier": "protected static final",
"original_string": "protected static final short kLastExerciseMode = 4;",
"type": "short",
"var_name": "kLastExerciseMode"
},
{
"declarator": "out = new ByteArrayOutputStream(40... | {
"body": "@Test(expected = IllegalStateException.class)\n public void WriterCopyWithoutInit() {\n standard_writer.copy(6, 5);\n }",
"class_method_signature": "VCDiffCodeTableWriterImplTest.WriterCopyWithoutInit()",
"constructor": false,
"full_signature": "@Test(expected = IllegalStateException.cla... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(VCDiffCodeTableWriterImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(VCDiffCodeTableWriterImpl.class);",
"type": "Logger",
"var_name": "L... | {
"body": "public void copy(int offset, int size) {\n if (instructionMap == null) {\n throw new IllegalStateException(\"copy called without calling init().\");\n }\n\n // If a single interleaved stream of encoded values is used\n // instead of separate sections for instructions,... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_57 | {
"fields": [],
"file": "core/src/test/java/com/davidehrmann/vcdiff/engine/VCDiffInstructionMapTest.java",
"identifier": "VCDiffInstructionMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void DefaultMapLookupSecondRun() {\n assertEquals(kNoOpcode, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupSecondOpcode((byte) 0, VCD_RUN, (byte) 0, (byte) 0));\n assertEquals(kNoOpcode, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupSecondOpcode((byte) 20, VCD_RUN,... | {
"fields": [
{
"declarator": "DEFAULT_INSTRUCTION_MAP = new VCDiffInstructionMap(\n VCDiffCodeTableData.kDefaultCodeTableData, VCDiffAddressCache.DefaultLastMode())",
"modifier": "public static final",
"original_string": "public static final VCDiffInstructionMap DEFAULT_INSTRUCTION_M... | {
"body": "public short LookupSecondOpcode(byte first_opcode, byte inst, byte size, byte mode) {\n return second_instruction_map_.Lookup(first_opcode, inst, size, mode);\n }",
"class_method_signature": "VCDiffInstructionMap.LookupSecondOpcode(byte first_opcode, byte inst, byte size, byte mode)",
"constr... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_56 | {
"fields": [],
"file": "core/src/test/java/com/davidehrmann/vcdiff/engine/VCDiffInstructionMapTest.java",
"identifier": "VCDiffInstructionMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void DefaultMapLookupSecondAdd() {\n Assert.assertEquals(247, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupSecondOpcode((byte) 20, VCD_ADD, (byte) 1, (byte) 0));\n Assert.assertEquals(248, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupSecondOpcode((byte) 36, VCD_A... | {
"fields": [
{
"declarator": "DEFAULT_INSTRUCTION_MAP = new VCDiffInstructionMap(\n VCDiffCodeTableData.kDefaultCodeTableData, VCDiffAddressCache.DefaultLastMode())",
"modifier": "public static final",
"original_string": "public static final VCDiffInstructionMap DEFAULT_INSTRUCTION_M... | {
"body": "public short LookupSecondOpcode(byte first_opcode, byte inst, byte size, byte mode) {\n return second_instruction_map_.Lookup(first_opcode, inst, size, mode);\n }",
"class_method_signature": "VCDiffInstructionMap.LookupSecondOpcode(byte first_opcode, byte inst, byte size, byte mode)",
"constr... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_17 | {
"fields": [
{
"declarator": "code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone()",
"modifier": "private",
"original_string": "private VCDiffCodeTableData code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone();",
"type": "VCDiffCodeTableData",
"var_nam... | {
"body": "@Test\n public void MissingCopyMode() {\n VerifyInstruction(131, VCDiffCodeTableData.VCD_COPY, (byte) 0, (byte) 7);\n code_table_data_.size1[131] = (byte) 0xFF;\n // Now there is no opcode expressing COPY with mode 7 and size 0.\n Assert.assertFalse(code_table_data_.Validate(... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class);",
"type": "Logger",
"var_name": "LOGGER"
}... | {
"body": "protected boolean Validate(short max_mode) {\n final int kNumberOfTypesAndModes = VCD_LAST_INSTRUCTION_TYPE + max_mode + 1;\n boolean[] hasOpcodeForTypeAndMode = new boolean[VCD_LAST_INSTRUCTION_TYPE + VCDiffAddressCache.VCD_MAX_MODES];\n boolean no_errors_found = true;\n for (i... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_40 | {
"fields": [
{
"declarator": "block_of_first_e = 2",
"modifier": "static final",
"original_string": "static final int block_of_first_e = 2;",
"type": "int",
"var_name": "block_of_first_e"
},
{
"declarator": "block_of_second_e = 16",
"modifier": "static final",
... | {
"body": "@Test\n public void SearchStringFindsTooManyMatches() {\n final int kTestSize = 1 << 20; // 1M\n\n byte[] huge_dictionary = new byte[kTestSize];\n Arrays.fill(huge_dictionary, (byte) 'Q');\n\n BlockHash huge_bh = new BlockHash(huge_dictionary, 0, true);\n\n byte[] hug... | {
"fields": [
{
"declarator": "kBlockSize = 16",
"modifier": "public static final",
"original_string": "public static final int kBlockSize = 16;",
"type": "int",
"var_name": "kBlockSize"
},
{
"declarator": "kMaxMatchesToCheck = 32 * (32 / kBlockSize)",
"modifier":... | {
"body": "public void FindBestMatch(int hash_value, ByteBuffer target, Match best_match) {\n // Keep a count of the number of matches found. This will throttle the\n // number of iterations in FindBestMatch. For example, if the entire\n // dictionary is made up of spaces (' ') and the search s... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_3 | {
"fields": [],
"file": "core/src/test/java/com/davidehrmann/vcdiff/util/VarIntTest.java",
"identifier": "VarIntTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testNegativeLong1() {\n ByteBuffer buffer = ByteBuffer.allocate(32);\n VarInt.putLong(buffer, Integer.MIN_VALUE);\n }",
"class_method_signature": "VarIntTest.testNegativeLong1()",
"constructor": false,
"full_signature"... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(VarInt.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(VarInt.class);",
"type": "Logger",
"var_name": "LOGGER"
}
],
"file": "core/src/... | {
"body": "public static void putLong(ByteBuffer dest, long val) {\n if (val < 0) {\n throw new IllegalArgumentException(String.format(\"Value (%d) was negative\", val));\n }\n\n for (int shift = 63; shift >= 0; shift -= 7) {\n long v2 = val >> shift;\n if (v2 != ... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_106 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testMaliciousEncodingWithMaxTargetFileSize() throws Exception {\n // A malicious encoding that tries to produce a 4GB target file made up of 64\n // windows, each window having a size of 64MB.\n\n exit.expectSystemExit();\n\n PrintStream outBackup = System... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_83 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testDeltaNotFound() throws Exception {\n exit.expectSystemExit();\n VCDiffFileBasedCoder.main(new String[] {\n \"decode\",\n \"-dictionary\", dictionaryFile.getCanonicalPath(),\n \"-delta\", tempFolder.getRoot().getCanonicalP... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_110 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testDisallowVCDTarget() throws Exception {\n VCDiffFileBasedCoder.main(new String[] {\n \"encode\",\n \"-interleaved\",\n \"-checksum\",\n \"-dictionary\", dictionaryFile.getCanonicalPath(),\n \"-target... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_95 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testBufferSizeZero() throws Exception {\n exit.expectSystemExit();\n VCDiffFileBasedCoder.main(new String[] {\n \"test\",\n \"-interleaved\",\n \"-checksum\",\n \"-target\", targetFile.getCanonicalPath(),\n ... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_37 | {
"fields": [
{
"declarator": "block_of_first_e = 2",
"modifier": "static final",
"original_string": "static final int block_of_first_e = 2;",
"type": "int",
"var_name": "block_of_first_e"
},
{
"declarator": "block_of_second_e = 16",
"modifier": "static final",
... | {
"body": "@Test\n public void FindBestMatch() {\n BlockHash dh_ = BlockHash.CreateDictionaryHash(sample_text);\n\n BlockHash.Match best_match = new BlockHash.Match();\n dh_.FindBestMatch(\n (int) hashed_f,\n search_string, index_of_f_in_fearsome,\n ... | {
"fields": [
{
"declarator": "kBlockSize = 16",
"modifier": "public static final",
"original_string": "public static final int kBlockSize = 16;",
"type": "int",
"var_name": "kBlockSize"
},
{
"declarator": "kMaxMatchesToCheck = 32 * (32 / kBlockSize)",
"modifier":... | {
"body": "public void FindBestMatch(int hash_value, ByteBuffer target, Match best_match) {\n // Keep a count of the number of matches found. This will throttle the\n // number of iterations in FindBestMatch. For example, if the entire\n // dictionary is made up of spaces (' ') and the search s... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_60 | {
"fields": [],
"file": "core/src/test/java/com/davidehrmann/vcdiff/engine/VCDiffInstructionMapTest.java",
"identifier": "VCDiffInstructionMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void DefaultMapLookupSecondCopyMode2() {\n Assert.assertEquals(187, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupSecondOpcode((byte) 2, VCD_COPY, (byte) 4, (byte) 2));\n Assert.assertEquals(188, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupSecondOpcode((byte) 2, ... | {
"fields": [
{
"declarator": "DEFAULT_INSTRUCTION_MAP = new VCDiffInstructionMap(\n VCDiffCodeTableData.kDefaultCodeTableData, VCDiffAddressCache.DefaultLastMode())",
"modifier": "public static final",
"original_string": "public static final VCDiffInstructionMap DEFAULT_INSTRUCTION_M... | {
"body": "public short LookupSecondOpcode(byte first_opcode, byte inst, byte size, byte mode) {\n return second_instruction_map_.Lookup(first_opcode, inst, size, mode);\n }",
"class_method_signature": "VCDiffInstructionMap.LookupSecondOpcode(byte first_opcode, byte inst, byte size, byte mode)",
"constr... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_76 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testVCDiffWithStdio() throws Exception {\n // vcdiff using stdin/stdout. Verify that output file matches target file.\n InputStream inBackup;\n PrintStream outBackup;\n\n // encode\n inBackup = System.in;\n try {\n outBackup = Sys... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_99 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testDecodeMissingDictionary() throws Exception {\n exit.expectSystemExit();\n VCDiffFileBasedCoder.main(new String[] {\n \"decode\",\n \"-target\", targetFile.getCanonicalPath(),\n \"-delta\", deltaFile.getCanonicalPath()\n ... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_21 | {
"fields": [
{
"declarator": "code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone()",
"modifier": "private",
"original_string": "private VCDiffCodeTableData code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone();",
"type": "VCDiffCodeTableData",
"var_nam... | {
"body": "@Test\n public void BadMode() {\n VerifyInstruction(131, VCDiffCodeTableData.VCD_COPY, (byte) 0, (byte) 7);\n code_table_data_.mode1[131] = (byte) (VCDiffAddressCache.DefaultLastMode() + 1);\n Assert.assertFalse(code_table_data_.Validate());\n code_table_data_.mode1[131] = (b... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class);",
"type": "Logger",
"var_name": "LOGGER"
}... | {
"body": "protected boolean Validate(short max_mode) {\n final int kNumberOfTypesAndModes = VCD_LAST_INSTRUCTION_TYPE + max_mode + 1;\n boolean[] hasOpcodeForTypeAndMode = new boolean[VCD_LAST_INSTRUCTION_TYPE + VCDiffAddressCache.VCD_MAX_MODES];\n boolean no_errors_found = true;\n for (i... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_59 | {
"fields": [],
"file": "core/src/test/java/com/davidehrmann/vcdiff/engine/VCDiffInstructionMapTest.java",
"identifier": "VCDiffInstructionMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void DefaultMapLookupSecondCopyMode1() {\n Assert.assertEquals(175, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupSecondOpcode((byte) 2, VCD_COPY, (byte) 4, (byte) 1));\n Assert.assertEquals(176, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupSecondOpcode((byte) 2, ... | {
"fields": [
{
"declarator": "DEFAULT_INSTRUCTION_MAP = new VCDiffInstructionMap(\n VCDiffCodeTableData.kDefaultCodeTableData, VCDiffAddressCache.DefaultLastMode())",
"modifier": "public static final",
"original_string": "public static final VCDiffInstructionMap DEFAULT_INSTRUCTION_M... | {
"body": "public short LookupSecondOpcode(byte first_opcode, byte inst, byte size, byte mode) {\n return second_instruction_map_.Lookup(first_opcode, inst, size, mode);\n }",
"class_method_signature": "VCDiffInstructionMap.LookupSecondOpcode(byte first_opcode, byte inst, byte size, byte mode)",
"constr... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_18 | {
"fields": [
{
"declarator": "code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone()",
"modifier": "private",
"original_string": "private VCDiffCodeTableData code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone();",
"type": "VCDiffCodeTableData",
"var_nam... | {
"body": "@Test\n public void MissingAdd() {\n VerifyInstruction(1, VCDiffCodeTableData.VCD_ADD, (byte) 0, (byte) 0);\n code_table_data_.size1[1] = (byte) 0xFF; // add size 0 => size 255\n // Now there is no opcode expressing ADD with size 0.\n Assert.assertFalse(code_table_data_.Vali... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class);",
"type": "Logger",
"var_name": "LOGGER"
}... | {
"body": "protected boolean Validate(short max_mode) {\n final int kNumberOfTypesAndModes = VCD_LAST_INSTRUCTION_TYPE + max_mode + 1;\n boolean[] hasOpcodeForTypeAndMode = new boolean[VCD_LAST_INSTRUCTION_TYPE + VCDiffAddressCache.VCD_MAX_MODES];\n boolean no_errors_found = true;\n for (i... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_34 | {
"fields": [
{
"declarator": "block_of_first_e = 2",
"modifier": "static final",
"original_string": "static final int block_of_first_e = 2;",
"type": "int",
"var_name": "block_of_first_e"
},
{
"declarator": "block_of_second_e = 16",
"modifier": "static final",
... | {
"body": "@Test\n public void LeftNotLimited() throws UnsupportedEncodingException {\n // The number of bytes that match between the original \"we hear is fearsome\"\n // and the altered \"ve hear is fearsome\".\n final int expected_length = kBlockSize * \"e hear is \".getBytes(StandardCharse... | {
"fields": [
{
"declarator": "kBlockSize = 16",
"modifier": "public static final",
"original_string": "public static final int kBlockSize = 16;",
"type": "int",
"var_name": "kBlockSize"
},
{
"declarator": "kMaxMatchesToCheck = 32 * (32 / kBlockSize)",
"modifier":... | {
"body": "protected static int MatchingBytesToLeft(ByteBuffer source_match_start, int source_match_offset, byte[] target_match_start, int target_match_start_offset, int max_bytes) {\n int bytes_found = 0;\n while (bytes_found < max_bytes) {\n --source_match_offset;\n --target_matc... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_63 | {
"fields": [],
"file": "core/src/test/java/com/davidehrmann/vcdiff/engine/VCDiffInstructionMapTest.java",
"identifier": "VCDiffInstructionMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void DefaultMapLookupSecondCopyMode5() {\n Assert.assertEquals(223, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupSecondOpcode((byte) 2, VCD_COPY, (byte) 4, (byte) 5));\n Assert.assertEquals(224, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupSecondOpcode((byte) 2, ... | {
"fields": [
{
"declarator": "DEFAULT_INSTRUCTION_MAP = new VCDiffInstructionMap(\n VCDiffCodeTableData.kDefaultCodeTableData, VCDiffAddressCache.DefaultLastMode())",
"modifier": "public static final",
"original_string": "public static final VCDiffInstructionMap DEFAULT_INSTRUCTION_M... | {
"body": "public short LookupSecondOpcode(byte first_opcode, byte inst, byte size, byte mode) {\n return second_instruction_map_.Lookup(first_opcode, inst, size, mode);\n }",
"class_method_signature": "VCDiffInstructionMap.LookupSecondOpcode(byte first_opcode, byte inst, byte size, byte mode)",
"constr... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_109 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testWithMaxTargetWindowSize() throws Exception {\n // Decoding a small target with -max_target_window_size option should succeed.\n VCDiffFileBasedCoder.main(new String[] {\n \"test\",\n \"-dictionary\", dictionaryFile.getCanonicalPath(),\n... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_75 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testVCDiff() throws Exception {\n // vcdiff with all three arguments. Verify that output file matches target file.\n VCDiffFileBasedCoder.main(new String[] {\n \"encode\",\n \"-interleaved\",\n \"-checksum\",\n ... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_22 | {
"fields": [
{
"declarator": "code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone()",
"modifier": "private",
"original_string": "private VCDiffCodeTableData code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone();",
"type": "VCDiffCodeTableData",
"var_nam... | {
"body": "@Test\n public void AddWithNonzeroMode() {\n VerifyInstruction(1, VCDiffCodeTableData.VCD_ADD, (byte) 0, (byte) 0);\n code_table_data_.mode1[1] = 1;\n Assert.assertFalse(code_table_data_.Validate());\n }",
"class_method_signature": "VCDiffCodeTableDataTest.AddWithNonzeroMode()"... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class);",
"type": "Logger",
"var_name": "LOGGER"
}... | {
"body": "protected boolean Validate(short max_mode) {\n final int kNumberOfTypesAndModes = VCD_LAST_INSTRUCTION_TYPE + max_mode + 1;\n boolean[] hasOpcodeForTypeAndMode = new boolean[VCD_LAST_INSTRUCTION_TYPE + VCDiffAddressCache.VCD_MAX_MODES];\n boolean no_errors_found = true;\n for (i... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_55 | {
"fields": [],
"file": "core/src/test/java/com/davidehrmann/vcdiff/engine/VCDiffInstructionMapTest.java",
"identifier": "VCDiffInstructionMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void DefaultMapLookupSecondNoop() {\n // The second opcode table does not store entries for NOOP instructions.\n // Just make sure that a NOOP does not crash the lookup code.\n assertEquals(kNoOpcode, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupSecondOpcode((by... | {
"fields": [
{
"declarator": "DEFAULT_INSTRUCTION_MAP = new VCDiffInstructionMap(\n VCDiffCodeTableData.kDefaultCodeTableData, VCDiffAddressCache.DefaultLastMode())",
"modifier": "public static final",
"original_string": "public static final VCDiffInstructionMap DEFAULT_INSTRUCTION_M... | {
"body": "public short LookupSecondOpcode(byte first_opcode, byte inst, byte size, byte mode) {\n return second_instruction_map_.Lookup(first_opcode, inst, size, mode);\n }",
"class_method_signature": "VCDiffInstructionMap.LookupSecondOpcode(byte first_opcode, byte inst, byte size, byte mode)",
"constr... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_14 | {
"fields": [
{
"declarator": "kLastExerciseMode = 4",
"modifier": "protected static final",
"original_string": "protected static final short kLastExerciseMode = 4;",
"type": "short",
"var_name": "kLastExerciseMode"
},
{
"declarator": "out = new ByteArrayOutputStream(40... | {
"body": "@Test(expected = IllegalStateException.class)\n public void WriterAddWithoutInit() {\n standard_writer.add(\"Hello\".getBytes(US_ASCII), 0, 5);\n }",
"class_method_signature": "VCDiffCodeTableWriterImplTest.WriterAddWithoutInit()",
"constructor": false,
"full_signature": "@Test(expected ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(VCDiffCodeTableWriterImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(VCDiffCodeTableWriterImpl.class);",
"type": "Logger",
"var_name": "L... | {
"body": "public void add(byte[] data, int offset, int length) {\n if (offset + length > data.length || length < 0) {\n throw new IllegalArgumentException();\n }\n\n encodeInstruction(VCDiffCodeTableData.VCD_ADD, length);\n dataForAddAndRun.put(data, offset, length);\n t... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_43 | {
"fields": [],
"file": "core/src/test/java/com/davidehrmann/vcdiff/engine/VCDiffInstructionMapTest.java",
"identifier": "VCDiffInstructionMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void DefaultMapLookupFirstAddTest() {\n Assert.assertEquals(2, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupFirstOpcode(VCD_ADD, (byte) 1, (byte) 0));\n Assert.assertEquals(3, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupFirstOpcode(VCD_ADD, (byte) 2, (byte) 0));... | {
"fields": [
{
"declarator": "DEFAULT_INSTRUCTION_MAP = new VCDiffInstructionMap(\n VCDiffCodeTableData.kDefaultCodeTableData, VCDiffAddressCache.DefaultLastMode())",
"modifier": "public static final",
"original_string": "public static final VCDiffInstructionMap DEFAULT_INSTRUCTION_M... | {
"body": "public short LookupFirstOpcode(byte inst, byte size, byte mode) {\n return first_instruction_map_.Lookup(inst, size, mode);\n }",
"class_method_signature": "VCDiffInstructionMap.LookupFirstOpcode(byte inst, byte size, byte mode)",
"constructor": false,
"full_signature": "public short Lookup... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_38 | {
"fields": [
{
"declarator": "block_of_first_e = 2",
"modifier": "static final",
"original_string": "static final int block_of_first_e = 2;",
"type": "int",
"var_name": "block_of_first_e"
},
{
"declarator": "block_of_second_e = 16",
"modifier": "static final",
... | {
"body": "@Test\n public void FindBestMatchWithStartingOffset() throws UnsupportedEncodingException {\n BlockHash th2 = new BlockHash(sample_text, 0x10000, true);\n\n BlockHash.Match best_match = new BlockHash.Match();\n th2.FindBestMatch((int) hashed_f,\n search_string, index_... | {
"fields": [
{
"declarator": "kBlockSize = 16",
"modifier": "public static final",
"original_string": "public static final int kBlockSize = 16;",
"type": "int",
"var_name": "kBlockSize"
},
{
"declarator": "kMaxMatchesToCheck = 32 * (32 / kBlockSize)",
"modifier":... | {
"body": "public void FindBestMatch(int hash_value, ByteBuffer target, Match best_match) {\n // Keep a count of the number of matches found. This will throttle the\n // number of iterations in FindBestMatch. For example, if the entire\n // dictionary is made up of spaces (' ') and the search s... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_0 | {
"fields": [],
"file": "core/src/test/java/com/davidehrmann/vcdiff/util/VarIntTest.java",
"identifier": "VarIntTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void longMatchesSpecTest() {\n ByteBuffer buffer = ByteBuffer.allocate(16);\n VarInt.putLong(buffer, 0xffffffffL);\n\n int size = buffer.position();\n buffer.flip();\n byte[] data = new byte[size];\n buffer.get(data);\n\n assertArrayEquals(... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(VarInt.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(VarInt.class);",
"type": "Logger",
"var_name": "LOGGER"
}
],
"file": "core/src/... | {
"body": "public static void putLong(ByteBuffer dest, long val) {\n if (val < 0) {\n throw new IllegalArgumentException(String.format(\"Value (%d) was negative\", val));\n }\n\n for (int shift = 63; shift >= 0; shift -= 7) {\n long v2 = val >> shift;\n if (v2 != ... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_105 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testTestWithoutDictionary() throws Exception {\n exit.expectSystemExit();\n VCDiffFileBasedCoder.main(new String[] {\n \"test\",\n \"-target_matches\",\n \"-delta\", deltaFile.getCanonicalPath(),\n \"-target\",... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_80 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testVCDiffTest() throws Exception {\n // \"vcdiff test\" with all three arguments.\n VCDiffFileBasedCoder.main(new String[] {\n \"test\",\n \"-interleaved\",\n \"-checksum\",\n \"-dictionary\", dictionaryFile.g... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_113 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testDecodeXDelta3() throws Exception {\n // This delta was generated by xdelta3:\n // xdelta3 -e -S -A -n -s configure.ac.v0.1 configure.ac.v0.2 xdelta3.vcdiff\n copyResourceToFile(deltaFile, \"xdelta3.vcdiff\");\n\n VCDiffFileBasedCoder.main(new String[] ... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_96 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testLargeBufferSize() throws Exception {\n // Using -buffersize=128M (larger than default maximum) should still work.\n VCDiffFileBasedCoder.main(new String[] {\n \"test\",\n \"-interleaved\",\n \"-checksum\",\n ... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_79 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testWrongDictionary() throws Exception {\n // If using the wrong dictionary, and dictionary is smaller than the original\n // dictionary, vcdiff will spot the mistake and return an error. (It can't\n // detect the case where the wrong dictionary is larger than t... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_97 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testUnrecognizedOption() throws Exception {\n exit.expectSystemExit();\n\n VCDiffFileBasedCoder.main(new String[] {\n \"test\",\n \"-interleaved\",\n \"-checksum\",\n \"-target\", targetFile.getCanonicalPath(),... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_78 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testVCDiffWithStdin() throws Exception {\n // vcdiff using stdin/stdout. Verify that output file matches target file.\n InputStream inBackup;\n\n // encode\n inBackup = System.in;\n try {\n try (InputStream in = new FileInputStream(targe... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_112 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testDecodeReferenceDeltas() throws Exception {\n // These deltas were generated by open-vcdiff\n for (int i = 0; i < 6; i++) {\n String filename = String.format(\"configure.ac.vcdiff.%d\", i);\n copyResourceToFile(deltaFile, filename);\n\n ... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_81 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testDictionaryNotFound() throws Exception {\n exit.expectSystemExit();\n VCDiffFileBasedCoder.main(new String[] {\n \"encode\",\n \"-interleaved\",\n \"-checksum\",\n \"-dictionary\", tempFolder.getRoot().getCa... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_1 | {
"fields": [],
"file": "core/src/test/java/com/davidehrmann/vcdiff/util/VarIntTest.java",
"identifier": "VarIntTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testNegativeInt1() {\n ByteBuffer buffer = ByteBuffer.allocate(32);\n VarInt.putInt(buffer, Integer.MIN_VALUE);\n }",
"class_method_signature": "VarIntTest.testNegativeInt1()",
"constructor": false,
"full_signature": "... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(VarInt.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(VarInt.class);",
"type": "Logger",
"var_name": "LOGGER"
}
],
"file": "core/src/... | {
"body": "public static void putInt(ByteBuffer dest, int val) {\n if (val < 0) {\n throw new IllegalArgumentException(String.format(\"Value (%d) was negative\", val));\n }\n\n for (int shift = 28; shift >= 0; shift -= 7) {\n int v2 = val >> shift;\n if (v2 != 0 |... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_104 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testTestWithoutTarget() throws Exception {\n exit.expectSystemExit();\n VCDiffFileBasedCoder.main(new String[] {\n \"test\",\n \"-target_matches\",\n \"-stats\",\n \"-delta\", deltaFile.getCanonicalPath(),\n ... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_39 | {
"fields": [
{
"declarator": "block_of_first_e = 2",
"modifier": "static final",
"original_string": "static final int block_of_first_e = 2;",
"type": "int",
"var_name": "block_of_first_e"
},
{
"declarator": "block_of_second_e = 16",
"modifier": "static final",
... | {
"body": "@Test\n public void BestMatchWithManyMatches() {\n RollingHash rollingHash = new RollingHash(kBlockSize);\n BlockHash.Match best_match = new BlockHash.Match();\n BlockHash many_matches_hash = new BlockHash(sample_text_many_matches, 0, true);\n\n // Hash the \" a\" at the be... | {
"fields": [
{
"declarator": "kBlockSize = 16",
"modifier": "public static final",
"original_string": "public static final int kBlockSize = 16;",
"type": "int",
"var_name": "kBlockSize"
},
{
"declarator": "kMaxMatchesToCheck = 32 * (32 / kBlockSize)",
"modifier":... | {
"body": "public void FindBestMatch(int hash_value, ByteBuffer target, Match best_match) {\n // Keep a count of the number of matches found. This will throttle the\n // number of iterations in FindBestMatch. For example, if the entire\n // dictionary is made up of spaces (' ') and the search s... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_42 | {
"fields": [],
"file": "core/src/test/java/com/davidehrmann/vcdiff/engine/VCDiffInstructionMapTest.java",
"identifier": "VCDiffInstructionMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void DefaultMapLookupFirstNoopTest() {\n assertEquals(kNoOpcode, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupFirstOpcode(VCD_NOOP, (byte) 0, (byte) 0));\n assertEquals(kNoOpcode, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupFirstOpcode(VCD_NOOP, (byte) 0, (byte)... | {
"fields": [
{
"declarator": "DEFAULT_INSTRUCTION_MAP = new VCDiffInstructionMap(\n VCDiffCodeTableData.kDefaultCodeTableData, VCDiffAddressCache.DefaultLastMode())",
"modifier": "public static final",
"original_string": "public static final VCDiffInstructionMap DEFAULT_INSTRUCTION_M... | {
"body": "public short LookupFirstOpcode(byte inst, byte size, byte mode) {\n return first_instruction_map_.Lookup(inst, size, mode);\n }",
"class_method_signature": "VCDiffInstructionMap.LookupFirstOpcode(byte inst, byte size, byte mode)",
"constructor": false,
"full_signature": "public short Lookup... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_15 | {
"fields": [
{
"declarator": "kLastExerciseMode = 4",
"modifier": "protected static final",
"original_string": "protected static final short kLastExerciseMode = 4;",
"type": "short",
"var_name": "kLastExerciseMode"
},
{
"declarator": "out = new ByteArrayOutputStream(40... | {
"body": "@Test(expected = IllegalStateException.class)\n public void WriterRunWithoutInit() {\n standard_writer.run(3, (byte) 'a');\n }",
"class_method_signature": "VCDiffCodeTableWriterImplTest.WriterRunWithoutInit()",
"constructor": false,
"full_signature": "@Test(expected = IllegalStateExcepti... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(VCDiffCodeTableWriterImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(VCDiffCodeTableWriterImpl.class);",
"type": "Logger",
"var_name": "L... | {
"body": "public void run(int size, byte b) {\n encodeInstruction(VCDiffCodeTableData.VCD_RUN, size);\n dataForAddAndRun.put(b);\n targetLength += size;\n }",
"class_method_signature": "VCDiffCodeTableWriterImpl.run(int size, byte b)",
"constructor": false,
"full_signature": "public voi... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_54 | {
"fields": [],
"file": "core/src/test/java/com/davidehrmann/vcdiff/engine/VCDiffInstructionMapTest.java",
"identifier": "VCDiffInstructionMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void DefaultMapLookupFirstCopyInvalid() {\n assertEquals(kNoOpcode, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupFirstOpcode(VCD_COPY, (byte) 3, (byte) 0));\n assertEquals(kNoOpcode, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupFirstOpcode(VCD_COPY, (byte) 3, (by... | {
"fields": [
{
"declarator": "DEFAULT_INSTRUCTION_MAP = new VCDiffInstructionMap(\n VCDiffCodeTableData.kDefaultCodeTableData, VCDiffAddressCache.DefaultLastMode())",
"modifier": "public static final",
"original_string": "public static final VCDiffInstructionMap DEFAULT_INSTRUCTION_M... | {
"body": "public short LookupFirstOpcode(byte inst, byte size, byte mode) {\n return first_instruction_map_.Lookup(inst, size, mode);\n }",
"class_method_signature": "VCDiffInstructionMap.LookupFirstOpcode(byte inst, byte size, byte mode)",
"constructor": false,
"full_signature": "public short Lookup... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_23 | {
"fields": [
{
"declarator": "code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone()",
"modifier": "private",
"original_string": "private VCDiffCodeTableData code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone();",
"type": "VCDiffCodeTableData",
"var_nam... | {
"body": "@Test\n public void RunWithNonzeroMode() {\n VerifyInstruction(0, VCDiffCodeTableData.VCD_RUN, (byte) 0, (byte) 0);\n code_table_data_.mode1[0] = 1;\n Assert.assertFalse(code_table_data_.Validate());\n }",
"class_method_signature": "VCDiffCodeTableDataTest.RunWithNonzeroMode()"... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class);",
"type": "Logger",
"var_name": "LOGGER"
}... | {
"body": "protected boolean Validate(short max_mode) {\n final int kNumberOfTypesAndModes = VCD_LAST_INSTRUCTION_TYPE + max_mode + 1;\n boolean[] hasOpcodeForTypeAndMode = new boolean[VCD_LAST_INSTRUCTION_TYPE + VCDiffAddressCache.VCD_MAX_MODES];\n boolean no_errors_found = true;\n for (i... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_74 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testNoCommand() throws Exception {\n // vcdiff with three arguments but without \"encode\" or \"decode\"\n // shows usage information & error result\n exit.expectSystemExit();\n VCDiffFileBasedCoder.main(new String[]{\n \"-dictionary\", dict... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_108 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testWithMaxTargetFileSize() throws Exception {\n // Decoding a small target with the -max_target_file_size option should succeed.\n VCDiffFileBasedCoder.main(new String[] {\n \"test\",\n \"-dictionary\", dictionaryFile.getCanonicalPath(),\n... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_62 | {
"fields": [],
"file": "core/src/test/java/com/davidehrmann/vcdiff/engine/VCDiffInstructionMapTest.java",
"identifier": "VCDiffInstructionMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void DefaultMapLookupSecondCopyMode4() {\n Assert.assertEquals(211, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupSecondOpcode((byte) 2, VCD_COPY, (byte) 4, (byte) 4));\n Assert.assertEquals(212, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupSecondOpcode((byte) 2, ... | {
"fields": [
{
"declarator": "DEFAULT_INSTRUCTION_MAP = new VCDiffInstructionMap(\n VCDiffCodeTableData.kDefaultCodeTableData, VCDiffAddressCache.DefaultLastMode())",
"modifier": "public static final",
"original_string": "public static final VCDiffInstructionMap DEFAULT_INSTRUCTION_M... | {
"body": "public short LookupSecondOpcode(byte first_opcode, byte inst, byte size, byte mode) {\n return second_instruction_map_.Lookup(first_opcode, inst, size, mode);\n }",
"class_method_signature": "VCDiffInstructionMap.LookupSecondOpcode(byte first_opcode, byte inst, byte size, byte mode)",
"constr... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_35 | {
"fields": [
{
"declarator": "block_of_first_e = 2",
"modifier": "static final",
"original_string": "static final int block_of_first_e = 2;",
"type": "int",
"var_name": "block_of_first_e"
},
{
"declarator": "block_of_second_e = 16",
"modifier": "static final",
... | {
"body": "@Test\n public void RightLimitedByMaxBytes() throws UnsupportedEncodingException {\n // The number of bytes that match between the original \"fearsome\"\n // and the altered \"fearsomm\".\n final int expected_length = (kBlockSize * \"fearsom\".getBytes(StandardCharsets.US_ASCII).len... | {
"fields": [
{
"declarator": "kBlockSize = 16",
"modifier": "public static final",
"original_string": "public static final int kBlockSize = 16;",
"type": "int",
"var_name": "kBlockSize"
},
{
"declarator": "kMaxMatchesToCheck = 32 * (32 / kBlockSize)",
"modifier":... | {
"body": "protected static int MatchingBytesToRight(ByteBuffer source_match_end, int source_match_end_offset, byte[] target_match_end, int target_match_end_offset, int max_bytes) {\n int bytes_found = 0;\n while ((bytes_found < max_bytes) && (source_match_end.get(source_match_end_offset) == target_matc... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_19 | {
"fields": [
{
"declarator": "code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone()",
"modifier": "private",
"original_string": "private VCDiffCodeTableData code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone();",
"type": "VCDiffCodeTableData",
"var_nam... | {
"body": "@Test\n public void MissingRun() {\n VerifyInstruction(0, VCDiffCodeTableData.VCD_RUN, (byte) 0, (byte) 0);\n code_table_data_.size1[0] = (byte) 0xFF; // run size 0 => size 255\n // Now there is no opcode expressing RUN with size 0.\n Assert.assertFalse(code_table_data_.Vali... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class);",
"type": "Logger",
"var_name": "LOGGER"
}... | {
"body": "protected boolean Validate(short max_mode) {\n final int kNumberOfTypesAndModes = VCD_LAST_INSTRUCTION_TYPE + max_mode + 1;\n boolean[] hasOpcodeForTypeAndMode = new boolean[VCD_LAST_INSTRUCTION_TYPE + VCDiffAddressCache.VCD_MAX_MODES];\n boolean no_errors_found = true;\n for (i... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_58 | {
"fields": [],
"file": "core/src/test/java/com/davidehrmann/vcdiff/engine/VCDiffInstructionMapTest.java",
"identifier": "VCDiffInstructionMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void DefaultMapLookupSecondCopyMode0() {\n Assert.assertEquals(163, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupSecondOpcode((byte) 2, VCD_COPY, (byte) 4, (byte) 0));\n Assert.assertEquals(164, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupSecondOpcode((byte) 2, ... | {
"fields": [
{
"declarator": "DEFAULT_INSTRUCTION_MAP = new VCDiffInstructionMap(\n VCDiffCodeTableData.kDefaultCodeTableData, VCDiffAddressCache.DefaultLastMode())",
"modifier": "public static final",
"original_string": "public static final VCDiffInstructionMap DEFAULT_INSTRUCTION_M... | {
"body": "public short LookupSecondOpcode(byte first_opcode, byte inst, byte size, byte mode) {\n return second_instruction_map_.Lookup(first_opcode, inst, size, mode);\n }",
"class_method_signature": "VCDiffInstructionMap.LookupSecondOpcode(byte first_opcode, byte inst, byte size, byte mode)",
"constr... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_53 | {
"fields": [],
"file": "core/src/test/java/com/davidehrmann/vcdiff/engine/VCDiffInstructionMapTest.java",
"identifier": "VCDiffInstructionMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void DefaultMapLookupFirstCopyMode8() {\n Assert.assertEquals(147, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupFirstOpcode(VCD_COPY, (byte) 0, (byte) 8));\n Assert.assertEquals(148, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupFirstOpcode(VCD_COPY, (byte) 4, (by... | {
"fields": [
{
"declarator": "DEFAULT_INSTRUCTION_MAP = new VCDiffInstructionMap(\n VCDiffCodeTableData.kDefaultCodeTableData, VCDiffAddressCache.DefaultLastMode())",
"modifier": "public static final",
"original_string": "public static final VCDiffInstructionMap DEFAULT_INSTRUCTION_M... | {
"body": "public short LookupFirstOpcode(byte inst, byte size, byte mode) {\n return first_instruction_map_.Lookup(inst, size, mode);\n }",
"class_method_signature": "VCDiffInstructionMap.LookupFirstOpcode(byte inst, byte size, byte mode)",
"constructor": false,
"full_signature": "public short Lookup... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_12 | {
"fields": [
{
"declarator": "thrown= ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException thrown= ExpectedException.none();",
"type": "ExpectedException",
"var_name": "thrown"
}
],
"file": "core/src/test/java/co... | {
"body": "@Test\n public void DecodeAddressZeroCacheSizes() throws IOException {\n VCDiffAddressCacheImpl zero_cache = new VCDiffAddressCacheImpl((short) 0, (short) 0);\n ByteBuffer buffer = ByteBuffer.allocate(2048);\n\n VarInt.putInt(buffer, 0xCAFE);\n VarInt.putInt(buffer, 0xCAFE);\... | {
"fields": [
{
"declarator": "VCD_SELF_MODE = (short)0",
"modifier": "public static final",
"original_string": "public static final short VCD_SELF_MODE = (short)0;",
"type": "short",
"var_name": "VCD_SELF_MODE"
},
{
"declarator": "VCD_HERE_MODE = (short)1",
"modi... | {
"body": "public abstract int DecodeAddress(int here_address, short vcDiffMode, ByteBuffer address_stream) throws IOException;",
"class_method_signature": "VCDiffAddressCache.DecodeAddress(int here_address, short vcDiffMode, ByteBuffer address_stream)",
"constructor": false,
"full_signature": "public abstract ... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_45 | {
"fields": [],
"file": "core/src/test/java/com/davidehrmann/vcdiff/engine/VCDiffInstructionMapTest.java",
"identifier": "VCDiffInstructionMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void DefaultMapLookupFirstCopyMode0() {\n Assert.assertEquals(19, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupFirstOpcode(VCD_COPY, (byte) 0, (byte) 0));\n Assert.assertEquals(20, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupFirstOpcode(VCD_COPY, (byte) 4, (byte... | {
"fields": [
{
"declarator": "DEFAULT_INSTRUCTION_MAP = new VCDiffInstructionMap(\n VCDiffCodeTableData.kDefaultCodeTableData, VCDiffAddressCache.DefaultLastMode())",
"modifier": "public static final",
"original_string": "public static final VCDiffInstructionMap DEFAULT_INSTRUCTION_M... | {
"body": "public short LookupFirstOpcode(byte inst, byte size, byte mode) {\n return first_instruction_map_.Lookup(inst, size, mode);\n }",
"class_method_signature": "VCDiffInstructionMap.LookupFirstOpcode(byte inst, byte size, byte mode)",
"constructor": false,
"full_signature": "public short Lookup... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_6 | {
"fields": [
{
"declarator": "thrown= ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException thrown= ExpectedException.none();",
"type": "ExpectedException",
"var_name": "thrown"
}
],
"file": "core/src/test/java/co... | {
"body": "@Test\n public void ZeroCacheSizes() {\n VCDiffAddressCache zero_cache = new VCDiffAddressCacheImpl((short) 0, (short) 0);\n zero_cache.Init();\n }",
"class_method_signature": "VCDiffAddressCacheTest.ZeroCacheSizes()",
"constructor": false,
"full_signature": "@Test public void Zer... | {
"fields": [
{
"declarator": "VCD_SELF_MODE = (short)0",
"modifier": "public static final",
"original_string": "public static final short VCD_SELF_MODE = (short)0;",
"type": "short",
"var_name": "VCD_SELF_MODE"
},
{
"declarator": "VCD_HERE_MODE = (short)1",
"modi... | {
"body": "public abstract void Init();",
"class_method_signature": "VCDiffAddressCache.Init()",
"constructor": false,
"full_signature": "public abstract void Init()",
"identifier": "Init",
"invocations": [],
"modifiers": "public abstract",
"parameters": "()",
"return": "void",
"signature": "void In... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_103 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testTestWithoutDelta() throws Exception {\n exit.expectSystemExit();\n VCDiffFileBasedCoder.main(new String[] {\n \"test\",\n \"-target_matches\",\n \"-stats\",\n \"-dictionary\", dictionaryFile.getCanonicalPat... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_86 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testEmptyUnreadableDictionary() throws Exception {\n exit.expectSystemExit();\n\n File writeOnlyDictionary = tempFolder.newFile(\"write_only_dictionary\");\n assumeTrue(\"Couldn't create a read-only file\", writeOnlyDictionary.setReadable(false));\n\n // \... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_69 | {
"fields": [
{
"declarator": "coder_ = null",
"modifier": "private",
"original_string": "private JSONCodeTableWriter coder_ = null;",
"type": "JSONCodeTableWriter",
"var_name": "coder_"
},
{
"declarator": "writer = null",
"modifier": "private",
"original_st... | {
"body": "@Test\n public void nullTest() throws IOException {\n coder_.finishEncoding(writer);\n assertEquals(\"\", writer.toString());\n }",
"class_method_signature": "JSONCodeTableWriterTest.nullTest()",
"constructor": false,
"full_signature": "@Test public void nullTest()",
"identifier... | {
"fields": [
{
"declarator": "output = new StringBuilder(1024)",
"modifier": "private",
"original_string": "private StringBuilder output = new StringBuilder(1024);",
"type": "StringBuilder",
"var_name": "output"
},
{
"declarator": "outputCalled = false",
"modifie... | {
"body": "public void finishEncoding(Appendable out) throws IOException {\n if (outputCalled) {\n out.append(']');\n }\n }",
"class_method_signature": "JSONCodeTableWriter.finishEncoding(Appendable out)",
"constructor": false,
"full_signature": "public void finishEncoding(Appendable... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_90 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testMissingTarget() throws Exception {\n exit.expectSystemExit();\n VCDiffFileBasedCoder.main(new String[] {\n \"encode\",\n \"-interleaved\",\n \"-checksum\",\n \"-delta\", deltaFile.getCanonicalPath(),\n ... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_28 | {
"fields": [
{
"declarator": "code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone()",
"modifier": "private",
"original_string": "private VCDiffCodeTableData code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone();",
"type": "VCDiffCodeTableData",
"var_nam... | {
"body": "@Test\n public void AddSecondWithNonzeroMode() {\n VerifyInstruction(20, VCDiffCodeTableData.VCD_COPY, (byte) 4, (byte) 0);\n code_table_data_.inst2[20] = VCDiffCodeTableData.VCD_ADD;\n Assert.assertTrue(code_table_data_.Validate());\n code_table_data_.mode2[20] = 1;\n ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class);",
"type": "Logger",
"var_name": "LOGGER"
}... | {
"body": "protected boolean Validate(short max_mode) {\n final int kNumberOfTypesAndModes = VCD_LAST_INSTRUCTION_TYPE + max_mode + 1;\n boolean[] hasOpcodeForTypeAndMode = new boolean[VCD_LAST_INSTRUCTION_TYPE + VCDiffAddressCache.VCD_MAX_MODES];\n boolean no_errors_found = true;\n for (i... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_49 | {
"fields": [],
"file": "core/src/test/java/com/davidehrmann/vcdiff/engine/VCDiffInstructionMapTest.java",
"identifier": "VCDiffInstructionMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void DefaultMapLookupFirstCopyMode4() {\n Assert.assertEquals(83, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupFirstOpcode(VCD_COPY, (byte) 0, (byte) 4));\n Assert.assertEquals(84, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupFirstOpcode(VCD_COPY, (byte) 4, (byte... | {
"fields": [
{
"declarator": "DEFAULT_INSTRUCTION_MAP = new VCDiffInstructionMap(\n VCDiffCodeTableData.kDefaultCodeTableData, VCDiffAddressCache.DefaultLastMode())",
"modifier": "public static final",
"original_string": "public static final VCDiffInstructionMap DEFAULT_INSTRUCTION_M... | {
"body": "public short LookupFirstOpcode(byte inst, byte size, byte mode) {\n return first_instruction_map_.Lookup(inst, size, mode);\n }",
"class_method_signature": "VCDiffInstructionMap.LookupFirstOpcode(byte inst, byte size, byte mode)",
"constructor": false,
"full_signature": "public short Lookup... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_32 | {
"fields": [
{
"declarator": "code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone()",
"modifier": "private",
"original_string": "private VCDiffCodeTableData code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone();",
"type": "VCDiffCodeTableData",
"var_nam... | {
"body": "@Test\n public void ValidateExerciseCodeTable() {\n // This value is designed so that the total number of inst values and modes\n // will equal 8 (VCD_NOOP, VCD_ADD, VCD_RUN, VCD_COPY modes 0 - 4).\n // Eight combinations of inst and mode, times two possible size values,\n //... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class);",
"type": "Logger",
"var_name": "LOGGER"
}... | {
"body": "protected boolean Validate(short max_mode) {\n final int kNumberOfTypesAndModes = VCD_LAST_INSTRUCTION_TYPE + max_mode + 1;\n boolean[] hasOpcodeForTypeAndMode = new boolean[VCD_LAST_INSTRUCTION_TYPE + VCDiffAddressCache.VCD_MAX_MODES];\n boolean no_errors_found = true;\n for (i... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_65 | {
"fields": [],
"file": "core/src/test/java/com/davidehrmann/vcdiff/engine/VCDiffInstructionMapTest.java",
"identifier": "VCDiffInstructionMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void DefaultMapLookupSecondCopyMode7() {\n Assert.assertEquals(240, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupSecondOpcode((byte) 3, VCD_COPY, (byte) 4, (byte) 7));\n Assert.assertEquals(241, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupSecondOpcode((byte) 4, ... | {
"fields": [
{
"declarator": "DEFAULT_INSTRUCTION_MAP = new VCDiffInstructionMap(\n VCDiffCodeTableData.kDefaultCodeTableData, VCDiffAddressCache.DefaultLastMode())",
"modifier": "public static final",
"original_string": "public static final VCDiffInstructionMap DEFAULT_INSTRUCTION_M... | {
"body": "public short LookupSecondOpcode(byte first_opcode, byte inst, byte size, byte mode) {\n return second_instruction_map_.Lookup(first_opcode, inst, size, mode);\n }",
"class_method_signature": "VCDiffInstructionMap.LookupSecondOpcode(byte first_opcode, byte inst, byte size, byte mode)",
"constr... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_73 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testNoArguments() throws Exception {\n // vcdiff with no arguments shows usage information & error result\n exit.expectSystemExit();\n VCDiffFileBasedCoder.main(new String[0]);\n }",
"class_method_signature": "VCDiffFileBasedCoderTest.testNoArguments()",
"... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_24 | {
"fields": [
{
"declarator": "code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone()",
"modifier": "private",
"original_string": "private VCDiffCodeTableData code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone();",
"type": "VCDiffCodeTableData",
"var_nam... | {
"body": "@Test\n public void NoOpWithNonzeroMode() {\n VerifyInstruction(20, VCDiffCodeTableData.VCD_COPY, (byte) 4, (byte) 0);\n code_table_data_.inst1[20] = VCDiffCodeTableData.VCD_NOOP;\n code_table_data_.mode1[20] = 0;\n code_table_data_.size1[20] = 0;\n Assert.assertTrue(c... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class);",
"type": "Logger",
"var_name": "LOGGER"
}... | {
"body": "protected boolean Validate(short max_mode) {\n final int kNumberOfTypesAndModes = VCD_LAST_INSTRUCTION_TYPE + max_mode + 1;\n boolean[] hasOpcodeForTypeAndMode = new boolean[VCD_LAST_INSTRUCTION_TYPE + VCDiffAddressCache.VCD_MAX_MODES];\n boolean no_errors_found = true;\n for (i... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_25 | {
"fields": [
{
"declarator": "code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone()",
"modifier": "private",
"original_string": "private VCDiffCodeTableData code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone();",
"type": "VCDiffCodeTableData",
"var_nam... | {
"body": "@Test\n public void NoOpWithNonzeroSize() {\n VerifyInstruction(20, VCDiffCodeTableData.VCD_COPY, (byte) 4, (byte) 0);\n code_table_data_.inst1[20] = VCDiffCodeTableData.VCD_NOOP;\n code_table_data_.mode1[20] = 0;\n code_table_data_.size1[20] = 0;\n Assert.assertTrue(c... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class);",
"type": "Logger",
"var_name": "LOGGER"
}... | {
"body": "protected boolean Validate(short max_mode) {\n final int kNumberOfTypesAndModes = VCD_LAST_INSTRUCTION_TYPE + max_mode + 1;\n boolean[] hasOpcodeForTypeAndMode = new boolean[VCD_LAST_INSTRUCTION_TYPE + VCDiffAddressCache.VCD_MAX_MODES];\n boolean no_errors_found = true;\n for (i... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_72 | {
"fields": [
{
"declarator": "coder_ = null",
"modifier": "private",
"original_string": "private JSONCodeTableWriter coder_ = null;",
"type": "JSONCodeTableWriter",
"var_name": "coder_"
},
{
"declarator": "writer = null",
"modifier": "private",
"original_st... | {
"body": "@Test\n public void Run() throws IOException {\n coder_.run(3, (byte) 'a');\n coder_.output(writer);\n coder_.finishEncoding(writer);\n assertEquals(\"[\\\"aaa\\\"]\", writer.toString());\n }",
"class_method_signature": "JSONCodeTableWriterTest.Run()",
"constructor": f... | {
"fields": [
{
"declarator": "output = new StringBuilder(1024)",
"modifier": "private",
"original_string": "private StringBuilder output = new StringBuilder(1024);",
"type": "StringBuilder",
"var_name": "output"
},
{
"declarator": "outputCalled = false",
"modifie... | {
"body": "public void run(int size, byte b) {\n // add leading comma if this is not the first opcode.\n if (opcodeAdded) {\n output.append(',');\n }\n\n output.append('\"');\n\n StringBuilder escapedByte = new StringBuilder(8);\n JSONEscape(b, escapedByte);\n\n ... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_64 | {
"fields": [],
"file": "core/src/test/java/com/davidehrmann/vcdiff/engine/VCDiffInstructionMapTest.java",
"identifier": "VCDiffInstructionMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void DefaultMapLookupSecondCopyMode6() {\n Assert.assertEquals(235, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupSecondOpcode((byte) 2, VCD_COPY, (byte) 4, (byte) 6));\n Assert.assertEquals(236, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupSecondOpcode((byte) 3, ... | {
"fields": [
{
"declarator": "DEFAULT_INSTRUCTION_MAP = new VCDiffInstructionMap(\n VCDiffCodeTableData.kDefaultCodeTableData, VCDiffAddressCache.DefaultLastMode())",
"modifier": "public static final",
"original_string": "public static final VCDiffInstructionMap DEFAULT_INSTRUCTION_M... | {
"body": "public short LookupSecondOpcode(byte first_opcode, byte inst, byte size, byte mode) {\n return second_instruction_map_.Lookup(first_opcode, inst, size, mode);\n }",
"class_method_signature": "VCDiffInstructionMap.LookupSecondOpcode(byte first_opcode, byte inst, byte size, byte mode)",
"constr... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_33 | {
"fields": [
{
"declarator": "block_of_first_e = 2",
"modifier": "static final",
"original_string": "static final int block_of_first_e = 2;",
"type": "int",
"var_name": "block_of_first_e"
},
{
"declarator": "block_of_second_e = 16",
"modifier": "static final",
... | {
"body": "@Test\n public void LeftLimitedByMaxBytes() throws UnsupportedEncodingException {\n // The number of bytes that match between the original \"we hear is fearsome\"\n // and the altered \"ve hear is fearsome\".\n final int expected_length = kBlockSize * \"e hear is \".getBytes(Standar... | {
"fields": [
{
"declarator": "kBlockSize = 16",
"modifier": "public static final",
"original_string": "public static final int kBlockSize = 16;",
"type": "int",
"var_name": "kBlockSize"
},
{
"declarator": "kMaxMatchesToCheck = 32 * (32 / kBlockSize)",
"modifier":... | {
"body": "protected static int MatchingBytesToLeft(ByteBuffer source_match_start, int source_match_offset, byte[] target_match_start, int target_match_start_offset, int max_bytes) {\n int bytes_found = 0;\n while (bytes_found < max_bytes) {\n --source_match_offset;\n --target_matc... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_48 | {
"fields": [],
"file": "core/src/test/java/com/davidehrmann/vcdiff/engine/VCDiffInstructionMapTest.java",
"identifier": "VCDiffInstructionMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void DefaultMapLookupFirstCopyMode3() {\n Assert.assertEquals(67, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupFirstOpcode(VCD_COPY, (byte) 0, (byte) 3));\n Assert.assertEquals(68, VCDiffInstructionMap.DEFAULT_INSTRUCTION_MAP.LookupFirstOpcode(VCD_COPY, (byte) 4, (byte... | {
"fields": [
{
"declarator": "DEFAULT_INSTRUCTION_MAP = new VCDiffInstructionMap(\n VCDiffCodeTableData.kDefaultCodeTableData, VCDiffAddressCache.DefaultLastMode())",
"modifier": "public static final",
"original_string": "public static final VCDiffInstructionMap DEFAULT_INSTRUCTION_M... | {
"body": "public short LookupFirstOpcode(byte inst, byte size, byte mode) {\n return first_instruction_map_.Lookup(inst, size, mode);\n }",
"class_method_signature": "VCDiffInstructionMap.LookupFirstOpcode(byte inst, byte size, byte mode)",
"constructor": false,
"full_signature": "public short Lookup... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_29 | {
"fields": [
{
"declarator": "code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone()",
"modifier": "private",
"original_string": "private VCDiffCodeTableData code_table_data_ = VCDiffCodeTableData.kDefaultCodeTableData.clone();",
"type": "VCDiffCodeTableData",
"var_nam... | {
"body": "@Test\n public void RunSecondWithNonzeroMode() {\n VerifyInstruction(20, VCDiffCodeTableData.VCD_COPY, (byte) 4, (byte) 0);\n code_table_data_.inst2[20] = VCDiffCodeTableData.VCD_RUN;\n Assert.assertTrue(code_table_data_.Validate());\n code_table_data_.mode2[20] = 1;\n ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(VCDiffCodeTableData.class);",
"type": "Logger",
"var_name": "LOGGER"
}... | {
"body": "protected boolean Validate(short max_mode) {\n final int kNumberOfTypesAndModes = VCD_LAST_INSTRUCTION_TYPE + max_mode + 1;\n boolean[] hasOpcodeForTypeAndMode = new boolean[VCD_LAST_INSTRUCTION_TYPE + VCDiffAddressCache.VCD_MAX_MODES];\n boolean no_errors_found = true;\n for (i... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_91 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testMissingDelta() throws Exception {\n exit.expectSystemExit();\n\n VCDiffFileBasedCoder.main(new String[] {\n \"encode\",\n \"-interleaved\",\n \"-checksum\",\n \"-target\", targetFile.getCanonicalPath(),\n ... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_87 | {
"fields": [
{
"declarator": "dictionaryFile",
"modifier": "private static",
"original_string": "private static File dictionaryFile;",
"type": "File",
"var_name": "dictionaryFile"
},
{
"declarator": "targetFile",
"modifier": "private static",
"original_stri... | {
"body": "@Test\n public void testEmptyUnreadableTarget() throws Exception {\n exit.expectSystemExit();\n\n File writeOnlyTarget = tempFolder.newFile(\"write_only_target\");\n assumeTrue(\"Couldn't create a read-only file\", writeOnlyTarget.setReadable(false));\n\n // \"vcdiff test\" w... | {
"fields": [
{
"declarator": "DEFAULT_MAX_TARGET_SIZE = 1 << 26",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_TARGET_SIZE = 1 << 26;",
"type": "int",
"var_name": "DEFAULT_MAX_TARGET_SIZE"
}
],
"file": "cli/src/main/java/com/davi... | {
"body": "public static void main(String[] argv) throws Exception {\n\n // TODO: JCommander has an issue with boolean arity. Rewrite allow_vcd_target.\n List<String> newArgv = new LinkedList<String>(Arrays.asList(argv));\n\n ListIterator<String> i = newArgv.listIterator();\n while (i.hasN... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
35185022_68 | {
"fields": [
{
"declarator": "instruction_buffer_size = VCDiffCodeTableData.kCodeTableSize * 5",
"modifier": "static final",
"original_string": "static final int instruction_buffer_size = VCDiffCodeTableData.kCodeTableSize * 5;",
"type": "int",
"var_name": "instruction_buffer_size"
... | {
"body": "@Test\n public void ExerciseCodeTableReaderTest() throws IOException {\n for (int opcode = 0; opcode < VCDiffCodeTableData.kCodeTableSize; ++opcode) {\n instructions_and_sizes_ptr_.put((byte) opcode);\n if ((g_exercise_code_table_.inst1[opcode] != VCDiffCodeTableData.VCD_NOO... | {
"fields": [
{
"declarator": "NO_OPCODE = 0x100",
"modifier": "protected static final",
"original_string": "protected static final short NO_OPCODE = 0x100;",
"type": "short",
"var_name": "NO_OPCODE"
},
{
"declarator": "codeTableData",
"modifier": "private final",... | {
"body": "public void init(ByteBuffer instructions_and_sizes) {\n instructionsAndSizes = instructions_and_sizes;\n lastInstructionStart = -1;\n pendingSecondInstruction = NO_OPCODE;\n lastPendingSecondInstruction = NO_OPCODE;\n }",
"class_method_signature": "VCDiffCodeTableReader.ini... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35185022,
"size": 887,
"stargazer_count": 17,
"stars": null,
"updates": null,
"url": "https://github.com/ehrmann/vcdiff-java"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.