id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
128018428_86
{ "fields": [], "file": "sentinel-core/src/test/java/com/alibaba/csp/sentinel/SphUTest.java", "identifier": "SphUTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = ErrorEntryFreeException.class)\n public void testStringEntryNotPairedException() throws BlockException {\n Entry e = SphU.entry(\"resourceName\");\n Entry e1 = SphU.entry(\"resourceName\");\n\n if (e != null) {\n e.exit();\n }\n if (e1 != nu...
{ "fields": [ { "declarator": "OBJECTS0 = new Object[0]", "modifier": "private static final", "original_string": "private static final Object[] OBJECTS0 = new Object[0];", "type": "Object[]", "var_name": "OBJECTS0" } ], "file": "sentinel-core/src/main/java/com/alibaba/csp/sen...
{ "body": "public static Entry entry(String name) throws BlockException {\n return Env.sph.entry(name, EntryType.OUT, 1, OBJECTS0);\n }", "class_method_signature": "SphU.entry(String name)", "constructor": false, "full_signature": "public static Entry entry(String name)", "identifier": "entry", "i...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_155
{ "fields": [], "file": "sentinel-extension/sentinel-datasource-zookeeper/src/test/java/com/alibaba/csp/sentinel/datasource/zookeeper/ZookeeperDataSourceTest.java", "identifier": "ZookeeperDataSourceTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testZooKeeperDataSourceAuthorization() throws Exception {\n TestingServer server = new TestingServer(21812);\n server.start();\n\n final String remoteAddress = server.getConnectString();\n final String groupId = \"sentinel-zk-ds-demo\";\n final Stri...
{ "fields": [ { "declarator": "RETRY_TIMES = 3", "modifier": "private static final", "original_string": "private static final int RETRY_TIMES = 3;", "type": "int", "var_name": "RETRY_TIMES" }, { "declarator": "SLEEP_TIME = 1000", "modifier": "private static final"...
{ "body": "@Override\n public void close() throws Exception {\n if (this.nodeCache != null) {\n this.nodeCache.getListenable().removeListener(listener);\n this.nodeCache.close();\n }\n if (this.zkClient != null) {\n this.zkClient.close();\n }\n po...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_12
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "sentine...
{ "body": "@Test\n public void testSplit() {\n Assert.assertNull(EagleEyeCoreUtils.split(null, 'a'));\n\n Assert.assertArrayEquals(new String[0],\n EagleEyeCoreUtils.split(\"\", ','));\n Assert.assertArrayEquals(new String[]{\"foo\", \"bar\", \"baz\"},\n EagleEyeC...
{ "fields": [ { "declarator": "EMPTY_STRING = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY_STRING = \"\";", "type": "String", "var_name": "EMPTY_STRING" }, { "declarator": "NEWLINE = \"\\r\\n\"", "modifier": "publi...
{ "body": "public static String[] split(String str, char separatorChar) {\n return splitWorker(str, separatorChar, false);\n }", "class_method_signature": "EagleEyeCoreUtils.split(String str, char separatorChar)", "constructor": false, "full_signature": "public static String[] split(String str, char s...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_102
{ "fields": [], "file": "sentinel-core/src/test/java/com/alibaba/csp/sentinel/node/metric/MetricNodeTest.java", "identifier": "MetricNodeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testFromFatString() {\n String line = \"1564382218000|2019-07-29 14:36:58|/foo/*|1|0|1|0|0|0|2|1\";\n MetricNode node = MetricNode.fromFatString(line);\n assertEquals(ResourceTypeConstants.COMMON_WEB, node.getClassification());\n assertEquals(2, node.getCo...
{ "fields": [ { "declarator": "resource", "modifier": "private", "original_string": "private String resource;", "type": "String", "var_name": "resource" }, { "declarator": "classification", "modifier": "private", "original_string": "private int classificatio...
{ "body": "public static MetricNode fromFatString(String line) {\n String[] strs = line.split(\"\\\\|\");\n Long time = Long.parseLong(strs[0]);\n MetricNode node = new MetricNode();\n node.setTimestamp(time);\n node.setResource(strs[2]);\n node.setPassQps(Long.parseLong(strs...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_45
{ "fields": [], "file": "sentinel-core/src/test/java/com/alibaba/csp/sentinel/slots/block/degrade/DegradeRuleManagerTest.java", "identifier": "DegradeRuleManagerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsValidRule() {\n DegradeRule rule1 = new DegradeRule(\"abc\");\n DegradeRule rule2 = new DegradeRule(\"cde\")\n .setCount(100)\n .setGrade(RuleConstant.DEGRADE_GRADE_RT)\n .setTimeWindow(-1);\n DegradeRule rule3 = new Degrade...
{ "fields": [ { "declarator": "circuitBreakers = new HashMap<>()", "modifier": "private static volatile", "original_string": "private static volatile Map<String, List<CircuitBreaker>> circuitBreakers = new HashMap<>();", "type": "Map<String, List<CircuitBreaker>>", "var_name": "circu...
{ "body": "public static boolean isValidRule(DegradeRule rule) {\n boolean baseValid = rule != null && !StringUtil.isBlank(rule.getResource())\n && rule.getCount() >= 0 && rule.getTimeWindow() > 0;\n if (!baseValid) {\n return false;\n }\n if (rule.getMinRequestAmount...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_114
{ "fields": [], "file": "sentinel-transport/sentinel-transport-simple-http/src/test/java/com/alibaba/csp/sentinel/transport/command/http/HttpEventTaskTest.java", "identifier": "HttpEventTaskTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void parseParams() {\n CommandRequest request;\n \n // mixed\n request = new CommandRequest();\n HttpEventTask.parseParams(\"a=1&&b&=3&&c=4&a_+1=3_3%20&%E7%9A%84=test%E7%9A%84#mark\", request);\n assertEquals(4, request.getParameters().size());\n ...
{ "fields": [ { "declarator": "SERVER_ERROR_MESSAGE = \"Command server error\"", "modifier": "public static final", "original_string": "public static final String SERVER_ERROR_MESSAGE = \"Command server error\";", "type": "String", "var_name": "SERVER_ERROR_MESSAGE" }, { ...
{ "body": "protected static void parseParams(String queryString, CommandRequest request) {\n if (queryString == null || queryString.length() < 1) {\n return;\n }\n\n int offset = 0, pos = -1;\n\n // check anchor\n queryString = removeAnchor(queryString);\n\n while ...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_53
{ "fields": [], "file": "sentinel-core/src/test/java/com/alibaba/csp/sentinel/util/SpiLoaderTest.java", "identifier": "SpiLoaderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testLoadFirstInstance() {\n ProcessorSlot processorSlot = SpiLoader.loadFirstInstance(ProcessorSlot.class);\n assertNotNull(processorSlot);\n\n ProcessorSlot processorSlot2 = SpiLoader.loadFirstInstance(ProcessorSlot.class);\n // As SERVICE_LOADER_MAP in S...
{ "fields": [ { "declarator": "SERVICE_LOADER_MAP = new ConcurrentHashMap<String, ServiceLoader>()", "modifier": "private static final", "original_string": "private static final Map<String, ServiceLoader> SERVICE_LOADER_MAP = new ConcurrentHashMap<String, ServiceLoader>();", "type": "Map<S...
{ "body": "public static <T> T loadFirstInstance(Class<T> clazz) {\n AssertUtil.notNull(clazz, \"SPI class cannot be null\");\n try {\n String key = clazz.getName();\n // Not thread-safe, as it's expected to be resolved in a thread-safe context.\n ServiceLoader<T> servic...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_143
{ "fields": [ { "declarator": "paramFlowSlot = new ParamFlowSlot()", "modifier": "private final", "original_string": "private final ParamFlowSlot paramFlowSlot = new ParamFlowSlot();", "type": "ParamFlowSlot", "var_name": "paramFlowSlot" } ], "file": "sentinel-extension/senti...
{ "body": "@Test\n public void testEntryWhenParamFlowRuleNotExists() throws Throwable {\n String resourceName = \"testEntryWhenParamFlowRuleNotExists\";\n ResourceWrapper resourceWrapper = new StringResourceWrapper(resourceName, EntryType.IN);\n paramFlowSlot.entry(null, resourceWrapper, null,...
{ "fields": [], "file": "sentinel-extension/sentinel-parameter-flow-control/src/main/java/com/alibaba/csp/sentinel/slots/block/flow/param/ParamFlowSlot.java", "identifier": "ParamFlowSlot", "interfaces": "", "methods": [ { "class_method_signature": "ParamFlowSlot.entry(Context context, ResourceWrapp...
{ "body": "@Override\n public void entry(Context context, ResourceWrapper resourceWrapper, DefaultNode node, int count,\n boolean prioritized, Object... args) throws Throwable {\n if (!ParamFlowRuleManager.hasRules(resourceWrapper.getName())) {\n fireEntry(context, resourceWr...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_148
{ "fields": [], "file": "sentinel-extension/sentinel-parameter-flow-control/src/test/java/com/alibaba/csp/sentinel/slots/block/flow/param/ParamFlowCheckerTest.java", "identifier": "ParamFlowCheckerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testPassLocalCheckForCollection() throws InterruptedException {\n final String resourceName = \"testPassLocalCheckForCollection\";\n final ResourceWrapper resourceWrapper = new StringResourceWrapper(resourceName, EntryType.IN);\n int paramIdx = 0;\n double...
{ "fields": [], "file": "sentinel-extension/sentinel-parameter-flow-control/src/main/java/com/alibaba/csp/sentinel/slots/block/flow/param/ParamFlowChecker.java", "identifier": "ParamFlowChecker", "interfaces": "", "methods": [ { "class_method_signature": "ParamFlowChecker.passCheck(ResourceWrapper r...
{ "body": "public static boolean passCheck(ResourceWrapper resourceWrapper, /*@Valid*/ ParamFlowRule rule, /*@Valid*/ int count,\n Object... args) {\n if (args == null) {\n return true;\n }\n\n int paramIdx = rule.getParamIdx();\n if (args.length <= p...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_58
{ "fields": [], "file": "sentinel-core/src/test/java/com/alibaba/csp/sentinel/util/StringUtilTest.java", "identifier": "StringUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testCapitalize() {\n Assert.assertNull(StringUtil.capitalize(null));\n Assert.assertEquals(\"Foo\", StringUtil.capitalize(\"foo\"));\n }", "class_method_signature": "StringUtilTest.testCapitalize()", "constructor": false, "full_signature": "@Test public void testCapitalize...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" } ], "file": "sentinel-core/src/main/java/com/alibaba/csp/sentinel/util/StringUtil.java", "i...
{ "body": "public static String capitalize(String str) {\n return changeFirstCharacterCase(str, true);\n }", "class_method_signature": "StringUtil.capitalize(String str)", "constructor": false, "full_signature": "public static String capitalize(String str)", "identifier": "capitalize", "invocation...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_109
{ "fields": [], "file": "sentinel-transport/sentinel-transport-common/src/test/java/com/alibaba/csp/sentinel/transport/config/TransportConfigTest.java", "identifier": "TransportConfigTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetHeartbeatApiPath() {\n // use default heartbeat api path\n assertTrue(StringUtil.isNotEmpty(TransportConfig.getHeartbeatApiPath()));\n assertEquals(TransportConfig.HEARTBEAT_DEFAULT_PATH, TransportConfig.getHeartbeatApiPath());\n\n // config heartbe...
{ "fields": [ { "declarator": "CONSOLE_SERVER = \"csp.sentinel.dashboard.server\"", "modifier": "public static final", "original_string": "public static final String CONSOLE_SERVER = \"csp.sentinel.dashboard.server\";", "type": "String", "var_name": "CONSOLE_SERVER" }, { ...
{ "body": "public static String getHeartbeatApiPath() {\n String apiPath = SentinelConfig.getConfig(HEARTBEAT_API_PATH);\n if (StringUtil.isBlank(apiPath)) {\n return HEARTBEAT_DEFAULT_PATH;\n }\n if (!apiPath.startsWith(\"/\")) {\n apiPath = \"/\" + apiPath;\n ...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_220
{ "fields": [], "file": "sentinel-adapter/sentinel-api-gateway-adapter-common/src/test/java/com/alibaba/csp/sentinel/adapter/gateway/common/rule/GatewayRuleConverterTest.java", "identifier": "GatewayRuleConverterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testConvertAndApplyToParamRule() {\n GatewayFlowRule routeRule1 = new GatewayFlowRule(\"routeId1\")\n .setCount(2)\n .setIntervalSec(2)\n .setBurst(2)\n .setParamItem(new GatewayParamFlowItem()\n .setParseStrategy(Sent...
{ "fields": [], "file": "sentinel-adapter/sentinel-api-gateway-adapter-common/src/main/java/com/alibaba/csp/sentinel/adapter/gateway/common/rule/GatewayRuleConverter.java", "identifier": "GatewayRuleConverter", "interfaces": "", "methods": [ { "class_method_signature": "GatewayRuleConverter.toFlowRu...
{ "body": "static ParamFlowRule applyToParamRule(/*@Valid*/ GatewayFlowRule gatewayRule, int idx) {\n ParamFlowRule paramRule = new ParamFlowRule(gatewayRule.getResource())\n .setCount(gatewayRule.getCount())\n .setGrade(gatewayRule.getGrade())\n .setDurationInSec(gatewayRule.g...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_19
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "sentine...
{ "body": "@Test\n public void testIsHexNumeric() {\n Assert.assertTrue(EagleEyeCoreUtils.isHexNumeric('2'));\n Assert.assertTrue(EagleEyeCoreUtils.isHexNumeric('b'));\n\n Assert.assertFalse(EagleEyeCoreUtils.isHexNumeric('z'));\n Assert.assertFalse(EagleEyeCoreUtils.isHexNumeric('%'));...
{ "fields": [ { "declarator": "EMPTY_STRING = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY_STRING = \"\";", "type": "String", "var_name": "EMPTY_STRING" }, { "declarator": "NEWLINE = \"\\r\\n\"", "modifier": "publi...
{ "body": "public static boolean isHexNumeric(char ch) {\n return (ch >= 'a' && ch <= 'f') || (ch >= '0' && ch <= '9');\n }", "class_method_signature": "EagleEyeCoreUtils.isHexNumeric(char ch)", "constructor": false, "full_signature": "public static boolean isHexNumeric(char ch)", "identifier": "isH...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_125
{ "fields": [], "file": "sentinel-cluster/sentinel-cluster-server-default/src/test/java/com/alibaba/csp/sentinel/cluster/server/connection/ConnectionManagerTest.java", "identifier": "ConnectionManagerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testRemoveConnection() {\n String namespace = \"test-namespace-remove\";\n String address1 = \"12.23.34.45:1997\";\n String address2 = \"12.23.34.46:1998\";\n String address3 = \"12.23.34.47:1999\";\n ConnectionManager.addConnection(namespace, addre...
{ "fields": [ { "declarator": "CONN_MAP = new ConcurrentHashMap<>()", "modifier": "private static final", "original_string": "private static final Map<String, ConnectionGroup> CONN_MAP = new ConcurrentHashMap<>();", "type": "Map<String, ConnectionGroup>", "var_name": "CONN_MAP" }...
{ "body": "public static void removeConnection(String address) {\n AssertUtil.assertNotBlank(address, \"address should not be empty\");\n String namespace = NAMESPACE_MAP.get(address);\n if (namespace != null) {\n ConnectionGroup group = CONN_MAP.get(namespace);\n if (group ...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_62
{ "fields": [], "file": "sentinel-core/src/test/java/com/alibaba/csp/sentinel/util/StringUtilTest.java", "identifier": "StringUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsEmpty() {\n Assert.assertFalse(StringUtil.isEmpty(\"bar\"));\n Assert.assertTrue(StringUtil.isEmpty(\"\"));\n }", "class_method_signature": "StringUtilTest.testIsEmpty()", "constructor": false, "full_signature": "@Test public void testIsEmpty()", "identifier": "tes...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" } ], "file": "sentinel-core/src/main/java/com/alibaba/csp/sentinel/util/StringUtil.java", "i...
{ "body": "public static boolean isEmpty(String str) {\n return str == null || str.length() == 0;\n }", "class_method_signature": "StringUtil.isEmpty(String str)", "constructor": false, "full_signature": "public static boolean isEmpty(String str)", "identifier": "isEmpty", "invocations": [ "le...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_5
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "sentine...
{ "body": "@Test\n public void testCheckNotNullEmptyInputNullThrowsException() {\n thrown.expect(IllegalArgumentException.class);\n EagleEyeCoreUtils.checkNotNullEmpty(null, \"bar\");\n // Method is not expected to return due to exception thrown\n }", "class_method_signature": "EagleEyeCo...
{ "fields": [ { "declarator": "EMPTY_STRING = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY_STRING = \"\";", "type": "String", "var_name": "EMPTY_STRING" }, { "declarator": "NEWLINE = \"\\r\\n\"", "modifier": "publi...
{ "body": "public static String checkNotNullEmpty(String value, String name) throws IllegalArgumentException {\n if (isBlank(value)) {\n throw new IllegalArgumentException(name + \" is null or empty\");\n }\n return value;\n }", "class_method_signature": "EagleEyeCoreUtils.checkNo...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_172
{ "fields": [], "file": "sentinel-adapter/sentinel-apache-dubbo-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/dubbo/DubboUtilsTest.java", "identifier": "DubboUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetInterfaceName() {\n\n URL url = URL.valueOf(\"dubbo://127.0.0.1:2181\")\n .addParameter(CommonConstants.VERSION_KEY, \"1.0.0\")\n .addParameter(CommonConstants.GROUP_KEY, \"grp1\")\n .addParameter(CommonConstants.INTERFACE_KE...
{ "fields": [ { "declarator": "SENTINEL_DUBBO_APPLICATION_KEY = \"dubboApplication\"", "modifier": "public static final", "original_string": "public static final String SENTINEL_DUBBO_APPLICATION_KEY = \"dubboApplication\";", "type": "String", "var_name": "SENTINEL_DUBBO_APPLICATION_...
{ "body": "public static String getInterfaceName(Invoker invoker) {\n return getInterfaceName(invoker, false);\n }", "class_method_signature": "DubboUtils.getInterfaceName(Invoker invoker)", "constructor": false, "full_signature": "public static String getInterfaceName(Invoker invoker)", "identifier...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_35
{ "fields": [], "file": "sentinel-core/src/test/java/com/alibaba/csp/sentinel/slots/block/flow/FlowRuleCheckerTest.java", "identifier": "FlowRuleCheckerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testPassCheckNullLimitApp() {\n FlowRule rule = new FlowRule(\"abc\").setCount(1);\n rule.setLimitApp(null);\n FlowRuleChecker checker = new FlowRuleChecker();\n assertTrue(checker.canPassCheck(rule, null, null, 1));\n }", "class_method_signature": "F...
{ "fields": [], "file": "sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/block/flow/FlowRuleChecker.java", "identifier": "FlowRuleChecker", "interfaces": "", "methods": [ { "class_method_signature": "FlowRuleChecker.checkFlow(Function<String, Collection<FlowRule>> ruleProvider, ResourceWr...
{ "body": "public boolean canPassCheck(/*@NonNull*/ FlowRule rule, Context context, DefaultNode node,\n int acquireCount) {\n return canPassCheck(rule, context, node, acquireCount, false);\n }", "class_method_signature": "FlowRuleChecker.canPassCheck(/*@N...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_23
{ "fields": [], "file": "sentinel-core/src/test/java/com/alibaba/csp/sentinel/slots/statistic/base/LeapArrayTest.java", "identifier": "LeapArrayTest", "interfaces": "", "superclass": "extends AbstractTimeBasedTest" }
{ "body": "@Test\n public void testGetValidHead() {\n int windowLengthInMs = 100;\n int intervalInMs = 1000;\n int sampleCount = intervalInMs / windowLengthInMs;\n LeapArray<AtomicInteger> leapArray = new LeapArray<AtomicInteger>(sampleCount, intervalInMs) {\n @Override\n ...
{ "fields": [ { "declarator": "windowLengthInMs", "modifier": "protected", "original_string": "protected int windowLengthInMs;", "type": "int", "var_name": "windowLengthInMs" }, { "declarator": "sampleCount", "modifier": "protected", "original_string": "prot...
{ "body": "WindowWrap<T> getValidHead(long timeMillis) {\n // Calculate index for expected head time.\n int idx = calculateTimeIdx(timeMillis + windowLengthInMs);\n\n WindowWrap<T> wrap = array.get(idx);\n if (wrap == null || isWindowDeprecated(wrap)) {\n return null;\n }...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_133
{ "fields": [], "file": "sentinel-cluster/sentinel-cluster-server-default/src/test/java/com/alibaba/csp/sentinel/cluster/flow/statistic/metric/ClusterParamMetricTest.java", "identifier": "ClusterParamMetricTest", "interfaces": "", "superclass": "extends AbstractTimeBasedTest" }
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void testIllegalArgument() {\n ClusterParamMetric metric = new ClusterParamMetric(5, 25, 100);\n metric.getTopValues(-1);\n }", "class_method_signature": "ClusterParamMetricTest.testIllegalArgument()", "constructor": false, ...
{ "fields": [ { "declarator": "DEFAULT_CLUSTER_MAX_CAPACITY = 4000", "modifier": "public static final", "original_string": "public static final int DEFAULT_CLUSTER_MAX_CAPACITY = 4000;", "type": "int", "var_name": "DEFAULT_CLUSTER_MAX_CAPACITY" }, { "declarator": "metri...
{ "body": "public Map<Object, Double> getTopValues(int number) {\n AssertUtil.isTrue(number > 0, \"number must be positive\");\n metric.currentWindow();\n List<CacheMap<Object, LongAdder>> buckets = metric.values();\n\n Map<Object, Long> result = new HashMap<>(buckets.size());\n\n f...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_74
{ "fields": [], "file": "sentinel-core/src/test/java/com/alibaba/csp/sentinel/TracerTest.java", "identifier": "TracerTest", "interfaces": "", "superclass": "extends Tracer" }
{ "body": "@Test\n public void setExceptionsToTrace() {\n Tracer.ignoreClasses = null;\n Tracer.traceClasses = null;\n Tracer.setExceptionsToTrace(TraceException.class, TraceException2.class);\n Assert.assertTrue(Tracer.shouldTrace(new TraceException2()));\n Assert.assertTrue(Tra...
{ "fields": [ { "declarator": "traceClasses", "modifier": "protected static", "original_string": "protected static Class<? extends Throwable>[] traceClasses;", "type": "Class<? extends Throwable>[]", "var_name": "traceClasses" }, { "declarator": "ignoreClasses", "...
{ "body": "@SafeVarargs\n public static void setExceptionsToTrace(Class<? extends Throwable>... traceClasses) {\n checkNotNull(traceClasses);\n Tracer.traceClasses = traceClasses;\n }", "class_method_signature": "Tracer.setExceptionsToTrace(Class<? extends Throwable>... traceClasses)", "constr...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_144
{ "fields": [ { "declarator": "paramFlowSlot = new ParamFlowSlot()", "modifier": "private final", "original_string": "private final ParamFlowSlot paramFlowSlot = new ParamFlowSlot();", "type": "ParamFlowSlot", "var_name": "paramFlowSlot" } ], "file": "sentinel-extension/senti...
{ "body": "@Test\n public void testEntryWhenParamFlowExists() throws Throwable {\n String resourceName = \"testEntryWhenParamFlowExists\";\n ResourceWrapper resourceWrapper = new StringResourceWrapper(resourceName, EntryType.IN);\n long argToGo = 1L;\n double count = 1;\n ParamFl...
{ "fields": [], "file": "sentinel-extension/sentinel-parameter-flow-control/src/main/java/com/alibaba/csp/sentinel/slots/block/flow/param/ParamFlowSlot.java", "identifier": "ParamFlowSlot", "interfaces": "", "methods": [ { "class_method_signature": "ParamFlowSlot.entry(Context context, ResourceWrapp...
{ "body": "@Override\n public void entry(Context context, ResourceWrapper resourceWrapper, DefaultNode node, int count,\n boolean prioritized, Object... args) throws Throwable {\n if (!ParamFlowRuleManager.hasRules(resourceWrapper.getName())) {\n fireEntry(context, resourceWr...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_54
{ "fields": [], "file": "sentinel-core/src/test/java/com/alibaba/csp/sentinel/util/SpiLoaderTest.java", "identifier": "SpiLoaderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testLoadHighestPriorityInstance() {\n ProcessorSlot processorSlot = SpiLoader.loadHighestPriorityInstance(ProcessorSlot.class);\n assertNotNull(processorSlot);\n\n // NodeSelectorSlot is highest order with @SpiOrder(-10000), among all slots\n assertTrue(pr...
{ "fields": [ { "declarator": "SERVICE_LOADER_MAP = new ConcurrentHashMap<String, ServiceLoader>()", "modifier": "private static final", "original_string": "private static final Map<String, ServiceLoader> SERVICE_LOADER_MAP = new ConcurrentHashMap<String, ServiceLoader>();", "type": "Map<S...
{ "body": "public static <T> T loadHighestPriorityInstance(Class<T> clazz) {\n try {\n String key = clazz.getName();\n // Not thread-safe, as it's expected to be resolved in a thread-safe context.\n ServiceLoader<T> serviceLoader = SERVICE_LOADER_MAP.get(key);\n if (...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_113
{ "fields": [], "file": "sentinel-transport/sentinel-transport-simple-http/src/test/java/com/alibaba/csp/sentinel/transport/command/http/HttpEventTaskTest.java", "identifier": "HttpEventTaskTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void parseSingleParam() {\n CommandRequest request;\n \n request = new CommandRequest();\n HttpEventTask.parseSingleParam(null, request);\n assertEquals(0, request.getParameters().size());\n \n request = new CommandRequest();\n HttpE...
{ "fields": [ { "declarator": "SERVER_ERROR_MESSAGE = \"Command server error\"", "modifier": "public static final", "original_string": "public static final String SERVER_ERROR_MESSAGE = \"Command server error\";", "type": "String", "var_name": "SERVER_ERROR_MESSAGE" }, { ...
{ "body": "protected static void parseSingleParam(String single, CommandRequest request) {\n if (single == null || single.length() < 3) {\n return;\n }\n\n int index = single.indexOf('=');\n if (index <= 0 || index >= single.length() - 1) {\n // empty key/val or nothi...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_42
{ "fields": [], "file": "sentinel-core/src/test/java/com/alibaba/csp/sentinel/slots/block/flow/controller/RateLimiterControllerTest.java", "identifier": "RateLimiterControllerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testPaceController_normal() throws InterruptedException {\n RateLimiterController paceController = new RateLimiterController(500, 10d);\n Node node = mock(Node.class);\n\n long start = TimeUtil.currentTimeMillis();\n for (int i = 0; i < 6; i++) {\n ...
{ "fields": [ { "declarator": "maxQueueingTimeMs", "modifier": "private final", "original_string": "private final int maxQueueingTimeMs;", "type": "int", "var_name": "maxQueueingTimeMs" }, { "declarator": "count", "modifier": "private final", "original_strin...
{ "body": "@Override\n public boolean canPass(Node node, int acquireCount) {\n return canPass(node, acquireCount, false);\n }", "class_method_signature": "RateLimiterController.canPass(Node node, int acquireCount)", "constructor": false, "full_signature": "@Override public boolean canPass(Node node...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_105
{ "fields": [], "file": "sentinel-transport/sentinel-transport-netty-http/src/test/java/com/alibaba/csp/sentinel/transport/command/netty/HttpServerInitializerTest.java", "identifier": "HttpServerInitializerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testInitChannel() throws Exception {\n // Mock Objects\n HttpServerInitializer httpServerInitializer = mock(HttpServerInitializer.class);\n SocketChannel socketChannel = mock(SocketChannel.class);\n ChannelPipeline channelPipeline = mock(ChannelPipeline.cl...
{ "fields": [], "file": "sentinel-transport/sentinel-transport-netty-http/src/main/java/com/alibaba/csp/sentinel/transport/command/netty/HttpServerInitializer.java", "identifier": "HttpServerInitializer", "interfaces": "", "methods": [ { "class_method_signature": "HttpServerInitializer.initChannel(S...
{ "body": "@Override\n protected void initChannel(SocketChannel socketChannel) throws Exception {\n ChannelPipeline p = socketChannel.pipeline();\n\n p.addLast(new HttpRequestDecoder());\n p.addLast(new HttpObjectAggregator(1024 * 1024));\n p.addLast(new HttpResponseEncoder());\n\n ...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_15
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "sentine...
{ "body": "@Test\n public void testAppendLog() {\n Assert.assertEquals(\"foo bar baz foo\", EagleEyeCoreUtils.appendLog(\n \"foo\\nbar\\rbaz,foo\", new StringBuilder(), ',').toString());\n Assert.assertEquals(\"\", EagleEyeCoreUtils.appendLog(\n null, new StringBuilder()...
{ "fields": [ { "declarator": "EMPTY_STRING = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY_STRING = \"\";", "type": "String", "var_name": "EMPTY_STRING" }, { "declarator": "NEWLINE = \"\\r\\n\"", "modifier": "publi...
{ "body": "public static StringBuilder appendLog(String str, StringBuilder appender, char delimiter) {\n if (str != null) {\n int len = str.length();\n appender.ensureCapacity(appender.length() + len);\n for (int i = 0; i < len; i++) {\n char c = str.charAt(i);\n...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_152
{ "fields": [], "file": "sentinel-extension/sentinel-parameter-flow-control/src/test/java/com/alibaba/csp/sentinel/slots/block/flow/param/ParamFlowRuleUtilTest.java", "identifier": "ParamFlowRuleUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testParseHotParamExceptionItemsFailure() {\n String valueB = \"Sentinel\";\n Integer valueC = 6;\n char valueD = 6;\n float valueE = 11.11f;\n // Null object will not be parsed.\n ParamFlowItem itemA = new ParamFlowItem(null, 1, double.class....
{ "fields": [ { "declarator": "EXTRACT_RESOURCE = new Function<ParamFlowRule, String>() {\n @Override\n public String apply(ParamFlowRule rule) {\n return rule.getResource();\n }\n }", "modifier": "private static final", "original_string": "private static final...
{ "body": "static Map<Object, Integer> parseHotItems(List<ParamFlowItem> items) {\n if (items == null || items.isEmpty()) {\n return new HashMap<>();\n }\n Map<Object, Integer> itemMap = new HashMap<>(items.size());\n for (ParamFlowItem item : items) {\n // Value shou...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_81
{ "fields": [ { "declarator": "ctSph = new CtSph()", "modifier": "private final", "original_string": "private final CtSph ctSph = new CtSph();", "type": "CtSph", "var_name": "ctSph" } ], "file": "sentinel-core/src/test/java/com/alibaba/csp/sentinel/CtSphTest.java", "identif...
{ "body": "@Test\n public void testAsyncEntryNormalPass() {\n String resourceName = \"testAsyncEntryNormalPass\";\n ResourceWrapper resourceWrapper = new StringResourceWrapper(resourceName, EntryType.IN);\n AsyncEntry entry = null;\n\n // Prepare a slot that \"should pass\".\n Sh...
{ "fields": [ { "declarator": "OBJECTS0 = new Object[0]", "modifier": "private static final", "original_string": "private static final Object[] OBJECTS0 = new Object[0];", "type": "Object[]", "var_name": "OBJECTS0" }, { "declarator": "chainMap\n = new HashMap<Res...
{ "body": "@Override\n public AsyncEntry asyncEntry(String name, EntryType type, int count, Object... args) throws BlockException {\n StringResourceWrapper resource = new StringResourceWrapper(name, type);\n return asyncEntryInternal(resource, count, args);\n }", "class_method_signature": "CtSph...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_9
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "sentine...
{ "body": "@Test\n public void testIsNotBlank() {\n Assert.assertFalse(EagleEyeCoreUtils.isNotBlank(\"\"));\n Assert.assertFalse(EagleEyeCoreUtils.isNotBlank(\" \"));\n Assert.assertFalse(EagleEyeCoreUtils.isNotBlank(null));\n\n Assert.assertTrue(EagleEyeCoreUtils.isNotBlank(\"foo\"));\...
{ "fields": [ { "declarator": "EMPTY_STRING = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY_STRING = \"\";", "type": "String", "var_name": "EMPTY_STRING" }, { "declarator": "NEWLINE = \"\\r\\n\"", "modifier": "publi...
{ "body": "public static boolean isNotBlank(String str) {\n return !isBlank(str);\n }", "class_method_signature": "EagleEyeCoreUtils.isNotBlank(String str)", "constructor": false, "full_signature": "public static boolean isNotBlank(String str)", "identifier": "isNotBlank", "invocations": [ "is...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_200
{ "fields": [], "file": "sentinel-adapter/sentinel-sofa-rpc-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/sofa/rpc/AbstractSofaRpcFilterTest.java", "identifier": "AbstractSofaRpcFilterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNeedToLoadProviderAndConsumer() {\n SentinelSofaRpcProviderFilter providerFilter = new SentinelSofaRpcProviderFilter();\n ProviderConfig providerConfig = new ProviderConfig();\n providerConfig.setInterfaceId(Serializer.class.getName());\n providerConfi...
{ "fields": [], "file": "sentinel-adapter/sentinel-sofa-rpc-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/sofa/rpc/AbstractSofaRpcFilter.java", "identifier": "AbstractSofaRpcFilter", "interfaces": "", "methods": [ { "class_method_signature": "AbstractSofaRpcFilter.needToLoad(FilterInvoker i...
{ "body": "@Override\n public boolean needToLoad(FilterInvoker invoker) {\n AbstractInterfaceConfig<?, ?> config = invoker.getConfig();\n\n String enabled = config.getParameter(SentinelConstants.SOFA_RPC_SENTINEL_ENABLED);\n if (StringUtils.isNotBlank(enabled)) {\n return Boolean.pa...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_129
{ "fields": [], "file": "sentinel-cluster/sentinel-cluster-server-default/src/test/java/com/alibaba/csp/sentinel/cluster/flow/ConcurrentClusterFlowCheckerTest.java", "identifier": "ConcurrentClusterFlowCheckerTest", "interfaces": "", "superclass": "extends AbstractTimeBasedTest" }
{ "body": "@Test\n public void testReleaseExpiredToken() throws InterruptedException {\n ConnectionManager.addConnection(\"test\", \"127.0.0.1\");\n FlowRule rule = ClusterFlowRuleManager.getFlowRuleById(111L);\n for (int i = 0; i < 10; i++) {\n ConcurrentClusterFlowChecker.acquireC...
{ "fields": [], "file": "sentinel-cluster/sentinel-cluster-server-default/src/main/java/com/alibaba/csp/sentinel/cluster/flow/ConcurrentClusterFlowChecker.java", "identifier": "ConcurrentClusterFlowChecker", "interfaces": "", "methods": [ { "class_method_signature": "ConcurrentClusterFlowChecker.cal...
{ "body": "public static TokenResult acquireConcurrentToken(/*@Valid*/ String clientAddress, FlowRule rule, int acquireCount) {\n long flowId = rule.getClusterConfig().getFlowId();\n AtomicInteger nowCalls = CurrentConcurrencyManager.get(flowId);\n if (nowCalls == null) {\n RecordLog.w...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_39
{ "fields": [], "file": "sentinel-core/src/test/java/com/alibaba/csp/sentinel/slots/block/flow/controller/WarmUpControllerTest.java", "identifier": "WarmUpControllerTest", "interfaces": "", "superclass": "extends AbstractTimeBasedTest" }
{ "body": "@Test\n public void testWarmUp() throws InterruptedException {\n WarmUpController warmupController = new WarmUpController(10, 10, 3);\n \n setCurrentMillis(System.currentTimeMillis());\n\n Node node = mock(Node.class);\n\n when(node.passQps()).thenReturn(8d);\n ...
{ "fields": [ { "declarator": "count", "modifier": "protected", "original_string": "protected double count;", "type": "double", "var_name": "count" }, { "declarator": "coldFactor", "modifier": "private", "original_string": "private int coldFactor;", "t...
{ "body": "@Override\n public boolean canPass(Node node, int acquireCount) {\n return canPass(node, acquireCount, false);\n }", "class_method_signature": "WarmUpController.canPass(Node node, int acquireCount)", "constructor": false, "full_signature": "@Override public boolean canPass(Node node, int...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_191
{ "fields": [ { "declarator": "filter = new AbstractDubboFilter() {\n @Override\n public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {\n return null;\n }\n }", "modifier": "private", "original_string": "private AbstractDubboFilt...
{ "body": "@Test\n public void testGetResourceNameWithPrefix() {\n Invoker invoker = mock(Invoker.class);\n when(invoker.getInterface()).thenReturn(DemoService.class);\n\n Invocation invocation = mock(Invocation.class);\n Method method = DemoService.class.getMethods()[0];\n when(...
{ "fields": [], "file": "sentinel-adapter/sentinel-dubbo-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/AbstractDubboFilter.java", "identifier": "AbstractDubboFilter", "interfaces": "implements Filter", "methods": [ { "class_method_signature": "AbstractDubboFilter.getMethodResourceName...
{ "body": "protected String getMethodResourceName(Invoker<?> invoker, Invocation invocation) {\n StringBuilder buf = new StringBuilder(64);\n buf.append(invoker.getInterface().getName())\n .append(\":\")\n .append(invocation.getMethodName())\n .append(\"(\");\n bo...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_168
{ "fields": [], "file": "sentinel-adapter/sentinel-apache-dubbo-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/dubbo/DubboUtilsTest.java", "identifier": "DubboUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void testGetApplicationNoAttachments() {\n Invocation invocation = mock(Invocation.class);\n when(invocation.getAttachments()).thenReturn(null);\n when(invocation.getAttachment(DubboUtils.SENTINEL_DUBBO_APPLICATION_KEY, \"\")...
{ "fields": [ { "declarator": "SENTINEL_DUBBO_APPLICATION_KEY = \"dubboApplication\"", "modifier": "public static final", "original_string": "public static final String SENTINEL_DUBBO_APPLICATION_KEY = \"dubboApplication\";", "type": "String", "var_name": "SENTINEL_DUBBO_APPLICATION_...
{ "body": "public static String getApplication(Invocation invocation, String defaultValue) {\n if (invocation == null || invocation.getAttachments() == null) {\n throw new IllegalArgumentException(\"Bad invocation instance\");\n }\n return invocation.getAttachment(SENTINEL_DUBBO_APPLIC...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_187
{ "fields": [ { "declarator": "filter = new DubboAppContextFilter()", "modifier": "private", "original_string": "private DubboAppContextFilter filter = new DubboAppContextFilter();", "type": "DubboAppContextFilter", "var_name": "filter" } ], "file": "sentinel-adapter/sentinel...
{ "body": "@Test\n public void testInvokeApplicationKey() {\n Invoker invoker = mock(Invoker.class);\n Invocation invocation = mock(Invocation.class);\n URL url = URL.valueOf(\"test://test:111/test?application=serviceA\");\n when(invoker.getUrl()).thenReturn(url);\n\n filter.invo...
{ "fields": [], "file": "sentinel-adapter/sentinel-dubbo-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/DubboAppContextFilter.java", "identifier": "DubboAppContextFilter", "interfaces": "implements Filter", "methods": [ { "class_method_signature": "DubboAppContextFilter.invoke(Invoker<...
{ "body": "@Override\n public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {\n String application = invoker.getUrl().getParameter(Constants.APPLICATION_KEY);\n if (application != null) {\n RpcContext.getContext().setAttachment(DubboUtils.DUBBO_APPLICATION_KE...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_78
{ "fields": [], "file": "sentinel-core/src/test/java/com/alibaba/csp/sentinel/TracerTest.java", "identifier": "TracerTest", "interfaces": "", "superclass": "extends Tracer" }
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void testNull1() {\n Tracer.setExceptionsToTrace(TraceException.class, null);\n }", "class_method_signature": "TracerTest.testNull1()", "constructor": false, "full_signature": "@Test(expected = IllegalArgumentException.class) publ...
{ "fields": [ { "declarator": "traceClasses", "modifier": "protected static", "original_string": "protected static Class<? extends Throwable>[] traceClasses;", "type": "Class<? extends Throwable>[]", "var_name": "traceClasses" }, { "declarator": "ignoreClasses", "...
{ "body": "@SafeVarargs\n public static void setExceptionsToTrace(Class<? extends Throwable>... traceClasses) {\n checkNotNull(traceClasses);\n Tracer.traceClasses = traceClasses;\n }", "class_method_signature": "Tracer.setExceptionsToTrace(Class<? extends Throwable>... traceClasses)", "constr...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_216
{ "fields": [], "file": "sentinel-adapter/sentinel-apache-httpclient-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/apache/httpclient/config/SentinelApacheHttpClientConfigTest.java", "identifier": "SentinelApacheHttpClientConfigTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void testConfigSetCleaner() {\n SentinelApacheHttpClientConfig config = new SentinelApacheHttpClientConfig();\n config.setExtractor(null);\n }", "class_method_signature": "SentinelApacheHttpClientConfigTest.testConfigSetCleaner...
{ "fields": [ { "declarator": "prefix = \"httpclient:\"", "modifier": "private", "original_string": "private String prefix = \"httpclient:\";", "type": "String", "var_name": "prefix" }, { "declarator": "extractor = new DefaultApacheHttpClientResourceExtractor()", ...
{ "body": "public void setExtractor(ApacheHttpClientResourceExtractor extractor) {\n AssertUtil.notNull(extractor, \"extractor cannot be null\");\n this.extractor = extractor;\n }", "class_method_signature": "SentinelApacheHttpClientConfig.setExtractor(ApacheHttpClientResourceExtractor extractor)",...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_97
{ "fields": [], "file": "sentinel-core/src/test/java/com/alibaba/csp/sentinel/metric/extension/callback/MetricEntryCallbackTest.java", "identifier": "MetricEntryCallbackTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void onPass() throws Exception {\n FakeMetricExtension extension = new FakeMetricExtension();\n FakeAdvancedMetricExtension advancedExtension = new FakeAdvancedMetricExtension();\n MetricExtensionProvider.addMetricExtension(extension);\n MetricExtensionProvider...
{ "fields": [], "file": "sentinel-core/src/main/java/com/alibaba/csp/sentinel/metric/extension/callback/MetricEntryCallback.java", "identifier": "MetricEntryCallback", "interfaces": "implements ProcessorSlotEntryCallback<DefaultNode>", "methods": [ { "class_method_signature": "MetricEntryCallback.on...
{ "body": "@Override\n public void onPass(Context context, ResourceWrapper rw, DefaultNode param, int count, Object... args)\n throws Exception {\n for (MetricExtension m : MetricExtensionProvider.getMetricExtensions()) {\n if (m instanceof AdvancedMetricExtension) {\n ((Adv...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_79
{ "fields": [], "file": "sentinel-core/src/test/java/com/alibaba/csp/sentinel/TracerTest.java", "identifier": "TracerTest", "interfaces": "", "superclass": "extends Tracer" }
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void testNull2() {\n Tracer.setExceptionsToIgnore(IgnoreException.class, null);\n }", "class_method_signature": "TracerTest.testNull2()", "constructor": false, "full_signature": "@Test(expected = IllegalArgumentException.class) pu...
{ "fields": [ { "declarator": "traceClasses", "modifier": "protected static", "original_string": "protected static Class<? extends Throwable>[] traceClasses;", "type": "Class<? extends Throwable>[]", "var_name": "traceClasses" }, { "declarator": "ignoreClasses", "...
{ "body": "@SafeVarargs\n public static void setExceptionsToIgnore(Class<? extends Throwable>... ignoreClasses) {\n checkNotNull(ignoreClasses);\n Tracer.ignoreClasses = ignoreClasses;\n }", "class_method_signature": "Tracer.setExceptionsToIgnore(Class<? extends Throwable>... ignoreClasses)", ...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_217
{ "fields": [], "file": "sentinel-adapter/sentinel-apache-httpclient-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/apache/httpclient/config/SentinelApacheHttpClientConfigTest.java", "identifier": "SentinelApacheHttpClientConfigTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void testConfigSetFallback() {\n SentinelApacheHttpClientConfig config = new SentinelApacheHttpClientConfig();\n config.setFallback(null);\n }", "class_method_signature": "SentinelApacheHttpClientConfigTest.testConfigSetFallbac...
{ "fields": [ { "declarator": "prefix = \"httpclient:\"", "modifier": "private", "original_string": "private String prefix = \"httpclient:\";", "type": "String", "var_name": "prefix" }, { "declarator": "extractor = new DefaultApacheHttpClientResourceExtractor()", ...
{ "body": "public void setFallback(ApacheHttpClientFallback fallback) {\n AssertUtil.notNull(fallback, \"fallback cannot be null\");\n this.fallback = fallback;\n }", "class_method_signature": "SentinelApacheHttpClientConfig.setFallback(ApacheHttpClientFallback fallback)", "constructor": false, ...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_96
{ "fields": [], "file": "sentinel-core/src/test/java/com/alibaba/csp/sentinel/metric/extension/callback/MetricExitCallbackTest.java", "identifier": "MetricExitCallbackTest", "interfaces": "", "superclass": "extends AbstractTimeBasedTest" }
{ "body": "@Test\n public void advancedExtensionOnExit() {\n FakeAdvancedMetricExtension extension = new FakeAdvancedMetricExtension();\n MetricExtensionProvider.addMetricExtension(extension);\n\n MetricExitCallback exitCallback = new MetricExitCallback();\n StringResourceWrapper resour...
{ "fields": [], "file": "sentinel-core/src/main/java/com/alibaba/csp/sentinel/metric/extension/callback/MetricExitCallback.java", "identifier": "MetricExitCallback", "interfaces": "implements ProcessorSlotExitCallback", "methods": [ { "class_method_signature": "MetricExitCallback.onExit(Context cont...
{ "body": "@Override\n public void onExit(Context context, ResourceWrapper rw, int acquireCount, Object... args) {\n Entry curEntry = context.getCurEntry();\n if (curEntry == null) {\n return;\n }\n for (MetricExtension m : MetricExtensionProvider.getMetricExtensions()) {\n ...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_169
{ "fields": [], "file": "sentinel-adapter/sentinel-apache-dubbo-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/dubbo/DubboUtilsTest.java", "identifier": "DubboUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetResourceName() throws NoSuchMethodException {\n Invoker invoker = mock(Invoker.class);\n when(invoker.getInterface()).thenReturn(DemoService.class);\n\n Invocation invocation = mock(Invocation.class);\n Method method = DemoService.class.getDeclaredM...
{ "fields": [ { "declarator": "SENTINEL_DUBBO_APPLICATION_KEY = \"dubboApplication\"", "modifier": "public static final", "original_string": "public static final String SENTINEL_DUBBO_APPLICATION_KEY = \"dubboApplication\";", "type": "String", "var_name": "SENTINEL_DUBBO_APPLICATION_...
{ "body": "public static String getMethodResourceName(Invoker<?> invoker, Invocation invocation){\n return getMethodResourceName(invoker, invocation, false);\n }", "class_method_signature": "DubboUtils.getMethodResourceName(Invoker<?> invoker, Invocation invocation)", "constructor": false, "full_signa...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_186
{ "fields": [ { "declarator": "filter = new SentinelDubboConsumerFilter()", "modifier": "private", "original_string": "private SentinelDubboConsumerFilter filter = new SentinelDubboConsumerFilter();", "type": "SentinelDubboConsumerFilter", "var_name": "filter" } ], "file": "s...
{ "body": "@Test\n public void testInvoke() {\n final Invoker invoker = mock(Invoker.class);\n when(invoker.getInterface()).thenReturn(DemoService.class);\n\n final Invocation invocation = mock(Invocation.class);\n Method method = DemoService.class.getMethods()[0];\n when(invocat...
{ "fields": [], "file": "sentinel-adapter/sentinel-dubbo-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboConsumerFilter.java", "identifier": "SentinelDubboConsumerFilter", "interfaces": "implements Filter", "methods": [ { "class_method_signature": "SentinelDubboConsumerFilt...
{ "body": "@Override\n public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {\n Entry interfaceEntry = null;\n Entry methodEntry = null;\n try {\n String prefix = DubboAdapterGlobalConfig.getDubboConsumerPrefix();\n String interfaceResourceN...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_190
{ "fields": [ { "declarator": "filter = new AbstractDubboFilter() {\n @Override\n public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {\n return null;\n }\n }", "modifier": "private", "original_string": "private AbstractDubboFilt...
{ "body": "@Test\n public void testGetResourceName() {\n Invoker invoker = mock(Invoker.class);\n when(invoker.getInterface()).thenReturn(DemoService.class);\n\n Invocation invocation = mock(Invocation.class);\n Method method = DemoService.class.getMethods()[0];\n when(invocation...
{ "fields": [], "file": "sentinel-adapter/sentinel-dubbo-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/AbstractDubboFilter.java", "identifier": "AbstractDubboFilter", "interfaces": "implements Filter", "methods": [ { "class_method_signature": "AbstractDubboFilter.getMethodResourceName...
{ "body": "protected String getMethodResourceName(Invoker<?> invoker, Invocation invocation) {\n StringBuilder buf = new StringBuilder(64);\n buf.append(invoker.getInterface().getName())\n .append(\":\")\n .append(invocation.getMethodName())\n .append(\"(\");\n bo...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_38
{ "fields": [], "file": "sentinel-core/src/test/java/com/alibaba/csp/sentinel/slots/block/flow/controller/WarmUpRateLimiterControllerTest.java", "identifier": "WarmUpRateLimiterControllerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testPaceCanNotPass() throws InterruptedException {\n WarmUpRateLimiterController controller = new WarmUpRateLimiterController(10, 10, 10, 3);\n\n Node node = mock(Node.class);\n\n when(node.passQps()).thenReturn(100d);\n when(node.previousPassQps()).thenRe...
{ "fields": [ { "declarator": "timeoutInMs", "modifier": "private final", "original_string": "private final int timeoutInMs;", "type": "int", "var_name": "timeoutInMs" }, { "declarator": "latestPassedTime = new AtomicLong(-1)", "modifier": "private final", "...
{ "body": "@Override\n public boolean canPass(Node node, int acquireCount) {\n return canPass(node, acquireCount, false);\n }", "class_method_signature": "WarmUpRateLimiterController.canPass(Node node, int acquireCount)", "constructor": false, "full_signature": "@Override public boolean canPass(Nod...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_128
{ "fields": [], "file": "sentinel-cluster/sentinel-cluster-server-default/src/test/java/com/alibaba/csp/sentinel/cluster/server/config/ClusterServerConfigManagerTest.java", "identifier": "ClusterServerConfigManagerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsValidFlowConfig() {\n ServerFlowConfig badConfig1 = new ServerFlowConfig().setMaxAllowedQps(-2);\n ServerFlowConfig badConfig2 = new ServerFlowConfig().setIntervalMs(1000).setSampleCount(3);\n ServerFlowConfig badConfig3 = new ServerFlowConfig().setInterval...
{ "fields": [ { "declarator": "embedded = false", "modifier": "private static", "original_string": "private static boolean embedded = false;", "type": "boolean", "var_name": "embedded" }, { "declarator": "port = ClusterConstants.DEFAULT_CLUSTER_SERVER_PORT", "modi...
{ "body": "public static boolean isValidFlowConfig(ServerFlowConfig config) {\n return config != null && config.getMaxOccupyRatio() >= 0 && config.getExceedCount() >= 0\n && config.getMaxAllowedQps() >= 0\n && FlowRuleUtil.isWindowConfigValid(config.getSampleCount(), config.getIntervalMs(...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_80
{ "fields": [], "file": "sentinel-core/src/test/java/com/alibaba/csp/sentinel/TracerTest.java", "identifier": "TracerTest", "interfaces": "", "superclass": "extends Tracer" }
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void testNull3() {\n Tracer.setExceptionPredicate(null);\n }", "class_method_signature": "TracerTest.testNull3()", "constructor": false, "full_signature": "@Test(expected = IllegalArgumentException.class) public void testNull3()",...
{ "fields": [ { "declarator": "traceClasses", "modifier": "protected static", "original_string": "protected static Class<? extends Throwable>[] traceClasses;", "type": "Class<? extends Throwable>[]", "var_name": "traceClasses" }, { "declarator": "ignoreClasses", "...
{ "body": "public static void setExceptionPredicate(Predicate<Throwable> exceptionPredicate) {\n AssertUtil.notNull(exceptionPredicate, \"exception predicate must not be null\");\n Tracer.exceptionPredicate = exceptionPredicate;\n }", "class_method_signature": "Tracer.setExceptionPredicate(Predicat...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_8
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "sentine...
{ "body": "@Test\n public void testDefaultIfNull() {\n Assert.assertEquals(\"\", EagleEyeCoreUtils.defaultIfNull(\"\", \"bar\"));\n Assert.assertEquals(\" \", EagleEyeCoreUtils.defaultIfNull(\" \", \"bar\"));\n Assert.assertEquals(\"bar\",\n EagleEyeCoreUtils.defaultIfNull(null,...
{ "fields": [ { "declarator": "EMPTY_STRING = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY_STRING = \"\";", "type": "String", "var_name": "EMPTY_STRING" }, { "declarator": "NEWLINE = \"\\r\\n\"", "modifier": "publi...
{ "body": "public static <T> T defaultIfNull(T value, T defaultValue) {\n return (value == null) ? defaultValue : value;\n }", "class_method_signature": "EagleEyeCoreUtils.defaultIfNull(T value, T defaultValue)", "constructor": false, "full_signature": "public static T defaultIfNull(T value, T default...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_201
{ "fields": [], "file": "sentinel-adapter/sentinel-sofa-rpc-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/sofa/rpc/SentinelSofaRpcProviderFilterTest.java", "identifier": "SentinelSofaRpcProviderFilterTest", "interfaces": "", "superclass": "extends BaseTest" }
{ "body": "@Test\n public void testInvokeSentinelWorks() {\n SentinelSofaRpcProviderFilter filter = new SentinelSofaRpcProviderFilter();\n\n final String applicationName = \"demo-provider\";\n final String interfaceResourceName = \"com.alibaba.csp.sentinel.adapter.sofa.rpc.service.DemoService\...
{ "fields": [], "file": "sentinel-adapter/sentinel-sofa-rpc-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/sofa/rpc/SentinelSofaRpcProviderFilter.java", "identifier": "SentinelSofaRpcProviderFilter", "interfaces": "", "methods": [ { "class_method_signature": "SentinelSofaRpcProviderFilter.in...
{ "body": "@Override\n public SofaResponse invoke(FilterInvoker invoker, SofaRequest request) throws SofaRpcException {\n // Now only support sync invoke.\n if (request.getInvokeType() != null && !RpcConstants.INVOKER_TYPE_SYNC.equals(request.getInvokeType())) {\n return invoker.invoke(req...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_153
{ "fields": [], "file": "sentinel-extension/sentinel-parameter-flow-control/src/test/java/com/alibaba/csp/sentinel/slots/block/flow/param/ParamFlowRuleUtilTest.java", "identifier": "ParamFlowRuleUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testParseHotParamExceptionItemsSuccess() {\n // Test for empty list.\n assertEquals(0, ParamFlowRuleUtil.parseHotItems(null).size());\n assertEquals(0, ParamFlowRuleUtil.parseHotItems(new ArrayList<ParamFlowItem>()).size());\n\n // Test for boxing objects ...
{ "fields": [ { "declarator": "EXTRACT_RESOURCE = new Function<ParamFlowRule, String>() {\n @Override\n public String apply(ParamFlowRule rule) {\n return rule.getResource();\n }\n }", "modifier": "private static final", "original_string": "private static final...
{ "body": "static Map<Object, Integer> parseHotItems(List<ParamFlowItem> items) {\n if (items == null || items.isEmpty()) {\n return new HashMap<>();\n }\n Map<Object, Integer> itemMap = new HashMap<>(items.size());\n for (ParamFlowItem item : items) {\n // Value shou...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_14
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "sentine...
{ "body": "@Test\n public void testAppendWithNullCheck() {\n Assert.assertEquals(\"bar\", EagleEyeCoreUtils.appendWithNullCheck(\n null, \"bar\", new StringBuilder()).toString());\n Assert.assertEquals(\"foo\", EagleEyeCoreUtils.appendWithNullCheck(\n \"foo\", \"bar\", n...
{ "fields": [ { "declarator": "EMPTY_STRING = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY_STRING = \"\";", "type": "String", "var_name": "EMPTY_STRING" }, { "declarator": "NEWLINE = \"\\r\\n\"", "modifier": "publi...
{ "body": "public static StringBuilder appendWithNullCheck(Object obj, String defaultValue, StringBuilder appender) {\n if (obj != null) {\n appender.append(obj.toString());\n } else {\n appender.append(defaultValue);\n }\n return appender;\n }", "class_method_si...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_104
{ "fields": [ { "declarator": "httpServer", "modifier": "private static", "original_string": "private static HttpServer httpServer;", "type": "HttpServer", "var_name": "httpServer" } ], "file": "sentinel-transport/sentinel-transport-netty-http/src/test/java/com/alibaba/csp/se...
{ "body": "@Test\n public void testRegisterCommands() {\n Map<String, CommandHandler> handlerMap = null;\n\n // If handlerMap is null, no handler added in handlerMap\n httpServer.registerCommands(handlerMap);\n assertEquals(0, HttpServer.handlerMap.size());\n\n // Add handler fro...
{ "fields": [ { "declarator": "DEFAULT_PORT = 8719", "modifier": "private static final", "original_string": "private static final int DEFAULT_PORT = 8719;", "type": "int", "var_name": "DEFAULT_PORT" }, { "declarator": "channel", "modifier": "private", "origi...
{ "body": "public void registerCommands(Map<String, CommandHandler> handlerMap) {\n if (handlerMap != null) {\n for (Entry<String, CommandHandler> e : handlerMap.entrySet()) {\n registerCommand(e.getKey(), e.getValue());\n }\n }\n }", "class_method_signature": "...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_43
{ "fields": [], "file": "sentinel-core/src/test/java/com/alibaba/csp/sentinel/slots/block/flow/controller/RateLimiterControllerTest.java", "identifier": "RateLimiterControllerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testPaceController_timeout() throws InterruptedException {\n final RateLimiterController paceController = new RateLimiterController(500, 10d);\n final Node node = mock(Node.class);\n\n final AtomicInteger passcount = new AtomicInteger();\n final AtomicInte...
{ "fields": [ { "declarator": "maxQueueingTimeMs", "modifier": "private final", "original_string": "private final int maxQueueingTimeMs;", "type": "int", "var_name": "maxQueueingTimeMs" }, { "declarator": "count", "modifier": "private final", "original_strin...
{ "body": "@Override\n public boolean canPass(Node node, int acquireCount) {\n return canPass(node, acquireCount, false);\n }", "class_method_signature": "RateLimiterController.canPass(Node node, int acquireCount)", "constructor": false, "full_signature": "@Override public boolean canPass(Node node...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_112
{ "fields": [], "file": "sentinel-transport/sentinel-transport-simple-http/src/test/java/com/alibaba/csp/sentinel/transport/command/http/HttpEventTaskTest.java", "identifier": "HttpEventTaskTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void removeAnchor() {\n assertNull(HttpEventTask.removeAnchor(null));\n assertEquals(\"\", HttpEventTask.removeAnchor(\"\"));\n assertEquals(\"\", HttpEventTask.removeAnchor(\"#mark\"));\n assertEquals(\"a\", HttpEventTask.removeAnchor(\"a#mark\"));\n }", ...
{ "fields": [ { "declarator": "SERVER_ERROR_MESSAGE = \"Command server error\"", "modifier": "public static final", "original_string": "public static final String SERVER_ERROR_MESSAGE = \"Command server error\";", "type": "String", "var_name": "SERVER_ERROR_MESSAGE" }, { ...
{ "body": "protected static String removeAnchor(String str) {\n if (str == null || str.length() == 0) {\n return str;\n }\n\n int anchor = str.indexOf('#');\n\n if (anchor == 0) {\n return \"\";\n } else if (anchor > 0) {\n return str.substring(0, an...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_55
{ "fields": [], "file": "sentinel-core/src/test/java/com/alibaba/csp/sentinel/util/SpiLoaderTest.java", "identifier": "SpiLoaderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testLoadInstanceList() {\n List<ProcessorSlot> slots = SpiLoader.loadInstanceList(ProcessorSlot.class);\n assertNotNull(slots);\n\n // Total 8 default slot in sentinel-core\n assertEquals(8, slots.size());\n\n // Get the first slot of slots\n ...
{ "fields": [ { "declarator": "SERVICE_LOADER_MAP = new ConcurrentHashMap<String, ServiceLoader>()", "modifier": "private static final", "original_string": "private static final Map<String, ServiceLoader> SERVICE_LOADER_MAP = new ConcurrentHashMap<String, ServiceLoader>();", "type": "Map<S...
{ "body": "public static <T> List<T> loadInstanceList(Class<T> clazz) {\n try {\n String key = clazz.getName();\n // Not thread-safe, as it's expected to be resolved in a thread-safe context.\n ServiceLoader<T> serviceLoader = SERVICE_LOADER_MAP.get(key);\n if (servi...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_145
{ "fields": [], "file": "sentinel-extension/sentinel-parameter-flow-control/src/test/java/com/alibaba/csp/sentinel/slots/block/flow/param/ParamFlowCheckerTest.java", "identifier": "ParamFlowCheckerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testHotParamCheckerPassCheckExceedArgs() {\n final String resourceName = \"testHotParamCheckerPassCheckExceedArgs\";\n final ResourceWrapper resourceWrapper = new StringResourceWrapper(resourceName, EntryType.IN);\n int paramIdx = 1;\n\n ParamFlowRule rule...
{ "fields": [], "file": "sentinel-extension/sentinel-parameter-flow-control/src/main/java/com/alibaba/csp/sentinel/slots/block/flow/param/ParamFlowChecker.java", "identifier": "ParamFlowChecker", "interfaces": "", "methods": [ { "class_method_signature": "ParamFlowChecker.passCheck(ResourceWrapper r...
{ "body": "public static boolean passCheck(ResourceWrapper resourceWrapper, /*@Valid*/ ParamFlowRule rule, /*@Valid*/ int count,\n Object... args) {\n if (args == null) {\n return true;\n }\n\n int paramIdx = rule.getParamIdx();\n if (args.length <= p...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_75
{ "fields": [], "file": "sentinel-core/src/test/java/com/alibaba/csp/sentinel/TracerTest.java", "identifier": "TracerTest", "interfaces": "", "superclass": "extends Tracer" }
{ "body": "@Test\n public void setExceptionPredicate() {\n\n Predicate<Throwable> throwablePredicate = new Predicate<Throwable>() {\n @Override\n public boolean test(Throwable throwable) {\n if (throwable instanceof TraceException) {\n return true;\n ...
{ "fields": [ { "declarator": "traceClasses", "modifier": "protected static", "original_string": "protected static Class<? extends Throwable>[] traceClasses;", "type": "Class<? extends Throwable>[]", "var_name": "traceClasses" }, { "declarator": "ignoreClasses", "...
{ "body": "public static void setExceptionPredicate(Predicate<Throwable> exceptionPredicate) {\n AssertUtil.notNull(exceptionPredicate, \"exception predicate must not be null\");\n Tracer.exceptionPredicate = exceptionPredicate;\n }", "class_method_signature": "Tracer.setExceptionPredicate(Predicat...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_132
{ "fields": [], "file": "sentinel-cluster/sentinel-cluster-server-default/src/test/java/com/alibaba/csp/sentinel/cluster/flow/statistic/metric/ClusterParamMetricTest.java", "identifier": "ClusterParamMetricTest", "interfaces": "", "superclass": "extends AbstractTimeBasedTest" }
{ "body": "@Test\n public void testClusterParamMetric() {\n setCurrentMillis(System.currentTimeMillis());\n Map<Object, Double> topMap = new HashMap<Object, Double>();\n ClusterParamMetric metric = new ClusterParamMetric(5, 25, 100);\n metric.addValue(\"e1\", -1);\n metric.addVal...
{ "fields": [ { "declarator": "DEFAULT_CLUSTER_MAX_CAPACITY = 4000", "modifier": "public static final", "original_string": "public static final int DEFAULT_CLUSTER_MAX_CAPACITY = 4000;", "type": "int", "var_name": "DEFAULT_CLUSTER_MAX_CAPACITY" }, { "declarator": "metri...
{ "body": "public ClusterParamMetric(int sampleCount, int intervalInMs) {\n this(sampleCount, intervalInMs, DEFAULT_CLUSTER_MAX_CAPACITY);\n }", "class_method_signature": "ClusterParamMetric.ClusterParamMetric(int sampleCount, int intervalInMs)", "constructor": true, "full_signature": "public Cluster...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_22
{ "fields": [], "file": "sentinel-core/src/test/java/com/alibaba/csp/sentinel/slots/DefaultSlotChainBuilderTest.java", "identifier": "DefaultSlotChainBuilderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testBuild() {\n DefaultSlotChainBuilder builder = new DefaultSlotChainBuilder();\n ProcessorSlotChain slotChain = builder.build();\n assertNotNull(slotChain);\n\n // Verify the order of slot\n AbstractLinkedProcessorSlot<?> next = slotChain.getNext(...
{ "fields": [], "file": "sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/DefaultSlotChainBuilder.java", "identifier": "DefaultSlotChainBuilder", "interfaces": "implements SlotChainBuilder", "methods": [ { "class_method_signature": "DefaultSlotChainBuilder.build()", "constructor": fa...
{ "body": "@Override\n public ProcessorSlotChain build() {\n ProcessorSlotChain chain = new DefaultProcessorSlotChain();\n\n // Note: the instances of ProcessorSlot should be different, since they are not stateless.\n List<ProcessorSlot> sortedSlotList = SpiLoader.loadPrototypeInstanceListSort...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_165
{ "fields": [], "file": "sentinel-extension/sentinel-annotation-cdi-interceptor/src/test/java/com/alibaba/csp/sentinel/annotation/cdi/interceptor/AbstractSentinelInterceptorSupportTest.java", "identifier": "AbstractSentinelInterceptorSupportTest", "interfaces": "", "superclass": "extends AbstractSentinelInter...
{ "body": "@Test\n public void testGetResourceName() throws Exception {\n Method method = FooService.class.getMethod(\"random\");\n String resourceName = \"someRandom\";\n String expectedResolvedName = FooService.class.getName() + \":random()\";\n assertThat(getResourceName(resourceName...
{ "fields": [], "file": "sentinel-extension/sentinel-annotation-cdi-interceptor/src/main/java/com/alibaba/csp/sentinel/annotation/cdi/interceptor/AbstractSentinelInterceptorSupport.java", "identifier": "AbstractSentinelInterceptorSupport", "interfaces": "", "methods": [ { "class_method_signature": "...
{ "body": "protected String getResourceName(String resourceName, /*@NonNull*/ Method method) {\n // If resource name is present in annotation, use this value.\n if (StringUtil.isNotBlank(resourceName)) {\n return resourceName;\n }\n // Parse name of target method.\n retur...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_34
{ "fields": [], "file": "sentinel-core/src/test/java/com/alibaba/csp/sentinel/slots/block/flow/FlowRuleCheckerTest.java", "identifier": "FlowRuleCheckerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSelectReferenceNodeForContextEntrance() {\n String contextName = \"good_context\";\n\n DefaultNode node = mock(DefaultNode.class);\n Context context = mock(Context.class);\n\n FlowRule rule = new FlowRule(\"testSelectReferenceNodeForContextEntrance\")\...
{ "fields": [], "file": "sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/block/flow/FlowRuleChecker.java", "identifier": "FlowRuleChecker", "interfaces": "", "methods": [ { "class_method_signature": "FlowRuleChecker.checkFlow(Function<String, Collection<FlowRule>> ruleProvider, ResourceWr...
{ "body": "static Node selectReferenceNode(FlowRule rule, Context context, DefaultNode node) {\n String refResource = rule.getRefResource();\n int strategy = rule.getStrategy();\n\n if (StringUtil.isEmpty(refResource)) {\n return null;\n }\n\n if (strategy == RuleConstant...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_173
{ "fields": [], "file": "sentinel-adapter/sentinel-apache-dubbo-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/dubbo/DubboUtilsTest.java", "identifier": "DubboUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetInterfaceNameWithGroupAndVersion() throws NoSuchMethodException {\n\n URL url = URL.valueOf(\"dubbo://127.0.0.1:2181\")\n .addParameter(CommonConstants.VERSION_KEY, \"1.0.0\")\n .addParameter(CommonConstants.GROUP_KEY, \"grp1\")\n ...
{ "fields": [ { "declarator": "SENTINEL_DUBBO_APPLICATION_KEY = \"dubboApplication\"", "modifier": "public static final", "original_string": "public static final String SENTINEL_DUBBO_APPLICATION_KEY = \"dubboApplication\";", "type": "String", "var_name": "SENTINEL_DUBBO_APPLICATION_...
{ "body": "public static String getInterfaceName(Invoker invoker) {\n return getInterfaceName(invoker, false);\n }", "class_method_signature": "DubboUtils.getInterfaceName(Invoker invoker)", "constructor": false, "full_signature": "public static String getInterfaceName(Invoker invoker)", "identifier...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_63
{ "fields": [], "file": "sentinel-core/src/test/java/com/alibaba/csp/sentinel/util/StringUtilTest.java", "identifier": "StringUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsNotBlank() {\n Assert.assertFalse(StringUtil.isNotBlank(\"\"));\n Assert.assertTrue(StringUtil.isNotBlank(\"\\\"###\"));\n }", "class_method_signature": "StringUtilTest.testIsNotBlank()", "constructor": false, "full_signature": "@Test public void testIsNotBlank()", ...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" } ], "file": "sentinel-core/src/main/java/com/alibaba/csp/sentinel/util/StringUtil.java", "i...
{ "body": "public static boolean isNotBlank(String str) {\n return !isBlank(str);\n }", "class_method_signature": "StringUtil.isNotBlank(String str)", "constructor": false, "full_signature": "public static boolean isNotBlank(String str)", "identifier": "isNotBlank", "invocations": [ "isBlank" ...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_4
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "sentine...
{ "body": "@Test\n public void testCheckNotNullEmptyInputSpaceThrowsException() {\n thrown.expect(IllegalArgumentException.class);\n EagleEyeCoreUtils.checkNotNullEmpty(\" \", \"bar\");\n // Method is not expected to return due to exception thrown\n }", "class_method_signature": "EagleEye...
{ "fields": [ { "declarator": "EMPTY_STRING = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY_STRING = \"\";", "type": "String", "var_name": "EMPTY_STRING" }, { "declarator": "NEWLINE = \"\\r\\n\"", "modifier": "publi...
{ "body": "public static String checkNotNullEmpty(String value, String name) throws IllegalArgumentException {\n if (isBlank(value)) {\n throw new IllegalArgumentException(name + \" is null or empty\");\n }\n return value;\n }", "class_method_signature": "EagleEyeCoreUtils.checkNo...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_124
{ "fields": [], "file": "sentinel-cluster/sentinel-cluster-server-default/src/test/java/com/alibaba/csp/sentinel/cluster/server/connection/ConnectionManagerTest.java", "identifier": "ConnectionManagerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetOrCreateGroupMultipleThread() throws Exception {\n final String namespace = \"test-namespace\";\n int threadCount = 32;\n final List<ConnectionGroup> groups = new CopyOnWriteArrayList<>();\n final CountDownLatch latch = new CountDownLatch(threadCoun...
{ "fields": [ { "declarator": "CONN_MAP = new ConcurrentHashMap<>()", "modifier": "private static final", "original_string": "private static final Map<String, ConnectionGroup> CONN_MAP = new ConcurrentHashMap<>();", "type": "Map<String, ConnectionGroup>", "var_name": "CONN_MAP" }...
{ "body": "public static ConnectionGroup getOrCreateGroup(String namespace) {\n AssertUtil.assertNotBlank(namespace, \"namespace should not be empty\");\n ConnectionGroup group = CONN_MAP.get(namespace);\n if (group == null) {\n synchronized (CREATE_LOCK) {\n if ((group ...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_18
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "sentine...
{ "body": "@Test\n public void testGetSystemPropertyForLong() {\n Assert.assertEquals(2L,\n EagleEyeCoreUtils.getSystemPropertyForLong(null, 2L));\n }", "class_method_signature": "EagleEyeCoreUtilsTest.testGetSystemPropertyForLong()", "constructor": false, "full_signature": "@Test pu...
{ "fields": [ { "declarator": "EMPTY_STRING = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY_STRING = \"\";", "type": "String", "var_name": "EMPTY_STRING" }, { "declarator": "NEWLINE = \"\\r\\n\"", "modifier": "publi...
{ "body": "public static long getSystemPropertyForLong(String key, long defaultValue) {\n try {\n return Long.parseLong(System.getProperty(key));\n } catch (Throwable t) {\n return defaultValue;\n }\n }", "class_method_signature": "EagleEyeCoreUtils.getSystemPropertyFor...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_221
{ "fields": [], "file": "sentinel-adapter/sentinel-api-gateway-adapter-common/src/test/java/com/alibaba/csp/sentinel/adapter/gateway/common/api/GatewayApiDefinitionManagerTest.java", "identifier": "GatewayApiDefinitionManagerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsValidApi() {\n ApiDefinition bad1 = new ApiDefinition();\n ApiDefinition bad2 = new ApiDefinition(\"foo\");\n ApiDefinition good1 = new ApiDefinition(\"foo\")\n .setPredicateItems(Collections.<ApiPredicateItem>singleton(new ApiPathPredicateItem()...
{ "fields": [ { "declarator": "API_MAP = new ConcurrentHashMap<>()", "modifier": "private static final", "original_string": "private static final Map<String, ApiDefinition> API_MAP = new ConcurrentHashMap<>();", "type": "Map<String, ApiDefinition>", "var_name": "API_MAP" }, {...
{ "body": "public static boolean isValidApi(ApiDefinition apiDefinition) {\n return apiDefinition != null && StringUtil.isNotBlank(apiDefinition.getApiName())\n && apiDefinition.getPredicateItems() != null;\n }", "class_method_signature": "GatewayApiDefinitionManager.isValidApi(ApiDefinition ap...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_108
{ "fields": [], "file": "sentinel-transport/sentinel-transport-common/src/test/java/com/alibaba/csp/sentinel/transport/config/TransportConfigTest.java", "identifier": "TransportConfigTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetHeartbeatClientIp() {\n String clientIp = \"10.10.10.10\";\n SentinelConfig.setConfig(TransportConfig.HEARTBEAT_CLIENT_IP, clientIp);\n // Set heartbeat client ip to system property.\n String ip = TransportConfig.getHeartbeatClientIp();\n\n a...
{ "fields": [ { "declarator": "CONSOLE_SERVER = \"csp.sentinel.dashboard.server\"", "modifier": "public static final", "original_string": "public static final String CONSOLE_SERVER = \"csp.sentinel.dashboard.server\";", "type": "String", "var_name": "CONSOLE_SERVER" }, { ...
{ "body": "public static String getHeartbeatClientIp() {\n String ip = SentinelConfig.getConfig(HEARTBEAT_CLIENT_IP);\n if (StringUtil.isBlank(ip)) {\n ip = HostNameUtil.getIp();\n }\n return ip;\n }", "class_method_signature": "TransportConfig.getHeartbeatClientIp()", "c...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_59
{ "fields": [], "file": "sentinel-core/src/test/java/com/alibaba/csp/sentinel/util/StringUtilTest.java", "identifier": "StringUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testEqualsIgnoreCase() {\n Assert.assertFalse(StringUtil.equalsIgnoreCase(\"\", \"BCCC\"));\n Assert.assertFalse(StringUtil.equalsIgnoreCase(null, \"\"));\n Assert.assertTrue(StringUtil.equalsIgnoreCase(\"\", \"\"));\n Assert.assertTrue(StringUtil.equalsIgnoreCase(\"BcCc\",...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" } ], "file": "sentinel-core/src/main/java/com/alibaba/csp/sentinel/util/StringUtil.java", "i...
{ "body": "public static boolean equalsIgnoreCase(final CharSequence str1, final CharSequence str2) {\n if (str1 == null || str2 == null) {\n return str1 == str2;\n } else if (str1 == str2) {\n return true;\n } else if (str1.length() != str2.length()) {\n return f...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
128018428_149
{ "fields": [], "file": "sentinel-extension/sentinel-parameter-flow-control/src/test/java/com/alibaba/csp/sentinel/slots/block/flow/param/ParamFlowCheckerTest.java", "identifier": "ParamFlowCheckerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testPassLocalCheckForArray() throws InterruptedException {\n final String resourceName = \"testPassLocalCheckForArray\";\n final ResourceWrapper resourceWrapper = new StringResourceWrapper(resourceName, EntryType.IN);\n int paramIdx = 0;\n double globalThr...
{ "fields": [], "file": "sentinel-extension/sentinel-parameter-flow-control/src/main/java/com/alibaba/csp/sentinel/slots/block/flow/param/ParamFlowChecker.java", "identifier": "ParamFlowChecker", "interfaces": "", "methods": [ { "class_method_signature": "ParamFlowChecker.passCheck(ResourceWrapper r...
{ "body": "public static boolean passCheck(ResourceWrapper resourceWrapper, /*@Valid*/ ParamFlowRule rule, /*@Valid*/ int count,\n Object... args) {\n if (args == null) {\n return true;\n }\n\n int paramIdx = rule.getParamIdx();\n if (args.length <= p...
{ "created": "4/4/2018 6:37:33 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 128018428, "size": null, "stargazer_count": null, "stars": 10653, "updates": "2020-01-27T13:24:35+00:00", "url": "https://github.com/alibaba/Sentin...
75735839_27
{ "fields": [ { "declarator": "controller", "modifier": "", "original_string": "W3CSearchController controller;", "type": "W3CSearchController", "var_name": "controller" }, { "declarator": "w3cAnnotationSearchService", "modifier": "private", "original_string...
{ "body": "@Test\n public void testSearchWithinGet() throws UnsupportedEncodingException {\n\tString queryNotFound = \"not found\";\n\tString motivation = null;\n\tString date = null;\n\tString user = null;\n\tString page = null;\n\tServiceResponse notFoundResponse = new ServiceResponse(Status.NOT_FOUND, null);\n\...
{ "fields": [ { "declarator": "CONTROLLER_NAME = \"w3cSearchController\"", "modifier": "public static final", "original_string": "public static final String CONTROLLER_NAME = \"w3cSearchController\";", "type": "String", "var_name": "CONTROLLER_NAME" }, { "declarator": "...
{ "body": "@CrossOrigin\n\t@RequestMapping(value = WITHIN_W3C_MIXED_SEARCH_REQUEST_PATH, method = RequestMethod.GET)\n\tpublic ResponseEntity<Map<String, Object>> searchW3CWithinGet(@PathVariable String withinId,\n\t\t\t@RequestParam(value = AnnotationSearchConstants.PARAM_FIELD_QUERY, required = false) String query,...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_31
{ "fields": [ { "declarator": "controller", "modifier": "", "original_string": "W3CTextSearchController controller;", "type": "W3CTextSearchController", "var_name": "controller" }, { "declarator": "textSearchService", "modifier": "private", "original_string"...
{ "body": "@Test\n public void testSearchWithinGet() throws UnsupportedEncodingException {\n\tString queryNotFound = \"not found\";\n\tString motivation = null;\n\tString date = null;\n\tString user = null;\n\tString page = null;\n\tServiceResponse notFoundResponse = new ServiceResponse(Status.NOT_FOUND, null);\n\...
{ "fields": [ { "declarator": "CONTROLLER_NAME = \"w3CTextSearchController\"", "modifier": "public static final", "original_string": "public static final String CONTROLLER_NAME = \"w3CTextSearchController\";", "type": "String", "var_name": "CONTROLLER_NAME" }, { "declar...
{ "body": "@CrossOrigin\n\t@RequestMapping(value = WITHIN_TEXT_SEARCH_REQUEST_PATH, method = RequestMethod.GET)\n\tpublic ResponseEntity<Map<String, Object>> searchTextWithinGet(@PathVariable String withinId,\n\t\t\t@RequestParam(value = AnnotationSearchConstants.PARAM_FIELD_QUERY, required = true) String query,\n\t\...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_11
{ "fields": [ { "declarator": "LOG = Logger.getLogger(TextSearchServiceImplTest.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = Logger.getLogger(TextSearchServiceImplTest.class);", "type": "Logger", "var_name": "LOG" }, { ...
{ "body": "@Test\n public void testGetTotalHits() {\n\tassertEquals(0, textSearchServiceImpl.getTotalHits());\n }", "class_method_signature": "TextSearchServiceImplTest.testGetTotalHits()", "constructor": false, "full_signature": "@Test public void testGetTotalHits()", "identifier": "testGetTotalHits", ...
{ "fields": [ { "declarator": "LOG = Logger.getLogger(TextSearchServiceImpl.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = Logger.getLogger(TextSearchServiceImpl.class);", "type": "Logger", "var_name": "LOG" }, { "decl...
{ "body": "@Override\n public long getTotalHits() {\n\treturn totalHits;\n }", "class_method_signature": "TextSearchServiceImpl.getTotalHits()", "constructor": false, "full_signature": "@Override public long getTotalHits()", "identifier": "getTotalHits", "invocations": [], "modifiers": "@Override pu...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_6
{ "fields": [ { "declarator": "impl", "modifier": "private", "original_string": "private W3CAnnotationSearchServiceImpl impl;", "type": "W3CAnnotationSearchServiceImpl", "var_name": "impl" }, { "declarator": "annotationUtils", "modifier": "", "original_strin...
{ "body": "@Test\n public void testGetAnnotationPage() {\n\tString query = \"comment\";\n\tString motivation = null;\n\tString date = null;\n\tString user = null;\n\tString queryString = \"http://www.example.com/search?q=comment\";\n\tString page = null;\n\n\tlong totalHits = 20;\n\tsearchQueryUtils.setUpBuilder(t...
{ "fields": [ { "declarator": "W3C_ANNOTATION_SERVICE_NAME = \"w3CAnnotationSearchServiceImpl\"", "modifier": "public static final", "original_string": "public static final String W3C_ANNOTATION_SERVICE_NAME = \"w3CAnnotationSearchServiceImpl\";", "type": "String", "var_name": "W3C_A...
{ "body": "@Override\n @Cacheable(value = \"w3cAnnotationSearchPagingCache\", key = \"#queryString\" )\n @Transactional(readOnly = true, isolation = Isolation.SERIALIZABLE)\n public ServiceResponse<Map<String, Object>> getAnnotationPage(Parameters parameters, String queryString, String page, String within, S...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_7
{ "fields": [ { "declarator": "getPayloadServiceImpl", "modifier": "private", "original_string": "private GetPayloadServiceImpl getPayloadServiceImpl;", "type": "GetPayloadServiceImpl", "var_name": "getPayloadServiceImpl" }, { "declarator": "LOG = Logger.getLogger(GetPa...
{ "body": "@Test\n public void testGetPayloadServiceImpl() {\n\tassertNotNull(getPayloadServiceImpl.httpClient.toString());\n }", "class_method_signature": "GetPayloadServiceImplTest.testGetPayloadServiceImpl()", "constructor": false, "full_signature": "@Test public void testGetPayloadServiceImpl()", "i...
{ "fields": [ { "declarator": "LOG = Logger.getLogger(GetPayloadServiceImpl.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = Logger.getLogger(GetPayloadServiceImpl.class);", "type": "Logger", "var_name": "LOG" }, { "decl...
{ "body": "GetPayloadServiceImpl(){\n\n\thttpClient = HttpClientBuilder.create().build(); //Use this instead\n }", "class_method_signature": "GetPayloadServiceImpl.GetPayloadServiceImpl()", "constructor": true, "full_signature": " GetPayloadServiceImpl()", "identifier": "GetPayloadServiceImpl", "invocat...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_10
{ "fields": [ { "declarator": "LOG = Logger.getLogger(TextSearchServiceImplTest.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = Logger.getLogger(TextSearchServiceImplTest.class);", "type": "Logger", "var_name": "LOG" }, { ...
{ "body": "@Test\n public void testGetPageParameters() {\n\tassertNull(textSearchServiceImpl.getPageParameters());\n }", "class_method_signature": "TextSearchServiceImplTest.testGetPageParameters()", "constructor": false, "full_signature": "@Test public void testGetPageParameters()", "identifier": "test...
{ "fields": [ { "declarator": "LOG = Logger.getLogger(TextSearchServiceImpl.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = Logger.getLogger(TextSearchServiceImpl.class);", "type": "Logger", "var_name": "LOG" }, { "decl...
{ "body": "@Override\n public PageParameters getPageParameters() {\n\treturn pagingParameters;\n }", "class_method_signature": "TextSearchServiceImpl.getPageParameters()", "constructor": false, "full_signature": "@Override public PageParameters getPageParameters()", "identifier": "getPageParameters", ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_30
{ "fields": [ { "declarator": "controller", "modifier": "", "original_string": "W3CTextSearchController controller;", "type": "W3CTextSearchController", "var_name": "controller" }, { "declarator": "textSearchService", "modifier": "private", "original_string"...
{ "body": "@Test\n public void testAutocompleteGet() throws UnsupportedEncodingException {\n\tString queryNotFound = \"not found\";\n\tString motivation = null;\n\tString date = null;\n\tString user = null;\n\tString min = null;\n\tServiceResponse notFoundResponse = new ServiceResponse(Status.NOT_FOUND, null);\n\n...
{ "fields": [ { "declarator": "CONTROLLER_NAME = \"w3CTextSearchController\"", "modifier": "public static final", "original_string": "public static final String CONTROLLER_NAME = \"w3CTextSearchController\";", "type": "String", "var_name": "CONTROLLER_NAME" }, { "declar...
{ "body": "@CrossOrigin\n\t@RequestMapping(value = W3C_TEXT_AUTOCOMPLETE_REQUEST_PATH, method = RequestMethod.GET)\n\tpublic ResponseEntity<Map<String, Object>> autocompleteTextW3CGet(\n\t\t\t@RequestParam(value = AnnotationSearchConstants.PARAM_FIELD_QUERY, required = true) String query,\n\t\t\t@RequestParam(value =...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_26
{ "fields": [ { "declarator": "controller", "modifier": "", "original_string": "W3CSearchController controller;", "type": "W3CSearchController", "var_name": "controller" }, { "declarator": "w3cAnnotationSearchService", "modifier": "private", "original_string...
{ "body": "@Test\n public void testAutocompleteGet() throws UnsupportedEncodingException {\n\tString queryNotFound = \"not found\";\n\tString motivation = null;\n\tString date = null;\n\tString user = null;\n\tString min = null;\n\tServiceResponse notFoundResponse = new ServiceResponse(Status.NOT_FOUND, null);\n\n...
{ "fields": [ { "declarator": "CONTROLLER_NAME = \"w3cSearchController\"", "modifier": "public static final", "original_string": "public static final String CONTROLLER_NAME = \"w3cSearchController\";", "type": "String", "var_name": "CONTROLLER_NAME" }, { "declarator": "...
{ "body": "@CrossOrigin\n\t@RequestMapping(value = W3C_MIXED_AUTOCOMPLETE_REQUEST_PATH, method = RequestMethod.GET)\n\tpublic ResponseEntity<Map<String, Object>> autocompleteW3CMixedGet(\n\t\t\t@RequestParam(value = AnnotationSearchConstants.PARAM_FIELD_QUERY, required = true) String query,\n\t\t\t@RequestParam(value...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_17
{ "fields": [ { "declarator": "controller", "modifier": "", "original_string": "OAAnnotationSearchController controller;", "type": "OAAnnotationSearchController", "var_name": "controller" }, { "declarator": "oaAnnotationSearchService", "modifier": "private", ...
{ "body": "@Test\n public void testSearchGet() throws UnsupportedEncodingException {\n\tString queryNotFound = \"not found\";\n\tString motivation = null;\n\tString date = null;\n\tString user = null;\n\tString page = null;\n\tServiceResponse notFoundResponse = new ServiceResponse(Status.NOT_FOUND, null);\n\tStrin...
{ "fields": [ { "declarator": "CONTROLLER_NAME = \"oaAnnotationSearchController\"", "modifier": "public static final", "original_string": "public static final String CONTROLLER_NAME = \"oaAnnotationSearchController\";", "type": "String", "var_name": "CONTROLLER_NAME" }, { ...
{ "body": "@CrossOrigin\n\t@RequestMapping(value = OA_SEARCH_REQUEST_PATH, method = RequestMethod.GET)\n\tpublic ResponseEntity<Map<String, Object>> searchOAGet(\n\t\t\t@RequestParam(value = AnnotationSearchConstants.PARAM_FIELD_QUERY, required = false) String query,\n\t\t\t@RequestParam(value = AnnotationSearchConst...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_40
{ "fields": [ { "declarator": "controller", "modifier": "", "original_string": "OATextSearchController controller;", "type": "OATextSearchController", "var_name": "controller" }, { "declarator": "textSearchService", "modifier": "private", "original_string": ...
{ "body": "@Test\n public void testAutocompleteWithinGet() throws UnsupportedEncodingException {\n\tString queryNotFound = \"not found\";\n\tString motivation = null;\n\tString date = null;\n\tString user = null;\n\tString min = null;\n\tServiceResponse notFoundResponse = new ServiceResponse(Status.NOT_FOUND, null...
{ "fields": [ { "declarator": "CONTROLLER_NAME = \"OATextSearchController\"", "modifier": "public static final", "original_string": "public static final String CONTROLLER_NAME = \"OATextSearchController\";", "type": "String", "var_name": "CONTROLLER_NAME" }, { "declarat...
{ "body": "@CrossOrigin\n\t@RequestMapping(value = WITHIN_OA_TEXT_AUTOCOMPLETE_REQUEST_PATH, method = RequestMethod.GET)\n\tpublic ResponseEntity<Map<String, Object>> autocompleteTextWithinOAGet(@PathVariable String withinId,\n\t\t\t@RequestParam(value = AnnotationSearchConstants.PARAM_FIELD_QUERY, required = true) S...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_0
{ "fields": [ { "declarator": "LOG = Logger.getLogger(TextUtilsTest.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = Logger.getLogger(TextUtilsTest.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "textUt...
{ "body": "@Test\n public void testSortPositionsForMultiwordPhrase() {\n\n\tString query = \"fox brown\";\n\tList positions = new ArrayList();\n\tList<TermWithTermOffsets> termWithOffsetsList = new ArrayList<>();\n\n\tTermWithTermOffsets one = new TermWithTermOffsets();\n\tTermWithTermOffsets two = new TermWithT...
{ "fields": [ { "declarator": "LOG = Logger.getLogger(TextUtils.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = Logger.getLogger(TextUtils.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "SERVICE_NAME =...
{ "body": "public List<Object> sortPositionsForMultiwordPhrase(List<TermWithTermOffsets> termWithOffsetsList,\n\t\t\tMap<String, String> offsetPositionMap, List<Positions> positionsList) {\n\n\t\tList<String> stringSets = workThoughOffsets(termWithOffsetsList);\n\n\t\tList<String> templist;\n\t\tList<Object> position...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_21
{ "fields": [ { "declarator": "controller", "modifier": "", "original_string": "W3CAnnotationSearchController controller;", "type": "W3CAnnotationSearchController", "var_name": "controller" }, { "declarator": "w3cAnnotationSearchService", "modifier": "private", ...
{ "body": "@Test\n public void testSearchGet() throws UnsupportedEncodingException {\n\tString queryNotFound = \"not found\";\n\tString motivation = null;\n\tString date = null;\n\tString user = null;\n\tString page = null;\n\tServiceResponse notFoundResponse = new ServiceResponse(Status.NOT_FOUND, null);\n\tParam...
{ "fields": [ { "declarator": "CONTROLLER_NAME = \"w3cAnnotationSearchController\"", "modifier": "public static final", "original_string": "public static final String CONTROLLER_NAME = \"w3cAnnotationSearchController\";", "type": "String", "var_name": "CONTROLLER_NAME" }, { ...
{ "body": "@CrossOrigin\n\t@RequestMapping(value = W3C_SEARCH_REQUEST_PATH, method = RequestMethod.GET)\n\tpublic ResponseEntity<Map<String, Object>> searchGet(\n\t\t\t@RequestParam(value = AnnotationSearchConstants.PARAM_FIELD_QUERY, required = false) String query,\n\t\t\t@RequestParam(value = AnnotationSearchConsta...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_37
{ "fields": [ { "declarator": "controller", "modifier": "", "original_string": "OATextSearchController controller;", "type": "OATextSearchController", "var_name": "controller" }, { "declarator": "textSearchService", "modifier": "private", "original_string": ...
{ "body": "@Test\n public void testSearchGet() throws UnsupportedEncodingException {\n\tString queryNotFound = \"not found\";\n\tString motivation = null;\n\tString date = null;\n\tString user = null;\n\tString page = null;\n\tServiceResponse notFoundResponse = new ServiceResponse(Status.NOT_FOUND, null);\n\n\twhe...
{ "fields": [ { "declarator": "CONTROLLER_NAME = \"OATextSearchController\"", "modifier": "public static final", "original_string": "public static final String CONTROLLER_NAME = \"OATextSearchController\";", "type": "String", "var_name": "CONTROLLER_NAME" }, { "declarat...
{ "body": "@CrossOrigin\n\t@RequestMapping(value = OA_TEXT_SEARCH_REQUEST_PATH, method = RequestMethod.GET)\n\tpublic ResponseEntity<Map<String, Object>> searchTextOAGet(\n\t\t\t@RequestParam(value = AnnotationSearchConstants.PARAM_FIELD_QUERY, required = true) String query,\n\t\t\t@RequestParam(value = AnnotationSea...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_36
{ "fields": [ { "declarator": "controller", "modifier": "", "original_string": "OASearchController controller;", "type": "OASearchController", "var_name": "controller" }, { "declarator": "oaAnnotationSearchService", "modifier": "private", "original_string": ...
{ "body": "@Test\n public void testAutocompleteWithinGet() throws UnsupportedEncodingException {\n\tString queryNotFound = \"not found\";\n\tString motivation = null;\n\tString date = null;\n\tString user = null;\n\tString min = null;\n\tServiceResponse notFoundResponse = new ServiceResponse(Status.NOT_FOUND, null...
{ "fields": [ { "declarator": "CONTROLLER_NAME = \"oaSearchController\"", "modifier": "public static final", "original_string": "public static final String CONTROLLER_NAME = \"oaSearchController\";", "type": "String", "var_name": "CONTROLLER_NAME" }, { "declarator": "oa...
{ "body": "@CrossOrigin\n\t@RequestMapping(value = WITHIN_OA_MIXED_AUTOCOMPLETE_REQUEST_PATH, method = RequestMethod.GET)\n\tpublic ResponseEntity<Map<String, Object>> autocompleteOAWithinMixedGet(@PathVariable String withinId,\n\t\t\t@RequestParam(value = AnnotationSearchConstants.PARAM_FIELD_QUERY, required = true)...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_20
{ "fields": [ { "declarator": "controller", "modifier": "", "original_string": "OAAnnotationSearchController controller;", "type": "OAAnnotationSearchController", "var_name": "controller" }, { "declarator": "oaAnnotationSearchService", "modifier": "private", ...
{ "body": "@Test\n public void testAutocompletewithinGet() throws UnsupportedEncodingException {\n\tString queryNotFound = \"not found\";\n\tString motivation = null;\n\tString date = null;\n\tString user = null;\n\tString min = null;\n\tServiceResponse notFoundResponse = new ServiceResponse(Status.NOT_FOUND, null...
{ "fields": [ { "declarator": "CONTROLLER_NAME = \"oaAnnotationSearchController\"", "modifier": "public static final", "original_string": "public static final String CONTROLLER_NAME = \"oaAnnotationSearchController\";", "type": "String", "var_name": "CONTROLLER_NAME" }, { ...
{ "body": "@CrossOrigin\n\t@RequestMapping(value = WITHIN_OA_AUTOCOMPLETE_REQUEST_PATH, method = RequestMethod.GET)\n\tpublic ResponseEntity<Map<String, Object>> autocompleteWithinGet(@PathVariable String withinId,\n\t\t\t@RequestParam(value = AnnotationSearchConstants.PARAM_FIELD_QUERY, required = true) String query...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_1
{ "fields": [ { "declarator": "LOG = Logger.getLogger(TextUtilsTest.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = Logger.getLogger(TextUtilsTest.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "textUt...
{ "body": "@Test\n public void testCoordinates() throws IOException{\n\n\tString id1 = \"https://dlcs.io/iiif-img/2/1/6b33280a-d28f-4773-be0d-05bd364c745e\";\n\tString id2 = \"https://dlcs.io/iiif-img/50/1/000214ef-74f3-4ec2-9a5f-3b79f50fc500\";\n\tString id3 = \"https://dlcs.io/iiif-img/50/1/000214ef-74f3-4ec2-9a...
{ "fields": [ { "declarator": "LOG = Logger.getLogger(TextUtils.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = Logger.getLogger(TextUtils.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "SERVICE_NAME =...
{ "body": "public Map<String, Object> createCoordinateAnnotation(String query, String coordinatePayload, boolean isW3c,\n\t\t\tImageHelperObject imageHelper, Map<String, Map<String, TermOffsetStart>> termPositionMap,\n\t\t\tString queryString, PageParameters pageParams, boolean isMixedSearch, Map<String, String> imag...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_16
{ "fields": [ { "declarator": "LOG = Logger.getLogger(AnnotationSearchServiceImplTest.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = Logger.getLogger(AnnotationSearchServiceImplTest.class);", "type": "Logger", "var_name": "LOG" ...
{ "body": "@Test\n public void testGetAnnotationsPage() {\n\tString query = \"comment\";\n\tString motivation = null;\n\tString date = null;\n\tString user = null;\n\tString queryString = \"http://www.example.com/search?q=comment\";\n\tboolean isW3c = false;\n\tString page = null;\n\tlong totalHits = 10;\n\tString...
{ "fields": [ { "declarator": "LOG = Logger.getLogger(AnnotationSearchServiceImpl.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = Logger.getLogger(AnnotationSearchServiceImpl.class);", "type": "Logger", "var_name": "LOG" }, {...
{ "body": "public String[] getAnnotationsPage(Parameters parameters, String queryString, boolean isW3c, String page,\n\t String within, String type) {\n\n\ttotalHits = 0;\n\n\tpagingParameters = null;\n\n\tint pagingSize = DEFAULT_PAGING_NUMBER;\n\tint from = DEFAULT_STARTING_PAGING_NUMBER;\n\n\t// TODO validate t...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_39
{ "fields": [ { "declarator": "controller", "modifier": "", "original_string": "OATextSearchController controller;", "type": "OATextSearchController", "var_name": "controller" }, { "declarator": "textSearchService", "modifier": "private", "original_string": ...
{ "body": "@Test\n public void testSearchWithinGet() throws UnsupportedEncodingException {\n\tString queryNotFound = \"not found\";\n\tString motivation = null;\n\tString date = null;\n\tString user = null;\n\tString page = null;\n\tServiceResponse notFoundResponse = new ServiceResponse(Status.NOT_FOUND, null);\n\...
{ "fields": [ { "declarator": "CONTROLLER_NAME = \"OATextSearchController\"", "modifier": "public static final", "original_string": "public static final String CONTROLLER_NAME = \"OATextSearchController\";", "type": "String", "var_name": "CONTROLLER_NAME" }, { "declarat...
{ "body": "@CrossOrigin\n\t@RequestMapping(value = WITHIN_OA_TEXT_SEARCH_REQUEST_PATH, method = RequestMethod.GET)\n\tpublic ResponseEntity<Map<String, Object>> searchTextWithinOAGet(@PathVariable String withinId,\n\t\t\t@RequestParam(value = AnnotationSearchConstants.PARAM_FIELD_QUERY, required = true) String query,...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_2
{ "fields": [ { "declarator": "LOG = Logger.getLogger(TextUtilsTest.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = Logger.getLogger(TextUtilsTest.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "textUt...
{ "body": "@Test\n public void testAmendStartsAndEndsPositions(){\n\tString text = \"had than the a pions we can mahe- to have one see from One chain jaica k one side from, anotes and - it T hit C Na an one chain, a hr a we can me one can heue the fire is are code , but I those order in fines, they to order n he o...
{ "fields": [ { "declarator": "LOG = Logger.getLogger(TextUtils.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = Logger.getLogger(TextUtils.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "SERVICE_NAME =...
{ "body": "public void amendStartsAndEndsPositions(String text, int startText, int endText) {\n\n\t\tString endPreviousText = text.substring(0, startText - 1);\n\t\tString currrentText = text.substring(startText, endText);\n\t\tString startNextText = text.substring(endText + 1, text.length());\n\t\tLOG.info(\"[\" + t...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_15
{ "fields": [ { "declarator": "LOG = Logger.getLogger(AnnotationSearchServiceImplTest.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = Logger.getLogger(AnnotationSearchServiceImplTest.class);", "type": "Logger", "var_name": "LOG" ...
{ "body": "@Test\n public void testGetTotalHits() {\n\tassertEquals(0, annotationSearchServiceImpl.getTotalHits());\n }", "class_method_signature": "AnnotationSearchServiceImplTest.testGetTotalHits()", "constructor": false, "full_signature": "@Test public void testGetTotalHits()", "identifier": "testGet...
{ "fields": [ { "declarator": "LOG = Logger.getLogger(AnnotationSearchServiceImpl.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = Logger.getLogger(AnnotationSearchServiceImpl.class);", "type": "Logger", "var_name": "LOG" }, {...
{ "body": "public long getTotalHits() {\n\treturn totalHits;\n }", "class_method_signature": "AnnotationSearchServiceImpl.getTotalHits()", "constructor": false, "full_signature": "public long getTotalHits()", "identifier": "getTotalHits", "invocations": [], "modifiers": "public", "parameters": "()", ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_35
{ "fields": [ { "declarator": "controller", "modifier": "", "original_string": "OASearchController controller;", "type": "OASearchController", "var_name": "controller" }, { "declarator": "oaAnnotationSearchService", "modifier": "private", "original_string": ...
{ "body": "@Test\n public void testSearchWithinGet() throws UnsupportedEncodingException {\n\tString queryNotFound = \"not found\";\n\tString motivation = null;\n\tString date = null;\n\tString user = null;\n\tString page = null;\n\tServiceResponse notFoundResponse = new ServiceResponse(Status.NOT_FOUND, null);\n\...
{ "fields": [ { "declarator": "CONTROLLER_NAME = \"oaSearchController\"", "modifier": "public static final", "original_string": "public static final String CONTROLLER_NAME = \"oaSearchController\";", "type": "String", "var_name": "CONTROLLER_NAME" }, { "declarator": "oa...
{ "body": "@CrossOrigin\n\t@RequestMapping(value = WITHIN_OA_MIXED_SEARCH_REQUEST_PATH, method = RequestMethod.GET)\n\tpublic ResponseEntity<Map<String, Object>> searchOAWithinMixedGet(@PathVariable String withinId,\n\t\t\t@RequestParam(value = AnnotationSearchConstants.PARAM_FIELD_QUERY, required = false) String que...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_23
{ "fields": [ { "declarator": "controller", "modifier": "", "original_string": "W3CAnnotationSearchController controller;", "type": "W3CAnnotationSearchController", "var_name": "controller" }, { "declarator": "w3cAnnotationSearchService", "modifier": "private", ...
{ "body": "@Test\n public void testSearchWithinGet() throws UnsupportedEncodingException {\n\tString queryNotFound = \"not found\";\n\tString motivation = null;\n\tString date = null;\n\tString user = null;\n\tString page = null;\n\tServiceResponse notFoundResponse = new ServiceResponse(Status.NOT_FOUND, null);\n\...
{ "fields": [ { "declarator": "CONTROLLER_NAME = \"w3cAnnotationSearchController\"", "modifier": "public static final", "original_string": "public static final String CONTROLLER_NAME = \"w3cAnnotationSearchController\";", "type": "String", "var_name": "CONTROLLER_NAME" }, { ...
{ "body": "@CrossOrigin\n\t@RequestMapping(value = WITHIN_W3C_SEARCH_REQUEST_PATH, method = RequestMethod.GET)\n\tpublic ResponseEntity<Map<String, Object>> searchWithinGet(@PathVariable String withinId,\n\t\t\t@RequestParam(value = AnnotationSearchConstants.PARAM_FIELD_QUERY, required = false) String query,\n\t\t\t@...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_19
{ "fields": [ { "declarator": "controller", "modifier": "", "original_string": "OAAnnotationSearchController controller;", "type": "OAAnnotationSearchController", "var_name": "controller" }, { "declarator": "oaAnnotationSearchService", "modifier": "private", ...
{ "body": "@Test\n public void testSearchWithinGet() throws UnsupportedEncodingException {\n\tString queryNotFound = \"not found\";\n\tString motivation = null;\n\tString date = null;\n\tString user = null;\n\tString page = null;\n\tServiceResponse notFoundResponse = new ServiceResponse(Status.NOT_FOUND, null);\n\...
{ "fields": [ { "declarator": "CONTROLLER_NAME = \"oaAnnotationSearchController\"", "modifier": "public static final", "original_string": "public static final String CONTROLLER_NAME = \"oaAnnotationSearchController\";", "type": "String", "var_name": "CONTROLLER_NAME" }, { ...
{ "body": "@CrossOrigin\n\t@RequestMapping(value = WITHIN_OA_SEARCH_REQUEST_PATH, method = RequestMethod.GET)\n\tpublic ResponseEntity<Map<String, Object>> searchWithinOAGet(@PathVariable String withinId,\n\t\t\t@RequestParam(value = AnnotationSearchConstants.PARAM_FIELD_QUERY, required = false) String query,\n\t\t\t...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_18
{ "fields": [ { "declarator": "controller", "modifier": "", "original_string": "OAAnnotationSearchController controller;", "type": "OAAnnotationSearchController", "var_name": "controller" }, { "declarator": "oaAnnotationSearchService", "modifier": "private", ...
{ "body": "@Test\n public void testAutocompleteGet() throws UnsupportedEncodingException {\n\tString queryNotFound = \"not found\";\n\tString motivation = null;\n\tString date = null;\n\tString user = null;\n\tString min = null;\n\tServiceResponse notFoundResponse = new ServiceResponse(Status.NOT_FOUND, null);\n\n...
{ "fields": [ { "declarator": "CONTROLLER_NAME = \"oaAnnotationSearchController\"", "modifier": "public static final", "original_string": "public static final String CONTROLLER_NAME = \"oaAnnotationSearchController\";", "type": "String", "var_name": "CONTROLLER_NAME" }, { ...
{ "body": "@CrossOrigin\n\t@RequestMapping(value = OA_AUTOCOMPLETE_REQUEST_PATH, method = RequestMethod.GET)\n\tpublic ResponseEntity<Map<String, Object>> autocompleteGet(\n\t\t\t@RequestParam(value = AnnotationSearchConstants.PARAM_FIELD_QUERY, required = true) String query,\n\t\t\t@RequestParam(value = AnnotationSe...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_22
{ "fields": [ { "declarator": "controller", "modifier": "", "original_string": "W3CAnnotationSearchController controller;", "type": "W3CAnnotationSearchController", "var_name": "controller" }, { "declarator": "w3cAnnotationSearchService", "modifier": "private", ...
{ "body": "@Test\n public void testAutocompleteGet() throws UnsupportedEncodingException {\n\tString queryNotFound = \"not found\";\n\tString motivation = null;\n\tString date = null;\n\tString user = null;\n\tString min = null;\n\tServiceResponse notFoundResponse = new ServiceResponse(Status.NOT_FOUND, null);\n\n...
{ "fields": [ { "declarator": "CONTROLLER_NAME = \"w3cAnnotationSearchController\"", "modifier": "public static final", "original_string": "public static final String CONTROLLER_NAME = \"w3cAnnotationSearchController\";", "type": "String", "var_name": "CONTROLLER_NAME" }, { ...
{ "body": "@CrossOrigin\n\t@RequestMapping(value = W3C_AUTOCOMPLETE_REQUEST_PATH, method = RequestMethod.GET)\n\tpublic ResponseEntity<Map<String, Object>> autocompleteGet(\n\t\t\t@RequestParam(value = AnnotationSearchConstants.PARAM_FIELD_QUERY, required = true) String query,\n\t\t\t@RequestParam(value = AnnotationS...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_34
{ "fields": [ { "declarator": "controller", "modifier": "", "original_string": "OASearchController controller;", "type": "OASearchController", "var_name": "controller" }, { "declarator": "oaAnnotationSearchService", "modifier": "private", "original_string": ...
{ "body": "@Test\n public void testAutocompleteGet() throws UnsupportedEncodingException {\n\tString queryNotFound = \"not found\";\n\tString motivation = null;\n\tString date = null;\n\tString user = null;\n\tString min = null;\n\tServiceResponse notFoundResponse = new ServiceResponse(Status.NOT_FOUND, null);\n\n...
{ "fields": [ { "declarator": "CONTROLLER_NAME = \"oaSearchController\"", "modifier": "public static final", "original_string": "public static final String CONTROLLER_NAME = \"oaSearchController\";", "type": "String", "var_name": "CONTROLLER_NAME" }, { "declarator": "oa...
{ "body": "@CrossOrigin\n\t@RequestMapping(value = OA_MIXED_AUTOCOMPLETE_REQUEST_PATH, method = RequestMethod.GET)\n\tpublic ResponseEntity<Map<String, Object>> autocompleteOAMixedGet(\n\t\t\t@RequestParam(value = AnnotationSearchConstants.PARAM_FIELD_QUERY, required = true) String query,\n\t\t\t@RequestParam(value =...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_14
{ "fields": [ { "declarator": "LOG = Logger.getLogger(AnnotationSearchServiceImplTest.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = Logger.getLogger(AnnotationSearchServiceImplTest.class);", "type": "Logger", "var_name": "LOG" ...
{ "body": "@Test\n public void testGetPageParameters() {\n\tassertNull(annotationSearchServiceImpl.getPageParameters());\n }", "class_method_signature": "AnnotationSearchServiceImplTest.testGetPageParameters()", "constructor": false, "full_signature": "@Test public void testGetPageParameters()", "identi...
{ "fields": [ { "declarator": "LOG = Logger.getLogger(AnnotationSearchServiceImpl.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = Logger.getLogger(AnnotationSearchServiceImpl.class);", "type": "Logger", "var_name": "LOG" }, {...
{ "body": "public PageParameters getPageParameters() {\n\treturn pagingParameters;\n }", "class_method_signature": "AnnotationSearchServiceImpl.getPageParameters()", "constructor": false, "full_signature": "public PageParameters getPageParameters()", "identifier": "getPageParameters", "invocations": [], ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_3
{ "fields": [ { "declarator": "annotationUtils", "modifier": "private", "original_string": "private AnnotationUtils annotationUtils;", "type": "AnnotationUtils", "var_name": "annotationUtils" }, { "declarator": "LOG = Logger.getLogger(AnnotationUtilsTest.class)", ...
{ "body": "@Test\n public void testCreateAnnotationPage() {\n\n\tList<W3CAnnotation> annoList = new ArrayList<W3CAnnotation>();\n\tannoList.add(createDummyAnnotation(\"1\"));\n\n\tString query = \"http://www.example.com/q=test\";\n\tboolean isW3c = true;\n\n\tPageParameters pageParams = new PageParameters();\n\tpa...
{ "fields": [ { "declarator": "LOG = Logger.getLogger(AnnotationUtils.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = Logger.getLogger(AnnotationUtils.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "SE...
{ "body": "public Map<String, Object> createAnnotationPage(String query, List<W3CAnnotation> annoList, boolean isW3c,\n\t PageParameters pageParams, int totalHits, boolean isMixedSearch) {\n\n\tif (null == annoList || annoList.isEmpty()) {\n\t return null;\n\t}\n\n\tMap<String, Object> root;\n\n\tif (isMixedSea...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }
75735839_38
{ "fields": [ { "declarator": "controller", "modifier": "", "original_string": "OATextSearchController controller;", "type": "OATextSearchController", "var_name": "controller" }, { "declarator": "textSearchService", "modifier": "private", "original_string": ...
{ "body": "@Test\n public void testAutocompleteGet() throws UnsupportedEncodingException {\n\tString queryNotFound = \"not found\";\n\tString motivation = null;\n\tString date = null;\n\tString user = null;\n\tString min = null;\n\tServiceResponse notFoundResponse = new ServiceResponse(Status.NOT_FOUND, null);\n\n...
{ "fields": [ { "declarator": "CONTROLLER_NAME = \"OATextSearchController\"", "modifier": "public static final", "original_string": "public static final String CONTROLLER_NAME = \"OATextSearchController\";", "type": "String", "var_name": "CONTROLLER_NAME" }, { "declarat...
{ "body": "@CrossOrigin\n\t@RequestMapping(value = OA_TEXT_AUTOCOMPLETE_REQUEST_PATH, method = RequestMethod.GET)\n\tpublic ResponseEntity<Map<String, Object>> autocompleteTextOAGet(\n\t\t\t@RequestParam(value = AnnotationSearchConstants.PARAM_FIELD_QUERY, required = true) String query,\n\t\t\t@RequestParam(value = P...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 75735839, "size": 412, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/dlcs/the-mathmos-server" }