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
36456716_250
class VM { public void step(Program program) { if (CONFIG.vmTrace()) { program.saveOpTrace(); } try { OpCode op = OpCode.code(program.getCurrentOp()); if (op == null) { throw Program.Exception.invalidOpCode(program.getCurrentOp()); ...
VM vm = new VM(); program = new Program(Hex.decode("614444639999666603"), invoke); String s_expected_1 = "0000000000000000000000000000000000000000000000000000000099992222"; vm.step(program); vm.step(program); vm.step(program); DataWord item1 = program.stackPop(...
[FOCAL] public void VM.step(Program program) [CLASS] class VM [METRICS] loc=1077 cc=236 branches=84 loops=1 returns=0 throws=5 nesting=4 [CALLS-INTERNAL] BigInteger memNeeded(DataWord offset, DataWord size); void dumpLine(OpCode op, long gasBefore, long gasCost, long memWords, Program program) [CALLS-EXTERNAL] CONFIG.v...
class VM { public void step(Program program) { if (CONFIG.vmTrace()) { program.saveOpTrace(); } try { OpCode op = OpCode.code(program.getCurrentOp()); if (op == null) { throw Program.Exception.invalidOpCode(program.getCurrentOp()); ...
false
ok
{"focal": {"class": "VM", "name": "step", "signature": "void step(Program program)", "start_line": 3, "modifiers": "public", "params": [{"name": "program", "type": "Program"}], "return_type": "void"}, "class_info": {"name": "VM", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"nam...
36461471_5
class DGRN { boolean edgePropagatesSignal(Edge edge) throws KeySelectorException { // returns true if the given node has a signal that should be passed along the given edge // assuming single-step weight-threshold-gate drain // check if src node has enough potential to traverse edge ...
// tests when signal should propagate DGRN dgrn = getMockDGRN_twoNode(); List<Edge> edges = dgrn.graph.getAllEdges(); Assert.assertEquals(edges.size(), 1); // only 1 edge in this graph Edge edge = edges.get(0); // init state: // (1) -2-> (0) Assert.assert...
[FOCAL] boolean DGRN.edgePropagatesSignal(Edge edge) [CLASS] class DGRN [METRICS] loc=17 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] String getNodeAttributeValue(Node node, String attributeId) [CALLS-EXTERNAL] Math.abs/1, Edge.getWeight/0, Integer.parseInt/1, Edge.getSource/0, Logger.trace/1, ...
/* static context [FOCAL] boolean DGRN.edgePropagatesSignal(Edge edge) [PATH1] try-body throws -> return false [PATH2] return srcPotential >= edgeMagnitude [INPUTS] branches=- | result=edge [COLLABORATORS] param edge:Edge getWeight/0,getSource/0,getTarget/0 [EXCEPTIONS] declares KeySelectorException; catches IllegalSta...
/* static context [FOCAL] boolean DGRN.edgePropagatesSignal(Edge edge) [PATH1] try-body throws -> return false [PATH2] return srcPotential >= edgeMagnitude [INPUTS] branches=- | result=edge [COLLABORATORS] param edge:Edge getWeight/0,getSource/0,getTarget/0 [EXCEPTIONS] declares KeySelectorException; catches IllegalSta...
true
ok
{"focal": {"class": "DGRN", "name": "edgePropagatesSignal", "signature": "boolean edgePropagatesSignal(Edge edge) throws KeySelectorException", "start_line": 3, "modifiers": "", "params": [{"name": "edge", "type": "Edge"}], "return_type": "boolean"}, "class_info": {"name": "DGRN", "kind": "class", "modifiers": "", "sup...
36476378_1
class DfsUtil { public static Set<Path> listFiles(FileSystem hdfs, Path path, boolean recurse, boolean filterMetaData) throws IOException { Set<Path> files = new HashSet<>(); try { RemoteIterator<LocatedFileStatus> filesIterator = hdfs.listFiles(path, recurse); while (filesIterator.hasNext())...
assertEquals(0, DfsUtil.listFiles(dfsServer.getFileSystem(), dfsServer.getPath("/tmq/t"), false, false).size()); assertEquals(0, DfsUtil.listFiles(dfsServer.getFileSystem(), dfsServer.getPath("/tmq/t"), false, false).size()); assertEquals(0, DfsUtil.listFiles(dfsServer.getFileSystem(), dfsServer.getPath("/t...
[FOCAL] public static Set<Path> DfsUtil.listFiles(FileSystem hdfs, Path path, boolean recurse, boolean filterMetaData) [CLASS] class DfsUtil [METRICS] loc=16 cc=4 branches=1 loops=1 returns=1 throws=0 nesting=3 [CALLS-EXTERNAL] FileSystem.listFiles/2, RemoteIterator<LocatedFileStatus>.hasNext/0, filesIterator.next().ge...
/* static context [FOCAL] public static Set<Path> DfsUtil.listFiles(FileSystem hdfs, Path path, boolean recurse, boolean filterMetaData) [PATH1] while(filesIterator.hasNext())=T -> if(!filterMetaData || !file.getName().startsWith(FILE_METADATA_PREFIX))=T -> exit loop -> return files [PATH2] try-body throws -> return fi...
/* static context [FOCAL] public static Set<Path> DfsUtil.listFiles(FileSystem hdfs, Path path, boolean recurse, boolean filterMetaData) [PATH1] while(filesIterator.hasNext())=T -> if(!filterMetaData || !file.getName().startsWith(FILE_METADATA_PREFIX))=T -> exit loop -> return files [PATH2] try-body throws -> return fi...
true
ok
{"focal": {"class": "DfsUtil", "name": "listFiles", "signature": "Set<Path> listFiles(FileSystem hdfs, Path path, boolean recurse, boolean filterMetaData) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "hdfs", "type": "FileSystem"}, {"name": "path", "type": "Path"}, {"name": "re...
36483902_22
class DateRange implements Comparable<DateRange> { public DateRange rounded(long interval) { if (interval <= 0) { return this; } return new DateRange(start - start % interval, end - (end % interval)); } public DateRange(long start, long end); public long start();...
final DateRange range = new DateRange(0, 0); assertTrue(range == range.rounded(-1)); } }
[FOCAL] public DateRange DateRange.rounded(long interval) [CLASS] class DateRange implements Comparable<DateRange> [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [NEW] DateRange [PATH1] if(interval <= 0)=T -> return this [PATH2] if(interval <= 0)=F -> return new DateRange(start - start % interval,...
/* static context [FOCAL] public DateRange DateRange.rounded(long interval) [PATH1] if(interval <= 0)=T -> return this [PATH2] if(interval <= 0)=F -> return new DateRange(start - start % interval, end - (end % interval)) [INPUTS] branches=interval | result=interval [NEW] DateRange */
/* static context [FOCAL] public DateRange DateRange.rounded(long interval) [PATH1] if(interval <= 0)=T -> return this [PATH2] if(interval <= 0)=F -> return new DateRange(start - start % interval, end - (end % interval)) [INPUTS] branches=interval | result=interval [NEW] DateRange */ class DateRange implements Comparab...
true
ok
{"focal": {"class": "DateRange", "name": "rounded", "signature": "DateRange rounded(long interval)", "start_line": 3, "modifiers": "public", "params": [{"name": "interval", "type": "long"}], "return_type": "DateRange"}, "class_info": {"name": "DateRange", "kind": "class", "modifiers": "", "superclass": null, "interface...
36487440_42
class OAuth2AuthenticationHandler implements AuthenticationHandler { @Override public String name() { return AUTHENTICATION_HANDLER_NAME; } @Override public boolean canHandle(AuthenticationContext context); private String readToken(Request request); @Override public int order(); @O...
Assert.assertEquals(OAuth2AuthenticationHandler.AUTHENTICATION_HANDLER_NAME, authenticationHandler.name()); } }
[FOCAL] @Override public String OAuth2AuthenticationHandler.name() [CLASS] class OAuth2AuthenticationHandler implements AuthenticationHandler [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] boolean canHandle(AuthenticationContext context); String readToken(Request request); int orde...
/* static context [FOCAL] @Override public String OAuth2AuthenticationHandler.name() */
/* static context [FOCAL] @Override public String OAuth2AuthenticationHandler.name() */ class OAuth2AuthenticationHandler implements AuthenticationHandler { @Override public String name() { return AUTHENTICATION_HANDLER_NAME; } @Override public boolean canHandle(AuthenticationContext context);...
true
ok
{"focal": {"class": "OAuth2AuthenticationHandler", "name": "name", "signature": "String name()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "OAuth2AuthenticationHandler", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Authentica...
36518071_10
class UserServiceImpl implements UserService { @Override @Transactional(rollbackFor = Throwable.class) public User createUser(User userTemplate) throws FieldValidationException { Preconditions.checkArgument(userTemplate != null, "userTemplate is required"); validateUser(userTemplate); User userToCreate = ne...
UserServiceImpl fixture = UserServiceImplFactory.createUsersServiceImpl(); User user = UserFactory.createNewUserTemplate(); user.setEmail(null); fixture.createUser(user); fail(); } }
[FOCAL] @Override @Transactional(rollbackFor = Throwable.class) public User UserServiceImpl.createUser(User userTemplate) [CLASS] class UserServiceImpl implements UserService [METRICS] loc=46 cc=7 branches=4 loops=0 returns=1 throws=2 nesting=1 [CALLS-INTERNAL] void validateUser(User user) [CALLS-EXTERNAL] Precondition...
/* static context [FOCAL] @Override @Transactional(rollbackFor = Throwable.class) public User UserServiceImpl.createUser(User userTemplate) [THROWS-WHEN] FieldValidationException when userTemplate.getUuid() != null && userToCreate.getRegisteredAt() == 0 && userToCreate.getLocale() == null && userToCreate.getTimeZone() ...
/* static context [FOCAL] @Override @Transactional(rollbackFor = Throwable.class) public User UserServiceImpl.createUser(User userTemplate) [THROWS-WHEN] FieldValidationException when userTemplate.getUuid() != null && userToCreate.getRegisteredAt() == 0 && userToCreate.getLocale() == null && userToCreate.getTimeZone() ...
true
ok
{"focal": {"class": "UserServiceImpl", "name": "createUser", "signature": "User createUser(User userTemplate) throws FieldValidationException", "start_line": 3, "modifiers": "@Override @Transactional(rollbackFor = Throwable.class) public", "params": [{"name": "userTemplate", "type": "User"}], "return_type": "User"}, "c...
36524737_0
class AdapterReferenceCollector { static <T, A extends BindingCollectionAdapter<T>> WeakReference<A> createRef(A adapter, ObservableList<T> items, ObservableList.OnListChangedCallback callback) { if (thread == null || !thread.isAlive()) { thread = new PollReferenceThread(); thread.s...
BindingCollectionAdapter adapter = mock(BindingCollectionAdapter.class); ObservableList items = mock(ObservableList.class); ObservableList.OnListChangedCallback callback = mock(ObservableList.OnListChangedCallback.class); WeakReference ref = AdapterReferenceCollector.createRef(adapter, i...
[FOCAL] static WeakReference<A> AdapterReferenceCollector.createRef(A adapter, ObservableList<T> items, ObservableList.OnListChangedCallback callback) [CLASS] class AdapterReferenceCollector [METRICS] loc=7 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] thread.isAlive/0, thread.start/0 [NEW] Poll...
/* static context [FOCAL] static WeakReference<A> AdapterReferenceCollector.createRef(A adapter, ObservableList<T> items, ObservableList.OnListChangedCallback callback) [PATH1] if(thread == null || !thread.isAlive())=T -> return new AdapterRef<>(adapter, items, callback) [PATH2] if(thread == null || !thread.isAlive())=...
/* static context [FOCAL] static WeakReference<A> AdapterReferenceCollector.createRef(A adapter, ObservableList<T> items, ObservableList.OnListChangedCallback callback) [PATH1] if(thread == null || !thread.isAlive())=T -> return new AdapterRef<>(adapter, items, callback) [PATH2] if(thread == null || !thread.isAlive())=...
true
ok
{"focal": {"class": "AdapterReferenceCollector", "name": "createRef", "signature": "WeakReference<A> createRef(A adapter, ObservableList<T> items, ObservableList.OnListChangedCallback callback)", "start_line": 3, "modifiers": "static", "params": [{"name": "adapter", "type": "A"}, {"name": "items", "type": "ObservableLi...
36564453_7
class SmartLock extends Lock implements CredentialStore, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener { void onCredentialsRetrieved(final Activity activity, final Credential credential) { Log.v(TAG, "Credentials : " + credential.getName()); String email = credenti...
smartLock.onCredentialsRetrieved(activity, credential); verify(apiClient).login(eq(EMAIL), eq(PASSWORD), anyMapOf(String.class, Object.class), any(AuthenticationCallback.class)); } }
[FOCAL] void SmartLock.onCredentialsRetrieved(Activity activity, Credential credential) [CLASS] class SmartLock extends Lock implements CredentialStore, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener [METRICS] loc=22 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] ...
/* static context [FOCAL] void SmartLock.onCredentialsRetrieved(Activity activity, Credential credential) [COLLABORATORS] param credential:Credential getName/0,getId/0,getPassword/0 [NEW] AuthenticationCallback, Intent, LoginAuthenticationErrorBuilder [CALLS-EXTERNAL] Log.v/2, Credential.getName/0, Credential.getId/0, ...
/* static context [FOCAL] void SmartLock.onCredentialsRetrieved(Activity activity, Credential credential) [COLLABORATORS] param credential:Credential getName/0,getId/0,getPassword/0 [NEW] AuthenticationCallback, Intent, LoginAuthenticationErrorBuilder [CALLS-EXTERNAL] Log.v/2, Credential.getName/0, Credential.getId/0, ...
true
ok
{"focal": {"class": "SmartLock", "name": "onCredentialsRetrieved", "signature": "void onCredentialsRetrieved(Activity activity, Credential credential)", "start_line": 3, "modifiers": "", "params": [{"name": "activity", "type": "Activity"}, {"name": "credential", "type": "Credential"}], "return_type": "void"}, "class_in...
36572522_0
class MyParcelable implements Parcelable { @Override public void writeToParcel(Parcel dest, int flags) { Postman.writeToParcel(this, dest); } public MyParcelable(); public MyParcelable(String myString); @Override public int describeContents(); } class MyParcelableTest { @Tes...
Object o = new Object(); boolean exceptionCaught = false; try { Postman.writeToParcel(o, Parcel.obtain()); } catch (PostmanException e) { exceptionCaught = true; assertTrue("expected cause to be of type ClassNotFoundException but found " + ...
[FOCAL] @Override public void MyParcelable.writeToParcel(Parcel dest, int flags) [CLASS] class MyParcelable implements Parcelable [METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] Postman.writeToParcel/2 [INPUTS] branches=- | result=- | unused=flags [DATAFLOW] dest@param->L3 [CLASS-M...
/* static context [FOCAL] @Override public void MyParcelable.writeToParcel(Parcel dest, int flags) [INPUTS] branches=- | result=- | unused=flags [CALLS-EXTERNAL] Postman.writeToParcel/2 */
/* static context [FOCAL] @Override public void MyParcelable.writeToParcel(Parcel dest, int flags) [INPUTS] branches=- | result=- | unused=flags [CALLS-EXTERNAL] Postman.writeToParcel/2 */ class MyParcelable implements Parcelable { @Override public void writeToParcel(Parcel dest, int flags) { Postman.w...
true
ok
{"focal": {"class": "MyParcelable", "name": "writeToParcel", "signature": "void writeToParcel(Parcel dest, int flags)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "dest", "type": "Parcel"}, {"name": "flags", "type": "int"}], "return_type": "void"}, "class_info": {"name": "MyParcelable", "kind...
36600590_10
class ITCHSession implements Closeable { public int receive() throws IOException { int bytes = channel.read(rxBuffer); if (bytes <= 0) return bytes; rxBuffer.flip(); while (parse()); rxBuffer.compact(); if (rxBuffer.position() == rxBuffer.capacity())...
client.requestInstrumentDirectory(); while (serverEvents.collect().size() != 1) server.receive(); assertEquals(asList(new InstrumentDirectoryRequest()), serverEvents.collect()); } }
[FOCAL] public int ITCHSession.receive() [CLASS] class ITCHSession implements Closeable [METRICS] loc=19 cc=4 branches=2 loops=1 returns=2 throws=1 nesting=1 [CALLS-INTERNAL] boolean parse(); void receivedData() [CALLS-EXTERNAL] channel.read/1, rxBuffer.flip/0, rxBuffer.compact/0, rxBuffer.position/0, rxBuffer.capacity...
/* static context [FOCAL] public int ITCHSession.receive() [THROWS-WHEN] ITCHException when !(bytes <= 0) && parse() && rxBuffer.position() == rxBuffer.capacity() [THROWS-WHEN] ITCHException when !(bytes <= 0) && !parse() && rxBuffer.position() == rxBuffer.capacity() [PATH1] if(bytes <= 0)=F -> while(parse())=T -> exit...
/* static context [FOCAL] public int ITCHSession.receive() [THROWS-WHEN] ITCHException when !(bytes <= 0) && parse() && rxBuffer.position() == rxBuffer.capacity() [THROWS-WHEN] ITCHException when !(bytes <= 0) && !parse() && rxBuffer.position() == rxBuffer.capacity() [PATH1] if(bytes <= 0)=F -> while(parse())=T -> exit...
true
ok
{"focal": {"class": "ITCHSession", "name": "receive", "signature": "int receive() throws IOException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "ITCHSession", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Closeable", "fields": [{"name": "...
36603494_1
class PagedDataProvider extends AbstractDataProvider<T, F> { public PagingControls getPagingControls() { return pagingControls; } public PagedDataProvider(DataProvider<T, F> dataProvider); public PagedDataProvider(DataProvider<T, F> dataProvider, int pageLength); @Override public boolean isInMemory(); @Ove...
PagingControls controls = pagedDP.getPagingControls(); Assert.assertEquals(0, controls.getPageNumber()); controls.previousPage(); Assert.assertEquals(0, controls.getPageNumber()); } }
[FOCAL] public PagingControls PagedDataProvider.getPagingControls() [CLASS] class PagedDataProvider extends AbstractDataProvider<T, F> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] PagedDataProvider(DataProvider<T, F> dataProvider); PagedDataProvider(DataProvider<T, F> dataProvide...
/* static context [FOCAL] public PagingControls PagedDataProvider.getPagingControls() */
/* static context [FOCAL] public PagingControls PagedDataProvider.getPagingControls() */ class PagedDataProvider extends AbstractDataProvider<T, F> { public PagingControls getPagingControls() { return pagingControls; } public PagedDataProvider(DataProvider<T, F> dataProvider); public PagedDataProvider(DataPro...
true
ok
{"focal": {"class": "PagedDataProvider", "name": "getPagingControls", "signature": "PagingControls getPagingControls()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "PagingControls"}, "class_info": {"name": "PagedDataProvider", "kind": "class", "modifiers": "", "superclass": "AbstractDataProvid...
36614714_5
class Commands { public static byte[] getReadPumpCommand(final byte[] serial) { byte[] data = new byte[]{ 0x01, // head 0x00, // head (byte) 0xA7, // 167 0x01, // 1 0x00, // Serial 0x00, // Serial ...
byte[] output = new byte[] { 0x01, 0x00, (byte) 0xA7, 0x01, 0x66, 0x54, 0x55, (byte) 0x80, 0x00, 0x00, 0x02, 0x01, 0x00, (byte) 0x8D, 0x5B, 0x00 }; byte[] serial = new byte[] { 0x66,0x54,0x55 }; byte[] generated = Commands.getReadPumpCommand(serial); as...
[FOCAL] public static byte[] Commands.getReadPumpCommand(byte[] serial) [CLASS] class Commands [METRICS] loc=29 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] CRC.computeCRC/2 [DATAFLOW] data@L2->L22,L23,L24,L26,L28; serial@param->L22,L23,L24 [CLASS-MEMBERS] byte[] setSuspendCommand(byte[] serial...
/* static context [FOCAL] public static byte[] Commands.getReadPumpCommand(byte[] serial) [CALLS-EXTERNAL] CRC.computeCRC/2 */
/* static context [FOCAL] public static byte[] Commands.getReadPumpCommand(byte[] serial) [CALLS-EXTERNAL] CRC.computeCRC/2 */ class Commands { public static byte[] getReadPumpCommand(final byte[] serial) { byte[] data = new byte[]{ 0x01, // head 0x00, // head ...
true
ok
{"focal": {"class": "Commands", "name": "getReadPumpCommand", "signature": "byte[] getReadPumpCommand(byte[] serial)", "start_line": 3, "modifiers": "public static", "params": [{"name": "serial", "type": "byte[]"}], "return_type": "byte[]"}, "class_info": {"name": "Commands", "kind": "class", "modifiers": "", "supercla...
36649267_29
class Packager { public static boolean validateBag(File dir) throws Exception { boolean isValid = false; Bag bag = new BagReader().read(dir.toPath()); BagVerifier bv = new BagVerifier(); try { bv.isValid(bag, false); isValid = true; } ...
final String TEST_FILE1 = "item.pdf"; final String TEST_FILE2 = "banjo.jpg"; final String TEST_FILE_WITH_SPACE = "peacock butterfly.jpeg"; final String EMPTY_DIR_NAME = "emptydir"; final String CHILD_DIR_NAME = "childdir"; final String CHILD_DIR_WITH_SPACE = "second child...
[FOCAL] public static boolean Packager.validateBag(File dir) [CLASS] class Packager [METRICS] loc=22 cc=2 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] new BagReader().read/1, File.toPath/0, BagVerifier.isValid/2, log.warn/1, Bag.getRootDir/0, IOException | CorruptChecksumException | InvalidBagitFile...
/* static context [FOCAL] public static boolean Packager.validateBag(File dir) [PATH1] try-body throws -> return isValid [COLLABORATORS] param dir:File toPath/0 [EXCEPTIONS] declares Exception; catches IOException | CorruptChecksumException | InvalidBagitFileFormatException | VerificationException ... [NEW] BagReader, ...
/* static context [FOCAL] public static boolean Packager.validateBag(File dir) [PATH1] try-body throws -> return isValid [COLLABORATORS] param dir:File toPath/0 [EXCEPTIONS] declares Exception; catches IOException | CorruptChecksumException | InvalidBagitFileFormatException | VerificationException ... [NEW] BagReader, ...
true
ok
{"focal": {"class": "Packager", "name": "validateBag", "signature": "boolean validateBag(File dir) throws Exception", "start_line": 3, "modifiers": "public static", "params": [{"name": "dir", "type": "File"}], "return_type": "boolean"}, "class_info": {"name": "Packager", "kind": "class", "modifiers": "", "superclass": ...
36657331_1
class AddController { protected static Person personFromRequest(String json) { AddPersonRequest apr = JsonUtils.getAPRFromJson(json); Person p = AddPersonRequest.toPerson(apr); return p; } @POST @Consumes(MediaType.TEXT_PLAIN) public Response handle(String json); protected static void addToGlobalList(Perso...
Person p = AddController.personFromRequest(json); Config.cc.putPerson(p); Person p2 = Config.cc.getPerson("JOHN SMITH"); assertTrue(p2 != null); assertTrue(p2.name.equals("JOHN SMITH")); assertTrue(p2.role.equals(Role.DEV)); assertTrue(p2.resumeInfo != null); assertTrue(p2.qaResponses.get(0).equals("ans...
[FOCAL] protected static Person AddController.personFromRequest(String json) [CLASS] class AddController [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] JsonUtils.getAPRFromJson/1, AddPersonRequest.toPerson/1 [INPUTS] branches=- | result=json [DATAFLOW] apr@L3->L4; json@param->L3; ...
/* static context [FOCAL] protected static Person AddController.personFromRequest(String json) [INPUTS] branches=- | result=json [CALLS-EXTERNAL] JsonUtils.getAPRFromJson/1, AddPersonRequest.toPerson/1 */
/* static context [FOCAL] protected static Person AddController.personFromRequest(String json) [INPUTS] branches=- | result=json [CALLS-EXTERNAL] JsonUtils.getAPRFromJson/1, AddPersonRequest.toPerson/1 */ class AddController { protected static Person personFromRequest(String json) { AddPersonRequest apr = JsonUtil...
true
ok
{"focal": {"class": "AddController", "name": "personFromRequest", "signature": "Person personFromRequest(String json)", "start_line": 3, "modifiers": "protected static", "params": [{"name": "json", "type": "String"}], "return_type": "Person"}, "class_info": {"name": "AddController", "kind": "class", "modifiers": "", "s...
36664864_9
class BulkManager implements Runnable { @VisibleForTesting @SuppressWarnings("checkstyle:designforextension") protected URI getUri() throws URISyntaxException { String baseURL = config.baseURL; if (!baseURL.endsWith("/")) { baseURL += "/"; } String url = baseURL...
DataSiftConfig config = new DataSiftConfig(); config.baseURL = "http://in.example.com/"; config.sourceID = "SOURCEID"; config.port = 42; config.username = "USER"; config.apiKey = "APIKEY"; BulkManager b = new BulkManager(config, null, null, null); try { ...
[FOCAL] @VisibleForTesting @SuppressWarnings("checkstyle:designforextension") protected URI BulkManager.getUri() [CLASS] class BulkManager implements Runnable [METRICS] loc=20 cc=3 branches=2 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] String.endsWith/1, new URIBuilder(url).setPort(config.port).build/0, new U...
/* static context [FOCAL] @VisibleForTesting @SuppressWarnings("checkstyle:designforextension") protected URI BulkManager.getUri() [THROWS-WHEN] URISyntaxException when !baseURL.endsWith("/") && uri == null [THROWS-WHEN] URISyntaxException when baseURL.endsWith("/") && uri == null [PATH1] if(!baseURL.endsWith("/"))=T -...
/* static context [FOCAL] @VisibleForTesting @SuppressWarnings("checkstyle:designforextension") protected URI BulkManager.getUri() [THROWS-WHEN] URISyntaxException when !baseURL.endsWith("/") && uri == null [THROWS-WHEN] URISyntaxException when baseURL.endsWith("/") && uri == null [PATH1] if(!baseURL.endsWith("/"))=T -...
true
ok
{"focal": {"class": "BulkManager", "name": "getUri", "signature": "URI getUri() throws URISyntaxException", "start_line": 3, "modifiers": "@VisibleForTesting @SuppressWarnings(\"checkstyle:designforextension\") protected", "params": [], "return_type": "URI"}, "class_info": {"name": "BulkManager", "kind": "class", "modi...
36765917_1
class KeywordStatistics { public Map<String, Long> extract(String text, List<String> keywords) { Map<String, Long> result = Maps.newHashMap(); keywords.forEach(new Consumer<String>() { @Override public void accept(String keyword) { if (text.contains(keyword))...
//setup String message = "Poker poker poker poker poker poker"; //act Map<String, Long> result = testObj.extract(message, Lists.newArrayList("Poker","Tournament")); //assert assertNotNull(result); assertThat(result, Matchers.allOf(hasEntry(is("Poker"), is(1L))))...
[FOCAL] public Map<String, Long> KeywordStatistics.extract(String text, List<String> keywords) [CLASS] class KeywordStatistics [METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] Maps.newHashMap/0, List<String>.forEach/1, String.contains/1, Map<String, Long>.put/2 [NEW] Consumer<Strin...
/* static context [FOCAL] public Map<String, Long> KeywordStatistics.extract(String text, List<String> keywords) [COLLABORATORS] param keywords:List<String> forEach/1 [NEW] Consumer<String> [CALLS-EXTERNAL] Maps.newHashMap/0, List<String>.forEach/1, String.contains/1, Map<String, Long>.put/2 */
/* static context [FOCAL] public Map<String, Long> KeywordStatistics.extract(String text, List<String> keywords) [COLLABORATORS] param keywords:List<String> forEach/1 [NEW] Consumer<String> [CALLS-EXTERNAL] Maps.newHashMap/0, List<String>.forEach/1, String.contains/1, Map<String, Long>.put/2 */ class KeywordStatistics ...
true
ok
{"focal": {"class": "KeywordStatistics", "name": "extract", "signature": "Map<String, Long> extract(String text, List<String> keywords)", "start_line": 3, "modifiers": "public", "params": [{"name": "text", "type": "String"}, {"name": "keywords", "type": "List<String>"}], "return_type": "Map<String, Long>"}, "class_info...
36781255_0
class EmailNotificationServiceImpl implements EmailNotificationService { public void sendPodcastAdditionConfirmation(final String name, final String email, final String podcastUrl) { MimeMessagePreparator preparator = new MimeMessagePreparator() { @SuppressWarnings({ "rawtypes", "unchecked" }) public void pre...
emailNotificationService.sendPodcastAdditionConfirmation("Gigi", "gigi@podcastpedia.org", "feed.xxx"); Mailbox inbox = Mailbox.get("gigi@podcastpedia.org"); assert(inbox.size()==1); assert(inbox.get(0).getSubject().equals(EMAIL_SUBJECT)); Address[] addresses = inbox.get(0).getFrom(); assert(addresses[0]...
[FOCAL] public void EmailNotificationServiceImpl.sendPodcastAdditionConfirmation(String name, String email, String podcastUrl) [CLASS] class EmailNotificationServiceImpl implements EmailNotificationService [METRICS] loc=24 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] MimeMessageHelper.setTo/1, ...
/* static context [FOCAL] public void EmailNotificationServiceImpl.sendPodcastAdditionConfirmation(String name, String email, String podcastUrl) [COLLABORATORS] field configService getValue/1; field mailSender send/1 [FIELDS] read=EMAIL_SUBJECT:String [NEW] MimeMessagePreparator, MimeMessageHelper, Date, HashMap [CALLS...
/* static context [FOCAL] public void EmailNotificationServiceImpl.sendPodcastAdditionConfirmation(String name, String email, String podcastUrl) [COLLABORATORS] field configService getValue/1; field mailSender send/1 [FIELDS] read=EMAIL_SUBJECT:String [NEW] MimeMessagePreparator, MimeMessageHelper, Date, HashMap [CALLS...
true
ok
{"focal": {"class": "EmailNotificationServiceImpl", "name": "sendPodcastAdditionConfirmation", "signature": "void sendPodcastAdditionConfirmation(String name, String email, String podcastUrl)", "start_line": 3, "modifiers": "public", "params": [{"name": "name", "type": "String"}, {"name": "email", "type": "String"}, {"...
36793280_136
class RetryTransformer implements FlowableTransformer<T, T>, ObservableTransformer<T, T>, SingleTransformer<T, T>, CompletableTransformer, MaybeTransformer<T, T> { public static <T> RetryTransformer<T> of(Retry retry) { return new RetryTransformer<>(retry); } private RetryTransformer(Retry re...
RetryConfig config = RetryConfig.<String>custom() .retryOnResult("retry"::equals) .waitDuration(Duration.ofMillis(50)) .maxAttempts(3).build(); Retry retry = Retry.of("testName", config); given(helloWorldService.returnHelloWorld()) .willReturn("ret...
[FOCAL] public static RetryTransformer<T> RetryTransformer.of(Retry retry) [CLASS] class RetryTransformer implements FlowableTransformer<T, T>, ObservableTransformer<T, T>, SingleTransformer<T, T>, CompletableTransformer, MaybeTransformer<T, T> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] ...
/* static context [FOCAL] public static RetryTransformer<T> RetryTransformer.of(Retry retry) [INPUTS] branches=- | result=retry [NEW] RetryTransformer<> */
/* static context [FOCAL] public static RetryTransformer<T> RetryTransformer.of(Retry retry) [INPUTS] branches=- | result=retry [NEW] RetryTransformer<> */ class RetryTransformer implements FlowableTransformer<T, T>, ObservableTransformer<T, T>, SingleTransformer<T, T>, CompletableTransformer, MaybeTransformer<T, T...
true
ok
{"focal": {"class": "RetryTransformer", "name": "of", "signature": "RetryTransformer<T> of(Retry retry)", "start_line": 4, "modifiers": "public static", "params": [{"name": "retry", "type": "Retry"}], "return_type": "RetryTransformer<T>"}, "class_info": {"name": "RetryTransformer", "kind": "class", "modifiers": "", "su...
36807893_16
class IDBuilder { public static int parseGeneratorId(byte[] id) { assertNotNullEightBytes(id); return parseGeneratorIdNoChecks(id); } public static byte[] build(Blueprint blueprint); public static Blueprint parse(byte[] id); public static int parseSequenceId(byte[] id); public ...
byte[] id = new byte[8]; id[6] = 0x0f; id[7] = (byte) (0x0f << 4); byte[] clone = id.clone(); assertThat(parseGeneratorId(id), is(255)); assertThat(id, is(clone)); } }
[FOCAL] public static int IDBuilder.parseGeneratorId(byte[] id) [CLASS] class IDBuilder [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] int parseGeneratorIdNoChecks(byte[] id) [CALLS-EXTERNAL] assertNotNullEightBytes/1 (inherited) [INPUTS] branches=- | result=id [DATAFLOW] id@param...
/* static context [FOCAL] public static int IDBuilder.parseGeneratorId(byte[] id) [INPUTS] branches=- | result=id [CALLS-INTERNAL] int parseGeneratorIdNoChecks(byte[] id) [CALLS-EXTERNAL] assertNotNullEightBytes/1 (inherited) */
/* static context [FOCAL] public static int IDBuilder.parseGeneratorId(byte[] id) [INPUTS] branches=- | result=id [CALLS-INTERNAL] int parseGeneratorIdNoChecks(byte[] id) [CALLS-EXTERNAL] assertNotNullEightBytes/1 (inherited) */ class IDBuilder { public static int parseGeneratorId(byte[] id) { assertNotNul...
true
ok
{"focal": {"class": "IDBuilder", "name": "parseGeneratorId", "signature": "int parseGeneratorId(byte[] id)", "start_line": 3, "modifiers": "public static", "params": [{"name": "id", "type": "byte[]"}], "return_type": "int"}, "class_info": {"name": "IDBuilder", "kind": "class", "modifiers": "", "superclass": null, "inte...
36812061_1
class SurgicalRoutingRequestTransformer implements LoadBalancerRequestTransformer { @Override public HttpRequest transformRequest(HttpRequest request, ServiceInstance instance) { Map<String, String> metadata = instance.getMetadata(); if (metadata.containsKey(CF_APP_GUID) && metadata.containsKey(CF_INSTANCE_INDEX...
Map<String, String> metadata = new HashMap<>(); metadata.put("cfAppGuid", "123"); metadata.put("cfInstanceIndex", "4"); when(instance.getMetadata()).thenReturn(metadata); HttpRequest transformedRequest = transformer.transformRequest(request, instance); assertThat(transformedRequest.getHeaders().get("foo")...
[FOCAL] @Override public HttpRequest SurgicalRoutingRequestTransformer.transformRequest(HttpRequest request, ServiceInstance instance) [CLASS] class SurgicalRoutingRequestTransformer implements LoadBalancerRequestTransformer [METRICS] loc=19 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] ServiceI...
/* static context [FOCAL] @Override public HttpRequest SurgicalRoutingRequestTransformer.transformRequest(HttpRequest request, ServiceInstance instance) [PATH1] if(metadata.containsKey(CF_APP_GUID) && metadata.containsKey(CF_INSTANCE_INDEX))=T -> return new HttpRequestWrapper(request) { @Override public HttpHeaders get...
/* static context [FOCAL] @Override public HttpRequest SurgicalRoutingRequestTransformer.transformRequest(HttpRequest request, ServiceInstance instance) [PATH1] if(metadata.containsKey(CF_APP_GUID) && metadata.containsKey(CF_INSTANCE_INDEX))=T -> return new HttpRequestWrapper(request) { @Override public HttpHeaders get...
true
ok
{"focal": {"class": "SurgicalRoutingRequestTransformer", "name": "transformRequest", "signature": "HttpRequest transformRequest(HttpRequest request, ServiceInstance instance)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "HttpRequest"}, {"name": "instance", "type": "ServiceI...
36816840_5
class StringUtils { public static String removeNonNumeric(String text) { return text.replaceAll("[^0-9]", ""); } public static boolean isNumeric(String maybeNumeric); public static boolean validateCNPJ(String CNPJ); public static String reverseString(String str); public static void app...
Assert.assertEquals(removeNonNumeric("3515 1222 8436 4200 0195 6500 1000 0018 1214 0002 0216"), "35151222843642000195650010000018121400020216"); Assert.assertEquals(removeNonNumeric("22.843.642/0001-95"),"22843642000195"); } }
[FOCAL] public static String StringUtils.removeNonNumeric(String text) [CLASS] class StringUtils [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] String.replaceAll/2 [INPUTS] branches=- | result=text [DATAFLOW] text@param->L2 [CLASS-MEMBERS] boolean isNumeric(String maybeNumeric); b...
/* static context [FOCAL] public static String StringUtils.removeNonNumeric(String text) [INPUTS] branches=- | result=text [CALLS-EXTERNAL] String.replaceAll/2 */
/* static context [FOCAL] public static String StringUtils.removeNonNumeric(String text) [INPUTS] branches=- | result=text [CALLS-EXTERNAL] String.replaceAll/2 */ class StringUtils { public static String removeNonNumeric(String text) { return text.replaceAll("[^0-9]", ""); } public static boolean ...
true
ok
{"focal": {"class": "StringUtils", "name": "removeNonNumeric", "signature": "String removeNonNumeric(String text)", "start_line": 3, "modifiers": "public static", "params": [{"name": "text", "type": "String"}], "return_type": "String"}, "class_info": {"name": "StringUtils", "kind": "class", "modifiers": "", "superclass...
36817565_0
class ApiGeneratorUtils { public static List<ApiImplementor> getAllImplementors() { List<ApiImplementor> imps = new ArrayList<>(); ApiImplementor api; imps.add(new AlertAPI(null)); api = new AntiCsrfAPI(null); api.addApiOptions(new AntiCsrfParam()); imps.add(api);...
// Given / When Map<String, ApiImplementor> generatorApis = ApiGeneratorUtils.getAllImplementors().stream() .collect(Collectors.toMap(ApiImplementor::getPrefix, Function.identity())); // Then for (Entry<String, ApiImplementor> entry : coreApis.entr...
[FOCAL] public static List<ApiImplementor> ApiGeneratorUtils.getAllImplementors() [CLASS] class ApiGeneratorUtils [METRICS] loc=59 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] List<ApiImplementor>.add/1, ApiImplementor.addApiOptions/1 [NEW] ArrayList<>, AlertAPI, AntiCsrfAPI, AntiCsrfParam, Pas...
/* static context [FOCAL] public static List<ApiImplementor> ApiGeneratorUtils.getAllImplementors() [NEW] ArrayList<>, AlertAPI, AntiCsrfAPI, AntiCsrfParam, PassiveScanAPI, SearchAPI, AutoUpdateAPI, OptionsParamCheckForUpdates, SpiderAPI, SpiderParam, CoreAPI, ConnectionParam, ParamsAPI, ActiveScanAPI, ScannerParam, Co...
/* static context [FOCAL] public static List<ApiImplementor> ApiGeneratorUtils.getAllImplementors() [NEW] ArrayList<>, AlertAPI, AntiCsrfAPI, AntiCsrfParam, PassiveScanAPI, SearchAPI, AutoUpdateAPI, OptionsParamCheckForUpdates, SpiderAPI, SpiderParam, CoreAPI, ConnectionParam, ParamsAPI, ActiveScanAPI, ScannerParam, Co...
true
ok
{"focal": {"class": "ApiGeneratorUtils", "name": "getAllImplementors", "signature": "List<ApiImplementor> getAllImplementors()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "List<ApiImplementor>"}, "class_info": {"name": "ApiGeneratorUtils", "kind": "class", "modifiers": "", "superclass"...
36819131_4
class AllJUnitReports { public int getTotalFailures() { return totalFailures; } public AllJUnitReports(String pageTitle, List<TestSuiteModel> allTestSuites); public List<TestSuiteModel> getAllTestSuites(); public String getPageTitle(); public String getTotalTime(); public int get...
assertEquals(reports.getTotalFailures(), 7); } }
[FOCAL] public int AllJUnitReports.getTotalFailures() [CLASS] class AllJUnitReports [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] AllJUnitReports(String pageTitle, List<TestSuiteModel> allTestSuites); List<TestSuiteModel> getAllTestSuites(); String getPageTitle(); String getTotalT...
/* static context [FOCAL] public int AllJUnitReports.getTotalFailures() */
/* static context [FOCAL] public int AllJUnitReports.getTotalFailures() */ class AllJUnitReports { public int getTotalFailures() { return totalFailures; } public AllJUnitReports(String pageTitle, List<TestSuiteModel> allTestSuites); public List<TestSuiteModel> getAllTestSuites(); public ...
true
ok
{"focal": {"class": "AllJUnitReports", "name": "getTotalFailures", "signature": "int getTotalFailures()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "AllJUnitReports", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "...
36827833_5
class RgbLedBatchProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { final Message msg = exchange.getIn(); final StringBuffer pwmBatch = new StringBuffer(); final String[] batchLines = msg.getBody(String.class).split("\n"); final Obj...
final Exchange ex = new DefaultExchange(ctx); final Message msg = ex.getIn(); config.resetRgbLeds(); msg.setBody("65535;r;50\n0;g;100\n1;g;100"); processor.process(ex); Assert.assertEquals(msg.getBody(), "0x00;0;2047\n" + "0x00;3;2047\n" + "0x00;6;2047\n" ...
[FOCAL] @Override public void RgbLedBatchProcessor.process(Exchange exchange) [CLASS] class RgbLedBatchProcessor implements Processor [METRICS] loc=50 cc=10 branches=7 loops=2 returns=0 throws=0 nesting=3 [CALLS-INTERNAL] void batchAppend(StringBuffer pwmBatch, int led, String channel, int value, boolean smooth) [CALLS...
/* static context [FOCAL] @Override public void RgbLedBatchProcessor.process(Exchange exchange) [PATH1] if(smoothChangeHeader != null)=T -> foreach(String batchLine : batchLines)=T -> if(batchLine.trim().isEmpty())=F -> if(log.isDebugEnabled())=T -> if(log.isTraceEnabled())=T -> if(led == 0xFFFF)=T -> for(i < Configura...
/* static context [FOCAL] @Override public void RgbLedBatchProcessor.process(Exchange exchange) [PATH1] if(smoothChangeHeader != null)=T -> foreach(String batchLine : batchLines)=T -> if(batchLine.trim().isEmpty())=F -> if(log.isDebugEnabled())=T -> if(log.isTraceEnabled())=T -> if(led == 0xFFFF)=T -> for(i < Configura...
true
ok
{"focal": {"class": "RgbLedBatchProcessor", "name": "process", "signature": "void process(Exchange exchange) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "exchange", "type": "Exchange"}], "return_type": "void"}, "class_info": {"name": "RgbLedBatchProcessor", "kind": "class", ...
36857422_14
class LoginViewModel extends ViewModel { void onLoginClick(@Nullable FABProgressCircle fabCircle) { if (!isSiteValid()) { return; } if (fabCircle != null) { fabCircle.show(); } triggerLogin(); } LoginViewModel(UserManager userManager, Rest...
viewModel.url.set("Junk"); viewModel.onLoginClick(null); assertThat(viewModel.urlError.get()).isEqualTo(ERROR_URL_INVALID); } }
[FOCAL] void LoginViewModel.onLoginClick(FABProgressCircle fabCircle) [CLASS] class LoginViewModel extends ViewModel [METRICS] loc=10 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] boolean isSiteValid(); void triggerLogin() [CALLS-EXTERNAL] FABProgressCircle.show/0 [PATH1] if(!isSiteValid())=T ->...
/* static context [FOCAL] void LoginViewModel.onLoginClick(FABProgressCircle fabCircle) [PATH1] if(!isSiteValid())=T -> return [PATH2] if(!isSiteValid())=F -> if(fabCircle != null)=T [PATH3] if(!isSiteValid())=F -> if(fabCircle != null)=F [INPUTS] branches=fabCircle | result=- [COLLABORATORS] param fabCircle:FABProgres...
/* static context [FOCAL] void LoginViewModel.onLoginClick(FABProgressCircle fabCircle) [PATH1] if(!isSiteValid())=T -> return [PATH2] if(!isSiteValid())=F -> if(fabCircle != null)=T [PATH3] if(!isSiteValid())=F -> if(fabCircle != null)=F [INPUTS] branches=fabCircle | result=- [COLLABORATORS] param fabCircle:FABProgres...
true
ok
{"focal": {"class": "LoginViewModel", "name": "onLoginClick", "signature": "void onLoginClick(FABProgressCircle fabCircle)", "start_line": 3, "modifiers": "", "params": [{"name": "fabCircle", "type": "FABProgressCircle"}], "return_type": "void"}, "class_info": {"name": "LoginViewModel", "kind": "class", "modifiers": ""...
36873773_585
class DownloadResponse { public String getFirstHeader(final ResponseHeader responseHeader) { for (final Header header : mHeaders) { if (header.getName().equalsIgnoreCase(responseHeader.getKey())) { return header.getValue(); } } return null; } ...
assertEquals("testCustomEvent", subject.getFirstHeader(ResponseHeader.CUSTOM_EVENT_NAME)); assertEquals("http://example.com/", subject.getFirstHeader(ResponseHeader.CLICK_TRACKING_URL)); assertEquals("http://mopub.com/", subject.getFirstHeader(ResponseHeader.FAIL_URL)); assertNull(subjec...
[FOCAL] public String DownloadResponse.getFirstHeader(ResponseHeader responseHeader) [CLASS] class DownloadResponse [METRICS] loc=8 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] header.getName().equalsIgnoreCase/1, Header.getName/0, ResponseHeader.getKey/0, Header.getValue/0 [PATH1] foreach(Head...
/* static context [FOCAL] public String DownloadResponse.getFirstHeader(ResponseHeader responseHeader) [PATH1] foreach(Header header : mHeaders)=T -> if(header.getName().equalsIgnoreCase(responseHeader.getKey()))=F -> exit loop -> return null [PATH2] foreach(Header header : mHeaders)=T -> if(header.getName().equalsIgno...
/* static context [FOCAL] public String DownloadResponse.getFirstHeader(ResponseHeader responseHeader) [PATH1] foreach(Header header : mHeaders)=T -> if(header.getName().equalsIgnoreCase(responseHeader.getKey()))=F -> exit loop -> return null [PATH2] foreach(Header header : mHeaders)=T -> if(header.getName().equalsIgno...
true
ok
{"focal": {"class": "DownloadResponse", "name": "getFirstHeader", "signature": "String getFirstHeader(ResponseHeader responseHeader)", "start_line": 3, "modifiers": "public", "params": [{"name": "responseHeader", "type": "ResponseHeader"}], "return_type": "String"}, "class_info": {"name": "DownloadResponse", "kind": "c...
36882032_1
class Authority implements GrantedAuthority { @Override public int hashCode() { return authority.hashCode(); } private Authority(); public Authority(String authority); public Authority(String authority, String description); @Id @GeneratedValue public Long getId(); public vo...
Authority userAuthority = new Authority("user"); Authority adminAuthority = new Authority("admin"); assertThat(userAuthority.hashCode(), not(equalTo(adminAuthority.hashCode()))); assertThat(userAuthority.hashCode(), equalTo(new Authority("user").hashCode())); } }
[FOCAL] @Override public int Authority.hashCode() [CLASS] class Authority implements GrantedAuthority [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] authority.hashCode/0 [COLLABORATORS] field authority hashCode/0 [CLASS-MEMBERS] Authority(); Authority(String authority); Authority(...
/* static context [FOCAL] @Override public int Authority.hashCode() [COLLABORATORS] field authority hashCode/0 [CALLS-EXTERNAL] authority.hashCode/0 */
/* static context [FOCAL] @Override public int Authority.hashCode() [COLLABORATORS] field authority hashCode/0 [CALLS-EXTERNAL] authority.hashCode/0 */ class Authority implements GrantedAuthority { @Override public int hashCode() { return authority.hashCode(); } private Authority(); publi...
true
ok
{"focal": {"class": "Authority", "name": "hashCode", "signature": "int hashCode()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "Authority", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "GrantedAuthority", "fields": [], "members": ...
36906356_32
class FeatureSection implements Section { @Override public String render(CukedoctorDocumentBuilder docBuilder, I18nLoader i18n, DocumentAttributes documentAttributes) { final FeatureRenderer renderer = FeatureSection.featureRenderer.get(); renderer.setI18n(i18n); renderer.setDocumentAtt...
final Feature feature = FeatureBuilder.instance().aFeatureWithNoScenarios(); final FeatureSection section = new FeatureSection(feature); final String expected = "[[Feature-name, Feature name]]" + newLine() + "= *Feature name*" + newLine() + newLine() + ...
[FOCAL] @Override public String FeatureSection.render(CukedoctorDocumentBuilder docBuilder, I18nLoader i18n, DocumentAttributes documentAttributes) [CLASS] class FeatureSection implements Section [METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] FeatureSection.featureRenderer.get/0, ...
/* static context [FOCAL] @Override public String FeatureSection.render(CukedoctorDocumentBuilder docBuilder, I18nLoader i18n, DocumentAttributes documentAttributes) [INPUTS] branches=- | result=docBuilder [CALLS-EXTERNAL] FeatureSection.featureRenderer.get/0, FeatureRenderer.setI18n/1, FeatureRenderer.setDocumentAttri...
/* static context [FOCAL] @Override public String FeatureSection.render(CukedoctorDocumentBuilder docBuilder, I18nLoader i18n, DocumentAttributes documentAttributes) [INPUTS] branches=- | result=docBuilder [CALLS-EXTERNAL] FeatureSection.featureRenderer.get/0, FeatureRenderer.setI18n/1, FeatureRenderer.setDocumentAttri...
true
ok
{"focal": {"class": "FeatureSection", "name": "render", "signature": "String render(CukedoctorDocumentBuilder docBuilder, I18nLoader i18n, DocumentAttributes documentAttributes)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "docBuilder", "type": "CukedoctorDocumentBuilder"}, {"name": "i18n", "...
36953044_19
class Stream implements Iterable<T> { public <R> R reduce(R initial, Func2<R, T, R> accumulator) { R value = initial; for (T anIt : this) value = accumulator.call(value, anIt); return value; } public static Stream<T> stream(final T[] array); public static Stream<T> ...
assertFalse(Stream.of().reduce(null).isPresent()); assertEquals((Integer) 9, Stream.of(9).reduce(null).get()); assertFalse(null, Stream.of(null, null, null).reduce(new Func2<Object, Object, Object>() { @Override public Object call(Object value1, Object value2) {return n...
[FOCAL] public R Stream.reduce(R initial, Func2<R, T, R> accumulator) [CLASS] class Stream implements Iterable<T> [METRICS] loc=6 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] Func2<R, T, R>.call/2 [PATH1] foreach(T anIt : this)=T -> exit loop -> return value [PATH2] foreach(T anIt : this)=F -> ...
/* static context [FOCAL] public R Stream.reduce(R initial, Func2<R, T, R> accumulator) [PATH1] foreach(T anIt : this)=T -> exit loop -> return value [PATH2] foreach(T anIt : this)=F -> return value [INPUTS] branches=- | result=accumulator, initial [COLLABORATORS] param accumulator:Func2<R, T, R> call/2 [CALLS-EXTERNAL...
/* static context [FOCAL] public R Stream.reduce(R initial, Func2<R, T, R> accumulator) [PATH1] foreach(T anIt : this)=T -> exit loop -> return value [PATH2] foreach(T anIt : this)=F -> return value [INPUTS] branches=- | result=accumulator, initial [COLLABORATORS] param accumulator:Func2<R, T, R> call/2 [CALLS-EXTERNAL...
true
ok
{"focal": {"class": "Stream", "name": "reduce", "signature": "R reduce(R initial, Func2<R, T, R> accumulator)", "start_line": 3, "modifiers": "public", "params": [{"name": "initial", "type": "R"}, {"name": "accumulator", "type": "Func2<R, T, R>"}], "return_type": "R"}, "class_info": {"name": "Stream", "kind": "class", ...
36960637_540
class TimestampTracker { @VisibleForTesting static void registerTimestampForTracking( Clock clock, MetricsManager metricsManager, String shortName, Supplier<Long> supplier) { metricsManager.registerMetric( TimestampTracker.class, shortName, Tr...
when(mockClock.getTick()).thenReturn(0L, CACHE_INTERVAL_NANOS - 1, CACHE_INTERVAL_NANOS + 1); AtomicLong timestampValue = new AtomicLong(0L); TimestampTracker.registerTimestampForTracking( mockClock, metricsManager, FAKE_METRIC, timestampValue::incrementAndGet); assertTh...
[FOCAL] @VisibleForTesting static void TimestampTracker.registerTimestampForTracking(Clock clock, MetricsManager metricsManager, String shortName, Supplier<Long> supplier) [CLASS] class TimestampTracker [METRICS] loc=8 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] MetricsManager.registerMetric/3...
/* static context [FOCAL] @VisibleForTesting static void TimestampTracker.registerTimestampForTracking(Clock clock, MetricsManager metricsManager, String shortName, Supplier<Long> supplier) [COLLABORATORS] param metricsManager:MetricsManager registerMetric/3 [CALLS-EXTERNAL] MetricsManager.registerMetric/3, TrackerUtil...
/* static context [FOCAL] @VisibleForTesting static void TimestampTracker.registerTimestampForTracking(Clock clock, MetricsManager metricsManager, String shortName, Supplier<Long> supplier) [COLLABORATORS] param metricsManager:MetricsManager registerMetric/3 [CALLS-EXTERNAL] MetricsManager.registerMetric/3, TrackerUtil...
true
ok
{"focal": {"class": "TimestampTracker", "name": "registerTimestampForTracking", "signature": "void registerTimestampForTracking(Clock clock, MetricsManager metricsManager, String shortName, Supplier<Long> supplier)", "start_line": 3, "modifiers": "@VisibleForTesting static", "params": [{"name": "clock", "type": "Clock"...
37007492_11
class CassandraIdSupplier implements IdSupplier<Long> { @Override public Long next() { return range(1)[0]; } public CassandraIdSupplier(Session session, String keySpace); long[] range(long size); long latest(); @Mock Session session; @Mock Row row; @Mock List<Row> rows...
assertThat(ids.next(), is(equalTo(1L))); } }
[FOCAL] @Override public Long CassandraIdSupplier.next() [CLASS] class CassandraIdSupplier implements IdSupplier<Long> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] long[] range(long size) [CLASS-MEMBERS] CassandraIdSupplier(Session session, String keySpace); long[] range(long si...
/* static context [FOCAL] @Override public Long CassandraIdSupplier.next() [CALLS-INTERNAL] long[] range(long size) */
/* static context [FOCAL] @Override public Long CassandraIdSupplier.next() [CALLS-INTERNAL] long[] range(long size) */ class CassandraIdSupplier implements IdSupplier<Long> { @Override public Long next() { return range(1)[0]; } public CassandraIdSupplier(Session session, String keySpace); ...
true
ok
{"focal": {"class": "CassandraIdSupplier", "name": "next", "signature": "Long next()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Long"}, "class_info": {"name": "CassandraIdSupplier", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "IdSupplier<Long>", "fields": [...
37063452_115
class SqoopIDFUtils { public static String toText(String string) { boolean escaped = false; StringBuilder sb = new StringBuilder(); int i; // Remove the trailing and starting quotes. string = removeQuotes(string); // Decode for (i = 0; i < string.length(); ++i) { char c = string.c...
String test = "'\\n'"; String expectedString = new String(new char[] { 0x0A }); String toString = toText(test); assertEquals(toString, expectedString); } }
[FOCAL] public static String SqoopIDFUtils.toText(String string) [CLASS] class SqoopIDFUtils [METRICS] loc=35 cc=5 branches=3 loops=1 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] String removeQuotes(String string) [CALLS-EXTERNAL] String.length/0, String.charAt/1, REPLACEMENTS.containsKey/1, REPLACEMENTS.get/1, String...
/* static context [FOCAL] public static String SqoopIDFUtils.toText(String string) [PATH1] for(i < string.length())=T -> if(escaped)=T -> if(REPLACEMENTS.containsKey(c))=T -> exit loop -> return sb.toString() [PATH2] for(i < string.length())=T -> if(escaped)=F -> switch(c)=case ESCAPE_CHARACTER -> exit loop -> return s...
/* static context [FOCAL] public static String SqoopIDFUtils.toText(String string) [PATH1] for(i < string.length())=T -> if(escaped)=T -> if(REPLACEMENTS.containsKey(c))=T -> exit loop -> return sb.toString() [PATH2] for(i < string.length())=T -> if(escaped)=F -> switch(c)=case ESCAPE_CHARACTER -> exit loop -> return s...
true
ok
{"focal": {"class": "SqoopIDFUtils", "name": "toText", "signature": "String toText(String string)", "start_line": 3, "modifiers": "public static", "params": [{"name": "string", "type": "String"}], "return_type": "String"}, "class_info": {"name": "SqoopIDFUtils", "kind": "class", "modifiers": "", "superclass": null, "in...
37063524_6
class ConfigManager { public void onNewConfigsFromScheduler(List<LogstashConfig> hostInfo, List<LogstashConfig> dockerInfo) { LOGGER.info("onNewConfigsFromScheduler, {}\n-------\n{}", dockerInfo, hostInfo); this.dockerInfo = dockerInfo; this.hostInfo = hostInfo; LOGGER.info(...
List<LogstashConfig> dockerFrameworks = asLogstashConfigList(framework1, framework2, framework3); List<LogstashConfig> hostFrameworks = asLogstashConfigList(hostFramework); configureAsRunningFrameworks(framework1); configManager.onNewConfigsFromScheduler(hostFrameworks, doc...
[FOCAL] public void ConfigManager.onNewConfigsFromScheduler(List<LogstashConfig> hostInfo, List<LogstashConfig> dockerInfo) [CLASS] class ConfigManager [METRICS] loc=9 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void updateDockerStreams() [CALLS-EXTERNAL] LOGGER.info/3, LOGGER.info/1, Logstash...
/* static context [FOCAL] public void ConfigManager.onNewConfigsFromScheduler(List<LogstashConfig> hostInfo, List<LogstashConfig> dockerInfo) [COLLABORATORS] field logstash:LogstashService update/2 [STATE] dockerInfo, hostInfo [CALLS-INTERNAL] void updateDockerStreams() [FIELDS] read=logstash:LogstashService | write=do...
/* static context [FOCAL] public void ConfigManager.onNewConfigsFromScheduler(List<LogstashConfig> hostInfo, List<LogstashConfig> dockerInfo) [COLLABORATORS] field logstash:LogstashService update/2 [STATE] dockerInfo, hostInfo [CALLS-INTERNAL] void updateDockerStreams() [FIELDS] read=logstash:LogstashService | write=do...
true
ok
{"focal": {"class": "ConfigManager", "name": "onNewConfigsFromScheduler", "signature": "void onNewConfigsFromScheduler(List<LogstashConfig> hostInfo, List<LogstashConfig> dockerInfo)", "start_line": 3, "modifiers": "public", "params": [{"name": "hostInfo", "type": "List<LogstashConfig>"}, {"name": "dockerInfo", "type":...
37125392_45
class DeepExperimentBuilder extends AbstractBuilder { @Override public DeepExperimentBuilder preprocessing(AnalysisEngineDescription preprocessing) { super.preprocessing(preprocessing); return this; } public DeepExperimentBuilder(); public DeepExperimentBuilder machineLearningBac...
builder.preprocessing(AnalysisEngineFactory.createEngineDescription(NoOpAnnotator.class)); assertTrue(builder.preprocessing != null); } }
[FOCAL] @Override public DeepExperimentBuilder DeepExperimentBuilder.preprocessing(AnalysisEngineDescription preprocessing) [CLASS] class DeepExperimentBuilder extends AbstractBuilder [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] AbstractBuilder.preprocessing/1 [DATAFLOW] preproc...
/* static context [FOCAL] @Override public DeepExperimentBuilder DeepExperimentBuilder.preprocessing(AnalysisEngineDescription preprocessing) [CALLS-EXTERNAL] AbstractBuilder.preprocessing/1 */
/* static context [FOCAL] @Override public DeepExperimentBuilder DeepExperimentBuilder.preprocessing(AnalysisEngineDescription preprocessing) [CALLS-EXTERNAL] AbstractBuilder.preprocessing/1 */ class DeepExperimentBuilder extends AbstractBuilder { @Override public DeepExperimentBuilder preprocessing(AnalysisEn...
true
ok
{"focal": {"class": "DeepExperimentBuilder", "name": "preprocessing", "signature": "DeepExperimentBuilder preprocessing(AnalysisEngineDescription preprocessing)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "preprocessing", "type": "AnalysisEngineDescription"}], "return_type": "DeepExperimentB...
37128954_67
class BluetoothConnector implements BluetoothServerThread.Listener, BluetoothClientThread.Listener { public synchronized void stopListeningForIncomingConnections() { if (mServerThread != null) { Log.i(TAG, "stopListeningForIncomingConnections: Stopping..."); mIsStoppingServer = true...
Field serverThreadField = mBluetoothConnector.getClass() .getDeclaredField("mServerThread"); serverThreadField.setAccessible(true); Field stoppingServerField = mBluetoothConnector.getClass() .getDeclaredField("mIsStoppingServer"); stoppingServerField.setA...
[FOCAL] public synchronized void BluetoothConnector.stopListeningForIncomingConnections() [CLASS] class BluetoothConnector implements BluetoothServerThread.Listener, BluetoothClientThread.Listener [METRICS] loc=8 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] Log.i/2, mServerThread.shutdown/0 [PA...
/* static context [FOCAL] public synchronized void BluetoothConnector.stopListeningForIncomingConnections() [PATH1] if(mServerThread != null)=T [PATH2] if(mServerThread != null)=F [COLLABORATORS] field mServerThread shutdown/0 [CALLS-EXTERNAL] Log.i/2, mServerThread.shutdown/0 */
/* static context [FOCAL] public synchronized void BluetoothConnector.stopListeningForIncomingConnections() [PATH1] if(mServerThread != null)=T [PATH2] if(mServerThread != null)=F [COLLABORATORS] field mServerThread shutdown/0 [CALLS-EXTERNAL] Log.i/2, mServerThread.shutdown/0 */ class BluetoothConnector implements Blu...
true
ok
{"focal": {"class": "BluetoothConnector", "name": "stopListeningForIncomingConnections", "signature": "void stopListeningForIncomingConnections()", "start_line": 3, "modifiers": "public synchronized", "params": [], "return_type": "void"}, "class_info": {"name": "BluetoothConnector", "kind": "class", "modifiers": "", "s...
37147644_29
class TemplateEncoder extends Encoder<Object> { @Override public void write(Object value, OutputStream outputStream) throws IOException { write(value, outputStream, Locale.getDefault()); } public TemplateEncoder(URL url); public TemplateEncoder(URL url, Charset charset); public Map<...
TemplateEncoder encoder = new TemplateEncoder(getClass().getResource("format1.txt")); String result; try (StringWriter writer = new StringWriter()) { encoder.write(4.5, writer); result = writer.toString(); } assertEquals("4.50", result); } }
[FOCAL] @Override public void TemplateEncoder.write(Object value, OutputStream outputStream) [CLASS] class TemplateEncoder extends Encoder<Object> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void write(Object value, OutputStream outputStream, Locale locale) [CALLS-EXTERNAL] Loc...
/* static context [FOCAL] @Override public void TemplateEncoder.write(Object value, OutputStream outputStream) [EXCEPTIONS] declares IOException [CALLS-INTERNAL] void write(Object value, OutputStream outputStream, Locale locale) [CALLS-EXTERNAL] Locale.getDefault/0 */
/* static context [FOCAL] @Override public void TemplateEncoder.write(Object value, OutputStream outputStream) [EXCEPTIONS] declares IOException [CALLS-INTERNAL] void write(Object value, OutputStream outputStream, Locale locale) [CALLS-EXTERNAL] Locale.getDefault/0 */ class TemplateEncoder extends Encoder<Object> { ...
true
ok
{"focal": {"class": "TemplateEncoder", "name": "write", "signature": "void write(Object value, OutputStream outputStream) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "value", "type": "Object"}, {"name": "outputStream", "type": "OutputStream"}], "return_type": "void"}, "cla...
37148584_2
class AbstractCharacterTerminatedMessageProtocol extends AbstractMessageProtocol { public boolean clientSendsToken() { return true; } public AbstractCharacterTerminatedMessageProtocol(Socket socket, char recordTerminator); @Override protected void writeMessage(String message); @Override public String readMes...
setupProtcolWithMessageAndExitToken("ANY", "XXX"); assertTrue( protocol.clientSendsToken() ); } }
[FOCAL] public boolean AbstractCharacterTerminatedMessageProtocol.clientSendsToken() [CLASS] class AbstractCharacterTerminatedMessageProtocol extends AbstractMessageProtocol [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] AbstractCharacterTerminatedMessageProtocol(Socket socket, cha...
/* static context [FOCAL] public boolean AbstractCharacterTerminatedMessageProtocol.clientSendsToken() */
/* static context [FOCAL] public boolean AbstractCharacterTerminatedMessageProtocol.clientSendsToken() */ class AbstractCharacterTerminatedMessageProtocol extends AbstractMessageProtocol { public boolean clientSendsToken() { return true; } public AbstractCharacterTerminatedMessageProtocol(Socket socket, char re...
true
ok
{"focal": {"class": "AbstractCharacterTerminatedMessageProtocol", "name": "clientSendsToken", "signature": "boolean clientSendsToken()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "AbstractCharacterTerminatedMessageProtocol", "kind": "class", "modifiers": "",...
37149914_1
class PortalPropertiesPrettierPortlet extends MVCPortlet { public void prettify(ActionRequest request, ActionResponse response) throws IOException, PortletException { String prettyProperties = prettify(request); request.setAttribute("portalPrettyProperties", prettyProperties); } public void serveResource(...
MockActionRequest request = new MockActionRequest(); MockActionResponse response = new MockActionResponse(); PortalPropertiesPrettierPortlet portlet = createMockBuilder( PortalPropertiesPrettierPortlet.class).addMockedMethod( "prettify", PortletRequest.class).createMock(); String expected = "expected";...
[FOCAL] public void PortalPropertiesPrettierPortlet.prettify(ActionRequest request, ActionResponse response) [CLASS] class PortalPropertiesPrettierPortlet extends MVCPortlet [METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] String prettify(PortletRequest request) [CALLS-EXTERNAL] Act...
/* static context [FOCAL] public void PortalPropertiesPrettierPortlet.prettify(ActionRequest request, ActionResponse response) [INPUTS] branches=- | result=- | unused=response [COLLABORATORS] param request:ActionRequest setAttribute/2 [EXCEPTIONS] declares IOException, PortletException [CALLS-INTERNAL] String prettify(...
/* static context [FOCAL] public void PortalPropertiesPrettierPortlet.prettify(ActionRequest request, ActionResponse response) [INPUTS] branches=- | result=- | unused=response [COLLABORATORS] param request:ActionRequest setAttribute/2 [EXCEPTIONS] declares IOException, PortletException [CALLS-INTERNAL] String prettify(...
true
ok
{"focal": {"class": "PortalPropertiesPrettierPortlet", "name": "prettify", "signature": "void prettify(ActionRequest request, ActionResponse response) throws IOException, PortletException", "start_line": 3, "modifiers": "public", "params": [{"name": "request", "type": "ActionRequest"}, {"name": "response", "type": "Act...
37256706_12
class HighlightDataMap implements Map<String, HighlightData> { @Override public boolean containsKey(Object key) { return map.containsKey(key); } public HighlightDataMap(); public HighlightDataMap(int initialCapacity); @Override public int size(); @Override public boolean isE...
assertThat(highlightDataMap.containsKey("key1"), is(true)); } }
[FOCAL] @Override public boolean HighlightDataMap.containsKey(Object key) [CLASS] class HighlightDataMap implements Map<String, HighlightData> [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] map.containsKey/1 [INPUTS] branches=- | result=key [COLLABORATORS] field map containsKey/1 ...
/* static context [FOCAL] @Override public boolean HighlightDataMap.containsKey(Object key) [INPUTS] branches=- | result=key [COLLABORATORS] field map containsKey/1 [CALLS-EXTERNAL] map.containsKey/1 */
/* static context [FOCAL] @Override public boolean HighlightDataMap.containsKey(Object key) [INPUTS] branches=- | result=key [COLLABORATORS] field map containsKey/1 [CALLS-EXTERNAL] map.containsKey/1 */ class HighlightDataMap implements Map<String, HighlightData> { @Override public boolean containsKey(Object k...
true
ok
{"focal": {"class": "HighlightDataMap", "name": "containsKey", "signature": "boolean containsKey(Object key)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "key", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "HighlightDataMap", "kind": "class", "modifiers": "", "supercl...
37286678_3
class DeepLinkAnnotatedElement { String getUri() { return uri; } DeepLinkAnnotatedElement(String annotation, Element element, DeepLinkEntry.Type type); DeepLinkEntry.Type getAnnotationType(); TypeElement getAnnotatedElement(); String getMethod(); Element getElement(); @Mock TypeElement ele...
DeepLinkAnnotatedElement annotatedElement = new DeepLinkAnnotatedElement( "airbnb://example.com/{foo}/bar", element, DeepLinkEntry.Type.CLASS); assertThat(annotatedElement.getUri()).isEqualTo("airbnb://example.com/{foo}/bar"); } }
[FOCAL] String DeepLinkAnnotatedElement.getUri() [CLASS] class DeepLinkAnnotatedElement [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] DeepLinkAnnotatedElement(String annotation, Element element, DeepLinkEntry.Type type); DeepLinkEntry.Type getAnnotationType(); TypeElement getAnnot...
/* static context [FOCAL] String DeepLinkAnnotatedElement.getUri() */
/* static context [FOCAL] String DeepLinkAnnotatedElement.getUri() */ class DeepLinkAnnotatedElement { String getUri() { return uri; } DeepLinkAnnotatedElement(String annotation, Element element, DeepLinkEntry.Type type); DeepLinkEntry.Type getAnnotationType(); TypeElement getAnnotatedElement(); ...
true
ok
{"focal": {"class": "DeepLinkAnnotatedElement", "name": "getUri", "signature": "String getUri()", "start_line": 3, "modifiers": "", "params": [], "return_type": "String"}, "class_info": {"name": "DeepLinkAnnotatedElement", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "el...
37293168_20
class GameOfLife implements RainbowInputController.RainbowInteractionListener, OnCellUpdatedCallback2D, RainbowDrawer.PointDetectedListener { @Override public void onPointDetected(float px, float py, float x, float y) { int cellX = (int) (x / CELL_SIZE); int cellY = (int) (y / CELL_SIZE); ...
givenThatAutomataHasAllCellsDead(); assertThat(gameOfLifeAutomata.getCells()[ANY_CELL_X][ANY_CELL_Y]).isEqualTo(DEAD); gameOfLife.onPointDetected(ANY_CELL_X, ANY_CELL_Y, ANY_CELL_X, ANY_CELL_Y); assertThat(gameOfLifeAutomata.getCells()[ANY_CELL_X][ANY_CELL_Y]).isEqualTo(ALIVE); } ...
[FOCAL] @Override public void GameOfLife.onPointDetected(float px, float py, float x, float y) [CLASS] class GameOfLife implements RainbowInputController.RainbowInteractionListener, OnCellUpdatedCallback2D, RainbowDrawer.PointDetectedListener [METRICS] loc=10 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-...
/* static context [FOCAL] @Override public void GameOfLife.onPointDetected(float px, float py, float x, float y) [PATH1] if(cellX >= 0 && cellX < gameOfLifeAutomata.getWidth() && cellY >= 0 && cellY < gameOfLifeAutomata.getHeight())=T [PATH2] if(cellX >= 0 && cellX < gameOfLifeAutomata.getWidth() && cellY >= 0 && cellY...
/* static context [FOCAL] @Override public void GameOfLife.onPointDetected(float px, float py, float x, float y) [PATH1] if(cellX >= 0 && cellX < gameOfLifeAutomata.getWidth() && cellY >= 0 && cellY < gameOfLifeAutomata.getHeight())=T [PATH2] if(cellX >= 0 && cellX < gameOfLifeAutomata.getWidth() && cellY >= 0 && cellY...
true
ok
{"focal": {"class": "GameOfLife", "name": "onPointDetected", "signature": "void onPointDetected(float px, float py, float x, float y)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "px", "type": "float"}, {"name": "py", "type": "float"}, {"name": "x", "type": "float"}, {"name": "y", "type": "fl...
37299113_0
class Tracker { public void add(TimeEntry entry) { entries.add(entry); } public void remove(TimeEntry entry); public int size(); public TimeEntry get(int index); @Autowired private Tracker tracker; } class TrackerTest { @Autowired private Tracker tracker; @Test ...
TimeEntry entry = new TimeEntry(); entry.setDescription("Entry Test"); entry.setRate(80.0f); entry.setTime(3); tracker.add(entry); assertTrue(tracker.size() > 0); } }
[FOCAL] public void Tracker.add(TimeEntry entry) [CLASS] class Tracker [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] entries.add/1 [COLLABORATORS] field entries add/1 [DATAFLOW] entry@param->L2 [CLASS-MEMBERS] void remove(TimeEntry entry); int size(); TimeEntry get(int index) [TE...
/* static context [FOCAL] public void Tracker.add(TimeEntry entry) [COLLABORATORS] field entries add/1 [CALLS-EXTERNAL] entries.add/1 */
/* static context [FOCAL] public void Tracker.add(TimeEntry entry) [COLLABORATORS] field entries add/1 [CALLS-EXTERNAL] entries.add/1 */ class Tracker { public void add(TimeEntry entry) { entries.add(entry); } public void remove(TimeEntry entry); public int size(); public TimeEntry get(int...
true
ok
{"focal": {"class": "Tracker", "name": "add", "signature": "void add(TimeEntry entry)", "start_line": 3, "modifiers": "public", "params": [{"name": "entry", "type": "TimeEntry"}], "return_type": "void"}, "class_info": {"name": "Tracker", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields"...
37318294_19
class CreditCardRegexValidatorService extends BasicAbstractRegexValidatorService { @Override public boolean validate(String cc) { cc = NON_DIGIT.matcher(cc).replaceAll(""); if (isRepeated(cc)) { return false; } int sum = 0; boolean odd = false; for (i...
String tituloEleitor = "4369811367191812"; assertFalse(service.validate(tituloEleitor)); } }
[FOCAL] @Override public boolean CreditCardRegexValidatorService.validate(String cc) [CLASS] class CreditCardRegexValidatorService extends BasicAbstractRegexValidatorService [METRICS] loc=21 cc=5 branches=3 loops=1 returns=2 throws=0 nesting=3 [CALLS-INTERNAL] boolean isRepeated(String str) [CALLS-EXTERNAL] NON_DIGIT.m...
/* static context [FOCAL] @Override public boolean CreditCardRegexValidatorService.validate(String cc) [PATH1] if(isRepeated(cc))=F -> for(index >= 0)=T -> if(odd)=T -> if(n > 9)=T -> exit loop -> return (sum % 10 == 0) [PATH2] if(isRepeated(cc))=T -> return false [PATH3] if(isRepeated(cc))=F -> for(index >= 0)=F -> re...
/* static context [FOCAL] @Override public boolean CreditCardRegexValidatorService.validate(String cc) [PATH1] if(isRepeated(cc))=F -> for(index >= 0)=T -> if(odd)=T -> if(n > 9)=T -> exit loop -> return (sum % 10 == 0) [PATH2] if(isRepeated(cc))=T -> return false [PATH3] if(isRepeated(cc))=F -> for(index >= 0)=F -> re...
true
ok
{"focal": {"class": "CreditCardRegexValidatorService", "name": "validate", "signature": "boolean validate(String cc)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "cc", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "CreditCardRegexValidatorService", "kind": "class", "mo...
37418050_9
class SELECT extends SqlRootNode { public FROM FROM(@NonNull String tableName) { return new FROM(this, tableName); } public SELECT(@NonNull String... columns); @Override public String getSql(); public FROM FROM(@NonNull String... tableNames); } class SelectTest { @Test public void testSelectFromN...
int tests = 100; int columns = 5; for (int i = 0; i < tests; i++) { Columns c = new Columns(columns); String tableName = "table" + i; String whereClause = "col1=val1 AND col2=val2"; String groupBy = "col" + i; String tableToJoin = "TableName" + i; String sql = new SEL...
[FOCAL] public FROM SELECT.FROM(String tableName) [CLASS] class SELECT extends SqlRootNode [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] FROM [INPUTS] branches=- | result=tableName [DATAFLOW] tableName@param->L2 [CLASS-MEMBERS] SELECT(String... columns); String getSql(); FROM FROM(String......
/* static context [FOCAL] public FROM SELECT.FROM(String tableName) [INPUTS] branches=- | result=tableName [NEW] FROM */
/* static context [FOCAL] public FROM SELECT.FROM(String tableName) [INPUTS] branches=- | result=tableName [NEW] FROM */ class SELECT extends SqlRootNode { public FROM FROM(@NonNull String tableName) { return new FROM(this, tableName); } public SELECT(@NonNull String... columns); @Override public String...
true
ok
{"focal": {"class": "SELECT", "name": "FROM", "signature": "FROM FROM(String tableName)", "start_line": 3, "modifiers": "public", "params": [{"name": "tableName", "type": "String"}], "return_type": "FROM"}, "class_info": {"name": "SELECT", "kind": "class", "modifiers": "", "superclass": "SqlRootNode", "interfaces": nul...
37421395_11
class BisectBoundaryHelper { public static BisectStep getNextStep(BisectStep step, boolean isSuccess) { return isSuccess ? later(step.getLeft(), step.getRight()) : earlier(step.getLeft(), step.getRight()); } private BisectBoundaryHelper(); public static BisectStep firstStep(int number); ...
BisectStep actual = BisectBoundaryHelper.getNextStep(new BisectStep(0, 0), true); assertNull(actual); actual = BisectBoundaryHelper.getNextStep(new BisectStep(0, 0), false); assertNull(actual); } }
[FOCAL] public static BisectStep BisectBoundaryHelper.getNextStep(BisectStep step, boolean isSuccess) [CLASS] class BisectBoundaryHelper [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] BisectStep earlier(int left, int right); BisectStep later(int left, int right) [CALLS-EXTERNAL] B...
/* static context [FOCAL] public static BisectStep BisectBoundaryHelper.getNextStep(BisectStep step, boolean isSuccess) [INPUTS] branches=- | result=isSuccess, step [COLLABORATORS] param step:BisectStep getLeft/0,getRight/0 [CALLS-INTERNAL] BisectStep earlier(int left, int right); BisectStep later(int left, int right) ...
/* static context [FOCAL] public static BisectStep BisectBoundaryHelper.getNextStep(BisectStep step, boolean isSuccess) [INPUTS] branches=- | result=isSuccess, step [COLLABORATORS] param step:BisectStep getLeft/0,getRight/0 [CALLS-INTERNAL] BisectStep earlier(int left, int right); BisectStep later(int left, int right) ...
true
ok
{"focal": {"class": "BisectBoundaryHelper", "name": "getNextStep", "signature": "BisectStep getNextStep(BisectStep step, boolean isSuccess)", "start_line": 3, "modifiers": "public static", "params": [{"name": "step", "type": "BisectStep"}, {"name": "isSuccess", "type": "boolean"}], "return_type": "BisectStep"}, "class_...
37447498_36
class GlucoseRanges { public String colorFromReading(double reading) { if (reading < HYPO_LIMIT) { // hypo limit 70 return "purple"; } else if (reading > HYPER_LIMIT) { // hyper limit 200 return "red"; } else if (reading < userMin) { ...
assertTrue(glucoseRanges.colorFromReading(90).equals("blue")); } }
[FOCAL] public String GlucoseRanges.colorFromReading(double reading) [CLASS] class GlucoseRanges [METRICS] loc=18 cc=5 branches=4 loops=0 returns=5 throws=0 nesting=4 [PATH1] if(reading < HYPO_LIMIT)=F -> if(reading > HYPER_LIMIT)=F -> if(reading < userMin)=F -> if(reading > userMax)=T -> return "orange" [PATH2] if(rea...
/* static context [FOCAL] public String GlucoseRanges.colorFromReading(double reading) [PATH1] if(reading < HYPO_LIMIT)=F -> if(reading > HYPER_LIMIT)=F -> if(reading < userMin)=F -> if(reading > userMax)=T -> return "orange" [PATH2] if(reading < HYPO_LIMIT)=T -> return "purple" [PATH3] if(reading < HYPO_LIMIT)=F -> if...
/* static context [FOCAL] public String GlucoseRanges.colorFromReading(double reading) [PATH1] if(reading < HYPO_LIMIT)=F -> if(reading > HYPER_LIMIT)=F -> if(reading < userMin)=F -> if(reading > userMax)=T -> return "orange" [PATH2] if(reading < HYPO_LIMIT)=T -> return "purple" [PATH3] if(reading < HYPO_LIMIT)=F -> if...
true
ok
{"focal": {"class": "GlucoseRanges", "name": "colorFromReading", "signature": "String colorFromReading(double reading)", "start_line": 3, "modifiers": "public", "params": [{"name": "reading", "type": "double"}], "return_type": "String"}, "class_info": {"name": "GlucoseRanges", "kind": "class", "modifiers": "", "supercl...
37462781_28
class Variable extends Element implements TypedElement { public final T getInitialValue() { return this.initialValue.orNull(); } protected Variable(final Type type, final String id, final T initialValue); public Variable(final Type type, final String id); public final String getId(); ...
Variable v = Variable.create(Type.BOOL, "test", null); assertEquals(null, v.getInitialValue()); Variable w = Variable.create(Type.BOOL, "test", "true"); assertEquals(true, w.getInitialValue()); } }
[FOCAL] public final T Variable.getInitialValue() [CLASS] class Variable extends Element implements TypedElement [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] this.initialValue.orNull/0 [FIELDS] read=initialValue [COLLABORATORS] field initialValue orNull/0 [CLASS-MEMBERS] Variabl...
/* static context [FOCAL] public final T Variable.getInitialValue() [COLLABORATORS] field initialValue orNull/0 [FIELDS] read=initialValue [CALLS-EXTERNAL] this.initialValue.orNull/0 */
/* static context [FOCAL] public final T Variable.getInitialValue() [COLLABORATORS] field initialValue orNull/0 [FIELDS] read=initialValue [CALLS-EXTERNAL] this.initialValue.orNull/0 */ class Variable extends Element implements TypedElement { public final T getInitialValue() { return this.initialValue.orNu...
true
ok
{"focal": {"class": "Variable", "name": "getInitialValue", "signature": "T getInitialValue()", "start_line": 3, "modifiers": "public final", "params": [], "return_type": "T"}, "class_info": {"name": "Variable", "kind": "class", "modifiers": "", "superclass": "Element", "interfaces": "TypedElement", "fields": [], "membe...
37475020_14
class Misc { public static boolean doubleEquals(final double a, final double b, final double epsilon) { final double diff = Math.abs(a - b); return diff < epsilon || (Double.isNaN(diff) && a == b); // Handle the case where a = b = Double.POSITIVE_INFINITY or a = b = Double.N...
final double a = 0.00001; final double b = 0.00001; assertTrue(Misc.doubleEquals(a, b, 0.00001)); } }
[FOCAL] public static boolean Misc.doubleEquals(double a, double b, double epsilon) [CLASS] class Misc [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Math.abs/1, Double.isNaN/1 [INPUTS] branches=- | result=a, b, epsilon [DATAFLOW] a@param->L3,L4; b@param->L3,L4; diff@L3->L4; epsil...
/* static context [FOCAL] public static boolean Misc.doubleEquals(double a, double b, double epsilon) [INPUTS] branches=- | result=a, b, epsilon [CALLS-EXTERNAL] Math.abs/1, Double.isNaN/1 */
/* static context [FOCAL] public static boolean Misc.doubleEquals(double a, double b, double epsilon) [INPUTS] branches=- | result=a, b, epsilon [CALLS-EXTERNAL] Math.abs/1, Double.isNaN/1 */ class Misc { public static boolean doubleEquals(final double a, final double b, final double epsilon) { ...
true
ok
{"focal": {"class": "Misc", "name": "doubleEquals", "signature": "boolean doubleEquals(double a, double b, double epsilon)", "start_line": 3, "modifiers": "public static", "params": [{"name": "a", "type": "double"}, {"name": "b", "type": "double"}, {"name": "epsilon", "type": "double"}], "return_type": "boolean"}, "cla...
37485046_17
class KNNClassifier extends Classifier { public int getNumFeatures() { return model.numFeatures; } public KNNClassifier(int k, int numFeatures); public KNNClassifier(Object objModel); @Override public boolean train(List<FeatureVector> data); @Override public int classify(FeatureVector featureVector); @Ove...
assertEquals("KnnClassifier.getNumFeatures failed", knnClassifier.getNumFeatures(),numFeatures); } }
[FOCAL] public int KNNClassifier.getNumFeatures() [CLASS] class KNNClassifier extends Classifier [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] KNNClassifier(int k, int numFeatures); KNNClassifier(Object objModel); boolean train(List<FeatureVector> data); int classify(FeatureVector...
/* static context [FOCAL] public int KNNClassifier.getNumFeatures() */
/* static context [FOCAL] public int KNNClassifier.getNumFeatures() */ class KNNClassifier extends Classifier { public int getNumFeatures() { return model.numFeatures; } public KNNClassifier(int k, int numFeatures); public KNNClassifier(Object objModel); @Override public boolean train(List<FeatureVector> da...
true
ok
{"focal": {"class": "KNNClassifier", "name": "getNumFeatures", "signature": "int getNumFeatures()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "KNNClassifier", "kind": "class", "modifiers": "", "superclass": "Classifier", "interfaces": null, "fields": [{"name": "...
37507175_40
class CamundaBpmConfiguration { @Bean @ConditionalOnMissingBean(ProcessEngineConfigurationImpl.class) public ProcessEngineConfigurationImpl processEngineConfigurationImpl(List<ProcessEnginePlugin> processEnginePlugins) { final SpringProcessEngineConfiguration configuration = CamundaSpringBootUtil.springProce...
CamundaBpmConfiguration camundaBpmConfiguration = new CamundaBpmConfiguration(); List<ProcessEnginePlugin> processEnginePlugins = createUnordedList(); ProcessEngineConfigurationImpl processEngineConfigurationImpl = camundaBpmConfiguration.processEngineConfigurationImpl(processEnginePlugins); CompositeP...
[FOCAL] @Bean @ConditionalOnMissingBean(ProcessEngineConfigurationImpl.class) public ProcessEngineConfigurationImpl CamundaBpmConfiguration.processEngineConfigurationImpl(List<ProcessEnginePlugin> processEnginePlugins) [CLASS] class CamundaBpmConfiguration [METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nest...
/* static context [FOCAL] @Bean @ConditionalOnMissingBean(ProcessEngineConfigurationImpl.class) public ProcessEngineConfigurationImpl CamundaBpmConfiguration.processEngineConfigurationImpl(List<ProcessEnginePlugin> processEnginePlugins) [NEW] CompositeProcessEnginePlugin [CALLS-EXTERNAL] CamundaSpringBootUtil.springPro...
/* static context [FOCAL] @Bean @ConditionalOnMissingBean(ProcessEngineConfigurationImpl.class) public ProcessEngineConfigurationImpl CamundaBpmConfiguration.processEngineConfigurationImpl(List<ProcessEnginePlugin> processEnginePlugins) [NEW] CompositeProcessEnginePlugin [CALLS-EXTERNAL] CamundaSpringBootUtil.springPro...
true
ok
{"focal": {"class": "CamundaBpmConfiguration", "name": "processEngineConfigurationImpl", "signature": "ProcessEngineConfigurationImpl processEngineConfigurationImpl(List<ProcessEnginePlugin> processEnginePlugins)", "start_line": 3, "modifiers": "@Bean @ConditionalOnMissingBean(ProcessEngineConfigurationImpl.class) publ...
37523659_1
class BooksListPresenter extends MvpBasePresenter<BooksListView> { public void loadBooks(final boolean pullToRefresh) { if(isViewAttached()) { getView().showLoading(pullToRefresh); } dataFetcher.getBooks(new DataCallback<Book[]>() { @Override public vo...
//Given presenter = new BooksListPresenter(dataFetcher); presenter.attachView(view); boolean pullToRefresh = true; //When presenter.loadBooks(pullToRefresh); //Then ArgumentCaptor<DataCallback> dataCallbackArg = ArgumentCaptor.forClass(DataCallback.class...
[FOCAL] public void BooksListPresenter.loadBooks(boolean pullToRefresh) [CLASS] class BooksListPresenter extends MvpBasePresenter<BooksListView> [METRICS] loc=24 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] isViewAttached/0 (inherited), getView().showLoading/1, getView/0 (inherited), DataFetche...
/* static context [FOCAL] public void BooksListPresenter.loadBooks(boolean pullToRefresh) [PATH1] if(isViewAttached())=T [PATH2] if(isViewAttached())=F [COLLABORATORS] field dataFetcher:DataFetcher getBooks/1 [FIELDS] read=dataFetcher:DataFetcher [NEW] DataCallback<Book[]>, Throwable [CALLS-EXTERNAL] isViewAttached/0 (...
/* static context [FOCAL] public void BooksListPresenter.loadBooks(boolean pullToRefresh) [PATH1] if(isViewAttached())=T [PATH2] if(isViewAttached())=F [COLLABORATORS] field dataFetcher:DataFetcher getBooks/1 [FIELDS] read=dataFetcher:DataFetcher [NEW] DataCallback<Book[]>, Throwable [CALLS-EXTERNAL] isViewAttached/0 (...
true
ok
{"focal": {"class": "BooksListPresenter", "name": "loadBooks", "signature": "void loadBooks(boolean pullToRefresh)", "start_line": 3, "modifiers": "public", "params": [{"name": "pullToRefresh", "type": "boolean"}], "return_type": "void"}, "class_info": {"name": "BooksListPresenter", "kind": "class", "modifiers": "", "s...
37629393_2
class ConfigFieldsDefiner extends PrototypicalClassAdapter { private ConfigFieldsDefiner( int classWriterFlags, String className, ConfigClassScanner configScanner, Map<String, ?> config) { super(classWriterFlags, className); this.configScanner = configScanner; this.config = conf...
final String field = "UNDEFINED"; final String value = "blah"; Map<String, String> config = new HashMap<>(); config.put(field, value); byte[] bytecode = ConfigFieldsDefiner.define(className, classFile, config); ConfigClassScanner configClassScanner = runClassScanner(className, nul...
[FOCAL] private ConfigFieldsDefiner.ConfigFieldsDefiner(int classWriterFlags, String className, ConfigClassScanner configScanner, Map<String, ?> config) [CLASS] class ConfigFieldsDefiner extends PrototypicalClassAdapter [METRICS] loc=9 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [FIELDS] write=config, configSc...
/* static context [FOCAL] private ConfigFieldsDefiner.ConfigFieldsDefiner(int classWriterFlags, String className, ConfigClassScanner configScanner, Map<String, ?> config) [STATE] config, configScanner [FIELDS] write=config, configScanner */
/* static context [FOCAL] private ConfigFieldsDefiner.ConfigFieldsDefiner(int classWriterFlags, String className, ConfigClassScanner configScanner, Map<String, ?> config) [STATE] config, configScanner [FIELDS] write=config, configScanner */ class ConfigFieldsDefiner extends PrototypicalClassAdapter { private ConfigF...
true
ok
{"focal": {"class": "ConfigFieldsDefiner", "name": "ConfigFieldsDefiner", "signature": "ConfigFieldsDefiner(int classWriterFlags, String className, ConfigClassScanner configScanner, Map<String, ?> config)", "start_line": 3, "modifiers": "private", "params": [{"name": "classWriterFlags", "type": "int"}, {"name": "classN...
37632768_1
class Searcher { public SearchResult search(String term) { if (term == null || term.trim().isEmpty()) { LOGGER.debug("No query term supplied, returning empty results."); return new SearchResult(); } THROTTLE.acquire(); String normalizedTerm = term.toLowerCa...
setupMock(); Searcher searcher = new Searcher(new ConferenceSessionLoader(getConfiguration())); SearchResult result = searcher.search("clojure"); assertNotNull(result); assertTrue(result.getResults().size() > 0); } }
[FOCAL] public SearchResult Searcher.search(String term) [CLASS] class Searcher [METRICS] loc=51 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=3 [CALLS-EXTERNAL] term.trim().isEmpty/0, String.trim/0, LOGGER.debug/1, THROTTLE.acquire/0, String.toLowerCase/0, loader.load/0, Iterables.filter/2, input.getTags/0, tag.t...
/* static context [FOCAL] public SearchResult Searcher.search(String term) [PATH1] if(term == null || term.trim().isEmpty())=T -> return new SearchResult() [PATH2] if(term == null || term.trim().isEmpty())=F -> return new SearchResult(Lists.newArrayList( Iterables.transform(filteredRe... [INPUTS] branches=term | result...
/* static context [FOCAL] public SearchResult Searcher.search(String term) [PATH1] if(term == null || term.trim().isEmpty())=T -> return new SearchResult() [PATH2] if(term == null || term.trim().isEmpty())=F -> return new SearchResult(Lists.newArrayList( Iterables.transform(filteredRe... [INPUTS] branches=term | result...
true
ok
{"focal": {"class": "Searcher", "name": "search", "signature": "SearchResult search(String term)", "start_line": 3, "modifiers": "public", "params": [{"name": "term", "type": "String"}], "return_type": "SearchResult"}, "class_info": {"name": "Searcher", "kind": "class", "modifiers": "", "superclass": null, "interfaces"...
37656718_2
class CXFClientConfigurer extends ConfigHelper { @Override public void setConfigProperties(Object client, String configFile, String configName) { Class<?> clazz = !(client instanceof Dispatch) ? client.getClass() : null; ClientConfig config = readConfig(configFile, configName, clazz, (BindingProvider...
Bus bus = null; try { bus = BusFactory.newInstance().createBus(); BusFactory.setThreadDefaultBus(bus); Service service = Service.create(this.getClass().getResource("META-INF/TestService.wsdl"), new QName("http://www.openuri.org/2004/04/HelloWorld", "EndpointService")); ...
[FOCAL] @Override public void CXFClientConfigurer.setConfigProperties(Object client, String configFile, String configName) [CLASS] class CXFClientConfigurer extends ConfigHelper [METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void setConfigProperties(Object client, ClientConfig con...
/* static context [FOCAL] @Override public void CXFClientConfigurer.setConfigProperties(Object client, String configFile, String configName) [CALLS-INTERNAL] void setConfigProperties(Object client, ClientConfig config) [CALLS-EXTERNAL] Object.getClass/0, readConfig/4 (inherited) */
/* static context [FOCAL] @Override public void CXFClientConfigurer.setConfigProperties(Object client, String configFile, String configName) [CALLS-INTERNAL] void setConfigProperties(Object client, ClientConfig config) [CALLS-EXTERNAL] Object.getClass/0, readConfig/4 (inherited) */ class CXFClientConfigurer extends Con...
true
ok
{"focal": {"class": "CXFClientConfigurer", "name": "setConfigProperties", "signature": "void setConfigProperties(Object client, String configFile, String configName)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "client", "type": "Object"}, {"name": "configFile", "type": "String"}, {"name": "c...
37672572_3
class Recast { public static void clearUnwalkableTriangles(Context ctx, float walkableSlopeAngle, float[] verts, int nv, int[] tris, int nt, int[] areas) { float walkableThr = (float) Math.cos(walkableSlopeAngle / 180.0f * Math.PI); float norm[] = new float[3]; for (int i = 0;...
float walkableSlopeAngle = 45; float verts[] = { 0, 0, 0, 1, 0, 0, 0, 0, -1 }; int nv = 3; int walkable_tri[] = { 0, 1, 2 }; int unwalkable_tri[] = { 0, 2, 1 }; int nt = 1; Context ctx = new Context(); { int areas[] = { 42 }; Recas...
[FOCAL] public static void Recast.clearUnwalkableTriangles(Context ctx, float walkableSlopeAngle, float[] verts, int nv, int[] tris, int nt, int[] areas) [CLASS] class Recast [METRICS] loc=14 cc=3 branches=1 loops=1 returns=0 throws=0 nesting=2 [CALLS-INTERNAL] void calcTriNormal(float[] verts, int v0, int v1, int v2, ...
/* static context [FOCAL] public static void Recast.clearUnwalkableTriangles(Context ctx, float walkableSlopeAngle, float[] verts, int nv, int[] tris, int nt, int[] areas) [PATH1] for(i < nt)=T -> if(norm[1] <= walkableThr)=T -> exit loop [PATH2] for(i < nt)=F [PATH3] for(i < nt)=T -> if(norm[1] <= walkableThr)=F -> ex...
/* static context [FOCAL] public static void Recast.clearUnwalkableTriangles(Context ctx, float walkableSlopeAngle, float[] verts, int nv, int[] tris, int nt, int[] areas) [PATH1] for(i < nt)=T -> if(norm[1] <= walkableThr)=T -> exit loop [PATH2] for(i < nt)=F [PATH3] for(i < nt)=T -> if(norm[1] <= walkableThr)=F -> ex...
true
ok
{"focal": {"class": "Recast", "name": "clearUnwalkableTriangles", "signature": "void clearUnwalkableTriangles(Context ctx, float walkableSlopeAngle, float[] verts, int nv, int[] tris, int nt, int[] areas)", "start_line": 3, "modifiers": "public static", "params": [{"name": "ctx", "type": "Context"}, {"name": "walkableS...
37712296_2
class RootBeer { public boolean detectPotentiallyDangerousApps() { return detectPotentiallyDangerousApps(null); } public RootBeer(Context context); public boolean isRooted(); @Deprecated public boolean isRootedWithoutBusyBoxCheck(); public boolean isRootedWithBusyBoxCheck(); publ...
RootBeer rootBeer = new RootBeer(getMockedContext(null)); rootBeer.setLogging(false); // Should be false as no packages detected assertFalse(rootBeer.detectPotentiallyDangerousApps()); rootBeer = new RootBeer(getMockedContext(Const.knownDangerousAppsPackages[0])); root...
[FOCAL] public boolean RootBeer.detectPotentiallyDangerousApps() [CLASS] class RootBeer [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] boolean detectPotentiallyDangerousApps(String[] additionalDangerousApps) [CLASS-MEMBERS] RootBeer(Context context); boolean isRooted(); boolean is...
/* static context [FOCAL] public boolean RootBeer.detectPotentiallyDangerousApps() [CALLS-INTERNAL] boolean detectPotentiallyDangerousApps(String[] additionalDangerousApps) */
/* static context [FOCAL] public boolean RootBeer.detectPotentiallyDangerousApps() [CALLS-INTERNAL] boolean detectPotentiallyDangerousApps(String[] additionalDangerousApps) */ class RootBeer { public boolean detectPotentiallyDangerousApps() { return detectPotentiallyDangerousApps(null); } public ...
true
ok
{"focal": {"class": "RootBeer", "name": "detectPotentiallyDangerousApps", "signature": "boolean detectPotentiallyDangerousApps()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "RootBeer", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null,...
37720965_35
class SubscriptionMapper { public Subscription convert(SubscriptionEntity subscriptionEntity) { final Subscription subscriptionItem = new Subscription(); subscriptionItem.setId(subscriptionEntity.getId()); subscriptionItem.setApi(subscriptionEntity.getApi()); subscriptionItem.setApp...
Instant now = Instant.now(); Date nowDate = Date.from(now); //init subscriptionEntity = new SubscriptionEntity(); subscriptionEntity.setApi(SUBSCRIPTION_API); subscriptionEntity.setApplication(SUBSCRIPTION_APPLICATION); subscriptionEntity.setClientId(SUBS...
[FOCAL] public Subscription SubscriptionMapper.convert(SubscriptionEntity subscriptionEntity) [CLASS] class SubscriptionMapper [METRICS] loc=19 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] OffsetDateTime getDate(Date date) [CALLS-EXTERNAL] Subscription.setId/1, SubscriptionEntity.getId/0, Subsc...
/* static context [FOCAL] public Subscription SubscriptionMapper.convert(SubscriptionEntity subscriptionEntity) [COLLABORATORS] param subscriptionEntity:SubscriptionEntity getId/0,getApi/0,getApplication/0,getCreatedAt/0,getEndingAt/0,getProcessedAt/0 [CALLS-INTERNAL] OffsetDateTime getDate(Date date) [NEW] Subscriptio...
/* static context [FOCAL] public Subscription SubscriptionMapper.convert(SubscriptionEntity subscriptionEntity) [COLLABORATORS] param subscriptionEntity:SubscriptionEntity getId/0,getApi/0,getApplication/0,getCreatedAt/0,getEndingAt/0,getProcessedAt/0 [CALLS-INTERNAL] OffsetDateTime getDate(Date date) [NEW] Subscriptio...
true
ok
{"focal": {"class": "SubscriptionMapper", "name": "convert", "signature": "Subscription convert(SubscriptionEntity subscriptionEntity)", "start_line": 3, "modifiers": "public", "params": [{"name": "subscriptionEntity", "type": "SubscriptionEntity"}], "return_type": "Subscription"}, "class_info": {"name": "SubscriptionM...
37728390_15
class GeomVectorField extends GeomField { public Bag getObjectsWithinDistance(final Geometry g, final double dist) { Bag nearbyObjects = new Bag(); Envelope e = g.getEnvelopeInternal(); e.expandBy(dist); List<?> gList = spatialIndex.query(e); // However, the JTS QuadTr...
System.out.println("getObjectsWithinDistance"); GeomVectorField instance = new GeomVectorField(); addEvenlySpacedPoints(100, 100, 10, instance); MasonGeometry testPoint = new MasonGeometry(createPoint(50,50)); Bag result = instance.getObjectsWithinDistance(testPoint, 10.0); ...
[FOCAL] public Bag GeomVectorField.getObjectsWithinDistance(Geometry g, double dist) [CLASS] class GeomVectorField extends GeomField [METRICS] loc=24 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] Geometry.getEnvelopeInternal/0, Envelope.expandBy/1, spatialIndex.query/1, List<?>.size/0, List<?>.g...
/* static context [FOCAL] public Bag GeomVectorField.getObjectsWithinDistance(Geometry g, double dist) [PATH1] for(i < gList.size())=T -> if(g.isWithinDistance(tempGeometry.getGeometry(), dist))=T -> exit loop -> return nearbyObjects [PATH2] for(i < gList.size())=F -> return nearbyObjects [PATH3] for(i < gList.size())=...
/* static context [FOCAL] public Bag GeomVectorField.getObjectsWithinDistance(Geometry g, double dist) [PATH1] for(i < gList.size())=T -> if(g.isWithinDistance(tempGeometry.getGeometry(), dist))=T -> exit loop -> return nearbyObjects [PATH2] for(i < gList.size())=F -> return nearbyObjects [PATH3] for(i < gList.size())=...
true
ok
{"focal": {"class": "GeomVectorField", "name": "getObjectsWithinDistance", "signature": "Bag getObjectsWithinDistance(Geometry g, double dist)", "start_line": 3, "modifiers": "public", "params": [{"name": "g", "type": "Geometry"}, {"name": "dist", "type": "double"}], "return_type": "Bag"}, "class_info": {"name": "GeomV...
37775708_0
class Helper { public static String removeNonPrintableChars(@Nullable final String s) { if (null == s || s.isEmpty()) return ""; StringBuilder newString = new StringBuilder(s.length()); for (int offset = 0; offset < s.length(); ) { int codePoint = s.codePointAt(offset); ...
assertEquals("a", Helper.removeNonPrintableChars("\uF8FFa")); assertEquals("a", Helper.removeNonPrintableChars("\uDC00a")); assertEquals("a", Helper.removeNonPrintableChars("\u000Ea")); assertEquals("a", Helper.removeNonPrintableChars("\u200Ea")); assertEquals("a", Helper.removeN...
[FOCAL] public static String Helper.removeNonPrintableChars(String s) [CLASS] class Helper [METRICS] loc=24 cc=8 branches=2 loops=1 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] String.isEmpty/0, String.length/0, String.codePointAt/1, Character.charCount/1, Character.getType/1, StringBuilder.append/1, Character.toChars...
/* static context [FOCAL] public static String Helper.removeNonPrintableChars(String s) [PATH1] if(null == s || s.isEmpty())=F -> for(offset < s.length())=T -> switch(Character.getType(codePoint))=case Character.UNASSIGNED -> exit loop -> return newString.toString() [PATH2] if(null == s || s.isEmpty())=T -> return "" [...
/* static context [FOCAL] public static String Helper.removeNonPrintableChars(String s) [PATH1] if(null == s || s.isEmpty())=F -> for(offset < s.length())=T -> switch(Character.getType(codePoint))=case Character.UNASSIGNED -> exit loop -> return newString.toString() [PATH2] if(null == s || s.isEmpty())=T -> return "" [...
true
ok
{"focal": {"class": "Helper", "name": "removeNonPrintableChars", "signature": "String removeNonPrintableChars(String s)", "start_line": 3, "modifiers": "public static", "params": [{"name": "s", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Helper", "kind": "class", "modifiers": "", "superclass":...
37788075_21
class RollingLatency extends AbstractMetrics<T> implements WritableLatency<T>, Rolling<PartitionedLatency<T>> { @Override public IntervalIterator<PartitionedLatency<T>> intervals() { return rolling.intervalsWithDefault(noOpLatency); } public RollingLatency(Class<T> clazz, int buckets, long na...
IntervalIterator iterator = mock(IntervalIterator.class); when(baseMetrics.intervalsWithDefault(eq(2000L), any(NoOpLatency.class))).thenReturn(iterator); IntervalIterator<PartitionedLatency<TimeoutableResult>> intervals = latencies.intervals(2000L); assertSame(iterator, intervals); ...
[FOCAL] @Override public IntervalIterator<PartitionedLatency<T>> RollingLatency.intervals() [CLASS] class RollingLatency extends AbstractMetrics<T> implements WritableLatency<T>, Rolling<PartitionedLatency<T>> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] rolling.intervalsWithDef...
/* static context [FOCAL] @Override public IntervalIterator<PartitionedLatency<T>> RollingLatency.intervals() [COLLABORATORS] field rolling intervalsWithDefault/1 [CALLS-EXTERNAL] rolling.intervalsWithDefault/1 */
/* static context [FOCAL] @Override public IntervalIterator<PartitionedLatency<T>> RollingLatency.intervals() [COLLABORATORS] field rolling intervalsWithDefault/1 [CALLS-EXTERNAL] rolling.intervalsWithDefault/1 */ class RollingLatency extends AbstractMetrics<T> implements WritableLatency<T>, Rolling<PartitionedLatency<...
true
ok
{"focal": {"class": "RollingLatency", "name": "intervals", "signature": "IntervalIterator<PartitionedLatency<T>> intervals()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "IntervalIterator<PartitionedLatency<T>>"}, "class_info": {"name": "RollingLatency", "kind": "class", "modifiers":...
37791069_1
class SDP { public static SDPScheme parse(String sdp) { SDPReader reader = new SDPReader(sdp); SDPRawRecord record; // // Session // int version = reader.readVersion(); String originator = reader.readRecord('o').getValue(); String sessionName = reade...
SDPScheme sdpScheme = SDP.parse(sdp2); String serialized = sdpScheme.toSDP().replace("\r", ""); // assertEquals(sdp2, serialized); } }
[FOCAL] public static SDPScheme SDP.parse(String sdp) [CLASS] class SDP [METRICS] loc=88 cc=15 branches=8 loops=6 returns=1 throws=0 nesting=10 [CALLS-EXTERNAL] SDPReader.readVersion/0, reader.readRecord('o').getValue/0, SDPReader.readRecord/1, reader.readRecord('s').getValue/0, SDPReader.readUntil/1, session.getRecord...
/* static context [FOCAL] public static SDPScheme SDP.parse(String sdp) [PATH1] while((record = reader.readUntil('m')) != null)#1=T -> exit loop -> while((mediaLine = reader.readOptionalRecord('m')) != null)=T -> for(i < mediaDesc.length)=T -> exit loop -> while((record = reader.readUntil('m')) != null)#2=T -> if(recor...
/* static context [FOCAL] public static SDPScheme SDP.parse(String sdp) [PATH1] while((record = reader.readUntil('m')) != null)#1=T -> exit loop -> while((mediaLine = reader.readOptionalRecord('m')) != null)=T -> for(i < mediaDesc.length)=T -> exit loop -> while((record = reader.readUntil('m')) != null)#2=T -> if(recor...
true
ok
{"focal": {"class": "SDP", "name": "parse", "signature": "SDPScheme parse(String sdp)", "start_line": 3, "modifiers": "public static", "params": [{"name": "sdp", "type": "String"}], "return_type": "SDPScheme"}, "class_info": {"name": "SDP", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fiel...
37796696_56
class DataTable { public DataTable subTable(int fromRow, int fromColumn) { return subTable(fromRow, fromColumn, height(), width()); } private DataTable(List<List<String>> raw, TableConverter tableConverter); public static DataTable create(List<List<String>> raw); public static DataTable ...
DataTable table = createSimpleTable(); assertThrows(IndexOutOfBoundsException.class, () -> table.subTable(0, 0, 4, 1)); } }
[FOCAL] public DataTable DataTable.subTable(int fromRow, int fromColumn) [CLASS] class DataTable [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] DataTable subTable(int fromRow, int fromColumn, int toRow, int toColumn); int height(); int width() [INPUTS] branches=- | result=fromColu...
/* static context [FOCAL] public DataTable DataTable.subTable(int fromRow, int fromColumn) [INPUTS] branches=- | result=fromColumn, fromRow [CALLS-INTERNAL] DataTable subTable(int fromRow, int fromColumn, int toRow, int toColumn); int height(); int width() */
/* static context [FOCAL] public DataTable DataTable.subTable(int fromRow, int fromColumn) [INPUTS] branches=- | result=fromColumn, fromRow [CALLS-INTERNAL] DataTable subTable(int fromRow, int fromColumn, int toRow, int toColumn); int height(); int width() */ class DataTable { public DataTable subTable(int fromRow...
true
ok
{"focal": {"class": "DataTable", "name": "subTable", "signature": "DataTable subTable(int fromRow, int fromColumn)", "start_line": 3, "modifiers": "public", "params": [{"name": "fromRow", "type": "int"}, {"name": "fromColumn", "type": "int"}], "return_type": "DataTable"}, "class_info": {"name": "DataTable", "kind": "cl...
37816257_153
class JdbcWrapper { public DataSource createDataSourceProxy(DataSource dataSource) { return createDataSourceProxy(null, dataSource); } private JdbcWrapper(Counter sqlCounter); void initServletContext(ServletContext context); public static int getUsedConnectionCount(); public static int getActiveConnectionC...
// on fait le ménage au cas où TestMonitoringSpringInterceptor ait été exécuté juste avant cleanUp(); assertTrue("getBasicDataSourceProperties0", JdbcWrapper.getBasicDataSourceProperties().isEmpty()); assertEquals("getMaxConnectionCount0", -1, JdbcWrapper.getMaxConnectionCount()); final org.apache.tomca...
[FOCAL] public DataSource JdbcWrapper.createDataSourceProxy(DataSource dataSource) [CLASS] class JdbcWrapper [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] DataSource createDataSourceProxy(String name, DataSource dataSource) [INPUTS] branches=- | result=dataSource [DATAFLOW] dataS...
/* static context [FOCAL] public DataSource JdbcWrapper.createDataSourceProxy(DataSource dataSource) [INPUTS] branches=- | result=dataSource [CALLS-INTERNAL] DataSource createDataSourceProxy(String name, DataSource dataSource) */
/* static context [FOCAL] public DataSource JdbcWrapper.createDataSourceProxy(DataSource dataSource) [INPUTS] branches=- | result=dataSource [CALLS-INTERNAL] DataSource createDataSourceProxy(String name, DataSource dataSource) */ class JdbcWrapper { public DataSource createDataSourceProxy(DataSource dataSource) { r...
true
ok
{"focal": {"class": "JdbcWrapper", "name": "createDataSourceProxy", "signature": "DataSource createDataSourceProxy(DataSource dataSource)", "start_line": 3, "modifiers": "public", "params": [{"name": "dataSource", "type": "DataSource"}], "return_type": "DataSource"}, "class_info": {"name": "JdbcWrapper", "kind": "class...
37853715_0
class OptionAssertion { public void assertIsNone() { if (!actual.isNone()) { throw fail("Option was not None"); } } OptionAssertion(@NotNull final Option<T> actual); @NotNull public OptionAssertion<T> assertIsSome(); @NotNull public OptionAssertion<T> assertValue(@No...
new OptionAssertion<Object>(Option.none()).assertIsNone(); } }
[FOCAL] public void OptionAssertion.assertIsNone() [CLASS] class OptionAssertion [METRICS] loc=5 cc=2 branches=1 loops=0 returns=0 throws=1 nesting=1 [CALLS-INTERNAL] AssertionError fail(String message) [CALLS-EXTERNAL] actual.isNone/0 [EXCEPTIONS] throws throw fail("Option was not None") [THROWS-WHEN] fail("Option was...
/* static context [FOCAL] public void OptionAssertion.assertIsNone() [THROWS-WHEN] fail("Option was not None") when !actual.isNone() [PATH1] if(!actual.isNone())=T -> throw fail("Option was not None") [PATH2] if(!actual.isNone())=F [COLLABORATORS] field actual isNone/0 [EXCEPTIONS] throws throw fail("Option was not Non...
/* static context [FOCAL] public void OptionAssertion.assertIsNone() [THROWS-WHEN] fail("Option was not None") when !actual.isNone() [PATH1] if(!actual.isNone())=T -> throw fail("Option was not None") [PATH2] if(!actual.isNone())=F [COLLABORATORS] field actual isNone/0 [EXCEPTIONS] throws throw fail("Option was not Non...
true
ok
{"focal": {"class": "OptionAssertion", "name": "assertIsNone", "signature": "void assertIsNone()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "OptionAssertion", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "thrown...
37879810_24
class DefaultAuditContext implements AuditContext { @Override public String getContextValue() { return value; } public DefaultAuditContext(String name, String value); @Override public String getContextName(); @Override public String toString(); } class DefaultAuditContextTest { @Test public void test...
DefaultAuditContext context = new DefaultAuditContext("name", "value"); assertEquals("value", context.getContextValue()); } }
[FOCAL] @Override public String DefaultAuditContext.getContextValue() [CLASS] class DefaultAuditContext implements AuditContext [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] DefaultAuditContext(String name, String value); String getContextName(); String toString() [TEST] DefaultAu...
/* static context [FOCAL] @Override public String DefaultAuditContext.getContextValue() */
/* static context [FOCAL] @Override public String DefaultAuditContext.getContextValue() */ class DefaultAuditContext implements AuditContext { @Override public String getContextValue() { return value; } public DefaultAuditContext(String name, String value); @Override public String getContextName(); @Overr...
true
ok
{"focal": {"class": "DefaultAuditContext", "name": "getContextValue", "signature": "String getContextValue()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "DefaultAuditContext", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Audi...
37984143_69
class PagedIterator implements Iterator<E>, Iterable<E> { @Override public void remove () { if (currentElement == null) { throw new IllegalStateException (); } result = result.subList (index, result.size ()); index = 0; pageable.delete (currentElement); cur...
// Initial mutable list List<Integer> list = new ArrayList<> (); list.addAll (Arrays.asList (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)); // Elements to remove from initial list: at least test first and last. List<Integer> removed = Arrays.asList (0, 1, 5, 8 ,9); int intial_list_size = lis...
[FOCAL] @Override public void PagedIterator.remove() [CLASS] class PagedIterator implements Iterator<E>, Iterable<E> [METRICS] loc=15 cc=2 branches=1 loops=0 returns=0 throws=1 nesting=1 [CALLS-EXTERNAL] result.subList/2, result.size/0, pageable.delete/1 [NEW] IllegalStateException [EXCEPTIONS] throws IllegalStateExcep...
/* static context [FOCAL] @Override public void PagedIterator.remove() [THROWS-WHEN] IllegalStateException when currentElement == null [PATH1] if(currentElement == null)=T -> throw new IllegalStateException () [PATH2] if(currentElement == null)=F [COLLABORATORS] field result subList/2,size/0; field pageable delete/1 [E...
/* static context [FOCAL] @Override public void PagedIterator.remove() [THROWS-WHEN] IllegalStateException when currentElement == null [PATH1] if(currentElement == null)=T -> throw new IllegalStateException () [PATH2] if(currentElement == null)=F [COLLABORATORS] field result subList/2,size/0; field pageable delete/1 [E...
true
ok
{"focal": {"class": "PagedIterator", "name": "remove", "signature": "void remove()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "PagedIterator", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Iterator<E>, Iterable<E>", "fields": [...
38044291_0
class Ed25519DsaSigner implements DsaSigner { @Override public Signature sign(final byte[] data) { if (!this.getKeyPair().hasPrivateKey()) { throw new CryptoException("cannot sign without private key"); } // Hash the private key to improve randomness. final byte[] hash = Hashes.sha3_512(ArrayUtils.toByte...
final String dataHex = "010100000100009803555e0020000000f5496c59ff336ae2d497140f0ad48306092beeda0d36c31c7373103956c9026180841e000000000063a95e002800000054435550565143373754414d4837514b504650354f5433544c5556344a59525056364345474a585700ca9a3b000000001900000001000000110000004669727374205445535421205965616821"; final b...
[FOCAL] @Override public Signature Ed25519DsaSigner.sign(byte[] data) [CLASS] class Ed25519DsaSigner implements DsaSigner [METRICS] loc=41 cc=3 branches=2 loops=0 returns=1 throws=2 nesting=1 [CALLS-INTERNAL] KeyPair getKeyPair(); boolean isCanonicalSignature(Signature signature) [CALLS-EXTERNAL] this.getKeyPair().hasP...
/* static context [FOCAL] @Override public Signature Ed25519DsaSigner.sign(byte[] data) [THROWS-WHEN] CryptoException when !this.getKeyPair().hasPrivateKey() [THROWS-WHEN] CryptoException when !(!this.getKeyPair().hasPrivateKey()) && !this.isCanonicalSignature(signature) [PATH1] if(!this.getKeyPair().hasPrivateKey())=F...
/* static context [FOCAL] @Override public Signature Ed25519DsaSigner.sign(byte[] data) [THROWS-WHEN] CryptoException when !this.getKeyPair().hasPrivateKey() [THROWS-WHEN] CryptoException when !(!this.getKeyPair().hasPrivateKey()) && !this.isCanonicalSignature(signature) [PATH1] if(!this.getKeyPair().hasPrivateKey())=F...
true
ok
{"focal": {"class": "Ed25519DsaSigner", "name": "sign", "signature": "Signature sign(byte[] data)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "data", "type": "byte[]"}], "return_type": "Signature"}, "class_info": {"name": "Ed25519DsaSigner", "kind": "class", "modifiers": "", "superclass": nu...
38080174_77
class RpcStrategySharding implements RpcStrategy { @Nullable @Override public RpcSender createSender(RpcClientConnectionPool pool) { List<RpcSender> subSenders = list.listOfNullableSenders(pool); int activeSenders = 0; for (RpcSender subSender : subSenders) { if (subSender != null) { activeSenders++; ...
RpcClientConnectionPoolStub pool = new RpcClientConnectionPoolStub(); RpcSenderStub connection2 = new RpcSenderStub(); RpcSenderStub connection3 = new RpcSenderStub(); int shardsAmount = 3; ShardingFunction<Integer> shardingFunction = item -> item % shardsAmount; RpcStrategy shardingStrategy = sharding(shar...
[FOCAL] @Nullable @Override public RpcSender RpcStrategySharding.createSender(RpcClientConnectionPool pool) [CLASS] class RpcStrategySharding implements RpcStrategy [METRICS] loc=18 cc=6 branches=4 loops=1 returns=4 throws=0 nesting=2 [CALLS-EXTERNAL] list.listOfNullableSenders/1, List<RpcSender>.size/0, List<RpcSender...
/* static context [FOCAL] @Nullable @Override public RpcSender RpcStrategySharding.createSender(RpcClientConnectionPool pool) [PATH1] foreach(RpcSender subSender : subSenders)=T -> if(subSender != null)=T -> exit loop -> if(activeSenders < minActiveSubStrategies)=F -> if(subSenders.size() == 0)=F -> if(subSenders.size(...
/* static context [FOCAL] @Nullable @Override public RpcSender RpcStrategySharding.createSender(RpcClientConnectionPool pool) [PATH1] foreach(RpcSender subSender : subSenders)=T -> if(subSender != null)=T -> exit loop -> if(activeSenders < minActiveSubStrategies)=F -> if(subSenders.size() == 0)=F -> if(subSenders.size(...
true
ok
{"focal": {"class": "RpcStrategySharding", "name": "createSender", "signature": "RpcSender createSender(RpcClientConnectionPool pool)", "start_line": 3, "modifiers": "@Nullable @Override public", "params": [{"name": "pool", "type": "RpcClientConnectionPool"}], "return_type": "RpcSender"}, "class_info": {"name": "RpcStr...
38108174_3
class AndroidRxBus implements Bus { public static AndroidRxBus create() { return create(new AndroidQueueCache()); } private AndroidRxBus(RxBus.QueueCache cache, RxBus.Logger logger); public static AndroidRxBus create(RxBus.QueueCache cache); public static AndroidRxBus create(RxBus.Logger...
Bus bus = AndroidRxBus.create(); assertNotNull(bus); } }
[FOCAL] public static AndroidRxBus AndroidRxBus.create() [CLASS] class AndroidRxBus implements Bus [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] AndroidRxBus create(RxBus.QueueCache cache) [NEW] AndroidQueueCache [CLASS-MEMBERS] AndroidRxBus(RxBus.QueueCache cache, RxBus.Logger l...
/* static context [FOCAL] public static AndroidRxBus AndroidRxBus.create() [CALLS-INTERNAL] AndroidRxBus create(RxBus.QueueCache cache) [NEW] AndroidQueueCache */
/* static context [FOCAL] public static AndroidRxBus AndroidRxBus.create() [CALLS-INTERNAL] AndroidRxBus create(RxBus.QueueCache cache) [NEW] AndroidQueueCache */ class AndroidRxBus implements Bus { public static AndroidRxBus create() { return create(new AndroidQueueCache()); } private AndroidRxB...
true
ok
{"focal": {"class": "AndroidRxBus", "name": "create", "signature": "AndroidRxBus create()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "AndroidRxBus"}, "class_info": {"name": "AndroidRxBus", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Bus", "fields": [{"name": "...
38152816_7
class LanguageIndex { public Set<LanguageDirection> getLanguages() { return languages; } private LanguageIndex(Map<SimpleLanguageDirection, List<LanguageDirection>> index, Map<String, List<LanguageRule>> rules, Map<LanguageDirection, LanguageBridge> pivots); public int size(); public Lan...
LanguageIndex index = new LanguageIndex.Builder() .add(lp("it en")) .add(lp("en it")) .build(false); assertEquals(lpset("it en", "en it"), index.getLanguages()); index = new LanguageIndex.Builder() .add(lp("it en")) ...
[FOCAL] public Set<LanguageDirection> LanguageIndex.getLanguages() [CLASS] class LanguageIndex [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] LanguageIndex(Map<SimpleLanguageDirection, List<LanguageDirection>> index, Map<String, List<LanguageRule>> rules, Map<LanguageDirection, Lan...
/* static context [FOCAL] public Set<LanguageDirection> LanguageIndex.getLanguages() */
/* static context [FOCAL] public Set<LanguageDirection> LanguageIndex.getLanguages() */ class LanguageIndex { public Set<LanguageDirection> getLanguages() { return languages; } private LanguageIndex(Map<SimpleLanguageDirection, List<LanguageDirection>> index, Map<String, List<LanguageRule>> rules...
true
ok
{"focal": {"class": "LanguageIndex", "name": "getLanguages", "signature": "Set<LanguageDirection> getLanguages()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Set<LanguageDirection>"}, "class_info": {"name": "LanguageIndex", "kind": "class", "modifiers": "", "superclass": null, "interfaces": n...
38174524_7
class EventBusAddressMessageMapping { public static <REQUEST extends com.google.protobuf.Message, RESPONSE extends com.google.protobuf.Message> Builder<REQUEST, RESPONSE> builder() { return new Builder<>(); } private EventBusAddressMessageMapping(); public void validate(); public JsonObj...
final EventBusAddressMessageMapping<GetVerticleDeployments.Request, GetVerticleDeployments.Response> mapping = EventBusAddressMessageMapping.<GetVerticleDeployments.Request, GetVerticleDeployments.Response>builder() .address("/xyz") .requestDefaultInstance(GetVerticleDeployments....
[FOCAL] public static Builder<REQUEST, RESPONSE> EventBusAddressMessageMapping.builder() [CLASS] class EventBusAddressMessageMapping [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] Builder<> [CLASS-MEMBERS] EventBusAddressMessageMapping(); void validate(); JsonObject toJson(); String toString...
/* static context [FOCAL] public static Builder<REQUEST, RESPONSE> EventBusAddressMessageMapping.builder() [NEW] Builder<> */
/* static context [FOCAL] public static Builder<REQUEST, RESPONSE> EventBusAddressMessageMapping.builder() [NEW] Builder<> */ class EventBusAddressMessageMapping { public static <REQUEST extends com.google.protobuf.Message, RESPONSE extends com.google.protobuf.Message> Builder<REQUEST, RESPONSE> builder() { ...
true
ok
{"focal": {"class": "EventBusAddressMessageMapping", "name": "builder", "signature": "Builder<REQUEST, RESPONSE> builder()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Builder<REQUEST, RESPONSE>"}, "class_info": {"name": "EventBusAddressMessageMapping", "kind": "class", "modifiers": ""...
38195479_4
class WeatherData { public boolean checkQuality(String quality) { return (!quality.equals("") && ALLOWEDQUALITY.contains(quality)); } public WeatherData(LocalDateTime dateTime, String[] data); public abstract String[] combineValues(); public abstract Reading getReading(WeatherVar whichVa...
assertTrue(wd.checkQuality("Y")); assertTrue(wd.checkQuality("N")); assertTrue(wd.checkQuality("S")); assertTrue(wd.checkQuality("F")); assertFalse(wd.checkQuality("I")); assertFalse(wd.checkQuality("")); } }
[FOCAL] public boolean WeatherData.checkQuality(String quality) [CLASS] class WeatherData [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] String.equals/1, ALLOWEDQUALITY.contains/1 [INPUTS] branches=- | result=quality [DATAFLOW] quality@param->L2 [CLASS-MEMBERS] WeatherData(LocalDa...
/* static context [FOCAL] public boolean WeatherData.checkQuality(String quality) [INPUTS] branches=- | result=quality [CALLS-EXTERNAL] String.equals/1, ALLOWEDQUALITY.contains/1 */
/* static context [FOCAL] public boolean WeatherData.checkQuality(String quality) [INPUTS] branches=- | result=quality [CALLS-EXTERNAL] String.equals/1, ALLOWEDQUALITY.contains/1 */ class WeatherData { public boolean checkQuality(String quality) { return (!quality.equals("") && ALLOWEDQUALITY.contains(qual...
true
ok
{"focal": {"class": "WeatherData", "name": "checkQuality", "signature": "boolean checkQuality(String quality)", "start_line": 3, "modifiers": "public", "params": [{"name": "quality", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "WeatherData", "kind": "class", "modifiers": "", "superclass": null...
38215053_0
class HOCRFileReader { public String readHOCRFile(final String pathOfHOCRFile) throws DCMAApplicationException { final StringBuffer infoHOCRFile = new StringBuffer(); synchronized (object) { String errMsg = null; if (null == pathOfHOCRFile || RegexConstants.EMPTY.equals(pathOfHOCRFile)) { errMsg = "Inv...
Boolean isSuccess = Boolean.FALSE; try { String hicrReaderObj = HOCRFileReader.getInstance().readHOCRFile( "E:\\file\\111\\output1024.html"); if (null == hicrReaderObj || "".equals(hicrReaderObj)) { isSuccess = Boolean.FALSE; } else { isSuccess = Boolean.TRUE; } } catch (DCMAApplicationE...
[FOCAL] public String HOCRFileReader.readHOCRFile(String pathOfHOCRFile) [CLASS] class HOCRFileReader [METRICS] loc=56 cc=10 branches=4 loops=1 returns=1 throws=2 nesting=4 [CALLS-EXTERNAL] RegexConstants.EMPTY.equals/1, BufferedReader.readLine/0, StringBuffer.append/1, Logger.error/1, IOException.getMessage/0, FileInp...
/* static context [FOCAL] public String HOCRFileReader.readHOCRFile(String pathOfHOCRFile) [THROWS-WHEN] DCMAApplicationException when null == pathOfHOCRFile || RegexConstants.EMPTY.equals(pathOfHOCRFile) [PATH1] if(null == pathOfHOCRFile || RegexConstants.EMPTY.equals(pathOfHOCRFile))=F -> while(strLine != null)=T -> ...
/* static context [FOCAL] public String HOCRFileReader.readHOCRFile(String pathOfHOCRFile) [THROWS-WHEN] DCMAApplicationException when null == pathOfHOCRFile || RegexConstants.EMPTY.equals(pathOfHOCRFile) [PATH1] if(null == pathOfHOCRFile || RegexConstants.EMPTY.equals(pathOfHOCRFile))=F -> while(strLine != null)=T -> ...
true
ok
{"focal": {"class": "HOCRFileReader", "name": "readHOCRFile", "signature": "String readHOCRFile(String pathOfHOCRFile) throws DCMAApplicationException", "start_line": 3, "modifiers": "public", "params": [{"name": "pathOfHOCRFile", "type": "String"}], "return_type": "String"}, "class_info": {"name": "HOCRFileReader", "k...
38218145_182
class AddMembersController extends AbstractCommandController { public void setGroupsController(TabbedGroupController groupsController) { this.groupsController = groupsController; } public AddMembersController(); public GroupsEditorContext getEditorContext(HttpServletRequest req); private void addSelection(Ht...
try { TabbedGroupController tc = new TabbedGroupController(); TabConfig tabConfig = new TabConfig(); tabConfig.setViewName("groups"); List<Tab> tabs = getTabList(); tabConfig.setTabs(tabs); tc.setTabConfig(tabConfig); tc.setDefaultCommandClass(org.webcurator.ui.groups.command.DefaultCommand.c...
[FOCAL] public void AddMembersController.setGroupsController(TabbedGroupController groupsController) [CLASS] class AddMembersController extends AbstractCommandController [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [FIELDS] write=groupsController [STATE] groupsController [DATAFLOW] groupsControl...
/* static context [FOCAL] public void AddMembersController.setGroupsController(TabbedGroupController groupsController) [STATE] groupsController [FIELDS] write=groupsController */
/* static context [FOCAL] public void AddMembersController.setGroupsController(TabbedGroupController groupsController) [STATE] groupsController [FIELDS] write=groupsController */ class AddMembersController extends AbstractCommandController { public void setGroupsController(TabbedGroupController groupsController) { ...
true
ok
{"focal": {"class": "AddMembersController", "name": "setGroupsController", "signature": "void setGroupsController(TabbedGroupController groupsController)", "start_line": 3, "modifiers": "public", "params": [{"name": "groupsController", "type": "TabbedGroupController"}], "return_type": "void"}, "class_info": {"name": "A...
38261859_9
class MetaDataUtils { @Nullable public static String getSharedPermission(Context context) { Bundle metaData = getMetaData(context); return getMetaValue(metaData, APP_SHARED_PERMISSION); } private MetaDataUtils(); @Nullable public static String getSharedAuthorityMatcher(Context context); @Nullable ...
String expected = "com.owlr.PERMISSION"; when(bundle.getString(MetaDataUtils.APP_SHARED_PERMISSION)).thenReturn(expected); assertThat(MetaDataUtils.getSharedPermission(context)).isEqualTo(expected); } }
[FOCAL] @Nullable public static String MetaDataUtils.getSharedPermission(Context context) [CLASS] class MetaDataUtils [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Bundle getMetaData(Context context); String getMetaValue(Bundle metaData, String appSharedPermission) [INPUTS] branc...
/* static context [FOCAL] @Nullable public static String MetaDataUtils.getSharedPermission(Context context) [INPUTS] branches=- | result=context [CALLS-INTERNAL] Bundle getMetaData(Context context); String getMetaValue(Bundle metaData, String appSharedPermission) */
/* static context [FOCAL] @Nullable public static String MetaDataUtils.getSharedPermission(Context context) [INPUTS] branches=- | result=context [CALLS-INTERNAL] Bundle getMetaData(Context context); String getMetaValue(Bundle metaData, String appSharedPermission) */ class MetaDataUtils { @Nullable public static Stri...
true
ok
{"focal": {"class": "MetaDataUtils", "name": "getSharedPermission", "signature": "String getSharedPermission(Context context)", "start_line": 3, "modifiers": "@Nullable public static", "params": [{"name": "context", "type": "Context"}], "return_type": "String"}, "class_info": {"name": "MetaDataUtils", "kind": "class", ...
38307113_24
class Main { int run(String[] args) { initJCommander(); try { parseParams(jc, args); if (help) { printUsage(null); return EXIT_CODE_OK; } if (debug) { initializeDebugLogging(); } ...
main.run(new String[]{"install"}); String output = outputStream.toString("UTF-8"); assertTrue(output.contains("Usage: install [options]")); } }
[FOCAL] int Main.run(String[] args) [CLASS] class Main [METRICS] loc=55 cc=9 branches=7 loops=0 returns=6 throws=0 nesting=3 [CALLS-INTERNAL] int handleNoCommand(); void initJCommander(); void initializeDebugLogging(); void parseParams(JCommander jc, String[] args); void printUsage(String commandName) [CALLS-EXTERNAL] ...
/* static context [FOCAL] int Main.run(String[] args) [PATH1] if(help)=F -> if(debug)=T -> if(jc.getParsedCommand() == null)=F -> if(!commands.containsKey(jc.getParsedCommand()))=F -> if(CommandHelp.CLINAME.equals(parsedCommand.getName()))=F -> if(parsedCommand.validateParameters())=T -> return EXIT_CODE_OK [PATH2] try...
/* static context [FOCAL] int Main.run(String[] args) [PATH1] if(help)=F -> if(debug)=T -> if(jc.getParsedCommand() == null)=F -> if(!commands.containsKey(jc.getParsedCommand()))=F -> if(CommandHelp.CLINAME.equals(parsedCommand.getName()))=F -> if(parsedCommand.validateParameters())=T -> return EXIT_CODE_OK [PATH2] try...
true
ok
{"focal": {"class": "Main", "name": "run", "signature": "int run(String[] args)", "start_line": 3, "modifiers": "", "params": [{"name": "args", "type": "String[]"}], "return_type": "int"}, "class_info": {"name": "Main", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "outpu...
38307688_3
class MostToLeastDerivedPlaceTypeComparator implements Comparator<TypeElement> { @Override public int compare(TypeElement o1, TypeElement o2) { return realComparator.compare(o1, o2); } private int getHierarchyDepth(TypeElement typeElement); @Rule public CompilationRule compilationRule; private MostTo...
TypeElement[][] places = { {place3, place4}, // place3 and place4 both extend directly from place1 {place1, place2}, // place1 and place2 both extend directly from place }; for (TypeElement[] pair : places) { assertThat(comparator.compare(pair[0], pair[1])) .named(String.format("...
[FOCAL] @Override public int MostToLeastDerivedPlaceTypeComparator.compare(TypeElement o1, TypeElement o2) [CLASS] class MostToLeastDerivedPlaceTypeComparator implements Comparator<TypeElement> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] realComparator.compare/2 [INPUTS] branch...
/* static context [FOCAL] @Override public int MostToLeastDerivedPlaceTypeComparator.compare(TypeElement o1, TypeElement o2) [INPUTS] branches=- | result=o1, o2 [COLLABORATORS] field realComparator compare/2 [CALLS-EXTERNAL] realComparator.compare/2 */
/* static context [FOCAL] @Override public int MostToLeastDerivedPlaceTypeComparator.compare(TypeElement o1, TypeElement o2) [INPUTS] branches=- | result=o1, o2 [COLLABORATORS] field realComparator compare/2 [CALLS-EXTERNAL] realComparator.compare/2 */ class MostToLeastDerivedPlaceTypeComparator implements Comparator<T...
true
ok
{"focal": {"class": "MostToLeastDerivedPlaceTypeComparator", "name": "compare", "signature": "int compare(TypeElement o1, TypeElement o2)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "o1", "type": "TypeElement"}, {"name": "o2", "type": "TypeElement"}], "return_type": "int"}, "class_info": {"n...
38311906_265
class EventSubscriberClass extends ModelClass<S> implements EventReceiverClass, SubscribingClass { @Override public ImmutableSet<SubscriberMethod> subscribersOf(EventClass eventClass, MessageClass originClass) { return delegate.handlersOf(eventClass, originClass); } private EventSubscribe...
ImmutableSet<SubscriberMethod> methods = subscriberClass.subscribersOf( EventClass.from(SpeakerJoined.class), EmptyClass.instance()); assertThat(methods).hasSize(1); SubscriberMethod actual = getFirst(methods, null); assertThat(actual.rawMethod()) .isEqualTo(...
[FOCAL] @Override public ImmutableSet<SubscriberMethod> EventSubscriberClass.subscribersOf(EventClass eventClass, MessageClass originClass) [CLASS] class EventSubscriberClass extends ModelClass<S> implements EventReceiverClass, SubscribingClass [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS...
/* static context [FOCAL] @Override public ImmutableSet<SubscriberMethod> EventSubscriberClass.subscribersOf(EventClass eventClass, MessageClass originClass) [INPUTS] branches=- | result=eventClass, originClass [COLLABORATORS] field delegate handlersOf/2 [CALLS-EXTERNAL] delegate.handlersOf/2 */
/* static context [FOCAL] @Override public ImmutableSet<SubscriberMethod> EventSubscriberClass.subscribersOf(EventClass eventClass, MessageClass originClass) [INPUTS] branches=- | result=eventClass, originClass [COLLABORATORS] field delegate handlersOf/2 [CALLS-EXTERNAL] delegate.handlersOf/2 */ class EventSubscriberCl...
true
ok
{"focal": {"class": "EventSubscriberClass", "name": "subscribersOf", "signature": "ImmutableSet<SubscriberMethod> subscribersOf(EventClass eventClass, MessageClass originClass)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "eventClass", "type": "EventClass"}, {"name": "originClass", "type": "M...
38357506_0
class Significance { public static boolean testCorrelations(double correlation1, double correlation2, int n1, int n2, double alpha) throws MathException { double p = getSignificance(correlation1, correlation2, n1, n2); if (p <= alpha) { return true; } ...
assertTrue(testCorrelations(0.5, 0.74, 68, 68, 0.2)); assertTrue(testCorrelations(0.5, 0.74, 68, 68, 0.1)); assertTrue(testCorrelations(0.5, 0.74, 68, 68, 0.05)); assertFalse(testCorrelations(0.5, 0.74, 68, 68, 0.01)); assertTrue(testCorrelations(0.5, 0.7, 100, 100, 0.1)); ...
[FOCAL] public static boolean Significance.testCorrelations(double correlation1, double correlation2, int n1, int n2, double alpha) [CLASS] class Significance [METRICS] loc=14 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] double getSignificance(double correlation1, double correlation2, int n1, i...
/* static context [FOCAL] public static boolean Significance.testCorrelations(double correlation1, double correlation2, int n1, int n2, double alpha) [PATH1] if(p <= alpha)=T -> return true [PATH2] if(p <= alpha)=F -> return false [INPUTS] branches=alpha, correlation1, correlation2, n1, n2 | result=- [EXCEPTIONS] decla...
/* static context [FOCAL] public static boolean Significance.testCorrelations(double correlation1, double correlation2, int n1, int n2, double alpha) [PATH1] if(p <= alpha)=T -> return true [PATH2] if(p <= alpha)=F -> return false [INPUTS] branches=alpha, correlation1, correlation2, n1, n2 | result=- [EXCEPTIONS] decla...
true
ok
{"focal": {"class": "Significance", "name": "testCorrelations", "signature": "boolean testCorrelations(double correlation1, double correlation2, int n1, int n2, double alpha) throws MathException", "start_line": 3, "modifiers": "public static", "params": [{"name": "correlation1", "type": "double"}, {"name": "correlatio...
38417079_18
class ProductFlavorCombo { @NonNull public static <S extends DimensionAware & Named> List<ProductFlavorCombo<S>> createCombinations( @Nullable List<String> flavorDimensions, @NonNull Iterable<S> productFlavors) { List <ProductFlavorCombo<S>> result = Lists.newArrayList(); ...
try { ProductFlavorCombo.createCombinations( ImmutableList.of(DIMENSION1, DIMENSION2), ImmutableList.of(f1d1)); fail("Expected to throw"); } catch (RuntimeException ignore) { } } }
[FOCAL] @NonNull public static List<ProductFlavorCombo<S>> ProductFlavorCombo.createCombinations(List<String> flavorDimensions, Iterable<S> productFlavors) [CLASS] class ProductFlavorCombo [METRICS] loc=36 cc=6 branches=3 loops=2 returns=1 throws=2 nesting=3 [CALLS-INTERNAL] void createProductFlavorCombinations(List<Pr...
/* static context [FOCAL] @NonNull public static List<ProductFlavorCombo<S>> ProductFlavorCombo.createCombinations(List<String> flavorDimensions, Iterable<S> productFlavors) [THROWS-WHEN] RuntimeException when !(flavorDimensions == null || flavorDimensions.isEmpty()) && foreach(S flavor : productFlavors)#2=T && flavorD...
/* static context [FOCAL] @NonNull public static List<ProductFlavorCombo<S>> ProductFlavorCombo.createCombinations(List<String> flavorDimensions, Iterable<S> productFlavors) [THROWS-WHEN] RuntimeException when !(flavorDimensions == null || flavorDimensions.isEmpty()) && foreach(S flavor : productFlavors)#2=T && flavorD...
true
ok
{"focal": {"class": "ProductFlavorCombo", "name": "createCombinations", "signature": "List<ProductFlavorCombo<S>> createCombinations(List<String> flavorDimensions, Iterable<S> productFlavors)", "start_line": 3, "modifiers": "@NonNull public static", "params": [{"name": "flavorDimensions", "type": "List<String>"}, {"nam...
38443009_4
class CipherHelper { public static String encrypt(String text) { String base64EncryptedString = ""; if (!StringUtils.isBlank(text)) { try { String secretKey = getSecretKey(); MessageDigest md = MessageDigest.getInstance("MD5"); byte[] dige...
assertEquals(CipherHelper.encrypt(""), ""); } }
[FOCAL] public static String CipherHelper.encrypt(String text) [CLASS] class CipherHelper [METRICS] loc=23 cc=3 branches=1 loops=0 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] String getSecretKey() [CALLS-EXTERNAL] StringUtils.isBlank/1, MessageDigest.getInstance/1, MessageDigest.digest/1, String.getBytes/1, Arrays.co...
/* static context [FOCAL] public static String CipherHelper.encrypt(String text) [PATH1] if(!StringUtils.isBlank(text))=T -> try-body throws -> return base64EncryptedString [PATH2] if(!StringUtils.isBlank(text))=F -> return base64EncryptedString [INPUTS] branches=text | result=text [EXCEPTIONS] catches Exception e [CAL...
/* static context [FOCAL] public static String CipherHelper.encrypt(String text) [PATH1] if(!StringUtils.isBlank(text))=T -> try-body throws -> return base64EncryptedString [PATH2] if(!StringUtils.isBlank(text))=F -> return base64EncryptedString [INPUTS] branches=text | result=text [EXCEPTIONS] catches Exception e [CAL...
true
ok
{"focal": {"class": "CipherHelper", "name": "encrypt", "signature": "String encrypt(String text)", "start_line": 3, "modifiers": "public static", "params": [{"name": "text", "type": "String"}], "return_type": "String"}, "class_info": {"name": "CipherHelper", "kind": "class", "modifiers": "", "superclass": null, "interf...
38443555_124
class RemoveAllNotificationsMutation implements DataFetcher<Boolean> { @Override public Boolean get(DataFetchingEnvironment environment) { final String username = environment.getArgument("username"); if (Strings.isNullOrEmpty(username)) { throw new GraphQLValidationError("username cannot be empty"); ...
when(environment.getArgument("username")).thenReturn("test"); final Boolean actual = mutation.get(environment); verify(store).removeAll(eq("test")); assertThat(actual).isTrue(); } }
[FOCAL] @Override public Boolean RemoveAllNotificationsMutation.get(DataFetchingEnvironment environment) [CLASS] class RemoveAllNotificationsMutation implements DataFetcher<Boolean> [METRICS] loc=16 cc=3 branches=1 loops=0 returns=1 throws=2 nesting=1 [CALLS-EXTERNAL] DataFetchingEnvironment.getArgument/1, Strings.isNu...
/* static context [FOCAL] @Override public Boolean RemoveAllNotificationsMutation.get(DataFetchingEnvironment environment) [THROWS-WHEN] GraphQLValidationError when Strings.isNullOrEmpty(username) [THROWS-WHEN] GraphQLValidationError when !Strings.isNullOrEmpty(username) && try-body throws [PATH1] if(Strings.isNullOrEm...
/* static context [FOCAL] @Override public Boolean RemoveAllNotificationsMutation.get(DataFetchingEnvironment environment) [THROWS-WHEN] GraphQLValidationError when Strings.isNullOrEmpty(username) [THROWS-WHEN] GraphQLValidationError when !Strings.isNullOrEmpty(username) && try-body throws [PATH1] if(Strings.isNullOrEm...
true
ok
{"focal": {"class": "RemoveAllNotificationsMutation", "name": "get", "signature": "Boolean get(DataFetchingEnvironment environment)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "environment", "type": "DataFetchingEnvironment"}], "return_type": "Boolean"}, "class_info": {"name": "RemoveAllNoti...
38482121_116
class ClientRendered implements BitbucketRendered { public final String getType() { return type; } public ClientRendered(); public ClientRendered(final ClientRendered other); public void setType(String type); @Override public final String getMarkup(); public final void setMa...
String string1 = "{\"type\":\"rendered\"}"; ClientRendered rendered1 = jsonb.fromJson(string1, ClientRendered.class); assertEquals("rendered", rendered1.getType()); } }
[FOCAL] public final String ClientRendered.getType() [CLASS] class ClientRendered implements BitbucketRendered [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] ClientRendered(); ClientRendered(ClientRendered other); void setType(String type); String getMarkup(); void setMarkup(String...
/* static context [FOCAL] public final String ClientRendered.getType() */
/* static context [FOCAL] public final String ClientRendered.getType() */ class ClientRendered implements BitbucketRendered { public final String getType() { return type; } public ClientRendered(); public ClientRendered(final ClientRendered other); public void setType(String type); ...
true
ok
{"focal": {"class": "ClientRendered", "name": "getType", "signature": "String getType()", "start_line": 3, "modifiers": "public final", "params": [], "return_type": "String"}, "class_info": {"name": "ClientRendered", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "BitbucketRendered", "fields": [{"n...
38484146_8
class SqsMessagePoller { @Scheduled(fixedDelay = 1) // SUPPRESS CHECKSTYLE bug? public void loop() { // NOPMD - cc List<Message> messages = reveiveMessages(); if (messages.isEmpty()) { log.trace("No SQS message received"); return; } log.debug("{} SQS messages are received", messages.size()); messages...
// setup Message msg1 = createMessage(1); DeleteMessageRequest expectedDmr = createDeleteMessageRequest(1); when(sqs.receiveMessage(any(ReceiveMessageRequest.class))).thenReturn(receiveMessageResultOf(msg1)); doAnswer(createHeavyJobAnswer(4, true)).when(messageHandler).accept(any(Message.class)); // exercis...
[FOCAL] @Scheduled(fixedDelay = 1) // SUPPRESS CHECKSTYLE bug? public void SqsMessagePoller.loop() [CLASS] class SqsMessagePoller [METRICS] loc=10 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] List<Message> reveiveMessages() [CALLS-EXTERNAL] List<Message>.isEmpty/0, log.trace/1, log.debug/2, Lis...
/* static context [FOCAL] @Scheduled(fixedDelay = 1) // SUPPRESS CHECKSTYLE bug? public void SqsMessagePoller.loop() [PATH1] if(messages.isEmpty())=T -> return [PATH2] if(messages.isEmpty())=F [CALLS-INTERNAL] List<Message> reveiveMessages() [CALLS-EXTERNAL] List<Message>.isEmpty/0, log.trace/1, log.debug/2, List<Messa...
/* static context [FOCAL] @Scheduled(fixedDelay = 1) // SUPPRESS CHECKSTYLE bug? public void SqsMessagePoller.loop() [PATH1] if(messages.isEmpty())=T -> return [PATH2] if(messages.isEmpty())=F [CALLS-INTERNAL] List<Message> reveiveMessages() [CALLS-EXTERNAL] List<Message>.isEmpty/0, log.trace/1, log.debug/2, List<Messa...
true
ok
{"focal": {"class": "SqsMessagePoller", "name": "loop", "signature": "void loop()", "start_line": 3, "modifiers": "@Scheduled(fixedDelay = 1) // SUPPRESS CHECKSTYLE bug? public", "params": [], "return_type": "void"}, "class_info": {"name": "SqsMessagePoller", "kind": "class", "modifiers": "", "superclass": null, "inter...
38503932_0
class Examples extends Activity { public Instant now() { return Instant.now(); } @Override protected void onCreate(Bundle savedInstanceState); public ZonedDateTime hereAndNow(); } class ExamplesTest { @Test public void one() {
Examples activity = Robolectric.setupActivity(Examples.class); Instant now = activity.now(); assertNotNull(now); } }
[FOCAL] public Instant Examples.now() [CLASS] class Examples extends Activity [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Instant.now/0 [CLASS-MEMBERS] void onCreate(Bundle savedInstanceState); ZonedDateTime hereAndNow() [TEST] ExamplesTest: @Test public void one()
/* static context [FOCAL] public Instant Examples.now() [CALLS-EXTERNAL] Instant.now/0 */
/* static context [FOCAL] public Instant Examples.now() [CALLS-EXTERNAL] Instant.now/0 */ class Examples extends Activity { public Instant now() { return Instant.now(); } @Override protected void onCreate(Bundle savedInstanceState); public ZonedDateTime hereAndNow(); } class ExamplesTest { @Test publ...
true
ok
{"focal": {"class": "Examples", "name": "now", "signature": "Instant now()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Instant"}, "class_info": {"name": "Examples", "kind": "class", "modifiers": "", "superclass": "Activity", "interfaces": null, "fields": [], "members": [{"name": "onCreate", ...
38569235_8
class ConfirmationService { public Confirmation addConfirmation(@NotNull final String username, final long encounterId) { Confirmation newConfirmation = new Confirmation(); newConfirmation.setUser(userService.getDukeEncountersUser(username)); newConfirmation.setDate(new Date()); new...
given(userService.getDukeEncountersUser(anyString())).willReturn(testUser()); given(encounterService.getEncounterById(anyLong())).willReturn(testEncounter(1)); given(repository.save(any(Confirmation.class))).willReturn(testConfirmation()); Confirmation confirmation = service.addConfirmat...
[FOCAL] public Confirmation ConfirmationService.addConfirmation(String username, long encounterId) [CLASS] class ConfirmationService [METRICS] loc=12 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Confirmation.setUser/1, UserService.getDukeEncountersUser/1, Confirmation.setDate/1, Confirmation.se...
/* static context [FOCAL] public Confirmation ConfirmationService.addConfirmation(String username, long encounterId) [INPUTS] branches=- | result=repository [COLLABORATORS] field userService:UserService getDukeEncountersUser/1; field encounterService:EncounterService getEncounterById/1; field repository:ConfirmationRep...
/* static context [FOCAL] public Confirmation ConfirmationService.addConfirmation(String username, long encounterId) [INPUTS] branches=- | result=repository [COLLABORATORS] field userService:UserService getDukeEncountersUser/1; field encounterService:EncounterService getEncounterById/1; field repository:ConfirmationRep...
true
ok
{"focal": {"class": "ConfirmationService", "name": "addConfirmation", "signature": "Confirmation addConfirmation(String username, long encounterId)", "start_line": 3, "modifiers": "public", "params": [{"name": "username", "type": "String"}, {"name": "encounterId", "type": "long"}], "return_type": "Confirmation"}, "clas...
38597960_45
class FormDatas { public FormDatas toRight() { return toRight( 0 ); } private FormDatas( Control control ); public static FormDatas attach( Control control ); public FormDatas toLeft(); public FormDatas toLeft( int margin ); public FormDatas atLeftTo( Control control ); public FormDatas atLeftTo...
FormDatas actual = attach( control ).toRight(); assertThat( actual ).isAttachedToRight( DENOMINATOR, 0 ); } }
[FOCAL] public FormDatas FormDatas.toRight() [CLASS] class FormDatas [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] FormDatas toRight(int margin) [CLASS-MEMBERS] FormDatas(Control control); FormDatas attach(Control control); FormDatas toLeft(); FormDatas toLeft(int margin); FormDa...
/* static context [FOCAL] public FormDatas FormDatas.toRight() [CALLS-INTERNAL] FormDatas toRight(int margin) */
/* static context [FOCAL] public FormDatas FormDatas.toRight() [CALLS-INTERNAL] FormDatas toRight(int margin) */ class FormDatas { public FormDatas toRight() { return toRight( 0 ); } private FormDatas( Control control ); public static FormDatas attach( Control control ); public FormDatas toLeft(); p...
true
ok
{"focal": {"class": "FormDatas", "name": "toRight", "signature": "FormDatas toRight()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "FormDatas"}, "class_info": {"name": "FormDatas", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "NUMERATOR", "type"...
38705594_523
class HL7DateTimeFormat { public static DateTimeFormatter forPrecision(Precision p) { switch (p) { case MILLISECOND: return dateTime(); case SECOND: return PointInTimeFormat.forPattern("yyyyMMddHHmmss"); case MINUTE: return...
PointInTime t = new PointInTime(1975, 7, 23, 10, 23, 55, 123); Assert.assertEquals("1975", HL7DateTimeFormat.forPrecision(Precision.YEAR).print(t)); Assert.assertEquals("197507", HL7DateTimeFormat.forPrecision(Precision.MONTH).print(t)); Assert.assertEquals("19750723", HL7DateTimeFormat....
[FOCAL] public static DateTimeFormatter HL7DateTimeFormat.forPrecision(Precision p) [CLASS] class HL7DateTimeFormat [METRICS] loc=18 cc=7 branches=1 loops=0 returns=7 throws=0 nesting=1 [CALLS-INTERNAL] DateTimeFormatter dateTime() [CALLS-EXTERNAL] PointInTimeFormat.forPattern/1 [PATH1] switch(p)=case MILLISECOND -> re...
/* static context [FOCAL] public static DateTimeFormatter HL7DateTimeFormat.forPrecision(Precision p) [PATH1] switch(p)=case MILLISECOND -> return dateTime() [PATH2] switch(p)=case SECOND -> return PointInTimeFormat.forPattern("yyyyMMddHHmmss") [PATH3] switch(p)=case MINUTE -> return PointInTimeFormat.forPattern("yyyyM...
/* static context [FOCAL] public static DateTimeFormatter HL7DateTimeFormat.forPrecision(Precision p) [PATH1] switch(p)=case MILLISECOND -> return dateTime() [PATH2] switch(p)=case SECOND -> return PointInTimeFormat.forPattern("yyyyMMddHHmmss") [PATH3] switch(p)=case MINUTE -> return PointInTimeFormat.forPattern("yyyyM...
true
ok
{"focal": {"class": "HL7DateTimeFormat", "name": "forPrecision", "signature": "DateTimeFormatter forPrecision(Precision p)", "start_line": 3, "modifiers": "public static", "params": [{"name": "p", "type": "Precision"}], "return_type": "DateTimeFormatter"}, "class_info": {"name": "HL7DateTimeFormat", "kind": "class", "m...
38706431_2
class Utils { public static void unsubscribe(Subscription subscription) { if (subscription != null && !subscription.isUnsubscribed()) { subscription.unsubscribe(); } } private Utils(); public static void openPlayStorePage(Context context); public static void openPriva...
Subscription subscription = Mockito.mock(Subscription.class); Utils.unsubscribe(subscription); verify(subscription, times(1)).unsubscribe(); verify(subscription, times(1)).isUnsubscribed(); } }
[FOCAL] public static void Utils.unsubscribe(Subscription subscription) [CLASS] class Utils [METRICS] loc=5 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] Subscription.isUnsubscribed/0, Subscription.unsubscribe/0 [PATH1] if(subscription != null && !subscription.isUnsubscribed())=T [PATH2] if(subs...
/* static context [FOCAL] public static void Utils.unsubscribe(Subscription subscription) [PATH1] if(subscription != null && !subscription.isUnsubscribed())=T [PATH2] if(subscription != null && !subscription.isUnsubscribed())=F [INPUTS] branches=subscription | result=- [COLLABORATORS] param subscription:Subscription is...
/* static context [FOCAL] public static void Utils.unsubscribe(Subscription subscription) [PATH1] if(subscription != null && !subscription.isUnsubscribed())=T [PATH2] if(subscription != null && !subscription.isUnsubscribed())=F [INPUTS] branches=subscription | result=- [COLLABORATORS] param subscription:Subscription is...
true
ok
{"focal": {"class": "Utils", "name": "unsubscribe", "signature": "void unsubscribe(Subscription subscription)", "start_line": 3, "modifiers": "public static", "params": [{"name": "subscription", "type": "Subscription"}], "return_type": "void"}, "class_info": {"name": "Utils", "kind": "class", "modifiers": "", "supercla...
38710489_1
class ManifestGenerator { public String generateJson(Manifest manifest) throws JsonProcessingException { ObjectMapper mapper = new IiifPresentationApiObjectMapper(); String json = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(manifest); return json; } public ManifestGenerator(); pub...
String urlPrefix = "http://localhost:10000/test"; Manifest manifest = new ManifestImpl(URI.create(urlPrefix + "/demo/bookreader/manifest.json"), new PropertyValueSimpleImpl("Walters MS 168")); List<Sequence> sequences = new ArrayList<>(); manifest.setSequences(sequences); Sequence seq1 = new Seque...
[FOCAL] public String ManifestGenerator.generateJson(Manifest manifest) [CLASS] class ManifestGenerator [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] mapper.writerWithDefaultPrettyPrinter().writeValueAsString/1, ObjectMapper.writerWithDefaultPrettyPrinter/0 [NEW] IiifPresentation...
/* static context [FOCAL] public String ManifestGenerator.generateJson(Manifest manifest) [INPUTS] branches=- | result=manifest [EXCEPTIONS] declares JsonProcessingException [NEW] IiifPresentationApiObjectMapper [CALLS-EXTERNAL] mapper.writerWithDefaultPrettyPrinter().writeValueAsString/1, ObjectMapper.writerWithDefaul...
/* static context [FOCAL] public String ManifestGenerator.generateJson(Manifest manifest) [INPUTS] branches=- | result=manifest [EXCEPTIONS] declares JsonProcessingException [NEW] IiifPresentationApiObjectMapper [CALLS-EXTERNAL] mapper.writerWithDefaultPrettyPrinter().writeValueAsString/1, ObjectMapper.writerWithDefaul...
true
ok
{"focal": {"class": "ManifestGenerator", "name": "generateJson", "signature": "String generateJson(Manifest manifest) throws JsonProcessingException", "start_line": 3, "modifiers": "public", "params": [{"name": "manifest", "type": "Manifest"}], "return_type": "String"}, "class_info": {"name": "ManifestGenerator", "kind...
38710494_0
class BasicTransactionAssistanceFactoryImpl implements BasicTransactionAssistanceFactory { @Override public TransactionAssistant getTransactionAssistant() throws ResourceException { //enlist a new resource into the transaction. it will be delisted, when its closed. final CommitRollbackCallback commitRollbackCall...
CommitRollbackCallback callback = new CommitRollbackCallback() { private static final long serialVersionUID = 1L; @Override public void rollback(String txid) throws Exception { } @Override public void commit(String txid) throws Exception { } }; final UserTransactionManager tm = mock(UserTr...
[FOCAL] @Override public TransactionAssistant BasicTransactionAssistanceFactoryImpl.getTransactionAssistant() [CLASS] class BasicTransactionAssistanceFactoryImpl implements BasicTransactionAssistanceFactory [METRICS] loc=17 cc=3 branches=1 loops=0 returns=1 throws=2 nesting=2 [CALLS-INTERNAL] UserTransactionManager get...
/* static context [FOCAL] @Override public TransactionAssistant BasicTransactionAssistanceFactoryImpl.getTransactionAssistant() [THROWS-WHEN] ResourceException when try-body throws [THROWS-WHEN] ResourceException when utm.getStatus() == Status.STATUS_NO_TRANSACTION && throw new ResourceException("no transaction found. ...
/* static context [FOCAL] @Override public TransactionAssistant BasicTransactionAssistanceFactoryImpl.getTransactionAssistant() [THROWS-WHEN] ResourceException when try-body throws [THROWS-WHEN] ResourceException when utm.getStatus() == Status.STATUS_NO_TRANSACTION && throw new ResourceException("no transaction found. ...
true
ok
{"focal": {"class": "BasicTransactionAssistanceFactoryImpl", "name": "getTransactionAssistant", "signature": "TransactionAssistant getTransactionAssistant() throws ResourceException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "TransactionAssistant"}, "class_info": {"name": "BasicTra...
38743792_67
class SQLTask extends Task { public static Instance run(Odps odps, String sql) throws OdpsException { String project = odps.getDefaultProject(); if (project == null) { throw new OdpsException("default project required."); } return run(odps, project, sql, "AnonymousSQLTask", null, null, "sql"); ...
Instance i = SQLTask.run(odps, odps.getDefaultProject(), "select * from src;", "testsql", null, null, 3); assertEquals(i.getPriority(), 3); } }
[FOCAL] public static Instance SQLTask.run(Odps odps, String sql) [CLASS] class SQLTask extends Task [METRICS] loc=7 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] Instance run(Odps odps, String project, String sql, String taskName, Map<String, String> hints, Map<String, String> aliases, int prio...
/* static context [FOCAL] public static Instance SQLTask.run(Odps odps, String sql) [THROWS-WHEN] OdpsException when project == null [PATH1] if(project == null)=T -> throw new OdpsException("default project required.") [PATH2] if(project == null)=F -> return run(odps, project, sql, "AnonymousSQLTask", null, null, "sql"...
/* static context [FOCAL] public static Instance SQLTask.run(Odps odps, String sql) [THROWS-WHEN] OdpsException when project == null [PATH1] if(project == null)=T -> throw new OdpsException("default project required.") [PATH2] if(project == null)=F -> return run(odps, project, sql, "AnonymousSQLTask", null, null, "sql"...
true
ok
{"focal": {"class": "SQLTask", "name": "run", "signature": "Instance run(Odps odps, String sql) throws OdpsException", "start_line": 3, "modifiers": "public static", "params": [{"name": "odps", "type": "Odps"}, {"name": "sql", "type": "String"}], "return_type": "Instance"}, "class_info": {"name": "SQLTask", "kind": "cl...
38755419_7
class Utilities { public static String completeDate(String date) { if (date.endsWith("-")) { date = date.substring(0, date.length()-1); } String val = ""; if (date.length() < 4) { return val; } else if (date.length() == 4) { val = date + ...
assertThat(Utilities.completeDate("2015"), is("2015-12-31")); } }
[FOCAL] public static String Utilities.completeDate(String date) [CLASS] class Utilities [METRICS] loc=57 cc=13 branches=11 loops=0 returns=2 throws=0 nesting=6 [CALLS-EXTERNAL] String.endsWith/1, String.substring/2, String.length/0, String.indexOf/1, String.equals/1, Integer.parseInt/1, String.lastIndexOf/1, String.tr...
/* static context [FOCAL] public static String Utilities.completeDate(String date) [PATH1] if(date.endsWith("-"))=T -> if(date.length() < 4)=F -> if(date.length() == 4)=F -> if((date.length() == 7) || (date.length() == 6))=T -> if(monthStr.length() == 1)=T -> if(monthStr.equals("02"))=F -> if((monthStr.equals("04")) ||...
/* static context [FOCAL] public static String Utilities.completeDate(String date) [PATH1] if(date.endsWith("-"))=T -> if(date.length() < 4)=F -> if(date.length() == 4)=F -> if((date.length() == 7) || (date.length() == 6))=T -> if(monthStr.length() == 1)=T -> if(monthStr.equals("02"))=F -> if((monthStr.equals("04")) ||...
true
ok
{"focal": {"class": "Utilities", "name": "completeDate", "signature": "String completeDate(String date)", "start_line": 3, "modifiers": "public static", "params": [{"name": "date", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Utilities", "kind": "class", "modifiers": "", "superclass": null, "in...
38829639_38
class Quantity implements Serializable { @Override public String toString() { StringBuilder b = new StringBuilder(); if (getAmount() != null) { b.append(getAmount()); } if (getFormat() != null) { b.append(getFormat()); } return b.toString(); } public Quantity(); public ...
assertEquals(".5Mi", new Quantity(".5Mi").toString()); assertEquals("1", new Quantity("1").toString()); assertEquals("129e6", new Quantity("129e6").toString()); assertEquals("0.001m", new Quantity("0.001m").toString()); assertEquals("1Ki", new Quantity("1Ki").toString()); assertEquals("32Mi", ne...
[FOCAL] @Override public String Quantity.toString() [CLASS] class Quantity implements Serializable [METRICS] loc=11 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] String getAmount(); String getFormat() [CALLS-EXTERNAL] StringBuilder.append/1, StringBuilder.toString/0 [NEW] StringBuilder [PATH1] i...
/* static context [FOCAL] @Override public String Quantity.toString() [PATH1] if(getAmount() != null)=T -> if(getFormat() != null)=T -> return b.toString() [PATH2] if(getAmount() != null)=F -> if(getFormat() != null)=F -> return b.toString() [CALLS-INTERNAL] String getAmount(); String getFormat() [NEW] StringBuilder [C...
/* static context [FOCAL] @Override public String Quantity.toString() [PATH1] if(getAmount() != null)=T -> if(getFormat() != null)=T -> return b.toString() [PATH2] if(getAmount() != null)=F -> if(getFormat() != null)=F -> return b.toString() [CALLS-INTERNAL] String getAmount(); String getFormat() [NEW] StringBuilder [C...
true
ok
{"focal": {"class": "Quantity", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "Quantity", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Serializable", "fields": [{"name": "mapp...
38830174_1
class PostPresenter extends BasePresenter { public void loadPostIdList(String storyTypeUrl) { mCompositeSubscription.add(mDataManager.getPostList(storyTypeUrl) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Action1<List<Long>>() {...
when(mDataManager.getPostList("test")).thenReturn(Observable.just(makePostIdList(5))); mPresenter.loadPostIdList("test"); verify(mPostView).hideSwipeRefresh(); } }
[FOCAL] public void PostPresenter.loadPostIdList(String storyTypeUrl) [CLASS] class PostPresenter extends BasePresenter [METRICS] loc=18 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void loadPosts(List<Long> list, boolean updateObservable) [CALLS-EXTERNAL] mCompositeSubscription.add/1, mDataMan...
/* static context [FOCAL] public void PostPresenter.loadPostIdList(String storyTypeUrl) [COLLABORATORS] field mCompositeSubscription add/1; field mDataManager:DataManager getPostList/1; field mPostIdList addAll/1,subList/2; field mPostView:PostView hideSwipeRefresh/0,showErrorLog/2; field throwable toString/0 [CALLS-IN...
/* static context [FOCAL] public void PostPresenter.loadPostIdList(String storyTypeUrl) [COLLABORATORS] field mCompositeSubscription add/1; field mDataManager:DataManager getPostList/1; field mPostIdList addAll/1,subList/2; field mPostView:PostView hideSwipeRefresh/0,showErrorLog/2; field throwable toString/0 [CALLS-IN...
true
ok
{"focal": {"class": "PostPresenter", "name": "loadPostIdList", "signature": "void loadPostIdList(String storyTypeUrl)", "start_line": 3, "modifiers": "public", "params": [{"name": "storyTypeUrl", "type": "String"}], "return_type": "void"}, "class_info": {"name": "PostPresenter", "kind": "class", "modifiers": "", "super...
38846457_2
class KotlinScriptEngine extends AbstractScriptEngine implements ScriptEngine, Compilable { @Override public Bindings createBindings() { return new SimpleBindings(); } public KotlinScriptEngine(KotlinScriptEngineFactory factory); @Override public CompiledScript compile(String script); @Override public Objec...
assertNotNull(engine.createBindings()); } }
[FOCAL] @Override public Bindings KotlinScriptEngine.createBindings() [CLASS] class KotlinScriptEngine extends AbstractScriptEngine implements ScriptEngine, Compilable [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] SimpleBindings [CLASS-MEMBERS] KotlinScriptEngine(KotlinScriptEngineFactory f...
/* static context [FOCAL] @Override public Bindings KotlinScriptEngine.createBindings() [NEW] SimpleBindings */
/* static context [FOCAL] @Override public Bindings KotlinScriptEngine.createBindings() [NEW] SimpleBindings */ class KotlinScriptEngine extends AbstractScriptEngine implements ScriptEngine, Compilable { @Override public Bindings createBindings() { return new SimpleBindings(); } public KotlinScriptEngine(Kotli...
true
ok
{"focal": {"class": "KotlinScriptEngine", "name": "createBindings", "signature": "Bindings createBindings()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Bindings"}, "class_info": {"name": "KotlinScriptEngine", "kind": "class", "modifiers": "", "superclass": "AbstractScriptEngine", "...
38883479_7
class NormalizerNR1_5 implements NormalizationRule { @Override public Set<IntegerAxiom> apply(IntegerAxiom axiom) { Objects.requireNonNull(axiom); Set<IntegerAxiom> ret = Collections.emptySet(); if (axiom instanceof IntegerEquivalentClassesAxiom) { ret = applyRule((IntegerEquivalentClassesAxiom) axiom); }...
Set<IntegerAnnotation> annotations = new TreeSet<>(); IntegerOntologyObjectFactory factory = new IntegerOntologyObjectFactoryImpl(); NormalizerNR1_5 normalizer = new NormalizerNR1_5(factory); IntegerObjectProperty r = factory.getDataTypeFactory().createObjectProperty( factory.getEntityManager().createNamed...
[FOCAL] @Override public Set<IntegerAxiom> NormalizerNR1_5.apply(IntegerAxiom axiom) [CLASS] class NormalizerNR1_5 implements NormalizationRule [METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] Set<IntegerAxiom> applyRule(IntegerEquivalentClassesAxiom equivalentAxiom) [CALLS-EXTERNAL...
/* static context [FOCAL] @Override public Set<IntegerAxiom> NormalizerNR1_5.apply(IntegerAxiom axiom) [PATH1] if(axiom instanceof IntegerEquivalentClassesAxiom)=T -> return ret [PATH2] if(axiom instanceof IntegerEquivalentClassesAxiom)=F -> return ret [INPUTS] branches=axiom | result=axiom [CALLS-INTERNAL] Set<Integer...
/* static context [FOCAL] @Override public Set<IntegerAxiom> NormalizerNR1_5.apply(IntegerAxiom axiom) [PATH1] if(axiom instanceof IntegerEquivalentClassesAxiom)=T -> return ret [PATH2] if(axiom instanceof IntegerEquivalentClassesAxiom)=F -> return ret [INPUTS] branches=axiom | result=axiom [CALLS-INTERNAL] Set<Integer...
true
ok
{"focal": {"class": "NormalizerNR1_5", "name": "apply", "signature": "Set<IntegerAxiom> apply(IntegerAxiom axiom)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "axiom", "type": "IntegerAxiom"}], "return_type": "Set<IntegerAxiom>"}, "class_info": {"name": "NormalizerNR1_5", "kind": "class", "mo...
38917208_1839
class SetError { public static Builder builder() { return new Builder(); } @VisibleForTesting SetError(Type type, Optional<String> description, Optional<ImmutableSet<MessageProperty>> properties); protected SetError(SetError setError); @JsonSerialize public String getType(); @JsonSe...
ImmutableSet<MessageProperty> props = ImmutableSet.of(MessageProperty.attachedMessages); SetError expected = new SetError(SetError.Type.ERROR, Optional.of("description"), Optional.of(props)); SetError setError = SetError.builder() .type(SetError.Type.ERROR) .des...
[FOCAL] public static Builder SetError.builder() [CLASS] class SetError [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] Builder [CLASS-MEMBERS] SetError(Type type, Optional<String> description, Optional<ImmutableSet<MessageProperty>> properties); SetError(SetError setError); String getType();...
/* static context [FOCAL] public static Builder SetError.builder() [NEW] Builder */
/* static context [FOCAL] public static Builder SetError.builder() [NEW] Builder */ class SetError { public static Builder builder() { return new Builder(); } @VisibleForTesting SetError(Type type, Optional<String> description, Optional<ImmutableSet<MessageProperty>> properties); protected S...
true
ok
{"focal": {"class": "SetError", "name": "builder", "signature": "Builder builder()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Builder"}, "class_info": {"name": "SetError", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Se...
38935102_44
class Utils { @Nullable public static Point2D findRectEdgeIntersection(@Nonnull final Rectangle2D rect, final double outboundX, final double outboundY) { final int detectedSide = rect.outcode(outboundX, outboundY); if ((detectedSide & (Rectangle2D.OUT_TOP | Rectangle2D.OUT_BOTTOM)) != 0) { final boo...
final Rectangle2D rect = new Rectangle2D.Double(50, 50, 100, 50); assertEquals(new Point2D.Double(100d, 50d), Utils.findRectEdgeIntersection(rect, 100d, 25d)); assertEquals(new Point2D.Double(100d, 100d), Utils.findRectEdgeIntersection(rect, 100d, 125d)); assertEquals(new Point2D.Double(50d, 75d), Util...
[FOCAL] @Nullable public static Point2D Utils.findRectEdgeIntersection(Rectangle2D rect, double outboundX, double outboundY) [CLASS] class Utils [METRICS] loc=38 cc=7 branches=6 loops=0 returns=5 throws=0 nesting=3 [CALLS-EXTERNAL] Rectangle2D.outcode/2, Rectangle2D.getCenterX/0, Rectangle2D.getMinY/0, Rectangle2D.getM...
class Utils { @Nullable public static Point2D findRectEdgeIntersection(@Nonnull final Rectangle2D rect, final double outboundX, final double outboundY) { final int detectedSide = rect.outcode(outboundX, outboundY); if ((detectedSide & (Rectangle2D.OUT_TOP | Rectangle2D.OUT_BOTTOM)) != 0) { final boo...
false
ok
{"focal": {"class": "Utils", "name": "findRectEdgeIntersection", "signature": "Point2D findRectEdgeIntersection(Rectangle2D rect, double outboundX, double outboundY)", "start_line": 3, "modifiers": "@Nullable public static", "params": [{"name": "rect", "type": "Rectangle2D"}, {"name": "outboundX", "type": "double"}, {"...
38952211_1
class InsertSort { public static void mysort(Comparable[] a) { int sortedSize = 1; int length = a.length; //剩下未排序的队列 for (int i = 1; i < length; i++) { Comparable insertObject = a[i]; int insertIndex = sorte...
Integer[] sortIntegerArray = { 1, 2, 5, 4, 3 }; Integer[] resultArray = { 1, 2, 3, 4, 5 }; InsertSort.mysort(sortIntegerArray); Assert.assertArrayEquals(sortIntegerArray, resultArray); } }
[FOCAL] public static void InsertSort.mysort(Comparable[] a) [CLASS] class InsertSort [METRICS] loc=37 cc=5 branches=1 loops=3 returns=0 throws=0 nesting=3 [CALLS-EXTERNAL] Utils.less/2 [PATH1] for(i < length)=T -> for(j < sortedSize)=T -> if(Utils.less(insertObject, a[j]))=T -> for(m >= insertIndex)=F -> exit loop [PA...
/* static context [FOCAL] public static void InsertSort.mysort(Comparable[] a) [PATH1] for(i < length)=T -> for(j < sortedSize)=T -> if(Utils.less(insertObject, a[j]))=T -> for(m >= insertIndex)=F -> exit loop [PATH2] for(i < length)=T -> for(j < sortedSize)=F -> for(m >= insertIndex)=T -> exit loop -> exit loop [PATH3...
/* static context [FOCAL] public static void InsertSort.mysort(Comparable[] a) [PATH1] for(i < length)=T -> for(j < sortedSize)=T -> if(Utils.less(insertObject, a[j]))=T -> for(m >= insertIndex)=F -> exit loop [PATH2] for(i < length)=T -> for(j < sortedSize)=F -> for(m >= insertIndex)=T -> exit loop -> exit loop [PATH3...
true
ok
{"focal": {"class": "InsertSort", "name": "mysort", "signature": "void mysort(Comparable[] a)", "start_line": 3, "modifiers": "public static", "params": [{"name": "a", "type": "Comparable[]"}], "return_type": "void"}, "class_info": {"name": "InsertSort", "kind": "class", "modifiers": "", "superclass": null, "interfaces...