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 |
|---|---|---|---|---|---|---|---|---|
65855862_4 | class LiKafkaClientsUtils {
public static Map<String, String> getKnownLibraryVersions() {
Map<String, String> results = new HashMap<>();
for (String knownProjectGroup : KNOWN_PROJECT_GROUPS) {
String versions = VersioningUtils.summarize(VersioningUtils.getProjectHistogram(
project -> project.... | Map<String, String> versions = LiKafkaClientsUtils.getKnownLibraryVersions();
Assert.assertEquals(versions.size(), 3);
Assert.assertNotNull(versions.get("com.linkedin.kafka"));
Assert.assertNotNull(versions.get("com.linkedin.mario"));
//if we run from an IDE we wont get a version for "com.linkedin.k... | [FOCAL] public static Map<String, String> LiKafkaClientsUtils.getKnownLibraryVersions()
[CLASS] class LiKafkaClientsUtils
[METRICS] loc=11 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] VersioningUtils.summarize/1, VersioningUtils.getProjectHistogram/2, project.getCoordinates().getGroup().equals/... | /* static context
[FOCAL] public static Map<String, String> LiKafkaClientsUtils.getKnownLibraryVersions()
[PATH1] foreach(String knownProjectGroup : KNOWN_PROJECT_GROUPS)=T -> exit loop -> return results
[PATH2] foreach(String knownProjectGroup : KNOWN_PROJECT_GROUPS)=F -> return results
[COLLABORATORS] field project g... | /* static context
[FOCAL] public static Map<String, String> LiKafkaClientsUtils.getKnownLibraryVersions()
[PATH1] foreach(String knownProjectGroup : KNOWN_PROJECT_GROUPS)=T -> exit loop -> return results
[PATH2] foreach(String knownProjectGroup : KNOWN_PROJECT_GROUPS)=F -> return results
[COLLABORATORS] field project g... | true | ok | {"focal": {"class": "LiKafkaClientsUtils", "name": "getKnownLibraryVersions", "signature": "Map<String, String> getKnownLibraryVersions()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Map<String, String>"}, "class_info": {"name": "LiKafkaClientsUtils", "kind": "class", "modifiers": "", ... |
65927678_11 | class HivePresenter implements HiveContract.Presenter {
@Override
public void result(int requestCode, int resultCode, Intent data) {
// If a recording was successfully saved, show snackbar
if (MonitoringActivity.REQUEST_MONITORING == requestCode) {
if (resultCode == Activity.RESULT_... | when(intent.getIntExtra(anyString(), anyInt()))
.thenReturn(HiveRecordingsFragment.ERROR_RECORDING_TOO_SHORT);
hivePresenter.result(MonitoringActivity.REQUEST_MONITORING,
Activity.RESULT_CANCELED, intent);
// Show msg
verify(hiveRecordingsView).showRecordi... | [FOCAL] @Override public void HivePresenter.result(int requestCode, int resultCode, Intent data)
[CLASS] class HivePresenter implements HiveContract.Presenter
[METRICS] loc=26 cc=6 branches=4 loops=0 returns=0 throws=0 nesting=4
[CALLS-INTERNAL] void loadData(boolean forceUpdate)
[CALLS-EXTERNAL] HiveContract.HiveRecor... | /* static context
[FOCAL] @Override public void HivePresenter.result(int requestCode, int resultCode, Intent data)
[PATH1] if(MonitoringActivity.REQUEST_MONITORING == requestCode)=T -> if(resultCode == Activity.RESULT_OK)=F -> if(resultCode == Activity.RESULT_CANCELED && data != null)=T -> switch(error)=case HiveRecord... | /* static context
[FOCAL] @Override public void HivePresenter.result(int requestCode, int resultCode, Intent data)
[PATH1] if(MonitoringActivity.REQUEST_MONITORING == requestCode)=T -> if(resultCode == Activity.RESULT_OK)=F -> if(resultCode == Activity.RESULT_CANCELED && data != null)=T -> switch(error)=case HiveRecord... | true | ok | {"focal": {"class": "HivePresenter", "name": "result", "signature": "void result(int requestCode, int resultCode, Intent data)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "requestCode", "type": "int"}, {"name": "resultCode", "type": "int"}, {"name": "data", "type": "Intent"}], "return_type":... |
65931687_6 | class SessionVote {
@PUT
@Path("/attendee/{id}")
@Produces(APPLICATION_JSON)
@Consumes(APPLICATION_JSON)
public Attendee updateAttendee(@PathParam("id") String id, Attendee attendee) {
Attendee original = getAttendee(id);
original.setName(attendee.getName());
Attendee update... | Attendee jonathanDoe = sessionVote.registerAttendee(new Attendee("Jonathan Doe"));
String id = jonathanDoe.getId();
Attendee jonDoe = new Attendee(id, "Jon Doe");
// API method under test:
Attendee attendee = sessionVote.updateAttendee(id, jonDoe);
assertEquals("Attendee... | [FOCAL] @PUT @Path("/attendee/{id}") @Produces(APPLICATION_JSON) @Consumes(APPLICATION_JSON) public Attendee SessionVote.updateAttendee(String id, Attendee attendee)
[CLASS] class SessionVote
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Attendee getAttendee(String id)
[CALLS-EX... | /* static context
[FOCAL] @PUT @Path("/attendee/{id}") @Produces(APPLICATION_JSON) @Consumes(APPLICATION_JSON) public Attendee SessionVote.updateAttendee(String id, Attendee attendee)
[INPUTS] branches=- | result=id
[COLLABORATORS] param attendee:Attendee getName/0; field selectedAttendeeDAO updateAttendee/1
[CALLS-INT... | /* static context
[FOCAL] @PUT @Path("/attendee/{id}") @Produces(APPLICATION_JSON) @Consumes(APPLICATION_JSON) public Attendee SessionVote.updateAttendee(String id, Attendee attendee)
[INPUTS] branches=- | result=id
[COLLABORATORS] param attendee:Attendee getName/0; field selectedAttendeeDAO updateAttendee/1
[CALLS-INT... | true | ok | {"focal": {"class": "SessionVote", "name": "updateAttendee", "signature": "Attendee updateAttendee(String id, Attendee attendee)", "start_line": 3, "modifiers": "@PUT @Path(\"/attendee/{id}\") @Produces(APPLICATION_JSON) @Consumes(APPLICATION_JSON) public", "params": [{"name": "id", "type": "String"}, {"name": "attende... |
65946712_2 | class MethodReflectionUtil {
public static Class<?> getReturnArrayType(Method method) {
Class<?> returnType = method.getReturnType();
return returnType.getComponentType();
}
public static Class<?> getReturnParameterizedType(Method method);
}
class MethodReflectionUtilTest {
@Test
... | Class<?> actual = MethodReflectionUtil.getReturnArrayType(MethodFixture.class.getDeclaredMethod("eventArray"));
Assert.assertEquals(Event.class, actual);
}
} | [FOCAL] public static Class<?> MethodReflectionUtil.getReturnArrayType(Method method)
[CLASS] class MethodReflectionUtil
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Method.getReturnType/0, Class<?>.getComponentType/0
[INPUTS] branches=- | result=method
[COLLABORATORS] param met... | /* static context
[FOCAL] public static Class<?> MethodReflectionUtil.getReturnArrayType(Method method)
[INPUTS] branches=- | result=method
[COLLABORATORS] param method:Method getReturnType/0
[CALLS-EXTERNAL] Method.getReturnType/0, Class<?>.getComponentType/0
*/
| /* static context
[FOCAL] public static Class<?> MethodReflectionUtil.getReturnArrayType(Method method)
[INPUTS] branches=- | result=method
[COLLABORATORS] param method:Method getReturnType/0
[CALLS-EXTERNAL] Method.getReturnType/0, Class<?>.getComponentType/0
*/
class MethodReflectionUtil {
public static Class<?>... | true | ok | {"focal": {"class": "MethodReflectionUtil", "name": "getReturnArrayType", "signature": "Class<?> getReturnArrayType(Method method)", "start_line": 3, "modifiers": "public static", "params": [{"name": "method", "type": "Method"}], "return_type": "Class<?>"}, "class_info": {"name": "MethodReflectionUtil", "kind": "class"... |
65947212_2 | class DynamoDBUtil {
static int getItemSizeBytes(Map<String, AttributeValue> item) {
try {
int itemSize = 0;
for (Entry<String, AttributeValue> entry : item.entrySet()) {
itemSize += entry.getKey() != null ? entry.getKey().getBytes(CHARACTER_ENCODING).length : 0;
itemSize += entry.get... | Map<String, AttributeValue> item = new HashMap<>();
item.put(TEST_NAMES.get(0), new AttributeValue(TEST_STRING));
item.put(TEST_NAMES.get(1), new AttributeValue(TEST_STRING));
item.put(TEST_NAMES.get(2), new AttributeValue().withN(TEST_NUMBER));
Map<String, AttributeValue> attrMap = new HashMap<>()... | [FOCAL] static int DynamoDBUtil.getItemSizeBytes(Map<String, AttributeValue> item)
[CLASS] class DynamoDBUtil
[METRICS] loc=12 cc=3 branches=0 loops=1 returns=1 throws=1 nesting=2
[CALLS-INTERNAL] int getAttributeSizeBytes(AttributeValue att)
[CALLS-EXTERNAL] Map<String, AttributeValue>.entrySet/0, Entry<String, Attrib... | /* static context
[FOCAL] static int DynamoDBUtil.getItemSizeBytes(Map<String, AttributeValue> item)
[THROWS-WHEN] RuntimeException when try-body throws
[PATH1] foreach(Entry<String, AttributeValue> entry : item.entrySet())=T -> exit loop -> return itemSize
[PATH2] try-body throws -> throw new RuntimeException(e)
[PATH... | /* static context
[FOCAL] static int DynamoDBUtil.getItemSizeBytes(Map<String, AttributeValue> item)
[THROWS-WHEN] RuntimeException when try-body throws
[PATH1] foreach(Entry<String, AttributeValue> entry : item.entrySet())=T -> exit loop -> return itemSize
[PATH2] try-body throws -> throw new RuntimeException(e)
[PATH... | true | ok | {"focal": {"class": "DynamoDBUtil", "name": "getItemSizeBytes", "signature": "int getItemSizeBytes(Map<String, AttributeValue> item)", "start_line": 3, "modifiers": "static", "params": [{"name": "item", "type": "Map<String, AttributeValue>"}], "return_type": "int"}, "class_info": {"name": "DynamoDBUtil", "kind": "class... |
65963317_10 | class GremlinGroovyScriptEngine extends GroovyScriptEngineImpl implements DependencyManager, AutoCloseable {
@Override
public Object eval(final Reader reader, final ScriptContext context) throws ScriptException {
return eval(readFully(reader), context);
}
public GremlinGroovyScriptEngine();
... | final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine();
final Bindings b = new SimpleBindings();
b.put("x", 2);
assertEquals(3, engine.eval("1+x", b));
}
} | [FOCAL] @Override public Object GremlinGroovyScriptEngine.eval(Reader reader, ScriptContext context)
[CLASS] class GremlinGroovyScriptEngine extends GroovyScriptEngineImpl implements DependencyManager, AutoCloseable
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Object eval(String... | /* static context
[FOCAL] @Override public Object GremlinGroovyScriptEngine.eval(Reader reader, ScriptContext context)
[INPUTS] branches=- | result=context, reader
[EXCEPTIONS] declares ScriptException
[CALLS-INTERNAL] Object eval(String script, ScriptContext context); String readFully(Reader reader)
*/
| /* static context
[FOCAL] @Override public Object GremlinGroovyScriptEngine.eval(Reader reader, ScriptContext context)
[INPUTS] branches=- | result=context, reader
[EXCEPTIONS] declares ScriptException
[CALLS-INTERNAL] Object eval(String script, ScriptContext context); String readFully(Reader reader)
*/
class GremlinGr... | true | ok | {"focal": {"class": "GremlinGroovyScriptEngine", "name": "eval", "signature": "Object eval(Reader reader, ScriptContext context) throws ScriptException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "reader", "type": "Reader"}, {"name": "context", "type": "ScriptContext"}], "return_type": "Obje... |
65973286_4 | class KuduTableSource implements StreamTableSource<Row>,
LimitableTableSource<Row>, ProjectableTableSource<Row>, FilterableTableSource<Row> {
@Override
public TableSchema getTableSchema() {
return flinkSchema;
}
public KuduTableSource(KuduReaderConfig.Builder configBuilder, KuduTableInfo ... | TableSchema tableSchema = kuduTableSource.getTableSchema();
assertNotNull(tableSchema);
assertArrayEquals(getFieldNames(), tableSchema.getFieldNames());
assertArrayEquals(getFieldDataTypes(), tableSchema.getFieldDataTypes());
}
} | [FOCAL] @Override public TableSchema KuduTableSource.getTableSchema()
[CLASS] class KuduTableSource implements StreamTableSource<Row>, LimitableTableSource<Row>, ProjectableTableSource<Row>, FilterableTableSource<Row>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] KuduTableSource(K... | /* static context
[FOCAL] @Override public TableSchema KuduTableSource.getTableSchema()
*/
| /* static context
[FOCAL] @Override public TableSchema KuduTableSource.getTableSchema()
*/
class KuduTableSource implements StreamTableSource<Row>,
LimitableTableSource<Row>, ProjectableTableSource<Row>, FilterableTableSource<Row> {
@Override
public TableSchema getTableSchema() {
return flinkSchema... | true | ok | {"focal": {"class": "KuduTableSource", "name": "getTableSchema", "signature": "TableSchema getTableSchema()", "start_line": 4, "modifiers": "@Override public", "params": [], "return_type": "TableSchema"}, "class_info": {"name": "KuduTableSource", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Stre... |
65975333_76 | class OutStream implements javax.ws.rs.core.StreamingOutput {
public Object getData() {
return data;
}
public OutStream();
public OutStream(RowSet<Row> result);
@Override public void write(OutputStream output);
public void setData(Object data);
private Charset oldDefaultCharset;
}
class OutStr... | assertNull(new OutStream().getData());
}
} | [FOCAL] public Object OutStream.getData()
[CLASS] class OutStream implements javax.ws.rs.core.StreamingOutput
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] OutStream(); OutStream(RowSet<Row> result); void write(OutputStream output); void setData(Object data)
[TEST] OutStreamTest: ... | /* static context
[FOCAL] public Object OutStream.getData()
*/
| /* static context
[FOCAL] public Object OutStream.getData()
*/
class OutStream implements javax.ws.rs.core.StreamingOutput {
public Object getData() {
return data;
}
public OutStream();
public OutStream(RowSet<Row> result);
@Override public void write(OutputStream output);
public void setData(Objec... | true | ok | {"focal": {"class": "OutStream", "name": "getData", "signature": "Object getData()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Object"}, "class_info": {"name": "OutStream", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "javax.ws.rs.core.StreamingOutput", "fields": [{"na... |
65977170_25 | class SpacePlayerImpl implements SpacePlayer {
@Override
public String getContent() {
String health = getHealth().getContent();
if (activeItem != null) {
String item = activeItem.getItemSymbol(direction, activeItemUsage);
return Direction.BACKWARD.equals(direction) ? ite... | Assert.assertEquals(player.getContent(),"³H");
}
} | [FOCAL] @Override public String SpacePlayerImpl.getContent()
[CLASS] class SpacePlayerImpl implements SpacePlayer
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] Health getHealth()
[CALLS-EXTERNAL] getHealth().getContent/0, activeItem.getItemSymbol/2, Direction.BACKWARD.equals/1
[P... | /* static context
[FOCAL] @Override public String SpacePlayerImpl.getContent()
[PATH1] if(activeItem != null)=T -> return Direction.BACKWARD.equals(direction) ? item + content + health : he...
[PATH2] if(activeItem != null)=F -> return Direction.BACKWARD.equals(direction) ? content + health : health + ...
[COLLABORATOR... | /* static context
[FOCAL] @Override public String SpacePlayerImpl.getContent()
[PATH1] if(activeItem != null)=T -> return Direction.BACKWARD.equals(direction) ? item + content + health : he...
[PATH2] if(activeItem != null)=F -> return Direction.BACKWARD.equals(direction) ? content + health : health + ...
[COLLABORATOR... | true | ok | {"focal": {"class": "SpacePlayerImpl", "name": "getContent", "signature": "String getContent()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "SpacePlayerImpl", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "SpacePlayer", "fields"... |
65980850_2 | class Moment implements Parcelable, Serializable {
public Field fields() {
return new Field(this);
}
public Moment(final Calendar calendar);
public Moment(final Date date);
public Moment();
public Moment(final int year,
@IntRange(from = 0, to = 11) final int month... | Moment moment = new Moment("2016-09-02","yyyy-MM-dd");
assertEquals(Moment.SEPTEMBER, moment.fields().month());
assertEquals(2, moment.fields().day());
assertEquals(2016, moment.fields().year());
}
} | [FOCAL] public Field Moment.fields()
[CLASS] class Moment implements Parcelable, Serializable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] Field
[CLASS-MEMBERS] Moment(Calendar calendar); Moment(Date date); Moment(); Moment(int year, int month, int day); Moment(long timeInMillis); Moment(i... | /* static context
[FOCAL] public Field Moment.fields()
[NEW] Field
*/
| /* static context
[FOCAL] public Field Moment.fields()
[NEW] Field
*/
class Moment implements Parcelable, Serializable {
public Field fields() {
return new Field(this);
}
public Moment(final Calendar calendar);
public Moment(final Date date);
public Moment();
public Moment(final in... | true | ok | {"focal": {"class": "Moment", "name": "fields", "signature": "Field fields()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Field"}, "class_info": {"name": "Moment", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Parcelable, Serializable", "fields": [], "members": [{"name"... |
65993144_168 | class InputDestContextResolveStrategy implements DestContextResolveStrategy {
@Override
public DestContextTypeMap resolveContext(DestContextsTypeMap destContexts) throws ConversionException {
ContextInfo seqContextInfo = new ContextInfoBuilder()
.setSequenceType(SequenceType.VIDEO)
... |
InputDestContextResolveStrategy strategy = new InputDestContextResolveStrategy(contextProvider, ITunesPackageType.film,
new FakeVideoDestContextResolveStrategy());
DestContextTypeMap map = strategy.resolveContext(new DestContextsTypeMap());
assertEquals("720", map.getMap().get... | [FOCAL] @Override public DestContextTypeMap InputDestContextResolveStrategy.resolveContext(DestContextsTypeMap destContexts)
[CLASS] class InputDestContextResolveStrategy implements DestContextResolveStrategy
[METRICS] loc=21 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] SequenceUUID getSequence... | /* static context
[FOCAL] @Override public DestContextTypeMap InputDestContextResolveStrategy.resolveContext(DestContextsTypeMap destContexts)
[INPUTS] branches=- | result=destContexts
[COLLABORATORS] field resolveStrategy setPackageType/1
[EXCEPTIONS] declares ConversionException
[CALLS-INTERNAL] SequenceUUID getSeque... | /* static context
[FOCAL] @Override public DestContextTypeMap InputDestContextResolveStrategy.resolveContext(DestContextsTypeMap destContexts)
[INPUTS] branches=- | result=destContexts
[COLLABORATORS] field resolveStrategy setPackageType/1
[EXCEPTIONS] declares ConversionException
[CALLS-INTERNAL] SequenceUUID getSeque... | true | ok | {"focal": {"class": "InputDestContextResolveStrategy", "name": "resolveContext", "signature": "DestContextTypeMap resolveContext(DestContextsTypeMap destContexts) throws ConversionException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "destContexts", "type": "DestContextsTypeMap"}], "return_t... |
66000206_190 | class TimeValue implements Time {
public static TimeValueBuilder builder() {
return new TimeValueBuilder();
}
private TimeValue(int hour, int minute, int second, int microsecond);
public static TimeValue from(Calendar calendar, int microsecond);
@Override public int getHour();
@Overr... | try {
TimeValue.builder().withMinute(60);
} catch (IllegalArgumentException e) {
assertThat(e.getMessage(), containsString("minute"));
return;
}
fail("Expected an Exception");
}
} | [FOCAL] public static TimeValueBuilder TimeValue.builder()
[CLASS] class TimeValue implements Time
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] TimeValueBuilder
[CLASS-MEMBERS] TimeValue(int hour, int minute, int second, int microsecond); TimeValue from(Calendar calendar, int microsecond);... | /* static context
[FOCAL] public static TimeValueBuilder TimeValue.builder()
[NEW] TimeValueBuilder
*/
| /* static context
[FOCAL] public static TimeValueBuilder TimeValue.builder()
[NEW] TimeValueBuilder
*/
class TimeValue implements Time {
public static TimeValueBuilder builder() {
return new TimeValueBuilder();
}
private TimeValue(int hour, int minute, int second, int microsecond);
public st... | true | ok | {"focal": {"class": "TimeValue", "name": "builder", "signature": "TimeValueBuilder builder()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "TimeValueBuilder"}, "class_info": {"name": "TimeValue", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Time", "fields": [{"nam... |
66020851_21 | class Instrumentation {
public static <T, U extends T> Builder<T, U> builder(Class<T> interfaceClass, U delegate) {
return new Builder<>(interfaceClass, delegate);
}
private Instrumentation();
static T wrap(
Class<T> interfaceClass,
U delegate,
List<Invoca... | TestImplementation delegate = new TestImplementation();
InvocationEventHandler<InvocationContext> handler = TracingInvocationEventHandler.create("test");
TestInterface proxy0 = Instrumentation.builder(TestInterface.class, delegate)
.withHandler(handler)
.build();
... | [FOCAL] public static Builder<T, U> Instrumentation.builder(Class<T> interfaceClass, U delegate)
[CLASS] class Instrumentation
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] Builder<>
[INPUTS] branches=- | result=delegate, interfaceClass
[DATAFLOW] delegate@param->L2; interfaceClass@param->L... | /* static context
[FOCAL] public static Builder<T, U> Instrumentation.builder(Class<T> interfaceClass, U delegate)
[INPUTS] branches=- | result=delegate, interfaceClass
[NEW] Builder<>
*/
| /* static context
[FOCAL] public static Builder<T, U> Instrumentation.builder(Class<T> interfaceClass, U delegate)
[INPUTS] branches=- | result=delegate, interfaceClass
[NEW] Builder<>
*/
class Instrumentation {
public static <T, U extends T> Builder<T, U> builder(Class<T> interfaceClass, U delegate) {
ret... | true | ok | {"focal": {"class": "Instrumentation", "name": "builder", "signature": "Builder<T, U> builder(Class<T> interfaceClass, U delegate)", "start_line": 3, "modifiers": "public static", "params": [{"name": "interfaceClass", "type": "Class<T>"}, {"name": "delegate", "type": "U"}], "return_type": "Builder<T, U>"}, "class_info"... |
66027126_68 | class Parametrizing implements RewritePolicy {
@Override
public URI rewritten(URI location, HttpRequest<?> request)
{
// Note: this will look simpler when we switched to uri-toolkit
// parse the given URI
Uri uri = new LazyUri(new Precoded(location.toString()));
// create u... | HttpRequest mockRequest = mock(HttpRequest.class);
RewritePolicy mockPolicy = mock(RewritePolicy.class);
when(mockPolicy.rewritten(URI.create("http://example.com/test?xyz=987&abc=123"), mockRequest)).thenReturn(URI.create("https://example.org/result"));
// test that it returns whatever ... | [FOCAL] @Override public URI Parametrizing.rewritten(URI location, HttpRequest<?> request)
[CLASS] class Parametrizing implements RewritePolicy
[METRICS] loc=16 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] URI.toString/0, uri.query().isPresent/0, Uri.query/0, uri.query().value/0, mDelegate.rewr... | /* static context
[FOCAL] @Override public URI Parametrizing.rewritten(URI location, HttpRequest<?> request)
[INPUTS] branches=- | result=location, request
[COLLABORATORS] param location:URI toString/0; field mDelegate rewritten/2
[NEW] LazyUri, Precoded, Replacing, XwfueParameterList, BasicParameterList, Text, Resolve... | /* static context
[FOCAL] @Override public URI Parametrizing.rewritten(URI location, HttpRequest<?> request)
[INPUTS] branches=- | result=location, request
[COLLABORATORS] param location:URI toString/0; field mDelegate rewritten/2
[NEW] LazyUri, Precoded, Replacing, XwfueParameterList, BasicParameterList, Text, Resolve... | true | ok | {"focal": {"class": "Parametrizing", "name": "rewritten", "signature": "URI rewritten(URI location, HttpRequest<?> request)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "location", "type": "URI"}, {"name": "request", "type": "HttpRequest<?>"}], "return_type": "URI"}, "class_info": {"name": "P... |
66062805_14 | class ShardColumnValueUtil {
public static List<ColumnValue> eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange) {
return eval(ctx, shardColumns, isRange, false);
}
public static List<ColumnValue> eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange,
boolean isBatchInsert... | SQLParsedResult parseResult = SQLParser.parseWithoutCache(
"INSERT INTO `User` (`Name`,`Tel`,`Alias`,`Email`)VALUES('zhuhao','123','hao.zhu','z@d'),('zhuhao1','1233','hao.zhu1','z@d')");
List<Object> params = null;
ShardEvalContext ctx = new ShardEvalContext(parseResult, params);
Set<String> shardColumns = ... | [FOCAL] public static List<ColumnValue> ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)
[CLASS] class ShardColumnValueUtil
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] List<ColumnValue> eval(ShardEvalContext ctx, Set<String> shardColumn... | /* static context
[FOCAL] public static List<ColumnValue> ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)
[INPUTS] branches=- | result=ctx, isRange, shardColumns
[CALLS-INTERNAL] List<ColumnValue> eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange, boolean is... | /* static context
[FOCAL] public static List<ColumnValue> ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)
[INPUTS] branches=- | result=ctx, isRange, shardColumns
[CALLS-INTERNAL] List<ColumnValue> eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange, boolean is... | true | ok | {"focal": {"class": "ShardColumnValueUtil", "name": "eval", "signature": "List<ColumnValue> eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)", "start_line": 3, "modifiers": "public static", "params": [{"name": "ctx", "type": "ShardEvalContext"}, {"name": "shardColumns", "type": "Set<String>"}, {"na... |
66080823_11 | class Slf4JFormattingStrategy implements FormattingStrategy {
@Override
public boolean isPlaceholder(String pattern, int position) {
return pattern.length() > position + 1
&& pattern.charAt(position) == '{'
&& pattern.charAt(position + 1) == '}';
}
@Override public boolean isEscape(String pattern, int pos... | assertTrue(strategy.isPlaceholder("{}", 0));
assertFalse(strategy.isPlaceholder("{", 0));
assertFalse(strategy.isPlaceholder(" {}", 0));
assertFalse(strategy.isPlaceholder(" {} ", 3));
assertFalse(strategy.isPlaceholder("{}", 1));
assertFalse("not a string placeholder", strategy.isPlaceholder("%s", 0));
}
... | [FOCAL] @Override public boolean Slf4JFormattingStrategy.isPlaceholder(String pattern, int position)
[CLASS] class Slf4JFormattingStrategy implements FormattingStrategy
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] String.length/0, String.charAt/1
[INPUTS] branches=- | result=pat... | /* static context
[FOCAL] @Override public boolean Slf4JFormattingStrategy.isPlaceholder(String pattern, int position)
[INPUTS] branches=- | result=pattern, position
[CALLS-EXTERNAL] String.length/0, String.charAt/1
*/
| /* static context
[FOCAL] @Override public boolean Slf4JFormattingStrategy.isPlaceholder(String pattern, int position)
[INPUTS] branches=- | result=pattern, position
[CALLS-EXTERNAL] String.length/0, String.charAt/1
*/
class Slf4JFormattingStrategy implements FormattingStrategy {
@Override
public boolean isPlacehold... | true | ok | {"focal": {"class": "Slf4JFormattingStrategy", "name": "isPlaceholder", "signature": "boolean isPlaceholder(String pattern, int position)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "pattern", "type": "String"}, {"name": "position", "type": "int"}], "return_type": "boolean"}, "class_info": {... |
66136602_9 | class FileUtils {
private static boolean unpackPackage(File ourDir, InputStream is, Map<String, String> md5List,
CompressMode mode) {
if (!ourDir.exists()) {
return false;
}
boolean uncompressResult = false;
if (mode == CompressM... | File tmpoutdir = new File("/Users/netease/webcacheunittestfiles/", "tmpoutdir");
FileUtils.deleteDir(tmpoutdir);
assertTrue(tmpoutdir.mkdirs());
String filePath = "/Users/netease/webcacheunittestfiles/web_app_new.tgz";
Map<String, String> fileMd5List = new HashMap<String, Strin... | [FOCAL] private static boolean FileUtils.unpackPackage(File ourDir, InputStream is, Map<String, String> md5List, CompressMode mode)
[CLASS] class FileUtils
[METRICS] loc=15 cc=4 branches=3 loops=0 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] File.exists/0, FileUtils.unpackZipPkg/3, FileUtils.unpackTgzPkg/3
[PATH1] if(... | /* static context
[FOCAL] private static boolean FileUtils.unpackPackage(File ourDir, InputStream is, Map<String, String> md5List, CompressMode mode)
[PATH1] if(!ourDir.exists())=F -> if(mode == CompressMode.ZIP)=F -> if(mode == CompressMode.TAR_GZ)=T -> return uncompressResult
[PATH2] if(!ourDir.exists())=T -> return ... | /* static context
[FOCAL] private static boolean FileUtils.unpackPackage(File ourDir, InputStream is, Map<String, String> md5List, CompressMode mode)
[PATH1] if(!ourDir.exists())=F -> if(mode == CompressMode.ZIP)=F -> if(mode == CompressMode.TAR_GZ)=T -> return uncompressResult
[PATH2] if(!ourDir.exists())=T -> return ... | true | ok | {"focal": {"class": "FileUtils", "name": "unpackPackage", "signature": "boolean unpackPackage(File ourDir, InputStream is, Map<String, String> md5List, CompressMode mode)", "start_line": 3, "modifiers": "private static", "params": [{"name": "ourDir", "type": "File"}, {"name": "is", "type": "InputStream"}, {"name": "md5... |
66157799_1 | class TeamService {
@TX
public List<Team> listEqual(Integer rating) {
return new Team().queryTeamsRatingEqualTo(rating);
}
public List<Team> listAll();
@TX public List<Team> listNotEqual(Integer rating);
@TX public List<Team> listBigger(Integer rating);
}
class TeamServiceTest {
@Test
public void ListEq... | List<Team> teams = teamServices.listEqual(10);
Assert.assertEquals(1, teams.size());
}
} | [FOCAL] @TX public List<Team> TeamService.listEqual(Integer rating)
[CLASS] class TeamService
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] new Team().queryTeamsRatingEqualTo/1
[NEW] Team
[INPUTS] branches=- | result=rating
[DATAFLOW] rating@param->L3
[CLASS-MEMBERS] List<Team> l... | /* static context
[FOCAL] @TX public List<Team> TeamService.listEqual(Integer rating)
[INPUTS] branches=- | result=rating
[NEW] Team
[CALLS-EXTERNAL] new Team().queryTeamsRatingEqualTo/1
*/
| /* static context
[FOCAL] @TX public List<Team> TeamService.listEqual(Integer rating)
[INPUTS] branches=- | result=rating
[NEW] Team
[CALLS-EXTERNAL] new Team().queryTeamsRatingEqualTo/1
*/
class TeamService {
@TX
public List<Team> listEqual(Integer rating) {
return new Team().queryTeamsRatingEqualTo(rating);
}
... | true | ok | {"focal": {"class": "TeamService", "name": "listEqual", "signature": "List<Team> listEqual(Integer rating)", "start_line": 3, "modifiers": "@TX public", "params": [{"name": "rating", "type": "Integer"}], "return_type": "List<Team>"}, "class_info": {"name": "TeamService", "kind": "class", "modifiers": "", "superclass": ... |
66187270_2 | class Waifu2xPyCloneNd4J {
public static INDArray padWithEdge(INDArray src, int len) {
int channel = src.size(0);
int height = src.size(1);
int width = src.size(2);
INDArray dst = Nd4j.zeros(channel, height + len * 2, width + len * 2);
for (int h = 0; h < dst.size(1); h++) ... | INDArray from = Nd4j.create(new double[] {
1, 2, 3, 4, 5, 6, 7, 8},
new int[] {2, 2, 2});
INDArray res = padWithEdge(from, 1);
assertThat(res.getInt(0, 0, 0), is(1));
assertThat(res.getInt(0, 0, 1), is(1));
assertThat(res.getInt(0, 0, 2), is(2));
... | [FOCAL] public static INDArray Waifu2xPyCloneNd4J.padWithEdge(INDArray src, int len)
[CLASS] class Waifu2xPyCloneNd4J
[METRICS] loc=23 cc=5 branches=1 loops=3 returns=1 throws=0 nesting=4
[CALLS-EXTERNAL] INDArray.size/1, Nd4j.zeros/3, INDArray.putScalar/2, INDArray.getFloat/1, min/2 (inherited), max/2 (inherited)
[PAT... | /* static context
[FOCAL] public static INDArray Waifu2xPyCloneNd4J.padWithEdge(INDArray src, int len)
[PATH1] for(h < dst.size(1))=T -> for(w < dst.size(2))=T -> for(c < channel)=T -> if(w < len || h < len || w > width - len - 1 || h > height - len - 1)=T -> exit loop -> exit loop -> exit loop -> return dst
[PATH2] fo... | /* static context
[FOCAL] public static INDArray Waifu2xPyCloneNd4J.padWithEdge(INDArray src, int len)
[PATH1] for(h < dst.size(1))=T -> for(w < dst.size(2))=T -> for(c < channel)=T -> if(w < len || h < len || w > width - len - 1 || h > height - len - 1)=T -> exit loop -> exit loop -> exit loop -> return dst
[PATH2] fo... | true | ok | {"focal": {"class": "Waifu2xPyCloneNd4J", "name": "padWithEdge", "signature": "INDArray padWithEdge(INDArray src, int len)", "start_line": 3, "modifiers": "public static", "params": [{"name": "src", "type": "INDArray"}, {"name": "len", "type": "int"}], "return_type": "INDArray"}, "class_info": {"name": "Waifu2xPyCloneN... |
66192759_3 | class Token implements Serializable {
public String getTokenId() {
return tokenId;
}
private Token(String uid, String nick, String avatar, String appKey, String tokenId);
public Token(String uid, String nick, String avatar, String appKey);
public void setTokenId(String tokenId);
pub... | Token t = new Token("1000", "n_1000", "a_1000", "key");
Assert.assertNotNull(t.getTokenId());
}
} | [FOCAL] public String Token.getTokenId()
[CLASS] class Token implements Serializable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] Token(String uid, String nick, String avatar, String appKey, String tokenId); Token(String uid, String nick, String avatar, String appKey); void setTo... | /* static context
[FOCAL] public String Token.getTokenId()
*/
| /* static context
[FOCAL] public String Token.getTokenId()
*/
class Token implements Serializable {
public String getTokenId() {
return tokenId;
}
private Token(String uid, String nick, String avatar, String appKey, String tokenId);
public Token(String uid, String nick, String avatar, String... | true | ok | {"focal": {"class": "Token", "name": "getTokenId", "signature": "String getTokenId()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "Token", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Serializable", "fields": [], "members": [{"name": "T... |
66259813_6 | class Actions {
public static <T> T from(Class<T> actionCreator) {
Object creator = classCache.get(actionCreator);
if (creator == null) {
creator = createCreator(actionCreator);
classCache.put(actionCreator, creator);
}
return (T) creator;
}
private ... | Creator creator = Actions.from(Creator.class);
Action action = creator.test3(42, "foobar");
assertEquals(Action.create("TEST3", 42, "foobar"), action);
}
} | [FOCAL] public static T Actions.from(Class<T> actionCreator)
[CLASS] class Actions
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] Object createCreator(Class<?> actionCreator)
[CALLS-EXTERNAL] classCache.get/1, classCache.put/2
[PATH1] if(creator == null)=T -> return (T) creator
[P... | /* static context
[FOCAL] public static T Actions.from(Class<T> actionCreator)
[PATH1] if(creator == null)=T -> return (T) creator
[PATH2] if(creator == null)=F -> return (T) creator
[INPUTS] branches=actionCreator | result=actionCreator
[COLLABORATORS] field classCache get/1,put/2
[CALLS-INTERNAL] Object createCreator... | /* static context
[FOCAL] public static T Actions.from(Class<T> actionCreator)
[PATH1] if(creator == null)=T -> return (T) creator
[PATH2] if(creator == null)=F -> return (T) creator
[INPUTS] branches=actionCreator | result=actionCreator
[COLLABORATORS] field classCache get/1,put/2
[CALLS-INTERNAL] Object createCreator... | true | ok | {"focal": {"class": "Actions", "name": "from", "signature": "T from(Class<T> actionCreator)", "start_line": 3, "modifiers": "public static", "params": [{"name": "actionCreator", "type": "Class<T>"}], "return_type": "T"}, "class_info": {"name": "Actions", "kind": "class", "modifiers": "", "superclass": null, "interfaces... |
66266995_14 | class NetworkManager {
int createNetwork(Params params) throws Exception {
Log.d(Tag.NAME, "Get connected network id...");
int connectedNetId = getConnectedNetworkWithSsid(params.quotedSsid);
if (connectedNetId != NO_ID) {
Log.d(Tag.NAME, "Configured network found. It is connect... | mData.whenNetworkIsConfigured();
assertEquals(NET_ID, mNetworkManager.createNetwork(UNSECURE_PARAMS));
}
} | [FOCAL] int NetworkManager.createNetwork(Params params)
[CLASS] class NetworkManager
[METRICS] loc=22 cc=4 branches=3 loops=0 returns=2 throws=1 nesting=2
[CALLS-INTERNAL] int addNetwork(Params params); int getConfiguredNetworkId(Params params); int getConnectedNetworkWithSsid(String maskedSsid)
[CALLS-EXTERNAL] Log.d/... | /* static context
[FOCAL] int NetworkManager.createNetwork(Params params)
[THROWS-WHEN] IllegalStateException when !(connectedNetId != NO_ID) && !(netId == NO_ID) && !mWifiManager.removeNetwork(netId)
[PATH1] if(connectedNetId != NO_ID)=F -> if(netId == NO_ID)=F -> if(!mWifiManager.removeNetwork(netId))=T -> throw new ... | /* static context
[FOCAL] int NetworkManager.createNetwork(Params params)
[THROWS-WHEN] IllegalStateException when !(connectedNetId != NO_ID) && !(netId == NO_ID) && !mWifiManager.removeNetwork(netId)
[PATH1] if(connectedNetId != NO_ID)=F -> if(netId == NO_ID)=F -> if(!mWifiManager.removeNetwork(netId))=T -> throw new ... | true | ok | {"focal": {"class": "NetworkManager", "name": "createNetwork", "signature": "int createNetwork(Params params) throws Exception", "start_line": 3, "modifiers": "", "params": [{"name": "params", "type": "Params"}], "return_type": "int"}, "class_info": {"name": "NetworkManager", "kind": "class", "modifiers": "", "supercla... |
66281816_15 | class RxTiPresenterDisposableHandler {
public Disposable manageViewDisposable(@NonNull final Disposable disposable) {
if (mUiDisposables == null) {
throw new IllegalStateException("view disposable can't be handled"
+ " when there is no view");
}
mUiDisposabl... | mPresenter.create();
mPresenter.attachView(mView);
final TestObserver<Integer> testObserver = new TestObserver<>();
mDisposableHandler.manageViewDisposable(testObserver);
assertThat(testObserver.isDisposed()).isFalse();
mPresenter.detachView();
assertThat(testOb... | [FOCAL] public Disposable RxTiPresenterDisposableHandler.manageViewDisposable(Disposable disposable)
[CLASS] class RxTiPresenterDisposableHandler
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] mUiDisposables.add/1
[NEW] IllegalStateException
[EXCEPTIONS] throws IllegalStateExcepti... | /* static context
[FOCAL] public Disposable RxTiPresenterDisposableHandler.manageViewDisposable(Disposable disposable)
[THROWS-WHEN] IllegalStateException when mUiDisposables == null
[PATH1] if(mUiDisposables == null)=T -> throw new IllegalStateException("view disposable can't be handled" + " wh...
[PATH2] if(mUiDispos... | /* static context
[FOCAL] public Disposable RxTiPresenterDisposableHandler.manageViewDisposable(Disposable disposable)
[THROWS-WHEN] IllegalStateException when mUiDisposables == null
[PATH1] if(mUiDisposables == null)=T -> throw new IllegalStateException("view disposable can't be handled" + " wh...
[PATH2] if(mUiDispos... | true | ok | {"focal": {"class": "RxTiPresenterDisposableHandler", "name": "manageViewDisposable", "signature": "Disposable manageViewDisposable(Disposable disposable)", "start_line": 3, "modifiers": "public", "params": [{"name": "disposable", "type": "Disposable"}], "return_type": "Disposable"}, "class_info": {"name": "RxTiPresent... |
66285950_133 | class ClusterAntiAffinityHostFilter implements HostSelectionFilter<PlacementHostSelectionTaskState> {
@Override
public void filter(final PlacementHostSelectionTaskState state,
final Map<String, HostSelection> hostSelectionMap,
final HostSelectionFilterCompletion callback) {
//I... | ContainerDescription desc = createDescription();
for (int i = 0; i < initialHostLinks.size() - 1; i++) {
String hostLink = expectedLinks.remove(i);
createContainer(desc, hostLink);
}
assertEquals(1, expectedLinks.size());
filter = new ClusterAntiAffinity... | [FOCAL] @Override public void ClusterAntiAffinityHostFilter.filter(PlacementHostSelectionTaskState state, Map<String, HostSelection> hostSelectionMap, HostSelectionFilterCompletion callback)
[CLASS] class ClusterAntiAffinityHostFilter implements HostSelectionFilter<PlacementHostSelectionTaskState>
[METRICS] loc=14 cc=2... | /* static context
[FOCAL] @Override public void ClusterAntiAffinityHostFilter.filter(PlacementHostSelectionTaskState state, Map<String, HostSelection> hostSelectionMap, HostSelectionFilterCompletion callback)
[PATH1] if((!isActive() && state.resourceCount <= 1 && state.getCustomProperty(RequestUtils.CLUSTERING_OPERATIO... | /* static context
[FOCAL] @Override public void ClusterAntiAffinityHostFilter.filter(PlacementHostSelectionTaskState state, Map<String, HostSelection> hostSelectionMap, HostSelectionFilterCompletion callback)
[PATH1] if((!isActive() && state.resourceCount <= 1 && state.getCustomProperty(RequestUtils.CLUSTERING_OPERATIO... | true | ok | {"focal": {"class": "ClusterAntiAffinityHostFilter", "name": "filter", "signature": "void filter(PlacementHostSelectionTaskState state, Map<String, HostSelection> hostSelectionMap, HostSelectionFilterCompletion callback)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "state", "type": "Placement... |
66321621_1 | class SampleActor extends AbstractActor {
public SampleActor() {
receive(ReceiveBuilder.
match(Double.class, d -> {
sender().tell(d.isNaN() ? 0 : d, self());
}).
match(Integer.class, i -> {
sender().tell(i * 10, self());
}).
match(String.class, s -> s.startsWith("gua... | new JavaTestKit(system) {{
final ActorRef subject = system.actorOf(Props.create(SampleActor.class), "sample-actor");
final ActorRef probeRef = getRef();
subject.tell(47.11, probeRef);
subject.tell("and no guard in the beginning", probeRef);
subject.tell("guard is a good thing", probeR... | [FOCAL] public SampleActor.SampleActor()
[CLASS] class SampleActor extends AbstractActor
[METRICS] loc=14 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] receive/1 (inherited), ReceiveBuilder. match(Double.class, d -> { sender().tell(....build/0, ReceiveBuilder. match(Double.class, d -> { sender()... | /* static context
[FOCAL] public SampleActor.SampleActor()
[COLLABORATORS] field d isNaN/0; field s startsWith/1,toUpperCase/0
[CALLS-EXTERNAL] receive/1 (inherited), ReceiveBuilder. match(Double.class, d -> { sender().tell(....build/0, ReceiveBuilder. match(Double.class, d -> { sender().tell(....match/3, ReceiveBuilde... | /* static context
[FOCAL] public SampleActor.SampleActor()
[COLLABORATORS] field d isNaN/0; field s startsWith/1,toUpperCase/0
[CALLS-EXTERNAL] receive/1 (inherited), ReceiveBuilder. match(Double.class, d -> { sender().tell(....build/0, ReceiveBuilder. match(Double.class, d -> { sender().tell(....match/3, ReceiveBuilde... | true | ok | {"focal": {"class": "SampleActor", "name": "SampleActor", "signature": "SampleActor()", "start_line": 3, "modifiers": "public", "params": [], "return_type": null}, "class_info": {"name": "SampleActor", "kind": "class", "modifiers": "", "superclass": "AbstractActor", "interfaces": null, "fields": [{"name": "system", "ty... |
66343128_20 | class KafkaCollector implements CollectorComponent {
public static Builder builder() {
return new Builder();
}
public KafkaCollector(Builder builder);
@Override public KafkaCollector start();
@Override public CheckResult check();
@Override public void close();
@Rule
public ExpectedException thr... | KafkaCollector.Builder builder = builder("consumer_exception");
AtomicInteger counter = new AtomicInteger();
consumer = (spans, callback) -> {
if (counter.getAndIncrement() == 1) {
callback.onError(new RuntimeException("storage fell over"));
} else {
recvdSpans.add(spans);
... | [FOCAL] public static Builder KafkaCollector.builder()
[CLASS] class KafkaCollector implements CollectorComponent
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] Builder
[CLASS-MEMBERS] KafkaCollector(Builder builder); KafkaCollector start(); CheckResult check(); void close()
[TEST] KafkaColl... | /* static context
[FOCAL] public static Builder KafkaCollector.builder()
[NEW] Builder
*/
| /* static context
[FOCAL] public static Builder KafkaCollector.builder()
[NEW] Builder
*/
class KafkaCollector implements CollectorComponent {
public static Builder builder() {
return new Builder();
}
public KafkaCollector(Builder builder);
@Override public KafkaCollector start();
@Override public Che... | true | ok | {"focal": {"class": "KafkaCollector", "name": "builder", "signature": "Builder builder()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Builder"}, "class_info": {"name": "KafkaCollector", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "CollectorComponent", "fields": ... |
66507191_1 | class LegislatorRepository {
public ResponseContainer<List<Legislator>> fetchLegislatorListByCoordinates(Location location) {
NetworkResponse<LegislatorResponse> networkResponse = NetworkExecutor.execute(mOkHttpClient, new GetLegislatorsByCoordinates(location), new JsonObjectResponseHandler<LegislatorRespo... | Location location = mock(Location.class);
Mockito.when(location.getLatitude()).thenReturn(32.961790);
Mockito.when(location.getLongitude()).thenReturn(-96.829169);
ResponseContainer<List<Legislator>> legislatorResponse = mLegislatorRepository.fetchLegislatorListByCoordinates(location);
... | [FOCAL] public ResponseContainer<List<Legislator>> LegislatorRepository.fetchLegislatorListByCoordinates(Location location)
[CLASS] class LegislatorRepository
[METRICS] loc=14 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] List<Legislator> processServerLegislatorList(NetworkResponse<LegislatorRes... | /* static context
[FOCAL] public ResponseContainer<List<Legislator>> LegislatorRepository.fetchLegislatorListByCoordinates(Location location)
[PATH1] if(networkResponse.isSuccess())=T -> return new ResponseContainer<>(processServerLegislatorList(networkResponse...
[PATH2] if(networkResponse.isSuccess())=F -> return new... | /* static context
[FOCAL] public ResponseContainer<List<Legislator>> LegislatorRepository.fetchLegislatorListByCoordinates(Location location)
[PATH1] if(networkResponse.isSuccess())=T -> return new ResponseContainer<>(processServerLegislatorList(networkResponse...
[PATH2] if(networkResponse.isSuccess())=F -> return new... | true | ok | {"focal": {"class": "LegislatorRepository", "name": "fetchLegislatorListByCoordinates", "signature": "ResponseContainer<List<Legislator>> fetchLegislatorListByCoordinates(Location location)", "start_line": 3, "modifiers": "public", "params": [{"name": "location", "type": "Location"}], "return_type": "ResponseContainer<... |
66541104_0 | class LoadPatchError {
public static LoadPatchError record(int type, Exception e) {
return new LoadPatchError(type, e);
}
public LoadPatchError(int type, Exception exception);
public int getType();
public Exception getException();
}
class LoadPatchErrorTest {
@Test
public void... | Exception err = new RuntimeException("mock exception");
LoadPatchError recordedError = LoadPatchError.record(LoadPatchError.LOAD_ERR, err);
Assert.assertEquals(err, recordedError.getException());
Assert.assertEquals(LoadPatchError.LOAD_ERR, recordedError.getType());
}
} | [FOCAL] public static LoadPatchError LoadPatchError.record(int type, Exception e)
[CLASS] class LoadPatchError
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] LoadPatchError
[INPUTS] branches=- | result=e, type
[DATAFLOW] e@param->L2; type@param->L2
[CLASS-MEMBERS] LoadPatchError(int type, Ex... | /* static context
[FOCAL] public static LoadPatchError LoadPatchError.record(int type, Exception e)
[INPUTS] branches=- | result=e, type
[NEW] LoadPatchError
*/
| /* static context
[FOCAL] public static LoadPatchError LoadPatchError.record(int type, Exception e)
[INPUTS] branches=- | result=e, type
[NEW] LoadPatchError
*/
class LoadPatchError {
public static LoadPatchError record(int type, Exception e) {
return new LoadPatchError(type, e);
}
public LoadPat... | true | ok | {"focal": {"class": "LoadPatchError", "name": "record", "signature": "LoadPatchError record(int type, Exception e)", "start_line": 3, "modifiers": "public static", "params": [{"name": "type", "type": "int"}, {"name": "e", "type": "Exception"}], "return_type": "LoadPatchError"}, "class_info": {"name": "LoadPatchError", ... |
66572810_1 | class GRPCClient implements HLAPI {
@Override
public HLAPITransaction getTransaction(TID hash) throws HLAPIException {
try {
ByteString result = query("getTran", Collections.singletonList(hash.toString()));
byte[] resultStr = result.toByteArray();
if (resultStr.lengt... | assertNull(client.getTransaction(TID.INVALID));
}
} | [FOCAL] @Override public HLAPITransaction GRPCClient.getTransaction(TID hash)
[CLASS] class GRPCClient implements HLAPI
[METRICS] loc=20 cc=7 branches=4 loops=0 returns=5 throws=2 nesting=2
[CALLS-INTERNAL] ByteString query(String functionName, Collection<String> args)
[CALLS-EXTERNAL] Collections.singletonList/1, TID.... | /* static context
[FOCAL] @Override public HLAPITransaction GRPCClient.getTransaction(TID hash)
[THROWS-WHEN] e when try-body throws && !(e.getMessage().contains(NOT_FOUND))
[THROWS-WHEN] HLAPIException when try-body throws
[PATH1] if(resultStr.length == 0)=F -> if(result.toString("UTF8").contains(NOT_FOUND))=F -> if(!... | /* static context
[FOCAL] @Override public HLAPITransaction GRPCClient.getTransaction(TID hash)
[THROWS-WHEN] e when try-body throws && !(e.getMessage().contains(NOT_FOUND))
[THROWS-WHEN] HLAPIException when try-body throws
[PATH1] if(resultStr.length == 0)=F -> if(result.toString("UTF8").contains(NOT_FOUND))=F -> if(!... | true | ok | {"focal": {"class": "GRPCClient", "name": "getTransaction", "signature": "HLAPITransaction getTransaction(TID hash) throws HLAPIException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "hash", "type": "TID"}], "return_type": "HLAPITransaction"}, "class_info": {"name": "GRPCClient", "kind": "cla... |
66596294_0 | class Matherator implements Adder, Subtractor, Multiplier, Divider, Power {
@Override
public long add(long... operands) {
long ret = 0;
for (long operand : operands) {
ret += operand;
}
return ret;
}
@Override public long subtract(long... operands);
@Override public long multiply(long.... | // Let Java add it up
long result = 10 + 23 + (-1) + 16;
// Compare that to what the Matherator gives us
assertEquals(result, classUnderTest.add(10, 23, -1, 16));
result = 100 + 102;
assertEquals(result, classUnderTest.add(100 + 102));
result = 0;
assertEquals(result, classUnderTest.ad... | [FOCAL] @Override public long Matherator.add(long... operands)
[CLASS] class Matherator implements Adder, Subtractor, Multiplier, Divider, Power
[METRICS] loc=8 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[PATH1] foreach(long operand : operands)=T -> exit loop -> return ret
[PATH2] foreach(long operand : opera... | /* static context
[FOCAL] @Override public long Matherator.add(long... operands)
[PATH1] foreach(long operand : operands)=T -> exit loop -> return ret
[PATH2] foreach(long operand : operands)=F -> return ret
[INPUTS] branches=operands | result=operands
*/
| /* static context
[FOCAL] @Override public long Matherator.add(long... operands)
[PATH1] foreach(long operand : operands)=T -> exit loop -> return ret
[PATH2] foreach(long operand : operands)=F -> return ret
[INPUTS] branches=operands | result=operands
*/
class Matherator implements Adder, Subtractor, Multiplier, Divid... | true | ok | {"focal": {"class": "Matherator", "name": "add", "signature": "long add(long... operands)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "operands", "type": "long..."}], "return_type": "long"}, "class_info": {"name": "Matherator", "kind": "class", "modifiers": "", "superclass": null, "interface... |
66666501_63 | class AbstractErrorSqlConnection implements Connection {
@Override
public int getNetworkTimeout() throws SQLException {
throw error();
}
public AbstractErrorSqlConnection(Runnable errorThrownListener, SQLException error);
public AbstractErrorSqlConnection(Runnable errorThrownListener, RuntimeException... | verifyAction(connection::getNetworkTimeout);
}
} | [FOCAL] @Override public int AbstractErrorSqlConnection.getNetworkTimeout()
[CLASS] class AbstractErrorSqlConnection implements Connection
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=1 nesting=0
[CALLS-INTERNAL] SQLException error()
[EXCEPTIONS] declares SQLException; throws throw error()
[THROWS-WHEN] err... | /* static context
[FOCAL] @Override public int AbstractErrorSqlConnection.getNetworkTimeout()
[THROWS-WHEN] error() when always
[EXCEPTIONS] declares SQLException; throws throw error()
[CALLS-INTERNAL] SQLException error()
*/
| /* static context
[FOCAL] @Override public int AbstractErrorSqlConnection.getNetworkTimeout()
[THROWS-WHEN] error() when always
[EXCEPTIONS] declares SQLException; throws throw error()
[CALLS-INTERNAL] SQLException error()
*/
class AbstractErrorSqlConnection implements Connection {
@Override
public int getNetworkT... | true | ok | {"focal": {"class": "AbstractErrorSqlConnection", "name": "getNetworkTimeout", "signature": "int getNetworkTimeout() throws SQLException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "AbstractErrorSqlConnection", "kind": "class", "modifiers": "", "superc... |
66676274_2347 | class TipoUsoMdtoON extends BaseBusiness {
public List<AfaTipoUsoMdto> pesquisar(Integer firstResult,
Integer maxResult, String orderProperty, boolean asc,
AfaTipoUsoMdto elemento) {
return getAfaTipoUsoMdtoDAO().pesquisar(firstResult, maxResult,
orderProperty, asc, elemento);
}
@Override @Deprecated ... |
// mockingContext.checking(new Expectations() {
// {
// oneOf(mockedAfaTipoUsoMdtoDAO).pesquisar(
// with(any(Integer.class)), with(any(Integer.class)),
// with(any(String.class)), with(any(Boolean.class)),
// with(any(AfaTipoUsoMdto.class)));
// will(returnValue(Collections.singletonList(tipoU... | [FOCAL] public List<AfaTipoUsoMdto> TipoUsoMdtoON.pesquisar(Integer firstResult, Integer maxResult, String orderProperty, boolean asc, AfaTipoUsoMdto elemento)
[CLASS] class TipoUsoMdtoON extends BaseBusiness
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] AfaTipoUsoMdtoDAO getAfaT... | /* static context
[FOCAL] public List<AfaTipoUsoMdto> TipoUsoMdtoON.pesquisar(Integer firstResult, Integer maxResult, String orderProperty, boolean asc, AfaTipoUsoMdto elemento)
[INPUTS] branches=- | result=asc, elemento, firstResult, maxResult, orderProperty
[CALLS-INTERNAL] AfaTipoUsoMdtoDAO getAfaTipoUsoMdtoDAO()
[C... | /* static context
[FOCAL] public List<AfaTipoUsoMdto> TipoUsoMdtoON.pesquisar(Integer firstResult, Integer maxResult, String orderProperty, boolean asc, AfaTipoUsoMdto elemento)
[INPUTS] branches=- | result=asc, elemento, firstResult, maxResult, orderProperty
[CALLS-INTERNAL] AfaTipoUsoMdtoDAO getAfaTipoUsoMdtoDAO()
[C... | true | ok | {"focal": {"class": "TipoUsoMdtoON", "name": "pesquisar", "signature": "List<AfaTipoUsoMdto> pesquisar(Integer firstResult, Integer maxResult, String orderProperty, boolean asc, AfaTipoUsoMdto elemento)", "start_line": 3, "modifiers": "public", "params": [{"name": "firstResult", "type": "Integer"}, {"name": "maxResult"... |
66750234_31 | class FeedModelMapper {
public FeedModel transform(Feed entity){
FeedModel feed = new FeedModel();
feed.setImage(entity.getImage());
feed.setBody(entity.getBody());
feed.setTitle(entity.getTitle());
feed.setIndex(entity.getIndex());
return feed;
}
@Inject ... | WrittenModel written = mapper.transform(createDummyWritten());
assertThat(written, is(instanceOf(WrittenModel.class)));
}
} | [FOCAL] public FeedModel FeedModelMapper.transform(Feed entity)
[CLASS] class FeedModelMapper
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] FeedModel.setImage/1, Feed.getImage/0, FeedModel.setBody/1, Feed.getBody/0, FeedModel.setTitle/1, Feed.getTitle/0, FeedModel.setIndex/1, Fe... | /* static context
[FOCAL] public FeedModel FeedModelMapper.transform(Feed entity)
[COLLABORATORS] param entity:Feed getImage/0,getBody/0,getTitle/0,getIndex/0
[NEW] FeedModel
[CALLS-EXTERNAL] FeedModel.setImage/1, Feed.getImage/0, FeedModel.setBody/1, Feed.getBody/0, FeedModel.setTitle/1, Feed.getTitle/0, FeedModel.set... | /* static context
[FOCAL] public FeedModel FeedModelMapper.transform(Feed entity)
[COLLABORATORS] param entity:Feed getImage/0,getBody/0,getTitle/0,getIndex/0
[NEW] FeedModel
[CALLS-EXTERNAL] FeedModel.setImage/1, Feed.getImage/0, FeedModel.setBody/1, Feed.getBody/0, FeedModel.setTitle/1, Feed.getTitle/0, FeedModel.set... | true | ok | {"focal": {"class": "FeedModelMapper", "name": "transform", "signature": "FeedModel transform(Feed entity)", "start_line": 3, "modifiers": "public", "params": [{"name": "entity", "type": "Feed"}], "return_type": "FeedModel"}, "class_info": {"name": "FeedModelMapper", "kind": "class", "modifiers": "", "superclass": null... |
66772740_9 | class ImagePlane implements Comparable<ImagePlane> {
@Override
public int compareTo(ImagePlane o) {
int tCompare = Integer.compare(t, o.t);
if (tCompare != 0)
return tCompare;
int zCompare = Integer.compare(z, o.z);
if (zCompare != 0)
return zCompare;
return Integer.compare(c, o.c);
}
private Ima... |
ImagePlane pDefault = ImagePlane.getDefaultPlane();
ImagePlane p000 = ImagePlane.getPlaneWithChannel(0, 0, 0);
ImagePlane p100 = ImagePlane.getPlaneWithChannel(1, 0, 0);
ImagePlane p010 = ImagePlane.getPlaneWithChannel(0, 1, 0);
ImagePlane p001 = ImagePlane.getPlaneWithChannel(0, 0, 1);
ImagePlane p11... | [FOCAL] @Override public int ImagePlane.compareTo(ImagePlane o)
[CLASS] class ImagePlane implements Comparable<ImagePlane>
[METRICS] loc=10 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[CALLS-EXTERNAL] Integer.compare/2
[PATH1] if(tCompare != 0)=F -> if(zCompare != 0)=T -> return zCompare
[PATH2] if(tCompare !=... | /* static context
[FOCAL] @Override public int ImagePlane.compareTo(ImagePlane o)
[PATH1] if(tCompare != 0)=F -> if(zCompare != 0)=T -> return zCompare
[PATH2] if(tCompare != 0)=T -> return tCompare
[PATH3] if(tCompare != 0)=F -> if(zCompare != 0)=F -> return Integer.compare(c, o.c)
[INPUTS] branches=o | result=o
[CALL... | /* static context
[FOCAL] @Override public int ImagePlane.compareTo(ImagePlane o)
[PATH1] if(tCompare != 0)=F -> if(zCompare != 0)=T -> return zCompare
[PATH2] if(tCompare != 0)=T -> return tCompare
[PATH3] if(tCompare != 0)=F -> if(zCompare != 0)=F -> return Integer.compare(c, o.c)
[INPUTS] branches=o | result=o
[CALL... | true | ok | {"focal": {"class": "ImagePlane", "name": "compareTo", "signature": "int compareTo(ImagePlane o)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "o", "type": "ImagePlane"}], "return_type": "int"}, "class_info": {"name": "ImagePlane", "kind": "class", "modifiers": "", "superclass": null, "interfa... |
66862644_7 | class ImageDecoder {
Dimension decodeBmpDimension(BufferedSource bmpSource) throws IOException {
// Bmp stores in little endian
bmpSource.skip(18);
int w = bmpSource.readIntLe();
int h = bmpSource.readIntLe();
return new Dimension(w, h);
}
Dimension decodeJpegDime... | URL bmp = ImageDecoderTest.class.getClassLoader().getResource("4x4.bmp");
FileInputStream inputStream = new FileInputStream((bmp == null) ? "" : bmp.getPath());
Dimension dimension = decoder.decodeBmpDimension(Okio.buffer(Okio.source(inputStream)));
assertEquals(dimension.getWidth(), 4)... | [FOCAL] Dimension ImageDecoder.decodeBmpDimension(BufferedSource bmpSource)
[CLASS] class ImageDecoder
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] BufferedSource.skip/1, BufferedSource.readIntLe/0
[NEW] Dimension
[EXCEPTIONS] declares IOException
[INPUTS] branches=- | result=bm... | /* static context
[FOCAL] Dimension ImageDecoder.decodeBmpDimension(BufferedSource bmpSource)
[INPUTS] branches=- | result=bmpSource
[COLLABORATORS] param bmpSource:BufferedSource skip/1,readIntLe/0
[EXCEPTIONS] declares IOException
[NEW] Dimension
[CALLS-EXTERNAL] BufferedSource.skip/1, BufferedSource.readIntLe/0
*/
| /* static context
[FOCAL] Dimension ImageDecoder.decodeBmpDimension(BufferedSource bmpSource)
[INPUTS] branches=- | result=bmpSource
[COLLABORATORS] param bmpSource:BufferedSource skip/1,readIntLe/0
[EXCEPTIONS] declares IOException
[NEW] Dimension
[CALLS-EXTERNAL] BufferedSource.skip/1, BufferedSource.readIntLe/0
*/
c... | true | ok | {"focal": {"class": "ImageDecoder", "name": "decodeBmpDimension", "signature": "Dimension decodeBmpDimension(BufferedSource bmpSource) throws IOException", "start_line": 3, "modifiers": "", "params": [{"name": "bmpSource", "type": "BufferedSource"}], "return_type": "Dimension"}, "class_info": {"name": "ImageDecoder", "... |
66888160_0 | class CliLtrTools {
public static void main(String args[]) {
Options options = initOptions();
HelpFormatter formatter = new HelpFormatter();
CommandLineParser parser = new DefaultParser();
try {
// parse the command line arguments
CommandLine line = parser.p... | String[] args=new String[]{"-help"};
CliLtrTools.main(args);
final String expectedHelpMessage = "usage: ltr-tools\n" +
" -categoricalFeatures <file> use given list of categorical features\n" +
" -features <file> use given mapping file to resolve the\n" +
... | [FOCAL] public static void CliLtrTools.main(String args)
[CLASS] class CliLtrTools
[METRICS] loc=25 cc=6 branches=1 loops=0 returns=0 throws=0 nesting=2
[CALLS-INTERNAL] Options initOptions(); void selectAndRunTool(CommandLine line)
[CALLS-EXTERNAL] CommandLineParser.parse/2, CommandLine.hasOption/1, HelpFormatter.prin... | /* static context
[FOCAL] public static void CliLtrTools.main(String args)
[PATH1] try-body throws
[PATH2] if(line.hasOption(HELP))=T
[PATH3] if(line.hasOption(HELP))=F
[INPUTS] branches=args | result=-
[EXCEPTIONS] catches ParseException e, IOException e, SolrServerException e, RuntimeException e
[CALLS-INTERNAL] Opti... | /* static context
[FOCAL] public static void CliLtrTools.main(String args)
[PATH1] try-body throws
[PATH2] if(line.hasOption(HELP))=T
[PATH3] if(line.hasOption(HELP))=F
[INPUTS] branches=args | result=-
[EXCEPTIONS] catches ParseException e, IOException e, SolrServerException e, RuntimeException e
[CALLS-INTERNAL] Opti... | true | ok | {"focal": {"class": "CliLtrTools", "name": "main", "signature": "void main(String args)", "start_line": 3, "modifiers": "public static", "params": [{"name": "args", "type": "String"}], "return_type": "void"}, "class_info": {"name": "CliLtrTools", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null,... |
66918551_0 | class ExampleConsumer {
Future<HonoConnection> clientFactoryConnect(DisconnectListener<HonoConnection> disconnectHandler) {
LOG.info("Connecting to IoT Hub messaging endpoint...");
clientFactory.addDisconnectListener(disconnectHandler);
return clientFactory.connect();
}
void setCl... | final Async async = context.async();
final String testName = "Hono Client: IoT Hub Connection Test.";
LOG.info("[{}]: Starting...", testName);
exampleConsumer.clientFactoryConnect(null).setHandler(clientConnected -> {
context.assertTrue(clientConnected.succeeded(), "[" + te... | [FOCAL] Future<HonoConnection> ExampleConsumer.clientFactoryConnect(DisconnectListener<HonoConnection> disconnectHandler)
[CLASS] class ExampleConsumer
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Logger.info/1, ApplicationClientFactory.addDisconnectListener/1, ApplicationClient... | /* static context
[FOCAL] Future<HonoConnection> ExampleConsumer.clientFactoryConnect(DisconnectListener<HonoConnection> disconnectHandler)
[INPUTS] branches=- | result=clientFactory
[COLLABORATORS] field clientFactory:ApplicationClientFactory addDisconnectListener/1,connect/0
[FIELDS] read=LOG:Logger, clientFactory:Ap... | /* static context
[FOCAL] Future<HonoConnection> ExampleConsumer.clientFactoryConnect(DisconnectListener<HonoConnection> disconnectHandler)
[INPUTS] branches=- | result=clientFactory
[COLLABORATORS] field clientFactory:ApplicationClientFactory addDisconnectListener/1,connect/0
[FIELDS] read=LOG:Logger, clientFactory:Ap... | true | ok | {"focal": {"class": "ExampleConsumer", "name": "clientFactoryConnect", "signature": "Future<HonoConnection> clientFactoryConnect(DisconnectListener<HonoConnection> disconnectHandler)", "start_line": 3, "modifiers": "", "params": [{"name": "disconnectHandler", "type": "DisconnectListener<HonoConnection>"}], "return_type... |
66920833_2 | class CppBean {
public Class getJavaClass() {
return javaClass;
}
public CppBean(Class javaClass, String nativePath);
public CppBean(Class javaClass, String cppClassName, String nativePath);
private void createDeclarationIfFieldsMapIsSuccessful();
private boolean generateFullPath();... | assertEquals(VectorBean.class, testSubject.getJavaClass());
}
} | [FOCAL] public Class CppBean.getJavaClass()
[CLASS] class CppBean
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] CppBean(Class javaClass, String nativePath); CppBean(Class javaClass, String cppClassName, String nativePath); void createDeclarationIfFieldsMapIsSuccessful(); boolean g... | /* static context
[FOCAL] public Class CppBean.getJavaClass()
*/
| /* static context
[FOCAL] public Class CppBean.getJavaClass()
*/
class CppBean {
public Class getJavaClass() {
return javaClass;
}
public CppBean(Class javaClass, String nativePath);
public CppBean(Class javaClass, String cppClassName, String nativePath);
private void createDeclarationI... | true | ok | {"focal": {"class": "CppBean", "name": "getJavaClass", "signature": "Class getJavaClass()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Class"}, "class_info": {"name": "CppBean", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "EXPECTED_CLASS_NAME"... |
66977907_0 | class CsProjFile implements DotnetProjectFile {
@Override
public List<DotnetProjectDependency> getDependencies() {
final List<DotnetProjectDependency> list = new ArrayList<>();
final NodeList packageRefElems =
(NodeList) xpath("/Project/ItemGroup/PackageReference", XPathConstan... | assertThat(file1_xUnit.getDependencies()).isNotEmpty().hasSize(3);
assertThat(file2_msTest.getDependencies()).isNotEmpty().hasSize(3);
assertThat(file3_webApp.getDependencies()).isNotEmpty().hasSize(5);
assertThat(file3_webApp.getDependencies())
.contains(new DotnetProje... | [FOCAL] @Override public List<DotnetProjectDependency> CsProjFile.getDependencies()
[CLASS] class CsProjFile implements DotnetProjectFile
[METRICS] loc=18 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] Object xpath(String expression, QName returnType)
[CALLS-EXTERNAL] NodeList.getLength/0, NodeLi... | /* static context
[FOCAL] @Override public List<DotnetProjectDependency> CsProjFile.getDependencies()
[PATH1] if(packageRefElems != null && packageRefElems.getLength() > 0)=T -> for(i < packageRefElems.getLength())=T -> exit loop -> return list
[PATH2] if(packageRefElems != null && packageRefElems.getLength() > 0)=F ->... | /* static context
[FOCAL] @Override public List<DotnetProjectDependency> CsProjFile.getDependencies()
[PATH1] if(packageRefElems != null && packageRefElems.getLength() > 0)=T -> for(i < packageRefElems.getLength())=T -> exit loop -> return list
[PATH2] if(packageRefElems != null && packageRefElems.getLength() > 0)=F ->... | true | ok | {"focal": {"class": "CsProjFile", "name": "getDependencies", "signature": "List<DotnetProjectDependency> getDependencies()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "List<DotnetProjectDependency>"}, "class_info": {"name": "CsProjFile", "kind": "class", "modifiers": "", "superclass... |
67013967_7 | class Expectation {
boolean gradesContains(int grade) {
return this.grades.contains(grade);
}
Expectation(String description, List<Integer> grades, Trait trait, String subTrait);
Trait getTrait();
String getDescription();
static Expectation parse(String csvString);
String get... |
Expectation expectation = new Expectation.Builder()
.withDescription("A")
.forTrait(Trait.DEX)
.forGrades("3|4|5")
.build();
assertTrue(expectation.gradesContains(3));
assertTrue(expectation.gradesContains(4));
assertTrue(... | [FOCAL] boolean Expectation.gradesContains(int grade)
[CLASS] class Expectation
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] this.grades.contains/1
[FIELDS] read=grades
[INPUTS] branches=- | result=grade
[COLLABORATORS] field grades contains/1
[DATAFLOW] grade@param->L2
[CLASS-M... | /* static context
[FOCAL] boolean Expectation.gradesContains(int grade)
[INPUTS] branches=- | result=grade
[COLLABORATORS] field grades contains/1
[FIELDS] read=grades
[CALLS-EXTERNAL] this.grades.contains/1
*/
| /* static context
[FOCAL] boolean Expectation.gradesContains(int grade)
[INPUTS] branches=- | result=grade
[COLLABORATORS] field grades contains/1
[FIELDS] read=grades
[CALLS-EXTERNAL] this.grades.contains/1
*/
class Expectation {
boolean gradesContains(int grade) {
return this.grades.contains(grade);
... | true | ok | {"focal": {"class": "Expectation", "name": "gradesContains", "signature": "boolean gradesContains(int grade)", "start_line": 3, "modifiers": "", "params": [{"name": "grade", "type": "int"}], "return_type": "boolean"}, "class_info": {"name": "Expectation", "kind": "class", "modifiers": "", "superclass": null, "interface... |
67037282_0 | class CurrencyUtil {
public static String format(Locale locale, Currency currency, double value) {
NumberFormat format = NumberFormat.getCurrencyInstance(locale);
format.setCurrency(currency);
format.setMaximumFractionDigits(currency.getDefaultFractionDigits());
format.setGroupingUs... | String formatted = CurrencyUtil.format(new Locale("SV"), Currency.getInstance("SEK"), 3000000.5d);
Assert.assertEquals("SEK 3 000 000,50", formatted); //not white spaces, but the \x{A0} character (no-break space)
}
} | [FOCAL] public static String CurrencyUtil.format(Locale locale, Currency currency, double value)
[CLASS] class CurrencyUtil
[METRICS] loc=17 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] NumberFormat.getCurrencyInstance/1, NumberFormat.setCurrency/1, NumberFormat.setMaximumFractionDigits/1, Curr... | /* static context
[FOCAL] public static String CurrencyUtil.format(Locale locale, Currency currency, double value)
[PATH1] if(isCurrencySymbolBeforeValueInLocale && !formatted.contains(" "))=T -> return symbol + " " + valueString
[PATH2] if(isCurrencySymbolBeforeValueInLocale && !formatted.contains(" "))=F -> return fo... | /* static context
[FOCAL] public static String CurrencyUtil.format(Locale locale, Currency currency, double value)
[PATH1] if(isCurrencySymbolBeforeValueInLocale && !formatted.contains(" "))=T -> return symbol + " " + valueString
[PATH2] if(isCurrencySymbolBeforeValueInLocale && !formatted.contains(" "))=F -> return fo... | true | ok | {"focal": {"class": "CurrencyUtil", "name": "format", "signature": "String format(Locale locale, Currency currency, double value)", "start_line": 3, "modifiers": "public static", "params": [{"name": "locale", "type": "Locale"}, {"name": "currency", "type": "Currency"}, {"name": "value", "type": "double"}], "return_type... |
67046748_0 | class LongStringUtils {
public static int getLengthOfLongestWord(String string)
{
int longestWordLength = 0;
Matcher m = Pattern.compile("\\s*(\\S+)", Pattern.CASE_INSENSITIVE | Pattern.MULTILINE).matcher(string);
while(m.find())
{
longestWordLength = Math.max(longestWordLength, m.group(1).length());
}
... | Assert.assertEquals(9, LongStringUtils.getLengthOfLongestWord("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS"));
}
} | [FOCAL] public static int LongStringUtils.getLengthOfLongestWord(String string)
[CLASS] class LongStringUtils
[METRICS] loc=10 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] Pattern.compile("\\s*(\\S+)", Pattern.CASE_INSENSITIVE | ....matcher/1, Pattern.compile/2, Matcher.find/0, Math.max/2, m.gr... | /* static context
[FOCAL] public static int LongStringUtils.getLengthOfLongestWord(String string)
[PATH1] while(m.find())=T -> exit loop -> return longestWordLength
[PATH2] while(m.find())=F -> return longestWordLength
[INPUTS] branches=string | result=string
[CALLS-EXTERNAL] Pattern.compile("\\s*(\\S+)", Pattern.CASE_... | /* static context
[FOCAL] public static int LongStringUtils.getLengthOfLongestWord(String string)
[PATH1] while(m.find())=T -> exit loop -> return longestWordLength
[PATH2] while(m.find())=F -> return longestWordLength
[INPUTS] branches=string | result=string
[CALLS-EXTERNAL] Pattern.compile("\\s*(\\S+)", Pattern.CASE_... | true | ok | {"focal": {"class": "LongStringUtils", "name": "getLengthOfLongestWord", "signature": "int getLengthOfLongestWord(String string)", "start_line": 3, "modifiers": "public static", "params": [{"name": "string", "type": "String"}], "return_type": "int"}, "class_info": {"name": "LongStringUtils", "kind": "class", "modifiers... |
67053037_36 | class MethodHandlerChain implements MethodHandler, MethodFilter {
@Override
public Object invoke(Object self, Method thisMethod, Method proceed, Object[] args) throws Throwable {
for (ConditionalMethodHandler handler : delegateHandlers) {
if (handler.supports(thisMethod)) {
return handler.invoke(self, thisM... |
// CHECKSTYLE:ON
Method method = ResourceContent.class.getMethod("method1");
ConditionalMethodHandler expectedHandler = newHandlerSupportedFor(method);
MethodHandlerChain chain = new MethodHandlerChain(asList(
newHandlerUnsupportedFor(method),
expectedHandler,
newHandlerSupportedFor(method)... | [FOCAL] @Override public Object MethodHandlerChain.invoke(Object self, Method thisMethod, Method proceed, Object[] args)
[CLASS] class MethodHandlerChain implements MethodHandler, MethodFilter
[METRICS] loc=10 cc=3 branches=1 loops=1 returns=1 throws=1 nesting=2
[CALLS-EXTERNAL] ConditionalMethodHandler.supports/1, Con... | /* static context
[FOCAL] @Override public Object MethodHandlerChain.invoke(Object self, Method thisMethod, Method proceed, Object[] args)
[THROWS-WHEN] IllegalStateException when foreach(ConditionalMethodHandler handler : delegateHandlers)=T && !handler.supports(thisMethod)
[THROWS-WHEN] IllegalStateException when for... | /* static context
[FOCAL] @Override public Object MethodHandlerChain.invoke(Object self, Method thisMethod, Method proceed, Object[] args)
[THROWS-WHEN] IllegalStateException when foreach(ConditionalMethodHandler handler : delegateHandlers)=T && !handler.supports(thisMethod)
[THROWS-WHEN] IllegalStateException when for... | true | ok | {"focal": {"class": "MethodHandlerChain", "name": "invoke", "signature": "Object invoke(Object self, Method thisMethod, Method proceed, Object[] args) throws Throwable", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "self", "type": "Object"}, {"name": "thisMethod", "type": "Method"}, {"name": "p... |
67059803_10 | class ResponseUtility {
public static List<ResponseValue> filterMergeResults(List<ResponseValue> results,
List<String> requestValues, int limit, SortType sort)
{
List<String> keepSet = requestValues == null ? new LinkedList<>() : requestValues;
... | List<String> keep = Arrays.asList(new String [] {"v4"});
List<ResponseValue> actual = ResponseUtility.filterMergeResults(values, keep, 2, SortType.foreground_popularity);
assertEquals(2, actual.size());
assertEquals("v1", actual.get(0).value);
assertEquals("v4", actual.get(1).v... | [FOCAL] public static List<ResponseValue> ResponseUtility.filterMergeResults(List<ResponseValue> results, List<String> requestValues, int limit, SortType sort)
[CLASS] class ResponseUtility
[METRICS] loc=25 cc=5 branches=3 loops=1 returns=1 throws=1 nesting=2
[CALLS-EXTERNAL] List<String>.size/0, List<ResponseValue>.si... | /* static context
[FOCAL] public static List<ResponseValue> ResponseUtility.filterMergeResults(List<ResponseValue> results, List<String> requestValues, int limit, SortType sort)
[THROWS-WHEN] IllegalArgumentException when keepSet.size() > results.size()
[PATH1] if(keepSet.size() > results.size())=F -> foreach(ResponseV... | /* static context
[FOCAL] public static List<ResponseValue> ResponseUtility.filterMergeResults(List<ResponseValue> results, List<String> requestValues, int limit, SortType sort)
[THROWS-WHEN] IllegalArgumentException when keepSet.size() > results.size()
[PATH1] if(keepSet.size() > results.size())=F -> foreach(ResponseV... | true | ok | {"focal": {"class": "ResponseUtility", "name": "filterMergeResults", "signature": "List<ResponseValue> filterMergeResults(List<ResponseValue> results, List<String> requestValues, int limit, SortType sort)", "start_line": 3, "modifiers": "public static", "params": [{"name": "results", "type": "List<ResponseValue>"}, {"n... |
67075821_0 | class RequestInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
Request.Builder requestBuilder = request.newBuilder()
.addHeader(AUTHORIZATION_HEADER, "Bearer " + clientToken)
... | requestInterceptor.intercept(chain);
verify(chain).proceed(argumentCaptor.capture());
Request requestWithHeaders = argumentCaptor.getValue();
String authHeader = requestWithHeaders.header(RequestInterceptor.AUTHORIZATION_HEADER);
assertEquals("Bearer " + CLIENT_TOKEN, authHeade... | [FOCAL] @Override public Response RequestInterceptor.intercept(Chain chain)
[CLASS] class RequestInterceptor implements Interceptor
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Chain.request/0, request.newBuilder() .addHeader(AUTHORIZATION_HEADER, "Be....addHeader/2, request.new... | /* static context
[FOCAL] @Override public Response RequestInterceptor.intercept(Chain chain)
[INPUTS] branches=- | result=chain
[COLLABORATORS] param chain:Chain request/0,proceed/1
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] Chain.request/0, request.newBuilder() .addHeader(AUTHORIZATION_HEADER, "Be....addHeade... | /* static context
[FOCAL] @Override public Response RequestInterceptor.intercept(Chain chain)
[INPUTS] branches=- | result=chain
[COLLABORATORS] param chain:Chain request/0,proceed/1
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] Chain.request/0, request.newBuilder() .addHeader(AUTHORIZATION_HEADER, "Be....addHeade... | true | ok | {"focal": {"class": "RequestInterceptor", "name": "intercept", "signature": "Response intercept(Chain chain) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "chain", "type": "Chain"}], "return_type": "Response"}, "class_info": {"name": "RequestInterceptor", "kind": "class", "m... |
67078673_4 | class CredentialsCLI {
CredentialsAction processArgs(String[] args) {
CredentialsAction action = null;
if (args.length < 2) {
action = new PrintHelpAction();
return action;
}
String command = args[0];
String credentialsFile = args[1];
switch (... | final String[] args = new String[]{"list", credentialsFilePath};
final CredentialsCLI cli = new CredentialsCLI();
final CredentialsAction action = cli.processArgs(args);
Assert.assertEquals(CredentialsCLI.ListUsersAction.class, action.getClass());
action.execute();
Assert... | [FOCAL] CredentialsAction CredentialsCLI.processArgs(String[] args)
[CLASS] class CredentialsCLI
[METRICS] loc=28 cc=6 branches=2 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] CredentialsAction.setArgs/1
[NEW] PrintHelpAction, ListUsersAction, AddUserAction, ResetPasswordAction, RemoveUserAction
[PATH1] if(args... | /* static context
[FOCAL] CredentialsAction CredentialsCLI.processArgs(String[] args)
[PATH1] if(args.length < 2)=F -> switch(command)=case "list" -> return action
[PATH2] if(args.length < 2)=T -> return action
[PATH3] if(args.length < 2)=F -> switch(command)=case "add" -> return action
[PATH4] if(args.length < 2)=F ->... | /* static context
[FOCAL] CredentialsAction CredentialsCLI.processArgs(String[] args)
[PATH1] if(args.length < 2)=F -> switch(command)=case "list" -> return action
[PATH2] if(args.length < 2)=T -> return action
[PATH3] if(args.length < 2)=F -> switch(command)=case "add" -> return action
[PATH4] if(args.length < 2)=F ->... | true | ok | {"focal": {"class": "CredentialsCLI", "name": "processArgs", "signature": "CredentialsAction processArgs(String[] args)", "start_line": 3, "modifiers": "", "params": [{"name": "args", "type": "String[]"}], "return_type": "CredentialsAction"}, "class_info": {"name": "CredentialsCLI", "kind": "class", "modifiers": "", "s... |
67109557_5 | class BeanFactory implements ApplicationContextAware {
public static String[] getBeanNames() {
return container.getBeanNames();
}
public static T getBean(Class<T> clazz);
public static T getBean(String beanName);
public static T getBean(String beanName, Class<T> clazz);
public static C... | Set<String> set = converter.toSet(BeanFactory.getBeanNames());
Assert.assertTrue(set.contains("tephra.util.converter"));
Assert.assertTrue(set.contains("tephra.bean.singleton"));
Assert.assertTrue(set.contains("tephra.bean.prototype"));
Assert.assertTrue(set.contains("tephra.bean... | [FOCAL] public static String[] BeanFactory.getBeanNames()
[CLASS] class BeanFactory implements ApplicationContextAware
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] container.getBeanNames/0
[COLLABORATORS] field container getBeanNames/0
[CLASS-MEMBERS] T getBean(Class<T> clazz); ... | /* static context
[FOCAL] public static String[] BeanFactory.getBeanNames()
[COLLABORATORS] field container getBeanNames/0
[CALLS-EXTERNAL] container.getBeanNames/0
*/
| /* static context
[FOCAL] public static String[] BeanFactory.getBeanNames()
[COLLABORATORS] field container getBeanNames/0
[CALLS-EXTERNAL] container.getBeanNames/0
*/
class BeanFactory implements ApplicationContextAware {
public static String[] getBeanNames() {
return container.getBeanNames();
}
... | true | ok | {"focal": {"class": "BeanFactory", "name": "getBeanNames", "signature": "String[] getBeanNames()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "String[]"}, "class_info": {"name": "BeanFactory", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "ApplicationContextAware",... |
67114675_1 | class NetworkingModule extends ReactContextBaseJavaModule {
@ReactMethod
/**
* @param timeout value of 0 results in no timeout
*/
public void sendRequest(
final ExecutorToken executorToken,
String method,
String url,
final int requestId,
ReadableArray headers,
ReadableMa... | OkHttpClient httpClient = mock(OkHttpClient.class);
when(httpClient.newCall(any(Request.class))).thenAnswer(new Answer<Object>() {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
Call callMock = mock(Call.class);
return callMock;
}
});
OkH... | [FOCAL] @ReactMethod /** * @param timeout value of 0 results in no timeout */ public void NetworkingModule.sendRequest(ExecutorToken executorToken, String method, String url, int requestId, ReadableArray headers, ReadableMap data, String responseType, boolean useIncrementalUpdates, int timeout)
[CLASS] class Networking... | class NetworkingModule extends ReactContextBaseJavaModule {
@ReactMethod
/**
* @param timeout value of 0 results in no timeout
*/
public void sendRequest(
final ExecutorToken executorToken,
String method,
String url,
final int requestId,
ReadableArray headers,
ReadableMa... | false | ok | {"focal": {"class": "NetworkingModule", "name": "sendRequest", "signature": "void sendRequest(ExecutorToken executorToken, String method, String url, int requestId, ReadableArray headers, ReadableMap data, String responseType, boolean useIncrementalUpdates, int timeout)", "start_line": 3, "modifiers": "@ReactMethod /**... | |
67148625_59 | class ORAdapter {
public static Resource rMapResource2Rdf4jResource(RMapResource rmapResource) {
if (rmapResource==null) {
return null;
}
Resource resource = null;
if (rmapResource instanceof RMapBlankNode){
RMapBlankNode rb = (RMapBlankNode)rmapResource;
BNode blank = rMapBlankNode2Rdf4jBNode(rb);
... | try {
//BNODE
String bnId = rmapIdService.createId().toASCIIString();
RMapBlankNode bn = new RMapBlankNode(bnId);
Resource resource = ORAdapter.rMapResource2Rdf4jResource(bn);
assertEquals(bnId, resource.stringValue());
assertTrue (resource instanceof BNode);
//IRI
RMapIri rmIri = new RMapIri(... | [FOCAL] public static Resource ORAdapter.rMapResource2Rdf4jResource(RMapResource rmapResource)
[CLASS] class ORAdapter
[METRICS] loc=21 cc=4 branches=3 loops=0 returns=2 throws=1 nesting=2
[CALLS-INTERNAL] BNode rMapBlankNode2Rdf4jBNode(RMapBlankNode blank); IRI rMapIri2Rdf4jIri(RMapIri rIri)
[NEW] IllegalArgumentExcep... | /* static context
[FOCAL] public static Resource ORAdapter.rMapResource2Rdf4jResource(RMapResource rmapResource)
[THROWS-WHEN] IllegalArgumentException when !(rmapResource==null) && !(rmapResource instanceof RMapBlankNode) && !(rmapResource instanceof RMapIri)
[PATH1] if(rmapResource==null)=F -> if(rmapResource instanc... | /* static context
[FOCAL] public static Resource ORAdapter.rMapResource2Rdf4jResource(RMapResource rmapResource)
[THROWS-WHEN] IllegalArgumentException when !(rmapResource==null) && !(rmapResource instanceof RMapBlankNode) && !(rmapResource instanceof RMapIri)
[PATH1] if(rmapResource==null)=F -> if(rmapResource instanc... | true | ok | {"focal": {"class": "ORAdapter", "name": "rMapResource2Rdf4jResource", "signature": "Resource rMapResource2Rdf4jResource(RMapResource rmapResource)", "start_line": 3, "modifiers": "public static", "params": [{"name": "rmapResource", "type": "RMapResource"}], "return_type": "Resource"}, "class_info": {"name": "ORAdapter... |
67165904_19 | class Section extends NestedGroup {
public void setFooter(@NonNull Group footer) {
if (footer == null)
throw new NullPointerException("Footer can't be null. Please use removeFooter() instead!");
if (this.footer != null) {
this.footer.unregisterGroupDataObserver(this);
... | Section section = new Section();
section.setFooter(footer);
assertEquals(footerSize, section.getItemCount());
}
} | [FOCAL] public void Section.setFooter(Group footer)
[CLASS] class Section extends NestedGroup
[METRICS] loc=11 cc=3 branches=2 loops=0 returns=0 throws=1 nesting=1
[CALLS-INTERNAL] int getFooterItemCount(); void notifyFooterItemsChanged(int previousFooterItemCount)
[CALLS-EXTERNAL] Group.unregisterGroupDataObserver/1, ... | /* static context
[FOCAL] public void Section.setFooter(Group footer)
[THROWS-WHEN] NullPointerException when footer == null
[PATH1] if(footer == null)=T -> throw new NullPointerException("Footer can't be null. Please use removeFo...
[PATH2] if(footer == null)=F -> if(this.footer != null)=T
[PATH3] if(footer == null)=F... | /* static context
[FOCAL] public void Section.setFooter(Group footer)
[THROWS-WHEN] NullPointerException when footer == null
[PATH1] if(footer == null)=T -> throw new NullPointerException("Footer can't be null. Please use removeFo...
[PATH2] if(footer == null)=F -> if(this.footer != null)=T
[PATH3] if(footer == null)=F... | true | ok | {"focal": {"class": "Section", "name": "setFooter", "signature": "void setFooter(Group footer)", "start_line": 3, "modifiers": "public", "params": [{"name": "footer", "type": "Group"}], "return_type": "void"}, "class_info": {"name": "Section", "kind": "class", "modifiers": "", "superclass": "NestedGroup", "interfaces":... |
67216543_10 | class StringType implements MagicMatcher {
@Override
public void renderValue(StringBuilder sb, Object extractedValue, MagicFormatter formatter) {
formatter.format(sb, extractedValue);
}
@Override public Object convertTestString(String typeStr, String testStr);
@Override public Object extra... | StringType type = new StringType();
Object info = type.convertTestString("string/Bb", "h ello");
byte[] bytes = new byte[]{'h', ' ', 'e', 'l', 'l', 'o'};
Object extract = type.isMatch(info, null, false, null, new MutableOffset(0), bytes);
assertNotNull(extract);
StringBui... | [FOCAL] @Override public void StringType.renderValue(StringBuilder sb, Object extractedValue, MagicFormatter formatter)
[CLASS] class StringType implements MagicMatcher
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] MagicFormatter.format/2
[COLLABORATORS] param formatter:MagicForm... | /* static context
[FOCAL] @Override public void StringType.renderValue(StringBuilder sb, Object extractedValue, MagicFormatter formatter)
[COLLABORATORS] param formatter:MagicFormatter format/2
[CALLS-EXTERNAL] MagicFormatter.format/2
*/
| /* static context
[FOCAL] @Override public void StringType.renderValue(StringBuilder sb, Object extractedValue, MagicFormatter formatter)
[COLLABORATORS] param formatter:MagicFormatter format/2
[CALLS-EXTERNAL] MagicFormatter.format/2
*/
class StringType implements MagicMatcher {
@Override
public void renderVa... | true | ok | {"focal": {"class": "StringType", "name": "renderValue", "signature": "void renderValue(StringBuilder sb, Object extractedValue, MagicFormatter formatter)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "sb", "type": "StringBuilder"}, {"name": "extractedValue", "type": "Object"}, {"name": "forma... |
67262828_7 | class EncodingFixer {
public String convertMarkdownToHtml(String input) {
input = urlMarkdownToHtml(input);
input = boldMarkdownToHtml(input);
return input;
}
public String fixHtmlEscapes(String input);
public String convertSubredditsToLinks(String input);
private String u... | String output = encodingFixer.convertMarkdownToHtml("");
assertEquals("", output);
output = encodingFixer.convertMarkdownToHtml("This description has no markdown");
assertEquals("This description has no markdown", output);
}
} | [FOCAL] public String EncodingFixer.convertMarkdownToHtml(String input)
[CLASS] class EncodingFixer
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String boldMarkdownToHtml(String string); String urlMarkdownToHtml(String string)
[INPUTS] branches=- | result=input
[DATAFLOW] input@... | /* static context
[FOCAL] public String EncodingFixer.convertMarkdownToHtml(String input)
[INPUTS] branches=- | result=input
[CALLS-INTERNAL] String boldMarkdownToHtml(String string); String urlMarkdownToHtml(String string)
*/
| /* static context
[FOCAL] public String EncodingFixer.convertMarkdownToHtml(String input)
[INPUTS] branches=- | result=input
[CALLS-INTERNAL] String boldMarkdownToHtml(String string); String urlMarkdownToHtml(String string)
*/
class EncodingFixer {
public String convertMarkdownToHtml(String input) {
input ... | true | ok | {"focal": {"class": "EncodingFixer", "name": "convertMarkdownToHtml", "signature": "String convertMarkdownToHtml(String input)", "start_line": 3, "modifiers": "public", "params": [{"name": "input", "type": "String"}], "return_type": "String"}, "class_info": {"name": "EncodingFixer", "kind": "class", "modifiers": "", "s... |
67281621_3 | class Messenger {
Message generateNewMessage() {
return Message.builder()
.message(getRandomPhrase())
.sender(SENDER)
.timestamp(System.currentTimeMillis())
.build();
}
private Messenger(String[] phrases, Random random);
static ... | long before = System.currentTimeMillis();
Message message = messenger.generateNewMessage();
long after = System.currentTimeMillis();
assertThat(message.timestamp()).isBetween(before, after);
}
} | [FOCAL] Message Messenger.generateNewMessage()
[CLASS] class Messenger
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String getRandomPhrase()
[CALLS-EXTERNAL] Message.builder() .message(getRandomPhrase()) .sender(SEN....build/0, Message.builder() .message(getRandomPhrase()) .send... | /* static context
[FOCAL] Message Messenger.generateNewMessage()
[CALLS-INTERNAL] String getRandomPhrase()
[CALLS-EXTERNAL] Message.builder() .message(getRandomPhrase()) .sender(SEN....build/0, Message.builder() .message(getRandomPhrase()) .sender(SEN....timestamp/1, Message.builder() .message(getRandomPhrase()).sender... | /* static context
[FOCAL] Message Messenger.generateNewMessage()
[CALLS-INTERNAL] String getRandomPhrase()
[CALLS-EXTERNAL] Message.builder() .message(getRandomPhrase()) .sender(SEN....build/0, Message.builder() .message(getRandomPhrase()) .sender(SEN....timestamp/1, Message.builder() .message(getRandomPhrase()).sender... | true | ok | {"focal": {"class": "Messenger", "name": "generateNewMessage", "signature": "Message generateNewMessage()", "start_line": 3, "modifiers": "", "params": [], "return_type": "Message"}, "class_info": {"name": "Messenger", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "ITERAT... |
67328052_151 | class JavaParser extends Parser {
@Override
public String generatePoetStringTypes() {
StringBuilder symbolBuilder = new StringBuilder();
if (getMethodReturnType().equals(theContract)) {
symbolBuilder.append("$L = $T.");
} else {
symbolBuilder.append("$T $L = $L."... | List<Method> listOfFilteredMethods = MethodFilter.extractValidMethods(greeterContractClass);
Method deploy =
listOfFilteredMethods.stream()
.filter(m -> m.getName().equals("deploy"))
.collect(Collectors.toList())
.ge... | [FOCAL] @Override public String JavaParser.generatePoetStringTypes()
[CLASS] class JavaParser extends Parser
[METRICS] loc=16 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] String getPoetFormatSpecifier()
[CALLS-EXTERNAL] getMethodReturnType().equals/1, getMethodReturnType/0 (inherited), StringBu... | /* static context
[FOCAL] @Override public String JavaParser.generatePoetStringTypes()
[PATH1] if(getMethodReturnType().equals(theContract))=T -> return symbolBuilder.toString()
[PATH2] if(getMethodReturnType().equals(theContract))=F -> return symbolBuilder.toString()
[COLLABORATORS] field method getName/0
[CALLS-INTER... | /* static context
[FOCAL] @Override public String JavaParser.generatePoetStringTypes()
[PATH1] if(getMethodReturnType().equals(theContract))=T -> return symbolBuilder.toString()
[PATH2] if(getMethodReturnType().equals(theContract))=F -> return symbolBuilder.toString()
[COLLABORATORS] field method getName/0
[CALLS-INTER... | true | ok | {"focal": {"class": "JavaParser", "name": "generatePoetStringTypes", "signature": "String generatePoetStringTypes()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "JavaParser", "kind": "class", "modifiers": "", "superclass": "Parser", "interfaces": nul... |
67350976_21 | class XMemcachedClient implements IMemcachedClient {
@Override
public Object get(String key) {
try {
return this.memcachedClient.get(key);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new MemcachedOperationException("Failed to ... | given(client.get(anyString())).willThrow(new TimeoutException("Test timeout error"));
assertThatThrownBy(() -> memcachedClient.get("my-key"))
.isInstanceOf(MemcachedOperationException.class)
.hasMessage("Failed to get key")
.hasCauseInstanceOf(TimeoutExce... | [FOCAL] @Override public Object XMemcachedClient.get(String key)
[CLASS] class XMemcachedClient implements IMemcachedClient
[METRICS] loc=11 cc=3 branches=0 loops=0 returns=1 throws=2 nesting=1
[CALLS-EXTERNAL] XMemcachedClient.get/1, Thread.currentThread().interrupt/0, Thread.currentThread/0
[NEW] MemcachedOperationEx... | /* static context
[FOCAL] @Override public Object XMemcachedClient.get(String key)
[THROWS-WHEN] MemcachedOperationException when try-body throws
[PATH1] try-body throws -> throw new MemcachedOperationException("Failed to get key", e)
[PATH2] return this.memcachedClient.get(key)
[INPUTS] branches=- | result=key, memcac... | /* static context
[FOCAL] @Override public Object XMemcachedClient.get(String key)
[THROWS-WHEN] MemcachedOperationException when try-body throws
[PATH1] try-body throws -> throw new MemcachedOperationException("Failed to get key", e)
[PATH2] return this.memcachedClient.get(key)
[INPUTS] branches=- | result=key, memcac... | true | ok | {"focal": {"class": "XMemcachedClient", "name": "get", "signature": "Object get(String key)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "key", "type": "String"}], "return_type": "Object"}, "class_info": {"name": "XMemcachedClient", "kind": "class", "modifiers": "", "superclass": null, "inter... |
67417531_10 | class TypeUri {
public boolean hasEmptyPath() {
return pathSegments.isEmpty();
}
private TypeUri(URI uri);
public static TypeUri parse(URI uri);
public static TypeUri parse(String url);
public URI URI();
public Map<String, List<String>> queryMap();
public List<String> getPathSegments();
public... | TypeUri emptyPathUri = TypeUri.parse("https://github.com/");
TypeUri pathContainedUri = TypeUri.parse("https://github.com/shaunkawano");
assertFalse(pathContainedUri.hasEmptyPath());
assertTrue(emptyPathUri.hasEmptyPath());
}
} | [FOCAL] public boolean TypeUri.hasEmptyPath()
[CLASS] class TypeUri
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] pathSegments.isEmpty/0
[COLLABORATORS] field pathSegments isEmpty/0
[CLASS-MEMBERS] TypeUri(URI uri); TypeUri parse(URI uri); TypeUri parse(String url); URI URI(); Ma... | /* static context
[FOCAL] public boolean TypeUri.hasEmptyPath()
[COLLABORATORS] field pathSegments isEmpty/0
[CALLS-EXTERNAL] pathSegments.isEmpty/0
*/
| /* static context
[FOCAL] public boolean TypeUri.hasEmptyPath()
[COLLABORATORS] field pathSegments isEmpty/0
[CALLS-EXTERNAL] pathSegments.isEmpty/0
*/
class TypeUri {
public boolean hasEmptyPath() {
return pathSegments.isEmpty();
}
private TypeUri(URI uri);
public static TypeUri parse(URI uri);
publi... | true | ok | {"focal": {"class": "TypeUri", "name": "hasEmptyPath", "signature": "boolean hasEmptyPath()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "TypeUri", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "T... |
67436705_35 | class ZigBeeConverterGenericButton extends ZigBeeBaseChannelConverter implements ZclCommandListener, ZclAttributeListener {
@Override
public synchronized boolean initializeConverter() {
for (ButtonPressType buttonPressType : ButtonPressType.values()) {
EventSpec eventSpec = parseEventSpec(c... | channelProperties.put("zigbee_shortpress_cluster_id", "0xEFGH");
channelProperties.put("zigbee_shortpress_command_id", "123");
boolean initResult = converter.initializeConverter();
assertFalse(initResult);
}
} | [FOCAL] @Override public synchronized boolean ZigBeeConverterGenericButton.initializeConverter()
[CLASS] class ZigBeeConverterGenericButton extends ZigBeeBaseChannelConverter implements ZclCommandListener, ZclAttributeListener
[METRICS] loc=23 cc=5 branches=2 loops=2 returns=2 throws=0 nesting=2
[CALLS-INTERNAL] EventS... | /* static context
[FOCAL] @Override public synchronized boolean ZigBeeConverterGenericButton.initializeConverter()
[PATH1] foreach(ButtonPressType buttonPressType : ButtonPressType.values())=T -> if(eventSpec != null)=T -> exit loop -> if(handledEvents.isEmpty())=F -> foreach(EventSpec eventSpec : handledEvents.values(... | /* static context
[FOCAL] @Override public synchronized boolean ZigBeeConverterGenericButton.initializeConverter()
[PATH1] foreach(ButtonPressType buttonPressType : ButtonPressType.values())=T -> if(eventSpec != null)=T -> exit loop -> if(handledEvents.isEmpty())=F -> foreach(EventSpec eventSpec : handledEvents.values(... | true | ok | {"focal": {"class": "ZigBeeConverterGenericButton", "name": "initializeConverter", "signature": "boolean initializeConverter()", "start_line": 3, "modifiers": "@Override public synchronized", "params": [], "return_type": "boolean"}, "class_info": {"name": "ZigBeeConverterGenericButton", "kind": "class", "modifiers": ""... |
67473511_72 | class FieldFilter {
public static Result filter(String path, Collection<NumberedInclude> includes, Collection<String> excludes, boolean allowPartialMatches) {
includes = (includes == null ? Collections.<NumberedInclude> emptyList() : includes);
excludes = (excludes == null ? Collections.<String> em... | assertFalse(filter("foo.bar", null, Arrays.asList("foo.bar")));
}
} | [FOCAL] public static Result FieldFilter.filter(String path, Collection<NumberedInclude> includes, Collection<String> excludes, boolean allowPartialMatches)
[CLASS] class FieldFilter
[METRICS] loc=61 cc=12 branches=10 loops=1 returns=4 throws=0 nesting=5
[CALLS-EXTERNAL] Collections.emptyList/0, Collection<NumberedIncl... | /* static context
[FOCAL] public static Result FieldFilter.filter(String path, Collection<NumberedInclude> includes, Collection<String> excludes, boolean allowPartialMatches)
[PATH1] if(includes.isEmpty() && excludes.isEmpty())=F -> if(Regex.simpleMatch(excludes, path))=F -> if(includes.isEmpty())=F -> foreach(Numbered... | /* static context
[FOCAL] public static Result FieldFilter.filter(String path, Collection<NumberedInclude> includes, Collection<String> excludes, boolean allowPartialMatches)
[PATH1] if(includes.isEmpty() && excludes.isEmpty())=F -> if(Regex.simpleMatch(excludes, path))=F -> if(includes.isEmpty())=F -> foreach(Numbered... | true | ok | {"focal": {"class": "FieldFilter", "name": "filter", "signature": "Result filter(String path, Collection<NumberedInclude> includes, Collection<String> excludes, boolean allowPartialMatches)", "start_line": 3, "modifiers": "public static", "params": [{"name": "path", "type": "String"}, {"name": "includes", "type": "Coll... |
67497179_0 | class Cal {
public int add(int a, int b) {
return a + b;
}
}
class CalTest {
@Test
public void testAdd() {
| Assert.assertEquals(2, 3, 4);
}
} | [FOCAL] public int Cal.add(int a, int b)
[CLASS] class Cal
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[INPUTS] branches=- | result=a, b
[DATAFLOW] a@param->L2; b@param->L2
[TEST] CalTest: @Test public void testAdd() | /* static context
[FOCAL] public int Cal.add(int a, int b)
[INPUTS] branches=- | result=a, b
*/
| /* static context
[FOCAL] public int Cal.add(int a, int b)
[INPUTS] branches=- | result=a, b
*/
class Cal {
public int add(int a, int b) {
return a + b;
}
}
class CalTest {
@Test
public void testAdd() {
| true | ok | {"focal": {"class": "Cal", "name": "add", "signature": "int add(int a, int b)", "start_line": 3, "modifiers": "public", "params": [{"name": "a", "type": "int"}, {"name": "b", "type": "int"}], "return_type": "int"}, "class_info": {"name": "Cal", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "... |
67498438_106 | class PersonNameComparator implements Comparator {
@Override
public double compare(String v1, String v2) {
if (v1.equals(v2))
return 1.0;
if (v1.length() + v2.length() > 20 && Levenshtein.distance(v1, v2) == 1)
return 0.95;
String[] t1 = StringUtils.split(v1);
String[] t2 = StringUt... | assertEquals(0.8, comp.compare("liang gang", "liang wang"));
}
} | [FOCAL] @Override public double PersonNameComparator.compare(String v1, String v2)
[CLASS] class PersonNameComparator implements Comparator
[METRICS] loc=97 cc=19 branches=16 loops=2 returns=7 throws=0 nesting=7
[CALLS-EXTERNAL] String.equals/1, String.length/0, Levenshtein.distance/2, StringUtils.split/1, t1[0].length... | /* static context
[FOCAL] @Override public double PersonNameComparator.compare(String v1, String v2)
[PATH1] if(v1.equals(v2))=F -> if(v1.length() + v2.length() > 20 && Levenshtein.distance(v1, v2) == 1)=F -> if(t1.length < t2.length)=T -> if(t1.length != t2.length && t2.length >= 2)=T -> if((t1[0].length() == 2 && t1[... | /* static context
[FOCAL] @Override public double PersonNameComparator.compare(String v1, String v2)
[PATH1] if(v1.equals(v2))=F -> if(v1.length() + v2.length() > 20 && Levenshtein.distance(v1, v2) == 1)=F -> if(t1.length < t2.length)=T -> if(t1.length != t2.length && t2.length >= 2)=T -> if((t1[0].length() == 2 && t1[... | true | ok | {"focal": {"class": "PersonNameComparator", "name": "compare", "signature": "double compare(String v1, String v2)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "v1", "type": "String"}, {"name": "v2", "type": "String"}], "return_type": "double"}, "class_info": {"name": "PersonNameComparator", "... |
67579957_45 | class ByteBufferInputStream extends InputStream {
@Override
public int read() {
if (!buffer.hasRemaining()) {
return -1;
}
return buffer.get() & 0xFF;
}
public ByteBufferInputStream(ByteBuffer buffer);
@Override public int read(byte[] bytes, int outputOffset, ... | int capacity = 1;
var byteBuffer = ByteBuffer.allocate(capacity);
for (int i = 0; i < capacity; i++) {
byteBuffer.put((byte) 0x64);
}
byteBuffer.position(0);
try (var inputStream = new ByteBufferInputStream(byteBuffer)) {
assertEquals(0x64, inputS... | [FOCAL] @Override public int ByteBufferInputStream.read()
[CLASS] class ByteBufferInputStream extends InputStream
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] buffer.hasRemaining/0, buffer.get/0
[PATH1] if(!buffer.hasRemaining())=T -> return -1
[PATH2] if(!buffer.hasRemaining())... | /* static context
[FOCAL] @Override public int ByteBufferInputStream.read()
[PATH1] if(!buffer.hasRemaining())=T -> return -1
[PATH2] if(!buffer.hasRemaining())=F -> return buffer.get() & 0xFF
[COLLABORATORS] field buffer hasRemaining/0,get/0
[CALLS-EXTERNAL] buffer.hasRemaining/0, buffer.get/0
*/
| /* static context
[FOCAL] @Override public int ByteBufferInputStream.read()
[PATH1] if(!buffer.hasRemaining())=T -> return -1
[PATH2] if(!buffer.hasRemaining())=F -> return buffer.get() & 0xFF
[COLLABORATORS] field buffer hasRemaining/0,get/0
[CALLS-EXTERNAL] buffer.hasRemaining/0, buffer.get/0
*/
class ByteBufferInput... | true | ok | {"focal": {"class": "ByteBufferInputStream", "name": "read", "signature": "int read()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "ByteBufferInputStream", "kind": "class", "modifiers": "", "superclass": "InputStream", "interfaces": null, "fields": [], ... |
67585201_231 | class Structures {
public static boolean isBackboneStructure(Structure structure) {
return structure.getAllAminoAcids().stream()
.map(LeafSubstructure::getAllAtoms)
.flatMap(Collection::stream)
.noneMatch(StructuralEntityFilter.AtomFilter.isBackbone().negate(... | Structure alphaCarbonStructure = StructureParser.pdb()
.pdbIdentifier("2plp")
.parse();
assertTrue(Structures.isBackboneStructure(alphaCarbonStructure));
}
} | [FOCAL] public static boolean Structures.isBackboneStructure(Structure structure)
[CLASS] class Structures
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] structure.getAllAminoAcids().stream() .map(LeafSubstructu....noneMatch/1, structure.getAllAminoAcids().stream() .map(LeafSubstr... | /* static context
[FOCAL] public static boolean Structures.isBackboneStructure(Structure structure)
[INPUTS] branches=- | result=structure
[COLLABORATORS] param structure:Structure getAllAminoAcids/0
[CALLS-EXTERNAL] structure.getAllAminoAcids().stream() .map(LeafSubstructu....noneMatch/1, structure.getAllAminoAcids().... | /* static context
[FOCAL] public static boolean Structures.isBackboneStructure(Structure structure)
[INPUTS] branches=- | result=structure
[COLLABORATORS] param structure:Structure getAllAminoAcids/0
[CALLS-EXTERNAL] structure.getAllAminoAcids().stream() .map(LeafSubstructu....noneMatch/1, structure.getAllAminoAcids().... | true | ok | {"focal": {"class": "Structures", "name": "isBackboneStructure", "signature": "boolean isBackboneStructure(Structure structure)", "start_line": 3, "modifiers": "public static", "params": [{"name": "structure", "type": "Structure"}], "return_type": "boolean"}, "class_info": {"name": "Structures", "kind": "class", "modif... |
67639251_2 | class FacebookRepository extends MainRepository {
@Override
public Observable<Post.PostBuilder> fetchPostsSinceObservable(Date dSince, int numPosts) {
return parsePosts("&since=" + String.valueOf(dSince.getTime() / 1000), numPosts);
}
FacebookRepository(MainActivity view);
private Obser... | FacebookRepository presenter = preparePresenter();
TestSubscriber<Post> testSubscriber = new TestSubscriber<>();
presenter.fetchPostsSinceObservable(new Date(), 50)
.map(Post.PostBuilder::build)
.subscribe(testSubscriber);
List<Post> list = testSubscriber.... | [FOCAL] @Override public Observable<Post.PostBuilder> FacebookRepository.fetchPostsSinceObservable(Date dSince, int numPosts)
[CLASS] class FacebookRepository extends MainRepository
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Observable<Post.PostBuilder> parsePosts(String strTi... | /* static context
[FOCAL] @Override public Observable<Post.PostBuilder> FacebookRepository.fetchPostsSinceObservable(Date dSince, int numPosts)
[INPUTS] branches=- | result=dSince, numPosts
[COLLABORATORS] param dSince:Date getTime/0
[CALLS-INTERNAL] Observable<Post.PostBuilder> parsePosts(String strTime, int numPosts)... | /* static context
[FOCAL] @Override public Observable<Post.PostBuilder> FacebookRepository.fetchPostsSinceObservable(Date dSince, int numPosts)
[INPUTS] branches=- | result=dSince, numPosts
[COLLABORATORS] param dSince:Date getTime/0
[CALLS-INTERNAL] Observable<Post.PostBuilder> parsePosts(String strTime, int numPosts)... | true | ok | {"focal": {"class": "FacebookRepository", "name": "fetchPostsSinceObservable", "signature": "Observable<Post.PostBuilder> fetchPostsSinceObservable(Date dSince, int numPosts)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "dSince", "type": "Date"}, {"name": "numPosts", "type": "int"}], "return_... |
67680403_0 | class Calculator {
public int add(int op1, int op2) {
return op1 + op2;
}
public int diff(int op1, int op2);
public double div(int op1, int op2);
private Calculator calculator;
}
class CalculatorTest {
private Calculator calculator;
@Test
public void testAdd() {
| calculator = new Calculator();
int total = calculator.add(4, 5);
assertEquals("Calculator is not adding correctly", 9, total);
}
} | [FOCAL] public int Calculator.add(int op1, int op2)
[CLASS] class Calculator
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[INPUTS] branches=- | result=op1, op2
[DATAFLOW] op1@param->L2; op2@param->L2
[CLASS-MEMBERS] int diff(int op1, int op2); double div(int op1, int op2)
[TEST] CalculatorTest: ... | /* static context
[FOCAL] public int Calculator.add(int op1, int op2)
[INPUTS] branches=- | result=op1, op2
*/
| /* static context
[FOCAL] public int Calculator.add(int op1, int op2)
[INPUTS] branches=- | result=op1, op2
*/
class Calculator {
public int add(int op1, int op2) {
return op1 + op2;
}
public int diff(int op1, int op2);
public double div(int op1, int op2);
private Calculator calculator;
... | true | ok | {"focal": {"class": "Calculator", "name": "add", "signature": "int add(int op1, int op2)", "start_line": 3, "modifiers": "public", "params": [{"name": "op1", "type": "int"}, {"name": "op2", "type": "int"}], "return_type": "int"}, "class_info": {"name": "Calculator", "kind": "class", "modifiers": "", "superclass": null,... |
67732760_12 | class DefaultOrientDBTemplate extends AbstractDocumentTemplate implements OrientDBTemplate {
@Override
public <T> void live(DocumentQuery query, OrientDBLiveCallback<T> callBacks) {
Objects.requireNonNull(query, "query is required");
Objects.requireNonNull(callBacks, "callBacks is required");
... | OrientDBLiveCreateCallback<Person> callBack = p -> {
};
template.live("sql from Person where name = ?", OrientDBLiveCallbackBuilder.builder().onCreate(callBack).build(), "Ada");
verify(manager).live(Mockito.eq("sql from Person where name = ?"),
Mockito.any(OrientDBLiveCal... | [FOCAL] @Override public void DefaultOrientDBTemplate.live(DocumentQuery query, OrientDBLiveCallback<T> callBacks)
[CLASS] class DefaultOrientDBTemplate extends AbstractDocumentTemplate implements OrientDBTemplate
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] OrientDBLiveCallback... | /* static context
[FOCAL] @Override public void DefaultOrientDBTemplate.live(DocumentQuery query, OrientDBLiveCallback<T> callBacks)
[COLLABORATORS] field manager:OrientDBDocumentCollectionManager get/0
[CALLS-INTERNAL] OrientDBLiveCallback<DocumentEntity> bindCallbacks(OrientDBLiveCallback<T> callBacks)
[FIELDS] read=... | /* static context
[FOCAL] @Override public void DefaultOrientDBTemplate.live(DocumentQuery query, OrientDBLiveCallback<T> callBacks)
[COLLABORATORS] field manager:OrientDBDocumentCollectionManager get/0
[CALLS-INTERNAL] OrientDBLiveCallback<DocumentEntity> bindCallbacks(OrientDBLiveCallback<T> callBacks)
[FIELDS] read=... | true | ok | {"focal": {"class": "DefaultOrientDBTemplate", "name": "live", "signature": "void live(DocumentQuery query, OrientDBLiveCallback<T> callBacks)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "query", "type": "DocumentQuery"}, {"name": "callBacks", "type": "OrientDBLiveCallback<T>"}], "return_typ... |
67794596_14 | class CreateCredentialStore extends AbstractCredentialStoreCommand {
@Override
public Object execute() throws Exception {
if (credentialStoreService.available() && !force) {
System.err.println("Credential store is already configured. To replace the configuration, please use \"--force\" opti... | final File storeFile = new File(tmp.getRoot(), "credential.store");
Session session = mock(Session.class);
when(session.readLine(anyString(), anyChar())).thenReturn("test");
final CreateCredentialStore command = new CreateCredentialStore();
command.credentialStoreService = cre... | [FOCAL] @Override public Object CreateCredentialStore.execute()
[CLASS] class CreateCredentialStore extends AbstractCredentialStoreCommand
[METRICS] loc=146 cc=25 branches=23 loops=1 returns=12 throws=0 nesting=3
[CALLS-EXTERNAL] CredentialStoreServiceImpl.available/0, System.err.println/1, "".equals/1, algorithm.trim/... | class CreateCredentialStore extends AbstractCredentialStoreCommand {
@Override
public Object execute() throws Exception {
if (credentialStoreService.available() && !force) {
System.err.println("Credential store is already configured. To replace the configuration, please use \"--force\" opti... | false | ok | {"focal": {"class": "CreateCredentialStore", "name": "execute", "signature": "Object execute() throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Object"}, "class_info": {"name": "CreateCredentialStore", "kind": "class", "modifiers": "", "superclass": "AbstractCredentialS... | |
67827813_8 | class TransformationLanguageInterpreter {
public List<Transformation> getTransformations() {
return transformations;
}
public TransformationLanguageInterpreter(TransformationFunctionRegistry registry);
public void parse(String transformScript);
public List<Mapping> getMappings();
pub... | String ts = "if ( \"$.'PDBx:datablock'\" exists or \"$.'Cell ID'\" = \"45\" ) and \"$.x\" <> \"a\" then transform column \"Date added\" to \"date_added\" apply toStandardDate(\"MM/dd/yyyy\");\"";
TransformationLanguageInterpreter interpreter = getTransformationLanguageInterpreter(ts);
assertEqua... | [FOCAL] public List<Transformation> TransformationLanguageInterpreter.getTransformations()
[CLASS] class TransformationLanguageInterpreter
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] TransformationLanguageInterpreter(TransformationFunctionRegistry registry); void parse(String tr... | /* static context
[FOCAL] public List<Transformation> TransformationLanguageInterpreter.getTransformations()
*/
| /* static context
[FOCAL] public List<Transformation> TransformationLanguageInterpreter.getTransformations()
*/
class TransformationLanguageInterpreter {
public List<Transformation> getTransformations() {
return transformations;
}
public TransformationLanguageInterpreter(TransformationFunctionReg... | true | ok | {"focal": {"class": "TransformationLanguageInterpreter", "name": "getTransformations", "signature": "List<Transformation> getTransformations()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<Transformation>"}, "class_info": {"name": "TransformationLanguageInterpreter", "kind": "class", "mod... |
67934497_5 | class DataGetHandler implements HttpHandler {
public DataGetHandler() {
try {
connection = client.connect(new URI(apidHost), Http2Client.WORKER, Http2Client.SSL, Http2Client.BUFFER_POOL, OptionMap.create(UndertowOptions.ENABLE_HTTP2, true)).get();
} catch (Exception e) {
log... | /*
final Http2Client client = Http2Client.getInstance();
final CountDownLatch latch = new CountDownLatch(1);
final ClientConnection connection;
try {
connection = client.connect(new URI(url), Http2Client.WORKER, Http2Client.SSL, Http2Client.BUFFER_POOL, enableHttp2 ? ... | [FOCAL] public DataGetHandler.DataGetHandler()
[CLASS] class DataGetHandler implements HttpHandler
[METRICS] loc=7 cc=2 branches=0 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] client.connect(new URI(apidHost), Http2Client.WORKER, Htt....get/0, client.connect/5, OptionMap.create/2, Logger.error/2
[NEW] URI
[FIE... | /* static context
[FOCAL] public DataGetHandler.DataGetHandler()
[PATH1] try-body throws
[COLLABORATORS] field client connect/5
[EXCEPTIONS] catches Exception e
[FIELDS] read=logger:Logger
[NEW] URI
[CALLS-EXTERNAL] client.connect(new URI(apidHost), Http2Client.WORKER, Htt....get/0, client.connect/5, OptionMap.create/2... | /* static context
[FOCAL] public DataGetHandler.DataGetHandler()
[PATH1] try-body throws
[COLLABORATORS] field client connect/5
[EXCEPTIONS] catches Exception e
[FIELDS] read=logger:Logger
[NEW] URI
[CALLS-EXTERNAL] client.connect(new URI(apidHost), Http2Client.WORKER, Htt....get/0, client.connect/5, OptionMap.create/2... | true | ok | {"focal": {"class": "DataGetHandler", "name": "DataGetHandler", "signature": "DataGetHandler()", "start_line": 3, "modifiers": "public", "params": [], "return_type": null}, "class_info": {"name": "DataGetHandler", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "HttpHandler", "fields": [{"name": "se... |
68019127_31 | class TotalLogEntry extends AbstractLogEntry {
public boolean isUsedSinceLastCheck() {
boolean used = false;
long callCount = totalStatistics.getCallCount();
if( callCount > markedCallCount ) {
used = true;
markedCallCount = callCount;
}
return used;
}
public TotalLogEntry(String id, long[] interv... | assertEquals(false, entry.isUsedSinceLastCheck());
entry.addValue(1000, 200, false, false, false);
assertEquals(true, entry.isUsedSinceLastCheck());
assertEquals(false, entry.isUsedSinceLastCheck());
}
} | [FOCAL] public boolean TotalLogEntry.isUsedSinceLastCheck()
[CLASS] class TotalLogEntry extends AbstractLogEntry
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] totalStatistics.getCallCount/0
[PATH1] if(callCount > markedCallCount)=T -> return used
[PATH2] if(callCount > markedCall... | /* static context
[FOCAL] public boolean TotalLogEntry.isUsedSinceLastCheck()
[PATH1] if(callCount > markedCallCount)=T -> return used
[PATH2] if(callCount > markedCallCount)=F -> return used
[COLLABORATORS] field totalStatistics getCallCount/0
[CALLS-EXTERNAL] totalStatistics.getCallCount/0
*/
| /* static context
[FOCAL] public boolean TotalLogEntry.isUsedSinceLastCheck()
[PATH1] if(callCount > markedCallCount)=T -> return used
[PATH2] if(callCount > markedCallCount)=F -> return used
[COLLABORATORS] field totalStatistics getCallCount/0
[CALLS-EXTERNAL] totalStatistics.getCallCount/0
*/
class TotalLogEntry exte... | true | ok | {"focal": {"class": "TotalLogEntry", "name": "isUsedSinceLastCheck", "signature": "boolean isUsedSinceLastCheck()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "TotalLogEntry", "kind": "class", "modifiers": "", "superclass": "AbstractLogEntry", "interfaces": n... |
68020885_0 | class OutgoingAsyncTopic extends JmsTopic implements OutgoingTopic {
public Future<Void> asyncSendMessages(final List<byte[]> messages, final Map<String, Object> msgProperties)
{
final MultiThreadedTx localTransaction = this.getMultiThreadedTm().getLocalTransaction();
if (async)
{
... | mithraTransaction = topicResourcesWithTransactionXid.startTransaction();
UnifiedMap<String, Object> msgProperties = UnifiedMap.<String, Object>newMap();
msgProperties.put("Hello", "World");
Future<Void> voidFuture = outTopic.asyncSendMessages(FastList.newListWith("msg1".getBytes()), msg... | [FOCAL] public Future<Void> OutgoingAsyncTopic.asyncSendMessages(List<byte[]> messages, Map<String, Object> msgProperties)
[CLASS] class OutgoingAsyncTopic extends JmsTopic implements OutgoingTopic
[METRICS] loc=93 cc=8 branches=4 loops=1 returns=4 throws=0 nesting=4
[CALLS-INTERNAL] String getTopicName(); void setMess... | /* static context
[FOCAL] public Future<Void> OutgoingAsyncTopic.asyncSendMessages(List<byte[]> messages, Map<String, Object> msgProperties)
[PATH1] if(async)=F -> if(listener != null)#1=T -> for(i < messages.size())=T -> if(listener != null)#2=T -> exit loop -> if(listener != null)#3=T -> return new ImmediateFuture<Vo... | /* static context
[FOCAL] public Future<Void> OutgoingAsyncTopic.asyncSendMessages(List<byte[]> messages, Map<String, Object> msgProperties)
[PATH1] if(async)=F -> if(listener != null)#1=T -> for(i < messages.size())=T -> if(listener != null)#2=T -> exit loop -> if(listener != null)#3=T -> return new ImmediateFuture<Vo... | true | ok | {"focal": {"class": "OutgoingAsyncTopic", "name": "asyncSendMessages", "signature": "Future<Void> asyncSendMessages(List<byte[]> messages, Map<String, Object> msgProperties)", "start_line": 3, "modifiers": "public", "params": [{"name": "messages", "type": "List<byte[]>"}, {"name": "msgProperties", "type": "Map<String, ... |
68029136_222 | class NodeGenerationResult {
public boolean hasErrors() {
if(!propertyValidationExceptions.isEmpty()){
return true;
}
for (GenerationUnitGenerationResult result : applicationServerResults) {
if(!result.isSuccess()){
return true;
}
}
for (ApplicationGenerationResult result : applicationResults) ... | // given
unitResult = Mockito.mock(GenerationUnitGenerationResult.class);
Mockito.when(unitResult.isSuccess()).thenReturn(Boolean.TRUE);
unitResult2 = Mockito.mock(GenerationUnitGenerationResult.class);
Mockito.when(unitResult2.isSuccess()).thenReturn(Boolean.FALSE);
List<GenerationUnitGenerationResul... | [FOCAL] public boolean NodeGenerationResult.hasErrors()
[CLASS] class NodeGenerationResult
[METRICS] loc=16 cc=6 branches=3 loops=2 returns=4 throws=0 nesting=2
[CALLS-EXTERNAL] propertyValidationExceptions.isEmpty/0, ApplicationGenerationResult.isSuccess/0, ApplicationGenerationResult.hasErrors/0
[PATH1] if(!propertyV... | /* static context
[FOCAL] public boolean NodeGenerationResult.hasErrors()
[PATH1] if(!propertyValidationExceptions.isEmpty())=F -> foreach(GenerationUnitGenerationResult result : applicationServerResults)=T -> if(!result.isSuccess())=F -> exit loop -> foreach(ApplicationGenerationResult result : applicationResults)=T -... | /* static context
[FOCAL] public boolean NodeGenerationResult.hasErrors()
[PATH1] if(!propertyValidationExceptions.isEmpty())=F -> foreach(GenerationUnitGenerationResult result : applicationServerResults)=T -> if(!result.isSuccess())=F -> exit loop -> foreach(ApplicationGenerationResult result : applicationResults)=T -... | true | ok | {"focal": {"class": "NodeGenerationResult", "name": "hasErrors", "signature": "boolean hasErrors()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "NodeGenerationResult", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name... |
68036856_6 | class BananaRepository {
public Banana findOne(Long id) {
if(Objects.isNull(id)) {
return null;
}
return bananas
.stream()
.filter(b -> id.equals(b.getId()))
.findFirst()
.orElse(null);
}
public Banana save(Banana entity);
public List<Banana> ... | Banana b = repository.findOne(null);
Assert.assertNull("result is null", b);
}
} | [FOCAL] public Banana BananaRepository.findOne(Long id)
[CLASS] class BananaRepository
[METRICS] loc=11 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] Objects.isNull/1, bananas .stream() .filter(b -> id.equals(b.getId())) .fin....orElse/1, bananas .stream() .filter(b -> id.equals(b.getId())).find... | /* static context
[FOCAL] public Banana BananaRepository.findOne(Long id)
[PATH1] if(Objects.isNull(id))=T -> return null
[PATH2] if(Objects.isNull(id))=F -> return bananas .stream() .filter(b -> id.equals(b.getId())) .findFirst() ....
[INPUTS] branches=id | result=id
[COLLABORATORS] field bananas stream/0; field b get... | /* static context
[FOCAL] public Banana BananaRepository.findOne(Long id)
[PATH1] if(Objects.isNull(id))=T -> return null
[PATH2] if(Objects.isNull(id))=F -> return bananas .stream() .filter(b -> id.equals(b.getId())) .findFirst() ....
[INPUTS] branches=id | result=id
[COLLABORATORS] field bananas stream/0; field b get... | true | ok | {"focal": {"class": "BananaRepository", "name": "findOne", "signature": "Banana findOne(Long id)", "start_line": 3, "modifiers": "public", "params": [{"name": "id", "type": "Long"}], "return_type": "Banana"}, "class_info": {"name": "BananaRepository", "kind": "class", "modifiers": "", "superclass": null, "interfaces": ... |
68042196_5 | class ClearShoppingCartController {
@ModelAttribute("shoppingCartModel")
public ShowShoppingCartModel createShoppingCartModel(@ModelAttribute(ShoppingCart.SHOPPING_CART_KEY) ShoppingCart shoppingCart) {
shoppingCart.clear();
return new ShowShoppingCartModel(shoppingCart.getItems(), REQUEST_MAPPING);
}
@Reques... | // GIVEN in setup
// WHEN
ShowShoppingCartModel result = underTest.createShoppingCartModel(shoppingCart);
// THEN
Mockito.verify(shoppingCart).clear();
Assert.assertEquals(result.getClearShoppingCartUrl(), ClearShoppingCartController.REQUEST_MAPPING);
}
} | [FOCAL] @ModelAttribute("shoppingCartModel") public ShowShoppingCartModel ClearShoppingCartController.createShoppingCartModel(ShoppingCart shoppingCart)
[CLASS] class ClearShoppingCartController
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] ShoppingCart.clear/0, ShoppingCart.getI... | /* static context
[FOCAL] @ModelAttribute("shoppingCartModel") public ShowShoppingCartModel ClearShoppingCartController.createShoppingCartModel(ShoppingCart shoppingCart)
[INPUTS] branches=- | result=shoppingCart
[COLLABORATORS] param shoppingCart:ShoppingCart clear/0,getItems/0
[NEW] ShowShoppingCartModel
[CALLS-EXTER... | /* static context
[FOCAL] @ModelAttribute("shoppingCartModel") public ShowShoppingCartModel ClearShoppingCartController.createShoppingCartModel(ShoppingCart shoppingCart)
[INPUTS] branches=- | result=shoppingCart
[COLLABORATORS] param shoppingCart:ShoppingCart clear/0,getItems/0
[NEW] ShowShoppingCartModel
[CALLS-EXTER... | true | ok | {"focal": {"class": "ClearShoppingCartController", "name": "createShoppingCartModel", "signature": "ShowShoppingCartModel createShoppingCartModel(ShoppingCart shoppingCart)", "start_line": 3, "modifiers": "@ModelAttribute(\"shoppingCartModel\") public", "params": [{"name": "shoppingCart", "type": "ShoppingCart"}], "ret... |
68100331_22 | class DatatablesColumns {
public Iterable<Column> getColumns() {
List<Column> values = new ArrayList<>(columns.size());
values.addAll(columns.values());
return values;
}
public DatatablesColumns();
public void setData(int index, String data);
public void setName(int index, String name);
publ... | assertThat(columns.getColumns()).isEmpty();
}
} | [FOCAL] public Iterable<Column> DatatablesColumns.getColumns()
[CLASS] class DatatablesColumns
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] DatatablesColumns.size/0, List<Column>.addAll/1, DatatablesColumns.values/0
[NEW] ArrayList<>
[FIELDS] read=columns:DatatablesColumns
[INPU... | /* static context
[FOCAL] public Iterable<Column> DatatablesColumns.getColumns()
[INPUTS] branches=- | result=columns
[COLLABORATORS] field columns:DatatablesColumns size/0,values/0
[FIELDS] read=columns:DatatablesColumns
[NEW] ArrayList<>
[CALLS-EXTERNAL] DatatablesColumns.size/0, List<Column>.addAll/1, DatatablesColu... | /* static context
[FOCAL] public Iterable<Column> DatatablesColumns.getColumns()
[INPUTS] branches=- | result=columns
[COLLABORATORS] field columns:DatatablesColumns size/0,values/0
[FIELDS] read=columns:DatatablesColumns
[NEW] ArrayList<>
[CALLS-EXTERNAL] DatatablesColumns.size/0, List<Column>.addAll/1, DatatablesColu... | true | ok | {"focal": {"class": "DatatablesColumns", "name": "getColumns", "signature": "Iterable<Column> getColumns()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Iterable<Column>"}, "class_info": {"name": "DatatablesColumns", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fi... |
68100913_3 | class DailyStoryPresenter implements DailyStoryContract.Presenter {
@Override
public void loadMore(String date) {
mBeforeDailyStoriesUsecase.setDate(date);
Subscription subscription = mBeforeDailyStoriesUsecase.execute()
.subscribeOn(Schedulers.io())
.onErrorRetu... | String date = "";
when(mBeforeDailyStoriesUsecase.execute()).thenReturn(Observable.<DailyStories>error(new Throwable()));
mPresenter.loadMore(date);
verify(mBeforeDailyStoriesUsecase).setDate(date);
verify(mView).showError("load more error");
}
} | [FOCAL] @Override public void DailyStoryPresenter.loadMore(String date)
[CLASS] class DailyStoryPresenter implements DailyStoryContract.Presenter
[METRICS] loc=23 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] FetchBeforeDailyStoriesUsecase.setDate/1, mBeforeDailyStoriesUsecase.execute() .subscri... | /* static context
[FOCAL] @Override public void DailyStoryPresenter.loadMore(String date)
[COLLABORATORS] field mBeforeDailyStoriesUsecase:FetchBeforeDailyStoriesUsecase setDate/1,execute/0; field mView:DailyStoryContract.View showError/1,appendStory/1; field mCompositeSubscription add/1
[FIELDS] read=mBeforeDailyStori... | /* static context
[FOCAL] @Override public void DailyStoryPresenter.loadMore(String date)
[COLLABORATORS] field mBeforeDailyStoriesUsecase:FetchBeforeDailyStoriesUsecase setDate/1,execute/0; field mView:DailyStoryContract.View showError/1,appendStory/1; field mCompositeSubscription add/1
[FIELDS] read=mBeforeDailyStori... | true | ok | {"focal": {"class": "DailyStoryPresenter", "name": "loadMore", "signature": "void loadMore(String date)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "date", "type": "String"}], "return_type": "void"}, "class_info": {"name": "DailyStoryPresenter", "kind": "class", "modifiers": "", "superclass"... |
68199747_4 | class TasksRepository implements TasksDataSource {
@Override
public Observable<Task> getTask(@NonNull final String taskId) {
checkNotNull(taskId);
final Task cachedTask = getTaskWithId(taskId);
// Respond immediately with cache if available
if (cachedTask != null) {
... | // Given a stub completed task with title and description in the local repository
Task task = new Task(TASK_TITLE, "Some Task Description", true);
setTaskAvailable(mTasksLocalDataSource, task);
// And the task not available in the remote repository
setTaskNotAvailable(mTasksRemot... | [FOCAL] @Override public Observable<Task> TasksRepository.getTask(String taskId)
[CLASS] class TasksRepository implements TasksDataSource
[METRICS] loc=41 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] Observable<Task> getTaskWithIdFromLocalRepository(String taskId); Task getTaskWithId(String id)... | /* static context
[FOCAL] @Override public Observable<Task> TasksRepository.getTask(String taskId)
[PATH1] if(cachedTask != null)=F -> if(mCachedTasks == null)=T -> return Observable.concat(localTask, remoteTask).first() .map(new Func1<Tas...
[PATH2] if(cachedTask != null)=T -> return Observable.just(cachedTask)
[PATH3... | /* static context
[FOCAL] @Override public Observable<Task> TasksRepository.getTask(String taskId)
[PATH1] if(cachedTask != null)=F -> if(mCachedTasks == null)=T -> return Observable.concat(localTask, remoteTask).first() .map(new Func1<Tas...
[PATH2] if(cachedTask != null)=T -> return Observable.just(cachedTask)
[PATH3... | true | ok | {"focal": {"class": "TasksRepository", "name": "getTask", "signature": "Observable<Task> getTask(String taskId)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "taskId", "type": "String"}], "return_type": "Observable<Task>"}, "class_info": {"name": "TasksRepository", "kind": "class", "modifiers"... |
68204996_18 | class DefaultTwitterProfileService implements TwitterProfileService {
@Override
public List<TwitterProfile> findAll() {
return repository.findAll();
}
@PostConstruct public void init();
@Override public TwitterProfile findByScreenName(final String screenName);
private TwitterProfileSe... | doReturn(new ArrayList<TwitterProfile>()).when(repository).findAll();
assertThat(profileService.findAll(), emptyCollectionOf(TwitterProfile.class));
verify(repository).findAll();
}
} | [FOCAL] @Override public List<TwitterProfile> DefaultTwitterProfileService.findAll()
[CLASS] class DefaultTwitterProfileService implements TwitterProfileService
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] TwitterProfileRepository.findAll/0
[FIELDS] read=repository:TwitterProfil... | /* static context
[FOCAL] @Override public List<TwitterProfile> DefaultTwitterProfileService.findAll()
[INPUTS] branches=- | result=repository
[COLLABORATORS] field repository:TwitterProfileRepository findAll/0
[FIELDS] read=repository:TwitterProfileRepository
[CALLS-EXTERNAL] TwitterProfileRepository.findAll/0
*/
| /* static context
[FOCAL] @Override public List<TwitterProfile> DefaultTwitterProfileService.findAll()
[INPUTS] branches=- | result=repository
[COLLABORATORS] field repository:TwitterProfileRepository findAll/0
[FIELDS] read=repository:TwitterProfileRepository
[CALLS-EXTERNAL] TwitterProfileRepository.findAll/0
*/
clas... | true | ok | {"focal": {"class": "DefaultTwitterProfileService", "name": "findAll", "signature": "List<TwitterProfile> findAll()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "List<TwitterProfile>"}, "class_info": {"name": "DefaultTwitterProfileService", "kind": "class", "modifiers": "", "supercla... |
68246414_0 | class Data {
public Map<String, Object> toChildMap() {
return toChildMap(false);
}
public Data();
public Data(String key);
public Data(String key, Object value);
public String getKey();
public Object getValue();
public T getValue(Class<T> valueType);
public void setValu... | Data data = new Data("root");
data.setValue("a/b/c", "val1");
data.setValue("a/b/d", "val2");
data.setValue("a/a/d", "val3");
Map<String, Object> map = data.toChildMap();
assertEquals(3, map.size());
assertEquals("val1", map.get("a/b/c"));
assertEquals("v... | [FOCAL] public Map<String, Object> Data.toChildMap()
[CLASS] class Data
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Map<String, Object> toChildMap(boolean isDelete)
[CLASS-MEMBERS] Data(); Data(String key); Data(String key, Object value); String getKey(); Object getValue(); T g... | /* static context
[FOCAL] public Map<String, Object> Data.toChildMap()
[CALLS-INTERNAL] Map<String, Object> toChildMap(boolean isDelete)
*/
| /* static context
[FOCAL] public Map<String, Object> Data.toChildMap()
[CALLS-INTERNAL] Map<String, Object> toChildMap(boolean isDelete)
*/
class Data {
public Map<String, Object> toChildMap() {
return toChildMap(false);
}
public Data();
public Data(String key);
public Data(String key, ... | true | ok | {"focal": {"class": "Data", "name": "toChildMap", "signature": "Map<String, Object> toChildMap()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Map<String, Object>"}, "class_info": {"name": "Data", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members"... |
68253152_55 | class ApiException extends RuntimeException {
public List<Pair<String, List<String>>> getExtraResponseHeaders() {
return extraResponseHeaders;
}
public ApiException(ApiError error);
public ApiException(Builder builder);
@Deprecated public ApiException(List<ApiError> apiErrors, List<Pair... | // given
List<Pair<String, String>> loggingDetails = Collections.emptyList();
List<ApiError> apiErrors = Arrays.asList(apiError1, apiError2);
// when
ApiException apiException = new ApiException(apiErrors, loggingDetails, null, exceptionMessage, cause);
// then
... | [FOCAL] public List<Pair<String, List<String>>> ApiException.getExtraResponseHeaders()
[CLASS] class ApiException extends RuntimeException
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] ApiException(ApiError error); ApiException(Builder builder); ApiException(List<ApiError> apiErro... | /* static context
[FOCAL] public List<Pair<String, List<String>>> ApiException.getExtraResponseHeaders()
*/
| /* static context
[FOCAL] public List<Pair<String, List<String>>> ApiException.getExtraResponseHeaders()
*/
class ApiException extends RuntimeException {
public List<Pair<String, List<String>>> getExtraResponseHeaders() {
return extraResponseHeaders;
}
public ApiException(ApiError error);
pub... | true | ok | {"focal": {"class": "ApiException", "name": "getExtraResponseHeaders", "signature": "List<Pair<String, List<String>>> getExtraResponseHeaders()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<Pair<String, List<String>>>"}, "class_info": {"name": "ApiException", "kind": "class", "modifiers":... |
68273151_109 | class ArrayUtils {
public static int[] argrank(@Nonnull final int[] a) {
return argsort(argsort(a));
}
private ArrayUtils();
@SuppressWarnings("unchecked") public static T[] newInstance(@Nonnull final T[] a, @Nonnegative final int newLength);
@SuppressWarnings("unchecked") public static ... | double[] a = new double[] {5.1d, 2.1d, 0.1d, 1.1d};
Assert.assertArrayEquals(new int[] {3, 2, 0, 1}, argrank(a));
}
} | [FOCAL] public static int[] ArrayUtils.argrank(int[] a)
[CLASS] class ArrayUtils
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] int[] argsort(int[] a)
[INPUTS] branches=- | result=a
[DATAFLOW] a@param->L2
[CLASS-MEMBERS] ArrayUtils(); T[] newInstance(T[] a, int newLength); T[] new... | class ArrayUtils {
public static int[] argrank(@Nonnull final int[] a) {
return argsort(argsort(a));
}
private ArrayUtils();
@SuppressWarnings("unchecked") public static T[] newInstance(@Nonnull final T[] a, @Nonnegative final int newLength);
@SuppressWarnings("unchecked") public static ... | false | ok | {"focal": {"class": "ArrayUtils", "name": "argrank", "signature": "int[] argrank(int[] a)", "start_line": 3, "modifiers": "public static", "params": [{"name": "a", "type": "int[]"}], "return_type": "int[]"}, "class_info": {"name": "ArrayUtils", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "... | |
68289398_0 | class JsonChannelList implements IChannelList {
@Override
public int size() {
return channels.size();
}
public JsonChannelList(Context context);
@Override public ChannelModel get(int index);
@Override public ChannelModel get(String id);
@Override public List<ChannelModel> getList();
@NonNull @Override pub... | assertNotNull("channel list is not null", channelList);
assertTrue("channel list is not empty", channelList.size() > 0);
}
} | [FOCAL] @Override public int JsonChannelList.size()
[CLASS] class JsonChannelList implements IChannelList
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] channels.size/0
[COLLABORATORS] field channels size/0
[CLASS-MEMBERS] JsonChannelList(Context context); ChannelModel get(int ind... | /* static context
[FOCAL] @Override public int JsonChannelList.size()
[COLLABORATORS] field channels size/0
[CALLS-EXTERNAL] channels.size/0
*/
| /* static context
[FOCAL] @Override public int JsonChannelList.size()
[COLLABORATORS] field channels size/0
[CALLS-EXTERNAL] channels.size/0
*/
class JsonChannelList implements IChannelList {
@Override
public int size() {
return channels.size();
}
public JsonChannelList(Context context);
@Override public Cha... | true | ok | {"focal": {"class": "JsonChannelList", "name": "size", "signature": "int size()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "JsonChannelList", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "IChannelList", "fields": [{"name": "chan... |
68379040_23 | class YamlDataSet implements IDataSet {
String applyCaseInsensitivity(String name) {
return (name != null)
? isCaseSensitiveTableNames() ? name : isCaseInsensitiveStrategyLowerCase()
? name.toLowerCase(Locale.ENGLISH)
: name.toUpperCase(Locale... | DBUnitConfig dbUnitConfig = DBUnitConfig.from(YamlDataSetTest.class.getAnnotation(DBUnit.class));
dbUnitConfig.caseInsensitiveStrategy(Orthography.LOWERCASE);
// uses default config (dbunit.yml plus @DBUnit of this class)
YamlDataSet dataSet = new YamlDataSet(YamlDataSetTest.class.getRes... | [FOCAL] String YamlDataSet.applyCaseInsensitivity(String name)
[CLASS] class YamlDataSet implements IDataSet
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] boolean isCaseInsensitiveStrategyLowerCase(); boolean isCaseSensitiveTableNames()
[CALLS-EXTERNAL] String.toLowerCase/1, Stri... | /* static context
[FOCAL] String YamlDataSet.applyCaseInsensitivity(String name)
[INPUTS] branches=- | result=name
[CALLS-INTERNAL] boolean isCaseInsensitiveStrategyLowerCase(); boolean isCaseSensitiveTableNames()
[CALLS-EXTERNAL] String.toLowerCase/1, String.toUpperCase/1
*/
| /* static context
[FOCAL] String YamlDataSet.applyCaseInsensitivity(String name)
[INPUTS] branches=- | result=name
[CALLS-INTERNAL] boolean isCaseInsensitiveStrategyLowerCase(); boolean isCaseSensitiveTableNames()
[CALLS-EXTERNAL] String.toLowerCase/1, String.toUpperCase/1
*/
class YamlDataSet implements IDataSet {
... | true | ok | {"focal": {"class": "YamlDataSet", "name": "applyCaseInsensitivity", "signature": "String applyCaseInsensitivity(String name)", "start_line": 3, "modifiers": "", "params": [{"name": "name", "type": "String"}], "return_type": "String"}, "class_info": {"name": "YamlDataSet", "kind": "class", "modifiers": "", "superclass"... |
68436985_7 | class Loader {
public final boolean hasResult() {
return (state.get() & STATE_HAS_RESULT) == STATE_HAS_RESULT;
}
private static boolean isRunning(int state);
private static boolean isSuccess(int state);
private static boolean isError(int state);
private static boolean isDestroyed(int s... | assertFalse(loader.hasResult());
}
} | [FOCAL] public final boolean Loader.hasResult()
[CLASS] class Loader
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] state.get/0
[COLLABORATORS] field state get/0
[CLASS-MEMBERS] boolean isRunning(int state); boolean isSuccess(int state); boolean isError(int state); boolean isDestr... | /* static context
[FOCAL] public final boolean Loader.hasResult()
[COLLABORATORS] field state get/0
[CALLS-EXTERNAL] state.get/0
*/
| /* static context
[FOCAL] public final boolean Loader.hasResult()
[COLLABORATORS] field state get/0
[CALLS-EXTERNAL] state.get/0
*/
class Loader {
public final boolean hasResult() {
return (state.get() & STATE_HAS_RESULT) == STATE_HAS_RESULT;
}
private static boolean isRunning(int state);
priv... | true | ok | {"focal": {"class": "Loader", "name": "hasResult", "signature": "boolean hasResult()", "start_line": 3, "modifiers": "public final", "params": [], "return_type": "boolean"}, "class_info": {"name": "Loader", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "loader", "type": "... |
68459222_0 | class NetUtil {
public static String getBasicHeader(String name, String password) {
String str = Base64.encodeToString((name + ":" + password).getBytes(), Base64.NO_WRAP);
return "Basic " + str;
}
public static Error convertError(Throwable throwable);
}
class NetUtilTest {
@Test
... | Assert.assertEquals("Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==", NetUtil.getBasicHeader("Aladdin", "open sesame"));
}
} | [FOCAL] public static String NetUtil.getBasicHeader(String name, String password)
[CLASS] class NetUtil
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Base64.encodeToString/2, (name + ":" + password).getBytes/0
[INPUTS] branches=- | result=name, password
[DATAFLOW] name@param->L2;... | /* static context
[FOCAL] public static String NetUtil.getBasicHeader(String name, String password)
[INPUTS] branches=- | result=name, password
[CALLS-EXTERNAL] Base64.encodeToString/2, (name + ":" + password).getBytes/0
*/
| /* static context
[FOCAL] public static String NetUtil.getBasicHeader(String name, String password)
[INPUTS] branches=- | result=name, password
[CALLS-EXTERNAL] Base64.encodeToString/2, (name + ":" + password).getBytes/0
*/
class NetUtil {
public static String getBasicHeader(String name, String password) {
... | true | ok | {"focal": {"class": "NetUtil", "name": "getBasicHeader", "signature": "String getBasicHeader(String name, String password)", "start_line": 3, "modifiers": "public static", "params": [{"name": "name", "type": "String"}, {"name": "password", "type": "String"}], "return_type": "String"}, "class_info": {"name": "NetUtil", ... |
68501019_16 | class AbstractClusterInvoker implements Invoker<T> {
public Result invoke(final Invocation invocation) throws RpcException {
checkWhetherDestroyed();
LoadBalance loadbalance;
List<Invoker<T>> invokers = list(invocation);
if (invokers != null && invokers.size() > 0) {
... | List<Invoker<DemoService>> invokers = new ArrayList<Invoker<DemoService>>();
invokers.add(new Invoker<DemoService>() {
public Class<DemoService> getInterface() {
return DemoService.class;
}
public URL getUrl() {
return URL.valueOf("du... | [FOCAL] public Result AbstractClusterInvoker.invoke(Invocation invocation)
[CLASS] class AbstractClusterInvoker implements Invoker<T>
[METRICS] loc=16 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] List<Invoker<T>> list(Invocation invocation); Result doInvoke(Invocation invocation, List<Invoker<T... | /* static context
[FOCAL] public Result AbstractClusterInvoker.invoke(Invocation invocation)
[PATH1] if(invokers != null && invokers.size() > 0)=T -> return doInvoke(invocation, invokers, loadbalance)
[PATH2] if(invokers != null && invokers.size() > 0)=F -> return doInvoke(invocation, invokers, loadbalance)
[INPUTS] br... | /* static context
[FOCAL] public Result AbstractClusterInvoker.invoke(Invocation invocation)
[PATH1] if(invokers != null && invokers.size() > 0)=T -> return doInvoke(invocation, invokers, loadbalance)
[PATH2] if(invokers != null && invokers.size() > 0)=F -> return doInvoke(invocation, invokers, loadbalance)
[INPUTS] br... | true | ok | {"focal": {"class": "AbstractClusterInvoker", "name": "invoke", "signature": "Result invoke(Invocation invocation) throws RpcException", "start_line": 3, "modifiers": "public", "params": [{"name": "invocation", "type": "Invocation"}], "return_type": "Result"}, "class_info": {"name": "AbstractClusterInvoker", "kind": "c... |
68539843_51 | class WebApplicationExceptionErrorMapper extends TypedErrorMapper<WebApplicationException> {
@Override
protected List<String> doGetErrorMessages(WebApplicationException exception) {
Response response = exception.getResponse();
if (StringUtils.isBlank(exception.getMessage())) {
retur... | final WebApplicationExceptionErrorMapper errorMapper = new WebApplicationExceptionErrorMapper();
assertEquals(Collections.singletonList("Not found!"), errorMapper.doGetErrorMessages(new NotFoundException("Not found!")));
assertEquals(Collections.singletonList("Not Found"), errorMapper.doGetError... | [FOCAL] @Override protected List<String> WebApplicationExceptionErrorMapper.doGetErrorMessages(WebApplicationException exception)
[CLASS] class WebApplicationExceptionErrorMapper extends TypedErrorMapper<WebApplicationException>
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] WebAp... | /* static context
[FOCAL] @Override protected List<String> WebApplicationExceptionErrorMapper.doGetErrorMessages(WebApplicationException exception)
[PATH1] if(StringUtils.isBlank(exception.getMessage()))=T -> return Collections.singletonList(Responses.getErrorMessage(response))
[PATH2] if(StringUtils.isBlank(exception.... | /* static context
[FOCAL] @Override protected List<String> WebApplicationExceptionErrorMapper.doGetErrorMessages(WebApplicationException exception)
[PATH1] if(StringUtils.isBlank(exception.getMessage()))=T -> return Collections.singletonList(Responses.getErrorMessage(response))
[PATH2] if(StringUtils.isBlank(exception.... | true | ok | {"focal": {"class": "WebApplicationExceptionErrorMapper", "name": "doGetErrorMessages", "signature": "List<String> doGetErrorMessages(WebApplicationException exception)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "exception", "type": "WebApplicationException"}], "return_type": "List<Strin... |
68581045_39 | class KeywordDao extends BaseDao<Keyword> implements IKeywordDao {
@Override
public void addOrUpdate(String name) {
Keyword k = (Keyword)this.queryObject("from Keyword where name=?", name);
if(k==null) {
k = new Keyword();
k.setName(name);
k.setNameFullPy(PinyinUtil.str2Pinyin(name, null));
k.setName... | keywordDao.addOrUpdate("招生政策");
Keyword k = keywordDao.load(11);
Keyword kk = new Keyword(11, "招生政策", "zhaoshengzhengce","zszc");
TestUtil.assertObjByClz(k, kk, Keyword.class, new String[]{"times"});
}
} | [FOCAL] @Override public void KeywordDao.addOrUpdate(String name)
[CLASS] class KeywordDao extends BaseDao<Keyword> implements IKeywordDao
[METRICS] loc=14 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] this.queryObject/2, Keyword.setName/1, Keyword.setNameFullPy/1, PinyinUtil.str2Pinyin/2, Keywo... | /* static context
[FOCAL] @Override public void KeywordDao.addOrUpdate(String name)
[PATH1] if(k==null)=T
[PATH2] if(k==null)=F
[INPUTS] branches=name | result=-
[NEW] Keyword
[CALLS-EXTERNAL] this.queryObject/2, Keyword.setName/1, Keyword.setNameFullPy/1, PinyinUtil.str2Pinyin/2, Keyword.setNameShortPy/1, PinyinUtil.s... | /* static context
[FOCAL] @Override public void KeywordDao.addOrUpdate(String name)
[PATH1] if(k==null)=T
[PATH2] if(k==null)=F
[INPUTS] branches=name | result=-
[NEW] Keyword
[CALLS-EXTERNAL] this.queryObject/2, Keyword.setName/1, Keyword.setNameFullPy/1, PinyinUtil.str2Pinyin/2, Keyword.setNameShortPy/1, PinyinUtil.s... | true | ok | {"focal": {"class": "KeywordDao", "name": "addOrUpdate", "signature": "void addOrUpdate(String name)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "name", "type": "String"}], "return_type": "void"}, "class_info": {"name": "KeywordDao", "kind": "class", "modifiers": "", "superclass": "BaseDao<K... |
68586699_28 | class DataCell {
void performMatching(String dataContent, String correspontingHeadline){
if(isExactMatch(dataContent, correspontingHeadline)) {
this.dataCellEvaluationStatus = DataCellEvaluationStatus.EXACT_MATCH;
return;
}
if(isContainsMatch(dataContent, corresponti... | DataCell dataCell = new DataCell(" Content1 ", " Headline1 ");
dataCell.performMatching(".*Content.*", "Headline1");
Assert.assertTrue(dataCell.dataCellEvaluationStatus.equals(DataCellEvaluationStatus.REGEX_MATCH));
}
} | [FOCAL] void DataCell.performMatching(String dataContent, String correspontingHeadline)
[CLASS] class DataCell
[METRICS] loc=15 cc=4 branches=3 loops=0 returns=3 throws=0 nesting=1
[CALLS-INTERNAL] boolean isContainsMatch(String dataContent, String correspontingHeadline); boolean isExactMatch(String dataContent, String... | /* static context
[FOCAL] void DataCell.performMatching(String dataContent, String correspontingHeadline)
[PATH1] if(isExactMatch(dataContent, correspontingHeadline))=F -> if(isContainsMatch(dataContent, correspontingHeadline))=F -> if(isRegexMatch(dataContent, correspontingHeadline))=T -> return
[PATH2] if(isExactMatc... | /* static context
[FOCAL] void DataCell.performMatching(String dataContent, String correspontingHeadline)
[PATH1] if(isExactMatch(dataContent, correspontingHeadline))=F -> if(isContainsMatch(dataContent, correspontingHeadline))=F -> if(isRegexMatch(dataContent, correspontingHeadline))=T -> return
[PATH2] if(isExactMatc... | true | ok | {"focal": {"class": "DataCell", "name": "performMatching", "signature": "void performMatching(String dataContent, String correspontingHeadline)", "start_line": 3, "modifiers": "", "params": [{"name": "dataContent", "type": "String"}, {"name": "correspontingHeadline", "type": "String"}], "return_type": "void"}, "class_i... |
68590674_0 | class BingWallpaperUtils {
public static DateTime checkTime(LocalTime time) {
return DateTimeUtils.checkTimeToNextDay(time);
}
public static boolean isEnableLog(Context context);
public static boolean isEnableLogProvider(Context context);
public static String getResolutionImageUrl(Context ... | DateTime dateTime = DateTime.now().minusHours(1);
DateTime dateTime1 = BingWallpaperUtils.checkTime(dateTime.toLocalTime());
assertEquals(dateTime1.getDayOfMonth(), dateTime.plusDays(1).getDayOfMonth());
}
} | [FOCAL] public static DateTime BingWallpaperUtils.checkTime(LocalTime time)
[CLASS] class BingWallpaperUtils
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] DateTimeUtils.checkTimeToNextDay/1
[INPUTS] branches=- | result=time
[DATAFLOW] time@param->L2
[CLASS-MEMBERS] boolean isEnab... | /* static context
[FOCAL] public static DateTime BingWallpaperUtils.checkTime(LocalTime time)
[INPUTS] branches=- | result=time
[CALLS-EXTERNAL] DateTimeUtils.checkTimeToNextDay/1
*/
| /* static context
[FOCAL] public static DateTime BingWallpaperUtils.checkTime(LocalTime time)
[INPUTS] branches=- | result=time
[CALLS-EXTERNAL] DateTimeUtils.checkTimeToNextDay/1
*/
class BingWallpaperUtils {
public static DateTime checkTime(LocalTime time) {
return DateTimeUtils.checkTimeToNextDay(time);... | true | ok | {"focal": {"class": "BingWallpaperUtils", "name": "checkTime", "signature": "DateTime checkTime(LocalTime time)", "start_line": 3, "modifiers": "public static", "params": [{"name": "time", "type": "LocalTime"}], "return_type": "DateTime"}, "class_info": {"name": "BingWallpaperUtils", "kind": "class", "modifiers": "", "... |
68602823_4 | class DbMapper {
public Speaker fromAppSpeaker(@Nullable com.nilhcem.mobilization.data.app.model.Speaker from) {
if (from == null) {
return null;
}
return new Speaker(from.getId(), from.getName(), from.getTitle(), from.getBio(),
from.getWebsite(), from.getTwitte... | // Given
Speaker speaker = new Speaker(10, "name", "title", "bio", "website", "twitter", "github", "photo");
// When
com.nilhcem.mobilization.data.database.model.Speaker result = dbMapper.fromAppSpeaker(speaker);
// Then
assertThat(result.id).isEqualTo(10);
asse... | [FOCAL] public Speaker DbMapper.fromAppSpeaker(com.nilhcem.mobilization.data.app.model.Speaker from)
[CLASS] class DbMapper
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] com.nilhcem.mobilization.data.app.model.Speaker.getId/0, com.nilhcem.mobilization.data.app.model.Speaker.getNa... | /* static context
[FOCAL] public Speaker DbMapper.fromAppSpeaker(com.nilhcem.mobilization.data.app.model.Speaker from)
[PATH1] if(from == null)=T -> return null
[PATH2] if(from == null)=F -> return new Speaker(from.getId(), from.getName(), from.getTitle(), from.get...
[INPUTS] branches=from | result=from
[COLLABORATORS... | /* static context
[FOCAL] public Speaker DbMapper.fromAppSpeaker(com.nilhcem.mobilization.data.app.model.Speaker from)
[PATH1] if(from == null)=T -> return null
[PATH2] if(from == null)=F -> return new Speaker(from.getId(), from.getName(), from.getTitle(), from.get...
[INPUTS] branches=from | result=from
[COLLABORATORS... | true | ok | {"focal": {"class": "DbMapper", "name": "fromAppSpeaker", "signature": "Speaker fromAppSpeaker(com.nilhcem.mobilization.data.app.model.Speaker from)", "start_line": 3, "modifiers": "public", "params": [{"name": "from", "type": "com.nilhcem.mobilization.data.app.model.Speaker"}], "return_type": "Speaker"}, "class_info":... |
68614547_10 | class YaRxDelegate {
public synchronized void remove(Disposable disposable) {
if (mDisposables2Stop == null && mDisposables2Destroy == null) {
throw new IllegalStateException("remove should not be called after onDestroy");
}
if (mDisposables2Stop != null) {
mDisposab... | mYaRxDelegate.onCreate();
mYaRxDelegate.onStart();
mYaRxDelegate.addUtilStop(mDisposable);
assertThat(mDisposable.isDisposed()).isFalse();
mYaRxDelegate.remove(mDisposable);
mYaRxDelegate.onStop();
assertThat(mDisposable.isDisposed()).isTrue();
}
} | [FOCAL] public synchronized void YaRxDelegate.remove(Disposable disposable)
[CLASS] class YaRxDelegate
[METRICS] loc=11 cc=4 branches=3 loops=0 returns=0 throws=1 nesting=1
[CALLS-EXTERNAL] mDisposables2Stop.remove/1, mDisposables2Destroy.remove/1
[NEW] IllegalStateException
[EXCEPTIONS] throws IllegalStateException
[T... | /* static context
[FOCAL] public synchronized void YaRxDelegate.remove(Disposable disposable)
[THROWS-WHEN] IllegalStateException when mDisposables2Stop == null && mDisposables2Destroy == null
[PATH1] if(mDisposables2Stop == null && mDisposables2Destroy == null)=F -> if(mDisposables2Stop != null)=T -> if(mDisposables2D... | /* static context
[FOCAL] public synchronized void YaRxDelegate.remove(Disposable disposable)
[THROWS-WHEN] IllegalStateException when mDisposables2Stop == null && mDisposables2Destroy == null
[PATH1] if(mDisposables2Stop == null && mDisposables2Destroy == null)=F -> if(mDisposables2Stop != null)=T -> if(mDisposables2D... | true | ok | {"focal": {"class": "YaRxDelegate", "name": "remove", "signature": "void remove(Disposable disposable)", "start_line": 3, "modifiers": "public synchronized", "params": [{"name": "disposable", "type": "Disposable"}], "return_type": "void"}, "class_info": {"name": "YaRxDelegate", "kind": "class", "modifiers": "", "superc... |
68626098_3 | class QuizPresenter implements QuizContract.Presenter {
@Override
public void onSkipQuestion() {
// -1 denotes a skipped question that doesn't make it into the final score object
// This behavior is configurable in settings
recordScore(current, -1);
current = getNextCountry();... |
doNothing().when(spyPresenter)
.recordScore(Mockito.any(CountryCapitalPair.class),
Mockito.anyInt());
doReturn(countryCapitalPair).when(spyPresenter).getNextCountry();
spyPresenter.onSkipQuestion();
InOrder inOrder = inOrder(spyPresenter, view);... | [FOCAL] @Override public void QuizPresenter.onSkipQuestion()
[CLASS] class QuizPresenter implements QuizContract.Presenter
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] CountryCapitalPair getNextCountry(); void recordScore(CountryCapitalPair current, int m)
[CALLS-EXTERNAL] Quiz... | /* static context
[FOCAL] @Override public void QuizPresenter.onSkipQuestion()
[COLLABORATORS] field view:QuizContract.View showQuestion/1; field current asCountry/0
[CALLS-INTERNAL] CountryCapitalPair getNextCountry(); void recordScore(CountryCapitalPair current, int m)
[FIELDS] read=view:QuizContract.View
[CALLS-EXTE... | /* static context
[FOCAL] @Override public void QuizPresenter.onSkipQuestion()
[COLLABORATORS] field view:QuizContract.View showQuestion/1; field current asCountry/0
[CALLS-INTERNAL] CountryCapitalPair getNextCountry(); void recordScore(CountryCapitalPair current, int m)
[FIELDS] read=view:QuizContract.View
[CALLS-EXTE... | true | ok | {"focal": {"class": "QuizPresenter", "name": "onSkipQuestion", "signature": "void onSkipQuestion()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "QuizPresenter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "QuizContract.Presenter... |
68632639_4 | class BindingService implements ServiceInstanceBindingService {
@Override
public CreateServiceInstanceBindingResponse createServiceInstanceBinding(CreateServiceInstanceBindingRequest request) {
ServiceInstance instance = instanceService.getServiceInstance(request.getServiceInstanceId());
if (... | when(mockDefaultServiceImpl.createBinding(any(ServiceInstance.class), any(ServiceBinding.class))).thenThrow(new RuntimeException("aaaagh!"));
exception.expect(ServiceBrokerException.class);
assertNotNull(bindingService.createServiceInstanceBinding(TestConfig.createBindingRequest(ID, ID)));
... | [FOCAL] @Override public CreateServiceInstanceBindingResponse BindingService.createServiceInstanceBinding(CreateServiceInstanceBindingRequest request)
[CLASS] class BindingService implements ServiceInstanceBindingService
[METRICS] loc=36 cc=4 branches=2 loops=0 returns=1 throws=3 nesting=1
[CALLS-INTERNAL] ServiceBindi... | /* static context
[FOCAL] @Override public CreateServiceInstanceBindingResponse BindingService.createServiceInstanceBinding(CreateServiceInstanceBindingRequest request)
[THROWS-WHEN] ServiceInstanceBindingExistsException when getBinding(request.getBindingId()) != null
[THROWS-WHEN] ServiceBrokerException when !(getBind... | /* static context
[FOCAL] @Override public CreateServiceInstanceBindingResponse BindingService.createServiceInstanceBinding(CreateServiceInstanceBindingRequest request)
[THROWS-WHEN] ServiceInstanceBindingExistsException when getBinding(request.getBindingId()) != null
[THROWS-WHEN] ServiceBrokerException when !(getBind... | true | ok | {"focal": {"class": "BindingService", "name": "createServiceInstanceBinding", "signature": "CreateServiceInstanceBindingResponse createServiceInstanceBinding(CreateServiceInstanceBindingRequest request)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "CreateServiceInstanceBind... |
68643971_5 | class UserDao implements Dao<User> {
@Override
public List<User> getAllWhere(String... conditions) {
List<User> persons = new ArrayList<>();
try (Connection con = DbConnector.getConnection();
Statement stm = con.createStatement()
) {
String condition = String.j... | List<User> lol = userDao.getAllWhere("login like 'Lol%'");
assertTrue(
lol.stream()
.map(User::getLogin)
.anyMatch(s -> s.startsWith(login))
);
}
} | [FOCAL] @Override public List<User> UserDao.getAllWhere(String... conditions)
[CLASS] class UserDao implements Dao<User>
[METRICS] loc=19 cc=3 branches=0 loops=1 returns=2 throws=0 nesting=2
[CALLS-INTERNAL] User mapToUser(ResultSet rs)
[CALLS-EXTERNAL] DbConnector.getConnection/0, Connection.createStatement/0, String.... | /* static context
[FOCAL] @Override public List<User> UserDao.getAllWhere(String... conditions)
[PATH1] while(rs.next())=T -> exit loop -> return persons
[PATH2] try-body throws -> return Collections.emptyList()
[PATH3] while(rs.next())=F -> return persons
[INPUTS] branches=conditions | result=-
[EXCEPTIONS] catches SQ... | /* static context
[FOCAL] @Override public List<User> UserDao.getAllWhere(String... conditions)
[PATH1] while(rs.next())=T -> exit loop -> return persons
[PATH2] try-body throws -> return Collections.emptyList()
[PATH3] while(rs.next())=F -> return persons
[INPUTS] branches=conditions | result=-
[EXCEPTIONS] catches SQ... | true | ok | {"focal": {"class": "UserDao", "name": "getAllWhere", "signature": "List<User> getAllWhere(String... conditions)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "conditions", "type": "String..."}], "return_type": "List<User>"}, "class_info": {"name": "UserDao", "kind": "class", "modifiers": "", ... |
68648922_1 | class RedditListViewModel extends Fragment {
@VisibleForTesting
void refresh() {
mSubscription = mRepository
.getReddits(mCategory)
.subscribeOn(Schedulers.io())
.observeOn(mMainThreadScheduler)
.doOnSubscribe(() -> errorText.set(null))
... | final Reddit reddit = new Reddit();
PublishSubject<Reddit> subject = PublishSubject.create();
Mockito.doReturn(subject.asObservable().toList())
.when(mRepository)
.getReddits(Mockito.anyString());
mViewModel.refresh();
Mockito.verify(mRepository).g... | [FOCAL] @VisibleForTesting void RedditListViewModel.refresh()
[CLASS] class RedditListViewModel extends Fragment
[METRICS] loc=16 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] mRepository .getReddits(mCategory) .subscribeOn(Scheduler....subscribe/2, mRepository .getReddits(mCategory) .subscribeO... | /* static context
[FOCAL] @VisibleForTesting void RedditListViewModel.refresh()
[COLLABORATORS] field mRepository:RedditRepository getReddits/1; field errorText set/1; field isLoading set/1; field reddits clear/0,addAll/1; field e getMessage/0
[FIELDS] read=mRepository:RedditRepository
[CALLS-EXTERNAL] mRepository .get... | /* static context
[FOCAL] @VisibleForTesting void RedditListViewModel.refresh()
[COLLABORATORS] field mRepository:RedditRepository getReddits/1; field errorText set/1; field isLoading set/1; field reddits clear/0,addAll/1; field e getMessage/0
[FIELDS] read=mRepository:RedditRepository
[CALLS-EXTERNAL] mRepository .get... | true | ok | {"focal": {"class": "RedditListViewModel", "name": "refresh", "signature": "void refresh()", "start_line": 3, "modifiers": "@VisibleForTesting", "params": [], "return_type": "void"}, "class_info": {"name": "RedditListViewModel", "kind": "class", "modifiers": "", "superclass": "Fragment", "interfaces": null, "fields": [... |
68664213_1 | class AddItemsViewModel implements ViewModel {
public BooleanProperty allSelectedProperty() {
return allSelected;
}
public AddItemsViewModel(TodoItemStore store);
public void selectAll();
public void addItem();
public StringProperty newItemValueProperty();
public ReadOnlyBooleanProperty allSelectedVisibleP... | itemStore.getItems().add(item1);
itemStore.getItems().add(item2);
itemStore.getItems().add(item3);
item1.setCompleted(true);
item2.setCompleted(true);
item3.setCompleted(true);
FxTestingUtils.waitForUiThread();
assertThat(viewModel.allSelectedProperty().... | [FOCAL] public BooleanProperty AddItemsViewModel.allSelectedProperty()
[CLASS] class AddItemsViewModel implements ViewModel
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] AddItemsViewModel(TodoItemStore store); void selectAll(); void addItem(); StringProperty newItemValueProperty()... | /* static context
[FOCAL] public BooleanProperty AddItemsViewModel.allSelectedProperty()
*/
| /* static context
[FOCAL] public BooleanProperty AddItemsViewModel.allSelectedProperty()
*/
class AddItemsViewModel implements ViewModel {
public BooleanProperty allSelectedProperty() {
return allSelected;
}
public AddItemsViewModel(TodoItemStore store);
public void selectAll();
public void addItem();
publi... | true | ok | {"focal": {"class": "AddItemsViewModel", "name": "allSelectedProperty", "signature": "BooleanProperty allSelectedProperty()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "BooleanProperty"}, "class_info": {"name": "AddItemsViewModel", "kind": "class", "modifiers": "", "superclass": null, "interf... |
68676827_488 | class Person extends BaseOpenmrsData {
public PersonAttribute getAttribute(PersonAttributeType pat) {
if (pat != null) {
for (PersonAttribute attribute : getAttributes()) {
if (pat.equals(attribute.getAttributeType()) && !attribute.isVoided()) {
return attribute;
}
}
}
return null;
}
publi... | Person person = personHelper(true, 1, 2, 3, "name1", "name2", "name3", "value1", "value2", "value3");
Assert.assertNull(person.getAttribute(new Integer(3)));
}
} | [FOCAL] public PersonAttribute Person.getAttribute(PersonAttributeType pat)
[CLASS] class Person extends BaseOpenmrsData
[METRICS] loc=10 cc=4 branches=2 loops=1 returns=2 throws=0 nesting=3
[CALLS-INTERNAL] Set<PersonAttribute> getAttributes()
[CALLS-EXTERNAL] PersonAttributeType.equals/1, PersonAttribute.getAttribute... | /* static context
[FOCAL] public PersonAttribute Person.getAttribute(PersonAttributeType pat)
[PATH1] if(pat != null)=T -> foreach(PersonAttribute attribute : getAttributes())=T -> if(pat.equals(attribute.getAttributeType()) && !attribute.isVoided())=F -> exit loop -> return null
[PATH2] if(pat != null)=T -> foreach(Pe... | /* static context
[FOCAL] public PersonAttribute Person.getAttribute(PersonAttributeType pat)
[PATH1] if(pat != null)=T -> foreach(PersonAttribute attribute : getAttributes())=T -> if(pat.equals(attribute.getAttributeType()) && !attribute.isVoided())=F -> exit loop -> return null
[PATH2] if(pat != null)=T -> foreach(Pe... | true | ok | {"focal": {"class": "Person", "name": "getAttribute", "signature": "PersonAttribute getAttribute(PersonAttributeType pat)", "start_line": 3, "modifiers": "public", "params": [{"name": "pat", "type": "PersonAttributeType"}], "return_type": "PersonAttribute"}, "class_info": {"name": "Person", "kind": "class", "modifiers"... |
68739393_0 | class OrderServiceV1 {
public OrderAggregate createOrder(CreateOrderRequest orderRequest) {
EntityWithIdAndVersion<OrderAggregate> createdAggregate =
Util.get(aggregateRepository.save(new CreateOrderCommand(orderRequest.getOrderStatus())));
// Save using JPA too
OrderAggre... | // Create a new order and aggregate
OrderAggregate expected = orderServiceV1.createOrder(new CreateOrderRequest(OrderStatus.CREATED));
Assert.assertEquals(expected.getStatus(), OrderStatus.CREATED);
String orderNumber = expected.getOrderNumber();
// Process the pending order co... | [FOCAL] public OrderAggregate OrderServiceV1.createOrder(CreateOrderRequest orderRequest)
[CLASS] class OrderServiceV1
[METRICS] loc=12 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Util.get/1, aggregateRepository.save/1, CreateOrderRequest.getOrderStatus/0, EntityWithIdAndVersion<OrderAggregate... | /* static context
[FOCAL] public OrderAggregate OrderServiceV1.createOrder(CreateOrderRequest orderRequest)
[INPUTS] branches=- | result=orderRequest
[COLLABORATORS] field aggregateRepository save/1; param orderRequest:CreateOrderRequest getOrderStatus/0; field orderRepository save/1
[NEW] CreateOrderCommand
[CALLS-EXT... | /* static context
[FOCAL] public OrderAggregate OrderServiceV1.createOrder(CreateOrderRequest orderRequest)
[INPUTS] branches=- | result=orderRequest
[COLLABORATORS] field aggregateRepository save/1; param orderRequest:CreateOrderRequest getOrderStatus/0; field orderRepository save/1
[NEW] CreateOrderCommand
[CALLS-EXT... | true | ok | {"focal": {"class": "OrderServiceV1", "name": "createOrder", "signature": "OrderAggregate createOrder(CreateOrderRequest orderRequest)", "start_line": 3, "modifiers": "public", "params": [{"name": "orderRequest", "type": "CreateOrderRequest"}], "return_type": "OrderAggregate"}, "class_info": {"name": "OrderServiceV1", ... |
68883930_2 | class ShadeTwo {
static BeanShade2 calculateDimentions(FrameModel frameModel, float width1, float height1, float width2, float height2){
WIDTH_1 = 0; WIDTH_2 = 0; HEIGHT_1 = 0; HEIGHT_2 = 0;
BeanShade2 beanShade2 = new BeanShade2();
//width1 amount to required width
float amountW1 =... | BeanShade2 beanShade2Result = ShadeTwo.calculateDimentions
(frameModel, dimentionsModel.params[0],
dimentionsModel.params[1],
dimentionsModel.params[2],
dimentionsModel.params[3]);
boolean isFirstImageLeftOrTop = beanShade2Result.getImageO... | [FOCAL] static BeanShade2 ShadeTwo.calculateDimentions(FrameModel frameModel, float width1, float height1, float width2, float height2)
[CLASS] class ShadeTwo
[METRICS] loc=92 cc=5 branches=4 loops=0 returns=1 throws=0 nesting=4
[CALLS-INTERNAL] void calculateHorz(FrameModel frameModel, BeanShade2 beanShade2, float wid... | class ShadeTwo {
static BeanShade2 calculateDimentions(FrameModel frameModel, float width1, float height1, float width2, float height2){
WIDTH_1 = 0; WIDTH_2 = 0; HEIGHT_1 = 0; HEIGHT_2 = 0;
BeanShade2 beanShade2 = new BeanShade2();
//width1 amount to required width
float amountW1 =... | false | ok | {"focal": {"class": "ShadeTwo", "name": "calculateDimentions", "signature": "BeanShade2 calculateDimentions(FrameModel frameModel, float width1, float height1, float width2, float height2)", "start_line": 3, "modifiers": "static", "params": [{"name": "frameModel", "type": "FrameModel"}, {"name": "width1", "type": "floa... | |
68901259_2 | class EditDistance {
public static int computeMinEditDistance(String src, String dest, boolean shouldPrintMorphing) {
char[] str1 = src.toCharArray();
char[] str2 = dest.toCharArray();
int editArr[][] = new int[str1.length + 1][str2.length + 1];
for (int i = 0; i < editArr[0].lengt... | String src = "world";
String dest = "aafdfyord";
int result = EditDistance.computeMinEditDistance(src, dest, true);
assertThat(result).isEqualTo(7);
}
} | [FOCAL] public static int EditDistance.computeMinEditDistance(String src, String dest, boolean shouldPrintMorphing)
[CLASS] class EditDistance
[METRICS] loc=28 cc=7 branches=2 loops=4 returns=1 throws=0 nesting=3
[CALLS-INTERNAL] void printMorphing(int arr, String src, String dest)
[CALLS-EXTERNAL] String.toCharArray/0... | /* static context
[FOCAL] public static int EditDistance.computeMinEditDistance(String src, String dest, boolean shouldPrintMorphing)
[PATH1] for(i < editArr[0].length)=F -> for(i < editArr.length)=F -> for(i <= str1.length)=T -> for(j <= str2.length)=T -> if(str1[i - 1] == str2[j - 1])=T -> exit loop -> exit loop -> i... | /* static context
[FOCAL] public static int EditDistance.computeMinEditDistance(String src, String dest, boolean shouldPrintMorphing)
[PATH1] for(i < editArr[0].length)=F -> for(i < editArr.length)=F -> for(i <= str1.length)=T -> for(j <= str2.length)=T -> if(str1[i - 1] == str2[j - 1])=T -> exit loop -> exit loop -> i... | true | ok | {"focal": {"class": "EditDistance", "name": "computeMinEditDistance", "signature": "int computeMinEditDistance(String src, String dest, boolean shouldPrintMorphing)", "start_line": 3, "modifiers": "public static", "params": [{"name": "src", "type": "String"}, {"name": "dest", "type": "String"}, {"name": "shouldPrintMor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.