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 |
|---|---|---|---|---|---|---|---|---|
117452304_11 | class Position extends Point {
@Override
public Position clone() {
return new Position(x, y, angle);
}
public Position(double x, double y, double angle);
public Position(double x, double y);
public Position(Point point, double angle);
public Position(Point point);
public P... | Position p1 = new Position(Math.random(), Math.random(), Math.random());
assertNotSame(p1, p1.clone());
assertEquals(p1, p1.clone());
}
} | [FOCAL] @Override public Position Position.clone()
[CLASS] class Position extends Point
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] Position
[CLASS-MEMBERS] Position(double x, double y, double angle); Position(double x, double y); Position(Point point, double angle); Position(Point point)... | /* static context
[FOCAL] @Override public Position Position.clone()
[NEW] Position
*/
| /* static context
[FOCAL] @Override public Position Position.clone()
[NEW] Position
*/
class Position extends Point {
@Override
public Position clone() {
return new Position(x, y, angle);
}
public Position(double x, double y, double angle);
public Position(double x, double y);
public... | true | ok | {"focal": {"class": "Position", "name": "clone", "signature": "Position clone()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Position"}, "class_info": {"name": "Position", "kind": "class", "modifiers": "", "superclass": "Point", "interfaces": null, "fields": [], "members": [{"name":... |
117474465_9 | class RepoMVPPresenter extends BasePresenter<RepoMVPView> implements RepoPresenter {
@Override
public void getRepo(@NonNull String owner, @NonNull String repo) {
checkViewAttached();
getMvpView().showMessageView(false);
getMvpView().showProgress(true);
getDataManager().getRepo(... | String owner = TestDataFactory.repoDataFactory.createOwner().login;
String repoName = TestDataFactory.repoDataFactory.createRepoName();
stubDataManagerGetRepo(owner, repoName, Single.error(new RuntimeException("")));
repoPresenter.getRepo(owner, repoName);
testScheduler.triggerA... | [FOCAL] @Override public void RepoMVPPresenter.getRepo(String owner, String repo)
[CLASS] class RepoMVPPresenter extends BasePresenter<RepoMVPView> implements RepoPresenter
[METRICS] loc=47 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=3
[CALLS-EXTERNAL] checkViewAttached/0 (inherited), getMvpView().showMessageVie... | /* static context
[FOCAL] @Override public void RepoMVPPresenter.getRepo(String owner, String repo)
[COLLABORATORS] field schedulerProvider ui/0,io/0; field response isSuccessful/0,code/0,body/0,errorBody/0
[NEW] SingleObserver<Response<Repo>>
[CALLS-EXTERNAL] checkViewAttached/0 (inherited), getMvpView().showMessageVi... | /* static context
[FOCAL] @Override public void RepoMVPPresenter.getRepo(String owner, String repo)
[COLLABORATORS] field schedulerProvider ui/0,io/0; field response isSuccessful/0,code/0,body/0,errorBody/0
[NEW] SingleObserver<Response<Repo>>
[CALLS-EXTERNAL] checkViewAttached/0 (inherited), getMvpView().showMessageVi... | true | ok | {"focal": {"class": "RepoMVPPresenter", "name": "getRepo", "signature": "void getRepo(String owner, String repo)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "owner", "type": "String"}, {"name": "repo", "type": "String"}], "return_type": "void"}, "class_info": {"name": "RepoMVPPresenter", "ki... |
117598163_0 | class PulsarClientLRUCache extends LRUMap<K, V> {
@Override
public void clear() {
this.values().parallelStream().forEach(closable -> {
releaseResources(closable);
});
super.clear();
}
public PulsarClientLRUCache(int maxSize);
public PulsarClientLRUCache(int max... | PulsarClientLRUCache<String, Producer> cache = new PulsarClientLRUCache<String, Producer>(26);
for (Character i='A'; i<='Z'; i++) {
cache.put(i.toString(), mockedPulsarProducer);
}
// Make sure we only have all the items in the cache
assertEquals(26, cache.size());
... | [FOCAL] @Override public void PulsarClientLRUCache.clear()
[CLASS] class PulsarClientLRUCache extends LRUMap<K, V>
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void releaseResources(V value)
[CALLS-EXTERNAL] this.values().parallelStream().forEach/1, this.values().parallelStream/... | /* static context
[FOCAL] @Override public void PulsarClientLRUCache.clear()
[CALLS-INTERNAL] void releaseResources(V value)
[CALLS-EXTERNAL] this.values().parallelStream().forEach/1, this.values().parallelStream/0, this.values/0, LRUMap<K, V>.clear/0
*/
| /* static context
[FOCAL] @Override public void PulsarClientLRUCache.clear()
[CALLS-INTERNAL] void releaseResources(V value)
[CALLS-EXTERNAL] this.values().parallelStream().forEach/1, this.values().parallelStream/0, this.values/0, LRUMap<K, V>.clear/0
*/
class PulsarClientLRUCache extends LRUMap<K, V> {
@Override
... | true | ok | {"focal": {"class": "PulsarClientLRUCache", "name": "clear", "signature": "void clear()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "PulsarClientLRUCache", "kind": "class", "modifiers": "", "superclass": "LRUMap<K, V>", "interfaces": null, "fields": [... |
117711019_4 | class BylineImpl implements Byline {
@Override
public boolean isEmpty() {
final Image image = getImage();
if (StringUtils.isBlank(name)) {
// Name is missing, but required
return true;
} else if (occupations == null || occupations.isEmpty()) {
... | ctx.currentResource("/content/without-name");
Byline byline = ctx.request().adaptTo(Byline.class);
assertTrue(byline.isEmpty());
}
} | [FOCAL] @Override public boolean BylineImpl.isEmpty()
[CLASS] class BylineImpl implements Byline
[METRICS] loc=18 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=3
[CALLS-INTERNAL] Image getImage()
[CALLS-EXTERNAL] StringUtils.isBlank/1, occupations.isEmpty/0, Image.getSrc/0
[PATH1] if(StringUtils.isBlank(name))=F -... | /* static context
[FOCAL] @Override public boolean BylineImpl.isEmpty()
[PATH1] if(StringUtils.isBlank(name))=F -> if(occupations == null || occupations.isEmpty())=F -> if(image == null || StringUtils.isBlank(image.getSrc()))=T -> return true
[PATH2] if(StringUtils.isBlank(name))=F -> if(occupations == null || occupati... | /* static context
[FOCAL] @Override public boolean BylineImpl.isEmpty()
[PATH1] if(StringUtils.isBlank(name))=F -> if(occupations == null || occupations.isEmpty())=F -> if(image == null || StringUtils.isBlank(image.getSrc()))=T -> return true
[PATH2] if(StringUtils.isBlank(name))=F -> if(occupations == null || occupati... | true | ok | {"focal": {"class": "BylineImpl", "name": "isEmpty", "signature": "boolean isEmpty()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "boolean"}, "class_info": {"name": "BylineImpl", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Byline", "fields": [{"name": "ctx", ... |
117965972_5 | class TSDBConnection implements Connection4TSDB {
@Override
public boolean isSupported() {
String versionJson = version();
if (StringUtils.isBlank(versionJson)) {
throw new RuntimeException("Cannot get the version!");
}
String version = JSON.parseObject(versionJson).... | Assert.assertTrue(new TSDBConnection(TSDB_ADDRESS).isSupported());
}
} | [FOCAL] @Override public boolean TSDBConnection.isSupported()
[CLASS] class TSDBConnection implements Connection4TSDB
[METRICS] loc=17 cc=5 branches=3 loops=1 returns=3 throws=1 nesting=2
[CALLS-INTERNAL] String version(); String[] getSupportVersionPrefix()
[CALLS-EXTERNAL] StringUtils.isBlank/1, JSON.parseObject(versi... | /* static context
[FOCAL] @Override public boolean TSDBConnection.isSupported()
[THROWS-WHEN] RuntimeException when StringUtils.isBlank(versionJson)
[PATH1] if(StringUtils.isBlank(versionJson))=F -> if(StringUtils.isBlank(version))=F -> foreach(String prefix : getSupportVersionPrefix())=T -> if(version.startsWith(prefi... | /* static context
[FOCAL] @Override public boolean TSDBConnection.isSupported()
[THROWS-WHEN] RuntimeException when StringUtils.isBlank(versionJson)
[PATH1] if(StringUtils.isBlank(versionJson))=F -> if(StringUtils.isBlank(version))=F -> foreach(String prefix : getSupportVersionPrefix())=T -> if(version.startsWith(prefi... | true | ok | {"focal": {"class": "TSDBConnection", "name": "isSupported", "signature": "boolean isSupported()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "boolean"}, "class_info": {"name": "TSDBConnection", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Connection4TSDB", "f... |
117978265_8 | class OverrideDubboConfigApplicationListener implements ApplicationListener<ApplicationEnvironmentPreparedEvent> {
@Override
public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) {
/**
* Gets Logger After LoggingSystem configuration ready
* @see LoggingApplication... |
Properties properties = ConfigUtils.getProperties();
Assert.assertEquals("dubbo-demo-application", properties.get("dubbo.application.name"));
Assert.assertEquals("dubbo-demo-module", properties.get("dubbo.module.name"));
Assert.assertEquals("zookeeper://192.168.99.100:32770", propertie... | [FOCAL] @Override public void OverrideDubboConfigApplicationListener.onApplicationEvent(ApplicationEnvironmentPreparedEvent event)
[CLASS] class OverrideDubboConfigApplicationListener implements ApplicationListener<ApplicationEnvironmentPreparedEvent>
[METRICS] loc=30 cc=4 branches=3 loops=0 returns=0 throws=0 nesting=... | /* static context
[FOCAL] @Override public void OverrideDubboConfigApplicationListener.onApplicationEvent(ApplicationEnvironmentPreparedEvent event)
[PATH1] if(override)=T -> if(logger.isInfoEnabled())#1=T
[PATH2] if(override)=F -> if(logger.isInfoEnabled())#2=T
[PATH3] if(override)=T -> if(logger.isInfoEnabled())#1=F
... | /* static context
[FOCAL] @Override public void OverrideDubboConfigApplicationListener.onApplicationEvent(ApplicationEnvironmentPreparedEvent event)
[PATH1] if(override)=T -> if(logger.isInfoEnabled())#1=T
[PATH2] if(override)=F -> if(logger.isInfoEnabled())#2=T
[PATH3] if(override)=T -> if(logger.isInfoEnabled())#1=F
... | true | ok | {"focal": {"class": "OverrideDubboConfigApplicationListener", "name": "onApplicationEvent", "signature": "void onApplicationEvent(ApplicationEnvironmentPreparedEvent event)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "event", "type": "ApplicationEnvironmentPreparedEvent"}], "return_type": "v... |
118104847_0 | class EasyPermissions {
public static boolean hasPermissions(@NonNull Context context,
@Size(min = 1) @NonNull String... perms) {
// Always return true for SDK < M, let the system deal with the permissions
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {... | Application app = RuntimeEnvironment.application;
String[] perms = new String[]{
Manifest.permission.READ_SMS,
Manifest.permission.ACCESS_FINE_LOCATION
};
// Wes should not have permissions before any are granted
assertFalse(EasyPermissions.hasPe... | [FOCAL] public static boolean EasyPermissions.hasPermissions(Context context, String... perms)
[CLASS] class EasyPermissions
[METRICS] loc=25 cc=5 branches=3 loops=1 returns=3 throws=1 nesting=2
[CALLS-EXTERNAL] Log.w/2, ContextCompat.checkSelfPermission/2
[NEW] IllegalArgumentException
[EXCEPTIONS] throws IllegalArgum... | /* static context
[FOCAL] public static boolean EasyPermissions.hasPermissions(Context context, String... perms)
[THROWS-WHEN] IllegalArgumentException when !(Build.VERSION.SDK_INT < Build.VERSION_CODES.M) && context == null
[PATH1] if(Build.VERSION.SDK_INT < Build.VERSION_CODES.M)=F -> if(context == null)=F -> foreach... | /* static context
[FOCAL] public static boolean EasyPermissions.hasPermissions(Context context, String... perms)
[THROWS-WHEN] IllegalArgumentException when !(Build.VERSION.SDK_INT < Build.VERSION_CODES.M) && context == null
[PATH1] if(Build.VERSION.SDK_INT < Build.VERSION_CODES.M)=F -> if(context == null)=F -> foreach... | true | ok | {"focal": {"class": "EasyPermissions", "name": "hasPermissions", "signature": "boolean hasPermissions(Context context, String... perms)", "start_line": 3, "modifiers": "public static", "params": [{"name": "context", "type": "Context"}, {"name": "perms", "type": "String..."}], "return_type": "boolean"}, "class_info": {"... |
118151375_4 | class SupplyChainCredentialValidator implements CredentialValidator {
@Override
public AppraisalStatus validatePlatformCredentialAttributes(
final PlatformCredential platformCredential,
final DeviceInfoReport deviceInfoReport,
final EndorsementCredential endorsementCredentia... |
DeviceInfoReport deviceInfoReport = buildReport(
new HardwareInfo(PLATFORM_MANUFACTURER, PLATFORM_MODEL,
PLATFORM_VERSION, DeviceInfoReport.NOT_SPECIFIED,
TEST_SERIAL_NUMBER, TEST_SERIAL_NUMBER));
deviceInfoReport = PowerMockito.spy(device... | [FOCAL] @Override public AppraisalStatus SupplyChainCredentialValidator.validatePlatformCredentialAttributes(PlatformCredential platformCredential, DeviceInfoReport deviceInfoReport, EndorsementCredential endorsementCredential)
[CLASS] class SupplyChainCredentialValidator implements CredentialValidator
[METRICS] loc=38... | class SupplyChainCredentialValidator implements CredentialValidator {
@Override
public AppraisalStatus validatePlatformCredentialAttributes(
final PlatformCredential platformCredential,
final DeviceInfoReport deviceInfoReport,
final EndorsementCredential endorsementCredentia... | false | ok | {"focal": {"class": "SupplyChainCredentialValidator", "name": "validatePlatformCredentialAttributes", "signature": "AppraisalStatus validatePlatformCredentialAttributes(PlatformCredential platformCredential, DeviceInfoReport deviceInfoReport, EndorsementCredential endorsementCredential)", "start_line": 3, "modifiers": ... | |
118198720_1 | class TraitToPropertyMap {
String traitsToDataFormat(final boolean onlyFromProperty) {
boolean isArray = false;
boolean isBig = false;
boolean isSmall = false;
boolean isInteger = false;
boolean probablyJson = false;
Enum<CdmDataFormat> baseType = CdmDataFormat.Unknown;
final CdmTraitCol... | final CdmTypeAttributeDefinition cdmAttribute =
new CdmTypeAttributeDefinition(
new ResolveContext(new CdmCorpusDefinition()),
"SomeAttribute");
cdmAttribute.getAppliedTraits().add("is.dataFormat.someRandomDataFormat");
final TraitToPropertyMap traitToPropertyMap = new TraitT... | [FOCAL] String TraitToPropertyMap.traitsToDataFormat(boolean onlyFromProperty)
[CLASS] class TraitToPropertyMap
[METRICS] loc=109 cc=33 branches=17 loops=1 returns=1 throws=0 nesting=6
[CALLS-INTERNAL] CdmTraitCollection getTraits()
[CALLS-EXTERNAL] CdmTraitReference.isFromProperty/0, CdmTraitReference.fetchObjectDefin... | /* static context
[FOCAL] String TraitToPropertyMap.traitsToDataFormat(boolean onlyFromProperty)
[PATH1] if(traits != null)=T -> foreach(CdmTraitReference trait : traits)=T -> if(onlyFromProperty && !trait.isFromProperty())=T -> exit loop -> if(isArray)=T -> if(probablyJson)=F -> if(CdmDataFormat.Char.equals(baseType))... | /* static context
[FOCAL] String TraitToPropertyMap.traitsToDataFormat(boolean onlyFromProperty)
[PATH1] if(traits != null)=T -> foreach(CdmTraitReference trait : traits)=T -> if(onlyFromProperty && !trait.isFromProperty())=T -> exit loop -> if(isArray)=T -> if(probablyJson)=F -> if(CdmDataFormat.Char.equals(baseType))... | true | ok | {"focal": {"class": "TraitToPropertyMap", "name": "traitsToDataFormat", "signature": "String traitsToDataFormat(boolean onlyFromProperty)", "start_line": 3, "modifiers": "", "params": [{"name": "onlyFromProperty", "type": "boolean"}], "return_type": "String"}, "class_info": {"name": "TraitToPropertyMap", "kind": "class... |
118261543_81 | class WishlistDtoFromRecordBuilder extends DtoFromRecordBuilder<WishlistDataDto> {
public WishlistDataDto build(CSVRecord csvRecord) throws ImportException {
try {
return new WishlistDataDto(
formatLong(getId(csvRecord)),
formatInteger(csvRecord.get("movi... | doReturn(true).when(csvRecord).isMapped("id");
doReturn("12").when(csvRecord).get("id");
doReturn("24").when(csvRecord).get("movie_id");
doReturn("a good title").when(csvRecord).get("title");
doReturn("overview").when(csvRecord).get("overview");
doReturn("2015").when(csvR... | [FOCAL] public WishlistDataDto WishlistDtoFromRecordBuilder.build(CSVRecord csvRecord)
[CLASS] class WishlistDtoFromRecordBuilder extends DtoFromRecordBuilder<WishlistDataDto>
[METRICS] loc=16 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-INTERNAL] WishlistItemType getWishlistItemTypeFromString(String typ... | /* static context
[FOCAL] public WishlistDataDto WishlistDtoFromRecordBuilder.build(CSVRecord csvRecord)
[THROWS-WHEN] ImportException when try-body throws
[PATH1] try-body throws -> throw new ImportException(context.getString(R.string.import_parsing_line_...
[PATH2] return new WishlistDataDto( formatLong(getId(csvReco... | /* static context
[FOCAL] public WishlistDataDto WishlistDtoFromRecordBuilder.build(CSVRecord csvRecord)
[THROWS-WHEN] ImportException when try-body throws
[PATH1] try-body throws -> throw new ImportException(context.getString(R.string.import_parsing_line_...
[PATH2] return new WishlistDataDto( formatLong(getId(csvReco... | true | ok | {"focal": {"class": "WishlistDtoFromRecordBuilder", "name": "build", "signature": "WishlistDataDto build(CSVRecord csvRecord) throws ImportException", "start_line": 3, "modifiers": "public", "params": [{"name": "csvRecord", "type": "CSVRecord"}], "return_type": "WishlistDataDto"}, "class_info": {"name": "WishlistDtoFro... |
118323013_0 | class MainViewModel extends ActorViewModel {
@Command(MSG_SEARCH_FOR_CITY_RESULT)
void onSearchForCityResult(Optional<City> foundCity) {
foundCity.map(this::addNewFavoriteCityAndSaveToPreferences)
.defaultIfEmpty(false)
.whenNot(Boolean::booleanValue)
.th... | boolean[] result = {false};
viewModel.searchCityInProgress
.subscribeOn(scheduler)
.observeOn(scheduler)
.subscribe(status -> result[0] = status);
scheduler.triggerActions();
viewModel.searchForCity.onNext(true);
scheduler.trigger... | [FOCAL] @Command(MSG_SEARCH_FOR_CITY_RESULT) void MainViewModel.onSearchForCityResult(Optional<City> foundCity)
[CLASS] class MainViewModel extends ActorViewModel
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] foundCity.map(this::addNewFavoriteCityAndSaveToPreference....invoke/1, ... | /* static context
[FOCAL] @Command(MSG_SEARCH_FOR_CITY_RESULT) void MainViewModel.onSearchForCityResult(Optional<City> foundCity)
[COLLABORATORS] param foundCity:Optional<City> map/1; field searchCityInProgress onNext/1
[CALLS-EXTERNAL] foundCity.map(this::addNewFavoriteCityAndSaveToPreference....invoke/1, foundCity.ma... | /* static context
[FOCAL] @Command(MSG_SEARCH_FOR_CITY_RESULT) void MainViewModel.onSearchForCityResult(Optional<City> foundCity)
[COLLABORATORS] param foundCity:Optional<City> map/1; field searchCityInProgress onNext/1
[CALLS-EXTERNAL] foundCity.map(this::addNewFavoriteCityAndSaveToPreference....invoke/1, foundCity.ma... | true | ok | {"focal": {"class": "MainViewModel", "name": "onSearchForCityResult", "signature": "void onSearchForCityResult(Optional<City> foundCity)", "start_line": 3, "modifiers": "@Command(MSG_SEARCH_FOR_CITY_RESULT)", "params": [{"name": "foundCity", "type": "Optional<City>"}], "return_type": "void"}, "class_info": {"name": "Ma... |
118375319_0 | class IcyHttpDataSourceFactory extends OkHttpDataSource.BaseFactory {
@Override
protected IcyHttpDataSource createDataSourceInternal(@NonNull HttpDataSource.RequestProperties defaultRequestProperties) {
return new IcyHttpDataSource.Builder(callFactory)
.setUserAgent(userAgent)
... | // Arrange
OkHttpClient client = new OkHttpClient.Builder().build();
IcyHttpDataSourceFactory factory = new IcyHttpDataSourceFactory.Builder(client)
.setUserAgent(Constants.TEST_USER_AGENT)
.setIcyHeadersListener(TEST_ICY_HEADERS_LISTENER)
.setIcyM... | [FOCAL] @Override protected IcyHttpDataSource IcyHttpDataSourceFactory.createDataSourceInternal(HttpDataSource.RequestProperties defaultRequestProperties)
[CLASS] class IcyHttpDataSourceFactory extends OkHttpDataSource.BaseFactory
[METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] ne... | /* static context
[FOCAL] @Override protected IcyHttpDataSource IcyHttpDataSourceFactory.createDataSourceInternal(HttpDataSource.RequestProperties defaultRequestProperties)
[INPUTS] branches=- | result=defaultRequestProperties
[NEW] IcyHttpDataSource.Builder
[CALLS-EXTERNAL] new IcyHttpDataSource.Builder(callFactory) .... | /* static context
[FOCAL] @Override protected IcyHttpDataSource IcyHttpDataSourceFactory.createDataSourceInternal(HttpDataSource.RequestProperties defaultRequestProperties)
[INPUTS] branches=- | result=defaultRequestProperties
[NEW] IcyHttpDataSource.Builder
[CALLS-EXTERNAL] new IcyHttpDataSource.Builder(callFactory) .... | true | ok | {"focal": {"class": "IcyHttpDataSourceFactory", "name": "createDataSourceInternal", "signature": "IcyHttpDataSource createDataSourceInternal(HttpDataSource.RequestProperties defaultRequestProperties)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "defaultRequestProperties", "type": "HttpData... |
118421344_71 | class HurlStack extends BaseHttpStack {
@SuppressWarnings("deprecation")
/* package */ static void setConnectionParametersForRequest(HttpURLConnection connection,
Request<?> request) throws IOException, AuthFailureError {
switch (request.getMethod()) {
case Method.DEPRECATED_GET... | TestRequest.Options request = new TestRequest.Options();
assertEquals(request.getMethod(), Method.OPTIONS);
HurlStack.setConnectionParametersForRequest(mMockConnection, request);
assertEquals("OPTIONS", mMockConnection.getRequestMethod());
assertFalse(mMockConnection.getDoOutput... | [FOCAL] @SuppressWarnings("deprecation") /* package */ static void HurlStack.setConnectionParametersForRequest(HttpURLConnection connection, Request<?> request)
[CLASS] class HurlStack extends BaseHttpStack
[METRICS] loc=47 cc=11 branches=2 loops=0 returns=0 throws=1 nesting=2
[CALLS-INTERNAL] void addBody(HttpURLConne... | /* static context
[FOCAL] @SuppressWarnings("deprecation") /* package * / static void HurlStack.setConnectionParametersForRequest(HttpURLConnection connection, Request<?> request)
[THROWS-WHEN] IllegalStateException when switch(request.getMethod())=default
[PATH1] switch(request.getMethod())=case Method.DEPRECATED_GET_... | /* static context
[FOCAL] @SuppressWarnings("deprecation") /* package * / static void HurlStack.setConnectionParametersForRequest(HttpURLConnection connection, Request<?> request)
[THROWS-WHEN] IllegalStateException when switch(request.getMethod())=default
[PATH1] switch(request.getMethod())=case Method.DEPRECATED_GET_... | true | ok | {"focal": {"class": "HurlStack", "name": "setConnectionParametersForRequest", "signature": "void setConnectionParametersForRequest(HttpURLConnection connection, Request<?> request) throws IOException, AuthFailureError", "start_line": 3, "modifiers": "@SuppressWarnings(\"deprecation\") /* package */ static", "params": [... |
118477931_0 | class Value {
public boolean cmp(Value o) {
if (o == null) {
return false;
}
if (rlp != null && o.rlp != null) {
return Arrays.equals(rlp, o.rlp);
} else {
return Arrays.equals(this.encode(), o.encode());
}
// return DeepEquals.de... | Value val1 = new Value("hello");
Value val2 = new Value("world");
assertFalse("Expected values not to be equal", val1.cmp(val2));
Value val3 = new Value("hello");
Value val4 = new Value("hello");
assertTrue("Expected values to be equal", val3.cmp(val4));
Value... | [FOCAL] public boolean Value.cmp(Value o)
[CLASS] class Value
[METRICS] loc=12 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[CALLS-INTERNAL] byte[] encode()
[CALLS-EXTERNAL] Arrays.equals/2, Value.encode/0
[PATH1] if(o == null)=F -> if(rlp != null && o.rlp != null)=T -> return Arrays.equals(rlp, o.rlp)
[PATH2] ... | /* static context
[FOCAL] public boolean Value.cmp(Value o)
[PATH1] if(o == null)=F -> if(rlp != null && o.rlp != null)=T -> return Arrays.equals(rlp, o.rlp)
[PATH2] if(o == null)=T -> return false
[PATH3] if(o == null)=F -> if(rlp != null && o.rlp != null)=F -> return Arrays.equals(this.encode(), o.encode())
[INPUTS] ... | /* static context
[FOCAL] public boolean Value.cmp(Value o)
[PATH1] if(o == null)=F -> if(rlp != null && o.rlp != null)=T -> return Arrays.equals(rlp, o.rlp)
[PATH2] if(o == null)=T -> return false
[PATH3] if(o == null)=F -> if(rlp != null && o.rlp != null)=F -> return Arrays.equals(this.encode(), o.encode())
[INPUTS] ... | true | ok | {"focal": {"class": "Value", "name": "cmp", "signature": "boolean cmp(Value o)", "start_line": 3, "modifiers": "public", "params": [{"name": "o", "type": "Value"}], "return_type": "boolean"}, "class_info": {"name": "Value", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members... |
118497841_326 | class DockerCredentialHelper {
public Credential retrieve()
throws IOException, CredentialHelperUnhandledServerUrlException,
CredentialHelperNotFoundException {
boolean isWindows =
systemProperties.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows");
String lowerCas... | systemProperties.setProperty("os.name", "WINdows");
List<String> command = Arrays.asList(Paths.get("/foo/bar.CmD").toString(), "get");
Mockito.when(processBuilderFactory.apply(command)).thenReturn(processBuilder);
DockerCredentialHelper credentialHelper =
new DockerCredentialHelper(
... | [FOCAL] public Credential DockerCredentialHelper.retrieve()
[CLASS] class DockerCredentialHelper
[METRICS] loc=23 cc=4 branches=1 loops=1 returns=3 throws=0 nesting=2
[CALLS-INTERNAL] Credential retrieve(List<String> credentialHelperCommand)
[CALLS-EXTERNAL] systemProperties.getProperty("os.name").toLowerCase(Local....... | /* static context
[FOCAL] public Credential DockerCredentialHelper.retrieve()
[PATH1] if(!isWindows || lowerCaseHelper.endsWith(".cmd") || lowerCaseHelper.endsWith(".exe"))=F -> foreach(String suffix : Arrays.asList(".cmd", ".exe"))=T -> try-body throws -> exit loop -> return retrieve(Arrays.asList(credentialHelper.toS... | /* static context
[FOCAL] public Credential DockerCredentialHelper.retrieve()
[PATH1] if(!isWindows || lowerCaseHelper.endsWith(".cmd") || lowerCaseHelper.endsWith(".exe"))=F -> foreach(String suffix : Arrays.asList(".cmd", ".exe"))=T -> try-body throws -> exit loop -> return retrieve(Arrays.asList(credentialHelper.toS... | true | ok | {"focal": {"class": "DockerCredentialHelper", "name": "retrieve", "signature": "Credential retrieve() throws IOException, CredentialHelperUnhandledServerUrlException, CredentialHelperNotFoundException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Credential"}, "class_info": {"name": "DockerCre... |
118602757_0 | class TextStyleBuilder {
void applyStyle(@NonNull TextView textView) {
for (Map.Entry<TextStyle, Object> entry : values.entrySet()) {
switch (entry.getKey()) {
case SIZE: {
final float size = (float) entry.getValue();
applyTextSize(textVie... | final MockTextStyleBuilder builder = new MockTextStyleBuilder();
final TextView textView = Mockito.mock(TextView.class);
builder.applyStyle(textView);
Assert.assertFalse(builder.textColorApplied);
Assert.assertFalse(builder.textSizeApplied);
Assert.assertFalse(builder.g... | [FOCAL] void TextStyleBuilder.applyStyle(TextView textView)
[CLASS] class TextStyleBuilder
[METRICS] loc=49 cc=11 branches=4 loops=1 returns=0 throws=0 nesting=4
[CALLS-INTERNAL] void applyBackgroundColor(TextView textView, int color); void applyBackgroundDrawable(TextView textView, Drawable bg); void applyFontFamily(T... | /* static context
[FOCAL] void TextStyleBuilder.applyStyle(TextView textView)
[PATH1] foreach(Map.Entry<TextStyle, Object> entry : values.entrySet())=T -> switch(entry.getKey())=case BACKGROUND -> if(entry.getValue() instanceof Drawable)=F -> if(entry.getValue() instanceof Integer)#1=T -> exit loop
[PATH2] foreach(Map.... | /* static context
[FOCAL] void TextStyleBuilder.applyStyle(TextView textView)
[PATH1] foreach(Map.Entry<TextStyle, Object> entry : values.entrySet())=T -> switch(entry.getKey())=case BACKGROUND -> if(entry.getValue() instanceof Drawable)=F -> if(entry.getValue() instanceof Integer)#1=T -> exit loop
[PATH2] foreach(Map.... | true | ok | {"focal": {"class": "TextStyleBuilder", "name": "applyStyle", "signature": "void applyStyle(TextView textView)", "start_line": 3, "modifiers": "", "params": [{"name": "textView", "type": "TextView"}], "return_type": "void"}, "class_info": {"name": "TextStyleBuilder", "kind": "class", "modifiers": "", "superclass": null... |
118738606_4 | class XCLLongLongMap extends AbstractMarshallable {
public void putAll(XCLLongLongMap map) {
if (put == null) put = this::put;
map.forEach(put);
}
public static XCLLongLongMap withExpectedSize(int expectedSize);
public abstract long put(long key, long value);
public abstract long g... | map.put(1, 1);
map.put(2, 2);
XCLLongLongMap map2 = XCLLongLongMap.withExpectedSize(16);
map2.put(0, 0);
map2.put(1, 11);
map2.putAll(map);
assertEquals("!cash.xcl.util.KolobokeXCLLongLongMap {\n" +
" ? 2: 2,\n" +
" ? 1: 1,\n" +
... | [FOCAL] public void XCLLongLongMap.putAll(XCLLongLongMap map)
[CLASS] class XCLLongLongMap extends AbstractMarshallable
[METRICS] loc=4 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] XCLLongLongMap.forEach/1
[PATH1] if(put == null)=T
[PATH2] if(put == null)=F
[COLLABORATORS] param map:XCLLongLong... | /* static context
[FOCAL] public void XCLLongLongMap.putAll(XCLLongLongMap map)
[PATH1] if(put == null)=T
[PATH2] if(put == null)=F
[COLLABORATORS] param map:XCLLongLongMap forEach/1
[CALLS-EXTERNAL] XCLLongLongMap.forEach/1
*/
| /* static context
[FOCAL] public void XCLLongLongMap.putAll(XCLLongLongMap map)
[PATH1] if(put == null)=T
[PATH2] if(put == null)=F
[COLLABORATORS] param map:XCLLongLongMap forEach/1
[CALLS-EXTERNAL] XCLLongLongMap.forEach/1
*/
class XCLLongLongMap extends AbstractMarshallable {
public void putAll(XCLLongLongMap m... | true | ok | {"focal": {"class": "XCLLongLongMap", "name": "putAll", "signature": "void putAll(XCLLongLongMap map)", "start_line": 3, "modifiers": "public", "params": [{"name": "map", "type": "XCLLongLongMap"}], "return_type": "void"}, "class_info": {"name": "XCLLongLongMap", "kind": "class", "modifiers": "", "superclass": "Abstrac... |
118781792_9 | class ShoveGestureDetector extends ProgressiveGesture<ShoveGestureDetector.OnShoveGestureListener> {
boolean isAngleAcceptable() {
MultiFingerDistancesObject distancesObject =
pointersDistanceMap.get(new PointerDistancePair(pointerIdList.get(0), pointerIdList.get(1)));
// Takes values from 0 to 180
... | gestureDetector.pointerIdList.add(0);
gestureDetector.pointerIdList.add(1);
gestureDetector.pointersDistanceMap.put(
new PointerDistancePair(0, 1),
new MultiFingerDistancesObject(300, 0, 275, 15)
);
assertTrue(gestureDetector.isAngleAcceptable());
gestureDetector.pointerIdList.clear... | [FOCAL] boolean ShoveGestureDetector.isAngleAcceptable()
[CLASS] class ShoveGestureDetector extends ProgressiveGesture<ShoveGestureDetector.OnShoveGestureListener>
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] pointersDistanceMap.get/1, pointerIdList.get/1, Math.toDegrees/1, Mat... | /* static context
[FOCAL] boolean ShoveGestureDetector.isAngleAcceptable()
[COLLABORATORS] field pointersDistanceMap get/1; field pointerIdList get/1
[NEW] PointerDistancePair
[CALLS-EXTERNAL] pointersDistanceMap.get/1, pointerIdList.get/1, Math.toDegrees/1, Math.abs/1, Math.atan2/2, MultiFingerDistancesObject.getCurrF... | /* static context
[FOCAL] boolean ShoveGestureDetector.isAngleAcceptable()
[COLLABORATORS] field pointersDistanceMap get/1; field pointerIdList get/1
[NEW] PointerDistancePair
[CALLS-EXTERNAL] pointersDistanceMap.get/1, pointerIdList.get/1, Math.toDegrees/1, Math.abs/1, Math.atan2/2, MultiFingerDistancesObject.getCurrF... | true | ok | {"focal": {"class": "ShoveGestureDetector", "name": "isAngleAcceptable", "signature": "boolean isAngleAcceptable()", "start_line": 3, "modifiers": "", "params": [], "return_type": "boolean"}, "class_info": {"name": "ShoveGestureDetector", "kind": "class", "modifiers": "", "superclass": "ProgressiveGesture<ShoveGestureD... |
118787197_1 | class MyEnrichAndReformatFn extends DoFn<String, String> {
public long _calculateTimestamp(long offset) {
return this.startTimestamp + offset;
}
public MyEnrichAndReformatFn();
public MyEnrichAndReformatFn(long arg0);
@ProcessElement public void processElement(@Element String element, Outp... | long offset = 789;
long timestampExpected = BEAM_2_14_RELEASE + offset;
long timestampCalculated = myEnrichAndReformatFn._calculateTimestamp(offset);
assertThat("timestampCalculated", timestampCalculated, is(equalTo(timestampExpected)));
}
} | [FOCAL] public long MyEnrichAndReformatFn._calculateTimestamp(long offset)
[CLASS] class MyEnrichAndReformatFn extends DoFn<String, String>
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[FIELDS] read=startTimestamp
[INPUTS] branches=- | result=offset
[DATAFLOW] offset@param->L2
[CLASS-MEMBERS] My... | /* static context
[FOCAL] public long MyEnrichAndReformatFn._calculateTimestamp(long offset)
[INPUTS] branches=- | result=offset
[FIELDS] read=startTimestamp
*/
| /* static context
[FOCAL] public long MyEnrichAndReformatFn._calculateTimestamp(long offset)
[INPUTS] branches=- | result=offset
[FIELDS] read=startTimestamp
*/
class MyEnrichAndReformatFn extends DoFn<String, String> {
public long _calculateTimestamp(long offset) {
return this.startTimestamp + offset;
}
... | true | ok | {"focal": {"class": "MyEnrichAndReformatFn", "name": "_calculateTimestamp", "signature": "long _calculateTimestamp(long offset)", "start_line": 3, "modifiers": "public", "params": [{"name": "offset", "type": "long"}], "return_type": "long"}, "class_info": {"name": "MyEnrichAndReformatFn", "kind": "class", "modifiers": ... |
118799500_3 | class ResourceMapNamespaces {
public static boolean isResourceMap(String namespace) {
boolean is = false;
if(namespace != null && !namespace.trim().equals("")) {
getNamespaces();
if(resourceMapNamespaces != null && resourceMapNamespaces.contains(namespace)) {
is = true;
}
... | assertTrue(NAMESPACE1+"should be a namespace of the resource map document ", ResourceMapNamespaces.isResourceMap(NAMESPACE1));
assertTrue(NAMESPACE2+"should be a namespace of the resource map document ", ResourceMapNamespaces.isResourceMap(NAMESPACE2));
assertTrue(NAMESPACE3+"should NOT be a namespace of... | [FOCAL] public static boolean ResourceMapNamespaces.isResourceMap(String namespace)
[CLASS] class ResourceMapNamespaces
[METRICS] loc=11 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] List<String> getNamespaces()
[CALLS-EXTERNAL] namespace.trim().equals/1, String.trim/0, resourceMapNamespaces.con... | /* static context
[FOCAL] public static boolean ResourceMapNamespaces.isResourceMap(String namespace)
[PATH1] if(namespace != null && !namespace.trim().equals(""))=T -> if(resourceMapNamespaces != null && resourceMapNamespaces.contains(namespace))=T -> return is
[PATH2] if(namespace != null && !namespace.trim().equals(... | /* static context
[FOCAL] public static boolean ResourceMapNamespaces.isResourceMap(String namespace)
[PATH1] if(namespace != null && !namespace.trim().equals(""))=T -> if(resourceMapNamespaces != null && resourceMapNamespaces.contains(namespace))=T -> return is
[PATH2] if(namespace != null && !namespace.trim().equals(... | true | ok | {"focal": {"class": "ResourceMapNamespaces", "name": "isResourceMap", "signature": "boolean isResourceMap(String namespace)", "start_line": 3, "modifiers": "public static", "params": [{"name": "namespace", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "ResourceMapNamespaces", "kind": "class", "m... |
118824988_0 | class Player {
public List<PlayedWord> getPlayedWords() {
return playedWords;
}
protected Player();
public Player(String username, String macAddr, Team team);
public void setScore();
public String getUsername();
public String getMacAddr();
public Team getTeam();
public int getScore();
@Autowired
pr... | Player player = players.findByUsername("brendan").get(0);
assertTrue(player.getPlayedWords().size() == 0);
player.getPlayedWords().add(new PlayedWord("cool", 100, false, false, player));
assertTrue(player.getPlayedWords().size() == 1);
}
} | [FOCAL] public List<PlayedWord> Player.getPlayedWords()
[CLASS] class Player
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] Player(); Player(String username, String macAddr, Team team); void setScore(); String getUsername(); String getMacAddr(); Team getTeam(); int getScore()
[TEST... | /* static context
[FOCAL] public List<PlayedWord> Player.getPlayedWords()
*/
| /* static context
[FOCAL] public List<PlayedWord> Player.getPlayedWords()
*/
class Player {
public List<PlayedWord> getPlayedWords() {
return playedWords;
}
protected Player();
public Player(String username, String macAddr, Team team);
public void setScore();
public String getUsername();
public String get... | true | ok | {"focal": {"class": "Player", "name": "getPlayedWords", "signature": "List<PlayedWord> getPlayedWords()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<PlayedWord>"}, "class_info": {"name": "Player", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name... |
118963036_1 | class ParamProvider implements AutoCloseable {
public abstract Iterator<Object[]> iterator()public abstract Iterator<Object[]> iterator();
public abstract Iterator<Object[]> iterator()public ParamProvider(ParamGenerator... paramGenerators);
public abstract Iterator<Object[]> iterator()public static Suggested sugges... | ParamProvider prov = new ParamProvider.AllPermutations(
ParamGenerator.of(1, 2, 3),
ParamGenerator.of(true, false)
);
Iterator<Object[]> iter = prov.iterator();
List<List<Object>> all = new ArrayList<>();
while (iter.hasNext()) all.add(Arrays.asList(iter.next()));
Assert.assertEquals... | [FOCAL] public abstract Iterator<Object[]> ParamProvider.iterator()
[CLASS] class ParamProvider implements AutoCloseable
[METRICS] loc=1 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CLASS-MEMBERS] ParamProvider(ParamGenerator... paramGenerators); Suggested suggested(Class<?>... parameterTypes); void onResult(E... | /* static context
[FOCAL] public abstract Iterator<Object[]> ParamProvider.iterator()
*/
| /* static context
[FOCAL] public abstract Iterator<Object[]> ParamProvider.iterator()
*/
class ParamProvider implements AutoCloseable {
public abstract Iterator<Object[]> iterator()public abstract Iterator<Object[]> iterator();
public abstract Iterator<Object[]> iterator()public ParamProvider(ParamGenerator... param... | true | partial | {"focal": {"class": "ParamProvider", "name": "iterator", "signature": "Iterator<Object[]> iterator()", "start_line": 3, "modifiers": "public abstract", "params": [], "return_type": "Iterator<Object[]>"}, "class_info": {"name": "ParamProvider", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "AutoClo... |
118998719_2 | class WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer {
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT);
// IE issue, see https://github.com/jhipster/generator... | env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION);
UndertowEmbeddedServletContainerFactory container = new UndertowEmbeddedServletContainerFactory();
webConfigurer.customize(container);
assertThat(container.getMimeMappings().get("abs")).isEqualTo("audio/x-mpeg");
... | [FOCAL] @Override public void WebConfigurer.customize(ConfigurableEmbeddedServletContainer container)
[CLASS] class WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer
[METRICS] loc=25 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] void setLocationForStaticAsset... | /* static context
[FOCAL] @Override public void WebConfigurer.customize(ConfigurableEmbeddedServletContainer container)
[PATH1] if((jHipsterProperties.getHttp().getVersion().equals(JHipsterProperties.Http.Version.V_2_0) && container instanceof Unde...)=T
[PATH2] if((jHipsterProperties.getHttp().getVersion().equals(JHip... | /* static context
[FOCAL] @Override public void WebConfigurer.customize(ConfigurableEmbeddedServletContainer container)
[PATH1] if((jHipsterProperties.getHttp().getVersion().equals(JHipsterProperties.Http.Version.V_2_0) && container instanceof Unde...)=T
[PATH2] if((jHipsterProperties.getHttp().getVersion().equals(JHip... | true | ok | {"focal": {"class": "WebConfigurer", "name": "customize", "signature": "void customize(ConfigurableEmbeddedServletContainer container)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "container", "type": "ConfigurableEmbeddedServletContainer"}], "return_type": "void"}, "class_info": {"name": "We... |
119147365_6 | class Timepoint implements Parcelable, Comparable<Timepoint> {
public void add(TYPE type, int value) {
if (type == MINUTE) value *= 60;
if (type == HOUR) value *= 3600;
value += toSeconds();
switch (type) {
case SECOND:
second = (value % 3600) % 60;
... | HashSet<Timepoint> timepoints = new HashSet<>(4);
timepoints.add(new Timepoint(12, 0, 0));
timepoints.add(new Timepoint(12, 0, 0));
timepoints.add(new Timepoint(12, 0, 0));
timepoints.add(new Timepoint(12, 0, 0));
Assert.assertEquals(timepoints.size(), 1);
}
} | [FOCAL] public void Timepoint.add(TYPE type, int value)
[CLASS] class Timepoint implements Parcelable, Comparable<Timepoint>
[METRICS] loc=14 cc=6 branches=3 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] int toSeconds()
[PATH1] if(type == MINUTE)=T -> if(type == HOUR)=T -> switch(type)=case SECOND
[PATH2] if(ty... | /* static context
[FOCAL] public void Timepoint.add(TYPE type, int value)
[PATH1] if(type == MINUTE)=T -> if(type == HOUR)=T -> switch(type)=case SECOND
[PATH2] if(type == MINUTE)=F -> if(type == HOUR)=F -> switch(type)=case MINUTE
[PATH3] if(type == MINUTE)=T -> if(type == HOUR)=T -> switch(type)=case HOUR
[PATH4] if(... | /* static context
[FOCAL] public void Timepoint.add(TYPE type, int value)
[PATH1] if(type == MINUTE)=T -> if(type == HOUR)=T -> switch(type)=case SECOND
[PATH2] if(type == MINUTE)=F -> if(type == HOUR)=F -> switch(type)=case MINUTE
[PATH3] if(type == MINUTE)=T -> if(type == HOUR)=T -> switch(type)=case HOUR
[PATH4] if(... | true | ok | {"focal": {"class": "Timepoint", "name": "add", "signature": "void add(TYPE type, int value)", "start_line": 3, "modifiers": "public", "params": [{"name": "type", "type": "TYPE"}, {"name": "value", "type": "int"}], "return_type": "void"}, "class_info": {"name": "Timepoint", "kind": "class", "modifiers": "", "superclass... |
119281902_3 | class GeoJsonReader {
public Geometry read(String string)
{
try
{
JSONObject json = new JSONObject(string);
String type = json.getString(TYPE);
switch (type)
{
case "Feature":
return createFeature(json);
case "FeatureCollection":
Geometry[] features = createFeatures(json.getJSONArra... | Geometry g = read("{" +
" \"type\": \"Feature\"," +
" \"properties\": {\"a\": 3, \"b\": \"blub\", \"c\": null, \"d\": [1,2], \"e\": {\"hi\":\"ho\"}}," +
" \"geometry\": {" +
" \"type\": \"Point\"," +
" \"coordinates\": [5,5]" +
" }" +
"}");
assertTrue(g.getUserData() instanceof... | [FOCAL] public Geometry GeoJsonReader.read(String string)
[CLASS] class GeoJsonReader
[METRICS] loc=21 cc=4 branches=1 loops=0 returns=3 throws=1 nesting=2
[CALLS-INTERNAL] Geometry createFeature(JSONObject feature); Geometry createGeometry(JSONObject geo); Geometry[] createFeatures(JSONArray features)
[CALLS-EXTERNAL]... | /* static context
[FOCAL] public Geometry GeoJsonReader.read(String string)
[THROWS-WHEN] GeoJsonException when try-body throws
[PATH1] try-body throws -> throw new GeoJsonException(e)
[PATH2] switch(type)=case "Feature" -> return createFeature(json)
[PATH3] switch(type)=case "FeatureCollection" -> return factory.creat... | /* static context
[FOCAL] public Geometry GeoJsonReader.read(String string)
[THROWS-WHEN] GeoJsonException when try-body throws
[PATH1] try-body throws -> throw new GeoJsonException(e)
[PATH2] switch(type)=case "Feature" -> return createFeature(json)
[PATH3] switch(type)=case "FeatureCollection" -> return factory.creat... | true | ok | {"focal": {"class": "GeoJsonReader", "name": "read", "signature": "Geometry read(String string)", "start_line": 3, "modifiers": "public", "params": [{"name": "string", "type": "String"}], "return_type": "Geometry"}, "class_info": {"name": "GeoJsonReader", "kind": "class", "modifiers": "", "superclass": null, "interface... |
119369247_14 | class LiteCycle implements LifecycleObserver {
public static <T> LiteObserverFactory<T> with(T item) {
return new LiteObserverFactory<>(item);
}
public static LiteObserverFactory<T> defer(Callable<T> itemInitializer);
}
class LiteCycleTest {
@Test
public void observeWithNoParameterThenR... | Object subject = LiteCycle.with(0)
.forLifeCycle(new MockLifeCycleOwner())
.observe(BehaviorSubject.<Integer>create());
assertTrue(subject instanceof BehaviorSubject);
}
} | [FOCAL] public static LiteObserverFactory<T> LiteCycle.with(T item)
[CLASS] class LiteCycle implements LifecycleObserver
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] LiteObserverFactory<>
[INPUTS] branches=- | result=item
[DATAFLOW] item@param->L2
[CLASS-MEMBERS] LiteObserverFactory<T> def... | /* static context
[FOCAL] public static LiteObserverFactory<T> LiteCycle.with(T item)
[INPUTS] branches=- | result=item
[NEW] LiteObserverFactory<>
*/
| /* static context
[FOCAL] public static LiteObserverFactory<T> LiteCycle.with(T item)
[INPUTS] branches=- | result=item
[NEW] LiteObserverFactory<>
*/
class LiteCycle implements LifecycleObserver {
public static <T> LiteObserverFactory<T> with(T item) {
return new LiteObserverFactory<>(item);
}
pu... | true | ok | {"focal": {"class": "LiteCycle", "name": "with", "signature": "LiteObserverFactory<T> with(T item)", "start_line": 3, "modifiers": "public static", "params": [{"name": "item", "type": "T"}], "return_type": "LiteObserverFactory<T>"}, "class_info": {"name": "LiteCycle", "kind": "class", "modifiers": "", "superclass": nul... |
119531923_16 | class TimeUtil {
public static String convertMillisToMinSecFormat(long millis) {
long ms = millis % 1000;
long s = (millis / 1000) % 60;
long m = ((millis / 1000) / 60) % 60;
if (s > 0 && m <= 0) {
return String.format("%d sec %d ms", s, ms);
} else if (s > 0 || ... | assertThat(TimeUtil.convertMillisToMinSecFormat(100), equalTo("100 ms"));
assertThat(TimeUtil.convertMillisToMinSecFormat(1010), equalTo("1 sec 10 ms"));
assertThat(TimeUtil.convertMillisToMinSecFormat(60010), equalTo("1 min 0 sec 10 ms"));
}
} | [FOCAL] public static String TimeUtil.convertMillisToMinSecFormat(long millis)
[CLASS] class TimeUtil
[METRICS] loc=12 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=2
[CALLS-EXTERNAL] String.format/3, String.format/4, String.format/2
[PATH1] if(s > 0 && m <= 0)=F -> if(s > 0 || m > 0)=T -> return String.format("%d... | /* static context
[FOCAL] public static String TimeUtil.convertMillisToMinSecFormat(long millis)
[PATH1] if(s > 0 && m <= 0)=F -> if(s > 0 || m > 0)=T -> return String.format("%d min %d sec %d ms", m, s, ms)
[PATH2] if(s > 0 && m <= 0)=T -> return String.format("%d sec %d ms", s, ms)
[PATH3] if(s > 0 && m <= 0)=F -> if... | /* static context
[FOCAL] public static String TimeUtil.convertMillisToMinSecFormat(long millis)
[PATH1] if(s > 0 && m <= 0)=F -> if(s > 0 || m > 0)=T -> return String.format("%d min %d sec %d ms", m, s, ms)
[PATH2] if(s > 0 && m <= 0)=T -> return String.format("%d sec %d ms", s, ms)
[PATH3] if(s > 0 && m <= 0)=F -> if... | true | ok | {"focal": {"class": "TimeUtil", "name": "convertMillisToMinSecFormat", "signature": "String convertMillisToMinSecFormat(long millis)", "start_line": 3, "modifiers": "public static", "params": [{"name": "millis", "type": "long"}], "return_type": "String"}, "class_info": {"name": "TimeUtil", "kind": "class", "modifiers":... |
119633513_2 | class ThumbnailAdapter extends RecyclerView.Adapter<ThumbnailViewHolder> {
@Override
public int getItemCount() {
if (cursor == null) {
return 0;
} else {
return cursor.getCount();
}
}
public ThumbnailAdapter(EventBus eventBus);
public void setCurso... | assertEquals(0, adapter.getItemCount());
}
} | [FOCAL] @Override public int ThumbnailAdapter.getItemCount()
[CLASS] class ThumbnailAdapter extends RecyclerView.Adapter<ThumbnailViewHolder>
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] Cursor.getCount/0
[FIELDS] read=cursor:Cursor
[PATH1] if(cursor == null)=T -> return 0
[PATH... | /* static context
[FOCAL] @Override public int ThumbnailAdapter.getItemCount()
[PATH1] if(cursor == null)=T -> return 0
[PATH2] if(cursor == null)=F -> return cursor.getCount()
[INPUTS] branches=cursor | result=cursor
[COLLABORATORS] field cursor:Cursor getCount/0
[FIELDS] read=cursor:Cursor
[CALLS-EXTERNAL] Cursor.get... | /* static context
[FOCAL] @Override public int ThumbnailAdapter.getItemCount()
[PATH1] if(cursor == null)=T -> return 0
[PATH2] if(cursor == null)=F -> return cursor.getCount()
[INPUTS] branches=cursor | result=cursor
[COLLABORATORS] field cursor:Cursor getCount/0
[FIELDS] read=cursor:Cursor
[CALLS-EXTERNAL] Cursor.get... | true | ok | {"focal": {"class": "ThumbnailAdapter", "name": "getItemCount", "signature": "int getItemCount()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "ThumbnailAdapter", "kind": "class", "modifiers": "", "superclass": "RecyclerView.Adapter<ThumbnailViewHolder>"... |
119644903_0 | class PinnedPubKeyTrustManager implements X509TrustManager {
public static SSLContext pinSha256SSLContext(final Stream<String> sha256Pins) {
return sslContext(pinSha256TrustManager(sha256Pins));
}
public PinnedPubKeyTrustManager(final String algorithm, final Iterable<byte[]> pinnedPubKeys);
... | // todo: make these not rely on remote server, stand up local TLS server with hard-coded certs?
assertEquals("pinnedpubkey authentication failed, server pin (SHA-256): t62CeU2tQiqkexU74Gxa2eg7fRbEgoChTociMee9wno=",
testPin("moparisthebest.com", 443, "bla").getCause().getMessage());
... | [FOCAL] public static SSLContext PinnedPubKeyTrustManager.pinSha256SSLContext(Stream<String> sha256Pins)
[CLASS] class PinnedPubKeyTrustManager implements X509TrustManager
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] SSLContext sslContext(TrustManager trustManager); TrustManager... | /* static context
[FOCAL] public static SSLContext PinnedPubKeyTrustManager.pinSha256SSLContext(Stream<String> sha256Pins)
[INPUTS] branches=- | result=sha256Pins
[CALLS-INTERNAL] SSLContext sslContext(TrustManager trustManager); TrustManager pinSha256TrustManager(Stream<String> sha256Pins)
*/
| /* static context
[FOCAL] public static SSLContext PinnedPubKeyTrustManager.pinSha256SSLContext(Stream<String> sha256Pins)
[INPUTS] branches=- | result=sha256Pins
[CALLS-INTERNAL] SSLContext sslContext(TrustManager trustManager); TrustManager pinSha256TrustManager(Stream<String> sha256Pins)
*/
class PinnedPubKeyTrustMa... | true | ok | {"focal": {"class": "PinnedPubKeyTrustManager", "name": "pinSha256SSLContext", "signature": "SSLContext pinSha256SSLContext(Stream<String> sha256Pins)", "start_line": 3, "modifiers": "public static", "params": [{"name": "sha256Pins", "type": "Stream<String>"}], "return_type": "SSLContext"}, "class_info": {"name": "Pinn... |
119702819_35 | class DeadLetterConfig extends AbstractConfig {
@Override
public boolean validate() {
log.info("Validating DeadLetterConfig...");
if (deadLetterExchange != null && deadLetterExchange.validate()) {
log.info("DeadLetterConfig configuration validated successfully for deadLetterExchange '{}'", deadLetter... | deadLetterConfig = DeadLetterConfig.builder()
.deadLetterExchange(null)
.queuePostfix(".dlq")
.build();
assertFalse(deadLetterConfig.validate());
}
} | [FOCAL] @Override public boolean DeadLetterConfig.validate()
[CLASS] class DeadLetterConfig extends AbstractConfig
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] log.info/1, deadLetterExchange.validate/0, log.info/2, log.error/1
[PATH1] if(deadLetterExchange != null && deadLetter... | /* static context
[FOCAL] @Override public boolean DeadLetterConfig.validate()
[PATH1] if(deadLetterExchange != null && deadLetterExchange.validate())=T -> return true
[PATH2] if(deadLetterExchange != null && deadLetterExchange.validate())=F -> return false
[COLLABORATORS] field deadLetterExchange validate/0
[CALLS-EXT... | /* static context
[FOCAL] @Override public boolean DeadLetterConfig.validate()
[PATH1] if(deadLetterExchange != null && deadLetterExchange.validate())=T -> return true
[PATH2] if(deadLetterExchange != null && deadLetterExchange.validate())=F -> return false
[COLLABORATORS] field deadLetterExchange validate/0
[CALLS-EXT... | true | ok | {"focal": {"class": "DeadLetterConfig", "name": "validate", "signature": "boolean validate()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "boolean"}, "class_info": {"name": "DeadLetterConfig", "kind": "class", "modifiers": "", "superclass": "AbstractConfig", "interfaces": null, "fiel... |
119727871_28 | class PatternOptionBuilder {
public static Options parsePattern(String pattern)
{
char opt = ' ';
boolean required = false;
Class<?> type = null;
Options options = new Options();
for (int i = 0; i < pattern.length(); i++)
{
char ch = pattern.charAt(... | Options options = PatternOptionBuilder.parsePattern("abc");
CommandLineParser parser = new PosixParser();
CommandLine line = parser.parse(options, new String[] { "-abc" });
assertTrue(line.hasOption('a'));
assertNull("value a", line.getOptionObject('a'));
assertTrue(line... | [FOCAL] public static Options PatternOptionBuilder.parsePattern(String pattern)
[CLASS] class PatternOptionBuilder
[METRICS] loc=57 cc=6 branches=4 loops=1 returns=1 throws=0 nesting=3
[CALLS-INTERNAL] Object getValueClass(char ch); boolean isValueCode(char ch)
[CALLS-EXTERNAL] String.length/0, String.charAt/1, Option.... | /* static context
[FOCAL] public static Options PatternOptionBuilder.parsePattern(String pattern)
[PATH1] for(i < pattern.length())=T -> if(!isValueCode(ch))=T -> if(opt != ' ')#1=T -> exit loop -> if(opt != ' ')#2=T -> return options
[PATH2] for(i < pattern.length())=T -> if(!isValueCode(ch))=F -> if(ch == '!')=T -> e... | /* static context
[FOCAL] public static Options PatternOptionBuilder.parsePattern(String pattern)
[PATH1] for(i < pattern.length())=T -> if(!isValueCode(ch))=T -> if(opt != ' ')#1=T -> exit loop -> if(opt != ' ')#2=T -> return options
[PATH2] for(i < pattern.length())=T -> if(!isValueCode(ch))=F -> if(ch == '!')=T -> e... | true | ok | {"focal": {"class": "PatternOptionBuilder", "name": "parsePattern", "signature": "Options parsePattern(String pattern)", "start_line": 3, "modifiers": "public static", "params": [{"name": "pattern", "type": "String"}], "return_type": "Options"}, "class_info": {"name": "PatternOptionBuilder", "kind": "class", "modifiers... |
119737924_5 | class User implements Parcelable {
public void setEmail(String mail) throws InvalidEmailException {
this.email = mail;
}
public User(String username, String email, String phoneNumber);
public User(String username, String email, String phoneNumber, float rating);
public User(String Usern... | User newUser = new User("HelloWorld");
newUser.setEmail("myEmail@gmail.com");
assertTrue(newUser.getEmail().equals("myEmail@gmail.com"));
}
} | [FOCAL] public void User.setEmail(String mail)
[CLASS] class User implements Parcelable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[FIELDS] write=email
[EXCEPTIONS] declares InvalidEmailException
[STATE] email via getEmail()
[DATAFLOW] mail@param->L2
[CLASS-MEMBERS] User(String username, Strin... | /* static context
[FOCAL] public void User.setEmail(String mail)
[STATE] email via getEmail()
[EXCEPTIONS] declares InvalidEmailException
[FIELDS] write=email
*/
| /* static context
[FOCAL] public void User.setEmail(String mail)
[STATE] email via getEmail()
[EXCEPTIONS] declares InvalidEmailException
[FIELDS] write=email
*/
class User implements Parcelable {
public void setEmail(String mail) throws InvalidEmailException {
this.email = mail;
}
public User(St... | true | ok | {"focal": {"class": "User", "name": "setEmail", "signature": "void setEmail(String mail) throws InvalidEmailException", "start_line": 3, "modifiers": "public", "params": [{"name": "mail", "type": "String"}], "return_type": "void"}, "class_info": {"name": "User", "kind": "class", "modifiers": "", "superclass": null, "in... |
119819447_306 | class MethodVisitor {
@Deprecated
public void visitMethodInsn(
final int opcode, final String owner, final String name, final String descriptor) {
int opcodeAndSource = opcode | (api < Opcodes.ASM5 ? Opcodes.SOURCE_DEPRECATED : 0);
visitMethodInsn(opcodeAndSource, owner, name, descriptor, opcode == O... | StringWriter log = new StringWriter();
LogMethodVisitor logMethodVisitor = new LogMethodVisitor(log);
MethodVisitor methodVisitor = new MethodVisitor4Override(logMethodVisitor, log);
methodVisitor.visitMethodInsn(0, "C", "m", "()V", false);
assertEquals("LogMethodVisitor:m4()V;MethodVisitor4:m()V;... | [FOCAL] @Deprecated public void MethodVisitor.visitMethodInsn(int opcode, String owner, String name, String descriptor)
[CLASS] class MethodVisitor
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void visitMethodInsn(int opcode, String owner, String name, String descriptor, boolean... | /* static context
[FOCAL] @Deprecated public void MethodVisitor.visitMethodInsn(int opcode, String owner, String name, String descriptor)
[CALLS-INTERNAL] void visitMethodInsn(int opcode, String owner, String name, String descriptor, boolean isInterface)
*/
| /* static context
[FOCAL] @Deprecated public void MethodVisitor.visitMethodInsn(int opcode, String owner, String name, String descriptor)
[CALLS-INTERNAL] void visitMethodInsn(int opcode, String owner, String name, String descriptor, boolean isInterface)
*/
class MethodVisitor {
@Deprecated
public void visitMethod... | true | ok | {"focal": {"class": "MethodVisitor", "name": "visitMethodInsn", "signature": "void visitMethodInsn(int opcode, String owner, String name, String descriptor)", "start_line": 3, "modifiers": "@Deprecated public", "params": [{"name": "opcode", "type": "int"}, {"name": "owner", "type": "String"}, {"name": "name", "type": "... |
120003293_2 | class RetryStrategy implements Function<Flowable<Throwable>, Flowable<?>> {
public static Builder always() {
return new Builder(t -> true);
}
RetryStrategy(Builder builder);
@Override public Flowable<?> apply(Flowable<Throwable> errors);
private Flowable<Duration> getCappedDelays();
private Flowabl... | AtomicInteger retries = new AtomicInteger();
TestScheduler scheduler = new TestScheduler();
TestSubscriber<Integer> test =
errorSource(10)
.doOnSubscribe(d -> retries.incrementAndGet())
.retryWhen(
RetryStrategy.always()
.withBackoffSchedul... | [FOCAL] public static Builder RetryStrategy.always()
[CLASS] class RetryStrategy implements Function<Flowable<Throwable>, Flowable<?>>
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] Builder
[CLASS-MEMBERS] RetryStrategy(Builder builder); Flowable<?> apply(Flowable<Throwable> errors); Flowabl... | /* static context
[FOCAL] public static Builder RetryStrategy.always()
[NEW] Builder
*/
| /* static context
[FOCAL] public static Builder RetryStrategy.always()
[NEW] Builder
*/
class RetryStrategy implements Function<Flowable<Throwable>, Flowable<?>> {
public static Builder always() {
return new Builder(t -> true);
}
RetryStrategy(Builder builder);
@Override public Flowable<?> apply(Flowab... | true | ok | {"focal": {"class": "RetryStrategy", "name": "always", "signature": "Builder always()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Builder"}, "class_info": {"name": "RetryStrategy", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Function<Flowable<Throwable>, Flowa... |
120074273_7 | class ColuTransferInstructionsParser {
public List<Integer> retrieveOutputIndexesFromScript(byte []scriptBytes) throws ParseException {
List<Integer> indexes = new ArrayList<>();
if (!isValidColuScript(scriptBytes)) {
return indexes;
}
int offset = OPCODE_OFFSET;
... | // Transaction 811ce060b88cec67e5066f7bb75cd8acef43c3f24c0787fb1fe426510d4fe38b contains the invalid script
byte[] script = Hex.decode("6a 07 43 43 02 15 00 21 64");
// this may not crash but result in no output being found.
// Or am I interpreting wrongly the fact that the CC blockexplo... | [FOCAL] public List<Integer> ColuTransferInstructionsParser.retrieveOutputIndexesFromScript(byte [] scriptBytes)
[CLASS] class ColuTransferInstructionsParser
[METRICS] loc=67 cc=16 branches=5 loops=1 returns=2 throws=1 nesting=3
[CALLS-INTERNAL] boolean isValidColuScript(byte [] scriptBytes); int getAmountTotalBytesSFF... | /* static context
[FOCAL] public List<Integer> ColuTransferInstructionsParser.retrieveOutputIndexesFromScript(byte [] scriptBytes)
[THROWS-WHEN] ParseException when isValidColuScript(scriptBytes) && scriptBytes[offset] >= OPCODE_ISSUANCE_TORRENT_METADATA && scriptBytes[offset] <= 0x0F && switch(scriptBytes[offset])=cas... | /* static context
[FOCAL] public List<Integer> ColuTransferInstructionsParser.retrieveOutputIndexesFromScript(byte [] scriptBytes)
[THROWS-WHEN] ParseException when isValidColuScript(scriptBytes) && scriptBytes[offset] >= OPCODE_ISSUANCE_TORRENT_METADATA && scriptBytes[offset] <= 0x0F && switch(scriptBytes[offset])=cas... | true | ok | {"focal": {"class": "ColuTransferInstructionsParser", "name": "retrieveOutputIndexesFromScript", "signature": "List<Integer> retrieveOutputIndexesFromScript(byte [] scriptBytes) throws ParseException", "start_line": 3, "modifiers": "public", "params": [{"name": "scriptBytes", "type": "byte []"}], "return_type": "List<I... |
120152712_6 | class XMLDSigVerifier {
public XMLDsigVerificationResult VerifyXMLDSig(InputStream fileStream)
{
XMLDsigVerificationResult result = new XMLDsigVerificationResult();
try
{
//Signature will also be validated in this call, if it fails an exception is thrown
//No poi... | InputStream EntryToken = new FileInputStream("src/test/ts/EntryToken-future-cert-self-signed.tsml");
XMLDsigVerificationResult result = new XMLDSigVerifier().VerifyXMLDSig(EntryToken);
assert(!result.isValid);
assert(result.failureReason.contains("NotBefore")); // save travis from misrep... | [FOCAL] public XMLDsigVerificationResult XMLDSigVerifier.VerifyXMLDSig(InputStream fileStream)
[CLASS] class XMLDSigVerifier
[METRICS] loc=20 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] XMLDsigVerificationResult validateCertificateIssuer(XMLSignature signature, XMLDsigVerificationResult result... | /* static context
[FOCAL] public XMLDsigVerificationResult XMLDSigVerifier.VerifyXMLDSig(InputStream fileStream)
[PATH1] try-body throws -> return result
[PATH2] return validateCertificateIssuer(signature, result)
[INPUTS] branches=- | result=fileStream
[EXCEPTIONS] catches Exception e
[CALLS-INTERNAL] XMLDsigVerificat... | /* static context
[FOCAL] public XMLDsigVerificationResult XMLDSigVerifier.VerifyXMLDSig(InputStream fileStream)
[PATH1] try-body throws -> return result
[PATH2] return validateCertificateIssuer(signature, result)
[INPUTS] branches=- | result=fileStream
[EXCEPTIONS] catches Exception e
[CALLS-INTERNAL] XMLDsigVerificat... | true | ok | {"focal": {"class": "XMLDSigVerifier", "name": "VerifyXMLDSig", "signature": "XMLDsigVerificationResult VerifyXMLDSig(InputStream fileStream)", "start_line": 3, "modifiers": "public", "params": [{"name": "fileStream", "type": "InputStream"}], "return_type": "XMLDsigVerificationResult"}, "class_info": {"name": "XMLDSigV... |
120272671_0 | class OrderRepository implements OrderDataSource {
@Nullable
public OrderList getAllCachedOrderHistory() {
return cachedOrderList;
}
private OrderRepository(@NonNull final BlockchainSource blockchainSource,
@NonNull final EventLogger eventLogger,
@NonNull final OrderDataSource.Remote remoteData,
@NonNull... | assertNull(orderRepository.getAllCachedOrderHistory());
}
} | [FOCAL] @Nullable public OrderList OrderRepository.getAllCachedOrderHistory()
[CLASS] class OrderRepository implements OrderDataSource
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] OrderRepository(BlockchainSource blockchainSource, EventLogger eventLogger, OrderDataSource.Remote r... | /* static context
[FOCAL] @Nullable public OrderList OrderRepository.getAllCachedOrderHistory()
*/
| /* static context
[FOCAL] @Nullable public OrderList OrderRepository.getAllCachedOrderHistory()
*/
class OrderRepository implements OrderDataSource {
@Nullable
public OrderList getAllCachedOrderHistory() {
return cachedOrderList;
}
private OrderRepository(@NonNull final BlockchainSource blockchainSource,
@No... | true | ok | {"focal": {"class": "OrderRepository", "name": "getAllCachedOrderHistory", "signature": "OrderList getAllCachedOrderHistory()", "start_line": 3, "modifiers": "@Nullable public", "params": [], "return_type": "OrderList"}, "class_info": {"name": "OrderRepository", "kind": "class", "modifiers": "", "superclass": null, "in... |
120274146_0 | class StringUtil {
public boolean isValidPassword(String password) {
Pattern p = Pattern.compile("^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=\\S+$).{8,}$");
Matcher m = p.matcher(password);
if (m.find())
return true;
return false;
}
StringUtil stringUtil;
}
class S... | //given
String validPassword = "As1asd1sdas21";
String invalidPassword = "asd123";
//when and then
assertTrue(stringUtil.isValidPassword(validPassword));
assertFalse(stringUtil.isValidPassword(invalidPassword));
}
} | [FOCAL] public boolean StringUtil.isValidPassword(String password)
[CLASS] class StringUtil
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] Pattern.compile/1, Pattern.matcher/1, Matcher.find/0
[PATH1] if(m.find())=T -> return true
[PATH2] if(m.find())=F -> return false
[INPUTS] bra... | /* static context
[FOCAL] public boolean StringUtil.isValidPassword(String password)
[PATH1] if(m.find())=T -> return true
[PATH2] if(m.find())=F -> return false
[INPUTS] branches=password | result=-
[CALLS-EXTERNAL] Pattern.compile/1, Pattern.matcher/1, Matcher.find/0
*/
| /* static context
[FOCAL] public boolean StringUtil.isValidPassword(String password)
[PATH1] if(m.find())=T -> return true
[PATH2] if(m.find())=F -> return false
[INPUTS] branches=password | result=-
[CALLS-EXTERNAL] Pattern.compile/1, Pattern.matcher/1, Matcher.find/0
*/
class StringUtil {
public boolean isValidP... | true | ok | {"focal": {"class": "StringUtil", "name": "isValidPassword", "signature": "boolean isValidPassword(String password)", "start_line": 3, "modifiers": "public", "params": [{"name": "password", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "StringUtil", "kind": "class", "modifiers": "", "superclass"... |
120363922_2 | class FeignContext extends NamedContextFactory<FeignClientSpecification> {
@Nullable
public <T> T getInstanceWithoutAncestors(String name, Class<T> type) {
try {
return BeanFactoryUtils.beanOfType(getContext(name), type);
}
catch (BeansException ex) {
return null;
}
}
public FeignContext();
@Null... | AnnotationConfigApplicationContext parent = new AnnotationConfigApplicationContext();
parent.refresh();
FeignContext feignContext = new FeignContext();
feignContext.setApplicationContext(parent);
feignContext.setConfigurations(Lists.newArrayList(getSpec("demo", DemoConfiguration.class)));
Logger.Level lev... | [FOCAL] @Nullable public T FeignContext.getInstanceWithoutAncestors(String name, Class<T> type)
[CLASS] class FeignContext extends NamedContextFactory<FeignClientSpecification>
[METRICS] loc=9 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] BeanFactoryUtils.beanOfType/2, getContext/1 (inherited)
[... | /* static context
[FOCAL] @Nullable public T FeignContext.getInstanceWithoutAncestors(String name, Class<T> type)
[PATH1] try-body throws -> return null
[PATH2] return BeanFactoryUtils.beanOfType(getContext(name), type)
[INPUTS] branches=- | result=name, type
[EXCEPTIONS] catches BeansException ex
[CALLS-EXTERNAL] Bean... | /* static context
[FOCAL] @Nullable public T FeignContext.getInstanceWithoutAncestors(String name, Class<T> type)
[PATH1] try-body throws -> return null
[PATH2] return BeanFactoryUtils.beanOfType(getContext(name), type)
[INPUTS] branches=- | result=name, type
[EXCEPTIONS] catches BeansException ex
[CALLS-EXTERNAL] Bean... | true | ok | {"focal": {"class": "FeignContext", "name": "getInstanceWithoutAncestors", "signature": "T getInstanceWithoutAncestors(String name, Class<T> type)", "start_line": 3, "modifiers": "@Nullable public", "params": [{"name": "name", "type": "String"}, {"name": "type", "type": "Class<T>"}], "return_type": "T"}, "class_info": ... |
120471283_161 | class RoleStore {
public List<Role> findAll() {
List<Role> result = new ArrayList<>();
try (Connection connect = CON.getConnect();
Statement st = connect.createStatement();
ResultSet rstSet = st.executeQuery(QUERIES.getProperty("findAllRoles"))) {
while (rstSet... | testStore.add(new Role("test"));
testStore.add(new Role("test2"));
assertTrue(testStore.findAll().containsAll(asList(new Role("test"), new Role("test2"))));
}
} | [FOCAL] public List<Role> RoleStore.findAll()
[CLASS] class RoleStore
[METRICS] loc=15 cc=3 branches=0 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] CON.getConnect/0, Connection.createStatement/0, Statement.executeQuery/1, QUERIES.getProperty/1, ResultSet.next/0, ResultSet.getString/1, Role.setId/1, ResultSet.g... | /* static context
[FOCAL] public List<Role> RoleStore.findAll()
[PATH1] while(rstSet.next())=T -> exit loop -> return result
[PATH2] try-body throws -> return result
[PATH3] while(rstSet.next())=F -> return result
[EXCEPTIONS] catches SQLException e
[NEW] ArrayList<>, Role
[CALLS-EXTERNAL] CON.getConnect/0, Connection.... | /* static context
[FOCAL] public List<Role> RoleStore.findAll()
[PATH1] while(rstSet.next())=T -> exit loop -> return result
[PATH2] try-body throws -> return result
[PATH3] while(rstSet.next())=F -> return result
[EXCEPTIONS] catches SQLException e
[NEW] ArrayList<>, Role
[CALLS-EXTERNAL] CON.getConnect/0, Connection.... | true | ok | {"focal": {"class": "RoleStore", "name": "findAll", "signature": "List<Role> findAll()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<Role>"}, "class_info": {"name": "RoleStore", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "testStore", "typ... |
120487379_34 | class TypesBuilder {
public List<Builder> build(Domain domain, DomainTypeResolver domainTypeResolver) {
final List<Type> domainTypes = domain.getTypes();
List<TypeHandlerResult> result = new ArrayList<>();
if (CollectionUtils.isNotEmpty(domainTypes)) {
for (Type type : domainTypes) {
resul... | Map<Class<? extends ArrayItem>, String> arrayItems = new HashMap<>();
arrayItems.put(ObjectArrayItem.class, "Object");
arrayItems.put(AnyArrayItem.class, "Object");
arrayItems.put(StringArrayItem.class, "String");
arrayItems.put(IntegerArrayItem.class, "Integer");
arrayItems.put(NumberArrayItem... | [FOCAL] public List<Builder> TypesBuilder.build(Domain domain, DomainTypeResolver domainTypeResolver)
[CLASS] class TypesBuilder
[METRICS] loc=16 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] TypeHandlerResult buildType(Type type, Domain domain, DomainTypeResolver domainTypeResolver)
[CALLS-EXTE... | /* static context
[FOCAL] public List<Builder> TypesBuilder.build(Domain domain, DomainTypeResolver domainTypeResolver)
[PATH1] if(CollectionUtils.isNotEmpty(domainTypes))=T -> foreach(Type type : domainTypes)=T -> exit loop -> return result .stream() .map(TypeHandlerResult::getBuilder) .filter(Object...
[PATH2] if(Col... | /* static context
[FOCAL] public List<Builder> TypesBuilder.build(Domain domain, DomainTypeResolver domainTypeResolver)
[PATH1] if(CollectionUtils.isNotEmpty(domainTypes))=T -> foreach(Type type : domainTypes)=T -> exit loop -> return result .stream() .map(TypeHandlerResult::getBuilder) .filter(Object...
[PATH2] if(Col... | true | ok | {"focal": {"class": "TypesBuilder", "name": "build", "signature": "List<Builder> build(Domain domain, DomainTypeResolver domainTypeResolver)", "start_line": 3, "modifiers": "public", "params": [{"name": "domain", "type": "Domain"}, {"name": "domainTypeResolver", "type": "DomainTypeResolver"}], "return_type": "List<Buil... |
120606464_2 | class AsynchronousTimeoutBean {
@Asynchronous
public Future<Boolean> timeout(boolean shouldTimeout) {
Boolean timedOut = false;
if (shouldTimeout) {
try {
// Simulate a long running query
Thread.sleep(AWAIT);
} catch (InterruptedE... | Future<Boolean> future = asynchronousTimeoutBean.timeout(true);
try {
future.get();
} catch (TimeoutException toe) {
return;
} catch (ExecutionException ex) {
if (ex.getCause() instanceof TimeoutException) {
return;
}
... | [FOCAL] @Asynchronous public Future<Boolean> AsynchronousTimeoutBean.timeout(boolean shouldTimeout)
[CLASS] class AsynchronousTimeoutBean
[METRICS] loc=15 cc=3 branches=1 loops=0 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] Thread.sleep/1, CompletableFuture.completedFuture/1
[EXCEPTIONS] catches InterruptedException e... | /* static context
[FOCAL] @Asynchronous public Future<Boolean> AsynchronousTimeoutBean.timeout(boolean shouldTimeout)
[PATH1] if(shouldTimeout)=T -> try-body throws -> return CompletableFuture.completedFuture(timedOut)
[PATH2] if(shouldTimeout)=F -> return CompletableFuture.completedFuture(timedOut)
[INPUTS] branches=s... | /* static context
[FOCAL] @Asynchronous public Future<Boolean> AsynchronousTimeoutBean.timeout(boolean shouldTimeout)
[PATH1] if(shouldTimeout)=T -> try-body throws -> return CompletableFuture.completedFuture(timedOut)
[PATH2] if(shouldTimeout)=F -> return CompletableFuture.completedFuture(timedOut)
[INPUTS] branches=s... | true | ok | {"focal": {"class": "AsynchronousTimeoutBean", "name": "timeout", "signature": "Future<Boolean> timeout(boolean shouldTimeout)", "start_line": 3, "modifiers": "@Asynchronous public", "params": [{"name": "shouldTimeout", "type": "boolean"}], "return_type": "Future<Boolean>"}, "class_info": {"name": "AsynchronousTimeoutB... |
120684055_76 | class CalypsoPo extends MatchingSe {
public PoRevision getRevision() {
return this.revision;
}
public CalypsoPo(SeResponse selectionResponse, String extraInfo);
public byte[] getDfName();
public byte[] getApplicationSerialNumber();
public byte[] getAtr();
public boolean isModific... | Assert.assertEquals(getPoApplicationByte((byte) 0x01).getRevision(), PoRevision.REV2_4);
Assert.assertEquals(getPoApplicationByte((byte) 0x04).getRevision(), PoRevision.REV2_4);
Assert.assertEquals(getPoApplicationByte((byte) 0x06).getRevision(), PoRevision.REV2_4);
Assert.assertEqual... | [FOCAL] public PoRevision CalypsoPo.getRevision()
[CLASS] class CalypsoPo extends MatchingSe
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[FIELDS] read=revision
[CLASS-MEMBERS] CalypsoPo(SeResponse selectionResponse, String extraInfo); byte[] getDfName(); byte[] getApplicationSerialNumber(); byt... | /* static context
[FOCAL] public PoRevision CalypsoPo.getRevision()
[FIELDS] read=revision
*/
| /* static context
[FOCAL] public PoRevision CalypsoPo.getRevision()
[FIELDS] read=revision
*/
class CalypsoPo extends MatchingSe {
public PoRevision getRevision() {
return this.revision;
}
public CalypsoPo(SeResponse selectionResponse, String extraInfo);
public byte[] getDfName();
public... | true | ok | {"focal": {"class": "CalypsoPo", "name": "getRevision", "signature": "PoRevision getRevision()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "PoRevision"}, "class_info": {"name": "CalypsoPo", "kind": "class", "modifiers": "", "superclass": "MatchingSe", "interfaces": null, "fields": [], "member... |
120756407_1 | class CompositeBuffer implements Buffer {
public static CompositeBuffer newBuffer() {
return BuffersBuffer.create();
}
public static CompositeBuffer newBuffer(final MemoryManager memoryManager);
public static CompositeBuffer newBuffer(final MemoryManager memoryManager, final Buffer... buffers)... |
final byte[] bytes = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
final List<Buffer> bufferList = new ArrayList<>();
for (byte b : bytes) {
final Buffer buffer = mm.allocate(1);
buffer.put(0, b);
bufferList.add(buffer);
}
final Buffer[] buff... | [FOCAL] public static CompositeBuffer CompositeBuffer.newBuffer()
[CLASS] class CompositeBuffer implements Buffer
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] BuffersBuffer.create/0
[CLASS-MEMBERS] CompositeBuffer newBuffer(MemoryManager memoryManager); CompositeBuffer newBuffer... | /* static context
[FOCAL] public static CompositeBuffer CompositeBuffer.newBuffer()
[CALLS-EXTERNAL] BuffersBuffer.create/0
*/
| /* static context
[FOCAL] public static CompositeBuffer CompositeBuffer.newBuffer()
[CALLS-EXTERNAL] BuffersBuffer.create/0
*/
class CompositeBuffer implements Buffer {
public static CompositeBuffer newBuffer() {
return BuffersBuffer.create();
}
public static CompositeBuffer newBuffer(final Memory... | true | ok | {"focal": {"class": "CompositeBuffer", "name": "newBuffer", "signature": "CompositeBuffer newBuffer()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "CompositeBuffer"}, "class_info": {"name": "CompositeBuffer", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Buffer", ... |
120761297_9 | class UserMapper implements Function<UserRaw, User> {
@Override
public User apply(UserRaw userRaw) {
return User.builder()
.login(notNullOrEmpty(userRaw.login()))
.id(userRaw.id())
.avatarUrl(notNullOrEmpty(userRaw.avatarUrl()))
.url(notNu... | UserRaw userRaw = UserDataTestUtils.userRawTestBuilder()
.starredUrl("www.google.com")
.build();
User user = userMapper.apply(userRaw);
assertThat(user.starredUrl()).isEqualTo("www.google.com");
}
} | [FOCAL] @Override public User UserMapper.apply(UserRaw userRaw)
[CLASS] class UserMapper implements Function<UserRaw, User>
[METRICS] loc=17 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] User.builder() .login(notNullOrEmpty(userRaw.login())) .i....build/0, User.builder() .login(notNullOrEmpty(us... | /* static context
[FOCAL] @Override public User UserMapper.apply(UserRaw userRaw)
[INPUTS] branches=- | result=userRaw
[COLLABORATORS] param userRaw:UserRaw login/0,id/0,avatarUrl/0,url/0,htmlUrl/0,followersUrl/0
[CALLS-EXTERNAL] User.builder() .login(notNullOrEmpty(userRaw.login())) .i....build/0, User.builder() .logi... | /* static context
[FOCAL] @Override public User UserMapper.apply(UserRaw userRaw)
[INPUTS] branches=- | result=userRaw
[COLLABORATORS] param userRaw:UserRaw login/0,id/0,avatarUrl/0,url/0,htmlUrl/0,followersUrl/0
[CALLS-EXTERNAL] User.builder() .login(notNullOrEmpty(userRaw.login())) .i....build/0, User.builder() .logi... | true | ok | {"focal": {"class": "UserMapper", "name": "apply", "signature": "User apply(UserRaw userRaw)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "userRaw", "type": "UserRaw"}], "return_type": "User"}, "class_info": {"name": "UserMapper", "kind": "class", "modifiers": "", "superclass": null, "interfa... |
120778005_2 | class LiveDataResponseBodyConverterFactory extends Converter.Factory {
@Nullable
@Override
public Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations,
Retrofit retrofit) {
if (type instanceof ParameterizedT... | Type responseType = new TypeToken<String>() {}.getType();
Converter<ResponseBody, ?> converter = factory
.responseBodyConverter(responseType, NO_ANNOTATIONS, retrofit);
assertThat(converter).isInstanceOf(StringConverterFactory.StringResponseBodyConverter.class);
}
} | [FOCAL] @Nullable @Override public Converter<ResponseBody, ?> LiveDataResponseBodyConverterFactory.responseBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit)
[CLASS] class LiveDataResponseBodyConverterFactory extends Converter.Factory
[METRICS] loc=20 cc=5 branches=4 loops=0 returns=2 throws=0 nestin... | /* static context
[FOCAL] @Nullable @Override public Converter<ResponseBody, ?> LiveDataResponseBodyConverterFactory.responseBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit)
[PATH1] if(type instanceof ParameterizedType)=T -> if(parameterizedType.getRawType() == Response.class)=T -> if(subType insta... | /* static context
[FOCAL] @Nullable @Override public Converter<ResponseBody, ?> LiveDataResponseBodyConverterFactory.responseBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit)
[PATH1] if(type instanceof ParameterizedType)=T -> if(parameterizedType.getRawType() == Response.class)=T -> if(subType insta... | true | ok | {"focal": {"class": "LiveDataResponseBodyConverterFactory", "name": "responseBodyConverter", "signature": "Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit)", "start_line": 3, "modifiers": "@Nullable @Override public", "params": [{"name": "type", "type": "Type"}, {... |
120780458_0 | class Library {
public Collection<Book> getFirstAvailableBooks(final String keyword) {
return new GetFirstAvailableBooks(emf, keyword).transact();
}
public static final Library library();
public synchronized Library init(KieContext kcontext);
synchronized Library init();
public Loan at... | final Collection<Book> books = LIBRARY.getFirstAvailableBooks("Time Machine");
assertThat(books, is(not(emptyCollectionOf(Book.class))));
}
} | [FOCAL] public Collection<Book> Library.getFirstAvailableBooks(String keyword)
[CLASS] class Library
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] new GetFirstAvailableBooks(emf, keyword).transact/0
[NEW] GetFirstAvailableBooks
[INPUTS] branches=- | result=keyword
[DATAFLOW] keyw... | /* static context
[FOCAL] public Collection<Book> Library.getFirstAvailableBooks(String keyword)
[INPUTS] branches=- | result=keyword
[NEW] GetFirstAvailableBooks
[CALLS-EXTERNAL] new GetFirstAvailableBooks(emf, keyword).transact/0
*/
| /* static context
[FOCAL] public Collection<Book> Library.getFirstAvailableBooks(String keyword)
[INPUTS] branches=- | result=keyword
[NEW] GetFirstAvailableBooks
[CALLS-EXTERNAL] new GetFirstAvailableBooks(emf, keyword).transact/0
*/
class Library {
public Collection<Book> getFirstAvailableBooks(final String keyw... | true | ok | {"focal": {"class": "Library", "name": "getFirstAvailableBooks", "signature": "Collection<Book> getFirstAvailableBooks(String keyword)", "start_line": 3, "modifiers": "public", "params": [{"name": "keyword", "type": "String"}], "return_type": "Collection<Book>"}, "class_info": {"name": "Library", "kind": "class", "modi... |
120905144_6 | class ProcFSUtils {
protected static List<ProcSmaps> parseSmaps(String output) {
String[] lines = output.split("\n");
List<ProcSmaps> res = new ArrayList<>();
ProcSmaps.Builder builder = null;
for (String line : lines) {
line = line.trim();
Matcher address ... | String output = "7f1ada0ca000-7f1ada19c000 rw-p 00000000 00:00 0 \n" +
"Size: 840 kB\n" +
"Rss: 836 kB\n" +
"Pss: 836 kB\n" +
"Shared_Clean: 0 kB\n" +
"Shared_Dirty: 0... | [FOCAL] protected static List<ProcSmaps> ProcFSUtils.parseSmaps(String output)
[CLASS] class ProcFSUtils
[METRICS] loc=74 cc=17 branches=6 loops=1 returns=1 throws=0 nesting=3
[CALLS-EXTERNAL] String.split/1, String.trim/0, ADDRESS_PATTERN.matcher/1, Matcher.find/0, address.group(4).trim/0, Matcher.group/1, List<ProcSm... | /* static context
[FOCAL] protected static List<ProcSmaps> ProcFSUtils.parseSmaps(String output)
[PATH1] foreach(String line : lines)=T -> if(address.find())=F -> if(memInfo.find())=T -> if(builder == null || info == null)=F -> switch(info)=case SIZE -> exit loop -> if(builder != null)#2=T -> return res
*/
| /* static context
[FOCAL] protected static List<ProcSmaps> ProcFSUtils.parseSmaps(String output)
[PATH1] foreach(String line : lines)=T -> if(address.find())=F -> if(memInfo.find())=T -> if(builder == null || info == null)=F -> switch(info)=case SIZE -> exit loop -> if(builder != null)#2=T -> return res
*/
class ProcFS... | true | ok | {"focal": {"class": "ProcFSUtils", "name": "parseSmaps", "signature": "List<ProcSmaps> parseSmaps(String output)", "start_line": 3, "modifiers": "protected static", "params": [{"name": "output", "type": "String"}], "return_type": "List<ProcSmaps>"}, "class_info": {"name": "ProcFSUtils", "kind": "class", "modifiers": ""... |
120961330_12 | class Resources {
public static Set<String> getResourceReferences(Collection<? extends Message> resources) {
final ImmutableSet.Builder<String> refs = ImmutableSet.builder();
for (Message r : resources) {
if (r instanceof ClusterLoadAssignment || r instanceof RouteConfiguration) {
// Endpoints... | String clusterServiceName = "clusterWithServiceName0";
io.envoyproxy.envoy.config.cluster.v3.Cluster clusterWithServiceName = io.envoyproxy.envoy.config.cluster.v3.Cluster
.newBuilder()
.setName(V3_CLUSTER_NAME)
.setEdsClusterConfig(
io.envoyproxy.envoy.config.cluster.v3.Clus... | [FOCAL] public static Set<String> Resources.getResourceReferences(Collection<? extends Message> resources)
[CLASS] class Resources
[METRICS] loc=106 cc=22 branches=14 loops=5 returns=1 throws=0 nesting=9
[CALLS-INTERNAL] String getResourceName(Message resource); void structAsMessage(Struct struct, Message.Builder messa... | class Resources {
public static Set<String> getResourceReferences(Collection<? extends Message> resources) {
final ImmutableSet.Builder<String> refs = ImmutableSet.builder();
for (Message r : resources) {
if (r instanceof ClusterLoadAssignment || r instanceof RouteConfiguration) {
// Endpoints... | false | ok | {"focal": {"class": "Resources", "name": "getResourceReferences", "signature": "Set<String> getResourceReferences(Collection<? extends Message> resources)", "start_line": 3, "modifiers": "public static", "params": [{"name": "resources", "type": "Collection<? extends Message>"}], "return_type": "Set<String>"}, "class_in... | |
120970441_39 | class BigQuerySchemaUtils {
public static Schema beamSchemaToBigQueryClientSchema(
org.apache.beam.sdk.schemas.Schema tableSchema) {
ArrayList<Field> bqFields = new ArrayList<>(tableSchema.getFieldCount());
for (org.apache.beam.sdk.schemas.Schema.Field f : tableSchema.getFields()) {
bqFields.add... | assertThat(BigQuerySchemaUtils.beamSchemaToBigQueryClientSchema(ALL_BEAM_SCHEMA),
is(ALL_BQ_SCHEMA));
}
} | [FOCAL] public static Schema BigQuerySchemaUtils.beamSchemaToBigQueryClientSchema(org.apache.beam.sdk.schemas.Schema tableSchema)
[CLASS] class BigQuerySchemaUtils
[METRICS] loc=9 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] Field beamFieldToBigQueryClientField(org.apache.beam.sdk.schemas.Schem... | /* static context
[FOCAL] public static Schema BigQuerySchemaUtils.beamSchemaToBigQueryClientSchema(org.apache.beam.sdk.schemas.Schema tableSchema)
[PATH1] foreach(org.apache.beam.sdk.schemas.Schema.Field f : tableSchema.getFields())=T -> exit loop -> return Schema.of(bqFields)
[PATH2] foreach(org.apache.beam.sdk.schem... | /* static context
[FOCAL] public static Schema BigQuerySchemaUtils.beamSchemaToBigQueryClientSchema(org.apache.beam.sdk.schemas.Schema tableSchema)
[PATH1] foreach(org.apache.beam.sdk.schemas.Schema.Field f : tableSchema.getFields())=T -> exit loop -> return Schema.of(bqFields)
[PATH2] foreach(org.apache.beam.sdk.schem... | true | ok | {"focal": {"class": "BigQuerySchemaUtils", "name": "beamSchemaToBigQueryClientSchema", "signature": "Schema beamSchemaToBigQueryClientSchema(org.apache.beam.sdk.schemas.Schema tableSchema)", "start_line": 3, "modifiers": "public static", "params": [{"name": "tableSchema", "type": "org.apache.beam.sdk.schemas.Schema"}],... |
121075789_4 | class App {
public String greet(String name) {
return Util.join("Hello ", name);
}
public boolean store(String name);
}
class AppTest {
@Test
public void testGreet() {
| App app = new App();
assertEquals(app.greet("world"), "Hello world");
}
} | [FOCAL] public String App.greet(String name)
[CLASS] class App
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Util.join/2
[INPUTS] branches=- | result=name
[DATAFLOW] name@param->L2
[CLASS-MEMBERS] boolean store(String name)
[TEST] AppTest: @Test public void testGreet() | /* static context
[FOCAL] public String App.greet(String name)
[INPUTS] branches=- | result=name
[CALLS-EXTERNAL] Util.join/2
*/
| /* static context
[FOCAL] public String App.greet(String name)
[INPUTS] branches=- | result=name
[CALLS-EXTERNAL] Util.join/2
*/
class App {
public String greet(String name) {
return Util.join("Hello ", name);
}
public boolean store(String name);
}
class AppTest {
@Test
public void test... | true | ok | {"focal": {"class": "App", "name": "greet", "signature": "String greet(String name)", "start_line": 3, "modifiers": "public", "params": [{"name": "name", "type": "String"}], "return_type": "String"}, "class_info": {"name": "App", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "m... |
121110666_1 | class CalendarUtil {
public static List<Date> getMonthDates(int year, int month) {
// long curTime = System.currentTimeMillis();
LocalDate localDate = new LocalDate(year, month, 1);
List<Date> dates = new ArrayList<>();
while (localDate.getMonthOfYear() <= month && localDate.getYear(... | List<Date> dates = CalendarUtil.getMonthDates(2018, 7);
assertEquals(42, dates.size());
}
} | [FOCAL] public static List<Date> CalendarUtil.getMonthDates(int year, int month)
[CLASS] class CalendarUtil
[METRICS] loc=10 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] List<Date> getWeekDates(int year, int month, int day)
[CALLS-EXTERNAL] LocalDate.getMonthOfYear/0, LocalDate.getYear/0, List<... | /* static context
[FOCAL] public static List<Date> CalendarUtil.getMonthDates(int year, int month)
[PATH1] while(localDate.getMonthOfYear() <= month && localDate.getYear() == year)=T -> exit loop -> return dates
[PATH2] while(localDate.getMonthOfYear() <= month && localDate.getYear() == year)=F -> return dates
[INPUTS]... | /* static context
[FOCAL] public static List<Date> CalendarUtil.getMonthDates(int year, int month)
[PATH1] while(localDate.getMonthOfYear() <= month && localDate.getYear() == year)=T -> exit loop -> return dates
[PATH2] while(localDate.getMonthOfYear() <= month && localDate.getYear() == year)=F -> return dates
[INPUTS]... | true | ok | {"focal": {"class": "CalendarUtil", "name": "getMonthDates", "signature": "List<Date> getMonthDates(int year, int month)", "start_line": 3, "modifiers": "public static", "params": [{"name": "year", "type": "int"}, {"name": "month", "type": "int"}], "return_type": "List<Date>"}, "class_info": {"name": "CalendarUtil", "k... |
121151622_4 | class ExpandableList extends Node implements List<INode> {
protected boolean isChild(INode node) {
INode parent = node.getParent();
while (parent != null) {
if (parent == this) {
return true;
}
parent = parent.getParent();
}
return... | INode node1 = new Node();
INode node2 = new Node();
node1.insert(node2);
Node node3 = new Node();
node2.insert(node3);
ExpandableList list = new ExpandableList();
assertFalse(list.isChild(node3));
list.insert(node1);
assertTrue(list.isChild(node3))... | [FOCAL] protected boolean ExpandableList.isChild(INode node)
[CLASS] class ExpandableList extends Node implements List<INode>
[METRICS] loc=10 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] INode.getParent/0
[PATH1] while(parent != null)=T -> if(parent == this)=F -> exit loop -> return false
[PAT... | /* static context
[FOCAL] protected boolean ExpandableList.isChild(INode node)
[PATH1] while(parent != null)=T -> if(parent == this)=F -> exit loop -> return false
[PATH2] while(parent != null)=T -> if(parent == this)=T -> return true
[PATH3] while(parent != null)=F -> return false
[INPUTS] branches=node | result=-
[CO... | /* static context
[FOCAL] protected boolean ExpandableList.isChild(INode node)
[PATH1] while(parent != null)=T -> if(parent == this)=F -> exit loop -> return false
[PATH2] while(parent != null)=T -> if(parent == this)=T -> return true
[PATH3] while(parent != null)=F -> return false
[INPUTS] branches=node | result=-
[CO... | true | ok | {"focal": {"class": "ExpandableList", "name": "isChild", "signature": "boolean isChild(INode node)", "start_line": 3, "modifiers": "protected", "params": [{"name": "node", "type": "INode"}], "return_type": "boolean"}, "class_info": {"name": "ExpandableList", "kind": "class", "modifiers": "", "superclass": "Node", "inte... |
121153885_0 | class McuMgrResponse {
public static int getExpectedLength(@NotNull McuMgrScheme scheme, @NotNull byte[] bytes)
throws IOException {
if (scheme.isCoap()) {
throw new UnsupportedOperationException("Method not implemented for CoAP");
} else {
if (bytes.length < Mcu... | final byte[] data = {(byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x79, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x00,
(byte) 0xBF, (byte) 0x66, (byte) 0x69, (byte) 0x6D, (byte) 0x61, (byte) 0x67, (byte) 0x65, (byte) 0x73, (byte) 0x9F,
(byte) 0xBF, (byte) 0x64, (byte) 0x73,... | [FOCAL] public static int McuMgrResponse.getExpectedLength(McuMgrScheme scheme, byte[] bytes)
[CLASS] class McuMgrResponse
[METRICS] loc=13 cc=3 branches=2 loops=0 returns=1 throws=2 nesting=2
[CALLS-EXTERNAL] McuMgrScheme.isCoap/0, Arrays.copyOf/2, McuMgrHeader.fromBytes/1, McuMgrHeader.getLen/0
[NEW] UnsupportedOpera... | /* static context
[FOCAL] public static int McuMgrResponse.getExpectedLength(McuMgrScheme scheme, byte[] bytes)
[THROWS-WHEN] UnsupportedOperationException when scheme.isCoap()
[THROWS-WHEN] IOException when !scheme.isCoap() && bytes.length < McuMgrHeader.HEADER_LENGTH
[PATH1] if(scheme.isCoap())=F -> if(bytes.length <... | /* static context
[FOCAL] public static int McuMgrResponse.getExpectedLength(McuMgrScheme scheme, byte[] bytes)
[THROWS-WHEN] UnsupportedOperationException when scheme.isCoap()
[THROWS-WHEN] IOException when !scheme.isCoap() && bytes.length < McuMgrHeader.HEADER_LENGTH
[PATH1] if(scheme.isCoap())=F -> if(bytes.length <... | true | ok | {"focal": {"class": "McuMgrResponse", "name": "getExpectedLength", "signature": "int getExpectedLength(McuMgrScheme scheme, byte[] bytes) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "scheme", "type": "McuMgrScheme"}, {"name": "bytes", "type": "byte[]"}], "return_type": "int"}... |
121218280_1 | class QRTone {
public static double computeRms(float[] signal) {
double sum = 0;
for (double aSignal : signal) {
sum += aSignal * aSignal;
}
return Math.sqrt(sum / signal.length);
}
public QRTone(Configuration configuration);
public int getMaximumWindowLen... | double sampleRate = 44100;
double powerRMS = Math.pow(10, -26.0 / 20.0); // -26 dBFS
float signalFrequency = 1000;
double powerPeak = powerRMS * Math.sqrt(2);
float[] audio = new float[4410];
for (int s = 0; s < audio.length; s++) {
double t = s * (1 / sample... | [FOCAL] public static double QRTone.computeRms(float[] signal)
[CLASS] class QRTone
[METRICS] loc=7 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] Math.sqrt/1
[PATH1] foreach(double aSignal : signal)=T -> exit loop -> return Math.sqrt(sum / signal.length)
[PATH2] foreach(double aSignal : signal)=... | /* static context
[FOCAL] public static double QRTone.computeRms(float[] signal)
[PATH1] foreach(double aSignal : signal)=T -> exit loop -> return Math.sqrt(sum / signal.length)
[PATH2] foreach(double aSignal : signal)=F -> return Math.sqrt(sum / signal.length)
[INPUTS] branches=signal | result=signal
[CALLS-EXTERNAL] ... | /* static context
[FOCAL] public static double QRTone.computeRms(float[] signal)
[PATH1] foreach(double aSignal : signal)=T -> exit loop -> return Math.sqrt(sum / signal.length)
[PATH2] foreach(double aSignal : signal)=F -> return Math.sqrt(sum / signal.length)
[INPUTS] branches=signal | result=signal
[CALLS-EXTERNAL] ... | true | ok | {"focal": {"class": "QRTone", "name": "computeRms", "signature": "double computeRms(float[] signal)", "start_line": 3, "modifiers": "public static", "params": [{"name": "signal", "type": "float[]"}], "return_type": "double"}, "class_info": {"name": "QRTone", "kind": "class", "modifiers": "", "superclass": null, "interf... |
121236494_125 | class WildcardMatcher {
public abstract boolean matches(CharSequence s)public abstract boolean matches(CharSequence s);
public abstract boolean matches(CharSequence s)public static WildcardMatcher caseSensitiveMatcher(String matcher);
public abstract boolean matches(CharSequence s)public static WildcardMatcher matchA... | final WildcardMatcher matcher = buildMatcher("*foo*");
assertSoftly(softly -> {
// no allocations necessary
softly.assertThat(matcher.matches("foo", "BAR")).isTrue();
softly.assertThat(matcher.matches("BAR", "foo")).isTrue();
softly.assertThat(matcher.matc... | [FOCAL] public abstract boolean WildcardMatcher.matches(CharSequence s)
[CLASS] class WildcardMatcher
[METRICS] loc=1 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CLASS-MEMBERS] WildcardMatcher caseSensitiveMatcher(String matcher); WildcardMatcher matchAll(); List<WildcardMatcher> matchAllList(); WildcardMatch... | /* static context
[FOCAL] public abstract boolean WildcardMatcher.matches(CharSequence s)
*/
| /* static context
[FOCAL] public abstract boolean WildcardMatcher.matches(CharSequence s)
*/
class WildcardMatcher {
public abstract boolean matches(CharSequence s)public abstract boolean matches(CharSequence s);
public abstract boolean matches(CharSequence s)public static WildcardMatcher caseSensitiveMatcher(String ... | true | partial | {"focal": {"class": "WildcardMatcher", "name": "matches", "signature": "boolean matches(CharSequence s)", "start_line": 3, "modifiers": "public abstract", "params": [{"name": "s", "type": "CharSequence"}], "return_type": "boolean"}, "class_info": {"name": "WildcardMatcher", "kind": "class", "modifiers": "", "superclass... |
121247108_26 | class QuickSort {
public static List<Integer> sort(List<Integer> sourceDatas) {
switch (sourceDatas.size()) {
case 0: // Base Case
return new ArrayList<>();
case 1: // Base Case
return sourceDatas;
default:
int pivot = sour... | int[] array = { 3, 2, 4, 1 };
QuickSort.sort(array, 0, array.length - 1);
assertThat(array, equalTo(new int[] { 1, 2, 3, 4 }));
}
} | [FOCAL] public static List<Integer> QuickSort.sort(List<Integer> sourceDatas)
[CLASS] class QuickSort
[METRICS] loc=32 cc=5 branches=2 loops=1 returns=3 throws=0 nesting=3
[CALLS-INTERNAL] void sort(int[] sourceDatas, int from, int to)
[CALLS-EXTERNAL] List<Integer>.size/0, List<Integer>.get/1, List<Integer>.add/1, Lis... | /* static context
[FOCAL] public static List<Integer> QuickSort.sort(List<Integer> sourceDatas)
[PATH1] switch(sourceDatas.size())=default -> for(i < sourceDatas.size())=T -> if(pivot > sourceDatas.get(i))=T -> exit loop -> return smallerDatas
[PATH2] switch(sourceDatas.size())=case 0 -> return new ArrayList<>()
[PATH3... | /* static context
[FOCAL] public static List<Integer> QuickSort.sort(List<Integer> sourceDatas)
[PATH1] switch(sourceDatas.size())=default -> for(i < sourceDatas.size())=T -> if(pivot > sourceDatas.get(i))=T -> exit loop -> return smallerDatas
[PATH2] switch(sourceDatas.size())=case 0 -> return new ArrayList<>()
[PATH3... | true | ok | {"focal": {"class": "QuickSort", "name": "sort", "signature": "List<Integer> sort(List<Integer> sourceDatas)", "start_line": 3, "modifiers": "public static", "params": [{"name": "sourceDatas", "type": "List<Integer>"}], "return_type": "List<Integer>"}, "class_info": {"name": "QuickSort", "kind": "class", "modifiers": "... |
121312281_8 | class WebConfigurer implements ServletContextInitializer, WebServerFactoryCustomizer<WebServerFactory> {
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
if (env.getActiveProfiles().length != 0) {
log.info("Web application configuration, using profile... | env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION);
webConfigurer.onStartup(servletContext);
assertThat(servletContext.getAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE)).isEqualTo(metricRegistry);
assertThat(servletContext.getAttribute(MetricsServlet.METRICS_REGISTRY))... | [FOCAL] @Override public void WebConfigurer.onStartup(ServletContext servletContext)
[CLASS] class WebConfigurer implements ServletContextInitializer, WebServerFactoryCustomizer<WebServerFactory>
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] void initMetrics(ServletContext servle... | /* static context
[FOCAL] @Override public void WebConfigurer.onStartup(ServletContext servletContext)
[PATH1] if(env.getActiveProfiles().length != 0)=T
[PATH2] if(env.getActiveProfiles().length != 0)=F
[INPUTS] branches=env | result=-
[COLLABORATORS] field env:MockEnvironment getActiveProfiles/0
[EXCEPTIONS] declares ... | /* static context
[FOCAL] @Override public void WebConfigurer.onStartup(ServletContext servletContext)
[PATH1] if(env.getActiveProfiles().length != 0)=T
[PATH2] if(env.getActiveProfiles().length != 0)=F
[INPUTS] branches=env | result=-
[COLLABORATORS] field env:MockEnvironment getActiveProfiles/0
[EXCEPTIONS] declares ... | true | ok | {"focal": {"class": "WebConfigurer", "name": "onStartup", "signature": "void onStartup(ServletContext servletContext) throws ServletException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "servletContext", "type": "ServletContext"}], "return_type": "void"}, "class_info": {"name": "WebConfigure... |
121320887_3 | class CursorPoint {
public CursorPoint getCursorPointScaledBy(double scaleFactor) {
return (new CursorPoint((int) (this.x * scaleFactor), (int) (this.y * scaleFactor), (int) (delay * scaleFactor)));
}
public CursorPoint(int x, int y, int delay);
public double getDistanceFromOrigin();
public double getThetaFr... | CursorPoint a = new CursorPoint(0, 0, 0);
CursorPoint b = new CursorPoint(100, 0, 0);
CursorPoint c = new CursorPoint(100, 200, 0);
CursorPoint d = new CursorPoint(-400, -300, 0);
CursorPoint e = a.getCursorPointScaledBy(1.1);
CursorPoint f = b.getCursorPointScaledBy(0.95);
CursorPoint g = c.getCursorPoin... | [FOCAL] public CursorPoint CursorPoint.getCursorPointScaledBy(double scaleFactor)
[CLASS] class CursorPoint
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] CursorPoint
[FIELDS] read=x, y
[INPUTS] branches=- | result=scaleFactor
[DATAFLOW] scaleFactor@param->L2
[CLASS-MEMBERS] CursorPoint(int ... | /* static context
[FOCAL] public CursorPoint CursorPoint.getCursorPointScaledBy(double scaleFactor)
[INPUTS] branches=- | result=scaleFactor
[FIELDS] read=x, y
[NEW] CursorPoint
*/
| /* static context
[FOCAL] public CursorPoint CursorPoint.getCursorPointScaledBy(double scaleFactor)
[INPUTS] branches=- | result=scaleFactor
[FIELDS] read=x, y
[NEW] CursorPoint
*/
class CursorPoint {
public CursorPoint getCursorPointScaledBy(double scaleFactor) {
return (new CursorPoint((int) (this.x * scaleFactor... | true | ok | {"focal": {"class": "CursorPoint", "name": "getCursorPointScaledBy", "signature": "CursorPoint getCursorPointScaledBy(double scaleFactor)", "start_line": 3, "modifiers": "public", "params": [{"name": "scaleFactor", "type": "double"}], "return_type": "CursorPoint"}, "class_info": {"name": "CursorPoint", "kind": "class",... |
121349361_3 | class HelloHandler implements RequestHandler<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent> {
@Override
public APIGatewayProxyResponseEvent handleRequest(APIGatewayProxyRequestEvent request, Context context) {
String who = "World";
if ( request.getPathParameters() != null ) {
String name ... | input.withPathParamters(Collections.emptyMap());
APIGatewayProxyResponseEvent res = handler.handleRequest(input, null);
assertNotNull(res);
assertEquals("Hello World!", res.getBody());
}
} | [FOCAL] @Override public APIGatewayProxyResponseEvent HelloHandler.handleRequest(APIGatewayProxyRequestEvent request, Context context)
[CLASS] class HelloHandler implements RequestHandler<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent>
[METRICS] loc=11 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=2
[CA... | /* static context
[FOCAL] @Override public APIGatewayProxyResponseEvent HelloHandler.handleRequest(APIGatewayProxyRequestEvent request, Context context)
[PATH1] if(request.getPathParameters() != null)=T -> if(name != null && !"".equals(name.trim()))=T -> return new APIGatewayProxyResponseEvent().withStatusCode(HttpURLC... | /* static context
[FOCAL] @Override public APIGatewayProxyResponseEvent HelloHandler.handleRequest(APIGatewayProxyRequestEvent request, Context context)
[PATH1] if(request.getPathParameters() != null)=T -> if(name != null && !"".equals(name.trim()))=T -> return new APIGatewayProxyResponseEvent().withStatusCode(HttpURLC... | true | ok | {"focal": {"class": "HelloHandler", "name": "handleRequest", "signature": "APIGatewayProxyResponseEvent handleRequest(APIGatewayProxyRequestEvent request, Context context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "APIGatewayProxyRequestEvent"}, {"name": "context", "type... |
121391917_16 | class JsonSchemaPreProcessor implements RecordPreProcessor {
@Override
public CompletionStage<Envelope> preProcess(Envelope envelope) {
try {
var rawValue = envelope.getRawValue();
final JsonNode event;
final String eventType;
if (rawValue instanceof Clo... | var processor = getProcessor();
assertThatThrownBy(() -> preProcess(processor, (String) null))
.hasMessageContaining("/eventType is null");
}
} | [FOCAL] @Override public CompletionStage<Envelope> JsonSchemaPreProcessor.preProcess(Envelope envelope)
[CLASS] class JsonSchemaPreProcessor implements RecordPreProcessor
[METRICS] loc=77 cc=11 branches=9 loops=0 returns=7 throws=0 nesting=6
[CALLS-INTERNAL] Set<ValidationMessage> validate(String eventType, JsonNode ev... | /* static context
[FOCAL] @Override public CompletionStage<Envelope> JsonSchemaPreProcessor.preProcess(Envelope envelope)
[PATH1] if(rawValue instanceof CloudEvent)=T -> if(mediaType == null)=F -> if(!mediaType.isCompatibleWith(MediaType.APPLICATION_JSON))=F -> if(data instanceof JsonNode)=F -> if(data instanceof byte[... | /* static context
[FOCAL] @Override public CompletionStage<Envelope> JsonSchemaPreProcessor.preProcess(Envelope envelope)
[PATH1] if(rawValue instanceof CloudEvent)=T -> if(mediaType == null)=F -> if(!mediaType.isCompatibleWith(MediaType.APPLICATION_JSON))=F -> if(data instanceof JsonNode)=F -> if(data instanceof byte[... | true | ok | {"focal": {"class": "JsonSchemaPreProcessor", "name": "preProcess", "signature": "CompletionStage<Envelope> preProcess(Envelope envelope)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "envelope", "type": "Envelope"}], "return_type": "CompletionStage<Envelope>"}, "class_info": {"name": "JsonSch... |
121405227_0 | class FixLengthDecoder extends ByteToMessageDecoder {
@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
while (in.readableBytes() >= length){
ByteBuf byt = in.readBytes(length) ;
out.add(byt) ;
}
}
publ... |
ByteBuf buf = Unpooled.buffer();
for (int i = 0; i < 9; i++) {
buf.writeByte(i);
}
ByteBuf duplicate = buf.duplicate();
EmbeddedChannel channel = new EmbeddedChannel(new FixLengthDecoder(3));
channel.writeInbound(buf.retain());
channel.finish();
... | [FOCAL] @Override protected void FixLengthDecoder.decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out)
[CLASS] class FixLengthDecoder extends ByteToMessageDecoder
[METRICS] loc=9 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] ByteBuf.readableBytes/0, ByteBuf.readBytes/1, List<Object>.a... | /* static context
[FOCAL] @Override protected void FixLengthDecoder.decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out)
[PATH1] while(in.readableBytes() >= length)=T -> exit loop
[PATH2] while(in.readableBytes() >= length)=F
[INPUTS] branches=in | result=- | unused=ctx
[COLLABORATORS] param in:ByteBuf reada... | /* static context
[FOCAL] @Override protected void FixLengthDecoder.decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out)
[PATH1] while(in.readableBytes() >= length)=T -> exit loop
[PATH2] while(in.readableBytes() >= length)=F
[INPUTS] branches=in | result=- | unused=ctx
[COLLABORATORS] param in:ByteBuf reada... | true | ok | {"focal": {"class": "FixLengthDecoder", "name": "decode", "signature": "void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "ctx", "type": "ChannelHandlerContext"}, {"name": "in", "type": "ByteBuf"}, {"name": "o... |
121473558_6 | class VertexMetadata {
public Iterable<String> toIterable(CSVRecord record) {
return () -> new Iterator<String>() {
int index = 0;
@Override
public boolean hasNext() {
return index <= lastColumnIndex;
}
@Override
publ... | String columnHeaders = "\"_id\",\"_labels\",\"address\",\"name\",\"index\",\"txid\",\"_start\",\"_end\",\"_type\",\"strength\",\"timestamp\"";
VertexMetadata vertexMetadata = createVertexMetadata(columnHeaders);
CSVRecord record = CSVUtils.firstRecord("\"1\",\":Person\",\"address\",\"name\",\"1... | [FOCAL] public Iterable<String> VertexMetadata.toIterable(CSVRecord record)
[CLASS] class VertexMetadata
[METRICS] loc=29 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] headers.get/1, Header.equals/1, Arrays.stream(record.get(index++).split(":")) .filter(s -....collect/1, Arrays.stream(record.get... | /* static context
[FOCAL] public Iterable<String> VertexMetadata.toIterable(CSVRecord record)
[INPUTS] branches=- | result=record
[COLLABORATORS] field headers get/1; param record:CSVRecord get/1; field s isEmpty/0; field propertyValueParser parse/1
[NEW] Iterator<String>
[CALLS-EXTERNAL] headers.get/1, Header.equals/1... | /* static context
[FOCAL] public Iterable<String> VertexMetadata.toIterable(CSVRecord record)
[INPUTS] branches=- | result=record
[COLLABORATORS] field headers get/1; param record:CSVRecord get/1; field s isEmpty/0; field propertyValueParser parse/1
[NEW] Iterator<String>
[CALLS-EXTERNAL] headers.get/1, Header.equals/1... | true | ok | {"focal": {"class": "VertexMetadata", "name": "toIterable", "signature": "Iterable<String> toIterable(CSVRecord record)", "start_line": 3, "modifiers": "public", "params": [{"name": "record", "type": "CSVRecord"}], "return_type": "Iterable<String>"}, "class_info": {"name": "VertexMetadata", "kind": "class", "modifiers"... |
121514433_0 | class MethodRemovalRule implements ComparingValidationRule {
@Override
public void methodRemoved(final ValidationContext ctx, final MethodDescriptor current) {
// TODO(staffan): Take things like lifecycle into account here. Removing methods from a GA
// service is a no-no but removing it from a experimenta... | final DescriptorSet current = DescriptorSetUtils.buildDescriptorSet(
"a.proto",
"syntax = 'proto3';\n"
+ "service Derp {\n"
+ " rpc GetDerp (HerpDerp) returns (HerpDerp);\n"
+ "}\n"
+ "message HerpDerp {}"
);
final DescriptorSet candidate = DescriptorSetUtils... | [FOCAL] @Override public void MethodRemovalRule.methodRemoved(ValidationContext ctx, MethodDescriptor current)
[CLASS] class MethodRemovalRule implements ComparingValidationRule
[METRICS] loc=13 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] current.options().getDeprecated/0, MethodDescriptor.opt... | /* static context
[FOCAL] @Override public void MethodRemovalRule.methodRemoved(ValidationContext ctx, MethodDescriptor current)
[PATH1] if(!current.options().getDeprecated())=T
[PATH2] if(!current.options().getDeprecated())=F
[INPUTS] branches=current | result=-
[COLLABORATORS] param current:MethodDescriptor options/0... | /* static context
[FOCAL] @Override public void MethodRemovalRule.methodRemoved(ValidationContext ctx, MethodDescriptor current)
[PATH1] if(!current.options().getDeprecated())=T
[PATH2] if(!current.options().getDeprecated())=F
[INPUTS] branches=current | result=-
[COLLABORATORS] param current:MethodDescriptor options/0... | true | ok | {"focal": {"class": "MethodRemovalRule", "name": "methodRemoved", "signature": "void methodRemoved(ValidationContext ctx, MethodDescriptor current)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "ctx", "type": "ValidationContext"}, {"name": "current", "type": "MethodDescriptor"}], "return_type"... |
121984024_10 | class DictionaryPresenter {
void search(String word) {
boolean isLatinAlphabet;
if (word.isEmpty()) {
return;
}
word = word.toLowerCase(Locale.ROOT);
if (SpellChecker.ALPHABET_LATIN.indexOf(word.charAt(0)) >= 0) {
isLatinAlphabet = true;
} ... | List<SozlikDbModel> list = new ArrayList<>();
list.add(new SozlikDbModel());
when(sozlikDaoMock.getTranslation(SOME_WORD)).thenReturn(null);
when(spellCheckerMock.check(SOME_WORD, true)).thenReturn(list);
dictionaryPresenter.search(SOME_WORD);
verify(dictionaryViewMock... | [FOCAL] void DictionaryPresenter.search(String word)
[CLASS] class DictionaryPresenter
[METRICS] loc=32 cc=6 branches=5 loops=0 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] String.isEmpty/0, String.toLowerCase/1, SpellChecker.ALPHABET_LATIN.indexOf/1, String.charAt/1, SpellChecker.ALPHABET_CYRILLIC.indexOf/1, dictiona... | /* static context
[FOCAL] void DictionaryPresenter.search(String word)
[PATH1] if(word.isEmpty())=F -> if(SpellChecker.ALPHABET_LATIN.indexOf(word.charAt(0)) >= 0)=F -> if(SpellChecker.ALPHABET_CYRILLIC.indexOf(word.charAt(0)) >= 0)=T -> if(result != null)=F -> if(word.length() >= WORD_MIN_LENGTH)=T
[PATH2] if(word.isE... | /* static context
[FOCAL] void DictionaryPresenter.search(String word)
[PATH1] if(word.isEmpty())=F -> if(SpellChecker.ALPHABET_LATIN.indexOf(word.charAt(0)) >= 0)=F -> if(SpellChecker.ALPHABET_CYRILLIC.indexOf(word.charAt(0)) >= 0)=T -> if(result != null)=F -> if(word.length() >= WORD_MIN_LENGTH)=T
[PATH2] if(word.isE... | true | ok | {"focal": {"class": "DictionaryPresenter", "name": "search", "signature": "void search(String word)", "start_line": 3, "modifiers": "", "params": [{"name": "word", "type": "String"}], "return_type": "void"}, "class_info": {"name": "DictionaryPresenter", "kind": "class", "modifiers": "", "superclass": null, "interfaces"... |
122105687_1 | class Manifest {
Optional<String> fetch(final String assetName) {
log.fine(() -> String.format("Fetching asset '%s'", assetName));
Optional<String> rv;
try {
final Map<String, String> values = getValues();
rv = Optional.ofNullable(values.get(assetName)).map(a -> a.r... | final Manifest manifest = new Manifest(objectMapper, new ClassPathResource("broken.json"));
assertThat(manifest.fetch("app.js")).isEmpty();
}
} | [FOCAL] Optional<String> Manifest.fetch(String assetName)
[CLASS] class Manifest
[METRICS] loc=18 cc=3 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] Map<String, String> getValues()
[CALLS-EXTERNAL] log.fine/1, String.format/2, Optional.ofNullable(values.get(assetName)).map/1, Optional.ofNullable/1, M... | /* static context
[FOCAL] Optional<String> Manifest.fetch(String assetName)
[PATH1] try-body throws -> if(!rv.isPresent())=T -> return rv
[PATH2] if(!rv.isPresent())=F -> return rv
[INPUTS] branches=assetName | result=assetName
[COLLABORATORS] field a replaceFirst/2
[EXCEPTIONS] catches IOException e
[CALLS-INTERNAL] M... | /* static context
[FOCAL] Optional<String> Manifest.fetch(String assetName)
[PATH1] try-body throws -> if(!rv.isPresent())=T -> return rv
[PATH2] if(!rv.isPresent())=F -> return rv
[INPUTS] branches=assetName | result=assetName
[COLLABORATORS] field a replaceFirst/2
[EXCEPTIONS] catches IOException e
[CALLS-INTERNAL] M... | true | ok | {"focal": {"class": "Manifest", "name": "fetch", "signature": "Optional<String> fetch(String assetName)", "start_line": 3, "modifiers": "", "params": [{"name": "assetName", "type": "String"}], "return_type": "Optional<String>"}, "class_info": {"name": "Manifest", "kind": "class", "modifiers": "", "superclass": null, "i... |
122146857_2 | class FeaturesConfigReader extends AbstractConfigReader {
public static FieldFeatureExtractorFactory loadFactory(FeaturesConfigReader.FeatureDesc featureDesc){
ClassLoader loader = Thread.currentThread().getContextClassLoader();
try {
Class<? extends FieldFeatureExtractorFactory> cls = (Class<? extends... | FeaturesConfigReader fcReader = new FeaturesConfigReader(loader,"ltr_features.conf");
assertEquals(FieldFeatureTFExtractorFactory.class, FeaturesConfigReader.loadFactory(fcReader.getFeatureDesc("TF in title")).getClass());
assertEquals(FieldFeatureTFExtractorFactory.class, FeaturesConfigReader.loadFactory(f... | [FOCAL] public static FieldFeatureExtractorFactory FeaturesConfigReader.loadFactory(FeaturesConfigReader.FeatureDesc featureDesc)
[CLASS] class FeaturesConfigReader extends AbstractConfigReader
[METRICS] loc=12 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] Thread.currentThread().getContextClassL... | /* static context
[FOCAL] public static FieldFeatureExtractorFactory FeaturesConfigReader.loadFactory(FeaturesConfigReader.FeatureDesc featureDesc)
[THROWS-WHEN] RuntimeException when try-body throws
[PATH1] try-body throws -> throw new RuntimeException(e)
[PATH2] return constructor.newInstance(featureDesc.name, featur... | /* static context
[FOCAL] public static FieldFeatureExtractorFactory FeaturesConfigReader.loadFactory(FeaturesConfigReader.FeatureDesc featureDesc)
[THROWS-WHEN] RuntimeException when try-body throws
[PATH1] try-body throws -> throw new RuntimeException(e)
[PATH2] return constructor.newInstance(featureDesc.name, featur... | true | ok | {"focal": {"class": "FeaturesConfigReader", "name": "loadFactory", "signature": "FieldFeatureExtractorFactory loadFactory(FeaturesConfigReader.FeatureDesc featureDesc)", "start_line": 3, "modifiers": "public static", "params": [{"name": "featureDesc", "type": "FeaturesConfigReader.FeatureDesc"}], "return_type": "FieldF... |
122194961_3 | class NarayanaConfiguration {
@Bean
@ConditionalOnMissingBean
public JtaTransactionManager transactionManager(UserTransaction userTransaction,
TransactionManager transactionManager,
TransactionSynchronizationRegistry transactionSynchronizationRegistry) {
JtaTransactionManage... | JtaTransactionManager jtaTransactionManager = this.configuration.transactionManager(
this.mockUserTransaction, this.mockTransactionManager, this.mockTransactionSynchronizationRegistry);
assertThat(jtaTransactionManager.getUserTransaction()).isEqualTo(this.mockUserTransaction);
as... | [FOCAL] @Bean @ConditionalOnMissingBean public JtaTransactionManager NarayanaConfiguration.transactionManager(UserTransaction userTransaction, TransactionManager transactionManager, TransactionSynchronizationRegistry transactionSynchronizationRegistry)
[CLASS] class NarayanaConfiguration
[METRICS] loc=12 cc=2 branches=... | /* static context
[FOCAL] @Bean @ConditionalOnMissingBean public JtaTransactionManager NarayanaConfiguration.transactionManager(UserTransaction userTransaction, TransactionManager transactionManager, TransactionSynchronizationRegistry transactionSynchronizationRegistry)
[PATH1] if(this.transactionManagerCustomizers != ... | /* static context
[FOCAL] @Bean @ConditionalOnMissingBean public JtaTransactionManager NarayanaConfiguration.transactionManager(UserTransaction userTransaction, TransactionManager transactionManager, TransactionSynchronizationRegistry transactionSynchronizationRegistry)
[PATH1] if(this.transactionManagerCustomizers != ... | true | ok | {"focal": {"class": "NarayanaConfiguration", "name": "transactionManager", "signature": "JtaTransactionManager transactionManager(UserTransaction userTransaction, TransactionManager transactionManager, TransactionSynchronizationRegistry transactionSynchronizationRegistry)", "start_line": 3, "modifiers": "@Bean @Conditi... |
122369264_51 | class ComposerProviderHandler implements Handler {
@Nonnull
@Override
public Response handle(@Nonnull final Context context) throws Exception {
Response response = context.proceed();
if (!Boolean.parseBoolean(context.getRequest().getAttributes().get(DO_NOT_REWRITE, String.class))) {
if (response.ge... | when(response.getPayload()).thenReturn(null);
Response output = underTest.handle(context);
assertThat(output, is(response));
verifyNoMoreInteractions(composerJsonProcessor);
}
} | [FOCAL] @Nonnull @Override public Response ComposerProviderHandler.handle(Context context)
[CLASS] class ComposerProviderHandler implements Handler
[METRICS] loc=12 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] Context.proceed/0, Boolean.parseBoolean/1, context.getRequest().getAttributes().get/2... | /* static context
[FOCAL] @Nonnull @Override public Response ComposerProviderHandler.handle(Context context)
[PATH1] if(!Boolean.parseBoolean(context.getRequest().getAttributes().get(DO_NOT_REWRITE, String.class)))=T -> if(response.getStatus().getCode() == HttpStatus.OK && response.getPayload() != null)=T -> return res... | /* static context
[FOCAL] @Nonnull @Override public Response ComposerProviderHandler.handle(Context context)
[PATH1] if(!Boolean.parseBoolean(context.getRequest().getAttributes().get(DO_NOT_REWRITE, String.class)))=T -> if(response.getStatus().getCode() == HttpStatus.OK && response.getPayload() != null)=T -> return res... | true | ok | {"focal": {"class": "ComposerProviderHandler", "name": "handle", "signature": "Response handle(Context context) throws Exception", "start_line": 3, "modifiers": "@Nonnull @Override public", "params": [{"name": "context", "type": "Context"}], "return_type": "Response"}, "class_info": {"name": "ComposerProviderHandler", ... |
122426223_23 | class TransactionApiImpl implements TransactionApi {
@Override
public List<String> getPendingTransactionList(String branchId) {
return branchGroup.getUnconfirmedTxs(BranchId.of(branchId))
.stream().map(tx -> tx.getHash().toString()).collect(Collectors.toList());
}
@Autowired pu... | assertThat(txApi.getPendingTransactionList(yggdrashBranch)).isNotNull();
}
} | [FOCAL] @Override public List<String> TransactionApiImpl.getPendingTransactionList(String branchId)
[CLASS] class TransactionApiImpl implements TransactionApi
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] branchGroup.getUnconfirmedTxs(BranchId.of(branchId)) .str....collect/1, bra... | /* static context
[FOCAL] @Override public List<String> TransactionApiImpl.getPendingTransactionList(String branchId)
[INPUTS] branches=- | result=branchId, branchGroup
[COLLABORATORS] field branchGroup:BranchGroup getUnconfirmedTxs/1; field tx getHash/0
[FIELDS] read=branchGroup:BranchGroup
[CALLS-EXTERNAL] branchGrou... | /* static context
[FOCAL] @Override public List<String> TransactionApiImpl.getPendingTransactionList(String branchId)
[INPUTS] branches=- | result=branchId, branchGroup
[COLLABORATORS] field branchGroup:BranchGroup getUnconfirmedTxs/1; field tx getHash/0
[FIELDS] read=branchGroup:BranchGroup
[CALLS-EXTERNAL] branchGrou... | true | ok | {"focal": {"class": "TransactionApiImpl", "name": "getPendingTransactionList", "signature": "List<String> getPendingTransactionList(String branchId)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "branchId", "type": "String"}], "return_type": "List<String>"}, "class_info": {"name": "Transaction... |
122426901_387 | class BlockchainConfig {
public void updateChain(Chain chain, int minPrunableLifetime, int maxPrunableLifetime) {
Objects.requireNonNull(chain, "Chain cannot be null");
setFields(chain, minPrunableLifetime, maxPrunableLifetime);
Map<Integer, BlockchainProperties> blockchainProperties = cha... | Chain emptyChain = new Chain(UUID.randomUUID(), new ArrayList<>(), "Empty", "Empty chain", "EMP", "EM", "EMP", "", List.of());
assertThrows(IllegalArgumentException.class, () -> blockchainConfig.updateChain(emptyChain));
}
} | [FOCAL] public void BlockchainConfig.updateChain(Chain chain, int minPrunableLifetime, int maxPrunableLifetime)
[CLASS] class BlockchainConfig
[METRICS] loc=16 cc=2 branches=1 loops=0 returns=0 throws=1 nesting=1
[CALLS-INTERNAL] void setFields(Chain chain, int minPrunableLifetime, int maxPrunableLifetime)
[CALLS-EXTER... | /* static context
[FOCAL] public void BlockchainConfig.updateChain(Chain chain, int minPrunableLifetime, int maxPrunableLifetime)
[THROWS-WHEN] IllegalArgumentException when blockchainProperties.isEmpty() || blockchainProperties.get(0) == null
[PATH1] if(blockchainProperties.isEmpty() || blockchainProperties.get(0) == ... | /* static context
[FOCAL] public void BlockchainConfig.updateChain(Chain chain, int minPrunableLifetime, int maxPrunableLifetime)
[THROWS-WHEN] IllegalArgumentException when blockchainProperties.isEmpty() || blockchainProperties.get(0) == null
[PATH1] if(blockchainProperties.isEmpty() || blockchainProperties.get(0) == ... | true | ok | {"focal": {"class": "BlockchainConfig", "name": "updateChain", "signature": "void updateChain(Chain chain, int minPrunableLifetime, int maxPrunableLifetime)", "start_line": 3, "modifiers": "public", "params": [{"name": "chain", "type": "Chain"}, {"name": "minPrunableLifetime", "type": "int"}, {"name": "maxPrunableLifet... |
122429896_1 | class AkkaEngineProvider implements ReactiveStreamsEngine {
public static AkkaEngine provider() {
AkkaEngine engine = null;
// Double checked locking to initialize the weak reference the first time this method
// is invoked.
if (cachedEngine == null) {
synchronized (mutex) {
if (cached... | AkkaEngine engine = AkkaEngineProvider.provider();
ActorSystem system = ((ActorMaterializer) engine.materializer).system();
Flow.Publisher<Done> publisher =
Source.tick(
Duration.create(100, TimeUnit.MILLISECONDS),
Duration.create(100, TimeUnit.MILLISECONDS),
Don... | [FOCAL] public static AkkaEngine AkkaEngineProvider.provider()
[CLASS] class AkkaEngineProvider implements ReactiveStreamsEngine
[METRICS] loc=32 cc=6 branches=5 loops=0 returns=1 throws=0 nesting=4
[CALLS-INTERNAL] AkkaEngine createEngine()
[CALLS-EXTERNAL] cachedEngine.get/0
[NEW] WeakReference<>
[PATH1] if(cachedEng... | /* static context
[FOCAL] public static AkkaEngine AkkaEngineProvider.provider()
[PATH1] if(cachedEngine == null)#1=T -> if(cachedEngine == null)#2=T -> if(engine == null)#1=T -> if(engine == null)#2=T -> if(engine == null)#3=T -> return engine
[PATH2] if(cachedEngine == null)#1=F -> if(engine == null)#1=F -> return en... | /* static context
[FOCAL] public static AkkaEngine AkkaEngineProvider.provider()
[PATH1] if(cachedEngine == null)#1=T -> if(cachedEngine == null)#2=T -> if(engine == null)#1=T -> if(engine == null)#2=T -> if(engine == null)#3=T -> return engine
[PATH2] if(cachedEngine == null)#1=F -> if(engine == null)#1=F -> return en... | true | ok | {"focal": {"class": "AkkaEngineProvider", "name": "provider", "signature": "AkkaEngine provider()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "AkkaEngine"}, "class_info": {"name": "AkkaEngineProvider", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "ReactiveStreams... |
122461562_1 | class ImageBuilder {
public TargetPlatformSpec prepare(TargetPlatformSpec inputSpec) {
try {
List<Path> platformArtifacts = install(Arrays.asList(inputSpec.getDependencies()),TargetPlatformSpec.platformPath(targetBase));
Path specArtifact = Files.createDirectories(TargetPlatformSpec... | FileSystem fs = Jimfs.newFileSystem(Configuration.unix());
// Create test inputs:
Path inputs = Files.createDirectories(fs.getPath("/").resolve("INPUTS"));
Path p1 = Files.write(inputs.resolve("DATA1"),"data1".getBytes(StandardCharsets.UTF_8));
Path p2 = Files.write(inputs.resolv... | [FOCAL] public TargetPlatformSpec ImageBuilder.prepare(TargetPlatformSpec inputSpec)
[CLASS] class ImageBuilder
[METRICS] loc=10 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-INTERNAL] List<Path> install(List<Dependency> external, Path path); void writeBlob(TargetPlatformSpec targetPlatformSpec, JarOutput... | /* static context
[FOCAL] public TargetPlatformSpec ImageBuilder.prepare(TargetPlatformSpec inputSpec)
[THROWS-WHEN] RuntimeException when try-body throws
[PATH1] try-body throws -> throw new RuntimeException("Problem!",e)
[PATH2] return inputSpec
[INPUTS] branches=- | result=inputSpec
[COLLABORATORS] param inputSpec:T... | /* static context
[FOCAL] public TargetPlatformSpec ImageBuilder.prepare(TargetPlatformSpec inputSpec)
[THROWS-WHEN] RuntimeException when try-body throws
[PATH1] try-body throws -> throw new RuntimeException("Problem!",e)
[PATH2] return inputSpec
[INPUTS] branches=- | result=inputSpec
[COLLABORATORS] param inputSpec:T... | true | ok | {"focal": {"class": "ImageBuilder", "name": "prepare", "signature": "TargetPlatformSpec prepare(TargetPlatformSpec inputSpec)", "start_line": 3, "modifiers": "public", "params": [{"name": "inputSpec", "type": "TargetPlatformSpec"}], "return_type": "TargetPlatformSpec"}, "class_info": {"name": "ImageBuilder", "kind": "c... |
122467588_2 | class NameRepository {
public Single<String> getName() {
return Single.create(
emitter -> {
Gson gson = new Gson();
emitter.onSuccess(gson.fromJson(fileReader.readFile(), User.class).name);
});
}
public NameRepository(FileReader fileReader);
@Mock FileReader fileReade... | TestObserver<String> observer = nameRepository.getName().test();
observer.assertValue("Sasha");
}
} | [FOCAL] public Single<String> NameRepository.getName()
[CLASS] class NameRepository
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Single.create/1, emitter.onSuccess/1, Gson.fromJson/2, FileReader.readFile/0
[NEW] Gson
[FIELDS] read=fileReader:FileReader
[INPUTS] branches=- | resu... | /* static context
[FOCAL] public Single<String> NameRepository.getName()
[INPUTS] branches=- | result=fileReader
[COLLABORATORS] field emitter onSuccess/1; field fileReader:FileReader readFile/0
[FIELDS] read=fileReader:FileReader
[NEW] Gson
[CALLS-EXTERNAL] Single.create/1, emitter.onSuccess/1, Gson.fromJson/2, FileRe... | /* static context
[FOCAL] public Single<String> NameRepository.getName()
[INPUTS] branches=- | result=fileReader
[COLLABORATORS] field emitter onSuccess/1; field fileReader:FileReader readFile/0
[FIELDS] read=fileReader:FileReader
[NEW] Gson
[CALLS-EXTERNAL] Single.create/1, emitter.onSuccess/1, Gson.fromJson/2, FileRe... | true | ok | {"focal": {"class": "NameRepository", "name": "getName", "signature": "Single<String> getName()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Single<String>"}, "class_info": {"name": "NameRepository", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name":... |
122494549_0 | class Server implements Instance, Communicatable {
@Override
public void start() {
try {
this.starting = true;
Message message = Message.create()
.setType("START_SERVER")
.set("name", getName())
.set("id", getId())
... | mockStatic(HashUtil.class);
when(HashUtil.getHashes(any(File.class))).thenReturn(null);
when(coreFileManager.getServerGlobalDirectory()).thenReturn(new File("core/templates/server/Global/"));
doAnswer(invocation -> {
Message message = invocation.getArgument(0);
ge... | [FOCAL] @Override public void Server.start()
[CLASS] class Server implements Instance, Communicatable
[METRICS] loc=39 cc=6 branches=3 loops=0 returns=2 throws=0 nesting=4
[CALLS-INTERNAL] Base getBase(); ServerGroup getGroup(); String getId(); String getMap(); String getName(); boolean hasMap()
[CALLS-EXTERNAL] Messag... | /* static context
[FOCAL] @Override public void Server.start()
[PATH1] if(!getGroup().isStatic())=T -> try-body throws -> return
[PATH2] if(!getGroup().isStatic())=T -> if(hasMap())#1=T -> if(hasMap())#2=T
[PATH3] if(!getGroup().isStatic())=T -> if(hasMap())#1=F -> if(hasMap())#2=F
[PATH4] if(!getGroup().isStatic())=F
... | /* static context
[FOCAL] @Override public void Server.start()
[PATH1] if(!getGroup().isStatic())=T -> try-body throws -> return
[PATH2] if(!getGroup().isStatic())=T -> if(hasMap())#1=T -> if(hasMap())#2=T
[PATH3] if(!getGroup().isStatic())=T -> if(hasMap())#1=F -> if(hasMap())#2=F
[PATH4] if(!getGroup().isStatic())=F
... | true | ok | {"focal": {"class": "Server", "name": "start", "signature": "void start()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "Server", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Instance, Communicatable", "fields": [{"name": "baseIn... |
122514469_8 | class FloatParser implements ConfigurationParser {
@Override
public Float parseValue(String value, Class targetType) {
if(value == null) throw new ConfigurationParserException("Could not parse 'null' to float");
return Float.parseFloat(value);
}
@Override public Set<Class> getResponsib... | parser.parseValue(null, Float.class);
fail();
}
} | [FOCAL] @Override public Float FloatParser.parseValue(String value, Class targetType)
[CLASS] class FloatParser implements ConfigurationParser
[METRICS] loc=5 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] Float.parseFloat/1
[NEW] ConfigurationParserException
[EXCEPTIONS] throws ConfigurationPars... | /* static context
[FOCAL] @Override public Float FloatParser.parseValue(String value, Class targetType)
[THROWS-WHEN] ConfigurationParserException when value == null
[PATH1] if(value == null)=T -> throw new ConfigurationParserException("Could not parse 'null' to float")
[PATH2] if(value == null)=F -> return Float.parse... | /* static context
[FOCAL] @Override public Float FloatParser.parseValue(String value, Class targetType)
[THROWS-WHEN] ConfigurationParserException when value == null
[PATH1] if(value == null)=T -> throw new ConfigurationParserException("Could not parse 'null' to float")
[PATH2] if(value == null)=F -> return Float.parse... | true | ok | {"focal": {"class": "FloatParser", "name": "parseValue", "signature": "Float parseValue(String value, Class targetType)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "value", "type": "String"}, {"name": "targetType", "type": "Class"}], "return_type": "Float"}, "class_info": {"name": "FloatPars... |
122529106_2 | class OwnerFieldClass {
public ExecutableElement getSetter(String propertyName) throws UnableToCompleteException {
if (ambiguousSetters != null && ambiguousSetters.contains(propertyName)) {
logger.die(
"Ambiguous setter requested: " + AptUtil.asQualifiedNameable(rawType).getQualifiedName()
... | TypeElement typeElement = elements.getTypeElement(ChildClass.class.getName());
OwnerFieldClass cut = new OwnerFieldClass(typeElement.asType(), mockLogger, mockContext);
ExecutableElement setter = cut.getSetter("text");
assertNotNull(setter);
verifyNoMoreInteractions(mockLogger, mockContext);
}
... | [FOCAL] public ExecutableElement OwnerFieldClass.getSetter(String propertyName)
[CLASS] class OwnerFieldClass
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] ambiguousSetters.contains/1, logger.die/1, AptUtil.asQualifiedNameable(rawType).getQualifiedName().toString/0, AptUtil.asQua... | /* static context
[FOCAL] public ExecutableElement OwnerFieldClass.getSetter(String propertyName)
[PATH1] if(ambiguousSetters != null && ambiguousSetters.contains(propertyName))=T -> return setters.get(propertyName)
[PATH2] if(ambiguousSetters != null && ambiguousSetters.contains(propertyName))=F -> return setters.get(... | /* static context
[FOCAL] public ExecutableElement OwnerFieldClass.getSetter(String propertyName)
[PATH1] if(ambiguousSetters != null && ambiguousSetters.contains(propertyName))=T -> return setters.get(propertyName)
[PATH2] if(ambiguousSetters != null && ambiguousSetters.contains(propertyName))=F -> return setters.get(... | true | ok | {"focal": {"class": "OwnerFieldClass", "name": "getSetter", "signature": "ExecutableElement getSetter(String propertyName) throws UnableToCompleteException", "start_line": 3, "modifiers": "public", "params": [{"name": "propertyName", "type": "String"}], "return_type": "ExecutableElement"}, "class_info": {"name": "Owner... |
122577034_11 | class InterProcessReadWriteLock {
public InterProcessMutex writeLock()
{
return writeMutex;
}
public InterProcessReadWriteLock(CuratorFramework client, String basePath);
public InterProcessReadWriteLock(CuratorFramework client, String basePath, byte[] lockData);
public InterProc... | CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
try
{
client.start();
final byte[] nodeData = new byte[] { 1, 2, 3, 4 };
InterProcessReadWriteLock lock = new InterProcessReadWriteLock(cli... | [FOCAL] public InterProcessMutex InterProcessReadWriteLock.writeLock()
[CLASS] class InterProcessReadWriteLock
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] InterProcessReadWriteLock(CuratorFramework client, String basePath); InterProcessReadWriteLock(CuratorFramework client, Stri... | /* static context
[FOCAL] public InterProcessMutex InterProcessReadWriteLock.writeLock()
*/
| /* static context
[FOCAL] public InterProcessMutex InterProcessReadWriteLock.writeLock()
*/
class InterProcessReadWriteLock {
public InterProcessMutex writeLock()
{
return writeMutex;
}
public InterProcessReadWriteLock(CuratorFramework client, String basePath);
public InterProcessRea... | true | ok | {"focal": {"class": "InterProcessReadWriteLock", "name": "writeLock", "signature": "InterProcessMutex writeLock()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "InterProcessMutex"}, "class_info": {"name": "InterProcessReadWriteLock", "kind": "class", "modifiers": "", "superclass": null, "interf... |
122583771_0 | class ChirpTimelineEntity extends PersistentEntity<ChirpTimelineCommand, ChirpTimelineEvent, NotUsed> {
private Persist addChirp(AddChirp cmd, CommandContext<Done> ctx) {
return ctx.thenPersist(new ChirpAdded(cmd.chirp), evt -> {
ctx.reply(Done.getInstance());
topic.publish(cmd.chir... | ChirpTopicStub topic = new ChirpTopicStub();
PersistentEntityTestDriver<ChirpTimelineCommand, ChirpTimelineEvent, NotUsed> driver =
new PersistentEntityTestDriver<>(system, new ChirpTimelineEntity(topic), "user-1");
Chirp chirp = new Chirp("user-1", "Hello, world");
Per... | [FOCAL] private Persist ChirpTimelineEntity.addChirp(AddChirp cmd, CommandContext<Done> ctx)
[CLASS] class ChirpTimelineEntity extends PersistentEntity<ChirpTimelineCommand, ChirpTimelineEvent, NotUsed>
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] CommandContext<Done>.thenPersis... | /* static context
[FOCAL] private Persist ChirpTimelineEntity.addChirp(AddChirp cmd, CommandContext<Done> ctx)
[INPUTS] branches=- | result=cmd, ctx
[COLLABORATORS] param ctx:CommandContext<Done> thenPersist/2,reply/1; field topic publish/1
[NEW] ChirpAdded
[CALLS-EXTERNAL] CommandContext<Done>.thenPersist/2, CommandCo... | /* static context
[FOCAL] private Persist ChirpTimelineEntity.addChirp(AddChirp cmd, CommandContext<Done> ctx)
[INPUTS] branches=- | result=cmd, ctx
[COLLABORATORS] param ctx:CommandContext<Done> thenPersist/2,reply/1; field topic publish/1
[NEW] ChirpAdded
[CALLS-EXTERNAL] CommandContext<Done>.thenPersist/2, CommandCo... | true | ok | {"focal": {"class": "ChirpTimelineEntity", "name": "addChirp", "signature": "Persist addChirp(AddChirp cmd, CommandContext<Done> ctx)", "start_line": 3, "modifiers": "private", "params": [{"name": "cmd", "type": "AddChirp"}, {"name": "ctx", "type": "CommandContext<Done>"}], "return_type": "Persist"}, "class_info": {"na... |
122638182_96 | class PlanParser {
public PerfPlan parseResource(Resource resource) {
requireNonNull(resource);
URI uri = resource.getUri();
String source = read(resource);
ServiceLoader<cucumber.perf.salad.PlanParser> services =ServiceLoader.load(cucumber.perf.salad.PlanParser.class);
Iter... | PlanParser p = new PlanParser(UUID::randomUUID);
URI uri = URI.create("src/test/java/resources/test.plan");
Resource r = new UriResource(Paths.get(uri.getPath()));
PerfPlan pp = p.parseResource(r);
assertEquals("simulation 1", pp.getSaladPlan().getPlan().getChildren().get(0).getName());
}
} | [FOCAL] public PerfPlan PlanParser.parseResource(Resource resource)
[CLASS] class PlanParser
[METRICS] loc=14 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] String read(Resource resource)
[CALLS-EXTERNAL] requireNonNull/1 (inherited), Resource.getUri/0, ServiceLoader.load/1, ServiceLoader<cucumbe... | /* static context
[FOCAL] public PerfPlan PlanParser.parseResource(Resource resource)
[PATH1] while(iterator.hasNext())=T -> exit loop -> return Collections.max(parser, version).parse(uri, source, idGenerator)
[PATH2] while(iterator.hasNext())=F -> return Collections.max(parser, version).parse(uri, source, idGenerator)... | /* static context
[FOCAL] public PerfPlan PlanParser.parseResource(Resource resource)
[PATH1] while(iterator.hasNext())=T -> exit loop -> return Collections.max(parser, version).parse(uri, source, idGenerator)
[PATH2] while(iterator.hasNext())=F -> return Collections.max(parser, version).parse(uri, source, idGenerator)... | true | ok | {"focal": {"class": "PlanParser", "name": "parseResource", "signature": "PerfPlan parseResource(Resource resource)", "start_line": 3, "modifiers": "public", "params": [{"name": "resource", "type": "Resource"}], "return_type": "PerfPlan"}, "class_info": {"name": "PlanParser", "kind": "class", "modifiers": "", "superclas... |
122711080_76 | class IndexFile {
public void selectPhyOffset(final List<Long> phyOffsets, final String key, final int maxNum,
final long begin, final long end, boolean lock) {
if (this.mappedFile.hold()) {
int keyHash = indexKeyHashMethod(key);
int slotPos = keyHash... | IndexFile indexFile = new IndexFile("200", HASH_SLOT_NUM, INDEX_NUM, 0, 0);
for (long i = 0; i < (INDEX_NUM - 1); i++) {
boolean putResult = indexFile.putKey(Long.toString(i), i, System.currentTimeMillis());
assertThat(putResult).isTrue();
}
// put over index fi... | [FOCAL] public void IndexFile.selectPhyOffset(List<Long> phyOffsets, String key, int maxNum, long begin, long end, boolean lock)
[CLASS] class IndexFile
[METRICS] loc=71 cc=11 branches=8 loops=1 returns=0 throws=0 nesting=5
[CALLS-INTERNAL] int indexKeyHashMethod(String key)
[CALLS-EXTERNAL] this.mappedFile.hold/0, thi... | /* static context
[FOCAL] public void IndexFile.selectPhyOffset(List<Long> phyOffsets, String key, int maxNum, long begin, long end, boolean lock)
[PATH1] if(this.mappedFile.hold())=T -> if(lock)=T -> if(slotValue <= invalidIndex || slotValue > this.indexHeader.getIndexCount() || this.indexHeader.getIndexCount() <= 1)=... | /* static context
[FOCAL] public void IndexFile.selectPhyOffset(List<Long> phyOffsets, String key, int maxNum, long begin, long end, boolean lock)
[PATH1] if(this.mappedFile.hold())=T -> if(lock)=T -> if(slotValue <= invalidIndex || slotValue > this.indexHeader.getIndexCount() || this.indexHeader.getIndexCount() <= 1)=... | true | ok | {"focal": {"class": "IndexFile", "name": "selectPhyOffset", "signature": "void selectPhyOffset(List<Long> phyOffsets, String key, int maxNum, long begin, long end, boolean lock)", "start_line": 3, "modifiers": "public", "params": [{"name": "phyOffsets", "type": "List<Long>"}, {"name": "key", "type": "String"}, {"name":... |
122751554_12 | class MatcherContext {
public Set<Person> getRemainingReceivers() {
return IntStream.range(0, satisfiedReceivers.length)
.filter(i -> !satisfiedReceivers[i])
.mapToObj(receivers::get)
.collect(Collectors.toUnmodifiableSet());
}
public MatcherContext(final List<... | assertEquals(Set.of(PERSON_1, PERSON_2, PERSON_3), target.getRemainingReceivers());
}
} | [FOCAL] public Set<Person> MatcherContext.getRemainingReceivers()
[CLASS] class MatcherContext
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] IntStream.range(0, satisfiedReceivers.length) .filter(i -....collect/1, IntStream.range(0, satisfiedReceivers.length) .filter(i -....mapToO... | /* static context
[FOCAL] public Set<Person> MatcherContext.getRemainingReceivers()
[CALLS-EXTERNAL] IntStream.range(0, satisfiedReceivers.length) .filter(i -....collect/1, IntStream.range(0, satisfiedReceivers.length) .filter(i -....mapToObj/1, IntStream.range(0, satisfiedReceivers.length).filter/1, IntStream.range/2,... | /* static context
[FOCAL] public Set<Person> MatcherContext.getRemainingReceivers()
[CALLS-EXTERNAL] IntStream.range(0, satisfiedReceivers.length) .filter(i -....collect/1, IntStream.range(0, satisfiedReceivers.length) .filter(i -....mapToObj/1, IntStream.range(0, satisfiedReceivers.length).filter/1, IntStream.range/2,... | true | ok | {"focal": {"class": "MatcherContext", "name": "getRemainingReceivers", "signature": "Set<Person> getRemainingReceivers()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Set<Person>"}, "class_info": {"name": "MatcherContext", "kind": "class", "modifiers": "", "superclass": null, "interfaces": nul... |
122753171_110 | class DefaultHttp2FrameReader implements Http2FrameReader, Http2FrameSizePolicy, Configuration {
@Override
public void readFrame(
final ChannelHandlerContext ctx, final ByteBuf input, final Http2FrameListener listener)
throws Http2Exception {
if (readError) {
input.skipBytes(input.readableByt... | final int streamId = 1;
final ByteBuf input = Unpooled.buffer();
try {
final Http2Headers headers =
new DefaultHttp2Headers().authority("foo").method("get").path("/").scheme("https");
final Http2Flags flags = new Http2Flags().endOfHeaders(true).endOfStream(true);
writeHeaderFram... | [FOCAL] @Override public void DefaultHttp2FrameReader.readFrame(ChannelHandlerContext ctx, ByteBuf input, Http2FrameListener listener)
[CLASS] class DefaultHttp2FrameReader implements Http2FrameReader, Http2FrameSizePolicy, Configuration
[METRICS] loc=40 cc=9 branches=4 loops=1 returns=3 throws=2 nesting=4
[CALLS-INTER... | /* static context
[FOCAL] @Override public void DefaultHttp2FrameReader.readFrame(ChannelHandlerContext ctx, ByteBuf input, Http2FrameListener listener)
[THROWS-WHEN] e when !readError && try-body throws
[PATH1] if(readError)=F -> if(readingHeaders)#1=T -> if(readingHeaders)#2=F -> if(!readingHeaders)=T -> return
[PATH... | /* static context
[FOCAL] @Override public void DefaultHttp2FrameReader.readFrame(ChannelHandlerContext ctx, ByteBuf input, Http2FrameListener listener)
[THROWS-WHEN] e when !readError && try-body throws
[PATH1] if(readError)=F -> if(readingHeaders)#1=T -> if(readingHeaders)#2=F -> if(!readingHeaders)=T -> return
[PATH... | true | ok | {"focal": {"class": "DefaultHttp2FrameReader", "name": "readFrame", "signature": "void readFrame(ChannelHandlerContext ctx, ByteBuf input, Http2FrameListener listener) throws Http2Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "ctx", "type": "ChannelHandlerContext"}, {"name": "input",... |
122852176_0 | class DatabaseFourObject implements ModelDAO {
public boolean createStudent(Student student) throws SQLException, FileNotFoundException, IOException {
state = isUserAvailable(student.getChatId());
if (state) {
students = connect();
students.store(student);
students.commit();
}
return state;
}
p... | assertTrue(database.createStudent(new Student(Long.parseLong("9998"), "0000", "0000")));
}
} | [FOCAL] public boolean DatabaseFourObject.createStudent(Student student)
[CLASS] class DatabaseFourObject implements ModelDAO
[METRICS] loc=12 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] ObjectContainer connect(); boolean isUserAvailable(Long chatId)
[CALLS-EXTERNAL] Student.getChatId/0, stude... | /* static context
[FOCAL] public boolean DatabaseFourObject.createStudent(Student student)
[PATH1] if(state)=T -> return state
[PATH2] if(state)=F -> return state
[INPUTS] branches=student | result=student
[COLLABORATORS] param student:Student getChatId/0; field students store/1,commit/0
[EXCEPTIONS] declares SQLExcept... | /* static context
[FOCAL] public boolean DatabaseFourObject.createStudent(Student student)
[PATH1] if(state)=T -> return state
[PATH2] if(state)=F -> return state
[INPUTS] branches=student | result=student
[COLLABORATORS] param student:Student getChatId/0; field students store/1,commit/0
[EXCEPTIONS] declares SQLExcept... | true | ok | {"focal": {"class": "DatabaseFourObject", "name": "createStudent", "signature": "boolean createStudent(Student student) throws SQLException, FileNotFoundException, IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "student", "type": "Student"}], "return_type": "boolean"}, "class_info": {"name": ... |
122918493_34 | class ServiceProviderInterfaceRecommender implements ConfigDef.Recommender {
@Override
public boolean visible(String name, Map<String, Object> connectorConfigs) {
return true;
}
public ServiceProviderInterfaceRecommender(Class<T> clazz);
@Override public List<Object> validValues(String name, Map<Strin... | ServiceProviderInterfaceRecommender<RequestExecutor> recommender =
new ServiceProviderInterfaceRecommender<>(RequestExecutor.class);
assertThat(recommender.visible("test", Collections.emptyMap()), equalTo(true));
}
} | [FOCAL] @Override public boolean ServiceProviderInterfaceRecommender.visible(String name, Map<String, Object> connectorConfigs)
[CLASS] class ServiceProviderInterfaceRecommender implements ConfigDef.Recommender
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[INPUTS] branches=- | result=- | unused=... | /* static context
[FOCAL] @Override public boolean ServiceProviderInterfaceRecommender.visible(String name, Map<String, Object> connectorConfigs)
[INPUTS] branches=- | result=- | unused=name, connectorConfigs
*/
| /* static context
[FOCAL] @Override public boolean ServiceProviderInterfaceRecommender.visible(String name, Map<String, Object> connectorConfigs)
[INPUTS] branches=- | result=- | unused=name, connectorConfigs
*/
class ServiceProviderInterfaceRecommender implements ConfigDef.Recommender {
@Override
public boolean v... | true | ok | {"focal": {"class": "ServiceProviderInterfaceRecommender", "name": "visible", "signature": "boolean visible(String name, Map<String, Object> connectorConfigs)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "name", "type": "String"}, {"name": "connectorConfigs", "type": "Map<String, Object>"}], ... |
122954189_6 | class DefaultCaseValidator extends Validator {
@Override
public void validate(UastNode node) {
is(UastNode.Kind.DEFAULT_CASE);
hasKeyword("default");
noChild(UastNode.Kind.CONDITION);
// FIXME go 'select' nodes are feeding default cases and should be removed
// hasAncestor(UastNode.Kind.SWITCH)... | UastNode caseNode = node(Sets.newHashSet(UastNode.Kind.DEFAULT_CASE, UastNode.Kind.CASE),
keyword("case"),
token(":"));
UastNode node = node(UastNode.Kind.SWITCH, caseNode);
Validator.ValidationException exception = assertThrows(Validator.ValidationException.class, () -> validate(node));
as... | [FOCAL] @Override public void DefaultCaseValidator.validate(UastNode node)
[CLASS] class DefaultCaseValidator extends Validator
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] is/1 (inherited), hasKeyword/1 (inherited), noChild/1 (inherited)
[INPUTS] branches=- | result=- | unused=... | /* static context
[FOCAL] @Override public void DefaultCaseValidator.validate(UastNode node)
[INPUTS] branches=- | result=- | unused=node
[CALLS-EXTERNAL] is/1 (inherited), hasKeyword/1 (inherited), noChild/1 (inherited)
*/
| /* static context
[FOCAL] @Override public void DefaultCaseValidator.validate(UastNode node)
[INPUTS] branches=- | result=- | unused=node
[CALLS-EXTERNAL] is/1 (inherited), hasKeyword/1 (inherited), noChild/1 (inherited)
*/
class DefaultCaseValidator extends Validator {
@Override
public void validate(UastNode node... | true | ok | {"focal": {"class": "DefaultCaseValidator", "name": "validate", "signature": "void validate(UastNode node)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "node", "type": "UastNode"}], "return_type": "void"}, "class_info": {"name": "DefaultCaseValidator", "kind": "class", "modifiers": "", "super... |
122966748_12 | class DateUtils {
public static Date getDateBeforePeriod(String perStr, Date curDate) {
Period pr = getPeriod(perStr);
DateTime dt = new DateTime(curDate);
return dt.minus(pr).toDate();
}
public static Period getPeriod( String perStr );
public static Date getDateAfte... |
DateTime dt = new DateTime(2015, 1, 1, 1, 1);
Date expected = dt.minusHours(1).minusMinutes(5).toDate();
Date result = DateUtils.getDateBeforePeriod("1s5d", dt.toDate());
Assert.assertEquals(expected, result);
//Ingilizce
result = DateUtils.getD... | [FOCAL] public static Date DateUtils.getDateBeforePeriod(String perStr, Date curDate)
[CLASS] class DateUtils
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Period getPeriod(String perStr)
[CALLS-EXTERNAL] dt.minus(pr).toDate/0, DateTime.minus/1
[NEW] DateTime
[INPUTS] branches=- ... | /* static context
[FOCAL] public static Date DateUtils.getDateBeforePeriod(String perStr, Date curDate)
[INPUTS] branches=- | result=curDate, perStr
[CALLS-INTERNAL] Period getPeriod(String perStr)
[NEW] DateTime
[CALLS-EXTERNAL] dt.minus(pr).toDate/0, DateTime.minus/1
*/
| /* static context
[FOCAL] public static Date DateUtils.getDateBeforePeriod(String perStr, Date curDate)
[INPUTS] branches=- | result=curDate, perStr
[CALLS-INTERNAL] Period getPeriod(String perStr)
[NEW] DateTime
[CALLS-EXTERNAL] dt.minus(pr).toDate/0, DateTime.minus/1
*/
class DateUtils {
public static Date getDa... | true | ok | {"focal": {"class": "DateUtils", "name": "getDateBeforePeriod", "signature": "Date getDateBeforePeriod(String perStr, Date curDate)", "start_line": 3, "modifiers": "public static", "params": [{"name": "perStr", "type": "String"}, {"name": "curDate", "type": "Date"}], "return_type": "Date"}, "class_info": {"name": "Date... |
123178569_1 | class Library {
public boolean someLibraryMethod() {
return true;
}
}
class LibraryTest {
@Test public void testSomeLibraryMethod() {
| Library classUnderTest = new Library();
assertTrue(classUnderTest.someLibraryMethod(), "someLibraryMethod should return 'true'");
}
} | [FOCAL] public boolean Library.someLibraryMethod()
[CLASS] class Library
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[TEST] LibraryTest: @Test public void testSomeLibraryMethod() | /* static context
[FOCAL] public boolean Library.someLibraryMethod()
*/
| /* static context
[FOCAL] public boolean Library.someLibraryMethod()
*/
class Library {
public boolean someLibraryMethod() {
return true;
}
}
class LibraryTest {
@Test public void testSomeLibraryMethod() {
| true | ok | {"focal": {"class": "Library", "name": "someLibraryMethod", "signature": "boolean someLibraryMethod()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "Library", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": []... |
123189523_1 | class MagnetInstanceManager implements InstanceManager {
@Override
public <T> @Nullable InstanceFactory<T> getFilteredInstanceFactory(
Class<T> type, String classifier, FactoryFilter factoryFilter
) {
Range range = getOptionalRange(type, classifier);
if (range == null) {
... | // when
InstanceFactory<Type1> factory = instManager.getFilteredInstanceFactory(
Type1.class, CLASSIFIER_LOCAL, factoryFilter);
// then
assertThat(factory).isNotNull();
}
} | [FOCAL] @Override public InstanceFactory<T> MagnetInstanceManager.getFilteredInstanceFactory(Class<T> type, String classifier, FactoryFilter factoryFilter)
[CLASS] class MagnetInstanceManager implements InstanceManager
[METRICS] loc=36 cc=7 branches=5 loops=1 returns=4 throws=1 nesting=3
[CALLS-INTERNAL] Range getOptio... | /* static context
[FOCAL] @Override public InstanceFactory<T> MagnetInstanceManager.getFilteredInstanceFactory(Class<T> type, String classifier, FactoryFilter factoryFilter)
[THROWS-WHEN] IllegalStateException when !(range == null) && !(range.getCount() == 1) && index < afterLast && factoryFilter.filter(candidate) && f... | /* static context
[FOCAL] @Override public InstanceFactory<T> MagnetInstanceManager.getFilteredInstanceFactory(Class<T> type, String classifier, FactoryFilter factoryFilter)
[THROWS-WHEN] IllegalStateException when !(range == null) && !(range.getCount() == 1) && index < afterLast && factoryFilter.filter(candidate) && f... | true | ok | {"focal": {"class": "MagnetInstanceManager", "name": "getFilteredInstanceFactory", "signature": "InstanceFactory<T> getFilteredInstanceFactory(Class<T> type, String classifier, FactoryFilter factoryFilter)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "type", "type": "Class<T>"}, {"name": "cla... |
123284439_19 | class RecordApi extends BaseProvider implements RecordProvider {
@Override
public void checkRecordExists(String id) throws OaiPmhException {
ResponseEntity<String> response = getResponseForRecord(id);
if (response == null) {
throw new IdDoesNotExistException("Record with id '" + id ... | Mockito.doThrow(new IdDoesNotExistException("INCORRECT/ID")).when(recordApi).checkRecordExists("INCORRECT/ID");
recordApi.checkRecordExists("INCORRECT/ID");
fail(); // should not reach this code
}
} | [FOCAL] @Override public void RecordApi.checkRecordExists(String id)
[CLASS] class RecordApi extends BaseProvider implements RecordProvider
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=0 throws=1 nesting=1
[CALLS-INTERNAL] ResponseEntity<String> getResponseForRecord(String id)
[NEW] IdDoesNotExistException
[EXCEPTIO... | /* static context
[FOCAL] @Override public void RecordApi.checkRecordExists(String id)
[THROWS-WHEN] IdDoesNotExistException when response == null
[PATH1] if(response == null)=T -> throw new IdDoesNotExistException("Record with id '" + id + "' not found")
[PATH2] if(response == null)=F
[INPUTS] branches=id | result=id
... | /* static context
[FOCAL] @Override public void RecordApi.checkRecordExists(String id)
[THROWS-WHEN] IdDoesNotExistException when response == null
[PATH1] if(response == null)=T -> throw new IdDoesNotExistException("Record with id '" + id + "' not found")
[PATH2] if(response == null)=F
[INPUTS] branches=id | result=id
... | true | ok | {"focal": {"class": "RecordApi", "name": "checkRecordExists", "signature": "void checkRecordExists(String id) throws OaiPmhException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "id", "type": "String"}], "return_type": "void"}, "class_info": {"name": "RecordApi", "kind": "class", "modifiers":... |
123335926_5 | class Utils {
public static String formatQuantity(BigDecimal pQuantity, String pSymbol, ExchangeInfo pExchangeInfo) {
SymbolInfo symbolInfo = pExchangeInfo.getSymbolInfo(pSymbol);
String tickSize = symbolInfo.getSymbolFilter(FilterType.LOT_SIZE).getStepSize();
return roundToTickSize(pQuantity, tickSize);
}
p... | ExchangeInfo ex = new ExchangeInfo();
List<SymbolInfo> symbols = new ArrayList<>();
SymbolInfo si = new SymbolInfo();
si.setSymbol("NEOETH");
symbols.add(si);
ex.setSymbols(symbols);
SymbolFilter lotFilter = new SymbolFilter();
lotFilter.setFilterType(FilterType.LOT_SIZE);
lotFilter.setStepSize(... | [FOCAL] public static String Utils.formatQuantity(BigDecimal pQuantity, String pSymbol, ExchangeInfo pExchangeInfo)
[CLASS] class Utils
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String roundToTickSize(BigDecimal pDecimal, String tickSize)
[CALLS-EXTERNAL] ExchangeInfo.getSymb... | /* static context
[FOCAL] public static String Utils.formatQuantity(BigDecimal pQuantity, String pSymbol, ExchangeInfo pExchangeInfo)
[INPUTS] branches=- | result=pExchangeInfo, pQuantity, pSymbol
[COLLABORATORS] param pExchangeInfo:ExchangeInfo getSymbolInfo/1
[CALLS-INTERNAL] String roundToTickSize(BigDecimal pDecima... | /* static context
[FOCAL] public static String Utils.formatQuantity(BigDecimal pQuantity, String pSymbol, ExchangeInfo pExchangeInfo)
[INPUTS] branches=- | result=pExchangeInfo, pQuantity, pSymbol
[COLLABORATORS] param pExchangeInfo:ExchangeInfo getSymbolInfo/1
[CALLS-INTERNAL] String roundToTickSize(BigDecimal pDecima... | true | ok | {"focal": {"class": "Utils", "name": "formatQuantity", "signature": "String formatQuantity(BigDecimal pQuantity, String pSymbol, ExchangeInfo pExchangeInfo)", "start_line": 3, "modifiers": "public static", "params": [{"name": "pQuantity", "type": "BigDecimal"}, {"name": "pSymbol", "type": "String"}, {"name": "pExchange... |
123340956_1 | class User implements Serializable {
public String getUsername() {
return username;
}
public User(String username);
public void setUsername(String username);
public void listenToMessages(MessageReceivedObserver observer);
public void receiveMessage(Message message);
@Override pub... | assertEquals("john", john.getUsername());
}
} | [FOCAL] public String User.getUsername()
[CLASS] class User implements Serializable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] User(String username); void setUsername(String username); void listenToMessages(MessageReceivedObserver observer); void receiveMessage(Message message)... | /* static context
[FOCAL] public String User.getUsername()
*/
| /* static context
[FOCAL] public String User.getUsername()
*/
class User implements Serializable {
public String getUsername() {
return username;
}
public User(String username);
public void setUsername(String username);
public void listenToMessages(MessageReceivedObserver observer);
... | true | ok | {"focal": {"class": "User", "name": "getUsername", "signature": "String getUsername()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "User", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Serializable", "fields": [{"name": "john", "type": "... |
123415889_0 | class ResteasyEmbeddedServletInitializer implements BeanFactoryPostProcessor {
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
logger.debug("Post process bean factory has been called");
findJaxrsApplications(beanFactory);
// This is ... |
Map<String, ServletRegistrationBean> servletRegistrationBeans = applicationContext.getBeansOfType(ServletRegistrationBean.class);
Assert.assertNotNull(servletRegistrationBeans);
// Although there are 5 sample JAX-RS Application classes, one of them is not annotated with the Application... | [FOCAL] public void ResteasyEmbeddedServletInitializer.postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
[CLASS] class ResteasyEmbeddedServletInitializer implements BeanFactoryPostProcessor
[METRICS] loc=40 cc=6 branches=4 loops=1 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] GenericBeanDefinition cre... | /* static context
[FOCAL] public void ResteasyEmbeddedServletInitializer.postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
[PATH1] if(allResources.size() == 0)=T -> if(applications.size() == 0)=F -> if(servletMappingPrefix != null)=T -> foreach(Class<? extends Application> applicationClass : applicati... | /* static context
[FOCAL] public void ResteasyEmbeddedServletInitializer.postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
[PATH1] if(allResources.size() == 0)=T -> if(applications.size() == 0)=F -> if(servletMappingPrefix != null)=T -> foreach(Class<? extends Application> applicationClass : applicati... | true | ok | {"focal": {"class": "ResteasyEmbeddedServletInitializer", "name": "postProcessBeanFactory", "signature": "void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException", "start_line": 3, "modifiers": "public", "params": [{"name": "beanFactory", "type": "ConfigurableListableBeanFactory"}... |
123463973_5 | class PlayerViewModel extends BaseViewModel {
public void volumeDown(){
audioManager.adjustVolume(AudioManager.ADJUST_LOWER, AudioManager.FLAG_PLAY_SOUND);
setCurrentVolumeVolume();
}
@Inject public PlayerViewModel(VideoRepository videoRepository, AudioManager audioManager);
public v... | Observer observer = mock(Observer.class);
viewModel.getVolumeValue().observeForever(observer);
currentVolume = 5;
viewModel.volumeDown();
verify(observer, times(2)).onChanged(any());
assertTrue(viewModel.getVolumeValue().getValue() == 4);
}
} | [FOCAL] public void PlayerViewModel.volumeDown()
[CLASS] class PlayerViewModel extends BaseViewModel
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void setCurrentVolumeVolume()
[CALLS-EXTERNAL] AudioManager.adjustVolume/2
[FIELDS] read=audioManager:AudioManager
[COLLABORATORS] fi... | /* static context
[FOCAL] public void PlayerViewModel.volumeDown()
[COLLABORATORS] field audioManager:AudioManager adjustVolume/2
[CALLS-INTERNAL] void setCurrentVolumeVolume()
[FIELDS] read=audioManager:AudioManager
[CALLS-EXTERNAL] AudioManager.adjustVolume/2
*/
| /* static context
[FOCAL] public void PlayerViewModel.volumeDown()
[COLLABORATORS] field audioManager:AudioManager adjustVolume/2
[CALLS-INTERNAL] void setCurrentVolumeVolume()
[FIELDS] read=audioManager:AudioManager
[CALLS-EXTERNAL] AudioManager.adjustVolume/2
*/
class PlayerViewModel extends BaseViewModel {
publ... | true | ok | {"focal": {"class": "PlayerViewModel", "name": "volumeDown", "signature": "void volumeDown()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "PlayerViewModel", "kind": "class", "modifiers": "", "superclass": "BaseViewModel", "interfaces": null, "fields": [{"name": ... |
123532715_1 | class DockerPluginUtils {
public static String resolveValue(String value) throws DockerPluginException {
int startIndex;
if ((startIndex = value.indexOf("$env{")) >= 0) {
int endIndex = value.indexOf("}", startIndex);
if (endIndex > 0) {
String varName = valu... | Map<String, String> env = new HashMap<>();
env.put("DOCKER_USERNAME", "anuruddhal");
setEnv(env);
try {
Assert.assertEquals(DockerPluginUtils.resolveValue("$env{DOCKER_USERNAME}"), "anuruddhal");
} catch (DockerPluginException e) {
Assert.fail("Unable to r... | [FOCAL] public static String DockerPluginUtils.resolveValue(String value)
[CLASS] class DockerPluginUtils
[METRICS] loc=15 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] String.indexOf/1, String.indexOf/2, value.substring(startIndex + 5, endIndex).trim/0, String.substring/2, Optional.ofNullable(S... | /* static context
[FOCAL] public static String DockerPluginUtils.resolveValue(String value)
[PATH1] if((startIndex = value.indexOf("$env{")) >= 0)=T -> if(endIndex > 0)=T -> return value.substring(0, startIndex) + resolvedVar + rest
[PATH2] if((startIndex = value.indexOf("$env{")) >= 0)=F -> return value
[PATH3] if((st... | /* static context
[FOCAL] public static String DockerPluginUtils.resolveValue(String value)
[PATH1] if((startIndex = value.indexOf("$env{")) >= 0)=T -> if(endIndex > 0)=T -> return value.substring(0, startIndex) + resolvedVar + rest
[PATH2] if((startIndex = value.indexOf("$env{")) >= 0)=F -> return value
[PATH3] if((st... | true | ok | {"focal": {"class": "DockerPluginUtils", "name": "resolveValue", "signature": "String resolveValue(String value) throws DockerPluginException", "start_line": 3, "modifiers": "public static", "params": [{"name": "value", "type": "String"}], "return_type": "String"}, "class_info": {"name": "DockerPluginUtils", "kind": "c... |
123532974_6 | class KubernetesUtils {
public static void copyFileOrDirectory(String source, String destination) throws KubernetesPluginException {
File src = new File(source);
File dst = new File(destination);
try {
// if source is file
if (Files.isRegularFile(Paths.get(source))) ... | File testFile = tempDirectory.resolve("copy.txt").toFile();
Assert.assertTrue(testFile.createNewFile());
Path destinationDir = Files.createTempDirectory("copy-test-");
KubernetesUtils.copyFileOrDirectory(testFile.getAbsolutePath(), destinationDir.toString());
// assert
... | [FOCAL] public static void KubernetesUtils.copyFileOrDirectory(String source, String destination)
[CLASS] class KubernetesUtils
[METRICS] loc=20 cc=5 branches=3 loops=0 returns=0 throws=1 nesting=3
[CALLS-EXTERNAL] Files.isRegularFile/1, Paths.get/1, Files.isDirectory/1, File.toPath/0, FileUtils.copyFileToDirectory/2, ... | /* static context
[FOCAL] public static void KubernetesUtils.copyFileOrDirectory(String source, String destination)
[THROWS-WHEN] KubernetesPluginException when try-body throws
[PATH1] try-body throws -> throw new KubernetesPluginException("error while copying file", e)
[PATH2] if(Files.isRegularFile(Paths.get(source))... | /* static context
[FOCAL] public static void KubernetesUtils.copyFileOrDirectory(String source, String destination)
[THROWS-WHEN] KubernetesPluginException when try-body throws
[PATH1] try-body throws -> throw new KubernetesPluginException("error while copying file", e)
[PATH2] if(Files.isRegularFile(Paths.get(source))... | true | ok | {"focal": {"class": "KubernetesUtils", "name": "copyFileOrDirectory", "signature": "void copyFileOrDirectory(String source, String destination) throws KubernetesPluginException", "start_line": 3, "modifiers": "public static", "params": [{"name": "source", "type": "String"}, {"name": "destination", "type": "String"}], "... |
123618046_11 | class Config {
public AsyncClient getAsyncClient() {
if (!asyncClientIsReady()) {
buildAsyncClient();
}
return asyncClient.get();
}
public Config();
private void setDefaults();
public Config httpClient(HttpClient httpClient);
public Config httpClient(Clien... | assertSame(config.getAsyncClient(), config.getAsyncClient());
}
} | [FOCAL] public AsyncClient Config.getAsyncClient()
[CLASS] class Config
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] boolean asyncClientIsReady(); void buildAsyncClient()
[CALLS-EXTERNAL] CloseableHttpAsyncClient.get/0
[FIELDS] read=asyncClient:CloseableHttpAsyncClient
[PATH1] i... | /* static context
[FOCAL] public AsyncClient Config.getAsyncClient()
[PATH1] if(!asyncClientIsReady())=T -> return asyncClient.get()
[PATH2] if(!asyncClientIsReady())=F -> return asyncClient.get()
[INPUTS] branches=- | result=asyncClient
[COLLABORATORS] field asyncClient:CloseableHttpAsyncClient get/0
[CALLS-INTERNAL] ... | /* static context
[FOCAL] public AsyncClient Config.getAsyncClient()
[PATH1] if(!asyncClientIsReady())=T -> return asyncClient.get()
[PATH2] if(!asyncClientIsReady())=F -> return asyncClient.get()
[INPUTS] branches=- | result=asyncClient
[COLLABORATORS] field asyncClient:CloseableHttpAsyncClient get/0
[CALLS-INTERNAL] ... | true | ok | {"focal": {"class": "Config", "name": "getAsyncClient", "signature": "AsyncClient getAsyncClient()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "AsyncClient"}, "class_info": {"name": "Config", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "httpc"... |
123664565_0 | class RxBackoff {
public static RxBackoff fixed(long interval, int maxRetryCount) {
return new RxBackoff(new Backoff.Builder()
.setAlgorithm(new FixedIntervalAlgorithm(interval, TimeUnit.MILLISECONDS))
.setMaxRetryCount(maxRetryCount)
.build());
}
public RxBackoff(@NonNull Backoff b... | final AtomicInteger count = new AtomicInteger(0);
final TestScheduler scheduler = new TestScheduler();
final RxBackoff backoff = new RxBackoff(
new Backoff.Builder()
.setAlgorithm(new FixedIntervalAlgorithm())
.setMaxRetryCount(5)
.build(),
scheduler);
... | [FOCAL] public static RxBackoff RxBackoff.fixed(long interval, int maxRetryCount)
[CLASS] class RxBackoff
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] new Backoff.Builder() .setAlgorithm(new FixedIntervalAlgo....build/0, new Backoff.Builder() .setAlgorithm(new FixedIntervalAlgo.... | /* static context
[FOCAL] public static RxBackoff RxBackoff.fixed(long interval, int maxRetryCount)
[INPUTS] branches=- | result=interval, maxRetryCount
[NEW] RxBackoff, Backoff.Builder, FixedIntervalAlgorithm
[CALLS-EXTERNAL] new Backoff.Builder() .setAlgorithm(new FixedIntervalAlgo....build/0, new Backoff.Builder() .... | /* static context
[FOCAL] public static RxBackoff RxBackoff.fixed(long interval, int maxRetryCount)
[INPUTS] branches=- | result=interval, maxRetryCount
[NEW] RxBackoff, Backoff.Builder, FixedIntervalAlgorithm
[CALLS-EXTERNAL] new Backoff.Builder() .setAlgorithm(new FixedIntervalAlgo....build/0, new Backoff.Builder() .... | true | ok | {"focal": {"class": "RxBackoff", "name": "fixed", "signature": "RxBackoff fixed(long interval, int maxRetryCount)", "start_line": 3, "modifiers": "public static", "params": [{"name": "interval", "type": "long"}, {"name": "maxRetryCount", "type": "int"}], "return_type": "RxBackoff"}, "class_info": {"name": "RxBackoff", ... |
123681471_114 | class RuleParser {
public static KnowledgeBase parse(final InputStream stream, final String encoding,
final ParserConfiguration parserConfiguration) throws ParsingException {
JavaCCParser parser = new JavaCCParser(stream, encoding);
parser.setParserConfiguration(parserConfiguration);
return doParse(parser);
... | String input = "@base <http://example.org/> . " + " q(?X, !Y), r(?X, d) :- ~p(?X,c), p(?X,?Z) . ";
ArrayList<Statement> statements = new ArrayList<>(RuleParser.parse(input).getStatements());
assertEquals(Arrays.asList(rule2), statements);
}
} | [FOCAL] public static KnowledgeBase RuleParser.parse(InputStream stream, String encoding, ParserConfiguration parserConfiguration)
[CLASS] class RuleParser
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] KnowledgeBase doParse(JavaCCParser parser)
[CALLS-EXTERNAL] JavaCCParser.setPa... | /* static context
[FOCAL] public static KnowledgeBase RuleParser.parse(InputStream stream, String encoding, ParserConfiguration parserConfiguration)
[INPUTS] branches=- | result=encoding, stream
[EXCEPTIONS] declares ParsingException
[CALLS-INTERNAL] KnowledgeBase doParse(JavaCCParser parser)
[NEW] JavaCCParser
[CALLS-... | /* static context
[FOCAL] public static KnowledgeBase RuleParser.parse(InputStream stream, String encoding, ParserConfiguration parserConfiguration)
[INPUTS] branches=- | result=encoding, stream
[EXCEPTIONS] declares ParsingException
[CALLS-INTERNAL] KnowledgeBase doParse(JavaCCParser parser)
[NEW] JavaCCParser
[CALLS-... | true | ok | {"focal": {"class": "RuleParser", "name": "parse", "signature": "KnowledgeBase parse(InputStream stream, String encoding, ParserConfiguration parserConfiguration) throws ParsingException", "start_line": 3, "modifiers": "public static", "params": [{"name": "stream", "type": "InputStream"}, {"name": "encoding", "type": "... |
123712995_12 | class TweeterApplicationRunner implements ApplicationRunner {
@Override
public void run(ApplicationArguments args) throws Exception {
this.jdbcTemplate.execute("CREATE TABLE tweets (\n" + //
" uuid VARCHAR(36) PRIMARY KEY,\n" + //
" text VARCHAR(255),\n" + //
" username VARCHAR(128),\n... | SpringApplication.run(Hajiboot2TweeterApplication.class);
String output = capture.toString();
assertThat(output).contains("Number of tweets: 2");
assertThat(output).containsPattern(
"Tweet\\{uuid=[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}, text='Demo1', username='making', createdAt=[0-9]{4... | [FOCAL] @Override public void TweeterApplicationRunner.run(ApplicationArguments args)
[CLASS] class TweeterApplicationRunner implements ApplicationRunner
[METRICS] loc=24 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] this.jdbcTemplate.execute/1, this.jdbcTemplate.update/5, UUID.randomUUID/0, Ins... | /* static context
[FOCAL] @Override public void TweeterApplicationRunner.run(ApplicationArguments args)
[INPUTS] branches=- | result=- | unused=args
[COLLABORATORS] field jdbcTemplate execute/1,update/5,queryForObject/2,query/2; field rs getString/1,getTimestamp/1
[EXCEPTIONS] declares Exception
[FIELDS] read=jdbcTempl... | /* static context
[FOCAL] @Override public void TweeterApplicationRunner.run(ApplicationArguments args)
[INPUTS] branches=- | result=- | unused=args
[COLLABORATORS] field jdbcTemplate execute/1,update/5,queryForObject/2,query/2; field rs getString/1,getTimestamp/1
[EXCEPTIONS] declares Exception
[FIELDS] read=jdbcTempl... | true | ok | {"focal": {"class": "TweeterApplicationRunner", "name": "run", "signature": "void run(ApplicationArguments args) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "args", "type": "ApplicationArguments"}], "return_type": "void"}, "class_info": {"name": "TweeterApplicationRunner", "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.