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 |
|---|---|---|---|---|---|---|---|---|
17939962_0 | class FTDISerialDevice extends UsbSerialDevice {
static byte[] adaptArray(byte[] ftdiData)
{
int length = ftdiData.length;
if(length > 64)
{
int n = 1;
int p = 64;
// Precalculate length without FTDI headers
while(p < length)
{... | byte[] onlyHeaders = {1, 2};
byte[] adapted = FTDISerialDevice.adaptArray(onlyHeaders);
Assert.assertEquals("Should be empty", 0, adapted.length);
byte[] adaptAgain = FTDISerialDevice.adaptArray(onlyHeaders);
Assert.assertSame("Should be the same instance of empty array", adapted... | [FOCAL] static byte[] FTDISerialDevice.adaptArray(byte[] ftdiData)
[CLASS] class FTDISerialDevice extends UsbSerialDevice
[METRICS] loc=27 cc=4 branches=2 loops=1 returns=3 throws=0 nesting=2
[CALLS-INTERNAL] void copyData(byte[] src, byte[] dst)
[CALLS-EXTERNAL] Arrays.copyOfRange/3
[PATH1] if(length > 64)=T -> while(... | /* static context
[FOCAL] static byte[] FTDISerialDevice.adaptArray(byte[] ftdiData)
[PATH1] if(length > 64)=T -> while(p < length)=T -> exit loop -> return data
[PATH2] if(length > 64)=F -> if(length == 2)=T -> return EMPTY_BYTE_ARRAY
[PATH3] if(length > 64)=F -> if(length == 2)=F -> return Arrays.copyOfRange(ftdiData... | /* static context
[FOCAL] static byte[] FTDISerialDevice.adaptArray(byte[] ftdiData)
[PATH1] if(length > 64)=T -> while(p < length)=T -> exit loop -> return data
[PATH2] if(length > 64)=F -> if(length == 2)=T -> return EMPTY_BYTE_ARRAY
[PATH3] if(length > 64)=F -> if(length == 2)=F -> return Arrays.copyOfRange(ftdiData... | true | ok | {"focal": {"class": "FTDISerialDevice", "name": "adaptArray", "signature": "byte[] adaptArray(byte[] ftdiData)", "start_line": 3, "modifiers": "static", "params": [{"name": "ftdiData", "type": "byte[]"}], "return_type": "byte[]"}, "class_info": {"name": "FTDISerialDevice", "kind": "class", "modifiers": "", "superclass"... |
17959249_7 | class ConstraintParser {
public String parse() {
Map<String, ClassConstraints> classNameToValidationRulesMap = new HashMap<>();
for (Class clazz : classpathScanner.findClassesToParse()) {
if (clazz != null) {
ClassConstraints classValidationRules = new AnnotatedClass(clazz, options.getExcluded... | // given
parserConfiguredFor(Lists.newArrayList(TestModelWithEmailAnnotation.class.getPackage().getName()),
emptyStringList());
// when
String json = parser.parse();
// then
assertThat(json, containsString(TestModelWithEmailAnnotation.class.getSimpleName()));
assertThat(json, containsS... | [FOCAL] public String ConstraintParser.parse()
[CLASS] class ConstraintParser
[METRICS] loc=16 cc=4 branches=2 loops=1 returns=1 throws=0 nesting=3
[CALLS-INTERNAL] String toJson(Map<String, ClassConstraints> classNameToValidationRulesMap)
[CALLS-EXTERNAL] classpathScanner.findClassesToParse/0, new AnnotatedClass(clazz... | /* static context
[FOCAL] public String ConstraintParser.parse()
[PATH1] foreach(Class clazz : classpathScanner.findClassesToParse())=T -> if(clazz != null)=T -> if(classValidationRules.size() > 0)=T -> exit loop -> return toJson(classNameToValidationRulesMap)
[PATH2] foreach(Class clazz : classpathScanner.findClassesT... | /* static context
[FOCAL] public String ConstraintParser.parse()
[PATH1] foreach(Class clazz : classpathScanner.findClassesToParse())=T -> if(clazz != null)=T -> if(classValidationRules.size() > 0)=T -> exit loop -> return toJson(classNameToValidationRulesMap)
[PATH2] foreach(Class clazz : classpathScanner.findClassesT... | true | ok | {"focal": {"class": "ConstraintParser", "name": "parse", "signature": "String parse()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "ConstraintParser", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "LS", "type": "... |
17959600_0 | class NumerusRollingNumber {
public void increment(NumerusRollingNumberEvent type, Boolean doNotBlock) {
Bucket lastBucket = getCurrentBucket(doNotBlock);
if (lastBucket == null)
return;
lastBucket.getAdder(type).increment();
}
public NumerusRollingNumber(NumerusRollin... | MockedTime time = new MockedTime();
try {
NumerusRollingNumber counter = new NumerusRollingNumber(EventType.BOOTSTRAP, time, 200, 10);
// we start out with 0 buckets in the queue
assertEquals(0, counter.buckets.size());
// add 1
counter.incre... | [FOCAL] public void NumerusRollingNumber.increment(NumerusRollingNumberEvent type, Boolean doNotBlock)
[CLASS] class NumerusRollingNumber
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] Bucket getCurrentBucket(Boolean doNotBlock)
[CALLS-EXTERNAL] lastBucket.getAdder(type).increment... | /* static context
[FOCAL] public void NumerusRollingNumber.increment(NumerusRollingNumberEvent type, Boolean doNotBlock)
[PATH1] if(lastBucket == null)=T -> return
[PATH2] if(lastBucket == null)=F
[INPUTS] branches=doNotBlock | result=-
[CALLS-INTERNAL] Bucket getCurrentBucket(Boolean doNotBlock)
[CALLS-EXTERNAL] lastB... | /* static context
[FOCAL] public void NumerusRollingNumber.increment(NumerusRollingNumberEvent type, Boolean doNotBlock)
[PATH1] if(lastBucket == null)=T -> return
[PATH2] if(lastBucket == null)=F
[INPUTS] branches=doNotBlock | result=-
[CALLS-INTERNAL] Bucket getCurrentBucket(Boolean doNotBlock)
[CALLS-EXTERNAL] lastB... | true | ok | {"focal": {"class": "NumerusRollingNumber", "name": "increment", "signature": "void increment(NumerusRollingNumberEvent type, Boolean doNotBlock)", "start_line": 3, "modifiers": "public", "params": [{"name": "type", "type": "NumerusRollingNumberEvent"}, {"name": "doNotBlock", "type": "Boolean"}], "return_type": "void"}... |
17971137_149 | class LogicalPlanner extends BaseAlgebraVisitor<LogicalPlanner.PlanContext, LogicalNode> {
public LogicalPlan createPlan(Expr expr) throws PlanningException {
return createPlan(expr, false);
}
public LogicalPlanner(CatalogService catalog);
@VisibleForTesting public LogicalPlan createPlan(Expr expr, bool... | Expr expr = sqlAnalyzer.parse(ALIAS[0]);
LogicalNode plan = planner.createPlan(expr).getRootBlock().getRoot();
LogicalRootNode root = (LogicalRootNode) plan;
testJsonSerDerObject(root);
Schema finalSchema = root.getOutSchema();
Iterator<Column> it = finalSchema.getColumns().iterator();
Colu... | [FOCAL] public LogicalPlan LogicalPlanner.createPlan(Expr expr)
[CLASS] class LogicalPlanner extends BaseAlgebraVisitor<LogicalPlanner.PlanContext, LogicalNode>
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] LogicalPlan createPlan(Expr expr, boolean debug)
[EXCEPTIONS] declares Pl... | class LogicalPlanner extends BaseAlgebraVisitor<LogicalPlanner.PlanContext, LogicalNode> {
public LogicalPlan createPlan(Expr expr) throws PlanningException {
return createPlan(expr, false);
}
public LogicalPlanner(CatalogService catalog);
@VisibleForTesting public LogicalPlan createPlan(Expr expr, bool... | false | ok | {"focal": {"class": "LogicalPlanner", "name": "createPlan", "signature": "LogicalPlan createPlan(Expr expr) throws PlanningException", "start_line": 3, "modifiers": "public", "params": [{"name": "expr", "type": "Expr"}], "return_type": "LogicalPlan"}, "class_info": {"name": "LogicalPlanner", "kind": "class", "modifiers... | |
17971138_20 | class LazyTuple implements Tuple, Cloneable {
@Override
public boolean equals(Object obj) {
if (obj instanceof Tuple) {
Tuple other = (Tuple) obj;
return Arrays.equals(getValues(), other.getValues());
}
return false;
}
public LazyTuple(Schema schema, byte[][] textBytes, long offset);
... | int colNum = schema.size();
LazyTuple t1 = new LazyTuple(schema, new byte[colNum][], -1);
LazyTuple t2 = new LazyTuple(schema, new byte[colNum][], -1);
t1.put(0, DatumFactory.createInt4(1));
t1.put(1, DatumFactory.createInt4(2));
t1.put(3, DatumFactory.createInt4(2));
t2.put(0, DatumFactor... | [FOCAL] @Override public boolean LazyTuple.equals(Object obj)
[CLASS] class LazyTuple implements Tuple, Cloneable
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] Datum[] getValues()
[CALLS-EXTERNAL] Arrays.equals/2, Tuple.getValues/0
[PATH1] if(obj instanceof Tuple)=T -> return Arr... | /* static context
[FOCAL] @Override public boolean LazyTuple.equals(Object obj)
[PATH1] if(obj instanceof Tuple)=T -> return Arrays.equals(getValues(), other.getValues())
[PATH2] if(obj instanceof Tuple)=F -> return false
[INPUTS] branches=obj | result=obj
[CALLS-INTERNAL] Datum[] getValues()
[CALLS-EXTERNAL] Arrays.eq... | /* static context
[FOCAL] @Override public boolean LazyTuple.equals(Object obj)
[PATH1] if(obj instanceof Tuple)=T -> return Arrays.equals(getValues(), other.getValues())
[PATH2] if(obj instanceof Tuple)=F -> return false
[INPUTS] branches=obj | result=obj
[CALLS-INTERNAL] Datum[] getValues()
[CALLS-EXTERNAL] Arrays.eq... | true | ok | {"focal": {"class": "LazyTuple", "name": "equals", "signature": "boolean equals(Object obj)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "obj", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "LazyTuple", "kind": "class", "modifiers": "", "superclass": null, "interfaces"... |
17971683_0 | class HibernateBookDao implements BookDao {
@Override
public Book addBook(Book book) {
sessionFactory.getCurrentSession().persist(book);
return book;
}
public HibernateBookDao(SessionFactory sessionFactory);
@Override public void removeBook(Book book);
@SpringBean("bookDao")... | Book book = new Book("Hibernate in Action");
book.setTags(new LinkedHashSet<String>(asList("blog", "java")));
assertNotNull(dao.addBook(book).getId());
}
} | [FOCAL] @Override public Book HibernateBookDao.addBook(Book book)
[CLASS] class HibernateBookDao implements BookDao
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] sessionFactory.getCurrentSession().persist/1, sessionFactory.getCurrentSession/0
[INPUTS] branches=- | result=book
[CO... | /* static context
[FOCAL] @Override public Book HibernateBookDao.addBook(Book book)
[INPUTS] branches=- | result=book
[COLLABORATORS] field sessionFactory getCurrentSession/0
[CALLS-EXTERNAL] sessionFactory.getCurrentSession().persist/1, sessionFactory.getCurrentSession/0
*/
| /* static context
[FOCAL] @Override public Book HibernateBookDao.addBook(Book book)
[INPUTS] branches=- | result=book
[COLLABORATORS] field sessionFactory getCurrentSession/0
[CALLS-EXTERNAL] sessionFactory.getCurrentSession().persist/1, sessionFactory.getCurrentSession/0
*/
class HibernateBookDao implements BookDao {
... | true | ok | {"focal": {"class": "HibernateBookDao", "name": "addBook", "signature": "Book addBook(Book book)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "book", "type": "Book"}], "return_type": "Book"}, "class_info": {"name": "HibernateBookDao", "kind": "class", "modifiers": "", "superclass": null, "int... |
17987394_23 | class LocationSerializer implements JsonSerializer<JSON.Location> {
@Override public JsonElement serialize(JSON.Location src, Type typeOfSrc,
JsonSerializationContext context) {
JsonObject jsonObject = (JsonObject) new GsonBuilder().create().toJsonTree(src);
if (src.heading < 0 || src.heading >= 360) {... | location.heading = 361;
assertThat(locationSerializer.serialize(location, JSON.Location.class, null).toString())
.doesNotContain("\"heading\":361");
}
} | [FOCAL] @Override public JsonElement LocationSerializer.serialize(JSON.Location src, Type typeOfSrc, JsonSerializationContext context)
[CLASS] class LocationSerializer implements JsonSerializer<JSON.Location>
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] new GsonBuilder().create(... | /* static context
[FOCAL] @Override public JsonElement LocationSerializer.serialize(JSON.Location src, Type typeOfSrc, JsonSerializationContext context)
[PATH1] if(src.heading < 0 || src.heading >= 360)=T -> return jsonObject
[PATH2] if(src.heading < 0 || src.heading >= 360)=F -> return jsonObject
[INPUTS] branches=src... | /* static context
[FOCAL] @Override public JsonElement LocationSerializer.serialize(JSON.Location src, Type typeOfSrc, JsonSerializationContext context)
[PATH1] if(src.heading < 0 || src.heading >= 360)=T -> return jsonObject
[PATH2] if(src.heading < 0 || src.heading >= 360)=F -> return jsonObject
[INPUTS] branches=src... | true | ok | {"focal": {"class": "LocationSerializer", "name": "serialize", "signature": "JsonElement serialize(JSON.Location src, Type typeOfSrc, JsonSerializationContext context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "src", "type": "JSON.Location"}, {"name": "typeOfSrc", "type": "Type"}, {"name":... |
17988451_2 | class ElasticsearchItemWriter implements ItemWriter<IndexQuery>, InitializingBean {
@Override
public void write(List<? extends IndexQuery> items) throws Exception {
if(isActualTransactionActive()) {
addToBuffer(items);
}else {
writeItems(items);
}
}
public ElasticsearchItemWriter(ElasticsearchOperat... |
IndexQueryBuilder builder = new IndexQueryBuilder();
builder.withObject(dummyDocument);
List<IndexQuery> items = asList(builder.build());
writer.write(items);
verify(elasticsearchOperations).index(items.iterator().next());
}
} | [FOCAL] @Override public void ElasticsearchItemWriter.write(List<? extends IndexQuery> items)
[CLASS] class ElasticsearchItemWriter implements ItemWriter<IndexQuery>, InitializingBean
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] void addToBuffer(List<? extends IndexQuery> items)... | /* static context
[FOCAL] @Override public void ElasticsearchItemWriter.write(List<? extends IndexQuery> items)
[PATH1] if(isActualTransactionActive())=T
[PATH2] if(isActualTransactionActive())=F
[EXCEPTIONS] declares Exception
[CALLS-INTERNAL] void addToBuffer(List<? extends IndexQuery> items); void writeItems(List<? ... | /* static context
[FOCAL] @Override public void ElasticsearchItemWriter.write(List<? extends IndexQuery> items)
[PATH1] if(isActualTransactionActive())=T
[PATH2] if(isActualTransactionActive())=F
[EXCEPTIONS] declares Exception
[CALLS-INTERNAL] void addToBuffer(List<? extends IndexQuery> items); void writeItems(List<? ... | true | ok | {"focal": {"class": "ElasticsearchItemWriter", "name": "write", "signature": "void write(List<? extends IndexQuery> items) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "items", "type": "List<? extends IndexQuery>"}], "return_type": "void"}, "class_info": {"name": "Elasticsear... |
17994739_3 | class ManifestOptimizer {
public static void adjustMinMax(AdaptationSetType adaptationSetType, Function<RepresentationType, Long> get, ObjLongConsumer<AdaptationSetType> setMin, ObjLongConsumer<AdaptationSetType> setMax) {
List<RepresentationType> representations = adaptationSetType.getRepresentation();
... | MPDtype mpd = read(new File(ManifestOptimizerTest.class.getProtectionDomain().getCodeSource().getLocation().getFile() + "/com/castlabs/dash/dashfragmenter/representation/exampleManifest.mpd"));
ManifestOptimizer.adjustMinMax(mpd.getPeriod().get(0).getAdaptationSet().get(0), RepresentationType::getBandw... | [FOCAL] public static void ManifestOptimizer.adjustMinMax(AdaptationSetType adaptationSetType, Function<RepresentationType, Long> get, ObjLongConsumer<AdaptationSetType> setMin, ObjLongConsumer<AdaptationSetType> setMax)
[CLASS] class ManifestOptimizer
[METRICS] loc=15 cc=4 branches=2 loops=1 returns=0 throws=0 nesting... | /* static context
[FOCAL] public static void ManifestOptimizer.adjustMinMax(AdaptationSetType adaptationSetType, Function<RepresentationType, Long> get, ObjLongConsumer<AdaptationSetType> setMin, ObjLongConsumer<AdaptationSetType> setMax)
[PATH1] foreach(RepresentationType representationType : representations)=T -> if(... | /* static context
[FOCAL] public static void ManifestOptimizer.adjustMinMax(AdaptationSetType adaptationSetType, Function<RepresentationType, Long> get, ObjLongConsumer<AdaptationSetType> setMin, ObjLongConsumer<AdaptationSetType> setMax)
[PATH1] foreach(RepresentationType representationType : representations)=T -> if(... | true | ok | {"focal": {"class": "ManifestOptimizer", "name": "adjustMinMax", "signature": "void adjustMinMax(AdaptationSetType adaptationSetType, Function<RepresentationType, Long> get, ObjLongConsumer<AdaptationSetType> setMin, ObjLongConsumer<AdaptationSetType> setMax)", "start_line": 3, "modifiers": "public static", "params": [... |
18023059_2 | class Sha256Hasher extends Hasher {
@PostConstruct
public void init() {
rn = new SecureRandom();
}
@Override public String hash(String value);
@Override public boolean compareInternal(String plainText, String previousHash);
@Override public String getName();
private String hash256(... | SecureRandom random = new SecureRandom();
Sha256Hasher hasher = new Sha256Hasher();
hasher.init();
String password;
for (int i =0; i < 100; i++){
password = new BigInteger(130, random).toString(32);
Assert.assertTrue(hasher.compare(password, hasher.transfo... | [FOCAL] @PostConstruct public void Sha256Hasher.init()
[CLASS] class Sha256Hasher extends Hasher
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[NEW] SecureRandom
[CLASS-MEMBERS] String hash(String value); boolean compareInternal(String plainText, String previousHash); String getName(); String has... | /* static context
[FOCAL] @PostConstruct public void Sha256Hasher.init()
[NEW] SecureRandom
*/
| /* static context
[FOCAL] @PostConstruct public void Sha256Hasher.init()
[NEW] SecureRandom
*/
class Sha256Hasher extends Hasher {
@PostConstruct
public void init() {
rn = new SecureRandom();
}
@Override public String hash(String value);
@Override public boolean compareInternal(String plai... | true | ok | {"focal": {"class": "Sha256Hasher", "name": "init", "signature": "void init()", "start_line": 3, "modifiers": "@PostConstruct public", "params": [], "return_type": "void"}, "class_info": {"name": "Sha256Hasher", "kind": "class", "modifiers": "", "superclass": "Hasher", "interfaces": null, "fields": [], "members": [{"na... |
18035587_2 | class DefaultLandMatcher implements LandMatcher {
@Override
public boolean match(String className, String pattern) {
return matchExactlyFullQualifiedClassName(className, pattern) ||
matchFullQualifiedPackageNameAndItsSubPackage(className, pattern) ||
matchFullQualifiedPa... | assertTrue(matcher.match("foo.A", "foo.A"));
assertTrue(matcher.match("foo.A", "foo.*"));
assertTrue(matcher.match("foo.Air123", "foo.*"));
assertFalse(matcher.match("foo1.Air123", "foo.*"));
assertFalse(matcher.match("foo.p.A", "foo.*"));
assertTrue(matcher.match("foo.... | [FOCAL] @Override public boolean DefaultLandMatcher.match(String className, String pattern)
[CLASS] class DefaultLandMatcher implements LandMatcher
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] boolean matchExactlyFullQualifiedClassName(String className, String pattern); boolean ... | /* static context
[FOCAL] @Override public boolean DefaultLandMatcher.match(String className, String pattern)
[INPUTS] branches=- | result=className, pattern
[CALLS-INTERNAL] boolean matchExactlyFullQualifiedClassName(String className, String pattern); boolean matchFullQualifiedPackageName(String className, String patt... | /* static context
[FOCAL] @Override public boolean DefaultLandMatcher.match(String className, String pattern)
[INPUTS] branches=- | result=className, pattern
[CALLS-INTERNAL] boolean matchExactlyFullQualifiedClassName(String className, String pattern); boolean matchFullQualifiedPackageName(String className, String patt... | true | ok | {"focal": {"class": "DefaultLandMatcher", "name": "match", "signature": "boolean match(String className, String pattern)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "className", "type": "String"}, {"name": "pattern", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "Defa... |
18093759_63 | class OracleSpecifics {
static Connection createCustomDriverConnection(OracleDriverConnectionInfo connInfo,
ConnectorMessages cm) {
try {
return SQLUtil.getDriverMangerConnection(connInfo.getDriver(), connInfo.getUrl(),
connInfo.getUser(), connInfo.getPassword())... | String user = TEST_PROPS.getStringProperty("customDriver.user");
String password = TEST_PROPS.getStringProperty("customDriver.password");
String url = TEST_PROPS.getStringProperty("customDriver.url");
String driver = TEST_PROPS.getStringProperty("customDriver.driverClassName");
C... | [FOCAL] static Connection OracleSpecifics.createCustomDriverConnection(OracleDriverConnectionInfo connInfo, ConnectorMessages cm)
[CLASS] class OracleSpecifics
[METRICS] loc=10 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-INTERNAL] String getCauseMessage(Exception e); Throwable getCause(Exception e)
[CAL... | /* static context
[FOCAL] static Connection OracleSpecifics.createCustomDriverConnection(OracleDriverConnectionInfo connInfo, ConnectorMessages cm)
[THROWS-WHEN] ConnectorException when try-body throws
[PATH1] try-body throws -> throw new ConnectorException(cm.format(MSG_CUSTOM_CONNECTION_ERROR, null,...
[PATH2] return... | /* static context
[FOCAL] static Connection OracleSpecifics.createCustomDriverConnection(OracleDriverConnectionInfo connInfo, ConnectorMessages cm)
[THROWS-WHEN] ConnectorException when try-body throws
[PATH1] try-body throws -> throw new ConnectorException(cm.format(MSG_CUSTOM_CONNECTION_ERROR, null,...
[PATH2] return... | true | ok | {"focal": {"class": "OracleSpecifics", "name": "createCustomDriverConnection", "signature": "Connection createCustomDriverConnection(OracleDriverConnectionInfo connInfo, ConnectorMessages cm)", "start_line": 3, "modifiers": "static", "params": [{"name": "connInfo", "type": "OracleDriverConnectionInfo"}, {"name": "cm", ... |
18114836_20 | class X509CertificateUtil {
public static String getPropertyFromX500Principal(X509Certificate cert, String propertyName) {
String propertyValue = null;
String principalName = cert.getSubjectX500Principal().getName();
log.debug("Found principalName = {}", principalName);
Pattern pattern = createPattern(... | X509Certificate cert = mock(X509Certificate.class);
X500Principal principal = new X500Principal("OU=JavaSoft, O=Sun Microsystems, C=US");
when(cert.getSubjectX500Principal()).thenReturn(principal);
try {
X509CertificateUtil.getPropertyFromX500Principal(cert, "CN");
fail();
} catch (Exception e) {
... | [FOCAL] public static String X509CertificateUtil.getPropertyFromX500Principal(X509Certificate cert, String propertyName)
[CLASS] class X509CertificateUtil
[METRICS] loc=17 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] Pattern createPattern(String propertyName); void logAndThrowError(String error... | /* static context
[FOCAL] public static String X509CertificateUtil.getPropertyFromX500Principal(X509Certificate cert, String propertyName)
[PATH1] if(matcher.find())=T -> return propertyValue
[PATH2] if(matcher.find())=F -> return propertyValue
[INPUTS] branches=cert, propertyName | result=cert, propertyName
[COLLABORA... | /* static context
[FOCAL] public static String X509CertificateUtil.getPropertyFromX500Principal(X509Certificate cert, String propertyName)
[PATH1] if(matcher.find())=T -> return propertyValue
[PATH2] if(matcher.find())=F -> return propertyValue
[INPUTS] branches=cert, propertyName | result=cert, propertyName
[COLLABORA... | true | ok | {"focal": {"class": "X509CertificateUtil", "name": "getPropertyFromX500Principal", "signature": "String getPropertyFromX500Principal(X509Certificate cert, String propertyName)", "start_line": 3, "modifiers": "public static", "params": [{"name": "cert", "type": "X509Certificate"}, {"name": "propertyName", "type": "Strin... |
18133301_36 | class ModalApplication extends SimpleApplication implements Application {
public E getMode() {
return mode;
}
protected ModalApplication(
Class<E> modeClass,
E defaultMode,
String[] args);
Optional<E> determineMode(Class<E> modeClass, String[] args);
... | TestModes mode = new TestModalApplication(ARGS_MISSING).getMode();
assertThat(mode, equalTo(TestModes.PROD));
}
} | [FOCAL] public E ModalApplication.getMode()
[CLASS] class ModalApplication extends SimpleApplication implements Application
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] ModalApplication(Class<E> modeClass, E defaultMode, String[] args); Optional<E> determineMode(Class<E> modeClas... | /* static context
[FOCAL] public E ModalApplication.getMode()
*/
| /* static context
[FOCAL] public E ModalApplication.getMode()
*/
class ModalApplication extends SimpleApplication implements Application {
public E getMode() {
return mode;
}
protected ModalApplication(
Class<E> modeClass,
E defaultMode,
String[] args);
O... | true | ok | {"focal": {"class": "ModalApplication", "name": "getMode", "signature": "E getMode()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "E"}, "class_info": {"name": "ModalApplication", "kind": "class", "modifiers": "", "superclass": "SimpleApplication", "interfaces": "Application", "fields": [{"name... |
18143415_0 | class MutableString {
public void clear()
{
m_string = "";
}
public MutableString();
public MutableString(String s);
public MutableString(MutableString s);
public int indexOf(String s);
public int indexOf(String s, int fromIndex);
public void trim();
public int length();
public MutableString[] split(... | MutableString ms1 = new MutableString("abc");
ms1.clear();
assertEquals("", ms1.toString());
assertEquals(0, ms1.length());
}
} | [FOCAL] public void MutableString.clear()
[CLASS] class MutableString
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CLASS-MEMBERS] MutableString(); MutableString(String s); MutableString(MutableString s); int indexOf(String s); int indexOf(String s, int fromIndex); void trim(); int length(); Mut... | /* static context
[FOCAL] public void MutableString.clear()
*/
| /* static context
[FOCAL] public void MutableString.clear()
*/
class MutableString {
public void clear()
{
m_string = "";
}
public MutableString();
public MutableString(String s);
public MutableString(MutableString s);
public int indexOf(String s);
public int indexOf(String s, int fromIndex);
public vo... | true | ok | {"focal": {"class": "MutableString", "name": "clear", "signature": "void clear()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "MutableString", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "MutableSt... |
18150497_4 | class CertUtils {
public static String confirmationMethodHashS256(String certificateAsPem) {
if (org.apache.commons.lang.StringUtils.isBlank(certificateAsPem)) {
return "";
}
try {
certificateAsPem = org.apache.commons.lang.StringUtils.remove(certificateAsPem, "-----... | Assert.assertEquals("A4DtL2JmUMhAsvJj5tKyn64SqzmuXbMrJa0n761y5v0", CertUtils.confirmationMethodHashS256(TEST_PEM_1));
Assert.assertEquals("A4DtL2JmUMhAsvJj5tKyn64SqzmuXbMrJa0n761y5v0", CertUtils.confirmationMethodHashS256(TEST_PEM_2));
Assert.assertEquals("A4DtL2JmUMhAsvJj5tKyn64SqzmuXbMrJa0n761... | [FOCAL] public static String CertUtils.confirmationMethodHashS256(String certificateAsPem)
[CLASS] class CertUtils
[METRICS] loc=14 cc=3 branches=1 loops=0 returns=3 throws=0 nesting=1
[CALLS-EXTERNAL] org.apache.commons.lang.StringUtils.isBlank/1, org.apache.commons.lang.StringUtils.remove/2, StringUtils.replace/3, Ba... | /* static context
[FOCAL] public static String CertUtils.confirmationMethodHashS256(String certificateAsPem)
[PATH1] if(org.apache.commons.lang.StringUtils.isBlank(certificateAsPem))=F -> try-body throws -> return ""
[PATH2] if(org.apache.commons.lang.StringUtils.isBlank(certificateAsPem))=T -> return ""
[PATH3] if(org... | /* static context
[FOCAL] public static String CertUtils.confirmationMethodHashS256(String certificateAsPem)
[PATH1] if(org.apache.commons.lang.StringUtils.isBlank(certificateAsPem))=F -> try-body throws -> return ""
[PATH2] if(org.apache.commons.lang.StringUtils.isBlank(certificateAsPem))=T -> return ""
[PATH3] if(org... | true | ok | {"focal": {"class": "CertUtils", "name": "confirmationMethodHashS256", "signature": "String confirmationMethodHashS256(String certificateAsPem)", "start_line": 3, "modifiers": "public static", "params": [{"name": "certificateAsPem", "type": "String"}], "return_type": "String"}, "class_info": {"name": "CertUtils", "kind... |
18188420_0 | class ArchiveUtils {
public static void extractArchive (Path archivePath, Path extractToDirectory)
throws IOException, CompressorException, ArchiveException {
try (InputStream jdkInputStream = new BufferedInputStream(Files.newInputStream(archivePath))) {
String compressorType = null;
try {
compr... | String someFilename = "some-file.txt";
Path someFilePath = tempDir.resolve(someFilename);
Files.write(someFilePath, "Hello world\n".getBytes(StandardCharsets.UTF_8));
Path archiveZip = tempDir.resolve("archive.zip");
// Create an archive, add entry, update file, add same entry
try (OutputStream... | [FOCAL] public static void ArchiveUtils.extractArchive(Path archivePath, Path extractToDirectory)
[CLASS] class ArchiveUtils
[METRICS] loc=37 cc=7 branches=3 loops=0 returns=0 throws=0 nesting=3
[CALLS-INTERNAL] void extractGenericArchive(InputStream inputStream, Path extractToDirectory); void extractJarArchive(InputSt... | /* static context
[FOCAL] public static void ArchiveUtils.extractArchive(Path archivePath, Path extractToDirectory)
[PATH1] try-body throws -> if(compressorType != null)#1=T -> switch(ArchiveStreamFactory.detect(decompressedJdkInputStream))=case ArchiveStreamFactory.ZIP -> if(compressorType != null)#2=T
[PATH2] if(comp... | /* static context
[FOCAL] public static void ArchiveUtils.extractArchive(Path archivePath, Path extractToDirectory)
[PATH1] try-body throws -> if(compressorType != null)#1=T -> switch(ArchiveStreamFactory.detect(decompressedJdkInputStream))=case ArchiveStreamFactory.ZIP -> if(compressorType != null)#2=T
[PATH2] if(comp... | true | ok | {"focal": {"class": "ArchiveUtils", "name": "extractArchive", "signature": "void extractArchive(Path archivePath, Path extractToDirectory) throws IOException, CompressorException, ArchiveException", "start_line": 3, "modifiers": "public static", "params": [{"name": "archivePath", "type": "Path"}, {"name": "extractToDir... |
18202815_119 | class StringConverter implements TypeConverter<String> {
public String convert(Integer target) {
return target.toString();
}
public StringConverter();
public String convert(Long target);
public String convert(BigInteger target);
public String convert(Float target);
public String ... |
assertThat(new StringConverter().convert(Integer.valueOf(10)), is("10"));
}
} | [FOCAL] public String StringConverter.convert(Integer target)
[CLASS] class StringConverter implements TypeConverter<String>
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Integer.toString/0
[INPUTS] branches=- | result=target
[DATAFLOW] target@param->L2
[CLASS-MEMBERS] StringConv... | /* static context
[FOCAL] public String StringConverter.convert(Integer target)
[INPUTS] branches=- | result=target
[CALLS-EXTERNAL] Integer.toString/0
*/
| /* static context
[FOCAL] public String StringConverter.convert(Integer target)
[INPUTS] branches=- | result=target
[CALLS-EXTERNAL] Integer.toString/0
*/
class StringConverter implements TypeConverter<String> {
public String convert(Integer target) {
return target.toString();
}
public StringConv... | true | ok | {"focal": {"class": "StringConverter", "name": "convert", "signature": "String convert(Integer target)", "start_line": 3, "modifiers": "public", "params": [{"name": "target", "type": "Integer"}], "return_type": "String"}, "class_info": {"name": "StringConverter", "kind": "class", "modifiers": "", "superclass": null, "i... |
18208577_2 | class EasyObjectCursor extends AbstractCursor implements EasyCursor {
@Override
public int getColumnIndex(final String columnName) {
final String column = applyAlias(columnName);
return mFieldAccessor.getFieldIndexByName(column);
}
public EasyObjectCursor(final Class<T> clazz, final L... | final EasyCursor cursor = TestObjectCursorBuilder.getCursor("int");
final int intIndex = cursor.getColumnIndex("int");
final int idIndex = cursor.getColumnIndex("_id");
assertEquals(intIndex, idIndex);
}
} | [FOCAL] @Override public int EasyObjectCursor.getColumnIndex(String columnName)
[CLASS] class EasyObjectCursor extends AbstractCursor implements EasyCursor
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String applyAlias(String columnName)
[CALLS-EXTERNAL] mFieldAccessor.getFieldI... | /* static context
[FOCAL] @Override public int EasyObjectCursor.getColumnIndex(String columnName)
[INPUTS] branches=- | result=columnName
[COLLABORATORS] field mFieldAccessor getFieldIndexByName/1
[CALLS-INTERNAL] String applyAlias(String columnName)
[CALLS-EXTERNAL] mFieldAccessor.getFieldIndexByName/1
*/
| /* static context
[FOCAL] @Override public int EasyObjectCursor.getColumnIndex(String columnName)
[INPUTS] branches=- | result=columnName
[COLLABORATORS] field mFieldAccessor getFieldIndexByName/1
[CALLS-INTERNAL] String applyAlias(String columnName)
[CALLS-EXTERNAL] mFieldAccessor.getFieldIndexByName/1
*/
class EasyOb... | true | ok | {"focal": {"class": "EasyObjectCursor", "name": "getColumnIndex", "signature": "int getColumnIndex(String columnName)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "columnName", "type": "String"}], "return_type": "int"}, "class_info": {"name": "EasyObjectCursor", "kind": "class", "modifiers": ... |
18227906_9 | class FontPackage {
public static boolean validFontPackFolder(String path) {
final File folder = new File(path);
if (!folder.exists() || !folder.isDirectory()) return false;
final String[] fileList = folder.list();
if (fileList == null) return false;
final Set<String> fileNameSet = new HashSet<>(... | File invalidFontPackFolder = getFileResource(INVALID_FONT_FOLDER_NAME);
assertFalse(FontPackage.validFontPackFolder(invalidFontPackFolder.getPath()));
}
} | [FOCAL] public static boolean FontPackage.validFontPackFolder(String path)
[CLASS] class FontPackage
[METRICS] loc=8 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[CALLS-EXTERNAL] File.exists/0, File.isDirectory/0, File.list/0, Arrays.asList/1, Set<String>.containsAll/1
[NEW] File, HashSet<>
[PATH1] if(!folder.e... | /* static context
[FOCAL] public static boolean FontPackage.validFontPackFolder(String path)
[PATH1] if(!folder.exists() || !folder.isDirectory())=F -> if(fileList == null)=T -> return false
[PATH2] if(!folder.exists() || !folder.isDirectory())=F -> if(fileList == null)=F -> return fileNameSet.containsAll(Style.REMOTE_... | /* static context
[FOCAL] public static boolean FontPackage.validFontPackFolder(String path)
[PATH1] if(!folder.exists() || !folder.isDirectory())=F -> if(fileList == null)=T -> return false
[PATH2] if(!folder.exists() || !folder.isDirectory())=F -> if(fileList == null)=F -> return fileNameSet.containsAll(Style.REMOTE_... | true | ok | {"focal": {"class": "FontPackage", "name": "validFontPackFolder", "signature": "boolean validFontPackFolder(String path)", "start_line": 3, "modifiers": "public static", "params": [{"name": "path", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "FontPackage", "kind": "class", "modifiers": "", "su... |
18249859_0 | class PasswordHash {
public static String createHash(String password) {
Args.notBlank(password, "password");
return createHash(StringUtil.toUtf8Bytes(password));
}
private PasswordHash();
public static String createHash(byte[] password);
public static String createHash(byte[] password, int saltSiz... | Set<String> passwordHashes = new HashSet<>(20);
for (int i = 0; i < 10; i++) {
String passwordHash = PasswordHash.createHash("p\r\nassw0Rd!");
Assert.assertFalse("PasswordHash duplication occurs",
passwordHashes.contains(passwordHash));
passwordHashes.add(passwordHash);
}
}
} | [FOCAL] public static String PasswordHash.createHash(String password)
[CLASS] class PasswordHash
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String createHash(byte[] password)
[CALLS-EXTERNAL] Args.notBlank/2, StringUtil.toUtf8Bytes/1
[INPUTS] branches=- | result=password
[DATA... | /* static context
[FOCAL] public static String PasswordHash.createHash(String password)
[INPUTS] branches=- | result=password
[CALLS-INTERNAL] String createHash(byte[] password)
[CALLS-EXTERNAL] Args.notBlank/2, StringUtil.toUtf8Bytes/1
*/
| /* static context
[FOCAL] public static String PasswordHash.createHash(String password)
[INPUTS] branches=- | result=password
[CALLS-INTERNAL] String createHash(byte[] password)
[CALLS-EXTERNAL] Args.notBlank/2, StringUtil.toUtf8Bytes/1
*/
class PasswordHash {
public static String createHash(String password) {
A... | true | ok | {"focal": {"class": "PasswordHash", "name": "createHash", "signature": "String createHash(String password)", "start_line": 3, "modifiers": "public static", "params": [{"name": "password", "type": "String"}], "return_type": "String"}, "class_info": {"name": "PasswordHash", "kind": "class", "modifiers": "", "superclass":... |
18259368_4 | class Chaining {
public static <T> Chain<T> chain(final List<T> list) {
return new Chaining.Chain<T>(list);
}
public static E first(final Iterable<E> iterable);
public static List<T> map(final List<E> list, final Function<? super E, T> func);
public static List<E> sortBy(final List<E> iter... | final List<Map<String, Object>> stooges = new ArrayList<Map<String, Object>>() { {
add(new LinkedHashMap<String, Object>() { { put("name", "curly"); put("age", 25); } });
add(new LinkedHashMap<String, Object>() { { put("name", "moe"); put("age", 21); } });
add(new LinkedHashM... | [FOCAL] public static Chain<T> Chaining.chain(List<T> list)
[CLASS] class Chaining
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] Chaining.Chain<T>
[INPUTS] branches=- | result=list
[DATAFLOW] list@param->L2
[CLASS-MEMBERS] E first(Iterable<E> iterable); List<T> map(List<E> list, Function<? ... | /* static context
[FOCAL] public static Chain<T> Chaining.chain(List<T> list)
[INPUTS] branches=- | result=list
[NEW] Chaining.Chain<T>
*/
| /* static context
[FOCAL] public static Chain<T> Chaining.chain(List<T> list)
[INPUTS] branches=- | result=list
[NEW] Chaining.Chain<T>
*/
class Chaining {
public static <T> Chain<T> chain(final List<T> list) {
return new Chaining.Chain<T>(list);
}
public static E first(final Iterable<E> iterable)... | true | ok | {"focal": {"class": "Chaining", "name": "chain", "signature": "Chain<T> chain(List<T> list)", "start_line": 3, "modifiers": "public static", "params": [{"name": "list", "type": "List<T>"}], "return_type": "Chain<T>"}, "class_info": {"name": "Chaining", "kind": "class", "modifiers": "", "superclass": null, "interfaces":... |
18259510_3 | class RestrictSerializationToBaseClassFactory implements TypeAdapterFactory {
@Override
public <T> TypeAdapter<T> create(final Gson gson, final TypeToken<T> type) {
Class incoming = type.getRawType();
if (subClasses != null) {
boolean matched = false;
for (Class<? extends B> subClass : subClass... | Gson gson = new GsonBuilder()
.registerTypeAdapterFactory(new RestrictSerializationToBaseClassFactory<Base>(Base.class, Sub1.class))
.create();
String json = gson.toJson(new Container());
assertTrue(json.contains("\"a\":1"));
assertFalse(json.contains("\"b\""));
assertTrue(json.contains(... | [FOCAL] @Override public TypeAdapter<T> RestrictSerializationToBaseClassFactory.create(Gson gson, TypeToken<T> type)
[CLASS] class RestrictSerializationToBaseClassFactory implements TypeAdapterFactory
[METRICS] loc=32 cc=6 branches=4 loops=1 returns=3 throws=0 nesting=3
[CALLS-EXTERNAL] TypeToken<T>.getRawType/0, baseC... | /* static context
[FOCAL] @Override public TypeAdapter<T> RestrictSerializationToBaseClassFactory.create(Gson gson, TypeToken<T> type)
[PATH1] if(subClasses != null)=T -> foreach(Class<? extends B> subClass : subClasses)=T -> if(incoming == subClass)=F -> exit loop -> if(!matched)=T -> return null
[PATH2] if(subClasses... | /* static context
[FOCAL] @Override public TypeAdapter<T> RestrictSerializationToBaseClassFactory.create(Gson gson, TypeToken<T> type)
[PATH1] if(subClasses != null)=T -> foreach(Class<? extends B> subClass : subClasses)=T -> if(incoming == subClass)=F -> exit loop -> if(!matched)=T -> return null
[PATH2] if(subClasses... | true | ok | {"focal": {"class": "RestrictSerializationToBaseClassFactory", "name": "create", "signature": "TypeAdapter<T> create(Gson gson, TypeToken<T> type)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "gson", "type": "Gson"}, {"name": "type", "type": "TypeToken<T>"}], "return_type": "TypeAdapter<T>"},... |
18269132_9 | class Utils {
@NonNull
public static String appendPath(@NonNull String first,
@NonNull String second) {
String result = first + SEP + second;
while (result.contains("//")) {
result = result.replaceAll("//", "/");
}
if (result.len... | assertEquals("A/B", Utils.appendPath("A", "/B"));
assertEquals("/A/B", Utils.appendPath("/A", "/B"));
assertEquals("/A/B/C/D", Utils.appendPath("/A/B", "/C/D"));
assertEquals("/A/B/C/D", Utils.appendPath("/A/B", "/C/D/"));
}
} | [FOCAL] @NonNull public static String Utils.appendPath(String first, String second)
[CLASS] class Utils
[METRICS] loc=15 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] String.contains/1, String.replaceAll/2, String.length/0, String.endsWith/1, String.substring/2
[PATH1] while(result.contains("//"... | /* static context
[FOCAL] @NonNull public static String Utils.appendPath(String first, String second)
[PATH1] while(result.contains("//"))=T -> exit loop -> if(result.length() > 1 && result.endsWith(SEP))=T -> return result.substring(0, result.length() - 1)
[PATH2] while(result.contains("//"))=F -> if(result.length() >... | /* static context
[FOCAL] @NonNull public static String Utils.appendPath(String first, String second)
[PATH1] while(result.contains("//"))=T -> exit loop -> if(result.length() > 1 && result.endsWith(SEP))=T -> return result.substring(0, result.length() - 1)
[PATH2] while(result.contains("//"))=F -> if(result.length() >... | true | ok | {"focal": {"class": "Utils", "name": "appendPath", "signature": "String appendPath(String first, String second)", "start_line": 3, "modifiers": "@NonNull public static", "params": [{"name": "first", "type": "String"}, {"name": "second", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Utils", "kind... |
18288221_2 | class JMeterSensor implements Sensor {
protected GlobalSummary getGlobalSummary(Project project) {
GlobalSummary globalSummary = null;
String localJtlPath = getLocalJtlFilePath(project);
String projectName = project.getName();
try {
if (!StringUtils.isBlank(localJtlPath)) {
// ... |
// Start jmeter report server.
// Testing plugin targeting remote jmeter report server,
// then we need a running server.
JMeterReportServer server = new JMeterReportServer();
server.start();
try {
Thread.sleep(SERVER_START_TIME);
} catch (InterruptedException e) {
// Server must ... | [FOCAL] protected GlobalSummary JMeterSensor.getGlobalSummary(Project project)
[CLASS] class JMeterSensor implements Sensor
[METRICS] loc=37 cc=4 branches=1 loops=0 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] JMeterReportClient getReportClient(Project project); String getLocalJtlFilePath(Project project); String getT... | /* static context
[FOCAL] protected GlobalSummary JMeterSensor.getGlobalSummary(Project project)
[PATH1] try-body throws -> return globalSummary
[PATH2] if(!StringUtils.isBlank(localJtlPath))=T -> return globalSummary
[PATH3] if(!StringUtils.isBlank(localJtlPath))=F -> return globalSummary
[INPUTS] branches=project | r... | /* static context
[FOCAL] protected GlobalSummary JMeterSensor.getGlobalSummary(Project project)
[PATH1] try-body throws -> return globalSummary
[PATH2] if(!StringUtils.isBlank(localJtlPath))=T -> return globalSummary
[PATH3] if(!StringUtils.isBlank(localJtlPath))=F -> return globalSummary
[INPUTS] branches=project | r... | true | ok | {"focal": {"class": "JMeterSensor", "name": "getGlobalSummary", "signature": "GlobalSummary getGlobalSummary(Project project)", "start_line": 3, "modifiers": "protected", "params": [{"name": "project", "type": "Project"}], "return_type": "GlobalSummary"}, "class_info": {"name": "JMeterSensor", "kind": "class", "modifie... |
18298933_24 | class AlumnosUseCaseImpl implements AlumnosUseCase {
@Override
public Single<List<Alumno>> getListaAlumnos() {
// return Single.<List<Alumno>>error(new Throwable("No se pudo acceder"));
return Single.just(Arrays.asList(
new Alumno("Baldomero", "Su casa", "http://lorempixel.com/10... | // when.
TestObserver<List<Alumno>> observer = mAlumnosUseCase.getListaAlumnos().test();
// then.
observer.awaitTerminalEvent();
observer.assertNoErrors();
observer.assertValueCount(1);
assertEquals(observer.values().get(0).get(0).getNombre(), "Baldomero");
}
... | [FOCAL] @Override public Single<List<Alumno>> AlumnosUseCaseImpl.getListaAlumnos()
[CLASS] class AlumnosUseCaseImpl implements AlumnosUseCase
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Single.just(Arrays.asList( new Alumno("Baldomero", "Su ca....delay/2, Single.just/1, Arrays.... | /* static context
[FOCAL] @Override public Single<List<Alumno>> AlumnosUseCaseImpl.getListaAlumnos()
[NEW] Alumno
[CALLS-EXTERNAL] Single.just(Arrays.asList( new Alumno("Baldomero", "Su ca....delay/2, Single.just/1, Arrays.asList/3
*/
| /* static context
[FOCAL] @Override public Single<List<Alumno>> AlumnosUseCaseImpl.getListaAlumnos()
[NEW] Alumno
[CALLS-EXTERNAL] Single.just(Arrays.asList( new Alumno("Baldomero", "Su ca....delay/2, Single.just/1, Arrays.asList/3
*/
class AlumnosUseCaseImpl implements AlumnosUseCase {
@Override
public Single... | true | ok | {"focal": {"class": "AlumnosUseCaseImpl", "name": "getListaAlumnos", "signature": "Single<List<Alumno>> getListaAlumnos()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Single<List<Alumno>>"}, "class_info": {"name": "AlumnosUseCaseImpl", "kind": "class", "modifiers": "", "superclass":... |
18338023_11 | class GsonMapper {
public static <T> BodyReader<T> json(Class<T> type) {
return INSTANCE.reader(type);
}
public GsonMapper(Gson gson);
public static BodyWriter json(Object value);
public BodyReader<T> reader(Class<T> type);
public BodyWriter writer(Object value);
}
class GsonMapper... | String json = "{\"name\":\"world\"}";
Hello hello = json(Hello.class).readFrom(new ByteArrayInputStream(json.getBytes()));
assertThat(hello.getName(), equalTo("world"));
}
} | [FOCAL] public static BodyReader<T> GsonMapper.json(Class<T> type)
[CLASS] class GsonMapper
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] INSTANCE.reader/1
[INPUTS] branches=- | result=type
[DATAFLOW] type@param->L2
[CLASS-MEMBERS] GsonMapper(Gson gson); BodyWriter json(Object va... | /* static context
[FOCAL] public static BodyReader<T> GsonMapper.json(Class<T> type)
[INPUTS] branches=- | result=type
[CALLS-EXTERNAL] INSTANCE.reader/1
*/
| /* static context
[FOCAL] public static BodyReader<T> GsonMapper.json(Class<T> type)
[INPUTS] branches=- | result=type
[CALLS-EXTERNAL] INSTANCE.reader/1
*/
class GsonMapper {
public static <T> BodyReader<T> json(Class<T> type) {
return INSTANCE.reader(type);
}
public GsonMapper(Gson gson);
... | true | ok | {"focal": {"class": "GsonMapper", "name": "json", "signature": "BodyReader<T> json(Class<T> type)", "start_line": 3, "modifiers": "public static", "params": [{"name": "type", "type": "Class<T>"}], "return_type": "BodyReader<T>"}, "class_info": {"name": "GsonMapper", "kind": "class", "modifiers": "", "superclass": null,... |
18345774_2 | class RequestInterceptor implements Interceptor {
@Override public Response intercept(Chain chain) throws IOException {
if (requestHandler != null) {
return modifyRequest(chain);
}
return chain.proceed(chain.request());
}
private Response modifyRequest(Chain chain);
private void addHeaders(... | assertThat(requestInterceptor.intercept(new TestChain())).isInstanceOf(Response.class);
}
} | [FOCAL] @Override public Response RequestInterceptor.intercept(Chain chain)
[CLASS] class RequestInterceptor implements Interceptor
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] Response modifyRequest(Chain chain)
[CALLS-EXTERNAL] Chain.proceed/1, Chain.request/0
[EXCEPTIONS] dec... | /* static context
[FOCAL] @Override public Response RequestInterceptor.intercept(Chain chain)
[PATH1] if(requestHandler != null)=T -> return modifyRequest(chain)
[PATH2] if(requestHandler != null)=F -> return chain.proceed(chain.request())
[INPUTS] branches=- | result=chain
[COLLABORATORS] param chain:Chain proceed/1,r... | /* static context
[FOCAL] @Override public Response RequestInterceptor.intercept(Chain chain)
[PATH1] if(requestHandler != null)=T -> return modifyRequest(chain)
[PATH2] if(requestHandler != null)=F -> return chain.proceed(chain.request())
[INPUTS] branches=- | result=chain
[COLLABORATORS] param chain:Chain proceed/1,r... | 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... |
18347965_3 | class JerseyJaxRsEntity implements JaxRsEntity {
@Override
public <T extends Annotation> Optional<T> getAnnotation(Class<T> annotationType) {
Class castClass = Cast.toClass(input);
return (Optional<T>) Optional.fromNullable(castClass.getAnnotation(annotationType));
}
public JerseyJaxRsEntity(Type i... |
JerseyJaxRsEntity entity = new JerseyJaxRsEntity(Foo.class, null);
Optional<Ignore> annotations = entity.getAnnotation(Ignore.class);
assertTrue(annotations.isPresent());
}
} | [FOCAL] @Override public Optional<T> JerseyJaxRsEntity.getAnnotation(Class<T> annotationType)
[CLASS] class JerseyJaxRsEntity implements JaxRsEntity
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Cast.toClass/1, Optional.fromNullable/1, Class.getAnnotation/1
[INPUTS] branches=- | ... | /* static context
[FOCAL] @Override public Optional<T> JerseyJaxRsEntity.getAnnotation(Class<T> annotationType)
[INPUTS] branches=- | result=annotationType
[CALLS-EXTERNAL] Cast.toClass/1, Optional.fromNullable/1, Class.getAnnotation/1
*/
| /* static context
[FOCAL] @Override public Optional<T> JerseyJaxRsEntity.getAnnotation(Class<T> annotationType)
[INPUTS] branches=- | result=annotationType
[CALLS-EXTERNAL] Cast.toClass/1, Optional.fromNullable/1, Class.getAnnotation/1
*/
class JerseyJaxRsEntity implements JaxRsEntity {
@Override
public <T extends... | true | ok | {"focal": {"class": "JerseyJaxRsEntity", "name": "getAnnotation", "signature": "Optional<T> getAnnotation(Class<T> annotationType)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "annotationType", "type": "Class<T>"}], "return_type": "Optional<T>"}, "class_info": {"name": "JerseyJaxRsEntity", "k... |
18355892_3 | class MainPresenter {
public void onFinished(List<String> items) {
if (mainView != null) {
mainView.setItems(items);
mainView.hideProgress();
}
}
MainPresenter(MainView mainView, FindItemsInteractor findItemsInteractor);
void onResume();
void onItemClic... | List<String> items = Arrays.asList("Model", "View", "Controller");
presenter.onFinished(items);
verify(view, times(1)).setItems(items);
verify(view, times(1)).hideProgress();
}
} | [FOCAL] public void MainPresenter.onFinished(List<String> items)
[CLASS] class MainPresenter
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] mainView.setItems/1, mainView.hideProgress/0
[PATH1] if(mainView != null)=T
[PATH2] if(mainView != null)=F
[COLLABORATORS] field mainView set... | /* static context
[FOCAL] public void MainPresenter.onFinished(List<String> items)
[PATH1] if(mainView != null)=T
[PATH2] if(mainView != null)=F
[COLLABORATORS] field mainView setItems/1,hideProgress/0
[CALLS-EXTERNAL] mainView.setItems/1, mainView.hideProgress/0
*/
| /* static context
[FOCAL] public void MainPresenter.onFinished(List<String> items)
[PATH1] if(mainView != null)=T
[PATH2] if(mainView != null)=F
[COLLABORATORS] field mainView setItems/1,hideProgress/0
[CALLS-EXTERNAL] mainView.setItems/1, mainView.hideProgress/0
*/
class MainPresenter {
public void onFinished(Lis... | true | ok | {"focal": {"class": "MainPresenter", "name": "onFinished", "signature": "void onFinished(List<String> items)", "start_line": 3, "modifiers": "public", "params": [{"name": "items", "type": "List<String>"}], "return_type": "void"}, "class_info": {"name": "MainPresenter", "kind": "class", "modifiers": "", "superclass": nu... |
18358222_9 | class MessageService {
public List<Message> getMessagesMatchingFilter(MessageFilter filter) {
Date calcFromDate = Optional.ofNullable(filter.getFromDate()).orElse(startOfDay());
Date calcToDate = Optional.ofNullable(filter.getFromDate()).orElse(endOfDay());
Integer calcPage = Optional.ofNul... | MessageFilter filter = new MessageFilter();
when(messageRepository.findByDateBetweenAndDirectionIn(
notNull(),
notNull(),
directionsCaptor.capture(),
pageableCaptor.capture())
).thenReturn(singleResult());
assertHasSingleR... | [FOCAL] public List<Message> MessageService.getMessagesMatchingFilter(MessageFilter filter)
[CLASS] class MessageService
[METRICS] loc=33 cc=4 branches=3 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] Date endOfDay(); Date startOfDay()
[CALLS-EXTERNAL] Optional.ofNullable(filter.getFromDate()).orElse/1, Optional... | /* static context
[FOCAL] public List<Message> MessageService.getMessagesMatchingFilter(MessageFilter filter)
[PATH1] if(includeInbound)=T -> if(includeOutbound)=T -> if(StringUtils.isNotEmpty(filter.getContainingText()))=T -> return messageRepository.findByDateBetweenAndDirectionInAndPayloadContaini...
[PATH2] if(incl... | /* static context
[FOCAL] public List<Message> MessageService.getMessagesMatchingFilter(MessageFilter filter)
[PATH1] if(includeInbound)=T -> if(includeOutbound)=T -> if(StringUtils.isNotEmpty(filter.getContainingText()))=T -> return messageRepository.findByDateBetweenAndDirectionInAndPayloadContaini...
[PATH2] if(incl... | true | ok | {"focal": {"class": "MessageService", "name": "getMessagesMatchingFilter", "signature": "List<Message> getMessagesMatchingFilter(MessageFilter filter)", "start_line": 3, "modifiers": "public", "params": [{"name": "filter", "type": "MessageFilter"}], "return_type": "List<Message>"}, "class_info": {"name": "MessageServic... |
18369808_1 | class BRITWalletId {
public byte[] getBytes() {
return Arrays.copyOf(britWalletId, britWalletId.length);
}
public BRITWalletId(byte[] seed);
public BRITWalletId(String britWalletIdInHex);
@Override public String toString();
@Override public boolean equals(Object o);
@Override public int hashCode... | SeedPhraseGenerator seedGenerator = new Bip39SeedPhraseGenerator();
byte[] seed = seedGenerator.convertToSeed(Bip39SeedPhraseGenerator.split(SEED_PHRASE_2));
BRITWalletId walletId = new BRITWalletId(seed);
assertThat(walletId).isNotNull();
assertThat(walletId.getBytes()).isNotNull();
String wa... | [FOCAL] public byte[] BRITWalletId.getBytes()
[CLASS] class BRITWalletId
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Arrays.copyOf/2
[CLASS-MEMBERS] BRITWalletId(byte[] seed); BRITWalletId(String britWalletIdInHex); String toString(); boolean equals(Object o); int hashCode()
[T... | /* static context
[FOCAL] public byte[] BRITWalletId.getBytes()
[CALLS-EXTERNAL] Arrays.copyOf/2
*/
| /* static context
[FOCAL] public byte[] BRITWalletId.getBytes()
[CALLS-EXTERNAL] Arrays.copyOf/2
*/
class BRITWalletId {
public byte[] getBytes() {
return Arrays.copyOf(britWalletId, britWalletId.length);
}
public BRITWalletId(byte[] seed);
public BRITWalletId(String britWalletIdInHex);
@Override pu... | true | ok | {"focal": {"class": "BRITWalletId", "name": "getBytes", "signature": "byte[] getBytes()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "byte[]"}, "class_info": {"name": "BRITWalletId", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "SEED_PHRASE_1", ... |
18369848_20 | class LayerDistributor implements Serializable {
public List<List<Double>> distribute(final List<SectionData> sectionDataList) {
final List<LayerData> layerList = groupSectionsByZ(sectionDataList);
Collections.sort(layerList); // sort layers by tile count
bucketList = bucketLayers(layerLi... |
final int numberOfBuckets = 3;
final List<Long> tileCounts = LongStream.of(10, 10, 30, 28, 7, 9).boxed().collect(Collectors.toList());
// should be distributed as: | 30 | 28, 7 | 10, 10, 9 |
final List<SectionData> sectionDataList = new ArrayList<>();
double z = 1.0;
f... | [FOCAL] public List<List<Double>> LayerDistributor.distribute(List<SectionData> sectionDataList)
[CLASS] class LayerDistributor implements Serializable
[METRICS] loc=12 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] List<Bucket> bucketLayers(List<LayerData> sortedLayerList); List<LayerData> group... | /* static context
[FOCAL] public List<List<Double>> LayerDistributor.distribute(List<SectionData> sectionDataList)
[COLLABORATORS] field bucketList stream/0
[CALLS-INTERNAL] List<Bucket> bucketLayers(List<LayerData> sortedLayerList); List<LayerData> groupSectionsByZ(List<SectionData> sectionDataList)
[NEW] ArrayList<>
... | /* static context
[FOCAL] public List<List<Double>> LayerDistributor.distribute(List<SectionData> sectionDataList)
[COLLABORATORS] field bucketList stream/0
[CALLS-INTERNAL] List<Bucket> bucketLayers(List<LayerData> sortedLayerList); List<LayerData> groupSectionsByZ(List<SectionData> sectionDataList)
[NEW] ArrayList<>
... | true | ok | {"focal": {"class": "LayerDistributor", "name": "distribute", "signature": "List<List<Double>> distribute(List<SectionData> sectionDataList)", "start_line": 3, "modifiers": "public", "params": [{"name": "sectionDataList", "type": "List<SectionData>"}], "return_type": "List<List<Double>>"}, "class_info": {"name": "Layer... |
18379456_33 | class DnssecClient extends ReliableDnsClient {
public DnssecQueryResult queryDnssec(CharSequence name, TYPE type) throws IOException {
Question q = new Question(name, type, CLASS.IN);
return queryDnssec(q);
}
public DnssecClient();
public DnssecClient(DnsCache cache);
@Override ... | DnssecClient client = constructDnssecClient();
applyZones(client,
signedRootZone(
sign(rootKSK, "", rootPrivateKSK, algorithm,
record("", rootKSK),
record("", rootZSK)),
sign(r... | [FOCAL] public DnssecQueryResult DnssecClient.queryDnssec(CharSequence name, TYPE type)
[CLASS] class DnssecClient extends ReliableDnsClient
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] DnssecQueryResult queryDnssec(Question q)
[NEW] Question
[EXCEPTIONS] declares IOException
[I... | /* static context
[FOCAL] public DnssecQueryResult DnssecClient.queryDnssec(CharSequence name, TYPE type)
[INPUTS] branches=- | result=name, type
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] DnssecQueryResult queryDnssec(Question q)
[NEW] Question
*/
| /* static context
[FOCAL] public DnssecQueryResult DnssecClient.queryDnssec(CharSequence name, TYPE type)
[INPUTS] branches=- | result=name, type
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] DnssecQueryResult queryDnssec(Question q)
[NEW] Question
*/
class DnssecClient extends ReliableDnsClient {
public Dnss... | true | ok | {"focal": {"class": "DnssecClient", "name": "queryDnssec", "signature": "DnssecQueryResult queryDnssec(CharSequence name, TYPE type) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "name", "type": "CharSequence"}, {"name": "type", "type": "TYPE"}], "return_type": "DnssecQueryResult"}, "... |
18394987_39 | class AbstractTemplateOutputBuilder extends AbstractOutputBuilder {
protected JtwigModel createModel(AbstractTestDataEntity abstractTestDataEntity) {
JtwigModel model = JtwigModel.newModel()
.with(TEST_DATA_ENTITY.getName(), abstractTestDataEntity)
.with(SAKULI_PROPERTIES.ge... | JtwigModel model = testling.createModel(testSuite);
assertEquals(model.get(TEST_DATA_ENTITY.getName()).get().getValue(), testSuite);
assertEquals(model.get(SAKULI_PROPERTIES.getName()).get().getValue(), sakuliProperties);
assertEquals(model.get(CHECK_MK_PROPERTIES.getName()).get().getVal... | [FOCAL] protected JtwigModel AbstractTemplateOutputBuilder.createModel(AbstractTestDataEntity abstractTestDataEntity)
[CLASS] class AbstractTemplateOutputBuilder extends AbstractOutputBuilder
[METRICS] loc=11 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] Map<TemplateModelEntityName, Object> getS... | /* static context
[FOCAL] protected JtwigModel AbstractTemplateOutputBuilder.createModel(AbstractTestDataEntity abstractTestDataEntity)
[PATH1] if(getSpecificModelEntities() != null)=T -> return model
[PATH2] if(getSpecificModelEntities() != null)=F -> return model
[INPUTS] branches=- | result=abstractTestDataEntity, s... | /* static context
[FOCAL] protected JtwigModel AbstractTemplateOutputBuilder.createModel(AbstractTestDataEntity abstractTestDataEntity)
[PATH1] if(getSpecificModelEntities() != null)=T -> return model
[PATH2] if(getSpecificModelEntities() != null)=F -> return model
[INPUTS] branches=- | result=abstractTestDataEntity, s... | true | ok | {"focal": {"class": "AbstractTemplateOutputBuilder", "name": "createModel", "signature": "JtwigModel createModel(AbstractTestDataEntity abstractTestDataEntity)", "start_line": 3, "modifiers": "protected", "params": [{"name": "abstractTestDataEntity", "type": "AbstractTestDataEntity"}], "return_type": "JtwigModel"}, "cl... |
18409234_18 | class Timestamps {
public static String format(long timestampMillis) {
return FORMATTER.format(LocalTime.ofNanoOfDay(timestampMillis % (24 * 60 * 60 * 1000) * 1_000_000));
}
private Timestamps();
}
class TimestampsTest {
@Test
public void testFirstMidnight() {
| long timestampMillis = 0L;
assertEquals("00:00:00.000", Timestamps.format(timestampMillis));
}
} | [FOCAL] public static String Timestamps.format(long timestampMillis)
[CLASS] class Timestamps
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] FORMATTER.format/1, LocalTime.ofNanoOfDay/1
[INPUTS] branches=- | result=timestampMillis
[DATAFLOW] timestampMillis@param->L2
[CLASS-MEMBERS... | /* static context
[FOCAL] public static String Timestamps.format(long timestampMillis)
[INPUTS] branches=- | result=timestampMillis
[CALLS-EXTERNAL] FORMATTER.format/1, LocalTime.ofNanoOfDay/1
*/
| /* static context
[FOCAL] public static String Timestamps.format(long timestampMillis)
[INPUTS] branches=- | result=timestampMillis
[CALLS-EXTERNAL] FORMATTER.format/1, LocalTime.ofNanoOfDay/1
*/
class Timestamps {
public static String format(long timestampMillis) {
return FORMATTER.format(LocalTime.ofNano... | true | ok | {"focal": {"class": "Timestamps", "name": "format", "signature": "String format(long timestampMillis)", "start_line": 3, "modifiers": "public static", "params": [{"name": "timestampMillis", "type": "long"}], "return_type": "String"}, "class_info": {"name": "Timestamps", "kind": "class", "modifiers": "", "superclass": n... |
18419894_75 | class ScriptParserImpl implements ScriptParser {
public <T extends AstRegion> T parseWithStrategy(String input, ScriptParseStrategy<T> strategy)
throws ScriptParseException {
T result = null;
int newStart = 0;
int newEnd = input.length();
CharStream ais = CharStreams.f... |
String script =
"# tcp.client.accept-then-close\n" +
"accept 'tcp://localhost:7788'\n" +
"accepted\n" +
"connected\n" +
"close\n" +
"closed\n";
ScriptParserImpl parser = new ScriptParserImpl();
AstS... | [FOCAL] public T ScriptParserImpl.parseWithStrategy(String input, ScriptParseStrategy<T> strategy)
[CLASS] class ScriptParserImpl implements ScriptParser
[METRICS] loc=42 cc=6 branches=2 loops=0 returns=1 throws=3 nesting=2
[CALLS-INTERNAL] ScriptParseException createScriptParseException(RobotParser parser, Recognition... | /* static context
[FOCAL] public T ScriptParserImpl.parseWithStrategy(String input, ScriptParseStrategy<T> strategy)
[THROWS-WHEN] createScriptParseException(parser, re) when try-body throws && cause instanceof RecognitionException
[THROWS-WHEN] pce when try-body throws && !(cause instanceof RecognitionException)
[THRO... | /* static context
[FOCAL] public T ScriptParserImpl.parseWithStrategy(String input, ScriptParseStrategy<T> strategy)
[THROWS-WHEN] createScriptParseException(parser, re) when try-body throws && cause instanceof RecognitionException
[THROWS-WHEN] pce when try-body throws && !(cause instanceof RecognitionException)
[THRO... | true | ok | {"focal": {"class": "ScriptParserImpl", "name": "parseWithStrategy", "signature": "T parseWithStrategy(String input, ScriptParseStrategy<T> strategy) throws ScriptParseException", "start_line": 3, "modifiers": "public", "params": [{"name": "input", "type": "String"}, {"name": "strategy", "type": "ScriptParseStrategy<T>... |
18433849_10 | class GameActivity extends RoboFragmentActivity implements LoaderManager.LoaderCallbacks<Cursor> {
public void chooseBox(View view){
String boxIdString = getResources().getResourceEntryName(view.getId());
int boxId = Integer.parseInt(boxIdString.substring(boxIdString.length() - 1));
ToeStr... | when(toeGame.getTurn()).thenReturn(GameSymbol.O);
Button button = Mockito.mock(Button.class);
when(button.getId()).thenReturn(R.id.box_8);
activity.chooseBox(button);
ToeStrategy expectedStrategy = new ToeStrategyExplicit(8, GameSymbol.O);
verify(toeGame).chooseBox(any(... | [FOCAL] public void GameActivity.chooseBox(View view)
[CLASS] class GameActivity extends RoboFragmentActivity implements LoaderManager.LoaderCallbacks<Cursor>
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] getResources().getResourceEntryName/1, getResources/0 (inherited), View.get... | /* static context
[FOCAL] public void GameActivity.chooseBox(View view)
[COLLABORATORS] param view:View getId/0; field toeGame:ToeGame getTurn/0,chooseBox/2
[FIELDS] read=toeGame:ToeGame
[NEW] ToeStrategyExplicit
[CALLS-EXTERNAL] getResources().getResourceEntryName/1, getResources/0 (inherited), View.getId/0, Integer.p... | /* static context
[FOCAL] public void GameActivity.chooseBox(View view)
[COLLABORATORS] param view:View getId/0; field toeGame:ToeGame getTurn/0,chooseBox/2
[FIELDS] read=toeGame:ToeGame
[NEW] ToeStrategyExplicit
[CALLS-EXTERNAL] getResources().getResourceEntryName/1, getResources/0 (inherited), View.getId/0, Integer.p... | true | ok | {"focal": {"class": "GameActivity", "name": "chooseBox", "signature": "void chooseBox(View view)", "start_line": 3, "modifiers": "public", "params": [{"name": "view", "type": "View"}], "return_type": "void"}, "class_info": {"name": "GameActivity", "kind": "class", "modifiers": "", "superclass": "RoboFragmentActivity", ... |
18451768_22 | class FusedLocationProviderApiImpl extends ApiImpl implements FusedLocationProviderApi, EventCallbacks, ServiceConnection {
public boolean isConnecting() {
return serviceConnectionManager.isConnecting();
}
public FusedLocationProviderApiImpl(FusedLocationServiceConnectionManager connectionManager,
Fu... | api.isConnecting();
verify(connectionManager).isConnecting();
}
} | [FOCAL] public boolean FusedLocationProviderApiImpl.isConnecting()
[CLASS] class FusedLocationProviderApiImpl extends ApiImpl implements FusedLocationProviderApi, EventCallbacks, ServiceConnection
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] serviceConnectionManager.isConnecting... | /* static context
[FOCAL] public boolean FusedLocationProviderApiImpl.isConnecting()
[COLLABORATORS] field serviceConnectionManager isConnecting/0
[CALLS-EXTERNAL] serviceConnectionManager.isConnecting/0
*/
| /* static context
[FOCAL] public boolean FusedLocationProviderApiImpl.isConnecting()
[COLLABORATORS] field serviceConnectionManager isConnecting/0
[CALLS-EXTERNAL] serviceConnectionManager.isConnecting/0
*/
class FusedLocationProviderApiImpl extends ApiImpl implements FusedLocationProviderApi, EventCallbacks, ServiceCo... | true | ok | {"focal": {"class": "FusedLocationProviderApiImpl", "name": "isConnecting", "signature": "boolean isConnecting()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "FusedLocationProviderApiImpl", "kind": "class", "modifiers": "", "superclass": "ApiImpl", "interface... |
18473213_0 | class XeroClient {
protected static <T> T unmarshallResponse(String responseBody, Class<T> clazz) {
try {
JAXBContext context = JAXBContext.newInstance(clazz);
Unmarshaller unmarshaller = context.createUnmarshaller();
Source source = new StreamSource(new ByteArrayInputStream(responseBody.getByt... | String xml = getResourceAsString("create-invoice-response.xml");
ResponseType response = XeroClient.unmarshallResponse(xml, ResponseType.class);
Assert.assertNotNull(response);
}
} | [FOCAL] protected static T XeroClient.unmarshallResponse(String responseBody, Class<T> clazz)
[CLASS] class XeroClient
[METRICS] loc=10 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] JAXBContext.newInstance/1, JAXBContext.createUnmarshaller/0, String.getBytes/0, unmarshaller.unmarshal(source, cla... | /* static context
[FOCAL] protected static T XeroClient.unmarshallResponse(String responseBody, Class<T> clazz)
[THROWS-WHEN] IllegalStateException when try-body throws
[PATH1] try-body throws -> throw new IllegalStateException("Error unmarshalling response: " + respon...
[PATH2] return unmarshaller.unmarshal(source, c... | /* static context
[FOCAL] protected static T XeroClient.unmarshallResponse(String responseBody, Class<T> clazz)
[THROWS-WHEN] IllegalStateException when try-body throws
[PATH1] try-body throws -> throw new IllegalStateException("Error unmarshalling response: " + respon...
[PATH2] return unmarshaller.unmarshal(source, c... | true | ok | {"focal": {"class": "XeroClient", "name": "unmarshallResponse", "signature": "T unmarshallResponse(String responseBody, Class<T> clazz)", "start_line": 3, "modifiers": "protected static", "params": [{"name": "responseBody", "type": "String"}, {"name": "clazz", "type": "Class<T>"}], "return_type": "T"}, "class_info": {"... |
18495485_110 | class PublisherEuropeanaDao {
public List<SourceDocumentReferenceMetaInfo> retrieveMetaInfo(final Collection<String> sourceDocumentReferenceIds) {
if (null == sourceDocumentReferenceIds || sourceDocumentReferenceIds.isEmpty()) {
return Collections.EMPTY_LIST;
}
LOG.debug(Logging... | assertTrue(europeanaDao.retrieveMetaInfo(Collections.EMPTY_LIST).isEmpty());
}
} | [FOCAL] public List<SourceDocumentReferenceMetaInfo> PublisherEuropeanaDao.retrieveMetaInfo(Collection<String> sourceDocumentReferenceIds)
[CLASS] class PublisherEuropeanaDao
[METRICS] loc=19 cc=4 branches=2 loops=0 returns=3 throws=0 nesting=2
[CALLS-EXTERNAL] Collection<String>.isEmpty/0, LOG.debug/2, LoggingComponen... | /* static context
[FOCAL] public List<SourceDocumentReferenceMetaInfo> PublisherEuropeanaDao.retrieveMetaInfo(Collection<String> sourceDocumentReferenceIds)
[PATH1] if(null == sourceDocumentReferenceIds || sourceDocumentReferenceIds.isEmpty())#1=F -> if(null == sourceDocumentReferenceIds || sourceDocumentReferenceIds.i... | /* static context
[FOCAL] public List<SourceDocumentReferenceMetaInfo> PublisherEuropeanaDao.retrieveMetaInfo(Collection<String> sourceDocumentReferenceIds)
[PATH1] if(null == sourceDocumentReferenceIds || sourceDocumentReferenceIds.isEmpty())#1=F -> if(null == sourceDocumentReferenceIds || sourceDocumentReferenceIds.i... | true | ok | {"focal": {"class": "PublisherEuropeanaDao", "name": "retrieveMetaInfo", "signature": "List<SourceDocumentReferenceMetaInfo> retrieveMetaInfo(Collection<String> sourceDocumentReferenceIds)", "start_line": 3, "modifiers": "public", "params": [{"name": "sourceDocumentReferenceIds", "type": "Collection<String>"}], "return... |
18499671_0 | class RawXJC2Mojo extends AbstractXJC2Mojo<O> {
void collectBindingUrisFromArtifact(File file, List<URI> bindingUris) throws MojoExecutionException {
try (JarFile jarFile = new JarFile(file))
{
final Enumeration<JarEntry> jarFileEntries = jarFile.entries();
while (jarFileEntries.hasMoreElements()) {
Jar... | List<URI> bindings = new ArrayList<>();
final RawXJC2Mojo<Void> mojo = new RawXJC2Mojo<Void>() {
@Override
protected OptionsFactory<Void> getOptionsFactory() {
throw new UnsupportedOperationException();
}
@Override
public void doExecute(Void options) throws MojoExecut... | [FOCAL] void RawXJC2Mojo.collectBindingUrisFromArtifact(File file, List<URI> bindingUris)
[CLASS] class RawXJC2Mojo extends AbstractXJC2Mojo<O>
[METRICS] loc=20 cc=5 branches=1 loops=1 returns=0 throws=2 nesting=4
[CALLS-EXTERNAL] JarFile.entries/0, Enumeration<JarEntry>.hasMoreElements/0, Enumeration<JarEntry>.nextEle... | /* static context
[FOCAL] void RawXJC2Mojo.collectBindingUrisFromArtifact(File file, List<URI> bindingUris)
[THROWS-WHEN] MojoExecutionException when try-body throws
[THROWS-WHEN] MojoExecutionException when jarFileEntries.hasMoreElements() && entry.getName().endsWith(".xjb") && try-body throws && throw new MojoExecuti... | /* static context
[FOCAL] void RawXJC2Mojo.collectBindingUrisFromArtifact(File file, List<URI> bindingUris)
[THROWS-WHEN] MojoExecutionException when try-body throws
[THROWS-WHEN] MojoExecutionException when jarFileEntries.hasMoreElements() && entry.getName().endsWith(".xjb") && try-body throws && throw new MojoExecuti... | true | ok | {"focal": {"class": "RawXJC2Mojo", "name": "collectBindingUrisFromArtifact", "signature": "void collectBindingUrisFromArtifact(File file, List<URI> bindingUris) throws MojoExecutionException", "start_line": 3, "modifiers": "", "params": [{"name": "file", "type": "File"}, {"name": "bindingUris", "type": "List<URI>"}], "... |
18500436_4 | class YtsClient {
public UserModule user() {
if (userModule == null) {
throw new IllegalStateException("User module not loaded. Call YtsClient.Builder.withUser() ");
}
return userModule;
}
private YtsClient();
public BookmarkModule bookmarks();
public CommentM... | client = new YtsClient
.Builder()
.withUser()
.build();
assertNotNull(client);
assertNotNull(client.user());
assertBookmarksModuleException(client);
assertCommentModuleException(client);
assertMoviesModuleException(client);... | [FOCAL] public UserModule YtsClient.user()
[CLASS] class YtsClient
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[NEW] IllegalStateException
[EXCEPTIONS] throws IllegalStateException
[THROWS-WHEN] IllegalStateException when userModule == null
[PATH1] if(userModule == null)=T -> throw new IllegalS... | /* static context
[FOCAL] public UserModule YtsClient.user()
[THROWS-WHEN] IllegalStateException when userModule == null
[PATH1] if(userModule == null)=T -> throw new IllegalStateException("User module not loaded. Call YtsClient.B...
[PATH2] if(userModule == null)=F -> return userModule
[EXCEPTIONS] throws IllegalState... | /* static context
[FOCAL] public UserModule YtsClient.user()
[THROWS-WHEN] IllegalStateException when userModule == null
[PATH1] if(userModule == null)=T -> throw new IllegalStateException("User module not loaded. Call YtsClient.B...
[PATH2] if(userModule == null)=F -> return userModule
[EXCEPTIONS] throws IllegalState... | true | ok | {"focal": {"class": "YtsClient", "name": "user", "signature": "UserModule user()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "UserModule"}, "class_info": {"name": "YtsClient", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "client", "type": "YtsC... |
18506893_7 | class JavaToJavaccDependencyAction implements Action<Project> {
@Override
public void execute(Project project) {
if (!project.getPlugins().hasPlugin("java")) {
return;
}
configureCompileJJTreeTask(project);
configureCompileJavaccTask(project);
}
private voi... | project = Mockito.mock(Project.class, Answers.RETURNS_MOCKS.get());
JavaToJavaccDependencyAction action = new JavaToJavaccDependencyAction();
action.execute(project);
Mockito.verify(project).getPlugins();
Mockito.verifyNoMoreInteractions(project);
}
} | [FOCAL] @Override public void JavaToJavaccDependencyAction.execute(Project project)
[CLASS] class JavaToJavaccDependencyAction implements Action<Project>
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] void configureCompileJJTreeTask(Project project); void configureCompileJavaccTas... | /* static context
[FOCAL] @Override public void JavaToJavaccDependencyAction.execute(Project project)
[PATH1] if(!project.getPlugins().hasPlugin("java"))=T -> return
[PATH2] if(!project.getPlugins().hasPlugin("java"))=F
[INPUTS] branches=project | result=-
[COLLABORATORS] param project:Project getPlugins/0
[CALLS-INTER... | /* static context
[FOCAL] @Override public void JavaToJavaccDependencyAction.execute(Project project)
[PATH1] if(!project.getPlugins().hasPlugin("java"))=T -> return
[PATH2] if(!project.getPlugins().hasPlugin("java"))=F
[INPUTS] branches=project | result=-
[COLLABORATORS] param project:Project getPlugins/0
[CALLS-INTER... | true | ok | {"focal": {"class": "JavaToJavaccDependencyAction", "name": "execute", "signature": "void execute(Project project)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "project", "type": "Project"}], "return_type": "void"}, "class_info": {"name": "JavaToJavaccDependencyAction", "kind": "class", "modi... |
18511687_47 | class SystemProperty {
public String getPlugin() {
return plugin;
}
private SystemProperty(final Builder<T> builder);
private static Stream<Object> getObjectStream(final String value, final SystemProperty systemProperty);
public static Collection<SystemProperty> getProperties();
@Sup... |
final SystemProperty<Long> longProperty = SystemProperty.Builder.ofType(Long.class)
.setKey("a-plugin-property")
.setDefaultValue(42L)
.setPlugin("TestPluginName")
.setDynamic(false)
.build();
assertThat(longProperty.getPlugin(), is("TestPlug... | [FOCAL] public String SystemProperty.getPlugin()
[CLASS] class SystemProperty
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] SystemProperty(Builder<T> builder); Stream<Object> getObjectStream(String value, SystemProperty systemProperty); Collection<SystemProperty> getProperties(); ... | /* static context
[FOCAL] public String SystemProperty.getPlugin()
*/
| /* static context
[FOCAL] public String SystemProperty.getPlugin()
*/
class SystemProperty {
public String getPlugin() {
return plugin;
}
private SystemProperty(final Builder<T> builder);
private static Stream<Object> getObjectStream(final String value, final SystemProperty systemProperty);
... | true | ok | {"focal": {"class": "SystemProperty", "name": "getPlugin", "signature": "String getPlugin()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "SystemProperty", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "xmppServer... |
18512985_3 | class WordSequence implements Comparable<WordSequence> {
public static WordSequence asWordSequence(final Dictionary dictionary,
String... words) {
Word[] dictWords = new Word[words.length];
for (int i = 0; i < words.length; i++) {
dictWords[i] = dictionary.getWord(words[i]);... | assertThat(asWordSequence(dictionary, "one"),
lessThan(asWordSequence(dictionary, "two")));
assertThat(asWordSequence(dictionary, "one"),
lessThan(asWordSequence(dictionary, "one", "two")));
assertThat(asWordSequence(dictionary, "one", "two"),
less... | [FOCAL] public static WordSequence WordSequence.asWordSequence(Dictionary dictionary, String... words)
[CLASS] class WordSequence implements Comparable<WordSequence>
[METRICS] loc=8 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] Dictionary.getWord/1
[NEW] WordSequence
[PATH1] for(i < words.length... | /* static context
[FOCAL] public static WordSequence WordSequence.asWordSequence(Dictionary dictionary, String... words)
[PATH1] for(i < words.length)=T -> exit loop -> return new WordSequence(dictWords)
[PATH2] for(i < words.length)=F -> return new WordSequence(dictWords)
[INPUTS] branches=words | result=words
[COLLAB... | /* static context
[FOCAL] public static WordSequence WordSequence.asWordSequence(Dictionary dictionary, String... words)
[PATH1] for(i < words.length)=T -> exit loop -> return new WordSequence(dictWords)
[PATH2] for(i < words.length)=F -> return new WordSequence(dictWords)
[INPUTS] branches=words | result=words
[COLLAB... | true | ok | {"focal": {"class": "WordSequence", "name": "asWordSequence", "signature": "WordSequence asWordSequence(Dictionary dictionary, String... words)", "start_line": 3, "modifiers": "public static", "params": [{"name": "dictionary", "type": "Dictionary"}, {"name": "words", "type": "String..."}], "return_type": "WordSequence"... |
18516668_30 | class AbstractConnectionSpecFactory implements ConnectionSpecFactory {
protected ConnectionSpec newConnectionSpecInstance(final Class<?> connectionSpecClass,
final Class<?>[] constructorParameterTypes,
fin... | TestConnectionSpecImpl spec = (TestConnectionSpecImpl)
factory.newConnectionSpecInstance(
TestConnectionSpecImpl.class,
new Class<?>[]{int.class, String.class},
new Object[]{4711, "property2"});
assertThat(spec.prop... | [FOCAL] protected ConnectionSpec AbstractConnectionSpecFactory.newConnectionSpecInstance(Class<?> connectionSpecClass, Class<?>[] constructorParameterTypes, Object[] constructorArguments)
[CLASS] class AbstractConnectionSpecFactory implements ConnectionSpecFactory
[METRICS] loc=29 cc=7 branches=1 loops=0 returns=2 thro... | /* static context
[FOCAL] protected ConnectionSpec AbstractConnectionSpecFactory.newConnectionSpecInstance(Class<?> connectionSpecClass, Class<?>[] constructorParameterTypes, Object[] constructorArguments)
[THROWS-WHEN] InternalHiberSapException when try-body throws && !ConnectionSpec.class.isAssignableFrom(connSpecImp... | /* static context
[FOCAL] protected ConnectionSpec AbstractConnectionSpecFactory.newConnectionSpecInstance(Class<?> connectionSpecClass, Class<?>[] constructorParameterTypes, Object[] constructorArguments)
[THROWS-WHEN] InternalHiberSapException when try-body throws && !ConnectionSpec.class.isAssignableFrom(connSpecImp... | true | ok | {"focal": {"class": "AbstractConnectionSpecFactory", "name": "newConnectionSpecInstance", "signature": "ConnectionSpec newConnectionSpecInstance(Class<?> connectionSpecClass, Class<?>[] constructorParameterTypes, Object[] constructorArguments)", "start_line": 3, "modifiers": "protected", "params": [{"name": "connection... |
18532549_1 | class SoupBinTCPSession implements Closeable {
public int receive() throws IOException {
int bytes = channel.read(rxBuffer);
if (bytes <= 0)
return bytes;
rxBuffer.flip();
while (parse());
rxBuffer.compact();
receivedData();
return bytes;
... | loginRejected.rejectReasonCode = SoupBinTCP.LOGIN_REJECT_CODE_NOT_AUTHORIZED;
server.reject(loginRejected);
while (clientStatus.collect().size() != 1)
client.receive();
assertEquals(asList(new LoginRejected(SoupBinTCP.LOGIN_REJECT_CODE_NOT_AUTHORIZED)),
cli... | [FOCAL] public int SoupBinTCPSession.receive()
[CLASS] class SoupBinTCPSession implements Closeable
[METRICS] loc=16 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] boolean parse(); void receivedData()
[CALLS-EXTERNAL] channel.read/1, rxBuffer.flip/0, rxBuffer.compact/0
[EXCEPTIONS] declares IOExc... | /* static context
[FOCAL] public int SoupBinTCPSession.receive()
[PATH1] if(bytes <= 0)=F -> while(parse())=T -> exit loop -> return bytes
[PATH2] if(bytes <= 0)=T -> return bytes
[PATH3] if(bytes <= 0)=F -> while(parse())=F -> return bytes
[COLLABORATORS] field channel read/1; field rxBuffer flip/0,compact/0
[EXCEPTIO... | /* static context
[FOCAL] public int SoupBinTCPSession.receive()
[PATH1] if(bytes <= 0)=F -> while(parse())=T -> exit loop -> return bytes
[PATH2] if(bytes <= 0)=T -> return bytes
[PATH3] if(bytes <= 0)=F -> while(parse())=F -> return bytes
[COLLABORATORS] field channel read/1; field rxBuffer flip/0,compact/0
[EXCEPTIO... | true | ok | {"focal": {"class": "SoupBinTCPSession", "name": "receive", "signature": "int receive() throws IOException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "SoupBinTCPSession", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Closeable", "fields":... |
18559877_1 | class CaptchaNoJsHtmlParser {
public void parseChallengeTitle(
String responseHtml,
CaptchaInfo captchaInfo
) throws CaptchaNoJsV2ParsingError {
Matcher matcher = challengeTitlePattern.matcher(responseHtml);
if (!matcher.find()) {
throw new CaptchaNoJsV2Parsi... | for (int i = 0; i < inputDataList.size(); ++i) {
String inputData = inputDataList.get(i);
CaptchaInfo captchaInfo = new CaptchaInfo();
parser.parseChallengeTitle(inputData, captchaInfo);
String title = captchaInfo.captchaTitle.getTitle();
assertEquals... | [FOCAL] public void CaptchaNoJsHtmlParser.parseChallengeTitle(String responseHtml, CaptchaInfo captchaInfo)
[CLASS] class CaptchaNoJsHtmlParser
[METRICS] loc=41 cc=5 branches=3 loops=0 returns=0 throws=3 nesting=2
[CALLS-EXTERNAL] challengeTitlePattern.matcher/1, Matcher.find/0, Matcher.group/1, challengeTitleBoldPartP... | /* static context
[FOCAL] public void CaptchaNoJsHtmlParser.parseChallengeTitle(String responseHtml, CaptchaInfo captchaInfo)
[THROWS-WHEN] CaptchaNoJsV2ParsingError when !matcher.find()
[THROWS-WHEN] CaptchaNoJsV2ParsingError when matcher.find() && try-body throws
[THROWS-WHEN] CaptchaNoJsV2ParsingError when matcher.f... | /* static context
[FOCAL] public void CaptchaNoJsHtmlParser.parseChallengeTitle(String responseHtml, CaptchaInfo captchaInfo)
[THROWS-WHEN] CaptchaNoJsV2ParsingError when !matcher.find()
[THROWS-WHEN] CaptchaNoJsV2ParsingError when matcher.find() && try-body throws
[THROWS-WHEN] CaptchaNoJsV2ParsingError when matcher.f... | true | ok | {"focal": {"class": "CaptchaNoJsHtmlParser", "name": "parseChallengeTitle", "signature": "void parseChallengeTitle(String responseHtml, CaptchaInfo captchaInfo) throws CaptchaNoJsV2ParsingError", "start_line": 3, "modifiers": "public", "params": [{"name": "responseHtml", "type": "String"}, {"name": "captchaInfo", "type... |
18560435_15 | class ModifiedVariable implements Variable, Cloneable {
@Override
public String getSyntaxString() {
log.trace("syntax string of variable {} will be retrieved", variable);
return variable.getSyntaxString();
}
public ModifiedVariable(final Variable variable, final List<VariableModifier>... | assertEquals(modifiedVariable.getSyntaxString(), variable.getSyntaxString());
}
} | [FOCAL] @Override public String ModifiedVariable.getSyntaxString()
[CLASS] class ModifiedVariable implements Variable, Cloneable
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] log.trace/2, Variable.getSyntaxString/0
[FIELDS] read=variable:Variable
[INPUTS] branches=- | result=vari... | /* static context
[FOCAL] @Override public String ModifiedVariable.getSyntaxString()
[INPUTS] branches=- | result=variable
[COLLABORATORS] field variable:Variable getSyntaxString/0
[FIELDS] read=variable:Variable
[CALLS-EXTERNAL] log.trace/2, Variable.getSyntaxString/0
*/
| /* static context
[FOCAL] @Override public String ModifiedVariable.getSyntaxString()
[INPUTS] branches=- | result=variable
[COLLABORATORS] field variable:Variable getSyntaxString/0
[FIELDS] read=variable:Variable
[CALLS-EXTERNAL] log.trace/2, Variable.getSyntaxString/0
*/
class ModifiedVariable implements Variable, Clo... | true | ok | {"focal": {"class": "ModifiedVariable", "name": "getSyntaxString", "signature": "String getSyntaxString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "ModifiedVariable", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Variable, ... |
18610267_4 | class EventService {
public EventHandlerStatus dispatchEvent(HttpServletRequest httpRequest) {
ApiContext apiContext = new MozuApiContext(httpRequest);
Event event = null;
// get the event from the request and validate
try {
String body = IOUtils.toString(httpRequest.ge... | final String jsonString = deletedEventJson();
new Expectations() {
{ mockHttpServletRequest.getHeader(Headers.X_VOL_TENANT_DOMAIN); result=TENANT_URL; }
{ mockHttpServletRequest.getHeader(Headers.X_VOL_SITE_DOMAIN); result=SITE_URL; }
{ mockHttpServletRequest.getIntH... | [FOCAL] public EventHandlerStatus EventService.dispatchEvent(HttpServletRequest httpRequest)
[CLASS] class EventService
[METRICS] loc=30 cc=4 branches=1 loops=0 returns=4 throws=0 nesting=2
[CALLS-INTERNAL] void invokeHandler(Event event, ApiContext apiContext)
[CALLS-EXTERNAL] IOUtils.toString/1, HttpServletRequest.ge... | /* static context
[FOCAL] public EventHandlerStatus EventService.dispatchEvent(HttpServletRequest httpRequest)
[PATH1] if(!Crypto.isRequestValid(apiContext, body))=F -> try-body throws -> return ( new EventHandlerStatus(msg.toString(), HttpServletResponse.SC_INT...
[PATH2] if(!Crypto.isRequestValid(apiContext, body))=T... | /* static context
[FOCAL] public EventHandlerStatus EventService.dispatchEvent(HttpServletRequest httpRequest)
[PATH1] if(!Crypto.isRequestValid(apiContext, body))=F -> try-body throws -> return ( new EventHandlerStatus(msg.toString(), HttpServletResponse.SC_INT...
[PATH2] if(!Crypto.isRequestValid(apiContext, body))=T... | true | ok | {"focal": {"class": "EventService", "name": "dispatchEvent", "signature": "EventHandlerStatus dispatchEvent(HttpServletRequest httpRequest)", "start_line": 3, "modifiers": "public", "params": [{"name": "httpRequest", "type": "HttpServletRequest"}], "return_type": "EventHandlerStatus"}, "class_info": {"name": "EventServ... |
18627126_85 | class PropagateErrorsDownloadPolicy extends AbstractPolicy implements DownloadErrorPolicy {
@Override
public boolean applyPolicy( PolicyOption policySetting, Properties request, StorageAsset localFile, Exception exception,
Map<String, Exception> previousExceptions )
thro... | DownloadErrorPolicy policy = lookupPolicy();
StorageAsset localFile = getFile();
Properties request = createRequest();
Exception ex = new RuntimeException();
Map<String, Exception> exMap = new HashMap<>();
assertFalse(policy.applyPolicy( PropagateErrorsDownloadPolicy.IG... | [FOCAL] @Override public boolean PropagateErrorsDownloadPolicy.applyPolicy(PolicyOption policySetting, Properties request, StorageAsset localFile, Exception exception, Map<String, Exception> previousExceptions)
[CLASS] class PropagateErrorsDownloadPolicy extends AbstractPolicy implements DownloadErrorPolicy
[METRICS] l... | /* static context
[FOCAL] @Override public boolean PropagateErrorsDownloadPolicy.applyPolicy(PolicyOption policySetting, Properties request, StorageAsset localFile, Exception exception, Map<String, Exception> previousExceptions)
[THROWS-WHEN] PolicyConfigurationException when !options.contains( policySetting )
[THROWS-... | /* static context
[FOCAL] @Override public boolean PropagateErrorsDownloadPolicy.applyPolicy(PolicyOption policySetting, Properties request, StorageAsset localFile, Exception exception, Map<String, Exception> previousExceptions)
[THROWS-WHEN] PolicyConfigurationException when !options.contains( policySetting )
[THROWS-... | true | ok | {"focal": {"class": "PropagateErrorsDownloadPolicy", "name": "applyPolicy", "signature": "boolean applyPolicy(PolicyOption policySetting, Properties request, StorageAsset localFile, Exception exception, Map<String, Exception> previousExceptions) throws PolicyConfigurationException", "start_line": 3, "modifiers": "@Over... |
18641766_9 | class IOUtil {
public static void writeInt(OutputStream output, int value) throws IOException {
byte[] writeBuffer = new byte[4];
writeBuffer[0] = (byte) (value & 0xFF);
writeBuffer[1] = (byte) ((value>>8) & 0xFF);
writeBuffer[2] = (byte) ((value>>16) & 0xFF);
writeBuffer[3] = (byte) ((value>>24) & 0xFF);
... | try {
ByteArrayOutputStream bout = new ByteArrayOutputStream();
IOUtil.writeInt(bout, 3);
IOUtil.writeInt(bout, 4);
IOUtil.writeInt(bout, 0xFF0000AA);
IOUtil.writeInt(bout, 0xAABBCCDD);
ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
long a = IOUtil.readInt(bi... | [FOCAL] public static void IOUtil.writeInt(OutputStream output, int value)
[CLASS] class IOUtil
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] OutputStream.write/3
[EXCEPTIONS] declares IOException
[COLLABORATORS] param output:OutputStream write/3
[DATAFLOW] output@param->L7; valu... | /* static context
[FOCAL] public static void IOUtil.writeInt(OutputStream output, int value)
[COLLABORATORS] param output:OutputStream write/3
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] OutputStream.write/3
*/
| /* static context
[FOCAL] public static void IOUtil.writeInt(OutputStream output, int value)
[COLLABORATORS] param output:OutputStream write/3
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] OutputStream.write/3
*/
class IOUtil {
public static void writeInt(OutputStream output, int value) throws IOException {
by... | true | ok | {"focal": {"class": "IOUtil", "name": "writeInt", "signature": "void writeInt(OutputStream output, int value) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "output", "type": "OutputStream"}, {"name": "value", "type": "int"}], "return_type": "void"}, "class_info": {"name": "IOUt... |
18672634_8 | class ProductResource {
@GET
@Path("{productId}")
public ProductDto getProduct(@PathParam("productId") String productId) {
Product product = productRepository.getProduct(productId);
if (product == null) {
throw new IllegalArgumentException("No such product: " + productId);
}
logger.info("Re... |
String bookId = UUID.randomUUID().toString();
Book book = new Book(bookId, "1234567890", "Book Title", "");
String productId = UUID.randomUUID().toString();
Product product = new Product(productId, book, 1000L, null);
when(productRepository.getProduct(productId)).thenReturn(product);
ProductDt... | [FOCAL] @GET @Path("{productId}") public ProductDto ProductResource.getProduct(String productId)
[CLASS] class ProductResource
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] ProductRepository.getProduct/1, logger.info/2, ProductDtoFactory.fromProduct/1
[NEW] IllegalArgumentExcept... | /* static context
[FOCAL] @GET @Path("{productId}") public ProductDto ProductResource.getProduct(String productId)
[THROWS-WHEN] IllegalArgumentException when product == null
[PATH1] if(product == null)=T -> throw new IllegalArgumentException("No such product: " + productId)
[PATH2] if(product == null)=F -> return Prod... | /* static context
[FOCAL] @GET @Path("{productId}") public ProductDto ProductResource.getProduct(String productId)
[THROWS-WHEN] IllegalArgumentException when product == null
[PATH1] if(product == null)=T -> throw new IllegalArgumentException("No such product: " + productId)
[PATH2] if(product == null)=F -> return Prod... | true | ok | {"focal": {"class": "ProductResource", "name": "getProduct", "signature": "ProductDto getProduct(String productId)", "start_line": 3, "modifiers": "@GET @Path(\"{productId}\") public", "params": [{"name": "productId", "type": "String"}], "return_type": "ProductDto"}, "class_info": {"name": "ProductResource", "kind": "c... |
18693684_0 | class TitleBuilder extends UpdateBuilder {
public String buildCondensed() {
String title = "";
if(validNotificationsResponse() && validInboxResponse()) {
title = resources.getString(R.string.message_condensed, inboxResponse.count);
title += " ";
title += resource... | String title = "Mail: 0 Updates: 0";
InboxResponse inboxResponse = createInboxResponse(0);
NotificationsResponse notificationsResponse = createNotificationResponse(0);
TitleBuilder titleBuilder = new TitleBuilder(notificationsResponse, inboxResponse, resources);
assertEquals(titl... | [FOCAL] public String TitleBuilder.buildCondensed()
[CLASS] class TitleBuilder extends UpdateBuilder
[METRICS] loc=13 cc=4 branches=3 loops=0 returns=1 throws=0 nesting=3
[CALLS-EXTERNAL] validNotificationsResponse/0 (inherited), validInboxResponse/0 (inherited), Resources.getString/2
[FIELDS] read=resources:Resources
... | /* static context
[FOCAL] public String TitleBuilder.buildCondensed()
[PATH1] if(validNotificationsResponse() && validInboxResponse())=F -> if(validNotificationsResponse())=F -> if(validInboxResponse())=T -> return title
[PATH2] if(validNotificationsResponse() && validInboxResponse())=T -> return title
[PATH3] if(valid... | /* static context
[FOCAL] public String TitleBuilder.buildCondensed()
[PATH1] if(validNotificationsResponse() && validInboxResponse())=F -> if(validNotificationsResponse())=F -> if(validInboxResponse())=T -> return title
[PATH2] if(validNotificationsResponse() && validInboxResponse())=T -> return title
[PATH3] if(valid... | true | ok | {"focal": {"class": "TitleBuilder", "name": "buildCondensed", "signature": "String buildCondensed()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "TitleBuilder", "kind": "class", "modifiers": "", "superclass": "UpdateBuilder", "interfaces": null, "fields": [{"n... |
18709657_13 | class ViManager implements ViNodeSet {
@Override
public synchronized ViNode node(String namePattern) {
ensureAlive();
if (liveNodes.containsKey(namePattern)) {
return liveNodes.get(namePattern);
}
else if (deadNodes.containsKey(namePattern)) {
return deadNodes.get(namePattern);
}
else if (dynamicSe... | try {
man.node("aa").exec(new ExceptionalRunnable());
} catch (Exception e) {
e.printStackTrace();
ArithmeticException exception = (ArithmeticException) e;
// expect that exception not changed
boolean found = false;
for (StackTrace... | [FOCAL] @Override public synchronized ViNode ViManager.node(String namePattern)
[CLASS] class ViManager implements ViNodeSet
[METRICS] loc=25 cc=5 branches=4 loops=0 returns=5 throws=0 nesting=4
[CALLS-INTERNAL] boolean isPattern(String namePattern); void ensureAlive(); void inferConfiguration(ManagedNode node)
[CALLS-... | /* static context
[FOCAL] @Override public synchronized ViNode ViManager.node(String namePattern)
[PATH1] if(liveNodes.containsKey(namePattern))=F -> if(deadNodes.containsKey(namePattern))=F -> if(dynamicSelectors.containsKey(namePattern))=F -> if(isPattern(namePattern))=T -> return selector
[PATH2] if(liveNodes.contai... | /* static context
[FOCAL] @Override public synchronized ViNode ViManager.node(String namePattern)
[PATH1] if(liveNodes.containsKey(namePattern))=F -> if(deadNodes.containsKey(namePattern))=F -> if(dynamicSelectors.containsKey(namePattern))=F -> if(isPattern(namePattern))=T -> return selector
[PATH2] if(liveNodes.contai... | true | ok | {"focal": {"class": "ViManager", "name": "node", "signature": "ViNode node(String namePattern)", "start_line": 3, "modifiers": "@Override public synchronized", "params": [{"name": "namePattern", "type": "String"}], "return_type": "ViNode"}, "class_info": {"name": "ViManager", "kind": "class", "modifiers": "", "supercla... |
18749529_0 | class FaultInfoBuilder {
public static StepFaultCause blame(Blame blame) {
return new Builder(blame);
}
}
class FaultInfoBuilderTest {
@Test
public void testBlame() throws Exception {
| FaultInfo faultInfo = FaultInfoBuilder
.blame(Blame.CLIENT)
.faultCause("InvalidInput")
.applicationErrorCode(null)
.message("Invalid input")
.retrySameLocation(Retry.no())
.retryOtherLocations(Retry.no())
... | [FOCAL] public static StepFaultCause FaultInfoBuilder.blame(Blame blame)
[CLASS] class FaultInfoBuilder
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] Builder
[INPUTS] branches=- | result=blame
[DATAFLOW] blame@param->L2
[TEST] FaultInfoBuilderTest: @Test public void testBlame() throws Excep... | /* static context
[FOCAL] public static StepFaultCause FaultInfoBuilder.blame(Blame blame)
[INPUTS] branches=- | result=blame
[NEW] Builder
*/
| /* static context
[FOCAL] public static StepFaultCause FaultInfoBuilder.blame(Blame blame)
[INPUTS] branches=- | result=blame
[NEW] Builder
*/
class FaultInfoBuilder {
public static StepFaultCause blame(Blame blame) {
return new Builder(blame);
}
}
class FaultInfoBuilderTest {
@Test
public v... | true | ok | {"focal": {"class": "FaultInfoBuilder", "name": "blame", "signature": "StepFaultCause blame(Blame blame)", "start_line": 3, "modifiers": "public static", "params": [{"name": "blame", "type": "Blame"}], "return_type": "StepFaultCause"}, "class_info": {"name": "FaultInfoBuilder", "kind": "class", "modifiers": "", "superc... |
18759272_59 | class CurrentClient {
public ClosedConnectionReport closeConnections(CloseType closeType) {
return closeConnectionsByUrl(closeType, "");
}
private CurrentClient(String host, int port, int socketTimeout);
public static CurrentClientBuilder builder();
public ConnectionReport getConnections... | //given
stubFor(delete(urlEqualTo(connectionsUrl + "?type=reset")).willReturn(aResponse().withBody("{\n"
+ " \"closed_connections\": [{\n"
+ " \"host\": \"127.0.0.1\",\n"
+ " \"port\": 57518\n"
+ " }, {\n"
+ " \"host\": \"127.0.0.1\"... | [FOCAL] public ClosedConnectionReport CurrentClient.closeConnections(CloseType closeType)
[CLASS] class CurrentClient
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] ClosedConnectionReport closeConnectionsByUrl(CloseType closeType, String url)
[INPUTS] branches=- | result=closeType... | /* static context
[FOCAL] public ClosedConnectionReport CurrentClient.closeConnections(CloseType closeType)
[INPUTS] branches=- | result=closeType
[CALLS-INTERNAL] ClosedConnectionReport closeConnectionsByUrl(CloseType closeType, String url)
*/
| /* static context
[FOCAL] public ClosedConnectionReport CurrentClient.closeConnections(CloseType closeType)
[INPUTS] branches=- | result=closeType
[CALLS-INTERNAL] ClosedConnectionReport closeConnectionsByUrl(CloseType closeType, String url)
*/
class CurrentClient {
public ClosedConnectionReport closeConnections(C... | true | ok | {"focal": {"class": "CurrentClient", "name": "closeConnections", "signature": "ClosedConnectionReport closeConnections(CloseType closeType)", "start_line": 3, "modifiers": "public", "params": [{"name": "closeType", "type": "CloseType"}], "return_type": "ClosedConnectionReport"}, "class_info": {"name": "CurrentClient", ... |
18774289_3 | class MerkleTree {
public Leaf rightLeaf()
{
return (rightLeaf);
}
public MerkleTree(MessageDigest md);
private byte[] digest(Leaf leaf);
public void add(final MerkleTree leftTree, final MerkleTree rightTree);
public void add(final Leaf leftLeaf, final Leaf rightLeaf);
public MerkleTree leftTree();
publi... | Leaf rightLeaf = leafTree.rightLeaf();
assertTrue(rightLeaf.toString().equals(rightLeafString));
}
} | [FOCAL] public Leaf MerkleTree.rightLeaf()
[CLASS] class MerkleTree
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] MerkleTree(MessageDigest md); byte[] digest(Leaf leaf); void add(MerkleTree leftTree, MerkleTree rightTree); void add(Leaf leftLeaf, Leaf rightLeaf); MerkleTree leftTr... | /* static context
[FOCAL] public Leaf MerkleTree.rightLeaf()
*/
| /* static context
[FOCAL] public Leaf MerkleTree.rightLeaf()
*/
class MerkleTree {
public Leaf rightLeaf()
{
return (rightLeaf);
}
public MerkleTree(MessageDigest md);
private byte[] digest(Leaf leaf);
public void add(final MerkleTree leftTree, final MerkleTree rightTree);
public void add(final Leaf leftLe... | true | ok | {"focal": {"class": "MerkleTree", "name": "rightLeaf", "signature": "Leaf rightLeaf()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Leaf"}, "class_info": {"name": "MerkleTree", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "md", "type": "MessageD... |
18778871_50 | class AccountReceivableEntryListener {
@EventHandler
public void handleCreated(AccountReceivableFeeCreatedEvent event) {
AccountReceivableFeeEntry entry = new AccountReceivableFeeEntry();
entry.copy(event);
repository.save(entry);
}
@EventHandler public void handleConfirmed(Acc... | FeeId feeId = new FeeId();
FeeStatus feeStatus = FeeStatus.PENDING;
BigMoney amount = BigMoney.parse("BTC 30");
FeeType feeType = FeeType.PAY_COIN;
Date dueDate = new Date();
Date businessCreationTime = new Date();
String portfolioId = "portfolioId";
Strin... | [FOCAL] @EventHandler public void AccountReceivableEntryListener.handleCreated(AccountReceivableFeeCreatedEvent event)
[CLASS] class AccountReceivableEntryListener
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] AccountReceivableFeeEntry.copy/1, repository.save/1
[NEW] AccountRecei... | /* static context
[FOCAL] @EventHandler public void AccountReceivableEntryListener.handleCreated(AccountReceivableFeeCreatedEvent event)
[COLLABORATORS] field repository save/1
[NEW] AccountReceivableFeeEntry
[CALLS-EXTERNAL] AccountReceivableFeeEntry.copy/1, repository.save/1
*/
| /* static context
[FOCAL] @EventHandler public void AccountReceivableEntryListener.handleCreated(AccountReceivableFeeCreatedEvent event)
[COLLABORATORS] field repository save/1
[NEW] AccountReceivableFeeEntry
[CALLS-EXTERNAL] AccountReceivableFeeEntry.copy/1, repository.save/1
*/
class AccountReceivableEntryListener {
... | true | ok | {"focal": {"class": "AccountReceivableEntryListener", "name": "handleCreated", "signature": "void handleCreated(AccountReceivableFeeCreatedEvent event)", "start_line": 3, "modifiers": "@EventHandler public", "params": [{"name": "event", "type": "AccountReceivableFeeCreatedEvent"}], "return_type": "void"}, "class_info":... |
18817575_7 | class OsgiModelSource {
@Override
public int hashCode() {
return this.hashCode;
}
public OsgiModelSource(ModelDefinition<T> modelDefinition, ResourceModelFactory factory, Bundle bundle);
public T getModel(ContentToModelMappingCallback<T> callback);
public Class<?> getModelType();
... | OsgiModelSource<?> one = new OsgiModelSource<>(modelDefinition("one"), mock(ResourceModelFactory.class), this.bundleOne);
OsgiModelSource<?> two = new OsgiModelSource<>(modelDefinition("one"), mock(ResourceModelFactory.class), this.bundleOne);
assertThat(one.hashCode()).isEqualTo(two.hashCode()... | [FOCAL] @Override public int OsgiModelSource.hashCode()
[CLASS] class OsgiModelSource
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[FIELDS] read=hashCode
[CLASS-MEMBERS] OsgiModelSource(ModelDefinition<T> modelDefinition, ResourceModelFactory factory, Bundle bundle); T getModel(ContentToModelMap... | /* static context
[FOCAL] @Override public int OsgiModelSource.hashCode()
[FIELDS] read=hashCode
*/
| /* static context
[FOCAL] @Override public int OsgiModelSource.hashCode()
[FIELDS] read=hashCode
*/
class OsgiModelSource {
@Override
public int hashCode() {
return this.hashCode;
}
public OsgiModelSource(ModelDefinition<T> modelDefinition, ResourceModelFactory factory, Bundle bundle);
p... | true | ok | {"focal": {"class": "OsgiModelSource", "name": "hashCode", "signature": "int hashCode()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "OsgiModelSource", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "factor... |
18826763_2 | class PersonCollector {
public List<Person> getValidPeople() {
return validPeople;
}
public PersonCollector(PersonValidator personValidator);
public void addPerson(Person person);
PersonCollector personCollector;
}
class PersonCollectorTest {
PersonCollector personCollector;
@Test
public void perso... | assertEquals(0, personCollector.getValidPeople().size());
}
} | [FOCAL] public List<Person> PersonCollector.getValidPeople()
[CLASS] class PersonCollector
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] PersonCollector(PersonValidator personValidator); void addPerson(Person person)
[TEST] PersonCollectorTest: @Test public void personCollector_st... | /* static context
[FOCAL] public List<Person> PersonCollector.getValidPeople()
*/
| /* static context
[FOCAL] public List<Person> PersonCollector.getValidPeople()
*/
class PersonCollector {
public List<Person> getValidPeople() {
return validPeople;
}
public PersonCollector(PersonValidator personValidator);
public void addPerson(Person person);
PersonCollector personCollector;
}
class Pe... | true | ok | {"focal": {"class": "PersonCollector", "name": "getValidPeople", "signature": "List<Person> getValidPeople()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<Person>"}, "class_info": {"name": "PersonCollector", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields... |
18830102_391 | class JsonPropertyDeserializer {
public Map<String, Object> readPropertyStandalone(JsonReader reader, final EdmProperty edmProperty,
final DeserializerProperties readProperties) throws EntityProviderException {
return readPropertyStandalone(reader, EntityInfoAggregator.create(edmProperty), readProperties);... | String simplePropertyJson = "{\"d\":{\"Age\":67}}";
JsonReader reader = prepareReader(simplePropertyJson);
final EdmProperty edmProperty =
(EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee").getProperty("Age");
DeserializerProperties readProperties = mock(Deserializer... | [FOCAL] public Map<String, Object> JsonPropertyDeserializer.readPropertyStandalone(JsonReader reader, EdmProperty edmProperty, DeserializerProperties readProperties)
[CLASS] class JsonPropertyDeserializer
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Map<String, Object> readPrope... | /* static context
[FOCAL] public Map<String, Object> JsonPropertyDeserializer.readPropertyStandalone(JsonReader reader, EdmProperty edmProperty, DeserializerProperties readProperties)
[INPUTS] branches=- | result=edmProperty, readProperties, reader
[EXCEPTIONS] declares EntityProviderException
[CALLS-INTERNAL] Map<Stri... | /* static context
[FOCAL] public Map<String, Object> JsonPropertyDeserializer.readPropertyStandalone(JsonReader reader, EdmProperty edmProperty, DeserializerProperties readProperties)
[INPUTS] branches=- | result=edmProperty, readProperties, reader
[EXCEPTIONS] declares EntityProviderException
[CALLS-INTERNAL] Map<Stri... | true | ok | {"focal": {"class": "JsonPropertyDeserializer", "name": "readPropertyStandalone", "signature": "Map<String, Object> readPropertyStandalone(JsonReader reader, EdmProperty edmProperty, DeserializerProperties readProperties) throws EntityProviderException", "start_line": 3, "modifiers": "public", "params": [{"name": "read... |
18830782_0 | class UserRetriever {
public void retrieveUser(final UserCallback callback) {
mExecutor.execute(new RetrieveUserTask(callback));
}
public UserRetriever(final WebService webService, final AsyncTaskExecutor executor);
}
class UserRetrieverTest {
@Test
public void retrieveUser_retrievesUser_andNotifies... | /* Given */
User user = new User();
WebService webService = mock(WebService.class);
when(webService.retrieveUser()).thenReturn(user);
UserRetriever.UserCallback callback = mock(UserRetriever.UserCallback.class);
UserRetriever userRetriever = new UserRetriever(webService, TestAsyncTaskExecutor... | [FOCAL] public void UserRetriever.retrieveUser(UserCallback callback)
[CLASS] class UserRetriever
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] mExecutor.execute/1
[NEW] RetrieveUserTask
[COLLABORATORS] field mExecutor execute/1
[DATAFLOW] callback@param->L2
[CLASS-MEMBERS] UserR... | /* static context
[FOCAL] public void UserRetriever.retrieveUser(UserCallback callback)
[COLLABORATORS] field mExecutor execute/1
[NEW] RetrieveUserTask
[CALLS-EXTERNAL] mExecutor.execute/1
*/
| /* static context
[FOCAL] public void UserRetriever.retrieveUser(UserCallback callback)
[COLLABORATORS] field mExecutor execute/1
[NEW] RetrieveUserTask
[CALLS-EXTERNAL] mExecutor.execute/1
*/
class UserRetriever {
public void retrieveUser(final UserCallback callback) {
mExecutor.execute(new RetrieveUserTask(cal... | true | ok | {"focal": {"class": "UserRetriever", "name": "retrieveUser", "signature": "void retrieveUser(UserCallback callback)", "start_line": 3, "modifiers": "public", "params": [{"name": "callback", "type": "UserCallback"}], "return_type": "void"}, "class_info": {"name": "UserRetriever", "kind": "class", "modifiers": "", "super... |
18831720_2 | class ListUtil {
public static String join(Collection c) {
return join(c, ", ");
}
public static String join(Collection c, String join);
}
class ListUtilTest {
@Test
public void shouldJoinAListUsingComma(){
| ArrayList<String> list = new ArrayList<String>();
list.add("a");
list.add("b");
list.add("c");
assertThat(ListUtil.join(list), is("a, b, c"));
}
} | [FOCAL] public static String ListUtil.join(Collection c)
[CLASS] class ListUtil
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String join(Collection c, String join)
[INPUTS] branches=- | result=c
[DATAFLOW] c@param->L2
[CLASS-MEMBERS] String join(Collection c, String join)
[TEST]... | /* static context
[FOCAL] public static String ListUtil.join(Collection c)
[INPUTS] branches=- | result=c
[CALLS-INTERNAL] String join(Collection c, String join)
*/
| /* static context
[FOCAL] public static String ListUtil.join(Collection c)
[INPUTS] branches=- | result=c
[CALLS-INTERNAL] String join(Collection c, String join)
*/
class ListUtil {
public static String join(Collection c) {
return join(c, ", ");
}
public static String join(Collection c, String joi... | true | ok | {"focal": {"class": "ListUtil", "name": "join", "signature": "String join(Collection c)", "start_line": 3, "modifiers": "public static", "params": [{"name": "c", "type": "Collection"}], "return_type": "String"}, "class_info": {"name": "ListUtil", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null,... |
18871700_92 | class FreeformQuery extends AbstractTransactionalQuery implements
QueryDelegate {
@Override
@SuppressWarnings("deprecation")
public boolean containsRowWithKey(Object... keys) throws SQLException {
String query = null;
boolean contains = false;
if (delegate != null) {
... | FreeformQuery query = new FreeformQuery("SELECT * FROM people",
Arrays.asList("ID"), connectionPool);
Assert.assertFalse(query.containsRowWithKey(38796));
}
} | [FOCAL] @Override @SuppressWarnings("deprecation") public boolean FreeformQuery.containsRowWithKey(Object... keys)
[CLASS] class FreeformQuery extends AbstractTransactionalQuery implements QueryDelegate
[METRICS] loc=47 cc=7 branches=2 loops=0 returns=2 throws=0 nesting=4
[CALLS-INTERNAL] String modifyWhereClause(Objec... | /* static context
[FOCAL] @Override @SuppressWarnings("deprecation") public boolean FreeformQuery.containsRowWithKey(Object... keys)
[PATH1] if(delegate != null)=T -> if(delegate instanceof FreeformStatementDelegate)=T -> try-body throws -> return contains
[PATH2] if(delegate != null)=F -> return contains
[PATH3] if(de... | /* static context
[FOCAL] @Override @SuppressWarnings("deprecation") public boolean FreeformQuery.containsRowWithKey(Object... keys)
[PATH1] if(delegate != null)=T -> if(delegate instanceof FreeformStatementDelegate)=T -> try-body throws -> return contains
[PATH2] if(delegate != null)=F -> return contains
[PATH3] if(de... | true | ok | {"focal": {"class": "FreeformQuery", "name": "containsRowWithKey", "signature": "boolean containsRowWithKey(Object... keys) throws SQLException", "start_line": 4, "modifiers": "@Override @SuppressWarnings(\"deprecation\") public", "params": [{"name": "keys", "type": "Object..."}], "return_type": "boolean"}, "class_info... |
18894744_18 | class JavascriptObject {
protected Object invokeJavascript(String function) {
return checkUndefined(jsObject.call(function));
}
protected JavascriptObject();
protected JavascriptObject(String type);
protected JavascriptObject( String type, String stringRepresentation );
protected J... | String arg = "myArg";
Object[] argArray = new Object[] {arg};
String function = "myFunction";
String result = "result";
when(mockJsObject.call(function, argArray)).thenReturn(result);
Object returnValue = testJavascriptObject.invokeJavascript(function, arg);
... | [FOCAL] protected Object JavascriptObject.invokeJavascript(String function)
[CLASS] class JavascriptObject
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Object checkUndefined(Object val)
[CALLS-EXTERNAL] jsObject.call/1
[INPUTS] branches=- | result=function
[COLLABORATORS] field ... | /* static context
[FOCAL] protected Object JavascriptObject.invokeJavascript(String function)
[INPUTS] branches=- | result=function
[COLLABORATORS] field jsObject call/1
[CALLS-INTERNAL] Object checkUndefined(Object val)
[CALLS-EXTERNAL] jsObject.call/1
*/
| /* static context
[FOCAL] protected Object JavascriptObject.invokeJavascript(String function)
[INPUTS] branches=- | result=function
[COLLABORATORS] field jsObject call/1
[CALLS-INTERNAL] Object checkUndefined(Object val)
[CALLS-EXTERNAL] jsObject.call/1
*/
class JavascriptObject {
protected Object invokeJavascript... | true | ok | {"focal": {"class": "JavascriptObject", "name": "invokeJavascript", "signature": "Object invokeJavascript(String function)", "start_line": 3, "modifiers": "protected", "params": [{"name": "function", "type": "String"}], "return_type": "Object"}, "class_info": {"name": "JavascriptObject", "kind": "class", "modifiers": "... |
18907185_6 | class ValueShardedJedis extends Sharded<Jedis, JedisShardInfo> implements JedisCommands {
@Override
public Long incrBy(String key, long integer) {
Long result = 0L;
if (this.exists(key)) {
Long newValue = Long.valueOf(this.get(key)).longValue() + integer;
this.del(key);
this.set(key, newValue.toString()... | assertEquals(shardedJedis.incrBy("string:decrby", 5).longValue(), 5L);
assertEquals(shardedJedis.incrBy("string:decrby", 5).longValue(), 10L);
}
} | [FOCAL] @Override public Long ValueShardedJedis.incrBy(String key, long integer)
[CLASS] class ValueShardedJedis extends Sharded<Jedis, JedisShardInfo> implements JedisCommands
[METRICS] loc=14 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] Boolean exists(String key); Long del(String... keys); St... | class ValueShardedJedis extends Sharded<Jedis, JedisShardInfo> implements JedisCommands {
@Override
public Long incrBy(String key, long integer) {
Long result = 0L;
if (this.exists(key)) {
Long newValue = Long.valueOf(this.get(key)).longValue() + integer;
this.del(key);
this.set(key, newValue.toString()... | false | ok | {"focal": {"class": "ValueShardedJedis", "name": "incrBy", "signature": "Long incrBy(String key, long integer)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "key", "type": "String"}, {"name": "integer", "type": "long"}], "return_type": "Long"}, "class_info": {"name": "ValueShardedJedis", "kind... | |
18910111_9 | class FormValidator {
public static ValidationResult isValid(Form form) {
if (form == null) {
throw new IllegalAddException("Arugment cannot be null");
}
Class<? extends Object> type = form.getClass();
String key = type.getName();
ValidatorContianer contianer = c... | MockForm form = new MockForm();
form.setEmail("zxc@msun.com");
form.setPassword("hello1234");
ValidationResult valid = FormValidator.isValid(form);
System.out.println(valid);
assertTrue(valid.isValid());
assertFalse(valid.isFieldError("email"));
}
} | [FOCAL] public static ValidationResult FormValidator.isValid(Form form)
[CLASS] class FormValidator
[METRICS] loc=17 cc=4 branches=2 loops=1 returns=1 throws=1 nesting=1
[CALLS-INTERNAL] void validFiled(Object date, Field filed, ValidatorContianer contianer, ValidationResult result)
[CALLS-EXTERNAL] Form.getClass/0, Cl... | /* static context
[FOCAL] public static ValidationResult FormValidator.isValid(Form form)
[THROWS-WHEN] IllegalAddException when form == null
[PATH1] if(form == null)=F -> if(contianer == null)=T -> foreach(Field filed : type.getDeclaredFields())=T -> exit loop -> return result
[PATH2] if(form == null)=T -> throw new I... | /* static context
[FOCAL] public static ValidationResult FormValidator.isValid(Form form)
[THROWS-WHEN] IllegalAddException when form == null
[PATH1] if(form == null)=F -> if(contianer == null)=T -> foreach(Field filed : type.getDeclaredFields())=T -> exit loop -> return result
[PATH2] if(form == null)=T -> throw new I... | true | ok | {"focal": {"class": "FormValidator", "name": "isValid", "signature": "ValidationResult isValid(Form form)", "start_line": 3, "modifiers": "public static", "params": [{"name": "form", "type": "Form"}], "return_type": "ValidationResult"}, "class_info": {"name": "FormValidator", "kind": "class", "modifiers": "", "supercla... |
18912218_12 | class Capsule implements Runnable, InvocationHandler {
static List<String> expandArgs(List<String> args0, List<String> args) {
final List<String> args1 = new ArrayList<String>();
boolean expanded = false;
for (String a : args0) {
if (a.startsWith("$")) {
if (a.eq... | assertEquals(list("x", "y", "z"), Capsule.expandArgs(list("x", "y", "z"), CapsuleTest.<String>list()));
assertEquals(list("a", "b", "c"), Capsule.expandArgs(CapsuleTest.<String>list(), list("a", "b", "c")));
assertEquals(list("x", "y", "z", "a", "b", "c"), Capsule.expandArgs(list("x", "y", "z"),... | [FOCAL] static List<String> Capsule.expandArgs(List<String> args0, List<String> args)
[CLASS] class Capsule implements Runnable, InvocationHandler
[METRICS] loc=25 cc=6 branches=3 loops=1 returns=1 throws=0 nesting=4
[CALLS-EXTERNAL] String.startsWith/1, String.equals/1, List<String>.addAll/1, Integer.parseInt/1, Strin... | class Capsule implements Runnable, InvocationHandler {
static List<String> expandArgs(List<String> args0, List<String> args) {
final List<String> args1 = new ArrayList<String>();
boolean expanded = false;
for (String a : args0) {
if (a.startsWith("$")) {
if (a.eq... | false | ok | {"focal": {"class": "Capsule", "name": "expandArgs", "signature": "List<String> expandArgs(List<String> args0, List<String> args)", "start_line": 3, "modifiers": "static", "params": [{"name": "args0", "type": "List<String>"}, {"name": "args", "type": "List<String>"}], "return_type": "List<String>"}, "class_info": {"nam... | |
18942355_240 | class AbstractEventList implements EventList<E> {
@Override
public void replaceAll(UnaryOperator<E> operator) {
updates.beginEvent(true); // nested due to set below
for (int i = size() - 1; i >= 0; i--) {
E oldValue = get(i);
E newValue = operat... | AbstractEventList<String> list = new AbstractEventList<String>() {
@Override
public int size() {
return 1;
}
@Override
public String get(int index) {
if (index != 0) throw new IndexOutOfBoundsException("Wha??");
... | [FOCAL] @Override public void AbstractEventList.replaceAll(UnaryOperator<E> operator)
[CLASS] class AbstractEventList implements EventList<E>
[METRICS] loc=21 cc=4 branches=1 loops=1 returns=0 throws=1 nesting=3
[CALLS-INTERNAL] E get(int index); E set(int index, E value); int size()
[CALLS-EXTERNAL] updates.beginEvent... | /* static context
[FOCAL] @Override public void AbstractEventList.replaceAll(UnaryOperator<E> operator)
[THROWS-WHEN] ex when i >= 0 && oldValue != newValue && try-body throws
[PATH1] for(i >= 0)=T -> if(oldValue != newValue)=T -> try-body throws -> throw ex
[PATH2] for(i >= 0)=T -> if(oldValue != newValue)=F -> exit l... | /* static context
[FOCAL] @Override public void AbstractEventList.replaceAll(UnaryOperator<E> operator)
[THROWS-WHEN] ex when i >= 0 && oldValue != newValue && try-body throws
[PATH1] for(i >= 0)=T -> if(oldValue != newValue)=T -> try-body throws -> throw ex
[PATH2] for(i >= 0)=T -> if(oldValue != newValue)=F -> exit l... | true | ok | {"focal": {"class": "AbstractEventList", "name": "replaceAll", "signature": "void replaceAll(UnaryOperator<E> operator)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "operator", "type": "UnaryOperator<E>"}], "return_type": "void"}, "class_info": {"name": "AbstractEventList", "kind": "class", "... |
18948102_0 | class FixSaxParser implements BytesSaxParser {
@Override
public void parse(Bytes bytes) {
long limit = bytes.readLimit(), limit2 = limit;
while (limit2 > bytes.readPosition() && bytes.readByte(limit2 - 1) != FIELD_TERMINATOR)
limit2--;
bytes.readLimit(limit2);
while... | String s = "8=FIX.4.2|9=130|35=D|34=659|49=BROKER04|56=REUTERS|52=20070123-19:09:43|38=1000|59=1|100=N|40=1|11=ORD10001|60=20070123-19:01:17|55=HPQ|54=1|21=2|10=004|";
Bytes bbb = Bytes.from(s.replace('|', '\u0001'));
final StringBuilder sb = new StringBuilder();
FixSaxParser parser = ne... | [FOCAL] @Override public void FixSaxParser.parse(Bytes bytes)
[CLASS] class FixSaxParser implements BytesSaxParser
[METRICS] loc=26 cc=3 branches=0 loops=2 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] void searchForTheEndOfField(Bytes bytes)
[CALLS-EXTERNAL] Bytes.readLimit/0, Bytes.readPosition/0, Bytes.readByte/1, B... | /* static context
[FOCAL] @Override public void FixSaxParser.parse(Bytes bytes)
[PATH1] while(limit2 > bytes.readPosition() && bytes.readByte(limit2 - 1) != FIELD_TERMINATOR)=T -> exit loop -> while(bytes.readRemaining() > 0)=F
[PATH2] while(limit2 > bytes.readPosition() && bytes.readByte(limit2 - 1) != FIELD_TERMINATO... | /* static context
[FOCAL] @Override public void FixSaxParser.parse(Bytes bytes)
[PATH1] while(limit2 > bytes.readPosition() && bytes.readByte(limit2 - 1) != FIELD_TERMINATOR)=T -> exit loop -> while(bytes.readRemaining() > 0)=F
[PATH2] while(limit2 > bytes.readPosition() && bytes.readByte(limit2 - 1) != FIELD_TERMINATO... | true | ok | {"focal": {"class": "FixSaxParser", "name": "parse", "signature": "void parse(Bytes bytes)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "bytes", "type": "Bytes"}], "return_type": "void"}, "class_info": {"name": "FixSaxParser", "kind": "class", "modifiers": "", "superclass": null, "interfaces"... |
18974940_126 | class AccountController {
public String getWebClientId() {
return mAppConfig.getString("appspot_webClientId");
}
@Inject public AccountController(
SharedPreferences preferences,
AccountManager accountManager,
AppConfig appConfig,
String accountType)... | mAccountController.getWebClientId();
verify(mAppConfig).getString("appspot_webClientId");
}
} | [FOCAL] public String AccountController.getWebClientId()
[CLASS] class AccountController
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] AppConfig.getString/1
[FIELDS] read=mAppConfig:AppConfig
[INPUTS] branches=- | result=mAppConfig
[COLLABORATORS] field mAppConfig:AppConfig getSt... | /* static context
[FOCAL] public String AccountController.getWebClientId()
[INPUTS] branches=- | result=mAppConfig
[COLLABORATORS] field mAppConfig:AppConfig getString/1
[FIELDS] read=mAppConfig:AppConfig
[CALLS-EXTERNAL] AppConfig.getString/1
*/
| /* static context
[FOCAL] public String AccountController.getWebClientId()
[INPUTS] branches=- | result=mAppConfig
[COLLABORATORS] field mAppConfig:AppConfig getString/1
[FIELDS] read=mAppConfig:AppConfig
[CALLS-EXTERNAL] AppConfig.getString/1
*/
class AccountController {
public String getWebClientId() {
r... | true | ok | {"focal": {"class": "AccountController", "name": "getWebClientId", "signature": "String getWebClientId()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "AccountController", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"na... |
18982942_19 | class WayHelper {
public static List<Node> isParallel(final List<Node> aFirstWay, final List<Node> aSecondWay) {
ArrayList<Node> aFirstWayCopy = new ArrayList<Node>(aFirstWay);
ArrayList<Node> aSecondWayCopy = new ArrayList<Node>(aSecondWay);
List<Node> retval = isParallelInternal(aFirstWa... | Node start = new Node(1, 1, new Date(), null, 0, 1.0, 5.0);
Node testStart = new Node(2, 1, new Date(), null, 0, 1.00001, 5.0);
Node end = new Node(3, 1, new Date(), null, 0, 1.0, 10.0);
Node afterEnd = new Node(4, 1, new Date(), null, 0, 1.0, 20.0);
Node testEnd = n... | [FOCAL] public static List<Node> WayHelper.isParallel(List<Node> aFirstWay, List<Node> aSecondWay)
[CLASS] class WayHelper
[METRICS] loc=17 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[CALLS-INTERNAL] List<Node> isParallelInternal(List<Node> aFirstWay, List<Node> aSecondWay)
[CALLS-EXTERNAL] Collections.revers... | /* static context
[FOCAL] public static List<Node> WayHelper.isParallel(List<Node> aFirstWay, List<Node> aSecondWay)
[PATH1] if(retval != null)#1=F -> if(retval != null)#2=T -> return retval
[PATH2] if(retval != null)#1=F -> if(retval != null)#2=F -> return null
[PATH3] if(retval != null)#1=T -> return retval
[INPUTS] ... | /* static context
[FOCAL] public static List<Node> WayHelper.isParallel(List<Node> aFirstWay, List<Node> aSecondWay)
[PATH1] if(retval != null)#1=F -> if(retval != null)#2=T -> return retval
[PATH2] if(retval != null)#1=F -> if(retval != null)#2=F -> return null
[PATH3] if(retval != null)#1=T -> return retval
[INPUTS] ... | true | ok | {"focal": {"class": "WayHelper", "name": "isParallel", "signature": "List<Node> isParallel(List<Node> aFirstWay, List<Node> aSecondWay)", "start_line": 3, "modifiers": "public static", "params": [{"name": "aFirstWay", "type": "List<Node>"}, {"name": "aSecondWay", "type": "List<Node>"}], "return_type": "List<Node>"}, "c... |
18997610_32 | class ClasspathHelper {
public static String loadFileFromClasspath(String location) {
InputStream inputStream = ClasspathHelper.class.getResourceAsStream(location);
if(inputStream == null) {
inputStream = ClasspathHelper.class.getClassLoader().getResourceAsStream(location);
}
... | final String contents = ClasspathHelper.loadFileFromClasspath("classpathTest.txt");
assertEquals(contents, "How now brown cow?");
}
} | [FOCAL] public static String ClasspathHelper.loadFileFromClasspath(String location)
[CLASS] class ClasspathHelper
[METRICS] loc=22 cc=5 branches=3 loops=0 returns=1 throws=2 nesting=2
[CALLS-EXTERNAL] ClasspathHelper.class.getResourceAsStream/1, ClasspathHelper.class.getClassLoader().getResourceAsStream/1, ClasspathHel... | /* static context
[FOCAL] public static String ClasspathHelper.loadFileFromClasspath(String location)
[THROWS-WHEN] RuntimeException when inputStream == null && inputStream == null && inputStream != null && try-body throws
[THROWS-WHEN] RuntimeException when inputStream == null && inputStream == null && !(inputStream !... | /* static context
[FOCAL] public static String ClasspathHelper.loadFileFromClasspath(String location)
[THROWS-WHEN] RuntimeException when inputStream == null && inputStream == null && inputStream != null && try-body throws
[THROWS-WHEN] RuntimeException when inputStream == null && inputStream == null && !(inputStream !... | true | ok | {"focal": {"class": "ClasspathHelper", "name": "loadFileFromClasspath", "signature": "String loadFileFromClasspath(String location)", "start_line": 3, "modifiers": "public static", "params": [{"name": "location", "type": "String"}], "return_type": "String"}, "class_info": {"name": "ClasspathHelper", "kind": "class", "m... |
19008038_65 | class OwlApiUtils {
public static String getIri(OWLDeclarationAxiom expression) {
return expression.getEntity().getIRI().toString();
}
public static Optional<Object> getTypedLiteralValue(OWLLiteral literal);
static String hash(String input);
public static String getIri(OWLClassExpression expression);
... | String ontologyIri = "http://x.org/ontology";
OWLOntology ontology = manager.createOntology(IRI.create(ontologyIri));
assertThat(OwlApiUtils.getIri(ontology), is(ontologyIri));
}
} | [FOCAL] public static String OwlApiUtils.getIri(OWLDeclarationAxiom expression)
[CLASS] class OwlApiUtils
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] expression.getEntity().getIRI().toString/0, expression.getEntity().getIRI/0, OWLDeclarationAxiom.getEntity/0
[INPUTS] branches=-... | /* static context
[FOCAL] public static String OwlApiUtils.getIri(OWLDeclarationAxiom expression)
[INPUTS] branches=- | result=expression
[COLLABORATORS] param expression:OWLDeclarationAxiom getEntity/0
[CALLS-EXTERNAL] expression.getEntity().getIRI().toString/0, expression.getEntity().getIRI/0, OWLDeclarationAxiom.get... | /* static context
[FOCAL] public static String OwlApiUtils.getIri(OWLDeclarationAxiom expression)
[INPUTS] branches=- | result=expression
[COLLABORATORS] param expression:OWLDeclarationAxiom getEntity/0
[CALLS-EXTERNAL] expression.getEntity().getIRI().toString/0, expression.getEntity().getIRI/0, OWLDeclarationAxiom.get... | true | ok | {"focal": {"class": "OwlApiUtils", "name": "getIri", "signature": "String getIri(OWLDeclarationAxiom expression)", "start_line": 3, "modifiers": "public static", "params": [{"name": "expression", "type": "OWLDeclarationAxiom"}], "return_type": "String"}, "class_info": {"name": "OwlApiUtils", "kind": "class", "modifiers... |
19024198_201 | class HttpRequestEncoder extends HttpObjectEncoder<HttpRequest> {
@Override
protected void encodeInitialLine(ByteBuf buf, HttpRequest request) throws Exception {
request.getMethod().encode(buf);
buf.writeByte(SP);
// Add / as absolute path if no is present.
// See http://tools.... | HttpRequestEncoder encoder = new HttpRequestEncoder();
ByteBuf buffer = Unpooled.buffer(64);
encoder.encodeInitialLine(buffer, new DefaultHttpRequest(HttpVersion.HTTP_1_1,
HttpMethod.GET, "/"));
String req = buffer.toString(Charset.forName("US-ASCII"));
assertEqua... | [FOCAL] @Override protected void HttpRequestEncoder.encodeInitialLine(ByteBuf buf, HttpRequest request)
[CLASS] class HttpRequestEncoder extends HttpObjectEncoder<HttpRequest>
[METRICS] loc=27 cc=4 branches=3 loops=0 returns=0 throws=0 nesting=3
[CALLS-EXTERNAL] request.getMethod().encode/1, HttpRequest.getMethod/0, By... | /* static context
[FOCAL] @Override protected void HttpRequestEncoder.encodeInitialLine(ByteBuf buf, HttpRequest request)
[PATH1] if(uri.length() == 0)=F -> if(start != -1 && uri.charAt(0) != SLASH)=T -> if(uri.lastIndexOf(SLASH) <= startIndex)=T
[PATH2] if(uri.length() == 0)=T
[PATH3] if(uri.length() == 0)=F -> if(sta... | /* static context
[FOCAL] @Override protected void HttpRequestEncoder.encodeInitialLine(ByteBuf buf, HttpRequest request)
[PATH1] if(uri.length() == 0)=F -> if(start != -1 && uri.charAt(0) != SLASH)=T -> if(uri.lastIndexOf(SLASH) <= startIndex)=T
[PATH2] if(uri.length() == 0)=T
[PATH3] if(uri.length() == 0)=F -> if(sta... | true | ok | {"focal": {"class": "HttpRequestEncoder", "name": "encodeInitialLine", "signature": "void encodeInitialLine(ByteBuf buf, HttpRequest request) throws Exception", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "buf", "type": "ByteBuf"}, {"name": "request", "type": "HttpRequest"}], "return_type":... |
19062268_150 | class ImmutableMediaType implements MediaType {
@Override
public Map<String,String> parameters() {
return this.parameters;
}
ImmutableMediaType(final MediaRangeSyntax syntax, final String type, final String subtype, String suffix, final Map<String, String> parameters);
@Override public String type();
@Over... | ImmutableMediaType sut=new ImmutableMediaType(MediaRangeSyntax.RFC7230,"type","subtype",null,null);
assertThat(sut.parameters(),notNullValue());
assertThat(sut.parameters().isEmpty(),equalTo(true));
}
} | [FOCAL] @Override public Map<String,String> ImmutableMediaType.parameters()
[CLASS] class ImmutableMediaType implements MediaType
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[FIELDS] read=parameters
[CLASS-MEMBERS] ImmutableMediaType(MediaRangeSyntax syntax, String type, String subtype, String ... | /* static context
[FOCAL] @Override public Map<String,String> ImmutableMediaType.parameters()
[FIELDS] read=parameters
*/
| /* static context
[FOCAL] @Override public Map<String,String> ImmutableMediaType.parameters()
[FIELDS] read=parameters
*/
class ImmutableMediaType implements MediaType {
@Override
public Map<String,String> parameters() {
return this.parameters;
}
ImmutableMediaType(final MediaRangeSyntax syntax, final String ... | true | ok | {"focal": {"class": "ImmutableMediaType", "name": "parameters", "signature": "Map<String,String> parameters()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Map<String,String>"}, "class_info": {"name": "ImmutableMediaType", "kind": "class", "modifiers": "", "superclass": null, "interf... |
19067639_125 | class WebHookPayloadManager {
public Boolean isRegisteredFormat(String format){
return formats.containsKey(format.toLowerCase());
}
public WebHookPayloadManager(SBuildServer server);
public void registerPayloadFormat(WebHookPayload payloadFormat);
public WebHookPayload getFormat(String formatShortname);
pub... | assertEquals(true, manager.isRegisteredFormat("one"));
assertEquals(false, manager.isRegisteredFormat("none"));
}
} | [FOCAL] public Boolean WebHookPayloadManager.isRegisteredFormat(String format)
[CLASS] class WebHookPayloadManager
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] formats.containsKey/1, String.toLowerCase/0
[INPUTS] branches=- | result=format
[COLLABORATORS] field formats containsK... | /* static context
[FOCAL] public Boolean WebHookPayloadManager.isRegisteredFormat(String format)
[INPUTS] branches=- | result=format
[COLLABORATORS] field formats containsKey/1
[CALLS-EXTERNAL] formats.containsKey/1, String.toLowerCase/0
*/
| /* static context
[FOCAL] public Boolean WebHookPayloadManager.isRegisteredFormat(String format)
[INPUTS] branches=- | result=format
[COLLABORATORS] field formats containsKey/1
[CALLS-EXTERNAL] formats.containsKey/1, String.toLowerCase/0
*/
class WebHookPayloadManager {
public Boolean isRegisteredFormat(String format... | true | ok | {"focal": {"class": "WebHookPayloadManager", "name": "isRegisteredFormat", "signature": "Boolean isRegisteredFormat(String format)", "start_line": 3, "modifiers": "public", "params": [{"name": "format", "type": "String"}], "return_type": "Boolean"}, "class_info": {"name": "WebHookPayloadManager", "kind": "class", "modi... |
19069584_1 | class VariablesResolver {
public static String replaceAllVariables(String strVars) {
return replaceAllVariables(strVars, null);
}
private VariablesResolver();
public static void configure(Properties props);
public static void configure();
public static URL getVariablessUrl();
sta... |
assertFalse(VariablesResolver.containsVariable("novariable"));
assertFalse(VariablesResolver.containsVariable("$(varTest"));
assertTrue(VariablesResolver.containsVariable("$(varTest)"));
assertTrue(VariablesResolver.containsVariable("a string $(varTest) with variable"));
assertT... | [FOCAL] public static String VariablesResolver.replaceAllVariables(String strVars)
[CLASS] class VariablesResolver
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String replaceAllVariables(String strVars, DriverRequest request)
[INPUTS] branches=- | result=strVars
[DATAFLOW] strVa... | /* static context
[FOCAL] public static String VariablesResolver.replaceAllVariables(String strVars)
[INPUTS] branches=- | result=strVars
[CALLS-INTERNAL] String replaceAllVariables(String strVars, DriverRequest request)
*/
| /* static context
[FOCAL] public static String VariablesResolver.replaceAllVariables(String strVars)
[INPUTS] branches=- | result=strVars
[CALLS-INTERNAL] String replaceAllVariables(String strVars, DriverRequest request)
*/
class VariablesResolver {
public static String replaceAllVariables(String strVars) {
... | true | ok | {"focal": {"class": "VariablesResolver", "name": "replaceAllVariables", "signature": "String replaceAllVariables(String strVars)", "start_line": 3, "modifiers": "public static", "params": [{"name": "strVars", "type": "String"}], "return_type": "String"}, "class_info": {"name": "VariablesResolver", "kind": "class", "mod... |
19076996_898 | class EndpointHelper {
public static Endpoint lookupEndpoint(EndpointKey epKey, ReadOnlyTransaction transaction) {
Optional<Endpoint> optionalEp =
readFromDs(LogicalDatastoreType.OPERATIONAL, endpointIid(epKey.getL2Context(), epKey.getMacAddress()),
transaction);
if (op... | when(readOptional.isPresent()).thenReturn(true);
when(readOptional.get()).thenReturn(endpoint);
Endpoint result = EndpointHelper.lookupEndpoint(epKey, readTransaction);
assertEquals(result, endpoint);
}
} | [FOCAL] public static Endpoint EndpointHelper.lookupEndpoint(EndpointKey epKey, ReadOnlyTransaction transaction)
[CLASS] class EndpointHelper
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] readFromDs/3 (inherited), endpointIid/2 (inherited), EndpointKey.getL2Context/0, EndpointKe... | /* static context
[FOCAL] public static Endpoint EndpointHelper.lookupEndpoint(EndpointKey epKey, ReadOnlyTransaction transaction)
[PATH1] if(optionalEp.isPresent())=T -> return optionalEp.get()
[PATH2] if(optionalEp.isPresent())=F -> return null
[INPUTS] branches=epKey, transaction | result=epKey, transaction
[COLLABO... | /* static context
[FOCAL] public static Endpoint EndpointHelper.lookupEndpoint(EndpointKey epKey, ReadOnlyTransaction transaction)
[PATH1] if(optionalEp.isPresent())=T -> return optionalEp.get()
[PATH2] if(optionalEp.isPresent())=F -> return null
[INPUTS] branches=epKey, transaction | result=epKey, transaction
[COLLABO... | true | ok | {"focal": {"class": "EndpointHelper", "name": "lookupEndpoint", "signature": "Endpoint lookupEndpoint(EndpointKey epKey, ReadOnlyTransaction transaction)", "start_line": 3, "modifiers": "public static", "params": [{"name": "epKey", "type": "EndpointKey"}, {"name": "transaction", "type": "ReadOnlyTransaction"}], "return... |
19097627_21 | class GravityAttributeProcessor extends AttributeProcessor<V> {
@Override
public Value compile(@Nullable Value value, Context context) {
if (null == value) {
return NO_GRAVITY;
}
return ParseHelper.getGravity(value.getAsString());
}
@Override public void handleValue(V view, Value value);
@... | AttributeProcessor processor = new GravityAttributeProcessor() {
@Override
public void setGravity(View view, @Gravity int gravity) {
}
};
Value value = processor.compile(new Primitive("top|left"), null);
int gravity = Gravity.TOP | Gravity.LEFT;
assertThat(value.getAsInt(), is(gr... | [FOCAL] @Override public Value GravityAttributeProcessor.compile(Value value, Context context)
[CLASS] class GravityAttributeProcessor extends AttributeProcessor<V>
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] ParseHelper.getGravity/1, Value.getAsString/0
[PATH1] if(null == valu... | /* static context
[FOCAL] @Override public Value GravityAttributeProcessor.compile(Value value, Context context)
[PATH1] if(null == value)=T -> return NO_GRAVITY
[PATH2] if(null == value)=F -> return ParseHelper.getGravity(value.getAsString())
[INPUTS] branches=value | result=value | unused=context
[COLLABORATORS] para... | /* static context
[FOCAL] @Override public Value GravityAttributeProcessor.compile(Value value, Context context)
[PATH1] if(null == value)=T -> return NO_GRAVITY
[PATH2] if(null == value)=F -> return ParseHelper.getGravity(value.getAsString())
[INPUTS] branches=value | result=value | unused=context
[COLLABORATORS] para... | true | ok | {"focal": {"class": "GravityAttributeProcessor", "name": "compile", "signature": "Value compile(Value value, Context context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "value", "type": "Value"}, {"name": "context", "type": "Context"}], "return_type": "Value"}, "class_info": {"name": "Gravi... |
19097773_39 | class DateUtil {
public static Date parse(String dateString, String format) {
try {
SimpleDateFormat sdf = new SimpleDateFormat(format);
sdf.setLenient(false);
Date date = sdf.parse(dateString);
return date;
} catch (Exception e) {
LOGGER.... | String formatString = "yyyy-MM-dd HH:mm:ss";
String dateString = "2015-01-22 01:44:50";
Calendar c = Calendar.getInstance();
c.set(Calendar.YEAR, 2015);
c.set(Calendar.MONTH, 0);
c.set(Calendar.DAY_OF_MONTH, 22);
c.set(Calendar.HOUR_OF_DAY, 01);
c.set(Calendar.MINU... | [FOCAL] public static Date DateUtil.parse(String dateString, String format)
[CLASS] class DateUtil
[METRICS] loc=11 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] SimpleDateFormat.setLenient/1, SimpleDateFormat.parse/1, LOGGER.error/2
[NEW] SimpleDateFormat
[EXCEPTIONS] catches Exception e
[PATH1... | /* static context
[FOCAL] public static Date DateUtil.parse(String dateString, String format)
[PATH1] try-body throws -> return null
[PATH2] return date
[INPUTS] branches=- | result=dateString, format
[EXCEPTIONS] catches Exception e
[NEW] SimpleDateFormat
[CALLS-EXTERNAL] SimpleDateFormat.setLenient/1, SimpleDateForma... | /* static context
[FOCAL] public static Date DateUtil.parse(String dateString, String format)
[PATH1] try-body throws -> return null
[PATH2] return date
[INPUTS] branches=- | result=dateString, format
[EXCEPTIONS] catches Exception e
[NEW] SimpleDateFormat
[CALLS-EXTERNAL] SimpleDateFormat.setLenient/1, SimpleDateForma... | true | ok | {"focal": {"class": "DateUtil", "name": "parse", "signature": "Date parse(String dateString, String format)", "start_line": 3, "modifiers": "public static", "params": [{"name": "dateString", "type": "String"}, {"name": "format", "type": "String"}], "return_type": "Date"}, "class_info": {"name": "DateUtil", "kind": "cla... |
19116210_36 | class OrgMatchingItemProcessor extends BaseItemProcessor implements ItemProcessor<OrgData, OrgData> {
@Override
public OrgData process(OrgData input) throws Exception {
ServiceContext context = getServiceContext();
List<ValidationError> errors = Lists.newArrayList();
if (StringUtils.isBlank(input.getOrg().getO... | FieldSet fieldSet = new DefaultFieldSet(OrgLineTokenizer.COL_NAMES, OrgLineTokenizer.COL_NAMES);
orgData.setFieldSet(fieldSet);
Mockito.when(
organizationService.getMatch(org.mockito.Matchers.any(ServiceContext.class),
org.mockito.Matchers.any(Org.class))).thenReturn(null);
Map<String, String> asMap =... | [FOCAL] @Override public OrgData OrgMatchingItemProcessor.process(OrgData input)
[CLASS] class OrgMatchingItemProcessor extends BaseItemProcessor implements ItemProcessor<OrgData, OrgData>
[METRICS] loc=37 cc=6 branches=5 loops=0 returns=2 throws=2 nesting=2
[CALLS-EXTERNAL] getServiceContext/0 (inherited), Lists.newAr... | /* static context
[FOCAL] @Override public OrgData OrgMatchingItemProcessor.process(OrgData input)
[THROWS-WHEN] e when StringUtils.isBlank(input.getOrg().getOrgTypeCode()) && StringUtils.isBlank(input.getOrg().getParentOrgCode()) && !errors.isEmpty()
[THROWS-WHEN] e when StringUtils.isBlank(input.getOrg().getOrgTypeCo... | /* static context
[FOCAL] @Override public OrgData OrgMatchingItemProcessor.process(OrgData input)
[THROWS-WHEN] e when StringUtils.isBlank(input.getOrg().getOrgTypeCode()) && StringUtils.isBlank(input.getOrg().getParentOrgCode()) && !errors.isEmpty()
[THROWS-WHEN] e when StringUtils.isBlank(input.getOrg().getOrgTypeCo... | true | ok | {"focal": {"class": "OrgMatchingItemProcessor", "name": "process", "signature": "OrgData process(OrgData input) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "input", "type": "OrgData"}], "return_type": "OrgData"}, "class_info": {"name": "OrgMatchingItemProcessor", "kind": "cl... |
19141372_0 | class SipInvite {
boolean hasRemotePartyId() {
return remotePartyId != null;
}
SipInvite(String packet);
private CallerInformationHeader extractFromLikeHeader(String header);
boolean hasPAssertedIdentity();
CallerInformationHeader getPAssertedIdentity();
CallerInformationHead... | assertTrue(new SipInvite(INVITE_PACKET_WITH_REMOTE_PARTY_ID).hasRemotePartyId());
assertFalse(new SipInvite(INVITE_PACKET_WITHOUT_REMOTE_PARTY_ID).hasRemotePartyId());
}
} | [FOCAL] boolean SipInvite.hasRemotePartyId()
[CLASS] class SipInvite
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] SipInvite(String packet); CallerInformationHeader extractFromLikeHeader(String header); boolean hasPAssertedIdentity(); CallerInformationHeader getPAssertedIdentity()... | /* static context
[FOCAL] boolean SipInvite.hasRemotePartyId()
*/
| /* static context
[FOCAL] boolean SipInvite.hasRemotePartyId()
*/
class SipInvite {
boolean hasRemotePartyId() {
return remotePartyId != null;
}
SipInvite(String packet);
private CallerInformationHeader extractFromLikeHeader(String header);
boolean hasPAssertedIdentity();
CallerIn... | true | ok | {"focal": {"class": "SipInvite", "name": "hasRemotePartyId", "signature": "boolean hasRemotePartyId()", "start_line": 3, "modifiers": "", "params": [], "return_type": "boolean"}, "class_info": {"name": "SipInvite", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "INVITE_PAC... |
19169174_57 | class JSONArrayRequestDecorator extends RequestDecorator<T> {
@NonNull
public String getElementsKey() {
return elementsKey;
}
public JSONArrayRequestDecorator(@NonNull final Request<T> request, @NonNull final String elementsKey);
@Override protected Response<T> parseNetworkResponse(final NetworkResponse resp... | assertEquals(ELEMENTS_KEY, decorator.getElementsKey());
}
} | [FOCAL] @NonNull public String JSONArrayRequestDecorator.getElementsKey()
[CLASS] class JSONArrayRequestDecorator extends RequestDecorator<T>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] JSONArrayRequestDecorator(Request<T> request, String elementsKey); Response<T> parseNetworkRe... | /* static context
[FOCAL] @NonNull public String JSONArrayRequestDecorator.getElementsKey()
*/
| /* static context
[FOCAL] @NonNull public String JSONArrayRequestDecorator.getElementsKey()
*/
class JSONArrayRequestDecorator extends RequestDecorator<T> {
@NonNull
public String getElementsKey() {
return elementsKey;
}
public JSONArrayRequestDecorator(@NonNull final Request<T> request, @NonNull final String ... | true | ok | {"focal": {"class": "JSONArrayRequestDecorator", "name": "getElementsKey", "signature": "String getElementsKey()", "start_line": 3, "modifiers": "@NonNull public", "params": [], "return_type": "String"}, "class_info": {"name": "JSONArrayRequestDecorator", "kind": "class", "modifiers": "", "superclass": "RequestDecorato... |
19253642_1 | class BDecoder {
public static BEValue bdecode(InputStream in) throws IOException {
return new BDecoder(in).bdecode();
}
public BDecoder(InputStream in);
public byte[] get_special_map_digest();
public void set_special_map_name(String name);
public int getNextIndicator();
public B... | try {
FileInputStream in = null;
in = new FileInputStream(f);
Map m = new BDecoder(in).bdecode().getMap();
BEValue val = (BEValue) m.get("minId");
if (val == null) {
throw new InvalidBEncodingException("minId");
}
... | [FOCAL] public static BEValue BDecoder.bdecode(InputStream in)
[CLASS] class BDecoder
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] new BDecoder(in).bdecode/0
[NEW] BDecoder
[EXCEPTIONS] declares IOException
[INPUTS] branches=- | result=in
[DATAFLOW] in@param->L2
[CLASS-MEMBERS] ... | /* static context
[FOCAL] public static BEValue BDecoder.bdecode(InputStream in)
[INPUTS] branches=- | result=in
[EXCEPTIONS] declares IOException
[NEW] BDecoder
[CALLS-EXTERNAL] new BDecoder(in).bdecode/0
*/
| /* static context
[FOCAL] public static BEValue BDecoder.bdecode(InputStream in)
[INPUTS] branches=- | result=in
[EXCEPTIONS] declares IOException
[NEW] BDecoder
[CALLS-EXTERNAL] new BDecoder(in).bdecode/0
*/
class BDecoder {
public static BEValue bdecode(InputStream in) throws IOException {
return new BDe... | true | ok | {"focal": {"class": "BDecoder", "name": "bdecode", "signature": "BEValue bdecode(InputStream in) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "in", "type": "InputStream"}], "return_type": "BEValue"}, "class_info": {"name": "BDecoder", "kind": "class", "modifiers": "", "supercl... |
19260634_12 | class AdapterItemBinding {
public int getLayoutResourceId() {
return mLayoutResourceId;
}
public AdapterItemBinding(final int layoutResourceId);
public AdapterItemBinding(final int layoutResourceId, final Binding binding);
public AdapterItemBinding(final int layoutResourceId, final Set<... | AdapterItemBinding adapterItemBinding = new AdapterItemBinding(1);
int layoutResourceId = adapterItemBinding.getLayoutResourceId();
assertThat(layoutResourceId).isEqualTo(1);
adapterItemBinding = new AdapterItemBinding(2, new TextBinder(0,new ViewModelColumn("TABLE_NAME", "COLUMN_NAME",... | [FOCAL] public int AdapterItemBinding.getLayoutResourceId()
[CLASS] class AdapterItemBinding
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] AdapterItemBinding(int layoutResourceId); AdapterItemBinding(int layoutResourceId, Binding binding); AdapterItemBinding(int layoutResourceId, ... | /* static context
[FOCAL] public int AdapterItemBinding.getLayoutResourceId()
*/
| /* static context
[FOCAL] public int AdapterItemBinding.getLayoutResourceId()
*/
class AdapterItemBinding {
public int getLayoutResourceId() {
return mLayoutResourceId;
}
public AdapterItemBinding(final int layoutResourceId);
public AdapterItemBinding(final int layoutResourceId, final Bindin... | true | ok | {"focal": {"class": "AdapterItemBinding", "name": "getLayoutResourceId", "signature": "int getLayoutResourceId()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "AdapterItemBinding", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields":... |
19260719_0 | class CacHookingAgent {
static void processArgs(String args, Config config) {
String[] split = args.split(",\\s*");
for (String s : split) {
if (s.equals("debug")) {
DEBUG = true;
}
if (s.equals("tty")) {
config.setTty(true);
}
if (s.startsWith("context=")) {
CONTEXT = s.replace("contex... | Config config = new Config();
CacHookingAgent.processArgs("", config);
assertEquals(false, CacHookingAgent.DEBUG);
assertEquals("TLS", CacHookingAgent.CONTEXT);
CacHookingAgent.processArgs("load,debug,context=SSLv3", config);
assertEquals(true, CacHookingAgent.DEBUG);
assertEquals("SSLv3", CacHookingAg... | [FOCAL] static void CacHookingAgent.processArgs(String args, Config config)
[CLASS] class CacHookingAgent
[METRICS] loc=20 cc=7 branches=5 loops=1 returns=0 throws=0 nesting=2
[CALLS-INTERNAL] void showHelp()
[CALLS-EXTERNAL] String.split/1, String.equals/1, Config.setTty/1, String.startsWith/1, String.replace/2, Confi... | /* static context
[FOCAL] static void CacHookingAgent.processArgs(String args, Config config)
[PATH1] foreach(String s : split)=T -> if(s.equals("debug"))=T -> if(s.equals("tty"))=T -> if(s.startsWith("context="))=T -> if(s.equals("windowsTrust"))=T -> if(s.equals("help"))=T -> exit loop
[PATH2] foreach(String s : spli... | /* static context
[FOCAL] static void CacHookingAgent.processArgs(String args, Config config)
[PATH1] foreach(String s : split)=T -> if(s.equals("debug"))=T -> if(s.equals("tty"))=T -> if(s.startsWith("context="))=T -> if(s.equals("windowsTrust"))=T -> if(s.equals("help"))=T -> exit loop
[PATH2] foreach(String s : spli... | true | ok | {"focal": {"class": "CacHookingAgent", "name": "processArgs", "signature": "void processArgs(String args, Config config)", "start_line": 3, "modifiers": "static", "params": [{"name": "args", "type": "String"}, {"name": "config", "type": "Config"}], "return_type": "void"}, "class_info": {"name": "CacHookingAgent", "kind... |
19271154_30 | class PriorityQueue implements Iterable<E> {
public abstract E pop()@Nullable
public abstract E pop();
public abstract E pop()public abstract boolean isEmpty();
public abstract E pop()public abstract int size();
public abstract E pop()public abstract E push(@NotNull P priority, @NotNull E value);
... | final PriorityQueue<Priority, String> queue = populateAndCopyQueue();
assertEquals("7", queue.pop());
assertEquals("2", queue.pop());
assertEquals("4", queue.pop());
assertEquals("1", queue.pop());
assertEquals("3", queue.pop());
assertEquals("5", queue.pop());
... | [FOCAL] public abstract E PriorityQueue.pop()
[CLASS] class PriorityQueue implements Iterable<E>
[METRICS] loc=1 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CLASS-MEMBERS] E pop(); boolean isEmpty(); E pop(); int size(); E pop(); E push(P priority, E value); E peek(); Pair<P, E> peekPair(); Pair<P, E> floorPa... | /* static context
[FOCAL] public abstract E PriorityQueue.pop()
*/
| /* static context
[FOCAL] public abstract E PriorityQueue.pop()
*/
class PriorityQueue implements Iterable<E> {
public abstract E pop()@Nullable
public abstract E pop();
public abstract E pop()public abstract boolean isEmpty();
public abstract E pop()public abstract int size();
public abstract E p... | true | partial | {"focal": {"class": "PriorityQueue", "name": "pop", "signature": "E pop()", "start_line": 4, "modifiers": "public abstract", "params": [], "return_type": "E"}, "class_info": {"name": "PriorityQueue", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Iterable<E>", "fields": [], "members": [{"name": "p... |
19276770_0 | class UUID {
private UUID() {
}
private UUID();
public static String uuid();
private static int randomInt(int radix);
private static final Pattern UUID_PATTERN;
}
class UuidTest {
private static final Pattern UUID_PATTERN;
@Test
public void uuid() {
| for (int i = 0; i < 100; i++) {
String id = UUID.uuid();
assertNotNull(id);
assertTrue(UUID_PATTERN.matcher(id).matches());
}
}
} | [FOCAL] private UUID.UUID()
[CLASS] class UUID
[METRICS] loc=2 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CLASS-MEMBERS] UUID(); String uuid(); int randomInt(int radix)
[TEST] UuidTest: @Test public void uuid()
[TEST-FIELDS] Pattern UUID_PATTERN | /* static context
[FOCAL] private UUID.UUID()
*/
| /* static context
[FOCAL] private UUID.UUID()
*/
class UUID {
private UUID() {
}
private UUID();
public static String uuid();
private static int randomInt(int radix);
private static final Pattern UUID_PATTERN;
}
class UuidTest {
private static final Pattern UUID_PATTERN;
@Test
public void uuid() {
| true | ok | {"focal": {"class": "UUID", "name": "UUID", "signature": "UUID()", "start_line": 3, "modifiers": "private", "params": [], "return_type": null}, "class_info": {"name": "UUID", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "UUID_PATTERN", "type": "Pattern", "modifiers": "pr... |
19308274_7 | class PumlLineParser {
void parseLine(final String line) {
if(line == null) return;
String normalizedLine = line.trim().toLowerCase();
// inlcudes cannot be handled because of working directory mismatch while scanning
if(normalizedLine.startsWith("!include")) {
return;... | final String asciidoc = "=== Level 1\n" +
"\n" +
"\n" +
"The following diagram shows the main building blocks of the system and their interdependencies:\n" +
"\n" +
... | [FOCAL] void PumlLineParser.parseLine(String line)
[CLASS] class PumlLineParser
[METRICS] loc=46 cc=8 branches=7 loops=0 returns=3 throws=0 nesting=2
[CALLS-INTERNAL] void storeDiagram()
[CALLS-EXTERNAL] line.trim().toLowerCase/0, String.trim/0, String.startsWith/1, normalizedLine .replaceAll("\\[", "") .replaceAll("]"... | /* static context
[FOCAL] void PumlLineParser.parseLine(String line)
[PATH1] if(line == null)=F -> if(normalizedLine.startsWith("!include"))=F -> if(parsingState == ParsingState.IGNORING && normalizedLine.startsWith("[\"plantuml\""))=T -> if(parts!= null && parts.length >= 3)=T -> if(parsingState == ParsingState.ACCEPT... | /* static context
[FOCAL] void PumlLineParser.parseLine(String line)
[PATH1] if(line == null)=F -> if(normalizedLine.startsWith("!include"))=F -> if(parsingState == ParsingState.IGNORING && normalizedLine.startsWith("[\"plantuml\""))=T -> if(parts!= null && parts.length >= 3)=T -> if(parsingState == ParsingState.ACCEPT... | true | ok | {"focal": {"class": "PumlLineParser", "name": "parseLine", "signature": "void parseLine(String line)", "start_line": 3, "modifiers": "", "params": [{"name": "line", "type": "String"}], "return_type": "void"}, "class_info": {"name": "PumlLineParser", "kind": "class", "modifiers": "", "superclass": null, "interfaces": nu... |
19317653_20 | class CloudantToDo {
public boolean isCompleted() {
return completed;
}
public CloudantToDo();
public CloudantToDo(ToDo td);
public String get_id();
public void set_id(String _id);
public String get_rev();
public void set_rev(String _rev);
public String getTitle();
public void setTitle(Stri... | CloudantToDo ctd = new CloudantToDo(td);
assertFalse(ctd.isCompleted());
ctd = new CloudantToDo();
ctd.setCompleted(true);
assertTrue(ctd.isCompleted());
}
} | [FOCAL] public boolean CloudantToDo.isCompleted()
[CLASS] class CloudantToDo
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] CloudantToDo(); CloudantToDo(ToDo td); String get_id(); void set_id(String _id); String get_rev(); void set_rev(String _rev); String getTitle(); void setTitle... | /* static context
[FOCAL] public boolean CloudantToDo.isCompleted()
*/
| /* static context
[FOCAL] public boolean CloudantToDo.isCompleted()
*/
class CloudantToDo {
public boolean isCompleted() {
return completed;
}
public CloudantToDo();
public CloudantToDo(ToDo td);
public String get_id();
public void set_id(String _id);
public String get_rev();
public void set_re... | true | ok | {"focal": {"class": "CloudantToDo", "name": "isCompleted", "signature": "boolean isCompleted()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "CloudantToDo", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "td", "ty... |
19351480_28 | class JenkinsJobProperty extends AbstractJenkinsProperty {
public List<String> getPathComponents() {
return Arrays.asList(withFolders(job).split("/job/"));
}
public JenkinsJobProperty(JenkinsConfiguration configuration, String job);
public String getUrl();
private String withFolders(Stri... | JenkinsJobProperty property = new JenkinsJobProperty(
new JenkinsConfiguration("Test", "http://jenkins", "", ""),
"test/job/test-master/job/test-master-build"
);
assertEquals(Arrays.asList("test", "test-master", "test-master-build"), property.getPathComponents());... | [FOCAL] public List<String> JenkinsJobProperty.getPathComponents()
[CLASS] class JenkinsJobProperty extends AbstractJenkinsProperty
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String withFolders(String path)
[CALLS-EXTERNAL] Arrays.asList/1, withFolders(job).split/1
[CLASS-MEMB... | /* static context
[FOCAL] public List<String> JenkinsJobProperty.getPathComponents()
[CALLS-INTERNAL] String withFolders(String path)
[CALLS-EXTERNAL] Arrays.asList/1, withFolders(job).split/1
*/
| /* static context
[FOCAL] public List<String> JenkinsJobProperty.getPathComponents()
[CALLS-INTERNAL] String withFolders(String path)
[CALLS-EXTERNAL] Arrays.asList/1, withFolders(job).split/1
*/
class JenkinsJobProperty extends AbstractJenkinsProperty {
public List<String> getPathComponents() {
return Arr... | true | ok | {"focal": {"class": "JenkinsJobProperty", "name": "getPathComponents", "signature": "List<String> getPathComponents()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<String>"}, "class_info": {"name": "JenkinsJobProperty", "kind": "class", "modifiers": "", "superclass": "AbstractJenkinsPrope... |
19361874_2 | class HelloAppEngine extends HttpServlet {
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException {
response.setContentType("text/plain");
response.getWriter().println("Hello App Engine - Flexible!");
}
public static String getInfo();
private... | servletUnderTest.doGet(mockRequest, mockResponse);
// We expect our hello world response.
assertThat(responseWriter.toString())
.named("HelloAppEngine response")
.contains("Hello App Engine - Flexible!");
}
} | [FOCAL] @Override public void HelloAppEngine.doGet(HttpServletRequest request, HttpServletResponse response)
[CLASS] class HelloAppEngine extends HttpServlet
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] HttpServletResponse.setContentType/1, response.getWriter().println/1, HttpSe... | /* static context
[FOCAL] @Override public void HelloAppEngine.doGet(HttpServletRequest request, HttpServletResponse response)
[INPUTS] branches=- | result=- | unused=request
[COLLABORATORS] param response:HttpServletResponse setContentType/1,getWriter/0
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] HttpServletRes... | /* static context
[FOCAL] @Override public void HelloAppEngine.doGet(HttpServletRequest request, HttpServletResponse response)
[INPUTS] branches=- | result=- | unused=request
[COLLABORATORS] param response:HttpServletResponse setContentType/1,getWriter/0
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] HttpServletRes... | true | ok | {"focal": {"class": "HelloAppEngine", "name": "doGet", "signature": "void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "HttpServletRequest"}, {"name": "response", "type": "HttpServletResponse... |
19367053_0 | class RelativeRootMeanSquaredErrorMT extends AbstractMultiTargetErrorMeasurer {
@Override
public double getCurrentError() {
if(weightSeen==0)
return Double.MAX_VALUE;
else
{
double sum=0;
int numOutputs=sumSquaredError.length;
for (int i=0; i<numOutputs; i++)
sum+=Math.sqrt(sumSquaredError[i]/s... | assertEquals(0.9402350854416155, m.getCurrentError(), 0.0000001);
}
} | [FOCAL] @Override public double RelativeRootMeanSquaredErrorMT.getCurrentError()
[CLASS] class RelativeRootMeanSquaredErrorMT extends AbstractMultiTargetErrorMeasurer
[METRICS] loc=13 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] Math.sqrt/1
[PATH1] if(weightSeen==0)=F -> for(i<numOutputs)=T -> ... | /* static context
[FOCAL] @Override public double RelativeRootMeanSquaredErrorMT.getCurrentError()
[PATH1] if(weightSeen==0)=F -> for(i<numOutputs)=T -> exit loop -> return sum/numLearnedOutputs
[PATH2] if(weightSeen==0)=T -> return Double.MAX_VALUE
[PATH3] if(weightSeen==0)=F -> for(i<numOutputs)=F -> return sum/numLe... | /* static context
[FOCAL] @Override public double RelativeRootMeanSquaredErrorMT.getCurrentError()
[PATH1] if(weightSeen==0)=F -> for(i<numOutputs)=T -> exit loop -> return sum/numLearnedOutputs
[PATH2] if(weightSeen==0)=T -> return Double.MAX_VALUE
[PATH3] if(weightSeen==0)=F -> for(i<numOutputs)=F -> return sum/numLe... | true | ok | {"focal": {"class": "RelativeRootMeanSquaredErrorMT", "name": "getCurrentError", "signature": "double getCurrentError()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "double"}, "class_info": {"name": "RelativeRootMeanSquaredErrorMT", "kind": "class", "modifiers": "", "superclass": "Ab... |
19368221_328 | class TemplateProcessor {
public static String processTemplateContents(String templateContents, EntityDriver driver, Map<String,? extends Object> extraSubstitutions) {
return processTemplateContents(templateContents, new EntityAndMapTemplateModel(driver, extraSubstitutions));
}
protected static Te... | mgmt.getBrooklynProperties().put("global.mykey", "myval");
String templateContents = "${mgmt['global.mykey']}";
String result = TemplateProcessor.processTemplateContents(templateContents, app, ImmutableMap.<String,Object>of());
assertEquals(result, "myval");
}
} | [FOCAL] public static String TemplateProcessor.processTemplateContents(String templateContents, EntityDriver driver, Map<String,? extends Object> extraSubstitutions)
[CLASS] class TemplateProcessor
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String processTemplateContents(Strin... | /* static context
[FOCAL] public static String TemplateProcessor.processTemplateContents(String templateContents, EntityDriver driver, Map<String,? extends Object> extraSubstitutions)
[INPUTS] branches=- | result=driver, extraSubstitutions, templateContents
[CALLS-INTERNAL] String processTemplateContents(String templat... | /* static context
[FOCAL] public static String TemplateProcessor.processTemplateContents(String templateContents, EntityDriver driver, Map<String,? extends Object> extraSubstitutions)
[INPUTS] branches=- | result=driver, extraSubstitutions, templateContents
[CALLS-INTERNAL] String processTemplateContents(String templat... | true | ok | {"focal": {"class": "TemplateProcessor", "name": "processTemplateContents", "signature": "String processTemplateContents(String templateContents, EntityDriver driver, Map<String,? extends Object> extraSubstitutions)", "start_line": 3, "modifiers": "public static", "params": [{"name": "templateContents", "type": "String... |
19370824_2 | class GenericCoverageSensor implements Sensor {
@Override
public boolean shouldExecuteOnProject(Project project) {
return StringUtils.isNotEmpty(coverageReportPath(null)) || StringUtils.isNotEmpty(itReportPath()) ||
StringUtils.isNotEmpty(overallReportPath()) || StringUtils.isNotEmpty(unitTestReportPath(... | configureOldReportPath("coverage.xml");
assertThat(sensor.shouldExecuteOnProject(project)).isTrue();
}
} | [FOCAL] @Override public boolean GenericCoverageSensor.shouldExecuteOnProject(Project project)
[CLASS] class GenericCoverageSensor implements Sensor
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String coverageReportPath(Logger logger); String itReportPath(); String overallReport... | /* static context
[FOCAL] @Override public boolean GenericCoverageSensor.shouldExecuteOnProject(Project project)
[INPUTS] branches=- | result=- | unused=project
[CALLS-INTERNAL] String coverageReportPath(Logger logger); String itReportPath(); String overallReportPath(); String unitTestReportPath()
[CALLS-EXTERNAL] Stri... | /* static context
[FOCAL] @Override public boolean GenericCoverageSensor.shouldExecuteOnProject(Project project)
[INPUTS] branches=- | result=- | unused=project
[CALLS-INTERNAL] String coverageReportPath(Logger logger); String itReportPath(); String overallReportPath(); String unitTestReportPath()
[CALLS-EXTERNAL] Stri... | true | ok | {"focal": {"class": "GenericCoverageSensor", "name": "shouldExecuteOnProject", "signature": "boolean shouldExecuteOnProject(Project project)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "project", "type": "Project"}], "return_type": "boolean"}, "class_info": {"name": "GenericCoverageSensor", ... |
19383958_20 | class SpreadsheetSnippets {
public BatchUpdateSpreadsheetResponse pivotTables(String spreadsheetId) throws IOException {
Sheets service = this.service;
// Create two sheets for our pivot table.
List<Request> sheetsRequests = new ArrayList<>();
sheetsRequests.add(new Request().setAd... | String spreadsheetId = this.createTestSpreadsheet();
BatchUpdateSpreadsheetResponse result = this.snippets.pivotTables(spreadsheetId);
assertNotNull(result);
}
} | [FOCAL] public BatchUpdateSpreadsheetResponse SpreadsheetSnippets.pivotTables(String spreadsheetId)
[CLASS] class SpreadsheetSnippets
[METRICS] loc=68 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] List<Request>.add/1, new Request().setAddSheet/1, new BatchUpdateSpreadsheetRequest().setRequests/1... | /* static context
[FOCAL] public BatchUpdateSpreadsheetResponse SpreadsheetSnippets.pivotTables(String spreadsheetId)
[INPUTS] branches=- | result=spreadsheetId
[EXCEPTIONS] declares IOException
[FIELDS] read=service
[NEW] ArrayList<>, Request, AddSheetRequest, BatchUpdateSpreadsheetRequest, PivotTable, GridRange, Pivo... | /* static context
[FOCAL] public BatchUpdateSpreadsheetResponse SpreadsheetSnippets.pivotTables(String spreadsheetId)
[INPUTS] branches=- | result=spreadsheetId
[EXCEPTIONS] declares IOException
[FIELDS] read=service
[NEW] ArrayList<>, Request, AddSheetRequest, BatchUpdateSpreadsheetRequest, PivotTable, GridRange, Pivo... | true | ok | {"focal": {"class": "SpreadsheetSnippets", "name": "pivotTables", "signature": "BatchUpdateSpreadsheetResponse pivotTables(String spreadsheetId) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "spreadsheetId", "type": "String"}], "return_type": "BatchUpdateSpreadsheetResponse"}, "class_... |
19394307_2 | class LongPreference extends AbsPreference<Long> {
@Override public Long get() {
return getPreferences().getLong(getKey(), getDefaultValue());
}
public LongPreference(SharedPreferences preferences, String key);
public LongPreference(SharedPreferences preferences, String key, long defaultValue);
@Over... | // Arrange
long expected = 2;
String key = "testKey2";
preferences.edit().putLong(key, expected).commit();
LongPreference preference = new LongPreference(preferences, key);
// Act
long result = preference.get();
// Assert
assertThat(result).isEqualTo(expected);
}
} | [FOCAL] @Override public Long LongPreference.get()
[CLASS] class LongPreference extends AbsPreference<Long>
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] getPreferences().getLong/2, getPreferences/0 (inherited), getKey/0 (inherited), getDefaultValue/0 (inherited)
[CLASS-MEMBERS] ... | /* static context
[FOCAL] @Override public Long LongPreference.get()
[CALLS-EXTERNAL] getPreferences().getLong/2, getPreferences/0 (inherited), getKey/0 (inherited), getDefaultValue/0 (inherited)
*/
| /* static context
[FOCAL] @Override public Long LongPreference.get()
[CALLS-EXTERNAL] getPreferences().getLong/2, getPreferences/0 (inherited), getKey/0 (inherited), getDefaultValue/0 (inherited)
*/
class LongPreference extends AbsPreference<Long> {
@Override public Long get() {
return getPreferences().getLong(g... | true | ok | {"focal": {"class": "LongPreference", "name": "get", "signature": "Long get()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Long"}, "class_info": {"name": "LongPreference", "kind": "class", "modifiers": "", "superclass": "AbsPreference<Long>", "interfaces": null, "fields": [{"name": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.