id
stringlengths
7
14
source
stringlengths
135
41.2k
target
stringlengths
36
20.4k
context_text
stringlengths
183
4k
prompt_context
stringlengths
0
1.52k
source_ctx
stringlengths
198
41.2k
ctx_included
bool
2 classes
static_status
stringclasses
2 values
static_context
stringlengths
1.96k
252k
172743796_31
class LoggingSupplier implements RbacMappingSupplier { @Override public Map<String, Set<String>> get() { return supplier.get(); } public LoggingSupplier(final Supplier<Map<String, Set<String>>> supplier); private void logMapping(); } class LoggingSupplierTest { @Test public void testDefaultBehaviourNull...
final RbacMappingSupplier supplier = () -> null; final Map<String, Set<String>> result = new LoggingSupplier(supplier).get(); assertThat(result, is(nullValue())); } }
[FOCAL] @Override public Map<String, Set<String>> LoggingSupplier.get() [CLASS] class LoggingSupplier implements RbacMappingSupplier [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] supplier.get/0 [COLLABORATORS] field supplier get/0 [CLASS-MEMBERS] LoggingSupplier(Supplier<Map<Stri...
/* static context [FOCAL] @Override public Map<String, Set<String>> LoggingSupplier.get() [COLLABORATORS] field supplier get/0 [CALLS-EXTERNAL] supplier.get/0 */
/* static context [FOCAL] @Override public Map<String, Set<String>> LoggingSupplier.get() [COLLABORATORS] field supplier get/0 [CALLS-EXTERNAL] supplier.get/0 */ class LoggingSupplier implements RbacMappingSupplier { @Override public Map<String, Set<String>> get() { return supplier.get(); } public LoggingSuppl...
true
ok
{"focal": {"class": "LoggingSupplier", "name": "get", "signature": "Map<String, Set<String>> get()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Map<String, Set<String>>"}, "class_info": {"name": "LoggingSupplier", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "...
172750723_127
class LongValueRecorderSdk extends AbstractSynchronousInstrument<BoundInstrument> implements LongValueRecorder { @Override public void record(long value, Labels labels) { BoundInstrument boundInstrument = bind(labels); boundInstrument.record(value); boundInstrument.unbind(); } private LongValueRe...
long startTime = testClock.now(); LongValueRecorderSdk longMeasure = testSdk.longValueRecorderBuilder("testRecorder").build(); BoundLongValueRecorder boundMeasure = longMeasure.bind(Labels.of("K", "V")); try { // Do some records using bounds and direct calls and bindings. longMeasure.record(...
[FOCAL] @Override public void LongValueRecorderSdk.record(long value, Labels labels) [CLASS] class LongValueRecorderSdk extends AbstractSynchronousInstrument<BoundInstrument> implements LongValueRecorder [METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] bind/1 (inherited), BoundInstr...
/* static context [FOCAL] @Override public void LongValueRecorderSdk.record(long value, Labels labels) [CALLS-EXTERNAL] bind/1 (inherited), BoundInstrument.record/1, BoundInstrument.unbind/0 */
/* static context [FOCAL] @Override public void LongValueRecorderSdk.record(long value, Labels labels) [CALLS-EXTERNAL] bind/1 (inherited), BoundInstrument.record/1, BoundInstrument.unbind/0 */ class LongValueRecorderSdk extends AbstractSynchronousInstrument<BoundInstrument> implements LongValueRecorder { @Override ...
true
ok
{"focal": {"class": "LongValueRecorderSdk", "name": "record", "signature": "void record(long value, Labels labels)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "value", "type": "long"}, {"name": "labels", "type": "Labels"}], "return_type": "void"}, "class_info": {"name": "LongValueRecorderSdk...
172981843_7
class SqsStreamProvisioner implements ProvisioningProvider<ExtendedConsumerProperties<SqsConsumerProperties>, ExtendedProducerProperties<SqsProducerProperties>> { @Override public ProducerDestination provisionProducerDestination(String name, ...
ExtendedProducerProperties<SqsProducerProperties> producerProperties = new ExtendedProducerProperties<>(new SqsProducerProperties()); sqsStreamProvisioner.provisionProducerDestination("topic-name", producerProperties); List<String> topicArns = listTopicsArns(); assertThat(topicArns).ha...
[FOCAL] @Override public ProducerDestination SqsStreamProvisioner.provisionProducerDestination(String name, ExtendedProducerProperties<SqsProducerProperties> properties) [CLASS] class SqsStreamProvisioner implements ProvisioningProvider<ExtendedConsumerProperties<SqsConsumerProperties>, ExtendedProducerProperties<SqsPr...
/* static context [FOCAL] @Override public ProducerDestination SqsStreamProvisioner.provisionProducerDestination(String name, ExtendedProducerProperties<SqsProducerProperties> properties) [INPUTS] branches=- | result=name | unused=properties [COLLABORATORS] field amazonSNSAsync createTopic/1 [EXCEPTIONS] declares Provi...
/* static context [FOCAL] @Override public ProducerDestination SqsStreamProvisioner.provisionProducerDestination(String name, ExtendedProducerProperties<SqsProducerProperties> properties) [INPUTS] branches=- | result=name | unused=properties [COLLABORATORS] field amazonSNSAsync createTopic/1 [EXCEPTIONS] declares Provi...
true
ok
{"focal": {"class": "SqsStreamProvisioner", "name": "provisionProducerDestination", "signature": "ProducerDestination provisionProducerDestination(String name, ExtendedProducerProperties<SqsProducerProperties> properties) throws ProvisioningException", "start_line": 4, "modifiers": "@Override public", "params": [{"name...
173167316_16
class TransactionProcessor { public void setAvailableKeys(@NotNull List<String> availableKeys) { this.availableKeys = availableKeys; } public TransactionProcessor( @NotNull ISerializationProvider serializationProvider, @NotNull IRPCProvider rpcProvider, @NotNul...
this.mockDefaultSuccessData(); TransactionProcessor processor = createAndPrepareTransaction(this.defaultActions()); assertNotNull(processor); List<String> availableKey = new ArrayList<>(); availableKey.add("Key3"); availableKey.add("Key4"); processor.setAvailable...
[FOCAL] public void TransactionProcessor.setAvailableKeys(List<String> availableKeys) [CLASS] class TransactionProcessor [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [FIELDS] write=availableKeys [STATE] availableKeys [DATAFLOW] availableKeys@param->L2 [CLASS-MEMBERS] TransactionProcessor(ISerial...
/* static context [FOCAL] public void TransactionProcessor.setAvailableKeys(List<String> availableKeys) [STATE] availableKeys [FIELDS] write=availableKeys */
/* static context [FOCAL] public void TransactionProcessor.setAvailableKeys(List<String> availableKeys) [STATE] availableKeys [FIELDS] write=availableKeys */ class TransactionProcessor { public void setAvailableKeys(@NotNull List<String> availableKeys) { this.availableKeys = availableKeys; } publi...
true
ok
{"focal": {"class": "TransactionProcessor", "name": "setAvailableKeys", "signature": "void setAvailableKeys(List<String> availableKeys)", "start_line": 3, "modifiers": "public", "params": [{"name": "availableKeys", "type": "List<String>"}], "return_type": "void"}, "class_info": {"name": "TransactionProcessor", "kind": ...
173228436_63
class IntPropertySet extends PropertySet { public void putInt(long index, int value) { PropertyPage page = getOrCreatePage(getPageID(index)); int n = page.getSize(); page.addInt(getPageOffset(index), value); numProperties += page.getSize() - n; } public IntPropertySet(String name); @Override public int ...
for (int i = 0; i < 10000; i++) { ps.putInt(i, i); } LongIterator it = ps.getPropertyIterator(); int i = 0; while (it.hasNext()) { long l = it.next(); assertEquals(i, l); i++; } assertEquals(i, 10000); } }
[FOCAL] public void IntPropertySet.putInt(long index, int value) [CLASS] class IntPropertySet extends PropertySet [METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] getOrCreatePage/1 (inherited), getPageID/1 (inherited), PropertyPage.getSize/0, PropertyPage.addInt/2, getPageOffset/1 (...
/* static context [FOCAL] public void IntPropertySet.putInt(long index, int value) [CALLS-EXTERNAL] getOrCreatePage/1 (inherited), getPageID/1 (inherited), PropertyPage.getSize/0, PropertyPage.addInt/2, getPageOffset/1 (inherited) */
/* static context [FOCAL] public void IntPropertySet.putInt(long index, int value) [CALLS-EXTERNAL] getOrCreatePage/1 (inherited), getPageID/1 (inherited), PropertyPage.getSize/0, PropertyPage.addInt/2, getPageOffset/1 (inherited) */ class IntPropertySet extends PropertySet { public void putInt(long index, int value)...
true
ok
{"focal": {"class": "IntPropertySet", "name": "putInt", "signature": "void putInt(long index, int value)", "start_line": 3, "modifiers": "public", "params": [{"name": "index", "type": "long"}, {"name": "value", "type": "int"}], "return_type": "void"}, "class_info": {"name": "IntPropertySet", "kind": "class", "modifiers...
173230987_13
class DownstreamPathCalculator { public String calculateDownstreamPath(final String receivedRequestUri) { // This function is required to join httpDownStreamPathPrefix with receivedRequestURI // remove any duplicate "/" // Not have an ending "/" if the path // assumes httpdownstreamPathPrefix does no...
final DownstreamPathCalculator calc = new DownstreamPathCalculator("/"); final String result = calc.calculateDownstreamPath("/"); assertThat(result).isEqualTo("/"); } }
[FOCAL] public String DownstreamPathCalculator.calculateDownstreamPath(String receivedRequestUri) [CLASS] class DownstreamPathCalculator [METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] String.replaceAll/2, String.length/0 [INPUTS] branches=- | result=receivedRequestUri [DATAFLOW] ...
/* static context [FOCAL] public String DownstreamPathCalculator.calculateDownstreamPath(String receivedRequestUri) [INPUTS] branches=- | result=receivedRequestUri [CALLS-EXTERNAL] String.replaceAll/2, String.length/0 */
/* static context [FOCAL] public String DownstreamPathCalculator.calculateDownstreamPath(String receivedRequestUri) [INPUTS] branches=- | result=receivedRequestUri [CALLS-EXTERNAL] String.replaceAll/2, String.length/0 */ class DownstreamPathCalculator { public String calculateDownstreamPath(final String receivedRequ...
true
ok
{"focal": {"class": "DownstreamPathCalculator", "name": "calculateDownstreamPath", "signature": "String calculateDownstreamPath(String receivedRequestUri)", "start_line": 3, "modifiers": "public", "params": [{"name": "receivedRequestUri", "type": "String"}], "return_type": "String"}, "class_info": {"name": "DownstreamP...
173306807_22
class ParameterizableStringListFactory extends AbstractFeatureFactory<T> { @Override public Pair<T, T> crossover(T parentA, T parentB) { Set<String> union = new HashSet<>(); for (ParameterizableString p : parentA.getParameterizableStrings()) { union.add(p.getFactoryId()); }...
String paramString = "recip(rord(creationDate),[1,2,3],[10,100,1000],[$2])"; TestParam t1 = new TestParam("bf", "0", "recip(rord(creationDate),2,100,100)"); TestParam t2 = new TestParam("bf", "0", "recip(rord(creationDate),1,1000,1000)"); ParameterizableS...
[FOCAL] @Override public Pair<T, T> ParameterizableStringListFactory.crossover(T parentA, T parentB) [CLASS] class ParameterizableStringListFactory extends AbstractFeatureFactory<T> [METRICS] loc=35 cc=5 branches=0 loops=4 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] T buildCrossOver(List<String> factoryIds, T parentA...
/* static context [FOCAL] @Override public Pair<T, T> ParameterizableStringListFactory.crossover(T parentA, T parentB) [PATH1] foreach(ParameterizableString p : parentA.getParameterizableStrings())=T -> exit loop -> foreach(ParameterizableString p : parentB.getParameterizableStrings())=F -> for(i < sz)#1=F -> for(i < s...
/* static context [FOCAL] @Override public Pair<T, T> ParameterizableStringListFactory.crossover(T parentA, T parentB) [PATH1] foreach(ParameterizableString p : parentA.getParameterizableStrings())=T -> exit loop -> foreach(ParameterizableString p : parentB.getParameterizableStrings())=F -> for(i < sz)#1=F -> for(i < s...
true
ok
{"focal": {"class": "ParameterizableStringListFactory", "name": "crossover", "signature": "Pair<T, T> crossover(T parentA, T parentB)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "parentA", "type": "T"}, {"name": "parentB", "type": "T"}], "return_type": "Pair<T, T>"}, "class_info": {"name": "...
173335706_175
class DataSourceController extends BaseController { @ApiOperation(value = "delete", notes = "DELETE_DATA_SOURCE_NOTES") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "DATA_SOURCE_ID", required = true, dataType = "Int", example = "100") }) @GetMapping(value = "/delete") @Re...
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>(); paramsMap.add("id","16"); MvcResult mvcResult = mockMvc.perform(get("/datasources/delete") .header("sessionId", sessionId) .params(paramsMap)) .andExpect(status().isOk()) ...
[FOCAL] @ApiOperation(value = "delete", notes = "DELETE_DATA_SOURCE_NOTES") @ApiImplicitParams({ @ApiImplicitParam(name = "id... Result DataSourceController.delete(User loginUser, int id) [CLASS] class DataSourceController extends BaseController [METRICS] loc=12 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CAL...
class DataSourceController extends BaseController { @ApiOperation(value = "delete", notes = "DELETE_DATA_SOURCE_NOTES") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "DATA_SOURCE_ID", required = true, dataType = "Int", example = "100") }) @GetMapping(value = "/delete") @Re...
false
ok
{"focal": {"class": "DataSourceController", "name": "delete", "signature": "Result delete(User loginUser, int id)", "start_line": 3, "modifiers": "@ApiOperation(value = \"delete\", notes = \"DELETE_DATA_SOURCE_NOTES\") @ApiImplicitParams({ @ApiImplicitParam(name = \"id...", "params": [{"name": "loginUser", "type": "Use...
173409096_54
class ResolverUtil { public void setClassLoader(ClassLoader classloader) { this.classloader = classloader; } public Set<Class<? extends T>> getClasses(); public ClassLoader getClassLoader(); public ResolverUtil<T> findImplementations(Class<?> parent, String... packageNames); public Res...
ResolverUtil resolverUtil = new ResolverUtil(); AccessController.doPrivileged((PrivilegedAction<Void>) () -> { resolverUtil.setClassLoader(new ClassLoader() { }); return null; }); assertNotEquals(resolverUtil.getClassLoader(), currentContextClassLoader...
[FOCAL] public void ResolverUtil.setClassLoader(ClassLoader classloader) [CLASS] class ResolverUtil [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [FIELDS] write=classloader [STATE] classloader [DATAFLOW] classloader@param->L2 [CLASS-MEMBERS] Set<Class<? extends T>> getClasses(); ClassLoader getCl...
/* static context [FOCAL] public void ResolverUtil.setClassLoader(ClassLoader classloader) [STATE] classloader [FIELDS] write=classloader */
/* static context [FOCAL] public void ResolverUtil.setClassLoader(ClassLoader classloader) [STATE] classloader [FIELDS] write=classloader */ class ResolverUtil { public void setClassLoader(ClassLoader classloader) { this.classloader = classloader; } public Set<Class<? extends T>> getClasses(); ...
true
ok
{"focal": {"class": "ResolverUtil", "name": "setClassLoader", "signature": "void setClassLoader(ClassLoader classloader)", "start_line": 3, "modifiers": "public", "params": [{"name": "classloader", "type": "ClassLoader"}], "return_type": "void"}, "class_info": {"name": "ResolverUtil", "kind": "class", "modifiers": "", ...
173534034_11
class CodeRequest { public static CodeRequest newCodeRequest(HarRequest harRequest) throws Exception { return new CodeRequest(harRequest); } private CodeRequest(HarRequest harRequest); private void validateMimeType(); public Map<String, List<String>> queryStringsToMap(); public Optional<HarHeader> f...
HarRequest harRequest = new HarRequest() .withUrl(HTTP_URL) .withPostData(new HarPostData().withMimeType(MediaType.APPLICATION_JSON)) ; Exception thrown = assertThrows( Exception.class, () -> newCodeRequest(harRequest), "Expected exception thrown")...
[FOCAL] public static CodeRequest CodeRequest.newCodeRequest(HarRequest harRequest) [CLASS] class CodeRequest [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] CodeRequest [EXCEPTIONS] declares Exception [INPUTS] branches=- | result=harRequest [DATAFLOW] harRequest@param->L2 [CLASS-MEMBERS] Cod...
/* static context [FOCAL] public static CodeRequest CodeRequest.newCodeRequest(HarRequest harRequest) [INPUTS] branches=- | result=harRequest [EXCEPTIONS] declares Exception [NEW] CodeRequest */
/* static context [FOCAL] public static CodeRequest CodeRequest.newCodeRequest(HarRequest harRequest) [INPUTS] branches=- | result=harRequest [EXCEPTIONS] declares Exception [NEW] CodeRequest */ class CodeRequest { public static CodeRequest newCodeRequest(HarRequest harRequest) throws Exception { return new Code...
true
ok
{"focal": {"class": "CodeRequest", "name": "newCodeRequest", "signature": "CodeRequest newCodeRequest(HarRequest harRequest) throws Exception", "start_line": 3, "modifiers": "public static", "params": [{"name": "harRequest", "type": "HarRequest"}], "return_type": "CodeRequest"}, "class_info": {"name": "CodeRequest", "k...
173572330_47
class CustomViewTarget implements Target<Z> { @Override public final void getSize(@NonNull SizeReadyCallback cb) { sizeDeterminer.getSize(cb); } public CustomViewTarget(@NonNull T view); protected abstract void onResourceCleared(@Nullable Drawable placeholder); protected void onResou...
activity.visible(); view.setLayoutParams(new FrameLayout.LayoutParams(100, 100)); view.setPadding(25, 25, 25, 25); view.requestLayout(); target.getSize(cb); verify(cb).onSizeReady(50, 50); } }
[FOCAL] @Override public final void CustomViewTarget.getSize(SizeReadyCallback cb) [CLASS] class CustomViewTarget implements Target<Z> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] sizeDeterminer.getSize/1 [COLLABORATORS] field sizeDeterminer getSize/1 [DATAFLOW] cb@param->L3 [CL...
/* static context [FOCAL] @Override public final void CustomViewTarget.getSize(SizeReadyCallback cb) [COLLABORATORS] field sizeDeterminer getSize/1 [CALLS-EXTERNAL] sizeDeterminer.getSize/1 */
/* static context [FOCAL] @Override public final void CustomViewTarget.getSize(SizeReadyCallback cb) [COLLABORATORS] field sizeDeterminer getSize/1 [CALLS-EXTERNAL] sizeDeterminer.getSize/1 */ class CustomViewTarget implements Target<Z> { @Override public final void getSize(@NonNull SizeReadyCallback cb) { ...
true
ok
{"focal": {"class": "CustomViewTarget", "name": "getSize", "signature": "void getSize(SizeReadyCallback cb)", "start_line": 3, "modifiers": "@Override public final", "params": [{"name": "cb", "type": "SizeReadyCallback"}], "return_type": "void"}, "class_info": {"name": "CustomViewTarget", "kind": "class", "modifiers": ...
173721564_1
class ProtobufMsgFactory { @SuppressWarnings("unchecked") public static <T extends Message> T newMessageByProtoClassName(final String className, final byte[] bs) { final MethodHandle handle = PARSE_METHODS_4PROTO.get(className); if (handle == null) { throw new MessageClassNotFoundEx...
SnapshotMeta meta = SnapshotMeta.newBuilder().setLastIncludedIndex(99).setLastIncludedTerm(1).build(); SnapshotMeta pMeta = ProtobufMsgFactory.newMessageByProtoClassName("jraft.SnapshotMeta", meta.toByteArray()); assertNotNull(pMeta); assertNotSame(pMeta, meta); assertEquals(pMet...
[FOCAL] @SuppressWarnings("unchecked") public static T ProtobufMsgFactory.newMessageByProtoClassName(String className, byte[] bs) [CLASS] class ProtobufMsgFactory [METRICS] loc=12 cc=3 branches=1 loops=0 returns=1 throws=2 nesting=1 [CALLS-EXTERNAL] PARSE_METHODS_4PROTO.get/1, MethodHandle.invoke/1 [NEW] MessageClassNo...
/* static context [FOCAL] @SuppressWarnings("unchecked") public static T ProtobufMsgFactory.newMessageByProtoClassName(String className, byte[] bs) [THROWS-WHEN] MessageClassNotFoundException when handle == null [THROWS-WHEN] SerializationException when !(handle == null) && try-body throws [PATH1] if(handle == null)=F ...
/* static context [FOCAL] @SuppressWarnings("unchecked") public static T ProtobufMsgFactory.newMessageByProtoClassName(String className, byte[] bs) [THROWS-WHEN] MessageClassNotFoundException when handle == null [THROWS-WHEN] SerializationException when !(handle == null) && try-body throws [PATH1] if(handle == null)=F ...
true
ok
{"focal": {"class": "ProtobufMsgFactory", "name": "newMessageByProtoClassName", "signature": "T newMessageByProtoClassName(String className, byte[] bs)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public static", "params": [{"name": "className", "type": "String"}, {"name": "bs", "type": "byte[]"}],...
173756598_3
class BillingService { public synchronized Transaction makeTransaction(String fromAddress, String toAddress, long value) throws ServerException { Wallet from = walletRepository.findByAddress(fromAddress); Wallet to = walletRepository.findByAddress(toAddress); if (from == null || to == null) throw new Ser...
String firstAddress= "firstAddress"; String secondAddresss= "secondAddress"; Wallet secondWallet = new Wallet(); secondWallet.setBalance(0); Long value = 30000L; String address = "some address"; when(walletRepository.findByAddress(firstAddress)).thenReturn(null); when(walletRepos...
[FOCAL] public synchronized Transaction BillingService.makeTransaction(String fromAddress, String toAddress, long value) [CLASS] class BillingService [METRICS] loc=30 cc=3 branches=2 loops=0 returns=1 throws=2 nesting=1 [CALLS-EXTERNAL] WalletRepository.findByAddress/1, Wallet.getBalance/0, Transaction.setSource/1, Tra...
/* static context [FOCAL] public synchronized Transaction BillingService.makeTransaction(String fromAddress, String toAddress, long value) [THROWS-WHEN] ServerException when from == null || to == null [THROWS-WHEN] ServerException when !(from == null || to == null) && from.getBalance() < value [PATH1] if(from == null |...
/* static context [FOCAL] public synchronized Transaction BillingService.makeTransaction(String fromAddress, String toAddress, long value) [THROWS-WHEN] ServerException when from == null || to == null [THROWS-WHEN] ServerException when !(from == null || to == null) && from.getBalance() < value [PATH1] if(from == null |...
true
ok
{"focal": {"class": "BillingService", "name": "makeTransaction", "signature": "Transaction makeTransaction(String fromAddress, String toAddress, long value) throws ServerException", "start_line": 3, "modifiers": "public synchronized", "params": [{"name": "fromAddress", "type": "String"}, {"name": "toAddress", "type": "...
173833378_0
class HelloController { @Get("/{name}") public String index(final String name) { return "Hello, " + name + ". From " + embeddedServer.getHost() + ":" + embeddedServer.getPort() + "\n"; } @Get("/enemies") public String enemies(); @Get("/config/{key}") public String config(String key); ...
try(RxHttpClient client = embeddedServer.getApplicationContext().createBean(RxHttpClient.class, embeddedServer.getURL())) { assertTrue(client.toBlocking().exchange("/hello/Alvaro", String.class).body().startsWith("Hello, Alvaro")); } } }
[FOCAL] @Get("/{name}") public String HelloController.index(String name) [CLASS] class HelloController [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] EmbeddedServer.getHost/0, EmbeddedServer.getPort/0 [FIELDS] read=embeddedServer:EmbeddedServer [INPUTS] branches=- | result=name, e...
/* static context [FOCAL] @Get("/{name}") public String HelloController.index(String name) [INPUTS] branches=- | result=name, embeddedServer [COLLABORATORS] field embeddedServer:EmbeddedServer getHost/0,getPort/0 [FIELDS] read=embeddedServer:EmbeddedServer [CALLS-EXTERNAL] EmbeddedServer.getHost/0, EmbeddedServer.getPo...
/* static context [FOCAL] @Get("/{name}") public String HelloController.index(String name) [INPUTS] branches=- | result=name, embeddedServer [COLLABORATORS] field embeddedServer:EmbeddedServer getHost/0,getPort/0 [FIELDS] read=embeddedServer:EmbeddedServer [CALLS-EXTERNAL] EmbeddedServer.getHost/0, EmbeddedServer.getPo...
true
ok
{"focal": {"class": "HelloController", "name": "index", "signature": "String index(String name)", "start_line": 3, "modifiers": "@Get(\"/{name}\") public", "params": [{"name": "name", "type": "String"}], "return_type": "String"}, "class_info": {"name": "HelloController", "kind": "class", "modifiers": "", "superclass": ...
173952800_1
class ExpressionEvaluator { public ComputedValues evaluateForAll(VariableEnvironment environment, Expression expression) throws Exception { return evaluate(environment, VariableEnvironment.NO_VALUE_SET_SELECTED, expression, false); } public ExpressionEvaluator(IExpressionEvaluatorErrorCallback ev...
// This test ensures the correct propagation of increment/decrement operator side effets through // conditional and short-circuiting operators in a value-recoding VariableEnvironment // Environment: Create two integer variables x, y with values 5, 10 VariableEnvironment environment = ne...
[FOCAL] public ComputedValues ExpressionEvaluator.evaluateForAll(VariableEnvironment environment, Expression expression) [CLASS] class ExpressionEvaluator [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] ComputedValues evaluate(VariableEnvironment environment, int valueSetIndex, Exp...
class ExpressionEvaluator { public ComputedValues evaluateForAll(VariableEnvironment environment, Expression expression) throws Exception { return evaluate(environment, VariableEnvironment.NO_VALUE_SET_SELECTED, expression, false); } public ExpressionEvaluator(IExpressionEvaluatorErrorCallback ev...
false
ok
{"focal": {"class": "ExpressionEvaluator", "name": "evaluateForAll", "signature": "ComputedValues evaluateForAll(VariableEnvironment environment, Expression expression) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "environment", "type": "VariableEnvironment"}, {"name": "expression", "t...
174011880_1
class FileParsingElementLoader implements ConfigLoader, ConfigConstants { public List<ParsingElement> load(boolean reload) { if (isLoaded() && !reload) { return getParsingElements(); } Map<String, Object> map = configLoader.readConfiguration(); fillParameters(map); ...
FileParsingElementLoader parsingElementLoader = TestUtils.prepareParsingElementFile(pathPlace, "parsingElementTest.yaml"); List<ParsingElement> load = parsingElementLoader.load(true); TestUtils.initXmlParsingAbsolutePath(load); ParsingElement root = load.get(0); assertEquals(3, ...
[FOCAL] public List<ParsingElement> FileParsingElementLoader.load(boolean reload) [CLASS] class FileParsingElementLoader implements ConfigLoader, ConfigConstants [METRICS] loc=20 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] List<ParsingElement> getParsingElements(); boolean isLoaded(); void ext...
/* static context [FOCAL] public List<ParsingElement> FileParsingElementLoader.load(boolean reload) [PATH1] if(isLoaded() && !reload)=T -> return getParsingElements() [PATH2] if(isLoaded() && !reload)=F -> return getParsingElements() [INPUTS] branches=reload | result=- [COLLABORATORS] field configLoader readConfigurati...
/* static context [FOCAL] public List<ParsingElement> FileParsingElementLoader.load(boolean reload) [PATH1] if(isLoaded() && !reload)=T -> return getParsingElements() [PATH2] if(isLoaded() && !reload)=F -> return getParsingElements() [INPUTS] branches=reload | result=- [COLLABORATORS] field configLoader readConfigurati...
true
ok
{"focal": {"class": "FileParsingElementLoader", "name": "load", "signature": "List<ParsingElement> load(boolean reload)", "start_line": 3, "modifiers": "public", "params": [{"name": "reload", "type": "boolean"}], "return_type": "List<ParsingElement>"}, "class_info": {"name": "FileParsingElementLoader", "kind": "class",...
174065041_172
class MetadataEntityManager implements SecuredEntityManager { @Transactional(propagation = Propagation.REQUIRED) public void deleteMetadataEntitiesInProject(Long projectId, String entityClassName) { Objects.requireNonNull(projectId); if (StringUtils.hasText(entityClassName)) { Metad...
entityManager.deleteMetadataEntitiesInProject(folder.getId(), null); assertTrue(loadEntities(SAMPLE_CLASS, folder.getId()).isEmpty()); assertTrue(loadEntities(PAIR_CLASS, folder.getId()).isEmpty()); } }
[FOCAL] @Transactional(propagation = Propagation.REQUIRED) public void MetadataEntityManager.deleteMetadataEntitiesInProject(Long projectId, String entityClassName) [CLASS] class MetadataEntityManager implements SecuredEntityManager [METRICS] loc=10 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] ...
/* static context [FOCAL] @Transactional(propagation = Propagation.REQUIRED) public void MetadataEntityManager.deleteMetadataEntitiesInProject(Long projectId, String entityClassName) [PATH1] if(StringUtils.hasText(entityClassName))=T [PATH2] if(StringUtils.hasText(entityClassName))=F [INPUTS] branches=entityClassName |...
/* static context [FOCAL] @Transactional(propagation = Propagation.REQUIRED) public void MetadataEntityManager.deleteMetadataEntitiesInProject(Long projectId, String entityClassName) [PATH1] if(StringUtils.hasText(entityClassName))=T [PATH2] if(StringUtils.hasText(entityClassName))=F [INPUTS] branches=entityClassName |...
true
ok
{"focal": {"class": "MetadataEntityManager", "name": "deleteMetadataEntitiesInProject", "signature": "void deleteMetadataEntitiesInProject(Long projectId, String entityClassName)", "start_line": 3, "modifiers": "@Transactional(propagation = Propagation.REQUIRED) public", "params": [{"name": "projectId", "type": "Long"}...
174097909_25
class Vm { public double getTotalUtilizationOfCpu(double time) { return getCloudletScheduler().getTotalUtilizationOfCpu(time); } public Vm( int id, int userId, double mips, int numberOfPes, int ram, long bw, long size, String vmm, CloudletScheduler cloudletScheduler); public double ...
assertEquals(0, vm.getTotalUtilizationOfCpu(0), 0); } }
[FOCAL] public double Vm.getTotalUtilizationOfCpu(double time) [CLASS] class Vm [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] CloudletScheduler getCloudletScheduler() [CALLS-EXTERNAL] getCloudletScheduler().getTotalUtilizationOfCpu/1 [INPUTS] branches=- | result=time [DATAFLOW] t...
/* static context [FOCAL] public double Vm.getTotalUtilizationOfCpu(double time) [INPUTS] branches=- | result=time [CALLS-INTERNAL] CloudletScheduler getCloudletScheduler() [CALLS-EXTERNAL] getCloudletScheduler().getTotalUtilizationOfCpu/1 */
/* static context [FOCAL] public double Vm.getTotalUtilizationOfCpu(double time) [INPUTS] branches=- | result=time [CALLS-INTERNAL] CloudletScheduler getCloudletScheduler() [CALLS-EXTERNAL] getCloudletScheduler().getTotalUtilizationOfCpu/1 */ class Vm { public double getTotalUtilizationOfCpu(double time) { return g...
true
ok
{"focal": {"class": "Vm", "name": "getTotalUtilizationOfCpu", "signature": "double getTotalUtilizationOfCpu(double time)", "start_line": 3, "modifiers": "public", "params": [{"name": "time", "type": "double"}], "return_type": "double"}, "class_info": {"name": "Vm", "kind": "class", "modifiers": "", "superclass": null, ...
174098511_6
class RabbitMQPasswordConverter { public boolean passwordMatchesHash(final String password, final String hash) { final byte[] decodedHash = base64Decoder.decode(hash); final int salt = ByteBuffer.wrap(decodedHash).getInt(); return convertPasswordToHash(password, salt).equals(hash); } ...
assertTrue(converter.passwordMatchesHash(PASSWORD, HASH_FROM_RABBIT)); } }
[FOCAL] public boolean RabbitMQPasswordConverter.passwordMatchesHash(String password, String hash) [CLASS] class RabbitMQPasswordConverter [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String convertPasswordToHash(String password, int salt) [CALLS-EXTERNAL] base64Decoder.decode/1...
/* static context [FOCAL] public boolean RabbitMQPasswordConverter.passwordMatchesHash(String password, String hash) [INPUTS] branches=- | result=hash, password [COLLABORATORS] field base64Decoder decode/1 [CALLS-INTERNAL] String convertPasswordToHash(String password, int salt) [CALLS-EXTERNAL] base64Decoder.decode/1, ...
/* static context [FOCAL] public boolean RabbitMQPasswordConverter.passwordMatchesHash(String password, String hash) [INPUTS] branches=- | result=hash, password [COLLABORATORS] field base64Decoder decode/1 [CALLS-INTERNAL] String convertPasswordToHash(String password, int salt) [CALLS-EXTERNAL] base64Decoder.decode/1, ...
true
ok
{"focal": {"class": "RabbitMQPasswordConverter", "name": "passwordMatchesHash", "signature": "boolean passwordMatchesHash(String password, String hash)", "start_line": 3, "modifiers": "public", "params": [{"name": "password", "type": "String"}, {"name": "hash", "type": "String"}], "return_type": "boolean"}, "class_info...
174185245_79
class ComplexNumber { public ComplexNumber[] root(int n) { if (n <= 0) { throw new IllegalArgumentException("Cannot calculate negative roots."); } double magnitude = Math.pow(getMagnitude(), 1.0 / n); double angle = getAngle() / n; double angleStep = 2 * Math.PI / n; ComplexNumber[] roots = new Compl...
assertThrows(IllegalArgumentException.class, () -> ComplexNumber.MINUS_ONE.root(-1)); } }
[FOCAL] public ComplexNumber[] ComplexNumber.root(int n) [CLASS] class ComplexNumber [METRICS] loc=17 cc=3 branches=1 loops=1 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] ComplexNumber fromMagnitudeAndAngle(double magnitude, double angle); double getAngle(); double getMagnitude() [CALLS-EXTERNAL] Math.pow/2 [NEW] Ille...
/* static context [FOCAL] public ComplexNumber[] ComplexNumber.root(int n) [THROWS-WHEN] IllegalArgumentException when n <= 0 [PATH1] if(n <= 0)=F -> for(index < n)=T -> exit loop -> return roots [PATH2] if(n <= 0)=T -> throw new IllegalArgumentException("Cannot calculate negative roots.") [PATH3] if(n <= 0)=F -> for(i...
/* static context [FOCAL] public ComplexNumber[] ComplexNumber.root(int n) [THROWS-WHEN] IllegalArgumentException when n <= 0 [PATH1] if(n <= 0)=F -> for(index < n)=T -> exit loop -> return roots [PATH2] if(n <= 0)=T -> throw new IllegalArgumentException("Cannot calculate negative roots.") [PATH3] if(n <= 0)=F -> for(i...
true
ok
{"focal": {"class": "ComplexNumber", "name": "root", "signature": "ComplexNumber[] root(int n)", "start_line": 3, "modifiers": "public", "params": [{"name": "n", "type": "int"}], "return_type": "ComplexNumber[]"}, "class_info": {"name": "ComplexNumber", "kind": "class", "modifiers": "", "superclass": null, "interfaces"...
174314296_1
class CountriesResource { public JsonNode jsonName(JsonNode nameNode) { Country country = countriesService.getByName(nameNode.get("name").asText()).iterator().next(); ObjectMapper mapper = new ObjectMapper(); JsonNode retNode = mapper.convertValue(country, JsonNode.class); return r...
String jsonString = "{\"name\": \"greece\"}"; ObjectMapper mapper = new ObjectMapper(); JsonNode inputNode = mapper.readTree(jsonString); JsonNode retNode = resource.jsonName(inputNode); assertNotNull(retNode); assertEquals("Greece", retNode.get("name").textValue()); ...
[FOCAL] public JsonNode CountriesResource.jsonName(JsonNode nameNode) [CLASS] class CountriesResource [METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] countriesService.getByName(nameNode.get("name").asText())....next/0, countriesService.getByName(nameNode.get("name").asText()).itera...
/* static context [FOCAL] public JsonNode CountriesResource.jsonName(JsonNode nameNode) [INPUTS] branches=- | result=nameNode [COLLABORATORS] field countriesService getByName/1; param nameNode:JsonNode get/1 [NEW] ObjectMapper [CALLS-EXTERNAL] countriesService.getByName(nameNode.get("name").asText())....next/0, countri...
/* static context [FOCAL] public JsonNode CountriesResource.jsonName(JsonNode nameNode) [INPUTS] branches=- | result=nameNode [COLLABORATORS] field countriesService getByName/1; param nameNode:JsonNode get/1 [NEW] ObjectMapper [CALLS-EXTERNAL] countriesService.getByName(nameNode.get("name").asText())....next/0, countri...
true
ok
{"focal": {"class": "CountriesResource", "name": "jsonName", "signature": "JsonNode jsonName(JsonNode nameNode)", "start_line": 3, "modifiers": "public", "params": [{"name": "nameNode", "type": "JsonNode"}], "return_type": "JsonNode"}, "class_info": {"name": "CountriesResource", "kind": "class", "modifiers": "", "super...
174354196_1
class ProdutoController { @PutMapping(value = "/{id}", produces = "application/json") public Produto update(@PathVariable("id") long id, @RequestBody Produto produto) { return storage.update(id, produto); } @PostMapping @ResponseStatus(code=HttpStatus.CREATED) public String save(@RequestBody P...
Long produtoId = 1L; Produto produto = new Produto(); produto.setId(produtoId); produto.setNome("Produto"); Mockito.when(storage.update(Mockito.anyLong(), Mockito.any(Produto.class))).thenReturn(produto); ObjectMapper objectMapper = new ObjectMapper(); String produtoJson = objectMapper.writeValue...
[FOCAL] @PutMapping(value = "/{id}", produces = "application/json") public Produto ProdutoController.update(long id, Produto produto) [CLASS] class ProdutoController [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Storage.update/2 [FIELDS] read=storage:Storage [INPUTS] branches=- |...
/* static context [FOCAL] @PutMapping(value = "/{id}", produces = "application/json") public Produto ProdutoController.update(long id, Produto produto) [INPUTS] branches=- | result=id, produto, storage [COLLABORATORS] field storage:Storage update/2 [FIELDS] read=storage:Storage [CALLS-EXTERNAL] Storage.update/2 */
/* static context [FOCAL] @PutMapping(value = "/{id}", produces = "application/json") public Produto ProdutoController.update(long id, Produto produto) [INPUTS] branches=- | result=id, produto, storage [COLLABORATORS] field storage:Storage update/2 [FIELDS] read=storage:Storage [CALLS-EXTERNAL] Storage.update/2 */ clas...
true
ok
{"focal": {"class": "ProdutoController", "name": "update", "signature": "Produto update(long id, Produto produto)", "start_line": 3, "modifiers": "@PutMapping(value = \"/{id}\", produces = \"application/json\") public", "params": [{"name": "id", "type": "long"}, {"name": "produto", "type": "Produto"}], "return_type": "...
174398263_151
class HttpClientImpl implements OktaHttpClient { @Override public void cleanUp() { mUrlConnection = null; } private void enableTlsV1_2(HttpURLConnection urlConnection); @VisibleForTesting protected HttpURLConnection openConnection(URL url, ConnectionParameters params); @Override public...
mHttpClient.cleanUp(); assertNull(mHttpClient.getUrlConnection()); } }
[FOCAL] @Override public void HttpClientImpl.cleanUp() [CLASS] class HttpClientImpl implements OktaHttpClient [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CLASS-MEMBERS] void enableTlsV1_2(HttpURLConnection urlConnection); HttpURLConnection openConnection(URL url, ConnectionParameters params); ...
/* static context [FOCAL] @Override public void HttpClientImpl.cleanUp() */
/* static context [FOCAL] @Override public void HttpClientImpl.cleanUp() */ class HttpClientImpl implements OktaHttpClient { @Override public void cleanUp() { mUrlConnection = null; } private void enableTlsV1_2(HttpURLConnection urlConnection); @VisibleForTesting protected HttpURLConnectio...
true
ok
{"focal": {"class": "HttpClientImpl", "name": "cleanUp", "signature": "void cleanUp()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "HttpClientImpl", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "OktaHttpClient", "fields": [{"name...
174912621_0
class InMemoryMetricsRepository implements MetricsRepository<MetricEntity> { @Override public List<String> listResourcesOfApp(String app) { List<String> results = new ArrayList<>(); if (StringUtil.isBlank(app)) { return results; } // TODO: 2019/3/26 请解决数据量大的问题,加一个时间...
// prepare basic test data testSave(); System.out.println( "[" + System.currentTimeMillis() + "] Basic test data ready in testListResourcesOfApp"); List<CompletableFuture> futures = Lists.newArrayList(); // concurrent query resources of app final CyclicBarrier cyclicBar...
[FOCAL] @Override public List<String> InMemoryMetricsRepository.listResourcesOfApp(String app) [CLASS] class InMemoryMetricsRepository implements MetricsRepository<MetricEntity> [METRICS] loc=59 cc=10 branches=6 loops=3 returns=4 throws=0 nesting=3 [CALLS-EXTERNAL] StringUtil.isBlank/1, dashboardProperties.getApplicati...
/* static context [FOCAL] @Override public List<String> InMemoryMetricsRepository.listResourcesOfApp(String app) [PATH1] if(StringUtil.isBlank(app))=F -> if(dashboardProperties.getApplication().isEnable())=F -> if(resourceMap == null)=F -> foreach(Entry<String, ConcurrentLinkedHashMap<Long, MetricEntity>> resourceMetri...
/* static context [FOCAL] @Override public List<String> InMemoryMetricsRepository.listResourcesOfApp(String app) [PATH1] if(StringUtil.isBlank(app))=F -> if(dashboardProperties.getApplication().isEnable())=F -> if(resourceMap == null)=F -> foreach(Entry<String, ConcurrentLinkedHashMap<Long, MetricEntity>> resourceMetri...
true
ok
{"focal": {"class": "InMemoryMetricsRepository", "name": "listResourcesOfApp", "signature": "List<String> listResourcesOfApp(String app)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "app", "type": "String"}], "return_type": "List<String>"}, "class_info": {"name": "InMemoryMetricsRepository", ...
174912738_6
class DefaultChangerCollector implements ChangerCollector { @Override public List<Item> collect(Object source) { if (source == null){ return Collections.emptyList(); } List<Item> result = Lists.newArrayList(); ReflectionUtils.doWithFields(source.getClass(), field -> ...
List<ChangerCollector.Item> items = this.changerCollector.collect(this.data); Assert.assertEquals(5, items.size()); } }
[FOCAL] @Override public List<Item> DefaultChangerCollector.collect(Object source) [CLASS] class DefaultChangerCollector implements ChangerCollector [METRICS] loc=19 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] Collections.emptyList/0, Lists.newArrayList/0, ReflectionUtils.doWithFields/2, Objec...
/* static context [FOCAL] @Override public List<Item> DefaultChangerCollector.collect(Object source) [PATH1] if(source == null)=T -> return Collections.emptyList() [PATH2] if(source == null)=F -> return result [INPUTS] branches=source | result=- [COLLABORATORS] field field getType/0,setAccessible/1,get/1,getName/0 [NEW...
/* static context [FOCAL] @Override public List<Item> DefaultChangerCollector.collect(Object source) [PATH1] if(source == null)=T -> return Collections.emptyList() [PATH2] if(source == null)=F -> return result [INPUTS] branches=source | result=- [COLLABORATORS] field field getType/0,setAccessible/1,get/1,getName/0 [NEW...
true
ok
{"focal": {"class": "DefaultChangerCollector", "name": "collect", "signature": "List<Item> collect(Object source)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "source", "type": "Object"}], "return_type": "List<Item>"}, "class_info": {"name": "DefaultChangerCollector", "kind": "class", "modifi...
175050767_27
class UriUtils { public static String extractEtherAddressFromUri(String uri) throws InvalidEthereumAddressException { String uriWithoutSchema = uri.replaceFirst("ethereum:", ""); uriWithoutSchema = Numeric.cleanHexPrefix(uriWithoutSchema); if (uriWithoutSchema.length() != 40) { ...
final String result = UriUtils.extractEtherAddressFromUri("0x6E670C473A2AD5894AE354B832AD4BADF1D919BF"); assertEquals("0x6E670C473A2AD5894AE354B832AD4BADF1D919BF", result); } }
[FOCAL] public static String UriUtils.extractEtherAddressFromUri(String uri) [CLASS] class UriUtils [METRICS] loc=21 cc=4 branches=3 loops=0 returns=1 throws=2 nesting=2 [CALLS-EXTERNAL] String.replaceFirst/2, Numeric.cleanHexPrefix/1, String.length/0, String.equals/1, String.toLowerCase/0, String.toUpperCase/0, Numeri...
/* static context [FOCAL] public static String UriUtils.extractEtherAddressFromUri(String uri) [THROWS-WHEN] InvalidEthereumAddressException when uriWithoutSchema.length() != 40 [THROWS-WHEN] InvalidEthereumAddressException when !(uriWithoutSchema.length() != 40) && hasChecksum && !uriWithoutSchema.equals(Keys.toChecks...
/* static context [FOCAL] public static String UriUtils.extractEtherAddressFromUri(String uri) [THROWS-WHEN] InvalidEthereumAddressException when uriWithoutSchema.length() != 40 [THROWS-WHEN] InvalidEthereumAddressException when !(uriWithoutSchema.length() != 40) && hasChecksum && !uriWithoutSchema.equals(Keys.toChecks...
true
ok
{"focal": {"class": "UriUtils", "name": "extractEtherAddressFromUri", "signature": "String extractEtherAddressFromUri(String uri) throws InvalidEthereumAddressException", "start_line": 3, "modifiers": "public static", "params": [{"name": "uri", "type": "String"}], "return_type": "String"}, "class_info": {"name": "UriUt...
175055878_2
class BoardGameGeekRatingService implements GameRatingService { @Override public Optional<BigDecimal> getAverageRating(final UUID gameId) { return this.resolveBoardGameGeekId(gameId) .map(bggId -> this.bggClient.getItemsWithRating(bggId)) .map(Items::getItems) .map(List::stream) .flatMap(Stream::findFi...
//Given BoardGameGeekRatingService boardGameGeekRatingService = new BoardGameGeekRatingService(bggClient, queryRepository); when(queryRepository.findBoardGameById(GAME_ID)).thenReturn(Optional.of(createBoardGame(null))); //When Optional<BigDecimal> rating = boardGameGeekRatingService.getAverageRating(GAME_ID...
[FOCAL] @Override public Optional<BigDecimal> BoardGameGeekRatingService.getAverageRating(UUID gameId) [CLASS] class BoardGameGeekRatingService implements GameRatingService [METRICS] loc=12 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Optional<Integer> resolveBoardGameGeekId(UUID gameId) [CALLS...
/* static context [FOCAL] @Override public Optional<BigDecimal> BoardGameGeekRatingService.getAverageRating(UUID gameId) [INPUTS] branches=- | result=gameId, bggClient [COLLABORATORS] field bggClient:BoardGameGeekClient getItemsWithRating/1 [CALLS-INTERNAL] Optional<Integer> resolveBoardGameGeekId(UUID gameId) [FIELDS]...
/* static context [FOCAL] @Override public Optional<BigDecimal> BoardGameGeekRatingService.getAverageRating(UUID gameId) [INPUTS] branches=- | result=gameId, bggClient [COLLABORATORS] field bggClient:BoardGameGeekClient getItemsWithRating/1 [CALLS-INTERNAL] Optional<Integer> resolveBoardGameGeekId(UUID gameId) [FIELDS]...
true
ok
{"focal": {"class": "BoardGameGeekRatingService", "name": "getAverageRating", "signature": "Optional<BigDecimal> getAverageRating(UUID gameId)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "gameId", "type": "UUID"}], "return_type": "Optional<BigDecimal>"}, "class_info": {"name": "BoardGameGeek...
175193018_1
class JavaUtils { public static boolean isAsciiAlpha(char ch) { return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'); } public static String getClassName(String scriptContent); public static boolean isDigital(char ch); } class JavaUtilsTest { @Test public void testIsAsciiAlph...
Assert.assertTrue(JavaUtils.isAsciiAlpha('B')); Assert.assertTrue(JavaUtils.isAsciiAlpha('b')); Assert.assertFalse(JavaUtils.isAsciiAlpha('%')); } }
[FOCAL] public static boolean JavaUtils.isAsciiAlpha(char ch) [CLASS] class JavaUtils [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [INPUTS] branches=- | result=ch [DATAFLOW] ch@param->L2 [CLASS-MEMBERS] String getClassName(String scriptContent); boolean isDigital(char ch) [TEST] JavaUtilsTest: @...
/* static context [FOCAL] public static boolean JavaUtils.isAsciiAlpha(char ch) [INPUTS] branches=- | result=ch */
/* static context [FOCAL] public static boolean JavaUtils.isAsciiAlpha(char ch) [INPUTS] branches=- | result=ch */ class JavaUtils { public static boolean isAsciiAlpha(char ch) { return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'); } public static String getClassName(String scriptContent);...
true
ok
{"focal": {"class": "JavaUtils", "name": "isAsciiAlpha", "signature": "boolean isAsciiAlpha(char ch)", "start_line": 3, "modifiers": "public static", "params": [{"name": "ch", "type": "char"}], "return_type": "boolean"}, "class_info": {"name": "JavaUtils", "kind": "class", "modifiers": "", "superclass": null, "interfac...
175482179_3
class DayView extends ViewGroup { protected void setRect(@NonNull DirectionalRect rect, int start, int top, int end, int bottom) { rect.set(isRtl, parentWidth, start, top, end, bottom); } public DayView(@NonNull Context context); public DayView(@NonNull Context context, @Nullable AttributeSe...
DirectionalRect rect = new DirectionalRect(); rect.set(false, 20, 1, 2, 3, 4); assertThat(rect.getLeft(), is(1)); assertThat(rect.getTop(), is(2)); assertThat(rect.getRight(), is(3)); assertThat(rect.getBottom(), is(4)); rect.set(true, 20, 1, 2, 3, 4); ...
[FOCAL] protected void DayView.setRect(DirectionalRect rect, int start, int top, int end, int bottom) [CLASS] class DayView extends ViewGroup [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] DirectionalRect.set/6 [COLLABORATORS] param rect:DirectionalRect set/6 [DATAFLOW] bottom@par...
/* static context [FOCAL] protected void DayView.setRect(DirectionalRect rect, int start, int top, int end, int bottom) [COLLABORATORS] param rect:DirectionalRect set/6 [CALLS-EXTERNAL] DirectionalRect.set/6 */
/* static context [FOCAL] protected void DayView.setRect(DirectionalRect rect, int start, int top, int end, int bottom) [COLLABORATORS] param rect:DirectionalRect set/6 [CALLS-EXTERNAL] DirectionalRect.set/6 */ class DayView extends ViewGroup { protected void setRect(@NonNull DirectionalRect rect, int start, int t...
true
ok
{"focal": {"class": "DayView", "name": "setRect", "signature": "void setRect(DirectionalRect rect, int start, int top, int end, int bottom)", "start_line": 3, "modifiers": "protected", "params": [{"name": "rect", "type": "DirectionalRect"}, {"name": "start", "type": "int"}, {"name": "top", "type": "int"}, {"name": "end...
175804011_5
class StreamUtils { public static <T,U,R> Stream<R> merge(Stream<T> seq1, Stream<U> seq2, BiPredicate<T,U> pred, BiFunction<T,U,R> transf, U defaultVal) { // TODO return null; } private final List<String> seq1; private final List<Integer> seq2Asc; private final List<Integer> seq2As...
final List<String> merged = merge(seq2DescDupl); assertEquals(expected, merged); } }
[FOCAL] public static Stream<R> StreamUtils.merge(Stream<T> seq1, Stream<U> seq2, BiPredicate<T,U> pred, BiFunction<T,U,R> transf, U defaultVal) [CLASS] class StreamUtils [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [INPUTS] branches=- | result=- | unused=seq1, seq2, pred, transf, defaultVal [TE...
/* static context [FOCAL] public static Stream<R> StreamUtils.merge(Stream<T> seq1, Stream<U> seq2, BiPredicate<T,U> pred, BiFunction<T,U,R> transf, U defaultVal) [INPUTS] branches=- | result=- | unused=seq1, seq2, pred, transf, defaultVal */
/* static context [FOCAL] public static Stream<R> StreamUtils.merge(Stream<T> seq1, Stream<U> seq2, BiPredicate<T,U> pred, BiFunction<T,U,R> transf, U defaultVal) [INPUTS] branches=- | result=- | unused=seq1, seq2, pred, transf, defaultVal */ class StreamUtils { public static <T,U,R> Stream<R> merge(Stream<T> seq1...
true
ok
{"focal": {"class": "StreamUtils", "name": "merge", "signature": "Stream<R> merge(Stream<T> seq1, Stream<U> seq2, BiPredicate<T,U> pred, BiFunction<T,U,R> transf, U defaultVal)", "start_line": 3, "modifiers": "public static", "params": [{"name": "seq1", "type": "Stream<T>"}, {"name": "seq2", "type": "Stream<U>"}, {"nam...
175889566_2
class SetParameterValuesCommand extends AbstractCommand { public Map<String, Object> getValues() { return values; } public SetParameterValuesCommand(); public void setValues(Map<String, Object> values); @Override public int hashCode(); @Override public boolean equals(Object obj); @Override public String to...
SetParameterValuesCommand command1 = ser.fromJson(new InputStreamReader(this.getClass().getResourceAsStream("command-setparametervalues-1.json")), SetParameterValuesCommand.class); assertEquals(CommandType.SetParameterValues, command1.getCommand()); assertNotNull(command1.getValues()); assertEquals(2, comman...
[FOCAL] public Map<String, Object> SetParameterValuesCommand.getValues() [CLASS] class SetParameterValuesCommand extends AbstractCommand [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] SetParameterValuesCommand(); void setValues(Map<String, Object> values); int hashCode(); boolean e...
/* static context [FOCAL] public Map<String, Object> SetParameterValuesCommand.getValues() */
/* static context [FOCAL] public Map<String, Object> SetParameterValuesCommand.getValues() */ class SetParameterValuesCommand extends AbstractCommand { public Map<String, Object> getValues() { return values; } public SetParameterValuesCommand(); public void setValues(Map<String, Object> values); @Override pu...
true
ok
{"focal": {"class": "SetParameterValuesCommand", "name": "getValues", "signature": "Map<String, Object> getValues()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Map<String, Object>"}, "class_info": {"name": "SetParameterValuesCommand", "kind": "class", "modifiers": "", "superclass": "Abstract...
175961394_11
class ExampleParametersResolver { public Optional<Object[]> resolve(final Method testMethod, final Example.Builder example) { // TODO fchovich MOVE LOGIC FROM THE RESOLVER. CREATE CONVERTIBLES BEFORE. return this.parameterConverterResolver .resolveConverters(testMethod, example) .flatMap(c ->...
final Optional<Object[]> conversions; final Example.Builder example; final Method testMethod; given: // TODO fchovich feature class and scenario name are unnecessary here example = new Example.Builder(ExampleParametersResolverTest.class.getName(), "", Collections.emptyList()); testMethod = ...
[FOCAL] public Optional<Object[]> ExampleParametersResolver.resolve(Method testMethod, Example.Builder example) [CLASS] class ExampleParametersResolver [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Optional<Object[]> resolveParameters(Method testMethod, Example.Builder example, P...
/* static context [FOCAL] public Optional<Object[]> ExampleParametersResolver.resolve(Method testMethod, Example.Builder example) [INPUTS] branches=- | result=example, testMethod, parameterConverterResolver [COLLABORATORS] field parameterConverterResolver:ParameterConverterResolver resolveConverters/2 [CALLS-INTERNAL] ...
/* static context [FOCAL] public Optional<Object[]> ExampleParametersResolver.resolve(Method testMethod, Example.Builder example) [INPUTS] branches=- | result=example, testMethod, parameterConverterResolver [COLLABORATORS] field parameterConverterResolver:ParameterConverterResolver resolveConverters/2 [CALLS-INTERNAL] ...
true
ok
{"focal": {"class": "ExampleParametersResolver", "name": "resolve", "signature": "Optional<Object[]> resolve(Method testMethod, Example.Builder example)", "start_line": 3, "modifiers": "public", "params": [{"name": "testMethod", "type": "Method"}, {"name": "example", "type": "Example.Builder"}], "return_type": "Optiona...
176135637_75
class SlayerPlugin extends Plugin { @Subscribe public void onChatMessage(ChatMessage event) { if (event.getType() != ChatMessageType.SERVER && event.getType() != ChatMessageType.FILTERED) { return; } String chatMsg = Text.removeTags(event.getMessage()); //remove color and linebreaks if (chatMsg.start...
ChatMessage chatMessageEvent = new ChatMessage(SERVER, "Perterter", TASK_LARGE_STREAK, null); slayerPlugin.onChatMessage(chatMessageEvent); assertEquals(2465, slayerPlugin.getStreak()); assertEquals("", slayerPlugin.getTaskName()); assertEquals(0, slayerPlugin.getAmount()); assertEquals(17_566_000, slayerP...
[FOCAL] @Subscribe public void SlayerPlugin.onChatMessage(ChatMessage event) [CLASS] class SlayerPlugin extends Plugin [METRICS] loc=115 cc=17 branches=13 loops=1 returns=7 throws=0 nesting=2 [CALLS-INTERNAL] void setTask(String name, int amt, int initAmt); void setTask(String name, int amt, int initAmt, String locatio...
class SlayerPlugin extends Plugin { @Subscribe public void onChatMessage(ChatMessage event) { if (event.getType() != ChatMessageType.SERVER && event.getType() != ChatMessageType.FILTERED) { return; } String chatMsg = Text.removeTags(event.getMessage()); //remove color and linebreaks if (chatMsg.start...
false
ok
{"focal": {"class": "SlayerPlugin", "name": "onChatMessage", "signature": "void onChatMessage(ChatMessage event)", "start_line": 3, "modifiers": "@Subscribe public", "params": [{"name": "event", "type": "ChatMessage"}], "return_type": "void"}, "class_info": {"name": "SlayerPlugin", "kind": "class", "modifiers": "", "su...
176206805_10
class CarbonSecurityManager extends SecurityManager { public void checkAccess(ThreadGroup g) { if (g == null) { throw new NullPointerException("thread group can't be null"); } checkPermission(SecurityConstants.MODIFY_THREADGROUP_PERMISSION); } public CarbonSecurityMa...
System.setProperty("denied.system.properties", "mockDeniedProperty"); carbonSecurityManager = new CarbonSecurityManager(); Thread thread = null; assertNull(thread); carbonSecurityManager.checkAccess(thread); } }
[FOCAL] public void CarbonSecurityManager.checkAccess(ThreadGroup g) [CLASS] class CarbonSecurityManager extends SecurityManager [METRICS] loc=8 cc=2 branches=1 loops=0 returns=0 throws=1 nesting=1 [CALLS-EXTERNAL] checkPermission/1 (inherited) [NEW] NullPointerException [EXCEPTIONS] throws NullPointerException [THROWS...
/* static context [FOCAL] public void CarbonSecurityManager.checkAccess(ThreadGroup g) [THROWS-WHEN] NullPointerException when g == null [PATH1] if(g == null)=T -> throw new NullPointerException("thread group can't be null") [PATH2] if(g == null)=F [INPUTS] branches=g | result=- [EXCEPTIONS] throws NullPointerException...
/* static context [FOCAL] public void CarbonSecurityManager.checkAccess(ThreadGroup g) [THROWS-WHEN] NullPointerException when g == null [PATH1] if(g == null)=T -> throw new NullPointerException("thread group can't be null") [PATH2] if(g == null)=F [INPUTS] branches=g | result=- [EXCEPTIONS] throws NullPointerException...
true
ok
{"focal": {"class": "CarbonSecurityManager", "name": "checkAccess", "signature": "void checkAccess(ThreadGroup g)", "start_line": 3, "modifiers": "public", "params": [{"name": "g", "type": "ThreadGroup"}], "return_type": "void"}, "class_info": {"name": "CarbonSecurityManager", "kind": "class", "modifiers": "", "supercl...
176291010_75
class BaseViewManager extends ViewManager<T, C> { @ReactProp(name = PROP_ACCESSIBILITY_ROLE) public void setAccessibilityRole(@Nonnull T view, @Nullable String accessibilityRole) { if (accessibilityRole == null) { return; } view.setTag(R.id.accessibility_role, AccessibilityRole.fromValue(accessi...
mViewManager.setAccessibilityRole(mView, "none"); assertThat(mView.getTag(R.id.accessibility_role)).isEqualTo(AccessibilityRole.NONE); } }
[FOCAL] @ReactProp(name = PROP_ACCESSIBILITY_ROLE) public void BaseViewManager.setAccessibilityRole(T view, String accessibilityRole) [CLASS] class BaseViewManager extends ViewManager<T, C> [METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] T.setTag/2, AccessibilityRole.fromValue/1 [P...
/* static context [FOCAL] @ReactProp(name = PROP_ACCESSIBILITY_ROLE) public void BaseViewManager.setAccessibilityRole(T view, String accessibilityRole) [PATH1] if(accessibilityRole == null)=T -> return [PATH2] if(accessibilityRole == null)=F [INPUTS] branches=accessibilityRole | result=- [COLLABORATORS] param view:T se...
/* static context [FOCAL] @ReactProp(name = PROP_ACCESSIBILITY_ROLE) public void BaseViewManager.setAccessibilityRole(T view, String accessibilityRole) [PATH1] if(accessibilityRole == null)=T -> return [PATH2] if(accessibilityRole == null)=F [INPUTS] branches=accessibilityRole | result=- [COLLABORATORS] param view:T se...
true
ok
{"focal": {"class": "BaseViewManager", "name": "setAccessibilityRole", "signature": "void setAccessibilityRole(T view, String accessibilityRole)", "start_line": 3, "modifiers": "@ReactProp(name = PROP_ACCESSIBILITY_ROLE) public", "params": [{"name": "view", "type": "T"}, {"name": "accessibilityRole", "type": "String"}]...
176770877_0
class OpenApiParser { public void parse() throws Exception { // TODO: Verify compatible OpenAPI version. logger.info("Parsing definitions."); this.generateAlgodIndexerObjects(root); // Generate classes from the return types which have more than one return element logger.in...
// Given - mock subscriber listening to all events while parsing "petstore.json" Subscriber subscriber = mock(Subscriber.class); InputStream istream = getInputStreamForResource("petstore.json"); Publisher publisher = new Publisher(); publisher.subscribeAll(subscriber); /...
[FOCAL] public void OpenApiParser.parse() [CLASS] class OpenApiParser [METRICS] loc=16 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void generateAlgodIndexerObjects(JsonNode root); void generateQueryMethods(); void generateReturnTypes(JsonNode root) [CALLS-EXTERNAL] logger.info/1, publisher.ter...
/* static context [FOCAL] public void OpenApiParser.parse() [COLLABORATORS] field publisher terminate/0 [EXCEPTIONS] declares Exception [CALLS-INTERNAL] void generateAlgodIndexerObjects(JsonNode root); void generateQueryMethods(); void generateReturnTypes(JsonNode root) [CALLS-EXTERNAL] logger.info/1, publisher.termina...
/* static context [FOCAL] public void OpenApiParser.parse() [COLLABORATORS] field publisher terminate/0 [EXCEPTIONS] declares Exception [CALLS-INTERNAL] void generateAlgodIndexerObjects(JsonNode root); void generateQueryMethods(); void generateReturnTypes(JsonNode root) [CALLS-EXTERNAL] logger.info/1, publisher.termina...
true
ok
{"focal": {"class": "OpenApiParser", "name": "parse", "signature": "void parse() throws Exception", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "OpenApiParser", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"...
177104472_11
class DefaultRegistryClient implements RegistryClient { @Override public Publisher register(PublisherRegistration registration, String... data) { if (!init.get()) { throw new IllegalStateException("Client needs to be initialized before using."); } if (null == registration) ...
PublisherRegistration publisherRegistration = new PublisherRegistration(dataId); Publisher publisher = registryClient.register(publisherRegistration); PublisherRegister register = ((DefaultPublisher) publisher).assembly(); assertEquals(appName, register.getAppName()); } }
[FOCAL] @Override public Publisher DefaultRegistryClient.register(PublisherRegistration registration, String... data) [CLASS] class DefaultRegistryClient implements RegistryClient [METRICS] loc=41 cc=7 branches=6 loops=0 returns=1 throws=3 nesting=1 [CALLS-INTERNAL] void throwDuplicateException(PublisherRegistration re...
/* static context [FOCAL] @Override public Publisher DefaultRegistryClient.register(PublisherRegistration registration, String... data) [THROWS-WHEN] IllegalStateException when !init.get() [THROWS-WHEN] IllegalArgumentException when init.get() && null == registration [THROWS-WHEN] IllegalArgumentException when init.get...
/* static context [FOCAL] @Override public Publisher DefaultRegistryClient.register(PublisherRegistration registration, String... data) [THROWS-WHEN] IllegalStateException when !init.get() [THROWS-WHEN] IllegalArgumentException when init.get() && null == registration [THROWS-WHEN] IllegalArgumentException when init.get...
true
ok
{"focal": {"class": "DefaultRegistryClient", "name": "register", "signature": "Publisher register(PublisherRegistration registration, String... data)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "registration", "type": "PublisherRegistration"}, {"name": "data", "type": "String..."}], "return_...
177177812_0
class DateOperation { public static String getStringDate(Date date) { Calendar calendar = Calendar.getInstance(TimeZone.getDefault()); int month = getMonth(date); StringBuilder stringBuilder = new StringBuilder(); calendar.setTime(date); stringBuilder.append(calendar.get(Cal...
String s = DateOperation.getCurrentDateAsString(); // String s = DateOperation.getStringDate(new Date()); assertEquals("10-8-2019", s); } }
[FOCAL] public static String DateOperation.getStringDate(Date date) [CLASS] class DateOperation [METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] int getMonth(Date date) [CALLS-EXTERNAL] Calendar.getInstance/1, TimeZone.getDefault/0, Calendar.setTime/1, StringBuilder.append/1, Calen...
/* static context [FOCAL] public static String DateOperation.getStringDate(Date date) [CALLS-INTERNAL] int getMonth(Date date) [NEW] StringBuilder [CALLS-EXTERNAL] Calendar.getInstance/1, TimeZone.getDefault/0, Calendar.setTime/1, StringBuilder.append/1, Calendar.get/1, StringBuilder.toString/0 */
/* static context [FOCAL] public static String DateOperation.getStringDate(Date date) [CALLS-INTERNAL] int getMonth(Date date) [NEW] StringBuilder [CALLS-EXTERNAL] Calendar.getInstance/1, TimeZone.getDefault/0, Calendar.setTime/1, StringBuilder.append/1, Calendar.get/1, StringBuilder.toString/0 */ class DateOperation {...
true
ok
{"focal": {"class": "DateOperation", "name": "getStringDate", "signature": "String getStringDate(Date date)", "start_line": 3, "modifiers": "public static", "params": [{"name": "date", "type": "Date"}], "return_type": "String"}, "class_info": {"name": "DateOperation", "kind": "class", "modifiers": "", "superclass": nul...
177503596_3
class JpaUserDao extends JpaAbstractSearchTextDao<UserEntity, User> implements UserDao { @Override public List<User> findTenantAdmins(UUID tenantId, TextPageLink pageLink) { return DaoUtil.convertDataList( userRepository .findUsersByAuthority( ...
UUID tenantId = UUIDs.timeBased(); UUID customerId = UUIDs.timeBased(); create30Adminsand60Users(tenantId, customerId); List<User> tenantAdmins1 = userDao.findTenantAdmins(tenantId, new TextPageLink(20)); assertEquals(20, tenantAdmins1.size()); List<User> tenantAdmins2 = ...
[FOCAL] @Override public List<User> JpaUserDao.findTenantAdmins(UUID tenantId, TextPageLink pageLink) [CLASS] class JpaUserDao extends JpaAbstractSearchTextDao<UserEntity, User> implements UserDao [METRICS] loc=12 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] DaoUtil.convertDataList/1, userRepos...
/* static context [FOCAL] @Override public List<User> JpaUserDao.findTenantAdmins(UUID tenantId, TextPageLink pageLink) [INPUTS] branches=- | result=pageLink, tenantId [COLLABORATORS] field userRepository findUsersByAuthority/6; param pageLink:TextPageLink getIdOffset/0,getTextSearch/0,getLimit/0 [NEW] PageRequest [CAL...
/* static context [FOCAL] @Override public List<User> JpaUserDao.findTenantAdmins(UUID tenantId, TextPageLink pageLink) [INPUTS] branches=- | result=pageLink, tenantId [COLLABORATORS] field userRepository findUsersByAuthority/6; param pageLink:TextPageLink getIdOffset/0,getTextSearch/0,getLimit/0 [NEW] PageRequest [CAL...
true
ok
{"focal": {"class": "JpaUserDao", "name": "findTenantAdmins", "signature": "List<User> findTenantAdmins(UUID tenantId, TextPageLink pageLink)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "tenantId", "type": "UUID"}, {"name": "pageLink", "type": "TextPageLink"}], "return_type": "List<User>"}, ...
177547877_1
class StatusResponseHelper extends ResponseHelper { public boolean isStatusResponse(String json) throws CouldNotReadJsonException { if (StringUtils.isBlank(json)) { return false; } String id = getRawId(json); return StringUtils.startsWithIgnoreCase(id, TmRpcMethod.STATUS...
String dumpConsensus = DUMP_CONSENSUS_STATE; Assert.assertFalse(classUnderTest.isStatusResponse(dumpConsensus)); String statusResponse = STATUS; Assert.assertThat("StatusResponseHelper didn't recognize our status response.", classUnderTest.isStatusResponse(statusResponse), is(true)); ...
[FOCAL] public boolean StatusResponseHelper.isStatusResponse(String json) [CLASS] class StatusResponseHelper extends ResponseHelper [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] StringUtils.isBlank/1, getRawId/1 (inherited), StringUtils.startsWithIgnoreCase/2, TmRpcMethod.STATUS....
/* static context [FOCAL] public boolean StatusResponseHelper.isStatusResponse(String json) [PATH1] if(StringUtils.isBlank(json))=T -> return false [PATH2] if(StringUtils.isBlank(json))=F -> return StringUtils.startsWithIgnoreCase(id, TmRpcMethod.STATUS.getMethodSt... [INPUTS] branches=json | result=json [EXCEPTIONS] d...
/* static context [FOCAL] public boolean StatusResponseHelper.isStatusResponse(String json) [PATH1] if(StringUtils.isBlank(json))=T -> return false [PATH2] if(StringUtils.isBlank(json))=F -> return StringUtils.startsWithIgnoreCase(id, TmRpcMethod.STATUS.getMethodSt... [INPUTS] branches=json | result=json [EXCEPTIONS] d...
true
ok
{"focal": {"class": "StatusResponseHelper", "name": "isStatusResponse", "signature": "boolean isStatusResponse(String json) throws CouldNotReadJsonException", "start_line": 3, "modifiers": "public", "params": [{"name": "json", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "StatusResponseHelper",...
177672258_0
class Util { public static <T, E> T getKeyByValue(Map<T, E> map, E value) { for (Map.Entry<T, E> entry : map.entrySet()) { if (Objects.equals(value, entry.getValue())) { return entry.getKey(); } } return null; } } class UtilTest { @Test ...
// Given Map<String, String> map = new HashMap<>(); map.put("key1", "value1"); map.put("key2", "value2"); map.put("key3", "value3"); // When String key = Util.getKeyByValue(map, "value1"); // Then assertEquals("key1", key); } }
[FOCAL] public static T Util.getKeyByValue(Map<T, E> map, E value) [CLASS] class Util [METRICS] loc=8 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] Map<T, E>.entrySet/0, Objects.equals/2, Map.Entry<T, E>.getValue/0, Map.Entry<T, E>.getKey/0 [PATH1] foreach(Map.Entry<T, E> entry : map.entrySet())...
/* static context [FOCAL] public static T Util.getKeyByValue(Map<T, E> map, E value) [PATH1] foreach(Map.Entry<T, E> entry : map.entrySet())=T -> if(Objects.equals(value, entry.getValue()))=F -> exit loop -> return null [PATH2] foreach(Map.Entry<T, E> entry : map.entrySet())=T -> if(Objects.equals(value, entry.getValue...
/* static context [FOCAL] public static T Util.getKeyByValue(Map<T, E> map, E value) [PATH1] foreach(Map.Entry<T, E> entry : map.entrySet())=T -> if(Objects.equals(value, entry.getValue()))=F -> exit loop -> return null [PATH2] foreach(Map.Entry<T, E> entry : map.entrySet())=T -> if(Objects.equals(value, entry.getValue...
true
ok
{"focal": {"class": "Util", "name": "getKeyByValue", "signature": "T getKeyByValue(Map<T, E> map, E value)", "start_line": 3, "modifiers": "public static", "params": [{"name": "map", "type": "Map<T, E>"}, {"name": "value", "type": "E"}], "return_type": "T"}, "class_info": {"name": "Util", "kind": "class", "modifiers": ...
177745239_136
class Quant1PropertiesGroupingAsgStrategy implements AsgStrategy { @Override public void apply(AsgQuery query, AsgStrategyContext context) { // phase 1 - group all Eprops to EPropGroups AsgQueryUtil.elements(query, Quant1.class).forEach(quant -> { List<AsgEBase<EProp>> ePropsAsg...
AsgQuery query = start("q1", "ont").next(typed(1, "1")).next(quant1(2, all)) .next(quant1(3, all)).in( eProp(4, "p1", of(eq, "abc" )), eProp(5, "p2", of(eq, 1 )), eProp(6, "p3", of(gt, 6))) .build(); ...
[FOCAL] @Override public void Quant1PropertiesGroupingAsgStrategy.apply(AsgQuery query, AsgStrategyContext context) [CLASS] class Quant1PropertiesGroupingAsgStrategy implements AsgStrategy [METRICS] loc=33 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=2 [CALLS-EXTERNAL] AsgQueryUtil.elements(query, Quant1.class).f...
/* static context [FOCAL] @Override public void Quant1PropertiesGroupingAsgStrategy.apply(AsgQuery query, AsgStrategyContext context) [INPUTS] branches=- | result=- | unused=context [COLLABORATORS] field quant geteBase/0,addNextChild/1; field asgEBase geteBase/0 [NEW] EPropGroup, AsgEBase<> [CALLS-EXTERNAL] AsgQueryUti...
/* static context [FOCAL] @Override public void Quant1PropertiesGroupingAsgStrategy.apply(AsgQuery query, AsgStrategyContext context) [INPUTS] branches=- | result=- | unused=context [COLLABORATORS] field quant geteBase/0,addNextChild/1; field asgEBase geteBase/0 [NEW] EPropGroup, AsgEBase<> [CALLS-EXTERNAL] AsgQueryUti...
true
ok
{"focal": {"class": "Quant1PropertiesGroupingAsgStrategy", "name": "apply", "signature": "void apply(AsgQuery query, AsgStrategyContext context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "query", "type": "AsgQuery"}, {"name": "context", "type": "AsgStrategyContext"}], "return_type": "void"...
177751597_24
class TransactionRetStore extends TronStoreWithRevoking<TransactionRetCapsule> { @Override public void put(byte[] key, TransactionRetCapsule item) { if (BooleanUtils.toBoolean(Args.getInstance().getStorage().getTransactionHistoreSwitch())) { super.put(key, item); } } @Autowired public Transacti...
TransactionInfoCapsule transactionInfoCapsule = new TransactionInfoCapsule(); transactionInfoCapsule.setId(transactionId); transactionInfoCapsule.setFee(1000L); transactionInfoCapsule.setBlockNumber(100L); transactionInfoCapsule.setBlockTimeStamp(200L); TransactionRetCapsule transactionRetCapsu...
[FOCAL] @Override public void TransactionRetStore.put(byte[] key, TransactionRetCapsule item) [CLASS] class TransactionRetStore extends TronStoreWithRevoking<TransactionRetCapsule> [METRICS] loc=6 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] BooleanUtils.toBoolean/1, Args.getInstance().getStora...
/* static context [FOCAL] @Override public void TransactionRetStore.put(byte[] key, TransactionRetCapsule item) [PATH1] if(BooleanUtils.toBoolean(Args.getInstance().getStorage().getTransactionHistoreSwitch()))=T [PATH2] if(BooleanUtils.toBoolean(Args.getInstance().getStorage().getTransactionHistoreSwitch()))=F [CALLS-E...
/* static context [FOCAL] @Override public void TransactionRetStore.put(byte[] key, TransactionRetCapsule item) [PATH1] if(BooleanUtils.toBoolean(Args.getInstance().getStorage().getTransactionHistoreSwitch()))=T [PATH2] if(BooleanUtils.toBoolean(Args.getInstance().getStorage().getTransactionHistoreSwitch()))=F [CALLS-E...
true
ok
{"focal": {"class": "TransactionRetStore", "name": "put", "signature": "void put(byte[] key, TransactionRetCapsule item)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "key", "type": "byte[]"}, {"name": "item", "type": "TransactionRetCapsule"}], "return_type": "void"}, "class_info": {"name": "T...
178002723_4
class ProtoDescriptorSerializer { public List<FileContent> descriptorToString(FileDescriptorSet descriptorSet) { List<FileContent> result = new LinkedList<>(); for (FileDescriptorProto protoFileDesc : descriptorSet.getFileList()) { StringBuilder buffer = new StringBuilder(); buffer.append("syntax = \"...
String file = IOUtils.toString(getClass().getResourceAsStream("/HelloService.proto")); FileDescriptorSet descriptorSet = toDescriptor(file); var sut = new ProtoDescriptorSerializer(); var generatedFiles = sut.descriptorToString(descriptorSet); var generatedContent = generatedFiles.get(0).getContents(); ...
[FOCAL] public List<FileContent> ProtoDescriptorSerializer.descriptorToString(FileDescriptorSet descriptorSet) [CLASS] class ProtoDescriptorSerializer [METRICS] loc=65 cc=10 branches=3 loops=6 returns=1 throws=0 nesting=4 [CALLS-INTERNAL] String getType(Type type); String toLabel(FieldDescriptorProto.Label label) [CALL...
/* static context [FOCAL] public List<FileContent> ProtoDescriptorSerializer.descriptorToString(FileDescriptorSet descriptorSet) [PATH1] foreach(FileDescriptorProto protoFileDesc : descriptorSet.getFileList())=T -> foreach(Entry<FieldDescriptor, Object> opt : protoFileDesc.getOptions().getAllFields().entrySet())=T -> e...
/* static context [FOCAL] public List<FileContent> ProtoDescriptorSerializer.descriptorToString(FileDescriptorSet descriptorSet) [PATH1] foreach(FileDescriptorProto protoFileDesc : descriptorSet.getFileList())=T -> foreach(Entry<FieldDescriptor, Object> opt : protoFileDesc.getOptions().getAllFields().entrySet())=T -> e...
true
ok
{"focal": {"class": "ProtoDescriptorSerializer", "name": "descriptorToString", "signature": "List<FileContent> descriptorToString(FileDescriptorSet descriptorSet)", "start_line": 3, "modifiers": "public", "params": [{"name": "descriptorSet", "type": "FileDescriptorSet"}], "return_type": "List<FileContent>"}, "class_inf...
178064729_22
class RegexPredicate implements Predicate<String> { @Override public boolean test(String httpText) { return this.patterns.stream() .anyMatch(p -> p.matcher(httpText).matches()); } public RegexPredicate(List<Pattern> patterns); public static Predicate<String> createDefaultUrlAllowlist(); public static Pr...
RegexPredicate test = new RegexPredicate(Arrays.asList(Pattern.compile("^$"))); assertThat(test.test("foo")).isFalse(); } }
[FOCAL] @Override public boolean RegexPredicate.test(String httpText) [CLASS] class RegexPredicate implements Predicate<String> [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] this.patterns.stream().anyMatch/1, this.patterns.stream/0, p.matcher(httpText).matches/0, p.matcher/1 [FIE...
/* static context [FOCAL] @Override public boolean RegexPredicate.test(String httpText) [INPUTS] branches=- | result=httpText [COLLABORATORS] field patterns stream/0; field p matcher/1 [FIELDS] read=patterns [CALLS-EXTERNAL] this.patterns.stream().anyMatch/1, this.patterns.stream/0, p.matcher(httpText).matches/0, p.mat...
/* static context [FOCAL] @Override public boolean RegexPredicate.test(String httpText) [INPUTS] branches=- | result=httpText [COLLABORATORS] field patterns stream/0; field p matcher/1 [FIELDS] read=patterns [CALLS-EXTERNAL] this.patterns.stream().anyMatch/1, this.patterns.stream/0, p.matcher(httpText).matches/0, p.mat...
true
ok
{"focal": {"class": "RegexPredicate", "name": "test", "signature": "boolean test(String httpText)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "httpText", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "RegexPredicate", "kind": "class", "modifiers": "", "superclass": nu...
178169608_2
class ObjectMapperHelper { public static Optional<SnykTestStatus> unmarshall(Path path) throws IOException { if (path == null) { return Optional.empty(); } try (JsonParser parser = JSON_FACTORY.createParser(path.toFile())) { JsonToken token = parser.nextToken(); if (token == JsonToken....
Path snykReportJsonForMultiProject = Paths.get(TEST_FIXTURES_DIRECTORY.getAbsolutePath(), "multi-module-project", "snyk_report_with_vulns.json"); Optional<SnykTestStatus> snykTestStatus = ObjectMapperHelper.unmarshall(snykReportJsonForMultiProject); assertTrue(snykTestStatus.isPresent()); assertAll("m...
[FOCAL] public static Optional<SnykTestStatus> ObjectMapperHelper.unmarshall(Path path) [CLASS] class ObjectMapperHelper [METRICS] loc=20 cc=5 branches=3 loops=1 returns=4 throws=0 nesting=3 [CALLS-INTERNAL] SnykTestStatus aggregateTestResults(List<SnykTestStatus> testStatuses); SnykTestStatus readTestResult(JsonParser...
/* static context [FOCAL] public static Optional<SnykTestStatus> ObjectMapperHelper.unmarshall(Path path) [PATH1] if(path == null)=F -> if(token == JsonToken.START_ARRAY)=T -> while(parser.nextToken() != JsonToken.END_ARRAY)=T -> exit loop -> return Optional.of(aggregateTestResults(testStatuses)) [PATH2] if(path == nul...
/* static context [FOCAL] public static Optional<SnykTestStatus> ObjectMapperHelper.unmarshall(Path path) [PATH1] if(path == null)=F -> if(token == JsonToken.START_ARRAY)=T -> while(parser.nextToken() != JsonToken.END_ARRAY)=T -> exit loop -> return Optional.of(aggregateTestResults(testStatuses)) [PATH2] if(path == nul...
true
ok
{"focal": {"class": "ObjectMapperHelper", "name": "unmarshall", "signature": "Optional<SnykTestStatus> unmarshall(Path path) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "path", "type": "Path"}], "return_type": "Optional<SnykTestStatus>"}, "class_info": {"name": "ObjectMapperH...
178173999_39
class NeuralNetwork implements Serializable { public synchronized void addListener(NeuralNetworkEventListener listener) { if (listener == null) throw new IllegalArgumentException("listener is null!"); listeners.add(listener); } public NeuralNetwork(); public void addLaye...
NeuralNetworkEventListener l = Mockito.mock(NeuralNetworkEventListener.class); instance.addListener(l); NeuralNetworkEvent event = Mockito.mock(NeuralNetworkEvent.class); instance.fireNetworkEvent(event); Mockito.verify(l).handleNeuralNetworkEvent(event); NeuralNetworkEv...
[FOCAL] public synchronized void NeuralNetwork.addListener(NeuralNetworkEventListener listener) [CLASS] class NeuralNetwork implements Serializable [METRICS] loc=6 cc=2 branches=1 loops=0 returns=0 throws=1 nesting=1 [CALLS-EXTERNAL] listeners.add/1 [NEW] IllegalArgumentException [EXCEPTIONS] throws IllegalArgumentExce...
/* static context [FOCAL] public synchronized void NeuralNetwork.addListener(NeuralNetworkEventListener listener) [THROWS-WHEN] IllegalArgumentException when listener == null [PATH1] if(listener == null)=T -> throw new IllegalArgumentException("listener is null!") [PATH2] if(listener == null)=F [INPUTS] branches=listen...
/* static context [FOCAL] public synchronized void NeuralNetwork.addListener(NeuralNetworkEventListener listener) [THROWS-WHEN] IllegalArgumentException when listener == null [PATH1] if(listener == null)=T -> throw new IllegalArgumentException("listener is null!") [PATH2] if(listener == null)=F [INPUTS] branches=listen...
true
ok
{"focal": {"class": "NeuralNetwork", "name": "addListener", "signature": "void addListener(NeuralNetworkEventListener listener)", "start_line": 3, "modifiers": "public synchronized", "params": [{"name": "listener", "type": "NeuralNetworkEventListener"}], "return_type": "void"}, "class_info": {"name": "NeuralNetwork", "...
178313880_0
class TableEnv { public DataTable sqlQuery(String sql) { try { executeBeforeSqlQuery(sql); if (sql2ExecutionPlanCache != null) { TableExecutionPlan executionPlan = sql2ExecutionPlanCache .getIfPresent( cacheKeyPrefix + sql); if (executionPlan != null) { ...
DataTable table1 = tableEnv.sqlQuery("select * from test.t1"); Assert.assertNotNull(table1); DataTable table2 = tableEnv.sqlQuery("select * from t2"); Assert.assertNotNull(table2); Assert.assertEquals("hello,marble", tableEnv.sqlQuery("select hello('marble') as c1") .toMapList() ...
[FOCAL] public DataTable TableEnv.sqlQuery(String sql) [CLASS] class TableEnv [METRICS] loc=28 cc=5 branches=3 loops=0 returns=2 throws=1 nesting=3 [CALLS-INTERNAL] DataTable implement(Bindable bindable, RelDataType rowType, RelDataTypeFactory typeFactory); TableExecutionPlan toExecutionPlan(String sql); void executeAf...
/* static context [FOCAL] public DataTable TableEnv.sqlQuery(String sql) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] if(sql2ExecutionPlanCache != null)#1=T -> if(executionPlan != null)=F -> if(sql2ExecutionPlanCache != null)#2=T -> return dt [PATH2] try-body throws -> throw new RuntimeException( "curren...
/* static context [FOCAL] public DataTable TableEnv.sqlQuery(String sql) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] if(sql2ExecutionPlanCache != null)#1=T -> if(executionPlan != null)=F -> if(sql2ExecutionPlanCache != null)#2=T -> return dt [PATH2] try-body throws -> throw new RuntimeException( "curren...
true
ok
{"focal": {"class": "TableEnv", "name": "sqlQuery", "signature": "DataTable sqlQuery(String sql)", "start_line": 3, "modifiers": "public", "params": [{"name": "sql", "type": "String"}], "return_type": "DataTable"}, "class_info": {"name": "TableEnv", "kind": "class", "modifiers": "", "superclass": null, "interfaces": nu...
178461625_308
class DefaultCompletableAsyncCompletion implements CompletableAsyncCompletion { @Override public void join() throws CompletionException, InterruptedException { try { join(10, TimeUnit.SECONDS); } catch (TimeoutException ex) { throw new RuntimeException("Default timeout triggered for blocking ca...
AtomicReference<Boolean> executed = new AtomicReference<>(); AsyncCompletion completion = AsyncCompletion.executeBlocking(() -> executed.set(true)); completion.join(); assertTrue(executed.get()); } }
[FOCAL] @Override public void DefaultCompletableAsyncCompletion.join() [CLASS] class DefaultCompletableAsyncCompletion implements CompletableAsyncCompletion [METRICS] loc=8 cc=2 branches=0 loops=0 returns=0 throws=1 nesting=1 [CALLS-INTERNAL] void join(long timeout, TimeUnit unit) [NEW] RuntimeException [EXCEPTIONS] de...
/* static context [FOCAL] @Override public void DefaultCompletableAsyncCompletion.join() [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException("Default timeout triggered for blocking call t... [EXCEPTIONS] declares CompletionException, InterruptedException; throws Run...
/* static context [FOCAL] @Override public void DefaultCompletableAsyncCompletion.join() [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException("Default timeout triggered for blocking call t... [EXCEPTIONS] declares CompletionException, InterruptedException; throws Run...
true
ok
{"focal": {"class": "DefaultCompletableAsyncCompletion", "name": "join", "signature": "void join() throws CompletionException, InterruptedException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "DefaultCompletableAsyncCompletion", "kind": "class", "modi...
178518612_3
class FreeMarkerUtils { public static String generate(String ftl, Object dataModel){ try { Template template = getTemplate(ftl); return buildResult(template, dataModel); } catch (IOException e) { logger.error("Error: {}\n{}", e.getMessage(), e.getStackTrace()); ...
String ftl = "${str?substring(str?last_index_of('.') + 1)}"; Map<String, String> model = new HashMap<>(); model.put("str", "java.utils.List"); String result = FreeMarkerUtils.generate(ftl, model); Assert.assertEquals("List", result); } }
[FOCAL] public static String FreeMarkerUtils.generate(String ftl, Object dataModel) [CLASS] class FreeMarkerUtils [METRICS] loc=11 cc=3 branches=0 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] String buildResult(Template template, Object dataModel); Template getTemplate(String ftl) [CALLS-EXTERNAL] Logger.error...
/* static context [FOCAL] public static String FreeMarkerUtils.generate(String ftl, Object dataModel) [PATH1] try-body throws -> return null [PATH2] return buildResult(template, dataModel) [INPUTS] branches=- | result=dataModel, ftl [EXCEPTIONS] catches IOException e, TemplateException e [CALLS-INTERNAL] String buildRe...
/* static context [FOCAL] public static String FreeMarkerUtils.generate(String ftl, Object dataModel) [PATH1] try-body throws -> return null [PATH2] return buildResult(template, dataModel) [INPUTS] branches=- | result=dataModel, ftl [EXCEPTIONS] catches IOException e, TemplateException e [CALLS-INTERNAL] String buildRe...
true
ok
{"focal": {"class": "FreeMarkerUtils", "name": "generate", "signature": "String generate(String ftl, Object dataModel)", "start_line": 3, "modifiers": "public static", "params": [{"name": "ftl", "type": "String"}, {"name": "dataModel", "type": "Object"}], "return_type": "String"}, "class_info": {"name": "FreeMarkerUtil...
178760528_3
class NamingChangelogAndRepartitionTopics { public Topology buildTopology(Properties envProps) { final StreamsBuilder builder = new StreamsBuilder(); final String inputTopic = envProps.getProperty("input.topic.name"); final String outputTopic = envProps.getProperty("output.topic.name"); final String ...
envProps.put("add.names", "true"); Topology topology = namingChangelogAndRepartitionTopics.buildTopology(envProps); final String firstTopologyNoFilter = topology.describe().toString(); final String initialStateStoreName = "the-counting-store"; final String initialAggregationRep...
[FOCAL] public Topology NamingChangelogAndRepartitionTopics.buildTopology(Properties envProps) [CLASS] class NamingChangelogAndRepartitionTopics [METRICS] loc=46 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] Properties.getProperty/1, Serdes.Long/0, Serdes.String/0, Boolean.parseBoolean/1, builde...
/* static context [FOCAL] public Topology NamingChangelogAndRepartitionTopics.buildTopology(Properties envProps) [PATH1] if(addFilter)=T -> if(!addNames)=T -> return builder.build() [PATH2] if(addFilter)=F -> if(!addNames)=F -> return builder.build() [INPUTS] branches=envProps | result=- [COLLABORATORS] param envProps:...
/* static context [FOCAL] public Topology NamingChangelogAndRepartitionTopics.buildTopology(Properties envProps) [PATH1] if(addFilter)=T -> if(!addNames)=T -> return builder.build() [PATH2] if(addFilter)=F -> if(!addNames)=F -> return builder.build() [INPUTS] branches=envProps | result=- [COLLABORATORS] param envProps:...
true
ok
{"focal": {"class": "NamingChangelogAndRepartitionTopics", "name": "buildTopology", "signature": "Topology buildTopology(Properties envProps)", "start_line": 3, "modifiers": "public", "params": [{"name": "envProps", "type": "Properties"}], "return_type": "Topology"}, "class_info": {"name": "NamingChangelogAndRepartitio...
178830383_11
class AuditRequestBodyAdvice extends RequestBodyAdviceAdapter { @Override public Object afterBodyRead(Object body, HttpInputMessage inputMessage, MethodParameter parameter, Type targetType, ...
advice.afterBodyRead(new Consents(), null, null, null, null); assertThat(MDC.get("consentModel")).contains("unknown"); } }
[FOCAL] @Override public Object AuditRequestBodyAdvice.afterBodyRead(Object body, HttpInputMessage inputMessage, MethodParameter parameter, Type targetType, Class<? extends HttpMessageConverter<?>> converterType) [CLASS] class AuditRequestBodyAdvice extends RequestBodyAdviceAdapter [METRICS] loc=16 cc=2 branches=1 loop...
/* static context [FOCAL] @Override public Object AuditRequestBodyAdvice.afterBodyRead(Object body, HttpInputMessage inputMessage, MethodParameter parameter, Type targetType, Class<? extends HttpMessageConverter<?>> converterType) [PATH1] if(body instanceof Consents)=T -> return body [PATH2] if(body instanceof Consents...
/* static context [FOCAL] @Override public Object AuditRequestBodyAdvice.afterBodyRead(Object body, HttpInputMessage inputMessage, MethodParameter parameter, Type targetType, Class<? extends HttpMessageConverter<?>> converterType) [PATH1] if(body instanceof Consents)=T -> return body [PATH2] if(body instanceof Consents...
true
ok
{"focal": {"class": "AuditRequestBodyAdvice", "name": "afterBodyRead", "signature": "Object afterBodyRead(Object body, HttpInputMessage inputMessage, MethodParameter parameter, Type targetType, Class<? extends HttpMessageConverter<?>> converterType)", "start_line": 3, "modifiers": "@Override public", "params": [{"name"...
178922614_6
class CsvParser { public static List<TestData> parse(Path testFile) throws IOException { Reader reader = Files.newBufferedReader(testFile); try { return parse(testFile.getFileName().toString(), reader); } catch (RuntimeException e) { throw new RuntimeException("Fail...
String content = "# Basic Scalar Types\n" + "1| type ScalarHolder | bigDecimalObject: BigDecimal | Expecting a BigDecimal Scalar Type in type ScalarHolder\n"; final List<TestData> testDate = CsvParser.parse("shouldHandleComments", new StringReader(content)); Assert.assertEquals...
[FOCAL] public static List<TestData> CsvParser.parse(Path testFile) [CLASS] class CsvParser [METRICS] loc=9 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] List<TestData> parse(String fileName, Reader reader) [CALLS-EXTERNAL] Files.newBufferedReader/1, testFile.getFileName().toString/0, Path.getFi...
/* static context [FOCAL] public static List<TestData> CsvParser.parse(Path testFile) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException("Failed parsing '" + testFile + "'", e) [PATH2] return parse(testFile.getFileName().toString(), reader) [INPUTS] branches=- | re...
/* static context [FOCAL] public static List<TestData> CsvParser.parse(Path testFile) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException("Failed parsing '" + testFile + "'", e) [PATH2] return parse(testFile.getFileName().toString(), reader) [INPUTS] branches=- | re...
true
ok
{"focal": {"class": "CsvParser", "name": "parse", "signature": "List<TestData> parse(Path testFile) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "testFile", "type": "Path"}], "return_type": "List<TestData>"}, "class_info": {"name": "CsvParser", "kind": "class", "modifiers": ""...
179002056_18
class Database implements Runnable { @Override public void run() { try { switch (method) { case "get": runGet(); break; case "delete": runDelete(); break; case "put": runPut(); break; case "scan": runSca...
// Arrange // Action CommandLine.run(database, "delete", "-p {\"partition\":\"p\"}"); // Assert Key partition = new Key(new TextValue("partition", "p")); Delete expected = new Delete(partition); verify(backend).delete(expected); } }
[FOCAL] @Override public void Database.run() [CLASS] class Database implements Runnable [METRICS] loc=21 cc=6 branches=1 loops=0 returns=0 throws=0 nesting=2 [CALLS-INTERNAL] void runDelete(); void runGet(); void runPut(); void runScan() [CALLS-EXTERNAL] TerminalWrapper.println/1, IllegalArgumentException.getMessage/0 ...
/* static context [FOCAL] @Override public void Database.run() [PATH1] try-body throws [PATH2] switch(method)=case "get" [PATH3] switch(method)=case "delete" [PATH4] switch(method)=case "put" [PATH5] switch(method)=case "scan" [PATH6] switch(method)=default [COLLABORATORS] field terminal:TerminalWrapper println/1 [EXCE...
/* static context [FOCAL] @Override public void Database.run() [PATH1] try-body throws [PATH2] switch(method)=case "get" [PATH3] switch(method)=case "delete" [PATH4] switch(method)=case "put" [PATH5] switch(method)=case "scan" [PATH6] switch(method)=default [COLLABORATORS] field terminal:TerminalWrapper println/1 [EXCE...
true
ok
{"focal": {"class": "Database", "name": "run", "signature": "void run()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "Database", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Runnable", "fields": [{"name": "backend", "type": "Mut...
179494421_7
class ArrayCreator { public static Optional<Array> createArray(Type type) { return createArray(null, type, false); } private ArrayCreator(); public static Optional<Array> createArray(Type type, boolean batched); public static Optional<Array> createArray(Type fieldType, Type methodType); ...
final ParameterizedType stringList = ParameterizedType.create(DotName.createSimple(List.class.getName()), new Type[] { STRING_TYPE }, null); final ParameterizedType type = ParameterizedType.create(Classes.COMPLETION_STAGE, new Type[] { stringList }, null); assert...
[FOCAL] public static Optional<Array> ArrayCreator.createArray(Type type) [CLASS] class ArrayCreator [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Optional<Array> createArray(Type fieldType, Type methodType, boolean batched) [INPUTS] branches=- | result=type [DATAFLOW] type@param...
/* static context [FOCAL] public static Optional<Array> ArrayCreator.createArray(Type type) [INPUTS] branches=- | result=type [CALLS-INTERNAL] Optional<Array> createArray(Type fieldType, Type methodType, boolean batched) */
/* static context [FOCAL] public static Optional<Array> ArrayCreator.createArray(Type type) [INPUTS] branches=- | result=type [CALLS-INTERNAL] Optional<Array> createArray(Type fieldType, Type methodType, boolean batched) */ class ArrayCreator { public static Optional<Array> createArray(Type type) { return ...
true
ok
{"focal": {"class": "ArrayCreator", "name": "createArray", "signature": "Optional<Array> createArray(Type type)", "start_line": 3, "modifiers": "public static", "params": [{"name": "type", "type": "Type"}], "return_type": "Optional<Array>"}, "class_info": {"name": "ArrayCreator", "kind": "class", "modifiers": "", "supe...
179502880_327
class DefectService { boolean areEqualDownToSeconds(Date date1, Date date2) { final boolean bothNull = (date1 == null && date2 == null); final boolean bothNotNull = (date1 != null && date2 != null); return bothNull || (bothNotNull && (date1.getTime() / 1000) == (date2.getTime() / 1000)); ...
// GIVEN final Date date1 = new Date(2001); final Date date2 = new Date(1000); // WHEN boolean areEqual = cut.areEqualDownToSeconds(date1, date2); // THEN assertThat(areEqual).isFalse(); } }
[FOCAL] boolean DefectService.areEqualDownToSeconds(Date date1, Date date2) [CLASS] class DefectService [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Date.getTime/0 [INPUTS] branches=- | result=date1, date2 [COLLABORATORS] param date1:Date getTime/0; param date2:Date getTime/0 [D...
/* static context [FOCAL] boolean DefectService.areEqualDownToSeconds(Date date1, Date date2) [INPUTS] branches=- | result=date1, date2 [COLLABORATORS] param date1:Date getTime/0; param date2:Date getTime/0 [CALLS-EXTERNAL] Date.getTime/0 */
/* static context [FOCAL] boolean DefectService.areEqualDownToSeconds(Date date1, Date date2) [INPUTS] branches=- | result=date1, date2 [COLLABORATORS] param date1:Date getTime/0; param date2:Date getTime/0 [CALLS-EXTERNAL] Date.getTime/0 */ class DefectService { boolean areEqualDownToSeconds(Date date1, Date date...
true
ok
{"focal": {"class": "DefectService", "name": "areEqualDownToSeconds", "signature": "boolean areEqualDownToSeconds(Date date1, Date date2)", "start_line": 3, "modifiers": "", "params": [{"name": "date1", "type": "Date"}, {"name": "date2", "type": "Date"}], "return_type": "boolean"}, "class_info": {"name": "DefectService...
179541399_2
class JSONPointer { public TDPath parse(String str) { TDPath path = new TDPath(); if (StringUtil.isEmpty(str)) return path; if (str.endsWith("#")) // Ignore the last # which indicate "key" of the map str = str.substring(0, str.length() - 1); if (str.indexOf('#') < 0) { if (parsePa...
verify("//ab.c/p1#/p1", new TDPath().setDocPath("//ab.c/p1").addParts(Part.ofRoot(), Part.ofChild("p1"))); verify("//ab.c/p1#p1/p2", new TDPath().setDocPath("//ab.c/p1").addParts(Part.ofId("p1"), Part.ofChild("p2"))); verify("1/p1", new TDPath().addParts(Part.ofRelative(1), Part.ofChild("p1"))); verify(...
[FOCAL] public TDPath JSONPointer.parse(String str) [CLASS] class JSONPointer [METRICS] loc=22 cc=6 branches=5 loops=0 returns=3 throws=0 nesting=2 [CALLS-INTERNAL] boolean parseParts(String str, TDPath path, boolean relativeWithNum) [CALLS-EXTERNAL] StringUtil.isEmpty/1, String.endsWith/1, String.substring/2, String.l...
/* static context [FOCAL] public TDPath JSONPointer.parse(String str) [PATH1] if(StringUtil.isEmpty(str))=F -> if(str.endsWith("#"))=T -> if(str.indexOf('#') < 0)=T -> if(parseParts(str, path, true))=T -> return path [PATH2] if(StringUtil.isEmpty(str))=F -> if(str.endsWith("#"))=F -> if(str.indexOf('#') < 0)=F -> if(!s...
/* static context [FOCAL] public TDPath JSONPointer.parse(String str) [PATH1] if(StringUtil.isEmpty(str))=F -> if(str.endsWith("#"))=T -> if(str.indexOf('#') < 0)=T -> if(parseParts(str, path, true))=T -> return path [PATH2] if(StringUtil.isEmpty(str))=F -> if(str.endsWith("#"))=F -> if(str.indexOf('#') < 0)=F -> if(!s...
true
ok
{"focal": {"class": "JSONPointer", "name": "parse", "signature": "TDPath parse(String str)", "start_line": 3, "modifiers": "public", "params": [{"name": "str", "type": "String"}], "return_type": "TDPath"}, "class_info": {"name": "JSONPointer", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "f...
179849363_8
class CpdTokensFiller implements Filler { @Override public void fill(InputFile file, SensorContext context, AntlrContext antlrContext) { try { if (!(file instanceof DefaultInputFile)) { return; } NewCpdTokens newCpdTokens = context.newCpdTokens().onFile(file); List<? extends Token> tokens = antlrCo...
SensorContextTester ctxTester = SensorContextTester.create(folder.getRoot()); ctxTester.fileSystem().setWorkDir(folder.getRoot().toPath()); File baseFile = folder.newFile("test.sql"); FileUtils.copyURLToFile(getClass().getResource("/tsql/sample1.sql"), baseFile); String contents = FileUtils.readFileToString...
[FOCAL] @Override public void CpdTokensFiller.fill(InputFile file, SensorContext context, AntlrContext antlrContext) [CLASS] class CpdTokensFiller implements Filler [METRICS] loc=36 cc=7 branches=3 loops=1 returns=1 throws=0 nesting=4 [CALLS-EXTERNAL] context.newCpdTokens().onFile/1, SensorContext.newCpdTokens/0, Antlr...
/* static context [FOCAL] @Override public void CpdTokensFiller.fill(InputFile file, SensorContext context, AntlrContext antlrContext) [PATH1] if(!(file instanceof DefaultInputFile))=F -> foreach(Token token : tokens)=T -> try-body throws -> if(LOGGER.isDebugEnabled())=T -> exit loop [PATH2] if(!(file instanceof Defaul...
/* static context [FOCAL] @Override public void CpdTokensFiller.fill(InputFile file, SensorContext context, AntlrContext antlrContext) [PATH1] if(!(file instanceof DefaultInputFile))=F -> foreach(Token token : tokens)=T -> try-body throws -> if(LOGGER.isDebugEnabled())=T -> exit loop [PATH2] if(!(file instanceof Defaul...
true
ok
{"focal": {"class": "CpdTokensFiller", "name": "fill", "signature": "void fill(InputFile file, SensorContext context, AntlrContext antlrContext)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "file", "type": "InputFile"}, {"name": "context", "type": "SensorContext"}, {"name": "antlrContext", "t...
179925476_3
class SingleLevelCacheRepository extends BaseRepository<M, P> implements Repository<M, P> { @NotNull @Override public Single<M> getLatest(P params) { return networkDataSource.getAndUpdate(params, cacheDataSource) .map(TimeStampedData::getModel) .toSingle(); } ...
TestObserver<String> testObserver = TestObserver.create(); when(networkDataSource.getAndUpdate(parameter, cacheDataSource)).thenReturn(Maybe.just(NETWORK_DATA)); sut.getLatest(parameter) .subscribe(testObserver); testObserver.assertResult(NETWORK_STRING); // includes .a...
[FOCAL] @NotNull @Override public Single<M> SingleLevelCacheRepository.getLatest(P params) [CLASS] class SingleLevelCacheRepository extends BaseRepository<M, P> implements Repository<M, P> [METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] networkDataSource.getAndUpdate(params, cacheD...
/* static context [FOCAL] @NotNull @Override public Single<M> SingleLevelCacheRepository.getLatest(P params) [INPUTS] branches=- | result=params, cacheDataSource, networkDataSource [COLLABORATORS] field networkDataSource:DataSource<String, Double> getAndUpdate/2 [FIELDS] read=cacheDataSource:MemoryCacheDataSource<Strin...
/* static context [FOCAL] @NotNull @Override public Single<M> SingleLevelCacheRepository.getLatest(P params) [INPUTS] branches=- | result=params, cacheDataSource, networkDataSource [COLLABORATORS] field networkDataSource:DataSource<String, Double> getAndUpdate/2 [FIELDS] read=cacheDataSource:MemoryCacheDataSource<Strin...
true
ok
{"focal": {"class": "SingleLevelCacheRepository", "name": "getLatest", "signature": "Single<M> getLatest(P params)", "start_line": 3, "modifiers": "@NotNull @Override public", "params": [{"name": "params", "type": "P"}], "return_type": "Single<M>"}, "class_info": {"name": "SingleLevelCacheRepository", "kind": "class", ...
179952747_0
class Utils { static String capitalize(String name) { return name.substring(0, 1).toUpperCase() + name.substring(1); } } class UtilsTest { @Test public void capitalize() {
assertEquals(Utils.capitalize("id"), "Id"); assertEquals(Utils.capitalize("location"), "Location"); assertEquals(Utils.capitalize("ABTesting"), "ABTesting"); assertEquals(Utils.capitalize("user"), "User"); } }
[FOCAL] static String Utils.capitalize(String name) [CLASS] class Utils [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] name.substring(0, 1).toUpperCase/0, String.substring/2, String.substring/1 [INPUTS] branches=- | result=name [DATAFLOW] name@param->L2 [TEST] UtilsTest: @Test pub...
/* static context [FOCAL] static String Utils.capitalize(String name) [INPUTS] branches=- | result=name [CALLS-EXTERNAL] name.substring(0, 1).toUpperCase/0, String.substring/2, String.substring/1 */
/* static context [FOCAL] static String Utils.capitalize(String name) [INPUTS] branches=- | result=name [CALLS-EXTERNAL] name.substring(0, 1).toUpperCase/0, String.substring/2, String.substring/1 */ class Utils { static String capitalize(String name) { return name.substring(0, 1).toUpperCase() + name.subst...
true
ok
{"focal": {"class": "Utils", "name": "capitalize", "signature": "String capitalize(String name)", "start_line": 3, "modifiers": "static", "params": [{"name": "name", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Utils", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "f...
180526285_34
class QueryIndexEndpointStrategy implements EndpointDetectionStrategy { @Override public Mono<Endpoints> detectEndpoints(Instance instance) { Registration registration = instance.getRegistration(); String managementUrl = registration.getManagementUrl(); if (managementUrl == null || Obje...
//given Instance instance = Instance.create(InstanceId.of("id")) .register(Registration.create("test", wireMock.url("/mgmt/health")) .managementUrl(wireMock.url("/mgmt")) ...
[FOCAL] @Override public Mono<Endpoints> QueryIndexEndpointStrategy.detectEndpoints(Instance instance) [CLASS] class QueryIndexEndpointStrategy implements EndpointDetectionStrategy [METRICS] loc=25 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] Instance.getRegistration/0, Registration.getManageme...
/* static context [FOCAL] @Override public Mono<Endpoints> QueryIndexEndpointStrategy.detectEndpoints(Instance instance) [PATH1] if(managementUrl == null || Objects.equals(registration.getServiceUrl(), managementUrl))=T -> return Mono.empty() [PATH2] if(managementUrl == null || Objects.equals(registration.getServiceUrl...
/* static context [FOCAL] @Override public Mono<Endpoints> QueryIndexEndpointStrategy.detectEndpoints(Instance instance) [PATH1] if(managementUrl == null || Objects.equals(registration.getServiceUrl(), managementUrl))=T -> return Mono.empty() [PATH2] if(managementUrl == null || Objects.equals(registration.getServiceUrl...
true
ok
{"focal": {"class": "QueryIndexEndpointStrategy", "name": "detectEndpoints", "signature": "Mono<Endpoints> detectEndpoints(Instance instance)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "instance", "type": "Instance"}], "return_type": "Mono<Endpoints>"}, "class_info": {"name": "QueryIndexEnd...
180537027_5
class ReadOnlyAttributesEraser { public T eraseAllFormCustomExtensions(final T resource) { List<Extension> extensions = resource.getExtensions().values().stream().map(extension -> { if (extension instanceof EnterpriseExtension) { // https://github.com/SAP/scimono/issues/77 // EnterpriseExte...
MockitoAnnotations.initMocks(this); Attribute attribute = new Attribute.Builder().name(ATTRIBUTE1).type(COMPLEX.toString()).mutability("readWrite") .addSubAttribute(new Attribute.Builder().name(ATTRIBUTE1).type(STRING.toString()).mutability("readWrite").build()) .addSubAttribute(new Attribute.B...
[FOCAL] public T ReadOnlyAttributesEraser.eraseAllFormCustomExtensions(T resource) [CLASS] class ReadOnlyAttributesEraser [METRICS] loc=29 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] boolean removeReadOnlyAttributes(Attribute targetAttribute, Object value) [CALLS-EXTERNAL] resource.getExtensio...
/* static context [FOCAL] public T ReadOnlyAttributesEraser.eraseAllFormCustomExtensions(T resource) [INPUTS] branches=- | result=resource, schemaAPI [COLLABORATORS] param resource:T getExtensions/0,builder/0; field extension getAttributes/0,getUrn/0; field schemaAPI:SchemasCallback getSchema/1 [CALLS-INTERNAL] boolean...
/* static context [FOCAL] public T ReadOnlyAttributesEraser.eraseAllFormCustomExtensions(T resource) [INPUTS] branches=- | result=resource, schemaAPI [COLLABORATORS] param resource:T getExtensions/0,builder/0; field extension getAttributes/0,getUrn/0; field schemaAPI:SchemasCallback getSchema/1 [CALLS-INTERNAL] boolean...
true
ok
{"focal": {"class": "ReadOnlyAttributesEraser", "name": "eraseAllFormCustomExtensions", "signature": "T eraseAllFormCustomExtensions(T resource)", "start_line": 3, "modifiers": "public", "params": [{"name": "resource", "type": "T"}], "return_type": "T"}, "class_info": {"name": "ReadOnlyAttributesEraser", "kind": "class...
180588003_85
class RedirectConsentServiceImpl implements RedirectConsentService { @Override public ConsentWorkflow identifyConsent(String encryptedConsentId, String authorizationId, boolean strict, String consentCookieString, BearerTokenTO bearerToken) { // Parse and verify the consent cookie. ConsentRefere...
// Given when(referencePolicy.fromRequest(any(), any(), any(), anyBoolean())).thenReturn(getConsentReference()); when(cmsPsuAisClient.getConsentIdByRedirectId(any(), any())).thenReturn(ResponseEntity.ok(getCmsAisConsentResponse(AisConsentRequestType.DEDICATED_ACCOUNTS, IBAN_DE))); when(c...
[FOCAL] @Override public ConsentWorkflow RedirectConsentServiceImpl.identifyConsent(String encryptedConsentId, String authorizationId, boolean strict, String consentCookieString, BearerTokenTO bearerToken) [CLASS] class RedirectConsentServiceImpl implements RedirectConsentService [METRICS] loc=20 cc=2 branches=1 loops=...
/* static context [FOCAL] @Override public ConsentWorkflow RedirectConsentServiceImpl.identifyConsent(String encryptedConsentId, String authorizationId, boolean strict, String consentCookieString, BearerTokenTO bearerToken) [PATH1] if(bearerToken != null)=T -> return workflow [PATH2] if(bearerToken != null)=F -> return...
/* static context [FOCAL] @Override public ConsentWorkflow RedirectConsentServiceImpl.identifyConsent(String encryptedConsentId, String authorizationId, boolean strict, String consentCookieString, BearerTokenTO bearerToken) [PATH1] if(bearerToken != null)=T -> return workflow [PATH2] if(bearerToken != null)=F -> return...
true
ok
{"focal": {"class": "RedirectConsentServiceImpl", "name": "identifyConsent", "signature": "ConsentWorkflow identifyConsent(String encryptedConsentId, String authorizationId, boolean strict, String consentCookieString, BearerTokenTO bearerToken)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "en...
180757477_5
class BackgroundFunctionExecutor extends HttpServlet { static Optional<Type> backgroundFunctionTypeArgument( Class<? extends BackgroundFunction<?>> functionClass) { // If this is BackgroundFunction<Foo> then the user must have implemented a method // accept(Foo, Context), so we look for that method and...
assertThat(backgroundFunctionTypeArgument(PubSubFunction.class)).hasValue(PubSubMessage.class); } }
[FOCAL] static Optional<Type> BackgroundFunctionExecutor.backgroundFunctionTypeArgument(Class<? extends BackgroundFunction<?>> functionClass) [CLASS] class BackgroundFunctionExecutor extends HttpServlet [METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Arrays.stream(functionClass.ge...
/* static context [FOCAL] static Optional<Type> BackgroundFunctionExecutor.backgroundFunctionTypeArgument(Class<? extends BackgroundFunction<?>> functionClass) [INPUTS] branches=- | result=functionClass [COLLABORATORS] param functionClass:Class<? extends BackgroundFunction<?>> getMethods/0; field m getName/0,getParamet...
/* static context [FOCAL] static Optional<Type> BackgroundFunctionExecutor.backgroundFunctionTypeArgument(Class<? extends BackgroundFunction<?>> functionClass) [INPUTS] branches=- | result=functionClass [COLLABORATORS] param functionClass:Class<? extends BackgroundFunction<?>> getMethods/0; field m getName/0,getParamet...
true
ok
{"focal": {"class": "BackgroundFunctionExecutor", "name": "backgroundFunctionTypeArgument", "signature": "Optional<Type> backgroundFunctionTypeArgument(Class<? extends BackgroundFunction<?>> functionClass)", "start_line": 3, "modifiers": "static", "params": [{"name": "functionClass", "type": "Class<? extends Background...
180773046_12
class InstantDeserializer extends StdScalarDeserializer<Instant> { @Override public Instant deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { try { String text = p.readValueAs(String.class); return text == null ? null : converter.convert(text); } catch (Exception e) { ...
// given given(parser.readValueAs(String.class)).willReturn(null); // when var actual = deserializer.deserialize(parser, ctx); // then assertThat(actual).isNull(); verify(parser).readValueAs(String.class); verify(converter, never()).convert(any()); } }
[FOCAL] @Override public Instant InstantDeserializer.deserialize(JsonParser p, DeserializationContext ctxt) [CLASS] class InstantDeserializer extends StdScalarDeserializer<Instant> [METRICS] loc=9 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] JsonParser.readValueAs/1, Converter<String, Instant>....
/* static context [FOCAL] @Override public Instant InstantDeserializer.deserialize(JsonParser p, DeserializationContext ctxt) [THROWS-WHEN] JsonParseException when try-body throws [PATH1] try-body throws -> throw new JsonParseException(p, "Could not parse node as instant", e) [PATH2] return text == null ? null : conver...
/* static context [FOCAL] @Override public Instant InstantDeserializer.deserialize(JsonParser p, DeserializationContext ctxt) [THROWS-WHEN] JsonParseException when try-body throws [PATH1] try-body throws -> throw new JsonParseException(p, "Could not parse node as instant", e) [PATH2] return text == null ? null : conver...
true
ok
{"focal": {"class": "InstantDeserializer", "name": "deserialize", "signature": "Instant deserialize(JsonParser p, DeserializationContext ctxt) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "p", "type": "JsonParser"}, {"name": "ctxt", "type": "DeserializationContext"}], "retu...
180834808_1
class InjectorHandler { public InjectorService getInjectorService() { Map<String, InjectorService> beansOfType = context.getBeansOfType(InjectorService.class); if (beansOfType.entrySet().isEmpty()) { throw new NoSuchBeanDefinitionException("No InjectorType found"); } ret...
Connection properties = new Connection("localhost", 12345); doReturn(remoteInjector).when(connectionService).createRemoteInjector(any()); connectionService.createConnection(properties); InjectorService currentConnection = injectorHandler.getInjectorService(); Assert.assertNotNull...
[FOCAL] public InjectorService InjectorHandler.getInjectorService() [CLASS] class InjectorHandler [METRICS] loc=7 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] GenericApplicationContext.getBeansOfType/1, beansOfType.entrySet().isEmpty/0, Map<String, InjectorService>.entrySet/0, beansOfType.entry...
/* static context [FOCAL] public InjectorService InjectorHandler.getInjectorService() [THROWS-WHEN] NoSuchBeanDefinitionException when beansOfType.entrySet().isEmpty() [PATH1] if(beansOfType.entrySet().isEmpty())=T -> throw new NoSuchBeanDefinitionException("No InjectorType found") [PATH2] if(beansOfType.entrySet().isE...
/* static context [FOCAL] public InjectorService InjectorHandler.getInjectorService() [THROWS-WHEN] NoSuchBeanDefinitionException when beansOfType.entrySet().isEmpty() [PATH1] if(beansOfType.entrySet().isEmpty())=T -> throw new NoSuchBeanDefinitionException("No InjectorType found") [PATH2] if(beansOfType.entrySet().isE...
true
ok
{"focal": {"class": "InjectorHandler", "name": "getInjectorService", "signature": "InjectorService getInjectorService()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "InjectorService"}, "class_info": {"name": "InjectorHandler", "kind": "class", "modifiers": "", "superclass": null, "interfaces":...
180961537_0
class LoansourceApplication { @Bean public Supplier<Loan> supplyLoan(){ Supplier<Loan> loanSupplier = () -> { Loan loan = new Loan(UUID.randomUUID().toString(), names.get(new Random().nextInt(names.size())), amounts.get(new Random().nextInt(amounts.size()))); log.info("...
LoansourceApplication app = new LoansourceApplication(); Supplier<Loan> loan = app.supplyLoan(); assertNotNull(loan); assertNotNull(loan.get()); assertNotNull(loan.get().getAmount()); assertNotNull(loan.get().getName()); } }
[FOCAL] @Bean public Supplier<Loan> LoansourceApplication.supplyLoan() [CLASS] class LoansourceApplication [METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] UUID.randomUUID().toString/0, UUID.randomUUID/0, names.get/1, new Random().nextInt/1, names.size/0, amounts.get/1, amounts.siz...
/* static context [FOCAL] @Bean public Supplier<Loan> LoansourceApplication.supplyLoan() [COLLABORATORS] field names get/1,size/0; field amounts get/1,size/0 [NEW] Loan, Random [CALLS-EXTERNAL] UUID.randomUUID().toString/0, UUID.randomUUID/0, names.get/1, new Random().nextInt/1, names.size/0, amounts.get/1, amounts.siz...
/* static context [FOCAL] @Bean public Supplier<Loan> LoansourceApplication.supplyLoan() [COLLABORATORS] field names get/1,size/0; field amounts get/1,size/0 [NEW] Loan, Random [CALLS-EXTERNAL] UUID.randomUUID().toString/0, UUID.randomUUID/0, names.get/1, new Random().nextInt/1, names.size/0, amounts.get/1, amounts.siz...
true
ok
{"focal": {"class": "LoansourceApplication", "name": "supplyLoan", "signature": "Supplier<Loan> supplyLoan()", "start_line": 3, "modifiers": "@Bean public", "params": [], "return_type": "Supplier<Loan>"}, "class_info": {"name": "LoansourceApplication", "kind": "class", "modifiers": "", "superclass": null, "interfaces":...
181194375_2
class PluggableLoggerFactory extends AbstractSimpleLoggerFactory { public PluggableLoggerFactory addLogger(LoggerChannel logger, Level level) { mSortedLoggers.add(new SortedLogger(logger, level.toInt())); Collections.sort(mSortedLoggers, mSortedLoggersComparator); return this; } @O...
// Fixture LoggerChannel loggerTrace = mock(LoggerChannel.class); LoggerChannel loggerInfo = mock(LoggerChannel.class); LoggerChannel loggerError = mock(LoggerChannel.class); PluggableLoggerFactory factory = new PluggableLoggerFactory(); factory.addLogger(loggerInfo, Leve...
[FOCAL] public PluggableLoggerFactory PluggableLoggerFactory.addLogger(LoggerChannel logger, Level level) [CLASS] class PluggableLoggerFactory extends AbstractSimpleLoggerFactory [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] mSortedLoggers.add/1, Level.toInt/0, Collections.sort/2...
/* static context [FOCAL] public PluggableLoggerFactory PluggableLoggerFactory.addLogger(LoggerChannel logger, Level level) [COLLABORATORS] field mSortedLoggers add/1; param level:Level toInt/0 [NEW] SortedLogger [CALLS-EXTERNAL] mSortedLoggers.add/1, Level.toInt/0, Collections.sort/2 */
/* static context [FOCAL] public PluggableLoggerFactory PluggableLoggerFactory.addLogger(LoggerChannel logger, Level level) [COLLABORATORS] field mSortedLoggers add/1; param level:Level toInt/0 [NEW] SortedLogger [CALLS-EXTERNAL] mSortedLoggers.add/1, Level.toInt/0, Collections.sort/2 */ class PluggableLoggerFactory ex...
true
ok
{"focal": {"class": "PluggableLoggerFactory", "name": "addLogger", "signature": "PluggableLoggerFactory addLogger(LoggerChannel logger, Level level)", "start_line": 3, "modifiers": "public", "params": [{"name": "logger", "type": "LoggerChannel"}, {"name": "level", "type": "Level"}], "return_type": "PluggableLoggerFacto...
181286172_8
class RomanConverter { static int convertRomanToArabicNumber(String roman) { roman = roman.toUpperCase(); int sum = 0; int current = 0; int previous = 0; for (int index = roman.length() - 1; index >= 0; index--) { if (doesSymbolsContainsRomanCharacter(roman, i...
assertEquals(36, convertRomanToArabicNumber("XXXVI"), "Roman XXXVI should equal to 36"); } }
[FOCAL] static int RomanConverter.convertRomanToArabicNumber(String roman) [CLASS] class RomanConverter [METRICS] loc=28 cc=4 branches=2 loops=1 returns=1 throws=1 nesting=3 [CALLS-INTERNAL] Integer getSymbolValue(String roman, int index); boolean doesSymbolsContainsRomanCharacter(String roman, int index); char getChar...
/* static context [FOCAL] static int RomanConverter.convertRomanToArabicNumber(String roman) [THROWS-WHEN] IllegalArgumentException when index >= 0 && !doesSymbolsContainsRomanCharacter(roman, index) [PATH1] for(index >= 0)=T -> if(doesSymbolsContainsRomanCharacter(roman, index))=T -> if(current < previous)=T -> exit l...
/* static context [FOCAL] static int RomanConverter.convertRomanToArabicNumber(String roman) [THROWS-WHEN] IllegalArgumentException when index >= 0 && !doesSymbolsContainsRomanCharacter(roman, index) [PATH1] for(index >= 0)=T -> if(doesSymbolsContainsRomanCharacter(roman, index))=T -> if(current < previous)=T -> exit l...
true
ok
{"focal": {"class": "RomanConverter", "name": "convertRomanToArabicNumber", "signature": "int convertRomanToArabicNumber(String roman)", "start_line": 3, "modifiers": "static", "params": [{"name": "roman", "type": "String"}], "return_type": "int"}, "class_info": {"name": "RomanConverter", "kind": "class", "modifiers": ...
181400274_0
class RocketMQAutoConfiguration { @Bean @ConditionalOnMissingBean(DefaultMQProducer.class) @ConditionalOnProperty(prefix = "spring.rocketmq", value = {"name-server", "producer.group"}) public DefaultMQProducer defaultMQProducer(RocketMQProperties rocketMQProperties) { RocketMQProperties.Produce...
runner.withPropertyValues("spring.rocketmq.name-server=127.0.0.1:9876", "spring.rocketmq.producer.group=spring_rocketmq"). run((context) -> { assertThat(context).hasSingleBean(DefaultMQProducer.class); }); } }
[FOCAL] @Bean @ConditionalOnMissingBean(DefaultMQProducer.class) @ConditionalOnProperty(prefix = "spring.rocketmq", value = {... DefaultMQProducer RocketMQAutoConfiguration.defaultMQProducer(RocketMQProperties rocketMQProperties) [CLASS] class RocketMQAutoConfiguration [METRICS] loc=33 cc=2 branches=1 loops=0 returns=1...
/* static context [FOCAL] @Bean @ConditionalOnMissingBean(DefaultMQProducer.class) @ConditionalOnProperty(prefix = "spring.rocketmq", value = {... DefaultMQProducer RocketMQAutoConfiguration.defaultMQProducer(RocketMQProperties rocketMQProperties) [PATH1] if(!StringUtils.isEmpty(ak) && !StringUtils.isEmpty(sk))=T -> re...
/* static context [FOCAL] @Bean @ConditionalOnMissingBean(DefaultMQProducer.class) @ConditionalOnProperty(prefix = "spring.rocketmq", value = {... DefaultMQProducer RocketMQAutoConfiguration.defaultMQProducer(RocketMQProperties rocketMQProperties) [PATH1] if(!StringUtils.isEmpty(ak) && !StringUtils.isEmpty(sk))=T -> re...
true
ok
{"focal": {"class": "RocketMQAutoConfiguration", "name": "defaultMQProducer", "signature": "DefaultMQProducer defaultMQProducer(RocketMQProperties rocketMQProperties)", "start_line": 3, "modifiers": "@Bean @ConditionalOnMissingBean(DefaultMQProducer.class) @ConditionalOnProperty(prefix = \"spring.rocketmq\", value = {....
181445409_46
class SslCustomizer implements HttpServerOptionsCustomizer { @Override public HttpServerOptions apply(HttpServerOptions options) { Ssl ssl = factory.getSsl(); if (ssl == null) { return options; } options.setSsl(ssl.isEnabled()); options.setKeyCertOptions(ke...
given(mockSsl.isEnabled()).willReturn(true); customizer.apply(mockHttpServerOptions); verify(mockHttpServerOptions).setSsl(true); } }
[FOCAL] @Override public HttpServerOptions SslCustomizer.apply(HttpServerOptions options) [CLASS] class SslCustomizer implements HttpServerOptionsCustomizer [METRICS] loc=30 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] KeyCertOptions keyCertOptionsAdapter(Ssl ssl); TrustOptions trustOptionsAdap...
/* static context [FOCAL] @Override public HttpServerOptions SslCustomizer.apply(HttpServerOptions options) [PATH1] if(ssl == null)=T -> return options [PATH2] if(ssl == null)=F -> return options [INPUTS] branches=- | result=options [COLLABORATORS] field factory getSsl/0; param options:HttpServerOptions setSsl/1,setKey...
/* static context [FOCAL] @Override public HttpServerOptions SslCustomizer.apply(HttpServerOptions options) [PATH1] if(ssl == null)=T -> return options [PATH2] if(ssl == null)=F -> return options [INPUTS] branches=- | result=options [COLLABORATORS] field factory getSsl/0; param options:HttpServerOptions setSsl/1,setKey...
true
ok
{"focal": {"class": "SslCustomizer", "name": "apply", "signature": "HttpServerOptions apply(HttpServerOptions options)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "options", "type": "HttpServerOptions"}], "return_type": "HttpServerOptions"}, "class_info": {"name": "SslCustomizer", "kind": "c...
181519091_56
class BlottingPaperRestController extends BaseValidatingRestController<BlottingPaper, BlottingPaperService> { @NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) public BlottingPaper createItem(@NonNull @Valid @RequestBody BlottingPaper input) { return this.service.createItem(input); ...
final BlottingPaper blottingPaper = BlottingPaper.builder() .label("label 3") .manufacturer("A manufacturer") .model("The new model") .build(); final String json = new ObjectMapper().writeValueAsString(blottingPaper); getMockMvc()....
[FOCAL] @NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) public BlottingPaper BlottingPaperRestController.createItem(BlottingPaper input) [CLASS] class BlottingPaperRestController extends BaseValidatingRestController<BlottingPaper, BlottingPaperService> [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=...
/* static context [FOCAL] @NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) public BlottingPaper BlottingPaperRestController.createItem(BlottingPaper input) [INPUTS] branches=- | result=input, service [COLLABORATORS] field service:BlottingPaperService createItem/1 [FIELDS] read=service:BlottingPaperService [CAL...
/* static context [FOCAL] @NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) public BlottingPaper BlottingPaperRestController.createItem(BlottingPaper input) [INPUTS] branches=- | result=input, service [COLLABORATORS] field service:BlottingPaperService createItem/1 [FIELDS] read=service:BlottingPaperService [CAL...
true
ok
{"focal": {"class": "BlottingPaperRestController", "name": "createItem", "signature": "BlottingPaper createItem(BlottingPaper input)", "start_line": 3, "modifiers": "@NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) public", "params": [{"name": "input", "type": "BlottingPaper"}], "return_type": "BlottingPaper"}...
181683494_110
class ProcessorEventPublisher { public void splitSegment(String context, List<String> clientIds, String processorName) { Map<ClientSegmentPair, SegmentStatus> clientToTracker = buildClientToTrackerMap(clientIds, processorName, REGULAR_ORDER); Integer biggestSegment = clientToTracke...
testSubject.splitSegment(CONTEXT, CLIENTS, PROCESSOR_NAME_TO_SPLIT); ArgumentCaptor<SplitSegmentRequest> argumentCaptor = ArgumentCaptor.forClass(SplitSegmentRequest.class); verify(applicationEventPublisher).publishEvent(argumentCaptor.capture()); SplitSegmentRequest result = argumentCa...
[FOCAL] public void ProcessorEventPublisher.splitSegment(String context, List<String> clientIds, String processorName) [CLASS] class ProcessorEventPublisher [METRICS] loc=20 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] Map<ClientSegmentPair, SegmentStatus> buildClientToTrackerMap(List<String> c...
/* static context [FOCAL] public void ProcessorEventPublisher.splitSegment(String context, List<String> clientIds, String processorName) [COLLABORATORS] field applicationEventPublisher:ApplicationEventPublisher publishEvent/1 [CALLS-INTERNAL] Map<ClientSegmentPair, SegmentStatus> buildClientToTrackerMap(List<String> cl...
/* static context [FOCAL] public void ProcessorEventPublisher.splitSegment(String context, List<String> clientIds, String processorName) [COLLABORATORS] field applicationEventPublisher:ApplicationEventPublisher publishEvent/1 [CALLS-INTERNAL] Map<ClientSegmentPair, SegmentStatus> buildClientToTrackerMap(List<String> cl...
true
ok
{"focal": {"class": "ProcessorEventPublisher", "name": "splitSegment", "signature": "void splitSegment(String context, List<String> clientIds, String processorName)", "start_line": 3, "modifiers": "public", "params": [{"name": "context", "type": "String"}, {"name": "clientIds", "type": "List<String>"}, {"name": "proces...
181777958_2
class VectorText { public static int[] count(Map<String, Integer> dictionary, String s) { int[] result = new int[dictionary.size()]; VectorText.tokenize(s).forEach(w -> { if (dictionary.containsKey(w)) { result[dictionary.get(w)]++; } }); retu...
// build a dictionary of all words we see in a subset of the text Map<String, Integer> dict = VectorText.tokenize(sample.split("\\.")[0]).collect( TreeMap::new, (Map<String, Integer> d, String s) -> d.put(s, d.size()), Map::putAll ); dict.r...
[FOCAL] public static int[] VectorText.count(Map<String, Integer> dictionary, String s) [CLASS] class VectorText [METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] Map<String, Integer>.size/0, VectorText.tokenize(s).forEach/1, VectorText.tokenize/1, Map<String, Integer>.containsKey/1,...
/* static context [FOCAL] public static int[] VectorText.count(Map<String, Integer> dictionary, String s) [INPUTS] branches=- | result=dictionary [COLLABORATORS] param dictionary:Map<String, Integer> size/0,containsKey/1,get/1 [CALLS-EXTERNAL] Map<String, Integer>.size/0, VectorText.tokenize(s).forEach/1, VectorText.to...
/* static context [FOCAL] public static int[] VectorText.count(Map<String, Integer> dictionary, String s) [INPUTS] branches=- | result=dictionary [COLLABORATORS] param dictionary:Map<String, Integer> size/0,containsKey/1,get/1 [CALLS-EXTERNAL] Map<String, Integer>.size/0, VectorText.tokenize(s).forEach/1, VectorText.to...
true
ok
{"focal": {"class": "VectorText", "name": "count", "signature": "int[] count(Map<String, Integer> dictionary, String s)", "start_line": 3, "modifiers": "public static", "params": [{"name": "dictionary", "type": "Map<String, Integer>"}, {"name": "s", "type": "String"}], "return_type": "int[]"}, "class_info": {"name": "V...
181845258_121
class TransactionalMessageBridge { public PullResult getOpMessage(int queueId, long offset, int nums) { String group = TransactionalMessageUtil.buildConsumerGroup(); String topic = TransactionalMessageUtil.buildOpTopic(); SubscriptionData sub = new SubscriptionData(topic, "*"); retu...
when(messageStore.getMessage(anyString(), anyString(), anyInt(), anyLong(), anyInt(), ArgumentMatchers.nullable(MessageFilter.class))).thenReturn(createGetMessageResult(GetMessageStatus.NO_MESSAGE_IN_QUEUE)); PullResult result = transactionBridge.getOpMessage(0, 0, 1); assertThat(result.getPull...
[FOCAL] public PullResult TransactionalMessageBridge.getOpMessage(int queueId, long offset, int nums) [CLASS] class TransactionalMessageBridge [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] PullResult getMessage(String group, String topic, int queueId, long offset, int nums, Subsc...
/* static context [FOCAL] public PullResult TransactionalMessageBridge.getOpMessage(int queueId, long offset, int nums) [INPUTS] branches=- | result=nums, offset, queueId [CALLS-INTERNAL] PullResult getMessage(String group, String topic, int queueId, long offset, int nums, SubscriptionData sub) [NEW] SubscriptionData [...
/* static context [FOCAL] public PullResult TransactionalMessageBridge.getOpMessage(int queueId, long offset, int nums) [INPUTS] branches=- | result=nums, offset, queueId [CALLS-INTERNAL] PullResult getMessage(String group, String topic, int queueId, long offset, int nums, SubscriptionData sub) [NEW] SubscriptionData [...
true
ok
{"focal": {"class": "TransactionalMessageBridge", "name": "getOpMessage", "signature": "PullResult getOpMessage(int queueId, long offset, int nums)", "start_line": 3, "modifiers": "public", "params": [{"name": "queueId", "type": "int"}, {"name": "offset", "type": "long"}, {"name": "nums", "type": "int"}], "return_type"...
181888758_2
class CanvasCommandLineRunner { public void run(String... args) throws Exception { CommandLine cmd = parseCommandLine(args); String inputFile = cmd.getOptionValue("input"); String outputFile = cmd.getOptionValue("output"); String yml = FileUtils.readFileToString(new File(inputFile), (String)null)...
CanvasCommandLineRunner runner = new CanvasCommandLineRunner(); File tmpFile = File.createTempFile("example", ".adoc"); String resource = getClass().getResource("/example.yml").toExternalForm(); assertTrue(resource.startsWith("file:")); String[] args = new String[]{"--input", resource.substring("fil...
[FOCAL] public void CanvasCommandLineRunner.run(String... args) [CLASS] class CanvasCommandLineRunner [METRICS] loc=13 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] CommandLine parseCommandLine(String[] args) [CALLS-EXTERNAL] CommandLine.getOptionValue/1, FileUtils.readFileToString/2, fromYaml/2...
/* static context [FOCAL] public void CanvasCommandLineRunner.run(String... args) [EXCEPTIONS] declares Exception [CALLS-INTERNAL] CommandLine parseCommandLine(String[] args) [NEW] File [CALLS-EXTERNAL] CommandLine.getOptionValue/1, FileUtils.readFileToString/2, fromYaml/2 (inherited), ServiceToJSon.toAsciidoc/1, FileU...
/* static context [FOCAL] public void CanvasCommandLineRunner.run(String... args) [EXCEPTIONS] declares Exception [CALLS-INTERNAL] CommandLine parseCommandLine(String[] args) [NEW] File [CALLS-EXTERNAL] CommandLine.getOptionValue/1, FileUtils.readFileToString/2, fromYaml/2 (inherited), ServiceToJSon.toAsciidoc/1, FileU...
true
ok
{"focal": {"class": "CanvasCommandLineRunner", "name": "run", "signature": "void run(String... args) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "args", "type": "String..."}], "return_type": "void"}, "class_info": {"name": "CanvasCommandLineRunner", "kind": "class", "modifiers": "", "...
181997557_0
class ReserveBuffer { public byte[] update(byte[] input, int offset, int inputLength) { int reserveToApply = Math.min(reserve.length, inputLength); int reserveToRelease = Math.max(reserveToApply - capacity(), 0); byte[] output = new byte[reserveToRelease + (inputLength - reserveToApply)...
ReserveBuffer buffer = new ReserveBuffer(16); byte[] input = new byte[1]; for (int i=0;i<16;i++) { input[0] = (byte)i; byte[] result = buffer.update(input, 0, 1); assertEquals(0, result.length); } byte[] largeInput = new byte[16]; Arrays.fill(largeInput, (byte)16); byte[...
[FOCAL] public byte[] ReserveBuffer.update(byte[] input, int offset, int inputLength) [CLASS] class ReserveBuffer [METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] int capacity(); void read(byte[] buffer, int offset, int length); void write(byte[] buffer, int offset, int length) [CA...
/* static context [FOCAL] public byte[] ReserveBuffer.update(byte[] input, int offset, int inputLength) [INPUTS] branches=- | result=inputLength [CALLS-INTERNAL] int capacity(); void read(byte[] buffer, int offset, int length); void write(byte[] buffer, int offset, int length) [CALLS-EXTERNAL] Math.min/2, Math.max/2, S...
/* static context [FOCAL] public byte[] ReserveBuffer.update(byte[] input, int offset, int inputLength) [INPUTS] branches=- | result=inputLength [CALLS-INTERNAL] int capacity(); void read(byte[] buffer, int offset, int length); void write(byte[] buffer, int offset, int length) [CALLS-EXTERNAL] Math.min/2, Math.max/2, S...
true
ok
{"focal": {"class": "ReserveBuffer", "name": "update", "signature": "byte[] update(byte[] input, int offset, int inputLength)", "start_line": 3, "modifiers": "public", "params": [{"name": "input", "type": "byte[]"}, {"name": "offset", "type": "int"}, {"name": "inputLength", "type": "int"}], "return_type": "byte[]"}, "c...
182006329_182
class FabricTopicAdmin implements IEventTopic { @Override public boolean open(String topic, String channelName) throws BrokerException { log.info("open topic: {} channelName: {}", topic, channelName); ParamCheckUtils.validateTopicName(topic); validateChannelName(channelName); t...
try { String topicStr = "topiclengthlonger64asdfghjklpoiuytrewqazxswcdevfrbg-" + System.currentTimeMillis(); this.iProducer.open(topicStr, this.channelName); Assert.fail(); } catch (BrokerException e) { Assert.assertEquals(ErrorCode.TOPIC_EXCEED_MAX_LENGTH...
[FOCAL] @Override public boolean FabricTopicAdmin.open(String topic, String channelName) [CLASS] class FabricTopicAdmin implements IEventTopic [METRICS] loc=15 cc=3 branches=1 loops=0 returns=2 throws=1 nesting=2 [CALLS-INTERNAL] void validateChannelName(String channelName) [CALLS-EXTERNAL] log.info/3, ParamCheckUtils....
/* static context [FOCAL] @Override public boolean FabricTopicAdmin.open(String topic, String channelName) [THROWS-WHEN] e when try-body throws && !(e.getCode() == ErrorCode.TOPIC_ALREADY_EXIST.getCode()) [PATH1] try-body throws -> if(e.getCode() == ErrorCode.TOPIC_ALREADY_EXIST.getCode())=T -> return true [PATH2] try-...
/* static context [FOCAL] @Override public boolean FabricTopicAdmin.open(String topic, String channelName) [THROWS-WHEN] e when try-body throws && !(e.getCode() == ErrorCode.TOPIC_ALREADY_EXIST.getCode()) [PATH1] try-body throws -> if(e.getCode() == ErrorCode.TOPIC_ALREADY_EXIST.getCode())=T -> return true [PATH2] try-...
true
ok
{"focal": {"class": "FabricTopicAdmin", "name": "open", "signature": "boolean open(String topic, String channelName) throws BrokerException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "topic", "type": "String"}, {"name": "channelName", "type": "String"}], "return_type": "boolean"}, "class_in...
182082980_6
class SshUriPropertyProcessor { public Map<String, SshUri> getSshKeysByHostname() { return extractNestedProperties(sshUriProperties); } public SshUriPropertyProcessor(SshUriProperties sshUriProperties); private Map<String, SshUri> extractNestedProperties(SshUriProperties uriProperties); protected static Stri...
SshUriPropertyProcessor sshUriPropertyProcessor = new SshUriPropertyProcessor(SshUri.builder().uri("https://user@github.com/proj/repo.git").build()); Map<String, SshUri> sshKeysByHostname = sshUriPropertyProcessor.getSshKeysByHostname(); assertThat(sshKeysByHostname.values(), hasSize(0)); } }
[FOCAL] public Map<String, SshUri> SshUriPropertyProcessor.getSshKeysByHostname() [CLASS] class SshUriPropertyProcessor [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Map<String, SshUri> extractNestedProperties(SshUriProperties uriProperties) [CLASS-MEMBERS] SshUriPropertyProcesso...
/* static context [FOCAL] public Map<String, SshUri> SshUriPropertyProcessor.getSshKeysByHostname() [CALLS-INTERNAL] Map<String, SshUri> extractNestedProperties(SshUriProperties uriProperties) */
/* static context [FOCAL] public Map<String, SshUri> SshUriPropertyProcessor.getSshKeysByHostname() [CALLS-INTERNAL] Map<String, SshUri> extractNestedProperties(SshUriProperties uriProperties) */ class SshUriPropertyProcessor { public Map<String, SshUri> getSshKeysByHostname() { return extractNestedProperties(sshUr...
true
ok
{"focal": {"class": "SshUriPropertyProcessor", "name": "getSshKeysByHostname", "signature": "Map<String, SshUri> getSshKeysByHostname()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Map<String, SshUri>"}, "class_info": {"name": "SshUriPropertyProcessor", "kind": "class", "modifiers": "", "supe...
182200911_1
class UniqueToken { public static String create() { return Base64Utils.encodeToUrlSafeString(UUID.randomUUID().toString().getBytes()); } private UniqueToken(); } class UniqueTokenTest { @Test void create() {
Set<Object> set = new HashSet<>(); for (int i = 0; i < 10E6; i++) { String token = UniqueToken.create(); assertNotNull(token); assertFalse(set.contains(token)); set.add(token); } } }
[FOCAL] public static String UniqueToken.create() [CLASS] class UniqueToken [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Base64Utils.encodeToUrlSafeString/1, UUID.randomUUID().toString().getBytes/0, UUID.randomUUID().toString/0, UUID.randomUUID/0 [CLASS-MEMBERS] UniqueToken() [T...
/* static context [FOCAL] public static String UniqueToken.create() [CALLS-EXTERNAL] Base64Utils.encodeToUrlSafeString/1, UUID.randomUUID().toString().getBytes/0, UUID.randomUUID().toString/0, UUID.randomUUID/0 */
/* static context [FOCAL] public static String UniqueToken.create() [CALLS-EXTERNAL] Base64Utils.encodeToUrlSafeString/1, UUID.randomUUID().toString().getBytes/0, UUID.randomUUID().toString/0, UUID.randomUUID/0 */ class UniqueToken { public static String create() { return Base64Utils.encodeToUrlSafeString(...
true
ok
{"focal": {"class": "UniqueToken", "name": "create", "signature": "String create()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "String"}, "class_info": {"name": "UniqueToken", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "...
182454442_4
class ResourcePreparer { public GenericScimResource trimRetrievedResource(final T returnedResource) { return trimReturned(returnedResource, null, null); } public ResourcePreparer(final ResourceTypeDefinition resourceType, final String attributesString, ...
ResourcePreparer<ScimResource> preparer = new ResourcePreparer<>(resourceTypeDefinition, "default", null, testBaseUri); ObjectNode node = (ObjectNode) JsonUtils.getObjectReader() .readTree("{\n" + " \"default\": {\n" + " \"never\": \"here\"\n" + " }\...
[FOCAL] public GenericScimResource ResourcePreparer.trimRetrievedResource(T returnedResource) [CLASS] class ResourcePreparer [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] GenericScimResource trimReturned(T returnedResource, T requestResource, Iterable<PatchOperation> patchOperati...
/* static context [FOCAL] public GenericScimResource ResourcePreparer.trimRetrievedResource(T returnedResource) [INPUTS] branches=- | result=returnedResource [CALLS-INTERNAL] GenericScimResource trimReturned(T returnedResource, T requestResource, Iterable<PatchOperation> patchOperations) */
/* static context [FOCAL] public GenericScimResource ResourcePreparer.trimRetrievedResource(T returnedResource) [INPUTS] branches=- | result=returnedResource [CALLS-INTERNAL] GenericScimResource trimReturned(T returnedResource, T requestResource, Iterable<PatchOperation> patchOperations) */ class ResourcePreparer { ...
true
ok
{"focal": {"class": "ResourcePreparer", "name": "trimRetrievedResource", "signature": "GenericScimResource trimRetrievedResource(T returnedResource)", "start_line": 3, "modifiers": "public", "params": [{"name": "returnedResource", "type": "T"}], "return_type": "GenericScimResource"}, "class_info": {"name": "ResourcePre...
182813463_18
class TfVarFilesOptionFormatter implements TfOptionFormatter { public String convert(String format, Object value) { String str = ""; if (value instanceof String) { str = csvConverter("-var-file=%s ", (String) value); } return str; } TfOptionFormatter formatter; } class TfVarFilesOptionF...
String format = "-var-file"; String value = "test1.txt "; Assert.assertEquals(formatter.convert(format, value), "-var-file=test1.txt "); } }
[FOCAL] public String TfVarFilesOptionFormatter.convert(String format, Object value) [CLASS] class TfVarFilesOptionFormatter implements TfOptionFormatter [METRICS] loc=7 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] csvConverter/2 (inherited) [PATH1] if(value instanceof String)=T -> return str [...
/* static context [FOCAL] public String TfVarFilesOptionFormatter.convert(String format, Object value) [PATH1] if(value instanceof String)=T -> return str [PATH2] if(value instanceof String)=F -> return str [INPUTS] branches=value | result=value | unused=format [CALLS-EXTERNAL] csvConverter/2 (inherited) */
/* static context [FOCAL] public String TfVarFilesOptionFormatter.convert(String format, Object value) [PATH1] if(value instanceof String)=T -> return str [PATH2] if(value instanceof String)=F -> return str [INPUTS] branches=value | result=value | unused=format [CALLS-EXTERNAL] csvConverter/2 (inherited) */ class TfVar...
true
ok
{"focal": {"class": "TfVarFilesOptionFormatter", "name": "convert", "signature": "String convert(String format, Object value)", "start_line": 3, "modifiers": "public", "params": [{"name": "format", "type": "String"}, {"name": "value", "type": "Object"}], "return_type": "String"}, "class_info": {"name": "TfVarFilesOptio...
182842409_47
class SpannerConnectionConfiguration { public String getFullyQualifiedDatabaseName() { return this.fullyQualifiedDbName; } private SpannerConnectionConfiguration(String url, GoogleCredentials credentials); private SpannerConnectionConfiguration( String projectId, String instanceName, S...
SpannerConnectionConfiguration config = this.configurationBuilder .setProjectId("project1") .setInstanceName("an-instance") .setDatabaseName("db") .build(); assertThat(config.getFullyQualifiedDatabaseName()) .isEqualTo("projects/project1/instances/an-instance/databases/db...
[FOCAL] public String SpannerConnectionConfiguration.getFullyQualifiedDatabaseName() [CLASS] class SpannerConnectionConfiguration [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [FIELDS] read=fullyQualifiedDbName [CLASS-MEMBERS] SpannerConnectionConfiguration(String url, GoogleCredentials credentia...
/* static context [FOCAL] public String SpannerConnectionConfiguration.getFullyQualifiedDatabaseName() [FIELDS] read=fullyQualifiedDbName */
/* static context [FOCAL] public String SpannerConnectionConfiguration.getFullyQualifiedDatabaseName() [FIELDS] read=fullyQualifiedDbName */ class SpannerConnectionConfiguration { public String getFullyQualifiedDatabaseName() { return this.fullyQualifiedDbName; } private SpannerConnectionConfiguration(Stri...
true
ok
{"focal": {"class": "SpannerConnectionConfiguration", "name": "getFullyQualifiedDatabaseName", "signature": "String getFullyQualifiedDatabaseName()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "SpannerConnectionConfiguration", "kind": "class", "modifiers": "",...
183382045_2
class HelloProxyServiceImpl implements HelloProxyService { @Override public ServiceCall<NotUsed, String> proxyViaHttp(String id) { return req -> helloService.hello(id).invoke(); } @Inject public HelloProxyServiceImpl( HelloService helloService, GreeterServiceClient greeterClie...
String msg = proxyServiceClient.proxyViaHttp("Alice").invoke() .toCompletableFuture().get(5, SECONDS); assertEquals("Hello Alice", msg); } }
[FOCAL] @Override public ServiceCall<NotUsed, String> HelloProxyServiceImpl.proxyViaHttp(String id) [CLASS] class HelloProxyServiceImpl implements HelloProxyService [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] helloService.hello(id).invoke/0, helloService.hello/1 [INPUTS] branch...
/* static context [FOCAL] @Override public ServiceCall<NotUsed, String> HelloProxyServiceImpl.proxyViaHttp(String id) [INPUTS] branches=- | result=id [COLLABORATORS] field helloService hello/1 [CALLS-EXTERNAL] helloService.hello(id).invoke/0, helloService.hello/1 */
/* static context [FOCAL] @Override public ServiceCall<NotUsed, String> HelloProxyServiceImpl.proxyViaHttp(String id) [INPUTS] branches=- | result=id [COLLABORATORS] field helloService hello/1 [CALLS-EXTERNAL] helloService.hello(id).invoke/0, helloService.hello/1 */ class HelloProxyServiceImpl implements HelloProxyServ...
true
ok
{"focal": {"class": "HelloProxyServiceImpl", "name": "proxyViaHttp", "signature": "ServiceCall<NotUsed, String> proxyViaHttp(String id)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "id", "type": "String"}], "return_type": "ServiceCall<NotUsed, String>"}, "class_info": {"name": "HelloProxyServ...
183462598_0
class CustomCodeGenerator implements CodeGenerator, InitializingBean { @Override public String generateCode(String phone) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < maxLength; i++) { int index = random.nextInt(arr.size()); sb.append(arr.get(index)); ...
CustomCodeGenerator generator = new CustomCodeGenerator(CustomCodeGenerator.Mode.NUMBER); String code = generator.generateCode("xxx"); Assert.assertEquals(6, code.length()); String code2 = generator.generateCode("xxx"); Assert.assertNotEquals(code, code2); } }
[FOCAL] @Override public String CustomCodeGenerator.generateCode(String phone) [CLASS] class CustomCodeGenerator implements CodeGenerator, InitializingBean [METRICS] loc=14 cc=4 branches=2 loops=1 returns=1 throws=0 nesting=3 [CALLS-EXTERNAL] random.nextInt/1, arr.size/0, StringBuilder.append/1, arr.get/1, StringBuilde...
/* static context [FOCAL] @Override public String CustomCodeGenerator.generateCode(String phone) [PATH1] for(i < maxLength)=T -> if(sb.length() >= minLength)=T -> if(random.nextBoolean())=F -> exit loop -> return sb.toString() [PATH2] for(i < maxLength)=F -> return sb.toString() [PATH3] for(i < maxLength)=T -> if(sb.le...
/* static context [FOCAL] @Override public String CustomCodeGenerator.generateCode(String phone) [PATH1] for(i < maxLength)=T -> if(sb.length() >= minLength)=T -> if(random.nextBoolean())=F -> exit loop -> return sb.toString() [PATH2] for(i < maxLength)=F -> return sb.toString() [PATH3] for(i < maxLength)=T -> if(sb.le...
true
ok
{"focal": {"class": "CustomCodeGenerator", "name": "generateCode", "signature": "String generateCode(String phone)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "phone", "type": "String"}], "return_type": "String"}, "class_info": {"name": "CustomCodeGenerator", "kind": "class", "modifiers": ""...
183523285_12
class QueryRegistry { public boolean deregisterQuery(String targetApp, String subId, String query) { appToSubscriptionMap.computeIfPresent(targetApp, (k, v) -> { v.deregisterQuery(subId, query); return v; }); return true; } private QueryRegistry(String cli...
try { QueryRegistry queryRegistry = new QueryRegistry.Builder().build(); fail(); } catch (IllegalArgumentException ignored) { } QueryRegistry queryRegistry = new QueryRegistry.Builder().withClientIdPrefix("myPrefix").build(); String targetApp = "myapp"; ...
[FOCAL] public boolean QueryRegistry.deregisterQuery(String targetApp, String subId, String query) [CLASS] class QueryRegistry [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] appToSubscriptionMap.computeIfPresent/2, v.deregisterQuery/2 [COLLABORATORS] field appToSubscriptionMap com...
/* static context [FOCAL] public boolean QueryRegistry.deregisterQuery(String targetApp, String subId, String query) [COLLABORATORS] field appToSubscriptionMap computeIfPresent/2; field v deregisterQuery/2 [CALLS-EXTERNAL] appToSubscriptionMap.computeIfPresent/2, v.deregisterQuery/2 */
/* static context [FOCAL] public boolean QueryRegistry.deregisterQuery(String targetApp, String subId, String query) [COLLABORATORS] field appToSubscriptionMap computeIfPresent/2; field v deregisterQuery/2 [CALLS-EXTERNAL] appToSubscriptionMap.computeIfPresent/2, v.deregisterQuery/2 */ class QueryRegistry { public...
true
ok
{"focal": {"class": "QueryRegistry", "name": "deregisterQuery", "signature": "boolean deregisterQuery(String targetApp, String subId, String query)", "start_line": 3, "modifiers": "public", "params": [{"name": "targetApp", "type": "String"}, {"name": "subId", "type": "String"}, {"name": "query", "type": "String"}], "re...
183536958_1
class Presentation implements ConvertJwt { @Override public Jwt buildJwt(Date issued, Date expiration) { String kid = issuerDid.getDid() + "#" + issuerDid.getKeyId(); return new Jwt.Builder() .alg(issuerDid.getAlgorithm()) .kid(kid) .iss(issuerDid...
String keyId = TestKeys.HOLDER_KEY_ID; AlgorithmProvider.Type type = AlgorithmProvider.Type.ES256; Algorithm algorithm = AlgorithmProvider.create(type); PrivateKey priKey = algorithm.byteToPrivateKey(EncodeType.HEX.decode(TestKeys.PRIVATE_KEY_ES256)); String rawCredential = "ey...
[FOCAL] @Override public Jwt Presentation.buildJwt(Date issued, Date expiration) [CLASS] class Presentation implements ConvertJwt [METRICS] loc=16 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] List<String> getTypes() [CALLS-EXTERNAL] issuerDid.getDid/0, issuerDid.getKeyId/0, new Jwt.Builder() .a...
class Presentation implements ConvertJwt { @Override public Jwt buildJwt(Date issued, Date expiration) { String kid = issuerDid.getDid() + "#" + issuerDid.getKeyId(); return new Jwt.Builder() .alg(issuerDid.getAlgorithm()) .kid(kid) .iss(issuerDid...
false
ok
{"focal": {"class": "Presentation", "name": "buildJwt", "signature": "Jwt buildJwt(Date issued, Date expiration)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "issued", "type": "Date"}, {"name": "expiration", "type": "Date"}], "return_type": "Jwt"}, "class_info": {"name": "Presentation", "kind...
183646665_3
class Step implements DeepComparable, Serializable { @Override public boolean deepEquals(Object o) { if (this == o) { return true; } if (!(o instanceof Step)) { return false; } Step step = (Step) o; if (this.id != null ? !this.id.equals(step.id) : step.id != null) { retu...
String id = UUID.randomUUID().toString(); Step one = getStep(id, "B"); Step two = getStep(id, "C"); Assert.assertEquals("same values same step", false, one.deepEquals(two)); Assert.assertEquals("same id <=> equals step", true, one.equals(two)); } }
[FOCAL] @Override public boolean Step.deepEquals(Object o) [CLASS] class Step implements DeepComparable, Serializable [METRICS] loc=30 cc=8 branches=7 loops=0 returns=8 throws=0 nesting=1 [CALLS-EXTERNAL] this.id.equals/1, this.metadataId.equals/1, this.name.equals/1, this.type.equals/1, this.description.equals/1, this...
/* static context [FOCAL] @Override public boolean Step.deepEquals(Object o) [PATH1] if(this == o)=F -> if(!(o instanceof Step))=F -> if(this.id != null ? !this.id.equals(step.id) : step.id != null)=F -> if(this.metadataId != null ? !this.metadataId.equals(step.metadataId) : step.id != null)=F -> if(this.name != null ?...
/* static context [FOCAL] @Override public boolean Step.deepEquals(Object o) [PATH1] if(this == o)=F -> if(!(o instanceof Step))=F -> if(this.id != null ? !this.id.equals(step.id) : step.id != null)=F -> if(this.metadataId != null ? !this.metadataId.equals(step.metadataId) : step.id != null)=F -> if(this.name != null ?...
true
ok
{"focal": {"class": "Step", "name": "deepEquals", "signature": "boolean deepEquals(Object o)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "o", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "Step", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Dee...
183916330_0
class BPlusTree { @SuppressWarnings("unused") public void insertPair(ArrayList<Object> key, long value) throws IOException, MiniDBException, IllegalStateException { if(root == null) {throw new IllegalStateException("Can't insert to null tree");} conf.padKey...
BPlusTree bt = createCommonTree(false); bt.insertPair(new ArrayList<>(Arrays.asList(100, 200.0, "12")), 12L); bt.insertPair(new ArrayList<>(Arrays.asList(100, 200.0, "120")), 0L); bt.insertPair(new ArrayList<>(Arrays.asList(100, 200.0, "9")), 254L); bt.insertPair(new ArrayList<>(...
[FOCAL] @SuppressWarnings("unused") public void BPlusTree.insertPair(ArrayList<Object> key, long value) [CLASS] class BPlusTree [METRICS] loc=28 cc=3 branches=2 loops=0 returns=0 throws=1 nesting=1 [CALLS-INTERNAL] long generateFirstAvailablePageIndex(BPlusConfiguration conf); void insertNonFull(TreeNode n, ArrayList<O...
/* static context [FOCAL] @SuppressWarnings("unused") public void BPlusTree.insertPair(ArrayList<Object> key, long value) [THROWS-WHEN] IllegalStateException when root == null [PATH1] if(root == null)=T -> throw new IllegalStateException("Can't insert to null tree") [STATE] root [FIELDS] read=root | write=root */
/* static context [FOCAL] @SuppressWarnings("unused") public void BPlusTree.insertPair(ArrayList<Object> key, long value) [THROWS-WHEN] IllegalStateException when root == null [PATH1] if(root == null)=T -> throw new IllegalStateException("Can't insert to null tree") [STATE] root [FIELDS] read=root | write=root */ class...
true
ok
{"focal": {"class": "BPlusTree", "name": "insertPair", "signature": "void insertPair(ArrayList<Object> key, long value) throws IOException, MiniDBException, IllegalStateException", "start_line": 3, "modifiers": "@SuppressWarnings(\"unused\") public", "params": [{"name": "key", "type": "ArrayList<Object>"}, {"name": "va...
183933015_15
class JdbcDBClient extends DB { @Override public Status read(String tableName, String key, Set<String> fields, Map<String, ByteIterator> result) { try { StatementType type = new StatementType(StatementType.Type.READ, tableName, 1, "", getShardIndexByKey(key)); PreparedStatement readStatement = cach...
String insertKey = "user0"; HashMap<String, ByteIterator> insertMap = insertRow(insertKey); Set<String> readFields = new HashSet<String>(); HashMap<String, ByteIterator> readResultMap = new HashMap<String, ByteIterator>(); // Test reading a single field readFields.add("F...
[FOCAL] @Override public Status JdbcDBClient.read(String tableName, String key, Set<String> fields, Map<String, ByteIterator> result) [CLASS] class JdbcDBClient extends DB [METRICS] loc=27 cc=6 branches=3 loops=1 returns=3 throws=0 nesting=3 [CALLS-INTERNAL] PreparedStatement createAndCacheReadStatement(StatementType r...
/* static context [FOCAL] @Override public Status JdbcDBClient.read(String tableName, String key, Set<String> fields, Map<String, ByteIterator> result) [PATH1] if(readStatement == null)=T -> if(!resultSet.next())=F -> if(result != null && fields != null)=T -> foreach(String field : fields)=T -> exit loop -> return Stat...
/* static context [FOCAL] @Override public Status JdbcDBClient.read(String tableName, String key, Set<String> fields, Map<String, ByteIterator> result) [PATH1] if(readStatement == null)=T -> if(!resultSet.next())=F -> if(result != null && fields != null)=T -> foreach(String field : fields)=T -> exit loop -> return Stat...
true
ok
{"focal": {"class": "JdbcDBClient", "name": "read", "signature": "Status read(String tableName, String key, Set<String> fields, Map<String, ByteIterator> result)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "tableName", "type": "String"}, {"name": "key", "type": "String"}, {"name": "fields", ...
183937162_747
class BinaryReader { public String readUnicodeString(long index) throws IOException { StringBuffer buffer = new StringBuffer(); while (index < length()) { int ch = readUnsignedShort(index); if (ch == 0) { break; } buffer.append((char) ch); index += 2; } return buffer.toString().trim(); } ...
BinaryReader br = br(false, 1, 1, 1, 0, 'A', 0, 'B', 0, 'C', 0x80, 0, 0); assertEquals("ABC\u8000", br.readUnicodeString(3, 4)); } }
[FOCAL] public String BinaryReader.readUnicodeString(long index) [CLASS] class BinaryReader [METRICS] loc=12 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] int readUnsignedShort(long index); long length() [CALLS-EXTERNAL] StringBuffer.append/1, buffer.toString().trim/0, StringBuffer.toString/0 [N...
/* static context [FOCAL] public String BinaryReader.readUnicodeString(long index) [PATH1] while(index < length())=T -> if(ch == 0)=F -> exit loop -> return buffer.toString().trim() [PATH2] while(index < length())=F -> return buffer.toString().trim() [PATH3] while(index < length())=T -> if(ch == 0)=T -> return buffer.t...
/* static context [FOCAL] public String BinaryReader.readUnicodeString(long index) [PATH1] while(index < length())=T -> if(ch == 0)=F -> exit loop -> return buffer.toString().trim() [PATH2] while(index < length())=F -> return buffer.toString().trim() [PATH3] while(index < length())=T -> if(ch == 0)=T -> return buffer.t...
true
ok
{"focal": {"class": "BinaryReader", "name": "readUnicodeString", "signature": "String readUnicodeString(long index) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "index", "type": "long"}], "return_type": "String"}, "class_info": {"name": "BinaryReader", "kind": "class", "modifiers": "...
184035533_3
class CompassConfigParserRM extends CompassConfigParser { @NotNull @Override public CompassConfig parse(@NotNull final VirtualFile file, @NotNull final String importPathsRoot, @Nullable final PsiManager psiManager) { return ReadAction.compute(() -> { ...
assertEmpty(parse().getImportPaths()); } }
[FOCAL] @NotNull @Override public CompassConfig CompassConfigParserRM.parse(VirtualFile file, String importPathsRoot, PsiManager psiManager) [CLASS] class CompassConfigParserRM extends CompassConfigParser [METRICS] loc=42 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=7 [CALLS-EXTERNAL] ReadAction.compute/1, PsiMan...
/* static context [FOCAL] @NotNull @Override public CompassConfig CompassConfigParserRM.parse(VirtualFile file, String importPathsRoot, PsiManager psiManager) [INPUTS] branches=- | result=file, importPathsRoot, psiManager [COLLABORATORS] param psiManager:PsiManager findFile/1; field arguments getCommand/0,getArguments/...
/* static context [FOCAL] @NotNull @Override public CompassConfig CompassConfigParserRM.parse(VirtualFile file, String importPathsRoot, PsiManager psiManager) [INPUTS] branches=- | result=file, importPathsRoot, psiManager [COLLABORATORS] param psiManager:PsiManager findFile/1; field arguments getCommand/0,getArguments/...
true
ok
{"focal": {"class": "CompassConfigParserRM", "name": "parse", "signature": "CompassConfig parse(VirtualFile file, String importPathsRoot, PsiManager psiManager)", "start_line": 3, "modifiers": "@NotNull @Override public", "params": [{"name": "file", "type": "VirtualFile"}, {"name": "importPathsRoot", "type": "String"},...
184219031_10
class HintCommand implements Command { @Override public String name() { return "hint"; } public HintCommand(Shell shell); @Override public Usage usage(); @Override public void run(Line line); } class HintCommandTest { @Test public void testName() {
HintCommand command = new HintCommand(new Shell()); assertThat(command.name(), is("hint")); } }
[FOCAL] @Override public String HintCommand.name() [CLASS] class HintCommand implements Command [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] HintCommand(Shell shell); Usage usage(); void run(Line line) [TEST] HintCommandTest: @Test public void testName()
/* static context [FOCAL] @Override public String HintCommand.name() */
/* static context [FOCAL] @Override public String HintCommand.name() */ class HintCommand implements Command { @Override public String name() { return "hint"; } public HintCommand(Shell shell); @Override public Usage usage(); @Override public void run(Line line); } class HintComman...
true
ok
{"focal": {"class": "HintCommand", "name": "name", "signature": "String name()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "HintCommand", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Command", "fields": [], "members": [{"name...
184265896_209
class BasicMonthViewUI extends MonthViewUI { protected Rectangle getMonthBoundsAtLocation(int x, int y) { if (!calendarGrid.contains(x, y)) return null; int calendarRow = (y - calendarGrid.y) / fullCalendarHeight; int calendarColumn = (x - calendarGrid.x) / fullCalendarWidth; ...
if (GraphicsEnvironment.isHeadless()) { LOG.fine("cannot run test - headless environment"); return; } BasicMonthViewUI ui = getRealizedMonthViewUI(ComponentOrientation.LEFT_TO_RIGHT); Rectangle monthBounds = ui.getMonthBoundsAtLocation(20, 20); assertEqual...
[FOCAL] protected Rectangle BasicMonthViewUI.getMonthBoundsAtLocation(int x, int y) [CLASS] class BasicMonthViewUI extends MonthViewUI [METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] calendarGrid.contains/2 [NEW] Rectangle [PATH1] if(!calendarGrid.contains(x, y))=T -> return null [...
/* static context [FOCAL] protected Rectangle BasicMonthViewUI.getMonthBoundsAtLocation(int x, int y) [PATH1] if(!calendarGrid.contains(x, y))=T -> return null [PATH2] if(!calendarGrid.contains(x, y))=F -> return new Rectangle(calendarGrid.x + calendarColumn * fullCalendarWidth, ... [INPUTS] branches=x, y | result=x, y...
/* static context [FOCAL] protected Rectangle BasicMonthViewUI.getMonthBoundsAtLocation(int x, int y) [PATH1] if(!calendarGrid.contains(x, y))=T -> return null [PATH2] if(!calendarGrid.contains(x, y))=F -> return new Rectangle(calendarGrid.x + calendarColumn * fullCalendarWidth, ... [INPUTS] branches=x, y | result=x, y...
true
ok
{"focal": {"class": "BasicMonthViewUI", "name": "getMonthBoundsAtLocation", "signature": "Rectangle getMonthBoundsAtLocation(int x, int y)", "start_line": 3, "modifiers": "protected", "params": [{"name": "x", "type": "int"}, {"name": "y", "type": "int"}], "return_type": "Rectangle"}, "class_info": {"name": "BasicMonthV...
184285250_188
class Format { public static String l(long v, int width) { return pad(Long.toString(v), width, true); } public static void tab(StringBuilder sbuff, int tabStop, boolean alwaysOne); public static String s(String s, int width); public static String pad(String s, int width, boolean rightJustify); public ...
long num = 12345L; assertThat(Format.l(num, 2)).isEqualTo("12345"); assertThat(Format.l(num, 3)).isEqualTo("12345"); assertThat(Format.l(num, 4)).isEqualTo("12345"); assertThat(Format.l(num, 5)).isEqualTo("12345"); assertThat(Format.l(num, 6)).isEqualTo(" 12345"); assertThat(Format.l(num, 7)...
[FOCAL] public static String Format.l(long v, int width) [CLASS] class Format [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String pad(String s, int width, boolean rightJustify) [CALLS-EXTERNAL] Long.toString/1 [INPUTS] branches=- | result=v, width [DATAFLOW] v@param->L2; width@p...
/* static context [FOCAL] public static String Format.l(long v, int width) [INPUTS] branches=- | result=v, width [CALLS-INTERNAL] String pad(String s, int width, boolean rightJustify) [CALLS-EXTERNAL] Long.toString/1 */
/* static context [FOCAL] public static String Format.l(long v, int width) [INPUTS] branches=- | result=v, width [CALLS-INTERNAL] String pad(String s, int width, boolean rightJustify) [CALLS-EXTERNAL] Long.toString/1 */ class Format { public static String l(long v, int width) { return pad(Long.toString(v), width...
true
ok
{"focal": {"class": "Format", "name": "l", "signature": "String l(long v, int width)", "start_line": 3, "modifiers": "public static", "params": [{"name": "v", "type": "long"}, {"name": "width", "type": "int"}], "return_type": "String"}, "class_info": {"name": "Format", "kind": "class", "modifiers": "", "superclass": nu...
184301969_5
class DijkstraAlgorithm { public static PathData findShortestPath(Graph graph, String sourceNodeIdentifier, String targetNodeIdentifier) throws ArrayStoreException { return findShortestPath(graph, graph.getNode(sourceNodeIdentifier), graph.getNode(targetNodeIdentifier)); } public static PathDataOb...
String[] sourceIDs = {"1", "1", "0", "4", "3", "3", "3", "2", "2"}; String[] targetIDs = {"0", "3", "4", "0", "0", "4", "5", "3", "5"}; double[] weights = {4, 1, 2, 3, 5, 2, 1, 3, 4}; graph = GraphBuilder.Build().WithNodes(6).SomeConnected(sourceIDs, targetIDs, weights).getGraph(); ...
[FOCAL] public static PathData DijkstraAlgorithm.findShortestPath(Graph graph, String sourceNodeIdentifier, String targetNodeIdentifier) [CLASS] class DijkstraAlgorithm [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] PathDataObject findShortestPath(GraphObject graph, String sourceN...
/* static context [FOCAL] public static PathData DijkstraAlgorithm.findShortestPath(Graph graph, String sourceNodeIdentifier, String targetNodeIdentifier) [INPUTS] branches=- | result=graph, sourceNodeIdentifier, targetNodeIdentifier [COLLABORATORS] param graph:Graph getNode/1 [EXCEPTIONS] declares ArrayStoreException ...
/* static context [FOCAL] public static PathData DijkstraAlgorithm.findShortestPath(Graph graph, String sourceNodeIdentifier, String targetNodeIdentifier) [INPUTS] branches=- | result=graph, sourceNodeIdentifier, targetNodeIdentifier [COLLABORATORS] param graph:Graph getNode/1 [EXCEPTIONS] declares ArrayStoreException ...
true
ok
{"focal": {"class": "DijkstraAlgorithm", "name": "findShortestPath", "signature": "PathData findShortestPath(Graph graph, String sourceNodeIdentifier, String targetNodeIdentifier) throws ArrayStoreException", "start_line": 3, "modifiers": "public static", "params": [{"name": "graph", "type": "Graph"}, {"name": "sourceN...
184386453_0
class GoogleTranslateApi { public String translate(String text, String lang) { Translation translationResult = translateApi.translate(text, TranslateOption.targetLanguage(lang)); return translationResult.getTranslatedText(); } public GoogleTranslateApi(); } class GoogleTranslateApiTest ...
GoogleTranslateApi service = new GoogleTranslateApi(); String result = service.translate("Hi there", "ja"); assertThat(result, is("こんにちは")); } }
[FOCAL] public String GoogleTranslateApi.translate(String text, String lang) [CLASS] class GoogleTranslateApi [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] translateApi.translate/2, TranslateOption.targetLanguage/1, Translation.getTranslatedText/0 [INPUTS] branches=- | result=lan...
/* static context [FOCAL] public String GoogleTranslateApi.translate(String text, String lang) [INPUTS] branches=- | result=lang, text [COLLABORATORS] field translateApi translate/2 [CALLS-EXTERNAL] translateApi.translate/2, TranslateOption.targetLanguage/1, Translation.getTranslatedText/0 */
/* static context [FOCAL] public String GoogleTranslateApi.translate(String text, String lang) [INPUTS] branches=- | result=lang, text [COLLABORATORS] field translateApi translate/2 [CALLS-EXTERNAL] translateApi.translate/2, TranslateOption.targetLanguage/1, Translation.getTranslatedText/0 */ class GoogleTranslateApi {...
true
ok
{"focal": {"class": "GoogleTranslateApi", "name": "translate", "signature": "String translate(String text, String lang)", "start_line": 3, "modifiers": "public", "params": [{"name": "text", "type": "String"}, {"name": "lang", "type": "String"}], "return_type": "String"}, "class_info": {"name": "GoogleTranslateApi", "ki...
184471389_18
class SpecificPageFilterFactory implements Filter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { SlingHttpServletRequest slingRequest = (SlingHttpServletRequest) request; // Skip filter if there isn't...
request.setResource(context.resourceResolver().resolve("/content/product-page")); MockRequestPathInfo pathInfo = (MockRequestPathInfo) request.getRequestPathInfo(); pathInfo.setSelectorString("productId1"); filter.doFilter(request, null, chain); // Check that the request dispatc...
[FOCAL] @Override public void SpecificPageFilterFactory.doFilter(ServletRequest request, ServletResponse response, FilterChain chain) [CLASS] class SpecificPageFilterFactory implements Filter [METRICS] loc=30 cc=4 branches=3 loops=0 returns=3 throws=0 nesting=1 [CALLS-EXTERNAL] slingRequest.getRequestPathInfo().getSele...
/* static context [FOCAL] @Override public void SpecificPageFilterFactory.doFilter(ServletRequest request, ServletResponse response, FilterChain chain) [PATH1] if(selector == null)=F -> if(!WCMMode.DISABLED.equals(wcmMode))=F -> if(subPage != null)=T -> return [PATH2] if(selector == null)=T -> return [PATH3] if(selecto...
/* static context [FOCAL] @Override public void SpecificPageFilterFactory.doFilter(ServletRequest request, ServletResponse response, FilterChain chain) [PATH1] if(selector == null)=F -> if(!WCMMode.DISABLED.equals(wcmMode))=F -> if(subPage != null)=T -> return [PATH2] if(selector == null)=T -> return [PATH3] if(selecto...
true
ok
{"focal": {"class": "SpecificPageFilterFactory", "name": "doFilter", "signature": "void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "ServletRequest"}, {"name"...
184496771_3
class DeleteHandler extends BaseHandler<CallbackContext> { @Override public ProgressEvent<ResourceModel, CallbackContext> handleRequest( final AmazonWebServicesClientProxy proxy, final ResourceHandlerRequest<ResourceModel> request, final CallbackContext callbackContext, final Lo...
final DeleteHandler handler = new DeleteHandler(); doThrow(ConfigurationSetDoesNotExistException.class) .when(proxy) .injectCredentialsAndInvokeV2( ArgumentMatchers.any(), ArgumentMatchers.any() ); final ResourceModel model = ...
[FOCAL] @Override public ProgressEvent<ResourceModel, CallbackContext> DeleteHandler.handleRequest(AmazonWebServicesClientProxy proxy, ResourceHandlerRequest<ResourceModel> request, CallbackContext callbackContext, Logger logger) [CLASS] class DeleteHandler extends BaseHandler<CallbackContext> [METRICS] loc=22 cc=2 bra...
/* static context [FOCAL] @Override public ProgressEvent<ResourceModel, CallbackContext> DeleteHandler.handleRequest(AmazonWebServicesClientProxy proxy, ResourceHandlerRequest<ResourceModel> request, CallbackContext callbackContext, Logger logger) [THROWS-WHEN] CfnNotFoundException when try-body throws [PATH1] try-body...
/* static context [FOCAL] @Override public ProgressEvent<ResourceModel, CallbackContext> DeleteHandler.handleRequest(AmazonWebServicesClientProxy proxy, ResourceHandlerRequest<ResourceModel> request, CallbackContext callbackContext, Logger logger) [THROWS-WHEN] CfnNotFoundException when try-body throws [PATH1] try-body...
true
ok
{"focal": {"class": "DeleteHandler", "name": "handleRequest", "signature": "ProgressEvent<ResourceModel, CallbackContext> handleRequest(AmazonWebServicesClientProxy proxy, ResourceHandlerRequest<ResourceModel> request, CallbackContext callbackContext, Logger logger)", "start_line": 3, "modifiers": "@Override public", "...
184569540_75
class ImageName { public String getFullName() { return getFullName(null); } public ImageName(String fullName); public ImageName(String fullName, String givenTag); public String getRepository(); public String getRegistry(); public String getTag(); public String getDigest(); ...
assertEquals("docker.jolokia.org/org/jolokia/jolokia_demo:0.18", new ImageName("org/jolokia/jolokia_demo:0.18").getFullName("docker.jolokia.org")); assertEquals("docker.jolokia.org/org/jolokia/jolokia_demo:latest", new ImageName("org/jolokia/jolokia_demo").getFullName("do...
[FOCAL] public String ImageName.getFullName() [CLASS] class ImageName [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String getFullName(String optionalRegistry) [CLASS-MEMBERS] ImageName(String fullName); ImageName(String fullName, String givenTag); String getRepository(); String ...
/* static context [FOCAL] public String ImageName.getFullName() [CALLS-INTERNAL] String getFullName(String optionalRegistry) */
/* static context [FOCAL] public String ImageName.getFullName() [CALLS-INTERNAL] String getFullName(String optionalRegistry) */ class ImageName { public String getFullName() { return getFullName(null); } public ImageName(String fullName); public ImageName(String fullName, String givenTag); ...
true
ok
{"focal": {"class": "ImageName", "name": "getFullName", "signature": "String getFullName()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "ImageName", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "I...