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 |
|---|---|---|---|---|---|---|---|---|
58881448_4 | class HttpResponseHandler {
public TrackerResponse handleResponse(InputStream in, Charset charset) {
try (BEParser parser = new BEParser(in)) {
return handleResponse(parser, charset);
} catch (Exception e) {
return TrackerResponse.exceptional(e);
}
}
public ... |
TrackerResponse trackerResponse = responseHandler.handleResponse(
HttpResponseHandlerTest.class.getResourceAsStream("tracker_response_failure1"), defaultCharset);
assertNotNull(trackerResponse);
assertFalse(trackerResponse.isSuccess());
assertFalse(trackerResponse.getEr... | [FOCAL] public TrackerResponse HttpResponseHandler.handleResponse(InputStream in, Charset charset)
[CLASS] class HttpResponseHandler
[METRICS] loc=7 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] TrackerResponse handleResponse(byte[] bytes, Charset charset)
[CALLS-EXTERNAL] TrackerResponse.except... | /* static context
[FOCAL] public TrackerResponse HttpResponseHandler.handleResponse(InputStream in, Charset charset)
[PATH1] try-body throws -> return TrackerResponse.exceptional(e)
[PATH2] return handleResponse(parser, charset)
[INPUTS] branches=- | result=charset, in
[EXCEPTIONS] catches Exception e
[CALLS-INTERNAL] ... | /* static context
[FOCAL] public TrackerResponse HttpResponseHandler.handleResponse(InputStream in, Charset charset)
[PATH1] try-body throws -> return TrackerResponse.exceptional(e)
[PATH2] return handleResponse(parser, charset)
[INPUTS] branches=- | result=charset, in
[EXCEPTIONS] catches Exception e
[CALLS-INTERNAL] ... | true | ok | {"focal": {"class": "HttpResponseHandler", "name": "handleResponse", "signature": "TrackerResponse handleResponse(InputStream in, Charset charset)", "start_line": 3, "modifiers": "public", "params": [{"name": "in", "type": "InputStream"}, {"name": "charset", "type": "Charset"}], "return_type": "TrackerResponse"}, "clas... |
58921823_374 | class SchedulerThriftInterface implements AnnotatedAuroraAdmin {
@Override
public Response createJob(JobConfiguration mutableJob) {
SanitizedConfiguration sanitized;
try {
sanitized = SanitizedConfiguration.fromUnsanitized(
configurationManager,
IJobConfiguration.build(mutableJob)... | TaskConfig task = new TaskConfig()
.setContactEmail("testing@twitter.com")
.setExecutorConfig(new ExecutorConfig("aurora", "config")) // Arbitrary opaque data.
.setNumCpus(1.0)
.setRamMb(1024)
.setDiskMb(1024)
.setIsService(true)
.setProduction(true)
... | [FOCAL] @Override public Response SchedulerThriftInterface.createJob(JobConfiguration mutableJob)
[CLASS] class SchedulerThriftInterface implements AnnotatedAuroraAdmin
[METRICS] loc=45 cc=3 branches=1 loops=0 returns=3 throws=0 nesting=1
[CALLS-INTERNAL] void checkJobExists(StoreProvider store, IJobKey jobKey); void v... | class SchedulerThriftInterface implements AnnotatedAuroraAdmin {
@Override
public Response createJob(JobConfiguration mutableJob) {
SanitizedConfiguration sanitized;
try {
sanitized = SanitizedConfiguration.fromUnsanitized(
configurationManager,
IJobConfiguration.build(mutableJob)... | false | ok | {"focal": {"class": "SchedulerThriftInterface", "name": "createJob", "signature": "Response createJob(JobConfiguration mutableJob)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "mutableJob", "type": "JobConfiguration"}], "return_type": "Response"}, "class_info": {"name": "SchedulerThriftInterf... | |
58940073_8 | class Validator extends AbstractGltfValidator {
public ValidatorResult validate()
{
validateAsset();
ValidatorContext context = new ValidatorContext("glTF");
ValidatorResult validatorResult = new ValidatorResult();
validatorResult.add(validateScenes(context));
... | GlTF gltf = new GlTF();
Scene scene = new Scene();
scene.addNodes("INVALID_ID");
gltf.addScenes("scene0", scene);
Validator validator = new Validator(gltf);
ValidatorResult validatorResult = validator.validate();
assertEquals(1, validatorResult.getErrors(... | [FOCAL] public ValidatorResult Validator.validate()
[CLASS] class Validator extends AbstractGltfValidator
[METRICS] loc=20 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] ValidatorResult validateAccessors(ValidatorContext currentContext); ValidatorResult validateBufferViews(ValidatorContext curren... | /* static context
[FOCAL] public ValidatorResult Validator.validate()
[CALLS-INTERNAL] ValidatorResult validateAccessors(ValidatorContext currentContext); ValidatorResult validateBufferViews(ValidatorContext currentContext); ValidatorResult validateMaterials(ValidatorContext currentContext); ValidatorResult validateMes... | /* static context
[FOCAL] public ValidatorResult Validator.validate()
[CALLS-INTERNAL] ValidatorResult validateAccessors(ValidatorContext currentContext); ValidatorResult validateBufferViews(ValidatorContext currentContext); ValidatorResult validateMaterials(ValidatorContext currentContext); ValidatorResult validateMes... | true | ok | {"focal": {"class": "Validator", "name": "validate", "signature": "ValidatorResult validate()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "ValidatorResult"}, "class_info": {"name": "Validator", "kind": "class", "modifiers": "", "superclass": "AbstractGltfValidator", "interfaces": null, "field... |
58952547_5 | class MovieDetailsPresenter implements MovieDetailsMVP.Presenter {
@Override
public void startPresenting(final MovieDetailsMVP.View movieDetailsView, long movieId) {
MovieDetails movieDetails = movieDetailsUseCase.getMovieDetails();
if (movieDetails != null) {
movieDetailsView.displ... | Exception exception = new Exception();
when(movieDetailsUseCase.getMovieDetails()).thenReturn(null);
ArgumentCaptor<MovieDetailsUseCase.Listener> listenerCapture = ArgumentCaptor.forClass(MovieDetailsUseCase.Listener.class);
presenter.startPresenting(view, ANY_MOVIE_ID);
verify(... | [FOCAL] @Override public void MovieDetailsPresenter.startPresenting(MovieDetailsMVP.View movieDetailsView, long movieId)
[CLASS] class MovieDetailsPresenter implements MovieDetailsMVP.Presenter
[METRICS] loc=22 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] MovieDetailsUseCase.getMovieDetails/0, ... | /* static context
[FOCAL] @Override public void MovieDetailsPresenter.startPresenting(MovieDetailsMVP.View movieDetailsView, long movieId)
[PATH1] if(movieDetails != null)=T
[PATH2] if(movieDetails != null)=F
[INPUTS] branches=movieDetailsUseCase | result=-
[COLLABORATORS] field movieDetailsUseCase:MovieDetailsUseCase ... | /* static context
[FOCAL] @Override public void MovieDetailsPresenter.startPresenting(MovieDetailsMVP.View movieDetailsView, long movieId)
[PATH1] if(movieDetails != null)=T
[PATH2] if(movieDetails != null)=F
[INPUTS] branches=movieDetailsUseCase | result=-
[COLLABORATORS] field movieDetailsUseCase:MovieDetailsUseCase ... | true | ok | {"focal": {"class": "MovieDetailsPresenter", "name": "startPresenting", "signature": "void startPresenting(MovieDetailsMVP.View movieDetailsView, long movieId)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "movieDetailsView", "type": "MovieDetailsMVP.View"}, {"name": "movieId", "type": "long"}... |
58955752_148 | class StopWord {
public String removeTrailing(String text) {
List<String> textList = Arrays.asList(text.split("\\s"));
List<String> result = removeTrailing(textList);
return Joiner.on(" ").join(result);
}
public StopWord(Path file);
public StopWord(Path file, Charset charset);
public void caseSensitive(... | assertArrayEquals(stopword.removeTrailing(new String[] { "the", "mountain", "the" }),
new String[] { "the", "mountain" });
}
} | [FOCAL] public String StopWord.removeTrailing(String text)
[CLASS] class StopWord
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String[] removeTrailing(String... text)
[CALLS-EXTERNAL] Arrays.asList/1, String.split/1, Joiner.on(" ").join/1, Joiner.on/1
[INPUTS] branches=- | resul... | /* static context
[FOCAL] public String StopWord.removeTrailing(String text)
[INPUTS] branches=- | result=text
[CALLS-INTERNAL] String[] removeTrailing(String... text)
[CALLS-EXTERNAL] Arrays.asList/1, String.split/1, Joiner.on(" ").join/1, Joiner.on/1
*/
| /* static context
[FOCAL] public String StopWord.removeTrailing(String text)
[INPUTS] branches=- | result=text
[CALLS-INTERNAL] String[] removeTrailing(String... text)
[CALLS-EXTERNAL] Arrays.asList/1, String.split/1, Joiner.on(" ").join/1, Joiner.on/1
*/
class StopWord {
public String removeTrailing(String text) {
... | true | ok | {"focal": {"class": "StopWord", "name": "removeTrailing", "signature": "String removeTrailing(String text)", "start_line": 3, "modifiers": "public", "params": [{"name": "text", "type": "String"}], "return_type": "String"}, "class_info": {"name": "StopWord", "kind": "class", "modifiers": "", "superclass": null, "interfa... |
58972818_285 | class AssociateIdentifiersEvent extends Event {
@Override
public boolean isValid() {
boolean isValid = true;
if (ids.size() > AssociatedIdentifiers.MAX_IDS) {
Logger.error("Associated identifiers exceeds %s", AssociatedIdentifiers.MAX_IDS);
isValid = false;
}
... | Map<String, String> ids = new HashMap<>();
for (int i = 0; i < 101; i++) {
ids.put(UUID.randomUUID().toString(), "value");
}
// Verify its invalid
assertFalse(new AssociateIdentifiersEvent(new AssociatedIdentifiers(ids)).isValid());
}
} | [FOCAL] @Override public boolean AssociateIdentifiersEvent.isValid()
[CLASS] class AssociateIdentifiersEvent extends Event
[METRICS] loc=23 cc=5 branches=3 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] ids.size/0, Logger.error/2, ids.entrySet/0, entry.getKey().length/0, Map.Entry<String, String>.getKey/0, Logge... | /* static context
[FOCAL] @Override public boolean AssociateIdentifiersEvent.isValid()
[PATH1] if(ids.size() > AssociatedIdentifiers.MAX_IDS)=T -> foreach(Map.Entry<String, String> entry : ids.entrySet())=T -> if(entry.getKey().length() > AssociatedIdentifiers.MAX_CHARACTER_COUNT)=T -> if(entry.getValue().length() > As... | /* static context
[FOCAL] @Override public boolean AssociateIdentifiersEvent.isValid()
[PATH1] if(ids.size() > AssociatedIdentifiers.MAX_IDS)=T -> foreach(Map.Entry<String, String> entry : ids.entrySet())=T -> if(entry.getKey().length() > AssociatedIdentifiers.MAX_CHARACTER_COUNT)=T -> if(entry.getValue().length() > As... | true | ok | {"focal": {"class": "AssociateIdentifiersEvent", "name": "isValid", "signature": "boolean isValid()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "boolean"}, "class_info": {"name": "AssociateIdentifiersEvent", "kind": "class", "modifiers": "", "superclass": "Event", "interfaces": null... |
59044564_1496 | class DataStorage extends Storage {
void recoverTransitionRead(DataNode datanode, NamespaceInfo nsInfo,
Collection<StorageLocation> dataDirs, StartupOption startOpt) throws IOException {
if (this.initialized) {
LOG.info("DataNode version: " + HdfsConstants.DATANODE_LAYOUT_VERSION
+ " and Na... | final int numLocations = 3;
List<StorageLocation> locations = createStorageLocations(numLocations);
// Prepare volumes
storage.recoverTransitionRead(mockDN, nsInfo, locations, START_OPT);
assertEquals(numLocations, storage.getNumStorageDirs());
// Reset DataStorage
storage.unlockAll();
... | [FOCAL] void DataStorage.recoverTransitionRead(DataNode datanode, NamespaceInfo nsInfo, Collection<StorageLocation> dataDirs, StartupOption startOpt)
[CLASS] class DataStorage extends Storage
[METRICS] loc=14 cc=3 branches=2 loops=0 returns=0 throws=1 nesting=1
[CALLS-INTERNAL] List<StorageLocation> addStorageLocations... | /* static context
[FOCAL] void DataStorage.recoverTransitionRead(DataNode datanode, NamespaceInfo nsInfo, Collection<StorageLocation> dataDirs, StartupOption startOpt)
[THROWS-WHEN] IOException when this.initialized && addStorageLocations(datanode, nsInfo, dataDirs, startOpt).isEmpty()
[THROWS-WHEN] IOException when !t... | /* static context
[FOCAL] void DataStorage.recoverTransitionRead(DataNode datanode, NamespaceInfo nsInfo, Collection<StorageLocation> dataDirs, StartupOption startOpt)
[THROWS-WHEN] IOException when this.initialized && addStorageLocations(datanode, nsInfo, dataDirs, startOpt).isEmpty()
[THROWS-WHEN] IOException when !t... | true | ok | {"focal": {"class": "DataStorage", "name": "recoverTransitionRead", "signature": "void recoverTransitionRead(DataNode datanode, NamespaceInfo nsInfo, Collection<StorageLocation> dataDirs, StartupOption startOpt) throws IOException", "start_line": 3, "modifiers": "", "params": [{"name": "datanode", "type": "DataNode"}, ... |
59064722_9 | class EventDispatcher {
public CompletableFuture<?> dispatch(DispatchedEvent<Event> de) {
EventHandler eventHandler = eventTypesAndHandlers.get(de.getEventType());
if (eventHandler != null) {
CompletableFuture<Object> result = new CompletableFuture<>();
dispatchEvent(de, eventHandler, result, Opt... |
whenEventHandlerDispatchReturning(CompletableFutureUtil.failedFuture(exception), CompletableFuture.completedFuture(null));
EventDeliveryExceptionHandlerWithState eventDeliveryExceptionHandlerWithState = mock(EventDeliveryExceptionHandlerWithState.class);
when(exceptionHandlerManager.getEventHandler(excep... | [FOCAL] public CompletableFuture<?> EventDispatcher.dispatch(DispatchedEvent<Event> de)
[CLASS] class EventDispatcher
[METRICS] loc=14 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] void dispatchEvent(DispatchedEvent<Event> de, EventHandler eventHandler, CompletableFuture<Object> result, Optional... | /* static context
[FOCAL] public CompletableFuture<?> EventDispatcher.dispatch(DispatchedEvent<Event> de)
[PATH1] if(eventHandler != null)=T -> return result
[PATH2] if(eventHandler != null)=F -> return completableFuture
[INPUTS] branches=de | result=-
[COLLABORATORS] field eventTypesAndHandlers get/1; param de:Dispatc... | /* static context
[FOCAL] public CompletableFuture<?> EventDispatcher.dispatch(DispatchedEvent<Event> de)
[PATH1] if(eventHandler != null)=T -> return result
[PATH2] if(eventHandler != null)=F -> return completableFuture
[INPUTS] branches=de | result=-
[COLLABORATORS] field eventTypesAndHandlers get/1; param de:Dispatc... | true | ok | {"focal": {"class": "EventDispatcher", "name": "dispatch", "signature": "CompletableFuture<?> dispatch(DispatchedEvent<Event> de)", "start_line": 3, "modifiers": "public", "params": [{"name": "de", "type": "DispatchedEvent<Event>"}], "return_type": "CompletableFuture<?>"}, "class_info": {"name": "EventDispatcher", "kin... |
59078087_56 | class JobCoder {
JobInvocation decodeIntentBundle(@NonNull Bundle bundle) {
if (bundle == null) {
Log.e(TAG, "Unexpected null Bundle provided");
return null;
}
Bundle taskExtras = bundle.getBundle(GooglePlayJobWriter.REQUEST_PARAM_EXTRAS);
if (taskExtras == null) {
return null;
... | Bundle bundle = new Bundle();
ContentUriTrigger uriTrigger = getContentUriTrigger();
Bundle encode = encodeContentUriJob(uriTrigger, coder);
bundle.putBundle(GooglePlayJobWriter.REQUEST_PARAM_EXTRAS, encode);
ArrayList<Uri> uris = new ArrayList<>();
uris.add(ContactsContract.AUTHORITY_URI);
... | [FOCAL] JobInvocation JobCoder.decodeIntentBundle(Bundle bundle)
[CLASS] class JobCoder
[METRICS] loc=20 cc=4 branches=3 loops=0 returns=3 throws=0 nesting=1
[CALLS-INTERNAL] JobInvocation.Builder decode(Bundle providedBundle)
[CALLS-EXTERNAL] Log.e/2, Bundle.getBundle/1, Bundle.getParcelableArrayList/1, JobInvocation.... | /* static context
[FOCAL] JobInvocation JobCoder.decodeIntentBundle(Bundle bundle)
[PATH1] if(bundle == null)=F -> if(taskExtras == null)=F -> if(triggeredContentUris != null)=T -> return builder.build()
[PATH2] if(bundle == null)=T -> return null
[PATH3] if(bundle == null)=F -> if(taskExtras == null)=T -> return null
... | /* static context
[FOCAL] JobInvocation JobCoder.decodeIntentBundle(Bundle bundle)
[PATH1] if(bundle == null)=F -> if(taskExtras == null)=F -> if(triggeredContentUris != null)=T -> return builder.build()
[PATH2] if(bundle == null)=T -> return null
[PATH3] if(bundle == null)=F -> if(taskExtras == null)=T -> return null
... | true | ok | {"focal": {"class": "JobCoder", "name": "decodeIntentBundle", "signature": "JobInvocation decodeIntentBundle(Bundle bundle)", "start_line": 3, "modifiers": "", "params": [{"name": "bundle", "type": "Bundle"}], "return_type": "JobInvocation"}, "class_info": {"name": "JobCoder", "kind": "class", "modifiers": "", "supercl... |
59134921_5 | class Logo {
@Nullable
public static String getUriFromSvgUri(@Nullable String iconUrl, int width, int height) {
if (iconUrl == null || iconUrl.isEmpty()) {
return null;
}
final Matcher matcher = LOGOS_REGEX.matcher(iconUrl);
if (!matcher.matches()) {
retu... | assertNull("Should retrun null when the SvgLogoUrl is null", Logo.getUriFromSvgUri(null, 150, 150));
assertNull("Should return null when the url doesn't contain $.svg",
Logo.getUriFromSvgUri("abc", 150, 150));
final String inputUrl = "https://cdn.cliqz.com/brands-database/databas... | [FOCAL] @Nullable public static String Logo.getUriFromSvgUri(String iconUrl, int width, int height)
[CLASS] class Logo
[METRICS] loc=14 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[CALLS-EXTERNAL] String.isEmpty/0, LOGOS_REGEX.matcher/1, Matcher.matches/0, Math.max/2, LogoSizes.getSize/1, String.format/5, Matc... | /* static context
[FOCAL] @Nullable public static String Logo.getUriFromSvgUri(String iconUrl, int width, int height)
[PATH1] if(iconUrl == null || iconUrl.isEmpty())=F -> if(!matcher.matches())=T -> return null
[PATH2] if(iconUrl == null || iconUrl.isEmpty())=F -> if(!matcher.matches())=F -> return String.format(Local... | /* static context
[FOCAL] @Nullable public static String Logo.getUriFromSvgUri(String iconUrl, int width, int height)
[PATH1] if(iconUrl == null || iconUrl.isEmpty())=F -> if(!matcher.matches())=T -> return null
[PATH2] if(iconUrl == null || iconUrl.isEmpty())=F -> if(!matcher.matches())=F -> return String.format(Local... | true | ok | {"focal": {"class": "Logo", "name": "getUriFromSvgUri", "signature": "String getUriFromSvgUri(String iconUrl, int width, int height)", "start_line": 3, "modifiers": "@Nullable public static", "params": [{"name": "iconUrl", "type": "String"}, {"name": "width", "type": "int"}, {"name": "height", "type": "int"}], "return_... |
59199640_2 | class OrderedContentTypeDetector implements ContentTypeDetector {
@Override
public FilterEngine.ContentType detect(final WebResourceRequest request)
{
FilterEngine.ContentType contentType;
for (final ContentTypeDetector detector : detectors)
{
contentType = detector.detect(request);
// ... | final OrderedContentTypeDetector regexFirst = new OrderedContentTypeDetector(
new UrlFileExtensionTypeDetector(),
new HeadersContentTypeDetector()
);
final OrderedContentTypeDetector headersFirst = new OrderedContentTypeDetector(
new HeadersContentTypeDetector(),
new UrlFileE... | [FOCAL] @Override public FilterEngine.ContentType OrderedContentTypeDetector.detect(WebResourceRequest request)
[CLASS] class OrderedContentTypeDetector implements ContentTypeDetector
[METRICS] loc=21 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] ContentTypeDetector.detect/1
[PATH1] foreach(Cont... | /* static context
[FOCAL] @Override public FilterEngine.ContentType OrderedContentTypeDetector.detect(WebResourceRequest request)
[PATH1] foreach(ContentTypeDetector detector : detectors)=T -> if(contentType != null)=F -> exit loop -> return null
[PATH2] foreach(ContentTypeDetector detector : detectors)=T -> if(content... | /* static context
[FOCAL] @Override public FilterEngine.ContentType OrderedContentTypeDetector.detect(WebResourceRequest request)
[PATH1] foreach(ContentTypeDetector detector : detectors)=T -> if(contentType != null)=F -> exit loop -> return null
[PATH2] foreach(ContentTypeDetector detector : detectors)=T -> if(content... | true | ok | {"focal": {"class": "OrderedContentTypeDetector", "name": "detect", "signature": "FilterEngine.ContentType detect(WebResourceRequest request)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "WebResourceRequest"}], "return_type": "FilterEngine.ContentType"}, "class_info": {"nam... |
59326989_167 | class LoopStep extends RefactorStep implements ProvidesValidations {
@Override
public Set<Step> refactor(Set<Step> steps) {
// The rows that the loop iterates over
List<Row> iterationRows = getIterationRows(steps);
// The mode that the loop runs as, either 'parallel' or 'serial'
String mode = ... | Set<Step> steps = Sets.newHashSet();
Map<String, Object> loopStepConfigMap = Maps.newHashMap();
loopStepConfigMap.put(LoopStep.MODE_PROPERTY, LoopStep.MODE_PARALLEL);
loopStepConfigMap.put(LoopStep.SOURCE_PROPERTY, LoopStep.SOURCE_RANGE);
loopStepConfigMap.put(LoopStep.RANGE_START_PROPERTY, 5);
... | [FOCAL] @Override public Set<Step> LoopStep.refactor(Set<Step> steps)
[CLASS] class LoopStep extends RefactorStep implements ProvidesValidations
[METRICS] loc=115 cc=17 branches=5 loops=11 returns=1 throws=0 nesting=5
[CALLS-INTERNAL] Config performSubstitutions(Config c, Row row); List<Row> getIterationRows(Set<Step> ... | class LoopStep extends RefactorStep implements ProvidesValidations {
@Override
public Set<Step> refactor(Set<Step> steps) {
// The rows that the loop iterates over
List<Row> iterationRows = getIterationRows(steps);
// The mode that the loop runs as, either 'parallel' or 'serial'
String mode = ... | false | ok | {"focal": {"class": "LoopStep", "name": "refactor", "signature": "Set<Step> refactor(Set<Step> steps)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "steps", "type": "Set<Step>"}], "return_type": "Set<Step>"}, "class_info": {"name": "LoopStep", "kind": "class", "modifiers": "", "superclass": "R... | |
59412136_1 | class Driver implements java.sql.Driver {
public boolean acceptsProperties(Properties info) throws SQLException {
return Utility.validateRiakProperties( info );
}
public Connection connect(String url, Properties info);
public boolean acceptsURL(String url);
public int getMajorVersion();
public int getMinorVer... | Properties info = new Properties();
info.setProperty("RiakUrl", "127.0.0.1");
info.setProperty("RiakPort", "8087");
assertTrue( _driver.acceptsProperties(info) );
}
} | [FOCAL] public boolean Driver.acceptsProperties(Properties info)
[CLASS] class Driver implements java.sql.Driver
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Utility.validateRiakProperties/1
[EXCEPTIONS] declares SQLException
[INPUTS] branches=- | result=info
[DATAFLOW] info@par... | /* static context
[FOCAL] public boolean Driver.acceptsProperties(Properties info)
[INPUTS] branches=- | result=info
[EXCEPTIONS] declares SQLException
[CALLS-EXTERNAL] Utility.validateRiakProperties/1
*/
| /* static context
[FOCAL] public boolean Driver.acceptsProperties(Properties info)
[INPUTS] branches=- | result=info
[EXCEPTIONS] declares SQLException
[CALLS-EXTERNAL] Utility.validateRiakProperties/1
*/
class Driver implements java.sql.Driver {
public boolean acceptsProperties(Properties info) throws SQLException {... | true | ok | {"focal": {"class": "Driver", "name": "acceptsProperties", "signature": "boolean acceptsProperties(Properties info) throws SQLException", "start_line": 3, "modifiers": "public", "params": [{"name": "info", "type": "Properties"}], "return_type": "boolean"}, "class_info": {"name": "Driver", "kind": "class", "modifiers": ... |
59419011_1 | class ConnectorNov2016 implements Connector {
@Override public Decoder.Response get(String caller, Transport.Target target,
Pager pager, Map<String, ?> parameters) throws InterruptedException
{
String id = UUID.randomUUID().toString();
Encoder.Request request = encoder.get(caller, target, pager, parame... | Transport.Factory factory = Transport.defaultFactory();
Responder south = new DefaultResponder()
{
@Override public Response first(String state, Decoder.Pager p,
Decoder.Parameters ps, Transport.Target t)
{
return DefaultResponse.fromData(
merge(new HashMap<>(), Bank.ba... | [FOCAL] @Override public Decoder.Response ConnectorNov2016.get(String caller, Transport.Target target, Pager pager, Map<String, ?> parameters)
[CLASS] class ConnectorNov2016 implements Connector
[METRICS] loc=48 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] UUID.randomUUID().toString/0, UUID.ran... | /* static context
[FOCAL] @Override public Decoder.Response ConnectorNov2016.get(String caller, Transport.Target target, Pager pager, Map<String, ?> parameters)
[PATH1] if(pager.count() == decoded.count())=T -> return decoded
[PATH2] if(pager.count() == decoded.count())=F -> return new Decoder.Response() { @Override pu... | /* static context
[FOCAL] @Override public Decoder.Response ConnectorNov2016.get(String caller, Transport.Target target, Pager pager, Map<String, ?> parameters)
[PATH1] if(pager.count() == decoded.count())=T -> return decoded
[PATH2] if(pager.count() == decoded.count())=F -> return new Decoder.Response() { @Override pu... | true | ok | {"focal": {"class": "ConnectorNov2016", "name": "get", "signature": "Decoder.Response get(String caller, Transport.Target target, Pager pager, Map<String, ?> parameters) throws InterruptedException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "caller", "type": "String"}, {"name": "target", "t... |
59504997_948 | class AclTransformation {
public static List<AclEntry> filterAclEntriesByAclSpec(
List<AclEntry> existingAcl, List<AclEntry> inAclSpec) throws AclException {
ValidatedAclSpec aclSpec = new ValidatedAclSpec(inAclSpec);
ArrayList<AclEntry> aclBuilder = Lists.newArrayListWithCapacity(MAX_ENTRIES);
Enu... | List<AclEntry> existing = new ImmutableList.Builder<AclEntry>()
.add(aclEntry(ACCESS, USER, ALL))
.add(aclEntry(ACCESS, USER, "bruce", READ_WRITE))
.add(aclEntry(ACCESS, GROUP, READ))
.add(aclEntry(ACCESS, MASK, ALL))
.add(aclEntry(ACCESS, OTHER, READ))
.add(aclEntry(DEFAULT, USE... | [FOCAL] public static List<AclEntry> AclTransformation.filterAclEntriesByAclSpec(List<AclEntry> existingAcl, List<AclEntry> inAclSpec)
[CLASS] class AclTransformation
[METRICS] loc=26 cc=5 branches=3 loops=1 returns=1 throws=0 nesting=3
[CALLS-INTERNAL] List<AclEntry> buildAndValidateAcl(ArrayList<AclEntry> aclBuilder)... | /* static context
[FOCAL] public static List<AclEntry> AclTransformation.filterAclEntriesByAclSpec(List<AclEntry> existingAcl, List<AclEntry> inAclSpec)
[PATH1] foreach(AclEntry existingEntry : existingAcl)=T -> if(aclSpec.containsKey(existingEntry))=T -> if(existingEntry.getType() == MASK)#1=T -> exit loop -> return b... | /* static context
[FOCAL] public static List<AclEntry> AclTransformation.filterAclEntriesByAclSpec(List<AclEntry> existingAcl, List<AclEntry> inAclSpec)
[PATH1] foreach(AclEntry existingEntry : existingAcl)=T -> if(aclSpec.containsKey(existingEntry))=T -> if(existingEntry.getType() == MASK)#1=T -> exit loop -> return b... | true | ok | {"focal": {"class": "AclTransformation", "name": "filterAclEntriesByAclSpec", "signature": "List<AclEntry> filterAclEntriesByAclSpec(List<AclEntry> existingAcl, List<AclEntry> inAclSpec) throws AclException", "start_line": 3, "modifiers": "public static", "params": [{"name": "existingAcl", "type": "List<AclEntry>"}, {"... |
59521369_5 | class Easter {
static LocalDate sundayFor(Year year) {
final int y = year.getValue();
final int a = y % 19;
final int b = y / 100;
final int c = y % 100;
final int d = b / 4;
final int e = b % 4;
final int f = (b + 8) / 25;
final int g = (b - f + 1) / 3;
final int h = (19 * a + b - d - g + 15) % 30;... | assertThat(Easter.sundayFor(Year.of(year))).isEqualTo(easterDate.atYear(year));
}
} | [FOCAL] static LocalDate Easter.sundayFor(Year year)
[CLASS] class Easter
[METRICS] loc=18 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Year.getValue/0, LocalDate.of/3
[INPUTS] branches=- | result=year
[COLLABORATORS] param year:Year getValue/0
[DATAFLOW] a@L3->L10,L14; b@L4->L6,L7,L8,L9,L10; c... | /* static context
[FOCAL] static LocalDate Easter.sundayFor(Year year)
[INPUTS] branches=- | result=year
[COLLABORATORS] param year:Year getValue/0
[CALLS-EXTERNAL] Year.getValue/0, LocalDate.of/3
*/
| /* static context
[FOCAL] static LocalDate Easter.sundayFor(Year year)
[INPUTS] branches=- | result=year
[COLLABORATORS] param year:Year getValue/0
[CALLS-EXTERNAL] Year.getValue/0, LocalDate.of/3
*/
class Easter {
static LocalDate sundayFor(Year year) {
final int y = year.getValue();
final int a = y % 19;
fina... | true | ok | {"focal": {"class": "Easter", "name": "sundayFor", "signature": "LocalDate sundayFor(Year year)", "start_line": 3, "modifiers": "static", "params": [{"name": "year", "type": "Year"}], "return_type": "LocalDate"}, "class_info": {"name": "Easter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, ... |
59553354_0 | class DefaultGreeter implements Greeter {
public String greet(final String name)
{
return "Hello " + name;
}
}
class DefaultGreeterTest {
@Test
public void testGreet()
{
| final Greeter greeter = new DefaultGreeter();
Assert.assertEquals("Hello foo", greeter.greet("foo"));
Assert.assertEquals("Hello bar", greeter.greet("bar"));
}
} | [FOCAL] public String DefaultGreeter.greet(String name)
[CLASS] class DefaultGreeter implements Greeter
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[INPUTS] branches=- | result=name
[DATAFLOW] name@param->L3
[TEST] DefaultGreeterTest: @Test public void testGreet() | /* static context
[FOCAL] public String DefaultGreeter.greet(String name)
[INPUTS] branches=- | result=name
*/
| /* static context
[FOCAL] public String DefaultGreeter.greet(String name)
[INPUTS] branches=- | result=name
*/
class DefaultGreeter implements Greeter {
public String greet(final String name)
{
return "Hello " + name;
}
}
class DefaultGreeterTest {
@Test
public void testGreet()
{
| true | ok | {"focal": {"class": "DefaultGreeter", "name": "greet", "signature": "String greet(String name)", "start_line": 3, "modifiers": "public", "params": [{"name": "name", "type": "String"}], "return_type": "String"}, "class_info": {"name": "DefaultGreeter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": ... |
59553587_0 | class TaskMapper {
public static TaskModel transform(TaskEntity taskEntity) {
TaskModel taskModel = null;
if (taskEntity != null) {
taskModel = new TaskModel(taskEntity.getTitle());
taskModel.setId(taskEntity.getId());
taskModel.setDeadline(taskEntity.getDeadline... | TaskEntity taskEntity = createEntity();
TaskModel taskModel = TaskMapper.transform(taskEntity);
assertThat(taskModel, is(instanceOf(TaskModel.class)));
assertThat(taskModel.getId(), is(FAKE_TASK_ID));
assertThat(taskModel.getTitle(), is(FAKE_TASK_TITLE));
assertThat(taskModel.getDeadlineMs()).i... | [FOCAL] public static TaskModel TaskMapper.transform(TaskEntity taskEntity)
[CLASS] class TaskMapper
[METRICS] loc=13 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] TaskEntity.getTitle/0, TaskModel.setId/1, TaskEntity.getId/0, TaskModel.setDeadline/1, TaskEntity.getDeadline/0, TaskModel.setTag/1,... | /* static context
[FOCAL] public static TaskModel TaskMapper.transform(TaskEntity taskEntity)
[PATH1] if(taskEntity != null)=T -> return taskModel
[PATH2] if(taskEntity != null)=F -> return taskModel
[INPUTS] branches=taskEntity | result=taskEntity
[COLLABORATORS] param taskEntity:TaskEntity getTitle/0,getId/0,getDeadl... | /* static context
[FOCAL] public static TaskModel TaskMapper.transform(TaskEntity taskEntity)
[PATH1] if(taskEntity != null)=T -> return taskModel
[PATH2] if(taskEntity != null)=F -> return taskModel
[INPUTS] branches=taskEntity | result=taskEntity
[COLLABORATORS] param taskEntity:TaskEntity getTitle/0,getId/0,getDeadl... | true | ok | {"focal": {"class": "TaskMapper", "name": "transform", "signature": "TaskModel transform(TaskEntity taskEntity)", "start_line": 3, "modifiers": "public static", "params": [{"name": "taskEntity", "type": "TaskEntity"}], "return_type": "TaskModel"}, "class_info": {"name": "TaskMapper", "kind": "class", "modifiers": "", "... |
59571413_99 | class Container {
public Iterable<V> getValues() {
return this.valueByKey.values();
}
public Container(final Logger logger);
public void setMode(final Mode mode);
public boolean add(final K key, final V value);
public void debug();
public void freeze();
public V get(final K k... | Assert.assertFalse(this.container.getValues().iterator().hasNext());
}
} | [FOCAL] public Iterable<V> Container.getValues()
[CLASS] class Container
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] this.valueByKey.values/0
[FIELDS] read=valueByKey
[COLLABORATORS] field valueByKey values/0
[CLASS-MEMBERS] Container(Logger logger); void setMode(Mode mode); bo... | /* static context
[FOCAL] public Iterable<V> Container.getValues()
[COLLABORATORS] field valueByKey values/0
[FIELDS] read=valueByKey
[CALLS-EXTERNAL] this.valueByKey.values/0
*/
| /* static context
[FOCAL] public Iterable<V> Container.getValues()
[COLLABORATORS] field valueByKey values/0
[FIELDS] read=valueByKey
[CALLS-EXTERNAL] this.valueByKey.values/0
*/
class Container {
public Iterable<V> getValues() {
return this.valueByKey.values();
}
public Container(final Logger lo... | true | ok | {"focal": {"class": "Container", "name": "getValues", "signature": "Iterable<V> getValues()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Iterable<V>"}, "class_info": {"name": "Container", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "container"... |
59681438_17 | class SamplesParser {
public static List<CodeSample> getSamples(final File[] files,
final String targetExtension) throws Exception {
if (files == null) {
throw new SampleParsingException(
"Must provide a non-null set of files to parse");
}
List<C... | File sampleFile = getSampleFile("NoContentSample.java");
assertTrue(SamplesParser.getSamples(sampleFile).isEmpty());
}
} | [FOCAL] public static List<CodeSample> SamplesParser.getSamples(File[] files, String targetExtension)
[CLASS] class SamplesParser
[METRICS] loc=11 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-INTERNAL] void parseFiles(File[] files, String targetExtension, List<CodeSample> samples)
[NEW] SampleParsingExce... | /* static context
[FOCAL] public static List<CodeSample> SamplesParser.getSamples(File[] files, String targetExtension)
[THROWS-WHEN] SampleParsingException when files == null
[PATH1] if(files == null)=T -> throw new SampleParsingException( "Must provide a non-null set of files t...
[PATH2] if(files == null)=F -> retur... | /* static context
[FOCAL] public static List<CodeSample> SamplesParser.getSamples(File[] files, String targetExtension)
[THROWS-WHEN] SampleParsingException when files == null
[PATH1] if(files == null)=T -> throw new SampleParsingException( "Must provide a non-null set of files t...
[PATH2] if(files == null)=F -> retur... | true | ok | {"focal": {"class": "SamplesParser", "name": "getSamples", "signature": "List<CodeSample> getSamples(File[] files, String targetExtension) throws Exception", "start_line": 3, "modifiers": "public static", "params": [{"name": "files", "type": "File[]"}, {"name": "targetExtension", "type": "String"}], "return_type": "Lis... |
59703501_2 | class FetcherDefault extends AbstractExtensionPoint implements Fetcher, Function<Resource, FetchedData> {
@Override
public Iterator<FetchedData> fetch(Iterator<Resource> resources) throws Exception {
return new StreamTransformer<>(resources, this);
}
public FetcherDefault();
@Override pu... | Iterator<FetchedData> stream = fetcher.fetch(resources.iterator());
List<FetchedData> list = new ArrayList<>();
stream.forEachRemaining(list::add);
assertEquals(list.size(), resources.size());
for (FetchedData data : list) {
if (data.getResource().getUrl().contains("... | [FOCAL] @Override public Iterator<FetchedData> FetcherDefault.fetch(Iterator<Resource> resources)
[CLASS] class FetcherDefault extends AbstractExtensionPoint implements Fetcher, Function<Resource, FetchedData>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] StreamTransformer<>
[EXCEPTIONS] de... | /* static context
[FOCAL] @Override public Iterator<FetchedData> FetcherDefault.fetch(Iterator<Resource> resources)
[INPUTS] branches=- | result=resources
[EXCEPTIONS] declares Exception
[NEW] StreamTransformer<>
*/
| /* static context
[FOCAL] @Override public Iterator<FetchedData> FetcherDefault.fetch(Iterator<Resource> resources)
[INPUTS] branches=- | result=resources
[EXCEPTIONS] declares Exception
[NEW] StreamTransformer<>
*/
class FetcherDefault extends AbstractExtensionPoint implements Fetcher, Function<Resource, FetchedData> ... | true | ok | {"focal": {"class": "FetcherDefault", "name": "fetch", "signature": "Iterator<FetchedData> fetch(Iterator<Resource> resources) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "resources", "type": "Iterator<Resource>"}], "return_type": "Iterator<FetchedData>"}, "class_info": {"na... |
59744695_73 | class FactoryBase {
@SuppressWarnings("unchecked")
void finalizeChildren() {
finalisedChildrenFlat = new ArrayList<>();
getFactoryMetadata().visitChildFactoriesAndViewsFlat(this, childUntyped->{
FactoryBase<?,R> child = (FactoryBase<?,R>)childUntyped;
if (child!=null){
... | ExampleFactoryA exampleFactoryA = new ExampleFactoryA();
ExampleFactoryB factory = new ExampleFactoryB();
exampleFactoryA.referenceAttribute.set(factory);
exampleFactoryA.referenceListAttribute.add(factory);
((FactoryBase<?, ?>)exampleFactoryA).finalizeChildren();
Asser... | [FOCAL] @SuppressWarnings("unchecked") void FactoryBase.finalizeChildren()
[CLASS] class FactoryBase
[METRICS] loc=17 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=2
[CALLS-INTERNAL] FactoryMetadata<R,FactoryBase<?,R>> getFactoryMetadata()
[CALLS-EXTERNAL] getFactoryMetadata().visitChildFactoriesAndViewsFlat/3, fi... | class FactoryBase {
@SuppressWarnings("unchecked")
void finalizeChildren() {
finalisedChildrenFlat = new ArrayList<>();
getFactoryMetadata().visitChildFactoriesAndViewsFlat(this, childUntyped->{
FactoryBase<?,R> child = (FactoryBase<?,R>)childUntyped;
if (child!=null){
... | false | ok | {"focal": {"class": "FactoryBase", "name": "finalizeChildren", "signature": "void finalizeChildren()", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\")", "params": [], "return_type": "void"}, "class_info": {"name": "FactoryBase", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "... | |
59800365_3 | class ProjectServiceImpl implements ProjectService {
@Override
public List<Team> getTeams() {
List<Team> teams = cacheClient.get(ServiceConstants.CACHE_KEY_TEAMS);
if (teams == null) {
teams = projectDao.getTeams();
cacheClient.set(ServiceConstants.CACHE_KEY_TEAMS, (Serializable) teams);
... | //TODO 修改该test case,先构建数据再恢复现场
// List<Team> teams = projectService.getTeams();
// Assert.assertEquals(4, teams.size());
}
} | [FOCAL] @Override public List<Team> ProjectServiceImpl.getTeams()
[CLASS] class ProjectServiceImpl implements ProjectService
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] cacheClient.get/1, projectDao.getTeams/0, cacheClient.set/2
[PATH1] if(teams == null)=T -> return teams
[PATH... | /* static context
[FOCAL] @Override public List<Team> ProjectServiceImpl.getTeams()
[PATH1] if(teams == null)=T -> return teams
[PATH2] if(teams == null)=F -> return teams
[COLLABORATORS] field cacheClient get/1,set/2; field projectDao getTeams/0
[CALLS-EXTERNAL] cacheClient.get/1, projectDao.getTeams/0, cacheClient.se... | /* static context
[FOCAL] @Override public List<Team> ProjectServiceImpl.getTeams()
[PATH1] if(teams == null)=T -> return teams
[PATH2] if(teams == null)=F -> return teams
[COLLABORATORS] field cacheClient get/1,set/2; field projectDao getTeams/0
[CALLS-EXTERNAL] cacheClient.get/1, projectDao.getTeams/0, cacheClient.se... | true | ok | {"focal": {"class": "ProjectServiceImpl", "name": "getTeams", "signature": "List<Team> getTeams()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "List<Team>"}, "class_info": {"name": "ProjectServiceImpl", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "ProjectServi... |
59834447_2 | class SymbolsCache {
public BuildMetadataEntry getEntry(@NotNull final String key,
@NotNull final MetadataSource metadataSource) {
Boolean missedSymbol = myMissedSymbols.getIfPresent(key);
if (missedSymbol != null && missedSymbol) {
LOG.debug("Symbol server does not... | // Given
SymbolsCache symbolsCache = new SymbolsCache(myFixture.getEventDispatcher());
Mockery m = new Mockery();
String key = "key";
BuildMetadataEntry entry = m.mock(BuildMetadataEntry.class, key);
String key2 = "key2";
BuildMetadataEntry entry2 = m.mock(BuildMetadataEntry.class, key2);
... | [FOCAL] public BuildMetadataEntry SymbolsCache.getEntry(String key, MetadataSource metadataSource)
[CLASS] class SymbolsCache
[METRICS] loc=64 cc=10 branches=7 loops=1 returns=4 throws=0 nesting=4
[CALLS-EXTERNAL] myMissedSymbols.getIfPresent/1, LOG.debug/1, myKeyToBuildIdMap.get/1, MetadataSource.getBuildIdByEntryKey/... | /* static context
[FOCAL] public BuildMetadataEntry SymbolsCache.getEntry(String key, MetadataSource metadataSource)
[PATH1] if(missedSymbol != null && missedSymbol)=F -> if(buildId == null)#1=T -> if(buildId == null)#2=F -> if(buildEntries.isPresent())=T -> if(shouldUpdateMap.get())=T -> foreach(String entryKey : buil... | /* static context
[FOCAL] public BuildMetadataEntry SymbolsCache.getEntry(String key, MetadataSource metadataSource)
[PATH1] if(missedSymbol != null && missedSymbol)=F -> if(buildId == null)#1=T -> if(buildId == null)#2=F -> if(buildEntries.isPresent())=T -> if(shouldUpdateMap.get())=T -> foreach(String entryKey : buil... | true | ok | {"focal": {"class": "SymbolsCache", "name": "getEntry", "signature": "BuildMetadataEntry getEntry(String key, MetadataSource metadataSource)", "start_line": 3, "modifiers": "public", "params": [{"name": "key", "type": "String"}, {"name": "metadataSource", "type": "MetadataSource"}], "return_type": "BuildMetadataEntry"}... |
59881768_8 | class GrowOnlyCounter implements CrdtCounter<Long, GrowOnlyCounter> {
@Override
public GrowOnlyCounter merge(GrowOnlyCounter other) {
return new GrowOnlyCounter(this, other);
}
GrowOnlyCounter(Map<String, Long> counters);
public GrowOnlyCounter(GrowOnlyCounter growOnlyCounter, Builder builder);
pub... |
Map<String, Long> node1Counter = new HashMap<>();
node1Counter.put("1", 3L);
Map<String, Long> node2Counter = new HashMap<>();
node2Counter.put("2", 1L);
Map<String, Long> node3Counter = new HashMap<>();
node3Counter.put("3", 2L);
GrowOnlyCounter gCounter1 = new GrowOnlyCounter(nod... | [FOCAL] @Override public GrowOnlyCounter GrowOnlyCounter.merge(GrowOnlyCounter other)
[CLASS] class GrowOnlyCounter implements CrdtCounter<Long, GrowOnlyCounter>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] GrowOnlyCounter
[INPUTS] branches=- | result=other
[DATAFLOW] other@param->L3
[CLAS... | /* static context
[FOCAL] @Override public GrowOnlyCounter GrowOnlyCounter.merge(GrowOnlyCounter other)
[INPUTS] branches=- | result=other
[NEW] GrowOnlyCounter
*/
| /* static context
[FOCAL] @Override public GrowOnlyCounter GrowOnlyCounter.merge(GrowOnlyCounter other)
[INPUTS] branches=- | result=other
[NEW] GrowOnlyCounter
*/
class GrowOnlyCounter implements CrdtCounter<Long, GrowOnlyCounter> {
@Override
public GrowOnlyCounter merge(GrowOnlyCounter other) {
return new Gr... | true | ok | {"focal": {"class": "GrowOnlyCounter", "name": "merge", "signature": "GrowOnlyCounter merge(GrowOnlyCounter other)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "other", "type": "GrowOnlyCounter"}], "return_type": "GrowOnlyCounter"}, "class_info": {"name": "GrowOnlyCounter", "kind": "class", "... |
59929488_16 | class Reg {
public String register(String uafMsg, String appFacetId) throws UafMsgProcessException, UafRequestMsgParseException, UafResponseMsgParseException {
logger.info(" [UAF][1]Reg ");
RegistrationResponse[] ret = new RegistrationResponse[1];
RegistrationResponse regResponse = proce... | InitConfig.getInstance().init(operParams.TEST_AAID, operParams.TestAttestCert, null, operParams, null);
Reg reg = new Reg();
String regRequest = "[{\"header\":{\"upv\":{\"major\":1,\"minor\":0},\"op\":\"Reg\",\"appID\":\"https://uaf-test-1.noknoktest.com:8443/SampleApp/uaf/facets\",\"serverData\":\"IjycjPZYiWMaQ1... | [FOCAL] public String Reg.register(String uafMsg, String appFacetId)
[CLASS] class Reg
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] RegistrationRequest getRegistrationRequest(String uafMsg); RegistrationResponse process(RegistrationRequest regRequest, String appFacetId); String ... | /* static context
[FOCAL] public String Reg.register(String uafMsg, String appFacetId)
[EXCEPTIONS] declares UafMsgProcessException, UafRequestMsgParseException, UafResponseMsgParseException
[CALLS-INTERNAL] RegistrationRequest getRegistrationRequest(String uafMsg); RegistrationResponse process(RegistrationRequest regR... | /* static context
[FOCAL] public String Reg.register(String uafMsg, String appFacetId)
[EXCEPTIONS] declares UafMsgProcessException, UafRequestMsgParseException, UafResponseMsgParseException
[CALLS-INTERNAL] RegistrationRequest getRegistrationRequest(String uafMsg); RegistrationResponse process(RegistrationRequest regR... | true | ok | {"focal": {"class": "Reg", "name": "register", "signature": "String register(String uafMsg, String appFacetId) throws UafMsgProcessException, UafRequestMsgParseException, UafResponseMsgParseException", "start_line": 3, "modifiers": "public", "params": [{"name": "uafMsg", "type": "String"}, {"name": "appFacetId", "type"... |
59975597_1 | class RxMemoization {
public static <R> Func0<R> memoize(final Func0<R> func0) {
return new Func0<R>() {
private R value;
@Override
public R call() {
if (null == value) {
synchronized (this) {
if (null == value... | final AtomicInteger count = new AtomicInteger(0);
Func1<Integer, MyObject> memoized = RxMemoization.memoize(new Func1<Integer, MyObject>() {
@Override
public MyObject call(Integer integer) {
count.incrementAndGet();
return INSTANCES.get(integer);
... | [FOCAL] public static Func0<R> RxMemoization.memoize(Func0<R> func0)
[CLASS] class RxMemoization
[METRICS] loc=17 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=3
[CALLS-EXTERNAL] Func0<R>.call/0
[NEW] Func0<R>
[INPUTS] branches=- | result=func0
[COLLABORATORS] param func0:Func0<R> call/0
[DATAFLOW] func0@param->L2... | /* static context
[FOCAL] public static Func0<R> RxMemoization.memoize(Func0<R> func0)
[INPUTS] branches=- | result=func0
[COLLABORATORS] param func0:Func0<R> call/0
[NEW] Func0<R>
[CALLS-EXTERNAL] Func0<R>.call/0
*/
| /* static context
[FOCAL] public static Func0<R> RxMemoization.memoize(Func0<R> func0)
[INPUTS] branches=- | result=func0
[COLLABORATORS] param func0:Func0<R> call/0
[NEW] Func0<R>
[CALLS-EXTERNAL] Func0<R>.call/0
*/
class RxMemoization {
public static <R> Func0<R> memoize(final Func0<R> func0) {
return ne... | true | ok | {"focal": {"class": "RxMemoization", "name": "memoize", "signature": "Func0<R> memoize(Func0<R> func0)", "start_line": 3, "modifiers": "public static", "params": [{"name": "func0", "type": "Func0<R>"}], "return_type": "Func0<R>"}, "class_info": {"name": "RxMemoization", "kind": "class", "modifiers": "", "superclass": n... |
59981531_33 | class FastDiag {
public Set<Constraint> getPreferredDiagnosis(Set<Constraint> constraintsSetC, Boolean displayFastDiagSteps)
throws DiagnosisException {
this.displayfastDiagSteps = displayFastDiagSteps;
if (constraintsSetC.isEmpty()) {
if (progressCalback != null) {
progressCalback.displayMessage("C... | Set<Constraint> constraintsSetC = new LinkedHashSet<Constraint>();
Set<Element> decisionsVar = new LinkedHashSet<Element>();
String fileName = UtilsForTest.getTestDataset1(constraintsSetC, decisionsVar);
FastDiag fastDiag = new FastDiag(fileName, constraintsSetC, ConflictDetectionAlgorithm.FastDiag, null);
... | [FOCAL] public Set<Constraint> FastDiag.getPreferredDiagnosis(Set<Constraint> constraintsSetC, Boolean displayFastDiagSteps)
[CLASS] class FastDiag
[METRICS] loc=45 cc=9 branches=8 loops=0 returns=4 throws=0 nesting=3
[CALLS-INTERNAL] Set<Constraint> fd(Set<Constraint> D, Set<Constraint> C, Set<Constraint> AC, int leve... | /* static context
[FOCAL] public Set<Constraint> FastDiag.getPreferredDiagnosis(Set<Constraint> constraintsSetC, Boolean displayFastDiagSteps)
[PATH1] if(constraintsSetC.isEmpty())=F -> if(consistencyChecker.isConsistent(userRequirements, fixedModel))=F -> if(!searchForDiagnosis)=T -> if(progressCalback != null)#3=T ->... | /* static context
[FOCAL] public Set<Constraint> FastDiag.getPreferredDiagnosis(Set<Constraint> constraintsSetC, Boolean displayFastDiagSteps)
[PATH1] if(constraintsSetC.isEmpty())=F -> if(consistencyChecker.isConsistent(userRequirements, fixedModel))=F -> if(!searchForDiagnosis)=T -> if(progressCalback != null)#3=T ->... | true | ok | {"focal": {"class": "FastDiag", "name": "getPreferredDiagnosis", "signature": "Set<Constraint> getPreferredDiagnosis(Set<Constraint> constraintsSetC, Boolean displayFastDiagSteps) throws DiagnosisException", "start_line": 3, "modifiers": "public", "params": [{"name": "constraintsSetC", "type": "Set<Constraint>"}, {"nam... |
60020187_2 | class AgeraCallAdapterFactory extends CallAdapter.Factory {
@Override
public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) {
if (getRawType(returnType) != Supplier.class) {
return null;
}
if (!(returnType instanceof ParameterizedType)) {... | Type reservoirType = new TypeToken<Supplier>() {}.getType();
try {
factory.get(reservoirType, NO_ANNOTATIONS, retrofit);
fail();
} catch (IllegalStateException e) {
assertThat(e, hasMessage(containsString(
"Supplier return type must be paramete... | [FOCAL] @Override public CallAdapter<?, ?> AgeraCallAdapterFactory.get(Type returnType, Annotation[] annotations, Retrofit retrofit)
[CLASS] class AgeraCallAdapterFactory extends CallAdapter.Factory
[METRICS] loc=29 cc=6 branches=5 loops=0 returns=3 throws=3 nesting=1
[CALLS-EXTERNAL] getRawType/1 (inherited), getParam... | /* static context
[FOCAL] @Override public CallAdapter<?, ?> AgeraCallAdapterFactory.get(Type returnType, Annotation[] annotations, Retrofit retrofit)
[THROWS-WHEN] IllegalStateException when !(getRawType(returnType) != Supplier.class) && !(returnType instanceof ParameterizedType)
[THROWS-WHEN] IllegalStateException wh... | /* static context
[FOCAL] @Override public CallAdapter<?, ?> AgeraCallAdapterFactory.get(Type returnType, Annotation[] annotations, Retrofit retrofit)
[THROWS-WHEN] IllegalStateException when !(getRawType(returnType) != Supplier.class) && !(returnType instanceof ParameterizedType)
[THROWS-WHEN] IllegalStateException wh... | true | ok | {"focal": {"class": "AgeraCallAdapterFactory", "name": "get", "signature": "CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "returnType", "type": "Type"}, {"name": "annotations", "type": "Annotation[]"}, {"name":... |
60094068_126 | class CrashReporterApiClient extends ApiClient {
public ApiClientResult<Object> reportError(Throwable t) {
Request request = generateCreateErrorReportRequest(t);
try {
Response response = httpClient.newCall(request).execute();
if (response.isSuccessful()) {
response.close();
retur... | enqueueMockResponse();
apiClient.reportError(ANY_EXCEPTION);
assertRequestSentTo("/errorReport");
}
} | [FOCAL] public ApiClientResult<Object> CrashReporterApiClient.reportError(Throwable t)
[CLASS] class CrashReporterApiClient extends ApiClient
[METRICS] loc=13 cc=3 branches=1 loops=0 returns=3 throws=0 nesting=2
[CALLS-INTERNAL] Request generateCreateErrorReportRequest(Throwable t)
[CALLS-EXTERNAL] httpClient.newCall(r... | /* static context
[FOCAL] public ApiClientResult<Object> CrashReporterApiClient.reportError(Throwable t)
[PATH1] try-body throws -> return new ApiClientResult<>(ApiClientResult.Error.NETWORK_ERROR)
[PATH2] if(response.isSuccessful())=T -> return new ApiClientResult<>(new Object())
[PATH3] if(response.isSuccessful())=F ... | /* static context
[FOCAL] public ApiClientResult<Object> CrashReporterApiClient.reportError(Throwable t)
[PATH1] try-body throws -> return new ApiClientResult<>(ApiClientResult.Error.NETWORK_ERROR)
[PATH2] if(response.isSuccessful())=T -> return new ApiClientResult<>(new Object())
[PATH3] if(response.isSuccessful())=F ... | true | ok | {"focal": {"class": "CrashReporterApiClient", "name": "reportError", "signature": "ApiClientResult<Object> reportError(Throwable t)", "start_line": 3, "modifiers": "public", "params": [{"name": "t", "type": "Throwable"}], "return_type": "ApiClientResult<Object>"}, "class_info": {"name": "CrashReporterApiClient", "kind"... |
60111626_28 | class Curses {
public static String tputs(String cap, Object... params) {
if (cap != null) {
StringWriter sw = new StringWriter();
tputs(sw, cap, params);
return sw.toString();
}
return null;
}
private Curses();
public static void tputs(App... |
assertEquals("{\033[3;4r", Curses.tputs("\\173\\E[%i%p1%d;%p2%dr", 2, 3));
}
} | [FOCAL] public static String Curses.tputs(String cap, Object... params)
[CLASS] class Curses
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] void tputs(Appendable out, String str, Object... params)
[CALLS-EXTERNAL] StringWriter.toString/0
[NEW] StringWriter
[PATH1] if(cap != null)=... | /* static context
[FOCAL] public static String Curses.tputs(String cap, Object... params)
[PATH1] if(cap != null)=T -> return sw.toString()
[PATH2] if(cap != null)=F -> return null
[INPUTS] branches=cap | result=-
[CALLS-INTERNAL] void tputs(Appendable out, String str, Object... params)
[NEW] StringWriter
[CALLS-EXTERN... | /* static context
[FOCAL] public static String Curses.tputs(String cap, Object... params)
[PATH1] if(cap != null)=T -> return sw.toString()
[PATH2] if(cap != null)=F -> return null
[INPUTS] branches=cap | result=-
[CALLS-INTERNAL] void tputs(Appendable out, String str, Object... params)
[NEW] StringWriter
[CALLS-EXTERN... | true | ok | {"focal": {"class": "Curses", "name": "tputs", "signature": "String tputs(String cap, Object... params)", "start_line": 3, "modifiers": "public static", "params": [{"name": "cap", "type": "String"}, {"name": "params", "type": "Object..."}], "return_type": "String"}, "class_info": {"name": "Curses", "kind": "class", "mo... |
60127046_0 | class ConfigMapper {
public static ReadableMap toMap(Config config) {
WritableMap out = Arguments.createMap();
WritableMap httpHeaders = Arguments.createMap();
if (config.getStationaryRadius() != null) {
out.putDouble("stationaryRadius", config.getStationaryRadius());
}
... | Config config = Config.getDefault();
ReadableMap map = ConfigMapper.toMap(config);
Assert.assertEquals(config.getStationaryRadius(), map.getDouble("stationaryRadius"), 0f);
Assert.assertEquals(config.getDistanceFilter().intValue(), map.getInt("distanceFilter"));
Assert.assertEqu... | [FOCAL] public static ReadableMap ConfigMapper.toMap(Config config)
[CLASS] class ConfigMapper
[METRICS] loc=123 cc=35 branches=33 loops=1 returns=1 throws=0 nesting=3
[CALLS-EXTERNAL] Arguments.createMap/0, Config.getStationaryRadius/0, WritableMap.putDouble/2, Config.getDistanceFilter/0, WritableMap.putInt/2, Config.... | class ConfigMapper {
public static ReadableMap toMap(Config config) {
WritableMap out = Arguments.createMap();
WritableMap httpHeaders = Arguments.createMap();
if (config.getStationaryRadius() != null) {
out.putDouble("stationaryRadius", config.getStationaryRadius());
}
... | false | ok | {"focal": {"class": "ConfigMapper", "name": "toMap", "signature": "ReadableMap toMap(Config config)", "start_line": 3, "modifiers": "public static", "params": [{"name": "config", "type": "Config"}], "return_type": "ReadableMap"}, "class_info": {"name": "ConfigMapper", "kind": "class", "modifiers": "", "superclass": nul... | |
60131932_2 | class RxUi {
public static <T> Function<Observable<T>, Disposable> ui(final Consumer<T> uiAction) {
return new Function<Observable<T>, Disposable>() {
@Override
public Disposable apply(Observable<T> observable) {
return observable
.observeOn(m... | final AtomicBoolean wasCalledOnUiThread = new AtomicBoolean(true);
// WHEN have UI action
Consumer<String> uiAction = spy(new Consumer<String>() {
@Override
public void accept(String s) {
if (!wasCalledOnUiThread.compareAndSet(true, Looper.getMainLooper()... | [FOCAL] public static Function<Observable<T>, Disposable> RxUi.ui(Consumer<T> uiAction)
[CLASS] class RxUi
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] observable .observeOn(mainThread()).subscribe/1, observable.observeOn/1, mainThread/0 (inherited)
[NEW] Function<Observable<T>... | /* static context
[FOCAL] public static Function<Observable<T>, Disposable> RxUi.ui(Consumer<T> uiAction)
[INPUTS] branches=- | result=uiAction
[COLLABORATORS] field observable observeOn/1
[NEW] Function<Observable<T>, Disposable>
[CALLS-EXTERNAL] observable .observeOn(mainThread()).subscribe/1, observable.observeOn/1,... | /* static context
[FOCAL] public static Function<Observable<T>, Disposable> RxUi.ui(Consumer<T> uiAction)
[INPUTS] branches=- | result=uiAction
[COLLABORATORS] field observable observeOn/1
[NEW] Function<Observable<T>, Disposable>
[CALLS-EXTERNAL] observable .observeOn(mainThread()).subscribe/1, observable.observeOn/1,... | true | ok | {"focal": {"class": "RxUi", "name": "ui", "signature": "Function<Observable<T>, Disposable> ui(Consumer<T> uiAction)", "start_line": 3, "modifiers": "public static", "params": [{"name": "uiAction", "type": "Consumer<T>"}], "return_type": "Function<Observable<T>, Disposable>"}, "class_info": {"name": "RxUi", "kind": "cl... |
60171447_0 | class MainViewPresenter extends Presenter {
private void loadBitcoinPrice() {
callback.showLoading();
loadBitcoinPriceUseCase.execute(
value -> callback.setData((List<BitcoinPriceViewModel>) value),
throwable -> callback.showError(throwable.getMessage()),
() -> callback.hideLoading()
... | mainViewPresenter.onStart();
verify(mainViewCallback).showLoading();
verify(loadBitcoinPriceUseCase).execute(any(Action1.class), any(Action1.class), any(Action0.class));
}
} | [FOCAL] private void MainViewPresenter.loadBitcoinPrice()
[CLASS] class MainViewPresenter extends Presenter
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] callback.showLoading/0, LoadBitcoinPriceUseCase.execute/3, callback.setData/1, callback.showError/1, throwable.getMessage/0, c... | /* static context
[FOCAL] private void MainViewPresenter.loadBitcoinPrice()
[COLLABORATORS] field callback showLoading/0,setData/1,showError/1,hideLoading/0; field loadBitcoinPriceUseCase:LoadBitcoinPriceUseCase execute/3; field throwable getMessage/0
[FIELDS] read=loadBitcoinPriceUseCase:LoadBitcoinPriceUseCase
[CALLS... | /* static context
[FOCAL] private void MainViewPresenter.loadBitcoinPrice()
[COLLABORATORS] field callback showLoading/0,setData/1,showError/1,hideLoading/0; field loadBitcoinPriceUseCase:LoadBitcoinPriceUseCase execute/3; field throwable getMessage/0
[FIELDS] read=loadBitcoinPriceUseCase:LoadBitcoinPriceUseCase
[CALLS... | true | ok | {"focal": {"class": "MainViewPresenter", "name": "loadBitcoinPrice", "signature": "void loadBitcoinPrice()", "start_line": 3, "modifiers": "private", "params": [], "return_type": "void"}, "class_info": {"name": "MainViewPresenter", "kind": "class", "modifiers": "", "superclass": "Presenter", "interfaces": null, "fields... |
60241390_28 | class ProcessorFactory {
static StatusProcessor produce(SuiteStatusResult suiteStatusResult, String reportUrl,
RedirectWriter redirectWriter, RunnerTerminator runnerTerminator) {
StatusProcessor processor = null;
if (suiteStatusResult != null) {
switch (suiteStatusResult.getStatus()) {
ca... | SuiteStatusResult nullSuiteStatus = null;
StatusProcessor processor = ProcessorFactory
.produce(nullSuiteStatus, REPORT_URL, null, runnerTerminator);
assertThat(processor, is(nullValue()));
}
} | [FOCAL] static StatusProcessor ProcessorFactory.produce(SuiteStatusResult suiteStatusResult, String reportUrl, RedirectWriter redirectWriter, RunnerTerminator runnerTerminator)
[CLASS] class ProcessorFactory
[METRICS] loc=27 cc=7 branches=2 loops=0 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] SuiteStatusResult.getStat... | /* static context
[FOCAL] static StatusProcessor ProcessorFactory.produce(SuiteStatusResult suiteStatusResult, String reportUrl, RedirectWriter redirectWriter, RunnerTerminator runnerTerminator)
[PATH1] if(suiteStatusResult != null)=T -> switch(suiteStatusResult.getStatus())=case PROGRESS -> return processor
[PATH2] if... | /* static context
[FOCAL] static StatusProcessor ProcessorFactory.produce(SuiteStatusResult suiteStatusResult, String reportUrl, RedirectWriter redirectWriter, RunnerTerminator runnerTerminator)
[PATH1] if(suiteStatusResult != null)=T -> switch(suiteStatusResult.getStatus())=case PROGRESS -> return processor
[PATH2] if... | true | ok | {"focal": {"class": "ProcessorFactory", "name": "produce", "signature": "StatusProcessor produce(SuiteStatusResult suiteStatusResult, String reportUrl, RedirectWriter redirectWriter, RunnerTerminator runnerTerminator)", "start_line": 3, "modifiers": "static", "params": [{"name": "suiteStatusResult", "type": "SuiteStatu... |
60259028_1 | class ServicesManager implements DataSource {
@Override
public Observable<List<WeatherConditionEntity>> getWeatherConditionEntities() {
Map<String, String> params = new android.support.v4.util.ArrayMap<>(2);
params.put("search", Constants.SEARCH_ALL_COND);
params.put("key", Constants.WE... | assertNotNull(mServicesManger);
TestSubscriber<List<WeatherConditionEntity>> testSubscriber = TestSubscriber.create(new GetWeatherConditionsDelegate());
mServicesManger.getWeatherConditionEntities().subscribe(testSubscriber);
testSubscriber.awaitTerminalEvent();
testSubscriber.as... | [FOCAL] @Override public Observable<List<WeatherConditionEntity>> ServicesManager.getWeatherConditionEntities()
[CLASS] class ServicesManager implements DataSource
[METRICS] loc=34 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=3
[CALLS-EXTERNAL] Map<String, String>.put/2, weatherInfoService.getConditionInfos(param... | /* static context
[FOCAL] @Override public Observable<List<WeatherConditionEntity>> ServicesManager.getWeatherConditionEntities()
[COLLABORATORS] field weatherInfoService getConditionInfos/1; field conditionsResponse getResultCode/0,getConditions/0; field mWeatherCondtionEntities clear/0,add/1
[NEW] android.support.v4.... | /* static context
[FOCAL] @Override public Observable<List<WeatherConditionEntity>> ServicesManager.getWeatherConditionEntities()
[COLLABORATORS] field weatherInfoService getConditionInfos/1; field conditionsResponse getResultCode/0,getConditions/0; field mWeatherCondtionEntities clear/0,add/1
[NEW] android.support.v4.... | true | ok | {"focal": {"class": "ServicesManager", "name": "getWeatherConditionEntities", "signature": "Observable<List<WeatherConditionEntity>> getWeatherConditionEntities()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Observable<List<WeatherConditionEntity>>"}, "class_info": {"name": "Service... |
60270542_0 | class ImgurMvpPresenter extends BasePresenter<ImgurMvpView> {
public void refreshTopics() {
imgurApi.defaultTopics()
.map(TopicResponse::getData)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.compose(view().bind())
.compose(view().injectProgress())
.subscribe(topics -> ... | // given
TopicResponse response = new TopicResponse();
List<Topic> topics = Lists.newArrayList(new Topic(), new Topic(), new Topic());
response.setData(topics);
given(imgurApi.defaultTopics()).willReturn(Observable.just(response));
// when
presenter.refreshTopics();
// then
proxy.advanceBy(1, TimeUn... | [FOCAL] public void ImgurMvpPresenter.refreshTopics()
[CLASS] class ImgurMvpPresenter extends BasePresenter<ImgurMvpView>
[METRICS] loc=13 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] imgurApi.defaultTopics() .map(TopicResponse::getData) .su....subscribe/2, imgurApi.defaultTopics() .map(TopicRe... | /* static context
[FOCAL] public void ImgurMvpPresenter.refreshTopics()
[COLLABORATORS] field imgurApi:ImgurApi defaultTopics/0
[FIELDS] read=imgurApi:ImgurApi
[CALLS-EXTERNAL] imgurApi.defaultTopics() .map(TopicResponse::getData) .su....subscribe/2, imgurApi.defaultTopics() .map(TopicResponse::getData) .su....compose/... | /* static context
[FOCAL] public void ImgurMvpPresenter.refreshTopics()
[COLLABORATORS] field imgurApi:ImgurApi defaultTopics/0
[FIELDS] read=imgurApi:ImgurApi
[CALLS-EXTERNAL] imgurApi.defaultTopics() .map(TopicResponse::getData) .su....subscribe/2, imgurApi.defaultTopics() .map(TopicResponse::getData) .su....compose/... | true | ok | {"focal": {"class": "ImgurMvpPresenter", "name": "refreshTopics", "signature": "void refreshTopics()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "ImgurMvpPresenter", "kind": "class", "modifiers": "", "superclass": "BasePresenter<ImgurMvpView>", "interfaces": nu... |
60296811_2 | class Diacetyl {
public static void butterForTests(Object... instancesWithViews) {
Diacetyl diacetyl = new Diacetyl();
for (Object instanceWithViews : instancesWithViews) {
diacetyl.bindForTests(instanceWithViews);
}
}
private void bindForTests(Object instanceWithViews)... | Diacetyl.butterForTests(exampleClass);
assertThat(exampleClass.nonNulView.getText()).isEqualTo("preset");
}
} | [FOCAL] public static void Diacetyl.butterForTests(Object... instancesWithViews)
[CLASS] class Diacetyl
[METRICS] loc=6 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] Diacetyl.bindForTests/1
[NEW] Diacetyl
[PATH1] foreach(Object instanceWithViews : instancesWithViews)=T -> exit loop
[PATH2] forea... | /* static context
[FOCAL] public static void Diacetyl.butterForTests(Object... instancesWithViews)
[PATH1] foreach(Object instanceWithViews : instancesWithViews)=T -> exit loop
[PATH2] foreach(Object instanceWithViews : instancesWithViews)=F
[INPUTS] branches=instancesWithViews | result=-
[NEW] Diacetyl
[CALLS-EXTERNAL... | /* static context
[FOCAL] public static void Diacetyl.butterForTests(Object... instancesWithViews)
[PATH1] foreach(Object instanceWithViews : instancesWithViews)=T -> exit loop
[PATH2] foreach(Object instanceWithViews : instancesWithViews)=F
[INPUTS] branches=instancesWithViews | result=-
[NEW] Diacetyl
[CALLS-EXTERNAL... | true | ok | {"focal": {"class": "Diacetyl", "name": "butterForTests", "signature": "void butterForTests(Object... instancesWithViews)", "start_line": 3, "modifiers": "public static", "params": [{"name": "instancesWithViews", "type": "Object..."}], "return_type": "void"}, "class_info": {"name": "Diacetyl", "kind": "class", "modifie... |
60379785_24 | class UserWS {
@RequestMapping(value = "/api/users", method = RequestMethod.GET)
public List<User> getUsers(@RequestParam(value = "username", required = false) String username) {
List<User> users = userRepository.findAll(
where(ifParamNotNull(usernameEquals(username)))
... | List<User> users = userClient.getUsers(null);
assertFalse(users.isEmpty());
for (User user : users) {
logger.debug("{}: {}", user.getUsername(), authoritiesToString(user.getAuthorities()));
}
}
} | [FOCAL] @RequestMapping(value = "/api/users", method = RequestMethod.GET) public List<User> UserWS.getUsers(String username)
[CLASS] class UserWS
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] userRepository.findAll/2, where(ifParamNotNull(usernameEquals(username))).and/1, where/1... | /* static context
[FOCAL] @RequestMapping(value = "/api/users", method = RequestMethod.GET) public List<User> UserWS.getUsers(String username)
[INPUTS] branches=- | result=username
[COLLABORATORS] field userRepository findAll/2
[CALLS-EXTERNAL] userRepository.findAll/2, where(ifParamNotNull(usernameEquals(username))).a... | /* static context
[FOCAL] @RequestMapping(value = "/api/users", method = RequestMethod.GET) public List<User> UserWS.getUsers(String username)
[INPUTS] branches=- | result=username
[COLLABORATORS] field userRepository findAll/2
[CALLS-EXTERNAL] userRepository.findAll/2, where(ifParamNotNull(usernameEquals(username))).a... | true | ok | {"focal": {"class": "UserWS", "name": "getUsers", "signature": "List<User> getUsers(String username)", "start_line": 3, "modifiers": "@RequestMapping(value = \"/api/users\", method = RequestMethod.GET) public", "params": [{"name": "username", "type": "String"}], "return_type": "List<User>"}, "class_info": {"name": "Use... |
60384641_0 | class CDPlayer implements MediaPlayer {
public void play() {
cd.play();
}
@Autowired public CDPlayer(CompactDisc cd);
@Rule
public final StandardOutputStreamLog log;
@Autowired
private MediaPlayer player;
@Autowired
private CompactDisc cd;
}
class CDPlayerTest {
@R... | player.play();
assertEquals("Playing Hello by Adele.", log.getLog());
}
} | [FOCAL] public void CDPlayer.play()
[CLASS] class CDPlayer implements MediaPlayer
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] CompactDisc.play/0
[FIELDS] read=cd:CompactDisc
[COLLABORATORS] field cd:CompactDisc play/0
[DATAFLOW] this.cd@param->L2
[CLASS-MEMBERS] CDPlayer(Compac... | /* static context
[FOCAL] public void CDPlayer.play()
[COLLABORATORS] field cd:CompactDisc play/0
[FIELDS] read=cd:CompactDisc
[CALLS-EXTERNAL] CompactDisc.play/0
*/
| /* static context
[FOCAL] public void CDPlayer.play()
[COLLABORATORS] field cd:CompactDisc play/0
[FIELDS] read=cd:CompactDisc
[CALLS-EXTERNAL] CompactDisc.play/0
*/
class CDPlayer implements MediaPlayer {
public void play() {
cd.play();
}
@Autowired public CDPlayer(CompactDisc cd);
@Rule
... | true | ok | {"focal": {"class": "CDPlayer", "name": "play", "signature": "void play()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "CDPlayer", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "MediaPlayer", "fields": [{"name": "log", "type": "StandardOutp... |
60395071_0 | class ShotsRepository implements ShotsDataSource {
private void getListShotsFromRemote(final int filterId, final LoadListShotsCallback callback){
mShotsRemoteDataSource.getListShots(filterId,new LoadListShotsCallback() {
@Override
public void onListShotsLoaded(List<Shots> shotsList)... | shotsRepository.refreshShots();
shotsRepository.getListShots(0,loadListShotsCallback);
verify(shotsRemoteDataSource).getListShots(eq(0),loadListShotsCallbackArgumentCaptor.capture());
loadListShotsCallbackArgumentCaptor.getValue().onListShotsLoaded(new ArrayList<Shots>());
verify... | [FOCAL] private void ShotsRepository.getListShotsFromRemote(int filterId, LoadListShotsCallback callback)
[CLASS] class ShotsRepository implements ShotsDataSource
[METRICS] loc=17 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] mShotsRemoteDataSource.getListShots/2, mCachedShots.put/2, mShotsLocal... | /* static context
[FOCAL] private void ShotsRepository.getListShotsFromRemote(int filterId, LoadListShotsCallback callback)
[COLLABORATORS] field mShotsRemoteDataSource getListShots/2; field mCachedShots put/2; field mShotsLocalDataSource deleteAllShots/0,saveListShots/1; param callback:LoadListShotsCallback onListShot... | /* static context
[FOCAL] private void ShotsRepository.getListShotsFromRemote(int filterId, LoadListShotsCallback callback)
[COLLABORATORS] field mShotsRemoteDataSource getListShots/2; field mCachedShots put/2; field mShotsLocalDataSource deleteAllShots/0,saveListShots/1; param callback:LoadListShotsCallback onListShot... | true | ok | {"focal": {"class": "ShotsRepository", "name": "getListShotsFromRemote", "signature": "void getListShotsFromRemote(int filterId, LoadListShotsCallback callback)", "start_line": 3, "modifiers": "private", "params": [{"name": "filterId", "type": "int"}, {"name": "callback", "type": "LoadListShotsCallback"}], "return_type... |
60416700_305 | class NsClientReceiverDelegate {
boolean calculateStatus(final EventChargingState ev) {
boolean chargingOnly = SP.getBoolean(R.string.key_ns_chargingonly, false);
boolean newAllowedState = true;
if (!ev.isCharging() && chargingOnly) {
newAllowedState = false;
}
... | PowerMockito.mockStatic(SP.class);
// wifiOnly = false
// allowRoaming = false as well
when(SP.getBoolean(anyInt(), anyBoolean())).thenReturn(false);
when(SP.getString(anyInt(), anyString())).thenReturn("");
EventNetworkChange ev = new EventNetworkChange();
ev.set... | [FOCAL] boolean NsClientReceiverDelegate.calculateStatus(EventChargingState ev)
[CLASS] class NsClientReceiverDelegate
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] SP.getBoolean/2, EventChargingState.isCharging/0
[PATH1] if(!ev.isCharging() && chargingOnly)=T -> return newAllow... | /* static context
[FOCAL] boolean NsClientReceiverDelegate.calculateStatus(EventChargingState ev)
[PATH1] if(!ev.isCharging() && chargingOnly)=T -> return newAllowedState
[PATH2] if(!ev.isCharging() && chargingOnly)=F -> return newAllowedState
[INPUTS] branches=ev | result=-
[COLLABORATORS] param ev:EventChargingState ... | /* static context
[FOCAL] boolean NsClientReceiverDelegate.calculateStatus(EventChargingState ev)
[PATH1] if(!ev.isCharging() && chargingOnly)=T -> return newAllowedState
[PATH2] if(!ev.isCharging() && chargingOnly)=F -> return newAllowedState
[INPUTS] branches=ev | result=-
[COLLABORATORS] param ev:EventChargingState ... | true | ok | {"focal": {"class": "NsClientReceiverDelegate", "name": "calculateStatus", "signature": "boolean calculateStatus(EventChargingState ev)", "start_line": 3, "modifiers": "", "params": [{"name": "ev", "type": "EventChargingState"}], "return_type": "boolean"}, "class_info": {"name": "NsClientReceiverDelegate", "kind": "cla... |
60432093_1 | class RxGuava {
public static <T> Observable<T> fromIterator(final ListenableFuture<Iterator<T>> futureIterator) {
return fromIterator(futureIterator, MoreExecutors.sameThreadExecutor());
}
public static Observable<T> fromIterable(final ListenableFuture<? extends Iterable<T>> futureIterable);
public stati... | Iterator<Integer> iter = Arrays.asList(1,2,3).iterator();
SettableFuture<Iterator<Integer>> future = SettableFuture.create();
Executors.newSingleThreadScheduledExecutor().schedule(()->future.set(iter), 100, TimeUnit.MILLISECONDS);
CountDownLatch latch = new CountDownLatch(3);
AtomicReference<String>... | [FOCAL] public static Observable<T> RxGuava.fromIterator(ListenableFuture<Iterator<T>> futureIterator)
[CLASS] class RxGuava
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Observable<T> fromIterator(ListenableFuture<Iterator<T>> futureIterator, Executor executor)
[CALLS-EXTERNAL] ... | /* static context
[FOCAL] public static Observable<T> RxGuava.fromIterator(ListenableFuture<Iterator<T>> futureIterator)
[INPUTS] branches=- | result=futureIterator
[CALLS-INTERNAL] Observable<T> fromIterator(ListenableFuture<Iterator<T>> futureIterator, Executor executor)
[CALLS-EXTERNAL] MoreExecutors.sameThreadExecu... | /* static context
[FOCAL] public static Observable<T> RxGuava.fromIterator(ListenableFuture<Iterator<T>> futureIterator)
[INPUTS] branches=- | result=futureIterator
[CALLS-INTERNAL] Observable<T> fromIterator(ListenableFuture<Iterator<T>> futureIterator, Executor executor)
[CALLS-EXTERNAL] MoreExecutors.sameThreadExecu... | true | ok | {"focal": {"class": "RxGuava", "name": "fromIterator", "signature": "Observable<T> fromIterator(ListenableFuture<Iterator<T>> futureIterator)", "start_line": 3, "modifiers": "public static", "params": [{"name": "futureIterator", "type": "ListenableFuture<Iterator<T>>"}], "return_type": "Observable<T>"}, "class_info": {... |
60435184_1 | class LoginViewModel implements ViewModel {
public void onClickLoginButton(@SuppressWarnings("unused") View view) {
navigator.startCustomTab(AnnictClient.getOAuthUrl());
}
@Inject public LoginViewModel(PageNavigator navigator);
@Override public void destroy();
private LoginViewModel log... | loginViewModel.onClickLoginButton(null);
verify(navigator, times(1)).startCustomTab(AnnictClient.getOAuthUrl());
}
} | [FOCAL] public void LoginViewModel.onClickLoginButton(View view)
[CLASS] class LoginViewModel implements ViewModel
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] PageNavigator.startCustomTab/1, AnnictClient.getOAuthUrl/0
[FIELDS] read=navigator:PageNavigator
[INPUTS] branches=- | ... | /* static context
[FOCAL] public void LoginViewModel.onClickLoginButton(View view)
[INPUTS] branches=- | result=- | unused=view
[COLLABORATORS] field navigator:PageNavigator startCustomTab/1
[FIELDS] read=navigator:PageNavigator
[CALLS-EXTERNAL] PageNavigator.startCustomTab/1, AnnictClient.getOAuthUrl/0
*/
| /* static context
[FOCAL] public void LoginViewModel.onClickLoginButton(View view)
[INPUTS] branches=- | result=- | unused=view
[COLLABORATORS] field navigator:PageNavigator startCustomTab/1
[FIELDS] read=navigator:PageNavigator
[CALLS-EXTERNAL] PageNavigator.startCustomTab/1, AnnictClient.getOAuthUrl/0
*/
class LoginV... | true | ok | {"focal": {"class": "LoginViewModel", "name": "onClickLoginButton", "signature": "void onClickLoginButton(View view)", "start_line": 3, "modifiers": "public", "params": [{"name": "view", "type": "View"}], "return_type": "void"}, "class_info": {"name": "LoginViewModel", "kind": "class", "modifiers": "", "superclass": nu... |
60450885_34 | class DefaultReactiveRepository extends DefaultRepository<E> implements ReactiveRepository<E, K> {
@Override
public Mono<Integer> insertBatch(Publisher<? extends Collection<E>> data) {
return Flux.from(data)
.filter(CollectionUtils::isNotEmpty)
.flatMap(e -> doInsert(e).... | List<TestEntity> list = Flux.range(0, 100)
.map(i -> {
TestEntity entity = new TestEntity();
entity.setId("test_" + i);
entity.setName("test_" + i);
if (i < 10) {
entity.setState((byte) 1);
... | [FOCAL] @Override public Mono<Integer> DefaultReactiveRepository.insertBatch(Publisher<? extends Collection<E>> data)
[CLASS] class DefaultReactiveRepository extends DefaultRepository<E> implements ReactiveRepository<E, K>
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Flux.from(d... | /* static context
[FOCAL] @Override public Mono<Integer> DefaultReactiveRepository.insertBatch(Publisher<? extends Collection<E>> data)
[INPUTS] branches=- | result=data
[CALLS-EXTERNAL] Flux.from(data) .filter(CollectionUtils::isNotEmpty) .fla....defaultIfEmpty/1, Flux.from(data) .filter(CollectionUtils::isNotEmpty) .... | /* static context
[FOCAL] @Override public Mono<Integer> DefaultReactiveRepository.insertBatch(Publisher<? extends Collection<E>> data)
[INPUTS] branches=- | result=data
[CALLS-EXTERNAL] Flux.from(data) .filter(CollectionUtils::isNotEmpty) .fla....defaultIfEmpty/1, Flux.from(data) .filter(CollectionUtils::isNotEmpty) .... | true | ok | {"focal": {"class": "DefaultReactiveRepository", "name": "insertBatch", "signature": "Mono<Integer> insertBatch(Publisher<? extends Collection<E>> data)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "data", "type": "Publisher<? extends Collection<E>>"}], "return_type": "Mono<Integer>"}, "class... |
60524334_3 | class BlankConstraint extends Constraint<Object> {
@NonNull
@Override
public Set<Violation> validate() throws UnsupportedException {
final Set<Violation> violations = new HashSet<>();
final String value = getStringFromObject(object, propertyName);
if (null != value && 0 != value.tr... | assertNotEmpty("is invalid with String", new BlankConstraint(NOT_BLANK, PROPERTY_NAME).validate());
assertNotEmpty("is invalid with EditText",
new BlankConstraint(generateEditText(NOT_BLANK), PROPERTY_NAME).validate());
assertNotEmpty("is invalid with Spinner",
new Blan... | [FOCAL] @NonNull @Override public Set<Violation> BlankConstraint.validate()
[CLASS] class BlankConstraint extends Constraint<Object>
[METRICS] loc=12 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] getStringFromObject/2 (inherited), value.trim().length/0, String.trim/0, Set<Violation>.add/1
[NEW] ... | /* static context
[FOCAL] @NonNull @Override public Set<Violation> BlankConstraint.validate()
[PATH1] if(null != value && 0 != value.trim().length())=T -> return violations
[PATH2] if(null != value && 0 != value.trim().length())=F -> return violations
[EXCEPTIONS] declares UnsupportedException
[NEW] HashSet<>, Violatio... | /* static context
[FOCAL] @NonNull @Override public Set<Violation> BlankConstraint.validate()
[PATH1] if(null != value && 0 != value.trim().length())=T -> return violations
[PATH2] if(null != value && 0 != value.trim().length())=F -> return violations
[EXCEPTIONS] declares UnsupportedException
[NEW] HashSet<>, Violatio... | true | ok | {"focal": {"class": "BlankConstraint", "name": "validate", "signature": "Set<Violation> validate() throws UnsupportedException", "start_line": 3, "modifiers": "@NonNull @Override public", "params": [], "return_type": "Set<Violation>"}, "class_info": {"name": "BlankConstraint", "kind": "class", "modifiers": "", "supercl... |
60536546_10 | class RequirementsChecker {
RequirementsReport checkRequirements() {
boolean result = true;
List<RequirementReport> requirementsReports = new ArrayList<>(mRequirements.size());
for (Requirement requirement : mRequirements) {
RequirementReport report = requirement.check();
... | final RequirementsChecker checker = new RequirementsChecker(Arrays.asList(
new FulfilledRequirement(),
new FulfilledRequirement(),
new FulfilledRequirement()
));
assertThat(checker.checkRequirements().isFulfilled()).isTrue();
}
} | [FOCAL] RequirementsReport RequirementsChecker.checkRequirements()
[CLASS] class RequirementsChecker
[METRICS] loc=12 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] mRequirements.size/0, Requirement.check/0, RequirementReport.isFulfilled/0, List<RequirementReport>.add/1
[NEW] ArrayList<>, Require... | /* static context
[FOCAL] RequirementsReport RequirementsChecker.checkRequirements()
[PATH1] foreach(Requirement requirement : mRequirements)=T -> exit loop -> return new RequirementsReport(result, requirementsReports)
[PATH2] foreach(Requirement requirement : mRequirements)=F -> return new RequirementsReport(result, r... | /* static context
[FOCAL] RequirementsReport RequirementsChecker.checkRequirements()
[PATH1] foreach(Requirement requirement : mRequirements)=T -> exit loop -> return new RequirementsReport(result, requirementsReports)
[PATH2] foreach(Requirement requirement : mRequirements)=F -> return new RequirementsReport(result, r... | true | ok | {"focal": {"class": "RequirementsChecker", "name": "checkRequirements", "signature": "RequirementsReport checkRequirements()", "start_line": 3, "modifiers": "", "params": [], "return_type": "RequirementsReport"}, "class_info": {"name": "RequirementsChecker", "kind": "class", "modifiers": "", "superclass": null, "interf... |
60561103_1 | class EasyOkCallback implements Callback {
public abstract void failure(Throwable t)public abstract void failure(Throwable t);
public abstract void failure(Throwable t)public EasyOkCallback();
public abstract void failure(Throwable t)public abstract void success(@NonNull Response response);
public abstract void fai... | Request request = new Request.Builder()
.url("https://www.google.com/404")
.build();
client.newCall(request).enqueue(new EasyOkCallback() {
@Override
public void success(@NonNull Response response) {
Assert.fail("call should have f... | [FOCAL] public abstract void EasyOkCallback.failure(Throwable t)
[CLASS] class EasyOkCallback implements Callback
[METRICS] loc=1 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CLASS-MEMBERS] EasyOkCallback(); void success(Response response); EasyOkCallback allowNullBodies(boolean allowNullBodies); EasyOkCallbac... | /* static context
[FOCAL] public abstract void EasyOkCallback.failure(Throwable t)
*/
| /* static context
[FOCAL] public abstract void EasyOkCallback.failure(Throwable t)
*/
class EasyOkCallback implements Callback {
public abstract void failure(Throwable t)public abstract void failure(Throwable t);
public abstract void failure(Throwable t)public EasyOkCallback();
public abstract void failure(Throwabl... | true | partial | {"focal": {"class": "EasyOkCallback", "name": "failure", "signature": "void failure(Throwable t)", "start_line": 3, "modifiers": "public abstract", "params": [{"name": "t", "type": "Throwable"}], "return_type": "void"}, "class_info": {"name": "EasyOkCallback", "kind": "class", "modifiers": "", "superclass": null, "inte... |
60573613_135 | class ItemUtils {
public static List<Integer> toItemList(final String itemsString) {
if (Strings.isNullOrEmpty(itemsString)) {
return Collections.emptyList();
}
String[] items = itemsString.split(DELIMITER);
List<Integer> result = new ArrayList<>(items.length);
f... | assertThat(ItemUtils.toItemList(""), is(Collections.EMPTY_LIST));
}
} | [FOCAL] public static List<Integer> ItemUtils.toItemList(String itemsString)
[CLASS] class ItemUtils
[METRICS] loc=14 cc=4 branches=2 loops=1 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] Strings.isNullOrEmpty/1, Collections.emptyList/0, String.split/1, Integer.parseInt/1, List<Integer>.contains/1, List<Integer>.add/1
... | /* static context
[FOCAL] public static List<Integer> ItemUtils.toItemList(String itemsString)
[PATH1] if(Strings.isNullOrEmpty(itemsString))=F -> foreach(String each : items)=T -> if(!result.contains(item))=T -> exit loop -> return result
[PATH2] if(Strings.isNullOrEmpty(itemsString))=T -> return Collections.emptyList... | /* static context
[FOCAL] public static List<Integer> ItemUtils.toItemList(String itemsString)
[PATH1] if(Strings.isNullOrEmpty(itemsString))=F -> foreach(String each : items)=T -> if(!result.contains(item))=T -> exit loop -> return result
[PATH2] if(Strings.isNullOrEmpty(itemsString))=T -> return Collections.emptyList... | true | ok | {"focal": {"class": "ItemUtils", "name": "toItemList", "signature": "List<Integer> toItemList(String itemsString)", "start_line": 3, "modifiers": "public static", "params": [{"name": "itemsString", "type": "String"}], "return_type": "List<Integer>"}, "class_info": {"name": "ItemUtils", "kind": "class", "modifiers": "",... |
60578004_96 | class SensitiveInfoUtils {
public static List<String> filterSensitiveIps(final List<String> result) {
final Map<String, String> fakeIpMap = new HashMap<String, String>();
final String fakeIpSample = "ip";
final AtomicInteger step = new AtomicInteger();
Function<String, String> func ... | List<String> content = new ArrayList<String>();
content.add("/simpleElasticDemoJob/servers");
content.add("/simpleElasticDemoJob/leader");
assertThat(SensitiveInfoUtils.filterSensitiveIps(content), is(content));
}
} | [FOCAL] public static List<String> SensitiveInfoUtils.filterSensitiveIps(List<String> result)
[CLASS] class SensitiveInfoUtils
[METRICS] loc=26 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] Pattern.compile/1, Pattern.matcher/1, Matcher.find/0, Matcher.group/0, Map<String, String>.get/1, Strings.... | /* static context
[FOCAL] public static List<String> SensitiveInfoUtils.filterSensitiveIps(List<String> result)
[INPUTS] branches=- | result=result
[COLLABORATORS] param result:List<String> replace/2
[NEW] HashMap<String, String>, AtomicInteger, Function<String, String>
[CALLS-EXTERNAL] Pattern.compile/1, Pattern.match... | /* static context
[FOCAL] public static List<String> SensitiveInfoUtils.filterSensitiveIps(List<String> result)
[INPUTS] branches=- | result=result
[COLLABORATORS] param result:List<String> replace/2
[NEW] HashMap<String, String>, AtomicInteger, Function<String, String>
[CALLS-EXTERNAL] Pattern.compile/1, Pattern.match... | true | ok | {"focal": {"class": "SensitiveInfoUtils", "name": "filterSensitiveIps", "signature": "List<String> filterSensitiveIps(List<String> result)", "start_line": 3, "modifiers": "public static", "params": [{"name": "result", "type": "List<String>"}], "return_type": "List<String>"}, "class_info": {"name": "SensitiveInfoUtils",... |
60598401_25 | class MaterialHandlerService implements IMaterialHandlerService {
@Override
public String checkPipelineForTriggerMaterials(PipelineDefinition pipelineDefinition) {
List<String> triggerMaterials = new ArrayList<>();
List<MaterialDefinition> materialDefinitions =
(List<MaterialDef... | // Arrange
PipelineDefinition pipelineDefinition = new PipelineDefinition();
List<MaterialDefinition> materialDefinitions = new ArrayList<>();
GitMaterial gitMaterial = new GitMaterial();
gitMaterial.setName(MATERIAL_ONE);
gitMaterial.setPollingForChanges(true);
m... | [FOCAL] @Override public String MaterialHandlerService.checkPipelineForTriggerMaterials(PipelineDefinition pipelineDefinition)
[CLASS] class MaterialHandlerService implements IMaterialHandlerService
[METRICS] loc=35 cc=7 branches=5 loops=1 returns=1 throws=0 nesting=3
[CALLS-INTERNAL] void setDestinationOfGitMaterial(M... | /* static context
[FOCAL] @Override public String MaterialHandlerService.checkPipelineForTriggerMaterials(PipelineDefinition pipelineDefinition)
[PATH1] foreach(MaterialDefinition materialDefinition : materialDefinitions)=T -> if(materialDefinition.isPollingForChanges())=T -> if(!oldError.equals(newError))=T -> if(!lat... | /* static context
[FOCAL] @Override public String MaterialHandlerService.checkPipelineForTriggerMaterials(PipelineDefinition pipelineDefinition)
[PATH1] foreach(MaterialDefinition materialDefinition : materialDefinitions)=T -> if(materialDefinition.isPollingForChanges())=T -> if(!oldError.equals(newError))=T -> if(!lat... | true | ok | {"focal": {"class": "MaterialHandlerService", "name": "checkPipelineForTriggerMaterials", "signature": "String checkPipelineForTriggerMaterials(PipelineDefinition pipelineDefinition)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "pipelineDefinition", "type": "PipelineDefinition"}], "return_typ... |
60642785_0 | class UtilMethods {
static String extractYoutubeID(String url) {
String pattern = "(?<=youtu.be/|youtube.com/watch\\?v=|/videos/|embed/)[^#&\\?]*";
Pattern compiledPattern = Pattern.compile(pattern);
Matcher matcher = compiledPattern.matcher(url);
if (matcher.find()) {
r... | assertEquals(UtilMethods.extractYoutubeID("youtube.com/watch?v=oGHWghMfbEU"), "oGHWghMfbEU");
assertEquals(UtilMethods.extractYoutubeID("https://youtube.com/watch?v=oGHWghMfbEU"), "oGHWghMfbEU");
assertEquals(UtilMethods.extractYoutubeID("https://www.youtube.com/watch?v=oGHWghMfbEU"), "oGHWghMfb... | [FOCAL] static String UtilMethods.extractYoutubeID(String url)
[CLASS] class UtilMethods
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] Pattern.compile/1, Pattern.matcher/1, Matcher.find/0, Matcher.group/0
[PATH1] if(matcher.find())=T -> return matcher.group()
[PATH2] if(matcher.... | /* static context
[FOCAL] static String UtilMethods.extractYoutubeID(String url)
[PATH1] if(matcher.find())=T -> return matcher.group()
[PATH2] if(matcher.find())=F -> return null
[INPUTS] branches=url | result=url
[CALLS-EXTERNAL] Pattern.compile/1, Pattern.matcher/1, Matcher.find/0, Matcher.group/0
*/
| /* static context
[FOCAL] static String UtilMethods.extractYoutubeID(String url)
[PATH1] if(matcher.find())=T -> return matcher.group()
[PATH2] if(matcher.find())=F -> return null
[INPUTS] branches=url | result=url
[CALLS-EXTERNAL] Pattern.compile/1, Pattern.matcher/1, Matcher.find/0, Matcher.group/0
*/
class UtilMetho... | true | ok | {"focal": {"class": "UtilMethods", "name": "extractYoutubeID", "signature": "String extractYoutubeID(String url)", "start_line": 3, "modifiers": "static", "params": [{"name": "url", "type": "String"}], "return_type": "String"}, "class_info": {"name": "UtilMethods", "kind": "class", "modifiers": "", "superclass": null, ... |
60648293_3 | class KafkaBinderMetrics implements MeterBinder, ApplicationListener<BindingCreatedEvent> {
@Override
public void bindTo(MeterRegistry registry) {
this.scheduler = Executors.newScheduledThreadPool(this.binder.getTopicsInUse().size());
for (Map.Entry<String, KafkaMessageChannelBinder.TopicInformation> topicInfo... | List<PartitionInfo> partitions = partitions(new Node(0, null, 0));
topicsInUse.put(TEST_TOPIC, new TopicInformation(null, partitions, false));
metrics.bindTo(meterRegistry);
assertThat(meterRegistry.getMeters()).isEmpty();
}
} | [FOCAL] @Override public void KafkaBinderMetrics.bindTo(MeterRegistry registry)
[CLASS] class KafkaBinderMetrics implements MeterBinder, ApplicationListener<BindingCreatedEvent>
[METRICS] loc=26 cc=3 branches=1 loops=1 returns=0 throws=0 nesting=2
[CALLS-INTERNAL] Runnable computeUnconsumedMessagesRunnable(String topic... | /* static context
[FOCAL] @Override public void KafkaBinderMetrics.bindTo(MeterRegistry registry)
[PATH1] foreach(Map.Entry<String, KafkaMessageChannelBinder.TopicInformation> topicInfo : this.binder .getTopicsInUse().entrySet())=T -> if(!topicInfo.getValue().isConsumerTopic())=T -> exit loop
[PATH2] foreach(Map.Entry<... | /* static context
[FOCAL] @Override public void KafkaBinderMetrics.bindTo(MeterRegistry registry)
[PATH1] foreach(Map.Entry<String, KafkaMessageChannelBinder.TopicInformation> topicInfo : this.binder .getTopicsInUse().entrySet())=T -> if(!topicInfo.getValue().isConsumerTopic())=T -> exit loop
[PATH2] foreach(Map.Entry<... | true | ok | {"focal": {"class": "KafkaBinderMetrics", "name": "bindTo", "signature": "void bindTo(MeterRegistry registry)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "registry", "type": "MeterRegistry"}], "return_type": "void"}, "class_info": {"name": "KafkaBinderMetrics", "kind": "class", "modifiers": ... |
60648780_0 | class SnomedCtIdentifier {
public long namespaceIdentifier() {
if (releaseIdentifier() == 1) {
int len = _id.length();
return Long.valueOf(_id.substring(len-10, len-3));
}
return 0;
}
public SnomedCtIdentifier(long id);
private boolean _isValid();
public boolean isValidConcept();
public boolean is... | assertEquals(989121L, new SnomedCtIdentifier(999999990989121104L).namespaceIdentifier());
assertEquals(1, new SnomedCtIdentifier(1290000001117L).namespaceIdentifier());
assertEquals(1, new SnomedCtIdentifier(40000001132L).namespaceIdentifier());
}
} | [FOCAL] public long SnomedCtIdentifier.namespaceIdentifier()
[CLASS] class SnomedCtIdentifier
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] int releaseIdentifier()
[CALLS-EXTERNAL] _id.length/0, Long.valueOf/1, _id.substring/2
[PATH1] if(releaseIdentifier() == 1)=T -> return Long... | /* static context
[FOCAL] public long SnomedCtIdentifier.namespaceIdentifier()
[PATH1] if(releaseIdentifier() == 1)=T -> return Long.valueOf(_id.substring(len-10, len-3))
[PATH2] if(releaseIdentifier() == 1)=F -> return 0
[CALLS-INTERNAL] int releaseIdentifier()
[CALLS-EXTERNAL] _id.length/0, Long.valueOf/1, _id.substr... | /* static context
[FOCAL] public long SnomedCtIdentifier.namespaceIdentifier()
[PATH1] if(releaseIdentifier() == 1)=T -> return Long.valueOf(_id.substring(len-10, len-3))
[PATH2] if(releaseIdentifier() == 1)=F -> return 0
[CALLS-INTERNAL] int releaseIdentifier()
[CALLS-EXTERNAL] _id.length/0, Long.valueOf/1, _id.substr... | true | ok | {"focal": {"class": "SnomedCtIdentifier", "name": "namespaceIdentifier", "signature": "long namespaceIdentifier()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "long"}, "class_info": {"name": "SnomedCtIdentifier", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields... |
60648874_18 | class Topping {
void updateColor(@ColorInt int color){
this.previousColor = this.color;
this.color = color;
}
Topping(int id);
public int getId();
public int getColor();
public int getPreviousColor();
@Override public boolean equals(Object o);
@Override public int ha... | int newColor = -123456;
mToppingMock.updateColor(newColor);
int color = mToppingMock.getColor();
int prevColor = mToppingMock.getPreviousColor();
assertThat(color, is(newColor));
assertThat(prevColor, is(MOCK_DEFAULT_COLOR));
}
} | [FOCAL] void Topping.updateColor(int color)
[CLASS] class Topping
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[FIELDS] read=color | write=color, previousColor
[STATE] color via getColor(), previousColor via getPreviousColor()
[DATAFLOW] color@param->L3
[CLASS-MEMBERS] Topping(int id); int getId... | /* static context
[FOCAL] void Topping.updateColor(int color)
[STATE] color via getColor(), previousColor via getPreviousColor()
[FIELDS] read=color | write=color, previousColor
*/
| /* static context
[FOCAL] void Topping.updateColor(int color)
[STATE] color via getColor(), previousColor via getPreviousColor()
[FIELDS] read=color | write=color, previousColor
*/
class Topping {
void updateColor(@ColorInt int color){
this.previousColor = this.color;
this.color = color;
}
... | true | ok | {"focal": {"class": "Topping", "name": "updateColor", "signature": "void updateColor(int color)", "start_line": 3, "modifiers": "", "params": [{"name": "color", "type": "int"}], "return_type": "void"}, "class_info": {"name": "Topping", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": ... |
60683863_130 | class ReflectUtils {
public static Method findMethodByMethodSignature(Class<?> clazz, String methodName, String[] parameterTypes)
throws NoSuchMethodException, ClassNotFoundException {
String signature = clazz.getName() + "." + methodName;
if(parameterTypes != null && parameterTypes.length > 0){... | try {
ReflectUtils.findMethodByMethodSignature(TestedClass.class, "notExsited", null);
fail();
} catch (NoSuchMethodException expected) {
assertThat(expected.getMessage(), containsString("No such method "));
assertThat(expected.getMessage(), containsString("i... | [FOCAL] public static Method ReflectUtils.findMethodByMethodSignature(Class<?> clazz, String methodName, String[] parameterTypes)
[CLASS] class ReflectUtils
[METRICS] loc=37 cc=9 branches=6 loops=2 returns=2 throws=2 nesting=3
[CALLS-EXTERNAL] Class<?>.getName/0, StringUtils.join/1, Signature_METHODS_CACHE.get/1, Class... | /* static context
[FOCAL] public static Method ReflectUtils.findMethodByMethodSignature(Class<?> clazz, String methodName, String[] parameterTypes)
[THROWS-WHEN] NoSuchMethodException when parameterTypes != null && parameterTypes.length > 0 && !(method != null) && parameterTypes == null && foreach(Method m : clazz.getM... | /* static context
[FOCAL] public static Method ReflectUtils.findMethodByMethodSignature(Class<?> clazz, String methodName, String[] parameterTypes)
[THROWS-WHEN] NoSuchMethodException when parameterTypes != null && parameterTypes.length > 0 && !(method != null) && parameterTypes == null && foreach(Method m : clazz.getM... | true | ok | {"focal": {"class": "ReflectUtils", "name": "findMethodByMethodSignature", "signature": "Method findMethodByMethodSignature(Class<?> clazz, String methodName, String[] parameterTypes) throws NoSuchMethodException, ClassNotFoundException", "start_line": 3, "modifiers": "public static", "params": [{"name": "clazz", "type... |
60686962_118 | class NetPlan extends NetworkElement {
public void removeAllMulticastTreesUnused(double toleranceTrafficAndCapacityValueToConsiderUnusedTree, NetworkLayer... optionalLayerParameter)
{
checkIsModifiable();
NetworkLayer layer = checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter);
... | np.removeAllMulticastTreesUnused(0.1 , lowerLayer);
assertEquals(np.getNumberOfMulticastTrees(lowerLayer) , 2);
}
} | [FOCAL] public void NetPlan.removeAllMulticastTreesUnused(double toleranceTrafficAndCapacityValueToConsiderUnusedTree, NetworkLayer... optionalLayerParameter)
[CLASS] class NetPlan extends NetworkElement
[METRICS] loc=9 cc=4 branches=2 loops=1 returns=0 throws=0 nesting=2
[CALLS-INTERNAL] NetworkLayer checkInThisNetPla... | class NetPlan extends NetworkElement {
public void removeAllMulticastTreesUnused(double toleranceTrafficAndCapacityValueToConsiderUnusedTree, NetworkLayer... optionalLayerParameter)
{
checkIsModifiable();
NetworkLayer layer = checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter);
... | false | ok | {"focal": {"class": "NetPlan", "name": "removeAllMulticastTreesUnused", "signature": "void removeAllMulticastTreesUnused(double toleranceTrafficAndCapacityValueToConsiderUnusedTree, NetworkLayer... optionalLayerParameter)", "start_line": 3, "modifiers": "public", "params": [{"name": "toleranceTrafficAndCapacityValueToC... | |
60701545_222 | class TransformTask extends StreamBasedTask implements Context {
@TaskAction
void transform(final IncrementalTaskInputs incrementalTaskInputs)
throws IOException, TransformException, InterruptedException {
final ReferenceHolder<List<TransformInput>> consumedInputs = ReferenceHolder.empty()... | // create a stream and add it to the pipeline
File jarFile = new File("jar file");
TransformStream projectClass = OriginalStream.builder()
.addContentType(DefaultContentType.CLASSES)
.addScope(Scope.PROJECT)
.setJar(jarFile)
.setDep... | [FOCAL] @TaskAction void TransformTask.transform(IncrementalTaskInputs incrementalTaskInputs)
[CLASS] class TransformTask extends StreamBasedTask implements Context
[METRICS] loc=92 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=2
[CALLS-INTERNAL] AndroidStudioStats.GradleTransformExecution.Type getTransformType(Cl... | class TransformTask extends StreamBasedTask implements Context {
@TaskAction
void transform(final IncrementalTaskInputs incrementalTaskInputs)
throws IOException, TransformException, InterruptedException {
final ReferenceHolder<List<TransformInput>> consumedInputs = ReferenceHolder.empty()... | false | ok | {"focal": {"class": "TransformTask", "name": "transform", "signature": "void transform(IncrementalTaskInputs incrementalTaskInputs) throws IOException, TransformException, InterruptedException", "start_line": 3, "modifiers": "@TaskAction", "params": [{"name": "incrementalTaskInputs", "type": "IncrementalTaskInputs"}], ... | |
60737153_13 | class AuthenticationClient {
public boolean isLoggedIn() {
return loginStatus;
}
public AuthenticationClient(String sessionUrl, String keyUrl);
public AuthenticationClient(String sessionUrl, String keyUrl, Client httpClient);
public AuthenticationClient(SymphonyClientConfig symphonyClie... |
assertEquals(false, authenticationClient.isLoggedIn());
}
} | [FOCAL] public boolean AuthenticationClient.isLoggedIn()
[CLASS] class AuthenticationClient
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] AuthenticationClient(String sessionUrl, String keyUrl); AuthenticationClient(String sessionUrl, String keyUrl, Client httpClient); Authenticati... | /* static context
[FOCAL] public boolean AuthenticationClient.isLoggedIn()
*/
| /* static context
[FOCAL] public boolean AuthenticationClient.isLoggedIn()
*/
class AuthenticationClient {
public boolean isLoggedIn() {
return loginStatus;
}
public AuthenticationClient(String sessionUrl, String keyUrl);
public AuthenticationClient(String sessionUrl, String keyUrl, Client h... | true | ok | {"focal": {"class": "AuthenticationClient", "name": "isLoggedIn", "signature": "boolean isLoggedIn()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "AuthenticationClient", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"na... |
60773713_1 | class ConsecutiveDaysAccumulateFunction implements AccumulateFunction {
@Override
public void init(Serializable context) throws Exception {
ConsecutiveDaysBuckets buckets = (ConsecutiveDaysBuckets) context;
buckets.buckets = new HashMap<>();
}
@Override public void accumulate(Serializa... | ConsecutiveDaysAccumulateFunction f = new ConsecutiveDaysAccumulateFunction();
ConsecutiveDaysAccumulateFunction.ConsecutiveDaysBuckets buckets = new ConsecutiveDaysAccumulateFunction.ConsecutiveDaysBuckets();
f.init(buckets);
Assert.assertNotNull(buckets.buckets);
Assert.assertE... | [FOCAL] @Override public void ConsecutiveDaysAccumulateFunction.init(Serializable context)
[CLASS] class ConsecutiveDaysAccumulateFunction implements AccumulateFunction
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[NEW] HashMap<>
[EXCEPTIONS] declares Exception
[DATAFLOW] buckets@L3->L4; context... | /* static context
[FOCAL] @Override public void ConsecutiveDaysAccumulateFunction.init(Serializable context)
[EXCEPTIONS] declares Exception
[NEW] HashMap<>
*/
| /* static context
[FOCAL] @Override public void ConsecutiveDaysAccumulateFunction.init(Serializable context)
[EXCEPTIONS] declares Exception
[NEW] HashMap<>
*/
class ConsecutiveDaysAccumulateFunction implements AccumulateFunction {
@Override
public void init(Serializable context) throws Exception {
Con... | true | ok | {"focal": {"class": "ConsecutiveDaysAccumulateFunction", "name": "init", "signature": "void init(Serializable context) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "context", "type": "Serializable"}], "return_type": "void"}, "class_info": {"name": "ConsecutiveDaysAccumulateFu... |
60780272_2 | class QuerySegmenterDefaultImpl implements QuerySegmenter {
@Override
public List<TypedSegment> segment(String query) {
List<TypedSegment> typedSegments = new ArrayList<TypedSegment>();
String[] segments = query.split("\\s+");
// Evaluate segments from left to right
for (int i = 0; i < segments.... |
String query = "pizza campbell park";
List<TypedSegment> segments = segmenter.segment(query);
assertEquals(1, segments.size());
TypedSegment segment = segments.get(0);
assertEquals(AreaTypedSegment.TYPE, segment.getType());
assertEquals("Campbell Park", segment.getLabel());
assertEquals("c... | [FOCAL] @Override public List<TypedSegment> QuerySegmenterDefaultImpl.segment(String query)
[CLASS] class QuerySegmenterDefaultImpl implements QuerySegmenter
[METRICS] loc=44 cc=9 branches=3 loops=5 returns=1 throws=0 nesting=4
[CALLS-EXTERNAL] String.split/1, StringBuilder.append/1, StringBuilder.toString/0, AbstractS... | /* static context
[FOCAL] @Override public List<TypedSegment> QuerySegmenterDefaultImpl.segment(String query)
[PATH1] for(i < segments.length)=T -> for(j >= 0)=T -> if(last >= segments.length)=F -> for(k <= last)=T -> if(k != last)=T -> exit loop -> foreach(AbstractSegmentDictionary dictionary : dictionaries)=T -> if(l... | /* static context
[FOCAL] @Override public List<TypedSegment> QuerySegmenterDefaultImpl.segment(String query)
[PATH1] for(i < segments.length)=T -> for(j >= 0)=T -> if(last >= segments.length)=F -> for(k <= last)=T -> if(k != last)=T -> exit loop -> foreach(AbstractSegmentDictionary dictionary : dictionaries)=T -> if(l... | true | ok | {"focal": {"class": "QuerySegmenterDefaultImpl", "name": "segment", "signature": "List<TypedSegment> segment(String query)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "query", "type": "String"}], "return_type": "List<TypedSegment>"}, "class_info": {"name": "QuerySegmenterDefaultImpl", "kind"... |
60794667_81 | class BasicNeuralNet implements NeuralNet, Serializable {
public double[] getOutput() {
if (currentNetOutput == null) {
return new double[netOutputDim];
}
return currentNetOutput;
}
public BasicNeuralNet(int[] netTopology, double biasInput,
Class<? extends... | double[] zeroArray = new double[NET_TOPOLOGY[NET_TOPOLOGY.length - 1]];
Arrays.fill(zeroArray, 0);
assertTrue("Network output is not as expected.", Arrays.equals(zeroArray, neuralNet.getOutput()));
}
} | [FOCAL] public double[] BasicNeuralNet.getOutput()
[CLASS] class BasicNeuralNet implements NeuralNet, Serializable
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[PATH1] if(currentNetOutput == null)=T -> return new double[netOutputDim]
[PATH2] if(currentNetOutput == null)=F -> return currentNetOut... | /* static context
[FOCAL] public double[] BasicNeuralNet.getOutput()
[PATH1] if(currentNetOutput == null)=T -> return new double[netOutputDim]
[PATH2] if(currentNetOutput == null)=F -> return currentNetOutput
*/
| /* static context
[FOCAL] public double[] BasicNeuralNet.getOutput()
[PATH1] if(currentNetOutput == null)=T -> return new double[netOutputDim]
[PATH2] if(currentNetOutput == null)=F -> return currentNetOutput
*/
class BasicNeuralNet implements NeuralNet, Serializable {
public double[] getOutput() {
if (cur... | true | ok | {"focal": {"class": "BasicNeuralNet", "name": "getOutput", "signature": "double[] getOutput()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "double[]"}, "class_info": {"name": "BasicNeuralNet", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "NeuralNet, Serializable", "field... |
60851319_52 | class LdapUtils {
public static String escapeCommonName(final String name)
{
if (name == null) {
return null;
}
final StringBuilder buf = new StringBuilder(name.length() + 5);
for (int i = 0; i < name.length(); i++) {
final char ch = name.charAt(i);
if (",=+<>#;\\\"".indexOf(ch) >... | assertNull(LdapUtils.escapeCommonName(null));
assertEquals("", LdapUtils.escapeCommonName(""));
assertEquals("\\,", LdapUtils.escapeCommonName(","));
assertEquals("\\,\\=\\+\\<\\>\\#\\;\\\\\\\"", LdapUtils.escapeCommonName(",=+<>#;\\\""));
}
} | [FOCAL] public static String LdapUtils.escapeCommonName(String name)
[CLASS] class LdapUtils
[METRICS] loc=15 cc=4 branches=2 loops=1 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] String.length/0, String.charAt/1, ",=+<>#;\\\"".indexOf/1, StringBuilder.append/1, StringBuilder.toString/0
[NEW] StringBuilder
[PATH1] if(n... | /* static context
[FOCAL] public static String LdapUtils.escapeCommonName(String name)
[PATH1] if(name == null)=F -> for(i < name.length())=T -> if(",=+<>#;\\\"".indexOf(ch) >= 0)=T -> exit loop -> return buf.toString()
[PATH2] if(name == null)=T -> return null
[PATH3] if(name == null)=F -> for(i < name.length())=F -> ... | /* static context
[FOCAL] public static String LdapUtils.escapeCommonName(String name)
[PATH1] if(name == null)=F -> for(i < name.length())=T -> if(",=+<>#;\\\"".indexOf(ch) >= 0)=T -> exit loop -> return buf.toString()
[PATH2] if(name == null)=T -> return null
[PATH3] if(name == null)=F -> for(i < name.length())=F -> ... | true | ok | {"focal": {"class": "LdapUtils", "name": "escapeCommonName", "signature": "String escapeCommonName(String name)", "start_line": 3, "modifiers": "public static", "params": [{"name": "name", "type": "String"}], "return_type": "String"}, "class_info": {"name": "LdapUtils", "kind": "class", "modifiers": "", "superclass": n... |
60913395_10 | class PrayerDownloader {
Observable<PrayerContext> getPrayerTimes(String code) {
return getCurrentPrayerTimesByCode(code)
.zipWith(getNextPrayerTimesByCode(code), mPrayerContextCreator);
}
@Inject PrayerDownloader(DateTimeHelper helper,
PrayerClient client,
... | String code = "ext-153";
PrayerDownloader d = new PrayerDownloader(
mDateHelper,
mPrayerClient,
mPrayerCache,
mInterfacePreferences
);
when(mLocation.getLatitude())
.thenReturn(3.28011);
when(mLoca... | [FOCAL] Observable<PrayerContext> PrayerDownloader.getPrayerTimes(String code)
[CLASS] class PrayerDownloader
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Observable<PrayerData> getCurrentPrayerTimesByCode(String code); Observable<PrayerData> getNextPrayerTimesByCode(String code... | /* static context
[FOCAL] Observable<PrayerContext> PrayerDownloader.getPrayerTimes(String code)
[INPUTS] branches=- | result=code
[CALLS-INTERNAL] Observable<PrayerData> getCurrentPrayerTimesByCode(String code); Observable<PrayerData> getNextPrayerTimesByCode(String code)
[CALLS-EXTERNAL] getCurrentPrayerTimesByCode(c... | /* static context
[FOCAL] Observable<PrayerContext> PrayerDownloader.getPrayerTimes(String code)
[INPUTS] branches=- | result=code
[CALLS-INTERNAL] Observable<PrayerData> getCurrentPrayerTimesByCode(String code); Observable<PrayerData> getNextPrayerTimesByCode(String code)
[CALLS-EXTERNAL] getCurrentPrayerTimesByCode(c... | true | ok | {"focal": {"class": "PrayerDownloader", "name": "getPrayerTimes", "signature": "Observable<PrayerContext> getPrayerTimes(String code)", "start_line": 3, "modifiers": "", "params": [{"name": "code", "type": "String"}], "return_type": "Observable<PrayerContext>"}, "class_info": {"name": "PrayerDownloader", "kind": "class... |
60923411_3 | class CredentialStore {
synchronized void setNewAccessToken(@NonNull String accessToken, int expiresIn) {
if(accessToken.length() == 0)
throw new IllegalArgumentException("accessToken.isEmpty()");
this.accessToken = accessToken;
this.expiresIn = expiresIn;
this.tokenAc... | credentialStore.authenticate(accessToken, refreshToken, expiresIn, new Date(1000));
credentialStore.setNewAccessToken(accessToken, expiresIn);
assertEquals(credentialStore.getAuthStatus(), CredentialStore.AUTHENTICATED);
assertTrue(credentialStore.getTokenAcquisitionTime().getTime() != n... | [FOCAL] synchronized void CredentialStore.setNewAccessToken(String accessToken, int expiresIn)
[CLASS] class CredentialStore
[METRICS] loc=13 cc=2 branches=1 loops=0 returns=0 throws=1 nesting=1
[CALLS-EXTERNAL] String.length/0, persister.persistUser/1
[NEW] IllegalArgumentException, Date
[FIELDS] write=accessToken, ex... | /* static context
[FOCAL] synchronized void CredentialStore.setNewAccessToken(String accessToken, int expiresIn)
[THROWS-WHEN] IllegalArgumentException when accessToken.length() == 0
[PATH1] if(accessToken.length() == 0)=T -> throw new IllegalArgumentException("accessToken.isEmpty()")
[PATH2] if(accessToken.length() ==... | /* static context
[FOCAL] synchronized void CredentialStore.setNewAccessToken(String accessToken, int expiresIn)
[THROWS-WHEN] IllegalArgumentException when accessToken.length() == 0
[PATH1] if(accessToken.length() == 0)=T -> throw new IllegalArgumentException("accessToken.isEmpty()")
[PATH2] if(accessToken.length() ==... | true | ok | {"focal": {"class": "CredentialStore", "name": "setNewAccessToken", "signature": "void setNewAccessToken(String accessToken, int expiresIn)", "start_line": 3, "modifiers": "synchronized", "params": [{"name": "accessToken", "type": "String"}, {"name": "expiresIn", "type": "int"}], "return_type": "void"}, "class_info": {... |
60963516_8 | class BookingEarningsCalculator extends EarningsCalculator {
public float calculateEarnings(Collection<? extends BookingBean> bookings) {
if (isPaymentDone()) {
bookings = bookings.stream().filter(b -> b.isPaymentDone()).collect(Collectors.toCollection(LinkedHashSet::new));
}
if... | c = new BookingEarningsCalculator();
BookingBean b = BookingBeanTest.newInstance(LocalDate.of(2012, 02, 02), LocalDate.of(2012, 2, 5));
b.setPaymentDone(true);
b.setGrossEarningsExpression("30");
float result = c.calculateEarnings(b);
assertThat(result, is(30f));
}
} | [FOCAL] public float BookingEarningsCalculator.calculateEarnings(Collection<? extends BookingBean> bookings)
[CLASS] class BookingEarningsCalculator extends EarningsCalculator
[METRICS] loc=15 cc=4 branches=2 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] isPaymentDone/0 (inherited), bookings.stream().filter(b -... | /* static context
[FOCAL] public float BookingEarningsCalculator.calculateEarnings(Collection<? extends BookingBean> bookings)
[PATH1] if(isPaymentDone())=T -> if(getDateRange() != null)=T -> foreach(BookingBean b : bookings)=T -> exit loop -> return result.getNumber().floatValue()
[PATH2] if(isPaymentDone())=F -> if(g... | /* static context
[FOCAL] public float BookingEarningsCalculator.calculateEarnings(Collection<? extends BookingBean> bookings)
[PATH1] if(isPaymentDone())=T -> if(getDateRange() != null)=T -> foreach(BookingBean b : bookings)=T -> exit loop -> return result.getNumber().floatValue()
[PATH2] if(isPaymentDone())=F -> if(g... | true | ok | {"focal": {"class": "BookingEarningsCalculator", "name": "calculateEarnings", "signature": "float calculateEarnings(Collection<? extends BookingBean> bookings)", "start_line": 3, "modifiers": "public", "params": [{"name": "bookings", "type": "Collection<? extends BookingBean>"}], "return_type": "float"}, "class_info": ... |
61105758_18 | class LocalRegionCache implements RegionCache {
void cleanup() {
final int maxSize = evictionConfig.getMaxSize();
final long timeToLive = evictionConfig.getTimeToLive().toMillis();
boolean limitSize = maxSize > 0 && maxSize != Integer.MAX_VALUE;
if (limitSize || timeToLive > 0) {
... | MapConfig mapConfig = mock(MapConfig.class);
Config config = mock(Config.class);
when(config.findMapConfig(eq(CACHE_NAME))).thenReturn(mapConfig);
com.hazelcast.config.EvictionConfig maxSizeConfig = mock(com.hazelcast.config.EvictionConfig.class);
when(mapConfig.getEvictionConf... | [FOCAL] void LocalRegionCache.cleanup()
[CLASS] class LocalRegionCache implements RegionCache
[METRICS] loc=14 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=2
[CALLS-INTERNAL] List<EvictionEntry> searchEvictableEntries(long timeToLive, boolean limitSize); int calculateEvictionRate(int diff, int maxSize); void evic... | /* static context
[FOCAL] void LocalRegionCache.cleanup()
[PATH1] if(limitSize || timeToLive > 0)=T -> if(evictionRate > 0 && entries != null)=T
[PATH2] if(limitSize || timeToLive > 0)=F
[PATH3] if(limitSize || timeToLive > 0)=T -> if(evictionRate > 0 && entries != null)=F
[COLLABORATORS] field evictionConfig getMaxSiz... | /* static context
[FOCAL] void LocalRegionCache.cleanup()
[PATH1] if(limitSize || timeToLive > 0)=T -> if(evictionRate > 0 && entries != null)=T
[PATH2] if(limitSize || timeToLive > 0)=F
[PATH3] if(limitSize || timeToLive > 0)=T -> if(evictionRate > 0 && entries != null)=F
[COLLABORATORS] field evictionConfig getMaxSiz... | true | ok | {"focal": {"class": "LocalRegionCache", "name": "cleanup", "signature": "void cleanup()", "start_line": 3, "modifiers": "", "params": [], "return_type": "void"}, "class_info": {"name": "LocalRegionCache", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "RegionCache", "fields": [{"name": "CACHE_NAME"... |
61323364_6 | class CityDetailPresenter implements CityDetailContract.Presenter {
@Override
public void openCity(int cityId) {
//mView.showProgressBar(true);
mSubscriptions.clear();
Subscription subscription = mRepository
.getForecast(cityId, mView.isNetworkAvailable())
... | when(mRepository.getForecast(54353, false)).thenReturn(Observable.just(new ArrayList<>()));
when(mView.getResources()).thenReturn(mResources);
when(mResources.getString(R.string.error)).thenReturn("Error");
mPresenter.openCity(54353);
verify(mRepository).getForecast(54353, false)... | [FOCAL] @Override public void CityDetailPresenter.openCity(int cityId)
[CLASS] class CityDetailPresenter implements CityDetailContract.Presenter
[METRICS] loc=15 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] mSubscriptions.clear/0, mRepository .getForecast(cityId, mView.isNetworkAvailable....sub... | /* static context
[FOCAL] @Override public void CityDetailPresenter.openCity(int cityId)
[COLLABORATORS] field mSubscriptions clear/0,add/1; field mRepository:RepositoryDataSource getForecast/2; field mView:CityDetailContract.View isNetworkAvailable/0,showProgressBar/1
[FIELDS] read=mRepository:RepositoryDataSource, mV... | /* static context
[FOCAL] @Override public void CityDetailPresenter.openCity(int cityId)
[COLLABORATORS] field mSubscriptions clear/0,add/1; field mRepository:RepositoryDataSource getForecast/2; field mView:CityDetailContract.View isNetworkAvailable/0,showProgressBar/1
[FIELDS] read=mRepository:RepositoryDataSource, mV... | true | ok | {"focal": {"class": "CityDetailPresenter", "name": "openCity", "signature": "void openCity(int cityId)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "cityId", "type": "int"}], "return_type": "void"}, "class_info": {"name": "CityDetailPresenter", "kind": "class", "modifiers": "", "superclass": ... |
61433804_1 | class ServiceResourceUtil implements Serializable {
public void patchServiceName(Set<HasMetadata> entities) {
if(isPatchingDisabled()) {
return;
}
Map<String, Service> services = patchServiceIfInvalidName(entities);
Map<String, Route> routes = patchRouteWithService(ent... | // GIVEN
envVars.set(ServiceResourceUtil.K8S_PIPELINE_SERVICE_PATCH, "disabled");
Set<HasMetadata> entities = getEntitiesFromResource("/services/invalidservice1.yaml");
ServiceResourceUtil util = new ServiceResourceUtil();
// WHEN
util.patchServiceName(entities);
... | [FOCAL] public void ServiceResourceUtil.patchServiceName(Set<HasMetadata> entities)
[CLASS] class ServiceResourceUtil implements Serializable
[METRICS] loc=11 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] Map<String, Route> patchRouteWithService(Set<HasMetadata> resources, Map<String, Service> s... | /* static context
[FOCAL] public void ServiceResourceUtil.patchServiceName(Set<HasMetadata> entities)
[PATH1] if(isPatchingDisabled())=T -> return
[PATH2] if(isPatchingDisabled())=F
[CALLS-INTERNAL] Map<String, Route> patchRouteWithService(Set<HasMetadata> resources, Map<String, Service> services); Map<String, Service>... | /* static context
[FOCAL] public void ServiceResourceUtil.patchServiceName(Set<HasMetadata> entities)
[PATH1] if(isPatchingDisabled())=T -> return
[PATH2] if(isPatchingDisabled())=F
[CALLS-INTERNAL] Map<String, Route> patchRouteWithService(Set<HasMetadata> resources, Map<String, Service> services); Map<String, Service>... | true | ok | {"focal": {"class": "ServiceResourceUtil", "name": "patchServiceName", "signature": "void patchServiceName(Set<HasMetadata> entities)", "start_line": 3, "modifiers": "public", "params": [{"name": "entities", "type": "Set<HasMetadata>"}], "return_type": "void"}, "class_info": {"name": "ServiceResourceUtil", "kind": "cla... |
61441349_0 | class Utils {
@Nullable
@CheckResult
public static byte[] toByteArray(@Nullable Byte[] array) {
if (array == null) {
return null;
} else if (array.length == 0) {
return EMPTY_PRIMITIVE_BYTES;
} else {
byte[] result = new byte[array.length];
for (int i = 0, size = array.length... | final byte[] expected = new byte[]{0x55, 0x66, 0x14};
assertThat(toByteArray(new Byte[]{0x55, 0x66, 0x14})).isEqualTo(expected);
}
} | [FOCAL] @Nullable @CheckResult public static byte[] Utils.toByteArray(Byte[] array)
[CLASS] class Utils
[METRICS] loc=16 cc=4 branches=2 loops=1 returns=3 throws=0 nesting=3
[PATH1] if(array == null)=F -> if(array.length == 0)=F -> for(i < size)=T -> exit loop -> return result
[PATH2] if(array == null)=T -> return null... | /* static context
[FOCAL] @Nullable @CheckResult public static byte[] Utils.toByteArray(Byte[] array)
[PATH1] if(array == null)=F -> if(array.length == 0)=F -> for(i < size)=T -> exit loop -> return result
[PATH2] if(array == null)=T -> return null
[PATH3] if(array == null)=F -> if(array.length == 0)=T -> return EMPTY_... | /* static context
[FOCAL] @Nullable @CheckResult public static byte[] Utils.toByteArray(Byte[] array)
[PATH1] if(array == null)=F -> if(array.length == 0)=F -> for(i < size)=T -> exit loop -> return result
[PATH2] if(array == null)=T -> return null
[PATH3] if(array == null)=F -> if(array.length == 0)=T -> return EMPTY_... | true | ok | {"focal": {"class": "Utils", "name": "toByteArray", "signature": "byte[] toByteArray(Byte[] array)", "start_line": 3, "modifiers": "@Nullable @CheckResult public static", "params": [{"name": "array", "type": "Byte[]"}], "return_type": "byte[]"}, "class_info": {"name": "Utils", "kind": "class", "modifiers": "", "supercl... |
61508446_420 | class ReadOnlyByteBuf extends AbstractDerivedByteBuf {
@Override
public ByteBuf unwrap() {
return buffer;
}
public ReadOnlyByteBuf(ByteBuf buffer);
@Override public boolean isReadOnly();
@Override public boolean isWritable();
@Override public boolean isWritable(int numBytes);
... | ByteBuf buf = buffer(1);
assertSame(buf, unmodifiableBuffer(buf).unwrap());
}
} | [FOCAL] @Override public ByteBuf ReadOnlyByteBuf.unwrap()
[CLASS] class ReadOnlyByteBuf extends AbstractDerivedByteBuf
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] ReadOnlyByteBuf(ByteBuf buffer); boolean isReadOnly(); boolean isWritable(); boolean isWritable(int numBytes); ByteB... | /* static context
[FOCAL] @Override public ByteBuf ReadOnlyByteBuf.unwrap()
*/
| /* static context
[FOCAL] @Override public ByteBuf ReadOnlyByteBuf.unwrap()
*/
class ReadOnlyByteBuf extends AbstractDerivedByteBuf {
@Override
public ByteBuf unwrap() {
return buffer;
}
public ReadOnlyByteBuf(ByteBuf buffer);
@Override public boolean isReadOnly();
@Override public b... | true | ok | {"focal": {"class": "ReadOnlyByteBuf", "name": "unwrap", "signature": "ByteBuf unwrap()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "ByteBuf"}, "class_info": {"name": "ReadOnlyByteBuf", "kind": "class", "modifiers": "", "superclass": "AbstractDerivedByteBuf", "interfaces": null, "fi... |
61520679_0 | class PrisonSortableMines extends PrisonSorter {
@Override
public Set<Mine> getSortedSet() {
TreeSet<Mine> mines = new TreeSet<>( new PrisonSortComparableMines() );
List<Mine> unsortedMines = PrisonMines.getInstance().getMineManager().getMines();
mines.addAll( unsortedMines );
return mines;
}
}
clas... | Mine a = new Mine();
a.setName( "A" );
Mine b = new Mine();
b.setName( "b" );
Mine c = new Mine();
c.setName( "C" );
List<Mine> unsortedList = new ArrayList<>();
unsortedList.add( b );
unsortedList.add( c );
unsortedList.add( a );
assertEquals( "b", unsortedList.get( 0 ).getName() );
asser... | [FOCAL] @Override public Set<Mine> PrisonSortableMines.getSortedSet()
[CLASS] class PrisonSortableMines extends PrisonSorter
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] PrisonMines.getInstance().getMineManager().getMines/0, PrisonMines.getInstance().getMineManager/0, PrisonMine... | /* static context
[FOCAL] @Override public Set<Mine> PrisonSortableMines.getSortedSet()
[NEW] TreeSet<>, PrisonSortComparableMines
[CALLS-EXTERNAL] PrisonMines.getInstance().getMineManager().getMines/0, PrisonMines.getInstance().getMineManager/0, PrisonMines.getInstance/0, TreeSet<Mine>.addAll/1
*/
| /* static context
[FOCAL] @Override public Set<Mine> PrisonSortableMines.getSortedSet()
[NEW] TreeSet<>, PrisonSortComparableMines
[CALLS-EXTERNAL] PrisonMines.getInstance().getMineManager().getMines/0, PrisonMines.getInstance().getMineManager/0, PrisonMines.getInstance/0, TreeSet<Mine>.addAll/1
*/
class PrisonSortable... | true | ok | {"focal": {"class": "PrisonSortableMines", "name": "getSortedSet", "signature": "Set<Mine> getSortedSet()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Set<Mine>"}, "class_info": {"name": "PrisonSortableMines", "kind": "class", "modifiers": "", "superclass": "PrisonSorter", "interfac... |
61523190_2 | class StringingT1 implements IStringingOperator {
@Override
public OpResult performOperator(Integer[] tour, Integer toString, int neighbourhoodSize, IDistanceCalculator distanceCalculator) {
int counterNull = 0;
int counterNotNull = 0;
int[] neigbourHoodJ = Util.getNeighbourhoodIndexesFromValue(tour, toString... |
Map<Integer, Integer[]> correct = buildIsCorrect();
StringingT1 stringT1 = new StringingT1();
double[][] tour = getSimpleTour();
for (int i = 0; i < tour.length; i++) {
// int i = 1;
int valueToRemoveInsert = i;
Integer[] intTour = remove(transform(tour), valueToRemoveInsert);
// test
// intTou... | [FOCAL] @Override public OpResult StringingT1.performOperator(Integer[] tour, Integer toString, int neighbourhoodSize, IDistanceCalculator distanceCalculator)
[CLASS] class StringingT1 implements IStringingOperator
[METRICS] loc=116 cc=9 branches=5 loops=3 returns=1 throws=0 nesting=7
[CALLS-EXTERNAL] Util.getNeighbour... | /* static context
[FOCAL] @Override public OpResult StringingT1.performOperator(Integer[] tour, Integer toString, int neighbourhoodSize, IDistanceCalculator distanceCalculator)
[PATH1] for(i < tour.length)=T -> foreach(int j : neigbourHoodJ)=T -> if(i == j)=F -> foreach(int k : neigbourHoodK)=T -> if(k != i && k != j)=... | /* static context
[FOCAL] @Override public OpResult StringingT1.performOperator(Integer[] tour, Integer toString, int neighbourhoodSize, IDistanceCalculator distanceCalculator)
[PATH1] for(i < tour.length)=T -> foreach(int j : neigbourHoodJ)=T -> if(i == j)=F -> foreach(int k : neigbourHoodK)=T -> if(k != i && k != j)=... | true | ok | {"focal": {"class": "StringingT1", "name": "performOperator", "signature": "OpResult performOperator(Integer[] tour, Integer toString, int neighbourhoodSize, IDistanceCalculator distanceCalculator)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "tour", "type": "Integer[]"}, {"name": "toString",... |
61565876_55 | class InjectorImpl implements Injector {
@Override
public <T> void registerProvider(Class<T> clazz, Provider<? extends T> provider) {
checkNotNull(clazz, "Class may not be null");
checkNotNull(provider, "Provider may not be null");
try {
for (Handler handler : config.getHand... | // given / when
InjectorException ex = assertThrows(InjectorException.class, () -> injector.registerProvider(null, mock(Provider.class)));
// then
assertThat(ex.getMessage(), containsString("may not be null"));
}
} | [FOCAL] @Override public void InjectorImpl.registerProvider(Class<T> clazz, Provider<? extends T> provider)
[CLASS] class InjectorImpl implements Injector
[METRICS] loc=12 cc=3 branches=0 loops=1 returns=0 throws=0 nesting=2
[CALLS-EXTERNAL] checkNotNull/2 (inherited), InjectorConfig.getHandlers/0, Handler.onProvider/2... | /* static context
[FOCAL] @Override public void InjectorImpl.registerProvider(Class<T> clazz, Provider<? extends T> provider)
[PATH1] foreach(Handler handler : config.getHandlers())=T -> exit loop
[PATH2] try-body throws
[PATH3] foreach(Handler handler : config.getHandlers())=F
[INPUTS] branches=config | result=-
[COLL... | /* static context
[FOCAL] @Override public void InjectorImpl.registerProvider(Class<T> clazz, Provider<? extends T> provider)
[PATH1] foreach(Handler handler : config.getHandlers())=T -> exit loop
[PATH2] try-body throws
[PATH3] foreach(Handler handler : config.getHandlers())=F
[INPUTS] branches=config | result=-
[COLL... | true | ok | {"focal": {"class": "InjectorImpl", "name": "registerProvider", "signature": "void registerProvider(Class<T> clazz, Provider<? extends T> provider)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "clazz", "type": "Class<T>"}, {"name": "provider", "type": "Provider<? extends T>"}], "return_type":... |
61610584_3 | class RepositoriesPresentationModel implements Serializable, Parcelable {
public void setRepositories(List<Repository> repositories) {
this.repositories = repositories;
}
public RepositoriesPresentationModel(String username);
protected RepositoriesPresentationModel(Parcel in);
public St... | assertNull(model.getRepositories());
model.setRepositories(TestMocks.REPOSITORIES);
assertEquals(TestMocks.REPOSITORIES, model.getRepositories());
}
} | [FOCAL] public void RepositoriesPresentationModel.setRepositories(List<Repository> repositories)
[CLASS] class RepositoriesPresentationModel implements Serializable, Parcelable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[FIELDS] write=repositories
[STATE] repositories via getRepositories()
[DA... | /* static context
[FOCAL] public void RepositoriesPresentationModel.setRepositories(List<Repository> repositories)
[STATE] repositories via getRepositories()
[FIELDS] write=repositories
*/
| /* static context
[FOCAL] public void RepositoriesPresentationModel.setRepositories(List<Repository> repositories)
[STATE] repositories via getRepositories()
[FIELDS] write=repositories
*/
class RepositoriesPresentationModel implements Serializable, Parcelable {
public void setRepositories(List<Repository> reposit... | true | ok | {"focal": {"class": "RepositoriesPresentationModel", "name": "setRepositories", "signature": "void setRepositories(List<Repository> repositories)", "start_line": 3, "modifiers": "public", "params": [{"name": "repositories", "type": "List<Repository>"}], "return_type": "void"}, "class_info": {"name": "RepositoriesPresen... |
61638949_0 | class JsonConsumer {
public String greet(String name) {
// TODO
// try adding a second field (e.g. gender) with a random value
// the test now fails because we send more than specified which should result in a contract change
return target.path("/greet")
.request(APPLICA... | final JsonConsumer consumer = new JsonConsumer(mockProvider.getUrl());
final String result = consumer.greet("Michael");
assertEquals("{\"greeting\":\"Hello, Michael!\"}", result);
}
} | [FOCAL] public String JsonConsumer.greet(String name)
[CLASS] class JsonConsumer
[METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] target.path("/greet") .request(APPLICATION_JSON).post/2, target.path("/greet").request/1, target.path/1, entity/2 (inherited)
[INPUTS] branches=- | resu... | /* static context
[FOCAL] public String JsonConsumer.greet(String name)
[INPUTS] branches=- | result=name
[COLLABORATORS] field target path/1
[CALLS-EXTERNAL] target.path("/greet") .request(APPLICATION_JSON).post/2, target.path("/greet").request/1, target.path/1, entity/2 (inherited)
*/
| /* static context
[FOCAL] public String JsonConsumer.greet(String name)
[INPUTS] branches=- | result=name
[COLLABORATORS] field target path/1
[CALLS-EXTERNAL] target.path("/greet") .request(APPLICATION_JSON).post/2, target.path("/greet").request/1, target.path/1, entity/2 (inherited)
*/
class JsonConsumer {
public... | true | ok | {"focal": {"class": "JsonConsumer", "name": "greet", "signature": "String greet(String name)", "start_line": 3, "modifiers": "public", "params": [{"name": "name", "type": "String"}], "return_type": "String"}, "class_info": {"name": "JsonConsumer", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null... |
61667990_279 | class PaginationHelper {
public Map<String, Object> paginate(String jsonKey, List<T> list, String filter,
String timezoneOffset, String sort, int page, int perPage) {
Map<String, Object> response = new HashMap<>();
paginationFilter.replaceFilter(filter, time... | Object[][] objectDefinitions = new Object[][]{
{"A", 22},
{"B", 23},
{"Z", 10},
{"D", 12},
{"E", 13},
{"C", 42},
{"Z", 11},
{"E", 12},
{"X", 35},
{"X", ... | [FOCAL] public Map<String, Object> PaginationHelper.paginate(String jsonKey, List<T> list, String filter, String timezoneOffset, String sort, int page, int perPage)
[CLASS] class PaginationHelper
[METRICS] loc=19 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] int fromIndex(int page, int perPage, ... | /* static context
[FOCAL] public Map<String, Object> PaginationHelper.paginate(String jsonKey, List<T> list, String filter, String timezoneOffset, String sort, int page, int perPage)
[COLLABORATORS] field paginationFilter replaceFilter/2; field paginationComparator replaceSortorder/1; param list:List<T> size/0,parallel... | /* static context
[FOCAL] public Map<String, Object> PaginationHelper.paginate(String jsonKey, List<T> list, String filter, String timezoneOffset, String sort, int page, int perPage)
[COLLABORATORS] field paginationFilter replaceFilter/2; field paginationComparator replaceSortorder/1; param list:List<T> size/0,parallel... | true | ok | {"focal": {"class": "PaginationHelper", "name": "paginate", "signature": "Map<String, Object> paginate(String jsonKey, List<T> list, String filter, String timezoneOffset, String sort, int page, int perPage)", "start_line": 3, "modifiers": "public", "params": [{"name": "jsonKey", "type": "String"}, {"name": "list", "typ... |
61691853_5 | class CacheUtil {
public static String getLocalPath(String remotePath, Configuration conf, int generationNumber)
{
checkState(generationNumber != UNKONWN_GENERATION_NUMBER, "generationNumber is " + UNKONWN_GENERATION_NUMBER);
final String absLocation = getDirectory(remotePath, conf);
return String.form... | String localRelPath = "testbucket/123/4566/789";
String remotePath = "s3://" + localRelPath;
CacheConfig.setCacheDataDirPrefix(conf, cacheTestDirPrefix);
CacheConfig.setCacheDataDirSuffix(conf, "/fcache/");
CacheConfig.setMaxDisks(conf, 1);
createCacheDirectoriesForTest(conf);
String local... | [FOCAL] public static String CacheUtil.getLocalPath(String remotePath, Configuration conf, int generationNumber)
[CLASS] class CacheUtil
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String getDirectory(String remotePath, Configuration conf); String getName(String remotePath)
[CA... | /* static context
[FOCAL] public static String CacheUtil.getLocalPath(String remotePath, Configuration conf, int generationNumber)
[INPUTS] branches=- | result=conf, generationNumber, remotePath
[CALLS-INTERNAL] String getDirectory(String remotePath, Configuration conf); String getName(String remotePath)
[CALLS-EXTERNA... | /* static context
[FOCAL] public static String CacheUtil.getLocalPath(String remotePath, Configuration conf, int generationNumber)
[INPUTS] branches=- | result=conf, generationNumber, remotePath
[CALLS-INTERNAL] String getDirectory(String remotePath, Configuration conf); String getName(String remotePath)
[CALLS-EXTERNA... | true | ok | {"focal": {"class": "CacheUtil", "name": "getLocalPath", "signature": "String getLocalPath(String remotePath, Configuration conf, int generationNumber)", "start_line": 3, "modifiers": "public static", "params": [{"name": "remotePath", "type": "String"}, {"name": "conf", "type": "Configuration"}, {"name": "generationNum... |
61705055_7 | class QImageMogr2UrlBuilder {
public QImageMogr2UrlBuilder thumbnailEdgeeMin(int width, int height){
thumbnail = "!" + width + "x" + height + "r";
return this;
}
QImageMogr2UrlBuilder(String host);
public String getHost();
public QImageMogr2UrlBuilder autoOrient();
public QI... | final String result = QImage.createMogr(HOST)
.thumbnailEdgeeMin(200, 400)
.toUrl();
final String r = HOST + "?imageMogr2/thumbnail/!200x400r";
assertEquals(r, result);
}
} | [FOCAL] public QImageMogr2UrlBuilder QImageMogr2UrlBuilder.thumbnailEdgeeMin(int width, int height)
[CLASS] class QImageMogr2UrlBuilder
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[DATAFLOW] height@param->L2; width@param->L2
[CLASS-MEMBERS] QImageMogr2UrlBuilder(String host); String getHost(); ... | /* static context
[FOCAL] public QImageMogr2UrlBuilder QImageMogr2UrlBuilder.thumbnailEdgeeMin(int width, int height)
*/
| /* static context
[FOCAL] public QImageMogr2UrlBuilder QImageMogr2UrlBuilder.thumbnailEdgeeMin(int width, int height)
*/
class QImageMogr2UrlBuilder {
public QImageMogr2UrlBuilder thumbnailEdgeeMin(int width, int height){
thumbnail = "!" + width + "x" + height + "r";
return this;
}
QImag... | true | ok | {"focal": {"class": "QImageMogr2UrlBuilder", "name": "thumbnailEdgeeMin", "signature": "QImageMogr2UrlBuilder thumbnailEdgeeMin(int width, int height)", "start_line": 3, "modifiers": "public", "params": [{"name": "width", "type": "int"}, {"name": "height", "type": "int"}], "return_type": "QImageMogr2UrlBuilder"}, "clas... |
61705166_2 | class UrlTokenizer extends Tokenizer {
protected List<String> splitUrl(String url) {
return splitUrl(url, true);
}
public UrlTokenizer();
@Override public final boolean incrementToken();
protected List<String> splitUrl(String url, boolean includeParams);
private String join(String[] ... | // given
String url = "129136207330/good-times-only?one=two&three=four";
// when
List<String> splits = urlTokenizer.splitUrl(url);
// then
assertTrue(splits.contains("129136207330"));
assertTrue(splits.contains("129136207330/good-times-only"));
assertTru... | [FOCAL] protected List<String> UrlTokenizer.splitUrl(String url)
[CLASS] class UrlTokenizer extends Tokenizer
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] List<String> splitUrl(String url, boolean includeParams)
[INPUTS] branches=- | result=url
[DATAFLOW] url@param->L2
[CLASS-ME... | /* static context
[FOCAL] protected List<String> UrlTokenizer.splitUrl(String url)
[INPUTS] branches=- | result=url
[CALLS-INTERNAL] List<String> splitUrl(String url, boolean includeParams)
*/
| /* static context
[FOCAL] protected List<String> UrlTokenizer.splitUrl(String url)
[INPUTS] branches=- | result=url
[CALLS-INTERNAL] List<String> splitUrl(String url, boolean includeParams)
*/
class UrlTokenizer extends Tokenizer {
protected List<String> splitUrl(String url) {
return splitUrl(url, true);
... | true | ok | {"focal": {"class": "UrlTokenizer", "name": "splitUrl", "signature": "List<String> splitUrl(String url)", "start_line": 3, "modifiers": "protected", "params": [{"name": "url", "type": "String"}], "return_type": "List<String>"}, "class_info": {"name": "UrlTokenizer", "kind": "class", "modifiers": "", "superclass": "Toke... |
61706237_8 | class ListenToValueEventsOnSubscribe implements ObservableOnSubscribe<T> {
@Override
public void subscribe(@NonNull ObservableEmitter<T> emitter) throws Exception {
final ValueEventListener eventListener = query.addValueEventListener(new RxValueListener<>(emitter, marshaller));
emitter.setCance... |
final DataSnapshot expectedKeyData = mock(DataSnapshot.class);
when(expectedKeyData.getKey()).thenReturn(EXPECTED_KEY);
Query query = mock(Query.class);
doAnswer(new Answer<ValueEventListener>() {
@Override
public ValueEventListener answer(InvocationOnMock invo... | [FOCAL] @Override public void ListenToValueEventsOnSubscribe.subscribe(ObservableEmitter<T> emitter)
[CLASS] class ListenToValueEventsOnSubscribe implements ObservableOnSubscribe<T>
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] query.addValueEventListener/1, ObservableEmitter<T>... | /* static context
[FOCAL] @Override public void ListenToValueEventsOnSubscribe.subscribe(ObservableEmitter<T> emitter)
[COLLABORATORS] field query addValueEventListener/1,removeEventListener/1; param emitter:ObservableEmitter<T> setCancellable/1
[EXCEPTIONS] declares Exception
[NEW] RxValueListener<>, Cancellable
[CALL... | /* static context
[FOCAL] @Override public void ListenToValueEventsOnSubscribe.subscribe(ObservableEmitter<T> emitter)
[COLLABORATORS] field query addValueEventListener/1,removeEventListener/1; param emitter:ObservableEmitter<T> setCancellable/1
[EXCEPTIONS] declares Exception
[NEW] RxValueListener<>, Cancellable
[CALL... | true | ok | {"focal": {"class": "ListenToValueEventsOnSubscribe", "name": "subscribe", "signature": "void subscribe(ObservableEmitter<T> emitter) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "emitter", "type": "ObservableEmitter<T>"}], "return_type": "void"}, "class_info": {"name": "List... |
61731745_2 | class XMLKatalog {
public int findeEintragnummer(String titel){
int nummer = -1;
String tmp ="";
ArrayList<String> tmpList = this.getTitles();
for(int i = 0; i<tmpList.size(); i++){
tmp = tmpList.get(i);
if(tmp.equals(titel)) nummer = i;
}
ret... | String titel = "Zweite Aufgabe!";
assertEquals(1, test.findeEintragnummer(titel));
}
} | [FOCAL] public int XMLKatalog.findeEintragnummer(String titel)
[CLASS] class XMLKatalog
[METRICS] loc=10 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] ArrayList<String> getTitles()
[CALLS-EXTERNAL] ArrayList<String>.size/0, ArrayList<String>.get/1, String.equals/1
[PATH1] for(i<tmpList.size())=T... | /* static context
[FOCAL] public int XMLKatalog.findeEintragnummer(String titel)
[PATH1] for(i<tmpList.size())=T -> if(tmp.equals(titel))=T -> exit loop -> return nummer
[PATH2] for(i<tmpList.size())=F -> return nummer
[PATH3] for(i<tmpList.size())=T -> if(tmp.equals(titel))=F -> exit loop -> return nummer
[INPUTS] bra... | /* static context
[FOCAL] public int XMLKatalog.findeEintragnummer(String titel)
[PATH1] for(i<tmpList.size())=T -> if(tmp.equals(titel))=T -> exit loop -> return nummer
[PATH2] for(i<tmpList.size())=F -> return nummer
[PATH3] for(i<tmpList.size())=T -> if(tmp.equals(titel))=F -> exit loop -> return nummer
[INPUTS] bra... | true | ok | {"focal": {"class": "XMLKatalog", "name": "findeEintragnummer", "signature": "int findeEintragnummer(String titel)", "start_line": 3, "modifiers": "public", "params": [{"name": "titel", "type": "String"}], "return_type": "int"}, "class_info": {"name": "XMLKatalog", "kind": "class", "modifiers": "", "superclass": null, ... |
61744742_256 | class MetricName extends BasicPath<MetricName> implements Comparable<MetricName>, Path {
public static MetricName valueOf(String... path) {
return CACHE.apply(new PathArray(path));
}
private MetricName(PathArray path);
public static MetricName valueOf(List<String> path);
}
class MetricName... | assertEquals("foo", MetricName.valueOf("foo").configString().toString());
assertEquals("'99'", MetricName.valueOf("99").configString().toString());
assertEquals("'\\r'", MetricName.valueOf("\r").configString().toString());
assertEquals("'3'.'14159'", MetricName.valueOf("3", "14159").conf... | [FOCAL] public static MetricName MetricName.valueOf(String... path)
[CLASS] class MetricName extends BasicPath<MetricName> implements Comparable<MetricName>, Path
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] CACHE.apply/1
[NEW] PathArray
[INPUTS] branches=- | result=path
[DATAFL... | /* static context
[FOCAL] public static MetricName MetricName.valueOf(String... path)
[INPUTS] branches=- | result=path
[NEW] PathArray
[CALLS-EXTERNAL] CACHE.apply/1
*/
| /* static context
[FOCAL] public static MetricName MetricName.valueOf(String... path)
[INPUTS] branches=- | result=path
[NEW] PathArray
[CALLS-EXTERNAL] CACHE.apply/1
*/
class MetricName extends BasicPath<MetricName> implements Comparable<MetricName>, Path {
public static MetricName valueOf(String... path) {
... | true | ok | {"focal": {"class": "MetricName", "name": "valueOf", "signature": "MetricName valueOf(String... path)", "start_line": 3, "modifiers": "public static", "params": [{"name": "path", "type": "String..."}], "return_type": "MetricName"}, "class_info": {"name": "MetricName", "kind": "class", "modifiers": "", "superclass": "Ba... |
61803076_1 | class BayesianNetwork {
public boolean isValid() {
for (N n: nodes) {
if (!n.isValid())
return false;
}
return true;
}
public BayesianNetwork(String name);
public void add(N n);
public void addAll(Collection<N> nns);
public boolean containsNode(N n);
public N getVariable(String id);
publi... |
NodeCategorical nGender = new NodeCategorical(null, "gender");
nGender.addDomain("male", "female");
nGender.setProbabilities(0.55, "male");
nGender.setProbabilities(0.45, "female");
assertEquals(0.55, nGender.getProbability("male"), 1e-5);
assertEquals(0.45, nGender.getProbability("female"), 1e-5)... | [FOCAL] public boolean BayesianNetwork.isValid()
[CLASS] class BayesianNetwork
[METRICS] loc=9 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] N.isValid/0
[PATH1] foreach(N n : nodes)=T -> if(!n.isValid())=F -> exit loop -> return true
[PATH2] foreach(N n : nodes)=T -> if(!n.isValid())=T -> return... | /* static context
[FOCAL] public boolean BayesianNetwork.isValid()
[PATH1] foreach(N n : nodes)=T -> if(!n.isValid())=F -> exit loop -> return true
[PATH2] foreach(N n : nodes)=T -> if(!n.isValid())=T -> return false
[PATH3] foreach(N n : nodes)=F -> return true
[CALLS-EXTERNAL] N.isValid/0
*/
| /* static context
[FOCAL] public boolean BayesianNetwork.isValid()
[PATH1] foreach(N n : nodes)=T -> if(!n.isValid())=F -> exit loop -> return true
[PATH2] foreach(N n : nodes)=T -> if(!n.isValid())=T -> return false
[PATH3] foreach(N n : nodes)=F -> return true
[CALLS-EXTERNAL] N.isValid/0
*/
class BayesianNetwork {
... | true | ok | {"focal": {"class": "BayesianNetwork", "name": "isValid", "signature": "boolean isValid()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "BayesianNetwork", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "tempFolder... |
61822650_48 | class NoteQueryParameters extends TimelineQueryParameters {
public boolean isDiscussionIndependentFilter() {
boolean isContinious = !this.isRetrieveOnlyFollowedItems()
&& !this.isFavorites() && !this.isNotificationFeed();
if (isContinious) {
isContinious = !this.isFeedFi... | // create the query parameters
NoteQueryParameters noteQueryParameters = new NoteQueryParameters();
// check the defaults
Assert.assertFalse(noteQueryParameters.isFavorites());
Assert.assertFalse(noteQueryParameters.isFollowingFeedAndUnfiltered());
Assert.assertTrue(note... | [FOCAL] public boolean NoteQueryParameters.isDiscussionIndependentFilter()
[CLASS] class NoteQueryParameters extends TimelineQueryParameters
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] boolean isFeedFiltered(boolean allowBlogFilter, boolean allowDateFilter, boolean allowDiscuss... | /* static context
[FOCAL] public boolean NoteQueryParameters.isDiscussionIndependentFilter()
[PATH1] if(isContinious)=T -> return isContinious
[PATH2] if(isContinious)=F -> return isContinious
[CALLS-INTERNAL] boolean isFeedFiltered(boolean allowBlogFilter, boolean allowDateFilter, boolean allowDiscussionIdFilter); boo... | /* static context
[FOCAL] public boolean NoteQueryParameters.isDiscussionIndependentFilter()
[PATH1] if(isContinious)=T -> return isContinious
[PATH2] if(isContinious)=F -> return isContinious
[CALLS-INTERNAL] boolean isFeedFiltered(boolean allowBlogFilter, boolean allowDateFilter, boolean allowDiscussionIdFilter); boo... | true | ok | {"focal": {"class": "NoteQueryParameters", "name": "isDiscussionIndependentFilter", "signature": "boolean isDiscussionIndependentFilter()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "NoteQueryParameters", "kind": "class", "modifiers": "", "superclass": "Time... |
61826847_14 | class DisplayUtil {
public static String getTooltipText(GraphEntity entity) {
Map<String, Object> properties = entity.getPropertyContainer().getProperties();
String start = "<p width=\"" + LABEL_TEXT_WIDTH + "px\"><b>";
String typesRepresentation = entity.isTypesSingle() ? entity.getTypes(... | properties.put(FIRST_KEY, FIRST_VALUE);
assertThat(DisplayUtil.getTooltipText(node))
.containsSubsequence(FIRST_KEY, FIRST_VALUE);
}
} | [FOCAL] public static String DisplayUtil.getTooltipText(GraphEntity entity)
[CLASS] class DisplayUtil
[METRICS] loc=33 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] String truncate(String text, int length)
[CALLS-EXTERNAL] entity.getPropertyContainer().getProperties/0, GraphEntity.getPropertyCon... | /* static context
[FOCAL] public static String DisplayUtil.getTooltipText(GraphEntity entity)
[PATH1] if(properties.size() > MAX_TOOLTIP_PROPERTIES)=T -> return "<html>" + sb.toString() + "</html>"
[PATH2] if(properties.size() > MAX_TOOLTIP_PROPERTIES)=F -> return "<html>" + sb.toString() + "</html>"
[INPUTS] branches=... | /* static context
[FOCAL] public static String DisplayUtil.getTooltipText(GraphEntity entity)
[PATH1] if(properties.size() > MAX_TOOLTIP_PROPERTIES)=T -> return "<html>" + sb.toString() + "</html>"
[PATH2] if(properties.size() > MAX_TOOLTIP_PROPERTIES)=F -> return "<html>" + sb.toString() + "</html>"
[INPUTS] branches=... | true | ok | {"focal": {"class": "DisplayUtil", "name": "getTooltipText", "signature": "String getTooltipText(GraphEntity entity)", "start_line": 3, "modifiers": "public static", "params": [{"name": "entity", "type": "GraphEntity"}], "return_type": "String"}, "class_info": {"name": "DisplayUtil", "kind": "class", "modifiers": "", "... |
61872305_0 | class CachedStorage implements Storage {
@Override
public boolean contains(@NonNull String id) throws IOException {
return local.contains(id) || remote.contains(id);
}
public CachedStorage(
@NonNull Storage remote,
@NonNull Storage local
);
public CachedStorag... |
MockWebServer server = new MockWebServer();
server.enqueue(new MockResponse().setResponseCode(404)); // remote doesn't contain TEST_NAME_1 (before save)
server.enqueue(new MockResponse()); // remote contains TEST_NAME_1 (after save)
server.enqueue(new MockResponse().setResponseCode(404)... | [FOCAL] @Override public boolean CachedStorage.contains(String id)
[CLASS] class CachedStorage implements Storage
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] local.contains/1, remote.contains/1
[EXCEPTIONS] declares IOException
[INPUTS] branches=- | result=id
[COLLABORATORS] fi... | /* static context
[FOCAL] @Override public boolean CachedStorage.contains(String id)
[INPUTS] branches=- | result=id
[COLLABORATORS] field local contains/1; field remote contains/1
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] local.contains/1, remote.contains/1
*/
| /* static context
[FOCAL] @Override public boolean CachedStorage.contains(String id)
[INPUTS] branches=- | result=id
[COLLABORATORS] field local contains/1; field remote contains/1
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] local.contains/1, remote.contains/1
*/
class CachedStorage implements Storage {
@Ov... | true | ok | {"focal": {"class": "CachedStorage", "name": "contains", "signature": "boolean contains(String id) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "id", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "CachedStorage", "kind": "class", "modifiers": "", "su... |
61942185_0 | class WechatPrepayService {
static WechatPrepayResponseDto getPrepay(WechatPrepayData prepayData, String hostEndpoint) throws Exception {
Assert.isNotNull(hostEndpoint);
WechatPrepayRequestDto prepayDto = new WechatPrepayRequestDto(
prepayData.getAppId(), prepayData.getMchId(), prep... | Assert.assertNotNull(prepayData);
WechatPrepayResponseDto responseDto = WechatPrepayService.getPrepay(prepayData, "");
Assert.assertNotNull(responseDto);
Assert.assertEquals("SUCCESS", responseDto.getReturn_code());
Assert.assertNotNull(responseDto.getPrepay_id());
Asser... | [FOCAL] static WechatPrepayResponseDto WechatPrepayService.getPrepay(WechatPrepayData prepayData, String hostEndpoint)
[CLASS] class WechatPrepayService
[METRICS] loc=38 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] WechatPrepayResponseDto parsePrepayXml(String content)
[CALLS-EXTERNAL] Assert.i... | /* static context
[FOCAL] static WechatPrepayResponseDto WechatPrepayService.getPrepay(WechatPrepayData prepayData, String hostEndpoint)
[INPUTS] branches=- | result=prepayData
[COLLABORATORS] param prepayData:WechatPrepayData getAppId/0,getMchId/0,getMchSecret/0,getProductName/0,getProductId/0,getOrderNo/0
[EXCEPTIONS... | /* static context
[FOCAL] static WechatPrepayResponseDto WechatPrepayService.getPrepay(WechatPrepayData prepayData, String hostEndpoint)
[INPUTS] branches=- | result=prepayData
[COLLABORATORS] param prepayData:WechatPrepayData getAppId/0,getMchId/0,getMchSecret/0,getProductName/0,getProductId/0,getOrderNo/0
[EXCEPTIONS... | true | ok | {"focal": {"class": "WechatPrepayService", "name": "getPrepay", "signature": "WechatPrepayResponseDto getPrepay(WechatPrepayData prepayData, String hostEndpoint) throws Exception", "start_line": 3, "modifiers": "static", "params": [{"name": "prepayData", "type": "WechatPrepayData"}, {"name": "hostEndpoint", "type": "St... |
61947614_6 | class IncomingMessageQueue {
public synchronized void addMessage(Peer sourcePeer, int messageType, int dependencyId, ByteBuf content) {
if (checkDependency(dependencyId)) {
byte[] contentBytes = new byte[content.readableBytes()];
content.readBytes(contentBytes);
message... | messageQueue.addMessage(stubPeer, MESSAGE_ID, 2, stubContent);
messageQueue.addMessage(stubPeer, OTHER_MESSAGE_ID, 1, stubContent);
InOrder inOrder = Mockito.inOrder(processorsService);
inOrder.verify(processorsService).getMessageProcessor(OTHER_MESSAGE_ID);
inOrder.verify(proce... | [FOCAL] public synchronized void IncomingMessageQueue.addMessage(Peer sourcePeer, int messageType, int dependencyId, ByteBuf content)
[CLASS] class IncomingMessageQueue
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] boolean checkDependency(int dependencyId); void processIncomingMe... | /* static context
[FOCAL] public synchronized void IncomingMessageQueue.addMessage(Peer sourcePeer, int messageType, int dependencyId, ByteBuf content)
[PATH1] if(checkDependency(dependencyId))=T
[PATH2] if(checkDependency(dependencyId))=F
[INPUTS] branches=dependencyId | result=-
[COLLABORATORS] param content:ByteBuf ... | /* static context
[FOCAL] public synchronized void IncomingMessageQueue.addMessage(Peer sourcePeer, int messageType, int dependencyId, ByteBuf content)
[PATH1] if(checkDependency(dependencyId))=T
[PATH2] if(checkDependency(dependencyId))=F
[INPUTS] branches=dependencyId | result=-
[COLLABORATORS] param content:ByteBuf ... | true | ok | {"focal": {"class": "IncomingMessageQueue", "name": "addMessage", "signature": "void addMessage(Peer sourcePeer, int messageType, int dependencyId, ByteBuf content)", "start_line": 3, "modifiers": "public synchronized", "params": [{"name": "sourcePeer", "type": "Peer"}, {"name": "messageType", "type": "int"}, {"name": ... |
61971175_2 | class SpanRecorder extends AbstractClosable {
void record(Record record) {
MutableSpan span = spanMap.get(record.traceId());
if (span == null) {
MutableSpan newSpan = new MutableSpan(record.traceId(), Time$.MODULE$.now());
MutableSpan prev = spanMap.putIfAbsent(record.traceId(), newSpan);
s... | recorder.record(
new Record(root, Time.fromMilliseconds(TODAY), new FancyAnnotation(), empty())
);
assertThat(mapAsJavaMap(stats.counters())).containsExactly(
entry(seq("record", "unhandled", FancyAnnotation.class.getName()), 1L)
);
}
} | [FOCAL] void SpanRecorder.record(Record record)
[CLASS] class SpanRecorder extends AbstractClosable
[METRICS] loc=15 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] void append(Record record, MutableSpan span); void report(MutableSpan span)
[CALLS-EXTERNAL] spanMap.get/1, Record.traceId/0, Time$.M... | /* static context
[FOCAL] void SpanRecorder.record(Record record)
[PATH1] if(span == null)=T -> if(span.isComplete())=T
[PATH2] if(span == null)=F -> if(span.isComplete())=F
[INPUTS] branches=record | result=-
[COLLABORATORS] field spanMap get/1,putIfAbsent/2,remove/2; param record:Record traceId/0
[CALLS-INTERNAL] voi... | /* static context
[FOCAL] void SpanRecorder.record(Record record)
[PATH1] if(span == null)=T -> if(span.isComplete())=T
[PATH2] if(span == null)=F -> if(span.isComplete())=F
[INPUTS] branches=record | result=-
[COLLABORATORS] field spanMap get/1,putIfAbsent/2,remove/2; param record:Record traceId/0
[CALLS-INTERNAL] voi... | true | ok | {"focal": {"class": "SpanRecorder", "name": "record", "signature": "void record(Record record)", "start_line": 3, "modifiers": "", "params": [{"name": "record", "type": "Record"}], "return_type": "void"}, "class_info": {"name": "SpanRecorder", "kind": "class", "modifiers": "", "superclass": "AbstractClosable", "interfa... |
62021204_1 | class ListenerHandlerFinder extends AbstractHandlerFinder {
@Override
public Map<Class<?>, Set<EventHandler>> findAllHandlers(Object listener) {
Map<Class<?>, Set<EventHandler>> methodsInListener = new HashMap<Class<?>, Set<EventHandler>>();
Class clazz = listener.getClass();
Type[] typ... | Sub listener = new Sub();
Map<Class<? >, Set<EventHandler>> map = new ListenerHandlerFinder().findAllHandlers(listener);
assertTrue(map.containsKey(SimpleEvent.class));
Collection<EventHandler> handlers = map.get(SimpleEvent.class);
assertTrue(handlers.size() == 1);
Iter... | [FOCAL] @Override public Map<Class<?>, Set<EventHandler>> ListenerHandlerFinder.findAllHandlers(Object listener)
[CLASS] class ListenerHandlerFinder extends AbstractHandlerFinder
[METRICS] loc=26 cc=6 branches=3 loops=1 returns=1 throws=1 nesting=4
[CALLS-EXTERNAL] Object.getClass/0, Class.getGenericInterfaces/0, param... | /* static context
[FOCAL] @Override public Map<Class<?>, Set<EventHandler>> ListenerHandlerFinder.findAllHandlers(Object listener)
[THROWS-WHEN] IllegalArgumentException when foreach(Type type : types)=T && type instanceof ParameterizedType && !(!parameterizedType.getRawType().equals(ISubscribe.class)) && typeArguments... | /* static context
[FOCAL] @Override public Map<Class<?>, Set<EventHandler>> ListenerHandlerFinder.findAllHandlers(Object listener)
[THROWS-WHEN] IllegalArgumentException when foreach(Type type : types)=T && type instanceof ParameterizedType && !(!parameterizedType.getRawType().equals(ISubscribe.class)) && typeArguments... | true | ok | {"focal": {"class": "ListenerHandlerFinder", "name": "findAllHandlers", "signature": "Map<Class<?>, Set<EventHandler>> findAllHandlers(Object listener)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "listener", "type": "Object"}], "return_type": "Map<Class<?>, Set<EventHandler>>"}, "class_info"... |
62054952_6 | class NetworkMapper {
public List<com.nilhcem.droidconat.data.app.model.Speaker> toAppSpeakers(@Nullable List<Speaker> from) {
if (from == null) {
return null;
}
return stream(from).map(speaker -> new com.nilhcem.droidconat.data.app.model.Speaker(
speaker.getId(... | // Given
Speaker speaker1 = new Speaker(1, "speaker1", "title1", "bio1", "website1", "twitter1", "github1", "photo1");
Speaker speaker2 = new Speaker(2, "speaker2", "title2", "bio2", "website2", "twitter2", "github2", "photo2");
List<Speaker> speakers = Arrays.asList(speaker1, speaker2);... | [FOCAL] public List<com.nilhcem.droidconat.data.app.model.Speaker> NetworkMapper.toAppSpeakers(List<Speaker> from)
[CLASS] class NetworkMapper
[METRICS] loc=11 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] stream(from).map(speaker -> new com.nilhcem.droidconat.da....collect/1, stream(from).map/1... | /* static context
[FOCAL] public List<com.nilhcem.droidconat.data.app.model.Speaker> NetworkMapper.toAppSpeakers(List<Speaker> from)
[PATH1] if(from == null)=T -> return null
[PATH2] if(from == null)=F -> return stream(from).map(speaker -> new com.nilhcem.droidconat.data.app.mod...
[INPUTS] branches=from | result=from
... | /* static context
[FOCAL] public List<com.nilhcem.droidconat.data.app.model.Speaker> NetworkMapper.toAppSpeakers(List<Speaker> from)
[PATH1] if(from == null)=T -> return null
[PATH2] if(from == null)=F -> return stream(from).map(speaker -> new com.nilhcem.droidconat.data.app.mod...
[INPUTS] branches=from | result=from
... | true | ok | {"focal": {"class": "NetworkMapper", "name": "toAppSpeakers", "signature": "List<com.nilhcem.droidconat.data.app.model.Speaker> toAppSpeakers(List<Speaker> from)", "start_line": 3, "modifiers": "public", "params": [{"name": "from", "type": "List<Speaker>"}], "return_type": "List<com.nilhcem.droidconat.data.app.model.Sp... |
62104898_5 | class CachedSearcher implements Searcher {
@Override
public Result search(Query query) {
return search(query, 1);
}
public CachedSearcher(GoogleSearcher searcher);
@Override public Result search(Query query, int pages);
public Result cache();
private String expected;
private... | Assert.assertEquals(expected, actual.next());
}
} | [FOCAL] @Override public Result CachedSearcher.search(Query query)
[CLASS] class CachedSearcher implements Searcher
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Result search(Query query, int pages)
[INPUTS] branches=- | result=query
[DATAFLOW] query@param->L3
[CLASS-MEMBERS] Ca... | /* static context
[FOCAL] @Override public Result CachedSearcher.search(Query query)
[INPUTS] branches=- | result=query
[CALLS-INTERNAL] Result search(Query query, int pages)
*/
| /* static context
[FOCAL] @Override public Result CachedSearcher.search(Query query)
[INPUTS] branches=- | result=query
[CALLS-INTERNAL] Result search(Query query, int pages)
*/
class CachedSearcher implements Searcher {
@Override
public Result search(Query query) {
return search(query, 1);
}
... | true | ok | {"focal": {"class": "CachedSearcher", "name": "search", "signature": "Result search(Query query)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "query", "type": "Query"}], "return_type": "Result"}, "class_info": {"name": "CachedSearcher", "kind": "class", "modifiers": "", "superclass": null, "i... |
62117812_546 | class ConcurrentSortedLongPairSet implements LongPairSet {
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append('{');
final AtomicBoolean first = new AtomicBoolean(true);
longPairSets.forEach((key, longPairSet) -> {
longPairSet.forEa... |
LongPairSet set = new ConcurrentSortedLongPairSet(16);
set.add(0, 0);
set.add(1, 1);
set.add(3, 3);
final String toString = "{[0:0], [1:1], [3:3]}";
System.out.println(set.toString());
assertEquals(set.toString(), toString);
}
} | [FOCAL] @Override public String ConcurrentSortedLongPairSet.toString()
[CLASS] class ConcurrentSortedLongPairSet implements LongPairSet
[METRICS] loc=20 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] StringBuilder.append/1, longPairSets.forEach/1, longPairSet.forEach/1, AtomicBoolean.getAndSet/1,... | /* static context
[FOCAL] @Override public String ConcurrentSortedLongPairSet.toString()
[COLLABORATORS] field longPairSets forEach/1; field longPairSet forEach/1
[NEW] StringBuilder, AtomicBoolean
[CALLS-EXTERNAL] StringBuilder.append/1, longPairSets.forEach/1, longPairSet.forEach/1, AtomicBoolean.getAndSet/1, StringB... | /* static context
[FOCAL] @Override public String ConcurrentSortedLongPairSet.toString()
[COLLABORATORS] field longPairSets forEach/1; field longPairSet forEach/1
[NEW] StringBuilder, AtomicBoolean
[CALLS-EXTERNAL] StringBuilder.append/1, longPairSets.forEach/1, longPairSet.forEach/1, AtomicBoolean.getAndSet/1, StringB... | true | ok | {"focal": {"class": "ConcurrentSortedLongPairSet", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "ConcurrentSortedLongPairSet", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Lo... |
62138020_46 | class PeppolCompatibilityValidator implements IAS4ProfileValidator {
@Override
public void validatePMode (@Nonnull final IPMode aPMode, @Nonnull final ErrorList aErrorList)
{
ValueEnforcer.isTrue (aErrorList.isEmpty (), () -> "Errors in global PMode validation: " + aErrorList.toString ());
try
{
... | m_aPMode.getLeg1 ().getSecurity ().setPModeAuthorize (ETriState.UNDEFINED);
VALIDATOR.validatePMode (m_aPMode, m_aErrorList);
assertTrue ("Errors: " + m_aErrorList.toString (), m_aErrorList.containsAny (x -> x.getErrorText (LOCALE).contains ("mandatory")));
}
} | [FOCAL] @Override public void PeppolCompatibilityValidator.validatePMode(IPMode aPMode, ErrorList aErrorList)
[CLASS] class PeppolCompatibilityValidator implements IAS4ProfileValidator
[METRICS] loc=46 cc=5 branches=3 loops=0 returns=0 throws=0 nesting=2
[CALLS-INTERNAL] IError _createError(String sMsg); void _checkIfL... | /* static context
[FOCAL] @Override public void PeppolCompatibilityValidator.validatePMode(IPMode aPMode, ErrorList aErrorList)
[PATH1] try-body throws -> if(eMEP == EMEP.ONE_WAY && eMEPBinding == EMEPBinding.PUSH)=F -> if(aPModeLeg1 == null)=F -> if(aPMode.getLeg2 () != null)=T
[PATH2] if(eMEP == EMEP.ONE_WAY && eMEPB... | /* static context
[FOCAL] @Override public void PeppolCompatibilityValidator.validatePMode(IPMode aPMode, ErrorList aErrorList)
[PATH1] try-body throws -> if(eMEP == EMEP.ONE_WAY && eMEPBinding == EMEPBinding.PUSH)=F -> if(aPModeLeg1 == null)=F -> if(aPMode.getLeg2 () != null)=T
[PATH2] if(eMEP == EMEP.ONE_WAY && eMEPB... | true | ok | {"focal": {"class": "PeppolCompatibilityValidator", "name": "validatePMode", "signature": "void validatePMode(IPMode aPMode, ErrorList aErrorList)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "aPMode", "type": "IPMode"}, {"name": "aErrorList", "type": "ErrorList"}], "return_type": "void"}, "c... |
62155865_1 | class ImmutableModule {
@ImmutableExecutorDecorator
Task provideTask(final Task task) {
return new TaskDecorator(new DummyExecutor(), task);
}
}
class ImmutableModuleTest {
@Test
public void givenANonNullDecoratedObject_ShouldExecute() {
| final MockTask task = new MockTask();
new ImmutableModule().provideTask(task).invoke();
assertTrue(task.isInvoke);
}
} | [FOCAL] @ImmutableExecutorDecorator Task ImmutableModule.provideTask(Task task)
[CLASS] class ImmutableModule
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] TaskDecorator, DummyExecutor
[INPUTS] branches=- | result=task
[DATAFLOW] task@param->L3
[TEST] ImmutableModuleTest: @Test public void ... | /* static context
[FOCAL] @ImmutableExecutorDecorator Task ImmutableModule.provideTask(Task task)
[INPUTS] branches=- | result=task
[NEW] TaskDecorator, DummyExecutor
*/
| /* static context
[FOCAL] @ImmutableExecutorDecorator Task ImmutableModule.provideTask(Task task)
[INPUTS] branches=- | result=task
[NEW] TaskDecorator, DummyExecutor
*/
class ImmutableModule {
@ImmutableExecutorDecorator
Task provideTask(final Task task) {
return new TaskDecorator(new DummyExecutor(),... | true | ok | {"focal": {"class": "ImmutableModule", "name": "provideTask", "signature": "Task provideTask(Task task)", "start_line": 3, "modifiers": "@ImmutableExecutorDecorator", "params": [{"name": "task", "type": "Task"}], "return_type": "Task"}, "class_info": {"name": "ImmutableModule", "kind": "class", "modifiers": "", "superc... |
62156481_25 | class EncryptedFileSystem extends DelegatingFileSystem {
@Override
public boolean rename(Path src, Path dst) throws IOException {
// Copy key material first so the encrypted file always has key material in the key store even if the
// put or rename fails
KeyMaterial keyMaterial = keySto... | when(mockFs.rename(path, newPath)).thenReturn(true);
doThrow(new IllegalArgumentException()).when(mockKeyStore).remove(anyString());
assertThat(mockedEfs.rename(path, newPath)).isTrue();
}
} | [FOCAL] @Override public boolean EncryptedFileSystem.rename(Path src, Path dst)
[CLASS] class EncryptedFileSystem extends DelegatingFileSystem
[METRICS] loc=16 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] void tryRemoveKey(Path path)
[CALLS-EXTERNAL] InMemoryKeyStorageStrategy.get/1, Path.toStr... | /* static context
[FOCAL] @Override public boolean EncryptedFileSystem.rename(Path src, Path dst)
[PATH1] if(renamed)=T -> return renamed
[PATH2] if(renamed)=F -> return renamed
[INPUTS] branches=dst, src | result=dst, src
[COLLABORATORS] field keyStore:InMemoryKeyStorageStrategy get/1,put/2; param src:Path toString/0;... | /* static context
[FOCAL] @Override public boolean EncryptedFileSystem.rename(Path src, Path dst)
[PATH1] if(renamed)=T -> return renamed
[PATH2] if(renamed)=F -> return renamed
[INPUTS] branches=dst, src | result=dst, src
[COLLABORATORS] field keyStore:InMemoryKeyStorageStrategy get/1,put/2; param src:Path toString/0;... | true | ok | {"focal": {"class": "EncryptedFileSystem", "name": "rename", "signature": "boolean rename(Path src, Path dst) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "src", "type": "Path"}, {"name": "dst", "type": "Path"}], "return_type": "boolean"}, "class_info": {"name": "EncryptedF... |
62161266_1 | class TokenProvider {
public boolean validateToken(String authToken) {
try {
Jwts.parser().setSigningKey(key).parseClaimsJws(authToken);
return true;
} catch (io.jsonwebtoken.security.SecurityException | MalformedJwtException e) {
log.info("Invalid JWT signature.... | String unsupportedToken = createUnsupportedToken();
boolean isTokenValid = tokenProvider.validateToken(unsupportedToken);
assertThat(isTokenValid).isEqualTo(false);
}
} | [FOCAL] public boolean TokenProvider.validateToken(String authToken)
[CLASS] class TokenProvider
[METRICS] loc=19 cc=5 branches=0 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] Jwts.parser().setSigningKey(key).parseClaimsJws/1, Jwts.parser().setSigningKey/1, Jwts.parser/0, log.info/1, log.trace/2
[FIELDS] read=k... | /* static context
[FOCAL] public boolean TokenProvider.validateToken(String authToken)
[PATH1] try-body throws -> return false
[PATH2] return true
[EXCEPTIONS] catches io.jsonwebtoken.security.SecurityException | MalformedJwtException e, ExpiredJwtException e, UnsupportedJwtException e, IllegalArgumentException e
[FIEL... | /* static context
[FOCAL] public boolean TokenProvider.validateToken(String authToken)
[PATH1] try-body throws -> return false
[PATH2] return true
[EXCEPTIONS] catches io.jsonwebtoken.security.SecurityException | MalformedJwtException e, ExpiredJwtException e, UnsupportedJwtException e, IllegalArgumentException e
[FIEL... | true | ok | {"focal": {"class": "TokenProvider", "name": "validateToken", "signature": "boolean validateToken(String authToken)", "start_line": 3, "modifiers": "public", "params": [{"name": "authToken", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "TokenProvider", "kind": "class", "modifiers": "", "supercl... |
62177795_129 | class MetadataUtils {
public static cern.c2mon.server.common.metadata.Metadata parseMetadataConfiguration(Properties properties, cern.c2mon.server.common.metadata.Metadata currentMetadata) {
return Optional.ofNullable(properties.getProperty("metadata"))
.map(Metadata::fromJSON)
.map(newMetadata -... | Metadata currentMetadata = new Metadata();
String currentKey = "currentKey";
currentMetadata.addMetadata(currentKey, "value1");
cern.c2mon.shared.client.metadata.Metadata clientMetadata = new cern.c2mon.shared.client.metadata.Metadata();
String newClientKey = "newClientKey";
clientMetadata.addMe... | [FOCAL] public static cern.c2mon.server.common.metadata.Metadata MetadataUtils.parseMetadataConfiguration(Properties properties, cern.c2mon.server.common.metadata.Metadata currentMetadata)
[CLASS] class MetadataUtils
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] cern.c2mon.server... | /* static context
[FOCAL] public static cern.c2mon.server.common.metadata.Metadata MetadataUtils.parseMetadataConfiguration(Properties properties, cern.c2mon.server.common.metadata.Metadata currentMetadata)
[INPUTS] branches=- | result=currentMetadata, properties
[COLLABORATORS] param properties:Properties getProperty/... | /* static context
[FOCAL] public static cern.c2mon.server.common.metadata.Metadata MetadataUtils.parseMetadataConfiguration(Properties properties, cern.c2mon.server.common.metadata.Metadata currentMetadata)
[INPUTS] branches=- | result=currentMetadata, properties
[COLLABORATORS] param properties:Properties getProperty/... | true | ok | {"focal": {"class": "MetadataUtils", "name": "parseMetadataConfiguration", "signature": "cern.c2mon.server.common.metadata.Metadata parseMetadataConfiguration(Properties properties, cern.c2mon.server.common.metadata.Metadata currentMetadata)", "start_line": 3, "modifiers": "public static", "params": [{"name": "properti... |
62209334_34 | class GtfsZipFile {
public Path extractStopsFile() throws IOException {
return extractFile(STOPS_FILE_NAME);
}
public GtfsZipFile(Path gtfsZip);
public void extractFile(String fileName, Path extractTo);
private Path extractFile(String fileName);
InputStream getFileInStream(ZipFile zipFile, String ... | // Prepare
Path zipFile = Paths.get(
"src/test/resources/siri_client/gtfs/data/GtfsWorkspaceTest/ftpWorkspace/israel-public-transportation.zip");
GtfsZipFile gtfsZipFile = new GtfsZipFile(zipFile);
// Execute
Path actual = gtfsZipFile.extractStopsFile();
// Test
assertNotNull(actual)... | [FOCAL] public Path GtfsZipFile.extractStopsFile()
[CLASS] class GtfsZipFile
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Path extractFile(String fileName)
[EXCEPTIONS] declares IOException
[CLASS-MEMBERS] GtfsZipFile(Path gtfsZip); void extractFile(String fileName, Path extract... | /* static context
[FOCAL] public Path GtfsZipFile.extractStopsFile()
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] Path extractFile(String fileName)
*/
| /* static context
[FOCAL] public Path GtfsZipFile.extractStopsFile()
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] Path extractFile(String fileName)
*/
class GtfsZipFile {
public Path extractStopsFile() throws IOException {
return extractFile(STOPS_FILE_NAME);
}
public GtfsZipFile(Path gtfsZip);
p... | true | ok | {"focal": {"class": "GtfsZipFile", "name": "extractStopsFile", "signature": "Path extractStopsFile() throws IOException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Path"}, "class_info": {"name": "GtfsZipFile", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.