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
24634425_374
class Converter { public static String getProviderXML(Provider provider) { return toXML(Provider.class, provider); } public static Provider getProviderObject(String xml); public static String getRootCollectionJSON(List<Provider> providers); private static Collection prepareCollection(List<Provider> provide...
Provider provider = new Provider(); provider.setHref("/11"); provider.setId(11); provider.setName("Nome"); provider.setVmmUrl("Punto final"); Link linkParent = new Link(); linkParent.setRel("parent"); linkParent.setHref("/"); linkParent.setType(PROVIDER_REGISTRY_NAMESPACE); Link linkSelf = new Link(...
[FOCAL] public static String Converter.getProviderXML(Provider provider) [CLASS] class Converter [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String toXML(Class<T> clazz, T t) [INPUTS] branches=- | result=provider [DATAFLOW] provider@param->L3 [CLASS-MEMBERS] Provider getProvide...
/* static context [FOCAL] public static String Converter.getProviderXML(Provider provider) [INPUTS] branches=- | result=provider [CALLS-INTERNAL] String toXML(Class<T> clazz, T t) */
/* static context [FOCAL] public static String Converter.getProviderXML(Provider provider) [INPUTS] branches=- | result=provider [CALLS-INTERNAL] String toXML(Class<T> clazz, T t) */ class Converter { public static String getProviderXML(Provider provider) { return toXML(Provider.class, provider); } public st...
true
ok
{"focal": {"class": "Converter", "name": "getProviderXML", "signature": "String getProviderXML(Provider provider)", "start_line": 3, "modifiers": "public static", "params": [{"name": "provider", "type": "Provider"}], "return_type": "String"}, "class_info": {"name": "Converter", "kind": "class", "modifiers": "", "superc...
24635052_3
class EventMatchCondition extends Condition { public boolean isSatisfied(Event event) { String fieldVal = null; // some information are in the decrypted event (like type) if (event.isEncrypted() && (null != event.getClearEvent())) { JsonObject eventJson = event.getClearEvent()....
condition.key = "content.other_field"; condition.pattern = "other_value"; Assert.assertTrue(condition.isSatisfied(event)); condition.pattern = "*value"; Assert.assertTrue(condition.isSatisfied(event)); condition.pattern = "value"; Assert.assertFalse(condition.is...
[FOCAL] public boolean EventMatchCondition.isSatisfied(Event event) [CLASS] class EventMatchCondition extends Condition [METRICS] loc=35 cc=7 branches=6 loops=0 returns=3 throws=0 nesting=1 [CALLS-INTERNAL] String extractField(JsonObject jsonObject, String fieldPath); String globToRegex(String glob) [CALLS-EXTERNAL] Ev...
/* static context [FOCAL] public boolean EventMatchCondition.isSatisfied(Event event) [PATH1] if(event.isEncrypted() && (null != event.getClearEvent()))=T -> if(TextUtils.isEmpty(fieldVal))#1=T -> if(TextUtils.isEmpty(fieldVal))#2=F -> if(TextUtils.equals(pattern, fieldVal))=F -> if(null == mPatternByRule)=T -> if(null...
/* static context [FOCAL] public boolean EventMatchCondition.isSatisfied(Event event) [PATH1] if(event.isEncrypted() && (null != event.getClearEvent()))=T -> if(TextUtils.isEmpty(fieldVal))#1=T -> if(TextUtils.isEmpty(fieldVal))#2=F -> if(TextUtils.equals(pattern, fieldVal))=F -> if(null == mPatternByRule)=T -> if(null...
true
ok
{"focal": {"class": "EventMatchCondition", "name": "isSatisfied", "signature": "boolean isSatisfied(Event event)", "start_line": 3, "modifiers": "public", "params": [{"name": "event", "type": "Event"}], "return_type": "boolean"}, "class_info": {"name": "EventMatchCondition", "kind": "class", "modifiers": "", "superclas...
24641218_11
class LatticeGUIMustache { public static Stream<String> getKnownTemplates() throws IOException { ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL knownDirURL = cl.getResource(TEMPLATE_DIR); if( knownDirURL == null) { throw new IllegalStateException("Unable to find mustache templates. Erro...
List<String> knownTemplates = LatticeGUIMustache.getKnownTemplates().collect(Collectors.toList()); assertTrue(knownTemplates.size()>0); assertTrue(knownTemplates.stream().anyMatch( t -> t.endsWith(LatticeGUIMustache.TEMPLATE_3DMOL)) ); assertTrue(knownTemplates.stream().anyMatch( t -> t.endsWith(Lat...
[FOCAL] public static Stream<String> LatticeGUIMustache.getKnownTemplates() [CLASS] class LatticeGUIMustache [METRICS] loc=27 cc=4 branches=2 loops=0 returns=1 throws=2 nesting=1 [CALLS-EXTERNAL] Thread.currentThread().getContextClassLoader/0, Thread.currentThread/0, ClassLoader.getResource/1, URL.toURI/0, knownDirURI....
/* static context [FOCAL] public static Stream<String> LatticeGUIMustache.getKnownTemplates() [THROWS-WHEN] IllegalStateException when knownDirURL == null [THROWS-WHEN] IllegalStateException when !(knownDirURL == null) && try-body throws [PATH1] if(knownDirURL == null)=F -> try-body throws -> throw new IllegalStateExce...
/* static context [FOCAL] public static Stream<String> LatticeGUIMustache.getKnownTemplates() [THROWS-WHEN] IllegalStateException when knownDirURL == null [THROWS-WHEN] IllegalStateException when !(knownDirURL == null) && try-body throws [PATH1] if(knownDirURL == null)=F -> try-body throws -> throw new IllegalStateExce...
true
ok
{"focal": {"class": "LatticeGUIMustache", "name": "getKnownTemplates", "signature": "Stream<String> getKnownTemplates() throws IOException", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Stream<String>"}, "class_info": {"name": "LatticeGUIMustache", "kind": "class", "modifiers": "", "supe...
24650339_37
class Utils { public static String getGroupId(PwsResult pwsResult) { // The PWS does not always give us a group id yet. if (pwsResult.getGroupId() == null || pwsResult.getGroupId().equals("")) { try { return new URI(pwsResult.getSiteUrl()).getHost() + pwsResult.getTitle(); } catch (URISyn...
String groupId = "group"; PwsResult mockResult = Mockito.mock(PwsResult.class); Mockito.when(mockResult.getGroupId()).thenReturn(groupId); Assert.assertEquals(groupId, Utils.getGroupId(mockResult)); } }
[FOCAL] public static String Utils.getGroupId(PwsResult pwsResult) [CLASS] class Utils [METRICS] loc=11 cc=3 branches=1 loops=0 returns=3 throws=0 nesting=2 [CALLS-EXTERNAL] PwsResult.getGroupId/0, pwsResult.getGroupId().equals/1, new URI(pwsResult.getSiteUrl()).getHost/0, PwsResult.getSiteUrl/0, PwsResult.getTitle/0 [...
/* static context [FOCAL] public static String Utils.getGroupId(PwsResult pwsResult) [PATH1] if(pwsResult.getGroupId() == null || pwsResult.getGroupId().equals(""))=T -> try-body throws -> return pwsResult.getSiteUrl() [INPUTS] branches=pwsResult | result=pwsResult [EXCEPTIONS] catches URISyntaxException e [NEW] URI */...
/* static context [FOCAL] public static String Utils.getGroupId(PwsResult pwsResult) [PATH1] if(pwsResult.getGroupId() == null || pwsResult.getGroupId().equals(""))=T -> try-body throws -> return pwsResult.getSiteUrl() [INPUTS] branches=pwsResult | result=pwsResult [EXCEPTIONS] catches URISyntaxException e [NEW] URI */...
true
ok
{"focal": {"class": "Utils", "name": "getGroupId", "signature": "String getGroupId(PwsResult pwsResult)", "start_line": 3, "modifiers": "public static", "params": [{"name": "pwsResult", "type": "PwsResult"}], "return_type": "String"}, "class_info": {"name": "Utils", "kind": "class", "modifiers": "", "superclass": null,...
24653868_21
class ACLFileParser { public static AuthorizationsCollector parse(File file) throws ParseException { if (file == null) { LOG.warn("parsing NULL file, so fallback on default configuration!"); return AuthorizationsCollector.emptyImmutableCollector(); } if (!file.exists...
Reader conf = new StringReader("topic /weather/italy/anemometer"); AuthorizationsCollector authorizations = ACLFileParser.parse(conf); // Verify assertTrue(authorizations.canRead(new Topic("/weather/italy/anemometer"), "", "")); assertTrue(authorizations.canWrite(new Topic("/wea...
[FOCAL] public static AuthorizationsCollector ACLFileParser.parse(File file) [CLASS] class ACLFileParser [METRICS] loc=24 cc=4 branches=2 loops=0 returns=4 throws=0 nesting=1 [CALLS-INTERNAL] AuthorizationsCollector parse(Reader reader) [CALLS-EXTERNAL] LOG.warn/1, AuthorizationsCollector.emptyImmutableCollector/0, Fil...
/* static context [FOCAL] public static AuthorizationsCollector ACLFileParser.parse(File file) [PATH1] if(file == null)=F -> if(!file.exists())=F -> try-body throws -> return AuthorizationsCollector.emptyImmutableCollector() [PATH2] if(file == null)=T -> return AuthorizationsCollector.emptyImmutableCollector() [PATH3] ...
/* static context [FOCAL] public static AuthorizationsCollector ACLFileParser.parse(File file) [PATH1] if(file == null)=F -> if(!file.exists())=F -> try-body throws -> return AuthorizationsCollector.emptyImmutableCollector() [PATH2] if(file == null)=T -> return AuthorizationsCollector.emptyImmutableCollector() [PATH3] ...
true
ok
{"focal": {"class": "ACLFileParser", "name": "parse", "signature": "AuthorizationsCollector parse(File file) throws ParseException", "start_line": 3, "modifiers": "public static", "params": [{"name": "file", "type": "File"}], "return_type": "AuthorizationsCollector"}, "class_info": {"name": "ACLFileParser", "kind": "cl...
24676715_0
class ItemsetTree { public ItemsetTree(final Multiset<Integer> singletons) { items = singletons; } public ItemsetTree(final Multiset<Integer> singletons); public Itemset randomWalk(); public void traverse(final ItemsetTreeNode node, final Itemset itemset); public void buildTree(final File inputFile); publi...
final File input = getTestFile("contextItemsetTree.txt"); // database // Get frequency of single items final Multiset<Integer> singletons = ItemsetMining .scanDatabaseToDetermineFrequencyOfSingleItems(input); // Applying the algorithm to build the itemset tree final ItemsetTree itemsetTree = new Itemset...
[FOCAL] public ItemsetTree.ItemsetTree(Multiset<Integer> singletons) [CLASS] class ItemsetTree [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [DATAFLOW] singletons@param->L2 [CLASS-MEMBERS] ItemsetTree(Multiset<Integer> singletons); Itemset randomWalk(); void traverse(ItemsetTreeNode node, Itemset...
/* static context [FOCAL] public ItemsetTree.ItemsetTree(Multiset<Integer> singletons) */
/* static context [FOCAL] public ItemsetTree.ItemsetTree(Multiset<Integer> singletons) */ class ItemsetTree { public ItemsetTree(final Multiset<Integer> singletons) { items = singletons; } public ItemsetTree(final Multiset<Integer> singletons); public Itemset randomWalk(); public void traverse(final ItemsetT...
true
ok
{"focal": {"class": "ItemsetTree", "name": "ItemsetTree", "signature": "ItemsetTree(Multiset<Integer> singletons)", "start_line": 3, "modifiers": "public", "params": [{"name": "singletons", "type": "Multiset<Integer>"}], "return_type": null}, "class_info": {"name": "ItemsetTree", "kind": "class", "modifiers": "", "supe...
24691184_68
class NotificationSettingsInteractor extends ValueInteractor<ArrayList<NotificationSetting>> { public Observable<VoidResponse> disableAll() { return latest().map(this::disableAll) .flatMap(this::updateNotificationSettings); } @Override protected boolean isDataDisposable(); ...
final ArrayList<NotificationSetting> list = new ArrayList<>(1); list.add(create(true)); list.add(create(true)); list.add(create(true)); notificationSettingsInteractor.notificationSettings.onNext(list); Sync.last(notificationSettingsInteractor.disableAll()); for...
[FOCAL] public Observable<VoidResponse> NotificationSettingsInteractor.disableAll() [CLASS] class NotificationSettingsInteractor extends ValueInteractor<ArrayList<NotificationSetting>> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] latest().map(this::disableAll).flatMap/1, latest(...
/* static context [FOCAL] public Observable<VoidResponse> NotificationSettingsInteractor.disableAll() [CALLS-EXTERNAL] latest().map(this::disableAll).flatMap/1, latest().map/1, latest/0 (inherited) */
/* static context [FOCAL] public Observable<VoidResponse> NotificationSettingsInteractor.disableAll() [CALLS-EXTERNAL] latest().map(this::disableAll).flatMap/1, latest().map/1, latest/0 (inherited) */ class NotificationSettingsInteractor extends ValueInteractor<ArrayList<NotificationSetting>> { public Observable<V...
true
ok
{"focal": {"class": "NotificationSettingsInteractor", "name": "disableAll", "signature": "Observable<VoidResponse> disableAll()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Observable<VoidResponse>"}, "class_info": {"name": "NotificationSettingsInteractor", "kind": "class", "modifiers": "", "...
24713325_1
class PropertyInterpolator extends AbstractPropertyLoader { @Override public Optional<String> lookupOptional(String name) { return delegate.lookupOptional(name).map(this::replace); } public PropertyInterpolator(PropertyLoader delegate); private String replace(String value); } class Pro...
PropertyLoader loader = mock(PropertyLoader.class); when(loader.lookupOptional("prop")).thenReturn(Optional.of("{first}-second-{third}")); when(loader.lookupOptional("first")).thenReturn(Optional.empty()); when(loader.lookupOptional("third")).thenReturn(Optional.empty()); String...
[FOCAL] @Override public Optional<String> PropertyInterpolator.lookupOptional(String name) [CLASS] class PropertyInterpolator extends AbstractPropertyLoader [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] delegate.lookupOptional(name).map/1, delegate.lookupOptional/1 [INPUTS] branc...
/* static context [FOCAL] @Override public Optional<String> PropertyInterpolator.lookupOptional(String name) [INPUTS] branches=- | result=name [COLLABORATORS] field delegate lookupOptional/1 [CALLS-EXTERNAL] delegate.lookupOptional(name).map/1, delegate.lookupOptional/1 */
/* static context [FOCAL] @Override public Optional<String> PropertyInterpolator.lookupOptional(String name) [INPUTS] branches=- | result=name [COLLABORATORS] field delegate lookupOptional/1 [CALLS-EXTERNAL] delegate.lookupOptional(name).map/1, delegate.lookupOptional/1 */ class PropertyInterpolator extends AbstractPro...
true
ok
{"focal": {"class": "PropertyInterpolator", "name": "lookupOptional", "signature": "Optional<String> lookupOptional(String name)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "name", "type": "String"}], "return_type": "Optional<String>"}, "class_info": {"name": "PropertyInterpolator", "kind": ...
24748638_22
class JooqBundle implements ConfiguredBundle<C>, JooqConfiguration<C> { @Override public void run(C configuration, Environment environment) throws Exception { // configure primary data source factory configureDataSourceFactory( configuration, environment, ...
jooqBundle.run(new DropwizardConfig(), environment); ArgumentCaptor<JooqHealthCheck> captor = ArgumentCaptor.forClass(JooqHealthCheck.class); verify(healthChecks).register(eq(DEFAULT_NAME), captor.capture()); assertThat(captor.getValue().getValidationQuery()).isEqualTo(validationQueryP...
[FOCAL] @Override public void JooqBundle.run(C configuration, Environment environment) [CLASS] class JooqBundle implements ConfiguredBundle<C>, JooqConfiguration<C> [METRICS] loc=26 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] String primaryDataSourceName(); void configureDataSourceFactory(C co...
/* static context [FOCAL] @Override public void JooqBundle.run(C configuration, Environment environment) [COLLABORATORS] field e getKey/0,getValue/0; param environment:Environment jersey/0 [EXCEPTIONS] declares Exception [CALLS-INTERNAL] String primaryDataSourceName(); void configureDataSourceFactory(C configuration, E...
/* static context [FOCAL] @Override public void JooqBundle.run(C configuration, Environment environment) [COLLABORATORS] field e getKey/0,getValue/0; param environment:Environment jersey/0 [EXCEPTIONS] declares Exception [CALLS-INTERNAL] String primaryDataSourceName(); void configureDataSourceFactory(C configuration, E...
true
ok
{"focal": {"class": "JooqBundle", "name": "run", "signature": "void run(C configuration, Environment environment) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "configuration", "type": "C"}, {"name": "environment", "type": "Environment"}], "return_type": "void"}, "class_info":...
24765223_2
class RESTUserGroupServiceImpl extends BaseRESTServiceImpl implements RESTUserGroupService { @Override public Response insert(RESTInputGroup userGroup) throws NotFoundRestEx, InternalErrorRestEx, ConflictRestEx { // check that no group with same name exists boolean exists; try { ...
{ RESTInputGroup group1 = new RESTInputGroup(); group1.setName("g1"); restUserGroupService.insert(group1); } LOGGER.info("Inserting dup"); try { RESTInputGroup group2 = new RESTInputGroup(); group2.setName("g1"); r...
[FOCAL] @Override public Response RESTUserGroupServiceImpl.insert(RESTInputGroup userGroup) [CLASS] class RESTUserGroupServiceImpl extends BaseRESTServiceImpl implements RESTUserGroupService [METRICS] loc=35 cc=5 branches=1 loops=0 returns=1 throws=3 nesting=1 [CALLS-EXTERNAL] userGroupAdminService.get/1, RESTInputGrou...
/* static context [FOCAL] @Override public Response RESTUserGroupServiceImpl.insert(RESTInputGroup userGroup) [THROWS-WHEN] ConflictRestEx when try-body throws && exists [THROWS-WHEN] InternalErrorRestEx when try-body throws && !exists && try-body throws [THROWS-WHEN] InternalErrorRestEx when try-body throws [THROWS-WH...
/* static context [FOCAL] @Override public Response RESTUserGroupServiceImpl.insert(RESTInputGroup userGroup) [THROWS-WHEN] ConflictRestEx when try-body throws && exists [THROWS-WHEN] InternalErrorRestEx when try-body throws && !exists && try-body throws [THROWS-WHEN] InternalErrorRestEx when try-body throws [THROWS-WH...
true
ok
{"focal": {"class": "RESTUserGroupServiceImpl", "name": "insert", "signature": "Response insert(RESTInputGroup userGroup) throws NotFoundRestEx, InternalErrorRestEx, ConflictRestEx", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "userGroup", "type": "RESTInputGroup"}], "return_type": "Response"}...
24771298_8
class SegmentTemplate extends AbstractStravaOperations implements SegmentOperations { public StravaSegment getSegmentById(String id) { return restTemplate.getForObject(buildUri("/segments/" + id), StravaSegment.class); } public SegmentTemplate(RestTemplate restTemplate, boolean isAuthorizedForUse...
mockServer.expect(requestTo("https://www.strava.com/api/v3/segments/1234")).andExpect(method(GET)) .andExpect(header("Authorization", "Bearer ACCESS_TOKEN")) .andRespond(withSuccess(new ClassPathResource("segment.json", getClass()), MediaType.APPLICATION_JSON)); StravaSegment segment = strava.segment...
[FOCAL] public StravaSegment SegmentTemplate.getSegmentById(String id) [CLASS] class SegmentTemplate extends AbstractStravaOperations implements SegmentOperations [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] restTemplate.getForObject/2, buildUri/1 (inherited) [INPUTS] branches=-...
/* static context [FOCAL] public StravaSegment SegmentTemplate.getSegmentById(String id) [INPUTS] branches=- | result=id [COLLABORATORS] field restTemplate getForObject/2 [CALLS-EXTERNAL] restTemplate.getForObject/2, buildUri/1 (inherited) */
/* static context [FOCAL] public StravaSegment SegmentTemplate.getSegmentById(String id) [INPUTS] branches=- | result=id [COLLABORATORS] field restTemplate getForObject/2 [CALLS-EXTERNAL] restTemplate.getForObject/2, buildUri/1 (inherited) */ class SegmentTemplate extends AbstractStravaOperations implements SegmentOper...
true
ok
{"focal": {"class": "SegmentTemplate", "name": "getSegmentById", "signature": "StravaSegment getSegmentById(String id)", "start_line": 3, "modifiers": "public", "params": [{"name": "id", "type": "String"}], "return_type": "StravaSegment"}, "class_info": {"name": "SegmentTemplate", "kind": "class", "modifiers": "", "sup...
24787461_0
class WebPWriter extends ImageWriter { @Override public void write( IIOMetadata streamMetadata, IIOImage image, ImageWriteParam param ) throws IOException { if ( param == null ) { param = getDefaultWriteParam(); } WebPWriteParam writeParam = (WebPWriteParam) param; ImageOutputStream output ...
final ByteArrayOutputStream baoStream = new ByteArrayOutputStream(); ImageIO.write(im, "webp", baoStream); assertTrue(baoStream.size() > 0); final String testName = "ImageIo"; final File file = createOutputFile(testName, outputName); final FileOutputStream foStream = new FileOutputSt...
[FOCAL] @Override public void WebPWriter.write(IIOMetadata streamMetadata, IIOImage image, ImageWriteParam param) [CLASS] class WebPWriter extends ImageWriter [METRICS] loc=14 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] ImageWriteParam getDefaultWriteParam() [CALLS-EXTERNAL] getOutput/0 (inher...
/* static context [FOCAL] @Override public void WebPWriter.write(IIOMetadata streamMetadata, IIOImage image, ImageWriteParam param) [PATH1] if(param == null)=T [PATH2] if(param == null)=F [INPUTS] branches=param | result=- | unused=streamMetadata [COLLABORATORS] param image:IIOImage getRenderedImage/0 [EXCEPTIONS] decl...
/* static context [FOCAL] @Override public void WebPWriter.write(IIOMetadata streamMetadata, IIOImage image, ImageWriteParam param) [PATH1] if(param == null)=T [PATH2] if(param == null)=F [INPUTS] branches=param | result=- | unused=streamMetadata [COLLABORATORS] param image:IIOImage getRenderedImage/0 [EXCEPTIONS] decl...
true
ok
{"focal": {"class": "WebPWriter", "name": "write", "signature": "void write(IIOMetadata streamMetadata, IIOImage image, ImageWriteParam param) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "streamMetadata", "type": "IIOMetadata"}, {"name": "image", "type": "IIOImage"}, {"nam...
24834448_0
class Information { @Override public int hashCode() { int result = localName != null ? localName.hashCode() : 0; result = 31 * result + (localDescription != null ? localDescription.hashCode() : 0); result = 31 * result + (localPricing != null ? localPricing.hashCode() : 0); retu...
Information first = new Information("Full edition", "Access to all themes", "€ 1.00"); Information second = new Information("Full edition", "Access to all themes", "€ 1.00"); assertEquals(first, second); assertEquals(first.hashCode(), second.hashCode()); } }
[FOCAL] @Override public int Information.hashCode() [CLASS] class Information [METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] localName.hashCode/0, localDescription.hashCode/0, localPricing.hashCode/0 [COLLABORATORS] field localName hashCode/0; field localDescription hashCode/0; fi...
/* static context [FOCAL] @Override public int Information.hashCode() [COLLABORATORS] field localName hashCode/0; field localDescription hashCode/0; field localPricing hashCode/0 [CALLS-EXTERNAL] localName.hashCode/0, localDescription.hashCode/0, localPricing.hashCode/0 */
/* static context [FOCAL] @Override public int Information.hashCode() [COLLABORATORS] field localName hashCode/0; field localDescription hashCode/0; field localPricing hashCode/0 [CALLS-EXTERNAL] localName.hashCode/0, localDescription.hashCode/0, localPricing.hashCode/0 */ class Information { @Override public ...
true
ok
{"focal": {"class": "Information", "name": "hashCode", "signature": "int hashCode()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "Information", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": ...
24855056_82
class TopologyResource { @GET @Path("/{topologyId}") @Produces(MediaType.APPLICATION_JSON) public Topology getTopology(@PathParam("topologyId") String topologyId) { String userId = (String) SecurityUtils.getSubject().getPrincipal(); return topologyService.getTopology(topologyId, userId)...
final Topology mockedTopology = RandomGenerator.randomObject(Topology.class); doReturn(mockedTopology) .when(topologyServiceMock) .getTopology(mockedTopology.getId(), TEST_SUBJECT_ID); mockAuthenticatedSubject(); TopologyCo...
[FOCAL] @GET @Path("/{topologyId}") @Produces(MediaType.APPLICATION_JSON) public Topology TopologyResource.getTopology(String topologyId) [CLASS] class TopologyResource [METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] SecurityUtils.getSubject().getPrincipal/0, SecurityUtils.getSubje...
/* static context [FOCAL] @GET @Path("/{topologyId}") @Produces(MediaType.APPLICATION_JSON) public Topology TopologyResource.getTopology(String topologyId) [INPUTS] branches=- | result=topologyId [COLLABORATORS] field topologyService getTopology/2 [CALLS-EXTERNAL] SecurityUtils.getSubject().getPrincipal/0, SecurityUtil...
/* static context [FOCAL] @GET @Path("/{topologyId}") @Produces(MediaType.APPLICATION_JSON) public Topology TopologyResource.getTopology(String topologyId) [INPUTS] branches=- | result=topologyId [COLLABORATORS] field topologyService getTopology/2 [CALLS-EXTERNAL] SecurityUtils.getSubject().getPrincipal/0, SecurityUtil...
true
ok
{"focal": {"class": "TopologyResource", "name": "getTopology", "signature": "Topology getTopology(String topologyId)", "start_line": 3, "modifiers": "@GET @Path(\"/{topologyId}\") @Produces(MediaType.APPLICATION_JSON) public", "params": [{"name": "topologyId", "type": "String"}], "return_type": "Topology"}, "class_info...
24892974_1
class CodingUtil { public static long readLong(byte[] buffer) { return ((((long) buffer[7] & 0xffL)) | (((long) buffer[6] & 0xffL) << 8) | (((long) buffer[5] & 0xffL) << 16) | (((long) buffer[4] & 0xffL) << 24) | (((long) buffer[3] & 0xffL) << 32) | ...
// Zero ByteBuffer buffer = ByteBuffer.allocate(8); buffer.asLongBuffer().put(0); assertEquals(0, CodingUtil.readLong(buffer.array())); // Max value buffer.position(0); buffer.asLongBuffer().put(Long.MAX_VALUE); assertEquals(Long.MAX_VALUE, CodingUtil.read...
[FOCAL] public static long CodingUtil.readLong(byte[] buffer) [CLASS] class CodingUtil [METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [INPUTS] branches=- | result=buffer [DATAFLOW] buffer@param->L2 [CLASS-MEMBERS] int readInt(byte[] buffer); short readShort(byte[] buffer) [TEST] CodingUtilTest: @...
/* static context [FOCAL] public static long CodingUtil.readLong(byte[] buffer) [INPUTS] branches=- | result=buffer */
/* static context [FOCAL] public static long CodingUtil.readLong(byte[] buffer) [INPUTS] branches=- | result=buffer */ class CodingUtil { public static long readLong(byte[] buffer) { return ((((long) buffer[7] & 0xffL)) | (((long) buffer[6] & 0xffL) << 8) | (((long) buffer[5] & 0xff...
true
ok
{"focal": {"class": "CodingUtil", "name": "readLong", "signature": "long readLong(byte[] buffer)", "start_line": 3, "modifiers": "public static", "params": [{"name": "buffer", "type": "byte[]"}], "return_type": "long"}, "class_info": {"name": "CodingUtil", "kind": "class", "modifiers": "", "superclass": null, "interfac...
24920193_0
class ALU { public static Object plus(Object o1, Object o2) throws IllegalStateException { Class<?> c1 = o1.getClass(); Class<?> c2 = o2.getClass(); if (c1 == String.class || c2 == String.class) { return String.valueOf(o1).concat(String.valueOf(o2)); } if (Number...
Assert.assertEquals(Integer.class, ALU.plus(b, b).getClass()); Assert.assertEquals(Integer.class, ALU.plus(b, s).getClass()); Assert.assertEquals(Integer.class, ALU.plus(b, i).getClass()); Assert.assertEquals(Long.class, ALU.plus(b, l).getClass()); Assert.assertEquals(Float.class...
[FOCAL] public static Object ALU.plus(Object o1, Object o2) [CLASS] class ALU [METRICS] loc=24 cc=9 branches=3 loops=0 returns=5 throws=1 nesting=2 [CALLS-INTERNAL] int getNumberType(Class<?> c1, Class<?> c2) [CALLS-EXTERNAL] Object.getClass/0, String.valueOf(o1).concat/1, String.valueOf/1, Number.class.isAssignableFro...
/* static context [FOCAL] public static Object ALU.plus(Object o1, Object o2) [THROWS-WHEN] IllegalStateException when !(c1 == String.class || c2 == String.class) && Number.class.isAssignableFrom(c1) && Number.class.isAssignableFrom(c2) && switch(getNumberType(c1, c2))=default [THROWS-WHEN] IllegalStateException when !...
/* static context [FOCAL] public static Object ALU.plus(Object o1, Object o2) [THROWS-WHEN] IllegalStateException when !(c1 == String.class || c2 == String.class) && Number.class.isAssignableFrom(c1) && Number.class.isAssignableFrom(c2) && switch(getNumberType(c1, c2))=default [THROWS-WHEN] IllegalStateException when !...
true
ok
{"focal": {"class": "ALU", "name": "plus", "signature": "Object plus(Object o1, Object o2) throws IllegalStateException", "start_line": 3, "modifiers": "public static", "params": [{"name": "o1", "type": "Object"}, {"name": "o2", "type": "Object"}], "return_type": "Object"}, "class_info": {"name": "ALU", "kind": "class"...
24968217_0
class DependencyMediatorMojo extends AbstractMojo { public void execute() throws MojoExecutionException, MojoFailureException { if (isSkip()) { getLog().info(project.getArtifactId() + " skipped compatible checking"); return; } doExecute(); } public boolean i...
File testPom = getTestFile("src/test/resources/unit/pom.xml"); assertNotNull(testPom); assertTrue(testPom.exists()); DependencyMediatorMojo myMojo = (DependencyMediatorMojo) lookupMojo("check", testPom); assertNotNull(myMojo); myMojo.execute(); } }
[FOCAL] public void DependencyMediatorMojo.execute() [CLASS] class DependencyMediatorMojo extends AbstractMojo [METRICS] loc=7 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] boolean isSkip(); void doExecute() [CALLS-EXTERNAL] getLog().info/1, getLog/0 (inherited), project.getArtifactId/0 [EXCEPTI...
/* static context [FOCAL] public void DependencyMediatorMojo.execute() [PATH1] if(isSkip())=T -> return [PATH2] if(isSkip())=F [COLLABORATORS] field project getArtifactId/0 [EXCEPTIONS] declares MojoExecutionException, MojoFailureException [CALLS-INTERNAL] boolean isSkip(); void doExecute() [CALLS-EXTERNAL] getLog().in...
/* static context [FOCAL] public void DependencyMediatorMojo.execute() [PATH1] if(isSkip())=T -> return [PATH2] if(isSkip())=F [COLLABORATORS] field project getArtifactId/0 [EXCEPTIONS] declares MojoExecutionException, MojoFailureException [CALLS-INTERNAL] boolean isSkip(); void doExecute() [CALLS-EXTERNAL] getLog().in...
true
ok
{"focal": {"class": "DependencyMediatorMojo", "name": "execute", "signature": "void execute() throws MojoExecutionException, MojoFailureException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "DependencyMediatorMojo", "kind": "class", "modifiers": "", "superclass...
24989037_0
class TrackerNetJaxbContext { public <T> T unmarshall( String s ) throws JAXBException { return jaxb.unmarshall( s ); } public Function<String, Root> fromXML(); public Function<Root, String> toXML(); @PostConstruct void start(); public String marshall( Root p ); pub...
for( String srcFile : PREDICTIONS ) { try( InputStream is = getClass().getResourceAsStream( srcFile ) ) { Root root = trackerNetJaxbContext.unmarshall( is ); assertNotNull( "no root from unmarshall", root ); assertNotNull( root.get...
[FOCAL] public T TrackerNetJaxbContext.unmarshall(String s) [CLASS] class TrackerNetJaxbContext [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] jaxb.unmarshall/1 [EXCEPTIONS] declares JAXBException [INPUTS] branches=- | result=s [COLLABORATORS] field jaxb unmarshall/1 [DATAFLOW] s@...
/* static context [FOCAL] public T TrackerNetJaxbContext.unmarshall(String s) [INPUTS] branches=- | result=s [COLLABORATORS] field jaxb unmarshall/1 [EXCEPTIONS] declares JAXBException [CALLS-EXTERNAL] jaxb.unmarshall/1 */
/* static context [FOCAL] public T TrackerNetJaxbContext.unmarshall(String s) [INPUTS] branches=- | result=s [COLLABORATORS] field jaxb unmarshall/1 [EXCEPTIONS] declares JAXBException [CALLS-EXTERNAL] jaxb.unmarshall/1 */ class TrackerNetJaxbContext { public <T> T unmarshall( String s ) throws JAXBExc...
true
ok
{"focal": {"class": "TrackerNetJaxbContext", "name": "unmarshall", "signature": "T unmarshall(String s) throws JAXBException", "start_line": 3, "modifiers": "public", "params": [{"name": "s", "type": "String"}], "return_type": "T"}, "class_info": {"name": "TrackerNetJaxbContext", "kind": "class", "modifiers": "", "supe...
25021196_0
class Wenku8API { static Map<String, String> getEncryptedMAP(String str) { Map<String, String> params = new HashMap<>(); params.put("appver=" + BuildConfig.VERSION_NAME + "&request", LightBase64.EncodeBase64(str) + "&timetoken=" + System.currentTimeMillis()); ...
final String str = "test"; Map<String, String> map = Wenku8API.getEncryptedMAP(str); Assert.assertEquals(map.size(), 1); Assert.assertEquals(map.get("request"), LightBase64.EncodeBase64(str + "&timetoken=" + CURRENT_TIME)); } }
[FOCAL] static Map<String, String> Wenku8API.getEncryptedMAP(String str) [CLASS] class Wenku8API [METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Map<String, String>.put/2, LightBase64.EncodeBase64/1, System.currentTimeMillis/0 [NEW] HashMap<> [DATAFLOW] params@L2->L3,L6; str@param-...
/* static context [FOCAL] static Map<String, String> Wenku8API.getEncryptedMAP(String str) [NEW] HashMap<> [CALLS-EXTERNAL] Map<String, String>.put/2, LightBase64.EncodeBase64/1, System.currentTimeMillis/0 */
/* static context [FOCAL] static Map<String, String> Wenku8API.getEncryptedMAP(String str) [NEW] HashMap<> [CALLS-EXTERNAL] Map<String, String>.put/2, LightBase64.EncodeBase64/1, System.currentTimeMillis/0 */ class Wenku8API { static Map<String, String> getEncryptedMAP(String str) { Map<String, String> par...
true
ok
{"focal": {"class": "Wenku8API", "name": "getEncryptedMAP", "signature": "Map<String, String> getEncryptedMAP(String str)", "start_line": 3, "modifiers": "static", "params": [{"name": "str", "type": "String"}], "return_type": "Map<String, String>"}, "class_info": {"name": "Wenku8API", "kind": "class", "modifiers": "", ...
25029544_7
class Asn implements SingleInternetResource<Asn, AsnRange>, Comparable<Asn> { public static Asn parse(String text) { try { String asnString = Validate.notNull(text, "AS Number must not be null").trim().toUpperCase(); if (asnString.startsWith("AS")) { asnString = asnS...
assertEquals(new Asn(65536l), Asn.parse("AS1.0")); } }
[FOCAL] public static Asn Asn.parse(String text) [CLASS] class Asn implements SingleInternetResource<Asn, AsnRange>, Comparable<Asn> [METRICS] loc=20 cc=4 branches=2 loops=0 returns=1 throws=1 nesting=2 [CALLS-EXTERNAL] Validate.notNull(text, "AS Number must not be null").trim().toUpperCase/0, Validate.notNull(text, "A...
/* static context [FOCAL] public static Asn Asn.parse(String text) [THROWS-WHEN] IllegalArgumentException when try-body throws [PATH1] if(asnString.startsWith("AS"))=T -> if(indexOfDot != -1)=T -> return new Asn((high << SIXTEEN) | low) [PATH2] try-body throws -> throw new IllegalArgumentException("Invalid AS number: '...
/* static context [FOCAL] public static Asn Asn.parse(String text) [THROWS-WHEN] IllegalArgumentException when try-body throws [PATH1] if(asnString.startsWith("AS"))=T -> if(indexOfDot != -1)=T -> return new Asn((high << SIXTEEN) | low) [PATH2] try-body throws -> throw new IllegalArgumentException("Invalid AS number: '...
true
ok
{"focal": {"class": "Asn", "name": "parse", "signature": "Asn parse(String text)", "start_line": 3, "modifiers": "public static", "params": [{"name": "text", "type": "String"}], "return_type": "Asn"}, "class_info": {"name": "Asn", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "SingleInternetResour...
25040159_5
class MethodsViaProxy implements Methods<T> { @Override public Method<T> get(Consumer<T> consumer) { return getMethod(consumer); } public MethodsViaProxy(Class<T> type, ProxyBuilder<T> proxyBuilder); @Override public Method<T> get(BiConsumer<T, P> biConsumer); @Override public Method...
final MethodsViaProxy<I> methods = new MethodsViaProxy<I>(I.class, new NativeProxyBuilder<>()); assertEquals("m1", methods.get(I::m1).name()); assertEquals("m2", methods.get(I::m2).name()); assertEquals("m3", methods.get(I::m3).name()); assertEquals("m4", methods.get(I::m4).name(...
[FOCAL] @Override public Method<T> MethodsViaProxy.get(Consumer<T> consumer) [CLASS] class MethodsViaProxy implements Methods<T> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Method<T> getMethod(BiConsumer<T, P> biConsumer) [INPUTS] branches=- | result=consumer [DATAFLOW] consume...
/* static context [FOCAL] @Override public Method<T> MethodsViaProxy.get(Consumer<T> consumer) [INPUTS] branches=- | result=consumer [CALLS-INTERNAL] Method<T> getMethod(BiConsumer<T, P> biConsumer) */
/* static context [FOCAL] @Override public Method<T> MethodsViaProxy.get(Consumer<T> consumer) [INPUTS] branches=- | result=consumer [CALLS-INTERNAL] Method<T> getMethod(BiConsumer<T, P> biConsumer) */ class MethodsViaProxy implements Methods<T> { @Override public Method<T> get(Consumer<T> consumer) { ...
true
ok
{"focal": {"class": "MethodsViaProxy", "name": "get", "signature": "Method<T> get(Consumer<T> consumer)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "consumer", "type": "Consumer<T>"}], "return_type": "Method<T>"}, "class_info": {"name": "MethodsViaProxy", "kind": "class", "modifiers": "", "s...
25125959_2
class EntradaDao { public Entrada findById(int id) { Connection con = null; PreparedStatement ps = null; try { con = ds.getConnection(); ps = con.prepareStatement( "select * from entrada where id = ?"); ps.setInt(1, id); ResultSet rs = ps.executeQuery(); if (rs.next()) { Entrada e = new ...
Entrada entrada = entradaDao.findById(1); assertNotNull(entrada); assertEquals("Curso Spring MVC", entrada.getDescricao()); assertEquals(new Integer(1), entrada.getIdUsuario()); assertEquals(Prioridade.Importantissimo, entrada.getPrioridade()); } }
[FOCAL] public Entrada EntradaDao.findById(int id) [CLASS] class EntradaDao [METRICS] loc=34 cc=5 branches=2 loops=0 returns=2 throws=1 nesting=3 [CALLS-EXTERNAL] ds.getConnection/0, Connection.prepareStatement/1, PreparedStatement.setInt/2, PreparedStatement.executeQuery/0, ResultSet.next/0, SQLException.setId/1, Resu...
/* static context [FOCAL] public Entrada EntradaDao.findById(int id) [PATH1] if(rs.next())=T -> return e -> if(con != null)=T -> try-body throws [PATH2] if(rs.next())=F -> return null -> if(con != null)=F [PATH3] try-body throws -> throw new RuntimeException(e) -> if(con != null)=T [COLLABORATORS] field ds getConnectio...
/* static context [FOCAL] public Entrada EntradaDao.findById(int id) [PATH1] if(rs.next())=T -> return e -> if(con != null)=T -> try-body throws [PATH2] if(rs.next())=F -> return null -> if(con != null)=F [PATH3] try-body throws -> throw new RuntimeException(e) -> if(con != null)=T [COLLABORATORS] field ds getConnectio...
true
ok
{"focal": {"class": "EntradaDao", "name": "findById", "signature": "Entrada findById(int id)", "start_line": 3, "modifiers": "public", "params": [{"name": "id", "type": "int"}], "return_type": "Entrada"}, "class_info": {"name": "EntradaDao", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fie...
25138352_715
class LocationMonitorState implements Serializable, IsSerializable { public boolean atLeastOneMonitorStarted() { if (m_monitorsStarted.size() > 0) { return true; } return false; } public LocationMonitorState(); public LocationMonitorState(Collection<GWTLocationSpecificStatus> statuses); public Locati...
Collection<GWTLocationMonitor> monitors = new ArrayList<GWTLocationMonitor>(); for (int i = 0; i < 5; i++) { monitors.add(getMonitor("DISCONNECTED")); } monitors.add(getMonitor("CONFIG_CHANGED")); LocationMonitorState lms = new LocationMonitorState(monitors, null); assertTrue("at least one monitor is CON...
[FOCAL] public boolean LocationMonitorState.atLeastOneMonitorStarted() [CLASS] class LocationMonitorState implements Serializable, IsSerializable [METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] m_monitorsStarted.size/0 [PATH1] if(m_monitorsStarted.size() > 0)=T -> return true [PATH...
/* static context [FOCAL] public boolean LocationMonitorState.atLeastOneMonitorStarted() [PATH1] if(m_monitorsStarted.size() > 0)=T -> return true [PATH2] if(m_monitorsStarted.size() > 0)=F -> return false [COLLABORATORS] field m_monitorsStarted size/0 [CALLS-EXTERNAL] m_monitorsStarted.size/0 */
/* static context [FOCAL] public boolean LocationMonitorState.atLeastOneMonitorStarted() [PATH1] if(m_monitorsStarted.size() > 0)=T -> return true [PATH2] if(m_monitorsStarted.size() > 0)=F -> return false [COLLABORATORS] field m_monitorsStarted size/0 [CALLS-EXTERNAL] m_monitorsStarted.size/0 */ class LocationMonitorS...
true
ok
{"focal": {"class": "LocationMonitorState", "name": "atLeastOneMonitorStarted", "signature": "boolean atLeastOneMonitorStarted()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "LocationMonitorState", "kind": "class", "modifiers": "", "superclass": null, "interf...
25151498_1
class StreamJsonCollapser extends DefaultStreamPipe<StreamReceiver> { @Override public void endRecord() { flushValues(); getReceiver().endRecord(); } @Override public void startRecord(final String identifier); @Override public void startEntity(final String name); @Override public void endEntity(); @Overrid...
collapser.endRecord(); Mockito.verify(mockedReceiver).endRecord(); } }
[FOCAL] @Override public void StreamJsonCollapser.endRecord() [CLASS] class StreamJsonCollapser extends DefaultStreamPipe<StreamReceiver> [METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void flushValues() [CALLS-EXTERNAL] getReceiver().endRecord/0, getReceiver/0 (inherited) [CLASS-...
/* static context [FOCAL] @Override public void StreamJsonCollapser.endRecord() [CALLS-INTERNAL] void flushValues() [CALLS-EXTERNAL] getReceiver().endRecord/0, getReceiver/0 (inherited) */
/* static context [FOCAL] @Override public void StreamJsonCollapser.endRecord() [CALLS-INTERNAL] void flushValues() [CALLS-EXTERNAL] getReceiver().endRecord/0, getReceiver/0 (inherited) */ class StreamJsonCollapser extends DefaultStreamPipe<StreamReceiver> { @Override public void endRecord() { flushValues(); get...
true
ok
{"focal": {"class": "StreamJsonCollapser", "name": "endRecord", "signature": "void endRecord()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "StreamJsonCollapser", "kind": "class", "modifiers": "", "superclass": "DefaultStreamPipe<StreamReceiver>", "int...
25156526_2
class ImageWebservice extends LdpWebService { @GET @Produces("image/*") public Response GET(@Context final UriInfo uriInfo, @HeaderParam(HttpHeaders.ACCEPT) @DefaultValue(MediaType.WILDCARD) final String type, @HeaderParam(LdpWebService.HTTP_HEADER_PREFER) Pr...
byte[] img = Resources.toByteArray(Resources.getResource("lions.jpg")); Response response1 = RestAssured .given() .content(img) .header(HttpHeaders.CONTENT_TYPE, "image/jpeg") .expect() .statusCode(201) .when() ...
[FOCAL] @GET @Produces("image/*") public Response ImageWebservice.GET(UriInfo uriInfo, String type, PreferHeader preferHeader, Rectangle rectangle) [CLASS] class ImageWebservice extends LdpWebService [METRICS] loc=50 cc=3 branches=1 loops=0 returns=3 throws=0 nesting=3 [CALLS-EXTERNAL] uriInfo.getAbsolutePathBuilder()....
/* static context [FOCAL] @GET @Produces("image/*") public Response ImageWebservice.GET(UriInfo uriInfo, String type, PreferHeader preferHeader, Rectangle rectangle) [PATH1] if(rectangle != null)=T -> try-body throws -> return super.GET(uriInfo, type, preferHeader) [PATH2] if(rectangle != null)=T -> return Response.ok(...
/* static context [FOCAL] @GET @Produces("image/*") public Response ImageWebservice.GET(UriInfo uriInfo, String type, PreferHeader preferHeader, Rectangle rectangle) [PATH1] if(rectangle != null)=T -> try-body throws -> return super.GET(uriInfo, type, preferHeader) [PATH2] if(rectangle != null)=T -> return Response.ok(...
true
ok
{"focal": {"class": "ImageWebservice", "name": "GET", "signature": "Response GET(UriInfo uriInfo, String type, PreferHeader preferHeader, Rectangle rectangle) throws RepositoryException, IOException", "start_line": 3, "modifiers": "@GET @Produces(\"image/*\") public", "params": [{"name": "uriInfo", "type": "UriInfo"}, ...
25205317_5
class FileTool { public static File create(String fileName) { String[] filePath = fileName.split(Pattern.quote(File.separator)); String name = filePath[filePath.length - 1]; return create(fileName.replace(name, ""), name); } private FileTool(); public static List<String> reader(String fileName)...
String fileName = System.getProperty("java.io.tmpdir") + File.separator + "tata2" + File.separator + "titi2" + File.separator + "toto2" + File.separator + "toto.txt"; File file = FileTool.create(fileName); ...
[FOCAL] public static File FileTool.create(String fileName) [CLASS] class FileTool [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] File create(String destinationFolder, String fileName) [CALLS-EXTERNAL] String.split/1, Pattern.quote/1, String.replace/2 [INPUTS] branches=- | result=...
/* static context [FOCAL] public static File FileTool.create(String fileName) [INPUTS] branches=- | result=fileName [CALLS-INTERNAL] File create(String destinationFolder, String fileName) [CALLS-EXTERNAL] String.split/1, Pattern.quote/1, String.replace/2 */
/* static context [FOCAL] public static File FileTool.create(String fileName) [INPUTS] branches=- | result=fileName [CALLS-INTERNAL] File create(String destinationFolder, String fileName) [CALLS-EXTERNAL] String.split/1, Pattern.quote/1, String.replace/2 */ class FileTool { public static File create(String fileName)...
true
ok
{"focal": {"class": "FileTool", "name": "create", "signature": "File create(String fileName)", "start_line": 3, "modifiers": "public static", "params": [{"name": "fileName", "type": "String"}], "return_type": "File"}, "class_info": {"name": "FileTool", "kind": "class", "modifiers": "", "superclass": null, "interfaces":...
25206330_0
class JsonUserRepository implements UserRepository { @Override public List<UserDTO> fetchAllUsers() { LOGGER.info("Fetching all users"); return users; } @Override public UserDTO firstUser(); @Override public UserDTO userByFirstNameAndLastName(String firstName, String lastName); @Autowired private UserR...
assertThat(repo.fetchAllUsers().size(), is(equalTo(3))); } }
[FOCAL] @Override public List<UserDTO> JsonUserRepository.fetchAllUsers() [CLASS] class JsonUserRepository implements UserRepository [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] LOGGER.info/1 [CLASS-MEMBERS] UserDTO firstUser(); UserDTO userByFirstNameAndLastName(String firstNam...
/* static context [FOCAL] @Override public List<UserDTO> JsonUserRepository.fetchAllUsers() [CALLS-EXTERNAL] LOGGER.info/1 */
/* static context [FOCAL] @Override public List<UserDTO> JsonUserRepository.fetchAllUsers() [CALLS-EXTERNAL] LOGGER.info/1 */ class JsonUserRepository implements UserRepository { @Override public List<UserDTO> fetchAllUsers() { LOGGER.info("Fetching all users"); return users; } @Override public UserDTO firstU...
true
ok
{"focal": {"class": "JsonUserRepository", "name": "fetchAllUsers", "signature": "List<UserDTO> fetchAllUsers()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "List<UserDTO>"}, "class_info": {"name": "JsonUserRepository", "kind": "class", "modifiers": "", "superclass": null, "interfaces...
25213631_2
class HtmlTextFilter { public static String filter(String text) { if ( text == null ) { return text; } Document document = Jsoup.parse(text); document.outputSettings(new Document.OutputSettings().prettyPrint(false)); document.select("br").append("\\n"); document.select("p").prepend("\\n\\n"); Stri...
String text = "XSS <script type=\"text/javascript\">alert('XSS')</script>."; Assertions.assertEquals("XSS .", HtmlTextFilter.filter(text)); } }
[FOCAL] public static String HtmlTextFilter.filter(String text) [CLASS] class HtmlTextFilter [METRICS] loc=12 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] Jsoup.parse/1, Document.outputSettings/1, new Document.OutputSettings().prettyPrint/1, document.select("br").append/1, Document.select/1, do...
/* static context [FOCAL] public static String HtmlTextFilter.filter(String text) [PATH1] if(text == null)=T -> return text [PATH2] if(text == null)=F -> return Jsoup.clean(s, "", Whitelist.none(), new Document.OutputSettings().... [INPUTS] branches=text | result=text [NEW] Document.OutputSettings [CALLS-EXTERNAL] Jsou...
/* static context [FOCAL] public static String HtmlTextFilter.filter(String text) [PATH1] if(text == null)=T -> return text [PATH2] if(text == null)=F -> return Jsoup.clean(s, "", Whitelist.none(), new Document.OutputSettings().... [INPUTS] branches=text | result=text [NEW] Document.OutputSettings [CALLS-EXTERNAL] Jsou...
true
ok
{"focal": {"class": "HtmlTextFilter", "name": "filter", "signature": "String filter(String text)", "start_line": 3, "modifiers": "public static", "params": [{"name": "text", "type": "String"}], "return_type": "String"}, "class_info": {"name": "HtmlTextFilter", "kind": "class", "modifiers": "", "superclass": null, "inte...
25239318_56
class InnerHtmlContainsCondition extends Condition<WebElement> { @Override public boolean apply(final WebElement element) { try { return ignoreCase ? StringUtils.containsIgnoreCase(element.getAttribute("innerHTML"), text) : element.getAttribute("inner...
when(mockElement.getAttribute("innerHTML")).thenThrow(new StaleElementReferenceException("stale")); InnerHtmlContainsCondition condition = new InnerHtmlContainsCondition("blah"); assertThat(condition.apply(mockElement), equalTo(false)); } }
[FOCAL] @Override public boolean InnerHtmlContainsCondition.apply(WebElement element) [CLASS] class InnerHtmlContainsCondition extends Condition<WebElement> [METRICS] loc=10 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] StringUtils.containsIgnoreCase/2, WebElement.getAttribute/1, element.getAttr...
/* static context [FOCAL] @Override public boolean InnerHtmlContainsCondition.apply(WebElement element) [PATH1] try-body throws -> return false [PATH2] return ignoreCase ? StringUtils.containsIgnoreCase(element.getAttribute("i... [INPUTS] branches=- | result=element [COLLABORATORS] param element:WebElement getAttribute...
/* static context [FOCAL] @Override public boolean InnerHtmlContainsCondition.apply(WebElement element) [PATH1] try-body throws -> return false [PATH2] return ignoreCase ? StringUtils.containsIgnoreCase(element.getAttribute("i... [INPUTS] branches=- | result=element [COLLABORATORS] param element:WebElement getAttribute...
true
ok
{"focal": {"class": "InnerHtmlContainsCondition", "name": "apply", "signature": "boolean apply(WebElement element)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "element", "type": "WebElement"}], "return_type": "boolean"}, "class_info": {"name": "InnerHtmlContainsCondition", "kind": "class", "...
25344951_7
class CollectionUtil { public static String[] shift(String[] array) { return shift(array, 1); } public static void addIfNotExist(List<T> list, T obj); public static String[] shift(String[] array, int n); @SafeVarargs public static String array2String(T... array); public static String l...
String[] s1 = new String[]{"aaa", "bbb", "ccc", "ddd"}; String[] s2 = CollectionUtil.shift(s1); Assert.assertEquals(3, s2.length); Assert.assertEquals("bbb", s2[0]); Assert.assertEquals("ddd", s2[2]); } }
[FOCAL] public static String[] CollectionUtil.shift(String[] array) [CLASS] class CollectionUtil [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String[] shift(String[] array, int n) [INPUTS] branches=- | result=array [DATAFLOW] array@param->L2 [CLASS-MEMBERS] void addIfNotExist(Li...
/* static context [FOCAL] public static String[] CollectionUtil.shift(String[] array) [INPUTS] branches=- | result=array [CALLS-INTERNAL] String[] shift(String[] array, int n) */
/* static context [FOCAL] public static String[] CollectionUtil.shift(String[] array) [INPUTS] branches=- | result=array [CALLS-INTERNAL] String[] shift(String[] array, int n) */ class CollectionUtil { public static String[] shift(String[] array) { return shift(array, 1); } public static void addI...
true
ok
{"focal": {"class": "CollectionUtil", "name": "shift", "signature": "String[] shift(String[] array)", "start_line": 3, "modifiers": "public static", "params": [{"name": "array", "type": "String[]"}], "return_type": "String[]"}, "class_info": {"name": "CollectionUtil", "kind": "class", "modifiers": "", "superclass": nul...
25345432_0
class AutoMatterTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(final Gson gson, final TypeToken<T> type) { final TypeAdapter<T> materialized; final AutoMatter annotation = type.getRawType().getAnnotation(AutoMatter.class); ...
gson = new GsonBuilder() .registerTypeAdapterFactory(new AutoMatterTypeAdapterFactory()) .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) .create(); final String json = gson.toJson(BAR); //isPrivate -> private final Bar parsed = gson.fromJson(json, Bar.class); //p...
[FOCAL] @SuppressWarnings("unchecked") @Override public TypeAdapter<T> AutoMatterTypeAdapterFactory.create(Gson gson, TypeToken<T> type) [CLASS] class AutoMatterTypeAdapterFactory implements TypeAdapterFactory [METRICS] loc=81 cc=8 branches=5 loops=1 returns=3 throws=1 nesting=3 [CALLS-INTERNAL] Map<String, List<String...
/* static context [FOCAL] @SuppressWarnings("unchecked") @Override public TypeAdapter<T> AutoMatterTypeAdapterFactory.create(Gson gson, TypeToken<T> type) [THROWS-WHEN] IllegalArgumentException when annotation != null && !(cached != null) && lastDollar > -1 && try-body throws [THROWS-WHEN] IllegalArgumentException when...
/* static context [FOCAL] @SuppressWarnings("unchecked") @Override public TypeAdapter<T> AutoMatterTypeAdapterFactory.create(Gson gson, TypeToken<T> type) [THROWS-WHEN] IllegalArgumentException when annotation != null && !(cached != null) && lastDollar > -1 && try-body throws [THROWS-WHEN] IllegalArgumentException when...
true
ok
{"focal": {"class": "AutoMatterTypeAdapterFactory", "name": "create", "signature": "TypeAdapter<T> create(Gson gson, TypeToken<T> type)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") @Override public", "params": [{"name": "gson", "type": "Gson"}, {"name": "type", "type": "TypeToken<T>"}], "return_typ...
25397566_0
class ReqIF10Iterator { public void iterateRecursivelyThrough( final EList<Specification> specifications, final SpecificationCallback specificationCallback, final SpecObjectCallback specObjectCallback) { for (Specification specification : specifications) { this.iterateRecursivelyThrough(specification, ...
final TestSpecification testSpecification = new TestSpecification(); final List<TestSpecObject> testSpecObjects = new ArrayList<TestSpecObject>(); ReqIF10Iterator iterator = new ReqIF10Iterator(); final EList<Specification> specs = reqif.getCoreContent() .getSpecifications(); iterator.iterateRecursivelyT...
[FOCAL] public void ReqIF10Iterator.iterateRecursivelyThrough(EList<Specification> specifications, SpecificationCallback specificationCallback, SpecObjectCallback specObjectCallback) [CLASS] class ReqIF10Iterator [METRICS] loc=9 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] void iterateRecursive...
/* static context [FOCAL] public void ReqIF10Iterator.iterateRecursivelyThrough(EList<Specification> specifications, SpecificationCallback specificationCallback, SpecObjectCallback specObjectCallback) [PATH1] foreach(Specification specification : specifications)=T -> exit loop [PATH2] foreach(Specification specificatio...
/* static context [FOCAL] public void ReqIF10Iterator.iterateRecursivelyThrough(EList<Specification> specifications, SpecificationCallback specificationCallback, SpecObjectCallback specObjectCallback) [PATH1] foreach(Specification specification : specifications)=T -> exit loop [PATH2] foreach(Specification specificatio...
true
ok
{"focal": {"class": "ReqIF10Iterator", "name": "iterateRecursivelyThrough", "signature": "void iterateRecursivelyThrough(EList<Specification> specifications, SpecificationCallback specificationCallback, SpecObjectCallback specObjectCallback)", "start_line": 3, "modifiers": "public", "params": [{"name": "specifications"...
25405542_165
class URLParser { public static Map<DomainParts, String> splitDomain(String domain) { Map<DomainParts, String> domainParts = null; String[] dottedParts = domain.trim().toLowerCase(Locale.ENGLISH).split("\\."); if(dottedParts.length==2) { domainParts = new HashM...
logger.info("splitDomain3"); String domain = "www.example.com"; Map<URLParser.DomainParts, String> expResult = new HashMap<>(); expResult.put(URLParser.DomainParts.TLD, "com"); expResult.put(URLParser.DomainParts.DOMAINNAME, "example"); expResult.put(URLParser.DomainParts...
[FOCAL] public static Map<DomainParts, String> URLParser.splitDomain(String domain) [CLASS] class URLParser [METRICS] loc=43 cc=7 branches=4 loops=2 returns=1 throws=0 nesting=5 [CALLS-EXTERNAL] domain.trim().toLowerCase(Locale.ENGLISH).split/1, domain.trim().toLowerCase/1, String.trim/0, Map<DomainParts, String>.put/2...
/* static context [FOCAL] public static Map<DomainParts, String> URLParser.splitDomain(String domain) [PATH1] if(dottedParts.length==2)=F -> if(dottedParts.length>2)=T -> if(( COMMON_TLD.contains(dottedParts[n-2]+"."+dottedParts[n-1]) || (COMMON_TLD.contains(dottedParts[n-1]) && COMMON_SLD....)=F -> if(COMMON_TLD.conta...
/* static context [FOCAL] public static Map<DomainParts, String> URLParser.splitDomain(String domain) [PATH1] if(dottedParts.length==2)=F -> if(dottedParts.length>2)=T -> if(( COMMON_TLD.contains(dottedParts[n-2]+"."+dottedParts[n-1]) || (COMMON_TLD.contains(dottedParts[n-1]) && COMMON_SLD....)=F -> if(COMMON_TLD.conta...
true
ok
{"focal": {"class": "URLParser", "name": "splitDomain", "signature": "Map<DomainParts, String> splitDomain(String domain)", "start_line": 3, "modifiers": "public static", "params": [{"name": "domain", "type": "String"}], "return_type": "Map<DomainParts, String>"}, "class_info": {"name": "URLParser", "kind": "class", "m...
25453552_0
class TravelFactory implements Iterable<TravelStrategy> { public TravelStrategy get(TravelId id) throws NullPointerException { TravelStrategy strategy = allModules.get(id); if (strategy == null) { throw new NullPointerException(); } return strategy; } private T...
TravelStrategy strategy = factory.get(null); Assert.assertNull(strategy); } }
[FOCAL] public TravelStrategy TravelFactory.get(TravelId id) [CLASS] class TravelFactory implements Iterable<TravelStrategy> [METRICS] loc=7 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] allModules.get/1 [NEW] NullPointerException [EXCEPTIONS] declares NullPointerException; throws NullPointerExc...
/* static context [FOCAL] public TravelStrategy TravelFactory.get(TravelId id) [THROWS-WHEN] NullPointerException when strategy == null [PATH1] if(strategy == null)=T -> throw new NullPointerException() [PATH2] if(strategy == null)=F -> return strategy [INPUTS] branches=id | result=id [COLLABORATORS] field allModules g...
/* static context [FOCAL] public TravelStrategy TravelFactory.get(TravelId id) [THROWS-WHEN] NullPointerException when strategy == null [PATH1] if(strategy == null)=T -> throw new NullPointerException() [PATH2] if(strategy == null)=F -> return strategy [INPUTS] branches=id | result=id [COLLABORATORS] field allModules g...
true
ok
{"focal": {"class": "TravelFactory", "name": "get", "signature": "TravelStrategy get(TravelId id) throws NullPointerException", "start_line": 3, "modifiers": "public", "params": [{"name": "id", "type": "TravelId"}], "return_type": "TravelStrategy"}, "class_info": {"name": "TravelFactory", "kind": "class", "modifiers": ...
25461048_104
class AuthorServiceImpl implements AuthorService { @Override public int addAuthor(Author author) { SqlSession sqlSession = null; try { sqlSession = MybatisUtil.getSqlSession(); AuthorMapper authorMapper = sqlSession.getMapper(AuthorMapper.class); int authorId...
Assert.assertEquals(true, authorService.addAuthor(new Author(3, "year")) > 0); } }
[FOCAL] @Override public int AuthorServiceImpl.addAuthor(Author author) [CLASS] class AuthorServiceImpl implements AuthorService [METRICS] loc=15 cc=3 branches=1 loops=0 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] MybatisUtil.getSqlSession/0, SqlSession.getMapper/1, AuthorMapper.addAuthor/1, SqlSession.commit/0, SqlS...
/* static context [FOCAL] @Override public int AuthorServiceImpl.addAuthor(Author author) [PATH1] return authorId -> if(sqlSession != null)=T [PATH2] try-body throws -> if(sqlSession != null)=F [INPUTS] branches=- | result=author [CALLS-EXTERNAL] MybatisUtil.getSqlSession/0, SqlSession.getMapper/1, AuthorMapper.addAuth...
/* static context [FOCAL] @Override public int AuthorServiceImpl.addAuthor(Author author) [PATH1] return authorId -> if(sqlSession != null)=T [PATH2] try-body throws -> if(sqlSession != null)=F [INPUTS] branches=- | result=author [CALLS-EXTERNAL] MybatisUtil.getSqlSession/0, SqlSession.getMapper/1, AuthorMapper.addAuth...
true
ok
{"focal": {"class": "AuthorServiceImpl", "name": "addAuthor", "signature": "int addAuthor(Author author)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "author", "type": "Author"}], "return_type": "int"}, "class_info": {"name": "AuthorServiceImpl", "kind": "class", "modifiers": "", "superclass"...
25461792_114
class RemoteFSController extends AbstractController implements Initializable { void deleteBoxObject(ButtonType confim, BoxPath path, BoxObject object) throws QblStorageException { if (confim != ButtonType.OK) { return; } transferManager.addUpload(new ManualUpload(DELETE, volume...
initTreeTable(); BoxFolder folder = nav.listFolders().get(0); controller.deleteBoxObject(ButtonType.OK, testFolder, folder); executeTransactions(); assertThat(controller.nav.listFolders().size(), is(0)); assertThat(controller.nav.listFiles().size(), is(0)); } }
[FOCAL] void RemoteFSController.deleteBoxObject(ButtonType confim, BoxPath path, BoxObject object) [CLASS] class RemoteFSController extends AbstractController implements Initializable [METRICS] loc=7 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] transferManager.addUpload/1 [NEW] ManualUpload [EX...
/* static context [FOCAL] void RemoteFSController.deleteBoxObject(ButtonType confim, BoxPath path, BoxObject object) [PATH1] if(confim != ButtonType.OK)=T -> return [PATH2] if(confim != ButtonType.OK)=F [INPUTS] branches=confim | result=- [COLLABORATORS] field transferManager addUpload/1 [EXCEPTIONS] declares QblStorag...
/* static context [FOCAL] void RemoteFSController.deleteBoxObject(ButtonType confim, BoxPath path, BoxObject object) [PATH1] if(confim != ButtonType.OK)=T -> return [PATH2] if(confim != ButtonType.OK)=F [INPUTS] branches=confim | result=- [COLLABORATORS] field transferManager addUpload/1 [EXCEPTIONS] declares QblStorag...
true
ok
{"focal": {"class": "RemoteFSController", "name": "deleteBoxObject", "signature": "void deleteBoxObject(ButtonType confim, BoxPath path, BoxObject object) throws QblStorageException", "start_line": 3, "modifiers": "", "params": [{"name": "confim", "type": "ButtonType"}, {"name": "path", "type": "BoxPath"}, {"name": "ob...
25507370_1330
class RpcProgramNfs3 extends RpcProgram implements Nfs3Interface { @Override public READDIRPLUS3Response readdirplus(XDR xdr, RpcInfo info) { return readdirplus(xdr, getSecurityHandler(info), info.remoteAddress()); } public RpcProgramNfs3(NfsConfiguration config, DatagramSocket registrationSocket, ...
HdfsFileStatus status = nn.getRpcServer().getFileInfo(testdir); long dirId = status.getFileId(); FileHandle handle = new FileHandle(dirId); XDR xdr_req = new XDR(); handle.serialize(xdr_req); xdr_req.writeLongAsHyper(0); xdr_req.writeLongAsHyper(0); xdr_req.writeInt(3); xdr_req.write...
[FOCAL] @Override public READDIRPLUS3Response RpcProgramNfs3.readdirplus(XDR xdr, RpcInfo info) [CLASS] class RpcProgramNfs3 extends RpcProgram implements Nfs3Interface [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] READDIRPLUS3Response readdirplus(XDR xdr, SecurityHandler securit...
/* static context [FOCAL] @Override public READDIRPLUS3Response RpcProgramNfs3.readdirplus(XDR xdr, RpcInfo info) [INPUTS] branches=- | result=info, xdr [COLLABORATORS] param info:RpcInfo remoteAddress/0 [CALLS-INTERNAL] READDIRPLUS3Response readdirplus(XDR xdr, SecurityHandler securityHandler, SocketAddress remoteAddr...
/* static context [FOCAL] @Override public READDIRPLUS3Response RpcProgramNfs3.readdirplus(XDR xdr, RpcInfo info) [INPUTS] branches=- | result=info, xdr [COLLABORATORS] param info:RpcInfo remoteAddress/0 [CALLS-INTERNAL] READDIRPLUS3Response readdirplus(XDR xdr, SecurityHandler securityHandler, SocketAddress remoteAddr...
true
ok
{"focal": {"class": "RpcProgramNfs3", "name": "readdirplus", "signature": "READDIRPLUS3Response readdirplus(XDR xdr, RpcInfo info)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "xdr", "type": "XDR"}, {"name": "info", "type": "RpcInfo"}], "return_type": "READDIRPLUS3Response"}, "class_info": {"...
25546146_5
class InstallOptions implements Serializable { public String[] getExcludeDependencyFilterPatterns() { return excludeDependencyFilterPatterns; } public InstallOptions(String id, String name, OpenMavenURL url, boolean offline, String[] optionalDependencyPatterns, String[] ...
assertNotNull(options.getExcludeDependencyFilterPatterns()); assertEquals(0, options.getExcludeDependencyFilterPatterns().length); } }
[FOCAL] public String[] InstallOptions.getExcludeDependencyFilterPatterns() [CLASS] class InstallOptions implements Serializable [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] InstallOptions(String id, String name, OpenMavenURL url, boolean offline, String[] optionalDependencyPatte...
/* static context [FOCAL] public String[] InstallOptions.getExcludeDependencyFilterPatterns() */
/* static context [FOCAL] public String[] InstallOptions.getExcludeDependencyFilterPatterns() */ class InstallOptions implements Serializable { public String[] getExcludeDependencyFilterPatterns() { return excludeDependencyFilterPatterns; } public InstallOptions(String id, String name, OpenMavenU...
true
ok
{"focal": {"class": "InstallOptions", "name": "getExcludeDependencyFilterPatterns", "signature": "String[] getExcludeDependencyFilterPatterns()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String[]"}, "class_info": {"name": "InstallOptions", "kind": "class", "modifiers": "", "superclass": nul...
25569063_2
class CatchException { public static void verifyException(ThrowingCallable actor) { verifyException(actor, Exception.class); } public static E caughtException(); public static E caughtException(Class<E> caughtExceptionType); public static void verifyException(ThrowingCallable actor, Class<...
// test validation of the arguments try { verifyException(() -> list.get(0), null); fail("IllegalArgumentException is expected"); } catch (IllegalArgumentException e) { assertEquals("exceptionClazz must not be null", e.getMessage()); } } }
[FOCAL] public static void CatchException.verifyException(ThrowingCallable actor) [CLASS] class CatchException [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void verifyException(ThrowingCallable actor, Class<? extends Exception> clazz) [DATAFLOW] actor@param->L2 [CLASS-MEMBERS] E...
/* static context [FOCAL] public static void CatchException.verifyException(ThrowingCallable actor) [CALLS-INTERNAL] void verifyException(ThrowingCallable actor, Class<? extends Exception> clazz) */
/* static context [FOCAL] public static void CatchException.verifyException(ThrowingCallable actor) [CALLS-INTERNAL] void verifyException(ThrowingCallable actor, Class<? extends Exception> clazz) */ class CatchException { public static void verifyException(ThrowingCallable actor) { verifyException(actor, E...
true
ok
{"focal": {"class": "CatchException", "name": "verifyException", "signature": "void verifyException(ThrowingCallable actor)", "start_line": 3, "modifiers": "public static", "params": [{"name": "actor", "type": "ThrowingCallable"}], "return_type": "void"}, "class_info": {"name": "CatchException", "kind": "class", "modif...
25573672_2
class RecordingSession { static RecordingInfo calculateRecordingInfo(int displayWidth, int displayHeight, int displayDensity, boolean isLandscapeDevice, int cameraWidth, int cameraHeight, int cameraFrameRate, int sizePercentage) { // Scale the display size before any maximum size calculations. di...
RecordingInfo size = calculateRecordingInfo(1080, 1920, 160, false, 1920, 1080, 30, 100); assertThat(size.width).isEqualTo(1080); assertThat(size.height).isEqualTo(1920); assertThat(size.density).isEqualTo(160); } }
[FOCAL] static RecordingInfo RecordingSession.calculateRecordingInfo(int displayWidth, int displayHeight, int displayDensity, boolean isLandscapeDevice, int cameraWidth, int cameraHeight, int cameraFrameRate, int sizePercentage) [CLASS] class RecordingSession [METRICS] loc=27 cc=4 branches=3 loops=0 returns=3 throws=0 ...
/* static context [FOCAL] static RecordingInfo RecordingSession.calculateRecordingInfo(int displayWidth, int displayHeight, int displayDensity, boolean isLandscapeDevice, int cameraWidth, int cameraHeight, int cameraFrameRate, int sizePercentage) [PATH1] if(cameraWidth == -1 && cameraHeight == -1)=F -> if(frameWidth >=...
/* static context [FOCAL] static RecordingInfo RecordingSession.calculateRecordingInfo(int displayWidth, int displayHeight, int displayDensity, boolean isLandscapeDevice, int cameraWidth, int cameraHeight, int cameraFrameRate, int sizePercentage) [PATH1] if(cameraWidth == -1 && cameraHeight == -1)=F -> if(frameWidth >=...
true
ok
{"focal": {"class": "RecordingSession", "name": "calculateRecordingInfo", "signature": "RecordingInfo calculateRecordingInfo(int displayWidth, int displayHeight, int displayDensity, boolean isLandscapeDevice, int cameraWidth, int cameraHeight, int cameraFrameRate, int sizePercentage)", "start_line": 3, "modifiers": "st...
25573964_23
class VncRecorderLifecycleManager { public void stopRecording(@Observes After afterTestMethod, TestResult testResult, CubeDroneConfiguration cubeDroneConfiguration, SeleniumContainers seleniumContainers) { try { if (this.vnc != null) { vnc.stop(); Path ...
final File destination = temporaryFolder.newFolder("destination"); final File video = temporaryFolder.newFile("file.flv"); Files.write(video.toPath(), "Hello".getBytes()); when(seleniumContainers.getVideoRecordingFile()).thenReturn(video.toPath()); when(after.getTestClass()).th...
[FOCAL] public void VncRecorderLifecycleManager.stopRecording(After afterTestMethod, TestResult testResult, CubeDroneConfiguration cubeDroneConfiguration, SeleniumContainers seleniumContainers) [CLASS] class VncRecorderLifecycleManager [METRICS] loc=26 cc=5 branches=3 loops=0 returns=0 throws=0 nesting=4 [CALLS-INTERNA...
/* static context [FOCAL] public void VncRecorderLifecycleManager.stopRecording(After afterTestMethod, TestResult testResult, CubeDroneConfiguration cubeDroneConfiguration, SeleniumContainers seleniumContainers) [PATH1] if(this.vnc != null)=T -> if(shouldRecordOnlyOnFailure(testResult, cubeDroneConfiguration))=F -> if(...
/* static context [FOCAL] public void VncRecorderLifecycleManager.stopRecording(After afterTestMethod, TestResult testResult, CubeDroneConfiguration cubeDroneConfiguration, SeleniumContainers seleniumContainers) [PATH1] if(this.vnc != null)=T -> if(shouldRecordOnlyOnFailure(testResult, cubeDroneConfiguration))=F -> if(...
true
ok
{"focal": {"class": "VncRecorderLifecycleManager", "name": "stopRecording", "signature": "void stopRecording(After afterTestMethod, TestResult testResult, CubeDroneConfiguration cubeDroneConfiguration, SeleniumContainers seleniumContainers)", "start_line": 3, "modifiers": "public", "params": [{"name": "afterTestMethod"...
25582637_44
class BasicAuthenticationHeaderParser { public Credentials<UserPasswordToken> extractCredentials(final Request request) { final String basicAuthHeader = request.getHeader(BASIC_AUTHORIZATION_HEADER); if (StringUtils.isNotBlank(basicAuthHeader) && basicAuthHeader.startsWith(BASIC_PREFIX)) { return extra...
when(request.getHeader("Authorization")).thenReturn("user:password"); final Credentials<UserPasswordToken> extractedCredentials = parser.extractCredentials(request); assertNull(extractedCredentials); } }
[FOCAL] public Credentials<UserPasswordToken> BasicAuthenticationHeaderParser.extractCredentials(Request request) [CLASS] class BasicAuthenticationHeaderParser [METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] Credentials<UserPasswordToken> extractCredentials(String basicAuthHeader) ...
/* static context [FOCAL] public Credentials<UserPasswordToken> BasicAuthenticationHeaderParser.extractCredentials(Request request) [PATH1] if(StringUtils.isNotBlank(basicAuthHeader) && basicAuthHeader.startsWith(BASIC_PREFIX))=T -> return extractCredentials(basicAuthHeader) [PATH2] if(StringUtils.isNotBlank(basicAuthH...
/* static context [FOCAL] public Credentials<UserPasswordToken> BasicAuthenticationHeaderParser.extractCredentials(Request request) [PATH1] if(StringUtils.isNotBlank(basicAuthHeader) && basicAuthHeader.startsWith(BASIC_PREFIX))=T -> return extractCredentials(basicAuthHeader) [PATH2] if(StringUtils.isNotBlank(basicAuthH...
true
ok
{"focal": {"class": "BasicAuthenticationHeaderParser", "name": "extractCredentials", "signature": "Credentials<UserPasswordToken> extractCredentials(Request request)", "start_line": 3, "modifiers": "public", "params": [{"name": "request", "type": "Request"}], "return_type": "Credentials<UserPasswordToken>"}, "class_inf...
25598822_70
class ChangelogDiffMaker { public Collection<Changeset> computeChangesetsToInsert(ExecutionContexts executionContexts, Collection<Changeset> declaredChangesets, Collection<Changeset> persistedChang...
Collection<Changeset> changesets = diffMaker.computeChangesetsToInsert( DEFAULT_CONTEXT, Arrays.asList( changeset("ID", "fbiville", "CREATE n2 RETURN n2", "baz", false, true), changeset("ID2", "fbiville", "CREATE m", "foo", false, true) ), ...
[FOCAL] public Collection<Changeset> ChangelogDiffMaker.computeChangesetsToInsert(ExecutionContexts executionContexts, Collection<Changeset> declaredChangesets, Collection<Changeset> persistedChangesets) [CLASS] class ChangelogDiffMaker [METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNA...
/* static context [FOCAL] public Collection<Changeset> ChangelogDiffMaker.computeChangesetsToInsert(ExecutionContexts executionContexts, Collection<Changeset> declaredChangesets, Collection<Changeset> persistedChangesets) [INPUTS] branches=- | result=declaredChangesets, executionContexts, persistedChangesets [COLLABORA...
/* static context [FOCAL] public Collection<Changeset> ChangelogDiffMaker.computeChangesetsToInsert(ExecutionContexts executionContexts, Collection<Changeset> declaredChangesets, Collection<Changeset> persistedChangesets) [INPUTS] branches=- | result=declaredChangesets, executionContexts, persistedChangesets [COLLABORA...
true
ok
{"focal": {"class": "ChangelogDiffMaker", "name": "computeChangesetsToInsert", "signature": "Collection<Changeset> computeChangesetsToInsert(ExecutionContexts executionContexts, Collection<Changeset> declaredChangesets, Collection<Changeset> persistedChangesets)", "start_line": 3, "modifiers": "public", "params": [{"na...
25603410_10
class LogCatSerializer { public void serializeLogs(List<LogCatMessage> logCatMessages) { List<LogCatMessage> filterLogCatMessages = filterLogCatMessages(logCatMessages); logCatWriter.writeLogs(test, filterLogCatMessages); } LogCatSerializer(TestIdentifier test, LogCatWriter logCatWriter); private List<LogC...
TestIdentifier test = new TestIdentifier(CLASS1_NAME, TEST1_NAME); SpyLogCatWriter logCatWriter = new SpyLogCatWriter(); LogCatSerializer serializer = new LogCatSerializer(test, logCatWriter); List<LogCatMessage> logCatMessages = new ArrayList<>(); addTestStartEnd(logCatMessages...
[FOCAL] public void LogCatSerializer.serializeLogs(List<LogCatMessage> logCatMessages) [CLASS] class LogCatSerializer [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] List<LogCatMessage> filterLogCatMessages(List<LogCatMessage> logCatMessages) [CALLS-EXTERNAL] logCatWriter.writeLogs...
/* static context [FOCAL] public void LogCatSerializer.serializeLogs(List<LogCatMessage> logCatMessages) [COLLABORATORS] field logCatWriter writeLogs/2 [CALLS-INTERNAL] List<LogCatMessage> filterLogCatMessages(List<LogCatMessage> logCatMessages) [CALLS-EXTERNAL] logCatWriter.writeLogs/2 */
/* static context [FOCAL] public void LogCatSerializer.serializeLogs(List<LogCatMessage> logCatMessages) [COLLABORATORS] field logCatWriter writeLogs/2 [CALLS-INTERNAL] List<LogCatMessage> filterLogCatMessages(List<LogCatMessage> logCatMessages) [CALLS-EXTERNAL] logCatWriter.writeLogs/2 */ class LogCatSerializer { pu...
true
ok
{"focal": {"class": "LogCatSerializer", "name": "serializeLogs", "signature": "void serializeLogs(List<LogCatMessage> logCatMessages)", "start_line": 3, "modifiers": "public", "params": [{"name": "logCatMessages", "type": "List<LogCatMessage>"}], "return_type": "void"}, "class_info": {"name": "LogCatSerializer", "kind"...
25619981_1
class JaxRs_Parser implements JaxRs_Compatibility { @Override public String getSupportedReferenceImplementation() { return "Jersey"; } public JaxRs_Parser(); @Override public String getSupportedJaxRSVersion(); @Override public String getResourceName(); @Override public ArrayList<...
assertNotNull(this.parser.getSupportedReferenceImplementation()); } }
[FOCAL] @Override public String JaxRs_Parser.getSupportedReferenceImplementation() [CLASS] class JaxRs_Parser implements JaxRs_Compatibility [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] JaxRs_Parser(); String getSupportedJaxRSVersion(); String getResourceName(); ArrayList<HTTPMet...
/* static context [FOCAL] @Override public String JaxRs_Parser.getSupportedReferenceImplementation() */
/* static context [FOCAL] @Override public String JaxRs_Parser.getSupportedReferenceImplementation() */ class JaxRs_Parser implements JaxRs_Compatibility { @Override public String getSupportedReferenceImplementation() { return "Jersey"; } public JaxRs_Parser(); @Override public String ge...
true
ok
{"focal": {"class": "JaxRs_Parser", "name": "getSupportedReferenceImplementation", "signature": "String getSupportedReferenceImplementation()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "JaxRs_Parser", "kind": "class", "modifiers": "", "superclass":...
25623941_13
class ResourceRequest { boolean isSatisfied() { return this.satisfied == req.getResourceCount(); } ResourceRequest(final ResourceRequestEvent req); void satisfyOne(); ResourceRequestEvent getRequestProto(); } class ResourceRequestTest { @Test() public void testInitializer() {
final ResourceRequest rr = get(1); Assert.assertFalse("A fresh request should not be satisfied.", rr.isSatisfied()); } }
[FOCAL] boolean ResourceRequest.isSatisfied() [CLASS] class ResourceRequest [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] req.getResourceCount/0 [FIELDS] read=satisfied [COLLABORATORS] field req getResourceCount/0 [CLASS-MEMBERS] ResourceRequest(ResourceRequestEvent req); void sa...
/* static context [FOCAL] boolean ResourceRequest.isSatisfied() [COLLABORATORS] field req getResourceCount/0 [FIELDS] read=satisfied [CALLS-EXTERNAL] req.getResourceCount/0 */
/* static context [FOCAL] boolean ResourceRequest.isSatisfied() [COLLABORATORS] field req getResourceCount/0 [FIELDS] read=satisfied [CALLS-EXTERNAL] req.getResourceCount/0 */ class ResourceRequest { boolean isSatisfied() { return this.satisfied == req.getResourceCount(); } ResourceRequest(final ResourceR...
true
ok
{"focal": {"class": "ResourceRequest", "name": "isSatisfied", "signature": "boolean isSatisfied()", "start_line": 3, "modifiers": "", "params": [], "return_type": "boolean"}, "class_info": {"name": "ResourceRequest", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"n...
25623942_4
class SyncopeWAEventRepository extends AbstractCasEventRepository { @Override public void saveInternal(final CasEvent event) { SyncopeClient syncopeClient = waRestClient.getSyncopeClient(); if (syncopeClient == null) { LOG.debug("Syncope client is not yet ready to store audit record...
CasEvent event = new CasEvent(1L, "Auth", "principalId", "creationTime", Map.of("timestamp", "1")); SyncopeWAEventRepository eventRepository = new SyncopeWAEventRepository(CasEventRepositoryFilter.noOp(), getWaRestClient()); eventRepository.saveInternal(event); verify(log...
[FOCAL] @Override public void SyncopeWAEventRepository.saveInternal(CasEvent event) [CLASS] class SyncopeWAEventRepository extends AbstractCasEventRepository [METRICS] loc=37 cc=5 branches=3 loops=0 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] void put(Map<String, String> properties, String key, String value) [CALLS-E...
/* static context [FOCAL] @Override public void SyncopeWAEventRepository.saveInternal(CasEvent event) [PATH1] if(syncopeClient == null)=F -> if(event.getGeoLocation() != null)=T -> if(event.getTimestamp() != null)=T [PATH2] if(syncopeClient == null)=T -> return [PATH3] if(syncopeClient == null)=F -> if(event.getGeoLoca...
/* static context [FOCAL] @Override public void SyncopeWAEventRepository.saveInternal(CasEvent event) [PATH1] if(syncopeClient == null)=F -> if(event.getGeoLocation() != null)=T -> if(event.getTimestamp() != null)=T [PATH2] if(syncopeClient == null)=T -> return [PATH3] if(syncopeClient == null)=F -> if(event.getGeoLoca...
true
ok
{"focal": {"class": "SyncopeWAEventRepository", "name": "saveInternal", "signature": "void saveInternal(CasEvent event)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "event", "type": "CasEvent"}], "return_type": "void"}, "class_info": {"name": "SyncopeWAEventRepository", "kind": "class", "modi...
25650668_1
class ParsingTools { protected static byte getByte(BsonType bsonType) throws NettyBsonReaderException { switch (bsonType) { case DOUBLE: return 0x01; case STRING: return 0x02; case DOCUMENT: return 0x03; case ARRAY: return 0x04; case BINARY: r...
BsonType[] types = BsonType.values(); Map<Byte, BsonType> foundBytes = new HashMap<>(types.length); for (BsonType value : types) { byte asByte = ParsingTools.getByte(value); BsonType old = foundBytes.put(asByte, value); assertNull(old + " and " + value + " has the same associated byte (" ...
[FOCAL] protected static byte ParsingTools.getByte(BsonType bsonType) [CLASS] class ParsingTools [METRICS] loc=49 cc=22 branches=1 loops=0 returns=21 throws=1 nesting=1 [NEW] NettyBsonReaderException [EXCEPTIONS] declares NettyBsonReaderException; throws NettyBsonReaderException [THROWS-WHEN] NettyBsonReaderException w...
/* static context [FOCAL] protected static byte ParsingTools.getByte(BsonType bsonType) [THROWS-WHEN] NettyBsonReaderException when switch(bsonType)=default [PATH1] switch(bsonType)=case DOUBLE -> return 0x01 [PATH2] switch(bsonType)=case STRING -> return 0x02 [PATH3] switch(bsonType)=case DOCUMENT -> return 0x03 [PATH...
/* static context [FOCAL] protected static byte ParsingTools.getByte(BsonType bsonType) [THROWS-WHEN] NettyBsonReaderException when switch(bsonType)=default [PATH1] switch(bsonType)=case DOUBLE -> return 0x01 [PATH2] switch(bsonType)=case STRING -> return 0x02 [PATH3] switch(bsonType)=case DOCUMENT -> return 0x03 [PATH...
true
ok
{"focal": {"class": "ParsingTools", "name": "getByte", "signature": "byte getByte(BsonType bsonType) throws NettyBsonReaderException", "start_line": 3, "modifiers": "protected static", "params": [{"name": "bsonType", "type": "BsonType"}], "return_type": "byte"}, "class_info": {"name": "ParsingTools", "kind": "class", "...
25706873_16
class Bencode { public static byte[] byteStringToArray(String str) { byte[] result = new byte[str.length()]; for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); if (c > 0xFF) throw new IllegalArgumentException("Character value outside of byte range"); result[i] = (byte)c; } return re...
assertArrayEquals(new byte[]{}, Bencode.byteStringToArray("")); assertArrayEquals(new byte[]{10}, Bencode.byteStringToArray("\n")); assertArrayEquals(new byte[]{'C','o','D','e'}, Bencode.byteStringToArray("CoDe")); assertArrayEquals(new byte[]{-1,-128,127}, Bencode.byteStringToArray("\u00FF\u0080\u007F")); } ...
[FOCAL] public static byte[] Bencode.byteStringToArray(String str) [CLASS] class Bencode [METRICS] loc=10 cc=3 branches=1 loops=1 returns=1 throws=1 nesting=2 [CALLS-EXTERNAL] String.length/0, String.charAt/1 [NEW] IllegalArgumentException [EXCEPTIONS] throws IllegalArgumentException [THROWS-WHEN] IllegalArgumentExcept...
/* static context [FOCAL] public static byte[] Bencode.byteStringToArray(String str) [THROWS-WHEN] IllegalArgumentException when i < str.length() && c > 0xFF [PATH1] for(i < str.length())=T -> if(c > 0xFF)=F -> exit loop -> return result [PATH2] for(i < str.length())=T -> if(c > 0xFF)=T -> throw new IllegalArgumentExce...
/* static context [FOCAL] public static byte[] Bencode.byteStringToArray(String str) [THROWS-WHEN] IllegalArgumentException when i < str.length() && c > 0xFF [PATH1] for(i < str.length())=T -> if(c > 0xFF)=F -> exit loop -> return result [PATH2] for(i < str.length())=T -> if(c > 0xFF)=T -> throw new IllegalArgumentExce...
true
ok
{"focal": {"class": "Bencode", "name": "byteStringToArray", "signature": "byte[] byteStringToArray(String str)", "start_line": 3, "modifiers": "public static", "params": [{"name": "str", "type": "String"}], "return_type": "byte[]"}, "class_info": {"name": "Bencode", "kind": "class", "modifiers": "", "superclass": null,...
25712818_3
class Inspector { public static Class<?> getGenericClassOfList(Class<?> type, Type listGenericClass) { if(type.isArray()) { return type.getComponentType(); } if (listGenericClass instanceof ParameterizedType) { for (Type typeArgument : ((ParameterizedType) listGenericClass).getActualT...
assertThat(Inspector.getGenericClassOfList(methodWithStringResponse.getReturnType(), methodWithStringResponse.getGenericReturnType()), is(nullValue())); } }
[FOCAL] public static Class<?> Inspector.getGenericClassOfList(Class<?> type, Type listGenericClass) [CLASS] class Inspector [METRICS] loc=11 cc=4 branches=2 loops=1 returns=3 throws=0 nesting=2 [CALLS-EXTERNAL] Class<?>.isArray/0, Class<?>.getComponentType/0, ((ParameterizedType) listGenericClass).getActualTypeArgumen...
/* static context [FOCAL] public static Class<?> Inspector.getGenericClassOfList(Class<?> type, Type listGenericClass) [PATH1] if(type.isArray())=F -> if(listGenericClass instanceof ParameterizedType)=T -> foreach(Type typeArgument : ((ParameterizedType) listGenericClass).getActualTypeArguments())=T -> return (Class<?>...
/* static context [FOCAL] public static Class<?> Inspector.getGenericClassOfList(Class<?> type, Type listGenericClass) [PATH1] if(type.isArray())=F -> if(listGenericClass instanceof ParameterizedType)=T -> foreach(Type typeArgument : ((ParameterizedType) listGenericClass).getActualTypeArguments())=T -> return (Class<?>...
true
ok
{"focal": {"class": "Inspector", "name": "getGenericClassOfList", "signature": "Class<?> getGenericClassOfList(Class<?> type, Type listGenericClass)", "start_line": 3, "modifiers": "public static", "params": [{"name": "type", "type": "Class<?>"}, {"name": "listGenericClass", "type": "Type"}], "return_type": "Class<?>"}...
25722021_7
class ChoiceOfTwoLoadBalancer implements LoadBalancerStrategy<T> { public static <T> ChoiceOfTwoLoadBalancer<T> create(final Comparator<T> func) { return new ChoiceOfTwoLoadBalancer<T>(func); } public ChoiceOfTwoLoadBalancer(final Comparator<T> func2); @Override public T choose(List<T> candi...
BehaviorSubject<List<Integer>> source = BehaviorSubject.create(); LoadBalancer<Integer> lb = LoadBalancer.fromSnapshotSource(source).build(ChoiceOfTwoLoadBalancer.create(COMPARATOR)); source.onNext(Lists.newArrayList(0,1)); AtomicIntegerArray counts = new AtomicIntegerA...
[FOCAL] public static ChoiceOfTwoLoadBalancer<T> ChoiceOfTwoLoadBalancer.create(Comparator<T> func) [CLASS] class ChoiceOfTwoLoadBalancer implements LoadBalancerStrategy<T> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] ChoiceOfTwoLoadBalancer<T> [INPUTS] branches=- | result=func [DATAFLOW] ...
/* static context [FOCAL] public static ChoiceOfTwoLoadBalancer<T> ChoiceOfTwoLoadBalancer.create(Comparator<T> func) [INPUTS] branches=- | result=func [NEW] ChoiceOfTwoLoadBalancer<T> */
/* static context [FOCAL] public static ChoiceOfTwoLoadBalancer<T> ChoiceOfTwoLoadBalancer.create(Comparator<T> func) [INPUTS] branches=- | result=func [NEW] ChoiceOfTwoLoadBalancer<T> */ class ChoiceOfTwoLoadBalancer implements LoadBalancerStrategy<T> { public static <T> ChoiceOfTwoLoadBalancer<T> create(final Co...
true
ok
{"focal": {"class": "ChoiceOfTwoLoadBalancer", "name": "create", "signature": "ChoiceOfTwoLoadBalancer<T> create(Comparator<T> func)", "start_line": 3, "modifiers": "public static", "params": [{"name": "func", "type": "Comparator<T>"}], "return_type": "ChoiceOfTwoLoadBalancer<T>"}, "class_info": {"name": "ChoiceOfTwoLo...
25732604_117
class MasterInfo extends ImageWriter { public List<Integer> listFiles(String path, boolean recursive) throws InvalidPathException, FileDoesNotExistException { List<Integer> ret = new ArrayList<Integer>(); synchronized (mRoot) { Inode inode = getInode(path); if (inode == null) { thro...
HashSet<Integer> ids = new HashSet<Integer>(); for (int i = 0; i < 10; i ++) { String dir = "/i" + i; mMasterInfo.mkdir(dir); for (int j = 0; j < 10; j ++) { ids.add(mMasterInfo.createFile(dir + "/j" + j, 64)); } } HashSet<Integer> listedIds = new HashSet<Integer>(mMaster...
[FOCAL] public List<Integer> MasterInfo.listFiles(String path, boolean recursive) [CLASS] class MasterInfo extends ImageWriter [METRICS] loc=28 cc=6 branches=4 loops=1 returns=1 throws=1 nesting=5 [CALLS-INTERNAL] Inode getInode(String path) [CALLS-EXTERNAL] Inode.isFile/0, List<Integer>.add/1, Inode.getId/0, Queue<Ino...
/* static context [FOCAL] public List<Integer> MasterInfo.listFiles(String path, boolean recursive) [THROWS-WHEN] FileDoesNotExistException when inode == null [PATH1] if(inode == null)=F -> if(inode.isFile())=F -> if(recursive)=T -> while(!queue.isEmpty())=T -> if(qinode.isDirectory())=T -> exit loop -> return ret */
/* static context [FOCAL] public List<Integer> MasterInfo.listFiles(String path, boolean recursive) [THROWS-WHEN] FileDoesNotExistException when inode == null [PATH1] if(inode == null)=F -> if(inode.isFile())=F -> if(recursive)=T -> while(!queue.isEmpty())=T -> if(qinode.isDirectory())=T -> exit loop -> return ret */ c...
true
ok
{"focal": {"class": "MasterInfo", "name": "listFiles", "signature": "List<Integer> listFiles(String path, boolean recursive) throws InvalidPathException, FileDoesNotExistException", "start_line": 3, "modifiers": "public", "params": [{"name": "path", "type": "String"}, {"name": "recursive", "type": "boolean"}], "return_...
25823015_88
class SimpleMessageListenerContainer extends AbstractMessageListenerContainer { protected AsyncTaskExecutor getTaskExecutor() { return this.taskExecutor; } public void setTaskExecutor(AsyncTaskExecutor taskExecutor); public long getBackOffTime(); public void setBackOffTime(long backOffTime); public long getQu...
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(); container.setAmazonSqs(mock(AmazonSQSAsync.class, withSettings().stubOnly())); container.setMessageHandler(mock(QueueMessageHandler.class)); container.afterPropertiesSet(); ThreadPoolTaskExecutor taskExecutor = (ThreadPoolTask...
[FOCAL] protected AsyncTaskExecutor SimpleMessageListenerContainer.getTaskExecutor() [CLASS] class SimpleMessageListenerContainer extends AbstractMessageListenerContainer [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [FIELDS] read=taskExecutor [CLASS-MEMBERS] void setTaskExecutor(AsyncTaskExecuto...
/* static context [FOCAL] protected AsyncTaskExecutor SimpleMessageListenerContainer.getTaskExecutor() [FIELDS] read=taskExecutor */
/* static context [FOCAL] protected AsyncTaskExecutor SimpleMessageListenerContainer.getTaskExecutor() [FIELDS] read=taskExecutor */ class SimpleMessageListenerContainer extends AbstractMessageListenerContainer { protected AsyncTaskExecutor getTaskExecutor() { return this.taskExecutor; } public void setTaskExecu...
true
ok
{"focal": {"class": "SimpleMessageListenerContainer", "name": "getTaskExecutor", "signature": "AsyncTaskExecutor getTaskExecutor()", "start_line": 3, "modifiers": "protected", "params": [], "return_type": "AsyncTaskExecutor"}, "class_info": {"name": "SimpleMessageListenerContainer", "kind": "class", "modifiers": "", "s...
25857692_1
class WordCount { public void insertWordCount(String tablename, String word, int count) { try (SqlSession sqlSession = sqlSessionFactory.openSession();) { WordCountDao wordCountDao = sqlSession.getMapper(WordCountDao.class); wordCountDao.insertWordCount(new InsertWordCount(tablename, word, count)); sqlSess...
long actualReturn = 0; try { wordCount.insertWordCount("wordcount", "词语1", 10); wordCount.insertWordCount("wordcount", "词语2", 15); wordCount.insertWordCount("wordcount", "词语3", 9); } catch (Exception e) { actualReturn = -1; } assertEquals(0L, actualReturn); } }
[FOCAL] public void WordCount.insertWordCount(String tablename, String word, int count) [CLASS] class WordCount [METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] sqlSessionFactory.openSession/0, SqlSession.getMapper/1, WordCountDao.insertWordCount/1, SqlSession.commit/0 [NEW] InsertW...
/* static context [FOCAL] public void WordCount.insertWordCount(String tablename, String word, int count) [COLLABORATORS] field sqlSessionFactory openSession/0 [NEW] InsertWordCount [CALLS-EXTERNAL] sqlSessionFactory.openSession/0, SqlSession.getMapper/1, WordCountDao.insertWordCount/1, SqlSession.commit/0 */
/* static context [FOCAL] public void WordCount.insertWordCount(String tablename, String word, int count) [COLLABORATORS] field sqlSessionFactory openSession/0 [NEW] InsertWordCount [CALLS-EXTERNAL] sqlSessionFactory.openSession/0, SqlSession.getMapper/1, WordCountDao.insertWordCount/1, SqlSession.commit/0 */ class Wor...
true
ok
{"focal": {"class": "WordCount", "name": "insertWordCount", "signature": "void insertWordCount(String tablename, String word, int count)", "start_line": 3, "modifiers": "public", "params": [{"name": "tablename", "type": "String"}, {"name": "word", "type": "String"}, {"name": "count", "type": "int"}], "return_type": "vo...
25858016_0
class Help implements ShellCommand { @Override public void run() { parent.usage(); } public Help(JCommander parent); } class HelpTest { @Test public void shouldProperlyShowHelpMessage() {
InputStream stream = toInputStream("help\n"); ByteArrayOutputStream result = new ByteArrayOutputStream(); new Shell(stream, result, "") { @Override public List<Object> buildCommands(JCommander jCommander) { return Arrays.<Object>asList( ...
[FOCAL] @Override public void Help.run() [CLASS] class Help implements ShellCommand [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] parent.usage/0 [COLLABORATORS] field parent usage/0 [CLASS-MEMBERS] Help(JCommander parent) [TEST] HelpTest: @Test public void shouldProperlyShowHelpM...
/* static context [FOCAL] @Override public void Help.run() [COLLABORATORS] field parent usage/0 [CALLS-EXTERNAL] parent.usage/0 */
/* static context [FOCAL] @Override public void Help.run() [COLLABORATORS] field parent usage/0 [CALLS-EXTERNAL] parent.usage/0 */ class Help implements ShellCommand { @Override public void run() { parent.usage(); } public Help(JCommander parent); } class HelpTest { @Test public v...
true
ok
{"focal": {"class": "Help", "name": "run", "signature": "void run()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "Help", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "ShellCommand", "fields": [], "members": [{"name": "Help", "kin...
25873783_80
class JoinTable implements SchemaOperation { JoinTable(String sourceTable, String alias, String... columns) { checkArgument(!Strings.isNullOrEmpty(sourceTable), "You must specify a 'sourceTable'."); checkArgument(!Strings.isNullOrEmpty(alias), "You must specify a 'alias'."); this.sourceTables = Maps.newLinkedH...
JoinTable operation = SchemaOperations.joinTable("users", "u", "id", "name") .with("addresses", "a", "u.id = a.user_id", "address") .into("users"); ImmutableMap<String, List<String>> expectedSourceColumns = ImmutableMap.<String, List<String>>builder() .put("u", Lists.newArrayList("id", "name")) .pu...
[FOCAL] JoinTable.JoinTable(String sourceTable, String alias, String... columns) [CLASS] class JoinTable implements SchemaOperation [METRICS] loc=11 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] checkArgument/2 (inherited), Strings.isNullOrEmpty/1, Maps.newLinkedHashMap/0, sourceTables.put/2, so...
/* static context [FOCAL] JoinTable.JoinTable(String sourceTable, String alias, String... columns) [COLLABORATORS] field sourceTables put/2; field sourceColumns put/2 [STATE] joinConditions via getJoinConditions(), sourceColumns via getSourceColumns(), sourceTables via getSourceTables() [FIELDS] write=joinConditions, s...
/* static context [FOCAL] JoinTable.JoinTable(String sourceTable, String alias, String... columns) [COLLABORATORS] field sourceTables put/2; field sourceColumns put/2 [STATE] joinConditions via getJoinConditions(), sourceColumns via getSourceColumns(), sourceTables via getSourceTables() [FIELDS] write=joinConditions, s...
true
ok
{"focal": {"class": "JoinTable", "name": "JoinTable", "signature": "JoinTable(String sourceTable, String alias, String... columns)", "start_line": 3, "modifiers": "", "params": [{"name": "sourceTable", "type": "String"}, {"name": "alias", "type": "String"}, {"name": "columns", "type": "String..."}], "return_type": null...
25889832_0
class JsonFormatter extends Formatter { @Override public String format(LogRecord record) { Instant timestamp = Instant.ofEpochMilli(record.getMillis()); StringWriter out = new StringWriter(); // Write using a simple JsonWriter rather than the more sophisticated Gson as we generally ...
LogRecord record = new LogRecord(Level.INFO, "message"); record.setMillis(12345_678); record.setLoggerName("logger"); LogContext context = new LogContext(Collections.singletonMap("traceId", "abcdef")); String logLine = context.execute(() -> formatter.format(record)); ass...
[FOCAL] @Override public String JsonFormatter.format(LogRecord record) [CLASS] class JsonFormatter extends Formatter [METRICS] loc=50 cc=3 branches=1 loops=0 returns=1 throws=1 nesting=6 [CALLS-INTERNAL] String formatMessage(LogRecord record); String severity(Level level) [CALLS-EXTERNAL] Instant.ofEpochMilli/1, LogRec...
/* static context [FOCAL] @Override public String JsonFormatter.format(LogRecord record) [THROWS-WHEN] AssertionError when try-body throws [PATH1] try-body throws -> throw new AssertionError(e) [PATH2] if(logContext != null)=T -> return out.toString() [PATH3] if(logContext != null)=F -> return out.toString() [COLLABORA...
/* static context [FOCAL] @Override public String JsonFormatter.format(LogRecord record) [THROWS-WHEN] AssertionError when try-body throws [PATH1] try-body throws -> throw new AssertionError(e) [PATH2] if(logContext != null)=T -> return out.toString() [PATH3] if(logContext != null)=F -> return out.toString() [COLLABORA...
true
ok
{"focal": {"class": "JsonFormatter", "name": "format", "signature": "String format(LogRecord record)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "record", "type": "LogRecord"}], "return_type": "String"}, "class_info": {"name": "JsonFormatter", "kind": "class", "modifiers": "", "superclass": ...
25900801_1
class DhcpV6MessageHandler { public static DhcpV6Message handleMessage(InetAddress localAddress, DhcpV6Message dhcpMessage) { DhcpV6Message replyMessage = null; if (dhcpMessage instanceof DhcpV6RelayMessage) { if (dhcpMessage.getMessageType() == DhcpConstants.V6MESSAGE_TYPE_RELAY_FORW) { Dh...
DhcpV6RelayMessage relayMessage = TestDhcpRelayMessage.buildMockDhcpRelayMessage(); // change the mock relay_reply message to a relay_forward relayMessage.setMessageType(DhcpConstants.V6MESSAGE_TYPE_RELAY_FORW); DhcpV6Message dhcpMessage = new DhcpV6Message(new InetSocketAddress("2001:db8:...
[FOCAL] public static DhcpV6Message DhcpV6MessageHandler.handleMessage(InetAddress localAddress, DhcpV6Message dhcpMessage) [CLASS] class DhcpV6MessageHandler [METRICS] loc=19 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] DhcpV6Message handleClientRequest(InetAddress linkAddress, DhcpV6Message d...
/* static context [FOCAL] public static DhcpV6Message DhcpV6MessageHandler.handleMessage(InetAddress localAddress, DhcpV6Message dhcpMessage) [PATH1] if(dhcpMessage instanceof DhcpV6RelayMessage)=T -> if(dhcpMessage.getMessageType() == DhcpConstants.V6MESSAGE_TYPE_RELAY_FORW)=T -> return replyMessage [PATH2] if(dhcpMes...
/* static context [FOCAL] public static DhcpV6Message DhcpV6MessageHandler.handleMessage(InetAddress localAddress, DhcpV6Message dhcpMessage) [PATH1] if(dhcpMessage instanceof DhcpV6RelayMessage)=T -> if(dhcpMessage.getMessageType() == DhcpConstants.V6MESSAGE_TYPE_RELAY_FORW)=T -> return replyMessage [PATH2] if(dhcpMes...
true
ok
{"focal": {"class": "DhcpV6MessageHandler", "name": "handleMessage", "signature": "DhcpV6Message handleMessage(InetAddress localAddress, DhcpV6Message dhcpMessage)", "start_line": 3, "modifiers": "public static", "params": [{"name": "localAddress", "type": "InetAddress"}, {"name": "dhcpMessage", "type": "DhcpV6Message"...
25962820_2
class ProductFlavorCombo { @NonNull public String getName() { if (name == null) { boolean first = true; StringBuilder sb = new StringBuilder(); for (ProductFlavor flavor : flavorList) { if (first) { sb.append(flavor.getName()); ...
assertEquals("flavor1Flavor2", new ProductFlavorCombo(f1, f2).getName()); } }
[FOCAL] @NonNull public String ProductFlavorCombo.getName() [CLASS] class ProductFlavorCombo [METRICS] loc=17 cc=4 branches=2 loops=1 returns=1 throws=0 nesting=3 [CALLS-EXTERNAL] StringBuilder.append/1, ProductFlavor.getName/0, StringHelper.capitalize/1, StringBuilder.toString/0 [NEW] StringBuilder [PATH1] if(name == ...
/* static context [FOCAL] @NonNull public String ProductFlavorCombo.getName() [PATH1] if(name == null)=T -> foreach(ProductFlavor flavor : flavorList)=T -> if(first)=T -> exit loop -> return name [PATH2] if(name == null)=F -> return name [PATH3] if(name == null)=T -> foreach(ProductFlavor flavor : flavorList)=F -> retu...
/* static context [FOCAL] @NonNull public String ProductFlavorCombo.getName() [PATH1] if(name == null)=T -> foreach(ProductFlavor flavor : flavorList)=T -> if(first)=T -> exit loop -> return name [PATH2] if(name == null)=F -> return name [PATH3] if(name == null)=T -> foreach(ProductFlavor flavor : flavorList)=F -> retu...
true
ok
{"focal": {"class": "ProductFlavorCombo", "name": "getName", "signature": "String getName()", "start_line": 3, "modifiers": "@NonNull public", "params": [], "return_type": "String"}, "class_info": {"name": "ProductFlavorCombo", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name"...
25968648_46
class SimpleFeaturePointFigure extends AbstractPointFigure implements SimpleFeatureFigure { @Override public Point getGeometry() { return (Point) simpleFeature.getDefaultGeometry(); } public SimpleFeaturePointFigure(SimpleFeature simpleFeature, SceneTransformProvider provider, FigureStyle sty...
SimpleFeatureType type = createShipTrackFeatureType(); SimpleFeature feature = createFeature(type, 1, 53.1F, 13.2F, 0.5); sceneTransformProvider = new SceneTransformProvider() { @Override public MathTransform2D getModelToSceneTransform() { return MathTra...
[FOCAL] @Override public Point SimpleFeaturePointFigure.getGeometry() [CLASS] class SimpleFeaturePointFigure extends AbstractPointFigure implements SimpleFeatureFigure [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] simpleFeature.getDefaultGeometry/0 [COLLABORATORS] field simpleFea...
/* static context [FOCAL] @Override public Point SimpleFeaturePointFigure.getGeometry() [COLLABORATORS] field simpleFeature getDefaultGeometry/0 [CALLS-EXTERNAL] simpleFeature.getDefaultGeometry/0 */
/* static context [FOCAL] @Override public Point SimpleFeaturePointFigure.getGeometry() [COLLABORATORS] field simpleFeature getDefaultGeometry/0 [CALLS-EXTERNAL] simpleFeature.getDefaultGeometry/0 */ class SimpleFeaturePointFigure extends AbstractPointFigure implements SimpleFeatureFigure { @Override public Po...
true
ok
{"focal": {"class": "SimpleFeaturePointFigure", "name": "getGeometry", "signature": "Point getGeometry()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Point"}, "class_info": {"name": "SimpleFeaturePointFigure", "kind": "class", "modifiers": "", "superclass": "AbstractPointFigure", "i...
25979437_90
class EhcacheSessionDataStorage implements SessionDataStorage { @Override public void delete(String sessionId) { this.sessions.remove(sessionId); } public EhcacheSessionDataStorage(); public EhcacheSessionDataStorage(String name); public EhcacheSessionDataStorage(Cache cache); ...
System.out.println("delete"); EhcacheSessionDataStorage instance = new EhcacheSessionDataStorage(); SessionData sessionData = instance.create(); String sessionId = sessionData.getId(); sessionData.put(KEY, VALUE); instance.save(sessionData); instance.delete(sessio...
[FOCAL] @Override public void EhcacheSessionDataStorage.delete(String sessionId) [CLASS] class EhcacheSessionDataStorage implements SessionDataStorage [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] this.sessions.remove/1 [FIELDS] read=sessions [COLLABORATORS] field sessions remove...
/* static context [FOCAL] @Override public void EhcacheSessionDataStorage.delete(String sessionId) [COLLABORATORS] field sessions remove/1 [FIELDS] read=sessions [CALLS-EXTERNAL] this.sessions.remove/1 */
/* static context [FOCAL] @Override public void EhcacheSessionDataStorage.delete(String sessionId) [COLLABORATORS] field sessions remove/1 [FIELDS] read=sessions [CALLS-EXTERNAL] this.sessions.remove/1 */ class EhcacheSessionDataStorage implements SessionDataStorage { @Override public void delete(String sessio...
true
ok
{"focal": {"class": "EhcacheSessionDataStorage", "name": "delete", "signature": "void delete(String sessionId)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "sessionId", "type": "String"}], "return_type": "void"}, "class_info": {"name": "EhcacheSessionDataStorage", "kind": "class", "modifiers"...
26027834_1
class JfrPageCacheTracer implements PageCacheTracer { @Override public EvictionRunEvent beginPageEvictions( int expectedEvictions ) { long evictionRunId = evictionRunCounter.incrementAndGet(); JfrEvictionRunEvent event = new JfrEvictionRunEvent( evictionEventStarter ); event.begin(...
try ( EvictionRunEvent evictionRunEvent = tracer.beginPageEvictions( 2 ) ) { try ( EvictionEvent evictionEvent = evictionRunEvent.beginEviction() ) { FlushEvent flushEvent = evictionEvent.flushEventOpportunity().beginFlush( 0, 0, swapper ); flushEv...
[FOCAL] @Override public EvictionRunEvent JfrPageCacheTracer.beginPageEvictions(int expectedEvictions) [CLASS] class JfrPageCacheTracer implements PageCacheTracer [METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] evictionRunCounter.incrementAndGet/0, JfrEvictionRunEvent.begin/0, Jfr...
/* static context [FOCAL] @Override public EvictionRunEvent JfrPageCacheTracer.beginPageEvictions(int expectedEvictions) [COLLABORATORS] field evictionRunCounter incrementAndGet/0 [NEW] JfrEvictionRunEvent [CALLS-EXTERNAL] evictionRunCounter.incrementAndGet/0, JfrEvictionRunEvent.begin/0, JfrEvictionRunEvent.setExpecte...
/* static context [FOCAL] @Override public EvictionRunEvent JfrPageCacheTracer.beginPageEvictions(int expectedEvictions) [COLLABORATORS] field evictionRunCounter incrementAndGet/0 [NEW] JfrEvictionRunEvent [CALLS-EXTERNAL] evictionRunCounter.incrementAndGet/0, JfrEvictionRunEvent.begin/0, JfrEvictionRunEvent.setExpecte...
true
ok
{"focal": {"class": "JfrPageCacheTracer", "name": "beginPageEvictions", "signature": "EvictionRunEvent beginPageEvictions(int expectedEvictions)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "expectedEvictions", "type": "int"}], "return_type": "EvictionRunEvent"}, "class_info": {"name": "JfrPa...
26057756_10
class FileUtils { public static void deleteDir(Path dir, DeleteVisitor visitor) { try{ if(Files.exists(dir) && Files.isDirectory(dir)) { Files.walkFileTree(dir, visitor); } } catch (IOException e) { throw new RuntimeException(e); } } private FileUtils(); public static void delete(Path path);...
Path parentdir = Files.createTempDirectory("DIR"); Path parentdirfile1 = createTempFile(parentdir, "FILE_1", ".tmp"); Path parentdirfile2 = createTempFile(parentdir, "FILE_2", ".tmp"); FileUtils.deleteDir(parentdir, new DeleteVisitor("*.tmp")); assertThat(exists(parentdir), is(true)); assertThat(exis...
[FOCAL] public static void FileUtils.deleteDir(Path dir, DeleteVisitor visitor) [CLASS] class FileUtils [METRICS] loc=9 cc=3 branches=1 loops=0 returns=0 throws=1 nesting=2 [CALLS-EXTERNAL] Files.exists/1, Files.isDirectory/1, Files.walkFileTree/2 [NEW] RuntimeException [EXCEPTIONS] throws RuntimeException; catches IOE...
/* static context [FOCAL] public static void FileUtils.deleteDir(Path dir, DeleteVisitor visitor) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException(e) [PATH2] if(Files.exists(dir) && Files.isDirectory(dir))=T [PATH3] if(Files.exists(dir) && Files.isDirectory(dir))...
/* static context [FOCAL] public static void FileUtils.deleteDir(Path dir, DeleteVisitor visitor) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException(e) [PATH2] if(Files.exists(dir) && Files.isDirectory(dir))=T [PATH3] if(Files.exists(dir) && Files.isDirectory(dir))...
true
ok
{"focal": {"class": "FileUtils", "name": "deleteDir", "signature": "void deleteDir(Path dir, DeleteVisitor visitor)", "start_line": 3, "modifiers": "public static", "params": [{"name": "dir", "type": "Path"}, {"name": "visitor", "type": "DeleteVisitor"}], "return_type": "void"}, "class_info": {"name": "FileUtils", "kin...
26065781_2
class JNAAccess { public static native int sum(int[] intArr, int arrayLength)public static native int sum(int[] intArr, int arrayLength); public static native int sum(int[] intArr, int arrayLength)public static native int inc(int arg); } class JNAAccessTest { @Test public void testSum() {
assertEquals(6, JNAAccess.sum(new int[]{0, 1, 2, 3}, 4)); } }
[FOCAL] public static native int JNAAccess.sum(int[] intArr, int arrayLength) [CLASS] class JNAAccess [METRICS] loc=1 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CLASS-MEMBERS] int inc(int arg) [TEST] JNAAccessTest: @Test public void testSum()
/* static context [FOCAL] public static native int JNAAccess.sum(int[] intArr, int arrayLength) */
/* static context [FOCAL] public static native int JNAAccess.sum(int[] intArr, int arrayLength) */ class JNAAccess { public static native int sum(int[] intArr, int arrayLength)public static native int sum(int[] intArr, int arrayLength); public static native int sum(int[] intArr, int arrayLength)public static native i...
true
partial
{"focal": {"class": "JNAAccess", "name": "sum", "signature": "int sum(int[] intArr, int arrayLength)", "start_line": 3, "modifiers": "public static native", "params": [{"name": "intArr", "type": "int[]"}, {"name": "arrayLength", "type": "int"}], "return_type": "int"}, "class_info": {"name": "JNAAccess", "kind": "class"...
26072381_3
class ExecMojo extends AbstractMojo { Collection<String> getResourceFiles(final Iterable<? extends FileSet> fileSets, final boolean followLinks, final boolean allowDuplicates, final boolean allowFiles, final boolean allowDirs) throws MojoExecutionException { final Set<String> result = new LinkedHashS...
final Collection<String> actualFiles = mojo.getResourceFiles(getFileSets(rootDir), mojo.isFollowLinks(), true, true, false); assertThat(actualFiles).isNotNull().doesNotContainNull().hasSameSizeAs(expectedFiles) .containsOnlyElementsOf(expectedFiles); // the following is the same as above, ...
[FOCAL] Collection<String> ExecMojo.getResourceFiles(Iterable<? extends FileSet> fileSets, boolean followLinks, boolean allowDuplicates, boolean allowFiles, boolean allowDirs) [CLASS] class ExecMojo extends AbstractMojo [METRICS] loc=22 cc=4 branches=1 loops=2 returns=1 throws=1 nesting=3 [CALLS-INTERNAL] Collection<St...
/* static context [FOCAL] Collection<String> ExecMojo.getResourceFiles(Iterable<? extends FileSet> fileSets, boolean followLinks, boolean allowDuplicates, boolean allowFiles, boolean allowDirs) [THROWS-WHEN] MojoExecutionException when foreach(FileSet fileSet : Objects.requireNonNull(fileSets))=T && foreach(String file...
/* static context [FOCAL] Collection<String> ExecMojo.getResourceFiles(Iterable<? extends FileSet> fileSets, boolean followLinks, boolean allowDuplicates, boolean allowFiles, boolean allowDirs) [THROWS-WHEN] MojoExecutionException when foreach(FileSet fileSet : Objects.requireNonNull(fileSets))=T && foreach(String file...
true
ok
{"focal": {"class": "ExecMojo", "name": "getResourceFiles", "signature": "Collection<String> getResourceFiles(Iterable<? extends FileSet> fileSets, boolean followLinks, boolean allowDuplicates, boolean allowFiles, boolean allowDirs) throws MojoExecutionException", "start_line": 3, "modifiers": "", "params": [{"name": "...
26088168_0
class LineIterator implements Iterator<String> { public LineIterator (String str) { this.str = str; this.strLength = str.length();; while (strLength > 0 && Character.isWhitespace(str.charAt(strLength - 1))) { --strLength; }...
LineIterator lineIter; lineIter = new WordWrapLineIterator("this is a string", 10); Assert.assertEquals("this is a", lineIter.next()); Assert.assertEquals("string", lineIter.next()); lineIter = new WordWrapLineIterator("this is a string", 4); As...
[FOCAL] public LineIterator.LineIterator(String str) [CLASS] class LineIterator implements Iterator<String> [METRICS] loc=11 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] String.length/0, Character.isWhitespace/1, String.charAt/1 [FIELDS] write=str, strLength [PATH1] while(strLength > 0 && Chara...
/* static context [FOCAL] public LineIterator.LineIterator(String str) [PATH1] while(strLength > 0 && Character.isWhitespace(str.charAt(strLength - 1)))=T -> exit loop [PATH2] while(strLength > 0 && Character.isWhitespace(str.charAt(strLength - 1)))=F [INPUTS] branches=str | result=- [STATE] str, strLength [FIELDS] wri...
/* static context [FOCAL] public LineIterator.LineIterator(String str) [PATH1] while(strLength > 0 && Character.isWhitespace(str.charAt(strLength - 1)))=T -> exit loop [PATH2] while(strLength > 0 && Character.isWhitespace(str.charAt(strLength - 1)))=F [INPUTS] branches=str | result=- [STATE] str, strLength [FIELDS] wri...
true
ok
{"focal": {"class": "LineIterator", "name": "LineIterator", "signature": "LineIterator(String str)", "start_line": 3, "modifiers": "public", "params": [{"name": "str", "type": "String"}], "return_type": null}, "class_info": {"name": "LineIterator", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "It...
26088996_0
class ChameleonTargetConfiguration { public Node getContainerDefinitionAsXml() { Document containerDocument = DomManipulation.createDocumentFromContainerTemplate(); // we can get directly the properties since template only set one container element final NodeList properties = containerDocu...
// given final ChameleonTargetConfiguration chameleonTargetConfiguration = new ChameleonTargetConfiguration("tomcat:8.0.0:managed"); // when final Element containerDefinition = (Element) chameleonTargetConfiguration.getContainerDefinitionAsXml(); // then fi...
[FOCAL] public Node ChameleonTargetConfiguration.getContainerDefinitionAsXml() [CLASS] class ChameleonTargetConfiguration [METRICS] loc=18 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] Element findChameleonTargetProperty(NodeList properties); String toChameleonTarget(); void updateCustomProperti...
/* static context [FOCAL] public Node ChameleonTargetConfiguration.getContainerDefinitionAsXml() [THROWS-WHEN] IllegalArgumentException when chameleonTargetProperty == null [PATH1] if(chameleonTargetProperty == null)=T -> throw new IllegalArgumentException("No property chameleonTarget found in ... [PATH2] if(chameleonT...
/* static context [FOCAL] public Node ChameleonTargetConfiguration.getContainerDefinitionAsXml() [THROWS-WHEN] IllegalArgumentException when chameleonTargetProperty == null [PATH1] if(chameleonTargetProperty == null)=T -> throw new IllegalArgumentException("No property chameleonTarget found in ... [PATH2] if(chameleonT...
true
ok
{"focal": {"class": "ChameleonTargetConfiguration", "name": "getContainerDefinitionAsXml", "signature": "Node getContainerDefinitionAsXml()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Node"}, "class_info": {"name": "ChameleonTargetConfiguration", "kind": "class", "modifiers": "", "superclass...
26094155_5
class MessagePollExecutor implements Runnable { @Override public void run() { Log.debug("Message pooling starts ..."); // is there message for processing? Message msg = null; int lockFailureCount = 0; while (true) { try { msg = messagesPool.g...
// prepare threads int threads = 5; final CountDownLatch latch = new CountDownLatch(threads); Runnable task = new Runnable() { @Override public void run() { try { messagePollExecutor.run(); } finally { ...
[FOCAL] @Override public void MessagePollExecutor.run() [CLASS] class MessagePollExecutor implements Runnable [METRICS] loc=37 cc=5 branches=2 loops=1 returns=0 throws=0 nesting=3 [CALLS-INTERNAL] void startMessageProcessing(Message msg) [CALLS-EXTERNAL] Log.debug/1, MessagesPool.getNextMessage/0, LogContextHelper.setL...
/* static context [FOCAL] @Override public void MessagePollExecutor.run() [PATH1] while(true)=T -> try-body throws -> if(lockFailureCount > LOCK_FAILURE_LIMIT)=T [PATH2] while(true)=T -> if(msg != null)=F [INPUTS] branches=messagesPool | result=- [COLLABORATORS] field messagesPool:MessagesPool getNextMessage/0 [EXCEPTI...
/* static context [FOCAL] @Override public void MessagePollExecutor.run() [PATH1] while(true)=T -> try-body throws -> if(lockFailureCount > LOCK_FAILURE_LIMIT)=T [PATH2] while(true)=T -> if(msg != null)=F [INPUTS] branches=messagesPool | result=- [COLLABORATORS] field messagesPool:MessagesPool getNextMessage/0 [EXCEPTI...
true
ok
{"focal": {"class": "MessagePollExecutor", "name": "run", "signature": "void run()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "MessagePollExecutor", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Runnable", "fields": [{"name": "...
26125896_0
class DefaultTypeProcessor implements TypeProcessor { @Override public Result processType(Type javaType, Context context) { if (Objects.equals(javaType, Object.class)) { return new Result(TsType.Any); } if (javaType instanceof Class) { final Class<?> javaClass = ...
TypeProcessor converter = new DefaultTypeProcessor(); final TypeProcessor.Context context = getTestContext(converter); assertEquals(context.getSymbol(A.class).getFullName(), converter.processType(A.class, context).getTsType().toString()); assertEquals(context.getSymbol(B.class).getFullNa...
[FOCAL] @Override public Result DefaultTypeProcessor.processType(Type javaType, Context context) [CLASS] class DefaultTypeProcessor implements TypeProcessor [METRICS] loc=143 cc=33 branches=30 loops=2 returns=28 throws=0 nesting=3 [CALLS-INTERNAL] Result processMapType(Type keyType, Type valueType, Context context); bo...
class DefaultTypeProcessor implements TypeProcessor { @Override public Result processType(Type javaType, Context context) { if (Objects.equals(javaType, Object.class)) { return new Result(TsType.Any); } if (javaType instanceof Class) { final Class<?> javaClass = ...
false
ok
{"focal": {"class": "DefaultTypeProcessor", "name": "processType", "signature": "Result processType(Type javaType, Context context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "javaType", "type": "Type"}, {"name": "context", "type": "Context"}], "return_type": "Result"}, "class_info": {"name...
26127972_0
class Bundler { public Bundler put(String key, boolean value) { delegate.putBoolean(key, value); return this; } private Bundler(Bundle delegate); public static Bundler copyOf(Bundle source); public static Bundler of(Bundle source); public static Bundler create(); public Bundler put(String key,...
ArrayList<Integer> integerArrayList = new ArrayList<Integer>(); integerArrayList.add(3); Bundle b = new Bundle(); ArrayList<String> stringArrayList = new ArrayList<String>(); stringArrayList.add("a string"); ArrayList<CharSequence> charSequenceArrayList = new ArrayList<CharSequence>(); charS...
[FOCAL] public Bundler Bundler.put(String key, boolean value) [CLASS] class Bundler [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] delegate.putBoolean/2 [COLLABORATORS] field delegate putBoolean/2 [DATAFLOW] key@param->L2; value@param->L2 [CLASS-MEMBERS] Bundler(Bundle delegate); ...
/* static context [FOCAL] public Bundler Bundler.put(String key, boolean value) [COLLABORATORS] field delegate putBoolean/2 [CALLS-EXTERNAL] delegate.putBoolean/2 */
/* static context [FOCAL] public Bundler Bundler.put(String key, boolean value) [COLLABORATORS] field delegate putBoolean/2 [CALLS-EXTERNAL] delegate.putBoolean/2 */ class Bundler { public Bundler put(String key, boolean value) { delegate.putBoolean(key, value); return this; } private Bundler(Bundle de...
true
ok
{"focal": {"class": "Bundler", "name": "put", "signature": "Bundler put(String key, boolean value)", "start_line": 3, "modifiers": "public", "params": [{"name": "key", "type": "String"}, {"name": "value", "type": "boolean"}], "return_type": "Bundler"}, "class_info": {"name": "Bundler", "kind": "class", "modifiers": "",...
26136655_58
class Int2IntHashMap implements Map<Integer, Integer>, Serializable { public boolean containsValue(final int value) { boolean found = false; if (value != missingValue) { @DoNotSub final int length = entries.length; @DoNotSub int remaining = size; for...
assertFalse(map.containsValue(1)); } }
[FOCAL] public boolean Int2IntHashMap.containsValue(int value) [CLASS] class Int2IntHashMap implements Map<Integer, Integer>, Serializable [METRICS] loc=24 cc=5 branches=3 loops=1 returns=1 throws=0 nesting=4 [PATH1] if(value != missingValue)=T -> for(remaining > 0 && valueIndex < length)=T -> if(missingValue != entrie...
/* static context [FOCAL] public boolean Int2IntHashMap.containsValue(int value) [PATH1] if(value != missingValue)=T -> for(remaining > 0 && valueIndex < length)=T -> if(missingValue != entries[valueIndex])=T -> if(value == entries[valueIndex])=F -> exit loop -> return found [PATH2] if(value != missingValue)=F -> retur...
/* static context [FOCAL] public boolean Int2IntHashMap.containsValue(int value) [PATH1] if(value != missingValue)=T -> for(remaining > 0 && valueIndex < length)=T -> if(missingValue != entries[valueIndex])=T -> if(value == entries[valueIndex])=F -> exit loop -> return found [PATH2] if(value != missingValue)=F -> retur...
true
ok
{"focal": {"class": "Int2IntHashMap", "name": "containsValue", "signature": "boolean containsValue(int value)", "start_line": 3, "modifiers": "public", "params": [{"name": "value", "type": "int"}], "return_type": "boolean"}, "class_info": {"name": "Int2IntHashMap", "kind": "class", "modifiers": "", "superclass": null, ...
26172294_0
class ArchetypeBuilder extends AbstractBuilder { public void generateArchetypes(String containerType, File baseDir, File outputDir, boolean clean, List<String> dirs) throws IOException { LOG.debug("Generating archetypes from {} to {}", baseDir.getCanonicalPath(), outputDir.getCanonicalPath()); File...
File srcDir = new File(basedir, "src/test/examples").getCanonicalFile(); try { List<String> dirs = new ArrayList<String>(); archetypeBuilder.generateArchetypes("java", srcDir, new File(basedir, "target/test-archetypes"), true, dirs); } finally { LOG.info("Com...
[FOCAL] public void ArchetypeBuilder.generateArchetypes(String containerType, File baseDir, File outputDir, boolean clean, List<String> dirs) [CLASS] class ArchetypeBuilder extends AbstractBuilder [METRICS] loc=32 cc=8 branches=6 loops=1 returns=0 throws=0 nesting=6 [CALLS-INTERNAL] boolean skipImport(File dir); void g...
/* static context [FOCAL] public void ArchetypeBuilder.generateArchetypes(String containerType, File baseDir, File outputDir, boolean clean, List<String> dirs) [PATH1] if(files != null)=T -> foreach(File file : files)=T -> if(file.isDirectory())=T -> if(projectPom.exists() && !skipImport(projectDir))=T -> if(archetypeU...
/* static context [FOCAL] public void ArchetypeBuilder.generateArchetypes(String containerType, File baseDir, File outputDir, boolean clean, List<String> dirs) [PATH1] if(files != null)=T -> foreach(File file : files)=T -> if(file.isDirectory())=T -> if(projectPom.exists() && !skipImport(projectDir))=T -> if(archetypeU...
true
ok
{"focal": {"class": "ArchetypeBuilder", "name": "generateArchetypes", "signature": "void generateArchetypes(String containerType, File baseDir, File outputDir, boolean clean, List<String> dirs) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "containerType", "type": "String"}, {"name": ...
26193137_1
class Assemblys { static public Assembly process(Path archiveFile) throws IOException { Path tempDir = Files.createTempDirectory("stork-deploy."); CloseablePath closeablePath = new CloseablePath(tempDir); return process(archiveFile, tempDir, Arrays.asList(closeablePath)); } static ...
Path archiveFile = TestHelper.getResource("/fixtures/hello-console-1.2.4.tar.gz"); try (Assembly assembly = Assemblys.process(archiveFile)) { assertThat(assembly.getName(), is("hello-console")); assertThat(assembly.getVersion(), is("1.2.4")); assertThat(assem...
[FOCAL] static public Assembly Assemblys.process(Path archiveFile) [CLASS] class Assemblys [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Assembly process(Path archiveFile, Path workDir, List<Closeable> resources) [CALLS-EXTERNAL] Files.createTempDirectory/1, Arrays.asList/1 [NEW]...
/* static context [FOCAL] static public Assembly Assemblys.process(Path archiveFile) [INPUTS] branches=- | result=archiveFile [EXCEPTIONS] declares IOException [CALLS-INTERNAL] Assembly process(Path archiveFile, Path workDir, List<Closeable> resources) [NEW] CloseablePath [CALLS-EXTERNAL] Files.createTempDirectory/1, A...
/* static context [FOCAL] static public Assembly Assemblys.process(Path archiveFile) [INPUTS] branches=- | result=archiveFile [EXCEPTIONS] declares IOException [CALLS-INTERNAL] Assembly process(Path archiveFile, Path workDir, List<Closeable> resources) [NEW] CloseablePath [CALLS-EXTERNAL] Files.createTempDirectory/1, A...
true
ok
{"focal": {"class": "Assemblys", "name": "process", "signature": "Assembly process(Path archiveFile) throws IOException", "start_line": 3, "modifiers": "static public", "params": [{"name": "archiveFile", "type": "Path"}], "return_type": "Assembly"}, "class_info": {"name": "Assemblys", "kind": "class", "modifiers": "", ...
26238360_29
class ConverterBoolean implements FieldConverter<Boolean> { @Override public Boolean convert( String aValue ) throws SdiException { if ( !StringUtils.hasText( aValue ) ) { myLog.debug( "Given value is null" ); return null; } String value = aValue.tri...
myLog.debug( "testing 'ja' fail" ); Boolean received = myClassUnderTest.convert( "ja" ); Assert.assertTrue( received ); myLog.debug( "testing 'nein' fail" ); received = myClassUnderTest.convert( "nein" ); Assert.assertFalse( received ); } }
[FOCAL] @Override public Boolean ConverterBoolean.convert(String aValue) [CLASS] class ConverterBoolean implements FieldConverter<Boolean> [METRICS] loc=30 cc=5 branches=3 loops=0 returns=4 throws=1 nesting=1 [CALLS-EXTERNAL] StringUtils.hasText/1, Logger.debug/1, aValue.trim().toLowerCase/0, String.trim/0, trueValues....
/* static context [FOCAL] @Override public Boolean ConverterBoolean.convert(String aValue) [THROWS-WHEN] SdiException when StringUtils.hasText( aValue ) && !trueValues.contains( value ) && !falseValues.contains( value ) && try-body throws [PATH1] if(!StringUtils.hasText( aValue ))=F -> if(trueValues.contains( value ))=...
/* static context [FOCAL] @Override public Boolean ConverterBoolean.convert(String aValue) [THROWS-WHEN] SdiException when StringUtils.hasText( aValue ) && !trueValues.contains( value ) && !falseValues.contains( value ) && try-body throws [PATH1] if(!StringUtils.hasText( aValue ))=F -> if(trueValues.contains( value ))=...
true
ok
{"focal": {"class": "ConverterBoolean", "name": "convert", "signature": "Boolean convert(String aValue) throws SdiException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "aValue", "type": "String"}], "return_type": "Boolean"}, "class_info": {"name": "ConverterBoolean", "kind": "class", "modifi...
26262349_108
class DoubleLinkedPoiCategory implements PoiCategory { @Override public int getID() { return this.id; } public DoubleLinkedPoiCategory(String title, PoiCategory parent); public DoubleLinkedPoiCategory(String title, PoiCategory parent, int id); private void addChildNode(DoubleLinkedP...
Assert.assertEquals(0, this.fastFood.getID()); Assert.assertEquals(1, this.bars.getID()); Assert.assertEquals(2, this.restaurants.getID()); Assert.assertEquals(3, this.electronics.getID()); Assert.assertEquals(4, this.clothes.getID()); Assert.assertEquals(5, this.shops.ge...
[FOCAL] @Override public int DoubleLinkedPoiCategory.getID() [CLASS] class DoubleLinkedPoiCategory implements PoiCategory [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [FIELDS] read=id [CLASS-MEMBERS] DoubleLinkedPoiCategory(String title, PoiCategory parent); DoubleLinkedPoiCategory(String title,...
/* static context [FOCAL] @Override public int DoubleLinkedPoiCategory.getID() [FIELDS] read=id */
/* static context [FOCAL] @Override public int DoubleLinkedPoiCategory.getID() [FIELDS] read=id */ class DoubleLinkedPoiCategory implements PoiCategory { @Override public int getID() { return this.id; } public DoubleLinkedPoiCategory(String title, PoiCategory parent); public DoubleLinked...
true
ok
{"focal": {"class": "DoubleLinkedPoiCategory", "name": "getID", "signature": "int getID()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "DoubleLinkedPoiCategory", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "PoiCategory", "fields"...
26282952_7
class CollectionHelper { public static <T> int singleIndexOf(Collection<T> items, Predicate<T> predicate) { int result = NOT_FOUND_INDEX; if (!isEmpty(items)) { int index = 0; for (T item : items) { if (predicate.apply(item)) { if (result...
int indexOf = CollectionHelper.singleIndexOf(Arrays.asList(1, 5, 3, 7, 9, 5), new Predicate<Integer>() { @Override public boolean apply(Integer object) { return object == 3; } }); assertEquals(2, indexOf); } }
[FOCAL] public static int CollectionHelper.singleIndexOf(Collection<T> items, Predicate<T> predicate) [CLASS] class CollectionHelper [METRICS] loc=20 cc=5 branches=3 loops=1 returns=1 throws=1 nesting=4 [CALLS-INTERNAL] boolean isEmpty(Collection items) [CALLS-EXTERNAL] Predicate<T>.apply/1 [NEW] InvalidOperationExcept...
/* static context [FOCAL] public static int CollectionHelper.singleIndexOf(Collection<T> items, Predicate<T> predicate) [THROWS-WHEN] InvalidOperationException when !isEmpty(items) && foreach(T item : items)=T && predicate.apply(item) && !(result == NOT_FOUND_INDEX) [PATH1] if(!isEmpty(items))=T -> foreach(T item : ite...
/* static context [FOCAL] public static int CollectionHelper.singleIndexOf(Collection<T> items, Predicate<T> predicate) [THROWS-WHEN] InvalidOperationException when !isEmpty(items) && foreach(T item : items)=T && predicate.apply(item) && !(result == NOT_FOUND_INDEX) [PATH1] if(!isEmpty(items))=T -> foreach(T item : ite...
true
ok
{"focal": {"class": "CollectionHelper", "name": "singleIndexOf", "signature": "int singleIndexOf(Collection<T> items, Predicate<T> predicate)", "start_line": 3, "modifiers": "public static", "params": [{"name": "items", "type": "Collection<T>"}, {"name": "predicate", "type": "Predicate<T>"}], "return_type": "int"}, "cl...
26284658_0
class BaseProducer { public static byte[] serializeAvro(Schema schema, GenericRecord event) throws IOException { ByteArrayOutputStream stream = new ByteArrayOutputStream(); BinaryEncoder binaryEncoder = EncoderFactory.get().binaryEncoder(stream, null); DatumWriter<GenericRecord> datumWriter = new Generic...
Schema schema = new Schema.Parser().parse("{\n" + "\t\"type\":\"record\",\n" + "\t\"name\":\"test_schema_1\",\n" + "\t\"fields\" : [ {\n" + "\t\t\"name\":\"a\",\n" + "\t\t\"type\":\"int\"\n" + "\t\t},\n" + "\t\t{\n" + "\t\t\"name\":\"b\",\n" + ...
[FOCAL] public static byte[] BaseProducer.serializeAvro(Schema schema, GenericRecord event) [CLASS] class BaseProducer [METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] EncoderFactory.get().binaryEncoder/2, EncoderFactory.get/0, DatumWriter<GenericRecord>.write/2, BinaryEncoder.flus...
/* static context [FOCAL] public static byte[] BaseProducer.serializeAvro(Schema schema, GenericRecord event) [EXCEPTIONS] declares IOException [NEW] ByteArrayOutputStream, GenericDatumWriter<GenericRecord> [CALLS-EXTERNAL] EncoderFactory.get().binaryEncoder/2, EncoderFactory.get/0, DatumWriter<GenericRecord>.write/2, ...
/* static context [FOCAL] public static byte[] BaseProducer.serializeAvro(Schema schema, GenericRecord event) [EXCEPTIONS] declares IOException [NEW] ByteArrayOutputStream, GenericDatumWriter<GenericRecord> [CALLS-EXTERNAL] EncoderFactory.get().binaryEncoder/2, EncoderFactory.get/0, DatumWriter<GenericRecord>.write/2, ...
true
ok
{"focal": {"class": "BaseProducer", "name": "serializeAvro", "signature": "byte[] serializeAvro(Schema schema, GenericRecord event) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "schema", "type": "Schema"}, {"name": "event", "type": "GenericRecord"}], "return_type": "byte[]"}, ...
26308814_18
class Luhn { public static boolean isValid(String number) { checkLongerThan("The number must have at least 2 characters.", number, 2); checkIsDigitsOnly("Only digits are allowed", number); int length = number.length(); // We will study all the digits but the last char[] cha...
// GIVEN String number = "123456789"; // WHEN boolean valid = Luhn.isValid(number); // THEN assertFalse(valid); } }
[FOCAL] public static boolean Luhn.isValid(String number) [CLASS] class Luhn [METRICS] loc=21 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] checkLongerThan/3 (inherited), checkIsDigitsOnly/2 (inherited), String.length/0, number.substring(0, length - 1).toCharArray/0, String.substring/2, Characte...
/* static context [FOCAL] public static boolean Luhn.isValid(String number) [PATH1] for(i < length - 1)=T -> exit loop -> return sum % 10 == 0 [PATH2] for(i < length - 1)=F -> return sum % 10 == 0 [INPUTS] branches=number | result=number [CALLS-EXTERNAL] checkLongerThan/3 (inherited), checkIsDigitsOnly/2 (inherited), S...
/* static context [FOCAL] public static boolean Luhn.isValid(String number) [PATH1] for(i < length - 1)=T -> exit loop -> return sum % 10 == 0 [PATH2] for(i < length - 1)=F -> return sum % 10 == 0 [INPUTS] branches=number | result=number [CALLS-EXTERNAL] checkLongerThan/3 (inherited), checkIsDigitsOnly/2 (inherited), S...
true
ok
{"focal": {"class": "Luhn", "name": "isValid", "signature": "boolean isValid(String number)", "start_line": 3, "modifiers": "public static", "params": [{"name": "number", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "Luhn", "kind": "class", "modifiers": "", "superclass": null, "interfaces": nul...
26311068_4
class UserDao { public User findUserByUserName(final String userName) { String sqlStr = " SELECT user_id,user_name " + " FROM t_user WHERE user_name =? "; final User user = new User(); jdbcTemplate.query(sqlStr, new Object[]{userName}, new RowCallbackHandler(...
User user = userDao.findUserByUserName("admin"); assertNotNull(user); assertEquals(user.getUserName(), "admin"); } }
[FOCAL] public User UserDao.findUserByUserName(String userName) [CLASS] class UserDao [METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] jdbcTemplate.query/3, User.setUserId/1, rs.getInt/1, User.setUserName/1 [NEW] User, RowCallbackHandler [COLLABORATORS] field jdbcTemplate query/3; ...
/* static context [FOCAL] public User UserDao.findUserByUserName(String userName) [COLLABORATORS] field jdbcTemplate query/3; field rs getInt/1 [NEW] User, RowCallbackHandler [CALLS-EXTERNAL] jdbcTemplate.query/3, User.setUserId/1, rs.getInt/1, User.setUserName/1 */
/* static context [FOCAL] public User UserDao.findUserByUserName(String userName) [COLLABORATORS] field jdbcTemplate query/3; field rs getInt/1 [NEW] User, RowCallbackHandler [CALLS-EXTERNAL] jdbcTemplate.query/3, User.setUserId/1, rs.getInt/1, User.setUserName/1 */ class UserDao { public User findUserByUserName(f...
true
ok
{"focal": {"class": "UserDao", "name": "findUserByUserName", "signature": "User findUserByUserName(String userName)", "start_line": 3, "modifiers": "public", "params": [{"name": "userName", "type": "String"}], "return_type": "User"}, "class_info": {"name": "UserDao", "kind": "class", "modifiers": "", "superclass": null...
26323526_83
class GVELayout implements LogicalGraphLayout<EPGMGraphHead, EPGMVertex, EPGMEdge>, GraphCollectionLayout<EPGMGraphHead, EPGMVertex, EPGMEdge> { @Override public DataSet<GraphTransaction> getGraphTransactions() { DataSet<Tuple2<GradoopId, EPGMGraphElement>> graphVertexTuples = getVertices() .map(new Ca...
GraphTransaction tx0 = new GraphTransaction(g0, Sets.newHashSet(v0, v1), Sets.newHashSet(e0)); assertEquals(tx0, from(singletonList(g0), asList(v0, v1), singletonList(e0)).getGraphTransactions().collect().get(0)); } }
[FOCAL] @Override public DataSet<GraphTransaction> GVELayout.getGraphTransactions() [CLASS] class GVELayout implements LogicalGraphLayout<EPGMGraphHead, EPGMVertex, EPGMEdge>, GraphCollectionLayout<EPGMGraphHead, EPGMVertex, EPGMEdge> [METRICS] loc=24 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL...
/* static context [FOCAL] @Override public DataSet<GraphTransaction> GVELayout.getGraphTransactions() [CALLS-INTERNAL] DataSet<EPGMEdge> getEdges(); DataSet<EPGMGraphHead> getGraphHeads(); DataSet<EPGMVertex> getVertices() [NEW] Cast<>, GraphElementExpander<>, GraphVerticesEdges, Id<>, TransactionFromSets [CALLS-EXTERN...
/* static context [FOCAL] @Override public DataSet<GraphTransaction> GVELayout.getGraphTransactions() [CALLS-INTERNAL] DataSet<EPGMEdge> getEdges(); DataSet<EPGMGraphHead> getGraphHeads(); DataSet<EPGMVertex> getVertices() [NEW] Cast<>, GraphElementExpander<>, GraphVerticesEdges, Id<>, TransactionFromSets [CALLS-EXTERN...
true
ok
{"focal": {"class": "GVELayout", "name": "getGraphTransactions", "signature": "DataSet<GraphTransaction> getGraphTransactions()", "start_line": 4, "modifiers": "@Override public", "params": [], "return_type": "DataSet<GraphTransaction>"}, "class_info": {"name": "GVELayout", "kind": "class", "modifiers": "", "superclass...
26344305_1
class Matrix { static int[][] SpiralMatrix(int n) { int[][] a = new int[n][n]; int c = 1, x = 0, y = 0; int d = 0; while (c <= n * n) { if (a[x][y] == 0) { a[x][y] = c++; } else { d++; d = d % 4; } switch (d) { case 0: if (y < n - 1 && a[x][y + 1] < 1) y++; else { ...
int[][] expecteds = new int[1][1]; expecteds[0][0] = 1; int n = 1; int[][] actuals = Matrix.SpiralMatrix(n); for (int i = 0; i < n; i++) { Assert.assertArrayEquals(expecteds[i], actuals[i]); } n = 2; actuals = Matrix.SpiralMatrix(n); expecteds = new int[][]{{1,2},{4,3}}; for (int i = 0; i <...
[FOCAL] static int[][] Matrix.SpiralMatrix(int n) [CLASS] class Matrix [METRICS] loc=55 cc=11 branches=6 loops=1 returns=1 throws=0 nesting=3 [PATH1] while(c <= n * n)=T -> if(a[x][y] == 0)=T -> switch(d)=case 0 -> if(y < n - 1 && a[x][y + 1] < 1)=T -> exit loop -> return a [PATH2] while(c <= n * n)=T -> if(a[x][y] == ...
/* static context [FOCAL] static int[][] Matrix.SpiralMatrix(int n) [PATH1] while(c <= n * n)=T -> if(a[x][y] == 0)=T -> switch(d)=case 0 -> if(y < n - 1 && a[x][y + 1] < 1)=T -> exit loop -> return a [PATH2] while(c <= n * n)=T -> if(a[x][y] == 0)=F -> switch(d)=case 1 -> if(x < n - 1 && a[x + 1][y] < 1)=T -> exit loo...
/* static context [FOCAL] static int[][] Matrix.SpiralMatrix(int n) [PATH1] while(c <= n * n)=T -> if(a[x][y] == 0)=T -> switch(d)=case 0 -> if(y < n - 1 && a[x][y + 1] < 1)=T -> exit loop -> return a [PATH2] while(c <= n * n)=T -> if(a[x][y] == 0)=F -> switch(d)=case 1 -> if(x < n - 1 && a[x + 1][y] < 1)=T -> exit loo...
true
ok
{"focal": {"class": "Matrix", "name": "SpiralMatrix", "signature": "int[][] SpiralMatrix(int n)", "start_line": 3, "modifiers": "static", "params": [{"name": "n", "type": "int"}], "return_type": "int[][]"}, "class_info": {"name": "Matrix", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "field...
26347416_4
class MavenColaProvider implements IColaProvider { @Override public List<String> getTargetClasses() { if (deltas != null) { return deltas; } final String[] resolvedIncludes = resolveIncludes(); final DirectoryScanner scanner = new DirectoryScanner(); if (re...
// When final List<String> classes = uut.getTargetClasses(); // Then assertThat(classes.isEmpty(), is(false)); assertThat(classes, hasItem(binaryToOsClass(getClass().getCanonicalName()))); } }
[FOCAL] @Override public List<String> MavenColaProvider.getTargetClasses() [CLASS] class MavenColaProvider implements IColaProvider [METRICS] loc=21 cc=4 branches=3 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] String[] resolveIncludes() [CALLS-EXTERNAL] DirectoryScanner.setIncludes/1, DirectoryScanner.setExclu...
/* static context [FOCAL] @Override public List<String> MavenColaProvider.getTargetClasses() [PATH1] if(deltas != null)=F -> if(resolvedIncludes != null && resolvedIncludes.length > 0)=T -> if(excludes != null && excludes.length > 0)=T -> return new ArrayList<String>(asList(scanner.getIncludedFiles())) [PATH2] if(delta...
/* static context [FOCAL] @Override public List<String> MavenColaProvider.getTargetClasses() [PATH1] if(deltas != null)=F -> if(resolvedIncludes != null && resolvedIncludes.length > 0)=T -> if(excludes != null && excludes.length > 0)=T -> return new ArrayList<String>(asList(scanner.getIncludedFiles())) [PATH2] if(delta...
true
ok
{"focal": {"class": "MavenColaProvider", "name": "getTargetClasses", "signature": "List<String> getTargetClasses()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "List<String>"}, "class_info": {"name": "MavenColaProvider", "kind": "class", "modifiers": "", "superclass": null, "interfac...
26403452_9
class FilterEngine { public void filterRequest(RequestFilterContext request) { for (RequestFilter filter : filterManager.getRequestFilters()) { filter.filter(request); } } public FilterEngine(FilterManagerImpl filterManager); public void filterResponse(Request request, Re...
// Given RequestFilterContext request = mock(RequestFilterContext.class); // When engine.filterRequest(request); // Then verify(requestFilter).filter(request); } }
[FOCAL] public void FilterEngine.filterRequest(RequestFilterContext request) [CLASS] class FilterEngine [METRICS] loc=5 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] filterManager.getRequestFilters/0, RequestFilter.filter/1 [PATH1] foreach(RequestFilter filter : filterManager.getRequestFilters()...
/* static context [FOCAL] public void FilterEngine.filterRequest(RequestFilterContext request) [PATH1] foreach(RequestFilter filter : filterManager.getRequestFilters())=T -> exit loop [PATH2] foreach(RequestFilter filter : filterManager.getRequestFilters())=F [COLLABORATORS] field filterManager getRequestFilters/0 [CAL...
/* static context [FOCAL] public void FilterEngine.filterRequest(RequestFilterContext request) [PATH1] foreach(RequestFilter filter : filterManager.getRequestFilters())=T -> exit loop [PATH2] foreach(RequestFilter filter : filterManager.getRequestFilters())=F [COLLABORATORS] field filterManager getRequestFilters/0 [CAL...
true
ok
{"focal": {"class": "FilterEngine", "name": "filterRequest", "signature": "void filterRequest(RequestFilterContext request)", "start_line": 3, "modifiers": "public", "params": [{"name": "request", "type": "RequestFilterContext"}], "return_type": "void"}, "class_info": {"name": "FilterEngine", "kind": "class", "modifier...
26424110_10
class Problem0001TwoSum { public int[] solution001(int[] nums, int target) { final Map<Integer, Integer> map = new HashMap<>(); for (int i = 0; i < nums.length; i++) { final int delta = target - nums[i]; if (!map.containsKey(delta)) { map.put(nums[i], i); continue; } ...
final int[] testSrc = {2, 7, 8, 8, 0}; final int[] result = problem.solution001(testSrc, 10); Assert.assertEquals(testSrc[result[0]] + testSrc[result[1]], 10); } }
[FOCAL] public int[] Problem0001TwoSum.solution001(int[] nums, int target) [CLASS] class Problem0001TwoSum [METRICS] loc=13 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] Map<Integer, Integer>.containsKey/1, Map<Integer, Integer>.put/2, Map<Integer, Integer>.get/1 [NEW] HashMap<> [PATH1] for(i < ...
/* static context [FOCAL] public int[] Problem0001TwoSum.solution001(int[] nums, int target) [PATH1] for(i < nums.length)=T -> if(!map.containsKey(delta))=T -> exit loop -> return null [PATH2] for(i < nums.length)=T -> if(!map.containsKey(delta))=F -> return new int[] {map.get(delta), i} [PATH3] for(i < nums.length)=F ...
/* static context [FOCAL] public int[] Problem0001TwoSum.solution001(int[] nums, int target) [PATH1] for(i < nums.length)=T -> if(!map.containsKey(delta))=T -> exit loop -> return null [PATH2] for(i < nums.length)=T -> if(!map.containsKey(delta))=F -> return new int[] {map.get(delta), i} [PATH3] for(i < nums.length)=F ...
true
ok
{"focal": {"class": "Problem0001TwoSum", "name": "solution001", "signature": "int[] solution001(int[] nums, int target)", "start_line": 3, "modifiers": "public", "params": [{"name": "nums", "type": "int[]"}, {"name": "target", "type": "int"}], "return_type": "int[]"}, "class_info": {"name": "Problem0001TwoSum", "kind":...
26442054_5
class MultipartReplyMessageFactory implements OFSerializer<MultipartReplyMessage>, SerializerRegistryInjector { @Override public void serialize(MultipartReplyMessage message, ByteBuf outBuffer) { ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH); outBuff...
builder.setType(MultipartType.forValue(10)); MultipartReplyMeterConfigCaseBuilder meterConfigCase = new MultipartReplyMeterConfigCaseBuilder(); MultipartReplyMeterConfigBuilder meterConfigBuilder = new MultipartReplyMeterConfigBuilder(); meterConfigBuilder.setMeterConfig(createMeterConfi...
[FOCAL] @Override public void MultipartReplyMessageFactory.serialize(MultipartReplyMessage message, ByteBuf outBuffer) [CLASS] class MultipartReplyMessageFactory implements OFSerializer<MultipartReplyMessage>, SerializerRegistryInjector [METRICS] loc=55 cc=16 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTER...
class MultipartReplyMessageFactory implements OFSerializer<MultipartReplyMessage>, SerializerRegistryInjector { @Override public void serialize(MultipartReplyMessage message, ByteBuf outBuffer) { ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH); outBuff...
false
ok
{"focal": {"class": "MultipartReplyMessageFactory", "name": "serialize", "signature": "void serialize(MultipartReplyMessage message, ByteBuf outBuffer)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "message", "type": "MultipartReplyMessage"}, {"name": "outBuffer", "type": "ByteBuf"}], "return_...
26444805_0
class AreaProcess extends AbstractStatisticsProcess { @Override @SuppressWarnings("unchecked") public Map<String, Object> execute(Map<String, Object> input, ProgressListener monitor) throws ProcessException { SimpleFeatureCollection features = (SimpleFeatureCollection) Params.getValue(i...
SimpleFeatureSource source = dataStore.getFeatureSource("polygon"); assertTrue(source.getCount(Query.ALL) > 0); Map<String, Object> input = new HashMap<String, Object>(); input.put(AreaProcessFactory.inputFeatures.key, source.getFeatures()); // direct org.geotools.proce...
[FOCAL] @Override @SuppressWarnings("unchecked") public Map<String, Object> AreaProcess.execute(Map<String, Object> input, ProgressListener monitor) [CLASS] class AreaProcess extends AbstractStatisticsProcess [METRICS] loc=51 cc=6 branches=3 loops=0 returns=1 throws=1 nesting=3 [CALLS-INTERNAL] double sumArea(SimpleFea...
/* static context [FOCAL] @Override @SuppressWarnings("unchecked") public Map<String, Object> AreaProcess.execute(Map<String, Object> input, ProgressListener monitor) [THROWS-WHEN] NullPointerException when features == null [PATH1] if(features == null)=F -> if(sourceCRS == null || targetUnit == AreaUnit.Default)=F -> i...
/* static context [FOCAL] @Override @SuppressWarnings("unchecked") public Map<String, Object> AreaProcess.execute(Map<String, Object> input, ProgressListener monitor) [THROWS-WHEN] NullPointerException when features == null [PATH1] if(features == null)=F -> if(sourceCRS == null || targetUnit == AreaUnit.Default)=F -> i...
true
ok
{"focal": {"class": "AreaProcess", "name": "execute", "signature": "Map<String, Object> execute(Map<String, Object> input, ProgressListener monitor) throws ProcessException", "start_line": 3, "modifiers": "@Override @SuppressWarnings(\"unchecked\") public", "params": [{"name": "input", "type": "Map<String, Object>"}, {...
26461674_4
class StringUtils { public static Iterable<String> splitRespectEscape(String s, char c) { String cs = shouldEscape(c) ? "\\" + c : Character.toString(c); Pattern p = Pattern.compile("[^\\\\]" + cs); //return Splitter.on(c).omitEmptyStrings().trimResults().split(s); return Splitter.o...
String s = "a\\ b"; Iterator<String> r = splitRespectEscape(s, ' ').iterator(); assertTrue(r.hasNext()); assertEquals("a\\ b", r.next()); } }
[FOCAL] public static Iterable<String> StringUtils.splitRespectEscape(String s, char c) [CLASS] class StringUtils [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] boolean shouldEscape(char c) [CALLS-EXTERNAL] Character.toString/1, Pattern.compile/1, Splitter.on(p).omitEmptyStrings()...
/* static context [FOCAL] public static Iterable<String> StringUtils.splitRespectEscape(String s, char c) [INPUTS] branches=- | result=c, s [CALLS-INTERNAL] boolean shouldEscape(char c) [CALLS-EXTERNAL] Character.toString/1, Pattern.compile/1, Splitter.on(p).omitEmptyStrings().trimResults().split/1, Splitter.on(p).omit...
/* static context [FOCAL] public static Iterable<String> StringUtils.splitRespectEscape(String s, char c) [INPUTS] branches=- | result=c, s [CALLS-INTERNAL] boolean shouldEscape(char c) [CALLS-EXTERNAL] Character.toString/1, Pattern.compile/1, Splitter.on(p).omitEmptyStrings().trimResults().split/1, Splitter.on(p).omit...
true
ok
{"focal": {"class": "StringUtils", "name": "splitRespectEscape", "signature": "Iterable<String> splitRespectEscape(String s, char c)", "start_line": 3, "modifiers": "public static", "params": [{"name": "s", "type": "String"}, {"name": "c", "type": "char"}], "return_type": "Iterable<String>"}, "class_info": {"name": "St...
26525416_12
class CubeMetastoreClient { public XFact getXFactTable(String tableName) throws LensException { return getXFactTable(getFactTable(tableName)); } private CubeMetastoreClient(HiveConf conf); public DataCompletenessChecker getCompletenessChecker(); public boolean isDataCompletenessCheckEnabled(); priva...
List<FieldSchema> factColumns = new ArrayList<>(cubeMeasures.size()); for (CubeMeasure measure : cubeMeasures) { factColumns.add(measure.getColumn()); } // add one dimension of the cube factColumns.add(new FieldSchema("zipcode", "int", "zip")); FieldSchema itPart = new FieldSchema("it", "...
[FOCAL] public XFact CubeMetastoreClient.getXFactTable(String tableName) [CLASS] class CubeMetastoreClient [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] FactTable getFactTable(String tableName); XFact getXFactTable(FactTable ft) [EXCEPTIONS] declares LensException [INPUTS] branch...
class CubeMetastoreClient { public XFact getXFactTable(String tableName) throws LensException { return getXFactTable(getFactTable(tableName)); } private CubeMetastoreClient(HiveConf conf); public DataCompletenessChecker getCompletenessChecker(); public boolean isDataCompletenessCheckEnabled(); priva...
false
ok
{"focal": {"class": "CubeMetastoreClient", "name": "getXFactTable", "signature": "XFact getXFactTable(String tableName) throws LensException", "start_line": 3, "modifiers": "public", "params": [{"name": "tableName", "type": "String"}], "return_type": "XFact"}, "class_info": {"name": "CubeMetastoreClient", "kind": "clas...
26525663_6
class LoadBalanceProxyFactoryBean extends ServiceMultiInterfaceAccessor implements BeanClassLoaderAware, FactoryBean, InitializingBean, MethodInterceptor, DisposableBean, BeanNameAware { @SuppressWarnings("unchecked") public void afterPropertiesSet() throws Exception { if (getServiceInterface()...
LoadBalanceProxyFactoryBean loadBalanceProxyFactoryBean = newLoadBalanceProxyFactoryBean(null, null); try { loadBalanceProxyFactoryBean.afterPropertiesSet(); Assert.fail("loadBalanceProxyFactoryBean with null service interface property should throw exception."); } catch ...
[FOCAL] @SuppressWarnings("unchecked") public void LoadBalanceProxyFactoryBean.afterPropertiesSet() [CLASS] class LoadBalanceProxyFactoryBean extends ServiceMultiInterfaceAccessor implements BeanClassLoaderAware, FactoryBean, InitializingBean, MethodInterceptor, DisposableBean, BeanNameAware [METRICS] loc=65 cc=14 bran...
/* static context [FOCAL] @SuppressWarnings("unchecked") public void LoadBalanceProxyFactoryBean.afterPropertiesSet() [THROWS-WHEN] IllegalArgumentException when getServiceInterface() == null [THROWS-WHEN] IllegalArgumentException when !(getServiceInterface() == null) && targetBeans == null [THROWS-WHEN] IllegalArgumen...
/* static context [FOCAL] @SuppressWarnings("unchecked") public void LoadBalanceProxyFactoryBean.afterPropertiesSet() [THROWS-WHEN] IllegalArgumentException when getServiceInterface() == null [THROWS-WHEN] IllegalArgumentException when !(getServiceInterface() == null) && targetBeans == null [THROWS-WHEN] IllegalArgumen...
true
ok
{"focal": {"class": "LoadBalanceProxyFactoryBean", "name": "afterPropertiesSet", "signature": "void afterPropertiesSet() throws Exception", "start_line": 4, "modifiers": "@SuppressWarnings(\"unchecked\") public", "params": [], "return_type": "void"}, "class_info": {"name": "LoadBalanceProxyFactoryBean", "kind": "class"...
26554573_3
class MyResource { @POST @Produces(MediaType.APPLICATION_JSON) public Model postIt() { return new Model("todd", "http://www.toddfredrich.com/"); } @GET @Produces(MediaType.TEXT_PLAIN) public String getIt(); private HttpServer server; private WebTarget target; } class MyResourceTest { private H...
Response response = target.path("myresource").request().post(null); assertEquals(200, response.getStatus()); MyResource.Model model = response.readEntity(MyResource.Model.class); assertEquals("todd", model.getName()); assertEquals("http://www.toddfredrich.com/", model.getHref()); ...
[FOCAL] @POST @Produces(MediaType.APPLICATION_JSON) public Model MyResource.postIt() [CLASS] class MyResource [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] Model [CLASS-MEMBERS] String getIt() [TEST] MyResourceTest: @Test public void testPostIt() [TEST-FIELDS] HttpServer server, WebTarget t...
/* static context [FOCAL] @POST @Produces(MediaType.APPLICATION_JSON) public Model MyResource.postIt() [NEW] Model */
/* static context [FOCAL] @POST @Produces(MediaType.APPLICATION_JSON) public Model MyResource.postIt() [NEW] Model */ class MyResource { @POST @Produces(MediaType.APPLICATION_JSON) public Model postIt() { return new Model("todd", "http://www.toddfredrich.com/"); } @GET @Produces(MediaType.TEXT_PLAIN) public S...
true
ok
{"focal": {"class": "MyResource", "name": "postIt", "signature": "Model postIt()", "start_line": 3, "modifiers": "@POST @Produces(MediaType.APPLICATION_JSON) public", "params": [], "return_type": "Model"}, "class_info": {"name": "MyResource", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fi...
26558278_5
class Block extends Super { public abstract void set( int i, int j, double value ) throws JWaveExceptionpublic abstract void set( int i, int j, double value ) throws JWaveException; public abstract void set( int i, int j, double value ) throws JWaveExceptionpublic Block( ); public abstract void set( int i, int j, do...
try { Block block = genBlockFullObject( _noOfRows, _noOfCols ); for( int i = 0; i < block.getNoOfRows( ); i++ ) for( int j = 0; j < block.getNoOfCols( ); j++ ) block.set( i, j, (double)( i + j + 1 ) ); for( int i = 0; i < block.getNoOfRows( ); i++ ) for( int j = 0; j ...
[FOCAL] public abstract void Block.set(int i, int j, double value) [CLASS] class Block extends Super [METRICS] loc=1 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [EXCEPTIONS] declares JWaveException [CLASS-MEMBERS] Block(); Block(Block block); Block(int noOfRows, int noOfCols); Block(int offSetRow, int offSetCo...
/* static context [FOCAL] public abstract void Block.set(int i, int j, double value) [EXCEPTIONS] declares JWaveException */
/* static context [FOCAL] public abstract void Block.set(int i, int j, double value) [EXCEPTIONS] declares JWaveException */ class Block extends Super { public abstract void set( int i, int j, double value ) throws JWaveExceptionpublic abstract void set( int i, int j, double value ) throws JWaveException; public abst...
true
partial
{"focal": {"class": "Block", "name": "set", "signature": "void set(int i, int j, double value) throws JWaveException", "start_line": 3, "modifiers": "public abstract", "params": [{"name": "i", "type": "int"}, {"name": "j", "type": "int"}, {"name": "value", "type": "double"}], "return_type": "void"}, "class_info": {"nam...
26574771_3
class Product { public Long getId() { return id; } public Product(String sku, String name); public void setId(Long id); public String getSku(); public void setSku(String sku); public String getName(); public void setName(String name); public static Product byName(String name); private stati...
LoadExampleData.load(); try (Transaction txn0 = DB.beginTransaction()) { Product newProd = new Product("Copper", "COP"); DB.save(newProd); List<Product> list = new QProduct() .name.istartsWith("c") .orderBy() .name.asc() .forUpdate() .findList(); ...
[FOCAL] public Long Product.getId() [CLASS] class Product [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Product(String sku, String name); void setId(Long id); String getSku(); void setSku(String sku); String getName(); void setName(String name); Product byName(String name) [TEST] ...
/* static context [FOCAL] public Long Product.getId() */
/* static context [FOCAL] public Long Product.getId() */ class Product { public Long getId() { return id; } public Product(String sku, String name); public void setId(Long id); public String getSku(); public void setSku(String sku); public String getName(); public void setName(String name); pu...
true
ok
{"focal": {"class": "Product", "name": "getId", "signature": "Long getId()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Long"}, "class_info": {"name": "Product", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "log", "type": "Logger", "modifiers":...
26628954_3
class RoutingContextImpl extends RoutingContextImplBase { @Override public HttpServerResponse response() { return request.response(); } public RoutingContextImpl(String mountPoint, RouterImpl router, HttpServerRequest request, Set<RouteImpl> routes); private String ensureNotNull(String string); priv...
router.route().handler(event -> { assertTrue(event.is("application/json")); event.response().end(); }); testRequest(HttpMethod.POST, "/", req -> { req.setChunked(true); req.putHeader("Content-Type", "application/json"); req.write(Buffer.buffer("{ \"foo\": \"bar\" }")); }, H...
[FOCAL] @Override public HttpServerResponse RoutingContextImpl.response() [CLASS] class RoutingContextImpl extends RoutingContextImplBase [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] request.response/0 [COLLABORATORS] field request response/0 [CLASS-MEMBERS] RoutingContextImpl(S...
/* static context [FOCAL] @Override public HttpServerResponse RoutingContextImpl.response() [COLLABORATORS] field request response/0 [CALLS-EXTERNAL] request.response/0 */
/* static context [FOCAL] @Override public HttpServerResponse RoutingContextImpl.response() [COLLABORATORS] field request response/0 [CALLS-EXTERNAL] request.response/0 */ class RoutingContextImpl extends RoutingContextImplBase { @Override public HttpServerResponse response() { return request.response(); } ...
true
ok
{"focal": {"class": "RoutingContextImpl", "name": "response", "signature": "HttpServerResponse response()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "HttpServerResponse"}, "class_info": {"name": "RoutingContextImpl", "kind": "class", "modifiers": "", "superclass": "RoutingContextIm...
26629839_7
class Ditaa implements DiagramGenerator { @Override public ResponseData generate(Request request) throws IOException { MimeType format = request.headers.getValue(HTTPHeader.ACCEPT); if (format == null) { format = DEFAULT_OUTPUT_FORMAT; } if (!format.equals(MimeType....
HTTPHeaders h = new HTTPHeaders(); h.putValue(HTTPHeader.CONTENT_TYPE, MimeType.TEXT_PLAIN_UTF8); h.putValue(HTTPHeader.ACCEPT, MimeType.PNG); ResponseData response = new Ditaa().generate(new Request( URI.create("/ditaa"), h, DITAA...
[FOCAL] @Override public ResponseData Ditaa.generate(Request request) [CLASS] class Ditaa implements DiagramGenerator [METRICS] loc=47 cc=7 branches=6 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] void doConvert(InputStream input, OutputStream output, ConversionOptions options) [CALLS-EXTERNAL] request.headers....
/* static context [FOCAL] @Override public ResponseData Ditaa.generate(Request request) [THROWS-WHEN] IOException when format == null && !format.equals(MimeType.PNG) && !format.equals(MimeType.SVG) [THROWS-WHEN] IOException when !(format == null) && !format.equals(MimeType.PNG) && !format.equals(MimeType.SVG) [PATH1] i...
/* static context [FOCAL] @Override public ResponseData Ditaa.generate(Request request) [THROWS-WHEN] IOException when format == null && !format.equals(MimeType.PNG) && !format.equals(MimeType.SVG) [THROWS-WHEN] IOException when !(format == null) && !format.equals(MimeType.PNG) && !format.equals(MimeType.SVG) [PATH1] i...
true
ok
{"focal": {"class": "Ditaa", "name": "generate", "signature": "ResponseData generate(Request request) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "Request"}], "return_type": "ResponseData"}, "class_info": {"name": "Ditaa", "kind": "class", "modifiers": "...
26633479_0
class Value implements IValue { public Value getConvert(IClass type) { Value newVal = value(type.getClassHolder(), value); convert(newVal, type); return newVal; } private Value(ClassHolder holder, Boolean value); private Value(ClassHolder holder, Byte value); private Val...
ASMSupportClassLoader classLoader = CachedThreadLocalClassLoader.getInstance(); Value value = Value.value(classLoader, 1); Value newValue = value.getConvert(classLoader.getType(double.class)); Assert.assertEquals(Type.DOUBLE_TYPE, newValue.getType()); Assert.assertTrue(newValue.getV...
[FOCAL] public Value Value.getConvert(IClass type) [CLASS] class Value implements IValue [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Value value(ClassHolder holder, Integer obj); void convert(Value val, IClass type) [CALLS-EXTERNAL] IClass.getClassHolder/0 [INPUTS] branches=- |...
/* static context [FOCAL] public Value Value.getConvert(IClass type) [INPUTS] branches=- | result=type [COLLABORATORS] param type:IClass getClassHolder/0 [CALLS-INTERNAL] Value value(ClassHolder holder, Integer obj); void convert(Value val, IClass type) [CALLS-EXTERNAL] IClass.getClassHolder/0 */
/* static context [FOCAL] public Value Value.getConvert(IClass type) [INPUTS] branches=- | result=type [COLLABORATORS] param type:IClass getClassHolder/0 [CALLS-INTERNAL] Value value(ClassHolder holder, Integer obj); void convert(Value val, IClass type) [CALLS-EXTERNAL] IClass.getClassHolder/0 */ class Value implements...
true
ok
{"focal": {"class": "Value", "name": "getConvert", "signature": "Value getConvert(IClass type)", "start_line": 3, "modifiers": "public", "params": [{"name": "type", "type": "IClass"}], "return_type": "Value"}, "class_info": {"name": "Value", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "IValue", ...
26646135_10
class HexUtilities { public static String encodeToHex(byte[] bytes, boolean uppercase, boolean semicolons) { final char[] lookupTable = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; final int multiplier = semicolons ? 3 : 2; final char[] hexChars = new char[...
assertEquals("4b:6e:61:62", HexUtilities.encodeToHex(new byte[] { 75, 110, 97, 98 }, false, true)); } }
[FOCAL] public static String HexUtilities.encodeToHex(byte[] bytes, boolean uppercase, boolean semicolons) [CLASS] class HexUtilities [METRICS] loc=16 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] new String(hexChars).toUpperCase/1 [NEW] String [PATH1] for(i < bytes.length)=T -> if(i < bytes.len...
/* static context [FOCAL] public static String HexUtilities.encodeToHex(byte[] bytes, boolean uppercase, boolean semicolons) [PATH1] for(i < bytes.length)=T -> if(i < bytes.length - 1)=T -> exit loop -> return uppercase ? new String(hexChars).toUpperCase(Locale.US) : new Strin... [PATH2] for(i < bytes.length)=F -> retu...
/* static context [FOCAL] public static String HexUtilities.encodeToHex(byte[] bytes, boolean uppercase, boolean semicolons) [PATH1] for(i < bytes.length)=T -> if(i < bytes.length - 1)=T -> exit loop -> return uppercase ? new String(hexChars).toUpperCase(Locale.US) : new Strin... [PATH2] for(i < bytes.length)=F -> retu...
true
ok
{"focal": {"class": "HexUtilities", "name": "encodeToHex", "signature": "String encodeToHex(byte[] bytes, boolean uppercase, boolean semicolons)", "start_line": 3, "modifiers": "public static", "params": [{"name": "bytes", "type": "byte[]"}, {"name": "uppercase", "type": "boolean"}, {"name": "semicolons", "type": "bool...
26649305_0
class MinMax { public Pair calculate() { return calculate(new Comparator<T>() { @Override public int compare(T o1, T o2) { return ((Comparable<T>) o1).compareTo(o2); } }); } public MinMax(T[] array); public Pair calculate(Comparator...
MinMax.Pair p1 = new MinMax<>(ARRAY_INT).calculate(); assertEquals(new MinMax<>(null).new Pair(-5, 123), p1); MinMaxStatic.Pair p2 = MinMaxStatic.calculate(ARRAY_INT); assertEquals(new MinMaxStatic.Pair<>(-5, 123), p2); } }
[FOCAL] public Pair MinMax.calculate() [CLASS] class MinMax [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Pair calculate(Comparator<T> cmp) [CALLS-EXTERNAL] ((Comparable<T>) o1).compareTo/1 [NEW] Comparator<T> [CLASS-MEMBERS] MinMax(T[] array); Pair calculate(Comparator<T> cmp) [...
/* static context [FOCAL] public Pair MinMax.calculate() [CALLS-INTERNAL] Pair calculate(Comparator<T> cmp) [NEW] Comparator<T> [CALLS-EXTERNAL] ((Comparable<T>) o1).compareTo/1 */
/* static context [FOCAL] public Pair MinMax.calculate() [CALLS-INTERNAL] Pair calculate(Comparator<T> cmp) [NEW] Comparator<T> [CALLS-EXTERNAL] ((Comparable<T>) o1).compareTo/1 */ class MinMax { public Pair calculate() { return calculate(new Comparator<T>() { @Override public int c...
true
ok
{"focal": {"class": "MinMax", "name": "calculate", "signature": "Pair calculate()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Pair"}, "class_info": {"name": "MinMax", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "ARRAY_INT", "type": "Integer[]...
26653760_4
class GoogleSafeBrowsingUrlVerifier implements UrlVerifier { public final boolean isSafe(String url) { final Map<String, String> formParameters = this.config.getParameters(); formParameters.put(PARAMETER_URL, url); boolean safe = true; try { final ResponseEntity<String> response = client.getFo...
ResponseEntity<String> verifierResult = new ResponseEntity<>("", HttpStatus.NO_CONTENT); given(restTemplate.getForEntity(anyString(), eq(String.class), Matchers.<Map<String, String>>any())).willReturn(verifierResult); boolean isSafe = verifier.isSafe(LONG_URL); assertThat(i...
[FOCAL] public final boolean GoogleSafeBrowsingUrlVerifier.isSafe(String url) [CLASS] class GoogleSafeBrowsingUrlVerifier implements UrlVerifier [METRICS] loc=23 cc=3 branches=1 loops=0 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] this.config.getParameters/0, Map<String, String>.put/2, client.getForEntity/3, config.ge...
/* static context [FOCAL] public final boolean GoogleSafeBrowsingUrlVerifier.isSafe(String url) [PATH1] try-body throws -> return safe [PATH2] if(response.getStatusCode() == HttpStatus.OK)=T -> return safe [PATH3] if(response.getStatusCode() == HttpStatus.OK)=F -> return safe [COLLABORATORS] field config getParameters/...
/* static context [FOCAL] public final boolean GoogleSafeBrowsingUrlVerifier.isSafe(String url) [PATH1] try-body throws -> return safe [PATH2] if(response.getStatusCode() == HttpStatus.OK)=T -> return safe [PATH3] if(response.getStatusCode() == HttpStatus.OK)=F -> return safe [COLLABORATORS] field config getParameters/...
true
ok
{"focal": {"class": "GoogleSafeBrowsingUrlVerifier", "name": "isSafe", "signature": "boolean isSafe(String url)", "start_line": 3, "modifiers": "public final", "params": [{"name": "url", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "GoogleSafeBrowsingUrlVerifier", "kind": "class", "modifiers": ...
26662929_0
class WebSocketResourceProviderFactory extends WebSocketServlet implements WebSocketCreator { @Override public Object createWebSocket(ServletUpgradeRequest request, ServletUpgradeResponse response) { try { Optional<WebSocketAuthenticator> authenticator = Optional.ofNullable(environment.getAuthenticator()...
JerseyEnvironment jerseyEnvironment = mock(JerseyEnvironment.class ); WebSocketEnvironment environment = mock(WebSocketEnvironment.class ); WebSocketAuthenticator authenticator = mock(WebSocketAuthenticator.class); ServletUpgradeRequest request = mock(ServletUpgradeReque...
[FOCAL] @Override public Object WebSocketResourceProviderFactory.createWebSocket(ServletUpgradeRequest request, ServletUpgradeResponse response) [CLASS] class WebSocketResourceProviderFactory extends WebSocketServlet implements WebSocketCreator [METRICS] loc=28 cc=4 branches=2 loops=0 returns=3 throws=0 nesting=3 [CALL...
/* static context [FOCAL] @Override public Object WebSocketResourceProviderFactory.createWebSocket(ServletUpgradeRequest request, ServletUpgradeResponse response) [PATH1] if(authenticator.isPresent())=T -> if(!authenticationResult.getUser().isPresent() && authenticationResult.isRequired())=T -> return null [PATH2] if(a...
/* static context [FOCAL] @Override public Object WebSocketResourceProviderFactory.createWebSocket(ServletUpgradeRequest request, ServletUpgradeResponse response) [PATH1] if(authenticator.isPresent())=T -> if(!authenticationResult.getUser().isPresent() && authenticationResult.isRequired())=T -> return null [PATH2] if(a...
true
ok
{"focal": {"class": "WebSocketResourceProviderFactory", "name": "createWebSocket", "signature": "Object createWebSocket(ServletUpgradeRequest request, ServletUpgradeResponse response)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "ServletUpgradeRequest"}, {"name": "response"...
26669439_0
class ContactEditText extends AppCompatEditText { public ArrayList<Contact> getContacts() { final Editable message = getEditableText(); ImageSpan[] spans = message.getSpans(0, message.length(), ImageSpan.class); Arrays.sort(spans, new Comparator<ImageSpan>() { @Override ...
mEditText.append(ALICE.getDisplayName() + ";"); assertEquals(ALICE, mEditText.getContacts().get(0)); } }
[FOCAL] public ArrayList<Contact> ContactEditText.getContacts() [CLASS] class ContactEditText extends AppCompatEditText [METRICS] loc=17 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] getEditableText/0 (inherited), Editable.getSpans/3, Editable.length/0, Arrays.sort/2, Editable.getSpanStart/1, Im...
/* static context [FOCAL] public ArrayList<Contact> ContactEditText.getContacts() [PATH1] foreach(ImageSpan span : spans)=T -> exit loop -> return contacts [PATH2] foreach(ImageSpan span : spans)=F -> return contacts [NEW] Comparator<ImageSpan>, ArrayList<> [CALLS-EXTERNAL] getEditableText/0 (inherited), Editable.getSp...
/* static context [FOCAL] public ArrayList<Contact> ContactEditText.getContacts() [PATH1] foreach(ImageSpan span : spans)=T -> exit loop -> return contacts [PATH2] foreach(ImageSpan span : spans)=F -> return contacts [NEW] Comparator<ImageSpan>, ArrayList<> [CALLS-EXTERNAL] getEditableText/0 (inherited), Editable.getSp...
true
ok
{"focal": {"class": "ContactEditText", "name": "getContacts", "signature": "ArrayList<Contact> getContacts()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "ArrayList<Contact>"}, "class_info": {"name": "ContactEditText", "kind": "class", "modifiers": "", "superclass": "AppCompatEditText", "inter...