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 |
|---|---|---|---|---|---|---|---|---|
91583905_213 | class SchemaHomology {
public boolean tablesMatch(Table table1, Table table2) {
noDifferences = true;
checkTable(table1, table2);
return noDifferences;
}
public SchemaHomology();
public SchemaHomology(DifferenceWriter differenceWriter);
public SchemaHomology(DifferenceWriter differenceWriter,... | assertFalse(schemaHomology.tablesMatch(pearTable, pearTableModifiedWidth));
}
} | [FOCAL] public boolean SchemaHomology.tablesMatch(Table table1, Table table2)
[CLASS] class SchemaHomology
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] void checkTable(Table table1, Table table2)
[DATAFLOW] noDifferences@L2->L4; table1@param->L3; table2@param->L3
[CLASS-MEMBERS]... | /* static context
[FOCAL] public boolean SchemaHomology.tablesMatch(Table table1, Table table2)
[CALLS-INTERNAL] void checkTable(Table table1, Table table2)
*/
| /* static context
[FOCAL] public boolean SchemaHomology.tablesMatch(Table table1, Table table2)
[CALLS-INTERNAL] void checkTable(Table table1, Table table2)
*/
class SchemaHomology {
public boolean tablesMatch(Table table1, Table table2) {
noDifferences = true;
checkTable(table1, table2);
return noDiffer... | true | ok | {"focal": {"class": "SchemaHomology", "name": "tablesMatch", "signature": "boolean tablesMatch(Table table1, Table table2)", "start_line": 3, "modifiers": "public", "params": [{"name": "table1", "type": "Table"}, {"name": "table2", "type": "Table"}], "return_type": "boolean"}, "class_info": {"name": "SchemaHomology", "... |
91584792_0 | class ByteArraySchema implements DeserializationSchema<byte[]>, SerializationSchema<byte[]> {
public TypeInformation<byte[]> getProducedType() { return PrimitiveArrayTypeInfo.BYTE_PRIMITIVE_ARRAY_TYPE_INFO; @Override
public TypeInformation<byte[]> getProducedType() { return PrimitiveArrayTypeInfo.BYTE_PRIMITIV... | final ByteArraySchema schema = new ByteArraySchema();
final ByteArraySchema copy = CommonTestUtils.createCopySerializable(schema);
assertEquals(schema.getProducedType(), copy.getProducedType());
}
} | [FOCAL] public TypeInformation<byte[]> ByteArraySchema.getProducedType()
[CLASS] class ByteArraySchema implements DeserializationSchema<byte[]>, SerializationSchema<byte[]>
[METRICS] loc=15 cc=1 branches=0 loops=0 returns=5 throws=0 nesting=0 | /* static context
[FOCAL] public TypeInformation<byte[]> ByteArraySchema.getProducedType()
*/
| /* static context
[FOCAL] public TypeInformation<byte[]> ByteArraySchema.getProducedType()
*/
class ByteArraySchema implements DeserializationSchema<byte[]>, SerializationSchema<byte[]> {
public TypeInformation<byte[]> getProducedType() { return PrimitiveArrayTypeInfo.BYTE_PRIMITIVE_ARRAY_TYPE_INFO; @Override
... | true | partial | {"focal": {"class": "ByteArraySchema", "name": "getProducedType", "signature": "TypeInformation<byte[]> getProducedType()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "TypeInformation<byte[]>"}, "class_info": {"name": "ByteArraySchema", "kind": "class", "modifiers": "", "superclass": null, "in... |
91595685_5 | class Sampler {
static Note extractMostFrequentNote(List<PitchDifference> samples) {
Map<Note, Integer> noteFrequencies = new HashMap<>();
for (PitchDifference pitchDifference : samples) {
Note closest = pitchDifference.closest;
if (noteFrequencies.containsKey(closest)) {
... | List<PitchDifference> samples = new ArrayList<>();
samples.add(new PitchDifference(G3, 2D));
samples.add(new PitchDifference(E2, 2D));
samples.add(new PitchDifference(B3, 3D));
samples.add(new PitchDifference(E2, 2D));
samples.add(new PitchDifference(B3, 3D));
N... | [FOCAL] static Note Sampler.extractMostFrequentNote(List<PitchDifference> samples)
[CLASS] class Sampler
[METRICS] loc=25 cc=5 branches=2 loops=2 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] Map<Note, Integer>.containsKey/1, Map<Note, Integer>.get/1, Map<Note, Integer>.put/2, Map<Note, Integer>.keySet/0
[NEW] HashMap<... | /* static context
[FOCAL] static Note Sampler.extractMostFrequentNote(List<PitchDifference> samples)
[PATH1] foreach(PitchDifference pitchDifference : samples)=T -> if(noteFrequencies.containsKey(closest))=T -> exit loop -> foreach(Note note : noteFrequencies.keySet())=T -> if(occurrences > mostOccurrences)=T -> exit l... | /* static context
[FOCAL] static Note Sampler.extractMostFrequentNote(List<PitchDifference> samples)
[PATH1] foreach(PitchDifference pitchDifference : samples)=T -> if(noteFrequencies.containsKey(closest))=T -> exit loop -> foreach(Note note : noteFrequencies.keySet())=T -> if(occurrences > mostOccurrences)=T -> exit l... | true | ok | {"focal": {"class": "Sampler", "name": "extractMostFrequentNote", "signature": "Note extractMostFrequentNote(List<PitchDifference> samples)", "start_line": 3, "modifiers": "static", "params": [{"name": "samples", "type": "List<PitchDifference>"}], "return_type": "Note"}, "class_info": {"name": "Sampler", "kind": "class... |
91663814_3 | class LoginPresenter extends BaseRxJavaPresenter<LoginContract.View> implements LoginContract.Presenter {
@Override
public void onEdtUserNameChanged(String userName) {
if (!TextUtil.isEmpty(userName)) {
mView.showClearUserNameButton();
} else {
mView.hideClearUserNameBut... | mLoginPresenter.onEdtUserNameChanged("a");
verify(mLoginView).showClearUserNameButton();
}
} | [FOCAL] @Override public void LoginPresenter.onEdtUserNameChanged(String userName)
[CLASS] class LoginPresenter extends BaseRxJavaPresenter<LoginContract.View> implements LoginContract.Presenter
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] TextUtil.isEmpty/1, mView.showClearUser... | /* static context
[FOCAL] @Override public void LoginPresenter.onEdtUserNameChanged(String userName)
[PATH1] if(!TextUtil.isEmpty(userName))=T
[PATH2] if(!TextUtil.isEmpty(userName))=F
[INPUTS] branches=userName | result=-
[COLLABORATORS] field mView showClearUserNameButton/0,hideClearUserNameButton/0
[CALLS-EXTERNAL] ... | /* static context
[FOCAL] @Override public void LoginPresenter.onEdtUserNameChanged(String userName)
[PATH1] if(!TextUtil.isEmpty(userName))=T
[PATH2] if(!TextUtil.isEmpty(userName))=F
[INPUTS] branches=userName | result=-
[COLLABORATORS] field mView showClearUserNameButton/0,hideClearUserNameButton/0
[CALLS-EXTERNAL] ... | true | ok | {"focal": {"class": "LoginPresenter", "name": "onEdtUserNameChanged", "signature": "void onEdtUserNameChanged(String userName)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "userName", "type": "String"}], "return_type": "void"}, "class_info": {"name": "LoginPresenter", "kind": "class", "modifi... |
91674936_332 | class ServletUtils {
static void setServletParameters(ServletContext servletContext) {
UploadConfig uploadConfig = new UploadConfig();
MultipartConfigElement multipartConfig = uploadConfig.toMultipartConfigElement();
if (multipartConfig == null) {
return;
}
File dir = createUploadDir(servl... | Map<String, ServletRegistration> servletRegistrations = new HashMap<>();
servletRegistrations.put("d1", d1);
servletRegistrations.put("d2", d2);
new Expectations() {
{
servletContext.getServletRegistrations();
result = servletRegistrations;
d1.getClassName();
result... | [FOCAL] static void ServletUtils.setServletParameters(ServletContext servletContext)
[CLASS] class ServletUtils
[METRICS] loc=20 cc=4 branches=2 loops=1 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] File createUploadDir(ServletContext servletContext, String location); List<ServletRegistration> findServletRegistrations(... | /* static context
[FOCAL] static void ServletUtils.setServletParameters(ServletContext servletContext)
[PATH1] if(multipartConfig == null)=F -> foreach(ServletRegistration servletRegistration : servlets)=T -> if(!Dynamic.class.isInstance(servletRegistration))=T -> exit loop
[PATH2] if(multipartConfig == null)=T -> retu... | /* static context
[FOCAL] static void ServletUtils.setServletParameters(ServletContext servletContext)
[PATH1] if(multipartConfig == null)=F -> foreach(ServletRegistration servletRegistration : servlets)=T -> if(!Dynamic.class.isInstance(servletRegistration))=T -> exit loop
[PATH2] if(multipartConfig == null)=T -> retu... | true | ok | {"focal": {"class": "ServletUtils", "name": "setServletParameters", "signature": "void setServletParameters(ServletContext servletContext)", "start_line": 3, "modifiers": "static", "params": [{"name": "servletContext", "type": "ServletContext"}], "return_type": "void"}, "class_info": {"name": "ServletUtils", "kind": "c... |
91725602_1 | class Castle {
public static boolean flushIfNeeded(String url) {
// Flush if request to whitelisted url
if (isUrlWhiteListed(url)) {
flush();
return true;
}
return false;
}
private Castle(Application application, CastleConfiguration castleConfigurat... | // Make sure flush is done for whitelisted base url
boolean flushed = Castle.flushIfNeeded("https://google.com/");
// FlushIfNeeded returns true if url is whitelisted and flush() is called
Assert.assertTrue(flushed);
// Make sure flush is NOT done for non whitelisted base url
... | [FOCAL] public static boolean Castle.flushIfNeeded(String url)
[CLASS] class Castle
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] boolean isUrlWhiteListed(String urlString); void flush()
[PATH1] if(isUrlWhiteListed(url))=T -> return true
[PATH2] if(isUrlWhiteListed(url))=F -> ret... | /* static context
[FOCAL] public static boolean Castle.flushIfNeeded(String url)
[PATH1] if(isUrlWhiteListed(url))=T -> return true
[PATH2] if(isUrlWhiteListed(url))=F -> return false
[INPUTS] branches=url | result=-
[CALLS-INTERNAL] boolean isUrlWhiteListed(String urlString); void flush()
*/
| /* static context
[FOCAL] public static boolean Castle.flushIfNeeded(String url)
[PATH1] if(isUrlWhiteListed(url))=T -> return true
[PATH2] if(isUrlWhiteListed(url))=F -> return false
[INPUTS] branches=url | result=-
[CALLS-INTERNAL] boolean isUrlWhiteListed(String urlString); void flush()
*/
class Castle {
public... | true | ok | {"focal": {"class": "Castle", "name": "flushIfNeeded", "signature": "boolean flushIfNeeded(String url)", "start_line": 3, "modifiers": "public static", "params": [{"name": "url", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "Castle", "kind": "class", "modifiers": "", "superclass": null, "interf... |
91826174_48 | class RRestoreBlobStrategy extends BaseRestoreBlobStrategy<RRestoreBlobData> {
@Override
protected Query getComponentQuery(final RRestoreBlobData data) throws IOException {
RRestoreFacet facet = getRestoreFacet(data);
RestoreBlobData blobData = data.getBlobData();
Map<String, String> attributes;
tr... | restoreBlobStrategy.getComponentQuery(rRestoreBlobData);
verify(rRestoreFacet, times(1)).getComponentQuery(anyMapOf(String.class, String.class));
}
} | [FOCAL] @Override protected Query RRestoreBlobStrategy.getComponentQuery(RRestoreBlobData data)
[CLASS] class RRestoreBlobStrategy extends BaseRestoreBlobStrategy<RRestoreBlobData>
[METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] RRestoreFacet getRestoreFacet(RRestoreBlobData rRest... | /* static context
[FOCAL] @Override protected Query RRestoreBlobStrategy.getComponentQuery(RRestoreBlobData data)
[INPUTS] branches=- | result=data
[COLLABORATORS] param data:RRestoreBlobData getBlobData/0
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] RRestoreFacet getRestoreFacet(RRestoreBlobData rRestoreBlobData... | /* static context
[FOCAL] @Override protected Query RRestoreBlobStrategy.getComponentQuery(RRestoreBlobData data)
[INPUTS] branches=- | result=data
[COLLABORATORS] param data:RRestoreBlobData getBlobData/0
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] RRestoreFacet getRestoreFacet(RRestoreBlobData rRestoreBlobData... | true | ok | {"focal": {"class": "RRestoreBlobStrategy", "name": "getComponentQuery", "signature": "Query getComponentQuery(RRestoreBlobData data) throws IOException", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "data", "type": "RRestoreBlobData"}], "return_type": "Query"}, "class_info": {"name": "RRest... |
91952715_2 | class FileTools {
public static File doChooseFile(String extension, String directory, String type) {
if (MainWindow.getInstance().getActiveProject() != null) {
File projectPath = new File(System.getProperty("project.path") + File.separator + directory);
if (projectPath.exists()) {
... | System.out.println("doChooseFile");
String extension = "";
String directory = "";
String type = "";
File expResult = null;
File result = FileTools.doChooseFile(extension, directory, type);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call... | [FOCAL] public static File FileTools.doChooseFile(String extension, String directory, String type)
[CLASS] class FileTools
[METRICS] loc=19 cc=4 branches=3 loops=0 returns=2 throws=0 nesting=3
[CALLS-EXTERNAL] MainWindow.getInstance().getActiveProject/0, MainWindow.getInstance/0, System.getProperty/1, File.exists/0, JF... | /* static context
[FOCAL] public static File FileTools.doChooseFile(String extension, String directory, String type)
[PATH1] if(MainWindow.getInstance().getActiveProject() != null)=T -> if(projectPath.exists())=T -> if(fileChooser.showOpenDialog(MainWindow.getInstance()) == JFileChooser.APPROVE_OPTION)=T -> return file... | /* static context
[FOCAL] public static File FileTools.doChooseFile(String extension, String directory, String type)
[PATH1] if(MainWindow.getInstance().getActiveProject() != null)=T -> if(projectPath.exists())=T -> if(fileChooser.showOpenDialog(MainWindow.getInstance()) == JFileChooser.APPROVE_OPTION)=T -> return file... | true | ok | {"focal": {"class": "FileTools", "name": "doChooseFile", "signature": "File doChooseFile(String extension, String directory, String type)", "start_line": 3, "modifiers": "public static", "params": [{"name": "extension", "type": "String"}, {"name": "directory", "type": "String"}, {"name": "type", "type": "String"}], "re... |
91956337_0 | class WXBizMsgCrypt {
String encrypt(String randomStr, String text) throws AesException {
ByteGroup byteCollector = new ByteGroup();
byte[] randomStrBytes = randomStr.getBytes(CHARSET);
byte[] textBytes = text.getBytes(CHARSET);
byte[] networkBytesOrder = getNetworkBytesOrder(textBytes.length);
byte[] appid... | try {
WXBizMsgCrypt pc = new WXBizMsgCrypt(token, encodingAesKey, appId);
assertEquals(afterAesEncrypt, pc.encrypt(randomStr, replyMsg));
} catch (AesException e) {
e.printStackTrace();
fail("no异常");
}
}
} | [FOCAL] String WXBizMsgCrypt.encrypt(String randomStr, String text)
[CLASS] class WXBizMsgCrypt
[METRICS] loc=43 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-INTERNAL] byte[] getNetworkBytesOrder(int sourceNumber)
[CALLS-EXTERNAL] String.getBytes/1, ByteGroup.addBytes/1, PKCS7Encoder.encode/1, ByteGroup.... | /* static context
[FOCAL] String WXBizMsgCrypt.encrypt(String randomStr, String text)
[THROWS-WHEN] AesException when try-body throws
[PATH1] try-body throws -> throw new AesException(AesException.EncryptAESError)
[PATH2] return base64Encrypted
[COLLABORATORS] field appId:String getBytes/1; field base64 encodeToString/... | /* static context
[FOCAL] String WXBizMsgCrypt.encrypt(String randomStr, String text)
[THROWS-WHEN] AesException when try-body throws
[PATH1] try-body throws -> throw new AesException(AesException.EncryptAESError)
[PATH2] return base64Encrypted
[COLLABORATORS] field appId:String getBytes/1; field base64 encodeToString/... | true | ok | {"focal": {"class": "WXBizMsgCrypt", "name": "encrypt", "signature": "String encrypt(String randomStr, String text) throws AesException", "start_line": 3, "modifiers": "", "params": [{"name": "randomStr", "type": "String"}, {"name": "text", "type": "String"}], "return_type": "String"}, "class_info": {"name": "WXBizMsgC... |
91984043_2 | class AvailableSegment extends Segment implements Serializable {
public void dataProvided(List<ITEM> items) {
if (items == null) {
dataProvided(items, 0);
} else {
dataProvided(items, getFrom() + items.size());
}
}
public AvailableSegment(UncoveringDataModel<?> model, int page);
publ... | AvailableSegment<TestItem> a = new AvailableSegment<>(model, 2);
assertNull(a.get(20));
assertNull(a.get(29));
assertNull(a.get(19));
assertNull(a.get(30));
assertEquals(0, a.getMaxIndex());
a.dataProvided(TestItem.range(20, 29));
assertEquals("p.20", a.get(20).toString());
assert... | [FOCAL] public void AvailableSegment.dataProvided(List<ITEM> items)
[CLASS] class AvailableSegment extends Segment implements Serializable
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] void dataProvided(List<ITEM> items, int maxIndex)
[CALLS-EXTERNAL] getFrom/0 (inherited), List<... | /* static context
[FOCAL] public void AvailableSegment.dataProvided(List<ITEM> items)
[PATH1] if(items == null)=T
[PATH2] if(items == null)=F
[INPUTS] branches=items | result=-
[COLLABORATORS] param items:List<ITEM> size/0
[CALLS-INTERNAL] void dataProvided(List<ITEM> items, int maxIndex)
[CALLS-EXTERNAL] getFrom/0 (in... | /* static context
[FOCAL] public void AvailableSegment.dataProvided(List<ITEM> items)
[PATH1] if(items == null)=T
[PATH2] if(items == null)=F
[INPUTS] branches=items | result=-
[COLLABORATORS] param items:List<ITEM> size/0
[CALLS-INTERNAL] void dataProvided(List<ITEM> items, int maxIndex)
[CALLS-EXTERNAL] getFrom/0 (in... | true | ok | {"focal": {"class": "AvailableSegment", "name": "dataProvided", "signature": "void dataProvided(List<ITEM> items)", "start_line": 3, "modifiers": "public", "params": [{"name": "items", "type": "List<ITEM>"}], "return_type": "void"}, "class_info": {"name": "AvailableSegment", "kind": "class", "modifiers": "", "superclas... |
91984923_2 | class TomorrowWeatherViewModel extends WeatherViewModel {
public void loadForecastWeatherDataForTomorrow()
{
Location lastKnownLocation = locationService.lastLocation();
if (lastKnownLocation != null)
{
double longitude = lastKnownLocation.getLongitude();
double ... | when(locationService.lastLocation()).thenReturn(null);
vm.onViewAttached();
vm.loadForecastWeatherDataForTomorrow();
verifyZeroInteractions(weatherService);
}
} | [FOCAL] public void TomorrowWeatherViewModel.loadForecastWeatherDataForTomorrow()
[CLASS] class TomorrowWeatherViewModel extends WeatherViewModel
[METRICS] loc=14 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] LocationService.lastLocation/0, Location.getLongitude/0, Location.getLatitude/0, dispat... | /* static context
[FOCAL] public void TomorrowWeatherViewModel.loadForecastWeatherDataForTomorrow()
[PATH1] if(lastKnownLocation != null)=T
[PATH2] if(lastKnownLocation != null)=F
[INPUTS] branches=locationService | result=-
[COLLABORATORS] field locationService:LocationService lastLocation/0; field weatherService:Weat... | /* static context
[FOCAL] public void TomorrowWeatherViewModel.loadForecastWeatherDataForTomorrow()
[PATH1] if(lastKnownLocation != null)=T
[PATH2] if(lastKnownLocation != null)=F
[INPUTS] branches=locationService | result=-
[COLLABORATORS] field locationService:LocationService lastLocation/0; field weatherService:Weat... | true | ok | {"focal": {"class": "TomorrowWeatherViewModel", "name": "loadForecastWeatherDataForTomorrow", "signature": "void loadForecastWeatherDataForTomorrow()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "TomorrowWeatherViewModel", "kind": "class", "modifiers": "", "supe... |
92027307_1 | class SyncTrigger {
public void check(){
check(false);
}
public SyncTrigger(DoThisWhenTriggered doThisWhenTriggered, CheckTriggerThreshold checkTriggerThreshold);
public SyncTrigger(DoThisWhenTriggered doThisWhenTriggered, CheckTriggerThreshold checkTriggerThreshold, ResetRule resetRule);
... |
SyncTrigger syncTrigger = new SyncTrigger(
() -> mockTrigger.triggered(),
() -> mockThreshold.shouldTrigger(),
ONLY_AFTER_REVERSION);
//no trigger
when(mockThreshold.shouldTrigger()).thenReturn(false);
syncTrigger.check();
verify(... | [FOCAL] public void SyncTrigger.check()
[CLASS] class SyncTrigger
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void check(boolean swallowTriggerForFirstCheck)
[CLASS-MEMBERS] SyncTrigger(DoThisWhenTriggered doThisWhenTriggered, CheckTriggerThreshold checkTriggerThreshold); SyncT... | /* static context
[FOCAL] public void SyncTrigger.check()
[CALLS-INTERNAL] void check(boolean swallowTriggerForFirstCheck)
*/
| /* static context
[FOCAL] public void SyncTrigger.check()
[CALLS-INTERNAL] void check(boolean swallowTriggerForFirstCheck)
*/
class SyncTrigger {
public void check(){
check(false);
}
public SyncTrigger(DoThisWhenTriggered doThisWhenTriggered, CheckTriggerThreshold checkTriggerThreshold);
publ... | true | ok | {"focal": {"class": "SyncTrigger", "name": "check", "signature": "void check()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "SyncTrigger", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "mockThreshold", "type": "Thr... |
92033442_103 | class XpathUtils {
public static Byte asByte(String expression, Node node)
throws XPathExpressionException {
String byteString = evaluateAsString(expression, node);
return (isEmptyString(byteString)) ? null : Byte.valueOf(byteString);
}
public static Document documentFrom(Input... | Document document = XpathUtils.documentFrom(DOCUMENT);
assertEquals(new Byte((byte) 123), XpathUtils.asByte("Foo/PositiveByte", document));
assertEquals(new Byte((byte) -99), XpathUtils.asByte("Foo/NegativeByte", document));
assertEquals(null, XpathUtils.asByte("Foo/Empty", document));
... | [FOCAL] public static Byte XpathUtils.asByte(String expression, Node node)
[CLASS] class XpathUtils
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String evaluateAsString(String expression, Node node); boolean isEmptyString(String s)
[CALLS-EXTERNAL] Byte.valueOf/1
[EXCEPTIONS] de... | /* static context
[FOCAL] public static Byte XpathUtils.asByte(String expression, Node node)
[INPUTS] branches=- | result=expression, node
[EXCEPTIONS] declares XPathExpressionException
[CALLS-INTERNAL] String evaluateAsString(String expression, Node node); boolean isEmptyString(String s)
[CALLS-EXTERNAL] Byte.valueOf/... | /* static context
[FOCAL] public static Byte XpathUtils.asByte(String expression, Node node)
[INPUTS] branches=- | result=expression, node
[EXCEPTIONS] declares XPathExpressionException
[CALLS-INTERNAL] String evaluateAsString(String expression, Node node); boolean isEmptyString(String s)
[CALLS-EXTERNAL] Byte.valueOf/... | true | ok | {"focal": {"class": "XpathUtils", "name": "asByte", "signature": "Byte asByte(String expression, Node node) throws XPathExpressionException", "start_line": 3, "modifiers": "public static", "params": [{"name": "expression", "type": "String"}, {"name": "node", "type": "Node"}], "return_type": "Byte"}, "class_info": {"nam... |
92062193_3 | class PeriodicRateGenerator implements RateGenerator {
@Override
public double getRate(long time) {
double valueInPeriod = normalizeValue(time);
double result = rateFunction(valueInPeriod);
LOGGER.trace("rateFunction returned: {} for value: {}", result, valueInPeriod);
return re... | // GIVEN
ConcretePeriodicRateGenerator periodicRateGenerator = new ConcretePeriodicRateGenerator(100);
// WHEN
double rate = periodicRateGenerator.getRate(TimeUnit.SECONDS.toNanos(399));
// THEN
Assert.assertEquals(99d, rate, DELTA);
}
} | [FOCAL] @Override public double PeriodicRateGenerator.getRate(long time)
[CLASS] class PeriodicRateGenerator implements RateGenerator
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] double normalizeValue(long time); double rateFunction(double value)
[CALLS-EXTERNAL] LOGGER.trace/3
... | /* static context
[FOCAL] @Override public double PeriodicRateGenerator.getRate(long time)
[INPUTS] branches=- | result=time
[CALLS-INTERNAL] double normalizeValue(long time); double rateFunction(double value)
[CALLS-EXTERNAL] LOGGER.trace/3
*/
| /* static context
[FOCAL] @Override public double PeriodicRateGenerator.getRate(long time)
[INPUTS] branches=- | result=time
[CALLS-INTERNAL] double normalizeValue(long time); double rateFunction(double value)
[CALLS-EXTERNAL] LOGGER.trace/3
*/
class PeriodicRateGenerator implements RateGenerator {
@Override
p... | true | ok | {"focal": {"class": "PeriodicRateGenerator", "name": "getRate", "signature": "double getRate(long time)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "time", "type": "long"}], "return_type": "double"}, "class_info": {"name": "PeriodicRateGenerator", "kind": "class", "modifiers": "", "superclas... |
92116596_22 | class LocalNotification implements ISerializable, IDeserializable {
public void deserialize(JSONObject jsonObject) {
if (jsonObject != null) {
code = jsonObject.optString("code", code);
tickerText = jsonObject.optString("tickerText", tickerText);
title = jsonObject.optSt... | try {
when(jsonObject.getJSONArray("actionData")).thenReturn(jsonArray);
when(jsonArray.length()).thenReturn(2);
when(jsonArray.getInt(0)).thenReturn(101);
when(jsonArray.getInt(1)).thenThrow(mock(JSONException.class));
getSubject().deserialize(jsonOb... | [FOCAL] public void LocalNotification.deserialize(JSONObject jsonObject)
[CLASS] class LocalNotification implements ISerializable, IDeserializable
[METRICS] loc=39 cc=4 branches=1 loops=1 returns=0 throws=0 nesting=3
[CALLS-EXTERNAL] JSONObject.optString/2, JSONObject.optBoolean/2, JSONObject.optInt/2, JSONObject.optLo... | /* static context
[FOCAL] public void LocalNotification.deserialize(JSONObject jsonObject)
[PATH1] if(jsonObject != null)=T -> for(i < dataLength)=T -> exit loop
[PATH2] if(jsonObject != null)=F
[PATH3] if(jsonObject != null)=T -> try-body throws
[PATH4] if(jsonObject != null)=T -> for(i < dataLength)=F
[INPUTS] branch... | /* static context
[FOCAL] public void LocalNotification.deserialize(JSONObject jsonObject)
[PATH1] if(jsonObject != null)=T -> for(i < dataLength)=T -> exit loop
[PATH2] if(jsonObject != null)=F
[PATH3] if(jsonObject != null)=T -> try-body throws
[PATH4] if(jsonObject != null)=T -> for(i < dataLength)=F
[INPUTS] branch... | true | ok | {"focal": {"class": "LocalNotification", "name": "deserialize", "signature": "void deserialize(JSONObject jsonObject)", "start_line": 3, "modifiers": "public", "params": [{"name": "jsonObject", "type": "JSONObject"}], "return_type": "void"}, "class_info": {"name": "LocalNotification", "kind": "class", "modifiers": "", ... |
92120027_58 | class SubStr {
public static String getSmallestAndLargest(String str, int k) {
if (str == null || str.length() < k || k <= 0) {
return "\n";
}
String smallest = str.substring(0, k);
String largest = smallest;
// Loop to check
for (int i = 1; i < str.len... | Map<String, String> mapIO = new HashMap<String, String>() {{
put("welcometojava", "ava\nwel");
}};
for (Map.Entry<String, String> io : mapIO.entrySet()) {
String ret = SubStr.getSmallestAndLargest(io.getKey(), 3);
Assert.assertEquals(io.getValue(), ret);
... | [FOCAL] public static String SubStr.getSmallestAndLargest(String str, int k)
[CLASS] class SubStr
[METRICS] loc=21 cc=5 branches=3 loops=1 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] String.length/0, String.substring/2, String.compareTo/1
[PATH1] if(str == null || str.length() < k || k <= 0)=F -> for(i < str.length()... | /* static context
[FOCAL] public static String SubStr.getSmallestAndLargest(String str, int k)
[PATH1] if(str == null || str.length() < k || k <= 0)=F -> for(i < str.length() - k + 1)=T -> if(smallest.compareTo(sub) > 0)=T -> if(largest.compareTo(sub) < 0)=T -> exit loop -> return smallest + "\n" + largest
[PATH2] if(s... | /* static context
[FOCAL] public static String SubStr.getSmallestAndLargest(String str, int k)
[PATH1] if(str == null || str.length() < k || k <= 0)=F -> for(i < str.length() - k + 1)=T -> if(smallest.compareTo(sub) > 0)=T -> if(largest.compareTo(sub) < 0)=T -> exit loop -> return smallest + "\n" + largest
[PATH2] if(s... | true | ok | {"focal": {"class": "SubStr", "name": "getSmallestAndLargest", "signature": "String getSmallestAndLargest(String str, int k)", "start_line": 3, "modifiers": "public static", "params": [{"name": "str", "type": "String"}, {"name": "k", "type": "int"}], "return_type": "String"}, "class_info": {"name": "SubStr", "kind": "c... |
92150440_1 | class HookMetadataParser {
SortedSet<HookMetadata> parse() throws IOException, ClassNotFoundException {
return parse(className -> true); // Parse all classes found in the JAR files.
}
public HookMetadataParser(Collection<Path> hookJars);
public SortedSet<HookMetadata> parse(Predicate<String>... | String expected = PrimitiveTypesTestHook.class.getName() + " instruments [com.example.Some]:\n" +
" * arrayArgs(java.lang.Object[], int[], java.lang.String[])\n" +
" * boxedArgs(java.lang.Boolean, java.lang.Character, java.lang.Byte, java.lang.Short, java.lang.Integer, java.lan... | [FOCAL] SortedSet<HookMetadata> HookMetadataParser.parse()
[CLASS] class HookMetadataParser
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] SortedSet<HookMetadata> parse(Predicate<String> classNameFilter)
[EXCEPTIONS] declares IOException, ClassNotFoundException
[CLASS-MEMBERS] Hoo... | /* static context
[FOCAL] SortedSet<HookMetadata> HookMetadataParser.parse()
[EXCEPTIONS] declares IOException, ClassNotFoundException
[CALLS-INTERNAL] SortedSet<HookMetadata> parse(Predicate<String> classNameFilter)
*/
| /* static context
[FOCAL] SortedSet<HookMetadata> HookMetadataParser.parse()
[EXCEPTIONS] declares IOException, ClassNotFoundException
[CALLS-INTERNAL] SortedSet<HookMetadata> parse(Predicate<String> classNameFilter)
*/
class HookMetadataParser {
SortedSet<HookMetadata> parse() throws IOException, ClassNotFoundExc... | true | ok | {"focal": {"class": "HookMetadataParser", "name": "parse", "signature": "SortedSet<HookMetadata> parse() throws IOException, ClassNotFoundException", "start_line": 3, "modifiers": "", "params": [], "return_type": "SortedSet<HookMetadata>"}, "class_info": {"name": "HookMetadataParser", "kind": "class", "modifiers": "", ... |
92184534_26 | class Fork implements IFork {
@Override
public boolean isPassed(int timestamp) {
return items.getFirst().isPassed(timestamp);
}
public Fork(BlockID genesisBlockID, ForkItem[] items, String beginAll);
public Fork(BlockID genesisBlockID, ForkItem[] items);
public Fork(BlockID genesisB... | assertFalse("Before fork", forkState.isPassed(50));
assertFalse("Fork started", forkState.isPassed(100));
assertFalse("On fork", forkState.isPassed(150));
assertFalse("Fork ended", forkState.isPassed(200));
assertTrue("After fork", forkState.isPassed(250));
}
} | [FOCAL] @Override public boolean Fork.isPassed(int timestamp)
[CLASS] class Fork implements IFork
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] items.getFirst().isPassed/1, items.getFirst/0
[INPUTS] branches=- | result=timestamp
[COLLABORATORS] field items getFirst/0
[DATAFLOW] t... | /* static context
[FOCAL] @Override public boolean Fork.isPassed(int timestamp)
[INPUTS] branches=- | result=timestamp
[COLLABORATORS] field items getFirst/0
[CALLS-EXTERNAL] items.getFirst().isPassed/1, items.getFirst/0
*/
| /* static context
[FOCAL] @Override public boolean Fork.isPassed(int timestamp)
[INPUTS] branches=- | result=timestamp
[COLLABORATORS] field items getFirst/0
[CALLS-EXTERNAL] items.getFirst().isPassed/1, items.getFirst/0
*/
class Fork implements IFork {
@Override
public boolean isPassed(int timestamp) {
... | true | ok | {"focal": {"class": "Fork", "name": "isPassed", "signature": "boolean isPassed(int timestamp)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "timestamp", "type": "int"}], "return_type": "boolean"}, "class_info": {"name": "Fork", "kind": "class", "modifiers": "", "superclass": null, "interfaces"... |
92225522_5 | class Queue {
void append(@NonNull MobileEventJson event) {
long now = Time.now();
if (event.userId == null) {
event.userId = userIdProvider.getUserId();
}
if (this.config.acceptSameEventAfter > 0 &&
state.lastEvent != null &&
now < stat... | Queue.UploadRequester uploadRequester = mock(Queue.UploadRequester.class);
Queue queue = new Queue(null, USER_ID_PROVIDER, uploadRequester,
new Queue.Config.Builder()
.withUploadWhenMoreThan(5)
.withUploadWhenOlderThan(10000)
... | [FOCAL] void Queue.append(MobileEventJson event)
[CLASS] class Queue
[METRICS] loc=24 cc=4 branches=3 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] List<MobileEventJson> flush(); boolean isReadyForUpload(long now)
[CALLS-EXTERNAL] Time.now/0, userIdProvider.getUserId/0, Utils.eventsAreBasicallyEqual/2, Log.d/2,... | /* static context
[FOCAL] void Queue.append(MobileEventJson event)
[PATH1] if(event.userId == null)=T -> if((this.config.acceptSameEventAfter > 0 && state.lastEvent != null && now < state.lastEvent.time + this.config.acceptSa...)=T -> return
[PATH2] if(event.userId == null)=F -> if((this.config.acceptSameEventAfter > 0... | /* static context
[FOCAL] void Queue.append(MobileEventJson event)
[PATH1] if(event.userId == null)=T -> if((this.config.acceptSameEventAfter > 0 && state.lastEvent != null && now < state.lastEvent.time + this.config.acceptSa...)=T -> return
[PATH2] if(event.userId == null)=F -> if((this.config.acceptSameEventAfter > 0... | true | ok | {"focal": {"class": "Queue", "name": "append", "signature": "void append(MobileEventJson event)", "start_line": 3, "modifiers": "", "params": [{"name": "event", "type": "MobileEventJson"}], "return_type": "void"}, "class_info": {"name": "Queue", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, ... |
92269851_15 | class SentinelVersion {
public boolean greaterThan(SentinelVersion version) {
if (version == null) {
return true;
}
return getFullVersion() > version.getFullVersion();
}
public SentinelVersion();
public SentinelVersion(int major, int minor, int fix);
public S... | assertTrue(new SentinelVersion(2, 0, 0).greaterThan(new SentinelVersion(1, 0, 0)));
assertTrue(new SentinelVersion(1, 1, 0).greaterThan(new SentinelVersion(1, 0, 0)));
assertTrue(new SentinelVersion(1, 1, 2).greaterThan(new SentinelVersion(1, 1, 0)));
assertTrue(new SentinelVersion(1, 1,... | [FOCAL] public boolean SentinelVersion.greaterThan(SentinelVersion version)
[CLASS] class SentinelVersion
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] int getFullVersion()
[CALLS-EXTERNAL] SentinelVersion.getFullVersion/0
[PATH1] if(version == null)=T -> return true
[PATH2] if(v... | /* static context
[FOCAL] public boolean SentinelVersion.greaterThan(SentinelVersion version)
[PATH1] if(version == null)=T -> return true
[PATH2] if(version == null)=F -> return getFullVersion() > version.getFullVersion()
[INPUTS] branches=version | result=version
[COLLABORATORS] param version:SentinelVersion getFullV... | /* static context
[FOCAL] public boolean SentinelVersion.greaterThan(SentinelVersion version)
[PATH1] if(version == null)=T -> return true
[PATH2] if(version == null)=F -> return getFullVersion() > version.getFullVersion()
[INPUTS] branches=version | result=version
[COLLABORATORS] param version:SentinelVersion getFullV... | true | ok | {"focal": {"class": "SentinelVersion", "name": "greaterThan", "signature": "boolean greaterThan(SentinelVersion version)", "start_line": 3, "modifiers": "public", "params": [{"name": "version", "type": "SentinelVersion"}], "return_type": "boolean"}, "class_info": {"name": "SentinelVersion", "kind": "class", "modifiers"... |
92312271_14 | class SenseHatColor {
public static SenseHatColor fromRGB(int red, int green, int blue) {
short r = (short) ((red >> 3) & 0b11111);
short g = (short) ((green >> 2) & 0b111111);
short b = (short) ((blue >> 3) & 0b11111);
return new SenseHatColor(r, g, b);
}
SenseHatColor(... | assertThat(SenseHatColor.fromRGB(0f ,0f, 1f).getSenseHatColor()).isEqualTo(0x001F);
}
} | [FOCAL] public static SenseHatColor SenseHatColor.fromRGB(int red, int green, int blue)
[CLASS] class SenseHatColor
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] SenseHatColor
[INPUTS] branches=- | result=blue, green, red
[DATAFLOW] b@L4->L6; blue@param->L4; g@L3->L6; green@param->L3; r@L2-... | /* static context
[FOCAL] public static SenseHatColor SenseHatColor.fromRGB(int red, int green, int blue)
[INPUTS] branches=- | result=blue, green, red
[NEW] SenseHatColor
*/
| /* static context
[FOCAL] public static SenseHatColor SenseHatColor.fromRGB(int red, int green, int blue)
[INPUTS] branches=- | result=blue, green, red
[NEW] SenseHatColor
*/
class SenseHatColor {
public static SenseHatColor fromRGB(int red, int green, int blue) {
short r = (short) ((red >> 3) & 0b11111);
... | true | ok | {"focal": {"class": "SenseHatColor", "name": "fromRGB", "signature": "SenseHatColor fromRGB(int red, int green, int blue)", "start_line": 3, "modifiers": "public static", "params": [{"name": "red", "type": "int"}, {"name": "green", "type": "int"}, {"name": "blue", "type": "int"}], "return_type": "SenseHatColor"}, "clas... |
92362395_119 | class ConfigUtils {
public static Properties loadProperties(String fileName) {
return loadProperties(fileName, false, false);
}
private ConfigUtils();
public static boolean isNotEmpty(String value);
public static boolean isEmpty(String value);
public static boolean isDefault(String v... | Properties p = ConfigUtils.loadProperties("notExisted", true);
Properties expected = new Properties();
Assert.assertEquals(expected, p);
p = ConfigUtils.loadProperties("notExisted", false);
Assert.assertEquals(expected, p);
}
} | [FOCAL] public static Properties ConfigUtils.loadProperties(String fileName)
[CLASS] class ConfigUtils
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Properties loadProperties(String fileName, boolean allowMultiFile, boolean optional)
[INPUTS] branches=- | result=fileName
[DATAFLO... | /* static context
[FOCAL] public static Properties ConfigUtils.loadProperties(String fileName)
[INPUTS] branches=- | result=fileName
[CALLS-INTERNAL] Properties loadProperties(String fileName, boolean allowMultiFile, boolean optional)
*/
| /* static context
[FOCAL] public static Properties ConfigUtils.loadProperties(String fileName)
[INPUTS] branches=- | result=fileName
[CALLS-INTERNAL] Properties loadProperties(String fileName, boolean allowMultiFile, boolean optional)
*/
class ConfigUtils {
public static Properties loadProperties(String fileName) ... | true | ok | {"focal": {"class": "ConfigUtils", "name": "loadProperties", "signature": "Properties loadProperties(String fileName)", "start_line": 3, "modifiers": "public static", "params": [{"name": "fileName", "type": "String"}], "return_type": "Properties"}, "class_info": {"name": "ConfigUtils", "kind": "class", "modifiers": "",... |
92375988_132 | class ProxyDestructor implements CancellableCleanAction<Class<?>> {
@Override
public void clean() {
if (destroyed || cancelled) {
return;
}
destroyed = true;
// Do not perform the destructor if the native handle is not valid.
if (!nativeHandle.isValid()) {
return;
}
long ... | long rawNativeHandle = 1L;
NativeHandle handle = spy(new NativeHandle(rawNativeHandle));
LongConsumer destructor = mock(LongConsumer.class);
ProxyDestructor d = newDestructor(handle, destructor);
// Clean multiple times.
int attemptsToClean = 3;
for (int i = 0; i < attemptsToClean; i++) {
... | [FOCAL] @Override public void ProxyDestructor.clean()
[CLASS] class ProxyDestructor implements CancellableCleanAction<Class<?>>
[METRICS] loc=21 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] nativeHandle.isValid/0, nativeHandle.get/0, nativeHandle.close/0, cleanFunction.accept/1
[PATH1] if(destr... | /* static context
[FOCAL] @Override public void ProxyDestructor.clean()
[PATH1] if(destroyed || cancelled)=F -> if(!nativeHandle.isValid())=T -> return
[PATH2] if(destroyed || cancelled)=T -> return
[PATH3] if(destroyed || cancelled)=F -> if(!nativeHandle.isValid())=F
[COLLABORATORS] field nativeHandle isValid/0,get/0,... | /* static context
[FOCAL] @Override public void ProxyDestructor.clean()
[PATH1] if(destroyed || cancelled)=F -> if(!nativeHandle.isValid())=T -> return
[PATH2] if(destroyed || cancelled)=T -> return
[PATH3] if(destroyed || cancelled)=F -> if(!nativeHandle.isValid())=F
[COLLABORATORS] field nativeHandle isValid/0,get/0,... | true | ok | {"focal": {"class": "ProxyDestructor", "name": "clean", "signature": "void clean()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "ProxyDestructor", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "CancellableCleanAction<Class<?>>", "... |
92377986_4 | class RegisterViewModel extends BaseViewModel {
protected boolean isLoginValid() {
boolean valid = true;
if (mLoginValidator != null && !mLoginValidator.isValid(mLogin.get())) {
mLoginError.set(mViewAccess.getLoginErrorMessage());
valid = false;
} else {
... | when(mModel.mLoginValidator.isValid(any())).thenReturn(false);
when(mModel.mViewAccess.getLoginErrorMessage()).thenReturn("error");
assertThat(mModel.isLoginValid(), is(false));
assertThat(Strings.isNullOrEmpty(mModel.mLoginError.get()), is(false));
}
} | [FOCAL] protected boolean RegisterViewModel.isLoginValid()
[CLASS] class RegisterViewModel extends BaseViewModel
[METRICS] loc=12 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] mLoginValidator.isValid/1, mLogin.get/0, mLoginError.set/1, mViewAccess.getLoginErrorMessage/0
[PATH1] if(mLoginValidato... | /* static context
[FOCAL] protected boolean RegisterViewModel.isLoginValid()
[PATH1] if(mLoginValidator != null && !mLoginValidator.isValid(mLogin.get()))=T -> return valid
[PATH2] if(mLoginValidator != null && !mLoginValidator.isValid(mLogin.get()))=F -> return valid
[COLLABORATORS] field mLoginValidator isValid/1; fi... | /* static context
[FOCAL] protected boolean RegisterViewModel.isLoginValid()
[PATH1] if(mLoginValidator != null && !mLoginValidator.isValid(mLogin.get()))=T -> return valid
[PATH2] if(mLoginValidator != null && !mLoginValidator.isValid(mLogin.get()))=F -> return valid
[COLLABORATORS] field mLoginValidator isValid/1; fi... | true | ok | {"focal": {"class": "RegisterViewModel", "name": "isLoginValid", "signature": "boolean isLoginValid()", "start_line": 3, "modifiers": "protected", "params": [], "return_type": "boolean"}, "class_info": {"name": "RegisterViewModel", "kind": "class", "modifiers": "", "superclass": "BaseViewModel", "interfaces": null, "fi... |
92469890_21 | class TimeUtils {
public static Date getNowDate() {
return new Date();
}
private TimeUtils();
public static String millis2String(long millis);
public static String millis2String(long millis, DateFormat format);
public static long string2Millis(String time);
public static long str... | assertEquals(System.currentTimeMillis(), TimeUtils.date2Millis(TimeUtils.getNowDate()), delta);
}
} | [FOCAL] public static Date TimeUtils.getNowDate()
[CLASS] class TimeUtils
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] Date
[CLASS-MEMBERS] TimeUtils(); String millis2String(long millis); String millis2String(long millis, DateFormat format); long string2Millis(String time); long string2Mil... | /* static context
[FOCAL] public static Date TimeUtils.getNowDate()
[NEW] Date
*/
| /* static context
[FOCAL] public static Date TimeUtils.getNowDate()
[NEW] Date
*/
class TimeUtils {
public static Date getNowDate() {
return new Date();
}
private TimeUtils();
public static String millis2String(long millis);
public static String millis2String(long millis, DateFormat form... | true | ok | {"focal": {"class": "TimeUtils", "name": "getNowDate", "signature": "Date getNowDate()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Date"}, "class_info": {"name": "TimeUtils", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "defaultFormat",... |
92486066_10 | class BuildEventHandler implements EventHandler {
@Override
public void processEvents(final List<Event> eventList, final Set<String> dashboardIds) {
final List<String> ids = eventList.stream()
.map(Event::getCollectionId)
.map(String.class::cast)
.collect(Collectors.... | final Dashboard dashboard1 = new Dashboard()
.setName("dashboard1")
.setCodeRepos(Arrays.asList("http://repo1.git", "http://repo2.git"));
final Dashboard dashboard2 = new Dashboard()
.setName("dashboard2")
.setCodeRepos(Arrays.asList(".*repo3.*", "http://r... | [FOCAL] @Override public void BuildEventHandler.processEvents(List<Event> eventList, Set<String> dashboardIds)
[CLASS] class BuildEventHandler implements EventHandler
[METRICS] loc=36 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=2
[CALLS-EXTERNAL] eventList.stream() .map(Event::getCollectionId) .map(Stri....colle... | /* static context
[FOCAL] @Override public void BuildEventHandler.processEvents(List<Event> eventList, Set<String> dashboardIds)
[PATH1] if(ids.contains(null))=T
[PATH2] if(ids.contains(null))=F
[INPUTS] branches=eventList | result=-
[COLLABORATORS] param eventList:List<Event> stream/0; field connectionHandler:Connecti... | /* static context
[FOCAL] @Override public void BuildEventHandler.processEvents(List<Event> eventList, Set<String> dashboardIds)
[PATH1] if(ids.contains(null))=T
[PATH2] if(ids.contains(null))=F
[INPUTS] branches=eventList | result=-
[COLLABORATORS] param eventList:List<Event> stream/0; field connectionHandler:Connecti... | true | ok | {"focal": {"class": "BuildEventHandler", "name": "processEvents", "signature": "void processEvents(List<Event> eventList, Set<String> dashboardIds)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "eventList", "type": "List<Event>"}, {"name": "dashboardIds", "type": "Set<String>"}], "return_type"... |
92500825_0 | class DataServiceBase implements TableDataService {
@Override
public List<Map<String, String>> getPageEntries(PaginationCriteria paginationCriteria) throws TableDataException {
List<T> data = getData(paginationCriteria);
log.debug("Table data retrieved...");
List<Map<String, String>> r... | List<Map<String, String>> data = dataService.getPageEntries(null);
assertEquals(5, data.size());
assertEquals("Lisa", data.get(0).get("name"));
assertEquals("2", data.get(1).get("id"));
assertEquals("38", data.get(2).get("age"));
}
} | [FOCAL] @Override public List<Map<String, String>> DataServiceBase.getPageEntries(PaginationCriteria paginationCriteria)
[CLASS] class DataServiceBase implements TableDataService
[METRICS] loc=19 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-INTERNAL] List<T> getData(PaginationCriteria paginationCriteria)... | /* static context
[FOCAL] @Override public List<Map<String, String>> DataServiceBase.getPageEntries(PaginationCriteria paginationCriteria)
[THROWS-WHEN] TableDataException when try-body throws
[PATH1] try-body throws -> throw new TableDataException("", e)
[PATH2] return records
[INPUTS] branches=- | result=paginationCr... | /* static context
[FOCAL] @Override public List<Map<String, String>> DataServiceBase.getPageEntries(PaginationCriteria paginationCriteria)
[THROWS-WHEN] TableDataException when try-body throws
[PATH1] try-body throws -> throw new TableDataException("", e)
[PATH2] return records
[INPUTS] branches=- | result=paginationCr... | true | ok | {"focal": {"class": "DataServiceBase", "name": "getPageEntries", "signature": "List<Map<String, String>> getPageEntries(PaginationCriteria paginationCriteria) throws TableDataException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "paginationCriteria", "type": "PaginationCriteria"}], "return_t... |
92515991_163 | class ChainedFailedMessageAction implements FailedMessageAction {
@Override
public void accept(FailedMessage failedMessage) {
actions.forEach(action -> action.accept(failedMessage));
}
public ChainedFailedMessageAction(@JsonProperty("actions") List<FailedMessageAction> actions);
@Overrid... | ChainedFailedMessageAction underTest = new ChainedFailedMessageAction(Arrays.asList(
failedMessageAction1, failedMessageAction2
));
underTest.accept(failedMessage);
verify(failedMessageAction1).accept(failedMessage);
verify(failedMessageAction2).accept(failedMes... | [FOCAL] @Override public void ChainedFailedMessageAction.accept(FailedMessage failedMessage)
[CLASS] class ChainedFailedMessageAction implements FailedMessageAction
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] actions.forEach/1, action.accept/1
[COLLABORATORS] field actions forE... | /* static context
[FOCAL] @Override public void ChainedFailedMessageAction.accept(FailedMessage failedMessage)
[COLLABORATORS] field actions forEach/1; field action accept/1
[CALLS-EXTERNAL] actions.forEach/1, action.accept/1
*/
| /* static context
[FOCAL] @Override public void ChainedFailedMessageAction.accept(FailedMessage failedMessage)
[COLLABORATORS] field actions forEach/1; field action accept/1
[CALLS-EXTERNAL] actions.forEach/1, action.accept/1
*/
class ChainedFailedMessageAction implements FailedMessageAction {
@Override
public... | true | ok | {"focal": {"class": "ChainedFailedMessageAction", "name": "accept", "signature": "void accept(FailedMessage failedMessage)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "failedMessage", "type": "FailedMessage"}], "return_type": "void"}, "class_info": {"name": "ChainedFailedMessageAction", "kin... |
92536940_1 | class CircularBuffer {
@SuppressWarnings("unchecked")
public T getItem(int index) {
int target = head - index;
if (target < 0) target = queue.length + target;
return (T) queue[target];
}
public CircularBuffer(int size);
public void enqueue(T item);
public int size();
... | CircularBuffer<Integer> queue = new CircularBuffer<>(3);
queue.enqueue(0);
assertEquals((Integer) 0, queue.getItem(0));
queue.enqueue(1);
assertEquals((Integer) 1, queue.getItem(0));
assertEquals((Integer) 0, queue.getItem(1));
queue.enqueue(2);
assertEqua... | [FOCAL] @SuppressWarnings("unchecked") public T CircularBuffer.getItem(int index)
[CLASS] class CircularBuffer
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[PATH1] if(target < 0)=T -> return (T) queue[target]
[PATH2] if(target < 0)=F -> return (T) queue[target]
[INPUTS] branches=index | result=i... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public T CircularBuffer.getItem(int index)
[PATH1] if(target < 0)=T -> return (T) queue[target]
[PATH2] if(target < 0)=F -> return (T) queue[target]
[INPUTS] branches=index | result=index
*/
| /* static context
[FOCAL] @SuppressWarnings("unchecked") public T CircularBuffer.getItem(int index)
[PATH1] if(target < 0)=T -> return (T) queue[target]
[PATH2] if(target < 0)=F -> return (T) queue[target]
[INPUTS] branches=index | result=index
*/
class CircularBuffer {
@SuppressWarnings("unchecked")
public T ... | true | ok | {"focal": {"class": "CircularBuffer", "name": "getItem", "signature": "T getItem(int index)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public", "params": [{"name": "index", "type": "int"}], "return_type": "T"}, "class_info": {"name": "CircularBuffer", "kind": "class", "modifiers": "", "superclass... |
92611668_3 | class KubeCloudClient implements CloudClientEx {
@Override
public boolean canStartNewInstance(@NotNull CloudImage cloudImage) {
KubeCloudImage kubeCloudImage = (KubeCloudImage) cloudImage;
String kubeCloudImageId = kubeCloudImage.getId();
if(!myImageIdToImageMap.containsKey(kubeCloudIma... | KubeCloudImage image = m.mock(KubeCloudImage.class);
m.checking(new Expectations(){{
allowing(image).getName(); will(returnValue("image-1-name"));
allowing(image).getId(); will(returnValue("image-1-id"));
allowing(image).getRunningInstanceCount(); will(returnValue(0))... | [FOCAL] @Override public boolean KubeCloudClient.canStartNewInstance(CloudImage cloudImage)
[CLASS] class KubeCloudClient implements CloudClientEx
[METRICS] loc=15 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[CALLS-EXTERNAL] KubeCloudImage.getId/0, myImageIdToImageMap.containsKey/1, LOG.debug/1, myKubeClientPa... | /* static context
[FOCAL] @Override public boolean KubeCloudClient.canStartNewInstance(CloudImage cloudImage)
[PATH1] if(!myImageIdToImageMap.containsKey(kubeCloudImageId))=F -> if((profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount)...)=T -> return false... | /* static context
[FOCAL] @Override public boolean KubeCloudClient.canStartNewInstance(CloudImage cloudImage)
[PATH1] if(!myImageIdToImageMap.containsKey(kubeCloudImageId))=F -> if((profileInstanceLimit >= 0 && myImageIdToImageMap.values().stream().mapToInt(KubeCloudImage::getRunningInstanceCount)...)=T -> return false... | true | ok | {"focal": {"class": "KubeCloudClient", "name": "canStartNewInstance", "signature": "boolean canStartNewInstance(CloudImage cloudImage)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "cloudImage", "type": "CloudImage"}], "return_type": "boolean"}, "class_info": {"name": "KubeCloudClient", "kind"... |
92615561_5 | class BoltCursor implements AutoCloseable {
public BoltKeyValue next() {
try(KeyValue.ByValue keyValue = BoltNative.BoltDBCursor_Next(objectId)) {
return keyValue.hasKeyValue() ? new BoltKeyValue(keyValue.getKey(), keyValue.getValue()) : null;
}
}
public BoltCursor(long object... | try(Bolt bolt = new Bolt(testFolder.newFile().getAbsolutePath())) {
bolt.update(boltTransaction -> {
try (BoltBucket ignored1 = boltTransaction.createBucket("test1".getBytes())) {
try (BoltBucket ignored2 = boltTransaction.createBucket("test2".getBytes())) {
... | [FOCAL] public BoltKeyValue BoltCursor.next()
[CLASS] class BoltCursor implements AutoCloseable
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] BoltNative.BoltDBCursor_Next/1, KeyValue.ByValue.hasKeyValue/0, KeyValue.ByValue.getKey/0, KeyValue.ByValue.getValue/0
[NEW] BoltKeyValue
... | /* static context
[FOCAL] public BoltKeyValue BoltCursor.next()
[NEW] BoltKeyValue
[CALLS-EXTERNAL] BoltNative.BoltDBCursor_Next/1, KeyValue.ByValue.hasKeyValue/0, KeyValue.ByValue.getKey/0, KeyValue.ByValue.getValue/0
*/
| /* static context
[FOCAL] public BoltKeyValue BoltCursor.next()
[NEW] BoltKeyValue
[CALLS-EXTERNAL] BoltNative.BoltDBCursor_Next/1, KeyValue.ByValue.hasKeyValue/0, KeyValue.ByValue.getKey/0, KeyValue.ByValue.getValue/0
*/
class BoltCursor implements AutoCloseable {
public BoltKeyValue next() {
try(KeyValue... | true | ok | {"focal": {"class": "BoltCursor", "name": "next", "signature": "BoltKeyValue next()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "BoltKeyValue"}, "class_info": {"name": "BoltCursor", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "AutoCloseable", "fields": [{"name": "testF... |
92632486_1 | class TableStats {
public int estimateTableCardinality(double selectivityFactor) {
// some code goes here
return (int) Math.ceil(totalTuples() * selectivityFactor);
}
public TableStats(int tableid, int ioCostPerPage);
public static TableStats getTableStats(String tablename);
publ... | TableStats s = new TableStats(this.tableId, IO_COST);
// Try a random selectivity
Assert.assertEquals(306, s.estimateTableCardinality(0.3));
// Make sure we get all rows with 100% selectivity, and none with 0%
Assert.assertEquals(1020, s.estimateTableCardinality(1.0));
Assert.assertEquals(0, s.estimat... | [FOCAL] public int TableStats.estimateTableCardinality(double selectivityFactor)
[CLASS] class TableStats
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] int totalTuples()
[CALLS-EXTERNAL] Math.ceil/1
[INPUTS] branches=- | result=selectivityFactor
[DATAFLOW] selectivityFactor@param... | /* static context
[FOCAL] public int TableStats.estimateTableCardinality(double selectivityFactor)
[INPUTS] branches=- | result=selectivityFactor
[CALLS-INTERNAL] int totalTuples()
[CALLS-EXTERNAL] Math.ceil/1
*/
| /* static context
[FOCAL] public int TableStats.estimateTableCardinality(double selectivityFactor)
[INPUTS] branches=- | result=selectivityFactor
[CALLS-INTERNAL] int totalTuples()
[CALLS-EXTERNAL] Math.ceil/1
*/
class TableStats {
public int estimateTableCardinality(double selectivityFactor) {
// some cod... | true | ok | {"focal": {"class": "TableStats", "name": "estimateTableCardinality", "signature": "int estimateTableCardinality(double selectivityFactor)", "start_line": 3, "modifiers": "public", "params": [{"name": "selectivityFactor", "type": "double"}], "return_type": "int"}, "class_info": {"name": "TableStats", "kind": "class", "... |
92746837_311 | class MetadataReportBuilder extends AbstractBuilder<MetadataReportConfig, MetadataReportBuilder> {
public MetadataReportBuilder address(String address) {
this.address = address;
return getThis();
}
public MetadataReportBuilder username(String username);
public MetadataReportBuilder pas... | MetadataReportBuilder builder = new MetadataReportBuilder();
builder.address("address");
Assertions.assertEquals("address", builder.build().getAddress());
}
} | [FOCAL] public MetadataReportBuilder MetadataReportBuilder.address(String address)
[CLASS] class MetadataReportBuilder extends AbstractBuilder<MetadataReportConfig, MetadataReportBuilder>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] MetadataReportBuilder getThis()
[FIELDS] write... | /* static context
[FOCAL] public MetadataReportBuilder MetadataReportBuilder.address(String address)
[STATE] address
[CALLS-INTERNAL] MetadataReportBuilder getThis()
[FIELDS] write=address
*/
| /* static context
[FOCAL] public MetadataReportBuilder MetadataReportBuilder.address(String address)
[STATE] address
[CALLS-INTERNAL] MetadataReportBuilder getThis()
[FIELDS] write=address
*/
class MetadataReportBuilder extends AbstractBuilder<MetadataReportConfig, MetadataReportBuilder> {
public MetadataReportBui... | true | ok | {"focal": {"class": "MetadataReportBuilder", "name": "address", "signature": "MetadataReportBuilder address(String address)", "start_line": 3, "modifiers": "public", "params": [{"name": "address", "type": "String"}], "return_type": "MetadataReportBuilder"}, "class_info": {"name": "MetadataReportBuilder", "kind": "class... |
92755785_4 | class EmailValidator {
public boolean isValid(CharSequence email) {
return email != null && EMAIL_ADDRESS.matcher(email).matches();
}
public Observable<Boolean> checkEmail(CharSequence email);
EmailValidator tested;
}
class EmailValidatorTest {
EmailValidator tested;
@Test
public void should_... | assertThat(tested.isValid(null)).isFalse();
}
} | [FOCAL] public boolean EmailValidator.isValid(CharSequence email)
[CLASS] class EmailValidator
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] EMAIL_ADDRESS.matcher(email).matches/0, EMAIL_ADDRESS.matcher/1
[INPUTS] branches=- | result=email
[DATAFLOW] email@param->L2
[CLASS-MEMBER... | /* static context
[FOCAL] public boolean EmailValidator.isValid(CharSequence email)
[INPUTS] branches=- | result=email
[CALLS-EXTERNAL] EMAIL_ADDRESS.matcher(email).matches/0, EMAIL_ADDRESS.matcher/1
*/
| /* static context
[FOCAL] public boolean EmailValidator.isValid(CharSequence email)
[INPUTS] branches=- | result=email
[CALLS-EXTERNAL] EMAIL_ADDRESS.matcher(email).matches/0, EMAIL_ADDRESS.matcher/1
*/
class EmailValidator {
public boolean isValid(CharSequence email) {
return email != null && EMAIL_ADDRESS.matc... | true | ok | {"focal": {"class": "EmailValidator", "name": "isValid", "signature": "boolean isValid(CharSequence email)", "start_line": 3, "modifiers": "public", "params": [{"name": "email", "type": "CharSequence"}], "return_type": "boolean"}, "class_info": {"name": "EmailValidator", "kind": "class", "modifiers": "", "superclass": ... |
92768732_18 | class GroovyConditionShell {
public ConditionScript parse(final String script) throws ConditionParsingException {
return parse(script, true);
}
public GroovyConditionShell(final GroovyConditionCache conditionCache);
private ConditionScript parse(
final String script,
final bo... | ConditionScript parsedScript = this.shell.parse(script);
Assert.assertNotNull(parsedScript);
}
} | [FOCAL] public ConditionScript GroovyConditionShell.parse(String script)
[CLASS] class GroovyConditionShell
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] ConditionScript parse(String script, boolean removeLoadedClasses)
[EXCEPTIONS] declares ConditionParsingException
[INPUTS] bra... | /* static context
[FOCAL] public ConditionScript GroovyConditionShell.parse(String script)
[INPUTS] branches=- | result=script
[EXCEPTIONS] declares ConditionParsingException
[CALLS-INTERNAL] ConditionScript parse(String script, boolean removeLoadedClasses)
*/
| /* static context
[FOCAL] public ConditionScript GroovyConditionShell.parse(String script)
[INPUTS] branches=- | result=script
[EXCEPTIONS] declares ConditionParsingException
[CALLS-INTERNAL] ConditionScript parse(String script, boolean removeLoadedClasses)
*/
class GroovyConditionShell {
public ConditionScript pa... | true | ok | {"focal": {"class": "GroovyConditionShell", "name": "parse", "signature": "ConditionScript parse(String script) throws ConditionParsingException", "start_line": 3, "modifiers": "public", "params": [{"name": "script", "type": "String"}], "return_type": "ConditionScript"}, "class_info": {"name": "GroovyConditionShell", "... |
92944959_7 | class Singleton4 {
public static final Singleton4 getInstance() {
if (INSTANCE == null) {
INSTANCE = Singleton4Holder.obj ;
}
return INSTANCE ;
}
private Singleton4();
}
class Singleton4Test {
@Test
public void test_single() {
|
Assert.assertTrue(Singleton4.getInstance() == Singleton4.getInstance());
}
} | [FOCAL] public static final Singleton4 Singleton4.getInstance()
[CLASS] class Singleton4
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[PATH1] if(INSTANCE == null)=T -> return INSTANCE
[PATH2] if(INSTANCE == null)=F -> return INSTANCE
[CLASS-MEMBERS] Singleton4()
[TEST] Singleton4Test: @Test publ... | /* static context
[FOCAL] public static final Singleton4 Singleton4.getInstance()
[PATH1] if(INSTANCE == null)=T -> return INSTANCE
[PATH2] if(INSTANCE == null)=F -> return INSTANCE
*/
| /* static context
[FOCAL] public static final Singleton4 Singleton4.getInstance()
[PATH1] if(INSTANCE == null)=T -> return INSTANCE
[PATH2] if(INSTANCE == null)=F -> return INSTANCE
*/
class Singleton4 {
public static final Singleton4 getInstance() {
if (INSTANCE == null) {
INSTANCE = Singleton... | true | ok | {"focal": {"class": "Singleton4", "name": "getInstance", "signature": "Singleton4 getInstance()", "start_line": 3, "modifiers": "public static final", "params": [], "return_type": "Singleton4"}, "class_info": {"name": "Singleton4", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], ... |
92951080_4 | class LCOVSensor implements Sensor {
public boolean shouldExecuteOnProject(Project project) {
return _1C.KEY.equalsIgnoreCase(project.getLanguageKey())
&& StringUtils.isNotBlank(_1c.getSettings().getString(_1CPlugin.LCOV_REPORT_PATH));
}
public LCOVSensor(_1C _1c);
public void analyse(Project proj... | Project project = mockProject(new Java());
assertThat(sensor.shouldExecuteOnProject(project)).isFalse();
project = mockProject(new _1C(settings));
assertThat(sensor.shouldExecuteOnProject(project)).isTrue();
settings.setProperty(_1CPlugin.LCOV_REPORT_PATH, "");
assertThat(sensor.shouldExecuteO... | [FOCAL] public boolean LCOVSensor.shouldExecuteOnProject(Project project)
[CLASS] class LCOVSensor implements Sensor
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] _1C.KEY.equalsIgnoreCase/1, Project.getLanguageKey/0, StringUtils.isNotBlank/1, _1c.getSettings().getString/1, _1c.ge... | /* static context
[FOCAL] public boolean LCOVSensor.shouldExecuteOnProject(Project project)
[INPUTS] branches=- | result=project
[COLLABORATORS] param project:Project getLanguageKey/0
[CALLS-EXTERNAL] _1C.KEY.equalsIgnoreCase/1, Project.getLanguageKey/0, StringUtils.isNotBlank/1, _1c.getSettings().getString/1, _1c.getS... | /* static context
[FOCAL] public boolean LCOVSensor.shouldExecuteOnProject(Project project)
[INPUTS] branches=- | result=project
[COLLABORATORS] param project:Project getLanguageKey/0
[CALLS-EXTERNAL] _1C.KEY.equalsIgnoreCase/1, Project.getLanguageKey/0, StringUtils.isNotBlank/1, _1c.getSettings().getString/1, _1c.getS... | true | ok | {"focal": {"class": "LCOVSensor", "name": "shouldExecuteOnProject", "signature": "boolean shouldExecuteOnProject(Project project)", "start_line": 3, "modifiers": "public", "params": [{"name": "project", "type": "Project"}], "return_type": "boolean"}, "class_info": {"name": "LCOVSensor", "kind": "class", "modifiers": ""... |
92956570_25 | class BuildConfiguration implements Serializable {
public ArchiveCompression getCompression() {
return compression;
}
public BuildConfiguration();
public boolean isDockerFileMode();
public String getDockerFile();
public String getDockerArchive();
public String getContextDir();
... | BuildConfiguration config =
new BuildConfiguration.Builder().
compression("gzip").build();
assertEquals(gzip, config.getCompression());
config = new BuildConfiguration.Builder().build();
assertEquals(none, config.getCompression());
config =
... | [FOCAL] public ArchiveCompression BuildConfiguration.getCompression()
[CLASS] class BuildConfiguration implements Serializable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] BuildConfiguration(); boolean isDockerFileMode(); String getDockerFile(); String getDockerArchive(); String ... | /* static context
[FOCAL] public ArchiveCompression BuildConfiguration.getCompression()
*/
| /* static context
[FOCAL] public ArchiveCompression BuildConfiguration.getCompression()
*/
class BuildConfiguration implements Serializable {
public ArchiveCompression getCompression() {
return compression;
}
public BuildConfiguration();
public boolean isDockerFileMode();
public String g... | true | ok | {"focal": {"class": "BuildConfiguration", "name": "getCompression", "signature": "ArchiveCompression getCompression()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "ArchiveCompression"}, "class_info": {"name": "BuildConfiguration", "kind": "class", "modifiers": "", "superclass": null, "interfac... |
92974732_0 | class ObjModel extends IndexedModel {
protected static void parseInts(String str, int[] ints) {
int len = str.length();
int intIndex = 0;
int currentInt = -1;
ints[0] = -1;
ints[1] = -1;
ints[2] = -1;
for (int i = 0; i < len; i++) {
char c = str.... | int[] ints = new int[4];
ObjModel.parseInts("1/2/3", ints);
assertEquals(ints[0], 1);
assertEquals(ints[1], 2);
assertEquals(ints[2], 3);
ObjModel.parseInts("111/222/333/444", ints);
assertEquals(ints[0], 111);
assertEquals(ints[1], 222);
assertE... | [FOCAL] protected static void ObjModel.parseInts(String str, int[] ints)
[CLASS] class ObjModel extends IndexedModel
[METRICS] loc=30 cc=6 branches=4 loops=1 returns=0 throws=0 nesting=3
[CALLS-EXTERNAL] String.length/0, String.charAt/1
[PATH1] for(i < len)=T -> if(c >= '0' && c <= '9')=T -> if(currentInt == -1)=T -> e... | /* static context
[FOCAL] protected static void ObjModel.parseInts(String str, int[] ints)
[PATH1] for(i < len)=T -> if(c >= '0' && c <= '9')=T -> if(currentInt == -1)=T -> exit loop -> if(currentInt >= 0)#2=T
[PATH2] for(i < len)=T -> if(c >= '0' && c <= '9')=F -> if(currentInt >= 0)#1=T -> exit loop -> if(currentInt ... | /* static context
[FOCAL] protected static void ObjModel.parseInts(String str, int[] ints)
[PATH1] for(i < len)=T -> if(c >= '0' && c <= '9')=T -> if(currentInt == -1)=T -> exit loop -> if(currentInt >= 0)#2=T
[PATH2] for(i < len)=T -> if(c >= '0' && c <= '9')=F -> if(currentInt >= 0)#1=T -> exit loop -> if(currentInt ... | true | ok | {"focal": {"class": "ObjModel", "name": "parseInts", "signature": "void parseInts(String str, int[] ints)", "start_line": 3, "modifiers": "protected static", "params": [{"name": "str", "type": "String"}, {"name": "ints", "type": "int[]"}], "return_type": "void"}, "class_info": {"name": "ObjModel", "kind": "class", "mod... |
92980167_129 | class EncryptedBatchWriter implements BatchWriter {
@Override
public void addMutation(Mutation mutation) throws MutationsRejectedException {
for (ColumnUpdate update : mutation.getUpdates()) {
MutableEntry entry = new MutableEntry(mutation.getRow(), update);
if (update.isDeleted()) {
if (!... | when(mockConnector.createBatchWriter(TEST_TABLE, null)).thenReturn(mockWriter);
BatchWriter writer = new EncryptedBatchWriter(mockConnector, TEST_TABLE, null, getConfig("encrypt-entry.ini"), KEYS);
Mutation mutation = new Mutation("row".getBytes());
mutation.putDelete("colF1".getBytes(), "colQ".getByte... | [FOCAL] @Override public void EncryptedBatchWriter.addMutation(Mutation mutation)
[CLASS] class EncryptedBatchWriter implements BatchWriter
[METRICS] loc=36 cc=7 branches=4 loops=2 returns=0 throws=1 nesting=4
[CALLS-EXTERNAL] Mutation.getUpdates/0, Mutation.getRow/0, ColumnUpdate.isDeleted/0, encryptor.getDeleteKeys/1... | /* static context
[FOCAL] @Override public void EncryptedBatchWriter.addMutation(Mutation mutation)
[THROWS-WHEN] IllegalArgumentException when foreach(ColumnUpdate update : mutation.getUpdates())=T && update.isDeleted() && !supportsDelete
[PATH1] foreach(ColumnUpdate update : mutation.getUpdates())=T -> if(update.isDe... | /* static context
[FOCAL] @Override public void EncryptedBatchWriter.addMutation(Mutation mutation)
[THROWS-WHEN] IllegalArgumentException when foreach(ColumnUpdate update : mutation.getUpdates())=T && update.isDeleted() && !supportsDelete
[PATH1] foreach(ColumnUpdate update : mutation.getUpdates())=T -> if(update.isDe... | true | ok | {"focal": {"class": "EncryptedBatchWriter", "name": "addMutation", "signature": "void addMutation(Mutation mutation) throws MutationsRejectedException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "mutation", "type": "Mutation"}], "return_type": "void"}, "class_info": {"name": "EncryptedBatchW... |
92982984_62 | class TypeFetchers {
public static TypeFetcher fromTypes() {
return new TypeFetcher() {
// this is technically invalid, as different apis might call. Won't happen, but could.
// make better
Iterable<TypeDeclaration> foundInApi;
@Override
public... |
when(api.types()).thenReturn(Arrays.asList(t1, t2, t3));
TypeDeclaration typeDeclaration = TypeFetchers.fromTypes().fetchType(api, "t1");
assertSame(t1, typeDeclaration);
}
} | [FOCAL] public static TypeFetcher TypeFetchers.fromTypes()
[CLASS] class TypeFetchers
[METRICS] loc=16 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Predicate<TypeDeclaration> namedPredicate(String name); Supplier<TypeDeclaration> fail(String name)
[CALLS-EXTERNAL] FluentIterable.from(Optional.f... | /* static context
[FOCAL] public static TypeFetcher TypeFetchers.fromTypes()
[INPUTS] branches=- | result=api
[COLLABORATORS] field api:Api types/0
[CALLS-INTERNAL] Predicate<TypeDeclaration> namedPredicate(String name); Supplier<TypeDeclaration> fail(String name)
[FIELDS] read=api:Api
[NEW] TypeFetcher
[CALLS-EXTERNAL... | /* static context
[FOCAL] public static TypeFetcher TypeFetchers.fromTypes()
[INPUTS] branches=- | result=api
[COLLABORATORS] field api:Api types/0
[CALLS-INTERNAL] Predicate<TypeDeclaration> namedPredicate(String name); Supplier<TypeDeclaration> fail(String name)
[FIELDS] read=api:Api
[NEW] TypeFetcher
[CALLS-EXTERNAL... | true | ok | {"focal": {"class": "TypeFetchers", "name": "fromTypes", "signature": "TypeFetcher fromTypes()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "TypeFetcher"}, "class_info": {"name": "TypeFetchers", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name"... |
93055348_0 | class Highlight extends UserNote implements Comparable<Highlight> {
@NonNull
public static ArrayList<ContentValues> deserializeToContentValues(@NonNull String serialized,
PageInfo pageInfo,
... | ArrayList<ContentValues> highlightsReturn = Highlight.deserializeToContentValues(serialized1,pagId,0);
ArrayList<ContentValues> highlightsGiven = new ArrayList<>();
ContentValues contentValues = new ContentValues();
contentValues.put(UserDataDBContract.HighlightEntry.COLUMN_NAME_PAGE_I... | [FOCAL] @NonNull public static ArrayList<ContentValues> Highlight.deserializeToContentValues(String serialized, PageInfo pageInfo, int bookId)
[CLASS] class Highlight extends UserNote implements Comparable<Highlight>
[METRICS] loc=51 cc=5 branches=3 loops=1 returns=1 throws=1 nesting=3
[CALLS-EXTERNAL] HIGHLIGHT_PATTER... | /* static context
[FOCAL] @NonNull public static ArrayList<ContentValues> Highlight.deserializeToContentValues(String serialized, PageInfo pageInfo, int bookId)
[THROWS-WHEN] Error when !matcher.matches()
[PATH1] if(matcher.matches())=T -> for(i < serializedHighlights.length)=T -> if(!parts[4].isEmpty())=T -> if(parts.... | /* static context
[FOCAL] @NonNull public static ArrayList<ContentValues> Highlight.deserializeToContentValues(String serialized, PageInfo pageInfo, int bookId)
[THROWS-WHEN] Error when !matcher.matches()
[PATH1] if(matcher.matches())=T -> for(i < serializedHighlights.length)=T -> if(!parts[4].isEmpty())=T -> if(parts.... | true | ok | {"focal": {"class": "Highlight", "name": "deserializeToContentValues", "signature": "ArrayList<ContentValues> deserializeToContentValues(String serialized, PageInfo pageInfo, int bookId)", "start_line": 3, "modifiers": "@NonNull public static", "params": [{"name": "serialized", "type": "String"}, {"name": "pageInfo", "... |
93131587_43 | class CodeGenerator {
public String generateMainClass(final Collection<TableModel> tables, final boolean enableVisualizationSupport) {
Objects.requireNonNull(tables);
//get package from the table models
final String targetPackage = ((TableModel) tables.toArray()[0]).getPackageName();
... | Connection connection = DatabaseManager.connectToDatabase("org.h2.Driver", "jdbc:h2:mem:rt-cg-main", "", "");
assertNotNull(connection);
File tempFile = Helpers.getResourceAsFile("codegenerator/test.sql");
assertNotNull(tempFile);
DatabaseManager.executePreparationScripts(connect... | [FOCAL] public String CodeGenerator.generateMainClass(Collection<TableModel> tables, boolean enableVisualizationSupport)
[CLASS] class CodeGenerator
[METRICS] loc=17 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Objects.requireNonNull/1, ((TableModel) tables.toArray()[0]).getPackageName/0, Colle... | /* static context
[FOCAL] public String CodeGenerator.generateMainClass(Collection<TableModel> tables, boolean enableVisualizationSupport)
[COLLABORATORS] param tables:Collection<TableModel> toArray/0,size/0; field stGroup getInstanceOf/1
[FIELDS] read=stGroup
[CALLS-EXTERNAL] Objects.requireNonNull/1, ((TableModel) ta... | /* static context
[FOCAL] public String CodeGenerator.generateMainClass(Collection<TableModel> tables, boolean enableVisualizationSupport)
[COLLABORATORS] param tables:Collection<TableModel> toArray/0,size/0; field stGroup getInstanceOf/1
[FIELDS] read=stGroup
[CALLS-EXTERNAL] Objects.requireNonNull/1, ((TableModel) ta... | true | ok | {"focal": {"class": "CodeGenerator", "name": "generateMainClass", "signature": "String generateMainClass(Collection<TableModel> tables, boolean enableVisualizationSupport)", "start_line": 3, "modifiers": "public", "params": [{"name": "tables", "type": "Collection<TableModel>"}, {"name": "enableVisualizationSupport", "t... |
93181581_6 | class SqlStringUtils {
public static StatementKind getStatementKind(String sql)
{
String prefix = sql.trim();
prefix = prefix.length() < 10 ? prefix : prefix.substring(0, 10);
prefix = prefix.toLowerCase();
if (prefix.startsWith("select"))
{
return SELECT;
... | assertThat(
SqlStringUtils.getStatementKind(" SELECT * FROM FOO"),
is(SELECT)
);
assertThat(
SqlStringUtils.getStatementKind("insert into alabalanicafoorbar values ()"),
is(INSERT)
);
asse... | [FOCAL] public static StatementKind SqlStringUtils.getStatementKind(String sql)
[CLASS] class SqlStringUtils
[METRICS] loc=29 cc=5 branches=4 loops=0 returns=5 throws=0 nesting=4
[CALLS-EXTERNAL] String.trim/0, String.length/0, String.substring/2, String.toLowerCase/0, String.startsWith/1
[PATH1] if(prefix.startsWith("... | /* static context
[FOCAL] public static StatementKind SqlStringUtils.getStatementKind(String sql)
[PATH1] if(prefix.startsWith("select"))=F -> if(prefix.startsWith("insert"))=F -> if(prefix.startsWith("update"))=F -> if(prefix.startsWith("delete"))=T -> return DELETE
[PATH2] if(prefix.startsWith("select"))=T -> return ... | /* static context
[FOCAL] public static StatementKind SqlStringUtils.getStatementKind(String sql)
[PATH1] if(prefix.startsWith("select"))=F -> if(prefix.startsWith("insert"))=F -> if(prefix.startsWith("update"))=F -> if(prefix.startsWith("delete"))=T -> return DELETE
[PATH2] if(prefix.startsWith("select"))=T -> return ... | true | ok | {"focal": {"class": "SqlStringUtils", "name": "getStatementKind", "signature": "StatementKind getStatementKind(String sql)", "start_line": 3, "modifiers": "public static", "params": [{"name": "sql", "type": "String"}], "return_type": "StatementKind"}, "class_info": {"name": "SqlStringUtils", "kind": "class", "modifiers... |
93201544_1 | class LoggerRegistry {
public <T extends LogEvent> Logger<T> getLogger(Supplier<?> supplier, Function<? super LoggerKey, ? extends Logger> builder) {
final String name = getLoggerName();
return getLogger(name, supplier, builder);
}
public Logger<T> getLogger(String name, Supplier<?> supplier, Function<?... | final Logger logEventLogger = LoggerFactory.getLogger();
logEventLogger.debug(e -> String.format("Logger %s ", logEventLogger.getName()));
final Logger<SpecializedLogEvent> specializedLogEventLogger =
LoggerFactory.getLogger(new SpecializedLogEventSupplier());
assertFalse(logEventLogg... | [FOCAL] public Logger<T> LoggerRegistry.getLogger(Supplier<?> supplier, Function<? super LoggerKey, ? extends Logger> builder)
[CLASS] class LoggerRegistry
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Logger<T> getLogger(String name, Supplier<?> supplier, Function<? super Logger... | /* static context
[FOCAL] public Logger<T> LoggerRegistry.getLogger(Supplier<?> supplier, Function<? super LoggerKey, ? extends Logger> builder)
[INPUTS] branches=- | result=builder, supplier
[CALLS-INTERNAL] Logger<T> getLogger(String name, Supplier<?> supplier, Function<? super LoggerKey, ? extends Logger> builder); ... | /* static context
[FOCAL] public Logger<T> LoggerRegistry.getLogger(Supplier<?> supplier, Function<? super LoggerKey, ? extends Logger> builder)
[INPUTS] branches=- | result=builder, supplier
[CALLS-INTERNAL] Logger<T> getLogger(String name, Supplier<?> supplier, Function<? super LoggerKey, ? extends Logger> builder); ... | true | ok | {"focal": {"class": "LoggerRegistry", "name": "getLogger", "signature": "Logger<T> getLogger(Supplier<?> supplier, Function<? super LoggerKey, ? extends Logger> builder)", "start_line": 3, "modifiers": "public", "params": [{"name": "supplier", "type": "Supplier<?>"}, {"name": "builder", "type": "Function<? super Logger... |
93268041_15 | class SecretsManager {
public void assertCurrentStageExists(final String secretId) {
final GetSecretValueRequest getSecretValueRequest = new GetSecretValueRequest();
getSecretValueRequest.setSecretId(secretId);
getSecretValueRequest.setVersionStage(CURRENT.getAwsName());
getDelegate... | // given
final GetSecretValueRequest request = new GetSecretValueRequest();
request.setSecretId("secret");
request.setVersionStage("AWSCURRENT");
given(delegate.getSecretValue(eq(request))).willThrow(new ResourceNotFoundException("not found"));
// when / then (exception ... | [FOCAL] public void SecretsManager.assertCurrentStageExists(String secretId)
[CLASS] class SecretsManager
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] AWSSecretsManager getDelegate()
[CALLS-EXTERNAL] GetSecretValueRequest.setSecretId/1, GetSecretValueRequest.setVersionStage/1, C... | /* static context
[FOCAL] public void SecretsManager.assertCurrentStageExists(String secretId)
[CALLS-INTERNAL] AWSSecretsManager getDelegate()
[NEW] GetSecretValueRequest
[CALLS-EXTERNAL] GetSecretValueRequest.setSecretId/1, GetSecretValueRequest.setVersionStage/1, CURRENT.getAwsName/0, getDelegate().getSecretValue/1
... | /* static context
[FOCAL] public void SecretsManager.assertCurrentStageExists(String secretId)
[CALLS-INTERNAL] AWSSecretsManager getDelegate()
[NEW] GetSecretValueRequest
[CALLS-EXTERNAL] GetSecretValueRequest.setSecretId/1, GetSecretValueRequest.setVersionStage/1, CURRENT.getAwsName/0, getDelegate().getSecretValue/1
... | true | ok | {"focal": {"class": "SecretsManager", "name": "assertCurrentStageExists", "signature": "void assertCurrentStageExists(String secretId)", "start_line": 3, "modifiers": "public", "params": [{"name": "secretId", "type": "String"}], "return_type": "void"}, "class_info": {"name": "SecretsManager", "kind": "class", "modifier... |
93307435_0 | class HeapUnit {
public static HeapImage captureHeap() throws IOException {
String path = "target/heapunit/" + System.currentTimeMillis() + ".hprof";
return new SimpleHeapImage(HeapDumpProcuder.makeHeapDump(path, TimeUnit.SECONDS.toMillis(60)));
}
}
class HeapUnitTest {
@Test
public ... |
@SuppressWarnings("unused")
TestInstance tt = new TestInstance();
HeapImage hi = HeapUnit.captureHeap();
System.out.println("String count: " + hi.instanceCount(String.class));
Assert.assertTrue(hi.instanceCount(String.class) > 0);
System.out.pr... | [FOCAL] public static HeapImage HeapUnit.captureHeap()
[CLASS] class HeapUnit
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] System.currentTimeMillis/0, HeapDumpProcuder.makeHeapDump/2, TimeUnit.SECONDS.toMillis/1
[NEW] SimpleHeapImage
[EXCEPTIONS] declares IOException
[DATAFLOW] ... | /* static context
[FOCAL] public static HeapImage HeapUnit.captureHeap()
[EXCEPTIONS] declares IOException
[NEW] SimpleHeapImage
[CALLS-EXTERNAL] System.currentTimeMillis/0, HeapDumpProcuder.makeHeapDump/2, TimeUnit.SECONDS.toMillis/1
*/
| /* static context
[FOCAL] public static HeapImage HeapUnit.captureHeap()
[EXCEPTIONS] declares IOException
[NEW] SimpleHeapImage
[CALLS-EXTERNAL] System.currentTimeMillis/0, HeapDumpProcuder.makeHeapDump/2, TimeUnit.SECONDS.toMillis/1
*/
class HeapUnit {
public static HeapImage captureHeap() throws IOException {
... | true | ok | {"focal": {"class": "HeapUnit", "name": "captureHeap", "signature": "HeapImage captureHeap() throws IOException", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "HeapImage"}, "class_info": {"name": "HeapUnit", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields... |
93314642_136 | class NumberScalingUtils {
public static BigInteger translate(
final BigInteger sourceAmount, final int sourceScale, final int destinationScale
) {
Objects.requireNonNull(sourceAmount, "sourceAmount must not be null");
Preconditions.checkArgument(sourceAmount.compareTo(BigInteger.ZERO) >= 0, "sourceAmo... | assertThat(NumberScalingUtils.translate(
sourceSettlementQuantity.amount(), sourceSettlementQuantity.scale(), expectedSettlementQuantity.scale()
)).as(description).isEqualTo(expectedSettlementQuantity.amount());
}
} | [FOCAL] public static BigInteger NumberScalingUtils.translate(BigInteger sourceAmount, int sourceScale, int destinationScale)
[CLASS] class NumberScalingUtils
[METRICS] loc=19 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Objects.requireNonNull/2, Preconditions.checkArgument/2, BigInteger.compar... | /* static context
[FOCAL] public static BigInteger NumberScalingUtils.translate(BigInteger sourceAmount, int sourceScale, int destinationScale)
[INPUTS] branches=- | result=destinationScale, sourceAmount, sourceScale
[COLLABORATORS] param sourceAmount:BigInteger compareTo/1,multiply/1,divide/1
[CALLS-EXTERNAL] Objects.... | /* static context
[FOCAL] public static BigInteger NumberScalingUtils.translate(BigInteger sourceAmount, int sourceScale, int destinationScale)
[INPUTS] branches=- | result=destinationScale, sourceAmount, sourceScale
[COLLABORATORS] param sourceAmount:BigInteger compareTo/1,multiply/1,divide/1
[CALLS-EXTERNAL] Objects.... | true | ok | {"focal": {"class": "NumberScalingUtils", "name": "translate", "signature": "BigInteger translate(BigInteger sourceAmount, int sourceScale, int destinationScale)", "start_line": 3, "modifiers": "public static", "params": [{"name": "sourceAmount", "type": "BigInteger"}, {"name": "sourceScale", "type": "int"}, {"name": "... |
93364077_10 | class AttractionRepository {
@VisibleForTesting
static AttractionCollection buildNightLifeCollection() {
ArrayList<Attraction> attractions = new ArrayList<>();
attractions.add(new Attraction(
R.drawable.social,
R.string.social_title,
... | assertThat(AttractionRepository.buildNightLifeCollection(), instanceOf(AttractionCollection.class));
}
} | [FOCAL] @VisibleForTesting static AttractionCollection AttractionRepository.buildNightLifeCollection()
[CLASS] class AttractionRepository
[METRICS] loc=47 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] ArrayList<Attraction>.add/1
[NEW] ArrayList<>, Attraction, AttractionCollection
[DATAFLOW] attr... | /* static context
[FOCAL] @VisibleForTesting static AttractionCollection AttractionRepository.buildNightLifeCollection()
[NEW] ArrayList<>, Attraction, AttractionCollection
[CALLS-EXTERNAL] ArrayList<Attraction>.add/1
*/
| /* static context
[FOCAL] @VisibleForTesting static AttractionCollection AttractionRepository.buildNightLifeCollection()
[NEW] ArrayList<>, Attraction, AttractionCollection
[CALLS-EXTERNAL] ArrayList<Attraction>.add/1
*/
class AttractionRepository {
@VisibleForTesting
static AttractionCollection buildNightLife... | true | ok | {"focal": {"class": "AttractionRepository", "name": "buildNightLifeCollection", "signature": "AttractionCollection buildNightLifeCollection()", "start_line": 3, "modifiers": "@VisibleForTesting static", "params": [], "return_type": "AttractionCollection"}, "class_info": {"name": "AttractionRepository", "kind": "class",... |
93389699_3 | class CompositeValidator extends Validator<T> {
@Override public void validate(T t) throws CompositeValidationException {
List<ValidationException> exceptions = new ArrayList<>();
for (Validator<? super T> validator : validators) {
try {
validator.validate(t);
} catch (ValidationException... | try {
reflectiveValidator.validate(new Foo(5));
reflectiveValidator.validate(new Foo(6));
reflectiveValidator.validate(new Foo(7));
reflectiveValidator.validate(new Foo(8));
reflectiveValidator.validate(new Foo(9));
reflectiveValidator.validate(new Foo(10));
} catch (Validati... | [FOCAL] @Override public void CompositeValidator.validate(T t)
[CLASS] class CompositeValidator extends Validator<T>
[METRICS] loc=17 cc=5 branches=2 loops=1 returns=0 throws=2 nesting=2
[CALLS-EXTERNAL] Validator<? super T>.validate/1, List<ValidationException>.add/1, List<ValidationException>.isEmpty/0, List<Validati... | /* static context
[FOCAL] @Override public void CompositeValidator.validate(T t)
[THROWS-WHEN] exceptions.get(0) when foreach(Validator<? super T> validator : validators)=T && try-body throws && !exceptions.isEmpty() && exceptions.size() == 1
[THROWS-WHEN] CompositeValidationException when foreach(Validator<? super T> ... | /* static context
[FOCAL] @Override public void CompositeValidator.validate(T t)
[THROWS-WHEN] exceptions.get(0) when foreach(Validator<? super T> validator : validators)=T && try-body throws && !exceptions.isEmpty() && exceptions.size() == 1
[THROWS-WHEN] CompositeValidationException when foreach(Validator<? super T> ... | true | ok | {"focal": {"class": "CompositeValidator", "name": "validate", "signature": "void validate(T t) throws CompositeValidationException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "t", "type": "T"}], "return_type": "void"}, "class_info": {"name": "CompositeValidator", "kind": "class", "modifiers"... |
93475299_4 | class TracingCallback implements Callback {
@Override
public void onCompletion(RecordMetadata metadata, Exception exception) {
if (exception != null) {
for (SpanDecorator decorator : spanDecorators) {
decorator.onError(exception, span);
}
}
try (Scope ignored = tracer.scopeManager(... | Span span = mockTracer.buildSpan("test").start();
try (Scope ignored = mockTracer.activateSpan(span)) {
TracingCallback callback = new TracingCallback(null, span, mockTracer,
Arrays.asList(SpanDecorator.STANDARD_TAGS, createDecorator()));
callback.onCompletion(null, new RuntimeException("t... | [FOCAL] @Override public void TracingCallback.onCompletion(RecordMetadata metadata, Exception exception)
[CLASS] class TracingCallback implements Callback
[METRICS] loc=16 cc=5 branches=2 loops=1 returns=0 throws=0 nesting=2
[CALLS-EXTERNAL] SpanDecorator.onError/2, tracer.scopeManager().activate/1, tracer.scopeManager... | /* static context
[FOCAL] @Override public void TracingCallback.onCompletion(RecordMetadata metadata, Exception exception)
[PATH1] if(exception != null)=T -> foreach(SpanDecorator decorator : spanDecorators)=T -> exit loop -> if(callback != null)=T
[PATH2] if(exception != null)=F -> if(callback != null)=F
[PATH3] if(ex... | /* static context
[FOCAL] @Override public void TracingCallback.onCompletion(RecordMetadata metadata, Exception exception)
[PATH1] if(exception != null)=T -> foreach(SpanDecorator decorator : spanDecorators)=T -> exit loop -> if(callback != null)=T
[PATH2] if(exception != null)=F -> if(callback != null)=F
[PATH3] if(ex... | true | ok | {"focal": {"class": "TracingCallback", "name": "onCompletion", "signature": "void onCompletion(RecordMetadata metadata, Exception exception)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "metadata", "type": "RecordMetadata"}, {"name": "exception", "type": "Exception"}], "return_type": "void"},... |
93584385_175 | class CMSClient {
public void updateActionOrderState(DelegateExecution exec, CmsActionOrderSimple aos, String newState) {
aos.setActionState(OpsActionState.valueOf(newState));
try {
if (newState.equalsIgnoreCase(COMPLETE)) {
CmsActionOrder ao = cmsUtil.custSimple2Action... | DelegateExecution delegateExecution = mock(DelegateExecution.class);
CmsOpsProcedure cmsOpsProcedure = mock(CmsOpsProcedure.class);
when(delegateExecution.getVariable("proc")).thenReturn(cmsOpsProcedure);
CmsActionOrderSimple cmsActionOrderSimple= new CmsActionOrderSimple();
cmsActionOrderSimple.setActionId(... | [FOCAL] public void CMSClient.updateActionOrderState(DelegateExecution exec, CmsActionOrderSimple aos, String newState)
[CLASS] class CMSClient
[METRICS] loc=40 cc=4 branches=2 loops=0 returns=0 throws=0 nesting=3
[CALLS-EXTERNAL] CmsActionOrderSimple.setActionState/1, OpsActionState.valueOf/1, String.equalsIgnoreCase/... | class CMSClient {
public void updateActionOrderState(DelegateExecution exec, CmsActionOrderSimple aos, String newState) {
aos.setActionState(OpsActionState.valueOf(newState));
try {
if (newState.equalsIgnoreCase(COMPLETE)) {
CmsActionOrder ao = cmsUtil.custSimple2Action... | false | ok | {"focal": {"class": "CMSClient", "name": "updateActionOrderState", "signature": "void updateActionOrderState(DelegateExecution exec, CmsActionOrderSimple aos, String newState)", "start_line": 3, "modifiers": "public", "params": [{"name": "exec", "type": "DelegateExecution"}, {"name": "aos", "type": "CmsActionOrderSimpl... | |
93627493_4 | class PlaceHolderManager {
public static String processMessage(String message, BungeeChatContext context) {
final StringBuilder builder = new StringBuilder();
final List<BungeeChatPlaceHolder> placeholders =
getApplicableStream(context).collect(Collectors.toList());
processMessageInternal(messag... | final String message = "Test %xxx% %hi%";
assertEquals(message, PlaceHolderManager.processMessage(message, EMPTY_CONTEXT));
}
} | [FOCAL] public static String PlaceHolderManager.processMessage(String message, BungeeChatContext context)
[CLASS] class PlaceHolderManager
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Stream<BungeeChatPlaceHolder> getApplicableStream(BungeeChatContext context); void processMessa... | /* static context
[FOCAL] public static String PlaceHolderManager.processMessage(String message, BungeeChatContext context)
[CALLS-INTERNAL] Stream<BungeeChatPlaceHolder> getApplicableStream(BungeeChatContext context); void processMessageInternal(String message, BungeeChatContext context, StringBuilder builder, List<Bu... | /* static context
[FOCAL] public static String PlaceHolderManager.processMessage(String message, BungeeChatContext context)
[CALLS-INTERNAL] Stream<BungeeChatPlaceHolder> getApplicableStream(BungeeChatContext context); void processMessageInternal(String message, BungeeChatContext context, StringBuilder builder, List<Bu... | true | ok | {"focal": {"class": "PlaceHolderManager", "name": "processMessage", "signature": "String processMessage(String message, BungeeChatContext context)", "start_line": 3, "modifiers": "public static", "params": [{"name": "message", "type": "String"}, {"name": "context", "type": "BungeeChatContext"}], "return_type": "String"... |
93642073_6 | class Registry {
public boolean isInRegistry(String url) {
if (getMockedEndpointsMethod == null) {
return false;
}
Set<String> mockedEndpoints = getMockedEndpoints();
for (String endpoint : mockedEndpoints) {
if (endpointMatches(endpoint, url)) {
... | // Given
MocksRegistry.setRegistry(new HashSet<>(asList(
"/path3/path4",
"/path1/path2"
)));
// When
boolean result = testee.isInRegistry("http://example.com/path3/path4?someArg=a&otherArg=b");
// Then
assertTrue(result);
}
} | [FOCAL] public boolean Registry.isInRegistry(String url)
[CLASS] class Registry
[METRICS] loc=15 cc=4 branches=2 loops=1 returns=3 throws=0 nesting=2
[CALLS-INTERNAL] Set<String> getMockedEndpoints(); boolean endpointMatches(String mockedEndpoint, String url)
[PATH1] if(getMockedEndpointsMethod == null)=F -> foreach(St... | /* static context
[FOCAL] public boolean Registry.isInRegistry(String url)
[PATH1] if(getMockedEndpointsMethod == null)=F -> foreach(String endpoint : mockedEndpoints)=T -> if(endpointMatches(endpoint, url))=F -> exit loop -> return false
[PATH2] if(getMockedEndpointsMethod == null)=F -> foreach(String endpoint : mocke... | /* static context
[FOCAL] public boolean Registry.isInRegistry(String url)
[PATH1] if(getMockedEndpointsMethod == null)=F -> foreach(String endpoint : mockedEndpoints)=T -> if(endpointMatches(endpoint, url))=F -> exit loop -> return false
[PATH2] if(getMockedEndpointsMethod == null)=F -> foreach(String endpoint : mocke... | true | ok | {"focal": {"class": "Registry", "name": "isInRegistry", "signature": "boolean isInRegistry(String url)", "start_line": 3, "modifiers": "public", "params": [{"name": "url", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "Registry", "kind": "class", "modifiers": "", "superclass": null, "interfaces"... |
93682788_19 | class PeoplePresenter implements PeopleContract.Presenter, LoaderManager.LoaderCallbacks<List<Person>> {
@Override
public void onLoadFinished(Loader<List<Person>> loader, List<Person> data) {
// This callback may be called twice, once for the cache and once for loading
// the data from the ser... |
mPeoplePresenter.onLoadFinished(mock(Loader.class), null);
verify(mPeopleView).showLoadingPeopleError();
}
} | [FOCAL] @Override public void PeoplePresenter.onLoadFinished(Loader<List<Person>> loader, List<Person> data)
[CLASS] class PeoplePresenter implements PeopleContract.Presenter, LoaderManager.LoaderCallbacks<List<Person>>
[METRICS] loc=17 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] void showPeop... | /* static context
[FOCAL] @Override public void PeoplePresenter.onLoadFinished(Loader<List<Person>> loader, List<Person> data)
[PATH1] if(!EspressoIdlingResource.getIdlingResource().isIdleNow())=T -> if(mCurrentPeople == null)=T
[PATH2] if(!EspressoIdlingResource.getIdlingResource().isIdleNow())=F -> if(mCurrentPeople ... | /* static context
[FOCAL] @Override public void PeoplePresenter.onLoadFinished(Loader<List<Person>> loader, List<Person> data)
[PATH1] if(!EspressoIdlingResource.getIdlingResource().isIdleNow())=T -> if(mCurrentPeople == null)=T
[PATH2] if(!EspressoIdlingResource.getIdlingResource().isIdleNow())=F -> if(mCurrentPeople ... | true | ok | {"focal": {"class": "PeoplePresenter", "name": "onLoadFinished", "signature": "void onLoadFinished(Loader<List<Person>> loader, List<Person> data)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "loader", "type": "Loader<List<Person>>"}, {"name": "data", "type": "List<Person>"}], "return_type": ... |
93754068_10 | class CollectionManagementService {
protected void checkAndInstallConfiguration(String configName) throws IOException {
this.checkAndInstallConfiguration(configName, false);
}
public CollectionManagementService(List<String> zkHosts);
public CollectionManagementService(List<String> zkHost, St... | String configName = "com.rbmhtechnology.vind:backend-solr:1.1.2";
service.checkAndInstallConfiguration(configName);
assertTrue(service.configurationIsDeployed(configName));
}
} | [FOCAL] protected void CollectionManagementService.checkAndInstallConfiguration(String configName)
[CLASS] class CollectionManagementService
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void checkAndInstallConfiguration(String configName, boolean force)
[EXCEPTIONS] declares IOE... | /* static context
[FOCAL] protected void CollectionManagementService.checkAndInstallConfiguration(String configName)
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] void checkAndInstallConfiguration(String configName, boolean force)
*/
| /* static context
[FOCAL] protected void CollectionManagementService.checkAndInstallConfiguration(String configName)
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] void checkAndInstallConfiguration(String configName, boolean force)
*/
class CollectionManagementService {
protected void checkAndInstallConfigurat... | true | ok | {"focal": {"class": "CollectionManagementService", "name": "checkAndInstallConfiguration", "signature": "void checkAndInstallConfiguration(String configName) throws IOException", "start_line": 3, "modifiers": "protected", "params": [{"name": "configName", "type": "String"}], "return_type": "void"}, "class_info": {"name... |
93782049_221 | class FormatOptionHandler {
public static Object parse(final VType value, String text, final FormatOption format)
{
try
{
switch (format)
{
case STRING:
return text;
case HEX:
{ // Remove trailing text (units or part ... | VType value = VDouble.of(3.16, Alarm.none(), Time.now(), display);
Object parsed = FormatOptionHandler.parse(value, "42.5 Socks", FormatOption.DEFAULT);
assertThat(parsed, instanceOf(Number.class));
assertThat(((Number)parsed).doubleValue(), equalTo(42.5));
}
} | [FOCAL] public static Object FormatOptionHandler.parse(VType value, String text, FormatOption format)
[CLASS] class FormatOptionHandler
[METRICS] loc=96 cc=25 branches=16 loops=2 returns=15 throws=0 nesting=5
[CALLS-EXTERNAL] String.trim/0, String.lastIndexOf/1, text.substring(0, sep).trim/0, String.substring/2, String... | /* static context
[FOCAL] public static Object FormatOptionHandler.parse(VType value, String text, FormatOption format)
[PATH1] switch(format)=default -> if(value instanceof VNumber)=F -> if(value instanceof VEnum)=F -> if(value instanceof VNumberArray)=T -> if(text.startsWith("["))=T -> if(text.endsWith("]"))=T -> for... | /* static context
[FOCAL] public static Object FormatOptionHandler.parse(VType value, String text, FormatOption format)
[PATH1] switch(format)=default -> if(value instanceof VNumber)=F -> if(value instanceof VEnum)=F -> if(value instanceof VNumberArray)=T -> if(text.startsWith("["))=T -> if(text.endsWith("]"))=T -> for... | true | ok | {"focal": {"class": "FormatOptionHandler", "name": "parse", "signature": "Object parse(VType value, String text, FormatOption format)", "start_line": 3, "modifiers": "public static", "params": [{"name": "value", "type": "VType"}, {"name": "text", "type": "String"}, {"name": "format", "type": "FormatOption"}], "return_t... |
93861612_50 | class FeatureFileContentRenderer {
private String formatDocString(final String docString) {
if (docString == null || docString.isEmpty()) {
return "";
}
return "\"\"\"" + LINE_SEPARATOR + docString + LINE_SEPARATOR + "\"\"\"" + LINE_SEPARATOR;
}
private String getRender... | String expectedOutput = "Feature: featureName\n" +
"\n" +
"Scenario: scenarioName\n" +
"Step 1\n" +
"\"\"\"\n" +
"DOCSTRING LINE 1\n" +
"DOCSTRING LINE 2\n" +
"\"\"\"\n" +
"\n# Source ... | [FOCAL] private String FeatureFileContentRenderer.formatDocString(String docString)
[CLASS] class FeatureFileContentRenderer
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] String.isEmpty/0
[PATH1] if(docString == null || docString.isEmpty())=T -> return ""
[PATH2] if(docString == ... | /* static context
[FOCAL] private String FeatureFileContentRenderer.formatDocString(String docString)
[PATH1] if(docString == null || docString.isEmpty())=T -> return ""
[PATH2] if(docString == null || docString.isEmpty())=F -> return "\"\"\"" + LINE_SEPARATOR + docString + LINE_SEPARATOR + "\"\"\"" +...
[INPUTS] branc... | /* static context
[FOCAL] private String FeatureFileContentRenderer.formatDocString(String docString)
[PATH1] if(docString == null || docString.isEmpty())=T -> return ""
[PATH2] if(docString == null || docString.isEmpty())=F -> return "\"\"\"" + LINE_SEPARATOR + docString + LINE_SEPARATOR + "\"\"\"" +...
[INPUTS] branc... | true | ok | {"focal": {"class": "FeatureFileContentRenderer", "name": "formatDocString", "signature": "String formatDocString(String docString)", "start_line": 3, "modifiers": "private", "params": [{"name": "docString", "type": "String"}], "return_type": "String"}, "class_info": {"name": "FeatureFileContentRenderer", "kind": "clas... |
93868467_35 | class RedisList extends Commands {
public String index(String key, long index) {
return getJedis().lindex(key, index);
}
private RedisList();
public synchronized static RedisList getInstance();
public long rPush(String key, String... values);
public long lPush(String key, String... values);
public... | deleteKeyForTest();
redisList.rPush(testKey,"tests");
String result = redisList.index(testKey, 0L);
Assert.assertEquals("tests", result);
deleteKeyForTest();
}
} | [FOCAL] public String RedisList.index(String key, long index)
[CLASS] class RedisList extends Commands
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] getJedis().lindex/2, getJedis/0 (inherited)
[INPUTS] branches=- | result=index, key
[DATAFLOW] index@param->L2; key@param->L2
[CLAS... | /* static context
[FOCAL] public String RedisList.index(String key, long index)
[INPUTS] branches=- | result=index, key
[CALLS-EXTERNAL] getJedis().lindex/2, getJedis/0 (inherited)
*/
| /* static context
[FOCAL] public String RedisList.index(String key, long index)
[INPUTS] branches=- | result=index, key
[CALLS-EXTERNAL] getJedis().lindex/2, getJedis/0 (inherited)
*/
class RedisList extends Commands {
public String index(String key, long index) {
return getJedis().lindex(key, index);
}
pri... | true | ok | {"focal": {"class": "RedisList", "name": "index", "signature": "String index(String key, long index)", "start_line": 3, "modifiers": "public", "params": [{"name": "key", "type": "String"}, {"name": "index", "type": "long"}], "return_type": "String"}, "class_info": {"name": "RedisList", "kind": "class", "modifiers": "",... |
93951167_2 | class SplashUrlDecoder {
public static LaunchData getLaunchType(String launchUri) {
if (launchUri == null) {
launchUri = "";
}
LaunchData data;
if (launchUri.contains(ADD_ISSUER_PATH)) {
data = handleAddIssuerUri(launchUri);
if (data != null) {
... | LaunchData launchData = SplashUrlDecoder.getLaunchType(ADD_ISSUER_URL);
assertEquals(ADD_ISSUER, launchData.getLaunchType());
assertEquals("https://certificates.learningmachine.com/issuer/asdf.json", launchData.getIntroUrl());
assertEquals("a*bcd", launchData.getNonce());
}
} | [FOCAL] public static LaunchData SplashUrlDecoder.getLaunchType(String launchUri)
[CLASS] class SplashUrlDecoder
[METRICS] loc=21 cc=6 branches=5 loops=0 returns=3 throws=0 nesting=3
[CALLS-INTERNAL] LaunchData handleAddCertificateUri(String uriString); LaunchData handleAddIssuerUri(String uriString)
[CALLS-EXTERNAL] S... | /* static context
[FOCAL] public static LaunchData SplashUrlDecoder.getLaunchType(String launchUri)
[PATH1] if(launchUri == null)=T -> if(launchUri.contains(ADD_ISSUER_PATH))=F -> if(launchUri.contains(ADD_CERT_PATH))=T -> if(data != null)#2=T -> return data
[PATH2] if(launchUri == null)=F -> if(launchUri.contains(ADD_... | /* static context
[FOCAL] public static LaunchData SplashUrlDecoder.getLaunchType(String launchUri)
[PATH1] if(launchUri == null)=T -> if(launchUri.contains(ADD_ISSUER_PATH))=F -> if(launchUri.contains(ADD_CERT_PATH))=T -> if(data != null)#2=T -> return data
[PATH2] if(launchUri == null)=F -> if(launchUri.contains(ADD_... | true | ok | {"focal": {"class": "SplashUrlDecoder", "name": "getLaunchType", "signature": "LaunchData getLaunchType(String launchUri)", "start_line": 3, "modifiers": "public static", "params": [{"name": "launchUri", "type": "String"}], "return_type": "LaunchData"}, "class_info": {"name": "SplashUrlDecoder", "kind": "class", "modif... |
93973957_0 | class Cloud {
public void createPacketsFile() {
File packetsFile = new File(this.sharedDir, "Packets.txt");
if (packetsFile.exists()) {
try {
packetsFile.createNewFile();
} catch (IOException e) {
log.error("Cannot create", e);
}
}
try (PrintWriter writer = new PrintWriter(new FileOutputStrea... | Cloud cloud = new Cloud();
cloud.createPacketsFile();
File file = new File(cloud.getSharedDir(), "Packets.txt");
try (BufferedReader inputStream = new BufferedReader(new FileReader(file))) {
List<String> lines = inputStream.lines().collect(Collectors.toList());
for (int i = 0; i < lines.size(); i++) {
... | [FOCAL] public void Cloud.createPacketsFile()
[CLASS] class Cloud
[METRICS] loc=17 cc=5 branches=1 loops=1 returns=0 throws=0 nesting=2
[CALLS-EXTERNAL] File.exists/0, File.createNewFile/0, log.error/2, PacketManager.getInstance().getPackets/0, PacketManager.getInstance/0, PrintWriter.println/1, Class<? extends Packet>... | /* static context
[FOCAL] public void Cloud.createPacketsFile()
[PATH1] if(packetsFile.exists())=T -> try-body throws -> foreach(Class<? extends Packet> packet : PacketManager.getInstance().getPackets())=T -> exit loop
[PATH2] if(packetsFile.exists())=F -> foreach(Class<? extends Packet> packet : PacketManager.getInsta... | /* static context
[FOCAL] public void Cloud.createPacketsFile()
[PATH1] if(packetsFile.exists())=T -> try-body throws -> foreach(Class<? extends Packet> packet : PacketManager.getInstance().getPackets())=T -> exit loop
[PATH2] if(packetsFile.exists())=F -> foreach(Class<? extends Packet> packet : PacketManager.getInsta... | true | ok | {"focal": {"class": "Cloud", "name": "createPacketsFile", "signature": "void createPacketsFile()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "Cloud", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "C... |
94000641_0 | class QuestionRepository implements QuestionDataSource {
@Override public Flowable<List<Question>> loadQuestions(boolean forceRemote) {
if (forceRemote) {
return refreshData();
} else {
if (caches.size() > 0) {
// if cache is available, return it immediately
return Flowable.just(c... | // Given
repository.caches.addAll(questions);
// When
repository.loadQuestions(false).subscribe(questionsTestSubscriber);
// Then
// No interaction with local storage or remote source
verifyZeroInteractions(localDataSource);
verifyZeroInteractions(remoteDataSource);
questionsTestS... | [FOCAL] @Override public Flowable<List<Question>> QuestionRepository.loadQuestions(boolean forceRemote)
[CLASS] class QuestionRepository implements QuestionDataSource
[METRICS] loc=21 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=2
[CALLS-INTERNAL] Flowable<List<Question>> refreshData()
[CALLS-EXTERNAL] caches.siz... | /* static context
[FOCAL] @Override public Flowable<List<Question>> QuestionRepository.loadQuestions(boolean forceRemote)
[PATH1] if(forceRemote)=F -> if(caches.size() > 0)=T -> return Flowable.just(caches)
[PATH2] if(forceRemote)=T -> return refreshData()
[PATH3] if(forceRemote)=F -> if(caches.size() > 0)=F -> return ... | /* static context
[FOCAL] @Override public Flowable<List<Question>> QuestionRepository.loadQuestions(boolean forceRemote)
[PATH1] if(forceRemote)=F -> if(caches.size() > 0)=T -> return Flowable.just(caches)
[PATH2] if(forceRemote)=T -> return refreshData()
[PATH3] if(forceRemote)=F -> if(caches.size() > 0)=F -> return ... | true | ok | {"focal": {"class": "QuestionRepository", "name": "loadQuestions", "signature": "Flowable<List<Question>> loadQuestions(boolean forceRemote)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "forceRemote", "type": "boolean"}], "return_type": "Flowable<List<Question>>"}, "class_info": {"name": "Que... |
94090559_61 | class CacheUtils {
public long getCacheSize() {
return mCacheManager.getCacheSize();
}
private CacheUtils(@NonNull File cacheDir, long maxSize, int maxCount);
public static CacheUtils getInstance();
public static CacheUtils getInstance(String cacheName);
public static CacheUtils getI... | Assert.assertEquals(FileUtils.getDirLength(file1), mCacheUtils1.getCacheSize());
Assert.assertEquals(FileUtils.getDirLength(file2), mCacheUtils2.getCacheSize());
}
} | [FOCAL] public long CacheUtils.getCacheSize()
[CLASS] class CacheUtils
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] mCacheManager.getCacheSize/0
[COLLABORATORS] field mCacheManager getCacheSize/0
[CLASS-MEMBERS] CacheUtils(File cacheDir, long maxSize, int maxCount); CacheUtils g... | /* static context
[FOCAL] public long CacheUtils.getCacheSize()
[COLLABORATORS] field mCacheManager getCacheSize/0
[CALLS-EXTERNAL] mCacheManager.getCacheSize/0
*/
| /* static context
[FOCAL] public long CacheUtils.getCacheSize()
[COLLABORATORS] field mCacheManager getCacheSize/0
[CALLS-EXTERNAL] mCacheManager.getCacheSize/0
*/
class CacheUtils {
public long getCacheSize() {
return mCacheManager.getCacheSize();
}
private CacheUtils(@NonNull File cacheDir, lon... | true | ok | {"focal": {"class": "CacheUtils", "name": "getCacheSize", "signature": "long getCacheSize()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "long"}, "class_info": {"name": "CacheUtils", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "path1", "type": ... |
94165107_13 | class PageHelper {
public <P extends BasePageObject<P>> P newInstance(Class<P> expectedPage, Object... params) {
try {
// Account for PageObjects that only have a BrowserBasedTest constructor.
if (params.length > 0) {
Class<?>[] constructorArguments = new Class<?>[2... |
PageHelper tpo = setUpMocks();
TestPageObject testPageObject = tpo.newInstance(TestPageObject.class);
assertNotNull("Should not be null when constructing instance of "
+ TestPageObject.class.getName(),
testPageObject);
}
} | [FOCAL] public P PageHelper.newInstance(Class<P> expectedPage, Object... params)
[CLASS] class PageHelper
[METRICS] loc=22 cc=4 branches=2 loops=0 returns=2 throws=2 nesting=2
[CALLS-INTERNAL] BrowserBasedTest getTest()
[CALLS-EXTERNAL] expectedPage.getDeclaredConstructor(constructorArguments).newInstance/2, Class<P>.g... | /* static context
[FOCAL] public P PageHelper.newInstance(Class<P> expectedPage, Object... params)
[THROWS-WHEN] RuntimeException when try-body throws && e.getMessage() == null && e.getCause() != null
[THROWS-WHEN] RuntimeException when try-body throws && !(e.getMessage() == null && e.getCause() != null)
[PATH1] try-bo... | /* static context
[FOCAL] public P PageHelper.newInstance(Class<P> expectedPage, Object... params)
[THROWS-WHEN] RuntimeException when try-body throws && e.getMessage() == null && e.getCause() != null
[THROWS-WHEN] RuntimeException when try-body throws && !(e.getMessage() == null && e.getCause() != null)
[PATH1] try-bo... | true | ok | {"focal": {"class": "PageHelper", "name": "newInstance", "signature": "P newInstance(Class<P> expectedPage, Object... params)", "start_line": 3, "modifiers": "public", "params": [{"name": "expectedPage", "type": "Class<P>"}, {"name": "params", "type": "Object..."}], "return_type": "P"}, "class_info": {"name": "PageHelp... |
94222613_4 | class BaggageMetricLabel implements MetricLabel {
@Override
public Object value(SpanData spanData) {
Object ret = spanData.getBaggageItem(name());
return ret == null ? defaultValue : ret;
}
public BaggageMetricLabel(String name, Object defaultValue);
@Override public String name(... | MetricLabel label = new BaggageMetricLabel(TEST_LABEL, TEST_LABEL_DEFAULT);
SpanData spanData = mock(SpanData.class);
when(spanData.getBaggageItem(anyString())).thenReturn("BaggageValue");
assertEquals("BaggageValue", label.value(spanData));
verify(spanData, times(1)).ge... | [FOCAL] @Override public Object BaggageMetricLabel.value(SpanData spanData)
[CLASS] class BaggageMetricLabel implements MetricLabel
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String name()
[CALLS-EXTERNAL] SpanData.getBaggageItem/1
[INPUTS] branches=- | result=spanData
[COLLAB... | /* static context
[FOCAL] @Override public Object BaggageMetricLabel.value(SpanData spanData)
[INPUTS] branches=- | result=spanData
[COLLABORATORS] param spanData:SpanData getBaggageItem/1
[CALLS-INTERNAL] String name()
[CALLS-EXTERNAL] SpanData.getBaggageItem/1
*/
| /* static context
[FOCAL] @Override public Object BaggageMetricLabel.value(SpanData spanData)
[INPUTS] branches=- | result=spanData
[COLLABORATORS] param spanData:SpanData getBaggageItem/1
[CALLS-INTERNAL] String name()
[CALLS-EXTERNAL] SpanData.getBaggageItem/1
*/
class BaggageMetricLabel implements MetricLabel {
... | true | ok | {"focal": {"class": "BaggageMetricLabel", "name": "value", "signature": "Object value(SpanData spanData)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "spanData", "type": "SpanData"}], "return_type": "Object"}, "class_info": {"name": "BaggageMetricLabel", "kind": "class", "modifiers": "", "sup... |
94284531_10 | class ShadowResources {
public String getString(@StringRes int id) throws NotFoundException {
return getText(id).toString();
}
public ShadowResources();
@NonNull protected CharSequence getText(@StringRes int id);
@NonNull public String[] getStringArray(@ArrayRes int id);
@NonNull pub... | Assert.assertEquals("KBUnitTest", resources.getString(R.string.test_string));
}
} | [FOCAL] public String ShadowResources.getString(int id)
[CLASS] class ShadowResources
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] CharSequence getText(int id)
[CALLS-EXTERNAL] getText(id).toString/0
[EXCEPTIONS] declares NotFoundException
[INPUTS] branches=- | result=id
[DATAFL... | /* static context
[FOCAL] public String ShadowResources.getString(int id)
[INPUTS] branches=- | result=id
[EXCEPTIONS] declares NotFoundException
[CALLS-INTERNAL] CharSequence getText(int id)
[CALLS-EXTERNAL] getText(id).toString/0
*/
| /* static context
[FOCAL] public String ShadowResources.getString(int id)
[INPUTS] branches=- | result=id
[EXCEPTIONS] declares NotFoundException
[CALLS-INTERNAL] CharSequence getText(int id)
[CALLS-EXTERNAL] getText(id).toString/0
*/
class ShadowResources {
public String getString(@StringRes int id) throws NotFou... | true | ok | {"focal": {"class": "ShadowResources", "name": "getString", "signature": "String getString(int id) throws NotFoundException", "start_line": 3, "modifiers": "public", "params": [{"name": "id", "type": "int"}], "return_type": "String"}, "class_info": {"name": "ShadowResources", "kind": "class", "modifiers": "", "supercla... |
94457960_67 | class JSPackagerClient implements ReconnectingWebSocket.MessageCallback {
@Override
public void onMessage(ResponseBody response) {
if (response.contentType() != WebSocket.TEXT) {
FLog.w(
TAG,
"Websocket received message with payload of unexpected type " + response.contentType());
re... | RequestHandler handler = mock(RequestHandler.class);
final JSPackagerClient client = new JSPackagerClient("test_client", mSettings, createRH("methodValue", handler));
client.onMessage(
ResponseBody.create(
WebSocket.TEXT,
"{\"version\": 2}"));
verify(handler, never()).onNoti... | [FOCAL] @Override public void JSPackagerClient.onMessage(ResponseBody response)
[CLASS] class JSPackagerClient implements ReconnectingWebSocket.MessageCallback
[METRICS] loc=46 cc=7 branches=5 loops=0 returns=4 throws=0 nesting=2
[CALLS-INTERNAL] void abortOnMessage(Object id, String reason)
[CALLS-EXTERNAL] ResponseBo... | /* static context
[FOCAL] @Override public void JSPackagerClient.onMessage(ResponseBody response)
[PATH1] if(response.contentType() != WebSocket.TEXT)=F -> if(version != PROTOCOL_VERSION)=F -> if(method == null)=F -> if(handler == null)=T -> return
[PATH2] if(response.contentType() != WebSocket.TEXT)=F -> if(version !=... | /* static context
[FOCAL] @Override public void JSPackagerClient.onMessage(ResponseBody response)
[PATH1] if(response.contentType() != WebSocket.TEXT)=F -> if(version != PROTOCOL_VERSION)=F -> if(method == null)=F -> if(handler == null)=T -> return
[PATH2] if(response.contentType() != WebSocket.TEXT)=F -> if(version !=... | true | ok | {"focal": {"class": "JSPackagerClient", "name": "onMessage", "signature": "void onMessage(ResponseBody response)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "response", "type": "ResponseBody"}], "return_type": "void"}, "class_info": {"name": "JSPackagerClient", "kind": "class", "modifiers": ... |
94459145_2 | class PdfParser {
public static Codebook parseCodebookPdf(SupportedCodebook codebookSource) {
try (InputStream codebookPdfStream = codebookSource.getCodebookPdfInputStream();) {
List<String> codebookTextLines = extractTextLinesFromPdf(codebookPdfStream);
Codebook codebook = new Codebook(codebookSource);
... | for (SupportedCodebook supportedCodebook : SupportedCodebook.values()) {
LOGGER.info("Looking for sections in codebook: {}", supportedCodebook.name());
Codebook codebook = PdfParser.parseCodebookPdf(supportedCodebook);
/*
* Since this test runs against all of the PDFs, it's mostly just a
* "make su... | [FOCAL] public static Codebook PdfParser.parseCodebookPdf(SupportedCodebook codebookSource)
[CLASS] class PdfParser
[METRICS] loc=24 cc=3 branches=0 loops=1 returns=1 throws=1 nesting=2
[CALLS-INTERNAL] List<List<String>> findVariableSections(List<String> codebookTextLines); List<String> extractTextLinesFromPdf(InputSt... | /* static context
[FOCAL] public static Codebook PdfParser.parseCodebookPdf(SupportedCodebook codebookSource)
[THROWS-WHEN] UncheckedIOException when try-body throws
[PATH1] foreach(List<String> variableSection : variableSections)=T -> exit loop -> return codebook
[PATH2] try-body throws -> throw new UncheckedIOExcepti... | /* static context
[FOCAL] public static Codebook PdfParser.parseCodebookPdf(SupportedCodebook codebookSource)
[THROWS-WHEN] UncheckedIOException when try-body throws
[PATH1] foreach(List<String> variableSection : variableSections)=T -> exit loop -> return codebook
[PATH2] try-body throws -> throw new UncheckedIOExcepti... | true | ok | {"focal": {"class": "PdfParser", "name": "parseCodebookPdf", "signature": "Codebook parseCodebookPdf(SupportedCodebook codebookSource)", "start_line": 3, "modifiers": "public static", "params": [{"name": "codebookSource", "type": "SupportedCodebook"}], "return_type": "Codebook"}, "class_info": {"name": "PdfParser", "ki... |
94524678_483 | class Configuration extends AbstractConfiguration {
public boolean isDisplaySearchRssLinks() {
return getLocalBoolean("rss.displaySearchRssLinks", true);
}
public Configuration(String configFilePath);
protected static Set<String> loadStopwords(String stopwordsFilePath);
public Set<String... | Assert.assertFalse(DataManager.getInstance().getConfiguration().isDisplaySearchRssLinks());
}
} | [FOCAL] public boolean Configuration.isDisplaySearchRssLinks()
[CLASS] class Configuration extends AbstractConfiguration
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] getLocalBoolean/2 (inherited)
[CLASS-MEMBERS] Configuration(String configFilePath); Set<String> loadStopwords(Str... | class Configuration extends AbstractConfiguration {
public boolean isDisplaySearchRssLinks() {
return getLocalBoolean("rss.displaySearchRssLinks", true);
}
public Configuration(String configFilePath);
protected static Set<String> loadStopwords(String stopwordsFilePath);
public Set<String... | false | ok | {"focal": {"class": "Configuration", "name": "isDisplaySearchRssLinks", "signature": "boolean isDisplaySearchRssLinks()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "Configuration", "kind": "class", "modifiers": "", "superclass": "AbstractConfiguration", "int... | |
94570463_0 | class RxStores {
public static <STATE> Observable<STATE> states(Store<STATE> store) {
if (store == null) {
throw new IllegalArgumentException("Store is null");
}
return Observable.create(new StoreOnSubscribe<>(store), BackpressureMode.ERROR);
}
private RxStores();
}
class RxStoresTest {
... | //GIVEN
Store<Integer> store = new Store<>(0);
TestSubscriber<Integer> testSubscriber = new TestSubscriber<>();
//WHEN
states(store).subscribe(testSubscriber);
//THEN
testSubscriber.assertNoTerminalEvent();
testSubscriber.assertValue(0);
}
} | [FOCAL] public static Observable<STATE> RxStores.states(Store<STATE> store)
[CLASS] class RxStores
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] Observable.create/2
[NEW] IllegalArgumentException, StoreOnSubscribe<>
[EXCEPTIONS] throws IllegalArgumentException
[THROWS-WHEN] Illeg... | /* static context
[FOCAL] public static Observable<STATE> RxStores.states(Store<STATE> store)
[THROWS-WHEN] IllegalArgumentException when store == null
[PATH1] if(store == null)=T -> throw new IllegalArgumentException("Store is null")
[PATH2] if(store == null)=F -> return Observable.create(new StoreOnSubscribe<>(store)... | /* static context
[FOCAL] public static Observable<STATE> RxStores.states(Store<STATE> store)
[THROWS-WHEN] IllegalArgumentException when store == null
[PATH1] if(store == null)=T -> throw new IllegalArgumentException("Store is null")
[PATH2] if(store == null)=F -> return Observable.create(new StoreOnSubscribe<>(store)... | true | ok | {"focal": {"class": "RxStores", "name": "states", "signature": "Observable<STATE> states(Store<STATE> store)", "start_line": 3, "modifiers": "public static", "params": [{"name": "store", "type": "Store<STATE>"}], "return_type": "Observable<STATE>"}, "class_info": {"name": "RxStores", "kind": "class", "modifiers": "", "... |
94627909_0 | class CameraClient {
public Call<State> state() {
return service.state();
}
public CameraClient();
CameraClient(String basePath);
public Call<Info> info();
public Call<ListFiles.Response> listFiles(ListFiles listFilesCommand);
public Call<Status> commandStatus(Command.CommandId id);
private C... | final MockResponse mockResponse = new MockResponse()
.setResponseCode(200)
.setBody(loadFile("fixtures/cameraStateResponse.json"));
server.enqueue(mockResponse);
final Response<State> response = client.state().execute();
assertThat(response.code(), equalTo(200));
final State state... | [FOCAL] public Call<State> CameraClient.state()
[CLASS] class CameraClient
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] service.state/0
[COLLABORATORS] field service state/0
[CLASS-MEMBERS] CameraClient(); CameraClient(String basePath); Call<Info> info(); Call<ListFiles.Response... | /* static context
[FOCAL] public Call<State> CameraClient.state()
[COLLABORATORS] field service state/0
[CALLS-EXTERNAL] service.state/0
*/
| /* static context
[FOCAL] public Call<State> CameraClient.state()
[COLLABORATORS] field service state/0
[CALLS-EXTERNAL] service.state/0
*/
class CameraClient {
public Call<State> state() {
return service.state();
}
public CameraClient();
CameraClient(String basePath);
public Call<Info> info();
pu... | true | ok | {"focal": {"class": "CameraClient", "name": "state", "signature": "Call<State> state()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Call<State>"}, "class_info": {"name": "CameraClient", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "client", "ty... |
94631072_0 | class LocationFragment extends LifecycleFragment implements LocationListener {
@Override
public void onAttach(Context context) {
super.onAttach(context);
FragmentActivity activity = getActivity();
LocationViewModel locationViewModel = getViewModelProvider(activity).get(LocationViewModel... |
locationFragment.onAttach(context);
verify(locationLiveData).observe(eq(locationFragment), any(Observer.class));
}
} | [FOCAL] @Override public void LocationFragment.onAttach(Context context)
[CLASS] class LocationFragment extends LifecycleFragment implements LocationListener
[METRICS] loc=13 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] ViewModelProvider getViewModelProvider(FragmentActivity activity); void upd... | /* static context
[FOCAL] @Override public void LocationFragment.onAttach(Context context)
[CALLS-INTERNAL] ViewModelProvider getViewModelProvider(FragmentActivity activity); void updateLocation(CommonLocation location)
[NEW] Observer<CommonLocation>
[CALLS-EXTERNAL] LifecycleFragment.onAttach/1, getActivity/0 (inherit... | /* static context
[FOCAL] @Override public void LocationFragment.onAttach(Context context)
[CALLS-INTERNAL] ViewModelProvider getViewModelProvider(FragmentActivity activity); void updateLocation(CommonLocation location)
[NEW] Observer<CommonLocation>
[CALLS-EXTERNAL] LifecycleFragment.onAttach/1, getActivity/0 (inherit... | true | ok | {"focal": {"class": "LocationFragment", "name": "onAttach", "signature": "void onAttach(Context context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "context", "type": "Context"}], "return_type": "void"}, "class_info": {"name": "LocationFragment", "kind": "class", "modifiers": "", "superclas... |
94749724_21 | class AddEditNotePresenter implements
AddEditNoteContract.Presenter, TokenCompleteTextView.TokenListener<Tag> {
@Override
public void saveNote(String noteNote, List<Tag> noteTags) {
if (isNewNote()) {
createNote(noteNote, noteTags);
} else {
updateNote(noteNote, ... | String noteNote = defaultNote.getNote();
String linkId = defaultNote.getLinkId();
List<Tag> noteTags = defaultNote.getTags();
when(repository.saveNote(any(Note.class), eq(false)))
.thenReturn(Observable.just(DataSource.ItemState.DEFERRED));
presenter.saveNote(not... | [FOCAL] @Override public void AddEditNotePresenter.saveNote(String noteNote, List<Tag> noteTags)
[CLASS] class AddEditNotePresenter implements AddEditNoteContract.Presenter, TokenCompleteTextView.TokenListener<Tag>
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] boolean isNewNote()... | /* static context
[FOCAL] @Override public void AddEditNotePresenter.saveNote(String noteNote, List<Tag> noteTags)
[PATH1] if(isNewNote())=T
[PATH2] if(isNewNote())=F
[CALLS-INTERNAL] boolean isNewNote(); void createNote(String noteNote, List<Tag> noteTags); void updateNote(String noteNote, List<Tag> noteTags)
*/
| /* static context
[FOCAL] @Override public void AddEditNotePresenter.saveNote(String noteNote, List<Tag> noteTags)
[PATH1] if(isNewNote())=T
[PATH2] if(isNewNote())=F
[CALLS-INTERNAL] boolean isNewNote(); void createNote(String noteNote, List<Tag> noteTags); void updateNote(String noteNote, List<Tag> noteTags)
*/
class... | true | ok | {"focal": {"class": "AddEditNotePresenter", "name": "saveNote", "signature": "void saveNote(String noteNote, List<Tag> noteTags)", "start_line": 4, "modifiers": "@Override public", "params": [{"name": "noteNote", "type": "String"}, {"name": "noteTags", "type": "List<Tag>"}], "return_type": "void"}, "class_info": {"name... |
94803952_27 | class MarkLogicBooleanQuery extends MarkLogicQuery implements BooleanQuery,MarkLogicQueryDependent {
@Override
public boolean evaluate() throws QueryEvaluationException {
try {
sync();
return getMarkLogicClient().sendBooleanQuery(getQueryString(), getBindings(), getIncludeInferr... | String queryString = "ASK {GRAPH <http://example.org/test/g27> {<http://semanticbible.org/ns/2006/NTNames#Shelah1> ?p ?o}}";
conn.setOptimizeLevel(0);
BooleanQuery booleanQuery = conn.prepareBooleanQuery(QueryLanguage.SPARQL, queryString);
boolean results = booleanQuery.evaluate();
... | [FOCAL] @Override public boolean MarkLogicBooleanQuery.evaluate()
[CLASS] class MarkLogicBooleanQuery extends MarkLogicQuery implements BooleanQuery,MarkLogicQueryDependent
[METRICS] loc=15 cc=5 branches=0 loops=0 returns=1 throws=4 nesting=1
[CALLS-EXTERNAL] sync/0 (inherited), getMarkLogicClient().sendBooleanQuery/4,... | /* static context
[FOCAL] @Override public boolean MarkLogicBooleanQuery.evaluate()
[THROWS-WHEN] QueryEvaluationException when try-body throws
[PATH1] try-body throws -> throw new QueryEvaluationException(e.getMessage(), e)
[PATH2] return getMarkLogicClient().sendBooleanQuery(getQueryString(), getBindings...
[EXCEPTIO... | /* static context
[FOCAL] @Override public boolean MarkLogicBooleanQuery.evaluate()
[THROWS-WHEN] QueryEvaluationException when try-body throws
[PATH1] try-body throws -> throw new QueryEvaluationException(e.getMessage(), e)
[PATH2] return getMarkLogicClient().sendBooleanQuery(getQueryString(), getBindings...
[EXCEPTIO... | true | ok | {"focal": {"class": "MarkLogicBooleanQuery", "name": "evaluate", "signature": "boolean evaluate() throws QueryEvaluationException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "boolean"}, "class_info": {"name": "MarkLogicBooleanQuery", "kind": "class", "modifiers": "", "superclass": "... |
94876336_0 | class HelloWorld {
public static String getHelloWorld() {
return "Hello from Java!";
}
}
class HelloWorldTest {
@Test
public void testHelloWorld() {
| assertEquals("Hello from Java!", HelloWorld.getHelloWorld());
}
} | [FOCAL] public static String HelloWorld.getHelloWorld()
[CLASS] class HelloWorld
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[TEST] HelloWorldTest: @Test public void testHelloWorld() | /* static context
[FOCAL] public static String HelloWorld.getHelloWorld()
*/
| /* static context
[FOCAL] public static String HelloWorld.getHelloWorld()
*/
class HelloWorld {
public static String getHelloWorld() {
return "Hello from Java!";
}
}
class HelloWorldTest {
@Test
public void testHelloWorld() {
| true | ok | {"focal": {"class": "HelloWorld", "name": "getHelloWorld", "signature": "String getHelloWorld()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "String"}, "class_info": {"name": "HelloWorld", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members":... |
94914141_3 | class LiveboardImpl extends StopLocationImpl implements Liveboard, Serializable {
public LiveboardType getLiveboardType() {
return mType;
}
public LiveboardImpl(StopLocation station, VehicleStop[] stops, DateTime searchTime, LiveboardType type, QueryTimeDefinition timeDefinition);
public Veh... | DateTime mDateTime = DateTime.now();
StopLocation station = Mockito.mock(StopLocation.class);
Mockito.when(station.getHafasId()).thenReturn("008814001");
VehicleStop stop = Mockito.mock(VehicleStop.class);
VehicleStop[] stops = new VehicleStop[]{stop};
Liveboard departing... | [FOCAL] public LiveboardType LiveboardImpl.getLiveboardType()
[CLASS] class LiveboardImpl extends StopLocationImpl implements Liveboard, Serializable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] LiveboardImpl(StopLocation station, VehicleStop[] stops, DateTime searchTime, Liveboa... | /* static context
[FOCAL] public LiveboardType LiveboardImpl.getLiveboardType()
*/
| /* static context
[FOCAL] public LiveboardType LiveboardImpl.getLiveboardType()
*/
class LiveboardImpl extends StopLocationImpl implements Liveboard, Serializable {
public LiveboardType getLiveboardType() {
return mType;
}
public LiveboardImpl(StopLocation station, VehicleStop[] stops, DateTime s... | true | ok | {"focal": {"class": "LiveboardImpl", "name": "getLiveboardType", "signature": "LiveboardType getLiveboardType()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "LiveboardType"}, "class_info": {"name": "LiveboardImpl", "kind": "class", "modifiers": "", "superclass": "StopLocationImpl", "interfaces... |
94987426_0 | class Base32Utils {
public static String encode(byte[] input) {
byte b;
int symbol;
int carry = 0;
int shift = 3;
StringBuilder sb = new StringBuilder();
for (byte value : input) {
b = value;
symbol = carry | (b >> shift);
sb.appe... | assertEquals("MY", Base32Utils.encode("f".getBytes()));
assertEquals("MZXQ", Base32Utils.encode("fo".getBytes()));
assertEquals("MZXW6", Base32Utils.encode("foo".getBytes()));
assertEquals("MZXW6YQ", Base32Utils.encode("foob".getBytes()));
assertEquals("MZXW6YTB", Base32Utils.enc... | [FOCAL] public static String Base32Utils.encode(byte[] input)
[CLASS] class Base32Utils
[METRICS] loc=29 cc=4 branches=2 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] StringBuilder.append/1, StringBuilder.toString/0
[NEW] StringBuilder
[PATH1] foreach(byte value : input)=T -> if(shift > 5)=T -> exit loop -> if(... | /* static context
[FOCAL] public static String Base32Utils.encode(byte[] input)
[PATH1] foreach(byte value : input)=T -> if(shift > 5)=T -> exit loop -> if(shift != 3)=T -> return sb.toString()
[PATH2] foreach(byte value : input)=F -> if(shift != 3)=F -> return sb.toString()
[PATH3] foreach(byte value : input)=T -> if(... | /* static context
[FOCAL] public static String Base32Utils.encode(byte[] input)
[PATH1] foreach(byte value : input)=T -> if(shift > 5)=T -> exit loop -> if(shift != 3)=T -> return sb.toString()
[PATH2] foreach(byte value : input)=F -> if(shift != 3)=F -> return sb.toString()
[PATH3] foreach(byte value : input)=T -> if(... | true | ok | {"focal": {"class": "Base32Utils", "name": "encode", "signature": "String encode(byte[] input)", "start_line": 3, "modifiers": "public static", "params": [{"name": "input", "type": "byte[]"}], "return_type": "String"}, "class_info": {"name": "Base32Utils", "kind": "class", "modifiers": "", "superclass": null, "interfac... |
95187094_29 | class HttpStubAuthenticatorConfig {
@Override
public String toString() {
return "HttpStubAuthenticatorConfig [uri: " + uri + ", poolSize: " + poolSize + ", timeoutMillis: " + timeoutMillis + "]";
}
public HttpStubAuthenticatorConfig withURI(URI uri);
public HttpStubAuthenticatorConfig withPoolSize(int p... | try (HttpStubAuthenticator auth = new MappingContext()
.withParser(new SnakeyamlParser())
.fromStream(HttpStubAuthenticatorConfigTest.class.getClassLoader().getResourceAsStream("http-stub-auth-config.yaml"))
.map(HttpStubAuthenticator.class)) {
assertEquals(new URI("http://localhost:80... | [FOCAL] @Override public String HttpStubAuthenticatorConfig.toString()
[CLASS] class HttpStubAuthenticatorConfig
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] HttpStubAuthenticatorConfig withURI(URI uri); HttpStubAuthenticatorConfig withPoolSize(int poolSize); HttpStubAuthenticato... | /* static context
[FOCAL] @Override public String HttpStubAuthenticatorConfig.toString()
*/
| /* static context
[FOCAL] @Override public String HttpStubAuthenticatorConfig.toString()
*/
class HttpStubAuthenticatorConfig {
@Override
public String toString() {
return "HttpStubAuthenticatorConfig [uri: " + uri + ", poolSize: " + poolSize + ", timeoutMillis: " + timeoutMillis + "]";
}
public HttpStubA... | true | ok | {"focal": {"class": "HttpStubAuthenticatorConfig", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "HttpStubAuthenticatorConfig", "kind": "class", "modifiers": "", "superclass": null, "interfaces": nul... |
95211078_2 | class CamtUtil {
public static boolean isMatchingXsdSchema(byte[] xmlAsBytes, @Nonnull String pathToXsd) {
try (ByteArrayInputStream xmlAsStream = new ByteArrayInputStream(xmlAsBytes);
InputStream xsdAsStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(pathToXsd)) {
SchemaFactory fa... | byte[] bytes = readXml(INVALID_XML);
assertFalse(CamtUtil.isMatchingXsdSchema(bytes, CAMT054V00104.getXsdPath()));
assertFalse(CamtUtil.isMatchingXsdSchema(readXml(VALID_CAMT53_XML), CAMT054V00104.getXsdPath()));
assertFalse(CamtUtil.isMatchingXsdSchema(readXml(VALID_CAMT54_XML), CAMT053V00104.getXsdPath()));
... | [FOCAL] public static boolean CamtUtil.isMatchingXsdSchema(byte[] xmlAsBytes, String pathToXsd)
[CLASS] class CamtUtil
[METRICS] loc=18 cc=3 branches=0 loops=0 returns=2 throws=1 nesting=1
[CALLS-EXTERNAL] Thread.currentThread().getContextClassLoader().getResourceAsStream/1, Thread.currentThread().getContextClassLoader... | /* static context
[FOCAL] public static boolean CamtUtil.isMatchingXsdSchema(byte[] xmlAsBytes, String pathToXsd)
[THROWS-WHEN] Iso20022RuntimeException when try-body throws
[PATH1] try-body throws -> throw new Iso20022RuntimeException("IO Exception while validating xml fil...
[PATH2] return true
[PATH3] try-body throw... | /* static context
[FOCAL] public static boolean CamtUtil.isMatchingXsdSchema(byte[] xmlAsBytes, String pathToXsd)
[THROWS-WHEN] Iso20022RuntimeException when try-body throws
[PATH1] try-body throws -> throw new Iso20022RuntimeException("IO Exception while validating xml fil...
[PATH2] return true
[PATH3] try-body throw... | true | ok | {"focal": {"class": "CamtUtil", "name": "isMatchingXsdSchema", "signature": "boolean isMatchingXsdSchema(byte[] xmlAsBytes, String pathToXsd)", "start_line": 3, "modifiers": "public static", "params": [{"name": "xmlAsBytes", "type": "byte[]"}, {"name": "pathToXsd", "type": "String"}], "return_type": "boolean"}, "class_... |
95222532_3 | class HdfsFSImageTool {
protected static int run(String[] args) {
final IExecutionExceptionHandler exceptionHandler = (ex, commandLine, parseResult) -> {
commandLine.getErr().println(commandLine.getColorScheme().errorText(ex.getMessage()));
if (getRootLogger().isInfoEnabled()) {
... | final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
HdfsFSImageTool.out = new PrintStream(byteArrayOutputStream);
HdfsFSImageTool.err = HdfsFSImageTool.out;
HdfsFSImageTool.run(new String[]{"-V"});
Pattern pattern = Pattern.compile("Version 1\\..*\n... | [FOCAL] protected static int HdfsFSImageTool.run(String[] args)
[CLASS] class HdfsFSImageTool
[METRICS] loc=21 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] commandLine.getErr().println/1, commandLine.getErr/0, commandLine.getColorScheme().errorText/1, commandLine.getColorScheme/0, ex.getMessage... | /* static context
[FOCAL] protected static int HdfsFSImageTool.run(String[] args)
[INPUTS] branches=- | result=args
[COLLABORATORS] field commandLine getErr/0,getColorScheme/0,getExitCodeExceptionMapper/0,getCommandSpec/0; field ex getMessage/0
[NEW] CommandLine, MainCommand, PrintWriter, RunLast
[CALLS-EXTERNAL] comma... | /* static context
[FOCAL] protected static int HdfsFSImageTool.run(String[] args)
[INPUTS] branches=- | result=args
[COLLABORATORS] field commandLine getErr/0,getColorScheme/0,getExitCodeExceptionMapper/0,getCommandSpec/0; field ex getMessage/0
[NEW] CommandLine, MainCommand, PrintWriter, RunLast
[CALLS-EXTERNAL] comma... | true | ok | {"focal": {"class": "HdfsFSImageTool", "name": "run", "signature": "int run(String[] args)", "start_line": 3, "modifiers": "protected static", "params": [{"name": "args", "type": "String[]"}], "return_type": "int"}, "class_info": {"name": "HdfsFSImageTool", "kind": "class", "modifiers": "", "superclass": null, "interfa... |
95247186_80 | class RuntimeController implements RuntimeApiDelegate {
@Override
public ResponseEntity<Runtime> getRuntime(String workspaceNamespace) {
String firecloudWorkspaceName = lookupWorkspace(workspaceNamespace).getFirecloudName();
workspaceService.enforceWorkspaceAccessLevelAndRegisteredAuthDomain(
works... | testLeoRuntime.setLabels(ImmutableMap.of("all-of-us-config", "preset-hail-genomic-analysis"));
when(userRuntimesApi.getRuntime(BILLING_PROJECT_ID, getRuntimeName()))
.thenReturn(testLeoRuntime);
assertThat(runtimeController.getRuntime(BILLING_PROJECT_ID).getBody().getConfigurationType())
.... | [FOCAL] @Override public ResponseEntity<Runtime> RuntimeController.getRuntime(String workspaceNamespace)
[CLASS] class RuntimeController implements RuntimeApiDelegate
[METRICS] loc=20 cc=3 branches=1 loops=0 returns=2 throws=1 nesting=2
[CALLS-INTERNAL] DbWorkspace lookupWorkspace(String workspaceNamespace); Runtime ge... | class RuntimeController implements RuntimeApiDelegate {
@Override
public ResponseEntity<Runtime> getRuntime(String workspaceNamespace) {
String firecloudWorkspaceName = lookupWorkspace(workspaceNamespace).getFirecloudName();
workspaceService.enforceWorkspaceAccessLevelAndRegisteredAuthDomain(
works... | false | ok | {"focal": {"class": "RuntimeController", "name": "getRuntime", "signature": "ResponseEntity<Runtime> getRuntime(String workspaceNamespace)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "workspaceNamespace", "type": "String"}], "return_type": "ResponseEntity<Runtime>"}, "class_info": {"name": "... | |
95247959_322 | class StaticImmutableTableSchema implements TableSchema<T> {
public static <T, B> Builder<T, B> builder(Class<T> itemClass, Class<B> builderClass) {
return new Builder<>(itemClass, builderClass);
}
private StaticImmutableTableSchema(Builder<T, B> builder);
@Override public StaticTableMetadat... | Set<Float> valueSet = new HashSet<>(asList(1.2f, 3.4f, 5.6f));
List<String> expectedList = valueSet.stream().map(Object::toString).collect(toList());
verifyNullableAttribute(EnhancedType.setOf(Float.class),
a -> a.name("value")
... | [FOCAL] public static Builder<T, B> StaticImmutableTableSchema.builder(Class<T> itemClass, Class<B> builderClass)
[CLASS] class StaticImmutableTableSchema implements TableSchema<T>
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] Builder<>
[INPUTS] branches=- | result=builderClass, itemClass
[... | /* static context
[FOCAL] public static Builder<T, B> StaticImmutableTableSchema.builder(Class<T> itemClass, Class<B> builderClass)
[INPUTS] branches=- | result=builderClass, itemClass
[NEW] Builder<>
*/
| /* static context
[FOCAL] public static Builder<T, B> StaticImmutableTableSchema.builder(Class<T> itemClass, Class<B> builderClass)
[INPUTS] branches=- | result=builderClass, itemClass
[NEW] Builder<>
*/
class StaticImmutableTableSchema implements TableSchema<T> {
public static <T, B> Builder<T, B> builder(Class<T... | true | ok | {"focal": {"class": "StaticImmutableTableSchema", "name": "builder", "signature": "Builder<T, B> builder(Class<T> itemClass, Class<B> builderClass)", "start_line": 3, "modifiers": "public static", "params": [{"name": "itemClass", "type": "Class<T>"}, {"name": "builderClass", "type": "Class<B>"}], "return_type": "Builde... |
95282920_2 | class HelloWithRepositoryController {
@GetMapping("/hello/data/{name}")
public Hello sayHi(@PathVariable String name) {
Optional<Person> person
= personRepository.findByFirstName(name);
String message =
person.map(person1 ->
String.format... | // Arrange
Person somkiat = new Person("somkiat", "pui");
given(personRepository.findByFirstName("somkiat"))
.willReturn(Optional.of(somkiat));
// Act
Hello hello = controller.sayHi("somkiat");
// Assert
assertEquals("Hello somkiat", hello.getMes... | [FOCAL] @GetMapping("/hello/data/{name}") public Hello HelloWithRepositoryController.sayHi(String name)
[CLASS] class HelloWithRepositoryController
[METRICS] loc=12 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] PersonRepository.findByFirstName/1, person.map(person1 -> String.format("Hello %s", p... | /* static context
[FOCAL] @GetMapping("/hello/data/{name}") public Hello HelloWithRepositoryController.sayHi(String name)
[INPUTS] branches=- | result=name, personRepository
[COLLABORATORS] field personRepository:PersonRepository findByFirstName/1; field person1 getFirstName/0
[FIELDS] read=personRepository:PersonRepos... | /* static context
[FOCAL] @GetMapping("/hello/data/{name}") public Hello HelloWithRepositoryController.sayHi(String name)
[INPUTS] branches=- | result=name, personRepository
[COLLABORATORS] field personRepository:PersonRepository findByFirstName/1; field person1 getFirstName/0
[FIELDS] read=personRepository:PersonRepos... | true | ok | {"focal": {"class": "HelloWithRepositoryController", "name": "sayHi", "signature": "Hello sayHi(String name)", "start_line": 3, "modifiers": "@GetMapping(\"/hello/data/{name}\") public", "params": [{"name": "name", "type": "String"}], "return_type": "Hello"}, "class_info": {"name": "HelloWithRepositoryController", "kin... |
95342834_0 | class BaseController extends Controller {
@NonNull @Override
protected final View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container) {
U view = createView(inflater, container);
view.setController(getThis());
return view;
}
public BaseController();
public BaseControll... | DummyView dummyView = (DummyView) dummyController.onCreateView(null, null);
Assert.assertEquals(dummyController, dummyView.getController());
}
} | [FOCAL] @NonNull @Override protected final View BaseController.onCreateView(LayoutInflater inflater, ViewGroup container)
[CLASS] class BaseController extends Controller
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] U createView(LayoutInflater inflater, ViewGroup container)
[CALL... | /* static context
[FOCAL] @NonNull @Override protected final View BaseController.onCreateView(LayoutInflater inflater, ViewGroup container)
[INPUTS] branches=- | result=container, inflater
[CALLS-INTERNAL] U createView(LayoutInflater inflater, ViewGroup container)
[CALLS-EXTERNAL] U.setController/1, getThis/0 (inherite... | /* static context
[FOCAL] @NonNull @Override protected final View BaseController.onCreateView(LayoutInflater inflater, ViewGroup container)
[INPUTS] branches=- | result=container, inflater
[CALLS-INTERNAL] U createView(LayoutInflater inflater, ViewGroup container)
[CALLS-EXTERNAL] U.setController/1, getThis/0 (inherite... | true | ok | {"focal": {"class": "BaseController", "name": "onCreateView", "signature": "View onCreateView(LayoutInflater inflater, ViewGroup container)", "start_line": 3, "modifiers": "@NonNull @Override protected final", "params": [{"name": "inflater", "type": "LayoutInflater"}, {"name": "container", "type": "ViewGroup"}], "retur... |
95357887_71 | class TasksPresenter implements TasksContract.Presenter {
@Override
public void completeTask(@NonNull Task completedTask) {
checkNotNull(completedTask, "completedTask cannot be null!");
mTasksRepository.completeTask(completedTask);
mTasksView.showTaskMarkedComplete();
loadTasks(... | // Given a stubbed task
Task task = new Task("Details Requested", "For this task");
// And no tasks available in the repository
when(mTasksRepository.getTasks()).thenReturn(Flowable.empty());
// When task is marked as complete
mTasksPresenter.completeTask(task);
... | [FOCAL] @Override public void TasksPresenter.completeTask(Task completedTask)
[CLASS] class TasksPresenter implements TasksContract.Presenter
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void loadTasks(boolean forceUpdate, boolean showLoadingUI)
[CALLS-EXTERNAL] checkNotNull/2 (... | /* static context
[FOCAL] @Override public void TasksPresenter.completeTask(Task completedTask)
[COLLABORATORS] field mTasksRepository:TasksRepository completeTask/1; field mTasksView:TasksContract.View showTaskMarkedComplete/0
[CALLS-INTERNAL] void loadTasks(boolean forceUpdate, boolean showLoadingUI)
[FIELDS] read=mT... | /* static context
[FOCAL] @Override public void TasksPresenter.completeTask(Task completedTask)
[COLLABORATORS] field mTasksRepository:TasksRepository completeTask/1; field mTasksView:TasksContract.View showTaskMarkedComplete/0
[CALLS-INTERNAL] void loadTasks(boolean forceUpdate, boolean showLoadingUI)
[FIELDS] read=mT... | true | ok | {"focal": {"class": "TasksPresenter", "name": "completeTask", "signature": "void completeTask(Task completedTask)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "completedTask", "type": "Task"}], "return_type": "void"}, "class_info": {"name": "TasksPresenter", "kind": "class", "modifiers": "", ... |
95374722_0 | class ByteArrayDequeue {
public void push(byte[] src) {
push(src, 0, src.length);
}
public ByteArrayDequeue();
ByteArrayDequeue(int initalCapacity);
public int getRemaining();
public void push(byte[] src, int srcOffset, int srcLengthToPush);
public void pushLast(byte[] src);
... | for (int i = 0; i < 200; i++) {
push("ABCDEFGH");
push("IJK");
assertEquals("ABCDE", pop(5));
assertEquals("FGHIJK", pop(6));
}
}
} | [FOCAL] public void ByteArrayDequeue.push(byte[] src)
[CLASS] class ByteArrayDequeue
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void push(byte[] src, int srcOffset, int srcLengthToPush)
[DATAFLOW] src@param->L2
[CLASS-MEMBERS] ByteArrayDequeue(); ByteArrayDequeue(int initalCap... | /* static context
[FOCAL] public void ByteArrayDequeue.push(byte[] src)
[CALLS-INTERNAL] void push(byte[] src, int srcOffset, int srcLengthToPush)
*/
| /* static context
[FOCAL] public void ByteArrayDequeue.push(byte[] src)
[CALLS-INTERNAL] void push(byte[] src, int srcOffset, int srcLengthToPush)
*/
class ByteArrayDequeue {
public void push(byte[] src) {
push(src, 0, src.length);
}
public ByteArrayDequeue();
ByteArrayDequeue(int initalCap... | true | ok | {"focal": {"class": "ByteArrayDequeue", "name": "push", "signature": "void push(byte[] src)", "start_line": 3, "modifiers": "public", "params": [{"name": "src", "type": "byte[]"}], "return_type": "void"}, "class_info": {"name": "ByteArrayDequeue", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null... |
95380855_2 | class IssueTextUtils {
public static String getFormattedIssueTitle(String volume, int number) {
return String.format(Locale.US, "%s #%d", volume, number);
}
public static String getFormattedIssueName(String issue, String volume, int number);
private static final String ISSUE_NAME;
private static final ... | assertEquals("getFormattedIssueTitle method returned incorrect string!",
FORMATTED_NAME_SHORT,
IssueTextUtils.getFormattedIssueTitle(VOLUME_NAME, ISSUE_NUMBER));
}
} | [FOCAL] public static String IssueTextUtils.getFormattedIssueTitle(String volume, int number)
[CLASS] class IssueTextUtils
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] String.format/4
[INPUTS] branches=- | result=number, volume
[DATAFLOW] number@param->L2; volume@param->L2
[CLAS... | /* static context
[FOCAL] public static String IssueTextUtils.getFormattedIssueTitle(String volume, int number)
[INPUTS] branches=- | result=number, volume
[CALLS-EXTERNAL] String.format/4
*/
| /* static context
[FOCAL] public static String IssueTextUtils.getFormattedIssueTitle(String volume, int number)
[INPUTS] branches=- | result=number, volume
[CALLS-EXTERNAL] String.format/4
*/
class IssueTextUtils {
public static String getFormattedIssueTitle(String volume, int number) {
return String.format(Loca... | true | ok | {"focal": {"class": "IssueTextUtils", "name": "getFormattedIssueTitle", "signature": "String getFormattedIssueTitle(String volume, int number)", "start_line": 3, "modifiers": "public static", "params": [{"name": "volume", "type": "String"}, {"name": "number", "type": "int"}], "return_type": "String"}, "class_info": {"n... |
95459293_16 | class TranslationUtils {
public static String toString(Object obj) {
return (obj == null) ? null : obj.toString();
}
private TranslationUtils();
public static Date toDate(DateTime date);
public static Date toDate(LocalDate ldate);
public static Date toDate(Calendar date);
public ... | URL url = null;
try {
url = new URL("http://localhost:80/");
} catch (MalformedURLException e) {
fail(e.getMessage());
}
assertEquals("http://localhost:80/", TranslationUtils.toString(url));
}
} | [FOCAL] public static String TranslationUtils.toString(Object obj)
[CLASS] class TranslationUtils
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Object.toString/0
[INPUTS] branches=- | result=obj
[DATAFLOW] obj@param->L2
[CLASS-MEMBERS] TranslationUtils(); Date toDate(DateTime dat... | /* static context
[FOCAL] public static String TranslationUtils.toString(Object obj)
[INPUTS] branches=- | result=obj
[CALLS-EXTERNAL] Object.toString/0
*/
| /* static context
[FOCAL] public static String TranslationUtils.toString(Object obj)
[INPUTS] branches=- | result=obj
[CALLS-EXTERNAL] Object.toString/0
*/
class TranslationUtils {
public static String toString(Object obj) {
return (obj == null) ? null : obj.toString();
}
private TranslationUtils... | true | ok | {"focal": {"class": "TranslationUtils", "name": "toString", "signature": "String toString(Object obj)", "start_line": 3, "modifiers": "public static", "params": [{"name": "obj", "type": "Object"}], "return_type": "String"}, "class_info": {"name": "TranslationUtils", "kind": "class", "modifiers": "", "superclass": null,... |
95534270_328 | class CliBootstrap {
static File getPlatformRootPath(CliBootstrapEnvironment env) {
// make sure APPNG_HOME is set and valid
File appngHome = env.getFileFromEnv(APPNG_HOME);
return checkFile(APPNG_HOME, appngHome, true);
}
public static void main(String[] args);
public static int run(String[] args);
static... | try {
CliBootstrap.getPlatformRootPath(cliBootstrapEnvironment);
Assert.fail("IllegalArgumentException expected, but no exception has been thrown.");
} catch (IllegalArgumentException e) {
Assert.assertEquals("APPNG_HOME is not defined!", e.getMessage());
}
}
} | [FOCAL] static File CliBootstrap.getPlatformRootPath(CliBootstrapEnvironment env)
[CLASS] class CliBootstrap
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] File checkFile(String name, File file, boolean isDirectory)
[CALLS-EXTERNAL] CliBootstrapEnvironment.getFileFromEnv/1
[INPUTS... | /* static context
[FOCAL] static File CliBootstrap.getPlatformRootPath(CliBootstrapEnvironment env)
[INPUTS] branches=- | result=env
[COLLABORATORS] param env:CliBootstrapEnvironment getFileFromEnv/1
[CALLS-INTERNAL] File checkFile(String name, File file, boolean isDirectory)
[CALLS-EXTERNAL] CliBootstrapEnvironment.ge... | /* static context
[FOCAL] static File CliBootstrap.getPlatformRootPath(CliBootstrapEnvironment env)
[INPUTS] branches=- | result=env
[COLLABORATORS] param env:CliBootstrapEnvironment getFileFromEnv/1
[CALLS-INTERNAL] File checkFile(String name, File file, boolean isDirectory)
[CALLS-EXTERNAL] CliBootstrapEnvironment.ge... | true | ok | {"focal": {"class": "CliBootstrap", "name": "getPlatformRootPath", "signature": "File getPlatformRootPath(CliBootstrapEnvironment env)", "start_line": 3, "modifiers": "static", "params": [{"name": "env", "type": "CliBootstrapEnvironment"}], "return_type": "File"}, "class_info": {"name": "CliBootstrap", "kind": "class",... |
95563905_4 | class RangeOverlapMerger {
static List<Range> join(List<Range> ranges) {
RangeOverlapMerger calculator = new RangeOverlapMerger(ranges);
return calculator.joinOverlappingRanges();
}
private RangeOverlapMerger(@NonNull List<Range> ranges);
private List<Range> joinOverlappingRanges();
... | List<Range> ranges = asList(
range(from(2017, Calendar.JANUARY, 1), from(2017, Calendar.JANUARY, 4)),
range(from(2017, Calendar.JANUARY, 6), from(2017, Calendar.JANUARY, 9))
);
assertEquals(ranges.size(), 2);
List<Range> result = RangeOverlapMerger.join(r... | [FOCAL] static List<Range> RangeOverlapMerger.join(List<Range> ranges)
[CLASS] class RangeOverlapMerger
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] RangeOverlapMerger.joinOverlappingRanges/0
[NEW] RangeOverlapMerger
[INPUTS] branches=- | result=ranges
[DATAFLOW] calculator@L2->... | /* static context
[FOCAL] static List<Range> RangeOverlapMerger.join(List<Range> ranges)
[INPUTS] branches=- | result=ranges
[NEW] RangeOverlapMerger
[CALLS-EXTERNAL] RangeOverlapMerger.joinOverlappingRanges/0
*/
| /* static context
[FOCAL] static List<Range> RangeOverlapMerger.join(List<Range> ranges)
[INPUTS] branches=- | result=ranges
[NEW] RangeOverlapMerger
[CALLS-EXTERNAL] RangeOverlapMerger.joinOverlappingRanges/0
*/
class RangeOverlapMerger {
static List<Range> join(List<Range> ranges) {
RangeOverlapMerger ca... | true | ok | {"focal": {"class": "RangeOverlapMerger", "name": "join", "signature": "List<Range> join(List<Range> ranges)", "start_line": 3, "modifiers": "static", "params": [{"name": "ranges", "type": "List<Range>"}], "return_type": "List<Range>"}, "class_info": {"name": "RangeOverlapMerger", "kind": "class", "modifiers": "", "sup... |
95591183_2 | class NetworkMonitor extends Monitor {
@Override
public void stop() {
super.stop();
if (!networkActivityDisposable.isDisposed()) {
networkActivityDisposable.dispose();
logger.d(TAG, "stop: disposed networkActivityDisposable");
}
}
public NetworkMonitor... | TestUtilComponent testUtilComponent = DaggerTestUtilComponent.builder()
.appModule(new AppModule(mockContext))
.fakeDateTimeModule(new FakeDateTimeModule())
.testLoggerModule(new TestLoggerModule())
.build();
PublishSubject<NetworkActivity... | [FOCAL] @Override public void NetworkMonitor.stop()
[CLASS] class NetworkMonitor extends Monitor
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] Monitor.stop/0, networkActivityDisposable.isDisposed/0, networkActivityDisposable.dispose/0, logger.d/2
[PATH1] if(!networkActivityDispos... | /* static context
[FOCAL] @Override public void NetworkMonitor.stop()
[PATH1] if(!networkActivityDisposable.isDisposed())=T
[PATH2] if(!networkActivityDisposable.isDisposed())=F
[COLLABORATORS] field networkActivityDisposable isDisposed/0,dispose/0
[CALLS-EXTERNAL] Monitor.stop/0, networkActivityDisposable.isDisposed/0... | /* static context
[FOCAL] @Override public void NetworkMonitor.stop()
[PATH1] if(!networkActivityDisposable.isDisposed())=T
[PATH2] if(!networkActivityDisposable.isDisposed())=F
[COLLABORATORS] field networkActivityDisposable isDisposed/0,dispose/0
[CALLS-EXTERNAL] Monitor.stop/0, networkActivityDisposable.isDisposed/0... | true | ok | {"focal": {"class": "NetworkMonitor", "name": "stop", "signature": "void stop()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "NetworkMonitor", "kind": "class", "modifiers": "", "superclass": "Monitor", "interfaces": null, "fields": [{"name": "mockConte... |
95603001_3 | class ArticleRepository implements IRepository<Article> {
@Override
public Observable<Article> get(int id) {
if(!cacheStore.isInCache(id)) {
if (isNetworkConnection()) {
return remoteSource.get(id)
.doOnNext(this::saveToLocal)
... | setDataSourceResult(local);
repository.get()
.observeOn(SCHEDULER.io())
.subscribeOn(SCHEDULER.ui())
.subscribe(this::resultShouldNotBeNull);
verify(local).get();
verify(mapper).map(anyList());
verify(manager).getActiveNetworkInfo... | [FOCAL] @Override public Observable<Article> ArticleRepository.get(int id)
[CLASS] class ArticleRepository implements IRepository<Article>
[METRICS] loc=15 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=2
[CALLS-INTERNAL] boolean isNetworkConnection()
[CALLS-EXTERNAL] CacheStore<Article>.isInCache/1, remoteSource.g... | /* static context
[FOCAL] @Override public Observable<Article> ArticleRepository.get(int id)
[PATH1] if(!cacheStore.isInCache(id))=T -> if(isNetworkConnection())=T -> return remoteSource.get(id) .doOnNext(this::saveToLocal) .map(mapper::map)...
[PATH2] if(!cacheStore.isInCache(id))=F -> return Observable.just(cacheStor... | /* static context
[FOCAL] @Override public Observable<Article> ArticleRepository.get(int id)
[PATH1] if(!cacheStore.isInCache(id))=T -> if(isNetworkConnection())=T -> return remoteSource.get(id) .doOnNext(this::saveToLocal) .map(mapper::map)...
[PATH2] if(!cacheStore.isInCache(id))=F -> return Observable.just(cacheStor... | true | ok | {"focal": {"class": "ArticleRepository", "name": "get", "signature": "Observable<Article> get(int id)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "id", "type": "int"}], "return_type": "Observable<Article>"}, "class_info": {"name": "ArticleRepository", "kind": "class", "modifiers": "", "super... |
95646670_0 | class WikidataHyponyms extends JCasAnnotator_ImplBase {
public String getWikidataId(String language, String title) throws JSONException, IOException {
if(title.contains("#"))
return null;
String url = "https://"+
language+
".wikipedia.org/w/api.php?action=query&titles="+title+"&ppprop=wikibase_item&pro... | WikidataHyponyms WikidataHyponyms = new WikidataHyponyms();
assertEquals("Q4692", WikidataHyponyms.getWikidataId("de", "Renaissance"));
assertEquals("Q169243", WikidataHyponyms.getWikidataId("en","Protagoras"));
}
} | [FOCAL] public String WikidataHyponyms.getWikidataId(String language, String title)
[CLASS] class WikidataHyponyms extends JCasAnnotator_ImplBase
[METRICS] loc=18 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=1
[CALLS-EXTERNAL] String.contains/1, System.out.println/1, Jsoup.connect(url).ignoreContentType(true).exe... | /* static context
[FOCAL] public String WikidataHyponyms.getWikidataId(String language, String title)
[PATH1] if(title.contains("#"))=F -> if(!json.getJSONObject("query").has("pages"))=F -> if(json.getJSONObject("query").getJSONObject("pages").getJSONObject(key).has("pageprops"))=T -> return (json.getJSONObject("query"... | /* static context
[FOCAL] public String WikidataHyponyms.getWikidataId(String language, String title)
[PATH1] if(title.contains("#"))=F -> if(!json.getJSONObject("query").has("pages"))=F -> if(json.getJSONObject("query").getJSONObject("pages").getJSONObject(key).has("pageprops"))=T -> return (json.getJSONObject("query"... | true | ok | {"focal": {"class": "WikidataHyponyms", "name": "getWikidataId", "signature": "String getWikidataId(String language, String title) throws JSONException, IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "language", "type": "String"}, {"name": "title", "type": "String"}], "return_type": "String"}... |
95657746_0 | class Strings {
public static String format(final String format, final Object... args) {
String retVal = format;
for (final Object current : args) {
retVal = retVal.replaceFirst("[%][s]", current.toString());
}
return retVal;
}
}
class StringsTest {
@Test
... | this.assertFormat("Some test here %s.", 54);
this.assertFormat("Some test here %s and there %s, and test [%s]. sfsfs !!!", 54, 59, "HAHA");
this.assertFormat("Some test here %s and there %s, and test [%s]. sfsfs !!!", 54, 59, "HAHA", "DONT SHOW");
Assert.assertEquals("Formatting is n... | [FOCAL] public static String Strings.format(String format, Object... args)
[CLASS] class Strings
[METRICS] loc=7 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] String.replaceFirst/2, Object.toString/0
[PATH1] foreach(Object current : args)=T -> exit loop -> return retVal
[PATH2] foreach(Object cu... | /* static context
[FOCAL] public static String Strings.format(String format, Object... args)
[PATH1] foreach(Object current : args)=T -> exit loop -> return retVal
[PATH2] foreach(Object current : args)=F -> return retVal
[INPUTS] branches=args | result=args, format
[CALLS-EXTERNAL] String.replaceFirst/2, Object.toStri... | /* static context
[FOCAL] public static String Strings.format(String format, Object... args)
[PATH1] foreach(Object current : args)=T -> exit loop -> return retVal
[PATH2] foreach(Object current : args)=F -> return retVal
[INPUTS] branches=args | result=args, format
[CALLS-EXTERNAL] String.replaceFirst/2, Object.toStri... | true | ok | {"focal": {"class": "Strings", "name": "format", "signature": "String format(String format, Object... args)", "start_line": 3, "modifiers": "public static", "params": [{"name": "format", "type": "String"}, {"name": "args", "type": "Object..."}], "return_type": "String"}, "class_info": {"name": "Strings", "kind": "class... |
95752629_38 | class AuthConfiguration {
public void setHttpProxyHost(String httpProxyHost) {
this.httpProxyHost = httpProxyHost;
}
public String getClient();
public void setClient(String client);
public String getTenant();
public void setTenant(String tenant);
public String getKey();
public ... | final AuthConfiguration auth = new AuthConfiguration();
auth.setHttpProxyHost("httpProxyHost1");
assertEquals("httpProxyHost1", auth.getHttpProxyHost());
}
} | [FOCAL] public void AuthConfiguration.setHttpProxyHost(String httpProxyHost)
[CLASS] class AuthConfiguration
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[FIELDS] write=httpProxyHost
[STATE] httpProxyHost via getHttpProxyHost()
[DATAFLOW] httpProxyHost@param->L2
[CLASS-MEMBERS] String getClient(... | /* static context
[FOCAL] public void AuthConfiguration.setHttpProxyHost(String httpProxyHost)
[STATE] httpProxyHost via getHttpProxyHost()
[FIELDS] write=httpProxyHost
*/
| /* static context
[FOCAL] public void AuthConfiguration.setHttpProxyHost(String httpProxyHost)
[STATE] httpProxyHost via getHttpProxyHost()
[FIELDS] write=httpProxyHost
*/
class AuthConfiguration {
public void setHttpProxyHost(String httpProxyHost) {
this.httpProxyHost = httpProxyHost;
}
public St... | true | ok | {"focal": {"class": "AuthConfiguration", "name": "setHttpProxyHost", "signature": "void setHttpProxyHost(String httpProxyHost)", "start_line": 3, "modifiers": "public", "params": [{"name": "httpProxyHost", "type": "String"}], "return_type": "void"}, "class_info": {"name": "AuthConfiguration", "kind": "class", "modifier... |
95896976_5 | class PairwiseRankingLearningAlgorithm extends AObjectRankingWithBaseLearner<PairwiseRankingConfiguration> {
@Override
public PairwiseRankingLearningModel train(IDataset<?, ?, ?> dataset) throws TrainModelsFailedException {
return (PairwiseRankingLearningModel) super.train(dataset);
}
public Pairwi... | File file = new File(getTestRessourcePathFor(OBJECT_RANKING_DATASET_B));
PairwiseRankingLearningAlgorithm algortihm = new PairwiseRankingLearningAlgorithm();
DatasetFile datasetFile = new DatasetFile(file);
ObjectRankingDatasetParser objectRankingParser = (ObjectRankingDatasetParser) algortihm.g... | [FOCAL] @Override public PairwiseRankingLearningModel PairwiseRankingLearningAlgorithm.train(IDataset<?, ?, ?> dataset)
[CLASS] class PairwiseRankingLearningAlgorithm extends AObjectRankingWithBaseLearner<PairwiseRankingConfiguration>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL]... | /* static context
[FOCAL] @Override public PairwiseRankingLearningModel PairwiseRankingLearningAlgorithm.train(IDataset<?, ?, ?> dataset)
[INPUTS] branches=- | result=dataset
[EXCEPTIONS] declares TrainModelsFailedException
[CALLS-EXTERNAL] AObjectRankingWithBaseLearner<PairwiseRankingConfiguration>.train/1
*/
| /* static context
[FOCAL] @Override public PairwiseRankingLearningModel PairwiseRankingLearningAlgorithm.train(IDataset<?, ?, ?> dataset)
[INPUTS] branches=- | result=dataset
[EXCEPTIONS] declares TrainModelsFailedException
[CALLS-EXTERNAL] AObjectRankingWithBaseLearner<PairwiseRankingConfiguration>.train/1
*/
class Pa... | true | ok | {"focal": {"class": "PairwiseRankingLearningAlgorithm", "name": "train", "signature": "PairwiseRankingLearningModel train(IDataset<?, ?, ?> dataset) throws TrainModelsFailedException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "dataset", "type": "IDataset<?, ?, ?>"}], "return_type": "Pairwis... |
95924484_0 | class Snippet {
@GetMapping(path = "/{id}")
public SnippetEntity getSnippet(@PathVariable("id") String id) {
return snippetService.getSnippet(id);
}
@GetMapping() public Page<SnippetEntity> getSnippets(@RequestParam(value = "from", defaultValue = "0") final int from,
... | ResponseEntity<String> response = restTemplate.getForEntity(SNIPPET_ENDPOINT, String.class);
Assert.assertEquals(HttpStatus.OK, response.getStatusCode());
Page<SnippetEntity> page = TestUtils.getObjectFromString(response.getBody(), new TypeReference<Page<SnippetEntity>>() {
});
... | [FOCAL] @GetMapping(path = "/{id}") public SnippetEntity Snippet.getSnippet(String id)
[CLASS] class Snippet
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] snippetService.getSnippet/1
[INPUTS] branches=- | result=id
[COLLABORATORS] field snippetService getSnippet/1
[DATAFLOW] id@p... | /* static context
[FOCAL] @GetMapping(path = "/{id}") public SnippetEntity Snippet.getSnippet(String id)
[INPUTS] branches=- | result=id
[COLLABORATORS] field snippetService getSnippet/1
[CALLS-EXTERNAL] snippetService.getSnippet/1
*/
| /* static context
[FOCAL] @GetMapping(path = "/{id}") public SnippetEntity Snippet.getSnippet(String id)
[INPUTS] branches=- | result=id
[COLLABORATORS] field snippetService getSnippet/1
[CALLS-EXTERNAL] snippetService.getSnippet/1
*/
class Snippet {
@GetMapping(path = "/{id}")
public SnippetEntity getSnippet(... | true | ok | {"focal": {"class": "Snippet", "name": "getSnippet", "signature": "SnippetEntity getSnippet(String id)", "start_line": 3, "modifiers": "@GetMapping(path = \"/{id}\") public", "params": [{"name": "id", "type": "String"}], "return_type": "SnippetEntity"}, "class_info": {"name": "Snippet", "kind": "class", "modifiers": ""... |
95946882_10 | class TransactionsTotalCalculator {
public Total getAccountBalance(Currency toCurrency, long accountId) {
WhereFilter filter = selectedAccountOnly(this.filter, accountId);
return getBalanceInHomeCurrency(V_BLOTTER_FOR_ACCOUNT_WITH_SPLITS, toCurrency, filter);
}
public TransactionsTotalCal... | TransactionBuilder.withDb(db).account(a1).dateTime(DateTime.date(2012, 1, 10)).amount(1).create();
assertFalse(c.getAccountBalance(c1, a1.id).isError()); // no conversion
assertFalse(c.getAccountBalance(c3, a1.id).isError()); // all rates are available
Total total = c.getAccountBalance... | [FOCAL] public Total TransactionsTotalCalculator.getAccountBalance(Currency toCurrency, long accountId)
[CLASS] class TransactionsTotalCalculator
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Total getBalanceInHomeCurrency(String view, Currency toCurrency, WhereFilter filter); Wh... | /* static context
[FOCAL] public Total TransactionsTotalCalculator.getAccountBalance(Currency toCurrency, long accountId)
[INPUTS] branches=- | result=accountId, toCurrency
[CALLS-INTERNAL] Total getBalanceInHomeCurrency(String view, Currency toCurrency, WhereFilter filter); WhereFilter selectedAccountOnly(WhereFilter ... | /* static context
[FOCAL] public Total TransactionsTotalCalculator.getAccountBalance(Currency toCurrency, long accountId)
[INPUTS] branches=- | result=accountId, toCurrency
[CALLS-INTERNAL] Total getBalanceInHomeCurrency(String view, Currency toCurrency, WhereFilter filter); WhereFilter selectedAccountOnly(WhereFilter ... | true | ok | {"focal": {"class": "TransactionsTotalCalculator", "name": "getAccountBalance", "signature": "Total getAccountBalance(Currency toCurrency, long accountId)", "start_line": 3, "modifiers": "public", "params": [{"name": "toCurrency", "type": "Currency"}, {"name": "accountId", "type": "long"}], "return_type": "Total"}, "cl... |
95958400_35 | class ChargeCalculator {
public double getCharge(Date date, double quantity) {
double charge;
if (date.before(SUMMER_START) || date.after(SUMMER_END))
charge = quantity * winterRate + winterServiceCharge;
else charge = quantity * summerRate;
return charge;
}
}
clas... | ChargeCalculator chargeCalculator = new ChargeCalculator();
double charge = chargeCalculator.getCharge(new Date(2011, 11, 1), 100);
assertEquals(400, charge, 0);
}
} | [FOCAL] public double ChargeCalculator.getCharge(Date date, double quantity)
[CLASS] class ChargeCalculator
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] Date.before/1, Date.after/1
[PATH1] if(date.before(SUMMER_START) || date.after(SUMMER_END))=T -> return charge
[PATH2] if(date... | /* static context
[FOCAL] public double ChargeCalculator.getCharge(Date date, double quantity)
[PATH1] if(date.before(SUMMER_START) || date.after(SUMMER_END))=T -> return charge
[PATH2] if(date.before(SUMMER_START) || date.after(SUMMER_END))=F -> return charge
[INPUTS] branches=date | result=quantity
[COLLABORATORS] pa... | /* static context
[FOCAL] public double ChargeCalculator.getCharge(Date date, double quantity)
[PATH1] if(date.before(SUMMER_START) || date.after(SUMMER_END))=T -> return charge
[PATH2] if(date.before(SUMMER_START) || date.after(SUMMER_END))=F -> return charge
[INPUTS] branches=date | result=quantity
[COLLABORATORS] pa... | true | ok | {"focal": {"class": "ChargeCalculator", "name": "getCharge", "signature": "double getCharge(Date date, double quantity)", "start_line": 3, "modifiers": "public", "params": [{"name": "date", "type": "Date"}, {"name": "quantity", "type": "double"}], "return_type": "double"}, "class_info": {"name": "ChargeCalculator", "ki... |
96021764_6 | class CronParser {
public static Matcher parse(String cron) throws InvalidCronException {
return new CronParser(cron).parse();
}
CronParser(final char[] cron);
CronParser(final String cron);
public static Matcher parse(final char[] cron);
public Matcher parse();
private int sk... | Matcher matcher;
matcher = new CronParser("3,5,8 1,2,3 * *").parse();
assertFalse(matcher.match(createTime(1, 1, 1, 1, 1, 0, 1, true)));
assertFalse(matcher.match(createTime(1, 1, 1, 1, 1, 1, 1, true)));
assertFalse(matcher.match(createTime(1, 1, 1, 1, 1, 2, 1, true)));
... | [FOCAL] public static Matcher CronParser.parse(String cron)
[CLASS] class CronParser
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] new CronParser(cron).parse/0
[NEW] CronParser
[EXCEPTIONS] declares InvalidCronException
[INPUTS] branches=- | result=cron
[DATAFLOW] cron@param->L2
... | /* static context
[FOCAL] public static Matcher CronParser.parse(String cron)
[INPUTS] branches=- | result=cron
[EXCEPTIONS] declares InvalidCronException
[NEW] CronParser
[CALLS-EXTERNAL] new CronParser(cron).parse/0
*/
| /* static context
[FOCAL] public static Matcher CronParser.parse(String cron)
[INPUTS] branches=- | result=cron
[EXCEPTIONS] declares InvalidCronException
[NEW] CronParser
[CALLS-EXTERNAL] new CronParser(cron).parse/0
*/
class CronParser {
public static Matcher parse(String cron) throws InvalidCronException {
... | true | ok | {"focal": {"class": "CronParser", "name": "parse", "signature": "Matcher parse(String cron) throws InvalidCronException", "start_line": 3, "modifiers": "public static", "params": [{"name": "cron", "type": "String"}], "return_type": "Matcher"}, "class_info": {"name": "CronParser", "kind": "class", "modifiers": "", "supe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.