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
96048740_17
class DeviceMessageHandler extends Handler { @Override public void handleMessage(Message message) { super.handleMessage(message); if (listener != null) { listener.onMessageReceived(message); } } DeviceMessageHandler(final DeviceMessageListener deviceMessageListener); @Mock private Devi...
// given DeviceMessageHandler handler = new DeviceMessageHandler(null); // when handler.handleMessage(message); // then verify(deviceMessageListener, times(0)).onMessageReceived(message); } }
[FOCAL] @Override public void DeviceMessageHandler.handleMessage(Message message) [CLASS] class DeviceMessageHandler extends Handler [METRICS] loc=7 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] Handler.handleMessage/1, listener.onMessageReceived/1 [PATH1] if(listener != null)=T [PATH2] if(liste...
/* static context [FOCAL] @Override public void DeviceMessageHandler.handleMessage(Message message) [PATH1] if(listener != null)=T [PATH2] if(listener != null)=F [COLLABORATORS] field listener onMessageReceived/1 [CALLS-EXTERNAL] Handler.handleMessage/1, listener.onMessageReceived/1 */
/* static context [FOCAL] @Override public void DeviceMessageHandler.handleMessage(Message message) [PATH1] if(listener != null)=T [PATH2] if(listener != null)=F [COLLABORATORS] field listener onMessageReceived/1 [CALLS-EXTERNAL] Handler.handleMessage/1, listener.onMessageReceived/1 */ class DeviceMessageHandler extend...
true
ok
{"focal": {"class": "DeviceMessageHandler", "name": "handleMessage", "signature": "void handleMessage(Message message)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "message", "type": "Message"}], "return_type": "void"}, "class_info": {"name": "DeviceMessageHandler", "kind": "class", "modifier...
96060769_12
class MDSMapObjectInspector implements SettableMapObjectInspector { @Override public ObjectInspector getMapValueObjectInspector(){ return valueObjectInspector; } public MDSMapObjectInspector( final MapTypeInfo typeInfo ); @Override public ObjectInspector getMapKeyObjectInspector(); @Override public ...
MapTypeInfo info = new MapTypeInfo(); info.setMapKeyTypeInfo( TypeInfoFactory.stringTypeInfo ); info.setMapValueTypeInfo( TypeInfoFactory.stringTypeInfo ); MDSMapObjectInspector inspector = new MDSMapObjectInspector( info ); assertTrue( inspector.getMapValueObjectInspector() instanceof StringObjectI...
[FOCAL] @Override public ObjectInspector MDSMapObjectInspector.getMapValueObjectInspector() [CLASS] class MDSMapObjectInspector implements SettableMapObjectInspector [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] MDSMapObjectInspector(MapTypeInfo typeInfo); ObjectInspector getMapKe...
/* static context [FOCAL] @Override public ObjectInspector MDSMapObjectInspector.getMapValueObjectInspector() */
/* static context [FOCAL] @Override public ObjectInspector MDSMapObjectInspector.getMapValueObjectInspector() */ class MDSMapObjectInspector implements SettableMapObjectInspector { @Override public ObjectInspector getMapValueObjectInspector(){ return valueObjectInspector; } public MDSMapObjectInspector( ...
true
ok
{"focal": {"class": "MDSMapObjectInspector", "name": "getMapValueObjectInspector", "signature": "ObjectInspector getMapValueObjectInspector()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "ObjectInspector"}, "class_info": {"name": "MDSMapObjectInspector", "kind": "class", "modifiers":...
96066104_1
class Promise { public static <U> Promise <U> race (Promise <U>... promises) { return race (Arrays.asList (promises)); } public Promise(PromiseExecutor<T> impl); public Promise(String name, PromiseExecutor<T> impl); private Promise(T value); private Promise(Throwable reason); private Promise(...
synchronized (this.lock_) { Promise<Integer> p = Promise.race ( new Promise<> (settlement -> { { try { Thread.sleep (500); settlement.resolve (10); } catc...
[FOCAL] public static Promise <U> Promise.race(Promise <U>... promises) [CLASS] class Promise [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Promise <U> race(List <Promise <U>> promises) [CALLS-EXTERNAL] Arrays.asList/1 [INPUTS] branches=- | result=promises [DATAFLOW] promises@par...
/* static context [FOCAL] public static Promise <U> Promise.race(Promise <U>... promises) [INPUTS] branches=- | result=promises [CALLS-INTERNAL] Promise <U> race(List <Promise <U>> promises) [CALLS-EXTERNAL] Arrays.asList/1 */
/* static context [FOCAL] public static Promise <U> Promise.race(Promise <U>... promises) [INPUTS] branches=- | result=promises [CALLS-INTERNAL] Promise <U> race(List <Promise <U>> promises) [CALLS-EXTERNAL] Arrays.asList/1 */ class Promise { public static <U> Promise <U> race (Promise <U>... promises) { retur...
true
ok
{"focal": {"class": "Promise", "name": "race", "signature": "Promise <U> race(Promise <U>... promises)", "start_line": 3, "modifiers": "public static", "params": [{"name": "promises", "type": "Promise <U>..."}], "return_type": "Promise <U>"}, "class_info": {"name": "Promise", "kind": "class", "modifiers": "", "supercla...
96094840_5
class JSONObject extends JSONGetter<String> implements JSON, Map<String, Object> { public <T> T toBean(Class<T> clazz) { return toBean(clazz, false); } public JSONObject(); public JSONObject(JSONObject jsonObject, String... names); public JSONObject(JSONTokener x); public JSONObject(Object source); publi...
UserA userA = new UserA(); userA.setA("A user"); userA.setName("nameTest"); userA.setDate(new Date()); JSONObject userAJson = JSONUtil.parseObj(userA); UserB userB = JSONUtil.toBean(userAJson, UserB.class); Assert.assertEquals(userA.getName(), userB.getName()); Assert.assertEquals(userA.getDate(),...
[FOCAL] public T JSONObject.toBean(Class<T> clazz) [CLASS] class JSONObject extends JSONGetter<String> implements JSON, Map<String, Object> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] T toBean(Class<T> clazz, boolean ignoreError) [INPUTS] branches=- | result=clazz [DATAFLOW] cl...
/* static context [FOCAL] public T JSONObject.toBean(Class<T> clazz) [INPUTS] branches=- | result=clazz [CALLS-INTERNAL] T toBean(Class<T> clazz, boolean ignoreError) */
/* static context [FOCAL] public T JSONObject.toBean(Class<T> clazz) [INPUTS] branches=- | result=clazz [CALLS-INTERNAL] T toBean(Class<T> clazz, boolean ignoreError) */ class JSONObject extends JSONGetter<String> implements JSON, Map<String, Object> { public <T> T toBean(Class<T> clazz) { return toBean(clazz, fals...
true
ok
{"focal": {"class": "JSONObject", "name": "toBean", "signature": "T toBean(Class<T> clazz)", "start_line": 3, "modifiers": "public", "params": [{"name": "clazz", "type": "Class<T>"}], "return_type": "T"}, "class_info": {"name": "JSONObject", "kind": "class", "modifiers": "", "superclass": "JSONGetter<String>", "interfa...
96114330_134
class RuleBuilder { public static Builder<RuleBuilder, DecisionTreeRule> creator() { return Builder.instanceOf(RuleBuilder.create(), RuleBuilder.validate(), RuleBuilder::builds); } public static DecisionTreeRule builds(final RuleBuilder builder); private static Supplier<RuleBuilder> create(); ...
final Instant startTime = Instant.now().minus(1, ChronoUnit.DAYS); final Instant endTime = Instant.now().plus(1, ChronoUnit.DAYS); final DecisionTreeRule rule = RuleBuilder.creator().with(RuleBuilder::input, Arrays.asList("test1", "test2")) .with(RuleBuilder::setDriverCount, 2L)...
[FOCAL] public static Builder<RuleBuilder, DecisionTreeRule> RuleBuilder.creator() [CLASS] class RuleBuilder [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Builder.instanceOf/3, RuleBuilder.create/0, RuleBuilder.validate/0 [CLASS-MEMBERS] DecisionTreeRule builds(RuleBuilder builde...
/* static context [FOCAL] public static Builder<RuleBuilder, DecisionTreeRule> RuleBuilder.creator() [CALLS-EXTERNAL] Builder.instanceOf/3, RuleBuilder.create/0, RuleBuilder.validate/0 */
/* static context [FOCAL] public static Builder<RuleBuilder, DecisionTreeRule> RuleBuilder.creator() [CALLS-EXTERNAL] Builder.instanceOf/3, RuleBuilder.create/0, RuleBuilder.validate/0 */ class RuleBuilder { public static Builder<RuleBuilder, DecisionTreeRule> creator() { return Builder.instanceOf(RuleBuil...
true
ok
{"focal": {"class": "RuleBuilder", "name": "creator", "signature": "Builder<RuleBuilder, DecisionTreeRule> creator()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Builder<RuleBuilder, DecisionTreeRule>"}, "class_info": {"name": "RuleBuilder", "kind": "class", "modifiers": "", "superclas...
96121797_109
class ElasticSearchRestHighImpl implements ElasticSearchService { @Override public Future<Boolean> bulkInsert( String index, List<Map<String, Object>> dataList, RequestContext context) { long startTime = System.currentTimeMillis(); logger.info( context, "ElasticSearchRestHighImpl:bulk...
mockRulesForBulk(false); List<Map<String, Object>> list = new ArrayList<>(); Map<String, Object> map = new HashMap<>(); map.put(JsonKey.IDENTIFIER, "0001"); list.add(map); Future<Boolean> result = esService.bulkInsert("test", list, null); boolean res = (boolean) ElasticSearchHelper.getRespon...
[FOCAL] @Override public Future<Boolean> ElasticSearchRestHighImpl.bulkInsert(String index, List<Map<String, Object>> dataList, RequestContext context) [CLASS] class ElasticSearchRestHighImpl implements ElasticSearchService [METRICS] loc=57 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] long calc...
/* static context [FOCAL] @Override public Future<Boolean> ElasticSearchRestHighImpl.bulkInsert(String index, List<Map<String, Object>> dataList, RequestContext context) [PATH1] foreach(Map<String, Object> data : dataList)=T -> exit loop -> return promise.future() [PATH2] foreach(Map<String, Object> data : dataList)=F ...
/* static context [FOCAL] @Override public Future<Boolean> ElasticSearchRestHighImpl.bulkInsert(String index, List<Map<String, Object>> dataList, RequestContext context) [PATH1] foreach(Map<String, Object> data : dataList)=T -> exit loop -> return promise.future() [PATH2] foreach(Map<String, Object> data : dataList)=F ...
true
ok
{"focal": {"class": "ElasticSearchRestHighImpl", "name": "bulkInsert", "signature": "Future<Boolean> bulkInsert(String index, List<Map<String, Object>> dataList, RequestContext context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "index", "type": "String"}, {"name": "dataList", "type": "List...
96123627_156
class RequestValidator { @SuppressWarnings("unchecked") public static void validateUpdateContent(Request contentRequestDto) { List<Map<String, Object>> list = (List<Map<String, Object>>) (contentRequestDto.getRequest().get(JsonKey.CONTENTS)); if(CollectionUtils.isNotEmpty(list)) { for (Ma...
Request request = new Request(); List<Map<String, Object>> listOfMap = new ArrayList<>(); Map<String, Object> requestObj = new HashMap<>(); requestObj.put(JsonKey.CONTENT_ID, "do_1233343"); listOfMap.add(requestObj); Map<String, Object> innerMap = new HashMap<>(); innerMap.put(JsonKey.CONTEN...
[FOCAL] @SuppressWarnings("unchecked") public static void RequestValidator.validateUpdateContent(Request contentRequestDto) [CLASS] class RequestValidator [METRICS] loc=164 cc=28 branches=24 loops=3 returns=0 throws=19 nesting=4 [CALLS-EXTERNAL] contentRequestDto.getRequest().get/1, Request.getRequest/0, CollectionUtil...
class RequestValidator { @SuppressWarnings("unchecked") public static void validateUpdateContent(Request contentRequestDto) { List<Map<String, Object>> list = (List<Map<String, Object>>) (contentRequestDto.getRequest().get(JsonKey.CONTENTS)); if(CollectionUtils.isNotEmpty(list)) { for (Ma...
false
ok
{"focal": {"class": "RequestValidator", "name": "validateUpdateContent", "signature": "void validateUpdateContent(Request contentRequestDto)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public static", "params": [{"name": "contentRequestDto", "type": "Request"}], "return_type": "void"}, "class_info...
96242277_10
class InternetRadioService { public List<InternetRadioSource> getInternetRadioSources(InternetRadio radio) { List<InternetRadioSource> sources; if (cachedSources.containsKey(radio.getId())) { LOG.debug("Got cached sources for internet radio {}!", radio.getStreamUrl()); sourc...
List<InternetRadioSource> radioSources = internetRadioService.getInternetRadioSources(radioMoveLoop); // A PlaylistHasTooManyRedirects exception is thrown internally, // and the `getInternetRadioSources` method logs it and returns 0 sources. Assert.assertEquals(0, radioSources.size()); ...
[FOCAL] public List<InternetRadioSource> InternetRadioService.getInternetRadioSources(InternetRadio radio) [CLASS] class InternetRadioService [METRICS] loc=22 cc=4 branches=2 loops=0 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] List<InternetRadioSource> retrieveInternetRadioSources(InternetRadio radio) [CALLS-EXTERNAL...
/* static context [FOCAL] public List<InternetRadioSource> InternetRadioService.getInternetRadioSources(InternetRadio radio) [PATH1] if(cachedSources.containsKey(radio.getId()))=F -> try-body throws -> return sources [PATH2] if(cachedSources.containsKey(radio.getId()))=T -> return sources [PATH3] if(cachedSources.conta...
/* static context [FOCAL] public List<InternetRadioSource> InternetRadioService.getInternetRadioSources(InternetRadio radio) [PATH1] if(cachedSources.containsKey(radio.getId()))=F -> try-body throws -> return sources [PATH2] if(cachedSources.containsKey(radio.getId()))=T -> return sources [PATH3] if(cachedSources.conta...
true
ok
{"focal": {"class": "InternetRadioService", "name": "getInternetRadioSources", "signature": "List<InternetRadioSource> getInternetRadioSources(InternetRadio radio)", "start_line": 3, "modifiers": "public", "params": [{"name": "radio", "type": "InternetRadio"}], "return_type": "List<InternetRadioSource>"}, "class_info":...
96331237_57
class CsarImpl implements Csar { @Override public Optional<Transformation> getTransformation(String platformId) { Transformation t = transformations.get(platformId); return Optional.ofNullable(t); } public CsarImpl(File rootDir, String identifier, Log log); private List<Lifecycle...
Optional<Transformation> result = csar.getTransformation(PLATFORM1.id); assertTrue(result.isPresent()); assertEquals(transformation1, result.get()); } }
[FOCAL] @Override public Optional<Transformation> CsarImpl.getTransformation(String platformId) [CLASS] class CsarImpl implements Csar [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] List<Transformation>.get/1, Optional.ofNullable/1 [FIELDS] read=transformations:List<Transformation...
/* static context [FOCAL] @Override public Optional<Transformation> CsarImpl.getTransformation(String platformId) [INPUTS] branches=- | result=platformId, transformations [COLLABORATORS] field transformations:List<Transformation> get/1 [FIELDS] read=transformations:List<Transformation> [CALLS-EXTERNAL] List<Transformat...
/* static context [FOCAL] @Override public Optional<Transformation> CsarImpl.getTransformation(String platformId) [INPUTS] branches=- | result=platformId, transformations [COLLABORATORS] field transformations:List<Transformation> get/1 [FIELDS] read=transformations:List<Transformation> [CALLS-EXTERNAL] List<Transformat...
true
ok
{"focal": {"class": "CsarImpl", "name": "getTransformation", "signature": "Optional<Transformation> getTransformation(String platformId)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "platformId", "type": "String"}], "return_type": "Optional<Transformation>"}, "class_info": {"name": "CsarImpl"...
96367327_165
class SpyImpl implements Spy { @Nonnull @Override public ObserverInfo asObserverInfo( @Nonnull final Observer observer ) { return observer.asInfo(); } SpyImpl( @Nullable final ArezContext context ); @Override public void addSpyEventHandler( @Nonnull final SpyEventHandler handler ); @Override pu...
final ArezContext context = Arez.context(); final Observer observer = context.observer( AbstractTest::observeADependency ); final ObserverInfo info = context.getSpy().asObserverInfo( observer ); assertEquals( info.getName(), observer.getName() ); } }
[FOCAL] @Nonnull @Override public ObserverInfo SpyImpl.asObserverInfo(Observer observer) [CLASS] class SpyImpl implements Spy [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Observer.asInfo/0 [INPUTS] branches=- | result=observer [COLLABORATORS] param observer:Observer asInfo/0 [DA...
/* static context [FOCAL] @Nonnull @Override public ObserverInfo SpyImpl.asObserverInfo(Observer observer) [INPUTS] branches=- | result=observer [COLLABORATORS] param observer:Observer asInfo/0 [CALLS-EXTERNAL] Observer.asInfo/0 */
/* static context [FOCAL] @Nonnull @Override public ObserverInfo SpyImpl.asObserverInfo(Observer observer) [INPUTS] branches=- | result=observer [COLLABORATORS] param observer:Observer asInfo/0 [CALLS-EXTERNAL] Observer.asInfo/0 */ class SpyImpl implements Spy { @Nonnull @Override public ObserverInfo asObserverI...
true
ok
{"focal": {"class": "SpyImpl", "name": "asObserverInfo", "signature": "ObserverInfo asObserverInfo(Observer observer)", "start_line": 3, "modifiers": "@Nonnull @Override public", "params": [{"name": "observer", "type": "Observer"}], "return_type": "ObserverInfo"}, "class_info": {"name": "SpyImpl", "kind": "class", "mod...
96455695_1
class RepositoryInitializationService { @EventListener @Transactional public void initialize(ApplicationReadyEvent event) { synchronizeRepositories(); synchronizePackageMetadata(); } public RepositoryInitializationService(RepositoryRepository repositoryRepository, PackageMetadataRepository packageMetadat...
assertThat(repositoryRepository.count()).isEqualTo(2); assertThat(repositoryRepository.findByName("test").getUrl()).isEqualTo("classpath:/repositories/binaries/test"); // Note, this is a brittle assertion. assertThat(packageMetadataRepository.count()).isGreaterThan(5); } }
[FOCAL] @EventListener @Transactional public void RepositoryInitializationService.initialize(ApplicationReadyEvent event) [CLASS] class RepositoryInitializationService [METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void synchronizePackageMetadata(); void synchronizeRepositories() ...
/* static context [FOCAL] @EventListener @Transactional public void RepositoryInitializationService.initialize(ApplicationReadyEvent event) [INPUTS] branches=- | result=- | unused=event [CALLS-INTERNAL] void synchronizePackageMetadata(); void synchronizeRepositories() */
/* static context [FOCAL] @EventListener @Transactional public void RepositoryInitializationService.initialize(ApplicationReadyEvent event) [INPUTS] branches=- | result=- | unused=event [CALLS-INTERNAL] void synchronizePackageMetadata(); void synchronizeRepositories() */ class RepositoryInitializationService { @Event...
true
ok
{"focal": {"class": "RepositoryInitializationService", "name": "initialize", "signature": "void initialize(ApplicationReadyEvent event)", "start_line": 3, "modifiers": "@EventListener @Transactional public", "params": [{"name": "event", "type": "ApplicationReadyEvent"}], "return_type": "void"}, "class_info": {"name": "...
96467418_0
class DefaultClientHeadersFactoryImpl implements ClientHeadersFactory { @Override public MultivaluedMap<String, String> update(MultivaluedMap<String, String> incomingHeaders, MultivaluedMap<String, String> clientOutgoingHeaders) { if (LOG.isLoggable(Lev...
MultivaluedMap<String, String> incomingHeaders = mockIncomingHeaders(); MultivaluedMap<String, String> clientOutgoingHeaders = new MultivaluedHashMap<>(); MultivaluedMap<String, String> updatedHeaders = impl.update(incomingHeaders, clientOutgoingHeaders); assertNotNull(updatedHeaders); ...
[FOCAL] @Override public MultivaluedMap<String, String> DefaultClientHeadersFactoryImpl.update(MultivaluedMap<String, String> incomingHeaders, MultivaluedMap<String, String> clientOutgoingHeaders) [CLASS] class DefaultClientHeadersFactoryImpl implements ClientHeadersFactory [METRICS] loc=22 cc=4 branches=3 loops=0 retu...
/* static context [FOCAL] @Override public MultivaluedMap<String, String> DefaultClientHeadersFactoryImpl.update(MultivaluedMap<String, String> incomingHeaders, MultivaluedMap<String, String> clientOutgoingHeaders) [PATH1] if(LOG.isLoggable(Level.FINER))#1=T -> if(propagateHeaderString.isPresent())=T -> if(LOG.isLoggab...
/* static context [FOCAL] @Override public MultivaluedMap<String, String> DefaultClientHeadersFactoryImpl.update(MultivaluedMap<String, String> incomingHeaders, MultivaluedMap<String, String> clientOutgoingHeaders) [PATH1] if(LOG.isLoggable(Level.FINER))#1=T -> if(propagateHeaderString.isPresent())=T -> if(LOG.isLoggab...
true
ok
{"focal": {"class": "DefaultClientHeadersFactoryImpl", "name": "update", "signature": "MultivaluedMap<String, String> update(MultivaluedMap<String, String> incomingHeaders, MultivaluedMap<String, String> clientOutgoingHeaders)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "incomingHeaders", "t...
96480746_9
class DebugBashCodeToggleSupport { public String disableDebugging(String sourceCode) throws IOException { int index = sourceCode.indexOf(DEBUG_POSTFIX); if (index == -1) { return sourceCode; } int pos = index + DEBUG_POSTFIX.length(); String data = sourceCode.sub...
assertEquals("#! /bin/mybash", supportToTest.disableDebugging(EXPECTED_DEBUG_ENABLED_CODE + "#! /bin/mybash")); } }
[FOCAL] public String DebugBashCodeToggleSupport.disableDebugging(String sourceCode) [CLASS] class DebugBashCodeToggleSupport [METRICS] loc=15 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] String.indexOf/1, DEBUG_POSTFIX.length/0, String.substring/1, String.startsWith/1 [EXCEPTIONS] declares IOE...
/* static context [FOCAL] public String DebugBashCodeToggleSupport.disableDebugging(String sourceCode) [PATH1] if(index == -1)=F -> if(data.startsWith("\n"))=T -> return data [PATH2] if(index == -1)=T -> return sourceCode [PATH3] if(index == -1)=F -> if(data.startsWith("\n"))=F -> return data [INPUTS] branches=sourceCo...
/* static context [FOCAL] public String DebugBashCodeToggleSupport.disableDebugging(String sourceCode) [PATH1] if(index == -1)=F -> if(data.startsWith("\n"))=T -> return data [PATH2] if(index == -1)=T -> return sourceCode [PATH3] if(index == -1)=F -> if(data.startsWith("\n"))=F -> return data [INPUTS] branches=sourceCo...
true
ok
{"focal": {"class": "DebugBashCodeToggleSupport", "name": "disableDebugging", "signature": "String disableDebugging(String sourceCode) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "sourceCode", "type": "String"}], "return_type": "String"}, "class_info": {"name": "DebugBashCodeToggleS...
96517640_0
class LoginViewModel extends BaseViewModel<LoginNavigator> { public void login(String email, String password) { setIsLoading(true); getCompositeDisposable().add(getDataManager() .doServerLoginApiCall(new LoginRequest.ServerLoginRequest(email, password)) .doOnSuccess(...
String email = "dummy@gmail.com"; String password = "password"; LoginResponse loginResponse = new LoginResponse(); doReturn(Single.just(loginResponse)) .when(mMockDataManager) .doServerLoginApiCall(new LoginRequest.ServerLoginRequest(email, password)); ...
[FOCAL] public void LoginViewModel.login(String email, String password) [CLASS] class LoginViewModel extends BaseViewModel<LoginNavigator> [METRICS] loc=22 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] setIsLoading/1 (inherited), getCompositeDisposable().add/1, getCompositeDisposable/0 (inherite...
/* static context [FOCAL] public void LoginViewModel.login(String email, String password) [COLLABORATORS] field response getAccessToken/0,getUserId/0,getUserName/0,getUserEmail/0,getGoogleProfilePicUrl/0 [NEW] LoginRequest.ServerLoginRequest [CALLS-EXTERNAL] setIsLoading/1 (inherited), getCompositeDisposable().add/1, g...
/* static context [FOCAL] public void LoginViewModel.login(String email, String password) [COLLABORATORS] field response getAccessToken/0,getUserId/0,getUserName/0,getUserEmail/0,getGoogleProfilePicUrl/0 [NEW] LoginRequest.ServerLoginRequest [CALLS-EXTERNAL] setIsLoading/1 (inherited), getCompositeDisposable().add/1, g...
true
ok
{"focal": {"class": "LoginViewModel", "name": "login", "signature": "void login(String email, String password)", "start_line": 3, "modifiers": "public", "params": [{"name": "email", "type": "String"}, {"name": "password", "type": "String"}], "return_type": "void"}, "class_info": {"name": "LoginViewModel", "kind": "clas...
96553293_2
class RAMLtoSwagger implements Constants { @SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); } RAMLtoSwagger(); private void initializeRespCodes(); private String getResponseMessage(int code); private voi...
String raml = IOUtils.resourceToString("/product-api.raml", Charset.forName("UTF-8")); Assert.assertNotNull(raml); String swagger = raml2Swagger.convertToSwagger(raml); Assert.assertNotNull(swagger); TypeReference<HashMap<String, Object>> typeRef = new TypeReference<HashMap<Str...
[FOCAL] @SuppressWarnings("WeakerAccess, unused") public String RAMLtoSwagger.convertToSwagger(String raml) [CLASS] class RAMLtoSwagger implements Constants [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String convertToSwagger(String raml, ResourceLoader resourceLoader) [INPUTS] ...
/* static context [FOCAL] @SuppressWarnings("WeakerAccess, unused") public String RAMLtoSwagger.convertToSwagger(String raml) [INPUTS] branches=- | result=raml [CALLS-INTERNAL] String convertToSwagger(String raml, ResourceLoader resourceLoader) */
/* static context [FOCAL] @SuppressWarnings("WeakerAccess, unused") public String RAMLtoSwagger.convertToSwagger(String raml) [INPUTS] branches=- | result=raml [CALLS-INTERNAL] String convertToSwagger(String raml, ResourceLoader resourceLoader) */ class RAMLtoSwagger implements Constants { @SuppressWarnings("Weake...
true
ok
{"focal": {"class": "RAMLtoSwagger", "name": "convertToSwagger", "signature": "String convertToSwagger(String raml)", "start_line": 3, "modifiers": "@SuppressWarnings(\"WeakerAccess, unused\") public", "params": [{"name": "raml", "type": "String"}], "return_type": "String"}, "class_info": {"name": "RAMLtoSwagger", "kin...
96556232_64
class KeepaliveReaderWrapper implements DelegatingReader<D, B>,Runnable, Closeable { @Override public void close() { // Do not interrupt, it's not our executor scheduledFuture.cancel(false); } public KeepaliveReaderWrapper(@Nonnull final Reader<D, B> delegate, ...
final CapturingFailListener listener = new CapturingFailListener(); final KeepaliveReaderWrapper<DataObject, Builder<DataObject>> keepaliveWrapper = new KeepaliveReaderWrapper<>(delegate, exec, TestingException.class, 1, listener); keepaliveWrapper.readCurrentAttributes(id, bui...
[FOCAL] @Override public void KeepaliveReaderWrapper.close() [CLASS] class KeepaliveReaderWrapper implements DelegatingReader<D, B>,Runnable, Closeable [METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] scheduledFuture.cancel/1 [COLLABORATORS] field scheduledFuture cancel/1 [CLASS-MEM...
/* static context [FOCAL] @Override public void KeepaliveReaderWrapper.close() [COLLABORATORS] field scheduledFuture cancel/1 [CALLS-EXTERNAL] scheduledFuture.cancel/1 */
/* static context [FOCAL] @Override public void KeepaliveReaderWrapper.close() [COLLABORATORS] field scheduledFuture cancel/1 [CALLS-EXTERNAL] scheduledFuture.cancel/1 */ class KeepaliveReaderWrapper implements DelegatingReader<D, B>,Runnable, Closeable { @Override public void close() { // Do not inter...
true
ok
{"focal": {"class": "KeepaliveReaderWrapper", "name": "close", "signature": "void close()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "KeepaliveReaderWrapper", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "DelegatingReader<D, B>...
96556656_626
class VppCommonModule extends AbstractModule { @Override protected void configure() { install(ConfigurationModule.create()); // Inject non-dependency configuration requestInjection(VppConfigAttributes.class); bind(VppStatusListener.class).toInstance(new VppStatusListener()); ...
initMocks(this); Guice.createInjector(new VppCommonModule(), BoundFieldModule.of(this)).injectMembers(this); assertThat(readerFactories, is(not(empty()))); assertEquals(15, JvppReplyConsumer.JvppReplyTimeoutHolder.getTimeout()); } }
[FOCAL] @Override protected void VppCommonModule.configure() [CLASS] class VppCommonModule extends AbstractModule [METRICS] loc=16 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] install/1 (inherited), ConfigurationModule.create/0, requestInjection/1 (inherited), bind(VppStatusListener.class).toIn...
/* static context [FOCAL] @Override protected void VppCommonModule.configure() [NEW] VppStatusListener [CALLS-EXTERNAL] install/1 (inherited), ConfigurationModule.create/0, requestInjection/1 (inherited), bind(VppStatusListener.class).toInstance/1, bind/1 (inherited), bind(JVppRegistry.class).toProvider(JVppRegistryPro...
/* static context [FOCAL] @Override protected void VppCommonModule.configure() [NEW] VppStatusListener [CALLS-EXTERNAL] install/1 (inherited), ConfigurationModule.create/0, requestInjection/1 (inherited), bind(VppStatusListener.class).toInstance/1, bind/1 (inherited), bind(JVppRegistry.class).toProvider(JVppRegistryPro...
true
ok
{"focal": {"class": "VppCommonModule", "name": "configure", "signature": "void configure()", "start_line": 3, "modifiers": "@Override protected", "params": [], "return_type": "void"}, "class_info": {"name": "VppCommonModule", "kind": "class", "modifiers": "", "superclass": "AbstractModule", "interfaces": null, "fields"...
96573099_91
class FilterParser { public List<List<IdentifierMatcher>> parse() throws ParseException { eatSeparators(); while (!atEnd()) { List<IdentifierMatcher> list = new ArrayList<>(); while (!atEnd()) { if (current() == '/') { list.add(parseRegex(...
Assert.assertEquals("/foo.bar/0", toString(new FilterParser("/foo.bar/").parse())); } }
[FOCAL] public List<List<IdentifierMatcher>> FilterParser.parse() [CLASS] class FilterParser [METRICS] loc=20 cc=5 branches=2 loops=2 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] IdentifierMatcher parseIdentifier(); IdentifierMatcher parseRegex(); boolean atEnd(); boolean atFilterTerminator(); char current(); void eat...
/* static context [FOCAL] public List<List<IdentifierMatcher>> FilterParser.parse() [PATH1] while(!atEnd())#1=T -> while(!atEnd())#2=T -> if(current() == '/')=T -> if(!atEnd() && atFilterTerminator())=T -> exit loop -> return result [PATH2] while(!atEnd())#1=T -> while(!atEnd())#2=T -> if(current() == '/')=F -> if(!atE...
/* static context [FOCAL] public List<List<IdentifierMatcher>> FilterParser.parse() [PATH1] while(!atEnd())#1=T -> while(!atEnd())#2=T -> if(current() == '/')=T -> if(!atEnd() && atFilterTerminator())=T -> exit loop -> return result [PATH2] while(!atEnd())#1=T -> while(!atEnd())#2=T -> if(current() == '/')=F -> if(!atE...
true
ok
{"focal": {"class": "FilterParser", "name": "parse", "signature": "List<List<IdentifierMatcher>> parse() throws ParseException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<List<IdentifierMatcher>>"}, "class_info": {"name": "FilterParser", "kind": "class", "modifiers": "", "superclass": n...
96577896_6
class GetPutFile extends AbstractFileAnalyzer { @Override public DataSetRefs analyze(AnalysisContext context, ProvenanceEventRecord event) { final URI uri = parseUri(event.getTransitUri()); final String clusterName = context.getClusterResolver().fromHostname(uri.getHost()); final Data...
final String processorName = "PutFile"; final String transitUri = "file:/var/data/landing/sample_z"; final ProvenanceEventRecord record = Mockito.mock(ProvenanceEventRecord.class); when(record.getComponentType()).thenReturn(processorName); when(record.getTransitUri()).thenReturn...
[FOCAL] @Override public DataSetRefs GetPutFile.analyze(AnalysisContext context, ProvenanceEventRecord event) [CLASS] class GetPutFile extends AbstractFileAnalyzer [METRICS] loc=25 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] parseUri/1 (inherited), ProvenanceEventRecord.getTransitUri/0, contex...
/* static context [FOCAL] @Override public DataSetRefs GetPutFile.analyze(AnalysisContext context, ProvenanceEventRecord event) [PATH1] if(event.getComponentType().equals("GetFile"))=T -> return refs [PATH2] if(event.getComponentType().equals("GetFile"))=F -> return refs [INPUTS] branches=event | result=event [COLLABOR...
/* static context [FOCAL] @Override public DataSetRefs GetPutFile.analyze(AnalysisContext context, ProvenanceEventRecord event) [PATH1] if(event.getComponentType().equals("GetFile"))=T -> return refs [PATH2] if(event.getComponentType().equals("GetFile"))=F -> return refs [INPUTS] branches=event | result=event [COLLABOR...
true
ok
{"focal": {"class": "GetPutFile", "name": "analyze", "signature": "DataSetRefs analyze(AnalysisContext context, ProvenanceEventRecord event)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "context", "type": "AnalysisContext"}, {"name": "event", "type": "ProvenanceEventRecord"}], "return_type": ...
96755147_0
class MailController { @RequestMapping(value = "/{targetId}", method = RequestMethod.GET) @ApiOperation(value = "按照发信人或收信人的id以及发信状态", notes = "target是指定按照收信人还是发信人查询,可选值是sender和receiver;如果是按照收信人查询,那么必须指定mail_status,可选值为ALL、NOT_VIEWED、VIEWED;如果是按照发信人查询,则不需要给出该参数", response = PageInfo.class) @ApiResponses(val...
String url = "/mails/2"; MultiValueMap<String,String> params = new LinkedMultiValueMap<>(); params.put("target", Arrays.asList("receiver")); params.put("mail_status",Arrays.asList("all")); MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.get(url).params(params).accept(Med...
[FOCAL] @RequestMapping(value = "/{targetId}", method = RequestMethod.GET) @ApiOperation(value = "按照发信人或收信人的id以及发信状态", notes ... PageInfo<MailDO> MailController.findMails(Long targetId, String target, Integer pageNum, Integer pageSize, String mailStatus) [CLASS] class MailController [METRICS] loc=22 cc=4 branches=3 loo...
/* static context [FOCAL] @RequestMapping(value = "/{targetId}", method = RequestMethod.GET) @ApiOperation(value = "按照发信人或收信人的id以及发信状态", notes ... PageInfo<MailDO> MailController.findMails(Long targetId, String target, Integer pageNum, Integer pageSize, String mailStatus) [THROWS-WHEN] MailStatusNotFoundException when ...
/* static context [FOCAL] @RequestMapping(value = "/{targetId}", method = RequestMethod.GET) @ApiOperation(value = "按照发信人或收信人的id以及发信状态", notes ... PageInfo<MailDO> MailController.findMails(Long targetId, String target, Integer pageNum, Integer pageSize, String mailStatus) [THROWS-WHEN] MailStatusNotFoundException when ...
true
ok
{"focal": {"class": "MailController", "name": "findMails", "signature": "PageInfo<MailDO> findMails(Long targetId, String target, Integer pageNum, Integer pageSize, String mailStatus)", "start_line": 3, "modifiers": "@RequestMapping(value = \"/{targetId}\", method = RequestMethod.GET) @ApiOperation(value = \"按照发信人或收信人的...
96760451_0
class UrlFactory extends RegexNamedEntityFactory { @Override protected List<NamedPattern> getRegexes(SpanCollection spanCollection, String lang) { return Collections.singletonList(new NamedPattern(URL, URL_PATTERN)); } @Override protected RegexNerProcessor.NamedEntity createNamedEntity(String ...
Pattern p = new UrlFactory().getRegexes(null, null).get(0).getPattern(); String url1 = "http://foo.com/blah_blah/"; String url2 = "Ein beispiel: https://www.example.com/foo/?bar=baz&inga=42&quux"; String wrong_url1 = "khttp://foo.bar?q=Spaces should be encoded"; String wrong_url...
[FOCAL] @Override protected List<NamedPattern> UrlFactory.getRegexes(SpanCollection spanCollection, String lang) [CLASS] class UrlFactory extends RegexNamedEntityFactory [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Collections.singletonList/1 [NEW] NamedPattern [INPUTS] branches...
/* static context [FOCAL] @Override protected List<NamedPattern> UrlFactory.getRegexes(SpanCollection spanCollection, String lang) [INPUTS] branches=- | result=- | unused=spanCollection, lang [NEW] NamedPattern [CALLS-EXTERNAL] Collections.singletonList/1 */
/* static context [FOCAL] @Override protected List<NamedPattern> UrlFactory.getRegexes(SpanCollection spanCollection, String lang) [INPUTS] branches=- | result=- | unused=spanCollection, lang [NEW] NamedPattern [CALLS-EXTERNAL] Collections.singletonList/1 */ class UrlFactory extends RegexNamedEntityFactory { @Over...
true
ok
{"focal": {"class": "UrlFactory", "name": "getRegexes", "signature": "List<NamedPattern> getRegexes(SpanCollection spanCollection, String lang)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "spanCollection", "type": "SpanCollection"}, {"name": "lang", "type": "String"}], "return_type": "Lis...
96845301_0
class ZuulRateLimitFilter extends ZuulFilter { @Override public Object run() { RequestContext context = getCurrentRequestContext(); HttpServletRequest request = context.getRequest(); Long remainingLimit = null; for (RateLimitCheck<HttpServletRequest> rl : filterConfig.getRateLimitChecks()) { Consum...
MockHttpServletRequest request = new MockHttpServletRequest("GET", "/url"); RequestContext context = new RequestContext(); context.setRequest(request); RequestContext.testSetCurrentContext(context); when(rateLimitCheck1.rateLimit(any(), Mockito.anyBoolean())).thenReturn(consum...
[FOCAL] @Override public Object ZuulRateLimitFilter.run() [CLASS] class ZuulRateLimitFilter extends ZuulFilter [METRICS] loc=27 cc=5 branches=3 loops=1 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] RequestContext getCurrentRequestContext(); long getRemainingLimit(Long remaining, ConsumptionProbe probe) [CALLS-EXTERNAL]...
/* static context [FOCAL] @Override public Object ZuulRateLimitFilter.run() [PATH1] foreach(RateLimitCheck<HttpServletRequest> rl : filterConfig.getRateLimitChecks())=T -> if(probeHolder != null && probeHolder.getConsumptionProbe() != null)=T -> if(probe.isConsumed())=T -> if(filterConfig.getStrategy().equals(RateLimit...
/* static context [FOCAL] @Override public Object ZuulRateLimitFilter.run() [PATH1] foreach(RateLimitCheck<HttpServletRequest> rl : filterConfig.getRateLimitChecks())=T -> if(probeHolder != null && probeHolder.getConsumptionProbe() != null)=T -> if(probe.isConsumed())=T -> if(filterConfig.getStrategy().equals(RateLimit...
true
ok
{"focal": {"class": "ZuulRateLimitFilter", "name": "run", "signature": "Object run()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Object"}, "class_info": {"name": "ZuulRateLimitFilter", "kind": "class", "modifiers": "", "superclass": "ZuulFilter", "interfaces": null, "fields": [{"na...
96905440_32
class TracedThreadPoolTaskScheduler extends ThreadPoolTaskScheduler { @Override public void setAwaitTerminationSeconds(int awaitTerminationSeconds) { delegate.setAwaitTerminationSeconds(awaitTerminationSeconds); } public TracedThreadPoolTaskScheduler(Tracer tracer, ThreadPoolTaskScheduler delegate); @...
scheduler.setAwaitTerminationSeconds(5); verify(delegate).setAwaitTerminationSeconds(5); } }
[FOCAL] @Override public void TracedThreadPoolTaskScheduler.setAwaitTerminationSeconds(int awaitTerminationSeconds) [CLASS] class TracedThreadPoolTaskScheduler extends ThreadPoolTaskScheduler [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] ThreadPoolTaskScheduler.setAwaitTerminatio...
/* static context [FOCAL] @Override public void TracedThreadPoolTaskScheduler.setAwaitTerminationSeconds(int awaitTerminationSeconds) [COLLABORATORS] field delegate:ThreadPoolTaskScheduler setAwaitTerminationSeconds/1 [FIELDS] read=delegate:ThreadPoolTaskScheduler [CALLS-EXTERNAL] ThreadPoolTaskScheduler.setAwaitTermin...
/* static context [FOCAL] @Override public void TracedThreadPoolTaskScheduler.setAwaitTerminationSeconds(int awaitTerminationSeconds) [COLLABORATORS] field delegate:ThreadPoolTaskScheduler setAwaitTerminationSeconds/1 [FIELDS] read=delegate:ThreadPoolTaskScheduler [CALLS-EXTERNAL] ThreadPoolTaskScheduler.setAwaitTermin...
true
ok
{"focal": {"class": "TracedThreadPoolTaskScheduler", "name": "setAwaitTerminationSeconds", "signature": "void setAwaitTerminationSeconds(int awaitTerminationSeconds)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "awaitTerminationSeconds", "type": "int"}], "return_type": "void"}, "class_info": ...
96925861_0
class UserRepository { public LiveData<User> getUser(String email) { MutableLiveData<User> liveData = new MutableLiveData<>(); userDao.loadUser(email) .compose(transformers.applySchedulersToFlowable()) .subscribe(liveData::setValue, Timber::d); userApi.getU...
User userEntity = new User("john.doe@gmail.com", "John", "Doe"); com.jonathanpetitfrere.mvvm.repository.api.model.User userModel = mapper.toModel(userEntity); when(transformers.applySchedulersToFlowable()).thenReturn(flowable -> flowable); when(userDao.loadUser(anyString())).thenReturn(...
[FOCAL] public LiveData<User> UserRepository.getUser(String email) [CLASS] class UserRepository [METRICS] loc=14 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] userDao.loadUser(email) .compose(transformers.applySchedu....subscribe/2, userDao.loadUser(email).compose/1, UserDao.loadUser/1, Transfor...
/* static context [FOCAL] public LiveData<User> UserRepository.getUser(String email) [COLLABORATORS] field userDao:UserDao loadUser/1; field transformers:Transformers applySchedulersToFlowable/0; field userApi:UserApi getUser/1 [FIELDS] read=mapper:UserMapper, transformers:Transformers, userApi:UserApi, userDao:UserDao...
/* static context [FOCAL] public LiveData<User> UserRepository.getUser(String email) [COLLABORATORS] field userDao:UserDao loadUser/1; field transformers:Transformers applySchedulersToFlowable/0; field userApi:UserApi getUser/1 [FIELDS] read=mapper:UserMapper, transformers:Transformers, userApi:UserApi, userDao:UserDao...
true
ok
{"focal": {"class": "UserRepository", "name": "getUser", "signature": "LiveData<User> getUser(String email)", "start_line": 3, "modifiers": "public", "params": [{"name": "email", "type": "String"}], "return_type": "LiveData<User>"}, "class_info": {"name": "UserRepository", "kind": "class", "modifiers": "", "superclass"...
96952895_12
class DelegatingIdlingResourceScheduler extends IdlingResourceScheduler { @Override public Worker createWorker() { final Worker delegateWorker = delegate.createWorker(); return new Worker() { private final CompositeSubscription subscriptions = new CompositeSubscription(delegateWorker); @Override...
Scheduler.Worker worker = scheduler.createWorker(); worker.unsubscribe(); worker.schedule(new CountingAction()); assertIdle(0); } }
[FOCAL] @Override public Worker DelegatingIdlingResourceScheduler.createWorker() [CLASS] class DelegatingIdlingResourceScheduler extends IdlingResourceScheduler [METRICS] loc=55 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] ScheduledWork createWork(Action0 action, long delay, long period) [CALLS...
/* static context [FOCAL] @Override public Worker DelegatingIdlingResourceScheduler.createWorker() [INPUTS] branches=- | result=delegate [COLLABORATORS] field delegate:TestScheduler createWorker/0; field subscriptions isUnsubscribed/0,add/1,unsubscribe/0 [CALLS-INTERNAL] ScheduledWork createWork(Action0 action, long de...
/* static context [FOCAL] @Override public Worker DelegatingIdlingResourceScheduler.createWorker() [INPUTS] branches=- | result=delegate [COLLABORATORS] field delegate:TestScheduler createWorker/0; field subscriptions isUnsubscribed/0,add/1,unsubscribe/0 [CALLS-INTERNAL] ScheduledWork createWork(Action0 action, long de...
true
ok
{"focal": {"class": "DelegatingIdlingResourceScheduler", "name": "createWorker", "signature": "Worker createWorker()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Worker"}, "class_info": {"name": "DelegatingIdlingResourceScheduler", "kind": "class", "modifiers": "", "superclass": "Id...
96973263_25
class Trie { public Trie findNode(final FocusString string) { if (terminator) { // Match achieved - and we're at a domain boundary. This is important, because // we don't want to return on partial domain matches. (E.g. if the trie node is bar.com, // and the search strin...
final Trie trie = Trie.createRootNode(); assertNull(trie.findNode(FocusString.create("hello"))); final Trie putNode = trie.put(FocusString.create("hello")); final Trie foundNode = trie.findNode(FocusString.create("hello")); assertNotNull(putNode); assertNotNull(foundNo...
[FOCAL] public Trie Trie.findNode(FocusString string) [CLASS] class Trie [METRICS] loc=21 cc=5 branches=4 loops=0 returns=4 throws=0 nesting=2 [CALLS-EXTERNAL] FocusString.length/0, FocusString.charAt/1, children.get/1, Trie.findNode/1, FocusString.substring/1 [PATH1] if(terminator)=T -> if(string.length() == 0 || stri...
/* static context [FOCAL] public Trie Trie.findNode(FocusString string) [PATH1] if(terminator)=T -> if(string.length() == 0 || string.charAt(0) == '.')=F -> if(next == null)=T -> return null [PATH2] if(terminator)=F -> if(string.length() == 0)=F -> if(next == null)=F -> return next.findNode(string.substring(1)) [PATH3]...
/* static context [FOCAL] public Trie Trie.findNode(FocusString string) [PATH1] if(terminator)=T -> if(string.length() == 0 || string.charAt(0) == '.')=F -> if(next == null)=T -> return null [PATH2] if(terminator)=F -> if(string.length() == 0)=F -> if(next == null)=F -> return next.findNode(string.substring(1)) [PATH3]...
true
ok
{"focal": {"class": "Trie", "name": "findNode", "signature": "Trie findNode(FocusString string)", "start_line": 3, "modifiers": "public", "params": [{"name": "string", "type": "FocusString"}], "return_type": "Trie"}, "class_info": {"name": "Trie", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null...
97025950_3
class CollectionUtils { public static <T extends Comparable<T>> T findMostPopularElement( List<T> list) { Preconditions.checkNotNull(list, "The list cannot be null"); Collections.sort(list); T previous = list.get(0); T popular = list.get(0); int count = 1; int maxCount = 1; for (int i = 1; i < lis...
Integer[] array = {1, 2, 2, 3, 4, 5, 5, 5, 6, 7, 7, 8}; List<Integer> list = new ArrayList<>(Arrays.asList(array)); assertEquals((Integer) 5, CollectionUtils.findMostPopularElement(list)); } }
[FOCAL] public static T CollectionUtils.findMostPopularElement(List<T> list) [CLASS] class CollectionUtils [METRICS] loc=26 cc=4 branches=2 loops=1 returns=1 throws=0 nesting=3 [CALLS-EXTERNAL] Preconditions.checkNotNull/2, Collections.sort/1, List<T>.get/1, List<T>.size/0 [PATH1] for(i < list.size())=T -> if(list.get(...
/* static context [FOCAL] public static T CollectionUtils.findMostPopularElement(List<T> list) [PATH1] for(i < list.size())=T -> if(list.get(i) == previous)=F -> if(count > maxCount)=T -> exit loop -> return count > maxCount ? list.get(list.size() - 1) : popular [PATH2] for(i < list.size())=F -> return count > maxCount...
/* static context [FOCAL] public static T CollectionUtils.findMostPopularElement(List<T> list) [PATH1] for(i < list.size())=T -> if(list.get(i) == previous)=F -> if(count > maxCount)=T -> exit loop -> return count > maxCount ? list.get(list.size() - 1) : popular [PATH2] for(i < list.size())=F -> return count > maxCount...
true
ok
{"focal": {"class": "CollectionUtils", "name": "findMostPopularElement", "signature": "T findMostPopularElement(List<T> list)", "start_line": 3, "modifiers": "public static", "params": [{"name": "list", "type": "List<T>"}], "return_type": "T"}, "class_info": {"name": "CollectionUtils", "kind": "class", "modifiers": "",...
97029141_10
class JwtAuthenticationEntryPoint implements AuthenticationEntryPoint { @Override public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException { response.sendError(HttpServletResponse.SC_UNAUTHORIZED, ...
final JwtAuthenticationEntryPoint jwtAuthenticationEntryPoint = new JwtAuthenticationEntryPoint(); jwtAuthenticationEntryPoint.commence(request, response, authException); verify(response, times(1)).sendError(HttpServletResponse.SC_UNAUTHORIZED, "Unauthorized"); } }
[FOCAL] @Override public void JwtAuthenticationEntryPoint.commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) [CLASS] class JwtAuthenticationEntryPoint implements AuthenticationEntryPoint [METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EX...
/* static context [FOCAL] @Override public void JwtAuthenticationEntryPoint.commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) [INPUTS] branches=- | result=- | unused=request, authException [COLLABORATORS] param response:HttpServletResponse sendError/2 [EXCEPTIONS]...
/* static context [FOCAL] @Override public void JwtAuthenticationEntryPoint.commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) [INPUTS] branches=- | result=- | unused=request, authException [COLLABORATORS] param response:HttpServletResponse sendError/2 [EXCEPTIONS]...
true
ok
{"focal": {"class": "JwtAuthenticationEntryPoint", "name": "commence", "signature": "void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "HttpServletRe...
97034221_41
class StringUtils { public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); t...
final String input = "___${____${TOKEN_1}__}___${TOKEN_2}__"; final List<String> tokens = StringUtils.allTokens(input, startDelimiter, endDelimiter); assertEquals(2, tokens.size()); assertEquals("TOKEN_1", tokens.get(0)); assertEquals("TOKEN_2", tokens.get(1)); } }
[FOCAL] public static List<String> StringUtils.allTokens(String input, String startDelimiter, String endDelimiter) [CLASS] class StringUtils [METRICS] loc=13 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] Optional<String> firstToken(String input, String startDelimiter, String endDelimiter) [CALLS...
/* static context [FOCAL] public static List<String> StringUtils.allTokens(String input, String startDelimiter, String endDelimiter) [PATH1] while(token.isPresent())=T -> exit loop -> return tokens [PATH2] while(token.isPresent())=F -> return tokens [INPUTS] branches=endDelimiter, input, startDelimiter | result=- [CALL...
/* static context [FOCAL] public static List<String> StringUtils.allTokens(String input, String startDelimiter, String endDelimiter) [PATH1] while(token.isPresent())=T -> exit loop -> return tokens [PATH2] while(token.isPresent())=F -> return tokens [INPUTS] branches=endDelimiter, input, startDelimiter | result=- [CALL...
true
ok
{"focal": {"class": "StringUtils", "name": "allTokens", "signature": "List<String> allTokens(String input, String startDelimiter, String endDelimiter)", "start_line": 3, "modifiers": "public static", "params": [{"name": "input", "type": "String"}, {"name": "startDelimiter", "type": "String"}, {"name": "endDelimiter", "...
97047427_10
class AbstractMinikubeMojo extends AbstractMojo { @VisibleForTesting List<String> buildMinikubeCommand() { List<String> execString = new ArrayList<>(); execString.add(minikube); execString.add(getCommand()); if (flags != null) { execString.addAll(flags); } execString.addAll(getMoreFla...
spyAbstractMinikubeMojo.setMinikube("path/to/minikube"); spyAbstractMinikubeMojo.setFlags(ImmutableList.of("someFlag1", "someFlag2")); Mockito.when(spyAbstractMinikubeMojo.getCommand()).thenReturn("somecommand"); Mockito.when(spyAbstractMinikubeMojo.getMoreFlags()) .thenReturn(ImmutableList.of(...
[FOCAL] @VisibleForTesting List<String> AbstractMinikubeMojo.buildMinikubeCommand() [CLASS] class AbstractMinikubeMojo extends AbstractMojo [METRICS] loc=12 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] ImmutableList<String> getMoreFlags(); String getCommand() [CALLS-EXTERNAL] List<String>.add/1...
/* static context [FOCAL] @VisibleForTesting List<String> AbstractMinikubeMojo.buildMinikubeCommand() [PATH1] if(flags != null)=T -> return execString [PATH2] if(flags != null)=F -> return execString [CALLS-INTERNAL] ImmutableList<String> getMoreFlags(); String getCommand() [NEW] ArrayList<> [CALLS-EXTERNAL] List<Strin...
/* static context [FOCAL] @VisibleForTesting List<String> AbstractMinikubeMojo.buildMinikubeCommand() [PATH1] if(flags != null)=T -> return execString [PATH2] if(flags != null)=F -> return execString [CALLS-INTERNAL] ImmutableList<String> getMoreFlags(); String getCommand() [NEW] ArrayList<> [CALLS-EXTERNAL] List<Strin...
true
ok
{"focal": {"class": "AbstractMinikubeMojo", "name": "buildMinikubeCommand", "signature": "List<String> buildMinikubeCommand()", "start_line": 3, "modifiers": "@VisibleForTesting", "params": [], "return_type": "List<String>"}, "class_info": {"name": "AbstractMinikubeMojo", "kind": "class", "modifiers": "", "superclass":...
97106222_97
class SecretIdentifier { @Override public String toString() { return name; } @JsonCreator public SecretIdentifier(@JsonProperty("name") String name); @Override public int hashCode(); @Override public boolean equals(final Object obj); } class SecretIdentifierTest { @Test pu...
SecretIdentifier secret = new SecretIdentifier("fooBar1"); assertEquals(secret.name, "fooBar1"); assertEquals(secret.toString(), "fooBar1"); } }
[FOCAL] @Override public String SecretIdentifier.toString() [CLASS] class SecretIdentifier [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] SecretIdentifier(String name); int hashCode(); boolean equals(Object obj) [TEST] SecretIdentifierTest: @Test public void testConstructWithValidN...
/* static context [FOCAL] @Override public String SecretIdentifier.toString() */
/* static context [FOCAL] @Override public String SecretIdentifier.toString() */ class SecretIdentifier { @Override public String toString() { return name; } @JsonCreator public SecretIdentifier(@JsonProperty("name") String name); @Override public int hashCode(); @Override public boo...
true
ok
{"focal": {"class": "SecretIdentifier", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "SecretIdentifier", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "memb...
97111736_1
class LambdaHandler implements RequestStreamHandler { @Override public void handleRequest(InputStream input, OutputStream output, Context context) throws IOException { I inputObject = deserializeEventJson(input, getInputType()); O handlerResult = handleRequest(inputObject, context); ser...
String jsonInputAndExpectedOutput = "{\"value\":\"testValue\"}"; InputStream exampleInputStream = new ByteArrayInputStream(jsonInputAndExpectedOutput.getBytes(StandardCharsets.UTF_8)); OutputStream exampleOutputStream = new OutputStream() { private final StringBuilder stringBuilder ...
[FOCAL] @Override public void LambdaHandler.handleRequest(InputStream input, OutputStream output, Context context) [CLASS] class LambdaHandler implements RequestStreamHandler [METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] Class<I> getInputType(); I deserializeEventJson(InputStream...
/* static context [FOCAL] @Override public void LambdaHandler.handleRequest(InputStream input, OutputStream output, Context context) [EXCEPTIONS] declares IOException [CALLS-INTERNAL] Class<I> getInputType(); I deserializeEventJson(InputStream inputStream, Class<I> clazz); O handleRequest(I input, Context context); voi...
/* static context [FOCAL] @Override public void LambdaHandler.handleRequest(InputStream input, OutputStream output, Context context) [EXCEPTIONS] declares IOException [CALLS-INTERNAL] Class<I> getInputType(); I deserializeEventJson(InputStream inputStream, Class<I> clazz); O handleRequest(I input, Context context); voi...
true
ok
{"focal": {"class": "LambdaHandler", "name": "handleRequest", "signature": "void handleRequest(InputStream input, OutputStream output, Context context) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "input", "type": "InputStream"}, {"name": "output", "type": "OutputStream"}, ...
97115482_19
class OfflineMessages extends XMPPProcessor implements XMPPPostprocessorIfc, XMPPProcessorIfc { public Queue<Packet> restorePacketForOffLineUser( XMPPResourceConnection conn, MsgRepositoryIfc repo ) throws UserNotFoundException, NotAuthorizedException { Queue<Element> elems = repo.loadM...
BareJID userJid = BareJID.bareJIDInstance("user1@example.com"); JID res1 = JID.jidInstance(userJid, "res1"); XMPPResourceConnection session1 = getSession(JID.jidInstance("c2s@example.com/" + UUID.randomUUID().toString()), res1); assertEquals(Arrays.asList(session1), session1.getActiveSessions()); Element pa...
[FOCAL] public Queue<Packet> OfflineMessages.restorePacketForOffLineUser(XMPPResourceConnection conn, MsgRepositoryIfc repo) [CLASS] class OfflineMessages extends XMPPProcessor implements XMPPPostprocessorIfc, XMPPProcessorIfc [METRICS] loc=35 cc=7 branches=2 loops=1 returns=2 throws=0 nesting=4 [CALLS-EXTERNAL] MsgRep...
/* static context [FOCAL] public Queue<Packet> OfflineMessages.restorePacketForOffLineUser(XMPPResourceConnection conn, MsgRepositoryIfc repo) [PATH1] if(elems != null)=T -> while(( elem = elems.poll() ) != null)=T -> if(p.getElemName() == Iq.ELEM_NAME)=T -> exit loop -> try-body throws -> return pacs [PATH2] if(elems ...
/* static context [FOCAL] public Queue<Packet> OfflineMessages.restorePacketForOffLineUser(XMPPResourceConnection conn, MsgRepositoryIfc repo) [PATH1] if(elems != null)=T -> while(( elem = elems.poll() ) != null)=T -> if(p.getElemName() == Iq.ELEM_NAME)=T -> exit loop -> try-body throws -> return pacs [PATH2] if(elems ...
true
ok
{"focal": {"class": "OfflineMessages", "name": "restorePacketForOffLineUser", "signature": "Queue<Packet> restorePacketForOffLineUser(XMPPResourceConnection conn, MsgRepositoryIfc repo) throws UserNotFoundException, NotAuthorizedException", "start_line": 3, "modifiers": "public", "params": [{"name": "conn", "type": "XM...
97231654_23
class DateCalcExpressionParser { public Queue<Token> parse(String text) { final Queue<Token> tokens = new ArrayDeque<>(); if (text != null) { text = text.trim(); if (!text.isEmpty()) { boolean matchFound = false; for (InfoWrapper iw : infos) ...
Queue<Token> words = parser.parse("12:37am"); Assert.assertEquals(words.size(), 1); Assert.assertTrue(words.poll() instanceof TimeToken); } }
[FOCAL] public Queue<Token> DateCalcExpressionParser.parse(String text) [CLASS] class DateCalcExpressionParser [METRICS] loc=25 cc=6 branches=4 loops=1 returns=1 throws=1 nesting=4 [CALLS-EXTERNAL] String.trim/0, String.isEmpty/0, iw.pattern.matcher/1, Matcher.find/0, matcher.group().trim/0, Matcher.group/0, Queue<Toke...
/* static context [FOCAL] public Queue<Token> DateCalcExpressionParser.parse(String text) [THROWS-WHEN] DateCalcException when text != null && !text.isEmpty() && foreach(InfoWrapper iw : infos)=T && matcher.find() && !matchFound [THROWS-WHEN] DateCalcException when text != null && !text.isEmpty() && foreach(InfoWrapper...
/* static context [FOCAL] public Queue<Token> DateCalcExpressionParser.parse(String text) [THROWS-WHEN] DateCalcException when text != null && !text.isEmpty() && foreach(InfoWrapper iw : infos)=T && matcher.find() && !matchFound [THROWS-WHEN] DateCalcException when text != null && !text.isEmpty() && foreach(InfoWrapper...
true
ok
{"focal": {"class": "DateCalcExpressionParser", "name": "parse", "signature": "Queue<Token> parse(String text)", "start_line": 3, "modifiers": "public", "params": [{"name": "text", "type": "String"}], "return_type": "Queue<Token>"}, "class_info": {"name": "DateCalcExpressionParser", "kind": "class", "modifiers": "", "s...
97286202_0
class Book { public void addAuthor(Author author) { authors.add(createAuthorRef(author)); } private AuthorRef createAuthorRef(Author author); @Autowired BookRepo bookRepo; @Autowired AuthorRepo authorRepo; } class BookTest { @Autowired BookRepo bookRepo; @Autowired AuthorRepo authorRepo; @Test public ...
Author author = new Author(); author.name = "Greg L. Turnquist"; author = authorRepo.save(author); Book book = new Book(); book.title = "Spring Boot"; book.addAuthor(author); bookRepo.save(book); bookRepo.deleteAll(); assertThat(authorRepo.count()).isEqualTo(1); } }
[FOCAL] public void Book.addAuthor(Author author) [CLASS] class Book [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] AuthorRef createAuthorRef(Author author) [CALLS-EXTERNAL] authors.add/1 [COLLABORATORS] field authors add/1 [DATAFLOW] author@param->L2 [CLASS-MEMBERS] AuthorRef cre...
/* static context [FOCAL] public void Book.addAuthor(Author author) [COLLABORATORS] field authors add/1 [CALLS-INTERNAL] AuthorRef createAuthorRef(Author author) [CALLS-EXTERNAL] authors.add/1 */
/* static context [FOCAL] public void Book.addAuthor(Author author) [COLLABORATORS] field authors add/1 [CALLS-INTERNAL] AuthorRef createAuthorRef(Author author) [CALLS-EXTERNAL] authors.add/1 */ class Book { public void addAuthor(Author author) { authors.add(createAuthorRef(author)); } private AuthorRef createA...
true
ok
{"focal": {"class": "Book", "name": "addAuthor", "signature": "void addAuthor(Author author)", "start_line": 3, "modifiers": "public", "params": [{"name": "author", "type": "Author"}], "return_type": "void"}, "class_info": {"name": "Book", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "field...
97291552_29
class BitStringBerEncoder implements BerEncoder { @Override public void encode( @NotNull WriterContext context ) throws IOException { assert context.getType().getFamily() == Family.BIT_STRING; assert context.getValue().getKind() == Kind.BYTE_ARRAY; ByteArrayValue arrayValue = context.getValue().toByteArrayVal...
Scope scope = CoreModule.getInstance().createScope(); Type type = UniversalType.BIT_STRING.ref().resolve( scope ); Value value = CoreUtils.byteArrayFromBitString( VALUE_01010000000000B ); try( AbstractBerWriter writer = mock( AbstractBerWriter.class ) ) { when( writer.getRules() ).thenReturn( BerRules.DER ...
[FOCAL] @Override public void BitStringBerEncoder.encode(WriterContext context) [CLASS] class BitStringBerEncoder implements BerEncoder [METRICS] loc=37 cc=6 branches=5 loops=0 returns=0 throws=0 nesting=3 [CALLS-INTERNAL] boolean hasEmptyBytesAtEnd(byte[] bytes); byte[] removeZerosFromEnd(byte[] bytes); int getTrailin...
/* static context [FOCAL] @Override public void BitStringBerEncoder.encode(WriterContext context) [PATH1] if(context.getRules() == BerRules.DER)=T -> if(!hasSizeConstraint && hasNamedValues)=T -> if(hasEmptyBytesAtEnd( bytes ))=T -> if(bytes.length > 0)=T -> if(length > 1)=T [PATH2] if(context.getRules() == BerRules.DE...
/* static context [FOCAL] @Override public void BitStringBerEncoder.encode(WriterContext context) [PATH1] if(context.getRules() == BerRules.DER)=T -> if(!hasSizeConstraint && hasNamedValues)=T -> if(hasEmptyBytesAtEnd( bytes ))=T -> if(bytes.length > 0)=T -> if(length > 1)=T [PATH2] if(context.getRules() == BerRules.DE...
true
ok
{"focal": {"class": "BitStringBerEncoder", "name": "encode", "signature": "void encode(WriterContext context) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "context", "type": "WriterContext"}], "return_type": "void"}, "class_info": {"name": "BitStringBerEncoder", "kind": "cl...
97306203_11
class Minting { public void mint(List<Token> tokens) throws ExecutionException, InterruptedException { for(Token token:tokens) { if(modumToken == null) { LOG.error("no modum token bean created"); } else { Future<TransactionReceipt> receipt = modumToke...
dataBtc(1).dataBtc(2); rateBtc(101, 1_050_001); rateBtc(102, 7); int current = 0; current = minting.mint(current, 100, 0, 1 * 100_000_000, 0, "w1"); Assert.assertEquals(0, current); current = minting.mint(current, 102, 0, 1 * 100_000_000, 0, "w2"); Asser...
[FOCAL] public void Minting.mint(List<Token> tokens) [CLASS] class Minting [METRICS] loc=11 cc=3 branches=1 loops=1 returns=0 throws=0 nesting=2 [CALLS-EXTERNAL] LOG.error/1, modumToken.mint/2, Token.getWalletAddress/0, Token.getAmount/0, Future<TransactionReceipt>.get/0, LOG.debug/3 [NEW] Address, Uint256 [EXCEPTIONS]...
/* static context [FOCAL] public void Minting.mint(List<Token> tokens) [PATH1] foreach(Token token : tokens)=T -> if(modumToken == null)=T -> exit loop [PATH2] foreach(Token token : tokens)=F [PATH3] foreach(Token token : tokens)=T -> if(modumToken == null)=F -> exit loop [INPUTS] branches=tokens | result=- [COLLABORAT...
/* static context [FOCAL] public void Minting.mint(List<Token> tokens) [PATH1] foreach(Token token : tokens)=T -> if(modumToken == null)=T -> exit loop [PATH2] foreach(Token token : tokens)=F [PATH3] foreach(Token token : tokens)=T -> if(modumToken == null)=F -> exit loop [INPUTS] branches=tokens | result=- [COLLABORAT...
true
ok
{"focal": {"class": "Minting", "name": "mint", "signature": "void mint(List<Token> tokens) throws ExecutionException, InterruptedException", "start_line": 3, "modifiers": "public", "params": [{"name": "tokens", "type": "List<Token>"}], "return_type": "void"}, "class_info": {"name": "Minting", "kind": "class", "modifier...
97484669_19
class BerObjectIdentifier implements Serializable, BerType { @Override public int decode(InputStream is) throws IOException { return decode(is, true); } public BerObjectIdentifier(); public BerObjectIdentifier(byte[] code); public BerObjectIdentifier(int[] value); @Override public int encode(Out...
ByteArrayInputStream berInputStream = new ByteArrayInputStream(expectedBytes); BerObjectIdentifier oi = new BerObjectIdentifier(); oi.decode(berInputStream, true); assertArrayEquals(objectIdentifierComponents, oi.value); ByteArrayInputStream berInputStream2 = new ByteArrayInputStream(expectedByt...
[FOCAL] @Override public int BerObjectIdentifier.decode(InputStream is) [CLASS] class BerObjectIdentifier implements Serializable, BerType [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] int decode(InputStream is, boolean withTag) [EXCEPTIONS] declares IOException [INPUTS] branches...
/* static context [FOCAL] @Override public int BerObjectIdentifier.decode(InputStream is) [INPUTS] branches=- | result=is [EXCEPTIONS] declares IOException [CALLS-INTERNAL] int decode(InputStream is, boolean withTag) */
/* static context [FOCAL] @Override public int BerObjectIdentifier.decode(InputStream is) [INPUTS] branches=- | result=is [EXCEPTIONS] declares IOException [CALLS-INTERNAL] int decode(InputStream is, boolean withTag) */ class BerObjectIdentifier implements Serializable, BerType { @Override public int decode(InputS...
true
ok
{"focal": {"class": "BerObjectIdentifier", "name": "decode", "signature": "int decode(InputStream is) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "is", "type": "InputStream"}], "return_type": "int"}, "class_info": {"name": "BerObjectIdentifier", "kind": "class", "modifiers...
97490945_457
class FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public GetFileMetadataResult get_file_metadata(GetFileMetadataRequest req) throws TException { return getPrimaryClient().get_file_metadat...
GetFileMetadataRequest request = new GetFileMetadataRequest(); GetFileMetadataResult expected = new GetFileMetadataResult(); when(primaryClient.get_file_metadata(request)).thenReturn(expected); GetFileMetadataResult result = handler.get_file_metadata(request); assertThat(result, is(expected)); } ...
[FOCAL] @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public GetFileMetadataResult FederatedHMSHandler.get_file_metadata(GetFileMetadataRequest req) [CLASS] class FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler [METRICS] loc=5 cc=1 branches=0 loops=0...
class FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public GetFileMetadataResult get_file_metadata(GetFileMetadataRequest req) throws TException { return getPrimaryClient().get_file_metadat...
false
ok
{"focal": {"class": "FederatedHMSHandler", "name": "get_file_metadata", "signature": "GetFileMetadataResult get_file_metadata(GetFileMetadataRequest req) throws TException", "start_line": 3, "modifiers": "@Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public", "params": [{"na...
97492141_16
class RuleMetadataLoader { public void addRulesByRuleKey(NewRepository repository, List<String> ruleKeys) { for (String ruleKey : ruleKeys) { addRuleByRuleKey(repository, ruleKey); } } public RuleMetadataLoader(String resourceFolder); public RuleMetadataLoader(String resourceFolder, String def...
ruleMetadataLoader.addRulesByRuleKey(newRepository, Arrays.asList("S110", "S100")); newRepository.done(); RulesDefinition.Repository repository = context.repository(RULE_REPOSITORY_KEY); RulesDefinition.Rule ruleS110 = repository.rule("S110"); assertThat(ruleS110).isNotNull(); assertThat(ruleS1...
[FOCAL] public void RuleMetadataLoader.addRulesByRuleKey(NewRepository repository, List<String> ruleKeys) [CLASS] class RuleMetadataLoader [METRICS] loc=5 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] NewRule addRuleByRuleKey(NewRepository repository, String ruleKey) [PATH1] foreach(String ruleK...
/* static context [FOCAL] public void RuleMetadataLoader.addRulesByRuleKey(NewRepository repository, List<String> ruleKeys) [PATH1] foreach(String ruleKey : ruleKeys)=T -> exit loop [PATH2] foreach(String ruleKey : ruleKeys)=F [INPUTS] branches=ruleKeys | result=- [CALLS-INTERNAL] NewRule addRuleByRuleKey(NewRepository...
/* static context [FOCAL] public void RuleMetadataLoader.addRulesByRuleKey(NewRepository repository, List<String> ruleKeys) [PATH1] foreach(String ruleKey : ruleKeys)=T -> exit loop [PATH2] foreach(String ruleKey : ruleKeys)=F [INPUTS] branches=ruleKeys | result=- [CALLS-INTERNAL] NewRule addRuleByRuleKey(NewRepository...
true
ok
{"focal": {"class": "RuleMetadataLoader", "name": "addRulesByRuleKey", "signature": "void addRulesByRuleKey(NewRepository repository, List<String> ruleKeys)", "start_line": 3, "modifiers": "public", "params": [{"name": "repository", "type": "NewRepository"}, {"name": "ruleKeys", "type": "List<String>"}], "return_type":...
97518356_346
class SimpleLimitExchangeRemover { public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); ...
Prel input = newScreen( newLimit(0, 10, newProject(exprs(), rowType(), newUnionExchange( newLimit(0, 10, newProject(exprs(), rowType(), newSoftScan(rowType()) ...
[FOCAL] public static Prel SimpleLimitExchangeRemover.apply(PlannerSettings settings, Prel input) [CLASS] class SimpleLimitExchangeRemover [METRICS] loc=10 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1 [CALLS-EXTERNAL] PlannerSettings.isTrivialSingularOptimized/0, PlannerSettings.isLeafLimitsEnabled/0, Prel.acce...
/* static context [FOCAL] public static Prel SimpleLimitExchangeRemover.apply(PlannerSettings settings, Prel input) [PATH1] if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled())=F -> if(input.accept(new Identifier(), false))=T -> return input.accept(new AllExchangeRemover(), null) [PATH2] if(!set...
/* static context [FOCAL] public static Prel SimpleLimitExchangeRemover.apply(PlannerSettings settings, Prel input) [PATH1] if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled())=F -> if(input.accept(new Identifier(), false))=T -> return input.accept(new AllExchangeRemover(), null) [PATH2] if(!set...
true
ok
{"focal": {"class": "SimpleLimitExchangeRemover", "name": "apply", "signature": "Prel apply(PlannerSettings settings, Prel input)", "start_line": 3, "modifiers": "public static", "params": [{"name": "settings", "type": "PlannerSettings"}, {"name": "input", "type": "Prel"}], "return_type": "Prel"}, "class_info": {"name"...
97570753_0
class ThriftyConverterFactory extends Converter.Factory { public static ThriftyConverterFactory create(ProtocolType protocolType) { return new ThriftyConverterFactory(protocolType); } private ThriftyConverterFactory(ProtocolType protocolType); @SuppressWarnings("unchecked") private static Ad...
Retrofit retrofit = new Retrofit.Builder() .baseUrl(server.url("/")) .addConverterFactory(ThriftyConverterFactory.create(ProtocolType.BINARY)) .build(); BrokenService brokenService = retrofit.create(BrokenService.class); try { brokenSe...
[FOCAL] public static ThriftyConverterFactory ThriftyConverterFactory.create(ProtocolType protocolType) [CLASS] class ThriftyConverterFactory extends Converter.Factory [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] ThriftyConverterFactory [INPUTS] branches=- | result=protocolType [DATAFLOW] ...
/* static context [FOCAL] public static ThriftyConverterFactory ThriftyConverterFactory.create(ProtocolType protocolType) [INPUTS] branches=- | result=protocolType [NEW] ThriftyConverterFactory */
/* static context [FOCAL] public static ThriftyConverterFactory ThriftyConverterFactory.create(ProtocolType protocolType) [INPUTS] branches=- | result=protocolType [NEW] ThriftyConverterFactory */ class ThriftyConverterFactory extends Converter.Factory { public static ThriftyConverterFactory create(ProtocolType pr...
true
ok
{"focal": {"class": "ThriftyConverterFactory", "name": "create", "signature": "ThriftyConverterFactory create(ProtocolType protocolType)", "start_line": 3, "modifiers": "public static", "params": [{"name": "protocolType", "type": "ProtocolType"}], "return_type": "ThriftyConverterFactory"}, "class_info": {"name": "Thrif...
97580115_12
class Pool { @Nullable public T get() { synchronized (lock) { T item = queue.poll(); if (item != null) { activeCount++; // poll decreases, this fixes LOG.v("GET - Reusing recycled item.", this); return item; } ...
pool.get(); assertEquals(1, instances); } }
[FOCAL] @Nullable public T Pool.get() [CLASS] class Pool [METRICS] loc=20 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=2 [CALLS-INTERNAL] boolean isEmpty() [CALLS-EXTERNAL] queue.poll/0, LOG.v/2, factory.create/0 [PATH1] if(item != null)=F -> if(isEmpty())=T -> return null [PATH2] if(item != null)=T -> return ite...
/* static context [FOCAL] @Nullable public T Pool.get() [PATH1] if(item != null)=F -> if(isEmpty())=T -> return null [PATH2] if(item != null)=T -> return item [PATH3] if(item != null)=F -> if(isEmpty())=F -> return factory.create() [COLLABORATORS] field queue poll/0; field factory create/0 [CALLS-INTERNAL] boolean isEm...
/* static context [FOCAL] @Nullable public T Pool.get() [PATH1] if(item != null)=F -> if(isEmpty())=T -> return null [PATH2] if(item != null)=T -> return item [PATH3] if(item != null)=F -> if(isEmpty())=F -> return factory.create() [COLLABORATORS] field queue poll/0; field factory create/0 [CALLS-INTERNAL] boolean isEm...
true
ok
{"focal": {"class": "Pool", "name": "get", "signature": "T get()", "start_line": 3, "modifiers": "@Nullable public", "params": [], "return_type": "T"}, "class_info": {"name": "Pool", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "MAX_SIZE", "type": "int", "modifiers": "pr...
97598061_24
class JUnitCoreParameters { public boolean isParallelismSelected() { return isParallelSuites() || isParallelClasses() || isParallelMethods(); } public JUnitCoreParameters( Map<String, String> properties ); private static Collection<String> lowerCase( String... elements ); private boo...
assertTrue( newTestSetClasses().isParallelismSelected() ); assertTrue( newTestSetMethods().isParallelismSelected() ); assertTrue( newTestSetBoth().isParallelismSelected() ); } }
[FOCAL] public boolean JUnitCoreParameters.isParallelismSelected() [CLASS] class JUnitCoreParameters [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] boolean isParallelClasses(); boolean isParallelMethods(); boolean isParallelSuites() [CLASS-MEMBERS] JUnitCoreParameters(Map<String, ...
/* static context [FOCAL] public boolean JUnitCoreParameters.isParallelismSelected() [CALLS-INTERNAL] boolean isParallelClasses(); boolean isParallelMethods(); boolean isParallelSuites() */
/* static context [FOCAL] public boolean JUnitCoreParameters.isParallelismSelected() [CALLS-INTERNAL] boolean isParallelClasses(); boolean isParallelMethods(); boolean isParallelSuites() */ class JUnitCoreParameters { public boolean isParallelismSelected() { return isParallelSuites() || isParallelClass...
true
ok
{"focal": {"class": "JUnitCoreParameters", "name": "isParallelismSelected", "signature": "boolean isParallelismSelected()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "JUnitCoreParameters", "kind": "class", "modifiers": "", "superclass": null, "interfaces": n...
97621321_1155
class SmartRegisterClients extends ArrayList<SmartRegisterClient> { public SmartRegisterClients applyFilter(final FilterOption villageFilter, final ServiceModeOption serviceModeOption, final FilterOption searchFilter, SortOption sortOption) { SmartRegisterClients results = new SmartRegisterClients(); ...
SmartRegisterClients originalClients = getSmartRegisterClientsWithProperDetails(); SmartRegisterClients filteredClients = originalClients.applyFilter( new AllClientsFilter(), allEligibleCoupleServiceMode, new ECSearchOption(""), new HighPri...
[FOCAL] public SmartRegisterClients SmartRegisterClients.applyFilter(FilterOption villageFilter, ServiceModeOption serviceModeOption, FilterOption searchFilter, SortOption sortOption) [CLASS] class SmartRegisterClients extends ArrayList<SmartRegisterClient> [METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 ne...
/* static context [FOCAL] public SmartRegisterClients SmartRegisterClients.applyFilter(FilterOption villageFilter, ServiceModeOption serviceModeOption, FilterOption searchFilter, SortOption sortOption) [INPUTS] branches=- | result=sortOption [COLLABORATORS] param villageFilter:FilterOption filter/1; param searchFilter:...
/* static context [FOCAL] public SmartRegisterClients SmartRegisterClients.applyFilter(FilterOption villageFilter, ServiceModeOption serviceModeOption, FilterOption searchFilter, SortOption sortOption) [INPUTS] branches=- | result=sortOption [COLLABORATORS] param villageFilter:FilterOption filter/1; param searchFilter:...
true
ok
{"focal": {"class": "SmartRegisterClients", "name": "applyFilter", "signature": "SmartRegisterClients applyFilter(FilterOption villageFilter, ServiceModeOption serviceModeOption, FilterOption searchFilter, SortOption sortOption)", "start_line": 3, "modifiers": "public", "params": [{"name": "villageFilter", "type": "Fil...
97621363_0
class ImageUtils { public static int profileImageResourceByGender(String gender) { if (StringUtils.isNotBlank(gender)) { if (gender.equalsIgnoreCase(PathConstants.GENDER.MALE)) { return R.drawable.child_boy_infant; } else if (gender.equalsIgnoreCase(PathConstants.GEN...
assertEquals(ImageUtils.profileImageResourceByGender(""), R.drawable.child_boy_infant); } }
[FOCAL] public static int ImageUtils.profileImageResourceByGender(String gender) [CLASS] class ImageUtils [METRICS] loc=12 cc=5 branches=4 loops=0 returns=4 throws=0 nesting=4 [CALLS-EXTERNAL] StringUtils.isNotBlank/1, String.equalsIgnoreCase/1, gender.toLowerCase().contains/1, String.toLowerCase/0 [PATH1] if(StringUti...
/* static context [FOCAL] public static int ImageUtils.profileImageResourceByGender(String gender) [PATH1] if(StringUtils.isNotBlank(gender))=T -> if(gender.equalsIgnoreCase(PathConstants.GENDER.MALE))=F -> if(gender.equalsIgnoreCase(PathConstants.GENDER.FEMALE))=F -> if(gender.toLowerCase().contains("trans"))=T -> ret...
/* static context [FOCAL] public static int ImageUtils.profileImageResourceByGender(String gender) [PATH1] if(StringUtils.isNotBlank(gender))=T -> if(gender.equalsIgnoreCase(PathConstants.GENDER.MALE))=F -> if(gender.equalsIgnoreCase(PathConstants.GENDER.FEMALE))=F -> if(gender.toLowerCase().contains("trans"))=T -> ret...
true
ok
{"focal": {"class": "ImageUtils", "name": "profileImageResourceByGender", "signature": "int profileImageResourceByGender(String gender)", "start_line": 3, "modifiers": "public static", "params": [{"name": "gender", "type": "String"}], "return_type": "int"}, "class_info": {"name": "ImageUtils", "kind": "class", "modifie...
97638785_4
class ScrollEventCalculator { public boolean isAtScrollEnd() { RecyclerView.LayoutManager layoutManager = recyclerViewScrollEvent.view().getLayoutManager(); if (layoutManager instanceof LinearLayoutManager) { LinearLayoutManager linearLayoutManager = (LinearLayoutManager...
// //Arrange // LinearLayoutManager mockLinearLayoutManager = Mockito.mock(LinearLayoutManager.class); RecyclerView mockRecyclerView = Mockito.mock(RecyclerView.class); RecyclerViewScrollEvent mockRecyclerViewScrollEvent = Mockito.mock(RecyclerViewScrollEvent.class); ...
[FOCAL] public boolean ScrollEventCalculator.isAtScrollEnd() [CLASS] class ScrollEventCalculator [METRICS] loc=14 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] recyclerViewScrollEvent.view().getLayoutManager/0, recyclerViewScrollEvent.view/0, LinearLayoutManager.getItemCount/0, LinearLayoutManag...
/* static context [FOCAL] public boolean ScrollEventCalculator.isAtScrollEnd() [PATH1] if(layoutManager instanceof LinearLayoutManager)=T -> return totalItemCount <= (lastVisibleItem + 2) [PATH2] if(layoutManager instanceof LinearLayoutManager)=F -> return false [COLLABORATORS] field recyclerViewScrollEvent view/0 [CAL...
/* static context [FOCAL] public boolean ScrollEventCalculator.isAtScrollEnd() [PATH1] if(layoutManager instanceof LinearLayoutManager)=T -> return totalItemCount <= (lastVisibleItem + 2) [PATH2] if(layoutManager instanceof LinearLayoutManager)=F -> return false [COLLABORATORS] field recyclerViewScrollEvent view/0 [CAL...
true
ok
{"focal": {"class": "ScrollEventCalculator", "name": "isAtScrollEnd", "signature": "boolean isAtScrollEnd()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "ScrollEventCalculator", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields...
97664518_9
class BarcodeInfo { CalendarEvent getCalendarEvent() { return mCalendarEvent; } Rect getBoundingBox(); public void setBoundingBox(Rect boundingBox); Contact getContact(); public void setContact(Contact contact); UrlBookmark getUrlBookmark(); public void setUrlBookmark(UrlBoo...
BarcodeInfo.CalendarEvent calendarEvent = new BarcodeInfo.CalendarEvent(); BarcodeInfo barcodeInfo = new BarcodeInfo(); barcodeInfo.setCalendarEvent(calendarEvent); assertEquals(barcodeInfo.getCalendarEvent(), calendarEvent); } }
[FOCAL] CalendarEvent BarcodeInfo.getCalendarEvent() [CLASS] class BarcodeInfo [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Rect getBoundingBox(); void setBoundingBox(Rect boundingBox); Contact getContact(); void setContact(Contact contact); UrlBookmark getUrlBookmark(); void set...
/* static context [FOCAL] CalendarEvent BarcodeInfo.getCalendarEvent() */
/* static context [FOCAL] CalendarEvent BarcodeInfo.getCalendarEvent() */ class BarcodeInfo { CalendarEvent getCalendarEvent() { return mCalendarEvent; } Rect getBoundingBox(); public void setBoundingBox(Rect boundingBox); Contact getContact(); public void setContact(Contact contact)...
true
ok
{"focal": {"class": "BarcodeInfo", "name": "getCalendarEvent", "signature": "CalendarEvent getCalendarEvent()", "start_line": 3, "modifiers": "", "params": [], "return_type": "CalendarEvent"}, "class_info": {"name": "BarcodeInfo", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "...
97805491_0
class MCacheDb extends AbstractActor { public String getValue(String key) { return this.map.get(key); } @Override public Receive createReceive(); ActorSystem actorSystem; } class MCacheDbTest { ActorSystem actorSystem; @Test public void testPut() {
TestActorRef<MCacheDb> actorRef = TestActorRef.create(actorSystem, Props.create(MCacheDb.class)); actorRef.tell(new SetRequest("key", "value"), ActorRef.noSender()); MCacheDb mCacheDb = actorRef.underlyingActor(); Assert.assertEquals(mCacheDb.getValue("key"), "value"); } }
[FOCAL] public String MCacheDb.getValue(String key) [CLASS] class MCacheDb extends AbstractActor [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] this.map.get/1 [FIELDS] read=map [INPUTS] branches=- | result=key [COLLABORATORS] field map get/1 [DATAFLOW] key@param->L2 [CLASS-MEMBERS...
/* static context [FOCAL] public String MCacheDb.getValue(String key) [INPUTS] branches=- | result=key [COLLABORATORS] field map get/1 [FIELDS] read=map [CALLS-EXTERNAL] this.map.get/1 */
/* static context [FOCAL] public String MCacheDb.getValue(String key) [INPUTS] branches=- | result=key [COLLABORATORS] field map get/1 [FIELDS] read=map [CALLS-EXTERNAL] this.map.get/1 */ class MCacheDb extends AbstractActor { public String getValue(String key) { return this.map.get(key); } @Overr...
true
ok
{"focal": {"class": "MCacheDb", "name": "getValue", "signature": "String getValue(String key)", "start_line": 3, "modifiers": "public", "params": [{"name": "key", "type": "String"}], "return_type": "String"}, "class_info": {"name": "MCacheDb", "kind": "class", "modifiers": "", "superclass": "AbstractActor", "interfaces...
97935002_3
class HelloWorldImpl implements HelloWorldPortType { @Override public Greeting sayHello(Person person) { String firstName = person.getFirstName(); LOGGER.info("firstName={}", firstName); String lasttName = person.getLastName(); LOGGER.info("lastName={}", lasttName); ObjectFactory factory = ne...
Person person = new Person(); person.setFirstName("Jane"); person.setLastName("Doe"); Greeting greeting = helloWorldRequesterProxy.sayHello(person); assertEquals("Hello Jane Doe!", greeting.getText()); } }
[FOCAL] @Override public Greeting HelloWorldImpl.sayHello(Person person) [CLASS] class HelloWorldImpl implements HelloWorldPortType [METRICS] loc=17 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Person.getFirstName/0, LOGGER.info/2, Person.getLastName/0, ObjectFactory.createGreeting/0, Greeting....
/* static context [FOCAL] @Override public Greeting HelloWorldImpl.sayHello(Person person) [COLLABORATORS] param person:Person getFirstName/0,getLastName/0 [NEW] ObjectFactory [CALLS-EXTERNAL] Person.getFirstName/0, LOGGER.info/2, Person.getLastName/0, ObjectFactory.createGreeting/0, Greeting.setText/1 */
/* static context [FOCAL] @Override public Greeting HelloWorldImpl.sayHello(Person person) [COLLABORATORS] param person:Person getFirstName/0,getLastName/0 [NEW] ObjectFactory [CALLS-EXTERNAL] Person.getFirstName/0, LOGGER.info/2, Person.getLastName/0, ObjectFactory.createGreeting/0, Greeting.setText/1 */ class HelloWo...
true
ok
{"focal": {"class": "HelloWorldImpl", "name": "sayHello", "signature": "Greeting sayHello(Person person)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "person", "type": "Person"}], "return_type": "Greeting"}, "class_info": {"name": "HelloWorldImpl", "kind": "class", "modifiers": "", "superclas...
98013453_9
class AtlasMapType extends AtlasType { @Override public Map<Object, Object> createDefaultValue() { Map<Object, Object> ret = new HashMap<>(); Object key = keyType.createDefaultValue(); if ( key != null) { ret.put(key, valueType.createDefaultValue()); } re...
Map<Object, Object> defValue = intIntMapType.createDefaultValue(); assertEquals(defValue.size(), 1); } }
[FOCAL] @Override public Map<Object, Object> AtlasMapType.createDefaultValue() [CLASS] class AtlasMapType extends AtlasType [METRICS] loc=12 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] keyType.createDefaultValue/0, Map<Object, Object>.put/2, valueType.createDefaultValue/0 [NEW] HashMap<> [PATH...
/* static context [FOCAL] @Override public Map<Object, Object> AtlasMapType.createDefaultValue() [PATH1] if(key != null)=T -> return ret [PATH2] if(key != null)=F -> return ret [COLLABORATORS] field keyType createDefaultValue/0; field valueType createDefaultValue/0 [NEW] HashMap<> [CALLS-EXTERNAL] keyType.createDefault...
/* static context [FOCAL] @Override public Map<Object, Object> AtlasMapType.createDefaultValue() [PATH1] if(key != null)=T -> return ret [PATH2] if(key != null)=F -> return ret [COLLABORATORS] field keyType createDefaultValue/0; field valueType createDefaultValue/0 [NEW] HashMap<> [CALLS-EXTERNAL] keyType.createDefault...
true
ok
{"focal": {"class": "AtlasMapType", "name": "createDefaultValue", "signature": "Map<Object, Object> createDefaultValue()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Map<Object, Object>"}, "class_info": {"name": "AtlasMapType", "kind": "class", "modifiers": "", "superclass": "AtlasT...
98026470_1
class Event { public static Event create() { return Event.builder().build(); } protected Event(String id, String name, Serializable data); protected Event(String id, String name); protected Event(Builder builder); protected Event(); protected static Builder builder(); public static Builder id...
Event event = Event.create(); assertThat(event).isNotNull(); } }
[FOCAL] public static Event Event.create() [CLASS] class Event [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Event.builder().build/0, Event.builder/0 [CLASS-MEMBERS] Event(String id, String name, Serializable data); Event(String id, String name); Event(Builder builder); Event(); ...
/* static context [FOCAL] public static Event Event.create() [CALLS-EXTERNAL] Event.builder().build/0, Event.builder/0 */
/* static context [FOCAL] public static Event Event.create() [CALLS-EXTERNAL] Event.builder().build/0, Event.builder/0 */ class Event { public static Event create() { return Event.builder().build(); } protected Event(String id, String name, Serializable data); protected Event(String id, String name); ...
true
ok
{"focal": {"class": "Event", "name": "create", "signature": "Event create()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Event"}, "class_info": {"name": "Event", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "eventId", "type": "String", "...
98080471_0
class DataSourceController { @RequestMapping(method = RequestMethod.PUT) @ResponseBody public GetDatasourceResponse put(@PathVariable("tenant") String tenantId, @PathVariable("datasource") String dataSourceId, @RequestParam(value = "validate", required = false) Boolean validate, ...
final String tenant = name.getMethodName(); tenantRegistry.createTenantContext(tenant); final RestDataSourceDefinition dataSourceDefinition = new RestDataSourceDefinition(); dataSourceDefinition.setType("foo bar"); dataSourceDefinition.set("hello", "world"); final GetDa...
[FOCAL] @RequestMapping(method = RequestMethod.PUT) @ResponseBody public GetDatasourceResponse DataSourceController.put(String tenantId, String dataSourceId, Boolean validate, RestDataSourceDefinition dataSourceDefinition) [CLASS] class DataSourceController [METRICS] loc=31 cc=3 branches=1 loops=0 returns=1 throws=1 ne...
/* static context [FOCAL] @RequestMapping(method = RequestMethod.PUT) @ResponseBody public GetDatasourceResponse DataSourceController.put(String tenantId, String dataSourceId, Boolean validate, RestDataSourceDefinition dataSourceDefinition) [THROWS-WHEN] InvalidDataSourceException when validate != null && validate.bool...
/* static context [FOCAL] @RequestMapping(method = RequestMethod.PUT) @ResponseBody public GetDatasourceResponse DataSourceController.put(String tenantId, String dataSourceId, Boolean validate, RestDataSourceDefinition dataSourceDefinition) [THROWS-WHEN] InvalidDataSourceException when validate != null && validate.bool...
true
ok
{"focal": {"class": "DataSourceController", "name": "put", "signature": "GetDatasourceResponse put(String tenantId, String dataSourceId, Boolean validate, RestDataSourceDefinition dataSourceDefinition)", "start_line": 3, "modifiers": "@RequestMapping(method = RequestMethod.PUT) @ResponseBody public", "params": [{"name"...
98085592_14
class OntologyTerms { public static <O extends Ontology<?, ?>> Set<TermId> parentsOf(TermId termId, O ontology) { Set<TermId> result = new HashSet<>(); visitParentsOf(termId, ontology, new TermVisitor<O>() { @Override public boolean visit(O ontology, TermId termId) { result.add(termId); ...
assertEquals( "[ImmutableTermId [prefix=ImmutableTermPrefix [value=VO], id=0000004], ImmutableTermId [prefix=ImmutableTermPrefix [value=VO], id=0000007], ImmutableTermId [prefix=ImmutableTermPrefix [value=VO], id=0000001], ImmutableTermId [prefix=ImmutableTermPrefix [value=VO], id=0000002]]", Ontolo...
[FOCAL] public static Set<TermId> OntologyTerms.parentsOf(TermId termId, O ontology) [CLASS] class OntologyTerms [METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] void visitParentsOf(TermId termId, O ontology, TermVisitor<O> termVisitor) [CALLS-EXTERNAL] Set<TermId>.add/1 [NEW] Hash...
/* static context [FOCAL] public static Set<TermId> OntologyTerms.parentsOf(TermId termId, O ontology) [CALLS-INTERNAL] void visitParentsOf(TermId termId, O ontology, TermVisitor<O> termVisitor) [NEW] HashSet<>, TermVisitor<O> [CALLS-EXTERNAL] Set<TermId>.add/1 */
/* static context [FOCAL] public static Set<TermId> OntologyTerms.parentsOf(TermId termId, O ontology) [CALLS-INTERNAL] void visitParentsOf(TermId termId, O ontology, TermVisitor<O> termVisitor) [NEW] HashSet<>, TermVisitor<O> [CALLS-EXTERNAL] Set<TermId>.add/1 */ class OntologyTerms { public static <O extends Ontol...
true
ok
{"focal": {"class": "OntologyTerms", "name": "parentsOf", "signature": "Set<TermId> parentsOf(TermId termId, O ontology)", "start_line": 3, "modifiers": "public static", "params": [{"name": "termId", "type": "TermId"}, {"name": "ontology", "type": "O"}], "return_type": "Set<TermId>"}, "class_info": {"name": "OntologyTe...
98171786_53
class AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); static Map<String...
// when Map<String, String> attributes = getMetaAttributes(getMethod(CustomizableValueUsage.class, "customizableOnly")); // then assertThat(attributes).containsOnly( entry("name", "method-level") ); } }
[FOCAL] static Map<String, String> AttributesExtractor.getMetaAttributes(Class<?> clazz) [CLASS] class AttributesExtractor [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] List<Annotation> getAnnotations(Class<?> clazz); Map<String, String> getMetaAttributes(Method method) [CALLS-EX...
/* static context [FOCAL] static Map<String, String> AttributesExtractor.getMetaAttributes(Class<?> clazz) [INPUTS] branches=- | result=clazz [COLLABORATORS] field attributesByTypeCache computeIfAbsent/2 [CALLS-INTERNAL] List<Annotation> getAnnotations(Class<?> clazz); Map<String, String> getMetaAttributes(Method metho...
/* static context [FOCAL] static Map<String, String> AttributesExtractor.getMetaAttributes(Class<?> clazz) [INPUTS] branches=- | result=clazz [COLLABORATORS] field attributesByTypeCache computeIfAbsent/2 [CALLS-INTERNAL] List<Annotation> getAnnotations(Class<?> clazz); Map<String, String> getMetaAttributes(Method metho...
true
ok
{"focal": {"class": "AttributesExtractor", "name": "getMetaAttributes", "signature": "Map<String, String> getMetaAttributes(Class<?> clazz)", "start_line": 3, "modifiers": "static", "params": [{"name": "clazz", "type": "Class<?>"}], "return_type": "Map<String, String>"}, "class_info": {"name": "AttributesExtractor", "k...
98175571_291
class ParametersHooksO { public void showTimeFields(final ViewDefinitionState view) { orderService.changeFieldState(view, REASON_NEEDED_WHEN_DELAYED_EFFECTIVE_DATE_FROM, DELAYED_EFFECTIVE_DATE_FROM_TIME); orderService.changeFieldState(view, REASON_NEEDED_WHEN_EARLIER_EFFECTIVE_DATE_FROM, EARLIER_EF...
// given // when parametersHooksO.showTimeFields(view); // then verify(orderService).changeFieldState(view, REASON_NEEDED_WHEN_DELAYED_EFFECTIVE_DATE_FROM, DELAYED_EFFECTIVE_DATE_FROM_TIME); verify(orderService).changeFieldState(view, REASON_NEEDED_WHEN_...
[FOCAL] public void ParametersHooksO.showTimeFields(ViewDefinitionState view) [CLASS] class ParametersHooksO [METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] OrderService.changeFieldState/3 [FIELDS] read=orderService:OrderService [COLLABORATORS] field orderService:OrderService chang...
/* static context [FOCAL] public void ParametersHooksO.showTimeFields(ViewDefinitionState view) [COLLABORATORS] field orderService:OrderService changeFieldState/3 [FIELDS] read=orderService:OrderService [CALLS-EXTERNAL] OrderService.changeFieldState/3 */
/* static context [FOCAL] public void ParametersHooksO.showTimeFields(ViewDefinitionState view) [COLLABORATORS] field orderService:OrderService changeFieldState/3 [FIELDS] read=orderService:OrderService [CALLS-EXTERNAL] OrderService.changeFieldState/3 */ class ParametersHooksO { public void showTimeFields(final Vi...
true
ok
{"focal": {"class": "ParametersHooksO", "name": "showTimeFields", "signature": "void showTimeFields(ViewDefinitionState view)", "start_line": 3, "modifiers": "public", "params": [{"name": "view", "type": "ViewDefinitionState"}], "return_type": "void"}, "class_info": {"name": "ParametersHooksO", "kind": "class", "modifi...
98184950_2
class Sha1Digest implements MessageDigest { public void save(String source) throws IOException { final String digest = calculate(source); final File file = new File(source + "." + HASH_NAME); if (file.exists()) { if (!file.delete()) { throw new IOException("Una...
Sha1Digest sha1Digest = new Sha1Digest(); sha1Digest.save(MESSAGE_FILE); sha1Digest.verify(MESSAGE_FILE); } }
[FOCAL] public void Sha1Digest.save(String source) [CLASS] class Sha1Digest implements MessageDigest [METRICS] loc=23 cc=4 branches=3 loops=0 returns=0 throws=2 nesting=2 [CALLS-INTERNAL] String calculate(InputStream inputStream) [CALLS-EXTERNAL] File.exists/0, File.delete/0, File.getPath/0, File.createNewFile/0, IOUti...
/* static context [FOCAL] public void Sha1Digest.save(String source) [THROWS-WHEN] IOException when file.exists() && !file.delete() [THROWS-WHEN] IOException when !file.exists() && !file.createNewFile() [PATH1] if(file.exists())=T -> if(!file.delete())=T -> throw new IOException("Unable to delete an existent file: " + ...
/* static context [FOCAL] public void Sha1Digest.save(String source) [THROWS-WHEN] IOException when file.exists() && !file.delete() [THROWS-WHEN] IOException when !file.exists() && !file.createNewFile() [PATH1] if(file.exists())=T -> if(!file.delete())=T -> throw new IOException("Unable to delete an existent file: " + ...
true
ok
{"focal": {"class": "Sha1Digest", "name": "save", "signature": "void save(String source) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "source", "type": "String"}], "return_type": "void"}, "class_info": {"name": "Sha1Digest", "kind": "class", "modifiers": "", "superclass": null, "inte...
98396630_0
class SnackbarAdapter extends RecyclerView.Adapter<SnackbarAdapter.ViewHolder> { public boolean isEmpty() { return mSnackbarViews == null || mSnackbarViews.size() == 0; } @Override public ViewHolder onCreateViewHolder(ViewGroup parent, int position); @Override public void onBindViewHolder(View...
Assert.assertTrue(mAdapter.isEmpty()); } }
[FOCAL] public boolean SnackbarAdapter.isEmpty() [CLASS] class SnackbarAdapter extends RecyclerView.Adapter<SnackbarAdapter.ViewHolder> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] mSnackbarViews.size/0 [COLLABORATORS] field mSnackbarViews size/0 [CLASS-MEMBERS] ViewHolder onCre...
/* static context [FOCAL] public boolean SnackbarAdapter.isEmpty() [COLLABORATORS] field mSnackbarViews size/0 [CALLS-EXTERNAL] mSnackbarViews.size/0 */
/* static context [FOCAL] public boolean SnackbarAdapter.isEmpty() [COLLABORATORS] field mSnackbarViews size/0 [CALLS-EXTERNAL] mSnackbarViews.size/0 */ class SnackbarAdapter extends RecyclerView.Adapter<SnackbarAdapter.ViewHolder> { public boolean isEmpty() { return mSnackbarViews == null || mSnackbarView...
true
ok
{"focal": {"class": "SnackbarAdapter", "name": "isEmpty", "signature": "boolean isEmpty()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "SnackbarAdapter", "kind": "class", "modifiers": "", "superclass": "RecyclerView.Adapter<SnackbarAdapter.ViewHolder>", "inte...
98410891_42
class ThreadPoolKiller { public static void shutdown(ExecutorService threadPool, String name) { shutdown(threadPool, name, DEFAULT_WAIT_DOWN_SECONDS); } public static void shutdown(ExecutorService threadPool, String name, long waitSeconds); } class ThreadPoolKillerTest { @Test public void testCleanSh...
final int wait = 1; ExecutorService threadPool = mock(ExecutorService.class); when(threadPool.awaitTermination(wait, TimeUnit.SECONDS)).thenReturn(true); ThreadPoolKiller.shutdown(threadPool, "TestPool", wait); verify(threadPool).shutdown(); verify(threadPool).awaitTermination(wait, TimeUnit.SEC...
[FOCAL] public static void ThreadPoolKiller.shutdown(ExecutorService threadPool, String name) [CLASS] class ThreadPoolKiller [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void shutdown(ExecutorService threadPool, String name, long waitSeconds) [DATAFLOW] name@param->L2; threadPoo...
/* static context [FOCAL] public static void ThreadPoolKiller.shutdown(ExecutorService threadPool, String name) [CALLS-INTERNAL] void shutdown(ExecutorService threadPool, String name, long waitSeconds) */
/* static context [FOCAL] public static void ThreadPoolKiller.shutdown(ExecutorService threadPool, String name) [CALLS-INTERNAL] void shutdown(ExecutorService threadPool, String name, long waitSeconds) */ class ThreadPoolKiller { public static void shutdown(ExecutorService threadPool, String name) { shutdown(thr...
true
ok
{"focal": {"class": "ThreadPoolKiller", "name": "shutdown", "signature": "void shutdown(ExecutorService threadPool, String name)", "start_line": 3, "modifiers": "public static", "params": [{"name": "threadPool", "type": "ExecutorService"}, {"name": "name", "type": "String"}], "return_type": "void"}, "class_info": {"nam...
98480042_5
class MetaClient { public MetaProto.StringListType listDatabases() { MetaProto.NoneType none = MetaProto.NoneType.newBuilder().build(); MetaProto.StringListType stringList; try { stringList = metaBlockingStub.listDatabases(none); } catch (StatusRuntimeExcepti...
MetaProto.StringListType expect = MetaProto.StringListType.newBuilder().addStr("test").addStr("regular").build(); MetaProto.StringListType stringList = client.listDatabases(); assertEquals(expect, stringList); } }
[FOCAL] public MetaProto.StringListType MetaClient.listDatabases() [CLASS] class MetaClient [METRICS] loc=15 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] MetaProto.NoneType.newBuilder().build/0, MetaProto.NoneType.newBuilder/0, metaBlockingStub.listDatabases/1, logger.warn/1, StatusRuntimeExcep...
/* static context [FOCAL] public MetaProto.StringListType MetaClient.listDatabases() [PATH1] try-body throws -> return stringList [COLLABORATORS] field metaBlockingStub listDatabases/1 [EXCEPTIONS] catches StatusRuntimeException e [CALLS-EXTERNAL] MetaProto.NoneType.newBuilder().build/0, MetaProto.NoneType.newBuilder/0...
/* static context [FOCAL] public MetaProto.StringListType MetaClient.listDatabases() [PATH1] try-body throws -> return stringList [COLLABORATORS] field metaBlockingStub listDatabases/1 [EXCEPTIONS] catches StatusRuntimeException e [CALLS-EXTERNAL] MetaProto.NoneType.newBuilder().build/0, MetaProto.NoneType.newBuilder/0...
true
ok
{"focal": {"class": "MetaClient", "name": "listDatabases", "signature": "MetaProto.StringListType listDatabases()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "MetaProto.StringListType"}, "class_info": {"name": "MetaClient", "kind": "class", "modifiers": "", "superclass": null, "interfaces": n...
98490554_6
class RetryerBuilder { public RetryerBuilder<V> retryIfExceptionOfType(Class<? extends Throwable> exceptionClass) { Preconditions.checkNotNull(exceptionClass, "exceptionClass may not be null"); rejectionPredicate = Predicates.or(rejectionPredicate, new ExceptionClassPredicate<V>(exceptionClass)); ...
Callable<Boolean> callable = noIOExceptionAfter5Attempts(); Retryer<Boolean> retryer = RetryerBuilder.<Boolean>newBuilder() .retryIfExceptionOfType(IOException.class) .build(); assertTrue(retryer.call(callable)); callable = noIllegalStateExceptionAfter5At...
[FOCAL] public RetryerBuilder<V> RetryerBuilder.retryIfExceptionOfType(Class<? extends Throwable> exceptionClass) [CLASS] class RetryerBuilder [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Preconditions.checkNotNull/2, Predicates.or/2 [NEW] ExceptionClassPredicate<V> [DATAFLOW] e...
/* static context [FOCAL] public RetryerBuilder<V> RetryerBuilder.retryIfExceptionOfType(Class<? extends Throwable> exceptionClass) [NEW] ExceptionClassPredicate<V> [CALLS-EXTERNAL] Preconditions.checkNotNull/2, Predicates.or/2 */
/* static context [FOCAL] public RetryerBuilder<V> RetryerBuilder.retryIfExceptionOfType(Class<? extends Throwable> exceptionClass) [NEW] ExceptionClassPredicate<V> [CALLS-EXTERNAL] Preconditions.checkNotNull/2, Predicates.or/2 */ class RetryerBuilder { public RetryerBuilder<V> retryIfExceptionOfType(Class<? exten...
true
ok
{"focal": {"class": "RetryerBuilder", "name": "retryIfExceptionOfType", "signature": "RetryerBuilder<V> retryIfExceptionOfType(Class<? extends Throwable> exceptionClass)", "start_line": 3, "modifiers": "public", "params": [{"name": "exceptionClass", "type": "Class<? extends Throwable>"}], "return_type": "RetryerBuilder...
98639195_9
class FixDoubles { static Object fix(Object orig) { if (orig instanceof List) { final List<?> list = MappingContext.cast(orig); final List<Object> copy = new ArrayList<>(list.size()); for (Object obj : list) { copy.add(fix(obj)); } return copy; } else if (orig instanceof...
assertEquals(Arrays.asList(8_000_000_000L), FixDoubles.fix(Arrays.asList(8_000_000_000.0))); } }
[FOCAL] static Object FixDoubles.fix(Object orig) [CLASS] class FixDoubles [METRICS] loc=28 cc=8 branches=5 loops=2 returns=6 throws=0 nesting=5 [CALLS-EXTERNAL] MappingContext.cast/1, List<?>.size/0, Map<Object, Object>.add/1, fix/1 (inherited), Map<?, ?>.size/0, Map<?, ?>.entrySet/0, Map<Object, Object>.put/2, Map.En...
/* static context [FOCAL] static Object FixDoubles.fix(Object orig) [PATH1] if(orig instanceof List)=F -> if(orig instanceof Map)=F -> if(orig instanceof Double)=T -> if(d.intValue() == d)=F -> if(d.longValue() == d)=T -> return d.longValue() [PATH2] if(orig instanceof List)=T -> foreach(Object obj : list)=T -> exit lo...
/* static context [FOCAL] static Object FixDoubles.fix(Object orig) [PATH1] if(orig instanceof List)=F -> if(orig instanceof Map)=F -> if(orig instanceof Double)=T -> if(d.intValue() == d)=F -> if(d.longValue() == d)=T -> return d.longValue() [PATH2] if(orig instanceof List)=T -> foreach(Object obj : list)=T -> exit lo...
true
ok
{"focal": {"class": "FixDoubles", "name": "fix", "signature": "Object fix(Object orig)", "start_line": 3, "modifiers": "static", "params": [{"name": "orig", "type": "Object"}], "return_type": "Object"}, "class_info": {"name": "FixDoubles", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "field...
98709134_1
class HttpDateHeaderFormatUtil { public static String nowAsHttpDateString() { return timeAsHttpDateString(ZonedDateTime.now(ZoneId.of("GMT"))); } public static String timeAsHttpDateString(ZonedDateTime gmtTime); } class HttpDateHeaderFormatUtilTest { @Test public void shouldFormatDateNow() {
Assert.assertNotNull((HttpDateHeaderFormatUtil.nowAsHttpDateString())); } }
[FOCAL] public static String HttpDateHeaderFormatUtil.nowAsHttpDateString() [CLASS] class HttpDateHeaderFormatUtil [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String timeAsHttpDateString(ZonedDateTime gmtTime) [CALLS-EXTERNAL] ZonedDateTime.now/1, ZoneId.of/1 [CLASS-MEMBERS] St...
/* static context [FOCAL] public static String HttpDateHeaderFormatUtil.nowAsHttpDateString() [CALLS-INTERNAL] String timeAsHttpDateString(ZonedDateTime gmtTime) [CALLS-EXTERNAL] ZonedDateTime.now/1, ZoneId.of/1 */
/* static context [FOCAL] public static String HttpDateHeaderFormatUtil.nowAsHttpDateString() [CALLS-INTERNAL] String timeAsHttpDateString(ZonedDateTime gmtTime) [CALLS-EXTERNAL] ZonedDateTime.now/1, ZoneId.of/1 */ class HttpDateHeaderFormatUtil { public static String nowAsHttpDateString() { return timeAsHttpDat...
true
ok
{"focal": {"class": "HttpDateHeaderFormatUtil", "name": "nowAsHttpDateString", "signature": "String nowAsHttpDateString()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "String"}, "class_info": {"name": "HttpDateHeaderFormatUtil", "kind": "class", "modifiers": "", "superclass": null, "int...
98801926_32
class BcCryptWorkFactorService { int getStrength(long previousDuration, long currentDuration, int strength) { if (isPreviousDurationCloserToGoal(previousDuration, currentDuration)) { return strength - 1; } else { return strength; } } public BcryptWorkFactor calculateStrengthDivideAndConq...
// given // when int actual = bcCryptWorkFactorService.getStrength(960, 1021, 5); // then assertThat(actual).isEqualTo(5); } }
[FOCAL] int BcCryptWorkFactorService.getStrength(long previousDuration, long currentDuration, int strength) [CLASS] class BcCryptWorkFactorService [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] boolean isPreviousDurationCloserToGoal(long previousDuration, long currentDuration) [PA...
/* static context [FOCAL] int BcCryptWorkFactorService.getStrength(long previousDuration, long currentDuration, int strength) [PATH1] if(isPreviousDurationCloserToGoal(previousDuration, currentDuration))=T -> return strength - 1 [PATH2] if(isPreviousDurationCloserToGoal(previousDuration, currentDuration))=F -> return s...
/* static context [FOCAL] int BcCryptWorkFactorService.getStrength(long previousDuration, long currentDuration, int strength) [PATH1] if(isPreviousDurationCloserToGoal(previousDuration, currentDuration))=T -> return strength - 1 [PATH2] if(isPreviousDurationCloserToGoal(previousDuration, currentDuration))=F -> return s...
true
ok
{"focal": {"class": "BcCryptWorkFactorService", "name": "getStrength", "signature": "int getStrength(long previousDuration, long currentDuration, int strength)", "start_line": 3, "modifiers": "", "params": [{"name": "previousDuration", "type": "long"}, {"name": "currentDuration", "type": "long"}, {"name": "strength", "...
98805906_15
class Logger { private boolean isEnabled(org.slf4j.Logger logger, LogLevel level) { Objects.requireNonNull(level, "LogLevel must not be null."); switch (level) { case TRACE: return logger.isTraceEnabled(); case DEBUG: return logger.isDebugEnab...
LoggingSystem.get(ClassLoader.getSystemClassLoader()) .setLogLevel(org.slf4j.Logger.ROOT_LOGGER_NAME, LogLevel.INFO); assertTrue(logger.isEnabled(LogLevel.INFO, "logger name")); } }
[FOCAL] private boolean Logger.isEnabled(org.slf4j.Logger logger, LogLevel level) [CLASS] class Logger [METRICS] loc=18 cc=7 branches=1 loops=0 returns=5 throws=1 nesting=1 [CALLS-EXTERNAL] Objects.requireNonNull/2, org.slf4j.Logger.isTraceEnabled/0, org.slf4j.Logger.isDebugEnabled/0, org.slf4j.Logger.isInfoEnabled/0, ...
/* static context [FOCAL] private boolean Logger.isEnabled(org.slf4j.Logger logger, LogLevel level) [THROWS-WHEN] IllegalArgumentException when switch(level)=default [PATH1] switch(level)=case TRACE -> return logger.isTraceEnabled() [PATH2] switch(level)=case DEBUG -> return logger.isDebugEnabled() [PATH3] switch(level...
/* static context [FOCAL] private boolean Logger.isEnabled(org.slf4j.Logger logger, LogLevel level) [THROWS-WHEN] IllegalArgumentException when switch(level)=default [PATH1] switch(level)=case TRACE -> return logger.isTraceEnabled() [PATH2] switch(level)=case DEBUG -> return logger.isDebugEnabled() [PATH3] switch(level...
true
ok
{"focal": {"class": "Logger", "name": "isEnabled", "signature": "boolean isEnabled(org.slf4j.Logger logger, LogLevel level)", "start_line": 3, "modifiers": "private", "params": [{"name": "logger", "type": "org.slf4j.Logger"}, {"name": "level", "type": "LogLevel"}], "return_type": "boolean"}, "class_info": {"name": "Log...
98876601_2
class OCPSUtils { @Deprecated public static long[] toLongArray(List<Long> ls) { long[] output = new long[ls.size()]; int i = 0; for (Long l : ls) { output[i] = l; i++; } return output; } @Deprecated public static String[] toStringArray(List<String> ls); } class OCPSUtilsTest { @Test public...
List<Long> inputArr = new ArrayList<>(); inputArr.add(12L); inputArr.add(13L); inputArr.add(14L); long[] outputArr = OCPSUtils.toLongArray(inputArr); long[] expectedOutputArr = {12L, 13L, 14L}; Assert.assertArrayEquals(outputArr, expectedOutputArr); } }
[FOCAL] @Deprecated public static long[] OCPSUtils.toLongArray(List<Long> ls) [CLASS] class OCPSUtils [METRICS] loc=13 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] List<Long>.size/0 [PATH1] foreach(Long l : ls)=T -> exit loop -> return output [PATH2] foreach(Long l : ls)=F -> return output [INP...
/* static context [FOCAL] @Deprecated public static long[] OCPSUtils.toLongArray(List<Long> ls) [PATH1] foreach(Long l : ls)=T -> exit loop -> return output [PATH2] foreach(Long l : ls)=F -> return output [INPUTS] branches=ls | result=ls [COLLABORATORS] param ls:List<Long> size/0 [CALLS-EXTERNAL] List<Long>.size/0 */
/* static context [FOCAL] @Deprecated public static long[] OCPSUtils.toLongArray(List<Long> ls) [PATH1] foreach(Long l : ls)=T -> exit loop -> return output [PATH2] foreach(Long l : ls)=F -> return output [INPUTS] branches=ls | result=ls [COLLABORATORS] param ls:List<Long> size/0 [CALLS-EXTERNAL] List<Long>.size/0 */ c...
true
ok
{"focal": {"class": "OCPSUtils", "name": "toLongArray", "signature": "long[] toLongArray(List<Long> ls)", "start_line": 3, "modifiers": "@Deprecated public static", "params": [{"name": "ls", "type": "List<Long>"}], "return_type": "long[]"}, "class_info": {"name": "OCPSUtils", "kind": "class", "modifiers": "", "supercla...
98885701_0
class CDICommandBus implements CommandBus { @Override public <R, C extends Command<R>> R execute(C command) { CommandHandler<R, C> commandHandler = (CommandHandler<R, C>) registry.get(command.getClass()); return commandHandler.handle(command); } @Inject public CDICommandBus(Registry registry); @Mo...
when(registry.get(HelloCommand.class)).thenReturn(handler); HelloCommand command = new HelloCommand("joe"); commandBus.execute(command); verify(handler).handle(command); } }
[FOCAL] @Override public R CDICommandBus.execute(C command) [CLASS] class CDICommandBus implements CommandBus [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Registry.get/1, C.getClass/0, CommandHandler<R, C>.handle/1 [FIELDS] read=registry:Registry [INPUTS] branches=- | result=com...
/* static context [FOCAL] @Override public R CDICommandBus.execute(C command) [INPUTS] branches=- | result=command, registry [COLLABORATORS] field registry:Registry get/1; param command:C getClass/0 [FIELDS] read=registry:Registry [CALLS-EXTERNAL] Registry.get/1, C.getClass/0, CommandHandler<R, C>.handle/1 */
/* static context [FOCAL] @Override public R CDICommandBus.execute(C command) [INPUTS] branches=- | result=command, registry [COLLABORATORS] field registry:Registry get/1; param command:C getClass/0 [FIELDS] read=registry:Registry [CALLS-EXTERNAL] Registry.get/1, C.getClass/0, CommandHandler<R, C>.handle/1 */ class CDI...
true
ok
{"focal": {"class": "CDICommandBus", "name": "execute", "signature": "R execute(C command)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "command", "type": "C"}], "return_type": "R"}, "class_info": {"name": "CDICommandBus", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "C...
98887914_2
class SoundViewModel extends BaseObservable { @Bindable public String getTitle() { return mSound.getName(); } public SoundViewModel(BeatBox beatBox); public Sound getSound(); public void setSound(Sound sound); public void onButtonClicked(); private BeatBox mBeatBox; priv...
assertThat(mSubject.getTitle(), is(mSound.getName())); } }
[FOCAL] @Bindable public String SoundViewModel.getTitle() [CLASS] class SoundViewModel extends BaseObservable [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Sound.getName/0 [FIELDS] read=mSound:Sound [INPUTS] branches=- | result=mSound [COLLABORATORS] field mSound:Sound getName/0 ...
/* static context [FOCAL] @Bindable public String SoundViewModel.getTitle() [INPUTS] branches=- | result=mSound [COLLABORATORS] field mSound:Sound getName/0 [FIELDS] read=mSound:Sound [CALLS-EXTERNAL] Sound.getName/0 */
/* static context [FOCAL] @Bindable public String SoundViewModel.getTitle() [INPUTS] branches=- | result=mSound [COLLABORATORS] field mSound:Sound getName/0 [FIELDS] read=mSound:Sound [CALLS-EXTERNAL] Sound.getName/0 */ class SoundViewModel extends BaseObservable { @Bindable public String getTitle() { ...
true
ok
{"focal": {"class": "SoundViewModel", "name": "getTitle", "signature": "String getTitle()", "start_line": 3, "modifiers": "@Bindable public", "params": [], "return_type": "String"}, "class_info": {"name": "SoundViewModel", "kind": "class", "modifiers": "", "superclass": "BaseObservable", "interfaces": null, "fields": [...
99030958_0
class AvroSchemaIterator implements Iterable<Schema>, Iterator<Schema> { @Override public Iterator<Schema> iterator() { return this; } public AvroSchemaIterator(Schema rootSchema); @Override public boolean hasNext(); @Override public Schema next(); private static List<Schema> getChildNodes...
Schema sample = AvroSchemaGeneratorTest.getSampleSchema(); boolean baseSeen = false, recursiveSeen = false, compositeSeen = false, arraySeen = false, mapSeen = false; for (Schema schema : new AvroSchemaIterator(sample)) { if (schema.getName().equals("SampleBaseType")) { baseSeen = ...
[FOCAL] @Override public Iterator<Schema> AvroSchemaIterator.iterator() [CLASS] class AvroSchemaIterator implements Iterable<Schema>, Iterator<Schema> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] AvroSchemaIterator(Schema rootSchema); boolean hasNext(); Schema next(); List<Schema...
/* static context [FOCAL] @Override public Iterator<Schema> AvroSchemaIterator.iterator() */
/* static context [FOCAL] @Override public Iterator<Schema> AvroSchemaIterator.iterator() */ class AvroSchemaIterator implements Iterable<Schema>, Iterator<Schema> { @Override public Iterator<Schema> iterator() { return this; } public AvroSchemaIterator(Schema rootSchema); @Override public boo...
true
ok
{"focal": {"class": "AvroSchemaIterator", "name": "iterator", "signature": "Iterator<Schema> iterator()", "start_line": 4, "modifiers": "@Override public", "params": [], "return_type": "Iterator<Schema>"}, "class_info": {"name": "AvroSchemaIterator", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "...
99161825_30
class DebugWebViewClientLogger implements LogControl { public void onTooManyRedirects(WebView view, Message cancelMsg, Message continueMsg) { if (loggingEnabled) { logger.logError(String.format(LOCALE, "%s onTooManyRedirects()", SPACE)); } } public DebugWebViewClientLogger(); ...
final Message cancelMsg = Mockito.mock(Message.class); final Message continueMsg = Mockito.mock(Message.class); logger.setLoggingEnabled(false); logger.onTooManyRedirects(webView, cancelMsg, continueMsg); verifyLogNotCalled(); logger.setLoggingEnabled(true); log...
[FOCAL] public void DebugWebViewClientLogger.onTooManyRedirects(WebView view, Message cancelMsg, Message continueMsg) [CLASS] class DebugWebViewClientLogger implements LogControl [METRICS] loc=5 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] DebugWebViewClientLogger.logError/1, String.format/3 [F...
/* static context [FOCAL] public void DebugWebViewClientLogger.onTooManyRedirects(WebView view, Message cancelMsg, Message continueMsg) [PATH1] if(loggingEnabled)=T [PATH2] if(loggingEnabled)=F [INPUTS] branches=- | result=- | unused=view, cancelMsg, continueMsg [FIELDS] read=logger:DebugWebViewClientLogger [CALLS-EXTE...
/* static context [FOCAL] public void DebugWebViewClientLogger.onTooManyRedirects(WebView view, Message cancelMsg, Message continueMsg) [PATH1] if(loggingEnabled)=T [PATH2] if(loggingEnabled)=F [INPUTS] branches=- | result=- | unused=view, cancelMsg, continueMsg [FIELDS] read=logger:DebugWebViewClientLogger [CALLS-EXTE...
true
ok
{"focal": {"class": "DebugWebViewClientLogger", "name": "onTooManyRedirects", "signature": "void onTooManyRedirects(WebView view, Message cancelMsg, Message continueMsg)", "start_line": 3, "modifiers": "public", "params": [{"name": "view", "type": "WebView"}, {"name": "cancelMsg", "type": "Message"}, {"name": "continue...
99244131_2
class InstanceRegistry extends PeerAwareInstanceRegistryImpl implements ApplicationContextAware { @Override protected boolean internalCancel(String appName, String id, boolean isReplication) { handleCancelation(appName, id, isReplication); return super.internalCancel(appName, id, isReplication); } public Ins...
// calling tested method instanceRegistry.internalCancel(APP_NAME, HOST_NAME, false); // event of proper type is registered assertEquals(1, this.testEvents.applicationEvents.size()); assertTrue(this.testEvents.applicationEvents.get(0) instanceof EurekaInstanceCanceledEvent); // event details are correct f...
[FOCAL] @Override protected boolean InstanceRegistry.internalCancel(String appName, String id, boolean isReplication) [CLASS] class InstanceRegistry extends PeerAwareInstanceRegistryImpl implements ApplicationContextAware [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] void handleC...
/* static context [FOCAL] @Override protected boolean InstanceRegistry.internalCancel(String appName, String id, boolean isReplication) [INPUTS] branches=- | result=appName, id, isReplication [CALLS-INTERNAL] void handleCancelation(String appName, String id, boolean isReplication) [CALLS-EXTERNAL] PeerAwareInstanceRegi...
/* static context [FOCAL] @Override protected boolean InstanceRegistry.internalCancel(String appName, String id, boolean isReplication) [INPUTS] branches=- | result=appName, id, isReplication [CALLS-INTERNAL] void handleCancelation(String appName, String id, boolean isReplication) [CALLS-EXTERNAL] PeerAwareInstanceRegi...
true
ok
{"focal": {"class": "InstanceRegistry", "name": "internalCancel", "signature": "boolean internalCancel(String appName, String id, boolean isReplication)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "appName", "type": "String"}, {"name": "id", "type": "String"}, {"name": "isReplication", "t...
99313507_1
class MigrateUtils { public static SortedMap<String, List<MigrateTask>> balanceExpand(List<List<NodeIndexRange>> integerListMap, List<String> oldDataNodes, List<String> newDataNodes, int slotsTotalNum) { int newNodeSize = oldDataNodes.size() + newDataNodes.size(); int newSlotPerNode = slotsTotalNum...
List<List<NodeIndexRange>> integerListMap = new ArrayList<>(); integerListMap.add(Lists.newArrayList(new NodeIndexRange(0, 0, 32))); integerListMap.add(Lists.newArrayList(new NodeIndexRange(1, 33, 65))); integerListMap.add(Lists.newArrayList(new NodeIndexRange(2, 66, 99))); int t...
[FOCAL] public static SortedMap<String, List<MigrateTask>> MigrateUtils.balanceExpand(List<List<NodeIndexRange>> integerListMap, List<String> oldDataNodes, List<String> newDataNodes, int slotsTotalNum) [CLASS] class MigrateUtils [METRICS] loc=32 cc=7 branches=4 loops=2 returns=1 throws=2 nesting=4 [CALLS-INTERNAL] List...
class MigrateUtils { public static SortedMap<String, List<MigrateTask>> balanceExpand(List<List<NodeIndexRange>> integerListMap, List<String> oldDataNodes, List<String> newDataNodes, int slotsTotalNum) { int newNodeSize = oldDataNodes.size() + newDataNodes.size(); int newSlotPerNode = slotsTotalNum...
false
ok
{"focal": {"class": "MigrateUtils", "name": "balanceExpand", "signature": "SortedMap<String, List<MigrateTask>> balanceExpand(List<List<NodeIndexRange>> integerListMap, List<String> oldDataNodes, List<String> newDataNodes, int slotsTotalNum)", "start_line": 3, "modifiers": "public static", "params": [{"name": "integerL...
99413042_0
class EmailSender { void sendEmail(String to, String from, String title, String content) { SimpleMailMessage mail = new SimpleMailMessage(); mail.setTo(to); mail.setFrom(from); mail.setSubject(title); mail.setText(content); javaMailSender.send(mail); } Ema...
// Given String to = "test@codecouple.pl"; String from = "blog@codecouple.pl"; String title = "Title"; String content = "Content"; // When emailSender.sendEmail(to, from, title, content); // Then MimeMessage[] receivedMessages = server.getReceivedM...
[FOCAL] void EmailSender.sendEmail(String to, String from, String title, String content) [CLASS] class EmailSender [METRICS] loc=8 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] SimpleMailMessage.setTo/1, SimpleMailMessage.setFrom/1, SimpleMailMessage.setSubject/1, SimpleMailMessage.setText/1, ja...
/* static context [FOCAL] void EmailSender.sendEmail(String to, String from, String title, String content) [COLLABORATORS] field javaMailSender send/1 [NEW] SimpleMailMessage [CALLS-EXTERNAL] SimpleMailMessage.setTo/1, SimpleMailMessage.setFrom/1, SimpleMailMessage.setSubject/1, SimpleMailMessage.setText/1, javaMailSen...
/* static context [FOCAL] void EmailSender.sendEmail(String to, String from, String title, String content) [COLLABORATORS] field javaMailSender send/1 [NEW] SimpleMailMessage [CALLS-EXTERNAL] SimpleMailMessage.setTo/1, SimpleMailMessage.setFrom/1, SimpleMailMessage.setSubject/1, SimpleMailMessage.setText/1, javaMailSen...
true
ok
{"focal": {"class": "EmailSender", "name": "sendEmail", "signature": "void sendEmail(String to, String from, String title, String content)", "start_line": 3, "modifiers": "", "params": [{"name": "to", "type": "String"}, {"name": "from", "type": "String"}, {"name": "title", "type": "String"}, {"name": "content", "type":...
99449332_6
class OAuthClientConfiguration { public Uri getRedirectUri() { return mRedirectUri; } @VisibleForTesting OAuthClientConfiguration( final Context context, final SharedPreferences prefs, final InputStream configurationStream); @AnyThread public static OAuthC...
assertThat(sut.getRedirectUri()).isEqualTo( Uri.parse("com.okta.appauth.android.test:/oauth2redirect")); } }
[FOCAL] public Uri OAuthClientConfiguration.getRedirectUri() [CLASS] class OAuthClientConfiguration [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] OAuthClientConfiguration(Context context, SharedPreferences prefs, InputStream configurationStream); OAuthClientConfiguration getInstan...
/* static context [FOCAL] public Uri OAuthClientConfiguration.getRedirectUri() */
/* static context [FOCAL] public Uri OAuthClientConfiguration.getRedirectUri() */ class OAuthClientConfiguration { public Uri getRedirectUri() { return mRedirectUri; } @VisibleForTesting OAuthClientConfiguration( final Context context, final SharedPreferences prefs, ...
true
ok
{"focal": {"class": "OAuthClientConfiguration", "name": "getRedirectUri", "signature": "Uri getRedirectUri()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Uri"}, "class_info": {"name": "OAuthClientConfiguration", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields...
99486588_8
class GesturePane extends Control implements GesturePaneOps { @Override public void centreOn(Point2D pointOnTarget) { // move to centre point and apply scale Point2D delta = pointOnTarget.subtract(targetPointAtViewportCentre()); translateBy(new Dimension2D(delta.getX(), delta.getY())); } public GesturePane...
final double zoom = 2d; final double dx = 300d; final double dy = 200d; pane.setScrollBarPolicy(ScrollBarPolicy.NEVER); pane.zoomTo(zoom, pane.targetPointAtViewportCentre()); final Transform last = target.captureTransform(); pane.centreOn(new Point2D(dx, dy)); final Transform now = target.captureTransfo...
[FOCAL] @Override public void GesturePane.centreOn(Point2D pointOnTarget) [CLASS] class GesturePane extends Control implements GesturePaneOps [METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] Point2D targetPointAtViewportCentre(); void translateBy(Dimension2D targetAmount) [CALLS-EXT...
/* static context [FOCAL] @Override public void GesturePane.centreOn(Point2D pointOnTarget) [COLLABORATORS] param pointOnTarget:Point2D subtract/1 [CALLS-INTERNAL] Point2D targetPointAtViewportCentre(); void translateBy(Dimension2D targetAmount) [NEW] Dimension2D [CALLS-EXTERNAL] Point2D.subtract/1, Point2D.getX/0, Poi...
/* static context [FOCAL] @Override public void GesturePane.centreOn(Point2D pointOnTarget) [COLLABORATORS] param pointOnTarget:Point2D subtract/1 [CALLS-INTERNAL] Point2D targetPointAtViewportCentre(); void translateBy(Dimension2D targetAmount) [NEW] Dimension2D [CALLS-EXTERNAL] Point2D.subtract/1, Point2D.getX/0, Poi...
true
ok
{"focal": {"class": "GesturePane", "name": "centreOn", "signature": "void centreOn(Point2D pointOnTarget)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "pointOnTarget", "type": "Point2D"}], "return_type": "void"}, "class_info": {"name": "GesturePane", "kind": "class", "modifiers": "", "supercl...
99686575_3
class BookResource { @PUT @Path("/{id : \\d+}") @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @ApiOperation(value = "Update a Book", response = Book.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "The book is updated"), @ApiResponse(code = 400, messa...
final Book book = new Book("Joshua Bloch", "Effective Java (3rd Edition)", 2018, "Tech", " 978-0-1346-8599-1"); final Response response = webTarget.path("{id}") .resolveTemplate("id", 1) .request() ...
[FOCAL] @PUT @Path("/{id : \\d+}") @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @ApiOperation(value = "Update a Bo... Response BookResource.update(Long id, Book book) [CLASS] class BookResource [METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] log.info/1, ok(bookRepositor...
/* static context [FOCAL] @PUT @Path("/{id : \\d+}") @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @ApiOperation(value = "Update a Bo... Response BookResource.update(Long id, Book book) [INPUTS] branches=- | result=book | unused=id [COLLABORATORS] field bookRepository update/1 [CALLS-EXTERNAL] log.info/1, ok(...
/* static context [FOCAL] @PUT @Path("/{id : \\d+}") @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @ApiOperation(value = "Update a Bo... Response BookResource.update(Long id, Book book) [INPUTS] branches=- | result=book | unused=id [COLLABORATORS] field bookRepository update/1 [CALLS-EXTERNAL] log.info/1, ok(...
true
ok
{"focal": {"class": "BookResource", "name": "update", "signature": "Response update(Long id, Book book)", "start_line": 3, "modifiers": "@PUT @Path(\"/{id : \\\\d+}\") @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @ApiOperation(value = \"Update a Bo...", "params": [{"name": "id", "type": "Long"}, {"name": "bo...
99695762_5
class SecKillRecoveryService { public SecKillRecoveryCheckResult<T> check(PromotionEntity promotion) { List<EventEntity> entities = this.repository.findByPromotionId(promotion.getPromotionId()); if (!entities.isEmpty()) { long count = entities.stream() .filter(event -> SecKillEventType.Coupon...
SecKillRecoveryCheckResult<String> result = recoveryService.check(runningPromotion); assertThat(result.isStarted(), is(true)); assertThat(result.isFinished(), is(false)); assertThat(result.remainingCoupons(), is(runningPromotion.getNumberOfCoupons() - 1)); assertThat(result.getClaimedCustomers(), co...
[FOCAL] public SecKillRecoveryCheckResult<T> SecKillRecoveryService.check(PromotionEntity promotion) [CLASS] class SecKillRecoveryService [METRICS] loc=19 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] SpringSecKillEventRepository.findByPromotionId/1, PromotionEntity.getPromotionId/0, List<EventE...
/* static context [FOCAL] public SecKillRecoveryCheckResult<T> SecKillRecoveryService.check(PromotionEntity promotion) [PATH1] if(!entities.isEmpty())=T -> return new SecKillRecoveryCheckResult<>(true, isFinished, promotion.getNum... [PATH2] if(!entities.isEmpty())=F -> return new SecKillRecoveryCheckResult<>(promotion...
/* static context [FOCAL] public SecKillRecoveryCheckResult<T> SecKillRecoveryService.check(PromotionEntity promotion) [PATH1] if(!entities.isEmpty())=T -> return new SecKillRecoveryCheckResult<>(true, isFinished, promotion.getNum... [PATH2] if(!entities.isEmpty())=F -> return new SecKillRecoveryCheckResult<>(promotion...
true
ok
{"focal": {"class": "SecKillRecoveryService", "name": "check", "signature": "SecKillRecoveryCheckResult<T> check(PromotionEntity promotion)", "start_line": 3, "modifiers": "public", "params": [{"name": "promotion", "type": "PromotionEntity"}], "return_type": "SecKillRecoveryCheckResult<T>"}, "class_info": {"name": "Sec...
99742967_18
class DimensionMapper { public List<Dimension> getDimensions(final Metric metric, final MetricRecorder.RecorderContext context) { //Flattening the context hierarchy here allows this dimension mapper to work with multiple cloudwatch //recorders. If a recorder wants to precompute the flattened hi...
String childId = UUID.randomUUID().toString(); MetricRecorder.RecorderContext context = new MetricRecorder.RecorderContext(ContextData.withId(ID) .add(StandardContext.SERVICE, SERVICE_NAME) .build()); MetricRecorder.Rec...
[FOCAL] public List<Dimension> DimensionMapper.getDimensions(Metric metric, MetricRecorder.RecorderContext context) [CLASS] class DimensionMapper [METRICS] loc=17 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] TypedMap flattenContextHierarchy(MetricRecorder.RecorderContext context) [CALLS-EXTERNA...
/* static context [FOCAL] public List<Dimension> DimensionMapper.getDimensions(Metric metric, MetricRecorder.RecorderContext context) [PATH1] if(dimensionKeys == null)=T -> return keys.map(key -> new Dimension().withName(key.name).withValue(String... [PATH2] if(dimensionKeys == null)=F -> return keys.map(key -> new Dim...
/* static context [FOCAL] public List<Dimension> DimensionMapper.getDimensions(Metric metric, MetricRecorder.RecorderContext context) [PATH1] if(dimensionKeys == null)=T -> return keys.map(key -> new Dimension().withName(key.name).withValue(String... [PATH2] if(dimensionKeys == null)=F -> return keys.map(key -> new Dim...
true
ok
{"focal": {"class": "DimensionMapper", "name": "getDimensions", "signature": "List<Dimension> getDimensions(Metric metric, MetricRecorder.RecorderContext context)", "start_line": 3, "modifiers": "public", "params": [{"name": "metric", "type": "Metric"}, {"name": "context", "type": "MetricRecorder.RecorderContext"}], "r...
99851447_1
class DocHighlighter { protected void highlightSingleFieldValue(String field, String s, Set<HighlightingQuery> highlightingQueries, Analyzer analyzer, AtomicBoolean anythingHighlig...
String s = "the quick brown fox as well as some other fox and quick"; SpanQuery spanQuery = new SpanOrQuery(foxQuick, foxAs); Analyzer analyzer = new WhitespaceAnalyzer(); ContentHandler handler = new ToHTMLContentHandler(); RhapsodeXHTMLHandler xhtml = new RhapsodeXHTMLHandler(...
[FOCAL] protected void DocHighlighter.highlightSingleFieldValue(String field, String s, Set<HighlightingQuery> highlightingQueries, Analyzer analyzer, AtomicBoolean anythingHighlighted, RhapsodeXHTMLHandler xhtml) [CLASS] class DocHighlighter [METRICS] loc=22 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=1 [CALLS-...
/* static context [FOCAL] protected void DocHighlighter.highlightSingleFieldValue(String field, String s, Set<HighlightingQuery> highlightingQueries, Analyzer analyzer, AtomicBoolean anythingHighlighted, RhapsodeXHTMLHandler xhtml) [PATH1] if(highlightingQueries == null || highlightingQueries.size() == 0)=F -> foreach(...
/* static context [FOCAL] protected void DocHighlighter.highlightSingleFieldValue(String field, String s, Set<HighlightingQuery> highlightingQueries, Analyzer analyzer, AtomicBoolean anythingHighlighted, RhapsodeXHTMLHandler xhtml) [PATH1] if(highlightingQueries == null || highlightingQueries.size() == 0)=F -> foreach(...
true
ok
{"focal": {"class": "DocHighlighter", "name": "highlightSingleFieldValue", "signature": "void highlightSingleFieldValue(String field, String s, Set<HighlightingQuery> highlightingQueries, Analyzer analyzer, AtomicBoolean anythingHighlighted, RhapsodeXHTMLHandler xhtml) throws IOException, SAXException", "start_line": 3...
100021742_27
class ListenerContainerFactory { public AbstractMessageListenerContainer getListenerContainer(String topic, String subscriptionName) { DefaultMessageListenerContainer listenerContainer = new DefaultMessageListenerContainer(); listenerContainer.setConnectionFactory(connectionFactory); listen...
ListenerContainerFactory factory = new ListenerContainerFactory(mockConnectionFactory); AbstractMessageListenerContainer container = factory.getListenerContainer("testTopic", "testSubscription"); assertThat(container.getConnectionFactory()).isEqualTo(mockConnectionFactory); assertThat(co...
[FOCAL] public AbstractMessageListenerContainer ListenerContainerFactory.getListenerContainer(String topic, String subscriptionName) [CLASS] class ListenerContainerFactory [METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] DefaultMessageListenerContainer.setConnectionFactory/1, Defau...
/* static context [FOCAL] public AbstractMessageListenerContainer ListenerContainerFactory.getListenerContainer(String topic, String subscriptionName) [NEW] DefaultMessageListenerContainer [CALLS-EXTERNAL] DefaultMessageListenerContainer.setConnectionFactory/1, DefaultMessageListenerContainer.setPubSubDomain/1, Default...
/* static context [FOCAL] public AbstractMessageListenerContainer ListenerContainerFactory.getListenerContainer(String topic, String subscriptionName) [NEW] DefaultMessageListenerContainer [CALLS-EXTERNAL] DefaultMessageListenerContainer.setConnectionFactory/1, DefaultMessageListenerContainer.setPubSubDomain/1, Default...
true
ok
{"focal": {"class": "ListenerContainerFactory", "name": "getListenerContainer", "signature": "AbstractMessageListenerContainer getListenerContainer(String topic, String subscriptionName)", "start_line": 3, "modifiers": "public", "params": [{"name": "topic", "type": "String"}, {"name": "subscriptionName", "type": "Strin...
100077276_0
class LookupEngine { public String fetchDOI(String input) { //From grobid // Pattern DOIPattern = Pattern.compile("(10\\.\\d{4,5}\\/[\\S]+[^;,.\\s])"); Matcher doiMatcher = DOIPattern.matcher(input); while (doiMatcher.find()) { if (doiMatcher.groupCount() == 1) { ...
String input = "{\"reference-count\":176,\"publisher\":\"IOP Publishing\",\"issue\":\"4\",\"content-domain\":{\"domain\":[],\"crossmark-restriction\":false},\"short-container-title\":[\"Russ. Chem. Rev.\"],\"published-print\":{\"date-parts\":[[1998,4,30]]},\"DOI\":\"10.1070/rc1998v067n04abeh000372\",\"type\":\"...
[FOCAL] public String LookupEngine.fetchDOI(String input) [CLASS] class LookupEngine [METRICS] loc=13 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] DOIPattern.matcher/1, Matcher.find/0, Matcher.groupCount/0, Matcher.group/1 [PATH1] while(doiMatcher.find())=T -> if(doiMatcher.groupCount() == 1)=F...
/* static context [FOCAL] public String LookupEngine.fetchDOI(String input) [PATH1] while(doiMatcher.find())=T -> if(doiMatcher.groupCount() == 1)=F -> exit loop -> return null [PATH2] while(doiMatcher.find())=T -> if(doiMatcher.groupCount() == 1)=T -> return doiMatcher.group(1) [PATH3] while(doiMatcher.find())=F -> re...
/* static context [FOCAL] public String LookupEngine.fetchDOI(String input) [PATH1] while(doiMatcher.find())=T -> if(doiMatcher.groupCount() == 1)=F -> exit loop -> return null [PATH2] while(doiMatcher.find())=T -> if(doiMatcher.groupCount() == 1)=T -> return doiMatcher.group(1) [PATH3] while(doiMatcher.find())=F -> re...
true
ok
{"focal": {"class": "LookupEngine", "name": "fetchDOI", "signature": "String fetchDOI(String input)", "start_line": 3, "modifiers": "public", "params": [{"name": "input", "type": "String"}], "return_type": "String"}, "class_info": {"name": "LookupEngine", "kind": "class", "modifiers": "", "superclass": null, "interface...
100086904_0
class SupplyLocationBulkUploadController { public List<SupplyLocation> uploadFitleredLocations(List<SupplyLocation> locations) { return this.service.saveSupplyLocationsZipContains504(locations); } @Autowired public SupplyLocationBulkUploadController(SupplyLocationRepository repository); @Auto...
List<SupplyLocation> locations = new ArrayList<>(); locations.add(generateSupplyLocations(4, 4, "504")); when(service.saveSupplyLocationsZipContains504(inputLocations)).thenReturn(locations); assertThat(controller.uploadFitleredLocations(inputLocations)).size().isEqualTo(1); ass...
[FOCAL] public List<SupplyLocation> SupplyLocationBulkUploadController.uploadFitleredLocations(List<SupplyLocation> locations) [CLASS] class SupplyLocationBulkUploadController [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] SupplyLocationService.saveSupplyLocationsZipContains504/1 ...
/* static context [FOCAL] public List<SupplyLocation> SupplyLocationBulkUploadController.uploadFitleredLocations(List<SupplyLocation> locations) [INPUTS] branches=- | result=locations, service [COLLABORATORS] field service:SupplyLocationService saveSupplyLocationsZipContains504/1 [FIELDS] read=service:SupplyLocationSer...
/* static context [FOCAL] public List<SupplyLocation> SupplyLocationBulkUploadController.uploadFitleredLocations(List<SupplyLocation> locations) [INPUTS] branches=- | result=locations, service [COLLABORATORS] field service:SupplyLocationService saveSupplyLocationsZipContains504/1 [FIELDS] read=service:SupplyLocationSer...
true
ok
{"focal": {"class": "SupplyLocationBulkUploadController", "name": "uploadFitleredLocations", "signature": "List<SupplyLocation> uploadFitleredLocations(List<SupplyLocation> locations)", "start_line": 3, "modifiers": "public", "params": [{"name": "locations", "type": "List<SupplyLocation>"}], "return_type": "List<Supply...
100135378_9
class JacksonPropertyScanner implements PropertyScanner { @Override public List<Property> getProperties(Type type) { return getJacksonProperties(type).stream() .filter(JacksonPropertyScanner::isReadable) .map(this::conver...
assertTrue(scanner.getProperties(int.class).isEmpty()); } }
[FOCAL] @Override public List<Property> JacksonPropertyScanner.getProperties(Type type) [CLASS] class JacksonPropertyScanner implements PropertyScanner [METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] List<BeanPropertyDefinition> getJacksonProperties(Type type) [CALLS-EXTERNAL] getJ...
/* static context [FOCAL] @Override public List<Property> JacksonPropertyScanner.getProperties(Type type) [INPUTS] branches=- | result=type [CALLS-INTERNAL] List<BeanPropertyDefinition> getJacksonProperties(Type type) [CALLS-EXTERNAL] getJacksonProperties(type).stream() .filter(JacksonProper....collect/1, getJacksonPro...
/* static context [FOCAL] @Override public List<Property> JacksonPropertyScanner.getProperties(Type type) [INPUTS] branches=- | result=type [CALLS-INTERNAL] List<BeanPropertyDefinition> getJacksonProperties(Type type) [CALLS-EXTERNAL] getJacksonProperties(type).stream() .filter(JacksonProper....collect/1, getJacksonPro...
true
ok
{"focal": {"class": "JacksonPropertyScanner", "name": "getProperties", "signature": "List<Property> getProperties(Type type)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "type", "type": "Type"}], "return_type": "List<Property>"}, "class_info": {"name": "JacksonPropertyScanner", "kind": "class...
100262257_3
class OptimizedBubbleSort { public <T> int sort(T[] array, Comparator<T> comparator, boolean optimized) { if (array == null) { return 0; } int counter = 0; //make sure we enter into first loop of the "while" boolean swapped = true; int lastSwap = array...
String[] array = {"d", "a", "c", "b"}; sorter.sort(array, new StringComparator(), false); assertEquals("a", array[0]); assertEquals("b", array[1]); assertEquals("c", array[2]); assertEquals("d", array[3]); } }
[FOCAL] public int OptimizedBubbleSort.sort(T[] array, Comparator<T> comparator, boolean optimized) [CLASS] class OptimizedBubbleSort [METRICS] loc=50 cc=6 branches=3 loops=2 returns=2 throws=0 nesting=3 [CALLS-EXTERNAL] Comparator<T>.compare/2 [PATH1] if(array == null)=F -> while(swapped)=T -> if(optimized)=T -> for(i...
/* static context [FOCAL] public int OptimizedBubbleSort.sort(T[] array, Comparator<T> comparator, boolean optimized) [PATH1] if(array == null)=F -> while(swapped)=T -> if(optimized)=T -> for(i < limit)=T -> if(comparator.compare(array[i], array[j]) > 0)=T -> exit loop -> exit loop -> return counter [PATH2] if(array ==...
/* static context [FOCAL] public int OptimizedBubbleSort.sort(T[] array, Comparator<T> comparator, boolean optimized) [PATH1] if(array == null)=F -> while(swapped)=T -> if(optimized)=T -> for(i < limit)=T -> if(comparator.compare(array[i], array[j]) > 0)=T -> exit loop -> exit loop -> return counter [PATH2] if(array ==...
true
ok
{"focal": {"class": "OptimizedBubbleSort", "name": "sort", "signature": "int sort(T[] array, Comparator<T> comparator, boolean optimized)", "start_line": 3, "modifiers": "public", "params": [{"name": "array", "type": "T[]"}, {"name": "comparator", "type": "Comparator<T>"}, {"name": "optimized", "type": "boolean"}], "re...
100280380_0
class AxonDBEventStore extends AbstractEventStore { @Override public TrackingEventStream openStream(TrackingToken trackingToken) { return storageEngine().openStream(trackingToken); } public AxonDBEventStore(AxonDBConfiguration configuration, Serializer serializer); public AxonDBEventStor...
UnitOfWork<Message<?>> uow = DefaultUnitOfWork.startAndGet(null); testSubject.publish(GenericEventMessage.asEventMessage("Test1"), GenericEventMessage.asEventMessage("Test2"), GenericEventMessage.asEventMessage("Test3")); uow.commit(); ...
[FOCAL] @Override public TrackingEventStream AxonDBEventStore.openStream(TrackingToken trackingToken) [CLASS] class AxonDBEventStore extends AbstractEventStore [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] AxonIQEventStorageEngine storageEngine() [CALLS-EXTERNAL] storageEngine()....
/* static context [FOCAL] @Override public TrackingEventStream AxonDBEventStore.openStream(TrackingToken trackingToken) [INPUTS] branches=- | result=trackingToken [CALLS-INTERNAL] AxonIQEventStorageEngine storageEngine() [CALLS-EXTERNAL] storageEngine().openStream/1 */
/* static context [FOCAL] @Override public TrackingEventStream AxonDBEventStore.openStream(TrackingToken trackingToken) [INPUTS] branches=- | result=trackingToken [CALLS-INTERNAL] AxonIQEventStorageEngine storageEngine() [CALLS-EXTERNAL] storageEngine().openStream/1 */ class AxonDBEventStore extends AbstractEventStore ...
true
ok
{"focal": {"class": "AxonDBEventStore", "name": "openStream", "signature": "TrackingEventStream openStream(TrackingToken trackingToken)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "trackingToken", "type": "TrackingToken"}], "return_type": "TrackingEventStream"}, "class_info": {"name": "AxonD...
100295611_13
class CollectionHelper { @SafeVarargs @Nullable public static <T> List<T> toList(@Nullable T... arguments) { if (arguments != null) { if (arguments.length == 1) { return Collections.singletonList(arguments[0]); } if (arguments.length > 1) { return Arrays.asList(arguments); } } return null...
assertThat(CollectionHelper.toList((List<String>) null)).isNull(); assertThat(CollectionHelper.toList(Arrays.asList(1))).isInstanceOf(List.class) .containsExactly(1); assertThat(CollectionHelper.toList(Arrays.asList(1, 2, 3))) .isInstanceOf(List.class).containsExactly(1, 2, 3); Set<Long> set = new Hash...
[FOCAL] @SafeVarargs @Nullable public static List<T> CollectionHelper.toList(T... arguments) [CLASS] class CollectionHelper [METRICS] loc=14 cc=4 branches=3 loops=0 returns=3 throws=0 nesting=2 [CALLS-EXTERNAL] Collections.singletonList/1, Arrays.asList/1 [PATH1] if(arguments != null)=T -> if(arguments.length == 1)=F -...
/* static context [FOCAL] @SafeVarargs @Nullable public static List<T> CollectionHelper.toList(T... arguments) [PATH1] if(arguments != null)=T -> if(arguments.length == 1)=F -> if(arguments.length > 1)=T -> return Arrays.asList(arguments) [PATH2] if(arguments != null)=F -> return null [PATH3] if(arguments != null)=T ->...
/* static context [FOCAL] @SafeVarargs @Nullable public static List<T> CollectionHelper.toList(T... arguments) [PATH1] if(arguments != null)=T -> if(arguments.length == 1)=F -> if(arguments.length > 1)=T -> return Arrays.asList(arguments) [PATH2] if(arguments != null)=F -> return null [PATH3] if(arguments != null)=T ->...
true
ok
{"focal": {"class": "CollectionHelper", "name": "toList", "signature": "List<T> toList(T... arguments)", "start_line": 3, "modifiers": "@SafeVarargs @Nullable public static", "params": [{"name": "arguments", "type": "T..."}], "return_type": "List<T>"}, "class_info": {"name": "CollectionHelper", "kind": "class", "modifi...
100361171_9
class ObservableWebSocketClient extends ObservableMessengerClient { @NonNull protected Intent getServiceIntent(String clientId) { Intent intent = super.getServiceIntent(clientId); intent.putExtra(KEY_CHANNEL_TYPE, CHANNEL_WEBSOCKET); return intent; } public ObservableWebSocket...
Intent bindIntent = observableWebSocketClient.getServiceIntent("7878"); assertThat(bindIntent).isNotNull(); assertThat(bindIntent.hasExtra(KEY_CHANNEL_TYPE)).isTrue(); assertThat(bindIntent.getStringExtra(KEY_CHANNEL_TYPE)).isEqualTo(CHANNEL_WEBSOCKET); assertThat(bindIntent.ha...
[FOCAL] @NonNull protected Intent ObservableWebSocketClient.getServiceIntent(String clientId) [CLASS] class ObservableWebSocketClient extends ObservableMessengerClient [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] ObservableMessengerClient.getServiceIntent/1, Intent.putExtra/2 [I...
/* static context [FOCAL] @NonNull protected Intent ObservableWebSocketClient.getServiceIntent(String clientId) [INPUTS] branches=- | result=clientId [CALLS-EXTERNAL] ObservableMessengerClient.getServiceIntent/1, Intent.putExtra/2 */
/* static context [FOCAL] @NonNull protected Intent ObservableWebSocketClient.getServiceIntent(String clientId) [INPUTS] branches=- | result=clientId [CALLS-EXTERNAL] ObservableMessengerClient.getServiceIntent/1, Intent.putExtra/2 */ class ObservableWebSocketClient extends ObservableMessengerClient { @NonNull ...
true
ok
{"focal": {"class": "ObservableWebSocketClient", "name": "getServiceIntent", "signature": "Intent getServiceIntent(String clientId)", "start_line": 3, "modifiers": "@NonNull protected", "params": [{"name": "clientId", "type": "String"}], "return_type": "Intent"}, "class_info": {"name": "ObservableWebSocketClient", "kin...
100388774_0
class BaseHumanName extends BaseResource { public String getDisplayName(){ List<String> names = Arrays.asList(getPrefix(), getGivenName(), getFamilyName(), getSuffix()); return names.stream().filter(Objects::nonNull).collect(Collectors.joining(" ")); } public HumanName.NameUse getNameUse()...
BaseHumanName name = new BaseHumanName(); String displayName = name.getDisplayName(); assertThat(displayName, not(nullValue())); assertThat(displayName, equalTo("")); } }
[FOCAL] public String BaseHumanName.getDisplayName() [CLASS] class BaseHumanName extends BaseResource [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String getFamilyName(); String getGivenName(); String getPrefix(); String getSuffix() [CALLS-EXTERNAL] Arrays.asList/4, names.stream...
/* static context [FOCAL] public String BaseHumanName.getDisplayName() [CALLS-INTERNAL] String getFamilyName(); String getGivenName(); String getPrefix(); String getSuffix() [CALLS-EXTERNAL] Arrays.asList/4, names.stream().filter(Objects::nonNull).collect/1, names.stream().filter/1, List<String>.stream/0, Collectors.jo...
/* static context [FOCAL] public String BaseHumanName.getDisplayName() [CALLS-INTERNAL] String getFamilyName(); String getGivenName(); String getPrefix(); String getSuffix() [CALLS-EXTERNAL] Arrays.asList/4, names.stream().filter(Objects::nonNull).collect/1, names.stream().filter/1, List<String>.stream/0, Collectors.jo...
true
ok
{"focal": {"class": "BaseHumanName", "name": "getDisplayName", "signature": "String getDisplayName()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "BaseHumanName", "kind": "class", "modifiers": "", "superclass": "BaseResource", "interfaces": null, "fields": [],...
100394036_2
class AuthRepository { @NonNull public FirebaseAuthLiveData getFirebaseAuthLiveData() { return firebaseAuthLiveData; } @Inject public AuthRepository(FirebaseAuthLiveData firebaseAuthLiveData); @InjectMocks private AuthRepository authRepository; @Mock private FirebaseAuthLiveD...
//Act FirebaseAuthLiveData expectedData = authRepository.getFirebaseAuthLiveData(); //Assert assertThat(expectedData, equalTo(firebaseAuthLiveData)); } }
[FOCAL] @NonNull public FirebaseAuthLiveData AuthRepository.getFirebaseAuthLiveData() [CLASS] class AuthRepository [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [FIELDS] read=firebaseAuthLiveData:FirebaseAuthLiveData [INPUTS] branches=- | result=firebaseAuthLiveData [DATAFLOW] this.firebaseAuthLi...
/* static context [FOCAL] @NonNull public FirebaseAuthLiveData AuthRepository.getFirebaseAuthLiveData() [INPUTS] branches=- | result=firebaseAuthLiveData [FIELDS] read=firebaseAuthLiveData:FirebaseAuthLiveData */
/* static context [FOCAL] @NonNull public FirebaseAuthLiveData AuthRepository.getFirebaseAuthLiveData() [INPUTS] branches=- | result=firebaseAuthLiveData [FIELDS] read=firebaseAuthLiveData:FirebaseAuthLiveData */ class AuthRepository { @NonNull public FirebaseAuthLiveData getFirebaseAuthLiveData() { re...
true
ok
{"focal": {"class": "AuthRepository", "name": "getFirebaseAuthLiveData", "signature": "FirebaseAuthLiveData getFirebaseAuthLiveData()", "start_line": 3, "modifiers": "@NonNull public", "params": [], "return_type": "FirebaseAuthLiveData"}, "class_info": {"name": "AuthRepository", "kind": "class", "modifiers": "", "super...
100402355_74
class SlowBrokerFinder implements MetricAnomalyFinder<BrokerEntity> { @Override public Collection<MetricAnomaly<BrokerEntity>> metricAnomalies(Map<BrokerEntity, ValuesAndExtrapolations> metricsHistoryByBroker, Map<BrokerEntity, ValuesAndExtrapolation...
SlowBrokerFinder slowBrokerFinder = createSlowBrokerFinder(); Map<BrokerEntity, ValuesAndExtrapolations> history = createHistory(populateMetricValues(NORMAL_BYTES_IN_RATE, NORMAL_BYTES_IN_RATE, NORMAL_LOG_FLUSH_TIME_MS), populateMetricValues(NORMAL_BYTES_IN_RATE * BYTE_IN_RATE_VARI...
[FOCAL] @Override public Collection<MetricAnomaly<BrokerEntity>> SlowBrokerFinder.metricAnomalies(Map<BrokerEntity, ValuesAndExtrapolations> metricsHistoryByBroker, Map<BrokerEntity, ValuesAndExtrapolations> currentMetricsByBroker) [CLASS] class SlowBrokerFinder implements MetricAnomalyFinder<BrokerEntity> [METRICS] lo...
/* static context [FOCAL] @Override public Collection<MetricAnomaly<BrokerEntity>> SlowBrokerFinder.metricAnomalies(Map<BrokerEntity, ValuesAndExtrapolations> metricsHistoryByBroker, Map<BrokerEntity, ValuesAndExtrapolations> currentMetricsByBroker) [PATH1] try-body throws -> return Collections.emptySet() [PATH2] retur...
/* static context [FOCAL] @Override public Collection<MetricAnomaly<BrokerEntity>> SlowBrokerFinder.metricAnomalies(Map<BrokerEntity, ValuesAndExtrapolations> metricsHistoryByBroker, Map<BrokerEntity, ValuesAndExtrapolations> currentMetricsByBroker) [PATH1] try-body throws -> return Collections.emptySet() [PATH2] retur...
true
ok
{"focal": {"class": "SlowBrokerFinder", "name": "metricAnomalies", "signature": "Collection<MetricAnomaly<BrokerEntity>> metricAnomalies(Map<BrokerEntity, ValuesAndExtrapolations> metricsHistoryByBroker, Map<BrokerEntity, ValuesAndExtrapolations> currentMetricsByBroker)", "start_line": 3, "modifiers": "@Override public...
100407794_0
class RichTextElementConverter { public RichTextElement convert(RichTextElement orig) { if (orig.getValue() == null) { return orig; } orig.setValue(resolveLinks(orig)); orig.setValue(resolveLinkedItems(orig)); if (richTextElementResolver != null) { or...
RichTextElementConverter converter = new RichTextElementConverter( Link::getUrlSlug, () -> "/404", content -> content, null, null); RichTextElement original = new RichTextElement(); original.setValue("<p>Each AeroPre...
[FOCAL] public RichTextElement RichTextElementConverter.convert(RichTextElement orig) [CLASS] class RichTextElementConverter [METRICS] loc=11 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] String resolveLinkedItems(RichTextElement element); String resolveLinks(RichTextElement element) [CALLS-EXTE...
/* static context [FOCAL] public RichTextElement RichTextElementConverter.convert(RichTextElement orig) [PATH1] if(orig.getValue() == null)=F -> if(richTextElementResolver != null)=T -> return orig [PATH2] if(orig.getValue() == null)=T -> return orig [PATH3] if(orig.getValue() == null)=F -> if(richTextElementResolver !...
/* static context [FOCAL] public RichTextElement RichTextElementConverter.convert(RichTextElement orig) [PATH1] if(orig.getValue() == null)=F -> if(richTextElementResolver != null)=T -> return orig [PATH2] if(orig.getValue() == null)=T -> return orig [PATH3] if(orig.getValue() == null)=F -> if(richTextElementResolver !...
true
ok
{"focal": {"class": "RichTextElementConverter", "name": "convert", "signature": "RichTextElement convert(RichTextElement orig)", "start_line": 3, "modifiers": "public", "params": [{"name": "orig", "type": "RichTextElement"}], "return_type": "RichTextElement"}, "class_info": {"name": "RichTextElementConverter", "kind": ...
100417935_19
class WatchDog extends DukesVerticle { public WatchDog(Car car) throws Exception { super(Characters.FLASH); this.car = car; Environment env = Config.getEnvironment(); HEARTBEAT_INTERVAL_MS=env.getInteger(Config.WATCHDOG_HEARTBEAT_INTERVAL_MS); MAX_MISSED_BEATS=env.getInteger(Config.WATCHDOG_MAX_MISSED_BEAT...
ClusterStarter clusterStarter=new ClusterStarter(); // sideffect is to use dummy configuration // which also effects watchdog Car car=TestCar.getCar(); Environment env = Config.getEnvironment(); int heartBeatInterval=env.getInteger(Config.WATCHDOG_HEARTBEAT_INTERVAL_MS); assertEquals(20,heartBeatInterval)...
[FOCAL] public WatchDog.WatchDog(Car car) [CLASS] class WatchDog extends DukesVerticle [METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] Config.getEnvironment/0, Environment.getInteger/1 [FIELDS] write=car [EXCEPTIONS] declares Exception [STATE] car [DATAFLOW] car@param->L3; env@L4->...
/* static context [FOCAL] public WatchDog.WatchDog(Car car) [STATE] car [EXCEPTIONS] declares Exception [FIELDS] write=car [CALLS-EXTERNAL] Config.getEnvironment/0, Environment.getInteger/1 */
/* static context [FOCAL] public WatchDog.WatchDog(Car car) [STATE] car [EXCEPTIONS] declares Exception [FIELDS] write=car [CALLS-EXTERNAL] Config.getEnvironment/0, Environment.getInteger/1 */ class WatchDog extends DukesVerticle { public WatchDog(Car car) throws Exception { super(Characters.FLASH); this.car = c...
true
ok
{"focal": {"class": "WatchDog", "name": "WatchDog", "signature": "WatchDog(Car car) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "car", "type": "Car"}], "return_type": null}, "class_info": {"name": "WatchDog", "kind": "class", "modifiers": "", "superclass": "DukesVerticle", "interfaces...
100418846_46
class SplitJoinPermission extends Permission { @Override public void deserialize(Binder data, BiDeserializer deserializer) { super.deserialize(data, deserializer); initFromParams(); } public SplitJoinPermission(Role role, Binder params); private SplitJoinPermission(); protec...
Contract c = createCoin(); c.addSignerKeyFromFile(PRIVATE_KEY_PATH); sealCheckTrace(c, true); Contract c2 = c.split(1)[0]; sealCheckTrace(c2, true); Binder sd2 = DefaultBiMapper.serialize(c2); Binder state = (Binder) sd2.get("state"); assertNotNull(st...
[FOCAL] @Override public void SplitJoinPermission.deserialize(Binder data, BiDeserializer deserializer) [CLASS] class SplitJoinPermission extends Permission [METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void initFromParams() [CALLS-EXTERNAL] Permission.deserialize/2 [DATAFLOW] da...
/* static context [FOCAL] @Override public void SplitJoinPermission.deserialize(Binder data, BiDeserializer deserializer) [CALLS-INTERNAL] void initFromParams() [CALLS-EXTERNAL] Permission.deserialize/2 */
/* static context [FOCAL] @Override public void SplitJoinPermission.deserialize(Binder data, BiDeserializer deserializer) [CALLS-INTERNAL] void initFromParams() [CALLS-EXTERNAL] Permission.deserialize/2 */ class SplitJoinPermission extends Permission { @Override public void deserialize(Binder data, BiDeseriali...
true
ok
{"focal": {"class": "SplitJoinPermission", "name": "deserialize", "signature": "void deserialize(Binder data, BiDeserializer deserializer)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "data", "type": "Binder"}, {"name": "deserializer", "type": "BiDeserializer"}], "return_type": "void"}, "clas...
100470026_0
class StandaloneBean { public String returnMessage() { return message; } private EJBContainer ec; private Context ctx; private static final Logger logger; } class StandaloneBeanTest { private EJBContainer ec; private Context ctx; private static final Logger logger; @Tes...
logger.info("Testing standalone.ejb.StandaloneBean.returnMessage()"); StandaloneBean instance = (StandaloneBean) ctx.lookup("java:global/classes/StandaloneBean"); String expResult = "Greetings!"; String result = instance.returnMessage(); assertEquals(expResult, r...
[FOCAL] public String StandaloneBean.returnMessage() [CLASS] class StandaloneBean [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [TEST] StandaloneBeanTest: @Test public void testReturnMessage() throws Exception [TEST-FIELDS] EJBContainer ec, Context ctx, Logger logger
/* static context [FOCAL] public String StandaloneBean.returnMessage() */
/* static context [FOCAL] public String StandaloneBean.returnMessage() */ class StandaloneBean { public String returnMessage() { return message; } private EJBContainer ec; private Context ctx; private static final Logger logger; } class StandaloneBeanTest { private EJBContainer ec; ...
true
ok
{"focal": {"class": "StandaloneBean", "name": "returnMessage", "signature": "String returnMessage()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "StandaloneBean", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "ec...
100470837_4
class MetalSearcher extends Searcher { @Override public Result search(Query query, Execution execution) { QueryTree tree = query.getModel().getQueryTree(); if (isMetalQuery(tree)) { OrItem orItem = new OrItem(); orItem.addItem(tree.getRoot()); orItem.addItem(...
DocumentSourceSearcher docSource = new DocumentSourceSearcher(); Query testQuery = new Query(); testQuery.setTraceLevel(6); testQuery.getModel().getQueryTree().setRoot(new WordItem("drum","album")); Result mockResult = new Result(testQuery); mockResult.hits().add(new Hi...
[FOCAL] @Override public Result MetalSearcher.search(Query query, Execution execution) [CLASS] class MetalSearcher extends Searcher [METRICS] loc=13 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] boolean isMetalQuery(QueryTree tree) [CALLS-EXTERNAL] query.getModel().getQueryTree/0, Query.getModel...
/* static context [FOCAL] @Override public Result MetalSearcher.search(Query query, Execution execution) [PATH1] if(isMetalQuery(tree))=T -> return execution.search(query) [PATH2] if(isMetalQuery(tree))=F -> return execution.search(query) [INPUTS] branches=query | result=execution, query [COLLABORATORS] param query:Que...
/* static context [FOCAL] @Override public Result MetalSearcher.search(Query query, Execution execution) [PATH1] if(isMetalQuery(tree))=T -> return execution.search(query) [PATH2] if(isMetalQuery(tree))=F -> return execution.search(query) [INPUTS] branches=query | result=execution, query [COLLABORATORS] param query:Que...
true
ok
{"focal": {"class": "MetalSearcher", "name": "search", "signature": "Result search(Query query, Execution execution)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "query", "type": "Query"}, {"name": "execution", "type": "Execution"}], "return_type": "Result"}, "class_info": {"name": "MetalSear...
100522769_15
class Label { @SuppressWarnings("PMD.ShortMethodName") public static String of(Element element) { return of(element.getClass()); } private Label(); @SuppressWarnings("PMD.ShortMethodName") public static String of(Class<? extends Element> elementType); } class LabelTest { @Test public void test...
assertEquals("develops", of(Develops.class)); assertEquals("develops", of(develops)); } }
[FOCAL] @SuppressWarnings("PMD.ShortMethodName") public static String Label.of(Element element) [CLASS] class Label [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String of(Class<? extends Element> elementType) [CALLS-EXTERNAL] Element.getClass/0 [INPUTS] branches=- | result=eleme...
/* static context [FOCAL] @SuppressWarnings("PMD.ShortMethodName") public static String Label.of(Element element) [INPUTS] branches=- | result=element [COLLABORATORS] param element:Element getClass/0 [CALLS-INTERNAL] String of(Class<? extends Element> elementType) [CALLS-EXTERNAL] Element.getClass/0 */
/* static context [FOCAL] @SuppressWarnings("PMD.ShortMethodName") public static String Label.of(Element element) [INPUTS] branches=- | result=element [COLLABORATORS] param element:Element getClass/0 [CALLS-INTERNAL] String of(Class<? extends Element> elementType) [CALLS-EXTERNAL] Element.getClass/0 */ class Label { ...
true
ok
{"focal": {"class": "Label", "name": "of", "signature": "String of(Element element)", "start_line": 3, "modifiers": "@SuppressWarnings(\"PMD.ShortMethodName\") public static", "params": [{"name": "element", "type": "Element"}], "return_type": "String"}, "class_info": {"name": "Label", "kind": "class", "modifiers": "", ...
100544309_2
class CounterViewModel extends BaseObservable { public void decrement() { setCount(getCount() - 1); } public void increment(); @Bindable public int getCount(); private void setCount(int count); private CounterViewModel counterViewModel; } class CounterViewModelTest { private Co...
for (int i = 1; i <= 5; i++) { counterViewModel.decrement(); Assert.assertEquals(i * -1, counterViewModel.getCount()); } } }
[FOCAL] public void CounterViewModel.decrement() [CLASS] class CounterViewModel extends BaseObservable [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] int getCount(); void setCount(int count) [CLASS-MEMBERS] void increment(); int getCount(); void setCount(int count) [TEST] CounterV...
/* static context [FOCAL] public void CounterViewModel.decrement() [CALLS-INTERNAL] int getCount(); void setCount(int count) */
/* static context [FOCAL] public void CounterViewModel.decrement() [CALLS-INTERNAL] int getCount(); void setCount(int count) */ class CounterViewModel extends BaseObservable { public void decrement() { setCount(getCount() - 1); } public void increment(); @Bindable public int getCount(); pr...
true
ok
{"focal": {"class": "CounterViewModel", "name": "decrement", "signature": "void decrement()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "CounterViewModel", "kind": "class", "modifiers": "", "superclass": "BaseObservable", "interfaces": null, "fields": [{"name":...
100566396_36
class RegexUtil { public String getMacthResult(String regex, String source, int index) { return getMacthResult(regex,source,index,null); } private RegexUtil(); public static RegexUtil getInstance(); public List<String> getMacthAllResult(String regex, String source, int index); public...
String exected = "uuid_tt_dd=1449951587432284316_20171009; bdshare_firstime=1507526697430; _JQCMT_ifcookie=1; _JQCMT_browser=9b9bfcf50ae6c14645788efed25613f9; UN=weixin_38032099; UE=\\\"\\\"; BT=1509089267060; ADHOC_MEMBERSHIP_CLIENT_ID1.0=f4889c67-3d52-6eb3-6cb4-e7a329d9b3c5; Hm_ct_6bcd52f51e9b3dce32bec4a3997...
[FOCAL] public String RegexUtil.getMacthResult(String regex, String source, int index) [CLASS] class RegexUtil [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String getMacthResult(String regex, String source, int index, String defaultValue) [INPUTS] branches=- | result=index, rege...
/* static context [FOCAL] public String RegexUtil.getMacthResult(String regex, String source, int index) [INPUTS] branches=- | result=index, regex, source [CALLS-INTERNAL] String getMacthResult(String regex, String source, int index, String defaultValue) */
/* static context [FOCAL] public String RegexUtil.getMacthResult(String regex, String source, int index) [INPUTS] branches=- | result=index, regex, source [CALLS-INTERNAL] String getMacthResult(String regex, String source, int index, String defaultValue) */ class RegexUtil { public String getMacthResult(String reg...
true
ok
{"focal": {"class": "RegexUtil", "name": "getMacthResult", "signature": "String getMacthResult(String regex, String source, int index)", "start_line": 3, "modifiers": "public", "params": [{"name": "regex", "type": "String"}, {"name": "source", "type": "String"}, {"name": "index", "type": "int"}], "return_type": "String...
100677440_5
class TrafficDensity2 { private CountByLane countByLane(int lanesNumber, double[] speedLimit, double speed){ for(int i = 1; i <= lanesNumber; i++){ if(speed <= speedLimit[i - 1]){ return new CountByLane(1, i); } } return new CountByLane(1, lanesNumber...
int[] count ={0}; double[] speeds = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; TrafficDensity2 trafficDensity = new TrafficDensity2(){ @Override protected double calcSpeed(Vehicle vehicle, double traction, double timeSec) { return speeds[count[0]++]; ...
[FOCAL] private CountByLane TrafficDensity2.countByLane(int lanesNumber, double[] speedLimit, double speed) [CLASS] class TrafficDensity2 [METRICS] loc=8 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2 [NEW] CountByLane [PATH1] for(i <= lanesNumber)=T -> if(speed <= speedLimit[i - 1])=F -> exit loop -> return new ...
/* static context [FOCAL] private CountByLane TrafficDensity2.countByLane(int lanesNumber, double[] speedLimit, double speed) [PATH1] for(i <= lanesNumber)=T -> if(speed <= speedLimit[i - 1])=F -> exit loop -> return new CountByLane(1, lanesNumber) [PATH2] for(i <= lanesNumber)=T -> if(speed <= speedLimit[i - 1])=T -> ...
/* static context [FOCAL] private CountByLane TrafficDensity2.countByLane(int lanesNumber, double[] speedLimit, double speed) [PATH1] for(i <= lanesNumber)=T -> if(speed <= speedLimit[i - 1])=F -> exit loop -> return new CountByLane(1, lanesNumber) [PATH2] for(i <= lanesNumber)=T -> if(speed <= speedLimit[i - 1])=T -> ...
true
ok
{"focal": {"class": "TrafficDensity2", "name": "countByLane", "signature": "CountByLane countByLane(int lanesNumber, double[] speedLimit, double speed)", "start_line": 3, "modifiers": "private", "params": [{"name": "lanesNumber", "type": "int"}, {"name": "speedLimit", "type": "double[]"}, {"name": "speed", "type": "dou...
100683024_676
class LdifRevertor { public static List<LdifEntry> reverseRename( Entry entry, Rdn newRdn, boolean deleteOldRdn ) throws LdapInvalidDnException { return reverseMoveAndRename( entry, null, newRdn, deleteOldRdn ); } private LdifRevertor(); public static LdifEntry reverseAdd( Dn dn ...
Dn dn = new Dn( "cn=test,ou=system" ); Rdn oldRdn = new Rdn( "cn=test" ); Rdn newRdn = new Rdn( "cn=joe+sn=small" ); Entry entry = new DefaultEntry( dn, "objectClass: top", "objectClass: person", "cn: test", "sn: small", "sn: t...
[FOCAL] public static List<LdifEntry> LdifRevertor.reverseRename(Entry entry, Rdn newRdn, boolean deleteOldRdn) [CLASS] class LdifRevertor [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] List<LdifEntry> reverseMoveAndRename(Entry entry, Dn newSuperior, Rdn newRdn, boolean deleteOld...
/* static context [FOCAL] public static List<LdifEntry> LdifRevertor.reverseRename(Entry entry, Rdn newRdn, boolean deleteOldRdn) [INPUTS] branches=- | result=deleteOldRdn, entry, newRdn [EXCEPTIONS] declares LdapInvalidDnException [CALLS-INTERNAL] List<LdifEntry> reverseMoveAndRename(Entry entry, Dn newSuperior, Rdn n...
/* static context [FOCAL] public static List<LdifEntry> LdifRevertor.reverseRename(Entry entry, Rdn newRdn, boolean deleteOldRdn) [INPUTS] branches=- | result=deleteOldRdn, entry, newRdn [EXCEPTIONS] declares LdapInvalidDnException [CALLS-INTERNAL] List<LdifEntry> reverseMoveAndRename(Entry entry, Dn newSuperior, Rdn n...
true
ok
{"focal": {"class": "LdifRevertor", "name": "reverseRename", "signature": "List<LdifEntry> reverseRename(Entry entry, Rdn newRdn, boolean deleteOldRdn) throws LdapInvalidDnException", "start_line": 3, "modifiers": "public static", "params": [{"name": "entry", "type": "Entry"}, {"name": "newRdn", "type": "Rdn"}, {"name"...