id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
62117812_74
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/AvroSchemaTest.java", "identifier": "AvroSchemaTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNotAllowNullEncodeAndDecode() {\n AvroSchema<Foo> avroSchema = AvroSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).withAlwaysAllowNull(false).build());\n\n Foo foo1 = new Foo();\n foo1.setField1(\"foo1\");\n foo1.setField2(\"bar1\");\n ...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(AvroSchema.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(AvroSchema.class);", "type": "Logger", "var_name": "LOG" }, { "declarator":...
{ "body": "public static <T> AvroSchema<T> of(SchemaDefinition<T> schemaDefinition) {\n ClassLoader pojoClassLoader = null;\n if (schemaDefinition.getPojo() != null) {\n pojoClassLoader = schemaDefinition.getPojo().getClassLoader();\n }\n return new AvroSchema<>(parseSchemaInfo(...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_324
{ "fields": [], "file": "pulsar-io/mongo/src/test/java/org/apache/pulsar/io/mongodb/MongoConfigTest.java", "identifier": "MongoConfigTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testYaml() throws IOException {\n final File yaml = getFile(\"mongoSinkConfig.yaml\");\n final MongoConfig cfg = MongoConfig.load(yaml.getAbsolutePath());\n\n assertEquals(cfg.getMongoUri(), TestHelper.URI);\n assertEquals(cfg.getDatabase(), TestHelper.DB)...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "DEFAULT_BATCH_SIZE = 100", "modifie...
{ "body": "public static MongoConfig load(String yamlFile) throws IOException {\n final ObjectMapper mapper = new ObjectMapper(new YAMLFactory());\n final MongoConfig cfg = mapper.readValue(new File(yamlFile), MongoConfig.class);\n\n return cfg;\n }", "class_method_signature": "MongoConfig.l...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_261
{ "fields": [], "file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/ExceptionsTest.java", "identifier": "ExceptionsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testRethrowErrorAsIOException() throws IOException {\n Error error = new Error(\"test\");\n try {\n rethrowIOException(error);\n fail(\"Should rethrow Error\");\n } catch (Error e) {\n assertSame(error, e);\n }\n }", "...
{ "fields": [], "file": "pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/Exceptions.java", "identifier": "Exceptions", "interfaces": "", "methods": [ { "class_method_signature": "Exceptions.rethrowIOException(Throwable cause)", "constructor": false, "full_signature...
{ "body": "public static void rethrowIOException(Throwable cause)\n throws IOException {\n if (cause instanceof IOException) {\n throw (IOException) cause;\n } else if (cause instanceof RuntimeException) {\n throw (RuntimeException) cause;\n } else if (cause insta...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_518
{ "fields": [], "file": "pulsar-common/src/test/java/org/apache/pulsar/common/util/RateLimiterTest.java", "identifier": "RateLimiterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testclose() throws Exception {\n RateLimiter rate = new RateLimiter(1, 1000, TimeUnit.MILLISECONDS);\n assertFalse(rate.isClosed());\n rate.close();\n assertTrue(rate.isClosed());\n try {\n rate.acquire();\n fail(\"should have ...
{ "fields": [ { "declarator": "executorService", "modifier": "private final", "original_string": "private final ScheduledExecutorService executorService;", "type": "ScheduledExecutorService", "var_name": "executorService" }, { "declarator": "rateTime", "modifier":...
{ "body": "@Override\n public synchronized void close() {\n if (!isClosed) {\n if (!externalExecutor) {\n executorService.shutdownNow();\n }\n if (renewTask != null) {\n renewTask.cancel(false);\n }\n isClosed = true;\n ...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_148
{ "fields": [], "file": "pulsar-functions/runtime/src/test/java/org/apache/pulsar/functions/runtime/RuntimeUtilsTest.java", "identifier": "RuntimeUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSplitRuntimeArgs() {\n String str1 = \"-Xms314572800\";\n String[] result = RuntimeUtils.splitRuntimeArgs(str1);\n Assert.assertEquals(result.length,1);\n Assert.assertEquals(result[0], str1);\n\n String str2 = \"-Xms314572800 -Dbar=foo\";\n ...
{ "fields": [ { "declarator": "FUNCTIONS_EXTRA_DEPS_PROPERTY = \"pulsar.functions.extra.dependencies.dir\"", "modifier": "private static final", "original_string": "private static final String FUNCTIONS_EXTRA_DEPS_PROPERTY = \"pulsar.functions.extra.dependencies.dir\";", "type": "String", ...
{ "body": "public static String[] splitRuntimeArgs(String input) {\n return input.split(\"\\\\s(?=([^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)\");\n }", "class_method_signature": "RuntimeUtils.splitRuntimeArgs(String input)", "constructor": false, "full_signature": "public static String[] splitRuntimeArgs(St...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_62
{ "fields": [ { "declarator": "TOPIC_NAME = \"testTopicName\"", "modifier": "private static final", "original_string": "private static final String TOPIC_NAME = \"testTopicName\";", "type": "String", "var_name": "TOPIC_NAME" }, { "declarator": "consumerBuilderImpl", ...
{ "body": "@Test(expectedExceptions = IllegalArgumentException.class)\n public void testConsumerBuilderImplWhenNegativeAckRedeliveryDelayPropertyIsNegative() {\n consumerBuilderImpl.negativeAckRedeliveryDelay(-1, TimeUnit.MILLISECONDS);\n }", "class_method_signature": "ConsumerBuilderImplTest.testConsu...
{ "fields": [ { "declarator": "client", "modifier": "private final", "original_string": "private final PulsarClientImpl client;", "type": "PulsarClientImpl", "var_name": "client" }, { "declarator": "conf", "modifier": "private", "original_string": "private C...
{ "body": "@Override\n public ConsumerBuilder<T> negativeAckRedeliveryDelay(long redeliveryDelay, TimeUnit timeUnit) {\n checkArgument(redeliveryDelay >= 0, \"redeliveryDelay needs to be >= 0\");\n conf.setNegativeAckRedeliveryDelayMicros(timeUnit.toMicros(redeliveryDelay));\n return this;\n ...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_373
{ "fields": [], "file": "pulsar-sql/presto-pulsar/src/test/java/org/apache/pulsar/sql/presto/TestAvroSchemaHandler.java", "identifier": "TestAvroSchemaHandler", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testAvroSchemaHandler() throws IOException {\n List<PulsarColumnHandle> columnHandles = new ArrayList();\n RawMessage message = mock(RawMessage.class);\n Schema schema1 = ReflectData.AllowNull.get().getSchema(Foo1.class);\n PulsarSqlSchemaInfoProvider puls...
{ "fields": [ { "declarator": "columnHandles", "modifier": "private final", "original_string": "private final List<PulsarColumnHandle> columnHandles;", "type": "List<PulsarColumnHandle>", "var_name": "columnHandles" }, { "declarator": "genericAvroSchema", "modifie...
{ "body": "AvroSchemaHandler(TopicName topicName,\n PulsarConnectorConfig pulsarConnectorConfig,\n SchemaInfo schemaInfo,\n List<PulsarColumnHandle> columnHandles) throws PulsarClientException {\n this(new PulsarSqlSchemaInfoProvider(topicName,\n ...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_236
{ "fields": [], "file": "pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionConfigUtilsTest.java", "identifier": "FunctionConfigUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = \"Input Topics cannot be altered\")\n public void testMergeDifferentInputs() {\n FunctionConfig functionConfig = createFunctionConfig();\n FunctionConfig newFunctionConfig = createUpdatedFunctionCo...
{ "fields": [ { "declarator": "MAX_PENDING_ASYNC_REQUESTS_DEFAULT = Integer.valueOf(1000)", "modifier": "static final", "original_string": "static final Integer MAX_PENDING_ASYNC_REQUESTS_DEFAULT = Integer.valueOf(1000);", "type": "Integer", "var_name": "MAX_PENDING_ASYNC_REQUESTS_DE...
{ "body": "public static FunctionConfig validateUpdate(FunctionConfig existingConfig, FunctionConfig newConfig) {\n FunctionConfig mergedConfig = existingConfig.toBuilder().build();\n if (!existingConfig.getTenant().equals(newConfig.getTenant())) {\n throw new IllegalArgumentException(\"Tenan...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_35
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/conf/ConfigurationDataUtilsTest.java", "identifier": "ConfigurationDataUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testLoadConsumerConfigurationData() {\n ConsumerConfigurationData confData = new ConsumerConfigurationData();\n confData.setSubscriptionName(\"unknown-subscription\");\n confData.setPriorityLevel(10000);\n confData.setConsumerName(\"unknown-consumer\");\n ...
{ "fields": [ { "declarator": "mapper = new FastThreadLocal<ObjectMapper>() {\n @Override\n protected ObjectMapper initialValue() throws Exception {\n return create();\n }\n }", "modifier": "private static final", "original_string": "private static final FastTh...
{ "body": "public static <T> T loadData(Map<String, Object> config,\n T existingData,\n Class<T> dataCls) {\n ObjectMapper mapper = getThreadLocal();\n try {\n String existingConfigJson = mapper.writeValueAsString(existingData);\...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_308
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(BlobStoreManagedLedgerOffloaderTest.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(BlobStoreManagedLedgerOffloaderTest.class);", "type": "Logger", ...
{ "body": "@Test\n public void testOffloadEmpty() throws Exception {\n CompletableFuture<LedgerEntries> noEntries = new CompletableFuture<>();\n noEntries.completeExceptionally(new BKException.BKReadException());\n\n ReadHandle readHandle = Mockito.mock(ReadHandle.class);\n Mockito.doRe...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(BlobStoreManagedLedgerOffloader.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(BlobStoreManagedLedgerOffloader.class);", "type": "Logger", "var_nam...
{ "body": "@Override\n public CompletableFuture<Void> offload(ReadHandle readHandle,\n UUID uuid,\n Map<String, String> extraMetadata) {\n CompletableFuture<Void> promise = new CompletableFuture<>();\n scheduler.choos...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_471
{ "fields": [], "file": "pulsar-broker/src/test/java/org/apache/pulsar/broker/BookKeeperClientFactoryImplTest.java", "identifier": "BookKeeperClientFactoryImplTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSetDefaultEnsemblePlacementPolicyRackAwareEnabledChangedValues() {\n AtomicReference<ZooKeeperCache> rackawarePolicyZkCache = new AtomicReference<>();\n AtomicReference<ZooKeeperCache> clientIsolationZkCache = new AtomicReference<>();\n ClientConfiguration bk...
{ "fields": [ { "declarator": "rackawarePolicyZkCache = new AtomicReference<>()", "modifier": "private final", "original_string": "private final AtomicReference<ZooKeeperCache> rackawarePolicyZkCache = new AtomicReference<>();", "type": "AtomicReference<ZooKeeperCache>", "var_name": ...
{ "body": "public static void setDefaultEnsemblePlacementPolicy(\n AtomicReference<ZooKeeperCache> rackawarePolicyZkCache,\n AtomicReference<ZooKeeperCache> clientIsolationZkCache,\n ClientConfiguration bkConf,\n ServiceConfiguration conf,\n ZooKeeper zkClient\n ) {\n if (...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_164
{ "fields": [ { "declarator": "testWindowedPulsarFunction", "modifier": "private", "original_string": "private TestWindowFunctionExecutor testWindowedPulsarFunction;", "type": "TestWindowFunctionExecutor", "var_name": "testWindowedPulsarFunction" }, { "declarator": "con...
{ "body": "@Test\n public void testExecuteWithLateTupleStream() throws Exception {\n\n windowConfig.setLateDataTopic(\"$late\");\n doReturn(Optional.of(new Gson().fromJson(new Gson().toJson(windowConfig), Map.class)))\n .when(context).getUserConfigValue(WindowConfig.WINDOW_CONFIG_KEY);...
{ "fields": [ { "declarator": "initialized", "modifier": "private", "original_string": "private boolean initialized;", "type": "boolean", "var_name": "initialized" }, { "declarator": "windowConfig", "modifier": "protected", "original_string": "protected Wind...
{ "body": "@Override\n public O process(I input, Context context) throws Exception {\n if (!this.initialized) {\n initialize(context);\n }\n\n Record<I> record = (Record<I>)context.getCurrentRecord();\n\n if (isEventTime()) {\n long ts = this.timestampExtractor.ext...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_534
{ "fields": [ { "declarator": "channel", "modifier": "@Mock\n private", "original_string": "@Mock\n private Channel channel;", "type": "Channel", "var_name": "channel" }, { "declarator": "eventLoop", "modifier": "private", "original_string": "private D...
{ "body": "@Test(expectedExceptions = NullPointerException.class)\n public void toCompletableFuture_shouldRequireNonNullArgument() {\n ChannelFutures.toCompletableFuture(null);\n }", "class_method_signature": "ChannelFuturesTest.toCompletableFuture_shouldRequireNonNullArgument()", "constructor": fals...
{ "fields": [], "file": "pulsar-common/src/main/java/org/apache/pulsar/common/util/netty/ChannelFutures.java", "identifier": "ChannelFutures", "interfaces": "", "methods": [ { "class_method_signature": "ChannelFutures.ChannelFutures()", "constructor": true, "full_signature": "private Ch...
{ "body": "public static CompletableFuture<Channel> toCompletableFuture(ChannelFuture channelFuture) {\n Objects.requireNonNull(channelFuture, \"channelFuture cannot be null\");\n\n CompletableFuture<Channel> adapter = new CompletableFuture<>();\n if (channelFuture.isDone()) {\n if (ch...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_426
{ "fields": [ { "declarator": "pulsarMock", "modifier": "private", "original_string": "private PulsarService pulsarMock;", "type": "PulsarService", "var_name": "pulsarMock" }, { "declarator": "brokerMock", "modifier": "private", "original_string": "private B...
{ "body": "@Test\n public void testSendMarkerMessage() {\n try {\n persistentDispatcher.addConsumer(consumerMock);\n persistentDispatcher.consumerFlow(consumerMock, 1000);\n } catch (Exception e) {\n fail(\"Failed to add mock consumer\", e);\n }\n\n List...
{ "fields": [ { "declarator": "allowOutOfOrderDelivery", "modifier": "private final", "original_string": "private final boolean allowOutOfOrderDelivery;", "type": "boolean", "var_name": "allowOutOfOrderDelivery" }, { "declarator": "selector", "modifier": "private ...
{ "body": "@Override\n public synchronized void addConsumer(Consumer consumer) throws BrokerServiceException {\n super.addConsumer(consumer);\n try {\n selector.addConsumer(consumer);\n } catch (BrokerServiceException e) {\n consumerSet.removeAll(consumer);\n c...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_19
{ "fields": [], "file": "pulsar-client/src/test/java/org/apache/pulsar/client/impl/SinglePartitionMessageRouterImplTest.java", "identifier": "SinglePartitionMessageRouterImplTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testChoosePartitionWithKey() {\n String key1 = \"key1\";\n String key2 = \"key2\";\n Message<?> msg1 = mock(Message.class);\n when(msg1.hasKey()).thenReturn(true);\n when(msg1.getKey()).thenReturn(key1);\n Message<?> msg2 = mock(Message.class...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "partitionIndex", "modifier": "priva...
{ "body": "@Override\n public int choosePartition(Message<?> msg, TopicMetadata metadata) {\n // If the message has a key, it supersedes the single partition routing policy\n if (msg.hasKey()) {\n return signSafeMod(hash.makeHash(msg.getKey()), metadata.numPartitions());\n }\n\n ...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_563
{ "fields": [], "file": "pulsar-common/src/test/java/org/apache/pulsar/common/util/RelativeTimeUtilTest.java", "identifier": "RelativeTimeUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testParseRelativeTime() {\n assertEquals(RelativeTimeUtil.parseRelativeTimeInSeconds(\"-1\"), -1);\n assertEquals(RelativeTimeUtil.parseRelativeTimeInSeconds(\"7\"), 7);\n assertEquals(RelativeTimeUtil.parseRelativeTimeInSeconds(\"3s\"), 3);\n assertEquals...
{ "fields": [], "file": "pulsar-common/src/main/java/org/apache/pulsar/common/util/RelativeTimeUtil.java", "identifier": "RelativeTimeUtil", "interfaces": "", "methods": [ { "class_method_signature": "RelativeTimeUtil.parseRelativeTimeInSeconds(String relativeTime)", "constructor": false, ...
{ "body": "public static long parseRelativeTimeInSeconds(String relativeTime) {\n if (relativeTime.isEmpty()) {\n throw new IllegalArgumentException(\"exipiry time cannot be empty\");\n }\n\n int lastIndex = relativeTime.length() - 1;\n char lastChar = relativeTime.charAt(lastI...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_133
{ "fields": [ { "declarator": "tenant = \"test-tenant\"", "modifier": "private static final", "original_string": "private static final String tenant = \"test-tenant\";", "type": "String", "var_name": "tenant" }, { "declarator": "namespace = \"test-namespace\"", "m...
{ "body": "@Test\n public void testStatusEmpty() {\n assertNotNull(this.resource.getFunctionInstanceStatus(tenant, namespace, function, \"0\", null, null, null));\n }", "class_method_signature": "FunctionsImplTest.testStatusEmpty()", "constructor": false, "full_signature": "@Test public void testSt...
{ "fields": [], "file": "pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/FunctionsImpl.java", "identifier": "FunctionsImpl", "interfaces": "", "methods": [ { "class_method_signature": "FunctionsImpl.FunctionsImpl(Supplier<WorkerService> workerServiceSupplier)", ...
{ "body": "public FunctionStatus.FunctionInstanceStatus.FunctionInstanceStatusData getFunctionInstanceStatus(final String tenant,\n final String namespace,\n ...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_349
{ "fields": [], "file": "pulsar-io/flume/src/test/java/org/apache/pulsar/io/flume/node/TestAbstractConfigurationProvider.java", "identifier": "TestAbstractConfigurationProvider", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testChannelThrowsExceptionDuringConfiguration() throws Exception {\n String agentName = \"agent1\";\n String sourceType = \"seq\";\n String channelType = UnconfigurableChannel.class.getName();\n String sinkType = \"null\";\n Map<String, String> prop...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(AbstractConfigurationProvider.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(AbstractConfigurationProvider.class);", "type": "Logger", "var_n...
{ "body": "public MaterializedConfiguration getConfiguration() {\n MaterializedConfiguration conf = new SimpleMaterializedConfiguration();\n FlumeConfiguration fconfig = getFlumeConfiguration();\n AgentConfiguration agentConf = fconfig.getConfigurationFor(getAgentName());\n if (agentConf !...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_430
{ "fields": [ { "declarator": "TLS_SERVER_CERT_FILE_PATH = \"./src/test/resources/certificate/server.crt\"", "modifier": "private final", "original_string": "private final String TLS_SERVER_CERT_FILE_PATH = \"./src/test/resources/certificate/server.crt\";", "type": "String", "var_nam...
{ "body": "@Test\n public void testTlsEnabled() throws Exception {\n final String topicName = \"persistent://prop/ns-abc/newTopic\";\n final String subName = \"newSub\";\n\n conf.setAuthenticationEnabled(false);\n conf.setBrokerServicePortTls(Optional.of(0));\n conf.setWebService...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(BrokerService.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(BrokerService.class);", "type": "Logger", "var_name": "log" }, { "declar...
{ "body": "@Override\n public void close() throws IOException {\n log.info(\"Shutting down Pulsar Broker service\");\n\n if (pulsar.getConfigurationCache() != null) {\n pulsar.getConfigurationCache().policiesCache().unregisterListener(this);\n }\n\n // unloads all namespaces ...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_125
{ "fields": [ { "declarator": "testStringList = Arrays.asList(new String[]{\"foo\", \"bar\"})", "modifier": "private final", "original_string": "private final List<String> testStringList = Arrays.asList(new String[]{\"foo\", \"bar\"});", "type": "List<String>", "var_name": "testStrin...
{ "body": "@Test\n public void testListEntry() {\n TestConfig testConfig = createGoodConfig();\n testConfig.integerList = testStringList;\n Exception e = expectThrows(IllegalArgumentException.class, () -> ConfigValidation.validateConfig(testConfig));\n assertTrue(e.getMessage().contains...
{ "fields": [ { "declarator": "DEFAULT_ANNOTATION_CLASS = ConfigValidationAnnotations.class", "modifier": "private static final", "original_string": "private static final Class DEFAULT_ANNOTATION_CLASS = ConfigValidationAnnotations.class;", "type": "Class", "var_name": "DEFAULT_ANNOT...
{ "body": "public static void validateConfig(Object config, Class annotationClass) {\n for (Field field : config.getClass().getDeclaredFields()) {\n Object value = null;\n field.setAccessible(true);\n try {\n value = field.get(config);\n } catch (Illeg...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_575
{ "fields": [], "file": "pulsar-common/src/test/java/org/apache/pulsar/common/policies/data/ReplicatorStatsTest.java", "identifier": "ReplicatorStatsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testReplicatorStatsAdd() {\n ReplicatorStats replicatorStats = new ReplicatorStats();\n replicatorStats.msgRateIn = 5;\n replicatorStats.msgThroughputIn = 10;\n replicatorStats.msgRateOut = 5;\n replicatorStats.msgThroughputOut = 10;\n replic...
{ "fields": [ { "declarator": "msgRateIn", "modifier": "public", "original_string": "public double msgRateIn;", "type": "double", "var_name": "msgRateIn" }, { "declarator": "msgThroughputIn", "modifier": "public", "original_string": "public double msgThrough...
{ "body": "public ReplicatorStats add(ReplicatorStats stats) {\n checkNotNull(stats);\n this.msgRateIn += stats.msgRateIn;\n this.msgThroughputIn += stats.msgThroughputIn;\n this.msgRateOut += stats.msgRateOut;\n this.msgThroughputOut += stats.msgThroughputOut;\n this.msgRate...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_467
{ "fields": [], "file": "pulsar-broker/src/test/java/org/apache/pulsar/broker/web/RestExceptionTest.java", "identifier": "RestExceptionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testWebApplicationException() {\n WebApplicationException wae = new WebApplicationException(\"test web application exception\", Status.TEMPORARY_REDIRECT);\n RestException testException = new RestException(wae);\n\n assertEquals(Status.TEMPORARY_REDIRECT.getStatu...
{ "fields": [], "file": "pulsar-broker/src/main/java/org/apache/pulsar/broker/web/RestException.java", "identifier": "RestException", "interfaces": "", "methods": [ { "class_method_signature": "RestException.getExceptionData(Throwable t)", "constructor": false, "full_signature": "static ...
{ "body": "private static Response getResponse(Throwable t) {\n if (t instanceof WebApplicationException) {\n WebApplicationException e = (WebApplicationException) t;\n return e.getResponse();\n } else {\n return Response\n .status(Status.INTERNAL_SERVER_E...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_58
{ "fields": [ { "declarator": "TOPIC_NAME = \"testTopicName\"", "modifier": "private static final", "original_string": "private static final String TOPIC_NAME = \"testTopicName\";", "type": "String", "var_name": "TOPIC_NAME" }, { "declarator": "consumerBuilderImpl", ...
{ "body": "@Test(expectedExceptions = IllegalArgumentException.class)\n public void testConsumerBuilderImplWhenTopicNamesIsNull() {\n consumerBuilderImpl.topics(null);\n }", "class_method_signature": "ConsumerBuilderImplTest.testConsumerBuilderImplWhenTopicNamesIsNull()", "constructor": false, "ful...
{ "fields": [ { "declarator": "client", "modifier": "private final", "original_string": "private final PulsarClientImpl client;", "type": "PulsarClientImpl", "var_name": "client" }, { "declarator": "conf", "modifier": "private", "original_string": "private C...
{ "body": "@Override\n public ConsumerBuilder<T> topics(List<String> topicNames) {\n checkArgument(topicNames != null && !topicNames.isEmpty(),\n \"Passed in topicNames list should not be null or empty.\");\n topicNames.stream().forEach(topicName ->\n checkArgument(Strin...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_522
{ "fields": [ { "declarator": "classLoader", "modifier": "private final", "original_string": "private final ClassLoader classLoader;", "type": "ClassLoader", "var_name": "classLoader" } ], "file": "pulsar-common/src/test/java/org/apache/pulsar/common/util/ReflectionsTest.java...
{ "body": "@Test\n public void testCreateInstanceClassNotFound() {\n try {\n createInstance(\"notfound-class\", classLoader);\n fail(\"Should fail to load notfound class\");\n } catch (RuntimeException re) {\n assertTrue(re.getCause() instanceof ClassNotFoundException...
{ "fields": [ { "declarator": "constructorCache =\n new ConcurrentHashMap<>()", "modifier": "private static final", "original_string": "private static final Map<Class<?>, Constructor<?>> constructorCache =\n new ConcurrentHashMap<>();", "type": "Map<Class<?>, Constructor<?>>"...
{ "body": "public static <T> T createInstance(String userClassName,\n Class<T> xface,\n ClassLoader classLoader) {\n Class<?> theCls;\n try {\n theCls = Class.forName(userClassName, true, classLoader);\n } catc...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_172
{ "fields": [], "file": "pulsar-functions/instance/src/test/java/org/apache/pulsar/functions/instance/InstanceUtilsTest.java", "identifier": "InstanceUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testCalculateSubjectTypeForSink() {\n FunctionDetails.Builder builder = FunctionDetails.newBuilder();\n // an input and a sink classname is a sink\n builder.setSource(Function.SourceSpec.newBuilder().putInputSpecs(\"topic\", Function.ConsumerSpec.newBuilder().bui...
{ "fields": [], "file": "pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/InstanceUtils.java", "identifier": "InstanceUtils", "interfaces": "", "methods": [ { "class_method_signature": "InstanceUtils.initializeSerDe(String serdeClassName, ClassLoader clsLoader, Class<?> t...
{ "body": "public Function.FunctionDetails.ComponentType calculateSubjectType(Function.FunctionDetails functionDetails) {\n if (functionDetails.getComponentType() != Function.FunctionDetails.ComponentType.UNKNOWN) {\n return functionDetails.getComponentType();\n }\n Function.SourceSpec...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
62117812_488
{ "fields": [], "file": "pulsar-broker/src/test/java/org/apache/pulsar/PulsarBrokerStarterTest.java", "identifier": "PulsarBrokerStarterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testMainRunBookieAndAutoRecoveryNoConfig() throws Exception {\n try {\n File testConfigFile = createValidBrokerConfigFile();\n String[] args = {\"-c\", testConfigFile.getAbsolutePath(), \"-rb\", \"-ra\", \"-bc\", \"\"};\n PulsarBrokerStarter.ma...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(PulsarBrokerStarter.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(PulsarBrokerStarter.class);", "type": "Logger", "var_name": "log" } ], "...
{ "body": "public static void main(String[] args) throws Exception {\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss,SSS\");\n Thread.setDefaultUncaughtExceptionHandler((thread, exception) -> {\n System.out.println(String.format(\"%s [%s] error Uncaught exception in threa...
{ "created": "6/28/2016 7:00:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62117812, "size": null, "stargazer_count": null, "stars": 5004, "updates": "2020-01-27T18:49:26+00:00", "url": "https://github.com/apache/pulsar" ...
27344072_0
{ "fields": [], "file": "ph-bdve-json/src/test/java/com/helger/bdve/json/BDVEJsonHelperTest.java", "identifier": "BDVEJsonHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGlobalError ()\n {\n final IJsonObject aObj = new JsonObject ();\n BDVEJsonHelper.applyGlobalError (aObj, \"My error\", 123);\n final String sJson = aObj.getAsJsonString ();\n assertEquals (\"{\\\"success\\\":false,\" +\n \"\\\"interrupted\\\":false,\"...
{ "fields": [ { "declarator": "JSON_ERRORLEVEL_SUCCESS = \"SUCCESS\"", "modifier": "public static final", "original_string": "public static final String JSON_ERRORLEVEL_SUCCESS = \"SUCCESS\";", "type": "String", "var_name": "JSON_ERRORLEVEL_SUCCESS" }, { "declarator": "...
{ "body": "public static void applyGlobalError (@Nonnull final IJsonObject aResponse,\n @Nonnull final String sErrorMsg,\n @Nonnegative final long nDurationMilliseconds)\n {\n ValueEnforcer.notNull (aResponse, \"Response\");\n ValueEnf...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27344072, "size": 182771, "stargazer_count": 11, "stars": null, "updates": null, "url": "https://github.com/phax/ph-bdve" }
27344072_1
{ "fields": [], "file": "ph-bdve-json/src/test/java/com/helger/bdve/json/BDVEJsonHelperTest.java", "identifier": "BDVEJsonHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testValidationResults ()\n {\n final IJsonObject aObj = new JsonObject ();\n final Locale aDisplayLocale = Locale.US;\n final VESID aVESID = new VESID (\"group\", \"art\", \"1.0\");\n final IValidationExecutorSet <?> aVES = new ValidationExecutorSet <> (aVESID, \"name\", f...
{ "fields": [ { "declarator": "JSON_ERRORLEVEL_SUCCESS = \"SUCCESS\"", "modifier": "public static final", "original_string": "public static final String JSON_ERRORLEVEL_SUCCESS = \"SUCCESS\";", "type": "String", "var_name": "JSON_ERRORLEVEL_SUCCESS" }, { "declarator": "...
{ "body": "public static void applyValidationResultList (@Nonnull final IJsonObject aResponse,\n @Nonnull final IValidationExecutorSet <?> aVES,\n @Nonnull final List <? extends ValidationResult> aValidationResultList,\n ...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27344072, "size": 182771, "stargazer_count": 11, "stars": null, "updates": null, "url": "https://github.com/phax/ph-bdve" }
27344072_2
{ "fields": [], "file": "ph-bdve-json/src/test/java/com/helger/bdve/json/BDVEJsonHelperTest.java", "identifier": "BDVEJsonHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testException ()\n {\n final Exception ex = new IllegalArgumentException (\"bla foo\");\n\n // to Json\n final IJsonObject aObj = BDVEJsonHelper.getJsonStackTrace (ex);\n assertNotNull (aObj);\n }", "class_method_signature": "BDVEJsonHelperTest.testException()", "cons...
{ "fields": [ { "declarator": "JSON_ERRORLEVEL_SUCCESS = \"SUCCESS\"", "modifier": "public static final", "original_string": "public static final String JSON_ERRORLEVEL_SUCCESS = \"SUCCESS\";", "type": "String", "var_name": "JSON_ERRORLEVEL_SUCCESS" }, { "declarator": "...
{ "body": "@Nullable\n public static IJsonObject getJsonStackTrace (@Nullable final Throwable t)\n {\n if (t == null)\n return null;\n if (t instanceof BDVERestoredException)\n return ((BDVERestoredException) t).getAsJson ();\n return new JsonObject ().add (JSON_CLASS, t.getClass ().getName ())\n...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27344072, "size": 182771, "stargazer_count": 11, "stars": null, "updates": null, "url": "https://github.com/phax/ph-bdve" }
27344072_3
{ "fields": [], "file": "ph-bdve-api/src/test/java/com/helger/bdve/api/executorset/VESIDTest.java", "identifier": "VESIDTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsValid ()\n {\n assertTrue (VESID.isValidPart (\"com\"));\n assertTrue (VESID.isValidPart (\"com.helger\"));\n assertTrue (VESID.isValidPart (\"01234\"));\n assertTrue (VESID.isValidPart (\"1.2.3.4.5\"));\n assertTrue (VESID.isValidPart (\"ph-as4\"));\n assertTr...
{ "fields": [ { "declarator": "REGEX_PART = \"[a-zA-Z0-9_\\\\-\\\\.]+\"", "modifier": "@RegEx\n public static final", "original_string": "@RegEx\n public static final String REGEX_PART = \"[a-zA-Z0-9_\\\\-\\\\.]+\";", "type": "String", "var_name": "REGEX_PART" }, { "d...
{ "body": "public static boolean isValidPart (@Nullable final String sPart)\n {\n return StringHelper.hasText (sPart) && RegExHelper.stringMatchesPattern (REGEX_PART, sPart);\n }", "class_method_signature": "VESID.isValidPart(@Nullable final String sPart)", "constructor": false, "full_signature": "public s...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27344072, "size": 182771, "stargazer_count": 11, "stars": null, "updates": null, "url": "https://github.com/phax/ph-bdve" }
27344072_4
{ "fields": [], "file": "ph-bdve-api/src/test/java/com/helger/bdve/api/executorset/VESIDTest.java", "identifier": "VESIDTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testParseID ()\n {\n final VESID aID1 = new VESID (\"com.helger\", \"ph-bdve\", \"3.0.0-SNAPSHOT\");\n final VESID aID2 = aID1.getWithClassifier (\"test\");\n\n assertEquals (aID1, VESID.parseIDOrNull (aID1.getAsSingleID ()));\n assertEquals (aID1, VESID.parseIDOrNull (aID...
{ "fields": [ { "declarator": "REGEX_PART = \"[a-zA-Z0-9_\\\\-\\\\.]+\"", "modifier": "@RegEx\n public static final", "original_string": "@RegEx\n public static final String REGEX_PART = \"[a-zA-Z0-9_\\\\-\\\\.]+\";", "type": "String", "var_name": "REGEX_PART" }, { "d...
{ "body": "@Nonnull\n public static VESID parseID (@Nullable final String sVESID)\n {\n final ICommonsList <String> aParts = StringHelper.getExploded (ID_SEPARATOR, sVESID);\n final int nSize = aParts.size ();\n if (nSize >= 3 && nSize <= 4)\n return new VESID (aParts.get (0), aParts.get (1), aParts.g...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27344072, "size": 182771, "stargazer_count": 11, "stars": null, "updates": null, "url": "https://github.com/phax/ph-bdve" }
41351929_11
{ "fields": [ { "declarator": "transportMappingCG", "modifier": "private", "original_string": "private DummyTransport<UdpAddress> transportMappingCG;", "type": "DummyTransport<UdpAddress>", "var_name": "transportMappingCG" }, { "declarator": "transportMappingCR", ...
{ "body": "@Test\n public void testInformV3AsyncWithRetry() throws Exception {\n UserTarget target = (UserTarget) userTarget.clone();\n target.setRetries(2);\n target.setTimeout(1200);\n target.setVersion(SnmpConstants.version3);\n ScopedPDU pdu = new ScopedPDU();\n pdu.setType(PDU.INFORM);\n pd...
{ "fields": [ { "declarator": "logger = LogFactory.getLogger(Snmp.class)", "modifier": "private static final", "original_string": "private static final LogAdapter logger = LogFactory.getLogger(Snmp.class);", "type": "LogAdapter", "var_name": "logger" }, { "declarator": ...
{ "body": "public int getNextRequestID() {\n return messageDispatcher.getNextRequestID();\n }", "class_method_signature": "Snmp.getNextRequestID()", "constructor": false, "full_signature": "public int getNextRequestID()", "identifier": "getNextRequestID", "invocations": [ "getNextRequestID" ], "...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 41351929, "size": 3328, "stargazer_count": 7, "stars": null, "updates": null, "url": "https://github.com/GEBIT/snmp4j" }
41351929_7
{ "fields": [ { "declarator": "transportMappingCG", "modifier": "private", "original_string": "private DummyTransport<UdpAddress> transportMappingCG;", "type": "DummyTransport<UdpAddress>", "var_name": "transportMappingCG" }, { "declarator": "transportMappingCR", ...
{ "body": "@Test\n public void testInformV3() throws Exception {\n UserTarget target = (UserTarget) userTarget.clone();\n target.setTimeout(10000);\n target.setVersion(SnmpConstants.version3);\n ScopedPDU pdu = new ScopedPDU();\n pdu.setType(PDU.INFORM);\n pdu.setContextName(new OctetString(\"myCon...
{ "fields": [ { "declarator": "logger = LogFactory.getLogger(Snmp.class)", "modifier": "private static final", "original_string": "private static final LogAdapter logger = LogFactory.getLogger(Snmp.class);", "type": "LogAdapter", "var_name": "logger" }, { "declarator": ...
{ "body": "public int getNextRequestID() {\n return messageDispatcher.getNextRequestID();\n }", "class_method_signature": "Snmp.getNextRequestID()", "constructor": false, "full_signature": "public int getNextRequestID()", "identifier": "getNextRequestID", "invocations": [ "getNextRequestID" ], "...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 41351929, "size": 3328, "stargazer_count": 7, "stars": null, "updates": null, "url": "https://github.com/GEBIT/snmp4j" }
41351929_6
{ "fields": [ { "declarator": "transportMappingCG", "modifier": "private", "original_string": "private DummyTransport<UdpAddress> transportMappingCG;", "type": "DummyTransport<UdpAddress>", "var_name": "transportMappingCG" }, { "declarator": "transportMappingCR", ...
{ "body": "@Test\n public void testInformV2c() throws Exception {\n CommunityTarget target = (CommunityTarget) communityTarget.clone();\n target.setVersion(SnmpConstants.version2c);\n PDU pdu = new PDU();\n pdu.setType(PDU.INFORM);\n addTestVariableBindings(pdu, true, false, target.getVersion());\n ...
{ "fields": [ { "declarator": "logger = LogFactory.getLogger(Snmp.class)", "modifier": "private static final", "original_string": "private static final LogAdapter logger = LogFactory.getLogger(Snmp.class);", "type": "LogAdapter", "var_name": "logger" }, { "declarator": ...
{ "body": "public int getNextRequestID() {\n return messageDispatcher.getNextRequestID();\n }", "class_method_signature": "Snmp.getNextRequestID()", "constructor": false, "full_signature": "public int getNextRequestID()", "identifier": "getNextRequestID", "invocations": [ "getNextRequestID" ], "...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 41351929, "size": 3328, "stargazer_count": 7, "stars": null, "updates": null, "url": "https://github.com/GEBIT/snmp4j" }
41351929_10
{ "fields": [ { "declarator": "transportMappingCG", "modifier": "private", "original_string": "private DummyTransport<UdpAddress> transportMappingCG;", "type": "DummyTransport<UdpAddress>", "var_name": "transportMappingCG" }, { "declarator": "transportMappingCR", ...
{ "body": "@Test\n public void testInformV3Async() throws Exception {\n UserTarget target = (UserTarget) userTarget.clone();\n target.setTimeout(10000);\n target.setVersion(SnmpConstants.version3);\n ScopedPDU pdu = new ScopedPDU();\n pdu.setType(PDU.INFORM);\n pdu.setContextName(new OctetString(\"...
{ "fields": [ { "declarator": "logger = LogFactory.getLogger(Snmp.class)", "modifier": "private static final", "original_string": "private static final LogAdapter logger = LogFactory.getLogger(Snmp.class);", "type": "LogAdapter", "var_name": "logger" }, { "declarator": ...
{ "body": "public int getNextRequestID() {\n return messageDispatcher.getNextRequestID();\n }", "class_method_signature": "Snmp.getNextRequestID()", "constructor": false, "full_signature": "public int getNextRequestID()", "identifier": "getNextRequestID", "invocations": [ "getNextRequestID" ], "...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 41351929, "size": 3328, "stargazer_count": 7, "stars": null, "updates": null, "url": "https://github.com/GEBIT/snmp4j" }
41351929_1
{ "fields": [ { "declarator": "transportMappingCG", "modifier": "private", "original_string": "private DummyTransport<UdpAddress> transportMappingCG;", "type": "DummyTransport<UdpAddress>", "var_name": "transportMappingCG" }, { "declarator": "transportMappingCR", ...
{ "body": "@Test\n public void testClose() throws Exception {\n assertEquals(transportMappingCG.isListening(), false);\n snmpCommandGenerator.close();\n assertEquals(transportMappingCG.isListening(), false);\n testListen();\n snmpCommandGenerator.close();\n assertEquals(transportMappingCG.isListeni...
{ "fields": [ { "declarator": "logger = LogFactory.getLogger(Snmp.class)", "modifier": "private static final", "original_string": "private static final LogAdapter logger = LogFactory.getLogger(Snmp.class);", "type": "LogAdapter", "var_name": "logger" }, { "declarator": ...
{ "body": "public void close() throws IOException {\n for (TransportMapping tm : messageDispatcher.getTransportMappings()) {\n if (tm.isListening()) {\n tm.close();\n }\n }\n CommonTimer t = timer;\n timer = null;\n if (t != null) {\n t.cancel();\n }\n // close all notificat...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 41351929, "size": 3328, "stargazer_count": 7, "stars": null, "updates": null, "url": "https://github.com/GEBIT/snmp4j" }
41351929_0
{ "fields": [ { "declarator": "transportMappingCG", "modifier": "private", "original_string": "private DummyTransport<UdpAddress> transportMappingCG;", "type": "DummyTransport<UdpAddress>", "var_name": "transportMappingCG" }, { "declarator": "transportMappingCR", ...
{ "body": "@Test\n public void testListen() throws Exception {\n assertEquals(transportMappingCG.isListening(), false);\n snmpCommandGenerator.listen();\n assertEquals(transportMappingCG.isListening(), true);\n }", "class_method_signature": "SnmpTest.testListen()", "constructor": false, "full_signatu...
{ "fields": [ { "declarator": "logger = LogFactory.getLogger(Snmp.class)", "modifier": "private static final", "original_string": "private static final LogAdapter logger = LogFactory.getLogger(Snmp.class);", "type": "LogAdapter", "var_name": "logger" }, { "declarator": ...
{ "body": "public void listen() throws IOException {\n for (Iterator<TransportMapping> it = messageDispatcher.getTransportMappings().iterator();\n it.hasNext(); ) {\n TransportMapping tm = it.next();\n if (!tm.isListening()) {\n tm.listen();\n }\n }\n }", "class_method_signature...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 41351929, "size": 3328, "stargazer_count": 7, "stars": null, "updates": null, "url": "https://github.com/GEBIT/snmp4j" }
41351929_3
{ "fields": [ { "declarator": "transportMappingCG", "modifier": "private", "original_string": "private DummyTransport<UdpAddress> transportMappingCG;", "type": "DummyTransport<UdpAddress>", "var_name": "transportMappingCG" }, { "declarator": "transportMappingCR", ...
{ "body": "@Test\n public void testTrapV2WithV1() throws Exception {\n CommunityTarget target = (CommunityTarget) communityTarget.clone();\n target.setVersion(SnmpConstants.version1);\n PDU pdu = new PDU();\n pdu.setType(PDU.NOTIFICATION);\n addTestVariableBindings(pdu, true, false, target.getVersion(...
{ "fields": [ { "declarator": "logger = LogFactory.getLogger(Snmp.class)", "modifier": "private static final", "original_string": "private static final LogAdapter logger = LogFactory.getLogger(Snmp.class);", "type": "LogAdapter", "var_name": "logger" }, { "declarator": ...
{ "body": "public int getNextRequestID() {\n return messageDispatcher.getNextRequestID();\n }", "class_method_signature": "Snmp.getNextRequestID()", "constructor": false, "full_signature": "public int getNextRequestID()", "identifier": "getNextRequestID", "invocations": [ "getNextRequestID" ], "...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 41351929, "size": 3328, "stargazer_count": 7, "stars": null, "updates": null, "url": "https://github.com/GEBIT/snmp4j" }
41351929_2
{ "fields": [ { "declarator": "transportMappingCG", "modifier": "private", "original_string": "private DummyTransport<UdpAddress> transportMappingCG;", "type": "DummyTransport<UdpAddress>", "var_name": "transportMappingCG" }, { "declarator": "transportMappingCR", ...
{ "body": "@Test\n public void testUsmSeparation() {\n assertNotSame(snmpCommandGenerator.getUSM(), snmpCommandResponder.getUSM());\n }", "class_method_signature": "SnmpTest.testUsmSeparation()", "constructor": false, "full_signature": "@Test public void testUsmSeparation()", "identifier": "testUsmSepara...
{ "fields": [ { "declarator": "logger = LogFactory.getLogger(Snmp.class)", "modifier": "private static final", "original_string": "private static final LogAdapter logger = LogFactory.getLogger(Snmp.class);", "type": "LogAdapter", "var_name": "logger" }, { "declarator": ...
{ "body": "public USM getUSM() {\n MPv3 mp = (MPv3) getMessageProcessingModel(MPv3.ID);\n if (mp != null) {\n return (USM)mp.getSecurityModel(SecurityModel.SECURITY_MODEL_USM);\n }\n return null;\n }", "class_method_signature": "Snmp.getUSM()", "constructor": false, "full_signature": "public U...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 41351929, "size": 3328, "stargazer_count": 7, "stars": null, "updates": null, "url": "https://github.com/GEBIT/snmp4j" }
41351929_9
{ "fields": [ { "declarator": "transportMappingCG", "modifier": "private", "original_string": "private DummyTransport<UdpAddress> transportMappingCG;", "type": "DummyTransport<UdpAddress>", "var_name": "transportMappingCG" }, { "declarator": "transportMappingCR", ...
{ "body": "@Test\n public void testInformV2cAsyncWithRetry() throws Exception {\n CommunityTarget target = (CommunityTarget) communityTarget.clone();\n target.setVersion(SnmpConstants.version2c);\n target.setTimeout(1200);\n target.setRetries(2);\n PDU pdu = new PDU();\n pdu.setType(PDU.INFORM);\n ...
{ "fields": [ { "declarator": "logger = LogFactory.getLogger(Snmp.class)", "modifier": "private static final", "original_string": "private static final LogAdapter logger = LogFactory.getLogger(Snmp.class);", "type": "LogAdapter", "var_name": "logger" }, { "declarator": ...
{ "body": "public int getNextRequestID() {\n return messageDispatcher.getNextRequestID();\n }", "class_method_signature": "Snmp.getNextRequestID()", "constructor": false, "full_signature": "public int getNextRequestID()", "identifier": "getNextRequestID", "invocations": [ "getNextRequestID" ], "...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 41351929, "size": 3328, "stargazer_count": 7, "stars": null, "updates": null, "url": "https://github.com/GEBIT/snmp4j" }
41351929_5
{ "fields": [ { "declarator": "transportMappingCG", "modifier": "private", "original_string": "private DummyTransport<UdpAddress> transportMappingCG;", "type": "DummyTransport<UdpAddress>", "var_name": "transportMappingCG" }, { "declarator": "transportMappingCR", ...
{ "body": "@Test\n public void testNotifyV2c() throws Exception {\n CommunityTarget target = (CommunityTarget) communityTarget.clone();\n target.setVersion(SnmpConstants.version2c);\n PDU pdu = new PDU();\n pdu.setType(PDU.NOTIFICATION);\n addTestVariableBindings(pdu, true, false, target.getVersion())...
{ "fields": [ { "declarator": "logger = LogFactory.getLogger(Snmp.class)", "modifier": "private static final", "original_string": "private static final LogAdapter logger = LogFactory.getLogger(Snmp.class);", "type": "LogAdapter", "var_name": "logger" }, { "declarator": ...
{ "body": "public int getNextRequestID() {\n return messageDispatcher.getNextRequestID();\n }", "class_method_signature": "Snmp.getNextRequestID()", "constructor": false, "full_signature": "public int getNextRequestID()", "identifier": "getNextRequestID", "invocations": [ "getNextRequestID" ], "...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 41351929, "size": 3328, "stargazer_count": 7, "stars": null, "updates": null, "url": "https://github.com/GEBIT/snmp4j" }
41351929_4
{ "fields": [ { "declarator": "transportMappingCG", "modifier": "private", "original_string": "private DummyTransport<UdpAddress> transportMappingCG;", "type": "DummyTransport<UdpAddress>", "var_name": "transportMappingCG" }, { "declarator": "transportMappingCR", ...
{ "body": "@Test\n public void testTrapV2WithV1Allowed() throws Exception {\n CommunityTarget target = (CommunityTarget) communityTarget.clone();\n target.setVersion(SnmpConstants.version1);\n PDU pdu = new PDU();\n pdu.setType(PDU.NOTIFICATION);\n addTestVariableBindings(pdu, true, false, target.getV...
{ "fields": [ { "declarator": "logger = LogFactory.getLogger(Snmp.class)", "modifier": "private static final", "original_string": "private static final LogAdapter logger = LogFactory.getLogger(Snmp.class);", "type": "LogAdapter", "var_name": "logger" }, { "declarator": ...
{ "body": "public int getNextRequestID() {\n return messageDispatcher.getNextRequestID();\n }", "class_method_signature": "Snmp.getNextRequestID()", "constructor": false, "full_signature": "public int getNextRequestID()", "identifier": "getNextRequestID", "invocations": [ "getNextRequestID" ], "...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 41351929, "size": 3328, "stargazer_count": 7, "stars": null, "updates": null, "url": "https://github.com/GEBIT/snmp4j" }
41351929_8
{ "fields": [ { "declarator": "transportMappingCG", "modifier": "private", "original_string": "private DummyTransport<UdpAddress> transportMappingCG;", "type": "DummyTransport<UdpAddress>", "var_name": "transportMappingCG" }, { "declarator": "transportMappingCR", ...
{ "body": "@Test\n public void testInformV2cAsync() throws Exception {\n CommunityTarget target = (CommunityTarget) communityTarget.clone();\n target.setVersion(SnmpConstants.version2c);\n PDU pdu = new PDU();\n pdu.setType(PDU.INFORM);\n addTestVariableBindings(pdu, true, false, target.getVersion());...
{ "fields": [ { "declarator": "logger = LogFactory.getLogger(Snmp.class)", "modifier": "private static final", "original_string": "private static final LogAdapter logger = LogFactory.getLogger(Snmp.class);", "type": "LogAdapter", "var_name": "logger" }, { "declarator": ...
{ "body": "public int getNextRequestID() {\n return messageDispatcher.getNextRequestID();\n }", "class_method_signature": "Snmp.getNextRequestID()", "constructor": false, "full_signature": "public int getNextRequestID()", "identifier": "getNextRequestID", "invocations": [ "getNextRequestID" ], "...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 41351929, "size": 3328, "stargazer_count": 7, "stars": null, "updates": null, "url": "https://github.com/GEBIT/snmp4j" }
41351929_12
{ "fields": [ { "declarator": "transportMappingCG", "modifier": "private", "original_string": "private DummyTransport<UdpAddress> transportMappingCG;", "type": "DummyTransport<UdpAddress>", "var_name": "transportMappingCG" }, { "declarator": "transportMappingCR", ...
{ "body": "@Test\n public void testSend() throws Exception {\n\n }", "class_method_signature": "SnmpTest.testSend()", "constructor": false, "full_signature": "@Test public void testSend()", "identifier": "testSend", "invocations": [], "modifiers": "@Test public", "parameters": "()", "return": "void"...
{ "fields": [ { "declarator": "logger = LogFactory.getLogger(Snmp.class)", "modifier": "private static final", "original_string": "private static final LogAdapter logger = LogFactory.getLogger(Snmp.class);", "type": "LogAdapter", "var_name": "logger" }, { "declarator": ...
{ "body": "public ResponseEvent send(PDU pdu, Target target) throws IOException {\n return send(pdu, target, null);\n }", "class_method_signature": "Snmp.send(PDU pdu, Target target)", "constructor": false, "full_signature": "public ResponseEvent send(PDU pdu, Target target)", "identifier": "send", "inv...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 41351929, "size": 3328, "stargazer_count": 7, "stars": null, "updates": null, "url": "https://github.com/GEBIT/snmp4j" }
175482179_1
{ "fields": [ { "declarator": "DIVIDER_HEIGHT = 7", "modifier": "private static final", "original_string": "private static final int DIVIDER_HEIGHT = 7;", "type": "int", "var_name": "DIVIDER_HEIGHT" }, { "declarator": "HALF_HOUR_HEIGHT = 28", "modifier": "private ...
{ "body": "@Test\n public void setDividerRects() {\n dayView.setDividerRects(10, 5, 195);\n\n assertThat(dayView.hourDividerRects.get(0).getLeft(), is(5));\n assertThat(dayView.hourDividerRects.get(0).getTop(), is(10));\n assertThat(dayView.hourDividerRects.get(0).getRight(), is(195));\...
{ "fields": [ { "declarator": "MIN_START_HOUR = 0", "modifier": "@VisibleForTesting\n static final", "original_string": "@VisibleForTesting\n static final int MIN_START_HOUR = 0;", "type": "int", "var_name": "MIN_START_HOUR" }, { "declarator": "MAX_END_HOUR = 24",...
{ "body": "@VisibleForTesting\n void setDividerRects(int firstDividerTop, int dividerStart, int dividerEnd) {\n for (int i = 0; i < hourDividerRects.size(); i++) {\n int top = firstDividerTop + i * 2 * usableHalfHourHeight;\n int bottom = top + dividerHeight;\n\n setRect(hou...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 175482179, "size": 148, "stargazer_count": 32, "stars": null, "updates": null, "url": "https://github.com/linkedin/Tachyon" }
175482179_0
{ "fields": [ { "declarator": "DIVIDER_HEIGHT = 7", "modifier": "private static final", "original_string": "private static final int DIVIDER_HEIGHT = 7;", "type": "int", "var_name": "DIVIDER_HEIGHT" }, { "declarator": "HALF_HOUR_HEIGHT = 28", "modifier": "private ...
{ "body": "@Test\n public void setHourLabelRects() {\n dayView.setHourLabelRects(25, 75, 90);\n\n assertThat(dayView.hourLabelRects.get(0).getLeft(), is(25));\n assertThat(dayView.hourLabelRects.get(0).getTop(), is(80));\n assertThat(dayView.hourLabelRects.get(0).getRight(), is(75));\n ...
{ "fields": [ { "declarator": "MIN_START_HOUR = 0", "modifier": "@VisibleForTesting\n static final", "original_string": "@VisibleForTesting\n static final int MIN_START_HOUR = 0;", "type": "int", "var_name": "MIN_START_HOUR" }, { "declarator": "MAX_END_HOUR = 24",...
{ "body": "@VisibleForTesting\n void setHourLabelRects(int hourLabelStart, int hourLabelEnd, int firstDividerTop) {\n for (int i = 0; i < hourLabelViews.size(); i++) {\n View view = hourLabelViews.get(i);\n\n int height = view.getMeasuredHeight();\n\n int top = firstDividerT...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 175482179, "size": 148, "stargazer_count": 32, "stars": null, "updates": null, "url": "https://github.com/linkedin/Tachyon" }
175482179_3
{ "fields": [ { "declarator": "DIVIDER_HEIGHT = 7", "modifier": "private static final", "original_string": "private static final int DIVIDER_HEIGHT = 7;", "type": "int", "var_name": "DIVIDER_HEIGHT" }, { "declarator": "HALF_HOUR_HEIGHT = 28", "modifier": "private ...
{ "body": "@Test\n public void setRect() {\n DirectionalRect rect = new DirectionalRect();\n rect.set(false, 20, 1, 2, 3, 4);\n\n assertThat(rect.getLeft(), is(1));\n assertThat(rect.getTop(), is(2));\n assertThat(rect.getRight(), is(3));\n assertThat(rect.getBottom(), is(...
{ "fields": [ { "declarator": "MIN_START_HOUR = 0", "modifier": "@VisibleForTesting\n static final", "original_string": "@VisibleForTesting\n static final int MIN_START_HOUR = 0;", "type": "int", "var_name": "MIN_START_HOUR" }, { "declarator": "MAX_END_HOUR = 24",...
{ "body": "protected void setRect(@NonNull DirectionalRect rect, int start, int top, int end, int bottom) {\n rect.set(isRtl, parentWidth, start, top, end, bottom);\n }", "class_method_signature": "DayView.setRect(@NonNull DirectionalRect rect, int start, int top, int end, int bottom)", "constructor": f...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 175482179, "size": 148, "stargazer_count": 32, "stars": null, "updates": null, "url": "https://github.com/linkedin/Tachyon" }
175482179_2
{ "fields": [ { "declarator": "DIVIDER_HEIGHT = 7", "modifier": "private static final", "original_string": "private static final int DIVIDER_HEIGHT = 7;", "type": "int", "var_name": "DIVIDER_HEIGHT" }, { "declarator": "HALF_HOUR_HEIGHT = 28", "modifier": "private ...
{ "body": "@Test\n public void setEventRects() {\n dayView.setEventRects(10, MINUTE_HEIGHT, 5, 195);\n\n assertThat(dayView.eventRects, notNullValue());\n\n assertThat(dayView.eventRects.get(0).getLeft(), is(8));\n assertThat(dayView.eventRects.get(0).getTop(), is(48));\n assertT...
{ "fields": [ { "declarator": "MIN_START_HOUR = 0", "modifier": "@VisibleForTesting\n static final", "original_string": "@VisibleForTesting\n static final int MIN_START_HOUR = 0;", "type": "int", "var_name": "MIN_START_HOUR" }, { "declarator": "MAX_END_HOUR = 24",...
{ "body": "@VisibleForTesting\n void setEventRects(int firstDividerTop, float minuteHeight, int dividerStart, int dividerEnd) {\n if (eventColumnSpansHelper == null) {\n return;\n }\n\n int eventColumnWidth = eventColumnSpansHelper.columnCount > 0\n ? (dividerEnd - di...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 175482179, "size": 148, "stargazer_count": 32, "stars": null, "updates": null, "url": "https://github.com/linkedin/Tachyon" }
17592978_2
{ "fields": [ { "declarator": "licenceService", "modifier": "@Autowired", "original_string": "@Autowired\n\tLicenceService licenceService;", "type": "LicenceService", "var_name": "licenceService" } ], "file": "server/src/test/java/com/paperight/licence/LicenceServiceTest.java...
{ "body": "@Test\n\tpublic final void testGenerateFile() throws Exception {\n\t\t//licenceService.generateFile(licence);\n\t\tfail(\"Not yet implemented\");\n\t}", "class_method_signature": "LicenceServiceTest.testGenerateFile()", "constructor": false, "full_signature": "@Test public final void testGenerateFile...
{ "fields": [ { "declarator": "trackingUrlCreator", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate TrackingUrlCreator trackingUrlCreator;", "type": "TrackingUrlCreator", "var_name": "trackingUrlCreator" }, { "declarator": "licenceFileServ...
{ "body": "public boolean generateFile(Licence licence) throws Exception {\n\t\tfinalizeLicence(licence);\n\t\tWatermarkWriter watermarkWriter = WatermarkWriterFactory.create(FilenameUtils.getExtension(licence.getOriginalFileName()));\n\t\ttry {\n\t\t\twatermarkWriter.writeWatermark(sourceLicenceFile(licence), target...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17592978, "size": 2560, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Paperight/website" }
17592978_1
{ "fields": [ { "declarator": "paypalService", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate PaypalService paypalService;", "type": "PaypalService", "var_name": "paypalService" }, { "declarator": "applicationUrl", "modifier": "@Val...
{ "body": "@Test\n\tpublic final void testCompletePayment() {\n\t\tPaperightCreditTransaction transaction = new PaperightCreditTransaction();\n\t\ttransaction.setNumberOfCredits(new BigDecimal(123).setScale(0));\n\t\tPaypalResponse response = paypalService.completePayment(transaction, \"EC-786270384N085350D\", \"ZHTT...
{ "fields": [ { "declarator": "sandbox", "modifier": "@Value(\"${paypal.api.sandbox}\")\n\tprivate", "original_string": "@Value(\"${paypal.api.sandbox}\")\n\tprivate boolean sandbox;", "type": "boolean", "var_name": "sandbox" }, { "declarator": "apiUser", "modifie...
{ "body": "public PaypalResponse completePayment(PaperightCreditTransaction transaction, String token, String payerId) {\n\t\tProfile user = new BaseProfile.Builder(apiUser, apiPassword).signature(apiSignature).build();\n\t\t/* create new instance of paypal nvp */\n\t\tEnvironment environment;\n\t\tif (sandbox) {\n\t...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17592978, "size": 2560, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Paperight/website" }
17592978_0
{ "fields": [ { "declarator": "paypalService", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate PaypalService paypalService;", "type": "PaypalService", "var_name": "paypalService" }, { "declarator": "applicationUrl", "modifier": "@Val...
{ "body": "@Test\n\tpublic final void testInitiatePayment() {\n\t\tPaperightCreditTransaction transaction = new PaperightCreditTransaction();\n\t\ttransaction.setNumberOfCredits(new BigDecimal(123).setScale(0));\n\t\tPaypalResponse response = paypalService.initiatePayment(transaction, applicationUrl + \"/transaction/...
{ "fields": [ { "declarator": "sandbox", "modifier": "@Value(\"${paypal.api.sandbox}\")\n\tprivate", "original_string": "@Value(\"${paypal.api.sandbox}\")\n\tprivate boolean sandbox;", "type": "boolean", "var_name": "sandbox" }, { "declarator": "apiUser", "modifie...
{ "body": "public PaypalResponse initiatePayment(PaperightCreditTransaction transaction, String returnUrl, String cancelUrl) {\n\t\tProfile user = new BaseProfile.Builder(apiUser, apiPassword).signature(apiSignature).build();\n\t\t/* create new instance of paypal nvp */\n\t\tEnvironment environment;\n\t\tif (sandbox)...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17592978, "size": 2560, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Paperight/website" }
11664357_17
{ "fields": [ { "declarator": "_graph", "modifier": "private", "original_string": "private Graph _graph;", "type": "Graph", "var_name": "_graph" }, { "declarator": "fromEdge", "modifier": "private", "original_string": "private PlainStreetEdge fromEdge;", ...
{ "body": "@Test\n public void testInferredFreeFlowing() {\n IntersectionVertex iv = new IntersectionVertex(_graph, \"vertex\", 1.0, 2.0);\n assertFalse(iv.isTrafficLight());\n assertFalse(iv.inferredFreeFlowing());\n assertEquals(0, iv.getDegreeIn());\n assertEquals(0, iv.getDeg...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "trafficLight", "modifier": "@Getter...
{ "body": "public boolean inferredFreeFlowing() {\n if (this.freeFlowing) {\n return true;\n }\n \n return getDegreeIn() == 1 && getDegreeOut() == 1 && !this.trafficLight;\n }", "class_method_signature": "IntersectionVertex.inferredFreeFlowing()", "constructor": false, ...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_21
{ "fields": [ { "declarator": "_graph", "modifier": "private", "original_string": "private Graph _graph;", "type": "Graph", "var_name": "_graph" }, { "declarator": "v0", "modifier": "private", "original_string": "private IntersectionVertex v0, v1, v2;", ...
{ "body": "@Test\n public void testModeSetCanTraverse() {\n PlainStreetEdge e = edge(v1, v2, 1.0, StreetTraversalPermission.ALL);\n \n TraverseModeSet modes = TraverseModeSet.allModes();\n assertTrue(e.canTraverse(modes));\n \n modes = new TraverseModeSet(TraverseMode.BICY...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(PlainStreetEdge.class)", "modifier": "private static", "original_string": "private static Logger LOG = LoggerFactory.getLogger(PlainStreetEdge.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "...
{ "body": "@Override\n public boolean canTraverse(RoutingRequest options) {\n if (options.wheelchairAccessible) {\n if (!wheelchairAccessible) {\n return false;\n }\n if (elevationProfileSegment.getMaxSlope() > options.maxSlope) {\n return false...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_0
{ "fields": [], "file": "opentripplanner-graph-builder/src/test/java/org/opentripplanner/graph_builder/impl/raptor/ArrayBagTest.java", "identifier": "ArrayBagTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testArrayBag() {\n ArrayBag<Integer> bag = new ArrayBag<Integer>();\n \n //a one-item bag\n bag.add(1);\n assertEquals(1, bag.size());\n Iterator<Integer> it = bag.iterator();\n assertTrue(it.hasNext());\n int j = it.next();\n ...
{ "fields": [ { "declarator": "items", "modifier": "", "original_string": "T[] items;", "type": "T[]", "var_name": "items" }, { "declarator": "last", "modifier": "", "original_string": "int last;", "type": "int", "var_name": "last" } ], "...
{ "body": "@SuppressWarnings(\"unchecked\")\n ArrayBag() {\n items = (T[]) new Object[2];\n last = 0;\n }", "class_method_signature": "ArrayBag.ArrayBag()", "constructor": true, "full_signature": "@SuppressWarnings(\"unchecked\") ArrayBag()", "identifier": "ArrayBag", "invocations": [],...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_1
{ "fields": [ { "declarator": "gf = new GeometryFactory()", "modifier": "static", "original_string": "static GeometryFactory gf = new GeometryFactory();", "type": "GeometryFactory", "var_name": "gf" }, { "declarator": "_graph", "modifier": "private", "origin...
{ "body": "@Test\n public void testStreetMatcher() {\n \n LineString geometry = geometry(-122.385689, 47.669484, -122.387384, 47.669470);\n\n StreetMatcher matcher = new StreetMatcher(_graph);\n\n List<Edge> match = matcher.match(geometry);\n assertNotNull(match);\n assert...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(StreetMatcher.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(StreetMatcher.class);", "type": "Logger", "var_name": "log" }, { "declar...
{ "body": "public StreetMatcher(Graph graph) {\n this.graph = graph;\n index = createIndex();\n index.build();\n }", "class_method_signature": "StreetMatcher.StreetMatcher(Graph graph)", "constructor": true, "full_signature": "public StreetMatcher(Graph graph)", "identifier": "StreetM...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_20
{ "fields": [ { "declarator": "_graph", "modifier": "private", "original_string": "private Graph _graph;", "type": "Graph", "var_name": "_graph" }, { "declarator": "v1", "modifier": "private", "original_string": "private IntersectionVertex v1, v2, v3, v4;", ...
{ "body": "@Test\n public void testReverseEdge() {\n PartialPlainStreetEdge pEdge1 = new PartialPlainStreetEdge(e1, v1, v2, e1.getGeometry(),\n \"partial e1\", e1.getLength());\n PartialPlainStreetEdge pEdge2 = new PartialPlainStreetEdge(e1Reverse, v2, v1, e1Reverse.getGeometry(),\n ...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "parentEdge", "modifier": "@Setter\n...
{ "body": "@Override\n public boolean isReverseOf(Edge e) {\n Edge other = e;\n if (e instanceof PartialPlainStreetEdge) {\n other = ((PartialPlainStreetEdge) e).getParentEdge();\n }\n \n // TODO(flamholz): is there a case where a partial edge has a reverse of its own?...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_16
{ "fields": [], "file": "openstreetmap/src/test/java/org/opentripplanner/openstreetmap/model/OSMWayTest.java", "identifier": "OSMWayTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsOpposableCycleway() {\n OSMWay way = new OSMWay();\n assertFalse(way.isOpposableCycleway());\n\n way.addTag(\"cycleway\", \"notatagvalue\");\n assertFalse(way.isOpposableCycleway());\n\n way.addTag(\"cycleway\", \"oppo\");\n assertFalse...
{ "fields": [ { "declarator": "_nodes = new ArrayList<Long>()", "modifier": "private", "original_string": "private List<Long> _nodes = new ArrayList<Long>();", "type": "List<Long>", "var_name": "_nodes" } ], "file": "openstreetmap/src/main/java/org/opentripplanner/openstreetm...
{ "body": "public boolean isOpposableCycleway() {\n // any cycleway which is opposite* allows contraflow biking\n String cycleway = getTag(\"cycleway\");\n String cyclewayLeft = getTag(\"cycleway:left\");\n String cyclewayRight = getTag(\"cycleway:right\");\n\n return (cycleway != n...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_27
{ "fields": [], "file": "opentripplanner-api-thrift/src/test/java/org/opentripplanner/api/thrift/util/TravelModeSetTest.java", "identifier": "TravelModeSetTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testConstructFromSet() {\n Set<TravelMode> modes = new HashSet<TravelMode>(3);\n\n modes.add(TravelMode.WALK);\n modes.add(TravelMode.ANY_TRAIN);\n\n TravelModeSet modeSet = new TravelModeSet(modes);\n TraverseModeSet traverseModes = modeSet.toTrave...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" } ], "file": "opentripplanner-api-thrift/src/main/java/org/opentrip...
{ "body": "public TraverseModeSet toTraverseModeSet() {\n TraverseModeSet modeSet = new TraverseModeSet();\n for (TravelMode travelMode : this) {\n TraverseMode traverseMode = (new TravelModeWrapper(travelMode)).toTraverseMode();\n modeSet.setMode(traverseMode, true);\n }\n\...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_31
{ "fields": [ { "declarator": "extra", "modifier": "private static", "original_string": "private static HashMap<Class<?>, Object> extra;", "type": "HashMap<Class<?>, Object>", "var_name": "extra" }, { "declarator": "graph", "modifier": "private static", "ori...
{ "body": "@Test\n public void testFindPaths() throws TException {\n PathOptions opts = new PathOptions();\n opts.setNum_paths(1);\n opts.setReturn_detailed_path(true);\n\n TripParameters trip = new TripParameters();\n trip.addToAllowed_modes(TravelMode.CAR);\n\n P2<Locati...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(OTPServerTask.class)", "modifier": "private static", "original_string": "private static Logger LOG = LoggerFactory.getLogger(OTPServerTask.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "grap...
{ "body": "@Override\n public FindPathsResponse FindPaths(FindPathsRequest req) throws TException {\n LOG.debug(\"FindPaths called\");\n long startTime = System.currentTimeMillis();\n\n TripParameters trip = req.getTrip();\n TripPaths outPaths = new TripPaths();\n outPaths.setTri...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_6
{ "fields": [], "file": "openstreetmap/src/test/java/org/opentripplanner/openstreetmap/model/OSMNodeTest.java", "identifier": "OSMNodeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetCapacity() {\n OSMNode node = new OSMNode();\n assertFalse(node.hasTag(\"capacity\"));\n assertEquals(0, node.getCapacity());\n \n try {\n node.addTag(\"capacity\", \"foobie\");\n node.getCapacity();\n \n ...
{ "fields": [ { "declarator": "lat", "modifier": "@Setter\n @Getter\n private", "original_string": "@Setter\n @Getter\n private double lat;", "type": "double", "var_name": "lat" }, { "declarator": "lon", "modifier": "@Setter\n @Getter\n private",...
{ "body": "public int getCapacity() throws NumberFormatException {\n String capacity = getTag(\"capacity\");\n if (capacity == null) {\n return 0;\n }\n \n return Integer.parseInt(getTag(\"capacity\"));\n }", "class_method_signature": "OSMNode.getCapacity()", "cons...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_11
{ "fields": [], "file": "openstreetmap/src/test/java/org/opentripplanner/openstreetmap/model/OSMWithTagsTest.java", "identifier": "OSMWithTagsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsGeneralAccessDenied() {\n OSMWithTags o = new OSMWithTags();\n assertFalse(o.isGeneralAccessDenied());\n \n o.addTag(\"access\", \"something\");\n assertFalse(o.isGeneralAccessDenied());\n \n o.addTag(\"access\", \"license\");\n ...
{ "fields": [ { "declarator": "_tags", "modifier": "private", "original_string": "private Map<String, String> _tags;", "type": "Map<String, String>", "var_name": "_tags" }, { "declarator": "id", "modifier": "protected", "original_string": "protected long id;...
{ "body": "public boolean isGeneralAccessDenied() {\n return isTagDeniedAccess(\"access\");\n }", "class_method_signature": "OSMWithTags.isGeneralAccessDenied()", "constructor": false, "full_signature": "public boolean isGeneralAccessDenied()", "identifier": "isGeneralAccessDenied", "invocations":...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_10
{ "fields": [], "file": "openstreetmap/src/test/java/org/opentripplanner/openstreetmap/model/OSMWithTagsTest.java", "identifier": "OSMWithTagsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsTrue() {\n assertTrue(OSMWithTags.isTrue(\"yes\"));\n assertTrue(OSMWithTags.isTrue(\"1\"));\n assertTrue(OSMWithTags.isTrue(\"true\"));\n \n assertFalse(OSMWithTags.isTrue(\"no\"));\n assertFalse(OSMWithTags.isTrue(\"0\"));\n as...
{ "fields": [ { "declarator": "_tags", "modifier": "private", "original_string": "private Map<String, String> _tags;", "type": "Map<String, String>", "var_name": "_tags" }, { "declarator": "id", "modifier": "protected", "original_string": "protected long id;...
{ "body": "public static boolean isTrue(String tagValue) {\n return (\"yes\".equals(tagValue) || \"1\".equals(tagValue) || \"true\".equals(tagValue));\n }", "class_method_signature": "OSMWithTags.isTrue(String tagValue)", "constructor": false, "full_signature": "public static boolean isTrue(String tag...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_7
{ "fields": [], "file": "openstreetmap/src/test/java/org/opentripplanner/openstreetmap/model/OSMWithTagsTest.java", "identifier": "OSMWithTagsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testHasTag() {\n OSMWithTags o = new OSMWithTags();\n assertFalse(o.hasTag(\"foo\"));\n assertFalse(o.hasTag(\"FOO\"));\n o.addTag(\"foo\", \"bar\");\n \n assertTrue(o.hasTag(\"foo\"));\n assertTrue(o.hasTag(\"FOO\"));\n }", "clas...
{ "fields": [ { "declarator": "_tags", "modifier": "private", "original_string": "private Map<String, String> _tags;", "type": "Map<String, String>", "var_name": "_tags" }, { "declarator": "id", "modifier": "protected", "original_string": "protected long id;...
{ "body": "public boolean hasTag(String tag) {\n tag = tag.toLowerCase();\n return _tags != null && _tags.containsKey(tag);\n }", "class_method_signature": "OSMWithTags.hasTag(String tag)", "constructor": false, "full_signature": "public boolean hasTag(String tag)", "identifier": "hasTag", ...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_30
{ "fields": [ { "declarator": "extra", "modifier": "private static", "original_string": "private static HashMap<Class<?>, Object> extra;", "type": "HashMap<Class<?>, Object>", "var_name": "extra" }, { "declarator": "graph", "modifier": "private static", "ori...
{ "body": "@Test\n public void testGetGraphVertices() throws TException {\n GraphVerticesRequest req = new GraphVerticesRequest();\n req.validate();\n\n GraphVerticesResponse res = serviceImpl.GetVertices(req);\n\n Set<Integer> expectedVertexIds = new HashSet<Integer>();\n for (V...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(OTPServerTask.class)", "modifier": "private static", "original_string": "private static Logger LOG = LoggerFactory.getLogger(OTPServerTask.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "grap...
{ "body": "@Override\n public GraphVerticesResponse GetVertices(GraphVerticesRequest req) throws TException {\n LOG.debug(\"GetVertices called\");\n long startTime = System.currentTimeMillis();\n\n GraphVerticesResponse res = new GraphVerticesResponse();\n Graph g = graphService.getGrap...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_26
{ "fields": [], "file": "opentripplanner-api-thrift/src/test/java/org/opentripplanner/api/thrift/util/TravelModeSetTest.java", "identifier": "TravelModeSetTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testAdd() {\n TravelModeSet modeSet = new TravelModeSet();\n modeSet.add(TravelMode.WALK);\n modeSet.add(TravelMode.ANY_TRAIN);\n\n TraverseModeSet traverseModes = modeSet.toTraverseModeSet();\n assertTrue(traverseModes.getWalk());\n assertTr...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" } ], "file": "opentripplanner-api-thrift/src/main/java/org/opentrip...
{ "body": "public TraverseModeSet toTraverseModeSet() {\n TraverseModeSet modeSet = new TraverseModeSet();\n for (TravelMode travelMode : this) {\n TraverseMode traverseMode = (new TravelModeWrapper(travelMode)).toTraverseMode();\n modeSet.setMode(traverseMode, true);\n }\n\...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_4
{ "fields": [], "file": "opentripplanner-utils/src/test/java/org/opentripplanner/common/model/GenericLocationTest.java", "identifier": "GenericLocationTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testToString() {\n String input = \"name::1.0,2.5\";\n GenericLocation loc = GenericLocation.fromOldStyleString(input);\n assertEquals(input, loc.toString());\n assertTrue(loc.hasCoordinate());\n assertFalse(loc.hasHeading());\n \n inp...
{ "fields": [ { "declarator": "name", "modifier": "private final", "original_string": "private final String name;", "type": "String", "var_name": "name" }, { "declarator": "place", "modifier": "private final", "original_string": "private final String place;"...
{ "body": "@Override\n public String toString() {\n if (this.place != null && !this.place.isEmpty()) {\n if (this.name == null || this.name.isEmpty()) {\n return this.place;\n } else {\n return String.format(\"%s::%s\", this.name, this.place);\n ...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_33
{ "fields": [ { "declarator": "extra", "modifier": "private static", "original_string": "private static HashMap<Class<?>, Object> extra;", "type": "HashMap<Class<?>, Object>", "var_name": "extra" }, { "declarator": "graph", "modifier": "private static", "ori...
{ "body": "@Test\n public void testFindNearestVertex() throws TException {\n for (Vertex v : graph.getVertices()) {\n FindNearestVertexRequest req = new FindNearestVertexRequest();\n VertexQuery q = new VertexQuery();\n q.setLocation(getLocationForVertex(v));\n re...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(OTPServerTask.class)", "modifier": "private static", "original_string": "private static Logger LOG = LoggerFactory.getLogger(OTPServerTask.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "grap...
{ "body": "@Override\n public FindNearestVertexResponse FindNearestVertex(FindNearestVertexRequest req)\n throws TException {\n LOG.debug(\"FindNearestVertex called\");\n long startTime = System.currentTimeMillis();\n VertexQuery q = req.getQuery();\n VertexResult result = fi...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_25
{ "fields": [], "file": "opentripplanner-api-thrift/src/test/java/org/opentripplanner/api/thrift/util/RoutingRequestBuilderTest.java", "identifier": "RoutingRequestBuilderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSetArriveBy() {\n long t = this.getTimeSeconds() + 30 * 60;\n RoutingRequest rr = (new RoutingRequestBuilder()).setArriveBy(t).build();\n assertEquals(t, rr.dateTime);\n assertTrue(rr.arriveBy);\n }", "class_method_signature": "RoutingRequestBuild...
{ "fields": [ { "declarator": "routingRequest", "modifier": "private final", "original_string": "private final RoutingRequest routingRequest;", "type": "RoutingRequest", "var_name": "routingRequest" }, { "declarator": "graph", "modifier": "private", "origina...
{ "body": "public RoutingRequestBuilder setArriveBy(long arriveBy) {\n routingRequest.dateTime = arriveBy;\n routingRequest.setArriveBy(true);\n return this;\n }", "class_method_signature": "RoutingRequestBuilder.setArriveBy(long arriveBy)", "constructor": false, "full_signature": "publi...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_8
{ "fields": [], "file": "openstreetmap/src/test/java/org/opentripplanner/openstreetmap/model/OSMWithTagsTest.java", "identifier": "OSMWithTagsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetTag() {\n OSMWithTags o = new OSMWithTags();\n assertNull(o.getTag(\"foo\"));\n assertNull(o.getTag(\"FOO\"));\n \n o.addTag(\"foo\", \"bar\");\n assertEquals(\"bar\", o.getTag(\"foo\"));\n assertEquals(\"bar\", o.getTag(\"FOO\"...
{ "fields": [ { "declarator": "_tags", "modifier": "private", "original_string": "private Map<String, String> _tags;", "type": "Map<String, String>", "var_name": "_tags" }, { "declarator": "id", "modifier": "protected", "original_string": "protected long id;...
{ "body": "public String getTag(String tag) {\n tag = tag.toLowerCase();\n if (_tags != null && _tags.containsKey(tag))\n return _tags.get(tag);\n\n return null;\n }", "class_method_signature": "OSMWithTags.getTag(String tag)", "constructor": false, "full_signature": "public S...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_13
{ "fields": [], "file": "openstreetmap/src/test/java/org/opentripplanner/openstreetmap/model/OSMWayTest.java", "identifier": "OSMWayTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsBicycleDismountForced() {\n OSMWay way = new OSMWay();\n assertFalse(way.isBicycleDismountForced());\n\n way.addTag(\"bicycle\", \"dismount\");\n assertTrue(way.isBicycleDismountForced());\n }", "class_method_signature": "OSMWayTest.testIsBicycl...
{ "fields": [ { "declarator": "_nodes = new ArrayList<Long>()", "modifier": "private", "original_string": "private List<Long> _nodes = new ArrayList<Long>();", "type": "List<Long>", "var_name": "_nodes" } ], "file": "openstreetmap/src/main/java/org/opentripplanner/openstreetm...
{ "body": "public boolean isBicycleDismountForced() {\n String bicycle = getTag(\"bicycle\");\n return isTag(\"cycleway\", \"dismount\") || \"dismount\".equals(bicycle);\n }", "class_method_signature": "OSMWay.isBicycleDismountForced()", "constructor": false, "full_signature": "public boolean i...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_29
{ "fields": [ { "declarator": "extra", "modifier": "private static", "original_string": "private static HashMap<Class<?>, Object> extra;", "type": "HashMap<Class<?>, Object>", "var_name": "extra" }, { "declarator": "graph", "modifier": "private static", "ori...
{ "body": "@Test\n public void testGetGraphEdges() throws TException {\n GraphEdgesRequest req = new GraphEdgesRequest();\n req.validate();\n\n req.setStreet_edges_only(true);\n GraphEdgesResponse res = serviceImpl.GetEdges(req);\n\n Set<Integer> expectedEdgeIds = new HashSet<Int...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(OTPServerTask.class)", "modifier": "private static", "original_string": "private static Logger LOG = LoggerFactory.getLogger(OTPServerTask.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "grap...
{ "body": "@Override\n public GraphEdgesResponse GetEdges(GraphEdgesRequest req) throws TException {\n LOG.debug(\"GetEdges called\");\n long startTime = System.currentTimeMillis();\n\n GraphEdgesResponse res = new GraphEdgesResponse();\n Graph g = graphService.getGraph(); \n ...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_28
{ "fields": [], "file": "opentripplanner-api-thrift/src/test/java/org/opentripplanner/api/thrift/util/TravelModeWrapperTest.java", "identifier": "TravelModeWrapperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testToTraverseMode() {\n Map<TravelMode, TraverseMode> modeMap = new HashMap<TravelMode, TraverseMode>();\n modeMap.put(TravelMode.BICYCLE, TraverseMode.BICYCLE);\n modeMap.put(TravelMode.CAR, TraverseMode.CAR);\n modeMap.put(TravelMode.CUSTOM_MOTOR_VEHICL...
{ "fields": [ { "declarator": "travelMode", "modifier": "private", "original_string": "private TravelMode travelMode;", "type": "TravelMode", "var_name": "travelMode" } ], "file": "opentripplanner-api-thrift/src/main/java/org/opentripplanner/api/thrift/util/TravelModeWrapper....
{ "body": "public TraverseMode toTraverseMode() {\n switch (travelMode) {\n case BICYCLE:\n return TraverseMode.BICYCLE;\n case WALK:\n return TraverseMode.WALK;\n case CAR:\n return TraverseMode.CAR;\n case CUSTOM_MOTOR_VEHICLE:\n return ...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_12
{ "fields": [], "file": "openstreetmap/src/test/java/org/opentripplanner/openstreetmap/model/OSMWithTagsTest.java", "identifier": "OSMWithTagsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsThroughTrafficExplicitlyDisallowed() {\n OSMWithTags o = new OSMWithTags();\n assertFalse(o.isThroughTrafficExplicitlyDisallowed());\n \n o.addTag(\"access\", \"something\");\n assertFalse(o.isThroughTrafficExplicitlyDisallowed());\n \n...
{ "fields": [ { "declarator": "_tags", "modifier": "private", "original_string": "private Map<String, String> _tags;", "type": "Map<String, String>", "var_name": "_tags" }, { "declarator": "id", "modifier": "protected", "original_string": "protected long id;...
{ "body": "public boolean isThroughTrafficExplicitlyDisallowed() {\n String access = getTag(\"access\");\n boolean noThruTraffic = \"destination\".equals(access) || \"private\".equals(access)\n || \"customers\".equals(access) || \"delivery\".equals(access)\n || \"forestry\"...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_9
{ "fields": [], "file": "openstreetmap/src/test/java/org/opentripplanner/openstreetmap/model/OSMWithTagsTest.java", "identifier": "OSMWithTagsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsFalse() {\n assertTrue(OSMWithTags.isFalse(\"no\"));\n assertTrue(OSMWithTags.isFalse(\"0\"));\n assertTrue(OSMWithTags.isFalse(\"false\"));\n \n assertFalse(OSMWithTags.isFalse(\"yes\"));\n assertFalse(OSMWithTags.isFalse(\"1\"));\n ...
{ "fields": [ { "declarator": "_tags", "modifier": "private", "original_string": "private Map<String, String> _tags;", "type": "Map<String, String>", "var_name": "_tags" }, { "declarator": "id", "modifier": "protected", "original_string": "protected long id;...
{ "body": "public static boolean isFalse(String tagValue) {\n return (\"no\".equals(tagValue) || \"0\".equals(tagValue) || \"false\".equals(tagValue));\n }", "class_method_signature": "OSMWithTags.isFalse(String tagValue)", "constructor": false, "full_signature": "public static boolean isFalse(String ...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_24
{ "fields": [], "file": "opentripplanner-api-thrift/src/test/java/org/opentripplanner/api/thrift/util/RoutingRequestBuilderTest.java", "identifier": "RoutingRequestBuilderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSetStartTime() {\n long now = this.getTimeSeconds();\n RoutingRequest rr = (new RoutingRequestBuilder()).setStartTime(now).build();\n assertEquals(now, rr.dateTime);\n assertFalse(rr.arriveBy);\n }", "class_method_signature": "RoutingRequestBuilde...
{ "fields": [ { "declarator": "routingRequest", "modifier": "private final", "original_string": "private final RoutingRequest routingRequest;", "type": "RoutingRequest", "var_name": "routingRequest" }, { "declarator": "graph", "modifier": "private", "origina...
{ "body": "public RoutingRequestBuilder setStartTime(long startTime) {\n routingRequest.dateTime = startTime;\n routingRequest.setArriveBy(false);\n return this;\n }", "class_method_signature": "RoutingRequestBuilder.setStartTime(long startTime)", "constructor": false, "full_signature": ...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_32
{ "fields": [ { "declarator": "extra", "modifier": "private static", "original_string": "private static HashMap<Class<?>, Object> extra;", "type": "HashMap<Class<?>, Object>", "var_name": "extra" }, { "declarator": "graph", "modifier": "private static", "ori...
{ "body": "@Test\n public void testBulkFindPaths() throws TException {\n PathOptions opts = new PathOptions();\n opts.setNum_paths(1);\n opts.setReturn_detailed_path(true);\n\n BulkPathsRequest req = new BulkPathsRequest();\n req.setOptions(opts);\n\n for (int i = 0; i < 4...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(OTPServerTask.class)", "modifier": "private static", "original_string": "private static Logger LOG = LoggerFactory.getLogger(OTPServerTask.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "grap...
{ "body": "@Override\n public BulkPathsResponse BulkFindPaths(BulkPathsRequest req) throws TException {\n LOG.debug(\"BulkFindPaths called\");\n long startTime = System.currentTimeMillis();\n\n PathOptions pathOptions = req.getOptions();\n BulkPathsResponse res = new BulkPathsResponse()...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_5
{ "fields": [], "file": "openstreetmap/src/test/java/org/opentripplanner/openstreetmap/model/OSMNodeTest.java", "identifier": "OSMNodeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsMultiLevel() {\n OSMNode node = new OSMNode();\n assertFalse(node.isMultiLevel());\n \n node.addTag(\"highway\", \"var\");\n assertFalse(node.isMultiLevel());\n \n node.addTag(\"highway\", \"elevator\");\n assertTrue(node....
{ "fields": [ { "declarator": "lat", "modifier": "@Setter\n @Getter\n private", "original_string": "@Setter\n @Getter\n private double lat;", "type": "double", "var_name": "lat" }, { "declarator": "lon", "modifier": "@Setter\n @Getter\n private",...
{ "body": "public boolean isMultiLevel() {\n return hasTag(\"highway\") && \"elevator\".equals(getTag(\"highway\"));\n }", "class_method_signature": "OSMNode.isMultiLevel()", "constructor": false, "full_signature": "public boolean isMultiLevel()", "identifier": "isMultiLevel", "invocations": [ ...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_15
{ "fields": [], "file": "openstreetmap/src/test/java/org/opentripplanner/openstreetmap/model/OSMWayTest.java", "identifier": "OSMWayTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsRoundabout() {\n OSMWay way = new OSMWay();\n assertFalse(way.isRoundabout());\n\n way.addTag(\"junction\", \"dovetail\");\n assertFalse(way.isRoundabout());\n\n way.addTag(\"junction\", \"roundabout\");\n assertTrue(way.isRoundabout())...
{ "fields": [ { "declarator": "_nodes = new ArrayList<Long>()", "modifier": "private", "original_string": "private List<Long> _nodes = new ArrayList<Long>();", "type": "List<Long>", "var_name": "_nodes" } ], "file": "openstreetmap/src/main/java/org/opentripplanner/openstreetm...
{ "body": "public boolean isRoundabout() {\n return \"roundabout\".equals(getTag(\"junction\"));\n }", "class_method_signature": "OSMWay.isRoundabout()", "constructor": false, "full_signature": "public boolean isRoundabout()", "identifier": "isRoundabout", "invocations": [ "equals", "getTa...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_2
{ "fields": [], "file": "opentripplanner-utils/src/test/java/org/opentripplanner/common/model/GenericLocationTest.java", "identifier": "GenericLocationTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testFromOldStyleString() {\n GenericLocation loc = GenericLocation.fromOldStyleString(\"name::12345\");\n assertEquals(\"name\", loc.getName());\n assertEquals(\"12345\", loc.getPlace());\n \n NamedPlace np = loc.getNamedPlace();\n assertEqua...
{ "fields": [ { "declarator": "name", "modifier": "private final", "original_string": "private final String name;", "type": "String", "var_name": "name" }, { "declarator": "place", "modifier": "private final", "original_string": "private final String place;"...
{ "body": "public static GenericLocation fromOldStyleString(String input) {\n String name = \"\";\n String place = input;\n if (input.contains(\"::\")) {\n String[] parts = input.split(\"::\");\n name = parts[0];\n place = parts[1];\n }\n return new ...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_19
{ "fields": [], "file": "opentripplanner-routing/src/test/java/org/opentripplanner/routing/util/IncrementingIdGeneratorTest.java", "identifier": "IncrementingIdGeneratorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testConstructWithStart() {\n int start = 102;\n UniqueIdGenerator<String> gen = new IncrementingIdGenerator<String>(start);\n assertEquals(start, gen.getId(\"\"));\n assertEquals(start + 1, gen.getId(\"fake\"));\n assertEquals(start + 2, gen.getId(\...
{ "fields": [ { "declarator": "next", "modifier": "private", "original_string": "private int next;", "type": "int", "var_name": "next" } ], "file": "opentripplanner-routing/src/main/java/org/opentripplanner/routing/util/IncrementingIdGenerator.java", "identifier": "Incremen...
{ "body": "public int getId(T elem) {\n return next++;\n }", "class_method_signature": "IncrementingIdGenerator.getId(T elem)", "constructor": false, "full_signature": "public int getId(T elem)", "identifier": "getId", "invocations": [], "modifiers": "public", "parameters": "(T elem)", "retu...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_35
{ "fields": [], "file": "opentripplanner-geocoder/src/test/java/org/opentripplanner/geocoder/GeocoderNullImplTest.java", "identifier": "GeocoderNullImplTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGeocode() {\n Geocoder nullGeocoder = new GeocoderNullImpl();\n GeocoderResults result = nullGeocoder.geocode(\"121 elm street\", null);\n assertEquals(\"stub response\", GeocoderNullImpl.ERROR_MSG, result.getError());\n }", "class_method_signature": "Ge...
{ "fields": [ { "declarator": "ERROR_MSG = \"no geocoder configured\"", "modifier": "static final", "original_string": "static final String ERROR_MSG = \"no geocoder configured\";", "type": "String", "var_name": "ERROR_MSG" } ], "file": "opentripplanner-geocoder/src/main/java...
{ "body": "@Override\n public GeocoderResults geocode(String address, Envelope bbox) {\n return new GeocoderResults(ERROR_MSG);\n }", "class_method_signature": "GeocoderNullImpl.geocode(String address, Envelope bbox)", "constructor": false, "full_signature": "@Override public GeocoderResults geocod...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_23
{ "fields": [], "file": "opentripplanner-api-thrift/src/test/java/org/opentripplanner/api/thrift/util/RoutingRequestBuilderTest.java", "identifier": "RoutingRequestBuilderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSetNumItineraries() {\n int n = 3;\n RoutingRequest rr = (new RoutingRequestBuilder()).setNumItineraries(n).build();\n assertEquals(n, rr.getNumItineraries());\n }", "class_method_signature": "RoutingRequestBuilderTest.testSetNumItineraries()", "constr...
{ "fields": [ { "declarator": "routingRequest", "modifier": "private final", "original_string": "private final RoutingRequest routingRequest;", "type": "RoutingRequest", "var_name": "routingRequest" }, { "declarator": "graph", "modifier": "private", "origina...
{ "body": "public RoutingRequestBuilder setNumItineraries(int n) {\n routingRequest.setNumItineraries(n);\n return this;\n }", "class_method_signature": "RoutingRequestBuilder.setNumItineraries(int n)", "constructor": false, "full_signature": "public RoutingRequestBuilder setNumItineraries(int ...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_22
{ "fields": [], "file": "opentripplanner-api-thrift/src/test/java/org/opentripplanner/api/thrift/util/RoutingRequestBuilderTest.java", "identifier": "RoutingRequestBuilderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testAddTripParameters() {\n TripParameters tp = new TripParameters();\n tp.addToAllowed_modes(TravelMode.WALK);\n tp.addToAllowed_modes(TravelMode.CAR);\n\n LatLng originLatLng = new LatLng(1.0, 2.5);\n Location origin = new Location();\n ori...
{ "fields": [ { "declarator": "routingRequest", "modifier": "private final", "original_string": "private final RoutingRequest routingRequest;", "type": "RoutingRequest", "var_name": "routingRequest" }, { "declarator": "graph", "modifier": "private", "origina...
{ "body": "public RoutingRequestBuilder addTripParameters(TripParameters tripParams) {\n if (tripParams.isSetAllowed_modes()) {\n Set<TravelMode> allowedModes = tripParams.getAllowed_modes();\n setTravelModes(new TravelModeSet(allowedModes));\n }\n\n // Set trip timing infor...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_34
{ "fields": [ { "declarator": "geocoderServer", "modifier": "private", "original_string": "private GeocoderServer geocoderServer;", "type": "GeocoderServer", "var_name": "geocoderServer" } ], "file": "opentripplanner-geocoder/src/test/java/org/opentripplanner/geocoder/ws/Geoc...
{ "body": "@Test(expected = WebApplicationException.class)\n public void testGeocodeNoAddress() {\n geocoderServer.geocode(null, null);\n fail(\"Should have thrown an error\");\n }", "class_method_signature": "GeocoderServerTest.testGeocodeNoAddress()", "constructor": false, "full_signature"...
{ "fields": [ { "declarator": "geocoder", "modifier": "private", "original_string": "private Geocoder geocoder;", "type": "Geocoder", "var_name": "geocoder" } ], "file": "opentripplanner-geocoder/src/main/java/org/opentripplanner/geocoder/ws/GeocoderServer.java", "identifie...
{ "body": "@GET\n @Produces({MediaType.APPLICATION_XML + \"; charset=UTF-8\", MediaType.APPLICATION_JSON + \"; charset=UTF-8\"})\n public GeocoderResults geocode(\n @QueryParam(\"address\") String address,\n @QueryParam(\"bbox\") String bbox) {\n if (address == null) {\n ...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_18
{ "fields": [], "file": "opentripplanner-routing/src/test/java/org/opentripplanner/routing/util/IncrementingIdGeneratorTest.java", "identifier": "IncrementingIdGeneratorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testConstruct() {\n UniqueIdGenerator<String> gen = new IncrementingIdGenerator<String>();\n assertEquals(0, gen.getId(\"\"));\n assertEquals(1, gen.getId(\"fake\"));\n assertEquals(2, gen.getId(\"foo\"));\n }", "class_method_signature": "Incrementing...
{ "fields": [ { "declarator": "next", "modifier": "private", "original_string": "private int next;", "type": "int", "var_name": "next" } ], "file": "opentripplanner-routing/src/main/java/org/opentripplanner/routing/util/IncrementingIdGenerator.java", "identifier": "Incremen...
{ "body": "public int getId(T elem) {\n return next++;\n }", "class_method_signature": "IncrementingIdGenerator.getId(T elem)", "constructor": false, "full_signature": "public int getId(T elem)", "identifier": "getId", "invocations": [], "modifiers": "public", "parameters": "(T elem)", "retu...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_3
{ "fields": [], "file": "opentripplanner-utils/src/test/java/org/opentripplanner/common/model/GenericLocationTest.java", "identifier": "GenericLocationTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testFromStringWithEdgeAndHeading() {\n String s = \"40.75542978896869,-73.97618338000376 heading=29.028895183287617 edgeId=2767\";\n GenericLocation loc = GenericLocation.fromOldStyleString(s);\n assertEquals(29.028895183287617, loc.getHeading(), 0.00001);\n ...
{ "fields": [ { "declarator": "name", "modifier": "private final", "original_string": "private final String name;", "type": "String", "var_name": "name" }, { "declarator": "place", "modifier": "private final", "original_string": "private final String place;"...
{ "body": "public static GenericLocation fromOldStyleString(String input) {\n String name = \"\";\n String place = input;\n if (input.contains(\"::\")) {\n String[] parts = input.split(\"::\");\n name = parts[0];\n place = parts[1];\n }\n return new ...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
11664357_14
{ "fields": [], "file": "openstreetmap/src/test/java/org/opentripplanner/openstreetmap/model/OSMWayTest.java", "identifier": "OSMWayTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsSteps() {\n OSMWay way = new OSMWay();\n assertFalse(way.isSteps());\n\n way.addTag(\"highway\", \"primary\");\n assertFalse(way.isSteps());\n\n way.addTag(\"highway\", \"steps\");\n assertTrue(way.isSteps());\n }", "class_method_s...
{ "fields": [ { "declarator": "_nodes = new ArrayList<Long>()", "modifier": "private", "original_string": "private List<Long> _nodes = new ArrayList<Long>();", "type": "List<Long>", "var_name": "_nodes" } ], "file": "openstreetmap/src/main/java/org/opentripplanner/openstreetm...
{ "body": "public boolean isSteps() {\n return \"steps\".equals(getTag(\"highway\"));\n }", "class_method_signature": "OSMWay.isSteps()", "constructor": false, "full_signature": "public boolean isSteps()", "identifier": "isSteps", "invocations": [ "equals", "getTag" ], "modifiers": "pu...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11664357, "size": 4200, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/dssg/cta-otp" }
88544701_222
{ "fields": [ { "declarator": "observer", "modifier": "@Mock\n private", "original_string": "@Mock\n private StreamObserver<MSG_Notification> observer;", "type": "StreamObserver<MSG_Notification>", "var_name": "observer" }, { "declarator": "projection", "mod...
{ "body": "@Test\n void testOnComplete() {\n GrpcObserverAdapter uut = new GrpcObserverAdapter(\"foo\", observer, projection);\n uut.onComplete();\n verify(observer).onCompleted();\n }", "class_method_signature": "GrpcObserverAdapterTest.testOnComplete()", "constructor": false, "full_...
{ "fields": [ { "declarator": "converter = new ProtoConverter()", "modifier": "final", "original_string": "final ProtoConverter converter = new ProtoConverter();", "type": "ProtoConverter", "var_name": "converter" }, { "declarator": "id", "modifier": "@NonNull\n ...
{ "body": "@Override\n public void onComplete() {\n log.info(\"{} onComplete – sending complete notification\", id);\n observer.onNext(converter.createCompleteNotification());\n tryComplete();\n }", "class_method_signature": "GrpcObserverAdapter.onComplete()", "constructor": false, "f...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_45
{ "fields": [ { "declarator": "uut = new ProtoConverter()", "modifier": "", "original_string": "ProtoConverter uut = new ProtoConverter();", "type": "ProtoConverter", "var_name": "uut" } ], "file": "factcast-grpc-api/src/test/java/org/factcast/grpc/api/conv/ProtoConverterTest...
{ "body": "@Test\n void testToProtoOptionalLongPresent() {\n MSG_OptionalSerial msg = uut.toProto(OptionalLong.of(133));\n assertTrue(msg.getPresent());\n assertEquals(133, msg.getSerial());\n }", "class_method_signature": "ProtoConverterTest.testToProtoOptionalLongPresent()", "construc...
{ "fields": [ { "declarator": "EMPTY = MSG_Empty.newBuilder().build()", "modifier": "private static final", "original_string": "private static final MSG_Empty EMPTY = MSG_Empty.newBuilder().build();", "type": "MSG_Empty", "var_name": "EMPTY" } ], "file": "factcast-grpc-api/sr...
{ "body": "@NonNull\n public MSG_UUID toProto(@NonNull UUID id) {\n return MSG_UUID.newBuilder()\n .setLsb(id.getLeastSignificantBits())\n .setMsb(id.getMostSignificantBits())\n .build();\n }", "class_method_signature": "ProtoConverter.toProto(@NonNull UUID ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_12
{ "fields": [ { "declarator": "serial = new AtomicLong(5)", "modifier": "private", "original_string": "private AtomicLong serial = new AtomicLong(5);", "type": "AtomicLong", "var_name": "serial" }, { "declarator": "uut = new PgIdFactExtractor(serial)", "modifier":...
{ "body": "@Test\n void testMapRowNullContracts() throws Exception {\n\n assertThrows(NullPointerException.class, () -> {\n uut.mapRow(null, 1);\n });\n }", "class_method_signature": "PgIdFactExtractorTest.testMapRowNullContracts()", "constructor": false, "full_signature": "@Test ...
{ "fields": [ { "declarator": "serial", "modifier": "final", "original_string": "final AtomicLong serial;", "type": "AtomicLong", "var_name": "serial" } ], "file": "factcast-store-pgsql/src/main/java/org/factcast/store/pgsql/internal/rowmapper/PgIdFactExtractor.java", "iden...
{ "body": "@Override\n @NonNull\n public Fact mapRow(@NonNull ResultSet rs, int rowNum) throws SQLException {\n serial.set(rs.getLong(PgConstants.COLUMN_SER));\n return new IdOnlyFact(UUID.fromString(rs.getString(PgConstants.ALIAS_ID)));\n }", "class_method_signature": "PgIdFactExtractor.mapR...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_5
{ "fields": [ { "declarator": "uut", "modifier": "", "original_string": "PgSynchronizedQuery uut;", "type": "PgSynchronizedQuery", "var_name": "uut" }, { "declarator": "jdbcTemplate", "modifier": "@Mock(answer = Answers.RETURNS_DEEP_STUBS)", "original_string...
{ "body": "@Test\n public void testRunWithIndex() throws Exception {\n uut = new PgSynchronizedQuery(jdbcTemplate, sql, setter, rowHandler, serialToContinueFrom,\n fetcher);\n uut.run(true);\n verify(jdbcTemplate, never()).execute(startsWith(\"SET LOCAL enable_bitmapscan\"));\n ...
{ "fields": [ { "declarator": "jdbcTemplate", "modifier": "@NonNull\n final", "original_string": "@NonNull\n final JdbcTemplate jdbcTemplate;", "type": "JdbcTemplate", "var_name": "jdbcTemplate" }, { "declarator": "sql", "modifier": "@NonNull\n final", ...
{ "body": "@SuppressWarnings(\"SameReturnValue\")\n public synchronized void run(boolean useIndex) {\n // TODO recheck latest handling - looks broken\n long latest = latestFetcher.retrieveLatestSer();\n transactionTemplate.execute(status -> {\n if (!useIndex)\n jdbcTe...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_53
{ "fields": [ { "declarator": "uut = new ProtoConverter()", "modifier": "", "original_string": "ProtoConverter uut = new ProtoConverter();", "type": "ProtoConverter", "var_name": "uut" } ], "file": "factcast-grpc-api/src/test/java/org/factcast/grpc/api/conv/ProtoConverterTest...
{ "body": "@Test\n public void testToProtoBoolean() throws Exception {\n assertFalse(uut.toProto(false).getSuccess());\n assertTrue(uut.toProto(true).getSuccess());\n }", "class_method_signature": "ProtoConverterTest.testToProtoBoolean()", "constructor": false, "full_signature": "@Test publi...
{ "fields": [ { "declarator": "EMPTY = MSG_Empty.newBuilder().build()", "modifier": "private static final", "original_string": "private static final MSG_Empty EMPTY = MSG_Empty.newBuilder().build();", "type": "MSG_Empty", "var_name": "EMPTY" } ], "file": "factcast-grpc-api/sr...
{ "body": "@NonNull\n public MSG_UUID toProto(@NonNull UUID id) {\n return MSG_UUID.newBuilder()\n .setLsb(id.getLeastSignificantBits())\n .setMsb(id.getMostSignificantBits())\n .build();\n }", "class_method_signature": "ProtoConverter.toProto(@NonNull UUID ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_166
{ "fields": [ { "declarator": "store", "modifier": "@Mock\n private", "original_string": "@Mock\n private FactStore store;", "type": "FactStore", "var_name": "store" }, { "declarator": "uut", "modifier": "@InjectMocks\n private", "original_string": ...
{ "body": "@Test\n public void testSubscribeReconnectsOnError() throws Exception {\n\n Subscription sub1 = mock(Subscription.class);\n Subscription sub2 = mock(Subscription.class);\n ArgumentCaptor<FactObserver> observer = ArgumentCaptor.forClass(FactObserver.class);\n when(store.subscr...
{ "fields": [ { "declarator": "store", "modifier": "@NonNull\n final", "original_string": "@NonNull\n final FactStore store;", "type": "FactStore", "var_name": "store" } ], "file": "factcast-core/src/main/java/org/factcast/core/DefaultFactCast.java", "identifier": "De...
{ "body": "@Override\n public Subscription subscribe(@NonNull SubscriptionRequest request,\n @NonNull FactObserver observer) {\n return new ReconnectingFactSubscriptionWrapper(store, SubscriptionRequestTO.forFacts(\n request),\n observer);\n }", "class_method_si...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_28
{ "fields": [ { "declarator": "env", "modifier": "@Mock", "original_string": "@Mock\n Environment env;", "type": "Environment", "var_name": "env" }, { "declarator": "uut", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n RdsDataSourceFact...
{ "body": "@Test\n public void shouldReturnFromBeforeSameBeanAsPassed() throws Exception {\n UUID instance = UUID.randomUUID();\n\n Object beforeInit = uut.postProcessBeforeInitialization(instance, \"foo\");\n\n assertThat(beforeInit).isSameAs(instance);\n }", "class_method_signature": "R...
{ "fields": [ { "declarator": "env", "modifier": "@NonNull\n private final", "original_string": "@NonNull\n private final Environment env;", "type": "Environment", "var_name": "env" } ], "file": "factcast-store-pgsql-rds/src/main/java/org/factcast/store/pgsql/rds/RdsDat...
{ "body": "@Override\n @NonNull\n public Object postProcessBeforeInitialization(@NonNull Object bean, @NonNull String beanName)\n throws BeansException {\n if (bean instanceof AmazonRdsDataSourceFactoryBean) {\n ((AmazonRdsDataSourceFactoryBean) bean).setDataSourceFactory(\n ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_189
{ "fields": [ { "declarator": "store", "modifier": "@Mock\n private", "original_string": "@Mock\n private FactStore store;", "type": "FactStore", "var_name": "store" }, { "declarator": "req", "modifier": "@Mock\n private", "original_string": "@Mock\...
{ "body": "@Test\n public void testAssertSubscriptionStateNotClosed() throws Exception {\n uut.close();\n assertThrows(SubscriptionCancelledException.class, () -> {\n uut.awaitCatchup();\n });\n assertThrows(SubscriptionCancelledException.class, () -> {\n uut.await...
{ "fields": [ { "declarator": "currentSubscription = new AtomicReference<>()", "modifier": "@NonNull\n private final", "original_string": "@NonNull\n private final AtomicReference<Subscription> currentSubscription = new AtomicReference<>();", "type": "AtomicReference<Subscription>", ...
{ "body": "private void assertSubscriptionStateNotClosed() {\n if (closed.get()) {\n throw new SubscriptionCancelledException(\"Subscription already cancelled\");\n }\n }", "class_method_signature": "ReconnectingFactSubscriptionWrapper.assertSubscriptionStateNotClosed()", "constructor"...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_218
{ "fields": [ { "declarator": "backend", "modifier": "@Mock", "original_string": "@Mock\n FactStore backend;", "type": "FactStore", "var_name": "backend" }, { "declarator": "uut", "modifier": "", "original_string": "FactStoreGrpcService uut;", "type...
{ "body": "@Test\n public void testStateFor() throws Exception {\n\n {\n UUID id = UUID.randomUUID();\n\n StateForRequest sfr = new StateForRequest(Lists.newArrayList(id), \"foo\");\n MSG_StateForRequest req = conv.toProto(sfr);\n StreamObserver o = mock(StreamObs...
{ "fields": [ { "declarator": "PROTOCOL_VERSION = ProtocolVersion.of(1, 1, 0)", "modifier": "static final", "original_string": "static final ProtocolVersion PROTOCOL_VERSION = ProtocolVersion.of(1, 1, 0);", "type": "ProtocolVersion", "var_name": "PROTOCOL_VERSION" }, { ...
{ "body": "@Override\n @Secured(FactCastRole.WRITE)\n public void stateFor(MSG_StateForRequest request, StreamObserver<MSG_UUID> responseObserver) {\n try {\n StateForRequest req = converter.fromProto(request);\n StateToken token = store.stateFor(req.aggIds(), Optional.ofNullable(re...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_90
{ "fields": [ { "declarator": "uut", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private GrpcFactStore uut;", "type": "GrpcFactStore", "var_name": "uut" }, { "declarator": "blockingStub", "modifier": "@Mock\n private", "...
{ "body": "@Test\n void testInitializationExecutesOnlyOnce() {\n when(blockingStub.handshake(any()))\n .thenReturn(conv.toProto(ServerConfig.of(ProtocolVersion.of(1, 1, 0),\n new HashMap<>())));\n uut.initialize();\n uut.initialize();\n verify(block...
{ "fields": [ { "declarator": "codecs = new CompressionCodecs()", "modifier": "private final", "original_string": "private final CompressionCodecs codecs = new CompressionCodecs();", "type": "CompressionCodecs", "var_name": "codecs" }, { "declarator": "CHANNEL_NAME = \"...
{ "body": "public synchronized void initialize() {\n if (!initialized.getAndSet(true)) {\n log.debug(\"Invoking handshake\");\n Map<String, String> serverProperties;\n ProtocolVersion serverProtocolVersion;\n try {\n ServerConfig cfg = converter.fromPr...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_131
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/IdOnlyFactTest.java", "identifier": "IdOnlyFactTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testJsonPayload() {\n Assertions.assertThrows(UnsupportedOperationException.class, () -> {\n new IdOnlyFact(UUID.randomUUID()).jsonPayload();\n });\n }", "class_method_signature": "IdOnlyFactTest.testJsonPayload()", "constructor": false, "full_signature": "...
{ "fields": [ { "declarator": "id", "modifier": "@Getter\n @NonNull\n final", "original_string": "@Getter\n @NonNull\n final UUID id;", "type": "UUID", "var_name": "id" } ], "file": "factcast-core/src/main/java/org/factcast/core/IdOnlyFact.java", "identifier": "...
{ "body": "@Override\n public String jsonPayload() {\n throw new UnsupportedOperationException();\n }", "class_method_signature": "IdOnlyFact.jsonPayload()", "constructor": false, "full_signature": "@Override public String jsonPayload()", "identifier": "jsonPayload", "invocations": [], "modif...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_127
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/IdOnlyFactTest.java", "identifier": "IdOnlyFactTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testNs() {\n Assertions.assertThrows(UnsupportedOperationException.class, () -> {\n new IdOnlyFact(UUID.randomUUID()).ns();\n });\n }", "class_method_signature": "IdOnlyFactTest.testNs()", "constructor": false, "full_signature": "@Test void testNs()", "id...
{ "fields": [ { "declarator": "id", "modifier": "@Getter\n @NonNull\n final", "original_string": "@Getter\n @NonNull\n final UUID id;", "type": "UUID", "var_name": "id" } ], "file": "factcast-core/src/main/java/org/factcast/core/IdOnlyFact.java", "identifier": "...
{ "body": "@Override\n public String ns() {\n throw new UnsupportedOperationException();\n }", "class_method_signature": "IdOnlyFact.ns()", "constructor": false, "full_signature": "@Override public String ns()", "identifier": "ns", "invocations": [], "modifiers": "@Override public", "parame...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_86
{ "fields": [ { "declarator": "uut", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private GrpcFactStore uut;", "type": "GrpcFactStore", "var_name": "uut" }, { "declarator": "blockingStub", "modifier": "@Mock\n private", "...
{ "body": "@Test\n void testEnumerateTypes() {\n HashSet<String> types = Sets.newHashSet(\"foo\", \"bar\");\n when(blockingStub.enumerateTypes(any())).thenReturn(conv.toProto(types));\n Set<String> enumerateTypes = uut.enumerateTypes(\"ns\");\n assertEquals(types, enumerateTypes);\n ...
{ "fields": [ { "declarator": "codecs = new CompressionCodecs()", "modifier": "private final", "original_string": "private final CompressionCodecs codecs = new CompressionCodecs();", "type": "CompressionCodecs", "var_name": "codecs" }, { "declarator": "CHANNEL_NAME = \"...
{ "body": "@Override\n public Set<String> enumerateTypes(String ns) {\n MSG_String ns_message = converter.toProto(ns);\n MSG_StringSet resp;\n try {\n resp = blockingStub.enumerateTypes(ns_message);\n } catch (StatusRuntimeException e) {\n throw wrapRetryable(e);\n...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }