id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
17517521_94 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\";",
"type": "String",
"var_name": "PRIVATE_KEY_FILE"... | {
"body": "@Test\n public void shouldFailRSA512VerificationWhenUsingPrivateKey() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: SHA512withRSA\");\n exception.expe... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final RSAKeyProvider keyProvider;",
"type": "RSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"original_... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n RSAPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_144 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldFailECDSA256VerificationOnInvalidJOSESignature() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: SHA256withECDSA\");\n\n byte[... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_328 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldGetNullStringWhenParsingNullNode() throws Exception {\n Map<String, JsonNode> tree = new HashMap<>();\n NullNode node = NullNode.getInstance();\n tree.put(\"key\", node);\n\n String text = deserializer.getString(tree, \"key\");\n assertThat(te... | {
"fields": [
{
"declarator": "objectReader",
"modifier": "private final",
"original_string": "private final ObjectReader objectReader;",
"type": "ObjectReader",
"var_name": "objectReader"
}
],
"file": "lib/src/main/java/com/auth0/jwt/impl/PayloadDeserializer.java",
"identi... | {
"body": "String getString(Map<String, JsonNode> tree, String claimName) {\n JsonNode node = tree.get(claimName);\n if (node == null || node.isNull()) {\n return null;\n }\n return node.asText(null);\n }",
"class_method_signature": "PayloadDeserializer.getString(Map<String... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_282 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldParseHeader() throws Exception {\n ObjectMapper mapper = mock(ObjectMapper.class);\n ObjectReader reader = mock(ObjectReader.class);\n when(mapper.readerFor(Header.class)).thenReturn(reader);\n JWTParser parser = new JWTParser(mapper);\n parse... | {
"fields": [
{
"declarator": "payloadReader",
"modifier": "private final",
"original_string": "private final ObjectReader payloadReader;",
"type": "ObjectReader",
"var_name": "payloadReader"
},
{
"declarator": "headerReader",
"modifier": "private final",
"o... | {
"body": "@Override\n public Header parseHeader(String json) throws JWTDecodeException {\n if (json == null) {\n throw decodeException();\n }\n\n try {\n return headerReader.readValue(json);\n } catch (IOException e) {\n throw decodeException(json);\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_329 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldGetNullStringWhenParsingNull() throws Exception {\n Map<String, JsonNode> tree = new HashMap<>();\n tree.put(\"key\", null);\n\n String text = deserializer.getString(tree, \"key\");\n assertThat(text, is(nullValue()));\n }",
"class_method_signat... | {
"fields": [
{
"declarator": "objectReader",
"modifier": "private final",
"original_string": "private final ObjectReader objectReader;",
"type": "ObjectReader",
"var_name": "objectReader"
}
],
"file": "lib/src/main/java/com/auth0/jwt/impl/PayloadDeserializer.java",
"identi... | {
"body": "String getString(Map<String, JsonNode> tree, String claimName) {\n JsonNode node = tree.get(claimName);\n if (node == null || node.isNull()) {\n return null;\n }\n return node.asText(null);\n }",
"class_method_signature": "PayloadDeserializer.getString(Map<String... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_283 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldThrowOnInvalidHeader() throws Exception {\n String jsonHeader = \"}}\";\n exception.expect(JWTDecodeException.class);\n exception.expectMessage(String.format(\"The string '%s' doesn't have a valid JSON format.\", jsonHeader));\n Header header = parse... | {
"fields": [
{
"declarator": "payloadReader",
"modifier": "private final",
"original_string": "private final ObjectReader payloadReader;",
"type": "ObjectReader",
"var_name": "payloadReader"
},
{
"declarator": "headerReader",
"modifier": "private final",
"o... | {
"body": "@Override\n public Header parseHeader(String json) throws JWTDecodeException {\n if (json == null) {\n throw decodeException();\n }\n\n try {\n return headerReader.readValue(json);\n } catch (IOException e) {\n throw decodeException(json);\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_145 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldFailECDSA256VerificationOnInvalidDERSignature() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: SHA256withECDSA\");\n\n byte[]... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_95 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\";",
"type": "String",
"var_name": "PRIVATE_KEY_FILE"... | {
"body": "@Test\n public void shouldDoRSA256Signing() throws Exception {\n Algorithm algorithmSign = Algorithm.RSA256((RSAKey) readPrivateKeyFromFile(PRIVATE_KEY_FILE, \"RSA\"));\n Algorithm algorithmVerify = Algorithm.RSA256((RSAKey) readPublicKeyFromFile(PUBLIC_KEY_FILE, \"RSA\"));\n\n Stri... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final RSAKeyProvider keyProvider;",
"type": "RSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"original_... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n RSAPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_112 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\";",
"type": "String",
"var_name": "PRIVATE_KEY_FILE"... | {
"body": "@Test\n public void shouldFailOnRSA256SigningWithDeprecatedMethodWhenProvidedPrivateKeyIsNull() throws Exception {\n exception.expect(SignatureGenerationException.class);\n exception.expectMessage(\"The Token's Signature couldn't be generated when signing using the Algorithm: SHA256withRSA... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final RSAKeyProvider keyProvider;",
"type": "RSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"original_... | {
"body": "@Override\n @Deprecated\n public byte[] sign(byte[] headerBytes, byte[] payloadBytes) throws SignatureGenerationException {\n try {\n RSAPrivateKey privateKey = keyProvider.getPrivateKey();\n if (privateKey == null) {\n throw new IllegalStateException(\"The... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_83 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\";",
"type": "String",
"var_name": "PRIVATE_KEY_FILE"... | {
"body": "@Test\n public void shouldPassRSA384Verification() throws Exception {\n String jwt = \"eyJhbGciOiJSUzM4NCIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhdXRoMCJ9.TZlWjXObwGSQOiu2oMq8kiKz0_BR7bbBddNL6G8eZ_GoR82BXOZDqNrQr7lb_M-78XGBguWLWNIdYhzgxOUL9EoCJlrqVm9s9vo6G8T1sj1op-4TbjXZ61TwIvrJee9BvPLdKUJ9_fp1Js5kl6yXkst4... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final RSAKeyProvider keyProvider;",
"type": "RSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"original_... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n RSAPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_104 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\";",
"type": "String",
"var_name": "PRIVATE_KEY_FILE"... | {
"body": "@Test\n public void shouldFailOnRSA384SigningWhenUsingPublicKey() throws Exception {\n exception.expect(SignatureGenerationException.class);\n exception.expectMessage(\"The Token's Signature couldn't be generated when signing using the Algorithm: SHA384withRSA\");\n exception.expect... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final RSAKeyProvider keyProvider;",
"type": "RSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"original_... | {
"body": "@Override\n @Deprecated\n public byte[] sign(byte[] headerBytes, byte[] payloadBytes) throws SignatureGenerationException {\n try {\n RSAPrivateKey privateKey = keyProvider.getPrivateKey();\n if (privateKey == null) {\n throw new IllegalStateException(\"The... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_295 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldGetContentType() throws Exception {\n BasicHeader header = new BasicHeader(null, null, \"content\", null, null, objectReader);\n\n assertThat(header, is(notNullValue()));\n assertThat(header.getContentType(), is(notNullValue()));\n assertThat(header.... | {
"fields": [
{
"declarator": "serialVersionUID = -4659137688548605095L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -4659137688548605095L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "alg... | {
"body": "@Override\n public String getContentType() {\n return contentType;\n }",
"class_method_signature": "BasicHeader.getContentType()",
"constructor": false,
"full_signature": "@Override public String getContentType()",
"identifier": "getContentType",
"invocations": [],
"modifiers": "@O... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_153 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldFailECDSA256KVerificationOnInvalidJOSESignatureLength() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: SHA256withECDSA\");\n ... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_201 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldDecodeECDSA256DER() throws Exception {\n ECDSAAlgorithm algorithm256 = (ECDSAAlgorithm) Algorithm.ECDSA256((ECPublicKey) readPublicKeyFromFile(PUBLIC_KEY_FILE_256, \"EC\"), (ECPrivateKey) readPrivateKeyFromFile(PRIVATE_KEY_FILE_256, \"EC\"));\n\n //Without padding... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "byte[] DERToJOSE(byte[] derSignature) throws SignatureException {\n // DER Structure: http://crypto.stackexchange.com/a/1797\n boolean derEncoded = derSignature[0] == 0x30 && derSignature.length != ecNumberSize * 2;\n if (!derEncoded) {\n throw new SignatureException(\"Inval... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_40 | {
"fields": [
{
"declarator": "DATE_TOKEN_MS_VALUE = 1477592 * 1000",
"modifier": "private static final",
"original_string": "private static final long DATE_TOKEN_MS_VALUE = 1477592 * 1000;",
"type": "long",
"var_name": "DATE_TOKEN_MS_VALUE"
},
{
"declarator": "exceptio... | {
"body": "@SuppressWarnings(\"RedundantCast\")\n @Test\n public void shouldOverrideDefaultExpiresAtLeeway() throws Exception {\n Algorithm algorithm = mock(Algorithm.class);\n JWTVerifier verifier = JWTVerifier.init(algorithm)\n .acceptLeeway(1234L)\n .acceptExpiresA... | {
"fields": [
{
"declarator": "algorithm",
"modifier": "private final",
"original_string": "private final Algorithm algorithm;",
"type": "Algorithm",
"var_name": "algorithm"
},
{
"declarator": "claims",
"modifier": "final",
"original_string": "final Map<Stri... | {
"body": "static Verification init(Algorithm algorithm) throws IllegalArgumentException {\n return new BaseVerification(algorithm);\n }",
"class_method_signature": "JWTVerifier.init(Algorithm algorithm)",
"constructor": false,
"full_signature": "static Verification init(Algorithm algorithm)",
"iden... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_128 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldDoHMAC512SigningWithBytes() throws Exception {\n Algorithm algorithm = Algorithm.HMAC512(\"secret\".getBytes(StandardCharsets.UTF_8));\n\n String jwt = asJWT(algorithm, HS512Header, auth0IssPayload);\n String expectedSignature = \"OXWyxmf-VcVo8viOiTFfLaEy6m... | {
"fields": [
{
"declarator": "crypto",
"modifier": "private final",
"original_string": "private final CryptoHelper crypto;",
"type": "CryptoHelper",
"var_name": "crypto"
},
{
"declarator": "secret",
"modifier": "private final",
"original_string": "private f... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n boolean valid = crypto.verifySignatureFor(getDescription(), secret, jwt.getHeader(), jwt.getPayload(), signatureB... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_256 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldGetNullJWTIdIfMissing() throws Exception {\n PayloadImpl payload = new PayloadImpl(null, null, null, null, null, null, null, null, objectReader);\n assertThat(payload, is(notNullValue()));\n assertThat(payload.getId(), is(nullValue()));\n }",
"class_me... | {
"fields": [
{
"declarator": "serialVersionUID = 1659021498824562311L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1659021498824562311L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "issue... | {
"body": "@Override\n public String getId() {\n return jwtId;\n }",
"class_method_signature": "PayloadImpl.getId()",
"constructor": false,
"full_signature": "@Override public String getId()",
"identifier": "getId",
"invocations": [],
"modifiers": "@Override public",
"parameters": "()",
"... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_313 | {
"fields": [
{
"declarator": "claim",
"modifier": "private",
"original_string": "private NullClaim claim;",
"type": "NullClaim",
"var_name": "claim"
}
],
"file": "lib/src/test/java/com/auth0/jwt/impl/NullClaimTest.java",
"identifier": "NullClaimTest",
"interfaces": "",
... | {
"body": "@Test\n public void shouldGetAsCustomClass() throws Exception {\n assertThat(claim.as(Object.class), is(nullValue()));\n }",
"class_method_signature": "NullClaimTest.shouldGetAsCustomClass()",
"constructor": false,
"full_signature": "@Test public void shouldGetAsCustomClass()",
"identi... | {
"fields": [],
"file": "lib/src/main/java/com/auth0/jwt/impl/NullClaim.java",
"identifier": "NullClaim",
"interfaces": "implements Claim",
"methods": [
{
"class_method_signature": "NullClaim.isNull()",
"constructor": false,
"full_signature": "@Override public boolean isNull()",
"i... | {
"body": "@Override\n public <T> T as(Class<T> tClazz) throws JWTDecodeException {\n return null;\n }",
"class_method_signature": "NullClaim.as(Class<T> tClazz)",
"constructor": false,
"full_signature": "@Override public T as(Class<T> tClazz)",
"identifier": "as",
"invocations": [],
"modifie... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_17 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "lib/src/te... | {
"body": "@Test\n public void shouldGetValidClaim() throws Exception {\n DecodedJWT jwt = JWT.decode(\"eyJhbGciOiJIUzI1NiJ9.eyJvYmplY3QiOnsibmFtZSI6ImpvaG4ifX0.lrU1gZlOdlmTTeZwq0VI-pZx2iV46UWYd5-lCjy6-c4\");\n assertThat(jwt, is(notNullValue()));\n assertThat(jwt.getClaim(\"object\"), is(notN... | {
"fields": [
{
"declarator": "serialVersionUID = 1873362438023312895L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1873362438023312895L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "parts... | {
"body": "@Override\n public Claim getClaim(String name) {\n return payload.getClaim(name);\n }",
"class_method_signature": "JWTDecoder.getClaim(String name)",
"constructor": false,
"full_signature": "@Override public Claim getClaim(String name)",
"identifier": "getClaim",
"invocations": [
... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_190 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldFailOnECDSA512SigningWhenProvidedPrivateKeyIsNull() throws Exception {\n exception.expect(SignatureGenerationException.class);\n exception.expectMessage(\"The Token's Signature couldn't be generated when signing using the Algorithm: SHA512withECDSA\");\n ex... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public byte[] sign(byte[] headerBytes, byte[] payloadBytes) throws SignatureGenerationException {\n try {\n ECPrivateKey privateKey = keyProvider.getPrivateKey();\n if (privateKey == null) {\n throw new IllegalStateException(\"The given Private Key... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_240 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldGetStringWhenParsingTextNode() throws Exception {\n Map<String, JsonNode> tree = new HashMap<>();\n TextNode node = new TextNode(\"something here\");\n tree.put(\"key\", node);\n\n String text = deserializer.getString(tree, \"key\");\n assertT... | {
"fields": [
{
"declarator": "objectReader",
"modifier": "private final",
"original_string": "private final ObjectReader objectReader;",
"type": "ObjectReader",
"var_name": "objectReader"
}
],
"file": "lib/src/main/java/com/auth0/jwt/impl/HeaderDeserializer.java",
"identif... | {
"body": "String getString(Map<String, JsonNode> tree, String claimName) {\n JsonNode node = tree.get(claimName);\n if (node == null || node.isNull()) {\n return null;\n }\n return node.asText(null);\n }",
"class_method_signature": "HeaderDeserializer.getString(Map<String,... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_305 | {
"fields": [
{
"declarator": "claim",
"modifier": "private",
"original_string": "private NullClaim claim;",
"type": "NullClaim",
"var_name": "claim"
}
],
"file": "lib/src/test/java/com/auth0/jwt/impl/NullClaimTest.java",
"identifier": "NullClaimTest",
"interfaces": "",
... | {
"body": "@Test\n public void shouldGetAsInt() throws Exception {\n assertThat(claim.asInt(), is(nullValue()));\n }",
"class_method_signature": "NullClaimTest.shouldGetAsInt()",
"constructor": false,
"full_signature": "@Test public void shouldGetAsInt()",
"identifier": "shouldGetAsInt",
"invoc... | {
"fields": [],
"file": "lib/src/main/java/com/auth0/jwt/impl/NullClaim.java",
"identifier": "NullClaim",
"interfaces": "implements Claim",
"methods": [
{
"class_method_signature": "NullClaim.isNull()",
"constructor": false,
"full_signature": "@Override public boolean isNull()",
"i... | {
"body": "@Override\n public Integer asInt() {\n return null;\n }",
"class_method_signature": "NullClaim.asInt()",
"constructor": false,
"full_signature": "@Override public Integer asInt()",
"identifier": "asInt",
"invocations": [],
"modifiers": "@Override public",
"parameters": "()",
"r... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_186 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldFailOnECDSA384SigningWhenUsingPublicKey() throws Exception {\n exception.expect(SignatureGenerationException.class);\n exception.expectMessage(\"The Token's Signature couldn't be generated when signing using the Algorithm: SHA384withECDSA\");\n exception.ex... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public byte[] sign(byte[] headerBytes, byte[] payloadBytes) throws SignatureGenerationException {\n try {\n ECPrivateKey privateKey = keyProvider.getPrivateKey();\n if (privateKey == null) {\n throw new IllegalStateException(\"The given Private Key... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_169 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldPassECDSA512VerificationWithJOSESignatureWithBothKeys() throws Exception {\n String jwt = \"eyJhbGciOiJFUzUxMiJ9.eyJpc3MiOiJhdXRoMCJ9.AeCJPDIsSHhwRSGZCY6rspi8zekOw0K9qYMNridP1Fu9uhrA1QrG-EUxXlE06yvmh2R7Rz0aE7kxBwrnq8L8aOBCAYAsqhzPeUvyp8fXjjgs0Eto5I0mndE2QHlgcMSFASyjHbU8w... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_9 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "lib/src/te... | {
"body": "@Test\n public void shouldGetExpirationTime() throws Exception {\n DecodedJWT jwt = JWT.decode(\"eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NzY3MjcwODZ9.L9dcPHEDQew2u9MkDCORFkfDGcSOsgoPqNY-LUMLEHg\");\n assertThat(jwt, is(notNullValue()));\n assertThat(jwt.getExpiresAt(), is(instanceOf(Date.c... | {
"fields": [
{
"declarator": "serialVersionUID = 1873362438023312895L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1873362438023312895L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "parts... | {
"body": "@Override\n public Date getExpiresAt() {\n return payload.getExpiresAt();\n }",
"class_method_signature": "JWTDecoder.getExpiresAt()",
"constructor": false,
"full_signature": "@Override public Date getExpiresAt()",
"identifier": "getExpiresAt",
"invocations": [
"getExpiresAt"
]... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_217 | {
"fields": [
{
"declarator": "PUBLIC_KEY_FILE_RSA = \"src/test/resources/rsa-public.pem\"",
"modifier": "private static final",
"original_string": "private static final String PUBLIC_KEY_FILE_RSA = \"src/test/resources/rsa-public.pem\";",
"type": "String",
"var_name": "PUBLIC_KEY_FI... | {
"body": "@Test\n public void shouldAcceptRSA512Algorithm() throws Exception {\n String token = \"eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhdXRoMCJ9.mvL5LoMyIrWYjk5umEXZTmbyIrkbbcVPUkvdGZbu0qFBxGOf0nXP5PZBvPcOu084lvpwVox5n3VaD4iqzW-PsJyvKFgi5TnwmsbKchAp7JexQEsQOnTSGcfRqeUUiBZqRQdYsho71oAB3T4FnalDdFE... | {
"fields": [
{
"declarator": "parser",
"modifier": "private final",
"original_string": "private final JWTParser parser;",
"type": "JWTParser",
"var_name": "parser"
}
],
"file": "lib/src/main/java/com/auth0/jwt/JWT.java",
"identifier": "JWT",
"interfaces": "",
"methods"... | {
"body": "public static Verification require(Algorithm algorithm) {\n return JWTVerifier.init(algorithm);\n }",
"class_method_signature": "JWT.require(Algorithm algorithm)",
"constructor": false,
"full_signature": "public static Verification require(Algorithm algorithm)",
"identifier": "require",
... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_56 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "lib/src/te... | {
"body": "@Test\n public void shouldThrowRSA256InstanceWithNullKeys() throws Exception {\n exception.expect(IllegalArgumentException.class);\n exception.expectMessage(\"Both provided Keys cannot be null.\");\n Algorithm.RSA256(null, null);\n }",
"class_method_signature": "AlgorithmTest.s... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "description",
"modifier": "private final",
"original_string": "private final String d... | {
"body": "public static Algorithm RSA256(RSAKeyProvider keyProvider) throws IllegalArgumentException {\n return new RSAAlgorithm(\"RS256\", \"SHA256withRSA\", keyProvider);\n }",
"class_method_signature": "Algorithm.RSA256(RSAKeyProvider keyProvider)",
"constructor": false,
"full_signature": "public ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_149 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldPassECDSA256KVerificationWithProvidedPublicKey() throws Exception {\n ECDSAKeyProvider provider = mock(ECDSAKeyProvider.class);\n PublicKey publicKey = readPublicKeyFromFile(PUBLIC_KEY_FILE_256K, \"EC\");\n when(provider.getPublicKeyById(\"my-key-id\")).the... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_21 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "lib/src/te... | {
"body": "@Test\n public void shouldGetCustomClaimOfTypeBoolean() throws Exception {\n String token = \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjp0cnVlfQ.FwQ8VfsZNRqBa9PXMinSIQplfLU4-rkCLfIlTLg_MV0\";\n DecodedJWT jwt = JWT.decode(token);\n Assert.assertThat(jwt, is(notNullValue()));\n ... | {
"fields": [
{
"declarator": "serialVersionUID = 1873362438023312895L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1873362438023312895L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "parts... | {
"body": "@Override\n public Claim getClaim(String name) {\n return payload.getClaim(name);\n }",
"class_method_signature": "JWTDecoder.getClaim(String name)",
"constructor": false,
"full_signature": "@Override public Claim getClaim(String name)",
"identifier": "getClaim",
"invocations": [
... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_325 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldThrowWhenParsingNonNumericNode() throws Exception {\n exception.expect(JWTDecodeException.class);\n exception.expectMessage(\"The claim 'key' contained a non-numeric date value.\");\n\n Map<String, JsonNode> tree = new HashMap<>();\n TextNode node = ... | {
"fields": [
{
"declarator": "objectReader",
"modifier": "private final",
"original_string": "private final ObjectReader objectReader;",
"type": "ObjectReader",
"var_name": "objectReader"
}
],
"file": "lib/src/main/java/com/auth0/jwt/impl/PayloadDeserializer.java",
"identi... | {
"body": "Date getDateFromSeconds(Map<String, JsonNode> tree, String claimName) {\n JsonNode node = tree.get(claimName);\n if (node == null || node.isNull()) {\n return null;\n }\n if (!node.canConvertToLong()) {\n throw new JWTDecodeException(String.format(\"The cla... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_260 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldNotAllowToModifyClaimsMap() throws Exception {\n assertThat(payload, is(notNullValue()));\n Map<String, Claim> claims = payload.getClaims();\n assertThat(claims, is(notNullValue()));\n exception.expect(UnsupportedOperationException.class);\n c... | {
"fields": [
{
"declarator": "serialVersionUID = 1659021498824562311L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1659021498824562311L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "issue... | {
"body": "@Override\n public Map<String, Claim> getClaims() {\n Map<String, Claim> claims = new HashMap<>(tree.size() * 2);\n for (String name : tree.keySet()) {\n claims.put(name, extractClaim(name, tree, objectReader));\n }\n return Collections.unmodifiableMap(claims);\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_76 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "lib/src/te... | {
"body": "@Test\n public void shouldFailNoneVerificationWhenSignatureIsPresent() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: none\");\n String jwt = \"eyJhbGc... | {
"fields": [],
"file": "lib/src/main/java/com/auth0/jwt/algorithms/NoneAlgorithm.java",
"identifier": "NoneAlgorithm",
"interfaces": "",
"methods": [
{
"class_method_signature": "NoneAlgorithm.NoneAlgorithm()",
"constructor": true,
"full_signature": " NoneAlgorithm()",
"identifie... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n if (signatureBytes.length > 0) {\n throw new SignatureVerificationException(this);\n }\n }",
"class_method_sign... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_237 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldNotRemoveKnownPublicClaimsFromTree() throws Exception {\n String headerJSON = \"{\\n\" +\n \" \\\"alg\\\": \\\"HS256\\\",\\n\" +\n \" \\\"typ\\\": \\\"jws\\\",\\n\" +\n \" \\\"cty\\\": \\\"content\\\",\\n\" +\n ... | {
"fields": [
{
"declarator": "objectReader",
"modifier": "private final",
"original_string": "private final ObjectReader objectReader;",
"type": "ObjectReader",
"var_name": "objectReader"
}
],
"file": "lib/src/main/java/com/auth0/jwt/impl/HeaderDeserializer.java",
"identif... | {
"body": "@Override\n public BasicHeader deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {\n Map<String, JsonNode> tree = p.getCodec().readValue(p, new TypeReference<Map<String, JsonNode>>() {\n });\n if (tree == null) {\n throw new JWTDecodeException(\"Pa... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_99 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\";",
"type": "String",
"var_name": "PRIVATE_KEY_FILE"... | {
"body": "@Test\n public void shouldFailOnRSA256SigningWhenUsingPublicKey() throws Exception {\n exception.expect(SignatureGenerationException.class);\n exception.expectMessage(\"The Token's Signature couldn't be generated when signing using the Algorithm: SHA256withRSA\");\n exception.expect... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final RSAKeyProvider keyProvider;",
"type": "RSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"original_... | {
"body": "@Override\n @Deprecated\n public byte[] sign(byte[] headerBytes, byte[] payloadBytes) throws SignatureGenerationException {\n try {\n RSAPrivateKey privateKey = keyProvider.getPrivateKey();\n if (privateKey == null) {\n throw new IllegalStateException(\"The... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_108 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\";",
"type": "String",
"var_name": "PRIVATE_KEY_FILE"... | {
"body": "@Test\n public void shouldFailOnRSA512SigningWhenProvidedPrivateKeyIsNull() throws Exception {\n exception.expect(SignatureGenerationException.class);\n exception.expectMessage(\"The Token's Signature couldn't be generated when signing using the Algorithm: SHA512withRSA\");\n except... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final RSAKeyProvider keyProvider;",
"type": "RSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"original_... | {
"body": "@Override\n @Deprecated\n public byte[] sign(byte[] headerBytes, byte[] payloadBytes) throws SignatureGenerationException {\n try {\n RSAPrivateKey privateKey = keyProvider.getPrivateKey();\n if (privateKey == null) {\n throw new IllegalStateException(\"The... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_60 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "lib/src/te... | {
"body": "@Test\n public void shouldThrowRSA384InstanceWithNullKeyProvider() throws Exception {\n exception.expect(IllegalArgumentException.class);\n exception.expectMessage(\"The Key Provider cannot be null.\");\n RSAKeyProvider provider = null;\n Algorithm.RSA384(provider);\n }",
... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "description",
"modifier": "private final",
"original_string": "private final String d... | {
"body": "public static Algorithm RSA384(RSAKeyProvider keyProvider) throws IllegalArgumentException {\n return new RSAAlgorithm(\"RS384\", \"SHA384withRSA\", keyProvider);\n }",
"class_method_signature": "Algorithm.RSA384(RSAKeyProvider keyProvider)",
"constructor": false,
"full_signature": "public ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_221 | {
"fields": [
{
"declarator": "PUBLIC_KEY_FILE_RSA = \"src/test/resources/rsa-public.pem\"",
"modifier": "private static final",
"original_string": "private static final String PUBLIC_KEY_FILE_RSA = \"src/test/resources/rsa-public.pem\";",
"type": "String",
"var_name": "PUBLIC_KEY_FI... | {
"body": "@Test\n public void shouldGetAlgorithm() throws Exception {\n String token = \"eyJhbGciOiJIUzI1NiJ9.e30.XmNK3GpH3Ys_7wsYBfq4C3M6goz71I7dTgUkuIa5lyQ\";\n DecodedJWT jwt = JWT.require(Algorithm.HMAC256(\"secret\"))\n .build()\n .verify(token);\n\n assertT... | {
"fields": [
{
"declarator": "parser",
"modifier": "private final",
"original_string": "private final JWTParser parser;",
"type": "JWTParser",
"var_name": "parser"
}
],
"file": "lib/src/main/java/com/auth0/jwt/JWT.java",
"identifier": "JWT",
"interfaces": "",
"methods"... | {
"body": "public static Verification require(Algorithm algorithm) {\n return JWTVerifier.init(algorithm);\n }",
"class_method_signature": "JWT.require(Algorithm algorithm)",
"constructor": false,
"full_signature": "public static Verification require(Algorithm algorithm)",
"identifier": "require",
... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_37 | {
"fields": [
{
"declarator": "DATE_TOKEN_MS_VALUE = 1477592 * 1000",
"modifier": "private static final",
"original_string": "private static final long DATE_TOKEN_MS_VALUE = 1477592 * 1000;",
"type": "long",
"var_name": "DATE_TOKEN_MS_VALUE"
},
{
"declarator": "exceptio... | {
"body": "@SuppressWarnings(\"RedundantCast\")\n @Test\n public void shouldAddDefaultLeewayToDateClaims() throws Exception {\n Algorithm algorithm = mock(Algorithm.class);\n JWTVerifier verifier = JWTVerifier.init(algorithm)\n .build();\n\n assertThat(verifier.claims, is(not... | {
"fields": [
{
"declarator": "algorithm",
"modifier": "private final",
"original_string": "private final Algorithm algorithm;",
"type": "Algorithm",
"var_name": "algorithm"
},
{
"declarator": "claims",
"modifier": "final",
"original_string": "final Map<Stri... | {
"body": "static Verification init(Algorithm algorithm) throws IllegalArgumentException {\n return new BaseVerification(algorithm);\n }",
"class_method_signature": "JWTVerifier.init(Algorithm algorithm)",
"constructor": false,
"full_signature": "static Verification init(Algorithm algorithm)",
"iden... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_299 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldGetExtraClaim() throws Exception {\n Map<String, JsonNode> tree = new HashMap<>();\n tree.put(\"extraClaim\", new TextNode(\"extraValue\"));\n BasicHeader header = new BasicHeader(null, null, null, null, tree, objectReader);\n\n assertThat(header, is... | {
"fields": [
{
"declarator": "serialVersionUID = -4659137688548605095L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -4659137688548605095L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "alg... | {
"body": "@Override\n public Claim getHeaderClaim(String name) {\n return extractClaim(name, tree, objectReader);\n }",
"class_method_signature": "BasicHeader.getHeaderClaim(String name)",
"constructor": false,
"full_signature": "@Override public Claim getHeaderClaim(String name)",
"identifier":... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_276 | {
"fields": [
{
"declarator": "writer",
"modifier": "private",
"original_string": "private StringWriter writer;",
"type": "StringWriter",
"var_name": "writer"
},
{
"declarator": "serializer",
"modifier": "private",
"original_string": "private PayloadSerializ... | {
"body": "@Test\n public void shouldSerializeCustomArrayOfObject() throws Exception {\n UserPojo user1 = new UserPojo(\"Michael\", 1);\n UserPojo user2 = new UserPojo(\"Lucas\", 2);\n ClaimsHolder holder = holderFor(\"users\", new UserPojo[]{user1, user2});\n serializer.serialize(holde... | {
"fields": [],
"file": "lib/src/main/java/com/auth0/jwt/impl/PayloadSerializer.java",
"identifier": "PayloadSerializer",
"interfaces": "",
"methods": [
{
"class_method_signature": "PayloadSerializer.PayloadSerializer()",
"constructor": true,
"full_signature": "public PayloadSerializer(... | {
"body": "@Override\n public void serialize(ClaimsHolder holder, JsonGenerator gen, SerializerProvider provider) throws IOException {\n\n gen.writeStartObject();\n for (Map.Entry<String, Object> e : holder.getClaims().entrySet()) {\n switch (e.getKey()) {\n case PublicClaim... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_124 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldThrowOnVerifyWhenSignatureAlgorithmDoesNotExists() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: some-alg\");\n exception.ex... | {
"fields": [
{
"declarator": "crypto",
"modifier": "private final",
"original_string": "private final CryptoHelper crypto;",
"type": "CryptoHelper",
"var_name": "crypto"
},
{
"declarator": "secret",
"modifier": "private final",
"original_string": "private f... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n boolean valid = crypto.verifySignatureFor(getDescription(), secret, jwt.getHeader(), jwt.getPayload(), signatureB... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_173 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldFailECDSA512VerificationWithInvalidPublicKey() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: SHA512withECDSA\");\n String jw... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_5 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "lib/src/te... | {
"body": "@Test\n public void shouldGetIssuer() throws Exception {\n DecodedJWT jwt = JWT.decode(\"eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJKb2huIERvZSJ9.SgXosfRR_IwCgHq5lF3tlM-JHtpucWCRSaVuoHTbWbQ\");\n assertThat(jwt, is(notNullValue()));\n assertThat(jwt.getIssuer(), is(\"John Doe\"));\n }",
"... | {
"fields": [
{
"declarator": "serialVersionUID = 1873362438023312895L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1873362438023312895L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "parts... | {
"body": "@Override\n public String getIssuer() {\n return payload.getIssuer();\n }",
"class_method_signature": "JWTDecoder.getIssuer()",
"constructor": false,
"full_signature": "@Override public String getIssuer()",
"identifier": "getIssuer",
"invocations": [
"getIssuer"
],
"modifiers... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_165 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldFailECDSA384VerificationOnInvalidJOSESignature() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: SHA384withECDSA\");\n\n byte[... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_309 | {
"fields": [
{
"declarator": "claim",
"modifier": "private",
"original_string": "private NullClaim claim;",
"type": "NullClaim",
"var_name": "claim"
}
],
"file": "lib/src/test/java/com/auth0/jwt/impl/NullClaimTest.java",
"identifier": "NullClaimTest",
"interfaces": "",
... | {
"body": "@Test\n public void shouldGetAsDate() throws Exception {\n assertThat(claim.asDate(), is(nullValue()));\n }",
"class_method_signature": "NullClaimTest.shouldGetAsDate()",
"constructor": false,
"full_signature": "@Test public void shouldGetAsDate()",
"identifier": "shouldGetAsDate",
"... | {
"fields": [],
"file": "lib/src/main/java/com/auth0/jwt/impl/NullClaim.java",
"identifier": "NullClaim",
"interfaces": "implements Claim",
"methods": [
{
"class_method_signature": "NullClaim.isNull()",
"constructor": false,
"full_signature": "@Override public boolean isNull()",
"i... | {
"body": "@Override\n public Date asDate() {\n return null;\n }",
"class_method_signature": "NullClaim.asDate()",
"constructor": false,
"full_signature": "@Override public Date asDate()",
"identifier": "asDate",
"invocations": [],
"modifiers": "@Override public",
"parameters": "()",
"ret... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_132 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldThrowOnSignWhenSignatureAlgorithmDoesNotExists() throws Exception {\n exception.expect(SignatureGenerationException.class);\n exception.expectMessage(\"The Token's Signature couldn't be generated when signing using the Algorithm: some-algorithm\");\n except... | {
"fields": [
{
"declarator": "crypto",
"modifier": "private final",
"original_string": "private final CryptoHelper crypto;",
"type": "CryptoHelper",
"var_name": "crypto"
},
{
"declarator": "secret",
"modifier": "private final",
"original_string": "private f... | {
"body": "@Override\n public byte[] sign(byte[] headerBytes, byte[] payloadBytes) throws SignatureGenerationException {\n try {\n return crypto.createSignatureFor(getDescription(), secret, headerBytes, payloadBytes);\n } catch (NoSuchAlgorithmException | InvalidKeyException e) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
19317653_9 | {
"fields": [
{
"declarator": "td1",
"modifier": "private",
"original_string": "private ToDo td1;",
"type": "ToDo",
"var_name": "td1"
},
{
"declarator": "td2",
"modifier": "private",
"original_string": "private ToDo td2;",
"type": "ToDo",
"var_na... | {
"body": "@Test\n\tpublic void testUpdateToDo() {\n\t\tToDo td = new ToDo();\n\t\ttd.setTitle(\"do a test\");\n\t\ttd.setCompleted(true);\n\t\tapi.updateToDo(td1.getId(), td);\n\t\ttd = api.getToDo(td1.getId());\n\t\tassertEquals(\"do a test\", td.getTitle());\n\t\tassertTrue(td.isCompleted());\n\t}",
"class_metho... | {
"fields": [
{
"declarator": "store",
"modifier": "private",
"original_string": "private ToDoStore store;",
"type": "ToDoStore",
"var_name": "store"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/rest/ToDoAPI.java",
"identifier": "ToDoAPI",
"interface... | {
"body": "@PUT @Path(\"/{id}\")\n @Produces(\"application/json\")\n @Consumes(\"application/json\")\n public ToDo updateToDo(@PathParam(\"id\") String id, ToDo td) {\n if(id == null) {\n throw new WebApplicationException(\"Must supply an ID, for example /api/todos/123.\", \n Response.Status.B... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_30 | {
"fields": [],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/model/ToDoTest.java",
"identifier": "ToDoTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGetOrder() {\n\t ToDo td = new ToDo();\n\t td.setOrder(1);\n\t assertEquals(1, td.getOrder());\n\t}",
"class_method_signature": "ToDoTest.testGetOrder()",
"constructor": false,
"full_signature": "@Test public void testGetOrder()",
"identifier": "testGetOrder",
"invocat... | {
"fields": [
{
"declarator": "completed",
"modifier": "private",
"original_string": "private boolean completed;",
"type": "boolean",
"var_name": "completed"
},
{
"declarator": "title",
"modifier": "private",
"original_string": "private String title;",
... | {
"body": "public int getOrder() {\n return order;\n }",
"class_method_signature": "ToDo.getOrder()",
"constructor": false,
"full_signature": "public int getOrder()",
"identifier": "getOrder",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getOrd... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_26 | {
"fields": [],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/model/CloudantPostResponseTest.java",
"identifier": "CloudantPostResponseTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetRev() {\n CloudantPostResponse resp = new CloudantPostResponse();\n resp.setRev(\"abc\");\n assertEquals(\"abc\", resp.getRev());\n }",
"class_method_signature": "CloudantPostResponseTest.testGetRev()",
"constructor": false,
"full_signature": "@Test public void t... | {
"fields": [
{
"declarator": "id",
"modifier": "private",
"original_string": "private String id;",
"type": "String",
"var_name": "id"
},
{
"declarator": "ok",
"modifier": "private",
"original_string": "private boolean ok;",
"type": "boolean",
"v... | {
"body": "public String getRev() {\n return rev;\n }",
"class_method_signature": "CloudantPostResponse.getRev()",
"constructor": false,
"full_signature": "public String getRev()",
"identifier": "getRev",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "String",
"signatur... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_51 | {
"fields": [
{
"declarator": "docs",
"modifier": "private",
"original_string": "private CloudantAllDocs docs;",
"type": "CloudantAllDocs",
"var_name": "docs"
},
{
"declarator": "rows",
"modifier": "private",
"original_string": "private List<CloudantRow> row... | {
"body": "@Test\n public void testGetAll() throws Exception {\n IMocksControl control = createControl();\n Response resp = control.createMock(Response.class);\n expect(resp.getStatus()).andReturn(200).times(3);\n Capture<Class<CloudantAllDocs>> classCapture = new Capture<Class<CloudantAllDocs>>();\n ... | {
"fields": [
{
"declarator": "REVISION_PARAM = \"rev\"",
"modifier": "private static final",
"original_string": "private static final String REVISION_PARAM = \"rev\";",
"type": "String",
"var_name": "REVISION_PARAM"
},
{
"declarator": "DESIGN_DOC_NAME = \"todos\"",
... | {
"body": "@Override\n public Collection<ToDo> getAll() throws ToDoStoreException {\n Response allDocsResp = target.queryParam(\"reduce\", false).\n path(\"_design\").path(DESIGN_DOC_NAME).path(\"_view\").path(VIEW_NAME).\n request(MediaType.APPLICATION_JSON).get();\n int status = allDocs... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_47 | {
"fields": [],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/store/MongoStoreTest.java",
"identifier": "MongoStoreTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testPersist() {\n\t\tDBCollection coll = createMockCollection();\n\t\tToDo td = new ToDo();\n\t\ttd.setTitle(\"This is a test\");\n\t\ttd.setId(\"aaaaaaaaaaaaaaaaaaaaaaa1\");\n\t\texpect(coll.insert(isA(DBObject.class))).andAnswer(new IAnswer<WriteResult>() {\n\t\t\t@Override\n\t\t\tpu... | {
"fields": [
{
"declarator": "coll",
"modifier": "private",
"original_string": "private DBCollection coll;",
"type": "DBCollection",
"var_name": "coll"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/store/MongoStore.java",
"identifier": "MongoStore",
... | {
"body": "@Override\n public ToDo persist(ToDo td) {\n DBObject dbObj = convertToDbObject(td);\n coll.insert(dbObj);\n return createToDo(dbObj);\n }",
"class_method_signature": "MongoStore.persist(ToDo td)",
"constructor": false,
"full_signature": "@Override public ToDo persist(ToDo td)",
"identif... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_10 | {
"fields": [
{
"declarator": "td1",
"modifier": "private",
"original_string": "private ToDo td1;",
"type": "ToDo",
"var_name": "td1"
},
{
"declarator": "td2",
"modifier": "private",
"original_string": "private ToDo td2;",
"type": "ToDo",
"var_na... | {
"body": "@Test\n\tpublic void testUpdateToDoIdException() {\n\t\ttry {\n\t\t\tapi.updateToDo(null, new ToDo());\n\t\t\tfail(\"Expected exception to be thrown.\");\n\t\t} catch(WebApplicationException e) {\n\t\t\tassertEquals(Response.Status.BAD_REQUEST.getStatusCode(), e.getResponse().getStatus());\n\t\t}\n\t}",
... | {
"fields": [
{
"declarator": "store",
"modifier": "private",
"original_string": "private ToDoStore store;",
"type": "ToDoStore",
"var_name": "store"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/rest/ToDoAPI.java",
"identifier": "ToDoAPI",
"interface... | {
"body": "@PUT @Path(\"/{id}\")\n @Produces(\"application/json\")\n @Consumes(\"application/json\")\n public ToDo updateToDo(@PathParam(\"id\") String id, ToDo td) {\n if(id == null) {\n throw new WebApplicationException(\"Must supply an ID, for example /api/todos/123.\", \n Response.Status.B... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_5 | {
"fields": [
{
"declarator": "td1",
"modifier": "private",
"original_string": "private ToDo td1;",
"type": "ToDo",
"var_name": "td1"
},
{
"declarator": "td2",
"modifier": "private",
"original_string": "private ToDo td2;",
"type": "ToDo",
"var_na... | {
"body": "@Test\n\tpublic void testGetToDosException() {\n\t\ttry {\n\t\t\terrorApi.getToDos();\n\t\t\tfail(\"Expected exception to be thrown.\");\n\t\t} catch(WebApplicationException e) {\n\t\t\tassertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), e.getResponse().getStatus());\n\t\t}\n\t}",
"class_... | {
"fields": [
{
"declarator": "store",
"modifier": "private",
"original_string": "private ToDoStore store;",
"type": "ToDoStore",
"var_name": "store"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/rest/ToDoAPI.java",
"identifier": "ToDoAPI",
"interface... | {
"body": "@GET\n @Produces(\"application/json\")\n public Collection<ToDo> getToDos() {\n try {\n return store.getAll();\n } catch (ToDoStoreException e) {\n throw new WebApplicationException(\"Error getting all ToDos.\", Response.Status.INTERNAL_SERVER_ERROR);\n }\n }",
"class_method_signatu... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_4 | {
"fields": [
{
"declarator": "td1",
"modifier": "private",
"original_string": "private ToDo td1;",
"type": "ToDo",
"var_name": "td1"
},
{
"declarator": "td2",
"modifier": "private",
"original_string": "private ToDo td2;",
"type": "ToDo",
"var_na... | {
"body": "@Test\n\tpublic void testGetToDos() {\n\t\tCollection<ToDo> todos = api.getToDos();\n\t\tassertTrue(todos.contains(td1));\n\t\tassertTrue(todos.contains(td2));\n\t\tassertEquals(2, todos.size());\n\t}",
"class_method_signature": "ToDoAPITest.testGetToDos()",
"constructor": false,
"full_signature": "@... | {
"fields": [
{
"declarator": "store",
"modifier": "private",
"original_string": "private ToDoStore store;",
"type": "ToDoStore",
"var_name": "store"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/rest/ToDoAPI.java",
"identifier": "ToDoAPI",
"interface... | {
"body": "@GET\n @Produces(\"application/json\")\n public Collection<ToDo> getToDos() {\n try {\n return store.getAll();\n } catch (ToDoStoreException e) {\n throw new WebApplicationException(\"Error getting all ToDos.\", Response.Status.INTERNAL_SERVER_ERROR);\n }\n }",
"class_method_signatu... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_11 | {
"fields": [
{
"declarator": "td1",
"modifier": "private",
"original_string": "private ToDo td1;",
"type": "ToDo",
"var_name": "td1"
},
{
"declarator": "td2",
"modifier": "private",
"original_string": "private ToDo td2;",
"type": "ToDo",
"var_na... | {
"body": "@Test\n\tpublic void testUpdateToDoException() {\n\t\ttry {\n\t\t\tapi.updateToDo(\"123\", null);\n\t\t\tfail(\"Expected exception to be thrown.\");\n\t\t} catch(WebApplicationException e) {\n\t\t\tassertEquals(Response.Status.BAD_REQUEST.getStatusCode(), e.getResponse().getStatus());\n\t\t}\n\t}",
"clas... | {
"fields": [
{
"declarator": "store",
"modifier": "private",
"original_string": "private ToDoStore store;",
"type": "ToDoStore",
"var_name": "store"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/rest/ToDoAPI.java",
"identifier": "ToDoAPI",
"interface... | {
"body": "@PUT @Path(\"/{id}\")\n @Produces(\"application/json\")\n @Consumes(\"application/json\")\n public ToDo updateToDo(@PathParam(\"id\") String id, ToDo td) {\n if(id == null) {\n throw new WebApplicationException(\"Must supply an ID, for example /api/todos/123.\", \n Response.Status.B... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_46 | {
"fields": [],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/store/MongoStoreTest.java",
"identifier": "MongoStoreTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGet() {\n\t\tDBCollection coll = createMockCollection();\n\t\tDBCursor cursor = createMockCursor();\n\t\texpect(cursor.hasNext()).andAnswer(new IAnswer<Boolean>() {\n\t\t\tprivate int count = 0;\n\t\t\t@Override\n\t\t\tpublic Boolean answer() throws Throwable {\n\t\t\t\tcount++;\n\... | {
"fields": [
{
"declarator": "coll",
"modifier": "private",
"original_string": "private DBCollection coll;",
"type": "DBCollection",
"var_name": "coll"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/store/MongoStore.java",
"identifier": "MongoStore",
... | {
"body": "@Override\n public ToDo get(String id) {\n BasicDBObject query = new BasicDBObject(\"_id\", id);\n DBCursor cursor = coll.find(query);\n if(cursor.hasNext()) {\n ToDo td = createToDo(cursor.next());\n cursor.close();\n return td;\n } else {\n return null;\n }\n }",
"c... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_50 | {
"fields": [],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/store/MongoStoreTest.java",
"identifier": "MongoStoreTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testCount() throws Exception {\n\t DBCollection coll = createMockCollection();\n DBCursor cursor = createMockCursor();\n expect(cursor.hasNext()).andAnswer(new IAnswer<Boolean>() {\n private int count = 0;\n @Override\n public Boolean answer() throws Throwable {\n... | {
"fields": [
{
"declarator": "coll",
"modifier": "private",
"original_string": "private DBCollection coll;",
"type": "DBCollection",
"var_name": "coll"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/store/MongoStore.java",
"identifier": "MongoStore",
... | {
"body": "@Override\n public int count() throws ToDoStoreException {\n return getAll().size();\n }",
"class_method_signature": "MongoStore.count()",
"constructor": false,
"full_signature": "@Override public int count()",
"identifier": "count",
"invocations": [
"size",
"getAll"
],
"modifier... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_27 | {
"fields": [],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/model/ToDoTest.java",
"identifier": "ToDoTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGetId() {\n\t\tToDo td = new ToDo();\n\t\tassertNull(td.getId());\n\t\ttd.setId(\"123abc\");\n\t\tassertEquals(\"123abc\", td.getId());\n\t}",
"class_method_signature": "ToDoTest.testGetId()",
"constructor": false,
"full_signature": "@Test public void testGetId()",
"identif... | {
"fields": [
{
"declarator": "completed",
"modifier": "private",
"original_string": "private boolean completed;",
"type": "boolean",
"var_name": "completed"
},
{
"declarator": "title",
"modifier": "private",
"original_string": "private String title;",
... | {
"body": "public String getId() {\n return id;\n }",
"class_method_signature": "ToDo.getId()",
"constructor": false,
"full_signature": "public String getId()",
"identifier": "getId",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getId()",... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_31 | {
"fields": [],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/model/ToDoTest.java",
"identifier": "ToDoTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testEquals() {\n\t\tToDo td = new ToDo();\n\t\tassertFalse(td.equals(null));\n\t\tassertTrue(td.equals(td));\n\t\ttd.setTitle(\"this is a test task\");\n\t\ttd.setCompleted(true);\n\t\tassertFalse(td.equals(new ToDo()));\n\t\tToDo td2 = new ToDo();\n\t\ttd2.setTitle(\"this is a test ta... | {
"fields": [
{
"declarator": "completed",
"modifier": "private",
"original_string": "private boolean completed;",
"type": "boolean",
"var_name": "completed"
},
{
"declarator": "title",
"modifier": "private",
"original_string": "private String title;",
... | {
"body": "@Override\n public boolean equals(Object obj) {\n if(obj instanceof ToDo) {\n ToDo test = (ToDo)obj;\n boolean result = false;\n result = id == null ? id == test.getId() : id.equals(test.getId());\n result &= title == null ? title == test.getTitle() : title.equals(test.getTitle());\... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_8 | {
"fields": [
{
"declarator": "td1",
"modifier": "private",
"original_string": "private ToDo td1;",
"type": "ToDo",
"var_name": "td1"
},
{
"declarator": "td2",
"modifier": "private",
"original_string": "private ToDo td2;",
"type": "ToDo",
"var_na... | {
"body": "@Test\n\tpublic void testNewToDoInternalError() {\n\t\ttry {\n\t\t\terrorApi.newToDo(new ToDo());\n\t\t\tfail(\"Expected exception to be thrown.\");\n\t\t} catch(WebApplicationException e) {\n\t\t\tassertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), e.getResponse().getStatus());\n\t\t}\n\t}... | {
"fields": [
{
"declarator": "store",
"modifier": "private",
"original_string": "private ToDoStore store;",
"type": "ToDoStore",
"var_name": "store"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/rest/ToDoAPI.java",
"identifier": "ToDoAPI",
"interface... | {
"body": "@POST\n @Consumes(\"application/json\")\n @Produces(\"application/json\")\n public ToDo newToDo(ToDo td) {\n if(td == null) {\n throw new WebApplicationException(\"Must supply a ToDo in the POST body.\", \n Response.Status.BAD_REQUEST);\n }\n try {\n return store.persist(... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_41 | {
"fields": [
{
"declarator": "td1",
"modifier": "",
"original_string": "ToDo td1;",
"type": "ToDo",
"var_name": "td1"
},
{
"declarator": "td2",
"modifier": "",
"original_string": "ToDo td2;",
"type": "ToDo",
"var_name": "td2"
},
{
... | {
"body": "@Test\n\tpublic void testPersist() throws Exception {\n\t\tToDo td = new ToDo();\n\t\ttd.setTitle(\"do a test\");\n\t\ttd = emptyStore.persist(td);\n\t\tassertEquals(td, emptyStore.get(td.getId()));\n\t}",
"class_method_signature": "InMemoryStoreTest.testPersist()",
"constructor": false,
"full_signat... | {
"fields": [
{
"declarator": "store",
"modifier": "private",
"original_string": "private Map<String, ToDo> store;",
"type": "Map<String, ToDo>",
"var_name": "store"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/store/InMemoryStore.java",
"identifier": ... | {
"body": "@Override\n public ToDo persist(ToDo td) {\n td.setId(UUID.randomUUID().toString());\n synchronized(td) {\n store.put(td.getId(), td);\n }\n return td;\n }",
"class_method_signature": "InMemoryStore.persist(ToDo td)",
"constructor": false,
"full_signature": "@Override public ToDo p... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_16 | {
"fields": [
{
"declarator": "rows",
"modifier": "private",
"original_string": "private List<CloudantRow> rows;",
"type": "List<CloudantRow>",
"var_name": "rows"
},
{
"declarator": "row1",
"modifier": "private",
"original_string": "private CloudantRow row1;... | {
"body": "@Test\n public void testGetRows() {\n CloudantAllDocs resp = new CloudantAllDocs();\n resp.setRows(rows);\n assertEquals(rows, resp.getRows());\n }",
"class_method_signature": "CloudantAllDocsTest.testGetRows()",
"constructor": false,
"full_signature": "@Test public void testGetRows()",
... | {
"fields": [
{
"declarator": "rows",
"modifier": "private",
"original_string": "private List<CloudantRow> rows;",
"type": "List<CloudantRow>",
"var_name": "rows"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/model/CloudantAllDocs.java",
"identifier": "... | {
"body": "public List<CloudantRow> getRows() {\n return rows;\n }",
"class_method_signature": "CloudantAllDocs.getRows()",
"constructor": false,
"full_signature": "public List<CloudantRow> getRows()",
"identifier": "getRows",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return":... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_3 | {
"fields": [
{
"declarator": "td1",
"modifier": "private",
"original_string": "private ToDo td1;",
"type": "ToDo",
"var_name": "td1"
},
{
"declarator": "td2",
"modifier": "private",
"original_string": "private ToDo td2;",
"type": "ToDo",
"var_na... | {
"body": "@Test\n\tpublic void testToDoDoesNotExist() {\n\t\ttry {\n\t\t\tapi.getToDo(\"123\");\n\t\t\tfail(\"Expected exception to be thrown.\");\n\t\t} catch(WebApplicationException e) {\n\t\t\tassertEquals(Response.Status.BAD_REQUEST.getStatusCode(), e.getResponse().getStatus());\n\t\t}\n\t}",
"class_method_sig... | {
"fields": [
{
"declarator": "store",
"modifier": "private",
"original_string": "private ToDoStore store;",
"type": "ToDoStore",
"var_name": "store"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/rest/ToDoAPI.java",
"identifier": "ToDoAPI",
"interface... | {
"body": "@GET @Path(\"/{id}\")\n @Produces(\"application/json\")\n public ToDo getToDo(@PathParam(\"id\") String id) {\n if(id == null) {\n throw new WebApplicationException(\"Must supply an ID, for example /api/todos/123.\", \n Response.Status.BAD_REQUEST);\n }\n try {\n ToDo td =... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_36 | {
"fields": [
{
"declarator": "ctd",
"modifier": "private",
"original_string": "private CloudantToDo ctd;",
"type": "CloudantToDo",
"var_name": "ctd"
}
],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/model/CloudantRowTest.java",
"identifier": "CloudantRowTe... | {
"body": "@Test\n public void testGetId() {\n CloudantRow row = new CloudantRow();\n row.setId(\"123\");\n assertEquals(\"123\", row.getId());\n }",
"class_method_signature": "CloudantRowTest.testGetId()",
"constructor": false,
"full_signature": "@Test public void testGetId()",
"identifier": "test... | {
"fields": [
{
"declarator": "id",
"modifier": "private",
"original_string": "private String id;",
"type": "String",
"var_name": "id"
},
{
"declarator": "key",
"modifier": "private",
"original_string": "private int key;",
"type": "int",
"var_nam... | {
"body": "public String getId() {\n return id;\n }",
"class_method_signature": "CloudantRow.getId()",
"constructor": false,
"full_signature": "public String getId()",
"identifier": "getId",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String ge... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_20 | {
"fields": [
{
"declarator": "td",
"modifier": "private",
"original_string": "private ToDo td;",
"type": "ToDo",
"var_name": "td"
}
],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/model/CloudantToDoTest.java",
"identifier": "CloudantToDoTest",
"interface... | {
"body": "@Test\n public void testIsCompleted() {\n CloudantToDo ctd = new CloudantToDo(td);\n assertFalse(ctd.isCompleted());\n ctd = new CloudantToDo();\n ctd.setCompleted(true);\n assertTrue(ctd.isCompleted());\n }",
"class_method_signature": "CloudantToDoTest.testIsCompleted()",
"constructor... | {
"fields": [
{
"declarator": "_id",
"modifier": "private",
"original_string": "private String _id;",
"type": "String",
"var_name": "_id"
},
{
"declarator": "_rev",
"modifier": "private",
"original_string": "private String _rev;",
"type": "String",
... | {
"body": "public boolean isCompleted() {\n return completed;\n }",
"class_method_signature": "CloudantToDo.isCompleted()",
"constructor": false,
"full_signature": "public boolean isCompleted()",
"identifier": "isCompleted",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_21 | {
"fields": [
{
"declarator": "td",
"modifier": "private",
"original_string": "private ToDo td;",
"type": "ToDo",
"var_name": "td"
}
],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/model/CloudantToDoTest.java",
"identifier": "CloudantToDoTest",
"interface... | {
"body": "@Test\n public void testGetToDo() {\n CloudantToDo ctd = new CloudantToDo(td);\n assertEquals(td, ctd.getToDo());\n ctd = new CloudantToDo();\n ctd.set_id(\"456\");\n ctd.set_rev(\"def\");\n ctd.setTitle(\"Another test\");\n ToDo testTd = new ToDo();\n testTd.setId(\"456\");\n t... | {
"fields": [
{
"declarator": "_id",
"modifier": "private",
"original_string": "private String _id;",
"type": "String",
"var_name": "_id"
},
{
"declarator": "_rev",
"modifier": "private",
"original_string": "private String _rev;",
"type": "String",
... | {
"body": "public ToDo getToDo() {\n ToDo td = new ToDo();\n td.setId(this.get_id());\n td.setCompleted(this.isCompleted());\n td.setTitle(this.getTitle());\n return td;\n }",
"class_method_signature": "CloudantToDo.getToDo()",
"constructor": false,
"full_signature": "public ToDo getToDo()",
"... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_37 | {
"fields": [
{
"declarator": "ctd",
"modifier": "private",
"original_string": "private CloudantToDo ctd;",
"type": "CloudantToDo",
"var_name": "ctd"
}
],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/model/CloudantRowTest.java",
"identifier": "CloudantRowTe... | {
"body": "@Test\n public void testGetKey() {\n CloudantRow row = new CloudantRow();\n row.setKey(0);\n assertEquals(0, row.getKey());\n }",
"class_method_signature": "CloudantRowTest.testGetKey()",
"constructor": false,
"full_signature": "@Test public void testGetKey()",
"identifier": "testGetKey"... | {
"fields": [
{
"declarator": "id",
"modifier": "private",
"original_string": "private String id;",
"type": "String",
"var_name": "id"
},
{
"declarator": "key",
"modifier": "private",
"original_string": "private int key;",
"type": "int",
"var_nam... | {
"body": "public int getKey() {\n return key;\n }",
"class_method_signature": "CloudantRow.getKey()",
"constructor": false,
"full_signature": "public int getKey()",
"identifier": "getKey",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getKey()"... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_2 | {
"fields": [
{
"declarator": "td1",
"modifier": "private",
"original_string": "private ToDo td1;",
"type": "ToDo",
"var_name": "td1"
},
{
"declarator": "td2",
"modifier": "private",
"original_string": "private ToDo td2;",
"type": "ToDo",
"var_na... | {
"body": "@Test\n\tpublic void testGetToDoException() {\n\t\ttry {\n\t\t\terrorApi.getToDo(\"123\");\n\t\t\tfail(\"Expected exception to be thrown.\");\n\t\t} catch(WebApplicationException e) {\n\t\t\tassertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), e.getResponse().getStatus());\n\t\t}\n\t}",
"c... | {
"fields": [
{
"declarator": "store",
"modifier": "private",
"original_string": "private ToDoStore store;",
"type": "ToDoStore",
"var_name": "store"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/rest/ToDoAPI.java",
"identifier": "ToDoAPI",
"interface... | {
"body": "@GET @Path(\"/{id}\")\n @Produces(\"application/json\")\n public ToDo getToDo(@PathParam(\"id\") String id) {\n if(id == null) {\n throw new WebApplicationException(\"Must supply an ID, for example /api/todos/123.\", \n Response.Status.BAD_REQUEST);\n }\n try {\n ToDo td =... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_17 | {
"fields": [
{
"declarator": "td",
"modifier": "private",
"original_string": "private ToDo td;",
"type": "ToDo",
"var_name": "td"
}
],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/model/CloudantToDoTest.java",
"identifier": "CloudantToDoTest",
"interface... | {
"body": "@Test\n public void testGet_id() {\n CloudantToDo ctd = new CloudantToDo(td);\n assertEquals(\"123\", ctd.get_id());\n ctd = new CloudantToDo();\n ctd.set_id(\"456\");\n assertEquals(\"456\", ctd.get_id());\n }",
"class_method_signature": "CloudantToDoTest.testGet_id()",
"constructor":... | {
"fields": [
{
"declarator": "_id",
"modifier": "private",
"original_string": "private String _id;",
"type": "String",
"var_name": "_id"
},
{
"declarator": "_rev",
"modifier": "private",
"original_string": "private String _rev;",
"type": "String",
... | {
"body": "public String get_id() {\n return _id;\n }",
"class_method_signature": "CloudantToDo.get_id()",
"constructor": false,
"full_signature": "public String get_id()",
"identifier": "get_id",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "Str... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_40 | {
"fields": [
{
"declarator": "td1",
"modifier": "",
"original_string": "ToDo td1;",
"type": "ToDo",
"var_name": "td1"
},
{
"declarator": "td2",
"modifier": "",
"original_string": "ToDo td2;",
"type": "ToDo",
"var_name": "td2"
},
{
... | {
"body": "@Test\n\tpublic void testGet() throws Exception {\n\t\tassertNull(emptyStore.get(\"123\"));\n\t\tassertNull(populatedStore.get(\"123\"));\n\t\tassertEquals(td1, populatedStore.get(td1.getId()));\n\t\tassertEquals(td2, populatedStore.get(td2.getId()));\n\t}",
"class_method_signature": "InMemoryStoreTest.t... | {
"fields": [
{
"declarator": "store",
"modifier": "private",
"original_string": "private Map<String, ToDo> store;",
"type": "Map<String, ToDo>",
"var_name": "store"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/store/InMemoryStore.java",
"identifier": ... | {
"body": "@Override\n public ToDo get(String id) {\n return store.get(id);\n }",
"class_method_signature": "InMemoryStore.get(String id)",
"constructor": false,
"full_signature": "@Override public ToDo get(String id)",
"identifier": "get",
"invocations": [
"get"
],
"modifiers": "@Override publ... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_56 | {
"fields": [
{
"declarator": "docs",
"modifier": "private",
"original_string": "private CloudantAllDocs docs;",
"type": "CloudantAllDocs",
"var_name": "docs"
},
{
"declarator": "rows",
"modifier": "private",
"original_string": "private List<CloudantRow> row... | {
"body": "@Test\n public void testCount() throws Exception {\n IMocksControl control = createControl();\n Response resp = control.createMock(Response.class);\n expect(resp.getStatus()).andReturn(200).times(3);\n Capture<Class<CloudantCount>> classCapture = new Capture<Class<CloudantCount>>();\n expec... | {
"fields": [
{
"declarator": "REVISION_PARAM = \"rev\"",
"modifier": "private static final",
"original_string": "private static final String REVISION_PARAM = \"rev\";",
"type": "String",
"var_name": "REVISION_PARAM"
},
{
"declarator": "DESIGN_DOC_NAME = \"todos\"",
... | {
"body": "@Override\n public int count() throws ToDoStoreException {\n Response allDocsResp = target.path(\"_design\").path(DESIGN_DOC_NAME).path(\"_view\").path(VIEW_NAME).\n request(MediaType.APPLICATION_JSON).get();\n int status = allDocsResp.getStatus();\n if(status == HttpURLConnection.HTTP... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_38 | {
"fields": [],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/model/CloudantCountTest.java",
"identifier": "CloudantCountTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetRows() {\n CloudantCount count = new CloudantCount();\n List<CloudantReducedRow> rows = new ArrayList<CloudantReducedRow>();\n CloudantReducedRow row = new CloudantReducedRow();\n row.setValue(123);\n rows.add(row);\n count.setRows(rows);\n assertEquals(rows... | {
"fields": [
{
"declarator": "rows",
"modifier": "private",
"original_string": "private List<CloudantReducedRow> rows;",
"type": "List<CloudantReducedRow>",
"var_name": "rows"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/model/CloudantCount.java",
"id... | {
"body": "public List<CloudantReducedRow> getRows() {\n return rows;\n }",
"class_method_signature": "CloudantCount.getRows()",
"constructor": false,
"full_signature": "public List<CloudantReducedRow> getRows()",
"identifier": "getRows",
"invocations": [],
"modifiers": "public",
"parameters": "()",... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_1 | {
"fields": [
{
"declarator": "td1",
"modifier": "private",
"original_string": "private ToDo td1;",
"type": "ToDo",
"var_name": "td1"
},
{
"declarator": "td2",
"modifier": "private",
"original_string": "private ToDo td2;",
"type": "ToDo",
"var_na... | {
"body": "@Test\n\tpublic void testGetToDoBadRequest() {\n\t\ttry {\n\t\t\tapi.getToDo(null);\n\t\t\tfail(\"Expected exception to be thrown.\");\n\t\t} catch(WebApplicationException e) {\n\t\t\tassertEquals(Response.Status.BAD_REQUEST.getStatusCode(), e.getResponse().getStatus());\n\t\t}\n\t}",
"class_method_signa... | {
"fields": [
{
"declarator": "store",
"modifier": "private",
"original_string": "private ToDoStore store;",
"type": "ToDoStore",
"var_name": "store"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/rest/ToDoAPI.java",
"identifier": "ToDoAPI",
"interface... | {
"body": "@GET @Path(\"/{id}\")\n @Produces(\"application/json\")\n public ToDo getToDo(@PathParam(\"id\") String id) {\n if(id == null) {\n throw new WebApplicationException(\"Must supply an ID, for example /api/todos/123.\", \n Response.Status.BAD_REQUEST);\n }\n try {\n ToDo td =... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_14 | {
"fields": [
{
"declarator": "td1",
"modifier": "private",
"original_string": "private ToDo td1;",
"type": "ToDo",
"var_name": "td1"
},
{
"declarator": "td2",
"modifier": "private",
"original_string": "private ToDo td2;",
"type": "ToDo",
"var_na... | {
"body": "@Test\n\tpublic void testDeleteToDo() {\n\t\tapi.deleteToDo(td1.getId());\n\t\tCollection<ToDo> todos = api.getToDos();\n\t\tassertTrue(todos.contains(td2));\n\t\tassertEquals(1, todos.size());\t\n\t}",
"class_method_signature": "ToDoAPITest.testDeleteToDo()",
"constructor": false,
"full_signature": ... | {
"fields": [
{
"declarator": "store",
"modifier": "private",
"original_string": "private ToDoStore store;",
"type": "ToDoStore",
"var_name": "store"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/rest/ToDoAPI.java",
"identifier": "ToDoAPI",
"interface... | {
"body": "@DELETE @Path(\"/{id}\")\n public void deleteToDo(@PathParam(\"id\") String id) {\n if(id == null) {\n throw new WebApplicationException(\"Must supply an ID, for example /api/todos/123,\",\n Response.Status.BAD_REQUEST);\n }\n try {\n store.delete(id);\n } catch (ToDoSto... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_43 | {
"fields": [
{
"declarator": "td1",
"modifier": "",
"original_string": "ToDo td1;",
"type": "ToDo",
"var_name": "td1"
},
{
"declarator": "td2",
"modifier": "",
"original_string": "ToDo td2;",
"type": "ToDo",
"var_name": "td2"
},
{
... | {
"body": "@Test\n\tpublic void testDelete() throws Exception {\n\t\temptyStore.delete(\"123\");\n\t\tpopulatedStore.delete(td1.getId());\n\t\tassertNull(populatedStore.get(td1.getId()));\n\t}",
"class_method_signature": "InMemoryStoreTest.testDelete()",
"constructor": false,
"full_signature": "@Test public voi... | {
"fields": [
{
"declarator": "store",
"modifier": "private",
"original_string": "private Map<String, ToDo> store;",
"type": "Map<String, ToDo>",
"var_name": "store"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/store/InMemoryStore.java",
"identifier": ... | {
"body": "@Override\n public void delete(String id) {\n synchronized(store) {\n store.remove(id);\n }\n }",
"class_method_signature": "InMemoryStore.delete(String id)",
"constructor": false,
"full_signature": "@Override public void delete(String id)",
"identifier": "delete",
"invocations": [
... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_55 | {
"fields": [
{
"declarator": "docs",
"modifier": "private",
"original_string": "private CloudantAllDocs docs;",
"type": "CloudantAllDocs",
"var_name": "docs"
},
{
"declarator": "rows",
"modifier": "private",
"original_string": "private List<CloudantRow> row... | {
"body": "@Test\n public void testDelete() throws Exception {\n IMocksControl control = createControl();\n Response resp = control.createMock(Response.class);\n expect(resp.getStatus()).andReturn(200).times(4);\n Capture<Class<CloudantToDo>> classCapture = new Capture<Class<CloudantToDo>>();\n expect... | {
"fields": [
{
"declarator": "REVISION_PARAM = \"rev\"",
"modifier": "private static final",
"original_string": "private static final String REVISION_PARAM = \"rev\";",
"type": "String",
"var_name": "REVISION_PARAM"
},
{
"declarator": "DESIGN_DOC_NAME = \"todos\"",
... | {
"body": "@Override\n public void delete(String id) throws ToDoStoreException {\n Response docResp = getRequest(id);\n int status = docResp.getStatus();\n if(status == HttpURLConnection.HTTP_OK) {\n CloudantToDo ctd = docResp.readEntity(CloudantToDo.class);\n Response updateReq = target.queryPara... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_22 | {
"fields": [
{
"declarator": "td",
"modifier": "private",
"original_string": "private ToDo td;",
"type": "ToDo",
"var_name": "td"
}
],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/model/CloudantToDoTest.java",
"identifier": "CloudantToDoTest",
"interface... | {
"body": "@Test\n public void testGetOrder() {\n CloudantToDo ctd = new CloudantToDo();\n ctd.setOrder(1);\n assertEquals(1, ctd.getOrder());\n }",
"class_method_signature": "CloudantToDoTest.testGetOrder()",
"constructor": false,
"full_signature": "@Test public void testGetOrder()",
"identifier":... | {
"fields": [
{
"declarator": "_id",
"modifier": "private",
"original_string": "private String _id;",
"type": "String",
"var_name": "_id"
},
{
"declarator": "_rev",
"modifier": "private",
"original_string": "private String _rev;",
"type": "String",
... | {
"body": "public int getOrder() {\n return order;\n }",
"class_method_signature": "CloudantToDo.getOrder()",
"constructor": false,
"full_signature": "public int getOrder()",
"identifier": "getOrder",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "in... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_34 | {
"fields": [
{
"declarator": "ctd",
"modifier": "private",
"original_string": "private CloudantToDo ctd;",
"type": "CloudantToDo",
"var_name": "ctd"
}
],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/model/CloudantRowTest.java",
"identifier": "CloudantRowTe... | {
"body": "@Test\n public void testGetDoc() {\n CloudantRow row = new CloudantRow();\n row.setDoc(ctd);\n assertEquals(ctd, row.getDoc());\n }",
"class_method_signature": "CloudantRowTest.testGetDoc()",
"constructor": false,
"full_signature": "@Test public void testGetDoc()",
"identifier": "testGet... | {
"fields": [
{
"declarator": "id",
"modifier": "private",
"original_string": "private String id;",
"type": "String",
"var_name": "id"
},
{
"declarator": "key",
"modifier": "private",
"original_string": "private int key;",
"type": "int",
"var_nam... | {
"body": "public CloudantToDo getDoc() {\n return doc;\n }",
"class_method_signature": "CloudantRow.getDoc()",
"constructor": false,
"full_signature": "public CloudantToDo getDoc()",
"identifier": "getDoc",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "CloudantToDo",
... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_18 | {
"fields": [
{
"declarator": "td",
"modifier": "private",
"original_string": "private ToDo td;",
"type": "ToDo",
"var_name": "td"
}
],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/model/CloudantToDoTest.java",
"identifier": "CloudantToDoTest",
"interface... | {
"body": "@Test\n public void testGet_rev() {\n CloudantToDo ctd = new CloudantToDo(td);\n assertNull(ctd.get_rev());\n ctd = new CloudantToDo();\n ctd.set_rev(\"def\");\n assertEquals(\"def\", ctd.get_rev());\n }",
"class_method_signature": "CloudantToDoTest.testGet_rev()",
"constructor": false... | {
"fields": [
{
"declarator": "_id",
"modifier": "private",
"original_string": "private String _id;",
"type": "String",
"var_name": "_id"
},
{
"declarator": "_rev",
"modifier": "private",
"original_string": "private String _rev;",
"type": "String",
... | {
"body": "public String get_rev() {\n return _rev;\n }",
"class_method_signature": "CloudantToDo.get_rev()",
"constructor": false,
"full_signature": "public String get_rev()",
"identifier": "get_rev",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature":... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_19 | {
"fields": [
{
"declarator": "td",
"modifier": "private",
"original_string": "private ToDo td;",
"type": "ToDo",
"var_name": "td"
}
],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/model/CloudantToDoTest.java",
"identifier": "CloudantToDoTest",
"interface... | {
"body": "@Test\n public void testGetTitle() {\n CloudantToDo ctd = new CloudantToDo(td);\n assertEquals(\"This is a test\", ctd.getTitle());\n ctd = new CloudantToDo();\n ctd.setTitle(\"Another test\");\n assertEquals(\"Another test\", ctd.getTitle());\n }",
"class_method_signature": "CloudantToD... | {
"fields": [
{
"declarator": "_id",
"modifier": "private",
"original_string": "private String _id;",
"type": "String",
"var_name": "_id"
},
{
"declarator": "_rev",
"modifier": "private",
"original_string": "private String _rev;",
"type": "String",
... | {
"body": "public String getTitle() {\n return title;\n }",
"class_method_signature": "CloudantToDo.getTitle()",
"constructor": false,
"full_signature": "public String getTitle()",
"identifier": "getTitle",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "String",
"signat... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_35 | {
"fields": [
{
"declarator": "ctd",
"modifier": "private",
"original_string": "private CloudantToDo ctd;",
"type": "CloudantToDo",
"var_name": "ctd"
}
],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/model/CloudantRowTest.java",
"identifier": "CloudantRowTe... | {
"body": "@Test\n public void testGetValue() {\n CloudantRow row = new CloudantRow();\n row.setValue(ctd.getToDo());\n assertEquals(ctd.getToDo(), row.getValue());\n }",
"class_method_signature": "CloudantRowTest.testGetValue()",
"constructor": false,
"full_signature": "@Test public void testGetValu... | {
"fields": [
{
"declarator": "id",
"modifier": "private",
"original_string": "private String id;",
"type": "String",
"var_name": "id"
},
{
"declarator": "key",
"modifier": "private",
"original_string": "private int key;",
"type": "int",
"var_nam... | {
"body": "public ToDo getValue() {\n return value;\n }",
"class_method_signature": "CloudantRow.getValue()",
"constructor": false,
"full_signature": "public ToDo getValue()",
"identifier": "getValue",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "ToDo",
"signature": "... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_23 | {
"fields": [
{
"declarator": "td",
"modifier": "private",
"original_string": "private ToDo td;",
"type": "ToDo",
"var_name": "td"
}
],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/model/CloudantToDoTest.java",
"identifier": "CloudantToDoTest",
"interface... | {
"body": "@Test\n public void testEquals() {\n CloudantToDo ctd = new CloudantToDo(td);\n assertFalse(ctd.equals(null));\n assertFalse(ctd.equals(\"test\"));\n CloudantToDo testCtd = new CloudantToDo();\n testCtd.set_id(\"123\");\n testCtd.setTitle(\"This is a test\");\n assertTrue(ctd.equals(t... | {
"fields": [
{
"declarator": "_id",
"modifier": "private",
"original_string": "private String _id;",
"type": "String",
"var_name": "_id"
},
{
"declarator": "_rev",
"modifier": "private",
"original_string": "private String _rev;",
"type": "String",
... | {
"body": "@Override\n public boolean equals(Object obj) {\n if(obj instanceof CloudantToDo) {\n CloudantToDo test = (CloudantToDo)obj;\n boolean result = _id == null ? _id == test.get_id() : _id.equals(test.get_id());\n result &= _rev == null ? _rev == test.get_rev() : _rev.equals(test.get_rev());... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_54 | {
"fields": [
{
"declarator": "docs",
"modifier": "private",
"original_string": "private CloudantAllDocs docs;",
"type": "CloudantAllDocs",
"var_name": "docs"
},
{
"declarator": "rows",
"modifier": "private",
"original_string": "private List<CloudantRow> row... | {
"body": "@Test\n public void testUpdate() throws Exception {\n IMocksControl control = createControl();\n Response resp = control.createMock(Response.class);\n expect(resp.getStatus()).andReturn(200).times(3);\n expect(resp.getStatus()).andReturn(201);\n Capture<Class<CloudantToDo>> classToDoCapture... | {
"fields": [
{
"declarator": "REVISION_PARAM = \"rev\"",
"modifier": "private static final",
"original_string": "private static final String REVISION_PARAM = \"rev\";",
"type": "String",
"var_name": "REVISION_PARAM"
},
{
"declarator": "DESIGN_DOC_NAME = \"todos\"",
... | {
"body": "@Override\n public ToDo update(String id, ToDo td) throws ToDoStoreException {\n Response docResp = getRequest(id);\n int status = docResp.getStatus();\n if(status == HttpURLConnection.HTTP_OK) {\n CloudantToDo ctd = docResp.readEntity(CloudantToDo.class);\n CloudantToDo updatedCtd = ne... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_42 | {
"fields": [
{
"declarator": "td1",
"modifier": "",
"original_string": "ToDo td1;",
"type": "ToDo",
"var_name": "td1"
},
{
"declarator": "td2",
"modifier": "",
"original_string": "ToDo td2;",
"type": "ToDo",
"var_name": "td2"
},
{
... | {
"body": "@Test\n\tpublic void testUpdate() throws Exception {\n\t\tToDo td = new ToDo();\n\t\ttd.setCompleted(true);\n\t\tassertNull(emptyStore.update(\"123\", td));\n\t\tpopulatedStore.update(td1.getId(), td);\n\t\ttd = populatedStore.get(td1.getId());\n\t\tassertEquals(\"\", td.getTitle());\n\t\tassertTrue(td.isC... | {
"fields": [
{
"declarator": "store",
"modifier": "private",
"original_string": "private Map<String, ToDo> store;",
"type": "Map<String, ToDo>",
"var_name": "store"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/store/InMemoryStore.java",
"identifier": ... | {
"body": "@Override\n public ToDo update(String id, ToDo td) {\n synchronized(store) {\n ToDo old = store.get(id);\n if(old == null) {\n return null;\n } else {\n old.setCompleted(td.isCompleted());\n old.setTitle(td.getTitle());\n }\n store.put(id, old);\n retu... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_15 | {
"fields": [
{
"declarator": "td1",
"modifier": "private",
"original_string": "private ToDo td1;",
"type": "ToDo",
"var_name": "td1"
},
{
"declarator": "td2",
"modifier": "private",
"original_string": "private ToDo td2;",
"type": "ToDo",
"var_na... | {
"body": "@Test\n\tpublic void testDeleteToDoException() {\n\t\ttry {\n\t\t\terrorApi.deleteToDo(\"123\");\n\t\t\tfail(\"Expected exception to be thrown.\");\n\t\t} catch (WebApplicationException e) {\n\t\t\tassertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), e.getResponse().getStatus());\n\t\t}\n\t\... | {
"fields": [
{
"declarator": "store",
"modifier": "private",
"original_string": "private ToDoStore store;",
"type": "ToDoStore",
"var_name": "store"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/rest/ToDoAPI.java",
"identifier": "ToDoAPI",
"interface... | {
"body": "@DELETE @Path(\"/{id}\")\n public void deleteToDo(@PathParam(\"id\") String id) {\n if(id == null) {\n throw new WebApplicationException(\"Must supply an ID, for example /api/todos/123,\",\n Response.Status.BAD_REQUEST);\n }\n try {\n store.delete(id);\n } catch (ToDoSto... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_0 | {
"fields": [
{
"declarator": "td1",
"modifier": "private",
"original_string": "private ToDo td1;",
"type": "ToDo",
"var_name": "td1"
},
{
"declarator": "td2",
"modifier": "private",
"original_string": "private ToDo td2;",
"type": "ToDo",
"var_na... | {
"body": "@Test\n\tpublic void testGetToDo() {\n\t\tassertEquals(td1, api.getToDo(td1.getId()));\n\t}",
"class_method_signature": "ToDoAPITest.testGetToDo()",
"constructor": false,
"full_signature": "@Test public void testGetToDo()",
"identifier": "testGetToDo",
"invocations": [
"assertEquals",
"ge... | {
"fields": [
{
"declarator": "store",
"modifier": "private",
"original_string": "private ToDoStore store;",
"type": "ToDoStore",
"var_name": "store"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/rest/ToDoAPI.java",
"identifier": "ToDoAPI",
"interface... | {
"body": "@GET @Path(\"/{id}\")\n @Produces(\"application/json\")\n public ToDo getToDo(@PathParam(\"id\") String id) {\n if(id == null) {\n throw new WebApplicationException(\"Must supply an ID, for example /api/todos/123.\", \n Response.Status.BAD_REQUEST);\n }\n try {\n ToDo td =... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_39 | {
"fields": [
{
"declarator": "td1",
"modifier": "",
"original_string": "ToDo td1;",
"type": "ToDo",
"var_name": "td1"
},
{
"declarator": "td2",
"modifier": "",
"original_string": "ToDo td2;",
"type": "ToDo",
"var_name": "td2"
},
{
... | {
"body": "@Test\n\tpublic void testGetAll() throws Exception {\n\t\tassertTrue(emptyStore.getAll().isEmpty());\n\t\tCollection<ToDo> todos = populatedStore.getAll();\n\t\tassertTrue(todos.contains(td2));\n\t\tassertTrue(todos.contains(td1));\n\t}",
"class_method_signature": "InMemoryStoreTest.testGetAll()",
"con... | {
"fields": [
{
"declarator": "store",
"modifier": "private",
"original_string": "private Map<String, ToDo> store;",
"type": "Map<String, ToDo>",
"var_name": "store"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/store/InMemoryStore.java",
"identifier": ... | {
"body": "@Override\n public Collection<ToDo> getAll() {\n return store.values();\n }",
"class_method_signature": "InMemoryStore.getAll()",
"constructor": false,
"full_signature": "@Override public Collection<ToDo> getAll()",
"identifier": "getAll",
"invocations": [
"values"
],
"modifiers": "@... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_24 | {
"fields": [],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/model/CloudantPostResponseTest.java",
"identifier": "CloudantPostResponseTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetId() {\n CloudantPostResponse resp = new CloudantPostResponse();\n resp.setId(\"123\");\n assertEquals(\"123\", resp.getId());\n }",
"class_method_signature": "CloudantPostResponseTest.testGetId()",
"constructor": false,
"full_signature": "@Test public void testG... | {
"fields": [
{
"declarator": "id",
"modifier": "private",
"original_string": "private String id;",
"type": "String",
"var_name": "id"
},
{
"declarator": "ok",
"modifier": "private",
"original_string": "private boolean ok;",
"type": "boolean",
"v... | {
"body": "public String getId() {\n return id;\n }",
"class_method_signature": "CloudantPostResponse.getId()",
"constructor": false,
"full_signature": "public String getId()",
"identifier": "getId",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_32 | {
"fields": [],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/model/CloudantReducedRowTest.java",
"identifier": "CloudantReducedRowTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetKey() {\n CloudantReducedRow row = new CloudantReducedRow();\n row.setKey(\"123\");\n assertEquals(\"123\", row.getKey());\n }",
"class_method_signature": "CloudantReducedRowTest.testGetKey()",
"constructor": false,
"full_signature": "@Test public void testGetKey... | {
"fields": [
{
"declarator": "key",
"modifier": "private",
"original_string": "private String key;",
"type": "String",
"var_name": "key"
},
{
"declarator": "value",
"modifier": "private",
"original_string": "private int value;",
"type": "int",
"... | {
"body": "public String getKey() {\n return key;\n }",
"class_method_signature": "CloudantReducedRow.getKey()",
"constructor": false,
"full_signature": "public String getKey()",
"identifier": "getKey",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature"... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_49 | {
"fields": [],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/store/MongoStoreTest.java",
"identifier": "MongoStoreTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testDelete() {\n\t\tToDo td = new ToDo();\n\t\ttd.setId(\"aaaaaaaaaaaaaaaaaaaaaaa2\");\n\t\ttd.setTitle(\"this is a test\");\n\t\tBasicDBObject dbObj = new BasicDBObject();\n\t\tdbObj.put(\"_id\", new ObjectId(\"aaaaaaaaaaaaaaaaaaaaaaa2\"));\n\t\tDBCollection coll = createMockCollectio... | {
"fields": [
{
"declarator": "coll",
"modifier": "private",
"original_string": "private DBCollection coll;",
"type": "DBCollection",
"var_name": "coll"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/store/MongoStore.java",
"identifier": "MongoStore",
... | {
"body": "@Override\n public void delete(String id) {\n DBObject query = new BasicDBObject(\"_id\", new ObjectId(id));\n coll.remove(query);\n }",
"class_method_signature": "MongoStore.delete(String id)",
"constructor": false,
"full_signature": "@Override public void delete(String id)",
"identifier":... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_28 | {
"fields": [],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/model/ToDoTest.java",
"identifier": "ToDoTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testIsCompleted() {\n\t\tToDo td = new ToDo();\n\t\tassertFalse(td.isCompleted());\n\t\ttd.setCompleted(true);\n\t\tassertTrue(td.isCompleted());\n\t}",
"class_method_signature": "ToDoTest.testIsCompleted()",
"constructor": false,
"full_signature": "@Test public void testIsComple... | {
"fields": [
{
"declarator": "completed",
"modifier": "private",
"original_string": "private boolean completed;",
"type": "boolean",
"var_name": "completed"
},
{
"declarator": "title",
"modifier": "private",
"original_string": "private String title;",
... | {
"body": "public boolean isCompleted() {\n return completed;\n }",
"class_method_signature": "ToDo.isCompleted()",
"constructor": false,
"full_signature": "public boolean isCompleted()",
"identifier": "isCompleted",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "boolean"... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_7 | {
"fields": [
{
"declarator": "td1",
"modifier": "private",
"original_string": "private ToDo td1;",
"type": "ToDo",
"var_name": "td1"
},
{
"declarator": "td2",
"modifier": "private",
"original_string": "private ToDo td2;",
"type": "ToDo",
"var_na... | {
"body": "@Test\n\tpublic void testNewToDoException() {\n\t\ttry {\n\t\t\tapi.newToDo(null);\n\t\t\tfail(\"Expected exception to be thrown.\");\n\t\t} catch(WebApplicationException e) {\n\t\t\tassertEquals(Response.Status.BAD_REQUEST.getStatusCode(), e.getResponse().getStatus());\n\t\t}\n\t}",
"class_method_signat... | {
"fields": [
{
"declarator": "store",
"modifier": "private",
"original_string": "private ToDoStore store;",
"type": "ToDoStore",
"var_name": "store"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/rest/ToDoAPI.java",
"identifier": "ToDoAPI",
"interface... | {
"body": "@POST\n @Consumes(\"application/json\")\n @Produces(\"application/json\")\n public ToDo newToDo(ToDo td) {\n if(td == null) {\n throw new WebApplicationException(\"Must supply a ToDo in the POST body.\", \n Response.Status.BAD_REQUEST);\n }\n try {\n return store.persist(... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_12 | {
"fields": [
{
"declarator": "td1",
"modifier": "private",
"original_string": "private ToDo td1;",
"type": "ToDo",
"var_name": "td1"
},
{
"declarator": "td2",
"modifier": "private",
"original_string": "private ToDo td2;",
"type": "ToDo",
"var_na... | {
"body": "@Test\n\tpublic void testUpdateToDoInternalError() {\n\t\ttry {\n\t\t\terrorApi.updateToDo(\"123\", new ToDo());\n\t\t\tfail(\"Expected exception to be thrown.\");\n\t\t} catch(WebApplicationException e) {\n\t\t\tassertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), e.getResponse().getStatus(... | {
"fields": [
{
"declarator": "store",
"modifier": "private",
"original_string": "private ToDoStore store;",
"type": "ToDoStore",
"var_name": "store"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/rest/ToDoAPI.java",
"identifier": "ToDoAPI",
"interface... | {
"body": "@PUT @Path(\"/{id}\")\n @Produces(\"application/json\")\n @Consumes(\"application/json\")\n public ToDo updateToDo(@PathParam(\"id\") String id, ToDo td) {\n if(id == null) {\n throw new WebApplicationException(\"Must supply an ID, for example /api/todos/123.\", \n Response.Status.B... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_45 | {
"fields": [],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/store/MongoStoreTest.java",
"identifier": "MongoStoreTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGetAll() {\n\t\tDBCollection coll = createMockCollection();\n\t\tDBCursor cursor = createMockCursor();\n\t\texpect(cursor.hasNext()).andAnswer(new IAnswer<Boolean>() {\n\t\t\tprivate int count = 0;\n\t\t\t@Override\n\t\t\tpublic Boolean answer() throws Throwable {\n\t\t\t\tcount++;... | {
"fields": [
{
"declarator": "coll",
"modifier": "private",
"original_string": "private DBCollection coll;",
"type": "DBCollection",
"var_name": "coll"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/store/MongoStore.java",
"identifier": "MongoStore",
... | {
"body": "@Override\n public Collection<ToDo> getAll() {\n List<ToDo> todos = new ArrayList<ToDo>();\n DBCursor cursor = coll.find();\n while(cursor.hasNext()) {\n todos.add(createToDo(cursor.next()));\n }\n cursor.close();\n return todos;\n }",
"class_method_signature": "MongoStore.getAll... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_53 | {
"fields": [
{
"declarator": "docs",
"modifier": "private",
"original_string": "private CloudantAllDocs docs;",
"type": "CloudantAllDocs",
"var_name": "docs"
},
{
"declarator": "rows",
"modifier": "private",
"original_string": "private List<CloudantRow> row... | {
"body": "@Test\n public void testPersist() throws Exception {\n IMocksControl control = createControl();\n Response resp = control.createMock(Response.class);\n expect(resp.getStatus()).andReturn(200).times(2);\n expect(resp.getStatus()).andReturn(201);\n CloudantPostResponse postResp = new Cloudant... | {
"fields": [
{
"declarator": "REVISION_PARAM = \"rev\"",
"modifier": "private static final",
"original_string": "private static final String REVISION_PARAM = \"rev\";",
"type": "String",
"var_name": "REVISION_PARAM"
},
{
"declarator": "DESIGN_DOC_NAME = \"todos\"",
... | {
"body": "@Override\n public ToDo persist(ToDo td) throws ToDoStoreException {\n Response newdoc = target.request(MediaType.APPLICATION_JSON).post(Entity.entity(td, MediaType.APPLICATION_JSON));\n int status = newdoc.getStatus();\n if(status == HttpURLConnection.HTTP_CREATED) {\n CloudantPostResponse ... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_52 | {
"fields": [
{
"declarator": "docs",
"modifier": "private",
"original_string": "private CloudantAllDocs docs;",
"type": "CloudantAllDocs",
"var_name": "docs"
},
{
"declarator": "rows",
"modifier": "private",
"original_string": "private List<CloudantRow> row... | {
"body": "@Test\n public void testGet() throws Exception {\n IMocksControl control = createControl();\n Response resp = control.createMock(Response.class);\n expect(resp.getStatus()).andReturn(200).times(3);\n Capture<Class<CloudantToDo>> classCapture = new Capture<Class<CloudantToDo>>();\n expect(re... | {
"fields": [
{
"declarator": "REVISION_PARAM = \"rev\"",
"modifier": "private static final",
"original_string": "private static final String REVISION_PARAM = \"rev\";",
"type": "String",
"var_name": "REVISION_PARAM"
},
{
"declarator": "DESIGN_DOC_NAME = \"todos\"",
... | {
"body": "@Override\n public ToDo get(String id) throws ToDoStoreException {\n Response docResp = getRequest(id);\n int status = docResp.getStatus();\n if(status == HttpURLConnection.HTTP_OK) {\n CloudantToDo td = docResp.readEntity(CloudantToDo.class); \n return td.getToDo();\n } else {\... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_44 | {
"fields": [
{
"declarator": "td1",
"modifier": "",
"original_string": "ToDo td1;",
"type": "ToDo",
"var_name": "td1"
},
{
"declarator": "td2",
"modifier": "",
"original_string": "ToDo td2;",
"type": "ToDo",
"var_name": "td2"
},
{
... | {
"body": "@Test\n\tpublic void testCount() throws Exception {\n\t assertEquals(0, emptyStore.count());\n\t assertEquals(2, populatedStore.count());\n\t}",
"class_method_signature": "InMemoryStoreTest.testCount()",
"constructor": false,
"full_signature": "@Test public void testCount()",
"identifier": "testC... | {
"fields": [
{
"declarator": "store",
"modifier": "private",
"original_string": "private Map<String, ToDo> store;",
"type": "Map<String, ToDo>",
"var_name": "store"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/store/InMemoryStore.java",
"identifier": ... | {
"body": "@Override\n public int count() throws ToDoStoreException {\n return store.size();\n }",
"class_method_signature": "InMemoryStore.count()",
"constructor": false,
"full_signature": "@Override public int count()",
"identifier": "count",
"invocations": [
"size"
],
"modifiers": "@Override... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_13 | {
"fields": [
{
"declarator": "td1",
"modifier": "private",
"original_string": "private ToDo td1;",
"type": "ToDo",
"var_name": "td1"
},
{
"declarator": "td2",
"modifier": "private",
"original_string": "private ToDo td2;",
"type": "ToDo",
"var_na... | {
"body": "@Test\n\tpublic void testUpdateToDoDoesNotExist() {\n\t\ttry{\n\t\t\tapi.updateToDo(\"123\", new ToDo());\n\t\t\tfail(\"Expected exception to be thrown.\");\n\t\t} catch(WebApplicationException e) {\n\t\t\tassertEquals(Response.Status.BAD_REQUEST.getStatusCode(), e.getResponse().getStatus());\n\t\t}\n\t}",... | {
"fields": [
{
"declarator": "store",
"modifier": "private",
"original_string": "private ToDoStore store;",
"type": "ToDoStore",
"var_name": "store"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/rest/ToDoAPI.java",
"identifier": "ToDoAPI",
"interface... | {
"body": "@PUT @Path(\"/{id}\")\n @Produces(\"application/json\")\n @Consumes(\"application/json\")\n public ToDo updateToDo(@PathParam(\"id\") String id, ToDo td) {\n if(id == null) {\n throw new WebApplicationException(\"Must supply an ID, for example /api/todos/123.\", \n Response.Status.B... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_6 | {
"fields": [
{
"declarator": "td1",
"modifier": "private",
"original_string": "private ToDo td1;",
"type": "ToDo",
"var_name": "td1"
},
{
"declarator": "td2",
"modifier": "private",
"original_string": "private ToDo td2;",
"type": "ToDo",
"var_na... | {
"body": "@Test\n\tpublic void testNewToDo() {\n\t\tToDo td = new ToDo();\n\t\ttd.setTitle(\"do a test\");\n\t\ttd = api.newToDo(td);\n\t\tassertNotNull(td.getId());\n\t\tCollection<ToDo> todos = api.getToDos();\n\t\tassertTrue(todos.contains(td1));\n\t\tassertTrue(todos.contains(td2));\n\t\tassertTrue(todos.contain... | {
"fields": [
{
"declarator": "store",
"modifier": "private",
"original_string": "private ToDoStore store;",
"type": "ToDoStore",
"var_name": "store"
}
],
"file": "java/bluemix-todo-app/src/main/java/net/bluemix/todo/rest/ToDoAPI.java",
"identifier": "ToDoAPI",
"interface... | {
"body": "@POST\n @Consumes(\"application/json\")\n @Produces(\"application/json\")\n public ToDo newToDo(ToDo td) {\n if(td == null) {\n throw new WebApplicationException(\"Must supply a ToDo in the POST body.\", \n Response.Status.BAD_REQUEST);\n }\n try {\n return store.persist(... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
19317653_29 | {
"fields": [],
"file": "java/bluemix-todo-app/src/test/java/net/bluemix/todo/model/ToDoTest.java",
"identifier": "ToDoTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGetTitle() {\n\t\tToDo td = new ToDo();\n\t\tassertEquals(\"\", td.getTitle());\n\t\ttd.setTitle(\"Pick up kids at 3\");\n\t\tassertEquals(\"Pick up kids at 3\", td.getTitle());\n\t}",
"class_method_signature": "ToDoTest.testGetTitle()",
"constructor": false,
"full_signature"... | {
"fields": [
{
"declarator": "completed",
"modifier": "private",
"original_string": "private boolean completed;",
"type": "boolean",
"var_name": "completed"
},
{
"declarator": "title",
"modifier": "private",
"original_string": "private String title;",
... | {
"body": "public String getTitle() {\n return title;\n }",
"class_method_signature": "ToDo.getTitle()",
"constructor": false,
"full_signature": "public String getTitle()",
"identifier": "getTitle",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "S... | {
"created": null,
"fork": null,
"fork_count": 305,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 19317653,
"size": 777,
"stargazer_count": 196,
"stars": null,
"updates": null,
"url": "https://github.com/IBM-Cloud/todo-apps"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.