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 |
|---|---|---|---|---|---|---|---|---|
79723681_1 | class OpenApiEndpointSource implements EndpointSource {
@Override
public Iterable<Endpoint> listEndpoints() {
List<Endpoint> endpoints = new ArrayList<>();
String basePath = findBasePath();
Map<String, Path> paths = OpenApiHelper.openApi3.getPaths();
if(log.isInfoEnabled()) l... | OpenApiEndpointSource source = new OpenApiEndpointSource();
Iterable<EndpointSource.Endpoint> endpoints = source.listEndpoints();
// Extract a set of string representations of endpoints
Set<String> endpointStrings = StreamSupport
.stream(endpoints.spliterator(), false)
... | [FOCAL] @Override public Iterable<Endpoint> OpenApiEndpointSource.listEndpoints()
[CLASS] class OpenApiEndpointSource implements EndpointSource
[METRICS] loc=19 cc=5 branches=2 loops=2 returns=1 throws=0 nesting=3
[CALLS-INTERNAL] String findBasePath()
[CALLS-EXTERNAL] OpenApiHelper.openApi3.getPaths/0, log.isInfoEnabl... | /* static context
[FOCAL] @Override public Iterable<Endpoint> OpenApiEndpointSource.listEndpoints()
[PATH1] if(log.isInfoEnabled())=T -> foreach(Map.Entry<String, Path> pathPair : paths.entrySet())=T -> foreach(String method : pathPair.getValue().getOperations().keySet())=T -> if(log.isDebugEnabled())=T -> exit loop ->... | /* static context
[FOCAL] @Override public Iterable<Endpoint> OpenApiEndpointSource.listEndpoints()
[PATH1] if(log.isInfoEnabled())=T -> foreach(Map.Entry<String, Path> pathPair : paths.entrySet())=T -> foreach(String method : pathPair.getValue().getOperations().keySet())=T -> if(log.isDebugEnabled())=T -> exit loop ->... | true | ok | {"focal": {"class": "OpenApiEndpointSource", "name": "listEndpoints", "signature": "Iterable<Endpoint> listEndpoints()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Iterable<Endpoint>"}, "class_info": {"name": "OpenApiEndpointSource", "kind": "class", "modifiers": "", "superclass": n... |
79736675_14 | class WitchCore {
public void doBind(Object target, ViewFinder viewFinder) {
Object viewHolder = getOrCreateViewHolder(target, viewFinder);
TargetViewBinder targetViewBinder = getOrCreateBinder(target, viewFinder);
targetViewBinder.bind(viewHolder, viewFinder, target);
if (loggingE... | // When
core.doBind(target, viewFinder);
// Then
verify(viewFinder).putViewHolder(same(target.getClass()), same(viewHolderFromFactory));
verify(targetViewBinderFromFactory).bind(same(viewHolderFromFactory), same(viewFinder), same(target));
}
} | [FOCAL] public void WitchCore.doBind(Object target, ViewFinder viewFinder)
[CLASS] class WitchCore
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] Object getOrCreateViewHolder(Object target, ViewFinder viewFinder); TargetViewBinder getOrCreateBinder(Object target, ViewFinder viewF... | /* static context
[FOCAL] public void WitchCore.doBind(Object target, ViewFinder viewFinder)
[PATH1] if(loggingEnabled && logger != null)=T
[PATH2] if(loggingEnabled && logger != null)=F
[INPUTS] branches=logger | result=-
[CALLS-INTERNAL] Object getOrCreateViewHolder(Object target, ViewFinder viewFinder); TargetViewBi... | /* static context
[FOCAL] public void WitchCore.doBind(Object target, ViewFinder viewFinder)
[PATH1] if(loggingEnabled && logger != null)=T
[PATH2] if(loggingEnabled && logger != null)=F
[INPUTS] branches=logger | result=-
[CALLS-INTERNAL] Object getOrCreateViewHolder(Object target, ViewFinder viewFinder); TargetViewBi... | true | ok | {"focal": {"class": "WitchCore", "name": "doBind", "signature": "void doBind(Object target, ViewFinder viewFinder)", "start_line": 3, "modifiers": "public", "params": [{"name": "target", "type": "Object"}, {"name": "viewFinder", "type": "ViewFinder"}], "return_type": "void"}, "class_info": {"name": "WitchCore", "kind":... |
79741030_15 | class Creator {
protected static int getSetBitOffset(final int mask,
final int bitIndex) {
int count = 0; // index of the next bit seen being set
int workingMask = mask; // the left unseen bits are set
int low = Integer.numberOfTrailingZeros(workingMask);
workingMask >>>... | int v = Creator.getSetBitOffset(3, 1);
assertEquals(1, v);
}
} | [FOCAL] protected static int Creator.getSetBitOffset(int mask, int bitIndex)
[CLASS] class Creator
[METRICS] loc=18 cc=4 branches=2 loops=1 returns=2 throws=0 nesting=3
[CALLS-EXTERNAL] Integer.numberOfTrailingZeros/1
[PATH1] for(workingMask != 0)=T -> if((workingMask & 1) != 0)=T -> if(count == bitIndex)=F -> exit loo... | /* static context
[FOCAL] protected static int Creator.getSetBitOffset(int mask, int bitIndex)
[PATH1] for(workingMask != 0)=T -> if((workingMask & 1) != 0)=T -> if(count == bitIndex)=F -> exit loop -> return -1
[PATH2] for(workingMask != 0)=T -> if((workingMask & 1) != 0)=T -> if(count == bitIndex)=T -> return i
[PATH... | /* static context
[FOCAL] protected static int Creator.getSetBitOffset(int mask, int bitIndex)
[PATH1] for(workingMask != 0)=T -> if((workingMask & 1) != 0)=T -> if(count == bitIndex)=F -> exit loop -> return -1
[PATH2] for(workingMask != 0)=T -> if((workingMask & 1) != 0)=T -> if(count == bitIndex)=T -> return i
[PATH... | true | ok | {"focal": {"class": "Creator", "name": "getSetBitOffset", "signature": "int getSetBitOffset(int mask, int bitIndex)", "start_line": 3, "modifiers": "protected static", "params": [{"name": "mask", "type": "int"}, {"name": "bitIndex", "type": "int"}], "return_type": "int"}, "class_info": {"name": "Creator", "kind": "clas... |
79750743_0 | class GroupSummaryMessageExtractor extends BasicMessageExtractor {
@Override
public CharSequence[] getTitleAndText(String appPackageName, Bundle extras, int notificationFlags) {
DebugLog debugLog = getDebugLog();
if (isLoggingEnabled()) {
debugLog.writeLog("Entered GroupSummaryMessa... | MessageExtractor extractor = new GroupSummaryMessageExtractor(true);
assertTitleAndTextEqual("Alice", null,
getTitleAndText(extractor, REGULAR, "Alice", "Hello there!"));
assertTitleAndTextEqual("Alice", "Hello there!",
getTitleAndText(extractor, SUMMARY, "Alice... | [FOCAL] @Override public CharSequence[] GroupSummaryMessageExtractor.getTitleAndText(String appPackageName, Bundle extras, int notificationFlags)
[CLASS] class GroupSummaryMessageExtractor extends BasicMessageExtractor
[METRICS] loc=89 cc=16 branches=15 loops=0 returns=5 throws=0 nesting=3
[CALLS-INTERNAL] CharSequence... | /* static context
[FOCAL] @Override public CharSequence[] GroupSummaryMessageExtractor.getTitleAndText(String appPackageName, Bundle extras, int notificationFlags)
[INPUTS] branches=extras, notificationFlags | result=appPackageName, extras, notificationFlags
*/
| /* static context
[FOCAL] @Override public CharSequence[] GroupSummaryMessageExtractor.getTitleAndText(String appPackageName, Bundle extras, int notificationFlags)
[INPUTS] branches=extras, notificationFlags | result=appPackageName, extras, notificationFlags
*/
class GroupSummaryMessageExtractor extends BasicMessageExt... | true | ok | {"focal": {"class": "GroupSummaryMessageExtractor", "name": "getTitleAndText", "signature": "CharSequence[] getTitleAndText(String appPackageName, Bundle extras, int notificationFlags)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "appPackageName", "type": "String"}, {"name": "extras", "type":... |
79943898_35 | class OnPostViewClickListener implements OnViewClickListener {
@Override
public void onViewClick(final View sharedElementView, final Post post) {
final Intent intent = new Intent(activity.getApplicationContext(), PostActivity.class);
intent.putExtras(getExtras(post));
final ActivityOpti... | onPostViewClickListener.onViewClick(viewMock, post);
final ShadowActivity shadowActivity = Shadows.shadowOf(postsActivity);
final Intent intent = shadowActivity.peekNextStartedActivityForResult().intent;
assertThat(intent.getComponent()).isEqualTo(new ComponentName(postsActivity, PostAc... | [FOCAL] @Override public void OnPostViewClickListener.onViewClick(View sharedElementView, Post post)
[CLASS] class OnPostViewClickListener implements OnViewClickListener
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] Bundle getExtras(Post post)
[CALLS-EXTERNAL] activity.getApplica... | /* static context
[FOCAL] @Override public void OnPostViewClickListener.onViewClick(View sharedElementView, Post post)
[COLLABORATORS] field activity getApplicationContext/0
[CALLS-INTERNAL] Bundle getExtras(Post post)
[NEW] Intent
[CALLS-EXTERNAL] activity.getApplicationContext/0, Intent.putExtras/1, ActivityOptionsCo... | /* static context
[FOCAL] @Override public void OnPostViewClickListener.onViewClick(View sharedElementView, Post post)
[COLLABORATORS] field activity getApplicationContext/0
[CALLS-INTERNAL] Bundle getExtras(Post post)
[NEW] Intent
[CALLS-EXTERNAL] activity.getApplicationContext/0, Intent.putExtras/1, ActivityOptionsCo... | true | ok | {"focal": {"class": "OnPostViewClickListener", "name": "onViewClick", "signature": "void onViewClick(View sharedElementView, Post post)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "sharedElementView", "type": "View"}, {"name": "post", "type": "Post"}], "return_type": "void"}, "class_info": {... |
79946335_11 | class ReduceByKey extends StateAwareWindowWiseSingleInputOperator<
IN, IN, IN, KEY, Pair<KEY, OUT>, W,
ReduceByKey<IN, KEY, VALUE, OUT, W>> {
public static <IN> KeyByBuilder<IN> of(Dataset<IN> input) {
return new KeyByBuilder<>("ReduceByKey", input);
}
@SuppressWarnings("unchecked") ReduceB... | Flow flow = Flow.create("TEST");
Dataset<String> dataset = Util.createMockDataset(flow, 2);
ReduceByKey.of(dataset)
.keyBy(s -> s)
.valueBy(s -> 1L)
.reduceBy(n -> StreamSupport.stream(n.spliterator(), false).mapToLong(Long::new).sum())
.output();
ReduceByKey reduce = (... | [FOCAL] public static KeyByBuilder<IN> ReduceByKey.of(Dataset<IN> input)
[CLASS] class ReduceByKey extends StateAwareWindowWiseSingleInputOperator< IN, IN, IN, KEY, Pair<KEY, OUT>, W, ReduceByKey<IN, KEY, VALUE, OUT, W>>
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] KeyByBuilder<>
[INPUTS] ... | /* static context
[FOCAL] public static KeyByBuilder<IN> ReduceByKey.of(Dataset<IN> input)
[INPUTS] branches=- | result=input
[NEW] KeyByBuilder<>
*/
| /* static context
[FOCAL] public static KeyByBuilder<IN> ReduceByKey.of(Dataset<IN> input)
[INPUTS] branches=- | result=input
[NEW] KeyByBuilder<>
*/
class ReduceByKey extends StateAwareWindowWiseSingleInputOperator<
IN, IN, IN, KEY, Pair<KEY, OUT>, W,
ReduceByKey<IN, KEY, VALUE, OUT, W>> {
public st... | true | ok | {"focal": {"class": "ReduceByKey", "name": "of", "signature": "KeyByBuilder<IN> of(Dataset<IN> input)", "start_line": 5, "modifiers": "public static", "params": [{"name": "input", "type": "Dataset<IN>"}], "return_type": "KeyByBuilder<IN>"}, "class_info": {"name": "ReduceByKey", "kind": "class", "modifiers": "", "superc... |
79994161_2 | class RxOkuki {
public static Observable<Place> onAnyPlace(Okuki okuki) {
return Observable.create(new OnGlobalPlaceOnSubscribe(okuki));
}
private RxOkuki();
public static Observable<P> onPlace(Okuki okuki, Class<P> clazz);
public static Observable<Place> onBranch(Okuki okuki, Class<B> c... | TestSubscriber<Place> testObserver = TestSubscriber.create();
RxOkuki.onAnyPlace(okuki).subscribe(testObserver);
verify(okuki).addGlobalListener(isA(GlobalListener.class));
testObserver.unsubscribe();
verify(okuki).removeGlobalListener(isA(GlobalListener.class));
}
} | [FOCAL] public static Observable<Place> RxOkuki.onAnyPlace(Okuki okuki)
[CLASS] class RxOkuki
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Observable.create/1
[NEW] OnGlobalPlaceOnSubscribe
[INPUTS] branches=- | result=okuki
[DATAFLOW] okuki@param->L2
[CLASS-MEMBERS] RxOkuki(); ... | /* static context
[FOCAL] public static Observable<Place> RxOkuki.onAnyPlace(Okuki okuki)
[INPUTS] branches=- | result=okuki
[NEW] OnGlobalPlaceOnSubscribe
[CALLS-EXTERNAL] Observable.create/1
*/
| /* static context
[FOCAL] public static Observable<Place> RxOkuki.onAnyPlace(Okuki okuki)
[INPUTS] branches=- | result=okuki
[NEW] OnGlobalPlaceOnSubscribe
[CALLS-EXTERNAL] Observable.create/1
*/
class RxOkuki {
public static Observable<Place> onAnyPlace(Okuki okuki) {
return Observable.create(new OnGlobal... | true | ok | {"focal": {"class": "RxOkuki", "name": "onAnyPlace", "signature": "Observable<Place> onAnyPlace(Okuki okuki)", "start_line": 3, "modifiers": "public static", "params": [{"name": "okuki", "type": "Okuki"}], "return_type": "Observable<Place>"}, "class_info": {"name": "RxOkuki", "kind": "class", "modifiers": "", "supercla... |
80027205_4 | class TimeData {
static byte[] timezoneWithDstOffset(Calendar time) {
// See https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.local_time_information.xml
// UTC-1:00 = -4
// UTC+0:00 = 0
// UTC+1:00 = 4
int timezone = time.ge... | Calendar bst = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
bst.set(Calendar.MONTH, Calendar.JUNE);
bst.set(Calendar.DST_OFFSET, ONE_HOUR);
assertArrayEquals(
new byte[] {0, 4},
TimeData.timezoneWithDstOffset(bst)
);
}
} | [FOCAL] static byte[] TimeData.timezoneWithDstOffset(Calendar time)
[CLASS] class TimeData
[METRICS] loc=15 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Calendar.get/1, ByteBuffer.allocate(2) .order(ByteOrder.LITTLE_ENDIAN) .p....array/0, ByteBuffer.allocate(2) .order(ByteOrder.LITTLE_ENDIAN) .... | /* static context
[FOCAL] static byte[] TimeData.timezoneWithDstOffset(Calendar time)
[INPUTS] branches=- | result=time
[COLLABORATORS] param time:Calendar get/1
[CALLS-EXTERNAL] Calendar.get/1, ByteBuffer.allocate(2) .order(ByteOrder.LITTLE_ENDIAN) .p....array/0, ByteBuffer.allocate(2) .order(ByteOrder.LITTLE_ENDIAN) ... | /* static context
[FOCAL] static byte[] TimeData.timezoneWithDstOffset(Calendar time)
[INPUTS] branches=- | result=time
[COLLABORATORS] param time:Calendar get/1
[CALLS-EXTERNAL] Calendar.get/1, ByteBuffer.allocate(2) .order(ByteOrder.LITTLE_ENDIAN) .p....array/0, ByteBuffer.allocate(2) .order(ByteOrder.LITTLE_ENDIAN) ... | true | ok | {"focal": {"class": "TimeData", "name": "timezoneWithDstOffset", "signature": "byte[] timezoneWithDstOffset(Calendar time)", "start_line": 3, "modifiers": "static", "params": [{"name": "time", "type": "Calendar"}], "return_type": "byte[]"}, "class_info": {"name": "TimeData", "kind": "class", "modifiers": "", "superclas... |
80043676_185 | class ZclAttribute {
public Future<CommandResult> reportValue(Object value) {
return cluster.reportAttribute(id, dataType, value);
}
public ZclAttribute();
public ZclAttribute(final ZclCluster cluster, final int id, final String name, final ZclDataType dataType,
final boolean man... | ZclCluster cluster = Mockito.mock(ZclCluster.class);
ZclAttribute attribute = new ZclAttribute(cluster, 123, "Test Name", ZclDataType.UNSIGNED_8_BIT_INTEGER, false,
false, false, false);
Integer value = Integer.valueOf(888);
attribute.reportValue(value);
Mockito.... | [FOCAL] public Future<CommandResult> ZclAttribute.reportValue(Object value)
[CLASS] class ZclAttribute
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] cluster.reportAttribute/3
[INPUTS] branches=- | result=value
[COLLABORATORS] field cluster reportAttribute/3
[DATAFLOW] value@param... | /* static context
[FOCAL] public Future<CommandResult> ZclAttribute.reportValue(Object value)
[INPUTS] branches=- | result=value
[COLLABORATORS] field cluster reportAttribute/3
[CALLS-EXTERNAL] cluster.reportAttribute/3
*/
| /* static context
[FOCAL] public Future<CommandResult> ZclAttribute.reportValue(Object value)
[INPUTS] branches=- | result=value
[COLLABORATORS] field cluster reportAttribute/3
[CALLS-EXTERNAL] cluster.reportAttribute/3
*/
class ZclAttribute {
public Future<CommandResult> reportValue(Object value) {
return... | true | ok | {"focal": {"class": "ZclAttribute", "name": "reportValue", "signature": "Future<CommandResult> reportValue(Object value)", "start_line": 3, "modifiers": "public", "params": [{"name": "value", "type": "Object"}], "return_type": "Future<CommandResult>"}, "class_info": {"name": "ZclAttribute", "kind": "class", "modifiers"... |
80046613_1 | class VcapParser implements EnvironmentPostProcessor {
VcapResult parse(String vcapServices)
{
VcapResult result = new VcapResult();
List<VcapPojo> results = new ArrayList<VcapPojo>();
log("VcapParser.parse: vcapServices = " + vcapServices);
if (vcapServices != null)
{
try
{
JSONObject json = ... | Resource resource = new ClassPathResource("/vcap2.json");
String content;
try
{
content = new String(Files.readAllBytes(Paths.get(resource.getURI())));
VcapResult result = parser.parse(content);
VcapPojo[] pojos = result.getPojos();
assertNotNull(pojos);
assertEquals(1, pojos.length);
VcapPoj... | [FOCAL] VcapResult VcapParser.parse(String vcapServices)
[CLASS] class VcapParser implements EnvironmentPostProcessor
[METRICS] loc=37 cc=6 branches=2 loops=2 returns=1 throws=0 nesting=5
[CALLS-INTERNAL] VcapPojo parseService(String serviceBrokerName, JSONArray azureService, String vCapServices, int index); void log(S... | /* static context
[FOCAL] VcapResult VcapParser.parse(String vcapServices)
[PATH1] if(vcapServices != null)=T -> for(i < names.length())=T -> if(name.startsWith(AZURE))=T -> for(index < numElements)=F -> exit loop -> return result
[PATH2] if(vcapServices != null)=F -> return result
[PATH3] if(vcapServices != null)=T ->... | /* static context
[FOCAL] VcapResult VcapParser.parse(String vcapServices)
[PATH1] if(vcapServices != null)=T -> for(i < names.length())=T -> if(name.startsWith(AZURE))=T -> for(index < numElements)=F -> exit loop -> return result
[PATH2] if(vcapServices != null)=F -> return result
[PATH3] if(vcapServices != null)=T ->... | true | ok | {"focal": {"class": "VcapParser", "name": "parse", "signature": "VcapResult parse(String vcapServices)", "start_line": 3, "modifiers": "", "params": [{"name": "vcapServices", "type": "String"}], "return_type": "VcapResult"}, "class_info": {"name": "VcapParser", "kind": "class", "modifiers": "", "superclass": null, "int... |
80087888_5 | class MongolCode {
public static String getSuffixYinUnU(Gender previousWordGender, char previousWordLastChar) {
if (isVowel(previousWordLastChar)) {
return Suffix.YIN;
} else if (previousWordLastChar == Uni.NA) {
if (previousWordGender == Gender.MASCULINE) {
... | char wordLastChar = MongolCode.Uni.OE;
String result = MongolCode.getSuffixYinUnU(MongolCode.Gender.MASCULINE, wordLastChar);
String expected = MongolCode.Suffix.YIN;
assertEquals(expected, result);
}
} | [FOCAL] public static String MongolCode.getSuffixYinUnU(Gender previousWordGender, char previousWordLastChar)
[CLASS] class MongolCode
[METRICS] loc=17 cc=5 branches=4 loops=0 returns=5 throws=0 nesting=3
[CALLS-INTERNAL] boolean isVowel(char character)
[PATH1] if(isVowel(previousWordLastChar))=F -> if(previousWordLast... | /* static context
[FOCAL] public static String MongolCode.getSuffixYinUnU(Gender previousWordGender, char previousWordLastChar)
[PATH1] if(isVowel(previousWordLastChar))=F -> if(previousWordLastChar == Uni.NA)=T -> if(previousWordGender == Gender.MASCULINE)#1=T -> return Suffix.U
[PATH2] if(isVowel(previousWordLastChar... | /* static context
[FOCAL] public static String MongolCode.getSuffixYinUnU(Gender previousWordGender, char previousWordLastChar)
[PATH1] if(isVowel(previousWordLastChar))=F -> if(previousWordLastChar == Uni.NA)=T -> if(previousWordGender == Gender.MASCULINE)#1=T -> return Suffix.U
[PATH2] if(isVowel(previousWordLastChar... | true | ok | {"focal": {"class": "MongolCode", "name": "getSuffixYinUnU", "signature": "String getSuffixYinUnU(Gender previousWordGender, char previousWordLastChar)", "start_line": 3, "modifiers": "public static", "params": [{"name": "previousWordGender", "type": "Gender"}, {"name": "previousWordLastChar", "type": "char"}], "return... |
80098624_35 | class HumanCoffeeNetUser extends AbstractCoffeeNetUser {
@Override
public boolean isCoffeeNetAdmin() {
return getAuthorities().contains(new SimpleGrantedAuthority("ROLE_COFFEENET-ADMIN"));
}
public HumanCoffeeNetUser(String username, String email, Collection<GrantedAuthority> authorities);
... |
HumanCoffeeNetUser sut = new HumanCoffeeNetUser("username", "email@coffeenet", emptyList());
assertThat(sut.isCoffeeNetAdmin(), is(false));
}
} | [FOCAL] @Override public boolean HumanCoffeeNetUser.isCoffeeNetAdmin()
[CLASS] class HumanCoffeeNetUser extends AbstractCoffeeNetUser
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Collection<GrantedAuthority> getAuthorities()
[CALLS-EXTERNAL] getAuthorities().contains/1
[NEW] Sim... | /* static context
[FOCAL] @Override public boolean HumanCoffeeNetUser.isCoffeeNetAdmin()
[CALLS-INTERNAL] Collection<GrantedAuthority> getAuthorities()
[NEW] SimpleGrantedAuthority
[CALLS-EXTERNAL] getAuthorities().contains/1
*/
| /* static context
[FOCAL] @Override public boolean HumanCoffeeNetUser.isCoffeeNetAdmin()
[CALLS-INTERNAL] Collection<GrantedAuthority> getAuthorities()
[NEW] SimpleGrantedAuthority
[CALLS-EXTERNAL] getAuthorities().contains/1
*/
class HumanCoffeeNetUser extends AbstractCoffeeNetUser {
@Override
public boolean ... | true | ok | {"focal": {"class": "HumanCoffeeNetUser", "name": "isCoffeeNetAdmin", "signature": "boolean isCoffeeNetAdmin()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "boolean"}, "class_info": {"name": "HumanCoffeeNetUser", "kind": "class", "modifiers": "", "superclass": "AbstractCoffeeNetUser"... |
80161946_0 | class Client {
public List<Object> fetchAndProcessData(String dateTime) throws UnirestException {
Optional<JsonNode> data = loadProviderJson(dateTime);
System.out.println("data=" + data);
if (data != null && data.isPresent()) {
JSONObject jsonObject = data.get().getObject();
int value = 100 ... |
String date = "2013-08-16T15:31:20+1000";
stubFor(get(urlPathEqualTo("/provider.json"))
.withQueryParam("validDate", matching(".+"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody("{\"test\": \"NO\", \"validDate\": \"" + d... | [FOCAL] public List<Object> Client.fetchAndProcessData(String dateTime)
[CLASS] class Client
[METRICS] loc=18 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] Optional<JsonNode> loadProviderJson(String dateTime)
[CALLS-EXTERNAL] System.out.println/1, Optional<JsonNode>.isPresent/0, data.get().getOb... | /* static context
[FOCAL] public List<Object> Client.fetchAndProcessData(String dateTime)
[PATH1] if(data != null && data.isPresent())=T -> return Arrays.asList(value, OffsetDateTime.from(date))
[PATH2] if(data != null && data.isPresent())=F -> return Arrays.asList(0, null)
[INPUTS] branches=dateTime | result=dateTime
... | /* static context
[FOCAL] public List<Object> Client.fetchAndProcessData(String dateTime)
[PATH1] if(data != null && data.isPresent())=T -> return Arrays.asList(value, OffsetDateTime.from(date))
[PATH2] if(data != null && data.isPresent())=F -> return Arrays.asList(0, null)
[INPUTS] branches=dateTime | result=dateTime
... | true | ok | {"focal": {"class": "Client", "name": "fetchAndProcessData", "signature": "List<Object> fetchAndProcessData(String dateTime) throws UnirestException", "start_line": 3, "modifiers": "public", "params": [{"name": "dateTime", "type": "String"}], "return_type": "List<Object>"}, "class_info": {"name": "Client", "kind": "cla... |
80179724_33 | class RequiredPropAnnotator implements Annotator {
static void annotate(
PsiElement element,
BiConsumer<Collection<String>, PsiReferenceExpression> errorHandler,
Function<PsiMethodCallExpression, PsiClass> generatedClassResolver) {
if (element instanceof PsiDeclarationStatement) {
Arrays.... | testHelper.getPsiClass(
psiClasses -> {
assertEquals(2, psiClasses.size());
PsiClass underTest = psiClasses.get(0);
PsiClass component = psiClasses.get(1);
// For testing environment
Function<PsiMethodCallExpression, PsiClass> resolver =
psiM... | [FOCAL] static void RequiredPropAnnotator.annotate(PsiElement element, BiConsumer<Collection<String>, PsiReferenceExpression> errorHandler, Function<PsiMethodCallExpression, PsiClass> generatedClassResolver)
[CLASS] class RequiredPropAnnotator implements Annotator
[METRICS] loc=18 cc=4 branches=3 loops=0 returns=0 thro... | /* static context
[FOCAL] static void RequiredPropAnnotator.annotate(PsiElement element, BiConsumer<Collection<String>, PsiReferenceExpression> errorHandler, Function<PsiMethodCallExpression, PsiClass> generatedClassResolver)
[PATH1] if(element instanceof PsiDeclarationStatement)=F -> if(element instanceof PsiExpressio... | /* static context
[FOCAL] static void RequiredPropAnnotator.annotate(PsiElement element, BiConsumer<Collection<String>, PsiReferenceExpression> errorHandler, Function<PsiMethodCallExpression, PsiClass> generatedClassResolver)
[PATH1] if(element instanceof PsiDeclarationStatement)=F -> if(element instanceof PsiExpressio... | true | ok | {"focal": {"class": "RequiredPropAnnotator", "name": "annotate", "signature": "void annotate(PsiElement element, BiConsumer<Collection<String>, PsiReferenceExpression> errorHandler, Function<PsiMethodCallExpression, PsiClass> generatedClassResolver)", "start_line": 3, "modifiers": "static", "params": [{"name": "element... |
80192374_0 | class LoginPresenter extends BasePresenter<V> implements LoginMvpPresenter<V> {
@Override
public void onServerLoginClick(String email, String password) {
//validate email and password
if (email == null || email.isEmpty()) {
getMvpView().onError(R.string.empty_email);
ret... |
String email = "dummy@gmail.com";
String password = "password";
LoginResponse loginResponse = new LoginResponse();
doReturn(Observable.just(loginResponse))
.when(mMockDataManager)
.doServerLoginApiCall(new LoginRequest
.ServerLog... | [FOCAL] @Override public void LoginPresenter.onServerLoginClick(String email, String password)
[CLASS] class LoginPresenter extends BasePresenter<V> implements LoginMvpPresenter<V>
[METRICS] loc=58 cc=4 branches=3 loops=0 returns=3 throws=0 nesting=1
[CALLS-EXTERNAL] String.isEmpty/0, getMvpView().onError/1, getMvpView... | /* static context
[FOCAL] @Override public void LoginPresenter.onServerLoginClick(String email, String password)
[PATH1] if(email == null || email.isEmpty())=F -> if(!CommonUtils.isEmailValid(email))=F -> if(password == null || password.isEmpty())=T -> return
[PATH2] if(email == null || email.isEmpty())=T -> return
[PA... | /* static context
[FOCAL] @Override public void LoginPresenter.onServerLoginClick(String email, String password)
[PATH1] if(email == null || email.isEmpty())=F -> if(!CommonUtils.isEmailValid(email))=F -> if(password == null || password.isEmpty())=T -> return
[PATH2] if(email == null || email.isEmpty())=T -> return
[PA... | true | ok | {"focal": {"class": "LoginPresenter", "name": "onServerLoginClick", "signature": "void onServerLoginClick(String email, String password)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "email", "type": "String"}, {"name": "password", "type": "String"}], "return_type": "void"}, "class_info": {"na... |
80196099_77 | class ProxyMessageDecoder {
public void parse(InputStream is) throws Exception {
LOG.trace("parse()");
String baseContentType = HttpFields.valueParameters(contentType, null);
if (faultAllowed && baseContentType.equalsIgnoreCase(TEXT_XML)) {
parseFault(is);
} else if (ba... | String contentType =
MimeUtils.mpMixedContentType("xtop1357783211hcn1yiro");
ProxyMessageDecoder decoder = createDecoder(contentType);
decoder.parse(getMessage("normal-soapfault.request"));
assertNotNull(callback.getFault());
}
} | [FOCAL] public void ProxyMessageDecoder.parse(InputStream is)
[CLASS] class ProxyMessageDecoder
[METRICS] loc=13 cc=3 branches=2 loops=0 returns=0 throws=1 nesting=2
[CALLS-INTERNAL] void parseFault(InputStream is); void parseMultipart(InputStream is)
[CALLS-EXTERNAL] LOG.trace/1, HttpFields.valueParameters/2, String.e... | /* static context
[FOCAL] public void ProxyMessageDecoder.parse(InputStream is)
[THROWS-WHEN] CodedException when !(faultAllowed && baseContentType.equalsIgnoreCase(TEXT_XML)) && !baseContentType.equalsIgnoreCase(MULTIPART_MIXED)
[PATH1] if(faultAllowed && baseContentType.equalsIgnoreCase(TEXT_XML))=F -> if(baseContent... | /* static context
[FOCAL] public void ProxyMessageDecoder.parse(InputStream is)
[THROWS-WHEN] CodedException when !(faultAllowed && baseContentType.equalsIgnoreCase(TEXT_XML)) && !baseContentType.equalsIgnoreCase(MULTIPART_MIXED)
[PATH1] if(faultAllowed && baseContentType.equalsIgnoreCase(TEXT_XML))=F -> if(baseContent... | true | ok | {"focal": {"class": "ProxyMessageDecoder", "name": "parse", "signature": "void parse(InputStream is) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "is", "type": "InputStream"}], "return_type": "void"}, "class_info": {"name": "ProxyMessageDecoder", "kind": "class", "modifiers": "", "supe... |
80207578_4 | class XSLTService {
public String generateSimpleReport(String simpleReport) {
try {
return SimpleReportFacade.newFacade().generateHtmlReport(simpleReport);
} catch (Exception e) {
LOG.error("Error while generating simple report : " + e.getMessage(), e);
return null;
}
}
public String generateSimpleC... | JAXBContext context = JAXBContext.newInstance(XmlSimpleReport.class.getPackage().getName());
Unmarshaller unmarshaller = context.createUnmarshaller();
Marshaller marshaller = context.createMarshaller();
JAXBElement<XmlSimpleReport> unmarshal = (JAXBElement<XmlSimpleReport>) unmarshaller.unmarshal(new File("src... | [FOCAL] public String XSLTService.generateSimpleReport(String simpleReport)
[CLASS] class XSLTService
[METRICS] loc=8 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] SimpleReportFacade.newFacade().generateHtmlReport/1, SimpleReportFacade.newFacade/0, Logger.error/2, Exception.getMessage/0
[FIELDS]... | /* static context
[FOCAL] public String XSLTService.generateSimpleReport(String simpleReport)
[PATH1] try-body throws -> return null
[PATH2] return SimpleReportFacade.newFacade().generateHtmlReport(simpleReport)
[INPUTS] branches=- | result=simpleReport
[EXCEPTIONS] catches Exception e
[FIELDS] read=LOG:Logger
[CALLS-E... | /* static context
[FOCAL] public String XSLTService.generateSimpleReport(String simpleReport)
[PATH1] try-body throws -> return null
[PATH2] return SimpleReportFacade.newFacade().generateHtmlReport(simpleReport)
[INPUTS] branches=- | result=simpleReport
[EXCEPTIONS] catches Exception e
[FIELDS] read=LOG:Logger
[CALLS-E... | true | ok | {"focal": {"class": "XSLTService", "name": "generateSimpleReport", "signature": "String generateSimpleReport(String simpleReport)", "start_line": 3, "modifiers": "public", "params": [{"name": "simpleReport", "type": "String"}], "return_type": "String"}, "class_info": {"name": "XSLTService", "kind": "class", "modifiers"... |
80228150_178 | class UpdatePortGroupTask extends TransactionalTask {
public UpdatePortGroupTask create(SecurityGroup sg, NetworkElementImpl portGroup) {
UpdatePortGroupTask task = new UpdatePortGroupTask();
task.securityGroup = sg;
task.portGroup = portGroup;
task.apiFactoryService = this.apiFacto... | // Arrange.
SecurityGroup sg = registerSecurityGroup(1L, "projectId", "projectName", 1L, "sgName");
sg.addSecurityGroupMember(newSGMWithPort(1L, OPENSTACK_ID));
NetworkElementImpl portGroup = createPortGroup(OPENSTACK_ID);
ostRegisterPorts(sg);
String domainId = UUID.ra... | [FOCAL] public UpdatePortGroupTask UpdatePortGroupTask.create(SecurityGroup sg, NetworkElementImpl portGroup)
[CLASS] class UpdatePortGroupTask extends TransactionalTask
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] UpdatePortGroupTask
[FIELDS] read=apiFactoryService, dbConnectionManager, ... | /* static context
[FOCAL] public UpdatePortGroupTask UpdatePortGroupTask.create(SecurityGroup sg, NetworkElementImpl portGroup)
[FIELDS] read=apiFactoryService, dbConnectionManager, txBroadcastUtil:TransactionalBroadcastUtil
[NEW] UpdatePortGroupTask
*/
| /* static context
[FOCAL] public UpdatePortGroupTask UpdatePortGroupTask.create(SecurityGroup sg, NetworkElementImpl portGroup)
[FIELDS] read=apiFactoryService, dbConnectionManager, txBroadcastUtil:TransactionalBroadcastUtil
[NEW] UpdatePortGroupTask
*/
class UpdatePortGroupTask extends TransactionalTask {
public ... | true | ok | {"focal": {"class": "UpdatePortGroupTask", "name": "create", "signature": "UpdatePortGroupTask create(SecurityGroup sg, NetworkElementImpl portGroup)", "start_line": 3, "modifiers": "public", "params": [{"name": "sg", "type": "SecurityGroup"}, {"name": "portGroup", "type": "NetworkElementImpl"}], "return_type": "Update... |
80229651_1 | class SetupAndExecuteCanariesStage implements StageDefinitionBuilder {
protected Duration calculateLifetime(
Instant start,
Instant endTime,
CanaryAnalysisExecutionRequest canaryAnalysisExecutionRequest) {
Duration lifetime;
if (endTime != null) {
lifetime = Duration.ofMinutes(start.... | long lifetimeInMinutes = 5L;
Instant now = Instant.now();
Instant later = null;
CanaryAnalysisExecutionRequest request =
CanaryAnalysisExecutionRequest.builder().lifetimeDurationMins(5L).build();
Duration actual = stage.calculateLifetime(now, later, request);
Duration expected = Duratio... | [FOCAL] protected Duration SetupAndExecuteCanariesStage.calculateLifetime(Instant start, Instant endTime, CanaryAnalysisExecutionRequest canaryAnalysisExecutionRequest)
[CLASS] class SetupAndExecuteCanariesStage implements StageDefinitionBuilder
[METRICS] loc=17 cc=3 branches=2 loops=0 returns=1 throws=1 nesting=2
[CAL... | /* static context
[FOCAL] protected Duration SetupAndExecuteCanariesStage.calculateLifetime(Instant start, Instant endTime, CanaryAnalysisExecutionRequest canaryAnalysisExecutionRequest)
[THROWS-WHEN] IllegalArgumentException when !(endTime != null) && !(canaryAnalysisExecutionRequest.getLifetimeDuration() != null)
[PA... | /* static context
[FOCAL] protected Duration SetupAndExecuteCanariesStage.calculateLifetime(Instant start, Instant endTime, CanaryAnalysisExecutionRequest canaryAnalysisExecutionRequest)
[THROWS-WHEN] IllegalArgumentException when !(endTime != null) && !(canaryAnalysisExecutionRequest.getLifetimeDuration() != null)
[PA... | true | ok | {"focal": {"class": "SetupAndExecuteCanariesStage", "name": "calculateLifetime", "signature": "Duration calculateLifetime(Instant start, Instant endTime, CanaryAnalysisExecutionRequest canaryAnalysisExecutionRequest)", "start_line": 3, "modifiers": "protected", "params": [{"name": "start", "type": "Instant"}, {"name": ... |
80231323_0 | class MediaIDHelper {
public static String createMediaID(String musicID, String... categories) {
StringBuilder sb = new StringBuilder();
if (categories != null) {
for (int i=0; i < categories.length; i++) {
if (!isValidCategory(categories[i])) {
throw... | fail(MediaIDHelper.createMediaID(null, "BY|GENRE/2", "Classic 70's"));
}
} | [FOCAL] public static String MediaIDHelper.createMediaID(String musicID, String... categories)
[CLASS] class MediaIDHelper
[METRICS] loc=18 cc=6 branches=4 loops=1 returns=1 throws=1 nesting=3
[CALLS-INTERNAL] boolean isValidCategory(String category)
[CALLS-EXTERNAL] StringBuilder.append/1, sb.append(LEAF_SEPARATOR).ap... | /* static context
[FOCAL] public static String MediaIDHelper.createMediaID(String musicID, String... categories)
[THROWS-WHEN] IllegalArgumentException when categories != null && i < categories.length && !isValidCategory(categories[i])
[PATH1] if(categories != null)=T -> for(i < categories.length)=T -> if(!isValidCateg... | /* static context
[FOCAL] public static String MediaIDHelper.createMediaID(String musicID, String... categories)
[THROWS-WHEN] IllegalArgumentException when categories != null && i < categories.length && !isValidCategory(categories[i])
[PATH1] if(categories != null)=T -> for(i < categories.length)=T -> if(!isValidCateg... | true | ok | {"focal": {"class": "MediaIDHelper", "name": "createMediaID", "signature": "String createMediaID(String musicID, String... categories)", "start_line": 3, "modifiers": "public static", "params": [{"name": "musicID", "type": "String"}, {"name": "categories", "type": "String..."}], "return_type": "String"}, "class_info": ... |
80324891_4 | class TitleModel extends AbstractComponentModel {
@Override
protected String getIdPrefix() {
return ID_PREFIX;
}
@PostConstruct private void initModel();
public String getTitle();
public String getType();
private static final String MOCK_JSON;
private static final String TEST_... | underTest = context.request().adaptTo(TitleModel.class);
assertEquals("title", underTest.getIdPrefix());
}
} | [FOCAL] @Override protected String TitleModel.getIdPrefix()
[CLASS] class TitleModel extends AbstractComponentModel
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] void initModel(); String getTitle(); String getType()
[TEST] TitleModelTest: @Test public void testIdPrefix()
[TEST-FIE... | /* static context
[FOCAL] @Override protected String TitleModel.getIdPrefix()
*/
| /* static context
[FOCAL] @Override protected String TitleModel.getIdPrefix()
*/
class TitleModel extends AbstractComponentModel {
@Override
protected String getIdPrefix() {
return ID_PREFIX;
}
@PostConstruct private void initModel();
public String getTitle();
public String getType();
... | true | ok | {"focal": {"class": "TitleModel", "name": "getIdPrefix", "signature": "String getIdPrefix()", "start_line": 3, "modifiers": "@Override protected", "params": [], "return_type": "String"}, "class_info": {"name": "TitleModel", "kind": "class", "modifiers": "", "superclass": "AbstractComponentModel", "interfaces": null, "f... |
80376233_1 | class Longitude implements Serializable {
@Override
public String toString() {
return String.format(Locale.ENGLISH, "%f", value);
}
public Longitude(Double value);
public Longitude(Integer value);
public Double value();
@Override public int hashCode();
@Override public boolean equa... | Longitude l = new Longitude(-0.000066);
assertEquals("-0.000066", l.toString());
}
} | [FOCAL] @Override public String Longitude.toString()
[CLASS] class Longitude implements Serializable
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] String.format/3
[CLASS-MEMBERS] Longitude(Double value); Longitude(Integer value); Double value(); int hashCode(); boolean equals(Obj... | /* static context
[FOCAL] @Override public String Longitude.toString()
[CALLS-EXTERNAL] String.format/3
*/
| /* static context
[FOCAL] @Override public String Longitude.toString()
[CALLS-EXTERNAL] String.format/3
*/
class Longitude implements Serializable {
@Override
public String toString() {
return String.format(Locale.ENGLISH, "%f", value);
}
public Longitude(Double value);
public Longitude(Integer... | true | ok | {"focal": {"class": "Longitude", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "Longitude", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Serializable", "fields": [], "members"... |
80403715_2 | class Presenter implements Contract.Presenter {
@Override
public void onStart() {
setLoading();
binder.bind(getAnimals(), this::setAnimals, this::setError, this::setComplete);
}
public Presenter(@NonNull Repository repository,
@NonNull Contract.View view,
@NonNul... | // given
ServiceException exception = new ServiceException();
when(repository.fetchResponse(any())).thenReturn(Single.error(exception));
// when
presenter.onStart();
// then
verify(view).setViewState(ViewState.Error.create(R.string.error_message));
}
} | [FOCAL] @Override public void Presenter.onStart()
[CLASS] class Presenter implements Contract.Presenter
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] Observable<List<Animal>> getAnimals(); void setLoading()
[CALLS-EXTERNAL] binder.bind/4
[COLLABORATORS] field binder bind/4
[CLASS... | /* static context
[FOCAL] @Override public void Presenter.onStart()
[COLLABORATORS] field binder bind/4
[CALLS-INTERNAL] Observable<List<Animal>> getAnimals(); void setLoading()
[CALLS-EXTERNAL] binder.bind/4
*/
| /* static context
[FOCAL] @Override public void Presenter.onStart()
[COLLABORATORS] field binder bind/4
[CALLS-INTERNAL] Observable<List<Animal>> getAnimals(); void setLoading()
[CALLS-EXTERNAL] binder.bind/4
*/
class Presenter implements Contract.Presenter {
@Override
public void onStart() {
setLoading();
... | true | ok | {"focal": {"class": "Presenter", "name": "onStart", "signature": "void onStart()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "Presenter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Contract.Presenter", "fields": [{"name": "re... |
80451996_127 | class ZkNodeCacheWrapper extends BaseCacheWrapper implements INodeCacheWrapper {
@Override
public int getCurrentDataVersion() {
int result = RedirectorConstants.NO_MODEL_NODE_VERSION;
if (isCacheUsageAllowed()) {
ChildData data = cache.getCurrentData();
if (data != null ... | testee = new ZkNodeCacheWrapper(client, "/test", null);
doThrow(new DataSourceConnectorException()).when(client).getNodeVersion(anyString());
int result = testee.getCurrentDataVersion();
Assert.assertEquals(NO_MODEL_NODE_VERSION, result);
}
} | [FOCAL] @Override public int ZkNodeCacheWrapper.getCurrentDataVersion()
[CLASS] class ZkNodeCacheWrapper extends BaseCacheWrapper implements INodeCacheWrapper
[METRICS] loc=21 cc=5 branches=3 loops=0 returns=1 throws=0 nesting=3
[CALLS-EXTERNAL] isCacheUsageAllowed/0 (inherited), NodeCache.getCurrentData/0, ChildData.g... | /* static context
[FOCAL] @Override public int ZkNodeCacheWrapper.getCurrentDataVersion()
[PATH1] if(isCacheUsageAllowed())=T -> if(data != null && data.getStat() != null)=T -> return result
[PATH2] if(isCacheUsageAllowed())=F -> try-body throws -> return result
[PATH3] if(isCacheUsageAllowed())=T -> if(data != null &&... | /* static context
[FOCAL] @Override public int ZkNodeCacheWrapper.getCurrentDataVersion()
[PATH1] if(isCacheUsageAllowed())=T -> if(data != null && data.getStat() != null)=T -> return result
[PATH2] if(isCacheUsageAllowed())=F -> try-body throws -> return result
[PATH3] if(isCacheUsageAllowed())=T -> if(data != null &&... | true | ok | {"focal": {"class": "ZkNodeCacheWrapper", "name": "getCurrentDataVersion", "signature": "int getCurrentDataVersion()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "ZkNodeCacheWrapper", "kind": "class", "modifiers": "", "superclass": "BaseCacheWrapper", "... |
80485636_1 | class Utils {
public static DateTime convertLocalToDTSafely(LocalDateTime localDateTime) {
DateTime convertedDT = null;
try {
convertedDT = localDateTime.toDateTime();
} catch (IllegalInstantException e) {
boolean failed = true;
int iteration = 1;
... | DateTimeZone.setDefault(DateTimeZone.forID("America/Los_Angeles"));
Assert.assertEquals(LocalDateTime.parse("2018-03-11T03:04:00").toDateTime(DateTimeZone.getDefault()),
Utils.convertLocalToDTSafely(LocalDateTime.parse("2018-03-11T02:04:00")));
Assert.assertEquals(LocalDateTime... | [FOCAL] public static DateTime Utils.convertLocalToDTSafely(LocalDateTime localDateTime)
[CLASS] class Utils
[METRICS] loc=22 cc=4 branches=0 loops=1 returns=1 throws=0 nesting=3
[CALLS-EXTERNAL] LocalDateTime.toDateTime/0, localDateTime.plusMinutes(30 * iteration).toDateTime/0, LocalDateTime.plusMinutes/1, Timber.i/1
... | /* static context
[FOCAL] public static DateTime Utils.convertLocalToDTSafely(LocalDateTime localDateTime)
[PATH1] try-body throws -> while(failed)=T -> exit loop -> return convertedDT
[PATH2] try-body throws -> while(failed)=F -> return convertedDT
[INPUTS] branches=- | result=localDateTime
[COLLABORATORS] param local... | /* static context
[FOCAL] public static DateTime Utils.convertLocalToDTSafely(LocalDateTime localDateTime)
[PATH1] try-body throws -> while(failed)=T -> exit loop -> return convertedDT
[PATH2] try-body throws -> while(failed)=F -> return convertedDT
[INPUTS] branches=- | result=localDateTime
[COLLABORATORS] param local... | true | ok | {"focal": {"class": "Utils", "name": "convertLocalToDTSafely", "signature": "DateTime convertLocalToDTSafely(LocalDateTime localDateTime)", "start_line": 3, "modifiers": "public static", "params": [{"name": "localDateTime", "type": "LocalDateTime"}], "return_type": "DateTime"}, "class_info": {"name": "Utils", "kind": "... |
80501529_5 | 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"... |
80550868_1 | class EventDeserializer implements Deserializer<CoffeeEvent> {
@Override
public CoffeeEvent deserialize(final String topic, final byte[] data) {
try (ByteArrayInputStream input = new ByteArrayInputStream(data)) {
final JsonObject jsonObject = Json.createReader(input).readObject();
... | final CoffeeEvent actual = cut.deserialize(null, data.getBytes(StandardCharsets.UTF_8));
assertEventEquals(actual, expected);
}
} | [FOCAL] @Override public CoffeeEvent EventDeserializer.deserialize(String topic, byte[] data)
[CLASS] class EventDeserializer implements Deserializer<CoffeeEvent>
[METRICS] loc=11 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] Json.createReader(input).readObject/0, Json.createReader/1, Class.forN... | /* static context
[FOCAL] @Override public CoffeeEvent EventDeserializer.deserialize(String topic, byte[] data)
[THROWS-WHEN] SerializationException when try-body throws
[PATH1] try-body throws -> throw new SerializationException("Could not deserialize event", e)
[PATH2] return eventClass.getConstructor(JsonObject.clas... | /* static context
[FOCAL] @Override public CoffeeEvent EventDeserializer.deserialize(String topic, byte[] data)
[THROWS-WHEN] SerializationException when try-body throws
[PATH1] try-body throws -> throw new SerializationException("Could not deserialize event", e)
[PATH2] return eventClass.getConstructor(JsonObject.clas... | true | ok | {"focal": {"class": "EventDeserializer", "name": "deserialize", "signature": "CoffeeEvent deserialize(String topic, byte[] data)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "topic", "type": "String"}, {"name": "data", "type": "byte[]"}], "return_type": "CoffeeEvent"}, "class_info": {"name": ... |
80550971_13 | class RegexFileFilter implements ParcelableFileFilter {
@Override
public boolean accept(File pathname) {
String pathToMatch = matchAbsolutePath ? pathname.getAbsolutePath() : pathname.getName();
return pattern.matcher(pathToMatch).matches();
}
public RegexFileFilter(String regex, bool... | when(file.getName()).thenReturn("testMe.java");
assertTrue(regexFileFilter.accept(file));
}
} | [FOCAL] @Override public boolean RegexFileFilter.accept(File pathname)
[CLASS] class RegexFileFilter implements ParcelableFileFilter
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] File.getAbsolutePath/0, File.getName/0, pattern.matcher(pathToMatch).matches/0, pattern.matcher/1
[FI... | /* static context
[FOCAL] @Override public boolean RegexFileFilter.accept(File pathname)
[INPUTS] branches=- | result=pathname, matchAbsolutePath
[COLLABORATORS] param pathname:File getAbsolutePath/0,getName/0; field pattern matcher/1
[FIELDS] read=matchAbsolutePath:boolean
[CALLS-EXTERNAL] File.getAbsolutePath/0, File... | /* static context
[FOCAL] @Override public boolean RegexFileFilter.accept(File pathname)
[INPUTS] branches=- | result=pathname, matchAbsolutePath
[COLLABORATORS] param pathname:File getAbsolutePath/0,getName/0; field pattern matcher/1
[FIELDS] read=matchAbsolutePath:boolean
[CALLS-EXTERNAL] File.getAbsolutePath/0, File... | true | ok | {"focal": {"class": "RegexFileFilter", "name": "accept", "signature": "boolean accept(File pathname)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "pathname", "type": "File"}], "return_type": "boolean"}, "class_info": {"name": "RegexFileFilter", "kind": "class", "modifiers": "", "superclass": ... |
80563893_7 | class LoadGenerator extends ContainerLifeCycle {
public CompletableFuture<Void> begin() {
if (logger.isDebugEnabled()) {
logger.debug("generating load, {}", config);
}
return proceed().thenCompose(x -> {
CompletableFuture[] futures = new CompletableFuture[config.getT... | prepare(new TestHandler());
AtomicLong requests = new AtomicLong();
AtomicLong resources = new AtomicLong();
LoadGenerator loadGenerator = new LoadGenerator.Builder()
.port(connector.getLocalPort())
.httpClientTransportBuilder(clientTransportBuilder)
... | [FOCAL] public CompletableFuture<Void> LoadGenerator.begin()
[CLASS] class LoadGenerator extends ContainerLifeCycle
[METRICS] loc=12 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] CompletableFuture<Void> halt(); CompletableFuture<Void> proceed()
[CALLS-EXTERNAL] logger.isDebugEnabled/0, logger.de... | /* static context
[FOCAL] public CompletableFuture<Void> LoadGenerator.begin()
[PATH1] if(logger.isDebugEnabled())=T -> return proceed().thenCompose(x -> { CompletableFuture[] futures = new Comp...
[PATH2] if(logger.isDebugEnabled())=F -> return proceed().thenCompose(x -> { CompletableFuture[] futures = new Comp...
[CO... | /* static context
[FOCAL] public CompletableFuture<Void> LoadGenerator.begin()
[PATH1] if(logger.isDebugEnabled())=T -> return proceed().thenCompose(x -> { CompletableFuture[] futures = new Comp...
[PATH2] if(logger.isDebugEnabled())=F -> return proceed().thenCompose(x -> { CompletableFuture[] futures = new Comp...
[CO... | true | ok | {"focal": {"class": "LoadGenerator", "name": "begin", "signature": "CompletableFuture<Void> begin()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "CompletableFuture<Void>"}, "class_info": {"name": "LoadGenerator", "kind": "class", "modifiers": "", "superclass": "ContainerLifeCycle", "interfaces... |
80605895_2 | class EventHubCollector extends CollectorComponent {
@Override
public CheckResult check() {
try {
// make sure compute doesn't throw an exception
Future<?> registrationFuture = lazyRegisterEventProcessorFactoryWithHost.get();
registrationFuture.get(); // make sure registration succeeded
... | EventHubCollector collector = new EventHubCollector(new LazyFuture());
assertThat(collector.check().ok()).isTrue();
assertThat(registration).isCompleted();
}
} | [FOCAL] @Override public CheckResult EventHubCollector.check()
[CLASS] class EventHubCollector extends CollectorComponent
[METRICS] loc=18 cc=5 branches=1 loops=0 returns=4 throws=1 nesting=2
[CALLS-EXTERNAL] lazyRegisterEventProcessorFactoryWithHost.get/0, Future<?>.get/0, CheckResult.failed/1, Thread.currentThread().... | /* static context
[FOCAL] @Override public CheckResult EventHubCollector.check()
[THROWS-WHEN] (Error) cause when try-body throws && cause instanceof Error
[PATH1] try-body throws -> if(cause instanceof Error)=T -> throw (Error) cause
[PATH2] try-body throws -> if(cause instanceof Error)=F -> return CheckResult.failed(... | /* static context
[FOCAL] @Override public CheckResult EventHubCollector.check()
[THROWS-WHEN] (Error) cause when try-body throws && cause instanceof Error
[PATH1] try-body throws -> if(cause instanceof Error)=T -> throw (Error) cause
[PATH2] try-body throws -> if(cause instanceof Error)=F -> return CheckResult.failed(... | true | ok | {"focal": {"class": "EventHubCollector", "name": "check", "signature": "CheckResult check()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "CheckResult"}, "class_info": {"name": "EventHubCollector", "kind": "class", "modifiers": "", "superclass": "CollectorComponent", "interfaces": nul... |
80643997_41 | class RxFirebaseUser {
@CheckResult @NonNull public static Completable updateEmail(@NonNull FirebaseUser user,
@NonNull String email) {
return Completable.create(new UserUpdateEmailOnSubscribe(user, email));
}
private RxFirebaseUser();
@CheckResult @NonNull public static Completable delete(@NonNul... | mockNotSuccessfulVoidResult(new IllegalStateException());
when(mockFirebaseUser.updateEmail("foo@bar.com")).thenReturn(mockVoidTaskResult);
TestObserver obs = TestObserver.create();
RxFirebaseUser.updateEmail(mockFirebaseUser, "foo@bar.com").subscribe(obs);
callOnComplete(mockVoidTaskResult);
... | [FOCAL] @CheckResult @NonNull public static Completable RxFirebaseUser.updateEmail(FirebaseUser user, String email)
[CLASS] class RxFirebaseUser
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Completable.create/1
[NEW] UserUpdateEmailOnSubscribe
[INPUTS] branches=- | result=email,... | /* static context
[FOCAL] @CheckResult @NonNull public static Completable RxFirebaseUser.updateEmail(FirebaseUser user, String email)
[INPUTS] branches=- | result=email, user
[NEW] UserUpdateEmailOnSubscribe
[CALLS-EXTERNAL] Completable.create/1
*/
| /* static context
[FOCAL] @CheckResult @NonNull public static Completable RxFirebaseUser.updateEmail(FirebaseUser user, String email)
[INPUTS] branches=- | result=email, user
[NEW] UserUpdateEmailOnSubscribe
[CALLS-EXTERNAL] Completable.create/1
*/
class RxFirebaseUser {
@CheckResult @NonNull public static Completab... | true | ok | {"focal": {"class": "RxFirebaseUser", "name": "updateEmail", "signature": "Completable updateEmail(FirebaseUser user, String email)", "start_line": 3, "modifiers": "@CheckResult @NonNull public static", "params": [{"name": "user", "type": "FirebaseUser"}, {"name": "email", "type": "String"}], "return_type": "Completabl... |
80644284_26 | class HoverEvent implements Examinable, HoverEventSource<V>, StyleBuilderApplicable {
@Deprecated
public static <V> @NonNull HoverEvent<V> of(final @NonNull Action<V> action, final @NonNull V value) {
return new HoverEvent<>(action, value);
}
private HoverEvent(final @NonNull Action<V> action, final @Non... | final HoverEvent.ShowEntity se0 = HoverEvent.ShowEntity.of(Key.key("cow"), UUID.randomUUID());
assertEquals(Key.key("cow"), se0.type());
final HoverEvent.ShowEntity se1 = se0.type(Key.key("chicken"));
assertEquals(Key.key("cow"), se0.type()); // original should be unmodified
assertEquals(Key.key("ch... | [FOCAL] @Deprecated public static HoverEvent<V> HoverEvent.of(Action<V> action, V value)
[CLASS] class HoverEvent implements Examinable, HoverEventSource<V>, StyleBuilderApplicable
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] HoverEvent<>
[INPUTS] branches=- | result=action, value
[DATAFLO... | /* static context
[FOCAL] @Deprecated public static HoverEvent<V> HoverEvent.of(Action<V> action, V value)
[INPUTS] branches=- | result=action, value
[NEW] HoverEvent<>
*/
| /* static context
[FOCAL] @Deprecated public static HoverEvent<V> HoverEvent.of(Action<V> action, V value)
[INPUTS] branches=- | result=action, value
[NEW] HoverEvent<>
*/
class HoverEvent implements Examinable, HoverEventSource<V>, StyleBuilderApplicable {
@Deprecated
public static <V> @NonNull HoverEvent<V> of(f... | true | ok | {"focal": {"class": "HoverEvent", "name": "of", "signature": "HoverEvent<V> of(Action<V> action, V value)", "start_line": 3, "modifiers": "@Deprecated public static", "params": [{"name": "action", "type": "Action<V>"}, {"name": "value", "type": "V"}], "return_type": "HoverEvent<V>"}, "class_info": {"name": "HoverEvent"... |
80648908_1 | class OrdersConnector {
public OrderResponse chargeChard() {
ResponseEntity<String> orderResponse = request(ordersHost, "/process-order");
return new OrderResponse(orderResponse);
}
@Autowired public OrdersConnector(
@Value("${orders.host}") String ordersHost,
Rest... | doReturn(ResponseEntity.badRequest().body("invalid content")).when(restTemplate).getForEntity("http://" + orders + "/process-order", String.class);
OrderResponse response = this.subject.chargeChard();
OrderResponse expectedResponse = new OrderResponse(false, "unable to process order, please tr... | [FOCAL] public OrderResponse OrdersConnector.chargeChard()
[CLASS] class OrdersConnector
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] ResponseEntity<String> request(String host, String path)
[NEW] OrderResponse
[DATAFLOW] orderResponse@L2->L3
[CLASS-MEMBERS] ResponseEntity<Strin... | /* static context
[FOCAL] public OrderResponse OrdersConnector.chargeChard()
[CALLS-INTERNAL] ResponseEntity<String> request(String host, String path)
[NEW] OrderResponse
*/
| /* static context
[FOCAL] public OrderResponse OrdersConnector.chargeChard()
[CALLS-INTERNAL] ResponseEntity<String> request(String host, String path)
[NEW] OrderResponse
*/
class OrdersConnector {
public OrderResponse chargeChard() {
ResponseEntity<String> orderResponse = request(ordersHost, "/process-ord... | true | ok | {"focal": {"class": "OrdersConnector", "name": "chargeChard", "signature": "OrderResponse chargeChard()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "OrderResponse"}, "class_info": {"name": "OrdersConnector", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [... |
80652674_2 | class ImageComponent {
public static String getRouteMap(Position origin, Position destination, String geometry, boolean isSmall) {
StaticMarkerAnnotation markerOrigin = new StaticMarkerAnnotation.Builder()
.setName(com.mapbox.services.Constants.PIN_LARGE)
.setPosition(origin... | // From https://www.mapbox.com/api-playground/#/directions
String geometry = "}jllF~_euMm@C?xC}B@?l@e@FItAaAhCaAH?ZqD`BaH@CpCe@f@ye@zTDZ_Bv@";
Position whiteHouse = Position.fromCoordinates(-77.0365, 38.8977);
Position dupontCircle = Position.fromCoordinates(-77.04341, 38.90962);
... | [FOCAL] public static String ImageComponent.getRouteMap(Position origin, Position destination, String geometry, boolean isSmall)
[CLASS] class ImageComponent
[METRICS] loc=29 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] new StaticMarkerAnnotation.Builder() .setName(com.mapbox.....build/0, new S... | /* static context
[FOCAL] public static String ImageComponent.getRouteMap(Position origin, Position destination, String geometry, boolean isSmall)
[INPUTS] branches=- | result=destination, geometry, isSmall, origin
[NEW] StaticMarkerAnnotation.Builder, StaticPolylineAnnotation.Builder, MapboxStaticImage.Builder
*/
| /* static context
[FOCAL] public static String ImageComponent.getRouteMap(Position origin, Position destination, String geometry, boolean isSmall)
[INPUTS] branches=- | result=destination, geometry, isSmall, origin
[NEW] StaticMarkerAnnotation.Builder, StaticPolylineAnnotation.Builder, MapboxStaticImage.Builder
*/
clas... | true | ok | {"focal": {"class": "ImageComponent", "name": "getRouteMap", "signature": "String getRouteMap(Position origin, Position destination, String geometry, boolean isSmall)", "start_line": 3, "modifiers": "public static", "params": [{"name": "origin", "type": "Position"}, {"name": "destination", "type": "Position"}, {"name":... |
80717362_9 | class ExecutorProgressListener implements ProgressListener, Runnable {
@Override
public void onProgress(long done, long total) {
if (!pending || done == total) {
this.done = done;
this.total = total;
try {
pending = true;
executor.exec... | testListener.onProgress(1, 1000);
verifyZeroInteractions(delegateListener);
verify(targetExecutor).execute(any(Runnable.class));
}
} | [FOCAL] @Override public void ExecutorProgressListener.onProgress(long done, long total)
[CLASS] class ExecutorProgressListener implements ProgressListener, Runnable
[METRICS] loc=13 cc=3 branches=1 loops=0 returns=0 throws=0 nesting=2
[CALLS-EXTERNAL] executor.execute/1
[FIELDS] write=done, total
[EXCEPTIONS] catches ... | /* static context
[FOCAL] @Override public void ExecutorProgressListener.onProgress(long done, long total)
[PATH1] if(!pending || done == total)=T -> try-body throws
[PATH2] if(!pending || done == total)=F
[INPUTS] branches=done, total | result=-
[COLLABORATORS] field executor execute/1
[STATE] done, total
[EXCEPTIONS]... | /* static context
[FOCAL] @Override public void ExecutorProgressListener.onProgress(long done, long total)
[PATH1] if(!pending || done == total)=T -> try-body throws
[PATH2] if(!pending || done == total)=F
[INPUTS] branches=done, total | result=-
[COLLABORATORS] field executor execute/1
[STATE] done, total
[EXCEPTIONS]... | true | ok | {"focal": {"class": "ExecutorProgressListener", "name": "onProgress", "signature": "void onProgress(long done, long total)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "done", "type": "long"}, {"name": "total", "type": "long"}], "return_type": "void"}, "class_info": {"name": "ExecutorProgress... |
80814228_44 | class UserController {
@RequestMapping(value = "/handle81")
public String handle81(@RequestParam("user") User user, ModelMap modelMap) {
modelMap.put("user", user);
return "/user/showUser";
}
@Autowired public void setUserService(UserService userService);
@RequestMapping(method = RequestMethod.POST) public M... | RestTemplate restTemplate = new RestTemplate();
MultiValueMap<String, String> form = new LinkedMultiValueMap<String, String>();
form.add("user", "tom:123456:tomson");
String html = restTemplate.postForObject(
"http://localhost:8080/chapter17/user/handle81.html", form, Str... | [FOCAL] @RequestMapping(value = "/handle81") public String UserController.handle81(User user, ModelMap modelMap)
[CLASS] class UserController
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] ModelMap.put/2
[COLLABORATORS] param modelMap:ModelMap put/2
[DATAFLOW] modelMap@param->L3; ... | /* static context
[FOCAL] @RequestMapping(value = "/handle81") public String UserController.handle81(User user, ModelMap modelMap)
[COLLABORATORS] param modelMap:ModelMap put/2
[CALLS-EXTERNAL] ModelMap.put/2
*/
| /* static context
[FOCAL] @RequestMapping(value = "/handle81") public String UserController.handle81(User user, ModelMap modelMap)
[COLLABORATORS] param modelMap:ModelMap put/2
[CALLS-EXTERNAL] ModelMap.put/2
*/
class UserController {
@RequestMapping(value = "/handle81")
public String handle81(@RequestParam("user") ... | true | ok | {"focal": {"class": "UserController", "name": "handle81", "signature": "String handle81(User user, ModelMap modelMap)", "start_line": 3, "modifiers": "@RequestMapping(value = \"/handle81\") public", "params": [{"name": "user", "type": "User"}, {"name": "modelMap", "type": "ModelMap"}], "return_type": "String"}, "class_... |
80822758_27 | class AnnotationUtils {
public static Set<Label> getLabels(final AnnotatedElement annotatedElement) {
return getLabels(annotatedElement.getDeclaredAnnotations());
}
private AnnotationUtils();
public static Set<Link> getLinks(final AnnotatedElement annotatedElement);
public static Set<Lin... | final Set<Label> labels = getLabels(RepeatableAnnotations.class);
assertThat(labels)
.extracting(Label::getName, Label::getValue)
.contains(
tuple(EPIC_LABEL_NAME, "e1"),
tuple(EPIC_LABEL_NAME, "e2")
);
}... | [FOCAL] public static Set<Label> AnnotationUtils.getLabels(AnnotatedElement annotatedElement)
[CLASS] class AnnotationUtils
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Set<Label> getLabels(Annotation... annotations)
[CALLS-EXTERNAL] AnnotatedElement.getDeclaredAnnotations/0
[IN... | /* static context
[FOCAL] public static Set<Label> AnnotationUtils.getLabels(AnnotatedElement annotatedElement)
[INPUTS] branches=- | result=annotatedElement
[COLLABORATORS] param annotatedElement:AnnotatedElement getDeclaredAnnotations/0
[CALLS-INTERNAL] Set<Label> getLabels(Annotation... annotations)
[CALLS-EXTERNAL]... | /* static context
[FOCAL] public static Set<Label> AnnotationUtils.getLabels(AnnotatedElement annotatedElement)
[INPUTS] branches=- | result=annotatedElement
[COLLABORATORS] param annotatedElement:AnnotatedElement getDeclaredAnnotations/0
[CALLS-INTERNAL] Set<Label> getLabels(Annotation... annotations)
[CALLS-EXTERNAL]... | true | ok | {"focal": {"class": "AnnotationUtils", "name": "getLabels", "signature": "Set<Label> getLabels(AnnotatedElement annotatedElement)", "start_line": 3, "modifiers": "public static", "params": [{"name": "annotatedElement", "type": "AnnotatedElement"}], "return_type": "Set<Label>"}, "class_info": {"name": "AnnotationUtils",... |
80874891_1 | class ArtifactSizeEnforcerRule implements EnforcerRule {
@Override
public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
if (skip) {
return;
}
String packaging = getPackaging(helper);
if (!SUPPORTED_PACKAGE_TYPES.contains(packaging)) {
helper
.getLog()... | tempFolder.newFile(SAMPLE_ARTIFACT_FILE_NAME);
ArtifactSizeEnforcerRule enforcer = new ArtifactSizeEnforcerRule();
try {
enforcer.execute(defaultMockhelper);
} catch (EnforcerRuleException e) {
fail("Failed to discover artifact.");
}
}
} | [FOCAL] @Override public void ArtifactSizeEnforcerRule.execute(EnforcerRuleHelper helper)
[CLASS] class ArtifactSizeEnforcerRule implements EnforcerRule
[METRICS] loc=26 cc=4 branches=3 loops=0 returns=2 throws=1 nesting=1
[CALLS-INTERNAL] File getArtifact(String artifactPath); String getArtifactPath(EnforcerRuleHelper... | /* static context
[FOCAL] @Override public void ArtifactSizeEnforcerRule.execute(EnforcerRuleHelper helper)
[THROWS-WHEN] EnforcerRuleException when !skip && SUPPORTED_PACKAGE_TYPES.contains(packaging) && artifactSize >= maxArtifactSizeBytes
[PATH1] if(skip)=F -> if(!SUPPORTED_PACKAGE_TYPES.contains(packaging))=F -> if... | /* static context
[FOCAL] @Override public void ArtifactSizeEnforcerRule.execute(EnforcerRuleHelper helper)
[THROWS-WHEN] EnforcerRuleException when !skip && SUPPORTED_PACKAGE_TYPES.contains(packaging) && artifactSize >= maxArtifactSizeBytes
[PATH1] if(skip)=F -> if(!SUPPORTED_PACKAGE_TYPES.contains(packaging))=F -> if... | true | ok | {"focal": {"class": "ArtifactSizeEnforcerRule", "name": "execute", "signature": "void execute(EnforcerRuleHelper helper) throws EnforcerRuleException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "helper", "type": "EnforcerRuleHelper"}], "return_type": "void"}, "class_info": {"name": "Artifact... |
80993243_1 | class InterfaceCodeGenerator {
public Map<File, String> analyze(boolean _ignoreDtd) throws Exception {
if (_ignoreDtd) { // if dtd validation is disabled (default)
docFac.setValidating(false);
docFac.setNamespaceAware(true);
docFac.setFeature("http://xml.org/sax/features... | String objectPath = "/";
String busName = "org.freedesktop.NetworkManager.Device.Wireless";
boolean ignoreDtd = true;
Logger logger = LoggerFactory.getLogger(InterfaceCodeGenerator.class);
if (!StringUtils.isBlank(busName)) {
String introspectionData = FileIoUtil.r... | [FOCAL] public Map<File, String> InterfaceCodeGenerator.analyze(boolean _ignoreDtd)
[CLASS] class InterfaceCodeGenerator
[METRICS] loc=39 cc=6 branches=4 loops=1 returns=2 throws=0 nesting=2
[CALLS-INTERNAL] List<Element> convertToElementList(org.w3c.dom.NodeList _nodeList); Map<File, String> extractAll(Element _ife)
[... | /* static context
[FOCAL] public Map<File, String> InterfaceCodeGenerator.analyze(boolean _ignoreDtd)
[PATH1] if(_ignoreDtd)=T -> if(!StringUtil.isBlank(nodeName) && !StringUtil.isBlank(root.getAttribute("name")))=T -> if(!nodeName.equals(root.getAttribute("name")))=F -> foreach(Element ife : interfaceElements)=T -> if... | /* static context
[FOCAL] public Map<File, String> InterfaceCodeGenerator.analyze(boolean _ignoreDtd)
[PATH1] if(_ignoreDtd)=T -> if(!StringUtil.isBlank(nodeName) && !StringUtil.isBlank(root.getAttribute("name")))=T -> if(!nodeName.equals(root.getAttribute("name")))=F -> foreach(Element ife : interfaceElements)=T -> if... | true | ok | {"focal": {"class": "InterfaceCodeGenerator", "name": "analyze", "signature": "Map<File, String> analyze(boolean _ignoreDtd) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "_ignoreDtd", "type": "boolean"}], "return_type": "Map<File, String>"}, "class_info": {"name": "InterfaceCodeGenerat... |
81002077_166 | class ClassUtil extends UtilityClass {
public static Optional<Class<?>> superclass(Class<?> aClass) {
return Optional.ofNullable(aClass.getSuperclass());
}
@SuppressWarnings("unchecked") public static Class<T> forObject(T value);
public static Optional<Class<?>> forName(String className);
... | Optional<Class<?>> result = ClassUtil.superclass(TestingTargetBase.class);
assertThat(result, is(Optional.of(Object.class)));
}
} | [FOCAL] public static Optional<Class<?>> ClassUtil.superclass(Class<?> aClass)
[CLASS] class ClassUtil extends UtilityClass
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Optional.ofNullable/1, Class<?>.getSuperclass/0
[INPUTS] branches=- | result=aClass
[COLLABORATORS] param aCla... | /* static context
[FOCAL] public static Optional<Class<?>> ClassUtil.superclass(Class<?> aClass)
[INPUTS] branches=- | result=aClass
[COLLABORATORS] param aClass:Class<?> getSuperclass/0
[CALLS-EXTERNAL] Optional.ofNullable/1, Class<?>.getSuperclass/0
*/
| /* static context
[FOCAL] public static Optional<Class<?>> ClassUtil.superclass(Class<?> aClass)
[INPUTS] branches=- | result=aClass
[COLLABORATORS] param aClass:Class<?> getSuperclass/0
[CALLS-EXTERNAL] Optional.ofNullable/1, Class<?>.getSuperclass/0
*/
class ClassUtil extends UtilityClass {
public static Optiona... | true | ok | {"focal": {"class": "ClassUtil", "name": "superclass", "signature": "Optional<Class<?>> superclass(Class<?> aClass)", "start_line": 3, "modifiers": "public static", "params": [{"name": "aClass", "type": "Class<?>"}], "return_type": "Optional<Class<?>>"}, "class_info": {"name": "ClassUtil", "kind": "class", "modifiers":... |
81016276_22 | class LogicalAnd extends BinaryOperation {
@Override
public String toString() {
return "(" + getLeft() + " && " + getRight() + ")";
}
public LogicalAnd(Expression left, Expression right, int line, int charPositionInLine);
@Override public T accept(ExpressionVisitor<T, C> visitor, C conte... | final String EXPECTED_RESULT = "(1 && 2)";
QLParser parser = ASTBuilder.getQlParser("1&&2");
LogicalAnd expression = (LogicalAnd) ASTBuilder.getExpression(parser);
assertEquals(EXPECTED_RESULT, expression.toString());
}
} | [FOCAL] @Override public String LogicalAnd.toString()
[CLASS] class LogicalAnd extends BinaryOperation
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] getLeft/0 (inherited), getRight/0 (inherited)
[CLASS-MEMBERS] LogicalAnd(Expression left, Expression right, int line, int charPosit... | /* static context
[FOCAL] @Override public String LogicalAnd.toString()
[CALLS-EXTERNAL] getLeft/0 (inherited), getRight/0 (inherited)
*/
| /* static context
[FOCAL] @Override public String LogicalAnd.toString()
[CALLS-EXTERNAL] getLeft/0 (inherited), getRight/0 (inherited)
*/
class LogicalAnd extends BinaryOperation {
@Override
public String toString() {
return "(" + getLeft() + " && " + getRight() + ")";
}
public LogicalAnd(Exp... | true | ok | {"focal": {"class": "LogicalAnd", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "LogicalAnd", "kind": "class", "modifiers": "", "superclass": "BinaryOperation", "interfaces": null, "fields": [{"name"... |
81052983_1 | class FactMap implements NameValueReferableMap<T> {
@Override
public boolean containsValue(Object value) {
return _facts.containsValue(value);
}
public FactMap(Map<String, NameValueReferable<T>> facts);
@SafeVarargs public FactMap(NameValueReferable<T>... facts);
public FactMap();
@Override publ... | Map<String, Object> map = Mockito.mock(Map.class);
FactMap factMap = new FactMap(map);
Mockito.when(map.containsValue("value1")).thenReturn(true);
Mockito.when(map.containsValue("value2")).thenReturn(false);
Assert.assertTrue(factMap.containsValue("value1"));
Assert.assertFalse(factMap.contains... | [FOCAL] @Override public boolean FactMap.containsValue(Object value)
[CLASS] class FactMap implements NameValueReferableMap<T>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] _facts.containsValue/1
[INPUTS] branches=- | result=value
[DATAFLOW] value@param->L3
[CLASS-MEMBERS] FactMa... | /* static context
[FOCAL] @Override public boolean FactMap.containsValue(Object value)
[INPUTS] branches=- | result=value
[CALLS-EXTERNAL] _facts.containsValue/1
*/
| /* static context
[FOCAL] @Override public boolean FactMap.containsValue(Object value)
[INPUTS] branches=- | result=value
[CALLS-EXTERNAL] _facts.containsValue/1
*/
class FactMap implements NameValueReferableMap<T> {
@Override
public boolean containsValue(Object value) {
return _facts.containsValue(value);
}... | true | ok | {"focal": {"class": "FactMap", "name": "containsValue", "signature": "boolean containsValue(Object value)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "value", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "FactMap", "kind": "class", "modifiers": "", "superclass": null... |
81102463_439 | class RestAuthRedirectCallbackHandler extends AbstractRestAuthCallbackHandler<RedirectCallback> {
public RedirectCallback convertFromJson(RedirectCallback callback, JsonValue jsonCallback) {
throw new RestAuthException(Response.Status.INTERNAL_SERVER_ERROR, new UnsupportedOperationException(
... |
//Given
//When
restAuthRedirectCallbackHandler.convertFromJson(null, null);
//Then
fail();
}
} | [FOCAL] public RedirectCallback RestAuthRedirectCallbackHandler.convertFromJson(RedirectCallback callback, JsonValue jsonCallback)
[CLASS] class RestAuthRedirectCallbackHandler extends AbstractRestAuthCallbackHandler<RedirectCallback>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=1 nesting=0
[NEW] RestAuthEx... | /* static context
[FOCAL] public RedirectCallback RestAuthRedirectCallbackHandler.convertFromJson(RedirectCallback callback, JsonValue jsonCallback)
[THROWS-WHEN] RestAuthException when always
[INPUTS] branches=- | result=- | unused=callback, jsonCallback
[EXCEPTIONS] throws RestAuthException
[NEW] RestAuthException, U... | /* static context
[FOCAL] public RedirectCallback RestAuthRedirectCallbackHandler.convertFromJson(RedirectCallback callback, JsonValue jsonCallback)
[THROWS-WHEN] RestAuthException when always
[INPUTS] branches=- | result=- | unused=callback, jsonCallback
[EXCEPTIONS] throws RestAuthException
[NEW] RestAuthException, U... | true | ok | {"focal": {"class": "RestAuthRedirectCallbackHandler", "name": "convertFromJson", "signature": "RedirectCallback convertFromJson(RedirectCallback callback, JsonValue jsonCallback)", "start_line": 3, "modifiers": "public", "params": [{"name": "callback", "type": "RedirectCallback"}, {"name": "jsonCallback", "type": "Jso... |
81125398_41 | class GroupCountsResult implements QueryResult {
@Override
public int hashCode() {
return this.items.hashCode();
}
private GroupCountsResult(final List<GroupCount> items);
public static GroupCountsResult create(final List<GroupCount> items);
@Override public int getType();
@Overr... | assertEquals(createSampleResult().hashCode(), createSampleResult().hashCode());
}
} | [FOCAL] @Override public int GroupCountsResult.hashCode()
[CLASS] class GroupCountsResult implements QueryResult
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] this.items.hashCode/0
[FIELDS] read=items
[COLLABORATORS] field items hashCode/0
[CLASS-MEMBERS] GroupCountsResult(List<G... | /* static context
[FOCAL] @Override public int GroupCountsResult.hashCode()
[COLLABORATORS] field items hashCode/0
[FIELDS] read=items
[CALLS-EXTERNAL] this.items.hashCode/0
*/
| /* static context
[FOCAL] @Override public int GroupCountsResult.hashCode()
[COLLABORATORS] field items hashCode/0
[FIELDS] read=items
[CALLS-EXTERNAL] this.items.hashCode/0
*/
class GroupCountsResult implements QueryResult {
@Override
public int hashCode() {
return this.items.hashCode();
}
pr... | true | ok | {"focal": {"class": "GroupCountsResult", "name": "hashCode", "signature": "int hashCode()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "GroupCountsResult", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "QueryResult", "fields": [], ... |
81128415_1 | class HrrsUrlEncodedFormHelper {
public HttpRequestPayload extractUrlEncodedFormPayload(HttpServletRequest request, String defaultEncoding) {
byte[] encodedFormParameterBytes = encodeFormParameters(request, defaultEncoding);
return ImmutableHttpRequestPayload
.newBuilder()
... | HttpServletRequest request = mock(HttpServletRequest.class);
String encoding = "ASCII";
when(request.getCharacterEncoding()).thenReturn(encoding);
when(request.getQueryString()).thenReturn("y=y1");
when(request.getParameterNames()).thenReturn(Collections.enumeration(Arrays.asList... | [FOCAL] public HttpRequestPayload HrrsUrlEncodedFormHelper.extractUrlEncodedFormPayload(HttpServletRequest request, String defaultEncoding)
[CLASS] class HrrsUrlEncodedFormHelper
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] byte[] encodeFormParameters(HttpServletRequest request,... | /* static context
[FOCAL] public HttpRequestPayload HrrsUrlEncodedFormHelper.extractUrlEncodedFormPayload(HttpServletRequest request, String defaultEncoding)
[INPUTS] branches=- | result=defaultEncoding, request
[CALLS-INTERNAL] byte[] encodeFormParameters(HttpServletRequest request, String defaultEncoding)
[CALLS-EXTE... | /* static context
[FOCAL] public HttpRequestPayload HrrsUrlEncodedFormHelper.extractUrlEncodedFormPayload(HttpServletRequest request, String defaultEncoding)
[INPUTS] branches=- | result=defaultEncoding, request
[CALLS-INTERNAL] byte[] encodeFormParameters(HttpServletRequest request, String defaultEncoding)
[CALLS-EXTE... | true | ok | {"focal": {"class": "HrrsUrlEncodedFormHelper", "name": "extractUrlEncodedFormPayload", "signature": "HttpRequestPayload extractUrlEncodedFormPayload(HttpServletRequest request, String defaultEncoding)", "start_line": 3, "modifiers": "public", "params": [{"name": "request", "type": "HttpServletRequest"}, {"name": "defa... |
81143147_48 | class EmptyUri implements Uri {
@Override
public Optional<? extends Fragment> fragment()
{
return absent();
}
@Override public Optional<? extends Scheme> scheme();
@Override public Optional<? extends Authority> authority();
@Override public Path path();
@Override public Optiona... | assertFalse(new EmptyUri().fragment().isPresent());
}
} | [FOCAL] @Override public Optional<? extends Fragment> EmptyUri.fragment()
[CLASS] class EmptyUri implements Uri
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] absent/0 (inherited)
[CLASS-MEMBERS] Optional<? extends Scheme> scheme(); Optional<? extends Authority> authority(); Path ... | /* static context
[FOCAL] @Override public Optional<? extends Fragment> EmptyUri.fragment()
[CALLS-EXTERNAL] absent/0 (inherited)
*/
| /* static context
[FOCAL] @Override public Optional<? extends Fragment> EmptyUri.fragment()
[CALLS-EXTERNAL] absent/0 (inherited)
*/
class EmptyUri implements Uri {
@Override
public Optional<? extends Fragment> fragment()
{
return absent();
}
@Override public Optional<? extends Scheme> sch... | true | ok | {"focal": {"class": "EmptyUri", "name": "fragment", "signature": "Optional<? extends Fragment> fragment()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Optional<? extends Fragment>"}, "class_info": {"name": "EmptyUri", "kind": "class", "modifiers": "", "superclass": null, "interfaces... |
81166660_0 | class ToggleJsonNode {
public static JsonNode fromString(String json) {
try {
return DEFAULT_OBJECT_READER.readTree(json);
} catch (IOException err) {
return MissingNode.getInstance();
}
}
public static JsonNode findByKey(Iterator<JsonNode> iterator, String key);
public static boolean ... | final JsonNode node = ToggleJsonNode.fromString("{\"foo\": 4, \"bar\": true}");
assertThat(node.isMissingNode()).isFalse();
assertThat(node.fieldNames()).containsOnly("foo", "bar");
assertThat(node.path("foo").intValue()).isEqualTo(4);
assertThat(node.path("bar").booleanValue()).isTrue();
}
} | [FOCAL] public static JsonNode ToggleJsonNode.fromString(String json)
[CLASS] class ToggleJsonNode
[METRICS] loc=7 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] DEFAULT_OBJECT_READER.readTree/1, MissingNode.getInstance/0
[EXCEPTIONS] catches IOException err
[PATH1] try-body throws -> return Miss... | /* static context
[FOCAL] public static JsonNode ToggleJsonNode.fromString(String json)
[PATH1] try-body throws -> return MissingNode.getInstance()
[PATH2] return DEFAULT_OBJECT_READER.readTree(json)
[INPUTS] branches=- | result=json
[EXCEPTIONS] catches IOException err
[CALLS-EXTERNAL] DEFAULT_OBJECT_READER.readTree/1... | /* static context
[FOCAL] public static JsonNode ToggleJsonNode.fromString(String json)
[PATH1] try-body throws -> return MissingNode.getInstance()
[PATH2] return DEFAULT_OBJECT_READER.readTree(json)
[INPUTS] branches=- | result=json
[EXCEPTIONS] catches IOException err
[CALLS-EXTERNAL] DEFAULT_OBJECT_READER.readTree/1... | true | ok | {"focal": {"class": "ToggleJsonNode", "name": "fromString", "signature": "JsonNode fromString(String json)", "start_line": 3, "modifiers": "public static", "params": [{"name": "json", "type": "String"}], "return_type": "JsonNode"}, "class_info": {"name": "ToggleJsonNode", "kind": "class", "modifiers": "", "superclass":... |
81175234_41 | class CommodityImgServiceImlpl implements ICommodityImgService {
@Override
public boolean deleteImage(Long id) {
return commodityImg.deleteByPrimaryKey(id) > 0;
}
@Override public boolean addImage(CommodityImg commodImg);
@Override public CommodityImg selectImg(Long id);
@Override publ... | boolean b = commodImg.deleteImage(1l);
Assert.assertTrue(b);
//测试完成 可用
}
} | [FOCAL] @Override public boolean CommodityImgServiceImlpl.deleteImage(Long id)
[CLASS] class CommodityImgServiceImlpl implements ICommodityImgService
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] commodityImg.deleteByPrimaryKey/1
[INPUTS] branches=- | result=id
[COLLABORATORS] fi... | /* static context
[FOCAL] @Override public boolean CommodityImgServiceImlpl.deleteImage(Long id)
[INPUTS] branches=- | result=id
[COLLABORATORS] field commodityImg deleteByPrimaryKey/1
[CALLS-EXTERNAL] commodityImg.deleteByPrimaryKey/1
*/
| /* static context
[FOCAL] @Override public boolean CommodityImgServiceImlpl.deleteImage(Long id)
[INPUTS] branches=- | result=id
[COLLABORATORS] field commodityImg deleteByPrimaryKey/1
[CALLS-EXTERNAL] commodityImg.deleteByPrimaryKey/1
*/
class CommodityImgServiceImlpl implements ICommodityImgService {
@Override
... | true | ok | {"focal": {"class": "CommodityImgServiceImlpl", "name": "deleteImage", "signature": "boolean deleteImage(Long id)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "id", "type": "Long"}], "return_type": "boolean"}, "class_info": {"name": "CommodityImgServiceImlpl", "kind": "class", "modifiers": ""... |
81186751_13 | class FinagleAdjuster extends Adjuster {
@Override protected Span adjust(Span span) {
if (applyTimestampAndDuration()) {
return ApplyTimestampAndDuration.apply(span);
}
return span;
}
FinagleAdjuster();
public static Builder newBuilder();
abstract boolean applyTimestampAndDuration();
... | Iterable<Span> adjusted = adjuster.adjust(TestObjects.TRACE);
assertThat(adjusted).containsExactlyElementsOf(TestObjects.TRACE);
}
} | [FOCAL] @Override protected Span FinagleAdjuster.adjust(Span span)
[CLASS] class FinagleAdjuster extends Adjuster
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] boolean applyTimestampAndDuration()
[CALLS-EXTERNAL] ApplyTimestampAndDuration.apply/1
[PATH1] if(applyTimestampAndDurat... | /* static context
[FOCAL] @Override protected Span FinagleAdjuster.adjust(Span span)
[PATH1] if(applyTimestampAndDuration())=T -> return ApplyTimestampAndDuration.apply(span)
[PATH2] if(applyTimestampAndDuration())=F -> return span
[INPUTS] branches=- | result=span
[CALLS-INTERNAL] boolean applyTimestampAndDuration()
[... | /* static context
[FOCAL] @Override protected Span FinagleAdjuster.adjust(Span span)
[PATH1] if(applyTimestampAndDuration())=T -> return ApplyTimestampAndDuration.apply(span)
[PATH2] if(applyTimestampAndDuration())=F -> return span
[INPUTS] branches=- | result=span
[CALLS-INTERNAL] boolean applyTimestampAndDuration()
[... | true | ok | {"focal": {"class": "FinagleAdjuster", "name": "adjust", "signature": "Span adjust(Span span)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "span", "type": "Span"}], "return_type": "Span"}, "class_info": {"name": "FinagleAdjuster", "kind": "class", "modifiers": "", "superclass": "Adjuster",... |
81201370_26 | class SubscribeCommand extends SingleCharacteristicsCommand {
@Override
protected void onError(int error) {
finish(CommandResult.createErrorResult(characteristicUUID, error));
}
SubscribeCommand(@Type int type, UUID serviceUUID, UUID characteristicUUID, CommandObserver observer);
@Overr... | setupDescriptorSuccess();
subscribeCommand.execute(device, operationCommandObserver, gatt);
subscribeCommand.onError(BluetoothGatt.GATT_FAILURE);
verifyCommandFail(subscribeCommand, BluetoothGatt.GATT_FAILURE);
}
} | [FOCAL] @Override protected void SubscribeCommand.onError(int error)
[CLASS] class SubscribeCommand extends SingleCharacteristicsCommand
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] finish/1 (inherited), CommandResult.createErrorResult/2
[FIELDS] read=characteristicUUID:UUID
[DA... | /* static context
[FOCAL] @Override protected void SubscribeCommand.onError(int error)
[FIELDS] read=characteristicUUID:UUID
[CALLS-EXTERNAL] finish/1 (inherited), CommandResult.createErrorResult/2
*/
| /* static context
[FOCAL] @Override protected void SubscribeCommand.onError(int error)
[FIELDS] read=characteristicUUID:UUID
[CALLS-EXTERNAL] finish/1 (inherited), CommandResult.createErrorResult/2
*/
class SubscribeCommand extends SingleCharacteristicsCommand {
@Override
protected void onError(int error) {
... | true | ok | {"focal": {"class": "SubscribeCommand", "name": "onError", "signature": "void onError(int error)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "error", "type": "int"}], "return_type": "void"}, "class_info": {"name": "SubscribeCommand", "kind": "class", "modifiers": "", "superclass": "Single... |
81201685_18 | class PrefixTokenizer implements MultiAutoCompleteTextView.Tokenizer {
@Override
public int findTokenStart(CharSequence text, int cursor) {
// base case: empty string
if (text.length() == 0) {
return 0;
}
// iterate back until we find the prefix
char separat... | assertThat(tokenizer.findTokenStart(" @:", 3), is(1));
assertThat(tokenizer.findTokenStart(" :@", 3), is(1));
assertThat(tokenizer.findTokenStart(" :test1@test2", 3), is(1));
assertThat(tokenizer.findTokenStart(" :test1 @test2", 9), is(8));
}
} | [FOCAL] @Override public int PrefixTokenizer.findTokenStart(CharSequence text, int cursor)
[CLASS] class PrefixTokenizer implements MultiAutoCompleteTextView.Tokenizer
[METRICS] loc=20 cc=5 branches=3 loops=1 returns=3 throws=0 nesting=3
[CALLS-INTERNAL] boolean matchesPrefix(CharSequence text, int index); char getDefa... | /* static context
[FOCAL] @Override public int PrefixTokenizer.findTokenStart(CharSequence text, int cursor)
[PATH1] if(text.length() == 0)=F -> for(i >= 0)=T -> if(matchesPrefix(text, i))=T -> if(i == 0 || (charAt = text.charAt(i - 1)) == separator || charAt == NEW_LINE)=F -> exit loop -> return cursor
[PATH2] if(text... | /* static context
[FOCAL] @Override public int PrefixTokenizer.findTokenStart(CharSequence text, int cursor)
[PATH1] if(text.length() == 0)=F -> for(i >= 0)=T -> if(matchesPrefix(text, i))=T -> if(i == 0 || (charAt = text.charAt(i - 1)) == separator || charAt == NEW_LINE)=F -> exit loop -> return cursor
[PATH2] if(text... | true | ok | {"focal": {"class": "PrefixTokenizer", "name": "findTokenStart", "signature": "int findTokenStart(CharSequence text, int cursor)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "text", "type": "CharSequence"}, {"name": "cursor", "type": "int"}], "return_type": "int"}, "class_info": {"name": "Pre... |
81304886_25 | class TextCleaner {
public String cleanInlineCode(Object input) {
String output = clean(input, false).replace('\n', ' ');
if(output.indexOf('`') != -1) {
String prepend = "";
if(output.charAt(0) == '`') {
prepend = " ";
}
String append = "";
if(output.charAt(output.length()-1) == '`') {
app... | Assert.assertEquals("```` ``t```i`ck` ````", BASIC.cleanInlineCode("``t```i`ck`"));
}
} | [FOCAL] public String TextCleaner.cleanInlineCode(Object input)
[CLASS] class TextCleaner
[METRICS] loc=18 cc=4 branches=3 loops=0 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] String clean(Object oinput, boolean normalText); String getDelimiter(String input)
[CALLS-EXTERNAL] clean(input, false).replace/2, String.index... | /* static context
[FOCAL] public String TextCleaner.cleanInlineCode(Object input)
[PATH1] if(output.indexOf('`') != -1)=T -> if(output.charAt(0) == '`')=T -> if(output.charAt(output.length()-1) == '`')=T -> return output
[PATH2] if(output.indexOf('`') != -1)=T -> if(output.charAt(0) == '`')=F -> if(output.charAt(output... | /* static context
[FOCAL] public String TextCleaner.cleanInlineCode(Object input)
[PATH1] if(output.indexOf('`') != -1)=T -> if(output.charAt(0) == '`')=T -> if(output.charAt(output.length()-1) == '`')=T -> return output
[PATH2] if(output.indexOf('`') != -1)=T -> if(output.charAt(0) == '`')=F -> if(output.charAt(output... | true | ok | {"focal": {"class": "TextCleaner", "name": "cleanInlineCode", "signature": "String cleanInlineCode(Object input)", "start_line": 3, "modifiers": "public", "params": [{"name": "input", "type": "Object"}], "return_type": "String"}, "class_info": {"name": "TextCleaner", "kind": "class", "modifiers": "", "superclass": null... |
81385470_3 | class SmartcarAuth {
public void addClickHandler(final Context context, final View view) {
addClickHandler(context, view, (new AuthUrlBuilder()).build());
}
public SmartcarAuth(String clientId, String redirectUri, String[] scope,
SmartcarCallback callback);
public Sma... |
// Setup mocks
Context context = mock(Context.class);
View view = mock(View.class);
// Execute methods
SmartcarAuth smartcarAuth = new SmartcarAuth(
"client123",
"scclient123://test",
new String[] {"read_odometer", "read_vin"},
... | [FOCAL] public void SmartcarAuth.addClickHandler(Context context, View view)
[CLASS] class SmartcarAuth
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void addClickHandler(Context context, View view, String authUrl)
[CALLS-EXTERNAL] (new AuthUrlBuilder()).build/0
[NEW] AuthUrlBuil... | /* static context
[FOCAL] public void SmartcarAuth.addClickHandler(Context context, View view)
[CALLS-INTERNAL] void addClickHandler(Context context, View view, String authUrl)
[NEW] AuthUrlBuilder
[CALLS-EXTERNAL] (new AuthUrlBuilder()).build/0
*/
| /* static context
[FOCAL] public void SmartcarAuth.addClickHandler(Context context, View view)
[CALLS-INTERNAL] void addClickHandler(Context context, View view, String authUrl)
[NEW] AuthUrlBuilder
[CALLS-EXTERNAL] (new AuthUrlBuilder()).build/0
*/
class SmartcarAuth {
public void addClickHandler(final Context con... | true | ok | {"focal": {"class": "SmartcarAuth", "name": "addClickHandler", "signature": "void addClickHandler(Context context, View view)", "start_line": 3, "modifiers": "public", "params": [{"name": "context", "type": "Context"}, {"name": "view", "type": "View"}], "return_type": "void"}, "class_info": {"name": "SmartcarAuth", "ki... |
81436550_3 | class Driver {
public void processOne() throws DriverException, CloseException {
Request request;
try {
request = this.reader.read();
} catch (CloseException ex) {
throw ex;
} catch (Exception ex) {
final Response response = createFatalResponse(ex... | final String input = "garbage";
final InputStream in = new ByteArrayInputStream(input.getBytes());
final RequestReader reader = new RequestReader(in);
final ByteArrayOutputStream out = new ByteArrayOutputStream();
final ResponseWriter writer = new ResponseWriter(out);
f... | [FOCAL] public void Driver.processOne()
[CLASS] class Driver
[METRICS] loc=25 cc=5 branches=0 loops=0 returns=1 throws=3 nesting=2
[CALLS-INTERNAL] Response createFatalResponse(Exception e); Response processRequest(Request request)
[CALLS-EXTERNAL] this.reader.read/0, this.writer.write/1, this.writer.setContent/1
[NEW]... | /* static context
[FOCAL] public void Driver.processOne()
[THROWS-WHEN] ex when try-body throws
[THROWS-WHEN] DriverException when try-body throws && try-body throws
[THROWS-WHEN] DriverException when try-body throws
[PATH1] try-body throws -> throw ex
[PATH2] try-body throws -> return
[PATH3] try-body throws -> throw ... | /* static context
[FOCAL] public void Driver.processOne()
[THROWS-WHEN] ex when try-body throws
[THROWS-WHEN] DriverException when try-body throws && try-body throws
[THROWS-WHEN] DriverException when try-body throws
[PATH1] try-body throws -> throw ex
[PATH2] try-body throws -> return
[PATH3] try-body throws -> throw ... | true | ok | {"focal": {"class": "Driver", "name": "processOne", "signature": "void processOne() throws DriverException, CloseException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "Driver", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": ... |
81464391_3 | class UserController {
@RequestMapping(method = RequestMethod.GET, value = "", params = "fullname",
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public
@ResponseBody
User userByFullname(@RequestParam("fullname") String fullname) {
return repository.findByFullname(fullname);
}
... | mockMvc.perform(get("/user?fullname={fullname}", "Samed Düzçay"))
.andExpect(status().isOk())
.andExpect(
content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(jsonPath("$.username", is("samed")))
.andExpect(jsonPa... | [FOCAL] @RequestMapping(method = RequestMethod.GET, value = "", params = "fullname", produces = MediaType.APPLICATION_JSON_UT... User UserController.userByFullname(String fullname)
[CLASS] class UserController
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] repository.findByFullnam... | /* static context
[FOCAL] @RequestMapping(method = RequestMethod.GET, value = "", params = "fullname", produces = MediaType.APPLICATION_JSON_UT... User UserController.userByFullname(String fullname)
[INPUTS] branches=- | result=fullname
[COLLABORATORS] field repository findByFullname/1
[CALLS-EXTERNAL] repository.findB... | /* static context
[FOCAL] @RequestMapping(method = RequestMethod.GET, value = "", params = "fullname", produces = MediaType.APPLICATION_JSON_UT... User UserController.userByFullname(String fullname)
[INPUTS] branches=- | result=fullname
[COLLABORATORS] field repository findByFullname/1
[CALLS-EXTERNAL] repository.findB... | true | ok | {"focal": {"class": "UserController", "name": "userByFullname", "signature": "User userByFullname(String fullname)", "start_line": 3, "modifiers": "@RequestMapping(method = RequestMethod.GET, value = \"\", params = \"fullname\", produces = MediaType.APPLICATION_JSON_UT...", "params": [{"name": "fullname", "type": "Stri... |
81464583_17 | class FeedRow {
public static int[] fromYearFormat(String yearFormat) {
String[] parts = yearFormat.split("/");
if (parts.length != 2) {
throw new IllegalArgumentException("Given string is not in expected format: " + yearFormat);
}
int[] intParts = {Integer.parseInt(par... | String year = "-30/2000";
int[] yearPair = {-30, 2000};
assertArrayEquals(yearPair, FeedRow.fromYearFormat(year));
year = "0/0";
yearPair = new int[]{0, 0};
assertArrayEquals(yearPair, FeedRow.fromYearFormat(year));
thrown.expect(IllegalArgumentException.class)... | [FOCAL] public static int[] FeedRow.fromYearFormat(String yearFormat)
[CLASS] class FeedRow
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] String.split/1, Integer.parseInt/1
[NEW] IllegalArgumentException
[EXCEPTIONS] throws IllegalArgumentException
[THROWS-WHEN] IllegalArgumentEx... | /* static context
[FOCAL] public static int[] FeedRow.fromYearFormat(String yearFormat)
[THROWS-WHEN] IllegalArgumentException when parts.length != 2
[PATH1] if(parts.length != 2)=T -> throw new IllegalArgumentException("Given string is not in expected forma...
[PATH2] if(parts.length != 2)=F -> return intParts
[INPUTS... | /* static context
[FOCAL] public static int[] FeedRow.fromYearFormat(String yearFormat)
[THROWS-WHEN] IllegalArgumentException when parts.length != 2
[PATH1] if(parts.length != 2)=T -> throw new IllegalArgumentException("Given string is not in expected forma...
[PATH2] if(parts.length != 2)=F -> return intParts
[INPUTS... | true | ok | {"focal": {"class": "FeedRow", "name": "fromYearFormat", "signature": "int[] fromYearFormat(String yearFormat)", "start_line": 3, "modifiers": "public static", "params": [{"name": "yearFormat", "type": "String"}], "return_type": "int[]"}, "class_info": {"name": "FeedRow", "kind": "class", "modifiers": "", "superclass":... |
81467673_18 | class AdbMonitor {
static String readPacket(ByteBuffer input) {
if (input.remaining() < LENGTH_FIELD_SIZE) {
return null;
}
// each packet contains 4 bytes representing the String length in hexa, followed by a list of device states, one per line;
// each line contains: t... | String data = "00300123456789ABCDEF\tdevice\nFEDCBA9876543210\tdevice\n";
String result = AdbMonitor.readPacket(toByteBuffer(data));
Assert.assertEquals("0123456789ABCDEF\tdevice\nFEDCBA9876543210\tdevice\n", result);
}
} | [FOCAL] static String AdbMonitor.readPacket(ByteBuffer input)
[CLASS] class AdbMonitor
[METRICS] loc=23 cc=4 branches=3 loops=0 returns=3 throws=1 nesting=1
[CALLS-INTERNAL] int parseLength(byte[] data)
[CALLS-EXTERNAL] ByteBuffer.remaining/0, ByteBuffer.get/3, ByteBuffer.rewind/0
[NEW] IllegalArgumentException, String... | /* static context
[FOCAL] static String AdbMonitor.readPacket(ByteBuffer input)
[THROWS-WHEN] IllegalArgumentException when !(input.remaining() < LENGTH_FIELD_SIZE) && length > BUFFER.length
[PATH1] if(input.remaining() < LENGTH_FIELD_SIZE)=F -> if(length > BUFFER.length)=F -> if(input.remaining() < length)=T -> return... | /* static context
[FOCAL] static String AdbMonitor.readPacket(ByteBuffer input)
[THROWS-WHEN] IllegalArgumentException when !(input.remaining() < LENGTH_FIELD_SIZE) && length > BUFFER.length
[PATH1] if(input.remaining() < LENGTH_FIELD_SIZE)=F -> if(length > BUFFER.length)=F -> if(input.remaining() < length)=T -> return... | true | ok | {"focal": {"class": "AdbMonitor", "name": "readPacket", "signature": "String readPacket(ByteBuffer input)", "start_line": 3, "modifiers": "static", "params": [{"name": "input", "type": "ByteBuffer"}], "return_type": "String"}, "class_info": {"name": "AdbMonitor", "kind": "class", "modifiers": "", "superclass": null, "i... |
81500686_0 | class DeepLinkAnnotationCompiler extends AbstractProcessor {
@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
System.out.println("[FlowR]: generating deep Link Handler...");
MethodSpec.Builder constructorBuilder = generateConstructor();
... | assertAbout(javaSources())
.that(Arrays.asList(TEST_DEEP_LINK_FRAGMENT, TEST_DEEP_LINK_HANDLER))
.processedWith(new DeepLinkAnnotationCompiler())
.compilesWithoutError()
.and()
.generatesSources(TEST_DEEP_GENERATED_HANDLER);
}
} | [FOCAL] @Override public boolean DeepLinkAnnotationCompiler.process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
[CLASS] class DeepLinkAnnotationCompiler extends AbstractProcessor
[METRICS] loc=30 cc=5 branches=1 loops=3 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] MethodSpec.Builder generateCons... | /* static context
[FOCAL] @Override public boolean DeepLinkAnnotationCompiler.process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
[PATH1] foreach(Element element : roundEnv.getElementsAnnotatedWith(DeepLink.class))=T -> foreach(String url : value)=F -> exit loop -> foreach(Element element : round... | /* static context
[FOCAL] @Override public boolean DeepLinkAnnotationCompiler.process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
[PATH1] foreach(Element element : roundEnv.getElementsAnnotatedWith(DeepLink.class))=T -> foreach(String url : value)=F -> exit loop -> foreach(Element element : round... | true | ok | {"focal": {"class": "DeepLinkAnnotationCompiler", "name": "process", "signature": "boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "annotations", "type": "Set<? extends TypeElement>"}, {"name": "roundEnv", "type":... |
81569594_24 | class Expression {
public Object eval(Object scope) {
try {
return valueExpression.getValue(new XLContext(scope));
} catch (ELException ele) {
return null; // unresolved element yields null value
}
}
public Expression(String expression);
@SuppressWarni... | Expression expr = new Expression("${1==1}");
Object o = expr.eval(null); // no scope required for non-resolving expression
assertThat(o).isInstanceOf(Boolean.class);
assertThat(o).isEqualTo(true);
}
} | [FOCAL] public Object Expression.eval(Object scope)
[CLASS] class Expression
[METRICS] loc=7 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] valueExpression.getValue/1
[NEW] XLContext
[EXCEPTIONS] catches ELException ele
[PATH1] try-body throws -> return null
[PATH2] return valueExpression.getValu... | /* static context
[FOCAL] public Object Expression.eval(Object scope)
[PATH1] try-body throws -> return null
[PATH2] return valueExpression.getValue(new XLContext(scope))
[INPUTS] branches=- | result=scope
[COLLABORATORS] field valueExpression getValue/1
[EXCEPTIONS] catches ELException ele
[NEW] XLContext
[CALLS-EXTER... | /* static context
[FOCAL] public Object Expression.eval(Object scope)
[PATH1] try-body throws -> return null
[PATH2] return valueExpression.getValue(new XLContext(scope))
[INPUTS] branches=- | result=scope
[COLLABORATORS] field valueExpression getValue/1
[EXCEPTIONS] catches ELException ele
[NEW] XLContext
[CALLS-EXTER... | true | ok | {"focal": {"class": "Expression", "name": "eval", "signature": "Object eval(Object scope)", "start_line": 3, "modifiers": "public", "params": [{"name": "scope", "type": "Object"}], "return_type": "Object"}, "class_info": {"name": "Expression", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "f... |
81587412_4 | class System {
public static SystemBuilder builder() {
return new SystemBuilder();
}
public System(String name, Collection<ComponentRelationships> rels, Collection<ResolutionError> errors);
public System(String name, Collection<ComponentRelationships> rels);
public static System of(Stri... | System actual = System.builder().name(NAME).componentRelationships(new HashSet<>()).errors(new HashSet<>())
.build();
Assertions.assertThat(System.empty(NAME)).isEqualTo(actual);
}
} | [FOCAL] public static SystemBuilder System.builder()
[CLASS] class System
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] SystemBuilder
[CLASS-MEMBERS] System(String name, Collection<ComponentRelationships> rels, Collection<ResolutionError> errors); System(String name, Collection<ComponentRel... | /* static context
[FOCAL] public static SystemBuilder System.builder()
[NEW] SystemBuilder
*/
| /* static context
[FOCAL] public static SystemBuilder System.builder()
[NEW] SystemBuilder
*/
class System {
public static SystemBuilder builder() {
return new SystemBuilder();
}
public System(String name, Collection<ComponentRelationships> rels, Collection<ResolutionError> errors);
public S... | true | ok | {"focal": {"class": "System", "name": "builder", "signature": "SystemBuilder builder()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "SystemBuilder"}, "class_info": {"name": "System", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "NAME", "t... |
81611630_13 | class ContentDisposition {
public static ContentDisposition parse(String contentDisposition) {
List<String> parts = tokenize(contentDisposition);
String type = parts.get(0);
String name = null;
String filename = null;
Charset charset = null;
Long size = null;
... | String header = "form-data; name=\"f\"; filename=\"image-for-upload.jpeg\"";
ContentDisposition d = ContentDisposition.parse(header);
System.out.format("parsed: %s%n", d);
assertEquals("type", "form-data", d.getType());
assertEquals("name", "f", d.getName());
assertEquals... | [FOCAL] public static ContentDisposition ContentDisposition.parse(String contentDisposition)
[CLASS] class ContentDisposition
[METRICS] loc=64 cc=13 branches=8 loops=1 returns=1 throws=1 nesting=10
[CALLS-INTERNAL] List<String> tokenize(String headerValue); String decodeHeaderFieldParam(String input)
[CALLS-EXTERNAL] L... | /* static context
[FOCAL] public static ContentDisposition ContentDisposition.parse(String contentDisposition)
[THROWS-WHEN] IllegalArgumentException when i < parts.size() && !(eqIndex != -1)
[PATH1] for(i < parts.size())=T -> if(eqIndex != -1)=T -> if(attribute.equals("name"))=F -> if(attribute.equals("filename*"))=F ... | /* static context
[FOCAL] public static ContentDisposition ContentDisposition.parse(String contentDisposition)
[THROWS-WHEN] IllegalArgumentException when i < parts.size() && !(eqIndex != -1)
[PATH1] for(i < parts.size())=T -> if(eqIndex != -1)=T -> if(attribute.equals("name"))=F -> if(attribute.equals("filename*"))=F ... | true | ok | {"focal": {"class": "ContentDisposition", "name": "parse", "signature": "ContentDisposition parse(String contentDisposition)", "start_line": 3, "modifiers": "public static", "params": [{"name": "contentDisposition", "type": "String"}], "return_type": "ContentDisposition"}, "class_info": {"name": "ContentDisposition", "... |
81617098_147 | class HttpsUsageImpl implements IBestPractice {
@Override
public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) {
/*
* Reset these total numbers before each test-run due to bean being
* singleton.
*/
totalNumConnectionsCurrentTrace = 0;
totalNumHttpConnectionsCurrentTrace = 0;
Li... | PacketAnalyzerResult pktAnalyzerResult = resultTestSetup(5);
HttpsUsageResult httpsUsageResult = (HttpsUsageResult) httpsUsageImpl.runTest(pktAnalyzerResult);
List<HttpsUsageEntry> httpsUsageEntries = httpsUsageResult.getResults();
assertEquals(2, httpsUsageEntries.size());
if (httpsUsageEntries.get(0).getIPA... | [FOCAL] @Override public AbstractBestPracticeResult HttpsUsageImpl.runTest(PacketAnalyzerResult tracedata)
[CLASS] class HttpsUsageImpl implements IBestPractice
[METRICS] loc=37 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] Integer getHttpConnectionsPercentage(int numHttpConnections, int numConn... | /* static context
[FOCAL] @Override public AbstractBestPracticeResult HttpsUsageImpl.runTest(PacketAnalyzerResult tracedata)
[PATH1] if(passTest())=F -> if(failTest(httpsUsageEntries, httpConnectionsPercentageCurrentTrace))=T -> return result
[PATH2] if(passTest())=T -> return result
[PATH3] if(passTest())=F -> if(fail... | /* static context
[FOCAL] @Override public AbstractBestPracticeResult HttpsUsageImpl.runTest(PacketAnalyzerResult tracedata)
[PATH1] if(passTest())=F -> if(failTest(httpsUsageEntries, httpConnectionsPercentageCurrentTrace))=T -> return result
[PATH2] if(passTest())=T -> return result
[PATH3] if(passTest())=F -> if(fail... | true | ok | {"focal": {"class": "HttpsUsageImpl", "name": "runTest", "signature": "AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "tracedata", "type": "PacketAnalyzerResult"}], "return_type": "AbstractBestPracticeResult"}, "class_info": {"n... |
81649451_0 | class PosTagger {
public synchronized List<Conll> tagging(List<String> tokens, FragmentationType fragmentationType)
throws ClassifierModelNotFoundException, IncorrectTokenException {
AdvancedTokenHandler<Conll> tokenHandler = new StatefulTokenHandler(fragmentationType);
try {
... | String text = "Отменить подписку на канал \"ByDaniel \u200E\u200E\u200E\u200E\u200E\u200E\u200E\u200E\u200E\u200E\"?";
List<String> tokens = this.tokenizer.tokenization(text);
List<Conll> conlls = this.tagger.tagging(tokens, FragmentationType.NO_FRAGMENTATION);
Assert.assertFalse(conlls.... | [FOCAL] public synchronized List<Conll> PosTagger.tagging(List<String> tokens, FragmentationType fragmentationType)
[CLASS] class PosTagger
[METRICS] loc=14 cc=3 branches=0 loops=0 returns=1 throws=2 nesting=1
[CALLS-EXTERNAL] this.tt.setHandler/1, this.tt.process/1, AdvancedTokenHandler<Conll>.getTokens/0
[NEW] Statef... | /* static context
[FOCAL] public synchronized List<Conll> PosTagger.tagging(List<String> tokens, FragmentationType fragmentationType)
[THROWS-WHEN] ClassifierModelNotFoundException when try-body throws
[THROWS-WHEN] IncorrectTokenException when try-body throws
[PATH1] try-body throws -> throw new ClassifierModelNotFoun... | /* static context
[FOCAL] public synchronized List<Conll> PosTagger.tagging(List<String> tokens, FragmentationType fragmentationType)
[THROWS-WHEN] ClassifierModelNotFoundException when try-body throws
[THROWS-WHEN] IncorrectTokenException when try-body throws
[PATH1] try-body throws -> throw new ClassifierModelNotFoun... | true | ok | {"focal": {"class": "PosTagger", "name": "tagging", "signature": "List<Conll> tagging(List<String> tokens, FragmentationType fragmentationType) throws ClassifierModelNotFoundException, IncorrectTokenException", "start_line": 3, "modifiers": "public synchronized", "params": [{"name": "tokens", "type": "List<String>"}, {... |
81653189_6 | class Shortbread {
@TargetApi(25)
public static void create(@NonNull Context context) {
if (Build.VERSION.SDK_INT < 25) {
return;
}
if (generated == null) {
try {
generated = Class.forName("shortbread.ShortbreadGenerated");
create... | when(intent.hasExtra("shortbread_method")).thenReturn(false);
ShortbreadGenerated.activityThatWasPassedToCallMethodShortcut = null;
Shortbread.create(activity);
assertNull(ShortbreadGenerated.activityThatWasPassedToCallMethodShortcut);
}
} | [FOCAL] @TargetApi(25) public static void Shortbread.create(Context context)
[CLASS] class Shortbread
[METRICS] loc=32 cc=8 branches=5 loops=0 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] void callMethodShortcut(Activity activity); void setActivityLifecycleCallbacks(Context applicationContext); void setShortcuts(Conte... | /* static context
[FOCAL] @TargetApi(25) public static void Shortbread.create(Context context)
[PATH1] if(Build.VERSION.SDK_INT < 25)=F -> if(generated == null)=T -> try-body throws -> if(!shortcutsSet)=T -> if(!activityLifecycleCallbacksSet)=T -> if(context instanceof Activity)=T
[PATH2] if(Build.VERSION.SDK_INT < 25)... | /* static context
[FOCAL] @TargetApi(25) public static void Shortbread.create(Context context)
[PATH1] if(Build.VERSION.SDK_INT < 25)=F -> if(generated == null)=T -> try-body throws -> if(!shortcutsSet)=T -> if(!activityLifecycleCallbacksSet)=T -> if(context instanceof Activity)=T
[PATH2] if(Build.VERSION.SDK_INT < 25)... | true | ok | {"focal": {"class": "Shortbread", "name": "create", "signature": "void create(Context context)", "start_line": 3, "modifiers": "@TargetApi(25) public static", "params": [{"name": "context", "type": "Context"}], "return_type": "void"}, "class_info": {"name": "Shortbread", "kind": "class", "modifiers": "", "superclass": ... |
81678042_0 | class LintRegistry extends IssueRegistry {
@Override
public List<Issue> getIssues() {
return ImmutableList.of(AndroidLogDetector.ISSUE,
HardcodedColorsDetector.ISSUE,
DirectMaterialPaletteColorUsageDetector.ISSUE,
NonMaterialColorsDetector.ISSUE);
}
... | int size = lintRegistry.getIssues().size();
assertThat(size).isEqualTo(NUMBER_OF_EXISTING_DETECTORS);
}
} | [FOCAL] @Override public List<Issue> LintRegistry.getIssues()
[CLASS] class LintRegistry extends IssueRegistry
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] ImmutableList.of/4
[TEST] LintRegistryTest: @Test public void number_of_issues_registered()
[TEST-FIELDS] LintRegistry lint... | /* static context
[FOCAL] @Override public List<Issue> LintRegistry.getIssues()
[CALLS-EXTERNAL] ImmutableList.of/4
*/
| /* static context
[FOCAL] @Override public List<Issue> LintRegistry.getIssues()
[CALLS-EXTERNAL] ImmutableList.of/4
*/
class LintRegistry extends IssueRegistry {
@Override
public List<Issue> getIssues() {
return ImmutableList.of(AndroidLogDetector.ISSUE,
HardcodedColorsDetector.ISSUE,
... | true | ok | {"focal": {"class": "LintRegistry", "name": "getIssues", "signature": "List<Issue> getIssues()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "List<Issue>"}, "class_info": {"name": "LintRegistry", "kind": "class", "modifiers": "", "superclass": "IssueRegistry", "interfaces": null, "fie... |
81799714_4 | class WebAppCache {
public List<WebappInfo> getAppBarWebInfos(String serverName) {
return getAppBarWebInfos(serverName, null);
}
public WebAppCache(Supplier<Collection<ComponentConfig>> supplier);
public List<WebappInfo> getAppBarWebInfos(String serverName, String menuName);
public Optio... | WebappInfo wInfo0 = new WebappInfo.Builder().server("foo").title("foo").create();
wInfos.add(wInfo0);
WebappInfo wInfo1 = new WebappInfo.Builder().server("foo").title("foo").position("14").create();
wInfos.add(wInfo1);
// Ensure that there is no collision.
assertThat(wac... | [FOCAL] public List<WebappInfo> WebAppCache.getAppBarWebInfos(String serverName)
[CLASS] class WebAppCache
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] List<WebappInfo> getAppBarWebInfos(String serverName, String menuName)
[INPUTS] branches=- | result=serverName
[DATAFLOW] serve... | /* static context
[FOCAL] public List<WebappInfo> WebAppCache.getAppBarWebInfos(String serverName)
[INPUTS] branches=- | result=serverName
[CALLS-INTERNAL] List<WebappInfo> getAppBarWebInfos(String serverName, String menuName)
*/
| /* static context
[FOCAL] public List<WebappInfo> WebAppCache.getAppBarWebInfos(String serverName)
[INPUTS] branches=- | result=serverName
[CALLS-INTERNAL] List<WebappInfo> getAppBarWebInfos(String serverName, String menuName)
*/
class WebAppCache {
public List<WebappInfo> getAppBarWebInfos(String serverName) {
... | true | ok | {"focal": {"class": "WebAppCache", "name": "getAppBarWebInfos", "signature": "List<WebappInfo> getAppBarWebInfos(String serverName)", "start_line": 3, "modifiers": "public", "params": [{"name": "serverName", "type": "String"}], "return_type": "List<WebappInfo>"}, "class_info": {"name": "WebAppCache", "kind": "class", "... |
81880059_4 | class BrokerApiVersionInterceptor extends HandlerInterceptorAdapter {
public boolean preHandle(HttpServletRequest request, HttpServletResponse response,
Object handler) throws ServiceBrokerApiVersionException {
if (version != null && !anyVersionAllowed()) {
String apiVersion = request.getHeader(version.getBro... | String header = "header";
String version = "version";
String notVersion = "not_version";
when(brokerApiVersion.getBrokerApiVersionHeader()).thenReturn(header);
when(brokerApiVersion.getApiVersions()).thenReturn(version);
when(request.getHeader(header)).thenReturn(notVersion);
BrokerApiVersionIntercepto... | [FOCAL] public boolean BrokerApiVersionInterceptor.preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
[CLASS] class BrokerApiVersionInterceptor extends HandlerInterceptorAdapter
[METRICS] loc=24 cc=7 branches=5 loops=1 returns=1 throws=1 nesting=4
[CALLS-INTERNAL] boolean anyVersionAllo... | /* static context
[FOCAL] public boolean BrokerApiVersionInterceptor.preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
[THROWS-WHEN] ServiceBrokerApiVersionException when version != null && !anyVersionAllowed() && foreach(String brokerApiVersion : version.getApiVersions().split(", "))=... | /* static context
[FOCAL] public boolean BrokerApiVersionInterceptor.preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
[THROWS-WHEN] ServiceBrokerApiVersionException when version != null && !anyVersionAllowed() && foreach(String brokerApiVersion : version.getApiVersions().split(", "))=... | true | ok | {"focal": {"class": "BrokerApiVersionInterceptor", "name": "preHandle", "signature": "boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws ServiceBrokerApiVersionException", "start_line": 3, "modifiers": "public", "params": [{"name": "request", "type": "HttpServletRequest"}... |
81897811_0 | class JSPackagerWebSocketClient implements WebSocketListener {
@Override
public void onMessage(ResponseBody response) throws IOException {
if (response.contentType() != WebSocket.TEXT) {
FLog.w(TAG, "Websocket received unexpected message with payload of type " + response.contentType());
return;
... | final JSPackagerWebSocketClient.JSPackagerCallback callback =
mock(JSPackagerWebSocketClient.JSPackagerCallback.class);
final JSPackagerWebSocketClient client = new JSPackagerWebSocketClient("ws://not_needed", callback);
client.onMessage(ResponseBody.create(WebSocket.TEXT,
"{\"version\": 1, \"ta... | [FOCAL] @Override public void JSPackagerWebSocketClient.onMessage(ResponseBody response)
[CLASS] class JSPackagerWebSocketClient implements WebSocketListener
[METRICS] loc=45 cc=10 branches=7 loops=1 returns=3 throws=0 nesting=5
[CALLS-INTERNAL] void abort(String message, Throwable cause); void triggerMessageCallback(S... | /* static context
[FOCAL] @Override public void JSPackagerWebSocketClient.onMessage(ResponseBody response)
[PATH1] if(response.contentType() != WebSocket.TEXT)=F -> while(reader.hasNext())=T -> if(JsonToken.NULL == reader.peek())=F -> if("version".equals(field))=F -> if("target".equals(field))=F -> if("action".equals(f... | /* static context
[FOCAL] @Override public void JSPackagerWebSocketClient.onMessage(ResponseBody response)
[PATH1] if(response.contentType() != WebSocket.TEXT)=F -> while(reader.hasNext())=T -> if(JsonToken.NULL == reader.peek())=F -> if("version".equals(field))=F -> if("target".equals(field))=F -> if("action".equals(f... | true | ok | {"focal": {"class": "JSPackagerWebSocketClient", "name": "onMessage", "signature": "void onMessage(ResponseBody response) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "response", "type": "ResponseBody"}], "return_type": "void"}, "class_info": {"name": "JSPackagerWebSocketCl... |
81928401_1 | class JSONBeanUtil {
public static String mapToJSONBean(final Map<String,Object> map) {
final JSONObject obj = new JSONObject();
for (String key : map.keySet()) {
if (! key.startsWith("#")) { //don't include Camel stats
obj.put(key, map.get(key));
}
... | ObjectMapper mapper = new ObjectMapper();
SimpleOutputBean bean = new SimpleOutputBean();
bean.setC(50);
String jsonBeanExcpected = mapper.writeValueAsString(bean);
Map<String,Object> map = new HashMap<>();
map.put("c", 50);
map.put("#update-count-1",0);
... | [FOCAL] public static String JSONBeanUtil.mapToJSONBean(Map<String,Object> map)
[CLASS] class JSONBeanUtil
[METRICS] loc=9 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] Map<String,Object>.keySet/0, String.startsWith/1, JSONObject.put/2, Map<String,Object>.get/1, JSONObject.toString/0
[NEW] JSONO... | /* static context
[FOCAL] public static String JSONBeanUtil.mapToJSONBean(Map<String,Object> map)
[PATH1] foreach(String key : map.keySet())=T -> if(! key.startsWith("#"))=T -> exit loop -> return obj.toString()
[PATH2] foreach(String key : map.keySet())=F -> return obj.toString()
[PATH3] foreach(String key : map.keySe... | /* static context
[FOCAL] public static String JSONBeanUtil.mapToJSONBean(Map<String,Object> map)
[PATH1] foreach(String key : map.keySet())=T -> if(! key.startsWith("#"))=T -> exit loop -> return obj.toString()
[PATH2] foreach(String key : map.keySet())=F -> return obj.toString()
[PATH3] foreach(String key : map.keySe... | true | ok | {"focal": {"class": "JSONBeanUtil", "name": "mapToJSONBean", "signature": "String mapToJSONBean(Map<String,Object> map)", "start_line": 3, "modifiers": "public static", "params": [{"name": "map", "type": "Map<String,Object>"}], "return_type": "String"}, "class_info": {"name": "JSONBeanUtil", "kind": "class", "modifiers... |
81932909_9 | class CircleView extends View {
@Override
protected void dispatchDraw(Canvas canvas) {
Paint paint = new Paint();
paint.setColor(defaultColor);
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OUT));
canvas.drawCircle(mCenterX, mCenterY, mRadius, paint);
if(m... |
ActivityController<Activity> activityController = Robolectric.buildActivity(Activity.class).create().start().resume()
.visible();
Activity activity = activityController.get();
CircleView mView = new CircleView(activity);
mView.setCenterY(2);
mView.setCenterX(3... | [FOCAL] @Override protected void CircleView.dispatchDraw(Canvas canvas)
[CLASS] class CircleView extends View
[METRICS] loc=14 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] Paint.setColor/1, Paint.setXfermode/1, Canvas.drawCircle/4, View.dispatchDraw/1
[NEW] Paint, PorterDuffXfermode
[PATH1] if(... | /* static context
[FOCAL] @Override protected void CircleView.dispatchDraw(Canvas canvas)
[PATH1] if(mTransparentRadius != 0)=T
[PATH2] if(mTransparentRadius != 0)=F
[COLLABORATORS] param canvas:Canvas drawCircle/4
[NEW] Paint, PorterDuffXfermode
[CALLS-EXTERNAL] Paint.setColor/1, Paint.setXfermode/1, Canvas.drawCircle... | /* static context
[FOCAL] @Override protected void CircleView.dispatchDraw(Canvas canvas)
[PATH1] if(mTransparentRadius != 0)=T
[PATH2] if(mTransparentRadius != 0)=F
[COLLABORATORS] param canvas:Canvas drawCircle/4
[NEW] Paint, PorterDuffXfermode
[CALLS-EXTERNAL] Paint.setColor/1, Paint.setXfermode/1, Canvas.drawCircle... | true | ok | {"focal": {"class": "CircleView", "name": "dispatchDraw", "signature": "void dispatchDraw(Canvas canvas)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "canvas", "type": "Canvas"}], "return_type": "void"}, "class_info": {"name": "CircleView", "kind": "class", "modifiers": "", "superclass": "... |
82177245_4 | class TimeFormatter implements StringFormatter<Long> {
@Override
public String format(Long millis) {
long diff = System.currentTimeMillis() - millis;
if (diff < TimeUnit.HOURS.toMillis(1)) {
return resolver.get(R.string.label_minutes, Math.max(1, TimeUnit.MILLISECONDS.toMinutes(diff)));
}
i... | long yesterday = System.currentTimeMillis() - TimeUnit.DAYS.toMillis(1);
String formatted = new SimpleDateFormat("MMM dd").format(new Date(yesterday));
assertThat(formatter.format(yesterday)).isEqualTo(formatted);
}
} | [FOCAL] @Override public String TimeFormatter.format(Long millis)
[CLASS] class TimeFormatter implements StringFormatter<Long>
[METRICS] loc=14 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[CALLS-EXTERNAL] System.currentTimeMillis/0, TimeUnit.HOURS.toMillis/1, StringResolver.get/2, Math.max/2, TimeUnit.MILLISEC... | /* static context
[FOCAL] @Override public String TimeFormatter.format(Long millis)
[PATH1] if(diff < TimeUnit.HOURS.toMillis(1))=F -> if(diff < TimeUnit.DAYS.toMillis(1))=T -> return resolver.get(R.string.label_hours, Math.max(1, TimeUnit.MILLISECOND...
[PATH2] if(diff < TimeUnit.HOURS.toMillis(1))=T -> return resolve... | /* static context
[FOCAL] @Override public String TimeFormatter.format(Long millis)
[PATH1] if(diff < TimeUnit.HOURS.toMillis(1))=F -> if(diff < TimeUnit.DAYS.toMillis(1))=T -> return resolver.get(R.string.label_hours, Math.max(1, TimeUnit.MILLISECOND...
[PATH2] if(diff < TimeUnit.HOURS.toMillis(1))=T -> return resolve... | true | ok | {"focal": {"class": "TimeFormatter", "name": "format", "signature": "String format(Long millis)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "millis", "type": "Long"}], "return_type": "String"}, "class_info": {"name": "TimeFormatter", "kind": "class", "modifiers": "", "superclass": null, "int... |
82179206_55 | class HurlStack implements HttpStack {
@SuppressWarnings("deprecation")
/* package */ static void setConnectionParametersForRequest(HttpURLConnection connection,
Request<?> request) throws IOException, AuthFailureError {
switch (request.getMethod()) {
case Method.DEPRECATED_GET_... | TestRequest.Head request = new TestRequest.Head();
assertEquals(request.getMethod(), Method.HEAD);
HurlStack.setConnectionParametersForRequest(mMockConnection, request);
assertEquals("HEAD", mMockConnection.getRequestMethod());
assertFalse(mMockConnection.getDoOutput());
}
... | [FOCAL] @SuppressWarnings("deprecation") /* package */ static void HurlStack.setConnectionParametersForRequest(HttpURLConnection connection, Request<?> request)
[CLASS] class HurlStack implements HttpStack
[METRICS] loc=47 cc=11 branches=2 loops=0 returns=0 throws=1 nesting=2
[CALLS-INTERNAL] void addBody(HttpURLConnec... | /* static context
[FOCAL] @SuppressWarnings("deprecation") /* package * / static void HurlStack.setConnectionParametersForRequest(HttpURLConnection connection, Request<?> request)
[THROWS-WHEN] IllegalStateException when switch(request.getMethod())=default
[PATH1] switch(request.getMethod())=case Method.DEPRECATED_GET_... | /* static context
[FOCAL] @SuppressWarnings("deprecation") /* package * / static void HurlStack.setConnectionParametersForRequest(HttpURLConnection connection, Request<?> request)
[THROWS-WHEN] IllegalStateException when switch(request.getMethod())=default
[PATH1] switch(request.getMethod())=case Method.DEPRECATED_GET_... | true | ok | {"focal": {"class": "HurlStack", "name": "setConnectionParametersForRequest", "signature": "void setConnectionParametersForRequest(HttpURLConnection connection, Request<?> request) throws IOException, AuthFailureError", "start_line": 3, "modifiers": "@SuppressWarnings(\"deprecation\") /* package */ static", "params": [... |
82273737_4 | class SpinedBuffer extends AbstractSpinedBuffer implements Consumer<E>, Iterable<E> {
public Spliterator<E> spliterator() {
class Splitr implements Spliterator<E> {
// The current spine index
int splSpineIndex;
// Last spine index
final int lastSpineIndex;
... | public void testIntLastSplit(int[] array, SpinedBuffer.OfInt sb) {
Spliterator.OfInt spliterator = sb.spliterator();
Spliterator.OfInt split = spliterator.trySplit();
long splitSizes = (split == null) ? 0 : split.getExactSizeIfKnown();
long lastSplitSize = spliterator.getExactSizeIfK... | [FOCAL] public Spliterator<E> SpinedBuffer.spliterator()
[CLASS] class SpinedBuffer extends AbstractSpinedBuffer implements Consumer<E>, Iterable<E>
[METRICS] loc=122 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=3
[CALLS-EXTERNAL] Objects.requireNonNull/1, consumer.accept/1, Arrays.spliterator/3
[NEW] Splitr
[FIE... | /* static context
[FOCAL] public Spliterator<E> SpinedBuffer.spliterator()
[COLLABORATORS] field consumer accept/1
[FIELDS] read=lastSpineElementFence, lastSpineIndex, splElementIndex, splSpineIndex
[NEW] Splitr
[CALLS-EXTERNAL] Objects.requireNonNull/1, consumer.accept/1, Arrays.spliterator/3
*/
| /* static context
[FOCAL] public Spliterator<E> SpinedBuffer.spliterator()
[COLLABORATORS] field consumer accept/1
[FIELDS] read=lastSpineElementFence, lastSpineIndex, splElementIndex, splSpineIndex
[NEW] Splitr
[CALLS-EXTERNAL] Objects.requireNonNull/1, consumer.accept/1, Arrays.spliterator/3
*/
class SpinedBuffer ext... | true | ok | {"focal": {"class": "SpinedBuffer", "name": "spliterator", "signature": "Spliterator<E> spliterator()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Spliterator<E>"}, "class_info": {"name": "SpinedBuffer", "kind": "class", "modifiers": "", "superclass": "AbstractSpinedBuffer", "interfaces": "Co... |
82304453_8 | class FileBase implements File {
@Override
public final void write(String data) throws IOException {
Files.write(this.path(), data.getBytes());
}
public FileBase(Directory directory, String file);
public FileBase(String directory, String file);
public FileBase(Path directory, String... | final FileBase file = new FileBase(testFolder.getRoot().getAbsolutePath(), "ccc");
file.write("dasd");
MatcherAssert.assertThat(Files.exists(file.path()), Matchers.is(true));
}
} | [FOCAL] @Override public final void FileBase.write(String data)
[CLASS] class FileBase implements File
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] Path path()
[CALLS-EXTERNAL] Files.write/2, String.getBytes/0
[EXCEPTIONS] declares IOException
[DATAFLOW] data@param->L3
[CLASS-ME... | /* static context
[FOCAL] @Override public final void FileBase.write(String data)
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] Path path()
[CALLS-EXTERNAL] Files.write/2, String.getBytes/0
*/
| /* static context
[FOCAL] @Override public final void FileBase.write(String data)
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] Path path()
[CALLS-EXTERNAL] Files.write/2, String.getBytes/0
*/
class FileBase implements File {
@Override
public final void write(String data) throws IOException {
File... | true | ok | {"focal": {"class": "FileBase", "name": "write", "signature": "void write(String data) throws IOException", "start_line": 3, "modifiers": "@Override public final", "params": [{"name": "data", "type": "String"}], "return_type": "void"}, "class_info": {"name": "FileBase", "kind": "class", "modifiers": "", "superclass": n... |
82313272_0 | class ObjectClassNameBuilder {
public String build() {
final StringBuilder nameBuilder = new StringBuilder();
Collections.reverse(enclosingClassSimpleNames);
for (String enclosingClassSimpleName : enclosingClassSimpleNames) {
nameBuilder.append(enclosingClassSimpleName).append("... | final String objectClassName = new ObjectClassNameBuilder("TargetClass").build();
assertEquals("TargetClass_Retainer", objectClassName);
}
} | [FOCAL] public String ObjectClassNameBuilder.build()
[CLASS] class ObjectClassNameBuilder
[METRICS] loc=8 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] Collections.reverse/1, nameBuilder.append(enclosingClassSimpleName).append/1, StringBuilder.append/1
[NEW] StringBuilder
[PATH1] foreach(String ... | /* static context
[FOCAL] public String ObjectClassNameBuilder.build()
[PATH1] foreach(String enclosingClassSimpleName : enclosingClassSimpleNames)=T -> exit loop -> return nameBuilder + targetClassSimpleName + RETAINER_CLASS_SUFFIX
[PATH2] foreach(String enclosingClassSimpleName : enclosingClassSimpleNames)=F -> retur... | /* static context
[FOCAL] public String ObjectClassNameBuilder.build()
[PATH1] foreach(String enclosingClassSimpleName : enclosingClassSimpleNames)=T -> exit loop -> return nameBuilder + targetClassSimpleName + RETAINER_CLASS_SUFFIX
[PATH2] foreach(String enclosingClassSimpleName : enclosingClassSimpleNames)=F -> retur... | true | ok | {"focal": {"class": "ObjectClassNameBuilder", "name": "build", "signature": "String build()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "ObjectClassNameBuilder", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members"... |
82348984_46 | class FloatCoder extends BaseCoder<Float> {
@Override
public void serialize(@NonNull Bundle state, @NonNull String key, @NonNull Float fieldValue) {
state.putFloat(key, fieldValue);
}
private FloatCoder mCoder;
}
class FloatCoderTest extends BaseCoder<Float> {
private FloatCoder mCoder;... | Float expectedValue = 9.0f;
mCoder.serialize(bundle(), randomKey(), expectedValue);
assertEquals(expectedValue, bundle().getFloat(randomKey()));
}
} | [FOCAL] @Override public void FloatCoder.serialize(Bundle state, String key, Float fieldValue)
[CLASS] class FloatCoder extends BaseCoder<Float>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] Bundle.putFloat/2
[COLLABORATORS] param state:Bundle putFloat/2
[DATAFLOW] fieldValue@par... | /* static context
[FOCAL] @Override public void FloatCoder.serialize(Bundle state, String key, Float fieldValue)
[COLLABORATORS] param state:Bundle putFloat/2
[CALLS-EXTERNAL] Bundle.putFloat/2
*/
| /* static context
[FOCAL] @Override public void FloatCoder.serialize(Bundle state, String key, Float fieldValue)
[COLLABORATORS] param state:Bundle putFloat/2
[CALLS-EXTERNAL] Bundle.putFloat/2
*/
class FloatCoder extends BaseCoder<Float> {
@Override
public void serialize(@NonNull Bundle state, @NonNull String... | true | ok | {"focal": {"class": "FloatCoder", "name": "serialize", "signature": "void serialize(Bundle state, String key, Float fieldValue)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "state", "type": "Bundle"}, {"name": "key", "type": "String"}, {"name": "fieldValue", "type": "Float"}], "return_type": ... |
82384202_23 | class MirrorFs implements se.tfiskgul.mux2fs.fs.base.FileSystem {
@Override
public int release(String path, int fileHandle) {
logger.info("release({}, {})", fileHandle, path);
FileChannel fileChannel = openFiles.remove(fileHandle);
if (fileChannel == null) {
return -ErrorCodes.EBADF();
}
safeClose(fileC... | // Given
FileHandleFiller filler = mock(FileHandleFiller.class);
ArgumentCaptor<Integer> handleCaptor = ArgumentCaptor.forClass(Integer.class);
doNothing().when(filler).setFileHandle(handleCaptor.capture());
Path fooBar = mockPath(mirrorRoot, "foo.bar");
when(fileSystem.provider().newFileChannel(eq(fooBar),... | [FOCAL] @Override public int MirrorFs.release(String path, int fileHandle)
[CLASS] class MirrorFs implements se.tfiskgul.mux2fs.fs.base.FileSystem
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] void safeClose(FileChannel fileChannel)
[CALLS-EXTERNAL] logger.info/3, openFiles.remo... | /* static context
[FOCAL] @Override public int MirrorFs.release(String path, int fileHandle)
[PATH1] if(fileChannel == null)=T -> return -ErrorCodes.EBADF()
[PATH2] if(fileChannel == null)=F -> return SUCCESS
[INPUTS] branches=fileHandle | result=-
[COLLABORATORS] field openFiles remove/1
[CALLS-INTERNAL] void safeClos... | /* static context
[FOCAL] @Override public int MirrorFs.release(String path, int fileHandle)
[PATH1] if(fileChannel == null)=T -> return -ErrorCodes.EBADF()
[PATH2] if(fileChannel == null)=F -> return SUCCESS
[INPUTS] branches=fileHandle | result=-
[COLLABORATORS] field openFiles remove/1
[CALLS-INTERNAL] void safeClos... | true | ok | {"focal": {"class": "MirrorFs", "name": "release", "signature": "int release(String path, int fileHandle)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "path", "type": "String"}, {"name": "fileHandle", "type": "int"}], "return_type": "int"}, "class_info": {"name": "MirrorFs", "kind": "class", ... |
82398873_3 | class TodoService {
public boolean edit(TodoEntity entity) {
if(todoDAO.findById(entity.getId()) == null) return false;
TodoEntity existingTodoEntity = todoDAO.findByName(entity.getName());
if(existingTodoEntity!=null && existingTodoEntity.getId()!=entity.getId()) return false;
if... | TodoEntity alreadyExistingTodo = new TodoEntity();
alreadyExistingTodo.setId(1);
alreadyExistingTodo.setStatus(TodoStatusType.OPEN);
alreadyExistingTodo.setName("Test already existing name");
TodoEntity todoToEdit = new TodoEntity();
todoToEdit.setId(1);
todoToEd... | [FOCAL] public boolean TodoService.edit(TodoEntity entity)
[CLASS] class TodoService
[METRICS] loc=11 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=1
[CALLS-EXTERNAL] TodoDAO.findById/1, TodoEntity.getId/0, TodoDAO.findByName/1, TodoEntity.getName/0, TodoEntity.getStatus/0, TodoDAO.saveOrUpdate/1
[FIELDS] read=tod... | /* static context
[FOCAL] public boolean TodoService.edit(TodoEntity entity)
[PATH1] if(todoDAO.findById(entity.getId()) == null)=F -> if(existingTodoEntity!=null && existingTodoEntity.getId()!=entity.getId())=F -> if(entity.getStatus()==null)=T -> return false
[PATH2] if(todoDAO.findById(entity.getId()) == null)=F -> ... | /* static context
[FOCAL] public boolean TodoService.edit(TodoEntity entity)
[PATH1] if(todoDAO.findById(entity.getId()) == null)=F -> if(existingTodoEntity!=null && existingTodoEntity.getId()!=entity.getId())=F -> if(entity.getStatus()==null)=T -> return false
[PATH2] if(todoDAO.findById(entity.getId()) == null)=F -> ... | true | ok | {"focal": {"class": "TodoService", "name": "edit", "signature": "boolean edit(TodoEntity entity)", "start_line": 3, "modifiers": "public", "params": [{"name": "entity", "type": "TodoEntity"}], "return_type": "boolean"}, "class_info": {"name": "TodoService", "kind": "class", "modifiers": "", "superclass": null, "interfa... |
82427374_36 | class RoleConversionService {
public Role convert(RoleRepresentation representation) {
Role role = new Role(representation.getName());
role.setDescription(representation.getDescription());
return role;
}
public RoleRepresentation convert(Role role);
public Role convert(RoleRepresentation representation, Rol... | RoleRepresentation representation = RoleDSL.role().build();
Role role = roleConversionService.convert(representation);
assertThat(role.getName()).isEqualTo(representation.getName());
assertThat(role.getDescription()).isEqualTo(representation.getDescription());
}
} | [FOCAL] public Role RoleConversionService.convert(RoleRepresentation representation)
[CLASS] class RoleConversionService
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] RoleRepresentation.getName/0, Role.setDescription/1, RoleRepresentation.getDescription/0
[NEW] Role
[INPUTS] bran... | /* static context
[FOCAL] public Role RoleConversionService.convert(RoleRepresentation representation)
[INPUTS] branches=- | result=representation
[COLLABORATORS] param representation:RoleRepresentation getName/0,getDescription/0
[NEW] Role
[CALLS-EXTERNAL] RoleRepresentation.getName/0, Role.setDescription/1, RoleRepre... | /* static context
[FOCAL] public Role RoleConversionService.convert(RoleRepresentation representation)
[INPUTS] branches=- | result=representation
[COLLABORATORS] param representation:RoleRepresentation getName/0,getDescription/0
[NEW] Role
[CALLS-EXTERNAL] RoleRepresentation.getName/0, Role.setDescription/1, RoleRepre... | true | ok | {"focal": {"class": "RoleConversionService", "name": "convert", "signature": "Role convert(RoleRepresentation representation)", "start_line": 3, "modifiers": "public", "params": [{"name": "representation", "type": "RoleRepresentation"}], "return_type": "Role"}, "class_info": {"name": "RoleConversionService", "kind": "c... |
82468869_5 | class RpcRouterConfig {
public String getHandlerPackage() {
return handlerPackage;
}
public RpcRouterConfig();
public String getDescription();
public void setDescription(String description);
public void setHandlerPackage(String handlerPackage);
public String getJsonPath();
pu... | String configName = "rpc-router-false-package";
RpcRouterConfig config = (RpcRouterConfig) Config.getInstance().getJsonObjectConfig(configName, RpcRouterConfig.class);
List<String> handlers;
try (ScanResult scanResult = new ClassGraph()
.whitelistPackages(config.getHandle... | [FOCAL] public String RpcRouterConfig.getHandlerPackage()
[CLASS] class RpcRouterConfig
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] RpcRouterConfig(); String getDescription(); void setDescription(String description); void setHandlerPackage(String handlerPackage); String getJsonP... | /* static context
[FOCAL] public String RpcRouterConfig.getHandlerPackage()
*/
| /* static context
[FOCAL] public String RpcRouterConfig.getHandlerPackage()
*/
class RpcRouterConfig {
public String getHandlerPackage() {
return handlerPackage;
}
public RpcRouterConfig();
public String getDescription();
public void setDescription(String description);
public void se... | true | ok | {"focal": {"class": "RpcRouterConfig", "name": "getHandlerPackage", "signature": "String getHandlerPackage()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "RpcRouterConfig", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [],... |
82477856_2 | class StringMethods {
public static boolean containsIgnoreCase(String str, String searchStr) {
if (str != null && searchStr != null) {
int len = searchStr.length();
int max = str.length() - len;
for (int i = 0; i <= max; ++i) {
if (str.regionMatches(true,... | assertThat(containsIgnoreCase("STRING1", "StRiNg1"), is(true));
assertThat(containsIgnoreCase("STRING1", "StRiNg12"), is(false));
}
} | [FOCAL] public static boolean StringMethods.containsIgnoreCase(String str, String searchStr)
[CLASS] class StringMethods
[METRICS] loc=14 cc=4 branches=2 loops=1 returns=3 throws=0 nesting=3
[CALLS-EXTERNAL] String.length/0, String.regionMatches/5
[PATH1] if(str != null && searchStr != null)=T -> for(i <= max)=T -> if(... | /* static context
[FOCAL] public static boolean StringMethods.containsIgnoreCase(String str, String searchStr)
[PATH1] if(str != null && searchStr != null)=T -> for(i <= max)=T -> if(str.regionMatches(true, i, searchStr, 0, len))=F -> exit loop -> return false
[PATH2] if(str != null && searchStr != null)=T -> for(i <= ... | /* static context
[FOCAL] public static boolean StringMethods.containsIgnoreCase(String str, String searchStr)
[PATH1] if(str != null && searchStr != null)=T -> for(i <= max)=T -> if(str.regionMatches(true, i, searchStr, 0, len))=F -> exit loop -> return false
[PATH2] if(str != null && searchStr != null)=T -> for(i <= ... | true | ok | {"focal": {"class": "StringMethods", "name": "containsIgnoreCase", "signature": "boolean containsIgnoreCase(String str, String searchStr)", "start_line": 3, "modifiers": "public static", "params": [{"name": "str", "type": "String"}, {"name": "searchStr", "type": "String"}], "return_type": "boolean"}, "class_info": {"na... |
82480345_2 | class PlaylistParser {
public static Playlist parse(final InputStream inputStream) {
if (inputStream == null) {
throw new IllegalArgumentException("Input stream is null!");
}
List<Playlist.Track> tracks = new ArrayList<>();
int version = -1, entries = -1;
Buffer... | // Arrange, act
Playlist playlist = PlaylistParser.parse(TEST_PLS, ENCODING_ASCII);
// Verify
assertNotNull(playlist);
assertEquals(TEST_PLAYLIST_SIZE, playlist.getTracks().size());
assertEquals(TEST_PLAYLIST_VERSION, playlist.getVersion());
}
} | [FOCAL] public static Playlist PlaylistParser.parse(InputStream inputStream)
[CLASS] class PlaylistParser
[METRICS] loc=52 cc=10 branches=7 loops=1 returns=1 throws=1 nesting=3
[CALLS-INTERNAL] int getTrackIndexAndAddIfMissing(List<Playlist.Track> tracks, Matcher matcher)
[CALLS-EXTERNAL] BufferedReader.readLine/0, FIL... | /* static context
[FOCAL] public static Playlist PlaylistParser.parse(InputStream inputStream)
[THROWS-WHEN] IllegalArgumentException when inputStream == null
[PATH1] if(inputStream == null)=F -> while((line = reader.readLine()) != null)=T -> if(fileMatcher.matches())=F -> if(titleMatcher.matches())=F -> if(lengthMatch... | /* static context
[FOCAL] public static Playlist PlaylistParser.parse(InputStream inputStream)
[THROWS-WHEN] IllegalArgumentException when inputStream == null
[PATH1] if(inputStream == null)=F -> while((line = reader.readLine()) != null)=T -> if(fileMatcher.matches())=F -> if(titleMatcher.matches())=F -> if(lengthMatch... | true | ok | {"focal": {"class": "PlaylistParser", "name": "parse", "signature": "Playlist parse(InputStream inputStream)", "start_line": 3, "modifiers": "public static", "params": [{"name": "inputStream", "type": "InputStream"}], "return_type": "Playlist"}, "class_info": {"name": "PlaylistParser", "kind": "class", "modifiers": "",... |
82595458_5 | class SpecificBlockingRestKiqrClientImpl implements SpecificBlockingKiqrClient<K,V> {
@Override
public Map<K, V> getAllKeyValues() {
return genericClient.getAllKeyValues(store, keyClass, valueClass, keySerde, valueSerde);
}
public SpecificBlockingRestKiqrClientImpl(String host, int port, Stri... |
Map<String, Long> results = new HashMap<>();
results.put("key1", 6L);
when(clientMock.getAllKeyValues(any(), eq(String.class), eq(Long.class), any(), any())).thenReturn(results);
Map<String, Long> result = unitUnderTest.getAllKeyValues();
assertThat(result.size(), is(equalTo(1... | [FOCAL] @Override public Map<K, V> SpecificBlockingRestKiqrClientImpl.getAllKeyValues()
[CLASS] class SpecificBlockingRestKiqrClientImpl implements SpecificBlockingKiqrClient<K,V>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] genericClient.getAllKeyValues/5
[COLLABORATORS] field ... | /* static context
[FOCAL] @Override public Map<K, V> SpecificBlockingRestKiqrClientImpl.getAllKeyValues()
[COLLABORATORS] field genericClient getAllKeyValues/5
[CALLS-EXTERNAL] genericClient.getAllKeyValues/5
*/
| /* static context
[FOCAL] @Override public Map<K, V> SpecificBlockingRestKiqrClientImpl.getAllKeyValues()
[COLLABORATORS] field genericClient getAllKeyValues/5
[CALLS-EXTERNAL] genericClient.getAllKeyValues/5
*/
class SpecificBlockingRestKiqrClientImpl implements SpecificBlockingKiqrClient<K,V> {
@Override
pub... | true | ok | {"focal": {"class": "SpecificBlockingRestKiqrClientImpl", "name": "getAllKeyValues", "signature": "Map<K, V> getAllKeyValues()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Map<K, V>"}, "class_info": {"name": "SpecificBlockingRestKiqrClientImpl", "kind": "class", "modifiers": "", "su... |
82604742_339 | class GroupNameRule extends ValidNameRule {
@Override
protected MessageResponseStatus getMessageResponseStatus() {
return FaultType.INVALID_GROUP_NAME;
}
public GroupNameRule(final String theName);
@Override protected String getMessage();
@Override public void validate();
privat... | final MessageResponseStatus messageResponseStatus = rule.getMessageResponseStatus();
assertEquals("InvalidGroupName", messageResponseStatus.getMessage());
}
} | [FOCAL] @Override protected MessageResponseStatus GroupNameRule.getMessageResponseStatus()
[CLASS] class GroupNameRule extends ValidNameRule
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] GroupNameRule(String theName); String getMessage(); void validate()
[TEST] GroupNameRuleTest: ... | /* static context
[FOCAL] @Override protected MessageResponseStatus GroupNameRule.getMessageResponseStatus()
*/
| /* static context
[FOCAL] @Override protected MessageResponseStatus GroupNameRule.getMessageResponseStatus()
*/
class GroupNameRule extends ValidNameRule {
@Override
protected MessageResponseStatus getMessageResponseStatus() {
return FaultType.INVALID_GROUP_NAME;
}
public GroupNameRule(final ... | true | ok | {"focal": {"class": "GroupNameRule", "name": "getMessageResponseStatus", "signature": "MessageResponseStatus getMessageResponseStatus()", "start_line": 3, "modifiers": "@Override protected", "params": [], "return_type": "MessageResponseStatus"}, "class_info": {"name": "GroupNameRule", "kind": "class", "modifiers": "", ... |
82722869_3 | class SimpleLogger implements Log {
public void debug(Object message) {
out.println(message);
}
public void debug(Object message, Throwable th);
public void error(Object message);
public void error(Object message, Throwable th);
public void fatal(Object message);
public void fatal(Object message, Throwable t... | testee.debug(object);
assertMessageSendViaSystemOut();
assertMessageNotSendViaSystemErr();
}
} | [FOCAL] public void SimpleLogger.debug(Object message)
[CLASS] class SimpleLogger implements Log
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] PrintStream.println/1
[FIELDS] read=out:PrintStream
[COLLABORATORS] field out:PrintStream println/1
[DATAFLOW] message@param->L2; this.ou... | /* static context
[FOCAL] public void SimpleLogger.debug(Object message)
[COLLABORATORS] field out:PrintStream println/1
[FIELDS] read=out:PrintStream
[CALLS-EXTERNAL] PrintStream.println/1
*/
| /* static context
[FOCAL] public void SimpleLogger.debug(Object message)
[COLLABORATORS] field out:PrintStream println/1
[FIELDS] read=out:PrintStream
[CALLS-EXTERNAL] PrintStream.println/1
*/
class SimpleLogger implements Log {
public void debug(Object message) {
out.println(message);
}
public void debug(Object... | true | ok | {"focal": {"class": "SimpleLogger", "name": "debug", "signature": "void debug(Object message)", "start_line": 3, "modifiers": "public", "params": [{"name": "message", "type": "Object"}], "return_type": "void"}, "class_info": {"name": "SimpleLogger", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "L... |
82764073_6 | class DataManager {
public Single<List<Topic>> getUserTopics(String userLogin, int offset) {
return mService.getUserTopics(buildAuthorization(), userLogin, offset, PAGE_LIMIT)
.compose(applySingleSchedulers());
}
public DataManager(@NonNull OkHttpClient client, @NonNull Preference... | TestObserver<List<Topic>> testObserver = mDataManager.getUserTopics("xshengcn", 0).test()
.await();
testObserver.assertNoErrors();
testObserver.assertComplete();
}
} | [FOCAL] public Single<List<Topic>> DataManager.getUserTopics(String userLogin, int offset)
[CLASS] class DataManager
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String buildAuthorization()
[CALLS-EXTERNAL] mService.getUserTopics(buildAuthorization(), userLogin, o....compose/1, ... | /* static context
[FOCAL] public Single<List<Topic>> DataManager.getUserTopics(String userLogin, int offset)
[INPUTS] branches=- | result=offset, userLogin
[COLLABORATORS] field mService getUserTopics/4
[CALLS-INTERNAL] String buildAuthorization()
[CALLS-EXTERNAL] mService.getUserTopics(buildAuthorization(), userLogin,... | /* static context
[FOCAL] public Single<List<Topic>> DataManager.getUserTopics(String userLogin, int offset)
[INPUTS] branches=- | result=offset, userLogin
[COLLABORATORS] field mService getUserTopics/4
[CALLS-INTERNAL] String buildAuthorization()
[CALLS-EXTERNAL] mService.getUserTopics(buildAuthorization(), userLogin,... | true | ok | {"focal": {"class": "DataManager", "name": "getUserTopics", "signature": "Single<List<Topic>> getUserTopics(String userLogin, int offset)", "start_line": 3, "modifiers": "public", "params": [{"name": "userLogin", "type": "String"}, {"name": "offset", "type": "int"}], "return_type": "Single<List<Topic>>"}, "class_info":... |
82809641_2 | class OpenTracingHelper extends Helper {
public Tracer getTracer() {
if (tracer == null) {
// Initialize on first use
initTracer();
}
return tracer;
}
public OpenTracingHelper(Rule rule);
private boolean allowInstrumentedTracer();
protected void in... | System.setProperty("io.opentracing.contrib.agent.allowInstrumentedTracer", "true");
try {
OpenTracingHelper helper = new OpenTracingHelper(null);
Tracer tracer = helper.getTracer();
assertNotNull(tracer);
tracer.buildSpan("test2");
} catch(DummyT... | [FOCAL] public Tracer OpenTracingHelper.getTracer()
[CLASS] class OpenTracingHelper extends Helper
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] void initTracer()
[PATH1] if(tracer == null)=T -> return tracer
[PATH2] if(tracer == null)=F -> return tracer
[CLASS-MEMBERS] OpenTraci... | /* static context
[FOCAL] public Tracer OpenTracingHelper.getTracer()
[PATH1] if(tracer == null)=T -> return tracer
[PATH2] if(tracer == null)=F -> return tracer
[CALLS-INTERNAL] void initTracer()
*/
| /* static context
[FOCAL] public Tracer OpenTracingHelper.getTracer()
[PATH1] if(tracer == null)=T -> return tracer
[PATH2] if(tracer == null)=F -> return tracer
[CALLS-INTERNAL] void initTracer()
*/
class OpenTracingHelper extends Helper {
public Tracer getTracer() {
if (tracer == null) {
// I... | true | ok | {"focal": {"class": "OpenTracingHelper", "name": "getTracer", "signature": "Tracer getTracer()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Tracer"}, "class_info": {"name": "OpenTracingHelper", "kind": "class", "modifiers": "", "superclass": "Helper", "interfaces": null, "fields": [], "member... |
82821845_17 | class TsDumpFileUtils {
@VisibleForTesting
static FreqBandwidth getFreqAndBandwidth(File file) {
if (!"ts".equals(getExtension(file))) return null;
String[] parts = file.getName().toLowerCase().split("_");
if (parts.length != 4) return null;
if (!"mux".equals(parts[0])) return n... | TsDumpFileUtils.FreqBandwidth res =
TsDumpFileUtils.getFreqAndBandwidth(new File(ROOT, "mux_506000000_8000000_randomSuffix.ts"));
assertThat(res.freq, is(506_000_000L));
assertThat(res.bandwidth, is(8_000_000L));
}
} | [FOCAL] @VisibleForTesting static FreqBandwidth TsDumpFileUtils.getFreqAndBandwidth(File file)
[CLASS] class TsDumpFileUtils
[METRICS] loc=14 cc=5 branches=3 loops=0 returns=5 throws=0 nesting=1
[CALLS-INTERNAL] String getExtension(File file)
[CALLS-EXTERNAL] "ts".equals/1, file.getName().toLowerCase().split/1, file.ge... | /* static context
[FOCAL] @VisibleForTesting static FreqBandwidth TsDumpFileUtils.getFreqAndBandwidth(File file)
[PATH1] if(!"ts".equals(getExtension(file)))=F -> if(parts.length != 4)=F -> if(!"mux".equals(parts[0]))=F -> try-body throws -> return null
[PATH2] if(!"ts".equals(getExtension(file)))=T -> return null
[PAT... | /* static context
[FOCAL] @VisibleForTesting static FreqBandwidth TsDumpFileUtils.getFreqAndBandwidth(File file)
[PATH1] if(!"ts".equals(getExtension(file)))=F -> if(parts.length != 4)=F -> if(!"mux".equals(parts[0]))=F -> try-body throws -> return null
[PATH2] if(!"ts".equals(getExtension(file)))=T -> return null
[PAT... | true | ok | {"focal": {"class": "TsDumpFileUtils", "name": "getFreqAndBandwidth", "signature": "FreqBandwidth getFreqAndBandwidth(File file)", "start_line": 3, "modifiers": "@VisibleForTesting static", "params": [{"name": "file", "type": "File"}], "return_type": "FreqBandwidth"}, "class_info": {"name": "TsDumpFileUtils", "kind": "... |
82903968_0 | class LoginController {
public String login(UserForm userForm) {
log.debug("LoginController.login {}", userForm);
try {
if (userForm == null) {
return "ERROR";
} else if (loginService.login(userForm)) {
return "OK";
} else {
... | loginController.login(userForm);
verify(loginService).login(userForm);
verifyNoMoreInteractions(loginService);
}
} | [FOCAL] public String LoginController.login(UserForm userForm)
[CLASS] class LoginController
[METRICS] loc=15 cc=4 branches=2 loops=0 returns=4 throws=0 nesting=3
[CALLS-EXTERNAL] log.debug/2, LoginService.login/1
[FIELDS] read=loginService:LoginService
[EXCEPTIONS] catches Exception e
[PATH1] if(userForm == null)=F ->... | /* static context
[FOCAL] public String LoginController.login(UserForm userForm)
[PATH1] if(userForm == null)=F -> if(loginService.login(userForm))=T -> return "OK"
[PATH2] try-body throws -> return "ERROR"
[PATH3] if(userForm == null)=F -> if(loginService.login(userForm))=F -> return "KO"
[PATH4] if(userForm == null)=... | /* static context
[FOCAL] public String LoginController.login(UserForm userForm)
[PATH1] if(userForm == null)=F -> if(loginService.login(userForm))=T -> return "OK"
[PATH2] try-body throws -> return "ERROR"
[PATH3] if(userForm == null)=F -> if(loginService.login(userForm))=F -> return "KO"
[PATH4] if(userForm == null)=... | true | ok | {"focal": {"class": "LoginController", "name": "login", "signature": "String login(UserForm userForm)", "start_line": 3, "modifiers": "public", "params": [{"name": "userForm", "type": "UserForm"}], "return_type": "String"}, "class_info": {"name": "LoginController", "kind": "class", "modifiers": "", "superclass": null, ... |
82906551_114 | class URL implements Serializable {
public String getPath() {
return path;
}
protected URL();
public URL(String protocol, String host, int port);
public URL(String protocol, String host, int port, String[] pairs);
public URL(String protocol, String host, int port, Map<String, String> parameters);
public ... | URL url = new URL("dubbo", "localhost", 20880, "////path");
assertEquals("path", url.getPath());
}
} | [FOCAL] public String URL.getPath()
[CLASS] class URL implements Serializable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] URL(); URL(String protocol, String host, int port); URL(String protocol, String host, int port, String[] pairs); URL(String protocol, String host, int port, ... | /* static context
[FOCAL] public String URL.getPath()
*/
| /* static context
[FOCAL] public String URL.getPath()
*/
class URL implements Serializable {
public String getPath() {
return path;
}
protected URL();
public URL(String protocol, String host, int port);
public URL(String protocol, String host, int port, String[] pairs);
public URL(String protocol, String ... | true | ok | {"focal": {"class": "URL", "name": "getPath", "signature": "String getPath()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "URL", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Serializable", "fields": [], "members": [{"name": "URL", "kind... |
82968973_37 | class RadialSort extends DistancedSort {
@Override
public PointF getDistancePoint(ViewGroup parent, List<View> children) {
PointF distancePoint;
switch (position) {
case TOP_LEFT:
distancePoint = new PointF(0, 0);
break;
case TOP_MIDDLE:
... | radialSort = new RadialSort(/*interObjectDelay=*/0,
/*reversed=*/false,
RadialSort.Position.MIDDLE);
// fake a width and height of 20, this will be double the expected value
Mockito.when(mockParent.getHeight()).thenReturn(20);
Mockito.when(mockParent.getWi... | [FOCAL] @Override public PointF RadialSort.getDistancePoint(ViewGroup parent, List<View> children)
[CLASS] class RadialSort extends DistancedSort
[METRICS] loc=38 cc=10 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] ViewGroup.getWidth/0, ViewGroup.getHeight/0, DistancedSort.translate/2
[NEW] PointF, A... | /* static context
[FOCAL] @Override public PointF RadialSort.getDistancePoint(ViewGroup parent, List<View> children)
[THROWS-WHEN] AssertionError when switch(position)=default
[PATH1] switch(position)=case TOP_LEFT -> return super.translate(distancePoint, children)
[PATH2] switch(position)=default -> throw new Assertio... | /* static context
[FOCAL] @Override public PointF RadialSort.getDistancePoint(ViewGroup parent, List<View> children)
[THROWS-WHEN] AssertionError when switch(position)=default
[PATH1] switch(position)=case TOP_LEFT -> return super.translate(distancePoint, children)
[PATH2] switch(position)=default -> throw new Assertio... | true | ok | {"focal": {"class": "RadialSort", "name": "getDistancePoint", "signature": "PointF getDistancePoint(ViewGroup parent, List<View> children)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "parent", "type": "ViewGroup"}, {"name": "children", "type": "List<View>"}], "return_type": "PointF"}, "class... |
82982240_0 | class PopupBridge extends BrowserSwitchFragment {
@SuppressLint("SetJavaScriptEnabled")
public static PopupBridge newInstance(AppCompatActivity activity, WebView webView) throws IllegalArgumentException {
return newInstance((FragmentActivity)activity, webView);
}
public PopupBridge();
@S... | Exception thrownException = null;
AppCompatTestActivity appCompatTestActivity = Robolectric.setupActivity(AppCompatTestActivity.class);
WebView webView = new WebView(appCompatTestActivity);
try {
PopupBridge.newInstance(null, webView);
} catch (IllegalArgumentExceptio... | [FOCAL] @SuppressLint("SetJavaScriptEnabled") public static PopupBridge PopupBridge.newInstance(AppCompatActivity activity, WebView webView)
[CLASS] class PopupBridge extends BrowserSwitchFragment
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] PopupBridge newInstance(FragmentActiv... | /* static context
[FOCAL] @SuppressLint("SetJavaScriptEnabled") public static PopupBridge PopupBridge.newInstance(AppCompatActivity activity, WebView webView)
[INPUTS] branches=- | result=activity, webView
[EXCEPTIONS] declares IllegalArgumentException
[CALLS-INTERNAL] PopupBridge newInstance(FragmentActivity activity,... | /* static context
[FOCAL] @SuppressLint("SetJavaScriptEnabled") public static PopupBridge PopupBridge.newInstance(AppCompatActivity activity, WebView webView)
[INPUTS] branches=- | result=activity, webView
[EXCEPTIONS] declares IllegalArgumentException
[CALLS-INTERNAL] PopupBridge newInstance(FragmentActivity activity,... | true | ok | {"focal": {"class": "PopupBridge", "name": "newInstance", "signature": "PopupBridge newInstance(AppCompatActivity activity, WebView webView) throws IllegalArgumentException", "start_line": 3, "modifiers": "@SuppressLint(\"SetJavaScriptEnabled\") public static", "params": [{"name": "activity", "type": "AppCompatActivity... |
83002023_5 | class BrowserSwitchConfig {
Intent createIntentForBrowserSwitchActivityQuery(String returnUrlScheme) {
String browserSwitchUrl = String.format("%s://", returnUrlScheme);
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(browserSwitchUrl));
intent.addCategory(Intent.CATEGORY_DEFAULT);... | when(context.getApplicationContext()).thenReturn(applicationContext);
when(applicationContext.getPackageName()).thenReturn("sample.package.name");
String returnUrlScheme = "sample.package.name.browserswitch";
Intent result = sut.createIntentForBrowserSwitchActivityQuery(returnUrlScheme)... | [FOCAL] Intent BrowserSwitchConfig.createIntentForBrowserSwitchActivityQuery(String returnUrlScheme)
[CLASS] class BrowserSwitchConfig
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] String.format/2, Uri.parse/1, Intent.addCategory/1
[NEW] Intent
[INPUTS] branches=- | result=return... | /* static context
[FOCAL] Intent BrowserSwitchConfig.createIntentForBrowserSwitchActivityQuery(String returnUrlScheme)
[INPUTS] branches=- | result=returnUrlScheme
[NEW] Intent
[CALLS-EXTERNAL] String.format/2, Uri.parse/1, Intent.addCategory/1
*/
| /* static context
[FOCAL] Intent BrowserSwitchConfig.createIntentForBrowserSwitchActivityQuery(String returnUrlScheme)
[INPUTS] branches=- | result=returnUrlScheme
[NEW] Intent
[CALLS-EXTERNAL] String.format/2, Uri.parse/1, Intent.addCategory/1
*/
class BrowserSwitchConfig {
Intent createIntentForBrowserSwitchActi... | true | ok | {"focal": {"class": "BrowserSwitchConfig", "name": "createIntentForBrowserSwitchActivityQuery", "signature": "Intent createIntentForBrowserSwitchActivityQuery(String returnUrlScheme)", "start_line": 3, "modifiers": "", "params": [{"name": "returnUrlScheme", "type": "String"}], "return_type": "Intent"}, "class_info": {"... |
83122389_1 | class UpdateIntelliJSdksTask extends DefaultTask {
@TaskAction
public void exec() throws IOException {
Path userHome = Paths.get(System.getProperty("user.home"));
final List<Path> intelliJFolders;
try (var files = Files.list(userHome)) {
intelliJFolders =
files
.filter(
... | Path intelliJFolder = Files.createDirectories(testUserHome.resolve(".IntelliJIdea2019.1"));
task.exec();
assertNoExistingConfig(intelliJFolder);
}
} | [FOCAL] @TaskAction public void UpdateIntelliJSdksTask.exec()
[CLASS] class UpdateIntelliJSdksTask extends DefaultTask
[METRICS] loc=74 cc=5 branches=2 loops=0 returns=0 throws=1 nesting=1
[CALLS-INTERNAL] void updateConfig(Path jdkTable, String jdkSubFolder, String jdkName, String templatePath, Map<String, Object> tem... | /* static context
[FOCAL] @TaskAction public void UpdateIntelliJSdksTask.exec()
[THROWS-WHEN] IllegalStateException when !intelliJFolders.isEmpty() && switch(new PlatformHelper().getOs())=default
[THROWS-WHEN] IllegalStateException when intelliJFolders.isEmpty() && switch(new PlatformHelper().getOs())=default
[PATH1] i... | /* static context
[FOCAL] @TaskAction public void UpdateIntelliJSdksTask.exec()
[THROWS-WHEN] IllegalStateException when !intelliJFolders.isEmpty() && switch(new PlatformHelper().getOs())=default
[THROWS-WHEN] IllegalStateException when intelliJFolders.isEmpty() && switch(new PlatformHelper().getOs())=default
[PATH1] i... | true | ok | {"focal": {"class": "UpdateIntelliJSdksTask", "name": "exec", "signature": "void exec() throws IOException", "start_line": 3, "modifiers": "@TaskAction public", "params": [], "return_type": "void"}, "class_info": {"name": "UpdateIntelliJSdksTask", "kind": "class", "modifiers": "", "superclass": "DefaultTask", "interfac... |
83137916_20 | class InitialRegistrationImpl {
@Activate
protected void activate(final Map<String, Object> props) throws ServiceException {
logger.debug("activate(): props = {}", props);
this.filterRoots = PropertiesUtil.toStringArray(props.get(PROP_FILTER_ROOTS), null);
if (this.filterRoots == null) {
throw new ServiceE... | /* Prepare data. */
assertEquals(0, this.baseDir.list().length);
createTempFiles(SYNC_FILTER_FN);
this.props.put(InitialRegistrationImpl.PROP_OVERWRITE_CONFIG_FILES, true);
/* Invoke method. */
this.initialRegistration.activate(this.props);
/* Check its results. */
FileAssert.assertEquals(getResource(... | [FOCAL] @Activate protected void InitialRegistrationImpl.activate(Map<String, Object> props)
[CLASS] class InitialRegistrationImpl
[METRICS] loc=30 cc=4 branches=3 loops=0 returns=0 throws=2 nesting=1
[CALLS-INTERNAL] void generateFiles()
[CALLS-EXTERNAL] logger.debug/2, PropertiesUtil.toStringArray/2, Map<String, Obje... | /* static context
[FOCAL] @Activate protected void InitialRegistrationImpl.activate(Map<String, Object> props)
[THROWS-WHEN] ServiceException when this.filterRoots == null
[THROWS-WHEN] ServiceException when !(this.filterRoots == null) && localDirValue == null
[PATH1] if(this.filterRoots == null)=F -> if(localDirValue ... | /* static context
[FOCAL] @Activate protected void InitialRegistrationImpl.activate(Map<String, Object> props)
[THROWS-WHEN] ServiceException when this.filterRoots == null
[THROWS-WHEN] ServiceException when !(this.filterRoots == null) && localDirValue == null
[PATH1] if(this.filterRoots == null)=F -> if(localDirValue ... | true | ok | {"focal": {"class": "InitialRegistrationImpl", "name": "activate", "signature": "void activate(Map<String, Object> props) throws ServiceException", "start_line": 3, "modifiers": "@Activate protected", "params": [{"name": "props", "type": "Map<String, Object>"}], "return_type": "void"}, "class_info": {"name": "InitialRe... |
83186903_1 | class ReflectTool {
public static <T> String tryGetGeneric(T t) {
ParameterizedType pt = null;
Type[] types = t.getClass().getGenericInterfaces();
if (types.length != 0 && types[0] instanceof ParameterizedType) {
pt = (ParameterizedType) types[0];
} else {
Ty... | String cls;
List<String> list = new ArrayList<>();
cls = ReflectTool.tryGetGeneric(list);
assertEquals(cls, null);
Mark<List<String>> mark = new Mark<List<String>>() {
};
cls = ReflectTool.tryGetGeneric(mark);
assertEquals(cls, "java.util.List<java.lang.... | [FOCAL] public static String ReflectTool.tryGetGeneric(T t)
[CLASS] class ReflectTool
[METRICS] loc=27 cc=5 branches=4 loops=0 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] t.getClass().getGenericInterfaces/0, T.getClass/0, t.getClass().getGenericSuperclass/0, ParameterizedType.getActualTypeArguments/0, actual[0].toStr... | /* static context
[FOCAL] public static String ReflectTool.tryGetGeneric(T t)
[PATH1] if(types.length != 0 && types[0] instanceof ParameterizedType)=F -> if(type instanceof ParameterizedType)=T -> if(pt == null)=F -> if(unsafe.contains(","))=T -> return genericString.length() < 4 ? null : genericString
[PATH2] if(types... | /* static context
[FOCAL] public static String ReflectTool.tryGetGeneric(T t)
[PATH1] if(types.length != 0 && types[0] instanceof ParameterizedType)=F -> if(type instanceof ParameterizedType)=T -> if(pt == null)=F -> if(unsafe.contains(","))=T -> return genericString.length() < 4 ? null : genericString
[PATH2] if(types... | true | ok | {"focal": {"class": "ReflectTool", "name": "tryGetGeneric", "signature": "String tryGetGeneric(T t)", "start_line": 3, "modifiers": "public static", "params": [{"name": "t", "type": "T"}], "return_type": "String"}, "class_info": {"name": "ReflectTool", "kind": "class", "modifiers": "", "superclass": null, "interfaces":... |
83256557_8 | class Preconditions {
public static boolean checkWidget(Observer<?> observer, Widget widget) {
if (null == widget) {
observer.onError(new NullPointerException("The given widget was null"));
return false;
} else if (widget.isDisposed()) {
observer.onError(new IllegalStateException("The given widget is dip... | TestObserver<?> testObserver = getEmptySubscribedTestObserver();
AtomicBoolean atomic = new AtomicBoolean(false);
Thread thread = new Thread(() -> {
boolean checkWidget = Preconditions.checkWidget(testObserver, shell);
assertThat(checkWidget, is(false));
testObserver.assertError(IllegalStateException... | [FOCAL] public static boolean Preconditions.checkWidget(Observer<?> observer, Widget widget)
[CLASS] class Preconditions
[METRICS] loc=14 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=3
[CALLS-EXTERNAL] Observer<?>.onError/1, Widget.isDisposed/0, Thread.currentThread().equals/1, Thread.currentThread/0, widget.getD... | /* static context
[FOCAL] public static boolean Preconditions.checkWidget(Observer<?> observer, Widget widget)
[PATH1] if(null == widget)=F -> if(widget.isDisposed())=F -> if(!(Thread.currentThread().equals(widget.getDisplay().getThread())))=T -> return false
[PATH2] if(null == widget)=F -> if(widget.isDisposed())=F ->... | /* static context
[FOCAL] public static boolean Preconditions.checkWidget(Observer<?> observer, Widget widget)
[PATH1] if(null == widget)=F -> if(widget.isDisposed())=F -> if(!(Thread.currentThread().equals(widget.getDisplay().getThread())))=T -> return false
[PATH2] if(null == widget)=F -> if(widget.isDisposed())=F ->... | true | ok | {"focal": {"class": "Preconditions", "name": "checkWidget", "signature": "boolean checkWidget(Observer<?> observer, Widget widget)", "start_line": 3, "modifiers": "public static", "params": [{"name": "observer", "type": "Observer<?>"}, {"name": "widget", "type": "Widget"}], "return_type": "boolean"}, "class_info": {"na... |
83275514_27 | class ConsumerGatewayUtil {
public static String removeResponseTag(String message) {
String responsePrefix = "";
// Regex for reponse tag's namespace prefix
String regex = ".*<(\\w+:)*(\\w+R|r)esponse.*?>.*";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = patter... | String source = "<testServiceResponse xmlns=\"http://test.com/ns\"><ts1:wrapper xmlns:ts1=\"http://test.com/ns2\"><ts1:param1>value1</ts1:param1><ts1:param2>value2</ts1:param2></ts1:wrapper></testServiceResponse>";
String result = "<ts1:wrapper xmlns:ts1=\"http://test.com/ns2\"><ts1:param1>value1</ts1:p... | [FOCAL] public static String ConsumerGatewayUtil.removeResponseTag(String message)
[CLASS] class ConsumerGatewayUtil
[METRICS] loc=26 cc=4 branches=3 loops=0 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] Pattern.compile/1, Pattern.matcher/1, Matcher.find/0, Matcher.group/1, log.debug/2, log.debug/1, String.replaceAll/2... | /* static context
[FOCAL] public static String ConsumerGatewayUtil.removeResponseTag(String message)
[PATH1] if(matcher.find())=T -> if(matcher.group(1) != null)=T -> if(!responsePrefix.isEmpty())=T -> return response
[PATH2] if(matcher.find())=F -> if(!responsePrefix.isEmpty())=F -> return response
[PATH3] if(matcher.... | /* static context
[FOCAL] public static String ConsumerGatewayUtil.removeResponseTag(String message)
[PATH1] if(matcher.find())=T -> if(matcher.group(1) != null)=T -> if(!responsePrefix.isEmpty())=T -> return response
[PATH2] if(matcher.find())=F -> if(!responsePrefix.isEmpty())=F -> return response
[PATH3] if(matcher.... | true | ok | {"focal": {"class": "ConsumerGatewayUtil", "name": "removeResponseTag", "signature": "String removeResponseTag(String message)", "start_line": 3, "modifiers": "public static", "params": [{"name": "message", "type": "String"}], "return_type": "String"}, "class_info": {"name": "ConsumerGatewayUtil", "kind": "class", "mod... |
83414665_11 | class MergeMentionOverlapResolution implements MentionOverlapResolutionRepository {
@Override
public final List<Entity> resolveMentionOverlapping(
final Map<AnnotatorConfig, List<Entity>> documents) {
final List<Entity> finalEntities = new ArrayList<>();
for (final Map.Entry<AnnotatorConfig, List<En... | final AnnotatorConfig config1 = new AnnotatorConfig();
config1.setName("ann1");
config1.setFrom("CoNLL");
final AnnotatorConfig config2 = new AnnotatorConfig();
config2.setName("ann2");
config2.setFrom("CoNLL");
final Entity entity1 = Entity.builder().phrase("United State... | [FOCAL] @Override public final List<Entity> MergeMentionOverlapResolution.resolveMentionOverlapping(Map<AnnotatorConfig, List<Entity>> documents)
[CLASS] class MergeMentionOverlapResolution implements MentionOverlapResolutionRepository
[METRICS] loc=64 cc=11 branches=4 loops=6 returns=1 throws=0 nesting=7
[CALLS-INTERN... | /* static context
[FOCAL] @Override public final List<Entity> MergeMentionOverlapResolution.resolveMentionOverlapping(Map<AnnotatorConfig, List<Entity>> documents)
[PATH1] foreach(Map.Entry<AnnotatorConfig, List<Entity>> document : documents.entrySet())=T -> foreach(Entity old : document.getValue())=T -> if(overlapInde... | /* static context
[FOCAL] @Override public final List<Entity> MergeMentionOverlapResolution.resolveMentionOverlapping(Map<AnnotatorConfig, List<Entity>> documents)
[PATH1] foreach(Map.Entry<AnnotatorConfig, List<Entity>> document : documents.entrySet())=T -> foreach(Entity old : document.getValue())=T -> if(overlapInde... | true | ok | {"focal": {"class": "MergeMentionOverlapResolution", "name": "resolveMentionOverlapping", "signature": "List<Entity> resolveMentionOverlapping(Map<AnnotatorConfig, List<Entity>> documents)", "start_line": 3, "modifiers": "@Override public final", "params": [{"name": "documents", "type": "Map<AnnotatorConfig, List<Entit... |
83457980_12 | class PRNG extends Random {
public float nextFloat(final float origin, final float bound) {
return nextFloat(origin, bound, this);
}
protected PRNG(final long seed);
protected PRNG();
public int nextInt(final int origin, final int bound);
public long nextLong(final long origin, final long bound);
public l... | final float min = 10;
final float max = 100000;
for (int i = 0; i < 1000; ++i) {
final float value = prng.nextFloat(min, max);
Assert.assertTrue(value < max);
Assert.assertTrue(value >= min);
}
}
} | [FOCAL] public float PRNG.nextFloat(float origin, float bound)
[CLASS] class PRNG extends Random
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] float nextFloat(float origin, float bound, Random random)
[INPUTS] branches=- | result=bound, origin
[DATAFLOW] bound@param->L2; origin@p... | /* static context
[FOCAL] public float PRNG.nextFloat(float origin, float bound)
[INPUTS] branches=- | result=bound, origin
[CALLS-INTERNAL] float nextFloat(float origin, float bound, Random random)
*/
| /* static context
[FOCAL] public float PRNG.nextFloat(float origin, float bound)
[INPUTS] branches=- | result=bound, origin
[CALLS-INTERNAL] float nextFloat(float origin, float bound, Random random)
*/
class PRNG extends Random {
public float nextFloat(final float origin, final float bound) {
return nextFloat(origi... | true | ok | {"focal": {"class": "PRNG", "name": "nextFloat", "signature": "float nextFloat(float origin, float bound)", "start_line": 3, "modifiers": "public", "params": [{"name": "origin", "type": "float"}, {"name": "bound", "type": "float"}], "return_type": "float"}, "class_info": {"name": "PRNG", "kind": "class", "modifiers": "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.