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 |
|---|---|---|---|---|---|---|---|---|
50600325_6 | class WidgetController {
@RequestMapping(
method = POST,
produces = MediaType.APPLICATION_JSON_VALUE,
consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<WidgetConfigResource> createWidget(
@PathVariable String slug, @RequestBody WidgetConfigResource widgetConfigResource) {
... | ConstrainedFields fields = fields(WidgetConfigResource.class);
WidgetConfig widgetConfig = widgetConfig();
WidgetConfigResource widgetConfigResource = widgetConfigResource();
when(dashboardService.load(any())).thenReturn(dashboard());
when(widgetService.saveWidget(any(WidgetConfig.class))).thenRetu... | [FOCAL] @RequestMapping( method = POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VA... ResponseEntity<WidgetConfigResource> WidgetController.createWidget(String slug, WidgetConfigResource widgetConfigResource)
[CLASS] class WidgetController
[METRICS] loc=16 cc=1 branches=0 loop... | /* static context
[FOCAL] @RequestMapping( method = POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VA... ResponseEntity<WidgetConfigResource> WidgetController.createWidget(String slug, WidgetConfigResource widgetConfigResource)
[INPUTS] branches=- | result=slug, widgetConfigRes... | /* static context
[FOCAL] @RequestMapping( method = POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VA... ResponseEntity<WidgetConfigResource> WidgetController.createWidget(String slug, WidgetConfigResource widgetConfigResource)
[INPUTS] branches=- | result=slug, widgetConfigRes... | true | ok | {"focal": {"class": "WidgetController", "name": "createWidget", "signature": "ResponseEntity<WidgetConfigResource> createWidget(String slug, WidgetConfigResource widgetConfigResource)", "start_line": 3, "modifiers": "@RequestMapping( method = POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLI... |
50632308_5 | class RMP {
public Observable<Professor> getProfessor(final Parameter params) {
Observable<Professor> professorFromClient = mRMPClient.findProfessor(params)
//Since this is first in the chain, don't try an error just yet.
.onErrorResumeNext(Observable.<Professor>empty())
... | Parameter params = new Parameter("rutgers",
"Computer Science", "Newark", "101", "", "NOPROFESSOR");
Professor result = rmp.getProfessor(params).toBlocking().lastOrDefault(null);
assertNull(result);
}
} | [FOCAL] public Observable<Professor> RMP.getProfessor(Parameter params)
[CLASS] class RMP
[METRICS] loc=23 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] mRMPClient.findProfessor(params) //Since this is first in....subscribeOn/1, mRMPClient.findProfessor(params).onErrorResumeNext/1, mRMPClient.fi... | /* static context
[FOCAL] public Observable<Professor> RMP.getProfessor(Parameter params)
[INPUTS] branches=- | result=params
[COLLABORATORS] field mRMPClient findProfessor/1; field mRMPScraper findBestProfessor/1
[NEW] Func1<Professor, Boolean>
[CALLS-EXTERNAL] mRMPClient.findProfessor(params) //Since this is first in... | /* static context
[FOCAL] public Observable<Professor> RMP.getProfessor(Parameter params)
[INPUTS] branches=- | result=params
[COLLABORATORS] field mRMPClient findProfessor/1; field mRMPScraper findBestProfessor/1
[NEW] Func1<Professor, Boolean>
[CALLS-EXTERNAL] mRMPClient.findProfessor(params) //Since this is first in... | true | ok | {"focal": {"class": "RMP", "name": "getProfessor", "signature": "Observable<Professor> getProfessor(Parameter params)", "start_line": 3, "modifiers": "public", "params": [{"name": "params", "type": "Parameter"}], "return_type": "Observable<Professor>"}, "class_info": {"name": "RMP", "kind": "class", "modifiers": "", "s... |
50677285_8 | class AssociatedLegendrePolynomial implements UnivariateFunction {
@Override
public final double value(double x) {
return this.sign * (FastMath.pow(1.0-FastMath.pow(x,2.0),m/2.0) * legendre.value(x));
}
public AssociatedLegendrePolynomial(int l, int m);
public final int getL();
publi... | final double increment = 1e-4;
final AssociatedLegendrePolynomial alp = new AssociatedLegendrePolynomial(2,2);
for (double x = -1.0;x<=1.0;x+=increment) {
assertEquals(3.0*(1-Math.pow(x,2)), alp.value(x), 1e-8);
}
}
} | [FOCAL] @Override public final double AssociatedLegendrePolynomial.value(double x)
[CLASS] class AssociatedLegendrePolynomial implements UnivariateFunction
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] FastMath.pow/2, legendre.value/1
[FIELDS] read=sign
[INPUTS] branches=- | resu... | /* static context
[FOCAL] @Override public final double AssociatedLegendrePolynomial.value(double x)
[INPUTS] branches=- | result=x
[COLLABORATORS] field legendre value/1
[FIELDS] read=sign
[CALLS-EXTERNAL] FastMath.pow/2, legendre.value/1
*/
| /* static context
[FOCAL] @Override public final double AssociatedLegendrePolynomial.value(double x)
[INPUTS] branches=- | result=x
[COLLABORATORS] field legendre value/1
[FIELDS] read=sign
[CALLS-EXTERNAL] FastMath.pow/2, legendre.value/1
*/
class AssociatedLegendrePolynomial implements UnivariateFunction {
@Over... | true | ok | {"focal": {"class": "AssociatedLegendrePolynomial", "name": "value", "signature": "double value(double x)", "start_line": 3, "modifiers": "@Override public final", "params": [{"name": "x", "type": "double"}], "return_type": "double"}, "class_info": {"name": "AssociatedLegendrePolynomial", "kind": "class", "modifiers": ... |
50679300_6 | class JWTFilter extends GenericFilterBean {
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
throws IOException, ServletException {
HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
String ... | MockHttpServletRequest request = new MockHttpServletRequest();
request.addHeader(JWTConfigurer.AUTHORIZATION_HEADER, "Bearer ");
request.setRequestURI("/api/test");
MockHttpServletResponse response = new MockHttpServletResponse();
MockFilterChain filterChain = new MockFilterChain... | [FOCAL] @Override public void JWTFilter.doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
[CLASS] class JWTFilter extends GenericFilterBean
[METRICS] loc=11 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] String resolveToken(HttpServletRequest reques... | /* static context
[FOCAL] @Override public void JWTFilter.doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
[PATH1] if(StringUtils.hasText(jwt) && this.tokenProvider.validateToken(jwt))=T
[PATH2] if(StringUtils.hasText(jwt) && this.tokenProvider.validateToken(jwt))=F
[INP... | /* static context
[FOCAL] @Override public void JWTFilter.doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
[PATH1] if(StringUtils.hasText(jwt) && this.tokenProvider.validateToken(jwt))=T
[PATH2] if(StringUtils.hasText(jwt) && this.tokenProvider.validateToken(jwt))=F
[INP... | true | ok | {"focal": {"class": "JWTFilter", "name": "doFilter", "signature": "void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "servletRequest", "type": "ServletRequest... |
50726401_0 | class DateUtils {
public static Long rfc3339ToMills(String dateInString) {
Calendar cal = Calendar.getInstance();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd-HH:mm:ss.SSSSSS", Locale.getDefault());
try {
cal.setTime(simpleDateFormat.parse(dateInString
... | assertEquals(1572374198000L , DateUtils.rfc3339ToMills("2019-10-29T18:36:38.000GMT").longValue());
long epoch = LocalDateTime.now().atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
assertTrue(((epoch - DateUtils.rfc3339ToMills("abc").longValue()) < 1000));
epoch = LocalDateTime... | [FOCAL] public static Long DateUtils.rfc3339ToMills(String dateInString)
[CLASS] class DateUtils
[METRICS] loc=13 cc=2 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] Calendar.getInstance/0, Locale.getDefault/0, Calendar.setTime/1, SimpleDateFormat.parse/1, dateInString .replace("Z", "").replace/2, Str... | /* static context
[FOCAL] public static Long DateUtils.rfc3339ToMills(String dateInString)
[PATH1] try-body throws -> return cal.getTimeInMillis() + timelineOffset
[EXCEPTIONS] catches ParseException e
[NEW] SimpleDateFormat
[CALLS-EXTERNAL] Calendar.getInstance/0, Locale.getDefault/0, Calendar.setTime/1, SimpleDateFor... | /* static context
[FOCAL] public static Long DateUtils.rfc3339ToMills(String dateInString)
[PATH1] try-body throws -> return cal.getTimeInMillis() + timelineOffset
[EXCEPTIONS] catches ParseException e
[NEW] SimpleDateFormat
[CALLS-EXTERNAL] Calendar.getInstance/0, Locale.getDefault/0, Calendar.setTime/1, SimpleDateFor... | true | ok | {"focal": {"class": "DateUtils", "name": "rfc3339ToMills", "signature": "Long rfc3339ToMills(String dateInString)", "start_line": 3, "modifiers": "public static", "params": [{"name": "dateInString", "type": "String"}], "return_type": "Long"}, "class_info": {"name": "DateUtils", "kind": "class", "modifiers": "", "superc... |
50726840_5 | class XmlSanitizer {
public static String sanitize(final String input, final String tag) {
Pattern p = Pattern.compile("<" + tag + ">(.+?)</" + tag + ">", Pattern.DOTALL);
if (BuildConfig.DEBUG) Log.d(TAG, "sanitize(): Using pattern \"" + p.pattern() + "\"");
Matcher m = p.matcher(input);
... | String sanitized = XmlSanitizer.sanitize(rawText1, "body");
assertThat(sanitized, is(equalTo(sanitizedText1)));
}
} | [FOCAL] public static String XmlSanitizer.sanitize(String input, String tag)
[CLASS] class XmlSanitizer
[METRICS] loc=32 cc=7 branches=3 loops=2 returns=2 throws=0 nesting=3
[CALLS-INTERNAL] String escapeXml(String s)
[CALLS-EXTERNAL] Pattern.compile/2, Log.d/2, Pattern.pattern/0, Pattern.matcher/1, Matcher.find/0, Mat... | /* static context
[FOCAL] public static String XmlSanitizer.sanitize(String input, String tag)
[PATH1] if(BuildConfig.DEBUG)=T -> if(!m.find())=F -> while(m.find(pos))=T -> exit loop -> if(BuildConfig.DEBUG_DATA)=T -> try-body throws -> return sb.toString()
[PATH2] if(BuildConfig.DEBUG)=F -> if(!m.find())=T -> return i... | /* static context
[FOCAL] public static String XmlSanitizer.sanitize(String input, String tag)
[PATH1] if(BuildConfig.DEBUG)=T -> if(!m.find())=F -> while(m.find(pos))=T -> exit loop -> if(BuildConfig.DEBUG_DATA)=T -> try-body throws -> return sb.toString()
[PATH2] if(BuildConfig.DEBUG)=F -> if(!m.find())=T -> return i... | true | ok | {"focal": {"class": "XmlSanitizer", "name": "sanitize", "signature": "String sanitize(String input, String tag)", "start_line": 3, "modifiers": "public static", "params": [{"name": "input", "type": "String"}, {"name": "tag", "type": "String"}], "return_type": "String"}, "class_info": {"name": "XmlSanitizer", "kind": "c... |
50753889_0 | class LoyaltyCardViewActivity extends AppCompatActivity {
@Override
public void onBackPressed() {
if (barcodeIsFullscreen)
{
setFullscreen(false);
return;
}
super.onBackPressed();
return;
}
private void extractIntentFields(Intent intent)... | ActivityController activityController = createActivityWithLoyaltyCard(false);
Activity activity = (Activity)activityController.get();
DBHelper db = new DBHelper(activity);
db.insertLoyaltyCard("store", "note", BARCODE_DATA, BARCODE_TYPE, Color.BLACK, Color.WHITE);
activityContr... | [FOCAL] @Override public void LoyaltyCardViewActivity.onBackPressed()
[CLASS] class LoyaltyCardViewActivity extends AppCompatActivity
[METRICS] loc=11 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] void setFullscreen(boolean enable)
[CALLS-EXTERNAL] AppCompatActivity.onBackPressed/0
[PATH1] if(ba... | /* static context
[FOCAL] @Override public void LoyaltyCardViewActivity.onBackPressed()
[PATH1] if(barcodeIsFullscreen)=T -> return
[PATH2] if(barcodeIsFullscreen)=F -> return
[CALLS-INTERNAL] void setFullscreen(boolean enable)
[CALLS-EXTERNAL] AppCompatActivity.onBackPressed/0
*/
| /* static context
[FOCAL] @Override public void LoyaltyCardViewActivity.onBackPressed()
[PATH1] if(barcodeIsFullscreen)=T -> return
[PATH2] if(barcodeIsFullscreen)=F -> return
[CALLS-INTERNAL] void setFullscreen(boolean enable)
[CALLS-EXTERNAL] AppCompatActivity.onBackPressed/0
*/
class LoyaltyCardViewActivity extends ... | true | ok | {"focal": {"class": "LoyaltyCardViewActivity", "name": "onBackPressed", "signature": "void onBackPressed()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "LoyaltyCardViewActivity", "kind": "class", "modifiers": "", "superclass": "AppCompatActivity", "int... |
50834437_9 | class Destination {
public Port getPort() {
return port;
}
public Destination(String host, Port port);
public Destination(String uriString);
private void setDefaultPort(String scheme);
private boolean noPort(URI uri);
public boolean noPort();
public String getHost();
pri... | Destination destination = new Destination("https://mysite.org/path");
Assert.assertEquals(ImmutablePort.of(443), destination.getPort());
}
} | [FOCAL] public Port Destination.getPort()
[CLASS] class Destination
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] Destination(String host, Port port); Destination(String uriString); void setDefaultPort(String scheme); boolean noPort(URI uri); boolean noPort(); String getHost(); vo... | /* static context
[FOCAL] public Port Destination.getPort()
*/
| /* static context
[FOCAL] public Port Destination.getPort()
*/
class Destination {
public Port getPort() {
return port;
}
public Destination(String host, Port port);
public Destination(String uriString);
private void setDefaultPort(String scheme);
private boolean noPort(URI uri);
... | true | ok | {"focal": {"class": "Destination", "name": "getPort", "signature": "Port getPort()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Port"}, "class_info": {"name": "Destination", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Destinati... |
50842364_180 | class IdBasedDataProvider extends BaseDataProvider<ID, T> {
@Override
public int size(Query<T, SerializablePredicate<T>> query) {
SortOrders so = createSortOrder(query);
FilterConverter<T> converter = getFilterConverter();
Filter filter = converter.convert(query.getFilter().orElse(null... |
when(service.findIds(isNull(), isNull(), any()))
.thenReturn(List.of(1, 2, 3));
provider = new IdBasedDataProvider<>(service, emf.getModel(TestEntity.class));
provider.size(query);
provider.setCurrentlySelectedId(2);
assertTrue(provider.hasPreviousItemId());
Integer next = provider.getPreviousItemId(... | [FOCAL] @Override public int IdBasedDataProvider.size(Query<T, SerializablePredicate<T>> query)
[CLASS] class IdBasedDataProvider extends BaseDataProvider<ID, T>
[METRICS] loc=19 cc=4 branches=3 loops=0 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] createSortOrder/1 (inherited), getFilterConverter/0 (inherited), Filter... | /* static context
[FOCAL] @Override public int IdBasedDataProvider.size(Query<T, SerializablePredicate<T>> query)
[PATH1] if(getMaxResults() != null)=T -> if(showNotification && count >= getMaxResults())=T -> if(getAfterCountCompleted() != null)=T -> return ids.size()
[PATH2] if(getMaxResults() != null)=F -> if(getAfte... | /* static context
[FOCAL] @Override public int IdBasedDataProvider.size(Query<T, SerializablePredicate<T>> query)
[PATH1] if(getMaxResults() != null)=T -> if(showNotification && count >= getMaxResults())=T -> if(getAfterCountCompleted() != null)=T -> return ids.size()
[PATH2] if(getMaxResults() != null)=F -> if(getAfte... | true | ok | {"focal": {"class": "IdBasedDataProvider", "name": "size", "signature": "int size(Query<T, SerializablePredicate<T>> query)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "query", "type": "Query<T, SerializablePredicate<T>>"}], "return_type": "int"}, "class_info": {"name": "IdBasedDataProvider"... |
50882844_11 | class Orbit {
public double getMeanAngularMotion() {
return MathUtils.TWO_PI / getPeriod();
}
public Orbit(Body body, double a, double e, double i, double lan, double aop);
public Body getBody();
public double getSemiMajorAxis();
public double getSMA();
public double getEccentricity();
public double getAp... | Body b = new Body("Earth", 398600441800000.0);
double a = 6774500;
double e = 0.0006531;
double i = Math.toRadians(51.6443);
double lan = Math.toRadians(117.8784);
double aop = Math.toRadians(15.1371);
Orbit o = new Orbit(b, a, e, i, lan, aop);
TestUtils.assertRelativelyEquals(0.00113227786, o.getMean... | [FOCAL] public double Orbit.getMeanAngularMotion()
[CLASS] class Orbit
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] double getPeriod()
[CLASS-MEMBERS] Orbit(Body body, double a, double e, double i, double lan, double aop); Body getBody(); double getSemiMajorAxis(); double getSMA... | /* static context
[FOCAL] public double Orbit.getMeanAngularMotion()
[CALLS-INTERNAL] double getPeriod()
*/
| /* static context
[FOCAL] public double Orbit.getMeanAngularMotion()
[CALLS-INTERNAL] double getPeriod()
*/
class Orbit {
public double getMeanAngularMotion() {
return MathUtils.TWO_PI / getPeriod();
}
public Orbit(Body body, double a, double e, double i, double lan, double aop);
public Body getBody();
publi... | true | ok | {"focal": {"class": "Orbit", "name": "getMeanAngularMotion", "signature": "double getMeanAngularMotion()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "double"}, "class_info": {"name": "Orbit", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{... |
50950973_17 | class AnnotatedText implements Serializable {
@SuppressWarnings("unchecked")
public ListAttribute<LayoutRegion> getLayoutRegions() {
return (ListAttribute<LayoutRegion>) attributes.get(AttributeKey.LAYOUT_REGION.key());
}
AnnotatedText(CharSequence data,
Map<String, BaseAtt... | final String data = "This is unstructured text. bla bla bla.\nThis\tis\tfragmented\t\text.\n";
AnnotatedText.Builder builder = new AnnotatedText.Builder().data(data);
ListAttribute.Builder<LayoutRegion> layoutRegionBuilder = new ListAttribute.Builder<>(LayoutRegion.class);
LayoutRegion.... | [FOCAL] @SuppressWarnings("unchecked") public ListAttribute<LayoutRegion> AnnotatedText.getLayoutRegions()
[CLASS] class AnnotatedText implements Serializable
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] attributes.get/1, AttributeKey.LAYOUT_REGION.key/0
[COLLABORATORS] field at... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public ListAttribute<LayoutRegion> AnnotatedText.getLayoutRegions()
[COLLABORATORS] field attributes get/1
[CALLS-EXTERNAL] attributes.get/1, AttributeKey.LAYOUT_REGION.key/0
*/
| /* static context
[FOCAL] @SuppressWarnings("unchecked") public ListAttribute<LayoutRegion> AnnotatedText.getLayoutRegions()
[COLLABORATORS] field attributes get/1
[CALLS-EXTERNAL] attributes.get/1, AttributeKey.LAYOUT_REGION.key/0
*/
class AnnotatedText implements Serializable {
@SuppressWarnings("unchecked")
... | true | ok | {"focal": {"class": "AnnotatedText", "name": "getLayoutRegions", "signature": "ListAttribute<LayoutRegion> getLayoutRegions()", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public", "params": [], "return_type": "ListAttribute<LayoutRegion>"}, "class_info": {"name": "AnnotatedText", "kind": "class", "... |
50951613_2 | class RangeUtil {
public static int map(float value, float fromLow, float fromHigh, int toLow, int toHigh) {
return map(value, fromLow, fromHigh, toLow, toHigh, DEFAULT_MAP_CONSTRAIN);
}
public static int constrain(int value, int min, int max);
public static float constrain(float value, float min, float max);
... | float min_pulse_width_ms = 0.75f;
float max_pulse_width_ms = 2.25f;
float minus90_pulse_width_ms = 1f;
float plus90_pulse_width_ms = 2f;
Assert.assertEquals(
RangeUtil.map(min_pulse_width_ms, minus90_pulse_width_ms, plus90_pulse_width_ms, 0, 180, false), -45);
Assert.assertEquals(
RangeUtil.map(max... | [FOCAL] public static int RangeUtil.map(float value, float fromLow, float fromHigh, int toLow, int toHigh)
[CLASS] class RangeUtil
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] int map(float value, float fromLow, float fromHigh, int toLow, int toHigh, boolean constrain)
[INPUTS] ... | /* static context
[FOCAL] public static int RangeUtil.map(float value, float fromLow, float fromHigh, int toLow, int toHigh)
[INPUTS] branches=- | result=fromHigh, fromLow, toHigh, toLow, value
[CALLS-INTERNAL] int map(float value, float fromLow, float fromHigh, int toLow, int toHigh, boolean constrain)
*/
| /* static context
[FOCAL] public static int RangeUtil.map(float value, float fromLow, float fromHigh, int toLow, int toHigh)
[INPUTS] branches=- | result=fromHigh, fromLow, toHigh, toLow, value
[CALLS-INTERNAL] int map(float value, float fromLow, float fromHigh, int toLow, int toHigh, boolean constrain)
*/
class RangeU... | true | ok | {"focal": {"class": "RangeUtil", "name": "map", "signature": "int map(float value, float fromLow, float fromHigh, int toLow, int toHigh)", "start_line": 3, "modifiers": "public static", "params": [{"name": "value", "type": "float"}, {"name": "fromLow", "type": "float"}, {"name": "fromHigh", "type": "float"}, {"name": "... |
50961051_0 | class IndicatorMatchers {
public static IndicatorMatcher build() {
return unused -> true;
}
public static IndicatorMatcherBuilder includes(String... indicatorNames);
public static IndicatorMatcherBuilder excludes(String... indicatorNames);
}
class IndicatorMatchersTest {
@Test
publi... | assertTrue(IndicatorMatchers.build().matches(new A()));
}
} | [FOCAL] public static IndicatorMatcher IndicatorMatchers.build()
[CLASS] class IndicatorMatchers
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] IndicatorMatcherBuilder includes(String... indicatorNames); IndicatorMatcherBuilder excludes(String... indicatorNames)
[TEST] IndicatorMat... | /* static context
[FOCAL] public static IndicatorMatcher IndicatorMatchers.build()
*/
| /* static context
[FOCAL] public static IndicatorMatcher IndicatorMatchers.build()
*/
class IndicatorMatchers {
public static IndicatorMatcher build() {
return unused -> true;
}
public static IndicatorMatcherBuilder includes(String... indicatorNames);
public static IndicatorMatcherBuilder excl... | true | ok | {"focal": {"class": "IndicatorMatchers", "name": "build", "signature": "IndicatorMatcher build()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "IndicatorMatcher"}, "class_info": {"name": "IndicatorMatchers", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "field... |
50999206_4 | class Pbkdf2PasswordHashImpl implements Pbkdf2PasswordHash {
@Override
public boolean verify(char[] password, String hashedPassword) {
EncodedPasswordHash encodedPasswordHash = new EncodedPasswordHash(hashedPassword);
byte[] hashToVerify = pbkdf2(
password,
encod... | // since -1 (or illegal value) is not captured within Soteria ....
hashImpl.verify("Soteria".toCharArray(), encodedPassword(encodedHash1, salt1, "PBKDF2WithHmacSHA256", -1));
}
} | [FOCAL] @Override public boolean Pbkdf2PasswordHashImpl.verify(char[] password, String hashedPassword)
[CLASS] class Pbkdf2PasswordHashImpl implements Pbkdf2PasswordHash
[METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] byte[] pbkdf2(char[] password, byte[] salt, String algorithm, i... | /* static context
[FOCAL] @Override public boolean Pbkdf2PasswordHashImpl.verify(char[] password, String hashedPassword)
[INPUTS] branches=- | result=hashedPassword, password
[CALLS-INTERNAL] byte[] pbkdf2(char[] password, byte[] salt, String algorithm, int iterations, int keySizeBytes)
[NEW] EncodedPasswordHash
[CALLS... | /* static context
[FOCAL] @Override public boolean Pbkdf2PasswordHashImpl.verify(char[] password, String hashedPassword)
[INPUTS] branches=- | result=hashedPassword, password
[CALLS-INTERNAL] byte[] pbkdf2(char[] password, byte[] salt, String algorithm, int iterations, int keySizeBytes)
[NEW] EncodedPasswordHash
[CALLS... | true | ok | {"focal": {"class": "Pbkdf2PasswordHashImpl", "name": "verify", "signature": "boolean verify(char[] password, String hashedPassword)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "password", "type": "char[]"}, {"name": "hashedPassword", "type": "String"}], "return_type": "boolean"}, "class_inf... |
51015648_148 | class RxJava3Adapter {
public static <T> Mono<T> singleToMono(Single<T> source) {
return new SingleAsMono<>(source);
}
RxJava3Adapter();
public static Flux<T> flowableToFlux(Flowable<T> source);
public static Flowable<T> fluxToFlowable(Flux<T> source);
public static Flowable<T> mono... | Mono<Integer> m = Single.just(1)
.to(RxJava3Adapter::singleToMono);
StepVerifier.create(m)
.expectNext(1)
.expectComplete()
.verify();
}
} | [FOCAL] public static Mono<T> RxJava3Adapter.singleToMono(Single<T> source)
[CLASS] class RxJava3Adapter
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] SingleAsMono<>
[INPUTS] branches=- | result=source
[DATAFLOW] source@param->L2
[CLASS-MEMBERS] RxJava3Adapter(); Flux<T> flowableToFlux(Flow... | /* static context
[FOCAL] public static Mono<T> RxJava3Adapter.singleToMono(Single<T> source)
[INPUTS] branches=- | result=source
[NEW] SingleAsMono<>
*/
| /* static context
[FOCAL] public static Mono<T> RxJava3Adapter.singleToMono(Single<T> source)
[INPUTS] branches=- | result=source
[NEW] SingleAsMono<>
*/
class RxJava3Adapter {
public static <T> Mono<T> singleToMono(Single<T> source) {
return new SingleAsMono<>(source);
}
RxJava3Adapter();
... | true | ok | {"focal": {"class": "RxJava3Adapter", "name": "singleToMono", "signature": "Mono<T> singleToMono(Single<T> source)", "start_line": 3, "modifiers": "public static", "params": [{"name": "source", "type": "Single<T>"}], "return_type": "Mono<T>"}, "class_info": {"name": "RxJava3Adapter", "kind": "class", "modifiers": "", "... |
51016215_1 | class RewardConfirmationMarshaller implements Marshaller {
@Override
public void marshal(Object graph, Result result) throws XmlMappingException, IOException {
RewardConfirmation rewardConfirmation = (RewardConfirmation) graph;
Assert.hasText(rewardConfirmation.getDiningTransactionId(),
"'diningTransactionId'... | RewardConfirmation rewardConfirmation = mock(RewardConfirmation.class);
when(rewardConfirmation.getDiningTransactionId()).thenReturn("w00t");
DOMResult result = new DOMResult();
marshaller.marshal(rewardConfirmation, result);
DOMSource source = new DOMSource(result.getNode());
assertThat(xpathTemplate.evalu... | [FOCAL] @Override public void RewardConfirmationMarshaller.marshal(Object graph, Result result)
[CLASS] class RewardConfirmationMarshaller implements Marshaller
[METRICS] loc=24 cc=3 branches=1 loops=0 returns=0 throws=2 nesting=1
[CALLS-EXTERNAL] Assert.hasText/2, RewardConfirmation.getDiningTransactionId/0, DocumentB... | /* static context
[FOCAL] @Override public void RewardConfirmationMarshaller.marshal(Object graph, Result result)
[THROWS-WHEN] MarshallingFailureException when try-body throws
[THROWS-WHEN] IllegalArgumentException when !(result instanceof DOMResult)
[PATH1] try-body throws -> throw new MarshallingFailureException("Ca... | /* static context
[FOCAL] @Override public void RewardConfirmationMarshaller.marshal(Object graph, Result result)
[THROWS-WHEN] MarshallingFailureException when try-body throws
[THROWS-WHEN] IllegalArgumentException when !(result instanceof DOMResult)
[PATH1] try-body throws -> throw new MarshallingFailureException("Ca... | true | ok | {"focal": {"class": "RewardConfirmationMarshaller", "name": "marshal", "signature": "void marshal(Object graph, Result result) throws XmlMappingException, IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "graph", "type": "Object"}, {"name": "result", "type": "Result"}], "return_type":... |
51074108_36 | class LocalContext {
public void registerNewState(Long version,
String name, String description,
String hookIdentifier, String taskIdentifier,
Long retryCount, Long timeout,
List<Even... | localContext.registerNew("fooBar", 1, "someDescription",null,
"defaultElbId");
EventDefinition dummyDependency = new EventDefinition("someName","com.blah.some.Event");
EventDefinition dummyOutput = new EventDefinition("someOutput","com.blah.some.Event");
localContext.regi... | [FOCAL] public void LocalContext.registerNewState(Long version, String name, String description, String hookIdentifier, String taskIdentifier, Long retryCount, Long timeout, List<EventDefinition> dependencySet, EventDefinition outputEvent)
[CLASS] class LocalContext
[METRICS] loc=11 cc=1 branches=0 loops=0 returns=0 th... | /* static context
[FOCAL] public void LocalContext.registerNewState(Long version, String name, String description, String hookIdentifier, String taskIdentifier, Long retryCount, Long timeout, List<EventDefinition> dependencySet, EventDefinition outputEvent)
[COLLABORATORS] field stateMachineDefinition get/0
[FIELDS] re... | /* static context
[FOCAL] public void LocalContext.registerNewState(Long version, String name, String description, String hookIdentifier, String taskIdentifier, Long retryCount, Long timeout, List<EventDefinition> dependencySet, EventDefinition outputEvent)
[COLLABORATORS] field stateMachineDefinition get/0
[FIELDS] re... | true | ok | {"focal": {"class": "LocalContext", "name": "registerNewState", "signature": "void registerNewState(Long version, String name, String description, String hookIdentifier, String taskIdentifier, Long retryCount, Long timeout, List<EventDefinition> dependencySet, EventDefinition outputEvent)", "start_line": 3, "modifiers"... |
51074728_33 | class PoliciedServiceLevelEvaluator implements IServiceLevelEvaluator {
@Override
public List<IViolation> evaluate(
IAgreement agreement, IGuaranteeTerm term, List<IMonitoringMetric> metrics, Date now) {
logger.debug("evaluate(agreement={}, term={}, servicelevel={})",
agreement.getAgreementId(), term.getKp... | IPolicy policy;
System.out.println("---testEvaluateWithPolicy1()---");
/*
* t-2, t-3 are breaches but are separated more than policy interval -> 0 violations
*/
List<IMonitoringMetric> metrics = setUpWithPolicies(null, null);
policy = newPolicy("LATENCY", 2, new Date(900));
... | [FOCAL] @Override public List<IViolation> PoliciedServiceLevelEvaluator.evaluate(IAgreement agreement, IGuaranteeTerm term, List<IMonitoringMetric> metrics, Date now)
[CLASS] class PoliciedServiceLevelEvaluator implements IServiceLevelEvaluator
[METRICS] loc=68 cc=7 branches=4 loops=2 returns=1 throws=0 nesting=3
[CALL... | /* static context
[FOCAL] @Override public List<IViolation> PoliciedServiceLevelEvaluator.evaluate(IAgreement agreement, IGuaranteeTerm term, List<IMonitoringMetric> metrics, Date now)
[PATH1] if(withPolicies)#1=T -> foreach(IPolicy policy : policies)=T -> if(withPolicies)#2=T -> if(evaluatePolicy(policy, oldBreaches, ... | /* static context
[FOCAL] @Override public List<IViolation> PoliciedServiceLevelEvaluator.evaluate(IAgreement agreement, IGuaranteeTerm term, List<IMonitoringMetric> metrics, Date now)
[PATH1] if(withPolicies)#1=T -> foreach(IPolicy policy : policies)=T -> if(withPolicies)#2=T -> if(evaluatePolicy(policy, oldBreaches, ... | true | ok | {"focal": {"class": "PoliciedServiceLevelEvaluator", "name": "evaluate", "signature": "List<IViolation> evaluate(IAgreement agreement, IGuaranteeTerm term, List<IMonitoringMetric> metrics, Date now)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "agreement", "type": "IAgreement"}, {"name": "ter... |
51083005_0 | class UniqueFilter extends AbstractConsumerStage<String> {
public OutputPort<String> getOutputPort() {
return this.outputPort;
}
public UniqueFilter();
@Override protected void execute(final String element);
private UniqueFilter uniqueFilter;
private List<String> inputList;
priv... | final List<String> outputList = new ArrayList<>();
StageTester.test(this.uniqueFilter).and().send(this.inputList).to(this.uniqueFilter.getInputPort()).and()
.receive(outputList).from(this.uniqueFilter.getOutputPort()).start();
Assert.assertEquals("Not the correct number of result... | [FOCAL] public OutputPort<String> UniqueFilter.getOutputPort()
[CLASS] class UniqueFilter extends AbstractConsumerStage<String>
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[FIELDS] read=outputPort
[CLASS-MEMBERS] UniqueFilter(); void execute(String element)
[TEST] UniqueFilterTest: @Test public... | /* static context
[FOCAL] public OutputPort<String> UniqueFilter.getOutputPort()
[FIELDS] read=outputPort
*/
| /* static context
[FOCAL] public OutputPort<String> UniqueFilter.getOutputPort()
[FIELDS] read=outputPort
*/
class UniqueFilter extends AbstractConsumerStage<String> {
public OutputPort<String> getOutputPort() {
return this.outputPort;
}
public UniqueFilter();
@Override protected void execut... | true | ok | {"focal": {"class": "UniqueFilter", "name": "getOutputPort", "signature": "OutputPort<String> getOutputPort()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "OutputPort<String>"}, "class_info": {"name": "UniqueFilter", "kind": "class", "modifiers": "", "superclass": "AbstractConsumerStage<String... |
51113763_8 | class InMemoryAccountRepository implements AccountRepository {
@Override
public int deleteAccount(Long id) {
accountMap.remove(id);
return 1;
}
@Override public List<Account> getAccounts();
@Override public Account getAccount(Long id);
@Override public int getNumberOfAccounts()... | // Get the number of accounts before deleting
int beforeCount = repository.getNumberOfAccounts();
Account account = repository.getAccount(3L);
// Delete an account and check that num is one less
repository.deleteAccount(3L);
int afterCount = repository.getNumberOfAccount... | [FOCAL] @Override public int InMemoryAccountRepository.deleteAccount(Long id)
[CLASS] class InMemoryAccountRepository implements AccountRepository
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] accountMap.remove/1
[COLLABORATORS] field accountMap remove/1
[DATAFLOW] id@param->L3
[... | /* static context
[FOCAL] @Override public int InMemoryAccountRepository.deleteAccount(Long id)
[COLLABORATORS] field accountMap remove/1
[CALLS-EXTERNAL] accountMap.remove/1
*/
| /* static context
[FOCAL] @Override public int InMemoryAccountRepository.deleteAccount(Long id)
[COLLABORATORS] field accountMap remove/1
[CALLS-EXTERNAL] accountMap.remove/1
*/
class InMemoryAccountRepository implements AccountRepository {
@Override
public int deleteAccount(Long id) {
accountMap.remov... | true | ok | {"focal": {"class": "InMemoryAccountRepository", "name": "deleteAccount", "signature": "int deleteAccount(Long id)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "id", "type": "Long"}], "return_type": "int"}, "class_info": {"name": "InMemoryAccountRepository", "kind": "class", "modifiers": "", ... |
51161341_58 | class WordCap implements Comparable<WordCap>, Serializable {
@Override
public boolean equals(@Nullable Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WordCap wordCap = (WordCap) o;
if (isCapitalized != wordCap.isCapit... | WordCap wordCap = new WordCap("aWord", false);
assertFalse(wordCap.equals("aString"));
}
} | [FOCAL] @Override public boolean WordCap.equals(Object o)
[CLASS] class WordCap implements Comparable<WordCap>, Serializable
[METRICS] loc=17 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=1
[CALLS-EXTERNAL] getClass/0 (inherited), Object.getClass/0, word.equals/1
[PATH1] if(this == o)=F -> if(o == null || getClass... | /* static context
[FOCAL] @Override public boolean WordCap.equals(Object o)
[PATH1] if(this == o)=F -> if(o == null || getClass() != o.getClass())=F -> if(isCapitalized != wordCap.isCapitalized)=T -> return false
[PATH2] if(this == o)=T -> return true
[PATH3] if(this == o)=F -> if(o == null || getClass() != o.getClass(... | /* static context
[FOCAL] @Override public boolean WordCap.equals(Object o)
[PATH1] if(this == o)=F -> if(o == null || getClass() != o.getClass())=F -> if(isCapitalized != wordCap.isCapitalized)=T -> return false
[PATH2] if(this == o)=T -> return true
[PATH3] if(this == o)=F -> if(o == null || getClass() != o.getClass(... | true | ok | {"focal": {"class": "WordCap", "name": "equals", "signature": "boolean equals(Object o)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "o", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "WordCap", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Compa... |
51247796_1 | class Krb5ServerHelper {
public Identity getClientIdentity(byte[] serviceTicket){
try {
DerValue APREQ = extractAPREQ(serviceTicket);
Ticket authenticationTicket = extractAuthenticationTicketFromAPREQ(APREQ.toDerInputStream(), APREQ.length());
Identity identity = decryptAuthenticationTicket(authenticationT... | Identity clientIdentity = krb5ServerHelper.getClientIdentity(serviceTicket);
System.out.println(clientIdentity.toString());
assertEquals("Username - Expected: " + clientUsername + " Actual: " + clientIdentity.getUsername(), clientUsername, clientIdentity.getUsername());
assertEquals("Realm - Expected: " + clie... | [FOCAL] public Identity Krb5ServerHelper.getClientIdentity(byte[] serviceTicket)
[CLASS] class Krb5ServerHelper
[METRICS] loc=10 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] DerValue extractAPREQ(byte[] serviceTicket); Identity decryptAuthenticationTicket(Ticket authenticationTicket); Ticket ex... | /* static context
[FOCAL] public Identity Krb5ServerHelper.getClientIdentity(byte[] serviceTicket)
[PATH1] try-body throws -> return null
[PATH2] return identity
[INPUTS] branches=- | result=serviceTicket
[EXCEPTIONS] catches Exception e
[CALLS-INTERNAL] DerValue extractAPREQ(byte[] serviceTicket); Identity decryptAuth... | /* static context
[FOCAL] public Identity Krb5ServerHelper.getClientIdentity(byte[] serviceTicket)
[PATH1] try-body throws -> return null
[PATH2] return identity
[INPUTS] branches=- | result=serviceTicket
[EXCEPTIONS] catches Exception e
[CALLS-INTERNAL] DerValue extractAPREQ(byte[] serviceTicket); Identity decryptAuth... | true | ok | {"focal": {"class": "Krb5ServerHelper", "name": "getClientIdentity", "signature": "Identity getClientIdentity(byte[] serviceTicket)", "start_line": 3, "modifiers": "public", "params": [{"name": "serviceTicket", "type": "byte[]"}], "return_type": "Identity"}, "class_info": {"name": "Krb5ServerHelper", "kind": "class", "... |
51291746_15 | class SpringBeanService {
public <T> T getBeanDefinition(File configFile, Project project, String id, Class<T> type) {
LSParser parser = XMLUtils.createLSParser();
GetSpringBeanFilter filter = new GetSpringBeanFilter(id, type);
parser.setFilter(filter);
List<File> configFiles = ne... | File tempFile = createTempContextFile("citrus-context-find");
SchemaModel schema = springBeanConfigService.getBeanDefinition(tempFile, project, "helloSchema", SchemaModel.class);
Assert.assertEquals(schema.getId(), "helloSchema");
Assert.assertEquals(schema.getLocation(), "classpath:co... | [FOCAL] public T SpringBeanService.getBeanDefinition(File configFile, Project project, String id, Class<T> type)
[CLASS] class SpringBeanService
[METRICS] loc=20 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2
[CALLS-INTERNAL] List<File> getConfigImports(File configFile, Project project); T createJaxbObjectFromEle... | /* static context
[FOCAL] public T SpringBeanService.getBeanDefinition(File configFile, Project project, String id, Class<T> type)
[PATH1] foreach(File file : configFiles)=T -> if(filter.getBeanDefinition() != null)=F -> exit loop -> return null
[PATH2] foreach(File file : configFiles)=T -> if(filter.getBeanDefinition(... | /* static context
[FOCAL] public T SpringBeanService.getBeanDefinition(File configFile, Project project, String id, Class<T> type)
[PATH1] foreach(File file : configFiles)=T -> if(filter.getBeanDefinition() != null)=F -> exit loop -> return null
[PATH2] foreach(File file : configFiles)=T -> if(filter.getBeanDefinition(... | true | ok | {"focal": {"class": "SpringBeanService", "name": "getBeanDefinition", "signature": "T getBeanDefinition(File configFile, Project project, String id, Class<T> type)", "start_line": 3, "modifiers": "public", "params": [{"name": "configFile", "type": "File"}, {"name": "project", "type": "Project"}, {"name": "id", "type": ... |
51307016_350 | class PemReader {
public static List<Entry> readAll(final Path path) throws IOException {
Objects.requireNonNull(path);
try (Reader reader = Files.newBufferedReader(path, StandardCharsets.US_ASCII)) {
return readAll(reader);
}
}
private PemReader();
public static... | final List<Entry> result = PemReader.readAll(this.basePath2.resolve("empty.pem"));
assertTrue(result.isEmpty());
}
} | [FOCAL] public static List<Entry> PemReader.readAll(Path path)
[CLASS] class PemReader
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] List<Entry> readAll(Reader reader)
[CALLS-EXTERNAL] Objects.requireNonNull/1, Files.newBufferedReader/2
[EXCEPTIONS] declares IOException
[INPUTS] ... | /* static context
[FOCAL] public static List<Entry> PemReader.readAll(Path path)
[INPUTS] branches=- | result=path
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] List<Entry> readAll(Reader reader)
[CALLS-EXTERNAL] Objects.requireNonNull/1, Files.newBufferedReader/2
*/
| /* static context
[FOCAL] public static List<Entry> PemReader.readAll(Path path)
[INPUTS] branches=- | result=path
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] List<Entry> readAll(Reader reader)
[CALLS-EXTERNAL] Objects.requireNonNull/1, Files.newBufferedReader/2
*/
class PemReader {
public static List<Entry... | true | ok | {"focal": {"class": "PemReader", "name": "readAll", "signature": "List<Entry> readAll(Path path) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "path", "type": "Path"}], "return_type": "List<Entry>"}, "class_info": {"name": "PemReader", "kind": "class", "modifiers": "", "supercl... |
51357073_11 | class AnnotatedBuilder extends RunnerBuilder {
@Override
public Runner runnerForClass(Class<?> testClass) throws Exception {
for (Class<?> currentTestClass = testClass; currentTestClass != null;
currentTestClass = getEnclosingClassForNonStaticMemberClass(currentTestClass)) {
Ru... | Runner runner = builder.runnerForClass(OuterClass.InnerClassWithOwnRunWith.MostInnerClass.class);
assertThat(runner, is(instanceOf(InnerRunner.class)));
RunnerSpy runnerSpy = (RunnerSpy) runner;
assertThat(runnerSpy.getInvokedTestClass(), is((Object) OuterClass.InnerClassWithOwnRunWith.... | [FOCAL] @Override public Runner AnnotatedBuilder.runnerForClass(Class<?> testClass)
[CLASS] class AnnotatedBuilder extends RunnerBuilder
[METRICS] loc=12 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2
[CALLS-INTERNAL] Class<?> getEnclosingClassForNonStaticMemberClass(Class<?> currentTestClass); Runner buildRunner... | /* static context
[FOCAL] @Override public Runner AnnotatedBuilder.runnerForClass(Class<?> testClass)
[PATH1] for(currentTestClass != null)=T -> if(annotation != null)=F -> exit loop -> return null
[PATH2] for(currentTestClass != null)=T -> if(annotation != null)=T -> return buildRunner(annotation.value(), testClass)
[... | /* static context
[FOCAL] @Override public Runner AnnotatedBuilder.runnerForClass(Class<?> testClass)
[PATH1] for(currentTestClass != null)=T -> if(annotation != null)=F -> exit loop -> return null
[PATH2] for(currentTestClass != null)=T -> if(annotation != null)=T -> return buildRunner(annotation.value(), testClass)
[... | true | ok | {"focal": {"class": "AnnotatedBuilder", "name": "runnerForClass", "signature": "Runner runnerForClass(Class<?> testClass) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "testClass", "type": "Class<?>"}], "return_type": "Runner"}, "class_info": {"name": "AnnotatedBuilder", "kind... |
51379345_108 | class PatchFileCreator {
public static PreparationResult prepareAndValidate(File patchFile,
File toDir,
UpdaterUI ui) throws IOException, OperationCancelledException {
Patch patch;
ZipFile zipFile = new... | Patch patch = createPatch();
assertAppliedAndRevertedCorrectly(patch, PatchFileCreator.prepareAndValidate(myFile, myOlderDir, TEST_UI));
}
} | [FOCAL] public static PreparationResult PatchFileCreator.prepareAndValidate(File patchFile, File toDir, UpdaterUI ui)
[CLASS] class PatchFileCreator
[METRICS] loc=25 cc=3 branches=0 loops=0 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] Utils.getEntryInputStream/2, InputStream.close/0, ZipFile.close/0, UpdaterUI.setDesc... | /* static context
[FOCAL] public static PreparationResult PatchFileCreator.prepareAndValidate(File patchFile, File toDir, UpdaterUI ui)
[PATH1] return new PreparationResult(patch, patchFile, toDir, validationResults)
[PATH2] try-body throws
[INPUTS] branches=- | result=patchFile, toDir, ui
[COLLABORATORS] param ui:Upda... | /* static context
[FOCAL] public static PreparationResult PatchFileCreator.prepareAndValidate(File patchFile, File toDir, UpdaterUI ui)
[PATH1] return new PreparationResult(patch, patchFile, toDir, validationResults)
[PATH2] try-body throws
[INPUTS] branches=- | result=patchFile, toDir, ui
[COLLABORATORS] param ui:Upda... | true | ok | {"focal": {"class": "PatchFileCreator", "name": "prepareAndValidate", "signature": "PreparationResult prepareAndValidate(File patchFile, File toDir, UpdaterUI ui) throws IOException, OperationCancelledException", "start_line": 3, "modifiers": "public static", "params": [{"name": "patchFile", "type": "File"}, {"name": "... |
51437409_1 | class LightLexer extends AbstractLexer {
@Override
public TokenizedSource convert() {
LightLexerWorker worker = new LightLexerWorker(this);
return worker.convert();
}
public LightLexer(String source);
private static final String DEFAULT;
private static final String INDENTATIO... | Lexer indentationLexer = new LightLexer(PandaURLSource.fromPath(INDENTATION).getContent());
TokenizedSource source = indentationLexer.convert();
Assertions.assertNotNull(source);
Assertions.assertTrue(source.size() > 0);
}
} | [FOCAL] @Override public TokenizedSource LightLexer.convert()
[CLASS] class LightLexer extends AbstractLexer
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] LightLexerWorker.convert/0
[NEW] LightLexerWorker
[DATAFLOW] worker@L3->L4
[CLASS-MEMBERS] LightLexer(String source)
[TEST] L... | /* static context
[FOCAL] @Override public TokenizedSource LightLexer.convert()
[NEW] LightLexerWorker
[CALLS-EXTERNAL] LightLexerWorker.convert/0
*/
| /* static context
[FOCAL] @Override public TokenizedSource LightLexer.convert()
[NEW] LightLexerWorker
[CALLS-EXTERNAL] LightLexerWorker.convert/0
*/
class LightLexer extends AbstractLexer {
@Override
public TokenizedSource convert() {
LightLexerWorker worker = new LightLexerWorker(this);
retur... | true | ok | {"focal": {"class": "LightLexer", "name": "convert", "signature": "TokenizedSource convert()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "TokenizedSource"}, "class_info": {"name": "LightLexer", "kind": "class", "modifiers": "", "superclass": "AbstractLexer", "interfaces": null, "fie... |
51441531_1 | class User {
public boolean checkSecretAnswer(String answer)
throws InvalidKeySpecException, NoSuchAlgorithmException {
if (answer == null)
return false;
byte[] salt = Base64.decodeBase64(this.secretAnswerSalt);
KeySpec spec = new PBEKeySpec(answer.toCharArray(), s... | final User fixture = mapper.readValue(fixture("fixtures/user.json"), User.class);
assertThat(fixture.checkSecretAnswer("deneme")).isEqualTo(true);
assertThat(fixture.checkSecretAnswer("nope")).isEqualTo(false);
}
} | [FOCAL] public boolean User.checkSecretAnswer(String answer)
[CLASS] class User
[METRICS] loc=15 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] Base64.decodeBase64/1, String.toCharArray/0, SecretKeyFactory.getInstance/1, fac.generateSecret(spec).getEncoded/0, SecretKeyFactory.generateSecret/1, Ba... | /* static context
[FOCAL] public boolean User.checkSecretAnswer(String answer)
[PATH1] if(answer == null)=T -> return false
[PATH2] if(answer == null)=F -> return Base64.encodeBase64String(hash).equals(this.secretAnswerHash)
[INPUTS] branches=answer | result=answer
[EXCEPTIONS] declares InvalidKeySpecException, NoSuchA... | /* static context
[FOCAL] public boolean User.checkSecretAnswer(String answer)
[PATH1] if(answer == null)=T -> return false
[PATH2] if(answer == null)=F -> return Base64.encodeBase64String(hash).equals(this.secretAnswerHash)
[INPUTS] branches=answer | result=answer
[EXCEPTIONS] declares InvalidKeySpecException, NoSuchA... | true | ok | {"focal": {"class": "User", "name": "checkSecretAnswer", "signature": "boolean checkSecretAnswer(String answer) throws InvalidKeySpecException, NoSuchAlgorithmException", "start_line": 3, "modifiers": "public", "params": [{"name": "answer", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "User", "... |
51447395_22 | class UserViewModel extends BaseObservable {
public String getUsername() {
return user.getLogin();
}
public UserViewModel(User user);
public String getImageUrl();
@BindingAdapter({ "bind:imageUrl" }) public static void loadImage(ImageView view, String imageUrl);
public void setUser(User user);
@M... | Assert.assertEquals(mockUser.getLogin(), userViewModel.getUsername());
}
} | [FOCAL] public String UserViewModel.getUsername()
[CLASS] class UserViewModel extends BaseObservable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] user.getLogin/0
[COLLABORATORS] field user getLogin/0
[CLASS-MEMBERS] UserViewModel(User user); String getImageUrl(); void loadImage(... | /* static context
[FOCAL] public String UserViewModel.getUsername()
[COLLABORATORS] field user getLogin/0
[CALLS-EXTERNAL] user.getLogin/0
*/
| /* static context
[FOCAL] public String UserViewModel.getUsername()
[COLLABORATORS] field user getLogin/0
[CALLS-EXTERNAL] user.getLogin/0
*/
class UserViewModel extends BaseObservable {
public String getUsername() {
return user.getLogin();
}
public UserViewModel(User user);
public String getImageUrl();... | true | ok | {"focal": {"class": "UserViewModel", "name": "getUsername", "signature": "String getUsername()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "UserViewModel", "kind": "class", "modifiers": "", "superclass": "BaseObservable", "interfaces": null, "fields": [{"name... |
51451752_7 | class DiffCommandsCalculator {
public List<AdapterCommand> diff(@NonNull List<T> newList) {
if (newList == null) {
throw new NullPointerException("newList == null");
}
int newSize = newList.size();
// first time called
if (oldList == null) {
oldList = new ArrayList<>();
oldLis... | // Warmup
ItemChangedDetector<Item> changeDetector = new Detector();
List<Item> items = newList("a", "b", "c", "d", "e", "f");
calculator.diff(items);
items.remove(1);
items.remove(3);
List<AdapterCommand> commands = calculator.diff(items);
Assert.assertEquals(2, commands.size());
... | [FOCAL] public List<AdapterCommand> DiffCommandsCalculator.diff(List<T> newList)
[CLASS] class DiffCommandsCalculator
[METRICS] loc=107 cc=16 branches=11 loops=4 returns=4 throws=1 nesting=3
[CALLS-EXTERNAL] List<T>.size/0, oldList.addAll/1, List<AdapterCommand>.add/1, List<T>.isEmpty/0, oldList.isEmpty/0, Collections.... | /* static context
[FOCAL] public List<AdapterCommand> DiffCommandsCalculator.diff(List<T> newList)
[THROWS-WHEN] NullPointerException when newList == null
[PATH1] if(newList == null)=F -> if(oldList == null)=F -> if(newList.isEmpty())=F -> for(i >= 0)=T -> for(j >= 0)=T -> if(oldList.get(i).equals(newList.get(j)))=T ->... | /* static context
[FOCAL] public List<AdapterCommand> DiffCommandsCalculator.diff(List<T> newList)
[THROWS-WHEN] NullPointerException when newList == null
[PATH1] if(newList == null)=F -> if(oldList == null)=F -> if(newList.isEmpty())=F -> for(i >= 0)=T -> for(j >= 0)=T -> if(oldList.get(i).equals(newList.get(j)))=T ->... | true | ok | {"focal": {"class": "DiffCommandsCalculator", "name": "diff", "signature": "List<AdapterCommand> diff(List<T> newList)", "start_line": 3, "modifiers": "public", "params": [{"name": "newList", "type": "List<T>"}], "return_type": "List<AdapterCommand>"}, "class_info": {"name": "DiffCommandsCalculator", "kind": "class", "... |
51498833_0 | class Coinbase {
public static void sign(FIXMessage message, String secret) {
StringBuilder presign = new StringBuilder();
appendField(message, SendingTime, "SendingTime(52)", presign);
presign.append(SOH);
presign.append(Logon);
presign.append(SOH);
appendField(mes... | FIXMessage message = new FIXMessage(64, 64);
message.addField(SenderCompID).setString("foo");
message.addField(TargetCompID).setString("Coinbase");
message.addField(MsgSeqNum).setInt(1);
message.addField(SendingTime).setString("20160118-09:30:00.000");
message.addField(E... | [FOCAL] public static void Coinbase.sign(FIXMessage message, String secret)
[CLASS] class Coinbase
[METRICS] loc=30 cc=2 branches=0 loops=0 returns=0 throws=1 nesting=1
[CALLS-INTERNAL] void appendField(FIXMessage message, int tag, String fieldName, StringBuilder s)
[CALLS-EXTERNAL] StringBuilder.append/1, Base64.getDe... | /* static context
[FOCAL] public static void Coinbase.sign(FIXMessage message, String secret)
[THROWS-WHEN] RuntimeException when try-body throws
[PATH1] try-body throws -> throw new RuntimeException(e)
[COLLABORATORS] param message:FIXMessage addField/1
[EXCEPTIONS] throws RuntimeException; catches InvalidKeyException... | /* static context
[FOCAL] public static void Coinbase.sign(FIXMessage message, String secret)
[THROWS-WHEN] RuntimeException when try-body throws
[PATH1] try-body throws -> throw new RuntimeException(e)
[COLLABORATORS] param message:FIXMessage addField/1
[EXCEPTIONS] throws RuntimeException; catches InvalidKeyException... | true | ok | {"focal": {"class": "Coinbase", "name": "sign", "signature": "void sign(FIXMessage message, String secret)", "start_line": 3, "modifiers": "public static", "params": [{"name": "message", "type": "FIXMessage"}, {"name": "secret", "type": "String"}], "return_type": "void"}, "class_info": {"name": "Coinbase", "kind": "cla... |
51536707_3 | class PresentationEntityMapper {
@Contract("null -> null")
public PresentationStripe transform(final @Nullable DomainStripe domainStripe) {
PresentationStripe ret = null;
if (domainStripe != null) {
ret = new PresentationStripe();
ret.setAlt(domainStripe.getAlt());
ret.setDay(domainStrip... | final DomainStripe source = new DomainStripe();
source.setAlt(generateString(Value.NULL));
source.setDay(generateString(Value.NULL));
source.setImg(generateString(Value.NULL));
source.setLink(generateString(Value.NULL));
source.setMonth(generateString(Value.NULL));
source.setYear(generateSt... | [FOCAL] @Contract("null -> null") public PresentationStripe PresentationEntityMapper.transform(DomainStripe domainStripe)
[CLASS] class PresentationEntityMapper
[METRICS] loc=21 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] PresentationStripe.setAlt/1, DomainStripe.getAlt/0, PresentationStripe.s... | /* static context
[FOCAL] @Contract("null -> null") public PresentationStripe PresentationEntityMapper.transform(DomainStripe domainStripe)
[PATH1] if(domainStripe != null)=T -> return ret
[PATH2] if(domainStripe != null)=F -> return ret
[INPUTS] branches=domainStripe | result=-
[COLLABORATORS] param domainStripe:Domai... | /* static context
[FOCAL] @Contract("null -> null") public PresentationStripe PresentationEntityMapper.transform(DomainStripe domainStripe)
[PATH1] if(domainStripe != null)=T -> return ret
[PATH2] if(domainStripe != null)=F -> return ret
[INPUTS] branches=domainStripe | result=-
[COLLABORATORS] param domainStripe:Domai... | true | ok | {"focal": {"class": "PresentationEntityMapper", "name": "transform", "signature": "PresentationStripe transform(DomainStripe domainStripe)", "start_line": 3, "modifiers": "@Contract(\"null -> null\") public", "params": [{"name": "domainStripe", "type": "DomainStripe"}], "return_type": "PresentationStripe"}, "class_info... |
51575637_10 | class RepositoriesPresenter extends BasePresenter<RepositoriesView> {
public void onErrorCancel() {
getViewState().hideError();
}
public RepositoriesPresenter();
@Override protected void onFirstViewAttach();
public void loadNextRepositories(int currentCount);
public void loadRepositories(boolean isRefreshin... | presenter.onErrorCancel();
verify(repositoriesViewState).hideError();
}
} | [FOCAL] public void RepositoriesPresenter.onErrorCancel()
[CLASS] class RepositoriesPresenter extends BasePresenter<RepositoriesView>
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] getViewState().hideError/0, getViewState/0 (inherited)
[CLASS-MEMBERS] RepositoriesPresenter(); void... | /* static context
[FOCAL] public void RepositoriesPresenter.onErrorCancel()
[CALLS-EXTERNAL] getViewState().hideError/0, getViewState/0 (inherited)
*/
| /* static context
[FOCAL] public void RepositoriesPresenter.onErrorCancel()
[CALLS-EXTERNAL] getViewState().hideError/0, getViewState/0 (inherited)
*/
class RepositoriesPresenter extends BasePresenter<RepositoriesView> {
public void onErrorCancel() {
getViewState().hideError();
}
public RepositoriesPresenter();... | true | ok | {"focal": {"class": "RepositoriesPresenter", "name": "onErrorCancel", "signature": "void onErrorCancel()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "RepositoriesPresenter", "kind": "class", "modifiers": "", "superclass": "BasePresenter<RepositoriesView>", "int... |
51592804_5 | class JenaExtensionRegistry extends WrappingRegistry implements ExtensionRegistry {
@Override
public Extension getExtension(final URI uri) {
return new JenaExtension(uri);
}
@Override @Reference // (target = "org.fcrepo.apix.registry.contains=org.fcrepo.apix.model.Extension") public void setRe... | final String EXPOSED_AT = "/svc:/123()";
when(registryDelegate.get(EXTENSION_URI)).thenReturn(rdfResource(EXTENSION,
ltriple(EXTENSION, PROP_EXPOSES_SERVICE_AT, EXPOSED_AT)));
assertEquals(Scope.REPOSITORY, toTest.getExtension(EXTENSION_URI).exposed().scope());
}
} | [FOCAL] @Override public Extension JenaExtensionRegistry.getExtension(URI uri)
[CLASS] class JenaExtensionRegistry extends WrappingRegistry implements ExtensionRegistry
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] JenaExtension
[INPUTS] branches=- | result=uri
[DATAFLOW] uri@param->L3
[CLA... | /* static context
[FOCAL] @Override public Extension JenaExtensionRegistry.getExtension(URI uri)
[INPUTS] branches=- | result=uri
[NEW] JenaExtension
*/
| /* static context
[FOCAL] @Override public Extension JenaExtensionRegistry.getExtension(URI uri)
[INPUTS] branches=- | result=uri
[NEW] JenaExtension
*/
class JenaExtensionRegistry extends WrappingRegistry implements ExtensionRegistry {
@Override
public Extension getExtension(final URI uri) {
return ne... | true | ok | {"focal": {"class": "JenaExtensionRegistry", "name": "getExtension", "signature": "Extension getExtension(URI uri)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "uri", "type": "URI"}], "return_type": "Extension"}, "class_info": {"name": "JenaExtensionRegistry", "kind": "class", "modifiers": ""... |
51621524_2 | class EtherFormatter {
public static String formatWeiAsEther(long wei) {
double ether = (double) wei / 1000000000000000000L;
return String.format(Locale.getDefault(), "%.2f" + "ETH", ether);
}
}
class EtherFormatterTest {
@Test
public void testFormatEtherFraction2() throws Exception... | assertThat(EtherFormatter.formatWeiAsEther(2119000000000000000L), is("2.12ETH"));
}
} | [FOCAL] public static String EtherFormatter.formatWeiAsEther(long wei)
[CLASS] class EtherFormatter
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] String.format/3, Locale.getDefault/0
[INPUTS] branches=- | result=wei
[DATAFLOW] ether@L2->L4; wei@param->L2
[TEST] EtherFormatterTest... | /* static context
[FOCAL] public static String EtherFormatter.formatWeiAsEther(long wei)
[INPUTS] branches=- | result=wei
[CALLS-EXTERNAL] String.format/3, Locale.getDefault/0
*/
| /* static context
[FOCAL] public static String EtherFormatter.formatWeiAsEther(long wei)
[INPUTS] branches=- | result=wei
[CALLS-EXTERNAL] String.format/3, Locale.getDefault/0
*/
class EtherFormatter {
public static String formatWeiAsEther(long wei) {
double ether = (double) wei / 1000000000000000000L;
... | true | ok | {"focal": {"class": "EtherFormatter", "name": "formatWeiAsEther", "signature": "String formatWeiAsEther(long wei)", "start_line": 3, "modifiers": "public static", "params": [{"name": "wei", "type": "long"}], "return_type": "String"}, "class_info": {"name": "EtherFormatter", "kind": "class", "modifiers": "", "superclass... |
51650903_1 | class ContentPresenter extends BasePresenter<ContentMvpView> {
public void getCats(List<Cat> cats) {
checkViewAttached();
mSubscription = mDataManager.getCats(cats)
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.io())
.subscribe(n... | List<Cat> cats = TestDataFactory.makeCats(10);
stubDataManagerGetCats(Single.just(cats));
mContentPresenter.getCats(cats);
verify(mMockContentMvpView).showCats(cats);
verify(mMockContentMvpView, never()).showCatsError();
}
} | [FOCAL] public void ContentPresenter.getCats(List<Cat> cats)
[CLASS] class ContentPresenter extends BasePresenter<ContentMvpView>
[METRICS] loc=19 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] checkViewAttached/0 (inherited), mDataManager.getCats(cats) .observeOn(AndroidSchedulers.m....subscribe... | /* static context
[FOCAL] public void ContentPresenter.getCats(List<Cat> cats)
[COLLABORATORS] field mDataManager getCats/1
[NEW] SingleSubscriber<List<Cat>>
[CALLS-EXTERNAL] checkViewAttached/0 (inherited), mDataManager.getCats(cats) .observeOn(AndroidSchedulers.m....subscribe/1, mDataManager.getCats(cats) .observeOn(... | /* static context
[FOCAL] public void ContentPresenter.getCats(List<Cat> cats)
[COLLABORATORS] field mDataManager getCats/1
[NEW] SingleSubscriber<List<Cat>>
[CALLS-EXTERNAL] checkViewAttached/0 (inherited), mDataManager.getCats(cats) .observeOn(AndroidSchedulers.m....subscribe/1, mDataManager.getCats(cats) .observeOn(... | true | ok | {"focal": {"class": "ContentPresenter", "name": "getCats", "signature": "void getCats(List<Cat> cats)", "start_line": 3, "modifiers": "public", "params": [{"name": "cats", "type": "List<Cat>"}], "return_type": "void"}, "class_info": {"name": "ContentPresenter", "kind": "class", "modifiers": "", "superclass": "BasePrese... |
51677030_11 | class WordnetPresenter implements MeaningPresenter {
public void onDownloadClicked() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
contextHelper.openDictionariesActivity();
controller.onDownloadClicked();
}else {
contextHelper.startDownload(Constants.WO... | presenter.onDownloadClicked();
verify(contextHelper).startDownload(Constants.WORDNET);
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
verify(controller).onDownloadClicked();
} else {
verify(controller, never()).onDownloadClicked();
}
}
} | [FOCAL] public void WordnetPresenter.onDownloadClicked()
[CLASS] class WordnetPresenter implements MeaningPresenter
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] ContextHelper.openDictionariesActivity/0, MeaningsController.onDownloadClicked/0, ContextHelper.startDownload/1
[FIELD... | /* static context
[FOCAL] public void WordnetPresenter.onDownloadClicked()
[PATH1] if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)=T
[PATH2] if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)=F
[COLLABORATORS] field contextHelper:ContextHelper openDictionariesActivity/0,startDownload/1; field controller:MeaningsCont... | /* static context
[FOCAL] public void WordnetPresenter.onDownloadClicked()
[PATH1] if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)=T
[PATH2] if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)=F
[COLLABORATORS] field contextHelper:ContextHelper openDictionariesActivity/0,startDownload/1; field controller:MeaningsCont... | true | ok | {"focal": {"class": "WordnetPresenter", "name": "onDownloadClicked", "signature": "void onDownloadClicked()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "WordnetPresenter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "MeaningPresenter", "... |
51719162_1 | class RxCurryingFunc {
public static <A, B, R> Func1<A, Func1<B, R>> curry(final Func2<A, B, R> func) {
return new Func1<A, Func1<B, R>>() {
@Override
public Func1<B, R> call(final A a) {
return new Func1<B, R>() {
@Override
pu... | Func1<String, Func1<String, Func1<String, Func1<String, Func1<String, String>>>>> secondVariable = RxCurryingFunc
.curry(new Func5<String, String, String, String, String, String>() {
@Override
public String call(String first, String second, String third, S... | [FOCAL] public static Func1<A, Func1<B, R>> RxCurryingFunc.curry(Func2<A, B, R> func)
[CLASS] class RxCurryingFunc
[METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Func2<A, B, R>.call/2
[NEW] Func1<A, Func1<B, R>>, Func1<B, R>
[INPUTS] branches=- | result=func
[COLLABORATORS] param... | /* static context
[FOCAL] public static Func1<A, Func1<B, R>> RxCurryingFunc.curry(Func2<A, B, R> func)
[INPUTS] branches=- | result=func
[COLLABORATORS] param func:Func2<A, B, R> call/2
[NEW] Func1<A, Func1<B, R>>, Func1<B, R>
[CALLS-EXTERNAL] Func2<A, B, R>.call/2
*/
| /* static context
[FOCAL] public static Func1<A, Func1<B, R>> RxCurryingFunc.curry(Func2<A, B, R> func)
[INPUTS] branches=- | result=func
[COLLABORATORS] param func:Func2<A, B, R> call/2
[NEW] Func1<A, Func1<B, R>>, Func1<B, R>
[CALLS-EXTERNAL] Func2<A, B, R>.call/2
*/
class RxCurryingFunc {
public static <A, B, R... | true | ok | {"focal": {"class": "RxCurryingFunc", "name": "curry", "signature": "Func1<A, Func1<B, R>> curry(Func2<A, B, R> func)", "start_line": 3, "modifiers": "public static", "params": [{"name": "func", "type": "Func2<A, B, R>"}], "return_type": "Func1<A, Func1<B, R>>"}, "class_info": {"name": "RxCurryingFunc", "kind": "class"... |
51724669_1 | class OsgiaasJavaCompilerService implements JavacService {
@Override
public <T> Optional<Class<T>> compileJavaClass( ClassLoaderContext classLoaderContext,
String qualifiedName,
String code,
... | String classDef = "package com.acme.util;" +
"import java.util.function.IntSupplier;" +
"public class ZeroSupplier implements IntSupplier {" +
"public int getAsInt() { return 0; }" +
"}";
Class<?> cls = javacService.compileJavaClass( Defau... | [FOCAL] @Override public Optional<Class<T>> OsgiaasJavaCompilerService.compileJavaClass(ClassLoaderContext classLoaderContext, String qualifiedName, String code, PrintStream writer)
[CLASS] class OsgiaasJavaCompilerService implements JavacService
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CAL... | /* static context
[FOCAL] @Override public Optional<Class<T>> OsgiaasJavaCompilerService.compileJavaClass(ClassLoaderContext classLoaderContext, String qualifiedName, String code, PrintStream writer)
[INPUTS] branches=- | result=classLoaderContext, code, qualifiedName, writer
[CALLS-INTERNAL] OsgiaasJavaCompiler getOsg... | /* static context
[FOCAL] @Override public Optional<Class<T>> OsgiaasJavaCompilerService.compileJavaClass(ClassLoaderContext classLoaderContext, String qualifiedName, String code, PrintStream writer)
[INPUTS] branches=- | result=classLoaderContext, code, qualifiedName, writer
[CALLS-INTERNAL] OsgiaasJavaCompiler getOsg... | true | ok | {"focal": {"class": "OsgiaasJavaCompilerService", "name": "compileJavaClass", "signature": "Optional<Class<T>> compileJavaClass(ClassLoaderContext classLoaderContext, String qualifiedName, String code, PrintStream writer)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "classLoaderContext", "typ... |
51744006_40 | class Ngsi2Client {
public ListenableFuture<String[]> bulkRegister(BulkRegisterRequest bulkRegisterRequest) {
return adapt(request(HttpMethod.POST, UriComponentsBuilder.fromHttpUrl(baseURL).path("v2/op/register").toUriString(), bulkRegisterRequest, String[].class));
}
private Ngsi2Client();
p... |
mockServer.expect(requestTo(baseURL + "/v2/op/register"))
.andExpect(method(HttpMethod.POST))
.andExpect(header("Content-Type", MediaType.APPLICATION_JSON_VALUE))
.andExpect(jsonPath("$.actionType").value("UPDATE"))
.andExpect(jsonPath("$.registra... | [FOCAL] public ListenableFuture<String[]> Ngsi2Client.bulkRegister(BulkRegisterRequest bulkRegisterRequest)
[CLASS] class Ngsi2Client
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] ListenableFuture<ResponseEntity<T>> request(HttpMethod method, String uri, U body, Class<T> response... | /* static context
[FOCAL] public ListenableFuture<String[]> Ngsi2Client.bulkRegister(BulkRegisterRequest bulkRegisterRequest)
[INPUTS] branches=- | result=bulkRegisterRequest, baseURL
[CALLS-INTERNAL] ListenableFuture<ResponseEntity<T>> request(HttpMethod method, String uri, U body, Class<T> responseType); ListenableFu... | /* static context
[FOCAL] public ListenableFuture<String[]> Ngsi2Client.bulkRegister(BulkRegisterRequest bulkRegisterRequest)
[INPUTS] branches=- | result=bulkRegisterRequest, baseURL
[CALLS-INTERNAL] ListenableFuture<ResponseEntity<T>> request(HttpMethod method, String uri, U body, Class<T> responseType); ListenableFu... | true | ok | {"focal": {"class": "Ngsi2Client", "name": "bulkRegister", "signature": "ListenableFuture<String[]> bulkRegister(BulkRegisterRequest bulkRegisterRequest)", "start_line": 3, "modifiers": "public", "params": [{"name": "bulkRegisterRequest", "type": "BulkRegisterRequest"}], "return_type": "ListenableFuture<String[]>"}, "c... |
51754367_9 | class FixValue implements FixNode {
public T getValue() {
return value;
}
public FixValue(FixType type, T value);
public FixValue(String name);
public FixValue(String name, FixType type);
public FixValue(String name, FixType type, T value);
@SuppressWarnings("unchecked") public void assign(FixV... | FixValue<Integer> op1 = new FixValue<Integer>("op1", FixType.intType, 3);
FixValue<Integer> op2 = new FixValue<Integer>("op2", FixType.intType, 4);
assertEquals(Integer.valueOf(7), fixValueOperations.add.apply(op1, op2).getValue());
}
} | [FOCAL] public T FixValue.getValue()
[CLASS] class FixValue implements FixNode
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] FixValue(FixType type, T value); FixValue(String name); FixValue(String name, FixType type); FixValue(String name, FixType type, T value); void assign(FixVa... | /* static context
[FOCAL] public T FixValue.getValue()
*/
| /* static context
[FOCAL] public T FixValue.getValue()
*/
class FixValue implements FixNode {
public T getValue() {
return value;
}
public FixValue(FixType type, T value);
public FixValue(String name);
public FixValue(String name, FixType type);
public FixValue(String name, FixType type, T value);... | true | ok | {"focal": {"class": "FixValue", "name": "getValue", "signature": "T getValue()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "T"}, "class_info": {"name": "FixValue", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "FixNode", "fields": [{"name": "fixValueOperations", "type": ... |
51787752_4 | class S3StorageDriver implements BackupStorageDriver {
String getPrefixKey(BackupRestoreContext ctx) throws URISyntaxException {
URI uri = new URI(ctx.getExternalLocation());
String[] segments = uri.getPath().split("/");
int startIndex = uri.getScheme().equals(AmazonS3Client.S3_SERVICE_NAM... | String backupName = "backup-name";
String nestedPath = "nested-path";
BackupRestoreContext backupRestoreContext = BackupRestoreContext.create(
"node-id",
backupName,
"s3://cassandrabackup/" + nestedPath,
"local-location",
... | [FOCAL] String S3StorageDriver.getPrefixKey(BackupRestoreContext ctx)
[CLASS] class S3StorageDriver implements BackupStorageDriver
[METRICS] loc=18 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] BackupRestoreContext.getExternalLocation/0, uri.getPath().split/1, URI.getPath/0, uri.getScheme().equa... | /* static context
[FOCAL] String S3StorageDriver.getPrefixKey(BackupRestoreContext ctx)
[PATH1] for(i<segments.length)=T -> if(i < segments.length - 1)=T -> exit loop -> return prefixKey
[PATH2] for(i<segments.length)=F -> return prefixKey
[PATH3] for(i<segments.length)=T -> if(i < segments.length - 1)=F -> exit loop -... | /* static context
[FOCAL] String S3StorageDriver.getPrefixKey(BackupRestoreContext ctx)
[PATH1] for(i<segments.length)=T -> if(i < segments.length - 1)=T -> exit loop -> return prefixKey
[PATH2] for(i<segments.length)=F -> return prefixKey
[PATH3] for(i<segments.length)=T -> if(i < segments.length - 1)=F -> exit loop -... | true | ok | {"focal": {"class": "S3StorageDriver", "name": "getPrefixKey", "signature": "String getPrefixKey(BackupRestoreContext ctx) throws URISyntaxException", "start_line": 3, "modifiers": "", "params": [{"name": "ctx", "type": "BackupRestoreContext"}], "return_type": "String"}, "class_info": {"name": "S3StorageDriver", "kind"... |
51848128_26 | class PatternMatch {
public boolean matches(String value)
{
return compliedPattern.matcher(value).matches();
}
public PatternMatch(String pattern);
private String pattern(String pattern);
}
class PatternMatchTest {
@Test
public void testMatches()
{
| assertThat(new PatternMatch("/").matches("/aaa/"), is(false));
assertThat(new PatternMatch("aaa").matches("b"), is(false));
assertThat(new PatternMatch("aaa").matches("aaa"), is(true));
assertThat(new PatternMatch("a*c").matches("abc"), is(true));
assertThat(new PatternMatch("a... | [FOCAL] public boolean PatternMatch.matches(String value)
[CLASS] class PatternMatch
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] compliedPattern.matcher(value).matches/0, compliedPattern.matcher/1
[INPUTS] branches=- | result=value
[COLLABORATORS] field compliedPattern matcher/... | /* static context
[FOCAL] public boolean PatternMatch.matches(String value)
[INPUTS] branches=- | result=value
[COLLABORATORS] field compliedPattern matcher/1
[CALLS-EXTERNAL] compliedPattern.matcher(value).matches/0, compliedPattern.matcher/1
*/
| /* static context
[FOCAL] public boolean PatternMatch.matches(String value)
[INPUTS] branches=- | result=value
[COLLABORATORS] field compliedPattern matcher/1
[CALLS-EXTERNAL] compliedPattern.matcher(value).matches/0, compliedPattern.matcher/1
*/
class PatternMatch {
public boolean matches(String value)
{
... | true | ok | {"focal": {"class": "PatternMatch", "name": "matches", "signature": "boolean matches(String value)", "start_line": 3, "modifiers": "public", "params": [{"name": "value", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "PatternMatch", "kind": "class", "modifiers": "", "superclass": null, "interface... |
51858172_86 | class HttpCallImplWithConnectionPooling implements HttpCall<T> {
@Override
public T doPost(final String url, final Object data, final Class<T> toMap, final Map<String, String> headers,
final Map<String, String> queryParams, final String accept, final String type,
final i... | stubFor(post(urlEqualTo("/test"))
.withHeader(ACCEPT, equalTo(accept))
.withHeader(CONTENT_TYPE, equalTo(type))
.withHeader("foo", equalTo(map.get("foo")))
.withHeader("dead", equalTo(map.get("dead")))
.willReturn(aResponse().withSt... | [FOCAL] @Override public T HttpCallImplWithConnectionPooling.doPost(String url, Object data, Class<T> toMap, Map<String, String> headers, Map<String, String> queryParams, String accept, String type, int expectedStatus)
[CLASS] class HttpCallImplWithConnectionPooling implements HttpCall<T>
[METRICS] loc=6 cc=1 branches=... | /* static context
[FOCAL] @Override public T HttpCallImplWithConnectionPooling.doPost(String url, Object data, Class<T> toMap, Map<String, String> headers, Map<String, String> queryParams, String accept, String type, int expectedStatus)
[INPUTS] branches=- | result=accept, data, expectedStatus, headers, queryParams, to... | /* static context
[FOCAL] @Override public T HttpCallImplWithConnectionPooling.doPost(String url, Object data, Class<T> toMap, Map<String, String> headers, Map<String, String> queryParams, String accept, String type, int expectedStatus)
[INPUTS] branches=- | result=accept, data, expectedStatus, headers, queryParams, to... | true | ok | {"focal": {"class": "HttpCallImplWithConnectionPooling", "name": "doPost", "signature": "T doPost(String url, Object data, Class<T> toMap, Map<String, String> headers, Map<String, String> queryParams, String accept, String type, int expectedStatus)", "start_line": 3, "modifiers": "@Override public", "params": [{"name":... |
51861689_5 | class ClusterList {
public List<String> get() {
return Lists.newArrayList(this.config.clusters().trim().split(","))
.stream()
.filter(cluster -> !cluster.isEmpty())
.collect(Collectors.toList());
}
public ClusterList(Config config);
}
class ClusterListTest {
... | final List<String> clusters = new ClusterList(
new ClusterListTest.FakeConfig("cluster1,cluster2,cluster3")
).get();
Assertions.assertThat(clusters)
.hasSize(3)
.contains("cluster1", "cluster2", "cluster3");
}
} | [FOCAL] public List<String> ClusterList.get()
[CLASS] class ClusterList
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Lists.newArrayList(this.config.clusters().trim().split(",....collect/1, Lists.newArrayList(this.config.clusters().trim().split(",....filter/1, Lists.newArrayList(... | /* static context
[FOCAL] public List<String> ClusterList.get()
[COLLABORATORS] field config clusters/0; field cluster isEmpty/0
[FIELDS] read=config
[CALLS-EXTERNAL] Lists.newArrayList(this.config.clusters().trim().split(",....collect/1, Lists.newArrayList(this.config.clusters().trim().split(",....filter/1, Lists.newA... | /* static context
[FOCAL] public List<String> ClusterList.get()
[COLLABORATORS] field config clusters/0; field cluster isEmpty/0
[FIELDS] read=config
[CALLS-EXTERNAL] Lists.newArrayList(this.config.clusters().trim().split(",....collect/1, Lists.newArrayList(this.config.clusters().trim().split(",....filter/1, Lists.newA... | true | ok | {"focal": {"class": "ClusterList", "name": "get", "signature": "List<String> get()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<String>"}, "class_info": {"name": "ClusterList", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "C... |
51906847_3 | class HistoneProcessingExceptionProcessor {
public final void process(HttpServletRequest request, HttpServletResponse response,
Exception exception, String templateLocation) throws Exception {
Exception cause = getRootCause(exception);
if (supports(cause.getClass())) {... | try {
exceptionProcessor.process(request, response, new Exception("Some exception occured"), "someLocation");
fail("Exception should be thrown");
} catch (Exception ex) {
assertThat(ex.getMessage(),
is("Error evaluating histone template 'someLocati... | [FOCAL] public final void HistoneProcessingExceptionProcessor.process(HttpServletRequest request, HttpServletResponse response, Exception exception, String templateLocation)
[CLASS] class HistoneProcessingExceptionProcessor
[METRICS] loc=11 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] Exception... | /* static context
[FOCAL] public final void HistoneProcessingExceptionProcessor.process(HttpServletRequest request, HttpServletResponse response, Exception exception, String templateLocation)
[PATH1] if(supports(cause.getClass()))=T -> return
[PATH2] if(supports(cause.getClass()))=F -> if(next != null)=T
[PATH3] if(sup... | /* static context
[FOCAL] public final void HistoneProcessingExceptionProcessor.process(HttpServletRequest request, HttpServletResponse response, Exception exception, String templateLocation)
[PATH1] if(supports(cause.getClass()))=T -> return
[PATH2] if(supports(cause.getClass()))=F -> if(next != null)=T
[PATH3] if(sup... | true | ok | {"focal": {"class": "HistoneProcessingExceptionProcessor", "name": "process", "signature": "void process(HttpServletRequest request, HttpServletResponse response, Exception exception, String templateLocation) throws Exception", "start_line": 3, "modifiers": "public final", "params": [{"name": "request", "type": "HttpSe... |
51909350_89 | class NgsiClient {
public HttpHeaders getRequestHeaders() {
HttpHeaders requestHeaders = new HttpHeaders();
requestHeaders.setContentType(MediaType.APPLICATION_XML);
requestHeaders.setAccept(Collections.singletonList(MediaType.APPLICATION_XML));
return requestHeaders;
}
pub... | HttpHeaders httpHeaders = ngsiClient.getRequestHeaders(null);
assertEquals(MediaType.APPLICATION_XML, httpHeaders.getContentType());
assertTrue(httpHeaders.getAccept().contains(MediaType.APPLICATION_XML));
}
} | [FOCAL] public HttpHeaders NgsiClient.getRequestHeaders()
[CLASS] class NgsiClient
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] HttpHeaders.setContentType/1, HttpHeaders.setAccept/1, Collections.singletonList/1
[NEW] HttpHeaders
[DATAFLOW] requestHeaders@L2->L3,L4,L5
[CLASS-MEMB... | /* static context
[FOCAL] public HttpHeaders NgsiClient.getRequestHeaders()
[NEW] HttpHeaders
[CALLS-EXTERNAL] HttpHeaders.setContentType/1, HttpHeaders.setAccept/1, Collections.singletonList/1
*/
| /* static context
[FOCAL] public HttpHeaders NgsiClient.getRequestHeaders()
[NEW] HttpHeaders
[CALLS-EXTERNAL] HttpHeaders.setContentType/1, HttpHeaders.setAccept/1, Collections.singletonList/1
*/
class NgsiClient {
public HttpHeaders getRequestHeaders() {
HttpHeaders requestHeaders = new HttpHeaders();
... | true | ok | {"focal": {"class": "NgsiClient", "name": "getRequestHeaders", "signature": "HttpHeaders getRequestHeaders()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "HttpHeaders"}, "class_info": {"name": "NgsiClient", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"... |
51920891_21 | class FileToRelativePath implements Function<File, String> {
@Override
public String apply(File f) {
return this.workingDir.toURI().relativize(f.toURI()).toString();
}
public FileToRelativePath(File workingDir);
@Rule
public TemporaryFolder tempFolder;
}
class FileToRelativePathTest {
@Rule
p... | public void testApply(String path) throws IOException {
File base = this.tempFolder.newFolder();
Assert.assertEquals(path, new FileToRelativePath(base).apply(new File(base, path)));
}
} | [FOCAL] @Override public String FileToRelativePath.apply(File f)
[CLASS] class FileToRelativePath implements Function<File, String>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] this.workingDir.toURI().relativize(f.toURI()).toString/0, this.workingDir.toURI().relativize/1, this.w... | /* static context
[FOCAL] @Override public String FileToRelativePath.apply(File f)
[INPUTS] branches=- | result=f
[COLLABORATORS] field workingDir toURI/0; param f:File toURI/0
[FIELDS] read=workingDir
[CALLS-EXTERNAL] this.workingDir.toURI().relativize(f.toURI()).toString/0, this.workingDir.toURI().relativize/1, this.... | /* static context
[FOCAL] @Override public String FileToRelativePath.apply(File f)
[INPUTS] branches=- | result=f
[COLLABORATORS] field workingDir toURI/0; param f:File toURI/0
[FIELDS] read=workingDir
[CALLS-EXTERNAL] this.workingDir.toURI().relativize(f.toURI()).toString/0, this.workingDir.toURI().relativize/1, this.... | true | ok | {"focal": {"class": "FileToRelativePath", "name": "apply", "signature": "String apply(File f)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "f", "type": "File"}], "return_type": "String"}, "class_info": {"name": "FileToRelativePath", "kind": "class", "modifiers": "", "superclass": null, "inter... |
51934971_1 | class WordToPdfRenditionProvider implements RenditionProvider {
@Override
public InputStream convert(InputStream fromInputSource, String toMimeType) {
try {
WordprocessingMLPackage pkg = WordprocessingMLPackage.load(fromInputSource);
FieldUpdater updater = new FieldUpdater(pkg);
updater.update(true);
... | InputStream converted = service.convert(this.getClass().getResourceAsStream("/sample-docx2.docx"),"application/pdf");
assertThat(converted.available(), is(greaterThan(0)));
assertThat(((ObservableInputStream)converted).getObservers(), hasItem(is(instanceOf(FileRemover.class))));
String content = pdfToText(con... | [FOCAL] @Override public InputStream WordToPdfRenditionProvider.convert(InputStream fromInputSource, String toMimeType)
[CLASS] class WordToPdfRenditionProvider implements RenditionProvider
[METRICS] loc=21 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] WordprocessingMLPackage.load/1, FieldUpdate... | /* static context
[FOCAL] @Override public InputStream WordToPdfRenditionProvider.convert(InputStream fromInputSource, String toMimeType)
[PATH1] try-body throws -> return null
[PATH2] return new ObservableInputStream(new FileInputStream(tmpFile), new FileRem...
[EXCEPTIONS] catches Exception e
[NEW] FieldUpdater, java... | /* static context
[FOCAL] @Override public InputStream WordToPdfRenditionProvider.convert(InputStream fromInputSource, String toMimeType)
[PATH1] try-body throws -> return null
[PATH2] return new ObservableInputStream(new FileInputStream(tmpFile), new FileRem...
[EXCEPTIONS] catches Exception e
[NEW] FieldUpdater, java... | true | ok | {"focal": {"class": "WordToPdfRenditionProvider", "name": "convert", "signature": "InputStream convert(InputStream fromInputSource, String toMimeType)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "fromInputSource", "type": "InputStream"}, {"name": "toMimeType", "type": "String"}], "return_typ... |
51949991_110 | class LinuxSyslogYearSetter {
@Override
public String toString() {
String str = "";
str += " source=" + m_source;
str += " year=" + m_currentYear;
str += " lastSeenMessage=" + DateTimeUtils.timestampToHumanDateAndTimeAndStampUTC(m_lastSeenMessageDate.getMillis());
retur... | String source = "aSource";
int nineties = 1990;
lsys = new LinuxSyslogYearSetter(source, nineties);
DateTimeZone dtz = DateTimeZone.forID("America/New_York");
DateTime dt = new DateTime(0L, dtz);
lsys.getDesiredYear(dt);
String actual = lsys.toString();
a... | [FOCAL] @Override public String LinuxSyslogYearSetter.toString()
[CLASS] class LinuxSyslogYearSetter
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] DateTimeUtils.timestampToHumanDateAndTimeAndStampUTC/1, m_lastSeenMessageDate.getMillis/0
[COLLABORATORS] field m_lastSeenMessageDate... | /* static context
[FOCAL] @Override public String LinuxSyslogYearSetter.toString()
[COLLABORATORS] field m_lastSeenMessageDate getMillis/0
[CALLS-EXTERNAL] DateTimeUtils.timestampToHumanDateAndTimeAndStampUTC/1, m_lastSeenMessageDate.getMillis/0
*/
| /* static context
[FOCAL] @Override public String LinuxSyslogYearSetter.toString()
[COLLABORATORS] field m_lastSeenMessageDate getMillis/0
[CALLS-EXTERNAL] DateTimeUtils.timestampToHumanDateAndTimeAndStampUTC/1, m_lastSeenMessageDate.getMillis/0
*/
class LinuxSyslogYearSetter {
@Override
public String toString... | true | ok | {"focal": {"class": "LinuxSyslogYearSetter", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "LinuxSyslogYearSetter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields":... |
51958035_0 | class KeywordOptimizerUtil {
public static StatsEstimate calculateMean(StatsEstimate min, StatsEstimate max) {
Money meanAverageCpc = calculateMean(min.getAverageCpc(), max.getAverageCpc());
Double meanAveragePosition = calculateMean(min.getAveragePosition(), max.getAveragePosition());
Double meanClicks ... | Money lowCpc = new Money();
lowCpc.setMicroAmount(1_000_000L);
Money lowTotal = new Money();
lowTotal.setMicroAmount(10_000_000L);
StatsEstimate lowEstimate = new StatsEstimate(lowCpc, 3.0, 0.01, 1000.0F, 100_000.0F, lowTotal);
Money highCpc = new Money();
highCpc.setMicroAmount(9_000_000L)... | [FOCAL] public static StatsEstimate KeywordOptimizerUtil.calculateMean(StatsEstimate min, StatsEstimate max)
[CLASS] class KeywordOptimizerUtil
[METRICS] loc=36 cc=7 branches=6 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] Money calculateMean(Money value1, Money value2)
[CALLS-EXTERNAL] StatsEstimate.getAverage... | /* static context
[FOCAL] public static StatsEstimate KeywordOptimizerUtil.calculateMean(StatsEstimate min, StatsEstimate max)
[PATH1] if(meanAverageCpc != null)=T -> if(meanAveragePosition != null)=T -> if(meanClicks != null)=T -> if(meanImpressions != null)=T -> if(meanCtr != null)=T -> if(meanTotalCost != null)=T ->... | /* static context
[FOCAL] public static StatsEstimate KeywordOptimizerUtil.calculateMean(StatsEstimate min, StatsEstimate max)
[PATH1] if(meanAverageCpc != null)=T -> if(meanAveragePosition != null)=T -> if(meanClicks != null)=T -> if(meanImpressions != null)=T -> if(meanCtr != null)=T -> if(meanTotalCost != null)=T ->... | true | ok | {"focal": {"class": "KeywordOptimizerUtil", "name": "calculateMean", "signature": "StatsEstimate calculateMean(StatsEstimate min, StatsEstimate max)", "start_line": 3, "modifiers": "public static", "params": [{"name": "min", "type": "StatsEstimate"}, {"name": "max", "type": "StatsEstimate"}], "return_type": "StatsEstim... |
51960935_1 | class InfiniteScrollListener extends RecyclerView.OnScrollListener {
protected boolean canLoadMoreItems() {
final int visibleItemsCount = layoutManager.getChildCount();
final int totalItemsCount = layoutManager.getItemCount();
final int pastVisibleItemsCount = layoutManager.findFirstVisibleItemPosition()... | // given
int visibleItemsCount = 10;
int totalItemsCount = 20;
int pastVisibleItemsCount = 15;
int itemsPerRequest = 10;
InfiniteScrollListener listener = createListener(manager, itemsPerRequest);
// when
when(manager.getChildCount()).thenReturn(visibleItemsCount);
when(manager.getI... | [FOCAL] protected boolean InfiniteScrollListener.canLoadMoreItems()
[CLASS] class InfiniteScrollListener extends RecyclerView.OnScrollListener
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] layoutManager.getChildCount/0, layoutManager.getItemCount/0, layoutManager.findFirstVisible... | /* static context
[FOCAL] protected boolean InfiniteScrollListener.canLoadMoreItems()
[COLLABORATORS] field layoutManager getChildCount/0,getItemCount/0,findFirstVisibleItemPosition/0
[CALLS-EXTERNAL] layoutManager.getChildCount/0, layoutManager.getItemCount/0, layoutManager.findFirstVisibleItemPosition/0
*/
| /* static context
[FOCAL] protected boolean InfiniteScrollListener.canLoadMoreItems()
[COLLABORATORS] field layoutManager getChildCount/0,getItemCount/0,findFirstVisibleItemPosition/0
[CALLS-EXTERNAL] layoutManager.getChildCount/0, layoutManager.getItemCount/0, layoutManager.findFirstVisibleItemPosition/0
*/
class Infi... | true | ok | {"focal": {"class": "InfiniteScrollListener", "name": "canLoadMoreItems", "signature": "boolean canLoadMoreItems()", "start_line": 3, "modifiers": "protected", "params": [], "return_type": "boolean"}, "class_info": {"name": "InfiniteScrollListener", "kind": "class", "modifiers": "", "superclass": "RecyclerView.OnScroll... |
51989270_60 | class ViewableWriter implements MessageBodyWriter<Viewable> {
@Override
public void writeTo(Viewable viewable, Class<?> aClass, Type type, Annotation[] annotations, MediaType mediaType,
MultivaluedMap<String, Object> headers, OutputStream out)
throws IOException, WebApplicat... | ViewableWriter writer = new ViewableWriter();
Field mvcField = writer.getClass().getDeclaredField("mvc");
mvcField.setAccessible(true);
mvcField.set(writer, new MvcContextImpl());
ViewEngineFinder finder = EasyMock.createStrictMock(ViewEngineFinder.class);
Field... | [FOCAL] @Override public void ViewableWriter.writeTo(Viewable viewable, Class<?> aClass, Type type, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> headers, OutputStream out)
[CLASS] class ViewableWriter implements MessageBodyWriter<Viewable>
[METRICS] loc=56 cc=6 branches=4 loops=0 return... | /* static context
[FOCAL] @Override public void ViewableWriter.writeTo(Viewable viewable, Class<?> aClass, Type type, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> headers, OutputStream out)
[THROWS-WHEN] ServerErrorException when engine == null
[THROWS-WHEN] ServerErrorException when !(... | /* static context
[FOCAL] @Override public void ViewableWriter.writeTo(Viewable viewable, Class<?> aClass, Type type, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> headers, OutputStream out)
[THROWS-WHEN] ServerErrorException when engine == null
[THROWS-WHEN] ServerErrorException when !(... | true | ok | {"focal": {"class": "ViewableWriter", "name": "writeTo", "signature": "void writeTo(Viewable viewable, Class<?> aClass, Type type, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> headers, OutputStream out) throws IOException, WebApplicationException", "start_line": 3, "modifiers": "@Overri... |
52030103_407 | class Viewport {
public boolean intersect(int x, int y, int width, int height) {
if (this.width > 0 && this.height > 0
&& width > 0 && height > 0
&& this.x < (x + width) && x < (this.x + this.width)
&& this.y < (y + height) && y < (this.y + this.height)) {
i... | Viewport a = new Viewport(30, 100, 3, 3);
Viewport adjacentEast = new Viewport(31, 103, 1, 1);
Viewport copy = new Viewport(a);
boolean intersected = a.intersect(adjacentEast);
assertFalse("adjacent, no intersection", intersected);
assertEquals("adjacent, no changed", a... | [FOCAL] public boolean Viewport.intersect(int x, int y, int width, int height)
[CLASS] class Viewport
[METRICS] loc=29 cc=6 branches=5 loops=0 returns=2 throws=0 nesting=2
[FIELDS] read=height, width, x, y | write=height, width, x, y
[PATH1] if((this.width > 0 && this.height > 0 && width > 0 && height > 0 && this.x < (... | /* static context
[FOCAL] public boolean Viewport.intersect(int x, int y, int width, int height)
[PATH1] if((this.width > 0 && this.height > 0 && width > 0 && height > 0 && this.x < (x + width) && x < (this.x + this.width) &&...)=T -> if(this.x < x)=T -> if(this.y < y)=T -> if((this.x + this.width) > (x + width))=T -> ... | /* static context
[FOCAL] public boolean Viewport.intersect(int x, int y, int width, int height)
[PATH1] if((this.width > 0 && this.height > 0 && width > 0 && height > 0 && this.x < (x + width) && x < (this.x + this.width) &&...)=T -> if(this.x < x)=T -> if(this.y < y)=T -> if((this.x + this.width) > (x + width))=T -> ... | true | ok | {"focal": {"class": "Viewport", "name": "intersect", "signature": "boolean intersect(int x, int y, int width, int height)", "start_line": 3, "modifiers": "public", "params": [{"name": "x", "type": "int"}, {"name": "y", "type": "int"}, {"name": "width", "type": "int"}, {"name": "height", "type": "int"}], "return_type": ... |
52040340_135 | class HTTPSCustomizer implements Customizer {
public void customize() {
if (!this.managementCoreService.isUnsatisfied()) {
if (certInfo.isValid()) {
ManagementCoreService management = this.managementCoreService.get();
if (management == null) {
... | HTTPSCustomizer customizer = new HTTPSCustomizer();
customizer.undertow = new UndertowFraction();
customizer.undertow.applyDefaults();
customizer.certInfo = new CertInfo("myhost.com", "./my/path");
customizer.managementCoreService = new MockInstance<>(new ManagementCoreService())... | [FOCAL] public void HTTPSCustomizer.customize()
[CLASS] class HTTPSCustomizer implements Customizer
[METRICS] loc=36 cc=7 branches=5 loops=1 returns=0 throws=1 nesting=4
[CALLS-INTERNAL] void handleSelfSignedCertificateHost(SslServerIdentity identity)
[CALLS-EXTERNAL] this.managementCoreService.isUnsatisfied/0, certInf... | /* static context
[FOCAL] public void HTTPSCustomizer.customize()
[THROWS-WHEN] SwarmMessages.MESSAGES.httpsRequiresManagementFraction() when !this.managementCoreService.isUnsatisfied() && certInfo.isValid() && management == null
[PATH1] if(!this.managementCoreService.isUnsatisfied())=T -> if(certInfo.isValid())=T -> i... | /* static context
[FOCAL] public void HTTPSCustomizer.customize()
[THROWS-WHEN] SwarmMessages.MESSAGES.httpsRequiresManagementFraction() when !this.managementCoreService.isUnsatisfied() && certInfo.isValid() && management == null
[PATH1] if(!this.managementCoreService.isUnsatisfied())=T -> if(certInfo.isValid())=T -> i... | true | ok | {"focal": {"class": "HTTPSCustomizer", "name": "customize", "signature": "void customize()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "HTTPSCustomizer", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Customizer", "fields": [], "members": ... |
52095301_4 | class Experiment {
public T run(Callable<T> control, Callable<T> candidate) throws Exception {
if (isAsync()) {
return runAsync(control, candidate);
} else {
return runSync(control, candidate);
}
}
public Experiment(MetricsProvider<?> metricsProvider);
... | Integer val = new Experiment<Integer>("test", true, new NoopMetricsProvider())
.run(() -> null, () -> null);
assertThat(val).isNull();
}
} | [FOCAL] public T Experiment.run(Callable<T> control, Callable<T> candidate)
[CLASS] class Experiment
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] T runAsync(Callable<T> control, Callable<T> candidate); T runSync(Callable<T> control, Callable<T> candidate); boolean isAsync()
[EXC... | /* static context
[FOCAL] public T Experiment.run(Callable<T> control, Callable<T> candidate)
[PATH1] if(isAsync())=T -> return runAsync(control, candidate)
[PATH2] if(isAsync())=F -> return runSync(control, candidate)
[INPUTS] branches=- | result=candidate, control
[EXCEPTIONS] declares Exception
[CALLS-INTERNAL] T ru... | /* static context
[FOCAL] public T Experiment.run(Callable<T> control, Callable<T> candidate)
[PATH1] if(isAsync())=T -> return runAsync(control, candidate)
[PATH2] if(isAsync())=F -> return runSync(control, candidate)
[INPUTS] branches=- | result=candidate, control
[EXCEPTIONS] declares Exception
[CALLS-INTERNAL] T ru... | true | ok | {"focal": {"class": "Experiment", "name": "run", "signature": "T run(Callable<T> control, Callable<T> candidate) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "control", "type": "Callable<T>"}, {"name": "candidate", "type": "Callable<T>"}], "return_type": "T"}, "class_info": {"name": "E... |
52113991_5 | class NewestVersionSelector extends ConflictResolver.VersionSelector {
@Override
public void selectVersion(ConflictResolver.ConflictContext context) throws RepositoryException {
ConflictGroup group = new ConflictGroup();
for (ConflictResolver.ConflictItem item : context.getItems()) {
... | NewestVersionSelector selector = new NewestVersionSelector();
List<ConflictResolver.ConflictItem> items = new ArrayList<>();
items.add(new ConflictResolver.ConflictItem(null, createNode("1.0.1.Alpha4"), 0, 0));
items.add(new ConflictResolver.ConflictItem(null, createNode("1.0.0.Final"),... | [FOCAL] @Override public void NewestVersionSelector.selectVersion(ConflictResolver.ConflictContext context)
[CLASS] class NewestVersionSelector extends ConflictResolver.VersionSelector
[METRICS] loc=32 cc=9 branches=7 loops=1 returns=0 throws=0 nesting=4
[CALLS-INTERNAL] boolean isAcceptable(ConflictGroup group, Versio... | /* static context
[FOCAL] @Override public void NewestVersionSelector.selectVersion(ConflictResolver.ConflictContext context)
[PATH1] foreach(ConflictResolver.ConflictItem item : context.getItems())=T -> if(hardConstraint)=T -> if(group.constraints.add(constraint))=T -> if(group.winner != null && !constraint.containsVe... | /* static context
[FOCAL] @Override public void NewestVersionSelector.selectVersion(ConflictResolver.ConflictContext context)
[PATH1] foreach(ConflictResolver.ConflictItem item : context.getItems())=T -> if(hardConstraint)=T -> if(group.constraints.add(constraint))=T -> if(group.winner != null && !constraint.containsVe... | true | ok | {"focal": {"class": "NewestVersionSelector", "name": "selectVersion", "signature": "void selectVersion(ConflictResolver.ConflictContext context) throws RepositoryException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "context", "type": "ConflictResolver.ConflictContext"}], "return_type": "voi... |
52139656_0 | class EnumAdapter implements IPreferenceAdapter<T> {
@Nonnull @Override
public Observable<T> observe(@Nonnull String key, @Nonnull T defaultValue, @Nonnull IGateway gateway) {
return gateway.observeString(key, toString(defaultValue)).map(new Function<String, T>() {
@Override public T apply(... | when(gateway.observeString("testKey", NUMBER.ONE.name()))
.thenReturn(Observable.just(NUMBER.TWO.name()));
Observable<NUMBER> observable = adapter.observe("testKey", NUMBER.ONE, gateway);
observable.subscribe(observer);
verify(gateway).observeString("testKey", NUMBER.ON... | [FOCAL] @Nonnull @Override public Observable<T> EnumAdapter.observe(String key, T defaultValue, IGateway gateway)
[CLASS] class EnumAdapter implements IPreferenceAdapter<T>
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String toString(T value); T fromString(String string)
[CALLS-... | /* static context
[FOCAL] @Nonnull @Override public Observable<T> EnumAdapter.observe(String key, T defaultValue, IGateway gateway)
[INPUTS] branches=- | result=defaultValue, gateway, key
[COLLABORATORS] param gateway:IGateway observeString/2
[CALLS-INTERNAL] String toString(T value); T fromString(String string)
[NEW] ... | /* static context
[FOCAL] @Nonnull @Override public Observable<T> EnumAdapter.observe(String key, T defaultValue, IGateway gateway)
[INPUTS] branches=- | result=defaultValue, gateway, key
[COLLABORATORS] param gateway:IGateway observeString/2
[CALLS-INTERNAL] String toString(T value); T fromString(String string)
[NEW] ... | true | ok | {"focal": {"class": "EnumAdapter", "name": "observe", "signature": "Observable<T> observe(String key, T defaultValue, IGateway gateway)", "start_line": 3, "modifiers": "@Nonnull @Override public", "params": [{"name": "key", "type": "String"}, {"name": "defaultValue", "type": "T"}, {"name": "gateway", "type": "IGateway"... |
52143457_2 | class Polymer {
@JsOverlay
public static String toCamelCase(String text) {
String bactrianCamel = Stream.of(text.split("[^a-zA-Z0-9]"))
.map(v -> v.substring(0, 1).toUpperCase() + v.substring(1).toLowerCase())
.collect(Collectors.joining());
return bactrianCamel.... | assertEquals("thisIsSomeText", Polymer.toCamelCase("THIS_IS_SOME_TEXT"));
}
} | [FOCAL] @JsOverlay public static String Polymer.toCamelCase(String text)
[CLASS] class Polymer
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Stream.of(text.split("[^a-zA-Z0-9]")) .map(v -> v.substri....collect/1, Stream.of(text.split("[^a-zA-Z0-9]")).map/1, Stream.of/1, String.sp... | /* static context
[FOCAL] @JsOverlay public static String Polymer.toCamelCase(String text)
[INPUTS] branches=- | result=text
[COLLABORATORS] field v substring/2,substring/1
[CALLS-EXTERNAL] Stream.of(text.split("[^a-zA-Z0-9]")) .map(v -> v.substri....collect/1, Stream.of(text.split("[^a-zA-Z0-9]")).map/1, Stream.of/1, ... | /* static context
[FOCAL] @JsOverlay public static String Polymer.toCamelCase(String text)
[INPUTS] branches=- | result=text
[COLLABORATORS] field v substring/2,substring/1
[CALLS-EXTERNAL] Stream.of(text.split("[^a-zA-Z0-9]")) .map(v -> v.substri....collect/1, Stream.of(text.split("[^a-zA-Z0-9]")).map/1, Stream.of/1, ... | true | ok | {"focal": {"class": "Polymer", "name": "toCamelCase", "signature": "String toCamelCase(String text)", "start_line": 3, "modifiers": "@JsOverlay public static", "params": [{"name": "text", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Polymer", "kind": "class", "modifiers": "", "superclass": null... |
52145597_9 | class TasksViewModel extends BaseViewModel<TasksViewModel.State> {
protected void onTaskUpdate(Task task) {
Task tmp;
int n = mTasks.size();
for (int i = 0; i < n; i++) {
tmp = mTasks.get(i);
if (task.getId().equals(tmp.getId())) {
tmp.setTitle(task.getTitle());
tmp.setDescrip... | Task taskA = new Task("title a", "description a");
List<Task> tasks = mTasksViewModel.getTasks();
tasks.add(taskA);
Task taskB = new Task(taskA.getId(), "title b", "description b");
mTasksViewModel.onTaskUpdate(taskB);
verify(mTasksViewModel, times(1)).setState(eq(TasksViewModel.State.UPDATED_... | [FOCAL] protected void TasksViewModel.onTaskUpdate(Task task)
[CLASS] class TasksViewModel extends BaseViewModel<TasksViewModel.State>
[METRICS] loc=14 cc=3 branches=1 loops=1 returns=0 throws=0 nesting=2
[CALLS-EXTERNAL] mTasks.size/0, mTasks.get/1, task.getId().equals/1, Task.getId/0, Task.setTitle/1, Task.getTitle/0... | /* static context
[FOCAL] protected void TasksViewModel.onTaskUpdate(Task task)
[PATH1] for(i < n)=T -> if(task.getId().equals(tmp.getId()))=F -> exit loop
[PATH2] for(i < n)=F
[PATH3] for(i < n)=T -> if(task.getId().equals(tmp.getId()))=T
[INPUTS] branches=task | result=-
[COLLABORATORS] field mTasks size/0,get/1; par... | /* static context
[FOCAL] protected void TasksViewModel.onTaskUpdate(Task task)
[PATH1] for(i < n)=T -> if(task.getId().equals(tmp.getId()))=F -> exit loop
[PATH2] for(i < n)=F
[PATH3] for(i < n)=T -> if(task.getId().equals(tmp.getId()))=T
[INPUTS] branches=task | result=-
[COLLABORATORS] field mTasks size/0,get/1; par... | true | ok | {"focal": {"class": "TasksViewModel", "name": "onTaskUpdate", "signature": "void onTaskUpdate(Task task)", "start_line": 3, "modifiers": "protected", "params": [{"name": "task", "type": "Task"}], "return_type": "void"}, "class_info": {"name": "TasksViewModel", "kind": "class", "modifiers": "", "superclass": "BaseViewMo... |
52192427_0 | class GreeterService implements Greeter.Iface {
@Override
public HelloReply sayHello(HelloRequest req) throws TException {
return new HelloReply("Hello " + req.getName());
}
@Value("${nifty.port}")
public int port;
private Greeter.Client client;
}
class GreeterServiceTest {
@Value("${nifty.port}"... | HelloRequest msg = new HelloRequest("Dude");
HelloReply resp = client.sayHello(msg);
assertEquals(resp.message, "Hello Dude");
}
} | [FOCAL] @Override public HelloReply GreeterService.sayHello(HelloRequest req)
[CLASS] class GreeterService implements Greeter.Iface
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] HelloRequest.getName/0
[NEW] HelloReply
[EXCEPTIONS] declares TException
[INPUTS] branches=- | result=... | /* static context
[FOCAL] @Override public HelloReply GreeterService.sayHello(HelloRequest req)
[INPUTS] branches=- | result=req
[COLLABORATORS] param req:HelloRequest getName/0
[EXCEPTIONS] declares TException
[NEW] HelloReply
[CALLS-EXTERNAL] HelloRequest.getName/0
*/
| /* static context
[FOCAL] @Override public HelloReply GreeterService.sayHello(HelloRequest req)
[INPUTS] branches=- | result=req
[COLLABORATORS] param req:HelloRequest getName/0
[EXCEPTIONS] declares TException
[NEW] HelloReply
[CALLS-EXTERNAL] HelloRequest.getName/0
*/
class GreeterService implements Greeter.Iface {
... | true | ok | {"focal": {"class": "GreeterService", "name": "sayHello", "signature": "HelloReply sayHello(HelloRequest req) throws TException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "req", "type": "HelloRequest"}], "return_type": "HelloReply"}, "class_info": {"name": "GreeterService", "kind": "class",... |
52212248_0 | class Bus {
public <T> void post(T event) {
if (event == null) {
throw new NullPointerException("Event cannot be null");
}
synchronized (listenerLock) {
for (Map.Entry<Class, List<Subscription>> entry : currentThreadListeners.entrySet()) {
checkAndPos... | Bus bus = new Bus.Builder()
.setMainScheduler(Schedulers.trampoline())
.setBackgroundScheduler(Schedulers.trampoline())
.setCurrentScheduler(Schedulers.trampoline())
.build();
String uid = UUID.randomUUID().toString();
setTestUid(u... | [FOCAL] public void Bus.post(T event)
[CLASS] class Bus
[METRICS] loc=32 cc=6 branches=2 loops=3 returns=0 throws=1 nesting=2
[CALLS-INTERNAL] void checkAndPost(Class subscriptionClazz, T event, List<Subscription> subscriptions, ThreadMode threadMode); void cleanupReferences(); void log(String msg)
[CALLS-EXTERNAL] cur... | /* static context
[FOCAL] public void Bus.post(T event)
[THROWS-WHEN] NullPointerException when event == null
[PATH1] if(event == null)=F -> foreach(Map.Entry<Class, List<Subscription>> entry : currentThreadListeners.entrySet())=T -> exit loop -> foreach(Map.Entry<Class, List<Subscription>> entry : mainThreadListeners.... | /* static context
[FOCAL] public void Bus.post(T event)
[THROWS-WHEN] NullPointerException when event == null
[PATH1] if(event == null)=F -> foreach(Map.Entry<Class, List<Subscription>> entry : currentThreadListeners.entrySet())=T -> exit loop -> foreach(Map.Entry<Class, List<Subscription>> entry : mainThreadListeners.... | true | ok | {"focal": {"class": "Bus", "name": "post", "signature": "void post(T event)", "start_line": 3, "modifiers": "public", "params": [{"name": "event", "type": "T"}], "return_type": "void"}, "class_info": {"name": "Bus", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "subscript... |
52227745_2 | class SubscriptionLimiter {
public static <T> Observable<T> limitSubscriptions(int maxNumber, Observable<T> source) {
State state = new State();
return Observable.create(subscriber -> {
synchronized (state) {
if (state.getNumberOfSubscriptions() == maxNumber) {
... | // given
PublishSubject<Integer> subject = PublishSubject.create();
Observable<Integer> limitedObservable = SubscriptionLimiter.limitSubscriptions(1, subject);
TestSubscriber<Integer> subscriber = new TestSubscriber<>();
// when
limitedObservable.subscribe(subscriber);
... | [FOCAL] public static Observable<T> SubscriptionLimiter.limitSubscriptions(int maxNumber, Observable<T> source)
[CLASS] class SubscriptionLimiter
[METRICS] loc=14 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] Observable.create/1, State.getNumberOfSubscriptions/0, System.out.println/1, subscriber... | /* static context
[FOCAL] public static Observable<T> SubscriptionLimiter.limitSubscriptions(int maxNumber, Observable<T> source)
[INPUTS] branches=- | result=maxNumber, source
[COLLABORATORS] field subscriber onError/1; param source:Observable<T> subscribe/1
[NEW] State, RuntimeException
[CALLS-EXTERNAL] Observable.cr... | /* static context
[FOCAL] public static Observable<T> SubscriptionLimiter.limitSubscriptions(int maxNumber, Observable<T> source)
[INPUTS] branches=- | result=maxNumber, source
[COLLABORATORS] field subscriber onError/1; param source:Observable<T> subscribe/1
[NEW] State, RuntimeException
[CALLS-EXTERNAL] Observable.cr... | true | ok | {"focal": {"class": "SubscriptionLimiter", "name": "limitSubscriptions", "signature": "Observable<T> limitSubscriptions(int maxNumber, Observable<T> source)", "start_line": 3, "modifiers": "public static", "params": [{"name": "maxNumber", "type": "int"}, {"name": "source", "type": "Observable<T>"}], "return_type": "Obs... |
52228869_0 | class AuthKeyGen {
public static AwsKeyPair generateKeypair() throws NoSuchAlgorithmException {
String accessKey = "-";
String secretKey = "-";
while (accessKey.contains("-") || accessKey.contains("_")
|| secretKey.contains("-") || secretKey.contains("_")) {
KeyG... | for (int i = 0 ; i < 1000; i++){
AuthKeyGen.AwsKeyPair keyPair = AuthKeyGen.generateKeypair();
System.out.println(keyPair);
assertFalse(keyPair.awsAccessKeyId.contains("-"));
assertFalse(keyPair.awsAccessKeyId.contains("_"));
assertFalse(keyPair.awsSecretAc... | [FOCAL] public static AwsKeyPair AuthKeyGen.generateKeypair()
[CLASS] class AuthKeyGen
[METRICS] loc=16 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] String.contains/1, KeyGenerator.getInstance/1, KeyGenerator.init/1, generator.generateKey().getEncoded/0, KeyGenerator.generateKey/0, BaseEncoding... | /* static context
[FOCAL] public static AwsKeyPair AuthKeyGen.generateKeypair()
[PATH1] while(accessKey.contains("-") || accessKey.contains("_") || secretKey.contains("-") || secretKey.contains("_"))=T -> exit loop -> return new AwsKeyPair(secretKey, accessKey)
[PATH2] while(accessKey.contains("-") || accessKey.contain... | /* static context
[FOCAL] public static AwsKeyPair AuthKeyGen.generateKeypair()
[PATH1] while(accessKey.contains("-") || accessKey.contains("_") || secretKey.contains("-") || secretKey.contains("_"))=T -> exit loop -> return new AwsKeyPair(secretKey, accessKey)
[PATH2] while(accessKey.contains("-") || accessKey.contain... | true | ok | {"focal": {"class": "AuthKeyGen", "name": "generateKeypair", "signature": "AwsKeyPair generateKeypair() throws NoSuchAlgorithmException", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "AwsKeyPair"}, "class_info": {"name": "AuthKeyGen", "kind": "class", "modifiers": "", "superclass": null, ... |
52264160_3 | class FileSortUtils {
public void performSortOperation(int option, List<File> pdf) {
switch (option) {
case DATE_INDEX:
sortFilesByDateNewestToOldest(pdf);
break;
case NAME_INDEX:
sortByNameAlphabetical(pdf);
break;
... | // given
long[] sizes = {10000, 1000, 100, 50, 2000, 2500};
for (int i = 0; i < sizes.length; i++)
when(mFiles.get(i).length()).thenReturn(sizes[i]);
File[] expected = new File[]{mFiles.get(0), mFiles.get(5), mFiles.get(4),
mFiles.get(1), mFiles.get(2), mFile... | [FOCAL] public void FileSortUtils.performSortOperation(int option, List<File> pdf)
[CLASS] class FileSortUtils
[METRICS] loc=16 cc=5 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] void sortByNameAlphabetical(List<File> filesList); void sortFilesByDateNewestToOldest(List<File> filesList); void sortFile... | /* static context
[FOCAL] public void FileSortUtils.performSortOperation(int option, List<File> pdf)
[PATH1] switch(option)=case DATE_INDEX
[PATH2] switch(option)=case NAME_INDEX
[PATH3] switch(option)=case SIZE_INCREASING_ORDER_INDEX
[PATH4] switch(option)=case SIZE_DECREASING_ORDER_INDEX
[PATH5] switch(option)=defaul... | /* static context
[FOCAL] public void FileSortUtils.performSortOperation(int option, List<File> pdf)
[PATH1] switch(option)=case DATE_INDEX
[PATH2] switch(option)=case NAME_INDEX
[PATH3] switch(option)=case SIZE_INCREASING_ORDER_INDEX
[PATH4] switch(option)=case SIZE_DECREASING_ORDER_INDEX
[PATH5] switch(option)=defaul... | true | ok | {"focal": {"class": "FileSortUtils", "name": "performSortOperation", "signature": "void performSortOperation(int option, List<File> pdf)", "start_line": 3, "modifiers": "public", "params": [{"name": "option", "type": "int"}, {"name": "pdf", "type": "List<File>"}], "return_type": "void"}, "class_info": {"name": "FileSor... |
52371323_51 | class GuavaCache implements MetricIdCache.Cache<T> {
@Override
public MetricId get(final MetricId base, final T key) throws ExecutionException {
return cache.get(key, new Callable<MetricId>() {
@Override
public MetricId call() throws Exception {
return loader.loa... | Assert.assertEquals(MetricId.EMPTY.tagged("endpoint", "foo"), endpointCache.get("foo"));
Assert.assertEquals(MetricId.EMPTY.tagged("endpoint", "foo"), endpointCache.get("foo"));
Assert.assertEquals(1, callCount.get());
Assert.assertEquals(MetricId.EMPTY.tagged("endpoint", "bar"), endpoi... | [FOCAL] @Override public MetricId GuavaCache.get(MetricId base, T key)
[CLASS] class GuavaCache implements MetricIdCache.Cache<T>
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] cache.get/2, loader.load/2
[NEW] Callable<MetricId>
[EXCEPTIONS] declares ExecutionException
[INPUTS] br... | /* static context
[FOCAL] @Override public MetricId GuavaCache.get(MetricId base, T key)
[INPUTS] branches=- | result=base, key
[COLLABORATORS] field cache get/2; field loader load/2
[EXCEPTIONS] declares ExecutionException
[NEW] Callable<MetricId>
[CALLS-EXTERNAL] cache.get/2, loader.load/2
*/
| /* static context
[FOCAL] @Override public MetricId GuavaCache.get(MetricId base, T key)
[INPUTS] branches=- | result=base, key
[COLLABORATORS] field cache get/2; field loader load/2
[EXCEPTIONS] declares ExecutionException
[NEW] Callable<MetricId>
[CALLS-EXTERNAL] cache.get/2, loader.load/2
*/
class GuavaCache impleme... | true | ok | {"focal": {"class": "GuavaCache", "name": "get", "signature": "MetricId get(MetricId base, T key) throws ExecutionException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "base", "type": "MetricId"}, {"name": "key", "type": "T"}], "return_type": "MetricId"}, "class_info": {"name": "GuavaCache",... |
52404147_87 | class StatisticsUtilities {
public static double minimum(double[] xs) {
double min = xs[0]; // Stores the minimum value to be returned later; is assumed to be the value at the first Index
for (int i = 1; i < xs.length; i++) { // Cycles through the Array to search for the minimum value
min = Math.min(min, xs[i]... | double[] test = { 1, 1, 1, 12, 2, 2, 2, 23, 3, 3, 3, 500};
double[] test2 = { 1, 2, 3, 4, 5 };
double[] test3 = { 1, 1, 100, 50 };
double[] test4 = { 50, 50, 51, 51 };
double[] test5 = { 100, 500, 101 };
assertEquals(StatisticsUtilities.minimum(test), 1, ERROR);
assertEquals(StatisticsUtilities.minimum(te... | [FOCAL] public static double StatisticsUtilities.minimum(double[] xs)
[CLASS] class StatisticsUtilities
[METRICS] loc=7 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] Math.min/2
[PATH1] for(i < xs.length)=T -> exit loop -> return min
[PATH2] for(i < xs.length)=F -> return min
[INPUTS] branches=xs... | /* static context
[FOCAL] public static double StatisticsUtilities.minimum(double[] xs)
[PATH1] for(i < xs.length)=T -> exit loop -> return min
[PATH2] for(i < xs.length)=F -> return min
[INPUTS] branches=xs | result=xs
[CALLS-EXTERNAL] Math.min/2
*/
| /* static context
[FOCAL] public static double StatisticsUtilities.minimum(double[] xs)
[PATH1] for(i < xs.length)=T -> exit loop -> return min
[PATH2] for(i < xs.length)=F -> return min
[INPUTS] branches=xs | result=xs
[CALLS-EXTERNAL] Math.min/2
*/
class StatisticsUtilities {
public static double minimum(double[] x... | true | ok | {"focal": {"class": "StatisticsUtilities", "name": "minimum", "signature": "double minimum(double[] xs)", "start_line": 3, "modifiers": "public static", "params": [{"name": "xs", "type": "double[]"}], "return_type": "double"}, "class_info": {"name": "StatisticsUtilities", "kind": "class", "modifiers": "", "superclass":... |
52453918_4 | class ElloURI {
public static boolean shouldLoadInApp(String url) {
if (url.matches("^(https?://)?((w{3}|preview.)?ello.(co|ninja)|(ello-webapp-epic|ello-webapp-rainbow|ello-fg-stage1|ello-fg-stage2).herokuapp.com)/?\\S*$")) {
return true;
}
else if (url.matches("/\\S*$")) {
... | assertFalse("https://hello.co should NOT load in app", ElloURI.shouldLoadInApp("https://hello.co"));
assertFalse("https://www.google.com should NOT load in app", ElloURI.shouldLoadInApp("https://www.google.com"));
assertFalse("yo/sean should NOT load in app", ElloURI.shouldLoadInApp("yo/sean"));... | [FOCAL] public static boolean ElloURI.shouldLoadInApp(String url)
[CLASS] class ElloURI
[METRICS] loc=11 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=2
[CALLS-EXTERNAL] String.matches/1
[PATH1] if((url.matches("^(https?://)?((w{3}|preview.)?ello.(co|ninja)|(ello-webapp-epic|ello-webapp-rainbow|ello-fg-stage1|ello... | /* static context
[FOCAL] public static boolean ElloURI.shouldLoadInApp(String url)
[PATH1] if((url.matches("^(https?://)?((w{3}|preview.)?ello.(co|ninja)|(ello-webapp-epic|ello-webapp-rainbow|ello-fg-stage1|ello...)=F -> if(url.matches("/\\S*$"))=T -> return true
[PATH2] if((url.matches("^(https?://)?((w{3}|preview.)?... | /* static context
[FOCAL] public static boolean ElloURI.shouldLoadInApp(String url)
[PATH1] if((url.matches("^(https?://)?((w{3}|preview.)?ello.(co|ninja)|(ello-webapp-epic|ello-webapp-rainbow|ello-fg-stage1|ello...)=F -> if(url.matches("/\\S*$"))=T -> return true
[PATH2] if((url.matches("^(https?://)?((w{3}|preview.)?... | true | ok | {"focal": {"class": "ElloURI", "name": "shouldLoadInApp", "signature": "boolean shouldLoadInApp(String url)", "start_line": 3, "modifiers": "public static", "params": [{"name": "url", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "ElloURI", "kind": "class", "modifiers": "", "superclass": null, "... |
52460731_1 | class Permissive {
public static String[] filterPermissions(Context context, String[] permissions, int filter) {
final ArrayList<String> filtered = new ArrayList<>();
for (String permission : permissions) {
if (checkPermissionInt(context, permission) == filter) {
filtered.add(permission);
... | String[] result = Permissive.filterPermissions(mockContext,
new String[]{TEST_DENIED_PERMISSION, TEST_GRANTED_PERMISSION},
PackageManager.PERMISSION_GRANTED);
assertArrayEquals(result, new String[]{TEST_GRANTED_PERMISSION});
result = Permissive.filterPermissions... | [FOCAL] public static String[] Permissive.filterPermissions(Context context, String[] permissions, int filter)
[CLASS] class Permissive
[METRICS] loc=9 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] int checkPermissionInt(Context context, String permission)
[CALLS-EXTERNAL] ArrayList<String>.add/... | /* static context
[FOCAL] public static String[] Permissive.filterPermissions(Context context, String[] permissions, int filter)
[PATH1] foreach(String permission : permissions)=T -> if(checkPermissionInt(context, permission) == filter)=T -> exit loop -> return filtered.toArray(new String[filtered.size()])
[PATH2] fore... | /* static context
[FOCAL] public static String[] Permissive.filterPermissions(Context context, String[] permissions, int filter)
[PATH1] foreach(String permission : permissions)=T -> if(checkPermissionInt(context, permission) == filter)=T -> exit loop -> return filtered.toArray(new String[filtered.size()])
[PATH2] fore... | true | ok | {"focal": {"class": "Permissive", "name": "filterPermissions", "signature": "String[] filterPermissions(Context context, String[] permissions, int filter)", "start_line": 3, "modifiers": "public static", "params": [{"name": "context", "type": "Context"}, {"name": "permissions", "type": "String[]"}, {"name": "filter", "... |
52478731_6 | class PhenotypeAssociation extends AbstractAuditable implements gemma.gsec.model.Securable {
public Collection<Characteristic> getPhenotypes() {
return this.phenotypes;
}
public PhenotypeAssociation();
public Characteristic getAssociationType();
public void setAssociationType( Characteri... | // 1- findEvidenceByGeneNCBI
Collection<EvidenceValueObject<? extends PhenotypeAssociation>> evidences = this.phenotypeAssociationManagerService
.findEvidenceByGeneNCBI( this.geneNCBI );
assertNotNull( evidences );
assertEquals( 1, evidences.size() );
EvidenceVal... | [FOCAL] public Collection<Characteristic> PhenotypeAssociation.getPhenotypes()
[CLASS] class PhenotypeAssociation extends AbstractAuditable implements gemma.gsec.model.Securable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[FIELDS] read=phenotypes
[CLASS-MEMBERS] PhenotypeAssociation(); Characte... | /* static context
[FOCAL] public Collection<Characteristic> PhenotypeAssociation.getPhenotypes()
[FIELDS] read=phenotypes
*/
| /* static context
[FOCAL] public Collection<Characteristic> PhenotypeAssociation.getPhenotypes()
[FIELDS] read=phenotypes
*/
class PhenotypeAssociation extends AbstractAuditable implements gemma.gsec.model.Securable {
public Collection<Characteristic> getPhenotypes() {
return this.phenotypes;
}
pu... | true | ok | {"focal": {"class": "PhenotypeAssociation", "name": "getPhenotypes", "signature": "Collection<Characteristic> getPhenotypes()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Collection<Characteristic>"}, "class_info": {"name": "PhenotypeAssociation", "kind": "class", "modifiers": "", "superclass... |
52507351_18 | class QueryUtils {
public static String discoverTablespace(String defaultTableSpace, String query) {
if (query == null) {
return defaultTableSpace;
}
final Matcher matcher = TABLE_SPACE_NAME_PATTERN.matcher(query);
/* A find will be used, no trim is needed */
i... | String defaultTableSpace = TableSpace.DEFAULT;
String theTableSpace = "myts";
assertEquals(defaultTableSpace, QueryUtils.discoverTablespace(defaultTableSpace, "update test"));
assertEquals(defaultTableSpace, QueryUtils.discoverTablespace(defaultTableSpace, ""));
assertEquals(theT... | [FOCAL] public static String QueryUtils.discoverTablespace(String defaultTableSpace, String query)
[CLASS] class QueryUtils
[METRICS] loc=18 cc=4 branches=3 loops=0 returns=3 throws=0 nesting=2
[CALLS-EXTERNAL] TABLE_SPACE_NAME_PATTERN.matcher/1, Matcher.find/0, Matcher.group/1, String.substring/2, String.length/0
[PAT... | /* static context
[FOCAL] public static String QueryUtils.discoverTablespace(String defaultTableSpace, String query)
[PATH1] if(query == null)=F -> if(matcher.find())=T -> if(tableSpace != null)=T -> return tableSpace.substring(0, tableSpace.length() - 1)
[PATH2] if(query == null)=T -> return defaultTableSpace
[PATH3] ... | /* static context
[FOCAL] public static String QueryUtils.discoverTablespace(String defaultTableSpace, String query)
[PATH1] if(query == null)=F -> if(matcher.find())=T -> if(tableSpace != null)=T -> return tableSpace.substring(0, tableSpace.length() - 1)
[PATH2] if(query == null)=T -> return defaultTableSpace
[PATH3] ... | true | ok | {"focal": {"class": "QueryUtils", "name": "discoverTablespace", "signature": "String discoverTablespace(String defaultTableSpace, String query)", "start_line": 3, "modifiers": "public static", "params": [{"name": "defaultTableSpace", "type": "String"}, {"name": "query", "type": "String"}], "return_type": "String"}, "cl... |
52509220_290 | class Paths {
@UserFunction
@Description("apoc.path.combine(path1, path2) - combines the paths into one if the connecting node matches")
public Path combine(@Name("first") Path first, @Name("second") Path second) {
if (first == null) return second;
if (second == null) return first;
... | TestUtil.testCall(db, "MATCH p1 = (a:A)-[:NEXT]->(b:B), p2 = (b)-[:NEXT]->() RETURN apoc.path.combine(p1,p2) as p",(row) -> assertPath(row, 2, "A", "C"));
TestUtil.testCall(db, "MATCH p1 = (a:A)-[:NEXT]->(b:B) RETURN apoc.path.combine(p1,null) as p",(row) -> assertPath(row, 1, "A", "B"));
TestUt... | [FOCAL] @UserFunction @Description("apoc.path.combine(path1, path2) - combines the paths into one if the connecting node matc... Path Paths.combine(Path first, Path second)
[CLASS] class Paths
[METRICS] loc=14 cc=6 branches=3 loops=2 returns=3 throws=1 nesting=1
[CALLS-EXTERNAL] first.endNode().equals/1, Path.endNode/0... | /* static context
[FOCAL] @UserFunction @Description("apoc.path.combine(path1, path2) - combines the paths into one if the connecting node matc... Path Paths.combine(Path first, Path second)
[THROWS-WHEN] IllegalArgumentException when !(first == null) && !(second == null) && !first.endNode().equals(second.startNode())
... | /* static context
[FOCAL] @UserFunction @Description("apoc.path.combine(path1, path2) - combines the paths into one if the connecting node matc... Path Paths.combine(Path first, Path second)
[THROWS-WHEN] IllegalArgumentException when !(first == null) && !(second == null) && !first.endNode().equals(second.startNode())
... | true | ok | {"focal": {"class": "Paths", "name": "combine", "signature": "Path combine(Path first, Path second)", "start_line": 3, "modifiers": "@UserFunction @Description(\"apoc.path.combine(path1, path2) - combines the paths into one if the connecting node matc...", "params": [{"name": "first", "type": "Path"}, {"name": "second"... |
52531953_1 | class StudyDao extends BaseDao<Study> {
@Override
public void persist(Study entity) {
persistUsersIfNecessary(entity.getAdministrators());
persistUsersIfNecessary(entity.getParticipants());
assert entity.getAuthor() != null;
super.persist(entity);
}
@Autowired public S... | final Study study = Generator.generateStudy(true);
study.setAuthor(author);
assertNull(study.getKey());
executeInTransaction(() -> studyDao.persist(study));
assertNotNull(study.getKey());
final Study result = studyDao.findByKey(study.getKey());
assertNotNull(resu... | [FOCAL] @Override public void StudyDao.persist(Study entity)
[CLASS] class StudyDao extends BaseDao<Study>
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void persistUsersIfNecessary(Collection<User> users)
[CALLS-EXTERNAL] Study.getAdministrators/0, Study.getParticipants/0, Study... | /* static context
[FOCAL] @Override public void StudyDao.persist(Study entity)
[COLLABORATORS] param entity:Study getAdministrators/0,getParticipants/0,getAuthor/0
[CALLS-INTERNAL] void persistUsersIfNecessary(Collection<User> users)
[CALLS-EXTERNAL] Study.getAdministrators/0, Study.getParticipants/0, Study.getAuthor/0... | /* static context
[FOCAL] @Override public void StudyDao.persist(Study entity)
[COLLABORATORS] param entity:Study getAdministrators/0,getParticipants/0,getAuthor/0
[CALLS-INTERNAL] void persistUsersIfNecessary(Collection<User> users)
[CALLS-EXTERNAL] Study.getAdministrators/0, Study.getParticipants/0, Study.getAuthor/0... | true | ok | {"focal": {"class": "StudyDao", "name": "persist", "signature": "void persist(Study entity)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "entity", "type": "Study"}], "return_type": "void"}, "class_info": {"name": "StudyDao", "kind": "class", "modifiers": "", "superclass": "BaseDao<Study>", "i... |
52565845_4 | class PaginationDo implements Serializable {
public void setTotalRowCnt(int totalRowCnt) {
this.totalRowCnt = totalRowCnt;
setPageNums(null);
}
public PaginationDo();
public PaginationDo(int pageNumCount, int rowCntPerPage);
public int getCurrentPageNum();
public void setCur... | PaginationDo pagination = new PaginationDo(5, 50);
assertThat("有効判定 no", pagination.isEnabled(), is(false));
pagination.setTotalRowCnt(0);
assertThat("有効判定 yes", pagination.isEnabled(), is(true));
}
} | [FOCAL] public void PaginationDo.setTotalRowCnt(int totalRowCnt)
[CLASS] class PaginationDo implements Serializable
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void setPageNums(List<Integer> pageNums)
[FIELDS] write=totalRowCnt
[STATE] totalRowCnt via getTotalRowCnt()
[DATAFLOW... | /* static context
[FOCAL] public void PaginationDo.setTotalRowCnt(int totalRowCnt)
[STATE] totalRowCnt via getTotalRowCnt()
[CALLS-INTERNAL] void setPageNums(List<Integer> pageNums)
[FIELDS] write=totalRowCnt
*/
| /* static context
[FOCAL] public void PaginationDo.setTotalRowCnt(int totalRowCnt)
[STATE] totalRowCnt via getTotalRowCnt()
[CALLS-INTERNAL] void setPageNums(List<Integer> pageNums)
[FIELDS] write=totalRowCnt
*/
class PaginationDo implements Serializable {
public void setTotalRowCnt(int totalRowCnt) {
this... | true | ok | {"focal": {"class": "PaginationDo", "name": "setTotalRowCnt", "signature": "void setTotalRowCnt(int totalRowCnt)", "start_line": 3, "modifiers": "public", "params": [{"name": "totalRowCnt", "type": "int"}], "return_type": "void"}, "class_info": {"name": "PaginationDo", "kind": "class", "modifiers": "", "superclass": nu... |
52597910_0 | class QualityConverter {
public static short toShort(final byte[] value) {
final byte[] ba = reverseAllBitsAndBytes(value);
final ByteBuffer bb = ByteBuffer.wrap(ba);
final short s = bb.getShort();
LOGGER.debug("Converting byte array [{}], reversed [{}] into short [{}]", toString(... |
// arrange
final byte[] ba = new byte[2];
ba[0] = (byte) 193;
ba[1] = (byte) 0;
// act
final short s = QualityConverter.toShort(ba);
// assert
assertEquals(131, s);
}
} | [FOCAL] public static short QualityConverter.toShort(byte[] value)
[CLASS] class QualityConverter
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String toString(byte[] value); byte[] reverseAllBitsAndBytes(byte[] val)
[CALLS-EXTERNAL] ByteBuffer.wrap/1, ByteBuffer.getShort/0, LOGG... | /* static context
[FOCAL] public static short QualityConverter.toShort(byte[] value)
[INPUTS] branches=- | result=value
[CALLS-INTERNAL] String toString(byte[] value); byte[] reverseAllBitsAndBytes(byte[] val)
[CALLS-EXTERNAL] ByteBuffer.wrap/1, ByteBuffer.getShort/0, LOGGER.debug/4
*/
| /* static context
[FOCAL] public static short QualityConverter.toShort(byte[] value)
[INPUTS] branches=- | result=value
[CALLS-INTERNAL] String toString(byte[] value); byte[] reverseAllBitsAndBytes(byte[] val)
[CALLS-EXTERNAL] ByteBuffer.wrap/1, ByteBuffer.getShort/0, LOGGER.debug/4
*/
class QualityConverter {
pub... | true | ok | {"focal": {"class": "QualityConverter", "name": "toShort", "signature": "short toShort(byte[] value)", "start_line": 3, "modifiers": "public static", "params": [{"name": "value", "type": "byte[]"}], "return_type": "short"}, "class_info": {"name": "QualityConverter", "kind": "class", "modifiers": "", "superclass": null,... |
52628247_15 | class Utils {
public static double stdev(double[] a) {
double m = mean(a);
double sumsq = 0;
for (double v : a) sumsq += (v-m)*(v-m);
return Math.sqrt(sumsq / a.length);
}
public static double median(ArrayList<Double> arrList);
public static double mean(double[] x);
... | assertThat(Utils.stdev(new double[]{42}), is(0d));
}
} | [FOCAL] public static double Utils.stdev(double[] a)
[CLASS] class Utils
[METRICS] loc=6 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] double mean(double[] x)
[CALLS-EXTERNAL] Math.sqrt/1
[PATH1] foreach(double v : a)=T -> exit loop -> return Math.sqrt(sumsq / a.length)
[PATH2] foreach(double v ... | /* static context
[FOCAL] public static double Utils.stdev(double[] a)
[PATH1] foreach(double v : a)=T -> exit loop -> return Math.sqrt(sumsq / a.length)
[PATH2] foreach(double v : a)=F -> return Math.sqrt(sumsq / a.length)
[INPUTS] branches=a | result=a
[CALLS-INTERNAL] double mean(double[] x)
[CALLS-EXTERNAL] Math.sq... | /* static context
[FOCAL] public static double Utils.stdev(double[] a)
[PATH1] foreach(double v : a)=T -> exit loop -> return Math.sqrt(sumsq / a.length)
[PATH2] foreach(double v : a)=F -> return Math.sqrt(sumsq / a.length)
[INPUTS] branches=a | result=a
[CALLS-INTERNAL] double mean(double[] x)
[CALLS-EXTERNAL] Math.sq... | true | ok | {"focal": {"class": "Utils", "name": "stdev", "signature": "double stdev(double[] a)", "start_line": 3, "modifiers": "public static", "params": [{"name": "a", "type": "double[]"}], "return_type": "double"}, "class_info": {"name": "Utils", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields... |
52632533_7 | class BaggageImpl {
public BaggageImpl split() {
Handlers.preSplit(this);
Map<ByteString, SetMultimap<ByteString, ByteString>> copiedData = Maps.newHashMapWithExpectedSize(contents.size());
for (ByteString namespace : contents.keySet()) {
copiedData.put(namespace, HashMultimap.c... | BaggageImpl b = new BaggageImpl();
ByteString myname = ByteString.copyFrom("namespace".getBytes());
ByteString myname2 = ByteString.copyFrom("namespace2".getBytes());
ByteString mybytes = ByteString.copyFrom("k1".getBytes());
ByteString mybytes2 = ByteString.copyFrom("k2".getByte... | [FOCAL] public BaggageImpl BaggageImpl.split()
[CLASS] class BaggageImpl
[METRICS] loc=10 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] Handlers.preSplit/1, Maps.newHashMapWithExpectedSize/1, contents.size/0, contents.keySet/0, Map<ByteString, SetMultimap<ByteString, ByteString>>.put/2, HashMult... | /* static context
[FOCAL] public BaggageImpl BaggageImpl.split()
[PATH1] foreach(ByteString namespace : contents.keySet())=T -> exit loop -> return newImpl
[PATH2] foreach(ByteString namespace : contents.keySet())=F -> return newImpl
[COLLABORATORS] field contents size/0,keySet/0,get/1
[NEW] BaggageImpl
[CALLS-EXTERNAL... | /* static context
[FOCAL] public BaggageImpl BaggageImpl.split()
[PATH1] foreach(ByteString namespace : contents.keySet())=T -> exit loop -> return newImpl
[PATH2] foreach(ByteString namespace : contents.keySet())=F -> return newImpl
[COLLABORATORS] field contents size/0,keySet/0,get/1
[NEW] BaggageImpl
[CALLS-EXTERNAL... | true | ok | {"focal": {"class": "BaggageImpl", "name": "split", "signature": "BaggageImpl split()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "BaggageImpl"}, "class_info": {"name": "BaggageImpl", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": ... |
52679228_0 | class MessagingConnectionService implements ConnectionListener {
public void notifyMissionMessageReceivers(Message message) {
try {
for (MessageReceiver receiver : missionMessageReceivers) {
switch (message.getPayloadType()) {
case AssignMission:
... | AssignMissionMessage assignMissionMessage = new AssignMissionMessage();
MissionDto mission = new MissionDto();
assignMissionMessage.setMission(mission);
String messageStr = messageConverter.parseMessageToString(assignMissionMessage);
JsonBasedMessageConverter jsonBasedMessageCo... | [FOCAL] public void MessagingConnectionService.notifyMissionMessageReceivers(Message message)
[CLASS] class MessagingConnectionService implements ConnectionListener
[METRICS] loc=16 cc=5 branches=1 loops=1 returns=0 throws=0 nesting=3
[CALLS-EXTERNAL] Message.getPayloadType/0, MessageReceiver.onAssignMissionMessageRece... | /* static context
[FOCAL] public void MessagingConnectionService.notifyMissionMessageReceivers(Message message)
[PATH1] foreach(MessageReceiver receiver : missionMessageReceivers)=T -> switch(message.getPayloadType())=case AssignMission -> exit loop
[PATH2] try-body throws
[PATH3] foreach(MessageReceiver receiver : mis... | /* static context
[FOCAL] public void MessagingConnectionService.notifyMissionMessageReceivers(Message message)
[PATH1] foreach(MessageReceiver receiver : missionMessageReceivers)=T -> switch(message.getPayloadType())=case AssignMission -> exit loop
[PATH2] try-body throws
[PATH3] foreach(MessageReceiver receiver : mis... | true | ok | {"focal": {"class": "MessagingConnectionService", "name": "notifyMissionMessageReceivers", "signature": "void notifyMissionMessageReceivers(Message message)", "start_line": 3, "modifiers": "public", "params": [{"name": "message", "type": "Message"}], "return_type": "void"}, "class_info": {"name": "MessagingConnectionSe... |
52689062_0 | class SketchyMovingMAD implements OutlierAlgorithm {
public SketchyMovingMAD() {
}
public SketchyMovingMAD();
public SketchyMovingMAD(OutlierConfig config);
public SketchyMovingMAD withConfig(OutlierConfig config);
public Map<String, Distribution.Context> getMedianDistributions();
publ... | Random r = new Random(0);
List<DataPoint> points = new ArrayList<>();
DescriptiveStatistics stats = new DescriptiveStatistics();
DescriptiveStatistics medianStats = new DescriptiveStatistics();
OutlierConfig config = JSONUtil.INSTANCE.load(madConfig, OutlierConfig.class);
... | [FOCAL] public SketchyMovingMAD.SketchyMovingMAD()
[CLASS] class SketchyMovingMAD implements OutlierAlgorithm
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CLASS-MEMBERS] SketchyMovingMAD(); SketchyMovingMAD(OutlierConfig config); SketchyMovingMAD withConfig(OutlierConfig config); Map<String, Di... | /* static context
[FOCAL] public SketchyMovingMAD.SketchyMovingMAD()
*/
| /* static context
[FOCAL] public SketchyMovingMAD.SketchyMovingMAD()
*/
class SketchyMovingMAD implements OutlierAlgorithm {
public SketchyMovingMAD() {
}
public SketchyMovingMAD();
public SketchyMovingMAD(OutlierConfig config);
public SketchyMovingMAD withConfig(OutlierConfig config);
pub... | true | ok | {"focal": {"class": "SketchyMovingMAD", "name": "SketchyMovingMAD", "signature": "SketchyMovingMAD()", "start_line": 3, "modifiers": "public", "params": [], "return_type": null}, "class_info": {"name": "SketchyMovingMAD", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "OutlierAlgorithm", "fields": ... |
52732011_3 | class ByteArrayUtil {
public static String asCharDetail(final byte b)
{
if (b < ' ' || (b & 0xFF) > 127)
{
// add hex value (always two digits)
final String hex = Integer.toHexString(b & 0xFF);
if (hex.length() < 2)
{
return SPECIAL_CHAR + "0" + hex;
}
else
{
return SPECIAL_CHAR + he... | fail("Not yet implemented");
}
} | [FOCAL] public static String ByteArrayUtil.asCharDetail(byte b)
[CLASS] class ByteArrayUtil
[METRICS] loc=20 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=2
[CALLS-EXTERNAL] Integer.toHexString/1, String.length/0, Character.toString/1
[PATH1] if(b < ' ' || (b & 0xFF) > 127)=T -> if(hex.length() < 2)=T -> return SP... | /* static context
[FOCAL] public static String ByteArrayUtil.asCharDetail(byte b)
[PATH1] if(b < ' ' || (b & 0xFF) > 127)=T -> if(hex.length() < 2)=T -> return SPECIAL_CHAR + "0" + hex
[PATH2] if(b < ' ' || (b & 0xFF) > 127)=F -> return Character.toString((char) b)
[PATH3] if(b < ' ' || (b & 0xFF) > 127)=T -> if(hex.le... | /* static context
[FOCAL] public static String ByteArrayUtil.asCharDetail(byte b)
[PATH1] if(b < ' ' || (b & 0xFF) > 127)=T -> if(hex.length() < 2)=T -> return SPECIAL_CHAR + "0" + hex
[PATH2] if(b < ' ' || (b & 0xFF) > 127)=F -> return Character.toString((char) b)
[PATH3] if(b < ' ' || (b & 0xFF) > 127)=T -> if(hex.le... | true | ok | {"focal": {"class": "ByteArrayUtil", "name": "asCharDetail", "signature": "String asCharDetail(byte b)", "start_line": 3, "modifiers": "public static", "params": [{"name": "b", "type": "byte"}], "return_type": "String"}, "class_info": {"name": "ByteArrayUtil", "kind": "class", "modifiers": "", "superclass": null, "inte... |
52774196_41 | class DefaultKeyStorage implements KeyStorage {
@Override
public Set<String> names() {
Entries entries = load();
return entries.keySet();
}
public DefaultKeyStorage();
public DefaultKeyStorage(String directoryName, String fileName);
@Override public void delete(String keyName);
@Override publ... | Set<String> names = storage.names();
assertNotNull(names);
assertTrue(names.isEmpty());
}
} | [FOCAL] @Override public Set<String> DefaultKeyStorage.names()
[CLASS] class DefaultKeyStorage implements KeyStorage
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Entries load()
[CALLS-EXTERNAL] Entries.keySet/0
[DATAFLOW] entries@L3->L4
[CLASS-MEMBERS] DefaultKeyStorage(); Defau... | /* static context
[FOCAL] @Override public Set<String> DefaultKeyStorage.names()
[CALLS-INTERNAL] Entries load()
[CALLS-EXTERNAL] Entries.keySet/0
*/
| /* static context
[FOCAL] @Override public Set<String> DefaultKeyStorage.names()
[CALLS-INTERNAL] Entries load()
[CALLS-EXTERNAL] Entries.keySet/0
*/
class DefaultKeyStorage implements KeyStorage {
@Override
public Set<String> names() {
Entries entries = load();
return entries.keySet();
}
public Defa... | true | ok | {"focal": {"class": "DefaultKeyStorage", "name": "names", "signature": "Set<String> names()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Set<String>"}, "class_info": {"name": "DefaultKeyStorage", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "KeyStorage", "fiel... |
52800193_1 | class AutoCaptureSource {
static Optional<AutoCaptureSource> newInstance(String value, SourceType type) {
boolean isSupportedType = type == SourceType.DEFAULT_PATH || type == SourceType.FILE;
Path path = type == SourceType.DEFAULT_PATH ?
Paths.get(HoverflyConstants.DEFAULT_HOVERFLY... | Optional<AutoCaptureSource> autoCaptureSource = AutoCaptureSource.newInstance("test-service-https.json", HoverflySimulate.SourceType.CLASSPATH);
assertThat(autoCaptureSource).isNotPresent();
}
} | [FOCAL] static Optional<AutoCaptureSource> AutoCaptureSource.newInstance(String value, SourceType type)
[CLASS] class AutoCaptureSource
[METRICS] loc=14 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] Paths.get(HoverflyConstants.DEFAULT_HOVERFLY_EXPORT_PATH).resolve/1, Paths.get/1, Files.isRegular... | /* static context
[FOCAL] static Optional<AutoCaptureSource> AutoCaptureSource.newInstance(String value, SourceType type)
[PATH1] if(isSupportedType && !Files.isRegularFile(path))=T -> return Optional.of(new AutoCaptureSource(path))
[PATH2] if(isSupportedType && !Files.isRegularFile(path))=F -> return Optional.empty()
... | /* static context
[FOCAL] static Optional<AutoCaptureSource> AutoCaptureSource.newInstance(String value, SourceType type)
[PATH1] if(isSupportedType && !Files.isRegularFile(path))=T -> return Optional.of(new AutoCaptureSource(path))
[PATH2] if(isSupportedType && !Files.isRegularFile(path))=F -> return Optional.empty()
... | true | ok | {"focal": {"class": "AutoCaptureSource", "name": "newInstance", "signature": "Optional<AutoCaptureSource> newInstance(String value, SourceType type)", "start_line": 3, "modifiers": "static", "params": [{"name": "value", "type": "String"}, {"name": "type", "type": "SourceType"}], "return_type": "Optional<AutoCaptureSour... |
52956887_17 | class Utils {
public static int getBitRange(final int b, final int s, final int n) {
return (((b & MASK) >> (s & MASK))
& ((1 << (n & MASK)) - 1)) & MASK;
}
private Utils();
public static byte[] concatByteArray(final byte[] a, final byte[] b);
public static int mergeBytes... | int b = 1;
int s = 0;
int n = 1;
int expResult = 1;
int result = Utils.getBitRange(b, s, n);
assertEquals(expResult, result);
}
} | [FOCAL] public static int Utils.getBitRange(int b, int s, int n)
[CLASS] class Utils
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[INPUTS] branches=- | result=b, n, s
[DATAFLOW] b@param->L2; n@param->L2; s@param->L2
[CLASS-MEMBERS] Utils(); byte[] concatByteArray(byte[] a, byte[] b); int mergeBy... | /* static context
[FOCAL] public static int Utils.getBitRange(int b, int s, int n)
[INPUTS] branches=- | result=b, n, s
*/
| /* static context
[FOCAL] public static int Utils.getBitRange(int b, int s, int n)
[INPUTS] branches=- | result=b, n, s
*/
class Utils {
public static int getBitRange(final int b, final int s, final int n) {
return (((b & MASK) >> (s & MASK))
& ((1 << (n & MASK)) - 1)) & MASK;
}
pr... | true | ok | {"focal": {"class": "Utils", "name": "getBitRange", "signature": "int getBitRange(int b, int s, int n)", "start_line": 3, "modifiers": "public static", "params": [{"name": "b", "type": "int"}, {"name": "s", "type": "int"}, {"name": "n", "type": "int"}], "return_type": "int"}, "class_info": {"name": "Utils", "kind": "cl... |
52997044_6 | class IdentityFactory {
public static UserPasswordIdentity createFromUserPassword(String user, String password) {
return new UserPasswordIdentity(user,password);
}
private IdentityFactory();
public static TokenIdentity createFromToken(String token);
}
class IdentityFactoryTest {
@Test... | UserPasswordIdentity identity = IdentityFactory.createFromUserPassword("USER", null);
Assert.assertThat(identity.getUsername(), equalTo("USER"));
Assert.assertThat(identity.getPassword(), nullValue());
}
} | [FOCAL] public static UserPasswordIdentity IdentityFactory.createFromUserPassword(String user, String password)
[CLASS] class IdentityFactory
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] UserPasswordIdentity
[INPUTS] branches=- | result=password, user
[DATAFLOW] password@param->L2; user@pa... | /* static context
[FOCAL] public static UserPasswordIdentity IdentityFactory.createFromUserPassword(String user, String password)
[INPUTS] branches=- | result=password, user
[NEW] UserPasswordIdentity
*/
| /* static context
[FOCAL] public static UserPasswordIdentity IdentityFactory.createFromUserPassword(String user, String password)
[INPUTS] branches=- | result=password, user
[NEW] UserPasswordIdentity
*/
class IdentityFactory {
public static UserPasswordIdentity createFromUserPassword(String user, String password)... | true | ok | {"focal": {"class": "IdentityFactory", "name": "createFromUserPassword", "signature": "UserPasswordIdentity createFromUserPassword(String user, String password)", "start_line": 3, "modifiers": "public static", "params": [{"name": "user", "type": "String"}, {"name": "password", "type": "String"}], "return_type": "UserPa... |
52999284_1 | class MapRedStatsLogModule extends BaseLogModule {
@VisibleForTesting
static String toJson(Counters counters) throws SerializationException {
ArrayNode countersJsonNode = JsonNodeFactory.instance.arrayNode();
ArrayNode groupsJsonNode = JsonNodeFactory.instance.arrayNode();
for (Group group: counters) ... | Counters counters = new Counters();
counters.incrCounter("SomeCounterGroupName", "SomeCounterName", 3);
String json = MapRedStatsLogModule.toJson(counters);
assertEquals(
"[{\"groupName\":\"SomeCounterGroupName\",\"counters\":[{\"counterNa"
+ "me\":\"SomeCounterName\",\"value\":3}]}]",... | [FOCAL] @VisibleForTesting static String MapRedStatsLogModule.toJson(Counters counters)
[CLASS] class MapRedStatsLogModule extends BaseLogModule
[METRICS] loc=25 cc=4 branches=0 loops=2 returns=1 throws=1 nesting=2
[CALLS-EXTERNAL] JsonNodeFactory.instance.arrayNode/0, JsonNodeFactory.instance.objectNode/0, counterJson... | /* static context
[FOCAL] @VisibleForTesting static String MapRedStatsLogModule.toJson(Counters counters)
[THROWS-WHEN] SerializationException when foreach(Group group : counters)=T && foreach(Counters.Counter counter : group)=T && try-body throws
[THROWS-WHEN] SerializationException when foreach(Group group : counters... | /* static context
[FOCAL] @VisibleForTesting static String MapRedStatsLogModule.toJson(Counters counters)
[THROWS-WHEN] SerializationException when foreach(Group group : counters)=T && foreach(Counters.Counter counter : group)=T && try-body throws
[THROWS-WHEN] SerializationException when foreach(Group group : counters... | true | ok | {"focal": {"class": "MapRedStatsLogModule", "name": "toJson", "signature": "String toJson(Counters counters) throws SerializationException", "start_line": 3, "modifiers": "@VisibleForTesting static", "params": [{"name": "counters", "type": "Counters"}], "return_type": "String"}, "class_info": {"name": "MapRedStatsLogMo... |
53002524_6 | class RxFunctions {
public static <T> Func1<T, Boolean> not(final Func1<T, Boolean> func1) {
return new Func1<T, Boolean>() {
@Override
public Boolean call(T t) {
return !func1.call(t);
}
};
}
private RxFunctions();
public static Fu... | User retired = new User("bla", "bla", 90, 10);
Assert.assertEquals(!IS_RETIRED.call(retired), RxFunctions.not(IS_RETIRED).call(retired));
}
} | [FOCAL] public static Func1<T, Boolean> RxFunctions.not(Func1<T, Boolean> func1)
[CLASS] class RxFunctions
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Func1<T, Boolean>.call/1
[NEW] Func1<T, Boolean>
[INPUTS] branches=- | result=func1
[COLLABORATORS] param func1:Func1<T, Boolea... | class RxFunctions {
public static <T> Func1<T, Boolean> not(final Func1<T, Boolean> func1) {
return new Func1<T, Boolean>() {
@Override
public Boolean call(T t) {
return !func1.call(t);
}
};
}
private RxFunctions();
public static Fu... | false | ok | {"focal": {"class": "RxFunctions", "name": "not", "signature": "Func1<T, Boolean> not(Func1<T, Boolean> func1)", "start_line": 3, "modifiers": "public static", "params": [{"name": "func1", "type": "Func1<T, Boolean>"}], "return_type": "Func1<T, Boolean>"}, "class_info": {"name": "RxFunctions", "kind": "class", "modifie... | |
53019432_1 | class RegularUtil {
public static boolean isInt(String s) {
return INT.matcher(s).matches();
}
public static boolean isIpAddress(String ip);
}
class RegularUtilTest {
@Test
public void testIsInt() throws Exception {
| assertEquals(true, (RegularUtil.isInt("45645")));
assertEquals(false, (RegularUtil.isInt("23.1")));
}
} | [FOCAL] public static boolean RegularUtil.isInt(String s)
[CLASS] class RegularUtil
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] INT.matcher(s).matches/0, INT.matcher/1
[INPUTS] branches=- | result=s
[DATAFLOW] s@param->L2
[CLASS-MEMBERS] boolean isIpAddress(String ip)
[TEST] Re... | /* static context
[FOCAL] public static boolean RegularUtil.isInt(String s)
[INPUTS] branches=- | result=s
[CALLS-EXTERNAL] INT.matcher(s).matches/0, INT.matcher/1
*/
| /* static context
[FOCAL] public static boolean RegularUtil.isInt(String s)
[INPUTS] branches=- | result=s
[CALLS-EXTERNAL] INT.matcher(s).matches/0, INT.matcher/1
*/
class RegularUtil {
public static boolean isInt(String s) {
return INT.matcher(s).matches();
}
public static boolean isIpAddress(St... | true | ok | {"focal": {"class": "RegularUtil", "name": "isInt", "signature": "boolean isInt(String s)", "start_line": 3, "modifiers": "public static", "params": [{"name": "s", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "RegularUtil", "kind": "class", "modifiers": "", "superclass": null, "interfaces": nul... |
53073438_7 | class XGH {
public Axiom axiom(int number) {
if (number < 1 || number > axioms.size()) {
throw new IllegalArgumentException(String.format("Axiom %d is not defined", number));
}
return axioms.get(number - 1);
}
public XGH(String lang);
public XGH();
private void initialize(Locale locale)... | Spec.given(new XGH())
.expect(doing(xgh -> xgh.axiom(1)), to().succeed())
.expect(doing(xgh -> xgh.axiom(23)), to().fail())
.expect(doing(xgh -> xgh.axiom(0)), to().fail());
for (int i = 1 ; i <= 22 ; i++) {
Spec.given(new XGH())
.expect(axiom(i), to().have(number(i)));
... | [FOCAL] public Axiom XGH.axiom(int number)
[CLASS] class XGH
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] axioms.size/0, String.format/2, axioms.get/1
[NEW] IllegalArgumentException
[EXCEPTIONS] throws IllegalArgumentException
[THROWS-WHEN] IllegalArgumentException when number <... | /* static context
[FOCAL] public Axiom XGH.axiom(int number)
[THROWS-WHEN] IllegalArgumentException when number < 1 || number > axioms.size()
[PATH1] if(number < 1 || number > axioms.size())=T -> throw new IllegalArgumentException(String.format("Axiom %d is not defined...
[PATH2] if(number < 1 || number > axioms.size()... | /* static context
[FOCAL] public Axiom XGH.axiom(int number)
[THROWS-WHEN] IllegalArgumentException when number < 1 || number > axioms.size()
[PATH1] if(number < 1 || number > axioms.size())=T -> throw new IllegalArgumentException(String.format("Axiom %d is not defined...
[PATH2] if(number < 1 || number > axioms.size()... | true | ok | {"focal": {"class": "XGH", "name": "axiom", "signature": "Axiom axiom(int number)", "start_line": 3, "modifiers": "public", "params": [{"name": "number", "type": "int"}], "return_type": "Axiom"}, "class_info": {"name": "XGH", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "membe... |
53084625_1 | class ProxyController {
@RequestMapping
public void staticProxy(HttpServletRequest request, HttpServletResponse response) throws IOException, SystemException, PortalException {
// /pocjsportlet/p/portletId/path
String requestURI = request.getRequestURI();
String portletId = getPortletId... | mockServer.when(request("/path/to/angular.png"))
.respond(response(TestUtil.getFileContents("website/angular.png"))
.withHeader(new Header(HttpHeaders.Names.CONTENT_TYPE, "image/png")));
MockHttpServletResponse response = new MockHttpServletResponse();
Mo... | [FOCAL] @RequestMapping public void ProxyController.staticProxy(HttpServletRequest request, HttpServletResponse response)
[CLASS] class ProxyController
[METRICS] loc=21 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] String getContentTypeByExtension(String requestURI); String getPortletId(String r... | /* static context
[FOCAL] @RequestMapping public void ProxyController.staticProxy(HttpServletRequest request, HttpServletResponse response)
[PATH1] if(valueWrapper != null)=T -> return
[PATH2] if(valueWrapper != null)=F
[INPUTS] branches=request, cacheManager | result=-
[COLLABORATORS] param request:HttpServletRequest ... | /* static context
[FOCAL] @RequestMapping public void ProxyController.staticProxy(HttpServletRequest request, HttpServletResponse response)
[PATH1] if(valueWrapper != null)=T -> return
[PATH2] if(valueWrapper != null)=F
[INPUTS] branches=request, cacheManager | result=-
[COLLABORATORS] param request:HttpServletRequest ... | true | ok | {"focal": {"class": "ProxyController", "name": "staticProxy", "signature": "void staticProxy(HttpServletRequest request, HttpServletResponse response) throws IOException, SystemException, PortalException", "start_line": 3, "modifiers": "@RequestMapping public", "params": [{"name": "request", "type": "HttpServletRequest... |
53088165_1 | class BeanBoxUtils {
public static Constructor<?> getConstructor(Class<?> clazz, Class<?>... paramTypes) {// NOSONAR
try {
return clazz.getConstructor(paramTypes);
} catch (SecurityException e) {
throw new IllegalStateException("Security exception found for Constructor: " + e.getMessage());
} catch (NoSuc... | BeanBox box = class2BeanBox(Constinject1.class);
Assert.assertEquals(Constinject1.class.getConstructor(), box.getConstructor());
box = class2BeanBox(Constinject2.class);
Assert.assertEquals(Constinject2.class.getConstructor(String.class), box.getConstructor());
box = class2BeanBox(Constinject3.class);
Ass... | [FOCAL] public static Constructor<?> BeanBoxUtils.getConstructor(Class<?> clazz, Class<?>... paramTypes)
[CLASS] class BeanBoxUtils
[METRICS] loc=9 cc=3 branches=0 loops=0 returns=1 throws=2 nesting=1
[CALLS-EXTERNAL] Class<?>.getConstructor/1, NoSuchMethodException.getMessage/0
[NEW] IllegalStateException
[EXCEPTIONS]... | /* static context
[FOCAL] public static Constructor<?> BeanBoxUtils.getConstructor(Class<?> clazz, Class<?>... paramTypes)
[THROWS-WHEN] IllegalStateException when try-body throws
[PATH1] try-body throws -> throw new IllegalStateException("Security exception found for Constructor...
[PATH2] return clazz.getConstructor(... | /* static context
[FOCAL] public static Constructor<?> BeanBoxUtils.getConstructor(Class<?> clazz, Class<?>... paramTypes)
[THROWS-WHEN] IllegalStateException when try-body throws
[PATH1] try-body throws -> throw new IllegalStateException("Security exception found for Constructor...
[PATH2] return clazz.getConstructor(... | true | ok | {"focal": {"class": "BeanBoxUtils", "name": "getConstructor", "signature": "Constructor<?> getConstructor(Class<?> clazz, Class<?>... paramTypes)", "start_line": 3, "modifiers": "public static", "params": [{"name": "clazz", "type": "Class<?>"}, {"name": "paramTypes", "type": "Class<?>..."}], "return_type": "Constructor... |
53127403_391 | class InstanceService {
public List<Instance> findInstancesByIds(Set<Long> instanceIds) {
Iterable<Instance> instances = instanceRepository.findAllById(instanceIds);
return Lists.newArrayList(instances);
}
public InstanceService(
final InstanceRepository instanceRepository,
final InstanceCo... | String someAppId = "someAppId";
String someClusterName = "someClusterName";
String someDataCenter = "someDataCenter";
String someIp = "someIp";
String anotherIp = "anotherIp";
Instance someInstance = instanceService.createInstance(assembleInstance(someAppId,
someClusterName, someDataCen... | [FOCAL] public List<Instance> InstanceService.findInstancesByIds(Set<Long> instanceIds)
[CLASS] class InstanceService
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] instanceRepository.findAllById/1, Lists.newArrayList/1
[INPUTS] branches=- | result=instanceIds
[COLLABORATORS] fiel... | /* static context
[FOCAL] public List<Instance> InstanceService.findInstancesByIds(Set<Long> instanceIds)
[INPUTS] branches=- | result=instanceIds
[COLLABORATORS] field instanceRepository findAllById/1
[CALLS-EXTERNAL] instanceRepository.findAllById/1, Lists.newArrayList/1
*/
| /* static context
[FOCAL] public List<Instance> InstanceService.findInstancesByIds(Set<Long> instanceIds)
[INPUTS] branches=- | result=instanceIds
[COLLABORATORS] field instanceRepository findAllById/1
[CALLS-EXTERNAL] instanceRepository.findAllById/1, Lists.newArrayList/1
*/
class InstanceService {
public List<Inst... | true | ok | {"focal": {"class": "InstanceService", "name": "findInstancesByIds", "signature": "List<Instance> findInstancesByIds(Set<Long> instanceIds)", "start_line": 3, "modifiers": "public", "params": [{"name": "instanceIds", "type": "Set<Long>"}], "return_type": "List<Instance>"}, "class_info": {"name": "InstanceService", "kin... |
53169994_0 | class MainPresenter {
void getFitnessData() {
fitnessSessionDataList.clear();
view.showLoading();
DataReadRequest.Builder dataReadRequestBuilder = getDataReadRequestBuilder();
DataReadRequest dataReadRequest = dataReadRequestBuilder.build();
DataReadRequest dataReadRequestS... | doReturn(Observable.empty()).when(history).readBuckets(Matchers.any(DataReadRequest.class));
mainPresenter.getFitnessData();
ArgumentCaptor<List> fitnessSessionDataCaptor = ArgumentCaptor.forClass(List.class);
verify(mainView, times(1)).onFitnessSessionDataLoaded(fitnessSessionDataCap... | [FOCAL] void MainPresenter.getFitnessData()
[CLASS] class MainPresenter
[METRICS] loc=19 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] DataReadRequest.Builder getDataReadRequestBuilder()
[CALLS-EXTERNAL] fitnessSessionDataList.clear/0, view.showLoading/0, DataReadRequest.Builder.build/0, dataRea... | /* static context
[FOCAL] void MainPresenter.getFitnessData()
[COLLABORATORS] field fitnessSessionDataList clear/0; field view showLoading/0,onFitnessSessionDataLoaded/1; field disposable add/1; field rxFit:RxFit history/0
[CALLS-INTERNAL] DataReadRequest.Builder getDataReadRequestBuilder()
[FIELDS] read=rxFit:RxFit
[C... | /* static context
[FOCAL] void MainPresenter.getFitnessData()
[COLLABORATORS] field fitnessSessionDataList clear/0; field view showLoading/0,onFitnessSessionDataLoaded/1; field disposable add/1; field rxFit:RxFit history/0
[CALLS-INTERNAL] DataReadRequest.Builder getDataReadRequestBuilder()
[FIELDS] read=rxFit:RxFit
[C... | true | ok | {"focal": {"class": "MainPresenter", "name": "getFitnessData", "signature": "void getFitnessData()", "start_line": 3, "modifiers": "", "params": [], "return_type": "void"}, "class_info": {"name": "MainPresenter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "rxSchedulers... |
53222598_8 | class RedisDBHandler implements IDBHandler {
@Override
public boolean update(String key, int sequenceId, byte[] value) {
boolean isUpdated = false;
try {
if (hasKey(key)) {
byte[] serializedKey = serialize(key);
byte[] serializedSequenceId = serialize(sequenceId);
if (redis.hexists(serializedKey, ... | byte[] serializedValue = "foo".getBytes();
String key = dbHandler.store(serializedValue);
boolean b = dbHandler.update(key, 0, "foobar".getBytes());
assertTrue(b);
}
} | [FOCAL] @Override public boolean RedisDBHandler.update(String key, int sequenceId, byte[] value)
[CLASS] class RedisDBHandler implements IDBHandler
[METRICS] loc=17 cc=4 branches=2 loops=0 returns=1 throws=0 nesting=3
[CALLS-INTERNAL] boolean hasKey(String key); byte[] serialize(Object obj)
[CALLS-EXTERNAL] redis.hexis... | /* static context
[FOCAL] @Override public boolean RedisDBHandler.update(String key, int sequenceId, byte[] value)
[PATH1] if(hasKey(key))=T -> if(redis.hexists(serializedKey, serializedSequenceId))=T -> return isUpdated
[PATH2] try-body throws -> return isUpdated
[PATH3] if(hasKey(key))=F -> return isUpdated
[PATH4] i... | /* static context
[FOCAL] @Override public boolean RedisDBHandler.update(String key, int sequenceId, byte[] value)
[PATH1] if(hasKey(key))=T -> if(redis.hexists(serializedKey, serializedSequenceId))=T -> return isUpdated
[PATH2] try-body throws -> return isUpdated
[PATH3] if(hasKey(key))=F -> return isUpdated
[PATH4] i... | true | ok | {"focal": {"class": "RedisDBHandler", "name": "update", "signature": "boolean update(String key, int sequenceId, byte[] value)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "key", "type": "String"}, {"name": "sequenceId", "type": "int"}, {"name": "value", "type": "byte[]"}], "return_type": "bo... |
53225573_7 | class OperatorConditionalBinding implements Observable.Operator<T, T> {
@Override
public Subscriber<? super T> call(final Subscriber<? super T> child) {
return new Subscriber<T>(child) {
@Override
public void onCompleted() {
Assertions.assertUiThread();
... | OperatorConditionalBinding<String, Object> op = new OperatorConditionalBinding<String, Object>(
new Object(), UtilityFunctions.alwaysFalse());
Subscriber<? super String> sub = op.call(subscriber);
sub.onNext("one");
sub.onNext("two");
sub.onCompleted();
s... | [FOCAL] @Override public Subscriber<? super T> OperatorConditionalBinding.call(Subscriber<? super T> child)
[CLASS] class OperatorConditionalBinding implements Observable.Operator<T, T>
[METRICS] loc=52 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] Assertions.assertUiThread/0, shouldForwardNotif... | /* static context
[FOCAL] @Override public Subscriber<? super T> OperatorConditionalBinding.call(Subscriber<? super T> child)
[INPUTS] branches=- | result=child
[COLLABORATORS] param child:Subscriber<? super T> onCompleted/0,onError/1,onNext/1; field predicate call/1
[NEW] Subscriber<T>
[CALLS-EXTERNAL] Assertions.asse... | /* static context
[FOCAL] @Override public Subscriber<? super T> OperatorConditionalBinding.call(Subscriber<? super T> child)
[INPUTS] branches=- | result=child
[COLLABORATORS] param child:Subscriber<? super T> onCompleted/0,onError/1,onNext/1; field predicate call/1
[NEW] Subscriber<T>
[CALLS-EXTERNAL] Assertions.asse... | true | ok | {"focal": {"class": "OperatorConditionalBinding", "name": "call", "signature": "Subscriber<? super T> call(Subscriber<? super T> child)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "child", "type": "Subscriber<? super T>"}], "return_type": "Subscriber<? super T>"}, "class_info": {"name": "Ope... |
53246590_0 | class StaticGsonProcessor extends AbstractProcessor {
@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
if (annotations.isEmpty()) {
return true;
}
long t0 = System.currentTimeMillis();
StaticGsonContext context =... | JavaFileObject modelFile = JavaFileObjects.forResource("Book.java");
assert_().about(javaSource())
.that(modelFile)
.processedWith(new StaticGsonProcessor())
.compilesWithoutWarnings();
}
} | [FOCAL] @Override public boolean StaticGsonProcessor.process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
[CLASS] class StaticGsonProcessor extends AbstractProcessor
[METRICS] loc=26 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] Set<? extends TypeElement>.isEmpty/0, System.... | /* static context
[FOCAL] @Override public boolean StaticGsonProcessor.process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
[PATH1] if(annotations.isEmpty())=T -> return true
[PATH2] if(annotations.isEmpty())=F -> return true
[INPUTS] branches=annotations | result=-
[COLLABORATORS] param annotatio... | /* static context
[FOCAL] @Override public boolean StaticGsonProcessor.process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
[PATH1] if(annotations.isEmpty())=T -> return true
[PATH2] if(annotations.isEmpty())=F -> return true
[INPUTS] branches=annotations | result=-
[COLLABORATORS] param annotatio... | true | ok | {"focal": {"class": "StaticGsonProcessor", "name": "process", "signature": "boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "annotations", "type": "Set<? extends TypeElement>"}, {"name": "roundEnv", "type": "Round... |
53251585_1 | class LocationUtils {
static boolean isInside(LocationUSourceData data, Location location) {
for (LatLong center : data.locations) {
if (inside(center, data.radius, location.getLatitude(), location.getLongitude())) {
return true;
}
}
return false;
... | Assert.assertTrue(
LocationUtils.inside(LatLong.fromString("50, 50"), 150000, LatLong.fromString("50, 51"))
);
Assert.assertFalse(
LocationUtils.inside(LatLong.fromString("50, 50"), 100000, LatLong.fromString("50, 51"))
);
}
} | [FOCAL] static boolean LocationUtils.isInside(LocationUSourceData data, Location location)
[CLASS] class LocationUtils
[METRICS] loc=8 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2
[CALLS-INTERNAL] boolean inside(LatLong center, int radius, double latitude, double longtitude)
[CALLS-EXTERNAL] Location.getLatitud... | /* static context
[FOCAL] static boolean LocationUtils.isInside(LocationUSourceData data, Location location)
[PATH1] foreach(LatLong center : data.locations)=T -> if(inside(center, data.radius, location.getLatitude(), location.getLongitude()))=F -> exit loop -> return false
[PATH2] foreach(LatLong center : data.locatio... | /* static context
[FOCAL] static boolean LocationUtils.isInside(LocationUSourceData data, Location location)
[PATH1] foreach(LatLong center : data.locations)=T -> if(inside(center, data.radius, location.getLatitude(), location.getLongitude()))=F -> exit loop -> return false
[PATH2] foreach(LatLong center : data.locatio... | true | ok | {"focal": {"class": "LocationUtils", "name": "isInside", "signature": "boolean isInside(LocationUSourceData data, Location location)", "start_line": 3, "modifiers": "static", "params": [{"name": "data", "type": "LocationUSourceData"}, {"name": "location", "type": "Location"}], "return_type": "boolean"}, "class_info": {... |
53265801_2 | class RxAppStateMonitor {
@NonNull
public static Observable<AppState> monitor(@NonNull Application app) {
return Observable.create(new AppStateObservableOnSubscribe(new DefaultAppStateRecognizer(app)));
}
}
class RxAppStateMonitorTest {
@Test
public void emitsAppStates() {
| FakeApplication fakeApplication = new FakeApplication();
TestObserver<AppState> subscriber = TestObserver.create();
RxAppStateMonitor.monitor(fakeApplication).subscribe(subscriber);
fakeApplication.goForeground();
fakeApplication.goBackground();
subscriber.assertValues(FOREGROUND, BACKGROUND);... | [FOCAL] @NonNull public static Observable<AppState> RxAppStateMonitor.monitor(Application app)
[CLASS] class RxAppStateMonitor
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Observable.create/1
[NEW] AppStateObservableOnSubscribe, DefaultAppStateRecognizer
[INPUTS] branches=- | re... | /* static context
[FOCAL] @NonNull public static Observable<AppState> RxAppStateMonitor.monitor(Application app)
[INPUTS] branches=- | result=app
[NEW] AppStateObservableOnSubscribe, DefaultAppStateRecognizer
[CALLS-EXTERNAL] Observable.create/1
*/
| /* static context
[FOCAL] @NonNull public static Observable<AppState> RxAppStateMonitor.monitor(Application app)
[INPUTS] branches=- | result=app
[NEW] AppStateObservableOnSubscribe, DefaultAppStateRecognizer
[CALLS-EXTERNAL] Observable.create/1
*/
class RxAppStateMonitor {
@NonNull
public static Observable<AppSta... | true | ok | {"focal": {"class": "RxAppStateMonitor", "name": "monitor", "signature": "Observable<AppState> monitor(Application app)", "start_line": 3, "modifiers": "@NonNull public static", "params": [{"name": "app", "type": "Application"}], "return_type": "Observable<AppState>"}, "class_info": {"name": "RxAppStateMonitor", "kind"... |
53275454_0 | class Deserializer {
public Resource createObjectFromString(String resourceName) throws InstantiationException, IllegalAccessException, NotExtendingResourceException {
Class objectClass = registeredClasses.get(resourceName);
try {
return (Resource) objectClass.newInstance();
} catch (InstantiationE... | HashMap<String, Class> mockMap = mock(HashMap.class);
when(mockMap.get("articles")).thenReturn(Article.class);
Deserializer.setRegisteredClasses(mockMap);
Deserializer deserializer = new Deserializer();
Resource resource = deserializer.createObjectFromString("articles");
assertNotNull(resource... | [FOCAL] public Resource Deserializer.createObjectFromString(String resourceName)
[CLASS] class Deserializer
[METRICS] loc=12 cc=4 branches=0 loops=0 returns=1 throws=3 nesting=1
[CALLS-EXTERNAL] registeredClasses.get/1, Class.newInstance/0
[NEW] NotExtendingResourceException
[EXCEPTIONS] declares InstantiationException... | /* static context
[FOCAL] public Resource Deserializer.createObjectFromString(String resourceName)
[THROWS-WHEN] e when try-body throws
[THROWS-WHEN] NotExtendingResourceException when try-body throws
[PATH1] try-body throws -> throw e
[PATH2] return (Resource) objectClass.newInstance()
[PATH3] try-body throws -> throw... | /* static context
[FOCAL] public Resource Deserializer.createObjectFromString(String resourceName)
[THROWS-WHEN] e when try-body throws
[THROWS-WHEN] NotExtendingResourceException when try-body throws
[PATH1] try-body throws -> throw e
[PATH2] return (Resource) objectClass.newInstance()
[PATH3] try-body throws -> throw... | true | ok | {"focal": {"class": "Deserializer", "name": "createObjectFromString", "signature": "Resource createObjectFromString(String resourceName) throws InstantiationException, IllegalAccessException, NotExtendingResourceException", "start_line": 3, "modifiers": "public", "params": [{"name": "resourceName", "type": "String"}], ... |
53291241_5 | class VeraCliArgParser {
public boolean isHelp() {
return this.help;
}
public boolean showVersion();
public boolean listProfiles();
public boolean isVerbose();
public int maxFailuresDisplayed();
public int maxFailures();
public boolean fixMetadata();
public String prefix();
public String saveFolder();
pu... | // Test default is false
assertFalse(VeraCliArgParser.DEFAULT_ARGS.isHelp());
// Test empty String[] args doesn't change that
VeraCliArgParser parser = new VeraCliArgParser();
JCommander jCommander = initialiseJCommander(parser);
jCommander.parse(new String[] {});
... | [FOCAL] public boolean VeraCliArgParser.isHelp()
[CLASS] class VeraCliArgParser
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[FIELDS] read=help
[CLASS-MEMBERS] boolean showVersion(); boolean listProfiles(); boolean isVerbose(); int maxFailuresDisplayed(); int maxFailures(); boolean fixMetadata()... | /* static context
[FOCAL] public boolean VeraCliArgParser.isHelp()
[FIELDS] read=help
*/
| /* static context
[FOCAL] public boolean VeraCliArgParser.isHelp()
[FIELDS] read=help
*/
class VeraCliArgParser {
public boolean isHelp() {
return this.help;
}
public boolean showVersion();
public boolean listProfiles();
public boolean isVerbose();
public int maxFailuresDisplayed();
public int maxFailures();... | true | ok | {"focal": {"class": "VeraCliArgParser", "name": "isHelp", "signature": "boolean isHelp()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "VeraCliArgParser", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "APP_NAME",... |
53291713_0 | class DateUtils {
public static String prettyTime(String timeInMillisec) {
if (timeInMillisec == null) {
return "";
}
return prettyTime(Long.parseLong(timeInMillisec), OmniNotes.getAppContext().getResources().getConfiguration().locale);
}
public static String getString(long date, String format);
public s... | long now = Calendar.getInstance().getTimeInMillis();
String prettyTime = DateUtils.prettyTime(now, Locale.ENGLISH);
Assert.assertEquals(prettyTime.toLowerCase(), "moments ago");
prettyTime = DateUtils.prettyTime(now + 10 * 60 * 1000, Locale.ENGLISH);
Assert.assertEquals(prettyTime.toLowerCase(), "10 minutes... | [FOCAL] public static String DateUtils.prettyTime(String timeInMillisec)
[CLASS] class DateUtils
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] String prettyTime(Long timeInMillisec, Locale locale)
[CALLS-EXTERNAL] Long.parseLong/1, OmniNotes.getAppContext().getResources().getConf... | /* static context
[FOCAL] public static String DateUtils.prettyTime(String timeInMillisec)
[PATH1] if(timeInMillisec == null)=T -> return ""
[PATH2] if(timeInMillisec == null)=F -> return prettyTime(Long.parseLong(timeInMillisec), OmniNotes.getAppContext(...
[INPUTS] branches=timeInMillisec | result=timeInMillisec
[CAL... | /* static context
[FOCAL] public static String DateUtils.prettyTime(String timeInMillisec)
[PATH1] if(timeInMillisec == null)=T -> return ""
[PATH2] if(timeInMillisec == null)=F -> return prettyTime(Long.parseLong(timeInMillisec), OmniNotes.getAppContext(...
[INPUTS] branches=timeInMillisec | result=timeInMillisec
[CAL... | true | ok | {"focal": {"class": "DateUtils", "name": "prettyTime", "signature": "String prettyTime(String timeInMillisec)", "start_line": 3, "modifiers": "public static", "params": [{"name": "timeInMillisec", "type": "String"}], "return_type": "String"}, "class_info": {"name": "DateUtils", "kind": "class", "modifiers": "", "superc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.