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 |
|---|---|---|---|---|---|---|---|---|
72728706_6 | class JsonArrayConverter implements Converter<String,JsonArray> {
@Override
public JsonArray from(String databaseObject) {
return databaseObject==null?null:new JsonArray(databaseObject);
}
@Override public String to(JsonArray userObject);
@Override public Class<String> fromType();
@Ove... | JsonArray from = converter.from(null);
Assert.assertNull(from);
}
} | [FOCAL] @Override public JsonArray JsonArrayConverter.from(String databaseObject)
[CLASS] class JsonArrayConverter implements Converter<String,JsonArray>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] JsonArray
[INPUTS] branches=- | result=databaseObject
[DATAFLOW] databaseObject@param->L3
[... | /* static context
[FOCAL] @Override public JsonArray JsonArrayConverter.from(String databaseObject)
[INPUTS] branches=- | result=databaseObject
[NEW] JsonArray
*/
| /* static context
[FOCAL] @Override public JsonArray JsonArrayConverter.from(String databaseObject)
[INPUTS] branches=- | result=databaseObject
[NEW] JsonArray
*/
class JsonArrayConverter implements Converter<String,JsonArray> {
@Override
public JsonArray from(String databaseObject) {
return databaseOb... | true | ok | {"focal": {"class": "JsonArrayConverter", "name": "from", "signature": "JsonArray from(String databaseObject)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "databaseObject", "type": "String"}], "return_type": "JsonArray"}, "class_info": {"name": "JsonArrayConverter", "kind": "class", "modifier... |
72736755_0 | class DefaultEventSerializer implements EventSerializer {
@Override
public String serialize(final Event event) {
return getXML(event);
}
public static String getXML(final Event event);
private static Marshaller getMarshaller();
private synchronized static JAXBContext getContext();
}
... | final Event event = buildEvent();
final EventSerializer serializer = new DefaultEventSerializer();
final String xml = serializer.serialize(event);
System.out.println(xml);
final String expectedXML = "<Event xmlns=\"event-logging:3\">\n" + " <EventDetail>\n"
+... | [FOCAL] @Override public String DefaultEventSerializer.serialize(Event event)
[CLASS] class DefaultEventSerializer implements EventSerializer
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String getXML(Event event)
[INPUTS] branches=- | result=event
[DATAFLOW] event@param->L3
[CL... | /* static context
[FOCAL] @Override public String DefaultEventSerializer.serialize(Event event)
[INPUTS] branches=- | result=event
[CALLS-INTERNAL] String getXML(Event event)
*/
| /* static context
[FOCAL] @Override public String DefaultEventSerializer.serialize(Event event)
[INPUTS] branches=- | result=event
[CALLS-INTERNAL] String getXML(Event event)
*/
class DefaultEventSerializer implements EventSerializer {
@Override
public String serialize(final Event event) {
return getXM... | true | ok | {"focal": {"class": "DefaultEventSerializer", "name": "serialize", "signature": "String serialize(Event event)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "event", "type": "Event"}], "return_type": "String"}, "class_info": {"name": "DefaultEventSerializer", "kind": "class", "modifiers": "", ... |
72737456_1 | class Configuration {
public List<Pipeline> getEffectiveOutputPipelines() {
final Map<String, Pipeline> pipelineMap = pipelines.stream()
.collect(Collectors.toMap(Pipeline::getPipelineName, Function.identity()));
final List<Pipeline> effectivePipelines = pipelines.stream()
... |
//pipe1 (no output)
Pipeline pipe1 = new Pipeline(
"pipe1",
null,
null,
false,
null,
Arrays.asList("T1.1", "T1.2"));
//pipe1 <- pipe2 (no output)
Pipeline pipe2 = new Pipeline(
... | [FOCAL] public List<Pipeline> Configuration.getEffectiveOutputPipelines()
[CLASS] class Configuration
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Pipeline getEffectivePipeline(Pipeline parentPipeline, Map<String, Pipeline> pipelineMap)
[CALLS-EXTERNAL] pipelines.stream().colle... | /* static context
[FOCAL] public List<Pipeline> Configuration.getEffectiveOutputPipelines()
[COLLABORATORS] field pipelines stream/0
[CALLS-INTERNAL] Pipeline getEffectivePipeline(Pipeline parentPipeline, Map<String, Pipeline> pipelineMap)
[CALLS-EXTERNAL] pipelines.stream().collect/1, pipelines.stream/0, Collectors.to... | /* static context
[FOCAL] public List<Pipeline> Configuration.getEffectiveOutputPipelines()
[COLLABORATORS] field pipelines stream/0
[CALLS-INTERNAL] Pipeline getEffectivePipeline(Pipeline parentPipeline, Map<String, Pipeline> pipelineMap)
[CALLS-EXTERNAL] pipelines.stream().collect/1, pipelines.stream/0, Collectors.to... | true | ok | {"focal": {"class": "Configuration", "name": "getEffectiveOutputPipelines", "signature": "List<Pipeline> getEffectiveOutputPipelines()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<Pipeline>"}, "class_info": {"name": "Configuration", "kind": "class", "modifiers": "", "superclass": null, "... |
72737874_48 | class DockerServiceImpl implements DockerService {
@Override
public SwarmInspectResponse getSwarm() {
return getOrNullAction(makeBaseUrl().path("swarm"), SwarmInspectResponse.class);
}
@SuppressWarnings("unchecked") public DockerServiceImpl(Builder b);
private URI createUri();
public... | SwarmInspectResponse swarm = service.getSwarm();
Assert.assertNotNull(swarm);
}
} | [FOCAL] @Override public SwarmInspectResponse DockerServiceImpl.getSwarm()
[CLASS] class DockerServiceImpl implements DockerService
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] T getOrNullAction(UriComponentsBuilder ub, Class<T> responseType); UriComponentsBuilder makeBaseUrl()
... | /* static context
[FOCAL] @Override public SwarmInspectResponse DockerServiceImpl.getSwarm()
[CALLS-INTERNAL] T getOrNullAction(UriComponentsBuilder ub, Class<T> responseType); UriComponentsBuilder makeBaseUrl()
[CALLS-EXTERNAL] makeBaseUrl().path/1
*/
| /* static context
[FOCAL] @Override public SwarmInspectResponse DockerServiceImpl.getSwarm()
[CALLS-INTERNAL] T getOrNullAction(UriComponentsBuilder ub, Class<T> responseType); UriComponentsBuilder makeBaseUrl()
[CALLS-EXTERNAL] makeBaseUrl().path/1
*/
class DockerServiceImpl implements DockerService {
@Override
... | true | ok | {"focal": {"class": "DockerServiceImpl", "name": "getSwarm", "signature": "SwarmInspectResponse getSwarm()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "SwarmInspectResponse"}, "class_info": {"name": "DockerServiceImpl", "kind": "class", "modifiers": "", "superclass": null, "interfac... |
72795142_10 | class AdminUserDetailsService implements IAdminUserDetailsService {
@Override
public List<UserDetails> getAllAdmins() {
List<UserDetails> userList = new ArrayList<>();
Set<Entry<Object, Object>> entries = users.entrySet();
for (Entry<Object, Object> entry : entries) {
String... | Entry<Object, Object> entry = new SimpleEntry<>(USERNAME, USERDATA);
Set<Entry<Object, Object>> set = new HashSet<>();
set.add(entry);
Mockito.when(users.entrySet()).thenReturn(set);
List<UserDetails> admins = adminDetailsServiceToTest.getAllAdmins();
Assert.assertTrue(a... | [FOCAL] @Override public List<UserDetails> AdminUserDetailsService.getAllAdmins()
[CLASS] class AdminUserDetailsService implements IAdminUserDetailsService
[METRICS] loc=17 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] Properties.entrySet/0, Properties.getProperty/1, entry.getKey().toString/0, E... | /* static context
[FOCAL] @Override public List<UserDetails> AdminUserDetailsService.getAllAdmins()
[PATH1] foreach(Entry<Object, Object> entry : entries)=T -> if(data.length >= 3)=T -> exit loop -> return userList
[PATH2] foreach(Entry<Object, Object> entry : entries)=F -> return userList
[PATH3] foreach(Entry<Object,... | /* static context
[FOCAL] @Override public List<UserDetails> AdminUserDetailsService.getAllAdmins()
[PATH1] foreach(Entry<Object, Object> entry : entries)=T -> if(data.length >= 3)=T -> exit loop -> return userList
[PATH2] foreach(Entry<Object, Object> entry : entries)=F -> return userList
[PATH3] foreach(Entry<Object,... | true | ok | {"focal": {"class": "AdminUserDetailsService", "name": "getAllAdmins", "signature": "List<UserDetails> getAllAdmins()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "List<UserDetails>"}, "class_info": {"name": "AdminUserDetailsService", "kind": "class", "modifiers": "", "superclass": n... |
72805051_3 | class TransformGestureDetector implements MultiPointerGestureDetector.Listener {
@Override
public void onGestureUpdate(MultiPointerGestureDetector detector) {
if (mListener != null) {
mListener.onGestureUpdate(this);
}
}
public TransformGestureDetector(MultiPointerGestureDetector multiPointerGe... | mGestureDetector.onGestureUpdate(mMultiPointerGestureDetector);
verify(mListener).onGestureUpdate(mGestureDetector);
}
} | [FOCAL] @Override public void TransformGestureDetector.onGestureUpdate(MultiPointerGestureDetector detector)
[CLASS] class TransformGestureDetector implements MultiPointerGestureDetector.Listener
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] TransformGestureDetector.Listener.onGe... | /* static context
[FOCAL] @Override public void TransformGestureDetector.onGestureUpdate(MultiPointerGestureDetector detector)
[PATH1] if(mListener != null)=T
[PATH2] if(mListener != null)=F
[INPUTS] branches=mListener | result=- | unused=detector
[COLLABORATORS] field mListener:TransformGestureDetector.Listener onGest... | /* static context
[FOCAL] @Override public void TransformGestureDetector.onGestureUpdate(MultiPointerGestureDetector detector)
[PATH1] if(mListener != null)=T
[PATH2] if(mListener != null)=F
[INPUTS] branches=mListener | result=- | unused=detector
[COLLABORATORS] field mListener:TransformGestureDetector.Listener onGest... | true | ok | {"focal": {"class": "TransformGestureDetector", "name": "onGestureUpdate", "signature": "void onGestureUpdate(MultiPointerGestureDetector detector)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "detector", "type": "MultiPointerGestureDetector"}], "return_type": "void"}, "class_info": {"name": ... |
72815283_3 | class BmcPropertyAccessor {
Accessor<Boolean> asBoolean() {
return new Accessor<Boolean>() {
@Override
public Boolean get(BmcProperties property) {
// overridden properties only use the new property names, no need to check for clashes
String overridde... | assertThat(
propertyAccessor.asBoolean().get(BmcProperties.IN_MEMORY_READ_BUFFER), is(false));
this.configuration.setBoolean(BmcProperties.IN_MEMORY_READ_BUFFER.getPropertyName(), true);
assertThat(propertyAccessor.asBoolean().get(BmcProperties.IN_MEMORY_READ_BUFFER), is(true));
... | [FOCAL] Accessor<Boolean> BmcPropertyAccessor.asBoolean()
[CLASS] class BmcPropertyAccessor
[METRICS] loc=28 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] String getOverriddenPropertyName(BmcProperties property); boolean exists(String key); void checkClash(BmcProperties property)
[CALLS-EXTERNAL... | /* static context
[FOCAL] Accessor<Boolean> BmcPropertyAccessor.asBoolean()
[INPUTS] branches=- | result=configuration
[COLLABORATORS] field configuration:Configuration getBoolean/2; field property getPropertyName/0,getDefaultValue/0
[CALLS-INTERNAL] String getOverriddenPropertyName(BmcProperties property); boolean exi... | /* static context
[FOCAL] Accessor<Boolean> BmcPropertyAccessor.asBoolean()
[INPUTS] branches=- | result=configuration
[COLLABORATORS] field configuration:Configuration getBoolean/2; field property getPropertyName/0,getDefaultValue/0
[CALLS-INTERNAL] String getOverriddenPropertyName(BmcProperties property); boolean exi... | true | ok | {"focal": {"class": "BmcPropertyAccessor", "name": "asBoolean", "signature": "Accessor<Boolean> asBoolean()", "start_line": 3, "modifiers": "", "params": [], "return_type": "Accessor<Boolean>"}, "class_info": {"name": "BmcPropertyAccessor", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fiel... |
72836592_0 | class CaEhcache extends BasicCa<K, V> {
public CaEhcache(String name, Cache<K, V> ca) {
super(name, CaType.Local);
this.ca = ca;
}
public CaEhcache(String name, Cache<K, V> ca);
@Override protected CaValue<K, V> doRead(K key);
@Override protected boolean doWrite(CaValue<K, V> val... | @SuppressWarnings("resource")
CaEhcache<String, String> ca = new CaEhcache<String, String>(NAME, cacheManager.getCache(NAME, String.class, String.class));
String key = "key1";
CaValue<String, String> val = ca.read(key);
LOG.info(val.toString());
Assert.assertEquals(null,... | [FOCAL] public CaEhcache.CaEhcache(String name, Cache<K, V> ca)
[CLASS] class CaEhcache extends BasicCa<K, V>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[FIELDS] write=ca
[STATE] ca
[DATAFLOW] ca@param->L3; name@param->L2
[CLASS-MEMBERS] CaEhcache(String name, Cache<K, V> ca); CaValue<K, V> do... | /* static context
[FOCAL] public CaEhcache.CaEhcache(String name, Cache<K, V> ca)
[STATE] ca
[FIELDS] write=ca
*/
| /* static context
[FOCAL] public CaEhcache.CaEhcache(String name, Cache<K, V> ca)
[STATE] ca
[FIELDS] write=ca
*/
class CaEhcache extends BasicCa<K, V> {
public CaEhcache(String name, Cache<K, V> ca) {
super(name, CaType.Local);
this.ca = ca;
}
public CaEhcache(String name, Cache<K, V> ca... | true | ok | {"focal": {"class": "CaEhcache", "name": "CaEhcache", "signature": "CaEhcache(String name, Cache<K, V> ca)", "start_line": 3, "modifiers": "public", "params": [{"name": "name", "type": "String"}, {"name": "ca", "type": "Cache<K, V>"}], "return_type": null}, "class_info": {"name": "CaEhcache", "kind": "class", "modifier... |
72846258_12 | class Gavtc extends Gav {
public static List<Gavtc> ofPattern(String gavtcPattern) {
StringTokenizer st = new StringTokenizer(gavtcPattern, ":");
if (!st.hasMoreTokens()) {
throw new IllegalStateException(
String.format("Cannot parse [%s] to a " + Gav.class.getName()... | Assert.assertEquals(Arrays.asList(Gavtc.of("g:a:v:pom"), Gavtc.of("g:a:v:jar")),
Gavtc.ofPattern("g:a:v:[pom,jar]"));
Assert.assertEquals(Arrays.asList(Gavtc.of("g:a:v:pom")), Gavtc.ofPattern("g:a:v:[pom]"));
Assert.assertEquals(Arrays.asList(Gavtc.of("g:a:v:pom")), Gavtc.ofPatte... | [FOCAL] public static List<Gavtc> Gavtc.ofPattern(String gavtcPattern)
[CLASS] class Gavtc extends Gav
[METRICS] loc=35 cc=6 branches=4 loops=1 returns=1 throws=4 nesting=5
[CALLS-EXTERNAL] StringTokenizer.hasMoreTokens/0, String.format/2, Gav.class.getName/0, StringTokenizer.nextToken/0, Gavtc.class.getName/0, List<Ga... | /* static context
[FOCAL] public static List<Gavtc> Gavtc.ofPattern(String gavtcPattern)
[THROWS-WHEN] IllegalStateException when !st.hasMoreTokens()
[THROWS-WHEN] IllegalStateException when st.hasMoreTokens() && !st.hasMoreTokens()
[THROWS-WHEN] IllegalStateException when st.hasMoreTokens() && st.hasMoreTokens() && !s... | /* static context
[FOCAL] public static List<Gavtc> Gavtc.ofPattern(String gavtcPattern)
[THROWS-WHEN] IllegalStateException when !st.hasMoreTokens()
[THROWS-WHEN] IllegalStateException when st.hasMoreTokens() && !st.hasMoreTokens()
[THROWS-WHEN] IllegalStateException when st.hasMoreTokens() && st.hasMoreTokens() && !s... | true | ok | {"focal": {"class": "Gavtc", "name": "ofPattern", "signature": "List<Gavtc> ofPattern(String gavtcPattern)", "start_line": 3, "modifiers": "public static", "params": [{"name": "gavtcPattern", "type": "String"}], "return_type": "List<Gavtc>"}, "class_info": {"name": "Gavtc", "kind": "class", "modifiers": "", "superclass... |
72847871_5 | class AppClient {
public App getApp() {
return app;
}
}
class AppClientTest {
@Test
public void appMessage() {
| Assert.assertEquals("Hello World!", new AppClient().getApp().getMessage());
}
} | [FOCAL] public App AppClient.getApp()
[CLASS] class AppClient
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[TEST] AppClientTest: @Test public void appMessage() | /* static context
[FOCAL] public App AppClient.getApp()
*/
| /* static context
[FOCAL] public App AppClient.getApp()
*/
class AppClient {
public App getApp() {
return app;
}
}
class AppClientTest {
@Test
public void appMessage() {
| true | ok | {"focal": {"class": "AppClient", "name": "getApp", "signature": "App getApp()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "App"}, "class_info": {"name": "AppClient", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": []}, "ast": {"sexp": "(metho... |
72868257_10 | class AppServerConfig implements ServerConfig {
@Override
public @Nullable List<@NotNull PostServerStartupHook> postServerStartupHooks() {
PostServerStartupHook eurekaStartupHook = guiceValues.eurekaServerHooks.eurekaStartupHook;
return (eurekaStartupHook == null) ? null : Collections.singleton... | "true",
"false"
})
@Test
public void postServerStartupHooks_works_as_expected(boolean eurekaStartupHookIsNull) {
// given
PostServerStartupHook eurekaStartupHook = (eurekaStartupHookIsNull) ? null : mock(PostServerStartupHook.class);
Whitebox.setInternalState(
... | [FOCAL] @Override public @Nullable List<@NotNull PostServerStartupHook> AppServerConfig.postServerStartupHooks()
[CLASS] class AppServerConfig implements ServerConfig
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Collections.singletonList/1
[DATAFLOW] eurekaStartupHook@L3->L4
[CL... | /* static context
[FOCAL] @Override public @Nullable List<@NotNull PostServerStartupHook> AppServerConfig.postServerStartupHooks()
[CALLS-EXTERNAL] Collections.singletonList/1
*/
| /* static context
[FOCAL] @Override public @Nullable List<@NotNull PostServerStartupHook> AppServerConfig.postServerStartupHooks()
[CALLS-EXTERNAL] Collections.singletonList/1
*/
class AppServerConfig implements ServerConfig {
@Override
public @Nullable List<@NotNull PostServerStartupHook> postServerStartupHoo... | true | ok | {"focal": {"class": "AppServerConfig", "name": "postServerStartupHooks", "signature": "List<@NotNull PostServerStartupHook> postServerStartupHooks()", "start_line": 3, "modifiers": "@Override public @Nullable", "params": [], "return_type": "List<@NotNull PostServerStartupHook>"}, "class_info": {"name": "AppServerConfig... |
72889410_70 | class MethodHash implements Comparable<MethodHash> {
@Override
public boolean equals(Object o) {
if (o instanceof MethodHash) {
return isSameHash((MethodHash) o);
}
return false;
}
public MethodHash();
public MethodHash(String methodName, String methodSig, boo... | byte[] hash2 = ClassHash.stringToHash(s);
Assert.assertTrue(Arrays.equals(hash, hash2));
}
} | [FOCAL] @Override public boolean MethodHash.equals(Object o)
[CLASS] class MethodHash implements Comparable<MethodHash>
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] boolean isSameHash(MethodHash other)
[PATH1] if(o instanceof MethodHash)=T -> return isSameHash((MethodHash) o)
[P... | /* static context
[FOCAL] @Override public boolean MethodHash.equals(Object o)
[PATH1] if(o instanceof MethodHash)=T -> return isSameHash((MethodHash) o)
[PATH2] if(o instanceof MethodHash)=F -> return false
[INPUTS] branches=o | result=o
[CALLS-INTERNAL] boolean isSameHash(MethodHash other)
*/
| /* static context
[FOCAL] @Override public boolean MethodHash.equals(Object o)
[PATH1] if(o instanceof MethodHash)=T -> return isSameHash((MethodHash) o)
[PATH2] if(o instanceof MethodHash)=F -> return false
[INPUTS] branches=o | result=o
[CALLS-INTERNAL] boolean isSameHash(MethodHash other)
*/
class MethodHash impleme... | true | ok | {"focal": {"class": "MethodHash", "name": "equals", "signature": "boolean equals(Object o)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "o", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "MethodHash", "kind": "class", "modifiers": "", "superclass": null, "interfaces": ... |
72967236_3 | class BlurLayout extends FrameLayout {
public void setBlurRadius(int blurRadius) {
this.mBlurRadius = blurRadius;
// This field is now bad (it's pre-blurred with blurRadius so will need to be re-made)
this.mLockedBitmap = null;
invalidate();
}
public BlurLayout(Context c... | blurLayout.setBlurRadius(TEST_INT);
assertEquals(TEST_INT, blurLayout.getBlurRadius());
}
} | [FOCAL] public void BlurLayout.setBlurRadius(int blurRadius)
[CLASS] class BlurLayout extends FrameLayout
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void invalidate()
[FIELDS] write=mBlurRadius, mLockedBitmap
[STATE] mBlurRadius, mLockedBitmap
[DATAFLOW] blurRadius@param->L2
[... | /* static context
[FOCAL] public void BlurLayout.setBlurRadius(int blurRadius)
[STATE] mBlurRadius, mLockedBitmap
[CALLS-INTERNAL] void invalidate()
[FIELDS] write=mBlurRadius, mLockedBitmap
*/
| /* static context
[FOCAL] public void BlurLayout.setBlurRadius(int blurRadius)
[STATE] mBlurRadius, mLockedBitmap
[CALLS-INTERNAL] void invalidate()
[FIELDS] write=mBlurRadius, mLockedBitmap
*/
class BlurLayout extends FrameLayout {
public void setBlurRadius(int blurRadius) {
this.mBlurRadius = blurRadius;... | true | ok | {"focal": {"class": "BlurLayout", "name": "setBlurRadius", "signature": "void setBlurRadius(int blurRadius)", "start_line": 3, "modifiers": "public", "params": [{"name": "blurRadius", "type": "int"}], "return_type": "void"}, "class_info": {"name": "BlurLayout", "kind": "class", "modifiers": "", "superclass": "FrameLayo... |
73006755_9 | class StreamResourceSupport {
static ResourceOptions buildResourceOptions(NakadiClient client, StreamConfiguration sc) {
ResourceOptions options = ResourceSupport
// breaks with api definition https://github.com/zalando-incubator/nakadi-java/issues/98
.options(APPLICATION_JSON)
.tokenProv... |
assertNull(
StreamResourceSupport.buildResourceOptions(client,
new StreamConfiguration().eventTypeName("et")).scope()
);
assertNull(
StreamResourceSupport.buildResourceOptions(client,
new StreamConfiguration().subscriptionId("sub1")).scope()
);
assertNull(
... | [FOCAL] static ResourceOptions StreamResourceSupport.buildResourceOptions(NakadiClient client, StreamConfiguration sc)
[CLASS] class StreamResourceSupport
[METRICS] loc=18 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] void applyConfiguredHeaders(StreamConfiguration sc, ResourceOptions options)
[... | /* static context
[FOCAL] static ResourceOptions StreamResourceSupport.buildResourceOptions(NakadiClient client, StreamConfiguration sc)
[PATH1] if(sc.isSubscriptionStream())=T -> return options
[PATH2] if(sc.isSubscriptionStream())=F -> return options
[INPUTS] branches=sc | result=client
[COLLABORATORS] param client:N... | /* static context
[FOCAL] static ResourceOptions StreamResourceSupport.buildResourceOptions(NakadiClient client, StreamConfiguration sc)
[PATH1] if(sc.isSubscriptionStream())=T -> return options
[PATH2] if(sc.isSubscriptionStream())=F -> return options
[INPUTS] branches=sc | result=client
[COLLABORATORS] param client:N... | true | ok | {"focal": {"class": "StreamResourceSupport", "name": "buildResourceOptions", "signature": "ResourceOptions buildResourceOptions(NakadiClient client, StreamConfiguration sc)", "start_line": 3, "modifiers": "static", "params": [{"name": "client", "type": "NakadiClient"}, {"name": "sc", "type": "StreamConfiguration"}], "r... |
73013368_14 | class ViewManager implements Observer<LifecycleEvent> {
@MainThread
void finish(@NonNull ContentViewContract view) {
final Dual<NavigationDetails, Boolean> removedViewMetadata = removeViewFromStack(view);
if (removedViewMetadata == null) {
LogUtil.logViewWarning(TAG, "Tried to remove non-existing vie... | final MockView secondView = spy(new MockView() {
@Override
public void onDestroy() {
super.onDestroy();
viewManager.finish(this);
}
});
assertFinishFromOnDestroyDoesNoting(secondView);
}
} | [FOCAL] @MainThread void ViewManager.finish(ContentViewContract view)
[CLASS] class ViewManager implements Observer<LifecycleEvent>
[METRICS] loc=37 cc=7 branches=6 loops=0 returns=1 throws=0 nesting=4
[CALLS-INTERNAL] Dual<NavigationDetails, Boolean> removeViewFromStack(ContentViewContract removableView); void callVie... | /* static context
[FOCAL] @MainThread void ViewManager.finish(ContentViewContract view)
[PATH1] if(removedViewMetadata == null)=F -> if(top && latestLifecycleEvent != STOP)#1=T -> if(top && latestLifecycleEvent != STOP)#2=T -> if(newTop != null)=T -> if(newTop.needsRestart())=F -> if(newTopView.latestLifecycleEvent() !... | /* static context
[FOCAL] @MainThread void ViewManager.finish(ContentViewContract view)
[PATH1] if(removedViewMetadata == null)=F -> if(top && latestLifecycleEvent != STOP)#1=T -> if(top && latestLifecycleEvent != STOP)#2=T -> if(newTop != null)=T -> if(newTop.needsRestart())=F -> if(newTopView.latestLifecycleEvent() !... | true | ok | {"focal": {"class": "ViewManager", "name": "finish", "signature": "void finish(ContentViewContract view)", "start_line": 3, "modifiers": "@MainThread", "params": [{"name": "view", "type": "ContentViewContract"}], "return_type": "void"}, "class_info": {"name": "ViewManager", "kind": "class", "modifiers": "", "superclass... |
73056727_27 | class Program {
public void compile() throws IOException {
final String[] lines = new TextOf(this.input).asString().split("\n");
final ANTLRErrorListener errors = new BaseErrorListener() {
// @checkstyle ParameterNumberCheck (10 lines)
@Override
public void synta... | final ByteArrayOutputStream baos = new ByteArrayOutputStream();
final Program program = new Program(
new InputOf(
new JoinedText(
"\n",
"object car as Serializable:",
" Integer @vin",
" String n... | [FOCAL] public void Program.compile()
[CLASS] class Program
[METRICS] loc=45 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] new TextOf(this.input).asString().split/1, new TextOf(this.input).asString/0, String.format/5, CharStreams.fromStream/1, this.input.stream/0, org.eolang.compiler.ProgramLexe... | /* static context
[FOCAL] public void Program.compile()
[COLLABORATORS] field input stream/0; field path getValue/0,getKey/0; field target apply/1
[EXCEPTIONS] declares IOException
[FIELDS] read=input, target
[NEW] TextOf, BaseErrorListener, CompileException, org.eolang.compiler.ProgramLexer, org.eolang.compiler.Progra... | /* static context
[FOCAL] public void Program.compile()
[COLLABORATORS] field input stream/0; field path getValue/0,getKey/0; field target apply/1
[EXCEPTIONS] declares IOException
[FIELDS] read=input, target
[NEW] TextOf, BaseErrorListener, CompileException, org.eolang.compiler.ProgramLexer, org.eolang.compiler.Progra... | true | ok | {"focal": {"class": "Program", "name": "compile", "signature": "void compile() throws IOException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "Program", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name":... |
73085073_1 | class IOTimeoutAction {
void execute() throws IOException
{
if( timeout > 0 )
{
long timeSpentWaiting = 0;
long currentTS = System.currentTimeMillis();
while( !condition() )
{
try
{
Thread.sleep(... | final long initialTS = System.currentTimeMillis();
IOTimeoutAction action = new IOTimeoutAction(300)
{
@Override
public boolean condition() throws IOException
{
return System.currentTimeMillis() - initialTS > 500;
}
};
... | [FOCAL] void IOTimeoutAction.execute()
[CLASS] class IOTimeoutAction
[METRICS] loc=42 cc=7 branches=2 loops=2 returns=0 throws=3 nesting=3
[CALLS-INTERNAL] boolean condition()
[CALLS-EXTERNAL] System.currentTimeMillis/0, Thread.sleep/1
[NEW] IOException
[EXCEPTIONS] declares IOException; throws IOException; catches Int... | /* static context
[FOCAL] void IOTimeoutAction.execute()
[THROWS-WHEN] IOException when timeout > 0 && !condition() && try-body throws
[THROWS-WHEN] IOException when timeout > 0 && !condition() && timeSpentWaiting >= timeout
[THROWS-WHEN] IOException when !(timeout > 0) && !condition() && try-body throws
[PATH1] if(tim... | /* static context
[FOCAL] void IOTimeoutAction.execute()
[THROWS-WHEN] IOException when timeout > 0 && !condition() && try-body throws
[THROWS-WHEN] IOException when timeout > 0 && !condition() && timeSpentWaiting >= timeout
[THROWS-WHEN] IOException when !(timeout > 0) && !condition() && try-body throws
[PATH1] if(tim... | true | ok | {"focal": {"class": "IOTimeoutAction", "name": "execute", "signature": "void execute() throws IOException", "start_line": 3, "modifiers": "", "params": [], "return_type": "void"}, "class_info": {"name": "IOTimeoutAction", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members":... |
73097094_5 | class DefaultXvfbController implements XvfbController {
@Override
public Map<String, String> configureEnvironment(Map<String, String> environment) {
environment.put(ENV_DISPLAY, display);
return environment;
}
public DefaultXvfbController(ProcessMonitor<?, ?> xvfbMonitor, String displ... | XvfbController ctrl = new DefaultXvfbController(EasyMock.createMock(ProcessMonitor.class), ":123",
EasyMock.createMock(DisplayReadinessChecker.class),
EasyMock.createMock(Screenshooter.class),
EasyMock.createMock(Sleeper.class),
EasyMock.createMock... | [FOCAL] @Override public Map<String, String> DefaultXvfbController.configureEnvironment(Map<String, String> environment)
[CLASS] class DefaultXvfbController implements XvfbController
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Map<String, String>.put/2
[INPUTS] branches=- | res... | /* static context
[FOCAL] @Override public Map<String, String> DefaultXvfbController.configureEnvironment(Map<String, String> environment)
[INPUTS] branches=- | result=environment
[COLLABORATORS] param environment:Map<String, String> put/2
[CALLS-EXTERNAL] Map<String, String>.put/2
*/
| /* static context
[FOCAL] @Override public Map<String, String> DefaultXvfbController.configureEnvironment(Map<String, String> environment)
[INPUTS] branches=- | result=environment
[COLLABORATORS] param environment:Map<String, String> put/2
[CALLS-EXTERNAL] Map<String, String>.put/2
*/
class DefaultXvfbController implem... | true | ok | {"focal": {"class": "DefaultXvfbController", "name": "configureEnvironment", "signature": "Map<String, String> configureEnvironment(Map<String, String> environment)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "environment", "type": "Map<String, String>"}], "return_type": "Map<String, String>... |
73103312_7 | class Zone extends ZoneType {
@Override
public int getLowerBoundbydbmIndex(int index)
{
return _matrix[dbmIndexToMatrixIndex(index)][0];
}
public Zone(int[] timers, int[][] matrix);
public Zone(State initialState);
private Zone();
@Override public int getUpperBoundbyTransitionIndex(int timer);
@Overrid... | int expected2 = -2;
int expected3 = -3;
int expected6 = -6;
int expected7 = -7;
int actual2 = zone1.getLowerBoundbydbmIndex(1);
int actual3 = zone1.getLowerBoundbydbmIndex(2);
int actual6 = zone1.getLowerBoundbydbmIndex(3);
int actual7 = zone1.getLowerBoundbydbmIndex(4);
assertEquals(expected2, act... | [FOCAL] @Override public int Zone.getLowerBoundbydbmIndex(int index)
[CLASS] class Zone extends ZoneType
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] int dbmIndexToMatrixIndex(int i)
[INPUTS] branches=- | result=index
[DATAFLOW] index@param->L4
[CLASS-MEMBERS] Zone(int[] timers,... | /* static context
[FOCAL] @Override public int Zone.getLowerBoundbydbmIndex(int index)
[INPUTS] branches=- | result=index
[CALLS-INTERNAL] int dbmIndexToMatrixIndex(int i)
*/
| /* static context
[FOCAL] @Override public int Zone.getLowerBoundbydbmIndex(int index)
[INPUTS] branches=- | result=index
[CALLS-INTERNAL] int dbmIndexToMatrixIndex(int i)
*/
class Zone extends ZoneType {
@Override
public int getLowerBoundbydbmIndex(int index)
{
return _matrix[dbmIndexToMatrixIndex(index)][0];
}... | true | ok | {"focal": {"class": "Zone", "name": "getLowerBoundbydbmIndex", "signature": "int getLowerBoundbydbmIndex(int index)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "index", "type": "int"}], "return_type": "int"}, "class_info": {"name": "Zone", "kind": "class", "modifiers": "", "superclass": "Zon... |
73185566_1 | class EventStoreEsjcEventRepository implements EventRepository<T> {
@Override
public EventReadResult<T> read(final String streamId, final int version, final int maxEvents) {
return readInternal(toEsStreamId(streamId), version, maxEvents, false);
}
public EventStoreEsjcEventRepository(
... | when(eventStore.readStreamEventsForward(any(), anyInt(), anyInt(), anyBoolean()))
.thenReturn(wrapFuture(new StreamEventsSlice(
SliceReadStatus.StreamNotFound,
"stream",
0,
ReadDirection.Forward,
... | [FOCAL] @Override public EventReadResult<T> EventStoreEsjcEventRepository.read(String streamId, int version, int maxEvents)
[CLASS] class EventStoreEsjcEventRepository implements EventRepository<T>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] EventReadResult<T> readInternal(Stri... | /* static context
[FOCAL] @Override public EventReadResult<T> EventStoreEsjcEventRepository.read(String streamId, int version, int maxEvents)
[INPUTS] branches=- | result=maxEvents, streamId, version
[CALLS-INTERNAL] EventReadResult<T> readInternal(String internalStreamId, int version, int maxEvents, boolean resolveLin... | /* static context
[FOCAL] @Override public EventReadResult<T> EventStoreEsjcEventRepository.read(String streamId, int version, int maxEvents)
[INPUTS] branches=- | result=maxEvents, streamId, version
[CALLS-INTERNAL] EventReadResult<T> readInternal(String internalStreamId, int version, int maxEvents, boolean resolveLin... | true | ok | {"focal": {"class": "EventStoreEsjcEventRepository", "name": "read", "signature": "EventReadResult<T> read(String streamId, int version, int maxEvents)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "streamId", "type": "String"}, {"name": "version", "type": "int"}, {"name": "maxEvents", "type":... |
73209796_0 | class MainViewModel {
@NonNull
public Observable<List<Language>> getObservableSupportedLanguages() {
return mDataModel.getObservableSupportedLanguages();
}
public MainViewModel(@NonNull final IDataModel dataModel,
@NonNull final ISchedulerProvider schedulerProvider);
... | Language de = new Language("German", LanguageCode.DE);
Language en = new Language("English", LanguageCode.EN);
List<Language> languages = Arrays.asList(de, en);
Observable<List<Language>> mockObservable = Observable.just(languages);
//Observable<Language> mockObservable = Observ... | [FOCAL] @NonNull public Observable<List<Language>> MainViewModel.getObservableSupportedLanguages()
[CLASS] class MainViewModel
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] IDataModel.getObservableSupportedLanguages/0
[FIELDS] read=mDataModel:IDataModel
[INPUTS] branches=- | resu... | /* static context
[FOCAL] @NonNull public Observable<List<Language>> MainViewModel.getObservableSupportedLanguages()
[INPUTS] branches=- | result=mDataModel
[COLLABORATORS] field mDataModel:IDataModel getObservableSupportedLanguages/0
[FIELDS] read=mDataModel:IDataModel
[CALLS-EXTERNAL] IDataModel.getObservableSupporte... | /* static context
[FOCAL] @NonNull public Observable<List<Language>> MainViewModel.getObservableSupportedLanguages()
[INPUTS] branches=- | result=mDataModel
[COLLABORATORS] field mDataModel:IDataModel getObservableSupportedLanguages/0
[FIELDS] read=mDataModel:IDataModel
[CALLS-EXTERNAL] IDataModel.getObservableSupporte... | true | ok | {"focal": {"class": "MainViewModel", "name": "getObservableSupportedLanguages", "signature": "Observable<List<Language>> getObservableSupportedLanguages()", "start_line": 3, "modifiers": "@NonNull public", "params": [], "return_type": "Observable<List<Language>>"}, "class_info": {"name": "MainViewModel", "kind": "class... |
73236117_13 | class MongoHealthCheck extends HealthCheck {
@Override
protected Result check() throws Exception {
try {
Document result = db.runCommand(PING);
int ok = 0;
if (result.containsKey("ok") && result.get("ok") instanceof Number) {
ok = result.get("ok", Num... | Fongo fongo = new Fongo("fake-mongo");
MongoHealthCheck check = new MongoHealthCheck(fongo.getDatabase("fake-mongo-db"));
assertTrue(check.check().isHealthy());
}
} | [FOCAL] @Override protected Result MongoHealthCheck.check()
[CLASS] class MongoHealthCheck extends HealthCheck
[METRICS] loc=18 cc=4 branches=2 loops=0 returns=3 throws=0 nesting=2
[CALLS-EXTERNAL] db.runCommand/1, Document.containsKey/1, Document.get/1, result.get("ok", Number.class).intValue/0, Document.get/2, LOGGER... | /* static context
[FOCAL] @Override protected Result MongoHealthCheck.check()
[PATH1] if(result.containsKey("ok") && result.get("ok") instanceof Number)=T -> if(ok != 1)=T -> return Result.unhealthy("Unexpected ping response: " + result.toString())
[PATH2] if(result.containsKey("ok") && result.get("ok") instanceof Numb... | /* static context
[FOCAL] @Override protected Result MongoHealthCheck.check()
[PATH1] if(result.containsKey("ok") && result.get("ok") instanceof Number)=T -> if(ok != 1)=T -> return Result.unhealthy("Unexpected ping response: " + result.toString())
[PATH2] if(result.containsKey("ok") && result.get("ok") instanceof Numb... | true | ok | {"focal": {"class": "MongoHealthCheck", "name": "check", "signature": "Result check() throws Exception", "start_line": 3, "modifiers": "@Override protected", "params": [], "return_type": "Result"}, "class_info": {"name": "MongoHealthCheck", "kind": "class", "modifiers": "", "superclass": "HealthCheck", "interfaces": nu... |
73270880_0 | class TelegramSettingsBean extends RememberState {
public TelegramSettings toSettings() {
TelegramSettings settings = new TelegramSettings();
settings.setBotToken(botToken);
settings.setPaused(paused);
settings.setUseProxy(useProxy);
settings.setProxyServer(proxyServer);
settings.setProxyPort... | TelegramSettingsBean bean = new TelegramSettingsBean(new TelegramSettings());
bean.setBotToken("123123");
bean.setPaused(true);
bean.setUseProxy(true);
bean.setProxyServer("localhost");
bean.setProxyPort("345");
bean.setProxyUsername("user");
bean.setProxyPassword("123");
TelegramSe... | [FOCAL] public TelegramSettings TelegramSettingsBean.toSettings()
[CLASS] class TelegramSettingsBean extends RememberState
[METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] TelegramSettings.setBotToken/1, TelegramSettings.setPaused/1, TelegramSettings.setUseProxy/1, TelegramSettings... | /* static context
[FOCAL] public TelegramSettings TelegramSettingsBean.toSettings()
[NEW] TelegramSettings
[CALLS-EXTERNAL] TelegramSettings.setBotToken/1, TelegramSettings.setPaused/1, TelegramSettings.setUseProxy/1, TelegramSettings.setProxyServer/1, TelegramSettings.setProxyPort/1, StringUtil.isEmpty/1, Integer.valu... | /* static context
[FOCAL] public TelegramSettings TelegramSettingsBean.toSettings()
[NEW] TelegramSettings
[CALLS-EXTERNAL] TelegramSettings.setBotToken/1, TelegramSettings.setPaused/1, TelegramSettings.setUseProxy/1, TelegramSettings.setProxyServer/1, TelegramSettings.setProxyPort/1, StringUtil.isEmpty/1, Integer.valu... | true | ok | {"focal": {"class": "TelegramSettingsBean", "name": "toSettings", "signature": "TelegramSettings toSettings()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "TelegramSettings"}, "class_info": {"name": "TelegramSettingsBean", "kind": "class", "modifiers": "", "superclass": "RememberState", "inter... |
73282380_0 | class BeerController {
@RequestMapping(method = RequestMethod.POST,
value = "/beer",
consumes = MediaType.APPLICATION_JSON_UTF8_VALUE,
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public String gimmeABeer(@RequestBody Person person) {
ResponseEntity<Response> response = this.restTemplate.exchange(
... | // OK
assertEquals(this.controller.gimmeABeer(new Person("marcin", 25)), "THERE YOU GO");
// NOT_OK
assertEquals(this.controller.gimmeABeer(new Person("marcin", 10)), "GET LOST");
}
} | [FOCAL] @RequestMapping(method = RequestMethod.POST, value = "/beer", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produ... String BeerController.gimmeABeer(Person person)
[CLASS] class BeerController
[METRICS] loc=18 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] this.restTemplate.exchange/... | /* static context
[FOCAL] @RequestMapping(method = RequestMethod.POST, value = "/beer", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produ... String BeerController.gimmeABeer(Person person)
[PATH1] switch(response.getBody().status)=case OK -> return "THERE YOU GO"
[PATH2] switch(response.getBody().status)=default ... | /* static context
[FOCAL] @RequestMapping(method = RequestMethod.POST, value = "/beer", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produ... String BeerController.gimmeABeer(Person person)
[PATH1] switch(response.getBody().status)=case OK -> return "THERE YOU GO"
[PATH2] switch(response.getBody().status)=default ... | true | ok | {"focal": {"class": "BeerController", "name": "gimmeABeer", "signature": "String gimmeABeer(Person person)", "start_line": 3, "modifiers": "@RequestMapping(method = RequestMethod.POST, value = \"/beer\", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produ...", "params": [{"name": "person", "type": "Person"}], "retu... |
73314646_0 | class MagicalRemoteDataSource implements MagicalDataSource {
@Override
public Observable<FluxWeed> getFluxWeed() {
return Observable.just(new FluxWeed())
.delay(randomizer.randomInRange(2, 5), TimeUnit.SECONDS);
}
@Inject public MagicalRemoteDataSource(Randomizer randomizer);
... |
//TODO Create a TestObserver
TestObserver<Object> testObserver = TestObserver.create();
//TODO subscribe to getFluxWeed()
magicalDataSource.getFluxWeed().subscribe(testObserver);
//TODO tell observer to wait for terminal event
testObserver.awaitTerminalEvent();
/... | [FOCAL] @Override public Observable<FluxWeed> MagicalRemoteDataSource.getFluxWeed()
[CLASS] class MagicalRemoteDataSource implements MagicalDataSource
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Observable.just(new FluxWeed()).delay/2, Observable.just/1, Randomizer.randomInRang... | /* static context
[FOCAL] @Override public Observable<FluxWeed> MagicalRemoteDataSource.getFluxWeed()
[INPUTS] branches=- | result=randomizer
[COLLABORATORS] field randomizer:Randomizer randomInRange/2
[FIELDS] read=randomizer:Randomizer
[NEW] FluxWeed
[CALLS-EXTERNAL] Observable.just(new FluxWeed()).delay/2, Observabl... | /* static context
[FOCAL] @Override public Observable<FluxWeed> MagicalRemoteDataSource.getFluxWeed()
[INPUTS] branches=- | result=randomizer
[COLLABORATORS] field randomizer:Randomizer randomInRange/2
[FIELDS] read=randomizer:Randomizer
[NEW] FluxWeed
[CALLS-EXTERNAL] Observable.just(new FluxWeed()).delay/2, Observabl... | true | ok | {"focal": {"class": "MagicalRemoteDataSource", "name": "getFluxWeed", "signature": "Observable<FluxWeed> getFluxWeed()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Observable<FluxWeed>"}, "class_info": {"name": "MagicalRemoteDataSource", "kind": "class", "modifiers": "", "superclass... |
73380577_1 | class BarAppListener {
@RabbitListener(queues = {BarApp.XEBICON_BARAPP_LISTENER})
public void receiveOrder(Map<String, Object> msg) {
logger.debug("Receiving message [{}]", msg);
if (shopService.isShopOpen().orElse(false) && ofNullable(msg.get("type")).orElse("").equals("BUY")) {
s... | // Given
Map<String, Object> buyOrderMsg = createBuyOrderMsg(ProductType.margaux, 1L);
when(shopService.isShopOpen()).thenReturn(ofNullable(TRUE));
// When
barAppListener.receiveOrder(buyOrderMsg);
// Then
Mockito.verify(shopService, times(1)).processBuyOrder(an... | [FOCAL] @RabbitListener(queues = {BarApp.XEBICON_BARAPP_LISTENER}) public void BarAppListener.receiveOrder(Map<String, Object> msg)
[CLASS] class BarAppListener
[METRICS] loc=19 cc=5 branches=4 loops=0 returns=0 throws=0 nesting=3
[CALLS-EXTERNAL] logger.debug/2, shopService.isShopOpen().orElse/1, ShopService.isShopOpe... | /* static context
[FOCAL] @RabbitListener(queues = {BarApp.XEBICON_BARAPP_LISTENER}) public void BarAppListener.receiveOrder(Map<String, Object> msg)
[PATH1] if(shopService.isShopOpen().orElse(false) && ofNullable(msg.get("type")).orElse("").equals("BUY"))=T -> if(ofNullable(msg.get("type")).orElse("").equals("KEYNOTE_... | /* static context
[FOCAL] @RabbitListener(queues = {BarApp.XEBICON_BARAPP_LISTENER}) public void BarAppListener.receiveOrder(Map<String, Object> msg)
[PATH1] if(shopService.isShopOpen().orElse(false) && ofNullable(msg.get("type")).orElse("").equals("BUY"))=T -> if(ofNullable(msg.get("type")).orElse("").equals("KEYNOTE_... | true | ok | {"focal": {"class": "BarAppListener", "name": "receiveOrder", "signature": "void receiveOrder(Map<String, Object> msg)", "start_line": 3, "modifiers": "@RabbitListener(queues = {BarApp.XEBICON_BARAPP_LISTENER}) public", "params": [{"name": "msg", "type": "Map<String, Object>"}], "return_type": "void"}, "class_info": {"... |
73419103_13 | class RequestParser {
public static <V extends Message> void handleBody(
String fieldPath,
V.Builder builder,
String body) throws InvalidProtocolBufferException {
// * maps all body fields to the top-level proto
// IDENT maps all body fields to nested proto
... | NestedType nestedType = NestedType.newBuilder().setF1("abc").build();
TestRequest expected = TestRequest.newBuilder().setNt(nestedType).build();
// Output nested json only
String json = JsonFormat.printer().print(nestedType);
TestRequest.Builder deserialized = TestRequest.newBu... | [FOCAL] public static void RequestParser.handleBody(String fieldPath, V.Builder builder, String body)
[CLASS] class RequestParser
[METRICS] loc=31 cc=6 branches=4 loops=1 returns=1 throws=0 nesting=3
[CALLS-EXTERNAL] "*".equals/1, ProtobufDescriptorJavaUtil.fieldPath/2, V.Builder.getDescriptorForType/0, ImmutableList<D... | /* static context
[FOCAL] public static void RequestParser.handleBody(String fieldPath, V.Builder builder, String body)
[PATH1] if("*".equals(fieldPath))=F -> if(fieldDescriptors.isEmpty())=F -> foreach(Descriptors.FieldDescriptor fd : fieldDescriptors)=T -> if(fd.getType() == Descriptors.FieldDescriptor.Type.MESSAGE)=... | /* static context
[FOCAL] public static void RequestParser.handleBody(String fieldPath, V.Builder builder, String body)
[PATH1] if("*".equals(fieldPath))=F -> if(fieldDescriptors.isEmpty())=F -> foreach(Descriptors.FieldDescriptor fd : fieldDescriptors)=T -> if(fd.getType() == Descriptors.FieldDescriptor.Type.MESSAGE)=... | true | ok | {"focal": {"class": "RequestParser", "name": "handleBody", "signature": "void handleBody(String fieldPath, V.Builder builder, String body) throws InvalidProtocolBufferException", "start_line": 3, "modifiers": "public static", "params": [{"name": "fieldPath", "type": "String"}, {"name": "builder", "type": "V.Builder"}, ... |
73420810_10 | class ProblemReportDB {
public static List<ProblemReport> getFavoriteProblemReports() {
// Simulate a long running process.
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
return database.subList(0, database.size() ... | List<ProblemReport> reports = getFavoriteProblemReports();
assertNotNull(reports);
assertFalse(reports.isEmpty());
assertEquals(2, reports.size());
}
} | [FOCAL] public static List<ProblemReport> ProblemReportDB.getFavoriteProblemReports()
[CLASS] class ProblemReportDB
[METRICS] loc=9 cc=2 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] Thread.sleep/1, InterruptedException.printStackTrace/0, database.subList/2, database.size/0
[EXCEPTIONS] catches Inter... | /* static context
[FOCAL] public static List<ProblemReport> ProblemReportDB.getFavoriteProblemReports()
[PATH1] try-body throws -> return database.subList(0, database.size() / 2)
[COLLABORATORS] field database subList/2,size/0
[EXCEPTIONS] catches InterruptedException e
[CALLS-EXTERNAL] Thread.sleep/1, InterruptedExcep... | /* static context
[FOCAL] public static List<ProblemReport> ProblemReportDB.getFavoriteProblemReports()
[PATH1] try-body throws -> return database.subList(0, database.size() / 2)
[COLLABORATORS] field database subList/2,size/0
[EXCEPTIONS] catches InterruptedException e
[CALLS-EXTERNAL] Thread.sleep/1, InterruptedExcep... | true | ok | {"focal": {"class": "ProblemReportDB", "name": "getFavoriteProblemReports", "signature": "List<ProblemReport> getFavoriteProblemReports()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "List<ProblemReport>"}, "class_info": {"name": "ProblemReportDB", "kind": "class", "modifiers": "", "sup... |
73430564_1 | class NomadJson {
public static Job readJobSpec(String jobSpec) throws IOException {
return OBJECT_MAPPER.readValue(jobSpec, JobSpec.class).job;
}
public static String asJobSpec(Job job);
public static String serialize(Object value);
public static T deserialize(String json, Class<T> clazz)... | String jobSpec = IOUtils.toString(getClass().getResourceAsStream("job.json"), UTF_8);
final Job job = NomadJson.readJobSpec(jobSpec);
assertThat(job.getId(), is("Job-ID"));
assertThat(job.getUnmappedProperties().get("Unknown Job String"), is((Object) "Hi"));
final HashMap<Strin... | [FOCAL] public static Job NomadJson.readJobSpec(String jobSpec)
[CLASS] class NomadJson
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] OBJECT_MAPPER.readValue/2
[EXCEPTIONS] declares IOException
[INPUTS] branches=- | result=jobSpec
[DATAFLOW] jobSpec@param->L2
[CLASS-MEMBERS] Stri... | /* static context
[FOCAL] public static Job NomadJson.readJobSpec(String jobSpec)
[INPUTS] branches=- | result=jobSpec
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] OBJECT_MAPPER.readValue/2
*/
| /* static context
[FOCAL] public static Job NomadJson.readJobSpec(String jobSpec)
[INPUTS] branches=- | result=jobSpec
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] OBJECT_MAPPER.readValue/2
*/
class NomadJson {
public static Job readJobSpec(String jobSpec) throws IOException {
return OBJECT_MAPPER.re... | true | ok | {"focal": {"class": "NomadJson", "name": "readJobSpec", "signature": "Job readJobSpec(String jobSpec) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "jobSpec", "type": "String"}], "return_type": "Job"}, "class_info": {"name": "NomadJson", "kind": "class", "modifiers": "", "super... |
73473909_3 | class SphericalView extends RelativeLayout {
public float getDefaultRotationSensibility() {
return defaultRotationSensibility;
}
public SphericalView(Context context);
public SphericalView(Context context, AttributeSet attrs);
public SphericalView(Context context, AttributeSet attrs, in... | AttributeSet attributeSet = Robolectric.buildAttributeSet().addAttribute(R.attr.rotationSensibility, "0.1").build();
SphericalView subject = new SphericalView(RuntimeEnvironment.application, attributeSet);
assertThat(subject.getDefaultRotationSensibility()).isEqualTo(0.1f);
}
} | [FOCAL] public float SphericalView.getDefaultRotationSensibility()
[CLASS] class SphericalView extends RelativeLayout
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] SphericalView(Context context); SphericalView(Context context, AttributeSet attrs); SphericalView(Context context, At... | /* static context
[FOCAL] public float SphericalView.getDefaultRotationSensibility()
*/
| /* static context
[FOCAL] public float SphericalView.getDefaultRotationSensibility()
*/
class SphericalView extends RelativeLayout {
public float getDefaultRotationSensibility() {
return defaultRotationSensibility;
}
public SphericalView(Context context);
public SphericalView(Context context... | true | ok | {"focal": {"class": "SphericalView", "name": "getDefaultRotationSensibility", "signature": "float getDefaultRotationSensibility()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "float"}, "class_info": {"name": "SphericalView", "kind": "class", "modifiers": "", "superclass": "RelativeLayout", "in... |
73478000_13 | class ExportFilterManager {
public static ExportFilter instantiateExportFilterByExtension(
Class<?> forClass, String identifier) throws Exception {
for (Class c = forClass; c != null; c = c.getSuperclass())
if (EXPORT_FILTER_EXTENSIONS.containsKey(c)) {
HashMap<Strin... | PluginManager.registerClass(TrivialGraphFormatExport.class);
ByteArrayOutputStream result = new ByteArrayOutputStream();
OutputStreamWriter out = new OutputStreamWriter(result);
ExportFilterManager.instantiateExportFilterByExtension(Structure.class, "tgf")
.exportGraph(... | [FOCAL] public static ExportFilter ExportFilterManager.instantiateExportFilterByExtension(Class<?> forClass, String identifier)
[CLASS] class ExportFilterManager
[METRICS] loc=10 cc=4 branches=2 loops=1 returns=2 throws=0 nesting=3
[CALLS-EXTERNAL] Class.getSuperclass/0, EXPORT_FILTER_EXTENSIONS.containsKey/1, EXPORT_F... | /* static context
[FOCAL] public static ExportFilter ExportFilterManager.instantiateExportFilterByExtension(Class<?> forClass, String identifier)
[PATH1] for(c != null)=T -> if(EXPORT_FILTER_EXTENSIONS.containsKey(c))=T -> if(filters.containsKey(identifier))=F -> exit loop -> return null
[PATH2] for(c != null)=T -> if(... | /* static context
[FOCAL] public static ExportFilter ExportFilterManager.instantiateExportFilterByExtension(Class<?> forClass, String identifier)
[PATH1] for(c != null)=T -> if(EXPORT_FILTER_EXTENSIONS.containsKey(c))=T -> if(filters.containsKey(identifier))=F -> exit loop -> return null
[PATH2] for(c != null)=T -> if(... | true | ok | {"focal": {"class": "ExportFilterManager", "name": "instantiateExportFilterByExtension", "signature": "ExportFilter instantiateExportFilterByExtension(Class<?> forClass, String identifier) throws Exception", "start_line": 3, "modifiers": "public static", "params": [{"name": "forClass", "type": "Class<?>"}, {"name": "id... |
73620856_36 | class RxFirebaseRemote {
@NonNull
public static Completable fetch(@NonNull final FirebaseRemoteConfig config,
@NonNull final long cacheLifeTime) {
return Completable.create(new CompletableOnSubscribe() {
@Override
public void subscribe(Complet... | TestObserver fetchTestObserver = RxFirebaseRemote
.fetch(firebaseConfig, ANY_TIME)
.test();
testOnFailureListener.getValue().onFailure(EXCEPTION);
verify(firebaseConfig).fetch(eq(ANY_TIME));
fetchTestObserver.assertError(EXCEPTION)
.assertNotComplet... | [FOCAL] @NonNull public static Completable RxFirebaseRemote.fetch(FirebaseRemoteConfig config, long cacheLifeTime)
[CLASS] class RxFirebaseRemote
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Completable.create/1, RxCompletableHandler.assignOnTask/2, FirebaseRemoteConfig.fetch/1... | /* static context
[FOCAL] @NonNull public static Completable RxFirebaseRemote.fetch(FirebaseRemoteConfig config, long cacheLifeTime)
[INPUTS] branches=- | result=cacheLifeTime, config
[COLLABORATORS] param config:FirebaseRemoteConfig fetch/1
[NEW] CompletableOnSubscribe
[CALLS-EXTERNAL] Completable.create/1, RxCompleta... | /* static context
[FOCAL] @NonNull public static Completable RxFirebaseRemote.fetch(FirebaseRemoteConfig config, long cacheLifeTime)
[INPUTS] branches=- | result=cacheLifeTime, config
[COLLABORATORS] param config:FirebaseRemoteConfig fetch/1
[NEW] CompletableOnSubscribe
[CALLS-EXTERNAL] Completable.create/1, RxCompleta... | true | ok | {"focal": {"class": "RxFirebaseRemote", "name": "fetch", "signature": "Completable fetch(FirebaseRemoteConfig config, long cacheLifeTime)", "start_line": 3, "modifiers": "@NonNull public static", "params": [{"name": "config", "type": "FirebaseRemoteConfig"}, {"name": "cacheLifeTime", "type": "long"}], "return_type": "C... |
73690083_19 | class ClusterManagerImpl implements ClusterManager {
public long getNumberOfNodes() throws DockerException, InterruptedException {
return streamReadyNodes().count();
}
public ClusterManagerImpl();
public Info getClusterInfo();
private Stream<Node> streamReadyNodes();
public long getN... | long numberOfNodes = clusterManager.getNumberOfNodes("org.hobbit.workergroup=system");
assertEquals(0, numberOfNodes);
}
} | [FOCAL] public long ClusterManagerImpl.getNumberOfNodes()
[CLASS] class ClusterManagerImpl implements ClusterManager
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Stream<Node> streamReadyNodes()
[CALLS-EXTERNAL] streamReadyNodes().count/0
[EXCEPTIONS] declares DockerException, In... | /* static context
[FOCAL] public long ClusterManagerImpl.getNumberOfNodes()
[EXCEPTIONS] declares DockerException, InterruptedException
[CALLS-INTERNAL] Stream<Node> streamReadyNodes()
[CALLS-EXTERNAL] streamReadyNodes().count/0
*/
| /* static context
[FOCAL] public long ClusterManagerImpl.getNumberOfNodes()
[EXCEPTIONS] declares DockerException, InterruptedException
[CALLS-INTERNAL] Stream<Node> streamReadyNodes()
[CALLS-EXTERNAL] streamReadyNodes().count/0
*/
class ClusterManagerImpl implements ClusterManager {
public long getNumberOfNodes()... | true | ok | {"focal": {"class": "ClusterManagerImpl", "name": "getNumberOfNodes", "signature": "long getNumberOfNodes() throws DockerException, InterruptedException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "long"}, "class_info": {"name": "ClusterManagerImpl", "kind": "class", "modifiers": "", "supercl... |
73711911_46 | class Tiling2048 implements Serializable {
public int addressSpecial(State2048 state) {
int[] values = state.getValues();
int address = 0;
for (int i = 0; i < numSegments; ++i) {
address *= 2;
address += state.hasValue(values, maxSegment - i) ? 1 : 0;
}
if (address > 0)
address -= 1;
for (int i =... | Tiling2048 tiling2048 = Tiling2048.createWithRandomWeights(3, 15, new int[] { 7, 8, 9, 10, 15, 16 }, 16,
0, 0, new RandomDataGenerator(new MersenneTwister(123)));
Assert.assertEquals(0, tiling2048.addressSpecial(new State2048(
new double[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 })));
Assert.as... | [FOCAL] public int Tiling2048.addressSpecial(State2048 state)
[CLASS] class Tiling2048 implements Serializable
[METRICS] loc=15 cc=4 branches=1 loops=2 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] State2048.getValues/0, State2048.hasValue/2, State2048.getValue/1
[PATH1] for(i < numSegments)=T -> exit loop -> if(addres... | /* static context
[FOCAL] public int Tiling2048.addressSpecial(State2048 state)
[PATH1] for(i < numSegments)=T -> exit loop -> if(address > 0)=T -> for(i < straightLocations.length)=F -> return address
[PATH2] for(i < numSegments)=F -> if(address > 0)=F -> for(i < straightLocations.length)=T -> exit loop -> return addr... | /* static context
[FOCAL] public int Tiling2048.addressSpecial(State2048 state)
[PATH1] for(i < numSegments)=T -> exit loop -> if(address > 0)=T -> for(i < straightLocations.length)=F -> return address
[PATH2] for(i < numSegments)=F -> if(address > 0)=F -> for(i < straightLocations.length)=T -> exit loop -> return addr... | true | ok | {"focal": {"class": "Tiling2048", "name": "addressSpecial", "signature": "int addressSpecial(State2048 state)", "start_line": 3, "modifiers": "public", "params": [{"name": "state", "type": "State2048"}], "return_type": "int"}, "class_info": {"name": "Tiling2048", "kind": "class", "modifiers": "", "superclass": null, "i... |
73733927_1 | class JPASessionUtil {
@SuppressWarnings("WeakerAccess")
public static synchronized EntityManager getEntityManager(String persistenceUnitName) {
persistenceUnits.putIfAbsent(persistenceUnitName,
Persistence.createEntityManagerFactory(persistenceUnitName));
return persistenceUnit... | public void nonexistentEntityManagerName() {
JPASessionUtil.getEntityManager("nonexistent");
fail("We shouldn't be able to acquire an EntityManager here");
}
} | [FOCAL] @SuppressWarnings("WeakerAccess") public static synchronized EntityManager JPASessionUtil.getEntityManager(String persistenceUnitName)
[CLASS] class JPASessionUtil
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] persistenceUnits.putIfAbsent/2, Persistence.createEntityManage... | /* static context
[FOCAL] @SuppressWarnings("WeakerAccess") public static synchronized EntityManager JPASessionUtil.getEntityManager(String persistenceUnitName)
[INPUTS] branches=- | result=persistenceUnitName
[COLLABORATORS] field persistenceUnits putIfAbsent/2,get/1
[CALLS-EXTERNAL] persistenceUnits.putIfAbsent/2, Pe... | /* static context
[FOCAL] @SuppressWarnings("WeakerAccess") public static synchronized EntityManager JPASessionUtil.getEntityManager(String persistenceUnitName)
[INPUTS] branches=- | result=persistenceUnitName
[COLLABORATORS] field persistenceUnits putIfAbsent/2,get/1
[CALLS-EXTERNAL] persistenceUnits.putIfAbsent/2, Pe... | true | ok | {"focal": {"class": "JPASessionUtil", "name": "getEntityManager", "signature": "EntityManager getEntityManager(String persistenceUnitName)", "start_line": 3, "modifiers": "@SuppressWarnings(\"WeakerAccess\") public static synchronized", "params": [{"name": "persistenceUnitName", "type": "String"}], "return_type": "Enti... |
73840074_1 | class AuditAggregator {
public boolean addRecord(String sourceTopic, int partition, long offset, JSONObject record) {
// dot . is reserved delimiter for graphite naming
String topicName = record.getString(AuditMsgField.TOPICNAME.getName());
String hostName = record.getString(AuditMsgField.HOSTNAME.getNam... | long timeBucketIntervalInSec = 60;
int reportFreqMsgCount = 10;
short reportFreqIntervalSec = 2;
AuditAggregator agg = new AuditAggregator(timeBucketIntervalInSec, reportFreqMsgCount, reportFreqIntervalSec);
int partition = 0;
long offset = 1024;
long nowInMs = System.currentTimeMillis();
... | [FOCAL] public boolean AuditAggregator.addRecord(String sourceTopic, int partition, long offset, JSONObject record)
[CLASS] class AuditAggregator
[METRICS] loc=72 cc=8 branches=7 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] void updateOffset(String sourceTopic, int partition, long offset)
[CALLS-EXTERNAL] JSON... | /* static context
[FOCAL] public boolean AuditAggregator.addRecord(String sourceTopic, int partition, long offset, JSONObject record)
[PATH1] if(combineMetricsAmongHosts)=T -> if(timestampInSec > MIN_TIMESTAMP_MS)=T -> if(timestampInSec <= 0 || timestampInSec >= (timestampSkewSec + System.currentTimeMillis() / 1000.0))... | /* static context
[FOCAL] public boolean AuditAggregator.addRecord(String sourceTopic, int partition, long offset, JSONObject record)
[PATH1] if(combineMetricsAmongHosts)=T -> if(timestampInSec > MIN_TIMESTAMP_MS)=T -> if(timestampInSec <= 0 || timestampInSec >= (timestampSkewSec + System.currentTimeMillis() / 1000.0))... | true | ok | {"focal": {"class": "AuditAggregator", "name": "addRecord", "signature": "boolean addRecord(String sourceTopic, int partition, long offset, JSONObject record)", "start_line": 3, "modifiers": "public", "params": [{"name": "sourceTopic", "type": "String"}, {"name": "partition", "type": "int"}, {"name": "offset", "type": ... |
73899453_155 | class JavaBeanSerializeUtil {
public static JavaBeanDescriptor serialize(Object obj) {
return serialize(obj, JavaBeanAccessor.FIELD);
}
private JavaBeanSerializeUtil();
public static JavaBeanDescriptor serialize(Object obj, JavaBeanAccessor accessor);
private static JavaBeanDescriptor cr... | JavaBeanDescriptor descriptor = new JavaBeanDescriptor();
JavaBeanDescriptor result = JavaBeanSerializeUtil.serialize(descriptor);
Assert.assertTrue(descriptor == result);
Map map = new HashMap();
map.put("first", descriptor);
result = JavaBeanSerializeUtil.serialize(map... | [FOCAL] public static JavaBeanDescriptor JavaBeanSerializeUtil.serialize(Object obj)
[CLASS] class JavaBeanSerializeUtil
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] JavaBeanDescriptor serialize(Object obj, JavaBeanAccessor accessor)
[INPUTS] branches=- | result=obj
[DATAFLOW] o... | /* static context
[FOCAL] public static JavaBeanDescriptor JavaBeanSerializeUtil.serialize(Object obj)
[INPUTS] branches=- | result=obj
[CALLS-INTERNAL] JavaBeanDescriptor serialize(Object obj, JavaBeanAccessor accessor)
*/
| /* static context
[FOCAL] public static JavaBeanDescriptor JavaBeanSerializeUtil.serialize(Object obj)
[INPUTS] branches=- | result=obj
[CALLS-INTERNAL] JavaBeanDescriptor serialize(Object obj, JavaBeanAccessor accessor)
*/
class JavaBeanSerializeUtil {
public static JavaBeanDescriptor serialize(Object obj) {
... | true | ok | {"focal": {"class": "JavaBeanSerializeUtil", "name": "serialize", "signature": "JavaBeanDescriptor serialize(Object obj)", "start_line": 3, "modifiers": "public static", "params": [{"name": "obj", "type": "Object"}], "return_type": "JavaBeanDescriptor"}, "class_info": {"name": "JavaBeanSerializeUtil", "kind": "class", ... |
73930305_59 | class WorkspacePackageRepository extends GeneralFSPackageRepository {
protected PackageSource lookupPackageSource(PackageID pkgID) {
Path path = this.generatePath(pkgID);
return new WorkspacePackageSource(pkgID, path);
}
public WorkspacePackageRepository(String programDirRoot, WorkspaceDo... | Path filePath = RES_DIR.resolve("source").resolve("multipackages").resolve("sample").resolve("main.bal");
Pair pair = compileAndGetWorkspacePackageRepo(filePath);
Names names = pair.getNames();
WorkspacePackageRepository workspacePackageRepository = pair.getWorkspacePackageRepository();
... | [FOCAL] protected PackageSource WorkspacePackageRepository.lookupPackageSource(PackageID pkgID)
[CLASS] class WorkspacePackageRepository extends GeneralFSPackageRepository
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] this.generatePath/1
[NEW] WorkspacePackageSource
[INPUTS] bran... | /* static context
[FOCAL] protected PackageSource WorkspacePackageRepository.lookupPackageSource(PackageID pkgID)
[INPUTS] branches=- | result=pkgID
[NEW] WorkspacePackageSource
[CALLS-EXTERNAL] this.generatePath/1
*/
| /* static context
[FOCAL] protected PackageSource WorkspacePackageRepository.lookupPackageSource(PackageID pkgID)
[INPUTS] branches=- | result=pkgID
[NEW] WorkspacePackageSource
[CALLS-EXTERNAL] this.generatePath/1
*/
class WorkspacePackageRepository extends GeneralFSPackageRepository {
protected PackageSource loo... | true | ok | {"focal": {"class": "WorkspacePackageRepository", "name": "lookupPackageSource", "signature": "PackageSource lookupPackageSource(PackageID pkgID)", "start_line": 3, "modifiers": "protected", "params": [{"name": "pkgID", "type": "PackageID"}], "return_type": "PackageSource"}, "class_info": {"name": "WorkspacePackageRepo... |
73963835_3 | class XForwardedRemoteAddressResolver implements RemoteAddressResolver {
@Override
public InetSocketAddress resolve(ServerWebExchange exchange) {
List<String> xForwardedValues = extractXForwardedValues(exchange);
Collections.reverse(xForwardedValues);
if (!xForwardedValues.isEmpty()) {
int index = Math.min(... | ServerWebExchange exchange = buildExchange(oneTwoThreeBuilder());
InetSocketAddress address = trustOne.resolve(exchange);
assertThat(address.getHostName()).isEqualTo("0.0.0.3");
}
} | [FOCAL] @Override public InetSocketAddress XForwardedRemoteAddressResolver.resolve(ServerWebExchange exchange)
[CLASS] class XForwardedRemoteAddressResolver implements RemoteAddressResolver
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] List<String> extractXForwardedValues(Server... | /* static context
[FOCAL] @Override public InetSocketAddress XForwardedRemoteAddressResolver.resolve(ServerWebExchange exchange)
[PATH1] if(!xForwardedValues.isEmpty())=T -> return new InetSocketAddress(xForwardedValues.get(index), 0)
[PATH2] if(!xForwardedValues.isEmpty())=F -> return defaultRemoteIpResolver.resolve(e... | /* static context
[FOCAL] @Override public InetSocketAddress XForwardedRemoteAddressResolver.resolve(ServerWebExchange exchange)
[PATH1] if(!xForwardedValues.isEmpty())=T -> return new InetSocketAddress(xForwardedValues.get(index), 0)
[PATH2] if(!xForwardedValues.isEmpty())=F -> return defaultRemoteIpResolver.resolve(e... | true | ok | {"focal": {"class": "XForwardedRemoteAddressResolver", "name": "resolve", "signature": "InetSocketAddress resolve(ServerWebExchange exchange)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "exchange", "type": "ServerWebExchange"}], "return_type": "InetSocketAddress"}, "class_info": {"name": "XF... |
74145628_185 | class AVLTreeNode {
public int height() {
// TODO...
return -3;
}
public AVLTreeNode(int key);
public boolean validAVL();
public boolean find(int key);
public AVLTreeNode insert(int key);
public void dot(StringBuilder sb);
private int dotNode(StringBuilder sb, int idx... | Random r = new Random();
int h1 = r.nextInt(Integer.MAX_VALUE);
int h2 = r.nextInt(Integer.MAX_VALUE);
setField(node().withHeight(h1), "right");
setField(node().withHeight(h2), "left");
Assert.assertEquals(Math.max(h1, h2) + 1, test.height());
}
} | [FOCAL] public int AVLTreeNode.height()
[CLASS] class AVLTreeNode
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] AVLTreeNode(int key); boolean validAVL(); boolean find(int key); AVLTreeNode insert(int key); void dot(StringBuilder sb); int dotNode(StringBuilder sb, int idx); int dot... | /* static context
[FOCAL] public int AVLTreeNode.height()
*/
| /* static context
[FOCAL] public int AVLTreeNode.height()
*/
class AVLTreeNode {
public int height() {
// TODO...
return -3;
}
public AVLTreeNode(int key);
public boolean validAVL();
public boolean find(int key);
public AVLTreeNode insert(int key);
public void dot(StringB... | true | ok | {"focal": {"class": "AVLTreeNode", "name": "height", "signature": "int height()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "AVLTreeNode", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "test", "type": "AVLTreeNode"... |
74149803_1 | class SchemaBuilder3 extends JFrame {
public void createSchema(){
pcName = schemaNameField.getText();
if(pcName == null || pcName.length() == 0){
JOptionPane.showMessageDialog(null, "Please fill out Schema Name Field");
return;
}
String descr = descrField.ge... | createSchema();
createTables(1);
assertErrorOnSubmit();
}
} | [FOCAL] public void SchemaBuilder3.createSchema()
[CLASS] class SchemaBuilder3 extends JFrame
[METRICS] loc=49 cc=6 branches=5 loops=0 returns=3 throws=0 nesting=1
[CALLS-INTERNAL] String getSchemaType(String type); void enableBuilder(); void resetAll(); void resetSchemaView(String baseType)
[CALLS-EXTERNAL] schemaName... | /* static context
[FOCAL] public void SchemaBuilder3.createSchema()
[PATH1] if(pcName == null || pcName.length() == 0)=F -> if(descr == null || descr.length() == 0)=T -> if(other == null || other.length() == 0)=T -> if(prop == null || prop.length() == 0)=F -> if(!bRes)=T -> return
[PATH2] if(pcName == null || pcName.le... | /* static context
[FOCAL] public void SchemaBuilder3.createSchema()
[PATH1] if(pcName == null || pcName.length() == 0)=F -> if(descr == null || descr.length() == 0)=T -> if(other == null || other.length() == 0)=T -> if(prop == null || prop.length() == 0)=F -> if(!bRes)=T -> return
[PATH2] if(pcName == null || pcName.le... | true | ok | {"focal": {"class": "SchemaBuilder3", "name": "createSchema", "signature": "void createSchema()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "SchemaBuilder3", "kind": "class", "modifiers": "", "superclass": "JFrame", "interfaces": null, "fields": [{"name": "name... |
74164375_9 | class ModuleDetailPresenter implements Presenter {
@Override
public void loadModule() {
if (null == mModule) {
mModuleDetailView.showMissingModule();
} else {
mModuleDetailView.showModule(mModule);
}
}
public ModuleDetailPresenter(@Nullable Module modul... | mModuleDetailPresenter = new ModuleDetailPresenter(null, mModuleDetailView);
mModuleDetailPresenter.loadModule();
verify(mModuleDetailView).showMissingModule();
}
} | [FOCAL] @Override public void ModuleDetailPresenter.loadModule()
[CLASS] class ModuleDetailPresenter implements Presenter
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] ModuleDetailContract.View.showMissingModule/0, ModuleDetailContract.View.showModule/1
[FIELDS] read=mModuleDetai... | /* static context
[FOCAL] @Override public void ModuleDetailPresenter.loadModule()
[PATH1] if(null == mModule)=T
[PATH2] if(null == mModule)=F
[COLLABORATORS] field mModuleDetailView:ModuleDetailContract.View showMissingModule/0,showModule/1
[FIELDS] read=mModuleDetailView:ModuleDetailContract.View
[CALLS-EXTERNAL] Mod... | /* static context
[FOCAL] @Override public void ModuleDetailPresenter.loadModule()
[PATH1] if(null == mModule)=T
[PATH2] if(null == mModule)=F
[COLLABORATORS] field mModuleDetailView:ModuleDetailContract.View showMissingModule/0,showModule/1
[FIELDS] read=mModuleDetailView:ModuleDetailContract.View
[CALLS-EXTERNAL] Mod... | true | ok | {"focal": {"class": "ModuleDetailPresenter", "name": "loadModule", "signature": "void loadModule()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "ModuleDetailPresenter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Presenter", "f... |
74169930_2 | class ArticlesServer implements ArticlesDataSource {
@Override
public Single<ArticleResource> requestArticle(@NonNull final String id) {
final Retrofit retrofit = new Retrofit.Builder()
.baseUrl(mBaseUrl)
.addConverterFactory(HALConverterFactory.create(ArticleResource.cl... | // Given there is a web server with some prepared responses
final String articleId = "bnl-vkn-20161117-7352758";
final HttpUrl baseUrl = prepareAndStartServerToReturnJsonFromFile(mServer,
"article(ws.blendle.com_item_" + articleId + ").json");
// When I make a request
... | [FOCAL] @Override public Single<ArticleResource> ArticlesServer.requestArticle(String id)
[CLASS] class ArticlesServer implements ArticlesDataSource
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] new Retrofit.Builder() .baseUrl(mBaseUrl) .addConverterFa....build/0, new Retrofit.B... | /* static context
[FOCAL] @Override public Single<ArticleResource> ArticlesServer.requestArticle(String id)
[INPUTS] branches=- | result=id
[NEW] Retrofit.Builder
[CALLS-EXTERNAL] new Retrofit.Builder() .baseUrl(mBaseUrl) .addConverterFa....build/0, new Retrofit.Builder() .baseUrl(mBaseUrl) .addConverterFa....addCallAd... | /* static context
[FOCAL] @Override public Single<ArticleResource> ArticlesServer.requestArticle(String id)
[INPUTS] branches=- | result=id
[NEW] Retrofit.Builder
[CALLS-EXTERNAL] new Retrofit.Builder() .baseUrl(mBaseUrl) .addConverterFa....build/0, new Retrofit.Builder() .baseUrl(mBaseUrl) .addConverterFa....addCallAd... | true | ok | {"focal": {"class": "ArticlesServer", "name": "requestArticle", "signature": "Single<ArticleResource> requestArticle(String id)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "id", "type": "String"}], "return_type": "Single<ArticleResource>"}, "class_info": {"name": "ArticlesServer", "kind": "c... |
74169960_32 | class ClusterSummary {
public List<Task> tasksForInstance(ContainerInstance instance) {
String arn = instance.getArn();
if (instancesByInstanceArn.containsKey(arn)) {
return tasksByInstanceArn.getOrDefault(arn, Collections.emptyList());
} else {
throw new IndexOutOfBoundsException(
... | ClusterSummary summary = new ClusterSummary(snapshot);
assertThatThrownBy(() -> summary.tasksForInstance(instance("i-1"))).hasMessageContaining("i-1");
}
} | [FOCAL] public List<Task> ClusterSummary.tasksForInstance(ContainerInstance instance)
[CLASS] class ClusterSummary
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] ContainerInstance.getArn/0, instancesByInstanceArn.containsKey/1, tasksByInstanceArn.getOrDefault/2, Collections.empty... | /* static context
[FOCAL] public List<Task> ClusterSummary.tasksForInstance(ContainerInstance instance)
[THROWS-WHEN] IndexOutOfBoundsException when !instancesByInstanceArn.containsKey(arn)
[PATH1] if(instancesByInstanceArn.containsKey(arn))=T -> return tasksByInstanceArn.getOrDefault(arn, Collections.emptyList())
[PAT... | /* static context
[FOCAL] public List<Task> ClusterSummary.tasksForInstance(ContainerInstance instance)
[THROWS-WHEN] IndexOutOfBoundsException when !instancesByInstanceArn.containsKey(arn)
[PATH1] if(instancesByInstanceArn.containsKey(arn))=T -> return tasksByInstanceArn.getOrDefault(arn, Collections.emptyList())
[PAT... | true | ok | {"focal": {"class": "ClusterSummary", "name": "tasksForInstance", "signature": "List<Task> tasksForInstance(ContainerInstance instance)", "start_line": 3, "modifiers": "public", "params": [{"name": "instance", "type": "ContainerInstance"}], "return_type": "List<Task>"}, "class_info": {"name": "ClusterSummary", "kind": ... |
74189838_2 | class ApiGenMojo extends AbstractMojo {
@Override
public void execute() {
try {
sourceDirectory = makeAbsolute(sourceDirectory);
outputDirectory = makeAbsolute(outputDirectory);
if ( ! sourceDirectory.exists() ) return;
getLog().debug("Running ApiGen\n\ts... | File basedir = resources.getBasedir("posts");
MavenExecutionResult result = mavenRuntime
.forProject(basedir)
.execute("clean", "test");
result.assertErrorFreeLog();
}
} | [FOCAL] @Override public void ApiGenMojo.execute()
[CLASS] class ApiGenMojo extends AbstractMojo
[METRICS] loc=35 cc=5 branches=2 loops=1 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] ClassLoader getCompileClassLoader(); File makeAbsolute(File in); void findGraphql(File rootDir, VisitPath visitPath)
[CALLS-EXTERNAL] so... | /* static context
[FOCAL] @Override public void ApiGenMojo.execute()
[PATH1] if(! sourceDirectory.exists())=F -> foreach(org.springframework.core.io.Resource resource : resolver.getResources("classpath*:graphql-apigen-schema/*.graphql{,s}"))=T -> exit loop
[PATH2] try-body throws -> if(null == msg)=T
[PATH3] if(! sourc... | /* static context
[FOCAL] @Override public void ApiGenMojo.execute()
[PATH1] if(! sourceDirectory.exists())=F -> foreach(org.springframework.core.io.Resource resource : resolver.getResources("classpath*:graphql-apigen-schema/*.graphql{,s}"))=T -> exit loop
[PATH2] try-body throws -> if(null == msg)=T
[PATH3] if(! sourc... | true | ok | {"focal": {"class": "ApiGenMojo", "name": "execute", "signature": "void execute()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "ApiGenMojo", "kind": "class", "modifiers": "", "superclass": "AbstractMojo", "interfaces": null, "fields": [{"name": "resour... |
74192763_1 | class RequestListener implements com.bumptech.glide.request.RequestListener {
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target target, boolean isFirstResource) {
WebImageView view = null;
if (target instanceof WebImageViewTarget) {
view = ((WebI... | verify(mEventEmitter, never()).receiveEvent(anyInt(), anyString(), any(WritableMap.class));
WebImageViewTarget target = new WebImageViewTarget(mImageView);
mViewManager.mRequestListener.onLoadFailed(new GlideException("some error"), null, target, true);
WritableMap expectedEvent = new... | [FOCAL] @Override public boolean RequestListener.onLoadFailed(GlideException e, Object model, Target target, boolean isFirstResource)
[CLASS] class RequestListener implements com.bumptech.glide.request.RequestListener
[METRICS] loc=24 cc=6 branches=5 loops=0 returns=1 throws=0 nesting=3
[CALLS-INTERNAL] WritableMap cre... | /* static context
[FOCAL] @Override public boolean RequestListener.onLoadFailed(GlideException e, Object model, Target target, boolean isFirstResource)
[PATH1] if(target instanceof WebImageViewTarget)=T -> if(view != null)=T -> if(context != null)=T -> if(e != null)=T -> if(uri != null)=T -> return false
[PATH2] if(tar... | /* static context
[FOCAL] @Override public boolean RequestListener.onLoadFailed(GlideException e, Object model, Target target, boolean isFirstResource)
[PATH1] if(target instanceof WebImageViewTarget)=T -> if(view != null)=T -> if(context != null)=T -> if(e != null)=T -> if(uri != null)=T -> return false
[PATH2] if(tar... | true | ok | {"focal": {"class": "RequestListener", "name": "onLoadFailed", "signature": "boolean onLoadFailed(GlideException e, Object model, Target target, boolean isFirstResource)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "e", "type": "GlideException"}, {"name": "model", "type": "Object"}, {"name": ... |
74278300_0 | class DrDecryption {
public static String decrypt(String input) {
if (input == null) {
return null;
}
try {
return doDecrypt(input);
} catch (GeneralSecurityException | RuntimeException ex) {
Timber.e(ex, "Unable to decrypt: %s", input);
return null;
}
}
private sta... |
assertEquals(
"https://drtesty-lh.akamaihd.net/i/drtestytext_0@668184/master.m3u8?subtestbyteje",
DrDecryption.decrypt("01000000c09b2fd5b4ffcb615af5555f571928bdad01cb1b0157af52c08a3673fae605f37c0e0a486f68f322d11e2df22fecb3d99fd30fb404021ba932076a2031401d527679ce066da7f71020a3f756cd8f123cdbf94fc3201... | [FOCAL] public static String DrDecryption.decrypt(String input)
[CLASS] class DrDecryption
[METRICS] loc=13 cc=3 branches=1 loops=0 returns=3 throws=0 nesting=1
[CALLS-INTERNAL] String doDecrypt(String input)
[CALLS-EXTERNAL] Timber.e/3
[EXCEPTIONS] catches GeneralSecurityException | RuntimeException ex
[PATH1] if(inpu... | /* static context
[FOCAL] public static String DrDecryption.decrypt(String input)
[PATH1] if(input == null)=F -> try-body throws -> return null
[PATH2] if(input == null)=T -> return null
[PATH3] if(input == null)=F -> return doDecrypt(input)
[INPUTS] branches=input | result=input
[EXCEPTIONS] catches GeneralSecurityExc... | /* static context
[FOCAL] public static String DrDecryption.decrypt(String input)
[PATH1] if(input == null)=F -> try-body throws -> return null
[PATH2] if(input == null)=T -> return null
[PATH3] if(input == null)=F -> return doDecrypt(input)
[INPUTS] branches=input | result=input
[EXCEPTIONS] catches GeneralSecurityExc... | true | ok | {"focal": {"class": "DrDecryption", "name": "decrypt", "signature": "String decrypt(String input)", "start_line": 3, "modifiers": "public static", "params": [{"name": "input", "type": "String"}], "return_type": "String"}, "class_info": {"name": "DrDecryption", "kind": "class", "modifiers": "", "superclass": null, "inte... |
74327735_1 | class RegexIntentDetector implements IntentDetector<IConversationIntent> {
@Override
public Optional<IConversationIntent> detectIntent(String text, String languageCode, String sessionId) {
for (Map.Entry<String, Pattern> entry : intentRegexMap.entrySet()) {
final Matcher matcher = entry.ge... | System.out.println("detectIntent");
String sessionId = "0";
Map<String,String> intentMap = new HashMap();
intentMap.put("DUCK", "duck");
intentMap.put("GOOSE", "goose");
intentMap.put("YES", RegexIntentDetector.YES);
intentMap.put("NO", RegexIntentDetecto... | [FOCAL] @Override public Optional<IConversationIntent> RegexIntentDetector.detectIntent(String text, String languageCode, String sessionId)
[CLASS] class RegexIntentDetector implements IntentDetector<IConversationIntent>
[METRICS] loc=56 cc=5 branches=2 loops=2 returns=2 throws=0 nesting=6
[CALLS-EXTERNAL] intentRegexM... | /* static context
[FOCAL] @Override public Optional<IConversationIntent> RegexIntentDetector.detectIntent(String text, String languageCode, String sessionId)
[PATH1] foreach(Map.Entry<String, Pattern> entry : intentRegexMap.entrySet())=T -> if(matcher.find())=T -> if(intentSlots != null)=T -> foreach(RegexIntentSlot in... | /* static context
[FOCAL] @Override public Optional<IConversationIntent> RegexIntentDetector.detectIntent(String text, String languageCode, String sessionId)
[PATH1] foreach(Map.Entry<String, Pattern> entry : intentRegexMap.entrySet())=T -> if(matcher.find())=T -> if(intentSlots != null)=T -> foreach(RegexIntentSlot in... | true | ok | {"focal": {"class": "RegexIntentDetector", "name": "detectIntent", "signature": "Optional<IConversationIntent> detectIntent(String text, String languageCode, String sessionId)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "text", "type": "String"}, {"name": "languageCode", "type": "String"}, {... |
74351531_0 | class UserService {
public void register(User user) throws UserExistException{
User u = this.getUserByUserName(user.getUserName());
if(u != null){
throw new UserExistException("用户名已经存在");
}else{
user.setCredit(100);
user.setUserType(1);
userDao.save(user);
}
}
public voi... | User user = new User();
user.setUserName("tom");
user.setPassword("1234");
doAnswer(new Answer<User>() {
public User answer(InvocationOnMock invocation) {
Object[] args = invocation.getArguments();
User user = (User) args[0];
if (user != null) {
user.setUserId(1);
}
return user;
... | [FOCAL] public void UserService.register(User user)
[CLASS] class UserService
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=0 throws=1 nesting=1
[CALLS-INTERNAL] User getUserByUserName(String userName)
[CALLS-EXTERNAL] User.getUserName/0, User.setCredit/1, User.setUserType/1, UserDao.save/1
[NEW] UserExistException
... | /* static context
[FOCAL] public void UserService.register(User user)
[THROWS-WHEN] UserExistException when u != null
[PATH1] if(u != null)=T -> throw new UserExistException("用户名已经存在")
[PATH2] if(u != null)=F
[INPUTS] branches=user | result=-
[COLLABORATORS] param user:User getUserName/0,setCredit/1,setUserType/1; fiel... | /* static context
[FOCAL] public void UserService.register(User user)
[THROWS-WHEN] UserExistException when u != null
[PATH1] if(u != null)=T -> throw new UserExistException("用户名已经存在")
[PATH2] if(u != null)=F
[INPUTS] branches=user | result=-
[COLLABORATORS] param user:User getUserName/0,setCredit/1,setUserType/1; fiel... | true | ok | {"focal": {"class": "UserService", "name": "register", "signature": "void register(User user) throws UserExistException", "start_line": 3, "modifiers": "public", "params": [{"name": "user", "type": "User"}], "return_type": "void"}, "class_info": {"name": "UserService", "kind": "class", "modifiers": "", "superclass": nu... |
74385593_4 | class HiveSchemaConverter {
public static TypeInfo convertPrimitiveMaybeLogical(Schema schema) {
if (schema.name() == null) {
return convertPrimitive(schema);
}
if (Decimal.LOGICAL_NAME.equals(schema.name())) {
String scale = schema.parameters().get(Decimal.SCALE_FIELD);
String precisi... | Map<String, String> props = new HashMap<>();
String someScale = "2";
String validPrecision = String.valueOf(HiveSchemaConverter.HIVE_DECIMAL_PRECISION_MAX);
props.put(Decimal.SCALE_FIELD, someScale);
props.put(HiveSchemaConverter.CONNECT_AVRO_DECIMAL_PRECISION_PROP, validPrecision);
//without a... | [FOCAL] public static TypeInfo HiveSchemaConverter.convertPrimitiveMaybeLogical(Schema schema)
[CLASS] class HiveSchemaConverter
[METRICS] loc=23 cc=4 branches=3 loops=0 returns=3 throws=1 nesting=2
[CALLS-INTERNAL] TypeInfo convertPrimitive(Schema schema)
[CALLS-EXTERNAL] Schema.name/0, Decimal.LOGICAL_NAME.equals/1, ... | /* static context
[FOCAL] public static TypeInfo HiveSchemaConverter.convertPrimitiveMaybeLogical(Schema schema)
[THROWS-WHEN] ConnectException when !(schema.name() == null) && Decimal.LOGICAL_NAME.equals(schema.name()) && precision != null && Integer.parseInt(precision) > HIVE_DECIMAL_PRECISION_MAX
[PATH1] if(schema.n... | /* static context
[FOCAL] public static TypeInfo HiveSchemaConverter.convertPrimitiveMaybeLogical(Schema schema)
[THROWS-WHEN] ConnectException when !(schema.name() == null) && Decimal.LOGICAL_NAME.equals(schema.name()) && precision != null && Integer.parseInt(precision) > HIVE_DECIMAL_PRECISION_MAX
[PATH1] if(schema.n... | true | ok | {"focal": {"class": "HiveSchemaConverter", "name": "convertPrimitiveMaybeLogical", "signature": "TypeInfo convertPrimitiveMaybeLogical(Schema schema)", "start_line": 3, "modifiers": "public static", "params": [{"name": "schema", "type": "Schema"}], "return_type": "TypeInfo"}, "class_info": {"name": "HiveSchemaConverter... |
74387321_8 | class S3SinkConnectorConfig extends StorageSinkConnectorConfig {
@Override
public Object get(String key) {
ComposableConfig config = propertyToConfig.get(key);
if (config == null) {
throw new ConfigException(String.format("Unknown configuration '%s'", key));
}
return config == this ? super.ge... | properties.put(AvroDataConfig.ENHANCED_AVRO_SCHEMA_SUPPORT_CONFIG, "true");
properties.put(AvroDataConfig.CONNECT_META_DATA_CONFIG, "false");
connectorConfig = new S3SinkConnectorConfig(properties);
assertEquals(true, connectorConfig.get(AvroDataConfig.ENHANCED_AVRO_SCHEMA_SUPPORT_CONFIG));
assertEq... | [FOCAL] @Override public Object S3SinkConnectorConfig.get(String key)
[CLASS] class S3SinkConnectorConfig extends StorageSinkConnectorConfig
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] propertyToConfig.get/1, String.format/2, StorageSinkConnectorConfig.get/1, ComposableConfig.g... | /* static context
[FOCAL] @Override public Object S3SinkConnectorConfig.get(String key)
[THROWS-WHEN] ConfigException when config == null
[PATH1] if(config == null)=T -> throw new ConfigException(String.format("Unknown configuration '%s'", key))
[PATH2] if(config == null)=F -> return config == this ? super.get(key) : c... | /* static context
[FOCAL] @Override public Object S3SinkConnectorConfig.get(String key)
[THROWS-WHEN] ConfigException when config == null
[PATH1] if(config == null)=T -> throw new ConfigException(String.format("Unknown configuration '%s'", key))
[PATH2] if(config == null)=F -> return config == this ? super.get(key) : c... | true | ok | {"focal": {"class": "S3SinkConnectorConfig", "name": "get", "signature": "Object get(String key)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "key", "type": "String"}], "return_type": "Object"}, "class_info": {"name": "S3SinkConnectorConfig", "kind": "class", "modifiers": "", "superclass": "S... |
74401462_32 | class Linker {
public static Set<BaggageBuffersDeclaration> link(BBC.Settings settings) throws CompileException {
return link(settings.files, FileUtils.splitBagPath(settings.bagPath));
}
private Linker(List<String> bagPath);
public static Set<BaggageBuffersDeclaration> link(List<String> inpu... | File dir = Files.createTempDir();
dir.deleteOnExit();
File f1 = new File(dir, "bagpathimport");
File f2 = createFile();
write(f1, "package edu.brown.cs;\nbag MyBag1 {bool test = 0;}");
write(f2, "import \"%s\";\nbag MyBag2 {MyBag1 test = 0;}", f1.getName... | [FOCAL] public static Set<BaggageBuffersDeclaration> Linker.link(BBC.Settings settings)
[CLASS] class Linker
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Set<BaggageBuffersDeclaration> link(List<String> inputFiles, List<String> bagPath)
[CALLS-EXTERNAL] FileUtils.splitBagPath/1
... | /* static context
[FOCAL] public static Set<BaggageBuffersDeclaration> Linker.link(BBC.Settings settings)
[INPUTS] branches=- | result=settings
[EXCEPTIONS] declares CompileException
[CALLS-INTERNAL] Set<BaggageBuffersDeclaration> link(List<String> inputFiles, List<String> bagPath)
[CALLS-EXTERNAL] FileUtils.splitBagPa... | /* static context
[FOCAL] public static Set<BaggageBuffersDeclaration> Linker.link(BBC.Settings settings)
[INPUTS] branches=- | result=settings
[EXCEPTIONS] declares CompileException
[CALLS-INTERNAL] Set<BaggageBuffersDeclaration> link(List<String> inputFiles, List<String> bagPath)
[CALLS-EXTERNAL] FileUtils.splitBagPa... | true | ok | {"focal": {"class": "Linker", "name": "link", "signature": "Set<BaggageBuffersDeclaration> link(BBC.Settings settings) throws CompileException", "start_line": 3, "modifiers": "public static", "params": [{"name": "settings", "type": "BBC.Settings"}], "return_type": "Set<BaggageBuffersDeclaration>"}, "class_info": {"name... |
74409326_16 | class EntityTag {
@Override
public String toString() {
StringBuilder b = new StringBuilder();
if (weak) {
b.append("W/");
}
appendQuoted(b, value);
//b.append('"').append(value.replaceAll("\"", "\\\\\"")).append('"');
return b.toString();
}
public EntityTag(final String value);
... | assertEquals(new EntityTag(
"Hello \"World\"", true).toString(),
"W/\"Hello \\\"World\\\"\"");
}
} | [FOCAL] @Override public String EntityTag.toString()
[CLASS] class EntityTag
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] void appendQuoted(StringBuilder b, String value)
[CALLS-EXTERNAL] StringBuilder.append/1, StringBuilder.toString/0
[NEW] StringBuilder
[PATH1] if(weak)=T ->... | /* static context
[FOCAL] @Override public String EntityTag.toString()
[PATH1] if(weak)=T -> return b.toString()
[PATH2] if(weak)=F -> return b.toString()
[CALLS-INTERNAL] void appendQuoted(StringBuilder b, String value)
[NEW] StringBuilder
[CALLS-EXTERNAL] StringBuilder.append/1, StringBuilder.toString/0
*/
| /* static context
[FOCAL] @Override public String EntityTag.toString()
[PATH1] if(weak)=T -> return b.toString()
[PATH2] if(weak)=F -> return b.toString()
[CALLS-INTERNAL] void appendQuoted(StringBuilder b, String value)
[NEW] StringBuilder
[CALLS-EXTERNAL] StringBuilder.append/1, StringBuilder.toString/0
*/
class Enti... | true | ok | {"focal": {"class": "EntityTag", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "EntityTag", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name"... |
74491626_10 | class NamedEntityGraph extends AbstractEntityGraph {
@Override
public int hashCode() {
return Objects.hash(name, getEntityGraphType(), isOptional());
}
public NamedEntityGraph(EntityGraphType type, boolean optional, String name);
public NamedEntityGraph(EntityGraphType type, String name);
public Na... | final EntityGraph optionalGraph = new NamedEntityGraph(EntityGraphType.LOAD, true, "graph");
final EntityGraph requiredGraph = new NamedEntityGraph(EntityGraphType.LOAD, false, "graph");
assertNotEquals(optionalGraph, requiredGraph);
assertNotEquals(optionalGraph.hashCode(), requiredGraph.hashCode());
... | [FOCAL] @Override public int NamedEntityGraph.hashCode()
[CLASS] class NamedEntityGraph extends AbstractEntityGraph
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Objects.hash/3, getEntityGraphType/0 (inherited), isOptional/0 (inherited)
[CLASS-MEMBERS] NamedEntityGraph(EntityGrap... | /* static context
[FOCAL] @Override public int NamedEntityGraph.hashCode()
[CALLS-EXTERNAL] Objects.hash/3, getEntityGraphType/0 (inherited), isOptional/0 (inherited)
*/
| /* static context
[FOCAL] @Override public int NamedEntityGraph.hashCode()
[CALLS-EXTERNAL] Objects.hash/3, getEntityGraphType/0 (inherited), isOptional/0 (inherited)
*/
class NamedEntityGraph extends AbstractEntityGraph {
@Override
public int hashCode() {
return Objects.hash(name, getEntityGraphType(), isOpti... | true | ok | {"focal": {"class": "NamedEntityGraph", "name": "hashCode", "signature": "int hashCode()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "NamedEntityGraph", "kind": "class", "modifiers": "", "superclass": "AbstractEntityGraph", "interfaces": null, "fields"... |
74616657_0 | class HalyardQueryJoinOptimizer extends QueryJoinOptimizer {
@Override
public void optimize(TupleExpr tupleExpr, Dataset dataset, BindingSet bindings) {
final Set<String> parallelSplitBounds = new HashSet<>();
tupleExpr.visit(new AbstractQueryModelVisitor<IncompatibleOperationException>() {
... | final TupleExpr expr = new SPARQLParser().parseQuery("select * where {?a ?b ?c, \"1\".}", "http://baseuri/").getTupleExpr();
new HalyardQueryJoinOptimizer(new HalyardEvaluationStatistics(null, null)).optimize(expr, null, null);
expr.visit(new AbstractQueryModelVisitor<RuntimeException>(){
... | [FOCAL] @Override public void HalyardQueryJoinOptimizer.optimize(TupleExpr tupleExpr, Dataset dataset, BindingSet bindings)
[CLASS] class HalyardQueryJoinOptimizer extends QueryJoinOptimizer
[METRICS] loc=57 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=3
[CALLS-EXTERNAL] TupleExpr.visit/1, HALYARD.PARALLEL_SPLIT_... | /* static context
[FOCAL] @Override public void HalyardQueryJoinOptimizer.optimize(TupleExpr tupleExpr, Dataset dataset, BindingSet bindings)
[INPUTS] branches=- | result=- | unused=dataset, bindings
[COLLABORATORS] param tupleExpr:TupleExpr visit/1; field node getURI/0,getArgs/0; field boundVars addAll/1; field priori... | /* static context
[FOCAL] @Override public void HalyardQueryJoinOptimizer.optimize(TupleExpr tupleExpr, Dataset dataset, BindingSet bindings)
[INPUTS] branches=- | result=- | unused=dataset, bindings
[COLLABORATORS] param tupleExpr:TupleExpr visit/1; field node getURI/0,getArgs/0; field boundVars addAll/1; field priori... | true | ok | {"focal": {"class": "HalyardQueryJoinOptimizer", "name": "optimize", "signature": "void optimize(TupleExpr tupleExpr, Dataset dataset, BindingSet bindings)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "tupleExpr", "type": "TupleExpr"}, {"name": "dataset", "type": "Dataset"}, {"name": "binding... |
74617406_2 | class Recipe {
public static Recipe readFromStream(InputStream stream) {
if (stream == null) {
return null;
}
BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
String id = null;
String title = null;
StringBuilder descBuilder = new StringBuilder();
try {
... | InputStream stream = RecipeTest.class.getResourceAsStream("/recipes/mixed.txt");
Recipe recipe = Recipe.readFromStream(stream);
assertNotNull(recipe);
assertEquals("punch", recipe.id);
assertEquals("Punch", recipe.title);
assertEquals("Juice of 3 lemons\n" +
"1 orange\n" +
"1 pin... | [FOCAL] public static Recipe Recipe.readFromStream(InputStream stream)
[CLASS] class Recipe
[METRICS] loc=36 cc=8 branches=5 loops=1 returns=4 throws=0 nesting=3
[CALLS-EXTERNAL] BufferedReader.readLine/0, String.startsWith/1, String.substring/1, ID_PREFIX.length/0, TITLE_PREFIX.length/0, StringBuilder.length/0, String... | /* static context
[FOCAL] public static Recipe Recipe.readFromStream(InputStream stream)
[PATH1] if(stream == null)=F -> for(line != null)=T -> if(line.startsWith(ID_PREFIX))=F -> if(line.startsWith(TITLE_PREFIX))=F -> if(descBuilder.length() > 0)=T -> exit loop -> if(id == null || title == null || descBuilder.length()... | /* static context
[FOCAL] public static Recipe Recipe.readFromStream(InputStream stream)
[PATH1] if(stream == null)=F -> for(line != null)=T -> if(line.startsWith(ID_PREFIX))=F -> if(line.startsWith(TITLE_PREFIX))=F -> if(descBuilder.length() > 0)=T -> exit loop -> if(id == null || title == null || descBuilder.length()... | true | ok | {"focal": {"class": "Recipe", "name": "readFromStream", "signature": "Recipe readFromStream(InputStream stream)", "start_line": 3, "modifiers": "public static", "params": [{"name": "stream", "type": "InputStream"}], "return_type": "Recipe"}, "class_info": {"name": "Recipe", "kind": "class", "modifiers": "", "superclass... |
74704643_1 | class GraphQlExecutorImpl implements GraphQlExecutor {
@Override
public Object executeRequest(Map requestBody) {
val query = (String) requestBody.get("query");
val operationName = (String) requestBody.get("operationName");
val variables = getVariablesFromRequest(requestBody);
va... | // Given
val request = new LinkedHashMap<String, Object>();
request.put("query", "dummy");
request.put("operationName", "dummy");
request.put("variables", 1234);
// When
val exception = assertThatThrownBy(() -> graphQlExecutor.executeRequest(request));
/... | [FOCAL] @Override public Object GraphQlExecutorImpl.executeRequest(Map requestBody)
[CLASS] class GraphQlExecutorImpl implements GraphQlExecutor
[METRICS] loc=20 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] Map<String, Object> getVariablesFromRequest(Map requestBody); void beforeExecuteRequest(... | /* static context
[FOCAL] @Override public Object GraphQlExecutorImpl.executeRequest(Map requestBody)
[PATH1] if(executionResult.getErrors().size() > 0)=T -> return result
[PATH2] if(executionResult.getErrors().size() > 0)=F -> return result
[INPUTS] branches=requestBody | result=-
[COLLABORATORS] param requestBody:Map... | /* static context
[FOCAL] @Override public Object GraphQlExecutorImpl.executeRequest(Map requestBody)
[PATH1] if(executionResult.getErrors().size() > 0)=T -> return result
[PATH2] if(executionResult.getErrors().size() > 0)=F -> return result
[INPUTS] branches=requestBody | result=-
[COLLABORATORS] param requestBody:Map... | true | ok | {"focal": {"class": "GraphQlExecutorImpl", "name": "executeRequest", "signature": "Object executeRequest(Map requestBody)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "requestBody", "type": "Map"}], "return_type": "Object"}, "class_info": {"name": "GraphQlExecutorImpl", "kind": "class", "modi... |
74740415_4 | class BallotCipherService {
public AuthenticatedBallot encryptBallotThenWrapForAuthentication(String plainText, int ballotIndex) {
Cipher ballotKeyCipher = ciphersProvider.getBallotKeyCipher();
Cipher ballotCipher = ciphersProvider.getBallotCipher();
// Generate a random symmetric key, re... | initBallotCiphersProviderMock();
StringBuilder sb = new StringBuilder();
sb.append("GE;6699:9903");
sb.append("370001;0;37000101;p=DEP");
sb.append(Strings.repeat(";1001", 545));
AuthenticatedBallot authenticatedBallot = ballotCipherService.encryptBallotThenWrapForAuthe... | [FOCAL] public AuthenticatedBallot BallotCipherService.encryptBallotThenWrapForAuthentication(String plainText, int ballotIndex)
[CLASS] class BallotCipherService
[METRICS] loc=24 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Key createNewRandomSymmetricKey(Cipher ballotCipher); byte[] aeadEncry... | /* static context
[FOCAL] public AuthenticatedBallot BallotCipherService.encryptBallotThenWrapForAuthentication(String plainText, int ballotIndex)
[INPUTS] branches=- | result=ballotIndex, plainText, propertyConfigurationService
[COLLABORATORS] field ciphersProvider getBallotKeyCipher/0,getBallotCipher/0,getIntegrityCh... | /* static context
[FOCAL] public AuthenticatedBallot BallotCipherService.encryptBallotThenWrapForAuthentication(String plainText, int ballotIndex)
[INPUTS] branches=- | result=ballotIndex, plainText, propertyConfigurationService
[COLLABORATORS] field ciphersProvider getBallotKeyCipher/0,getBallotCipher/0,getIntegrityCh... | true | ok | {"focal": {"class": "BallotCipherService", "name": "encryptBallotThenWrapForAuthentication", "signature": "AuthenticatedBallot encryptBallotThenWrapForAuthentication(String plainText, int ballotIndex)", "start_line": 3, "modifiers": "public", "params": [{"name": "plainText", "type": "String"}, {"name": "ballotIndex", "... |
74843923_59 | class AppRequestHandler implements RequestHandler {
@Override
public Response handle(Request request) {
final AppRequest appRequest = appRequestFactory.create(request);
final Optional<AppResponse> primedResponseOpt = primingContext.getResponse(appRequest);
if(!primedResponseOpt.isPres... | appRequestHandler.handle(request);
verify(callHistory).add(exchange);
}
} | [FOCAL] @Override public Response AppRequestHandler.handle(Request request)
[CLASS] class AppRequestHandler implements RequestHandler
[METRICS] loc=17 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] AppRequestFactory.create/1, PrimingContext.getResponse/1, Optional<AppResponse>.isPresent/0, FixedC... | /* static context
[FOCAL] @Override public Response AppRequestHandler.handle(Request request)
[THROWS-WHEN] PrimingNotFoundException when !primedResponseOpt.isPresent()
[PATH1] if(!primedResponseOpt.isPresent())=T -> throw new PrimingNotFoundException(appRequest)
[PATH2] if(!primedResponseOpt.isPresent())=F -> return z... | /* static context
[FOCAL] @Override public Response AppRequestHandler.handle(Request request)
[THROWS-WHEN] PrimingNotFoundException when !primedResponseOpt.isPresent()
[PATH1] if(!primedResponseOpt.isPresent())=T -> throw new PrimingNotFoundException(appRequest)
[PATH2] if(!primedResponseOpt.isPresent())=F -> return z... | true | ok | {"focal": {"class": "AppRequestHandler", "name": "handle", "signature": "Response handle(Request request)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "Request"}], "return_type": "Response"}, "class_info": {"name": "AppRequestHandler", "kind": "class", "modifiers": "", "sup... |
74857438_8 | class HoodUtil {
public static String obfuscateAndShorten(@Nullable String original, int maxCharLengthLeftOrRight,
char obfuscationChar) {
if (original == null || original.trim().length() <= 1) {
return original;
}
if (maxCharLengthL... | assertEquals("h***o", HoodUtil.obfuscateAndShorten("hello", 1, '*'));
assertEquals("he***lo", HoodUtil.obfuscateAndShorten("hello", 2, '*'));
assertEquals("he***lo", HoodUtil.obfuscateAndShorten("hello", 3, '*'));
assertEquals("he***lo", HoodUtil.obfuscateAndShorten("hello", 4, '*'));
... | [FOCAL] public static String HoodUtil.obfuscateAndShorten(String original, int maxCharLengthLeftOrRight, char obfuscationChar)
[CLASS] class HoodUtil
[METRICS] loc=18 cc=4 branches=3 loops=0 returns=3 throws=1 nesting=1
[CALLS-EXTERNAL] original.trim().length/0, String.trim/0, String.valueOf/1, String.length/0, String.... | /* static context
[FOCAL] public static String HoodUtil.obfuscateAndShorten(String original, int maxCharLengthLeftOrRight, char obfuscationChar)
[THROWS-WHEN] IllegalArgumentException when !(original == null || original.trim().length() <= 1) && maxCharLengthLeftOrRight <= 0
[PATH1] if(original == null || original.trim(... | /* static context
[FOCAL] public static String HoodUtil.obfuscateAndShorten(String original, int maxCharLengthLeftOrRight, char obfuscationChar)
[THROWS-WHEN] IllegalArgumentException when !(original == null || original.trim().length() <= 1) && maxCharLengthLeftOrRight <= 0
[PATH1] if(original == null || original.trim(... | true | ok | {"focal": {"class": "HoodUtil", "name": "obfuscateAndShorten", "signature": "String obfuscateAndShorten(String original, int maxCharLengthLeftOrRight, char obfuscationChar)", "start_line": 3, "modifiers": "public static", "params": [{"name": "original", "type": "String"}, {"name": "maxCharLengthLeftOrRight", "type": "i... |
74877759_0 | class ServiceHelperSupport {
public JSONObject get(String id) {
if (getKey == null)
getKey = getKey() + ".get";
return carousel.get(getKey, id);
}
public JSONArray fill(JSONArray array, String[] names);
protected abstract String getKey();
@Inject
private Thread th... | while (Calendar.getInstance().get(Calendar.SECOND) > 55)
thread.sleep(5, TimeUnit.Second);
mockHelper.reset();
mockHelper.mock("/service-helper");
mockCarousel.reset();
mockCarousel.register("key", "{\"code\":0,\"data\":{\"id 1\":{\"id\":\"new id\",\"name\":\"carouse... | [FOCAL] public JSONObject ServiceHelperSupport.get(String id)
[CLASS] class ServiceHelperSupport
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] String getKey()
[CALLS-EXTERNAL] carousel.get/2
[PATH1] if(getKey == null)=T -> return carousel.get(getKey, id)
[PATH2] if(getKey == null... | /* static context
[FOCAL] public JSONObject ServiceHelperSupport.get(String id)
[PATH1] if(getKey == null)=T -> return carousel.get(getKey, id)
[PATH2] if(getKey == null)=F -> return carousel.get(getKey, id)
[INPUTS] branches=- | result=id
[COLLABORATORS] field carousel get/2
[CALLS-INTERNAL] String getKey()
[CALLS-EXT... | /* static context
[FOCAL] public JSONObject ServiceHelperSupport.get(String id)
[PATH1] if(getKey == null)=T -> return carousel.get(getKey, id)
[PATH2] if(getKey == null)=F -> return carousel.get(getKey, id)
[INPUTS] branches=- | result=id
[COLLABORATORS] field carousel get/2
[CALLS-INTERNAL] String getKey()
[CALLS-EXT... | true | ok | {"focal": {"class": "ServiceHelperSupport", "name": "get", "signature": "JSONObject get(String id)", "start_line": 3, "modifiers": "public", "params": [{"name": "id", "type": "String"}], "return_type": "JSONObject"}, "class_info": {"name": "ServiceHelperSupport", "kind": "class", "modifiers": "", "superclass": null, "i... |
74907921_191 | class DataQuality extends Types {
public static int columns(Row row) {
return row.width();
}
public static boolean hascolumn(Row row, String column);
public static boolean inrange(double value, double lower, double upper);
public static int strlen(String str);
public static boolean isnull(Object objec... | Row row = new Row("a", 1).add("b", 2).add("c", 3);
Assert.assertEquals(3, DataQuality.columns(row));
row = new Row("a", 1);
Assert.assertEquals(1, DataQuality.columns(row));
row = new Row();
Assert.assertEquals(0, DataQuality.columns(row));
}
} | [FOCAL] public static int DataQuality.columns(Row row)
[CLASS] class DataQuality extends Types
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Row.width/0
[INPUTS] branches=- | result=row
[COLLABORATORS] param row:Row width/0
[DATAFLOW] row@param->L2
[CLASS-MEMBERS] boolean hascolu... | /* static context
[FOCAL] public static int DataQuality.columns(Row row)
[INPUTS] branches=- | result=row
[COLLABORATORS] param row:Row width/0
[CALLS-EXTERNAL] Row.width/0
*/
| /* static context
[FOCAL] public static int DataQuality.columns(Row row)
[INPUTS] branches=- | result=row
[COLLABORATORS] param row:Row width/0
[CALLS-EXTERNAL] Row.width/0
*/
class DataQuality extends Types {
public static int columns(Row row) {
return row.width();
}
public static boolean hascolumn(Row row... | true | ok | {"focal": {"class": "DataQuality", "name": "columns", "signature": "int columns(Row row)", "start_line": 3, "modifiers": "public static", "params": [{"name": "row", "type": "Row"}], "return_type": "int"}, "class_info": {"name": "DataQuality", "kind": "class", "modifiers": "", "superclass": "Types", "interfaces": null, ... |
74950506_2 | class ClassIntrospector {
public static Collection<ResourceMethodInfoDTO> getResourceMethodInfos(
Class<?> clazz, Bus bus) {
final Class<?> realClass = unwrap(clazz, bus);
ClassResourceInfo classResourceInfo =
ResourceUtils.createClassResourceInfo(
realClass... | Bus bus = BusFactory.getDefaultBus(true);
ResourceMethodInfoDTO[] resourceMethodInfoDTOS =
ClassIntrospector.getResourceMethodInfos(
PlainResourceSeveralOperations.class, bus
).toArray(
new ResourceMethodInfoDTO[0]
);
assertEq... | [FOCAL] public static Collection<ResourceMethodInfoDTO> ClassIntrospector.getResourceMethodInfos(Class<?> clazz, Bus bus)
[CLASS] class ClassIntrospector
[METRICS] loc=14 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Class<?> unwrap(Class<?> clazz, Bus bus); Stream<ResourceMethodInfoDTO> convert... | /* static context
[FOCAL] public static Collection<ResourceMethodInfoDTO> ClassIntrospector.getResourceMethodInfos(Class<?> clazz, Bus bus)
[INPUTS] branches=- | result=bus, clazz
[CALLS-INTERNAL] Class<?> unwrap(Class<?> clazz, Bus bus); Stream<ResourceMethodInfoDTO> convert(Set<ClassResourceInfo> visited, String pare... | /* static context
[FOCAL] public static Collection<ResourceMethodInfoDTO> ClassIntrospector.getResourceMethodInfos(Class<?> clazz, Bus bus)
[INPUTS] branches=- | result=bus, clazz
[CALLS-INTERNAL] Class<?> unwrap(Class<?> clazz, Bus bus); Stream<ResourceMethodInfoDTO> convert(Set<ClassResourceInfo> visited, String pare... | true | ok | {"focal": {"class": "ClassIntrospector", "name": "getResourceMethodInfos", "signature": "Collection<ResourceMethodInfoDTO> getResourceMethodInfos(Class<?> clazz, Bus bus)", "start_line": 3, "modifiers": "public static", "params": [{"name": "clazz", "type": "Class<?>"}, {"name": "bus", "type": "Bus"}], "return_type": "C... |
74971299_45 | class PatternFilter extends AbstractFilter {
@Override
public <T extends Object> PrismPropertyValue<T> apply(PrismPropertyValue<T> propertyValue) {
Validate.notNull(propertyValue, "Node must not be null.");
String value = getStringValue(propertyValue);
if (StringUtils.isEmpty(value)) {
... | List<Object> parameters = createBadParameters2();
filter.setParameters(parameters);
PrismPropertyValue<String> value = new PrismPropertyValue<String>(input);
value = filter.apply(value);
AssertJUnit.assertEquals(expected, value.getValue());
}
} | [FOCAL] @Override public PrismPropertyValue<T> PatternFilter.apply(PrismPropertyValue<T> propertyValue)
[CLASS] class PatternFilter extends AbstractFilter
[METRICS] loc=17 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] List<Replace> getReplaces()
[CALLS-EXTERNAL] Validate.notNull/2, getStringValu... | /* static context
[FOCAL] @Override public PrismPropertyValue<T> PatternFilter.apply(PrismPropertyValue<T> propertyValue)
[PATH1] if(StringUtils.isEmpty(value))=F -> foreach(Replace replace : replaces)=T -> exit loop -> return propertyValue
[PATH2] if(StringUtils.isEmpty(value))=T -> return propertyValue
[PATH3] if(Str... | /* static context
[FOCAL] @Override public PrismPropertyValue<T> PatternFilter.apply(PrismPropertyValue<T> propertyValue)
[PATH1] if(StringUtils.isEmpty(value))=F -> foreach(Replace replace : replaces)=T -> exit loop -> return propertyValue
[PATH2] if(StringUtils.isEmpty(value))=T -> return propertyValue
[PATH3] if(Str... | true | ok | {"focal": {"class": "PatternFilter", "name": "apply", "signature": "PrismPropertyValue<T> apply(PrismPropertyValue<T> propertyValue)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "propertyValue", "type": "PrismPropertyValue<T>"}], "return_type": "PrismPropertyValue<T>"}, "class_info": {"name":... |
74972240_0 | class RxMqtt {
@NonNull
@CheckReturnValue
public static Maybe<IMqttToken> connect(@NonNull final MqttAndroidClient client) {
return connect(client, new MqttConnectOptions(), null);
}
@NonNull public static MqttAndroidClient client(
@NonNull final Context context,
@N... | final MqttAndroidClient client = RxMqtt.client(RuntimeEnvironment.application, url);
TestObserver observer = RxMqtt.connect(client).doOnNext(new Consumer<IMqttToken>() {
@Override
public void accept(IMqttToken token) throws Exception {
System.out.println(token);
... | [FOCAL] @NonNull @CheckReturnValue public static Maybe<IMqttToken> RxMqtt.connect(MqttAndroidClient client)
[CLASS] class RxMqtt
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Maybe<IMqttToken> connect(MqttAndroidClient client, MqttConnectOptions options, DisconnectedBufferOptions... | /* static context
[FOCAL] @NonNull @CheckReturnValue public static Maybe<IMqttToken> RxMqtt.connect(MqttAndroidClient client)
[INPUTS] branches=- | result=client
[CALLS-INTERNAL] Maybe<IMqttToken> connect(MqttAndroidClient client, MqttConnectOptions options, DisconnectedBufferOptions bufferOptions)
[NEW] MqttConnectOpt... | /* static context
[FOCAL] @NonNull @CheckReturnValue public static Maybe<IMqttToken> RxMqtt.connect(MqttAndroidClient client)
[INPUTS] branches=- | result=client
[CALLS-INTERNAL] Maybe<IMqttToken> connect(MqttAndroidClient client, MqttConnectOptions options, DisconnectedBufferOptions bufferOptions)
[NEW] MqttConnectOpt... | true | ok | {"focal": {"class": "RxMqtt", "name": "connect", "signature": "Maybe<IMqttToken> connect(MqttAndroidClient client)", "start_line": 3, "modifiers": "@NonNull @CheckReturnValue public static", "params": [{"name": "client", "type": "MqttAndroidClient"}], "return_type": "Maybe<IMqttToken>"}, "class_info": {"name": "RxMqtt"... |
74999474_10 | class TypeSafeConfWrapper implements ParsecConfig {
@Override
public List<Integer> getIntList(String path) {
try {
return configDelegate.getIntList(path);
} catch (ConfigException e) {
throw new RuntimeException(e);
}
}
public TypeSafeConfWrapper(Config... | int[] expected = new int[] { 1, 2, 3, 4, 5, 6 };
ParsecConfig confWrapper = getConfig();
List<Integer> numberList = confWrapper.getIntList("numberList");
int idx = 0;
for (int value : numberList) {
assertEquals(value, expected[idx++]);
}
confWrapper.ge... | [FOCAL] @Override public List<Integer> TypeSafeConfWrapper.getIntList(String path)
[CLASS] class TypeSafeConfWrapper implements ParsecConfig
[METRICS] loc=8 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] configDelegate.getIntList/1
[NEW] RuntimeException
[EXCEPTIONS] throws RuntimeException; catc... | /* static context
[FOCAL] @Override public List<Integer> TypeSafeConfWrapper.getIntList(String path)
[THROWS-WHEN] RuntimeException when try-body throws
[PATH1] try-body throws -> throw new RuntimeException(e)
[PATH2] return configDelegate.getIntList(path)
[INPUTS] branches=- | result=path
[COLLABORATORS] field configD... | /* static context
[FOCAL] @Override public List<Integer> TypeSafeConfWrapper.getIntList(String path)
[THROWS-WHEN] RuntimeException when try-body throws
[PATH1] try-body throws -> throw new RuntimeException(e)
[PATH2] return configDelegate.getIntList(path)
[INPUTS] branches=- | result=path
[COLLABORATORS] field configD... | true | ok | {"focal": {"class": "TypeSafeConfWrapper", "name": "getIntList", "signature": "List<Integer> getIntList(String path)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "path", "type": "String"}], "return_type": "List<Integer>"}, "class_info": {"name": "TypeSafeConfWrapper", "kind": "class", "modifi... |
75065038_2 | class CollectionUtils {
public static <T> T get(T[] data, int index) {
int len = data.length;
if (index > len - 1) {
index = len - 1;
}
return data[index];
}
public static T last(List<T> data);
public static String strings(List<T> data, String split);
p... | int[] ints = new int[]{1, 2, 3, 4};
Assert.assertTrue(4 == CollectionUtils.get(ints, 7));
Assert.assertTrue(1 == CollectionUtils.get(ints, 0));
Assert.assertFalse(4 == CollectionUtils.get(ints, 1));
}
} | [FOCAL] public static T CollectionUtils.get(T[] data, int index)
[CLASS] class CollectionUtils
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[PATH1] if(index > len - 1)=T -> return data[index]
[PATH2] if(index > len - 1)=F -> return data[index]
[INPUTS] branches=data, index | result=data, index
[... | /* static context
[FOCAL] public static T CollectionUtils.get(T[] data, int index)
[PATH1] if(index > len - 1)=T -> return data[index]
[PATH2] if(index > len - 1)=F -> return data[index]
[INPUTS] branches=data, index | result=data, index
*/
| /* static context
[FOCAL] public static T CollectionUtils.get(T[] data, int index)
[PATH1] if(index > len - 1)=T -> return data[index]
[PATH2] if(index > len - 1)=F -> return data[index]
[INPUTS] branches=data, index | result=data, index
*/
class CollectionUtils {
public static <T> T get(T[] data, int index) {
... | true | ok | {"focal": {"class": "CollectionUtils", "name": "get", "signature": "T get(T[] data, int index)", "start_line": 3, "modifiers": "public static", "params": [{"name": "data", "type": "T[]"}, {"name": "index", "type": "int"}], "return_type": "T"}, "class_info": {"name": "CollectionUtils", "kind": "class", "modifiers": "", ... |
75085823_10 | class GitConfigStore implements ConfigStore {
@Override
public Future<Void> close() {
return vertx.executeBlocking(promise -> {
git.close();
promise.complete();
});
}
public GitConfigStore(Vertx vertx, JsonObject configuration);
private Git initializeGit();
@Override public Future<Bu... | git.close();
remote = "acme";
FileUtils.deleteQuietly(root);
git = connect(bareRoot, root);
Async async = tc.async();
add(git, root, new File("src/test/resources/files/a.json"), null);
branch = "dev";
add(git, root, new File("src/test/resources/files/regular.json"), null);
push(git);... | [FOCAL] @Override public Future<Void> GitConfigStore.close()
[CLASS] class GitConfigStore implements ConfigStore
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Vertx.executeBlocking/1, Git.close/0, promise.complete/0
[FIELDS] read=git:Git, vertx:Vertx
[INPUTS] branches=- | result=... | /* static context
[FOCAL] @Override public Future<Void> GitConfigStore.close()
[INPUTS] branches=- | result=git, vertx
[COLLABORATORS] field vertx:Vertx executeBlocking/1; field git:Git close/0; field promise complete/0
[FIELDS] read=git:Git, vertx:Vertx
[CALLS-EXTERNAL] Vertx.executeBlocking/1, Git.close/0, promise.co... | /* static context
[FOCAL] @Override public Future<Void> GitConfigStore.close()
[INPUTS] branches=- | result=git, vertx
[COLLABORATORS] field vertx:Vertx executeBlocking/1; field git:Git close/0; field promise complete/0
[FIELDS] read=git:Git, vertx:Vertx
[CALLS-EXTERNAL] Vertx.executeBlocking/1, Git.close/0, promise.co... | true | ok | {"focal": {"class": "GitConfigStore", "name": "close", "signature": "Future<Void> close()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Future<Void>"}, "class_info": {"name": "GitConfigStore", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "ConfigStore", "fields"... |
75118280_10 | class RecordPersister extends SourcePersister implements RecordProvider<BarCode> {
@Nonnull
@Override
public RecordState getRecordState(@Nonnull BarCode barCode) {
return sourceFileReader.getRecordState(barCode, expirationUnit, expirationDuration);
}
@Inject public RecordPersister(FileSys... | when(fileSystem.getRecordState(TimeUnit.DAYS, 1L, SourcePersister.pathForBarcode(simple)))
.thenReturn(RecordState.STALE);
assertThat(sourcePersister.getRecordState(simple)).isEqualTo(RecordState.STALE);
}
} | [FOCAL] @Nonnull @Override public RecordState RecordPersister.getRecordState(BarCode barCode)
[CLASS] class RecordPersister extends SourcePersister implements RecordProvider<BarCode>
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] sourceFileReader.getRecordState/3
[INPUTS] branches... | /* static context
[FOCAL] @Nonnull @Override public RecordState RecordPersister.getRecordState(BarCode barCode)
[INPUTS] branches=- | result=barCode
[COLLABORATORS] field sourceFileReader getRecordState/3
[CALLS-EXTERNAL] sourceFileReader.getRecordState/3
*/
| /* static context
[FOCAL] @Nonnull @Override public RecordState RecordPersister.getRecordState(BarCode barCode)
[INPUTS] branches=- | result=barCode
[COLLABORATORS] field sourceFileReader getRecordState/3
[CALLS-EXTERNAL] sourceFileReader.getRecordState/3
*/
class RecordPersister extends SourcePersister implements Reco... | true | ok | {"focal": {"class": "RecordPersister", "name": "getRecordState", "signature": "RecordState getRecordState(BarCode barCode)", "start_line": 3, "modifiers": "@Nonnull @Override public", "params": [{"name": "barCode", "type": "BarCode"}], "return_type": "RecordState"}, "class_info": {"name": "RecordPersister", "kind": "cl... |
75133570_25 | class TravelerGroupController extends Controller {
public void subscribe(@Nonnull String groupId, @Nonnull User user) {
final Key<Account> accountKey = Key.create(user.getUserId());
final Key<TravelerGroupEntity> groupKey = Key.create(groupId);
Map<Key<Object>, Object> fetched = ofy().load().keys(accoun... | TravelerGroupEntity group = endpoint.insert("Adventure", TEST_IMG, user);
endpoint.subscribe(group.getWebsafeId(), user);
TravelerGroupEntity adventure = ofy().load().entity(group).now();
assertTrue(adventure.getPostCount() == 1L);
}
} | [FOCAL] public void TravelerGroupController.subscribe(String groupId, User user)
[CLASS] class TravelerGroupController extends Controller
[METRICS] loc=18 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] Key.create/1, User.getUserId/0, ofy().load().keys/2, ofy().load/0, ofy/0 (inherited), Map<Key<O... | /* static context
[FOCAL] public void TravelerGroupController.subscribe(String groupId, User user)
[COLLABORATORS] param user:User getUserId/0
[CALLS-EXTERNAL] Key.create/1, User.getUserId/0, ofy().load().keys/2, ofy().load/0, ofy/0 (inherited), Map<Key<Object>, Object>.get/1, ofy().transact/1, account.toBuilder().subs... | /* static context
[FOCAL] public void TravelerGroupController.subscribe(String groupId, User user)
[COLLABORATORS] param user:User getUserId/0
[CALLS-EXTERNAL] Key.create/1, User.getUserId/0, ofy().load().keys/2, ofy().load/0, ofy/0 (inherited), Map<Key<Object>, Object>.get/1, ofy().transact/1, account.toBuilder().subs... | true | ok | {"focal": {"class": "TravelerGroupController", "name": "subscribe", "signature": "void subscribe(String groupId, User user)", "start_line": 3, "modifiers": "public", "params": [{"name": "groupId", "type": "String"}, {"name": "user", "type": "User"}], "return_type": "void"}, "class_info": {"name": "TravelerGroupControll... |
75164823_194 | class IndexFile {
public void selectPhyOffset(final List<Long> phyOffsets, final String key, final int maxNum,
final long begin, final long end, boolean lock) {
if (this.mappedFile.hold()) {
int keyHash = indexKeyHashMethod(key);
int slotPos = keyHash % this.hashSlotNum;
... | IndexFile indexFile = new IndexFile("200", HASH_SLOT_NUM, INDEX_NUM, 0, 0);
for (long i = 0; i < (INDEX_NUM - 1); i++) {
boolean putResult = indexFile.putKey(Long.toString(i), i, System.currentTimeMillis());
assertThat(putResult).isTrue();
}
// put over index fi... | [FOCAL] public void IndexFile.selectPhyOffset(List<Long> phyOffsets, String key, int maxNum, long begin, long end, boolean lock)
[CLASS] class IndexFile
[METRICS] loc=75 cc=11 branches=8 loops=1 returns=0 throws=0 nesting=5
[CALLS-INTERNAL] int indexKeyHashMethod(String key)
[CALLS-EXTERNAL] this.mappedFile.hold/0, thi... | /* static context
[FOCAL] public void IndexFile.selectPhyOffset(List<Long> phyOffsets, String key, int maxNum, long begin, long end, boolean lock)
[PATH1] if(this.mappedFile.hold())=T -> if(lock)=T -> if(slotValue <= invalidIndex || slotValue > this.indexHeader.getIndexCount() || this.indexHeader.getIndexCount() <= 1)=... | /* static context
[FOCAL] public void IndexFile.selectPhyOffset(List<Long> phyOffsets, String key, int maxNum, long begin, long end, boolean lock)
[PATH1] if(this.mappedFile.hold())=T -> if(lock)=T -> if(slotValue <= invalidIndex || slotValue > this.indexHeader.getIndexCount() || this.indexHeader.getIndexCount() <= 1)=... | true | ok | {"focal": {"class": "IndexFile", "name": "selectPhyOffset", "signature": "void selectPhyOffset(List<Long> phyOffsets, String key, int maxNum, long begin, long end, boolean lock)", "start_line": 3, "modifiers": "public", "params": [{"name": "phyOffsets", "type": "List<Long>"}, {"name": "key", "type": "String"}, {"name":... |
75169335_1 | class PrettyFormatter {
public static String formatMillisToYearsDaysHours(long millis) {
long days = TimeUnit.MILLISECONDS.toDays(millis);
millis -= TimeUnit.DAYS.toMillis(days);
final long hours = TimeUnit.MILLISECONDS.toHours(millis);
millis -= TimeUnit.HOURS.toMillis(hours);
... |
long millis = TimeUnit.MINUTES.toMillis(1);
Assert.assertEquals("1 minute", PrettyFormatter.formatMillisToYearsDaysHours(millis));
millis += TimeUnit.MINUTES.toMillis(1);
Assert.assertEquals("2 minutes", PrettyFormatter.formatMillisToYearsDaysHours(millis));
millis += TimeUnit... | [FOCAL] public static String PrettyFormatter.formatMillisToYearsDaysHours(long millis)
[CLASS] class PrettyFormatter
[METRICS] loc=37 cc=4 branches=2 loops=1 returns=3 throws=0 nesting=2
[CALLS-EXTERNAL] TimeUnit.MILLISECONDS.toDays/1, TimeUnit.DAYS.toMillis/1, TimeUnit.MILLISECONDS.toHours/1, TimeUnit.HOURS.toMillis/1... | /* static context
[FOCAL] public static String PrettyFormatter.formatMillisToYearsDaysHours(long millis)
[PATH1] while(days>365)=T -> exit loop -> if(formatted.length() == 0)=T -> if(millis > 0)=T -> return minutesPart + secondsPart
[PATH2] while(days>365)=F -> if(formatted.length() == 0)=F -> return formatted
[PATH3] ... | /* static context
[FOCAL] public static String PrettyFormatter.formatMillisToYearsDaysHours(long millis)
[PATH1] while(days>365)=T -> exit loop -> if(formatted.length() == 0)=T -> if(millis > 0)=T -> return minutesPart + secondsPart
[PATH2] while(days>365)=F -> if(formatted.length() == 0)=F -> return formatted
[PATH3] ... | true | ok | {"focal": {"class": "PrettyFormatter", "name": "formatMillisToYearsDaysHours", "signature": "String formatMillisToYearsDaysHours(long millis)", "start_line": 3, "modifiers": "public static", "params": [{"name": "millis", "type": "long"}], "return_type": "String"}, "class_info": {"name": "PrettyFormatter", "kind": "clas... |
75215830_74 | class CustomNginxStorageBackend implements StorageBackend {
@Override
public URI store(JsonOutputObject outputObject) throws StorageException {
URI serviceUri = getServiceUri(outputObject.getJobId());
try (PipeStream inputStream = createJsonInputStream(outputObject)) {
return store(... | URI localUri = null;
try {
setStorageUri("http://127.0.0.1:12345");
MarkupResult markup = createMarkupResult();
localUri = URI.create(markup.getMarkupUri());
_nginxStorageService.store(markup);
fail("Expected exception not thrown");
}
... | [FOCAL] @Override public URI CustomNginxStorageBackend.store(JsonOutputObject outputObject)
[CLASS] class CustomNginxStorageBackend implements StorageBackend
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] PipeStream createJsonInputStream(Object object); URI getServiceUri(long jobI... | /* static context
[FOCAL] @Override public URI CustomNginxStorageBackend.store(JsonOutputObject outputObject)
[INPUTS] branches=- | result=outputObject
[COLLABORATORS] param outputObject:JsonOutputObject getJobId/0
[EXCEPTIONS] declares StorageException
[CALLS-INTERNAL] PipeStream createJsonInputStream(Object object); ... | /* static context
[FOCAL] @Override public URI CustomNginxStorageBackend.store(JsonOutputObject outputObject)
[INPUTS] branches=- | result=outputObject
[COLLABORATORS] param outputObject:JsonOutputObject getJobId/0
[EXCEPTIONS] declares StorageException
[CALLS-INTERNAL] PipeStream createJsonInputStream(Object object); ... | true | ok | {"focal": {"class": "CustomNginxStorageBackend", "name": "store", "signature": "URI store(JsonOutputObject outputObject) throws StorageException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "outputObject", "type": "JsonOutputObject"}], "return_type": "URI"}, "class_info": {"name": "CustomNgin... |
75269665_3 | class Calculator {
public double add(double firstOperand, double secondOperand) {
return firstOperand + secondOperand;
}
public double sub(double firstOperand, double secondOperand);
public double div(double firstOperand, double secondOperand);
public double mul(double firstOperand, double... | double resultAdd = mCalculator.add(-1d, -17d);
assertThat(resultAdd, is(equalTo(-18d)));
}
} | [FOCAL] public double Calculator.add(double firstOperand, double secondOperand)
[CLASS] class Calculator
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[INPUTS] branches=- | result=firstOperand, secondOperand
[DATAFLOW] firstOperand@param->L2; secondOperand@param->L2
[CLASS-MEMBERS] double sub(dou... | /* static context
[FOCAL] public double Calculator.add(double firstOperand, double secondOperand)
[INPUTS] branches=- | result=firstOperand, secondOperand
*/
| /* static context
[FOCAL] public double Calculator.add(double firstOperand, double secondOperand)
[INPUTS] branches=- | result=firstOperand, secondOperand
*/
class Calculator {
public double add(double firstOperand, double secondOperand) {
return firstOperand + secondOperand;
}
public double sub(d... | true | ok | {"focal": {"class": "Calculator", "name": "add", "signature": "double add(double firstOperand, double secondOperand)", "start_line": 3, "modifiers": "public", "params": [{"name": "firstOperand", "type": "double"}, {"name": "secondOperand", "type": "double"}], "return_type": "double"}, "class_info": {"name": "Calculator... |
75277003_45 | class TbChangeOriginatorNode extends TbAbstractTransformNode {
@Override
public void init(TbContext ctx, TbNodeConfiguration configuration) throws TbNodeException {
this.config = TbNodeUtils.convert(configuration, TbChangeOriginatorNodeConfiguration.class);
validateConfig(config);
setCo... | init();
AssetId assetId = new AssetId(Uuids.timeBased());
CustomerId customerId = new CustomerId(Uuids.timeBased());
Asset asset = new Asset();
asset.setCustomerId(customerId);
RuleChainId ruleChainId = new RuleChainId(Uuids.timeBased());
RuleNodeId ruleNodeId = ... | [FOCAL] @Override public void TbChangeOriginatorNode.init(TbContext ctx, TbNodeConfiguration configuration)
[CLASS] class TbChangeOriginatorNode extends TbAbstractTransformNode
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void validateConfig(TbChangeOriginatorNodeConfiguration c... | /* static context
[FOCAL] @Override public void TbChangeOriginatorNode.init(TbContext ctx, TbNodeConfiguration configuration)
[INPUTS] branches=- | result=- | unused=ctx
[STATE] config
[EXCEPTIONS] declares TbNodeException
[CALLS-INTERNAL] void validateConfig(TbChangeOriginatorNodeConfiguration conf)
[FIELDS] write=con... | /* static context
[FOCAL] @Override public void TbChangeOriginatorNode.init(TbContext ctx, TbNodeConfiguration configuration)
[INPUTS] branches=- | result=- | unused=ctx
[STATE] config
[EXCEPTIONS] declares TbNodeException
[CALLS-INTERNAL] void validateConfig(TbChangeOriginatorNodeConfiguration conf)
[FIELDS] write=con... | true | ok | {"focal": {"class": "TbChangeOriginatorNode", "name": "init", "signature": "void init(TbContext ctx, TbNodeConfiguration configuration) throws TbNodeException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "ctx", "type": "TbContext"}, {"name": "configuration", "type": "TbNodeConfiguration"}], "... |
75368166_21 | class PersistenceManager {
public boolean createDirectoryStructure(String directoryPath) {
File directory = new File(directoryPath);
if (directory.exists()) {
throw new IllegalArgumentException("\"" + directoryPath + "\" already exists.");
}
return directory.mkdirs();
}
}
class PersistenceManagerTest ... | final String path = "directoryPath";
File fileMock = createMock(File.class);
PersistenceManager tested = new PersistenceManager();
expectNew(File.class, path).andReturn(fileMock);
expect(fileMock.exists()).andReturn(false);
expect(fileMock.mkdirs()).andReturn(true);
replay(fileMock, File.class);
as... | [FOCAL] public boolean PersistenceManager.createDirectoryStructure(String directoryPath)
[CLASS] class PersistenceManager
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] File.exists/0, File.mkdirs/0
[NEW] File, IllegalArgumentException
[EXCEPTIONS] throws IllegalArgumentException
[... | /* static context
[FOCAL] public boolean PersistenceManager.createDirectoryStructure(String directoryPath)
[THROWS-WHEN] IllegalArgumentException when directory.exists()
[PATH1] if(directory.exists())=T -> throw new IllegalArgumentException("\"" + directoryPath + "\" already exi...
[PATH2] if(directory.exists())=F -> r... | /* static context
[FOCAL] public boolean PersistenceManager.createDirectoryStructure(String directoryPath)
[THROWS-WHEN] IllegalArgumentException when directory.exists()
[PATH1] if(directory.exists())=T -> throw new IllegalArgumentException("\"" + directoryPath + "\" already exi...
[PATH2] if(directory.exists())=F -> r... | true | ok | {"focal": {"class": "PersistenceManager", "name": "createDirectoryStructure", "signature": "boolean createDirectoryStructure(String directoryPath)", "start_line": 3, "modifiers": "public", "params": [{"name": "directoryPath", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "PersistenceManager", "k... |
75383441_0 | class MainPresenter extends MainContract.PresenterViewOperations {
@Override
void onContinue(final String firstName, final String lastName) {
onView(new ViewAction<MainContract.ViewOperations>() {
@Override
public void onAction(MainContract.ViewOperations view) {
... | presenter.onContinue(null, null);
verify(view, times(1)).showFirstNameError();
verify(view, times(1)).showLastNameError();
}
} | [FOCAL] @Override void MainPresenter.onContinue(String firstName, String lastName)
[CLASS] class MainPresenter extends MainContract.PresenterViewOperations
[METRICS] loc=23 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] void saveDetails(String firstName, String lastName)
[CALLS-EXTERNAL] onView/1... | /* static context
[FOCAL] @Override void MainPresenter.onContinue(String firstName, String lastName)
[COLLABORATORS] field view:MainMVP.ViewOperations showFirstNameError/0,showLastNameError/0
[CALLS-INTERNAL] void saveDetails(String firstName, String lastName)
[FIELDS] read=view:MainMVP.ViewOperations
[NEW] ViewAction<... | /* static context
[FOCAL] @Override void MainPresenter.onContinue(String firstName, String lastName)
[COLLABORATORS] field view:MainMVP.ViewOperations showFirstNameError/0,showLastNameError/0
[CALLS-INTERNAL] void saveDetails(String firstName, String lastName)
[FIELDS] read=view:MainMVP.ViewOperations
[NEW] ViewAction<... | true | ok | {"focal": {"class": "MainPresenter", "name": "onContinue", "signature": "void onContinue(String firstName, String lastName)", "start_line": 3, "modifiers": "@Override", "params": [{"name": "firstName", "type": "String"}, {"name": "lastName", "type": "String"}], "return_type": "void"}, "class_info": {"name": "MainPresen... |
75386501_1 | class JsonObjectLoader {
public JsonObject loadOptions(String filename) {
return loadOptions(defaultRootPath, filename);
}
@SneakyThrows public T loadOptions(String filename, Class<T> optionClazz);
@SneakyThrows(IOException.class) public JsonObject loadOptions(String defaultRootPath, String filename);
... |
JsonObject jsonObject = my(JsonObjectLoader.class).loadOptions("VertxOptions.json");
Assert.assertNotNull(jsonObject);
Assert.assertTrue(jsonObject.getBoolean("clustered"));
VertxOptions vertxOptions = my(JsonObjectLoader.class).loadOptions("VertxOptions.json", VertxOptions.class);
Assert.assertNo... | [FOCAL] public JsonObject JsonObjectLoader.loadOptions(String filename)
[CLASS] class JsonObjectLoader
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] T loadOptions(String filename, Class<T> optionClazz)
[INPUTS] branches=- | result=filename
[DATAFLOW] filename@param->L3
[CLASS-MEM... | /* static context
[FOCAL] public JsonObject JsonObjectLoader.loadOptions(String filename)
[INPUTS] branches=- | result=filename
[CALLS-INTERNAL] T loadOptions(String filename, Class<T> optionClazz)
*/
| /* static context
[FOCAL] public JsonObject JsonObjectLoader.loadOptions(String filename)
[INPUTS] branches=- | result=filename
[CALLS-INTERNAL] T loadOptions(String filename, Class<T> optionClazz)
*/
class JsonObjectLoader {
public JsonObject loadOptions(String filename) {
return loadOptions(defaultRootPath, f... | true | ok | {"focal": {"class": "JsonObjectLoader", "name": "loadOptions", "signature": "JsonObject loadOptions(String filename)", "start_line": 3, "modifiers": "public", "params": [{"name": "filename", "type": "String"}], "return_type": "JsonObject"}, "class_info": {"name": "JsonObjectLoader", "kind": "class", "modifiers": "", "s... |
75608943_0 | class SmurfAssembler {
public static SmurfR toRepresentation(Smurf smurf) {
return new SmurfR(smurf.getId(), smurf.getName(), smurf.getCreationDate());
}
}
class SmurfAssemblerTest {
@Test
public void canAssembleASmurfRFromASmurfEntity() throws Exception {
| LocalDate now = LocalDate.now();
Smurf smurf = SmurfTestBuilder.aDefaultSmurf().withCreationDate(now).build();
SmurfR smurfR = SmurfAssembler.toRepresentation(smurf);
SmurfR expectedSmurfR = SmurfRTestBuilder.aSmurfR()
.withName(SmurfTestBuilder.NAME)
.wi... | [FOCAL] public static SmurfR SmurfAssembler.toRepresentation(Smurf smurf)
[CLASS] class SmurfAssembler
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Smurf.getId/0, Smurf.getName/0, Smurf.getCreationDate/0
[NEW] SmurfR
[INPUTS] branches=- | result=smurf
[COLLABORATORS] param smurf... | /* static context
[FOCAL] public static SmurfR SmurfAssembler.toRepresentation(Smurf smurf)
[INPUTS] branches=- | result=smurf
[COLLABORATORS] param smurf:Smurf getId/0,getName/0,getCreationDate/0
[NEW] SmurfR
[CALLS-EXTERNAL] Smurf.getId/0, Smurf.getName/0, Smurf.getCreationDate/0
*/
| /* static context
[FOCAL] public static SmurfR SmurfAssembler.toRepresentation(Smurf smurf)
[INPUTS] branches=- | result=smurf
[COLLABORATORS] param smurf:Smurf getId/0,getName/0,getCreationDate/0
[NEW] SmurfR
[CALLS-EXTERNAL] Smurf.getId/0, Smurf.getName/0, Smurf.getCreationDate/0
*/
class SmurfAssembler {
public... | true | ok | {"focal": {"class": "SmurfAssembler", "name": "toRepresentation", "signature": "SmurfR toRepresentation(Smurf smurf)", "start_line": 3, "modifiers": "public static", "params": [{"name": "smurf", "type": "Smurf"}], "return_type": "SmurfR"}, "class_info": {"name": "SmurfAssembler", "kind": "class", "modifiers": "", "supe... |
75626745_2 | class ProviderFactory {
public static UserInfoProvider getOpenIdProvider(String providerType) {
UserInfoProvider openIdProvider;
String s = providerType.toUpperCase();
if (s.equals("AZURE")) {
openIdProvider = new AzureAD();
} else {
openIdProvider = new UserInfoProvider();
}
return openId... | UserInfoProvider openIdProvider = ProviderFactory.getOpenIdProvider("");
assertTrue(openIdProvider.getClass() == UserInfoProvider.class);
}
} | [FOCAL] public static UserInfoProvider ProviderFactory.getOpenIdProvider(String providerType)
[CLASS] class ProviderFactory
[METRICS] loc=15 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] String.toUpperCase/0, String.equals/1
[NEW] AzureAD, UserInfoProvider
[PATH1] if(s.equals("AZURE"))=T -> retu... | /* static context
[FOCAL] public static UserInfoProvider ProviderFactory.getOpenIdProvider(String providerType)
[PATH1] if(s.equals("AZURE"))=T -> return openIdProvider
[PATH2] if(s.equals("AZURE"))=F -> return openIdProvider
[INPUTS] branches=providerType | result=-
[NEW] AzureAD, UserInfoProvider
[CALLS-EXTERNAL] Str... | /* static context
[FOCAL] public static UserInfoProvider ProviderFactory.getOpenIdProvider(String providerType)
[PATH1] if(s.equals("AZURE"))=T -> return openIdProvider
[PATH2] if(s.equals("AZURE"))=F -> return openIdProvider
[INPUTS] branches=providerType | result=-
[NEW] AzureAD, UserInfoProvider
[CALLS-EXTERNAL] Str... | true | ok | {"focal": {"class": "ProviderFactory", "name": "getOpenIdProvider", "signature": "UserInfoProvider getOpenIdProvider(String providerType)", "start_line": 3, "modifiers": "public static", "params": [{"name": "providerType", "type": "String"}], "return_type": "UserInfoProvider"}, "class_info": {"name": "ProviderFactory",... |
75643631_20 | class BadgeShape {
public Rect draw(@NonNull Canvas canvas, @NonNull Rect bounds, @NonNull Paint paint, int layoutDirection) {
float width = bounds.width() * scale;
float height = bounds.height() * scale;
if (width < height * aspectRatio) {
height = width / aspectRatio;
... | region.set(0, 0, 48, 48);
TestBadgeShape badgeShape = new TestBadgeShape(1, 1, 0);
Rect rect = badgeShape.draw(canvas, region, paint, 0);
badgeShape.assertRegion(rect);
badgeShape.assertRegion(region);
}
} | [FOCAL] public Rect BadgeShape.draw(Canvas canvas, Rect bounds, Paint paint, int layoutDirection)
[CLASS] class BadgeShape
[METRICS] loc=12 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] void applyGravity(int width, int height, Rect bounds, int layoutDirection); void onDraw(Canvas canvas, Rect re... | /* static context
[FOCAL] public Rect BadgeShape.draw(Canvas canvas, Rect bounds, Paint paint, int layoutDirection)
[PATH1] if(width < height * aspectRatio)=T -> return rect
[PATH2] if(width < height * aspectRatio)=F -> return rect
[INPUTS] branches=bounds | result=-
[COLLABORATORS] param bounds:Rect width/0,height/0
[... | /* static context
[FOCAL] public Rect BadgeShape.draw(Canvas canvas, Rect bounds, Paint paint, int layoutDirection)
[PATH1] if(width < height * aspectRatio)=T -> return rect
[PATH2] if(width < height * aspectRatio)=F -> return rect
[INPUTS] branches=bounds | result=-
[COLLABORATORS] param bounds:Rect width/0,height/0
[... | true | ok | {"focal": {"class": "BadgeShape", "name": "draw", "signature": "Rect draw(Canvas canvas, Rect bounds, Paint paint, int layoutDirection)", "start_line": 3, "modifiers": "public", "params": [{"name": "canvas", "type": "Canvas"}, {"name": "bounds", "type": "Rect"}, {"name": "paint", "type": "Paint"}, {"name": "layoutDirec... |
75661534_33 | class AwsHttpServletRequest implements HttpServletRequest {
protected List<HeaderValue> parseHeaderValue(String headerValue) {
return parseHeaderValue(headerValue, HEADER_VALUE_SEPARATOR, HEADER_QUALIFIER_SEPARATOR);
}
AwsHttpServletRequest(Context lambdaContext);
public AwsHttpServletRespo... | AwsHttpServletRequest context = new AwsProxyHttpServletRequest(null,null,null);
String value = Base64.getUrlEncoder().encodeToString("a".getBytes());
List<AwsHttpServletRequest.HeaderValue> result = context.parseHeaderValue(value);
assertTrue(result.size() > 0);
assertEquals("Y... | [FOCAL] protected List<HeaderValue> AwsHttpServletRequest.parseHeaderValue(String headerValue)
[CLASS] class AwsHttpServletRequest implements HttpServletRequest
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] List<HeaderValue> parseHeaderValue(String headerValue, String valueSepara... | /* static context
[FOCAL] protected List<HeaderValue> AwsHttpServletRequest.parseHeaderValue(String headerValue)
[INPUTS] branches=- | result=headerValue
[CALLS-INTERNAL] List<HeaderValue> parseHeaderValue(String headerValue, String valueSeparator, String qualifierSeparator)
*/
| /* static context
[FOCAL] protected List<HeaderValue> AwsHttpServletRequest.parseHeaderValue(String headerValue)
[INPUTS] branches=- | result=headerValue
[CALLS-INTERNAL] List<HeaderValue> parseHeaderValue(String headerValue, String valueSeparator, String qualifierSeparator)
*/
class AwsHttpServletRequest implements Ht... | true | ok | {"focal": {"class": "AwsHttpServletRequest", "name": "parseHeaderValue", "signature": "List<HeaderValue> parseHeaderValue(String headerValue)", "start_line": 3, "modifiers": "protected", "params": [{"name": "headerValue", "type": "String"}], "return_type": "List<HeaderValue>"}, "class_info": {"name": "AwsHttpServletReq... |
75718771_0 | class Computation extends IntentService {
@Override
protected void onHandleIntent(Intent intent) {
Intent resultIntent = new Intent(RESULT_INTENT_ACTION);
Integer result = new Computer().compute();
resultIntent.putExtra(RESULT_VALUE_INTENT_EXTRA_KEY, result);
sendBroadcast(resul... | final List<Intent> receivedIntents = new ArrayList<>();
BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
receivedIntents.add(intent);
}
};
IntentFilter fi... | [FOCAL] @Override protected void Computation.onHandleIntent(Intent intent)
[CLASS] class Computation extends IntentService
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] new Computer().compute/0, Intent.putExtra/2, sendBroadcast/1 (inherited)
[NEW] Intent, Computer
[INPUTS] branch... | /* static context
[FOCAL] @Override protected void Computation.onHandleIntent(Intent intent)
[INPUTS] branches=- | result=- | unused=intent
[NEW] Intent, Computer
[CALLS-EXTERNAL] new Computer().compute/0, Intent.putExtra/2, sendBroadcast/1 (inherited)
*/
| /* static context
[FOCAL] @Override protected void Computation.onHandleIntent(Intent intent)
[INPUTS] branches=- | result=- | unused=intent
[NEW] Intent, Computer
[CALLS-EXTERNAL] new Computer().compute/0, Intent.putExtra/2, sendBroadcast/1 (inherited)
*/
class Computation extends IntentService {
@Override
pro... | true | ok | {"focal": {"class": "Computation", "name": "onHandleIntent", "signature": "void onHandleIntent(Intent intent)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "intent", "type": "Intent"}], "return_type": "void"}, "class_info": {"name": "Computation", "kind": "class", "modifiers": "", "supercla... |
75735839_5 | class AnnotationUtils extends CommonUtils {
public String convertSpecialCharacters(String input) {
String returnInput = input;
if (null != input && input.contains(":")) {
List<String> inputList = getListFromSpaceSeparatedTerms(input);
for (String replacement : inputList) {
if (replacement.contains(... | String input = "http://www.emaple.com/ferd/lgg/";
String output = annotationUtils.convertSpecialCharacters(input);
LOG.info(input);
LOG.info(output);
assertEquals(output, "(\"http://www.emaple.com/ferd/lgg/\")");
input = "trt:ttttt";
output = annotationUtils.convertSpecialCharacters(input);
LOG.info(input);
L... | [FOCAL] public String AnnotationUtils.convertSpecialCharacters(String input)
[CLASS] class AnnotationUtils extends CommonUtils
[METRICS] loc=25 cc=5 branches=3 loops=1 returns=2 throws=0 nesting=4
[CALLS-EXTERNAL] String.contains/1, getListFromSpaceSeparatedTerms/1 (inherited), replacement.toLowerCase().substring/2, St... | /* static context
[FOCAL] public String AnnotationUtils.convertSpecialCharacters(String input)
[PATH1] if(null != input && input.contains(":"))=T -> foreach(String replacement : inputList)=T -> if(replacement.contains(":"))=T -> if(ArrayUtils.contains(SCHEMES, start))=T -> exit loop -> return returnInput
[PATH2] if(nul... | /* static context
[FOCAL] public String AnnotationUtils.convertSpecialCharacters(String input)
[PATH1] if(null != input && input.contains(":"))=T -> foreach(String replacement : inputList)=T -> if(replacement.contains(":"))=T -> if(ArrayUtils.contains(SCHEMES, start))=T -> exit loop -> return returnInput
[PATH2] if(nul... | true | ok | {"focal": {"class": "AnnotationUtils", "name": "convertSpecialCharacters", "signature": "String convertSpecialCharacters(String input)", "start_line": 3, "modifiers": "public", "params": [{"name": "input", "type": "String"}], "return_type": "String"}, "class_info": {"name": "AnnotationUtils", "kind": "class", "modifier... |
75753179_0 | class OrikaAutoConfiguration {
@ConditionalOnMissingBean
@Bean
public MapperFactoryBuilder<?, ?> orikaMapperFactoryBuilder() {
DefaultMapperFactory.Builder orikaMapperFactoryBuilder = new DefaultMapperFactory.Builder();
if (orikaProperties.getUseBuiltinConverters() != null) {
or... | assertThat(orikaMapperFactoryBuilder)
.isPresent()
.hasValueSatisfying(value ->
assertThat(value)
.hasFieldOrPropertyWithValue("useBuiltinConverters", true)
.hasFieldOrPropertyWithValue("useAutoMapping", ... | [FOCAL] @ConditionalOnMissingBean @Bean public MapperFactoryBuilder<?, ?> OrikaAutoConfiguration.orikaMapperFactoryBuilder()
[CLASS] class OrikaAutoConfiguration
[METRICS] loc=28 cc=7 branches=6 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] Optional<OrikaProperties>.getUseBuiltinConverters/0, DefaultMapperFacto... | /* static context
[FOCAL] @ConditionalOnMissingBean @Bean public MapperFactoryBuilder<?, ?> OrikaAutoConfiguration.orikaMapperFactoryBuilder()
[PATH1] if(orikaProperties.getUseBuiltinConverters() != null)=T -> if(orikaProperties.getUseAutoMapping() != null)=T -> if(orikaProperties.getMapNulls() != null)=T -> if(orikaPr... | /* static context
[FOCAL] @ConditionalOnMissingBean @Bean public MapperFactoryBuilder<?, ?> OrikaAutoConfiguration.orikaMapperFactoryBuilder()
[PATH1] if(orikaProperties.getUseBuiltinConverters() != null)=T -> if(orikaProperties.getUseAutoMapping() != null)=T -> if(orikaProperties.getMapNulls() != null)=T -> if(orikaPr... | true | ok | {"focal": {"class": "OrikaAutoConfiguration", "name": "orikaMapperFactoryBuilder", "signature": "MapperFactoryBuilder<?, ?> orikaMapperFactoryBuilder()", "start_line": 3, "modifiers": "@ConditionalOnMissingBean @Bean public", "params": [], "return_type": "MapperFactoryBuilder<?, ?>"}, "class_info": {"name": "OrikaAutoC... |
75873961_0 | class CloneHelper {
public static <T> T cloneObject(T source) {
T cloned = null;
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream ous = new ObjectOutputStream(baos);
ous.writeObject(source);
ous.close();
... | AdrConfigurationServiceMock config = new AdrConfigurationServiceMock(null);
AdrIconDescriptor sourceIcon = config.getDefaultIcon();
AdrIconDescriptor cloned = CloneHelper.cloneObject(sourceIcon);
cloned.setComponentId(cloned.getComponentId() + 10341);
assertNotEquals(sourceIcon,c... | [FOCAL] public static T CloneHelper.cloneObject(T source)
[CLASS] class CloneHelper
[METRICS] loc=17 cc=2 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] ObjectOutputStream.writeObject/1, ObjectOutputStream.close/0, ByteArrayOutputStream.toByteArray/0, ObjectInputStream.readObject/0, log.error/2
[NEW] ... | /* static context
[FOCAL] public static T CloneHelper.cloneObject(T source)
[PATH1] try-body throws -> return cloned
[EXCEPTIONS] catches IOException | ClassNotFoundException e
[NEW] ByteArrayOutputStream, ObjectOutputStream, ByteArrayInputStream, ObjectInputStream
[CALLS-EXTERNAL] ObjectOutputStream.writeObject/1, Obj... | /* static context
[FOCAL] public static T CloneHelper.cloneObject(T source)
[PATH1] try-body throws -> return cloned
[EXCEPTIONS] catches IOException | ClassNotFoundException e
[NEW] ByteArrayOutputStream, ObjectOutputStream, ByteArrayInputStream, ObjectInputStream
[CALLS-EXTERNAL] ObjectOutputStream.writeObject/1, Obj... | true | ok | {"focal": {"class": "CloneHelper", "name": "cloneObject", "signature": "T cloneObject(T source)", "start_line": 3, "modifiers": "public static", "params": [{"name": "source", "type": "T"}], "return_type": "T"}, "class_info": {"name": "CloneHelper", "kind": "class", "modifiers": "", "superclass": null, "interfaces": nul... |
75879612_1 | class AnnotationMerger {
public void merge() {
mergeByCategory();
}
public AnnotationMerger(HpoDisease d1, HpoDisease d2, Ontology honto);
public void printToShell();
private void outputByCategory();
private void outputCategory(HpoCategory hcat);
private void printTerms(List<Term... | assertNotNull(CCAIDCMS_OMIM);
AnnotationMerger merger = new AnnotationMerger(CCAIDCMS_OMIM,CCAIDCMS_ORPHA,ontology);
merger.merge();
}
} | [FOCAL] public void AnnotationMerger.merge()
[CLASS] class AnnotationMerger
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void mergeByCategory()
[CLASS-MEMBERS] AnnotationMerger(HpoDisease d1, HpoDisease d2, Ontology honto); void printToShell(); void outputByCategory(); void outp... | /* static context
[FOCAL] public void AnnotationMerger.merge()
[CALLS-INTERNAL] void mergeByCategory()
*/
| /* static context
[FOCAL] public void AnnotationMerger.merge()
[CALLS-INTERNAL] void mergeByCategory()
*/
class AnnotationMerger {
public void merge() {
mergeByCategory();
}
public AnnotationMerger(HpoDisease d1, HpoDisease d2, Ontology honto);
public void printToShell();
private void ou... | true | ok | {"focal": {"class": "AnnotationMerger", "name": "merge", "signature": "void merge()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "AnnotationMerger", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "Osteomesopyknosis_... |
75939912_4 | class EnvironmentVariables {
public static List<String> configurationNames() {
return configurationNames(System.getenv().keySet());
}
public static Optional<String> getValue(String configuration, String key);
public static Optional<JsonObject> getConfiguration(String configurationName);
st... | Map<String, String> entries = new HashMap<>();
entries.put("firehose.sampleservice.uri", "http://sample-service:8080/sample-service/resources/metrics");
entries.put("another.sampleservice.uri", "http://another:8080/another/resources/metrics");
entries.put("firehose.another.uri", "http://... | [FOCAL] public static List<String> EnvironmentVariables.configurationNames()
[CLASS] class EnvironmentVariables
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] List<String> configurationNames(Set<String> keys)
[CALLS-EXTERNAL] System.getenv().keySet/0, System.getenv/0
[CLASS-MEMBER... | /* static context
[FOCAL] public static List<String> EnvironmentVariables.configurationNames()
[CALLS-INTERNAL] List<String> configurationNames(Set<String> keys)
[CALLS-EXTERNAL] System.getenv().keySet/0, System.getenv/0
*/
| /* static context
[FOCAL] public static List<String> EnvironmentVariables.configurationNames()
[CALLS-INTERNAL] List<String> configurationNames(Set<String> keys)
[CALLS-EXTERNAL] System.getenv().keySet/0, System.getenv/0
*/
class EnvironmentVariables {
public static List<String> configurationNames() {
retu... | true | ok | {"focal": {"class": "EnvironmentVariables", "name": "configurationNames", "signature": "List<String> configurationNames()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "List<String>"}, "class_info": {"name": "EnvironmentVariables", "kind": "class", "modifiers": "", "superclass": null, "i... |
75974381_3 | class SingleWeaver {
public static boolean methodAnnotatedWithRxLogSingle(ProceedingJoinPoint joinPoint) {
return ((MethodSignature) joinPoint.getSignature()).getReturnType() == Single.class;
}
public Object weaveAroundJoinPoint(ProceedingJoinPoint joinPoint, Logger logger);
private SingleWeaver singleWe... | final boolean result = singleWeaver.methodAnnotatedWithRxLogSingle(proceedingJoinPoint);
assertThat(result).isTrue();
}
} | [FOCAL] public static boolean SingleWeaver.methodAnnotatedWithRxLogSingle(ProceedingJoinPoint joinPoint)
[CLASS] class SingleWeaver
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] ((MethodSignature) joinPoint.getSignature()).getReturnType/0, ProceedingJoinPoint.getSignature/0
[INPU... | /* static context
[FOCAL] public static boolean SingleWeaver.methodAnnotatedWithRxLogSingle(ProceedingJoinPoint joinPoint)
[INPUTS] branches=- | result=joinPoint
[COLLABORATORS] param joinPoint:ProceedingJoinPoint getSignature/0
[CALLS-EXTERNAL] ((MethodSignature) joinPoint.getSignature()).getReturnType/0, ProceedingJo... | /* static context
[FOCAL] public static boolean SingleWeaver.methodAnnotatedWithRxLogSingle(ProceedingJoinPoint joinPoint)
[INPUTS] branches=- | result=joinPoint
[COLLABORATORS] param joinPoint:ProceedingJoinPoint getSignature/0
[CALLS-EXTERNAL] ((MethodSignature) joinPoint.getSignature()).getReturnType/0, ProceedingJo... | true | ok | {"focal": {"class": "SingleWeaver", "name": "methodAnnotatedWithRxLogSingle", "signature": "boolean methodAnnotatedWithRxLogSingle(ProceedingJoinPoint joinPoint)", "start_line": 3, "modifiers": "public static", "params": [{"name": "joinPoint", "type": "ProceedingJoinPoint"}], "return_type": "boolean"}, "class_info": {"... |
75985902_3 | class HasherFactory {
public static Hasher createHasher(String hasherType) {
Hasher hasher;
switch (hasherType) {
case "MD5":
hasher = new MD5Hasher();
break;
case "SHA1":
hasher = new SHA1Hasher();
break;
... | Hasher hasher = HasherFactory.createHasher("CRC32b");
assertThat(hasher.getClass().getTypeName(), is(CRC32Hasher.class.getTypeName()));
}
} | [FOCAL] public static Hasher HasherFactory.createHasher(String hasherType)
[CLASS] class HasherFactory
[METRICS] loc=27 cc=7 branches=1 loops=0 returns=1 throws=0 nesting=1
[NEW] MD5Hasher, SHA1Hasher, SHA256Hasher, SHA384Hasher, Adler32Hasher, CRC32Hasher, SHA512Hasher
[PATH1] switch(hasherType)=case "MD5" -> return h... | /* static context
[FOCAL] public static Hasher HasherFactory.createHasher(String hasherType)
[PATH1] switch(hasherType)=case "MD5" -> return hasher
[PATH2] switch(hasherType)=case "SHA1" -> return hasher
[PATH3] switch(hasherType)=case "SHA256" -> return hasher
[PATH4] switch(hasherType)=case "SHA384" -> return hasher
... | /* static context
[FOCAL] public static Hasher HasherFactory.createHasher(String hasherType)
[PATH1] switch(hasherType)=case "MD5" -> return hasher
[PATH2] switch(hasherType)=case "SHA1" -> return hasher
[PATH3] switch(hasherType)=case "SHA256" -> return hasher
[PATH4] switch(hasherType)=case "SHA384" -> return hasher
... | true | ok | {"focal": {"class": "HasherFactory", "name": "createHasher", "signature": "Hasher createHasher(String hasherType)", "start_line": 3, "modifiers": "public static", "params": [{"name": "hasherType", "type": "String"}], "return_type": "Hasher"}, "class_info": {"name": "HasherFactory", "kind": "class", "modifiers": "", "su... |
75990052_9 | class UrlUtils {
public static boolean isInternalErrorURL(final String url) {
return "data:text/html;charset=utf-8;base64,".equals(url);
}
public static String normalize(@NonNull String input);
public static boolean isUrl(String url);
public static boolean isValidSearchQueryUrl(String url)... | assertTrue(UrlUtils.isInternalErrorURL("data:text/html;charset=utf-8;base64,"));
assertFalse(UrlUtils.isInternalErrorURL("http://www.mozilla.org"));
assertFalse(UrlUtils.isInternalErrorURL("https://www.mozilla.org/en-us/about"));
assertFalse(UrlUtils.isInternalErrorURL("www.mozilla.org"... | [FOCAL] public static boolean UrlUtils.isInternalErrorURL(String url)
[CLASS] class UrlUtils
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] "data:text/html;charset=utf-8;base64,".equals/1
[INPUTS] branches=- | result=url
[DATAFLOW] url@param->L2
[CLASS-MEMBERS] String normalize(St... | /* static context
[FOCAL] public static boolean UrlUtils.isInternalErrorURL(String url)
[INPUTS] branches=- | result=url
[CALLS-EXTERNAL] "data:text/html;charset=utf-8;base64,".equals/1
*/
| /* static context
[FOCAL] public static boolean UrlUtils.isInternalErrorURL(String url)
[INPUTS] branches=- | result=url
[CALLS-EXTERNAL] "data:text/html;charset=utf-8;base64,".equals/1
*/
class UrlUtils {
public static boolean isInternalErrorURL(final String url) {
return "data:text/html;charset=utf-8;bas... | true | ok | {"focal": {"class": "UrlUtils", "name": "isInternalErrorURL", "signature": "boolean isInternalErrorURL(String url)", "start_line": 3, "modifiers": "public static", "params": [{"name": "url", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "UrlUtils", "kind": "class", "modifiers": "", "superclass":... |
76003412_48 | class EfFindFilesInDirByPattern extends EvaluationFunction {
@Override
public ValueEvaluation evaluate() {
try {
checkContractCompliance();
boolean errorIfDirNull = true;
List<ValueParam> paramErrorIfDirNull = valueParams.getParams(PARAM_ERROR_IF_DIR_NULL);
... | EvaluationFunction evFunction = engine.buildEvaluationFunction(FUNCTION_NAME)
.withValueParam(PARAM_DIR, ValueType.FILE, new ValueEvaluation(PSP_DIR_FILE))
.withValueParamByReference(PARAM_DIR, ValueType.FILE, PSP_VAR);
//TODO: to by melo byt v ramci kontroly kotraktu, tj... | [FOCAL] @Override public ValueEvaluation EfFindFilesInDirByPattern.evaluate()
[CLASS] class EfFindFilesInDirByPattern extends EvaluationFunction
[METRICS] loc=50 cc=12 branches=8 loops=1 returns=9 throws=0 nesting=5
[CALLS-EXTERNAL] checkContractCompliance/0 (inherited), valueParams.getParams/1, List<ValueParam>.isEmpt... | /* static context
[FOCAL] @Override public ValueEvaluation EfFindFilesInDirByPattern.evaluate()
[PATH1] if(!paramErrorIfDirNull.isEmpty())=T -> if(dir == null)=F -> if(!dir.exists())=F -> if(!dir.isDirectory())=F -> if(!dir.canRead())=F -> if(!patternParam.isOk())=F -> foreach(File file : files)=T -> if(patternParam.ma... | /* static context
[FOCAL] @Override public ValueEvaluation EfFindFilesInDirByPattern.evaluate()
[PATH1] if(!paramErrorIfDirNull.isEmpty())=T -> if(dir == null)=F -> if(!dir.exists())=F -> if(!dir.isDirectory())=F -> if(!dir.canRead())=F -> if(!patternParam.isOk())=F -> foreach(File file : files)=T -> if(patternParam.ma... | true | ok | {"focal": {"class": "EfFindFilesInDirByPattern", "name": "evaluate", "signature": "ValueEvaluation evaluate()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "ValueEvaluation"}, "class_info": {"name": "EfFindFilesInDirByPattern", "kind": "class", "modifiers": "", "superclass": "Evaluati... |
76028699_0 | class ApiBaseResponse extends GenericErrorContainer implements ApiResponse {
@Override
public String getVersion() {
return version;
}
public ApiBaseResponse();
@Override public String getSid();
@Override public void setSid(String sid);
@Override public void insertData(String key, Object obj);
@O... | String result = apiBaseResponse.getVersion();
assertEquals("1.0.0", result);
}
} | [FOCAL] @Override public String ApiBaseResponse.getVersion()
[CLASS] class ApiBaseResponse extends GenericErrorContainer implements ApiResponse
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] ApiBaseResponse(); String getSid(); void setSid(String sid); void insertData(String key, Ob... | /* static context
[FOCAL] @Override public String ApiBaseResponse.getVersion()
*/
| /* static context
[FOCAL] @Override public String ApiBaseResponse.getVersion()
*/
class ApiBaseResponse extends GenericErrorContainer implements ApiResponse {
@Override
public String getVersion() {
return version;
}
public ApiBaseResponse();
@Override public String getSid();
@Override public void se... | true | ok | {"focal": {"class": "ApiBaseResponse", "name": "getVersion", "signature": "String getVersion()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "ApiBaseResponse", "kind": "class", "modifiers": "", "superclass": "GenericErrorContainer", "interfaces": "Api... |
76093141_6 | class AlipayRunner {
public String tradePrecreate(long seckillId) {
Seckill seckill = redisService.getSeckill(seckillId);
Goods goods = goodsMapper.selectById(seckill.getGoodsId());
// 需保证商户系统端不能重复,建议通过数据库sequence生成,
String outTradeNo = "tradeprecreate" + System.currentTimeMillis()
... | assertTrue(StringUtils.isNotBlank(alipayRunner.tradePrecreate(1001L)));
}
} | [FOCAL] public String AlipayRunner.tradePrecreate(long seckillId)
[CLASS] class AlipayRunner
[METRICS] loc=27 cc=3 branches=1 loops=0 returns=2 throws=0 nesting=2
[CALLS-INTERNAL] Config getOptions()
[CALLS-EXTERNAL] redisService.getSeckill/1, goodsMapper.selectById/1, Seckill.getGoodsId/0, System.currentTimeMillis/0, ... | /* static context
[FOCAL] public String AlipayRunner.tradePrecreate(long seckillId)
[PATH1] try-body throws -> return null
[PATH2] if(ResponseChecker.success(response))=T -> return finalQrcodeImagePath.split("/")[finalQrcodeImagePath.split("/").len...
[PATH3] if(ResponseChecker.success(response))=F -> return null
[INPU... | /* static context
[FOCAL] public String AlipayRunner.tradePrecreate(long seckillId)
[PATH1] try-body throws -> return null
[PATH2] if(ResponseChecker.success(response))=T -> return finalQrcodeImagePath.split("/")[finalQrcodeImagePath.split("/").len...
[PATH3] if(ResponseChecker.success(response))=F -> return null
[INPU... | true | ok | {"focal": {"class": "AlipayRunner", "name": "tradePrecreate", "signature": "String tradePrecreate(long seckillId)", "start_line": 3, "modifiers": "public", "params": [{"name": "seckillId", "type": "long"}], "return_type": "String"}, "class_info": {"name": "AlipayRunner", "kind": "class", "modifiers": "", "superclass": ... |
76099157_7 | class Substitutor {
public String replace(final String source) {
if (source == null) {
return null;
}
final StringBuilder builder = new StringBuilder(source);
if (substitute(builder, 0, source.length(), null) <= 0) {
return source;
}
return re... | assertEquals("pref-bar-suff", new Substitutor(singletonMap("foo", "bar")).replace("pref-${foo}-suff"));
}
} | [FOCAL] public String Substitutor.replace(String source)
[CLASS] class Substitutor
[METRICS] loc=10 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[CALLS-INTERNAL] int substitute(StringBuilder buf, int offset, int length, List<String> priorVariables)
[CALLS-EXTERNAL] String.length/0, replace/1 (inherited), String... | /* static context
[FOCAL] public String Substitutor.replace(String source)
[PATH1] if(source == null)=F -> if(substitute(builder, 0, source.length(), null) <= 0)=T -> return source
[PATH2] if(source == null)=T -> return null
[PATH3] if(source == null)=F -> if(substitute(builder, 0, source.length(), null) <= 0)=F -> ret... | /* static context
[FOCAL] public String Substitutor.replace(String source)
[PATH1] if(source == null)=F -> if(substitute(builder, 0, source.length(), null) <= 0)=T -> return source
[PATH2] if(source == null)=T -> return null
[PATH3] if(source == null)=F -> if(substitute(builder, 0, source.length(), null) <= 0)=F -> ret... | true | ok | {"focal": {"class": "Substitutor", "name": "replace", "signature": "String replace(String source)", "start_line": 3, "modifiers": "public", "params": [{"name": "source", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Substitutor", "kind": "class", "modifiers": "", "superclass": null, "interfaces"... |
76112580_1 | class FluxController {
@GetMapping("/status")
@ResponseStatus(HttpStatus.CREATED)
public Mono<String> status() {
return Mono.just("Status");
}
@GetMapping("/inject") public Mono<String> inject();
@GetMapping("/path/{param}") public Mono<String> pathParam(@PathVariable("param") String parameter);
@GetMapping(... | this.webTestClient.get().uri("/complex/status").exchange().expectStatus().isCreated().expectBody(String.class)
.value((body) -> assertEquals(body, "Status"));
}
} | [FOCAL] @GetMapping("/status") @ResponseStatus(HttpStatus.CREATED) public Mono<String> FluxController.status()
[CLASS] class FluxController
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Mono.just/1
[CLASS-MEMBERS] Mono<String> inject(); Mono<String> pathParam(String parameter); M... | /* static context
[FOCAL] @GetMapping("/status") @ResponseStatus(HttpStatus.CREATED) public Mono<String> FluxController.status()
[CALLS-EXTERNAL] Mono.just/1
*/
| /* static context
[FOCAL] @GetMapping("/status") @ResponseStatus(HttpStatus.CREATED) public Mono<String> FluxController.status()
[CALLS-EXTERNAL] Mono.just/1
*/
class FluxController {
@GetMapping("/status")
@ResponseStatus(HttpStatus.CREATED)
public Mono<String> status() {
return Mono.just("Status");
}
@GetMap... | true | ok | {"focal": {"class": "FluxController", "name": "status", "signature": "Mono<String> status()", "start_line": 3, "modifiers": "@GetMapping(\"/status\") @ResponseStatus(HttpStatus.CREATED) public", "params": [], "return_type": "Mono<String>"}, "class_info": {"name": "FluxController", "kind": "class", "modifiers": "", "sup... |
76160515_0 | class Option implements TraversableOnce<A>, Serializable, Equals, Function0<A>, Monad<A> {
public static <A> Option<A> of(A value) {
return value == null ? Option.none() : new Option<>(value);
}
private Option();
private Option(A value);
@SuppressWarnings("unchecked") public static Opti... | assertEquals(Option.of(0), Option.of(0));
}
} | [FOCAL] public static Option<A> Option.of(A value)
[CLASS] class Option implements TraversableOnce<A>, Serializable, Equals, Function0<A>, Monad<A>
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Option.none/0
[NEW] Option<>
[INPUTS] branches=- | result=value
[DATAFLOW] value@param... | /* static context
[FOCAL] public static Option<A> Option.of(A value)
[INPUTS] branches=- | result=value
[NEW] Option<>
[CALLS-EXTERNAL] Option.none/0
*/
| /* static context
[FOCAL] public static Option<A> Option.of(A value)
[INPUTS] branches=- | result=value
[NEW] Option<>
[CALLS-EXTERNAL] Option.none/0
*/
class Option implements TraversableOnce<A>, Serializable, Equals, Function0<A>, Monad<A> {
public static <A> Option<A> of(A value) {
return value == null ... | true | ok | {"focal": {"class": "Option", "name": "of", "signature": "Option<A> of(A value)", "start_line": 3, "modifiers": "public static", "params": [{"name": "value", "type": "A"}], "return_type": "Option<A>"}, "class_info": {"name": "Option", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "TraversableOnce<... |
76169459_0 | class SQLiteOperator {
public SaveOperation<T> save(final @NonNull T... objectsToInsert) {
final SQLiteDAO generated = getGeneratedDAO(null);
final SQLiteDAO<T>[] generatedObjects = new SQLiteDAO[objectsToInsert.length];
for (int i = 0; i < objectsToInsert.length; i++) {
generat... | SQLiteOperator<TestTable> operator = SQLiteOperator.from(getContext(), TestTable.class);
final TestTable table = new TestTable();
table.testString = "123";
table.testList = Arrays.asList("1", "2", "3");
table.testBoolean = true;
table.unique = 1;
table.testSeriali... | [FOCAL] public SaveOperation<T> SQLiteOperator.save(T... objectsToInsert)
[CLASS] class SQLiteOperator
[METRICS] loc=8 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] SQLiteDAO<T> getGeneratedDAO(T generator)
[NEW] SaveOperation<>
[PATH1] for(i < objectsToInsert.length)=T -> exit loop -> return ne... | /* static context
[FOCAL] public SaveOperation<T> SQLiteOperator.save(T... objectsToInsert)
[PATH1] for(i < objectsToInsert.length)=T -> exit loop -> return new SaveOperation<>(mContext, generated, generatedObjects)
[PATH2] for(i < objectsToInsert.length)=F -> return new SaveOperation<>(mContext, generated, generatedOb... | /* static context
[FOCAL] public SaveOperation<T> SQLiteOperator.save(T... objectsToInsert)
[PATH1] for(i < objectsToInsert.length)=T -> exit loop -> return new SaveOperation<>(mContext, generated, generatedObjects)
[PATH2] for(i < objectsToInsert.length)=F -> return new SaveOperation<>(mContext, generated, generatedOb... | true | ok | {"focal": {"class": "SQLiteOperator", "name": "save", "signature": "SaveOperation<T> save(T... objectsToInsert)", "start_line": 3, "modifiers": "public", "params": [{"name": "objectsToInsert", "type": "T..."}], "return_type": "SaveOperation<T>"}, "class_info": {"name": "SQLiteOperator", "kind": "class", "modifiers": ""... |
76177416_22 | class StringToDurationConverter implements Converter<String, Duration> {
@Override
public Duration convert(String source) {
try {
if (ISO8601.matcher(source).matches()) {
return Duration.parse(source);
}
Matcher matcher = SIMPLE.matcher(source);
... | assertThat(convert("10")).isEqualTo(Duration.ofMillis(10));
assertThat(convert("+10")).isEqualTo(Duration.ofMillis(10));
assertThat(convert("-10")).isEqualTo(Duration.ofMillis(-10));
}
} | [FOCAL] @Override public Duration StringToDurationConverter.convert(String source)
[CLASS] class StringToDurationConverter implements Converter<String, Duration>
[METRICS] loc=15 cc=3 branches=1 loops=0 returns=2 throws=1 nesting=2
[CALLS-INTERNAL] ChronoUnit getUnit(String value)
[CALLS-EXTERNAL] ISO8601.matcher(sourc... | /* static context
[FOCAL] @Override public Duration StringToDurationConverter.convert(String source)
[THROWS-WHEN] IllegalStateException when try-body throws
[PATH1] try-body throws -> throw new IllegalStateException("'" + source + "' is not a valid duration...
[PATH2] if(ISO8601.matcher(source).matches())=T -> return ... | /* static context
[FOCAL] @Override public Duration StringToDurationConverter.convert(String source)
[THROWS-WHEN] IllegalStateException when try-body throws
[PATH1] try-body throws -> throw new IllegalStateException("'" + source + "' is not a valid duration...
[PATH2] if(ISO8601.matcher(source).matches())=T -> return ... | true | ok | {"focal": {"class": "StringToDurationConverter", "name": "convert", "signature": "Duration convert(String source)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "source", "type": "String"}], "return_type": "Duration"}, "class_info": {"name": "StringToDurationConverter", "kind": "class", "modifi... |
76198055_1 | class ContributorsPresenter extends MvpBasePresenter<ContributorsView> {
public void loadContributors(String owner, String repo, boolean pullToRefresh) {
if (isViewAttached()) {
getView().showProgress(pullToRefresh);
}
subscription =
appRepository.contributors(owner... | ContributorsPresenter contributorsPresenter = new ContributorsPresenter(appRepository);
contributorsPresenter.attachView(contributorsView);
when(githubApi.contributors(OWNER, REPO)).thenReturn(
Observable.just(Response.success(new ArrayList<>())));
contributorsPresenter.loa... | [FOCAL] public void ContributorsPresenter.loadContributors(String owner, String repo, boolean pullToRefresh)
[CLASS] class ContributorsPresenter extends MvpBasePresenter<ContributorsView>
[METRICS] loc=33 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] isViewAttached/0 (inherited), getView().showP... | /* static context
[FOCAL] public void ContributorsPresenter.loadContributors(String owner, String repo, boolean pullToRefresh)
[PATH1] if(isViewAttached())=T
[PATH2] if(isViewAttached())=F
[COLLABORATORS] field appRepository:AppRepository contributors/2; field e toString/0; field contributors isEmpty/0
[FIELDS] read=ap... | /* static context
[FOCAL] public void ContributorsPresenter.loadContributors(String owner, String repo, boolean pullToRefresh)
[PATH1] if(isViewAttached())=T
[PATH2] if(isViewAttached())=F
[COLLABORATORS] field appRepository:AppRepository contributors/2; field e toString/0; field contributors isEmpty/0
[FIELDS] read=ap... | true | ok | {"focal": {"class": "ContributorsPresenter", "name": "loadContributors", "signature": "void loadContributors(String owner, String repo, boolean pullToRefresh)", "start_line": 3, "modifiers": "public", "params": [{"name": "owner", "type": "String"}, {"name": "repo", "type": "String"}, {"name": "pullToRefresh", "type": "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.