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
30850287_0
class Application { public int countWords(String words) { String[] separateWords = StringUtils.split(words, ' '); return (separateWords == null) ? 0 : separateWords.length; } public Application(); private Application app; } class ApplicationTest { private Application app; ...
int count = app.countWords("this is a test"); assertTrue(count == 4); } }
[FOCAL] public int Application.countWords(String words) [CLASS] class Application [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] StringUtils.split/2 [INPUTS] branches=- | result=words [DATAFLOW] separateWords@L2->L3; words@param->L2 [CLASS-MEMBERS] Application() [TEST] Application...
/* static context [FOCAL] public int Application.countWords(String words) [INPUTS] branches=- | result=words [CALLS-EXTERNAL] StringUtils.split/2 */
/* static context [FOCAL] public int Application.countWords(String words) [INPUTS] branches=- | result=words [CALLS-EXTERNAL] StringUtils.split/2 */ class Application { public int countWords(String words) { String[] separateWords = StringUtils.split(words, ' '); return (separateWords == null) ? 0 :...
true
ok
{"focal": {"class": "Application", "name": "countWords", "signature": "int countWords(String words)", "start_line": 3, "modifiers": "public", "params": [{"name": "words", "type": "String"}], "return_type": "int"}, "class_info": {"name": "Application", "kind": "class", "modifiers": "", "superclass": null, "interfaces": ...
30881048_41
class DataTable extends AbstractDataSource implements MutableDataSource { public int getRowCount() { return rows.size(); } public DataTable(); public DataTable(Class<? extends Comparable<?>>... types); @SuppressWarnings("unchecked") public DataTable(int cols, Class<? extends Comparable<?>> type); public D...
// Constructor with types DataTable table1 = new DataTable(Integer.class, Double.class, Long.class, Float.class); assertEquals(4, table1.getColumnCount()); assertEquals(0, table1.getRowCount()); Class<? extends Comparable<?>>[] types1 = table1.getColumnTypes(); assertEquals(Integer.class, types1[0]); asse...
[FOCAL] public int DataTable.getRowCount() [CLASS] class DataTable extends AbstractDataSource implements MutableDataSource [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] rows.size/0 [COLLABORATORS] field rows size/0 [CLASS-MEMBERS] DataTable(); DataTable(Class<? extends Comparable...
/* static context [FOCAL] public int DataTable.getRowCount() [COLLABORATORS] field rows size/0 [CALLS-EXTERNAL] rows.size/0 */
/* static context [FOCAL] public int DataTable.getRowCount() [COLLABORATORS] field rows size/0 [CALLS-EXTERNAL] rows.size/0 */ class DataTable extends AbstractDataSource implements MutableDataSource { public int getRowCount() { return rows.size(); } public DataTable(); public DataTable(Class<? extends Compara...
true
ok
{"focal": {"class": "DataTable", "name": "getRowCount", "signature": "int getRowCount()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "DataTable", "kind": "class", "modifiers": "", "superclass": "AbstractDataSource", "interfaces": "MutableDataSource", "fields": [{...
30885057_1
class JacksonDeserializer implements Deserializer<T> { @Override public T call(final RawJsonDocument document) { try { final String wrapped = join(START_OBJECT, document.content(), END_OBJECT); final BeanWrapper<T> bean = mapper.reader(reference).readValue(wrapped); return bean.getEntity(); ...
doThrow(new IOException()).when(reader).readValue(anyString()); final ReactiveEntity single = deserializer.call(serializedEntity); assertSame(single, entity); } }
[FOCAL] @Override public T JacksonDeserializer.call(RawJsonDocument document) [CLASS] class JacksonDeserializer implements Deserializer<T> [METRICS] loc=10 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] join/3 (inherited), RawJsonDocument.content/0, mapper.reader(reference).readValue/1, ObjectMap...
/* static context [FOCAL] @Override public T JacksonDeserializer.call(RawJsonDocument document) [THROWS-WHEN] JacksonConversionException when try-body throws [PATH1] try-body throws -> throw new JacksonConversionException("Error while deserializing document ... [PATH2] return bean.getEntity() [INPUTS] branches=- | resu...
/* static context [FOCAL] @Override public T JacksonDeserializer.call(RawJsonDocument document) [THROWS-WHEN] JacksonConversionException when try-body throws [PATH1] try-body throws -> throw new JacksonConversionException("Error while deserializing document ... [PATH2] return bean.getEntity() [INPUTS] branches=- | resu...
true
ok
{"focal": {"class": "JacksonDeserializer", "name": "call", "signature": "T call(RawJsonDocument document)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "document", "type": "RawJsonDocument"}], "return_type": "T"}, "class_info": {"name": "JacksonDeserializer", "kind": "class", "modifiers": "", ...
30921794_0
class Operations { public static List<Operation> getOperations(Class<?> someClass) { try { return operations.get(someClass); } catch (ExecutionException e) { throw new Error(e); } } public static List<Operation> computeOperationsForClass(Class<?> someClass);...
List<Operation> operations = Operations.getOperations(SomeResource.class); assertEquals(operations.size(), 2); for(Operation op : operations) { verifyOperation(op); } } }
[FOCAL] public static List<Operation> Operations.getOperations(Class<?> someClass) [CLASS] class Operations [METRICS] loc=7 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] operations.get/1 [NEW] Error [EXCEPTIONS] throws Error; catches ExecutionException e [THROWS-WHEN] Error when try-body throws ...
/* static context [FOCAL] public static List<Operation> Operations.getOperations(Class<?> someClass) [THROWS-WHEN] Error when try-body throws [PATH1] try-body throws -> throw new Error(e) [PATH2] return operations.get(someClass) [INPUTS] branches=- | result=someClass [COLLABORATORS] field operations get/1 [EXCEPTIONS] ...
/* static context [FOCAL] public static List<Operation> Operations.getOperations(Class<?> someClass) [THROWS-WHEN] Error when try-body throws [PATH1] try-body throws -> throw new Error(e) [PATH2] return operations.get(someClass) [INPUTS] branches=- | result=someClass [COLLABORATORS] field operations get/1 [EXCEPTIONS] ...
true
ok
{"focal": {"class": "Operations", "name": "getOperations", "signature": "List<Operation> getOperations(Class<?> someClass)", "start_line": 3, "modifiers": "public static", "params": [{"name": "someClass", "type": "Class<?>"}], "return_type": "List<Operation>"}, "class_info": {"name": "Operations", "kind": "class", "mod...
30923249_47
class ExecutorQueryService implements Query.Service { @Override public Query prepareQuery( String sqlString, int maxRows, Map<String, String> parameters ) throws KettleException { SQL sql = new SQL( sqlString ); Query query; try { IMetaStore metaStore = metastoreLocator != null ? metastoreLocat...
SQL sql = new SQL( "select field from table" ); ExecutorQueryService executorQueryService = new ExecutorQueryService( dataServiceResolver, metastoreLocator ); Query executorQuery = executorQueryService.prepareQuery( sql.getSqlString(), rowLimit, parameters ); DataOutputStream dataOutputStreamMock = moc...
[FOCAL] @Override public Query ExecutorQueryService.prepareQuery(String sqlString, int maxRows, Map<String, String> parameters) [CLASS] class ExecutorQueryService implements Query.Service [METRICS] loc=18 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] MetastoreLocator.getMetastore/0, resolver.cre...
/* static context [FOCAL] @Override public Query ExecutorQueryService.prepareQuery(String sqlString, int maxRows, Map<String, String> parameters) [THROWS-WHEN] KettleException when try-body throws [PATH1] try-body throws -> throw new KettleException( e ) [PATH2] return query [INPUTS] branches=- | result=maxRows, parame...
/* static context [FOCAL] @Override public Query ExecutorQueryService.prepareQuery(String sqlString, int maxRows, Map<String, String> parameters) [THROWS-WHEN] KettleException when try-body throws [PATH1] try-body throws -> throw new KettleException( e ) [PATH2] return query [INPUTS] branches=- | result=maxRows, parame...
true
ok
{"focal": {"class": "ExecutorQueryService", "name": "prepareQuery", "signature": "Query prepareQuery(String sqlString, int maxRows, Map<String, String> parameters) throws KettleException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "sqlString", "type": "String"}, {"name": "maxRows", "type": "...
30927071_4
class HttpMatchers { public static Matcher<Response> created() { final int statusCode = Response.Status.CREATED.getStatusCode(); return new CustomMatcher<Response>("created status (" + statusCode + ") with location header") { @Override public boolean matches(Object o) { ...
Matcher<Response> created = HttpMatchers.created(); Response response = mock(Response.class); when(response.getHeaderString("Location")).thenReturn("http://something"); when(response.getStatus()).thenReturn(201); assertThat(response, is(created)); } }
[FOCAL] public static Matcher<Response> HttpMatchers.created() [CLASS] class HttpMatchers [METRICS] loc=25 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] void provideDescription(Response response, Description description) [CALLS-EXTERNAL] Response.Status.CREATED.getStatusCode/0, Response.getStatu...
/* static context [FOCAL] public static Matcher<Response> HttpMatchers.created() [CALLS-INTERNAL] void provideDescription(Response response, Description description) [NEW] CustomMatcher<Response> [CALLS-EXTERNAL] Response.Status.CREATED.getStatusCode/0, Response.getStatus/0, Response.getHeaderString/1 */
/* static context [FOCAL] public static Matcher<Response> HttpMatchers.created() [CALLS-INTERNAL] void provideDescription(Response response, Description description) [NEW] CustomMatcher<Response> [CALLS-EXTERNAL] Response.Status.CREATED.getStatusCode/0, Response.getStatus/0, Response.getHeaderString/1 */ class HttpMatc...
true
ok
{"focal": {"class": "HttpMatchers", "name": "created", "signature": "Matcher<Response> created()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Matcher<Response>"}, "class_info": {"name": "HttpMatchers", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": ...
30947668_11
class MultipleBuildsFeatureMergeHelper { public MergeFeature getMergeFeature(final String featureId) { if (!this.orderedBuildList.isEmpty() && this.features.containsKey(featureId, getLatestBuild())) { final Feature feature = this.features.get(featureId, getLatestBuild()); final List<String> featureStatuses =...
final Feature feature = new Feature(BasicDBObject .parse("{'_id' : 'p1/f1','id' : 'f1','description' : '' ,'name' : 'f1', 'elements' : [{'id' : 'e1','description' : '','name' : 'e1','steps' : [{'result' : {'status' : 'passed'},'name' : 'e2',},{'result' : {'status' : 'passed'},'name' : 'e3',}],}],'coordinates' : {...
[FOCAL] public MergeFeature MultipleBuildsFeatureMergeHelper.getMergeFeature(String featureId) [CLASS] class MultipleBuildsFeatureMergeHelper [METRICS] loc=21 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] List<MergeScenario> getMergedScenarios(Feature feature); List<String> getFeatureStatuses(Fe...
/* static context [FOCAL] public MergeFeature MultipleBuildsFeatureMergeHelper.getMergeFeature(String featureId) [PATH1] if(!this.orderedBuildList.isEmpty() && this.features.containsKey(featureId, getLatestBuild()))=T -> return mergeFeature [PATH2] if(!this.orderedBuildList.isEmpty() && this.features.containsKey(featur...
/* static context [FOCAL] public MergeFeature MultipleBuildsFeatureMergeHelper.getMergeFeature(String featureId) [PATH1] if(!this.orderedBuildList.isEmpty() && this.features.containsKey(featureId, getLatestBuild()))=T -> return mergeFeature [PATH2] if(!this.orderedBuildList.isEmpty() && this.features.containsKey(featur...
true
ok
{"focal": {"class": "MultipleBuildsFeatureMergeHelper", "name": "getMergeFeature", "signature": "MergeFeature getMergeFeature(String featureId)", "start_line": 3, "modifiers": "public", "params": [{"name": "featureId", "type": "String"}], "return_type": "MergeFeature"}, "class_info": {"name": "MultipleBuildsFeatureMerg...
30950312_0
class ClientChannelFactory implements AutoCloseable { public ListenableFuture<RpcChannel> createChannel(String server, int port) { Bootstrap b = new Bootstrap(); b.group(group) .channel(NioSocketChannel.class) .handler(init); // Make a new connection. final ChannelFuture channel = b....
RequestManager requestManager = Mockito.mock(RequestManager.class); MessageMapper mapper = Mockito.mock(MessageMapper.class); ClientChannelInitializer channelInitializer = new ClientChannelInitializer(mapper, requestManager); ClientChannelFactory factory = new ClientChannelFactory(new ...
[FOCAL] public ListenableFuture<RpcChannel> ClientChannelFactory.createChannel(String server, int port) [CLASS] class ClientChannelFactory implements AutoCloseable [METRICS] loc=31 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] b.group(group) .channel(NioSocketChannel.class).handler/1, b.group(gr...
/* static context [FOCAL] public ListenableFuture<RpcChannel> ClientChannelFactory.createChannel(String server, int port) [COLLABORATORS] field future isSuccess/0,cause/0; field channels add/1 [NEW] Bootstrap, ExposedListenableFuture<>, GenericFutureListener<Future<Void>>, RpcChannel [CALLS-EXTERNAL] b.group(group) .ch...
/* static context [FOCAL] public ListenableFuture<RpcChannel> ClientChannelFactory.createChannel(String server, int port) [COLLABORATORS] field future isSuccess/0,cause/0; field channels add/1 [NEW] Bootstrap, ExposedListenableFuture<>, GenericFutureListener<Future<Void>>, RpcChannel [CALLS-EXTERNAL] b.group(group) .ch...
true
ok
{"focal": {"class": "ClientChannelFactory", "name": "createChannel", "signature": "ListenableFuture<RpcChannel> createChannel(String server, int port)", "start_line": 3, "modifiers": "public", "params": [{"name": "server", "type": "String"}, {"name": "port", "type": "int"}], "return_type": "ListenableFuture<RpcChannel>...
30956727_0
class HeartBeat extends FeedMessage { public Long getLast_trade_id() { return last_trade_id; } public HeartBeat(); public HeartBeat(Long last_trade_id); public void setLast_trade_id(Long last_trade_id); } class HeartBeatTest { @Test void shouldDeserialiseHeartbeatMessageSucce...
ObjectMapper objectMapper = new ObjectMapper(); objectMapper.registerModule(new JavaTimeModule()); String json = "{" + " \"type\": \"heartbeat\", " + " \"sequence\": 90, " + " \"last_trade_id\": 20," + ...
[FOCAL] public Long HeartBeat.getLast_trade_id() [CLASS] class HeartBeat extends FeedMessage [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] HeartBeat(); HeartBeat(Long last_trade_id); void setLast_trade_id(Long last_trade_id) [TEST] HeartBeatTest: @Test void shouldDeserialiseHeartb...
/* static context [FOCAL] public Long HeartBeat.getLast_trade_id() */
/* static context [FOCAL] public Long HeartBeat.getLast_trade_id() */ class HeartBeat extends FeedMessage { public Long getLast_trade_id() { return last_trade_id; } public HeartBeat(); public HeartBeat(Long last_trade_id); public void setLast_trade_id(Long last_trade_id); } class Hear...
true
ok
{"focal": {"class": "HeartBeat", "name": "getLast_trade_id", "signature": "Long getLast_trade_id()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Long"}, "class_info": {"name": "HeartBeat", "kind": "class", "modifiers": "", "superclass": "FeedMessage", "interfaces": null, "fields": [], "members...
30956940_90
class WorkflowBundleIO { public void setWriters(List<WorkflowBundleWriter> writers) { this.writers = writers; } protected List<WorkflowBundleReader> discoverReaders(); protected List<WorkflowBundleWriter> discoverWriters(); public WorkflowBundleReader getReaderForMediaType(String mediaType); public List<Workf...
WorkflowBundleWriter myWriter = new WorkflowBundleWriter() { @Override public Set<String> getMediaTypes() { return Collections.singleton("application/vnd.example.myOwn"); } @Override public void writeBundle(WorkflowBundle wfBundle, File destination, String mediaType) { } @Override pub...
[FOCAL] public void WorkflowBundleIO.setWriters(List<WorkflowBundleWriter> writers) [CLASS] class WorkflowBundleIO [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [FIELDS] write=writers [STATE] writers via getWriters() [DATAFLOW] writers@param->L2 [CLASS-MEMBERS] List<WorkflowBundleReader> discover...
/* static context [FOCAL] public void WorkflowBundleIO.setWriters(List<WorkflowBundleWriter> writers) [STATE] writers via getWriters() [FIELDS] write=writers */
/* static context [FOCAL] public void WorkflowBundleIO.setWriters(List<WorkflowBundleWriter> writers) [STATE] writers via getWriters() [FIELDS] write=writers */ class WorkflowBundleIO { public void setWriters(List<WorkflowBundleWriter> writers) { this.writers = writers; } protected List<WorkflowBundleReader> dis...
true
ok
{"focal": {"class": "WorkflowBundleIO", "name": "setWriters", "signature": "void setWriters(List<WorkflowBundleWriter> writers)", "start_line": 3, "modifiers": "public", "params": [{"name": "writers", "type": "List<WorkflowBundleWriter>"}], "return_type": "void"}, "class_info": {"name": "WorkflowBundleIO", "kind": "cla...
30957532_1
class CodePoolUtils { public static byte[] createCodePoolDataFromClass(Class klass) throws IOException { String res = '/' + klass.getName().replace('.', '/') + ".class"; URL location = klass.getResource(res); System.out.println("createCodePoolDataFromClass " + klass + " -> " + location); ...
byte[] zip = CodePoolUtils.createCodePoolDataFromClass(SimpleExecutor.class); Set<String> entries = new HashSet<>(); try (ZipInputStream in = new ZipInputStream(new ByteArrayInputStream(zip));) { ZipEntry nextEntry; while ((nextEntry = in.getNextEntry()) != null) { ...
[FOCAL] public static byte[] CodePoolUtils.createCodePoolDataFromClass(Class klass) [CLASS] class CodePoolUtils [METRICS] loc=37 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] void addFileToZip(int skipprefix, File file, ZipOutputStream zipper); void copyStream(InputStream input, OutputStream out...
/* static context [FOCAL] public static byte[] CodePoolUtils.createCodePoolDataFromClass(Class klass) [PATH1] if(slocation.startsWith("jar:file:"))=F -> if(slocation.startsWith("file:/"))=T -> return resb [PATH2] if(slocation.startsWith("jar:file:"))=T -> return resb [PATH3] if(slocation.startsWith("jar:file:"))=F -> i...
/* static context [FOCAL] public static byte[] CodePoolUtils.createCodePoolDataFromClass(Class klass) [PATH1] if(slocation.startsWith("jar:file:"))=F -> if(slocation.startsWith("file:/"))=T -> return resb [PATH2] if(slocation.startsWith("jar:file:"))=T -> return resb [PATH3] if(slocation.startsWith("jar:file:"))=F -> i...
true
ok
{"focal": {"class": "CodePoolUtils", "name": "createCodePoolDataFromClass", "signature": "byte[] createCodePoolDataFromClass(Class klass) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "klass", "type": "Class"}], "return_type": "byte[]"}, "class_info": {"name": "CodePoolUtils", ...
30977962_5
class WebAirMapViewBuilder implements AirMapViewBuilder<WebViewMapFragment, AirMapType> { @Override public WebViewMapFragment build() { if (options == null) { options = new GoogleWebMapType(); } if (options instanceof GoogleWebMapType) { return GoogleWebViewMapFragment.newInstance(options); ...
WebAirMapViewBuilder factory = new WebAirMapViewBuilder(); assertThat(factory.build(), instanceOf(GoogleWebViewMapFragment.class)); } }
[FOCAL] @Override public WebViewMapFragment WebAirMapViewBuilder.build() [CLASS] class WebAirMapViewBuilder implements AirMapViewBuilder<WebViewMapFragment, AirMapType> [METRICS] loc=15 cc=5 branches=4 loops=0 returns=4 throws=0 nesting=1 [CALLS-EXTERNAL] GoogleWebViewMapFragment.newInstance/1, GoogleChinaWebViewMapFra...
/* static context [FOCAL] @Override public WebViewMapFragment WebAirMapViewBuilder.build() [PATH1] if(options == null)=T -> if(options instanceof GoogleWebMapType)=F -> if(options instanceof GoogleChinaMapType)=F -> if(options instanceof LeafletMapType)=T -> return LeafletWebViewMapFragment.newInstance(options) [PATH2]...
/* static context [FOCAL] @Override public WebViewMapFragment WebAirMapViewBuilder.build() [PATH1] if(options == null)=T -> if(options instanceof GoogleWebMapType)=F -> if(options instanceof GoogleChinaMapType)=F -> if(options instanceof LeafletMapType)=T -> return LeafletWebViewMapFragment.newInstance(options) [PATH2]...
true
ok
{"focal": {"class": "WebAirMapViewBuilder", "name": "build", "signature": "WebViewMapFragment build()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "WebViewMapFragment"}, "class_info": {"name": "WebAirMapViewBuilder", "kind": "class", "modifiers": "", "superclass": null, "interfaces":...
31106547_52
class TwilioNotificationService implements NotificationService { @Override public void sendNotification(Check check, Subscription subscription, List<Alert> alerts) throws NotificationFailedException { String twilioUrl = StringUtils.trimToNull(seyrenConfig.getTwilioUrl()); if (twilioUrl ...
String seyrenUrl = clientDriver.getBaseUrl() + "/seyren"; when(mockSeyrenConfig.getTwilioUrl()).thenReturn(clientDriver.getBaseUrl() + "/twilio"); when(mockSeyrenConfig.getTwilioAccountSid()).thenReturn(ACCOUNT_SID); when(mockSeyrenConfig.getTwilioAuthToken()).thenReturn("5678")...
[FOCAL] @Override public void TwilioNotificationService.sendNotification(Check check, Subscription subscription, List<Alert> alerts) [CLASS] class TwilioNotificationService implements NotificationService [METRICS] loc=43 cc=6 branches=4 loops=0 returns=1 throws=2 nesting=2 [CALLS-EXTERNAL] StringUtils.trimToNull/1, sey...
/* static context [FOCAL] @Override public void TwilioNotificationService.sendNotification(Check check, Subscription subscription, List<Alert> alerts) [THROWS-WHEN] NotificationFailedException when !(twilioUrl == null) && check.getState() == AlertType.ERROR && try-body throws [THROWS-WHEN] NotificationFailedException w...
/* static context [FOCAL] @Override public void TwilioNotificationService.sendNotification(Check check, Subscription subscription, List<Alert> alerts) [THROWS-WHEN] NotificationFailedException when !(twilioUrl == null) && check.getState() == AlertType.ERROR && try-body throws [THROWS-WHEN] NotificationFailedException w...
true
ok
{"focal": {"class": "TwilioNotificationService", "name": "sendNotification", "signature": "void sendNotification(Check check, Subscription subscription, List<Alert> alerts) throws NotificationFailedException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "check", "type": "Check"}, {"name": "sub...
31117630_222
class AnnotatedFieldIdPropertyResolver implements IdPropertyResolver { @Override public String resolve(final Class<?> entityType, Class<?> idType) { final AtomicReference<Field> found = new AtomicReference<>(); //try to find the ID field ReflectionUtils.doWithFields(entityType, field ->...
final String property = getIdPropertyResolver().resolve(EntityWithAnnotatedIdFieldFromJPA.class, Long.class); assertThat(property, is(notNullValue())); assertThat(property, is("customIdProperty")); } }
[FOCAL] @Override public String AnnotatedFieldIdPropertyResolver.resolve(Class<?> entityType, Class<?> idType) [CLASS] class AnnotatedFieldIdPropertyResolver implements IdPropertyResolver [METRICS] loc=26 cc=3 branches=2 loops=0 returns=2 throws=1 nesting=2 [CALLS-EXTERNAL] ReflectionUtils.doWithFields/2, isAnnotated/1...
/* static context [FOCAL] @Override public String AnnotatedFieldIdPropertyResolver.resolve(Class<?> entityType, Class<?> idType) [THROWS-WHEN] PropertyTypeMismatchException when idAnnotatedField != null && !PropertyUtils.getTypeOf(idType).isAssignableFrom( PropertyUtils.getTypeOf(idAnnotatedField.getType())) [PATH1] if...
/* static context [FOCAL] @Override public String AnnotatedFieldIdPropertyResolver.resolve(Class<?> entityType, Class<?> idType) [THROWS-WHEN] PropertyTypeMismatchException when idAnnotatedField != null && !PropertyUtils.getTypeOf(idType).isAssignableFrom( PropertyUtils.getTypeOf(idAnnotatedField.getType())) [PATH1] if...
true
ok
{"focal": {"class": "AnnotatedFieldIdPropertyResolver", "name": "resolve", "signature": "String resolve(Class<?> entityType, Class<?> idType)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "entityType", "type": "Class<?>"}, {"name": "idType", "type": "Class<?>"}], "return_type": "String"}, "cla...
31142024_0
class LogglyTree extends Timber.Tree { public void tag(String tag) { loggly.setTags(tag); } public LogglyTree(String token); LogglyTree(ILogglyClient client, ILogglyClient.Callback handler, IFormatter formatter); @Override protected void log(int priority, String tag, String message, Th...
final String tag = "foo"; tree.tag(tag); verify(client).setTags(tag); } }
[FOCAL] public void LogglyTree.tag(String tag) [CLASS] class LogglyTree extends Timber.Tree [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] loggly.setTags/1 [COLLABORATORS] field loggly setTags/1 [DATAFLOW] tag@param->L2 [CLASS-MEMBERS] LogglyTree(String token); LogglyTree(ILogglyC...
/* static context [FOCAL] public void LogglyTree.tag(String tag) [COLLABORATORS] field loggly setTags/1 [CALLS-EXTERNAL] loggly.setTags/1 */
/* static context [FOCAL] public void LogglyTree.tag(String tag) [COLLABORATORS] field loggly setTags/1 [CALLS-EXTERNAL] loggly.setTags/1 */ class LogglyTree extends Timber.Tree { public void tag(String tag) { loggly.setTags(tag); } public LogglyTree(String token); LogglyTree(ILogglyClient ...
true
ok
{"focal": {"class": "LogglyTree", "name": "tag", "signature": "void tag(String tag)", "start_line": 3, "modifiers": "public", "params": [{"name": "tag", "type": "String"}], "return_type": "void"}, "class_info": {"name": "LogglyTree", "kind": "class", "modifiers": "", "superclass": "Timber.Tree", "interfaces": null, "fi...
31202652_8
class FileTypeDetectionAlgorithm { public static @Nullable FileType detectDataFileType(@Nonnull File fileName) throws IOException { // Parameter check Preconditions.checkNotNull(fileName); if (fileName.isDirectory()) { // To check for Waters .raw directory, we look for _FUNC[0-9]{3}.DAT for...
File fileName = new File(TEST_DATA_PATH + "A1-0_A2.mzXML"); FileType fileType = FileTypeDetectionAlgorithm.detectDataFileType(fileName); Assert.assertEquals(FileType.MZXML, fileType); } }
[FOCAL] public static @Nullable FileType FileTypeDetectionAlgorithm.detectDataFileType(File fileName) [CLASS] class FileTypeDetectionAlgorithm [METRICS] loc=48 cc=11 branches=9 loops=1 returns=10 throws=0 nesting=3 [CALLS-EXTERNAL] Preconditions.checkNotNull/1, File.isDirectory/0, File.listFiles/0, File.isFile/0, f.get...
/* static context [FOCAL] public static @Nullable FileType FileTypeDetectionAlgorithm.detectDataFileType(File fileName) [PATH1] if(fileName.isDirectory())=F -> if(fileHeader.startsWith(THERMO_HEADER))=F -> if(fileHeader.startsWith(CDF_HEADER))=F -> if(fileHeader.contains(MZML_HEADER))=F -> if(fileHeader.contains(MZDATA...
/* static context [FOCAL] public static @Nullable FileType FileTypeDetectionAlgorithm.detectDataFileType(File fileName) [PATH1] if(fileName.isDirectory())=F -> if(fileHeader.startsWith(THERMO_HEADER))=F -> if(fileHeader.startsWith(CDF_HEADER))=F -> if(fileHeader.contains(MZML_HEADER))=F -> if(fileHeader.contains(MZDATA...
true
ok
{"focal": {"class": "FileTypeDetectionAlgorithm", "name": "detectDataFileType", "signature": "FileType detectDataFileType(File fileName) throws IOException", "start_line": 3, "modifiers": "public static @Nullable", "params": [{"name": "fileName", "type": "File"}], "return_type": "FileType"}, "class_info": {"name": "Fil...
31214867_26
class ImportExportService { public boolean importRepository(String json){ ObjectMapper mapper = new ObjectMapper(); ImportExportModel model = null; try{ model = mapper.readValue(json, ImportExportModel.class); } catch (Exception e){ log.error("Exception while reading json i...
// Setup and export result. String json = "{\"services\":[{\"name\":\"Imp1\",\"version\":\"1.2\",\"xmlNS\":null,\"type\":null,\"operations\":[],\"id\":25638445759706201468670970602}," + "{\"name\":\"Imp2\",\"version\":\"1.1\",\"xmlNS\":null,\"type\":null,\"operations\":[],\"id\":2563844575970620...
[FOCAL] public boolean ImportExportService.importRepository(String json) [CLASS] class ImportExportService [METRICS] loc=25 cc=4 branches=2 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] ObjectMapper.readValue/2, log.error/2, log.isInfoEnabled/0, log.info/1, model.getServices().size/0, ImportExportModel.getServi...
/* static context [FOCAL] public boolean ImportExportService.importRepository(String json) [PATH1] try-body throws -> if(log.isInfoEnabled())=T -> if(model != null)=T -> return true [PATH2] if(log.isInfoEnabled())=F -> if(model != null)=F -> return false [INPUTS] branches=json | result=- [COLLABORATORS] field serviceRe...
/* static context [FOCAL] public boolean ImportExportService.importRepository(String json) [PATH1] try-body throws -> if(log.isInfoEnabled())=T -> if(model != null)=T -> return true [PATH2] if(log.isInfoEnabled())=F -> if(model != null)=F -> return false [INPUTS] branches=json | result=- [COLLABORATORS] field serviceRe...
true
ok
{"focal": {"class": "ImportExportService", "name": "importRepository", "signature": "boolean importRepository(String json)", "start_line": 3, "modifiers": "public", "params": [{"name": "json", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "ImportExportService", "kind": "class", "modifiers": "", ...
31231846_6
class HealthCheck implements HealthStatusChecker { @PostConstruct public void register() { errorBus.register(this); ErrorBus.setErrorBus(errorBus); } @Autowired public HealthCheck(HealthChecker healthChecker, @Value("${health.check.error.list.size:25}") int maxSize, @Value...
check.register(); verify(eventBus).register(check); } }
[FOCAL] @PostConstruct public void HealthCheck.register() [CLASS] class HealthCheck implements HealthStatusChecker [METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] errorBus.register/1, ErrorBus.setErrorBus/1 [COLLABORATORS] field errorBus register/1 [CLASS-MEMBERS] void setMaxSize(i...
/* static context [FOCAL] @PostConstruct public void HealthCheck.register() [COLLABORATORS] field errorBus register/1 [CALLS-EXTERNAL] errorBus.register/1, ErrorBus.setErrorBus/1 */
/* static context [FOCAL] @PostConstruct public void HealthCheck.register() [COLLABORATORS] field errorBus register/1 [CALLS-EXTERNAL] errorBus.register/1, ErrorBus.setErrorBus/1 */ class HealthCheck implements HealthStatusChecker { @PostConstruct public void register() { errorBus.register(this); ...
true
ok
{"focal": {"class": "HealthCheck", "name": "register", "signature": "void register()", "start_line": 3, "modifiers": "@PostConstruct public", "params": [], "return_type": "void"}, "class_info": {"name": "HealthCheck", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "HealthStatusChecker", "fields": [...
31282010_1
class CreateTaskInteractor implements Interactor { public void createTask(String name, String description, Boolean urgent, Callback<Task> callback, ErrorCallback errorCallback) { this.name = name; this.description = description; this.urgent = urgent; this.callback = callback; ...
when(taskListRepository.getAll()).thenReturn(taskLists()); InOrder order = inOrder(taskRepository, taskListRepository); interactor.createTask(NAME_STUB, DESCRIPTION_STUB, URGENT_STUB, callback, errorCallback); order.verify(taskListRepository).getAll(); order.verify(taskReposito...
[FOCAL] public void CreateTaskInteractor.createTask(String name, String description, Boolean urgent, Callback<Task> callback, ErrorCallback errorCallback) [CLASS] class CreateTaskInteractor implements Interactor [METRICS] loc=8 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] interactorHandler.exec...
/* static context [FOCAL] public void CreateTaskInteractor.createTask(String name, String description, Boolean urgent, Callback<Task> callback, ErrorCallback errorCallback) [COLLABORATORS] field interactorHandler execute/1 [STATE] callback, description, errorCallback, name, urgent [FIELDS] write=callback, description, ...
/* static context [FOCAL] public void CreateTaskInteractor.createTask(String name, String description, Boolean urgent, Callback<Task> callback, ErrorCallback errorCallback) [COLLABORATORS] field interactorHandler execute/1 [STATE] callback, description, errorCallback, name, urgent [FIELDS] write=callback, description, ...
true
ok
{"focal": {"class": "CreateTaskInteractor", "name": "createTask", "signature": "void createTask(String name, String description, Boolean urgent, Callback<Task> callback, ErrorCallback errorCallback)", "start_line": 3, "modifiers": "public", "params": [{"name": "name", "type": "String"}, {"name": "description", "type": ...
31306104_55
class BaseDexBuffer { public int readUbyte(int offset) { return buf[offset + baseOffset] & 0xff; } public BaseDexBuffer(@Nonnull byte[] buf); public BaseDexBuffer(@Nonnull byte[] buf, int offset); public int readSmallUint(int offset); public int readOptionalUint(int offset); pub...
byte[] buf = new byte[1]; BaseDexBuffer dexBuf = new BaseDexBuffer(buf); for (int i=0; i<=0xff; i++) { buf[0] = (byte)i; Assert.assertEquals(i, dexBuf.readUbyte(0)); } } }
[FOCAL] public int BaseDexBuffer.readUbyte(int offset) [CLASS] class BaseDexBuffer [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [INPUTS] branches=- | result=offset [DATAFLOW] offset@param->L2 [CLASS-MEMBERS] BaseDexBuffer(byte[] buf); BaseDexBuffer(byte[] buf, int offset); int readSmallUint(int ...
/* static context [FOCAL] public int BaseDexBuffer.readUbyte(int offset) [INPUTS] branches=- | result=offset */
/* static context [FOCAL] public int BaseDexBuffer.readUbyte(int offset) [INPUTS] branches=- | result=offset */ class BaseDexBuffer { public int readUbyte(int offset) { return buf[offset + baseOffset] & 0xff; } public BaseDexBuffer(@Nonnull byte[] buf); public BaseDexBuffer(@Nonnull byte[] b...
true
ok
{"focal": {"class": "BaseDexBuffer", "name": "readUbyte", "signature": "int readUbyte(int offset)", "start_line": 3, "modifiers": "public", "params": [{"name": "offset", "type": "int"}], "return_type": "int"}, "class_info": {"name": "BaseDexBuffer", "kind": "class", "modifiers": "", "superclass": null, "interfaces": nu...
31322089_1
class TracingFilter implements Filter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (request instanceof HttpServletRequest) { HttpServletRequest req = (HttpServletRequest) request; doFilterHttp(r...
// given when(httpRequest.getHeader(eq(TracingFilter.RATEL_HEADER_PROCESS_ID))).thenReturn("123"); assertThat(ProcessContext.getInstance().getProcessIdentifier()).isNull(); // when filter.doFilter(httpRequest, httpResponse, chainStub); // then assertThat(ProcessContext.getInstance().getP...
[FOCAL] @Override public void TracingFilter.doFilter(ServletRequest request, ServletResponse response, FilterChain chain) [CLASS] class TracingFilter implements Filter [METRICS] loc=11 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] void doFilterHttp(HttpServletRequest request, ServletResponse res...
/* static context [FOCAL] @Override public void TracingFilter.doFilter(ServletRequest request, ServletResponse response, FilterChain chain) [PATH1] if(request instanceof HttpServletRequest)=T [PATH2] if(request instanceof HttpServletRequest)=F [INPUTS] branches=request | result=- [COLLABORATORS] param chain:FilterChain...
/* static context [FOCAL] @Override public void TracingFilter.doFilter(ServletRequest request, ServletResponse response, FilterChain chain) [PATH1] if(request instanceof HttpServletRequest)=T [PATH2] if(request instanceof HttpServletRequest)=F [INPUTS] branches=request | result=- [COLLABORATORS] param chain:FilterChain...
true
ok
{"focal": {"class": "TracingFilter", "name": "doFilter", "signature": "void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "ServletRequest"}, {"name": "response"...
31323673_64
class GroupedLeaveOneOut implements CrossValidator<GroupedDataset<KEY, ListDataset<INSTANCE>, INSTANCE>> { @Override public CrossValidationIterable<GroupedDataset<KEY, ListDataset<INSTANCE>, INSTANCE>> createIterable( GroupedDataset<KEY, ListDataset<INSTANCE>, INSTANCE> data) { return new GroupedLeaveOneOutI...
final GroupedLeaveOneOut<String, Integer> cv = new GroupedLeaveOneOut<String, Integer>(); final CrossValidationIterable<GroupedDataset<String, ListDataset<Integer>, Integer>> iterable = cv .createIterable(equalDataset); for (final ValidationData<GroupedDataset<String, ListDataset<Integer>, Integer>> cvData :...
[FOCAL] @Override public CrossValidationIterable<GroupedDataset<KEY, ListDataset<INSTANCE>, INSTANCE>> GroupedLeaveOneOut.createIterable(GroupedDataset<KEY, ListDataset<INSTANCE>, INSTANCE> data) [CLASS] class GroupedLeaveOneOut implements CrossValidator<GroupedDataset<KEY, ListDataset<INSTANCE>, INSTANCE>> [METRICS] l...
/* static context [FOCAL] @Override public CrossValidationIterable<GroupedDataset<KEY, ListDataset<INSTANCE>, INSTANCE>> GroupedLeaveOneOut.createIterable(GroupedDataset<KEY, ListDataset<INSTANCE>, INSTANCE> data) [INPUTS] branches=- | result=data [NEW] GroupedLeaveOneOutIterable */
/* static context [FOCAL] @Override public CrossValidationIterable<GroupedDataset<KEY, ListDataset<INSTANCE>, INSTANCE>> GroupedLeaveOneOut.createIterable(GroupedDataset<KEY, ListDataset<INSTANCE>, INSTANCE> data) [INPUTS] branches=- | result=data [NEW] GroupedLeaveOneOutIterable */ class GroupedLeaveOneOut implements ...
true
ok
{"focal": {"class": "GroupedLeaveOneOut", "name": "createIterable", "signature": "CrossValidationIterable<GroupedDataset<KEY, ListDataset<INSTANCE>, INSTANCE>> createIterable(GroupedDataset<KEY, ListDataset<INSTANCE>, INSTANCE> data)", "start_line": 4, "modifiers": "@Override public", "params": [{"name": "data", "type"...
31334576_2
class CardFile { public LearnStatusSerializer getSerializer() { return serializer; } public CardFile(File cardFileLocation); public static SlideShow getSlideShow(CardFile cardFile); public Collection<Category> belongsTo(); public boolean addToCategory(Category c); public boolean ...
LearnStatusSerializer serializer = CardFileBackend.getBackend().getSerializer(); try { CardFile cardFile = new CardFile(new File("testdata/import/flashcards_ansi.txt")); serializer.readFlashcardsFromFile(cardFile); Assert.fail(); } catch (InvalidCardFileForm...
[FOCAL] public LearnStatusSerializer CardFile.getSerializer() [CLASS] class CardFile [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] CardFile(File cardFileLocation); SlideShow getSlideShow(CardFile cardFile); Collection<Category> belongsTo(); boolean addToCategory(Category c); boole...
/* static context [FOCAL] public LearnStatusSerializer CardFile.getSerializer() */
/* static context [FOCAL] public LearnStatusSerializer CardFile.getSerializer() */ class CardFile { public LearnStatusSerializer getSerializer() { return serializer; } public CardFile(File cardFileLocation); public static SlideShow getSlideShow(CardFile cardFile); public Collection<Categ...
true
ok
{"focal": {"class": "CardFile", "name": "getSerializer", "signature": "LearnStatusSerializer getSerializer()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "LearnStatusSerializer"}, "class_info": {"name": "CardFile", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fiel...
31334852_8
class LogViewEndpoint implements MvcEndpoint { @RequestMapping("/") @ResponseBody public String list(Model model, // TODO model should no longer be injected @RequestParam(required = false, defaultValue = "FILENAME") SortBy sortBy, @RequestParam(required = false...
// given createFile("A.log", "x", now); // when logViewEndpoint.list(model, SortBy.FILENAME, false, null); // then assertThat(getFileEntries().get(0).getFileType(), is(FileType.FILE)); } }
[FOCAL] @RequestMapping("/") @ResponseBody public String LogViewEndpoint.list(Model model, SortBy sortBy, boolean desc, String base) [CLASS] class LogViewEndpoint implements MvcEndpoint [METRICS] loc=23 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] FileProvider getFileProvider(Path folder); List...
/* static context [FOCAL] @RequestMapping("/") @ResponseBody public String LogViewEndpoint.list(Model model, SortBy sortBy, boolean desc, String base) [INPUTS] branches=- | result=model [COLLABORATORS] param model:Model addAttribute/2; field freemarkerConfig getTemplate/1 [EXCEPTIONS] declares IOException, TemplateExce...
/* static context [FOCAL] @RequestMapping("/") @ResponseBody public String LogViewEndpoint.list(Model model, SortBy sortBy, boolean desc, String base) [INPUTS] branches=- | result=model [COLLABORATORS] param model:Model addAttribute/2; field freemarkerConfig getTemplate/1 [EXCEPTIONS] declares IOException, TemplateExce...
true
ok
{"focal": {"class": "LogViewEndpoint", "name": "list", "signature": "String list(Model model, SortBy sortBy, boolean desc, String base) throws IOException, TemplateException", "start_line": 3, "modifiers": "@RequestMapping(\"/\") @ResponseBody public", "params": [{"name": "model", "type": "Model"}, {"name": "sortBy", "...
31344294_0
class JaxbUtil { public static <T> JAXBContext createContextIfNull(Class<T> clazz, JAXBContext context) { if (context != null) return context; try { return JAXBContext.newInstance(clazz.getPackage().getName()); } catch (JAXBException e) { LOG.error("Failed to create JaxbContext for {}", clazz.g...
JAXBContext context = null; context = JaxbUtil.createContextIfNull(Resources.class, context); assertNotNull(context); } }
[FOCAL] public static JAXBContext JaxbUtil.createContextIfNull(Class<T> clazz, JAXBContext context) [CLASS] class JaxbUtil [METRICS] loc=16 cc=3 branches=1 loops=0 returns=3 throws=0 nesting=1 [CALLS-EXTERNAL] JAXBContext.newInstance/1, clazz.getPackage().getName/0, Class<T>.getPackage/0, LOG.error/3 [EXCEPTIONS] catch...
/* static context [FOCAL] public static JAXBContext JaxbUtil.createContextIfNull(Class<T> clazz, JAXBContext context) [PATH1] if(context != null)=F -> try-body throws -> return null [PATH2] if(context != null)=T -> return context [PATH3] if(context != null)=F -> return JAXBContext.newInstance(clazz.getPackage().getName...
/* static context [FOCAL] public static JAXBContext JaxbUtil.createContextIfNull(Class<T> clazz, JAXBContext context) [PATH1] if(context != null)=F -> try-body throws -> return null [PATH2] if(context != null)=T -> return context [PATH3] if(context != null)=F -> return JAXBContext.newInstance(clazz.getPackage().getName...
true
ok
{"focal": {"class": "JaxbUtil", "name": "createContextIfNull", "signature": "JAXBContext createContextIfNull(Class<T> clazz, JAXBContext context)", "start_line": 3, "modifiers": "public static", "params": [{"name": "clazz", "type": "Class<T>"}, {"name": "context", "type": "JAXBContext"}], "return_type": "JAXBContext"},...
31356321_1
class _ { public static String getQnameParent(@Nullable String qname) { if (qname == null || qname.isEmpty()) { return ""; } int index = qname.lastIndexOf("."); if (index == -1) { return ""; } return qname.substring(0, index); } publi...
Assert.assertEquals("", _.getQnameParent(null)); Assert.assertEquals("", _.getQnameParent("")); Assert.assertEquals("", _.getQnameParent("1234")); Assert.assertEquals( "...............", _.getQnameParent("................?????????????")); } }
[FOCAL] public static String _.getQnameParent(String qname) [CLASS] class _ [METRICS] loc=10 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1 [CALLS-EXTERNAL] String.isEmpty/0, String.lastIndexOf/1, String.substring/2 [PATH1] if(qname == null || qname.isEmpty())=F -> if(index == -1)=T -> return "" [PATH2] if(qname ...
/* static context [FOCAL] public static String _.getQnameParent(String qname) [PATH1] if(qname == null || qname.isEmpty())=F -> if(index == -1)=T -> return "" [PATH2] if(qname == null || qname.isEmpty())=F -> if(index == -1)=F -> return qname.substring(0, index) [PATH3] if(qname == null || qname.isEmpty())=T -> return ...
/* static context [FOCAL] public static String _.getQnameParent(String qname) [PATH1] if(qname == null || qname.isEmpty())=F -> if(index == -1)=T -> return "" [PATH2] if(qname == null || qname.isEmpty())=F -> if(index == -1)=F -> return qname.substring(0, index) [PATH3] if(qname == null || qname.isEmpty())=T -> return ...
true
ok
{"focal": {"class": "_", "name": "getQnameParent", "signature": "String getQnameParent(String qname)", "start_line": 3, "modifiers": "public static", "params": [{"name": "qname", "type": "String"}], "return_type": "String"}, "class_info": {"name": "_", "kind": "class", "modifiers": "", "superclass": null, "interfaces":...
31410513_3
class VersionName implements Comparable { public static VersionName parse(final String versionName) { if (versionName == null) { return null; } String[] array = versionName.split("\\."); if (array.length != 3) { return null; } try { ...
VersionName versionName = VersionName.parse("1.2.3.4"); assertNull(versionName); } }
[FOCAL] public static VersionName VersionName.parse(String versionName) [CLASS] class VersionName implements Comparable [METRICS] loc=21 cc=6 branches=3 loops=1 returns=5 throws=0 nesting=3 [CALLS-EXTERNAL] String.split/1, Integer.parseInt/1 [NEW] VersionName [EXCEPTIONS] catches NumberFormatException e [PATH1] if(vers...
/* static context [FOCAL] public static VersionName VersionName.parse(String versionName) [PATH1] if(versionName == null)=F -> if(array.length != 3)=F -> for(i < version.length)=T -> if(version[i] < 0)=F -> exit loop -> return new VersionName(version) [PATH2] if(versionName == null)=T -> return null [PATH3] if(versionN...
/* static context [FOCAL] public static VersionName VersionName.parse(String versionName) [PATH1] if(versionName == null)=F -> if(array.length != 3)=F -> for(i < version.length)=T -> if(version[i] < 0)=F -> exit loop -> return new VersionName(version) [PATH2] if(versionName == null)=T -> return null [PATH3] if(versionN...
true
ok
{"focal": {"class": "VersionName", "name": "parse", "signature": "VersionName parse(String versionName)", "start_line": 3, "modifiers": "public static", "params": [{"name": "versionName", "type": "String"}], "return_type": "VersionName"}, "class_info": {"name": "VersionName", "kind": "class", "modifiers": "", "supercla...
31460755_0
class ArgParser { public String getConfigFilename() { if (agentArgs.length == 0) { return System.getProperty("agent-config"); } return getArg("agent-config"); } public ArgParser(String args); public String getLogConfigFilename(); public String getArg(String k...
ArgParser parser = new ArgParser("agent-config:agent.yaml"); assertThat(parser.getConfigFilename(), is("agent.yaml")); } }
[FOCAL] public String ArgParser.getConfigFilename() [CLASS] class ArgParser [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] String getArg(String key) [CALLS-EXTERNAL] System.getProperty/1 [PATH1] if(agentArgs.length == 0)=T -> return System.getProperty("agent-config") [PATH2] if(ag...
/* static context [FOCAL] public String ArgParser.getConfigFilename() [PATH1] if(agentArgs.length == 0)=T -> return System.getProperty("agent-config") [PATH2] if(agentArgs.length == 0)=F -> return getArg("agent-config") [CALLS-INTERNAL] String getArg(String key) [CALLS-EXTERNAL] System.getProperty/1 */
/* static context [FOCAL] public String ArgParser.getConfigFilename() [PATH1] if(agentArgs.length == 0)=T -> return System.getProperty("agent-config") [PATH2] if(agentArgs.length == 0)=F -> return getArg("agent-config") [CALLS-INTERNAL] String getArg(String key) [CALLS-EXTERNAL] System.getProperty/1 */ class ArgParser ...
true
ok
{"focal": {"class": "ArgParser", "name": "getConfigFilename", "signature": "String getConfigFilename()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "ArgParser", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": ...
31481933_7
class ResAllocsUtil { public static ResAllocs subtract(ResAllocs first, ResAllocs second) { return new ResAllocsBuilder(first.getTaskGroupName()) .withCores(first.getCores() - second.getCores()) .withMemory(first.getMemory() - second.getMemory()) .withNetwork...
ResAllocs result = ResAllocsUtil.subtract(generator.createResAllocs(2), generator.createResAllocs(1)); assertThat(hasEqualResources(result, generator.createResAllocs(1)), is(true)); } }
[FOCAL] public static ResAllocs ResAllocsUtil.subtract(ResAllocs first, ResAllocs second) [CLASS] class ResAllocsUtil [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] new ResAllocsBuilder(first.getTaskGroupName()) .withCores....build/0, new ResAllocsBuilder(first.getTaskGroupName())...
/* static context [FOCAL] public static ResAllocs ResAllocsUtil.subtract(ResAllocs first, ResAllocs second) [INPUTS] branches=- | result=first, second [COLLABORATORS] param first:ResAllocs getTaskGroupName/0,getCores/0,getMemory/0,getNetworkMbps/0,getDisk/0; param second:ResAllocs getCores/0,getMemory/0,getNetworkMbps/...
/* static context [FOCAL] public static ResAllocs ResAllocsUtil.subtract(ResAllocs first, ResAllocs second) [INPUTS] branches=- | result=first, second [COLLABORATORS] param first:ResAllocs getTaskGroupName/0,getCores/0,getMemory/0,getNetworkMbps/0,getDisk/0; param second:ResAllocs getCores/0,getMemory/0,getNetworkMbps/...
true
ok
{"focal": {"class": "ResAllocsUtil", "name": "subtract", "signature": "ResAllocs subtract(ResAllocs first, ResAllocs second)", "start_line": 3, "modifiers": "public static", "params": [{"name": "first", "type": "ResAllocs"}, {"name": "second", "type": "ResAllocs"}], "return_type": "ResAllocs"}, "class_info": {"name": "...
31482799_4
class CatnapWrappingView implements View, WrappingView<CatnapView> { public Object extractResult(Map<String, ?> model) { if (model != null && !model.isEmpty()) { if (model.size() == 1) { return model.values().iterator().next(); } else { if (model.cont...
Map<String, Object> modelMap = new HashMap<>(2); modelMap.put("params", new Object()); modelMap.put(CatnapWrappingView.DEFAULT_MODELNAME, new BeanModel()); CatnapWrappingView view = new CatnapWrappingView(new JsonView()); assertTrue(view.extractResult(modelMap) instanceof BeanMo...
[FOCAL] public Object CatnapWrappingView.extractResult(Map<String, ?> model) [CLASS] class CatnapWrappingView implements View, WrappingView<CatnapView> [METRICS] loc=15 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=3 [CALLS-INTERNAL] String getModelName() [CALLS-EXTERNAL] Map<String, ?>.isEmpty/0, Map<String, ?>.s...
/* static context [FOCAL] public Object CatnapWrappingView.extractResult(Map<String, ?> model) [PATH1] if(model != null && !model.isEmpty())=T -> if(model.size() == 1)=F -> if(model.containsKey(CatnapResponseBodyHandlerInterceptor.MODEL_NAME))=T -> return model.get(CatnapResponseBodyHandlerInterceptor.MODEL_NAME) [PATH...
/* static context [FOCAL] public Object CatnapWrappingView.extractResult(Map<String, ?> model) [PATH1] if(model != null && !model.isEmpty())=T -> if(model.size() == 1)=F -> if(model.containsKey(CatnapResponseBodyHandlerInterceptor.MODEL_NAME))=T -> return model.get(CatnapResponseBodyHandlerInterceptor.MODEL_NAME) [PATH...
true
ok
{"focal": {"class": "CatnapWrappingView", "name": "extractResult", "signature": "Object extractResult(Map<String, ?> model)", "start_line": 3, "modifiers": "public", "params": [{"name": "model", "type": "Map<String, ?>"}], "return_type": "Object"}, "class_info": {"name": "CatnapWrappingView", "kind": "class", "modifier...
31561391_37
class ModelContentToEcoreConverter implements IModelConverter<ModelContent, Model> { @Override public Model convert(ModelContent source, Optional<String> platformKey) { IModel model = source.getModels().get(source.getRoot()); return convert(model, source, platformKey); } private Model convert(IModel m...
FunctionblockModel fbModel = FunctionblockModel .Builder(ModelId.fromPrettyFormat("org.eclipse.vorto:Sensor:1.0.0")) .statusProperty(ModelProperty .Builder("value", new DictionaryType(PrimitiveType.STRING, PrimitiveType.INT)).build()) .build(); ModelContentToEcoreConverter c...
[FOCAL] @Override public Model ModelContentToEcoreConverter.convert(ModelContent source, Optional<String> platformKey) [CLASS] class ModelContentToEcoreConverter implements IModelConverter<ModelContent, Model> [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Model convert(IModel mod...
/* static context [FOCAL] @Override public Model ModelContentToEcoreConverter.convert(ModelContent source, Optional<String> platformKey) [INPUTS] branches=- | result=platformKey, source [COLLABORATORS] param source:ModelContent getModels/0,getRoot/0 [CALLS-INTERNAL] Model convert(IModel model, ModelContent context, Opt...
/* static context [FOCAL] @Override public Model ModelContentToEcoreConverter.convert(ModelContent source, Optional<String> platformKey) [INPUTS] branches=- | result=platformKey, source [COLLABORATORS] param source:ModelContent getModels/0,getRoot/0 [CALLS-INTERNAL] Model convert(IModel model, ModelContent context, Opt...
true
ok
{"focal": {"class": "ModelContentToEcoreConverter", "name": "convert", "signature": "Model convert(ModelContent source, Optional<String> platformKey)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "source", "type": "ModelContent"}, {"name": "platformKey", "type": "Optional<String>"}], "return_t...
31587091_25
class I18nMap implements Iterable<Map.Entry<Locale, String>> { public String valueFor(Locale locale) { String result = values.get(locale); if (result == null && !locale.getVariant().isEmpty()) { Locale fallbackLocale = new Locale(locale.getLanguage(), locale.getCountry()); r...
I18nMap value = new I18nMap(ImmutableMap.<Locale, String>builder() .put(ENGLISH_LOCALE, "greetings") .put(Locale.ITALIAN, "ciao").build()); assertEquals("greetings", value.valueFor(Locale.CHINA)); } }
[FOCAL] public String I18nMap.valueFor(Locale locale) [CLASS] class I18nMap implements Iterable<Map.Entry<Locale, String>> [METRICS] loc=15 cc=4 branches=3 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] String value() [CALLS-EXTERNAL] values.get/1, locale.getVariant().isEmpty/0, Locale.getVariant/0, Locale.getLa...
/* static context [FOCAL] public String I18nMap.valueFor(Locale locale) [PATH1] if(result == null && !locale.getVariant().isEmpty())=T -> if(result == null && !locale.getCountry().isEmpty())=T -> if(result == null)=T -> return result [PATH2] if(result == null && !locale.getVariant().isEmpty())=F -> if(result == null &&...
/* static context [FOCAL] public String I18nMap.valueFor(Locale locale) [PATH1] if(result == null && !locale.getVariant().isEmpty())=T -> if(result == null && !locale.getCountry().isEmpty())=T -> if(result == null)=T -> return result [PATH2] if(result == null && !locale.getVariant().isEmpty())=F -> if(result == null &&...
true
ok
{"focal": {"class": "I18nMap", "name": "valueFor", "signature": "String valueFor(Locale locale)", "start_line": 3, "modifiers": "public", "params": [{"name": "locale", "type": "Locale"}], "return_type": "String"}, "class_info": {"name": "I18nMap", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Ite...
31622667_0
class ElevatorSystemState implements State<ElevatorSystemState> { public static int hashCode(double x) { // System.out.println(x + " - " + round(x, (int)-Math.log10(RATE_EPSILON))); return (int)Math.round((round(x, (int)-Math.log10(RATE_EPSILON)) / RATE_EPSILON)); } public ElevatorSystemState(); public int g...
assertEquals(0, ElevatorSystemState.hashCode(0.0)); assertEquals(1, ElevatorSystemState.hashCode(0.05)); assertEquals(1, ElevatorSystemState.hashCode(0.1)); assertEquals(2, ElevatorSystemState.hashCode(0.15)); assertEquals(2, ElevatorSystemState.hashCode(0.2)); assertEquals(2, ElevatorSystemState.hashCode(0...
[FOCAL] public static int ElevatorSystemState.hashCode(double x) [CLASS] class ElevatorSystemState implements State<ElevatorSystemState> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] double round(double value, int places) [CALLS-EXTERNAL] Math.round/1, Math.log10/1 [INPUTS] branc...
/* static context [FOCAL] public static int ElevatorSystemState.hashCode(double x) [INPUTS] branches=- | result=x [CALLS-INTERNAL] double round(double value, int places) [CALLS-EXTERNAL] Math.round/1, Math.log10/1 */
/* static context [FOCAL] public static int ElevatorSystemState.hashCode(double x) [INPUTS] branches=- | result=x [CALLS-INTERNAL] double round(double value, int places) [CALLS-EXTERNAL] Math.round/1, Math.log10/1 */ class ElevatorSystemState implements State<ElevatorSystemState> { public static int hashCode(double x...
true
ok
{"focal": {"class": "ElevatorSystemState", "name": "hashCode", "signature": "int hashCode(double x)", "start_line": 3, "modifiers": "public static", "params": [{"name": "x", "type": "double"}], "return_type": "int"}, "class_info": {"name": "ElevatorSystemState", "kind": "class", "modifiers": "", "superclass": null, "in...
31639517_0
class Murmur3_x86_32 { public int hashInt(int input) { int k1 = mixK1(input); int h1 = mixH1(seed, k1); return fmix(h1, 4); } public Murmur3_x86_32(int seed); @Override public String toString(); public int hashLong(long input); private static int mixK1(int k1); private static int mixH1(in...
Assert.assertEquals(593689054, hasher.hashInt(0)); Assert.assertEquals(-189366624, hasher.hashInt(-42)); Assert.assertEquals(-1134849565, hasher.hashInt(42)); Assert.assertEquals(-1718298732, hasher.hashInt(Integer.MIN_VALUE)); Assert.assertEquals(-1653689534, hasher.hashInt(Integer.MAX_VALUE)); }...
[FOCAL] public int Murmur3_x86_32.hashInt(int input) [CLASS] class Murmur3_x86_32 [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] int fmix(int h1, int length); int mixH1(int h1, int k1); int mixK1(int k1) [INPUTS] branches=- | result=input [DATAFLOW] h1@L3->L5; input@param->L2; k1@...
/* static context [FOCAL] public int Murmur3_x86_32.hashInt(int input) [INPUTS] branches=- | result=input [CALLS-INTERNAL] int fmix(int h1, int length); int mixH1(int h1, int k1); int mixK1(int k1) */
/* static context [FOCAL] public int Murmur3_x86_32.hashInt(int input) [INPUTS] branches=- | result=input [CALLS-INTERNAL] int fmix(int h1, int length); int mixH1(int h1, int k1); int mixK1(int k1) */ class Murmur3_x86_32 { public int hashInt(int input) { int k1 = mixK1(input); int h1 = mixH1(seed, k1); ...
true
ok
{"focal": {"class": "Murmur3_x86_32", "name": "hashInt", "signature": "int hashInt(int input)", "start_line": 3, "modifiers": "public", "params": [{"name": "input", "type": "int"}], "return_type": "int"}, "class_info": {"name": "Murmur3_x86_32", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, ...
31650129_22
class UnitFactory { public SensorCommandValue createPressureValue(CommandResult commandResult) { return new PressureValue(commandResult); } public SensorCommandValue createAirFlowValue(CommandResult commandResult); public SensorCommandValue createFuelConsumptionValue(CommandResult commandResult); public Sensor...
// given // when SensorCommandValue valueObject = sut.createPressureValue(commandResultMock); // then assertValueObjectHasProperTypeAndResult(valueObject, PressureValue.class); } }
[FOCAL] public SensorCommandValue UnitFactory.createPressureValue(CommandResult commandResult) [CLASS] class UnitFactory [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] PressureValue [INPUTS] branches=- | result=commandResult [DATAFLOW] commandResult@param->L2 [CLASS-MEMBERS] SensorCommandVal...
/* static context [FOCAL] public SensorCommandValue UnitFactory.createPressureValue(CommandResult commandResult) [INPUTS] branches=- | result=commandResult [NEW] PressureValue */
/* static context [FOCAL] public SensorCommandValue UnitFactory.createPressureValue(CommandResult commandResult) [INPUTS] branches=- | result=commandResult [NEW] PressureValue */ class UnitFactory { public SensorCommandValue createPressureValue(CommandResult commandResult) { return new PressureValue(commandResult);...
true
ok
{"focal": {"class": "UnitFactory", "name": "createPressureValue", "signature": "SensorCommandValue createPressureValue(CommandResult commandResult)", "start_line": 3, "modifiers": "public", "params": [{"name": "commandResult", "type": "CommandResult"}], "return_type": "SensorCommandValue"}, "class_info": {"name": "Unit...
31696454_6
class PhastDecoder { public static String decodeString(ChannelReader reader, Boolean isOptional){ if (reader.readPackedInt() == INCOMING_VARIABLE){ return reader.readUTF(); } else return null; } public static long decodeDeltaLong(long[] longDictionary, ChannelReader reader, long...
Pipe<RawDataSchema> pipe = new Pipe<RawDataSchema>(new PipeConfig<RawDataSchema>(RawDataSchema.instance, 100, 4000)); pipe.initBuffers(); DataOutputBlobWriter<RawDataSchema> writer = new DataOutputBlobWriter<RawDataSchema>(pipe); DataOutputBlobWriter.writePackedInt(writer, -63); writer.writeUTF("This is a ...
[FOCAL] public static String PhastDecoder.decodeString(ChannelReader reader, Boolean isOptional) [CLASS] class PhastDecoder [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] ChannelReader.readPackedInt/0, ChannelReader.readUTF/0 [PATH1] if(reader.readPackedInt() == INCOMING_VARIABLE)...
/* static context [FOCAL] public static String PhastDecoder.decodeString(ChannelReader reader, Boolean isOptional) [PATH1] if(reader.readPackedInt() == INCOMING_VARIABLE)=T -> return reader.readUTF() [PATH2] if(reader.readPackedInt() == INCOMING_VARIABLE)=F -> return null [INPUTS] branches=reader | result=reader | unus...
/* static context [FOCAL] public static String PhastDecoder.decodeString(ChannelReader reader, Boolean isOptional) [PATH1] if(reader.readPackedInt() == INCOMING_VARIABLE)=T -> return reader.readUTF() [PATH2] if(reader.readPackedInt() == INCOMING_VARIABLE)=F -> return null [INPUTS] branches=reader | result=reader | unus...
true
ok
{"focal": {"class": "PhastDecoder", "name": "decodeString", "signature": "String decodeString(ChannelReader reader, Boolean isOptional)", "start_line": 3, "modifiers": "public static", "params": [{"name": "reader", "type": "ChannelReader"}, {"name": "isOptional", "type": "Boolean"}], "return_type": "String"}, "class_in...
31766535_4
class ZkManager { public static CuratorFramework curatorFramework() { if (curatorFramework != null) { return curatorFramework; } else synchronized (ZkManager.class) { if (curatorFramework == null) { final String quorum = System.getProperty("zk.quorum", "local...
final CuratorFramework curator = ZkManager.curatorFramework(); assertEquals(curator.getState(), CuratorFrameworkState.STARTED); } }
[FOCAL] public static CuratorFramework ZkManager.curatorFramework() [CLASS] class ZkManager [METRICS] loc=35 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=3 [CALLS-EXTERNAL] System.getProperty/2, Integer.parseInt/1, logger.info/2, CuratorFrameworkFactory.newClient/4, CuratorFramework.start/0, Runtime.getRuntime()....
/* static context [FOCAL] public static CuratorFramework ZkManager.curatorFramework() [PATH1] if(curatorFramework != null)=F -> if(curatorFramework == null)=T -> return curatorFramework [PATH2] if(curatorFramework != null)=T -> return curatorFramework [PATH3] if(curatorFramework != null)=F -> if(curatorFramework == nul...
/* static context [FOCAL] public static CuratorFramework ZkManager.curatorFramework() [PATH1] if(curatorFramework != null)=F -> if(curatorFramework == null)=T -> return curatorFramework [PATH2] if(curatorFramework != null)=T -> return curatorFramework [PATH3] if(curatorFramework != null)=F -> if(curatorFramework == nul...
true
ok
{"focal": {"class": "ZkManager", "name": "curatorFramework", "signature": "CuratorFramework curatorFramework()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "CuratorFramework"}, "class_info": {"name": "ZkManager", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, ...
31784428_9
class CSRFHandler implements RequestResponseHandler { @Override public void handle(HttpServletRequest request, HttpServletResponse response, HandlerChain chain) throws Exception { if (request.getMethod().equals("GET")) { verifyTokenAbsence(request, response); } else { ve...
Cookie token = generateTokenCookie(); when(request.getMethod()).thenReturn("POST"); when(request.getCookies()).thenReturn(new Cookie[]{token}); when(request.getParameter(TOKEN_PARAM)).thenReturn(null); when(request.getHeader(TOKEN_HEADER)).thenReturn(token.getValue()); ha...
[FOCAL] @Override public void CSRFHandler.handle(HttpServletRequest request, HttpServletResponse response, HandlerChain chain) [CLASS] class CSRFHandler implements RequestResponseHandler [METRICS] loc=9 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] void verifyToken(HttpServletRequest request, Ht...
/* static context [FOCAL] @Override public void CSRFHandler.handle(HttpServletRequest request, HttpServletResponse response, HandlerChain chain) [PATH1] if(request.getMethod().equals("GET"))=T [PATH2] if(request.getMethod().equals("GET"))=F [INPUTS] branches=request | result=- [COLLABORATORS] param request:HttpServletR...
/* static context [FOCAL] @Override public void CSRFHandler.handle(HttpServletRequest request, HttpServletResponse response, HandlerChain chain) [PATH1] if(request.getMethod().equals("GET"))=T [PATH2] if(request.getMethod().equals("GET"))=F [INPUTS] branches=request | result=- [COLLABORATORS] param request:HttpServletR...
true
ok
{"focal": {"class": "CSRFHandler", "name": "handle", "signature": "void handle(HttpServletRequest request, HttpServletResponse response, HandlerChain chain) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "HttpServletRequest"}, {"name": "response", "type": "Ht...
31785239_90
class DelegatingStream implements Stream<T> { @Override public boolean noneMatch(Predicate<? super T> predicate) { boolean b = stream.noneMatch(predicate); close(); return b; } public DelegatingStream(Stream<T> stream); @Override public Stream<T> filter(Predicate<? super ...
assertTerminalOpCallsClose(stream -> stream.noneMatch(s -> true)); } }
[FOCAL] @Override public boolean DelegatingStream.noneMatch(Predicate<? super T> predicate) [CLASS] class DelegatingStream implements Stream<T> [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] void close() [CALLS-EXTERNAL] stream.noneMatch/1 [INPUTS] branches=- | result=predicate [C...
/* static context [FOCAL] @Override public boolean DelegatingStream.noneMatch(Predicate<? super T> predicate) [INPUTS] branches=- | result=predicate [COLLABORATORS] field stream noneMatch/1 [CALLS-INTERNAL] void close() [CALLS-EXTERNAL] stream.noneMatch/1 */
/* static context [FOCAL] @Override public boolean DelegatingStream.noneMatch(Predicate<? super T> predicate) [INPUTS] branches=- | result=predicate [COLLABORATORS] field stream noneMatch/1 [CALLS-INTERNAL] void close() [CALLS-EXTERNAL] stream.noneMatch/1 */ class DelegatingStream implements Stream<T> { @Override ...
true
ok
{"focal": {"class": "DelegatingStream", "name": "noneMatch", "signature": "boolean noneMatch(Predicate<? super T> predicate)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "predicate", "type": "Predicate<? super T>"}], "return_type": "boolean"}, "class_info": {"name": "DelegatingStream", "kind"...
31786762_1
class DeviceInfo { static int getCoresFromFileString(String str) { if (str == null || !str.matches("0-[\\d]+$")) { return DEVICEINFO_UNKNOWN; } int cores = Integer.valueOf(str.substring(2)) + 1; return cores; } public static int getNumberOfCPUCores(); private static int getCoresFromFileI...
assertEquals(DeviceInfo.getCoresFromFileString("INVALIDSTRING"), -1); assertEquals(DeviceInfo.getCoresFromFileString("0-2a"), -1); assertEquals(DeviceInfo.getCoresFromFileString("035"), -1); } }
[FOCAL] static int DeviceInfo.getCoresFromFileString(String str) [CLASS] class DeviceInfo [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] String.matches/1, Integer.valueOf/1, String.substring/1 [PATH1] if(str == null || !str.matches("0-[\\d]+$"))=T -> return DEVICEINFO_UNKNOWN [PAT...
/* static context [FOCAL] static int DeviceInfo.getCoresFromFileString(String str) [PATH1] if(str == null || !str.matches("0-[\\d]+$"))=T -> return DEVICEINFO_UNKNOWN [PATH2] if(str == null || !str.matches("0-[\\d]+$"))=F -> return cores [INPUTS] branches=str | result=str [CALLS-EXTERNAL] String.matches/1, Integer.valu...
/* static context [FOCAL] static int DeviceInfo.getCoresFromFileString(String str) [PATH1] if(str == null || !str.matches("0-[\\d]+$"))=T -> return DEVICEINFO_UNKNOWN [PATH2] if(str == null || !str.matches("0-[\\d]+$"))=F -> return cores [INPUTS] branches=str | result=str [CALLS-EXTERNAL] String.matches/1, Integer.valu...
true
ok
{"focal": {"class": "DeviceInfo", "name": "getCoresFromFileString", "signature": "int getCoresFromFileString(String str)", "start_line": 3, "modifiers": "static", "params": [{"name": "str", "type": "String"}], "return_type": "int"}, "class_info": {"name": "DeviceInfo", "kind": "class", "modifiers": "", "superclass": nu...
31789636_0
class EnipPacket { public CommandCode getCommandCode() { return commandCode; } public EnipPacket(CommandCode commandCode, long sessionHandle, EnipStatus status, long senderContext, @Nullable Command command); ...
EnipPacket packet = new EnipPacket( command.getCommandCode(), 1L, EnipStatus.EIP_SUCCESS, 2L, command ); EnipPacket decoded = encodeDecode(packet, EnipPacket::encode, EnipPacket::decode); assertEquals(packet, decoded); } ...
[FOCAL] public CommandCode EnipPacket.getCommandCode() [CLASS] class EnipPacket [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] EnipPacket(CommandCode commandCode, long sessionHandle, EnipStatus status, long senderContext, Command command); long getSessionHandle(); EnipStatus getSta...
/* static context [FOCAL] public CommandCode EnipPacket.getCommandCode() */
/* static context [FOCAL] public CommandCode EnipPacket.getCommandCode() */ class EnipPacket { public CommandCode getCommandCode() { return commandCode; } public EnipPacket(CommandCode commandCode, long sessionHandle, EnipStatus status, ...
true
ok
{"focal": {"class": "EnipPacket", "name": "getCommandCode", "signature": "CommandCode getCommandCode()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "CommandCode"}, "class_info": {"name": "EnipPacket", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "memb...
31836491_78
class BlockChain extends AbstractBlockChain { @Override public boolean add(FilteredBlock block) throws VerificationException, PrunedException { boolean success = super.add(block); if (success) { trackFilteredTransactions(block.getTransactionCount()); } return success...
// Quick check that we can actually receive coins. Transaction tx1 = createFakeTx(unitTestParams, Utils.toNanoCoins(1, 0), wallet.getKeys().get(0).toAddress(unitTestParams)); Block b1 = createFakeBlock(blockStore, tx1)...
[FOCAL] @Override public boolean BlockChain.add(FilteredBlock block) [CLASS] class BlockChain extends AbstractBlockChain [METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] AbstractBlockChain.add/1, trackFilteredTransactions/1 (inherited), FilteredBlock.getTransactionCount/0 [EXCEPTION...
/* static context [FOCAL] @Override public boolean BlockChain.add(FilteredBlock block) [PATH1] if(success)=T -> return success [PATH2] if(success)=F -> return success [INPUTS] branches=block | result=block [COLLABORATORS] param block:FilteredBlock getTransactionCount/0 [EXCEPTIONS] declares VerificationException, Prune...
/* static context [FOCAL] @Override public boolean BlockChain.add(FilteredBlock block) [PATH1] if(success)=T -> return success [PATH2] if(success)=F -> return success [INPUTS] branches=block | result=block [COLLABORATORS] param block:FilteredBlock getTransactionCount/0 [EXCEPTIONS] declares VerificationException, Prune...
true
ok
{"focal": {"class": "BlockChain", "name": "add", "signature": "boolean add(FilteredBlock block) throws VerificationException, PrunedException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "block", "type": "FilteredBlock"}], "return_type": "boolean"}, "class_info": {"name": "BlockChain", "kind"...
31854274_0
class CLMatrixUtils { public static long roundUp(long size, int blockSize) { return ((size + blockSize - 1) / blockSize) * blockSize; } static CLEvent[] join(CLEvent[]... evts); public static void matrixMultiply( final CLMatrix2D<T> a, final CLMatrix2D<T> b, ...
assertEquals(0, roundUp(0, 16)); assertEquals(16, roundUp(1, 16)); assertEquals(16, roundUp(16, 16)); assertEquals(32, roundUp(17, 16)); } }
[FOCAL] public static long CLMatrixUtils.roundUp(long size, int blockSize) [CLASS] class CLMatrixUtils [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [INPUTS] branches=- | result=blockSize, size [DATAFLOW] blockSize@param->L2; size@param->L2 [CLASS-MEMBERS] CLEvent[] join(CLEvent[]... evts); void ...
/* static context [FOCAL] public static long CLMatrixUtils.roundUp(long size, int blockSize) [INPUTS] branches=- | result=blockSize, size */
/* static context [FOCAL] public static long CLMatrixUtils.roundUp(long size, int blockSize) [INPUTS] branches=- | result=blockSize, size */ class CLMatrixUtils { public static long roundUp(long size, int blockSize) { return ((size + blockSize - 1) / blockSize) * blockSize; } static CLEvent[] join...
true
ok
{"focal": {"class": "CLMatrixUtils", "name": "roundUp", "signature": "long roundUp(long size, int blockSize)", "start_line": 3, "modifiers": "public static", "params": [{"name": "size", "type": "long"}, {"name": "blockSize", "type": "int"}], "return_type": "long"}, "class_info": {"name": "CLMatrixUtils", "kind": "class...
31909123_2
class CharacterMapper { public Map<Character, Integer> buildCharacterMapper() { Map<Character, Integer> charTOIntMap = new HashMap<Character, Integer>(); charTOIntMap.put('E', 0); charTOIntMap.put('J', 1); charTOIntMap.put('N', 1); charTOIntMap.put('Q', 1); charTOIntMap.put(...
Map<Character, Integer> buildCharacterMapper = mapper.buildCharacterMapper(); assertNotNull(buildCharacterMapper); assertTrue(buildCharacterMapper.get('F')==4); assertTrue(buildCharacterMapper.get('T')==4); assertTrue(buildCharacterMapper.get('A')==5); assertTrue(buildCharacterMapper.get('M')==5); asse...
[FOCAL] public Map<Character, Integer> CharacterMapper.buildCharacterMapper() [CLASS] class CharacterMapper [METRICS] loc=40 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Map<Character, Integer>.put/2 [NEW] HashMap<Character, Integer> [DATAFLOW] charTOIntMap@L3->L4,L6,L7,L8,L10,L11,L12,L14,L15,L...
/* static context [FOCAL] public Map<Character, Integer> CharacterMapper.buildCharacterMapper() [NEW] HashMap<Character, Integer> [CALLS-EXTERNAL] Map<Character, Integer>.put/2 */
/* static context [FOCAL] public Map<Character, Integer> CharacterMapper.buildCharacterMapper() [NEW] HashMap<Character, Integer> [CALLS-EXTERNAL] Map<Character, Integer>.put/2 */ class CharacterMapper { public Map<Character, Integer> buildCharacterMapper() { Map<Character, Integer> charTOIntMap = new Hash...
true
ok
{"focal": {"class": "CharacterMapper", "name": "buildCharacterMapper", "signature": "Map<Character, Integer> buildCharacterMapper()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Map<Character, Integer>"}, "class_info": {"name": "CharacterMapper", "kind": "class", "modifiers": "", "superclass":...
31911300_104
class EsperOperator implements DelayedResponseOperator { public void initialize(Properties properties) throws RequiredInputMissingException, ComponentInitializationFailedException { if(properties == null) throw new RequiredInputMissingException("Missing required properties"); ////////////////////////////...
try { new EsperOperator().initialize(null); Assert.fail("Invalid input"); } catch(RequiredInputMissingException e) { // } } }
[FOCAL] public void EsperOperator.initialize(Properties properties) [CLASS] class EsperOperator implements DelayedResponseOperator [METRICS] loc=84 cc=15 branches=7 loops=5 returns=0 throws=5 nesting=4 [CALLS-EXTERNAL] Properties.getProperty/1, StringUtils.isBlank/1, Set<String>.add/1, StringUtils.trim/1, Set<String>.i...
/* static context [FOCAL] public void EsperOperator.initialize(Properties properties) [THROWS-WHEN] RequiredInputMissingException when properties == null [THROWS-WHEN] RequiredInputMissingException when !(properties == null) && i < Integer.MAX_VALUE && StringUtils.isBlank(tmpStr) && esperQueryStrings.isEmpty() [THROWS-...
/* static context [FOCAL] public void EsperOperator.initialize(Properties properties) [THROWS-WHEN] RequiredInputMissingException when properties == null [THROWS-WHEN] RequiredInputMissingException when !(properties == null) && i < Integer.MAX_VALUE && StringUtils.isBlank(tmpStr) && esperQueryStrings.isEmpty() [THROWS-...
true
ok
{"focal": {"class": "EsperOperator", "name": "initialize", "signature": "void initialize(Properties properties) throws RequiredInputMissingException, ComponentInitializationFailedException", "start_line": 3, "modifiers": "public", "params": [{"name": "properties", "type": "Properties"}], "return_type": "void"}, "class_...
31923485_6
class TokenizerMapper extends Mapper<Object, Text, Text, IntWritable> { List<ImmutablePair<String, Integer>> parse(String value) { List<ImmutablePair<String, Integer>> result = newArrayList(); StringTokenizer tokenizer = new StringTokenizer(value, SEPARATORS); while (tokenizer.hasMoreElemen...
TokenizerMapper tokenizerMapper = new TokenizerMapper(); List<ImmutablePair<String, Integer>> pairs = tokenizerMapper.parse("LAS,WN,23.00,0.00\n" + "LAS,WN,0.00,1.00\n" + "WRO,AA,0.00,0.00\n" + "WRO,BB,-10.00,0.00\n" + "WRO,CC,,0.00\n"); ...
[FOCAL] List<ImmutablePair<String, Integer>> TokenizerMapper.parse(String value) [CLASS] class TokenizerMapper extends Mapper<Object, Text, Text, IntWritable> [METRICS] loc=17 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] Integer onTime(String carrierDelay); String merge(String origin, String ca...
/* static context [FOCAL] List<ImmutablePair<String, Integer>> TokenizerMapper.parse(String value) [PATH1] while(tokenizer.hasMoreElements())=T -> if(isNotCanceled(canceled))=T -> exit loop -> return result [PATH2] while(tokenizer.hasMoreElements())=F -> return result [PATH3] while(tokenizer.hasMoreElements())=T -> if(...
/* static context [FOCAL] List<ImmutablePair<String, Integer>> TokenizerMapper.parse(String value) [PATH1] while(tokenizer.hasMoreElements())=T -> if(isNotCanceled(canceled))=T -> exit loop -> return result [PATH2] while(tokenizer.hasMoreElements())=F -> return result [PATH3] while(tokenizer.hasMoreElements())=T -> if(...
true
ok
{"focal": {"class": "TokenizerMapper", "name": "parse", "signature": "List<ImmutablePair<String, Integer>> parse(String value)", "start_line": 3, "modifiers": "", "params": [{"name": "value", "type": "String"}], "return_type": "List<ImmutablePair<String, Integer>>"}, "class_info": {"name": "TokenizerMapper", "kind": "c...
31924536_3
class TextTokenizer extends BaseTokenizer { public String next() { if (!hasNext()) { throw new IllegalStateException("No next ngram to return"); } CharSequence result = CharBuffer.wrap(_normalized, _normalizedPos, _curNGramLength); nextNGram(); return result.t...
int numChars = 2000; StringBuilder sb = new StringBuilder(); for (int i = 0; i < numChars; i++) { sb.append((char)((int)'a' + (i % 10))); } // We should get 3(N - 1) ngrams int numNGrams = 0; TextTokenizer tokenizer = new TextTokenizer(sb.toSt...
[FOCAL] public String TextTokenizer.next() [CLASS] class TextTokenizer extends BaseTokenizer [METRICS] loc=11 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] hasNext/0 (inherited), CharBuffer.wrap/3, nextNGram/0 (inherited), CharSequence.toString/0 [NEW] IllegalStateException [EXCEPTIONS] throws I...
/* static context [FOCAL] public String TextTokenizer.next() [THROWS-WHEN] IllegalStateException when !hasNext() [PATH1] if(!hasNext())=T -> throw new IllegalStateException("No next ngram to return") [PATH2] if(!hasNext())=F -> return result.toString() [EXCEPTIONS] throws IllegalStateException [NEW] IllegalStateExcepti...
/* static context [FOCAL] public String TextTokenizer.next() [THROWS-WHEN] IllegalStateException when !hasNext() [PATH1] if(!hasNext())=T -> throw new IllegalStateException("No next ngram to return") [PATH2] if(!hasNext())=F -> return result.toString() [EXCEPTIONS] throws IllegalStateException [NEW] IllegalStateExcepti...
true
ok
{"focal": {"class": "TextTokenizer", "name": "next", "signature": "String next()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "TextTokenizer", "kind": "class", "modifiers": "", "superclass": "BaseTokenizer", "interfaces": null, "fields": [], "members": [{"name...
31924590_26
class EntriesFieldsDumper implements EventFilter { @Override public void filter(final FieldsMap fields) throws FormatException { if (fields instanceof Event) { final Event event = (Event) fields; final List<LogEntry> entries = event.getEntries(); if (entries != null && entries.size() > 0) { final LogE...
final FieldsMap fields = new FieldsMap(); final LogEntry entry = new LogEntry(); entry.put("abc", 1); fields.put(Event.FIELD_ENTRIES, Collections.singletonList(entry)); filter.filter(fields); Assert.assertFalse(fields.containsKey("abc")); } }
[FOCAL] @Override public void EntriesFieldsDumper.filter(FieldsMap fields) [CLASS] class EntriesFieldsDumper implements EventFilter [METRICS] loc=18 cc=5 branches=4 loops=0 returns=0 throws=0 nesting=3 [CALLS-EXTERNAL] Event.getEntries/0, List<LogEntry>.size/0, List<LogEntry>.get/1, Event.putAll/1, LogEntry.containsKey...
/* static context [FOCAL] @Override public void EntriesFieldsDumper.filter(FieldsMap fields) [PATH1] if(fields instanceof Event)=T -> if(entries != null && entries.size() > 0)=T -> if(excludeRaw && entry.containsKey(LogEntry.FIELD_RAW_CONTENT))=T -> if(deleteEntries)=T [PATH2] if(fields instanceof Event)=T -> if(entrie...
/* static context [FOCAL] @Override public void EntriesFieldsDumper.filter(FieldsMap fields) [PATH1] if(fields instanceof Event)=T -> if(entries != null && entries.size() > 0)=T -> if(excludeRaw && entry.containsKey(LogEntry.FIELD_RAW_CONTENT))=T -> if(deleteEntries)=T [PATH2] if(fields instanceof Event)=T -> if(entrie...
true
ok
{"focal": {"class": "EntriesFieldsDumper", "name": "filter", "signature": "void filter(FieldsMap fields) throws FormatException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "fields", "type": "FieldsMap"}], "return_type": "void"}, "class_info": {"name": "EntriesFieldsDumper", "kind": "class", ...
31935307_2
class ServletUtil { public static String extractCookie(final HttpServletRequest request, final String name) { Cookie[] cookies = request.getCookies(); if (cookies != null) { for (Cookie cookie : cookies) { if (cookie.getName().equals(name)) { return cookie.getValue(); } } } return null; } ...
String cookieName = "mycookiename"; MockHttpServletRequest httpServletRequest = new MockHttpServletRequest(); Assert.assertNull("Got cookie value by name", ServletUtil.extractCookie(httpServletRequest, cookieName)); } }
[FOCAL] public static String ServletUtil.extractCookie(HttpServletRequest request, String name) [CLASS] class ServletUtil [METRICS] loc=11 cc=4 branches=2 loops=1 returns=2 throws=0 nesting=3 [CALLS-EXTERNAL] HttpServletRequest.getCookies/0, cookie.getName().equals/1, Cookie.getName/0, Cookie.getValue/0 [PATH1] if(cook...
/* static context [FOCAL] public static String ServletUtil.extractCookie(HttpServletRequest request, String name) [PATH1] if(cookies != null)=T -> foreach(Cookie cookie : cookies)=T -> if(cookie.getName().equals(name))=F -> exit loop -> return null [PATH2] if(cookies != null)=T -> foreach(Cookie cookie : cookies)=T -> ...
/* static context [FOCAL] public static String ServletUtil.extractCookie(HttpServletRequest request, String name) [PATH1] if(cookies != null)=T -> foreach(Cookie cookie : cookies)=T -> if(cookie.getName().equals(name))=F -> exit loop -> return null [PATH2] if(cookies != null)=T -> foreach(Cookie cookie : cookies)=T -> ...
true
ok
{"focal": {"class": "ServletUtil", "name": "extractCookie", "signature": "String extractCookie(HttpServletRequest request, String name)", "start_line": 3, "modifiers": "public static", "params": [{"name": "request", "type": "HttpServletRequest"}, {"name": "name", "type": "String"}], "return_type": "String"}, "class_inf...
31976266_71
class DeletableFrameTupleAppender implements IAppendDeletableFrameTupleAccessor { @Override public int append(IFrameTupleAccessor tupleAccessor, int tIndex) throws HyracksDataException { byte[] src = tupleAccessor.getBuffer().array(); int tStartOffset = tupleAccessor.getTupleStartOffset(tIndex)...
int count = 10; ByteBuffer bufferRead = makeAFrame(cap, count, 0); DeletableFrameTupleAppender accessor = new DeletableFrameTupleAppender(recordDescriptor); accessor.reset(bufferRead); ByteBuffer bufferWrite = ByteBuffer.allocate(cap); appender.clear(bufferWrite); ...
[FOCAL] @Override public int DeletableFrameTupleAppender.append(IFrameTupleAccessor tupleAccessor, int tIndex) [CLASS] class DeletableFrameTupleAppender implements IAppendDeletableFrameTupleAccessor [METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] void setFreeDataEndOffset(int offs...
/* static context [FOCAL] @Override public int DeletableFrameTupleAppender.append(IFrameTupleAccessor tupleAccessor, int tIndex) [COLLABORATORS] param tupleAccessor:IFrameTupleAccessor getBuffer/0,getTupleStartOffset/1,getTupleLength/1 [EXCEPTIONS] declares HyracksDataException [CALLS-INTERNAL] void setFreeDataEndOffse...
/* static context [FOCAL] @Override public int DeletableFrameTupleAppender.append(IFrameTupleAccessor tupleAccessor, int tIndex) [COLLABORATORS] param tupleAccessor:IFrameTupleAccessor getBuffer/0,getTupleStartOffset/1,getTupleLength/1 [EXCEPTIONS] declares HyracksDataException [CALLS-INTERNAL] void setFreeDataEndOffse...
true
ok
{"focal": {"class": "DeletableFrameTupleAppender", "name": "append", "signature": "int append(IFrameTupleAccessor tupleAccessor, int tIndex) throws HyracksDataException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "tupleAccessor", "type": "IFrameTupleAccessor"}, {"name": "tIndex", "type": "in...
31989343_18
class MessageEventsQueryBuilder { public void buildQuery(Endpoint endpoint) { if (this.bounceClasses.size() > 0) { endpoint.addParam("bounce_classes", setAsString(this.bounceClasses, ",")); } if (this.campaignIds.size() > 0) { endpoint.addParam("campaign_ids", setAs...
MessageEventsQueryBuilder queryBuilder = new MessageEventsQueryBuilder(); Endpoint ep = new Endpoint("test"); queryBuilder.buildQuery(ep); String query = ep.toString(); Assert.assertNotNull(query); Assert.assertEquals("/test", query); } }
[FOCAL] public void MessageEventsQueryBuilder.buildQuery(Endpoint endpoint) [CLASS] class MessageEventsQueryBuilder [METRICS] loc=53 cc=14 branches=13 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] String setAsString(Set set, String separator) [CALLS-EXTERNAL] this.bounceClasses.size/0, Endpoint.addParam/2, this...
/* static context [FOCAL] public void MessageEventsQueryBuilder.buildQuery(Endpoint endpoint) [PATH1] if(this.bounceClasses.size() > 0)=T -> if(this.campaignIds.size() > 0)=T -> if(this.events.size() > 0)=T -> if(this.friendlyFroms.size() > 0)=T -> if(StringUtils.isNotEmpty(this.fromDateTime))=T -> if(StringUtils.isNot...
/* static context [FOCAL] public void MessageEventsQueryBuilder.buildQuery(Endpoint endpoint) [PATH1] if(this.bounceClasses.size() > 0)=T -> if(this.campaignIds.size() > 0)=T -> if(this.events.size() > 0)=T -> if(this.friendlyFroms.size() > 0)=T -> if(StringUtils.isNotEmpty(this.fromDateTime))=T -> if(StringUtils.isNot...
true
ok
{"focal": {"class": "MessageEventsQueryBuilder", "name": "buildQuery", "signature": "void buildQuery(Endpoint endpoint)", "start_line": 3, "modifiers": "public", "params": [{"name": "endpoint", "type": "Endpoint"}], "return_type": "void"}, "class_info": {"name": "MessageEventsQueryBuilder", "kind": "class", "modifiers"...
32034982_87
class OpenImmo_1_2_1 extends XmlConverter<OpenImmoDocument, OpenImmoVersion> { protected void upgradeXmlNamespace(Document doc) { //System.out.println( "----------------------------" ); //System.out.println( "DOCUMENT BEFORE CONVERSION:" ); //DocumentUtils.write( doc, System.out ); ...
try { Document doc = buildTransferDocumentForUpgrade(); Element root; String ns; //System.out.println( "----------------------------" ); //System.out.println( "DOCUMENT BEFORE CONVERSION:" ); //DocumentUtils.write( doc, System.out ); ...
[FOCAL] protected void OpenImmo_1_2_1.upgradeXmlNamespace(Document doc) [CLASS] class OpenImmo_1_2_1 extends XmlConverter<OpenImmoDocument, OpenImmoVersion> [METRICS] loc=13 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] XmlUtils.replaceNamespace/2 [DATAFLOW] doc@param->L7 [CLASS-MEMBERS] OpenImm...
/* static context [FOCAL] protected void OpenImmo_1_2_1.upgradeXmlNamespace(Document doc) [CALLS-EXTERNAL] XmlUtils.replaceNamespace/2 */
/* static context [FOCAL] protected void OpenImmo_1_2_1.upgradeXmlNamespace(Document doc) [CALLS-EXTERNAL] XmlUtils.replaceNamespace/2 */ class OpenImmo_1_2_1 extends XmlConverter<OpenImmoDocument, OpenImmoVersion> { protected void upgradeXmlNamespace(Document doc) { //System.out.println( "----------------...
true
ok
{"focal": {"class": "OpenImmo_1_2_1", "name": "upgradeXmlNamespace", "signature": "void upgradeXmlNamespace(Document doc)", "start_line": 3, "modifiers": "protected", "params": [{"name": "doc", "type": "Document"}], "return_type": "void"}, "class_info": {"name": "OpenImmo_1_2_1", "kind": "class", "modifiers": "", "supe...
32083811_15
class VariantParseQuery extends ParseQuery implements Serializable { public String parse(Query query, QueryOptions queryOptions, String viewName) { Set<String> keySet = query.keySet(); for (String key : keySet) { String value = (String) query.get(key); // sanity check ...
String result = "SELECT * FROM test WHERE (id = 'rs587604674' OR id = 'rs587603352') " + "ORDER BY chromosome, start ASC"; Query query = new Query(); query.put("id", "rs587604674,rs587603352"); String test = variantParseQuery.parse(query, null, "test"); assertEquals("S...
[FOCAL] public String VariantParseQuery.parse(Query query, QueryOptions queryOptions, String viewName) [CLASS] class VariantParseQuery extends ParseQuery implements Serializable [METRICS] loc=53 cc=14 branches=3 loops=1 returns=2 throws=1 nesting=2 [CALLS-INTERNAL] void buildQueryString(String viewName, QueryOptions qu...
/* static context [FOCAL] public String VariantParseQuery.parse(Query query, QueryOptions queryOptions, String viewName) [THROWS-WHEN] IllegalArgumentException when foreach(String key : keySet)=T && StringUtils.isEmpty(key) || StringUtils.isEmpty(value) [PATH1] foreach(String key : keySet)=T -> if(StringUtils.isEmpty(k...
/* static context [FOCAL] public String VariantParseQuery.parse(Query query, QueryOptions queryOptions, String viewName) [THROWS-WHEN] IllegalArgumentException when foreach(String key : keySet)=T && StringUtils.isEmpty(key) || StringUtils.isEmpty(value) [PATH1] foreach(String key : keySet)=T -> if(StringUtils.isEmpty(k...
true
ok
{"focal": {"class": "VariantParseQuery", "name": "parse", "signature": "String parse(Query query, QueryOptions queryOptions, String viewName)", "start_line": 3, "modifiers": "public", "params": [{"name": "query", "type": "Query"}, {"name": "queryOptions", "type": "QueryOptions"}, {"name": "viewName", "type": "String"}]...
32098238_5
class Student implements Serializable { public void copyBusinessFieldsFrom(Student student) { this.setAddress(student.getAddress()); this.setBirthDate(student.getBirthDate()); this.setLastName(student.getLastName()); this.setFirstName(student.getFirstName()); this.setPhoneNumber(student.getPhoneNumber()); ...
Student s1 = new Student("Steve", "Hostettler", new Date(), new PhoneNumber("+33698075273")); Student s2 = new Student("John", "Doe", new Date(), new PhoneNumber("+33698075273")); s1.copyBusinessFieldsFrom(s2); Assert.assertEquals("s1=s2", s1, s2); } }
[FOCAL] public void Student.copyBusinessFieldsFrom(Student student) [CLASS] class Student implements Serializable [METRICS] loc=8 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void setAddress(Address pAddress); void setBirthDate(Date pBirthDate); void setFirstName(String pFirstName); void setGen...
/* static context [FOCAL] public void Student.copyBusinessFieldsFrom(Student student) [COLLABORATORS] param student:Student getAddress/0,getBirthDate/0,getLastName/0,getFirstName/0,getPhoneNumber/0,getGender/0 [CALLS-INTERNAL] void setAddress(Address pAddress); void setBirthDate(Date pBirthDate); void setFirstName(Stri...
/* static context [FOCAL] public void Student.copyBusinessFieldsFrom(Student student) [COLLABORATORS] param student:Student getAddress/0,getBirthDate/0,getLastName/0,getFirstName/0,getPhoneNumber/0,getGender/0 [CALLS-INTERNAL] void setAddress(Address pAddress); void setBirthDate(Date pBirthDate); void setFirstName(Stri...
true
ok
{"focal": {"class": "Student", "name": "copyBusinessFieldsFrom", "signature": "void copyBusinessFieldsFrom(Student student)", "start_line": 3, "modifiers": "public", "params": [{"name": "student", "type": "Student"}], "return_type": "void"}, "class_info": {"name": "Student", "kind": "class", "modifiers": "", "superclas...
32104397_1
class KafkaLogAppender extends AppenderSkeleton { public KafkaLogAppender() { } public KafkaLogAppender(); public KafkaLogAppender(Properties props, String topic); @Override public void activateOptions(); @Override protected void append(LoggingEvent event); @Override public void close(...
Properties consumerProps = new Properties(); consumerProps.put("zookeeper.connect", zookeeper); consumerProps.put("group.id", "kafka-log-appender-test"); consumerProps.put("auto.offset.reset", "smallest"); consumerProps.put("schema.registry.url", schemaRegistry); Map<Str...
[FOCAL] public KafkaLogAppender.KafkaLogAppender() [CLASS] class KafkaLogAppender extends AppenderSkeleton [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CLASS-MEMBERS] KafkaLogAppender(); KafkaLogAppender(Properties props, String topic); void activateOptions(); void append(LoggingEvent event); v...
/* static context [FOCAL] public KafkaLogAppender.KafkaLogAppender() */
/* static context [FOCAL] public KafkaLogAppender.KafkaLogAppender() */ class KafkaLogAppender extends AppenderSkeleton { public KafkaLogAppender() { } public KafkaLogAppender(); public KafkaLogAppender(Properties props, String topic); @Override public void activateOptions(); @Override pro...
true
ok
{"focal": {"class": "KafkaLogAppender", "name": "KafkaLogAppender", "signature": "KafkaLogAppender()", "start_line": 3, "modifiers": "public", "params": [], "return_type": null}, "class_info": {"name": "KafkaLogAppender", "kind": "class", "modifiers": "", "superclass": "AppenderSkeleton", "interfaces": null, "fields": ...
32104835_210
class Z80 { public int getRegister(final int reg) { return this.getRegister(reg, false); } public Z80(final Z80CPUBus bus); public Z80(final Z80 cpu); private static int extractX(final int cmndByte); private static int extractY(final int cmndByte); private static int extractZ(final int cmndByte);...
final Z80State state = new Z80State(); state.H = 0x12; state.L = 0x34; final Pair<Z80, Integer> cpu = executeCommand(state, false, 0xE9); assertEquals(0x1234, cpu.getLeft().getRegister(Z80.REG_PC)); assertFlagsNotChanged(state, cpu.getLeft()); assertEquals(4, cpu.getRight().intValue()); ...
[FOCAL] public int Z80.getRegister(int reg) [CLASS] class Z80 [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] int getRegister(int reg, boolean alt) [INPUTS] branches=- | result=reg [DATAFLOW] reg@param->L2 [CLASS-MEMBERS] Z80(Z80CPUBus bus); Z80(Z80 cpu); int extractX(int cmndByte)...
class Z80 { public int getRegister(final int reg) { return this.getRegister(reg, false); } public Z80(final Z80CPUBus bus); public Z80(final Z80 cpu); private static int extractX(final int cmndByte); private static int extractY(final int cmndByte); private static int extractZ(final int cmndByte);...
false
ok
{"focal": {"class": "Z80", "name": "getRegister", "signature": "int getRegister(int reg)", "start_line": 3, "modifiers": "public", "params": [{"name": "reg", "type": "int"}], "return_type": "int"}, "class_info": {"name": "Z80", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "mem...
32181228_26
class KillerTable { final public int getKillerScore(int ply, Move m) { int move = (short)(m.from + (m.to << 6) + (m.promoteTo << 12)); if (ply < ktList.length) { KTEntry ent = ktList[ply]; if (move == ent.move0) { return 4; } else if (move == ent....
System.out.println("getKillerScore"); KillerTable kt = new KillerTable(); Move m1 = new Move(TextIO.getSquare("b1"), TextIO.getSquare("b5"), Piece.EMPTY); Move m2 = new Move(TextIO.getSquare("c1"), TextIO.getSquare("d2"), Piece.EMPTY); Move m3 = new Move(TextIO.getSquare("e1"), T...
[FOCAL] final public int KillerTable.getKillerScore(int ply, Move m) [CLASS] class KillerTable [METRICS] loc=20 cc=7 branches=6 loops=0 returns=5 throws=0 nesting=3 [PATH1] if(ply < ktList.length)=T -> if(move == ent.move0)#1=F -> if(move == ent.move1)#1=F -> if((ply - 2 >= 0) && (ply - 2 < ktList.length))=T -> if(move...
/* static context [FOCAL] final public int KillerTable.getKillerScore(int ply, Move m) [PATH1] if(ply < ktList.length)=T -> if(move == ent.move0)#1=F -> if(move == ent.move1)#1=F -> if((ply - 2 >= 0) && (ply - 2 < ktList.length))=T -> if(move == ent.move0)#2=F -> if(move == ent.move1)#2=T -> return 1 [PATH2] if(ply < k...
/* static context [FOCAL] final public int KillerTable.getKillerScore(int ply, Move m) [PATH1] if(ply < ktList.length)=T -> if(move == ent.move0)#1=F -> if(move == ent.move1)#1=F -> if((ply - 2 >= 0) && (ply - 2 < ktList.length))=T -> if(move == ent.move0)#2=F -> if(move == ent.move1)#2=T -> return 1 [PATH2] if(ply < k...
true
ok
{"focal": {"class": "KillerTable", "name": "getKillerScore", "signature": "int getKillerScore(int ply, Move m)", "start_line": 3, "modifiers": "final public", "params": [{"name": "ply", "type": "int"}, {"name": "m", "type": "Move"}], "return_type": "int"}, "class_info": {"name": "KillerTable", "kind": "class", "modifie...
32182572_7
class RealMatrix { public RealMatrix getTranspose() { code.clearOnline(); rcaller.runAndReturnResultOnline(this.name); int[] dims = rcaller.getParser().getDimensions(this.name); double[][] mat = rcaller.getParser().getAsDoubleMatrix(this.name, dims[0], dims[1]); RealMatrix m...
System.out.println("getTranspose"); double[][] t = rm.getTranspose().getData(); assertEquals(matrix[0][0], t[0][0], delta); assertEquals(matrix[0][1], t[1][0], delta); assertEquals(matrix[1][0], t[0][1], delta); assertEquals(matrix[1][1], t[1][1], delta); } }
[FOCAL] public RealMatrix RealMatrix.getTranspose() [CLASS] class RealMatrix [METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] code.clearOnline/0, rcaller.runAndReturnResultOnline/1, rcaller.getParser().getDimensions/1, rcaller.getParser/0, rcaller.getParser().getAsDoubleMatrix/3, Re...
/* static context [FOCAL] public RealMatrix RealMatrix.getTranspose() [COLLABORATORS] field code clearOnline/0; field rcaller runAndReturnResultOnline/1,getParser/0 [FIELDS] read=name [NEW] RealMatrix [CALLS-EXTERNAL] code.clearOnline/0, rcaller.runAndReturnResultOnline/1, rcaller.getParser().getDimensions/1, rcaller.g...
/* static context [FOCAL] public RealMatrix RealMatrix.getTranspose() [COLLABORATORS] field code clearOnline/0; field rcaller runAndReturnResultOnline/1,getParser/0 [FIELDS] read=name [NEW] RealMatrix [CALLS-EXTERNAL] code.clearOnline/0, rcaller.runAndReturnResultOnline/1, rcaller.getParser().getDimensions/1, rcaller.g...
true
ok
{"focal": {"class": "RealMatrix", "name": "getTranspose", "signature": "RealMatrix getTranspose()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "RealMatrix"}, "class_info": {"name": "RealMatrix", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "matr...
32199895_7
class KanjiUtils { public static String toHalfwidth(final String katakana) { return translate(katakana, KATAKANA_TO_HALFWIDTH, 1); } private KanjiUtils(); public static boolean isHiragana(char c); public static boolean isKatakana(char c); public static String halfwidthToKatakana(fina...
assertEquals("パパ", KanjiUtils.toHalfwidth("パパ")); assertEquals("コンピューター", KanjiUtils.toHalfwidth("コンピューター")); assertEquals("JOZOパパFOO", KanjiUtils.toHalfwidth("JOZOパパFOO")); assertEquals("FOOBARBAZ", KanjiUtils.toHalfwidth("FOOBARBAZ")); } }
[FOCAL] public static String KanjiUtils.toHalfwidth(String katakana) [CLASS] class KanjiUtils [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String translate(String in, Map<? extends String, ? extends String> table, int maxKeyLength) [INPUTS] branches=- | result=katakana [DATAFLOW...
/* static context [FOCAL] public static String KanjiUtils.toHalfwidth(String katakana) [INPUTS] branches=- | result=katakana [CALLS-INTERNAL] String translate(String in, Map<? extends String, ? extends String> table, int maxKeyLength) */
/* static context [FOCAL] public static String KanjiUtils.toHalfwidth(String katakana) [INPUTS] branches=- | result=katakana [CALLS-INTERNAL] String translate(String in, Map<? extends String, ? extends String> table, int maxKeyLength) */ class KanjiUtils { public static String toHalfwidth(final String katakana) { ...
true
ok
{"focal": {"class": "KanjiUtils", "name": "toHalfwidth", "signature": "String toHalfwidth(String katakana)", "start_line": 3, "modifiers": "public static", "params": [{"name": "katakana", "type": "String"}], "return_type": "String"}, "class_info": {"name": "KanjiUtils", "kind": "class", "modifiers": "", "superclass": n...
32199982_635
class CallbackSchedulerImpl implements CallbackScheduler { @Override public <K> void scheduleCallback(K key, long timestamp, ScheduledCallback<K> callback) { this.epochTimeScheduler.setTimer(key, timestamp, callback); } public CallbackSchedulerImpl(EpochTimeScheduler epochTimeScheduler); @Override pub...
@SuppressWarnings("unchecked") ScheduledCallback<String> stringCallback = mock(ScheduledCallback.class); scheduler.scheduleCallback("string_key", 123, stringCallback); verify(epochTimeScheduler).setTimer("string_key", 123, stringCallback); // check some other type of key @SuppressWarnings("unch...
[FOCAL] @Override public void CallbackSchedulerImpl.scheduleCallback(K key, long timestamp, ScheduledCallback<K> callback) [CLASS] class CallbackSchedulerImpl implements CallbackScheduler [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] EpochTimeScheduler.setTimer/3 [FIELDS] read=ep...
/* static context [FOCAL] @Override public void CallbackSchedulerImpl.scheduleCallback(K key, long timestamp, ScheduledCallback<K> callback) [COLLABORATORS] field epochTimeScheduler:EpochTimeScheduler setTimer/3 [FIELDS] read=epochTimeScheduler:EpochTimeScheduler [CALLS-EXTERNAL] EpochTimeScheduler.setTimer/3 */
/* static context [FOCAL] @Override public void CallbackSchedulerImpl.scheduleCallback(K key, long timestamp, ScheduledCallback<K> callback) [COLLABORATORS] field epochTimeScheduler:EpochTimeScheduler setTimer/3 [FIELDS] read=epochTimeScheduler:EpochTimeScheduler [CALLS-EXTERNAL] EpochTimeScheduler.setTimer/3 */ class ...
true
ok
{"focal": {"class": "CallbackSchedulerImpl", "name": "scheduleCallback", "signature": "void scheduleCallback(K key, long timestamp, ScheduledCallback<K> callback)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "key", "type": "K"}, {"name": "timestamp", "type": "long"}, {"name": "callback", "typ...
32203040_6
class ColumnsMask { public ColumnType getCategory(int colNumber) { if (colNumber < columns.size()) { return columns.get(colNumber); } return columns.get(columns.size() - 1); } public ColumnsMask(String str); private static ColumnType charToColumnType(char c); ...
ColumnsMask mask = new ColumnsMask("lc"); assertEquals(ColumnType.LABEL, mask.getCategory(0)); assertEquals(ColumnType.CATEGORICAL, mask.getCategory(30)); assertEquals(ColumnType.CATEGORICAL, mask.getCategory(47)); assertEquals(ColumnType.CATEGORICAL, mask.getCategory(1024)); ...
[FOCAL] public ColumnType ColumnsMask.getCategory(int colNumber) [CLASS] class ColumnsMask [METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] columns.size/0, columns.get/1 [PATH1] if(colNumber < columns.size())=T -> return columns.get(colNumber) [PATH2] if(colNumber < columns.size())=...
/* static context [FOCAL] public ColumnType ColumnsMask.getCategory(int colNumber) [PATH1] if(colNumber < columns.size())=T -> return columns.get(colNumber) [PATH2] if(colNumber < columns.size())=F -> return columns.get(columns.size() - 1) [INPUTS] branches=colNumber | result=colNumber [COLLABORATORS] field columns siz...
/* static context [FOCAL] public ColumnType ColumnsMask.getCategory(int colNumber) [PATH1] if(colNumber < columns.size())=T -> return columns.get(colNumber) [PATH2] if(colNumber < columns.size())=F -> return columns.get(columns.size() - 1) [INPUTS] branches=colNumber | result=colNumber [COLLABORATORS] field columns siz...
true
ok
{"focal": {"class": "ColumnsMask", "name": "getCategory", "signature": "ColumnType getCategory(int colNumber)", "start_line": 3, "modifiers": "public", "params": [{"name": "colNumber", "type": "int"}], "return_type": "ColumnType"}, "class_info": {"name": "ColumnsMask", "kind": "class", "modifiers": "", "superclass": nu...
32216000_20
class NoSpaceBeforeCloseWriter extends XmlWriter { @Override public void clearLineBuffer() { out.clearLineBuffer(); } NoSpaceBeforeCloseWriter(XmlWriter out); @Override public void write(String str); @Override public void write(int c); @Override public void flush(); @Overrid...
writer.clearLineBuffer(); verify(xmlWriter).clearLineBuffer(); } }
[FOCAL] @Override public void NoSpaceBeforeCloseWriter.clearLineBuffer() [CLASS] class NoSpaceBeforeCloseWriter extends XmlWriter [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] out.clearLineBuffer/0 [COLLABORATORS] field out clearLineBuffer/0 [CLASS-MEMBERS] NoSpaceBeforeCloseWrit...
/* static context [FOCAL] @Override public void NoSpaceBeforeCloseWriter.clearLineBuffer() [COLLABORATORS] field out clearLineBuffer/0 [CALLS-EXTERNAL] out.clearLineBuffer/0 */
/* static context [FOCAL] @Override public void NoSpaceBeforeCloseWriter.clearLineBuffer() [COLLABORATORS] field out clearLineBuffer/0 [CALLS-EXTERNAL] out.clearLineBuffer/0 */ class NoSpaceBeforeCloseWriter extends XmlWriter { @Override public void clearLineBuffer() { out.clearLineBuffer(); } ...
true
ok
{"focal": {"class": "NoSpaceBeforeCloseWriter", "name": "clearLineBuffer", "signature": "void clearLineBuffer()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "NoSpaceBeforeCloseWriter", "kind": "class", "modifiers": "", "superclass": "XmlWriter", "inter...
32223373_27
class TcasesCommand { public static void run( Options options) throws Exception { if( options.showVersion()) { System.out.println( getVersion()); return; } logger_.info( "{}", getVersion()); // Identify the system input definition file. File inputDefOption = options.get...
// Given... File inFile = getResourceFile( "run-transform-2"); File outDir = getResourceFile( "run-transform-2-outDir"); File outFile = getResourceFile( "run-transform-2.java"); File outFilePath = new File( outDir, outFile.getName()); File testDefFile = getResourceFile( "run-transform-2-test.xml...
[FOCAL] public static void TcasesCommand.run(Options options) [CLASS] class TcasesCommand [METRICS] loc=260 cc=30 branches=24 loops=0 returns=1 throws=8 nesting=3 [CALLS-INTERNAL] String getProjectName(File inputDefFile); String getVersion() [CALLS-EXTERNAL] Options.showVersion/0, System.out.println/1, logger_.info/2, ...
class TcasesCommand { public static void run( Options options) throws Exception { if( options.showVersion()) { System.out.println( getVersion()); return; } logger_.info( "{}", getVersion()); // Identify the system input definition file. File inputDefOption = options.get...
false
ok
{"focal": {"class": "TcasesCommand", "name": "run", "signature": "void run(Options options) throws Exception", "start_line": 3, "modifiers": "public static", "params": [{"name": "options", "type": "Options"}], "return_type": "void"}, "class_info": {"name": "TcasesCommand", "kind": "class", "modifiers": "", "superclass"...
32223919_0
class Dice { public int roll(){ return roll(iTimes, iFaces) + iModifier; } public Dice(); public Dice(int faces); public Dice(int times, int faces); public Dice(int times, int faces, int modifier); public int getFaces(); public void setFaces(int iFac); public int getTimes(); public void setTimes(int ...
int faces = 20; int rolls = 10000000; //Dice dice = new Dice(1, 20); int[] results = new int[faces]; for (int i=0; i<rolls; i++) { results[Dice.roll(faces)-1]++; } int max=results[0]; int min=max; int total = 0; int diff; int maxDiff = 0; int maxDiffIndex = 0; int expected = rolls / faces;...
[FOCAL] public int Dice.roll() [CLASS] class Dice [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] int roll(int times, int faces) [CLASS-MEMBERS] Dice(); Dice(int faces); Dice(int times, int faces); Dice(int times, int faces, int modifier); int getFaces(); void setFaces(int iFac); i...
/* static context [FOCAL] public int Dice.roll() [CALLS-INTERNAL] int roll(int times, int faces) */
/* static context [FOCAL] public int Dice.roll() [CALLS-INTERNAL] int roll(int times, int faces) */ class Dice { public int roll(){ return roll(iTimes, iFaces) + iModifier; } public Dice(); public Dice(int faces); public Dice(int times, int faces); public Dice(int times, int faces, int modifier); public...
true
ok
{"focal": {"class": "Dice", "name": "roll", "signature": "int roll()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "Dice", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Dice", "kind": "constructor", "...
32235391_3
class AvailablePortProvider { public int nextPort() { Set<Integer> notAvailable = Sets.newHashSet(); int port = from; while (port <= to) { if (!notAvailable.contains(port) && portChecker.apply(port)) { return port; } else { notAvailabl...
AvailablePortProvider portGenerator = new AvailablePortProvider(MIN_PORT_NUMBER, MIN_PORT_NUMBER + 3, p -> p > MAX_PORT_NUMBER); try { portGenerator.nextPort(); fail("Should not reach this line"); } catch (Exception e) { //its okay } } }
[FOCAL] public int AvailablePortProvider.nextPort() [CLASS] class AvailablePortProvider [METRICS] loc=13 cc=3 branches=1 loops=1 returns=1 throws=1 nesting=2 [CALLS-EXTERNAL] Sets.newHashSet/0, Set<Integer>.contains/1, portChecker.apply/1, Set<Integer>.add/1 [NEW] RuntimeException [EXCEPTIONS] throws RuntimeException [...
/* static context [FOCAL] public int AvailablePortProvider.nextPort() [THROWS-WHEN] RuntimeException when port <= to && !(!notAvailable.contains(port) && portChecker.apply(port)) [THROWS-WHEN] RuntimeException when !(port <= to) [PATH1] while(port <= to)=T -> if(!notAvailable.contains(port) && portChecker.apply(port))=...
/* static context [FOCAL] public int AvailablePortProvider.nextPort() [THROWS-WHEN] RuntimeException when port <= to && !(!notAvailable.contains(port) && portChecker.apply(port)) [THROWS-WHEN] RuntimeException when !(port <= to) [PATH1] while(port <= to)=T -> if(!notAvailable.contains(port) && portChecker.apply(port))=...
true
ok
{"focal": {"class": "AvailablePortProvider", "name": "nextPort", "signature": "int nextPort()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "AvailablePortProvider", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": ...
32238204_1
class Helper { public static Role getRole(IdentityManager identityManager, String name) throws IdentityManagementException { if (identityManager == null) { throw MESSAGES.nullArgument("IdentityManager"); } if (isNullOrEmpty(name)) { return null; } I...
assertNull(Helper.getRole(identityManager, "bottle washer")); Role admin = new Role("admin"); Role manager = new Role("manager"); Role user = new Role("user"); identityManager.add(admin); identityManager.add(manager); identityManager.add(user); assertE...
[FOCAL] public static Role Helper.getRole(IdentityManager identityManager, String name) [CLASS] class Helper [METRICS] loc=21 cc=5 branches=4 loops=0 returns=3 throws=2 nesting=2 [CALLS-EXTERNAL] MESSAGES.nullArgument/1, isNullOrEmpty/1 (inherited), IdentityManager.getQueryBuilder/0, queryBuilder.createIdentityQuery(Ro...
/* static context [FOCAL] public static Role Helper.getRole(IdentityManager identityManager, String name) [THROWS-WHEN] MESSAGES.nullArgument("IdentityManager") when identityManager == null [THROWS-WHEN] IdentityManagementException when !(identityManager == null) && !isNullOrEmpty(name) && !roles.isEmpty() && !(roles.s...
/* static context [FOCAL] public static Role Helper.getRole(IdentityManager identityManager, String name) [THROWS-WHEN] MESSAGES.nullArgument("IdentityManager") when identityManager == null [THROWS-WHEN] IdentityManagementException when !(identityManager == null) && !isNullOrEmpty(name) && !roles.isEmpty() && !(roles.s...
true
ok
{"focal": {"class": "Helper", "name": "getRole", "signature": "Role getRole(IdentityManager identityManager, String name) throws IdentityManagementException", "start_line": 3, "modifiers": "public static", "params": [{"name": "identityManager", "type": "IdentityManager"}, {"name": "name", "type": "String"}], "return_ty...
32257863_84
class FilmwebPlugin extends ImdbPlugin { protected boolean updateMediaInfo(Movie movie, String filmwebUrl) { boolean returnValue = Boolean.TRUE; String xml = getPage(filmwebUrl); if (StringUtils.isBlank(xml)) { return Boolean.FALSE; } if (HTMLTools.extr...
LOG.info("testUpdateMediaInfoYear"); Movie movie = new Movie(); movie.setId(FilmwebPlugin.FILMWEB_PLUGIN_ID, "http://www.filmweb.pl/Seksmisja"); filmwebPlugin.updateMediaInfo(movie, movie.getId(FilmwebPlugin.FILMWEB_PLUGIN_ID)); assertEquals("1983", movie.getYear()); } }
[FOCAL] protected boolean FilmwebPlugin.updateMediaInfo(Movie movie, String filmwebUrl) [CLASS] class FilmwebPlugin extends ImdbPlugin [METRICS] loc=118 cc=28 branches=26 loops=1 returns=3 throws=0 nesting=3 [CALLS-INTERNAL] String getPage(String filmwebUrl); boolean scanCastInformation(Movie movie, String xmlCast); bo...
/* static context [FOCAL] protected boolean FilmwebPlugin.updateMediaInfo(Movie movie, String filmwebUrl) [CALLS-INTERNAL] String getPage(String filmwebUrl); boolean scanCastInformation(Movie movie, String xmlCast); boolean scanCrewInformation(Movie movie, String xmlCrew); void scanTVShowTitles(Movie movie) [NEW] Array...
/* static context [FOCAL] protected boolean FilmwebPlugin.updateMediaInfo(Movie movie, String filmwebUrl) [CALLS-INTERNAL] String getPage(String filmwebUrl); boolean scanCastInformation(Movie movie, String xmlCast); boolean scanCrewInformation(Movie movie, String xmlCrew); void scanTVShowTitles(Movie movie) [NEW] Array...
true
ok
{"focal": {"class": "FilmwebPlugin", "name": "updateMediaInfo", "signature": "boolean updateMediaInfo(Movie movie, String filmwebUrl)", "start_line": 3, "modifiers": "protected", "params": [{"name": "movie", "type": "Movie"}, {"name": "filmwebUrl", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "...
32289221_0
class ResourceKeyFormatter { public String formatKey(@NonNull final String name, @Nullable final String family) { if (TextUtils.isEmpty(family)) { return name; } else { return family.concat("_").concat(name); } } public String for...
assertEquals(KEY, mFormatter.formatKey(KEY, null)); assertEquals(FAMILY + "_" + KEY, mFormatter.formatKey(KEY, FAMILY)); } }
[FOCAL] public String ResourceKeyFormatter.formatKey(String name, String family) [CLASS] class ResourceKeyFormatter [METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] TextUtils.isEmpty/1, family.concat("_").concat/1, String.concat/1 [PATH1] if(TextUtils.isEmpty(family))=T -> return na...
/* static context [FOCAL] public String ResourceKeyFormatter.formatKey(String name, String family) [PATH1] if(TextUtils.isEmpty(family))=T -> return name [PATH2] if(TextUtils.isEmpty(family))=F -> return family.concat("_").concat(name) [INPUTS] branches=family | result=family, name [CALLS-EXTERNAL] TextUtils.isEmpty/1,...
/* static context [FOCAL] public String ResourceKeyFormatter.formatKey(String name, String family) [PATH1] if(TextUtils.isEmpty(family))=T -> return name [PATH2] if(TextUtils.isEmpty(family))=F -> return family.concat("_").concat(name) [INPUTS] branches=family | result=family, name [CALLS-EXTERNAL] TextUtils.isEmpty/1,...
true
ok
{"focal": {"class": "ResourceKeyFormatter", "name": "formatKey", "signature": "String formatKey(String name, String family)", "start_line": 3, "modifiers": "public", "params": [{"name": "name", "type": "String"}, {"name": "family", "type": "String"}], "return_type": "String"}, "class_info": {"name": "ResourceKeyFormatt...
32310721_110
class AgeTag extends TagSupport { protected static String getAsAgeString(final Date start, final Date stop) { if (start == null || stop == null) { return ""; } final String s = DurationFormatUtils.formatDurationWords(stop.getTime() - start.getTime(), true, true); final Matcher m = PATTERN.match...
final Calendar start = new GregorianCalendar(2007, 0, 1, 0, 0, 0); final Calendar stop = (Calendar) start.clone(); stop.add(Calendar.SECOND, 25); assertEquals("25 seconds", AgeTag.getAsAgeString(start.getTime(), stop.getTime())); stop.add(Calendar.MINUTE, 31); assertEquals("31 minutes", AgeTag....
[FOCAL] protected static String AgeTag.getAsAgeString(Date start, Date stop) [CLASS] class AgeTag extends TagSupport [METRICS] loc=9 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] DurationFormatUtils.formatDurationWords/3, Date.getTime/0, PATTERN.matcher/1, Matcher.matches/0, Matcher.group/1 [PAT...
/* static context [FOCAL] protected static String AgeTag.getAsAgeString(Date start, Date stop) [PATH1] if(start == null || stop == null)=T -> return "" [PATH2] if(start == null || stop == null)=F -> return m.group(1) [INPUTS] branches=start, stop | result=start, stop [COLLABORATORS] param stop:Date getTime/0; param sta...
/* static context [FOCAL] protected static String AgeTag.getAsAgeString(Date start, Date stop) [PATH1] if(start == null || stop == null)=T -> return "" [PATH2] if(start == null || stop == null)=F -> return m.group(1) [INPUTS] branches=start, stop | result=start, stop [COLLABORATORS] param stop:Date getTime/0; param sta...
true
ok
{"focal": {"class": "AgeTag", "name": "getAsAgeString", "signature": "String getAsAgeString(Date start, Date stop)", "start_line": 3, "modifiers": "protected static", "params": [{"name": "start", "type": "Date"}, {"name": "stop", "type": "Date"}], "return_type": "String"}, "class_info": {"name": "AgeTag", "kind": "clas...
32311287_8
class Pagination { public int[] generateSuggestedPages(int count) { Preconditions.checkState(count > 3,"the count of pages must be more than 3"); int pages = getPages(); if (1 == pages) { return new int[] { 0 }; } int page = getPage(); // current page. ...
Pagination p = new Pagination(168,75,15); Assertions.assertThat(p.generateSuggestedPages(9)).isEqualTo(new int[] {0,2,3,4,5,6,7,8,11}); } }
[FOCAL] public int[] Pagination.generateSuggestedPages(int count) [CLASS] class Pagination [METRICS] loc=54 cc=7 branches=4 loops=2 returns=3 throws=0 nesting=3 [CALLS-INTERNAL] int getPage(); int getPages(); int[] linearSeries(int count); void fanFillLeft(int[] result, int startI); void fanFillRight(int[] result, int ...
/* static context [FOCAL] public int[] Pagination.generateSuggestedPages(int count) [PATH1] if(1 == pages)=F -> if(pages <= count)=F -> if(page < middleI)=F -> if(remainder <= (result.length - middleI) - 1)=T -> for(i < remainder)=T -> exit loop -> return result [PATH2] if(1 == pages)=T -> return new int[] { 0 } [PATH3...
/* static context [FOCAL] public int[] Pagination.generateSuggestedPages(int count) [PATH1] if(1 == pages)=F -> if(pages <= count)=F -> if(page < middleI)=F -> if(remainder <= (result.length - middleI) - 1)=T -> for(i < remainder)=T -> exit loop -> return result [PATH2] if(1 == pages)=T -> return new int[] { 0 } [PATH3...
true
ok
{"focal": {"class": "Pagination", "name": "generateSuggestedPages", "signature": "int[] generateSuggestedPages(int count)", "start_line": 3, "modifiers": "public", "params": [{"name": "count", "type": "int"}], "return_type": "int[]"}, "class_info": {"name": "Pagination", "kind": "class", "modifiers": "", "superclass": ...
32312076_16
class JToggl { public PagedResult getDetailedReport(PagedReportsParameter parameters) { String response = fetch(REPORTS_ENDPOINT + "/details?" + parameters.toParamList()); return new PagedResult(response); } public JToggl(String apiToken); public JToggl(String user, String password);...
PagedResult detailedReport = jToggl.getDetailedReport((PagedReportsParameter) new PagedReportsParameter(workspace.getId(), "jtoggl-integration-test") .setSince("2011-11-15") .setUntil("2011-11-15") .setProjectIds(Collections.singleton(project.getId()))); ...
[FOCAL] public PagedResult JToggl.getDetailedReport(PagedReportsParameter parameters) [CLASS] class JToggl [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String fetch(String url) [CALLS-EXTERNAL] PagedReportsParameter.toParamList/0 [NEW] PagedResult [INPUTS] branches=- | result=pa...
/* static context [FOCAL] public PagedResult JToggl.getDetailedReport(PagedReportsParameter parameters) [INPUTS] branches=- | result=parameters [COLLABORATORS] param parameters:PagedReportsParameter toParamList/0 [CALLS-INTERNAL] String fetch(String url) [NEW] PagedResult [CALLS-EXTERNAL] PagedReportsParameter.toParamL...
/* static context [FOCAL] public PagedResult JToggl.getDetailedReport(PagedReportsParameter parameters) [INPUTS] branches=- | result=parameters [COLLABORATORS] param parameters:PagedReportsParameter toParamList/0 [CALLS-INTERNAL] String fetch(String url) [NEW] PagedResult [CALLS-EXTERNAL] PagedReportsParameter.toParamL...
true
ok
{"focal": {"class": "JToggl", "name": "getDetailedReport", "signature": "PagedResult getDetailedReport(PagedReportsParameter parameters)", "start_line": 3, "modifiers": "public", "params": [{"name": "parameters", "type": "PagedReportsParameter"}], "return_type": "PagedResult"}, "class_info": {"name": "JToggl", "kind": ...
32332642_2
class PathListener implements DataTreeChangeListener<Flow> { @Override public void onDataTreeChanged(@Nonnull Collection<DataTreeModification<Flow>> changes) { if (changes == null) { LOG.info("This line should never be reached because of @Nonnull."); return; } fo...
try { Collection<DataTreeModification<Flow>> nullChanges = null; pathListener1.onDataTreeChanged(nullChanges); pathListener2.onDataTreeChanged(nullChanges); } catch (Exception e) { Assert.assertEquals(IllegalArgumentException.class, e.getClass()); ...
[FOCAL] @Override public void PathListener.onDataTreeChanged(Collection<DataTreeModification<Flow>> changes) [CLASS] class PathListener implements DataTreeChangeListener<Flow> [METRICS] loc=26 cc=8 branches=4 loops=1 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] void onFlowRuleCreated(InstanceIdentifier<Flow> iid, Flow...
/* static context [FOCAL] @Override public void PathListener.onDataTreeChanged(Collection<DataTreeModification<Flow>> changes) [PATH1] if(changes == null)=F -> foreach(DataTreeModification<Flow> change : changes)=T -> if(change == null)=F -> if(iid.firstKeyOf(Table.class).getId().equals(DEFAULT_TABLE_ID))=T -> switch(r...
/* static context [FOCAL] @Override public void PathListener.onDataTreeChanged(Collection<DataTreeModification<Flow>> changes) [PATH1] if(changes == null)=F -> foreach(DataTreeModification<Flow> change : changes)=T -> if(change == null)=F -> if(iid.firstKeyOf(Table.class).getId().equals(DEFAULT_TABLE_ID))=T -> switch(r...
true
ok
{"focal": {"class": "PathListener", "name": "onDataTreeChanged", "signature": "void onDataTreeChanged(Collection<DataTreeModification<Flow>> changes)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "changes", "type": "Collection<DataTreeModification<Flow>>"}], "return_type": "void"}, "class_info...
32354897_8
class SimpleCell implements Cell { @Override public boolean isDead() { return state == STATE_DEAD; } public SimpleCell(int x, int y, int state); @Override public void setOverseer(Overseer overseer); @Override public void reset(int state); @Override public long getId(); @Overr...
assertThat(cell.isDead()).isFalse(); cell.setState(Cell.STATE_DEAD); assertThat(cell.isDead()).isTrue(); } }
[FOCAL] @Override public boolean SimpleCell.isDead() [CLASS] class SimpleCell implements Cell [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] SimpleCell(int x, int y, int state); void setOverseer(Overseer overseer); void reset(int state); long getId(); int getX(); int getY(); int ge...
/* static context [FOCAL] @Override public boolean SimpleCell.isDead() */
/* static context [FOCAL] @Override public boolean SimpleCell.isDead() */ class SimpleCell implements Cell { @Override public boolean isDead() { return state == STATE_DEAD; } public SimpleCell(int x, int y, int state); @Override public void setOverseer(Overseer overseer); @Override p...
true
ok
{"focal": {"class": "SimpleCell", "name": "isDead", "signature": "boolean isDead()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "boolean"}, "class_info": {"name": "SimpleCell", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Cell", "fields": [{"name": "cell", "ty...
32377028_115
class MemoryAsyncLogDataStore implements AsyncLogDataStore { @Override public int getLimit() { try { return service.submit(new OperationGetLimit(logDataStore)).get(); } catch (InterruptedException | ExecutionException e) { e.printStackTrace(); } return 0; } public MemoryAsyncLogDa...
store.setLimit(100); AssertJUnit.assertEquals(100, store.getLimit()); } }
[FOCAL] @Override public int MemoryAsyncLogDataStore.getLimit() [CLASS] class MemoryAsyncLogDataStore implements AsyncLogDataStore [METRICS] loc=9 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] service.submit(new OperationGetLimit(logDataStore)).get/0, service.submit/1, InterruptedException | Exe...
/* static context [FOCAL] @Override public int MemoryAsyncLogDataStore.getLimit() [PATH1] try-body throws -> return 0 [PATH2] return service.submit(new OperationGetLimit(logDataStore)).get() [COLLABORATORS] field service submit/1 [EXCEPTIONS] catches InterruptedException | ExecutionException e [NEW] OperationGetLimit [...
/* static context [FOCAL] @Override public int MemoryAsyncLogDataStore.getLimit() [PATH1] try-body throws -> return 0 [PATH2] return service.submit(new OperationGetLimit(logDataStore)).get() [COLLABORATORS] field service submit/1 [EXCEPTIONS] catches InterruptedException | ExecutionException e [NEW] OperationGetLimit [...
true
ok
{"focal": {"class": "MemoryAsyncLogDataStore", "name": "getLimit", "signature": "int getLimit()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "MemoryAsyncLogDataStore", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "AsyncLogDataStor...
32398593_45
class OperatorSwitchThenUnsubscribe implements Operator<T, Observable<? extends T>> { @SuppressWarnings({ "unchecked" }) public static <T> OperatorSwitchThenUnsubscribe<T> instance() { return (OperatorSwitchThenUnsubscribe<T>)Holder.INSTANCE; } OperatorSwitchThenUnsubscribe(boolean delayErro...
for (int i = 1; i < 1024; i *= 2) { System.out.println("switchAsyncHeavily >> " + i); final Queue<Throwable> q = new ConcurrentLinkedQueue<Throwable>(); final long[] lastSeen = { 0L }; final int j = i; TestSubscriber<Integer> ts = new TestSubscriber...
[FOCAL] @SuppressWarnings({ "unchecked" }) public static OperatorSwitchThenUnsubscribe<T> OperatorSwitchThenUnsubscribe.instance() [CLASS] class OperatorSwitchThenUnsubscribe implements Operator<T, Observable<? extends T>> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] OperatorSwit...
/* static context [FOCAL] @SuppressWarnings({ "unchecked" }) public static OperatorSwitchThenUnsubscribe<T> OperatorSwitchThenUnsubscribe.instance() */
/* static context [FOCAL] @SuppressWarnings({ "unchecked" }) public static OperatorSwitchThenUnsubscribe<T> OperatorSwitchThenUnsubscribe.instance() */ class OperatorSwitchThenUnsubscribe implements Operator<T, Observable<? extends T>> { @SuppressWarnings({ "unchecked" }) public static <T> OperatorSwitchThenUn...
true
ok
{"focal": {"class": "OperatorSwitchThenUnsubscribe", "name": "instance", "signature": "OperatorSwitchThenUnsubscribe<T> instance()", "start_line": 3, "modifiers": "@SuppressWarnings({ \"unchecked\" }) public static", "params": [], "return_type": "OperatorSwitchThenUnsubscribe<T>"}, "class_info": {"name": "OperatorSwitc...
32399379_5
class DynamoHolder { public void clearAll() { mDynamoMap.clear(); } public DynamoHolder(int maxSize); public T getDynamo(String meta, DynamoFactory<T> dynamoFactory); public void clear(String meta); public Map<String, T> getAll(); } class DynamoHolderTest { @Test publi...
final String DYNAMO_NAME = "testMeta1"; DynamoHolder<TestDynamo> testDynamoHolder = new DynamoHolder<TestDynamo>(2); DynamoHolder.DynamoFactory dynamoFactory = new DynamoHolder.DynamoFactory<TestDynamo>() { @Override public TestDynamo buildDynamo() { ...
[FOCAL] public void DynamoHolder.clearAll() [CLASS] class DynamoHolder [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] mDynamoMap.clear/0 [COLLABORATORS] field mDynamoMap clear/0 [CLASS-MEMBERS] DynamoHolder(int maxSize); T getDynamo(String meta, DynamoFactory<T> dynamoFactory); vo...
/* static context [FOCAL] public void DynamoHolder.clearAll() [COLLABORATORS] field mDynamoMap clear/0 [CALLS-EXTERNAL] mDynamoMap.clear/0 */
/* static context [FOCAL] public void DynamoHolder.clearAll() [COLLABORATORS] field mDynamoMap clear/0 [CALLS-EXTERNAL] mDynamoMap.clear/0 */ class DynamoHolder { public void clearAll() { mDynamoMap.clear(); } public DynamoHolder(int maxSize); public T getDynamo(String meta, DynamoFactor...
true
ok
{"focal": {"class": "DynamoHolder", "name": "clearAll", "signature": "void clearAll()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "DynamoHolder", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Dynam...
32403249_7
class MavenArtifactDescriptor { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof MavenArtifactDescriptor)) { return false; } return this.mavenGav().equals(((MavenArtifactDescriptor) obj).mavenGa...
MavenArtifactDescriptor left = MavenArtifactDescriptor.build() .groupId("org.wildfly.swarm") .artifactId("fish") .version("1.0").build(); MavenArtifactDescriptor right = MavenArtifactDescriptor.build() .groupId("org.wildfly.swarm") ...
[FOCAL] @Override public boolean MavenArtifactDescriptor.equals(Object obj) [CLASS] class MavenArtifactDescriptor [METRICS] loc=11 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1 [CALLS-INTERNAL] String mavenGav() [CALLS-EXTERNAL] this.mavenGav().equals/1, ((MavenArtifactDescriptor) obj).mavenGav/0 [PATH1] if(obj ...
/* static context [FOCAL] @Override public boolean MavenArtifactDescriptor.equals(Object obj) [PATH1] if(obj == this)=F -> if(!(obj instanceof MavenArtifactDescriptor))=T -> return false [PATH2] if(obj == this)=T -> return true [PATH3] if(obj == this)=F -> if(!(obj instanceof MavenArtifactDescriptor))=F -> return this....
/* static context [FOCAL] @Override public boolean MavenArtifactDescriptor.equals(Object obj) [PATH1] if(obj == this)=F -> if(!(obj instanceof MavenArtifactDescriptor))=T -> return false [PATH2] if(obj == this)=T -> return true [PATH3] if(obj == this)=F -> if(!(obj instanceof MavenArtifactDescriptor))=F -> return this....
true
ok
{"focal": {"class": "MavenArtifactDescriptor", "name": "equals", "signature": "boolean equals(Object obj)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "obj", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "MavenArtifactDescriptor", "kind": "class", "modifiers": "", "sup...
32407177_7
class DirectoryTree { public void setRootDirectoryAndNotify(File rootDirectory){ this.root = rootDirectory; bus.post(new CurrentRootDirectoryChangedEvent(rootDirectory)); } public DirectoryTree(EventBus bus); public void setParentDirectory(File parentDirectory); public File getRo...
File mockRootDirectory = mock(File.class); CurrentRootDirectoryChangedEvent expectedEvent = new CurrentRootDirectoryChangedEvent(mockRootDirectory); sut.setRootDirectoryAndNotify(mockRootDirectory); verify(mockBus).post(eq(expectedEvent)); } }
[FOCAL] public void DirectoryTree.setRootDirectoryAndNotify(File rootDirectory) [CLASS] class DirectoryTree [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] bus.post/1 [NEW] CurrentRootDirectoryChangedEvent [FIELDS] write=root [COLLABORATORS] field bus post/1 [STATE] root via getRoo...
/* static context [FOCAL] public void DirectoryTree.setRootDirectoryAndNotify(File rootDirectory) [COLLABORATORS] field bus post/1 [STATE] root via getRoot() [FIELDS] write=root [NEW] CurrentRootDirectoryChangedEvent [CALLS-EXTERNAL] bus.post/1 */
/* static context [FOCAL] public void DirectoryTree.setRootDirectoryAndNotify(File rootDirectory) [COLLABORATORS] field bus post/1 [STATE] root via getRoot() [FIELDS] write=root [NEW] CurrentRootDirectoryChangedEvent [CALLS-EXTERNAL] bus.post/1 */ class DirectoryTree { public void setRootDirectoryAndNotify(File ro...
true
ok
{"focal": {"class": "DirectoryTree", "name": "setRootDirectoryAndNotify", "signature": "void setRootDirectoryAndNotify(File rootDirectory)", "start_line": 3, "modifiers": "public", "params": [{"name": "rootDirectory", "type": "File"}], "return_type": "void"}, "class_info": {"name": "DirectoryTree", "kind": "class", "mo...
32427215_54
class TemplateParser { public TemplateModel parse(File f) throws IOException, ParserException { if (!f.exists() || !f.canRead()) { throw new IOException("File cannot read or does not exist [" + f + "]"); } TemplateIdentity identity = parseIdentity(this.configuration.get...
TemplateParser parser = createParser(); File f = findTemplate("rocker/parser/WithBlockMultipleArgumentsNullSafeFails.rocker.html"); try { parser.parse(f); fail("Expected ParserException"); } catch (ParserException e) { assertThat(e.getMessage(...
[FOCAL] public TemplateModel TemplateParser.parse(File f) [CLASS] class TemplateParser [METRICS] loc=11 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] TemplateIdentity parseIdentity(File baseDirectory, File templateFile); TemplateModel parse(ANTLRInputStream input, String packageName, String temp...
/* static context [FOCAL] public TemplateModel TemplateParser.parse(File f) [THROWS-WHEN] IOException when !f.exists() || !f.canRead() [PATH1] if(!f.exists() || !f.canRead())=T -> throw new IOException("File cannot read or does not exist [" + f + "]") [PATH2] if(!f.exists() || !f.canRead())=F -> return parse(input, ide...
/* static context [FOCAL] public TemplateModel TemplateParser.parse(File f) [THROWS-WHEN] IOException when !f.exists() || !f.canRead() [PATH1] if(!f.exists() || !f.canRead())=T -> throw new IOException("File cannot read or does not exist [" + f + "]") [PATH2] if(!f.exists() || !f.canRead())=F -> return parse(input, ide...
true
ok
{"focal": {"class": "TemplateParser", "name": "parse", "signature": "TemplateModel parse(File f) throws IOException, ParserException", "start_line": 3, "modifiers": "public", "params": [{"name": "f", "type": "File"}], "return_type": "TemplateModel"}, "class_info": {"name": "TemplateParser", "kind": "class", "modifiers"...
32445517_0
class TemplateEngineRocker implements TemplateEngine { @Override public void invoke(Context context, Result result) { try { doInvoke(context, result); } catch (CompileDiagnosticException e) { throwRenderingException(context, result, e); } catch (ParserException e...
RockerModel model = com.fizzed.ninja.rocker.views.common_error.template(new Message("Hello!")); when(context.getContextPath()).thenReturn("/context"); when(result.getRenderable()).thenReturn(model); String out = invoke(context, result); assertThat(out, ...
[FOCAL] @Override public void TemplateEngineRocker.invoke(Context context, Result result) [CLASS] class TemplateEngineRocker implements TemplateEngine [METRICS] loc=12 cc=4 branches=0 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] void doInvoke(Context context, Result result); void throwRenderingException(Contex...
/* static context [FOCAL] @Override public void TemplateEngineRocker.invoke(Context context, Result result) [PATH1] try-body throws [EXCEPTIONS] catches CompileDiagnosticException e, ParserException e, RenderingException e [CALLS-INTERNAL] void doInvoke(Context context, Result result); void throwRenderingException(Cont...
/* static context [FOCAL] @Override public void TemplateEngineRocker.invoke(Context context, Result result) [PATH1] try-body throws [EXCEPTIONS] catches CompileDiagnosticException e, ParserException e, RenderingException e [CALLS-INTERNAL] void doInvoke(Context context, Result result); void throwRenderingException(Cont...
true
ok
{"focal": {"class": "TemplateEngineRocker", "name": "invoke", "signature": "void invoke(Context context, Result result)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "context", "type": "Context"}, {"name": "result", "type": "Result"}], "return_type": "void"}, "class_info": {"name": "TemplateEn...
32447005_3
class Sentence implements AbstractServerSocket<Sentence> { @Override public Sentence send(String event, Object data) { return execute(new SendAction(event, data)); } Sentence(Server server, ServerSocketPredicate predicate); public Sentence find(ServerSocketPredicate predicate); public Sentence exec...
ServerSocket socket = mock(ServerSocket.class); Server server = new DefaultServer() { @Override public Server find(ServerSocketPredicate predicate, SerializableAction<ServerSocket> action) { action.on(socket); return this; } }; server.find(NOOP_PREDICATE).send("event");...
[FOCAL] @Override public Sentence Sentence.send(String event, Object data) [CLASS] class Sentence implements AbstractServerSocket<Sentence> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Sentence execute(SerializableAction<ServerSocket> action) [NEW] SendAction [INPUTS] branches=-...
/* static context [FOCAL] @Override public Sentence Sentence.send(String event, Object data) [INPUTS] branches=- | result=data, event [CALLS-INTERNAL] Sentence execute(SerializableAction<ServerSocket> action) [NEW] SendAction */
/* static context [FOCAL] @Override public Sentence Sentence.send(String event, Object data) [INPUTS] branches=- | result=data, event [CALLS-INTERNAL] Sentence execute(SerializableAction<ServerSocket> action) [NEW] SendAction */ class Sentence implements AbstractServerSocket<Sentence> { @Override public Sentence s...
true
ok
{"focal": {"class": "Sentence", "name": "send", "signature": "Sentence send(String event, Object data)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "event", "type": "String"}, {"name": "data", "type": "Object"}], "return_type": "Sentence"}, "class_info": {"name": "Sentence", "kind": "class", ...
32447381_27
class Vm { public String getUid() { return uid; } public Vm( int id, int userId, double mips, int numberOfPes, int ram, long bw, long size, String vmm, CloudletScheduler cloudletScheduler); public double updateVmProcessing(double currentTime, List<Double> mipsShare); public List<Do...
assertEquals(USER_ID + "-" + ID, vm.getUid()); } }
[FOCAL] public String Vm.getUid() [CLASS] class Vm [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Vm(int id, int userId, double mips, int numberOfPes, int ram, long bw, long size, String vmm, CloudletScheduler cloudletScheduler); double updateVmProcessing(double currentTime, List<D...
/* static context [FOCAL] public String Vm.getUid() */
/* static context [FOCAL] public String Vm.getUid() */ class Vm { public String getUid() { return uid; } public Vm( int id, int userId, double mips, int numberOfPes, int ram, long bw, long size, String vmm, CloudletScheduler cloudletScheduler); public double updateVmProcessing(doubl...
true
ok
{"focal": {"class": "Vm", "name": "getUid", "signature": "String getUid()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "Vm", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "ID", "type": "int", "modifiers": "privat...
32461606_20
class DefaultOntology implements Ontology { @Override public boolean contains(Rule rule) { return this.map.containsValue(rule); } public DefaultOntology(); public DefaultOntology(RuleSet rules); public DefaultOntology(CloseableIterator<Object> parser); @Override public Set<String> getRuleNames(); @Overr...
// given Ontology onto = new DefaultOntology(); onto.add(r1); // when boolean b = onto.contains(r1); // then Assert.assertTrue(b); } }
[FOCAL] @Override public boolean DefaultOntology.contains(Rule rule) [CLASS] class DefaultOntology implements Ontology [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] this.map.containsValue/1 [FIELDS] read=map [INPUTS] branches=- | result=rule [COLLABORATORS] field map containsValu...
/* static context [FOCAL] @Override public boolean DefaultOntology.contains(Rule rule) [INPUTS] branches=- | result=rule [COLLABORATORS] field map containsValue/1 [FIELDS] read=map [CALLS-EXTERNAL] this.map.containsValue/1 */
/* static context [FOCAL] @Override public boolean DefaultOntology.contains(Rule rule) [INPUTS] branches=- | result=rule [COLLABORATORS] field map containsValue/1 [FIELDS] read=map [CALLS-EXTERNAL] this.map.containsValue/1 */ class DefaultOntology implements Ontology { @Override public boolean contains(Rule rule) { ...
true
ok
{"focal": {"class": "DefaultOntology", "name": "contains", "signature": "boolean contains(Rule rule)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "rule", "type": "Rule"}], "return_type": "boolean"}, "class_info": {"name": "DefaultOntology", "kind": "class", "modifiers": "", "superclass": null...
32461864_18
class BaseEntity implements Serializable { public void setId(String id) { this.id = id; firePropertyChange(); } public BaseEntity(String name, String description); public BaseEntity(); public void addPropertyChangeListener(PropertyChangeListener listener); public void remove...
entity.setId("1234"); assertEquals("1234", entity.getId()); } }
[FOCAL] public void BaseEntity.setId(String id) [CLASS] class BaseEntity implements Serializable [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void firePropertyChange() [FIELDS] write=id [STATE] id via getId() [DATAFLOW] id@param->L2 [CLASS-MEMBERS] BaseEntity(String name, String...
/* static context [FOCAL] public void BaseEntity.setId(String id) [STATE] id via getId() [CALLS-INTERNAL] void firePropertyChange() [FIELDS] write=id */
/* static context [FOCAL] public void BaseEntity.setId(String id) [STATE] id via getId() [CALLS-INTERNAL] void firePropertyChange() [FIELDS] write=id */ class BaseEntity implements Serializable { public void setId(String id) { this.id = id; firePropertyChange(); } public BaseEntity(String...
true
ok
{"focal": {"class": "BaseEntity", "name": "setId", "signature": "void setId(String id)", "start_line": 3, "modifiers": "public", "params": [{"name": "id", "type": "String"}], "return_type": "void"}, "class_info": {"name": "BaseEntity", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Serializable", ...
32463056_14
class FilteringPluginSink implements PluginSink { @Override public void sendMetric(final Metric metric) { if (filter.matchesMetric(metric)) { sink.sendMetric(metric); } } public FilteringPluginSink(final Filter filter); @Override public void init(); @Override publ...
sink.filter = new NotFilter(new MatchKey(metric.getKey())); doNothing().when(childSink).sendMetric(metric); ArgumentCaptor<Metric> captor = ArgumentCaptor.forClass(Metric.class); sink.sendMetric(metric); verify(childSink, times(0)).sendMetric(captor.capture()); } }
[FOCAL] @Override public void FilteringPluginSink.sendMetric(Metric metric) [CLASS] class FilteringPluginSink implements PluginSink [METRICS] loc=6 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] filter.matchesMetric/1, FilteringPluginSink.sendMetric/1 [FIELDS] read=sink:FilteringPluginSink [PATH1...
/* static context [FOCAL] @Override public void FilteringPluginSink.sendMetric(Metric metric) [PATH1] if(filter.matchesMetric(metric))=T [PATH2] if(filter.matchesMetric(metric))=F [INPUTS] branches=metric | result=- [COLLABORATORS] field filter matchesMetric/1; field sink:FilteringPluginSink sendMetric/1 [FIELDS] read=...
/* static context [FOCAL] @Override public void FilteringPluginSink.sendMetric(Metric metric) [PATH1] if(filter.matchesMetric(metric))=T [PATH2] if(filter.matchesMetric(metric))=F [INPUTS] branches=metric | result=- [COLLABORATORS] field filter matchesMetric/1; field sink:FilteringPluginSink sendMetric/1 [FIELDS] read=...
true
ok
{"focal": {"class": "FilteringPluginSink", "name": "sendMetric", "signature": "void sendMetric(Metric metric)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "metric", "type": "Metric"}], "return_type": "void"}, "class_info": {"name": "FilteringPluginSink", "kind": "class", "modifiers": "", "sup...
32470641_13
class MethodSignatureFormatter extends Formatter<ExecutableElement> { @Override public String format(ExecutableElement method) { return format(method, Optional.<DeclaredType>absent()); } MethodSignatureFormatter(Types types); public String format(ExecutableElement method, Optional<DeclaredType> contain...
Elements elements = compilationRule.getElements(); TypeElement inner = elements.getTypeElement(InnerClass.class.getCanonicalName()); ExecutableElement method = Iterables.getOnlyElement(methodsIn(inner.getEnclosedElements())); String formatted = new MethodSignatureFormatter(compilationRule.getTypes()).fo...
[FOCAL] @Override public String MethodSignatureFormatter.format(ExecutableElement method) [CLASS] class MethodSignatureFormatter extends Formatter<ExecutableElement> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String format(ExecutableElement method, Optional<DeclaredType> conta...
/* static context [FOCAL] @Override public String MethodSignatureFormatter.format(ExecutableElement method) [INPUTS] branches=- | result=method [CALLS-INTERNAL] String format(ExecutableElement method, Optional<DeclaredType> container) [CALLS-EXTERNAL] Optional.absent/0 */
/* static context [FOCAL] @Override public String MethodSignatureFormatter.format(ExecutableElement method) [INPUTS] branches=- | result=method [CALLS-INTERNAL] String format(ExecutableElement method, Optional<DeclaredType> container) [CALLS-EXTERNAL] Optional.absent/0 */ class MethodSignatureFormatter extends Formatte...
true
ok
{"focal": {"class": "MethodSignatureFormatter", "name": "format", "signature": "String format(ExecutableElement method)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "method", "type": "ExecutableElement"}], "return_type": "String"}, "class_info": {"name": "MethodSignatureFormatter", "kind": "c...
32472801_81
class VmSimple extends CustomerEntityAbstract implements Vm { @Override public boolean removeOnHostAllocationListener(final EventListener<VmHostEventInfo> listener) { return onHostAllocationListeners.remove(requireNonNull(listener)); } public VmSimple(final double mipsCapacity, final long num...
Assertions.assertThrows(NullPointerException.class, () -> vm.removeOnHostAllocationListener(null)); } }
[FOCAL] @Override public boolean VmSimple.removeOnHostAllocationListener(EventListener<VmHostEventInfo> listener) [CLASS] class VmSimple extends CustomerEntityAbstract implements Vm [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] onHostAllocationListeners.remove/1, requireNonNull/1...
class VmSimple extends CustomerEntityAbstract implements Vm { @Override public boolean removeOnHostAllocationListener(final EventListener<VmHostEventInfo> listener) { return onHostAllocationListeners.remove(requireNonNull(listener)); } public VmSimple(final double mipsCapacity, final long num...
false
ok
{"focal": {"class": "VmSimple", "name": "removeOnHostAllocationListener", "signature": "boolean removeOnHostAllocationListener(EventListener<VmHostEventInfo> listener)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "listener", "type": "EventListener<VmHostEventInfo>"}], "return_type": "boolean"...
32479235_29
class TransferableUtils { public static Map<Occurrence, AdviceConfig> resolveConfiguration(final Method method, final Class<?> targetClass) { if (GeDAInfrastructure.class.isAssignableFrom(targetClass) || Adapter.class.isA...
final Map<Occurrence, AdviceConfig> map = TransferableUtils.resolveConfiguration(getMethod(AnnotatedTestServiceImpl.class, "entityToDtoKeyAfter"), AnnotatedTestServiceImpl.class); assertEquals(map.size(), 1); final AdviceConfig after = map.get(Occurrence.AFTER_METHOD_INVOCATIO...
[FOCAL] public static Map<Occurrence, AdviceConfig> TransferableUtils.resolveConfiguration(Method method, Class<?> targetClass) [CLASS] class TransferableUtils [METRICS] loc=9 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] Map<Occurrence, AdviceConfig> resolveConfiguration(Method method, Class<?>...
/* static context [FOCAL] public static Map<Occurrence, AdviceConfig> TransferableUtils.resolveConfiguration(Method method, Class<?> targetClass) [PATH1] if(GeDAInfrastructure.class.isAssignableFrom(targetClass) || Adapter.class.isAssignableFrom(targetClass))=T -> return Collections.emptyMap() [PATH2] if(GeDAInfrastruc...
/* static context [FOCAL] public static Map<Occurrence, AdviceConfig> TransferableUtils.resolveConfiguration(Method method, Class<?> targetClass) [PATH1] if(GeDAInfrastructure.class.isAssignableFrom(targetClass) || Adapter.class.isAssignableFrom(targetClass))=T -> return Collections.emptyMap() [PATH2] if(GeDAInfrastruc...
true
ok
{"focal": {"class": "TransferableUtils", "name": "resolveConfiguration", "signature": "Map<Occurrence, AdviceConfig> resolveConfiguration(Method method, Class<?> targetClass)", "start_line": 3, "modifiers": "public static", "params": [{"name": "method", "type": "Method"}, {"name": "targetClass", "type": "Class<?>"}], "...
32488797_2
class VitaminSaber { public static void inject(Activity target) { inject(target, target, ResourceFinder.CONTEXT); } private VitaminSaber(); public static void setDebug(boolean debug); public static void inject(Fragment target); public static void inject(Context context, Object target...
VitaminSaber.inject(new Activity()); assertThat(VitaminSaber.INJECTORS).isEmpty(); VitaminSaber.inject(new Activity(), new Object()); assertThat(VitaminSaber.INJECTORS).isEmpty(); } }
[FOCAL] public static void VitaminSaber.inject(Activity target) [CLASS] class VitaminSaber [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void inject(Object context, Object target, ResourceFinder resourceFinder) [DATAFLOW] target@param->L2 [CLASS-MEMBERS] VitaminSaber(); void setD...
/* static context [FOCAL] public static void VitaminSaber.inject(Activity target) [CALLS-INTERNAL] void inject(Object context, Object target, ResourceFinder resourceFinder) */
/* static context [FOCAL] public static void VitaminSaber.inject(Activity target) [CALLS-INTERNAL] void inject(Object context, Object target, ResourceFinder resourceFinder) */ class VitaminSaber { public static void inject(Activity target) { inject(target, target, ResourceFinder.CONTEXT); } privat...
true
ok
{"focal": {"class": "VitaminSaber", "name": "inject", "signature": "void inject(Activity target)", "start_line": 3, "modifiers": "public static", "params": [{"name": "target", "type": "Activity"}], "return_type": "void"}, "class_info": {"name": "VitaminSaber", "kind": "class", "modifiers": "", "superclass": null, "inte...
32505934_3
class AbstractRDFParser implements RDFParser, Cloneable { protected static Optional<RDFSyntax> guessRDFSyntax(final Path path) { return fileExtension(path).flatMap(RDFSyntax::byFileExtension); } public Optional<RDF> getRdfTermFactory(); public Optional<RDFSyntax> getContentTypeSyntax(); pu...
assertEquals(RDFSyntax.NTRIPLES, AbstractRDFParser.guessRDFSyntax(testNt).get()); assertEquals(RDFSyntax.TURTLE, AbstractRDFParser.guessRDFSyntax(testTtl).get()); assertFalse(AbstractRDFParser.guessRDFSyntax(testXml).isPresent()); } }
[FOCAL] protected static Optional<RDFSyntax> AbstractRDFParser.guessRDFSyntax(Path path) [CLASS] class AbstractRDFParser implements RDFParser, Cloneable [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Optional<String> fileExtension(Path path) [CALLS-EXTERNAL] fileExtension(path).fl...
/* static context [FOCAL] protected static Optional<RDFSyntax> AbstractRDFParser.guessRDFSyntax(Path path) [INPUTS] branches=- | result=path [CALLS-INTERNAL] Optional<String> fileExtension(Path path) [CALLS-EXTERNAL] fileExtension(path).flatMap/1 */
/* static context [FOCAL] protected static Optional<RDFSyntax> AbstractRDFParser.guessRDFSyntax(Path path) [INPUTS] branches=- | result=path [CALLS-INTERNAL] Optional<String> fileExtension(Path path) [CALLS-EXTERNAL] fileExtension(path).flatMap/1 */ class AbstractRDFParser implements RDFParser, Cloneable { protect...
true
ok
{"focal": {"class": "AbstractRDFParser", "name": "guessRDFSyntax", "signature": "Optional<RDFSyntax> guessRDFSyntax(Path path)", "start_line": 3, "modifiers": "protected static", "params": [{"name": "path", "type": "Path"}], "return_type": "Optional<RDFSyntax>"}, "class_info": {"name": "AbstractRDFParser", "kind": "cla...
32516197_4
class Factory { public static CmdQuit createCmdQuit() { initialize(); return new CmdQuit(); } public static String getEnv(String key); public static String getEnv(String key, String deflt); private static void overwriteWithEnv(String key); public static void readVersion(); ...
CmdQuit qc = Factory.createCmdQuit(); assertTrue("Factory Test createCmdQuit should return CmdQuit {}", qc != null); qc.execute(); } }
[FOCAL] public static CmdQuit Factory.createCmdQuit() [CLASS] class Factory [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] void initialize() [NEW] CmdQuit [CLASS-MEMBERS] String getEnv(String key); String getEnv(String key, String deflt); void overwriteWithEnv(String key); void re...
/* static context [FOCAL] public static CmdQuit Factory.createCmdQuit() [CALLS-INTERNAL] void initialize() [NEW] CmdQuit */
/* static context [FOCAL] public static CmdQuit Factory.createCmdQuit() [CALLS-INTERNAL] void initialize() [NEW] CmdQuit */ class Factory { public static CmdQuit createCmdQuit() { initialize(); return new CmdQuit(); } public static String getEnv(String key); public static String getEnv...
true
ok
{"focal": {"class": "Factory", "name": "createCmdQuit", "signature": "CmdQuit createCmdQuit()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "CmdQuit"}, "class_info": {"name": "Factory", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "broker"...
32521417_2
class TaupageYamlPlugin extends AbstractEC2InstancePlugin { @Override protected void process(final EC2InstanceContext context) { if (context.isTaupageAmi().orElse(false)) { if (!context.getTaupageYaml().isPresent()) { violationSink.put( context.violat...
when(mockContext.isTaupageAmi()).thenReturn(Optional.of(true)); when(mockContext.getTaupageYaml()).thenReturn(Optional.of(new TaupageYaml(null, null, null, null))); when(mockContext.getApplicationId()).thenReturn(Optional.of("1234")); when(mockContext.getSource()).thenReturn(Optional.of(...
[FOCAL] @Override protected void TaupageYamlPlugin.process(EC2InstanceContext context) [CLASS] class TaupageYamlPlugin extends AbstractEC2InstancePlugin [METRICS] loc=29 cc=5 branches=4 loops=0 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] context.isTaupageAmi().orElse/1, EC2InstanceContext.isTaupageAmi/0, context.getT...
/* static context [FOCAL] @Override protected void TaupageYamlPlugin.process(EC2InstanceContext context) [PATH1] if(context.isTaupageAmi().orElse(false))=T -> if(!context.getTaupageYaml().isPresent())=F -> if(!context.getApplicationId().isPresent())=T -> if(!context.getSource().isPresent())=T [PATH2] if(context.isTaupa...
/* static context [FOCAL] @Override protected void TaupageYamlPlugin.process(EC2InstanceContext context) [PATH1] if(context.isTaupageAmi().orElse(false))=T -> if(!context.getTaupageYaml().isPresent())=F -> if(!context.getApplicationId().isPresent())=T -> if(!context.getSource().isPresent())=T [PATH2] if(context.isTaupa...
true
ok
{"focal": {"class": "TaupageYamlPlugin", "name": "process", "signature": "void process(EC2InstanceContext context)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "context", "type": "EC2InstanceContext"}], "return_type": "void"}, "class_info": {"name": "TaupageYamlPlugin", "kind": "class", "m...
32525992_14
class StashProvider extends DefaultProvider { public String getState(String result) { result = result == null ? "" : result; String state = IN_PROGRESS_STATE; if (result.equalsIgnoreCase("Passed")) { state = SUCCESSFUL_STATE; } else if (result.equalsIgnoreCase("Failed"))...
assertThat(provider.getState("Unknown"), is(StashProvider.IN_PROGRESS_STATE)); assertThat(provider.getState("Passed"), is(StashProvider.SUCCESSFUL_STATE)); assertThat(provider.getState("Failed"), is(StashProvider.FAILED_STATE)); assertThat(provider.getState("Cancelled"), is(StashProvider...
[FOCAL] public String StashProvider.getState(String result) [CLASS] class StashProvider extends DefaultProvider [METRICS] loc=12 cc=4 branches=3 loops=0 returns=1 throws=0 nesting=3 [CALLS-EXTERNAL] String.equalsIgnoreCase/1 [PATH1] if(result.equalsIgnoreCase("Passed"))=F -> if(result.equalsIgnoreCase("Failed"))=F -> i...
/* static context [FOCAL] public String StashProvider.getState(String result) [PATH1] if(result.equalsIgnoreCase("Passed"))=F -> if(result.equalsIgnoreCase("Failed"))=F -> if(result.equalsIgnoreCase("Cancelled"))=T -> return state [PATH2] if(result.equalsIgnoreCase("Passed"))=T -> return state [PATH3] if(result.equalsI...
/* static context [FOCAL] public String StashProvider.getState(String result) [PATH1] if(result.equalsIgnoreCase("Passed"))=F -> if(result.equalsIgnoreCase("Failed"))=F -> if(result.equalsIgnoreCase("Cancelled"))=T -> return state [PATH2] if(result.equalsIgnoreCase("Passed"))=T -> return state [PATH3] if(result.equalsI...
true
ok
{"focal": {"class": "StashProvider", "name": "getState", "signature": "String getState(String result)", "start_line": 3, "modifiers": "public", "params": [{"name": "result", "type": "String"}], "return_type": "String"}, "class_info": {"name": "StashProvider", "kind": "class", "modifiers": "", "superclass": "DefaultProv...
32533210_87
class LogEntryInterval { public int getIntervalNumber() { return intervalNumber; } public LogEntryInterval(); public void setIntervalNumber( int intervalNumber ); public int getIntervalLength(); public void setIntervalLength( int intervalLength ); public int getNumberRequests...
LogEntryInterval instance = new LogEntryInterval(); int expResult = -1; int result = instance.getIntervalNumber(); assertEquals( expResult, result ); } }
[FOCAL] public int LogEntryInterval.getIntervalNumber() [CLASS] class LogEntryInterval [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] LogEntryInterval(); void setIntervalNumber(int intervalNumber); int getIntervalLength(); void setIntervalLength(int intervalLength); int getNumberRe...
/* static context [FOCAL] public int LogEntryInterval.getIntervalNumber() */
/* static context [FOCAL] public int LogEntryInterval.getIntervalNumber() */ class LogEntryInterval { public int getIntervalNumber() { return intervalNumber; } public LogEntryInterval(); public void setIntervalNumber( int intervalNumber ); public int getIntervalLength(); public v...
true
ok
{"focal": {"class": "LogEntryInterval", "name": "getIntervalNumber", "signature": "int getIntervalNumber()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "LogEntryInterval", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "me...
32535364_8
class ProjectChangeId { public static ProjectChangeId create(String token) { String mutableToken = token; // Try parsing /c/project/+/numericChangeId where token is project/+/numericChangeId int delimiter = mutableToken.indexOf(PageLinks.PROJECT_CHANGE_DELIMITER); Project.NameKey project = null; ...
assertThat(ProjectChangeId.create("123,edit/some/path")).isEqualTo(result(null, 123)); assertThat(ProjectChangeId.create("123,edit/")).isEqualTo(result(null, 123)); assertThat(ProjectChangeId.create("123,edit")).isEqualTo(result(null, 123)); assertThat(ProjectChangeId.create("test/+/123,edit/some/path"...
[FOCAL] public static ProjectChangeId ProjectChangeId.create(String token) [CLASS] class ProjectChangeId [METRICS] loc=28 cc=5 branches=4 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] Integer tryParse(String s) [CALLS-EXTERNAL] String.indexOf/1, String.substring/2, String.substring/1, PageLinks.PROJECT_CHANGE_D...
/* static context [FOCAL] public static ProjectChangeId ProjectChangeId.create(String token) [THROWS-WHEN] IllegalArgumentException when delimiter > 0 && s > 0 && s > 0 && !(cId != null) [THROWS-WHEN] IllegalArgumentException when delimiter > 0 && s > 0 && !(s > 0) && !(cId != null) [THROWS-WHEN] IllegalArgumentExcepti...
/* static context [FOCAL] public static ProjectChangeId ProjectChangeId.create(String token) [THROWS-WHEN] IllegalArgumentException when delimiter > 0 && s > 0 && s > 0 && !(cId != null) [THROWS-WHEN] IllegalArgumentException when delimiter > 0 && s > 0 && !(s > 0) && !(cId != null) [THROWS-WHEN] IllegalArgumentExcepti...
true
ok
{"focal": {"class": "ProjectChangeId", "name": "create", "signature": "ProjectChangeId create(String token)", "start_line": 3, "modifiers": "public static", "params": [{"name": "token", "type": "String"}], "return_type": "ProjectChangeId"}, "class_info": {"name": "ProjectChangeId", "kind": "class", "modifiers": "", "su...
32540624_0
class Backo { public long backoff(int attempt) { long duration = base * (long) Math.pow(factor, attempt); if (jitter != 0) { double random = Math.random(); int deviation = (int) Math.floor(random * jitter * duration); if ((((int) Math.floor(random * 10)) & 1) == 0) { duration = dura...
Backo backo = new Backo.Builder().build(); assertThat(backo.backoff(0)).isEqualTo(100); assertThat(backo.backoff(1)).isEqualTo(200); assertThat(backo.backoff(2)).isEqualTo(400); assertThat(backo.backoff(3)).isEqualTo(800); assertThat(backo.backoff(0)).isEqualTo(100); assertThat(backo.backo...
[FOCAL] public long Backo.backoff(int attempt) [CLASS] class Backo [METRICS] loc=16 cc=4 branches=3 loops=0 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] Math.pow/2, Math.random/0, Math.floor/1, Math.min/2, Math.max/2 [PATH1] if(jitter != 0)=T -> if((((int) Math.floor(random * 10)) & 1) == 0)=T -> if(duration < 0)=T ->...
/* static context [FOCAL] public long Backo.backoff(int attempt) [PATH1] if(jitter != 0)=T -> if((((int) Math.floor(random * 10)) & 1) == 0)=T -> if(duration < 0)=T -> return Math.min(Math.max(duration, base), cap) [PATH2] if(jitter != 0)=F -> if(duration < 0)=F -> return Math.min(Math.max(duration, base), cap) [PATH3]...
/* static context [FOCAL] public long Backo.backoff(int attempt) [PATH1] if(jitter != 0)=T -> if((((int) Math.floor(random * 10)) & 1) == 0)=T -> if(duration < 0)=T -> return Math.min(Math.max(duration, base), cap) [PATH2] if(jitter != 0)=F -> if(duration < 0)=F -> return Math.min(Math.max(duration, base), cap) [PATH3]...
true
ok
{"focal": {"class": "Backo", "name": "backoff", "signature": "long backoff(int attempt)", "start_line": 3, "modifiers": "public", "params": [{"name": "attempt", "type": "int"}], "return_type": "long"}, "class_info": {"name": "Backo", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": []...
32567407_1
class Calculator { public int sum(int num1, int num2){ return num1 + num2; } public Calculator(); public Calculator(String msg); public static int staticSum(int num1, int num2); private Calculator calc; } class CalculatorTest { private Calculator calc; @Test public void testSum(){
//calc = new Calculator(); assertEquals(777, calc.sum(666, 111)); } }
[FOCAL] public int Calculator.sum(int num1, int num2) [CLASS] class Calculator [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [INPUTS] branches=- | result=num1, num2 [DATAFLOW] num1@param->L2; num2@param->L2 [CLASS-MEMBERS] Calculator(); Calculator(String msg); int staticSum(int num1, int num2) [T...
/* static context [FOCAL] public int Calculator.sum(int num1, int num2) [INPUTS] branches=- | result=num1, num2 */
/* static context [FOCAL] public int Calculator.sum(int num1, int num2) [INPUTS] branches=- | result=num1, num2 */ class Calculator { public int sum(int num1, int num2){ return num1 + num2; } public Calculator(); public Calculator(String msg); public static int staticSum(int num1, int num2); private Calcu...
true
ok
{"focal": {"class": "Calculator", "name": "sum", "signature": "int sum(int num1, int num2)", "start_line": 3, "modifiers": "public", "params": [{"name": "num1", "type": "int"}, {"name": "num2", "type": "int"}], "return_type": "int"}, "class_info": {"name": "Calculator", "kind": "class", "modifiers": "", "superclass": n...
32568128_29
class RequestLookup { public String getContextPath() { return contextPath; } public RequestLookup(String contextPath, HttpRequest request, HttpResponse response); public HttpRequest getRequest(); public HttpResponse getResponse(); public Map<String, String> getPathParams(); void...
RequestLookup requestLookup = new RequestLookup("/test1", null, null); Assert.assertEquals(requestLookup.getContextPath(), "/test1"); HttpRequest request = mock(HttpRequest.class); when(request.getContextPath()).thenReturn("/test2"); requestLookup = new RequestLookup(null, reque...
[FOCAL] public String RequestLookup.getContextPath() [CLASS] class RequestLookup [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] RequestLookup(String contextPath, HttpRequest request, HttpResponse response); HttpRequest getRequest(); HttpResponse getResponse(); Map<String, String> g...
/* static context [FOCAL] public String RequestLookup.getContextPath() */
/* static context [FOCAL] public String RequestLookup.getContextPath() */ class RequestLookup { public String getContextPath() { return contextPath; } public RequestLookup(String contextPath, HttpRequest request, HttpResponse response); public HttpRequest getRequest(); public HttpRespons...
true
ok
{"focal": {"class": "RequestLookup", "name": "getContextPath", "signature": "String getContextPath()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "RequestLookup", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members"...
32571376_48
class BluemixEndpointService extends EndpointServiceImpl { @Override public void lookup(EndpointPromise future) { final String methodName = "lookup"; logger.entry(this, methodName, future); try { String lookupUri; Endpoint endpoint = null; boolean re...
BluemixEndpointService service = new MockBluemixEndpointService(null, "", ""); MockEndpointPromise promise = new MockEndpointPromise(Method.FAILURE); service.lookup(promise); assertTrue("Promise should have been marked done", promise.isComplete()); } }
[FOCAL] @Override public void BluemixEndpointService.lookup(EndpointPromise future) [CLASS] class BluemixEndpointService extends EndpointServiceImpl [METRICS] loc=51 cc=10 branches=7 loops=0 returns=0 throws=0 nesting=5 [CALLS-INTERNAL] void doHttpLookup(String httpUri, EndpointPromise future); void doRetry(EndpointPro...
/* static context [FOCAL] @Override public void BluemixEndpointService.lookup(EndpointPromise future) [PATH1] if(state.lookupUri == null)=T -> if(state.lookupUri != null)=T -> if(state.endpoints == null)=F -> if(state.nextEndpointIndex >= state.endpoints.size())=T -> if(lookupUri == null)=F -> if(retry)=F -> if(endpoin...
/* static context [FOCAL] @Override public void BluemixEndpointService.lookup(EndpointPromise future) [PATH1] if(state.lookupUri == null)=T -> if(state.lookupUri != null)=T -> if(state.endpoints == null)=F -> if(state.nextEndpointIndex >= state.endpoints.size())=T -> if(lookupUri == null)=F -> if(retry)=F -> if(endpoin...
true
ok
{"focal": {"class": "BluemixEndpointService", "name": "lookup", "signature": "void lookup(EndpointPromise future)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "future", "type": "EndpointPromise"}], "return_type": "void"}, "class_info": {"name": "BluemixEndpointService", "kind": "class", "modi...
32632538_1
class AndroidCustomField extends VCardProperty { public static AndroidCustomField dir(String type, String... values) { AndroidCustomField property = new AndroidCustomField(); property.dir = true; property.type = type; Collections.addAll(property.values, values); return property; } public static And...
AndroidCustomField property = AndroidCustomField.dir("type", "value1", "value2"); assertFalse(property.isItem()); assertTrue(property.isDir()); assertEquals("type", property.getType()); assertEquals(Arrays.asList("value1", "value2"), property.getValues()); } }
[FOCAL] public static AndroidCustomField AndroidCustomField.dir(String type, String... values) [CLASS] class AndroidCustomField extends VCardProperty [METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Collections.addAll/2 [NEW] AndroidCustomField [DATAFLOW] property@L2->L3,L4,L5,L6; t...
/* static context [FOCAL] public static AndroidCustomField AndroidCustomField.dir(String type, String... values) [NEW] AndroidCustomField [CALLS-EXTERNAL] Collections.addAll/2 */
/* static context [FOCAL] public static AndroidCustomField AndroidCustomField.dir(String type, String... values) [NEW] AndroidCustomField [CALLS-EXTERNAL] Collections.addAll/2 */ class AndroidCustomField extends VCardProperty { public static AndroidCustomField dir(String type, String... values) { AndroidCustomField...
true
ok
{"focal": {"class": "AndroidCustomField", "name": "dir", "signature": "AndroidCustomField dir(String type, String... values)", "start_line": 3, "modifiers": "public static", "params": [{"name": "type", "type": "String"}, {"name": "values", "type": "String..."}], "return_type": "AndroidCustomField"}, "class_info": {"nam...