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
198222234_67
class FlatMapIterableStageFactory implements ProcessingStageFactory<Stage.FlatMapIterable> { @Override public <I, O> ProcessingStage<I, O> create(Engine engine, Stage.FlatMapIterable stage) { Function<I, Iterable<O>> mapper = Casts.cast(stage.getMapper()); return new FlatMapIterable<>(mapper); ...
assertThrows(NullPointerException.class, () -> factory.create(null, () -> null)); } }
[FOCAL] @Override public ProcessingStage<I, O> FlatMapIterableStageFactory.create(Engine engine, Stage.FlatMapIterable stage) [CLASS] class FlatMapIterableStageFactory implements ProcessingStageFactory<Stage.FlatMapIterable> [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Casts.cas...
/* static context [FOCAL] @Override public ProcessingStage<I, O> FlatMapIterableStageFactory.create(Engine engine, Stage.FlatMapIterable stage) [INPUTS] branches=- | result=stage | unused=engine [COLLABORATORS] param stage:Stage.FlatMapIterable getMapper/0 [NEW] FlatMapIterable<> [CALLS-EXTERNAL] Casts.cast/1, Stage.Fl...
/* static context [FOCAL] @Override public ProcessingStage<I, O> FlatMapIterableStageFactory.create(Engine engine, Stage.FlatMapIterable stage) [INPUTS] branches=- | result=stage | unused=engine [COLLABORATORS] param stage:Stage.FlatMapIterable getMapper/0 [NEW] FlatMapIterable<> [CALLS-EXTERNAL] Casts.cast/1, Stage.Fl...
true
ok
{"focal": {"class": "FlatMapIterableStageFactory", "name": "create", "signature": "ProcessingStage<I, O> create(Engine engine, Stage.FlatMapIterable stage)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "engine", "type": "Engine"}, {"name": "stage", "type": "Stage.FlatMapIterable"}], "return_ty...
198238470_474
class ProjectWhiteListSecHubConfigurationValidationService { public void assertAllowedForProject(SecHubConfiguration configuration) { List<URI> allowed = fetchAllowedUris(configuration); Optional<SecHubInfrastructureScanConfiguration> infrascanOpt = configuration.getInfraScan(); if (infrascanOpt.isPresent()) {...
/* test */ expectedException.expect(NotAcceptableException.class); /* prepare */ whiteListFoundForProject.add(new ProjectWhitelistEntry(projectId, new URI(IP_ADRESS_2))); when(support.isWhitelisted(eq(IP_ADRESS_1), any())).thenReturn(false); // not whitelisted - so failure expected /* execute */ service...
[FOCAL] public void ProjectWhiteListSecHubConfigurationValidationService.assertAllowedForProject(SecHubConfiguration configuration) [CLASS] class ProjectWhiteListSecHubConfigurationValidationService [METRICS] loc=16 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] List<URI> asUris(List<InetAddress>...
/* static context [FOCAL] public void ProjectWhiteListSecHubConfigurationValidationService.assertAllowedForProject(SecHubConfiguration configuration) [PATH1] if(infrascanOpt.isPresent())=T -> if(webscanopt.isPresent())=T [PATH2] if(infrascanOpt.isPresent())=F -> if(webscanopt.isPresent())=F [INPUTS] branches=configurat...
/* static context [FOCAL] public void ProjectWhiteListSecHubConfigurationValidationService.assertAllowedForProject(SecHubConfiguration configuration) [PATH1] if(infrascanOpt.isPresent())=T -> if(webscanopt.isPresent())=T [PATH2] if(infrascanOpt.isPresent())=F -> if(webscanopt.isPresent())=F [INPUTS] branches=configurat...
true
ok
{"focal": {"class": "ProjectWhiteListSecHubConfigurationValidationService", "name": "assertAllowedForProject", "signature": "void assertAllowedForProject(SecHubConfiguration configuration)", "start_line": 3, "modifiers": "public", "params": [{"name": "configuration", "type": "SecHubConfiguration"}], "return_type": "voi...
198569702_7
class RSACipher implements Cipher { @Override public byte[] decrypt(byte[] encryptData) { try { javax.crypto.Cipher cipher = javax.crypto.Cipher.getInstance(KEY_ALGORITHM); cipher.init(javax.crypto.Cipher.DECRYPT_MODE, privateKey); byte[] result = cipher.doFinal(Base...
byte[] encryptData = rsaCipher.encrypt("我是ukuz😄".getBytes(StandardCharsets.UTF_8)); byte[] decryptData = rsaCipher.decrypt(encryptData); assertEquals("我是ukuz😄", new String(decryptData, StandardCharsets.UTF_8)); } }
[FOCAL] @Override public byte[] RSACipher.decrypt(byte[] encryptData) [CLASS] class RSACipher implements Cipher [METRICS] loc=11 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] javax.crypto.Cipher.getInstance/1, javax.crypto.Cipher.init/2, javax.crypto.Cipher.doFinal/1, Base64.getDecoder().decode/...
/* static context [FOCAL] @Override public byte[] RSACipher.decrypt(byte[] encryptData) [THROWS-WHEN] CryptoException when try-body throws [PATH1] try-body throws -> throw new CryptoException(e) [PATH2] return result [INPUTS] branches=- | result=encryptData [EXCEPTIONS] throws CryptoException; catches Exception e [NEW]...
/* static context [FOCAL] @Override public byte[] RSACipher.decrypt(byte[] encryptData) [THROWS-WHEN] CryptoException when try-body throws [PATH1] try-body throws -> throw new CryptoException(e) [PATH2] return result [INPUTS] branches=- | result=encryptData [EXCEPTIONS] throws CryptoException; catches Exception e [NEW]...
true
ok
{"focal": {"class": "RSACipher", "name": "decrypt", "signature": "byte[] decrypt(byte[] encryptData)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "encryptData", "type": "byte[]"}], "return_type": "byte[]"}, "class_info": {"name": "RSACipher", "kind": "class", "modifiers": "", "superclass": nu...
199027540_43
class Event implements Comparable<Event> { public long getTime() { return time; } public Event(long timeFromNowNs); public abstract void trigger(); @Override public int compareTo(Event o); } class EventTest { @Test public void testQueueOrder() {
// Events Event e1 = new FlowStartEvent(1000, null, 0, 0); Event e2 = new FlowStartEvent(0, null, 0, 0); Event e3 = new FlowStartEvent(848, null, 0, 0); Event e4 = new FlowStartEvent(1000, null, 0, 0); Event e5 = new FlowStartEvent(999999, null, 0, 0); // Create...
[FOCAL] public long Event.getTime() [CLASS] class Event implements Comparable<Event> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Event(long timeFromNowNs); void trigger(); int compareTo(Event o) [TEST] EventTest: @Test public void testQueueOrder()
/* static context [FOCAL] public long Event.getTime() */
/* static context [FOCAL] public long Event.getTime() */ class Event implements Comparable<Event> { public long getTime() { return time; } public Event(long timeFromNowNs); public abstract void trigger(); @Override public int compareTo(Event o); } class EventTest { @Test publi...
true
ok
{"focal": {"class": "Event", "name": "getTime", "signature": "long getTime()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "long"}, "class_info": {"name": "Event", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Comparable<Event>", "fields": [], "members": [{"name": "Event"...
199046636_39
class TagController { @PutMapping("/admin/tag/update") public Response updateOne(@RequestParam("id") Long id, @RequestParam("name") String name) { return ResponseUtil.success(tagService.update(id, name)); } @PostMapping("/admin/tag/create") public Response addOne(@RequestParam("name") String n...
Tag tag = tagMapper.getLastestTag(); assertNotNull(tag.getId()); String name = UUID.randomUUID().toString().substring(0, 4); mockMvc.perform(put("/admin/tag/update?id=" + tag.getId() + "&name=" + name).header("Authorization", adminLogin())).andDo(result -> { JSONObject object...
[FOCAL] @PutMapping("/admin/tag/update") public Response TagController.updateOne(Long id, String name) [CLASS] class TagController [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] ResponseUtil.success/1, tagService.update/2 [INPUTS] branches=- | result=id, name [COLLABORATORS] field...
/* static context [FOCAL] @PutMapping("/admin/tag/update") public Response TagController.updateOne(Long id, String name) [INPUTS] branches=- | result=id, name [COLLABORATORS] field tagService update/2 [CALLS-EXTERNAL] ResponseUtil.success/1, tagService.update/2 */
/* static context [FOCAL] @PutMapping("/admin/tag/update") public Response TagController.updateOne(Long id, String name) [INPUTS] branches=- | result=id, name [COLLABORATORS] field tagService update/2 [CALLS-EXTERNAL] ResponseUtil.success/1, tagService.update/2 */ class TagController { @PutMapping("/admin/tag/upda...
true
ok
{"focal": {"class": "TagController", "name": "updateOne", "signature": "Response updateOne(Long id, String name)", "start_line": 3, "modifiers": "@PutMapping(\"/admin/tag/update\") public", "params": [{"name": "id", "type": "Long"}, {"name": "name", "type": "String"}], "return_type": "Response"}, "class_info": {"name":...
199262429_198
class BST { public boolean isEmpty() { return root == null; } protected int getCount(Node cur); protected Node updateCount(Node cur); public int size(); public boolean contains(Key key); public Val find(Key key); private Node find(Node cur, Key key); public void put(Key key...
Assert.assertEquals(expect.isEmpty(), bst.isEmpty()); } }
[FOCAL] public boolean BST.isEmpty() [CLASS] class BST [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] int getCount(Node cur); Node updateCount(Node cur); int size(); boolean contains(Key key); Val find(Key key); Node find(Node cur, Key key); void put(Key key, Val val); Node put(Nod...
/* static context [FOCAL] public boolean BST.isEmpty() */
/* static context [FOCAL] public boolean BST.isEmpty() */ class BST { public boolean isEmpty() { return root == null; } protected int getCount(Node cur); protected Node updateCount(Node cur); public int size(); public boolean contains(Key key); public Val find(Key key); private...
true
ok
{"focal": {"class": "BST", "name": "isEmpty", "signature": "boolean isEmpty()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "BST", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "r", "type": "Random", "modifiers":...
199309560_3
class OpenAPIGenerator { public OpenAPI generate() { return generate(OpenApiGeneratorConfigBuilder.defaultConfig().build()); } public OpenAPIGenerator(List<String> modelPackages, List<String> controllerBasePackages, Info info); public OpenAPIGenerator(List<String> modelPackages, List<String>...
OpenAPI openAPI = createTestGenerator().generate( OpenApiGeneratorConfigBuilder.defaultConfig() .withGenerateExamples(true) .withOpenApiExampleResolver(createExampleResolver()) .build() ); assertOpenApiResult...
[FOCAL] public OpenAPI OpenAPIGenerator.generate() [CLASS] class OpenAPIGenerator [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] OpenAPI generate(OpenApiGeneratorConfig openApiGeneratorConfig) [CALLS-EXTERNAL] OpenApiGeneratorConfigBuilder.defaultConfig().build/0, OpenApiGenerator...
/* static context [FOCAL] public OpenAPI OpenAPIGenerator.generate() [CALLS-INTERNAL] OpenAPI generate(OpenApiGeneratorConfig openApiGeneratorConfig) [CALLS-EXTERNAL] OpenApiGeneratorConfigBuilder.defaultConfig().build/0, OpenApiGeneratorConfigBuilder.defaultConfig/0 */
/* static context [FOCAL] public OpenAPI OpenAPIGenerator.generate() [CALLS-INTERNAL] OpenAPI generate(OpenApiGeneratorConfig openApiGeneratorConfig) [CALLS-EXTERNAL] OpenApiGeneratorConfigBuilder.defaultConfig().build/0, OpenApiGeneratorConfigBuilder.defaultConfig/0 */ class OpenAPIGenerator { public OpenAPI gene...
true
ok
{"focal": {"class": "OpenAPIGenerator", "name": "generate", "signature": "OpenAPI generate()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "OpenAPI"}, "class_info": {"name": "OpenAPIGenerator", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "operat...
199431217_0
class PositioningStore implements JournalPersistence, MonitoredPersistence, Closeable { public void recover(Path path, long min, Properties properties) throws IOException { Files.createDirectories(path); this.base = path.toFile(); this.config = toConfig(properties); bufferPool.addP...
JournalPersistence store = new PositioningStore(); store.recover(path, new Properties()); int size = 10; int maxLength = 999; long start = store.max(); List<byte[]> journals = ByteUtils.createRandomSizeByteList(maxLength, size); int length = journa...
[FOCAL] public void PositioningStore.recover(Path path, long min, Properties properties) [CLASS] class PositioningStore implements JournalPersistence, MonitoredPersistence, Closeable [METRICS] loc=23 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] Config toConfig(Properties properties); long max()...
/* static context [FOCAL] public void PositioningStore.recover(Path path, long min, Properties properties) [PATH1] if(logger.isDebugEnabled())=T [PATH2] if(logger.isDebugEnabled())=F [INPUTS] branches=logger | result=- [COLLABORATORS] param path:Path toFile/0; field bufferPool addPreLoad/3; field config getFileDataSize...
/* static context [FOCAL] public void PositioningStore.recover(Path path, long min, Properties properties) [PATH1] if(logger.isDebugEnabled())=T [PATH2] if(logger.isDebugEnabled())=F [INPUTS] branches=logger | result=- [COLLABORATORS] param path:Path toFile/0; field bufferPool addPreLoad/3; field config getFileDataSize...
true
ok
{"focal": {"class": "PositioningStore", "name": "recover", "signature": "void recover(Path path, long min, Properties properties) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "path", "type": "Path"}, {"name": "min", "type": "long"}, {"name": "properties", "type": "Properties"}], "ret...
199491032_2
class LoadBalance { Result<? extends Record> run() { // Pull the latest state from the DB model.updateData(); // Run the solver and return the virtual machines table with solver-identified values for the // controllable__physical_machines column return model.solve(VIRTUAL_M...
final String allVmsGoToPm3 = "create view constraint_simple as " + "select * from virtual_machine " + "check controllable__physical_machine = 'pm3'"; final LoadBalance lb = new LoadBalance(Collections.singletonList(allVmsGoToPm3))...
[FOCAL] Result<? extends Record> LoadBalance.run() [CLASS] class LoadBalance [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] model.updateData/0, model.solve/1 [COLLABORATORS] field model updateData/0,solve/1 [CLASS-MEMBERS] LoadBalance(List<String> constraints); void addPhysicalMac...
/* static context [FOCAL] Result<? extends Record> LoadBalance.run() [COLLABORATORS] field model updateData/0,solve/1 [CALLS-EXTERNAL] model.updateData/0, model.solve/1 */
/* static context [FOCAL] Result<? extends Record> LoadBalance.run() [COLLABORATORS] field model updateData/0,solve/1 [CALLS-EXTERNAL] model.updateData/0, model.solve/1 */ class LoadBalance { Result<? extends Record> run() { // Pull the latest state from the DB model.updateData(); // Run t...
true
ok
{"focal": {"class": "LoadBalance", "name": "run", "signature": "Result<? extends Record> run()", "start_line": 3, "modifiers": "", "params": [], "return_type": "Result<? extends Record>"}, "class_info": {"name": "LoadBalance", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name":...
199626064_3
class PatternDetectingReader extends FilterReader { @Override public int read() throws IOException { char[] buffer = new char[1]; int read = read(buffer); if (read < 0) { return read; } else { return buffer[0]; } } PatternDetectingRead...
char[] buffer = new char[5]; Reader data = new StringReader("aabbccdd"); PatternDetectingReader in = new PatternDetectingReader(data, "abc"); assertEquals(3, in.read(buffer, 1, 3)); assertEquals(3, in.read(buffer, 1, 3)); assertEquals(2, in.read(buffer, 1, 3)); as...
[FOCAL] @Override public int PatternDetectingReader.read() [CLASS] class PatternDetectingReader extends FilterReader [METRICS] loc=11 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] int read(char[] b) [EXCEPTIONS] declares IOException [PATH1] if(read < 0)=T -> return read [PATH2] if(read < 0)=F ->...
/* static context [FOCAL] @Override public int PatternDetectingReader.read() [PATH1] if(read < 0)=T -> return read [PATH2] if(read < 0)=F -> return buffer[0] [EXCEPTIONS] declares IOException [CALLS-INTERNAL] int read(char[] b) */
/* static context [FOCAL] @Override public int PatternDetectingReader.read() [PATH1] if(read < 0)=T -> return read [PATH2] if(read < 0)=F -> return buffer[0] [EXCEPTIONS] declares IOException [CALLS-INTERNAL] int read(char[] b) */ class PatternDetectingReader extends FilterReader { @Override public int read() ...
true
ok
{"focal": {"class": "PatternDetectingReader", "name": "read", "signature": "int read() throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "PatternDetectingReader", "kind": "class", "modifiers": "", "superclass": "FilterReader", "interfaces"...
199703640_0
class FastActorClassFinder implements ActorClassFinder { @SuppressWarnings("unchecked") @Override public <T extends Actor> Collection<Class<? extends T>> findActorInterfaces(final Predicate<Class<T>> predicate) { List<Class<? extends T>> interfaces = null; for (Class<?> concreteInterfac...
Collection<Class<? extends Actor>> actorInterfaces = actorClassFinder.findActorInterfaces(ScheduledTask.class::isAssignableFrom); assertEquals(2, actorInterfaces.size()); } }
[FOCAL] @SuppressWarnings("unchecked") @Override public Collection<Class<? extends T>> FastActorClassFinder.findActorInterfaces(Predicate<Class<T>> predicate) [CLASS] class FastActorClassFinder implements ActorClassFinder [METRICS] loc=18 cc=4 branches=2 loops=1 returns=1 throws=0 nesting=3 [CALLS-EXTERNAL] concreteImp...
/* static context [FOCAL] @SuppressWarnings("unchecked") @Override public Collection<Class<? extends T>> FastActorClassFinder.findActorInterfaces(Predicate<Class<T>> predicate) [PATH1] foreach(Class<?> concreteInterface : concreteImplementations.keySet())=T -> if(predicate.test((Class<T>) concreteInterface))=T -> if(in...
/* static context [FOCAL] @SuppressWarnings("unchecked") @Override public Collection<Class<? extends T>> FastActorClassFinder.findActorInterfaces(Predicate<Class<T>> predicate) [PATH1] foreach(Class<?> concreteInterface : concreteImplementations.keySet())=T -> if(predicate.test((Class<T>) concreteInterface))=T -> if(in...
true
ok
{"focal": {"class": "FastActorClassFinder", "name": "findActorInterfaces", "signature": "Collection<Class<? extends T>> findActorInterfaces(Predicate<Class<T>> predicate)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") @Override public", "params": [{"name": "predicate", "type": "Predicate<Class<T>>"}]...
199829201_0
class ActivityPartService implements IActivityPartService { @Override public Result<NewCustomerPartResponse> partNewCustomerActivity(NewCustomerPartRequest request) { ContextParam contextParam = new ContextParam(FunctionCodeEnum.ACTIVITY_PARTICIPATE, request, ActivityTypeEnum.NEW_CUSTOM...
NewCustomerPartRequest request = new NewCustomerPartRequest(customerRegisterId, channelId); Result<NewCustomerPartResponse> result = activityPartService.partNewCustomerActivity(request); Assert.assertTrue(result.isSuccess()); Assert.assertNotNull(result.getModel()); } }
[FOCAL] @Override public Result<NewCustomerPartResponse> ActivityPartService.partNewCustomerActivity(NewCustomerPartRequest request) [CLASS] class ActivityPartService implements IActivityPartService [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] ActivityTypeEnum.NEW_CUSTOMER_GIFT....
/* static context [FOCAL] @Override public Result<NewCustomerPartResponse> ActivityPartService.partNewCustomerActivity(NewCustomerPartRequest request) [INPUTS] branches=- | result=request [COLLABORATORS] field activityDispatcher dispatcher/1 [NEW] ContextParam [CALLS-EXTERNAL] ActivityTypeEnum.NEW_CUSTOMER_GIFT.getType...
/* static context [FOCAL] @Override public Result<NewCustomerPartResponse> ActivityPartService.partNewCustomerActivity(NewCustomerPartRequest request) [INPUTS] branches=- | result=request [COLLABORATORS] field activityDispatcher dispatcher/1 [NEW] ContextParam [CALLS-EXTERNAL] ActivityTypeEnum.NEW_CUSTOMER_GIFT.getType...
true
ok
{"focal": {"class": "ActivityPartService", "name": "partNewCustomerActivity", "signature": "Result<NewCustomerPartResponse> partNewCustomerActivity(NewCustomerPartRequest request)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "NewCustomerPartRequest"}], "return_type": "Resul...
199902324_0
class CardRestApi { @POST @ApiOperation(value = "Create a new Card", notes = "Create a card using json") public Response createCard(Card card){ card = cardService.createCard(card); return Response.created(getGetUri(card)).build(); } @PUT @ApiOperation(value = "Update a new Card", n...
WebTarget path = client.target(this.uri).path(PATH); Response response = path .request(MediaType.APPLICATION_JSON_TYPE) .accept(MediaType.APPLICATION_JSON_TYPE) .post(Entity.entity(testCard, MediaType.APPLICATION_JSON_TYPE), Response.clas...
[FOCAL] @POST @ApiOperation(value = "Create a new Card", notes = "Create a card using json") public Response CardRestApi.createCard(Card card) [CLASS] class CardRestApi [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] URI getGetUri(Card card) [CALLS-EXTERNAL] cardService.createCard/...
/* static context [FOCAL] @POST @ApiOperation(value = "Create a new Card", notes = "Create a card using json") public Response CardRestApi.createCard(Card card) [INPUTS] branches=- | result=card [COLLABORATORS] field cardService createCard/1 [CALLS-INTERNAL] URI getGetUri(Card card) [CALLS-EXTERNAL] cardService.createC...
/* static context [FOCAL] @POST @ApiOperation(value = "Create a new Card", notes = "Create a card using json") public Response CardRestApi.createCard(Card card) [INPUTS] branches=- | result=card [COLLABORATORS] field cardService createCard/1 [CALLS-INTERNAL] URI getGetUri(Card card) [CALLS-EXTERNAL] cardService.createC...
true
ok
{"focal": {"class": "CardRestApi", "name": "createCard", "signature": "Response createCard(Card card)", "start_line": 3, "modifiers": "@POST @ApiOperation(value = \"Create a new Card\", notes = \"Create a card using json\") public", "params": [{"name": "card", "type": "Card"}], "return_type": "Response"}, "class_info":...
200044570_0
class UperEncoder { public static byte[] bytesFromHexString(String s) { if ((s.length() % 2) != 0) { throw new IllegalArgumentException( "Converting to bytes requires even number of characters, got " + s.length()); } int len = s.length(); byte[] data ...
String hexString = "AAB"; UperEncoder.bytesFromHexString(hexString); fail("Expected exception."); } }
[FOCAL] public static byte[] UperEncoder.bytesFromHexString(String s) [CLASS] class UperEncoder [METRICS] loc=13 cc=3 branches=1 loops=1 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] String.length/0, Character.digit/2, String.charAt/1 [NEW] IllegalArgumentException [EXCEPTIONS] throws IllegalArgumentException [THROWS-W...
/* static context [FOCAL] public static byte[] UperEncoder.bytesFromHexString(String s) [THROWS-WHEN] IllegalArgumentException when (s.length() % 2) != 0 [PATH1] if((s.length() % 2) != 0)=F -> for(i < len)=T -> exit loop -> return data [PATH2] if((s.length() % 2) != 0)=T -> throw new IllegalArgumentException( "Converti...
/* static context [FOCAL] public static byte[] UperEncoder.bytesFromHexString(String s) [THROWS-WHEN] IllegalArgumentException when (s.length() % 2) != 0 [PATH1] if((s.length() % 2) != 0)=F -> for(i < len)=T -> exit loop -> return data [PATH2] if((s.length() % 2) != 0)=T -> throw new IllegalArgumentException( "Converti...
true
ok
{"focal": {"class": "UperEncoder", "name": "bytesFromHexString", "signature": "byte[] bytesFromHexString(String s)", "start_line": 3, "modifiers": "public static", "params": [{"name": "s", "type": "String"}], "return_type": "byte[]"}, "class_info": {"name": "UperEncoder", "kind": "class", "modifiers": "", "superclass":...
200053873_12
class RNMarketingCloudSdkModule extends ReactContextBaseJavaModule { @ReactMethod public void enableVerboseLogging() { MarketingCloudSdk.setLogLevel(MCLogListener.VERBOSE); MarketingCloudSdk.setLogListener(new MCLogListener.AndroidLogListener()); } public RNMarketingCloudSdkModule(Rea...
// GIVEN ShadowMarketingCloudSdk.isReady(true); // WHEN reactModule.enableVerboseLogging(); // THEN assertEquals(MCLogListener.VERBOSE, ShadowMarketingCloudSdk.getLogLevel()); assertThat(ShadowMarketingCloudSdk.getLogListener(), CoreMatchers.<MCLogListener>insta...
[FOCAL] @ReactMethod public void RNMarketingCloudSdkModule.enableVerboseLogging() [CLASS] class RNMarketingCloudSdkModule extends ReactContextBaseJavaModule [METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] MarketingCloudSdk.setLogLevel/1, MarketingCloudSdk.setLogListener/1 [NEW] MCL...
/* static context [FOCAL] @ReactMethod public void RNMarketingCloudSdkModule.enableVerboseLogging() [NEW] MCLogListener.AndroidLogListener [CALLS-EXTERNAL] MarketingCloudSdk.setLogLevel/1, MarketingCloudSdk.setLogListener/1 */
/* static context [FOCAL] @ReactMethod public void RNMarketingCloudSdkModule.enableVerboseLogging() [NEW] MCLogListener.AndroidLogListener [CALLS-EXTERNAL] MarketingCloudSdk.setLogLevel/1, MarketingCloudSdk.setLogListener/1 */ class RNMarketingCloudSdkModule extends ReactContextBaseJavaModule { @ReactMethod pu...
true
ok
{"focal": {"class": "RNMarketingCloudSdkModule", "name": "enableVerboseLogging", "signature": "void enableVerboseLogging()", "start_line": 3, "modifiers": "@ReactMethod public", "params": [], "return_type": "void"}, "class_info": {"name": "RNMarketingCloudSdkModule", "kind": "class", "modifiers": "", "superclass": "Rea...
200062847_31
class ParagraphCompletion implements Completion { @Nonnull @Override public CompletionItemKind getKind() { return CompletionItemKind.Method; } @Nonnull @Override public Collection<String> getCompletionSource(MyDocumentModel document); @Nonnull @Override public String getSortOrderPrefix(); private s...
MyDocumentModel document = createModel(); Set<Completion> completionSet = new HashSet<>(); completionSet.add(new ParagraphCompletion()); Completions completions = new Completions(completionSet); List<CompletionItem> completionItems = completions.collectFor(document, createCompletionParams()...
[FOCAL] @Nonnull @Override public CompletionItemKind ParagraphCompletion.getKind() [CLASS] class ParagraphCompletion implements Completion [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Collection<String> getCompletionSource(MyDocumentModel document); String getSortOrderPrefix() [T...
/* static context [FOCAL] @Nonnull @Override public CompletionItemKind ParagraphCompletion.getKind() */
/* static context [FOCAL] @Nonnull @Override public CompletionItemKind ParagraphCompletion.getKind() */ class ParagraphCompletion implements Completion { @Nonnull @Override public CompletionItemKind getKind() { return CompletionItemKind.Method; } @Nonnull @Override public Collection<String> getCompletio...
true
ok
{"focal": {"class": "ParagraphCompletion", "name": "getKind", "signature": "CompletionItemKind getKind()", "start_line": 3, "modifiers": "@Nonnull @Override public", "params": [], "return_type": "CompletionItemKind"}, "class_info": {"name": "ParagraphCompletion", "kind": "class", "modifiers": "", "superclass": null, "i...
200492090_13
class DssRestHandler extends SimpleChannelInboundHandler<Object> implements DssHandler<DssRestChannelHandlerCommand> { @Override public Behavior<DssRestChannelHandlerCommand> create() { if (initializeBehavior.get()) { throw new DssUserActorDuplicateBehaviorCreateException("Cannot setup twic...
mockChannelHandlerContextChannelId(ctx, "abcedf"); final ChannelFuture channelFuture = Mockito.mock(ChannelFuture.class); Mockito.when(ctx.writeAndFlush(Mockito.anyObject())).thenReturn(channelFuture); final TestProbe<DssRestMasterActorCommand> testProbe = testKit.createTestProbe(); ...
[FOCAL] @Override public Behavior<DssRestChannelHandlerCommand> DssRestHandler.create() [CLASS] class DssRestHandler extends SimpleChannelInboundHandler<Object> implements DssHandler<DssRestChannelHandlerCommand> [METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] initializeBehavior.ge...
/* static context [FOCAL] @Override public Behavior<DssRestChannelHandlerCommand> DssRestHandler.create() [THROWS-WHEN] DssUserActorDuplicateBehaviorCreateException when initializeBehavior.get() [PATH1] if(initializeBehavior.get())=T -> throw new DssUserActorDuplicateBehaviorCreateException("Cannot setup twic... [PATH2...
/* static context [FOCAL] @Override public Behavior<DssRestChannelHandlerCommand> DssRestHandler.create() [THROWS-WHEN] DssUserActorDuplicateBehaviorCreateException when initializeBehavior.get() [PATH1] if(initializeBehavior.get())=T -> throw new DssUserActorDuplicateBehaviorCreateException("Cannot setup twic... [PATH2...
true
ok
{"focal": {"class": "DssRestHandler", "name": "create", "signature": "Behavior<DssRestChannelHandlerCommand> create()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Behavior<DssRestChannelHandlerCommand>"}, "class_info": {"name": "DssRestHandler", "kind": "class", "modifiers": "", "su...
200620451_122
class PlaceServiceImpl implements PlaceService { @Override public List<Place> findAll() { log.info(LogMessage.IN_FIND_ALL); return placeRepo.findAll(); } @Autowired public PlaceServiceImpl(PlaceRepo placeRepo, ModelMapper modelMapper, ...
List<Place> expectedList = Arrays.asList(new Place(), new Place()); when(placeRepo.findAll()).thenReturn(expectedList); assertEquals(expectedList, placeService.findAll()); } }
[FOCAL] @Override public List<Place> PlaceServiceImpl.findAll() [CLASS] class PlaceServiceImpl implements PlaceService [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] log.info/1, PlaceRepo.findAll/0 [FIELDS] read=placeRepo:PlaceRepo [INPUTS] branches=- | result=placeRepo [COLLABORA...
/* static context [FOCAL] @Override public List<Place> PlaceServiceImpl.findAll() [INPUTS] branches=- | result=placeRepo [COLLABORATORS] field placeRepo:PlaceRepo findAll/0 [FIELDS] read=placeRepo:PlaceRepo [CALLS-EXTERNAL] log.info/1, PlaceRepo.findAll/0 */
/* static context [FOCAL] @Override public List<Place> PlaceServiceImpl.findAll() [INPUTS] branches=- | result=placeRepo [COLLABORATORS] field placeRepo:PlaceRepo findAll/0 [FIELDS] read=placeRepo:PlaceRepo [CALLS-EXTERNAL] log.info/1, PlaceRepo.findAll/0 */ class PlaceServiceImpl implements PlaceService { @Overri...
true
ok
{"focal": {"class": "PlaceServiceImpl", "name": "findAll", "signature": "List<Place> findAll()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "List<Place>"}, "class_info": {"name": "PlaceServiceImpl", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "PlaceService", "...
200642013_0
class ProductService { public Response validateAndAdd(ProductFormData productData) { if ("".equals(productData.getName())) { return new Response(0, -2, "Missing Name"); } if ("".equals(productData.getType()) ) { return new Response(0, -2, "Missing Type"); } ...
// Arrange ProductFormData productData = new ProductFormData("Sample product", "Lipstick", 5D, 10D, false); FakeDatabase db = new FakeDatabase(); ProductService sut = new ProductService(db); // Act Response response = sut.validateAndAdd(productData); ...
[FOCAL] public Response ProductService.validateAndAdd(ProductFormData productData) [CLASS] class ProductService [METRICS] loc=74 cc=20 branches=19 loops=0 returns=8 throws=0 nesting=3 [CALLS-EXTERNAL] "".equals/1, ProductFormData.getName/0, ProductFormData.getType/0, Product.setType/1, "Eyeshadow".equals/1, "Mascara".e...
/* static context [FOCAL] public Response ProductService.validateAndAdd(ProductFormData productData) [PATH1] if("".equals(productData.getName()))=F -> if("".equals(productData.getType()))=F -> if("Eyeshadow".equals(productData.getType()) || "Mascara".equals(productData.getType()))=T -> if("Eyeshadow".equals(productData...
/* static context [FOCAL] public Response ProductService.validateAndAdd(ProductFormData productData) [PATH1] if("".equals(productData.getName()))=F -> if("".equals(productData.getType()))=F -> if("Eyeshadow".equals(productData.getType()) || "Mascara".equals(productData.getType()))=T -> if("Eyeshadow".equals(productData...
true
ok
{"focal": {"class": "ProductService", "name": "validateAndAdd", "signature": "Response validateAndAdd(ProductFormData productData)", "start_line": 3, "modifiers": "public", "params": [{"name": "productData", "type": "ProductFormData"}], "return_type": "Response"}, "class_info": {"name": "ProductService", "kind": "class...
200725818_0
class OperationCreditTransformer extends OperationTransformer { @Override public OperationResult transform(Transaction transaction) { String error = validateOperation(transaction); if (error != null) { return new OperationResult(false, transaction, null, error); } BigDecimal creditAmount = transaction.g...
String debitCurrency = "USD"; BigDecimal debitAmount = BigDecimal.valueOf(800d); String creditCurrency = "BTC"; BigDecimal askPrice = BigDecimal.valueOf(8222.21d); BigDecimal bidPrice = BigDecimal.valueOf(8219.04d); BigDecimal initialCreditCurrencyBalance = BigDecimal.valueOf(0.2d); BigDecimal expectedC...
[FOCAL] @Override public OperationResult OperationCreditTransformer.transform(Transaction transaction) [CLASS] class OperationCreditTransformer extends OperationTransformer [METRICS] loc=46 cc=5 branches=4 loops=0 returns=3 throws=0 nesting=2 [CALLS-EXTERNAL] validateOperation/1 (inherited), Transaction.getCreditAmount...
/* static context [FOCAL] @Override public OperationResult OperationCreditTransformer.transform(Transaction transaction) [PATH1] if(error != null)=F -> if(Transaction.Type.EXCHANGE.equals(transaction.getType()))=T -> if(rate == null)=F -> if(rate.getBaseCurrency().equals(transaction.getCreditCurrency()))=T -> return ne...
/* static context [FOCAL] @Override public OperationResult OperationCreditTransformer.transform(Transaction transaction) [PATH1] if(error != null)=F -> if(Transaction.Type.EXCHANGE.equals(transaction.getType()))=T -> if(rate == null)=F -> if(rate.getBaseCurrency().equals(transaction.getCreditCurrency()))=T -> return ne...
true
ok
{"focal": {"class": "OperationCreditTransformer", "name": "transform", "signature": "OperationResult transform(Transaction transaction)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "transaction", "type": "Transaction"}], "return_type": "OperationResult"}, "class_info": {"name": "OperationCred...
200810412_178
class BeekeeperVacuumToolApplication implements ApplicationRunner { @Override public void run(ApplicationArguments args) { log.warn("Do not run this tool at the same time as replicating to the target table!"); if (isDryRun) { log.warn("Dry-run only!"); } try { metastore = clientSupplier...
initialiseApp(); setPartitionedTable("partition1_"); // create hidden directories Files.createTempDirectory(snapshot1Dir, ".hidden1_"); Files.createTempDirectory(snapshot1Dir, "_hidden2_"); // create directories at levels that shouldn't be seen Files.createTempDirectory(tableDir, "snapshot3...
[FOCAL] @Override public void BeekeeperVacuumToolApplication.run(ApplicationArguments args) [CLASS] class BeekeeperVacuumToolApplication implements ApplicationRunner [METRICS] loc=18 cc=4 branches=2 loops=0 returns=0 throws=1 nesting=2 [CALLS-INTERNAL] Set<String> fetchHousekeepingPaths(BeekeeperRepository repository);...
/* static context [FOCAL] @Override public void BeekeeperVacuumToolApplication.run(ApplicationArguments args) [PATH1] if(isDryRun)=T -> try-body throws -> throw new RuntimeException(e) -> if(metastore != null)=T [PATH2] if(isDryRun)=F -> if(metastore != null)=F [INPUTS] branches=clientSupplier | result=- | unused=args ...
/* static context [FOCAL] @Override public void BeekeeperVacuumToolApplication.run(ApplicationArguments args) [PATH1] if(isDryRun)=T -> try-body throws -> throw new RuntimeException(e) -> if(metastore != null)=T [PATH2] if(isDryRun)=F -> if(metastore != null)=F [INPUTS] branches=clientSupplier | result=- | unused=args ...
true
ok
{"focal": {"class": "BeekeeperVacuumToolApplication", "name": "run", "signature": "void run(ApplicationArguments args)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "args", "type": "ApplicationArguments"}], "return_type": "void"}, "class_info": {"name": "BeekeeperVacuumToolApplication", "kind"...
200980523_46
class ListenerRegistrationService { public void gameStateChanged(GameState newState) { Set<Listener> listenersForNewState = recalculateListenersForNewState(newState); this.registerNew(listenersForNewState); } public ListenerRegistrationService(Plugin plugin, PluginManager pluginManager, L...
List<ListenerRegistration> registrations = new ArrayList<>(); registrations.add(newRegistration(GameState.WAITING)); registrations.add(newRegistration(GameState.WAITING)); runTest(listenerRegistrationService -> { listenerRegistrationService.gameStateChanged(GameState.WAITIN...
[FOCAL] public void ListenerRegistrationService.gameStateChanged(GameState newState) [CLASS] class ListenerRegistrationService [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] Set<Listener> recalculateListenersForNewState(GameState newState); void registerNew(Set<Listener> listeners...
/* static context [FOCAL] public void ListenerRegistrationService.gameStateChanged(GameState newState) [CALLS-INTERNAL] Set<Listener> recalculateListenersForNewState(GameState newState); void registerNew(Set<Listener> listenersForNewState) */
/* static context [FOCAL] public void ListenerRegistrationService.gameStateChanged(GameState newState) [CALLS-INTERNAL] Set<Listener> recalculateListenersForNewState(GameState newState); void registerNew(Set<Listener> listenersForNewState) */ class ListenerRegistrationService { public void gameStateChanged(GameSta...
true
ok
{"focal": {"class": "ListenerRegistrationService", "name": "gameStateChanged", "signature": "void gameStateChanged(GameState newState)", "start_line": 3, "modifiers": "public", "params": [{"name": "newState", "type": "GameState"}], "return_type": "void"}, "class_info": {"name": "ListenerRegistrationService", "kind": "c...
201021482_12
class OpenApiScannerSensor implements Sensor { @Override public void describe(SensorDescriptor descriptor) { descriptor.name("OpenAPI Scanner Sensor") .onlyOnFileType(InputFile.Type.MAIN) .onlyOnLanguage(OpenApi.KEY); } public OpenApiScannerSensor(CheckFactory checkFactory, FileLinesContextFa...
activeRules = (new ActiveRulesBuilder()).build(); DefaultSensorDescriptor descriptor = new DefaultSensorDescriptor(); sensor().describe(descriptor); assertThat(descriptor.name()).isEqualTo("OpenAPI Scanner Sensor"); assertThat(descriptor.languages()).containsOnly("openapi"); assertThat(descript...
[FOCAL] @Override public void OpenApiScannerSensor.describe(SensorDescriptor descriptor) [CLASS] class OpenApiScannerSensor implements Sensor [METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] descriptor.name("OpenAPI Scanner Sensor") .onlyOnFileType....onlyOnLanguage/1, descriptor.na...
/* static context [FOCAL] @Override public void OpenApiScannerSensor.describe(SensorDescriptor descriptor) [COLLABORATORS] param descriptor:SensorDescriptor name/1 [CALLS-EXTERNAL] descriptor.name("OpenAPI Scanner Sensor") .onlyOnFileType....onlyOnLanguage/1, descriptor.name("OpenAPI Scanner Sensor").onlyOnFileType/1, ...
/* static context [FOCAL] @Override public void OpenApiScannerSensor.describe(SensorDescriptor descriptor) [COLLABORATORS] param descriptor:SensorDescriptor name/1 [CALLS-EXTERNAL] descriptor.name("OpenAPI Scanner Sensor") .onlyOnFileType....onlyOnLanguage/1, descriptor.name("OpenAPI Scanner Sensor").onlyOnFileType/1, ...
true
ok
{"focal": {"class": "OpenApiScannerSensor", "name": "describe", "signature": "void describe(SensorDescriptor descriptor)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "descriptor", "type": "SensorDescriptor"}], "return_type": "void"}, "class_info": {"name": "OpenApiScannerSensor", "kind": "cla...
201179882_3
class Detail implements Parcelable, ClusterItem { public float getTilt() { return mTilt; } public Detail(String title, String description, LatLng location, float tilt, float bearing); protected Detail(Parcel in); @Override public LatLng getPosition(); public String getDescription();...
assertThat( Math.abs(mDetailUnderTest.getTilt() - mTilt) < MAX_FLOAT_DELTA, is(true)); } }
[FOCAL] public float Detail.getTilt() [CLASS] class Detail implements Parcelable, ClusterItem [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [FIELDS] read=mTilt:float [INPUTS] branches=- | result=mTilt [DATAFLOW] this.mTilt@param->L2 [CLASS-MEMBERS] Detail(String title, String description, LatLng ...
/* static context [FOCAL] public float Detail.getTilt() [INPUTS] branches=- | result=mTilt [FIELDS] read=mTilt:float */
/* static context [FOCAL] public float Detail.getTilt() [INPUTS] branches=- | result=mTilt [FIELDS] read=mTilt:float */ class Detail implements Parcelable, ClusterItem { public float getTilt() { return mTilt; } public Detail(String title, String description, LatLng location, float tilt, float bea...
true
ok
{"focal": {"class": "Detail", "name": "getTilt", "signature": "float getTilt()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "float"}, "class_info": {"name": "Detail", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Parcelable, ClusterItem", "fields": [{"name": "mDetailUnde...
201194795_9
class JavaScriptEngineFactory implements ScriptEngineFactory { @Override public String getLanguageVersion() { return System.getProperty("java.version"); } @Override public String getEngineName(); @Override public String getEngineVersion(); @Override public List<String> getExtensions();...
JavaScriptEngineFactory factory = new JavaScriptEngineFactory(); assertThat(factory.getLanguageVersion()).isEqualTo(System.getProperty("java.version")); } }
[FOCAL] @Override public String JavaScriptEngineFactory.getLanguageVersion() [CLASS] class JavaScriptEngineFactory implements ScriptEngineFactory [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] System.getProperty/1 [CLASS-MEMBERS] String getEngineName(); String getEngineVersion(); ...
/* static context [FOCAL] @Override public String JavaScriptEngineFactory.getLanguageVersion() [CALLS-EXTERNAL] System.getProperty/1 */
/* static context [FOCAL] @Override public String JavaScriptEngineFactory.getLanguageVersion() [CALLS-EXTERNAL] System.getProperty/1 */ class JavaScriptEngineFactory implements ScriptEngineFactory { @Override public String getLanguageVersion() { return System.getProperty("java.version"); } @Ov...
true
ok
{"focal": {"class": "JavaScriptEngineFactory", "name": "getLanguageVersion", "signature": "String getLanguageVersion()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "JavaScriptEngineFactory", "kind": "class", "modifiers": "", "superclass": null, "inte...
201285390_53
class DefaultMQAdminExt extends ClientConfig implements MQAdminExt { @Override public boolean cleanUnusedTopic(String cluster) throws RemotingConnectException, RemotingSendRequestException, RemotingTimeoutException, MQClientException, InterruptedException { return defaultMQAdminExtImpl.cleanUnu...
boolean result = defaultMQAdminExt.cleanUnusedTopic("default-cluster"); assertThat(result).isFalse(); } }
[FOCAL] @Override public boolean DefaultMQAdminExt.cleanUnusedTopic(String cluster) [CLASS] class DefaultMQAdminExt extends ClientConfig implements MQAdminExt [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] DefaultMQAdminExtImpl.cleanUnusedTopicByAddr/1 [FIELDS] read=defaultMQAdmin...
/* static context [FOCAL] @Override public boolean DefaultMQAdminExt.cleanUnusedTopic(String cluster) [INPUTS] branches=- | result=cluster, defaultMQAdminExtImpl [COLLABORATORS] field defaultMQAdminExtImpl:DefaultMQAdminExtImpl cleanUnusedTopicByAddr/1 [FIELDS] read=defaultMQAdminExtImpl:DefaultMQAdminExtImpl */
/* static context [FOCAL] @Override public boolean DefaultMQAdminExt.cleanUnusedTopic(String cluster) [INPUTS] branches=- | result=cluster, defaultMQAdminExtImpl [COLLABORATORS] field defaultMQAdminExtImpl:DefaultMQAdminExtImpl cleanUnusedTopicByAddr/1 [FIELDS] read=defaultMQAdminExtImpl:DefaultMQAdminExtImpl */ class ...
true
ok
{"focal": {"class": "DefaultMQAdminExt", "name": "cleanUnusedTopic", "signature": "boolean cleanUnusedTopic(String cluster) throws RemotingConnectException, RemotingSendRequestException, RemotingTimeoutException, MQClientException, Interrupt...", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "cl...
201347287_2
class ParsedStringPack { @Nullable public String getString(int id) { final String result = strings.get(id); if (result == null) { // String not loaded or doesn't exist. return loadString(id); } else { return result; } } public ParsedStringPack(@NonNull InputStream inputStrea...
String nonexistent = parsedStringPack.getString(EXPECTED_STRINGS.length + 1); assertNull(nonexistent); } }
[FOCAL] @Nullable public String ParsedStringPack.getString(int id) [CLASS] class ParsedStringPack [METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] String loadString(int id) [CALLS-EXTERNAL] strings.get/1 [PATH1] if(result == null)=T -> return loadString(id) [PATH2] if(result == nul...
/* static context [FOCAL] @Nullable public String ParsedStringPack.getString(int id) [PATH1] if(result == null)=T -> return loadString(id) [PATH2] if(result == null)=F -> return result [INPUTS] branches=id | result=id [COLLABORATORS] field strings get/1 [CALLS-INTERNAL] String loadString(int id) [CALLS-EXTERNAL] string...
/* static context [FOCAL] @Nullable public String ParsedStringPack.getString(int id) [PATH1] if(result == null)=T -> return loadString(id) [PATH2] if(result == null)=F -> return result [INPUTS] branches=id | result=id [COLLABORATORS] field strings get/1 [CALLS-INTERNAL] String loadString(int id) [CALLS-EXTERNAL] string...
true
ok
{"focal": {"class": "ParsedStringPack", "name": "getString", "signature": "String getString(int id)", "start_line": 3, "modifiers": "@Nullable public", "params": [{"name": "id", "type": "int"}], "return_type": "String"}, "class_info": {"name": "ParsedStringPack", "kind": "class", "modifiers": "", "superclass": null, "i...
201427469_11
class TwaProviderPicker { public static Action pickProvider(PackageManager pm) { // Setting the Intent Data as seen at // https://cs.android.com/android/platform/superproject/+/fd994cf9ef8207ad03dc3a1d831e9263ddfd4469:packages/apps/PermissionController/src/com/android/packageinstaller/role/model/Br...
installBrowser(BROWSER1); installCustomTabsProvider(CUSTOM_TABS_PROVIDER1); installChrome(CHROME_72_VERSION); installTrustedWebActivityProvider(TWA_PROVIDER2); TwaProviderPicker.Action action = TwaProviderPicker.pickProvider(mPackageManager); assertEquals(TwaProviderPic...
[FOCAL] public static Action TwaProviderPicker.pickProvider(PackageManager pm) [CLASS] class TwaProviderPicker [METRICS] loc=70 cc=10 branches=6 loops=1 returns=3 throws=0 nesting=3 [CALLS-INTERNAL] Map<String, Integer> getLaunchModesForCustomTabsServices(PackageManager pm) [CALLS-EXTERNAL] new Intent() .setAction(Inte...
/* static context [FOCAL] public static Action TwaProviderPicker.pickProvider(PackageManager pm) [PATH1] if(sPackageNameForTesting != null)=T -> if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)=T -> foreach(ResolveInfo possibleProvider : possibleProviders)=T -> switch(launchMode)=case LaunchMode.CUSTOM_TAB -> if(best...
/* static context [FOCAL] public static Action TwaProviderPicker.pickProvider(PackageManager pm) [PATH1] if(sPackageNameForTesting != null)=T -> if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)=T -> foreach(ResolveInfo possibleProvider : possibleProviders)=T -> switch(launchMode)=case LaunchMode.CUSTOM_TAB -> if(best...
true
ok
{"focal": {"class": "TwaProviderPicker", "name": "pickProvider", "signature": "Action pickProvider(PackageManager pm)", "start_line": 3, "modifiers": "public static", "params": [{"name": "pm", "type": "PackageManager"}], "return_type": "Action"}, "class_info": {"name": "TwaProviderPicker", "kind": "class", "modifiers":...
201612522_16
class JShellScriptEngineFactory implements ScriptEngineFactory { @Override public ScriptEngine getScriptEngine() { return new JShellScriptEngine(); } @Override public String getEngineName(); @Override public String getEngineVersion(); @Override public List<String> getExtensions(); ...
JShellScriptEngineFactory factory = new JShellScriptEngineFactory(); assertThat(factory.getScriptEngine() instanceof JShellScriptEngine).isTrue(); } }
[FOCAL] @Override public ScriptEngine JShellScriptEngineFactory.getScriptEngine() [CLASS] class JShellScriptEngineFactory implements ScriptEngineFactory [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] JShellScriptEngine [CLASS-MEMBERS] String getEngineName(); String getEngineVersion(); List<S...
/* static context [FOCAL] @Override public ScriptEngine JShellScriptEngineFactory.getScriptEngine() [NEW] JShellScriptEngine */
/* static context [FOCAL] @Override public ScriptEngine JShellScriptEngineFactory.getScriptEngine() [NEW] JShellScriptEngine */ class JShellScriptEngineFactory implements ScriptEngineFactory { @Override public ScriptEngine getScriptEngine() { return new JShellScriptEngine(); } @Override public...
true
ok
{"focal": {"class": "JShellScriptEngineFactory", "name": "getScriptEngine", "signature": "ScriptEngine getScriptEngine()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "ScriptEngine"}, "class_info": {"name": "JShellScriptEngineFactory", "kind": "class", "modifiers": "", "superclass": n...
201655283_0
class SqlParser { public String Execute(String sql) { this.generateStatements(sql); return parseStatements(); } private void generateStatements(String str); private String parseStatements(); private String getModelName(MySqlCreateTableStatement createTable); public void setStat...
String sql = "CREATE DATABASE IF NOT EXISTS demo_db;\n" + "\n" + "CREATE TABLE IF NOT EXISTS `demo`.`test_tab` (\n" + " `id` bigint(21) unsigned NOT NULL AUTO_INCREMENT,\n" + " user_id int(11) unsigned DEFAULT 0 NOT NULL,\n" + " ...
[FOCAL] public String SqlParser.Execute(String sql) [CLASS] class SqlParser [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String parseStatements(); void generateStatements(String str) [DATAFLOW] sql@param->L2 [CLASS-MEMBERS] void generateStatements(String str); String parseStatem...
/* static context [FOCAL] public String SqlParser.Execute(String sql) [CALLS-INTERNAL] String parseStatements(); void generateStatements(String str) */
/* static context [FOCAL] public String SqlParser.Execute(String sql) [CALLS-INTERNAL] String parseStatements(); void generateStatements(String str) */ class SqlParser { public String Execute(String sql) { this.generateStatements(sql); return parseStatements(); } private void generateState...
true
ok
{"focal": {"class": "SqlParser", "name": "Execute", "signature": "String Execute(String sql)", "start_line": 3, "modifiers": "public", "params": [{"name": "sql", "type": "String"}], "return_type": "String"}, "class_info": {"name": "SqlParser", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "f...
202089894_59
class EncryptionUtils { public static AsymmetricKeyPair initAsymmetricKeyPair() { return RSACoder.initKey(); } public static byte[] encryptByPrivateKey(byte[] data, byte[] key); public static String encryptByPrivateKeyAsString(byte[] data, String sKey); public static byte[] encryptByPublic...
AsymmetricKeyPair keyPair = EncryptionUtils.initAsymmetricKeyPair(); Assert.assertNotNull(keyPair); log.info("privateKey:{}", keyPair.getPrivateKey()); log.info("publicKey:{}", keyPair.getPublicKey()); } }
[FOCAL] public static AsymmetricKeyPair EncryptionUtils.initAsymmetricKeyPair() [CLASS] class EncryptionUtils [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] RSACoder.initKey/0 [CLASS-MEMBERS] byte[] encryptByPrivateKey(byte[] data, byte[] key); String encryptByPrivateKeyAsString(b...
/* static context [FOCAL] public static AsymmetricKeyPair EncryptionUtils.initAsymmetricKeyPair() [CALLS-EXTERNAL] RSACoder.initKey/0 */
/* static context [FOCAL] public static AsymmetricKeyPair EncryptionUtils.initAsymmetricKeyPair() [CALLS-EXTERNAL] RSACoder.initKey/0 */ class EncryptionUtils { public static AsymmetricKeyPair initAsymmetricKeyPair() { return RSACoder.initKey(); } public static byte[] encryptByPrivateKey(byte[] da...
true
ok
{"focal": {"class": "EncryptionUtils", "name": "initAsymmetricKeyPair", "signature": "AsymmetricKeyPair initAsymmetricKeyPair()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "AsymmetricKeyPair"}, "class_info": {"name": "EncryptionUtils", "kind": "class", "modifiers": "", "superclass": nu...
202309300_0
class JWTHelper { public static String createSignedJwt(String user, PrivateKey privateKey) throws Exception { Calendar c = Calendar.getInstance(); c.add(Calendar.MINUTE, 1); Date d = c.getTime(); return createSignedJwt(user, d.getTime() / 1000, privateKey); } public static String createSignedJwt(String us...
long future = 1562389592; KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA"); keyGen.initialize(4096, new SecureRandom(new byte[] { 1, 2, 4} )); KeyPair pair = keyGen.generateKeyPair(); PrivateKey priv = pair.getPrivate(); PublicKey pub = pair.getPublic(); System.out.println("Priva...
[FOCAL] public static String JWTHelper.createSignedJwt(String user, PrivateKey privateKey) [CLASS] class JWTHelper [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String createSignedJwt(String user, long expiration, PrivateKey privateKey) [CALLS-EXTERNAL] Calendar.getInstance/0, Ca...
/* static context [FOCAL] public static String JWTHelper.createSignedJwt(String user, PrivateKey privateKey) [INPUTS] branches=- | result=privateKey, user [EXCEPTIONS] declares Exception [CALLS-INTERNAL] String createSignedJwt(String user, long expiration, PrivateKey privateKey) [CALLS-EXTERNAL] Calendar.getInstance/0,...
/* static context [FOCAL] public static String JWTHelper.createSignedJwt(String user, PrivateKey privateKey) [INPUTS] branches=- | result=privateKey, user [EXCEPTIONS] declares Exception [CALLS-INTERNAL] String createSignedJwt(String user, long expiration, PrivateKey privateKey) [CALLS-EXTERNAL] Calendar.getInstance/0,...
true
ok
{"focal": {"class": "JWTHelper", "name": "createSignedJwt", "signature": "String createSignedJwt(String user, PrivateKey privateKey) throws Exception", "start_line": 3, "modifiers": "public static", "params": [{"name": "user", "type": "String"}, {"name": "privateKey", "type": "PrivateKey"}], "return_type": "String"}, "...
202361279_89
class DateTimeHandler { public static void parse(Prefix prefix, QueryParameterValue parameterValue, String v) throws FHIRSearchException { TemporalAccessor value = parse(v); parameterValue.setValueDateLowerBound(generateLowerBound(prefix, value, v)); parameterValue.setValueDateUpperBound(ge...
TemporalAccessor acc = DateTimeHandler.parse("2019-10-11T01:10:00.000002"); assertNotNull(acc); assertTrue(acc.isSupported(ChronoField.YEAR)); assertEquals(acc.getLong(ChronoField.YEAR), 2019); assertTrue(acc.isSupported(ChronoField.MONTH_OF_YEAR)); assertEquals(acc.getLo...
[FOCAL] public static void DateTimeHandler.parse(Prefix prefix, QueryParameterValue parameterValue, String v) [CLASS] class DateTimeHandler [METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] Instant generateLowerBound(Prefix prefix, TemporalAccessor value, String originalString); Inst...
class DateTimeHandler { public static void parse(Prefix prefix, QueryParameterValue parameterValue, String v) throws FHIRSearchException { TemporalAccessor value = parse(v); parameterValue.setValueDateLowerBound(generateLowerBound(prefix, value, v)); parameterValue.setValueDateUpperBound(ge...
false
ok
{"focal": {"class": "DateTimeHandler", "name": "parse", "signature": "void parse(Prefix prefix, QueryParameterValue parameterValue, String v) throws FHIRSearchException", "start_line": 3, "modifiers": "public static", "params": [{"name": "prefix", "type": "Prefix"}, {"name": "parameterValue", "type": "QueryParameterVal...
202482196_66
class ServiceProvider { public static <T> T loadClass(String name, Class<?> clazz) { final InputStream is = getResourceAsStream(getContextClassLoader(), name); BufferedReader reader; try { try { reader = new BufferedReader(new InputStreamReader(is, "UTF-8")); ...
AbstractTransactionalMessageCheckListener listener = ServiceProvider.loadClass(ServiceProvider.TRANSACTION_LISTENER_ID, AbstractTransactionalMessageCheckListener.class); assertThat(listener).isNotNull(); } }
[FOCAL] public static T ServiceProvider.loadClass(String name, Class<?> clazz) [CLASS] class ServiceProvider [METRICS] loc=22 cc=4 branches=1 loops=0 returns=3 throws=0 nesting=2 [CALLS-INTERNAL] ClassLoader getContextClassLoader(); InputStream getResourceAsStream(ClassLoader loader, String name); T initService(ClassLo...
/* static context [FOCAL] public static T ServiceProvider.loadClass(String name, Class<?> clazz) [PATH1] try-body throws -> if(serviceName != null && !"".equals(serviceName))=T -> return initService(getContextClassLoader(), serviceName, clazz) [PATH2] if(serviceName != null && !"".equals(serviceName))=F -> return null ...
/* static context [FOCAL] public static T ServiceProvider.loadClass(String name, Class<?> clazz) [PATH1] try-body throws -> if(serviceName != null && !"".equals(serviceName))=T -> return initService(getContextClassLoader(), serviceName, clazz) [PATH2] if(serviceName != null && !"".equals(serviceName))=F -> return null ...
true
ok
{"focal": {"class": "ServiceProvider", "name": "loadClass", "signature": "T loadClass(String name, Class<?> clazz)", "start_line": 3, "modifiers": "public static", "params": [{"name": "name", "type": "String"}, {"name": "clazz", "type": "Class<?>"}], "return_type": "T"}, "class_info": {"name": "ServiceProvider", "kind"...
202672490_1031
class NetworkBufferPool implements BufferPoolFactory, MemorySegmentProvider { public void destroy() { synchronized (factoryLock) { isDestroyed = true; MemorySegment segment; while ((segment = availableMemorySegments.poll()) != null) { segment.free(); } } } @VisibleForTesting public NetworkBuf...
// the number of requested buffers should be larger than zero NetworkBufferPool globalPool = new NetworkBufferPool(10, 128, 0); globalPool.destroy(); fail("Should throw an IllegalArgumentException"); } }
[FOCAL] public void NetworkBufferPool.destroy() [CLASS] class NetworkBufferPool implements BufferPoolFactory, MemorySegmentProvider [METRICS] loc=10 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=2 [CALLS-EXTERNAL] availableMemorySegments.poll/0, MemorySegment.free/0 [PATH1] while((segment = availableMemorySegments...
/* static context [FOCAL] public void NetworkBufferPool.destroy() [PATH1] while((segment = availableMemorySegments.poll()) != null)=T -> exit loop [PATH2] while((segment = availableMemorySegments.poll()) != null)=F [COLLABORATORS] field availableMemorySegments poll/0 [CALLS-EXTERNAL] availableMemorySegments.poll/0, Mem...
/* static context [FOCAL] public void NetworkBufferPool.destroy() [PATH1] while((segment = availableMemorySegments.poll()) != null)=T -> exit loop [PATH2] while((segment = availableMemorySegments.poll()) != null)=F [COLLABORATORS] field availableMemorySegments poll/0 [CALLS-EXTERNAL] availableMemorySegments.poll/0, Mem...
true
ok
{"focal": {"class": "NetworkBufferPool", "name": "destroy", "signature": "void destroy()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "NetworkBufferPool", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "BufferPoolFactory, MemorySegmentProvid...
202839292_117
class SchemaUpdate implements UpdateSchema { @Override public UpdateSchema addColumn(String name, Type type, String doc) { Preconditions.checkArgument(!name.contains("."), "Cannot add column with ambiguous name: %s, use addColumn(parent, name, type)", name); return addColumn(null, name, type, doc);...
// preferences.booleans could be top-level or a field of preferences AssertHelpers.assertThrows("Should reject ambiguous column name", IllegalArgumentException.class, "ambiguous name: preferences.booleans", () -> { UpdateSchema update = new SchemaUpdate(SCHEMA, SCHEMA_LAST_COLUMN_ID); ...
[FOCAL] @Override public UpdateSchema SchemaUpdate.addColumn(String name, Type type, String doc) [CLASS] class SchemaUpdate implements UpdateSchema [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] UpdateSchema addColumn(String parent, String name, Type type, String doc) [CALLS-EXTER...
/* static context [FOCAL] @Override public UpdateSchema SchemaUpdate.addColumn(String name, Type type, String doc) [INPUTS] branches=- | result=doc, name, type [CALLS-INTERNAL] UpdateSchema addColumn(String parent, String name, Type type, String doc) [CALLS-EXTERNAL] Preconditions.checkArgument/3, String.contains/1 */
/* static context [FOCAL] @Override public UpdateSchema SchemaUpdate.addColumn(String name, Type type, String doc) [INPUTS] branches=- | result=doc, name, type [CALLS-INTERNAL] UpdateSchema addColumn(String parent, String name, Type type, String doc) [CALLS-EXTERNAL] Preconditions.checkArgument/3, String.contains/1 */ ...
true
ok
{"focal": {"class": "SchemaUpdate", "name": "addColumn", "signature": "UpdateSchema addColumn(String name, Type type, String doc)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "name", "type": "String"}, {"name": "type", "type": "Type"}, {"name": "doc", "type": "String"}], "return_type": "Updat...
203381991_31
class PacketBufferWrapper implements Comparable<PacketBufferWrapper> { public void setSize(final int size) { if (DEBUG >= LOG_TRACE) { log.trace("Writing packet size field @ 0x{} + {}.", leftPad(virtualAddress), PKT_OFFSET); } mmanager.putIntVolatile(virtualAddress + PKT_OFFSET, size); } @Contract(pure = ...
assume(); val offset = PacketBufferWrapperConstants.HEADER_OFFSET + PacketBufferWrapperConstants.PKT_OFFSET; for (val virtual : virtuals) { assertThat(virtual).isNotZero(); val packet = new PacketBufferWrapper(virtual); val size = random.nextInt(); packet.setSize(size); assertThat(mmanager.getIntVo...
[FOCAL] public void PacketBufferWrapper.setSize(int size) [CLASS] class PacketBufferWrapper implements Comparable<PacketBufferWrapper> [METRICS] loc=6 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] log.trace/3, leftPad/1 (inherited), MemoryManager.putIntVolatile/2 [FIELDS] read=mmanager:MemoryMan...
/* static context [FOCAL] public void PacketBufferWrapper.setSize(int size) [PATH1] if(DEBUG >= LOG_TRACE)=T [PATH2] if(DEBUG >= LOG_TRACE)=F [COLLABORATORS] field mmanager:MemoryManager putIntVolatile/2 [FIELDS] read=mmanager:MemoryManager [CALLS-EXTERNAL] log.trace/3, leftPad/1 (inherited), MemoryManager.putIntVolati...
/* static context [FOCAL] public void PacketBufferWrapper.setSize(int size) [PATH1] if(DEBUG >= LOG_TRACE)=T [PATH2] if(DEBUG >= LOG_TRACE)=F [COLLABORATORS] field mmanager:MemoryManager putIntVolatile/2 [FIELDS] read=mmanager:MemoryManager [CALLS-EXTERNAL] log.trace/3, leftPad/1 (inherited), MemoryManager.putIntVolati...
true
ok
{"focal": {"class": "PacketBufferWrapper", "name": "setSize", "signature": "void setSize(int size)", "start_line": 3, "modifiers": "public", "params": [{"name": "size", "type": "int"}], "return_type": "void"}, "class_info": {"name": "PacketBufferWrapper", "kind": "class", "modifiers": "", "superclass": null, "interface...
203595784_93
class CliChangeScopeResolver extends JGitChangeScopeResolver implements ChangeScopeResolver { @Override public ChangeScope<Change> getChangeScope(RevisionScope<ObjectId> revisionScope) throws SourceControlException { final ChangeScope<Change> scope = new ChangeScopeImpl(); List<Diff> diffs = Gi...
mockStatic(GitDiffRunner.class); Diff diff = getChangeScopeDeletedFile(); when(GitDiffRunner.diff(any(), any())).thenReturn(singletonList(diff)); RevisionScope<ObjectId> scope = revisionResolver.resolve("fc776fe5e50", "e6f7c3d2954d6"); ChangeScope<Change> changeScope = changeS...
[FOCAL] @Override public ChangeScope<Change> CliChangeScopeResolver.getChangeScope(RevisionScope<ObjectId> revisionScope) [CLASS] class CliChangeScopeResolver extends JGitChangeScopeResolver implements ChangeScopeResolver [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Consumer<T> ...
/* static context [FOCAL] @Override public ChangeScope<Change> CliChangeScopeResolver.getChangeScope(RevisionScope<ObjectId> revisionScope) [COLLABORATORS] param revisionScope:RevisionScope<ObjectId> getTo/0 [EXCEPTIONS] declares SourceControlException [CALLS-INTERNAL] Consumer<T> throwingConsumerWrapper(ThrowingConsum...
/* static context [FOCAL] @Override public ChangeScope<Change> CliChangeScopeResolver.getChangeScope(RevisionScope<ObjectId> revisionScope) [COLLABORATORS] param revisionScope:RevisionScope<ObjectId> getTo/0 [EXCEPTIONS] declares SourceControlException [CALLS-INTERNAL] Consumer<T> throwingConsumerWrapper(ThrowingConsum...
true
ok
{"focal": {"class": "CliChangeScopeResolver", "name": "getChangeScope", "signature": "ChangeScope<Change> getChangeScope(RevisionScope<ObjectId> revisionScope) throws SourceControlException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "revisionScope", "type": "RevisionScope<ObjectId>"}], "ret...
203830892_17
class FloatComparisonStep implements ComparisonStep<T> { @Override public boolean isEqual(T object1, T object2) { float value1 = valueExtractor.applyAsFloat(object1); float value2 = valueExtractor.applyAsFloat(object2); return floatToIntBits(value1) == floatToIntBits(value2); } ...
FloatComparisonStep<TestData> hashStep = new FloatComparisonStep<>(TestData::getValue); boolean result = hashStep.isEqual(new TestData(1234.0f), new TestData(1337.0f)); assertThat(result) .isFalse(); } }
[FOCAL] @Override public boolean FloatComparisonStep.isEqual(T object1, T object2) [CLASS] class FloatComparisonStep implements ComparisonStep<T> [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] valueExtractor.applyAsFloat/1, floatToIntBits/1 (inherited) [INPUTS] branches=- | result...
/* static context [FOCAL] @Override public boolean FloatComparisonStep.isEqual(T object1, T object2) [INPUTS] branches=- | result=object1, object2 [COLLABORATORS] field valueExtractor applyAsFloat/1 [CALLS-EXTERNAL] valueExtractor.applyAsFloat/1, floatToIntBits/1 (inherited) */
/* static context [FOCAL] @Override public boolean FloatComparisonStep.isEqual(T object1, T object2) [INPUTS] branches=- | result=object1, object2 [COLLABORATORS] field valueExtractor applyAsFloat/1 [CALLS-EXTERNAL] valueExtractor.applyAsFloat/1, floatToIntBits/1 (inherited) */ class FloatComparisonStep implements Comp...
true
ok
{"focal": {"class": "FloatComparisonStep", "name": "isEqual", "signature": "boolean isEqual(T object1, T object2)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "object1", "type": "T"}, {"name": "object2", "type": "T"}], "return_type": "boolean"}, "class_info": {"name": "FloatComparisonStep", "...
203954530_0
class Result implements Serializable { public <R> Result<R> ifSuccess(Function<T, ? extends Result<R>> function) { if (success()) { return function.apply(data); } return Result.fail(BaseResultCode.SYSTEM_ERROR); } public Result(); protected Result(T data); pro...
Result.ok(Arrays.asList("a", "b", "c")) .ifNotSuccessThrowException() .ifSuccess(data -> { data.forEach(d -> System.out.println(d)); return Result.ok(data); }) .ifSuccess(data -> { data.fo...
[FOCAL] public Result<R> Result.ifSuccess(Function<T, ? extends Result<R>> function) [CLASS] class Result implements Serializable [METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] boolean success() [CALLS-EXTERNAL] Function<T, ? extends Result<R>>.apply/1, Result.fail/1 [PATH1] if(su...
/* static context [FOCAL] public Result<R> Result.ifSuccess(Function<T, ? extends Result<R>> function) [PATH1] if(success())=T -> return function.apply(data) [PATH2] if(success())=F -> return Result.fail(BaseResultCode.SYSTEM_ERROR) [INPUTS] branches=- | result=function [COLLABORATORS] param function:Function<T, ? exte...
/* static context [FOCAL] public Result<R> Result.ifSuccess(Function<T, ? extends Result<R>> function) [PATH1] if(success())=T -> return function.apply(data) [PATH2] if(success())=F -> return Result.fail(BaseResultCode.SYSTEM_ERROR) [INPUTS] branches=- | result=function [COLLABORATORS] param function:Function<T, ? exte...
true
ok
{"focal": {"class": "Result", "name": "ifSuccess", "signature": "Result<R> ifSuccess(Function<T, ? extends Result<R>> function)", "start_line": 3, "modifiers": "public", "params": [{"name": "function", "type": "Function<T, ? extends Result<R>>"}], "return_type": "Result<R>"}, "class_info": {"name": "Result", "kind": "c...
203966607_9
class VersionNumber { public String compareTo(VersionNumber latestVersion) { if (versionNumberArray != null) { // Calculate max length of version number int maxLength = Math.max(versionNumberArray.length, latestVersion.versionNumberArray.length); for (int i = 0; i < maxL...
String current = "BETA-SNAPSHOT"; String latest = "20200422"; VersionNumber currentVersion = new VersionNumber(current); VersionNumber latestVersion = new VersionNumber(latest); String receivedValue = currentVersion.compareTo(latestVersion); assertThat(receivedValue).i...
[FOCAL] public String VersionNumber.compareTo(VersionNumber latestVersion) [CLASS] class VersionNumber [METRICS] loc=20 cc=4 branches=2 loops=1 returns=3 throws=0 nesting=3 [CALLS-EXTERNAL] Math.max/2, VersionStatus.OUTDATED.toString/0, VersionStatus.AHEAD.toString/0, VersionStatus.UP_TO_DATE.toString/0 [PATH1] if(vers...
/* static context [FOCAL] public String VersionNumber.compareTo(VersionNumber latestVersion) [PATH1] if(versionNumberArray != null)=T -> for(i < maxLength)=T -> if(left != right)=F -> exit loop -> return VersionStatus.UP_TO_DATE.toString() [PATH2] if(versionNumberArray != null)=F -> return "Nothing to compare" [PATH3] ...
/* static context [FOCAL] public String VersionNumber.compareTo(VersionNumber latestVersion) [PATH1] if(versionNumberArray != null)=T -> for(i < maxLength)=T -> if(left != right)=F -> exit loop -> return VersionStatus.UP_TO_DATE.toString() [PATH2] if(versionNumberArray != null)=F -> return "Nothing to compare" [PATH3] ...
true
ok
{"focal": {"class": "VersionNumber", "name": "compareTo", "signature": "String compareTo(VersionNumber latestVersion)", "start_line": 3, "modifiers": "public", "params": [{"name": "latestVersion", "type": "VersionNumber"}], "return_type": "String"}, "class_info": {"name": "VersionNumber", "kind": "class", "modifiers": ...
204463745_46
class TransactionAspect { @Around("execution(@org.apache.servicecomb.saga.omega.transaction.annotations.Compensable * *(..)) && @annotation(compensable)") Object advise(ProceedingJoinPoint joinPoint, Compensable compensable) throws Throwable { Method method = ((MethodSignature) joinPoint.getSignature()).getMet...
aspect.advise(joinPoint, compensable); TxEvent startedEvent = messages.get(0); assertThat(startedEvent.globalTxId(), is(globalTxId)); assertThat(startedEvent.localTxId(), is(newLocalTxId)); assertThat(startedEvent.parentTxId(), is(localTxId)); assertThat(startedEvent.type(), is(EventType.TxSta...
[FOCAL] @Around("execution(@org.apache.servicecomb.saga.omega.transaction.annotations.Compensable * *(..)) && @annotation(com... Object TransactionAspect.advise(ProceedingJoinPoint joinPoint, Compensable compensable) [CLASS] class TransactionAspect [METRICS] loc=18 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [...
/* static context [FOCAL] @Around("execution(@org.apache.servicecomb.saga.omega.transaction.annotations.Compensable * *(..)) && @annotation(com... Object TransactionAspect.advise(ProceedingJoinPoint joinPoint, Compensable compensable) [THROWS-WHEN] e when try-body throws [PATH1] try-body throws -> throw e [PATH2] retur...
/* static context [FOCAL] @Around("execution(@org.apache.servicecomb.saga.omega.transaction.annotations.Compensable * *(..)) && @annotation(com... Object TransactionAspect.advise(ProceedingJoinPoint joinPoint, Compensable compensable) [THROWS-WHEN] e when try-body throws [PATH1] try-body throws -> throw e [PATH2] retur...
true
ok
{"focal": {"class": "TransactionAspect", "name": "advise", "signature": "Object advise(ProceedingJoinPoint joinPoint, Compensable compensable) throws Throwable", "start_line": 3, "modifiers": "@Around(\"execution(@org.apache.servicecomb.saga.omega.transaction.annotations.Compensable * *(..)) && @annotation(com...", "pa...
204591382_0
class TableExportService implements ITableExportService { @Override public String exportMarkdown(String dbName, List<String> tableList) { StringBuilder markdownBuilder = new StringBuilder(); for (String table : tableList) { TableInfo tableInfo = treeService.oneTable(dbName, table); ...
List<ColumnInfo> columnInfoList1 = new ArrayList<>(); ColumnInfo columnInfo11 = new ColumnInfo(); columnInfo11.setColumnName("id"); columnInfo11.setColumnType("int(11)"); columnInfo11.setAutoIncrement(1); columnInfo11.setNullable("NO"); columnInfo11.setPrimaryKey(...
[FOCAL] @Override public String TableExportService.exportMarkdown(String dbName, List<String> tableList) [CLASS] class TableExportService implements ITableExportService [METRICS] loc=24 cc=3 branches=0 loops=2 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] ITreeService.oneTable/2, ITreeService.columnList/2, markdownBuil...
/* static context [FOCAL] @Override public String TableExportService.exportMarkdown(String dbName, List<String> tableList) [PATH1] foreach(String table : tableList)=T -> for(i < columnInfoList.size())=F -> exit loop -> return markdownBuilder.toString() [PATH2] foreach(String table : tableList)=F -> return markdownBuild...
/* static context [FOCAL] @Override public String TableExportService.exportMarkdown(String dbName, List<String> tableList) [PATH1] foreach(String table : tableList)=T -> for(i < columnInfoList.size())=F -> exit loop -> return markdownBuilder.toString() [PATH2] foreach(String table : tableList)=F -> return markdownBuild...
true
ok
{"focal": {"class": "TableExportService", "name": "exportMarkdown", "signature": "String exportMarkdown(String dbName, List<String> tableList)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "dbName", "type": "String"}, {"name": "tableList", "type": "List<String>"}], "return_type": "String"}, "c...
205042001_2
class ExecutorBizImpl implements ExecutorBiz { @Override public ReturnT<String> beat() { return ReturnT.SUCCESS; } @Override public ReturnT<String> idleBeat(int jobId); @Override public ReturnT<String> kill(int jobId); @Override public ReturnT<LogResult> log(long logDateTim, long logId...
// Act final ReturnT<String> retval = executorBiz.beat(); // Assert result Assert.assertNotNull(retval); Assert.assertNull(((ReturnT<String>) retval).getContent()); Assert.assertEquals(200, retval.getCode()); Assert.assertNull(retval.getMsg()); } }
[FOCAL] @Override public ReturnT<String> ExecutorBizImpl.beat() [CLASS] class ExecutorBizImpl implements ExecutorBiz [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] ReturnT<String> idleBeat(int jobId); ReturnT<String> kill(int jobId); ReturnT<LogResult> log(long logDateTim, long log...
/* static context [FOCAL] @Override public ReturnT<String> ExecutorBizImpl.beat() */
/* static context [FOCAL] @Override public ReturnT<String> ExecutorBizImpl.beat() */ class ExecutorBizImpl implements ExecutorBiz { @Override public ReturnT<String> beat() { return ReturnT.SUCCESS; } @Override public ReturnT<String> idleBeat(int jobId); @Override public ReturnT<String> kil...
true
ok
{"focal": {"class": "ExecutorBizImpl", "name": "beat", "signature": "ReturnT<String> beat()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "ReturnT<String>"}, "class_info": {"name": "ExecutorBizImpl", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "ExecutorBiz", "f...
205116498_415
class AbstractConfig implements Serializable { protected void appendAnnotation(Class<?> annotationClass, Object annotation) { Method[] methods = annotationClass.getMethods(); for (Method method : methods) { if (method.getDeclaringClass() != Object.class && method.get...
parameters = {"k1", "v1", "k2", "v2"}) public void appendAnnotation() throws Exception { Config config = getClass().getMethod("appendAnnotation").getAnnotation(Config.class); AnnotationConfig annotationConfig = new AnnotationConfig(); annotationConfig.appendAnnotation(Config.clas...
[FOCAL] protected void AbstractConfig.appendAnnotation(Class<?> annotationClass, Object annotation) [CLASS] class AbstractConfig implements Serializable [METRICS] loc=37 cc=9 branches=5 loops=1 returns=0 throws=0 nesting=6 [CALLS-EXTERNAL] Class<?>.getMethods/0, Method.getDeclaringClass/0, Method.getReturnType/0, Metho...
/* static context [FOCAL] protected void AbstractConfig.appendAnnotation(Class<?> annotationClass, Object annotation) [PATH1] foreach(Method method : methods)=T -> if((method.getDeclaringClass() != Object.class && method.getReturnType() != void.class && method.getParameterTypes().len...)=T -> if("interfaceClass".equals...
/* static context [FOCAL] protected void AbstractConfig.appendAnnotation(Class<?> annotationClass, Object annotation) [PATH1] foreach(Method method : methods)=T -> if((method.getDeclaringClass() != Object.class && method.getReturnType() != void.class && method.getParameterTypes().len...)=T -> if("interfaceClass".equals...
true
ok
{"focal": {"class": "AbstractConfig", "name": "appendAnnotation", "signature": "void appendAnnotation(Class<?> annotationClass, Object annotation)", "start_line": 3, "modifiers": "protected", "params": [{"name": "annotationClass", "type": "Class<?>"}, {"name": "annotation", "type": "Object"}], "return_type": "void"}, "...
205517727_0
class JabelExample { public String run(String[] args) { // Switch Expressions // https://openjdk.java.net/jeps/325 var result = switch (args.length) { case 1 -> { yield """ one... yet pretty long! """; ...
JabelExample jabelExample = new JabelExample(); String result = jabelExample.run(new String[0]); assertTrue("'" + result + "' should start with 'idk '", result.startsWith("idk ")); } }
[FOCAL] public String JabelExample.run(String[] args) [CLASS] class JabelExample [METRICS] loc=15 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] new JabelExample().new Inner().innerPublic/0 [NEW] Inner, JabelExample [INPUTS] branches=- | result=args [DATAFLOW] args@param->L4; result@L4->L14 [CLAS...
/* static context [FOCAL] public String JabelExample.run(String[] args) [INPUTS] branches=- | result=args [NEW] Inner, JabelExample [CALLS-EXTERNAL] new JabelExample().new Inner().innerPublic/0 */
/* static context [FOCAL] public String JabelExample.run(String[] args) [INPUTS] branches=- | result=args [NEW] Inner, JabelExample [CALLS-EXTERNAL] new JabelExample().new Inner().innerPublic/0 */ class JabelExample { public String run(String[] args) { // Switch Expressions // https://openjdk.java.net/...
true
ok
{"focal": {"class": "JabelExample", "name": "run", "signature": "String run(String[] args)", "start_line": 3, "modifiers": "public", "params": [{"name": "args", "type": "String[]"}], "return_type": "String"}, "class_info": {"name": "JabelExample", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null...
205635067_6
class AutoComplete { public Set<String> hint(String prefix, long count) { String key = "auto_complete:" + prefix; return client.zrevrange(key, 0, count - 1); } public AutoComplete(); public void feed(String keyword, double weight); } class AutoCompleteTest { @Test public v...
AutoComplete ac = new AutoComplete(); ac.feed("张艺兴", 5000); ac.feed("张艺谋", 3000); ac.feed("张三", 500); assertEquals(ac.hint("张", 10), new LinkedHashSet<String>() {{ add("张艺兴"); add("张艺谋"); add("张三"); ...
[FOCAL] public Set<String> AutoComplete.hint(String prefix, long count) [CLASS] class AutoComplete [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] client.zrevrange/3 [INPUTS] branches=- | result=count, prefix [COLLABORATORS] field client zrevrange/3 [DATAFLOW] count@param->L3; key@...
/* static context [FOCAL] public Set<String> AutoComplete.hint(String prefix, long count) [INPUTS] branches=- | result=count, prefix [COLLABORATORS] field client zrevrange/3 [CALLS-EXTERNAL] client.zrevrange/3 */
/* static context [FOCAL] public Set<String> AutoComplete.hint(String prefix, long count) [INPUTS] branches=- | result=count, prefix [COLLABORATORS] field client zrevrange/3 [CALLS-EXTERNAL] client.zrevrange/3 */ class AutoComplete { public Set<String> hint(String prefix, long count) { String key = "auto_c...
true
ok
{"focal": {"class": "AutoComplete", "name": "hint", "signature": "Set<String> hint(String prefix, long count)", "start_line": 3, "modifiers": "public", "params": [{"name": "prefix", "type": "String"}, {"name": "count", "type": "long"}], "return_type": "Set<String>"}, "class_info": {"name": "AutoComplete", "kind": "clas...
205733669_7
class FastMath { public static float asin(float fValue) { if (-1.0f < fValue) { if (fValue < 1.0f) { return (float) Math.asin(fValue); } return HALF_PI; } return -HALF_PI; } private FastMath(); public static boolean isPowe...
final float HALF_PI = 0.5f * (float)Math.PI; assertEquals(-HALF_PI, FastMath.asin(-2.0f), 0.01f); assertEquals(HALF_PI, FastMath.asin(2.0f), 0.01f); assertEquals(HALF_PI, FastMath.asin(Float.POSITIVE_INFINITY), 0.0f); assertEquals(0.0f, FastMath.asin(0.0f), 0.0f); assert...
[FOCAL] public static float FastMath.asin(float fValue) [CLASS] class FastMath [METRICS] loc=11 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=2 [CALLS-EXTERNAL] Math.asin/1 [PATH1] if(-1.0f < fValue)=T -> if(fValue < 1.0f)=T -> return (float) Math.asin(fValue) [PATH2] if(-1.0f < fValue)=F -> return -HALF_PI [PATH3...
/* static context [FOCAL] public static float FastMath.asin(float fValue) [PATH1] if(-1.0f < fValue)=T -> if(fValue < 1.0f)=T -> return (float) Math.asin(fValue) [PATH2] if(-1.0f < fValue)=F -> return -HALF_PI [PATH3] if(-1.0f < fValue)=T -> if(fValue < 1.0f)=F -> return HALF_PI [INPUTS] branches=fValue | result=fValue...
/* static context [FOCAL] public static float FastMath.asin(float fValue) [PATH1] if(-1.0f < fValue)=T -> if(fValue < 1.0f)=T -> return (float) Math.asin(fValue) [PATH2] if(-1.0f < fValue)=F -> return -HALF_PI [PATH3] if(-1.0f < fValue)=T -> if(fValue < 1.0f)=F -> return HALF_PI [INPUTS] branches=fValue | result=fValue...
true
ok
{"focal": {"class": "FastMath", "name": "asin", "signature": "float asin(float fValue)", "start_line": 3, "modifiers": "public static", "params": [{"name": "fValue", "type": "float"}], "return_type": "float"}, "class_info": {"name": "FastMath", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "...
205759200_0
class SideKEK extends Provider { static String getRandomAlphanumericString(int length) { if (length <= 0) { return ""; } // TODO request fewer bytes byte[] bytes = getRandomBytes(length); // Generate unique name from alphabet [-_a-zA-Z0-9] byte[] encodedBytes = Base64.getUrlEncoder().withoutPaddi...
for (int i = 0; i < 100; i++) { for (int j = 0; j < 10; j++) { String str = SideKEK.getRandomAlphanumericString(i); for (int x = 0; x < str.length(); x++) { assertEquals("Size is not the expected value", i, str.length()); char c = str.charAt(x); if (((c >= 'a') && (c <= 'z')) || ...
[FOCAL] static String SideKEK.getRandomAlphanumericString(int length) [CLASS] class SideKEK extends Provider [METRICS] loc=13 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] byte[] getRandomBytes(int numBytes) [CALLS-EXTERNAL] Base64.getUrlEncoder().withoutPadding().encode/1, Base64.getUrlEncoder(...
/* static context [FOCAL] static String SideKEK.getRandomAlphanumericString(int length) [PATH1] if(length <= 0)=T -> return "" [PATH2] if(length <= 0)=F -> return new String(encodedBytes, 0, length) [INPUTS] branches=length | result=length [CALLS-INTERNAL] byte[] getRandomBytes(int numBytes) [NEW] String [CALLS-EXTERNA...
/* static context [FOCAL] static String SideKEK.getRandomAlphanumericString(int length) [PATH1] if(length <= 0)=T -> return "" [PATH2] if(length <= 0)=F -> return new String(encodedBytes, 0, length) [INPUTS] branches=length | result=length [CALLS-INTERNAL] byte[] getRandomBytes(int numBytes) [NEW] String [CALLS-EXTERNA...
true
ok
{"focal": {"class": "SideKEK", "name": "getRandomAlphanumericString", "signature": "String getRandomAlphanumericString(int length)", "start_line": 3, "modifiers": "static", "params": [{"name": "length", "type": "int"}], "return_type": "String"}, "class_info": {"name": "SideKEK", "kind": "class", "modifiers": "", "super...
205782720_943
class MySQLCDCUtils { public static Object getWritableObject(Integer type, Serializable value) { if (value == null) { return null; } if (type == null) { if (value instanceof byte[]) { return new String((byte[]) value); } else if (value ins...
assertNull(MySQLCDCUtils.getWritableObject(null, null)); assertNull(MySQLCDCUtils.getWritableObject(Types.INTEGER, null)); assertEquals((byte) 1, MySQLCDCUtils.getWritableObject(Types.INTEGER, (byte) 1)); assertEquals("Hello", MySQLCDCUtils.getWritableObject(Types.VARCHAR, "Hello".getByt...
[FOCAL] public static Object MySQLCDCUtils.getWritableObject(Integer type, Serializable value) [CLASS] class MySQLCDCUtils [METRICS] loc=21 cc=7 branches=6 loops=0 returns=7 throws=0 nesting=3 [CALLS-EXTERNAL] Serializable.toString/0 [NEW] String [PATH1] if(value == null)=F -> if(type == null)=T -> if(value instanceof ...
/* static context [FOCAL] public static Object MySQLCDCUtils.getWritableObject(Integer type, Serializable value) [PATH1] if(value == null)=F -> if(type == null)=T -> if(value instanceof byte[])#1=F -> if(value instanceof Number)#1=T -> return value [PATH2] if(value == null)=F -> if(type == null)=F -> if(value instanceo...
/* static context [FOCAL] public static Object MySQLCDCUtils.getWritableObject(Integer type, Serializable value) [PATH1] if(value == null)=F -> if(type == null)=T -> if(value instanceof byte[])#1=F -> if(value instanceof Number)#1=T -> return value [PATH2] if(value == null)=F -> if(type == null)=F -> if(value instanceo...
true
ok
{"focal": {"class": "MySQLCDCUtils", "name": "getWritableObject", "signature": "Object getWritableObject(Integer type, Serializable value)", "start_line": 3, "modifiers": "public static", "params": [{"name": "type", "type": "Integer"}, {"name": "value", "type": "Serializable"}], "return_type": "Object"}, "class_info": ...
205815601_211
class RouteInfoManager { public byte[] getAllTopicList() { TopicList topicList = new TopicList(); try { try { this.lock.readLock().lockInterruptibly(); topicList.getTopicList().addAll(this.topicQueueTable.keySet()); } finally { ...
byte[] topicInfo = routeInfoManager.getAllTopicList(); Assert.assertTrue(topicInfo != null); assertThat(topicInfo).isNotNull(); } }
[FOCAL] public byte[] RouteInfoManager.getAllTopicList() [CLASS] class RouteInfoManager [METRICS] loc=15 cc=3 branches=0 loops=0 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] this.lock.readLock().lockInterruptibly/0, this.lock.readLock/0, topicList.getTopicList().addAll/1, TopicList.getTopicList/0, this.topicQueueTable...
/* static context [FOCAL] public byte[] RouteInfoManager.getAllTopicList() [PATH1] try-body throws -> return topicList.encode() [COLLABORATORS] field lock readLock/0; field topicQueueTable keySet/0 [EXCEPTIONS] catches Exception e [FIELDS] read=lock, topicQueueTable [NEW] TopicList [CALLS-EXTERNAL] this.lock.readLock()...
/* static context [FOCAL] public byte[] RouteInfoManager.getAllTopicList() [PATH1] try-body throws -> return topicList.encode() [COLLABORATORS] field lock readLock/0; field topicQueueTable keySet/0 [EXCEPTIONS] catches Exception e [FIELDS] read=lock, topicQueueTable [NEW] TopicList [CALLS-EXTERNAL] this.lock.readLock()...
true
ok
{"focal": {"class": "RouteInfoManager", "name": "getAllTopicList", "signature": "byte[] getAllTopicList()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "byte[]"}, "class_info": {"name": "RouteInfoManager", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"na...
205819560_2
class AndroidInteropSchedulers { public static Scheduler from(Looper looper) { return from(looper, false); } private AndroidInteropSchedulers(); public static Scheduler mainThread(); @SuppressLint("NewApi") // Checking for an @hide API. public static Scheduler from(Looper looper, boolean...
try { AndroidInteropSchedulers.from(null, false); fail(); } catch (NullPointerException e) { assertEquals("looper == null", e.getMessage()); } } }
[FOCAL] public static Scheduler AndroidInteropSchedulers.from(Looper looper) [CLASS] class AndroidInteropSchedulers [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] from/2 (inherited) [INPUTS] branches=- | result=looper [DATAFLOW] looper@param->L2 [CLASS-MEMBERS] AndroidInteropSched...
/* static context [FOCAL] public static Scheduler AndroidInteropSchedulers.from(Looper looper) [INPUTS] branches=- | result=looper [CALLS-EXTERNAL] from/2 (inherited) */
/* static context [FOCAL] public static Scheduler AndroidInteropSchedulers.from(Looper looper) [INPUTS] branches=- | result=looper [CALLS-EXTERNAL] from/2 (inherited) */ class AndroidInteropSchedulers { public static Scheduler from(Looper looper) { return from(looper, false); } private AndroidInt...
true
ok
{"focal": {"class": "AndroidInteropSchedulers", "name": "from", "signature": "Scheduler from(Looper looper)", "start_line": 3, "modifiers": "public static", "params": [{"name": "looper", "type": "Looper"}], "return_type": "Scheduler"}, "class_info": {"name": "AndroidInteropSchedulers", "kind": "class", "modifiers": "",...
205889879_2
class Recording implements Parcelable { public static boolean hasIllegalChar(CharSequence fileName) { Pattern pattern = Pattern.compile("[^a-zA-Z0-9.\\- ]"); Matcher matcher = pattern.matcher(fileName); return matcher.find(); } public Recording(); public Recording(Long id, Lo...
String legalChars = "abcde10ABC.-"; assertFalse(Recording.hasIllegalChar(legalChars)); } }
[FOCAL] public static boolean Recording.hasIllegalChar(CharSequence fileName) [CLASS] class Recording implements Parcelable [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Pattern.compile/1, Pattern.matcher/1, Matcher.find/0 [INPUTS] branches=- | result=fileName [DATAFLOW] fileName...
/* static context [FOCAL] public static boolean Recording.hasIllegalChar(CharSequence fileName) [INPUTS] branches=- | result=fileName [CALLS-EXTERNAL] Pattern.compile/1, Pattern.matcher/1, Matcher.find/0 */
/* static context [FOCAL] public static boolean Recording.hasIllegalChar(CharSequence fileName) [INPUTS] branches=- | result=fileName [CALLS-EXTERNAL] Pattern.compile/1, Pattern.matcher/1, Matcher.find/0 */ class Recording implements Parcelable { public static boolean hasIllegalChar(CharSequence fileName) { ...
true
ok
{"focal": {"class": "Recording", "name": "hasIllegalChar", "signature": "boolean hasIllegalChar(CharSequence fileName)", "start_line": 3, "modifiers": "public static", "params": [{"name": "fileName", "type": "CharSequence"}], "return_type": "boolean"}, "class_info": {"name": "Recording", "kind": "class", "modifiers": "...
206005266_15
class LogSequenceNumber implements Comparable<LogSequenceNumber> { public static LogSequenceNumber valueOf(long value) { return new LogSequenceNumber(value); } private LogSequenceNumber(long value); public static LogSequenceNumber valueOf(String strValue); public long asLong(); public String asStrin...
LogSequenceNumber result = LogSequenceNumber.valueOf("0/15D68C50"); assertThat(result, notNullValue()); } }
[FOCAL] public static LogSequenceNumber LogSequenceNumber.valueOf(long value) [CLASS] class LogSequenceNumber implements Comparable<LogSequenceNumber> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] LogSequenceNumber [INPUTS] branches=- | result=value [DATAFLOW] value@param->L2 [CLASS-MEMBERS...
/* static context [FOCAL] public static LogSequenceNumber LogSequenceNumber.valueOf(long value) [INPUTS] branches=- | result=value [NEW] LogSequenceNumber */
/* static context [FOCAL] public static LogSequenceNumber LogSequenceNumber.valueOf(long value) [INPUTS] branches=- | result=value [NEW] LogSequenceNumber */ class LogSequenceNumber implements Comparable<LogSequenceNumber> { public static LogSequenceNumber valueOf(long value) { return new LogSequenceNumber(value...
true
ok
{"focal": {"class": "LogSequenceNumber", "name": "valueOf", "signature": "LogSequenceNumber valueOf(long value)", "start_line": 3, "modifiers": "public static", "params": [{"name": "value", "type": "long"}], "return_type": "LogSequenceNumber"}, "class_info": {"name": "LogSequenceNumber", "kind": "class", "modifiers": "...
206101640_11
class AddressService extends BaseNodeAddressService { public ResponseEntity<IResponse> getAddresses(GetHistoryAddressesRequest getHistoryAddressesRequest) { try { if (!getHistoryAddressesRequestCrypto.verifySignature(getHistoryAddressesRequest)) { return ResponseEntity.status(Ht...
GetHistoryAddressesRequest getHistoryAddressesRequest = new GetHistoryAddressesRequest(new ArrayList<>()); //create request without signer hash and signature ResponseEntity<IResponse> expectedResponse = ResponseEntity .status(HttpStatus.UNAUTHORIZED) .body(new Ser...
[FOCAL] public ResponseEntity<IResponse> AddressService.getAddresses(GetHistoryAddressesRequest getHistoryAddressesRequest) [CLASS] class AddressService extends BaseNodeAddressService [METRICS] loc=37 cc=6 branches=3 loops=0 returns=4 throws=0 nesting=3 [CALLS-INTERNAL] GetHistoryAddressesResponse getAddressesFromStora...
/* static context [FOCAL] public ResponseEntity<IResponse> AddressService.getAddresses(GetHistoryAddressesRequest getHistoryAddressesRequest) [PATH1] if(!getHistoryAddressesRequestCrypto.verifySignature(getHistoryAddressesRequest))=F -> if(!addressesHashesToGetFromStorage.isEmpty())=T -> if(responseValidationResult.isP...
/* static context [FOCAL] public ResponseEntity<IResponse> AddressService.getAddresses(GetHistoryAddressesRequest getHistoryAddressesRequest) [PATH1] if(!getHistoryAddressesRequestCrypto.verifySignature(getHistoryAddressesRequest))=F -> if(!addressesHashesToGetFromStorage.isEmpty())=T -> if(responseValidationResult.isP...
true
ok
{"focal": {"class": "AddressService", "name": "getAddresses", "signature": "ResponseEntity<IResponse> getAddresses(GetHistoryAddressesRequest getHistoryAddressesRequest)", "start_line": 3, "modifiers": "public", "params": [{"name": "getHistoryAddressesRequest", "type": "GetHistoryAddressesRequest"}], "return_type": "Re...
206137428_4
class Ring implements Iterable<Member> { public Iterable<Member> successors(HashKey location, Predicate<Member> predicate) { Iterator<Member> tail = ring.tailMap(location, false).values().iterator(); Iterator<Member> head = ring.headMap(location, false).values().iterator(); Iterator<Member...
Collection<Member> successors = ring.streamSuccessors(members.get(5), m -> m.equals(members.get(3))) .collect(Collectors.toList()); assertFalse(successors.isEmpty()); assertEquals(7, successors.size()); } }
[FOCAL] public Iterable<Member> Ring.successors(HashKey location, Predicate<Member> predicate) [CLASS] class Ring implements Iterable<Member> [METRICS] loc=42 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] ring.tailMap(location, false).values().iterator/0, ring.tailMap(location, false).values/0, ...
/* static context [FOCAL] public Iterable<Member> Ring.successors(HashKey location, Predicate<Member> predicate) [INPUTS] branches=- | result=location, predicate, ring [COLLABORATORS] field ring:Ring tailMap/2,headMap/2; param predicate:Predicate<Member> test/1 [FIELDS] read=ring:Ring [NEW] Iterator<Member>, NoSuchElem...
/* static context [FOCAL] public Iterable<Member> Ring.successors(HashKey location, Predicate<Member> predicate) [INPUTS] branches=- | result=location, predicate, ring [COLLABORATORS] field ring:Ring tailMap/2,headMap/2; param predicate:Predicate<Member> test/1 [FIELDS] read=ring:Ring [NEW] Iterator<Member>, NoSuchElem...
true
ok
{"focal": {"class": "Ring", "name": "successors", "signature": "Iterable<Member> successors(HashKey location, Predicate<Member> predicate)", "start_line": 3, "modifiers": "public", "params": [{"name": "location", "type": "HashKey"}, {"name": "predicate", "type": "Predicate<Member>"}], "return_type": "Iterable<Member>"}...
206303197_1
class DefaultBenchConfigurationResolver implements BenchConfigurationResolver { @Override public String resolve(String parameter) { return resolvers.stream() .map(benchConfigurationResolver -> benchConfigurationResolver.resolve(parameter)) .filter(Objects::nonNull) ....
Assert.assertNotNull(resolver.resolve(ENV_TEST_KEY)); } }
[FOCAL] @Override public String DefaultBenchConfigurationResolver.resolve(String parameter) [CLASS] class DefaultBenchConfigurationResolver implements BenchConfigurationResolver [METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] resolvers.stream() .map(benchConfigurationResolver -> be...
/* static context [FOCAL] @Override public String DefaultBenchConfigurationResolver.resolve(String parameter) [INPUTS] branches=- | result=parameter [COLLABORATORS] field resolvers stream/0; field benchConfigurationResolver resolve/1 [CALLS-EXTERNAL] resolvers.stream() .map(benchConfigurationResolver -> ben....orElse/1...
/* static context [FOCAL] @Override public String DefaultBenchConfigurationResolver.resolve(String parameter) [INPUTS] branches=- | result=parameter [COLLABORATORS] field resolvers stream/0; field benchConfigurationResolver resolve/1 [CALLS-EXTERNAL] resolvers.stream() .map(benchConfigurationResolver -> ben....orElse/1...
true
ok
{"focal": {"class": "DefaultBenchConfigurationResolver", "name": "resolve", "signature": "String resolve(String parameter)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "parameter", "type": "String"}], "return_type": "String"}, "class_info": {"name": "DefaultBenchConfigurationResolver", "kind"...
206414745_690
class StaticNodesParser { public static Set<EnodeURL> fromPath( final Path path, final EnodeDnsConfiguration enodeDnsConfiguration) throws IOException, IllegalArgumentException { try { return readEnodesFromPath(path, enodeDnsConfiguration); } catch (FileNotFoundException | NoSuchFileExcept...
final URL resource = StaticNodesParserTest.class.getResource("valid_hostname_static_nodes.json"); final File invalidFile = new File(resource.getFile()); assertThatThrownBy( () -> StaticNodesParser.fromPath( invalidFile.toPath(), EnodeDnsConfiguration....
[FOCAL] public static Set<EnodeURL> StaticNodesParser.fromPath(Path path, EnodeDnsConfiguration enodeDnsConfiguration) [CLASS] class StaticNodesParser [METRICS] loc=20 cc=5 branches=0 loops=0 returns=2 throws=3 nesting=1 [CALLS-INTERNAL] Set<EnodeURL> readEnodesFromPath(Path path, EnodeDnsConfiguration enodeDnsConfigur...
/* static context [FOCAL] public static Set<EnodeURL> StaticNodesParser.fromPath(Path path, EnodeDnsConfiguration enodeDnsConfiguration) [THROWS-WHEN] ex when try-body throws [PATH1] try-body throws -> return emptySet() [PATH2] return readEnodesFromPath(path, enodeDnsConfiguration) [PATH3] try-body throws -> throw ex [...
/* static context [FOCAL] public static Set<EnodeURL> StaticNodesParser.fromPath(Path path, EnodeDnsConfiguration enodeDnsConfiguration) [THROWS-WHEN] ex when try-body throws [PATH1] try-body throws -> return emptySet() [PATH2] return readEnodesFromPath(path, enodeDnsConfiguration) [PATH3] try-body throws -> throw ex [...
true
ok
{"focal": {"class": "StaticNodesParser", "name": "fromPath", "signature": "Set<EnodeURL> fromPath(Path path, EnodeDnsConfiguration enodeDnsConfiguration) throws IOException, IllegalArgumentException", "start_line": 3, "modifiers": "public static", "params": [{"name": "path", "type": "Path"}, {"name": "enodeDnsConfigura...
206662517_4
class RecoveryCodeGenerator { public String[] generateCodes(int amount) { // Must generate at least one code if (amount < 1) { throw new InvalidParameterException("Amount must be at least 1."); } // Create an array and fill with generated codes String[] codes = ...
RecoveryCodeGenerator generator = new RecoveryCodeGenerator(); String[] codes = generator.generateCodes(16); // Assert each one is the correct format for (String code : codes) { assertTrue(code.matches("[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}"), code); } ...
[FOCAL] public String[] RecoveryCodeGenerator.generateCodes(int amount) [CLASS] class RecoveryCodeGenerator [METRICS] loc=12 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] String generateCode() [CALLS-EXTERNAL] Arrays.setAll/2 [NEW] InvalidParameterException [EXCEPTIONS] throws InvalidParameterEx...
/* static context [FOCAL] public String[] RecoveryCodeGenerator.generateCodes(int amount) [THROWS-WHEN] InvalidParameterException when amount < 1 [PATH1] if(amount < 1)=T -> throw new InvalidParameterException("Amount must be at least 1.") [PATH2] if(amount < 1)=F -> return codes [INPUTS] branches=amount | result=amoun...
/* static context [FOCAL] public String[] RecoveryCodeGenerator.generateCodes(int amount) [THROWS-WHEN] InvalidParameterException when amount < 1 [PATH1] if(amount < 1)=T -> throw new InvalidParameterException("Amount must be at least 1.") [PATH2] if(amount < 1)=F -> return codes [INPUTS] branches=amount | result=amoun...
true
ok
{"focal": {"class": "RecoveryCodeGenerator", "name": "generateCodes", "signature": "String[] generateCodes(int amount)", "start_line": 3, "modifiers": "public", "params": [{"name": "amount", "type": "int"}], "return_type": "String[]"}, "class_info": {"name": "RecoveryCodeGenerator", "kind": "class", "modifiers": "", "s...
206738246_0
class SuperHeroCreator implements Processor { @Transactional(REQUIRED) Hero add(final String legumeItem) { log.info("Legume received: {}", legumeItem); final Hero hero = Hero.builder() .name("SUPER-" + legumeItem) .capeType(CapeType.SUPERMAN) .bu...
final Hero hero = creator.add("broccoli"); assertNotNull(hero); assertNotNull(hero.getId()); assertEquals("SUPER-broccoli", hero.getName()); } }
[FOCAL] @Transactional(REQUIRED) Hero SuperHeroCreator.add(String legumeItem) [CLASS] class SuperHeroCreator implements Processor [METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] log.info/2, Hero.builder() .name("SUPER-" + legumeItem) .capeType(Cap....build/0, Hero.builder() .name(...
/* static context [FOCAL] @Transactional(REQUIRED) Hero SuperHeroCreator.add(String legumeItem) [INPUTS] branches=- | result=legumeItem [COLLABORATORS] field entityManager merge/1 [CALLS-EXTERNAL] log.info/2, Hero.builder() .name("SUPER-" + legumeItem) .capeType(Cap....build/0, Hero.builder() .name("SUPER-" + legumeIte...
/* static context [FOCAL] @Transactional(REQUIRED) Hero SuperHeroCreator.add(String legumeItem) [INPUTS] branches=- | result=legumeItem [COLLABORATORS] field entityManager merge/1 [CALLS-EXTERNAL] log.info/2, Hero.builder() .name("SUPER-" + legumeItem) .capeType(Cap....build/0, Hero.builder() .name("SUPER-" + legumeIte...
true
ok
{"focal": {"class": "SuperHeroCreator", "name": "add", "signature": "Hero add(String legumeItem)", "start_line": 3, "modifiers": "@Transactional(REQUIRED)", "params": [{"name": "legumeItem", "type": "String"}], "return_type": "Hero"}, "class_info": {"name": "SuperHeroCreator", "kind": "class", "modifiers": "", "supercl...
206873260_1
class Parser { @NonNull public TextMarkdown parse(@NonNull final String string) { List<Element> parents = new ArrayList<>(); Pattern quotePattern = Pattern.compile(QUOTE_REGEX); Pattern pattern = Pattern.compile(BULLET_POINT_CODE_BLOCK_REGEX); Matcher matcher = quotePattern.ma...
String withQuote = "This is not a quote." + LINE_SEPARATOR + "> This is a quote"; List<Element> elements = new Parser().parse(withQuote).getElements(); assertEquals(elements.size(), 2); assertEquals(elements.get(0).getType(), TEXT); assertEquals(elements.get(0).getText(), "This...
[FOCAL] @NonNull public TextMarkdown Parser.parse(String string) [CLASS] class Parser [METRICS] loc=33 cc=4 branches=2 loops=1 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] List<Element> findElements(String string, Pattern pattern); int getEndOfParagraph(String string, int endIndex) [CALLS-EXTERNAL] Pattern.compile/1, ...
/* static context [FOCAL] @NonNull public TextMarkdown Parser.parse(String string) [PATH1] while(matcher.find(lastStartIndex))=T -> if(lastStartIndex < startIndex)=T -> exit loop -> if(lastStartIndex < string.length())=T -> return new TextMarkdown(parents) [PATH2] while(matcher.find(lastStartIndex))=F -> if(lastStartIn...
/* static context [FOCAL] @NonNull public TextMarkdown Parser.parse(String string) [PATH1] while(matcher.find(lastStartIndex))=T -> if(lastStartIndex < startIndex)=T -> exit loop -> if(lastStartIndex < string.length())=T -> return new TextMarkdown(parents) [PATH2] while(matcher.find(lastStartIndex))=F -> if(lastStartIn...
true
ok
{"focal": {"class": "Parser", "name": "parse", "signature": "TextMarkdown parse(String string)", "start_line": 3, "modifiers": "@NonNull public", "params": [{"name": "string", "type": "String"}], "return_type": "TextMarkdown"}, "class_info": {"name": "Parser", "kind": "class", "modifiers": "", "superclass": null, "inte...
207384523_56
class GraphOperationBuilder implements OperationBuilder { private static void setAttrShape(TF_OperationDescription handle, String name, long[] shape, int numDims) { requireHandle(handle); // num_dims and env->GetArrayLength(shape) are assumed to be consistent. // i.e., either num_dims < 0 or num_dims ==...
try (Graph g = new Graph()) { Output<?> n = g.opBuilder("Placeholder", "unknown") .setAttr("dtype", TFloat32.DTYPE) .setAttr("shape", Shape.unknown()) .build() .output(0); assertEquals(-1, n.shape().numDimensions()); assertEquals(TF...
[FOCAL] private static void GraphOperationBuilder.setAttrShape(TF_OperationDescription handle, String name, long[] shape, int numDims) [CLASS] class GraphOperationBuilder implements OperationBuilder [METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void requireHandle(Pointer handle) ...
/* static context [FOCAL] private static void GraphOperationBuilder.setAttrShape(TF_OperationDescription handle, String name, long[] shape, int numDims) [CALLS-INTERNAL] void requireHandle(Pointer handle) [CALLS-EXTERNAL] TF_SetAttrShape/4 (inherited) */
/* static context [FOCAL] private static void GraphOperationBuilder.setAttrShape(TF_OperationDescription handle, String name, long[] shape, int numDims) [CALLS-INTERNAL] void requireHandle(Pointer handle) [CALLS-EXTERNAL] TF_SetAttrShape/4 (inherited) */ class GraphOperationBuilder implements OperationBuilder { priv...
true
ok
{"focal": {"class": "GraphOperationBuilder", "name": "setAttrShape", "signature": "void setAttrShape(TF_OperationDescription handle, String name, long[] shape, int numDims)", "start_line": 3, "modifiers": "private static", "params": [{"name": "handle", "type": "TF_OperationDescription"}, {"name": "name", "type": "Strin...
207497806_29
class EntityService { public UpdateResult updateFields(String originalJsonObject, JsonNode jsonToUpdate, String attrId) throws Exception, ResponseException { logger.trace("updateFields() :: started"); String now = SerializationTools.formatter.format(Instant.now()); JsonNode resultJson = objectMapper.createOb...
try { Mockito.doReturn(blankNode).when(objectMapper).createObjectNode(); Mockito.doReturn(payloadNode).when(objectMapper).readTree(any(String.class)); UpdateResult updateResult=entityService.updateFields(entityPayload,updateJsonNode , null); Assert.assertTrue(updateResult.getStatus()); Assert.ass...
[FOCAL] public UpdateResult EntityService.updateFields(String originalJsonObject, JsonNode jsonToUpdate, String attrId) [CLASS] class EntityService [METRICS] loc=98 cc=16 branches=13 loops=2 returns=1 throws=2 nesting=5 [CALLS-INTERNAL] void removeTemporalProperties(JsonNode jsonNode); void setFieldValue(Iterator<Strin...
class EntityService { public UpdateResult updateFields(String originalJsonObject, JsonNode jsonToUpdate, String attrId) throws Exception, ResponseException { logger.trace("updateFields() :: started"); String now = SerializationTools.formatter.format(Instant.now()); JsonNode resultJson = objectMapper.createOb...
false
ok
{"focal": {"class": "EntityService", "name": "updateFields", "signature": "UpdateResult updateFields(String originalJsonObject, JsonNode jsonToUpdate, String attrId) throws Exception, ResponseException", "start_line": 3, "modifiers": "public", "params": [{"name": "originalJsonObject", "type": "String"}, {"name": "jsonT...
207567112_5
class GreetingController { @RequestMapping(value = {"/greeting/{name}", "/greeting"}) Greeting greeting(@PathVariable(required = false) String name) { String object = name != null ? name : "world"; /* Jack Griffin is the name of the "Invisible Man." */ if (object.equalsIgnoreCase("jack...
assertEquals( greetingController.greeting(name).getMessage(), greeting); } }
[FOCAL] @RequestMapping(value = {"/greeting/{name}", "/greeting"}) Greeting GreetingController.greeting(String name) [CLASS] class GreetingController [METRICS] loc=11 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] String.equalsIgnoreCase/1 [NEW] Greeting [PATH1] if(object.equalsIgnoreCase("jack g...
/* static context [FOCAL] @RequestMapping(value = {"/greeting/{name}", "/greeting"}) Greeting GreetingController.greeting(String name) [PATH1] if(object.equalsIgnoreCase("jack griffin"))=T -> return new Greeting("I don't know who you are.") [PATH2] if(object.equalsIgnoreCase("jack griffin"))=F -> return new Greeting("H...
/* static context [FOCAL] @RequestMapping(value = {"/greeting/{name}", "/greeting"}) Greeting GreetingController.greeting(String name) [PATH1] if(object.equalsIgnoreCase("jack griffin"))=T -> return new Greeting("I don't know who you are.") [PATH2] if(object.equalsIgnoreCase("jack griffin"))=F -> return new Greeting("H...
true
ok
{"focal": {"class": "GreetingController", "name": "greeting", "signature": "Greeting greeting(String name)", "start_line": 3, "modifiers": "@RequestMapping(value = {\"/greeting/{name}\", \"/greeting\"})", "params": [{"name": "name", "type": "String"}], "return_type": "Greeting"}, "class_info": {"name": "GreetingControl...
207726223_11
class NettyProtocolEncoder extends OneToOneEncoder { @Override protected Object encode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception { RpcDataPack dataPack = (RpcDataPack) msg; List<ByteBuffer> origs = dataPack.getDataLst(); List<By...
NettyProtocolEncoder nettyProtocolEncoder = new NettyProtocolEncoder(); // build RpcDataPack RpcDataPack obj = new RpcDataPack(); // set serial number obj.setSerialNo(123); List<ByteBuffer> dataList = new LinkedList<ByteBuffer>(); dataList.add(ByteBuffer.wrap("abc...
[FOCAL] @Override protected Object NettyProtocolEncoder.encode(ChannelHandlerContext ctx, Channel channel, Object msg) [CLASS] class NettyProtocolEncoder extends OneToOneEncoder [METRICS] loc=13 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] ByteBuffer getLengthHeader(ByteBuffer buf); ByteBuffer ...
/* static context [FOCAL] @Override protected Object NettyProtocolEncoder.encode(ChannelHandlerContext ctx, Channel channel, Object msg) [PATH1] foreach(ByteBuffer b : origs)=T -> exit loop -> return ChannelBuffers.wrappedBuffer(bbs.toArray(new ByteBuffer[bbs.size()])) [PATH2] foreach(ByteBuffer b : origs)=F -> return ...
/* static context [FOCAL] @Override protected Object NettyProtocolEncoder.encode(ChannelHandlerContext ctx, Channel channel, Object msg) [PATH1] foreach(ByteBuffer b : origs)=T -> exit loop -> return ChannelBuffers.wrappedBuffer(bbs.toArray(new ByteBuffer[bbs.size()])) [PATH2] foreach(ByteBuffer b : origs)=F -> return ...
true
ok
{"focal": {"class": "NettyProtocolEncoder", "name": "encode", "signature": "Object encode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "ctx", "type": "ChannelHandlerContext"}, {"name": "channel", "type": "Channel"}, {...
207822084_5
class AuthorizationService extends EscrowAgentService { @Override public final TreeMap<String, String> getParameters() { TreeMap<String, String> parameters = new TreeMap<>(); if (requestType.equals(PDGuardRequestType.ENCRYPTION)) { if (authBundle instanceof EncryptionBundle) { ...
AuthorizationService service = new AuthorizationService(client, escrowAgent, secure, encryptBundle, requestToken, PDGuardRequestType.ENCRYPTION); SignatureBase signatureBase = new SignatureBase(service.getParameters(), "url", "POST"); Assert.assertNotNull(service....
[FOCAL] @Override public final TreeMap<String, String> AuthorizationService.getParameters() [CLASS] class AuthorizationService extends EscrowAgentService [METRICS] loc=28 cc=4 branches=3 loops=0 returns=1 throws=2 nesting=2 [CALLS-EXTERNAL] requestType.equals/1, TreeMap<String, String>.put/2, ((EncryptionBundle) authBu...
/* static context [FOCAL] @Override public final TreeMap<String, String> AuthorizationService.getParameters() [THROWS-WHEN] RuntimeException when requestType.equals(PDGuardRequestType.ENCRYPTION) && !(authBundle instanceof EncryptionBundle) [THROWS-WHEN] RuntimeException when !requestType.equals(PDGuardRequestType.ENCR...
/* static context [FOCAL] @Override public final TreeMap<String, String> AuthorizationService.getParameters() [THROWS-WHEN] RuntimeException when requestType.equals(PDGuardRequestType.ENCRYPTION) && !(authBundle instanceof EncryptionBundle) [THROWS-WHEN] RuntimeException when !requestType.equals(PDGuardRequestType.ENCR...
true
ok
{"focal": {"class": "AuthorizationService", "name": "getParameters", "signature": "TreeMap<String, String> getParameters()", "start_line": 3, "modifiers": "@Override public final", "params": [], "return_type": "TreeMap<String, String>"}, "class_info": {"name": "AuthorizationService", "kind": "class", "modifiers": "", "...
208015762_1
class ExtensionManager { public static <T, M> T getOrLoadExtension(final Class<T> extensible, final M name) { ExtensionPoint<T, M> spi = SNAPSHOT.getOrLoadExtensionPoint(extensible, null, AscendingComparator.INSTANCE, null); return spi == null ? null : spi.get(name); } public static T getE...
Consumer c1 = ExtensionManager.getOrLoadExtension(Consumer.class); Consumer c2 = ExtensionManager.getOrLoadExtension(Consumer.class); Assert.assertNotNull(c1); Assert.assertEquals(c1, c2); } }
[FOCAL] public static T ExtensionManager.getOrLoadExtension(Class<T> extensible, M name) [CLASS] class ExtensionManager [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] SNAPSHOT.getOrLoadExtensionPoint/4, ExtensionPoint<T, M>.get/1 [INPUTS] branches=- | result=extensible, name [DATA...
/* static context [FOCAL] public static T ExtensionManager.getOrLoadExtension(Class<T> extensible, M name) [INPUTS] branches=- | result=extensible, name [CALLS-EXTERNAL] SNAPSHOT.getOrLoadExtensionPoint/4, ExtensionPoint<T, M>.get/1 */
/* static context [FOCAL] public static T ExtensionManager.getOrLoadExtension(Class<T> extensible, M name) [INPUTS] branches=- | result=extensible, name [CALLS-EXTERNAL] SNAPSHOT.getOrLoadExtensionPoint/4, ExtensionPoint<T, M>.get/1 */ class ExtensionManager { public static <T, M> T getOrLoadExtension(final Class<...
true
ok
{"focal": {"class": "ExtensionManager", "name": "getOrLoadExtension", "signature": "T getOrLoadExtension(Class<T> extensible, M name)", "start_line": 3, "modifiers": "public static", "params": [{"name": "extensible", "type": "Class<T>"}, {"name": "name", "type": "M"}], "return_type": "T"}, "class_info": {"name": "Exten...
208317627_38
class JarLoader implements ClassFileLoader { protected List<JarEntry> extractEntries(final JarFile jarFile) { final List<JarEntry> result = new ArrayList<>(); if (jarFile != null) { final Enumeration<JarEntry> entries = jarFile.entries(); while (entries.hasMoreElements()) ...
JarFile jarFile = MockEntities.makeMockJarFile(); List<JarEntry> entries = loader.extractEntries(jarFile); Assert.assertEquals(6, entries.size()); } }
[FOCAL] protected List<JarEntry> JarLoader.extractEntries(JarFile jarFile) [CLASS] class JarLoader implements ClassFileLoader [METRICS] loc=16 cc=4 branches=2 loops=1 returns=1 throws=0 nesting=3 [CALLS-EXTERNAL] JarFile.entries/0, Enumeration<JarEntry>.hasMoreElements/0, Enumeration<JarEntry>.nextElement/0, JarEntry.i...
/* static context [FOCAL] protected List<JarEntry> JarLoader.extractEntries(JarFile jarFile) [PATH1] if(jarFile != null)=T -> while(entries.hasMoreElements())=T -> if(!e.isDirectory() && e.getName().endsWith(".class"))=T -> exit loop -> return result [PATH2] if(jarFile != null)=F -> return result [PATH3] if(jarFile != ...
/* static context [FOCAL] protected List<JarEntry> JarLoader.extractEntries(JarFile jarFile) [PATH1] if(jarFile != null)=T -> while(entries.hasMoreElements())=T -> if(!e.isDirectory() && e.getName().endsWith(".class"))=T -> exit loop -> return result [PATH2] if(jarFile != null)=F -> return result [PATH3] if(jarFile != ...
true
ok
{"focal": {"class": "JarLoader", "name": "extractEntries", "signature": "List<JarEntry> extractEntries(JarFile jarFile)", "start_line": 3, "modifiers": "protected", "params": [{"name": "jarFile", "type": "JarFile"}], "return_type": "List<JarEntry>"}, "class_info": {"name": "JarLoader", "kind": "class", "modifiers": "",...
208319207_11
class HttpProtocolGeneratorUtils { static void writeHostPrefix(GenerationContext context, OperationShape operation) { TypeScriptWriter writer = context.getWriter(); SymbolProvider symbolProvider = context.getSymbolProvider(); EndpointTrait trait = operation.getTrait(EndpointTrait.class).get...
GenerationContext mockContext = new GenerationContext(); mockContext.setSymbolProvider(new MockProvider()); TypeScriptWriter writer = new TypeScriptWriter("foo"); mockContext.setWriter(writer); Model model = Model.assembler() .addImport(getClass().getResource("en...
[FOCAL] static void HttpProtocolGeneratorUtils.writeHostPrefix(GenerationContext context, OperationShape operation) [CLASS] class HttpProtocolGeneratorUtils [METRICS] loc=27 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] GenerationContext.getWriter/0, GenerationContext.getSymbolProvider/0, operat...
/* static context [FOCAL] static void HttpProtocolGeneratorUtils.writeHostPrefix(GenerationContext context, OperationShape operation) [COLLABORATORS] param context:GenerationContext getWriter/0,getSymbolProvider/0,getModel/0; param operation:OperationShape getTrait/1,getInput/0 [CALLS-EXTERNAL] GenerationContext.getWri...
/* static context [FOCAL] static void HttpProtocolGeneratorUtils.writeHostPrefix(GenerationContext context, OperationShape operation) [COLLABORATORS] param context:GenerationContext getWriter/0,getSymbolProvider/0,getModel/0; param operation:OperationShape getTrait/1,getInput/0 [CALLS-EXTERNAL] GenerationContext.getWri...
true
ok
{"focal": {"class": "HttpProtocolGeneratorUtils", "name": "writeHostPrefix", "signature": "void writeHostPrefix(GenerationContext context, OperationShape operation)", "start_line": 3, "modifiers": "static", "params": [{"name": "context", "type": "GenerationContext"}, {"name": "operation", "type": "OperationShape"}], "r...
208556644_10
class ExceptionCause { public RuntimeException unwrapped() { Throwable cause = exception.getCause(); if (cause instanceof RuntimeException) { return (RuntimeException) cause; } if (cause == null) { return new IllegalStateException(exception.getMessage()); } return new IllegalStateException(cause); ...
exceptionCauseToTest = new ExceptionCause(exceptionWithCause); RuntimeException unwrapped = exceptionCauseToTest.unwrapped(); assertEquals(exceptionWithoutCause, unwrapped); } }
[FOCAL] public RuntimeException ExceptionCause.unwrapped() [CLASS] class ExceptionCause [METRICS] loc=10 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1 [CALLS-EXTERNAL] exception.getCause/0, exception.getMessage/0 [NEW] IllegalStateException [PATH1] if(cause instanceof RuntimeException)=F -> if(cause == null)=T -...
/* static context [FOCAL] public RuntimeException ExceptionCause.unwrapped() [PATH1] if(cause instanceof RuntimeException)=F -> if(cause == null)=T -> return new IllegalStateException(exception.getMessage()) [PATH2] if(cause instanceof RuntimeException)=T -> return (RuntimeException) cause [PATH3] if(cause instanceof R...
/* static context [FOCAL] public RuntimeException ExceptionCause.unwrapped() [PATH1] if(cause instanceof RuntimeException)=F -> if(cause == null)=T -> return new IllegalStateException(exception.getMessage()) [PATH2] if(cause instanceof RuntimeException)=T -> return (RuntimeException) cause [PATH3] if(cause instanceof R...
true
ok
{"focal": {"class": "ExceptionCause", "name": "unwrapped", "signature": "RuntimeException unwrapped()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "RuntimeException"}, "class_info": {"name": "ExceptionCause", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [...
208698479_12
class DeFiClientManageProcessor implements NettyRequestProcessor { @Override public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) throws Exception { switch (request.getCode()) { case DeFiBusRequestCode.GET_CONSUMER_LIST_BY_GROUP_AND_TOPIC: ...
ConsumerGroupInfo consumerGroupInfo = deFiBrokerController.getConsumerManager().getConsumerGroupInfo(group); assertThat(consumerGroupInfo).isNotNull(); RemotingCommand request = GetConsumerListCommand(); RemotingCommand response = deFiClientManageProcessor.processRequest(handlerContext,...
[FOCAL] @Override public RemotingCommand DeFiClientManageProcessor.processRequest(ChannelHandlerContext ctx, RemotingCommand request) [CLASS] class DeFiClientManageProcessor implements NettyRequestProcessor [METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] RemotingCommand getConsume...
/* static context [FOCAL] @Override public RemotingCommand DeFiClientManageProcessor.processRequest(ChannelHandlerContext ctx, RemotingCommand request) [PATH1] switch(request.getCode())=case DeFiBusRequestCode.GET_CONSUMER_... -> return getConsumerListByGroupAndTopic(ctx, request) [PATH2] switch(request.getCode())=defa...
/* static context [FOCAL] @Override public RemotingCommand DeFiClientManageProcessor.processRequest(ChannelHandlerContext ctx, RemotingCommand request) [PATH1] switch(request.getCode())=case DeFiBusRequestCode.GET_CONSUMER_... -> return getConsumerListByGroupAndTopic(ctx, request) [PATH2] switch(request.getCode())=defa...
true
ok
{"focal": {"class": "DeFiClientManageProcessor", "name": "processRequest", "signature": "RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "ctx", "type": "ChannelHandlerContext"}, {"name": "request"...
209076507_85
class SchemaVersionRange { public static SchemaVersionRange parse(String versionStr) { versionStr = StringUtils.stripToNull(versionStr); Validate.notNull(versionStr, "Version string is blank"); if (isVersionStr(versionStr)) { return parseVersionStr(versionStr); } else ...
SchemaVersionRange range = SchemaVersionRange.parse(" [ 1 , ] "); Assert.assertNotNull(range); Assert.assertEquals(1, range.earliest); Assert.assertEquals(Integer.MAX_VALUE, range.latest); } }
[FOCAL] public static SchemaVersionRange SchemaVersionRange.parse(String versionStr) [CLASS] class SchemaVersionRange [METRICS] loc=13 cc=3 branches=2 loops=0 returns=2 throws=1 nesting=2 [CALLS-INTERNAL] SchemaVersionRange parseVersionRangeStr(String versionStr); SchemaVersionRange parseVersionStr(String versionStr); ...
/* static context [FOCAL] public static SchemaVersionRange SchemaVersionRange.parse(String versionStr) [THROWS-WHEN] IllegalArgumentException when !isVersionStr(versionStr) && !isVersionRangeStr(versionStr) [PATH1] if(isVersionStr(versionStr))=F -> if(isVersionRangeStr(versionStr))=T -> return parseVersionRangeStr(vers...
/* static context [FOCAL] public static SchemaVersionRange SchemaVersionRange.parse(String versionStr) [THROWS-WHEN] IllegalArgumentException when !isVersionStr(versionStr) && !isVersionRangeStr(versionStr) [PATH1] if(isVersionStr(versionStr))=F -> if(isVersionRangeStr(versionStr))=T -> return parseVersionRangeStr(vers...
true
ok
{"focal": {"class": "SchemaVersionRange", "name": "parse", "signature": "SchemaVersionRange parse(String versionStr)", "start_line": 3, "modifiers": "public static", "params": [{"name": "versionStr", "type": "String"}], "return_type": "SchemaVersionRange"}, "class_info": {"name": "SchemaVersionRange", "kind": "class", ...
209204932_7
class RowsEvent { public void parsePayload(final BinlogContext binlogContext, final ByteBuf in) { int columnsLength = (int) DataTypesCodec.readLengthCodedIntLE(in); columnsPresentBitmap = DataTypesCodec.readBitmap(columnsLength, in); if (EventTypes.UPDATE_ROWS_EVENT_V1 == binlogEventHeader....
binlogEventHeader.setTypeCode(EventTypes.WRITE_ROWS_EVENT_V2); ByteBuf byteBuf = Unpooled.buffer(); byteBuf.writeByte(1); byteBuf.writeByte(1); byteBuf.writeByte(1); RowsEvent actual = new RowsEvent(binlogEventHeader); actual.parsePayload(binlogContext, byteBuf); ...
[FOCAL] public void RowsEvent.parsePayload(BinlogContext binlogContext, ByteBuf in) [CLASS] class RowsEvent [METRICS] loc=35 cc=8 branches=4 loops=3 returns=0 throws=0 nesting=4 [CALLS-INTERNAL] Serializable decodeValue(ColumnDef columnDef, ByteBuf in) [CALLS-EXTERNAL] DataTypesCodec.readLengthCodedIntLE/1, DataTypesCo...
/* static context [FOCAL] public void RowsEvent.parsePayload(BinlogContext binlogContext, ByteBuf in) [PATH1] if((EventTypes.UPDATE_ROWS_EVENT_V1 == binlogEventHeader.getTypeCode() || EventTypes.UPDATE_ROWS_EVENT_V2 == binlogEvent...)#1=T -> while(in.isReadable())=T -> for(i < columnsLength)#1=T -> if(!nullBitmap.get(i...
/* static context [FOCAL] public void RowsEvent.parsePayload(BinlogContext binlogContext, ByteBuf in) [PATH1] if((EventTypes.UPDATE_ROWS_EVENT_V1 == binlogEventHeader.getTypeCode() || EventTypes.UPDATE_ROWS_EVENT_V2 == binlogEvent...)#1=T -> while(in.isReadable())=T -> for(i < columnsLength)#1=T -> if(!nullBitmap.get(i...
true
ok
{"focal": {"class": "RowsEvent", "name": "parsePayload", "signature": "void parsePayload(BinlogContext binlogContext, ByteBuf in)", "start_line": 3, "modifiers": "public", "params": [{"name": "binlogContext", "type": "BinlogContext"}, {"name": "in", "type": "ByteBuf"}], "return_type": "void"}, "class_info": {"name": "R...
209392510_23
class AbstractWebhookController { public void init() { try { this.createSubscriptions(); } catch (Exception e) { LOG.error("Error on try to create subscription", e); throw e; } } public AbstractWebhookController(MessageEventCallback messageEventHandler); public AbstractWebhookController( Messag...
subscriptions = new Subscription[] { messageStatusSubscription() }; AbstractClient client = new TestClient("TOKEN"); AbstractWebhookController webhook = new TestWebhookController(messageStatusHandler, client, "http://localhost", ChannelType.whatsapp ); webhook.init(); assertTrue(subscriptionListed); assertF...
[FOCAL] public void AbstractWebhookController.init() [CLASS] class AbstractWebhookController [METRICS] loc=8 cc=2 branches=0 loops=0 returns=0 throws=1 nesting=1 [CALLS-INTERNAL] void createSubscriptions() [CALLS-EXTERNAL] LOG.error/2 [EXCEPTIONS] throws throw e; catches Exception e [THROWS-WHEN] e when try-body throws...
/* static context [FOCAL] public void AbstractWebhookController.init() [THROWS-WHEN] e when try-body throws [PATH1] try-body throws -> throw e [EXCEPTIONS] throws throw e; catches Exception e [CALLS-INTERNAL] void createSubscriptions() [CALLS-EXTERNAL] LOG.error/2 */
/* static context [FOCAL] public void AbstractWebhookController.init() [THROWS-WHEN] e when try-body throws [PATH1] try-body throws -> throw e [EXCEPTIONS] throws throw e; catches Exception e [CALLS-INTERNAL] void createSubscriptions() [CALLS-EXTERNAL] LOG.error/2 */ class AbstractWebhookController { public void init...
true
ok
{"focal": {"class": "AbstractWebhookController", "name": "init", "signature": "void init()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "AbstractWebhookController", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "me...
209484041_160
class BackupManagerService { public void dataChanged(@UserIdInt int userId, String packageName) { UserBackupManagerService userBackupManagerService = getServiceForUserIfCallerHasPermission(userId, "dataChanged()"); if (userBackupManagerService != null) { userBackupManag...
BackupManagerService backupManagerService = createServiceAndRegisterUser(mUserOneId, mUserOneService); setCallerAndGrantInteractUserPermission(mUserOneId, /* shouldGrantPermission */ false); backupManagerService.dataChanged(mUserOneId, TEST_PACKAGE); verify(mUserOneServ...
[FOCAL] public void BackupManagerService.dataChanged(int userId, String packageName) [CLASS] class BackupManagerService [METRICS] loc=8 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] UserBackupManagerService getServiceForUserIfCallerHasPermission(int userId, String caller) [CALLS-EXTERNAL] UserBa...
/* static context [FOCAL] public void BackupManagerService.dataChanged(int userId, String packageName) [PATH1] if(userBackupManagerService != null)=T [PATH2] if(userBackupManagerService != null)=F [INPUTS] branches=userId | result=- [CALLS-INTERNAL] UserBackupManagerService getServiceForUserIfCallerHasPermission(int us...
/* static context [FOCAL] public void BackupManagerService.dataChanged(int userId, String packageName) [PATH1] if(userBackupManagerService != null)=T [PATH2] if(userBackupManagerService != null)=F [INPUTS] branches=userId | result=- [CALLS-INTERNAL] UserBackupManagerService getServiceForUserIfCallerHasPermission(int us...
true
ok
{"focal": {"class": "BackupManagerService", "name": "dataChanged", "signature": "void dataChanged(int userId, String packageName)", "start_line": 3, "modifiers": "public", "params": [{"name": "userId", "type": "int"}, {"name": "packageName", "type": "String"}], "return_type": "void"}, "class_info": {"name": "BackupMana...
209677008_4
class App { public String getGreeting() { return "[SMTP Client] Welcome to SMTP Client."; } public Properties getEmailProperties(String propertiesPath); public String buildPrompt(); public String maskPassword(String password); public void sendEmail(Properties props); public static ...
App classUnderTest = new App(); assertNotNull("app should have a greeting", classUnderTest.getGreeting()); } }
[FOCAL] public String App.getGreeting() [CLASS] class App [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Properties getEmailProperties(String propertiesPath); String buildPrompt(); String maskPassword(String password); void sendEmail(Properties props); void main(String[] args) [TES...
/* static context [FOCAL] public String App.getGreeting() */
/* static context [FOCAL] public String App.getGreeting() */ class App { public String getGreeting() { return "[SMTP Client] Welcome to SMTP Client."; } public Properties getEmailProperties(String propertiesPath); public String buildPrompt(); public String maskPassword(String password); ...
true
ok
{"focal": {"class": "App", "name": "getGreeting", "signature": "String getGreeting()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "App", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "getEmailPrope...
209731679_7
class ImmutableGroup implements CommandGroup { @Nonnull @Override public Set<ImmutableGroup> getChildren() { return children; } private ImmutableGroup( ImmutableGroup parent, Set<String> names, Set<? extends CommandCallable> commands); @Nonnull public static CommandGroup merge(@Nonnull Command...
assertThrows(UnsupportedOperationException.class, () -> group.getChildren().clear(), "children set is not immutable"); } }
[FOCAL] @Nonnull @Override public Set<ImmutableGroup> ImmutableGroup.getChildren() [CLASS] class ImmutableGroup implements CommandGroup [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] ImmutableGroup(ImmutableGroup parent, Set<String> names, Set<? extends CommandCallable> commands); ...
/* static context [FOCAL] @Nonnull @Override public Set<ImmutableGroup> ImmutableGroup.getChildren() */
/* static context [FOCAL] @Nonnull @Override public Set<ImmutableGroup> ImmutableGroup.getChildren() */ class ImmutableGroup implements CommandGroup { @Nonnull @Override public Set<ImmutableGroup> getChildren() { return children; } private ImmutableGroup( ImmutableGroup parent, Set<String> names,...
true
ok
{"focal": {"class": "ImmutableGroup", "name": "getChildren", "signature": "Set<ImmutableGroup> getChildren()", "start_line": 3, "modifiers": "@Nonnull @Override public", "params": [], "return_type": "Set<ImmutableGroup>"}, "class_info": {"name": "ImmutableGroup", "kind": "class", "modifiers": "", "superclass": null, "i...
209813646_10
class Streams { @NotNull public static <T> ReferencedOptional<T> filterToReference(@NotNull Collection<T> in, @NotNull Predicate<T> predicate) { return ReferencedOptional.build(filter(in, predicate)); } private Streams(); @NotNull public static List<String> toLowerCase(@NotNull Collectio...
Map<String, String> map = new HashMap<>(); map.put("ok", "cool"); map.put("derklaro", "cool"); map.put("reformcloud", "good"); ReferencedOptional<String> optional = Streams.filterToReference(map, t -> t.equals("ok")); Assertions.assertTrue(optional.isPresent()); ...
[FOCAL] @NotNull public static ReferencedOptional<T> Streams.filterToReference(Collection<T> in, Predicate<T> predicate) [CLASS] class Streams [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] T filter(Collection<T> in, Predicate<T> predicate) [CALLS-EXTERNAL] ReferencedOptional.buil...
/* static context [FOCAL] @NotNull public static ReferencedOptional<T> Streams.filterToReference(Collection<T> in, Predicate<T> predicate) [INPUTS] branches=- | result=in, predicate [CALLS-INTERNAL] T filter(Collection<T> in, Predicate<T> predicate) [CALLS-EXTERNAL] ReferencedOptional.build/1 */
/* static context [FOCAL] @NotNull public static ReferencedOptional<T> Streams.filterToReference(Collection<T> in, Predicate<T> predicate) [INPUTS] branches=- | result=in, predicate [CALLS-INTERNAL] T filter(Collection<T> in, Predicate<T> predicate) [CALLS-EXTERNAL] ReferencedOptional.build/1 */ class Streams { @N...
true
ok
{"focal": {"class": "Streams", "name": "filterToReference", "signature": "ReferencedOptional<T> filterToReference(Collection<T> in, Predicate<T> predicate)", "start_line": 3, "modifiers": "@NotNull public static", "params": [{"name": "in", "type": "Collection<T>"}, {"name": "predicate", "type": "Predicate<T>"}], "retur...
209854470_7
class PersonController { @GetMapping(value = "/list") public String list(Model model) { logger.info("Populating model with list..."); List<Person> persons = personService.findAll(); persons.sort(COMPARATOR_BY_ID); model.addAttribute("persons", persons); return "persons/...
List<Person> list = new ArrayList<>(); Person p = new Person(); p.setId(1L); list.add(p); when(mockService.findAll()).thenReturn(list); ExtendedModelMap model = new ExtendedModelMap(); String viewName = personController.list(model); List<Person> persons ...
[FOCAL] @GetMapping(value = "/list") public String PersonController.list(Model model) [CLASS] class PersonController [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] logger.info/1, personService.findAll/0, List<Person>.sort/1, Model.addAttribute/2 [COLLABORATORS] field personService...
/* static context [FOCAL] @GetMapping(value = "/list") public String PersonController.list(Model model) [COLLABORATORS] field personService findAll/0; param model:Model addAttribute/2 [CALLS-EXTERNAL] logger.info/1, personService.findAll/0, List<Person>.sort/1, Model.addAttribute/2 */
/* static context [FOCAL] @GetMapping(value = "/list") public String PersonController.list(Model model) [COLLABORATORS] field personService findAll/0; param model:Model addAttribute/2 [CALLS-EXTERNAL] logger.info/1, personService.findAll/0, List<Person>.sort/1, Model.addAttribute/2 */ class PersonController { @Get...
true
ok
{"focal": {"class": "PersonController", "name": "list", "signature": "String list(Model model)", "start_line": 3, "modifiers": "@GetMapping(value = \"/list\") public", "params": [{"name": "model", "type": "Model"}], "return_type": "String"}, "class_info": {"name": "PersonController", "kind": "class", "modifiers": "", "...
210029529_0
class ProjectComparator { static <K> Comparator<K> create0(DependencyGraph<K> dependencyGraph, Map<String, AtomicLong> historicalServiceTimes, Function<K, String> toKey) { final long defaultServiceTime = average(historicalServiceTimes.values()); final Map<K, Long> serviceTi...
MavenProject a = newProject("a"), b = newProject("b"), c = newProject("c"); TestProjectDependencyGraph graph = new TestProjectDependencyGraph(a, b, c); graph.addDependency(b, a); DependencyGraph<MavenProject> dp = DependencyGraph.fromMaven(graph, null); Comparator<MavenProject> ...
[FOCAL] static Comparator<K> ProjectComparator.create0(DependencyGraph<K> dependencyGraph, Map<String, AtomicLong> historicalServiceTimes, Function<K, String> toKey) [CLASS] class ProjectComparator [METRICS] loc=22 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] Map<K, Long> calculateWeights(Depen...
/* static context [FOCAL] static Comparator<K> ProjectComparator.create0(DependencyGraph<K> dependencyGraph, Map<String, AtomicLong> historicalServiceTimes, Function<K, String> toKey) [INPUTS] branches=- | result=dependencyGraph, toKey [COLLABORATORS] param historicalServiceTimes:Map<String, AtomicLong> values/0; param...
/* static context [FOCAL] static Comparator<K> ProjectComparator.create0(DependencyGraph<K> dependencyGraph, Map<String, AtomicLong> historicalServiceTimes, Function<K, String> toKey) [INPUTS] branches=- | result=dependencyGraph, toKey [COLLABORATORS] param historicalServiceTimes:Map<String, AtomicLong> values/0; param...
true
ok
{"focal": {"class": "ProjectComparator", "name": "create0", "signature": "Comparator<K> create0(DependencyGraph<K> dependencyGraph, Map<String, AtomicLong> historicalServiceTimes, Function<K, String> toKey)", "start_line": 3, "modifiers": "static", "params": [{"name": "dependencyGraph", "type": "DependencyGraph<K>"}, {...
210288653_100
class AbstractDir implements DirInterface { public static String normalizePath(final String path) { return path.replace('\\', SEPARATORCHAR); } protected File getCorrespondingRoot(final File file); public static String pathFromURI(String path); @Override public SessionInterface getSession(); @Override...
assertEquals("single relative filename", "test.dat", AbstractDir.normalizePath("test.dat")); assertEquals("relative path (unix)", "foo/test.dat", AbstractDir.normalizePath("foo/test.dat")); assertEquals("absolute path (unix)", "/foo/test.dat", AbstractDir.n...
[FOCAL] public static String AbstractDir.normalizePath(String path) [CLASS] class AbstractDir implements DirInterface [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] String.replace/2 [INPUTS] branches=- | result=path [DATAFLOW] path@param->L2 [CLASS-MEMBERS] File getCorrespondingRo...
/* static context [FOCAL] public static String AbstractDir.normalizePath(String path) [INPUTS] branches=- | result=path [CALLS-EXTERNAL] String.replace/2 */
/* static context [FOCAL] public static String AbstractDir.normalizePath(String path) [INPUTS] branches=- | result=path [CALLS-EXTERNAL] String.replace/2 */ class AbstractDir implements DirInterface { public static String normalizePath(final String path) { return path.replace('\\', SEPARATORCHAR); } protect...
true
ok
{"focal": {"class": "AbstractDir", "name": "normalizePath", "signature": "String normalizePath(String path)", "start_line": 3, "modifiers": "public static", "params": [{"name": "path", "type": "String"}], "return_type": "String"}, "class_info": {"name": "AbstractDir", "kind": "class", "modifiers": "", "superclass": nul...
210292685_59
class NumberOfTicksCriterion extends AbstractAnalysisCriterion { @Override public double calculate(TimeSeries series, TradingRecord tradingRecord) { int nTicks = 0; for (Trade trade : tradingRecord.getTrades()) { nTicks += calculate(series, trade); } return nTicks; ...
MockTimeSeries series = new MockTimeSeries(100, 105, 110, 100, 95, 105); TradingRecord tradingRecord = new TradingRecord( Order.buyAt(0), Order.sellAt(2), Order.buyAt(3), Order.sellAt(5)); AnalysisCriterion numberOfTicks = new NumberOfTicksCriterion(); as...
[FOCAL] @Override public double NumberOfTicksCriterion.calculate(TimeSeries series, TradingRecord tradingRecord) [CLASS] class NumberOfTicksCriterion extends AbstractAnalysisCriterion [METRICS] loc=8 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] double calculate(TimeSeries series, Trade trade) [...
/* static context [FOCAL] @Override public double NumberOfTicksCriterion.calculate(TimeSeries series, TradingRecord tradingRecord) [PATH1] foreach(Trade trade : tradingRecord.getTrades())=T -> exit loop -> return nTicks [PATH2] foreach(Trade trade : tradingRecord.getTrades())=F -> return nTicks [INPUTS] branches=tradin...
/* static context [FOCAL] @Override public double NumberOfTicksCriterion.calculate(TimeSeries series, TradingRecord tradingRecord) [PATH1] foreach(Trade trade : tradingRecord.getTrades())=T -> exit loop -> return nTicks [PATH2] foreach(Trade trade : tradingRecord.getTrades())=F -> return nTicks [INPUTS] branches=tradin...
true
ok
{"focal": {"class": "NumberOfTicksCriterion", "name": "calculate", "signature": "double calculate(TimeSeries series, TradingRecord tradingRecord)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "series", "type": "TimeSeries"}, {"name": "tradingRecord", "type": "TradingRecord"}], "return_type": "...
210568703_68
class GroupByRowComparator implements Comparator<MemoryResultSetRow> { @Override public int compare(final MemoryResultSetRow o1, final MemoryResultSetRow o2) { if (!selectStatement.getOrderByItems().isEmpty()) { return compare(o1, o2, selectStatement.getOrderByItems()); } re...
MemoryResultSetRow o1 = new MemoryResultSetRow(mockResult("1", "2")); MemoryResultSetRow o2 = new MemoryResultSetRow(mockResult("1", "2")); SelectStatement selectStatement = new SelectStatement(); selectStatement.getGroupByItems().addAll(Arrays.asList(new OrderItem(1, OrderType.ASC), new...
[FOCAL] @Override public int GroupByRowComparator.compare(MemoryResultSetRow o1, MemoryResultSetRow o2) [CLASS] class GroupByRowComparator implements Comparator<MemoryResultSetRow> [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] int compare(MemoryResultSetRow o1, MemoryResultSetRow...
/* static context [FOCAL] @Override public int GroupByRowComparator.compare(MemoryResultSetRow o1, MemoryResultSetRow o2) [PATH1] if(!selectStatement.getOrderByItems().isEmpty())=T -> return compare(o1, o2, selectStatement.getOrderByItems()) [PATH2] if(!selectStatement.getOrderByItems().isEmpty())=F -> return compare(o...
/* static context [FOCAL] @Override public int GroupByRowComparator.compare(MemoryResultSetRow o1, MemoryResultSetRow o2) [PATH1] if(!selectStatement.getOrderByItems().isEmpty())=T -> return compare(o1, o2, selectStatement.getOrderByItems()) [PATH2] if(!selectStatement.getOrderByItems().isEmpty())=F -> return compare(o...
true
ok
{"focal": {"class": "GroupByRowComparator", "name": "compare", "signature": "int compare(MemoryResultSetRow o1, MemoryResultSetRow o2)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "o1", "type": "MemoryResultSetRow"}, {"name": "o2", "type": "MemoryResultSetRow"}], "return_type": "int"}, "class...
210933087_17
class PatchLogger { public String getName() { return slf4jLogger.getName(); } private PatchLogger(String name); PatchLogger(org.slf4j.Logger logger); public static PatchLogger getLogger(String name); public static PatchLogger getLogger(String name, String resourceBundleName); org.slf4j.Logger g...
Set<MethodSignature> patchLoggerMethods = new HashSet<>(); for (Method method : PatchLogger.class.getMethods()) { MethodSignature methodSignature = new MethodSignature(); methodSignature.name = method.getName(); for (Class<?> clazz : method.getParameterTypes()) { String parameterType =...
[FOCAL] public String PatchLogger.getName() [CLASS] class PatchLogger [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] slf4jLogger.getName/0 [COLLABORATORS] field slf4jLogger getName/0 [CLASS-MEMBERS] PatchLogger(String name); PatchLogger(org.slf4j.Logger logger); PatchLogger getLog...
/* static context [FOCAL] public String PatchLogger.getName() [COLLABORATORS] field slf4jLogger getName/0 [CALLS-EXTERNAL] slf4jLogger.getName/0 */
/* static context [FOCAL] public String PatchLogger.getName() [COLLABORATORS] field slf4jLogger getName/0 [CALLS-EXTERNAL] slf4jLogger.getName/0 */ class PatchLogger { public String getName() { return slf4jLogger.getName(); } private PatchLogger(String name); PatchLogger(org.slf4j.Logger logger); pu...
true
ok
{"focal": {"class": "PatchLogger", "name": "getName", "signature": "String getName()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "PatchLogger", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Patch...
210939728_0
class Enforcer { public List<T> absent() { if (this.configured.isEmpty()) { return Collections.emptyList(); } Collection<T> existing = this.existing.get(); return Collections.unmodifiableList( this.configured .stream() .filter(c -> existing.stream().noneMatch(e -...
enforcer = new DummyEnforcer(dummies, () -> singletonList(dummies.get(0))); Assert.assertEquals(singletonList(dummies.get(1)), enforcer.absent()); } }
[FOCAL] public List<T> Enforcer.absent() [CLASS] class Enforcer [METRICS] loc=12 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] this.configured.isEmpty/0, Collections.emptyList/0, this.existing.get/0, Collections.unmodifiableList/1, this.configured .stream() .filter(c -> existing.stream().....col...
/* static context [FOCAL] public List<T> Enforcer.absent() [PATH1] if(this.configured.isEmpty())=T -> return Collections.emptyList() [PATH2] if(this.configured.isEmpty())=F -> return Collections.unmodifiableList( this.configured .stream() .filter(c -... [COLLABORATORS] field configured isEmpty/0,stream/0; field isEqual...
/* static context [FOCAL] public List<T> Enforcer.absent() [PATH1] if(this.configured.isEmpty())=T -> return Collections.emptyList() [PATH2] if(this.configured.isEmpty())=F -> return Collections.unmodifiableList( this.configured .stream() .filter(c -... [COLLABORATORS] field configured isEmpty/0,stream/0; field isEqual...
true
ok
{"focal": {"class": "Enforcer", "name": "absent", "signature": "List<T> absent()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<T>"}, "class_info": {"name": "Enforcer", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "dummies", "type": "List<Du...
211090195_79
class CaptionJsonSerializer implements JsonSerializer<Caption> { public Caption deserialize(JSONObject response) throws JSONException { Caption caption = new Caption(); if (response.has("uri")) { caption.setUri(response.getString("uri")); } if (response.has("src")) { ...
assertTrue(captionJsonSerializer.deserialize(new JSONArray()).isEmpty()); } }
[FOCAL] public Caption CaptionJsonSerializer.deserialize(JSONObject response) [CLASS] class CaptionJsonSerializer implements JsonSerializer<Caption> [METRICS] loc=16 cc=5 branches=4 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] JSONObject.has/1, Caption.setUri/1, JSONObject.getString/1, Caption.setSrc/1, Captio...
/* static context [FOCAL] public Caption CaptionJsonSerializer.deserialize(JSONObject response) [PATH1] if(response.has("uri"))=T -> if(response.has("src"))=T -> if(response.has("srclang"))=T -> if(response.has("default"))=T -> return caption [PATH2] if(response.has("uri"))=F -> if(response.has("src"))=F -> if(response...
/* static context [FOCAL] public Caption CaptionJsonSerializer.deserialize(JSONObject response) [PATH1] if(response.has("uri"))=T -> if(response.has("src"))=T -> if(response.has("srclang"))=T -> if(response.has("default"))=T -> return caption [PATH2] if(response.has("uri"))=F -> if(response.has("src"))=F -> if(response...
true
ok
{"focal": {"class": "CaptionJsonSerializer", "name": "deserialize", "signature": "Caption deserialize(JSONObject response) throws JSONException", "start_line": 3, "modifiers": "public", "params": [{"name": "response", "type": "JSONObject"}], "return_type": "Caption"}, "class_info": {"name": "CaptionJsonSerializer", "ki...
211099032_1
class DirectDependencies implements ModelRunner { public static Result calculate(Graph graph) { TraceTraversal<Vertex, Vertex> leafs = graph.traversal(TraceTraversalSource.class).leafSpans(); // service to its dependencies Map<String, Set<String>> dependencies = new LinkedHashMap<>(); // service to ...
Span root = Util.newTrace("root", "root"); Span child = Util.newChild("child", "child", root); Span child2 = Util.newChild("child2", "child2", root); Span child2Child = Util.newChild("child2", "child2Child", child2); Span child2ChildChild = Util.newChild("child2ChildChild", "child2ChildChild", child...
[FOCAL] public static Result DirectDependencies.calculate(Graph graph) [CLASS] class DirectDependencies implements ModelRunner [METRICS] loc=38 cc=6 branches=3 loops=2 returns=1 throws=0 nesting=4 [CALLS-EXTERNAL] graph.traversal(TraceTraversalSource.class).leafSpans/0, Graph.traversal/1, TraceTraversal<Vertex, Vertex>...
/* static context [FOCAL] public static Result DirectDependencies.calculate(Graph graph) [PATH1] while(leafs.hasNext())=T -> while(parent != null)=T -> if(!nodeSpan.serviceName.equals(parentSpan.serviceName))=T -> if(d == null)=T -> if(p == null)=T -> exit loop -> exit loop -> return new Result(Collections.unmodifiable...
/* static context [FOCAL] public static Result DirectDependencies.calculate(Graph graph) [PATH1] while(leafs.hasNext())=T -> while(parent != null)=T -> if(!nodeSpan.serviceName.equals(parentSpan.serviceName))=T -> if(d == null)=T -> if(p == null)=T -> exit loop -> exit loop -> return new Result(Collections.unmodifiable...
true
ok
{"focal": {"class": "DirectDependencies", "name": "calculate", "signature": "Result calculate(Graph graph)", "start_line": 3, "modifiers": "public static", "params": [{"name": "graph", "type": "Graph"}], "return_type": "Result"}, "class_info": {"name": "DirectDependencies", "kind": "class", "modifiers": "", "superclass...
211175076_2
class ApkPathUtils { public String name(final TokenMatcher.State state) { // See: https://wiki.alpinelinux.org/wiki/APKBUILD_Reference#pkgver Pattern pattern = Pattern.compile("(.*)-([.0-9]+[a-zA-Z]?)(_?(alpha|beta|pre|rc|cvs|svn|git|hg|p)?([0-9]+)?)?-r([0-9]+)"); String filename = match(state, "fi...
when(state.getTokens()).thenReturn(tokens); when(tokens.get("filename")).thenReturn("lua5.3-libs-5.3.5-r2"); assertThat(underTest.name(state), is(equalTo("lua5.3-libs"))); } }
[FOCAL] public String ApkPathUtils.name(TokenMatcher.State state) [CLASS] class ApkPathUtils [METRICS] loc=15 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] String match(TokenMatcher.State state, String name) [CALLS-EXTERNAL] Pattern.compile/1, Pattern.matcher/1, Matcher.find/0, Matcher.toMatchRe...
/* static context [FOCAL] public String ApkPathUtils.name(TokenMatcher.State state) [PATH1] if(matcher.find())=T -> return matchResult.group(1) [PATH2] if(matcher.find())=F -> return "" [INPUTS] branches=state | result=state [CALLS-INTERNAL] String match(TokenMatcher.State state, String name) [CALLS-EXTERNAL] Pattern.c...
/* static context [FOCAL] public String ApkPathUtils.name(TokenMatcher.State state) [PATH1] if(matcher.find())=T -> return matchResult.group(1) [PATH2] if(matcher.find())=F -> return "" [INPUTS] branches=state | result=state [CALLS-INTERNAL] String match(TokenMatcher.State state, String name) [CALLS-EXTERNAL] Pattern.c...
true
ok
{"focal": {"class": "ApkPathUtils", "name": "name", "signature": "String name(TokenMatcher.State state)", "start_line": 3, "modifiers": "public", "params": [{"name": "state", "type": "TokenMatcher.State"}], "return_type": "String"}, "class_info": {"name": "ApkPathUtils", "kind": "class", "modifiers": "", "superclass": ...
211330796_63
class ST_Loc extends STBase { public String parent() { int indexOf = loc.lastIndexOf('/'); if (indexOf == -1) { return ""; } return loc.substring(0, indexOf); } public ST_Loc(String path); public static ST_Loc getInstance(String loc); public static ST_...
ST_Loc loc = new ST_Loc("Doc_9/Pages/Page_0/Content.xml"); assertEquals("Doc_9/Pages/Page_0", loc.parent()); loc = new ST_Loc("Content.xml"); assertEquals("", loc.parent()); } }
[FOCAL] public String ST_Loc.parent() [CLASS] class ST_Loc extends STBase [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] loc.lastIndexOf/1, loc.substring/2 [PATH1] if(indexOf == -1)=T -> return "" [PATH2] if(indexOf == -1)=F -> return loc.substring(0, indexOf) [COLLABORATORS] fiel...
/* static context [FOCAL] public String ST_Loc.parent() [PATH1] if(indexOf == -1)=T -> return "" [PATH2] if(indexOf == -1)=F -> return loc.substring(0, indexOf) [COLLABORATORS] field loc lastIndexOf/1,substring/2 [CALLS-EXTERNAL] loc.lastIndexOf/1, loc.substring/2 */
/* static context [FOCAL] public String ST_Loc.parent() [PATH1] if(indexOf == -1)=T -> return "" [PATH2] if(indexOf == -1)=F -> return loc.substring(0, indexOf) [COLLABORATORS] field loc lastIndexOf/1,substring/2 [CALLS-EXTERNAL] loc.lastIndexOf/1, loc.substring/2 */ class ST_Loc extends STBase { public String par...
true
ok
{"focal": {"class": "ST_Loc", "name": "parent", "signature": "String parent()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "ST_Loc", "kind": "class", "modifiers": "", "superclass": "STBase", "interfaces": null, "fields": [], "members": [{"name": "ST_Loc", "kin...
211971342_16
class ApplicationsService implements ApplicationsApi { @Override public void deleteApplication(final String applicationId) { log.info("Deleting application {}", applicationId); ApplicationRecord applicationRecord = loadApplication(applicationId); Map<String, AttributeValue> expressionAttributeValues = ...
String userId = UUID.randomUUID().toString(); String applicationId = UUID.randomUUID().toString(); Long version = 1L; Map<String, AttributeValue> recordMap = keyMap(userId, applicationId); recordMap.put("version", AttributeValue.builder().n(version.toString()).build()); GetItemResponse response ...
[FOCAL] @Override public void ApplicationsService.deleteApplication(String applicationId) [CLASS] class ApplicationsService implements ApplicationsApi [METRICS] loc=15 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] ApplicationRecord loadApplication(String applicationId); Map<String, AttributeValu...
/* static context [FOCAL] @Override public void ApplicationsService.deleteApplication(String applicationId) [COLLABORATORS] field dynamodb:DynamoDbClient deleteItem/1 [CALLS-INTERNAL] ApplicationRecord loadApplication(String applicationId); Map<String, AttributeValue> toKeyRecord(String applicationId) [FIELDS] read=dyn...
/* static context [FOCAL] @Override public void ApplicationsService.deleteApplication(String applicationId) [COLLABORATORS] field dynamodb:DynamoDbClient deleteItem/1 [CALLS-INTERNAL] ApplicationRecord loadApplication(String applicationId); Map<String, AttributeValue> toKeyRecord(String applicationId) [FIELDS] read=dyn...
true
ok
{"focal": {"class": "ApplicationsService", "name": "deleteApplication", "signature": "void deleteApplication(String applicationId)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "applicationId", "type": "String"}], "return_type": "void"}, "class_info": {"name": "ApplicationsService", "kind": "c...
212300461_2
class ClusterH2DaoImpl implements ClusterDao { @Override public ClusterEntity selectByCluster(String cluster) { return transferEntity(clusterJpaRepository.findFirstByAndCluster(cluster)); } @Override public void insert(ClusterEntity clusterEntity); @Override @Transactional public void upda...
ClusterH2Entity envH2Entity = insertOneData(); ClusterEntity envEntity = clusterDao.selectByCluster(envH2Entity.getCluster()); Assert.assertNotNull(envEntity); assertEqualWithIgnore(envH2Entity, envEntity, "id"); clusterJpaRepository.deleteById(envH2Entity.getId()); } }
[FOCAL] @Override public ClusterEntity ClusterH2DaoImpl.selectByCluster(String cluster) [CLASS] class ClusterH2DaoImpl implements ClusterDao [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] ClusterEntity transferEntity(ClusterH2Entity envH2Entity) [CALLS-EXTERNAL] ClusterJpaReposito...
/* static context [FOCAL] @Override public ClusterEntity ClusterH2DaoImpl.selectByCluster(String cluster) [INPUTS] branches=- | result=cluster, clusterJpaRepository [COLLABORATORS] field clusterJpaRepository:ClusterJpaRepository findFirstByAndCluster/1 [CALLS-INTERNAL] ClusterEntity transferEntity(ClusterH2Entity envH2...
/* static context [FOCAL] @Override public ClusterEntity ClusterH2DaoImpl.selectByCluster(String cluster) [INPUTS] branches=- | result=cluster, clusterJpaRepository [COLLABORATORS] field clusterJpaRepository:ClusterJpaRepository findFirstByAndCluster/1 [CALLS-INTERNAL] ClusterEntity transferEntity(ClusterH2Entity envH2...
true
ok
{"focal": {"class": "ClusterH2DaoImpl", "name": "selectByCluster", "signature": "ClusterEntity selectByCluster(String cluster)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "cluster", "type": "String"}], "return_type": "ClusterEntity"}, "class_info": {"name": "ClusterH2DaoImpl", "kind": "class...
212338967_8
class UserDao { void create(User user) { entityManager.persist(user); } User read(int id); void update(User user); void delete(int id); User readByName(String name); List<User> readAll(); @Mock private EntityManager entityManager; @InjectMocks private UserDao userDao; } class UserDao...
User user = new User(); userDao.create(user); Mockito.verify(entityManager).persist(user); } }
[FOCAL] void UserDao.create(User user) [CLASS] class UserDao [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] EntityManager.persist/1 [FIELDS] read=entityManager:EntityManager [COLLABORATORS] field entityManager:EntityManager persist/1 [DATAFLOW] this.entityManager@param->L2; user@p...
/* static context [FOCAL] void UserDao.create(User user) [COLLABORATORS] field entityManager:EntityManager persist/1 [FIELDS] read=entityManager:EntityManager [CALLS-EXTERNAL] EntityManager.persist/1 */
/* static context [FOCAL] void UserDao.create(User user) [COLLABORATORS] field entityManager:EntityManager persist/1 [FIELDS] read=entityManager:EntityManager [CALLS-EXTERNAL] EntityManager.persist/1 */ class UserDao { void create(User user) { entityManager.persist(user); } User read(int id); void updat...
true
ok
{"focal": {"class": "UserDao", "name": "create", "signature": "void create(User user)", "start_line": 3, "modifiers": "", "params": [{"name": "user", "type": "User"}], "return_type": "void"}, "class_info": {"name": "UserDao", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": ...
212382406_249
class RDBStore implements DBStore { @Override public ArrayList<Table> listTables() { ArrayList<Table> returnList = new ArrayList<>(); for (ColumnFamilyHandle handle : handleTable.values()) { returnList.add(new RDBTable(db, handle, writeOptions, rdbMetrics)); } return returnList; } @Visib...
List<Table> tableList = rdbStore.listTables(); Assert.assertNotNull("Table list cannot be null", tableList); Map<String, Table> hashTable = new HashMap<>(); for (Table t : tableList) { hashTable.put(t.getName(), t); } int count = families.size(); // Assert that we have all the tables...
[FOCAL] @Override public ArrayList<Table> RDBStore.listTables() [CLASS] class RDBStore implements DBStore [METRICS] loc=8 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] handleTable.values/0, ArrayList<Table>.add/1 [NEW] ArrayList<>, RDBTable [PATH1] foreach(ColumnFamilyHandle handle : handleTable...
/* static context [FOCAL] @Override public ArrayList<Table> RDBStore.listTables() [PATH1] foreach(ColumnFamilyHandle handle : handleTable.values())=T -> exit loop -> return returnList [PATH2] foreach(ColumnFamilyHandle handle : handleTable.values())=F -> return returnList [COLLABORATORS] field handleTable values/0 [NEW...
/* static context [FOCAL] @Override public ArrayList<Table> RDBStore.listTables() [PATH1] foreach(ColumnFamilyHandle handle : handleTable.values())=T -> exit loop -> return returnList [PATH2] foreach(ColumnFamilyHandle handle : handleTable.values())=F -> return returnList [COLLABORATORS] field handleTable values/0 [NEW...
true
ok
{"focal": {"class": "RDBStore", "name": "listTables", "signature": "ArrayList<Table> listTables()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "ArrayList<Table>"}, "class_info": {"name": "RDBStore", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "DBStore", "field...
212625733_13
class Path { public boolean matches(String toMatch) { return matches(new Path(toMatch)); } public Path(); public Path(Path path); public Path(String... part); public Path(List<String> parts); public List<String> parts(); public String first(); public String last(); ...
assertTrue(new Path("[{^$}]").matches("")); assertTrue(new Path("*").matches("/something/asdfas/")); assertTrue(new Path("*").matches("something/asdfas/")); assertTrue(new Path("something/{collection:books|customers}").matches("something/books")); assertTrue(new Path("something/...
[FOCAL] public boolean Path.matches(String toMatch) [CLASS] class Path [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] boolean matches(Path concretePath) [NEW] Path [INPUTS] branches=- | result=toMatch [DATAFLOW] toMatch@param->L2 [CLASS-MEMBERS] Path(); Path(Path path); Path(Strin...
/* static context [FOCAL] public boolean Path.matches(String toMatch) [INPUTS] branches=- | result=toMatch [CALLS-INTERNAL] boolean matches(Path concretePath) [NEW] Path */
/* static context [FOCAL] public boolean Path.matches(String toMatch) [INPUTS] branches=- | result=toMatch [CALLS-INTERNAL] boolean matches(Path concretePath) [NEW] Path */ class Path { public boolean matches(String toMatch) { return matches(new Path(toMatch)); } public Path(); public Path(P...
true
ok
{"focal": {"class": "Path", "name": "matches", "signature": "boolean matches(String toMatch)", "start_line": 3, "modifiers": "public", "params": [{"name": "toMatch", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "Path", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "f...
212816799_1
class SinkUtils { public static int getProperty(Map<String, String> props, String propertyName, int defaultValue) { if (props != null) { String propertyValue = props.get(propertyName); if (StringUtils.isNotBlank(propertyValue)) { return Integer.parseInt(propertyValue); } } retu...
assertEquals(TEST_VALUE, SinkUtils.getProperty( ImmutableMap.of(TEST_KEY, String.valueOf(TEST_VALUE)), TEST_KEY, TEST_DEFAULT_VALUE )); } }
[FOCAL] public static int SinkUtils.getProperty(Map<String, String> props, String propertyName, int defaultValue) [CLASS] class SinkUtils [METRICS] loc=10 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] Map<String, String>.get/1, StringUtils.isNotBlank/1, Integer.parseInt/1 [PATH1] if(props != nul...
/* static context [FOCAL] public static int SinkUtils.getProperty(Map<String, String> props, String propertyName, int defaultValue) [PATH1] if(props != null)=T -> if(StringUtils.isNotBlank(propertyValue))=T -> return Integer.parseInt(propertyValue) [PATH2] if(props != null)=F -> return defaultValue [PATH3] if(props != ...
/* static context [FOCAL] public static int SinkUtils.getProperty(Map<String, String> props, String propertyName, int defaultValue) [PATH1] if(props != null)=T -> if(StringUtils.isNotBlank(propertyValue))=T -> return Integer.parseInt(propertyValue) [PATH2] if(props != null)=F -> return defaultValue [PATH3] if(props != ...
true
ok
{"focal": {"class": "SinkUtils", "name": "getProperty", "signature": "int getProperty(Map<String, String> props, String propertyName, int defaultValue)", "start_line": 3, "modifiers": "public static", "params": [{"name": "props", "type": "Map<String, String>"}, {"name": "propertyName", "type": "String"}, {"name": "defa...
212938936_3
class LibraAccountService { public LibraBalance getBalance(String libraAddress) { LibraBalance libraBalance = new LibraBalance(); Long balance = jLibraUtil.findBalance(libraAddress); libraBalance.setLibra(balance/1000000); libraBalance.setLibraMicro(balance); libraBalance.se...
LibraAccount account = libraAccountService.findAccount(1L); LibraBalance balance = libraAccountService.getBalance(account.getLibraAddressToString()); Assert.assertTrue(balance.getLibra() > 0); } }
[FOCAL] public LibraBalance LibraAccountService.getBalance(String libraAddress) [CLASS] class LibraAccountService [METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] jLibraUtil.findBalance/1, LibraBalance.setLibra/1, LibraBalance.setLibraMicro/1, LibraBalance.setLibraAddress/1, log.in...
/* static context [FOCAL] public LibraBalance LibraAccountService.getBalance(String libraAddress) [COLLABORATORS] field jLibraUtil findBalance/1 [NEW] LibraBalance [CALLS-EXTERNAL] jLibraUtil.findBalance/1, LibraBalance.setLibra/1, LibraBalance.setLibraMicro/1, LibraBalance.setLibraAddress/1, log.info/1, LibraBalance.t...
/* static context [FOCAL] public LibraBalance LibraAccountService.getBalance(String libraAddress) [COLLABORATORS] field jLibraUtil findBalance/1 [NEW] LibraBalance [CALLS-EXTERNAL] jLibraUtil.findBalance/1, LibraBalance.setLibra/1, LibraBalance.setLibraMicro/1, LibraBalance.setLibraAddress/1, log.info/1, LibraBalance.t...
true
ok
{"focal": {"class": "LibraAccountService", "name": "getBalance", "signature": "LibraBalance getBalance(String libraAddress)", "start_line": 3, "modifiers": "public", "params": [{"name": "libraAddress", "type": "String"}], "return_type": "LibraBalance"}, "class_info": {"name": "LibraAccountService", "kind": "class", "mo...
213330914_0
class TokenGenerator { @Nonnull String getToken(@Nonnull final TokenConfig tokenConfig, @Nonnull final String issuer) { JwtBuilder builder = Jwts.builder() .setHeaderParam("kid", KEY_ID) // since the specification allows for more than one audience, but JJWT only accepts ...
String token = generator.getToken( aTokenConfig() .withAudience(AUDIENCE) .withAuthorizedParty(AUTHORIZED_PARTY) .withSubject(SUBJECT) .withScope(SCOPE) .withRealmRoles(REALM_ROLES) .withResourceRoles...
[FOCAL] @Nonnull String TokenGenerator.getToken(TokenConfig tokenConfig, String issuer) [CLASS] class TokenGenerator [METRICS] loc=29 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] void setClaimIfPresent(JwtBuilder builder, String claim, String value) [CALLS-EXTERNAL] Jwts.builder() .setHeaderPar...
class TokenGenerator { @Nonnull String getToken(@Nonnull final TokenConfig tokenConfig, @Nonnull final String issuer) { JwtBuilder builder = Jwts.builder() .setHeaderParam("kid", KEY_ID) // since the specification allows for more than one audience, but JJWT only accepts ...
false
ok
{"focal": {"class": "TokenGenerator", "name": "getToken", "signature": "String getToken(TokenConfig tokenConfig, String issuer)", "start_line": 3, "modifiers": "@Nonnull", "params": [{"name": "tokenConfig", "type": "TokenConfig"}, {"name": "issuer", "type": "String"}], "return_type": "String"}, "class_info": {"name": "...
213344827_96
class ConsumedThingProperty extends ThingProperty<T> { public Observable<Optional<T>> observer() throws ConsumedThingException { try { Pair<ProtocolClient, Form> clientAndForm = thing.getClientFor(getForms(), Operation.OBSERVE_PROPERTY); ProtocolClient client = clientAndForm.first()...
when(thing.getClientFor(any(List.class), any())).thenReturn(new Pair(client, form)); when(client.writeResource(any(), any())).thenReturn(completedFuture(null)); when(client.observeResource(any())).thenReturn(observable); ConsumedThingProperty<Object> consumedThingProperty = new Consumed...
[FOCAL] public Observable<Optional<T>> ConsumedThingProperty.observer() [CLASS] class ConsumedThingProperty extends ThingProperty<T> [METRICS] loc=13 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] ConsumedThing.getClientFor/2, getForms/0 (inherited), Pair<ProtocolClient, Form>.first/0, Pair<Proto...
/* static context [FOCAL] public Observable<Optional<T>> ConsumedThingProperty.observer() [THROWS-WHEN] ConsumedThingException when try-body throws [PATH1] try-body throws -> throw new ConsumedThingException(e) [PATH2] return client.observeResource(form) .map(content -> Optional.ofNullable(Co... [INPUTS] branches=- | r...
/* static context [FOCAL] public Observable<Optional<T>> ConsumedThingProperty.observer() [THROWS-WHEN] ConsumedThingException when try-body throws [PATH1] try-body throws -> throw new ConsumedThingException(e) [PATH2] return client.observeResource(form) .map(content -> Optional.ofNullable(Co... [INPUTS] branches=- | r...
true
ok
{"focal": {"class": "ConsumedThingProperty", "name": "observer", "signature": "Observable<Optional<T>> observer() throws ConsumedThingException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Observable<Optional<T>>"}, "class_info": {"name": "ConsumedThingProperty", "kind": "class", "modifiers":...
213594368_20
class VariableAqlPath { public boolean isPartialAqlDataValuePath(){ return getSuffix().matches(jsonPathQualifierMatcher); } public VariableAqlPath(String path); public String getSuffix(); public String getInfix(); } class VariableAqlPathTest { @Test public void testIsPartialAq...
String aPath = "data[at0001]/events[at0002]/data[at0003]/items[at0007]/value"; assertTrue(new VariableAqlPath(aPath).isPartialAqlDataValuePath()); aPath = "data[at0001]/events[at0002]/data[at0003]/items[at0007]/value/magnitude"; assertFalse(new VariableAqlPath(aPath).isPartialAqlDataV...
[FOCAL] public boolean VariableAqlPath.isPartialAqlDataValuePath() [CLASS] class VariableAqlPath [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String getSuffix() [CALLS-EXTERNAL] getSuffix().matches/1 [CLASS-MEMBERS] VariableAqlPath(String path); String getSuffix(); String getInf...
/* static context [FOCAL] public boolean VariableAqlPath.isPartialAqlDataValuePath() [CALLS-INTERNAL] String getSuffix() [CALLS-EXTERNAL] getSuffix().matches/1 */
/* static context [FOCAL] public boolean VariableAqlPath.isPartialAqlDataValuePath() [CALLS-INTERNAL] String getSuffix() [CALLS-EXTERNAL] getSuffix().matches/1 */ class VariableAqlPath { public boolean isPartialAqlDataValuePath(){ return getSuffix().matches(jsonPathQualifierMatcher); } public Var...
true
ok
{"focal": {"class": "VariableAqlPath", "name": "isPartialAqlDataValuePath", "signature": "boolean isPartialAqlDataValuePath()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "VariableAqlPath", "kind": "class", "modifiers": "", "superclass": null, "interfaces": n...
213687575_123
class Polygon extends BasePointCollection { public int getFillColor() { return fillColor; } Polygon(); public int getStrokeColor(); public List<List<LatLng>> getHoles(); public void setFillColor(int color); public void setStrokeColor(int color); public void setHoles(@NonNull List<? extends List...
Polygon polygon = new PolygonOptions().fillColor(1).getPolygon(); assertEquals(1, polygon.getFillColor()); } }
[FOCAL] public int Polygon.getFillColor() [CLASS] class Polygon extends BasePointCollection [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Polygon(); int getStrokeColor(); List<List<LatLng>> getHoles(); void setFillColor(int color); void setStrokeColor(int color); void setHoles(Lis...
/* static context [FOCAL] public int Polygon.getFillColor() */
/* static context [FOCAL] public int Polygon.getFillColor() */ class Polygon extends BasePointCollection { public int getFillColor() { return fillColor; } Polygon(); public int getStrokeColor(); public List<List<LatLng>> getHoles(); public void setFillColor(int color); public void setStrokeColor(...
true
ok
{"focal": {"class": "Polygon", "name": "getFillColor", "signature": "int getFillColor()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "Polygon", "kind": "class", "modifiers": "", "superclass": "BasePointCollection", "interfaces": null, "fields": [], "members": [{"...