id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
65041301_24 | {
"fields": [
{
"declarator": "networkResponseUT",
"modifier": "private",
"original_string": "private NetworkResponse networkResponseUT;",
"type": "NetworkResponse",
"var_name": "networkResponseUT"
}
],
"file": "app/src/test/java/app/data/foundation/net/NetworkResponseTest.ja... | {
"body": "@Test public void Verify_On_Error() {\n String jsonError = \"{\\\"message\\\":\\\"such a nice error\\\"}\";\n ResponseBody responseBody = ResponseBody\n .create(MediaType.parse(\"application/json\"), jsonError);\n\n TestObserver<MockModel> observer = Single\n .just(Response.<MockMode... | {
"fields": [
{
"declarator": "errorAdapter",
"modifier": "private final",
"original_string": "private final ErrorAdapter errorAdapter;",
"type": "ErrorAdapter",
"var_name": "errorAdapter"
}
],
"file": "app/src/main/java/app/data/foundation/net/NetworkResponse.java",
"ident... | {
"body": "public <T> SingleTransformer<Response<T>, T> process() {\n return oResponse -> oResponse\n .flatMap(response -> {\n if (response.isSuccessful()) return Single.just(response.body());\n try {\n String error = errorAdapter.adapt(response.errorBody().string());\n ... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 65041301,
"size": 273,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/VictorAlbertos/DirtyAndroid"
} |
65041301_12 | {
"fields": [
{
"declarator": "FORMATTED_ERROR = \"formatted_error\"",
"modifier": "private final static",
"original_string": "private final static String FORMATTED_ERROR = \"formatted_error\",\n SUCCESS_MESSAGE = \"success_message\";",
"type": "String",
"var_name": "FORMATTED_E... | {
"body": "@Test public void Verify_ReportOnToast_Success() {\n TestObserver<String> observer = Single.just(SUCCESS_MESSAGE)\n .compose(transformationsBehaviourUT.reportOnToast())\n .test();\n observer.awaitTerminalEvent();\n\n observer.assertNoErrors();\n observer.assertValueCount(1);\n ... | {
"fields": [
{
"declarator": "lifecycle",
"modifier": "private",
"original_string": "private SingleTransformer lifecycle;",
"type": "SingleTransformer",
"var_name": "lifecycle"
},
{
"declarator": "exceptionFormatter",
"modifier": "private final",
"original_... | {
"body": "public <T> SingleTransformer<T, T> reportOnToast() {\n return single -> single\n .<T>doOnError(throwable -> {\n Single<String> formattedError = exceptionFormatter.format(throwable);\n notifications.showToast(formattedError);\n })\n .<T>onErrorResumeNext(throwable -... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 65041301,
"size": 273,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/VictorAlbertos/DirtyAndroid"
} |
65041301_9 | {
"fields": [
{
"declarator": "FORMATTED_ERROR = \"formatted_error\"",
"modifier": "private final static",
"original_string": "private final static String FORMATTED_ERROR = \"formatted_error\",\n SUCCESS_MESSAGE = \"success_message\";",
"type": "String",
"var_name": "FORMATTED_E... | {
"body": "@Test public void Verify_Safely_Success() {\n TestObserver<String> observer = Single.just(SUCCESS_MESSAGE)\n .compose(transformationsBehaviourUT.safely())\n .test();\n\n observer.awaitTerminalEvent();\n\n observer.assertNoErrors();\n observer.assertValueCount(1);\n assertEquals... | {
"fields": [
{
"declarator": "lifecycle",
"modifier": "private",
"original_string": "private SingleTransformer lifecycle;",
"type": "SingleTransformer",
"var_name": "lifecycle"
},
{
"declarator": "exceptionFormatter",
"modifier": "private final",
"original_... | {
"body": "public <T> SingleTransformer<T, T> safely() {\n return single -> single\n .subscribeOn(backgroundThread)\n .<T>observeOn(mainThread)\n .<T>compose(lifecycle)\n .<T>onErrorResumeNext(error -> {\n if (error instanceof CancellationException) return Single.never();\n ... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 65041301,
"size": 273,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/VictorAlbertos/DirtyAndroid"
} |
65041301_8 | {
"fields": [
{
"declarator": "mockitoRule = MockitoJUnit.rule()",
"modifier": "@Rule public",
"original_string": "@Rule public MockitoRule mockitoRule = MockitoJUnit.rule();",
"type": "MockitoRule",
"var_name": "mockitoRule"
},
{
"declarator": "transformations = Mockit... | {
"body": "@Test public void Verify_OnBindView() {\n when(wireframe.dashboard()).thenReturn(Single.just(Ignore.Get));\n launchPresenterUT.onBindView(view);\n\n verify(wireframe).dashboard();\n }",
"class_method_signature": "LaunchPresenterTest.Verify_OnBindView()",
"constructor": false,
"full_signatur... | {
"fields": [
{
"declarator": "wireframe",
"modifier": "private final",
"original_string": "private final LaunchWireframe wireframe;",
"type": "LaunchWireframe",
"var_name": "wireframe"
}
],
"file": "app/src/main/java/app/presentation/sections/launch/LaunchPresenter.java",
... | {
"body": "@Override public void onBindView(ViewPresenter view) {\n super.onBindView(view);\n wireframe.dashboard()\n .compose(transformations.safely())\n .subscribe();\n }",
"class_method_signature": "LaunchPresenter.onBindView(ViewPresenter view)",
"constructor": false,
"full_signature": ... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 65041301,
"size": 273,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/VictorAlbertos/DirtyAndroid"
} |
65041301_13 | {
"fields": [
{
"declarator": "FORMATTED_ERROR = \"formatted_error\"",
"modifier": "private final static",
"original_string": "private final static String FORMATTED_ERROR = \"formatted_error\",\n SUCCESS_MESSAGE = \"success_message\";",
"type": "String",
"var_name": "FORMATTED_E... | {
"body": "@Test public void Verify_ReportOnToast_Error() {\n TestObserver<String> observer = Single.<String>error(new RuntimeException())\n .compose(transformationsBehaviourUT.reportOnToast())\n .test();\n\n observer.assertNoErrors();\n observer.assertNoValues();\n verify(exceptionFormatter... | {
"fields": [
{
"declarator": "lifecycle",
"modifier": "private",
"original_string": "private SingleTransformer lifecycle;",
"type": "SingleTransformer",
"var_name": "lifecycle"
},
{
"declarator": "exceptionFormatter",
"modifier": "private final",
"original_... | {
"body": "public <T> SingleTransformer<T, T> reportOnToast() {\n return single -> single\n .<T>doOnError(throwable -> {\n Single<String> formattedError = exceptionFormatter.format(throwable);\n notifications.showToast(formattedError);\n })\n .<T>onErrorResumeNext(throwable -... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 65041301,
"size": 273,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/VictorAlbertos/DirtyAndroid"
} |
65041301_4 | {
"fields": [
{
"declarator": "mockitoRule = MockitoJUnit.rule()",
"modifier": "@Rule public",
"original_string": "@Rule public MockitoRule mockitoRule = MockitoJUnit.rule();",
"type": "MockitoRule",
"var_name": "mockitoRule"
},
{
"declarator": "transformations = Mockit... | {
"body": "@Test public void Verify_OnBindView_With_Error_Response() {\n when(wireframe.getUserScreen())\n .thenReturn(Single.error(new RuntimeException()));\n userPresenterUT.onBindView(view);\n\n verify(transformations).safely();\n verify(transformations).loading();\n verify(transformations).r... | {
"fields": [
{
"declarator": "wireframe",
"modifier": "private final",
"original_string": "private final UsersWireframe wireframe;",
"type": "UsersWireframe",
"var_name": "wireframe"
}
],
"file": "app/src/main/java/app/presentation/sections/users/detail/UserPresenter.java",
... | {
"body": "@Override public void onBindView(View view) {\n super.onBindView(view);\n\n wireframe.getUserScreen()\n .compose(transformations.safely())\n .compose(transformations.loading())\n .compose(transformations.reportOnSnackBar())\n .subscribe(view::showUser);\n }",
"class_met... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 65041301,
"size": 273,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/VictorAlbertos/DirtyAndroid"
} |
65041301_14 | {
"fields": [
{
"declarator": "FORMATTED_ERROR = \"formatted_error\"",
"modifier": "private final static",
"original_string": "private final static String FORMATTED_ERROR = \"formatted_error\",\n SUCCESS_MESSAGE = \"success_message\";",
"type": "String",
"var_name": "FORMATTED_E... | {
"body": "@Test public void Verify_Loading() {\n TestObserver<String> observer = Single.just(SUCCESS_MESSAGE)\n .compose(transformationsBehaviourUT.loading())\n .test();\n\n observer.assertNoErrors();\n observer.assertValueCount(1);\n verify(dialogs).showLoading();\n verify(dialogs).hide... | {
"fields": [
{
"declarator": "lifecycle",
"modifier": "private",
"original_string": "private SingleTransformer lifecycle;",
"type": "SingleTransformer",
"var_name": "lifecycle"
},
{
"declarator": "exceptionFormatter",
"modifier": "private final",
"original_... | {
"body": "public <T> SingleTransformer<T, T> loading() {\n return single -> single\n .doOnSubscribe(disposable -> dialogs.showLoading())\n .doOnSuccess(_I -> dialogs.hideLoading())\n .doOnError(throwable -> dialogs.hideLoading());\n }",
"class_method_signature": "TransformationsBehaviour.l... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 65041301,
"size": 273,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/VictorAlbertos/DirtyAndroid"
} |
65041301_18 | {
"fields": [
{
"declarator": "mockitoRule = MockitoJUnit.rule()",
"modifier": "@Rule public",
"original_string": "@Rule public MockitoRule mockitoRule = MockitoJUnit.rule();",
"type": "MockitoRule",
"var_name": "mockitoRule"
},
{
"declarator": "testFolder = new Tempora... | {
"body": "@Test public void Verify_GetUsers_Failure() {\n mockApiForFailure();\n\n TestObserver<List<User>> observer = userRepositoryUT.getUsers(null, false).test();\n observer.awaitTerminalEvent();\n observer.assertError(CompositeException.class);\n observer.assertNoValues();\n }",
"class_method_s... | {
"fields": [
{
"declarator": "FIRST_DEFAULT_ID = 0",
"modifier": "private static final",
"original_string": "private static final int FIRST_DEFAULT_ID = 0, USERS_PER_PAGE = 50;",
"type": "int",
"var_name": "FIRST_DEFAULT_ID"
},
{
"declarator": "githubUsersApi",
"... | {
"body": "public Single<List<User>> getUsers(Integer lastIdQueried, final boolean refresh) {\n return getUsersReply(lastIdQueried, refresh)\n .map(Reply::getData);\n }",
"class_method_signature": "UserRepository.getUsers(Integer lastIdQueried, final boolean refresh)",
"constructor": false,
"full_sig... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 65041301,
"size": 273,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/VictorAlbertos/DirtyAndroid"
} |
65041301_3 | {
"fields": [
{
"declarator": "mockitoRule = MockitoJUnit.rule()",
"modifier": "@Rule public",
"original_string": "@Rule public MockitoRule mockitoRule = MockitoJUnit.rule();",
"type": "MockitoRule",
"var_name": "mockitoRule"
},
{
"declarator": "transformations = Mockit... | {
"body": "@Test public void Verify_OnBindView_With_Success_Response() {\n when(wireframe.getUserScreen())\n .thenReturn(Single.just(User.create(1, \"name\", \"avatar\")));\n userPresenterUT.onBindView(view);\n\n verify(transformations).safely();\n verify(transformations).loading();\n verify(tra... | {
"fields": [
{
"declarator": "wireframe",
"modifier": "private final",
"original_string": "private final UsersWireframe wireframe;",
"type": "UsersWireframe",
"var_name": "wireframe"
}
],
"file": "app/src/main/java/app/presentation/sections/users/detail/UserPresenter.java",
... | {
"body": "@Override public void onBindView(View view) {\n super.onBindView(view);\n\n wireframe.getUserScreen()\n .compose(transformations.safely())\n .compose(transformations.loading())\n .compose(transformations.reportOnSnackBar())\n .subscribe(view::showUser);\n }",
"class_met... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 65041301,
"size": 273,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/VictorAlbertos/DirtyAndroid"
} |
65041301_22 | {
"fields": [
{
"declarator": "errorAdapterUT",
"modifier": "private",
"original_string": "private ErrorAdapter errorAdapterUT;",
"type": "ErrorAdapter",
"var_name": "errorAdapterUT"
}
],
"file": "app/src/test/java/app/data/foundation/net/ErrorAdapterTest.java",
"identifier... | {
"body": "@Test public void Verify_Adapt() {\n String json = \"{\\\"message\\\":\\\"such a nice error\\\"}\";\n String prettified = errorAdapterUT.adapt(json);\n assertEquals(prettified, \"such a nice error\");\n }",
"class_method_signature": "ErrorAdapterTest.Verify_Adapt()",
"constructor": false,
"... | {
"fields": [
{
"declarator": "jolyglot",
"modifier": "private final",
"original_string": "private final JolyglotGenerics jolyglot;",
"type": "JolyglotGenerics",
"var_name": "jolyglot"
}
],
"file": "app/src/main/java/app/data/foundation/net/ErrorAdapter.java",
"identifier":... | {
"body": "@Override public String adapt(String json) {\n try {\n return jolyglot\n .fromJson(json, ResponseError.class)\n .message;\n } catch (JsonSyntaxException e) {\n return json;\n }\n }",
"class_method_signature": "ErrorAdapter.adapt(String json)",
"constructor": false,... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 65041301,
"size": 273,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/VictorAlbertos/DirtyAndroid"
} |
65041301_23 | {
"fields": [
{
"declarator": "networkResponseUT",
"modifier": "private",
"original_string": "private NetworkResponse networkResponseUT;",
"type": "NetworkResponse",
"var_name": "networkResponseUT"
}
],
"file": "app/src/test/java/app/data/foundation/net/NetworkResponseTest.ja... | {
"body": "@Test public void Verify_On_Success() {\n MockModel model = new MockModel();\n TestObserver<MockModel> observer = Single\n .just(Response.success(model))\n .compose(networkResponseUT.process())\n .test();\n\n observer.awaitTerminalEvent();\n observer.assertNoErrors();\n ... | {
"fields": [
{
"declarator": "errorAdapter",
"modifier": "private final",
"original_string": "private final ErrorAdapter errorAdapter;",
"type": "ErrorAdapter",
"var_name": "errorAdapter"
}
],
"file": "app/src/main/java/app/data/foundation/net/NetworkResponse.java",
"ident... | {
"body": "public <T> SingleTransformer<Response<T>, T> process() {\n return oResponse -> oResponse\n .flatMap(response -> {\n if (response.isSuccessful()) return Single.just(response.body());\n try {\n String error = errorAdapter.adapt(response.errorBody().string());\n ... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 65041301,
"size": 273,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/VictorAlbertos/DirtyAndroid"
} |
65041301_2 | {
"fields": [
{
"declarator": "USER_ID = 1",
"modifier": "private final static",
"original_string": "private final static int USER_ID = 1;",
"type": "int",
"var_name": "USER_ID"
},
{
"declarator": "mockitoRule = MockitoJUnit.rule()",
"modifier": "@Rule public",
... | {
"body": "@Test public void When_Call_OnBindView_Then_UserSelectedClicks_Is_Called() {\n usersPresenterUT.onBindView(view);\n\n verify(view).userSelectedClicks();\n }",
"class_method_signature": "UsersPresenterTest.When_Call_OnBindView_Then_UserSelectedClicks_Is_Called()",
"constructor": false,
"full_si... | {
"fields": [
{
"declarator": "repository",
"modifier": "private final",
"original_string": "private final UserRepository repository;",
"type": "UserRepository",
"var_name": "repository"
},
{
"declarator": "usersState",
"modifier": "@VisibleForTesting final",
... | {
"body": "@Override public void onBindView(View view) {\n super.onBindView(view);\n\n view.setUpLoaderPager(usersState, lastItem -> callback -> nextPage(lastItem, callback));\n\n view.setUpRefreshList(this::refreshList);\n\n view.userSelectedClicks()\n .flatMap(user -> wireframe.userScreen(user).t... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 65041301,
"size": 273,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/VictorAlbertos/DirtyAndroid"
} |
65041301_19 | {
"fields": [
{
"declarator": "mockitoRule = MockitoJUnit.rule()",
"modifier": "@Rule public",
"original_string": "@Rule public MockitoRule mockitoRule = MockitoJUnit.rule();",
"type": "MockitoRule",
"var_name": "mockitoRule"
},
{
"declarator": "testFolder = new Tempora... | {
"body": "@Test public void Verify_SearchByUserName_Success() {\n mockApiForSuccess();\n\n String username = \"username\";\n\n TestObserver<User> observer = userRepositoryUT.searchByUserName(username).test();\n observer.awaitTerminalEvent();\n observer.assertNoErrors();\n observer.assertValueCount(... | {
"fields": [
{
"declarator": "FIRST_DEFAULT_ID = 0",
"modifier": "private static final",
"original_string": "private static final int FIRST_DEFAULT_ID = 0, USERS_PER_PAGE = 50;",
"type": "int",
"var_name": "FIRST_DEFAULT_ID"
},
{
"declarator": "githubUsersApi",
"... | {
"body": "public Single<User> searchByUserName(final String username) {\n return githubUsersApi\n .getUserByName(username)\n .compose(networkResponse.process());\n }",
"class_method_signature": "UserRepository.searchByUserName(final String username)",
"constructor": false,
"full_signature": "... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 65041301,
"size": 273,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/VictorAlbertos/DirtyAndroid"
} |
65041301_15 | {
"fields": [
{
"declarator": "mockitoRule = MockitoJUnit.rule()",
"modifier": "@Rule public",
"original_string": "@Rule public MockitoRule mockitoRule = MockitoJUnit.rule();",
"type": "MockitoRule",
"var_name": "mockitoRule"
},
{
"declarator": "testFolder = new Tempora... | {
"body": "@Test public void Verify_GetUsers_With_LastIdQueried_Null() {\n mockApiForSuccess();\n\n TestObserver<List<User>> observer = userRepositoryUT.getUsers(null, false).test();\n observer.awaitTerminalEvent();\n observer.assertNoErrors();\n observer.assertValueCount(1);\n\n List<User> users = ... | {
"fields": [
{
"declarator": "FIRST_DEFAULT_ID = 0",
"modifier": "private static final",
"original_string": "private static final int FIRST_DEFAULT_ID = 0, USERS_PER_PAGE = 50;",
"type": "int",
"var_name": "FIRST_DEFAULT_ID"
},
{
"declarator": "githubUsersApi",
"... | {
"body": "public Single<List<User>> getUsers(Integer lastIdQueried, final boolean refresh) {\n return getUsersReply(lastIdQueried, refresh)\n .map(Reply::getData);\n }",
"class_method_signature": "UserRepository.getUsers(Integer lastIdQueried, final boolean refresh)",
"constructor": false,
"full_sig... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 65041301,
"size": 273,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/VictorAlbertos/DirtyAndroid"
} |
65041301_16 | {
"fields": [
{
"declarator": "mockitoRule = MockitoJUnit.rule()",
"modifier": "@Rule public",
"original_string": "@Rule public MockitoRule mockitoRule = MockitoJUnit.rule();",
"type": "MockitoRule",
"var_name": "mockitoRule"
},
{
"declarator": "testFolder = new Tempora... | {
"body": "@Test public void Verify_GetUsers_Success() {\n mockApiForSuccess();\n\n int id = 50;\n\n TestObserver<List<User>> observer = userRepositoryUT.getUsers(id, false).test();\n observer.awaitTerminalEvent();\n observer.assertNoErrors();\n observer.assertValueCount(1);\n\n List<User> users ... | {
"fields": [
{
"declarator": "FIRST_DEFAULT_ID = 0",
"modifier": "private static final",
"original_string": "private static final int FIRST_DEFAULT_ID = 0, USERS_PER_PAGE = 50;",
"type": "int",
"var_name": "FIRST_DEFAULT_ID"
},
{
"declarator": "githubUsersApi",
"... | {
"body": "public Single<List<User>> getUsers(Integer lastIdQueried, final boolean refresh) {\n return getUsersReply(lastIdQueried, refresh)\n .map(Reply::getData);\n }",
"class_method_signature": "UserRepository.getUsers(Integer lastIdQueried, final boolean refresh)",
"constructor": false,
"full_sig... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 65041301,
"size": 273,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/VictorAlbertos/DirtyAndroid"
} |
65041301_20 | {
"fields": [
{
"declarator": "mockitoRule = MockitoJUnit.rule()",
"modifier": "@Rule public",
"original_string": "@Rule public MockitoRule mockitoRule = MockitoJUnit.rule();",
"type": "MockitoRule",
"var_name": "mockitoRule"
},
{
"declarator": "testFolder = new Tempora... | {
"body": "@Test public void Verify_SearchByUserName_Failure() {\n mockApiForFailure();\n\n TestObserver<User> observer = userRepositoryUT.searchByUserName(\"don't care\").test();\n observer.awaitTerminalEvent();\n observer.assertError(IOException.class);\n observer.assertNoValues();\n\n Throwable e... | {
"fields": [
{
"declarator": "FIRST_DEFAULT_ID = 0",
"modifier": "private static final",
"original_string": "private static final int FIRST_DEFAULT_ID = 0, USERS_PER_PAGE = 50;",
"type": "int",
"var_name": "FIRST_DEFAULT_ID"
},
{
"declarator": "githubUsersApi",
"... | {
"body": "public Single<User> searchByUserName(final String username) {\n return githubUsersApi\n .getUserByName(username)\n .compose(networkResponse.process());\n }",
"class_method_signature": "UserRepository.searchByUserName(final String username)",
"constructor": false,
"full_signature": "... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 65041301,
"size": 273,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/VictorAlbertos/DirtyAndroid"
} |
65041301_1 | {
"fields": [
{
"declarator": "USER_ID = 1",
"modifier": "private final static",
"original_string": "private final static int USER_ID = 1;",
"type": "int",
"var_name": "USER_ID"
},
{
"declarator": "mockitoRule = MockitoJUnit.rule()",
"modifier": "@Rule public",
... | {
"body": "@Test public void When_Call_OnBindView_Then_SetUpRefreshList_Is_Called() {\n usersPresenterUT.onBindView(view);\n\n verify(view).setUpRefreshList(any());\n }",
"class_method_signature": "UsersPresenterTest.When_Call_OnBindView_Then_SetUpRefreshList_Is_Called()",
"constructor": false,
"full_sig... | {
"fields": [
{
"declarator": "repository",
"modifier": "private final",
"original_string": "private final UserRepository repository;",
"type": "UserRepository",
"var_name": "repository"
},
{
"declarator": "usersState",
"modifier": "@VisibleForTesting final",
... | {
"body": "@Override public void onBindView(View view) {\n super.onBindView(view);\n\n view.setUpLoaderPager(usersState, lastItem -> callback -> nextPage(lastItem, callback));\n\n view.setUpRefreshList(this::refreshList);\n\n view.userSelectedClicks()\n .flatMap(user -> wireframe.userScreen(user).t... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 65041301,
"size": 273,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/VictorAlbertos/DirtyAndroid"
} |
65041301_0 | {
"fields": [
{
"declarator": "USER_ID = 1",
"modifier": "private final static",
"original_string": "private final static int USER_ID = 1;",
"type": "int",
"var_name": "USER_ID"
},
{
"declarator": "mockitoRule = MockitoJUnit.rule()",
"modifier": "@Rule public",
... | {
"body": "@Test public void When_Call_OnBindView_Then_SetUpLoaderPager_Is_Called() {\n usersPresenterUT.onBindView(view);\n\n verify(view).setUpLoaderPager(any(), any());\n }",
"class_method_signature": "UsersPresenterTest.When_Call_OnBindView_Then_SetUpLoaderPager_Is_Called()",
"constructor": false,
"f... | {
"fields": [
{
"declarator": "repository",
"modifier": "private final",
"original_string": "private final UserRepository repository;",
"type": "UserRepository",
"var_name": "repository"
},
{
"declarator": "usersState",
"modifier": "@VisibleForTesting final",
... | {
"body": "@Override public void onBindView(View view) {\n super.onBindView(view);\n\n view.setUpLoaderPager(usersState, lastItem -> callback -> nextPage(lastItem, callback));\n\n view.setUpRefreshList(this::refreshList);\n\n view.userSelectedClicks()\n .flatMap(user -> wireframe.userScreen(user).t... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 65041301,
"size": 273,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/VictorAlbertos/DirtyAndroid"
} |
65041301_21 | {
"fields": [
{
"declarator": "testFolder = new TemporaryFolder()",
"modifier": "@Rule public",
"original_string": "@Rule public TemporaryFolder testFolder = new TemporaryFolder();",
"type": "TemporaryFolder",
"var_name": "testFolder"
},
{
"declarator": "wireframeReposi... | {
"body": "@Test public void Verify_Get_Failure() {\n TestObserver<MockModel> observer = wireframeRepositoryUT.<MockModel>get(KEY).test();\n observer.awaitTerminalEvent(1, TimeUnit.SECONDS);\n observer.assertNoValues();\n\n Throwable error = observer.errors().get(0);\n assertEquals(error.getMessage(),\... | {
"fields": [
{
"declarator": "cacheProvider",
"modifier": "private final",
"original_string": "private final ProviderGroup cacheProvider;",
"type": "ProviderGroup",
"var_name": "cacheProvider"
}
],
"file": "app/src/main/java/app/data/foundation/WireframeRepository.java",
"... | {
"body": "@SuppressWarnings(\"unchecked\")\n public <T> Single<T> get(String key) {\n return cacheProvider\n .read(key)\n .onErrorResumeNext(error -> {\n String message = String\n .format(\"There is not cached data in wireframe repository for key %s\", key);\n return ... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 65041301,
"size": 273,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/VictorAlbertos/DirtyAndroid"
} |
65041301_17 | {
"fields": [
{
"declarator": "mockitoRule = MockitoJUnit.rule()",
"modifier": "@Rule public",
"original_string": "@Rule public MockitoRule mockitoRule = MockitoJUnit.rule();",
"type": "MockitoRule",
"var_name": "mockitoRule"
},
{
"declarator": "testFolder = new Tempora... | {
"body": "@Test public void Verify_GetUsers_Refresh() {\n mockApiForSuccess();\n\n TestObserver<Reply<List<User>>> observer1 = userRepositoryUT.getUsersReply(null, false).test();\n observer1.awaitTerminalEvent();\n\n assertEquals(Source.CLOUD,\n observer1.values().get(0).getSource());\n\n TestO... | {
"fields": [
{
"declarator": "FIRST_DEFAULT_ID = 0",
"modifier": "private static final",
"original_string": "private static final int FIRST_DEFAULT_ID = 0, USERS_PER_PAGE = 50;",
"type": "int",
"var_name": "FIRST_DEFAULT_ID"
},
{
"declarator": "githubUsersApi",
"... | {
"body": "@VisibleForTesting\n Single<Reply<List<User>>> getUsersReply(Integer lastIdQueried, final boolean refresh) {\n int safeId = lastIdQueried == null ? FIRST_DEFAULT_ID : lastIdQueried;\n\n Single<List<User>> apiCall = githubUsersApi\n .getUsers(safeId, USERS_PER_PAGE)\n .compose(networkRe... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 65041301,
"size": 273,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/VictorAlbertos/DirtyAndroid"
} |
65041301_7 | {
"fields": [
{
"declarator": "mockitoRule = MockitoJUnit.rule()",
"modifier": "@Rule public",
"original_string": "@Rule public MockitoRule mockitoRule = MockitoJUnit.rule();",
"type": "MockitoRule",
"var_name": "mockitoRule"
},
{
"declarator": "transformations = Mockit... | {
"body": "@Test public void Verify_OnBindView_With_Current_Fragment() {\n dashboardPresenterUT.onBindView(view);\n\n verify(view).clicksItemSelected();\n verify(view).replaceFragment(any(FragmentsManager.class), any());\n }",
"class_method_signature": "DashboardPresenterTest.Verify_OnBindView_With_Curren... | {
"fields": [
{
"declarator": "fragmentsManager",
"modifier": "private final",
"original_string": "private final FragmentsManager fragmentsManager;",
"type": "FragmentsManager",
"var_name": "fragmentsManager"
},
{
"declarator": "ITEMS_MENU",
"modifier": "private s... | {
"body": "@Override public void onBindView(View view) {\n super.onBindView(view);\n\n replaceDrawerFragment(R.id.drawer_users);\n\n view.clicksItemSelected()\n .subscribe(menuItem -> {\n replaceDrawerFragment(menuItem.getItemId());\n view.closeDrawer();\n });\n }",
"class_... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 65041301,
"size": 273,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/VictorAlbertos/DirtyAndroid"
} |
65041301_10 | {
"fields": [
{
"declarator": "FORMATTED_ERROR = \"formatted_error\"",
"modifier": "private final static",
"original_string": "private final static String FORMATTED_ERROR = \"formatted_error\",\n SUCCESS_MESSAGE = \"success_message\";",
"type": "String",
"var_name": "FORMATTED_E... | {
"body": "@Test public void Verify_ReportOnSnackBar_Success() {\n TestObserver<String> observer = Single.just(SUCCESS_MESSAGE)\n .compose(transformationsBehaviourUT.reportOnSnackBar())\n .test();\n\n observer.awaitTerminalEvent();\n\n observer.assertNoErrors();\n observer.assertValueCount(1... | {
"fields": [
{
"declarator": "lifecycle",
"modifier": "private",
"original_string": "private SingleTransformer lifecycle;",
"type": "SingleTransformer",
"var_name": "lifecycle"
},
{
"declarator": "exceptionFormatter",
"modifier": "private final",
"original_... | {
"body": "public <T> SingleTransformer<T, T> reportOnSnackBar() {\n return single -> single\n .<T>doOnError(throwable -> {\n Single<String> formattedError = exceptionFormatter.format(throwable);\n notifications.showSnackBar(formattedError);\n })\n .<T>onErrorResumeNext(error... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 65041301,
"size": 273,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/VictorAlbertos/DirtyAndroid"
} |
65041301_11 | {
"fields": [
{
"declarator": "FORMATTED_ERROR = \"formatted_error\"",
"modifier": "private final static",
"original_string": "private final static String FORMATTED_ERROR = \"formatted_error\",\n SUCCESS_MESSAGE = \"success_message\";",
"type": "String",
"var_name": "FORMATTED_E... | {
"body": "@Test public void Verify_ReportOnSnackBar_Error() {\n TestObserver<String> observer = Single.<String>error(new RuntimeException())\n .compose(transformationsBehaviourUT.reportOnSnackBar())\n .test();\n\n observer.assertNoErrors();\n observer.assertNoValues();\n verify(exceptionFor... | {
"fields": [
{
"declarator": "lifecycle",
"modifier": "private",
"original_string": "private SingleTransformer lifecycle;",
"type": "SingleTransformer",
"var_name": "lifecycle"
},
{
"declarator": "exceptionFormatter",
"modifier": "private final",
"original_... | {
"body": "public <T> SingleTransformer<T, T> reportOnSnackBar() {\n return single -> single\n .<T>doOnError(throwable -> {\n Single<String> formattedError = exceptionFormatter.format(throwable);\n notifications.showSnackBar(formattedError);\n })\n .<T>onErrorResumeNext(error... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 65041301,
"size": 273,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/VictorAlbertos/DirtyAndroid"
} |
65041301_6 | {
"fields": [
{
"declarator": "mockitoRule = MockitoJUnit.rule()",
"modifier": "@Rule public",
"original_string": "@Rule public MockitoRule mockitoRule = MockitoJUnit.rule();",
"type": "MockitoRule",
"var_name": "mockitoRule"
},
{
"declarator": "transformations = Mockit... | {
"body": "@Test public void Verify_OnBindView() {\n dashboardPresenterUT.onBindView(view);\n\n verify(view).clicksItemSelected();\n verify(view).replaceFragment(any(FragmentsManager.class), any());\n }",
"class_method_signature": "DashboardPresenterTest.Verify_OnBindView()",
"constructor": false,
"fu... | {
"fields": [
{
"declarator": "fragmentsManager",
"modifier": "private final",
"original_string": "private final FragmentsManager fragmentsManager;",
"type": "FragmentsManager",
"var_name": "fragmentsManager"
},
{
"declarator": "ITEMS_MENU",
"modifier": "private s... | {
"body": "@Override public void onBindView(View view) {\n super.onBindView(view);\n\n replaceDrawerFragment(R.id.drawer_users);\n\n view.clicksItemSelected()\n .subscribe(menuItem -> {\n replaceDrawerFragment(menuItem.getItemId());\n view.closeDrawer();\n });\n }",
"class_... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 65041301,
"size": 273,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/VictorAlbertos/DirtyAndroid"
} |
164049286_6 | {
"fields": [
{
"declarator": "groupService",
"modifier": "@Resource\n private",
"original_string": "@Resource\n private GroupService groupService;",
"type": "GroupService",
"var_name": "groupService"
}
],
"file": "him-api/src/test/java/com/lmxdawn/him/api/service/group... | {
"body": "@Test\n public void deleteByGroupId() {\n\n }",
"class_method_signature": "GroupServiceImplTest.deleteByGroupId()",
"constructor": false,
"full_signature": "@Test public void deleteByGroupId()",
"identifier": "deleteByGroupId",
"invocations": [],
"modifiers": "@Test public",
"parameters... | {
"fields": [
{
"declarator": "groupDao",
"modifier": "@Resource\n private",
"original_string": "@Resource\n private GroupDao groupDao;",
"type": "GroupDao",
"var_name": "groupDao"
}
],
"file": "him-api/src/main/java/com/lmxdawn/him/api/service/group/impl/GroupServiceIm... | {
"body": "@Override\n public boolean deleteByGroupId(Long groupId) {\n return groupDao.deleteByGroupId(groupId);\n }",
"class_method_signature": "GroupServiceImpl.deleteByGroupId(Long groupId)",
"constructor": false,
"full_signature": "@Override public boolean deleteByGroupId(Long groupId)",
"id... | {
"created": null,
"fork": null,
"fork_count": 29,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 164049286,
"size": 335,
"stargazer_count": 153,
"stars": null,
"updates": null,
"url": "https://github.com/lmxdawn/him-netty"
} |
164049286_0 | {
"fields": [
{
"declarator": "userFriendService",
"modifier": "@Resource\n private",
"original_string": "@Resource\n private UserFriendService userFriendService;",
"type": "UserFriendService",
"var_name": "userFriendService"
}
],
"file": "him-api/src/test/java/com/lmxd... | {
"body": "@Test\n public void listByUid() {\n\n\n }",
"class_method_signature": "UserFriendServiceImplTest.listByUid()",
"constructor": false,
"full_signature": "@Test public void listByUid()",
"identifier": "listByUid",
"invocations": [],
"modifiers": "@Test public",
"parameters": "()",
"retur... | {
"fields": [
{
"declarator": "userFriendDao",
"modifier": "@Resource\n private",
"original_string": "@Resource\n private UserFriendDao userFriendDao;",
"type": "UserFriendDao",
"var_name": "userFriendDao"
}
],
"file": "him-api/src/main/java/com/lmxdawn/him/api/service/... | {
"body": "@Override\n public List<UserFriend> listByUid(Long uid, Integer page, Integer limit) {\n Integer offset = PageUtils.createOffset(page, limit);\n return userFriendDao.listByUid(uid, offset, limit);\n }",
"class_method_signature": "UserFriendServiceImpl.listByUid(Long uid, Integer page,... | {
"created": null,
"fork": null,
"fork_count": 29,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 164049286,
"size": 335,
"stargazer_count": 153,
"stars": null,
"updates": null,
"url": "https://github.com/lmxdawn/him-netty"
} |
164049286_1 | {
"fields": [
{
"declarator": "userFriendService",
"modifier": "@Resource\n private",
"original_string": "@Resource\n private UserFriendService userFriendService;",
"type": "UserFriendService",
"var_name": "userFriendService"
}
],
"file": "him-api/src/test/java/com/lmxd... | {
"body": "@Test\n public void updateUserFriend() {\n }",
"class_method_signature": "UserFriendServiceImplTest.updateUserFriend()",
"constructor": false,
"full_signature": "@Test public void updateUserFriend()",
"identifier": "updateUserFriend",
"invocations": [],
"modifiers": "@Test public",
"par... | {
"fields": [
{
"declarator": "userFriendDao",
"modifier": "@Resource\n private",
"original_string": "@Resource\n private UserFriendDao userFriendDao;",
"type": "UserFriendDao",
"var_name": "userFriendDao"
}
],
"file": "him-api/src/main/java/com/lmxdawn/him/api/service/... | {
"body": "@Override\n public boolean updateUserFriend(UserFriend userFriend) {\n userFriend.setModifiedTime(new Date());\n return userFriendDao.updateUserFriend(userFriend);\n }",
"class_method_signature": "UserFriendServiceImpl.updateUserFriend(UserFriend userFriend)",
"constructor": false,
... | {
"created": null,
"fork": null,
"fork_count": 29,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 164049286,
"size": 335,
"stargazer_count": 153,
"stars": null,
"updates": null,
"url": "https://github.com/lmxdawn/him-netty"
} |
164049286_2 | {
"fields": [
{
"declarator": "groupService",
"modifier": "@Resource\n private",
"original_string": "@Resource\n private GroupService groupService;",
"type": "GroupService",
"var_name": "groupService"
}
],
"file": "him-api/src/test/java/com/lmxdawn/him/api/service/group... | {
"body": "@Test\n public void findByGroupId() {\n\n }",
"class_method_signature": "GroupServiceImplTest.findByGroupId()",
"constructor": false,
"full_signature": "@Test public void findByGroupId()",
"identifier": "findByGroupId",
"invocations": [],
"modifiers": "@Test public",
"parameters": "()",... | {
"fields": [
{
"declarator": "groupDao",
"modifier": "@Resource\n private",
"original_string": "@Resource\n private GroupDao groupDao;",
"type": "GroupDao",
"var_name": "groupDao"
}
],
"file": "him-api/src/main/java/com/lmxdawn/him/api/service/group/impl/GroupServiceIm... | {
"body": "@Override\n public Group findByGroupId(Long groupId) {\n return groupDao.findByGroupId(groupId);\n }",
"class_method_signature": "GroupServiceImpl.findByGroupId(Long groupId)",
"constructor": false,
"full_signature": "@Override public Group findByGroupId(Long groupId)",
"identifier": "... | {
"created": null,
"fork": null,
"fork_count": 29,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 164049286,
"size": 335,
"stargazer_count": 153,
"stars": null,
"updates": null,
"url": "https://github.com/lmxdawn/him-netty"
} |
164049286_3 | {
"fields": [
{
"declarator": "groupService",
"modifier": "@Resource\n private",
"original_string": "@Resource\n private GroupService groupService;",
"type": "GroupService",
"var_name": "groupService"
}
],
"file": "him-api/src/test/java/com/lmxdawn/him/api/service/group... | {
"body": "@Test\n public void listByGroupIdIn() {\n\n }",
"class_method_signature": "GroupServiceImplTest.listByGroupIdIn()",
"constructor": false,
"full_signature": "@Test public void listByGroupIdIn()",
"identifier": "listByGroupIdIn",
"invocations": [],
"modifiers": "@Test public",
"parameters... | {
"fields": [
{
"declarator": "groupDao",
"modifier": "@Resource\n private",
"original_string": "@Resource\n private GroupDao groupDao;",
"type": "GroupDao",
"var_name": "groupDao"
}
],
"file": "him-api/src/main/java/com/lmxdawn/him/api/service/group/impl/GroupServiceIm... | {
"body": "@Override\n public Map<Long, Group> listByGroupIdIn(List<Long> groupIds) {\n Map<Long, Group> groupMaps = new HashMap<>();\n List<Group> groupList = groupDao.listByGroupIdIn(groupIds);\n groupList.forEach(v -> {\n groupMaps.put(v.getGroupId(), v);\n });\n re... | {
"created": null,
"fork": null,
"fork_count": 29,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 164049286,
"size": 335,
"stargazer_count": 153,
"stars": null,
"updates": null,
"url": "https://github.com/lmxdawn/him-netty"
} |
164049286_4 | {
"fields": [
{
"declarator": "groupService",
"modifier": "@Resource\n private",
"original_string": "@Resource\n private GroupService groupService;",
"type": "GroupService",
"var_name": "groupService"
}
],
"file": "him-api/src/test/java/com/lmxdawn/him/api/service/group... | {
"body": "@Test\n public void insertGroup() {\n\n\n }",
"class_method_signature": "GroupServiceImplTest.insertGroup()",
"constructor": false,
"full_signature": "@Test public void insertGroup()",
"identifier": "insertGroup",
"invocations": [],
"modifiers": "@Test public",
"parameters": "()",
"re... | {
"fields": [
{
"declarator": "groupDao",
"modifier": "@Resource\n private",
"original_string": "@Resource\n private GroupDao groupDao;",
"type": "GroupDao",
"var_name": "groupDao"
}
],
"file": "him-api/src/main/java/com/lmxdawn/him/api/service/group/impl/GroupServiceIm... | {
"body": "@Override\n public boolean insertGroup(Group group) {\n group.setCreateTime(new Date());\n group.setModifiedTime(new Date());\n return groupDao.insertGroup(group);\n }",
"class_method_signature": "GroupServiceImpl.insertGroup(Group group)",
"constructor": false,
"full_signa... | {
"created": null,
"fork": null,
"fork_count": 29,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 164049286,
"size": 335,
"stargazer_count": 153,
"stars": null,
"updates": null,
"url": "https://github.com/lmxdawn/him-netty"
} |
164049286_5 | {
"fields": [
{
"declarator": "groupService",
"modifier": "@Resource\n private",
"original_string": "@Resource\n private GroupService groupService;",
"type": "GroupService",
"var_name": "groupService"
}
],
"file": "him-api/src/test/java/com/lmxdawn/him/api/service/group... | {
"body": "@Test\n public void updateGroup() {\n\n }",
"class_method_signature": "GroupServiceImplTest.updateGroup()",
"constructor": false,
"full_signature": "@Test public void updateGroup()",
"identifier": "updateGroup",
"invocations": [],
"modifiers": "@Test public",
"parameters": "()",
"retu... | {
"fields": [
{
"declarator": "groupDao",
"modifier": "@Resource\n private",
"original_string": "@Resource\n private GroupDao groupDao;",
"type": "GroupDao",
"var_name": "groupDao"
}
],
"file": "him-api/src/main/java/com/lmxdawn/him/api/service/group/impl/GroupServiceIm... | {
"body": "@Override\n public boolean updateGroup(Group group) {\n group.setModifiedTime(new Date());\n return groupDao.updateGroup(group);\n }",
"class_method_signature": "GroupServiceImpl.updateGroup(Group group)",
"constructor": false,
"full_signature": "@Override public boolean updateGro... | {
"created": null,
"fork": null,
"fork_count": 29,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 164049286,
"size": 335,
"stargazer_count": 153,
"stars": null,
"updates": null,
"url": "https://github.com/lmxdawn/him-netty"
} |
118799500_2 | {
"fields": [],
"file": "metacat-index/src/test/java/edu/ucsb/nceas/metacat/index/annotation/OntologyModelServiceTest.java",
"identifier": "OntologyModelServiceTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testOntologyModelService() throws Exception {\n OntologyModelService service = OntologyModelService.getInstance();\n\n System.out.println(\"FOOBAR: \" + service.getClass().getName());\n List<ISolrDataField> fieldList = service.getFieldList();\n assertEqual... | {
"fields": [
{
"declarator": "log = Logger.getLogger(OntologyModelService.class)",
"modifier": "private static",
"original_string": "private static Logger log = Logger.getLogger(OntologyModelService.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "inst... | {
"body": "private OntologyModelService() {\n }",
"class_method_signature": "OntologyModelService.OntologyModelService()",
"constructor": true,
"full_signature": "private OntologyModelService()",
"identifier": "OntologyModelService",
"invocations": [],
"modifiers": "private",
"parameters": "()",
"... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 118799500,
"size": 144769,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/NCEAS/metacat"
} |
118799500_3 | {
"fields": [
{
"declarator": "NAMESPACE1=\"http://www.w3.org/TR/rdf-syntax-grammar\"",
"modifier": "private static final",
"original_string": "private static final String NAMESPACE1=\"http://www.w3.org/TR/rdf-syntax-grammar\";",
"type": "String",
"var_name": "NAMESPACE1"
},
... | {
"body": "@Test\n public void testIsResourceMap() throws Exception {\n \tassertTrue(NAMESPACE1+\"should be a namespace of the resource map document \", ResourceMapNamespaces.isResourceMap(NAMESPACE1));\n \tassertTrue(NAMESPACE2+\"should be a namespace of the resource map document \", ResourceMapNamespaces.i... | {
"fields": [
{
"declarator": "RESOURCEMAPPROPERYNAME = \"index.resourcemap.namespace\"",
"modifier": "private static final",
"original_string": "private static final String RESOURCEMAPPROPERYNAME = \"index.resourcemap.namespace\";",
"type": "String",
"var_name": "RESOURCEMAPPROPERYN... | {
"body": "public static boolean isResourceMap(String namespace) {\n\t \tboolean is = false;\n\t \tif(namespace != null && !namespace.trim().equals(\"\")) {\n\t \t\tgetNamespaces();\n\t\t \tif(resourceMapNamespaces != null && resourceMapNamespaces.contains(namespace)) {\n\t\t \t\tis = true;\n\t\t \t... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 118799500,
"size": 144769,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/NCEAS/metacat"
} |
118799500_8 | {
"fields": [],
"file": "metacat-common/src/test/java/edu/ucsb/nceas/metacat/common/query/SolrQueryServiceControllerTest.java",
"identifier": "SolrQueryServiceControllerTest",
"interfaces": "",
"superclass": "extends MetacatCommonTestBase"
} | {
"body": "@Test\n public void testgetIndexSchemaFields() throws Exception {\n Map<String, SchemaField> fields = SolrQueryServiceController.getInstance().getIndexSchemaFields();\n assertTrue(fields != null);\n assertTrue(\"The number of index schema fields should be 160 rather than \"+fields.size... | {
"fields": [
{
"declarator": "controller = null",
"modifier": "private static",
"original_string": "private static SolrQueryServiceController controller = null;",
"type": "SolrQueryServiceController",
"var_name": "controller"
},
{
"declarator": "isEmbeddedSolrServer = ... | {
"body": "public Map<String, SchemaField> getIndexSchemaFields() throws MalformedURLException, ParserConfigurationException, IOException, SAXException {\n if(isEmbeddedSolrServer) {\n return embeddedQueryService.getIndexSchemaFields();\n } else {\n return httpQueryService.getInd... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 118799500,
"size": 144769,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/NCEAS/metacat"
} |
118799500_4 | {
"fields": [],
"file": "metacat-common/src/test/java/edu/ucsb/nceas/metacat/common/query/SolrQueryResponseWriterFactoryTest.java",
"identifier": "SolrQueryResponseWriterFactoryTest",
"interfaces": "",
"superclass": "extends MetacatCommonTestBase"
} | {
"body": "@Test\n public void testGenerateResponseWriter() throws Exception {\n QueryResponseWriter writer = SolrQueryResponseWriterFactory.generateResponseWriter(null);\n assertTrue(writer instanceof XMLResponseWriter);\n writer = SolrQueryResponseWriterFactory.generateResponseWriter(SolrQue... | {
"fields": [
{
"declarator": "XML = \"xml\"",
"modifier": "public static final",
"original_string": "public static final String XML = \"xml\";",
"type": "String",
"var_name": "XML"
},
{
"declarator": "JSON = \"json\"",
"modifier": "public static final",
"or... | {
"body": "public static QueryResponseWriter generateResponseWriter(String wt) throws SolrServerException {\n QueryResponseWriter writer = null;\n if(wt == null || wt.trim().equals(\"\") || wt.equals(XML)) {\n writer = new XMLResponseWriter();\n } else if(wt.equals(JSON)) {\n ... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 118799500,
"size": 144769,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/NCEAS/metacat"
} |
118799500_5 | {
"fields": [],
"file": "metacat-common/src/test/java/edu/ucsb/nceas/metacat/common/query/SolrQueryResponseWriterFactoryTest.java",
"identifier": "SolrQueryResponseWriterFactoryTest",
"interfaces": "",
"superclass": "extends MetacatCommonTestBase"
} | {
"body": "@Test\n public void testGetContentType() throws Exception {\n String contentType = SolrQueryResponseWriterFactory.getContentType(SolrQueryResponseWriterFactory.XML);\n assertTrue(contentType.equals(\"text/xml\"));\n contentType = SolrQueryResponseWriterFactory.getContentType(SolrQue... | {
"fields": [
{
"declarator": "XML = \"xml\"",
"modifier": "public static final",
"original_string": "public static final String XML = \"xml\";",
"type": "String",
"var_name": "XML"
},
{
"declarator": "JSON = \"json\"",
"modifier": "public static final",
"or... | {
"body": "public static String getContentType(String wt) {\n\t\tString contentType = null;\n\t\tif (wt == null || wt.trim().equals(\"\") || wt.equals(XML)) {\n\t\t\tcontentType = \"text/xml\";\n\t\t} else if (wt.equals(JSON)) {\n\t\t\tcontentType = \"text/json\";\n\t\t} else if (wt.equals(PYTHON)) {\n\t\t\tcontentTy... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 118799500,
"size": 144769,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/NCEAS/metacat"
} |
118799500_9 | {
"fields": [],
"file": "metacat-common/src/test/java/edu/ucsb/nceas/metacat/common/query/SolrQueryServiceControllerTest.java",
"identifier": "SolrQueryServiceControllerTest",
"interfaces": "",
"superclass": "extends MetacatCommonTestBase"
} | {
"body": "@Test\n public void testQuery() throws Exception {\n String query = \"q=*:*\";\n SolrParams solrParams = SolrRequestParsers.parseQueryString(query);\n InputStream input = SolrQueryServiceController.getInstance().query(solrParams, null, SolrRequest.METHOD.GET);\n assertTrue(in... | {
"fields": [
{
"declarator": "controller = null",
"modifier": "private static",
"original_string": "private static SolrQueryServiceController controller = null;",
"type": "SolrQueryServiceController",
"var_name": "controller"
},
{
"declarator": "isEmbeddedSolrServer = ... | {
"body": "public InputStream query(SolrParams params,Set<Subject> subjects, SolrRequest.METHOD method) throws NotImplemented, NotFound, IOException, UnsupportedType, ParserConfigurationException, SAXException, SolrServerException {\n if(isEmbeddedSolrServer) {\n return embeddedQueryService.query(p... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 118799500,
"size": 144769,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/NCEAS/metacat"
} |
118799500_6 | {
"fields": [],
"file": "metacat-common/src/test/java/edu/ucsb/nceas/metacat/common/query/SolrQueryResponseTransformerTest.java",
"identifier": "SolrQueryResponseTransformerTest",
"interfaces": "",
"superclass": "extends MetacatCommonTestBase"
} | {
"body": "@Test\n public void testTransformResults() throws Exception {\n \n SolrClient solrServer = SolrServerFactory.createSolrServer();\n CoreContainer coreContainer = SolrServerFactory.getCoreContainer();\n String collectionName = SolrServerFactory.getCollectionName();\n Sol... | {
"fields": [
{
"declarator": "core = null",
"modifier": "private",
"original_string": "private SolrCore core = null;",
"type": "SolrCore",
"var_name": "core"
}
],
"file": "metacat-common/src/main/java/edu/ucsb/nceas/metacat/common/query/SolrQueryResponseTransformer.java",
... | {
"body": "public InputStream transformResults(SolrParams request, QueryResponse response, String wt) throws SolrServerException, IOException {\n //InputStream stream = null;\n QueryResponseWriter writer = SolrQueryResponseWriterFactory.generateResponseWriter(wt);\n Writer results = new StringWri... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 118799500,
"size": 144769,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/NCEAS/metacat"
} |
118799500_7 | {
"fields": [],
"file": "metacat-common/src/test/java/edu/ucsb/nceas/metacat/common/query/SolrQueryServiceControllerTest.java",
"identifier": "SolrQueryServiceControllerTest",
"interfaces": "",
"superclass": "extends MetacatCommonTestBase"
} | {
"body": "@Test\n public void testGetSolrSpecVersion() throws UnsupportedType, NotFound, ParserConfigurationException, IOException, SAXException {\n String version = SolrQueryServiceController.getInstance().getSolrSpecVersion();\n //System.out.println(\"version is ======================== \"+version... | {
"fields": [
{
"declarator": "controller = null",
"modifier": "private static",
"original_string": "private static SolrQueryServiceController controller = null;",
"type": "SolrQueryServiceController",
"var_name": "controller"
},
{
"declarator": "isEmbeddedSolrServer = ... | {
"body": "public String getSolrSpecVersion() {\n if(isEmbeddedSolrServer) {\n return embeddedQueryService.getSolrServerVersion();\n } else {\n return httpQueryService.getSolrServerVersion();\n }\n }",
"class_method_signature": "SolrQueryServiceController.getSolrSpecVer... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 118799500,
"size": 144769,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/NCEAS/metacat"
} |
118799500_0 | {
"fields": [],
"file": "metacat-index/src/test/java/edu/ucsb/nceas/metacat/index/annotation/EmlAnnotationSubprocessorTest.java",
"identifier": "EmlAnnotationSubprocessorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testProcessDocument() throws Exception {\n String id = \"eml-annotation-scimeta\";\n InputStream is = getEmlAnnotationDoc();\n\n List<SolrElementField> sysSolrFields = new ArrayList<SolrElementField>();\n SolrElementField idField = new SolrElementField();\... | {
"fields": [
{
"declarator": "log = Logger.getLogger(EmlAnnotationSubprocessor.class.getName())",
"modifier": "private static",
"original_string": "private static Logger log = Logger.getLogger(EmlAnnotationSubprocessor.class.getName());",
"type": "Logger",
"var_name": "log"
},
... | {
"body": "@Override\n public Map<String, SolrDoc> processDocument(String identifier, Map<String, SolrDoc> docs,\n InputStream is) throws Exception {\n log.debug(\"processDocument() for \" + identifier);\n\n Document doc = XmlDocumentUtility.generateXmlDocument(is);\n SolrDoc solrDo... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 118799500,
"size": 144769,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/NCEAS/metacat"
} |
118799500_10 | {
"fields": [],
"file": "metacat-common/src/test/java/edu/ucsb/nceas/metacat/common/SolrServerFactoryTest.java",
"identifier": "SolrServerFactoryTest",
"interfaces": "",
"superclass": "extends MetacatCommonTestBase"
} | {
"body": "@Test\n public void testCreateSolrServer() throws Exception {\n SolrClient server = SolrServerFactory.createSolrServer();\n if(server == null) {\n assertTrue(\"testCreateSolrServer - the server shouldn't be null\", true);\n }\n }",
"class_method_signature": "SolrServ... | {
"fields": [
{
"declarator": "SOLR_HOME_PROPERTY_NAME = \"solr.homeDir\"",
"modifier": "public static final",
"original_string": "public static final String SOLR_HOME_PROPERTY_NAME = \"solr.homeDir\";",
"type": "String",
"var_name": "SOLR_HOME_PROPERTY_NAME"
},
{
"decl... | {
"body": "public static SolrClient createSolrServer() throws ParserConfigurationException, IOException, SAXException, UnsupportedType {\n\t if(solrServer == null) {\n\t String className = Settings.getConfiguration().getString(SOLR_SERVER_CLASSNAME_PROPERTY_NAME);\n\t if (className != null && classNa... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 118799500,
"size": 144769,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/NCEAS/metacat"
} |
118799500_1 | {
"fields": [],
"file": "metacat-index/src/test/java/edu/ucsb/nceas/metacat/index/annotation/MetacatRdfXmlSubprocessorTest.java",
"identifier": "MetacatRdfXmlSubprocessorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testProcessDocument() throws Exception {\n //Settings.getConfiguration().setProperty(\"dataone.hazelcast.configFilePath\", \"../lib/hazelcast.xml\");\n String id = \"resourceMap_urn:uuid:04780847-6082-455b-9831-22269c9ec0a6\";\n InputStream is = getResourceMapDoc... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(MetacatRdfXmlSubprocessor.class)",
"modifier": "private static",
"original_string": "private static Log log = LogFactory.getLog(MetacatRdfXmlSubprocessor.class);",
"type": "Log",
"var_name": "log"
},
{
"declarator":... | {
"body": "@Override\n public Map<String, SolrDoc> processDocument(String identifier, Map<String, SolrDoc> docs,\n InputStream is) throws Exception {\n\n if (log.isTraceEnabled()) {\n log.trace(\"INCOMING DOCS to processDocument(): \");\n serializeDocuments(docs);\n }... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 118799500,
"size": 144769,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/NCEAS/metacat"
} |
17626803_5 | {
"fields": [
{
"declarator": "user",
"modifier": "",
"original_string": "ApplicationUser user;",
"type": "ApplicationUser",
"var_name": "user"
},
{
"declarator": "measurement",
"modifier": "",
"original_string": "Measurement measurement;",
"type": "Me... | {
"body": "@Test\n\tpublic void testCanDelete() {\n\t\t\n\t\tApplicationUser newUser = new ApplicationUser(\"\");\n\t\tActionPossibility ap = uut.canDelete(complexMeasurement.getId(), newUser);\n\t\tAssert.assertFalse(ap.getReason(), ap.isPossible());\n\t\tuser.setName(\"TestUser\");\n\t\t ap = uut.canDelete(complexM... | {
"fields": [
{
"declarator": "complexMeasurementService",
"modifier": "@Autowired",
"original_string": "@Autowired\n\tComplexMeasurementsService complexMeasurementService;",
"type": "ComplexMeasurementsService",
"var_name": "complexMeasurementService"
}
],
"file": "DSM-monit... | {
"body": "public ActionPossibility canDelete(UUID uuid, ApplicationUser user) {\n\t\tInternalErrorException.check(measurementExists(uuid));\n\t\tif(user == null) {\n\t\t\treturn ActionPossibility.forFalse(\"Only logged users can delete measurements\", HttpStatus.UNAUTHORIZED);\n\t\t}\n\t\tboolean possible = complexM... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17626803,
"size": 6972,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/wysekm/DistributedSystemMonitoring"
} |
17626803_4 | {
"fields": [
{
"declarator": "user",
"modifier": "",
"original_string": "ApplicationUser user;",
"type": "ApplicationUser",
"var_name": "user"
},
{
"declarator": "measurement",
"modifier": "",
"original_string": "Measurement measurement;",
"type": "Me... | {
"body": "@Test\n\tpublic void testDelete() {\n\t\tuut.delete(complexMeasurement.getId(), complexMeasurement.getCreatedBy());\n\t\tActionPossibility ap = uut.measurementExists(complexMeasurement.getId());\n\t\tassertFalse(ap.getReason(), ap.isPossible());\n\t}",
"class_method_signature": "DeleteComplexMeasurementT... | {
"fields": [
{
"declarator": "complexMeasurementService",
"modifier": "@Autowired",
"original_string": "@Autowired\n\tComplexMeasurementsService complexMeasurementService;",
"type": "ComplexMeasurementsService",
"var_name": "complexMeasurementService"
}
],
"file": "DSM-monit... | {
"body": "public void delete(UUID uuid, ApplicationUser user) {\n\t\tInternalErrorException.check(canDelete(uuid, user));\n\t\tcomplexMeasurementService.delete(uuid);\n\t}",
"class_method_signature": "DeleteComplexMeasurement.delete(UUID uuid, ApplicationUser user)",
"constructor": false,
"full_signature": "pu... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17626803,
"size": 6972,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/wysekm/DistributedSystemMonitoring"
} |
17626803_3 | {
"fields": [
{
"declarator": "measurement",
"modifier": "",
"original_string": "Measurement measurement;",
"type": "Measurement",
"var_name": "measurement"
},
{
"declarator": "data",
"modifier": "",
"original_string": "MeasurementData data;",
"type": ... | {
"body": "@Test\n\tpublic void testAddSensorMeasurement() {\n\t\tUUID id = UUID.randomUUID();\n\t\tString resource, metric, unit, monitor;\n\t\tresource = \"localhost\"; \n\t\tmetric = \"cpu\";\n\t\tunit = \"%\";\n\t\tmonitor = \"mon1\";\n\t\tmeasurement = new Measurement(id, resource, metric, unit, monitor);\n\t\td... | {
"fields": [
{
"declarator": "measurementService",
"modifier": "@Autowired",
"original_string": "@Autowired\n\tMeasurementService measurementService;",
"type": "MeasurementService",
"var_name": "measurementService"
}
],
"file": "DSM-monitor/src/main/java/pl/edu/agh/dsm/monit... | {
"body": "public void addSensorMeasurement(Measurement measurement, MeasurementData data) {\n\t\tif(measurementService.getDetails(measurement.getId()) == null) {\n\t\t\tmeasurementService.addMeasurement(measurement);\n\t\t}\n\t\tmeasurementService.addMeasurementData(measurement.getId(), data);\n\t}",
"class_method... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17626803,
"size": 6972,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/wysekm/DistributedSystemMonitoring"
} |
17626803_2 | {
"fields": [
{
"declarator": "uut",
"modifier": "@Autowired",
"original_string": "@Autowired\n\tCreateComplexMeasurement uut;",
"type": "CreateComplexMeasurement",
"var_name": "uut"
},
{
"declarator": "addSensor",
"modifier": "@Autowired",
"original_string"... | {
"body": "@Test\n\tpublic void testBaseMeasurementExists() {\n\t\tuser = new ApplicationUser(\"TestUser\");\n\t\tcomplexMeasurement = new ComplexMeasurement(null, UUID.randomUUID(), \"move_avg\", Arrays.asList(\n\t\t\t\tnew ComplexMeasurementParam(\"interval\", 15),\n\t\t\t\tnew ComplexMeasurementParam(\"time_window... | {
"fields": [
{
"declarator": "complexMeasurementService",
"modifier": "@Autowired",
"original_string": "@Autowired\n\tComplexMeasurementsService complexMeasurementService;",
"type": "ComplexMeasurementsService",
"var_name": "complexMeasurementService"
},
{
"declarator"... | {
"body": "public ActionPossibility baseMeasurementExists(ComplexMeasurement complexMeasurement) {\n\t\tUUID uuid = complexMeasurement.getBaseMeasurementId();\n\t\tboolean possible = measurementService.getDetails(uuid) != null;\n\t\tString reason = \"Base measurement does not exist: \" + uuid;\n\t\treturn new ActionP... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17626803,
"size": 6972,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/wysekm/DistributedSystemMonitoring"
} |
17626803_1 | {
"fields": [
{
"declarator": "uut",
"modifier": "@Autowired",
"original_string": "@Autowired\n\tCreateComplexMeasurement uut;",
"type": "CreateComplexMeasurement",
"var_name": "uut"
},
{
"declarator": "addSensor",
"modifier": "@Autowired",
"original_string"... | {
"body": "@Test\n\tpublic void testCanCreate() {\n\t\tuser = new ApplicationUser(\"\");\n\t\tAssert.assertFalse(uut.canCreate(user).isPossible());\n\t\tuser.setName(\"TestUser\");\n\t\tAssert.assertTrue(uut.canCreate(user).isPossible());\n\t}",
"class_method_signature": "CreateComplexMeasurementTest.testCanCreate(... | {
"fields": [
{
"declarator": "complexMeasurementService",
"modifier": "@Autowired",
"original_string": "@Autowired\n\tComplexMeasurementsService complexMeasurementService;",
"type": "ComplexMeasurementsService",
"var_name": "complexMeasurementService"
},
{
"declarator"... | {
"body": "public ActionPossibility canCreate(ApplicationUser user) {\n\t\tboolean possible = user != null && user.getName() != null && !user.getName().isEmpty();\n\t\treturn new ActionPossibility(possible, \"Anonymous user cannot create complex measurement\", HttpStatus.UNAUTHORIZED);\n\t}",
"class_method_signatur... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17626803,
"size": 6972,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/wysekm/DistributedSystemMonitoring"
} |
17626803_0 | {
"fields": [
{
"declarator": "uut",
"modifier": "@Autowired",
"original_string": "@Autowired\n\tCreateComplexMeasurement uut;",
"type": "CreateComplexMeasurement",
"var_name": "uut"
},
{
"declarator": "addSensor",
"modifier": "@Autowired",
"original_string"... | {
"body": "@Test\n\tpublic void testCreate() {\n\t\tuser = new ApplicationUser(\"TestUser\");\n\t\t\n\t\t\n\t\tUUID mId = UUID.randomUUID();\n\t\tString resource, metric, unit, monitor;\n\t\tresource = \"localhost\"; \n\t\tmetric = \"cpu\";\n\t\tunit = \"%\";\n\t\tmonitor = \"mon1\";\n\t\tMeasurement measurement = ne... | {
"fields": [
{
"declarator": "complexMeasurementService",
"modifier": "@Autowired",
"original_string": "@Autowired\n\tComplexMeasurementsService complexMeasurementService;",
"type": "ComplexMeasurementsService",
"var_name": "complexMeasurementService"
},
{
"declarator"... | {
"body": "public Measurement create(ComplexMeasurement measurement, ApplicationUser user) {\n\t\tInternalErrorException.check(canCreate(user));\n\t\tInternalErrorException.check(baseMeasurementExists(measurement));\n\t\tmeasurement.setCreatedBy(user);\n\t\ttry {\n\t\t\treturn complexMeasurementService.create(measure... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17626803,
"size": 6972,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/wysekm/DistributedSystemMonitoring"
} |
17626803_6 | {
"fields": [
{
"declarator": "user",
"modifier": "",
"original_string": "ApplicationUser user;",
"type": "ApplicationUser",
"var_name": "user"
},
{
"declarator": "measurement",
"modifier": "",
"original_string": "Measurement measurement;",
"type": "Me... | {
"body": "@Test\n\tpublic void testMeasurementExists() {\n\t\t\n\t\tUUID uuid = UUID.fromString(\"0cb419a8-aa9b-41ba-ad33-4869eaa658ff\");\n\t\tActionPossibility ap = uut.measurementExists(uuid);\n\t\tassertFalse(ap.isPossible());\n\t\tap = uut.measurementExists(complexMeasurement.getId());\n\t\tassertTrue(ap.getRea... | {
"fields": [
{
"declarator": "complexMeasurementService",
"modifier": "@Autowired",
"original_string": "@Autowired\n\tComplexMeasurementsService complexMeasurementService;",
"type": "ComplexMeasurementsService",
"var_name": "complexMeasurementService"
}
],
"file": "DSM-monit... | {
"body": "public ActionPossibility measurementExists(UUID uuid) {\n\t\tboolean possible = complexMeasurementService.getDetails(uuid) != null;\n\t\tString reason = \"Complex measurement does not exist: \" +uuid;\n\t\treturn new ActionPossibility(possible, reason, HttpStatus.NOT_FOUND);\n\t}",
"class_method_signatur... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17626803,
"size": 6972,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/wysekm/DistributedSystemMonitoring"
} |
122429896_0 | {
"fields": [],
"file": "akka/src/test/java/com/lightbend/reactivestreams/utils/AkkaEngineProviderTest.java",
"identifier": "AkkaEngineProviderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void actorSystemIsCleanedUpWhenThereAreNoMoreReferences() throws Exception {\n // First get a reference\n AkkaEngine engine = AkkaEngineProvider.provider();\n // And get the actor system from it\n ActorSystem system = ((ActorMaterializer) engine.materializer).system();\n // C... | {
"fields": [
{
"declarator": "actorSystemCleaner = Cleaner.create(runnable -> {\n Thread thread = new Thread(runnable);\n // The default thread factory used by the cleaner sets the thread priority to this.\n thread.setPriority(Thread.MAX_PRIORITY - 2);\n thread.setName(\"Akka-Reactive-Streams-E... | {
"body": "public static AkkaEngine provider() {\n\n AkkaEngine engine = null;\n // Double checked locking to initialize the weak reference the first time this method\n // is invoked.\n if (cachedEngine == null) {\n synchronized (mutex) {\n if (cachedEngine == null) {\n // We could ju... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 122429896,
"size": 590,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/lightbend/reactive-streams-utils"
} |
122429896_1 | {
"fields": [],
"file": "akka/src/test/java/com/lightbend/reactivestreams/utils/AkkaEngineProviderTest.java",
"identifier": "AkkaEngineProviderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void aRunningStreamShouldPreventActorSystemFromShuttingDown() throws Exception {\n AkkaEngine engine = AkkaEngineProvider.provider();\n ActorSystem system = ((ActorMaterializer) engine.materializer).system();\n\n Flow.Publisher<Done> publisher =\n Source.tick(\n D... | {
"fields": [
{
"declarator": "actorSystemCleaner = Cleaner.create(runnable -> {\n Thread thread = new Thread(runnable);\n // The default thread factory used by the cleaner sets the thread priority to this.\n thread.setPriority(Thread.MAX_PRIORITY - 2);\n thread.setName(\"Akka-Reactive-Streams-E... | {
"body": "public static AkkaEngine provider() {\n\n AkkaEngine engine = null;\n // Double checked locking to initialize the weak reference the first time this method\n // is invoked.\n if (cachedEngine == null) {\n synchronized (mutex) {\n if (cachedEngine == null) {\n // We could ju... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 122429896,
"size": 590,
"stargazer_count": 58,
"stars": null,
"updates": null,
"url": "https://github.com/lightbend/reactive-streams-utils"
} |
14997161_4 | {
"fields": [
{
"declarator": "RAILSGOAT_ROUTES = new String [][] {\n {\"GET\", \"/login\"},\n {\"GET\", \"/signup\"},\n {\"GET\", \"/logout\"},\n {\"GET\", \"/forgot_password\"},\n {\"GET\", \"/password_resets\"},\n {\"POST\", \"/password_resets\"},\n {\"GET... | {
"body": "@Test\n public void testGitlabRoutesParser() throws Exception {\n File f = ResourceManager.getRailsFile(\"gitlab_routes.rb\");\n assert(f.exists());\n// System.err.println(\"parsing \"+f.getAbsolutePath() );\n Map<String, RailsRoute> mappings = RailsRoutesParser.parse(f);\n//... | {
"fields": [
{
"declarator": "LOG = new SanitizedLogger(\"RailsParser\")",
"modifier": "private static final",
"original_string": "private static final SanitizedLogger LOG = new SanitizedLogger(\"RailsParser\");",
"type": "SanitizedLogger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public static Map parse(@Nonnull File file) {\n if (!file.exists()) {\n LOG.error(\"File not found. Exiting. \" + file.getName());\n return null;\n }\n\n RailsRoutesParser parser = new RailsRoutesParser();\n EventBasedTokenizerRunner.runRails(file, parser);... | {
"created": null,
"fork": null,
"fork_count": 133,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 14997161,
"size": 119050,
"stargazer_count": 337,
"stars": null,
"updates": null,
"url": "https://github.com/denimgroup/threadfix"
} |
14997161_5 | {
"fields": [],
"file": "archived/threadfix-ham/src/test/java/com/denimgroup/threadfix/framework/impl/rails/RailsEndpointMappingsTest.java",
"identifier": "RailsEndpointMappingsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testRailsGoatControllerParser() {\n File f = new File (TestConstants.RAILSGOAT_SOURCE_LOCATION);\n\n assert f.exists() : \"Source code location does not exist. \" + TestConstants.RAILSGOAT_SOURCE_LOCATION;\n assert f.isDirectory() : \"Source code location is not ... | {
"fields": [
{
"declarator": "LOG = new SanitizedLogger(\"RailsParser\")",
"modifier": "private static final",
"original_string": "private static final SanitizedLogger LOG = new SanitizedLogger(\"RailsParser\");",
"type": "SanitizedLogger",
"var_name": "LOG"
},
{
"decl... | {
"body": "@Nonnull\n @Override\n public List<Endpoint> generateEndpoints() {\n return endpoints;\n }",
"class_method_signature": "RailsEndpointMappings.generateEndpoints()",
"constructor": false,
"full_signature": "@Nonnull @Override public List<Endpoint> generateEndpoints()",
"identifier": "... | {
"created": null,
"fork": null,
"fork_count": 133,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 14997161,
"size": 119050,
"stargazer_count": 337,
"stars": null,
"updates": null,
"url": "https://github.com/denimgroup/threadfix"
} |
14997161_2 | {
"fields": [
{
"declarator": "RAILSGOAT_ROUTES = new String [][] {\n {\"GET\", \"/login\"},\n {\"GET\", \"/signup\"},\n {\"GET\", \"/logout\"},\n {\"GET\", \"/forgot_password\"},\n {\"GET\", \"/password_resets\"},\n {\"POST\", \"/password_resets\"},\n {\"GET... | {
"body": "@Test\n public void testRailsGoatRoutesParser() {\n File f = ResourceManager.getRailsFile(\"railsgoat_routes.rb\");\n assert(f.exists());\n\n //System.err.println(\"parsing \"+f.getAbsolutePath() );\n Map<String, RailsRoute> mappings = RailsRoutesParser.parse(f);\n //S... | {
"fields": [
{
"declarator": "LOG = new SanitizedLogger(\"RailsParser\")",
"modifier": "private static final",
"original_string": "private static final SanitizedLogger LOG = new SanitizedLogger(\"RailsParser\");",
"type": "SanitizedLogger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public static Map parse(@Nonnull File file) {\n if (!file.exists()) {\n LOG.error(\"File not found. Exiting. \" + file.getName());\n return null;\n }\n\n RailsRoutesParser parser = new RailsRoutesParser();\n EventBasedTokenizerRunner.runRails(file, parser);... | {
"created": null,
"fork": null,
"fork_count": 133,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 14997161,
"size": 119050,
"stargazer_count": 337,
"stars": null,
"updates": null,
"url": "https://github.com/denimgroup/threadfix"
} |
14997161_3 | {
"fields": [
{
"declarator": "RAILSGOAT_ROUTES = new String [][] {\n {\"GET\", \"/login\"},\n {\"GET\", \"/signup\"},\n {\"GET\", \"/logout\"},\n {\"GET\", \"/forgot_password\"},\n {\"GET\", \"/password_resets\"},\n {\"POST\", \"/password_resets\"},\n {\"GET... | {
"body": "@Test\n public void testDiscourseRoutesParser() {\n File f = ResourceManager.getRailsFile(\"discource_routes.rb\");\n assert(f.exists());\n // System.err.println(\"parsing \"+f.getAbsolutePath() );\n Map<String, RailsRoute> mappings = RailsRoutesParser.parse(f);\n // S... | {
"fields": [
{
"declarator": "LOG = new SanitizedLogger(\"RailsParser\")",
"modifier": "private static final",
"original_string": "private static final SanitizedLogger LOG = new SanitizedLogger(\"RailsParser\");",
"type": "SanitizedLogger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public static Map parse(@Nonnull File file) {\n if (!file.exists()) {\n LOG.error(\"File not found. Exiting. \" + file.getName());\n return null;\n }\n\n RailsRoutesParser parser = new RailsRoutesParser();\n EventBasedTokenizerRunner.runRails(file, parser);... | {
"created": null,
"fork": null,
"fork_count": 133,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 14997161,
"size": 119050,
"stargazer_count": 337,
"stars": null,
"updates": null,
"url": "https://github.com/denimgroup/threadfix"
} |
14997161_0 | {
"fields": [
{
"declarator": "sampleServlets = makeClassMappings(\n\t\t\t// WebLogic examples\n\t\t\t// http://docs.oracle.com/cd/E13222_01/wls/docs92/webapp/configureservlet.html#wp156745\n\t\t\t\"watermelon\", \"myservlets.watermelon\",\n\t\t\t\"garden\", \"myservlets.garden\",\n\t\t\t\"list\", \"myservl... | {
"body": "@Test\n public void testURLToClassMapping() throws IOException {\n \tList<Entry<String,String>> tests;\n \t\n \tServletMappings mappings = getTestMappings();\n \t\n \ttests = makeMappingsList(\n \t\t\t\"/fruit/summer/index.html\", \"myservlets.watermelon\",\n \t\t\t\"/fruit/summer/i... | {
"fields": [
{
"declarator": "log = new SanitizedLogger(\"ServletMappings\")",
"modifier": "private static final",
"original_string": "private static final SanitizedLogger log = new SanitizedLogger(\"ServletMappings\");",
"type": "SanitizedLogger",
"var_name": "log"
},
{
... | {
"body": "@Nonnull\n public String getClassForURL(@Nonnull String path) {\n\t\tString servletName = findServletName(path);\n\t\t\n\t\tfor (ClassMapping entry : servlets) {\n\t\t\tif (entry != null && servletName.equals(entry.getServletName())) {\n\t\t\t\treturn entry.getClassWithPackage();\n\t\t\t}\n\t\t}\n\t\t\n... | {
"created": null,
"fork": null,
"fork_count": 133,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 14997161,
"size": 119050,
"stargazer_count": 337,
"stars": null,
"updates": null,
"url": "https://github.com/denimgroup/threadfix"
} |
14997161_1 | {
"fields": [
{
"declarator": "sampleServlets = makeClassMappings(\n\t\t\t// WebLogic examples\n\t\t\t// http://docs.oracle.com/cd/E13222_01/wls/docs92/webapp/configureservlet.html#wp156745\n\t\t\t\"watermelon\", \"myservlets.watermelon\",\n\t\t\t\"garden\", \"myservlets.garden\",\n\t\t\t\"list\", \"myservl... | {
"body": "@Test\n public void testClassToURLMapping() throws IOException {\n \tList<Entry<String,String>> tests;\n \t\n \tServletMappings mappings = getTestMappings();\n \t\n \ttests = makeMappingsList(\n \t\t\t\"myservlets.watermelon\", \"/fruit/summer/*\",\n \t\t\t\"myservlets.list\", \"/se... | {
"fields": [
{
"declarator": "log = new SanitizedLogger(\"ServletMappings\")",
"modifier": "private static final",
"original_string": "private static final SanitizedLogger log = new SanitizedLogger(\"ServletMappings\");",
"type": "SanitizedLogger",
"var_name": "log"
},
{
... | {
"body": "@Nonnull\n public List<String> getURLPatternsForClass(@Nonnull String classWithPackage) {\n\t\tList<String> mappings = list();\n\n\t\tString servletName = null;\n\t\t\n\t\tfor (ClassMapping entry : servlets) {\n\t\t\tif (entry != null && classWithPackage.equals(entry.getClassWithPackage())) {\n\t\t\t\ts... | {
"created": null,
"fork": null,
"fork_count": 133,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 14997161,
"size": 119050,
"stargazer_count": 337,
"stars": null,
"updates": null,
"url": "https://github.com/denimgroup/threadfix"
} |
14997161_6 | {
"fields": [
{
"declarator": "RAILSGOAT_CONTROLLERS = new String [][]{\n // {\"ctrl\", \"method1\", \"method2\", \"method3\"},\n {\"Admin\", \"dashboard\",\"analytics\",\"get_all_users\",\"get_user\",\"update_user\",\"delete_user\"},\n {\"BenefitForms\", \"index\",\"downlo... | {
"body": "@Test\n public void testRailsGoatControllerParser() {\n File f = new File(RAILSGOAT_SOURCE_LOCATION);\n assert(f.exists());\n assert(f.isDirectory());\n //System.err.println(\"parsing \"+f.getAbsolutePath() );\n railsControllers = (List<RailsController>) RailsControlle... | {
"fields": [
{
"declarator": "LOG = new SanitizedLogger(\"RailsParser\")",
"modifier": "private static final",
"original_string": "private static final SanitizedLogger LOG = new SanitizedLogger(\"RailsParser\");",
"type": "SanitizedLogger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public static Collection parse(@Nonnull File rootFile) {\n if (!rootFile.exists() || !rootFile.isDirectory()) {\n LOG.error(\"Root file not found or is not directory. Exiting.\");\n return null;\n }\n File ctrlDir = new File(rootFile,\"app/controllers\");\n ... | {
"created": null,
"fork": null,
"fork_count": 133,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 14997161,
"size": 119050,
"stargazer_count": 337,
"stars": null,
"updates": null,
"url": "https://github.com/denimgroup/threadfix"
} |
14997161_7 | {
"fields": [
{
"declarator": "RAILSGOAT_MODELS = new String [][]{\n // {\"model\", \"param1\", \"param2\", \"param3\"},\n {\"analytics\", \"ip_address\", \"referrer\", \"user_agent\"},\n {\"benefits\", \"backup\"},\n {\"key_management\", \"iv\", \"user_id\"},\n {\"message\",... | {
"body": "@Test\n public void testRailsGoatModelParser() {\n File f = new File(RAILSGOAT_SOURCE_LOCATION);\n assert(f.exists());\n assert(f.isDirectory());\n\n System.err.println(\"parsing \"+f.getAbsolutePath() );\n Map modelMap = RailsModelParser.parse(f);\n System.err.... | {
"fields": [
{
"declarator": "LOG = new SanitizedLogger(\"RailsParser\")",
"modifier": "private static final",
"original_string": "private static final SanitizedLogger LOG = new SanitizedLogger(\"RailsParser\");",
"type": "SanitizedLogger",
"var_name": "LOG"
},
{
"decl... | {
"body": "public static Map parse(@Nonnull File rootFile) {\n if (!rootFile.exists() || !rootFile.isDirectory()) {\n LOG.error(\"Root file not found or is not directory. Exiting.\");\n return null;\n }\n File modelDir = new File(rootFile,\"app/models\");\n if (!model... | {
"created": null,
"fork": null,
"fork_count": 133,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 14997161,
"size": 119050,
"stargazer_count": 337,
"stars": null,
"updates": null,
"url": "https://github.com/denimgroup/threadfix"
} |
142763963_15 | {
"fields": [
{
"declarator": "ipUtils = new IpUtils()",
"modifier": "private",
"original_string": "private IpUtils ipUtils = new IpUtils();",
"type": "IpUtils",
"var_name": "ipUtils"
},
{
"declarator": "ipDec = \"195.127.0.11\"",
"modifier": "private",
"ori... | {
"body": "@Test\n public void testIsOctalEncodedIpAddress() {\n Assert.assertFalse(ipUtils.isOctalEncodedIpAddress(ipDec));\n Assert.assertFalse(ipUtils.isOctalEncodedIpAddress(ipHex));\n Assert.assertTrue(ipUtils.isOctalEncodedIpAddress(ipOct));\n Assert.assertFalse(ipUtils.isOctalEnc... | {
"fields": [
{
"declarator": "DECIMAL_PATTERN = Pattern.compile(\"(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\d{1,3})\")",
"modifier": "private static final",
"original_string": "private static final Pattern DECIMAL_PATTERN = Pattern.compile(\"(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\... | {
"body": "public boolean isOctalEncodedIpAddress(String ip) {\n return OCTAL_PATTERN.matcher(ip).matches();\n }",
"class_method_signature": "IpUtils.isOctalEncodedIpAddress(String ip)",
"constructor": false,
"full_signature": "public boolean isOctalEncodedIpAddress(String ip)",
"identifier": "isOct... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_0 | {
"fields": [
{
"declarator": "expressions = new SuffixPrefixExpressions()",
"modifier": "private",
"original_string": "private SuffixPrefixExpressions expressions = new SuffixPrefixExpressions();",
"type": "SuffixPrefixExpressions",
"var_name": "expressions"
}
],
"file": "co... | {
"body": "@Test\n public void testMakeExpressions1() {\n Set<String> set = expressions.makeExpressions(\"http://a.b.c/1/2.html?param=1\");\n Assert.assertEquals(8, set.size());\n Assert.assertTrue(set.contains(\"a.b.c/1/2.html?param=1\"));\n Assert.assertTrue(set.contains(\"a.b.c/1/2.h... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(SuffixPrefixExpressions.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(SuffixPrefixExpressions.class);",
"type": "Logger",
"var_name": "LOGGE... | {
"body": "public Set<String> makeExpressions(String url) {\n UrlSplitter.UrlParts parts = urlSplitter.split(url);\n if (parts == null) {\n LOGGER.info(\"URL cannot be split into parts: {}\", url);\n return Collections.emptySet();\n }\n\n Set<String> suffixExprSet = e... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_23 | {
"fields": [
{
"declarator": "penc = new PercentEncoder()",
"modifier": "private",
"original_string": "private PercentEncoder penc = new PercentEncoder();",
"type": "PercentEncoder",
"var_name": "penc"
}
],
"file": "core/src/test/java/kg/net/bazi/gsb4j/util/PercentEncoderTes... | {
"body": "@Test\n public void testDecode() {\n Assert.assertEquals(\"query=world nomads&count=5\", penc.decode(\"query%3Dworld%20nomads%26count%3D5\"));\n Assert.assertEquals(\"query=He is \\\"Joe\\\"\", penc.decode(\"query%3DHe%20is%20%22Joe%22\"));\n Assert.assertEquals(\"pattern=a|b\", pen... | {
"fields": [],
"file": "core/src/main/java/kg/net/bazi/gsb4j/util/PercentEncoder.java",
"identifier": "PercentEncoder",
"interfaces": "",
"methods": [
{
"class_method_signature": "PercentEncoder.encode(String str)",
"constructor": false,
"full_signature": "public String encode(String st... | {
"body": "public String decode(String str) {\n try {\n return URLDecoder.decode(str, StandardCharsets.UTF_8.name());\n } catch (UnsupportedEncodingException ex) {\n throw new IllegalStateException(\"Shall not happen\", ex);\n }\n }",
"class_method_signature": "PercentE... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_19 | {
"fields": [
{
"declarator": "splitter = new UrlSplitter()",
"modifier": "private",
"original_string": "private UrlSplitter splitter = new UrlSplitter();",
"type": "UrlSplitter",
"var_name": "splitter"
}
],
"file": "core/src/test/java/kg/net/bazi/gsb4j/util/UrlSplitterTest.j... | {
"body": "@Test\n public void testSplit1() {\n UrlSplitter.UrlParts parts = splitter.split(\"http://example.com:8080/path/here?param=1\");\n\n Assert.assertEquals(\"http://\", parts.getScheme());\n Assert.assertEquals(\"example.com\", parts.getHost());\n Assert.assertEquals(\":8080\", ... | {
"fields": [
{
"declarator": "URL_PATTERN = Pattern.compile(\"(https?://)([^/:?]+)(:\\\\d+)?(/[^?]*)?(\\\\?.*)?\")",
"modifier": "private static final",
"original_string": "private static final Pattern URL_PATTERN = Pattern.compile(\"(https?://)([^/:?]+)(:\\\\d+)?(/[^?]*)?(\\\\?.*)?\");",
... | {
"body": "public UrlParts split(String url) {\n Matcher matcher = URL_PATTERN.matcher(url.trim());\n if (matcher.matches()) {\n UrlParts parts = new UrlParts();\n parts.scheme = matcher.group(1);\n parts.host = matcher.group(2);\n parts.port = matcher.group(3... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_18 | {
"fields": [
{
"declarator": "ipUtils = new IpUtils()",
"modifier": "private",
"original_string": "private IpUtils ipUtils = new IpUtils();",
"type": "IpUtils",
"var_name": "ipUtils"
},
{
"declarator": "ipDec = \"195.127.0.11\"",
"modifier": "private",
"ori... | {
"body": "@Test\n public void testToInetAddress() throws UnknownHostException {\n InetAddress inetAddr = InetAddress.getByName(\"195.127.0.11\");\n\n Assert.assertEquals(inetAddr, ipUtils.toInetAddress(ipDec));\n Assert.assertEquals(inetAddr, ipUtils.toInetAddress(ipHex));\n Assert.ass... | {
"fields": [
{
"declarator": "DECIMAL_PATTERN = Pattern.compile(\"(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\d{1,3})\")",
"modifier": "private static final",
"original_string": "private static final Pattern DECIMAL_PATTERN = Pattern.compile(\"(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\... | {
"body": "public InetAddress toInetAddress(String ip) {\n if (isDecimalIpAddress(ip)) {\n return InetAddresses.forString(ip);\n }\n\n Matcher matcherBin = BIN_PATTERN.matcher(ip);\n if (matcherBin.matches()) {\n String bin = matcherBin.group();\n int numer... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_22 | {
"fields": [
{
"declarator": "penc = new PercentEncoder()",
"modifier": "private",
"original_string": "private PercentEncoder penc = new PercentEncoder();",
"type": "PercentEncoder",
"var_name": "penc"
}
],
"file": "core/src/test/java/kg/net/bazi/gsb4j/util/PercentEncoderTes... | {
"body": "@Test\n public void testEncode() {\n Assert.assertEquals(\"query%3Dworld%20nomads%26count%3D5\", penc.encode(\"query=world nomads&count=5\"));\n Assert.assertEquals(\"query%3DHe%20is%20%22Joe%22\", penc.encode(\"query=He is \\\"Joe\\\"\"));\n Assert.assertEquals(\"pattern%3Da%7Cb\",... | {
"fields": [],
"file": "core/src/main/java/kg/net/bazi/gsb4j/util/PercentEncoder.java",
"identifier": "PercentEncoder",
"interfaces": "",
"methods": [
{
"class_method_signature": "PercentEncoder.encode(String str)",
"constructor": false,
"full_signature": "public String encode(String st... | {
"body": "public String encode(String str) {\n try {\n String urlEncoded = URLEncoder.encode(str, StandardCharsets.UTF_8.name());\n return urlEncoded.replace(\"+\", \"%20\");\n } catch (UnsupportedEncodingException ex) {\n throw new IllegalStateException(\"Shall not hap... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_1 | {
"fields": [
{
"declarator": "expressions = new SuffixPrefixExpressions()",
"modifier": "private",
"original_string": "private SuffixPrefixExpressions expressions = new SuffixPrefixExpressions();",
"type": "SuffixPrefixExpressions",
"var_name": "expressions"
}
],
"file": "co... | {
"body": "@Test\n public void testMakeExpressions2() {\n Set<String> set = expressions.makeExpressions(\"http://a.b.c.d.e.f.g/1.html\");\n Assert.assertEquals(10, set.size());\n Assert.assertTrue(set.contains(\"a.b.c.d.e.f.g/1.html\"));\n Assert.assertTrue(set.contains(\"a.b.c.d.e.f.g/... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(SuffixPrefixExpressions.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(SuffixPrefixExpressions.class);",
"type": "Logger",
"var_name": "LOGGE... | {
"body": "public Set<String> makeExpressions(String url) {\n UrlSplitter.UrlParts parts = urlSplitter.split(url);\n if (parts == null) {\n LOGGER.info(\"URL cannot be split into parts: {}\", url);\n return Collections.emptySet();\n }\n\n Set<String> suffixExprSet = e... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_14 | {
"fields": [
{
"declarator": "ipUtils = new IpUtils()",
"modifier": "private",
"original_string": "private IpUtils ipUtils = new IpUtils();",
"type": "IpUtils",
"var_name": "ipUtils"
},
{
"declarator": "ipDec = \"195.127.0.11\"",
"modifier": "private",
"ori... | {
"body": "@Test\n public void testIsBinaryIpAddress() {\n Assert.assertFalse(ipUtils.isBinaryIpAddress(ipDec));\n Assert.assertFalse(ipUtils.isBinaryIpAddress(ipHex));\n Assert.assertFalse(ipUtils.isBinaryIpAddress(ipOct));\n Assert.assertTrue(ipUtils.isBinaryIpAddress(ipBin));\n ... | {
"fields": [
{
"declarator": "DECIMAL_PATTERN = Pattern.compile(\"(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\d{1,3})\")",
"modifier": "private static final",
"original_string": "private static final Pattern DECIMAL_PATTERN = Pattern.compile(\"(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\... | {
"body": "public boolean isBinaryIpAddress(String ip) {\n return BIN_PATTERN.matcher(ip).matches();\n }",
"class_method_signature": "IpUtils.isBinaryIpAddress(String ip)",
"constructor": false,
"full_signature": "public boolean isBinaryIpAddress(String ip)",
"identifier": "isBinaryIpAddress",
"in... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_25 | {
"fields": [
{
"declarator": "riceCompression = new RiceCompression()",
"modifier": "private",
"original_string": "private RiceCompression riceCompression = new RiceCompression();",
"type": "RiceCompression",
"var_name": "riceCompression"
},
{
"declarator": "data1 = \"... | {
"body": "@Test\n public void testDecompress2() {\n byte[] bytes = Base64.getDecoder().decode(data2);\n List<Integer> ls = riceCompression.decompress(parameter, bytes);\n\n Assert.assertEquals(336, ls.size());\n }",
"class_method_signature": "RiceCompressionTest.testDecompress2()",
"co... | {
"fields": [
{
"declarator": "BYTE_BITS_SIZE = 8",
"modifier": "public static final",
"original_string": "public static final int BYTE_BITS_SIZE = 8;",
"type": "int",
"var_name": "BYTE_BITS_SIZE"
}
],
"file": "core/src/main/java/kg/net/bazi/gsb4j/util/RiceCompression.java",
... | {
"body": "public List<Integer> decompress(int riceParameter, byte[] data) {\n BitSet bits = new BitSet(data.length * 8);\n\n for (int i = 0; i < data.length; i++) {\n BitSet bitsOfByte = BitSet.valueOf(makeArrayOfByte(data[i]));\n for (int j = 0; j < bitsOfByte.size(); j++) {\n ... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_29 | {
"fields": [
{
"declarator": "dataSource",
"modifier": "static",
"original_string": "static DataSource dataSource;",
"type": "DataSource",
"var_name": "dataSource"
},
{
"declarator": "db = new SqlLocalDatabase()",
"modifier": "private",
"original_string": "... | {
"body": "@Test\n public void testClear() throws Exception {\n db.clear(descriptor);\n\n List<String> ls = db.load(descriptor);\n Assert.assertTrue(ls.isEmpty());\n }",
"class_method_signature": "SqlLocalDatabaseTest.testClear()",
"constructor": false,
"full_signature": "@Test public... | {
"fields": [
{
"declarator": "BATCH_SIZE = 50 * 1000",
"modifier": "static final",
"original_string": "static final int BATCH_SIZE = 50 * 1000;",
"type": "int",
"var_name": "BATCH_SIZE"
},
{
"declarator": "LOGGER = LoggerFactory.getLogger(SqlLocalDatabase.class)",
... | {
"body": "@Override\n public void clear(ThreatListDescriptor descriptor) throws IOException {\n try (Connection conn = dataSource.getConnection();\n Statement st = conn.createStatement()) {\n st.execute(\"DROP TABLE IF EXISTS \" + descriptor);\n conn.commit();\n ... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_13 | {
"fields": [
{
"declarator": "ipUtils = new IpUtils()",
"modifier": "private",
"original_string": "private IpUtils ipUtils = new IpUtils();",
"type": "IpUtils",
"var_name": "ipUtils"
},
{
"declarator": "ipDec = \"195.127.0.11\"",
"modifier": "private",
"ori... | {
"body": "@Test\n public void testIsDecimalIpAddress() {\n Assert.assertTrue(ipUtils.isDecimalIpAddress(ipDec));\n Assert.assertFalse(ipUtils.isDecimalIpAddress(ipHex));\n Assert.assertFalse(ipUtils.isDecimalIpAddress(ipOct));\n Assert.assertFalse(ipUtils.isDecimalIpAddress(ipBin));\n ... | {
"fields": [
{
"declarator": "DECIMAL_PATTERN = Pattern.compile(\"(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\d{1,3})\")",
"modifier": "private static final",
"original_string": "private static final Pattern DECIMAL_PATTERN = Pattern.compile(\"(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\... | {
"body": "public boolean isDecimalIpAddress(String ip) {\n return DECIMAL_PATTERN.matcher(ip).matches();\n }",
"class_method_signature": "IpUtils.isDecimalIpAddress(String ip)",
"constructor": false,
"full_signature": "public boolean isDecimalIpAddress(String ip)",
"identifier": "isDecimalIpAddress... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_6 | {
"fields": [
{
"declarator": "hashing = new Hashing()",
"modifier": "private",
"original_string": "private Hashing hashing = new Hashing();",
"type": "Hashing",
"var_name": "hashing"
}
],
"file": "core/src/test/java/kg/net/bazi/gsb4j/url/HashingTest.java",
"identifier": "H... | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testComputeHashPrefixWithInvalidParam1() {\n hashing.computeHashPrefix(\"abc\", 0);\n }",
"class_method_signature": "HashingTest.testComputeHashPrefixWithInvalidParam1()",
"constructor": false,
"full_signature": "@Test(expect... | {
"fields": [
{
"declarator": "MIN_SIGNIFICANT_BYTES = 4",
"modifier": "public static final",
"original_string": "public static final int MIN_SIGNIFICANT_BYTES = 4;",
"type": "int",
"var_name": "MIN_SIGNIFICANT_BYTES"
},
{
"declarator": "MAX_SIGNIFICANT_BYTES = 32",
... | {
"body": "public String computeHashPrefix(String expression, int significantBytes) {\n checkSignificantBytes(significantBytes);\n\n int hexDigitsLength = significantBytes * 2;\n return DigestUtils.sha256Hex(expression).substring(0, hexDigitsLength);\n }",
"class_method_signature": "Hashing.... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_7 | {
"fields": [
{
"declarator": "hashing = new Hashing()",
"modifier": "private",
"original_string": "private Hashing hashing = new Hashing();",
"type": "Hashing",
"var_name": "hashing"
}
],
"file": "core/src/test/java/kg/net/bazi/gsb4j/url/HashingTest.java",
"identifier": "H... | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testComputeHashPrefixWithInvalidParam2() {\n hashing.computeHashPrefix(\"abc\", 1);\n }",
"class_method_signature": "HashingTest.testComputeHashPrefixWithInvalidParam2()",
"constructor": false,
"full_signature": "@Test(expect... | {
"fields": [
{
"declarator": "MIN_SIGNIFICANT_BYTES = 4",
"modifier": "public static final",
"original_string": "public static final int MIN_SIGNIFICANT_BYTES = 4;",
"type": "int",
"var_name": "MIN_SIGNIFICANT_BYTES"
},
{
"declarator": "MAX_SIGNIFICANT_BYTES = 32",
... | {
"body": "public String computeHashPrefix(String expression, int significantBytes) {\n checkSignificantBytes(significantBytes);\n\n int hexDigitsLength = significantBytes * 2;\n return DigestUtils.sha256Hex(expression).substring(0, hexDigitsLength);\n }",
"class_method_signature": "Hashing.... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_12 | {
"fields": [
{
"declarator": "ipUtils = new IpUtils()",
"modifier": "private",
"original_string": "private IpUtils ipUtils = new IpUtils();",
"type": "IpUtils",
"var_name": "ipUtils"
},
{
"declarator": "ipDec = \"195.127.0.11\"",
"modifier": "private",
"ori... | {
"body": "@Test\n public void testIsIpAddress() {\n Assert.assertTrue(ipUtils.isIpAddress(ipDec));\n Assert.assertTrue(ipUtils.isIpAddress(ipHex));\n Assert.assertTrue(ipUtils.isIpAddress(ipOct));\n Assert.assertTrue(ipUtils.isIpAddress(ipBin));\n Assert.assertTrue(ipUtils.isIpA... | {
"fields": [
{
"declarator": "DECIMAL_PATTERN = Pattern.compile(\"(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\d{1,3})\")",
"modifier": "private static final",
"original_string": "private static final Pattern DECIMAL_PATTERN = Pattern.compile(\"(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\... | {
"body": "public boolean isIpAddress(String ip) {\n return isDecimalIpAddress(ip)\n || isBinaryIpAddress(ip)\n || isOctalEncodedIpAddress(ip)\n || isHexEncodedIpAddress(ip)\n || isNumericIpAddress(ip);\n }",
"class_method_signature": "IpUtils.isIpAddress(String... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_28 | {
"fields": [
{
"declarator": "dataSource",
"modifier": "static",
"original_string": "static DataSource dataSource;",
"type": "DataSource",
"var_name": "dataSource"
},
{
"declarator": "db = new SqlLocalDatabase()",
"modifier": "private",
"original_string": "... | {
"body": "@Test\n public void testContains() throws Exception {\n Assert.assertTrue(db.contains(\"1\", descriptor));\n Assert.assertTrue(db.contains(\"2\", descriptor));\n Assert.assertTrue(db.contains(\"3\", descriptor));\n Assert.assertTrue(db.contains(\"4\", descriptor));\n\n ... | {
"fields": [
{
"declarator": "BATCH_SIZE = 50 * 1000",
"modifier": "static final",
"original_string": "static final int BATCH_SIZE = 50 * 1000;",
"type": "int",
"var_name": "BATCH_SIZE"
},
{
"declarator": "LOGGER = LoggerFactory.getLogger(SqlLocalDatabase.class)",
... | {
"body": "@Override\n public boolean contains(String hash, ThreatListDescriptor descriptor) throws IOException {\n checkTableForDescriptor(descriptor);\n\n String sql = \"SELECT prefix FROM \" + descriptor + \" WHERE prefix=?\";\n try (Connection conn = dataSource.getConnection();\n ... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_24 | {
"fields": [
{
"declarator": "riceCompression = new RiceCompression()",
"modifier": "private",
"original_string": "private RiceCompression riceCompression = new RiceCompression();",
"type": "RiceCompression",
"var_name": "riceCompression"
},
{
"declarator": "data1 = \"... | {
"body": "@Test\n public void testDecompress1() {\n byte[] bytes = Base64.getDecoder().decode(data1);\n List<Integer> ls = riceCompression.decompress(parameter, bytes);\n\n Assert.assertEquals(336, ls.size());\n }",
"class_method_signature": "RiceCompressionTest.testDecompress1()",
"co... | {
"fields": [
{
"declarator": "BYTE_BITS_SIZE = 8",
"modifier": "public static final",
"original_string": "public static final int BYTE_BITS_SIZE = 8;",
"type": "int",
"var_name": "BYTE_BITS_SIZE"
}
],
"file": "core/src/main/java/kg/net/bazi/gsb4j/util/RiceCompression.java",
... | {
"body": "public List<Integer> decompress(int riceParameter, byte[] data) {\n BitSet bits = new BitSet(data.length * 8);\n\n for (int i = 0; i < data.length; i++) {\n BitSet bitsOfByte = BitSet.valueOf(makeArrayOfByte(data[i]));\n for (int j = 0; j < bitsOfByte.size(); j++) {\n ... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_8 | {
"fields": [
{
"declarator": "hashing = new Hashing()",
"modifier": "private",
"original_string": "private Hashing hashing = new Hashing();",
"type": "Hashing",
"var_name": "hashing"
}
],
"file": "core/src/test/java/kg/net/bazi/gsb4j/url/HashingTest.java",
"identifier": "H... | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testComputeHashPrefixWithInvalidParam3() {\n hashing.computeHashPrefix(\"abc\", 2);\n }",
"class_method_signature": "HashingTest.testComputeHashPrefixWithInvalidParam3()",
"constructor": false,
"full_signature": "@Test(expect... | {
"fields": [
{
"declarator": "MIN_SIGNIFICANT_BYTES = 4",
"modifier": "public static final",
"original_string": "public static final int MIN_SIGNIFICANT_BYTES = 4;",
"type": "int",
"var_name": "MIN_SIGNIFICANT_BYTES"
},
{
"declarator": "MAX_SIGNIFICANT_BYTES = 32",
... | {
"body": "public String computeHashPrefix(String expression, int significantBytes) {\n checkSignificantBytes(significantBytes);\n\n int hexDigitsLength = significantBytes * 2;\n return DigestUtils.sha256Hex(expression).substring(0, hexDigitsLength);\n }",
"class_method_signature": "Hashing.... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_27 | {
"fields": [
{
"declarator": "dataSource",
"modifier": "static",
"original_string": "static DataSource dataSource;",
"type": "DataSource",
"var_name": "dataSource"
},
{
"declarator": "db = new SqlLocalDatabase()",
"modifier": "private",
"original_string": "... | {
"body": "@Test\n public void testPersist() throws Exception {\n List<String> newValues = new ArrayList<>();\n newValues.add(\"abc\");\n newValues.add(\"def\");\n db.persist(descriptor, newValues);\n\n List<String> ls = db.load(descriptor);\n Assert.assertEquals(itemsCoun... | {
"fields": [
{
"declarator": "BATCH_SIZE = 50 * 1000",
"modifier": "static final",
"original_string": "static final int BATCH_SIZE = 50 * 1000;",
"type": "int",
"var_name": "BATCH_SIZE"
},
{
"declarator": "LOGGER = LoggerFactory.getLogger(SqlLocalDatabase.class)",
... | {
"body": "@Override\n public void persist(ThreatListDescriptor descriptor, List<String> hashes) throws IOException {\n checkTableForDescriptor(descriptor);\n\n String sql = \"INSERT INTO \" + descriptor + \" VALUES (?)\";\n try (Connection conn = dataSource.getConnection();\n Prepa... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_4 | {
"fields": [
{
"declarator": "hashing = new Hashing()",
"modifier": "private",
"original_string": "private Hashing hashing = new Hashing();",
"type": "Hashing",
"var_name": "hashing"
}
],
"file": "core/src/test/java/kg/net/bazi/gsb4j/url/HashingTest.java",
"identifier": "H... | {
"body": "@Test\n public void testComputeHashPrefix1() {\n String expression = \"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq\";\n String prefix = hashing.computeHashPrefix(expression, 6);\n Assert.assertEquals(\"248d6a61d206\", prefix);\n }",
"class_method_signature": "Hashi... | {
"fields": [
{
"declarator": "MIN_SIGNIFICANT_BYTES = 4",
"modifier": "public static final",
"original_string": "public static final int MIN_SIGNIFICANT_BYTES = 4;",
"type": "int",
"var_name": "MIN_SIGNIFICANT_BYTES"
},
{
"declarator": "MAX_SIGNIFICANT_BYTES = 32",
... | {
"body": "public String computeHashPrefix(String expression, int significantBytes) {\n checkSignificantBytes(significantBytes);\n\n int hexDigitsLength = significantBytes * 2;\n return DigestUtils.sha256Hex(expression).substring(0, hexDigitsLength);\n }",
"class_method_signature": "Hashing.... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_11 | {
"fields": [
{
"declarator": "hashing = new Hashing()",
"modifier": "private",
"original_string": "private Hashing hashing = new Hashing();",
"type": "Hashing",
"var_name": "hashing"
}
],
"file": "core/src/test/java/kg/net/bazi/gsb4j/url/HashingTest.java",
"identifier": "H... | {
"body": "@Test\n public void testComputeFullHash() {\n String fullHash = hashing.computeFullHash(\"abcdefg\");\n Assert.assertEquals(\"7d1a54127b222502f5b79b5fb0803061152a44f92b37e23c6527baf665d4da9a\", fullHash);\n }",
"class_method_signature": "HashingTest.testComputeFullHash()",
"construc... | {
"fields": [
{
"declarator": "MIN_SIGNIFICANT_BYTES = 4",
"modifier": "public static final",
"original_string": "public static final int MIN_SIGNIFICANT_BYTES = 4;",
"type": "int",
"var_name": "MIN_SIGNIFICANT_BYTES"
},
{
"declarator": "MAX_SIGNIFICANT_BYTES = 32",
... | {
"body": "public String computeFullHash(String expression) {\n return DigestUtils.sha256Hex(expression);\n }",
"class_method_signature": "Hashing.computeFullHash(String expression)",
"constructor": false,
"full_signature": "public String computeFullHash(String expression)",
"identifier": "computeFu... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_10 | {
"fields": [
{
"declarator": "hashing = new Hashing()",
"modifier": "private",
"original_string": "private Hashing hashing = new Hashing();",
"type": "Hashing",
"var_name": "hashing"
}
],
"file": "core/src/test/java/kg/net/bazi/gsb4j/url/HashingTest.java",
"identifier": "H... | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testComputeHashPrefixWithInvalidParam5() {\n hashing.computeHashPrefix(\"abc\", 33);\n }",
"class_method_signature": "HashingTest.testComputeHashPrefixWithInvalidParam5()",
"constructor": false,
"full_signature": "@Test(expec... | {
"fields": [
{
"declarator": "MIN_SIGNIFICANT_BYTES = 4",
"modifier": "public static final",
"original_string": "public static final int MIN_SIGNIFICANT_BYTES = 4;",
"type": "int",
"var_name": "MIN_SIGNIFICANT_BYTES"
},
{
"declarator": "MAX_SIGNIFICANT_BYTES = 32",
... | {
"body": "public String computeHashPrefix(String expression, int significantBytes) {\n checkSignificantBytes(significantBytes);\n\n int hexDigitsLength = significantBytes * 2;\n return DigestUtils.sha256Hex(expression).substring(0, hexDigitsLength);\n }",
"class_method_signature": "Hashing.... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_5 | {
"fields": [
{
"declarator": "hashing = new Hashing()",
"modifier": "private",
"original_string": "private Hashing hashing = new Hashing();",
"type": "Hashing",
"var_name": "hashing"
}
],
"file": "core/src/test/java/kg/net/bazi/gsb4j/url/HashingTest.java",
"identifier": "H... | {
"body": "@Test\n public void testComputeHashPrefix2() {\n String prefix = hashing.computeHashPrefix(\"abc\", 4);\n Assert.assertEquals(\"ba7816bf\", prefix);\n }",
"class_method_signature": "HashingTest.testComputeHashPrefix2()",
"constructor": false,
"full_signature": "@Test public void t... | {
"fields": [
{
"declarator": "MIN_SIGNIFICANT_BYTES = 4",
"modifier": "public static final",
"original_string": "public static final int MIN_SIGNIFICANT_BYTES = 4;",
"type": "int",
"var_name": "MIN_SIGNIFICANT_BYTES"
},
{
"declarator": "MAX_SIGNIFICANT_BYTES = 32",
... | {
"body": "public String computeHashPrefix(String expression, int significantBytes) {\n checkSignificantBytes(significantBytes);\n\n int hexDigitsLength = significantBytes * 2;\n return DigestUtils.sha256Hex(expression).substring(0, hexDigitsLength);\n }",
"class_method_signature": "Hashing.... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_26 | {
"fields": [
{
"declarator": "dataSource",
"modifier": "static",
"original_string": "static DataSource dataSource;",
"type": "DataSource",
"var_name": "dataSource"
},
{
"declarator": "db = new SqlLocalDatabase()",
"modifier": "private",
"original_string": "... | {
"body": "@Test\n public void testLoad() throws Exception {\n List<String> ls = db.load(descriptor);\n Assert.assertEquals(itemsCount, ls.size());\n Assert.assertTrue(ls.contains(\"1\"));\n Assert.assertTrue(ls.contains(\"2\"));\n }",
"class_method_signature": "SqlLocalDatabaseTes... | {
"fields": [
{
"declarator": "BATCH_SIZE = 50 * 1000",
"modifier": "static final",
"original_string": "static final int BATCH_SIZE = 50 * 1000;",
"type": "int",
"var_name": "BATCH_SIZE"
},
{
"declarator": "LOGGER = LoggerFactory.getLogger(SqlLocalDatabase.class)",
... | {
"body": "@Override\n public List<String> load(ThreatListDescriptor descriptor) throws IOException {\n checkTableForDescriptor(descriptor);\n\n String sql = \"SELECT prefix FROM \" + descriptor + \" ORDER BY prefix\";\n try (Connection conn = dataSource.getConnection();\n PreparedS... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_9 | {
"fields": [
{
"declarator": "hashing = new Hashing()",
"modifier": "private",
"original_string": "private Hashing hashing = new Hashing();",
"type": "Hashing",
"var_name": "hashing"
}
],
"file": "core/src/test/java/kg/net/bazi/gsb4j/url/HashingTest.java",
"identifier": "H... | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testComputeHashPrefixWithInvalidParam4() {\n hashing.computeHashPrefix(\"abc\", 3);\n }",
"class_method_signature": "HashingTest.testComputeHashPrefixWithInvalidParam4()",
"constructor": false,
"full_signature": "@Test(expect... | {
"fields": [
{
"declarator": "MIN_SIGNIFICANT_BYTES = 4",
"modifier": "public static final",
"original_string": "public static final int MIN_SIGNIFICANT_BYTES = 4;",
"type": "int",
"var_name": "MIN_SIGNIFICANT_BYTES"
},
{
"declarator": "MAX_SIGNIFICANT_BYTES = 32",
... | {
"body": "public String computeHashPrefix(String expression, int significantBytes) {\n checkSignificantBytes(significantBytes);\n\n int hexDigitsLength = significantBytes * 2;\n return DigestUtils.sha256Hex(expression).substring(0, hexDigitsLength);\n }",
"class_method_signature": "Hashing.... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_2 | {
"fields": [
{
"declarator": "expressions = new SuffixPrefixExpressions()",
"modifier": "private",
"original_string": "private SuffixPrefixExpressions expressions = new SuffixPrefixExpressions();",
"type": "SuffixPrefixExpressions",
"var_name": "expressions"
}
],
"file": "co... | {
"body": "@Test\n public void testMakeExpressions3() {\n Set<String> set = expressions.makeExpressions(\"http://1.2.3.4/1/\");\n Assert.assertEquals(2, set.size());\n Assert.assertTrue(set.contains(\"1.2.3.4/1/\"));\n Assert.assertTrue(set.contains(\"1.2.3.4/\"));\n\n }",
"class_m... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(SuffixPrefixExpressions.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(SuffixPrefixExpressions.class);",
"type": "Logger",
"var_name": "LOGGE... | {
"body": "public Set<String> makeExpressions(String url) {\n UrlSplitter.UrlParts parts = urlSplitter.split(url);\n if (parts == null) {\n LOGGER.info(\"URL cannot be split into parts: {}\", url);\n return Collections.emptySet();\n }\n\n Set<String> suffixExprSet = e... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_17 | {
"fields": [
{
"declarator": "ipUtils = new IpUtils()",
"modifier": "private",
"original_string": "private IpUtils ipUtils = new IpUtils();",
"type": "IpUtils",
"var_name": "ipUtils"
},
{
"declarator": "ipDec = \"195.127.0.11\"",
"modifier": "private",
"ori... | {
"body": "@Test\n public void testIsNumericIpAddress() {\n Assert.assertFalse(ipUtils.isNumericIpAddress(ipDec));\n Assert.assertFalse(ipUtils.isNumericIpAddress(ipHex));\n Assert.assertFalse(ipUtils.isNumericIpAddress(ipOct));\n Assert.assertFalse(ipUtils.isNumericIpAddress(ipBin));\n... | {
"fields": [
{
"declarator": "DECIMAL_PATTERN = Pattern.compile(\"(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\d{1,3})\")",
"modifier": "private static final",
"original_string": "private static final Pattern DECIMAL_PATTERN = Pattern.compile(\"(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\... | {
"body": "public boolean isNumericIpAddress(String ip) {\n try {\n Integer.parseUnsignedInt(ip);\n return true;\n } catch (NumberFormatException ex) {\n return false;\n }\n }",
"class_method_signature": "IpUtils.isNumericIpAddress(String ip)",
"constructor... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_21 | {
"fields": [
{
"declarator": "splitter = new UrlSplitter()",
"modifier": "private",
"original_string": "private UrlSplitter splitter = new UrlSplitter();",
"type": "UrlSplitter",
"var_name": "splitter"
}
],
"file": "core/src/test/java/kg/net/bazi/gsb4j/util/UrlSplitterTest.j... | {
"body": "@Test\n public void testSplit3() {\n UrlSplitter.UrlParts parts = splitter.split(\"http://example.com/path/1/\");\n\n Assert.assertEquals(\"http://\", parts.getScheme());\n Assert.assertEquals(\"example.com\", parts.getHost());\n Assert.assertNull(parts.getPort());\n A... | {
"fields": [
{
"declarator": "URL_PATTERN = Pattern.compile(\"(https?://)([^/:?]+)(:\\\\d+)?(/[^?]*)?(\\\\?.*)?\")",
"modifier": "private static final",
"original_string": "private static final Pattern URL_PATTERN = Pattern.compile(\"(https?://)([^/:?]+)(:\\\\d+)?(/[^?]*)?(\\\\?.*)?\");",
... | {
"body": "public UrlParts split(String url) {\n Matcher matcher = URL_PATTERN.matcher(url.trim());\n if (matcher.matches()) {\n UrlParts parts = new UrlParts();\n parts.scheme = matcher.group(1);\n parts.host = matcher.group(2);\n parts.port = matcher.group(3... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_20 | {
"fields": [
{
"declarator": "splitter = new UrlSplitter()",
"modifier": "private",
"original_string": "private UrlSplitter splitter = new UrlSplitter();",
"type": "UrlSplitter",
"var_name": "splitter"
}
],
"file": "core/src/test/java/kg/net/bazi/gsb4j/util/UrlSplitterTest.j... | {
"body": "@Test\n public void testSplit2() {\n UrlSplitter.UrlParts parts = splitter.split(\"http://example.com?param=1\");\n\n Assert.assertEquals(\"http://\", parts.getScheme());\n Assert.assertEquals(\"example.com\", parts.getHost());\n Assert.assertNull(parts.getPort());\n A... | {
"fields": [
{
"declarator": "URL_PATTERN = Pattern.compile(\"(https?://)([^/:?]+)(:\\\\d+)?(/[^?]*)?(\\\\?.*)?\")",
"modifier": "private static final",
"original_string": "private static final Pattern URL_PATTERN = Pattern.compile(\"(https?://)([^/:?]+)(:\\\\d+)?(/[^?]*)?(\\\\?.*)?\");",
... | {
"body": "public UrlParts split(String url) {\n Matcher matcher = URL_PATTERN.matcher(url.trim());\n if (matcher.matches()) {\n UrlParts parts = new UrlParts();\n parts.scheme = matcher.group(1);\n parts.host = matcher.group(2);\n parts.port = matcher.group(3... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_16 | {
"fields": [
{
"declarator": "ipUtils = new IpUtils()",
"modifier": "private",
"original_string": "private IpUtils ipUtils = new IpUtils();",
"type": "IpUtils",
"var_name": "ipUtils"
},
{
"declarator": "ipDec = \"195.127.0.11\"",
"modifier": "private",
"ori... | {
"body": "@Test\n public void testIsHexEncodedIpAddress() {\n Assert.assertFalse(ipUtils.isHexEncodedIpAddress(ipDec));\n Assert.assertTrue(ipUtils.isHexEncodedIpAddress(ipHex));\n Assert.assertFalse(ipUtils.isHexEncodedIpAddress(ipOct));\n Assert.assertFalse(ipUtils.isHexEncodedIpAddr... | {
"fields": [
{
"declarator": "DECIMAL_PATTERN = Pattern.compile(\"(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\d{1,3})\")",
"modifier": "private static final",
"original_string": "private static final Pattern DECIMAL_PATTERN = Pattern.compile(\"(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\... | {
"body": "public boolean isHexEncodedIpAddress(String ip) {\n return HEX_PATTERN.matcher(ip).matches();\n }",
"class_method_signature": "IpUtils.isHexEncodedIpAddress(String ip)",
"constructor": false,
"full_signature": "public boolean isHexEncodedIpAddress(String ip)",
"identifier": "isHexEncodedI... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
142763963_3 | {
"fields": [
{
"declarator": "canon = new Canonicalization()",
"modifier": "private",
"original_string": "private Canonicalization canon = new Canonicalization();",
"type": "Canonicalization",
"var_name": "canon"
}
],
"file": "core/src/test/java/kg/net/bazi/gsb4j/url/Canonic... | {
"body": "@Test\n public void testCanonicalize() throws MalformedURLException, URISyntaxException, DecoderException {\n\n Assert.assertEquals(\"http://host/%25\", canon.canonicalize(\"http://host/%25%32%35\"));\n Assert.assertEquals(\"http://host/%25%25\", canon.canonicalize(\"http://host/%25%32%35%... | {
"fields": [
{
"declarator": "HTTP_SCHEME_PATTERN = Pattern.compile(\"^https?://\")",
"modifier": "private static final",
"original_string": "private static final Pattern HTTP_SCHEME_PATTERN = Pattern.compile(\"^https?://\");",
"type": "Pattern",
"var_name": "HTTP_SCHEME_PATTERN"
... | {
"body": "public String canonicalize(String url) throws MalformedURLException {\n NormalizedUrl normalized = normalize(url);\n\n String host = normalized.host;\n // remove all leading and trailing dots and replace multiplce occurrences of dots to single ones\n host = host.replaceFirst(\"^... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 142763963,
"size": 321,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/bazi/gsb4j"
} |
124230133_7 | {
"fields": [
{
"declarator": "wireMockRule = new WireMockClassRule(8089)",
"modifier": "@ClassRule\n public static",
"original_string": "@ClassRule\n public static WireMockClassRule wireMockRule = new WireMockClassRule(8089);",
"type": "WireMockClassRule",
"var_name": "wireMoc... | {
"body": "@Test\n public void responseIsEmptyShouldReturnEmptyList() throws ExecutionException, InterruptedException {\n instanceRule.stubFor(WireMock.get(urlEqualTo(\"/range/5BAA6\")).willReturn(aResponse().withBody(\"003D68EB55068C33ACE09247EE4C639306B:3\\n\" +\n \"012C192B2F16F82EA0EB9EF1... | {
"fields": [
{
"declarator": "httpClient",
"modifier": "private final",
"original_string": "private final OkHttpClient httpClient;",
"type": "OkHttpClient",
"var_name": "httpClient"
},
{
"declarator": "url",
"modifier": "private final",
"original_string": "... | {
"body": "CompletableFuture<List<Hex>> fetchHashesAsync(Hex hashedPassword) {\n Call call = httpClient.newCall(buildRequest(hashedPassword));\n CompletableFuture<List<Hex>> future = new CompletableFuture<>();\n\n call.enqueue(new Callback() {\n\n @Override\n public void onF... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124230133,
"size": 50,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/nbaars/pwnedpasswords4j"
} |
124230133_6 | {
"fields": [
{
"declarator": "wireMockRule = new WireMockClassRule(8089)",
"modifier": "@ClassRule\n public static",
"original_string": "@ClassRule\n public static WireMockClassRule wireMockRule = new WireMockClassRule(8089);",
"type": "WireMockClassRule",
"var_name": "wireMoc... | {
"body": "@Test\n public void responseIsNotFoundShouldThrowException() {\n PwnedPasswordClient pwnedPasswordClient = new PwnedPasswordClient(new OkHttpClient(), \"http://localhost:8089\", \"unit-test\");\n\n try {\n pwnedPasswordClient.fetchHashesAsync(Hex.from(\"password\")).get();\n ... | {
"fields": [
{
"declarator": "httpClient",
"modifier": "private final",
"original_string": "private final OkHttpClient httpClient;",
"type": "OkHttpClient",
"var_name": "httpClient"
},
{
"declarator": "url",
"modifier": "private final",
"original_string": "... | {
"body": "CompletableFuture<List<Hex>> fetchHashesAsync(Hex hashedPassword) {\n Call call = httpClient.newCall(buildRequest(hashedPassword));\n CompletableFuture<List<Hex>> future = new CompletableFuture<>();\n\n call.enqueue(new Callback() {\n\n @Override\n public void onF... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124230133,
"size": 50,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/nbaars/pwnedpasswords4j"
} |
124230133_1 | {
"fields": [],
"file": "pwnedpasswords4j-client/src/test/java/com/github/nbaars/pwnedpasswords4j/client/PwnedPasswordCheckerTest.java",
"identifier": "PwnedPasswordCheckerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void resultsFromClientWithoutMatchShouldNotFindPassword() {\n PwnedPasswordClient client = Mockito.mock(PwnedPasswordClient.class);\n doAnswer(invocation -> CompletableFuture.completedFuture(Arrays.asList(Hex.from(\"ae\"))))\n .when(client).fetchHashesAsync(an... | {
"fields": [
{
"declarator": "client",
"modifier": "private final",
"original_string": "private final PwnedPasswordClient client;",
"type": "PwnedPasswordClient",
"var_name": "client"
}
],
"file": "pwnedpasswords4j-client/src/main/java/com/github/nbaars/pwnedpasswords4j/clie... | {
"body": "public boolean check(String password) {\n try {\n return asyncCheck(password).get();\n } catch (InterruptedException | ExecutionException e) {\n throw new RuntimeException(e);\n }\n }",
"class_method_signature": "PwnedPasswordChecker.check(String password)",
... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124230133,
"size": 50,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/nbaars/pwnedpasswords4j"
} |
124230133_0 | {
"fields": [],
"file": "pwnedpasswords4j-client/src/test/java/com/github/nbaars/pwnedpasswords4j/client/PwnedPasswordCheckerTest.java",
"identifier": "PwnedPasswordCheckerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void noResultsFromClientShouldNotFindPassword() {\n PwnedPasswordClient client = Mockito.mock(PwnedPasswordClient.class);\n doAnswer(invocation -> CompletableFuture.completedFuture(new ArrayList<>()))\n .when(client).fetchHashesAsync(any());\n\n boolean... | {
"fields": [
{
"declarator": "client",
"modifier": "private final",
"original_string": "private final PwnedPasswordClient client;",
"type": "PwnedPasswordClient",
"var_name": "client"
}
],
"file": "pwnedpasswords4j-client/src/main/java/com/github/nbaars/pwnedpasswords4j/clie... | {
"body": "public boolean check(String password) {\n try {\n return asyncCheck(password).get();\n } catch (InterruptedException | ExecutionException e) {\n throw new RuntimeException(e);\n }\n }",
"class_method_signature": "PwnedPasswordChecker.check(String password)",
... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124230133,
"size": 50,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/nbaars/pwnedpasswords4j"
} |
124230133_3 | {
"fields": [],
"file": "pwnedpasswords4j-client/src/test/java/com/github/nbaars/pwnedpasswords4j/client/PwnedPasswordCheckerTest.java",
"identifier": "PwnedPasswordCheckerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void multipleHashesWithPasswordShouldFindPassword() {\n PwnedPasswordClient client = Mockito.mock(PwnedPasswordClient.class);\n doAnswer(invocation -> CompletableFuture.completedFuture(Arrays.asList(Hex.from(\"5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8\"))))\n .... | {
"fields": [
{
"declarator": "client",
"modifier": "private final",
"original_string": "private final PwnedPasswordClient client;",
"type": "PwnedPasswordClient",
"var_name": "client"
}
],
"file": "pwnedpasswords4j-client/src/main/java/com/github/nbaars/pwnedpasswords4j/clie... | {
"body": "public boolean check(String password) {\n try {\n return asyncCheck(password).get();\n } catch (InterruptedException | ExecutionException e) {\n throw new RuntimeException(e);\n }\n }",
"class_method_signature": "PwnedPasswordChecker.check(String password)",
... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124230133,
"size": 50,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/nbaars/pwnedpasswords4j"
} |
124230133_2 | {
"fields": [],
"file": "pwnedpasswords4j-client/src/test/java/com/github/nbaars/pwnedpasswords4j/client/PwnedPasswordCheckerTest.java",
"identifier": "PwnedPasswordCheckerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void resultsFromClientWithMatchShouldFindPassword() {\n PwnedPasswordClient client = Mockito.mock(PwnedPasswordClient.class);\n doAnswer(invocation -> CompletableFuture.completedFuture(Arrays.asList(Hex.from(\"5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8\"))))\n .... | {
"fields": [
{
"declarator": "client",
"modifier": "private final",
"original_string": "private final PwnedPasswordClient client;",
"type": "PwnedPasswordClient",
"var_name": "client"
}
],
"file": "pwnedpasswords4j-client/src/main/java/com/github/nbaars/pwnedpasswords4j/clie... | {
"body": "public boolean check(String password) {\n try {\n return asyncCheck(password).get();\n } catch (InterruptedException | ExecutionException e) {\n throw new RuntimeException(e);\n }\n }",
"class_method_signature": "PwnedPasswordChecker.check(String password)",
... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124230133,
"size": 50,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/nbaars/pwnedpasswords4j"
} |
124230133_5 | {
"fields": [
{
"declarator": "wireMockRule = new WireMockClassRule(8089)",
"modifier": "@ClassRule\n public static",
"original_string": "@ClassRule\n public static WireMockClassRule wireMockRule = new WireMockClassRule(8089);",
"type": "WireMockClassRule",
"var_name": "wireMoc... | {
"body": "@Test\n public void wrongURLShouldThrowException() {\n PwnedPasswordClient pwnedPasswordClient = new PwnedPasswordClient(new OkHttpClient(), \"http://localhost:1111\", \"unit-test\");\n\n try {\n pwnedPasswordClient.fetchHashesAsync(Hex.from(\"password\")).get();\n fa... | {
"fields": [
{
"declarator": "httpClient",
"modifier": "private final",
"original_string": "private final OkHttpClient httpClient;",
"type": "OkHttpClient",
"var_name": "httpClient"
},
{
"declarator": "url",
"modifier": "private final",
"original_string": "... | {
"body": "CompletableFuture<List<Hex>> fetchHashesAsync(Hex hashedPassword) {\n Call call = httpClient.newCall(buildRequest(hashedPassword));\n CompletableFuture<List<Hex>> future = new CompletableFuture<>();\n\n call.enqueue(new Callback() {\n\n @Override\n public void onF... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124230133,
"size": 50,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/nbaars/pwnedpasswords4j"
} |
124230133_8 | {
"fields": [
{
"declarator": "wireMockRule = new WireMockClassRule(8089)",
"modifier": "@ClassRule\n public static",
"original_string": "@ClassRule\n public static WireMockClassRule wireMockRule = new WireMockClassRule(8089);",
"type": "WireMockClassRule",
"var_name": "wireMoc... | {
"body": "@Test\n public void wrongHashReturns400() {\n instanceRule.stubFor(WireMock.get(urlEqualTo(\"/range/5BAA6A\")).willReturn(aResponse().withStatus(400)));\n PwnedPasswordClient pwnedPasswordClient = new PwnedPasswordClient(new OkHttpClient(), \"http://localhost:8089/range\", \"unit-test\");\... | {
"fields": [
{
"declarator": "httpClient",
"modifier": "private final",
"original_string": "private final OkHttpClient httpClient;",
"type": "OkHttpClient",
"var_name": "httpClient"
},
{
"declarator": "url",
"modifier": "private final",
"original_string": "... | {
"body": "CompletableFuture<List<Hex>> fetchHashesAsync(Hex hashedPassword) {\n Call call = httpClient.newCall(buildRequest(hashedPassword));\n CompletableFuture<List<Hex>> future = new CompletableFuture<>();\n\n call.enqueue(new Callback() {\n\n @Override\n public void onF... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124230133,
"size": 50,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/nbaars/pwnedpasswords4j"
} |
124230133_4 | {
"fields": [],
"file": "pwnedpasswords4j-client/src/test/java/com/github/nbaars/pwnedpasswords4j/client/PwnedPasswordCheckerTest.java",
"identifier": "PwnedPasswordCheckerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void asyncMultipleHashesWithPasswordShouldFindPassword() throws ExecutionException, InterruptedException {\n PwnedPasswordClient client = Mockito.mock(PwnedPasswordClient.class);\n doAnswer(invocation -> CompletableFuture.completedFuture(Arrays.asList(Hex.from(\"5baa61e4c9b9... | {
"fields": [
{
"declarator": "client",
"modifier": "private final",
"original_string": "private final PwnedPasswordClient client;",
"type": "PwnedPasswordClient",
"var_name": "client"
}
],
"file": "pwnedpasswords4j-client/src/main/java/com/github/nbaars/pwnedpasswords4j/clie... | {
"body": "public CompletableFuture<Boolean> asyncCheck(String password) {\n Hex hashedPassword = hashPassword(password);\n return client.fetchHashesAsync(hashedPassword).thenApplyAsync(x -> x.contains(hashedPassword));\n }",
"class_method_signature": "PwnedPasswordChecker.asyncCheck(String passwor... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124230133,
"size": 50,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/nbaars/pwnedpasswords4j"
} |
23491281_1 | {
"fields": [],
"file": "ilves-vaadin/src/test/java/org/bubblecloud/ilves/security/OAuthServiceTest.java",
"identifier": "OAuthServiceTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n @Ignore\n public void getGetEmail() throws Exception {\n final String response = OAuthService.getEmail(\"xxx\");\n Assert.assertEquals(\"tommi.s.e.laukkanen@gmail.com\", response);\n }",
"class_method_signature": "OAuthServiceTest.getGetEmail()",
"constructor": false,
"... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(OAuthService.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(OAuthService.class);",
"type": "Logger",
"var_name": "LOGGER"
}
],
"file": "ilves-vaadi... | {
"body": "public static String getEmail(String accessToken) throws Exception {\n final String response = get(\"https://api.github.com/user/emails?access_token\", accessToken);\n ObjectMapper objectMapper = new ObjectMapper();\n final ArrayList<Map<String, Object>> emailList = objectMapper.readVa... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23491281,
"size": 1833,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/bubblecloud/ilves"
} |
23491281_0 | {
"fields": [],
"file": "ilves-vaadin/src/test/java/org/bubblecloud/ilves/security/OAuthServiceTest.java",
"identifier": "OAuthServiceTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n @Ignore\n public void testGet() throws Exception {\n final String response = OAuthService.get(\"https://api.github.com/user/emails\", \"xxx\");\n ObjectMapper objectMapper = new ObjectMapper();\n final ArrayList<Map<String, Object>> emailList = (ArrayList<Map<String, Obje... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(OAuthService.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(OAuthService.class);",
"type": "Logger",
"var_name": "LOGGER"
}
],
"file": "ilves-vaadi... | {
"body": "public static String get(final String url, final String accessToken) throws Exception {\n final HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(url).openConnection();\n httpURLConnection.setRequestMethod(\"GET\");\n httpURLConnection.setRequestProperty(\"User-Agent\",... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23491281,
"size": 1833,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/bubblecloud/ilves"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.