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 |
|---|---|---|---|---|---|---|---|---|
38958995_5 | class TreeNode implements Iterable<TreeNode<T>>, Serializable, Cloneable {
public abstract Collection<? extends TreeNode<T>> subtrees()public abstract Collection<? extends TreeNode<T>> subtrees();
public abstract Collection<? extends TreeNode<T>> subtrees()public TreeNode(T data);
public abstract Collection<? extend... | // Test if subtrees are correctly determined
String message = "Subtrees collection was incorrectly determined";
Collection<TreeNode<String>> mSubtreesLevel1 = new HashSet<>(3);
mSubtreesLevel1.add(node1);
mSubtreesLevel1.add(node2);
mSubtreesLevel1.add(node9);
assertEquals(message, mSubtreesLevel1, root.... | [FOCAL] public abstract Collection<? extends TreeNode<T>> TreeNode.subtrees()
[CLASS] class TreeNode implements Iterable<TreeNode<T>>, Serializable, Cloneable
[METRICS] loc=1 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CLASS-MEMBERS] TreeNode(T data); TreeNode(); boolean add(TreeNode<T> subtree); boolean drop... | /* static context
[FOCAL] public abstract Collection<? extends TreeNode<T>> TreeNode.subtrees()
*/
| /* static context
[FOCAL] public abstract Collection<? extends TreeNode<T>> TreeNode.subtrees()
*/
class TreeNode implements Iterable<TreeNode<T>>, Serializable, Cloneable {
public abstract Collection<? extends TreeNode<T>> subtrees()public abstract Collection<? extends TreeNode<T>> subtrees();
public abstract Collec... | true | partial | {"focal": {"class": "TreeNode", "name": "subtrees", "signature": "Collection<? extends TreeNode<T>> subtrees()", "start_line": 3, "modifiers": "public abstract", "params": [], "return_type": "Collection<? extends TreeNode<T>>"}, "class_info": {"name": "TreeNode", "kind": "class", "modifiers": "", "superclass": null, "i... |
39005675_10 | class FloatBag implements AnyBag<FloatBag> {
@Override
public void copyFrom(FloatBag from) {
copyFrom(from, true);
}
public FloatBag();
@Override public void copyFrom(FloatBag from, boolean clearExceeding);
@Override public void copyFrom(FloatBag from, int length);
@Override publ... | // Test copyFrom(bag) and copyFrom(bag, clearExceeding)
FloatBag bag0, bag1;
float e0 = 1f, e1 = 1f, e2 = 1f, e3 = 1f;
bag0 = new FloatBag();
bag0.set(0, e0);
bag0.set(3, e1);
bag0.set(9, e2);
bag1 = new FloatBag();
bag1.copyFrom(bag0);
as... | [FOCAL] @Override public void FloatBag.copyFrom(FloatBag from)
[CLASS] class FloatBag implements AnyBag<FloatBag>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void copyFrom(FloatBag from, boolean clearExceeding)
[DATAFLOW] from@param->L3
[CLASS-MEMBERS] FloatBag(); void copyFrom... | /* static context
[FOCAL] @Override public void FloatBag.copyFrom(FloatBag from)
[CALLS-INTERNAL] void copyFrom(FloatBag from, boolean clearExceeding)
*/
| /* static context
[FOCAL] @Override public void FloatBag.copyFrom(FloatBag from)
[CALLS-INTERNAL] void copyFrom(FloatBag from, boolean clearExceeding)
*/
class FloatBag implements AnyBag<FloatBag> {
@Override
public void copyFrom(FloatBag from) {
copyFrom(from, true);
}
public FloatBag();
... | true | ok | {"focal": {"class": "FloatBag", "name": "copyFrom", "signature": "void copyFrom(FloatBag from)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "from", "type": "FloatBag"}], "return_type": "void"}, "class_info": {"name": "FloatBag", "kind": "class", "modifiers": "", "superclass": null, "interface... |
39006243_14 | class CustomerController {
@RequestMapping(value = "/customers/create", method = RequestMethod.GET)
public String showCreateCustomerFormPage(ModelMap modelMap) {
modelMap.addAttribute("createCustomerForm", new Customer());
logger.info("Accessed Create Customer page");
logger.debug("Retrieved createCustomerForm... | assertEquals("customers/customers-createCustomer", customerController.showCreateCustomerFormPage(new ModelMap()));
}
} | [FOCAL] @RequestMapping(value = "/customers/create", method = RequestMethod.GET) public String CustomerController.showCreateCustomerFormPage(ModelMap modelMap)
[CLASS] class CustomerController
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] ModelMap.addAttribute/2, logger.info/1, l... | /* static context
[FOCAL] @RequestMapping(value = "/customers/create", method = RequestMethod.GET) public String CustomerController.showCreateCustomerFormPage(ModelMap modelMap)
[COLLABORATORS] param modelMap:ModelMap addAttribute/2
[NEW] Customer
[CALLS-EXTERNAL] ModelMap.addAttribute/2, logger.info/1, logger.debug/1
... | /* static context
[FOCAL] @RequestMapping(value = "/customers/create", method = RequestMethod.GET) public String CustomerController.showCreateCustomerFormPage(ModelMap modelMap)
[COLLABORATORS] param modelMap:ModelMap addAttribute/2
[NEW] Customer
[CALLS-EXTERNAL] ModelMap.addAttribute/2, logger.info/1, logger.debug/1
... | true | ok | {"focal": {"class": "CustomerController", "name": "showCreateCustomerFormPage", "signature": "String showCreateCustomerFormPage(ModelMap modelMap)", "start_line": 3, "modifiers": "@RequestMapping(value = \"/customers/create\", method = RequestMethod.GET) public", "params": [{"name": "modelMap", "type": "ModelMap"}], "r... |
39013067_1 | class ScheduleExpression {
public Calendar ceil(Calendar cal) {
if (contains(cal))
return cal;
Calendar cal2 = new GregorianCalendar(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DATE));
if (!containsDayOfWeek(cal2))
do
cal2.add(C... | ScheduleExpression[] schedules = {
ScheduleExpression.valueOf("hour=18-6 dayOfWeek=*"),
ScheduleExpression.valueOf("hour=* dayOfWeek=0,6")
};
assertEquals(new GregorianCalendar(2015, 9, 8, 18, 0), ScheduleExpression.ceil(
new GregorianCalendar(201... | [FOCAL] public Calendar ScheduleExpression.ceil(Calendar cal)
[CLASS] class ScheduleExpression
[METRICS] loc=16 cc=5 branches=2 loops=2 returns=2 throws=0 nesting=2
[CALLS-INTERNAL] boolean contains(Calendar cal); boolean containsDayOfWeek(Calendar cal); boolean containsHour(Calendar cal)
[CALLS-EXTERNAL] Calendar.get/... | /* static context
[FOCAL] public Calendar ScheduleExpression.ceil(Calendar cal)
[PATH1] if(contains(cal))=F -> if(!containsDayOfWeek(cal2))=T -> do_while(!containsDayOfWeek(cal2))=F -> while(!containsHour(cal2))=T -> exit loop -> return cal2
[PATH2] if(contains(cal))=T -> return cal
[PATH3] if(contains(cal))=F -> if(!c... | /* static context
[FOCAL] public Calendar ScheduleExpression.ceil(Calendar cal)
[PATH1] if(contains(cal))=F -> if(!containsDayOfWeek(cal2))=T -> do_while(!containsDayOfWeek(cal2))=F -> while(!containsHour(cal2))=T -> exit loop -> return cal2
[PATH2] if(contains(cal))=T -> return cal
[PATH3] if(contains(cal))=F -> if(!c... | true | ok | {"focal": {"class": "ScheduleExpression", "name": "ceil", "signature": "Calendar ceil(Calendar cal)", "start_line": 3, "modifiers": "public", "params": [{"name": "cal", "type": "Calendar"}], "return_type": "Calendar"}, "class_info": {"name": "ScheduleExpression", "kind": "class", "modifiers": "", "superclass": null, "i... |
39063523_96 | class PhysicalInventoryPresenter extends InventoryPresenter {
public Observable<Object> doInventory(final String sign) {
return Observable.create(subscriber -> {
try {
List<StockMovementItem> newestEachMovementItems = movementRepository.queryEachStockCardNewestMovement();
... | String signature = "signature";
presenter.getInventoryViewModelList().addAll(getStockCardViewModels());
when(stockMovementRepositoryMock.queryEachStockCardNewestMovement()).thenReturn(getInversionDateOrTimeStockMovementItem());
TestSubscriber<Object> subscriber = new TestSubscriber<>();
... | [FOCAL] public Observable<Object> PhysicalInventoryPresenter.doInventory(String sign)
[CLASS] class PhysicalInventoryPresenter extends InventoryPresenter
[METRICS] loc=32 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=3
[CALLS-INTERNAL] StockMovementItem calculateAdjustment(InventoryViewModel model, StockCard stock... | /* static context
[FOCAL] public Observable<Object> PhysicalInventoryPresenter.doInventory(String sign)
[INPUTS] branches=- | result=sign, sharedPreferenceMgr
[COLLABORATORS] field movementRepository queryEachStockCardNewestMovement/0; field stockRepository addStockMovementAndUpdateStockCard/1; field inventoryRepositor... | /* static context
[FOCAL] public Observable<Object> PhysicalInventoryPresenter.doInventory(String sign)
[INPUTS] branches=- | result=sign, sharedPreferenceMgr
[COLLABORATORS] field movementRepository queryEachStockCardNewestMovement/0; field stockRepository addStockMovementAndUpdateStockCard/1; field inventoryRepositor... | true | ok | {"focal": {"class": "PhysicalInventoryPresenter", "name": "doInventory", "signature": "Observable<Object> doInventory(String sign)", "start_line": 3, "modifiers": "public", "params": [{"name": "sign", "type": "String"}], "return_type": "Observable<Object>"}, "class_info": {"name": "PhysicalInventoryPresenter", "kind": ... |
39075884_0 | class GuavaCollectors {
public static <T,R,C,V> Collector<T, ?, Table<R, C, V>> toTable(
Function<? super T, ? extends R> rowMapper,
Function<? super T, ? extends C> columnMapper,
Function<? super T, ? extends V> valueMapper) {
return toTable(rowMapper, columnMapper, val... | Table<String, String, Integer> table = Stream.of(10, 11).collect(
GuavaCollectors.toTable(Object::toString, this::generateColumn, Function.identity()));
Truth.assertThat(table).hasSize(2);
Truth.assertThat(table).containsCell("10", "column", 10);
Truth.assertThat(table).c... | [FOCAL] public static Collector<T, ?, Table<R, C, V>> GuavaCollectors.toTable(Function<? super T, ? extends R> rowMapper, Function<? super T, ? extends C> columnMapper, Function<? super T, ? extends V> valueMapper)
[CLASS] class GuavaCollectors
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS... | /* static context
[FOCAL] public static Collector<T, ?, Table<R, C, V>> GuavaCollectors.toTable(Function<? super T, ? extends R> rowMapper, Function<? super T, ? extends C> columnMapper, Function<? super T, ? extends V> valueMapper)
[INPUTS] branches=- | result=columnMapper, rowMapper, valueMapper
[CALLS-INTERNAL] Bina... | /* static context
[FOCAL] public static Collector<T, ?, Table<R, C, V>> GuavaCollectors.toTable(Function<? super T, ? extends R> rowMapper, Function<? super T, ? extends C> columnMapper, Function<? super T, ? extends V> valueMapper)
[INPUTS] branches=- | result=columnMapper, rowMapper, valueMapper
[CALLS-INTERNAL] Bina... | true | ok | {"focal": {"class": "GuavaCollectors", "name": "toTable", "signature": "Collector<T, ?, Table<R, C, V>> toTable(Function<? super T, ? extends R> rowMapper, Function<? super T, ? extends C> columnMapper, Function<? super T, ? extends V> valueMapper)", "start_line": 3, "modifiers": "public static", "params": [{"name": "r... |
39091281_17 | class RxFirebaseDatabase {
@NonNull
@CheckReturnValue
public static <T> Single<T> dataOf(
@NonNull DatabaseReference ref, @NonNull Class<T> clazz) {
return data(ref).compose(new SingleTransformerOfClazz<>(clazz));
}
private RxFirebaseDatabase();
@NonNull @CheckReturnValue... | TestObserver<String> sub = TestObserver.create();
RxFirebaseDatabase.dataOf(mockDatabaseReference, String.class)
.subscribe(sub);
verifyDataReferenceAddListenerForSingleValueEvent();
callValueEventOnDataChange("Foo");
sub.assertComplete();
sub.assertNoE... | [FOCAL] @NonNull @CheckReturnValue public static Single<T> RxFirebaseDatabase.dataOf(DatabaseReference ref, Class<T> clazz)
[CLASS] class RxFirebaseDatabase
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Single<DataSnapshot> data(Query query)
[CALLS-EXTERNAL] data(ref).compose/1
[... | /* static context
[FOCAL] @NonNull @CheckReturnValue public static Single<T> RxFirebaseDatabase.dataOf(DatabaseReference ref, Class<T> clazz)
[INPUTS] branches=- | result=clazz, ref
[CALLS-INTERNAL] Single<DataSnapshot> data(Query query)
[NEW] SingleTransformerOfClazz<>
[CALLS-EXTERNAL] data(ref).compose/1
*/
| /* static context
[FOCAL] @NonNull @CheckReturnValue public static Single<T> RxFirebaseDatabase.dataOf(DatabaseReference ref, Class<T> clazz)
[INPUTS] branches=- | result=clazz, ref
[CALLS-INTERNAL] Single<DataSnapshot> data(Query query)
[NEW] SingleTransformerOfClazz<>
[CALLS-EXTERNAL] data(ref).compose/1
*/
class RxF... | true | ok | {"focal": {"class": "RxFirebaseDatabase", "name": "dataOf", "signature": "Single<T> dataOf(DatabaseReference ref, Class<T> clazz)", "start_line": 3, "modifiers": "@NonNull @CheckReturnValue public static", "params": [{"name": "ref", "type": "DatabaseReference"}, {"name": "clazz", "type": "Class<T>"}], "return_type": "S... |
39092083_1119 | class ShippingServiceFacadeImpl implements ShippingServiceFacade {
@Override
public PriceModel getCartShippingTotal(final ShoppingCart cart) {
final String currency = cart.getCurrencyCode();
final BigDecimal deliveriesCount = new BigDecimal(cart.getShippingList().size());
final BigDec... |
final ShopService shopService = context.mock(ShopService.class, "shopService");
final ShoppingCart cart = context.mock(ShoppingCart.class, "cart");
final ShoppingContext cartCtx = context.mock(ShoppingContext.class, "cartCtx");
final Total cartTotal = context.mock(Total.class, "cartTot... | [FOCAL] @Override public PriceModel ShippingServiceFacadeImpl.getCartShippingTotal(ShoppingCart cart)
[CLASS] class ShippingServiceFacadeImpl implements ShippingServiceFacade
[METRICS] loc=114 cc=8 branches=6 loops=1 returns=4 throws=0 nesting=4
[CALLS-EXTERNAL] ShoppingCart.getCurrencyCode/0, cart.getShippingList().si... | class ShippingServiceFacadeImpl implements ShippingServiceFacade {
@Override
public PriceModel getCartShippingTotal(final ShoppingCart cart) {
final String currency = cart.getCurrencyCode();
final BigDecimal deliveriesCount = new BigDecimal(cart.getShippingList().size());
final BigDec... | false | ok | {"focal": {"class": "ShippingServiceFacadeImpl", "name": "getCartShippingTotal", "signature": "PriceModel getCartShippingTotal(ShoppingCart cart)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "cart", "type": "ShoppingCart"}], "return_type": "PriceModel"}, "class_info": {"name": "ShippingServic... | |
39158944_4 | class NavigationManagerImpl implements NavigationManager {
@Override
public NavigationPageItem getFooterNavigation() {
Page footerNavRoot = siteRoot.getRelativePage(FOOTERNAV_RELATIVE_PATH);
if (footerNavRoot != null) {
return getFooterNavigationSpecific(footerNavRoot);
}
else {
Page si... |
// delete footer navigation in sample content
Resource footerNavResource = context.resourceResolver().getResource("/content/wcm-io-samples/en/tools/navigation/footernav");
context.resourceResolver().delete(footerNavResource);
NavigationPageItem rootItem = underTest.getFooterNavigation();
List<Navi... | [FOCAL] @Override public NavigationPageItem NavigationManagerImpl.getFooterNavigation()
[CLASS] class NavigationManagerImpl implements NavigationManager
[METRICS] loc=14 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=2
[CALLS-INTERNAL] NavigationPageItem getFooterNavigationDerivedFromMainNav(Page siteRootPage); Nav... | /* static context
[FOCAL] @Override public NavigationPageItem NavigationManagerImpl.getFooterNavigation()
[PATH1] if(footerNavRoot != null)=F -> if(siteRootPage == null)=T -> return getFooterNavigationDerivedFromMainNav(siteRootPage)
[PATH2] if(footerNavRoot != null)=T -> return getFooterNavigationSpecific(footerNavRoo... | /* static context
[FOCAL] @Override public NavigationPageItem NavigationManagerImpl.getFooterNavigation()
[PATH1] if(footerNavRoot != null)=F -> if(siteRootPage == null)=T -> return getFooterNavigationDerivedFromMainNav(siteRootPage)
[PATH2] if(footerNavRoot != null)=T -> return getFooterNavigationSpecific(footerNavRoo... | true | ok | {"focal": {"class": "NavigationManagerImpl", "name": "getFooterNavigation", "signature": "NavigationPageItem getFooterNavigation()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "NavigationPageItem"}, "class_info": {"name": "NavigationManagerImpl", "kind": "class", "modifiers": "", "su... |
39160554_85 | class CSSInclude {
public @Nullable String getInclude() {
return include;
}
@PostConstruct private void activate();
private @NotNull String buildIncludeString(@NotNull List<String> libraryPaths);
}
class CSSIncludeTest {
@Test
void testInvalid() {
| context.request().setAttribute("categories", CATEGORY_INVALID);
CSSInclude underTest = AdaptTo.notNull(context.request(), CSSInclude.class);
assertNull(underTest.getInclude());
}
} | [FOCAL] public @Nullable String CSSInclude.getInclude()
[CLASS] class CSSInclude
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] void activate(); String buildIncludeString(List<String> libraryPaths)
[TEST] CSSIncludeTest: @Test void testInvalid() | /* static context
[FOCAL] public @Nullable String CSSInclude.getInclude()
*/
| /* static context
[FOCAL] public @Nullable String CSSInclude.getInclude()
*/
class CSSInclude {
public @Nullable String getInclude() {
return include;
}
@PostConstruct private void activate();
private @NotNull String buildIncludeString(@NotNull List<String> libraryPaths);
}
class CSSIncludeTest {
@T... | true | ok | {"focal": {"class": "CSSInclude", "name": "getInclude", "signature": "String getInclude()", "start_line": 3, "modifiers": "public @Nullable", "params": [], "return_type": "String"}, "class_info": {"name": "CSSInclude", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{... |
39161492_0 | class GreeterService {
public Greeting greet(String salutation, String name) {
Assert.notNull(salutation, "salutation is required");
Assert.notNull(name, "name is required");
return rest.getForObject(URI_TEMPLATE, Greeting.class, salutation, name);
}
public GreeterService(RestTemplate restTemplate);
@Mock... | given(this.rest.getForObject("//greeter-messages/greeting?salutation={salutation}&name={name}", Greeting.class, "Hello", "Bob"))
.willReturn(new Greeting("Hello Bob"));
assertThat(this.greeter.greet("Hello", "Bob"))
.isNotNull()
.isEqualToComparingFieldByField(new Greeting("Hello Bob"));
}
} | [FOCAL] public Greeting GreeterService.greet(String salutation, String name)
[CLASS] class GreeterService
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Assert.notNull/2, RestTemplate.getForObject/4
[FIELDS] read=rest:RestTemplate
[INPUTS] branches=- | result=name, salutation, res... | /* static context
[FOCAL] public Greeting GreeterService.greet(String salutation, String name)
[INPUTS] branches=- | result=name, salutation, rest
[COLLABORATORS] field rest:RestTemplate getForObject/4
[FIELDS] read=rest:RestTemplate
[CALLS-EXTERNAL] Assert.notNull/2, RestTemplate.getForObject/4
*/
| /* static context
[FOCAL] public Greeting GreeterService.greet(String salutation, String name)
[INPUTS] branches=- | result=name, salutation, rest
[COLLABORATORS] field rest:RestTemplate getForObject/4
[FIELDS] read=rest:RestTemplate
[CALLS-EXTERNAL] Assert.notNull/2, RestTemplate.getForObject/4
*/
class GreeterService... | true | ok | {"focal": {"class": "GreeterService", "name": "greet", "signature": "Greeting greet(String salutation, String name)", "start_line": 3, "modifiers": "public", "params": [{"name": "salutation", "type": "String"}, {"name": "name", "type": "String"}], "return_type": "Greeting"}, "class_info": {"name": "GreeterService", "ki... |
39175817_2 | class DotEnvFileParser extends AbstractEnvVarsProvider {
@NotNull
@Override
protected Map<String, String> getEnvVars(@NotNull Map<String, String> runConfigEnv, @NotNull String path) throws EnvFileErrorException {
Map<String, String> result = new LinkedHashMap<>();
try {
List<St... | Map<String, String> result = parser.getEnvVars(Collections.emptyMap(), getFile("inline-comments.env"));
Assert.assertEquals("foo#bar", result.get("key1"));
Assert.assertEquals("foo", result.get("key2"));
Assert.assertEquals("foo #bar", result.get("key3"));
Assert.assertEquals("fo... | [FOCAL] @NotNull @Override protected Map<String, String> DotEnvFileParser.getEnvVars(Map<String, String> runConfigEnv, String path)
[CLASS] class DotEnvFileParser extends AbstractEnvVarsProvider
[METRICS] loc=22 cc=4 branches=1 loops=1 returns=1 throws=1 nesting=3
[CALLS-INTERNAL] String trim(String value)
[CALLS-EXTER... | /* static context
[FOCAL] @NotNull @Override protected Map<String, String> DotEnvFileParser.getEnvVars(Map<String, String> runConfigEnv, String path)
[THROWS-WHEN] EnvFileErrorException when try-body throws
[PATH1] foreach(String l : lines)=T -> if(!strippedLine.startsWith("#") && strippedLine.contains("="))=T -> exit ... | /* static context
[FOCAL] @NotNull @Override protected Map<String, String> DotEnvFileParser.getEnvVars(Map<String, String> runConfigEnv, String path)
[THROWS-WHEN] EnvFileErrorException when try-body throws
[PATH1] foreach(String l : lines)=T -> if(!strippedLine.startsWith("#") && strippedLine.contains("="))=T -> exit ... | true | ok | {"focal": {"class": "DotEnvFileParser", "name": "getEnvVars", "signature": "Map<String, String> getEnvVars(Map<String, String> runConfigEnv, String path) throws EnvFileErrorException", "start_line": 3, "modifiers": "@NotNull @Override protected", "params": [{"name": "runConfigEnv", "type": "Map<String, String>"}, {"nam... |
39183519_16 | class DrawerBackgroundView {
public void disableBlurredLayers() {
blurBackground.setVisibility(View.GONE);
orginalBackground.setVisibility(View.GONE);
}
public DrawerBackgroundView(DrawerLayoutWithBlurredBackground drawerLayoutWithBlurredBackground);
public synchronized void addBlurr... | //given
drawerBackgroundView.blurBackground.setVisibility(View.VISIBLE);
drawerBackgroundView.orginalBackground.setVisibility(View.VISIBLE);
//when
drawerBackgroundView.disableBlurredLayers();
//then
assertThat(drawerBackgroundView.blurBackground.getVisibility()... | [FOCAL] public void DrawerBackgroundView.disableBlurredLayers()
[CLASS] class DrawerBackgroundView
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] blurBackground.setVisibility/1, orginalBackground.setVisibility/1
[COLLABORATORS] field blurBackground setVisibility/1; field orginalBa... | /* static context
[FOCAL] public void DrawerBackgroundView.disableBlurredLayers()
[COLLABORATORS] field blurBackground setVisibility/1; field orginalBackground setVisibility/1
[CALLS-EXTERNAL] blurBackground.setVisibility/1, orginalBackground.setVisibility/1
*/
| /* static context
[FOCAL] public void DrawerBackgroundView.disableBlurredLayers()
[COLLABORATORS] field blurBackground setVisibility/1; field orginalBackground setVisibility/1
[CALLS-EXTERNAL] blurBackground.setVisibility/1, orginalBackground.setVisibility/1
*/
class DrawerBackgroundView {
public void disableBlurr... | true | ok | {"focal": {"class": "DrawerBackgroundView", "name": "disableBlurredLayers", "signature": "void disableBlurredLayers()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "DrawerBackgroundView", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "... |
39197120_0 | class ProvideAndRegisterDocumentSet extends XdsCommon {
static OMText getBinaryNode(OMElement document) {
Iterator<OMNode> childrenIterator = document.getChildren();
while (childrenIterator.hasNext())
{
OMNode container = childrenIterator.next();
if (container instanceof OMText && StringUtils.isNotBlank((... | String message = IOUtils.toString(ProvideAndRegisterDocumentSetTest.class.getResourceAsStream("/data/submit_document.xml"));
String documentString = IOUtils.toString(ProvideAndRegisterDocumentSetTest.class.getResourceAsStream("/data/referral_summary.xml"));
//replace document and submission set uniqueId variables... | [FOCAL] static OMText ProvideAndRegisterDocumentSet.getBinaryNode(OMElement document)
[CLASS] class ProvideAndRegisterDocumentSet extends XdsCommon
[METRICS] loc=12 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] OMElement.getChildren/0, Iterator<OMNode>.hasNext/0, Iterator<OMNode>.next/0, StringU... | /* static context
[FOCAL] static OMText ProvideAndRegisterDocumentSet.getBinaryNode(OMElement document)
[PATH1] while(childrenIterator.hasNext())=T -> if(container instanceof OMText && StringUtils.isNotBlank(((OMText)container).getText()))=F -> exit loop -> return null
[PATH2] while(childrenIterator.hasNext())=T -> if(... | /* static context
[FOCAL] static OMText ProvideAndRegisterDocumentSet.getBinaryNode(OMElement document)
[PATH1] while(childrenIterator.hasNext())=T -> if(container instanceof OMText && StringUtils.isNotBlank(((OMText)container).getText()))=F -> exit loop -> return null
[PATH2] while(childrenIterator.hasNext())=T -> if(... | true | ok | {"focal": {"class": "ProvideAndRegisterDocumentSet", "name": "getBinaryNode", "signature": "OMText getBinaryNode(OMElement document)", "start_line": 3, "modifiers": "static", "params": [{"name": "document", "type": "OMElement"}], "return_type": "OMText"}, "class_info": {"name": "ProvideAndRegisterDocumentSet", "kind": ... |
39198986_1 | class AgentConfiguration {
public String getArgs(String agentId) {
return arguments.getProperty(agentId);
}
public AgentConfiguration(Set<String> agents, String args);
private String extractPropertyFile(String remaining);
private Properties loadProperties(String propFile);
private St... | String p = createTestProps("port=8577","9999:other.json");
String[] data = new String[] {
p,"port=8577","9999:other.json",
p + ",jmx_exporter{{567:config.json}}","port=8577","567:config.json",
"jmx_exporter{{567:config.json}}," + p,"port=8577","567:config.... | [FOCAL] public String AgentConfiguration.getArgs(String agentId)
[CLASS] class AgentConfiguration
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] arguments.getProperty/1
[INPUTS] branches=- | result=agentId
[COLLABORATORS] field arguments getProperty/1
[DATAFLOW] agentId@param->L2
... | /* static context
[FOCAL] public String AgentConfiguration.getArgs(String agentId)
[INPUTS] branches=- | result=agentId
[COLLABORATORS] field arguments getProperty/1
[CALLS-EXTERNAL] arguments.getProperty/1
*/
| /* static context
[FOCAL] public String AgentConfiguration.getArgs(String agentId)
[INPUTS] branches=- | result=agentId
[COLLABORATORS] field arguments getProperty/1
[CALLS-EXTERNAL] arguments.getProperty/1
*/
class AgentConfiguration {
public String getArgs(String agentId) {
return arguments.getProperty(a... | true | ok | {"focal": {"class": "AgentConfiguration", "name": "getArgs", "signature": "String getArgs(String agentId)", "start_line": 3, "modifiers": "public", "params": [{"name": "agentId", "type": "String"}], "return_type": "String"}, "class_info": {"name": "AgentConfiguration", "kind": "class", "modifiers": "", "superclass": nu... |
39229420_6 | class LongRangeUtils {
public static LongRange getIntersection(final LongRange range1, final LongRange range2) {
if (!range1.overlapsRange(range2)) {
return null;
} else {
// The intersection is the [larger min, smaller max].
final long min1 = range1.getMinimumLong();
final long max1 ... | // [2, 7] intersection [0, 1] = null
final LongRange intersection1 = LongRangeUtils.getIntersection(ORIGINAL, OUTSIDE);
// The result should be null
assertNull(intersection1);
// [2, 7] intersection [2, 3] = [2, 3]
final LongRange intersection2 = LongRangeUtils.getIntersection(ORIGINAL, SAME_ED... | [FOCAL] public static LongRange LongRangeUtils.getIntersection(LongRange range1, LongRange range2)
[CLASS] class LongRangeUtils
[METRICS] loc=13 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] LongRange.overlapsRange/1, LongRange.getMinimumLong/0, LongRange.getMaximumLong/0, Math.max/2, Math.min/2... | /* static context
[FOCAL] public static LongRange LongRangeUtils.getIntersection(LongRange range1, LongRange range2)
[PATH1] if(!range1.overlapsRange(range2))=T -> return null
[PATH2] if(!range1.overlapsRange(range2))=F -> return new LongRange(Math.max(min1, min2), Math.min(max1, max2))
[INPUTS] branches=range1, range2... | /* static context
[FOCAL] public static LongRange LongRangeUtils.getIntersection(LongRange range1, LongRange range2)
[PATH1] if(!range1.overlapsRange(range2))=T -> return null
[PATH2] if(!range1.overlapsRange(range2))=F -> return new LongRange(Math.max(min1, min2), Math.min(max1, max2))
[INPUTS] branches=range1, range2... | true | ok | {"focal": {"class": "LongRangeUtils", "name": "getIntersection", "signature": "LongRange getIntersection(LongRange range1, LongRange range2)", "start_line": 3, "modifiers": "public static", "params": [{"name": "range1", "type": "LongRange"}, {"name": "range2", "type": "LongRange"}], "return_type": "LongRange"}, "class_... |
39244945_2 | class Main {
public static void main(String[] args) {
System.out.println("Hello Subproject2!");
}
private final ByteArrayOutputStream outContent;
}
class MainTest {
private final ByteArrayOutputStream outContent;
@Test
public void testMain() {
| Main.main(new String[]{});
Assert.assertEquals("Hello Subproject2!", outContent.toString().trim());
}
} | [FOCAL] public static void Main.main(String[] args)
[CLASS] class Main
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] System.out.println/1
[INPUTS] branches=- | result=- | unused=args
[TEST] MainTest: @Test public void testMain()
[TEST-FIELDS] ByteArrayOutputStream outContent | /* static context
[FOCAL] public static void Main.main(String[] args)
[INPUTS] branches=- | result=- | unused=args
[CALLS-EXTERNAL] System.out.println/1
*/
| /* static context
[FOCAL] public static void Main.main(String[] args)
[INPUTS] branches=- | result=- | unused=args
[CALLS-EXTERNAL] System.out.println/1
*/
class Main {
public static void main(String[] args) {
System.out.println("Hello Subproject2!");
}
private final ByteArrayOutputStream outConte... | true | ok | {"focal": {"class": "Main", "name": "main", "signature": "void main(String[] args)", "start_line": 3, "modifiers": "public static", "params": [{"name": "args", "type": "String[]"}], "return_type": "void"}, "class_info": {"name": "Main", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields":... |
39255205_0 | class InternalHeaderClickListener implements View.OnClickListener {
@Override
public void onClick(final View view) {
informHeaderListeners();
}
public InternalHeaderClickListener(final int columnIndex, final Set<TableHeaderClickListener> listeners);
private void informHeaderListeners();
... | // given
listeners.add(firstListenerMock);
listeners.add(secondListenerMock);
// when
cut.onClick(null);
// then
Mockito.verify(firstListenerMock, Mockito.times(1)).onHeaderClicked(TEST_ROW_INDEX);
Mockito.verify(secondListenerMock, Mockito.times(1)).onH... | [FOCAL] @Override public void InternalHeaderClickListener.onClick(View view)
[CLASS] class InternalHeaderClickListener implements View.OnClickListener
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void informHeaderListeners()
[INPUTS] branches=- | result=- | unused=view
[CLASS-ME... | /* static context
[FOCAL] @Override public void InternalHeaderClickListener.onClick(View view)
[INPUTS] branches=- | result=- | unused=view
[CALLS-INTERNAL] void informHeaderListeners()
*/
| /* static context
[FOCAL] @Override public void InternalHeaderClickListener.onClick(View view)
[INPUTS] branches=- | result=- | unused=view
[CALLS-INTERNAL] void informHeaderListeners()
*/
class InternalHeaderClickListener implements View.OnClickListener {
@Override
public void onClick(final View view) {
... | true | ok | {"focal": {"class": "InternalHeaderClickListener", "name": "onClick", "signature": "void onClick(View view)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "view", "type": "View"}], "return_type": "void"}, "class_info": {"name": "InternalHeaderClickListener", "kind": "class", "modifiers": "", "s... |
39269291_1 | class PushReportMapper {
public static PushReport mapFromImportSummaryToPushReport(ImportSummary importSummary,
String importSummaryKey) {
PushReport pushReport = new PushReport();
List<PushConflict> conflictList = new ArrayList<>();
if (importSummary.getConflicts() != null) {
... | //given
ImportSummary importSummary = givenAImportSummary(IMPORT_SUMMARY_CONFLICT_RESPONSE);
PushReport pushReport = PushReportMapper.mapFromImportSummaryToPushReport(importSummary,
EVENT_UID_KEY);
//then
assertThat(pushReport.getEventUid().equals(importSummary.g... | [FOCAL] public static PushReport PushReportMapper.mapFromImportSummaryToPushReport(ImportSummary importSummary, String importSummaryKey)
[CLASS] class PushReportMapper
[METRICS] loc=34 cc=7 branches=5 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] ImportSummary.getConflicts/0, List<PushConflict>.add/1, Conflict.... | /* static context
[FOCAL] public static PushReport PushReportMapper.mapFromImportSummaryToPushReport(ImportSummary importSummary, String importSummaryKey)
[PATH1] if(importSummary.getConflicts() != null)=T -> foreach(Conflict conflict : importSummary.getConflicts())=T -> exit loop -> if(importCount!=null)=T -> if(impor... | /* static context
[FOCAL] public static PushReport PushReportMapper.mapFromImportSummaryToPushReport(ImportSummary importSummary, String importSummaryKey)
[PATH1] if(importSummary.getConflicts() != null)=T -> foreach(Conflict conflict : importSummary.getConflicts())=T -> exit loop -> if(importCount!=null)=T -> if(impor... | true | ok | {"focal": {"class": "PushReportMapper", "name": "mapFromImportSummaryToPushReport", "signature": "PushReport mapFromImportSummaryToPushReport(ImportSummary importSummary, String importSummaryKey)", "start_line": 3, "modifiers": "public static", "params": [{"name": "importSummary", "type": "ImportSummary"}, {"name": "im... |
39285768_16 | class TableExtRetriever extends AbstractRetriever {
void retrieveViewTableUsage() throws SQLException {
final InformationSchemaViews informationSchemaViews =
getRetrieverConnection().getInformationSchemaViews();
if (!informationSchemaViews.hasQuery(VIEW_TABLE_USAGE)) {
LOGGER.log(
Le... |
int viewCount;
final Collection<Table> tables = catalog.getTables();
viewCount = 0;
assertThat(tables, hasSize(19));
for (final Table table : tables) {
if (!(table instanceof View)) {
continue;
}
viewCount = viewCount + 1;
final View view = (View) table;
assert... | [FOCAL] void TableExtRetriever.retrieveViewTableUsage()
[CLASS] class TableExtRetriever extends AbstractRetriever
[METRICS] loc=58 cc=6 branches=3 loops=1 returns=1 throws=0 nesting=3
[CALLS-EXTERNAL] getRetrieverConnection().getInformationSchemaViews/0, getRetrieverConnection/0 (inherited), InformationSchemaViews.hasQ... | /* static context
[FOCAL] void TableExtRetriever.retrieveViewTableUsage()
[PATH1] if(!informationSchemaViews.hasQuery(VIEW_TABLE_USAGE))=F -> while(results.next())=T -> if(!viewOptional.isPresent())=F -> if(!tableOptional.isPresent())=T -> exit loop
[PATH2] if(!informationSchemaViews.hasQuery(VIEW_TABLE_USAGE))=T -> re... | /* static context
[FOCAL] void TableExtRetriever.retrieveViewTableUsage()
[PATH1] if(!informationSchemaViews.hasQuery(VIEW_TABLE_USAGE))=F -> while(results.next())=T -> if(!viewOptional.isPresent())=F -> if(!tableOptional.isPresent())=T -> exit loop
[PATH2] if(!informationSchemaViews.hasQuery(VIEW_TABLE_USAGE))=T -> re... | true | ok | {"focal": {"class": "TableExtRetriever", "name": "retrieveViewTableUsage", "signature": "void retrieveViewTableUsage() throws SQLException", "start_line": 3, "modifiers": "", "params": [], "return_type": "void"}, "class_info": {"name": "TableExtRetriever", "kind": "class", "modifiers": "", "superclass": "AbstractRetrie... |
39314095_2 | class FileManager {
public Path calculatePathForNode(SimpleNode node, List<SimpleNode> simpleNodes) {
List<SimpleNode> parents = findParentsForNode(node, simpleNodes);
String path = "";
for (SimpleNode p : parents) {
String label = p.getLabel();
label = label.replace... | //arrange
SimpleNode toFind = FileManagerCreators.createValidSimpleNode("asdf", "myfile.java", "0");
List<SimpleNode> arrayOfNodes = FileManagerCreators.createSimpleListOfNodes(toFind);
//act
Path path = sut.calculatePathForNode(toFind, arrayOfNodes);
//assert
a... | [FOCAL] public Path FileManager.calculatePathForNode(SimpleNode node, List<SimpleNode> simpleNodes)
[CLASS] class FileManager
[METRICS] loc=15 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] List<SimpleNode> findParentsForNode(SimpleNode node, List<SimpleNode> simpleNodes)
[CALLS-EXTERNAL] SimpleN... | /* static context
[FOCAL] public Path FileManager.calculatePathForNode(SimpleNode node, List<SimpleNode> simpleNodes)
[PATH1] foreach(SimpleNode p : parents)=T -> if(p.getType() == FOLDER)=T -> exit loop -> return Paths.get(path, label)
[PATH2] foreach(SimpleNode p : parents)=F -> return Paths.get(path, label)
[PATH3] ... | /* static context
[FOCAL] public Path FileManager.calculatePathForNode(SimpleNode node, List<SimpleNode> simpleNodes)
[PATH1] foreach(SimpleNode p : parents)=T -> if(p.getType() == FOLDER)=T -> exit loop -> return Paths.get(path, label)
[PATH2] foreach(SimpleNode p : parents)=F -> return Paths.get(path, label)
[PATH3] ... | true | ok | {"focal": {"class": "FileManager", "name": "calculatePathForNode", "signature": "Path calculatePathForNode(SimpleNode node, List<SimpleNode> simpleNodes)", "start_line": 3, "modifiers": "public", "params": [{"name": "node", "type": "SimpleNode"}, {"name": "simpleNodes", "type": "List<SimpleNode>"}], "return_type": "Pat... |
39342898_17 | class Group {
public void clearGroup(K groupKey) {
Array<T> list = map.get(groupKey);
if (list != null) {
list.clear();
}
}
public void addToGroup(K groupKey, T object);
public Array<T> getAll();
public Array<K> getGroupKeys();
public void remove(T object);
public void ... | Group<String, String> group = new Group<String, String>();
group.addToGroup("a", "b");
group.addToGroup("a", "c");
group.addToGroup("b", "b");
group.clearGroup("a");
assertThat(group.getGroup("a")).isEmpty();
assertThat(group.getGroup("b")).containsExactly("b");
}
} | [FOCAL] public void Group.clearGroup(K groupKey)
[CLASS] class Group
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] map.get/1, Array<T>.clear/0
[PATH1] if(list != null)=T
[PATH2] if(list != null)=F
[INPUTS] branches=groupKey | result=-
[COLLABORATORS] field map get/1
[DATAFLOW] gr... | /* static context
[FOCAL] public void Group.clearGroup(K groupKey)
[PATH1] if(list != null)=T
[PATH2] if(list != null)=F
[INPUTS] branches=groupKey | result=-
[COLLABORATORS] field map get/1
[CALLS-EXTERNAL] map.get/1, Array<T>.clear/0
*/
| /* static context
[FOCAL] public void Group.clearGroup(K groupKey)
[PATH1] if(list != null)=T
[PATH2] if(list != null)=F
[INPUTS] branches=groupKey | result=-
[COLLABORATORS] field map get/1
[CALLS-EXTERNAL] map.get/1, Array<T>.clear/0
*/
class Group {
public void clearGroup(K groupKey) {
Array<T> list = map.... | true | ok | {"focal": {"class": "Group", "name": "clearGroup", "signature": "void clearGroup(K groupKey)", "start_line": 3, "modifiers": "public", "params": [{"name": "groupKey", "type": "K"}], "return_type": "void"}, "class_info": {"name": "Group", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields"... |
39376231_5 | class DateHelper {
public static Date getTime(Date datetime) {
Date time = new Date(0);
time.setHours(datetime.getHours());
time.setMinutes(datetime.getMinutes());
time.setSeconds(datetime.getSeconds());
return time;
}
private DateHelper();
public static Strin... | Calendar cal = Calendar.getInstance();
cal.set(2015, Calendar.FEBRUARY, 23, 15, 0, 0);
Date time = DateHelper.getTime(cal.getTime());
assertTrue(DateHelper.isOnlyTime(time));
}
} | [FOCAL] public static Date DateHelper.getTime(Date datetime)
[CLASS] class DateHelper
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Date.setHours/1, Date.getHours/0, Date.setMinutes/1, Date.getMinutes/0, Date.setSeconds/1, Date.getSeconds/0
[NEW] Date
[COLLABORATORS] param dateti... | /* static context
[FOCAL] public static Date DateHelper.getTime(Date datetime)
[COLLABORATORS] param datetime:Date getHours/0,getMinutes/0,getSeconds/0
[NEW] Date
[CALLS-EXTERNAL] Date.setHours/1, Date.getHours/0, Date.setMinutes/1, Date.getMinutes/0, Date.setSeconds/1, Date.getSeconds/0
*/
| /* static context
[FOCAL] public static Date DateHelper.getTime(Date datetime)
[COLLABORATORS] param datetime:Date getHours/0,getMinutes/0,getSeconds/0
[NEW] Date
[CALLS-EXTERNAL] Date.setHours/1, Date.getHours/0, Date.setMinutes/1, Date.getMinutes/0, Date.setSeconds/1, Date.getSeconds/0
*/
class DateHelper {
publ... | true | ok | {"focal": {"class": "DateHelper", "name": "getTime", "signature": "Date getTime(Date datetime)", "start_line": 3, "modifiers": "public static", "params": [{"name": "datetime", "type": "Date"}], "return_type": "Date"}, "class_info": {"name": "DateHelper", "kind": "class", "modifiers": "", "superclass": null, "interfaces... |
39392321_43 | class ExprSimplifier {
@SuppressWarnings("unchecked")
public static <T extends Type> Expr<T> simplify(final Expr<T> expr, final Valuation valuation) {
return (Expr<T>) TABLE.dispatch(expr, valuation);
}
private ExprSimplifier();
private static Expr<?> simplifyRef(final RefExpr<?> expr, final Valuation val);
... | assertEquals(
Bv(new boolean[] {false, false, false, true}),
simplify(BvExprs.SMod(
Bv(new boolean[] {false, true, false, false}),
Bv(new boolean[] {false, false, true, true})
))
);
assertEquals(
Bv(new boolean[] {false, false, false, false}),
simplify(BvExprs.SMod(e, e))
);
}
} | [FOCAL] @SuppressWarnings("unchecked") public static Expr<T> ExprSimplifier.simplify(Expr<T> expr, Valuation valuation)
[CLASS] class ExprSimplifier
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] TABLE.dispatch/2
[INPUTS] branches=- | result=expr, valuation
[DATAFLOW] expr@param->... | class ExprSimplifier {
@SuppressWarnings("unchecked")
public static <T extends Type> Expr<T> simplify(final Expr<T> expr, final Valuation valuation) {
return (Expr<T>) TABLE.dispatch(expr, valuation);
}
private ExprSimplifier();
private static Expr<?> simplifyRef(final RefExpr<?> expr, final Valuation val);
... | false | ok | {"focal": {"class": "ExprSimplifier", "name": "simplify", "signature": "Expr<T> simplify(Expr<T> expr, Valuation valuation)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public static", "params": [{"name": "expr", "type": "Expr<T>"}, {"name": "valuation", "type": "Valuation"}], "return_type": "Expr<... | |
39411151_22 | class OutlineImpl implements Outline<T> {
@Override
public Collection<String> propertyNames() {
return getProperties().keySet();
}
public OutlineImpl(T members, boolean camelCased);
private static String capitalize(String string);
private static Method findMethod(Class<?> start, Stri... | assertThat(OutlineBuilder.DEFAULT.defaultCamelCased().build(TestBeanClass.class).propertyNames(),
hasItems("readWriteProperty", "readOnlyProperty", "booleanProperty"));
assertEquals(0, actualBeanMethodInvocations);
}
} | [FOCAL] @Override public Collection<String> OutlineImpl.propertyNames()
[CLASS] class OutlineImpl implements Outline<T>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Map<String, Property> getProperties()
[CALLS-EXTERNAL] getProperties().keySet/0
[CLASS-MEMBERS] OutlineImpl(T memb... | /* static context
[FOCAL] @Override public Collection<String> OutlineImpl.propertyNames()
[CALLS-INTERNAL] Map<String, Property> getProperties()
[CALLS-EXTERNAL] getProperties().keySet/0
*/
| /* static context
[FOCAL] @Override public Collection<String> OutlineImpl.propertyNames()
[CALLS-INTERNAL] Map<String, Property> getProperties()
[CALLS-EXTERNAL] getProperties().keySet/0
*/
class OutlineImpl implements Outline<T> {
@Override
public Collection<String> propertyNames() {
return getPropert... | true | ok | {"focal": {"class": "OutlineImpl", "name": "propertyNames", "signature": "Collection<String> propertyNames()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Collection<String>"}, "class_info": {"name": "OutlineImpl", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "... |
39412278_6 | class Id {
public static String build(String id, String... additionalIds) {
return build(id, '-', additionalIds);
}
private Id();
public static String unique();
public static String unique(String id, String... additionalIds);
static String build(String id, char separator, String... a... | // must result in the same ID
String id1 = Id.build("foo_bar");
String id2 = Id.build("foo-bar");
String id3 = Id.build("foo bar");
assertEquals(id1, id2);
assertEquals(id1, id3);
assertEquals(id2, id3);
// must result in the same ID
String id4 = ... | [FOCAL] public static String Id.build(String id, String... additionalIds)
[CLASS] class Id
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String build(String id, char separator, String... additionalIds)
[INPUTS] branches=- | result=additionalIds, id
[DATAFLOW] additionalIds@param-... | /* static context
[FOCAL] public static String Id.build(String id, String... additionalIds)
[INPUTS] branches=- | result=additionalIds, id
[CALLS-INTERNAL] String build(String id, char separator, String... additionalIds)
*/
| /* static context
[FOCAL] public static String Id.build(String id, String... additionalIds)
[INPUTS] branches=- | result=additionalIds, id
[CALLS-INTERNAL] String build(String id, char separator, String... additionalIds)
*/
class Id {
public static String build(String id, String... additionalIds) {
return ... | true | ok | {"focal": {"class": "Id", "name": "build", "signature": "String build(String id, String... additionalIds)", "start_line": 3, "modifiers": "public static", "params": [{"name": "id", "type": "String"}, {"name": "additionalIds", "type": "String..."}], "return_type": "String"}, "class_info": {"name": "Id", "kind": "class",... |
39427174_36 | class BCQuery {
public void queryRefundStatusAsync(final BCReqParams.BCChannelTypes channel, final String refundNum,
final BCCallback callback) {
if (callback == null) {
Log.w(TAG, "请初始化callback");
return;
}
BCCache.executorSer... | BeeCloud.setSandbox(true);
query.queryRefundStatusAsync(BCReqParams.BCChannelTypes.WX,
"refundnum",
new BCCallback() {
@Override
public void done(BCResult result) {
Assert.assertTrue(result instanceof BCRefu... | [FOCAL] public void BCQuery.queryRefundStatusAsync(BCReqParams.BCChannelTypes channel, String refundNum, BCCallback callback)
[CLASS] class BCQuery
[METRICS] loc=69 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] Log.w/2, BCCache.executorService.execute/1, BCCache.getInstance/0, BCCallback.done/1,... | /* static context
[FOCAL] public void BCQuery.queryRefundStatusAsync(BCReqParams.BCChannelTypes channel, String refundNum, BCCallback callback)
[PATH1] if(callback == null)=T -> return
[PATH2] if(callback == null)=F
[INPUTS] branches=callback | result=-
[NEW] Runnable, BCRefundStatus, BCQueryReqParams
*/
| /* static context
[FOCAL] public void BCQuery.queryRefundStatusAsync(BCReqParams.BCChannelTypes channel, String refundNum, BCCallback callback)
[PATH1] if(callback == null)=T -> return
[PATH2] if(callback == null)=F
[INPUTS] branches=callback | result=-
[NEW] Runnable, BCRefundStatus, BCQueryReqParams
*/
class BCQuery ... | true | ok | {"focal": {"class": "BCQuery", "name": "queryRefundStatusAsync", "signature": "void queryRefundStatusAsync(BCReqParams.BCChannelTypes channel, String refundNum, BCCallback callback)", "start_line": 3, "modifiers": "public", "params": [{"name": "channel", "type": "BCReqParams.BCChannelTypes"}, {"name": "refundNum", "typ... |
39477878_2 | class Escaping {
public static String escapeHtml(String input) {
// Avoid building a new string in the majority of cases (nothing to escape)
StringBuilder sb = null;
loop:
for (int i = 0; i < input.length(); i++) {
char c = input.charAt(i);
String replacemen... | assertEquals("nothing to escape", Escaping.escapeHtml("nothing to escape"));
assertEquals("&", Escaping.escapeHtml("&"));
assertEquals("<", Escaping.escapeHtml("<"));
assertEquals(">", Escaping.escapeHtml(">"));
assertEquals(""", Escaping.escapeHtml("\""));
... | [FOCAL] public static String Escaping.escapeHtml(String input)
[CLASS] class Escaping
[METRICS] loc=36 cc=8 branches=3 loops=1 returns=1 throws=0 nesting=3
[CALLS-EXTERNAL] String.length/0, String.charAt/1, StringBuilder.append/1, StringBuilder.append/3, StringBuilder.toString/0
[NEW] StringBuilder
[PATH1] for(i < inpu... | /* static context
[FOCAL] public static String Escaping.escapeHtml(String input)
[PATH1] for(i < input.length())=T -> switch(c)=case '&' -> if(sb == null)=T -> exit loop -> return sb != null ? sb.toString() : input
[PATH2] for(i < input.length())=T -> switch(c)=case '<' -> if(sb == null)=F -> exit loop -> return sb != ... | /* static context
[FOCAL] public static String Escaping.escapeHtml(String input)
[PATH1] for(i < input.length())=T -> switch(c)=case '&' -> if(sb == null)=T -> exit loop -> return sb != null ? sb.toString() : input
[PATH2] for(i < input.length())=T -> switch(c)=case '<' -> if(sb == null)=F -> exit loop -> return sb != ... | true | ok | {"focal": {"class": "Escaping", "name": "escapeHtml", "signature": "String escapeHtml(String input)", "start_line": 3, "modifiers": "public static", "params": [{"name": "input", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Escaping", "kind": "class", "modifiers": "", "superclass": null, "interf... |
39513536_41 | class ConBox {
public static Constraint complexMembers()
{
return new PathConstraint("Complex/component*");
}
public static Constraint erToPE();
public static Constraint peToER();
public static Constraint peToControl();
public static Constraint peToControlledConv();
public static Constraint peToControlledIn... | Pattern p = new Pattern(Complex.class, "Complex");
p.add(ConBox.complexMembers(), "Complex", "member");
Blacklist blacklist = new Blacklist();
blacklist.addEntry("http://pid.nci.nih.gov/biopaxpid_679", 0, null); // GDP ER ID
p.add(new NonUbique(blacklist), "member"); // not GDP
List<Match> list = Searcher.... | [FOCAL] public static Constraint ConBox.complexMembers()
[CLASS] class ConBox
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] PathConstraint
[CLASS-MEMBERS] Constraint erToPE(); Constraint peToER(); Constraint peToControl(); Constraint peToControlledConv(); Constraint peToControlledInter(); C... | /* static context
[FOCAL] public static Constraint ConBox.complexMembers()
[NEW] PathConstraint
*/
| /* static context
[FOCAL] public static Constraint ConBox.complexMembers()
[NEW] PathConstraint
*/
class ConBox {
public static Constraint complexMembers()
{
return new PathConstraint("Complex/component*");
}
public static Constraint erToPE();
public static Constraint peToER();
public static Constraint peToCo... | true | ok | {"focal": {"class": "ConBox", "name": "complexMembers", "signature": "Constraint complexMembers()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Constraint"}, "class_info": {"name": "ConBox", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members... |
39525650_3 | class ApplicationPath {
public static String get(Bundle bundle) {
return bundle.getHeaders().get(HEADER_APPLICATON_PATH);
}
private ApplicationPath();
public static String get(BundleContext bundleContext);
public static String get(ComponentContext componentContext);
private static final String TEST... | assertEquals(TEST_PATH, ApplicationPath.get(componentContext));
}
} | [FOCAL] public static String ApplicationPath.get(Bundle bundle)
[CLASS] class ApplicationPath
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] bundle.getHeaders().get/1, Bundle.getHeaders/0
[INPUTS] branches=- | result=bundle
[COLLABORATORS] param bundle:Bundle getHeaders/0
[DATAFLO... | /* static context
[FOCAL] public static String ApplicationPath.get(Bundle bundle)
[INPUTS] branches=- | result=bundle
[COLLABORATORS] param bundle:Bundle getHeaders/0
[CALLS-EXTERNAL] bundle.getHeaders().get/1, Bundle.getHeaders/0
*/
| /* static context
[FOCAL] public static String ApplicationPath.get(Bundle bundle)
[INPUTS] branches=- | result=bundle
[COLLABORATORS] param bundle:Bundle getHeaders/0
[CALLS-EXTERNAL] bundle.getHeaders().get/1, Bundle.getHeaders/0
*/
class ApplicationPath {
public static String get(Bundle bundle) {
return bundle... | true | ok | {"focal": {"class": "ApplicationPath", "name": "get", "signature": "String get(Bundle bundle)", "start_line": 3, "modifiers": "public static", "params": [{"name": "bundle", "type": "Bundle"}], "return_type": "String"}, "class_info": {"name": "ApplicationPath", "kind": "class", "modifiers": "", "superclass": null, "inte... |
39526634_1 | class RenderUtil {
public static EBarElementFilled[] calculateBarFill(final int numberOfParts, final float percentFilled) {
if (numberOfParts < 1) {
return null;
}
final EBarElementFilled[] fills = new EBarElementFilled[numberOfParts];
// how much should be in a part for it to be considered full?
final f... | final int length = 2;
final EBarElementFilled[] calculateBarFill0Percent = RenderUtil.calculateBarFill(length,
RenderUtil.PERCENT_0);
assertNotNull("excpected to get an array of float", calculateBarFill0Percent);
assertEquals("double bar filled - checking size of array", length, calculateBarFill0Percent.le... | [FOCAL] public static EBarElementFilled[] RenderUtil.calculateBarFill(int numberOfParts, float percentFilled)
[CLASS] class RenderUtil
[METRICS] loc=26 cc=6 branches=4 loops=1 returns=2 throws=0 nesting=4
[CALLS-INTERNAL] EBarElementFilled getSingleFill(float percentFilled)
[PATH1] if(numberOfParts < 1)=F -> for(i < nu... | /* static context
[FOCAL] public static EBarElementFilled[] RenderUtil.calculateBarFill(int numberOfParts, float percentFilled)
[PATH1] if(numberOfParts < 1)=F -> for(i < numberOfParts)=T -> if(notDivided <= PERCENT_0)=F -> if(notDivided >= filled100PercentPerPart)=F -> if(chunk <= 0)=T -> exit loop -> return fills
[PA... | /* static context
[FOCAL] public static EBarElementFilled[] RenderUtil.calculateBarFill(int numberOfParts, float percentFilled)
[PATH1] if(numberOfParts < 1)=F -> for(i < numberOfParts)=T -> if(notDivided <= PERCENT_0)=F -> if(notDivided >= filled100PercentPerPart)=F -> if(chunk <= 0)=T -> exit loop -> return fills
[PA... | true | ok | {"focal": {"class": "RenderUtil", "name": "calculateBarFill", "signature": "EBarElementFilled[] calculateBarFill(int numberOfParts, float percentFilled)", "start_line": 3, "modifiers": "public static", "params": [{"name": "numberOfParts", "type": "int"}, {"name": "percentFilled", "type": "float"}], "return_type": "EBar... |
39570183_1 | class JvmOptionsUtils {
public static String extractDirectory(String jvmOptions) {
if (jvmOptions == null || jvmOptions.trim().length() == 0) { return null; }
if (jvmOptions.indexOf(CLOUDUNIT_SHARED_DIR) == -1) { return null; }
// we get cloudunit.shared=...
String subStringFromStar... | String dir = JvmOptionsUtils.extractDirectory("-Dkey=value -Dcloudunit.shared=tartapion");
Assert.assertEquals("tartapion", dir);
dir = JvmOptionsUtils.extractDirectory("-Dkey=value -Dcloudunit.shared=tartapion -Dkey2=value2");
Assert.assertEquals("tartapion", dir);
}
} | [FOCAL] public static String JvmOptionsUtils.extractDirectory(String jvmOptions)
[CLASS] class JvmOptionsUtils
[METRICS] loc=13 cc=6 branches=5 loops=0 returns=3 throws=0 nesting=1
[CALLS-EXTERNAL] jvmOptions.trim().length/0, String.trim/0, String.indexOf/1, String.substring/1, String.substring/2, String.length/0
[PATH... | /* static context
[FOCAL] public static String JvmOptionsUtils.extractDirectory(String jvmOptions)
[PATH1] if(jvmOptions == null || jvmOptions.trim().length() == 0)=F -> if(jvmOptions.indexOf(CLOUDUNIT_SHARED_DIR) == -1)=F -> if(subStringFromStart.indexOf("-D") != -1)=T -> if(finalValue != null)=T -> if(finalValue != n... | /* static context
[FOCAL] public static String JvmOptionsUtils.extractDirectory(String jvmOptions)
[PATH1] if(jvmOptions == null || jvmOptions.trim().length() == 0)=F -> if(jvmOptions.indexOf(CLOUDUNIT_SHARED_DIR) == -1)=F -> if(subStringFromStart.indexOf("-D") != -1)=T -> if(finalValue != null)=T -> if(finalValue != n... | true | ok | {"focal": {"class": "JvmOptionsUtils", "name": "extractDirectory", "signature": "String extractDirectory(String jvmOptions)", "start_line": 3, "modifiers": "public static", "params": [{"name": "jvmOptions", "type": "String"}], "return_type": "String"}, "class_info": {"name": "JvmOptionsUtils", "kind": "class", "modifie... |
39583456_2 | class TravelAgent {
String getBackupGuide() {
return "None available! Your backup guide is: Cookie";
}
public TravelAgent(RestTemplate rest);
@HystrixCommand(fallbackMethod = "getBackupGuide") public String getGuide();
@Mock
private RestTemplate restTemplate;
private TravelAgent travelAgent;
}
class Tra... | String guide = this.travelAgent.getBackupGuide();
assertThat(guide).isEqualTo("None available! Your backup guide is: Cookie");
}
} | [FOCAL] String TravelAgent.getBackupGuide()
[CLASS] class TravelAgent
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] TravelAgent(RestTemplate rest); String getGuide()
[TEST] TravelAgentTest: @Test public void getBackupGuide()
[TEST-FIELDS] RestTemplate restTemplate, TravelAgent tra... | /* static context
[FOCAL] String TravelAgent.getBackupGuide()
*/
| /* static context
[FOCAL] String TravelAgent.getBackupGuide()
*/
class TravelAgent {
String getBackupGuide() {
return "None available! Your backup guide is: Cookie";
}
public TravelAgent(RestTemplate rest);
@HystrixCommand(fallbackMethod = "getBackupGuide") public String getGuide();
@Mock
private RestTempl... | true | ok | {"focal": {"class": "TravelAgent", "name": "getBackupGuide", "signature": "String getBackupGuide()", "start_line": 3, "modifiers": "", "params": [], "return_type": "String"}, "class_info": {"name": "TravelAgent", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "restTemplate... |
39676740_41 | class SvgConverter {
public List<SvgPath> parseQRCodeMatrix(QRCode qrcode) {
Objects.requireNonNull(qrcode);
List<SvgPath> paths = Lists.newArrayList();
//We read line by line
for (int y = 0; y < qrcode.getMatrix().getHeight(); y++) {
//We read the point from the left ... | QRCode qrCode = new QRCode();
qrCode.setMatrix(new ByteMatrix(4, 2));
assertThat(svgConverter.parseQRCodeMatrix(qrCode)).isEmpty();
}
} | [FOCAL] public List<SvgPath> SvgConverter.parseQRCodeMatrix(QRCode qrcode)
[CLASS] class SvgConverter
[METRICS] loc=34 cc=8 branches=4 loops=3 returns=1 throws=0 nesting=6
[CALLS-EXTERNAL] Objects.requireNonNull/1, Lists.newArrayList/0, qrcode.getMatrix().getHeight/0, QRCode.getMatrix/0, qrcode.getMatrix().getWidth/0, ... | /* static context
[FOCAL] public List<SvgPath> SvgConverter.parseQRCodeMatrix(QRCode qrcode)
[PATH1] for(y < qrcode.getMatrix().getHeight())=T -> for(x < qrcode.getMatrix().getWidth())#1=T -> if(qrcode.getMatrix().get(x, y)==1)=T -> if(x + 1 == qrcode.getMatrix().getWidth())#1=T -> for(x < qrcode.getMatrix().getWidth()... | /* static context
[FOCAL] public List<SvgPath> SvgConverter.parseQRCodeMatrix(QRCode qrcode)
[PATH1] for(y < qrcode.getMatrix().getHeight())=T -> for(x < qrcode.getMatrix().getWidth())#1=T -> if(qrcode.getMatrix().get(x, y)==1)=T -> if(x + 1 == qrcode.getMatrix().getWidth())#1=T -> for(x < qrcode.getMatrix().getWidth()... | true | ok | {"focal": {"class": "SvgConverter", "name": "parseQRCodeMatrix", "signature": "List<SvgPath> parseQRCodeMatrix(QRCode qrcode)", "start_line": 3, "modifiers": "public", "params": [{"name": "qrcode", "type": "QRCode"}], "return_type": "List<SvgPath>"}, "class_info": {"name": "SvgConverter", "kind": "class", "modifiers": ... |
39683376_0 | class UserService {
@Scheduled(cron = "0 0 0 * * ?")
public void removeOldPersistentTokens() {
LocalDate now = new LocalDate();
persistentTokenRepository.findByTokenDateBefore(now.minusMonths(1)).stream().forEach(token ->{
log.debug("Deleting token {}", token.getSeries());
... | User admin = userRepository.findOneByLogin("admin").get();
int existingCount = persistentTokenRepository.findByUser(admin).size();
generateUserToken(admin, "1111-1111", new LocalDate());
LocalDate now = new LocalDate();
generateUserToken(admin, "2222-2222", now.minusDays(32));
... | [FOCAL] @Scheduled(cron = "0 0 0 * * ?") public void UserService.removeOldPersistentTokens()
[CLASS] class UserService
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] persistentTokenRepository.findByTokenDateBefore(now.minus....forEach/1, persistentTokenRepository.findByTokenDateB... | /* static context
[FOCAL] @Scheduled(cron = "0 0 0 * * ?") public void UserService.removeOldPersistentTokens()
[COLLABORATORS] field persistentTokenRepository:PersistentTokenRepository findByTokenDateBefore/1,delete/1; field token getSeries/0,getUser/0
[FIELDS] read=persistentTokenRepository:PersistentTokenRepository
[... | /* static context
[FOCAL] @Scheduled(cron = "0 0 0 * * ?") public void UserService.removeOldPersistentTokens()
[COLLABORATORS] field persistentTokenRepository:PersistentTokenRepository findByTokenDateBefore/1,delete/1; field token getSeries/0,getUser/0
[FIELDS] read=persistentTokenRepository:PersistentTokenRepository
[... | true | ok | {"focal": {"class": "UserService", "name": "removeOldPersistentTokens", "signature": "void removeOldPersistentTokens()", "start_line": 3, "modifiers": "@Scheduled(cron = \"0 0 0 * * ?\") public", "params": [], "return_type": "void"}, "class_info": {"name": "UserService", "kind": "class", "modifiers": "", "superclass": ... |
39694047_5 | class GithubClient {
@Cacheable("github.commits")
public List<Commit> getRecentCommits(String organization, String project) {
ResponseEntity<Commit[]> response = doGetRecentCommit(organization, project);
return Arrays.asList(response.getBody());
}
public GithubClient(CounterService counterService, RestTempla... | expectJson("https://api.github.com/repos/spring-projects/spring-boot/commits",
"github/no-commit.json");
List<Commit> latestCommit = this.githubClient.getRecentCommits("spring-projects", "spring-boot");
assertThat(latestCommit).hasSize(0);
verify(this.counterService, times(1)).increment("cfp.github.requests... | [FOCAL] @Cacheable("github.commits") public List<Commit> GithubClient.getRecentCommits(String organization, String project)
[CLASS] class GithubClient
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] ResponseEntity<Commit[]> doGetRecentCommit(String organization, String project)
[CA... | /* static context
[FOCAL] @Cacheable("github.commits") public List<Commit> GithubClient.getRecentCommits(String organization, String project)
[INPUTS] branches=- | result=organization, project
[CALLS-INTERNAL] ResponseEntity<Commit[]> doGetRecentCommit(String organization, String project)
[CALLS-EXTERNAL] Arrays.asList... | /* static context
[FOCAL] @Cacheable("github.commits") public List<Commit> GithubClient.getRecentCommits(String organization, String project)
[INPUTS] branches=- | result=organization, project
[CALLS-INTERNAL] ResponseEntity<Commit[]> doGetRecentCommit(String organization, String project)
[CALLS-EXTERNAL] Arrays.asList... | true | ok | {"focal": {"class": "GithubClient", "name": "getRecentCommits", "signature": "List<Commit> getRecentCommits(String organization, String project)", "start_line": 3, "modifiers": "@Cacheable(\"github.commits\") public", "params": [{"name": "organization", "type": "String"}, {"name": "project", "type": "String"}], "return... |
39705783_1 | class ProblemBuilder {
public ThrowableProblem build() {
return new DefaultProblem(type, title, status, detail, instance, cause, new LinkedHashMap<>(parameters));
}
ProblemBuilder();
public ProblemBuilder withType(@Nullable final URI type);
public ProblemBuilder withTitle(@Nullable fina... | final Problem problem = Problem.builder().build();
assertThat(problem, hasFeature("type", Problem::getType, hasToString("about:blank")));
assertThat(problem, hasFeature("title", Problem::getTitle, is(nullValue())));
assertThat(problem, hasFeature("status", Problem::getStatus, is(nullVal... | [FOCAL] public ThrowableProblem ProblemBuilder.build()
[CLASS] class ProblemBuilder
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] DefaultProblem, LinkedHashMap<>
[FIELDS] read=type:URI
[INPUTS] branches=- | result=type
[DATAFLOW] this.type@param->L2
[CLASS-MEMBERS] ProblemBuilder(); Problem... | /* static context
[FOCAL] public ThrowableProblem ProblemBuilder.build()
[INPUTS] branches=- | result=type
[FIELDS] read=type:URI
[NEW] DefaultProblem, LinkedHashMap<>
*/
| /* static context
[FOCAL] public ThrowableProblem ProblemBuilder.build()
[INPUTS] branches=- | result=type
[FIELDS] read=type:URI
[NEW] DefaultProblem, LinkedHashMap<>
*/
class ProblemBuilder {
public ThrowableProblem build() {
return new DefaultProblem(type, title, status, detail, instance, cause, new Lin... | true | ok | {"focal": {"class": "ProblemBuilder", "name": "build", "signature": "ThrowableProblem build()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "ThrowableProblem"}, "class_info": {"name": "ProblemBuilder", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name":... |
39726618_3 | class ExportPDF {
public static final void save(File file, Component c) {
save(file, c, c.getWidth(), c.getHeight());
}
public static final File selectFile();
public static final File selectFile(Component c);
public static final void save(File file, Component c, int width, int height);
}
class TestExportPDF ... | JButton b = new JButton("test");
b.setSize(100, 100);
File file = File.createTempFile("itext-text", ".pdf");
ExportPDF.save(file, b);
assertTrue(file.exists());
assertTrue(file.length() > 0);
file.delete();
assertFalse(file.exists());
}
} | [FOCAL] public static final void ExportPDF.save(File file, Component c)
[CLASS] class ExportPDF
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void save(File file, Component c, int width, int height)
[CALLS-EXTERNAL] Component.getWidth/0, Component.getHeight/0
[COLLABORATORS] para... | /* static context
[FOCAL] public static final void ExportPDF.save(File file, Component c)
[COLLABORATORS] param c:Component getWidth/0,getHeight/0
[CALLS-INTERNAL] void save(File file, Component c, int width, int height)
[CALLS-EXTERNAL] Component.getWidth/0, Component.getHeight/0
*/
| /* static context
[FOCAL] public static final void ExportPDF.save(File file, Component c)
[COLLABORATORS] param c:Component getWidth/0,getHeight/0
[CALLS-INTERNAL] void save(File file, Component c, int width, int height)
[CALLS-EXTERNAL] Component.getWidth/0, Component.getHeight/0
*/
class ExportPDF {
public static f... | true | ok | {"focal": {"class": "ExportPDF", "name": "save", "signature": "void save(File file, Component c)", "start_line": 3, "modifiers": "public static final", "params": [{"name": "file", "type": "File"}, {"name": "c", "type": "Component"}], "return_type": "void"}, "class_info": {"name": "ExportPDF", "kind": "class", "modifier... |
39727052_0 | class StanfordTagger extends AbstractTagger {
public ListMatrix<ListMatrix<MapMatrix<String, Object>>> tag(String text) throws Exception {
ListMatrix<ListMatrix<MapMatrix<String, Object>>> sentenceList = new DefaultListMatrix<ListMatrix<MapMatrix<String, Object>>>();
Annotation document = new Anno... | if (tagger == null) {
return;
}
List<ListMatrix<MapMatrix<String, Object>>> list = tagger.tag(s1);
System.out.println(list.get(0).get(0));
assertEquals(2, list.size());
assertEquals(1, list.get(0).getColumnCount());
assertEquals(11, list.get(0).getRowCount());
assertEquals(1, list.get(1).get... | [FOCAL] public ListMatrix<ListMatrix<MapMatrix<String, Object>>> StanfordTagger.tag(String text)
[CLASS] class StanfordTagger extends AbstractTagger
[METRICS] loc=36 cc=3 branches=0 loops=2 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] stanfordCoreNLP.annotate/1, Annotation.get/1, ListMatrix<ListMatrix<MapMatrix<String... | /* static context
[FOCAL] public ListMatrix<ListMatrix<MapMatrix<String, Object>>> StanfordTagger.tag(String text)
[PATH1] foreach(CoreMap sentence : sentences)=T -> foreach(CoreLabel token : sentence.get(CoreAnnotations.TokensAnnotation.class))=F -> exit loop -> return sentenceList
[PATH2] foreach(CoreMap sentence : s... | /* static context
[FOCAL] public ListMatrix<ListMatrix<MapMatrix<String, Object>>> StanfordTagger.tag(String text)
[PATH1] foreach(CoreMap sentence : sentences)=T -> foreach(CoreLabel token : sentence.get(CoreAnnotations.TokensAnnotation.class))=F -> exit loop -> return sentenceList
[PATH2] foreach(CoreMap sentence : s... | true | ok | {"focal": {"class": "StanfordTagger", "name": "tag", "signature": "ListMatrix<ListMatrix<MapMatrix<String, Object>>> tag(String text) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "text", "type": "String"}], "return_type": "ListMatrix<ListMatrix<MapMatrix<String, Object>>>"}, "class_inf... |
39764417_15 | class PeerManager {
public @Nullable Connection get(@NotNull Channel channel) {
Peer peer = peers.get(channel.remoteAddress());
return peer == null ? null : peer.getConnection(channel.id());
}
public PeerManager(Bootstrap clientBootstrap);
public Connection findOrNew(@NotNull SocketA... |
InetAddress host = InetAddress.getByName(null);
// create server
final TChannel server = new TChannel.Builder("server")
.setServerHost(host)
.build();
final SubChannel subServer = server.makeSubChannel("server")
.register("echo", new EchoHandler());
... | [FOCAL] public @Nullable Connection PeerManager.get(Channel channel)
[CLASS] class PeerManager
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] peers.get/1, Channel.remoteAddress/0, Peer.getConnection/1, Channel.id/0
[INPUTS] branches=- | result=channel
[COLLABORATORS] field peers g... | /* static context
[FOCAL] public @Nullable Connection PeerManager.get(Channel channel)
[INPUTS] branches=- | result=channel
[COLLABORATORS] field peers get/1; param channel:Channel remoteAddress/0,id/0
[CALLS-EXTERNAL] peers.get/1, Channel.remoteAddress/0, Peer.getConnection/1, Channel.id/0
*/
| /* static context
[FOCAL] public @Nullable Connection PeerManager.get(Channel channel)
[INPUTS] branches=- | result=channel
[COLLABORATORS] field peers get/1; param channel:Channel remoteAddress/0,id/0
[CALLS-EXTERNAL] peers.get/1, Channel.remoteAddress/0, Peer.getConnection/1, Channel.id/0
*/
class PeerManager {
... | true | ok | {"focal": {"class": "PeerManager", "name": "get", "signature": "Connection get(Channel channel)", "start_line": 3, "modifiers": "public @Nullable", "params": [{"name": "channel", "type": "Channel"}], "return_type": "Connection"}, "class_info": {"name": "PeerManager", "kind": "class", "modifiers": "", "superclass": null... |
39770930_15 | class JsonWireUtils {
public static String getFullSessionId(String uri) {
String tail = uri.substring(WD_HUB_SESSION.length());
int end = tail.indexOf('/');
if (end < 0) {
return tail;
}
return tail.substring(0, end);
}
private JsonWireUtils();
pub... | String routeHash = md5Hex("hubAddress".getBytes(StandardCharsets.UTF_8));
String sessionId = randomUUID().toString();
String expected = routeHash + sessionId;
assertThat(getFullSessionId(sessionRequest(routeHash, sessionId, "")), is(equalTo(expected)));
assertThat(getFullSessionI... | [FOCAL] public static String JsonWireUtils.getFullSessionId(String uri)
[CLASS] class JsonWireUtils
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] String.substring/1, WD_HUB_SESSION.length/0, String.indexOf/1, String.substring/2
[PATH1] if(end < 0)=T -> return tail
[PATH2] if(end ... | /* static context
[FOCAL] public static String JsonWireUtils.getFullSessionId(String uri)
[PATH1] if(end < 0)=T -> return tail
[PATH2] if(end < 0)=F -> return tail.substring(0, end)
[INPUTS] branches=uri | result=uri
[CALLS-EXTERNAL] String.substring/1, WD_HUB_SESSION.length/0, String.indexOf/1, String.substring/2
*/
| /* static context
[FOCAL] public static String JsonWireUtils.getFullSessionId(String uri)
[PATH1] if(end < 0)=T -> return tail
[PATH2] if(end < 0)=F -> return tail.substring(0, end)
[INPUTS] branches=uri | result=uri
[CALLS-EXTERNAL] String.substring/1, WD_HUB_SESSION.length/0, String.indexOf/1, String.substring/2
*/
c... | true | ok | {"focal": {"class": "JsonWireUtils", "name": "getFullSessionId", "signature": "String getFullSessionId(String uri)", "start_line": 3, "modifiers": "public static", "params": [{"name": "uri", "type": "String"}], "return_type": "String"}, "class_info": {"name": "JsonWireUtils", "kind": "class", "modifiers": "", "supercla... |
39772980_4 | class ValidationResult {
public static IValidationResult ok() {
return OK;
}
private ValidationResult();
public static IValidationResult create();
public static IValidationResult create(final IValidationMessage message);
public static IValidationResult info(final String text);
pu... | final IValidationResult ok = ValidationResult.ok();
Assert.assertEquals(ok.getWorstFirst().getType(), MessageType.OK);
}
} | [FOCAL] public static IValidationResult ValidationResult.ok()
[CLASS] class ValidationResult
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] ValidationResult(); IValidationResult create(); IValidationResult create(IValidationMessage message); IValidationResult info(String text); IVa... | /* static context
[FOCAL] public static IValidationResult ValidationResult.ok()
*/
| /* static context
[FOCAL] public static IValidationResult ValidationResult.ok()
*/
class ValidationResult {
public static IValidationResult ok() {
return OK;
}
private ValidationResult();
public static IValidationResult create();
public static IValidationResult create(final IValidationMe... | true | ok | {"focal": {"class": "ValidationResult", "name": "ok", "signature": "IValidationResult ok()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "IValidationResult"}, "class_info": {"name": "ValidationResult", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": []... |
39793957_7 | class ProgressFormatter {
protected static CharSequence format(long durationInSecondsSinceLoopStart, int count, int total, long durationLoopingStart, long countLoopingStart) {
StringBuilder result = new StringBuilder();
result.append(count).append("/").append(total);
if ((count > countLoo... |
long t3_15 = 3 * 60 + 15;
int durationLoopingStart = 0;
int countLoopingStart = 0;
int first = 1;
int last = 60;
Assert.assertEquals("a", "1/60 00:03:15/03:15:00", ProgressFormatter.format(t3_15,
first + countLoopingStart, last + countLoopingStart, du... | [FOCAL] protected static CharSequence ProgressFormatter.format(long durationInSecondsSinceLoopStart, int count, int total, long durationLoopingStart, long countLoopingStart)
[CLASS] class ProgressFormatter
[METRICS] loc=12 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] void addTime(StringBuilder ... | /* static context
[FOCAL] protected static CharSequence ProgressFormatter.format(long durationInSecondsSinceLoopStart, int count, int total, long durationLoopingStart, long countLoopingStart)
[PATH1] if((count > countLoopingStart) && (durationInSecondsSinceLoopStart > 10))=T -> return result
[PATH2] if((count > countLo... | /* static context
[FOCAL] protected static CharSequence ProgressFormatter.format(long durationInSecondsSinceLoopStart, int count, int total, long durationLoopingStart, long countLoopingStart)
[PATH1] if((count > countLoopingStart) && (durationInSecondsSinceLoopStart > 10))=T -> return result
[PATH2] if((count > countLo... | true | ok | {"focal": {"class": "ProgressFormatter", "name": "format", "signature": "CharSequence format(long durationInSecondsSinceLoopStart, int count, int total, long durationLoopingStart, long countLoopingStart)", "start_line": 3, "modifiers": "protected static", "params": [{"name": "durationInSecondsSinceLoopStart", "type": "... |
39875602_1 | class ChaCha20 {
protected static void quarterRound(int[] x, int a, int b, int c, int d) {
x[a] += x[b];
x[d] = ROTATE(x[d] ^ x[a], 16);
x[c] += x[d];
x[b] = ROTATE(x[b] ^ x[c], 12);
x[a] += x[b];
x[d] = ROTATE(x[d] ^ x[a], 8);
x[c] += x[d];
x[b] = RO... | int buf[] = {
0x879531e0, 0xc5ecf37d, 0x516461b1, 0xc9a62f8a,
0x44c20ef3, 0x3390af7f, 0xd9fc690b, 0x2a5f714c,
0x53372767, 0xb00a5631, 0x974c541a, 0x359e9963,
0x5c971061, 0x3d631689, 0x2098d9d6, 0x91dbd320
};
int expected[] = {
... | [FOCAL] protected static void ChaCha20.quarterRound(int[] x, int a, int b, int c, int d)
[CLASS] class ChaCha20
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] int ROTATE(int v, int c)
[DATAFLOW] a@param->L2,L3,L6,L7; b@param->L2,L5,L6,L9; c@param->L4,L5,L8,L9; d@param->L3,L4,L7,L... | /* static context
[FOCAL] protected static void ChaCha20.quarterRound(int[] x, int a, int b, int c, int d)
[CALLS-INTERNAL] int ROTATE(int v, int c)
*/
| /* static context
[FOCAL] protected static void ChaCha20.quarterRound(int[] x, int a, int b, int c, int d)
[CALLS-INTERNAL] int ROTATE(int v, int c)
*/
class ChaCha20 {
protected static void quarterRound(int[] x, int a, int b, int c, int d) {
x[a] += x[b];
x[d] = ROTATE(x[d] ^ x[a], 16);
x[... | true | ok | {"focal": {"class": "ChaCha20", "name": "quarterRound", "signature": "void quarterRound(int[] x, int a, int b, int c, int d)", "start_line": 3, "modifiers": "protected static", "params": [{"name": "x", "type": "int[]"}, {"name": "a", "type": "int"}, {"name": "b", "type": "int"}, {"name": "c", "type": "int"}, {"name": "... |
39894970_0 | class SplunkLogOutputConnector extends AbstractOutputConnector implements OutputConnector {
@Override
public OutputInteraction createOutputInteraction()
throws ConnectorException {
return new SplunkLogOutputInteraction();
}
}
class SplunkLogOutputConnectorTest {
@Test
public void testCreateOutputInteract... | // fail("Not yet implemented");
OutputInteraction oi = null;
try {
oi = new SplunkLogOutputConnector().createOutputInteraction();
} catch (ConnectorException e) {
e.printStackTrace();
}
if (oi == null) {
fail("unable to get outputinteraction");
} else {
Properties props = new Properties();
p... | [FOCAL] @Override public OutputInteraction SplunkLogOutputConnector.createOutputInteraction()
[CLASS] class SplunkLogOutputConnector extends AbstractOutputConnector implements OutputConnector
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] SplunkLogOutputInteraction
[EXCEPTIONS] declares Conn... | /* static context
[FOCAL] @Override public OutputInteraction SplunkLogOutputConnector.createOutputInteraction()
[EXCEPTIONS] declares ConnectorException
[NEW] SplunkLogOutputInteraction
*/
| /* static context
[FOCAL] @Override public OutputInteraction SplunkLogOutputConnector.createOutputInteraction()
[EXCEPTIONS] declares ConnectorException
[NEW] SplunkLogOutputInteraction
*/
class SplunkLogOutputConnector extends AbstractOutputConnector implements OutputConnector {
@Override
public OutputInteraction c... | true | ok | {"focal": {"class": "SplunkLogOutputConnector", "name": "createOutputInteraction", "signature": "OutputInteraction createOutputInteraction() throws ConnectorException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "OutputInteraction"}, "class_info": {"name": "SplunkLogOutputConnector",... |
39905749_2 | class LazyExpirableCache implements Cache {
@Override
public Observable<Boolean> remove(String key) {
return underlyingCache.remove(key);
}
private LazyExpirableCache(RxCache underlyingCache, long expireMillis, Observable<Long> timeObservable);
public static LazyExpirableCache fromCache(... | RxCache underlyingCache = mock(RxCache.class);
LazyExpirableCache lazyExpirableCache = LazyExpirableCache.fromCache(underlyingCache, 10, TimeUnit.SECONDS,
simpleTimeProvider);
String cacheKey = "cache_key";
when(underlyingCache.remove(eq(cacheKey))).thenReturn(Observab... | [FOCAL] @Override public Observable<Boolean> LazyExpirableCache.remove(String key)
[CLASS] class LazyExpirableCache implements Cache
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] underlyingCache.remove/1
[INPUTS] branches=- | result=key
[COLLABORATORS] field underlyingCache remov... | /* static context
[FOCAL] @Override public Observable<Boolean> LazyExpirableCache.remove(String key)
[INPUTS] branches=- | result=key
[COLLABORATORS] field underlyingCache remove/1
[CALLS-EXTERNAL] underlyingCache.remove/1
*/
| /* static context
[FOCAL] @Override public Observable<Boolean> LazyExpirableCache.remove(String key)
[INPUTS] branches=- | result=key
[COLLABORATORS] field underlyingCache remove/1
[CALLS-EXTERNAL] underlyingCache.remove/1
*/
class LazyExpirableCache implements Cache {
@Override
public Observable<Boolean> remo... | true | ok | {"focal": {"class": "LazyExpirableCache", "name": "remove", "signature": "Observable<Boolean> remove(String key)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "key", "type": "String"}], "return_type": "Observable<Boolean>"}, "class_info": {"name": "LazyExpirableCache", "kind": "class", "modifi... |
39922362_104 | class RunningStats {
public double stddev() {
return Math.sqrt(variance());
}
public void push(double x);
public double mean();
public double variance();
public double skewness();
public double kurtosis();
}
class RunningStatsTest {
@Test
public void testVarianceWithNoEntry() {
| RunningStats runningStats = new RunningStats();
Assert.assertEquals(0.0d, runningStats.stddev(), 0.001);
}
} | [FOCAL] public double RunningStats.stddev()
[CLASS] class RunningStats
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] double variance()
[CALLS-EXTERNAL] Math.sqrt/1
[CLASS-MEMBERS] void push(double x); double mean(); double variance(); double skewness(); double kurtosis()
[TEST] R... | /* static context
[FOCAL] public double RunningStats.stddev()
[CALLS-INTERNAL] double variance()
[CALLS-EXTERNAL] Math.sqrt/1
*/
| /* static context
[FOCAL] public double RunningStats.stddev()
[CALLS-INTERNAL] double variance()
[CALLS-EXTERNAL] Math.sqrt/1
*/
class RunningStats {
public double stddev() {
return Math.sqrt(variance());
}
public void push(double x);
public double mean();
public double variance();
public double skewn... | true | ok | {"focal": {"class": "RunningStats", "name": "stddev", "signature": "double stddev()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "double"}, "class_info": {"name": "RunningStats", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "push"... |
39924219_1 | class MetricConverter {
public static double getSRM(double inEBC) {
return (int) Math.round(inEBC / SRM);
}
public static double getEBC(double inSRM);
public static double getEBC(String inSRM);
public static String getPlato(double gravity);
public static boolean isCountryMetric(String ... | assert(1 == MetricConverter.getSRM(2));
assert(2 == MetricConverter.getSRM(4));
assert(10 == MetricConverter.getSRM(20));
assert(40 == MetricConverter.getSRM(79));
assert(-1 == MetricConverter.getSRM(-2));
assert(0 == MetricConverter.getSRM(0));
}
} | [FOCAL] public static double MetricConverter.getSRM(double inEBC)
[CLASS] class MetricConverter
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Math.round/1
[INPUTS] branches=- | result=inEBC
[DATAFLOW] inEBC@param->L2
[CLASS-MEMBERS] double getEBC(double inSRM); double getEBC(Stri... | /* static context
[FOCAL] public static double MetricConverter.getSRM(double inEBC)
[INPUTS] branches=- | result=inEBC
[CALLS-EXTERNAL] Math.round/1
*/
| /* static context
[FOCAL] public static double MetricConverter.getSRM(double inEBC)
[INPUTS] branches=- | result=inEBC
[CALLS-EXTERNAL] Math.round/1
*/
class MetricConverter {
public static double getSRM(double inEBC) {
return (int) Math.round(inEBC / SRM);
}
public static double getEBC(double inS... | true | ok | {"focal": {"class": "MetricConverter", "name": "getSRM", "signature": "double getSRM(double inEBC)", "start_line": 3, "modifiers": "public static", "params": [{"name": "inEBC", "type": "double"}], "return_type": "double"}, "class_info": {"name": "MetricConverter", "kind": "class", "modifiers": "", "superclass": null, "... |
39970786_0 | class TodoManagerImpl {
public void add(final Callback<Boolean> callback, final Todo todo) {
todoMap.put(todo.getId(), todo);
callback.resolve(true);
}
public TodoManagerImpl();
public void remove(final Callback<Boolean> callback, final String id);
public void list(final Callback... |
/* A list of promises for things we want to do all at once. */
final List<Promise<Boolean>> promises = new ArrayList<>(3);
final CountDownLatch latch = new CountDownLatch(1);
final AtomicBoolean success = new AtomicBoolean();
/** Add a todoItem to the client add method */
... | [FOCAL] public void TodoManagerImpl.add(Callback<Boolean> callback, Todo todo)
[CLASS] class TodoManagerImpl
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] todoMap.put/2, Todo.getId/0, Callback<Boolean>.resolve/1
[COLLABORATORS] field todoMap put/2; param todo:Todo getId/0; param ... | /* static context
[FOCAL] public void TodoManagerImpl.add(Callback<Boolean> callback, Todo todo)
[COLLABORATORS] field todoMap put/2; param todo:Todo getId/0; param callback:Callback<Boolean> resolve/1
[CALLS-EXTERNAL] todoMap.put/2, Todo.getId/0, Callback<Boolean>.resolve/1
*/
| /* static context
[FOCAL] public void TodoManagerImpl.add(Callback<Boolean> callback, Todo todo)
[COLLABORATORS] field todoMap put/2; param todo:Todo getId/0; param callback:Callback<Boolean> resolve/1
[CALLS-EXTERNAL] todoMap.put/2, Todo.getId/0, Callback<Boolean>.resolve/1
*/
class TodoManagerImpl {
public void ... | true | ok | {"focal": {"class": "TodoManagerImpl", "name": "add", "signature": "void add(Callback<Boolean> callback, Todo todo)", "start_line": 3, "modifiers": "public", "params": [{"name": "callback", "type": "Callback<Boolean>"}, {"name": "todo", "type": "Todo"}], "return_type": "void"}, "class_info": {"name": "TodoManagerImpl",... |
39997974_2 | class ArticleService {
public Mono<String> fetchArticle(String articleName) {
return cache.lookup(articleName);
}
@Autowired public ArticleService(WikiService wikiService, CountService countService, RatingService ratingService,
@Value("${article.cache.size}") int cacheSi... | StepVerifier.create(articleService.fetchArticle(EIGENWERT_ARTICLE.getName()))
.expectNext(EIGENWERT_ARTICLE.getContent())
.verifyComplete();
}
} | [FOCAL] public Mono<String> ArticleService.fetchArticle(String articleName)
[CLASS] class ArticleService
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] cache.lookup/1
[INPUTS] branches=- | result=articleName
[COLLABORATORS] field cache lookup/1
[DATAFLOW] articleName@param->L2
[CL... | /* static context
[FOCAL] public Mono<String> ArticleService.fetchArticle(String articleName)
[INPUTS] branches=- | result=articleName
[COLLABORATORS] field cache lookup/1
[CALLS-EXTERNAL] cache.lookup/1
*/
| /* static context
[FOCAL] public Mono<String> ArticleService.fetchArticle(String articleName)
[INPUTS] branches=- | result=articleName
[COLLABORATORS] field cache lookup/1
[CALLS-EXTERNAL] cache.lookup/1
*/
class ArticleService {
public Mono<String> fetchArticle(String articleName) {
return cache.lookup(ar... | true | ok | {"focal": {"class": "ArticleService", "name": "fetchArticle", "signature": "Mono<String> fetchArticle(String articleName)", "start_line": 3, "modifiers": "public", "params": [{"name": "articleName", "type": "String"}], "return_type": "Mono<String>"}, "class_info": {"name": "ArticleService", "kind": "class", "modifiers"... |
40049579_18 | class GarageServiceImpl implements GarageService {
@Override
public Result addCar(Car car) {
Preconditions.checkNotNull(car, "car should not be null");
Result result = FluentValidator.checkAll().failOver()
.on(car.getManufacturer(), new CarManufacturerValidator())
... | Result result = garageService.addCar(new Car("BMW", "XXXXX1234", 0));
System.out.println(result);
assertThat(result.isSuccess(), is(false));
assertThat(result.getErrorNumber(), is(2));
assertThat(result.getErrors().get(0), is(String.format(CarError.SEATCOUNT_ERROR.msg(), 0)));
... | [FOCAL] @Override public Result GarageServiceImpl.addCar(Car car)
[CLASS] class GarageServiceImpl implements GarageService
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Preconditions.checkNotNull/2, FluentValidator.checkAll().failOver() .on(car.getManufact....result/1, FluentVal... | /* static context
[FOCAL] @Override public Result GarageServiceImpl.addCar(Car car)
[INPUTS] branches=- | result=car
[COLLABORATORS] param car:Car getManufacturer/0,getSeatCount/0,getLicensePlate/0
[NEW] CarManufacturerValidator, CarSeatCountValidator, CarLicensePlateValidator
[CALLS-EXTERNAL] Preconditions.checkNotNul... | /* static context
[FOCAL] @Override public Result GarageServiceImpl.addCar(Car car)
[INPUTS] branches=- | result=car
[COLLABORATORS] param car:Car getManufacturer/0,getSeatCount/0,getLicensePlate/0
[NEW] CarManufacturerValidator, CarSeatCountValidator, CarLicensePlateValidator
[CALLS-EXTERNAL] Preconditions.checkNotNul... | true | ok | {"focal": {"class": "GarageServiceImpl", "name": "addCar", "signature": "Result addCar(Car car)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "car", "type": "Car"}], "return_type": "Result"}, "class_info": {"name": "GarageServiceImpl", "kind": "class", "modifiers": "", "superclass": null, "int... |
40055799_111 | class SimpleHashService extends HashService {
@Override
public String hash(String plaintext) {
return plaintext;
}
SimpleHashService(boolean serverSideHashEnabled, boolean allowCommonMistakes);
@Override boolean isMatchExact(String plaintext, String hashed);
private final HashService hashService;
... | String plaintext = "Password";
String hashed = hashService.hash(plaintext);
assertTrue(hashService.isMatch(plaintext, hashed));
String capsLock = "pASSWORD";
assertFalse(hashService.isMatch(capsLock, hashed));
String extraFirstCharacter = "*Password";
assertFalse(hashService.isMatch(extra... | [FOCAL] @Override public String SimpleHashService.hash(String plaintext)
[CLASS] class SimpleHashService extends HashService
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[INPUTS] branches=- | result=plaintext
[DATAFLOW] plaintext@param->L3
[CLASS-MEMBERS] SimpleHashService(boolean serverSideHash... | /* static context
[FOCAL] @Override public String SimpleHashService.hash(String plaintext)
[INPUTS] branches=- | result=plaintext
*/
| /* static context
[FOCAL] @Override public String SimpleHashService.hash(String plaintext)
[INPUTS] branches=- | result=plaintext
*/
class SimpleHashService extends HashService {
@Override
public String hash(String plaintext) {
return plaintext;
}
SimpleHashService(boolean serverSideHashEnabled, boolean... | true | ok | {"focal": {"class": "SimpleHashService", "name": "hash", "signature": "String hash(String plaintext)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "plaintext", "type": "String"}], "return_type": "String"}, "class_info": {"name": "SimpleHashService", "kind": "class", "modifiers": "", "superclas... |
40111808_37 | class TypedMap implements Map<String, Object> {
public Set<String> keySet() {
return inner.keySet();
}
public TypedMap(final RecordType type);
public TypedMap(final RecordType type, final Map<? extends String, ? extends Object> map);
public RecordType getType();
public Type getFieldType(final String fieldN... | Map<String, Object> values = new HashMap<String, Object>();
values.put("intValue", 1);
values.put("booleanValue", true);
String[] stringArray = new String[] { "a", "b", "c" };
values.put("stringArray", stringArray);
TypedMap map = new TypedMap(recordType, values);
Set<String> keySet = map.keySet();
ass... | [FOCAL] public Set<String> TypedMap.keySet()
[CLASS] class TypedMap implements Map<String, Object>
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] inner.keySet/0
[COLLABORATORS] field inner keySet/0
[CLASS-MEMBERS] TypedMap(RecordType type); TypedMap(RecordType type, Map<? extends ... | /* static context
[FOCAL] public Set<String> TypedMap.keySet()
[COLLABORATORS] field inner keySet/0
[CALLS-EXTERNAL] inner.keySet/0
*/
| /* static context
[FOCAL] public Set<String> TypedMap.keySet()
[COLLABORATORS] field inner keySet/0
[CALLS-EXTERNAL] inner.keySet/0
*/
class TypedMap implements Map<String, Object> {
public Set<String> keySet() {
return inner.keySet();
}
public TypedMap(final RecordType type);
public TypedMap(final RecordType... | true | ok | {"focal": {"class": "TypedMap", "name": "keySet", "signature": "Set<String> keySet()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Set<String>"}, "class_info": {"name": "TypedMap", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Map<String, Object>", "fields": [{"name": "s... |
40115035_16 | class EventMapper {
public Event eventFromContextElement(ContextElement contextElement) throws EventProcessingException, TypeNotFoundException {
String eventId = contextElement.getEntityId().getId();
String eventType = contextElement.getEntityId().getType();
Event event = new Event(eventTy... | ContextElement ce = new ContextElement();
ce.setEntityId(new EntityId("S1", "TempSensor", false));
List<ContextAttribute> attributes = new LinkedList<>();
attributes.add(new ContextAttribute("1", "string", "hello"));
attributes.add(new ContextAttribute("1_string", null, "hello")... | [FOCAL] public Event EventMapper.eventFromContextElement(ContextElement contextElement)
[CLASS] class EventMapper
[METRICS] loc=52 cc=7 branches=3 loops=3 returns=1 throws=1 nesting=3
[CALLS-INTERNAL] Object valueForType(Object value, String type, String name)
[CALLS-EXTERNAL] contextElement.getEntityId().getId/0, Cont... | /* static context
[FOCAL] public Event EventMapper.eventFromContextElement(ContextElement contextElement)
[THROWS-WHEN] EventProcessingException when foreach(ContextAttribute contextAttribute : contextElement.getContextAttributeList())#1=T && foreach(ContextMetadata contextMetada : contextAttribute.getMetadata())=T && ... | /* static context
[FOCAL] public Event EventMapper.eventFromContextElement(ContextElement contextElement)
[THROWS-WHEN] EventProcessingException when foreach(ContextAttribute contextAttribute : contextElement.getContextAttributeList())#1=T && foreach(ContextMetadata contextMetada : contextAttribute.getMetadata())=T && ... | true | ok | {"focal": {"class": "EventMapper", "name": "eventFromContextElement", "signature": "Event eventFromContextElement(ContextElement contextElement) throws EventProcessingException, TypeNotFoundException", "start_line": 3, "modifiers": "public", "params": [{"name": "contextElement", "type": "ContextElement"}], "return_type... |
40167498_37 | class IpUtils {
public static Integer ip2int(String ipAddress) {
Inet4Address a;
try {
a = (Inet4Address) InetAddress.getByName(ipAddress);
} catch (UnknownHostException e) {
_log.error(ExceptionUtils.errorInfo(e));
return null;
}
byte[] b... | Integer ip2int = ip2int("10.1.1.0");
Assert.notNull(ip2int);
int ip = ip2int;
assertEquals(167837952, ip);
assertEquals(0x0A010100, ip);
}
} | [FOCAL] public static Integer IpUtils.ip2int(String ipAddress)
[CLASS] class IpUtils
[METRICS] loc=11 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] InetAddress.getByName/1, Logger.error/1, ExceptionUtils.errorInfo/1, Inet4Address.getAddress/0
[FIELDS] read=_log:Logger
[EXCEPTIONS] catches Unknow... | /* static context
[FOCAL] public static Integer IpUtils.ip2int(String ipAddress)
[PATH1] try-body throws -> return null
[PATH2] return ((b[0] & 0xFF) << 24) | ((b[1] & 0xFF) << 16) | ((b[2] & 0xFF) << 8...
[INPUTS] branches=- | result=ipAddress
[COLLABORATORS] field _log:Logger error/1
[EXCEPTIONS] catches UnknownHostE... | /* static context
[FOCAL] public static Integer IpUtils.ip2int(String ipAddress)
[PATH1] try-body throws -> return null
[PATH2] return ((b[0] & 0xFF) << 24) | ((b[1] & 0xFF) << 16) | ((b[2] & 0xFF) << 8...
[INPUTS] branches=- | result=ipAddress
[COLLABORATORS] field _log:Logger error/1
[EXCEPTIONS] catches UnknownHostE... | true | ok | {"focal": {"class": "IpUtils", "name": "ip2int", "signature": "Integer ip2int(String ipAddress)", "start_line": 3, "modifiers": "public static", "params": [{"name": "ipAddress", "type": "String"}], "return_type": "Integer"}, "class_info": {"name": "IpUtils", "kind": "class", "modifiers": "", "superclass": null, "interf... |
40182023_27 | class TelegramBot {
public <T extends BaseRequest<T, R>, R extends BaseResponse> R execute(BaseRequest<T, R> request) {
return api.send(request);
}
public TelegramBot(String botToken);
TelegramBot(Builder builder);
public void execute(T request, Callback<T, R> callback);
public Str... | Message message = bot.execute(new SendSticker(chatId, stickerFileAnim)).message();
MessageTest.checkMessage(message);
StickerTest.check(message.sticker(), false, true);
assertTrue(message.sticker().isAnimated());
message = bot.execute(new SendSticker(chatId, stickerId)).message(... | [FOCAL] public R TelegramBot.execute(BaseRequest<T, R> request)
[CLASS] class TelegramBot
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] api.send/1
[INPUTS] branches=- | result=request
[COLLABORATORS] field api send/1
[DATAFLOW] request@param->L2
[CLASS-MEMBERS] TelegramBot(String... | /* static context
[FOCAL] public R TelegramBot.execute(BaseRequest<T, R> request)
[INPUTS] branches=- | result=request
[COLLABORATORS] field api send/1
[CALLS-EXTERNAL] api.send/1
*/
| /* static context
[FOCAL] public R TelegramBot.execute(BaseRequest<T, R> request)
[INPUTS] branches=- | result=request
[COLLABORATORS] field api send/1
[CALLS-EXTERNAL] api.send/1
*/
class TelegramBot {
public <T extends BaseRequest<T, R>, R extends BaseResponse> R execute(BaseRequest<T, R> request) {
retu... | true | ok | {"focal": {"class": "TelegramBot", "name": "execute", "signature": "R execute(BaseRequest<T, R> request)", "start_line": 3, "modifiers": "public", "params": [{"name": "request", "type": "BaseRequest<T, R>"}], "return_type": "R"}, "class_info": {"name": "TelegramBot", "kind": "class", "modifiers": "", "superclass": null... |
40213809_69 | class BearingWidget extends QuestionWidget implements BinaryDataReceiver {
@Override
public IAnswerData getAnswer() {
String answerText = binding.answerText.getText().toString();
return answerText.isEmpty() ? null : new StringData(answerText);
}
public BearingWidget(Context context, Q... | assertThat(createWidget(promptWithAnswer(null)).getAnswer(), nullValue());
}
} | [FOCAL] @Override public IAnswerData BearingWidget.getAnswer()
[CLASS] class BearingWidget extends QuestionWidget implements BinaryDataReceiver
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] binding.answerText.getText().toString/0, binding.answerText.getText/0, String.isEmpty/0
[N... | /* static context
[FOCAL] @Override public IAnswerData BearingWidget.getAnswer()
[NEW] StringData
[CALLS-EXTERNAL] binding.answerText.getText().toString/0, binding.answerText.getText/0, String.isEmpty/0
*/
| /* static context
[FOCAL] @Override public IAnswerData BearingWidget.getAnswer()
[NEW] StringData
[CALLS-EXTERNAL] binding.answerText.getText().toString/0, binding.answerText.getText/0, String.isEmpty/0
*/
class BearingWidget extends QuestionWidget implements BinaryDataReceiver {
@Override
public IAnswerData g... | true | ok | {"focal": {"class": "BearingWidget", "name": "getAnswer", "signature": "IAnswerData getAnswer()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "IAnswerData"}, "class_info": {"name": "BearingWidget", "kind": "class", "modifiers": "", "superclass": "QuestionWidget", "interfaces": "Binary... |
40235586_15 | class DefaultNetworkMetrics implements NetworkMetrics {
@Override
public Optional<NetworkInterface> networkInterfaceById(String id) {
return hal.getNetworkIFs().stream().filter(n -> n.getName().equalsIgnoreCase(id)).map(
mapToNetworkInterface()).findAny();
}
protected DefaultN... | when(networkInterface1.isLoopback()).thenThrow(new SocketException("Shrug"));
Optional<NetworkInterface> en1 = provider.networkInterfaceById("en0");
assertTrue(en1.isPresent());
assertFalse(en1.get().isLoopback());
}
} | [FOCAL] @Override public Optional<NetworkInterface> DefaultNetworkMetrics.networkInterfaceById(String id)
[CLASS] class DefaultNetworkMetrics implements NetworkMetrics
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Function<NetworkIF, NetworkInterface> mapToNetworkInterface()
[CAL... | /* static context
[FOCAL] @Override public Optional<NetworkInterface> DefaultNetworkMetrics.networkInterfaceById(String id)
[INPUTS] branches=- | result=id, hal
[COLLABORATORS] field hal:HardwareAbstractionLayer getNetworkIFs/0; field n getName/0
[CALLS-INTERNAL] Function<NetworkIF, NetworkInterface> mapToNetworkInterf... | /* static context
[FOCAL] @Override public Optional<NetworkInterface> DefaultNetworkMetrics.networkInterfaceById(String id)
[INPUTS] branches=- | result=id, hal
[COLLABORATORS] field hal:HardwareAbstractionLayer getNetworkIFs/0; field n getName/0
[CALLS-INTERNAL] Function<NetworkIF, NetworkInterface> mapToNetworkInterf... | true | ok | {"focal": {"class": "DefaultNetworkMetrics", "name": "networkInterfaceById", "signature": "Optional<NetworkInterface> networkInterfaceById(String id)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "id", "type": "String"}], "return_type": "Optional<NetworkInterface>"}, "class_info": {"name": "De... |
40266095_32 | class PageRankRanking extends JCasAnnotator_ImplBase {
@Override
public void process(JCas jcas) throws AnalysisEngineProcessException {
getContext().getLogger().log(Level.CONFIG, "Entering " + this.getClass().getSimpleName());
pageRank.initializeFromAnnotationPairIterator(
JCas... |
Map<String,Double> expectedResults = new HashMap<String,Double>();
expectedResults.put("sentence", 1.6487752080270504);
expectedResults.put("second", 0.8508165279819666);
expectedResults.put("long", 0.5004082639909833);
expectedResults.put("more", 0.5004082639909833);
ex... | [FOCAL] @Override public void PageRankRanking.process(JCas jcas)
[CLASS] class PageRankRanking extends JCasAnnotator_ImplBase
[METRICS] loc=17 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] void addKeyphrase(JCas jcas, TermRank termRank)
[CALLS-EXTERNAL] getContext().getLogger().log/2, getContext... | /* static context
[FOCAL] @Override public void PageRankRanking.process(JCas jcas)
[PATH1] foreach(TermRank termRank : termRanks)=T -> exit loop
[PATH2] foreach(TermRank termRank : termRanks)=F
[COLLABORATORS] field pageRank initializeFromAnnotationPairIterator/2,run/0,getTermRanks/0
[EXCEPTIONS] declares AnalysisEngin... | /* static context
[FOCAL] @Override public void PageRankRanking.process(JCas jcas)
[PATH1] foreach(TermRank termRank : termRanks)=T -> exit loop
[PATH2] foreach(TermRank termRank : termRanks)=F
[COLLABORATORS] field pageRank initializeFromAnnotationPairIterator/2,run/0,getTermRanks/0
[EXCEPTIONS] declares AnalysisEngin... | true | ok | {"focal": {"class": "PageRankRanking", "name": "process", "signature": "void process(JCas jcas) throws AnalysisEngineProcessException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "jcas", "type": "JCas"}], "return_type": "void"}, "class_info": {"name": "PageRankRanking", "kind": "class", "modi... |
40317158_3 | class MZTabUtils {
public static SplitList<String> parseGOTermList(String target) {
SplitList<String> list = parseStringList(COMMA, target);
SplitList<String> goList = new SplitList<String>(COMMA);
for (String item : list) {
item = parseString(item);
if (item.starts... | SplitList<String> goList;
StringBuilder sb = new StringBuilder();
goList = parseGOTermList(sb.toString());
assertTrue(goList.size() == 0);
sb.append("GO:0005515");
goList = parseGOTermList(sb.toString());
assertTrue(goList.size() == 1);
sb.append(",GO:0... | [FOCAL] public static SplitList<String> MZTabUtils.parseGOTermList(String target)
[CLASS] class MZTabUtils
[METRICS] loc=16 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] SplitList<String> parseStringList(char splitChar, String target); String parseString(String target)
[CALLS-EXTERNAL] String.st... | /* static context
[FOCAL] public static SplitList<String> MZTabUtils.parseGOTermList(String target)
[PATH1] foreach(String item : list)=T -> if(item.startsWith("GO:"))=T -> exit loop -> return goList
[PATH2] foreach(String item : list)=F -> return goList
[PATH3] foreach(String item : list)=T -> if(item.startsWith("GO:"... | /* static context
[FOCAL] public static SplitList<String> MZTabUtils.parseGOTermList(String target)
[PATH1] foreach(String item : list)=T -> if(item.startsWith("GO:"))=T -> exit loop -> return goList
[PATH2] foreach(String item : list)=F -> return goList
[PATH3] foreach(String item : list)=T -> if(item.startsWith("GO:"... | true | ok | {"focal": {"class": "MZTabUtils", "name": "parseGOTermList", "signature": "SplitList<String> parseGOTermList(String target)", "start_line": 3, "modifiers": "public static", "params": [{"name": "target", "type": "String"}], "return_type": "SplitList<String>"}, "class_info": {"name": "MZTabUtils", "kind": "class", "modif... |
40321883_9 | class MainTypesUtil {
public List<String> getMainTypesByTumorTypes(Set<TumorType> tumorTypes) {
Set<String> mainTypes = new HashSet<>();
// skip the root node, "TISSUE". Just add it's children
for (TumorType tumorType : tumorTypes) {
if (tumorType.getMainType() != null && tumorT... | List<String> returnedMainTypeList = mainTypesUtil.getMainTypesByTumorTypes(new HashSet<>(expectedTumorTypeMap.values()));
StringBuilder failureReport = new StringBuilder();
int failureCount = 0;
if (returnedMainTypeList.size() != expectedMainTypeList.size()) {
failureCount++... | [FOCAL] public List<String> MainTypesUtil.getMainTypesByTumorTypes(Set<TumorType> tumorTypes)
[CLASS] class MainTypesUtil
[METRICS] loc=10 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] TumorType.getMainType/0, TumorType.getParent/0, Set<String>.add/1
[NEW] HashSet<>, ArrayList<>
[PATH1] foreach(... | /* static context
[FOCAL] public List<String> MainTypesUtil.getMainTypesByTumorTypes(Set<TumorType> tumorTypes)
[PATH1] foreach(TumorType tumorType : tumorTypes)=T -> if(tumorType.getMainType() != null && tumorType.getParent() != null)=T -> exit loop -> return new ArrayList<>(mainTypes)
[PATH2] foreach(TumorType tumorT... | /* static context
[FOCAL] public List<String> MainTypesUtil.getMainTypesByTumorTypes(Set<TumorType> tumorTypes)
[PATH1] foreach(TumorType tumorType : tumorTypes)=T -> if(tumorType.getMainType() != null && tumorType.getParent() != null)=T -> exit loop -> return new ArrayList<>(mainTypes)
[PATH2] foreach(TumorType tumorT... | true | ok | {"focal": {"class": "MainTypesUtil", "name": "getMainTypesByTumorTypes", "signature": "List<String> getMainTypesByTumorTypes(Set<TumorType> tumorTypes)", "start_line": 3, "modifiers": "public", "params": [{"name": "tumorTypes", "type": "Set<TumorType>"}], "return_type": "List<String>"}, "class_info": {"name": "MainType... |
40396716_0 | class T411V2Provider extends DownloadFinder implements EpisodeFinder, MusicAlbumFinder, TVShowSeasonProvider, MovieProvider, BookFinder, MagazineProvider {
@Override
public List<SearchResult> findDownloadsForMagazine(String issueSearchString) throws Exception {
List<SearchResult> results = extract(issueSearchStrin... | fail("Not yet implemented");
}
} | [FOCAL] @Override public List<SearchResult> T411V2Provider.findDownloadsForMagazine(String issueSearchString)
[CLASS] class T411V2Provider extends DownloadFinder implements EpisodeFinder, MusicAlbumFinder, TVShowSeasonProvider, MovieProvider, BookFinder, MagazineProvider
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=... | /* static context
[FOCAL] @Override public List<SearchResult> T411V2Provider.findDownloadsForMagazine(String issueSearchString)
[INPUTS] branches=- | result=issueSearchString
[EXCEPTIONS] declares Exception
[CALLS-INTERNAL] List<SearchResult> extract(String search, int category, int subcategory)
*/
| /* static context
[FOCAL] @Override public List<SearchResult> T411V2Provider.findDownloadsForMagazine(String issueSearchString)
[INPUTS] branches=- | result=issueSearchString
[EXCEPTIONS] declares Exception
[CALLS-INTERNAL] List<SearchResult> extract(String search, int category, int subcategory)
*/
class T411V2Provider... | true | ok | {"focal": {"class": "T411V2Provider", "name": "findDownloadsForMagazine", "signature": "List<SearchResult> findDownloadsForMagazine(String issueSearchString) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "issueSearchString", "type": "String"}], "return_type": "List<SearchResul... |
40404190_2 | class RestartableSet implements Launcher {
@Override
public void launch(int id) {
restartable(id).launch();
}
public RestartableSet(ValueMap.Builder out);
public RestartableSet(ValueMap in, ValueMap.Builder out);
@Override public Observable<Notification<T>> channel(int id, DeliveryM... | ValueMap.Builder builder = ValueMap.builder();
RestartableSet set1 = new RestartableSet(builder);
Subscription subscription = subscribeRestartable(method, subscriber1, scheduler, set1);
launch(set1);
subscription.unsubscribe();
ValueMap state = builder.build();
... | [FOCAL] @Override public void RestartableSet.launch(int id)
[CLASS] class RestartableSet implements Launcher
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] Restartable restartable(int id)
[CALLS-EXTERNAL] restartable(id).launch/0
[DATAFLOW] id@param->L3
[CLASS-MEMBERS] Restartable... | /* static context
[FOCAL] @Override public void RestartableSet.launch(int id)
[CALLS-INTERNAL] Restartable restartable(int id)
[CALLS-EXTERNAL] restartable(id).launch/0
*/
| /* static context
[FOCAL] @Override public void RestartableSet.launch(int id)
[CALLS-INTERNAL] Restartable restartable(int id)
[CALLS-EXTERNAL] restartable(id).launch/0
*/
class RestartableSet implements Launcher {
@Override
public void launch(int id) {
restartable(id).launch();
}
public Rest... | true | ok | {"focal": {"class": "RestartableSet", "name": "launch", "signature": "void launch(int id)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "id", "type": "int"}], "return_type": "void"}, "class_info": {"name": "RestartableSet", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "L... |
40405884_15 | class PersistedHistogram {
public Path saveToFile(final Path outputDirectory, final String namePrefix) throws IOException
{
requireNonNull(outputDirectory);
final String prefix = namePrefix.trim();
if (prefix.isEmpty())
{
throw new IllegalArgumentException("Name pre... | assertThrows(IllegalArgumentException.class, () -> persistedHistogram.saveToFile(tempDir, " \t \n "));
}
} | [FOCAL] public Path PersistedHistogram.saveToFile(Path outputDirectory, String namePrefix)
[CLASS] class PersistedHistogram
[METRICS] loc=40 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-INTERNAL] Path saveToFile(Histogram histogram, Path file)
[CALLS-EXTERNAL] requireNonNull/1 (inherited), String.trim/0,... | /* static context
[FOCAL] public Path PersistedHistogram.saveToFile(Path outputDirectory, String namePrefix)
[THROWS-WHEN] IllegalArgumentException when prefix.isEmpty()
[PATH1] if(prefix.isEmpty())=T -> throw new IllegalArgumentException("Name prefix cannot be blank!")
[PATH2] if(prefix.isEmpty())=F -> return saveToFi... | /* static context
[FOCAL] public Path PersistedHistogram.saveToFile(Path outputDirectory, String namePrefix)
[THROWS-WHEN] IllegalArgumentException when prefix.isEmpty()
[PATH1] if(prefix.isEmpty())=T -> throw new IllegalArgumentException("Name prefix cannot be blank!")
[PATH2] if(prefix.isEmpty())=F -> return saveToFi... | true | ok | {"focal": {"class": "PersistedHistogram", "name": "saveToFile", "signature": "Path saveToFile(Path outputDirectory, String namePrefix) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "outputDirectory", "type": "Path"}, {"name": "namePrefix", "type": "String"}], "return_type": "Path"}, "... |
40442532_2 | class AbstractPermissionListener implements PermissionListener {
@Override public void onPermissionDenied(PermissionDeniedResponse response) {
if (!contextProvider.isActivityContextAvailable()) {
PermissionsUIViews.showPermissionToast(contextProvider.getApplicationContext(),
getPermissionDeniedFe... | DummyPermissionListenerImplementation dummyPermissionListenerImplementation =
new DummyPermissionListenerImplementation(contextProvider, stubString);
setUpActivityContextInitializedScenario();
dummyPermissionListenerImplementation.onPermissionDenied(
new Permiss... | [FOCAL] @Override public void AbstractPermissionListener.onPermissionDenied(PermissionDeniedResponse response)
[CLASS] class AbstractPermissionListener implements PermissionListener
[METRICS] loc=10 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] int getPermissionDeniedFeedback()
[CALLS-EXTERNAL] ... | /* static context
[FOCAL] @Override public void AbstractPermissionListener.onPermissionDenied(PermissionDeniedResponse response)
[PATH1] if(!contextProvider.isActivityContextAvailable())=T -> if(userPermissionRequestResponseListener != null)=T
[PATH2] if(!contextProvider.isActivityContextAvailable())=F -> if(userPermis... | /* static context
[FOCAL] @Override public void AbstractPermissionListener.onPermissionDenied(PermissionDeniedResponse response)
[PATH1] if(!contextProvider.isActivityContextAvailable())=T -> if(userPermissionRequestResponseListener != null)=T
[PATH2] if(!contextProvider.isActivityContextAvailable())=F -> if(userPermis... | true | ok | {"focal": {"class": "AbstractPermissionListener", "name": "onPermissionDenied", "signature": "void onPermissionDenied(PermissionDeniedResponse response)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "response", "type": "PermissionDeniedResponse"}], "return_type": "void"}, "class_info": {"name"... |
40457462_109 | class GunEnemy extends Enemy<TimestampedFiringAngle> {
@Override
public void initRound() {
super.initRound();
lastNonZeroVelocity = 0;
previousVelocity = 0;
timeSinceDirectionChange = 0;
timeSinceVelocityChange = 0;
hitLocations.clear();
}
public GunEnemy(String botName, double distan... | GunEnemy gunData = newGunEnemy();
gunData.energy = 10;
gunData.alive = false;
gunData.setRobotState(RobotState.newBuilder()
.setLocation(newLocation())
.setTime(1)
.build());
gunData.initRound();
assertEquals(100, gunData.energy, 0.01);
assertTrue(gunData.alive);
... | [FOCAL] @Override public void GunEnemy.initRound()
[CLASS] class GunEnemy extends Enemy<TimestampedFiringAngle>
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] Enemy<TimestampedFiringAngle>.initRound/0, hitLocations.clear/0
[COLLABORATORS] field hitLocations clear/0
[CLASS-MEMBERS]... | /* static context
[FOCAL] @Override public void GunEnemy.initRound()
[COLLABORATORS] field hitLocations clear/0
[CALLS-EXTERNAL] Enemy<TimestampedFiringAngle>.initRound/0, hitLocations.clear/0
*/
| /* static context
[FOCAL] @Override public void GunEnemy.initRound()
[COLLABORATORS] field hitLocations clear/0
[CALLS-EXTERNAL] Enemy<TimestampedFiringAngle>.initRound/0, hitLocations.clear/0
*/
class GunEnemy extends Enemy<TimestampedFiringAngle> {
@Override
public void initRound() {
super.initRound();
l... | true | ok | {"focal": {"class": "GunEnemy", "name": "initRound", "signature": "void initRound()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "GunEnemy", "kind": "class", "modifiers": "", "superclass": "Enemy<TimestampedFiringAngle>", "interfaces": null, "fields": ... |
40510168_72 | class PollUtils {
public static boolean poll(BooleanSupplier cond, long periodMs, long timeoutMs) {
return poll((n) -> cond.getAsBoolean(), periodMs, timeoutMs, null);
}
public static boolean poll(InterruptablePredicate<T> cond, long periodMs, long timeoutMs, T arg);
public static Optional<T> poll(Interru... | long now1 = System.currentTimeMillis();
boolean returnValue = PollUtils.poll((c) -> System.currentTimeMillis() >= now1 + c, 100, 600, 400);
Assert.assertTrue(returnValue);
long now2 = System.currentTimeMillis();
Assert.assertTrue(now2 - now1 >= 350);
}
} | [FOCAL] public static boolean PollUtils.poll(BooleanSupplier cond, long periodMs, long timeoutMs)
[CLASS] class PollUtils
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] boolean poll(InterruptablePredicate<T> cond, long periodMs, long timeoutMs, T arg)
[CALLS-EXTERNAL] BooleanSuppl... | /* static context
[FOCAL] public static boolean PollUtils.poll(BooleanSupplier cond, long periodMs, long timeoutMs)
[INPUTS] branches=- | result=cond, periodMs, timeoutMs
[COLLABORATORS] param cond:BooleanSupplier getAsBoolean/0
[CALLS-INTERNAL] boolean poll(InterruptablePredicate<T> cond, long periodMs, long timeoutMs... | /* static context
[FOCAL] public static boolean PollUtils.poll(BooleanSupplier cond, long periodMs, long timeoutMs)
[INPUTS] branches=- | result=cond, periodMs, timeoutMs
[COLLABORATORS] param cond:BooleanSupplier getAsBoolean/0
[CALLS-INTERNAL] boolean poll(InterruptablePredicate<T> cond, long periodMs, long timeoutMs... | true | ok | {"focal": {"class": "PollUtils", "name": "poll", "signature": "boolean poll(BooleanSupplier cond, long periodMs, long timeoutMs)", "start_line": 3, "modifiers": "public static", "params": [{"name": "cond", "type": "BooleanSupplier"}, {"name": "periodMs", "type": "long"}, {"name": "timeoutMs", "type": "long"}], "return_... |
40527870_200 | class DefaultBundleFilter extends MotechBundleFilter {
@Override
public boolean passesCriteria(Bundle bundle) {
return bundle != null && !isPlatformBundle(bundle) && importsExportsMotechPackage(bundle);
}
private boolean importsExportsMotechPackage(Bundle bundle);
private boolean isPlatfor... | when(headers.get(ExtendedBundleInformation.EXPORT_PACKAGE)).thenReturn(MOTECH_IMPORT_EXPORT);
when(bundle.getSymbolicName()).thenReturn("org.apache.felix.framework");
assertFalse(bundleFilter.passesCriteria(bundle));
}
} | [FOCAL] @Override public boolean DefaultBundleFilter.passesCriteria(Bundle bundle)
[CLASS] class DefaultBundleFilter extends MotechBundleFilter
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] boolean importsExportsMotechPackage(Bundle bundle); boolean isPlatformBundle(Bundle bundle... | /* static context
[FOCAL] @Override public boolean DefaultBundleFilter.passesCriteria(Bundle bundle)
[INPUTS] branches=- | result=bundle
[CALLS-INTERNAL] boolean importsExportsMotechPackage(Bundle bundle); boolean isPlatformBundle(Bundle bundle)
*/
| /* static context
[FOCAL] @Override public boolean DefaultBundleFilter.passesCriteria(Bundle bundle)
[INPUTS] branches=- | result=bundle
[CALLS-INTERNAL] boolean importsExportsMotechPackage(Bundle bundle); boolean isPlatformBundle(Bundle bundle)
*/
class DefaultBundleFilter extends MotechBundleFilter {
@Override
... | true | ok | {"focal": {"class": "DefaultBundleFilter", "name": "passesCriteria", "signature": "boolean passesCriteria(Bundle bundle)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "bundle", "type": "Bundle"}], "return_type": "boolean"}, "class_info": {"name": "DefaultBundleFilter", "kind": "class", "modifi... |
40536165_6 | class Validation extends AbsModule<Validation.ExtAsync, Validation.ExtRxJava> {
public PromotionResponse validate(ValidationContext context) throws IOException {
Map<String, String> queryParams = createQueryParamsForContext(context);
return api.validatePromotion(queryParams).execute().body();
}... | List<OrderItem> orderItems = new ArrayList<>();
orderItems.add(new OrderItem("0", "sku_0", 1, 10));
validation.validate("SAMPLE_CODE", ValidationContext.create(100, orderItems));
Map<String, String> expectedQueryParams = new LinkedHashMap<>();
expectedQueryParams.put("amount", "... | [FOCAL] public PromotionResponse Validation.validate(ValidationContext context)
[CLASS] class Validation extends AbsModule<Validation.ExtAsync, Validation.ExtRxJava>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Map<String, String> createQueryParamsForContext(ValidationContext co... | /* static context
[FOCAL] public PromotionResponse Validation.validate(ValidationContext context)
[INPUTS] branches=- | result=context, api
[COLLABORATORS] field api:VoucherifyApi validatePromotion/1
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] Map<String, String> createQueryParamsForContext(ValidationContext con... | /* static context
[FOCAL] public PromotionResponse Validation.validate(ValidationContext context)
[INPUTS] branches=- | result=context, api
[COLLABORATORS] field api:VoucherifyApi validatePromotion/1
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] Map<String, String> createQueryParamsForContext(ValidationContext con... | true | ok | {"focal": {"class": "Validation", "name": "validate", "signature": "PromotionResponse validate(ValidationContext context) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "context", "type": "ValidationContext"}], "return_type": "PromotionResponse"}, "class_info": {"name": "Validation", "... |
40538806_4 | class MeasurementUnit {
public static MeasurementUnit getFromLocale(Locale locale) {
String countryCode = locale.getCountry();
ArrayList<String> countriesUsingImperial
= new ArrayList<>(Arrays.asList(Locale.US.getCountry()));
if (countriesUsingImperial.contains(countryCode... | assertEquals(MeasurementUnit.getFromLocale(Locale.US), MeasurementUnit.Imperial);
assertEquals(MeasurementUnit.getFromLocale(Locale.JAPAN), MeasurementUnit.Metric);
assertEquals(MeasurementUnit.getFromLocale(Locale.FRANCE), MeasurementUnit.Metric);
}
} | [FOCAL] public static MeasurementUnit MeasurementUnit.getFromLocale(Locale locale)
[CLASS] class MeasurementUnit
[METRICS] loc=12 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] Locale.getCountry/0, Arrays.asList/1, Locale.US.getCountry/0, ArrayList<String>.contains/1
[NEW] ArrayList<>
[PATH1] if(... | /* static context
[FOCAL] public static MeasurementUnit MeasurementUnit.getFromLocale(Locale locale)
[PATH1] if(countriesUsingImperial.contains(countryCode))=T -> return Imperial
[PATH2] if(countriesUsingImperial.contains(countryCode))=F -> return Metric
[INPUTS] branches=locale | result=-
[COLLABORATORS] param locale:... | /* static context
[FOCAL] public static MeasurementUnit MeasurementUnit.getFromLocale(Locale locale)
[PATH1] if(countriesUsingImperial.contains(countryCode))=T -> return Imperial
[PATH2] if(countriesUsingImperial.contains(countryCode))=F -> return Metric
[INPUTS] branches=locale | result=-
[COLLABORATORS] param locale:... | true | ok | {"focal": {"class": "MeasurementUnit", "name": "getFromLocale", "signature": "MeasurementUnit getFromLocale(Locale locale)", "start_line": 3, "modifiers": "public static", "params": [{"name": "locale", "type": "Locale"}], "return_type": "MeasurementUnit"}, "class_info": {"name": "MeasurementUnit", "kind": "class", "mod... |
40541952_2 | class ScriptTools {
public static boolean testScript (byte[] script, byte[] template, byte[]... parameters) {
Script s = new Script(script);
List<ScriptChunk> chunks = s.getChunks();
int parameter = 0;
for (int i = 0; i < chunks.size(); i++) {
boolean correct = false;... | //Changed one byte of the original sequence
byte[] script = Tools.hexStringToByteArray
("A905AABBCCDDEE87630C049284008271007438924817570408796688527C1D0987093827AA980083A9FF89113947892811990283990428406678096552AE");
byte[] p1 = Tools.hexStringToByteArray("aa bb cc dd ee");
... | [FOCAL] public static boolean ScriptTools.testScript(byte[] script, byte[] template, byte[]... parameters)
[CLASS] class ScriptTools
[METRICS] loc=36 cc=8 branches=6 loops=1 returns=2 throws=0 nesting=4
[CALLS-EXTERNAL] Script.getChunks/0, List<ScriptChunk>.size/0, List<ScriptChunk>.get/1, ScriptChunk.isPushData/0, Arr... | /* static context
[FOCAL] public static boolean ScriptTools.testScript(byte[] script, byte[] template, byte[]... parameters)
[PATH1] for(i < chunks.size())=T -> if(op < 0)=T -> if(op == 255)=T -> if(chunk.isPushData())=T -> if(Arrays.equals(chunk.data, parameters[parameter]))=T -> if(!correct)=F -> exit loop -> return ... | /* static context
[FOCAL] public static boolean ScriptTools.testScript(byte[] script, byte[] template, byte[]... parameters)
[PATH1] for(i < chunks.size())=T -> if(op < 0)=T -> if(op == 255)=T -> if(chunk.isPushData())=T -> if(Arrays.equals(chunk.data, parameters[parameter]))=T -> if(!correct)=F -> exit loop -> return ... | true | ok | {"focal": {"class": "ScriptTools", "name": "testScript", "signature": "boolean testScript(byte[] script, byte[] template, byte[]... parameters)", "start_line": 3, "modifiers": "public static", "params": [{"name": "script", "type": "byte[]"}, {"name": "template", "type": "byte[]"}, {"name": "parameters", "type": "byte[]... |
40557971_13 | class MainPresenter implements Callback<SearchResult>, BarcodeListener {
@Subscribe
@SuppressWarnings("WeakerAccess")
public void productDetailsFragmentDismissed(@SuppressWarnings("UnusedParameters") ProductDetailsFragmentDismissedEvent event) {
viewBinder.dismissProductDetailsView();
}
... | presenter.productDetailsFragmentDismissed(null);
verify(viewBinder).dismissProductDetailsView();
}
} | [FOCAL] @Subscribe @SuppressWarnings("WeakerAccess") public void MainPresenter.productDetailsFragmentDismissed(ProductDetailsFragmentDismissedEvent event)
[CLASS] class MainPresenter implements Callback<SearchResult>, BarcodeListener
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] ... | /* static context
[FOCAL] @Subscribe @SuppressWarnings("WeakerAccess") public void MainPresenter.productDetailsFragmentDismissed(ProductDetailsFragmentDismissedEvent event)
[INPUTS] branches=- | result=- | unused=event
[COLLABORATORS] field viewBinder:MainViewBinder dismissProductDetailsView/0
[FIELDS] read=viewBinder:... | /* static context
[FOCAL] @Subscribe @SuppressWarnings("WeakerAccess") public void MainPresenter.productDetailsFragmentDismissed(ProductDetailsFragmentDismissedEvent event)
[INPUTS] branches=- | result=- | unused=event
[COLLABORATORS] field viewBinder:MainViewBinder dismissProductDetailsView/0
[FIELDS] read=viewBinder:... | true | ok | {"focal": {"class": "MainPresenter", "name": "productDetailsFragmentDismissed", "signature": "void productDetailsFragmentDismissed(ProductDetailsFragmentDismissedEvent event)", "start_line": 3, "modifiers": "@Subscribe @SuppressWarnings(\"WeakerAccess\") public", "params": [{"name": "event", "type": "ProductDetailsFrag... |
40563017_0 | class Serialization {
private Yaml yaml()
{
return this.cachedYaml.get();
}
private Serialization(@Nullable Void v);
public CommentsManager getCommentsManager();
private Yaml createYaml();
private Gson gson();
public void addTrueValues(String... strings);
public void addF... | Serialization global = prepareSerialization();
EntityStorage entityStorage = prepareObject();
System.out.println("[YAML] Deserializing javabean: \n");
{
String toYaml = global.toYaml(entityStorage.beanObject);
System.out.println(toYaml);
Assert.asser... | [FOCAL] private Yaml Serialization.yaml()
[CLASS] class Serialization
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] this.cachedYaml.get/0
[FIELDS] read=cachedYaml
[COLLABORATORS] field cachedYaml get/0
[CLASS-MEMBERS] Serialization(Void v); CommentsManager getCommentsManager(); Y... | /* static context
[FOCAL] private Yaml Serialization.yaml()
[COLLABORATORS] field cachedYaml get/0
[FIELDS] read=cachedYaml
[CALLS-EXTERNAL] this.cachedYaml.get/0
*/
| /* static context
[FOCAL] private Yaml Serialization.yaml()
[COLLABORATORS] field cachedYaml get/0
[FIELDS] read=cachedYaml
[CALLS-EXTERNAL] this.cachedYaml.get/0
*/
class Serialization {
private Yaml yaml()
{
return this.cachedYaml.get();
}
private Serialization(@Nullable Void v);
publi... | true | ok | {"focal": {"class": "Serialization", "name": "yaml", "signature": "Yaml yaml()", "start_line": 3, "modifiers": "private", "params": [], "return_type": "Yaml"}, "class_info": {"name": "Serialization", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "configManager", "type": "... |
40563645_11 | class ItemIdComposer {
public static boolean isExpandableGroup(long composedId) {
return (composedId != RecyclerView.NO_ID) && ((composedId & BIT_MASK_CHILD_ID) == BIT_MASK_CHILD_ID);
}
private ItemIdComposer();
public static long composeExpandableChildId(@IntRange(from = MIN_GROUP_ID, to = ... | // zero
assertThat(ItemIdComposer.isExpandableGroup(0L), is(false));
// NO_ID
assertThat(ItemIdComposer.isExpandableGroup(RecyclerView.NO_ID), is(false));
// not group - 1
assertThat(ItemIdComposer.isExpandableGroup(ItemIdComposer.BIT_MASK_CHILD_ID >> 1), is(false));
... | [FOCAL] public static boolean ItemIdComposer.isExpandableGroup(long composedId)
[CLASS] class ItemIdComposer
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[INPUTS] branches=- | result=composedId
[DATAFLOW] composedId@param->L2
[CLASS-MEMBERS] ItemIdComposer(); long composeExpandableChildId(long g... | /* static context
[FOCAL] public static boolean ItemIdComposer.isExpandableGroup(long composedId)
[INPUTS] branches=- | result=composedId
*/
| /* static context
[FOCAL] public static boolean ItemIdComposer.isExpandableGroup(long composedId)
[INPUTS] branches=- | result=composedId
*/
class ItemIdComposer {
public static boolean isExpandableGroup(long composedId) {
return (composedId != RecyclerView.NO_ID) && ((composedId & BIT_MASK_CHILD_ID) == BI... | true | ok | {"focal": {"class": "ItemIdComposer", "name": "isExpandableGroup", "signature": "boolean isExpandableGroup(long composedId)", "start_line": 3, "modifiers": "public static", "params": [{"name": "composedId", "type": "long"}], "return_type": "boolean"}, "class_info": {"name": "ItemIdComposer", "kind": "class", "modifiers... |
40605386_2 | class MDNSDiscover {
static Result decode(byte[] packet, int packetLength) throws IOException {
Result result = new Result();
decode(packet, packetLength, result);
return result;
}
private static byte[] discoverPacket(String serviceType);
static byte[] queryPacket(String servic... | byte[] packet = createReplyPacket();
Result r = decode(packet, packet.length);
// check A record
assertEquals("192.168.1.100", r.a.ipaddr);
assertEquals("dev0123456789.local", r.a.fqdn);
assertEquals(10, r.a.ttl);
// check SRV record
assertEquals(0, r.sr... | [FOCAL] static Result MDNSDiscover.decode(byte[] packet, int packetLength)
[CLASS] class MDNSDiscover
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] void decode(byte[] packet, int packetLength, Result result)
[NEW] Result
[EXCEPTIONS] declares IOException
[DATAFLOW] packet@param->... | /* static context
[FOCAL] static Result MDNSDiscover.decode(byte[] packet, int packetLength)
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] void decode(byte[] packet, int packetLength, Result result)
[NEW] Result
*/
| /* static context
[FOCAL] static Result MDNSDiscover.decode(byte[] packet, int packetLength)
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] void decode(byte[] packet, int packetLength, Result result)
[NEW] Result
*/
class MDNSDiscover {
static Result decode(byte[] packet, int packetLength) throws IOException {... | true | ok | {"focal": {"class": "MDNSDiscover", "name": "decode", "signature": "Result decode(byte[] packet, int packetLength) throws IOException", "start_line": 3, "modifiers": "static", "params": [{"name": "packet", "type": "byte[]"}, {"name": "packetLength", "type": "int"}], "return_type": "Result"}, "class_info": {"name": "MDN... |
40616171_1 | class Waiter {
public boolean wake() {
synchronized (lock) {
if (!isWaiting) {
return false;
} else {
woken = true;
lock.notify();
return true;
}
}
}
public Waiter(Duration duration);
p... | Waiter waiter = new Waiter(Duration.ofMillis(1000));
Future<Long> waitTime = executor.submit(new WaitForWaiter(waiter));
sleep(20); // give executor time to get to wait(..)
waiter.wake();
assertTrue(waitTime.get() < 100L, "Waited: " + waitTime.get());
Future<Long> waitT... | [FOCAL] public boolean Waiter.wake()
[CLASS] class Waiter
[METRICS] loc=11 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] lock.notify/0
[PATH1] if(!isWaiting)=T -> return false
[PATH2] if(!isWaiting)=F -> return true
[COLLABORATORS] field lock notify/0
[CLASS-MEMBERS] Waiter(Duration duration); W... | /* static context
[FOCAL] public boolean Waiter.wake()
[PATH1] if(!isWaiting)=T -> return false
[PATH2] if(!isWaiting)=F -> return true
[COLLABORATORS] field lock notify/0
[CALLS-EXTERNAL] lock.notify/0
*/
| /* static context
[FOCAL] public boolean Waiter.wake()
[PATH1] if(!isWaiting)=T -> return false
[PATH2] if(!isWaiting)=F -> return true
[COLLABORATORS] field lock notify/0
[CALLS-EXTERNAL] lock.notify/0
*/
class Waiter {
public boolean wake() {
synchronized (lock) {
if (!isWaiting) {
... | true | ok | {"focal": {"class": "Waiter", "name": "wake", "signature": "boolean wake()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "Waiter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "executor", "type": "ExecutorServic... |
40628209_514 | class ParseFacebookUtils {
public static Task<Void> unlinkInBackground(ParseUser user) {
checkInitialization();
return user.unlinkFromInBackground(AUTH_TYPE);
}
private ParseFacebookUtils();
public static boolean isLinked(ParseUser user);
public static void initialize(Context con... | ParseUser user = mock(ParseUser.class);
when(user.unlinkFromInBackground(anyString())).thenReturn(Task.<Void>forResult(null));
ParseFacebookUtils.isInitialized = true;
ParseFacebookUtils.unlinkInBackground(user);
verify(user).unlinkFromInBackground("facebook");
}
} | [FOCAL] public static Task<Void> ParseFacebookUtils.unlinkInBackground(ParseUser user)
[CLASS] class ParseFacebookUtils
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] void checkInitialization()
[CALLS-EXTERNAL] ParseUser.unlinkFromInBackground/1
[INPUTS] branches=- | result=user
[... | /* static context
[FOCAL] public static Task<Void> ParseFacebookUtils.unlinkInBackground(ParseUser user)
[INPUTS] branches=- | result=user
[COLLABORATORS] param user:ParseUser unlinkFromInBackground/1
[CALLS-INTERNAL] void checkInitialization()
[CALLS-EXTERNAL] ParseUser.unlinkFromInBackground/1
*/
| /* static context
[FOCAL] public static Task<Void> ParseFacebookUtils.unlinkInBackground(ParseUser user)
[INPUTS] branches=- | result=user
[COLLABORATORS] param user:ParseUser unlinkFromInBackground/1
[CALLS-INTERNAL] void checkInitialization()
[CALLS-EXTERNAL] ParseUser.unlinkFromInBackground/1
*/
class ParseFacebookU... | true | ok | {"focal": {"class": "ParseFacebookUtils", "name": "unlinkInBackground", "signature": "Task<Void> unlinkInBackground(ParseUser user)", "start_line": 3, "modifiers": "public static", "params": [{"name": "user", "type": "ParseUser"}], "return_type": "Task<Void>"}, "class_info": {"name": "ParseFacebookUtils", "kind": "clas... |
40667226_1 | class LoginActivity extends BaseActivity {
public boolean check() {
if (name.getText().toString().equals("")) {
nameLayout.setError(getString(R.string.empty_username));
return false;
}
if (pwd.getText().toString().equals("")) {
passwordLayout.setError(get... | emailEditText.setText("username");
activity.findViewById(R.id.login_submit).performClick();
assert(!activity.check());
}
} | [FOCAL] public boolean LoginActivity.check()
[CLASS] class LoginActivity extends BaseActivity
[METRICS] loc=11 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[CALLS-EXTERNAL] name.getText().toString().equals/1, name.getText().toString/0, name.getText/0, nameLayout.setError/1, getString/1 (inherited), pwd.getText(... | /* static context
[FOCAL] public boolean LoginActivity.check()
[PATH1] if(name.getText().toString().equals(""))=F -> if(pwd.getText().toString().equals(""))=T -> return false
[PATH2] if(name.getText().toString().equals(""))=F -> if(pwd.getText().toString().equals(""))=F -> return true
[PATH3] if(name.getText().toString... | /* static context
[FOCAL] public boolean LoginActivity.check()
[PATH1] if(name.getText().toString().equals(""))=F -> if(pwd.getText().toString().equals(""))=T -> return false
[PATH2] if(name.getText().toString().equals(""))=F -> if(pwd.getText().toString().equals(""))=F -> return true
[PATH3] if(name.getText().toString... | true | ok | {"focal": {"class": "LoginActivity", "name": "check", "signature": "boolean check()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "LoginActivity", "kind": "class", "modifiers": "", "superclass": "BaseActivity", "interfaces": null, "fields": [{"name": "activity... |
40695309_7 | class Path implements Iterable<Path> {
public boolean isLast()
{
if(isRoot()) return true;
return (pathElements.length <= 1);
}
public Path();
public Path(String path);
private Path(String[] pathElements);
public String[] getPathElements();
public String getFirstEle... | Path instance = new Path("/www");
boolean result = instance.isLast();
assertEquals(true, result);
}
} | [FOCAL] public boolean Path.isLast()
[CLASS] class Path implements Iterable<Path>
[METRICS] loc=5 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] boolean isRoot()
[PATH1] if(isRoot())=T -> return true
[PATH2] if(isRoot())=F -> return (pathElements.length <= 1)
[CLASS-MEMBERS] Path(); Path(String p... | /* static context
[FOCAL] public boolean Path.isLast()
[PATH1] if(isRoot())=T -> return true
[PATH2] if(isRoot())=F -> return (pathElements.length <= 1)
[CALLS-INTERNAL] boolean isRoot()
*/
| /* static context
[FOCAL] public boolean Path.isLast()
[PATH1] if(isRoot())=T -> return true
[PATH2] if(isRoot())=F -> return (pathElements.length <= 1)
[CALLS-INTERNAL] boolean isRoot()
*/
class Path implements Iterable<Path> {
public boolean isLast()
{
if(isRoot()) return true;
return (pathEl... | true | ok | {"focal": {"class": "Path", "name": "isLast", "signature": "boolean isLast()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "Path", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Iterable<Path>", "fields": [], "members": [{"name": "Path", ... |
40712527_0 | class CompanyService {
public String add(Company companyDto) {
Company company = new Company();
company.setName(companyDto.getName());
company.setAddress(companyDto.getAddress());
company.setHeadcount(companyDto.getHeadcount());
company.setStatus(Status.OPEN);
Company result = companyRepository.save... | Company companyDto = new Company();
companyDto.setName("plantlink");
companyDto.setAddress("westlake");
companyDto.setHeadcount(2);
String id = companyService.add(companyDto);
Assert.assertNotNull(id);
}
} | [FOCAL] public String CompanyService.add(Company companyDto)
[CLASS] class CompanyService
[METRICS] loc=12 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Company.setName/1, Company.getName/0, Company.setAddress/1, Company.getAddress/0, Company.setHeadcount/1, Company.getHeadcount/0, Company.setSt... | /* static context
[FOCAL] public String CompanyService.add(Company companyDto)
[COLLABORATORS] param companyDto:Company getName/0,getAddress/0,getHeadcount/0; field companyRepository save/1
[NEW] Company
[CALLS-EXTERNAL] Company.setName/1, Company.getName/0, Company.setAddress/1, Company.getAddress/0, Company.setHeadco... | /* static context
[FOCAL] public String CompanyService.add(Company companyDto)
[COLLABORATORS] param companyDto:Company getName/0,getAddress/0,getHeadcount/0; field companyRepository save/1
[NEW] Company
[CALLS-EXTERNAL] Company.setName/1, Company.getName/0, Company.setAddress/1, Company.getAddress/0, Company.setHeadco... | true | ok | {"focal": {"class": "CompanyService", "name": "add", "signature": "String add(Company companyDto)", "start_line": 3, "modifiers": "public", "params": [{"name": "companyDto", "type": "Company"}], "return_type": "String"}, "class_info": {"name": "CompanyService", "kind": "class", "modifiers": "", "superclass": null, "int... |
40714460_5 | class ServiceMethodInvoker {
public Flux<ServiceMessage> invokeBidirectional(Publisher<ServiceMessage> publisher) {
return Flux.from(publisher)
.switchOnFirst(
(first, messages) ->
Mono.deferWithContext(context -> authenticate(first.get(), context))
.flatMa... | final String methodName = "throwException3";
final Class<? extends StubService> serviceClass = stubService.getClass();
final Method method = serviceClass.getMethod(methodName, Flux.class);
final MethodInfo methodInfo =
new MethodInfo(
serviceClass.getName(),
methodName,
... | [FOCAL] public Flux<ServiceMessage> ServiceMethodInvoker.invokeBidirectional(Publisher<ServiceMessage> publisher)
[CLASS] class ServiceMethodInvoker
[METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Flux<?> deferWithContextBidirectional(Flux<ServiceMessage> messages, Object authData... | /* static context
[FOCAL] public Flux<ServiceMessage> ServiceMethodInvoker.invokeBidirectional(Publisher<ServiceMessage> publisher)
[INPUTS] branches=- | result=publisher
[COLLABORATORS] field first get/0; field errorMapper toMessage/2
[CALLS-INTERNAL] Flux<?> deferWithContextBidirectional(Flux<ServiceMessage> messages... | /* static context
[FOCAL] public Flux<ServiceMessage> ServiceMethodInvoker.invokeBidirectional(Publisher<ServiceMessage> publisher)
[INPUTS] branches=- | result=publisher
[COLLABORATORS] field first get/0; field errorMapper toMessage/2
[CALLS-INTERNAL] Flux<?> deferWithContextBidirectional(Flux<ServiceMessage> messages... | true | ok | {"focal": {"class": "ServiceMethodInvoker", "name": "invokeBidirectional", "signature": "Flux<ServiceMessage> invokeBidirectional(Publisher<ServiceMessage> publisher)", "start_line": 3, "modifiers": "public", "params": [{"name": "publisher", "type": "Publisher<ServiceMessage>"}], "return_type": "Flux<ServiceMessage>"},... |
40737618_12 | class PrizePresenter extends RxPresenter<PrizeView, ArrayList<Prize> > implements Comparator<Prize> {
@Override void onNext(ArrayList<Prize> prizes) {
Collections.sort(prizes, this);
if (isViewAttached()) {
getView().showPrizes(prizes);
}
}
public void updatePrizes();
... | ArrayList<Prize> prizes = new ArrayList<>();
prizes.add(new Prize());
presenter.onNext(prizes);
verify(view).showPrizes(prizes);
}
} | [FOCAL] @Override void PrizePresenter.onNext(ArrayList<Prize> prizes)
[CLASS] class PrizePresenter extends RxPresenter<PrizeView, ArrayList<Prize> > implements Comparator<Prize>
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] Collections.sort/2, isViewAttached/0 (inherited), getVie... | /* static context
[FOCAL] @Override void PrizePresenter.onNext(ArrayList<Prize> prizes)
[PATH1] if(isViewAttached())=T
[PATH2] if(isViewAttached())=F
[CALLS-EXTERNAL] Collections.sort/2, isViewAttached/0 (inherited), getView().showPrizes/1, getView/0 (inherited)
*/
| /* static context
[FOCAL] @Override void PrizePresenter.onNext(ArrayList<Prize> prizes)
[PATH1] if(isViewAttached())=T
[PATH2] if(isViewAttached())=F
[CALLS-EXTERNAL] Collections.sort/2, isViewAttached/0 (inherited), getView().showPrizes/1, getView/0 (inherited)
*/
class PrizePresenter extends RxPresenter<PrizeView, Ar... | true | ok | {"focal": {"class": "PrizePresenter", "name": "onNext", "signature": "void onNext(ArrayList<Prize> prizes)", "start_line": 3, "modifiers": "@Override", "params": [{"name": "prizes", "type": "ArrayList<Prize>"}], "return_type": "void"}, "class_info": {"name": "PrizePresenter", "kind": "class", "modifiers": "", "supercla... |
40753051_36 | class Transformers {
public byte[] transformAsBytes(Source input, Format format) throws TransformerException {
return transformAsBytes(input, format, Collections.<String, Object>emptyMap());
}
public Source transform(Source input, Format format);
public Source transform(Source input, Format fo... | InputStream goldenIS = TransformersTest.class.getResourceAsStream("alephXServerDetailResponseAsMarcXml.xml");
assertNotNull(goldenIS);
InputStream xmlIS = TransformersTest.class.getResourceAsStream("alephXServerDetailResponseAsOaiMarc.xml");
assertNotNull(xmlIS);
StreamSource str... | [FOCAL] public byte[] Transformers.transformAsBytes(Source input, Format format)
[CLASS] class Transformers
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] byte[] transformAsBytes(Source input, Format format, Map<String, Object> params)
[CALLS-EXTERNAL] Collections.emptyMap/0
[EXCE... | /* static context
[FOCAL] public byte[] Transformers.transformAsBytes(Source input, Format format)
[INPUTS] branches=- | result=format, input
[EXCEPTIONS] declares TransformerException
[CALLS-INTERNAL] byte[] transformAsBytes(Source input, Format format, Map<String, Object> params)
[CALLS-EXTERNAL] Collections.emptyMap... | /* static context
[FOCAL] public byte[] Transformers.transformAsBytes(Source input, Format format)
[INPUTS] branches=- | result=format, input
[EXCEPTIONS] declares TransformerException
[CALLS-INTERNAL] byte[] transformAsBytes(Source input, Format format, Map<String, Object> params)
[CALLS-EXTERNAL] Collections.emptyMap... | true | ok | {"focal": {"class": "Transformers", "name": "transformAsBytes", "signature": "byte[] transformAsBytes(Source input, Format format) throws TransformerException", "start_line": 3, "modifiers": "public", "params": [{"name": "input", "type": "Source"}, {"name": "format", "type": "Format"}], "return_type": "byte[]"}, "class... |
40762184_0 | class ExceptionUtils {
public static void insertMessage(Throwable onObject, String msg) {
try {
Field field = Throwable.class.getDeclaredField("detailMessage"); //Method("initCause", new Class[]{Throwable.class});
field.setAccessible(true);
if (onObject.getMessage() != n... | "and the original message must not be deleted"
}
)
@Test
public void testInsertMessage() throws Exception {
final RuntimeException exception = new RuntimeException(MESSAGE);
insertMessage(exception, NEW_MESSAGE);
assertTrue(exception.getMessage().con... | [FOCAL] public static void ExceptionUtils.insertMessage(Throwable onObject, String msg)
[CLASS] class ExceptionUtils
[METRICS] loc=14 cc=4 branches=1 loops=0 returns=0 throws=1 nesting=2
[CALLS-EXTERNAL] Throwable.class.getDeclaredField/1, Field.setAccessible/1, Throwable.getMessage/0, Field.set/2
[EXCEPTIONS] throws t... | /* static context
[FOCAL] public static void ExceptionUtils.insertMessage(Throwable onObject, String msg)
[THROWS-WHEN] e when try-body throws
[PATH1] try-body throws -> throw e
[PATH2] if(onObject.getMessage() != null)=T
[PATH3] if(onObject.getMessage() != null)=F
[INPUTS] branches=onObject | result=-
[COLLABORATORS] ... | /* static context
[FOCAL] public static void ExceptionUtils.insertMessage(Throwable onObject, String msg)
[THROWS-WHEN] e when try-body throws
[PATH1] try-body throws -> throw e
[PATH2] if(onObject.getMessage() != null)=T
[PATH3] if(onObject.getMessage() != null)=F
[INPUTS] branches=onObject | result=-
[COLLABORATORS] ... | true | ok | {"focal": {"class": "ExceptionUtils", "name": "insertMessage", "signature": "void insertMessage(Throwable onObject, String msg)", "start_line": 3, "modifiers": "public static", "params": [{"name": "onObject", "type": "Throwable"}, {"name": "msg", "type": "String"}], "return_type": "void"}, "class_info": {"name": "Excep... |
40763113_5 | class MergingException extends Exception {
public static void throwIfNonEmpty(Collection<Message> messages) throws MergingException {
if (!messages.isEmpty()) {
throw new MergingException(null, Iterables.toArray(messages, Message.class));
}
}
protected MergingException(@Nullab... | MergingException.throwIfNonEmpty(ImmutableList.<Message>of());
try {
MergingException.throwIfNonEmpty(ImmutableList.<Message>of(
new Message(Message.Kind.ERROR, "Message", SourceFilePosition.UNKNOWN)));
fail();
} catch (MergingException e) {
... | [FOCAL] public static void MergingException.throwIfNonEmpty(Collection<Message> messages)
[CLASS] class MergingException extends Exception
[METRICS] loc=5 cc=2 branches=1 loops=0 returns=0 throws=1 nesting=1
[CALLS-EXTERNAL] Collection<Message>.isEmpty/0, Iterables.toArray/2
[NEW] MergingException
[EXCEPTIONS] declares... | /* static context
[FOCAL] public static void MergingException.throwIfNonEmpty(Collection<Message> messages)
[THROWS-WHEN] MergingException when !messages.isEmpty()
[PATH1] if(!messages.isEmpty())=T -> throw new MergingException(null, Iterables.toArray(messages, Message.class))
[PATH2] if(!messages.isEmpty())=F
[INPUTS]... | /* static context
[FOCAL] public static void MergingException.throwIfNonEmpty(Collection<Message> messages)
[THROWS-WHEN] MergingException when !messages.isEmpty()
[PATH1] if(!messages.isEmpty())=T -> throw new MergingException(null, Iterables.toArray(messages, Message.class))
[PATH2] if(!messages.isEmpty())=F
[INPUTS]... | true | ok | {"focal": {"class": "MergingException", "name": "throwIfNonEmpty", "signature": "void throwIfNonEmpty(Collection<Message> messages) throws MergingException", "start_line": 3, "modifiers": "public static", "params": [{"name": "messages", "type": "Collection<Message>"}], "return_type": "void"}, "class_info": {"name": "Me... |
40779062_1 | class ClassMatcher {
static boolean matchesAsInnerClass(String classFqn, List<String> fqns) {
for (String fqn : fqns) {
if (classFqn.startsWith(fqn + "$")) {
return true;
}
}
return false;
}
private ClassMatcher();
static boolean anyMatchesAsClassOrPackage(List<String> classFqns, List<String> f... | assertTrue(ClassMatcher.matchesAsInnerClass("hu.awm.MyClass$InnerClass", Collections.singletonList("hu.awm.MyClass")));
assertTrue(ClassMatcher.matchesAsInnerClass("hu.awm.MyClass$InnerClass$InnerInnerClass", Collections.singletonList("hu.awm.MyClass")));
assertTrue(ClassMatcher.matchesAsInnerClass("hu.awm.MyClas... | [FOCAL] static boolean ClassMatcher.matchesAsInnerClass(String classFqn, List<String> fqns)
[CLASS] class ClassMatcher
[METRICS] loc=9 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] String.startsWith/1
[PATH1] foreach(String fqn : fqns)=T -> if(classFqn.startsWith(fqn + "$"))=F -> exit loop -> re... | /* static context
[FOCAL] static boolean ClassMatcher.matchesAsInnerClass(String classFqn, List<String> fqns)
[PATH1] foreach(String fqn : fqns)=T -> if(classFqn.startsWith(fqn + "$"))=F -> exit loop -> return false
[PATH2] foreach(String fqn : fqns)=T -> if(classFqn.startsWith(fqn + "$"))=T -> return true
[PATH3] fore... | /* static context
[FOCAL] static boolean ClassMatcher.matchesAsInnerClass(String classFqn, List<String> fqns)
[PATH1] foreach(String fqn : fqns)=T -> if(classFqn.startsWith(fqn + "$"))=F -> exit loop -> return false
[PATH2] foreach(String fqn : fqns)=T -> if(classFqn.startsWith(fqn + "$"))=T -> return true
[PATH3] fore... | true | ok | {"focal": {"class": "ClassMatcher", "name": "matchesAsInnerClass", "signature": "boolean matchesAsInnerClass(String classFqn, List<String> fqns)", "start_line": 3, "modifiers": "static", "params": [{"name": "classFqn", "type": "String"}, {"name": "fqns", "type": "List<String>"}], "return_type": "boolean"}, "class_info"... |
40780878_15 | class JSONRulesDefinition implements RulesDefinition {
@Override
public void define(Context context) {
NewRepository repository = context
.createRepository(JSONLanguage.KEY, JSONLanguage.KEY)
.setName(CheckList.REPOSITORY_NAME);
new AnnotationBasedRulesDefinition(repository, JSONLanguage.KEY).... | JSONRulesDefinition rulesDefinition = new JSONRulesDefinition();
RulesDefinition.Context context = new RulesDefinition.Context();
rulesDefinition.define(context);
RulesDefinition.Repository repository = context.repository("json");
assertThat(repository.name()).isEqualTo("SonarQube");
assertThat... | [FOCAL] @Override public void JSONRulesDefinition.define(Context context)
[CLASS] class JSONRulesDefinition implements RulesDefinition
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] context .createRepository(JSONLanguage.KEY, JSONLanguage.....setName/1, Context.createRepository/2,... | /* static context
[FOCAL] @Override public void JSONRulesDefinition.define(Context context)
[COLLABORATORS] param context:Context createRepository/2
[NEW] AnnotationBasedRulesDefinition
[CALLS-EXTERNAL] context .createRepository(JSONLanguage.KEY, JSONLanguage.....setName/1, Context.createRepository/2, new AnnotationBas... | /* static context
[FOCAL] @Override public void JSONRulesDefinition.define(Context context)
[COLLABORATORS] param context:Context createRepository/2
[NEW] AnnotationBasedRulesDefinition
[CALLS-EXTERNAL] context .createRepository(JSONLanguage.KEY, JSONLanguage.....setName/1, Context.createRepository/2, new AnnotationBas... | true | ok | {"focal": {"class": "JSONRulesDefinition", "name": "define", "signature": "void define(Context context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "context", "type": "Context"}], "return_type": "void"}, "class_info": {"name": "JSONRulesDefinition", "kind": "class", "modifiers": "", "supercl... |
40961773_3 | class PatternsGenerator implements ResourceGenerator<Context> {
@NotNull
@Override
public String create(@NotNull final Context context) {
final Document doc = myDocumentManager.createDocument();
final Element patternsElement = doc.createElement(PATTERNS_ELEMENT);
String thresholdsStr = myParametersSe... | // Given
String expectedContent = "<Patterns>" +
"<Pattern>Method1</Pattern>" +
"<Pattern>Method2</Pattern>" +
"</Patterns>";
final CommandLineSetup setup = new CommandLineSetup("tool", Collections.<CommandLineArgument>e... | [FOCAL] @NotNull @Override public String PatternsGenerator.create(Context context)
[CLASS] class PatternsGenerator implements ResourceGenerator<Context>
[METRICS] loc=17 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] Element createSimpleElement(Document doc, String name, String value)
[CALLS-EXTE... | /* static context
[FOCAL] @NotNull @Override public String PatternsGenerator.create(Context context)
[PATH1] if(!StringUtil.isEmptyOrSpaces(thresholdsStr))=T -> foreach(Metric metric : metrics.getMetrics())=T -> exit loop -> return myDocumentManager.convertDocumentToString(doc, Collections.<String,...
[PATH2] if(!Strin... | /* static context
[FOCAL] @NotNull @Override public String PatternsGenerator.create(Context context)
[PATH1] if(!StringUtil.isEmptyOrSpaces(thresholdsStr))=T -> foreach(Metric metric : metrics.getMetrics())=T -> exit loop -> return myDocumentManager.convertDocumentToString(doc, Collections.<String,...
[PATH2] if(!Strin... | true | ok | {"focal": {"class": "PatternsGenerator", "name": "create", "signature": "String create(Context context)", "start_line": 3, "modifiers": "@NotNull @Override public", "params": [{"name": "context", "type": "Context"}], "return_type": "String"}, "class_info": {"name": "PatternsGenerator", "kind": "class", "modifiers": "",... |
40970642_3 | class DrawingService {
public static Draw drawNumbers(LocalDate date) {
Random random = new Random(date.toEpochDay());
Draw.DrawBuilder builder = Draw.builder().withDate(date);
do {
Integer number = random.nextInt(MAX_NUMBER_IN_DRAW + 1);
if (number < MIN_NUMBER_IN_D... | LocalDate date = LocalDate.parse("2012-01-01");
LocalDate maxDate = LocalDate.parse("2013-01-01");
while (true) {
Draw draw = DrawingService.drawNumbers(date);
if (draw.getNumbers().contains(49)) {
break;
}
date = date.plusDays(1);
... | [FOCAL] public static Draw DrawingService.drawNumbers(LocalDate date)
[CLASS] class DrawingService
[METRICS] loc=15 cc=4 branches=2 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] LocalDate.toEpochDay/0, Draw.builder().withDate/1, Draw.builder/0, Random.nextInt/1, Draw.DrawBuilder.contains/1, Draw.DrawBuilder.wit... | /* static context
[FOCAL] public static Draw DrawingService.drawNumbers(LocalDate date)
[PATH1] if(number < MIN_NUMBER_IN_DRAW)=F -> if(builder.contains(number))=T -> do_while(!builder.isComplete())=F -> return builder.build()
[PATH2] if(number < MIN_NUMBER_IN_DRAW)=T -> do_while(!builder.isComplete())=F -> return buil... | /* static context
[FOCAL] public static Draw DrawingService.drawNumbers(LocalDate date)
[PATH1] if(number < MIN_NUMBER_IN_DRAW)=F -> if(builder.contains(number))=T -> do_while(!builder.isComplete())=F -> return builder.build()
[PATH2] if(number < MIN_NUMBER_IN_DRAW)=T -> do_while(!builder.isComplete())=F -> return buil... | true | ok | {"focal": {"class": "DrawingService", "name": "drawNumbers", "signature": "Draw drawNumbers(LocalDate date)", "start_line": 3, "modifiers": "public static", "params": [{"name": "date", "type": "LocalDate"}], "return_type": "Draw"}, "class_info": {"name": "DrawingService", "kind": "class", "modifiers": "", "superclass":... |
40976537_0 | class CachingService {
public boolean exists(String name) {
return cache.containsValue(name);
}
public CachingService(RemoteCache<String, String> cache);
public CachingService(RemoteCacheManager cacheManager);
public void storeName(String id, String name);
@RegisterExtension
static Infi... | // Grab the cache created in the context of this test
RemoteCache<String, String> cache = infinispanServerExtension.hotrod().create();
// Put some data in the cache
cache.put("123", "Mickey");
cache.put("456", "Donald");
// Create the CachingService, using the cache created in the ... | [FOCAL] public boolean CachingService.exists(String name)
[CLASS] class CachingService
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] cache.containsValue/1
[INPUTS] branches=- | result=name
[COLLABORATORS] field cache containsValue/1
[DATAFLOW] name@param->L2
[CLASS-MEMBERS] Cachi... | /* static context
[FOCAL] public boolean CachingService.exists(String name)
[INPUTS] branches=- | result=name
[COLLABORATORS] field cache containsValue/1
[CALLS-EXTERNAL] cache.containsValue/1
*/
| /* static context
[FOCAL] public boolean CachingService.exists(String name)
[INPUTS] branches=- | result=name
[COLLABORATORS] field cache containsValue/1
[CALLS-EXTERNAL] cache.containsValue/1
*/
class CachingService {
public boolean exists(String name) {
return cache.containsValue(name);
}
public Cac... | true | ok | {"focal": {"class": "CachingService", "name": "exists", "signature": "boolean exists(String name)", "start_line": 3, "modifiers": "public", "params": [{"name": "name", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "CachingService", "kind": "class", "modifiers": "", "superclass": null, "interface... |
40977450_7 | class ClubSquadBuilder {
public ClubSquad build() {
squad.add(goalkeepers.remove(0));
addToSquad(ClubSquad.TOTAL_DEFENDERS, asList(defenders, midfielders, attackers, goalkeepers));
addToSquad(ClubSquad.TOTAL_MIDFIELDERS, asList(midfielders, attackers, defenders, goalkeepers));
addToSquad(ClubSquad.T... | Player[] players = new Player[] { buildPlayer("LB"), buildPlayer("CB"), buildPlayer("CB"),
buildPlayer("CDM"), buildPlayer("RW"), buildPlayer("LM"), buildPlayer("CM"),
buildPlayer("GK"), buildPlayer("ST"), buildPlayer("CAM"), buildPlayer("CDM") };
ClubSquadBuilder builder = new ClubSquadBuilder(... | [FOCAL] public ClubSquad ClubSquadBuilder.build()
[CLASS] class ClubSquadBuilder
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] void addToSquad(int quantity, List<List<Player>> from)
[CALLS-EXTERNAL] squad.add/1, goalkeepers.remove/1, asList/4 (inherited), ClubSquad.create/2, club... | /* static context
[FOCAL] public ClubSquad ClubSquadBuilder.build()
[COLLABORATORS] field squad add/1; field goalkeepers remove/1; field club id/0
[CALLS-INTERNAL] void addToSquad(int quantity, List<List<Player>> from)
[CALLS-EXTERNAL] squad.add/1, goalkeepers.remove/1, asList/4 (inherited), ClubSquad.create/2, club.id... | /* static context
[FOCAL] public ClubSquad ClubSquadBuilder.build()
[COLLABORATORS] field squad add/1; field goalkeepers remove/1; field club id/0
[CALLS-INTERNAL] void addToSquad(int quantity, List<List<Player>> from)
[CALLS-EXTERNAL] squad.add/1, goalkeepers.remove/1, asList/4 (inherited), ClubSquad.create/2, club.id... | true | ok | {"focal": {"class": "ClubSquadBuilder", "name": "build", "signature": "ClubSquad build()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "ClubSquad"}, "class_info": {"name": "ClubSquadBuilder", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"n... |
40998919_6 | class AdviceTraits {
public static Optional<MediaType> getProblemMediaType(final List<MediaType> mediaTypes) {
for (final MediaType mediaType : mediaTypes) {
if (mediaType.includes(APPLICATION_JSON) || mediaType.includes(PROBLEM)) {
return Optional.of(PROBLEM);
} els... | List<MediaType> mediaTypes = Arrays.asList(MediaType.TEXT_PLAIN, MediaTypes.PROBLEM, MediaTypes.X_PROBLEM);
Optional<MediaType> mediaType = AdviceTraits.getProblemMediaType(mediaTypes);
assertTrue(mediaType.isPresent());
assertThat(mediaType.get(), is(MediaTypes.PROBLEM));
}
} | [FOCAL] public static Optional<MediaType> AdviceTraits.getProblemMediaType(List<MediaType> mediaTypes)
[CLASS] class AdviceTraits
[METRICS] loc=11 cc=4 branches=2 loops=1 returns=3 throws=0 nesting=3
[CALLS-EXTERNAL] MediaType.includes/1, Optional.of/1, Optional.empty/0
[PATH1] foreach(MediaType mediaType : mediaTypes)... | /* static context
[FOCAL] public static Optional<MediaType> AdviceTraits.getProblemMediaType(List<MediaType> mediaTypes)
[PATH1] foreach(MediaType mediaType : mediaTypes)=T -> if(mediaType.includes(APPLICATION_JSON) || mediaType.includes(PROBLEM))=F -> if(mediaType.includes(X_PROBLEM))=F -> exit loop -> return Optional... | /* static context
[FOCAL] public static Optional<MediaType> AdviceTraits.getProblemMediaType(List<MediaType> mediaTypes)
[PATH1] foreach(MediaType mediaType : mediaTypes)=T -> if(mediaType.includes(APPLICATION_JSON) || mediaType.includes(PROBLEM))=F -> if(mediaType.includes(X_PROBLEM))=F -> exit loop -> return Optional... | true | ok | {"focal": {"class": "AdviceTraits", "name": "getProblemMediaType", "signature": "Optional<MediaType> getProblemMediaType(List<MediaType> mediaTypes)", "start_line": 3, "modifiers": "public static", "params": [{"name": "mediaTypes", "type": "List<MediaType>"}], "return_type": "Optional<MediaType>"}, "class_info": {"name... |
41012501_0 | class PDFExtractor {
@SneakyThrows
public PDFDoc extractFromInputStream(InputStream is) {
return extractResultFromInputStream(is).document;
}
public PDFExtractor(Options opts);
public PDFExtractor();
private static List<String> guessKeywordList(String listStr);
private static List<String> guessAu... | String pdfPath = "/coordinate_calibrator.pdf";
InputStream pdfInputStream = getClass().getResourceAsStream(pdfPath);
PDFExtractor.Options opts = PDFExtractor.Options.builder().useHeuristicTitle(true).build();
PDFDoc doc = new PDFExtractor(opts).extractFromInputStream(pdfInputStream);
for(PDFPag... | [FOCAL] @SneakyThrows public PDFDoc PDFExtractor.extractFromInputStream(InputStream is)
[CLASS] class PDFExtractor
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] PdfDocExtractionResult extractResultFromInputStream(InputStream is)
[INPUTS] branches=- | result=is
[DATAFLOW] is@param... | /* static context
[FOCAL] @SneakyThrows public PDFDoc PDFExtractor.extractFromInputStream(InputStream is)
[INPUTS] branches=- | result=is
[CALLS-INTERNAL] PdfDocExtractionResult extractResultFromInputStream(InputStream is)
*/
| /* static context
[FOCAL] @SneakyThrows public PDFDoc PDFExtractor.extractFromInputStream(InputStream is)
[INPUTS] branches=- | result=is
[CALLS-INTERNAL] PdfDocExtractionResult extractResultFromInputStream(InputStream is)
*/
class PDFExtractor {
@SneakyThrows
public PDFDoc extractFromInputStream(InputStream is) {... | true | ok | {"focal": {"class": "PDFExtractor", "name": "extractFromInputStream", "signature": "PDFDoc extractFromInputStream(InputStream is)", "start_line": 3, "modifiers": "@SneakyThrows public", "params": [{"name": "is", "type": "InputStream"}], "return_type": "PDFDoc"}, "class_info": {"name": "PDFExtractor", "kind": "class", "... |
41053417_6 | class MemberService {
public void syncMembers() {
log.info("> Sync members");
syncLocalMembers();
syncRemoteMembers();
log.info("< Synced members");
}
private void syncLocalMembers();
private void syncRemoteMembers();
private void attachMemberToGroups(Member member... | //given
//TestAppConfig
//when
memberService.syncMembers();
//then
Optional<MembershipEntryEntity> entry = membershipRepository.findFirstByMemberIdAndGroupIdOrderByDateDesc("member1", "group1");
assertThat(entry).isPresent();
assertThat(entry.get().getEv... | [FOCAL] public void MemberService.syncMembers()
[CLASS] class MemberService
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void syncLocalMembers(); void syncRemoteMembers()
[CALLS-EXTERNAL] log.info/1
[CLASS-MEMBERS] void syncLocalMembers(); void syncRemoteMembers(); void attachMe... | /* static context
[FOCAL] public void MemberService.syncMembers()
[CALLS-INTERNAL] void syncLocalMembers(); void syncRemoteMembers()
[CALLS-EXTERNAL] log.info/1
*/
| /* static context
[FOCAL] public void MemberService.syncMembers()
[CALLS-INTERNAL] void syncLocalMembers(); void syncRemoteMembers()
[CALLS-EXTERNAL] log.info/1
*/
class MemberService {
public void syncMembers() {
log.info("> Sync members");
syncLocalMembers();
syncRemoteMembers();
... | true | ok | {"focal": {"class": "MemberService", "name": "syncMembers", "signature": "void syncMembers()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "MemberService", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name"... |
41057956_15 | class IconTabLayout extends TabLayout {
@Override public void setTabsFromPagerAdapter(@NonNull PagerAdapter adapter) {
super.setTabsFromPagerAdapter(
pageTitlesVisible ? adapter : TitleNullifyingPagerAdapter.from(adapter));
if (isLayoutPagerAdapterInstance(adapter)) {
setTabIconsFromLayoutPage... | // given
IconTabLayout iconTabLayout = new IconTabLayout(RuntimeEnvironment.application);
// when
iconTabLayout.setTabsFromPagerAdapter(pagerAdapter);
// then
assertThat(iconTabLayout.getTabAt(0)).hasIcon(null).hasText("barbers");
assertThat(iconTabLayout.getTabAt(1)).hasIcon(null).hasText... | [FOCAL] @Override public void IconTabLayout.setTabsFromPagerAdapter(PagerAdapter adapter)
[CLASS] class IconTabLayout extends TabLayout
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] boolean isLayoutPagerAdapterInstance(PagerAdapter adapter); void setTabIconsFromLayoutPagerAdapter... | /* static context
[FOCAL] @Override public void IconTabLayout.setTabsFromPagerAdapter(PagerAdapter adapter)
[PATH1] if(isLayoutPagerAdapterInstance(adapter))=T
[PATH2] if(isLayoutPagerAdapterInstance(adapter))=F
[INPUTS] branches=adapter | result=-
[CALLS-INTERNAL] boolean isLayoutPagerAdapterInstance(PagerAdapter adap... | /* static context
[FOCAL] @Override public void IconTabLayout.setTabsFromPagerAdapter(PagerAdapter adapter)
[PATH1] if(isLayoutPagerAdapterInstance(adapter))=T
[PATH2] if(isLayoutPagerAdapterInstance(adapter))=F
[INPUTS] branches=adapter | result=-
[CALLS-INTERNAL] boolean isLayoutPagerAdapterInstance(PagerAdapter adap... | true | ok | {"focal": {"class": "IconTabLayout", "name": "setTabsFromPagerAdapter", "signature": "void setTabsFromPagerAdapter(PagerAdapter adapter)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "adapter", "type": "PagerAdapter"}], "return_type": "void"}, "class_info": {"name": "IconTabLayout", "kind": "c... |
41091157_5 | class HomePageController extends AbstractController implements IController {
@Override
public ModelAndView doGet(ModelMap model) {
log.info("Requesting doGet of " + this.getClass());
return buildModelAndView(
getModelViewName(),
model,
new ModelP... | ModelMap model = new ModelMap();
assertEquals("homePage", controller.doGet(model));
}
} | [FOCAL] @Override public ModelAndView HomePageController.doGet(ModelMap model)
[CLASS] class HomePageController extends AbstractController implements IController
[METRICS] loc=23 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] List<Breadcrumb> getBreadcrumbs(SecureEntity entity); String getModelVi... | /* static context
[FOCAL] @Override public ModelAndView HomePageController.doGet(ModelMap model)
[INPUTS] branches=- | result=model
[COLLABORATORS] param model:ModelMap addAttribute/2
[CALLS-INTERNAL] List<Breadcrumb> getBreadcrumbs(SecureEntity entity); String getModelViewName()
[NEW] ModelPopulator, HomePageViewModel... | /* static context
[FOCAL] @Override public ModelAndView HomePageController.doGet(ModelMap model)
[INPUTS] branches=- | result=model
[COLLABORATORS] param model:ModelMap addAttribute/2
[CALLS-INTERNAL] List<Breadcrumb> getBreadcrumbs(SecureEntity entity); String getModelViewName()
[NEW] ModelPopulator, HomePageViewModel... | true | ok | {"focal": {"class": "HomePageController", "name": "doGet", "signature": "ModelAndView doGet(ModelMap model)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "model", "type": "ModelMap"}], "return_type": "ModelAndView"}, "class_info": {"name": "HomePageController", "kind": "class", "modifiers": ""... |
41092630_14 | class RequestExceptionHandler extends ResponseEntityExceptionHandler {
@ExceptionHandler(SmartCosmosException.class)
protected ResponseEntity<?> handleSmartCosmosExceptionMethod(SmartCosmosException exception, WebRequest request) {
if (exception.getCause() == null) {
logException(exception... |
SmartCosmosException smartCosmosException = new SmartCosmosException("just message, no cause");
ResponseEntity responseEntity = handler.handleSmartCosmosExceptionMethod(smartCosmosException, webRequest);
assertEquals(responseEntity.getStatusCode(), HttpStatus.INTERNAL_SERVER_ERROR);
ass... | [FOCAL] @ExceptionHandler(SmartCosmosException.class) protected ResponseEntity<?> RequestExceptionHandler.handleSmartCosmosExceptionMethod(SmartCosmosException exception, WebRequest request)
[CLASS] class RequestExceptionHandler extends ResponseEntityExceptionHandler
[METRICS] loc=36 cc=8 branches=7 loops=0 returns=8 t... | /* static context
[FOCAL] @ExceptionHandler(SmartCosmosException.class) protected ResponseEntity<?> RequestExceptionHandler.handleSmartCosmosExceptionMethod(SmartCosmosException exception, WebRequest request)
[PATH1] if(exception.getCause() == null)=F -> if(exception.getCause() instanceof NoEntityFoundException)=F -> i... | /* static context
[FOCAL] @ExceptionHandler(SmartCosmosException.class) protected ResponseEntity<?> RequestExceptionHandler.handleSmartCosmosExceptionMethod(SmartCosmosException exception, WebRequest request)
[PATH1] if(exception.getCause() == null)=F -> if(exception.getCause() instanceof NoEntityFoundException)=F -> i... | true | ok | {"focal": {"class": "RequestExceptionHandler", "name": "handleSmartCosmosExceptionMethod", "signature": "ResponseEntity<?> handleSmartCosmosExceptionMethod(SmartCosmosException exception, WebRequest request)", "start_line": 3, "modifiers": "@ExceptionHandler(SmartCosmosException.class) protected", "params": [{"name": "... |
41104075_6 | class IngestJob extends AbstractJob {
@Override
public int run(String[] args) throws Exception {
addInputOption();
addOutputOption();
addOption(JOB_NAME_OPTION, "jn", "Optional name to give the Hadoop Job.", false);
addOption(ZK_CONNECT_OPTION, "zk",
"Connection string for ZooKeeper. Either... | String warc = "warc/at.warc";
File warcFile = new File(ClassLoader.getSystemClassLoader().getResource(warc).getPath());
assertTrue(warc + " does not exist: " + warcFile.getAbsolutePath(), warcFile.exists());
Path input = new Path(tempDir, warc);
addContentToFS(input, Files.toString(warcFile, Charset... | [FOCAL] @Override public int IngestJob.run(String[] args)
[CLASS] class IngestJob extends AbstractJob
[METRICS] loc=183 cc=16 branches=13 loops=0 returns=8 throws=0 nesting=2
[CALLS-INTERNAL] boolean checkSolrOrZkString(JobConf conf); boolean checkSolrServer(JobConf conf); void doFinalCommit(JobConf conf, RunningJob jo... | class IngestJob extends AbstractJob {
@Override
public int run(String[] args) throws Exception {
addInputOption();
addOutputOption();
addOption(JOB_NAME_OPTION, "jn", "Optional name to give the Hadoop Job.", false);
addOption(ZK_CONNECT_OPTION, "zk",
"Connection string for ZooKeeper. Either... | false | ok | {"focal": {"class": "IngestJob", "name": "run", "signature": "int run(String[] args) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "args", "type": "String[]"}], "return_type": "int"}, "class_info": {"name": "IngestJob", "kind": "class", "modifiers": "", "superclass": "Abstract... | |
41115262_3 | class Device {
@NonNull
@SuppressWarnings("deprecation")
public static JobRequest.NetworkType getNetworkType(@NonNull Context context) {
ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo;
t... | NetworkInfo networkInfo = mock(NetworkInfo.class);
when(networkInfo.isConnected()).thenReturn(false);
when(networkInfo.isConnectedOrConnecting()).thenReturn(false);
ConnectivityManager connectivityManager = mock(ConnectivityManager.class);
when(connectivityManager.getActiveNetwo... | [FOCAL] @NonNull @SuppressWarnings("deprecation") public static JobRequest.NetworkType Device.getNetworkType(Context context)
[CLASS] class Device
[METRICS] loc=26 cc=5 branches=3 loops=0 returns=5 throws=0 nesting=1
[CALLS-INTERNAL] boolean isRoaming(ConnectivityManager connectivityManager, NetworkInfo networkInfo)
[C... | /* static context
[FOCAL] @NonNull @SuppressWarnings("deprecation") public static JobRequest.NetworkType Device.getNetworkType(Context context)
[PATH1] if(networkInfo == null || !networkInfo.isConnectedOrConnecting())=F -> if(!metered)=F -> if(isRoaming(connectivityManager, networkInfo))=T -> return JobRequest.NetworkT... | /* static context
[FOCAL] @NonNull @SuppressWarnings("deprecation") public static JobRequest.NetworkType Device.getNetworkType(Context context)
[PATH1] if(networkInfo == null || !networkInfo.isConnectedOrConnecting())=F -> if(!metered)=F -> if(isRoaming(connectivityManager, networkInfo))=T -> return JobRequest.NetworkT... | true | ok | {"focal": {"class": "Device", "name": "getNetworkType", "signature": "JobRequest.NetworkType getNetworkType(Context context)", "start_line": 3, "modifiers": "@NonNull @SuppressWarnings(\"deprecation\") public static", "params": [{"name": "context", "type": "Context"}], "return_type": "JobRequest.NetworkType"}, "class_i... |
41152339_2 | class MonetaryFormat {
public CharSequence format(Monetary monetary) {
return format(monetary, monetary.smallestUnitExponent());
}
public MonetaryFormat();
private MonetaryFormat(char negativeSign, char positiveSign, char zeroDigit, char decimalMark, int minDecimals,
... | assertEquals("0.1", format(Coin.parseCoin("0.1"), 0, 1, 2, 3));
assertEquals("0.010", format(Coin.parseCoin("0.01"), 0, 1, 2, 3));
assertEquals("0.001", format(Coin.parseCoin("0.001"), 0, 1, 2, 3));
assertEquals("0.000100", format(Coin.parseCoin("0.0001"), 0, 1, 2, 3));
assertEqu... | [FOCAL] public CharSequence MonetaryFormat.format(Monetary monetary)
[CLASS] class MonetaryFormat
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] CharSequence format(Monetary monetary, int smallestUnitExponent)
[CALLS-EXTERNAL] Monetary.smallestUnitExponent/0
[INPUTS] branches=- | ... | /* static context
[FOCAL] public CharSequence MonetaryFormat.format(Monetary monetary)
[INPUTS] branches=- | result=monetary
[COLLABORATORS] param monetary:Monetary smallestUnitExponent/0
[CALLS-INTERNAL] CharSequence format(Monetary monetary, int smallestUnitExponent)
[CALLS-EXTERNAL] Monetary.smallestUnitExponent/0
*... | /* static context
[FOCAL] public CharSequence MonetaryFormat.format(Monetary monetary)
[INPUTS] branches=- | result=monetary
[COLLABORATORS] param monetary:Monetary smallestUnitExponent/0
[CALLS-INTERNAL] CharSequence format(Monetary monetary, int smallestUnitExponent)
[CALLS-EXTERNAL] Monetary.smallestUnitExponent/0
*... | true | ok | {"focal": {"class": "MonetaryFormat", "name": "format", "signature": "CharSequence format(Monetary monetary)", "start_line": 3, "modifiers": "public", "params": [{"name": "monetary", "type": "Monetary"}], "return_type": "CharSequence"}, "class_info": {"name": "MonetaryFormat", "kind": "class", "modifiers": "", "supercl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.