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 |
|---|---|---|---|---|---|---|---|---|
62244807_3 | class Version implements Comparable<Version> {
public long value() {
return version;
}
private Version(long version, String display);
public static Version fromJson(JsonObject obj, String field, Version dftValue);
public static Version fromJson(JsonObject obj, String field);
public s... | assertEquals(-1, Version.UNSET.value());
assertEquals(0, Version.INIT.value());
assertEquals(1, Version.FIRST.value());
}
} | [FOCAL] public long Version.value()
[CLASS] class Version implements Comparable<Version>
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] Version(long version, String display); Version fromJson(JsonObject obj, String field, Version dftValue); Version fromJson(JsonObject obj, String f... | /* static context
[FOCAL] public long Version.value()
*/
| /* static context
[FOCAL] public long Version.value()
*/
class Version implements Comparable<Version> {
public long value() {
return version;
}
private Version(long version, String display);
public static Version fromJson(JsonObject obj, String field, Version dftValue);
public static Ver... | true | ok | {"focal": {"class": "Version", "name": "value", "signature": "long value()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "long"}, "class_info": {"name": "Version", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Comparable<Version>", "fields": [], "members": [{"name": "Vers... |
62246133_145 | class TokenRequest implements Request<Credentials, AuthenticationException> {
@NonNull
public TokenRequest addHeader(@NonNull String name, @NonNull String value) {
request.addHeader(name, value);
return this;
}
public TokenRequest(@NonNull ParameterizableRequest<Credentials, Authentic... | tokenRequest.addHeader("auth", "val123");
verify(mockRequest).addHeader(eq("auth"), eq("val123"));
}
} | [FOCAL] @NonNull public TokenRequest TokenRequest.addHeader(String name, String value)
[CLASS] class TokenRequest implements Request<Credentials, AuthenticationException>
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] request.addHeader/2
[COLLABORATORS] field request addHeader/2
[... | /* static context
[FOCAL] @NonNull public TokenRequest TokenRequest.addHeader(String name, String value)
[COLLABORATORS] field request addHeader/2
[CALLS-EXTERNAL] request.addHeader/2
*/
| /* static context
[FOCAL] @NonNull public TokenRequest TokenRequest.addHeader(String name, String value)
[COLLABORATORS] field request addHeader/2
[CALLS-EXTERNAL] request.addHeader/2
*/
class TokenRequest implements Request<Credentials, AuthenticationException> {
@NonNull
public TokenRequest addHeader(@NonNul... | true | ok | {"focal": {"class": "TokenRequest", "name": "addHeader", "signature": "TokenRequest addHeader(String name, String value)", "start_line": 3, "modifiers": "@NonNull public", "params": [{"name": "name", "type": "String"}, {"name": "value", "type": "String"}], "return_type": "TokenRequest"}, "class_info": {"name": "TokenRe... |
62262439_6 | class Move {
public int getTypeId() {
return typeId;
}
public Move(int moveId, String name, int typeId, int power, int pp, int accuracy, String className);
public int getMoveId();
public String getName();
public int getPower();
public int getPp();
public int getAccuracy();
... | assertEquals(0, mTestMoveOne.getTypeId());
assertEquals(1, mTestMoveTwo.getTypeId());
assertEquals(1, mTestMoveThree.getTypeId());
}
} | [FOCAL] public int Move.getTypeId()
[CLASS] class Move
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] Move(int moveId, String name, int typeId, int power, int pp, int accuracy, String className); int getMoveId(); String getName(); int getPower(); int getPp(); int getAccuracy(); Str... | /* static context
[FOCAL] public int Move.getTypeId()
*/
| /* static context
[FOCAL] public int Move.getTypeId()
*/
class Move {
public int getTypeId() {
return typeId;
}
public Move(int moveId, String name, int typeId, int power, int pp, int accuracy, String className);
public int getMoveId();
public String getName();
public int getPower();... | true | ok | {"focal": {"class": "Move", "name": "getTypeId", "signature": "int getTypeId()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "Move", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "mTestMoveOne", "type": "Move", "modi... |
62282525_18 | class PatternValidator implements ConfigDef.Validator {
@Override
public void ensureValid(String setting, Object value) {
if (value instanceof String) {
String s = (String) value;
validatePattern(setting, s);
} else if (value instanceof List) {
List<String> list = (List<String>) value;
... | ConfigException configException = assertThrows(ConfigException.class, ()->{
PatternValidator validator = new PatternValidator();
validator.ensureValid("foo", 1234);
});
assertTrue(configException.getMessage().contains("foo"));
}
} | [FOCAL] @Override public void PatternValidator.ensureValid(String setting, Object value)
[CLASS] class PatternValidator implements ConfigDef.Validator
[METRICS] loc=14 cc=4 branches=2 loops=1 returns=0 throws=1 nesting=3
[CALLS-INTERNAL] void validatePattern(String setting, String pattern)
[NEW] ConfigException
[EXCEPT... | /* static context
[FOCAL] @Override public void PatternValidator.ensureValid(String setting, Object value)
[THROWS-WHEN] ConfigException when !(value instanceof String) && !(value instanceof List)
[PATH1] if(value instanceof String)=F -> if(value instanceof List)=T -> foreach(String s : list)=T -> exit loop
[PATH2] if(... | /* static context
[FOCAL] @Override public void PatternValidator.ensureValid(String setting, Object value)
[THROWS-WHEN] ConfigException when !(value instanceof String) && !(value instanceof List)
[PATH1] if(value instanceof String)=F -> if(value instanceof List)=T -> foreach(String s : list)=T -> exit loop
[PATH2] if(... | true | ok | {"focal": {"class": "PatternValidator", "name": "ensureValid", "signature": "void ensureValid(String setting, Object value)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "setting", "type": "String"}, {"name": "value", "type": "Object"}], "return_type": "void"}, "class_info": {"name": "PatternV... |
62303580_13 | class ConfigStrategyProvider {
public static ConfigStrategy get() {
return new YamlConfig();
}
private ConfigStrategyProvider();
}
class ConfigStrategyProviderTest {
@Test
public void getReturnsYamlConfigByDefault() {
| assumeTrue(StringUtils.isBlank(System.getProperty(ConfigKeys.CONFIG_STRATEGY)));
ConfigStrategy configStrategy = ConfigStrategyProvider.get();
assertThat(configStrategy).isInstanceOf(YamlConfig.class);
}
} | [FOCAL] public static ConfigStrategy ConfigStrategyProvider.get()
[CLASS] class ConfigStrategyProvider
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] YamlConfig
[CLASS-MEMBERS] ConfigStrategyProvider()
[TEST] ConfigStrategyProviderTest: @Test public void getReturnsYamlConfigByDefault() | /* static context
[FOCAL] public static ConfigStrategy ConfigStrategyProvider.get()
[NEW] YamlConfig
*/
| /* static context
[FOCAL] public static ConfigStrategy ConfigStrategyProvider.get()
[NEW] YamlConfig
*/
class ConfigStrategyProvider {
public static ConfigStrategy get() {
return new YamlConfig();
}
private ConfigStrategyProvider();
}
class ConfigStrategyProviderTest {
@Test
public void getReturnsYa... | true | ok | {"focal": {"class": "ConfigStrategyProvider", "name": "get", "signature": "ConfigStrategy get()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "ConfigStrategy"}, "class_info": {"name": "ConfigStrategyProvider", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fie... |
62313135_1 | class GetComicsUseCaseImpl implements GetComicsUseCase {
@Override
public void execute(int characterId, Callback callback) {
this.characterId = characterId;
this.callback = callback;
this.threadExecutor.execute(this);
}
@Inject public GetComicsUseCaseImpl(ThreadExecutor thread... | interactor.execute(CHARACTER_ID, callback);
verify(comicsRepository).getComics(anyInt(), any(
ComicListCallback.class));
}
} | [FOCAL] @Override public void GetComicsUseCaseImpl.execute(int characterId, Callback callback)
[CLASS] class GetComicsUseCaseImpl implements GetComicsUseCase
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] this.threadExecutor.execute/1
[FIELDS] read=threadExecutor | write=callback,... | /* static context
[FOCAL] @Override public void GetComicsUseCaseImpl.execute(int characterId, Callback callback)
[COLLABORATORS] field threadExecutor execute/1
[STATE] callback, characterId
[FIELDS] read=threadExecutor | write=callback, characterId
[CALLS-EXTERNAL] this.threadExecutor.execute/1
*/
| /* static context
[FOCAL] @Override public void GetComicsUseCaseImpl.execute(int characterId, Callback callback)
[COLLABORATORS] field threadExecutor execute/1
[STATE] callback, characterId
[FIELDS] read=threadExecutor | write=callback, characterId
[CALLS-EXTERNAL] this.threadExecutor.execute/1
*/
class GetComicsUseCas... | true | ok | {"focal": {"class": "GetComicsUseCaseImpl", "name": "execute", "signature": "void execute(int characterId, Callback callback)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "characterId", "type": "int"}, {"name": "callback", "type": "Callback"}], "return_type": "void"}, "class_info": {"name": "... |
62384018_0 | class S3Util {
public static String getContentType(final File file) {
String contentType = URLConnection.guessContentTypeFromName(file.getName());
if (StringUtil.isNotEmpty(contentType)) {
return contentType;
}
if (PROBE_CONTENT_TYPE_METHOD != null && FILE_TO_PATH_METHOD != null) {
try {
... | Assert.assertEquals(S3Util.getContentType(new File("S3UtilsTest", fileName)), expectedType);
}
} | [FOCAL] public static String S3Util.getContentType(File file)
[CLASS] class S3Util
[METRICS] loc=16 cc=5 branches=3 loops=0 returns=2 throws=0 nesting=3
[CALLS-EXTERNAL] URLConnection.guessContentTypeFromName/1, File.getName/0, StringUtil.isNotEmpty/1, PROBE_CONTENT_TYPE_METHOD.invoke/2, FILE_TO_PATH_METHOD.invoke/1, S... | /* static context
[FOCAL] public static String S3Util.getContentType(File file)
[PATH1] if(StringUtil.isNotEmpty(contentType))=F -> if(PROBE_CONTENT_TYPE_METHOD != null && FILE_TO_PATH_METHOD != null)=T -> try-body throws -> return StringUtil.notEmpty(contentType, DEFAULT_CONTENT_TYPE)
[PATH2] if(StringUtil.isNotEmpty(... | /* static context
[FOCAL] public static String S3Util.getContentType(File file)
[PATH1] if(StringUtil.isNotEmpty(contentType))=F -> if(PROBE_CONTENT_TYPE_METHOD != null && FILE_TO_PATH_METHOD != null)=T -> try-body throws -> return StringUtil.notEmpty(contentType, DEFAULT_CONTENT_TYPE)
[PATH2] if(StringUtil.isNotEmpty(... | true | ok | {"focal": {"class": "S3Util", "name": "getContentType", "signature": "String getContentType(File file)", "start_line": 3, "modifiers": "public static", "params": [{"name": "file", "type": "File"}], "return_type": "String"}, "class_info": {"name": "S3Util", "kind": "class", "modifiers": "", "superclass": null, "interfac... |
62422842_38 | class During {
public Future execute (CompletionCallback <Object> callback)
{
if (callback == null)
throw new IllegalArgumentException ("Callback cannot be null");
TaskManagerImpl taskManager =
new TaskManagerImpl (
this.executor_,
this.cond_,
this.task_,
... | final During during = new During (
Executors.newCachedThreadPool (),
new ConditionalTask ()
{
@Override
public void evaluate (ConditionalCallback callback)
{
callback.done (remaining_ > 0);
}
},
new Task () {
@Over... | [FOCAL] public Future During.execute(CompletionCallback <Object> callback)
[CLASS] class During
[METRICS] loc=16 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] this.executor_.execute/1
[NEW] IllegalArgumentException, TaskManagerImpl, Future
[FIELDS] read=cond_, executor_, task_
[EXCEPTIONS] throw... | /* static context
[FOCAL] public Future During.execute(CompletionCallback <Object> callback)
[THROWS-WHEN] IllegalArgumentException when callback == null
[PATH1] if(callback == null)=T -> throw new IllegalArgumentException ("Callback cannot be null")
[PATH2] if(callback == null)=F -> return new Future (taskManager)
[IN... | /* static context
[FOCAL] public Future During.execute(CompletionCallback <Object> callback)
[THROWS-WHEN] IllegalArgumentException when callback == null
[PATH1] if(callback == null)=T -> throw new IllegalArgumentException ("Callback cannot be null")
[PATH2] if(callback == null)=F -> return new Future (taskManager)
[IN... | true | ok | {"focal": {"class": "During", "name": "execute", "signature": "Future execute(CompletionCallback <Object> callback)", "start_line": 3, "modifiers": "public", "params": [{"name": "callback", "type": "CompletionCallback <Object>"}], "return_type": "Future"}, "class_info": {"name": "During", "kind": "class", "modifiers": ... |
62535317_13 | class SalesOrderItem {
public BigDecimal getGrossAmount() {
return this.grossAmount;
}
public SalesOrderItem();
public SalesOrderItem(String salesOrderId, int itemNumber);
public SalesOrderItemId getId();
public void setId(SalesOrderItemId id);
public String getSalesOrderId();
public void setSalesOrderId... | EntityManager em = emf.createEntityManager();
String soId = "11111";
TestFactory tf = new TestFactory();
SalesOrderItem soItemAct = null;
try {
// Add Sales Order Item
assertTrue("Sales Order Item", tf.createSalesOrderItem(em, soId));
// Search for Sales Order Item
TypedQuery<SalesOrderItem> query... | [FOCAL] public BigDecimal SalesOrderItem.getGrossAmount()
[CLASS] class SalesOrderItem
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[FIELDS] read=grossAmount
[CLASS-MEMBERS] SalesOrderItem(); SalesOrderItem(String salesOrderId, int itemNumber); SalesOrderItemId getId(); void setId(SalesOrderItem... | /* static context
[FOCAL] public BigDecimal SalesOrderItem.getGrossAmount()
[FIELDS] read=grossAmount
*/
| /* static context
[FOCAL] public BigDecimal SalesOrderItem.getGrossAmount()
[FIELDS] read=grossAmount
*/
class SalesOrderItem {
public BigDecimal getGrossAmount() {
return this.grossAmount;
}
public SalesOrderItem();
public SalesOrderItem(String salesOrderId, int itemNumber);
public SalesOrderItemId getId()... | true | ok | {"focal": {"class": "SalesOrderItem", "name": "getGrossAmount", "signature": "BigDecimal getGrossAmount()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "BigDecimal"}, "class_info": {"name": "SalesOrderItem", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"... |
62553999_134 | class TextUtils {
public static boolean equals(@Nullable CharSequence a, @Nullable CharSequence b) {
if (a == b) {
return true;
}
int length;
if (a != null && b != null && (length = a.length()) == b.length()) {
if (a instanceof String && b instanceof String)... | StringBuilder first = new StringBuilder("9pda");
StringBuilder second = new StringBuilder("0ca");
boolean equals = TextUtils.equals(first, second);
assertFalse(equals);
}
} | [FOCAL] public static boolean TextUtils.equals(CharSequence a, CharSequence b)
[CLASS] class TextUtils
[METRICS] loc=20 cc=6 branches=4 loops=1 returns=5 throws=0 nesting=4
[CALLS-EXTERNAL] CharSequence.length/0, CharSequence.equals/1, CharSequence.charAt/1
[PATH1] if(a == b)=F -> if(a != null && b != null && (length =... | /* static context
[FOCAL] public static boolean TextUtils.equals(CharSequence a, CharSequence b)
[PATH1] if(a == b)=F -> if(a != null && b != null && (length = a.length()) == b.length())=T -> if(a instanceof String && b instanceof String)=F -> for(i < length)=T -> if(a.charAt(i) != b.charAt(i))=F -> exit loop -> return... | /* static context
[FOCAL] public static boolean TextUtils.equals(CharSequence a, CharSequence b)
[PATH1] if(a == b)=F -> if(a != null && b != null && (length = a.length()) == b.length())=T -> if(a instanceof String && b instanceof String)=F -> for(i < length)=T -> if(a.charAt(i) != b.charAt(i))=F -> exit loop -> return... | true | ok | {"focal": {"class": "TextUtils", "name": "equals", "signature": "boolean equals(CharSequence a, CharSequence b)", "start_line": 3, "modifiers": "public static", "params": [{"name": "a", "type": "CharSequence"}, {"name": "b", "type": "CharSequence"}], "return_type": "boolean"}, "class_info": {"name": "TextUtils", "kind"... |
62569629_43 | class Normalize {
public static String cleanupDeviceBrandName(String deviceBrand, String deviceName) {
deviceName = replaceString(deviceName, "'", " ");
deviceName = replaceString(deviceName, "_", " ");
deviceName = DEVICE_CLEANUP_PATTERN_1.matcher(deviceName).replaceAll("-");
devi... | assertEquals("Asus Something T123", Normalize.cleanupDeviceBrandName("AsUs", "something t123"));
assertEquals("Sony X1", Normalize.cleanupDeviceBrandName("Sony", "sony x1"));
assertEquals("Sony X1", Normalize.cleanupDeviceBrandName("Sony", "sony-x1"));
... | [FOCAL] public static String Normalize.cleanupDeviceBrandName(String deviceBrand, String deviceName)
[CLASS] class Normalize
[METRICS] loc=33 cc=4 branches=3 loops=0 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] String replaceString(String input, String searchFor, String replaceWith)
[CALLS-EXTERNAL] DEVICE_CLEANUP_PAT... | /* static context
[FOCAL] public static String Normalize.cleanupDeviceBrandName(String deviceBrand, String deviceName)
[PATH1] if(!deviceBrand.isEmpty())=T -> if(lowerDeviceName.startsWith(lowerDeviceBrand))=T -> if(result.indexOf('I') != -1)=T -> return result
[PATH2] if(!deviceBrand.isEmpty())=F -> if(result.indexOf(... | /* static context
[FOCAL] public static String Normalize.cleanupDeviceBrandName(String deviceBrand, String deviceName)
[PATH1] if(!deviceBrand.isEmpty())=T -> if(lowerDeviceName.startsWith(lowerDeviceBrand))=T -> if(result.indexOf('I') != -1)=T -> return result
[PATH2] if(!deviceBrand.isEmpty())=F -> if(result.indexOf(... | true | ok | {"focal": {"class": "Normalize", "name": "cleanupDeviceBrandName", "signature": "String cleanupDeviceBrandName(String deviceBrand, String deviceName)", "start_line": 3, "modifiers": "public static", "params": [{"name": "deviceBrand", "type": "String"}, {"name": "deviceName", "type": "String"}], "return_type": "String"}... |
62607150_1 | class RegexUtil {
public static boolean isThoughtWorkEmail(String email) {
return THOUGHT_WORKS_EMAIL_PATTERN.matcher(email).matches();
}
}
class RegexUtilTest {
@Test
public void testNotMatcherNonThoughtWorksEmail() throws Exception {
| String[] emails = new String[] {"test@google.com", "test @gmail.com", "test_wrong_email"};
for (String email : emails) {
boolean matcher = isThoughtWorkEmail(email);
assertThat(matcher).isFalse();
}
}
} | [FOCAL] public static boolean RegexUtil.isThoughtWorkEmail(String email)
[CLASS] class RegexUtil
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] THOUGHT_WORKS_EMAIL_PATTERN.matcher(email).matches/0, THOUGHT_WORKS_EMAIL_PATTERN.matcher/1
[INPUTS] branches=- | result=email
[DATAFLOW]... | /* static context
[FOCAL] public static boolean RegexUtil.isThoughtWorkEmail(String email)
[INPUTS] branches=- | result=email
[CALLS-EXTERNAL] THOUGHT_WORKS_EMAIL_PATTERN.matcher(email).matches/0, THOUGHT_WORKS_EMAIL_PATTERN.matcher/1
*/
| /* static context
[FOCAL] public static boolean RegexUtil.isThoughtWorkEmail(String email)
[INPUTS] branches=- | result=email
[CALLS-EXTERNAL] THOUGHT_WORKS_EMAIL_PATTERN.matcher(email).matches/0, THOUGHT_WORKS_EMAIL_PATTERN.matcher/1
*/
class RegexUtil {
public static boolean isThoughtWorkEmail(String email) {
... | true | ok | {"focal": {"class": "RegexUtil", "name": "isThoughtWorkEmail", "signature": "boolean isThoughtWorkEmail(String email)", "start_line": 3, "modifiers": "public static", "params": [{"name": "email", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "RegexUtil", "kind": "class", "modifiers": "", "superc... |
62640065_41 | class ZeroCodeAssertionsProcessorImpl implements ZeroCodeAssertionsProcessor {
@Override
public String resolveStringJson(String requestJsonOrAnyString, String scenarioStateJson) {
String resolvedFromTemplate = resolveKnownTokensAndProperties(requestJsonOrAnyString);
String resolvedJson = resolv... | ScenarioSpec scenarioSpec =
smartUtils.scenarioFileToJava(
"unit_test_files/test_engine/01_request_with_place_holders.json", ScenarioSpec.class);
final String requestJsonAsString = scenarioSpec.getSteps().get(0).getRequest().toString();
final String resol... | [FOCAL] @Override public String ZeroCodeAssertionsProcessorImpl.resolveStringJson(String requestJsonOrAnyString, String scenarioStateJson)
[CLASS] class ZeroCodeAssertionsProcessorImpl implements ZeroCodeAssertionsProcessor
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String res... | /* static context
[FOCAL] @Override public String ZeroCodeAssertionsProcessorImpl.resolveStringJson(String requestJsonOrAnyString, String scenarioStateJson)
[INPUTS] branches=- | result=requestJsonOrAnyString, scenarioStateJson
[CALLS-INTERNAL] String resolveFieldTypes(String resolvedJson); String resolveJsonPaths(Stri... | /* static context
[FOCAL] @Override public String ZeroCodeAssertionsProcessorImpl.resolveStringJson(String requestJsonOrAnyString, String scenarioStateJson)
[INPUTS] branches=- | result=requestJsonOrAnyString, scenarioStateJson
[CALLS-INTERNAL] String resolveFieldTypes(String resolvedJson); String resolveJsonPaths(Stri... | true | ok | {"focal": {"class": "ZeroCodeAssertionsProcessorImpl", "name": "resolveStringJson", "signature": "String resolveStringJson(String requestJsonOrAnyString, String scenarioStateJson)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "requestJsonOrAnyString", "type": "String"}, {"name": "scenarioState... |
62640701_32 | class DependencyManagement {
public Long createDependencyWithinArchitecture(final Long architectureId, final Long serviceId, final Long dependsOnServiceId) {
final Architecture architecture = architectureRepository.findOne(architectureId);
final Service service = serviceRepository.findOne(serviceId... | stub(dependencyRepository.save(any(Dependency.class))).toReturn(new Dependency());
dependencyManagement.createDependencyWithinArchitecture(1L, 2L, 3L);
verify(dependencyRepository).save(any(Dependency.class));
}
} | [FOCAL] public Long DependencyManagement.createDependencyWithinArchitecture(Long architectureId, Long serviceId, Long dependsOnServiceId)
[CLASS] class DependencyManagement
[METRICS] loc=15 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] ArchitectureRepository.findOne/1, ServiceRepository.findOne/... | /* static context
[FOCAL] public Long DependencyManagement.createDependencyWithinArchitecture(Long architectureId, Long serviceId, Long dependsOnServiceId)
[INPUTS] branches=- | result=dependencyRepository
[COLLABORATORS] field architectureRepository:ArchitectureRepository findOne/1; field serviceRepository:ServiceRepo... | /* static context
[FOCAL] public Long DependencyManagement.createDependencyWithinArchitecture(Long architectureId, Long serviceId, Long dependsOnServiceId)
[INPUTS] branches=- | result=dependencyRepository
[COLLABORATORS] field architectureRepository:ArchitectureRepository findOne/1; field serviceRepository:ServiceRepo... | true | ok | {"focal": {"class": "DependencyManagement", "name": "createDependencyWithinArchitecture", "signature": "Long createDependencyWithinArchitecture(Long architectureId, Long serviceId, Long dependsOnServiceId)", "start_line": 3, "modifiers": "public", "params": [{"name": "architectureId", "type": "Long"}, {"name": "service... |
62711375_6 | class GithubImpl implements Github {
@Override
public Promise<Collection<Repository>, Throwable, Void> repositories(final String organization) {
return deferredManager.when(() -> {
Response<List<Repository>> response = api.repositories(organization).execute();
if (response.isSuc... | // given:
Collection<Repository> repositories = createSampleRepositories();
stubFor(get(urlEqualTo("/orgs/" + ORGANIZATION + "/repos"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/json")
.withBody(reposito... | [FOCAL] @Override public Promise<Collection<Repository>, Throwable, Void> GithubImpl.repositories(String organization)
[CLASS] class GithubImpl implements Github
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] deferredManager.when/1, api.repositories(organization).execute/0, api.re... | /* static context
[FOCAL] @Override public Promise<Collection<Repository>, Throwable, Void> GithubImpl.repositories(String organization)
[INPUTS] branches=- | result=organization
[COLLABORATORS] field deferredManager when/1; field api repositories/1
[NEW] IllegalStateException
[CALLS-EXTERNAL] deferredManager.when/1, a... | /* static context
[FOCAL] @Override public Promise<Collection<Repository>, Throwable, Void> GithubImpl.repositories(String organization)
[INPUTS] branches=- | result=organization
[COLLABORATORS] field deferredManager when/1; field api repositories/1
[NEW] IllegalStateException
[CALLS-EXTERNAL] deferredManager.when/1, a... | true | ok | {"focal": {"class": "GithubImpl", "name": "repositories", "signature": "Promise<Collection<Repository>, Throwable, Void> repositories(String organization)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "organization", "type": "String"}], "return_type": "Promise<Collection<Repository>, Throwable... |
62793144_17 | class RealmFinalizerController extends AbstractFinalizerController {
@Override
protected Result processFinalizer(AddressSpace addressSpace) {
log.info("Processing realm finalizer for {}/{}", addressSpace.getMetadata().getNamespace(), addressSpace.getMetadata().getName());
final String realmNam... | when(authenticationServiceRegistry.findAuthenticationService(any())).thenReturn(Optional.of(createAuthService(AuthenticationServiceType.standard, "myrealm")));
AbstractFinalizerController.Result result = controller.processFinalizer(createTestSpace("standard", "myrealm"));
assertNotNull(result);
... | [FOCAL] @Override protected Result RealmFinalizerController.processFinalizer(AddressSpace addressSpace)
[CLASS] class RealmFinalizerController extends AbstractFinalizerController
[METRICS] loc=23 cc=4 branches=2 loops=0 returns=2 throws=0 nesting=3
[CALLS-INTERNAL] void deleteRealm(AuthenticationService authenticationS... | /* static context
[FOCAL] @Override protected Result RealmFinalizerController.processFinalizer(AddressSpace addressSpace)
[PATH1] if(realmName != null)=T -> if((authenticationService != null && authenticationService.getStatus() != null && authenticationService.getSpec().getTyp...)=T -> try-body throws -> return Result.... | /* static context
[FOCAL] @Override protected Result RealmFinalizerController.processFinalizer(AddressSpace addressSpace)
[PATH1] if(realmName != null)=T -> if((authenticationService != null && authenticationService.getStatus() != null && authenticationService.getSpec().getTyp...)=T -> try-body throws -> return Result.... | true | ok | {"focal": {"class": "RealmFinalizerController", "name": "processFinalizer", "signature": "Result processFinalizer(AddressSpace addressSpace)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "addressSpace", "type": "AddressSpace"}], "return_type": "Result"}, "class_info": {"name": "RealmFinaliz... |
62823867_3 | class ResourceMatcher {
public void match(Handler handler) {
matcher.reset();
while (matcher.find()) {
handler.handle(matcher.group(1), matcher.group(2));
}
}
public ResourceMatcher(String input, MatchType matchType);
private ResourceMatcher.Handler mockHandler;
}
class ResourceMatcher... | String codeLine = "editTextView.setText(toString(R.string.title));" +
"imageView.getLayoutParam().width = getResource().getDimen(R.dimen.width);";
ResourceMatcher matcher = new ResourceMatcher(codeLine, RES_VALUE_IN_JAVA);
matcher.match(mockHandler);
verify(mockHandler)... | [FOCAL] public void ResourceMatcher.match(Handler handler)
[CLASS] class ResourceMatcher
[METRICS] loc=6 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] matcher.reset/0, matcher.find/0, Handler.handle/2, matcher.group/1
[PATH1] while(matcher.find())=T -> exit loop
[PATH2] while(matcher.find())=F
[... | /* static context
[FOCAL] public void ResourceMatcher.match(Handler handler)
[PATH1] while(matcher.find())=T -> exit loop
[PATH2] while(matcher.find())=F
[COLLABORATORS] field matcher reset/0,find/0,group/1; param handler:Handler handle/2
[CALLS-EXTERNAL] matcher.reset/0, matcher.find/0, Handler.handle/2, matcher.group... | /* static context
[FOCAL] public void ResourceMatcher.match(Handler handler)
[PATH1] while(matcher.find())=T -> exit loop
[PATH2] while(matcher.find())=F
[COLLABORATORS] field matcher reset/0,find/0,group/1; param handler:Handler handle/2
[CALLS-EXTERNAL] matcher.reset/0, matcher.find/0, Handler.handle/2, matcher.group... | true | ok | {"focal": {"class": "ResourceMatcher", "name": "match", "signature": "void match(Handler handler)", "start_line": 3, "modifiers": "public", "params": [{"name": "handler", "type": "Handler"}], "return_type": "void"}, "class_info": {"name": "ResourceMatcher", "kind": "class", "modifiers": "", "superclass": null, "interfa... |
62839192_13 | class GroovyTreeParser implements TreeParser {
@Override
public Set<SymbolInformation> getFilteredSymbols(String query) {
checkNotNull(query, "query must not be null");
Pattern pattern = getQueryPattern(query);
return indexer.getFileSymbols().values().stream().flatMap(Collection::stream... | File coordinatesFiles = addFileToFolder(workspaceRoot, "Coordinates.groovy",
"class Coordinates implements ICoordinates {\n"
+ " double latitude\n"
+ " double longitude\n"
+ " double longitude2\n"
... | [FOCAL] @Override public Set<SymbolInformation> GroovyTreeParser.getFilteredSymbols(String query)
[CLASS] class GroovyTreeParser implements TreeParser
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] checkNotNull/2 (inherited), getQueryPattern/1 (inherited), indexer.getFileSymbols()... | /* static context
[FOCAL] @Override public Set<SymbolInformation> GroovyTreeParser.getFilteredSymbols(String query)
[INPUTS] branches=- | result=query
[COLLABORATORS] field indexer getFileSymbols/0; field symbol getName/0
[CALLS-EXTERNAL] checkNotNull/2 (inherited), getQueryPattern/1 (inherited), indexer.getFileSymbols... | /* static context
[FOCAL] @Override public Set<SymbolInformation> GroovyTreeParser.getFilteredSymbols(String query)
[INPUTS] branches=- | result=query
[COLLABORATORS] field indexer getFileSymbols/0; field symbol getName/0
[CALLS-EXTERNAL] checkNotNull/2 (inherited), getQueryPattern/1 (inherited), indexer.getFileSymbols... | true | ok | {"focal": {"class": "GroovyTreeParser", "name": "getFilteredSymbols", "signature": "Set<SymbolInformation> getFilteredSymbols(String query)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "query", "type": "String"}], "return_type": "Set<SymbolInformation>"}, "class_info": {"name": "GroovyTreePar... |
62872951_20 | class LogMapper {
public static ExchangeLogType toModel(ExchangeLog entity) {
ExchangeLogType model = new ExchangeLogType();
LogType logType = entity.getType();
if (logType.equals(LogType.RECEIVE_MOVEMENT)) {
ReceiveMovementType type = new ReceiveMovementType();
typ... | Date dateReceived = new Date();
String guid = "Paradise";
String senderReceiver = "Chris Martin";
boolean incoming = true;
ExchangeLogStatusTypeType status = ExchangeLogStatusTypeType.PROBABLY_TRANSMITTED;
String destination = "destination";
ExchangeLog entity = ... | [FOCAL] public static ExchangeLogType LogMapper.toModel(ExchangeLog entity)
[CLASS] class LogMapper
[METRICS] loc=56 cc=6 branches=5 loops=0 returns=1 throws=0 nesting=4
[CALLS-EXTERNAL] ExchangeLog.getType/0, LogType.equals/1, SendEmailType.setSource/1, ExchangeLog.getSource/0, SendEmailType.setRecipient/1, ExchangeLo... | /* static context
[FOCAL] public static ExchangeLogType LogMapper.toModel(ExchangeLog entity)
[PATH1] if(logType.equals(LogType.RECEIVE_MOVEMENT))=F -> if(logType.equals(LogType.SEND_MOVEMENT))=F -> if(logType.equals(LogType.SEND_POLL))=F -> if(logType.equals(LogType.SEND_EMAIL))=T -> if(entity.getTypeRefType() != null... | /* static context
[FOCAL] public static ExchangeLogType LogMapper.toModel(ExchangeLog entity)
[PATH1] if(logType.equals(LogType.RECEIVE_MOVEMENT))=F -> if(logType.equals(LogType.SEND_MOVEMENT))=F -> if(logType.equals(LogType.SEND_POLL))=F -> if(logType.equals(LogType.SEND_EMAIL))=T -> if(entity.getTypeRefType() != null... | true | ok | {"focal": {"class": "LogMapper", "name": "toModel", "signature": "ExchangeLogType toModel(ExchangeLog entity)", "start_line": 3, "modifiers": "public static", "params": [{"name": "entity", "type": "ExchangeLog"}], "return_type": "ExchangeLogType"}, "class_info": {"name": "LogMapper", "kind": "class", "modifiers": "", "... |
62914175_43 | class CreateVCFFileTask extends GenericTask {
@Override
@SneakyThrows
public void execute(TaskContext taskContext) {
val testedDonorCount = resolveTotalSsmTestedDonorCount(taskContext);
val releaseName = taskContext.getJobContext().getReleaseName();
val fastaFile = resolveFastaFile();
val header... | given(new File(INPUT_TEST_FIXTURES_DIR));
task.execute(createTaskContext(JobType.SUMMARIZE));
verifyOutput();
}
} | [FOCAL] @Override @SneakyThrows public void CreateVCFFileTask.execute(TaskContext taskContext)
[CLASS] class CreateVCFFileTask extends GenericTask
[METRICS] loc=17 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] File resolveFastaFile(); Integer resolveTotalSsmTestedDonorCount(TaskContext taskConte... | /* static context
[FOCAL] @Override @SneakyThrows public void CreateVCFFileTask.execute(TaskContext taskContext)
[COLLABORATORS] param taskContext:TaskContext getJobContext/0
[CALLS-INTERNAL] File resolveFastaFile(); Integer resolveTotalSsmTestedDonorCount(TaskContext taskContext); JavaRDD<String> getVCFHeaderRDD(int t... | /* static context
[FOCAL] @Override @SneakyThrows public void CreateVCFFileTask.execute(TaskContext taskContext)
[COLLABORATORS] param taskContext:TaskContext getJobContext/0
[CALLS-INTERNAL] File resolveFastaFile(); Integer resolveTotalSsmTestedDonorCount(TaskContext taskContext); JavaRDD<String> getVCFHeaderRDD(int t... | true | ok | {"focal": {"class": "CreateVCFFileTask", "name": "execute", "signature": "void execute(TaskContext taskContext)", "start_line": 3, "modifiers": "@Override @SneakyThrows public", "params": [{"name": "taskContext", "type": "TaskContext"}], "return_type": "void"}, "class_info": {"name": "CreateVCFFileTask", "kind": "class... |
62959750_0 | class FieldUtils {
@NonNull
public static <T> Observable<T> toObservable(@NonNull final ObservableField<T> field) {
return Observable.create(new ObservableOnSubscribe<T>() {
@Override
public void subscribe(final ObservableEmitter<T> e) throws Exception {
T initi... | testObserver = toObservable(new ObservableField<>((Integer) null)).test();
testObserver.assertNoValues()
.assertNoErrors();
}
} | [FOCAL] @NonNull public static Observable<T> FieldUtils.toObservable(ObservableField<T> field)
[CLASS] class FieldUtils
[METRICS] loc=26 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] Observable.create/1, ObservableField<T>.get/0, e.onNext/1, ObservableField<T>.addOnPropertyChangedCallback/1, e.s... | /* static context
[FOCAL] @NonNull public static Observable<T> FieldUtils.toObservable(ObservableField<T> field)
[INPUTS] branches=- | result=field
[COLLABORATORS] param field:ObservableField<T> get/0,addOnPropertyChangedCallback/1,removeOnPropertyChangedCallback/1; field e onNext/1,setCancellable/1
[NEW] ObservableOnS... | /* static context
[FOCAL] @NonNull public static Observable<T> FieldUtils.toObservable(ObservableField<T> field)
[INPUTS] branches=- | result=field
[COLLABORATORS] param field:ObservableField<T> get/0,addOnPropertyChangedCallback/1,removeOnPropertyChangedCallback/1; field e onNext/1,setCancellable/1
[NEW] ObservableOnS... | true | ok | {"focal": {"class": "FieldUtils", "name": "toObservable", "signature": "Observable<T> toObservable(ObservableField<T> field)", "start_line": 3, "modifiers": "@NonNull public static", "params": [{"name": "field", "type": "ObservableField<T>"}], "return_type": "Observable<T>"}, "class_info": {"name": "FieldUtils", "kind"... |
62970529_3 | class ZookeeperCRUD {
@VisibleForTesting
String readZNodeData(String path) {
//TODO: throw exceptions instead of returning null
try {
Stat stat = curatorClient.checkExists().forPath(path);
if(stat == null) return null; // path does not exist
String zNodeData ... | when(curatorFramework.checkExists().forPath(anyString())).thenReturn(null);
String zNodeData = zookeeperClientWrapper.readZNodeData("/path1/path2");
verify(curatorFramework, never()).getData();
assertNull(zNodeData);
}
} | [FOCAL] @VisibleForTesting String ZookeeperCRUD.readZNodeData(String path)
[CLASS] class ZookeeperCRUD
[METRICS] loc=14 cc=4 branches=2 loops=0 returns=4 throws=0 nesting=2
[CALLS-EXTERNAL] curatorClient.checkExists().forPath/1, curatorClient.checkExists/0, curatorClient.getData().forPath/1, curatorClient.getData/0, St... | /* static context
[FOCAL] @VisibleForTesting String ZookeeperCRUD.readZNodeData(String path)
[PATH1] if(stat == null)=F -> if(Strings.isNullOrEmpty(zNodeData))=T -> return null
[PATH2] if(stat == null)=F -> if(Strings.isNullOrEmpty(zNodeData))=F -> return zNodeData
[PATH3] try-body throws -> return null
[PATH4] if(stat... | /* static context
[FOCAL] @VisibleForTesting String ZookeeperCRUD.readZNodeData(String path)
[PATH1] if(stat == null)=F -> if(Strings.isNullOrEmpty(zNodeData))=T -> return null
[PATH2] if(stat == null)=F -> if(Strings.isNullOrEmpty(zNodeData))=F -> return zNodeData
[PATH3] try-body throws -> return null
[PATH4] if(stat... | true | ok | {"focal": {"class": "ZookeeperCRUD", "name": "readZNodeData", "signature": "String readZNodeData(String path)", "start_line": 3, "modifiers": "@VisibleForTesting", "params": [{"name": "path", "type": "String"}], "return_type": "String"}, "class_info": {"name": "ZookeeperCRUD", "kind": "class", "modifiers": "", "supercl... |
63061526_4 | class SettingsTmc implements TmcSettings, Serializable {
@Override
public SystemDefaultRoutePlanner proxy() {
// implement?
return null;
}
public SettingsTmc(String serverAddress, String username, String password);
public SettingsTmc();
public boolean isCheckForExercises();
... | assertEquals(null, settingstmc.proxy());
}
} | [FOCAL] @Override public SystemDefaultRoutePlanner SettingsTmc.proxy()
[CLASS] class SettingsTmc implements TmcSettings, Serializable
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] SettingsTmc(String serverAddress, String username, String password); SettingsTmc(); boolean isCheckFo... | /* static context
[FOCAL] @Override public SystemDefaultRoutePlanner SettingsTmc.proxy()
*/
| /* static context
[FOCAL] @Override public SystemDefaultRoutePlanner SettingsTmc.proxy()
*/
class SettingsTmc implements TmcSettings, Serializable {
@Override
public SystemDefaultRoutePlanner proxy() {
// implement?
return null;
}
public SettingsTmc(String serverAddress, String userna... | true | ok | {"focal": {"class": "SettingsTmc", "name": "proxy", "signature": "SystemDefaultRoutePlanner proxy()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "SystemDefaultRoutePlanner"}, "class_info": {"name": "SettingsTmc", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Tm... |
63085918_54 | class KeywordsProvider implements IKeywordsProvider {
public boolean isKeyword(final String name) {
return this.keywords.contains(name);
}
public KeywordsProvider();
public KeywordsProvider(final String... files);
private void init(final String file);
}
class KeywordsProviderTest {
@Test
public void te... | KeywordsProvider provider = new KeywordsProvider("nonExisting");
Assert.assertFalse(provider.isKeyword("SELECT"));
}
} | [FOCAL] public boolean KeywordsProvider.isKeyword(String name)
[CLASS] class KeywordsProvider implements IKeywordsProvider
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] this.keywords.contains/1
[FIELDS] read=keywords
[INPUTS] branches=- | result=name
[COLLABORATORS] field keyword... | /* static context
[FOCAL] public boolean KeywordsProvider.isKeyword(String name)
[INPUTS] branches=- | result=name
[COLLABORATORS] field keywords contains/1
[FIELDS] read=keywords
[CALLS-EXTERNAL] this.keywords.contains/1
*/
| /* static context
[FOCAL] public boolean KeywordsProvider.isKeyword(String name)
[INPUTS] branches=- | result=name
[COLLABORATORS] field keywords contains/1
[FIELDS] read=keywords
[CALLS-EXTERNAL] this.keywords.contains/1
*/
class KeywordsProvider implements IKeywordsProvider {
public boolean isKeyword(final String n... | true | ok | {"focal": {"class": "KeywordsProvider", "name": "isKeyword", "signature": "boolean isKeyword(String name)", "start_line": 3, "modifiers": "public", "params": [{"name": "name", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "KeywordsProvider", "kind": "class", "modifiers": "", "superclass": null, ... |
63107687_36 | class Set implements LongFunction<java.util.Set<Object>> {
@Example({"Set(HashRange(3,7),Add(15L))", "create a set between 3 and 7 elements of Long values"})
public Set(LongToIntFunction sizeFunc,
LongFunction<Object> valueFunc) {
this.sizeFunc = sizeFunc;
this.valueFunc = valueF... | Set set = new Set(s -> 3, e -> e);
java.util.Set<Object> s1 = set.apply(15L);
assertThat(s1).containsOnly(15L,16L,17L);
}
} | [FOCAL] @Example({"Set(HashRange(3,7),Add(15L))", "create a set between 3 and 7 elements of Long values"}) public Set.Set(LongToIntFunction sizeFunc, LongFunction<Object> valueFunc)
[CLASS] class Set implements LongFunction<java.util.Set<Object>>
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[FIE... | /* static context
[FOCAL] @Example({"Set(HashRange(3,7),Add(15L))", "create a set between 3 and 7 elements of Long values"}) public Set.Set(LongToIntFunction sizeFunc, LongFunction<Object> valueFunc)
[STATE] sizeFunc, valueFunc
[FIELDS] write=sizeFunc, valueFunc
*/
| /* static context
[FOCAL] @Example({"Set(HashRange(3,7),Add(15L))", "create a set between 3 and 7 elements of Long values"}) public Set.Set(LongToIntFunction sizeFunc, LongFunction<Object> valueFunc)
[STATE] sizeFunc, valueFunc
[FIELDS] write=sizeFunc, valueFunc
*/
class Set implements LongFunction<java.util.Set<Object... | true | ok | {"focal": {"class": "Set", "name": "Set", "signature": "Set(LongToIntFunction sizeFunc, LongFunction<Object> valueFunc)", "start_line": 3, "modifiers": "@Example({\"Set(HashRange(3,7),Add(15L))\", \"create a set between 3 and 7 elements of Long values\"}) public", "params": [{"name": "sizeFunc", "type": "LongToIntFunct... |
63135578_3 | class CSVSpecifiedWKTStrategy extends CSVStrategy {
@Override
protected SimpleFeatureType buildFeatureType() {
ISOSimpleFeatureTypeBuilder featureBuilder = createBuilder(csvFileState);
// For WKT strategy, we need to make sure the wktField is recognized as a Geometry
AttributeDescriptor de... | String input = CSVTestStrategySupport.buildInputString("quux,morx\n");
CSVFileState fileState = new CSVFileState(input, "foo");
CSVStrategy strategy = new CSVSpecifiedWKTStrategy(fileState, "quux");
SimpleFeatureType featureType = strategy.getFeatureType();
assertEquals("Invalid ... | [FOCAL] @Override protected SimpleFeatureType CSVSpecifiedWKTStrategy.buildFeatureType()
[CLASS] class CSVSpecifiedWKTStrategy extends CSVStrategy
[METRICS] loc=18 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] createBuilder/1 (inherited), ISOSimpleFeatureTypeBuilder.get/1, ISOAttributeTypeBuilde... | /* static context
[FOCAL] @Override protected SimpleFeatureType CSVSpecifiedWKTStrategy.buildFeatureType()
[PATH1] if(descriptor != null)=T -> return featureBuilder.buildFeatureType()
[PATH2] if(descriptor != null)=F -> return featureBuilder.buildFeatureType()
[COLLABORATORS] field csvFileState getCrs/0
[NEW] ISOAttrib... | /* static context
[FOCAL] @Override protected SimpleFeatureType CSVSpecifiedWKTStrategy.buildFeatureType()
[PATH1] if(descriptor != null)=T -> return featureBuilder.buildFeatureType()
[PATH2] if(descriptor != null)=F -> return featureBuilder.buildFeatureType()
[COLLABORATORS] field csvFileState getCrs/0
[NEW] ISOAttrib... | true | ok | {"focal": {"class": "CSVSpecifiedWKTStrategy", "name": "buildFeatureType", "signature": "SimpleFeatureType buildFeatureType()", "start_line": 3, "modifiers": "@Override protected", "params": [], "return_type": "SimpleFeatureType"}, "class_info": {"name": "CSVSpecifiedWKTStrategy", "kind": "class", "modifiers": "", "sup... |
63251000_28 | class ProcessDefinitionFinder {
public Optional<ProcessDefinition> find(ProcessDefinitionSpec spec) {
ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery();
add(processDefinitionQuery, ProcessDefinitionQuery::processDefinitionKey, spec.getProcessDefinitionKey());
... | ZonedDateTime beforeDeployment = ZonedDateTime.now();
runWithAnotherDeployment(() -> {
DeploymentSpec deploymentSpec = DeploymentSpec.builder()
.earliestDeployment(beforeDeployment)
.latestDeployment(ZonedDateTime.now())
.build();
Optional<ProcessDefinition> processDefiniti... | [FOCAL] public Optional<ProcessDefinition> ProcessDefinitionFinder.find(ProcessDefinitionSpec spec)
[CLASS] class ProcessDefinitionFinder
[METRICS] loc=18 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=2
[CALLS-INTERNAL] Optional<Deployment> findDeployment(DeploymentSpec spec); void add(DeploymentQuery query, BiFun... | /* static context
[FOCAL] public Optional<ProcessDefinition> ProcessDefinitionFinder.find(ProcessDefinitionSpec spec)
[PATH1] if(spec.getDeploymentSpec() != null)=T -> if(!deployment.isPresent())=T -> return Optional.empty()
[PATH2] if(spec.getDeploymentSpec() != null)=F -> return Optional.ofNullable(processDefinitionQ... | /* static context
[FOCAL] public Optional<ProcessDefinition> ProcessDefinitionFinder.find(ProcessDefinitionSpec spec)
[PATH1] if(spec.getDeploymentSpec() != null)=T -> if(!deployment.isPresent())=T -> return Optional.empty()
[PATH2] if(spec.getDeploymentSpec() != null)=F -> return Optional.ofNullable(processDefinitionQ... | true | ok | {"focal": {"class": "ProcessDefinitionFinder", "name": "find", "signature": "Optional<ProcessDefinition> find(ProcessDefinitionSpec spec)", "start_line": 3, "modifiers": "public", "params": [{"name": "spec", "type": "ProcessDefinitionSpec"}], "return_type": "Optional<ProcessDefinition>"}, "class_info": {"name": "Proces... |
63251719_15 | class DockerNode extends AbstractJCloudsNode<DockerCloudProvider> {
@Override
public ExecResult exec(String... command) {
MiscApi api = cloudProvider.getMiscApi();
ExecCreateParams execCreateParams = ExecCreateParams.builder().attachStderr(true).attachStdout(true)
.cmd(Arrays.as... | File srcFile = new File(WORK_DIR, "testCopyToNodeFileToNullTarget");
FileUtils.write(srcFile, "original content");
alpineSshNode.copyFileToNode(srcFile.toPath(), null);
assertEquals("original content",
alpineSshNode.exec("cat", "testCopyToNodeFileToNullTarget").getOutput(... | [FOCAL] @Override public ExecResult DockerNode.exec(String... command)
[CLASS] class DockerNode extends AbstractJCloudsNode<DockerCloudProvider>
[METRICS] loc=31 cc=5 branches=1 loops=1 returns=1 throws=1 nesting=3
[CALLS-EXTERNAL] cloudProvider.getMiscApi/0, ExecCreateParams.builder().attachStderr(true).attachStdou...... | /* static context
[FOCAL] @Override public ExecResult DockerNode.exec(String... command)
[THROWS-WHEN] RuntimeException when try-body throws
[PATH1] while(null != (data = dis.readStdStreamData()))=T -> switch(data.getType())=case OUT -> exit loop -> return new DefaultExecResult(baosOut.toString(StandardCharsets.UTF_8.n... | /* static context
[FOCAL] @Override public ExecResult DockerNode.exec(String... command)
[THROWS-WHEN] RuntimeException when try-body throws
[PATH1] while(null != (data = dis.readStdStreamData()))=T -> switch(data.getType())=case OUT -> exit loop -> return new DefaultExecResult(baosOut.toString(StandardCharsets.UTF_8.n... | true | ok | {"focal": {"class": "DockerNode", "name": "exec", "signature": "ExecResult exec(String... command)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "command", "type": "String..."}], "return_type": "ExecResult"}, "class_info": {"name": "DockerNode", "kind": "class", "modifiers": "", "superclass": ... |
63270256_0 | class SpringVoidRequestHandler extends SpringRequestHandler<I, Void> {
@Override
public Void handleRequest(final I input, final Context context) {
super.handleRequest(input, context);
return null;
}
ApplicationContext mockApplicationContext;
}
class SpringVoidRequestHandlerTest {
... | final RequestHandler handler = mock(RequestHandler.class);
when(mockApplicationContext.getBean(RequestHandler.class)).thenReturn(handler);
final TestSpringVoidRequestHandler testHandler = new TestSpringVoidRequestHandler();
final Context mockContext = mock(Context.class);
final S... | [FOCAL] @Override public Void SpringVoidRequestHandler.handleRequest(I input, Context context)
[CLASS] class SpringVoidRequestHandler extends SpringRequestHandler<I, Void>
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] SpringRequestHandler<I, Void>.handleRequest/2
[DATAFLOW] conte... | /* static context
[FOCAL] @Override public Void SpringVoidRequestHandler.handleRequest(I input, Context context)
[CALLS-EXTERNAL] SpringRequestHandler<I, Void>.handleRequest/2
*/
| /* static context
[FOCAL] @Override public Void SpringVoidRequestHandler.handleRequest(I input, Context context)
[CALLS-EXTERNAL] SpringRequestHandler<I, Void>.handleRequest/2
*/
class SpringVoidRequestHandler extends SpringRequestHandler<I, Void> {
@Override
public Void handleRequest(final I input, final Cont... | true | ok | {"focal": {"class": "SpringVoidRequestHandler", "name": "handleRequest", "signature": "Void handleRequest(I input, Context context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "input", "type": "I"}, {"name": "context", "type": "Context"}], "return_type": "Void"}, "class_info": {"name": "Spri... |
63353944_0 | class ErrorHandler {
public ErrorHandler skipDefaults() {
if (localContext != null) {
localContext.get().skipDefaults = true;
}
return this;
}
private ErrorHandler();
private ErrorHandler(ErrorHandler parentErrorHandler);
public static ErrorHandler createIsol... | ErrorHandler
.create()
.on(FooException.class, (throwable, handler) -> {
actionDelegateMock.action1();
})
.handle(new FooException("foo error"));
Mockito.verify(actionDelegateMock, times(1)).action1();
Mockito.v... | [FOCAL] public ErrorHandler ErrorHandler.skipDefaults()
[CLASS] class ErrorHandler
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] localContext.get/0
[PATH1] if(localContext != null)=T -> return this
[PATH2] if(localContext != null)=F -> return this
[COLLABORATORS] field localConte... | /* static context
[FOCAL] public ErrorHandler ErrorHandler.skipDefaults()
[PATH1] if(localContext != null)=T -> return this
[PATH2] if(localContext != null)=F -> return this
[COLLABORATORS] field localContext get/0
[CALLS-EXTERNAL] localContext.get/0
*/
| /* static context
[FOCAL] public ErrorHandler ErrorHandler.skipDefaults()
[PATH1] if(localContext != null)=T -> return this
[PATH2] if(localContext != null)=F -> return this
[COLLABORATORS] field localContext get/0
[CALLS-EXTERNAL] localContext.get/0
*/
class ErrorHandler {
public ErrorHandler skipDefaults() {
... | true | ok | {"focal": {"class": "ErrorHandler", "name": "skipDefaults", "signature": "ErrorHandler skipDefaults()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "ErrorHandler"}, "class_info": {"name": "ErrorHandler", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name... |
63372616_304 | class NavigableSetTypeReferenceReader implements TypeReferenceReader {
@Override
public boolean test(TypeSupplier<?> typeReference) {
Type type = typeReference.get();
if (ParameterizedType.class.isInstance(type)) {
ParameterizedType parameterizedType = ParameterizedType.class.cast(t... |
assertFalse(referenceReader.test(new TypeReference<SortedSet<Animal>>() {
}));
assertFalse(referenceReader.test(new TypeReference<NavigableSet<Animal>>() {
}));
assertFalse(referenceReader.test(new TypeReference<ArrayList<BigDecimal>>() {
}));
assertFalse(refere... | [FOCAL] @Override public boolean NavigableSetTypeReferenceReader.test(TypeSupplier<?> typeReference)
[CLASS] class NavigableSetTypeReferenceReader implements TypeReferenceReader
[METRICS] loc=19 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] TypeSupplier<?>.get/0, ParameterizedType.class.isInstan... | /* static context
[FOCAL] @Override public boolean NavigableSetTypeReferenceReader.test(TypeSupplier<?> typeReference)
[PATH1] if(ParameterizedType.class.isInstance(type))=T -> return isNavigableSet && isElementCompatible
[PATH2] if(ParameterizedType.class.isInstance(type))=F -> return false
[INPUTS] branches=typeRefer... | /* static context
[FOCAL] @Override public boolean NavigableSetTypeReferenceReader.test(TypeSupplier<?> typeReference)
[PATH1] if(ParameterizedType.class.isInstance(type))=T -> return isNavigableSet && isElementCompatible
[PATH2] if(ParameterizedType.class.isInstance(type))=F -> return false
[INPUTS] branches=typeRefer... | true | ok | {"focal": {"class": "NavigableSetTypeReferenceReader", "name": "test", "signature": "boolean test(TypeSupplier<?> typeReference)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "typeReference", "type": "TypeSupplier<?>"}], "return_type": "boolean"}, "class_info": {"name": "NavigableSetTypeRefere... |
63380093_0 | class Indexer {
public void index(File sourceCodeDirectory) throws IOException {
System.out.println("Indexing source code in " + sourceCodeDirectory.getAbsolutePath() + " into " + getDatabasePath(databaseDirectory));
databaseInitializer.initDatabase();
Collection<File> files = listFiles(so... | indexer.index(sourceCodeDirectory);
assertThat(count("class")).isEqualTo(2);
assertThat(count("interface")).isEqualTo(2);
assertThat(count("annotation")).isEqualTo(1);
assertThat(count("enumeration")).isEqualTo(1);
assertThat(count("field")).isEqualTo(3);
assertT... | [FOCAL] public void Indexer.index(File sourceCodeDirectory)
[CLASS] class Indexer
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] System.out.println/1, File.getAbsolutePath/0, getDatabasePath/1 (inherited), databaseInitializer.initDatabase/0, listFiles/3 (inherited), entityIndexer.... | /* static context
[FOCAL] public void Indexer.index(File sourceCodeDirectory)
[COLLABORATORS] param sourceCodeDirectory:File getAbsolutePath/0; field databaseInitializer initDatabase/0; field entityIndexer indexFiles/1; field relationCalculator calculateRelations/1
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] Sys... | /* static context
[FOCAL] public void Indexer.index(File sourceCodeDirectory)
[COLLABORATORS] param sourceCodeDirectory:File getAbsolutePath/0; field databaseInitializer initDatabase/0; field entityIndexer indexFiles/1; field relationCalculator calculateRelations/1
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] Sys... | true | ok | {"focal": {"class": "Indexer", "name": "index", "signature": "void index(File sourceCodeDirectory) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "sourceCodeDirectory", "type": "File"}], "return_type": "void"}, "class_info": {"name": "Indexer", "kind": "class", "modifiers": "", "superc... |
63394793_9 | class BaseHelper implements GoogleApiClient.ConnectionCallbacks,
GoogleApiClient.OnConnectionFailedListener {
@Override
public void onConnectionSuspended(int i) {
// Method's body left empty as we deem it's the best behavior.
//
// http://stackoverflow.com/a/27350444/972721
... | baseHelper.onConnectionSuspended(0);
Assert.assertEquals(0, baseHelper.onLocationPermissionsGrantedCount[0]);
Assert.assertEquals(0, baseHelper.onGooglePlayServicesDisconnectingCount[0]);
}
} | [FOCAL] @Override public void BaseHelper.onConnectionSuspended(int i)
[CLASS] class BaseHelper implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener
[METRICS] loc=18 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[INPUTS] branches=- | result=- | unused=i
[CLASS-MEMBERS] BaseHe... | /* static context
[FOCAL] @Override public void BaseHelper.onConnectionSuspended(int i)
[INPUTS] branches=- | result=- | unused=i
*/
| /* static context
[FOCAL] @Override public void BaseHelper.onConnectionSuspended(int i)
[INPUTS] branches=- | result=- | unused=i
*/
class BaseHelper implements GoogleApiClient.ConnectionCallbacks,
GoogleApiClient.OnConnectionFailedListener {
@Override
public void onConnectionSuspended(int i) {
... | true | ok | {"focal": {"class": "BaseHelper", "name": "onConnectionSuspended", "signature": "void onConnectionSuspended(int i)", "start_line": 4, "modifiers": "@Override public", "params": [{"name": "i", "type": "int"}], "return_type": "void"}, "class_info": {"name": "BaseHelper", "kind": "class", "modifiers": "", "superclass": nu... |
63452341_16 | class TickerCharacterList {
CharacterIndices getCharacterIndices(char start, char end, TickerView.ScrollingDirection direction) {
int startIndex = getIndexOfChar(start);
int endIndex = getIndexOfChar(end);
if (startIndex < 0 || endIndex < 0) {
return null;
}
sw... | final TickerCharacterList list = new TickerCharacterList("012");
final TickerCharacterList.CharacterIndices indices = list.getCharacterIndices('0', '2', TickerView.ScrollingDirection.ANY);
assertEquals(4, indices.startIndex);
assertEquals(3, indices.endIndex);
}
} | [FOCAL] CharacterIndices TickerCharacterList.getCharacterIndices(char start, char end, TickerView.ScrollingDirection direction)
[CLASS] class TickerCharacterList
[METRICS] loc=48 cc=13 branches=10 loops=0 returns=2 throws=0 nesting=5
[CALLS-INTERNAL] int getIndexOfChar(char c)
[NEW] CharacterIndices
[PATH1] if(startInd... | /* static context
[FOCAL] CharacterIndices TickerCharacterList.getCharacterIndices(char start, char end, TickerView.ScrollingDirection direction)
[PATH1] if(startIndex < 0 || endIndex < 0)=F -> switch(direction)=case ANY -> if(start != TickerUtils.EMPTY_CHAR && end != TickerUtils.EMPTY_CHAR)=T -> if(endIndex < startInd... | /* static context
[FOCAL] CharacterIndices TickerCharacterList.getCharacterIndices(char start, char end, TickerView.ScrollingDirection direction)
[PATH1] if(startIndex < 0 || endIndex < 0)=F -> switch(direction)=case ANY -> if(start != TickerUtils.EMPTY_CHAR && end != TickerUtils.EMPTY_CHAR)=T -> if(endIndex < startInd... | true | ok | {"focal": {"class": "TickerCharacterList", "name": "getCharacterIndices", "signature": "CharacterIndices getCharacterIndices(char start, char end, TickerView.ScrollingDirection direction)", "start_line": 3, "modifiers": "", "params": [{"name": "start", "type": "char"}, {"name": "end", "type": "char"}, {"name": "directi... |
63468727_7 | class City extends ExceptStoredHolder {
@Slow
public Collection<Island> disclaim(@NotNull ChunkPos chunk, boolean createIslands)
throws IllegalStateException, IllegalArgumentException, DataSourceException
{
if(invalid)
throw new IllegalStateException();
if(islands.s... | BlockPos spawn = new BlockPos(test.overWorld, 200,64,100);
ChunkPos spawnChunk = spawn.getChunk();
City city = new City(test.mineCity, "Disclaim", test.joserobjr, spawn, 0);
Island spawnIsland = city.islands().iterator().next();
assertThrown(()-> city.disclaim(spawnChunk, false)... | [FOCAL] @Slow public Collection<Island> City.disclaim(ChunkPos chunk, boolean createIslands)
[CLASS] class City extends ExceptStoredHolder
[METRICS] loc=60 cc=9 branches=8 loops=0 returns=4 throws=5 nesting=3
[CALLS-INTERNAL] BlockPos getSpawn(); Stream<Entry<Direction, Island>> connectedIslandsEntries(ChunkPos chunk);... | class City extends ExceptStoredHolder {
@Slow
public Collection<Island> disclaim(@NotNull ChunkPos chunk, boolean createIslands)
throws IllegalStateException, IllegalArgumentException, DataSourceException
{
if(invalid)
throw new IllegalStateException();
if(islands.s... | false | ok | {"focal": {"class": "City", "name": "disclaim", "signature": "Collection<Island> disclaim(ChunkPos chunk, boolean createIslands) throws IllegalStateException, IllegalArgumentException, DataSourceException", "start_line": 3, "modifiers": "@Slow public", "params": [{"name": "chunk", "type": "ChunkPos"}, {"name": "createI... | |
63481746_1 | class BurgersViewModel {
@NonNull
public Observable<Bun> getBunStream() {
return mDataModel.getBunStream();
}
public BurgersViewModel(@NonNull final DataModel dataModel);
@NonNull public Observable<TomatoSlice> getTomatoSliceStream();
@NonNull public Observable<Meat> getMeatStream();... | ArrangeBuilder builder = new ArrangeBuilder();
TestSubscriber<Bun> testSubscriber = new TestSubscriber<>();
mViewModel.getBunStream().subscribe(testSubscriber);
builder.withBun(BUN);
testSubscriber.assertNoErrors();
testSubscriber.assertValue(BUN);
}
} | [FOCAL] @NonNull public Observable<Bun> BurgersViewModel.getBunStream()
[CLASS] class BurgersViewModel
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] DataModel.getBunStream/0
[FIELDS] read=mDataModel:DataModel
[INPUTS] branches=- | result=mDataModel
[COLLABORATORS] field mDataMode... | /* static context
[FOCAL] @NonNull public Observable<Bun> BurgersViewModel.getBunStream()
[INPUTS] branches=- | result=mDataModel
[COLLABORATORS] field mDataModel:DataModel getBunStream/0
[FIELDS] read=mDataModel:DataModel
[CALLS-EXTERNAL] DataModel.getBunStream/0
*/
| /* static context
[FOCAL] @NonNull public Observable<Bun> BurgersViewModel.getBunStream()
[INPUTS] branches=- | result=mDataModel
[COLLABORATORS] field mDataModel:DataModel getBunStream/0
[FIELDS] read=mDataModel:DataModel
[CALLS-EXTERNAL] DataModel.getBunStream/0
*/
class BurgersViewModel {
@NonNull
public Ob... | true | ok | {"focal": {"class": "BurgersViewModel", "name": "getBunStream", "signature": "Observable<Bun> getBunStream()", "start_line": 3, "modifiers": "@NonNull public", "params": [], "return_type": "Observable<Bun>"}, "class_info": {"name": "BurgersViewModel", "kind": "class", "modifiers": "", "superclass": null, "interfaces": ... |
63499588_6 | class MorseRecord extends AlexaStateModel {
public void setOverallHighscorer(final String overallHighscorer) {
this.overallHighscorer = overallHighscorer;
}
public Integer getOverallHighscore();
public void setOverallHighscore(final Integer score);
public String getOverallHighscorer();
... | final String highscorer = "Bob";
record.setOverallHighscorer(highscorer);
assertEquals(highscorer, record.getOverallHighscorer());
}
} | [FOCAL] public void MorseRecord.setOverallHighscorer(String overallHighscorer)
[CLASS] class MorseRecord extends AlexaStateModel
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[FIELDS] write=overallHighscorer
[STATE] overallHighscorer via getOverallHighscorer()
[DATAFLOW] overallHighscorer@param->... | /* static context
[FOCAL] public void MorseRecord.setOverallHighscorer(String overallHighscorer)
[STATE] overallHighscorer via getOverallHighscorer()
[FIELDS] write=overallHighscorer
*/
| /* static context
[FOCAL] public void MorseRecord.setOverallHighscorer(String overallHighscorer)
[STATE] overallHighscorer via getOverallHighscorer()
[FIELDS] write=overallHighscorer
*/
class MorseRecord extends AlexaStateModel {
public void setOverallHighscorer(final String overallHighscorer) {
this.overa... | true | ok | {"focal": {"class": "MorseRecord", "name": "setOverallHighscorer", "signature": "void setOverallHighscorer(String overallHighscorer)", "start_line": 3, "modifiers": "public", "params": [{"name": "overallHighscorer", "type": "String"}], "return_type": "void"}, "class_info": {"name": "MorseRecord", "kind": "class", "modi... |
63527700_1 | class TimeViewModel {
public String formattedTime() {
return formatWithPadding(time.hour()) + COLON +
formatWithPadding(time.minutes());
}
public TimeViewModel(Time time);
public String formattedDate();
private String format(String pattern);
private String formatWithP... | Time time = Mockito.mock(Time.class);
Mockito.when(time.hour()).thenReturn(10);
Mockito.when(time.minutes()).thenReturn(37);
Mockito.when(time.seconds()).thenReturn(24);
TimeViewModel timeViewModel = new TimeViewModel(time);
String expectedFormattedTime = "10:37";
... | [FOCAL] public String TimeViewModel.formattedTime()
[CLASS] class TimeViewModel
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String formatWithPadding(int hour)
[CALLS-EXTERNAL] time.hour/0, time.minutes/0
[COLLABORATORS] field time hour/0,minutes/0
[CLASS-MEMBERS] TimeViewModel(... | /* static context
[FOCAL] public String TimeViewModel.formattedTime()
[COLLABORATORS] field time hour/0,minutes/0
[CALLS-INTERNAL] String formatWithPadding(int hour)
[CALLS-EXTERNAL] time.hour/0, time.minutes/0
*/
| /* static context
[FOCAL] public String TimeViewModel.formattedTime()
[COLLABORATORS] field time hour/0,minutes/0
[CALLS-INTERNAL] String formatWithPadding(int hour)
[CALLS-EXTERNAL] time.hour/0, time.minutes/0
*/
class TimeViewModel {
public String formattedTime() {
return formatWithPadding(time.hour()) +... | true | ok | {"focal": {"class": "TimeViewModel", "name": "formattedTime", "signature": "String formattedTime()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "TimeViewModel", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "cale... |
63534520_26 | class Project implements TypeIdentifiable {
@XmlElement
public Date getCreated() {
return created;
}
public Project();
protected Project(Project projectDto);
@XmlElement public String getId();
public void setId(String id);
@XmlElement public String getName();
public void... | final Date date = new Date();
final Project project = new Project();
project.setCreated(date);
Assert.assertEquals(date, project.getCreated());
}
} | [FOCAL] @XmlElement public Date Project.getCreated()
[CLASS] class Project implements TypeIdentifiable
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] Project(); Project(Project projectDto); String getId(); void setId(String id); String getName(); void setName(String name); Date get... | /* static context
[FOCAL] @XmlElement public Date Project.getCreated()
*/
| /* static context
[FOCAL] @XmlElement public Date Project.getCreated()
*/
class Project implements TypeIdentifiable {
@XmlElement
public Date getCreated() {
return created;
}
public Project();
protected Project(Project projectDto);
@XmlElement public String getId();
public void ... | true | ok | {"focal": {"class": "Project", "name": "getCreated", "signature": "Date getCreated()", "start_line": 3, "modifiers": "@XmlElement public", "params": [], "return_type": "Date"}, "class_info": {"name": "Project", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "TypeIdentifiable", "fields": [], "member... |
63553502_20 | class XmlUtils {
@Nonnull
public static String getPathInWorkspace(@Nonnull final String absoluteFilePath, @Nonnull FilePath workspace) {
boolean windows = FileUtils.isWindows(workspace);
final String workspaceRemote = workspace.getRemote();
String sanitizedAbsoluteFilePath;
St... | String workspace = "C:\\path\\to\\spring-petclinic\\";
String absolutePath = "C:\\path\\to\\spring-petclinic\\pom.xml";
String actual = XmlUtils.getPathInWorkspace(absolutePath, new FilePath(new File(workspace)));
String expected = "pom.xml";
assertThat(actual, is(expected));
... | [FOCAL] @Nonnull public static String XmlUtils.getPathInWorkspace(String absoluteFilePath, FilePath workspace)
[CLASS] class XmlUtils
[METRICS] loc=49 cc=7 branches=6 loops=0 returns=1 throws=1 nesting=3
[CALLS-EXTERNAL] FileUtils.isWindows/1, FilePath.getRemote/0, String.replace/2, String.startsWith/1, String.substrin... | /* static context
[FOCAL] @Nonnull public static String XmlUtils.getPathInWorkspace(String absoluteFilePath, FilePath workspace)
[THROWS-WHEN] IllegalArgumentException when windows && !StringUtils.startsWithIgnoreCase(sanitizedAbsoluteFilePath, sanitizedWorkspaceRemote) && !(sanitizedWorkspaceRemote.contains("/workspac... | /* static context
[FOCAL] @Nonnull public static String XmlUtils.getPathInWorkspace(String absoluteFilePath, FilePath workspace)
[THROWS-WHEN] IllegalArgumentException when windows && !StringUtils.startsWithIgnoreCase(sanitizedAbsoluteFilePath, sanitizedWorkspaceRemote) && !(sanitizedWorkspaceRemote.contains("/workspac... | true | ok | {"focal": {"class": "XmlUtils", "name": "getPathInWorkspace", "signature": "String getPathInWorkspace(String absoluteFilePath, FilePath workspace)", "start_line": 3, "modifiers": "@Nonnull public static", "params": [{"name": "absoluteFilePath", "type": "String"}, {"name": "workspace", "type": "FilePath"}], "return_type... |
63689332_0 | class SimulationTreeTableToModelConverter {
public BPMNProcess convertTreeToModel(final EventTree<Object> tree) {
this.tree = tree;
final BPMNStartEvent startEvent = new BPMNStartEvent(this.createID(), "Start", null);
this.process.addBPMNElement(startEvent);
final BPMNEndEvent endEvent = new BPMNEndEvent(this... | final SimulationTreeTableToModelConverter converter = new SimulationTreeTableToModelConverter();
final BPMNProcess process = converter.convertTreeToModel(this.tree);
Assert.assertTrue("Should be 14, but was " + process.getBPMNElementsWithOutSequenceFlows().size(), process.getBPMNElementsWithOutSequenceFlows().siz... | [FOCAL] public BPMNProcess SimulationTreeTableToModelConverter.convertTreeToModel(EventTree<Object> tree)
[CLASS] class SimulationTreeTableToModelConverter
[METRICS] loc=14 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String createID(); Tuple<AbstractBPMNElement, AbstractBPMNElement> createSubB... | /* static context
[FOCAL] public BPMNProcess SimulationTreeTableToModelConverter.convertTreeToModel(EventTree<Object> tree)
[COLLABORATORS] field process addBPMNElement/1; field bpmnTree getRootElements/0
[STATE] tree
[CALLS-INTERNAL] String createID(); Tuple<AbstractBPMNElement, AbstractBPMNElement> createSubBranch(Ab... | /* static context
[FOCAL] public BPMNProcess SimulationTreeTableToModelConverter.convertTreeToModel(EventTree<Object> tree)
[COLLABORATORS] field process addBPMNElement/1; field bpmnTree getRootElements/0
[STATE] tree
[CALLS-INTERNAL] String createID(); Tuple<AbstractBPMNElement, AbstractBPMNElement> createSubBranch(Ab... | true | ok | {"focal": {"class": "SimulationTreeTableToModelConverter", "name": "convertTreeToModel", "signature": "BPMNProcess convertTreeToModel(EventTree<Object> tree)", "start_line": 3, "modifiers": "public", "params": [{"name": "tree", "type": "EventTree<Object>"}], "return_type": "BPMNProcess"}, "class_info": {"name": "Simula... |
63693352_17 | class MongoUserDetailsService implements UserDetailsService {
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
User user = repository.findOne(username);
if (user == null) {
throw new UsernameNotFoundException(username);
}
return user;
}
@InjectMocks... |
final User user = new User();
when(repository.findOne(any())).thenReturn(user);
UserDetails loaded = service.loadUserByUsername("name");
assertEquals(user, loaded);
}
} | [FOCAL] @Override public UserDetails MongoUserDetailsService.loadUserByUsername(String username)
[CLASS] class MongoUserDetailsService implements UserDetailsService
[METRICS] loc=11 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] UserRepository.findOne/1
[NEW] UsernameNotFoundException
[FIELDS] re... | /* static context
[FOCAL] @Override public UserDetails MongoUserDetailsService.loadUserByUsername(String username)
[THROWS-WHEN] UsernameNotFoundException when user == null
[PATH1] if(user == null)=T -> throw new UsernameNotFoundException(username)
[PATH2] if(user == null)=F -> return user
[INPUTS] branches=username, r... | /* static context
[FOCAL] @Override public UserDetails MongoUserDetailsService.loadUserByUsername(String username)
[THROWS-WHEN] UsernameNotFoundException when user == null
[PATH1] if(user == null)=T -> throw new UsernameNotFoundException(username)
[PATH2] if(user == null)=F -> return user
[INPUTS] branches=username, r... | true | ok | {"focal": {"class": "MongoUserDetailsService", "name": "loadUserByUsername", "signature": "UserDetails loadUserByUsername(String username) throws UsernameNotFoundException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "username", "type": "String"}], "return_type": "UserDetails"}, "class_info":... |
63707572_2 | class InstanceService {
public static Set<Instance> getInstances(final Context context) {
if (!SystemResolver.get().isReadCalendarPermitted(context)) {
return new HashSet<>();
}
return readAllInstances(context);
}
static Set<Instance> readAllInstances(final Context con... | when(systemResolver.isReadCalendarPermitted(context)).thenReturn(false);
Set<Instance> instances = getInstances(context);
assertTrue(instances.isEmpty());
}
} | [FOCAL] public static Set<Instance> InstanceService.getInstances(Context context)
[CLASS] class InstanceService
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] Set<Instance> readAllInstances(Context context)
[CALLS-EXTERNAL] SystemResolver.get().isReadCalendarPermitted/1, SystemRes... | /* static context
[FOCAL] public static Set<Instance> InstanceService.getInstances(Context context)
[PATH1] if(!SystemResolver.get().isReadCalendarPermitted(context))=T -> return new HashSet<>()
[PATH2] if(!SystemResolver.get().isReadCalendarPermitted(context))=F -> return readAllInstances(context)
[INPUTS] branches=co... | /* static context
[FOCAL] public static Set<Instance> InstanceService.getInstances(Context context)
[PATH1] if(!SystemResolver.get().isReadCalendarPermitted(context))=T -> return new HashSet<>()
[PATH2] if(!SystemResolver.get().isReadCalendarPermitted(context))=F -> return readAllInstances(context)
[INPUTS] branches=co... | true | ok | {"focal": {"class": "InstanceService", "name": "getInstances", "signature": "Set<Instance> getInstances(Context context)", "start_line": 3, "modifiers": "public static", "params": [{"name": "context", "type": "Context"}], "return_type": "Set<Instance>"}, "class_info": {"name": "InstanceService", "kind": "class", "modif... |
63749548_5 | class ClientBuilder implements Cloneable {
public Collection<URI> endpoints() {
return Collections.unmodifiableCollection(this.endpoints);
}
ClientBuilder();
public ClientBuilder endpoints(Collection<URI> endpoints);
public ClientBuilder endpoints(URI... endpoints);
public ClientBui... | // test default namespace setting
final ClientBuilder builder = Client.builder().endpoints(new URI("http://127.0.0.1:2379"));
final ClientConnectionManager connectionManager = new ClientConnectionManager(builder);
assertThat(connectionManager.getNamespace()).isEqualTo(ByteSequence.EMPTY)... | [FOCAL] public Collection<URI> ClientBuilder.endpoints()
[CLASS] class ClientBuilder implements Cloneable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Collections.unmodifiableCollection/1
[FIELDS] read=endpoints
[CLASS-MEMBERS] ClientBuilder(); ClientBuilder endpoints(Collection... | /* static context
[FOCAL] public Collection<URI> ClientBuilder.endpoints()
[FIELDS] read=endpoints
[CALLS-EXTERNAL] Collections.unmodifiableCollection/1
*/
| /* static context
[FOCAL] public Collection<URI> ClientBuilder.endpoints()
[FIELDS] read=endpoints
[CALLS-EXTERNAL] Collections.unmodifiableCollection/1
*/
class ClientBuilder implements Cloneable {
public Collection<URI> endpoints() {
return Collections.unmodifiableCollection(this.endpoints);
}
... | true | ok | {"focal": {"class": "ClientBuilder", "name": "endpoints", "signature": "Collection<URI> endpoints()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Collection<URI>"}, "class_info": {"name": "ClientBuilder", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Cloneable", "fields"... |
63796401_11 | class WeeklyPaymentSchedule extends PaymentSchedule {
@Override
public boolean isPayDate(LocalDate date) {
return isDayOfWeek(date, PAYDAY_DAY_OF_WEEK);
}
@Override public DateInterval getPayIntervalForValidatedPayDate(LocalDate intervalEndDate);
@Override public LocalDate getSameOrNextPayDate(LocalDate refere... | assertThat(weeklyPaymentSchedule.isPayDate(THIS_MONDAY), is(false));
assertThat(weeklyPaymentSchedule.isPayDate(PREV_SATURDAY), is(false));
}
} | [FOCAL] @Override public boolean WeeklyPaymentSchedule.isPayDate(LocalDate date)
[CLASS] class WeeklyPaymentSchedule extends PaymentSchedule
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] boolean isDayOfWeek(LocalDate date, DayOfWeek dayOfWeek)
[INPUTS] branches=- | result=date
[D... | /* static context
[FOCAL] @Override public boolean WeeklyPaymentSchedule.isPayDate(LocalDate date)
[INPUTS] branches=- | result=date
[CALLS-INTERNAL] boolean isDayOfWeek(LocalDate date, DayOfWeek dayOfWeek)
*/
| /* static context
[FOCAL] @Override public boolean WeeklyPaymentSchedule.isPayDate(LocalDate date)
[INPUTS] branches=- | result=date
[CALLS-INTERNAL] boolean isDayOfWeek(LocalDate date, DayOfWeek dayOfWeek)
*/
class WeeklyPaymentSchedule extends PaymentSchedule {
@Override
public boolean isPayDate(LocalDate date) {
... | true | ok | {"focal": {"class": "WeeklyPaymentSchedule", "name": "isPayDate", "signature": "boolean isPayDate(LocalDate date)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "date", "type": "LocalDate"}], "return_type": "boolean"}, "class_info": {"name": "WeeklyPaymentSchedule", "kind": "class", "modifiers"... |
63800550_0 | class JmsSendingMessageHandlerFactory implements ApplicationContextAware, BeanFactoryAware {
public PartitionAwareJmsSendingMessageHandler build(TopicPartitionRegistrar destinations) {
template.setPubSubDomain(true);
PartitionAwareJmsSendingMessageHandler handler = new PartitionAwareJmsSendingMessageHandler(
... | PartitionAwareJmsSendingMessageHandler handler = target.build(TOPIC_PARTITION_REGISTRAR);
assertThat(ReflectionTestUtils.getField(handler, "jmsTemplate"), Matchers.<Object>is(jmsTemplate));
}
} | [FOCAL] public PartitionAwareJmsSendingMessageHandler JmsSendingMessageHandlerFactory.build(TopicPartitionRegistrar destinations)
[CLASS] class JmsSendingMessageHandlerFactory implements ApplicationContextAware, BeanFactoryAware
[METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] temp... | /* static context
[FOCAL] public PartitionAwareJmsSendingMessageHandler JmsSendingMessageHandlerFactory.build(TopicPartitionRegistrar destinations)
[INPUTS] branches=- | result=destinations
[COLLABORATORS] field template setPubSubDomain/1
[FIELDS] read=applicationContext:ApplicationContext, beanFactory:BeanFactory, tem... | /* static context
[FOCAL] public PartitionAwareJmsSendingMessageHandler JmsSendingMessageHandlerFactory.build(TopicPartitionRegistrar destinations)
[INPUTS] branches=- | result=destinations
[COLLABORATORS] field template setPubSubDomain/1
[FIELDS] read=applicationContext:ApplicationContext, beanFactory:BeanFactory, tem... | true | ok | {"focal": {"class": "JmsSendingMessageHandlerFactory", "name": "build", "signature": "PartitionAwareJmsSendingMessageHandler build(TopicPartitionRegistrar destinations)", "start_line": 3, "modifiers": "public", "params": [{"name": "destinations", "type": "TopicPartitionRegistrar"}], "return_type": "PartitionAwareJmsSen... |
63837927_17 | class AWSS3BuildProcessAdapter extends BuildProcessAdapter {
public boolean runProcess() {
final AgentRunnerBuildParametersModel model = helper.createModel(runnerParametersMap);
AmazonS3 s3Client = createClient(model.getPublicKey(), model.getPrivateKey(), model.getBucketRegion(), model.getHttpProx... | final String bucketName = "someName";
final String bucketRegion = "someRegion";
final String uploadTaskLogBucket = uploadTaskLog + bucketName;
final String desiredArtifactPaths = "src,examples/subfolder";
final String sourcePath = "src";
final String destinationPath = sou... | [FOCAL] public boolean AWSS3BuildProcessAdapter.runProcess()
[CLASS] class AWSS3BuildProcessAdapter extends BuildProcessAdapter
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] AmazonS3 createClient(String publicKey, String privateKey, String region, String httpProxy); void emptyBu... | /* static context
[FOCAL] public boolean AWSS3BuildProcessAdapter.runProcess()
[COLLABORATORS] field helper createModel/1
[CALLS-INTERNAL] AmazonS3 createClient(String publicKey, String privateKey, String region, String httpProxy); void emptyBucketIfNeeded(String bucketName, AmazonS3 s3Client, boolean emptyBucket); voi... | /* static context
[FOCAL] public boolean AWSS3BuildProcessAdapter.runProcess()
[COLLABORATORS] field helper createModel/1
[CALLS-INTERNAL] AmazonS3 createClient(String publicKey, String privateKey, String region, String httpProxy); void emptyBucketIfNeeded(String bucketName, AmazonS3 s3Client, boolean emptyBucket); voi... | true | ok | {"focal": {"class": "AWSS3BuildProcessAdapter", "name": "runProcess", "signature": "boolean runProcess()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "AWSS3BuildProcessAdapter", "kind": "class", "modifiers": "", "superclass": "BuildProcessAdapter", "interface... |
63894475_22 | class BaseRESTServiceJavaDelegate implements JavaDelegate {
void updateDataKeyVariable(DelegateExecution delegateExecution, ResponseEntity<Object> serviceResponse) {
Object value = null;
if (serviceResponse != null)
value = serviceResponse.getBody();
setProcessVariable(delegateE... | final ResponseEntity<Object> responseEntity = mock(ResponseEntity.class);
given(responseEntity.getBody()).willReturn("foo");
doThrow(RuntimeException.class).when(delegateExecution).setVariable(eq(BaseRESTServiceJavaDelegate.DATA_KEY), isNotNull());
try {
baseDelegate.updateDa... | [FOCAL] void BaseRESTServiceJavaDelegate.updateDataKeyVariable(DelegateExecution delegateExecution, ResponseEntity<Object> serviceResponse)
[CLASS] class BaseRESTServiceJavaDelegate implements JavaDelegate
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] void setProcessVariable(Dele... | /* static context
[FOCAL] void BaseRESTServiceJavaDelegate.updateDataKeyVariable(DelegateExecution delegateExecution, ResponseEntity<Object> serviceResponse)
[PATH1] if(serviceResponse != null)=T
[PATH2] if(serviceResponse != null)=F
[INPUTS] branches=serviceResponse | result=-
[COLLABORATORS] param serviceResponse:Res... | /* static context
[FOCAL] void BaseRESTServiceJavaDelegate.updateDataKeyVariable(DelegateExecution delegateExecution, ResponseEntity<Object> serviceResponse)
[PATH1] if(serviceResponse != null)=T
[PATH2] if(serviceResponse != null)=F
[INPUTS] branches=serviceResponse | result=-
[COLLABORATORS] param serviceResponse:Res... | true | ok | {"focal": {"class": "BaseRESTServiceJavaDelegate", "name": "updateDataKeyVariable", "signature": "void updateDataKeyVariable(DelegateExecution delegateExecution, ResponseEntity<Object> serviceResponse)", "start_line": 3, "modifiers": "", "params": [{"name": "delegateExecution", "type": "DelegateExecution"}, {"name": "s... |
63895649_23 | class MetaUtils {
static public boolean containsHyperlink(String s)
{
return startsWithNetworkProtocol(s) || HYPERLINK.matcher(s).find();
}
private MetaUtils();
static public boolean startsWithNetworkProtocol(String s);
static public boolean endsWithFileExtension(String s);
}
class MetaUtilsTest {
@Test... | String s;
s = "http://www.clearnlp.com";
assertTrue(MetaUtils.containsHyperlink(s));
s = "https://www-01.clearnlp.com";
assertTrue(MetaUtils.containsHyperlink(s));
s = "www.clearnlp.com";
assertTrue(MetaUtils.containsHyperlink(s));
s = "wiki.clearnlp.com";
assertTrue(MetaUtils.containsHype... | [FOCAL] static public boolean MetaUtils.containsHyperlink(String s)
[CLASS] class MetaUtils
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] boolean startsWithNetworkProtocol(String s)
[CALLS-EXTERNAL] HYPERLINK.matcher(s).find/0, HYPERLINK.matcher/1
[INPUTS] branches=- | result=s
[... | /* static context
[FOCAL] static public boolean MetaUtils.containsHyperlink(String s)
[INPUTS] branches=- | result=s
[CALLS-INTERNAL] boolean startsWithNetworkProtocol(String s)
[CALLS-EXTERNAL] HYPERLINK.matcher(s).find/0, HYPERLINK.matcher/1
*/
| /* static context
[FOCAL] static public boolean MetaUtils.containsHyperlink(String s)
[INPUTS] branches=- | result=s
[CALLS-INTERNAL] boolean startsWithNetworkProtocol(String s)
[CALLS-EXTERNAL] HYPERLINK.matcher(s).find/0, HYPERLINK.matcher/1
*/
class MetaUtils {
static public boolean containsHyperlink(String s)
{
... | true | ok | {"focal": {"class": "MetaUtils", "name": "containsHyperlink", "signature": "boolean containsHyperlink(String s)", "start_line": 3, "modifiers": "static public", "params": [{"name": "s", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "MetaUtils", "kind": "class", "modifiers": "", "superclass": nul... |
63898559_0 | class TemplatePlugin implements Plugin {
public PluginMessageHandlingResult onCommand(Command command) {
if (command.getCommand().equalsIgnoreCase("template")) {
if (Objects.equals(command.getArgs().get(0), "topic")) {
final String template = command.getArgs().subList(1, command... | tester.getPublicVariables().onNext(new PublicVariables(ImmutableMap.of("foo.oof", "bar")));
tester.test(plugin -> plugin.onCommand(Command.of("/bot template topic hello ${foo.oof} rocks")));
assertThat(tester.getRoomApi().getLastTopic(), is("hello bar rocks"));
tester.getPublicVariables... | [FOCAL] public PluginMessageHandlingResult TemplatePlugin.onCommand(Command command)
[CLASS] class TemplatePlugin implements Plugin
[METRICS] loc=14 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] command.getCommand().equalsIgnoreCase/1, Command.getCommand/0, Objects.equals/2, command.getArgs().ge... | /* static context
[FOCAL] public PluginMessageHandlingResult TemplatePlugin.onCommand(Command command)
[PATH1] if(command.getCommand().equalsIgnoreCase("template"))=T -> if(Objects.equals(command.getArgs().get(0), "topic"))=T -> return SUCCESS
[PATH2] if(command.getCommand().equalsIgnoreCase("template"))=F -> return FA... | /* static context
[FOCAL] public PluginMessageHandlingResult TemplatePlugin.onCommand(Command command)
[PATH1] if(command.getCommand().equalsIgnoreCase("template"))=T -> if(Objects.equals(command.getArgs().get(0), "topic"))=T -> return SUCCESS
[PATH2] if(command.getCommand().equalsIgnoreCase("template"))=F -> return FA... | true | ok | {"focal": {"class": "TemplatePlugin", "name": "onCommand", "signature": "PluginMessageHandlingResult onCommand(Command command)", "start_line": 3, "modifiers": "public", "params": [{"name": "command", "type": "Command"}], "return_type": "PluginMessageHandlingResult"}, "class_info": {"name": "TemplatePlugin", "kind": "c... |
63931184_186 | class DistributedLogManagerImpl implements DistributedLogManager {
@Override
public AppendOnlyStreamWriter getAppendOnlyStreamWriter() throws IOException {
return impl.getAppendOnlyStreamWriter();
}
public DistributedLogManagerImpl(org.apache.distributedlog.api.DistributedLogManager impl);
... | AppendOnlyStreamWriter writer = mock(AppendOnlyStreamWriter.class);
when(impl.getAppendOnlyStreamWriter()).thenReturn(writer);
assertEquals(writer, manager.getAppendOnlyStreamWriter());
verify(impl, times(1)).getAppendOnlyStreamWriter();
}
} | [FOCAL] @Override public AppendOnlyStreamWriter DistributedLogManagerImpl.getAppendOnlyStreamWriter()
[CLASS] class DistributedLogManagerImpl implements DistributedLogManager
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] org.apache.distributedlog.api.DistributedLogManager.getAppe... | /* static context
[FOCAL] @Override public AppendOnlyStreamWriter DistributedLogManagerImpl.getAppendOnlyStreamWriter()
[INPUTS] branches=- | result=impl
[COLLABORATORS] field impl:org.apache.distributedlog.api.DistributedLogManager getAppendOnlyStreamWriter/0
[EXCEPTIONS] declares IOException
[FIELDS] read=impl:org.ap... | /* static context
[FOCAL] @Override public AppendOnlyStreamWriter DistributedLogManagerImpl.getAppendOnlyStreamWriter()
[INPUTS] branches=- | result=impl
[COLLABORATORS] field impl:org.apache.distributedlog.api.DistributedLogManager getAppendOnlyStreamWriter/0
[EXCEPTIONS] declares IOException
[FIELDS] read=impl:org.ap... | true | ok | {"focal": {"class": "DistributedLogManagerImpl", "name": "getAppendOnlyStreamWriter", "signature": "AppendOnlyStreamWriter getAppendOnlyStreamWriter() throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "AppendOnlyStreamWriter"}, "class_info": {"name": "DistributedLogMana... |
63947141_375 | class AsyncEndpointResponseCall implements AsyncEndpointCall<EndpointResponse<T>> {
@Override
public void executeAsync(EndpointCallCallback<EndpointResponse<T>> callback) {
new CompletionStageAsyncEndpointCall<>(doExecuteAsync(), executor)
.executeAsync(callback);
}
public AsyncEndpointResponseCall(Endpoint... | asyncCall.executeAsync(callback);
verify(callback).onSuccess(response);
verify(asyncEndpointRequestExecutor).executeAsync(request);
}
} | [FOCAL] @Override public void AsyncEndpointResponseCall.executeAsync(EndpointCallCallback<EndpointResponse<T>> callback)
[CLASS] class AsyncEndpointResponseCall implements AsyncEndpointCall<EndpointResponse<T>>
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] CompletionStage<Endpoin... | /* static context
[FOCAL] @Override public void AsyncEndpointResponseCall.executeAsync(EndpointCallCallback<EndpointResponse<T>> callback)
[CALLS-INTERNAL] CompletionStage<EndpointResponse<T>> doExecuteAsync()
[NEW] CompletionStageAsyncEndpointCall<>
[CALLS-EXTERNAL] new CompletionStageAsyncEndpointCall<>(doExecuteAsyn... | /* static context
[FOCAL] @Override public void AsyncEndpointResponseCall.executeAsync(EndpointCallCallback<EndpointResponse<T>> callback)
[CALLS-INTERNAL] CompletionStage<EndpointResponse<T>> doExecuteAsync()
[NEW] CompletionStageAsyncEndpointCall<>
[CALLS-EXTERNAL] new CompletionStageAsyncEndpointCall<>(doExecuteAsyn... | true | ok | {"focal": {"class": "AsyncEndpointResponseCall", "name": "executeAsync", "signature": "void executeAsync(EndpointCallCallback<EndpointResponse<T>> callback)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "callback", "type": "EndpointCallCallback<EndpointResponse<T>>"}], "return_type": "void"}, ... |
63972047_1 | class MediaIDHelper {
public static String getParentMediaID(@NonNull String mediaID) {
String[] hierarchy = getHierarchy(mediaID);
if (!isBrowseable(mediaID)) {
return createMediaID(null, hierarchy);
}
if (hierarchy.length <= 1) {
return MEDIA_ID_ROOT;
... | assertEquals(
MediaIDHelper.MEDIA_ID_ROOT,
MediaIDHelper.getParentMediaID(MediaIDHelper.MEDIA_ID_ROOT));
}
} | [FOCAL] public static String MediaIDHelper.getParentMediaID(String mediaID)
[CLASS] class MediaIDHelper
[METRICS] loc=11 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[CALLS-INTERNAL] String createMediaID(String musicID, String... categories); String[] getHierarchy(String mediaID); boolean isBrowseable(String me... | /* static context
[FOCAL] public static String MediaIDHelper.getParentMediaID(String mediaID)
[PATH1] if(!isBrowseable(mediaID))=F -> if(hierarchy.length <= 1)=T -> return MEDIA_ID_ROOT
[PATH2] if(!isBrowseable(mediaID))=T -> return createMediaID(null, hierarchy)
[PATH3] if(!isBrowseable(mediaID))=F -> if(hierarchy.len... | /* static context
[FOCAL] public static String MediaIDHelper.getParentMediaID(String mediaID)
[PATH1] if(!isBrowseable(mediaID))=F -> if(hierarchy.length <= 1)=T -> return MEDIA_ID_ROOT
[PATH2] if(!isBrowseable(mediaID))=T -> return createMediaID(null, hierarchy)
[PATH3] if(!isBrowseable(mediaID))=F -> if(hierarchy.len... | true | ok | {"focal": {"class": "MediaIDHelper", "name": "getParentMediaID", "signature": "String getParentMediaID(String mediaID)", "start_line": 3, "modifiers": "public static", "params": [{"name": "mediaID", "type": "String"}], "return_type": "String"}, "class_info": {"name": "MediaIDHelper", "kind": "class", "modifiers": "", "... |
64025178_6 | class VoxelwindBaseInventory implements Inventory {
@Override
public boolean addItem(@Nonnull ItemStack stack) {
return addItem(stack, null);
}
VoxelwindBaseInventory(InventoryType type);
@Override public Optional<ItemStack> getItem(int slot);
@Override public void setItem(int slot,... | VoxelwindBaseInventory inventory = new VoxelwindBaseInventory(InventoryType.CHEST);
assertTrue("Can't add item even when inventory is empty", inventory.addItem(new VoxelwindItemStack(BlockTypes.DIRT, 1, null)));
assertTrue("Can't add item but no conflicts exist", inventory.addItem(new VoxelwindI... | [FOCAL] @Override public boolean VoxelwindBaseInventory.addItem(ItemStack stack)
[CLASS] class VoxelwindBaseInventory implements Inventory
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] boolean addItem(ItemStack stack, PlayerSession session)
[INPUTS] branches=- | result=stack
[DAT... | /* static context
[FOCAL] @Override public boolean VoxelwindBaseInventory.addItem(ItemStack stack)
[INPUTS] branches=- | result=stack
[CALLS-INTERNAL] boolean addItem(ItemStack stack, PlayerSession session)
*/
| /* static context
[FOCAL] @Override public boolean VoxelwindBaseInventory.addItem(ItemStack stack)
[INPUTS] branches=- | result=stack
[CALLS-INTERNAL] boolean addItem(ItemStack stack, PlayerSession session)
*/
class VoxelwindBaseInventory implements Inventory {
@Override
public boolean addItem(@Nonnull ItemSta... | true | ok | {"focal": {"class": "VoxelwindBaseInventory", "name": "addItem", "signature": "boolean addItem(ItemStack stack)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "stack", "type": "ItemStack"}], "return_type": "boolean"}, "class_info": {"name": "VoxelwindBaseInventory", "kind": "class", "modifiers"... |
64067562_4 | class ResponseParser {
@NonNull
Student parseStudent(@NonNull String loginJson, @NonNull String attendanceJson)
throws InvalidCredentialsException, InvalidResponseException {
Student student = processLogin(loginJson);
try {
student.subjects.putAll(processAttendance(atten... | ResponseParser responseParser = new ResponseParser();
Student student = responseParser.parseStudent("{\"name\":\"name\",\"status\":\"success\"}", "");
assertEquals(0, student.subjects.size());
}
} | [FOCAL] @NonNull Student ResponseParser.parseStudent(String loginJson, String attendanceJson)
[CLASS] class ResponseParser
[METRICS] loc=10 cc=2 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] HashMap<String, Subject> processAttendance(String attendanceJson); Student processLogin(String loginJson)
[CAL... | /* static context
[FOCAL] @NonNull Student ResponseParser.parseStudent(String loginJson, String attendanceJson)
[PATH1] try-body throws -> return student
[INPUTS] branches=- | result=loginJson
[EXCEPTIONS] declares InvalidCredentialsException, InvalidResponseException; catches InvalidResponseException ignored
[CALLS-IN... | /* static context
[FOCAL] @NonNull Student ResponseParser.parseStudent(String loginJson, String attendanceJson)
[PATH1] try-body throws -> return student
[INPUTS] branches=- | result=loginJson
[EXCEPTIONS] declares InvalidCredentialsException, InvalidResponseException; catches InvalidResponseException ignored
[CALLS-IN... | true | ok | {"focal": {"class": "ResponseParser", "name": "parseStudent", "signature": "Student parseStudent(String loginJson, String attendanceJson) throws InvalidCredentialsException, InvalidResponseException", "start_line": 3, "modifiers": "@NonNull", "params": [{"name": "loginJson", "type": "String"}, {"name": "attendanceJson"... |
64095208_18 | class ItemGetter {
ItemDetails get(IInAppBillingService service,
String itemType,
ArrayList<String> itemIds) throws BillingException {
ItemDetails itemDetails = new ItemDetails();
List<ArrayList<String>> splitItemIdList = new ArrayList<>();
// There... | int size = 20;
ArrayList<String> itemIds = mDataConverter.convertToItemIdArrayList(size);
ArrayList<String> items = mDataConverter.convertToSkuItemDetailsJsonArrayList(size, PurchaseType.IN_APP);
Bundle responseBundle = new Bundle();
responseBundle.putLong(Constants.RESPONSE_CODE... | [FOCAL] ItemDetails ItemGetter.get(IInAppBillingService service, String itemType, ArrayList<String> itemIds)
[CLASS] class ItemGetter
[METRICS] loc=31 cc=4 branches=0 loops=2 returns=1 throws=1 nesting=2
[CALLS-INTERNAL] Bundle createBundleItemListFromArray(ArrayList<String> itemIds); List<String> getItemsFromResponse(... | /* static context
[FOCAL] ItemDetails ItemGetter.get(IInAppBillingService service, String itemType, ArrayList<String> itemIds)
[THROWS-WHEN] BillingException when i < itemIds.size() && foreach(ArrayList<String> splitItemIds : splitItemIdList)=T && try-body throws
[THROWS-WHEN] BillingException when !(i < itemIds.size()... | /* static context
[FOCAL] ItemDetails ItemGetter.get(IInAppBillingService service, String itemType, ArrayList<String> itemIds)
[THROWS-WHEN] BillingException when i < itemIds.size() && foreach(ArrayList<String> splitItemIds : splitItemIdList)=T && try-body throws
[THROWS-WHEN] BillingException when !(i < itemIds.size()... | true | ok | {"focal": {"class": "ItemGetter", "name": "get", "signature": "ItemDetails get(IInAppBillingService service, String itemType, ArrayList<String> itemIds) throws BillingException", "start_line": 3, "modifiers": "", "params": [{"name": "service", "type": "IInAppBillingService"}, {"name": "itemType", "type": "String"}, {"n... |
64177091_38 | class OptimizelyClient {
public @Nullable
NotificationCenter getNotificationCenter() {
if (isValid()) {
return optimizely.notificationCenter;
} else {
logger.warn("Optimizely is not initialized, could not get the notification listener");
}
return null;
... | OptimizelyClient optimizelyClient = new OptimizelyClient(optimizely, logger);
ActivateNotificationListener listener = new ActivateNotificationListener() {
@Override
public void onActivate(Experiment experiment, String userId, Map<String, ?> attributes, Variation variation, LogEve... | [FOCAL] public @Nullable NotificationCenter OptimizelyClient.getNotificationCenter()
[CLASS] class OptimizelyClient
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] boolean isValid()
[CALLS-EXTERNAL] Logger.warn/1
[FIELDS] read=logger:Logger, optimizely:Optimizely
[PATH1] if(isVali... | /* static context
[FOCAL] public @Nullable NotificationCenter OptimizelyClient.getNotificationCenter()
[PATH1] if(isValid())=T -> return optimizely.notificationCenter
[PATH2] if(isValid())=F -> return null
[INPUTS] branches=- | result=optimizely
[CALLS-INTERNAL] boolean isValid()
[FIELDS] read=logger:Logger, optimizely... | /* static context
[FOCAL] public @Nullable NotificationCenter OptimizelyClient.getNotificationCenter()
[PATH1] if(isValid())=T -> return optimizely.notificationCenter
[PATH2] if(isValid())=F -> return null
[INPUTS] branches=- | result=optimizely
[CALLS-INTERNAL] boolean isValid()
[FIELDS] read=logger:Logger, optimizely... | true | ok | {"focal": {"class": "OptimizelyClient", "name": "getNotificationCenter", "signature": "NotificationCenter getNotificationCenter()", "start_line": 3, "modifiers": "public @Nullable", "params": [], "return_type": "NotificationCenter"}, "class_info": {"name": "OptimizelyClient", "kind": "class", "modifiers": "", "supercla... |
64185596_146 | class DalConnectionManager {
public DalConnection getNewConnection(DalHints hints, boolean useMaster, DalEventEnum operation)
throws SQLException {
DalConnection connHolder = null;
String realDbName = logicDbName;
try
{
if(DalStatusManager.getDatabaseSetStatus(logicDbName).isMarkdown())
throw new Da... | boolean useMaster = true;
DalHints hints = new DalHints();
try {
DalConnectionManager test = getDalConnectionManager(noShardDb);
DalConnection conn = test.getNewConnection(hints, useMaster, DalEventEnum.BATCH_CALL);
assertNotNull(conn);
assertNotNull(conn.getConn());
conn.getConn().close();
} ... | [FOCAL] public DalConnection DalConnectionManager.getNewConnection(DalHints hints, boolean useMaster, DalEventEnum operation)
[CLASS] class DalConnectionManager
[METRICS] loc=30 cc=4 branches=2 loops=0 returns=1 throws=2 nesting=2
[CALLS-INTERNAL] DalConnection getConnectionFromDSLocator(DalHints hints, boolean isMaste... | /* static context
[FOCAL] public DalConnection DalConnectionManager.getNewConnection(DalHints hints, boolean useMaster, DalEventEnum operation)
[THROWS-WHEN] ex when try-body throws
[THROWS-WHEN] ex when DalStatusManager.getDatabaseSetStatus(logicDbName).isMarkdown() && throw new DalException(ErrorCode.MarkdownLogicDb,... | /* static context
[FOCAL] public DalConnection DalConnectionManager.getNewConnection(DalHints hints, boolean useMaster, DalEventEnum operation)
[THROWS-WHEN] ex when try-body throws
[THROWS-WHEN] ex when DalStatusManager.getDatabaseSetStatus(logicDbName).isMarkdown() && throw new DalException(ErrorCode.MarkdownLogicDb,... | true | ok | {"focal": {"class": "DalConnectionManager", "name": "getNewConnection", "signature": "DalConnection getNewConnection(DalHints hints, boolean useMaster, DalEventEnum operation) throws SQLException", "start_line": 3, "modifiers": "public", "params": [{"name": "hints", "type": "DalHints"}, {"name": "useMaster", "type": "b... |
64193956_151 | class AddEditTaskPresenter implements AddEditTaskContract.Presenter,
LoaderManager.LoaderCallbacks<Cursor>, TasksDataSource.GetTaskCallback {
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
if (data != null && data.moveToLast()) {
Task task = Task.from(dat... | Task testTask = new Task("TITLE", "DESCRIPTION");
// When the presenter is asked to populate an existing task
mAddEditTaskPresenter.onLoadFinished(mock(Loader.class), mActiveTaskCursor);
// Then the task repository is queried and the view updated
//verify(mTasksRepository).getT... | [FOCAL] @Override public void AddEditTaskPresenter.onLoadFinished(Loader<Cursor> loader, Cursor data)
[CLASS] class AddEditTaskPresenter implements AddEditTaskContract.Presenter, LoaderManager.LoaderCallbacks<Cursor>, TasksDataSource.GetTaskCallback
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
... | /* static context
[FOCAL] @Override public void AddEditTaskPresenter.onLoadFinished(Loader<Cursor> loader, Cursor data)
[PATH1] if(data != null && data.moveToLast())=T
[PATH2] if(data != null && data.moveToLast())=F
[INPUTS] branches=data | result=- | unused=loader
[COLLABORATORS] param data:Cursor moveToLast/0; field ... | /* static context
[FOCAL] @Override public void AddEditTaskPresenter.onLoadFinished(Loader<Cursor> loader, Cursor data)
[PATH1] if(data != null && data.moveToLast())=T
[PATH2] if(data != null && data.moveToLast())=F
[INPUTS] branches=data | result=- | unused=loader
[COLLABORATORS] param data:Cursor moveToLast/0; field ... | true | ok | {"focal": {"class": "AddEditTaskPresenter", "name": "onLoadFinished", "signature": "void onLoadFinished(Loader<Cursor> loader, Cursor data)", "start_line": 4, "modifiers": "@Override public", "params": [{"name": "loader", "type": "Loader<Cursor>"}, {"name": "data", "type": "Cursor"}], "return_type": "void"}, "class_inf... |
64203431_21 | class Emitter {
public List<Listener> listeners(String event) {
ConcurrentLinkedQueue<Listener> callbacks = this.callbacks.get(event);
return callbacks != null ?
new ArrayList<Listener>(callbacks) : new ArrayList<Listener>(0);
}
public Emitter on(String event, Listener fn);... | Emitter emitter = new Emitter();
assertThat(emitter.listeners("foo").toArray(), is(new Object[] {}));
}
} | [FOCAL] public List<Listener> Emitter.listeners(String event)
[CLASS] class Emitter
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] this.callbacks.get/1
[NEW] ArrayList<Listener>
[FIELDS] read=callbacks
[INPUTS] branches=- | result=event
[DATAFLOW] callbacks@L2->L3; event@param->L2... | /* static context
[FOCAL] public List<Listener> Emitter.listeners(String event)
[INPUTS] branches=- | result=event
[FIELDS] read=callbacks
[NEW] ArrayList<Listener>
[CALLS-EXTERNAL] this.callbacks.get/1
*/
| /* static context
[FOCAL] public List<Listener> Emitter.listeners(String event)
[INPUTS] branches=- | result=event
[FIELDS] read=callbacks
[NEW] ArrayList<Listener>
[CALLS-EXTERNAL] this.callbacks.get/1
*/
class Emitter {
public List<Listener> listeners(String event) {
ConcurrentLinkedQueue<Listener> callb... | true | ok | {"focal": {"class": "Emitter", "name": "listeners", "signature": "List<Listener> listeners(String event)", "start_line": 3, "modifiers": "public", "params": [{"name": "event", "type": "String"}], "return_type": "List<Listener>"}, "class_info": {"name": "Emitter", "kind": "class", "modifiers": "", "superclass": null, "i... |
64210266_4 | class MesosHTTPFetcher {
public static Optional<String> extractDirectory(InputStream stream, String frameworkId,
String executorId, String containerId) throws IOException {
// TODO: prepare corresponding object type instead of using java.util.Map
... | InputStream in;
Optional<String> s;
in = MesosHTTPFetcherTest.class.getResourceAsStream("/slave-state.json");
s = MesosHTTPFetcher.extractDirectory(in, "3a3e9491-84a5-4c9d-8fed-5ca10c23d922-0000",
"sum", "d9b0e1d9-49dc-4dd1-8773-d53366fc1517");
assertTrue(s.isPre... | [FOCAL] public static Optional<String> MesosHTTPFetcher.extractDirectory(InputStream stream, String frameworkId, String executorId, String containerId)
[CLASS] class MesosHTTPFetcher
[METRICS] loc=33 cc=7 branches=5 loops=1 returns=2 throws=0 nesting=2
[CALLS-INTERNAL] Optional<String> extractDirectoryFromExecutors(Lis... | /* static context
[FOCAL] public static Optional<String> MesosHTTPFetcher.extractDirectory(InputStream stream, String frameworkId, String executorId, String containerId)
[PATH1] if(map.get("frameworks") != null)=T -> if(map.get("completed_frameworks") != null)=T -> foreach(Map<String, Object> framework : frameworks)=T ... | /* static context
[FOCAL] public static Optional<String> MesosHTTPFetcher.extractDirectory(InputStream stream, String frameworkId, String executorId, String containerId)
[PATH1] if(map.get("frameworks") != null)=T -> if(map.get("completed_frameworks") != null)=T -> foreach(Map<String, Object> framework : frameworks)=T ... | true | ok | {"focal": {"class": "MesosHTTPFetcher", "name": "extractDirectory", "signature": "Optional<String> extractDirectory(InputStream stream, String frameworkId, String executorId, String containerId) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "stream", "type": "InputStream"}, {"n... |
64226557_15 | class ConfigProvider implements Provider<Config> {
@Override
public Config get() {
return config;
}
@Inject public ConfigProvider();
}
class ConfigProviderTest {
@Test
public void check_that_the_configuration_is_correctly_loaded() {
| Config config = new ConfigProvider().get();
assertThat(config.getString("generic.property")).isEqualTo("Text property");
assertThat(config.getIntList("generic.to-be-overriden")).containsExactly(4, 5);
}
} | [FOCAL] @Override public Config ConfigProvider.get()
[CLASS] class ConfigProvider implements Provider<Config>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] ConfigProvider()
[TEST] ConfigProviderTest: @Test public void check_that_the_configuration_is_correctly_loaded() | /* static context
[FOCAL] @Override public Config ConfigProvider.get()
*/
| /* static context
[FOCAL] @Override public Config ConfigProvider.get()
*/
class ConfigProvider implements Provider<Config> {
@Override
public Config get() {
return config;
}
@Inject public ConfigProvider();
}
class ConfigProviderTest {
@Test
public void check_that_the_configuration_is_correctly_loaded() {... | true | ok | {"focal": {"class": "ConfigProvider", "name": "get", "signature": "Config get()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Config"}, "class_info": {"name": "ConfigProvider", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Provider<Config>", "fields": [], "memb... |
64257587_220 | class JsonSimpleConfigParser implements ConfigParser {
@Override
public ProjectConfig parseProjectConfig(@Nonnull String json) throws ConfigParseException {
try {
JSONParser parser = new JSONParser();
JSONObject rootObject = (JSONObject) parser.parse(json);
String a... | JsonSimpleConfigParser parser = new JsonSimpleConfigParser();
ProjectConfig actual = parser.parseProjectConfig(validConfigJsonV3());
ProjectConfig expected = validProjectConfigV3();
verifyProjectConfig(actual, expected);
}
} | [FOCAL] @Override public ProjectConfig JsonSimpleConfigParser.parseProjectConfig(String json)
[CLASS] class JsonSimpleConfigParser implements ConfigParser
[METRICS] loc=68 cc=8 branches=5 loops=0 returns=1 throws=2 nesting=3
[CALLS-INTERNAL] List<Attribute> parseAttributes(JSONArray attributeJson); List<Audience> parse... | /* static context
[FOCAL] @Override public ProjectConfig JsonSimpleConfigParser.parseProjectConfig(String json)
[THROWS-WHEN] ConfigParseException when try-body throws
[PATH1] if(rootObject.containsKey("audiences"))=T -> if(rootObject.containsKey("typedAudiences"))=T -> if(datafileVersion >= Integer.parseInt(DatafilePr... | /* static context
[FOCAL] @Override public ProjectConfig JsonSimpleConfigParser.parseProjectConfig(String json)
[THROWS-WHEN] ConfigParseException when try-body throws
[PATH1] if(rootObject.containsKey("audiences"))=T -> if(rootObject.containsKey("typedAudiences"))=T -> if(datafileVersion >= Integer.parseInt(DatafilePr... | true | ok | {"focal": {"class": "JsonSimpleConfigParser", "name": "parseProjectConfig", "signature": "ProjectConfig parseProjectConfig(String json) throws ConfigParseException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "json", "type": "String"}], "return_type": "ProjectConfig"}, "class_info": {"name": ... |
64339521_6 | class AuthenticationResult implements IAuthenticationResult {
@Nullable
@Override
public UUID getCorrelationId() {
return mCorrelationId;
}
AuthenticationResult(@NonNull final List<ICacheRecord> cacheRecords,
@Nullable final String correlationId);
@Override ... | final String invalidCorrelationId = "garbage";
AuthenticationResult authenticationResult = new AuthenticationResult(
mCacheRecords,
invalidCorrelationId
);
Assert.assertNotNull(authenticationResult);
Assert.assertNull(authenticationResult.getCorre... | [FOCAL] @Nullable @Override public UUID AuthenticationResult.getCorrelationId()
[CLASS] class AuthenticationResult implements IAuthenticationResult
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] AuthenticationResult(List<ICacheRecord> cacheRecords, String correlationId); String get... | /* static context
[FOCAL] @Nullable @Override public UUID AuthenticationResult.getCorrelationId()
*/
| /* static context
[FOCAL] @Nullable @Override public UUID AuthenticationResult.getCorrelationId()
*/
class AuthenticationResult implements IAuthenticationResult {
@Nullable
@Override
public UUID getCorrelationId() {
return mCorrelationId;
}
AuthenticationResult(@NonNull final List<ICache... | true | ok | {"focal": {"class": "AuthenticationResult", "name": "getCorrelationId", "signature": "UUID getCorrelationId()", "start_line": 3, "modifiers": "@Nullable @Override public", "params": [], "return_type": "UUID"}, "class_info": {"name": "AuthenticationResult", "kind": "class", "modifiers": "", "superclass": null, "interfac... |
64340716_77 | class PropertyUtils {
public static Type getPropertyType(Class<?> beanClass, String field) {
try {
return INSTANCE.findPropertyType(beanClass, field);
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
throw handleReflectionException(bea... | // WHEN
Object result = PropertyUtils.getPropertyType(Bean.class, "setProperty");
// THEN
assertThat(ParameterizedType.class).isAssignableFrom(result.getClass());
}
} | [FOCAL] public static Type PropertyUtils.getPropertyType(Class<?> beanClass, String field)
[CLASS] class PropertyUtils
[METRICS] loc=7 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-INTERNAL] RuntimeException handleReflectionException(Object bean, String field, ReflectiveOperationException e)
[CALLS-EXTERN... | /* static context
[FOCAL] public static Type PropertyUtils.getPropertyType(Class<?> beanClass, String field)
[THROWS-WHEN] handleReflectionException(beanClass, field, e) when try-body throws
[PATH1] try-body throws -> throw handleReflectionException(beanClass, field, e)
[PATH2] return INSTANCE.findPropertyType(beanClas... | /* static context
[FOCAL] public static Type PropertyUtils.getPropertyType(Class<?> beanClass, String field)
[THROWS-WHEN] handleReflectionException(beanClass, field, e) when try-body throws
[PATH1] try-body throws -> throw handleReflectionException(beanClass, field, e)
[PATH2] return INSTANCE.findPropertyType(beanClas... | true | ok | {"focal": {"class": "PropertyUtils", "name": "getPropertyType", "signature": "Type getPropertyType(Class<?> beanClass, String field)", "start_line": 3, "modifiers": "public static", "params": [{"name": "beanClass", "type": "Class<?>"}, {"name": "field", "type": "String"}], "return_type": "Type"}, "class_info": {"name":... |
64371551_1 | class LoginPresenter {
void doLogin(String userName, String password) {
if (isLoginAttemptExceeded()) {
loginView.showErrorMessageForMaxLoginAttempt();
return;
}
if (userName.equals("nj") && password.equals("tdd")) {
loginView.showLoginSuccessMessage();
... | LoginView loginView= mock(LoginView.class);
LoginPresenter loginPresenter = new LoginPresenter(loginView);
loginPresenter.doLogin("nj","tdd");
verify(loginView).showLoginSuccessMessage();
}
} | [FOCAL] void LoginPresenter.doLogin(String userName, String password)
[CLASS] class LoginPresenter
[METRICS] loc=16 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] boolean isLoginAttemptExceeded(); int incrementLoginAttempt(); void resetLoginAttempt()
[CALLS-EXTERNAL] loginView.showErrorMessageFor... | /* static context
[FOCAL] void LoginPresenter.doLogin(String userName, String password)
[PATH1] if(isLoginAttemptExceeded())=F -> if(userName.equals("nj") && password.equals("tdd"))=T -> return
[PATH2] if(isLoginAttemptExceeded())=T -> return
[PATH3] if(isLoginAttemptExceeded())=F -> if(userName.equals("nj") && passwor... | /* static context
[FOCAL] void LoginPresenter.doLogin(String userName, String password)
[PATH1] if(isLoginAttemptExceeded())=F -> if(userName.equals("nj") && password.equals("tdd"))=T -> return
[PATH2] if(isLoginAttemptExceeded())=T -> return
[PATH3] if(isLoginAttemptExceeded())=F -> if(userName.equals("nj") && passwor... | true | ok | {"focal": {"class": "LoginPresenter", "name": "doLogin", "signature": "void doLogin(String userName, String password)", "start_line": 3, "modifiers": "", "params": [{"name": "userName", "type": "String"}, {"name": "password", "type": "String"}], "return_type": "void"}, "class_info": {"name": "LoginPresenter", "kind": "... |
64405938_0 | class AllNamesStrategy implements QueryAssemblyStrategy {
@Override
public String getQuery(DBpediaResource resource, int option) {
return constructQuery(resource, this.excludeNames+option);
}
public AllNamesStrategy();
public AllNamesStrategy(int excludeNames);
@Override public Stri... |
List<String> names = new LinkedList<>();
names.add("test_name");
names.add("test_name");
names.add("test_name");
names.add("test_name");
names.add("test_name2");
names.add("test_name2");
names.add("test_name2");
names.add("test_name3");
na... | [FOCAL] @Override public String AllNamesStrategy.getQuery(DBpediaResource resource, int option)
[CLASS] class AllNamesStrategy implements QueryAssemblyStrategy
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String constructQuery(DBpediaResource resource, int excludeNames)
[FIELDS]... | /* static context
[FOCAL] @Override public String AllNamesStrategy.getQuery(DBpediaResource resource, int option)
[INPUTS] branches=- | result=option, resource
[CALLS-INTERNAL] String constructQuery(DBpediaResource resource, int excludeNames)
[FIELDS] read=excludeNames
*/
| /* static context
[FOCAL] @Override public String AllNamesStrategy.getQuery(DBpediaResource resource, int option)
[INPUTS] branches=- | result=option, resource
[CALLS-INTERNAL] String constructQuery(DBpediaResource resource, int excludeNames)
[FIELDS] read=excludeNames
*/
class AllNamesStrategy implements QueryAssembly... | true | ok | {"focal": {"class": "AllNamesStrategy", "name": "getQuery", "signature": "String getQuery(DBpediaResource resource, int option)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "resource", "type": "DBpediaResource"}, {"name": "option", "type": "int"}], "return_type": "String"}, "class_info": {"na... |
64431348_524 | class DropWizardUtils {
static String generateFullMetricDescription(String metricName, Metric metric) {
return "Collected from "
+ SOURCE
+ " (metric="
+ metricName
+ ", type="
+ metric.getClass().getName()
+ ")";
}
private DropWizardUtils();
static String... | assertThat(DropWizardUtils.generateFullMetricDescription("Counter", new Counter()))
.isEqualTo("Collected from codahale (metric=Counter, type=com.codahale.metrics.Counter)");
}
} | [FOCAL] static String DropWizardUtils.generateFullMetricDescription(String metricName, Metric metric)
[CLASS] class DropWizardUtils
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] metric.getClass().getName/0, Metric.getClass/0
[INPUTS] branches=- | result=metric, metricName
[COLLAB... | /* static context
[FOCAL] static String DropWizardUtils.generateFullMetricDescription(String metricName, Metric metric)
[INPUTS] branches=- | result=metric, metricName
[COLLABORATORS] param metric:Metric getClass/0
[CALLS-EXTERNAL] metric.getClass().getName/0, Metric.getClass/0
*/
| /* static context
[FOCAL] static String DropWizardUtils.generateFullMetricDescription(String metricName, Metric metric)
[INPUTS] branches=- | result=metric, metricName
[COLLABORATORS] param metric:Metric getClass/0
[CALLS-EXTERNAL] metric.getClass().getName/0, Metric.getClass/0
*/
class DropWizardUtils {
static Stri... | true | ok | {"focal": {"class": "DropWizardUtils", "name": "generateFullMetricDescription", "signature": "String generateFullMetricDescription(String metricName, Metric metric)", "start_line": 3, "modifiers": "static", "params": [{"name": "metricName", "type": "String"}, {"name": "metric", "type": "Metric"}], "return_type": "Strin... |
64458355_0 | class BundledJarRunnable implements TwillRunnable {
protected void setMainArgs(String[] mainArgs) {
this.arguments = new BundledJarRunner.Arguments.Builder()
.from(arguments)
.setMainArgs(mainArgs)
.createArguments();
}
@Override public void stop();
@Override public void run();
protect... | String[] mainArgs = {"a", "b", "c"};
String jarFileName = "test/123.jar";
String libFolder = "libsdf";
String mainClassName = "org.apache.twill.ext.Test";
List<String> argsArrayList = ImmutableList.<String>builder()
.add(jarFileName)
.add(libFolder)
.add(mainClassName)
.addA... | [FOCAL] protected void BundledJarRunnable.setMainArgs(String[] mainArgs)
[CLASS] class BundledJarRunnable implements TwillRunnable
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] new BundledJarRunner.Arguments.Builder() .from(arguments)....createArguments/0, new BundledJarRunner.Ar... | /* static context
[FOCAL] protected void BundledJarRunnable.setMainArgs(String[] mainArgs)
[STATE] arguments via getArguments()
[FIELDS] write=arguments
[NEW] BundledJarRunner.Arguments.Builder
[CALLS-EXTERNAL] new BundledJarRunner.Arguments.Builder() .from(arguments)....createArguments/0, new BundledJarRunner.Argument... | /* static context
[FOCAL] protected void BundledJarRunnable.setMainArgs(String[] mainArgs)
[STATE] arguments via getArguments()
[FIELDS] write=arguments
[NEW] BundledJarRunner.Arguments.Builder
[CALLS-EXTERNAL] new BundledJarRunner.Arguments.Builder() .from(arguments)....createArguments/0, new BundledJarRunner.Argument... | true | ok | {"focal": {"class": "BundledJarRunnable", "name": "setMainArgs", "signature": "void setMainArgs(String[] mainArgs)", "start_line": 3, "modifiers": "protected", "params": [{"name": "mainArgs", "type": "String[]"}], "return_type": "void"}, "class_info": {"name": "BundledJarRunnable", "kind": "class", "modifiers": "", "su... |
64510591_31 | class Provider {
public final Single<T> read() {
return Single.defer(() ->
Single.fromObservable(builder.processorProviders
.<T>process(getConfigProvider(exceptionAdapter.placeholderLoader(),
new EvictDynamicKey(false), false, null))))
.onErrorResumeNext(exceptionAdapt... | saveMock();
TestObserver<Mock> observer = cacheProvider.read().test();
observer.awaitTerminalEvent();
observer.assertValueCount(1);
observer.assertNoErrors();
observer.assertComplete();
assertThat(observer.values()
.get(0).getMessage(), is(MESSAGE));
}
} | [FOCAL] public final Single<T> Provider.read()
[CLASS] class Provider
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] ConfigProvider getConfigProvider(Observable<T> loader, EvictDynamicKey evict, boolean detailResponse, Boolean useExpiredDataIfNotLoaderAvailable)
[CALLS-EXTERNAL] S... | /* static context
[FOCAL] public final Single<T> Provider.read()
[COLLABORATORS] field exceptionAdapter placeholderLoader/0
[CALLS-INTERNAL] ConfigProvider getConfigProvider(Observable<T> loader, EvictDynamicKey evict, boolean detailResponse, Boolean useExpiredDataIfNotLoaderAvailable)
[NEW] EvictDynamicKey
[CALLS-EXTE... | /* static context
[FOCAL] public final Single<T> Provider.read()
[COLLABORATORS] field exceptionAdapter placeholderLoader/0
[CALLS-INTERNAL] ConfigProvider getConfigProvider(Observable<T> loader, EvictDynamicKey evict, boolean detailResponse, Boolean useExpiredDataIfNotLoaderAvailable)
[NEW] EvictDynamicKey
[CALLS-EXTE... | true | ok | {"focal": {"class": "Provider", "name": "read", "signature": "Single<T> read()", "start_line": 3, "modifiers": "public final", "params": [], "return_type": "Single<T>"}, "class_info": {"name": "Provider", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "temporaryFolder", "t... |
64529819_0 | class Policy {
public abstract A nextAction(INDArray input)public abstract A nextAction(INDArray input);
public abstract A nextAction(INDArray input)public abstract NeuralNet getNeuralNet();
public abstract A nextAction(INDArray input)public double play(MDP<O, A, AS> mdp);
public abstract A nextAction(INDArray input)... | ACPolicy policy = new ACPolicy(new DummyAC(), new Random(555));
INDArray input = Nd4j.create(new double[] {1.0, 0.0});
for (int i = 0; i < 100; i++) {
assertEquals(0, (int)policy.nextAction(input));
}
input = Nd4j.create(new double[] {0.0, 1.0});
for (int i ... | [FOCAL] public abstract A Policy.nextAction(INDArray input)
[CLASS] class Policy
[METRICS] loc=1 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CLASS-MEMBERS] NeuralNet getNeuralNet(); double play(MDP<O, A, AS> mdp); double play(MDP<O, A, AS> mdp, HistoryProcessor.Configuration conf); double play(MDP<O, A, AS> m... | /* static context
[FOCAL] public abstract A Policy.nextAction(INDArray input)
*/
| /* static context
[FOCAL] public abstract A Policy.nextAction(INDArray input)
*/
class Policy {
public abstract A nextAction(INDArray input)public abstract A nextAction(INDArray input);
public abstract A nextAction(INDArray input)public abstract NeuralNet getNeuralNet();
public abstract A nextAction(INDArray input)pu... | true | partial | {"focal": {"class": "Policy", "name": "nextAction", "signature": "A nextAction(INDArray input)", "start_line": 3, "modifiers": "public abstract", "params": [{"name": "input", "type": "INDArray"}], "return_type": "A"}, "class_info": {"name": "Policy", "kind": "class", "modifiers": "", "superclass": null, "interfaces": n... |
64565477_5 | class EnvironmentVariablesConfigurationSource implements ConfigurationSource {
@Override
public JsonNode getConfiguration() {
return ConfigurationUtils.Properties.fromMap(System.getenv());
}
private final EnvironmentVariablesConfigurationSource environmentVariablesConfigurationSource;
}
class EnvironmentVaria... |
String environmentVariableKey = "key";
String environmentVariableValue = "value";
new MockUp<System>() {
@Mock
Map<String,String> getenv() {
Map<String, String> environmentVariables = new HashMap<>();
environmentVariables.put(environmentVariableKey, environmentVariableValue);
return environm... | [FOCAL] @Override public JsonNode EnvironmentVariablesConfigurationSource.getConfiguration()
[CLASS] class EnvironmentVariablesConfigurationSource implements ConfigurationSource
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] ConfigurationUtils.Properties.fromMap/1, System.getenv/0... | /* static context
[FOCAL] @Override public JsonNode EnvironmentVariablesConfigurationSource.getConfiguration()
[CALLS-EXTERNAL] ConfigurationUtils.Properties.fromMap/1, System.getenv/0
*/
| /* static context
[FOCAL] @Override public JsonNode EnvironmentVariablesConfigurationSource.getConfiguration()
[CALLS-EXTERNAL] ConfigurationUtils.Properties.fromMap/1, System.getenv/0
*/
class EnvironmentVariablesConfigurationSource implements ConfigurationSource {
@Override
public JsonNode getConfiguration() {
r... | true | ok | {"focal": {"class": "EnvironmentVariablesConfigurationSource", "name": "getConfiguration", "signature": "JsonNode getConfiguration()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "JsonNode"}, "class_info": {"name": "EnvironmentVariablesConfigurationSource", "kind": "class", "modifiers... |
64608558_1 | class CellularAutomaton {
public Rule getRule() {
return this.rule;
}
protected CellularAutomaton(Rule rule);
public void executeRule(Space space, Time time);
}
class CellularAutomatonTest {
@Test
public void dimensionalCellularAutomataConstructor() throws CloneNotSupportedException,
InvalidAbsoluteTi... | final State dimensionalBlackState = new DimensionalState("black", 0);
final State dimensionalWhiteState = new DimensionalState("white", 1);
final Combination dimensionalCombination0 = new DimensionalCombination(dimensionalBlackState,
dimensionalBlackState, dimensionalBlackState);
final Transition dimensiona... | [FOCAL] public Rule CellularAutomaton.getRule()
[CLASS] class CellularAutomaton
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[FIELDS] read=rule
[CLASS-MEMBERS] CellularAutomaton(Rule rule); void executeRule(Space space, Time time)
[TEST] CellularAutomatonTest: @Test public void dimensionalCellul... | /* static context
[FOCAL] public Rule CellularAutomaton.getRule()
[FIELDS] read=rule
*/
| /* static context
[FOCAL] public Rule CellularAutomaton.getRule()
[FIELDS] read=rule
*/
class CellularAutomaton {
public Rule getRule() {
return this.rule;
}
protected CellularAutomaton(Rule rule);
public void executeRule(Space space, Time time);
}
class CellularAutomatonTest {
@Test
public void dimensio... | true | ok | {"focal": {"class": "CellularAutomaton", "name": "getRule", "signature": "Rule getRule()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Rule"}, "class_info": {"name": "CellularAutomaton", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name"... |
64658258_0 | class Period implements Serializable {
public Calendar periodBegin(Calendar time) {
return periodBegin(time, 0);
}
private Period(int periodSeconds, int beginOffsetSeconds);
public int periodSeconds();
public int periodBeginOffsetSeconds();
public static Period secondsOf(int periodSe... | Period p = Period.secondsOf(60);
Calendar t1 = Calendar.getInstance();
t1.set(Calendar.MILLISECOND, 999);
t1.set(Calendar.SECOND, 59);
Calendar t2 = Calendar.getInstance();
t2.set(Calendar.MILLISECOND, 0);
t2.set(Calendar.SECOND, 0);
t2.add(Calendar.MINU... | [FOCAL] public Calendar Period.periodBegin(Calendar time)
[CLASS] class Period implements Serializable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Calendar periodBegin(Calendar time, int tolerantDelayMilliseconds)
[INPUTS] branches=- | result=time
[DATAFLOW] time@param->L2
[CLA... | /* static context
[FOCAL] public Calendar Period.periodBegin(Calendar time)
[INPUTS] branches=- | result=time
[CALLS-INTERNAL] Calendar periodBegin(Calendar time, int tolerantDelayMilliseconds)
*/
| /* static context
[FOCAL] public Calendar Period.periodBegin(Calendar time)
[INPUTS] branches=- | result=time
[CALLS-INTERNAL] Calendar periodBegin(Calendar time, int tolerantDelayMilliseconds)
*/
class Period implements Serializable {
public Calendar periodBegin(Calendar time) {
return periodBegin(time, 0... | true | ok | {"focal": {"class": "Period", "name": "periodBegin", "signature": "Calendar periodBegin(Calendar time)", "start_line": 3, "modifiers": "public", "params": [{"name": "time", "type": "Calendar"}], "return_type": "Calendar"}, "class_info": {"name": "Period", "kind": "class", "modifiers": "", "superclass": null, "interface... |
64719557_101 | class HttpServletResponseWrapperForResponseInfo implements HttpServletResponse {
@Override
public void sendRedirect(String location) throws IOException {
throw new UnsupportedOperationException();
}
public HttpServletResponseWrapperForResponseInfo(ResponseInfo<T> responseInfo);
@Override... | // expect
verifyUnsupportedOperation(() -> wrapper.sendRedirect(null));
}
} | [FOCAL] @Override public void HttpServletResponseWrapperForResponseInfo.sendRedirect(String location)
[CLASS] class HttpServletResponseWrapperForResponseInfo implements HttpServletResponse
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=1 nesting=0
[NEW] UnsupportedOperationException
[EXCEPTIONS] declares IOEx... | /* static context
[FOCAL] @Override public void HttpServletResponseWrapperForResponseInfo.sendRedirect(String location)
[THROWS-WHEN] UnsupportedOperationException when always
[INPUTS] branches=- | result=- | unused=location
[EXCEPTIONS] declares IOException; throws UnsupportedOperationException
[NEW] UnsupportedOperat... | /* static context
[FOCAL] @Override public void HttpServletResponseWrapperForResponseInfo.sendRedirect(String location)
[THROWS-WHEN] UnsupportedOperationException when always
[INPUTS] branches=- | result=- | unused=location
[EXCEPTIONS] declares IOException; throws UnsupportedOperationException
[NEW] UnsupportedOperat... | true | ok | {"focal": {"class": "HttpServletResponseWrapperForResponseInfo", "name": "sendRedirect", "signature": "void sendRedirect(String location) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "location", "type": "String"}], "return_type": "void"}, "class_info": {"name": "HttpServlet... |
64751214_2 | class DataService implements Serializable {
public Collection<Category> getAllCategories() {
return categoryRepository.findAll();
}
public Collection<Product> getAllProducts();
public Product updateProduct(Product product);
public void deleteProduct(int productId);
public Product getPr... | Category category = new Category();
category.setName("foo");
long count = categoryRepository.count();
Category created = categoryRepository.save(category);
Assert.assertNotEquals(-1, created.getId());
Assert.assertEquals(count + 1, categoryRepository.count());
... | [FOCAL] public Collection<Category> DataService.getAllCategories()
[CLASS] class DataService implements Serializable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] CategoryRepository.findAll/0
[FIELDS] read=categoryRepository:CategoryRepository
[INPUTS] branches=- | result=categor... | /* static context
[FOCAL] public Collection<Category> DataService.getAllCategories()
[INPUTS] branches=- | result=categoryRepository
[COLLABORATORS] field categoryRepository:CategoryRepository findAll/0
[FIELDS] read=categoryRepository:CategoryRepository
[CALLS-EXTERNAL] CategoryRepository.findAll/0
*/
| /* static context
[FOCAL] public Collection<Category> DataService.getAllCategories()
[INPUTS] branches=- | result=categoryRepository
[COLLABORATORS] field categoryRepository:CategoryRepository findAll/0
[FIELDS] read=categoryRepository:CategoryRepository
[CALLS-EXTERNAL] CategoryRepository.findAll/0
*/
class DataServic... | true | ok | {"focal": {"class": "DataService", "name": "getAllCategories", "signature": "Collection<Category> getAllCategories()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Collection<Category>"}, "class_info": {"name": "DataService", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "... |
64767540_1 | class XWikiLDAPConfig {
@Deprecated
public boolean isLDAPEnabled(XWikiContext context)
{
return isLDAPEnabled();
}
@Deprecated public XWikiLDAPConfig(String userId, XWikiContext xcontext);
public XWikiLDAPConfig(String userId);
public XWikiLDAPConfig(String userId, Configuration... | // No param set
assertEquals(false, this.config.isLDAPEnabled());
assertEquals(false, this.config.isLDAPEnabled(null));
// Param set in xwiki.cfg only
setCfgPreference("xwiki.authentication.ldap", "1");
assertEquals(true, this.config.isLDAPEnabled());
assertEqual... | [FOCAL] @Deprecated public boolean XWikiLDAPConfig.isLDAPEnabled(XWikiContext context)
[CLASS] class XWikiLDAPConfig
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] boolean isLDAPEnabled()
[INPUTS] branches=- | result=- | unused=context
[CLASS-MEMBERS] XWikiLDAPConfig(String userId... | /* static context
[FOCAL] @Deprecated public boolean XWikiLDAPConfig.isLDAPEnabled(XWikiContext context)
[INPUTS] branches=- | result=- | unused=context
[CALLS-INTERNAL] boolean isLDAPEnabled()
*/
| /* static context
[FOCAL] @Deprecated public boolean XWikiLDAPConfig.isLDAPEnabled(XWikiContext context)
[INPUTS] branches=- | result=- | unused=context
[CALLS-INTERNAL] boolean isLDAPEnabled()
*/
class XWikiLDAPConfig {
@Deprecated
public boolean isLDAPEnabled(XWikiContext context)
{
return isLDAP... | true | ok | {"focal": {"class": "XWikiLDAPConfig", "name": "isLDAPEnabled", "signature": "boolean isLDAPEnabled(XWikiContext context)", "start_line": 3, "modifiers": "@Deprecated public", "params": [{"name": "context", "type": "XWikiContext"}], "return_type": "boolean"}, "class_info": {"name": "XWikiLDAPConfig", "kind": "class", "... |
64785879_7 | class UnidentifiedProducer {
public void sendName(String destinationName, String firstName,
String lastName) throws JMSException {
String text = firstName + " " + lastName;
// create a JMS TextMessage
TextMessage textMessage = session.createTextMessage(text);
// create the Destination to whi... | try {
unidentifiedProducer.sendName("helloworld.q", "John", "Doe");
String greeting = consumer.getGreeting(1000);
assertEquals("Hello John Doe!", greeting);
} catch (JMSException e) {
fail("a JMS Exception occurred");
}
}
} | [FOCAL] public void UnidentifiedProducer.sendName(String destinationName, String firstName, String lastName)
[CLASS] class UnidentifiedProducer
[METRICS] loc=17 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] session.createTextMessage/1, session.createQueue/1, messageProducer.send/2, LOGGER.debug/... | /* static context
[FOCAL] public void UnidentifiedProducer.sendName(String destinationName, String firstName, String lastName)
[COLLABORATORS] field session createTextMessage/1,createQueue/1; field messageProducer send/2
[EXCEPTIONS] declares JMSException
[CALLS-EXTERNAL] session.createTextMessage/1, session.createQueu... | /* static context
[FOCAL] public void UnidentifiedProducer.sendName(String destinationName, String firstName, String lastName)
[COLLABORATORS] field session createTextMessage/1,createQueue/1; field messageProducer send/2
[EXCEPTIONS] declares JMSException
[CALLS-EXTERNAL] session.createTextMessage/1, session.createQueu... | true | ok | {"focal": {"class": "UnidentifiedProducer", "name": "sendName", "signature": "void sendName(String destinationName, String firstName, String lastName) throws JMSException", "start_line": 3, "modifiers": "public", "params": [{"name": "destinationName", "type": "String"}, {"name": "firstName", "type": "String"}, {"name":... |
64790683_1 | class CategoryResource {
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("/{categoryId}")
public Category get(@PathParam("categoryId") Integer categoryId) {
return em.find(Category.class, categoryId);
}
@GET @Produces(MediaType.APPLICATION_JSON) public Collection<Category> all();
... | Response response =
given()
.pathParam("categoryId", 1014)
.when()
.get("/admin/category/{categoryId}")
.then()
.extract().response();
String jsonAsString = response.asString();
... | [FOCAL] @GET @Produces(MediaType.APPLICATION_JSON) @Path("/{categoryId}") public Category CategoryResource.get(Integer categoryId)
[CLASS] class CategoryResource
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] em.find/2
[INPUTS] branches=- | result=categoryId
[COLLABORATORS] field ... | /* static context
[FOCAL] @GET @Produces(MediaType.APPLICATION_JSON) @Path("/{categoryId}") public Category CategoryResource.get(Integer categoryId)
[INPUTS] branches=- | result=categoryId
[COLLABORATORS] field em find/2
[CALLS-EXTERNAL] em.find/2
*/
| /* static context
[FOCAL] @GET @Produces(MediaType.APPLICATION_JSON) @Path("/{categoryId}") public Category CategoryResource.get(Integer categoryId)
[INPUTS] branches=- | result=categoryId
[COLLABORATORS] field em find/2
[CALLS-EXTERNAL] em.find/2
*/
class CategoryResource {
@GET
@Produces(MediaType.APPLICATIO... | true | ok | {"focal": {"class": "CategoryResource", "name": "get", "signature": "Category get(Integer categoryId)", "start_line": 3, "modifiers": "@GET @Produces(MediaType.APPLICATION_JSON) @Path(\"/{categoryId}\") public", "params": [{"name": "categoryId", "type": "Integer"}], "return_type": "Category"}, "class_info": {"name": "C... |
64873196_8 | class IncrementalPositionIterator extends AbstractPositionIterator {
@Override
public Integer next() {
if (!hasNext()) throw new IllegalStateException("position out of bounds reached");
return pos++;
}
IncrementalPositionIterator(@IntRange(from = 0) int itemCount);
@Override pub... | AbstractPositionIterator iterator = providePositionIterator(5);
int result = iterator.next();
assertTrue(result == 0);
result = iterator.next();
assertTrue(result == 1);
result = iterator.next();
assertTrue(result == 2);
}
} | [FOCAL] @Override public Integer IncrementalPositionIterator.next()
[CLASS] class IncrementalPositionIterator extends AbstractPositionIterator
[METRICS] loc=5 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-INTERNAL] boolean hasNext()
[NEW] IllegalStateException
[EXCEPTIONS] throws IllegalStateException
[TH... | /* static context
[FOCAL] @Override public Integer IncrementalPositionIterator.next()
[THROWS-WHEN] IllegalStateException when !hasNext()
[PATH1] if(!hasNext())=T -> throw new IllegalStateException("position out of bounds reached")
[PATH2] if(!hasNext())=F -> return pos++
[EXCEPTIONS] throws IllegalStateException
[CALL... | /* static context
[FOCAL] @Override public Integer IncrementalPositionIterator.next()
[THROWS-WHEN] IllegalStateException when !hasNext()
[PATH1] if(!hasNext())=T -> throw new IllegalStateException("position out of bounds reached")
[PATH2] if(!hasNext())=F -> return pos++
[EXCEPTIONS] throws IllegalStateException
[CALL... | true | ok | {"focal": {"class": "IncrementalPositionIterator", "name": "next", "signature": "Integer next()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Integer"}, "class_info": {"name": "IncrementalPositionIterator", "kind": "class", "modifiers": "", "superclass": "AbstractPositionIterator", "... |
65041301_17 | class UserRepository {
@VisibleForTesting
Single<Reply<List<User>>> getUsersReply(Integer lastIdQueried, final boolean refresh) {
int safeId = lastIdQueried == null ? FIRST_DEFAULT_ID : lastIdQueried;
Single<List<User>> apiCall = githubUsersApi
.getUsers(safeId, USERS_PER_PAGE)
.compose(ne... | mockApiForSuccess();
TestObserver<Reply<List<User>>> observer1 = userRepositoryUT.getUsersReply(null, false).test();
observer1.awaitTerminalEvent();
assertEquals(Source.CLOUD,
observer1.values().get(0).getSource());
TestObserver<Reply<List<User>>> observer2 = userRepositoryUT.getUsersRepl... | [FOCAL] @VisibleForTesting Single<Reply<List<User>>> UserRepository.getUsersReply(Integer lastIdQueried, boolean refresh)
[CLASS] class UserRepository
[METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] githubUsersApi .getUsers(safeId, USERS_PER_PAGE).compose/1, githubUsersApi.getUser... | /* static context
[FOCAL] @VisibleForTesting Single<Reply<List<User>>> UserRepository.getUsersReply(Integer lastIdQueried, boolean refresh)
[INPUTS] branches=- | result=lastIdQueried, refresh
[COLLABORATORS] field githubUsersApi getUsers/2; field networkResponse process/0; field cacheProvider replaceAsReply/1,readWithL... | /* static context
[FOCAL] @VisibleForTesting Single<Reply<List<User>>> UserRepository.getUsersReply(Integer lastIdQueried, boolean refresh)
[INPUTS] branches=- | result=lastIdQueried, refresh
[COLLABORATORS] field githubUsersApi getUsers/2; field networkResponse process/0; field cacheProvider replaceAsReply/1,readWithL... | true | ok | {"focal": {"class": "UserRepository", "name": "getUsersReply", "signature": "Single<Reply<List<User>>> getUsersReply(Integer lastIdQueried, boolean refresh)", "start_line": 3, "modifiers": "@VisibleForTesting", "params": [{"name": "lastIdQueried", "type": "Integer"}, {"name": "refresh", "type": "boolean"}], "return_typ... |
65084302_122 | class HttpRequestReplaceFilter extends AbstractRequestReplaceFilter implements Filter {
@Override
public void doFilter(ApiContext apiContext, Future<ApiContext> completeFuture) {
for (int i = 0; i < apiContext.requests().size(); i++) {
RpcRequest request = apiContext.requests().get(i);
... | Multimap<String, String> params = ArrayListMultimap.create();
Multimap<String, String> headers = ArrayListMultimap.create();
JsonObject jsonObject = new JsonObject();
ApiContext apiContext =
ApiContext.create(HttpMethod.GET, "/devices", headers, params, jsonObject);
... | [FOCAL] @Override public void HttpRequestReplaceFilter.doFilter(ApiContext apiContext, Future<ApiContext> completeFuture)
[CLASS] class HttpRequestReplaceFilter extends AbstractRequestReplaceFilter implements Filter
[METRICS] loc=10 cc=3 branches=1 loops=1 returns=0 throws=0 nesting=2
[CALLS-INTERNAL] void replace(ApiC... | /* static context
[FOCAL] @Override public void HttpRequestReplaceFilter.doFilter(ApiContext apiContext, Future<ApiContext> completeFuture)
[PATH1] for(i < apiContext.requests().size())=T -> if(request instanceof HttpRpcRequest)=T -> exit loop
[PATH2] for(i < apiContext.requests().size())=F
[PATH3] for(i < apiContext.r... | /* static context
[FOCAL] @Override public void HttpRequestReplaceFilter.doFilter(ApiContext apiContext, Future<ApiContext> completeFuture)
[PATH1] for(i < apiContext.requests().size())=T -> if(request instanceof HttpRpcRequest)=T -> exit loop
[PATH2] for(i < apiContext.requests().size())=F
[PATH3] for(i < apiContext.r... | true | ok | {"focal": {"class": "HttpRequestReplaceFilter", "name": "doFilter", "signature": "void doFilter(ApiContext apiContext, Future<ApiContext> completeFuture)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "apiContext", "type": "ApiContext"}, {"name": "completeFuture", "type": "Future<ApiContext>"}]... |
65089775_0 | class ASpinWait {
public boolean awaitFulfill(final Instant waitingSince) throws IOException {
while (true) {
awaitFulfill(waitingSince, Duration.ONE_DAY);
}
}
protected Duration determineSkipSpinAfterWaitingSince();
protected static MethodHandle determineOnSpinWait();
... | final ASpinWait waitingSpinWait = new ASpinWait() {
@Override
protected boolean isConditionFulfilled() {
return false;
}
};
final Duration maxWait = Duration.ONE_SECOND;
final Instant waitingSince = new Instant();
waitingSpinWa... | [FOCAL] public boolean ASpinWait.awaitFulfill(Instant waitingSince)
[CLASS] class ASpinWait
[METRICS] loc=5 cc=1 branches=0 loops=1 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] boolean awaitFulfill(Instant waitingSince, Duration maxWait)
[EXCEPTIONS] declares IOException
[DATAFLOW] waitingSince@param->L3
[CLASS-MEMBER... | /* static context
[FOCAL] public boolean ASpinWait.awaitFulfill(Instant waitingSince)
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] boolean awaitFulfill(Instant waitingSince, Duration maxWait)
*/
| /* static context
[FOCAL] public boolean ASpinWait.awaitFulfill(Instant waitingSince)
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] boolean awaitFulfill(Instant waitingSince, Duration maxWait)
*/
class ASpinWait {
public boolean awaitFulfill(final Instant waitingSince) throws IOException {
while (true... | true | ok | {"focal": {"class": "ASpinWait", "name": "awaitFulfill", "signature": "boolean awaitFulfill(Instant waitingSince) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "waitingSince", "type": "Instant"}], "return_type": "boolean"}, "class_info": {"name": "ASpinWait", "kind": "class", "modifie... |
65158020_24 | class EGradleJUnitTaskVariableReplacement {
public String replace(String origin, String replacement) {
if (origin == null) {
return null;
}
if (replacement == null) {
return origin;
}
Matcher matcher = PATTERN.matcher(origin);
String result = matcher.replaceAll(replacement);
return result;
}
pr... | /* prepare */
String tasksWithVariable = null;
/* execute */
String tasks = supportToTest.replace(tasksWithVariable, "REPLACEMENT");
/* test */
assertEquals(tasksWithVariable, tasks);
}
} | [FOCAL] public String EGradleJUnitTaskVariableReplacement.replace(String origin, String replacement)
[CLASS] class EGradleJUnitTaskVariableReplacement
[METRICS] loc=11 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[CALLS-EXTERNAL] PATTERN.matcher/1, Matcher.replaceAll/1
[PATH1] if(origin == null)=F -> if(replace... | /* static context
[FOCAL] public String EGradleJUnitTaskVariableReplacement.replace(String origin, String replacement)
[PATH1] if(origin == null)=F -> if(replacement == null)=T -> return origin
[PATH2] if(origin == null)=T -> return null
[PATH3] if(origin == null)=F -> if(replacement == null)=F -> return result
[INPUTS... | /* static context
[FOCAL] public String EGradleJUnitTaskVariableReplacement.replace(String origin, String replacement)
[PATH1] if(origin == null)=F -> if(replacement == null)=T -> return origin
[PATH2] if(origin == null)=T -> return null
[PATH3] if(origin == null)=F -> if(replacement == null)=F -> return result
[INPUTS... | true | ok | {"focal": {"class": "EGradleJUnitTaskVariableReplacement", "name": "replace", "signature": "String replace(String origin, String replacement)", "start_line": 3, "modifiers": "public", "params": [{"name": "origin", "type": "String"}, {"name": "replacement", "type": "String"}], "return_type": "String"}, "class_info": {"n... |
65194280_0 | class SequenceTempDirMgr extends TempDirMgr {
public synchronized Path getTempDir() throws IOException {
Path tempDir =
new Path(prefix+Integer.toString(seqNum++));
if(fileSystem!=null) {
while (dirs.contains(tempDir) || fileSystem.exists(tempDir)) {
tempDir = new Path(prefix+Integer.toString(se... | SequenceTempDirMgr mgr=new SequenceTempDirMgr("test", 2);
mgr.getTempDir();
Path path2=mgr.getTempDir();
mgr.getTempDir();
mgr.getTempDir();
assertTrue(mgr.getDirs().size()==4);
assertTrue(mgr.getSeqNum()==6);
mgr.removePath(path2);
assertTrue(mgr.getDirs().size()==3);
mgr.deleteAll();
assertT... | [FOCAL] public synchronized Path SequenceTempDirMgr.getTempDir()
[CLASS] class SequenceTempDirMgr extends TempDirMgr
[METRICS] loc=18 cc=4 branches=1 loops=2 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] Integer.toString/1, dirs.contains/1, fileSystem.exists/1, dirs.add/1
[NEW] Path
[EXCEPTIONS] declares IOException
[P... | /* static context
[FOCAL] public synchronized Path SequenceTempDirMgr.getTempDir()
[PATH1] if(fileSystem!=null)=T -> while(dirs.contains(tempDir) || fileSystem.exists(tempDir))=T -> exit loop -> return tempDir
[PATH2] if(fileSystem!=null)=F -> while(dirs.contains(tempDir))=F -> return tempDir
[PATH3] if(fileSystem!=nul... | /* static context
[FOCAL] public synchronized Path SequenceTempDirMgr.getTempDir()
[PATH1] if(fileSystem!=null)=T -> while(dirs.contains(tempDir) || fileSystem.exists(tempDir))=T -> exit loop -> return tempDir
[PATH2] if(fileSystem!=null)=F -> while(dirs.contains(tempDir))=F -> return tempDir
[PATH3] if(fileSystem!=nul... | true | ok | {"focal": {"class": "SequenceTempDirMgr", "name": "getTempDir", "signature": "Path getTempDir() throws IOException", "start_line": 3, "modifiers": "public synchronized", "params": [], "return_type": "Path"}, "class_info": {"name": "SequenceTempDirMgr", "kind": "class", "modifiers": "", "superclass": "TempDirMgr", "inte... |
65245890_41 | class EpoxyController implements ModelCollector, StickyHeaderCallbacks {
public boolean isDuplicateFilteringEnabled() {
return filterDuplicates;
}
public EpoxyController();
public EpoxyController(Handler modelBuildingHandler, Handler diffingHandler);
public void requestModelBuild();
public boolean ... | EpoxyController controller = new EpoxyController() {
@Override
protected void buildModels() {
}
};
assertFalse(controller.isDuplicateFilteringEnabled());
}
} | [FOCAL] public boolean EpoxyController.isDuplicateFilteringEnabled()
[CLASS] class EpoxyController implements ModelCollector, StickyHeaderCallbacks
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] EpoxyController(); EpoxyController(Handler modelBuildingHandler, Handler diffingHandler... | /* static context
[FOCAL] public boolean EpoxyController.isDuplicateFilteringEnabled()
*/
| /* static context
[FOCAL] public boolean EpoxyController.isDuplicateFilteringEnabled()
*/
class EpoxyController implements ModelCollector, StickyHeaderCallbacks {
public boolean isDuplicateFilteringEnabled() {
return filterDuplicates;
}
public EpoxyController();
public EpoxyController(Handler modelBuild... | true | ok | {"focal": {"class": "EpoxyController", "name": "isDuplicateFilteringEnabled", "signature": "boolean isDuplicateFilteringEnabled()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "EpoxyController", "kind": "class", "modifiers": "", "superclass": null, "interfaces... |
65277100_0 | class BasicObservable implements Observable<V> {
protected void updateValue(final V value) {
if(inWillChangeEvent) {
throw new IllegalStateException("Value can not change while willChangeEvents are handled!");
}
if (this.value != value) {
boolean canChange = fireWill... | try {
BasicObservable<Boolean> observable = new BasicObservable<>();
CheckBooleanObservable.checkBooleanObservableBasicMethods(observable);
} catch (Exception e) {
e.printStackTrace();
Assert.fail("Error");
}
try {
BasicObserva... | [FOCAL] protected void BasicObservable.updateValue(V value)
[CLASS] class BasicObservable implements Observable<V>
[METRICS] loc=15 cc=5 branches=3 loops=0 returns=0 throws=1 nesting=3
[CALLS-INTERNAL] boolean fireWillChangeEvent(V newValue); void fireChangedEvent(V newValue)
[NEW] IllegalStateException
[FIELDS] read=v... | /* static context
[FOCAL] protected void BasicObservable.updateValue(V value)
[THROWS-WHEN] IllegalStateException when inWillChangeEvent
[PATH1] if(inWillChangeEvent)=F -> if(this.value != value)=T -> if(canChange)=T -> try-body throws
[PATH2] if(inWillChangeEvent)=T -> throw new IllegalStateException("Value can not ch... | /* static context
[FOCAL] protected void BasicObservable.updateValue(V value)
[THROWS-WHEN] IllegalStateException when inWillChangeEvent
[PATH1] if(inWillChangeEvent)=F -> if(this.value != value)=T -> if(canChange)=T -> try-body throws
[PATH2] if(inWillChangeEvent)=T -> throw new IllegalStateException("Value can not ch... | true | ok | {"focal": {"class": "BasicObservable", "name": "updateValue", "signature": "void updateValue(V value)", "start_line": 3, "modifiers": "protected", "params": [{"name": "value", "type": "V"}], "return_type": "void"}, "class_info": {"name": "BasicObservable", "kind": "class", "modifiers": "", "superclass": null, "interfac... |
65312676_1 | class AIServiceContextBuilder {
public AIServiceContext build() {
if (sessionId == null) {
throw new IllegalStateException("Session id is undefined");
}
return new PlainAIServiceContext(sessionId, timeZone);
}
public AIServiceContextBuilder();
public String getSessionId();
public AIServi... | AIServiceContextBuilder builder = new AIServiceContextBuilder();
assertNull(builder.getSessionId());
builder.setSessionId(DUMMY_SESSION_ID);
assertEquals(DUMMY_SESSION_ID, builder.getSessionId());
AIServiceContext context = builder.build();
assertEquals(DUMMY_SESSION_ID, context.getSessionId());
}
... | [FOCAL] public AIServiceContext AIServiceContextBuilder.build()
[CLASS] class AIServiceContextBuilder
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[NEW] IllegalStateException, PlainAIServiceContext
[EXCEPTIONS] throws IllegalStateException
[THROWS-WHEN] IllegalStateException when sessionId == nu... | /* static context
[FOCAL] public AIServiceContext AIServiceContextBuilder.build()
[THROWS-WHEN] IllegalStateException when sessionId == null
[PATH1] if(sessionId == null)=T -> throw new IllegalStateException("Session id is undefined")
[PATH2] if(sessionId == null)=F -> return new PlainAIServiceContext(sessionId, timeZo... | /* static context
[FOCAL] public AIServiceContext AIServiceContextBuilder.build()
[THROWS-WHEN] IllegalStateException when sessionId == null
[PATH1] if(sessionId == null)=T -> throw new IllegalStateException("Session id is undefined")
[PATH2] if(sessionId == null)=F -> return new PlainAIServiceContext(sessionId, timeZo... | true | ok | {"focal": {"class": "AIServiceContextBuilder", "name": "build", "signature": "AIServiceContext build()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "AIServiceContext"}, "class_info": {"name": "AIServiceContextBuilder", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "... |
65356302_30 | class OkHttpSender extends Sender {
@Override public CheckResult check() {
try {
Request request = new Request.Builder().url(endpoint)
.post(RequestBody.create(MediaType.parse("application/json"), "[]")).build();
try (Response response = client.newCall(request).execute()) {
if (!respo... | server.enqueue(new MockResponse().setSocketPolicy(SocketPolicy.DISCONNECT_AT_START));
assertThat(sender.check().ok()).isFalse();
}
} | [FOCAL] @Override public CheckResult OkHttpSender.check()
[CLASS] class OkHttpSender extends Sender
[METRICS] loc=14 cc=3 branches=1 loops=0 returns=3 throws=0 nesting=3
[CALLS-EXTERNAL] new Request.Builder().url(endpoint) .post(RequestBody.cre....build/0, new Request.Builder().url(endpoint).post/1, new Request.Builder... | /* static context
[FOCAL] @Override public CheckResult OkHttpSender.check()
[PATH1] try-body throws -> return CheckResult.failed(e)
[PATH2] if(!response.isSuccessful())=T -> return CheckResult.failed(new RuntimeException("check response failed: " +...
[PATH3] if(!response.isSuccessful())=F -> return CheckResult.OK
[INP... | /* static context
[FOCAL] @Override public CheckResult OkHttpSender.check()
[PATH1] try-body throws -> return CheckResult.failed(e)
[PATH2] if(!response.isSuccessful())=T -> return CheckResult.failed(new RuntimeException("check response failed: " +...
[PATH3] if(!response.isSuccessful())=F -> return CheckResult.OK
[INP... | true | ok | {"focal": {"class": "OkHttpSender", "name": "check", "signature": "CheckResult check()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "CheckResult"}, "class_info": {"name": "OkHttpSender", "kind": "class", "modifiers": "", "superclass": "Sender", "interfaces": null, "fields": [{"name":... |
65402989_8 | class BundleImmutable implements IBundle {
@NonNull
@Override
public Option<Float> getFloat(@NonNull final String key) {
return getObject(key)
.ofType(Float.class);
}
public BundleImmutable();
public BundleImmutable(@NonNull final Map<String, Object> map);
@NonNu... | String key = "SomeKey";
final float value = 0.2f;
BundleImmutable bundle = new BundleImmutable(
Collections.<String, Object>singletonMap(key, value));
Option<Float> result = bundle.getFloat(key);
assertThat(OptionUnsafe.getUnsafe(result)).isEqualTo(value);
}... | [FOCAL] @NonNull @Override public Option<Float> BundleImmutable.getFloat(String key)
[CLASS] class BundleImmutable implements IBundle
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Option<Object> getObject(String key)
[CALLS-EXTERNAL] getObject(key).ofType/1
[INPUTS] branches=- | ... | /* static context
[FOCAL] @NonNull @Override public Option<Float> BundleImmutable.getFloat(String key)
[INPUTS] branches=- | result=key
[CALLS-INTERNAL] Option<Object> getObject(String key)
[CALLS-EXTERNAL] getObject(key).ofType/1
*/
| /* static context
[FOCAL] @NonNull @Override public Option<Float> BundleImmutable.getFloat(String key)
[INPUTS] branches=- | result=key
[CALLS-INTERNAL] Option<Object> getObject(String key)
[CALLS-EXTERNAL] getObject(key).ofType/1
*/
class BundleImmutable implements IBundle {
@NonNull
@Override
public Opti... | true | ok | {"focal": {"class": "BundleImmutable", "name": "getFloat", "signature": "Option<Float> getFloat(String key)", "start_line": 3, "modifiers": "@NonNull @Override public", "params": [{"name": "key", "type": "String"}], "return_type": "Option<Float>"}, "class_info": {"name": "BundleImmutable", "kind": "class", "modifiers":... |
65441815_0 | class WikiSearch {
public List<Entry<String, Double>> sort(Map<String, Double> map) {
List<Entry<String, Double>> list = new ArrayList<Map.Entry<String, Double>>(map.entrySet());
Comparator<Entry<String, Double>> comparator = new Comparator<Entry<String, Double>>(){
public int compare(Entry<String, Double> one... | List<Entry<String, Integer>> list = search2.sort();
assertThat(list.get(0).getValue(), is(4));
assertThat(list.get(1).getValue(), is(5));
assertThat(list.get(2).getValue(), is(7));
}
} | [FOCAL] public List<Entry<String, Double>> WikiSearch.sort(Map<String, Double> map)
[CLASS] class WikiSearch
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Map<String, Double>.entrySet/0, (two.getValue()).compareTo/1, two.getValue/0, one.getValue/0, Collections.sort/2
[NEW] Array... | /* static context
[FOCAL] public List<Entry<String, Double>> WikiSearch.sort(Map<String, Double> map)
[INPUTS] branches=- | result=map
[COLLABORATORS] param map:Map<String, Double> entrySet/0; field two getValue/0; field one getValue/0
[NEW] ArrayList<Map.Entry<String, Double>>, Comparator<Entry<String, Double>>
[CALLS... | /* static context
[FOCAL] public List<Entry<String, Double>> WikiSearch.sort(Map<String, Double> map)
[INPUTS] branches=- | result=map
[COLLABORATORS] param map:Map<String, Double> entrySet/0; field two getValue/0; field one getValue/0
[NEW] ArrayList<Map.Entry<String, Double>>, Comparator<Entry<String, Double>>
[CALLS... | true | ok | {"focal": {"class": "WikiSearch", "name": "sort", "signature": "List<Entry<String, Double>> sort(Map<String, Double> map)", "start_line": 3, "modifiers": "public", "params": [{"name": "map", "type": "Map<String, Double>"}], "return_type": "List<Entry<String, Double>>"}, "class_info": {"name": "WikiSearch", "kind": "cla... |
65505864_3 | class CloudPubSubSinkConnector extends SinkConnector {
@Override
public List<Map<String, String>> taskConfigs(int maxTasks) {
// Each task will get the exact same configuration. Delegate all config validation to the task.
ArrayList<Map<String, String>> configs = new ArrayList<>();
for (int i = 0; i < m... | connector.start(props);
List<Map<String, String>> taskConfigs = connector.taskConfigs(NUM_TASKS);
assertEquals(taskConfigs.size(), NUM_TASKS);
for (int i = 0; i < taskConfigs.size(); ++i) {
assertEquals(taskConfigs.get(i), props);
}
}
} | [FOCAL] @Override public List<Map<String, String>> CloudPubSubSinkConnector.taskConfigs(int maxTasks)
[CLASS] class CloudPubSubSinkConnector extends SinkConnector
[METRICS] loc=10 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] ArrayList<Map<String, String>>.add/1
[NEW] ArrayList<>, HashMap<>
[FIE... | /* static context
[FOCAL] @Override public List<Map<String, String>> CloudPubSubSinkConnector.taskConfigs(int maxTasks)
[PATH1] for(i < maxTasks)=T -> exit loop -> return configs
[PATH2] for(i < maxTasks)=F -> return configs
[INPUTS] branches=maxTasks | result=-
[FIELDS] read=props:Map<String, String>
[NEW] ArrayList<>... | /* static context
[FOCAL] @Override public List<Map<String, String>> CloudPubSubSinkConnector.taskConfigs(int maxTasks)
[PATH1] for(i < maxTasks)=T -> exit loop -> return configs
[PATH2] for(i < maxTasks)=F -> return configs
[INPUTS] branches=maxTasks | result=-
[FIELDS] read=props:Map<String, String>
[NEW] ArrayList<>... | true | ok | {"focal": {"class": "CloudPubSubSinkConnector", "name": "taskConfigs", "signature": "List<Map<String, String>> taskConfigs(int maxTasks)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "maxTasks", "type": "int"}], "return_type": "List<Map<String, String>>"}, "class_info": {"name": "CloudPubSubSi... |
65507705_13 | class GerritApiClient implements GerritApi {
@Override
public Observable<ServerInfo> getServerInfo() {
return withVersionRequestCheck(mService.getServerInfo());
}
GerritApiClient(String endpoint, Authorization authorization,
PlatformAbstractionLayer abstractionLayer);
privat... | final GerritApiClient client = getGerritClient(ENDPOINT);
ServerInfo info = client.getServerInfo().blockingFirst();
assertNotNull(info);
assertEquals(info.gerrit.docUrl, ENDPOINT + "Documentation/");
}
} | [FOCAL] @Override public Observable<ServerInfo> GerritApiClient.getServerInfo()
[CLASS] class GerritApiClient implements GerritApi
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Observable<T> withVersionRequestCheck(Observable<T> observable)
[CALLS-EXTERNAL] mService.getServerInfo... | class GerritApiClient implements GerritApi {
@Override
public Observable<ServerInfo> getServerInfo() {
return withVersionRequestCheck(mService.getServerInfo());
}
GerritApiClient(String endpoint, Authorization authorization,
PlatformAbstractionLayer abstractionLayer);
privat... | false | ok | {"focal": {"class": "GerritApiClient", "name": "getServerInfo", "signature": "Observable<ServerInfo> getServerInfo()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Observable<ServerInfo>"}, "class_info": {"name": "GerritApiClient", "kind": "class", "modifiers": "", "superclass": null,... | |
65559078_9 | class HarryPotter {
static BigDecimal getPrice(List<Book> books) {
return Function1.of(HarryPotter::getBookSets)
.andThen(HarryPotter::getBundles)
.andThen(HarryPotter::adjustBundles)
.andThen(HarryPotter::getPriceForBundles)
... | assertThat(HarryPotter.getPrice(books(1, 1, 2, 2))).isEqualByComparingTo("30.40");
assertThat(HarryPotter.getPrice(books(1, 1, 2, 3))).isEqualByComparingTo("29.60");
}
} | [FOCAL] static BigDecimal HarryPotter.getPrice(List<Book> books)
[CLASS] class HarryPotter
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Function1.of(HarryPotter::getBookSets) .andThen(HarryPott....apply/1, Function1.of(HarryPotter::getBookSets) .andThen(HarryPott....andThen/1, F... | /* static context
[FOCAL] static BigDecimal HarryPotter.getPrice(List<Book> books)
[INPUTS] branches=- | result=books
[CALLS-EXTERNAL] Function1.of(HarryPotter::getBookSets) .andThen(HarryPott....apply/1, Function1.of(HarryPotter::getBookSets) .andThen(HarryPott....andThen/1, Function1.of(HarryPotter::getBookSets).andT... | /* static context
[FOCAL] static BigDecimal HarryPotter.getPrice(List<Book> books)
[INPUTS] branches=- | result=books
[CALLS-EXTERNAL] Function1.of(HarryPotter::getBookSets) .andThen(HarryPott....apply/1, Function1.of(HarryPotter::getBookSets) .andThen(HarryPott....andThen/1, Function1.of(HarryPotter::getBookSets).andT... | true | ok | {"focal": {"class": "HarryPotter", "name": "getPrice", "signature": "BigDecimal getPrice(List<Book> books)", "start_line": 3, "modifiers": "static", "params": [{"name": "books", "type": "List<Book>"}], "return_type": "BigDecimal"}, "class_info": {"name": "HarryPotter", "kind": "class", "modifiers": "", "superclass": nu... |
65582397_2 | class LogServiceProtoUtil {
public static LogServiceRequestProto toReadLogRequestProto(LogName name, long start, int total) {
LogNameProto logNameProto =
LogNameProto.newBuilder().setName(name.getName()).build();
ReadLogRequestProto.Builder builder = ReadLogRequestProto.newBuilder();
builder.setL... | LogName name = LogName.of("test");
long start = 100;
int total = 5;
LogServiceRequestProto proto = LogServiceProtoUtil.toReadLogRequestProto(name, start, total);
ReadLogRequestProto request = proto.getReadNextQuery();
assertEquals(name.getName(), request.getLogName().getName());
assertEqual... | [FOCAL] public static LogServiceRequestProto LogServiceProtoUtil.toReadLogRequestProto(LogName name, long start, int total)
[CLASS] class LogServiceProtoUtil
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] LogNameProto.newBuilder().setName(name.getName()).build/0, LogNameProto.newB... | /* static context
[FOCAL] public static LogServiceRequestProto LogServiceProtoUtil.toReadLogRequestProto(LogName name, long start, int total)
[COLLABORATORS] param name:LogName getName/0
[CALLS-EXTERNAL] LogNameProto.newBuilder().setName(name.getName()).build/0, LogNameProto.newBuilder().setName/1, LogNameProto.newBuil... | /* static context
[FOCAL] public static LogServiceRequestProto LogServiceProtoUtil.toReadLogRequestProto(LogName name, long start, int total)
[COLLABORATORS] param name:LogName getName/0
[CALLS-EXTERNAL] LogNameProto.newBuilder().setName(name.getName()).build/0, LogNameProto.newBuilder().setName/1, LogNameProto.newBuil... | true | ok | {"focal": {"class": "LogServiceProtoUtil", "name": "toReadLogRequestProto", "signature": "LogServiceRequestProto toReadLogRequestProto(LogName name, long start, int total)", "start_line": 3, "modifiers": "public static", "params": [{"name": "name", "type": "LogName"}, {"name": "start", "type": "long"}, {"name": "total"... |
65604083_16 | class PermutationSampler implements SharedStateSampler<PermutationSampler> {
public static int[] natural(int n) {
final int[] a = new int[n];
for (int i = 0; i < n; i++) {
a[i] = i;
}
return a;
}
public PermutationSampler(UniformRandomProvider rng,
... | final int[] natural = PermutationSampler.natural(0);
Assert.assertEquals(0, natural.length);
}
} | [FOCAL] public static int[] PermutationSampler.natural(int n)
[CLASS] class PermutationSampler implements SharedStateSampler<PermutationSampler>
[METRICS] loc=7 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[PATH1] for(i < n)=T -> exit loop -> return a
[PATH2] for(i < n)=F -> return a
[INPUTS] branches=n | resul... | /* static context
[FOCAL] public static int[] PermutationSampler.natural(int n)
[PATH1] for(i < n)=T -> exit loop -> return a
[PATH2] for(i < n)=F -> return a
[INPUTS] branches=n | result=n
*/
| /* static context
[FOCAL] public static int[] PermutationSampler.natural(int n)
[PATH1] for(i < n)=T -> exit loop -> return a
[PATH2] for(i < n)=F -> return a
[INPUTS] branches=n | result=n
*/
class PermutationSampler implements SharedStateSampler<PermutationSampler> {
public static int[] natural(int n) {
... | true | ok | {"focal": {"class": "PermutationSampler", "name": "natural", "signature": "int[] natural(int n)", "start_line": 3, "modifiers": "public static", "params": [{"name": "n", "type": "int"}], "return_type": "int[]"}, "class_info": {"name": "PermutationSampler", "kind": "class", "modifiers": "", "superclass": null, "interfac... |
65606855_51 | class CheckInHistoryViewModel extends ViewModel {
public List<CheckInDetail> getCheckInDetails(Attendee attendee, List<CheckInDetail> checkInDetails) {
String[] checkInTimes = attendee.getCheckinTimes().split(",");
String[] checkOutTimes = attendee.getCheckoutTimes().split(",");
for (int i... | List<CheckInDetail> ch = new ArrayList<>();
List<CheckInDetail> checkInDetails = checkInHistoryViewModel.getCheckInDetails(ATTENDEE, ch);
assertEquals(checkInDetails.get(0).getCheckTime(), "2018-07-20T20:36:32.822+03:00");
assertEquals(checkInDetails.get(0).getScanAction(), SCAN_IN);
... | [FOCAL] public List<CheckInDetail> CheckInHistoryViewModel.getCheckInDetails(Attendee attendee, List<CheckInDetail> checkInDetails)
[CLASS] class CheckInHistoryViewModel extends ViewModel
[METRICS] loc=20 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] attendee.getCheckinTimes().split/1, Attendee.... | /* static context
[FOCAL] public List<CheckInDetail> CheckInHistoryViewModel.getCheckInDetails(Attendee attendee, List<CheckInDetail> checkInDetails)
[PATH1] for(i < checkInTimes.length + checkOutTimes.length)=T -> if(i % 2 == 0)=T -> exit loop -> return checkInDetails
[PATH2] for(i < checkInTimes.length + checkOutTime... | /* static context
[FOCAL] public List<CheckInDetail> CheckInHistoryViewModel.getCheckInDetails(Attendee attendee, List<CheckInDetail> checkInDetails)
[PATH1] for(i < checkInTimes.length + checkOutTimes.length)=T -> if(i % 2 == 0)=T -> exit loop -> return checkInDetails
[PATH2] for(i < checkInTimes.length + checkOutTime... | true | ok | {"focal": {"class": "CheckInHistoryViewModel", "name": "getCheckInDetails", "signature": "List<CheckInDetail> getCheckInDetails(Attendee attendee, List<CheckInDetail> checkInDetails)", "start_line": 3, "modifiers": "public", "params": [{"name": "attendee", "type": "Attendee"}, {"name": "checkInDetails", "type": "List<C... |
65701037_10 | class ModifyTextPresenter implements ModifyTextContract.Presenter {
@Override
public void modifyText(String title, String oldString, String modifyString) {
if (StringUtils.isEmpty(modifyString)) {
view.showTip(title + "不能为空");
return;
}
// 旧文字为空或旧文字和新文字不相等,视为已修改... | String title = "昵称";
String oldString = "";
String modifyString = "bbb";
presenter.modifyText(title, oldString, modifyString);
verify(view).modifyTextSuccess(true, "bbb");
}
} | [FOCAL] @Override public void ModifyTextPresenter.modifyText(String title, String oldString, String modifyString)
[CLASS] class ModifyTextPresenter implements ModifyTextContract.Presenter
[METRICS] loc=11 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] StringUtils.isEmpty/1, ModifyTextContract.Vie... | /* static context
[FOCAL] @Override public void ModifyTextPresenter.modifyText(String title, String oldString, String modifyString)
[PATH1] if(StringUtils.isEmpty(modifyString))=T -> return
[PATH2] if(StringUtils.isEmpty(modifyString))=F
[INPUTS] branches=modifyString | result=-
[COLLABORATORS] field view:ModifyTextCon... | /* static context
[FOCAL] @Override public void ModifyTextPresenter.modifyText(String title, String oldString, String modifyString)
[PATH1] if(StringUtils.isEmpty(modifyString))=T -> return
[PATH2] if(StringUtils.isEmpty(modifyString))=F
[INPUTS] branches=modifyString | result=-
[COLLABORATORS] field view:ModifyTextCon... | true | ok | {"focal": {"class": "ModifyTextPresenter", "name": "modifyText", "signature": "void modifyText(String title, String oldString, String modifyString)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "title", "type": "String"}, {"name": "oldString", "type": "String"}, {"name": "modifyString", "type"... |
65751573_64 | class BigQueryRecordConverter implements RecordConverter<Map<String, Object>> {
public Map<String, Object> convertRecord(SinkRecord record, KafkaSchemaRecordType recordType) {
Schema kafkaConnectSchema = recordType == KafkaSchemaRecordType.KEY ? record.keySchema() : record.valueSchema();
Object kafkaConnectS... | Map kafkaConnectMap = new HashMap<Object, Object>(){{
put("f1", "abc");
put("f2", "abc");
put("f3", null);
}};
SinkRecord kafkaConnectRecord = spoofSinkRecord(null, kafkaConnectMap, true);
Map<String, Object> stringObjectMap = new BigQueryRecordConverter(SHOULD_CONVERT_DOUBLE).convert... | [FOCAL] public Map<String, Object> BigQueryRecordConverter.convertRecord(SinkRecord record, KafkaSchemaRecordType recordType)
[CLASS] class BigQueryRecordConverter implements RecordConverter<Map<String, Object>>
[METRICS] loc=16 cc=4 branches=3 loops=0 returns=2 throws=2 nesting=2
[CALLS-INTERNAL] Map<String, Object> c... | /* static context
[FOCAL] public Map<String, Object> BigQueryRecordConverter.convertRecord(SinkRecord record, KafkaSchemaRecordType recordType)
[THROWS-WHEN] ConversionConnectException when kafkaConnectSchema == null && !(kafkaConnectStruct instanceof Map)
[THROWS-WHEN] ConversionConnectException when !(kafkaConnectSch... | /* static context
[FOCAL] public Map<String, Object> BigQueryRecordConverter.convertRecord(SinkRecord record, KafkaSchemaRecordType recordType)
[THROWS-WHEN] ConversionConnectException when kafkaConnectSchema == null && !(kafkaConnectStruct instanceof Map)
[THROWS-WHEN] ConversionConnectException when !(kafkaConnectSch... | true | ok | {"focal": {"class": "BigQueryRecordConverter", "name": "convertRecord", "signature": "Map<String, Object> convertRecord(SinkRecord record, KafkaSchemaRecordType recordType)", "start_line": 3, "modifiers": "public", "params": [{"name": "record", "type": "SinkRecord"}, {"name": "recordType", "type": "KafkaSchemaRecordTyp... |
65800867_31 | class ProfileResultProcessor {
public ProfileResult process(List<Run> runs) {
if (runs.isEmpty()) {
return null;
}
List<RootSingleProfileResult> results = new ArrayList<>();
for (Run run : runs) {
results.add(processSingleRun(run));
}
if (res... | assertNull(mProcessor.process(Collections.<Run>emptyList()));
}
} | [FOCAL] public ProfileResult ProfileResultProcessor.process(List<Run> runs)
[CLASS] class ProfileResultProcessor
[METRICS] loc=14 cc=4 branches=2 loops=1 returns=3 throws=0 nesting=1
[CALLS-INTERNAL] ProfileResult takeAverage(List<RootSingleProfileResult> singleProfileResults); RootSingleProfileResult processSingleRun(... | /* static context
[FOCAL] public ProfileResult ProfileResultProcessor.process(List<Run> runs)
[PATH1] if(runs.isEmpty())=F -> foreach(Run run : runs)=T -> exit loop -> if(results.size() == 1)=T -> return results.get(0)
[PATH2] if(runs.isEmpty())=F -> foreach(Run run : runs)=F -> if(results.size() == 1)=F -> return take... | /* static context
[FOCAL] public ProfileResult ProfileResultProcessor.process(List<Run> runs)
[PATH1] if(runs.isEmpty())=F -> foreach(Run run : runs)=T -> exit loop -> if(results.size() == 1)=T -> return results.get(0)
[PATH2] if(runs.isEmpty())=F -> foreach(Run run : runs)=F -> if(results.size() == 1)=F -> return take... | true | ok | {"focal": {"class": "ProfileResultProcessor", "name": "process", "signature": "ProfileResult process(List<Run> runs)", "start_line": 3, "modifiers": "public", "params": [{"name": "runs", "type": "List<Run>"}], "return_type": "ProfileResult"}, "class_info": {"name": "ProfileResultProcessor", "kind": "class", "modifiers"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.