id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
22337952_24 | {
"fields": [
{
"declarator": "mSkus",
"modifier": "@Nonnull\n private",
"original_string": "@Nonnull\n private Skus mSkus;",
"type": "Skus",
"var_name": "mSkus"
}
],
"file": "lib/src/test/java/org/solovyev/android/checkout/SkusTest.java",
"identifier": "SkusTest",
... | {
"body": "@Test\n public void testShouldReadEmptyList() throws Exception {\n final Bundle bundle = new Bundle();\n bundle.putStringArrayList(Skus.BUNDLE_LIST, new ArrayList<String>());\n final Skus skus = Skus.fromBundle(bundle, \"test\");\n assertTrue(skus.list.isEmpty());\n }",
... | {
"fields": [
{
"declarator": "BUNDLE_LIST = \"DETAILS_LIST\"",
"modifier": "@Nonnull\n static final",
"original_string": "@Nonnull\n static final String BUNDLE_LIST = \"DETAILS_LIST\";",
"type": "String",
"var_name": "BUNDLE_LIST"
},
{
"declarator": "product",
... | {
"body": "@Nonnull\n static Skus fromBundle(@Nonnull Bundle bundle, @Nonnull String product) throws RequestException {\n final List<String> list = extractList(bundle);\n\n final List<Sku> skus = new ArrayList<>(list.size());\n for (String response : list) {\n try {\n ... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_9 | {
"fields": [],
"file": "lib/src/test/java/org/solovyev/android/checkout/PurchasesTest.java",
"identifier": "PurchasesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testShouldJson() throws Exception {\n final JSONObject purchaseJson2 = PurchaseTest.newJsonObject(2, PURCHASED);\n purchaseJson2.put(\"autoRenewing\", true);\n final Purchase purchase2 = Purchase.fromJson(purchaseJson2.toString(), \"signature\" + 2);\n fin... | {
"fields": [
{
"declarator": "BUNDLE_DATA_LIST = \"INAPP_PURCHASE_DATA_LIST\"",
"modifier": "static final",
"original_string": "static final String BUNDLE_DATA_LIST = \"INAPP_PURCHASE_DATA_LIST\";",
"type": "String",
"var_name": "BUNDLE_DATA_LIST"
},
{
"declarator": "B... | {
"body": "@Nonnull\n JSONObject toJsonObject(boolean withSignatures) {\n final JSONObject json = new JSONObject();\n try {\n json.put(\"product\", product);\n final JSONArray array = new JSONArray();\n for (int i = 0; i < list.size(); i++) {\n final Pu... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_49 | {
"fields": [],
"file": "lib/src/test/java/org/solovyev/android/checkout/SkuTest.java",
"identifier": "SkuTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSubscriptionSkuShouldBeCreatedFromJson() throws Exception {\n final Sku sku = Sku.fromJson(newSubscriptionJson(\"1\"), ProductTypes.SUBSCRIPTION);\n\n verifySku(sku, \"1\");\n }",
"class_method_signature": "SkuTest.testSubscriptionSkuShouldBeCreatedFromJson()",... | {
"fields": [
{
"declarator": "id",
"modifier": "@Nonnull\n public final",
"original_string": "@Nonnull\n public final Id id;",
"type": "Id",
"var_name": "id"
},
{
"declarator": "price",
"modifier": "@Nonnull\n public final",
"original_string": "@No... | {
"body": "@Nonnull\n static Sku fromJson(@Nonnull String json, @Nonnull String product) throws JSONException {\n return new Sku(json, product);\n }",
"class_method_signature": "Sku.fromJson(@Nonnull String json, @Nonnull String product)",
"constructor": false,
"full_signature": "@Nonnull static Sk... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_31 | {
"fields": [],
"file": "lib/src/test/java/org/solovyev/android/checkout/PurchaseRequestTest.java",
"identifier": "PurchaseRequestTest",
"interfaces": "",
"superclass": "extends RequestTestBase"
} | {
"body": "@Test\n public void testShouldUseExtraParams() throws Exception {\n final Bundle extraParams = new Bundle();\n extraParams.putString(\"extra\", \"test\");\n final PurchaseRequest request = new PurchaseRequest(\"product\", \"sku\", \"payload\", extraParams);\n final IInAppBill... | {
"fields": [
{
"declarator": "mProduct",
"modifier": "@Nonnull\n private final",
"original_string": "@Nonnull\n private final String mProduct;",
"type": "String",
"var_name": "mProduct"
},
{
"declarator": "mSku",
"modifier": "@Nonnull\n private final",
... | {
"body": "@Override\n void start(@Nonnull IInAppBillingService service, @Nonnull String packageName) throws RemoteException, RequestException {\n final String payload = mPayload == null ? \"\" : mPayload;\n final Bundle bundle = mExtraParams != null ? service.getBuyIntentExtraParams(mApiVersion, pac... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_27 | {
"fields": [],
"file": "lib/src/test/java/org/solovyev/android/checkout/BillingSupportedRequestTest.java",
"identifier": "BillingSupportedRequestTest",
"interfaces": "",
"superclass": "extends RequestTestBase"
} | {
"body": "@Test\n public void testShouldHaveDifferentCacheKeys() throws Exception {\n final BillingSupportedRequest r1 = newRequest(\"test1\");\n final BillingSupportedRequest r2 = newRequest(\"test2\");\n\n assertNotEquals(r1.getCacheKey(), r2.getCacheKey());\n }",
"class_method_signatu... | {
"fields": [
{
"declarator": "mProduct",
"modifier": "@Nonnull\n private final",
"original_string": "@Nonnull\n private final String mProduct;",
"type": "String",
"var_name": "mProduct"
},
{
"declarator": "mExtraParams",
"modifier": "@Nullable\n private ... | {
"body": "@Nullable\n @Override\n protected String getCacheKey() {\n if (mExtraParams != null) {\n // disable cache if there are any extra parameters\n return null;\n }\n if (mApiVersion == Billing.V3) {\n return mProduct;\n }\n return mProduc... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_50 | {
"fields": [],
"file": "lib/src/test/java/org/solovyev/android/checkout/SkuTest.java",
"identifier": "SkuTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testShouldHaveNotValidPriceIfNoDetailedDataAvailable() throws Exception {\n final Sku sku = Sku.fromJson(newInAppJson(\"1\"), \"test\");\n\n assertFalse(sku.detailedPrice.isValid());\n }",
"class_method_signature": "SkuTest.testShouldHaveNotValidPriceIfNoDetailedDa... | {
"fields": [
{
"declarator": "id",
"modifier": "@Nonnull\n public final",
"original_string": "@Nonnull\n public final Id id;",
"type": "Id",
"var_name": "id"
},
{
"declarator": "price",
"modifier": "@Nonnull\n public final",
"original_string": "@No... | {
"body": "@Nonnull\n static Sku fromJson(@Nonnull String json, @Nonnull String product) throws JSONException {\n return new Sku(json, product);\n }",
"class_method_signature": "Sku.fromJson(@Nonnull String json, @Nonnull String product)",
"constructor": false,
"full_signature": "@Nonnull static Sk... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_11 | {
"fields": [],
"file": "lib/src/test/java/org/solovyev/android/checkout/PurchasesTest.java",
"identifier": "PurchasesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testShouldNeutralizePurchasesWithSameSkus() throws Exception {\n List<Purchase> purchases = Purchases.neutralize(asList(newPurchase(\"test\", 100, PURCHASED),\n newPurchase(\"test\", 120, CANCELLED),\n newPurchase(\"test\", 135, PURCHASED)));\n\n ... | {
"fields": [
{
"declarator": "BUNDLE_DATA_LIST = \"INAPP_PURCHASE_DATA_LIST\"",
"modifier": "static final",
"original_string": "static final String BUNDLE_DATA_LIST = \"INAPP_PURCHASE_DATA_LIST\";",
"type": "String",
"var_name": "BUNDLE_DATA_LIST"
},
{
"declarator": "B... | {
"body": "@Nonnull\n static List<Purchase> neutralize(@Nonnull List<Purchase> purchases) {\n // probably, it's possible to avoid creation of temporary list. The reason for it is that we don't want to\n // modify original list\n purchases = new LinkedList<>(purchases);\n\n final List<Pu... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_6 | {
"fields": [],
"file": "lib/src/test/java/org/solovyev/android/checkout/PurchasesTest.java",
"identifier": "PurchasesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testShouldReadContinuationToken() throws Exception {\n final Bundle bundle = prepareBundle();\n bundle.putString(Purchases.BUNDLE_CONTINUATION_TOKEN, \"token\");\n final Purchases purchases = Purchases.fromBundle(bundle, \"test\");\n\n assertEquals(\"token... | {
"fields": [
{
"declarator": "BUNDLE_DATA_LIST = \"INAPP_PURCHASE_DATA_LIST\"",
"modifier": "static final",
"original_string": "static final String BUNDLE_DATA_LIST = \"INAPP_PURCHASE_DATA_LIST\";",
"type": "String",
"var_name": "BUNDLE_DATA_LIST"
},
{
"declarator": "B... | {
"body": "@Nonnull\n static Purchases fromBundle(@Nonnull Bundle bundle, @Nonnull String product) throws JSONException {\n final String continuationToken = getContinuationTokenFromBundle(bundle);\n final List<Purchase> purchases = getListFromBundle(bundle);\n return new Purchases(product, pur... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_46 | {
"fields": [
{
"declarator": "mListener",
"modifier": "@Nonnull\n private",
"original_string": "@Nonnull\n private RequestListener mListener;",
"type": "RequestListener",
"var_name": "mListener"
},
{
"declarator": "mFlow",
"modifier": "@Nonnull\n private... | {
"body": "@Test\n public void testShouldErrorWithEmptySignature() throws Exception {\n mFlow.onActivityResult(1, RESULT_OK, newIntent(OK, \"{productId:'test', purchaseTime:1000}\", \"\"));\n\n verifyError(ResponseCodes.WRONG_SIGNATURE, RuntimeException.class);\n }",
"class_method_signature": "P... | {
"fields": [
{
"declarator": "EXTRA_RESPONSE = \"RESPONSE_CODE\"",
"modifier": "static final",
"original_string": "static final String EXTRA_RESPONSE = \"RESPONSE_CODE\";",
"type": "String",
"var_name": "EXTRA_RESPONSE"
},
{
"declarator": "EXTRA_PURCHASE_DATA = \"INAPP... | {
"body": "void onActivityResult(int requestCode, int resultCode, Intent intent) {\n try {\n Check.equals(mRequestCode, requestCode);\n if (intent == null) {\n // sometimes intent is null (it's not obvious when it happens but it happens from time to time)\n h... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_47 | {
"fields": [
{
"declarator": "mListener",
"modifier": "@Nonnull\n private",
"original_string": "@Nonnull\n private RequestListener mListener;",
"type": "RequestListener",
"var_name": "mListener"
},
{
"declarator": "mFlow",
"modifier": "@Nonnull\n private... | {
"body": "@Test\n public void testShouldErrorIfVerificationFailed() throws Exception {\n Tests.mockVerifier(mVerifier, false);\n mFlow.onActivityResult(1, RESULT_OK, newIntent(OK, \"{productId:'test', purchaseTime:1000}\", \"signature\"));\n\n verifyError(ResponseCodes.WRONG_SIGNATURE, Runtim... | {
"fields": [
{
"declarator": "EXTRA_RESPONSE = \"RESPONSE_CODE\"",
"modifier": "static final",
"original_string": "static final String EXTRA_RESPONSE = \"RESPONSE_CODE\";",
"type": "String",
"var_name": "EXTRA_RESPONSE"
},
{
"declarator": "EXTRA_PURCHASE_DATA = \"INAPP... | {
"body": "void onActivityResult(int requestCode, int resultCode, Intent intent) {\n try {\n Check.equals(mRequestCode, requestCode);\n if (intent == null) {\n // sometimes intent is null (it's not obvious when it happens but it happens from time to time)\n h... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_10 | {
"fields": [],
"file": "lib/src/test/java/org/solovyev/android/checkout/PurchasesTest.java",
"identifier": "PurchasesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testShouldJsonEmptyList() throws Exception {\n final Purchases purchases = new Purchases(\"test\", Collections.<Purchase>emptyList(), null);\n final JSONObject json = purchases.toJsonObject(true);\n final JSONArray jsonArray = json.getJSONArray(\"list\");\n ... | {
"fields": [
{
"declarator": "BUNDLE_DATA_LIST = \"INAPP_PURCHASE_DATA_LIST\"",
"modifier": "static final",
"original_string": "static final String BUNDLE_DATA_LIST = \"INAPP_PURCHASE_DATA_LIST\";",
"type": "String",
"var_name": "BUNDLE_DATA_LIST"
},
{
"declarator": "B... | {
"body": "@Nonnull\n JSONObject toJsonObject(boolean withSignatures) {\n final JSONObject json = new JSONObject();\n try {\n json.put(\"product\", product);\n final JSONArray array = new JSONArray();\n for (int i = 0; i < list.size(); i++) {\n final Pu... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_7 | {
"fields": [],
"file": "lib/src/test/java/org/solovyev/android/checkout/PurchasesTest.java",
"identifier": "PurchasesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testShouldIncludeSignaturesInJson() throws Exception {\n final Purchases purchases = new Purchases(\"test\", asList(newPurchase(0), newPurchase(1), newPurchase(2)), null);\n\n final JSONObject json = purchases.toJsonObject(true);\n final JSONArray jsonArray = jso... | {
"fields": [
{
"declarator": "BUNDLE_DATA_LIST = \"INAPP_PURCHASE_DATA_LIST\"",
"modifier": "static final",
"original_string": "static final String BUNDLE_DATA_LIST = \"INAPP_PURCHASE_DATA_LIST\";",
"type": "String",
"var_name": "BUNDLE_DATA_LIST"
},
{
"declarator": "B... | {
"body": "@Nonnull\n JSONObject toJsonObject(boolean withSignatures) {\n final JSONObject json = new JSONObject();\n try {\n json.put(\"product\", product);\n final JSONArray array = new JSONArray();\n for (int i = 0; i < list.size(); i++) {\n final Pu... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_51 | {
"fields": [],
"file": "lib/src/test/java/org/solovyev/android/checkout/SkuTest.java",
"identifier": "SkuTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testShouldHaveNotValidIntroductoryPriceIfNoDetailedDataAvailable() throws Exception {\n final Sku sku = Sku.fromJson(newSubscriptionJson(\"1\"), \"test\");\n\n assertNotNull(sku.detailedIntroductoryPrice);\n assertFalse(sku.detailedIntroductoryPrice.isValid());\n... | {
"fields": [
{
"declarator": "id",
"modifier": "@Nonnull\n public final",
"original_string": "@Nonnull\n public final Id id;",
"type": "Id",
"var_name": "id"
},
{
"declarator": "price",
"modifier": "@Nonnull\n public final",
"original_string": "@No... | {
"body": "@Nonnull\n static Sku fromJson(@Nonnull String json, @Nonnull String product) throws JSONException {\n return new Sku(json, product);\n }",
"class_method_signature": "Sku.fromJson(@Nonnull String json, @Nonnull String product)",
"constructor": false,
"full_signature": "@Nonnull static Sk... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_26 | {
"fields": [
{
"declarator": "mSkus",
"modifier": "@Nonnull\n private",
"original_string": "@Nonnull\n private Skus mSkus;",
"type": "Skus",
"var_name": "mSkus"
}
],
"file": "lib/src/test/java/org/solovyev/android/checkout/SkusTest.java",
"identifier": "SkusTest",
... | {
"body": "@Test\n public void testShouldReadSkus() throws Exception {\n final ArrayList<String> list = new ArrayList<String>();\n list.add(SkuTest.newInAppJson(\"1\"));\n list.add(SkuTest.newInAppJson(\"2\"));\n list.add(SkuTest.newSubscriptionJson(\"3\"));\n list.add(SkuTest.ne... | {
"fields": [
{
"declarator": "BUNDLE_LIST = \"DETAILS_LIST\"",
"modifier": "@Nonnull\n static final",
"original_string": "@Nonnull\n static final String BUNDLE_LIST = \"DETAILS_LIST\";",
"type": "String",
"var_name": "BUNDLE_LIST"
},
{
"declarator": "product",
... | {
"body": "@Nonnull\n static Skus fromBundle(@Nonnull Bundle bundle, @Nonnull String product) throws RequestException {\n final List<String> list = extractList(bundle);\n\n final List<Sku> skus = new ArrayList<>(list.size());\n for (String response : list) {\n try {\n ... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_30 | {
"fields": [],
"file": "lib/src/test/java/org/solovyev/android/checkout/ConsumePurchaseRequestTest.java",
"identifier": "ConsumePurchaseRequestTest",
"interfaces": "",
"superclass": "extends RequestTestBase"
} | {
"body": "@Test\n public void testShouldNotBeCached() throws Exception {\n assertNull(newRequest().getCacheKey());\n }",
"class_method_signature": "ConsumePurchaseRequestTest.testShouldNotBeCached()",
"constructor": false,
"full_signature": "@Test public void testShouldNotBeCached()",
"identifie... | {
"fields": [
{
"declarator": "mToken",
"modifier": "@Nonnull\n private final",
"original_string": "@Nonnull\n private final String mToken;",
"type": "String",
"var_name": "mToken"
}
],
"file": "lib/src/main/java/org/solovyev/android/checkout/ConsumePurchaseRequest.java... | {
"body": "@Nullable\n @Override\n protected String getCacheKey() {\n return null;\n }",
"class_method_signature": "ConsumePurchaseRequest.getCacheKey()",
"constructor": false,
"full_signature": "@Nullable @Override protected String getCacheKey()",
"identifier": "getCacheKey",
"invocations":... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_56 | {
"fields": [
{
"declarator": "mService",
"modifier": "@Nonnull\n private",
"original_string": "@Nonnull\n private IInAppBillingService mService;",
"type": "IInAppBillingService",
"var_name": "mService"
},
{
"declarator": "mCheckout",
"modifier": "@Nonnull\n... | {
"body": "@Test\n public void testAllProductsShouldBeSupported() throws Exception {\n final AwaitingListener l = new AwaitingListener();\n\n mCheckout.start(l);\n\n l.waitWhileLoading();\n\n verify(l.mListener, times(2)).onReady(any(BillingRequests.class), anyString(), eq(true));\n ... | {
"fields": [
{
"declarator": "mTag",
"modifier": "@Nullable\n private final",
"original_string": "@Nullable\n private final Object mTag;",
"type": "Object",
"var_name": "mTag"
},
{
"declarator": "mBilling",
"modifier": "@Nonnull\n protected final",
... | {
"body": "public void start() {\n start(null);\n }",
"class_method_signature": "Checkout.start()",
"constructor": false,
"full_signature": "public void start()",
"identifier": "start",
"invocations": [
"start"
],
"modifiers": "public",
"parameters": "()",
"return": "void",
"signatur... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_17 | {
"fields": [],
"file": "lib/src/test/java/org/solovyev/android/checkout/GetSkuDetailsRequestTest.java",
"identifier": "GetSkuDetailsRequestTest",
"interfaces": "",
"superclass": "extends RequestTestBase"
} | {
"body": "@Test\n public void testShouldHaveSameCacheKey() throws Exception {\n final List<String> skus = asList(\"1\", \"2\", \"3\");\n final GetSkuDetailsRequest r1 = new GetSkuDetailsRequest(\"test\", skus);\n Collections.reverse(skus);\n final GetSkuDetailsRequest r2 = new GetSkuDe... | {
"fields": [
{
"declarator": "MAX_SIZE_PER_REQUEST = 20",
"modifier": "private static final",
"original_string": "private static final int MAX_SIZE_PER_REQUEST = 20;",
"type": "int",
"var_name": "MAX_SIZE_PER_REQUEST"
},
{
"declarator": "mProduct",
"modifier": "@... | {
"body": "@Nullable\n @Override\n protected String getCacheKey() {\n if (mSkus.size() == 1) {\n return mProduct + \"_\" + mSkus.get(0);\n } else {\n final StringBuilder sb = new StringBuilder(5 * mSkus.size());\n sb.append(\"[\");\n for (int i = 0; i < ... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_0 | {
"fields": [
{
"declarator": "mBilling",
"modifier": "@Nonnull\n private",
"original_string": "@Nonnull\n private Billing mBilling;",
"type": "Billing",
"var_name": "mBilling"
},
{
"declarator": "mRandom",
"modifier": "@Nonnull\n private",
"origina... | {
"body": "@Test\n public void testShouldLoadAllPurchases() throws Exception {\n final Billing billing = prepareMultiPurchasesBilling();\n\n final CountDownLatch latch = new CountDownLatch(1);\n final CountDownListener l = new CountDownListener(latch);\n billing.getRequests().getAllPurc... | {
"fields": [
{
"declarator": "V3 = 3",
"modifier": "static final",
"original_string": "static final int V3 = 3;",
"type": "int",
"var_name": "V3"
},
{
"declarator": "V5 = 5",
"modifier": "static final",
"original_string": "static final int V5 = 5;",
"... | {
"body": "@Nonnull\n public BillingRequests getRequests() {\n return mRequests;\n }",
"class_method_signature": "Billing.getRequests()",
"constructor": false,
"full_signature": "@Nonnull public BillingRequests getRequests()",
"identifier": "getRequests",
"invocations": [],
"modifiers": "@Non... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_40 | {
"fields": [
{
"declarator": "mListener",
"modifier": "@Nonnull\n private",
"original_string": "@Nonnull\n private RequestListener mListener;",
"type": "RequestListener",
"var_name": "mListener"
},
{
"declarator": "mFlow",
"modifier": "@Nonnull\n private... | {
"body": "@Test\n public void testShouldErrorIfIntentIsNull() throws Exception {\n mFlow.onActivityResult(1, 1, null);\n\n verifyError(ResponseCodes.NULL_INTENT, BillingException.class);\n }",
"class_method_signature": "PurchaseFlowTest.testShouldErrorIfIntentIsNull()",
"constructor": false,
... | {
"fields": [
{
"declarator": "EXTRA_RESPONSE = \"RESPONSE_CODE\"",
"modifier": "static final",
"original_string": "static final String EXTRA_RESPONSE = \"RESPONSE_CODE\";",
"type": "String",
"var_name": "EXTRA_RESPONSE"
},
{
"declarator": "EXTRA_PURCHASE_DATA = \"INAPP... | {
"body": "void onActivityResult(int requestCode, int resultCode, Intent intent) {\n try {\n Check.equals(mRequestCode, requestCode);\n if (intent == null) {\n // sometimes intent is null (it's not obvious when it happens but it happens from time to time)\n h... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_37 | {
"fields": [],
"file": "lib/src/test/java/org/solovyev/android/checkout/MainThreadRequestListenerTest.java",
"identifier": "MainThreadRequestListenerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testShouldCallOnError() throws Exception {\n final RequestListener l = mock(RequestListener.class);\n final MainThreadRequestListener mtl = new MainThreadRequestListener(Tests.sameThreadExecutor(), l);\n\n final Exception e = new Exception();\n mtl.onError... | {
"fields": [
{
"declarator": "mMainThread",
"modifier": "@Nonnull\n private final",
"original_string": "@Nonnull\n private final CancellableExecutor mMainThread;",
"type": "CancellableExecutor",
"var_name": "mMainThread"
},
{
"declarator": "mSuccessRunnable",
... | {
"body": "@Override\n public void onError(final int response, @Nonnull final Exception e) {\n mErrorRunnable = new Runnable() {\n @Override\n public void run() {\n mListener.onError(response, e);\n }\n };\n mMainThread.execute(mErrorRunnable);\n... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_60 | {
"fields": [],
"file": "lib/src/test/java/org/solovyev/android/checkout/BasePurchaseVerifierTest.java",
"identifier": "BasePurchaseVerifierTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testVerifierCallsListenerMethodsOnMainThreadFromMainThread() throws Exception {\n final ThreadAwareVerifier verifier = new ThreadAwareVerifier();\n final ThreadAwareRequestListener listener = new ThreadAwareRequestListener();\n\n verifier.verify(new ArrayList<Pur... | {
"fields": [
{
"declarator": "mBackground",
"modifier": "@Nonnull\n private final",
"original_string": "@Nonnull\n private final Executor mBackground;",
"type": "Executor",
"var_name": "mBackground"
},
{
"declarator": "mMainThread",
"modifier": "@Nonnull\n ... | {
"body": "@Override\n public final void verify(@Nonnull final List<Purchase> purchases, @Nonnull final RequestListener<List<Purchase>> listener) {\n if (MainThread.isMainThread()) {\n mBackground.execute(new Runnable() {\n @Override\n public void run() {\n ... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_21 | {
"fields": [
{
"declarator": "mSkus",
"modifier": "@Nonnull\n private",
"original_string": "@Nonnull\n private Skus mSkus;",
"type": "Skus",
"var_name": "mSkus"
}
],
"file": "lib/src/test/java/org/solovyev/android/checkout/SkusTest.java",
"identifier": "SkusTest",
... | {
"body": "@Test\n public void testShouldHaveSku() throws Exception {\n assertTrue(mSkus.hasSku(\"2\"));\n }",
"class_method_signature": "SkusTest.testShouldHaveSku()",
"constructor": false,
"full_signature": "@Test public void testShouldHaveSku()",
"identifier": "testShouldHaveSku",
"invocatio... | {
"fields": [
{
"declarator": "BUNDLE_LIST = \"DETAILS_LIST\"",
"modifier": "@Nonnull\n static final",
"original_string": "@Nonnull\n static final String BUNDLE_LIST = \"DETAILS_LIST\";",
"type": "String",
"var_name": "BUNDLE_LIST"
},
{
"declarator": "product",
... | {
"body": "public boolean hasSku(@Nonnull String sku) {\n return getSku(sku) != null;\n }",
"class_method_signature": "Skus.hasSku(@Nonnull String sku)",
"constructor": false,
"full_signature": "public boolean hasSku(@Nonnull String sku)",
"identifier": "hasSku",
"invocations": [
"getSku"
],... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_20 | {
"fields": [
{
"declarator": "mSkus",
"modifier": "@Nonnull\n private",
"original_string": "@Nonnull\n private Skus mSkus;",
"type": "Skus",
"var_name": "mSkus"
}
],
"file": "lib/src/test/java/org/solovyev/android/checkout/SkusTest.java",
"identifier": "SkusTest",
... | {
"body": "@Test\n public void testShouldNotReturnSkuById() throws Exception {\n assertNull(mSkus.getSku(\"4\"));\n }",
"class_method_signature": "SkusTest.testShouldNotReturnSkuById()",
"constructor": false,
"full_signature": "@Test public void testShouldNotReturnSkuById()",
"identifier": "testS... | {
"fields": [
{
"declarator": "BUNDLE_LIST = \"DETAILS_LIST\"",
"modifier": "@Nonnull\n static final",
"original_string": "@Nonnull\n static final String BUNDLE_LIST = \"DETAILS_LIST\";",
"type": "String",
"var_name": "BUNDLE_LIST"
},
{
"declarator": "product",
... | {
"body": "@Nullable\n public Sku getSku(@Nonnull String sku) {\n for (Sku s : list) {\n if (s.id.code.equals(sku)) {\n return s;\n }\n }\n return null;\n }",
"class_method_signature": "Skus.getSku(@Nonnull String sku)",
"constructor": false,
"full... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_61 | {
"fields": [],
"file": "lib/src/test/java/org/solovyev/android/checkout/BasePurchaseVerifierTest.java",
"identifier": "BasePurchaseVerifierTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testVerifierCallsListenerMethodsOnTheSameBackgroundThread() throws Exception {\n final ThreadAwareVerifier verifier = new ThreadAwareVerifier();\n final ThreadAwareRequestListener listener = new ThreadAwareRequestListener();\n\n new Thread(new Runnable() {\n ... | {
"fields": [
{
"declarator": "mBackground",
"modifier": "@Nonnull\n private final",
"original_string": "@Nonnull\n private final Executor mBackground;",
"type": "Executor",
"var_name": "mBackground"
},
{
"declarator": "mMainThread",
"modifier": "@Nonnull\n ... | {
"body": "@Override\n public final void verify(@Nonnull final List<Purchase> purchases, @Nonnull final RequestListener<List<Purchase>> listener) {\n if (MainThread.isMainThread()) {\n mBackground.execute(new Runnable() {\n @Override\n public void run() {\n ... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_36 | {
"fields": [],
"file": "lib/src/test/java/org/solovyev/android/checkout/MainThreadRequestListenerTest.java",
"identifier": "MainThreadRequestListenerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testShouldCallOnSuccess() throws Exception {\n final RequestListener l = mock(RequestListener.class);\n final MainThreadRequestListener mtl = new MainThreadRequestListener(Tests.sameThreadExecutor(), l);\n\n final Object o = new Object();\n mtl.onSuccess(o... | {
"fields": [
{
"declarator": "mMainThread",
"modifier": "@Nonnull\n private final",
"original_string": "@Nonnull\n private final CancellableExecutor mMainThread;",
"type": "CancellableExecutor",
"var_name": "mMainThread"
},
{
"declarator": "mSuccessRunnable",
... | {
"body": "@Override\n public void onSuccess(@Nonnull final R result) {\n mSuccessRunnable = new Runnable() {\n @Override\n public void run() {\n mListener.onSuccess(result);\n }\n };\n mMainThread.execute(mSuccessRunnable);\n }",
"class_met... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_41 | {
"fields": [
{
"declarator": "mListener",
"modifier": "@Nonnull\n private",
"original_string": "@Nonnull\n private RequestListener mListener;",
"type": "RequestListener",
"var_name": "mListener"
},
{
"declarator": "mFlow",
"modifier": "@Nonnull\n private... | {
"body": "@Test\n public void testShouldErrorIfRequestCodeIsDifferent() throws Exception {\n mFlow.onActivityResult(2, 1, new Intent());\n\n verifyError(ResponseCodes.EXCEPTION, RuntimeException.class);\n }",
"class_method_signature": "PurchaseFlowTest.testShouldErrorIfRequestCodeIsDifferent()"... | {
"fields": [
{
"declarator": "EXTRA_RESPONSE = \"RESPONSE_CODE\"",
"modifier": "static final",
"original_string": "static final String EXTRA_RESPONSE = \"RESPONSE_CODE\";",
"type": "String",
"var_name": "EXTRA_RESPONSE"
},
{
"declarator": "EXTRA_PURCHASE_DATA = \"INAPP... | {
"body": "void onActivityResult(int requestCode, int resultCode, Intent intent) {\n try {\n Check.equals(mRequestCode, requestCode);\n if (intent == null) {\n // sometimes intent is null (it's not obvious when it happens but it happens from time to time)\n h... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_16 | {
"fields": [],
"file": "lib/src/test/java/org/solovyev/android/checkout/PurchasesTest.java",
"identifier": "PurchasesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testShouldNotContainDuplicates() throws Exception {\n final List<Purchase> purchases = new ArrayList<Purchase>(1000);\n final Random r = new Random(currentTimeMillis());\n for (int i = 0; i < 1000; i++) {\n purchases.add(newPurchase(String.valueOf(i % ... | {
"fields": [
{
"declarator": "BUNDLE_DATA_LIST = \"INAPP_PURCHASE_DATA_LIST\"",
"modifier": "static final",
"original_string": "static final String BUNDLE_DATA_LIST = \"INAPP_PURCHASE_DATA_LIST\";",
"type": "String",
"var_name": "BUNDLE_DATA_LIST"
},
{
"declarator": "B... | {
"body": "@Nonnull\n static List<Purchase> neutralize(@Nonnull List<Purchase> purchases) {\n // probably, it's possible to avoid creation of temporary list. The reason for it is that we don't want to\n // modify original list\n purchases = new LinkedList<>(purchases);\n\n final List<Pu... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_1 | {
"fields": [
{
"declarator": "mBilling",
"modifier": "@Nonnull\n private",
"original_string": "@Nonnull\n private Billing mBilling;",
"type": "Billing",
"var_name": "mBilling"
},
{
"declarator": "mRandom",
"modifier": "@Nonnull\n private",
"origina... | {
"body": "@Test\n public void testShouldLoadWholePurchaseHistory() throws Exception {\n final Billing billing = prepareMultiPurchasesBilling();\n\n final CountDownLatch latch = new CountDownLatch(1);\n final CountDownListener l = new CountDownListener(latch);\n billing.getRequests().ge... | {
"fields": [
{
"declarator": "V3 = 3",
"modifier": "static final",
"original_string": "static final int V3 = 3;",
"type": "int",
"var_name": "V3"
},
{
"declarator": "V5 = 5",
"modifier": "static final",
"original_string": "static final int V5 = 5;",
"... | {
"body": "@Nonnull\n public BillingRequests getRequests() {\n return mRequests;\n }",
"class_method_signature": "Billing.getRequests()",
"constructor": false,
"full_signature": "@Nonnull public BillingRequests getRequests()",
"identifier": "getRequests",
"invocations": [],
"modifiers": "@Non... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
22337952_57 | {
"fields": [],
"file": "lib/src/test/java/org/solovyev/android/checkout/PurchaseTest.java",
"identifier": "PurchaseTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testShouldBeCreatedFromJson() throws Exception {\n final Purchase purchase = Purchase.fromJson(newJson(2, Purchase.State.REFUNDED), \"signature\");\n verifyPurchase(purchase, 2, Purchase.State.REFUNDED);\n }",
"class_method_signature": "PurchaseTest.testShouldBeCre... | {
"fields": [
{
"declarator": "sku",
"modifier": "@Nonnull\n public final",
"original_string": "@Nonnull\n public final String sku;",
"type": "String",
"var_name": "sku"
},
{
"declarator": "orderId",
"modifier": "@Nonnull\n public final",
"original_... | {
"body": "@Nonnull\n static Purchase fromJson(@Nonnull String data, @Nonnull String signature) throws JSONException {\n return new Purchase(data, signature);\n }",
"class_method_signature": "Purchase.fromJson(@Nonnull String data, @Nonnull String signature)",
"constructor": false,
"full_signature"... | {
"created": null,
"fork": null,
"fork_count": 161,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22337952,
"size": 2110,
"stargazer_count": 985,
"stars": null,
"updates": null,
"url": "https://github.com/serso/android-checkout"
} |
4581618_1 | {
"fields": [
{
"declarator": "tu = null",
"modifier": "private",
"original_string": "private IASTTranslationUnit tu = null;",
"type": "IASTTranslationUnit",
"var_name": "tu"
},
{
"declarator": "declarationsInFile = null",
"modifier": "private",
"original_st... | {
"body": "@Test\n public void testGetPointerToType() {\n IASTFunctionDefinition mainFunctionDefinition =\n (IASTFunctionDefinition) declarationsInFile.get(0);\n IASTCompoundStatement body = (IASTCompoundStatement) mainFunctionDefinition.getBody();\n IASTStatement[] statements = bod... | {
"fields": [],
"file": "src/com/github/uchan_nos/c_helper/util/TypeUtil.java",
"identifier": "TypeUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "TypeUtil.getPointerToType(IType type)",
"constructor": false,
"full_signature": "public static IType getPointerToType(ITyp... | {
"body": "public static IType getPointerToType(IType type) {\n type = removeQualifiers(type);\n if (type instanceof IPointerType) {\n return ((IPointerType) type).getType();\n } else {\n return null;\n }\n }",
"class_method_signature": "TypeUtil.getPointerToType... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 4581618,
"size": 1008,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/uchan-nos/c-helper"
} |
4581618_0 | {
"fields": [
{
"declarator": "tu = null",
"modifier": "private",
"original_string": "private IASTTranslationUnit tu = null;",
"type": "IASTTranslationUnit",
"var_name": "tu"
},
{
"declarator": "declarationsInFile = null",
"modifier": "private",
"original_st... | {
"body": "@Test\n public void testRemoveQualifiers() {\n IASTFunctionDefinition mainFunctionDefinition =\n (IASTFunctionDefinition) declarationsInFile.get(0);\n IASTCompoundStatement body = (IASTCompoundStatement) mainFunctionDefinition.getBody();\n IASTStatement[] statements = bod... | {
"fields": [],
"file": "src/com/github/uchan_nos/c_helper/util/TypeUtil.java",
"identifier": "TypeUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "TypeUtil.getPointerToType(IType type)",
"constructor": false,
"full_signature": "public static IType getPointerToType(ITyp... | {
"body": "public static IType removeQualifiers(IType type) {\n while (type instanceof IQualifierType) {\n type = ((IQualifierType) type).getType();\n }\n return type;\n }",
"class_method_signature": "TypeUtil.removeQualifiers(IType type)",
"constructor": false,
"full_signatur... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 4581618,
"size": 1008,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/uchan-nos/c-helper"
} |
33989963_15 | {
"fields": [],
"file": "esql-frontend/src/test/java/com/exxeta/iss/sonar/esql/tree/SyntacticEquivalenceTest.java",
"identifier": "SyntacticEquivalenceTest",
"interfaces": "",
"superclass": "extends EsqlTreeModelTest<Tree>"
} | {
"body": "@Test\n\tpublic void test_equivalence_for_tree_list() throws Exception {\n\t\tCallStatementTree tree1 = (CallStatementTree) parse(\"CALL f(a, b, c) ;\", Tree.Kind.CALL_STATEMENT);\n\t\tCallStatementTree tree2 = (CallStatementTree) parse(\"CALL f(a, b, c) ;\", Tree.Kind.CALL_STATEMENT);\n\t\tCallStatementTr... | {
"fields": [],
"file": "esql-frontend/src/main/java/com/exxeta/iss/sonar/esql/tree/SyntacticEquivalence.java",
"identifier": "SyntacticEquivalence",
"interfaces": "",
"methods": [
{
"class_method_signature": "SyntacticEquivalence.SyntacticEquivalence()",
"constructor": true,
"full_signa... | {
"body": "public static boolean areEquivalent(List<? extends Tree> leftList, List<? extends Tree> rightList) {\n if (leftList.size() != rightList.size() || leftList.isEmpty()) {\n return false;\n }\n\n for (int i = 0; i < leftList.size(); i++) {\n Tree left = leftList.get(i);\n Tree right = r... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_42 | {
"fields": [
{
"declarator": "settings",
"modifier": "private",
"original_string": "private MapSettings settings;",
"type": "MapSettings",
"var_name": "settings"
},
{
"declarator": "esqlLanguage",
"modifier": "private",
"original_string": "private EsqlLangu... | {
"body": "@Test\n\t public void customSuffixes() {\n\n\t\t MapSettings mapSettings = new MapSettings();\n\t\t mapSettings.setProperty(EsqlLanguage.FILE_SUFFIXES_KEY, \"esql\");\n\t\t EsqlLanguage esqlLanguage = new EsqlLanguage(mapSettings.asConfig());\n\t\t assertThat(esqlLanguage.getFileSuffixes()).containsOn... | {
"fields": [
{
"declarator": "KEY = \"esql\"",
"modifier": "public static final",
"original_string": "public static final String KEY = \"esql\";",
"type": "String",
"var_name": "KEY"
},
{
"declarator": "FILE_SUFFIXES_KEY = \"sonar.esql.file.suffixes\"",
"modifier... | {
"body": "@Override\n public String[] getFileSuffixes() {\n return configuration.getStringArray(FILE_SUFFIXES_KEY);\n }",
"class_method_signature": "EsqlLanguage.getFileSuffixes()",
"constructor": false,
"full_signature": "@Override public String[] getFileSuffixes()",
"identifier": "getFileSuffi... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_9 | {
"fields": [],
"file": "esql-checks/src/test/java/com/exxeta/iss/sonar/esql/check/CheckListTest.java",
"identifier": "CheckListTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void test() {\n\n\t\t\n\t\t\n\t\tList<Class> checks = CheckList.getChecks();\n\n\t for (Class cls : checks) {\n\t if (!cls.getSimpleName().equals(\"ParsingErrorCheck\")) {\n\t String testName = '/' + cls.getName().replace('.', '/') + \"Test.class\";\n\t assertThat(getC... | {
"fields": [
{
"declarator": "REPOSITORY_KEY = \"esql\"",
"modifier": "public static final",
"original_string": "public static final String REPOSITORY_KEY = \"esql\";",
"type": "String",
"var_name": "REPOSITORY_KEY"
},
{
"declarator": "REPOSITORY_NAME = \"SonarAnalyzer... | {
"body": "public static List<Class> getChecks() {\n return ImmutableList.<Class> of(\n \tCommentRegularExpressionCheck.class,\n ElseIfWithoutElseCheck.class,\n FileNameCheck.class,\n FunctionNameCheck.class,\n IterateStatementCheck.class,\n LineLengthCheck.class,\n Mod... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_39 | {
"fields": [
{
"declarator": "thrown = ExpectedException.none()",
"modifier": "@org.junit.Rule\n public final",
"original_string": "@org.junit.Rule\n public final ExpectedException thrown = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "thrown"
},
... | {
"body": "@Test\n public void progress_report_should_be_stopped_without_files() throws Exception {\n createSensor().analyseFiles(context, ImmutableList.of(), ImmutableList.of(), progressReport);\n verify(progressReport).stop();\n }",
"class_method_signature": "EsqlSensorTest.progress_report_sho... | {
"fields": [
{
"declarator": "LOG = Loggers.get(EsqlSensor.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = Loggers.get(EsqlSensor.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "checks",
"modifi... | {
"body": "@VisibleForTesting\n protected void analyseFiles(\n SensorContext context, List<TreeVisitor> treeVisitors, Iterable<InputFile> inputFiles,\n ProgressReport progressReport\n ) {\n boolean success = false;\n try {\n for (InputFile inputFile : inputFiles) {... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_19 | {
"fields": [],
"file": "esql-frontend/src/test/java/com/exxeta/iss/sonar/esql/tree/SyntacticEquivalenceTest.java",
"identifier": "SyntacticEquivalenceTest",
"interfaces": "",
"superclass": "extends EsqlTreeModelTest<Tree>"
} | {
"body": "@Test(expected = IllegalArgumentException.class)\n\tpublic void are_leafs_equivalent() throws Exception {\n\t\tCallStatementTreeImpl tree1 = (CallStatementTreeImpl) parse(\"CALL f(a,a) ;\", Tree.Kind.CALL_STATEMENT);\n\t\tassertThat(SyntacticEquivalence.areLeafsEquivalent((IdentifierTreeImpl) tree1.paramet... | {
"fields": [],
"file": "esql-frontend/src/main/java/com/exxeta/iss/sonar/esql/tree/SyntacticEquivalence.java",
"identifier": "SyntacticEquivalence",
"interfaces": "",
"methods": [
{
"class_method_signature": "SyntacticEquivalence.SyntacticEquivalence()",
"constructor": true,
"full_signa... | {
"body": "@VisibleForTesting\n protected static boolean areLeafsEquivalent(EsqlTree leftNode, EsqlTree rightNode) {\n if (leftNode instanceof IdentifierTree) {\n return Objects.equal(((IdentifierTree) leftNode).name(), ((IdentifierTree) rightNode).name());\n } else if (leftNode instanceof SyntaxToken) {\... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_5 | {
"fields": [
{
"declarator": "context",
"modifier": "private",
"original_string": "private SensorContextTester context;",
"type": "SensorContextTester",
"var_name": "context"
},
{
"declarator": "settings",
"modifier": "private",
"original_string": "private ... | {
"body": "@Test\n\tpublic void report_not_found() throws Exception {\n\n\t\tsensor.execute(context, linesOfCode, new String[] { \"/fake/path/trace.txt\" });\n\n\t\tassertThat(context.lineHits(\"moduleKey:file1.js\", 1)).isNull();\n\t}",
"class_method_signature": "TraceSensorTest.report_not_found()",
"constructor... | {
"fields": [],
"file": "esql-code-coverage/src/main/java/com/exxeta/iss/sonar/esql/codecoverage/TraceSensor.java",
"identifier": "TraceSensor",
"interfaces": "",
"methods": [
{
"class_method_signature": "TraceSensor.execute(SensorContext context, Map<InputFile, Set<Integer>> executableLines, Strin... | {
"body": "public void execute(SensorContext context, Map<InputFile, Set<Integer>> executableLines, String[] traces) {\n\t\t\n\t\tfor (String trace : traces) {\n\t\t\tFileSystem fs = context.fileSystem();\n\t\t\tFile report = fs.resolvePath(trace);\n\t\t\tif (report.isFile()) {\n\t\t\t\tnew UnitTestsAnalyzer(report,... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_23 | {
"fields": [
{
"declarator": "CHARSET = Charsets.UTF_8",
"modifier": "private static final",
"original_string": "private static final Charset CHARSET = Charsets.UTF_8;",
"type": "Charset",
"var_name": "CHARSET"
},
{
"declarator": "highlighterVisitor",
"modifier":... | {
"body": "@Test\n\tpublic void empty_input() throws Exception {\n\t\thighlight(\"\");\n\t\tassertThat(sensorContext.highlightingTypeAt(\"moduleKey:\" + inputFile.relativePath(), 1, 0)).isEmpty();\n\t}",
"class_method_signature": "HighlighterVisitorTest.empty_input()",
"constructor": false,
"full_signature": "@... | {
"fields": [
{
"declarator": "sensorContext",
"modifier": "private final",
"original_string": "private final SensorContext sensorContext;",
"type": "SensorContext",
"var_name": "sensorContext"
},
{
"declarator": "highlighting",
"modifier": "private",
"origi... | {
"body": "private void highlight(SyntaxToken token, TypeOfText type) {\n\t\thighlighting.highlight(token.line(), token.column(), token.endLine(), token.endColumn(), type);\n\t}",
"class_method_signature": "HighlighterVisitor.highlight(SyntaxToken token, TypeOfText type)",
"constructor": false,
"full_signature"... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_35 | {
"fields": [
{
"declarator": "thrown = ExpectedException.none()",
"modifier": "@org.junit.Rule\n public final",
"original_string": "@org.junit.Rule\n public final ExpectedException thrown = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "thrown"
},
... | {
"body": "@Test\n public void analysis_with_issues_should_not_add_error_to_context() {\n inputFile(\"file.esql\");\n\n ActiveRules activeRules = (new ActiveRulesBuilder())\n .addRule(new NewActiveRule.Builder().setRuleKey(RuleKey.of(CheckList.REPOSITORY_KEY, \"MissingNewlineAtEndOfFil... | {
"fields": [
{
"declarator": "LOG = Loggers.get(EsqlSensor.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = Loggers.get(EsqlSensor.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "checks",
"modifi... | {
"body": "public void execute(SensorContext context) {\n LOG.warn(\"ESQL sensor execute\");\n List<TreeVisitor> treeVisitors = Lists.newArrayList();\n treeVisitors.addAll(getTreeVisitors(context));\n treeVisitors.addAll(checks.visitorChecks());\n\n for (TreeVisitor check : treeVisi... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_34 | {
"fields": [
{
"declarator": "thrown = ExpectedException.none()",
"modifier": "@org.junit.Rule\n public final",
"original_string": "@org.junit.Rule\n public final ExpectedException thrown = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "thrown"
},
... | {
"body": "@Test\n public void analysis_with_no_issue_should_not_add_error_to_context() {\n inputFile(\"file.esql\");\n\n createSensor().execute(context);\n\n Collection<Issue> issues = context.allIssues();\n assertThat(issues).hasSize(0);\n\n assertThat(context.allAnalysisErrors... | {
"fields": [
{
"declarator": "LOG = Loggers.get(EsqlSensor.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = Loggers.get(EsqlSensor.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "checks",
"modifi... | {
"body": "public void execute(SensorContext context) {\n LOG.warn(\"ESQL sensor execute\");\n List<TreeVisitor> treeVisitors = Lists.newArrayList();\n treeVisitors.addAll(getTreeVisitors(context));\n treeVisitors.addAll(checks.visitorChecks());\n\n for (TreeVisitor check : treeVisi... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_22 | {
"fields": [
{
"declarator": "sensorContext",
"modifier": "private",
"original_string": "private SensorContextTester sensorContext;",
"type": "SensorContextTester",
"var_name": "sensorContext"
},
{
"declarator": "inputFile",
"modifier": "private",
"original... | {
"body": "@Test\n public void byte_order_mark_should_not_increment_offset() throws Exception {\n String filename = \"symbolHighlightingBom.esql\";\n\n HighlightSymbolTableBuilder.build(newSymbolTable(filename), context(inputFile));\n assertThat(Files.toString(inputFile.file(), inputFile.charset()).startsWi... | {
"fields": [],
"file": "esql-frontend/src/main/java/com/exxeta/iss/sonar/esql/highlighter/HighlightSymbolTableBuilder.java",
"identifier": "HighlightSymbolTableBuilder",
"interfaces": "",
"methods": [
{
"class_method_signature": "HighlightSymbolTableBuilder.HighlightSymbolTableBuilder()",
"co... | {
"body": "public static void build(NewSymbolTable newSymbolTable, TreeVisitorContext context) {\n\t\tfor (Symbol symbol : context.getSymbolModel().getSymbols()) {\n\t\t\thighlightSymbol(newSymbolTable, symbol);\n\t\t}\n\t\tnewSymbolTable.save();\n\t}",
"class_method_signature": "HighlightSymbolTableBuilder.build(N... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_4 | {
"fields": [],
"file": "esql-code-coverage/src/test/java/com/exxeta/iss/sonar/esql/codecoverage/CodeCoverageExtensionTest.java",
"identifier": "CodeCoverageExtensionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\t public void testExtensions() {\n\t assertThat(CodeCoverageExtension.getExtensions().size()).isEqualTo(1);\n\t }",
"class_method_signature": "CodeCoverageExtensionTest.testExtensions()",
"constructor": false,
"full_signature": "@Test public void testExtensions()",
"identifier": "testE... | {
"fields": [
{
"declarator": "LOG = Loggers.get(CodeCoverageExtension.class.getName())",
"modifier": "public static final",
"original_string": "public static final Logger LOG = Loggers.get(CodeCoverageExtension.class.getName());",
"type": "Logger",
"var_name": "LOG"
}
],
"fi... | {
"body": "public static List<Object> getExtensions() {\n\t\t ImmutableList.Builder<Object> extensions = ImmutableList.builder();\n\n\t\t extensions.add(\n\t\t \t\tTraceSensor.class);\n\t\t \n\t\t return extensions.build();\n\n\t }",
"class_method_signature": "CodeCoverageExtension.getExtensions()",... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_18 | {
"fields": [],
"file": "esql-frontend/src/test/java/com/exxeta/iss/sonar/esql/tree/SyntacticEquivalenceTest.java",
"identifier": "SyntacticEquivalenceTest",
"interfaces": "",
"superclass": "extends EsqlTreeModelTest<Tree>"
} | {
"body": "@Test\n\tpublic void test_skip_parenthesis() throws Exception {\n\t\tIfStatementTree tree1 = (IfStatementTree) parse(\"IF (TRUE) THEN END IF;\", Tree.Kind.IF_STATEMENT);\n\t\tIfStatementTree tree2 = (IfStatementTree) parse(\"IF TRUE THEN END IF;\", Tree.Kind.IF_STATEMENT);\n\n\t\tassertThat(SyntacticEquiva... | {
"fields": [],
"file": "esql-frontend/src/main/java/com/exxeta/iss/sonar/esql/tree/SyntacticEquivalence.java",
"identifier": "SyntacticEquivalence",
"interfaces": "",
"methods": [
{
"class_method_signature": "SyntacticEquivalence.SyntacticEquivalence()",
"constructor": true,
"full_signa... | {
"body": "public static ExpressionTree skipParentheses(ExpressionTree tree) {\n\t\tif (tree == null) {\n\t\t\treturn null;\n\t\t} else if (tree.is(Tree.Kind.PARENTHESISED_EXPRESSION)) {\n\t\t\treturn skipParentheses(((ParenthesisedExpressionTree) tree).expression());\n\t\t} else {\n\t\t\treturn tree;\n\t\t}\n\t}",
... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_38 | {
"fields": [
{
"declarator": "thrown = ExpectedException.none()",
"modifier": "@org.junit.Rule\n public final",
"original_string": "@org.junit.Rule\n public final ExpectedException thrown = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "thrown"
},
... | {
"body": "@Test\n public void progress_report_should_be_stopped() throws Exception {\n InputFile inputFile = inputFile(\"cpd/Person.esql\");\n createSensor().analyseFiles(context, ImmutableList.of(), ImmutableList.of(inputFile), progressReport);\n verify(progressReport).stop();\n }",
"cl... | {
"fields": [
{
"declarator": "LOG = Loggers.get(EsqlSensor.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = Loggers.get(EsqlSensor.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "checks",
"modifi... | {
"body": "@VisibleForTesting\n protected void analyseFiles(\n SensorContext context, List<TreeVisitor> treeVisitors, Iterable<InputFile> inputFiles,\n ProgressReport progressReport\n ) {\n boolean success = false;\n try {\n for (InputFile inputFile : inputFiles) {... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_8 | {
"fields": [],
"file": "esql-checks/src/test/java/com/exxeta/iss/sonar/esql/check/CheckListTest.java",
"identifier": "CheckListTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void count() {\n\t\tint count = 0;\n\t\tList<File> files = (List<File>) FileUtils.listFiles(new File(\"src/main/java/com/exxeta/iss/sonar/esql/check/\"),\n\t\t\t\tnew String[] { \"java\" }, true);\n\t\tfor (File file : files) {\n\t\t\t String name = file.getName();\n\t\t if (name.endsW... | {
"fields": [
{
"declarator": "REPOSITORY_KEY = \"esql\"",
"modifier": "public static final",
"original_string": "public static final String REPOSITORY_KEY = \"esql\";",
"type": "String",
"var_name": "REPOSITORY_KEY"
},
{
"declarator": "REPOSITORY_NAME = \"SonarAnalyzer... | {
"body": "public static List<Class> getChecks() {\n return ImmutableList.<Class> of(\n \tCommentRegularExpressionCheck.class,\n ElseIfWithoutElseCheck.class,\n FileNameCheck.class,\n FunctionNameCheck.class,\n IterateStatementCheck.class,\n LineLengthCheck.class,\n Mod... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_43 | {
"fields": [],
"file": "esql-plugin/src/test/java/com/exxeta/iss/sonar/esql/EsqlExclusionsFileFilterTest.java",
"identifier": "EsqlExclusionsFileFilterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void should_exclude_using_custom_path_regex() throws Exception {\n MapSettings settings = new MapSettings();\n settings.setProperty(\n EsqlPlugin.ESQL_EXCLUSIONS_KEY, EsqlPlugin.ESQL_EXCLUSIONS_DEFAULT_VALUE + \",\" + \"**/libs/**\");\n\n EsqlExclusions... | {
"fields": [
{
"declarator": "configuration",
"modifier": "private final",
"original_string": "private final Configuration configuration;",
"type": "Configuration",
"var_name": "configuration"
},
{
"declarator": "LOG = Loggers.get(EsqlExclusionsFileFilter.class)",
... | {
"body": "@Override\n public boolean accept(InputFile inputFile) {\n return !isExcludedWithProperty(inputFile, EsqlPlugin.ESQL_EXCLUSIONS_KEY);\n }",
"class_method_signature": "EsqlExclusionsFileFilter.accept(InputFile inputFile)",
"constructor": false,
"full_signature": "@Override public boolean ... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_14 | {
"fields": [],
"file": "esql-frontend/src/test/java/com/exxeta/iss/sonar/esql/tree/SyntacticEquivalenceTest.java",
"identifier": "SyntacticEquivalenceTest",
"interfaces": "",
"superclass": "extends EsqlTreeModelTest<Tree>"
} | {
"body": "@Test\n\tpublic void test() throws Exception {\n\t\tTree tree1 = parse(\"if a then end if;\", Tree.Kind.IF_STATEMENT);\n\t\tTree tree2 = parse(\"if a then end if;\", Tree.Kind.IF_STATEMENT);\n\n\t\tTree tree3 = parse(\"if b then end if;\", Tree.Kind.IF_STATEMENT);\n\t\tTree tree4 = parse(\"if b then leave ... | {
"fields": [],
"file": "esql-frontend/src/main/java/com/exxeta/iss/sonar/esql/tree/SyntacticEquivalence.java",
"identifier": "SyntacticEquivalence",
"interfaces": "",
"methods": [
{
"class_method_signature": "SyntacticEquivalence.SyntacticEquivalence()",
"constructor": true,
"full_signa... | {
"body": "public static boolean areEquivalent(List<? extends Tree> leftList, List<? extends Tree> rightList) {\n if (leftList.size() != rightList.size() || leftList.isEmpty()) {\n return false;\n }\n\n for (int i = 0; i < leftList.size(); i++) {\n Tree left = leftList.get(i);\n Tree right = r... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_3 | {
"fields": [
{
"declarator": "testVisitor = new ExecutionDataVisitor() {\n\t\tprivate int moduleCount = 0;\n\t\t@Override\n\t\tpublic void visitModuleExecution(ModuleExecutionData data) {\n\t\t\tmoduleCount++;\n\t\t\tassertNotNull(data);\n\t\t\tassertNotNull(data.getSchemaAndModuleName());\n\t\t\tassertTha... | {
"body": "@Test\n\tpublic void indexOutOfBounds112() throws IOException {\n\t\tTraceFileReader trace = new TraceFileReader(new File(\"src/test/resources/codecoverage/tests/usertrace_112.xml\")).readTrace(new ExecutionDataVisitor() {\n\n\t\t\t@Override\n\t\t\tpublic void visitModuleExecution(ModuleExecutionData data)... | {
"fields": [
{
"declarator": "traceFile",
"modifier": "private final",
"original_string": "private final File traceFile;",
"type": "File",
"var_name": "traceFile"
},
{
"declarator": "pattern",
"modifier": "private",
"original_string": "private Pattern patte... | {
"body": "public TraceFileReader readTrace(ExecutionDataVisitor executionDataVisitor) {\n if (traceFile == null) {\n return this;\n }\n CodeCoverageExtension.LOG.info(\"Analysing {}\", traceFile);\n try (FileInputStream fis = new FileInputStream(traceFile)) {\n\n Buf... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_25 | {
"fields": [
{
"declarator": "CHARSET = Charsets.UTF_8",
"modifier": "private static final",
"original_string": "private static final Charset CHARSET = Charsets.UTF_8;",
"type": "Charset",
"var_name": "CHARSET"
},
{
"declarator": "highlighterVisitor",
"modifier":... | {
"body": "@Test\n\tpublic void single_line_comment() throws Exception {\n\t\thighlight(\" --Comment \");\n\t\tassertHighlighting(2, 10, COMMENT);\n\t}",
"class_method_signature": "HighlighterVisitorTest.single_line_comment()",
"constructor": false,
"full_signature": "@Test public void single_line_comment()",
... | {
"fields": [
{
"declarator": "sensorContext",
"modifier": "private final",
"original_string": "private final SensorContext sensorContext;",
"type": "SensorContext",
"var_name": "sensorContext"
},
{
"declarator": "highlighting",
"modifier": "private",
"origi... | {
"body": "private void highlight(SyntaxToken token, TypeOfText type) {\n\t\thighlighting.highlight(token.line(), token.column(), token.endLine(), token.endColumn(), type);\n\t}",
"class_method_signature": "HighlighterVisitor.highlight(SyntaxToken token, TypeOfText type)",
"constructor": false,
"full_signature"... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_33 | {
"fields": [
{
"declarator": "thrown = ExpectedException.none()",
"modifier": "@org.junit.Rule\n public final",
"original_string": "@org.junit.Rule\n public final ExpectedException thrown = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "thrown"
},
... | {
"body": "@Test\n public void should_add_error_to_context_but_not_fail_analysis_with_technical_error() {\n EsqlCheck check = new ExceptionRaisingCheck(new NullPointerException(\"NPE forcibly raised by check class\"));\n\n InputFile file = inputFile(\"file.esql\");\n createSensor().analyseFile... | {
"fields": [
{
"declarator": "LOG = Loggers.get(EsqlSensor.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = Loggers.get(EsqlSensor.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "checks",
"modifi... | {
"body": "@VisibleForTesting\n protected void analyseFiles(\n SensorContext context, List<TreeVisitor> treeVisitors, Iterable<InputFile> inputFiles,\n ProgressReport progressReport\n ) {\n boolean success = false;\n try {\n for (InputFile inputFile : inputFiles) {... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_13 | {
"fields": [
{
"declarator": "REPOSITORY_NAME = \"Custom Rule Repository\"",
"modifier": "private static final",
"original_string": "private static final String REPOSITORY_NAME = \"Custom Rule Repository\";",
"type": "String",
"var_name": "REPOSITORY_NAME"
},
{
"declar... | {
"body": "@Test\n public void test() {\n MyCustomJavaScriptRulesDefinition rulesDefinition = new MyCustomJavaScriptRulesDefinition();\n RulesDefinition.Context context = new RulesDefinition.Context();\n rulesDefinition.define(context);\n RulesDefinition.Repository repository = context.repository(REPOSIT... | {
"fields": [],
"file": "esql-frontend/src/main/java/com/exxeta/iss/sonar/esql/api/CustomEsqlRulesDefinition.java",
"identifier": "CustomEsqlRulesDefinition",
"interfaces": "implements RulesDefinition",
"methods": [
{
"class_method_signature": "CustomEsqlRulesDefinition.define(RulesDefinition.Contex... | {
"body": "@Override\n public void define(RulesDefinition.Context context) {\n RulesDefinition.NewRepository repo = context.createRepository(repositoryKey(), \"esql\").setName(repositoryName());\n\n // Load metadata from check classes' annotations\n new AnnotationBasedRulesDefinition(repo, \"esql\").addRule... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_44 | {
"fields": [],
"file": "esql-plugin/src/test/java/com/exxeta/iss/sonar/esql/EsqlExclusionsFileFilterTest.java",
"identifier": "EsqlExclusionsFileFilterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void should_ignore_empty_path_regex() throws Exception {\n MapSettings settings = new MapSettings();\n settings.setProperty(EsqlPlugin.ESQL_EXCLUSIONS_KEY, \",\" + EsqlPlugin.ESQL_EXCLUSIONS_DEFAULT_VALUE + \",\");\n\n EsqlExclusionsFileFilter filter = new EsqlExclusi... | {
"fields": [
{
"declarator": "configuration",
"modifier": "private final",
"original_string": "private final Configuration configuration;",
"type": "Configuration",
"var_name": "configuration"
},
{
"declarator": "LOG = Loggers.get(EsqlExclusionsFileFilter.class)",
... | {
"body": "@Override\n public boolean accept(InputFile inputFile) {\n return !isExcludedWithProperty(inputFile, EsqlPlugin.ESQL_EXCLUSIONS_KEY);\n }",
"class_method_signature": "EsqlExclusionsFileFilter.accept(InputFile inputFile)",
"constructor": false,
"full_signature": "@Override public boolean ... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_29 | {
"fields": [
{
"declarator": "CHARSET = Charsets.UTF_8",
"modifier": "private static final",
"original_string": "private static final Charset CHARSET = Charsets.UTF_8;",
"type": "Charset",
"var_name": "CHARSET"
},
{
"declarator": "highlighterVisitor",
"modifier":... | {
"body": "@Test\n\tpublic void keyword() throws Exception {\n\t\thighlight(\"CREATE FUNCTION a() SET x = 0;\");\n\t\tassertHighlighting(20, 3, KEYWORD);\n\t}",
"class_method_signature": "HighlighterVisitorTest.keyword()",
"constructor": false,
"full_signature": "@Test public void keyword()",
"identifier": "k... | {
"fields": [
{
"declarator": "sensorContext",
"modifier": "private final",
"original_string": "private final SensorContext sensorContext;",
"type": "SensorContext",
"var_name": "sensorContext"
},
{
"declarator": "highlighting",
"modifier": "private",
"origi... | {
"body": "private void highlight(SyntaxToken token, TypeOfText type) {\n\t\thighlighting.highlight(token.line(), token.column(), token.endLine(), token.endColumn(), type);\n\t}",
"class_method_signature": "HighlighterVisitor.highlight(SyntaxToken token, TypeOfText type)",
"constructor": false,
"full_signature"... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_28 | {
"fields": [
{
"declarator": "CHARSET = Charsets.UTF_8",
"modifier": "private static final",
"original_string": "private static final Charset CHARSET = Charsets.UTF_8;",
"type": "Charset",
"var_name": "CHARSET"
},
{
"declarator": "highlighterVisitor",
"modifier":... | {
"body": "@Test\n\tpublic void string() throws Exception {\n\t\thighlight(\"CREATE FUNCTION a() SET x = 'a';\");\n\t\tassertHighlighting(28, 3, STRING);\n\t}",
"class_method_signature": "HighlighterVisitorTest.string()",
"constructor": false,
"full_signature": "@Test public void string()",
"identifier": "str... | {
"fields": [
{
"declarator": "sensorContext",
"modifier": "private final",
"original_string": "private final SensorContext sensorContext;",
"type": "SensorContext",
"var_name": "sensorContext"
},
{
"declarator": "highlighting",
"modifier": "private",
"origi... | {
"body": "private void highlight(SyntaxToken token, TypeOfText type) {\n\t\thighlighting.highlight(token.line(), token.column(), token.endLine(), token.endColumn(), type);\n\t}",
"class_method_signature": "HighlighterVisitor.highlight(SyntaxToken token, TypeOfText type)",
"constructor": false,
"full_signature"... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_12 | {
"fields": [
{
"declarator": "MODULE_BASE_DIR = new File(\"src/test/resources/metrics/\")",
"modifier": "private static final",
"original_string": "private static final File MODULE_BASE_DIR = new File(\"src/test/resources/metrics/\");",
"type": "File",
"var_name": "MODULE_BASE_DIR"
... | {
"body": "@Test\n public void test() {\n MetricsVisitor metricsVisitor = createMetricsVisitor();\n metricsVisitor.scanTree(treeVisitorContext);\n assertThat(context.measure(COMPONENT_KEY, CoreMetrics.FUNCTIONS).value()).isEqualTo(0);\n assertThat(context.measure(COMPONENT_KEY, CoreMetrics.STATEMENTS).va... | {
"fields": [
{
"declarator": "LIMITS_COMPLEXITY_FUNCTIONS = { 1, 2, 4, 6, 8, 10, 12, 20, 30 }",
"modifier": "private static final",
"original_string": "private static final Number[] LIMITS_COMPLEXITY_FUNCTIONS = { 1, 2, 4, 6, 8, 10, 12, 20, 30 };",
"type": "Number[]",
"var_name": "L... | {
"body": "public Map<InputFile, Set<Integer>> executableLines() {\n\t\treturn projectExecutableLines;\n\t}",
"class_method_signature": "MetricsVisitor.executableLines()",
"constructor": false,
"full_signature": "public Map<InputFile, Set<Integer>> executableLines()",
"identifier": "executableLines",
"invoc... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_32 | {
"fields": [
{
"declarator": "thrown = ExpectedException.none()",
"modifier": "@org.junit.Rule\n public final",
"original_string": "@org.junit.Rule\n public final ExpectedException thrown = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "thrown"
},
... | {
"body": "@Test\n public void parsing_error() {\n String relativePath = \"cpd/parsingError.esql\";\n inputFile(relativePath);\n\n String parsingErrorCheckKey = \"ParsingError\";\n\n ActiveRules activeRules = (new ActiveRulesBuilder())\n .addRule(new NewActiveRule.Builder... | {
"fields": [
{
"declarator": "LOG = Loggers.get(EsqlSensor.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = Loggers.get(EsqlSensor.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "checks",
"modifi... | {
"body": "public void execute(SensorContext context) {\n LOG.warn(\"ESQL sensor execute\");\n List<TreeVisitor> treeVisitors = Lists.newArrayList();\n treeVisitors.addAll(getTreeVisitors(context));\n treeVisitors.addAll(checks.visitorChecks());\n\n for (TreeVisitor check : treeVisi... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_24 | {
"fields": [
{
"declarator": "CHARSET = Charsets.UTF_8",
"modifier": "private static final",
"original_string": "private static final Charset CHARSET = Charsets.UTF_8;",
"type": "Charset",
"var_name": "CHARSET"
},
{
"declarator": "highlighterVisitor",
"modifier":... | {
"body": "@Test\n\tpublic void multiline_comment() throws Exception {\n\t\thighlight(\"/*\\nComment\\n*/ \");\n\t\tassertHighlighting(1, 0, 2, COMMENT);\n\t\tassertHighlighting(2, 0, 7, COMMENT);\n\t\tassertHighlighting(3, 0, 2, COMMENT);\n\t}",
"class_method_signature": "HighlighterVisitorTest.multiline_comment()... | {
"fields": [
{
"declarator": "sensorContext",
"modifier": "private final",
"original_string": "private final SensorContext sensorContext;",
"type": "SensorContext",
"var_name": "sensorContext"
},
{
"declarator": "highlighting",
"modifier": "private",
"origi... | {
"body": "private void highlight(SyntaxToken token, TypeOfText type) {\n\t\thighlighting.highlight(token.line(), token.column(), token.endLine(), token.endColumn(), type);\n\t}",
"class_method_signature": "HighlighterVisitor.highlight(SyntaxToken token, TypeOfText type)",
"constructor": false,
"full_signature"... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_2 | {
"fields": [
{
"declarator": "testVisitor = new ExecutionDataVisitor() {\n\t\tprivate int moduleCount = 0;\n\t\t@Override\n\t\tpublic void visitModuleExecution(ModuleExecutionData data) {\n\t\t\tmoduleCount++;\n\t\t\tassertNotNull(data);\n\t\t\tassertNotNull(data.getSchemaAndModuleName());\n\t\t\tassertTha... | {
"body": "@Test\n\tpublic void parserTest() throws Exception {\n\t\tassertThat(new UserTraceLog().getUserTraceOrInformation()).isNotNull();\n\t\tUserTraceLog trace = new TraceFileReader(new File(\"src/test/resources/codecoverage/trace.xml\")).parseTraceXml();\n\t\tassertThat(trace.getBufferSize()).isEqualTo(0);\n\t\... | {
"fields": [
{
"declarator": "traceFile",
"modifier": "private final",
"original_string": "private final File traceFile;",
"type": "File",
"var_name": "traceFile"
},
{
"declarator": "pattern",
"modifier": "private",
"original_string": "private Pattern patte... | {
"body": "protected UserTraceLog parseTraceXml() throws IOException, ParserConfigurationException, SAXException {\n\n TraceParser traceParser = new TraceParser();\n\n\n SAXParserFactory factory = SAXParserFactory.newInstance();\n factory.setNamespaceAware(true);\n factory.setFeature(XMLCo... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_31 | {
"fields": [
{
"declarator": "thrown = ExpectedException.none()",
"modifier": "@org.junit.Rule\n public final",
"original_string": "@org.junit.Rule\n public final ExpectedException thrown = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "thrown"
},
... | {
"body": "@Test\n public void should_analyse() {\n String relativePath = \"cpd/Person.esql\";\n inputFile(relativePath);\n\n createSensor().execute(context);\n\n String key = \"moduleKey:\" + relativePath;\n\n\n //assertThat(context.measure(key, CoreMetrics.FILES).value()).isEqu... | {
"fields": [
{
"declarator": "LOG = Loggers.get(EsqlSensor.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = Loggers.get(EsqlSensor.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "checks",
"modifi... | {
"body": "public void execute(SensorContext context) {\n LOG.warn(\"ESQL sensor execute\");\n List<TreeVisitor> treeVisitors = Lists.newArrayList();\n treeVisitors.addAll(getTreeVisitors(context));\n treeVisitors.addAll(checks.visitorChecks());\n\n for (TreeVisitor check : treeVisi... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_27 | {
"fields": [
{
"declarator": "CHARSET = Charsets.UTF_8",
"modifier": "private static final",
"original_string": "private static final Charset CHARSET = Charsets.UTF_8;",
"type": "Charset",
"var_name": "CHARSET"
},
{
"declarator": "highlighterVisitor",
"modifier":... | {
"body": "@Test\n\tpublic void numbers() throws Exception {\n\t\thighlight(\"CREATE FUNCTION a() SET x = 1;\");\n\t\tassertHighlighting(28, 1, TypeOfText.CONSTANT);\n\t}",
"class_method_signature": "HighlighterVisitorTest.numbers()",
"constructor": false,
"full_signature": "@Test public void numbers()",
"ide... | {
"fields": [
{
"declarator": "sensorContext",
"modifier": "private final",
"original_string": "private final SensorContext sensorContext;",
"type": "SensorContext",
"var_name": "sensorContext"
},
{
"declarator": "highlighting",
"modifier": "private",
"origi... | {
"body": "private void highlight(SyntaxToken token, TypeOfText type) {\n\t\thighlighting.highlight(token.line(), token.column(), token.endLine(), token.endColumn(), type);\n\t}",
"class_method_signature": "HighlighterVisitor.highlight(SyntaxToken token, TypeOfText type)",
"constructor": false,
"full_signature"... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_1 | {
"fields": [
{
"declarator": "testVisitor = new ExecutionDataVisitor() {\n\t\tprivate int moduleCount = 0;\n\t\t@Override\n\t\tpublic void visitModuleExecution(ModuleExecutionData data) {\n\t\t\tmoduleCount++;\n\t\t\tassertNotNull(data);\n\t\t\tassertNotNull(data.getSchemaAndModuleName());\n\t\t\tassertTha... | {
"body": "@Test(expected=RuntimeException.class)\n\tpublic void xmlReaderTestCorruptFile(){\n\t\tnew TraceFileReader(new File(\"src/test/resources/codecoverage/corruptTrace.xml\"))\n\t\t.readTrace(testVisitor);\n\t}",
"class_method_signature": "TraceFileReaderTest.xmlReaderTestCorruptFile()",
"constructor": fals... | {
"fields": [
{
"declarator": "traceFile",
"modifier": "private final",
"original_string": "private final File traceFile;",
"type": "File",
"var_name": "traceFile"
},
{
"declarator": "pattern",
"modifier": "private",
"original_string": "private Pattern patte... | {
"body": "public TraceFileReader readTrace(ExecutionDataVisitor executionDataVisitor) {\n if (traceFile == null) {\n return this;\n }\n CodeCoverageExtension.LOG.info(\"Analysing {}\", traceFile);\n try (FileInputStream fis = new FileInputStream(traceFile)) {\n\n Buf... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_11 | {
"fields": [
{
"declarator": "check = new TrailingCommentsCheck()",
"modifier": "",
"original_string": "TrailingCommentsCheck check = new TrailingCommentsCheck();",
"type": "TrailingCommentsCheck",
"var_name": "check"
}
],
"file": "esql-checks/src/test/java/com/exxeta/iss/so... | {
"body": "@Test\n public void withoutPattern(){\n\t TrailingCommentsCheck check = new TrailingCommentsCheck();\n\t check.setLegalCommentPattern(\"\");\n\t\t EsqlCheckVerifier.issues(check, new File(\"src/test/resources/trailingComments.esql\"))\n\t\t .next().atLine(8).withMessage(\"Move this trailing comment o... | {
"fields": [
{
"declarator": "MESSAGE = \"Move this trailing comment on the previous empty line.\"",
"modifier": "private static final",
"original_string": "private static final String MESSAGE = \"Move this trailing comment on the previous empty line.\";",
"type": "String",
"var_nam... | {
"body": "public void setLegalCommentPattern(String pattern) {\n\t this.legalCommentPattern = pattern;\n\t }",
"class_method_signature": "TrailingCommentsCheck.setLegalCommentPattern(String pattern)",
"constructor": false,
"full_signature": "public void setLegalCommentPattern(String pattern)",
"identifie... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_10 | {
"fields": [
{
"declarator": "file1 = new File(\"src/test/resources/FileHeaderCheck/file1.esql\")",
"modifier": "private final",
"original_string": "private final File file1 = new File(\"src/test/resources/FileHeaderCheck/file1.esql\");",
"type": "File",
"var_name": "file1"
},
... | {
"body": "@Test\n\t\t public void test_plain() {\n\t\t EsqlCheckVerifier.issues(checkPlainText(\"-- copyright 2005\"), file1)\n\t\t .noMore();\n\n\t\t EsqlCheckVerifier.issues(checkPlainText(\"-- copyright 20\\\\d\\\\d\"), file1)\n\t\t .next().atLine(null);\n\n\t\t EsqlCheckVerifier.issues(checkP... | {
"fields": [
{
"declarator": "DEFAULT_HEADER_FORMAT = \"\"",
"modifier": "private static final",
"original_string": "private static final String DEFAULT_HEADER_FORMAT = \"\";",
"type": "String",
"var_name": "DEFAULT_HEADER_FORMAT"
},
{
"declarator": "MESSAGE = \"Add or... | {
"body": "private void checkPlainText() {\n\t\t if (expectedLines == null) {\n\t\t expectedLines = headerFormat.split(\"(?:\\r)?\\n|\\r\");\n\t\t }\n\t\t EsqlFile file = getContext().getEsqlFile();\n\t\t List<String> lines = CheckUtils.readLines(file);\n\t\t if (!matches(expectedLines, lines)) {\... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_0 | {
"fields": [
{
"declarator": "testVisitor = new ExecutionDataVisitor() {\n\t\tprivate int moduleCount = 0;\n\t\t@Override\n\t\tpublic void visitModuleExecution(ModuleExecutionData data) {\n\t\t\tmoduleCount++;\n\t\t\tassertNotNull(data);\n\t\t\tassertNotNull(data.getSchemaAndModuleName());\n\t\t\tassertTha... | {
"body": "@Test(expected=RuntimeException.class)\n\tpublic void testReaderWithNotExistingFile(){\n\t\tnew TraceFileReader(new File(\"src/test/resources/codecoverage/doesNotExist.txt\")).readTrace(testVisitor);\n\t}",
"class_method_signature": "TraceFileReaderTest.testReaderWithNotExistingFile()",
"constructor": ... | {
"fields": [
{
"declarator": "traceFile",
"modifier": "private final",
"original_string": "private final File traceFile;",
"type": "File",
"var_name": "traceFile"
},
{
"declarator": "pattern",
"modifier": "private",
"original_string": "private Pattern patte... | {
"body": "public TraceFileReader readTrace(ExecutionDataVisitor executionDataVisitor) {\n if (traceFile == null) {\n return this;\n }\n CodeCoverageExtension.LOG.info(\"Analysing {}\", traceFile);\n try (FileInputStream fis = new FileInputStream(traceFile)) {\n\n Buf... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_26 | {
"fields": [
{
"declarator": "CHARSET = Charsets.UTF_8",
"modifier": "private static final",
"original_string": "private static final Charset CHARSET = Charsets.UTF_8;",
"type": "Charset",
"var_name": "CHARSET"
},
{
"declarator": "highlighterVisitor",
"modifier":... | {
"body": "@Test\n\tpublic void javadoc_comment() throws Exception {\n\t\thighlight(\" /**Comment*/ \");\n\t\tassertHighlighting(2, 12, TypeOfText.STRUCTURED_COMMENT);\n\t}",
"class_method_signature": "HighlighterVisitorTest.javadoc_comment()",
"constructor": false,
"full_signature": "@Test public void javadoc... | {
"fields": [
{
"declarator": "sensorContext",
"modifier": "private final",
"original_string": "private final SensorContext sensorContext;",
"type": "SensorContext",
"var_name": "sensorContext"
},
{
"declarator": "highlighting",
"modifier": "private",
"origi... | {
"body": "private void highlight(SyntaxToken token, TypeOfText type) {\n\t\thighlighting.highlight(token.line(), token.column(), token.endLine(), token.endColumn(), type);\n\t}",
"class_method_signature": "HighlighterVisitor.highlight(SyntaxToken token, TypeOfText type)",
"constructor": false,
"full_signature"... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_30 | {
"fields": [
{
"declarator": "CHARSET = Charsets.UTF_8",
"modifier": "private static final",
"original_string": "private static final Charset CHARSET = Charsets.UTF_8;",
"type": "Charset",
"var_name": "CHARSET"
},
{
"declarator": "highlighterVisitor",
"modifier":... | {
"body": "@Test\n\tpublic void byte_order_mark() throws Exception {\n\t\thighlight(\"\\uFEFFDECLARE a CHAR; --\");\n\t\tassertHighlighting(0, 7, KEYWORD);\n\t}",
"class_method_signature": "HighlighterVisitorTest.byte_order_mark()",
"constructor": false,
"full_signature": "@Test public void byte_order_mark()",... | {
"fields": [
{
"declarator": "sensorContext",
"modifier": "private final",
"original_string": "private final SensorContext sensorContext;",
"type": "SensorContext",
"var_name": "sensorContext"
},
{
"declarator": "highlighting",
"modifier": "private",
"origi... | {
"body": "private void highlight(SyntaxToken token, TypeOfText type) {\n\t\thighlighting.highlight(token.line(), token.column(), token.endLine(), token.endColumn(), type);\n\t}",
"class_method_signature": "HighlighterVisitor.highlight(SyntaxToken token, TypeOfText type)",
"constructor": false,
"full_signature"... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_40 | {
"fields": [
{
"declarator": "thrown = ExpectedException.none()",
"modifier": "@org.junit.Rule\n public final",
"original_string": "@org.junit.Rule\n public final ExpectedException thrown = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "thrown"
},
... | {
"body": "@Test\n public void cancelled_context_should_cancel_progress_report_and_return_with_no_exception() {\n EsqlCheck check = new DoubleDispatchVisitorCheck() {\n };\n EsqlSensor sensor = createSensor();\n SensorContextTester cancelledContext = SensorContextTester.create(baseDir);... | {
"fields": [
{
"declarator": "LOG = Loggers.get(EsqlSensor.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = Loggers.get(EsqlSensor.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "checks",
"modifi... | {
"body": "@VisibleForTesting\n protected void analyseFiles(\n SensorContext context, List<TreeVisitor> treeVisitors, Iterable<InputFile> inputFiles,\n ProgressReport progressReport\n ) {\n boolean success = false;\n try {\n for (InputFile inputFile : inputFiles) {... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_17 | {
"fields": [],
"file": "esql-frontend/src/test/java/com/exxeta/iss/sonar/esql/tree/SyntacticEquivalenceTest.java",
"identifier": "SyntacticEquivalenceTest",
"interfaces": "",
"superclass": "extends EsqlTreeModelTest<Tree>"
} | {
"body": "@Test\n\tpublic void test_equivalence_for_tokens() throws Exception {\n\t\tTree tree1 = parse(\"IF TRUE THEN END IF;\", Tree.Kind.IF_STATEMENT);\n\t\tTree tree2 = parse(\"IF FALSE THEN END IF;\", Tree.Kind.IF_STATEMENT);\n\n\t\tassertThat(SyntacticEquivalence.areEquivalent(tree1, tree1)).isTrue();\n\t\tass... | {
"fields": [],
"file": "esql-frontend/src/main/java/com/exxeta/iss/sonar/esql/tree/SyntacticEquivalence.java",
"identifier": "SyntacticEquivalence",
"interfaces": "",
"methods": [
{
"class_method_signature": "SyntacticEquivalence.SyntacticEquivalence()",
"constructor": true,
"full_signa... | {
"body": "public static boolean areEquivalent(List<? extends Tree> leftList, List<? extends Tree> rightList) {\n if (leftList.size() != rightList.size() || leftList.isEmpty()) {\n return false;\n }\n\n for (int i = 0; i < leftList.size(); i++) {\n Tree left = leftList.get(i);\n Tree right = r... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_37 | {
"fields": [
{
"declarator": "thrown = ExpectedException.none()",
"modifier": "@org.junit.Rule\n public final",
"original_string": "@org.junit.Rule\n public final ExpectedException thrown = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "thrown"
},
... | {
"body": "@Test\n public void custom_rule() throws Exception {\n inputFile(\"file.esql\");\n ActiveRules activeRules = (new ActiveRulesBuilder())\n .addRule(new NewActiveRule.Builder().setRuleKey(RuleKey.of(\"customKey\", \"key\")).build()).build();\n checkFactory = new CheckFa... | {
"fields": [
{
"declarator": "LOG = Loggers.get(EsqlSensor.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = Loggers.get(EsqlSensor.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "checks",
"modifi... | {
"body": "public void execute(SensorContext context) {\n LOG.warn(\"ESQL sensor execute\");\n List<TreeVisitor> treeVisitors = Lists.newArrayList();\n treeVisitors.addAll(getTreeVisitors(context));\n treeVisitors.addAll(checks.visitorChecks());\n\n for (TreeVisitor check : treeVisi... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_21 | {
"fields": [
{
"declarator": "sensorContext",
"modifier": "private",
"original_string": "private SensorContextTester sensorContext;",
"type": "SensorContextTester",
"var_name": "sensorContext"
},
{
"declarator": "inputFile",
"modifier": "private",
"original... | {
"body": "@Test\n public void sonar_symbol_table() throws Exception {\n String filename = \"symbolHighlighting.esql\";\n String key = \"moduleKey:\" + filename;\n HighlightSymbolTableBuilder.build(newSymbolTable(filename), context(inputFile));\n\n // variable\n assertThat(references(key, 2, 11)).cont... | {
"fields": [],
"file": "esql-frontend/src/main/java/com/exxeta/iss/sonar/esql/highlighter/HighlightSymbolTableBuilder.java",
"identifier": "HighlightSymbolTableBuilder",
"interfaces": "",
"methods": [
{
"class_method_signature": "HighlightSymbolTableBuilder.HighlightSymbolTableBuilder()",
"co... | {
"body": "public static void build(NewSymbolTable newSymbolTable, TreeVisitorContext context) {\n\t\tfor (Symbol symbol : context.getSymbolModel().getSymbols()) {\n\t\t\thighlightSymbol(newSymbolTable, symbol);\n\t\t}\n\t\tnewSymbolTable.save();\n\t}",
"class_method_signature": "HighlightSymbolTableBuilder.build(N... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_7 | {
"fields": [],
"file": "esql-checks/src/test/java/com/exxeta/iss/sonar/esql/check/CommentRegularExpressionCheckTest.java",
"identifier": "CommentRegularExpressionCheckTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void exception() {\n\t\tCommentRegularExpressionCheck check = new CommentRegularExpressionCheck();\n\n\t\ttry {\n\t\t\tcheck.setRegularExpression(\"[abc\");\n\t\t} catch (IllegalStateException e) {\n\t\t\tassertThat(e.getMessage()).isEqualTo(\"Unable to compile regular expression: [abc\");\... | {
"fields": [
{
"declarator": "DEFAULT_REGULAR_EXPRESSION = \"\"",
"modifier": "private static final",
"original_string": "private static final String DEFAULT_REGULAR_EXPRESSION = \"\";",
"type": "String",
"var_name": "DEFAULT_REGULAR_EXPRESSION"
},
{
"declarator": "DEF... | {
"body": "public void setRegularExpression(String regularExpression) {\n this.regularExpression = regularExpression;\n init();\n }",
"class_method_signature": "CommentRegularExpressionCheck.setRegularExpression(String regularExpression)",
"constructor": false,
"full_signature": "public void se... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_6 | {
"fields": [
{
"declarator": "context",
"modifier": "private",
"original_string": "private SensorContextTester context;",
"type": "SensorContextTester",
"var_name": "context"
},
{
"declarator": "settings",
"modifier": "private",
"original_string": "private ... | {
"body": "@Test\n\tpublic void test_overall_coverage() {\n\t\tsensor.execute(context, linesOfCode, new String[] { \"TraceSensorTest/trace.txt\" });\n\n\t\tInteger[] file1Expected = { 3, 3, 1, null };\n\t\tInteger[] file2Expected = { 5, 5, null, null };\n\n\t\tassertThat(context.conditions(\"moduleKey:file1.esql\", 1... | {
"fields": [],
"file": "esql-code-coverage/src/main/java/com/exxeta/iss/sonar/esql/codecoverage/TraceSensor.java",
"identifier": "TraceSensor",
"interfaces": "",
"methods": [
{
"class_method_signature": "TraceSensor.execute(SensorContext context, Map<InputFile, Set<Integer>> executableLines, Strin... | {
"body": "public void execute(SensorContext context, Map<InputFile, Set<Integer>> executableLines, String[] traces) {\n\t\t\n\t\tfor (String trace : traces) {\n\t\t\tFileSystem fs = context.fileSystem();\n\t\t\tFile report = fs.resolvePath(trace);\n\t\t\tif (report.isFile()) {\n\t\t\t\tnew UnitTestsAnalyzer(report,... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_20 | {
"fields": [],
"file": "esql-frontend/src/test/java/com/exxeta/iss/sonar/esql/tree/symbols/type/PrimitiveOperationsTest.java",
"identifier": "PrimitiveOperationsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\n\tpublic void test() {\n\t\tassertThat(PrimitiveOperations.getType(new PrefixExpressionTreeImpl(Tree.Kind.UNARY_MINUS, null,new IsExpressionTreeImpl(null, null, null, null, null) ))).isEqualTo(PrimitiveType.INTEGER);\n\t\tassertThat(PrimitiveOperations.getType(new PrefixExpressionTreeImpl(Tree.Kin... | {
"fields": [
{
"declarator": "binaryOperationsResults = new HashMap<>()",
"modifier": "private static",
"original_string": "private static Map<OperationKey, Type> binaryOperationsResults = new HashMap<>();",
"type": "Map<OperationKey, Type>",
"var_name": "binaryOperationsResults"
... | {
"body": "@Nullable\n static Type getType(ExpressionTree leftOperand, ExpressionTree rightOperand, Tree.Kind operationKind) {\n if (COMPARATIVE_OPERATORS.contains(operationKind)) {\n return PrimitiveType.BOOLEAN;\n\n } else if (ARITHMETIC_OPERATORS.contains(operationKind)) {\n return PrimitiveType.I... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_36 | {
"fields": [
{
"declarator": "thrown = ExpectedException.none()",
"modifier": "@org.junit.Rule\n public final",
"original_string": "@org.junit.Rule\n public final ExpectedException thrown = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "thrown"
},
... | {
"body": "@Test\n public void save_issue() throws Exception {\n inputFile(\"file.esql\");\n\n ActiveRules activeRules = (new ActiveRulesBuilder())\n .addRule(new NewActiveRule.Builder().setRuleKey(RuleKey.of(CheckList.REPOSITORY_KEY, \"MissingNewlineAtEndOfFile\")).build())\n ... | {
"fields": [
{
"declarator": "LOG = Loggers.get(EsqlSensor.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = Loggers.get(EsqlSensor.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "checks",
"modifi... | {
"body": "public void execute(SensorContext context) {\n LOG.warn(\"ESQL sensor execute\");\n List<TreeVisitor> treeVisitors = Lists.newArrayList();\n treeVisitors.addAll(getTreeVisitors(context));\n treeVisitors.addAll(checks.visitorChecks());\n\n for (TreeVisitor check : treeVisi... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_16 | {
"fields": [],
"file": "esql-frontend/src/test/java/com/exxeta/iss/sonar/esql/tree/SyntacticEquivalenceTest.java",
"identifier": "SyntacticEquivalenceTest",
"interfaces": "",
"superclass": "extends EsqlTreeModelTest<Tree>"
} | {
"body": "@Test\n\tpublic void test_equivalence_for_empty_tree_list() throws Exception {\n\t\tCallStatementTree tree1 = (CallStatementTree) parse(\"CALL f() ;\", Tree.Kind.CALL_STATEMENT);\n\t\tCallStatementTree tree2 = (CallStatementTree) parse(\"CALL f() ;\", Tree.Kind.CALL_STATEMENT);\n\n\t\tassertThat(SyntacticE... | {
"fields": [],
"file": "esql-frontend/src/main/java/com/exxeta/iss/sonar/esql/tree/SyntacticEquivalence.java",
"identifier": "SyntacticEquivalence",
"interfaces": "",
"methods": [
{
"class_method_signature": "SyntacticEquivalence.SyntacticEquivalence()",
"constructor": true,
"full_signa... | {
"body": "public static boolean areEquivalent(List<? extends Tree> leftList, List<? extends Tree> rightList) {\n if (leftList.size() != rightList.size() || leftList.isEmpty()) {\n return false;\n }\n\n for (int i = 0; i < leftList.size(); i++) {\n Tree left = leftList.get(i);\n Tree right = r... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
33989963_41 | {
"fields": [
{
"declarator": "settings",
"modifier": "private",
"original_string": "private MapSettings settings;",
"type": "MapSettings",
"var_name": "settings"
},
{
"declarator": "esqlLanguage",
"modifier": "private",
"original_string": "private EsqlLangu... | {
"body": "@Test\n\t public void defaultSuffixes() {\n\t\t MapSettings mapSettings = new MapSettings();\n\t\t mapSettings.setProperty(EsqlLanguage.FILE_SUFFIXES_KEY, EsqlLanguage.FILE_SUFFIXES_DEFVALUE);\n\t\t EsqlLanguage esqlLanguage = new EsqlLanguage(mapSettings.asConfig());\n\t\t assertThat(esqlLanguage.get... | {
"fields": [
{
"declarator": "KEY = \"esql\"",
"modifier": "public static final",
"original_string": "public static final String KEY = \"esql\";",
"type": "String",
"var_name": "KEY"
},
{
"declarator": "FILE_SUFFIXES_KEY = \"sonar.esql.file.suffixes\"",
"modifier... | {
"body": "@Override\n public String[] getFileSuffixes() {\n return configuration.getStringArray(FILE_SUFFIXES_KEY);\n }",
"class_method_signature": "EsqlLanguage.getFileSuffixes()",
"constructor": false,
"full_signature": "@Override public String[] getFileSuffixes()",
"identifier": "getFileSuffi... | {
"created": null,
"fork": null,
"fork_count": 30,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 33989963,
"size": 4181,
"stargazer_count": 22,
"stars": null,
"updates": null,
"url": "https://github.com/EXXETA/sonar-esql-plugin"
} |
85692970_59 | {
"fields": [],
"file": "cache/src/test/java/com/github/thorbenkuck/netcom2/network/shared/cache/NativeCacheTest.java",
"identifier": "NativeCacheTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void isSet() throws Exception {\n\t\t// Arrange\n\t\tNativeCache cache = new NativeCache();\n\n\t\t// Act\n\t\tboolean isSet = cache.isSet(CacheElement.class);\n\n\t\t// Assert\n\t\tassertFalse(isSet);\n\t}",
"class_method_signature": "NativeCacheTest.isSet()",
"constructor": false,
"... | {
"fields": [
{
"declarator": "internals = new HashMap<>()",
"modifier": "private final",
"original_string": "private final Map<Class<?>, Object> internals = new HashMap<>();",
"type": "Map<Class<?>, Object>",
"var_name": "internals"
},
{
"declarator": "semaphore = new ... | {
"body": "@Override\n\tpublic boolean isSet(final Class<?> clazz) {\n\t\tNetCom2Utils.parameterNotNull(clazz);\n\t\treturn get(clazz).isPresent();\n\t}",
"class_method_signature": "NativeCache.isSet(final Class<?> clazz)",
"constructor": false,
"full_signature": "@Override public boolean isSet(final Class<?> c... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 85692970,
"size": 2370,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/ThorbenKuck/NetCom2"
} |
85692970_18 | {
"fields": [],
"file": "rmi/src/test/java/com/github/thorbenkuck/netcom2/network/server/NativeRemoteObjectRegistrationTest.java",
"identifier": "NativeRemoteObjectRegistrationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IllegalArgumentException.class)\n\tpublic void unregisterNullClassArrayWithObject() throws Exception {\n\t\t//Arrange\n\t\tNativeRemoteObjectRegistration remoteObjectRegistration = new NativeRemoteObjectRegistration();\n\n\t\t//Act\n\t\tremoteObjectRegistration.unregister(new TestRemoteObj... | {
"fields": [
{
"declarator": "PRIMITIVE_MAPPING",
"modifier": "private static final",
"original_string": "private static final Map<Class<?>, Class<?>> PRIMITIVE_MAPPING;",
"type": "Map<Class<?>, Class<?>>",
"var_name": "PRIMITIVE_MAPPING"
},
{
"declarator": "mapping = ... | {
"body": "@Override\n\tpublic final void unregister(final Object object) {\n\t\tNetCom2Utils.parameterNotNull(object);\n\t\tunregister(object, object.getClass());\n\t}",
"class_method_signature": "NativeRemoteObjectRegistration.unregister(final Object object)",
"constructor": false,
"full_signature": "@Overrid... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 85692970,
"size": 2370,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/ThorbenKuck/NetCom2"
} |
85692970_63 | {
"fields": [],
"file": "cache/src/test/java/com/github/thorbenkuck/netcom2/network/shared/cache/NativeCacheTest.java",
"identifier": "NativeCacheTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void removeGeneralObserver() throws Exception {\n\t\t// Arrange\n\t\tNativeCache cache = new NativeCache();\n\t\tGeneralCacheObserver observer = new GeneralCacheObserver() {\n\t\t\t@Override\n\t\t\tpublic void newEntry(final Object o, final CacheObservable observable) {\n\n\t\t\t}\n\n\t\t\t... | {
"fields": [
{
"declarator": "internals = new HashMap<>()",
"modifier": "private final",
"original_string": "private final Map<Class<?>, Object> internals = new HashMap<>();",
"type": "Map<Class<?>, Object>",
"var_name": "internals"
},
{
"declarator": "semaphore = new ... | {
"body": "@Override\n\tpublic void removeGeneralObserver(final GeneralCacheObserver observer) {\n\t\tlogging.debug(\"Removing Observer(\" + observer + \") from \" + toString());\n\t\tNetCom2Utils.parameterNotNull(observer);\n\t\tdeleteObserver(observer);\n\t}",
"class_method_signature": "NativeCache.removeGeneralO... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 85692970,
"size": 2370,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/ThorbenKuck/NetCom2"
} |
85692970_34 | {
"fields": [
{
"declarator": "registration",
"modifier": "private",
"original_string": "private CommunicationRegistration registration;",
"type": "CommunicationRegistration",
"var_name": "registration"
}
],
"file": "core/src/test/java/com/github/thorbenkuck/netcom2/network/s... | {
"body": "@Test\n\tpublic void setID() throws Exception {\n\t\t// Arrange\n\t\tNativeClient client = new NativeClient(registration);\n\t\tClientID id = client.getID();\n\n\t\t// Act\n\t\tclient.setID(ClientID.fromString(TestUtils.UUID_SEED_1));\n\n\t\t// Assert\n\t\tassertEquals(id, client.getID());\n\t}",
"class_... | {
"fields": [
{
"declarator": "communicationRegistration",
"modifier": "private final",
"original_string": "private final CommunicationRegistration communicationRegistration;",
"type": "CommunicationRegistration",
"var_name": "communicationRegistration"
},
{
"declarator... | {
"body": "@Override\n\tpublic void setID(ClientID id) {\n\t\tclientID.updateBy(id);\n\t}",
"class_method_signature": "NativeClient.setID(ClientID id)",
"constructor": false,
"full_signature": "@Override public void setID(ClientID id)",
"identifier": "setID",
"invocations": [
"updateBy"
],
"modifier... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 85692970,
"size": 2370,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/ThorbenKuck/NetCom2"
} |
85692970_6 | {
"fields": [],
"file": "rmi/src/test/java/com/github/thorbenkuck/netcom2/network/client/RemoteAccessBlockRegistrationTest.java",
"identifier": "RemoteAccessBlockRegistrationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void release() throws Exception {\n\t\t// Arrange\n\t\tRemoteAccessBlockRegistration registration = new RemoteAccessBlockRegistration();\n\t\tUUID id = UUID.randomUUID();\n\n\t\t// Act\n\t\tSemaphore semaphore = registration.await(new RemoteAccessCommunicationRequest(\"\", Example.class, id... | {
"fields": [
{
"declarator": "semaphoreMap = new HashMap<>()",
"modifier": "private final",
"original_string": "private final Map<UUID, Semaphore> semaphoreMap = new HashMap<>();",
"type": "Map<UUID, Semaphore>",
"var_name": "semaphoreMap"
},
{
"declarator": "responseM... | {
"body": "@APILevel\n\tvoid release(RemoteAccessCommunicationResponse response) {\n\t\tNetCom2Utils.parameterNotNull(response);\n\t\tsynchronized (responseMap) {\n\t\t\tresponseMap.put(response.getUuid(), response);\n\t\t}\n\t\tSemaphore semaphore = getSemaphore(response.getUuid());\n\n\t\tif (semaphore == null) {\n... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 85692970,
"size": 2370,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/ThorbenKuck/NetCom2"
} |
85692970_22 | {
"fields": [],
"file": "rmi/src/test/java/com/github/thorbenkuck/netcom2/network/server/NativeRemoteObjectRegistrationTest.java",
"identifier": "NativeRemoteObjectRegistrationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IllegalArgumentException.class)\n\tpublic void runNullRequest() throws Exception {\n\t\t//Arrange\n\t\tNativeRemoteObjectRegistration remoteObjectRegistration = new NativeRemoteObjectRegistration();\n\n\t\t//Act\n\t\tremoteObjectRegistration.run(null);\n\n\t\t//Assert\n\t\tfail();\n\t}",
... | {
"fields": [
{
"declarator": "PRIMITIVE_MAPPING",
"modifier": "private static final",
"original_string": "private static final Map<Class<?>, Class<?>> PRIMITIVE_MAPPING;",
"type": "Map<Class<?>, Class<?>>",
"var_name": "PRIMITIVE_MAPPING"
},
{
"declarator": "mapping = ... | {
"body": "@Override\n\tpublic final RemoteAccessCommunicationResponse run(final RemoteAccessCommunicationRequest request) {\n\t\tNetCom2Utils.parameterNotNull(request);\n\t\tNetCom2Utils.parameterNotNull(request.getMethodName(), request.getClazz(), request.getUuid());\n\t\tfinal Object handlingObject;\n\t\tsynchroni... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 85692970,
"size": 2370,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/ThorbenKuck/NetCom2"
} |
85692970_75 | {
"fields": [
{
"declarator": "ADDRESS = \"localhost\"",
"modifier": "private static final",
"original_string": "private static final String ADDRESS = \"localhost\";",
"type": "String",
"var_name": "ADDRESS"
},
{
"declarator": "PORT = 1",
"modifier": "private stat... | {
"body": "@Test(expected = ConnectionEstablishmentFailedException.class)\n\tpublic void newConnectionNeg() throws Exception {\n\t\t// Arrange\n\t\tClientStart clientStart = new NativeClientStart(socketAddress, mockedClientCore);\n\n\t\t// Act\n\t\tclientStart.newConnection(TestSendObject.class);\n\n\t\t// Assert\n\t... | {
"fields": [
{
"declarator": "addressValue = Value.emptySynchronized()",
"modifier": "private final",
"original_string": "private final Value<SocketAddress> addressValue = Value.emptySynchronized();",
"type": "Value<SocketAddress>",
"var_name": "addressValue"
},
{
"dec... | {
"body": "@Override\n\tpublic Awaiting newConnection(Class<?> identifier) throws ConnectionEstablishmentFailedException {\n\t\ttry {\n\t\t\tclientCore.establishConnection(addressValue.get(), client, identifier);\n\t\t} catch (StartFailedException e) {\n\t\t\tthrow new ConnectionEstablishmentFailedException(e);\n\t\t... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 85692970,
"size": 2370,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/ThorbenKuck/NetCom2"
} |
85692970_55 | {
"fields": [],
"file": "cache/src/test/java/com/github/thorbenkuck/netcom2/network/shared/cache/NativeCacheTest.java",
"identifier": "NativeCacheTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void addAndOverride() throws Exception {\n\t\t// Arrange\n\t\tNativeCache cache = new NativeCache();\n\t\tCacheElement element = new CacheElement();\n\n\t\t// Act\n\t\tcache.addAndOverride(element);\n\n\t\t// Assert\n\t\tOptional<CacheElement> optional = cache.get(CacheElement.class);\n\t\t... | {
"fields": [
{
"declarator": "internals = new HashMap<>()",
"modifier": "private final",
"original_string": "private final Map<Class<?>, Object> internals = new HashMap<>();",
"type": "Map<Class<?>, Object>",
"var_name": "internals"
},
{
"declarator": "semaphore = new ... | {
"body": "@Override\n\tpublic void addAndOverride(final Object object) {\n\t\tNetCom2Utils.parameterNotNull(object);\n\t\tif (!isSet(object.getClass())) {\n\t\t\taddNew(object);\n\t\t} else {\n\t\t\tupdate(object);\n\t\t}\n\t}",
"class_method_signature": "NativeCache.addAndOverride(final Object object)",
"constr... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 85692970,
"size": 2370,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/ThorbenKuck/NetCom2"
} |
85692970_43 | {
"fields": [
{
"declarator": "bridge",
"modifier": "private",
"original_string": "private SendBridge bridge;",
"type": "SendBridge",
"var_name": "bridge"
}
],
"file": "core/src/test/java/com/github/thorbenkuck/netcom2/network/shared/NativeSessionTest.java",
"identifier": "... | {
"body": "@Test\n\tpublic void isIdentified() throws Exception {\n\t\t// Arrange\n\t\tNativeSession session = new NativeSession(bridge);\n\n\t\t// Act\n\t\tboolean isIdentified = session.isIdentified();\n\n\t\t// Assert\n\t\tassertFalse(isIdentified);\n\t}",
"class_method_signature": "NativeSessionTest.isIdentifie... | {
"fields": [
{
"declarator": "sendBridge",
"modifier": "private final",
"original_string": "private final SendBridge sendBridge;",
"type": "SendBridge",
"var_name": "sendBridge"
},
{
"declarator": "identifiedValue = Value.synchronize(false)",
"modifier": "private... | {
"body": "@Override\n\tpublic boolean isIdentified() {\n\t\treturn identifiedValue.get();\n\t}",
"class_method_signature": "NativeSession.isIdentified()",
"constructor": false,
"full_signature": "@Override public boolean isIdentified()",
"identifier": "isIdentified",
"invocations": [
"get"
],
"modi... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 85692970,
"size": 2370,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/ThorbenKuck/NetCom2"
} |
85692970_14 | {
"fields": [],
"file": "rmi/src/test/java/com/github/thorbenkuck/netcom2/network/server/NativeRemoteObjectRegistrationTest.java",
"identifier": "NativeRemoteObjectRegistrationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IllegalArgumentException.class)\n\tpublic void unregisterNullClassArray() throws Exception {\n\t\t//Arrange\n\t\tNativeRemoteObjectRegistration remoteObjectRegistration = new NativeRemoteObjectRegistration();\n\n\t\t//Act\n\t\tremoteObjectRegistration.unregister((Class[]) null);\n\n\t\t//A... | {
"fields": [
{
"declarator": "PRIMITIVE_MAPPING",
"modifier": "private static final",
"original_string": "private static final Map<Class<?>, Class<?>> PRIMITIVE_MAPPING;",
"type": "Map<Class<?>, Class<?>>",
"var_name": "PRIMITIVE_MAPPING"
},
{
"declarator": "mapping = ... | {
"body": "@Override\n\tpublic final void unregister(final Object object) {\n\t\tNetCom2Utils.parameterNotNull(object);\n\t\tunregister(object, object.getClass());\n\t}",
"class_method_signature": "NativeRemoteObjectRegistration.unregister(final Object object)",
"constructor": false,
"full_signature": "@Overrid... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 85692970,
"size": 2370,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/ThorbenKuck/NetCom2"
} |
85692970_80 | {
"fields": [
{
"declarator": "ADDRESS = \"localhost\"",
"modifier": "private static final",
"original_string": "private static final String ADDRESS = \"localhost\";",
"type": "String",
"var_name": "ADDRESS"
},
{
"declarator": "PORT = 1",
"modifier": "private stat... | {
"body": "@Test\n\tpublic void setMainDeSerializationAdapter() throws Exception {\n\t\t// Arrange\n\t\tNativeClientStart clientStart = new NativeClientStart(socketAddress, mockedClientCore);\n\t\tDeSerializationAdapter adapter = o -> o;\n\n\t\t// Act\n\t\tclientStart.setMainDeSerializationAdapter(adapter);\n\n\t\t//... | {
"fields": [
{
"declarator": "addressValue = Value.emptySynchronized()",
"modifier": "private final",
"original_string": "private final Value<SocketAddress> addressValue = Value.emptySynchronized();",
"type": "Value<SocketAddress>",
"var_name": "addressValue"
},
{
"dec... | {
"body": "@Override\n\tpublic void setMainDeSerializationAdapter(DeSerializationAdapter mainDeSerializationAdapter) {\n\t\tclient.objectHandler().setMainDeserialization(mainDeSerializationAdapter);\n\t}",
"class_method_signature": "NativeClientStart.setMainDeSerializationAdapter(DeSerializationAdapter mainDeSerial... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 85692970,
"size": 2370,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/ThorbenKuck/NetCom2"
} |
85692970_38 | {
"fields": [
{
"declarator": "registration",
"modifier": "private",
"original_string": "private CommunicationRegistration registration;",
"type": "CommunicationRegistration",
"var_name": "registration"
}
],
"file": "core/src/test/java/com/github/thorbenkuck/netcom2/network/s... | {
"body": "@Test\n\tpublic void prepareConnection() throws Exception {\n\t\t// Arrange\n\t\tNativeClient client = new NativeClient(registration);\n\n\t\t// Act\n\t\tAwaiting awaiting = client.prepareConnection(TestConnectionKey.class);\n\n\t\t// Assert\n\t\tassertNotNull(awaiting);\n\t\tassertFalse(Synchronize.isEmpt... | {
"fields": [
{
"declarator": "communicationRegistration",
"modifier": "private final",
"original_string": "private final CommunicationRegistration communicationRegistration;",
"type": "CommunicationRegistration",
"var_name": "communicationRegistration"
},
{
"declarator... | {
"body": "@Override\n\tpublic Awaiting prepareConnection(Class clazz) {\n\t\tNetCom2Utils.parameterNotNull(clazz);\n\t\tlogging.debug(\"Trying to prepare for \" + clazz);\n\t\tsynchronized (prepared) {\n\t\t\tprepared.computeIfAbsent(clazz, key -> Synchronize.createDefault());\n\t\t\treturn prepared.get(clazz);\n\t\... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 85692970,
"size": 2370,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/ThorbenKuck/NetCom2"
} |
85692970_96 | {
"fields": [
{
"declarator": "socketAddress = new InetSocketAddress(8888)",
"modifier": "private static final",
"original_string": "private static final InetSocketAddress socketAddress = new InetSocketAddress(8888);",
"type": "InetSocketAddress",
"var_name": "socketAddress"
},
... | {
"body": "@Test\n\tpublic void getCommunicationRegistrationNotRunning() throws Exception {\n\t\t// Arrange\n\n\t\t// Act\n\t\tCommunicationRegistration registration = serverStart.getCommunicationRegistration();\n\n\t\t// Assert\n\t\tassertNotNull(registration);\n\t}",
"class_method_signature": "NativeServerStartTe... | {
"fields": [
{
"declarator": "addressValue = Value.emptySynchronized()",
"modifier": "private final",
"original_string": "private final Value<InetSocketAddress> addressValue = Value.emptySynchronized();",
"type": "Value<InetSocketAddress>",
"var_name": "addressValue"
},
{
... | {
"body": "@Override\n\tpublic final CommunicationRegistration getCommunicationRegistration() {\n\t\treturn communicationRegistration;\n\t}",
"class_method_signature": "NativeServerStart.getCommunicationRegistration()",
"constructor": false,
"full_signature": "@Override public final CommunicationRegistration ge... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 85692970,
"size": 2370,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/ThorbenKuck/NetCom2"
} |
85692970_79 | {
"fields": [
{
"declarator": "ADDRESS = \"localhost\"",
"modifier": "private static final",
"original_string": "private static final String ADDRESS = \"localhost\";",
"type": "String",
"var_name": "ADDRESS"
},
{
"declarator": "PORT = 1",
"modifier": "private stat... | {
"body": "@Test\n\tpublic void setMainSerializationAdapter() throws Exception {\n\t\t// Arrange\n\t\tNativeClientStart clientStart = new NativeClientStart(socketAddress, mockedClientCore);\n\t\tSerializationAdapter adapter = Object::toString;\n\n\t\t// Act\n\t\tclientStart.setMainSerializationAdapter(adapter);\n\n\t... | {
"fields": [
{
"declarator": "addressValue = Value.emptySynchronized()",
"modifier": "private final",
"original_string": "private final Value<SocketAddress> addressValue = Value.emptySynchronized();",
"type": "Value<SocketAddress>",
"var_name": "addressValue"
},
{
"dec... | {
"body": "@Override\n\tpublic void setMainSerializationAdapter(SerializationAdapter mainSerializationAdapter) {\n\t\tclient.objectHandler().setMainSerialization(mainSerializationAdapter);\n\t}",
"class_method_signature": "NativeClientStart.setMainSerializationAdapter(SerializationAdapter mainSerializationAdapter)"... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 85692970,
"size": 2370,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/ThorbenKuck/NetCom2"
} |
85692970_104 | {
"fields": [],
"file": "main/src/test/java/com/github/thorbenkuck/netcom2/network/server/NativeClientListTest.java",
"identifier": "NativeClientListTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void open() throws Exception {\n\t\t//Arrange\n\t\tNativeClientList clients = new NativeClientList();\n\n\t\t//Act\n\t\tclients.open();\n\n\t\t//Assert\n\t\tassertTrue(clients.isOpen());\n\t}",
"class_method_signature": "NativeClientListTest.open()",
"constructor": false,
"full_signat... | {
"fields": [
{
"declarator": "core",
"modifier": "private final",
"original_string": "private final List<Client> core;",
"type": "List<Client>",
"var_name": "core"
},
{
"declarator": "openValue",
"modifier": "private final",
"original_string": "private fina... | {
"body": "@Override\n\tpublic final void open() {\n\t\tlogging.debug(\"Opening \" + this);\n\t\topenValue.set(true);\n\t}",
"class_method_signature": "NativeClientList.open()",
"constructor": false,
"full_signature": "@Override public final void open()",
"identifier": "open",
"invocations": [
"debug",
... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 85692970,
"size": 2370,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/ThorbenKuck/NetCom2"
} |
85692970_105 | {
"fields": [],
"file": "main/src/test/java/com/github/thorbenkuck/netcom2/network/server/NativeClientListTest.java",
"identifier": "NativeClientListTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\t@Ignore\n\t// TODO change to correct behaviour!\n\tpublic void isOpen() throws Exception {\n\t\t//Arrange\n\t\tNativeClientList clients = new NativeClientList();\n\n\t\t//Act\n\n\t\t//Assert\n\t\tassertTrue(clients.isOpen());\n\t}",
"class_method_signature": "NativeClientListTest.isOpen()",
"c... | {
"fields": [
{
"declarator": "core",
"modifier": "private final",
"original_string": "private final List<Client> core;",
"type": "List<Client>",
"var_name": "core"
},
{
"declarator": "openValue",
"modifier": "private final",
"original_string": "private fina... | {
"body": "@Override\n\tpublic final boolean isOpen() {\n\t\treturn openValue.get();\n\t}",
"class_method_signature": "NativeClientList.isOpen()",
"constructor": false,
"full_signature": "@Override public final boolean isOpen()",
"identifier": "isOpen",
"invocations": [
"get"
],
"modifiers": "@Overr... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 85692970,
"size": 2370,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/ThorbenKuck/NetCom2"
} |
85692970_97 | {
"fields": [
{
"declarator": "socketAddress = new InetSocketAddress(8888)",
"modifier": "private static final",
"original_string": "private static final InetSocketAddress socketAddress = new InetSocketAddress(8888);",
"type": "InetSocketAddress",
"var_name": "socketAddress"
},
... | {
"body": "@Test\n\tpublic void softStop() throws Exception {\n\t\t// Arrange\n\n\t\tserverStart.launch();\n\n\t\t// Act\n\t\tserverStart.softStop();\n\n\t\t// Assert\n\t\tassertFalse(serverStart.running());\n\t}",
"class_method_signature": "NativeServerStartTest.softStop()",
"constructor": false,
"full_signatu... | {
"fields": [
{
"declarator": "addressValue = Value.emptySynchronized()",
"modifier": "private final",
"original_string": "private final Value<InetSocketAddress> addressValue = Value.emptySynchronized();",
"type": "Value<InetSocketAddress>",
"var_name": "addressValue"
},
{
... | {
"body": "@Override\n\tpublic final void softStop() {\n\t\trunning.set(false);\n\t}",
"class_method_signature": "NativeServerStart.softStop()",
"constructor": false,
"full_signature": "@Override public final void softStop()",
"identifier": "softStop",
"invocations": [
"set"
],
"modifiers": "@Overri... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 85692970,
"size": 2370,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/ThorbenKuck/NetCom2"
} |
85692970_78 | {
"fields": [
{
"declarator": "ADDRESS = \"localhost\"",
"modifier": "private static final",
"original_string": "private static final String ADDRESS = \"localhost\";",
"type": "String",
"var_name": "ADDRESS"
},
{
"declarator": "PORT = 1",
"modifier": "private stat... | {
"body": "@Test\n\tpublic void addFallBackDeSerialization() throws Exception {\n\t\t// Arrange\n\t\tNativeClientStart clientStart = new NativeClientStart(socketAddress, mockedClientCore);\n\t\tDeSerializationAdapter adapter = o -> o;\n\n\t\t// Act\n\t\tclientStart.addFallBackDeSerialization(adapter);\n\n\t\t// Asser... | {
"fields": [
{
"declarator": "addressValue = Value.emptySynchronized()",
"modifier": "private final",
"original_string": "private final Value<SocketAddress> addressValue = Value.emptySynchronized();",
"type": "Value<SocketAddress>",
"var_name": "addressValue"
},
{
"dec... | {
"body": "@Override\n\tpublic void addFallBackDeSerialization(DeSerializationAdapter deSerializationAdapter) {\n\t\tclient.objectHandler().addFallbackDeserialization(deSerializationAdapter);\n\t}",
"class_method_signature": "NativeClientStart.addFallBackDeSerialization(DeSerializationAdapter deSerializationAdapter... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 85692970,
"size": 2370,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/ThorbenKuck/NetCom2"
} |
85692970_39 | {
"fields": [
{
"declarator": "registration",
"modifier": "private",
"original_string": "private CommunicationRegistration registration;",
"type": "CommunicationRegistration",
"var_name": "registration"
}
],
"file": "core/src/test/java/com/github/thorbenkuck/netcom2/network/s... | {
"body": "@Test\n\tpublic void prepareConnectionDouble() throws Exception {\n\t\t// Arrange\n\t\tNativeClient client = new NativeClient(registration);\n\t\tAwaiting awaiting = client.prepareConnection(TestConnectionKey.class);\n\n\t\t// Act\n\t\tAwaiting awaitingTwo = client.prepareConnection(TestConnectionKey.class... | {
"fields": [
{
"declarator": "communicationRegistration",
"modifier": "private final",
"original_string": "private final CommunicationRegistration communicationRegistration;",
"type": "CommunicationRegistration",
"var_name": "communicationRegistration"
},
{
"declarator... | {
"body": "@Override\n\tpublic Awaiting prepareConnection(Class clazz) {\n\t\tNetCom2Utils.parameterNotNull(clazz);\n\t\tlogging.debug(\"Trying to prepare for \" + clazz);\n\t\tsynchronized (prepared) {\n\t\t\tprepared.computeIfAbsent(clazz, key -> Synchronize.createDefault());\n\t\t\treturn prepared.get(clazz);\n\t\... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 85692970,
"size": 2370,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/ThorbenKuck/NetCom2"
} |
85692970_81 | {
"fields": [
{
"declarator": "ADDRESS = \"localhost\"",
"modifier": "private static final",
"original_string": "private static final String ADDRESS = \"localhost\";",
"type": "String",
"var_name": "ADDRESS"
},
{
"declarator": "PORT = 1",
"modifier": "private stat... | {
"body": "@Test\n\tpublic void addDisconnectedHandler() throws Exception {\n\t\t// Arrange\n\t\tNativeClientStart clientStart = new NativeClientStart(socketAddress, mockedClientCore);\n\n\t\tClientDisconnectedHandler clientDisconnectedHandler = client -> {\n\t\t};\n\n\t\t// Act\n\t\tclientStart.addDisconnectedHandle... | {
"fields": [
{
"declarator": "addressValue = Value.emptySynchronized()",
"modifier": "private final",
"original_string": "private final Value<SocketAddress> addressValue = Value.emptySynchronized();",
"type": "Value<SocketAddress>",
"var_name": "addressValue"
},
{
"dec... | {
"body": "@Override\n\tpublic void addDisconnectedHandler(ClientDisconnectedHandler clientDisconnectedHandler) {\n\t\tclient.addDisconnectedHandler(clientDisconnectedHandler);\n\t}",
"class_method_signature": "NativeClientStart.addDisconnectedHandler(ClientDisconnectedHandler clientDisconnectedHandler)",
"constr... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 85692970,
"size": 2370,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/ThorbenKuck/NetCom2"
} |
85692970_15 | {
"fields": [],
"file": "rmi/src/test/java/com/github/thorbenkuck/netcom2/network/server/NativeRemoteObjectRegistrationTest.java",
"identifier": "NativeRemoteObjectRegistrationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IllegalArgumentException.class)\n\tpublic void unregisterNullObject() throws Exception {\n\t\t//Arrange\n\t\tNativeRemoteObjectRegistration remoteObjectRegistration = new NativeRemoteObjectRegistration();\n\n\t\t//Act\n\t\tremoteObjectRegistration.unregister((Object) null);\n\n\t\t//Assert... | {
"fields": [
{
"declarator": "PRIMITIVE_MAPPING",
"modifier": "private static final",
"original_string": "private static final Map<Class<?>, Class<?>> PRIMITIVE_MAPPING;",
"type": "Map<Class<?>, Class<?>>",
"var_name": "PRIMITIVE_MAPPING"
},
{
"declarator": "mapping = ... | {
"body": "@Override\n\tpublic final void unregister(final Object object) {\n\t\tNetCom2Utils.parameterNotNull(object);\n\t\tunregister(object, object.getClass());\n\t}",
"class_method_signature": "NativeRemoteObjectRegistration.unregister(final Object object)",
"constructor": false,
"full_signature": "@Overrid... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 85692970,
"size": 2370,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/ThorbenKuck/NetCom2"
} |
85692970_42 | {
"fields": [
{
"declarator": "registration",
"modifier": "private",
"original_string": "private CommunicationRegistration registration;",
"type": "CommunicationRegistration",
"var_name": "registration"
}
],
"file": "core/src/test/java/com/github/thorbenkuck/netcom2/network/s... | {
"body": "@Test(expected = IllegalArgumentException.class)\n\tpublic void notifyAboutPreparedConnectionNull() throws Exception {\n\t\t// Arrange\n\t\tNativeClient client = new NativeClient(registration);\n\n\t\t// Act\n\t\tclient.connectionPrepared(null);\n\n\t\t// Assert\n\t\tfail();\n\t}",
"class_method_signatur... | {
"fields": [
{
"declarator": "communicationRegistration",
"modifier": "private final",
"original_string": "private final CommunicationRegistration communicationRegistration;",
"type": "CommunicationRegistration",
"var_name": "communicationRegistration"
},
{
"declarator... | {
"body": "@Override\n\tpublic void connectionPrepared(Class<?> identifier) {\n\t\tlogging.debug(\"Releasing all Threads, waiting for the preparation of the Connection \" + identifier);\n\t\tsynchronized (prepared) {\n\t\t\tlogging.trace(\"Fetching Synchronize\");\n\t\t\tSynchronize synchronize = prepared.remove(iden... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 85692970,
"size": 2370,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/ThorbenKuck/NetCom2"
} |
85692970_54 | {
"fields": [],
"file": "cache/src/test/java/com/github/thorbenkuck/netcom2/network/shared/cache/NativeCacheTest.java",
"identifier": "NativeCacheTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void addNew() throws Exception {\n\t\t// Arrange\n\t\tNativeCache cache = new NativeCache();\n\t\tCacheElement element = new CacheElement();\n\n\t\t// Act\n\t\tcache.addNew(element);\n\n\t\t// Assert\n\t\tOptional<CacheElement> optional = cache.get(CacheElement.class);\n\t\tassertTrue(optio... | {
"fields": [
{
"declarator": "internals = new HashMap<>()",
"modifier": "private final",
"original_string": "private final Map<Class<?>, Object> internals = new HashMap<>();",
"type": "Map<Class<?>, Object>",
"var_name": "internals"
},
{
"declarator": "semaphore = new ... | {
"body": "@Override\n\tpublic void addNew(final Object object) {\n\t\tlogging.trace(\"Trying to add a new Object(\" + object + \") to Cache ..\");\n\t\tNetCom2Utils.parameterNotNull(object);\n\t\tif (!isSet(object.getClass())) {\n\t\t\tsynchronized (internals) {\n\t\t\t\tinternals.put(object.getClass(), object);\n\t... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 85692970,
"size": 2370,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/ThorbenKuck/NetCom2"
} |
85692970_74 | {
"fields": [
{
"declarator": "ADDRESS = \"localhost\"",
"modifier": "private static final",
"original_string": "private static final String ADDRESS = \"localhost\";",
"type": "String",
"var_name": "ADDRESS"
},
{
"declarator": "PORT = 1",
"modifier": "private stat... | {
"body": "@Test\n\tpublic void newConnection() throws Exception {\n\t\t// Arrange\n\t\tNativeClientStart clientStart = new NativeClientStart(socketAddress, mockedClientCore);\n\t\tConnection mockedConnection = mock(Connection.class);\n\t\twhen(mockedConnection.getIdentifier()).thenReturn(Optional.of(TestSendObject.c... | {
"fields": [
{
"declarator": "addressValue = Value.emptySynchronized()",
"modifier": "private final",
"original_string": "private final Value<SocketAddress> addressValue = Value.emptySynchronized();",
"type": "Value<SocketAddress>",
"var_name": "addressValue"
},
{
"dec... | {
"body": "@Override\n\tpublic Awaiting newConnection(Class<?> identifier) throws ConnectionEstablishmentFailedException {\n\t\ttry {\n\t\t\tclientCore.establishConnection(addressValue.get(), client, identifier);\n\t\t} catch (StartFailedException e) {\n\t\t\tthrow new ConnectionEstablishmentFailedException(e);\n\t\t... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 85692970,
"size": 2370,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/ThorbenKuck/NetCom2"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.