id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
160999_86 | {
"fields": [
{
"declarator": "log",
"modifier": "private",
"original_string": "private Logger log;",
"type": "Logger",
"var_name": "log"
}
],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/server/util/VerifyingFileFactoryTest.java",
"identifier": "VerifyingFi... | {
"body": "@Test\n public void testForNoWarningOnIntendedRelativePath() {\n VerifyingFileFactory vff = new VerifyingFileFactory.Builder(log).warnForRelativePath().build();\n vff.create(\"./an/intended/relative/path\");\n // assertFalse(log.hasWarned);\n }",
"class_method_signature": "Veri... | {
"fields": [
{
"declarator": "warnForRelativePath",
"modifier": "private final",
"original_string": "private final boolean warnForRelativePath;",
"type": "boolean",
"var_name": "warnForRelativePath"
},
{
"declarator": "failForNonExistingPath",
"modifier": "privat... | {
"body": "public File create(String path) {\n File file = new File(path);\n return validate(file);\n }",
"class_method_signature": "VerifyingFileFactory.create(String path)",
"constructor": false,
"full_signature": "public File create(String path)",
"identifier": "create",
"invocations": [... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_208 | {
"fields": [
{
"declarator": "DATA_BYTES_0 = \"Apache ZooKeeper\".getBytes(StandardCharsets.UTF_8)",
"modifier": "private static final",
"original_string": "private static final byte[] DATA_BYTES_0 = \"Apache ZooKeeper\".getBytes(StandardCharsets.UTF_8);",
"type": "byte[]",
"var_nam... | {
"body": "@Test\n public void testReadArrayOffsetLength_AtEndOfStream() throws Exception {\n for (int i = 0; i < DATA_BYTES.length; i++) {\n in.read();\n }\n byte[] expected = Arrays.copyOf(bs, bs.length);\n assertEquals(-1, in.read(bs, 2, 2));\n assertArrayEquals(exp... | {
"fields": [
{
"declarator": "bb",
"modifier": "",
"original_string": "ByteBuffer bb;",
"type": "ByteBuffer",
"var_name": "bb"
}
],
"file": "zookeeper-server/src/main/java/org/apache/zookeeper/server/ByteBufferInputStream.java",
"identifier": "ByteBufferInputStream",
"in... | {
"body": "@Override\n public int read() throws IOException {\n if (bb.remaining() == 0) {\n return -1;\n }\n return bb.get() & 0xff;\n }",
"class_method_signature": "ByteBufferInputStream.read()",
"constructor": false,
"full_signature": "@Override public int read()",
"id... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_137 | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(FileTxnLogTest.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger LOG = LoggerFactory.getLogger(FileTxnLogTest.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"... | {
"body": "@Test\n public void testGetCurrentLogSize() throws Exception {\n FileTxnLog.setTxnLogSizeLimit(-1);\n File tmpDir = ClientBase.createTmpDir();\n FileTxnLog log = new FileTxnLog(tmpDir);\n FileTxnLog.setPreallocSize(PREALLOCATE);\n CreateRequest record = new CreateReque... | {
"fields": [
{
"declarator": "LOG",
"modifier": "private static final",
"original_string": "private static final Logger LOG;",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "TXNLOG_MAGIC = ByteBuffer.wrap(\"ZKLG\".getBytes()).getInt()",
"modifier": "publ... | {
"body": "public synchronized long getCurrentLogSize() {\n if (logFileWrite != null) {\n return logFileWrite.length();\n }\n return 0;\n }",
"class_method_signature": "FileTxnLog.getCurrentLogSize()",
"constructor": false,
"full_signature": "public synchronized long getCurren... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_90 | {
"fields": [],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/server/util/SerializeUtilsTest.java",
"identifier": "SerializeUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSerializeRequestRequestHeaderIsNull() {\n Request request = new Request(0, 0, 0, null, null, 0);\n byte[] data = SerializeUtils.serializeRequest(request);\n assertNull(data);\n }",
"class_method_signature": "SerializeUtilsTest.testSerializeRequestRequest... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(SerializeUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(SerializeUtils.class);",
"type": "Logger",
"var_name": "LOG"
}
],
"file": "zo... | {
"body": "public static byte[] serializeRequest(Request request) {\n if (request == null || request.getHdr() == null) {\n return null;\n }\n byte[] data = new byte[32];\n try {\n data = Util.marshallTxnEntry(request.getHdr(), request.getTxn(), request.getTxnDigest())... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_28 | {
"fields": [
{
"declarator": "keyPair",
"modifier": "private static",
"original_string": "private static KeyPair keyPair;",
"type": "KeyPair",
"var_name": "keyPair"
},
{
"declarator": "mockX509ExtendedTrustManager",
"modifier": "private",
"original_string":... | {
"body": "@Test\n public void testClientHostnameVerificationWithHostname() throws Exception {\n ZKTrustManager zkTrustManager = new ZKTrustManager(mockX509ExtendedTrustManager, true, true);\n\n X509Certificate[] certificateChain = createSelfSignedCertifcateChain(null, HOSTNAME);\n zkTrustMana... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ZKTrustManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(ZKTrustManager.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "@Override\n public void checkClientTrusted(\n X509Certificate[] chain,\n String authType,\n Socket socket) throws CertificateException {\n x509ExtendedTrustManager.checkClientTrusted(chain, authType, socket);\n if (clientHostnameVerificationEnabled) {\n perf... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_160 | {
"fields": [],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumPeerConfigTest.java",
"identifier": "QuorumPeerConfigTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParseBoolean() throws IOException, ConfigException {\n QuorumPeerConfig quorumPeerConfig = new QuorumPeerConfig();\n Properties zkProp = getDefaultZKProperties();\n\n zkProp.setProperty(\"localSessionsEnabled\", \"true\");\n quorumPeerConfig.parsePrope... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(QuorumPeerConfig.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(QuorumPeerConfig.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"... | {
"body": "private boolean parseBoolean(String key, String value) throws ConfigException {\n if (value.equalsIgnoreCase(\"true\")) {\n return true;\n } else if (value.equalsIgnoreCase(\"false\")) {\n return false;\n } else {\n throw new ConfigException(\"Invalid o... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_117 | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ZooKeeperServerMainTest.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger LOG = LoggerFactory.getLogger(ZooKeeperServerMainTest.class);",
"type": "Logger",
"var_name": "LOG"
... | {
"body": "@Test\n @Timeout(value = 30)\n public void testReadOnlySnapshotDir() throws Exception {\n ClientBase.setupTestEnv();\n final int CLIENT_PORT = PortAssignment.unique();\n\n // Start up the ZK server to automatically create the necessary directories\n // and capture the dire... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ZooKeeperServerMain.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(ZooKeeperServerMain.class);",
"type": "Logger",
"var_name": "LOG"
},
{
... | {
"body": "protected void shutdown() {\n if (containerManager != null) {\n containerManager.stop();\n }\n if (cnxnFactory != null) {\n cnxnFactory.shutdown();\n }\n if (secureCnxnFactory != null) {\n secureCnxnFactory.shutdown();\n }\n ... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_140 | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(DataTreeTest.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger LOG = LoggerFactory.getLogger(DataTreeTest.class);",
"type": "Logger",
"var_name": "LOG"
}
],
"file": "zo... | {
"body": "@Test\n @Timeout(value = 60)\n public void testDumpEphemerals() throws Exception {\n int count = 1000;\n long session = 1000;\n long zxid = 2000;\n final DataTree dataTree = new DataTree();\n LOG.info(\"Create {} zkclient sessions and its ephemeral nodes\", count);\... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(DataTree.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(DataTree.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "RA... | {
"body": "public void dumpEphemerals(PrintWriter pwriter) {\n pwriter.println(\"Sessions with Ephemerals (\" + ephemerals.keySet().size() + \"):\");\n for (Entry<Long, HashSet<String>> entry : ephemerals.entrySet()) {\n pwriter.print(\"0x\" + Long.toHexString(entry.getKey()));\n p... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_7 | {
"fields": [
{
"declarator": "mt0 = System.currentTimeMillis()",
"modifier": "private static final",
"original_string": "private static final long mt0 = System.currentTimeMillis();",
"type": "long",
"var_name": "mt0"
},
{
"declarator": "nt0 = Time.currentElapsedTime()"... | {
"body": "@Test\n public void testElapsedTimeToDate() throws Exception {\n long walltime = Time.currentWallTime();\n long elapsedTime = Time.currentElapsedTime();\n Thread.sleep(200);\n\n Calendar cal = Calendar.getInstance();\n cal.setTime(Time.elapsedTimeToDate(elapsedTime));\... | {
"fields": [],
"file": "zookeeper-server/src/main/java/org/apache/zookeeper/common/Time.java",
"identifier": "Time",
"interfaces": "",
"methods": [
{
"class_method_signature": "Time.currentElapsedTime()",
"constructor": false,
"full_signature": "public static long currentElapsedTime()",... | {
"body": "public static Date elapsedTimeToDate(long elapsedTime) {\n long wallTime = currentWallTime() + elapsedTime - currentElapsedTime();\n return new Date(wallTime);\n }",
"class_method_signature": "Time.elapsedTimeToDate(long elapsedTime)",
"constructor": false,
"full_signature": "public ... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_156 | {
"fields": [],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumPeerConfigTest.java",
"identifier": "QuorumPeerConfigTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testErrorMessageWhenclientPortNotSetButclientPortAddressSet() throws IOException, ConfigException {\n QuorumPeerConfig quorumPeerConfig = new QuorumPeerConfig();\n try {\n Properties zkProp = getDefaultZKProperties();\n zkProp.setProperty(\"clientP... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(QuorumPeerConfig.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(QuorumPeerConfig.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"... | {
"body": "public void parseProperties(Properties zkProp) throws IOException, ConfigException {\n int clientPort = 0;\n int secureClientPort = 0;\n int observerMasterPort = 0;\n String clientPortAddress = null;\n String secureClientPortAddress = null;\n VerifyingFileFactory v... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_49 | {
"fields": [],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/common/PathUtilsTest.java",
"identifier": "PathUtilsTest",
"interfaces": "",
"superclass": "extends ZKTestCase"
} | {
"body": "@Test\n public void testValidatePath_0x7f() {\n assertThrows(IllegalArgumentException.class, () -> {\n PathUtils.validatePath(\"/test\\u007f\");\n });\n }",
"class_method_signature": "PathUtilsTest.testValidatePath_0x7f()",
"constructor": false,
"full_signature": "@Test... | {
"fields": [],
"file": "zookeeper-server/src/main/java/org/apache/zookeeper/common/PathUtils.java",
"identifier": "PathUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "PathUtils.validatePath(String path, boolean isSequential)",
"constructor": false,
"full_signature": ... | {
"body": "public static void validatePath(String path, boolean isSequential) throws IllegalArgumentException {\n validatePath(isSequential ? path + \"1\" : path);\n }",
"class_method_signature": "PathUtils.validatePath(String path, boolean isSequential)",
"constructor": false,
"full_signature": "pu... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_101 | {
"fields": [],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/server/watch/PathParentIteratorTest.java",
"identifier": "PathParentIteratorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testForPathOnly() {\n PathParentIterator pathParentIterator = PathParentIterator.forPathOnly(\"/a/b/c/d\");\n assertTrue(pathParentIterator.hasNext());\n assertEquals(pathParentIterator.next(), \"/a/b/c/d\");\n assertFalse(pathParentIterator.atParentPath()... | {
"fields": [
{
"declarator": "path",
"modifier": "private",
"original_string": "private String path;",
"type": "String",
"var_name": "path"
},
{
"declarator": "maxLevel",
"modifier": "private final",
"original_string": "private final int maxLevel;",
"... | {
"body": "public static PathParentIterator forPathOnly(String path) {\n return new PathParentIterator(path, 0);\n }",
"class_method_signature": "PathParentIterator.forPathOnly(String path)",
"constructor": false,
"full_signature": "public static PathParentIterator forPathOnly(String path)",
"identi... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_32 | {
"fields": [
{
"declarator": "pathTrie",
"modifier": "private",
"original_string": "private PathTrie pathTrie;",
"type": "PathTrie",
"var_name": "pathTrie"
}
],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/common/PathTrieTest.java",
"identifier": "PathTrieT... | {
"body": "@Test\n public void deleteIllegalPath() {\n assertThrows(IllegalArgumentException.class, () -> {\n this.pathTrie.deletePath(\"\");\n });\n }",
"class_method_signature": "PathTrieTest.deleteIllegalPath()",
"constructor": false,
"full_signature": "@Test public void delete... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(PathTrie.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(PathTrie.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "ro... | {
"body": "public void deletePath(final String path) {\n Objects.requireNonNull(path, \"Path cannot be null\");\n\n if (path.length() == 0) {\n throw new IllegalArgumentException(\"Invalid path: \" + path);\n }\n final String[] pathComponents = split(path);\n\n\n wr... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_195 | {
"fields": [
{
"declarator": "leader",
"modifier": "private",
"original_string": "private Leader leader;",
"type": "Leader",
"var_name": "leader"
},
{
"declarator": "leaderBean",
"modifier": "private",
"original_string": "private LeaderBean leaderBean;",
... | {
"body": "@Test\n public void testFollowerInfo() throws IOException {\n Map<Long, QuorumServer> votingMembers = new HashMap<Long, QuorumServer>();\n votingMembers.put(1L, null);\n votingMembers.put(2L, null);\n votingMembers.put(3L, null);\n when(quorumVerifierMock.getVotingMemb... | {
"fields": [
{
"declarator": "leader",
"modifier": "private final",
"original_string": "private final Leader leader;",
"type": "Leader",
"var_name": "leader"
}
],
"file": "zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/LeaderBean.java",
"identifier": "Le... | {
"body": "public String followerInfo() {\n StringBuilder sb = new StringBuilder();\n for (LearnerHandler handler : leader.getLearners()) {\n if (handler.getLearnerType() == LearnerType.PARTICIPANT) {\n sb.append(handler.toString()).append(\"\\n\");\n }\n }\n ... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_204 | {
"fields": [
{
"declarator": "DATA_BYTES_0 = \"Apache ZooKeeper\".getBytes(StandardCharsets.UTF_8)",
"modifier": "private static final",
"original_string": "private static final byte[] DATA_BYTES_0 = \"Apache ZooKeeper\".getBytes(StandardCharsets.UTF_8);",
"type": "byte[]",
"var_nam... | {
"body": "@Test\n public void testRead() throws Exception {\n for (int i = 0; i < DATA_BYTES.length; i++) {\n int b = in.read();\n assertEquals(DATA_BYTES[i], (byte) b);\n }\n assertEquals(-1, in.read());\n }",
"class_method_signature": "ByteBufferInputStreamTest.te... | {
"fields": [
{
"declarator": "bb",
"modifier": "",
"original_string": "ByteBuffer bb;",
"type": "ByteBuffer",
"var_name": "bb"
}
],
"file": "zookeeper-server/src/main/java/org/apache/zookeeper/server/ByteBufferInputStream.java",
"identifier": "ByteBufferInputStream",
"in... | {
"body": "@Override\n public int read() throws IOException {\n if (bb.remaining() == 0) {\n return -1;\n }\n return bb.get() & 0xff;\n }",
"class_method_signature": "ByteBufferInputStream.read()",
"constructor": false,
"full_signature": "@Override public int read()",
"id... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_65 | {
"fields": [],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/MultiOperationRecordTest.java",
"identifier": "MultiOperationRecordTest",
"interfaces": "",
"superclass": "extends ZKTestCase"
} | {
"body": "@Test\n public void testEmptyRoundTrip() throws IOException {\n MultiOperationRecord request = new MultiOperationRecord();\n MultiOperationRecord decodedRequest = codeDecode(request);\n\n assertEquals(request, decodedRequest);\n assertEquals(request.hashCode(), decodedRequest... | {
"fields": [
{
"declarator": "ops = new ArrayList<Op>()",
"modifier": "private",
"original_string": "private List<Op> ops = new ArrayList<Op>();",
"type": "List<Op>",
"var_name": "ops"
},
{
"declarator": "opKind = null",
"modifier": "private",
"original_str... | {
"body": "@Override\n public int hashCode() {\n int h = 1023;\n for (Op op : ops) {\n h = h * 25 + op.hashCode();\n }\n return h;\n }",
"class_method_signature": "MultiOperationRecord.hashCode()",
"constructor": false,
"full_signature": "@Override public int hashCod... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_212 | {
"fields": [
{
"declarator": "DATA_BYTES_0 = \"Apache ZooKeeper\".getBytes(StandardCharsets.UTF_8)",
"modifier": "private static final",
"original_string": "private static final byte[] DATA_BYTES_0 = \"Apache ZooKeeper\".getBytes(StandardCharsets.UTF_8);",
"type": "byte[]",
"var_nam... | {
"body": "@Test\n public void testAvailable() throws Exception {\n for (int i = DATA_BYTES.length; i > 0; i--) {\n assertEquals(i, in.available());\n in.read();\n }\n assertEquals(0, in.available());\n }",
"class_method_signature": "ByteBufferInputStreamTest.testAva... | {
"fields": [
{
"declarator": "bb",
"modifier": "",
"original_string": "ByteBuffer bb;",
"type": "ByteBuffer",
"var_name": "bb"
}
],
"file": "zookeeper-server/src/main/java/org/apache/zookeeper/server/ByteBufferInputStream.java",
"identifier": "ByteBufferInputStream",
"in... | {
"body": "@Override\n public int available() throws IOException {\n return bb.remaining();\n }",
"class_method_signature": "ByteBufferInputStream.available()",
"constructor": false,
"full_signature": "@Override public int available()",
"identifier": "available",
"invocations": [
"remaining... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_73 | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(NettyServerCnxnTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(NettyServerCnxnTest.class);",
"type": "Logger",
"var_name": "LOG"
}
],
"... | {
"body": "@Test\n public void testClientResponseStatsUpdate() throws IOException, InterruptedException, KeeperException {\n try (ZooKeeper zk = createClient()) {\n BufferStats clientResponseStats = serverFactory.getZooKeeperServer().serverStats().getClientResponseStats();\n assertThat... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(NettyServerCnxn.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(NettyServerCnxn.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"de... | {
"body": "@Override\n protected ServerStats serverStats() {\n if (zkServer == null) {\n return null;\n }\n return zkServer.serverStats();\n }",
"class_method_signature": "NettyServerCnxn.serverStats()",
"constructor": false,
"full_signature": "@Override protected ServerSta... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_24 | {
"fields": [
{
"declarator": "keyPair",
"modifier": "private static",
"original_string": "private static KeyPair keyPair;",
"type": "KeyPair",
"var_name": "keyPair"
},
{
"declarator": "mockX509ExtendedTrustManager",
"modifier": "private",
"original_string":... | {
"body": "@Test\n public void testServerHostnameVerificationWithHostname() throws Exception {\n ZKTrustManager zkTrustManager = new ZKTrustManager(mockX509ExtendedTrustManager, true, false);\n\n X509Certificate[] certificateChain = createSelfSignedCertifcateChain(null, HOSTNAME);\n zkTrustMan... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ZKTrustManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(ZKTrustManager.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "@Override\n public void checkServerTrusted(\n X509Certificate[] chain,\n String authType,\n Socket socket) throws CertificateException {\n x509ExtendedTrustManager.checkServerTrusted(chain, authType, socket);\n if (serverHostnameVerificationEnabled) {\n perf... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_183 | {
"fields": [
{
"declarator": "PORTS_AMOUNT = 10",
"modifier": "public static final",
"original_string": "public static final int PORTS_AMOUNT = 10;",
"type": "int",
"var_name": "PORTS_AMOUNT"
}
],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/Mul... | {
"body": "@Test\n public void testRecreateSocketAddresses() throws UnknownHostException {\n List<InetSocketAddress> searchedAddresses = Arrays.stream(InetAddress.getAllByName(\"google.com\"))\n .map(addr -> new InetSocketAddress(addr, 222)).collect(Collectors.toList());\n\n MultipleAd... | {
"fields": [
{
"declarator": "DEFAULT_TIMEOUT = Duration.ofMillis(1000)",
"modifier": "public static final",
"original_string": "public static final Duration DEFAULT_TIMEOUT = Duration.ofMillis(1000);",
"type": "Duration",
"var_name": "DEFAULT_TIMEOUT"
},
{
"declarator... | {
"body": "public void recreateSocketAddresses() {\n addresses = addresses.parallelStream()\n .map(this::recreateSocketAddress)\n .collect(Collectors.toCollection(MultipleAddresses::newConcurrentHashSet));\n }",
"class_method_signature": "MultipleAddresses.recreateSocketAddresses()",
"... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_167 | {
"fields": [],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumBeanTest.java",
"identifier": "QuorumBeanTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetQuorumSizeProperty() {\n QuorumPeer qpMock = mock(QuorumPeer.class);\n QuorumBean qb = new QuorumBean(qpMock);\n\n when(qpMock.getQuorumSize()).thenReturn(5);\n assertThat(\"getQuorumSize property should return value of peet.getQuorumSize()\", qb.ge... | {
"fields": [
{
"declarator": "peer",
"modifier": "private final",
"original_string": "private final QuorumPeer peer;",
"type": "QuorumPeer",
"var_name": "peer"
},
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String ... | {
"body": "@Override\n public int getQuorumSize() {\n return peer.getQuorumSize();\n }",
"class_method_signature": "QuorumBean.getQuorumSize()",
"constructor": false,
"full_signature": "@Override public int getQuorumSize()",
"identifier": "getQuorumSize",
"invocations": [
"getQuorumSize"
... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_188 | {
"fields": [
{
"declarator": "PORTS_AMOUNT = 10",
"modifier": "public static final",
"original_string": "public static final int PORTS_AMOUNT = 10;",
"type": "int",
"var_name": "PORTS_AMOUNT"
}
],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/Mul... | {
"body": "@Test\n public void testEquals() {\n List<InetSocketAddress> addresses = getAddressList();\n\n MultipleAddresses multipleAddresses = new MultipleAddresses(addresses);\n MultipleAddresses multipleAddressesEquals = new MultipleAddresses(addresses);\n\n assertEquals(multipleAddr... | {
"fields": [
{
"declarator": "DEFAULT_TIMEOUT = Duration.ofMillis(1000)",
"modifier": "public static final",
"original_string": "public static final Duration DEFAULT_TIMEOUT = Duration.ofMillis(1000);",
"type": "Duration",
"var_name": "DEFAULT_TIMEOUT"
},
{
"declarator... | {
"body": "@Override\n public boolean equals(Object o) {\n if (this == o) {\n return true;\n } else if (o == null || getClass() != o.getClass()) {\n return false;\n }\n\n MultipleAddresses that = (MultipleAddresses) o;\n return Objects.equals(addresses, that... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_219 | {
"fields": [],
"file": "zookeeper-jute/src/test/java/org/apache/jute/BinaryInputArchiveTest.java",
"identifier": "BinaryInputArchiveTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testBuffer() {\n final byte[] expected = \"hello-world\".getBytes(StandardCharsets.UTF_8);\n final String tag = \"tag1\";\n checkWriterAndReader(\n (oa) -> oa.writeBuffer(expected, tag),\n (ia) -> {\n byte[] actual... | {
"fields": [
{
"declarator": "UNREASONBLE_LENGTH = \"Unreasonable length = \"",
"modifier": "public static final",
"original_string": "public static final String UNREASONBLE_LENGTH = \"Unreasonable length = \";",
"type": "String",
"var_name": "UNREASONBLE_LENGTH"
},
{
... | {
"body": "public byte[] readBuffer(String tag) throws IOException {\n int len = readInt(tag);\n if (len == -1) {\n return null;\n }\n checkLength(len);\n byte[] arr = new byte[len];\n in.readFully(arr);\n return arr;\n }",
"class_method_signature": "Bi... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_78 | {
"fields": [
{
"declarator": "BUFFERED_MESSAGE_SIZE = 5",
"modifier": "private static final",
"original_string": "private static final int BUFFERED_MESSAGE_SIZE = 5;",
"type": "int",
"var_name": "BUFFERED_MESSAGE_SIZE"
},
{
"declarator": "LOG = LoggerFactory.getLogger(... | {
"body": "@Test\n public void testTrackReceived() throws InterruptedException {\n long timestamp1 = System.currentTimeMillis();\n MessageTracker messageTracker = new MessageTracker(BUFFERED_MESSAGE_SIZE);\n\n // First timestamp is added\n messageTracker.trackReceived(timestamp1);\n ... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(MessageTracker.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(MessageTracker.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public void trackReceived(long timestamp) {\n if (enabled) {\n receivedBuffer.write(new BufferedMessage(timestamp));\n }\n }",
"class_method_signature": "MessageTracker.trackReceived(long timestamp)",
"constructor": false,
"full_signature": "public void trackReceived(long ... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_130 | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ZooKeeperServerMainTest.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger LOG = LoggerFactory.getLogger(ZooKeeperServerMainTest.class);",
"type": "Logger",
"var_name": "LOG"
... | {
"body": "@Test\n public void testJMXRegistrationWithNetty() throws Exception {\n String originalServerCnxnFactory = System.getProperty(ServerCnxnFactory.ZOOKEEPER_SERVER_CNXN_FACTORY);\n System.setProperty(ServerCnxnFactory.ZOOKEEPER_SERVER_CNXN_FACTORY, NettyServerCnxnFactory.class.getName());\n ... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ZooKeeperServerMain.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(ZooKeeperServerMain.class);",
"type": "Logger",
"var_name": "LOG"
},
{
... | {
"body": "protected void shutdown() {\n if (containerManager != null) {\n containerManager.stop();\n }\n if (cnxnFactory != null) {\n cnxnFactory.shutdown();\n }\n if (secureCnxnFactory != null) {\n secureCnxnFactory.shutdown();\n }\n ... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_97 | {
"fields": [
{
"declarator": "testACLs = new ArrayList<ACL>()",
"modifier": "private",
"original_string": "private List<ACL> testACLs = new ArrayList<ACL>();",
"type": "List<ACL>",
"var_name": "testACLs"
},
{
"declarator": "responseRecord = new Record[1]",
"modif... | {
"body": "@Test\n public void testACLDigestHashHiding_UserCanAll() {\n // Arrange\n List<Id> authInfo = new ArrayList<Id>();\n authInfo.add(new Id(\"digest\", \"user:secrethash\"));\n\n // Act\n Request r = new Request(cnxn, 0, 0, ZooDefs.OpCode.getACL, bb, authInfo);\n p... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(FinalRequestProcessor.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(FinalRequestProcessor.class);",
"type": "Logger",
"var_name": "LOG"
},
... | {
"body": "public void processRequest(Request request) {\n LOG.debug(\"Processing request:: {}\", request);\n\n if (LOG.isTraceEnabled()) {\n long traceMask = ZooTrace.CLIENT_REQUEST_TRACE_MASK;\n if (request.type == OpCode.ping) {\n traceMask = ZooTrace.SERVER_PING_... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_126 | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ZooKeeperServerMainTest.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger LOG = LoggerFactory.getLogger(ZooKeeperServerMainTest.class);",
"type": "Logger",
"var_name": "LOG"
... | {
"body": "@Test\n public void testMetricsProviderLifecycle() throws Exception {\n ClientBase.setupTestEnv();\n MetricsProviderCapturingLifecycle.reset();\n\n final int CLIENT_PORT = PortAssignment.unique();\n final String configs = \"metricsProvider.className=\"\n ... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ZooKeeperServerMain.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(ZooKeeperServerMain.class);",
"type": "Logger",
"var_name": "LOG"
},
{
... | {
"body": "protected void shutdown() {\n if (containerManager != null) {\n containerManager.stop();\n }\n if (cnxnFactory != null) {\n cnxnFactory.shutdown();\n }\n if (secureCnxnFactory != null) {\n secureCnxnFactory.shutdown();\n }\n ... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_81 | {
"fields": [],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/server/util/ConfigUtilsTest.java",
"identifier": "ConfigUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetHostAndPortWithIPv4() throws ConfigException {\n String[] nsa = ConfigUtils.getHostAndPort(\"127.0.0.1:443\");\n assertEquals(nsa[0], \"127.0.0.1\");\n assertEquals(nsa[1], \"443\");\n\n nsa = ConfigUtils.getHostAndPort(\"127.0.0.1:2888:3888\");\n ... | {
"fields": [],
"file": "zookeeper-server/src/main/java/org/apache/zookeeper/server/util/ConfigUtils.java",
"identifier": "ConfigUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "ConfigUtils.getClientConfigStr(String configData)",
"constructor": false,
"full_signature":... | {
"body": "public static String[] getHostAndPort(String s) throws ConfigException {\n if (s.startsWith(\"[\")) {\n int i = s.indexOf(\"]\");\n if (i < 0) {\n throw new ConfigException(s + \" starts with '[' but has no matching ']:'\");\n }\n if (i + 2 ... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_39 | {
"fields": [],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/common/PathUtilsTest.java",
"identifier": "PathUtilsTest",
"interfaces": "",
"superclass": "extends ZKTestCase"
} | {
"body": "@Test\n public void testValidatePath_EndsWithSlash() {\n assertThrows(IllegalArgumentException.class, () -> {\n PathUtils.validatePath(\"/ends/with/slash/\");\n });\n }",
"class_method_signature": "PathUtilsTest.testValidatePath_EndsWithSlash()",
"constructor": false,
"... | {
"fields": [],
"file": "zookeeper-server/src/main/java/org/apache/zookeeper/common/PathUtils.java",
"identifier": "PathUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "PathUtils.validatePath(String path, boolean isSequential)",
"constructor": false,
"full_signature": ... | {
"body": "public static void validatePath(String path, boolean isSequential) throws IllegalArgumentException {\n validatePath(isSequential ? path + \"1\" : path);\n }",
"class_method_signature": "PathUtils.validatePath(String path, boolean isSequential)",
"constructor": false,
"full_signature": "pu... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_171 | {
"fields": [],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/BufferStatsTest.java",
"identifier": "BufferStatsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testReset() {\n BufferStats stats = new BufferStats();\n stats.setLastBufferSize(10);\n assertEquals(10, stats.getLastBufferSize());\n assertEquals(10, stats.getMinBufferSize());\n assertEquals(10, stats.getMaxBufferSize());\n stats.reset();\... | {
"fields": [
{
"declarator": "INIT_VALUE = -1",
"modifier": "public static final",
"original_string": "public static final int INIT_VALUE = -1;",
"type": "int",
"var_name": "INIT_VALUE"
},
{
"declarator": "lastBufferSize = INIT_VALUE",
"modifier": "private",
... | {
"body": "public synchronized void reset() {\n lastBufferSize = INIT_VALUE;\n minBufferSize = INIT_VALUE;\n maxBufferSize = INIT_VALUE;\n }",
"class_method_signature": "BufferStats.reset()",
"constructor": false,
"full_signature": "public synchronized void reset()",
"identifier": "res... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_42 | {
"fields": [],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/common/PathUtilsTest.java",
"identifier": "PathUtilsTest",
"interfaces": "",
"superclass": "extends ZKTestCase"
} | {
"body": "@Test\n public void testValidatePath_SinglePeriod() {\n assertThrows(IllegalArgumentException.class, () -> {\n PathUtils.validatePath(\"/single/./period\");\n });\n }",
"class_method_signature": "PathUtilsTest.testValidatePath_SinglePeriod()",
"constructor": false,
"ful... | {
"fields": [],
"file": "zookeeper-server/src/main/java/org/apache/zookeeper/common/PathUtils.java",
"identifier": "PathUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "PathUtils.validatePath(String path, boolean isSequential)",
"constructor": false,
"full_signature": ... | {
"body": "public static void validatePath(String path, boolean isSequential) throws IllegalArgumentException {\n validatePath(isSequential ? path + \"1\" : path);\n }",
"class_method_signature": "PathUtils.validatePath(String path, boolean isSequential)",
"constructor": false,
"full_signature": "pu... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_15 | {
"fields": [
{
"declarator": "port = 1234",
"modifier": "private",
"original_string": "private Integer port = 1234;",
"type": "Integer",
"var_name": "port"
},
{
"declarator": "v4addr = \"127.0.0.1\"",
"modifier": "private",
"original_string": "private Strin... | {
"body": "@Test\n public void tetGetIPV6HostAndPort_WhenPortIsNotSeparatedProperly() {\n assertThrows(IllegalArgumentException.class, () -> {\n NetUtils.getIPV6HostAndPort(\"[2001:0db8:85a3:0000:0000:8a2e:0370:7334]2181\");\n });\n }",
"class_method_signature": "NetUtilsTest.tetGetIP... | {
"fields": [],
"file": "zookeeper-server/src/main/java/org/apache/zookeeper/common/NetUtils.java",
"identifier": "NetUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "NetUtils.formatInetAddr(InetSocketAddress addr)",
"constructor": false,
"full_signature": "public stat... | {
"body": "public static String[] getIPV6HostAndPort(String hostPort) {\n if (hostPort.startsWith(\"[\")) {\n int i = hostPort.lastIndexOf(']');\n if (i < 0) {\n throw new IllegalArgumentException(\n hostPort + \" starts with '[' but has no matching ']'\"... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_54 | {
"fields": [],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/common/PathUtilsTest.java",
"identifier": "PathUtilsTest",
"interfaces": "",
"superclass": "extends ZKTestCase"
} | {
"body": "@Test\n public void testValidatePath_SupplementaryChar() {\n assertThrows(IllegalArgumentException.class, () -> {\n PathUtils.validatePath(\"/test\\ufff0\");\n });\n }",
"class_method_signature": "PathUtilsTest.testValidatePath_SupplementaryChar()",
"constructor": false,
... | {
"fields": [],
"file": "zookeeper-server/src/main/java/org/apache/zookeeper/common/PathUtils.java",
"identifier": "PathUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "PathUtils.validatePath(String path, boolean isSequential)",
"constructor": false,
"full_signature": ... | {
"body": "public static void validatePath(String path, boolean isSequential) throws IllegalArgumentException {\n validatePath(isSequential ? path + \"1\" : path);\n }",
"class_method_signature": "PathUtils.validatePath(String path, boolean isSequential)",
"constructor": false,
"full_signature": "pu... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_23 | {
"fields": [
{
"declarator": "keyPair",
"modifier": "private static",
"original_string": "private static KeyPair keyPair;",
"type": "KeyPair",
"var_name": "keyPair"
},
{
"declarator": "mockX509ExtendedTrustManager",
"modifier": "private",
"original_string":... | {
"body": "@Test\n public void testServerHostnameVerificationWithIPAddress() throws Exception {\n ZKTrustManager zkTrustManager = new ZKTrustManager(mockX509ExtendedTrustManager, true, false);\n\n X509Certificate[] certificateChain = createSelfSignedCertifcateChain(IP_ADDRESS, null);\n zkTrust... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ZKTrustManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(ZKTrustManager.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "@Override\n public void checkServerTrusted(\n X509Certificate[] chain,\n String authType,\n Socket socket) throws CertificateException {\n x509ExtendedTrustManager.checkServerTrusted(chain, authType, socket);\n if (serverHostnameVerificationEnabled) {\n perf... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_184 | {
"fields": [
{
"declarator": "PORTS_AMOUNT = 10",
"modifier": "public static final",
"original_string": "public static final int PORTS_AMOUNT = 10;",
"type": "int",
"var_name": "PORTS_AMOUNT"
}
],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/Mul... | {
"body": "@Test\n public void testAlwaysGetReachableAddress() throws Exception{\n InetSocketAddress reachableHost = new InetSocketAddress(\"127.0.0.1\", 1234);\n InetSocketAddress unreachableHost1 = new InetSocketAddress(\"unreachable1.address.zookeeper.apache.com\", 1234);\n InetSocketAddres... | {
"fields": [
{
"declarator": "DEFAULT_TIMEOUT = Duration.ofMillis(1000)",
"modifier": "public static final",
"original_string": "public static final Duration DEFAULT_TIMEOUT = Duration.ofMillis(1000);",
"type": "Duration",
"var_name": "DEFAULT_TIMEOUT"
},
{
"declarator... | {
"body": "public InetSocketAddress getReachableAddress() throws NoRouteToHostException {\n // using parallelStream() + findAny() will help to minimize the time spent on network operations\n return addresses.parallelStream()\n .filter(this::checkIfAddressIsReachable)\n .findAny()\n ... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_74 | {
"fields": [],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/server/util/RequestPathMetricsCollectorTest.java",
"identifier": "RequestPathMetricsCollectorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testTrimPath() {\n //normal cases\n String trimedPath = RequestPathMetricsCollector.trimPathDepth(\"/p1/p2/p3\", 1);\n assertTrue(trimedPath.equalsIgnoreCase(\"/p1\"));\n trimedPath = RequestPathMetricsCollector.trimPathDepth(\"/p1/p2/p3\", 2);\n as... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(RequestPathMetricsCollector.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(RequestPathMetricsCollector.class);",
"type": "Logger",
"var_name": "LOG... | {
"body": "static String trimPathDepth(String path, int maxDepth) {\n int count = 0;\n StringBuilder sb = new StringBuilder();\n StringTokenizer pathTokenizer = new StringTokenizer(path, PATH_SEPERATOR);\n while (pathTokenizer.hasMoreElements() && count++ < maxDepth) {\n sb.appe... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_215 | {
"fields": [],
"file": "zookeeper-jute/src/test/java/org/apache/jute/BinaryInputArchiveTest.java",
"identifier": "BinaryInputArchiveTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testBool() {\n final boolean expected = false;\n final String tag = \"tag1\";\n checkWriterAndReader(\n (oa) -> oa.writeBool(expected, tag),\n (ia) -> {\n boolean actual = ia.readBool(tag);\n ass... | {
"fields": [
{
"declarator": "UNREASONBLE_LENGTH = \"Unreasonable length = \"",
"modifier": "public static final",
"original_string": "public static final String UNREASONBLE_LENGTH = \"Unreasonable length = \";",
"type": "String",
"var_name": "UNREASONBLE_LENGTH"
},
{
... | {
"body": "public boolean readBool(String tag) throws IOException {\n return in.readBoolean();\n }",
"class_method_signature": "BinaryInputArchive.readBool(String tag)",
"constructor": false,
"full_signature": "public boolean readBool(String tag)",
"identifier": "readBool",
"invocations": [
"r... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_62 | {
"fields": [
{
"declarator": "LINE_SEPARATOR = System.getProperty(\"line.separator\", \"\\n\")",
"modifier": "private static final",
"original_string": "private static final String LINE_SEPARATOR = System.getProperty(\"line.separator\", \"\\n\");",
"type": "String",
"var_name": "LIN... | {
"body": "@Test\n public void testSetData() throws Exception {\n final ZooKeeper zk = createClient();\n ZooKeeperMain zkMain = new ZooKeeperMain(zk);\n String cmdstring1 = \"create -e /node4 data\";\n String cmdstring2 = \"set /node4 \" + \"data\";\n String cmdstring3 = \"delete... | {
"fields": [
{
"declarator": "ZOOKEEPER_CLIENT_CNXN_SOCKET = \"zookeeper.clientCnxnSocket\"",
"modifier": "@Deprecated\n public static final",
"original_string": "@Deprecated\n public static final String ZOOKEEPER_CLIENT_CNXN_SOCKET = \"zookeeper.clientCnxnSocket\";",
"type": "Strin... | {
"body": "public Stat setData(final String path, byte[] data, int version) throws KeeperException, InterruptedException {\n final String clientPath = path;\n PathUtils.validatePath(clientPath);\n\n final String serverPath = prependChroot(clientPath);\n\n RequestHeader h = new RequestHeade... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_203 | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(JettyAdminServerTest.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger LOG = LoggerFactory.getLogger(JettyAdminServerTest.class);",
"type": "Logger",
"var_name": "LOG"
},
... | {
"body": "@Test\n public void testJettyAdminServer() throws AdminServerException, IOException, SSLContextException, GeneralSecurityException {\n JettyAdminServer server = new JettyAdminServer();\n try {\n server.start();\n queryAdminServer(jettyAdminPort);\n traceAdm... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(JettyAdminServer.class)",
"modifier": "static final",
"original_string": "static final Logger LOG = LoggerFactory.getLogger(JettyAdminServer.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "DE... | {
"body": "public JettyAdminServer() throws AdminServerException, IOException, GeneralSecurityException {\n this(\n System.getProperty(\"zookeeper.admin.serverAddress\", DEFAULT_ADDRESS),\n Integer.getInteger(\"zookeeper.admin.serverPort\", DEFAULT_PORT),\n Integer.getInteger(\... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_35 | {
"fields": [],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/common/PathUtilsTest.java",
"identifier": "PathUtilsTest",
"interfaces": "",
"superclass": "extends ZKTestCase"
} | {
"body": "@Test\n public void testValidatePath_ValidPath() {\n PathUtils.validatePath(\"/this is / a valid/path\");\n }",
"class_method_signature": "PathUtilsTest.testValidatePath_ValidPath()",
"constructor": false,
"full_signature": "@Test public void testValidatePath_ValidPath()",
"identifier"... | {
"fields": [],
"file": "zookeeper-server/src/main/java/org/apache/zookeeper/common/PathUtils.java",
"identifier": "PathUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "PathUtils.validatePath(String path, boolean isSequential)",
"constructor": false,
"full_signature": ... | {
"body": "public static void validatePath(String path, boolean isSequential) throws IllegalArgumentException {\n validatePath(isSequential ? path + \"1\" : path);\n }",
"class_method_signature": "PathUtils.validatePath(String path, boolean isSequential)",
"constructor": false,
"full_signature": "pu... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_192 | {
"fields": [
{
"declarator": "leader",
"modifier": "private",
"original_string": "private Leader leader;",
"type": "Leader",
"var_name": "leader"
},
{
"declarator": "leaderBean",
"modifier": "private",
"original_string": "private LeaderBean leaderBean;",
... | {
"body": "@Test\n public void testGetName() {\n assertEquals(\"Leader\", leaderBean.getName());\n }",
"class_method_signature": "LeaderBeanTest.testGetName()",
"constructor": false,
"full_signature": "@Test public void testGetName()",
"identifier": "testGetName",
"invocations": [
"assertEq... | {
"fields": [
{
"declarator": "leader",
"modifier": "private final",
"original_string": "private final Leader leader;",
"type": "Leader",
"var_name": "leader"
}
],
"file": "zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/LeaderBean.java",
"identifier": "Le... | {
"body": "public String getName() {\n return \"Leader\";\n }",
"class_method_signature": "LeaderBean.getName()",
"constructor": false,
"full_signature": "public String getName()",
"identifier": "getName",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "String",
"s... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_106 | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(WatcherCleanerTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(WatcherCleanerTest.class);",
"type": "Logger",
"var_name": "LOG"
}
],
"fi... | {
"body": "@Test\n public void testProcessDeadWatchersBasedOnTime() {\n MyDeadWatcherListener listener = new MyDeadWatcherListener();\n WatcherCleaner cleaner = new WatcherCleaner(listener, 10, 1, 1, 10);\n cleaner.start();\n\n cleaner.addDeadWatcher(1);\n // not trigger processD... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(WatcherCleaner.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(WatcherCleaner.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public void addDeadWatcher(int watcherBit) {\n // Wait if there are too many watchers waiting to be closed,\n // this is will slow down the socket packet processing and\n // the adding watches in the ZK pipeline.\n while (maxInProcessingDeadWatchers > 0 && !stopped && totalDeadW... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_19 | {
"fields": [
{
"declarator": "port = 1234",
"modifier": "private",
"original_string": "private Integer port = 1234;",
"type": "Integer",
"var_name": "port"
},
{
"declarator": "v4addr = \"127.0.0.1\"",
"modifier": "private",
"original_string": "private Strin... | {
"body": "@Test\n public void tetGetIPV6HostAndPort_ReturnHostPortPort() {\n String[] ipv6HostAndPort =\n NetUtils.getIPV6HostAndPort(\"[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:2181:3181\");\n assertEquals(2, ipv6HostAndPort.length);\n assertEquals(\"2001:0db8:85a3:0000:0000:8a2e:... | {
"fields": [],
"file": "zookeeper-server/src/main/java/org/apache/zookeeper/common/NetUtils.java",
"identifier": "NetUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "NetUtils.formatInetAddr(InetSocketAddress addr)",
"constructor": false,
"full_signature": "public stat... | {
"body": "public static String[] getIPV6HostAndPort(String hostPort) {\n if (hostPort.startsWith(\"[\")) {\n int i = hostPort.lastIndexOf(']');\n if (i < 0) {\n throw new IllegalArgumentException(\n hostPort + \" starts with '[' but has no matching ']'\"... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_151 | {
"fields": [
{
"declarator": "c",
"modifier": "private",
"original_string": "private ZooKeeperServerConf c;",
"type": "ZooKeeperServerConf",
"var_name": "c"
}
],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperServerConfTest.java",
"identifier"... | {
"body": "@Test\n public void testToMap() {\n Map<String, Object> m = c.toMap();\n assertEquals(9, m.size());\n assertEquals(Integer.valueOf(1), m.get(ZooKeeperServerConf.KEY_CLIENT_PORT));\n assertEquals(\"a\", m.get(ZooKeeperServerConf.KEY_DATA_DIR));\n assertEquals(\"b\", m.g... | {
"fields": [
{
"declarator": "KEY_CLIENT_PORT = \"client_port\"",
"modifier": "public static final",
"original_string": "public static final String KEY_CLIENT_PORT = \"client_port\";",
"type": "String",
"var_name": "KEY_CLIENT_PORT"
},
{
"declarator": "KEY_DATA_DIR = \... | {
"body": "public Map<String, Object> toMap() {\n Map<String, Object> conf = new LinkedHashMap<String, Object>();\n conf.put(KEY_CLIENT_PORT, clientPort);\n conf.put(KEY_DATA_DIR, dataDir);\n conf.put(KEY_DATA_LOG_DIR, dataLogDir);\n conf.put(KEY_TICK_TIME, tickTime);\n conf.... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_0 | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(LeaderElectionSupportTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(LeaderElectionSupportTest.class);",
"type": "Logger",
"var_name": "L... | {
"body": "@Test\n public void testGetLeaderHostName() throws Exception {\n LeaderElectionSupport electionSupport = createLeaderElectionSupport();\n\n electionSupport.start();\n\n // Sketchy: We assume there will be a leader (probably us) in 3 seconds.\n Thread.sleep(3000);\n\n S... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(LeaderElectionSupport.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(LeaderElectionSupport.class);",
"type": "Logger",
"var_name": "LOG"
},
... | {
"body": "public String getLeaderHostName() throws KeeperException, InterruptedException {\n\n List<LeaderOffer> leaderOffers = toLeaderOffers(zooKeeper.getChildren(rootNodeName, false));\n\n if (leaderOffers.size() > 0) {\n return leaderOffers.get(0).getHostName();\n }\n\n ret... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_147 | {
"fields": [
{
"declarator": "testCounter",
"modifier": "private",
"original_string": "private AvgMinMaxPercentileCounter testCounter;",
"type": "AvgMinMaxPercentileCounter",
"var_name": "testCounter"
}
],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/server/m... | {
"body": "@Test\n public void testReset() {\n addDataPoints();\n testCounter.reset();\n\n Map<String, Object> values = testCounter.values();\n\n assertEquals(9, values.size(), \"There should be 9 values in the set\");\n\n assertEquals(0D, values.get(\"avg_test\"), \"should avg=0... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "counter",
"modifier": "private final",
"original_string": "private final AvgMinMaxCou... | {
"body": "public void reset() {\n counter.reset();\n reservoir.reset();\n }",
"class_method_signature": "AvgMinMaxPercentileCounter.reset()",
"constructor": false,
"full_signature": "public void reset()",
"identifier": "reset",
"invocations": [
"reset",
"reset"
],
"modifiers": ... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_58 | {
"fields": [],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/common/FileKeyStoreLoaderBuilderProviderTest.java",
"identifier": "FileKeyStoreLoaderBuilderProviderTest",
"interfaces": "",
"superclass": "extends ZKTestCase"
} | {
"body": "@Test\n public void testGetBuilderForNullFileType() {\n assertThrows(NullPointerException.class, () -> {\n FileKeyStoreLoaderBuilderProvider.getBuilderForKeyStoreFileType(null);\n });\n }",
"class_method_signature": "FileKeyStoreLoaderBuilderProviderTest.testGetBuilderForNu... | {
"fields": [],
"file": "zookeeper-server/src/main/java/org/apache/zookeeper/common/FileKeyStoreLoaderBuilderProvider.java",
"identifier": "FileKeyStoreLoaderBuilderProvider",
"interfaces": "",
"methods": [
{
"class_method_signature": "FileKeyStoreLoaderBuilderProvider.getBuilderForKeyStoreFileType(... | {
"body": "static FileKeyStoreLoader.Builder<? extends FileKeyStoreLoader> getBuilderForKeyStoreFileType(KeyStoreFileType type) {\n switch (Objects.requireNonNull(type)) {\n case JKS:\n return new JKSFileLoader.Builder();\n case PEM:\n return new PEMFileLoader.Builder();\n ... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_110 | {
"fields": [
{
"declarator": "m",
"modifier": "private",
"original_string": "private Map<String, Set<Long>> m;",
"type": "Map<String, Set<Long>>",
"var_name": "m"
},
{
"declarator": "r",
"modifier": "private",
"original_string": "private WatchesPathReport r... | {
"body": "@Test\n public void testGetSessions() {\n Set<Long> s = r.getSessions(\"path1\");\n assertEquals(2, s.size());\n assertTrue(s.contains(101L));\n assertTrue(s.contains(102L));\n s = r.getSessions(\"path2\");\n assertEquals(1, s.size());\n assertTrue(s.cont... | {
"fields": [
{
"declarator": "path2Ids",
"modifier": "private final",
"original_string": "private final Map<String, Set<Long>> path2Ids;",
"type": "Map<String, Set<Long>>",
"var_name": "path2Ids"
}
],
"file": "zookeeper-server/src/main/java/org/apache/zookeeper/server/watch/... | {
"body": "public Set<Long> getSessions(String path) {\n Set<Long> s = path2Ids.get(path);\n return s != null ? Collections.unmodifiableSet(s) : null;\n }",
"class_method_signature": "WatchesPathReport.getSessions(String path)",
"constructor": false,
"full_signature": "public Set<Long> getSessi... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_59 | {
"fields": [
{
"declarator": "x509Util = new ClientX509Util()",
"modifier": "",
"original_string": "X509Util x509Util = new ClientX509Util();",
"type": "X509Util",
"var_name": "x509Util"
}
],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/common/ZKConfigTest.ja... | {
"body": "@Test\n @Timeout(value = 10)\n public void testBooleanRetrievalFromPropertyDefault() {\n ZKConfig conf = new ZKConfig();\n String prop = \"UnSetProperty\" + System.currentTimeMillis();\n boolean defaultValue = false;\n boolean result = conf.getBoolean(prop, defaultValue);\... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ZKConfig.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(ZKConfig.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "JU... | {
"body": "public boolean getBoolean(String key) {\n return getBoolean(key, false);\n }",
"class_method_signature": "ZKConfig.getBoolean(String key)",
"constructor": false,
"full_signature": "public boolean getBoolean(String key)",
"identifier": "getBoolean",
"invocations": [
"getBoolean"
],... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_111 | {
"fields": [
{
"declarator": "m",
"modifier": "private",
"original_string": "private Map<String, Set<Long>> m;",
"type": "Map<String, Set<Long>>",
"var_name": "m"
},
{
"declarator": "r",
"modifier": "private",
"original_string": "private WatchesPathReport r... | {
"body": "@Test\n public void testToMap() {\n assertEquals(m, r.toMap());\n }",
"class_method_signature": "WatchesPathReportTest.testToMap()",
"constructor": false,
"full_signature": "@Test public void testToMap()",
"identifier": "testToMap",
"invocations": [
"assertEquals",
"toMap"
... | {
"fields": [
{
"declarator": "path2Ids",
"modifier": "private final",
"original_string": "private final Map<String, Set<Long>> path2Ids;",
"type": "Map<String, Set<Long>>",
"var_name": "path2Ids"
}
],
"file": "zookeeper-server/src/main/java/org/apache/zookeeper/server/watch/... | {
"body": "public Map<String, Set<Long>> toMap() {\n return deepCopy(path2Ids);\n }",
"class_method_signature": "WatchesPathReport.toMap()",
"constructor": false,
"full_signature": "public Map<String, Set<Long>> toMap()",
"identifier": "toMap",
"invocations": [
"deepCopy"
],
"modifiers": "... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_146 | {
"fields": [
{
"declarator": "testCounterSet",
"modifier": "private",
"original_string": "private AvgMinMaxPercentileCounterSet testCounterSet;",
"type": "AvgMinMaxPercentileCounterSet",
"var_name": "testCounterSet"
}
],
"file": "zookeeper-server/src/test/java/org/apache/zoo... | {
"body": "@Test\n public void testValues() {\n addDataPoints();\n Map<String, Object> values = testCounterSet.values();\n\n assertEquals(18, values.size(), \"There should be 18 values in the set\");\n\n assertEquals(999D / 2, values.get(\"avg_key1_test\"), \"avg_key1_test should =499.5... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "counters = new ConcurrentHashMap<>()",
"modifier": "private",
"original_string": "pri... | {
"body": "@Override\n public Map<String, Object> values() {\n Map<String, Object> m = new LinkedHashMap<>();\n for (Map.Entry<String, AvgMinMaxPercentileCounter> entry : counters.entrySet()) {\n m.putAll(entry.getValue().values());\n }\n return m;\n }",
"class_method_si... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_1 | {
"fields": [],
"file": "zookeeper-recipes/zookeeper-recipes-queue/src/test/java/org/apache/zookeeper/recipes/queue/DistributedQueueTest.java",
"identifier": "DistributedQueueTest",
"interfaces": "",
"superclass": "extends ClientBase"
} | {
"body": "@Test\n public void testRemove1() throws Exception {\n String dir = \"/testRemove1\";\n final int numClients = 1;\n ZooKeeper[] clients = new ZooKeeper[numClients];\n DistributedQueue[] queueHandles = new DistributedQueue[numClients];\n for (int i = 0; i < clients.leng... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(DistributedQueue.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(DistributedQueue.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"... | {
"body": "public byte[] remove() throws NoSuchElementException, KeeperException, InterruptedException {\n Map<Long, String> orderedChildren;\n // Same as for element. Should refactor this.\n while (true) {\n try {\n orderedChildren = orderedChildren(null);\n ... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_18 | {
"fields": [
{
"declarator": "port = 1234",
"modifier": "private",
"original_string": "private Integer port = 1234;",
"type": "Integer",
"var_name": "port"
},
{
"declarator": "v4addr = \"127.0.0.1\"",
"modifier": "private",
"original_string": "private Strin... | {
"body": "@Test\n public void tetGetIPV6HostAndPort_ReturnHostPort() {\n String[] ipv6HostAndPort =\n NetUtils.getIPV6HostAndPort(\"[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:2181\");\n assertEquals(2, ipv6HostAndPort.length);\n assertEquals(\"2001:0db8:85a3:0000:0000:8a2e:0370:7334... | {
"fields": [],
"file": "zookeeper-server/src/main/java/org/apache/zookeeper/common/NetUtils.java",
"identifier": "NetUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "NetUtils.formatInetAddr(InetSocketAddress addr)",
"constructor": false,
"full_signature": "public stat... | {
"body": "public static String[] getIPV6HostAndPort(String hostPort) {\n if (hostPort.startsWith(\"[\")) {\n int i = hostPort.lastIndexOf(']');\n if (i < 0) {\n throw new IllegalArgumentException(\n hostPort + \" starts with '[' but has no matching ']'\"... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_150 | {
"fields": [
{
"declarator": "testCounterSet",
"modifier": "private",
"original_string": "private AvgMinMaxCounterSet testCounterSet;",
"type": "AvgMinMaxCounterSet",
"var_name": "testCounterSet"
}
],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/server/metric... | {
"body": "@Test\n public void testValues() {\n addDataPoints();\n Map<String, Object> values = testCounterSet.values();\n\n assertEquals(10, values.size(), \"There should be 10 values in the set\");\n assertEquals(0.5D, values.get(\"avg_key1_test\"), \"avg_key1_test should =0.5\");\n ... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "counters = new ConcurrentHashMap<>()",
"modifier": "private",
"original_string": "pri... | {
"body": "@Override\n public Map<String, Object> values() {\n Map<String, Object> m = new LinkedHashMap<>();\n for (Map.Entry<String, AvgMinMaxCounter> entry : counters.entrySet()) {\n m.putAll(entry.getValue().values());\n }\n return m;\n }",
"class_method_signature": ... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_107 | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(WatcherCleanerTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(WatcherCleanerTest.class);",
"type": "Logger",
"var_name": "LOG"
}
],
"fi... | {
"body": "@Test\n public void testMaxInProcessingDeadWatchers() {\n MyDeadWatcherListener listener = new MyDeadWatcherListener();\n int delayMs = 1000;\n listener.setDelayMs(delayMs);\n WatcherCleaner cleaner = new WatcherCleaner(listener, 1, 60, 1, 1);\n cleaner.start();\n\n ... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(WatcherCleaner.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(WatcherCleaner.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public void addDeadWatcher(int watcherBit) {\n // Wait if there are too many watchers waiting to be closed,\n // this is will slow down the socket packet processing and\n // the adding watches in the ZK pipeline.\n while (maxInProcessingDeadWatchers > 0 && !stopped && totalDeadW... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_34 | {
"fields": [
{
"declarator": "pathTrie",
"modifier": "private",
"original_string": "private PathTrie pathTrie;",
"type": "PathTrie",
"var_name": "pathTrie"
}
],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/common/PathTrieTest.java",
"identifier": "PathTrieT... | {
"body": "@Test\n public void findMaxPrefixRootPath() {\n assertEquals(\"/\", this.pathTrie.findMaxPrefix(\"/\"));\n }",
"class_method_signature": "PathTrieTest.findMaxPrefixRootPath()",
"constructor": false,
"full_signature": "@Test public void findMaxPrefixRootPath()",
"identifier": "findMaxPr... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(PathTrie.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(PathTrie.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "ro... | {
"body": "public String findMaxPrefix(final String path) {\n Objects.requireNonNull(path, \"Path cannot be null\");\n\n final String[] pathComponents = split(path);\n\n readLock.lock();\n try {\n TrieNode parent = rootNode;\n TrieNode deepestPropertyNode = null... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_193 | {
"fields": [
{
"declarator": "leader",
"modifier": "private",
"original_string": "private Leader leader;",
"type": "Leader",
"var_name": "leader"
},
{
"declarator": "leaderBean",
"modifier": "private",
"original_string": "private LeaderBean leaderBean;",
... | {
"body": "@Test\n public void testGetCurrentZxid() {\n // Arrange\n zks.setZxid(1);\n\n // Assert\n assertEquals(\"0x1\", leaderBean.getCurrentZxid());\n }",
"class_method_signature": "LeaderBeanTest.testGetCurrentZxid()",
"constructor": false,
"full_signature": "@Test public ... | {
"fields": [
{
"declarator": "leader",
"modifier": "private final",
"original_string": "private final Leader leader;",
"type": "Leader",
"var_name": "leader"
}
],
"file": "zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/LeaderBean.java",
"identifier": "Le... | {
"body": "public String getCurrentZxid() {\n return \"0x\" + Long.toHexString(zks.getZxid());\n }",
"class_method_signature": "LeaderBean.getCurrentZxid()",
"constructor": false,
"full_signature": "public String getCurrentZxid()",
"identifier": "getCurrentZxid",
"invocations": [
"toHexString"... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_202 | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(RequestThrottlerTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(RequestThrottlerTest.class);",
"type": "Logger",
"var_name": "LOG"
},
{... | {
"body": "@Test\n public void testGlobalOutstandingRequestThrottlingWithRequestThrottlerDisabled() throws Exception {\n try {\n System.setProperty(ZooKeeperServer.GLOBAL_OUTSTANDING_LIMIT, GLOBAL_OUTSTANDING_LIMIT);\n\n ServerMetrics.getMetrics().resetAll();\n\n // Here we ... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(RequestThrottler.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(RequestThrottler.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"... | {
"body": "public static void setMaxRequests(int requests) {\n maxRequests = requests;\n }",
"class_method_signature": "RequestThrottler.setMaxRequests(int requests)",
"constructor": false,
"full_signature": "public static void setMaxRequests(int requests)",
"identifier": "setMaxRequests",
"invoca... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_63 | {
"fields": [
{
"declarator": "LINE_SEPARATOR = System.getProperty(\"line.separator\", \"\\n\")",
"modifier": "private static final",
"original_string": "private static final String LINE_SEPARATOR = System.getProperty(\"line.separator\", \"\\n\");",
"type": "String",
"var_name": "LIN... | {
"body": "@Test\n public void testCliCommandsNotEchoingUsage() throws Exception {\n // setup redirect out/err streams to get System.in/err, use this judiciously!\n final PrintStream systemErr = System.err; // get current err\n final ByteArrayOutputStream errContent = new ByteArrayOutputStream... | {
"fields": [
{
"declarator": "ZOOKEEPER_CLIENT_CNXN_SOCKET = \"zookeeper.clientCnxnSocket\"",
"modifier": "@Deprecated\n public static final",
"original_string": "@Deprecated\n public static final String ZOOKEEPER_CLIENT_CNXN_SOCKET = \"zookeeper.clientCnxnSocket\";",
"type": "Strin... | {
"body": "@Override\n public String toString() {\n States state = getState();\n return (\"State:\"\n + state.toString()\n + (state.isConnected() ? \" Timeout:\" + getSessionTimeout() + \" \" : \" \")\n + cnxn);\n }",
"class_method_signature": "ZooKee... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_214 | {
"fields": [],
"file": "zookeeper-jute/src/test/java/org/apache/jute/BinaryInputArchiveTest.java",
"identifier": "BinaryInputArchiveTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testInt() {\n final int expected = 4;\n final String tag = \"tag1\";\n checkWriterAndReader(\n (oa) -> oa.writeInt(expected, tag),\n (ia) -> {\n int actual = ia.readInt(tag);\n assertEquals(expec... | {
"fields": [
{
"declarator": "UNREASONBLE_LENGTH = \"Unreasonable length = \"",
"modifier": "public static final",
"original_string": "public static final String UNREASONBLE_LENGTH = \"Unreasonable length = \";",
"type": "String",
"var_name": "UNREASONBLE_LENGTH"
},
{
... | {
"body": "public int readInt(String tag) throws IOException {\n return in.readInt();\n }",
"class_method_signature": "BinaryInputArchive.readInt(String tag)",
"constructor": false,
"full_signature": "public int readInt(String tag)",
"identifier": "readInt",
"invocations": [
"readInt"
],
"... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_75 | {
"fields": [],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/server/util/RequestPathMetricsCollectorTest.java",
"identifier": "RequestPathMetricsCollectorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCollectEmptyStats() throws InterruptedException {\n RequestPathMetricsCollector requestPathMetricsCollector = new RequestPathMetricsCollector();\n RequestPathMetricsCollector.PathStatsQueue pathStatsQueue = requestPathMetricsCollector.new PathStatsQueue(getChildren)... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(RequestPathMetricsCollector.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(RequestPathMetricsCollector.class);",
"type": "Logger",
"var_name": "LOG... | {
"body": "public void start() {\n if (!enabled) {\n return;\n }\n\n LOG.info(\"Start the RequestPath collector\");\n immutableRequestsMap.forEach((opType, pathStatsQueue) -> pathStatsQueue.start());\n\n // Schedule to log the top used read/write paths every 5 mins\n ... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_22 | {
"fields": [
{
"declarator": "keyPair",
"modifier": "private static",
"original_string": "private static KeyPair keyPair;",
"type": "KeyPair",
"var_name": "keyPair"
},
{
"declarator": "mockX509ExtendedTrustManager",
"modifier": "private",
"original_string":... | {
"body": "@Test\n public void testServerHostnameVerificationWithHostnameVerificationDisabledAndClientHostnameVerificationEnabled() throws Exception {\n ZKTrustManager zkTrustManager = new ZKTrustManager(mockX509ExtendedTrustManager, false, true);\n\n X509Certificate[] certificateChain = createSelfSi... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ZKTrustManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(ZKTrustManager.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "@Override\n public void checkServerTrusted(\n X509Certificate[] chain,\n String authType,\n Socket socket) throws CertificateException {\n x509ExtendedTrustManager.checkServerTrusted(chain, authType, socket);\n if (serverHostnameVerificationEnabled) {\n perf... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_185 | {
"fields": [
{
"declarator": "PORTS_AMOUNT = 10",
"modifier": "public static final",
"original_string": "public static final int PORTS_AMOUNT = 10;",
"type": "int",
"var_name": "PORTS_AMOUNT"
}
],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/Mul... | {
"body": "@Test\n public void testGetAllReachableAddresses() throws Exception {\n InetSocketAddress reachableHost1 = new InetSocketAddress(\"127.0.0.1\", 1234);\n InetSocketAddress reachableHost2 = new InetSocketAddress(\"127.0.0.1\", 2345);\n InetSocketAddress unreachableHost1 = new InetSock... | {
"fields": [
{
"declarator": "DEFAULT_TIMEOUT = Duration.ofMillis(1000)",
"modifier": "public static final",
"original_string": "public static final Duration DEFAULT_TIMEOUT = Duration.ofMillis(1000);",
"type": "Duration",
"var_name": "DEFAULT_TIMEOUT"
},
{
"declarator... | {
"body": "public Set<InetSocketAddress> getAllReachableAddresses() {\n // using parallelStream() will help to minimize the time spent on network operations\n return addresses.parallelStream()\n .filter(this::checkIfAddressIsReachable)\n .collect(Collectors.toSet());\n }",
"class_... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_55 | {
"fields": [],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/common/FileKeyStoreLoaderBuilderProviderTest.java",
"identifier": "FileKeyStoreLoaderBuilderProviderTest",
"interfaces": "",
"superclass": "extends ZKTestCase"
} | {
"body": "@Test\n public void testGetBuilderForJKSFileType() {\n FileKeyStoreLoader.Builder<?> builder = FileKeyStoreLoaderBuilderProvider.getBuilderForKeyStoreFileType(KeyStoreFileType.JKS);\n assertTrue(builder instanceof JKSFileLoader.Builder);\n }",
"class_method_signature": "FileKeyStoreLo... | {
"fields": [],
"file": "zookeeper-server/src/main/java/org/apache/zookeeper/common/FileKeyStoreLoaderBuilderProvider.java",
"identifier": "FileKeyStoreLoaderBuilderProvider",
"interfaces": "",
"methods": [
{
"class_method_signature": "FileKeyStoreLoaderBuilderProvider.getBuilderForKeyStoreFileType(... | {
"body": "static FileKeyStoreLoader.Builder<? extends FileKeyStoreLoader> getBuilderForKeyStoreFileType(KeyStoreFileType type) {\n switch (Objects.requireNonNull(type)) {\n case JKS:\n return new JKSFileLoader.Builder();\n case PEM:\n return new PEMFileLoader.Builder();\n ... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_14 | {
"fields": [
{
"declarator": "port = 1234",
"modifier": "private",
"original_string": "private Integer port = 1234;",
"type": "Integer",
"var_name": "port"
},
{
"declarator": "v4addr = \"127.0.0.1\"",
"modifier": "private",
"original_string": "private Strin... | {
"body": "@Test\n public void tetGetIPV6HostAndPort_WhenNoPortAfterColon() {\n assertThrows(IllegalArgumentException.class, () -> {\n NetUtils.getIPV6HostAndPort(\"[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:\");\n });\n }",
"class_method_signature": "NetUtilsTest.tetGetIPV6HostAndPort... | {
"fields": [],
"file": "zookeeper-server/src/main/java/org/apache/zookeeper/common/NetUtils.java",
"identifier": "NetUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "NetUtils.formatInetAddr(InetSocketAddress addr)",
"constructor": false,
"full_signature": "public stat... | {
"body": "public static String[] getIPV6HostAndPort(String hostPort) {\n if (hostPort.startsWith(\"[\")) {\n int i = hostPort.lastIndexOf(']');\n if (i < 0) {\n throw new IllegalArgumentException(\n hostPort + \" starts with '[' but has no matching ']'\"... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_43 | {
"fields": [],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/common/PathUtilsTest.java",
"identifier": "PathUtilsTest",
"interfaces": "",
"superclass": "extends ZKTestCase"
} | {
"body": "@Test\n public void testValidatePath_DoublePeriod() {\n assertThrows(IllegalArgumentException.class, () -> {\n PathUtils.validatePath(\"/double/../period\");\n });\n }",
"class_method_signature": "PathUtilsTest.testValidatePath_DoublePeriod()",
"constructor": false,
"fu... | {
"fields": [],
"file": "zookeeper-server/src/main/java/org/apache/zookeeper/common/PathUtils.java",
"identifier": "PathUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "PathUtils.validatePath(String path, boolean isSequential)",
"constructor": false,
"full_signature": ... | {
"body": "public static void validatePath(String path, boolean isSequential) throws IllegalArgumentException {\n validatePath(isSequential ? path + \"1\" : path);\n }",
"class_method_signature": "PathUtils.validatePath(String path, boolean isSequential)",
"constructor": false,
"full_signature": "pu... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_38 | {
"fields": [],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/common/PathUtilsTest.java",
"identifier": "PathUtilsTest",
"interfaces": "",
"superclass": "extends ZKTestCase"
} | {
"body": "@Test\n public void testValidatePath_NotAbsolutePath() {\n assertThrows(IllegalArgumentException.class, () -> {\n PathUtils.validatePath(\"not/valid\");\n });\n }",
"class_method_signature": "PathUtilsTest.testValidatePath_NotAbsolutePath()",
"constructor": false,
"full... | {
"fields": [],
"file": "zookeeper-server/src/main/java/org/apache/zookeeper/common/PathUtils.java",
"identifier": "PathUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "PathUtils.validatePath(String path, boolean isSequential)",
"constructor": false,
"full_signature": ... | {
"body": "public static void validatePath(String path, boolean isSequential) throws IllegalArgumentException {\n validatePath(isSequential ? path + \"1\" : path);\n }",
"class_method_signature": "PathUtils.validatePath(String path, boolean isSequential)",
"constructor": false,
"full_signature": "pu... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_170 | {
"fields": [],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java",
"identifier": "QuorumPeerMainTest",
"interfaces": "",
"superclass": "extends QuorumPeerTestBase"
} | {
"body": "@Test\n public void testLeaderOutOfView() throws Exception {\n ClientBase.setupTestEnv();\n\n int numServers = 3;\n\n // used for assertions later\n boolean foundLeading = false;\n boolean foundFollowing = false;\n\n // capture QuorumPeer logging\n ByteAr... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(QuorumPeerMain.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(QuorumPeerMain.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "protected QuorumPeer getQuorumPeer() throws SaslException {\n return new QuorumPeer();\n }",
"class_method_signature": "QuorumPeerMain.getQuorumPeer()",
"constructor": false,
"full_signature": "protected QuorumPeer getQuorumPeer()",
"identifier": "getQuorumPeer",
"invocations": [],
"m... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_127 | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ZooKeeperServerMainTest.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger LOG = LoggerFactory.getLogger(ZooKeeperServerMainTest.class);",
"type": "Logger",
"var_name": "LOG"
... | {
"body": "@Test\n public void testWithOnlyMinSessionTimeout() throws Exception {\n ClientBase.setupTestEnv();\n\n final int CLIENT_PORT = PortAssignment.unique();\n final int tickTime = 2000;\n final int minSessionTimeout = tickTime * 2 - 100;\n int maxSessionTimeout = 20 * tick... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ZooKeeperServerMain.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(ZooKeeperServerMain.class);",
"type": "Logger",
"var_name": "LOG"
},
{
... | {
"body": "protected void shutdown() {\n if (containerManager != null) {\n containerManager.stop();\n }\n if (cnxnFactory != null) {\n cnxnFactory.shutdown();\n }\n if (secureCnxnFactory != null) {\n secureCnxnFactory.shutdown();\n }\n ... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_80 | {
"fields": [],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/server/util/ConfigUtilsTest.java",
"identifier": "ConfigUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetHostAndPortWithIPv6() throws ConfigException {\n String[] nsa = ConfigUtils.getHostAndPort(\"[2001:db8:85a3:8d3:1319:8a2e:370:7348]:443\");\n assertEquals(nsa[0], \"2001:db8:85a3:8d3:1319:8a2e:370:7348\");\n assertEquals(nsa[1], \"443\");\n\n nsa = ... | {
"fields": [],
"file": "zookeeper-server/src/main/java/org/apache/zookeeper/server/util/ConfigUtils.java",
"identifier": "ConfigUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "ConfigUtils.getClientConfigStr(String configData)",
"constructor": false,
"full_signature":... | {
"body": "public static String[] getHostAndPort(String s) throws ConfigException {\n if (s.startsWith(\"[\")) {\n int i = s.indexOf(\"]\");\n if (i < 0) {\n throw new ConfigException(s + \" starts with '[' but has no matching ']:'\");\n }\n if (i + 2 ... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_79 | {
"fields": [
{
"declarator": "BUFFERED_MESSAGE_SIZE = 5",
"modifier": "private static final",
"original_string": "private static final int BUFFERED_MESSAGE_SIZE = 5;",
"type": "int",
"var_name": "BUFFERED_MESSAGE_SIZE"
},
{
"declarator": "LOG = LoggerFactory.getLogger(... | {
"body": "@Test\n public void testDumpToLog() {\n long timestamp1 = System.currentTimeMillis();\n MessageTracker messageTracker = new MessageTracker(BUFFERED_MESSAGE_SIZE);\n String sid = \"127.0.0.1\";\n\n // MessageTracker is empty\n messageTracker.dumpToLog(sid);\n ass... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(MessageTracker.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(MessageTracker.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public void dumpToLog(String serverAddress) {\n if (!enabled) {\n return;\n }\n logMessages(serverAddress, receivedBuffer, Direction.RECEIVED);\n logMessages(serverAddress, sentBuffer, Direction.SENT);\n }",
"class_method_signature": "MessageTracker.dumpToLog(Str... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_131 | {
"fields": [
{
"declarator": "tmpDir",
"modifier": "private",
"original_string": "private File tmpDir;",
"type": "File",
"var_name": "tmpDir"
},
{
"declarator": "logDir",
"modifier": "private",
"original_string": "private File logDir;",
"type": "File"... | {
"body": "@Test\n public void testACLCreatedDuringFuzzySnapshotSync() throws IOException {\n DataTree leaderDataTree = new DataTree();\n\n // Start the simulated snap-sync by serializing ACL cache.\n File file = File.createTempFile(\"snapshot\", \"zk\");\n FileOutputStream os = new Fil... | {
"fields": [
{
"declarator": "dataDir",
"modifier": "final",
"original_string": "final File dataDir;",
"type": "File",
"var_name": "dataDir"
},
{
"declarator": "snapDir",
"modifier": "final",
"original_string": "final File snapDir;",
"type": "File",
... | {
"body": "public void close() throws IOException {\n if (txnLog != null) {\n txnLog.close();\n txnLog = null;\n }\n if (snapLog != null) {\n snapLog.close();\n snapLog = null;\n }\n }",
"class_method_signature": "FileTxnSnapLog.close()",
... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_96 | {
"fields": [
{
"declarator": "testACLs = new ArrayList<ACL>()",
"modifier": "private",
"original_string": "private List<ACL> testACLs = new ArrayList<ACL>();",
"type": "List<ACL>",
"var_name": "testACLs"
},
{
"declarator": "responseRecord = new Record[1]",
"modif... | {
"body": "@Test\n public void testACLDigestHashHiding_UserCanRead() {\n // Arrange\n List<Id> authInfo = new ArrayList<Id>();\n authInfo.add(new Id(\"digest\", \"otheruser:somesecrethash\"));\n\n // Act\n Request r = new Request(cnxn, 0, 0, ZooDefs.OpCode.getACL, bb, authInfo);\... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(FinalRequestProcessor.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(FinalRequestProcessor.class);",
"type": "Logger",
"var_name": "LOG"
},
... | {
"body": "public void processRequest(Request request) {\n LOG.debug(\"Processing request:: {}\", request);\n\n if (LOG.isTraceEnabled()) {\n long traceMask = ZooTrace.CLIENT_REQUEST_TRACE_MASK;\n if (request.type == OpCode.ping) {\n traceMask = ZooTrace.SERVER_PING_... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_218 | {
"fields": [],
"file": "zookeeper-jute/src/test/java/org/apache/jute/BinaryInputArchiveTest.java",
"identifier": "BinaryInputArchiveTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDouble() {\n final double expected = 3.14159f;\n final String tag = \"tag1\";\n final float delta = 1e-20f;\n checkWriterAndReader(\n (oa) -> oa.writeDouble(expected, tag),\n (ia) -> {\n double actual = ... | {
"fields": [
{
"declarator": "UNREASONBLE_LENGTH = \"Unreasonable length = \"",
"modifier": "public static final",
"original_string": "public static final String UNREASONBLE_LENGTH = \"Unreasonable length = \";",
"type": "String",
"var_name": "UNREASONBLE_LENGTH"
},
{
... | {
"body": "public double readDouble(String tag) throws IOException {\n return in.readDouble();\n }",
"class_method_signature": "BinaryInputArchive.readDouble(String tag)",
"constructor": false,
"full_signature": "public double readDouble(String tag)",
"identifier": "readDouble",
"invocations": [
... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_166 | {
"fields": [],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumBeanTest.java",
"identifier": "QuorumBeanTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIsHiddenProperty() {\n QuorumPeer qpMock = mock(QuorumPeer.class);\n QuorumBean qb = new QuorumBean(qpMock);\n assertThat(\"isHidden should return false\", qb.isHidden(), equalTo(false));\n }",
"class_method_signature": "QuorumBeanTest.testIsHiddenProper... | {
"fields": [
{
"declarator": "peer",
"modifier": "private final",
"original_string": "private final QuorumPeer peer;",
"type": "QuorumPeer",
"var_name": "peer"
},
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String ... | {
"body": "@Override\n public boolean isHidden() {\n return false;\n }",
"class_method_signature": "QuorumBean.isHidden()",
"constructor": false,
"full_signature": "@Override public boolean isHidden()",
"identifier": "isHidden",
"invocations": [],
"modifiers": "@Override public",
"parameter... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
160999_189 | {
"fields": [
{
"declarator": "PORTS_AMOUNT = 10",
"modifier": "public static final",
"original_string": "public static final int PORTS_AMOUNT = 10;",
"type": "int",
"var_name": "PORTS_AMOUNT"
}
],
"file": "zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/Mul... | {
"body": "@Test\n public void testSize() {\n List<InetSocketAddress> addresses = getAddressList();\n MultipleAddresses multipleAddresses = new MultipleAddresses(addresses);\n\n assertEquals(PORTS_AMOUNT, multipleAddresses.size());\n }",
"class_method_signature": "MultipleAddressesTest.te... | {
"fields": [
{
"declarator": "DEFAULT_TIMEOUT = Duration.ofMillis(1000)",
"modifier": "public static final",
"original_string": "public static final Duration DEFAULT_TIMEOUT = Duration.ofMillis(1000);",
"type": "Duration",
"var_name": "DEFAULT_TIMEOUT"
},
{
"declarator... | {
"body": "public int size() {\n return addresses.size();\n }",
"class_method_signature": "MultipleAddresses.size()",
"constructor": false,
"full_signature": "public int size()",
"identifier": "size",
"invocations": [
"size"
],
"modifiers": "public",
"parameters": "()",
"return": "int"... | {
"created": "3/27/2009 3:41:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 160999,
"size": null,
"stargazer_count": null,
"stars": 7612,
"updates": "2020-01-27T13:06:42+00:00",
"url": "https://github.com/apache/zookeeper"... |
8087042_29 | {
"fields": [
{
"declarator": "regId = \"15;16\"",
"modifier": "private final",
"original_string": "private final String regId = \"15;16\";",
"type": "String",
"var_name": "regId"
},
{
"declarator": "collapseKey = \"collapseKey\"",
"modifier": "private final",
... | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testAddParameter_nullValue() {\n StringBuilder body = new StringBuilder();\n Sender.addParameter(body, \"key\", null);\n }",
"class_method_signature": "SenderTest.testAddParameter_nullValue()",
"constructor": false,
"full_signatur... | {
"fields": [
{
"declarator": "UTF8 = \"UTF-8\"",
"modifier": "protected static final",
"original_string": "protected static final String UTF8 = \"UTF-8\";",
"type": "String",
"var_name": "UTF8"
},
{
"declarator": "BACKOFF_INITIAL_DELAY = 1000",
"modifier": "prote... | {
"body": "protected static void addParameter(StringBuilder body, String name,\n String value) {\n nonNull(body).append('&')\n .append(nonNull(name)).append('=').append(nonNull(value));\n }",
"class_method_signature": "Sender.addParameter(StringBuilder body, String name,\n String value)",
"co... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 8087042,
"size": 228,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/guetux/gcm-sample"
} |
8087042_13 | {
"fields": [
{
"declarator": "regId = \"15;16\"",
"modifier": "private final",
"original_string": "private final String regId = \"15;16\";",
"type": "String",
"var_name": "regId"
},
{
"declarator": "collapseKey = \"collapseKey\"",
"modifier": "private final",
... | {
"body": "@Test\n public void testSendNoRetry_invalidHttpStatusCode() throws Exception {\n setResponseExpectations(108, \"id=4815162342\");\n try {\n sender.sendNoRetry(message, regId);\n } catch (InvalidRequestException e) {\n assertEquals(108, e.getHttpStatusCode());\n assertEquals(\"id=48... | {
"fields": [
{
"declarator": "UTF8 = \"UTF-8\"",
"modifier": "protected static final",
"original_string": "protected static final String UTF8 = \"UTF-8\";",
"type": "String",
"var_name": "UTF8"
},
{
"declarator": "BACKOFF_INITIAL_DELAY = 1000",
"modifier": "prote... | {
"body": "public Result sendNoRetry(Message message, String registrationId)\n throws IOException {\n StringBuilder body = newBody(PARAM_REGISTRATION_ID, registrationId);\n Boolean delayWhileIdle = message.isDelayWhileIdle();\n if (delayWhileIdle != null) {\n addParameter(body, PARAM_DELAY_WHILE_ID... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 8087042,
"size": 228,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/guetux/gcm-sample"
} |
8087042_25 | {
"fields": [
{
"declarator": "regId = \"15;16\"",
"modifier": "private final",
"original_string": "private final String regId = \"15;16\";",
"type": "String",
"var_name": "regId"
},
{
"declarator": "collapseKey = \"collapseKey\"",
"modifier": "private final",
... | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testNewBody_nullValue() {\n Sender.newBody(\"key\", null);\n }",
"class_method_signature": "SenderTest.testNewBody_nullValue()",
"constructor": false,
"full_signature": "@Test(expected = IllegalArgumentException.class) public void te... | {
"fields": [
{
"declarator": "UTF8 = \"UTF-8\"",
"modifier": "protected static final",
"original_string": "protected static final String UTF8 = \"UTF-8\";",
"type": "String",
"var_name": "UTF8"
},
{
"declarator": "BACKOFF_INITIAL_DELAY = 1000",
"modifier": "prote... | {
"body": "protected static StringBuilder newBody(String name, String value) {\n return new StringBuilder(nonNull(name)).append('=').append(nonNull(value));\n }",
"class_method_signature": "Sender.newBody(String name, String value)",
"constructor": false,
"full_signature": "protected static StringBuilder ne... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 8087042,
"size": 228,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/guetux/gcm-sample"
} |
8087042_7 | {
"fields": [
{
"declarator": "regId = \"15;16\"",
"modifier": "private final",
"original_string": "private final String regId = \"15;16\";",
"type": "String",
"var_name": "regId"
},
{
"declarator": "collapseKey = \"collapseKey\"",
"modifier": "private final",
... | {
"body": "@Test\n public void testSendNoRetry_serviceUnavailable() throws Exception {\n setResponseExpectations(503, \"\");\n Result result = sender.sendNoRetry(message, regId);\n assertNull(result);\n assertRequestBody();\n }",
"class_method_signature": "SenderTest.testSendNoRetry_serviceUnavailable... | {
"fields": [
{
"declarator": "UTF8 = \"UTF-8\"",
"modifier": "protected static final",
"original_string": "protected static final String UTF8 = \"UTF-8\";",
"type": "String",
"var_name": "UTF8"
},
{
"declarator": "BACKOFF_INITIAL_DELAY = 1000",
"modifier": "prote... | {
"body": "public Result sendNoRetry(Message message, String registrationId)\n throws IOException {\n StringBuilder body = newBody(PARAM_REGISTRATION_ID, registrationId);\n Boolean delayWhileIdle = message.isDelayWhileIdle();\n if (delayWhileIdle != null) {\n addParameter(body, PARAM_DELAY_WHILE_ID... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 8087042,
"size": 228,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/guetux/gcm-sample"
} |
8087042_33 | {
"fields": [
{
"declarator": "regId = \"15;16\"",
"modifier": "private final",
"original_string": "private final String regId = \"15;16\";",
"type": "String",
"var_name": "regId"
},
{
"declarator": "collapseKey = \"collapseKey\"",
"modifier": "private final",
... | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testPost_noUrl() throws Exception {\n sender.post(null, \"whatever\");\n }",
"class_method_signature": "SenderTest.testPost_noUrl()",
"constructor": false,
"full_signature": "@Test(expected = IllegalArgumentException.class) public vo... | {
"fields": [
{
"declarator": "UTF8 = \"UTF-8\"",
"modifier": "protected static final",
"original_string": "protected static final String UTF8 = \"UTF-8\";",
"type": "String",
"var_name": "UTF8"
},
{
"declarator": "BACKOFF_INITIAL_DELAY = 1000",
"modifier": "prote... | {
"body": "protected HttpURLConnection post(String url, String body)\n throws IOException {\n return post(url, \"application/x-www-form-urlencoded;charset=UTF-8\", body);\n }",
"class_method_signature": "Sender.post(String url, String body)",
"constructor": false,
"full_signature": "protected HttpURLCo... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 8087042,
"size": 228,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/guetux/gcm-sample"
} |
8087042_32 | {
"fields": [
{
"declarator": "regId = \"15;16\"",
"modifier": "private final",
"original_string": "private final String regId = \"15;16\";",
"type": "String",
"var_name": "regId"
},
{
"declarator": "collapseKey = \"collapseKey\"",
"modifier": "private final",
... | {
"body": "@Test\n public void testGetString_multipleLines() throws Exception {\n String expected = \"4\\n8\\n15\\n\\n16\\n23\\n42\";\n InputStream stream = new ByteArrayInputStream(expected.getBytes());\n String actual = Sender.getString(stream);\n assertEquals(expected, actual);\n }",
"class_method_... | {
"fields": [
{
"declarator": "UTF8 = \"UTF-8\"",
"modifier": "protected static final",
"original_string": "protected static final String UTF8 = \"UTF-8\";",
"type": "String",
"var_name": "UTF8"
},
{
"declarator": "BACKOFF_INITIAL_DELAY = 1000",
"modifier": "prote... | {
"body": "protected static String getString(InputStream stream) throws IOException {\n if (stream == null) {\n return \"\";\n }\n BufferedReader reader =\n new BufferedReader(new InputStreamReader(stream));\n StringBuilder content = new StringBuilder();\n String newLine;\n do {\n n... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 8087042,
"size": 228,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/guetux/gcm-sample"
} |
8087042_6 | {
"fields": [
{
"declarator": "regId = \"15;16\"",
"modifier": "private final",
"original_string": "private final String regId = \"15;16\";",
"type": "String",
"var_name": "regId"
},
{
"declarator": "collapseKey = \"collapseKey\"",
"modifier": "private final",
... | {
"body": "@Test\n public void testSendNoRetry_error() throws Exception {\n setResponseExpectations(200, \"Error=D'OH!\");\n Result result = sender.sendNoRetry(message, regId);\n assertNull(result.getMessageId());\n assertNull(result.getCanonicalRegistrationId());\n assertEquals(\"D'OH!\", result.getE... | {
"fields": [
{
"declarator": "UTF8 = \"UTF-8\"",
"modifier": "protected static final",
"original_string": "protected static final String UTF8 = \"UTF-8\";",
"type": "String",
"var_name": "UTF8"
},
{
"declarator": "BACKOFF_INITIAL_DELAY = 1000",
"modifier": "prote... | {
"body": "public Result sendNoRetry(Message message, String registrationId)\n throws IOException {\n StringBuilder body = newBody(PARAM_REGISTRATION_ID, registrationId);\n Boolean delayWhileIdle = message.isDelayWhileIdle();\n if (delayWhileIdle != null) {\n addParameter(body, PARAM_DELAY_WHILE_ID... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 8087042,
"size": 228,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/guetux/gcm-sample"
} |
8087042_24 | {
"fields": [
{
"declarator": "regId = \"15;16\"",
"modifier": "private final",
"original_string": "private final String regId = \"15;16\";",
"type": "String",
"var_name": "regId"
},
{
"declarator": "collapseKey = \"collapseKey\"",
"modifier": "private final",
... | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testNewBody_nullKey() {\n Sender.newBody(null, \"value\");\n }",
"class_method_signature": "SenderTest.testNewBody_nullKey()",
"constructor": false,
"full_signature": "@Test(expected = IllegalArgumentException.class) public void test... | {
"fields": [
{
"declarator": "UTF8 = \"UTF-8\"",
"modifier": "protected static final",
"original_string": "protected static final String UTF8 = \"UTF-8\";",
"type": "String",
"var_name": "UTF8"
},
{
"declarator": "BACKOFF_INITIAL_DELAY = 1000",
"modifier": "prote... | {
"body": "protected static StringBuilder newBody(String name, String value) {\n return new StringBuilder(nonNull(name)).append('=').append(nonNull(value));\n }",
"class_method_signature": "Sender.newBody(String name, String value)",
"constructor": false,
"full_signature": "protected static StringBuilder ne... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 8087042,
"size": 228,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/guetux/gcm-sample"
} |
8087042_12 | {
"fields": [
{
"declarator": "regId = \"15;16\"",
"modifier": "private final",
"original_string": "private final String regId = \"15;16\";",
"type": "String",
"var_name": "regId"
},
{
"declarator": "collapseKey = \"collapseKey\"",
"modifier": "private final",
... | {
"body": "@Test(expected = IOException.class)\n public void testSendNoRetry_emptyToken() throws Exception {\n setResponseExpectations(200, \"token=\");\n sender.sendNoRetry(message, regId);\n }",
"class_method_signature": "SenderTest.testSendNoRetry_emptyToken()",
"constructor": false,
"full_signature"... | {
"fields": [
{
"declarator": "UTF8 = \"UTF-8\"",
"modifier": "protected static final",
"original_string": "protected static final String UTF8 = \"UTF-8\";",
"type": "String",
"var_name": "UTF8"
},
{
"declarator": "BACKOFF_INITIAL_DELAY = 1000",
"modifier": "prote... | {
"body": "public Result sendNoRetry(Message message, String registrationId)\n throws IOException {\n StringBuilder body = newBody(PARAM_REGISTRATION_ID, registrationId);\n Boolean delayWhileIdle = message.isDelayWhileIdle();\n if (delayWhileIdle != null) {\n addParameter(body, PARAM_DELAY_WHILE_ID... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 8087042,
"size": 228,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/guetux/gcm-sample"
} |
8087042_28 | {
"fields": [
{
"declarator": "regId = \"15;16\"",
"modifier": "private final",
"original_string": "private final String regId = \"15;16\";",
"type": "String",
"var_name": "regId"
},
{
"declarator": "collapseKey = \"collapseKey\"",
"modifier": "private final",
... | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testAddParameter_nullKey() {\n StringBuilder body = new StringBuilder();\n Sender.addParameter(body, null, \"value\");\n }",
"class_method_signature": "SenderTest.testAddParameter_nullKey()",
"constructor": false,
"full_signature"... | {
"fields": [
{
"declarator": "UTF8 = \"UTF-8\"",
"modifier": "protected static final",
"original_string": "protected static final String UTF8 = \"UTF-8\";",
"type": "String",
"var_name": "UTF8"
},
{
"declarator": "BACKOFF_INITIAL_DELAY = 1000",
"modifier": "prote... | {
"body": "protected static void addParameter(StringBuilder body, String name,\n String value) {\n nonNull(body).append('&')\n .append(nonNull(name)).append('=').append(nonNull(value));\n }",
"class_method_signature": "Sender.addParameter(StringBuilder body, String name,\n String value)",
"co... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 8087042,
"size": 228,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/guetux/gcm-sample"
} |
8087042_23 | {
"fields": [
{
"declarator": "regId = \"15;16\"",
"modifier": "private final",
"original_string": "private final String regId = \"15;16\";",
"type": "String",
"var_name": "regId"
},
{
"declarator": "collapseKey = \"collapseKey\"",
"modifier": "private final",
... | {
"body": "@Test\n public void testNewBody() {\n StringBuilder body = Sender.newBody(\"name\", \"value\");\n assertEquals(\"name=value\", body.toString());\n }",
"class_method_signature": "SenderTest.testNewBody()",
"constructor": false,
"full_signature": "@Test public void testNewBody()",
"identifier... | {
"fields": [
{
"declarator": "UTF8 = \"UTF-8\"",
"modifier": "protected static final",
"original_string": "protected static final String UTF8 = \"UTF-8\";",
"type": "String",
"var_name": "UTF8"
},
{
"declarator": "BACKOFF_INITIAL_DELAY = 1000",
"modifier": "prote... | {
"body": "protected static StringBuilder newBody(String name, String value) {\n return new StringBuilder(nonNull(name)).append('=').append(nonNull(value));\n }",
"class_method_signature": "Sender.newBody(String name, String value)",
"constructor": false,
"full_signature": "protected static StringBuilder ne... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 8087042,
"size": 228,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/guetux/gcm-sample"
} |
8087042_1 | {
"fields": [],
"file": "gcm-server/src/test/java/com/google/android/gcm/server/MulticastResultTest.java",
"identifier": "MulticastResultTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = UnsupportedOperationException.class)\n public void testRetryMulticastIdsIsImmutable() {\n MulticastResult result = new MulticastResult.Builder(1, 2, 3, 4).build();\n result.getRetryMulticastIds().clear();\n }",
"class_method_signature": "MulticastResultTest.testRetryMulticastIdsI... | {
"fields": [
{
"declarator": "success",
"modifier": "private final",
"original_string": "private final int success;",
"type": "int",
"var_name": "success"
},
{
"declarator": "failure",
"modifier": "private final",
"original_string": "private final int failu... | {
"body": "public List<Long> getRetryMulticastIds() {\n return retryMulticastIds;\n }",
"class_method_signature": "MulticastResult.getRetryMulticastIds()",
"constructor": false,
"full_signature": "public List<Long> getRetryMulticastIds()",
"identifier": "getRetryMulticastIds",
"invocations": [],
"modi... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 8087042,
"size": 228,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/guetux/gcm-sample"
} |
8087042_35 | {
"fields": [
{
"declarator": "regId = \"15;16\"",
"modifier": "private final",
"original_string": "private final String regId = \"15;16\";",
"type": "String",
"var_name": "regId"
},
{
"declarator": "collapseKey = \"collapseKey\"",
"modifier": "private final",
... | {
"body": "@Test\n public void testPost() throws Exception {\n String requestBody = \"req\";\n String responseBody = \"resp\";\n setResponseExpectations(200, responseBody);\n HttpURLConnection response =\n sender.post(Constants.GCM_SEND_ENDPOINT, requestBody);\n assertEquals(requestBody, new St... | {
"fields": [
{
"declarator": "UTF8 = \"UTF-8\"",
"modifier": "protected static final",
"original_string": "protected static final String UTF8 = \"UTF-8\";",
"type": "String",
"var_name": "UTF8"
},
{
"declarator": "BACKOFF_INITIAL_DELAY = 1000",
"modifier": "prote... | {
"body": "protected HttpURLConnection post(String url, String body)\n throws IOException {\n return post(url, \"application/x-www-form-urlencoded;charset=UTF-8\", body);\n }",
"class_method_signature": "Sender.post(String url, String body)",
"constructor": false,
"full_signature": "protected HttpURLCo... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 8087042,
"size": 228,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/guetux/gcm-sample"
} |
8087042_19 | {
"fields": [
{
"declarator": "regId = \"15;16\"",
"modifier": "private final",
"original_string": "private final String regId = \"15;16\";",
"type": "String",
"var_name": "regId"
},
{
"declarator": "collapseKey = \"collapseKey\"",
"modifier": "private final",
... | {
"body": "@Test()\n public void testSendNoRetry_json_ok() throws Exception {\n String json = replaceQuotes(\"\\n\"\n + \"{\"\n + \" 'multicast_id': 108,\"\n + \" 'success': 2,\"\n + \" 'failure': 1,\"\n + \" 'canonical_ids': 1,\"\n + \" 'results': [\"\n + \" ... | {
"fields": [
{
"declarator": "UTF8 = \"UTF-8\"",
"modifier": "protected static final",
"original_string": "protected static final String UTF8 = \"UTF-8\";",
"type": "String",
"var_name": "UTF8"
},
{
"declarator": "BACKOFF_INITIAL_DELAY = 1000",
"modifier": "prote... | {
"body": "public Result sendNoRetry(Message message, String registrationId)\n throws IOException {\n StringBuilder body = newBody(PARAM_REGISTRATION_ID, registrationId);\n Boolean delayWhileIdle = message.isDelayWhileIdle();\n if (delayWhileIdle != null) {\n addParameter(body, PARAM_DELAY_WHILE_ID... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 8087042,
"size": 228,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/guetux/gcm-sample"
} |
8087042_15 | {
"fields": [
{
"declarator": "regId = \"15;16\"",
"modifier": "private final",
"original_string": "private final String regId = \"15;16\";",
"type": "String",
"var_name": "regId"
},
{
"declarator": "collapseKey = \"collapseKey\"",
"modifier": "private final",
... | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testSendNoRetry_json_nullRegIds() throws Exception {\n sender.sendNoRetry(message, (List<String>) null);\n }",
"class_method_signature": "SenderTest.testSendNoRetry_json_nullRegIds()",
"constructor": false,
"full_signature": "@Test(e... | {
"fields": [
{
"declarator": "UTF8 = \"UTF-8\"",
"modifier": "protected static final",
"original_string": "protected static final String UTF8 = \"UTF-8\";",
"type": "String",
"var_name": "UTF8"
},
{
"declarator": "BACKOFF_INITIAL_DELAY = 1000",
"modifier": "prote... | {
"body": "public Result sendNoRetry(Message message, String registrationId)\n throws IOException {\n StringBuilder body = newBody(PARAM_REGISTRATION_ID, registrationId);\n Boolean delayWhileIdle = message.isDelayWhileIdle();\n if (delayWhileIdle != null) {\n addParameter(body, PARAM_DELAY_WHILE_ID... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 8087042,
"size": 228,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/guetux/gcm-sample"
} |
8087042_14 | {
"fields": [
{
"declarator": "regId = \"15;16\"",
"modifier": "private final",
"original_string": "private final String regId = \"15;16\";",
"type": "String",
"var_name": "regId"
},
{
"declarator": "collapseKey = \"collapseKey\"",
"modifier": "private final",
... | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testSendNoRetry_noRegistrationId() throws Exception {\n sender.sendNoRetry(new Message.Builder().build(), (String) null);\n }",
"class_method_signature": "SenderTest.testSendNoRetry_noRegistrationId()",
"constructor": false,
"full_si... | {
"fields": [
{
"declarator": "UTF8 = \"UTF-8\"",
"modifier": "protected static final",
"original_string": "protected static final String UTF8 = \"UTF-8\";",
"type": "String",
"var_name": "UTF8"
},
{
"declarator": "BACKOFF_INITIAL_DELAY = 1000",
"modifier": "prote... | {
"body": "public Result sendNoRetry(Message message, String registrationId)\n throws IOException {\n StringBuilder body = newBody(PARAM_REGISTRATION_ID, registrationId);\n Boolean delayWhileIdle = message.isDelayWhileIdle();\n if (delayWhileIdle != null) {\n addParameter(body, PARAM_DELAY_WHILE_ID... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 8087042,
"size": 228,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/guetux/gcm-sample"
} |
8087042_18 | {
"fields": [
{
"declarator": "regId = \"15;16\"",
"modifier": "private final",
"original_string": "private final String regId = \"15;16\";",
"type": "String",
"var_name": "regId"
},
{
"declarator": "collapseKey = \"collapseKey\"",
"modifier": "private final",
... | {
"body": "@Test\n public void testSendNoRetry_json_badRequest_nullError() throws Exception {\n setResponseExpectations(42, null);\n try {\n sender.sendNoRetry(message, Arrays.asList(\"108\"));\n } catch (InvalidRequestException e) {\n assertEquals(42, e.getHttpStatusCode());\n assertEquals(\... | {
"fields": [
{
"declarator": "UTF8 = \"UTF-8\"",
"modifier": "protected static final",
"original_string": "protected static final String UTF8 = \"UTF-8\";",
"type": "String",
"var_name": "UTF8"
},
{
"declarator": "BACKOFF_INITIAL_DELAY = 1000",
"modifier": "prote... | {
"body": "public Result sendNoRetry(Message message, String registrationId)\n throws IOException {\n StringBuilder body = newBody(PARAM_REGISTRATION_ID, registrationId);\n Boolean delayWhileIdle = message.isDelayWhileIdle();\n if (delayWhileIdle != null) {\n addParameter(body, PARAM_DELAY_WHILE_ID... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 8087042,
"size": 228,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/guetux/gcm-sample"
} |
8087042_34 | {
"fields": [
{
"declarator": "regId = \"15;16\"",
"modifier": "private final",
"original_string": "private final String regId = \"15;16\";",
"type": "String",
"var_name": "regId"
},
{
"declarator": "collapseKey = \"collapseKey\"",
"modifier": "private final",
... | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testPost_noBody() throws Exception {\n sender.post(Constants.GCM_SEND_ENDPOINT, null);\n }",
"class_method_signature": "SenderTest.testPost_noBody()",
"constructor": false,
"full_signature": "@Test(expected = IllegalArgumentException... | {
"fields": [
{
"declarator": "UTF8 = \"UTF-8\"",
"modifier": "protected static final",
"original_string": "protected static final String UTF8 = \"UTF-8\";",
"type": "String",
"var_name": "UTF8"
},
{
"declarator": "BACKOFF_INITIAL_DELAY = 1000",
"modifier": "prote... | {
"body": "protected HttpURLConnection post(String url, String body)\n throws IOException {\n return post(url, \"application/x-www-form-urlencoded;charset=UTF-8\", body);\n }",
"class_method_signature": "Sender.post(String url, String body)",
"constructor": false,
"full_signature": "protected HttpURLCo... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 8087042,
"size": 228,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/guetux/gcm-sample"
} |
8087042_0 | {
"fields": [],
"file": "gcm-server/src/test/java/com/google/android/gcm/server/MulticastResultTest.java",
"identifier": "MulticastResultTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = UnsupportedOperationException.class)\n public void testResultsIsImmutable() {\n MulticastResult result = new MulticastResult.Builder(1, 2, 3, 4).build();\n result.getResults().clear();\n }",
"class_method_signature": "MulticastResultTest.testResultsIsImmutable()",
"constructor"... | {
"fields": [
{
"declarator": "success",
"modifier": "private final",
"original_string": "private final int success;",
"type": "int",
"var_name": "success"
},
{
"declarator": "failure",
"modifier": "private final",
"original_string": "private final int failu... | {
"body": "public List<Result> getResults() {\n return results;\n }",
"class_method_signature": "MulticastResult.getResults()",
"constructor": false,
"full_signature": "public List<Result> getResults()",
"identifier": "getResults",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"ret... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 8087042,
"size": 228,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/guetux/gcm-sample"
} |
8087042_22 | {
"fields": [
{
"declarator": "regId = \"15;16\"",
"modifier": "private final",
"original_string": "private final String regId = \"15;16\";",
"type": "String",
"var_name": "regId"
},
{
"declarator": "collapseKey = \"collapseKey\"",
"modifier": "private final",
... | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testNewKeyValues_nullValue() {\n Sender.newKeyValues(\"key\", null);\n }",
"class_method_signature": "SenderTest.testNewKeyValues_nullValue()",
"constructor": false,
"full_signature": "@Test(expected = IllegalArgumentException.class)... | {
"fields": [
{
"declarator": "UTF8 = \"UTF-8\"",
"modifier": "protected static final",
"original_string": "protected static final String UTF8 = \"UTF-8\";",
"type": "String",
"var_name": "UTF8"
},
{
"declarator": "BACKOFF_INITIAL_DELAY = 1000",
"modifier": "prote... | {
"body": "protected static final Map<String, String> newKeyValues(String key,\n String value) {\n Map<String, String> keyValues = new HashMap<String, String>(1);\n keyValues.put(nonNull(key), nonNull(value));\n return keyValues;\n }",
"class_method_signature": "Sender.newKeyValues(String key,\n ... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 8087042,
"size": 228,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/guetux/gcm-sample"
} |
8087042_37 | {
"fields": [],
"file": "gcm-server/src/test/java/com/google/android/gcm/server/MessageTest.java",
"identifier": "MessageTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = UnsupportedOperationException.class)\n public void testPayloadDataIsImmutable() {\n Message message = new Message.Builder().build();\n message.getData().clear();\n }",
"class_method_signature": "MessageTest.testPayloadDataIsImmutable()",
"constructor": false,
"full_signature"... | {
"fields": [
{
"declarator": "collapseKey",
"modifier": "private final",
"original_string": "private final String collapseKey;",
"type": "String",
"var_name": "collapseKey"
},
{
"declarator": "delayWhileIdle",
"modifier": "private final",
"original_string":... | {
"body": "public Map<String, String> getData() {\n return data;\n }",
"class_method_signature": "Message.getData()",
"constructor": false,
"full_signature": "public Map<String, String> getData()",
"identifier": "getData",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "Ma... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 8087042,
"size": 228,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/guetux/gcm-sample"
} |
8087042_3 | {
"fields": [
{
"declarator": "regId = \"15;16\"",
"modifier": "private final",
"original_string": "private final String regId = \"15;16\";",
"type": "String",
"var_name": "regId"
},
{
"declarator": "collapseKey = \"collapseKey\"",
"modifier": "private final",
... | {
"body": "@Test\n public void testSendNoRetry_ok_canonical() throws Exception {\n setResponseExpectations(200, \"id=4815162342\\nregistration_id=108\");\n Result result = sender.sendNoRetry(message, regId);\n assertNotNull(result);\n assertEquals(\"4815162342\", result.getMessageId());\n assertEquals... | {
"fields": [
{
"declarator": "UTF8 = \"UTF-8\"",
"modifier": "protected static final",
"original_string": "protected static final String UTF8 = \"UTF-8\";",
"type": "String",
"var_name": "UTF8"
},
{
"declarator": "BACKOFF_INITIAL_DELAY = 1000",
"modifier": "prote... | {
"body": "public Result sendNoRetry(Message message, String registrationId)\n throws IOException {\n StringBuilder body = newBody(PARAM_REGISTRATION_ID, registrationId);\n Boolean delayWhileIdle = message.isDelayWhileIdle();\n if (delayWhileIdle != null) {\n addParameter(body, PARAM_DELAY_WHILE_ID... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 8087042,
"size": 228,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/guetux/gcm-sample"
} |
8087042_21 | {
"fields": [
{
"declarator": "regId = \"15;16\"",
"modifier": "private final",
"original_string": "private final String regId = \"15;16\";",
"type": "String",
"var_name": "regId"
},
{
"declarator": "collapseKey = \"collapseKey\"",
"modifier": "private final",
... | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testNewKeyValues_nullKey() {\n Sender.newKeyValues(null, \"value\");\n }",
"class_method_signature": "SenderTest.testNewKeyValues_nullKey()",
"constructor": false,
"full_signature": "@Test(expected = IllegalArgumentException.class) p... | {
"fields": [
{
"declarator": "UTF8 = \"UTF-8\"",
"modifier": "protected static final",
"original_string": "protected static final String UTF8 = \"UTF-8\";",
"type": "String",
"var_name": "UTF8"
},
{
"declarator": "BACKOFF_INITIAL_DELAY = 1000",
"modifier": "prote... | {
"body": "protected static final Map<String, String> newKeyValues(String key,\n String value) {\n Map<String, String> keyValues = new HashMap<String, String>(1);\n keyValues.put(nonNull(key), nonNull(value));\n return keyValues;\n }",
"class_method_signature": "Sender.newKeyValues(String key,\n ... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 8087042,
"size": 228,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/guetux/gcm-sample"
} |
8087042_17 | {
"fields": [
{
"declarator": "regId = \"15;16\"",
"modifier": "private final",
"original_string": "private final String regId = \"15;16\";",
"type": "String",
"var_name": "regId"
},
{
"declarator": "collapseKey = \"collapseKey\"",
"modifier": "private final",
... | {
"body": "@Test\n public void testSendNoRetry_json_badRequest() throws Exception {\n setResponseExpectations(42, \"bad json\");\n try {\n sender.sendNoRetry(message, Arrays.asList(\"108\"));\n } catch (InvalidRequestException e) {\n assertEquals(42, e.getHttpStatusCode());\n assertEquals(\"b... | {
"fields": [
{
"declarator": "UTF8 = \"UTF-8\"",
"modifier": "protected static final",
"original_string": "protected static final String UTF8 = \"UTF-8\";",
"type": "String",
"var_name": "UTF8"
},
{
"declarator": "BACKOFF_INITIAL_DELAY = 1000",
"modifier": "prote... | {
"body": "public Result sendNoRetry(Message message, String registrationId)\n throws IOException {\n StringBuilder body = newBody(PARAM_REGISTRATION_ID, registrationId);\n Boolean delayWhileIdle = message.isDelayWhileIdle();\n if (delayWhileIdle != null) {\n addParameter(body, PARAM_DELAY_WHILE_ID... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 8087042,
"size": 228,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/guetux/gcm-sample"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.