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
136173345_53
class SnapshotProcessor extends AbstractProcessor { @Override public void process() { if (snapshotMode == CassandraConnectorConfig.SnapshotMode.ALWAYS) { snapshot(); } else if (snapshotMode == CassandraConnectorConfig.SnapshotMode.INITIAL && initial) { snapshot()...
CassandraConnectorContext context = generateTaskContext(); AtomicBoolean globalTaskState = new AtomicBoolean(true); SnapshotProcessor snapshotProcessor = Mockito.spy(new SnapshotProcessor(context)); when(snapshotProcessor.isRunning()).thenReturn(true); context.getCassandraClient...
[FOCAL] @Override public void SnapshotProcessor.process() [CLASS] class SnapshotProcessor extends AbstractProcessor [METRICS] loc=13 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=2 [CALLS-INTERNAL] void snapshot() [CALLS-EXTERNAL] LOGGER.debug/2 [PATH1] if(snapshotMode == CassandraConnectorConfig.SnapshotMode.ALWA...
/* static context [FOCAL] @Override public void SnapshotProcessor.process() [PATH1] if(snapshotMode == CassandraConnectorConfig.SnapshotMode.ALWAYS)=F -> if(snapshotMode == CassandraConnectorConfig.SnapshotMode.INITIAL && initial)=T [PATH2] if(snapshotMode == CassandraConnectorConfig.SnapshotMode.ALWAYS)=T [PATH3] if(s...
/* static context [FOCAL] @Override public void SnapshotProcessor.process() [PATH1] if(snapshotMode == CassandraConnectorConfig.SnapshotMode.ALWAYS)=F -> if(snapshotMode == CassandraConnectorConfig.SnapshotMode.INITIAL && initial)=T [PATH2] if(snapshotMode == CassandraConnectorConfig.SnapshotMode.ALWAYS)=T [PATH3] if(s...
true
ok
{"focal": {"class": "SnapshotProcessor", "name": "process", "signature": "void process()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "SnapshotProcessor", "kind": "class", "modifiers": "", "superclass": "AbstractProcessor", "interfaces": null, "fields"...
136324618_13
class SoliumKeyUtils { public static boolean keyExists(String key) { return rulesKeyset.contains(key); } private SoliumKeyUtils(); } class SoliumKeyUtilsTest { @Test public void test() {
assertThat(SoliumKeyUtils.keyExists(("imports-on-top"))).isTrue(); assertThat(SoliumKeyUtils.keyExists("security/no-unreachable-code")).isTrue(); assertThat(SoliumKeyUtils.keyExists("no_rule")).isFalse(); } }
[FOCAL] public static boolean SoliumKeyUtils.keyExists(String key) [CLASS] class SoliumKeyUtils [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] rulesKeyset.contains/1 [INPUTS] branches=- | result=key [COLLABORATORS] field rulesKeyset contains/1 [DATAFLOW] key@param->L2 [CLASS-MEMBE...
/* static context [FOCAL] public static boolean SoliumKeyUtils.keyExists(String key) [INPUTS] branches=- | result=key [COLLABORATORS] field rulesKeyset contains/1 [CALLS-EXTERNAL] rulesKeyset.contains/1 */
/* static context [FOCAL] public static boolean SoliumKeyUtils.keyExists(String key) [INPUTS] branches=- | result=key [COLLABORATORS] field rulesKeyset contains/1 [CALLS-EXTERNAL] rulesKeyset.contains/1 */ class SoliumKeyUtils { public static boolean keyExists(String key) { return rulesKeyset.contains(key); } ...
true
ok
{"focal": {"class": "SoliumKeyUtils", "name": "keyExists", "signature": "boolean keyExists(String key)", "start_line": 3, "modifiers": "public static", "params": [{"name": "key", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "SoliumKeyUtils", "kind": "class", "modifiers": "", "superclass": null,...
136395597_4
class JdbcDao implements DonkeyDao { @Override public void updateMessageAttachment(String channelId, long messageId, Attachment attachment) { logger.debug(channelId + "/" + messageId + ": updating message attachment"); PreparedStatement segmentCountStatement = null; ResultSet segmentCo...
String channelId = "testchannel"; long messageId = 1; Attachment attachment = new Attachment("testattachment", StringUtils.repeat("testtest", "", 10 * 1024 * 1024 / 8).getBytes(), "text/plain"); ResultSet segmentCountResult = mock(ResultSet.class); PreparedStatement segmentCount...
[FOCAL] @Override public void JdbcDao.updateMessageAttachment(String channelId, long messageId, Attachment attachment) [CLASS] class JdbcDao implements DonkeyDao [METRICS] loc=114 cc=8 branches=5 loops=1 returns=0 throws=1 nesting=4 [CALLS-INTERNAL] PreparedStatement prepareStatement(String queryId, String channelId); ...
class JdbcDao implements DonkeyDao { @Override public void updateMessageAttachment(String channelId, long messageId, Attachment attachment) { logger.debug(channelId + "/" + messageId + ": updating message attachment"); PreparedStatement segmentCountStatement = null; ResultSet segmentCo...
false
ok
{"focal": {"class": "JdbcDao", "name": "updateMessageAttachment", "signature": "void updateMessageAttachment(String channelId, long messageId, Attachment attachment)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "channelId", "type": "String"}, {"name": "messageId", "type": "long"}, {"name": "a...
136437189_3
class SecureNetworkBeacon extends MeshBeacon { protected boolean canOverwrite(final IvIndex ivIndex, final Calendar updatedAt, final boolean ivRecoveryActive, final boolean isTestMode, final boolean ivRecoveryO...
final byte[] data = MeshParserUtils.toByteArray("0102EE6C0EFF5298ECFF000000025E5AA7B268B5E044"); final SecureNetworkBeacon snb = new SecureNetworkBeacon(data); final IvIndex ivIndex = new IvIndex(0, false, Calendar.getInstance()); final Calendar currentTime = Calendar.getInstance(); ...
[FOCAL] protected boolean SecureNetworkBeacon.canOverwrite(IvIndex ivIndex, Calendar updatedAt, boolean ivRecoveryActive, boolean isTestMode, boolean ivRecoveryOver42Allowed) [CLASS] class SecureNetworkBeacon extends MeshBeacon [METRICS] loc=20 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] boole...
/* static context [FOCAL] protected boolean SecureNetworkBeacon.canOverwrite(IvIndex ivIndex, Calendar updatedAt, boolean ivRecoveryActive, boolean isTestMode, boolean ivRecoveryOver42Allowed) [PATH1] if(((this.ivIndex.getIvIndex() > ivIndex.getIvIndex() && (ivRecoveryOver42Allowed || this.ivIndex.getIvIndex() <= ivInd...
/* static context [FOCAL] protected boolean SecureNetworkBeacon.canOverwrite(IvIndex ivIndex, Calendar updatedAt, boolean ivRecoveryActive, boolean isTestMode, boolean ivRecoveryOver42Allowed) [PATH1] if(((this.ivIndex.getIvIndex() > ivIndex.getIvIndex() && (ivRecoveryOver42Allowed || this.ivIndex.getIvIndex() <= ivInd...
true
ok
{"focal": {"class": "SecureNetworkBeacon", "name": "canOverwrite", "signature": "boolean canOverwrite(IvIndex ivIndex, Calendar updatedAt, boolean ivRecoveryActive, boolean isTestMode, boolean ivRecoveryOver42Allowed)", "start_line": 3, "modifiers": "protected", "params": [{"name": "ivIndex", "type": "IvIndex"}, {"name...
136439284_6
class Zmq { public static Sink<ZMsg, NotUsed> publishServerSink(String addresses) { return Flow.fromGraph(new ZmqPublishStage(true, addresses)).to(Sink.ignore()); } public static Source<ZMsg, NotUsed> subscribeClientSource(String addresses); public static Source<ZMsg, NotUsed> subscribeClientSource(String...
//Given final int port = findFreePort(); final String addr = "tcp://localhost:" + port; //When Source<ZMsg, TestPublisher.Probe<ZMsg>> testSource = TestSource.probe(system); TestPublisher.Probe<ZMsg> probe = Zmq.publishServerSink(addr).runWith(testSource, materializer); probe.ensureSubscrip...
[FOCAL] public static Sink<ZMsg, NotUsed> Zmq.publishServerSink(String addresses) [CLASS] class Zmq [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Flow.fromGraph(new ZmqPublishStage(true, addresses)).to/1, Flow.fromGraph/1, Sink.ignore/0 [NEW] ZmqPublishStage [INPUTS] branches=- |...
/* static context [FOCAL] public static Sink<ZMsg, NotUsed> Zmq.publishServerSink(String addresses) [INPUTS] branches=- | result=addresses [NEW] ZmqPublishStage [CALLS-EXTERNAL] Flow.fromGraph(new ZmqPublishStage(true, addresses)).to/1, Flow.fromGraph/1, Sink.ignore/0 */
/* static context [FOCAL] public static Sink<ZMsg, NotUsed> Zmq.publishServerSink(String addresses) [INPUTS] branches=- | result=addresses [NEW] ZmqPublishStage [CALLS-EXTERNAL] Flow.fromGraph(new ZmqPublishStage(true, addresses)).to/1, Flow.fromGraph/1, Sink.ignore/0 */ class Zmq { public static Sink<ZMsg, NotUsed>...
true
ok
{"focal": {"class": "Zmq", "name": "publishServerSink", "signature": "Sink<ZMsg, NotUsed> publishServerSink(String addresses)", "start_line": 3, "modifiers": "public static", "params": [{"name": "addresses", "type": "String"}], "return_type": "Sink<ZMsg, NotUsed>"}, "class_info": {"name": "Zmq", "kind": "class", "modif...
136447306_0
class CustomTeaser implements Teaser { public String getImgAlign() { return imgAlign; } @Override public boolean isActionsEnabled(); @Override public List<ListItem> getActions(); @Override public String getLinkURL(); @Override public Resource getImageResource(); @Override public bo...
context.currentResource(TEASER1); CustomTeaser customTeaser1 = context.request().adaptTo(CustomTeaser.class); assertNotNull(customTeaser1); assertNotNull(customTeaser1.getImgAlign()); } }
[FOCAL] public String CustomTeaser.getImgAlign() [CLASS] class CustomTeaser implements Teaser [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] boolean isActionsEnabled(); List<ListItem> getActions(); String getLinkURL(); Resource getImageResource(); boolean isImageLinkHidden(); Strin...
/* static context [FOCAL] public String CustomTeaser.getImgAlign() */
/* static context [FOCAL] public String CustomTeaser.getImgAlign() */ class CustomTeaser implements Teaser { public String getImgAlign() { return imgAlign; } @Override public boolean isActionsEnabled(); @Override public List<ListItem> getActions(); @Override public String getLinkURL(); ...
true
ok
{"focal": {"class": "CustomTeaser", "name": "getImgAlign", "signature": "String getImgAlign()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "CustomTeaser", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Teaser", "fields": [{"name": "TEASER...
136463642_29
class ValidationUtils { public static List<ParamValidationError> checkNoFieldsOfType(final DatasetSchema schema, final Class<? extends AbstractValueSchema> fieldClass) { final ImmutableList.Builder<ParamValidationError> errors = ImmutableList...
final DatasetSchema schemaWithoutCat = TestDatasetSchemaBuilder.builder() .withCategoricalFields(3) .withNumericalFields(3) .withStringFields(3) .build(); assertThat(ValidationUtils.checkNoFieldsOfType(schemaWithoutCat, CategoricalValueSc...
[FOCAL] public static List<ParamValidationError> ValidationUtils.checkNoFieldsOfType(DatasetSchema schema, Class<? extends AbstractValueSchema> fieldClass) [CLASS] class ValidationUtils [METRICS] loc=16 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] ImmutableList.builder/0, schema.getPredictiveFi...
/* static context [FOCAL] public static List<ParamValidationError> ValidationUtils.checkNoFieldsOfType(DatasetSchema schema, Class<? extends AbstractValueSchema> fieldClass) [COLLABORATORS] param schema:DatasetSchema getPredictiveFields/0; param fieldClass:Class<? extends AbstractValueSchema> isInstance/1; field field ...
/* static context [FOCAL] public static List<ParamValidationError> ValidationUtils.checkNoFieldsOfType(DatasetSchema schema, Class<? extends AbstractValueSchema> fieldClass) [COLLABORATORS] param schema:DatasetSchema getPredictiveFields/0; param fieldClass:Class<? extends AbstractValueSchema> isInstance/1; field field ...
true
ok
{"focal": {"class": "ValidationUtils", "name": "checkNoFieldsOfType", "signature": "List<ParamValidationError> checkNoFieldsOfType(DatasetSchema schema, Class<? extends AbstractValueSchema> fieldClass)", "start_line": 3, "modifiers": "public static", "params": [{"name": "schema", "type": "DatasetSchema"}, {"name": "fie...
136544584_3
class MaxTemperatureDriver extends Configured implements Tool { @Override public int run(String[] args) throws Exception { if (args.length != 2) { System.err.printf("Usage: %s [generic options] <input> <output>\n", getClass().getSimpleName()); ToolRunner.printGenericCommandUsage(System.er...
Configuration conf = new Configuration(); conf.set("fs.defaultFS", "file:///"); conf.set("mapreduce.framework.name", "local"); conf.setInt("mapreduce.task.io.sort.mb", 1); Path input = new Path("input/ncdc/micro"); Path output = new Path("output"); FileSystem fs = FileSystem.getLoc...
[FOCAL] @Override public int MaxTemperatureDriver.run(String[] args) [CLASS] class MaxTemperatureDriver extends Configured implements Tool [METRICS] loc=24 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] System.err.printf/2, getClass().getSimpleName/0, getClass/0 (inherited), ToolRunner.printGener...
/* static context [FOCAL] @Override public int MaxTemperatureDriver.run(String[] args) [PATH1] if(args.length != 2)=T -> return -1 [PATH2] if(args.length != 2)=F -> return job.waitForCompletion(true) ? 0 : 1 [INPUTS] branches=args | result=- [EXCEPTIONS] declares Exception [NEW] Job, Path [CALLS-EXTERNAL] System.err.pr...
/* static context [FOCAL] @Override public int MaxTemperatureDriver.run(String[] args) [PATH1] if(args.length != 2)=T -> return -1 [PATH2] if(args.length != 2)=F -> return job.waitForCompletion(true) ? 0 : 1 [INPUTS] branches=args | result=- [EXCEPTIONS] declares Exception [NEW] Job, Path [CALLS-EXTERNAL] System.err.pr...
true
ok
{"focal": {"class": "MaxTemperatureDriver", "name": "run", "signature": "int run(String[] args) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "args", "type": "String[]"}], "return_type": "int"}, "class_info": {"name": "MaxTemperatureDriver", "kind": "class", "modifiers": "", "...
136567454_1
class HoldingsController { @PostMapping public Holding[] saveHoldings(@RequestBody Holding[] holdings, Principal principal) { User user = getUser(principal); try { String json = mapper.writeValueAsString(holdings); user.getProfile().put(HOLDINGS_ATTRIBUTE_NAME, json); ...
// define mocks Client client = mock(Client.class); User user = mock(User.class); UserProfile userProfile = mock(UserProfile.class); Principal principal = mock(Principal.class); // define behaviour String username = "joe.coder@example.com"; when(principa...
[FOCAL] @PostMapping public Holding[] HoldingsController.saveHoldings(Holding[] holdings, Principal principal) [CLASS] class HoldingsController [METRICS] loc=14 cc=2 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] User getUser(Principal principal) [CALLS-EXTERNAL] mapper.writeValueAsString/1, user.getP...
/* static context [FOCAL] @PostMapping public Holding[] HoldingsController.saveHoldings(Holding[] holdings, Principal principal) [PATH1] try-body throws -> return holdings [INPUTS] branches=- | result=holdings [COLLABORATORS] field mapper writeValueAsString/1 [EXCEPTIONS] catches JsonProcessingException e [CALLS-INTERN...
/* static context [FOCAL] @PostMapping public Holding[] HoldingsController.saveHoldings(Holding[] holdings, Principal principal) [PATH1] try-body throws -> return holdings [INPUTS] branches=- | result=holdings [COLLABORATORS] field mapper writeValueAsString/1 [EXCEPTIONS] catches JsonProcessingException e [CALLS-INTERN...
true
ok
{"focal": {"class": "HoldingsController", "name": "saveHoldings", "signature": "Holding[] saveHoldings(Holding[] holdings, Principal principal)", "start_line": 3, "modifiers": "@PostMapping public", "params": [{"name": "holdings", "type": "Holding[]"}, {"name": "principal", "type": "Principal"}], "return_type": "Holdin...
136645456_2
class RequestRetryAuthenticator implements Authenticator { @Nullable @Override public Request authenticate(@NonNull Route route, @NonNull Response response) throws IOException { if (response.priorResponse() != null) { return null; // Give up, we've already attempted to refre...
when(accountAuthenticator.getAccessToken()).thenAnswer(invocation -> validAccessToken); Response unauthenticatedResponse = response.newBuilder() .request( response.request() .newBuilder() ...
[FOCAL] @Nullable @Override public Request RequestRetryAuthenticator.authenticate(Route route, Response response) [CLASS] class RequestRetryAuthenticator implements Authenticator [METRICS] loc=25 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] String parseHeaderAccessToken(Response response) [CALL...
/* static context [FOCAL] @Nullable @Override public Request RequestRetryAuthenticator.authenticate(Route route, Response response) [PATH1] if(response.priorResponse() != null)=F -> if(invalidAccessToken.isEmpty())=T -> return response.request() .newBuilder() .removeHeader(Headers.AUTHORIZATIO... [PATH2] if(response.pr...
/* static context [FOCAL] @Nullable @Override public Request RequestRetryAuthenticator.authenticate(Route route, Response response) [PATH1] if(response.priorResponse() != null)=F -> if(invalidAccessToken.isEmpty())=T -> return response.request() .newBuilder() .removeHeader(Headers.AUTHORIZATIO... [PATH2] if(response.pr...
true
ok
{"focal": {"class": "RequestRetryAuthenticator", "name": "authenticate", "signature": "Request authenticate(Route route, Response response) throws IOException", "start_line": 3, "modifiers": "@Nullable @Override public", "params": [{"name": "route", "type": "Route"}, {"name": "response", "type": "Response"}], "return_t...
136895157_2
class HazelcastQuorumListener extends MembershipAdapter implements HZQuorumListener { @Override public boolean isQuorum() { return isQuorum.get(); } HazelcastQuorumListener(final int quorum); @Override public void memberAdded(final MembershipEvent e); @Override public void memberRemoved(final Membe...
listener = new HazelcastQuorumListener(2); assertFalse(listener.isQuorum()); } }
[FOCAL] @Override public boolean HazelcastQuorumListener.isQuorum() [CLASS] class HazelcastQuorumListener extends MembershipAdapter implements HZQuorumListener [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] isQuorum.get/0 [COLLABORATORS] field isQuorum get/0 [CLASS-MEMBERS] Hazelc...
/* static context [FOCAL] @Override public boolean HazelcastQuorumListener.isQuorum() [COLLABORATORS] field isQuorum get/0 [CALLS-EXTERNAL] isQuorum.get/0 */
/* static context [FOCAL] @Override public boolean HazelcastQuorumListener.isQuorum() [COLLABORATORS] field isQuorum get/0 [CALLS-EXTERNAL] isQuorum.get/0 */ class HazelcastQuorumListener extends MembershipAdapter implements HZQuorumListener { @Override public boolean isQuorum() { return isQuorum.get(); } ...
true
ok
{"focal": {"class": "HazelcastQuorumListener", "name": "isQuorum", "signature": "boolean isQuorum()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "boolean"}, "class_info": {"name": "HazelcastQuorumListener", "kind": "class", "modifiers": "", "superclass": "MembershipAdapter", "interfa...
136936588_1
class BaseUtils { public static String dateToString(Date d) { return dateToString("dd/MM/yyyy", d); } public static Integer getApiVersion(); public static String getPlatformVersion(); public static String checkClientVersion(String serverPlatformVersion, Integer serverApiVersion, String cli...
assertEquals("01/01/1901", BaseUtils.dateToString(new Date(1, 0, 1))); assertEquals("03/12/2001", BaseUtils.dateToString(new Date(101, 11, 3))); assertEquals("14/10/2012", BaseUtils.dateToString(new Date(112, 9, 14))); assertEquals("01.01.1901", BaseUtils.dateToString("dd.MM.yyyy", new ...
[FOCAL] public static String BaseUtils.dateToString(Date d) [CLASS] class BaseUtils [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String dateToString(String format, Date d) [INPUTS] branches=- | result=d [DATAFLOW] d@param->L2 [CLASS-MEMBERS] Integer getApiVersion(); String getPl...
class BaseUtils { public static String dateToString(Date d) { return dateToString("dd/MM/yyyy", d); } public static Integer getApiVersion(); public static String getPlatformVersion(); public static String checkClientVersion(String serverPlatformVersion, Integer serverApiVersion, String cli...
false
ok
{"focal": {"class": "BaseUtils", "name": "dateToString", "signature": "String dateToString(Date d)", "start_line": 3, "modifiers": "public static", "params": [{"name": "d", "type": "Date"}], "return_type": "String"}, "class_info": {"name": "BaseUtils", "kind": "class", "modifiers": "", "superclass": null, "interfaces":...
136938960_0
class Generator { private static List<Domain> parseProtocol(String protocolFileName) { InputStream resourceStream = Generator.class.getResourceAsStream(protocolFileName); return parseProtocol(resourceStream); } private static ObjectMapper newObjectMapper(); public static void main(String[] args); st...
InputStream resourceStream = getClass().getResourceAsStream("/sample.json"); Generator generator = new Generator(); Domain domain = Domain.builder() .setName("MyDomain") .setDescription("A description.") .setExperimental(true) .setDeprecated(false) .setDependencies(...
[FOCAL] private static List<Domain> Generator.parseProtocol(String protocolFileName) [CLASS] class Generator [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] List<Domain> parseProtocol(InputStream resourceStream) [CALLS-EXTERNAL] Generator.class.getResourceAsStream/1 [INPUTS] branch...
/* static context [FOCAL] private static List<Domain> Generator.parseProtocol(String protocolFileName) [INPUTS] branches=- | result=protocolFileName [CALLS-INTERNAL] List<Domain> parseProtocol(InputStream resourceStream) [CALLS-EXTERNAL] Generator.class.getResourceAsStream/1 */
/* static context [FOCAL] private static List<Domain> Generator.parseProtocol(String protocolFileName) [INPUTS] branches=- | result=protocolFileName [CALLS-INTERNAL] List<Domain> parseProtocol(InputStream resourceStream) [CALLS-EXTERNAL] Generator.class.getResourceAsStream/1 */ class Generator { private static List<...
true
ok
{"focal": {"class": "Generator", "name": "parseProtocol", "signature": "List<Domain> parseProtocol(String protocolFileName)", "start_line": 3, "modifiers": "private static", "params": [{"name": "protocolFileName", "type": "String"}], "return_type": "List<Domain>"}, "class_info": {"name": "Generator", "kind": "class", "...
136978154_0
class UserNotifier { public void notifyUser(String text, int duration, String id){ if(duration == Snackbar.LENGTH_SHORT) duration = 2000; else if (duration == Snackbar.LENGTH_LONG) duration = 3500; displayMessage(text, duration, id); } protected abstract vo...
TestUserNotifier notifier = new TestUserNotifier(); final String []messageText = {"test", "test2", "testtest\ntest"}; final int[] duration = {1000, Snackbar.LENGTH_SHORT, Snackbar.LENGTH_LONG}; final String []id = {"A", "B", "C"}; for (int i=0; i<3; i++){ notifier.n...
[FOCAL] public void UserNotifier.notifyUser(String text, int duration, String id) [CLASS] class UserNotifier [METRICS] loc=8 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=2 [CALLS-INTERNAL] void displayMessage(String text, int duration, String id) [PATH1] if(duration == Snackbar.LENGTH_SHORT)=F -> if(duration == S...
/* static context [FOCAL] public void UserNotifier.notifyUser(String text, int duration, String id) [PATH1] if(duration == Snackbar.LENGTH_SHORT)=F -> if(duration == Snackbar.LENGTH_LONG)=T [PATH2] if(duration == Snackbar.LENGTH_SHORT)=T [PATH3] if(duration == Snackbar.LENGTH_SHORT)=F -> if(duration == Snackbar.LENGTH_...
/* static context [FOCAL] public void UserNotifier.notifyUser(String text, int duration, String id) [PATH1] if(duration == Snackbar.LENGTH_SHORT)=F -> if(duration == Snackbar.LENGTH_LONG)=T [PATH2] if(duration == Snackbar.LENGTH_SHORT)=T [PATH3] if(duration == Snackbar.LENGTH_SHORT)=F -> if(duration == Snackbar.LENGTH_...
true
ok
{"focal": {"class": "UserNotifier", "name": "notifyUser", "signature": "void notifyUser(String text, int duration, String id)", "start_line": 3, "modifiers": "public", "params": [{"name": "text", "type": "String"}, {"name": "duration", "type": "int"}, {"name": "id", "type": "String"}], "return_type": "void"}, "class_in...
137041394_4
class ClassificationPythonModel implements ClassificationMLModel { @Override public int classify(final Instance instance) { // The Python API supports an array of instances and returns an array of results, we need to adapt to a // single result. final String classValue = invokeFunction(...
final Path modelPath = Paths.get(getClass().getResource("/dummy_model").toURI()); final String id = "classificationModel"; final List<FieldSchema> fields = ImmutableList.of(FIELD_SCHEMA, CATEGORICAL_FIELD_SCHEMA); final String illegalTargetValue = "those"; final DatasetSchema sch...
[FOCAL] @Override public int ClassificationPythonModel.classify(Instance instance) [CLASS] class ClassificationPythonModel implements ClassificationMLModel [METRICS] loc=30 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] T invokeFunction(Instance instance, String classificationFunction, String pyt...
/* static context [FOCAL] @Override public int ClassificationPythonModel.classify(Instance instance) [THROWS-WHEN] e when try-body throws [PATH1] try-body throws -> throw e [PATH2] return asNotNullable [INPUTS] branches=- | result=instance [COLLABORATORS] field classToIndexConverter apply/1; field schema getTargetField...
/* static context [FOCAL] @Override public int ClassificationPythonModel.classify(Instance instance) [THROWS-WHEN] e when try-body throws [PATH1] try-body throws -> throw e [PATH2] return asNotNullable [INPUTS] branches=- | result=instance [COLLABORATORS] field classToIndexConverter apply/1; field schema getTargetField...
true
ok
{"focal": {"class": "ClassificationPythonModel", "name": "classify", "signature": "int classify(Instance instance)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "instance", "type": "Instance"}], "return_type": "int"}, "class_info": {"name": "ClassificationPythonModel", "kind": "class", "modifi...
137178358_1
class DataService implements Serializable { public abstract Collection<Category> getAllCategories()public abstract Collection<Category> getAllCategories(); public abstract Collection<Category> getAllCategories()public abstract Collection<Product> getAllProducts(); public abstract Collection<Category> getAllCategories...
assertFalse(service.getAllCategories().isEmpty()); } }
[FOCAL] public abstract Collection<Category> DataService.getAllCategories() [CLASS] class DataService implements Serializable [METRICS] loc=1 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CLASS-MEMBERS] Collection<Product> getAllProducts(); void updateProduct(Product p); void deleteProduct(int productId); Produ...
/* static context [FOCAL] public abstract Collection<Category> DataService.getAllCategories() */
/* static context [FOCAL] public abstract Collection<Category> DataService.getAllCategories() */ class DataService implements Serializable { public abstract Collection<Category> getAllCategories()public abstract Collection<Category> getAllCategories(); public abstract Collection<Category> getAllCategories()public abs...
true
partial
{"focal": {"class": "DataService", "name": "getAllCategories", "signature": "Collection<Category> getAllCategories()", "start_line": 3, "modifiers": "public abstract", "params": [], "return_type": "Collection<Category>"}, "class_info": {"name": "DataService", "kind": "class", "modifiers": "", "superclass": null, "inter...
137437971_1
class StandardVelocityToolsScanner extends AbstractVelocityToolsScanner implements ServletContextAware { @Override protected void scan(String[] sources, Map<String, VelocityTool> velocityToolsMap) { viewToolManager = ViewToolManagerInitializer.getViewToolManager(servletContext); ToolboxFactor...
Map<String, VelocityTool> velocityToolsMap = scanner.scan(); Assert.assertFalse(velocityToolsMap.isEmpty()); } }
[FOCAL] @Override protected void StandardVelocityToolsScanner.scan(String[] sources, Map<String, VelocityTool> velocityToolsMap) [CLASS] class StandardVelocityToolsScanner extends AbstractVelocityToolsScanner implements ServletContextAware [METRICS] loc=14 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXT...
/* static context [FOCAL] @Override protected void StandardVelocityToolsScanner.scan(String[] sources, Map<String, VelocityTool> velocityToolsMap) [COLLABORATORS] field viewToolManager setToolboxFactory/1,configure/1; field factoryConfigurationLoader load/1 [NEW] ToolboxFactoryAdapter [CALLS-EXTERNAL] ViewToolManagerIn...
/* static context [FOCAL] @Override protected void StandardVelocityToolsScanner.scan(String[] sources, Map<String, VelocityTool> velocityToolsMap) [COLLABORATORS] field viewToolManager setToolboxFactory/1,configure/1; field factoryConfigurationLoader load/1 [NEW] ToolboxFactoryAdapter [CALLS-EXTERNAL] ViewToolManagerIn...
true
ok
{"focal": {"class": "StandardVelocityToolsScanner", "name": "scan", "signature": "void scan(String[] sources, Map<String, VelocityTool> velocityToolsMap)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "sources", "type": "String[]"}, {"name": "velocityToolsMap", "type": "Map<String, VelocityT...
137445556_1
class AccountDetailsService implements UserDetailsService { @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { Optional<Account> accountOptional = accountRepository.findByEmail(username); Account account = accountOptional.orElseThrow(() -> new Us...
AccountDetails accountDetails = (AccountDetails) accountDetailsService.loadUserByUsername("user@example.com"); Account account = accountDetails.getAccount(); assertNotNull(account); List<String> authorities = account.getAuthorities(); assertEquals(1, authorities.size()); ...
[FOCAL] @Override public UserDetails AccountDetailsService.loadUserByUsername(String username) [CLASS] class AccountDetailsService implements UserDetailsService [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] accountRepository.findByEmail/1, Optional<Account>.orElseThrow/1 [NEW] Us...
/* static context [FOCAL] @Override public UserDetails AccountDetailsService.loadUserByUsername(String username) [COLLABORATORS] field accountRepository findByEmail/1 [EXCEPTIONS] declares UsernameNotFoundException [NEW] UsernameNotFoundException [CALLS-EXTERNAL] accountRepository.findByEmail/1, Optional<Account>.orEls...
/* static context [FOCAL] @Override public UserDetails AccountDetailsService.loadUserByUsername(String username) [COLLABORATORS] field accountRepository findByEmail/1 [EXCEPTIONS] declares UsernameNotFoundException [NEW] UsernameNotFoundException [CALLS-EXTERNAL] accountRepository.findByEmail/1, Optional<Account>.orEls...
true
ok
{"focal": {"class": "AccountDetailsService", "name": "loadUserByUsername", "signature": "UserDetails loadUserByUsername(String username) throws UsernameNotFoundException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "username", "type": "String"}], "return_type": "UserDetails"}, "class_info": {...
137451403_39
class Service extends com.alibaba.nacos.api.naming.pojo.Service implements Record, RecordListener<Instances> { public String toJson() { return JacksonUtils.toJson(this); } public Service(); public Service(String name); @JsonIgnore public PushService getPushService(); public long get...
String actual = new Service("test-service").toJson(); System.out.println(actual); assertTrue(actual.contains("\"checksum\":\"394c845e1160bb880e7f26fb2149ed6d\"")); assertTrue(actual.contains("\"clusterMap\":{}")); assertTrue(actual.contains("\"empty\":true")); assertTrue(...
[FOCAL] public String Service.toJson() [CLASS] class Service extends com.alibaba.nacos.api.naming.pojo.Service implements Record, RecordListener<Instances> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] JacksonUtils.toJson/1 [CLASS-MEMBERS] Service(); Service(String name); PushSer...
/* static context [FOCAL] public String Service.toJson() [CALLS-EXTERNAL] JacksonUtils.toJson/1 */
/* static context [FOCAL] public String Service.toJson() [CALLS-EXTERNAL] JacksonUtils.toJson/1 */ class Service extends com.alibaba.nacos.api.naming.pojo.Service implements Record, RecordListener<Instances> { public String toJson() { return JacksonUtils.toJson(this); } public Service(); publ...
true
ok
{"focal": {"class": "Service", "name": "toJson", "signature": "String toJson()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "Service", "kind": "class", "modifiers": "", "superclass": "com.alibaba.nacos.api.naming.pojo.Service", "interfaces": "Record, RecordLis...
137528592_190
class BytesSSZReader implements SSZReader { @Override public int readInt(int bitLength) { checkArgument(bitLength % 8 == 0, "bitLength must be a multiple of 8"); int byteLength = bitLength / 8; ensureBytes(byteLength, () -> "SSZ encoded data has insufficient length to read a " + bitLength + "-bit integ...
InvalidSSZTypeException ex = assertThrows(InvalidSSZTypeException.class, () -> { SSZ.decode(fromHexString("1122334455667788"), r -> r.readInt(64)); }); assertEquals("decoded integer is too large for an int", ex.getMessage()); } }
[FOCAL] @Override public int BytesSSZReader.readInt(int bitLength) [CLASS] class BytesSSZReader implements SSZReader [METRICS] loc=13 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] void ensureBytes(int byteLength, Supplier<String> message) [CALLS-EXTERNAL] checkArgument/2 (inherited), content.sli...
/* static context [FOCAL] @Override public int BytesSSZReader.readInt(int bitLength) [THROWS-WHEN] InvalidSSZTypeException when (byteLength - zeroBytes) > 4 [PATH1] if((byteLength - zeroBytes) > 4)=T -> throw new InvalidSSZTypeException("decoded integer is too large for an int") [PATH2] if((byteLength - zeroBytes) > 4)...
/* static context [FOCAL] @Override public int BytesSSZReader.readInt(int bitLength) [THROWS-WHEN] InvalidSSZTypeException when (byteLength - zeroBytes) > 4 [PATH1] if((byteLength - zeroBytes) > 4)=T -> throw new InvalidSSZTypeException("decoded integer is too large for an int") [PATH2] if((byteLength - zeroBytes) > 4)...
true
ok
{"focal": {"class": "BytesSSZReader", "name": "readInt", "signature": "int readInt(int bitLength)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "bitLength", "type": "int"}], "return_type": "int"}, "class_info": {"name": "BytesSSZReader", "kind": "class", "modifiers": "", "superclass": null, "i...
137565180_2
class HitbtcRestService implements ManageOrders, Withdraw, Account { @Override public Optional<OrderDto> get(String id) { try { return getOpenOrderById(id); } catch (HttpClientErrorException ex) { if (ex.getStatusCode() != HttpStatus.BAD_REQUEST) { throw ...
OrderDto expectedOrder = mock(OrderDto.class); when(getOrderDto.mapTo()).thenReturn(expectedOrder); when(restTemplate.exchange( requestCaptor.capture(), eq(HttpMethod.GET), entity.capture(), eq(HitbtcOrderGetDto.class) )).t...
[FOCAL] @Override public Optional<OrderDto> HitbtcRestService.get(String id) [CLASS] class HitbtcRestService implements ManageOrders, Withdraw, Account [METRICS] loc=11 cc=3 branches=1 loops=0 returns=2 throws=1 nesting=2 [CALLS-INTERNAL] Optional<OrderDto> getClosedOrderById(String id); Optional<OrderDto> getOpenOrder...
/* static context [FOCAL] @Override public Optional<OrderDto> HitbtcRestService.get(String id) [THROWS-WHEN] ex when try-body throws && ex.getStatusCode() != HttpStatus.BAD_REQUEST [PATH1] try-body throws -> if(ex.getStatusCode() != HttpStatus.BAD_REQUEST)=T -> throw ex [PATH2] try-body throws -> if(ex.getStatusCode() ...
/* static context [FOCAL] @Override public Optional<OrderDto> HitbtcRestService.get(String id) [THROWS-WHEN] ex when try-body throws && ex.getStatusCode() != HttpStatus.BAD_REQUEST [PATH1] try-body throws -> if(ex.getStatusCode() != HttpStatus.BAD_REQUEST)=T -> throw ex [PATH2] try-body throws -> if(ex.getStatusCode() ...
true
ok
{"focal": {"class": "HitbtcRestService", "name": "get", "signature": "Optional<OrderDto> get(String id)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "id", "type": "String"}], "return_type": "Optional<OrderDto>"}, "class_info": {"name": "HitbtcRestService", "kind": "class", "modifiers": "", "s...
137570946_52
class NewNodeCatchUpTaskGroup { public boolean onReceiveAppendEntriesResult(AppendEntriesResultMessage resultMessage, int nextLogIndex) { NewNodeCatchUpTask task = taskMap.get(resultMessage.getSourceNodeId()); if (task == null) { return false; } task.onReceiveAppendEntri...
NewNodeCatchUpTaskGroup group = new NewNodeCatchUpTaskGroup(); Assert.assertFalse(group.onReceiveAppendEntriesResult( new AppendEntriesResultMessage( new AppendEntriesResult("", 1, true), NodeId.of("A"), new AppendEn...
[FOCAL] public boolean NewNodeCatchUpTaskGroup.onReceiveAppendEntriesResult(AppendEntriesResultMessage resultMessage, int nextLogIndex) [CLASS] class NewNodeCatchUpTaskGroup [METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] taskMap.get/1, AppendEntriesResultMessage.getSourceNodeId/0,...
/* static context [FOCAL] public boolean NewNodeCatchUpTaskGroup.onReceiveAppendEntriesResult(AppendEntriesResultMessage resultMessage, int nextLogIndex) [PATH1] if(task == null)=T -> return false [PATH2] if(task == null)=F -> return true [INPUTS] branches=resultMessage | result=- [COLLABORATORS] field taskMap get/1; p...
/* static context [FOCAL] public boolean NewNodeCatchUpTaskGroup.onReceiveAppendEntriesResult(AppendEntriesResultMessage resultMessage, int nextLogIndex) [PATH1] if(task == null)=T -> return false [PATH2] if(task == null)=F -> return true [INPUTS] branches=resultMessage | result=- [COLLABORATORS] field taskMap get/1; p...
true
ok
{"focal": {"class": "NewNodeCatchUpTaskGroup", "name": "onReceiveAppendEntriesResult", "signature": "boolean onReceiveAppendEntriesResult(AppendEntriesResultMessage resultMessage, int nextLogIndex)", "start_line": 3, "modifiers": "public", "params": [{"name": "resultMessage", "type": "AppendEntriesResultMessage"}, {"na...
137728198_47
class LogicalPlan extends TreeNode implements QueryItemInterface { public Query getQuery() { return query; } public LogicalPlan(String description); public TreeNode getCurrentNode(); public void setCurrentNode(TreeNode currentNode); public void setQuery(Query query); public Creat...
String sql = "select a, b from TRANSACTION t where a = 'hello world' group by c having b > 100"; LogicalPlan plan = getLogicalPlan(sql); LogicalPlan logicalPlan = buildHaving(); assertTrue(logicalPlan.getQuery().equals(plan.getQuery())); } }
[FOCAL] public Query LogicalPlan.getQuery() [CLASS] class LogicalPlan extends TreeNode implements QueryItemInterface [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] LogicalPlan(String description); TreeNode getCurrentNode(); void setCurrentNode(TreeNode currentNode); void setQuery(Q...
/* static context [FOCAL] public Query LogicalPlan.getQuery() */
/* static context [FOCAL] public Query LogicalPlan.getQuery() */ class LogicalPlan extends TreeNode implements QueryItemInterface { public Query getQuery() { return query; } public LogicalPlan(String description); public TreeNode getCurrentNode(); public void setCurrentNode(TreeNode curr...
true
ok
{"focal": {"class": "LogicalPlan", "name": "getQuery", "signature": "Query getQuery()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Query"}, "class_info": {"name": "LogicalPlan", "kind": "class", "modifiers": "", "superclass": "TreeNode", "interfaces": "QueryItemInterface", "fields": [], "memb...
137746205_1
class AddEditTaskLogic { @Nonnull public static Next<AddEditTaskModel, AddEditTaskEffect> update( AddEditTaskModel model, AddEditTaskEvent event) { return event.map( taskDefinitionCompleted -> onTaskDefinitionCompleted(model, taskDefinitionCompleted), taskCreatedSuccessfully -> exitWithSu...
TaskDetails details = TaskDetails.create("T1", "This is a task"); AddEditTaskModel updatingATask = AddEditTaskModel.builder().mode(AddEditTaskMode.update("123")).details(details).build(); TaskDetails updatedDetails = details.toBuilder().title("").description("Hello World").build(); updateSpec ...
[FOCAL] @Nonnull public static Next<AddEditTaskModel, AddEditTaskEffect> AddEditTaskLogic.update(AddEditTaskModel model, AddEditTaskEvent event) [CLASS] class AddEditTaskLogic [METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Next<AddEditTaskModel, AddEditTaskEffect> exitWithFailure...
/* static context [FOCAL] @Nonnull public static Next<AddEditTaskModel, AddEditTaskEffect> AddEditTaskLogic.update(AddEditTaskModel model, AddEditTaskEvent event) [INPUTS] branches=- | result=event, model [COLLABORATORS] param event:AddEditTaskEvent map/5 [CALLS-INTERNAL] Next<AddEditTaskModel, AddEditTaskEffect> exitW...
/* static context [FOCAL] @Nonnull public static Next<AddEditTaskModel, AddEditTaskEffect> AddEditTaskLogic.update(AddEditTaskModel model, AddEditTaskEvent event) [INPUTS] branches=- | result=event, model [COLLABORATORS] param event:AddEditTaskEvent map/5 [CALLS-INTERNAL] Next<AddEditTaskModel, AddEditTaskEffect> exitW...
true
ok
{"focal": {"class": "AddEditTaskLogic", "name": "update", "signature": "Next<AddEditTaskModel, AddEditTaskEffect> update(AddEditTaskModel model, AddEditTaskEvent event)", "start_line": 3, "modifiers": "@Nonnull public static", "params": [{"name": "model", "type": "AddEditTaskModel"}, {"name": "event", "type": "AddEditT...
137762067_28
class JiraTransitionIssueActionHandler implements BentenActionHandler { public BentenHandlerResponse handle(BentenMessage bentenMessage) { String issueKey = BentenMessageHelper.getParameterAsString(bentenMessage,JiraActionParameters.PARAMETER_ISSUE_KEY); String status = BentenMessageHelper.getParam...
String issueKey = TestHelper.createStory(bentenJiraClient); TestHelper.updateAssigneeAndReporter(bentenJiraClient,issueKey); JsonElement status = new JsonPrimitive("Closed"); JsonElement currentuser = new JsonPrimitive(TestHelper.assigneeName); Thread.sleep(500); Bente...
[FOCAL] public BentenHandlerResponse JiraTransitionIssueActionHandler.handle(BentenMessage bentenMessage) [CLASS] class JiraTransitionIssueActionHandler implements BentenActionHandler [METRICS] loc=29 cc=3 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] List<String> possibleTransitonValues(List<Transit...
/* static context [FOCAL] public BentenHandlerResponse JiraTransitionIssueActionHandler.handle(BentenMessage bentenMessage) [PATH1] if(toTransition==null)=F -> try-body throws -> return bentenHandlerResponse [PATH2] if(toTransition==null)=T -> return bentenHandlerResponse [INPUTS] branches=bentenMessage, bentenJiraClie...
/* static context [FOCAL] public BentenHandlerResponse JiraTransitionIssueActionHandler.handle(BentenMessage bentenMessage) [PATH1] if(toTransition==null)=F -> try-body throws -> return bentenHandlerResponse [PATH2] if(toTransition==null)=T -> return bentenHandlerResponse [INPUTS] branches=bentenMessage, bentenJiraClie...
true
ok
{"focal": {"class": "JiraTransitionIssueActionHandler", "name": "handle", "signature": "BentenHandlerResponse handle(BentenMessage bentenMessage)", "start_line": 3, "modifiers": "public", "params": [{"name": "bentenMessage", "type": "BentenMessage"}], "return_type": "BentenHandlerResponse"}, "class_info": {"name": "Jir...
137771260_2
class XMLHashtable extends XMLValue { @Override public String toXml() { final StringBuilder ret = new StringBuilder( "<" + getXMLTag() + " " + getColumnLabel(SIZEIDX) + "=\"" + size + "\" >"); for (int i = 0; i < size; i++) { ret.append(tuples[i].toXml()); } ret.append("</" + getXMLTag() + ">"); ...
try { final Collection v = new Vector(); v.add(new String("a string in vector")); v.add(new Integer(100)); v.add(new Boolean("true")); final Hashtable h = new Hashtable(); final Hashtable subHash = new Hashtable(); h.put(new Integer(1), new String("un")); h.put(new String("deux"), new Integer(...
[FOCAL] @Override public String XMLHashtable.toXml() [CLASS] class XMLHashtable extends XMLValue [METRICS] loc=13 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] getXMLTag/0 (inherited), getColumnLabel/1 (inherited), StringBuilder.append/1, tuples[i].toXml/0, StringBuilder.toString/0 [NEW] StringB...
/* static context [FOCAL] @Override public String XMLHashtable.toXml() [PATH1] for(i < size)=T -> exit loop -> return ret.toString() [PATH2] for(i < size)=F -> return ret.toString() [NEW] StringBuilder [CALLS-EXTERNAL] getXMLTag/0 (inherited), getColumnLabel/1 (inherited), StringBuilder.append/1, tuples[i].toXml/0, Str...
/* static context [FOCAL] @Override public String XMLHashtable.toXml() [PATH1] for(i < size)=T -> exit loop -> return ret.toString() [PATH2] for(i < size)=F -> return ret.toString() [NEW] StringBuilder [CALLS-EXTERNAL] getXMLTag/0 (inherited), getColumnLabel/1 (inherited), StringBuilder.append/1, tuples[i].toXml/0, Str...
true
ok
{"focal": {"class": "XMLHashtable", "name": "toXml", "signature": "String toXml()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "XMLHashtable", "kind": "class", "modifiers": "", "superclass": "XMLValue", "interfaces": null, "fields": [{"name": "logger...
137793178_1
class RunMapImpl implements RunMap { public void reinitialize() { runMapLock.writeLock().lock(); try { for (TestEntry testEntry : runMap.values()) { testEntry.init(); testEntry.reinitTime(); } clearCurrentTestResults(); } f...
AbstractTest test = new MockTest(); runMap.addTest(test); for (int i = 0; i < 100; i++) { runMap.record(createTestResult(test, TestResult.Status.PASSED)); } Assert.assertEquals(100, runMap.getCurrentTestResults().size()); Assert.assertEquals(100, runMap.getRe...
[FOCAL] public void RunMapImpl.reinitialize() [CLASS] class RunMapImpl implements RunMap [METRICS] loc=12 cc=3 branches=0 loops=1 returns=0 throws=0 nesting=2 [CALLS-INTERNAL] void clearCurrentTestResults() [CALLS-EXTERNAL] runMapLock.writeLock().lock/0, runMapLock.writeLock/0, RunMapImpl.values/0, TestEntry.init/0, Te...
/* static context [FOCAL] public void RunMapImpl.reinitialize() [PATH1] foreach(TestEntry testEntry : runMap.values())=T -> exit loop [PATH2] foreach(TestEntry testEntry : runMap.values())=F [PATH3] try-body throws [INPUTS] branches=runMap | result=- [COLLABORATORS] field runMapLock writeLock/0; field runMap:RunMapImpl...
/* static context [FOCAL] public void RunMapImpl.reinitialize() [PATH1] foreach(TestEntry testEntry : runMap.values())=T -> exit loop [PATH2] foreach(TestEntry testEntry : runMap.values())=F [PATH3] try-body throws [INPUTS] branches=runMap | result=- [COLLABORATORS] field runMapLock writeLock/0; field runMap:RunMapImpl...
true
ok
{"focal": {"class": "RunMapImpl", "name": "reinitialize", "signature": "void reinitialize()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "RunMapImpl", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "RunMap", "fields": [{"name": "runMap", "ty...
137794579_2
class Mapper { public String convertDateTime(Date date) { return iso8601DateFormat.format(date); } public Mapper(); public Date convertDateTime(String isodate); TimeZone convertTimeZone(String timeZone); static final String[] ISO_DATETIME_EXAMPLES; } class MapperTest { static final String[] I...
Mapper mapper = new Mapper(); TimeZone timeZone = new SimpleTimeZone(0, "GMT"); GregorianCalendar calendar = new GregorianCalendar(timeZone); calendar.set(Calendar.YEAR, 2015); calendar.set(Calendar.MONTH, 03); calendar.set(Calendar.DATE, 26); calendar.set(Calendar.HOUR_OF_DAY, 1); calen...
[FOCAL] public String Mapper.convertDateTime(Date date) [CLASS] class Mapper [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] iso8601DateFormat.format/1 [INPUTS] branches=- | result=date [COLLABORATORS] field iso8601DateFormat format/1 [DATAFLOW] date@param->L2 [CLASS-MEMBERS] Mappe...
/* static context [FOCAL] public String Mapper.convertDateTime(Date date) [INPUTS] branches=- | result=date [COLLABORATORS] field iso8601DateFormat format/1 [CALLS-EXTERNAL] iso8601DateFormat.format/1 */
/* static context [FOCAL] public String Mapper.convertDateTime(Date date) [INPUTS] branches=- | result=date [COLLABORATORS] field iso8601DateFormat format/1 [CALLS-EXTERNAL] iso8601DateFormat.format/1 */ class Mapper { public String convertDateTime(Date date) { return iso8601DateFormat.format(date); } publi...
true
ok
{"focal": {"class": "Mapper", "name": "convertDateTime", "signature": "String convertDateTime(Date date)", "start_line": 3, "modifiers": "public", "params": [{"name": "date", "type": "Date"}], "return_type": "String"}, "class_info": {"name": "Mapper", "kind": "class", "modifiers": "", "superclass": null, "interfaces": ...
137988099_78
class WXImage extends WXComponent<ImageView> { @Override protected ImageView initComponentHostView(@NonNull Context context) { WXImageView view = new WXImageView(context); view.setScaleType(ScaleType.FIT_XY); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { view.setCropToPadding(tru...
ImageView imageView = mWXImage.initComponentHostView(Robolectric.setupActivity(TestActivity.class)); mWXImage.mHost = imageView; mWXImage.setBackgroundColor("#FFFFFF"); Drawable drawable = mWXImage.getHostView().getBackground(); assertEquals(drawable instanceof BorderDrawable, true); } }
[FOCAL] @Override protected ImageView WXImage.initComponentHostView(Context context) [CLASS] class WXImage extends WXComponent<ImageView> [METRICS] loc=10 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] WXImageView.setScaleType/1, WXImageView.setCropToPadding/1, WXImageView.holdComponent/1 [NEW] W...
/* static context [FOCAL] @Override protected ImageView WXImage.initComponentHostView(Context context) [PATH1] if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)=T -> return view [PATH2] if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)=F -> return view [INPUTS] branches=- | result=context [NEW] WXIm...
/* static context [FOCAL] @Override protected ImageView WXImage.initComponentHostView(Context context) [PATH1] if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)=T -> return view [PATH2] if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)=F -> return view [INPUTS] branches=- | result=context [NEW] WXIm...
true
ok
{"focal": {"class": "WXImage", "name": "initComponentHostView", "signature": "ImageView initComponentHostView(Context context)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "context", "type": "Context"}], "return_type": "ImageView"}, "class_info": {"name": "WXImage", "kind": "class", "modif...
138077755_37
class Range { @Override public Range clone() { return new Range(start.clone(), end.clone()); } public Range(); public void add(LineColumn position); public void add(Range... ranges); public void add(Range range); public boolean contains(LineColumn position); Range range...
assertEquals(range.clone(), range); } }
[FOCAL] @Override public Range Range.clone() [CLASS] class Range [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] start.clone/0, end.clone/0 [NEW] Range [COLLABORATORS] field start clone/0; field end clone/0 [CLASS-MEMBERS] Range(); void add(LineColumn position); void add(Range... r...
/* static context [FOCAL] @Override public Range Range.clone() [COLLABORATORS] field start clone/0; field end clone/0 [NEW] Range [CALLS-EXTERNAL] start.clone/0, end.clone/0 */
/* static context [FOCAL] @Override public Range Range.clone() [COLLABORATORS] field start clone/0; field end clone/0 [NEW] Range [CALLS-EXTERNAL] start.clone/0, end.clone/0 */ class Range { @Override public Range clone() { return new Range(start.clone(), end.clone()); } public Range(); ...
true
ok
{"focal": {"class": "Range", "name": "clone", "signature": "Range clone()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Range"}, "class_info": {"name": "Range", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "range", "type": "Range", "mo...
138123418_32
class Parser { public List<Derivation> parseSyntactic(String input){ List<String> tokens = tokenizer.tokenize(input); List<String> tokensLower = new ArrayList<>(tokens.size()); for(String token: tokens) tokensLower.add(token.toLowerCase()); int N = tokens.size(); ...
Rule r1 = new Rule("$A", "a"); Rule r2 = new Rule("$B", "b"); Rule r3 = new Rule("$C", "$A $B"); Grammar grammar = new Grammar(Arrays.asList(r1, r2, r3), "$C"); Parser p = new Parser(grammar, s -> Arrays.asList(s.split(" ")), Collections.emptyList()); Derivation dc1 = n...
[FOCAL] public List<Derivation> Parser.parseSyntactic(String input) [CLASS] class Parser [METRICS] loc=27 cc=6 branches=1 loops=4 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] void applyAnnotators(Chart chart, List<String> tokens, int start, int end); void applyBinaryRules(Chart chart, int start, int end); void applyLe...
/* static context [FOCAL] public List<Derivation> Parser.parseSyntactic(String input) [PATH1] foreach(String token : tokens)=F -> for(e <= N)=T -> for(s >= 0)=F -> exit loop -> foreach(Derivation d : chart.getDerivations(0, N))=T -> if(grammar.isRoot(d.rule))=T -> exit loop -> return derivations [PATH2] foreach(String ...
/* static context [FOCAL] public List<Derivation> Parser.parseSyntactic(String input) [PATH1] foreach(String token : tokens)=F -> for(e <= N)=T -> for(s >= 0)=F -> exit loop -> foreach(Derivation d : chart.getDerivations(0, N))=T -> if(grammar.isRoot(d.rule))=T -> exit loop -> return derivations [PATH2] foreach(String ...
true
ok
{"focal": {"class": "Parser", "name": "parseSyntactic", "signature": "List<Derivation> parseSyntactic(String input)", "start_line": 3, "modifiers": "public", "params": [{"name": "input", "type": "String"}], "return_type": "List<Derivation>"}, "class_info": {"name": "Parser", "kind": "class", "modifiers": "", "superclas...
138216750_32
class ConnectionParams { public String getTelemetryTopic() { return mTelemetryTopic; } private ConnectionParams( @NonNull String projectId, @NonNull String registryId, @NonNull String deviceId, @NonNull String cloudRegion, @NonNull Strin...
ConnectionParams connectionParams = buildAllParameters(); String expectedTelemetrytopic = "/devices/" + DEVICE_ID + "/events"; assertThat(connectionParams.getTelemetryTopic()).isEqualTo(expectedTelemetrytopic); } }
[FOCAL] public String ConnectionParams.getTelemetryTopic() [CLASS] class ConnectionParams [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] ConnectionParams(String projectId, String registryId, String deviceId, String cloudRegion, String bridgeHostname, int bridgePort, long authTokenL...
/* static context [FOCAL] public String ConnectionParams.getTelemetryTopic() */
/* static context [FOCAL] public String ConnectionParams.getTelemetryTopic() */ class ConnectionParams { public String getTelemetryTopic() { return mTelemetryTopic; } private ConnectionParams( @NonNull String projectId, @NonNull String registryId, @NonNull Stri...
true
ok
{"focal": {"class": "ConnectionParams", "name": "getTelemetryTopic", "signature": "String getTelemetryTopic()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "ConnectionParams", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [...
138269161_17
class AsyncLoadBalancingTcpClient extends AbstractLoadBalancerAwareClient<TcpRequest, AsyncTcpResponse> { @Override public RequestSpecificRetryHandler getRequestSpecificRetryHandler(TcpRequest request, IClientConfig requestConfig) { if (!request.isRetriable()) { return new RequestSpecificR...
TcpRequest request = new TcpRequest.Builder(new URI("http://127.0.0.1"), null, true).build(); AsyncLoadBalancingTcpClient client = new AsyncLoadBalancingTcpClient(); RequestSpecificRetryHandler handler = client.getRequestSpecificRetryHandler(request, null); assertTrue(handler.isRetriabl...
[FOCAL] @Override public RequestSpecificRetryHandler AsyncLoadBalancingTcpClient.getRequestSpecificRetryHandler(TcpRequest request, IClientConfig requestConfig) [CLASS] class AsyncLoadBalancingTcpClient extends AbstractLoadBalancerAwareClient<TcpRequest, AsyncTcpResponse> [METRICS] loc=13 cc=3 branches=2 loops=0 return...
/* static context [FOCAL] @Override public RequestSpecificRetryHandler AsyncLoadBalancingTcpClient.getRequestSpecificRetryHandler(TcpRequest request, IClientConfig requestConfig) [PATH1] if(!request.isRetriable())=F -> if(this.icc != null && this.icc.get(CommonClientConfigKey.OkToRetryOnAllOperations, false))=T -> retu...
/* static context [FOCAL] @Override public RequestSpecificRetryHandler AsyncLoadBalancingTcpClient.getRequestSpecificRetryHandler(TcpRequest request, IClientConfig requestConfig) [PATH1] if(!request.isRetriable())=F -> if(this.icc != null && this.icc.get(CommonClientConfigKey.OkToRetryOnAllOperations, false))=T -> retu...
true
ok
{"focal": {"class": "AsyncLoadBalancingTcpClient", "name": "getRequestSpecificRetryHandler", "signature": "RequestSpecificRetryHandler getRequestSpecificRetryHandler(TcpRequest request, IClientConfig requestConfig)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "TcpRequest"},...
138315669_64
class XMLScanner implements Scanner { public static Scanner createScanner(String input) { return createScanner(input, false); } public XMLScanner(String input, int initialOffset, ScannerState initialState, boolean isDTDFile); boolean hasNextElementName(); boolean hasNextAttributeName(); boolean hasNextAt...
scanner = XMLScanner.createScanner("<a</a>"); assertOffsetAndToken(0, TokenType.StartTagOpen); assertOffsetAndToken(1, TokenType.StartTag); assertOffsetAndToken(2, TokenType.EndTagOpen); assertOffsetAndToken(4, TokenType.EndTag); assertOffsetAndToken(5, TokenType.EndTagClose); } }
[FOCAL] public static Scanner XMLScanner.createScanner(String input) [CLASS] class XMLScanner implements Scanner [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Scanner createScanner(String input, boolean isDTD) [INPUTS] branches=- | result=input [DATAFLOW] input@param->L2 [CLASS-M...
/* static context [FOCAL] public static Scanner XMLScanner.createScanner(String input) [INPUTS] branches=- | result=input [CALLS-INTERNAL] Scanner createScanner(String input, boolean isDTD) */
/* static context [FOCAL] public static Scanner XMLScanner.createScanner(String input) [INPUTS] branches=- | result=input [CALLS-INTERNAL] Scanner createScanner(String input, boolean isDTD) */ class XMLScanner implements Scanner { public static Scanner createScanner(String input) { return createScanner(input, false...
true
ok
{"focal": {"class": "XMLScanner", "name": "createScanner", "signature": "Scanner createScanner(String input)", "start_line": 3, "modifiers": "public static", "params": [{"name": "input", "type": "String"}], "return_type": "Scanner"}, "class_info": {"name": "XMLScanner", "kind": "class", "modifiers": "", "superclass": n...
138608373_5
class IAMReader extends IAMStream { public JSONObject read(IAMIndex index) { return readFromSelection(index, null); } public IAMReader(String id); public JSONObject readFromSelection(IAMIndex index, List<Transaction> selection); public String getID(); private JSONObject findConsensus...
JSONObject message1 = new JSONObject().put("planet", "mars"); JSONObject message2 = new JSONObject().put("planet", "venus"); iamWriter.write(new IAMIndex(100), message1); assertNotNull(iamReader.read(new IAMIndex(100))); iamWriter.write(new IAMIndex(100), message1); ass...
[FOCAL] public JSONObject IAMReader.read(IAMIndex index) [CLASS] class IAMReader extends IAMStream [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] JSONObject readFromSelection(IAMIndex index, List<Transaction> selection) [INPUTS] branches=- | result=index [DATAFLOW] index@param->L2...
/* static context [FOCAL] public JSONObject IAMReader.read(IAMIndex index) [INPUTS] branches=- | result=index [CALLS-INTERNAL] JSONObject readFromSelection(IAMIndex index, List<Transaction> selection) */
/* static context [FOCAL] public JSONObject IAMReader.read(IAMIndex index) [INPUTS] branches=- | result=index [CALLS-INTERNAL] JSONObject readFromSelection(IAMIndex index, List<Transaction> selection) */ class IAMReader extends IAMStream { public JSONObject read(IAMIndex index) { return readFromSelection(i...
true
ok
{"focal": {"class": "IAMReader", "name": "read", "signature": "JSONObject read(IAMIndex index)", "start_line": 3, "modifiers": "public", "params": [{"name": "index", "type": "IAMIndex"}], "return_type": "JSONObject"}, "class_info": {"name": "IAMReader", "kind": "class", "modifiers": "", "superclass": "IAMStream", "inte...
138623536_35
class CreateGroupOperation implements PostOperation { @Override public void run(SlingHttpServletRequest request, PostResponse response, SlingPostProcessor[] processors) { final List<Modification> changes = new ArrayList<>(); try { String name = request.getParameter(SlingPostConstan...
CreateGroupOperation createGroupOperation = new CreateGroupOperation(); PostResponse response = new JSONResponse(); context.currentResource("/home/users"); context.request().setParameterMap( ImmutableMap.<String, Object>builder().put(SlingPostConstants.RP_NODE_NAME, "tes...
[FOCAL] @Override public void CreateGroupOperation.run(SlingHttpServletRequest request, PostResponse response, SlingPostProcessor[] processors) [CLASS] class CreateGroupOperation implements PostOperation [METRICS] loc=33 cc=5 branches=2 loops=1 returns=0 throws=1 nesting=3 [CALLS-EXTERNAL] SlingHttpServletRequest.getPa...
/* static context [FOCAL] @Override public void CreateGroupOperation.run(SlingHttpServletRequest request, PostResponse response, SlingPostProcessor[] processors) [THROWS-WHEN] RepositoryException when userManager.getAuthorizable(new SimplePrincipal(name)) != null [PATH1] if(userManager.getAuthorizable(new SimplePrincip...
/* static context [FOCAL] @Override public void CreateGroupOperation.run(SlingHttpServletRequest request, PostResponse response, SlingPostProcessor[] processors) [THROWS-WHEN] RepositoryException when userManager.getAuthorizable(new SimplePrincipal(name)) != null [PATH1] if(userManager.getAuthorizable(new SimplePrincip...
true
ok
{"focal": {"class": "CreateGroupOperation", "name": "run", "signature": "void run(SlingHttpServletRequest request, PostResponse response, SlingPostProcessor[] processors)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "SlingHttpServletRequest"}, {"name": "response", "type": "...
138890589_49
class RowSpecGrouper { public static Set<FieldSpecGroup> createGroups(RowSpec rowSpec) { List<FieldPair> pairs = rowSpec.getRelations().stream() .map(relation -> new FieldPair(relation.main(), relation.other())) .collect(Collectors.toList()); return findGroups(rowSpec.getFi...
Field first = createField("first"); Field second = createField("second"); Fields fields = new ProfileFields(Arrays.asList(first, second)); Map<Field, FieldSpec> fieldSpecMap = fieldSpecMapOf(first, second); FieldSpecRelation relation = link(first, second); List<FieldSpe...
[FOCAL] public static Set<FieldSpecGroup> RowSpecGrouper.createGroups(RowSpec rowSpec) [CLASS] class RowSpecGrouper [METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] FieldSpecGroup createFieldSpecGroups(List<Field> fields, RowSpec rowSpec); Set<FieldGroup> findGroups(List<Field> fiel...
/* static context [FOCAL] public static Set<FieldSpecGroup> RowSpecGrouper.createGroups(RowSpec rowSpec) [INPUTS] branches=- | result=rowSpec [COLLABORATORS] param rowSpec:RowSpec getRelations/0,getFields/0; field relation main/0,other/0; field fs fields/0 [CALLS-INTERNAL] FieldSpecGroup createFieldSpecGroups(List<Fiel...
/* static context [FOCAL] public static Set<FieldSpecGroup> RowSpecGrouper.createGroups(RowSpec rowSpec) [INPUTS] branches=- | result=rowSpec [COLLABORATORS] param rowSpec:RowSpec getRelations/0,getFields/0; field relation main/0,other/0; field fs fields/0 [CALLS-INTERNAL] FieldSpecGroup createFieldSpecGroups(List<Fiel...
true
ok
{"focal": {"class": "RowSpecGrouper", "name": "createGroups", "signature": "Set<FieldSpecGroup> createGroups(RowSpec rowSpec)", "start_line": 3, "modifiers": "public static", "params": [{"name": "rowSpec", "type": "RowSpec"}], "return_type": "Set<FieldSpecGroup>"}, "class_info": {"name": "RowSpecGrouper", "kind": "clas...
138907954_6
class ParamUtils { public static <T> T nonNull(final T object, final Supplier<String> message) { if (object != null) { return object; } throw new IllegalArgumentException(message.get()); } private ParamUtils(); public static void validate(final boolean condition, ...
final String myString = "hello world"; final String returned = ParamUtils.nonNull(myString, () -> "Should not throw"); Assert.assertSame(returned, myString); } }
[FOCAL] public static T ParamUtils.nonNull(T object, Supplier<String> message) [CLASS] class ParamUtils [METRICS] loc=6 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] Supplier<String>.get/0 [NEW] IllegalArgumentException [EXCEPTIONS] throws IllegalArgumentException [THROWS-WHEN] IllegalArgumentEx...
/* static context [FOCAL] public static T ParamUtils.nonNull(T object, Supplier<String> message) [THROWS-WHEN] IllegalArgumentException when !(object != null) [PATH1] if(object != null)=T -> return object [PATH2] if(object != null)=F -> throw new IllegalArgumentException(message.get()) [INPUTS] branches=object | result...
/* static context [FOCAL] public static T ParamUtils.nonNull(T object, Supplier<String> message) [THROWS-WHEN] IllegalArgumentException when !(object != null) [PATH1] if(object != null)=T -> return object [PATH2] if(object != null)=F -> throw new IllegalArgumentException(message.get()) [INPUTS] branches=object | result...
true
ok
{"focal": {"class": "ParamUtils", "name": "nonNull", "signature": "T nonNull(T object, Supplier<String> message)", "start_line": 3, "modifiers": "public static", "params": [{"name": "object", "type": "T"}, {"name": "message", "type": "Supplier<String>"}], "return_type": "T"}, "class_info": {"name": "ParamUtils", "kind"...
138952078_0
class Dot { public static <ID> Dot<ID> dot(Graph<ID> graph) { return new Dot<>(graph); } private Dot(Graph<ID> graph); public String getType(); public void setType(String type); public Dot type(String type); public void write(Writer writer); private void writeGraphAttributes(...
NullPointerException thrown = assertThrows(NullPointerException.class, () -> dot(null)); assertThat(thrown).hasMessageThat().isEqualTo("graph must not be null."); } }
[FOCAL] public static Dot<ID> Dot.dot(Graph<ID> graph) [CLASS] class Dot [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] Dot<> [INPUTS] branches=- | result=graph [DATAFLOW] graph@param->L2 [CLASS-MEMBERS] Dot(Graph<ID> graph); String getType(); void setType(String type); Dot type(String type)...
/* static context [FOCAL] public static Dot<ID> Dot.dot(Graph<ID> graph) [INPUTS] branches=- | result=graph [NEW] Dot<> */
/* static context [FOCAL] public static Dot<ID> Dot.dot(Graph<ID> graph) [INPUTS] branches=- | result=graph [NEW] Dot<> */ class Dot { public static <ID> Dot<ID> dot(Graph<ID> graph) { return new Dot<>(graph); } private Dot(Graph<ID> graph); public String getType(); public void setType(S...
true
ok
{"focal": {"class": "Dot", "name": "dot", "signature": "Dot<ID> dot(Graph<ID> graph)", "start_line": 3, "modifiers": "public static", "params": [{"name": "graph", "type": "Graph<ID>"}], "return_type": "Dot<ID>"}, "class_info": {"name": "Dot", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fi...
138967647_1
class UserEventHandler { @QueryHandler public UserView find(UserByIdQuery query) { String userId = query.getUserId().getIdentifier(); return Optional.ofNullable(userRepository.findByIdentifier(userId)) .orElseGet(() -> { logger.warn("Tried to re...
UserView testView = buildTestView(); when(userViewRepository.findByIdentifier(testUserId.getIdentifier())).thenReturn(testView); UserView result = testSubject.find(new UserByIdQuery(testUserId)); assertEquals(testView, result); } }
[FOCAL] @QueryHandler public UserView UserEventHandler.find(UserByIdQuery query) [CLASS] class UserEventHandler [METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] query.getUserId().getIdentifier/0, UserByIdQuery.getUserId/0, Optional.ofNullable(userRepository.findByIdentifier(userId)...
/* static context [FOCAL] @QueryHandler public UserView UserEventHandler.find(UserByIdQuery query) [INPUTS] branches=- | result=query [COLLABORATORS] param query:UserByIdQuery getUserId/0; field userRepository findByIdentifier/1 [CALLS-EXTERNAL] query.getUserId().getIdentifier/0, UserByIdQuery.getUserId/0, Optional.ofN...
/* static context [FOCAL] @QueryHandler public UserView UserEventHandler.find(UserByIdQuery query) [INPUTS] branches=- | result=query [COLLABORATORS] param query:UserByIdQuery getUserId/0; field userRepository findByIdentifier/1 [CALLS-EXTERNAL] query.getUserId().getIdentifier/0, UserByIdQuery.getUserId/0, Optional.ofN...
true
ok
{"focal": {"class": "UserEventHandler", "name": "find", "signature": "UserView find(UserByIdQuery query)", "start_line": 3, "modifiers": "@QueryHandler public", "params": [{"name": "query", "type": "UserByIdQuery"}], "return_type": "UserView"}, "class_info": {"name": "UserEventHandler", "kind": "class", "modifiers": ""...
139051087_2
class MySQLIntervalLock extends JdbcIntervalLock { @Override protected String buildTryLockSql(TableConfig tableConfig) { return new StringBuilder() .append("INSERT INTO ") .append(getSafeName(tableConfig.getSchema())) .append(".") .append(getSafeName(tableConfig.getTable())) ...
MySQLIntervalLock mySQLIntervalLock = new MySQLIntervalLock(dataSource); String tryLockSQL = mySQLIntervalLock.buildTryLockSql(new TableConfig()); assertEquals( "INSERT INTO `public`.`lock` (`name`, `owner`, `locked_at`, `locked_till`)\n" + "SELECT :name, :owner, CURRENT_TIMESTAMP(), CUR...
[FOCAL] @Override protected String MySQLIntervalLock.buildTryLockSql(TableConfig tableConfig) [CLASS] class MySQLIntervalLock extends JdbcIntervalLock [METRICS] loc=33 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String getSafeName(String name); String getValueName(String name) [CALLS-EXTERNAL]...
/* static context [FOCAL] @Override protected String MySQLIntervalLock.buildTryLockSql(TableConfig tableConfig) [INPUTS] branches=- | result=tableConfig [COLLABORATORS] param tableConfig:TableConfig getSchema/0,getTable/0,getName/0,getOwner/0,getAt/0,getTill/0 [CALLS-INTERNAL] String getSafeName(String name); String ge...
/* static context [FOCAL] @Override protected String MySQLIntervalLock.buildTryLockSql(TableConfig tableConfig) [INPUTS] branches=- | result=tableConfig [COLLABORATORS] param tableConfig:TableConfig getSchema/0,getTable/0,getName/0,getOwner/0,getAt/0,getTill/0 [CALLS-INTERNAL] String getSafeName(String name); String ge...
true
ok
{"focal": {"class": "MySQLIntervalLock", "name": "buildTryLockSql", "signature": "String buildTryLockSql(TableConfig tableConfig)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "tableConfig", "type": "TableConfig"}], "return_type": "String"}, "class_info": {"name": "MySQLIntervalLock", "kind...
139242712_9
class Locale { public String message(String s, Object... objects) { return messageSource.getMessage(s, objects, nativeLocale); } @Autowired public Locale(@Value("#{localeCodeSource.code}") String code, MessageSource messageSource); public String message(String s); } class LocaleTest { ...
String testedString = "Some string {change}"; MessageSource mock = mock(MessageSource.class); Locale locale = new Locale("ru", mock); locale.message(testedString); verify(mock, times(1)).getMessage(eq(testedString), eq(new Object[0]), any()); } }
[FOCAL] public String Locale.message(String s, Object... objects) [CLASS] class Locale [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] messageSource.getMessage/3 [INPUTS] branches=- | result=objects, s [COLLABORATORS] field messageSource getMessage/3 [DATAFLOW] objects@param->L2; s...
/* static context [FOCAL] public String Locale.message(String s, Object... objects) [INPUTS] branches=- | result=objects, s [COLLABORATORS] field messageSource getMessage/3 [CALLS-EXTERNAL] messageSource.getMessage/3 */
/* static context [FOCAL] public String Locale.message(String s, Object... objects) [INPUTS] branches=- | result=objects, s [COLLABORATORS] field messageSource getMessage/3 [CALLS-EXTERNAL] messageSource.getMessage/3 */ class Locale { public String message(String s, Object... objects) { return messageSourc...
true
ok
{"focal": {"class": "Locale", "name": "message", "signature": "String message(String s, Object... objects)", "start_line": 3, "modifiers": "public", "params": [{"name": "s", "type": "String"}, {"name": "objects", "type": "Object..."}], "return_type": "String"}, "class_info": {"name": "Locale", "kind": "class", "modifie...
139299365_25
class TermFrequencySearcher { private long getFrequency(NGramField field) throws IOException { return getFrequency(field, null); } public TermFrequencySearcher(SolrQueryRequest request); public FrequencyMap getFrequencyHashMap(TokenizedString tokens, FrequencyMap map); public Freq...
setUpRequestMock(); setUpFrequencyMocks(NGramField.bigrams, "underwater basketweaver", 1L); TermFrequencySearcher target = new TermFrequencySearcher(mockedRequest); Long actual = Deencapsulation.invoke(target,"getFrequency", NGramField.bigrams, "underwater basketweaver"); Long ex...
[FOCAL] private long TermFrequencySearcher.getFrequency(NGramField field) [CLASS] class TermFrequencySearcher [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] long getFrequency(NGramField field, String q) [EXCEPTIONS] declares IOException [INPUTS] branches=- | result=field [DATAFLOW...
/* static context [FOCAL] private long TermFrequencySearcher.getFrequency(NGramField field) [INPUTS] branches=- | result=field [EXCEPTIONS] declares IOException [CALLS-INTERNAL] long getFrequency(NGramField field, String q) */
/* static context [FOCAL] private long TermFrequencySearcher.getFrequency(NGramField field) [INPUTS] branches=- | result=field [EXCEPTIONS] declares IOException [CALLS-INTERNAL] long getFrequency(NGramField field, String q) */ class TermFrequencySearcher { private long getFrequency(NGramField field) throws IOExcep...
true
ok
{"focal": {"class": "TermFrequencySearcher", "name": "getFrequency", "signature": "long getFrequency(NGramField field) throws IOException", "start_line": 3, "modifiers": "private", "params": [{"name": "field", "type": "NGramField"}], "return_type": "long"}, "class_info": {"name": "TermFrequencySearcher", "kind": "class...
139344139_1
class NumarComplex { public NumarComplex add(NumarComplex z) { this.setReal(this.real + z.getReal()); this.setImg(this.img + z.getImg()); return this; } public NumarComplex(); public NumarComplex(String nr); public double getImg(); public void setImg(double img);...
NumarComplex nr=new NumarComplex("3+i"); nr.add(new NumarComplex("i")); assertEquals(new NumarComplex("3.0+2.0i"), nr); } }
[FOCAL] public NumarComplex NumarComplex.add(NumarComplex z) [CLASS] class NumarComplex [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] void setImg(double img); void setReal(double real) [CALLS-EXTERNAL] NumarComplex.getReal/0, NumarComplex.getImg/0 [FIELDS] read=img, real [COLLABO...
/* static context [FOCAL] public NumarComplex NumarComplex.add(NumarComplex z) [COLLABORATORS] param z:NumarComplex getReal/0,getImg/0 [CALLS-INTERNAL] void setImg(double img); void setReal(double real) [FIELDS] read=img, real [CALLS-EXTERNAL] NumarComplex.getReal/0, NumarComplex.getImg/0 */
/* static context [FOCAL] public NumarComplex NumarComplex.add(NumarComplex z) [COLLABORATORS] param z:NumarComplex getReal/0,getImg/0 [CALLS-INTERNAL] void setImg(double img); void setReal(double real) [FIELDS] read=img, real [CALLS-EXTERNAL] NumarComplex.getReal/0, NumarComplex.getImg/0 */ class NumarComplex { p...
true
ok
{"focal": {"class": "NumarComplex", "name": "add", "signature": "NumarComplex add(NumarComplex z)", "start_line": 3, "modifiers": "public", "params": [{"name": "z", "type": "NumarComplex"}], "return_type": "NumarComplex"}, "class_info": {"name": "NumarComplex", "kind": "class", "modifiers": "", "superclass": null, "int...
139520942_65
class TypeDecoder { static Utf8String decodeUtf8String(String input, int offset) { DynamicBytes dynamicBytesResult = decodeDynamicBytes(input, offset); byte[] bytes = dynamicBytesResult.getValue(); return new Utf8String(new String(bytes, StandardCharsets.UTF_8)); } static int getS...
assertThat(TypeDecoder.decodeUtf8String( "000000000000000000000000000000000000000000000000000000000000000d" // length + "48656c6c6f2c20776f726c642100000000000000000000000000000000000000", 0), CoreMatchers.is(new Utf8String("Hello, world!"))); } }
[FOCAL] static Utf8String TypeDecoder.decodeUtf8String(String input, int offset) [CLASS] class TypeDecoder [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] DynamicBytes decodeDynamicBytes(String input, int offset) [CALLS-EXTERNAL] DynamicBytes.getValue/0 [NEW] Utf8String, String [IN...
/* static context [FOCAL] static Utf8String TypeDecoder.decodeUtf8String(String input, int offset) [INPUTS] branches=- | result=input, offset [CALLS-INTERNAL] DynamicBytes decodeDynamicBytes(String input, int offset) [NEW] Utf8String, String [CALLS-EXTERNAL] DynamicBytes.getValue/0 */
/* static context [FOCAL] static Utf8String TypeDecoder.decodeUtf8String(String input, int offset) [INPUTS] branches=- | result=input, offset [CALLS-INTERNAL] DynamicBytes decodeDynamicBytes(String input, int offset) [NEW] Utf8String, String [CALLS-EXTERNAL] DynamicBytes.getValue/0 */ class TypeDecoder { static Ut...
true
ok
{"focal": {"class": "TypeDecoder", "name": "decodeUtf8String", "signature": "Utf8String decodeUtf8String(String input, int offset)", "start_line": 3, "modifiers": "static", "params": [{"name": "input", "type": "String"}, {"name": "offset", "type": "int"}], "return_type": "Utf8String"}, "class_info": {"name": "TypeDecod...
139621153_94
class Vector2 extends AVector2 { public static Vector2 fromXY(final double x, final double y) { return new Vector2(x, y); } protected Vector2(); protected Vector2(final double x, final double y); protected Vector2(final IVector original); public static Vector2 zero(); public static Vector2 fromX(final d...
Vector2 vec1 = Vector2.fromXY(1, 3); Vector2 vec2 = Vector2.fromXY(-4, 2); double result = vec1.scalarProduct(vec2); assertEquals(2f, result, ACCURACY); vec1 = Vector2.fromXY(1, 3); vec2 = Vector2.fromXY(0, 0); result = vec1.scalarProduct(vec2); assertEquals(0f, result, ACCURACY); vec1 = Vector2...
[FOCAL] public static Vector2 Vector2.fromXY(double x, double y) [CLASS] class Vector2 extends AVector2 [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] Vector2 [INPUTS] branches=- | result=x, y [DATAFLOW] x@param->L3; y@param->L3 [CLASS-MEMBERS] Vector2(); Vector2(double x, double y); Vector2...
/* static context [FOCAL] public static Vector2 Vector2.fromXY(double x, double y) [INPUTS] branches=- | result=x, y [NEW] Vector2 */
/* static context [FOCAL] public static Vector2 Vector2.fromXY(double x, double y) [INPUTS] branches=- | result=x, y [NEW] Vector2 */ class Vector2 extends AVector2 { public static Vector2 fromXY(final double x, final double y) { return new Vector2(x, y); } protected Vector2(); protected Vector2(final double...
true
ok
{"focal": {"class": "Vector2", "name": "fromXY", "signature": "Vector2 fromXY(double x, double y)", "start_line": 3, "modifiers": "public static", "params": [{"name": "x", "type": "double"}, {"name": "y", "type": "double"}], "return_type": "Vector2"}, "class_info": {"name": "Vector2", "kind": "class", "modifiers": "", ...
139879729_5
class DistanceCalculator { public double getDistance( double latitude1, double longitude1, double latitude2, double longitude2) { double latitudeDifference = Math.toRadians(latitude2 - latitude1); double longitudeDifference = Math.toRadians(longitude2 - longitude1); latitude1 = Math.toRadians(latitude1); ...
Assert.assertEquals( 69.382, _distanceCalculator.getDistance( _LATITUDE, _LONGITUDE, 34.045886, -118.564861), _DELTA); Assert.assertEquals( 9070.629, _distanceCalculator.getDistance( _LATITUDE, _LONGITUDE, 48.856614, 2.352222), _DELTA); } }
[FOCAL] public double DistanceCalculator.getDistance(double latitude1, double longitude1, double latitude2, double longitude2) [CLASS] class DistanceCalculator [METRICS] loc=19 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Math.toRadians/1, Math.pow/2, Math.sin/1, Math.cos/1, Math.asin/1, Math.s...
/* static context [FOCAL] public double DistanceCalculator.getDistance(double latitude1, double longitude1, double latitude2, double longitude2) [INPUTS] branches=- | result=latitude1, latitude2, longitude1, longitude2 [CALLS-EXTERNAL] Math.toRadians/1, Math.pow/2, Math.sin/1, Math.cos/1, Math.asin/1, Math.sqrt/1 */
/* static context [FOCAL] public double DistanceCalculator.getDistance(double latitude1, double longitude1, double latitude2, double longitude2) [INPUTS] branches=- | result=latitude1, latitude2, longitude1, longitude2 [CALLS-EXTERNAL] Math.toRadians/1, Math.pow/2, Math.sin/1, Math.cos/1, Math.asin/1, Math.sqrt/1 */ cl...
true
ok
{"focal": {"class": "DistanceCalculator", "name": "getDistance", "signature": "double getDistance(double latitude1, double longitude1, double latitude2, double longitude2)", "start_line": 3, "modifiers": "public", "params": [{"name": "latitude1", "type": "double"}, {"name": "longitude1", "type": "double"}, {"name": "la...
139898859_32
class CLIParser { public static Arg parse(String[] inputArgs) { Options options = setupOptions(); CommandLineParser parser = new DefaultParser(); Arg argument = new Arg(); try { CommandLine commandLine = parser.parse(options, inputArgs); if (commandLine.has...
Arg parsedArg = CLIParser.parse(asArgArray("'" + defaultPw + "' -" + CLIParser.ARG_HASH + " 6")); Arg expectedArg = new Arg(defaultPw.toCharArray(), null, 6); assertEquals(expectedArg, parsedArg); } }
[FOCAL] public static Arg CLIParser.parse(String[] inputArgs) [CLASS] class CLIParser [METRICS] loc=41 cc=7 branches=5 loops=0 returns=5 throws=1 nesting=3 [CALLS-INTERNAL] Arg handleCheck(CommandLine commandLine, char[] password); Arg handleHash(CommandLine commandLine, char[] password); Options setupOptions(); void p...
/* static context [FOCAL] public static Arg CLIParser.parse(String[] inputArgs) [PATH1] if(commandLine.hasOption("h") || commandLine.hasOption("help"))=F -> if(commandLine.hasOption("v") || commandLine.hasOption("version"))=F -> if(commandLine.getArgs().length <= 0)=F -> if(commandLine.hasOption(ARG_HASH))=F -> if(comm...
/* static context [FOCAL] public static Arg CLIParser.parse(String[] inputArgs) [PATH1] if(commandLine.hasOption("h") || commandLine.hasOption("help"))=F -> if(commandLine.hasOption("v") || commandLine.hasOption("version"))=F -> if(commandLine.getArgs().length <= 0)=F -> if(commandLine.hasOption(ARG_HASH))=F -> if(comm...
true
ok
{"focal": {"class": "CLIParser", "name": "parse", "signature": "Arg parse(String[] inputArgs)", "start_line": 3, "modifiers": "public static", "params": [{"name": "inputArgs", "type": "String[]"}], "return_type": "Arg"}, "class_info": {"name": "CLIParser", "kind": "class", "modifiers": "", "superclass": null, "interfac...
139914932_102
class KafkaStreamsTopicsHealthCheck implements HealthCheck { @Override public HealthCheckResponse call() { HealthCheckResponseBuilder builder = HealthCheckResponse.named("Kafka Streams topics health check").up(); try { Set<String> missingTopics = manager.getMissingTopics(trimmedTop...
Mockito.when(manager.getMissingTopics(anyList())).thenReturn(Collections.emptySet()); HealthCheckResponse response = healthCheck.call(); assertThat(response.getState()).isEqualTo(HealthCheckResponse.State.UP); } }
[FOCAL] @Override public HealthCheckResponse KafkaStreamsTopicsHealthCheck.call() [CLASS] class KafkaStreamsTopicsHealthCheck implements HealthCheck [METRICS] loc=22 cc=4 branches=2 loops=0 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] HealthCheckResponse.named("Kafka Streams topics health ch....up/0, HealthCheckRespon...
/* static context [FOCAL] @Override public HealthCheckResponse KafkaStreamsTopicsHealthCheck.call() [PATH1] if(!availableTopics.isEmpty())=T -> if(!missingTopics.isEmpty())=T -> return builder.build() [PATH2] if(!availableTopics.isEmpty())=F -> if(!missingTopics.isEmpty())=F -> return builder.build() [PATH3] try-body t...
/* static context [FOCAL] @Override public HealthCheckResponse KafkaStreamsTopicsHealthCheck.call() [PATH1] if(!availableTopics.isEmpty())=T -> if(!missingTopics.isEmpty())=T -> return builder.build() [PATH2] if(!availableTopics.isEmpty())=F -> if(!missingTopics.isEmpty())=F -> return builder.build() [PATH3] try-body t...
true
ok
{"focal": {"class": "KafkaStreamsTopicsHealthCheck", "name": "call", "signature": "HealthCheckResponse call()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "HealthCheckResponse"}, "class_info": {"name": "KafkaStreamsTopicsHealthCheck", "kind": "class", "modifiers": "", "superclass": n...
139927346_48
class MapUtil { public static <K, V> HashMap<K, V> newHashMap() { return new HashMap<K, V>(); } public static boolean isEmpty(final Map<?, ?> map); public static boolean isNotEmpty(final Map<?, ?> map); public static V putIfAbsentReturnLast(@NotNull final ConcurrentMap<K, V> map, final K key, final V value); ...
try { HashMap<String, Integer> map4 = MapUtil.newHashMap(new String[] { "1", "2" }, new Integer[] { 1 }); fail("should fail here"); } catch (Exception e) { assertThat(e).isInstanceOf(IllegalArgumentException.class); assertThat(e).hasMessage("keys.length is 2 but values.length is 1"); } } }
[FOCAL] public static HashMap<K, V> MapUtil.newHashMap() [CLASS] class MapUtil [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] HashMap<K, V> [CLASS-MEMBERS] boolean isEmpty(Map<?, ?> map); boolean isNotEmpty(Map<?, ?> map); V putIfAbsentReturnLast(ConcurrentMap<K, V> map, K key, V value); V c...
/* static context [FOCAL] public static HashMap<K, V> MapUtil.newHashMap() [NEW] HashMap<K, V> */
/* static context [FOCAL] public static HashMap<K, V> MapUtil.newHashMap() [NEW] HashMap<K, V> */ class MapUtil { public static <K, V> HashMap<K, V> newHashMap() { return new HashMap<K, V>(); } public static boolean isEmpty(final Map<?, ?> map); public static boolean isNotEmpty(final Map<?, ?> map); public sta...
true
ok
{"focal": {"class": "MapUtil", "name": "newHashMap", "signature": "HashMap<K, V> newHashMap()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "HashMap<K, V>"}, "class_info": {"name": "MapUtil", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members...
139940514_67
class WxPayOrderNotifyResult extends BaseWxPayResult { public static WxPayOrderNotifyResult fromXML(String xmlString) { XStream xstream = XStreamInitializer.getInstance(); xstream.processAnnotations(WxPayOrderNotifyResult.class); xstream.registerConverter(new WxPayOrderNotifyResultConverter(xstream.getMa...
String xmlString = "<xml>\n" + " <appid><![CDATA[wx2421b1c4370ec43b]]></appid>\n" + " <attach><![CDATA[支付测试]]></attach>\n" + " <bank_type><![CDATA[CFT]]></bank_type>\n" + " <fee_type><![CDATA[CNY]]></fee_type>\n" + " <is_subscribe><![CDATA[Y]]></is_subscribe>\n" + " <mch_id...
[FOCAL] public static WxPayOrderNotifyResult WxPayOrderNotifyResult.fromXML(String xmlString) [CLASS] class WxPayOrderNotifyResult extends BaseWxPayResult [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] XStreamInitializer.getInstance/0, XStream.processAnnotations/1, XStream.registe...
/* static context [FOCAL] public static WxPayOrderNotifyResult WxPayOrderNotifyResult.fromXML(String xmlString) [INPUTS] branches=- | result=xmlString [NEW] WxPayOrderNotifyResultConverter [CALLS-EXTERNAL] XStreamInitializer.getInstance/0, XStream.processAnnotations/1, XStream.registerConverter/1, XStream.getMapper/0, ...
/* static context [FOCAL] public static WxPayOrderNotifyResult WxPayOrderNotifyResult.fromXML(String xmlString) [INPUTS] branches=- | result=xmlString [NEW] WxPayOrderNotifyResultConverter [CALLS-EXTERNAL] XStreamInitializer.getInstance/0, XStream.processAnnotations/1, XStream.registerConverter/1, XStream.getMapper/0, ...
true
ok
{"focal": {"class": "WxPayOrderNotifyResult", "name": "fromXML", "signature": "WxPayOrderNotifyResult fromXML(String xmlString)", "start_line": 3, "modifiers": "public static", "params": [{"name": "xmlString", "type": "String"}], "return_type": "WxPayOrderNotifyResult"}, "class_info": {"name": "WxPayOrderNotifyResult",...
140008964_0
class TimeWarpedClock implements Clock { @Override public void sleep(long dt, TimeUnit timeUnit) throws InterruptedException { Thread.sleep((long) (timeUnit.toMillis(dt) / speedMultiplier)); } public TimeWarpedClock(double speedMultiplier, long startTime); public TimeWarpedClock(double s...
TimeWarpedClock clock = new TimeWarpedClock(10); Stopwatch stopwatch = new Stopwatch(clock); stopwatch.resetIfNotInit(); try { Thread.sleep(5); } catch (InterruptedException e) { e.printStackTrace(); } assertEquals(50, stopwatch.pop(), ...
[FOCAL] @Override public void TimeWarpedClock.sleep(long dt, TimeUnit timeUnit) [CLASS] class TimeWarpedClock implements Clock [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] Thread.sleep/1, TimeUnit.toMillis/1 [EXCEPTIONS] declares InterruptedException [COLLABORATORS] param timeUn...
/* static context [FOCAL] @Override public void TimeWarpedClock.sleep(long dt, TimeUnit timeUnit) [COLLABORATORS] param timeUnit:TimeUnit toMillis/1 [EXCEPTIONS] declares InterruptedException [CALLS-EXTERNAL] Thread.sleep/1, TimeUnit.toMillis/1 */
/* static context [FOCAL] @Override public void TimeWarpedClock.sleep(long dt, TimeUnit timeUnit) [COLLABORATORS] param timeUnit:TimeUnit toMillis/1 [EXCEPTIONS] declares InterruptedException [CALLS-EXTERNAL] Thread.sleep/1, TimeUnit.toMillis/1 */ class TimeWarpedClock implements Clock { @Override public void ...
true
ok
{"focal": {"class": "TimeWarpedClock", "name": "sleep", "signature": "void sleep(long dt, TimeUnit timeUnit) throws InterruptedException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "dt", "type": "long"}, {"name": "timeUnit", "type": "TimeUnit"}], "return_type": "void"}, "class_info": {"name"...
140073232_0
class UsersRepositoryConnectionImpl implements UsersRepository { @Override public Optional<User> findOne(Long id) { try { PreparedStatement statement = connection.prepareStatement(SQL_FIND_BY_ID); statement.setLong(1, id); ResultSet resultSet = statement.executeQuery...
Optional<User> actualOptional = userRepository.findOne(1L); if (!actualOptional.isPresent()) { fail("Return object is null"); } else { User actual = actualOptional.get(); assertEquals(EXPECTED_USER, actual); } } }
[FOCAL] @Override public Optional<User> UsersRepositoryConnectionImpl.findOne(Long id) [CLASS] class UsersRepositoryConnectionImpl implements UsersRepository [METRICS] loc=15 cc=3 branches=0 loops=1 returns=1 throws=1 nesting=2 [CALLS-EXTERNAL] connection.prepareStatement/1, PreparedStatement.setLong/2, PreparedStateme...
/* static context [FOCAL] @Override public Optional<User> UsersRepositoryConnectionImpl.findOne(Long id) [THROWS-WHEN] IllegalArgumentException when try-body throws [PATH1] while(resultSet.next())=T -> exit loop -> return Optional.ofNullable(result) [PATH2] try-body throws -> throw new IllegalArgumentException(e) [PATH...
/* static context [FOCAL] @Override public Optional<User> UsersRepositoryConnectionImpl.findOne(Long id) [THROWS-WHEN] IllegalArgumentException when try-body throws [PATH1] while(resultSet.next())=T -> exit loop -> return Optional.ofNullable(result) [PATH2] try-body throws -> throw new IllegalArgumentException(e) [PATH...
true
ok
{"focal": {"class": "UsersRepositoryConnectionImpl", "name": "findOne", "signature": "Optional<User> findOne(Long id)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "id", "type": "Long"}], "return_type": "Optional<User>"}, "class_info": {"name": "UsersRepositoryConnectionImpl", "kind": "class",...
140255413_6
class MarqetaClient { public CreateUserResponse createUser(CreateUserRequest request) { try { final String url = baseUrl + "/users"; return restTemplate.postForObject(url, request, CreateUserResponse.class); } catch (HttpStatusCodeException cause) { throw errorFactory.fromResponseBody(cause...
final CreateUserResponse response = new CreateUserResponse(); when(restTemplate.postForObject(any(), any(), any(), any(Object[].class))).thenReturn(response); final CreateUserRequest request = new CreateUserRequest(); assertThat(target.createUser(request), is(sameInstance(response))); verify(rest...
[FOCAL] public CreateUserResponse MarqetaClient.createUser(CreateUserRequest request) [CLASS] class MarqetaClient [METRICS] loc=8 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] RestTemplate.postForObject/3, MarqetaErrorFactory.fromResponseBody/2, HttpStatusCodeException.getResponseBodyAsString/0,...
/* static context [FOCAL] public CreateUserResponse MarqetaClient.createUser(CreateUserRequest request) [THROWS-WHEN] errorFactory.fromResponseBody(cause.getResponseBodyAsString(), caus... when try-body throws [PATH1] try-body throws -> throw errorFactory.fromResponseBody(cause.getResponseBodyAsString(), caus... [PATH2...
/* static context [FOCAL] public CreateUserResponse MarqetaClient.createUser(CreateUserRequest request) [THROWS-WHEN] errorFactory.fromResponseBody(cause.getResponseBodyAsString(), caus... when try-body throws [PATH1] try-body throws -> throw errorFactory.fromResponseBody(cause.getResponseBodyAsString(), caus... [PATH2...
true
ok
{"focal": {"class": "MarqetaClient", "name": "createUser", "signature": "CreateUserResponse createUser(CreateUserRequest request)", "start_line": 3, "modifiers": "public", "params": [{"name": "request", "type": "CreateUserRequest"}], "return_type": "CreateUserResponse"}, "class_info": {"name": "MarqetaClient", "kind": ...
140269650_6
class ChordHelper { public int getWithFirstString(Chord chord) { int string = 1; int[] frets = chord.getFrets(); int[] fingers = chord.getFingers(); while (frets[frets.length - 1] == frets[frets.length - 1 - string]) { if(fingers!=null){ if(fingers[finger...
assertThat(mChordHelper.getWithFirstString(mChords.get(0)), is(1)); assertThat(mChordHelper.getWithFirstString(mChords.get(1)), is(1)); assertThat(mChordHelper.getWithFirstString(mChords.get(2)), is(1)); assertThat(mChordHelper.getWithFirstString(mChords.get(3)), is(2)); } }
[FOCAL] public int ChordHelper.getWithFirstString(Chord chord) [CLASS] class ChordHelper [METRICS] loc=17 cc=4 branches=2 loops=1 returns=2 throws=0 nesting=3 [CALLS-EXTERNAL] Chord.getFrets/0, Chord.getFingers/0 [PATH1] while(frets[frets.length - 1] == frets[frets.length - 1 - string])=T -> if(fingers!=null)=T -> if(f...
/* static context [FOCAL] public int ChordHelper.getWithFirstString(Chord chord) [PATH1] while(frets[frets.length - 1] == frets[frets.length - 1 - string])=T -> if(fingers!=null)=T -> if(fingers[fingers.length-1]== fingers[fingers.length-1-string])=T -> return string [PATH2] while(frets[frets.length - 1] == frets[frets...
/* static context [FOCAL] public int ChordHelper.getWithFirstString(Chord chord) [PATH1] while(frets[frets.length - 1] == frets[frets.length - 1 - string])=T -> if(fingers!=null)=T -> if(fingers[fingers.length-1]== fingers[fingers.length-1-string])=T -> return string [PATH2] while(frets[frets.length - 1] == frets[frets...
true
ok
{"focal": {"class": "ChordHelper", "name": "getWithFirstString", "signature": "int getWithFirstString(Chord chord)", "start_line": 3, "modifiers": "public", "params": [{"name": "chord", "type": "Chord"}], "return_type": "int"}, "class_info": {"name": "ChordHelper", "kind": "class", "modifiers": "", "superclass": null, ...
140540897_44
class CreditCardAuthorizationParesPaymentProcessor implements PaymentProcessor { @Override public void processPayment(Payment payment, PaymentOperationData data) throws WirecardPaymenException { String pares = data.getPares(); ThreeD threeD = objectFactory.createThreeD(); threeD.getCont...
this.payment = new Payment(); creditCardAuthorizationParesPaymentProcessor.processPayment(this.payment, data); Assert.assertEquals("response is not equals",this.threeD, payment.getThreeD()); } }
[FOCAL] @Override public void CreditCardAuthorizationParesPaymentProcessor.processPayment(Payment payment, PaymentOperationData data) [CLASS] class CreditCardAuthorizationParesPaymentProcessor implements PaymentProcessor [METRICS] loc=8 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] PaymentOperat...
/* static context [FOCAL] @Override public void CreditCardAuthorizationParesPaymentProcessor.processPayment(Payment payment, PaymentOperationData data) [COLLABORATORS] param data:PaymentOperationData getPares/0; field objectFactory:ObjectFactory createThreeD/0,createThreeDPares/1; param payment:Payment setThreeD/1 [EXC...
/* static context [FOCAL] @Override public void CreditCardAuthorizationParesPaymentProcessor.processPayment(Payment payment, PaymentOperationData data) [COLLABORATORS] param data:PaymentOperationData getPares/0; field objectFactory:ObjectFactory createThreeD/0,createThreeDPares/1; param payment:Payment setThreeD/1 [EXC...
true
ok
{"focal": {"class": "CreditCardAuthorizationParesPaymentProcessor", "name": "processPayment", "signature": "void processPayment(Payment payment, PaymentOperationData data) throws WirecardPaymenException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "payment", "type": "Payment"}, {"name": "data...
140874933_5
class FileGenerator { void generateServiceDispatcher(Writer output) throws IOException, TemplateException { configuration.getTemplate("ServiceDispatcherTemplate.ftl").process(dispatcherContext, output); } public FileGenerator(List<AnalysisResult> results, String outputPath); public void gene...
AnalysisResult result = buildResult(); List<AnalysisResult> results = new LinkedList<>(); results.add(result); FileGenerator fileGenerator = new FileGenerator(results, "."); StringWriter writer = new StringWriter(); fileGenerator.generateServiceDispatcher(writer); ...
[FOCAL] void FileGenerator.generateServiceDispatcher(Writer output) [CLASS] class FileGenerator [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] configuration.getTemplate("ServiceDispatcherTemplate.ftl").process/2, configuration.getTemplate/1 [EXCEPTIONS] declares IOException, Templ...
/* static context [FOCAL] void FileGenerator.generateServiceDispatcher(Writer output) [COLLABORATORS] field configuration getTemplate/1 [EXCEPTIONS] declares IOException, TemplateException [CALLS-EXTERNAL] configuration.getTemplate("ServiceDispatcherTemplate.ftl").process/2, configuration.getTemplate/1 */
/* static context [FOCAL] void FileGenerator.generateServiceDispatcher(Writer output) [COLLABORATORS] field configuration getTemplate/1 [EXCEPTIONS] declares IOException, TemplateException [CALLS-EXTERNAL] configuration.getTemplate("ServiceDispatcherTemplate.ftl").process/2, configuration.getTemplate/1 */ class FileGen...
true
ok
{"focal": {"class": "FileGenerator", "name": "generateServiceDispatcher", "signature": "void generateServiceDispatcher(Writer output) throws IOException, TemplateException", "start_line": 3, "modifiers": "", "params": [{"name": "output", "type": "Writer"}], "return_type": "void"}, "class_info": {"name": "FileGenerator"...
141102600_0
class Decision { public String toJsonString() throws JsonProcessingException { return ObjectMapperProvider.get().writeValueAsString(this); } public static Decision fromJsonString(String json); } class DecisionTest { @Test public void shouldSerializeToJson() throws JsonProcessingExceptio...
LocalDateTime now = LocalDateTime.now().plusNanos(1); Request request = new Request( "user1", "manager1", now, "Proszę o urlop"); Decision d = new Decision( "manager1", request, now, ...
[FOCAL] public String Decision.toJsonString() [CLASS] class Decision [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] ObjectMapperProvider.get().writeValueAsString/1, ObjectMapperProvider.get/0 [EXCEPTIONS] declares JsonProcessingException [CLASS-MEMBERS] Decision fromJsonString(Str...
/* static context [FOCAL] public String Decision.toJsonString() [EXCEPTIONS] declares JsonProcessingException [CALLS-EXTERNAL] ObjectMapperProvider.get().writeValueAsString/1, ObjectMapperProvider.get/0 */
/* static context [FOCAL] public String Decision.toJsonString() [EXCEPTIONS] declares JsonProcessingException [CALLS-EXTERNAL] ObjectMapperProvider.get().writeValueAsString/1, ObjectMapperProvider.get/0 */ class Decision { public String toJsonString() throws JsonProcessingException { return ObjectMapperPro...
true
ok
{"focal": {"class": "Decision", "name": "toJsonString", "signature": "String toJsonString() throws JsonProcessingException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "Decision", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "field...
141169138_0
class UserMessage { public String getMessage() { return message; } private UserMessage(Builder builder); public int getBackgroundColor(); public void setBackgroundColor(int backgroundColor); public int getTextColor(); public void setTextColor(int textColor); public void setMe...
UserMessage userMessage = new UserMessage.Builder().with(mContext).build(); assertNotNull(userMessage.getMessage()); } }
[FOCAL] public String UserMessage.getMessage() [CLASS] class UserMessage [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] UserMessage(Builder builder); int getBackgroundColor(); void setBackgroundColor(int backgroundColor); int getTextColor(); void setTextColor(int textColor); void s...
/* static context [FOCAL] public String UserMessage.getMessage() */
/* static context [FOCAL] public String UserMessage.getMessage() */ class UserMessage { public String getMessage() { return message; } private UserMessage(Builder builder); public int getBackgroundColor(); public void setBackgroundColor(int backgroundColor); public int getTextColor()...
true
ok
{"focal": {"class": "UserMessage", "name": "getMessage", "signature": "String getMessage()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "UserMessage", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "mContext", "ty...
141267788_13
class SamlSettings { String getApplicationId() { return configuration.get(APPLICATION_ID).orElseThrow(() -> new IllegalArgumentException("Application ID is missing")); } public SamlSettings(Configuration configuration); String getProviderId(); String getProviderName(); String getLoginUrl(); St...
assertThat(underTest.getApplicationId()).isEqualTo("sonarqube"); } }
[FOCAL] String SamlSettings.getApplicationId() [CLASS] class SamlSettings [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] configuration.get(APPLICATION_ID).orElseThrow/1, configuration.get/1 [NEW] IllegalArgumentException [COLLABORATORS] field configuration get/1 [CLASS-MEMBERS] Sa...
/* static context [FOCAL] String SamlSettings.getApplicationId() [COLLABORATORS] field configuration get/1 [NEW] IllegalArgumentException [CALLS-EXTERNAL] configuration.get(APPLICATION_ID).orElseThrow/1, configuration.get/1 */
/* static context [FOCAL] String SamlSettings.getApplicationId() [COLLABORATORS] field configuration get/1 [NEW] IllegalArgumentException [CALLS-EXTERNAL] configuration.get(APPLICATION_ID).orElseThrow/1, configuration.get/1 */ class SamlSettings { String getApplicationId() { return configuration.get(APPLICATION_...
true
ok
{"focal": {"class": "SamlSettings", "name": "getApplicationId", "signature": "String getApplicationId()", "start_line": 3, "modifiers": "", "params": [], "return_type": "String"}, "class_info": {"name": "SamlSettings", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "expect...
141270248_1
class FileManager { public static boolean createUserFolder(final String folder) throws IOException { final String tempPath = FileManager.libDir + OsUtils.getSeparator() + LibPaths.USER.getDirName() + OsUtils.getSeparator() + folder.replaceAll("\\s+", "_"); return FileManager.createD...
Assertions.assertDoesNotThrow(() -> FileManager.createUserFolder(FileManagerTest.USER_FOLDER)); } }
[FOCAL] public static boolean FileManager.createUserFolder(String folder) [CLASS] class FileManager [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] OsUtils.getSeparator/0, LibPaths.USER.getDirName/0, String.replaceAll/2, FileManager.createDirectory/1 [EXCEPTIONS] declares IOExcepti...
/* static context [FOCAL] public static boolean FileManager.createUserFolder(String folder) [INPUTS] branches=- | result=folder [EXCEPTIONS] declares IOException [CALLS-EXTERNAL] OsUtils.getSeparator/0, LibPaths.USER.getDirName/0, String.replaceAll/2, FileManager.createDirectory/1 */
/* static context [FOCAL] public static boolean FileManager.createUserFolder(String folder) [INPUTS] branches=- | result=folder [EXCEPTIONS] declares IOException [CALLS-EXTERNAL] OsUtils.getSeparator/0, LibPaths.USER.getDirName/0, String.replaceAll/2, FileManager.createDirectory/1 */ class FileManager { public sta...
true
ok
{"focal": {"class": "FileManager", "name": "createUserFolder", "signature": "boolean createUserFolder(String folder) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "folder", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "FileManager", "kind": "class", "mo...
141304234_0
class OpenKoreanTextNormalizer extends BaseCharFilter { @Override public int read(char[] cbuf, int off, int len) throws IOException { if (off < 0) throw new IllegalArgumentException("off < 0"); if (off >= cbuf.length) throw new IllegalArgumentException("off >= cbuf.length"); if (len <= ...
String query = "한국어를 처리하는 예시입니닼ㅋ. 오픈코리안텍스틓ㅎㅎㅎㅎㅎㅎㅎ"; String expected = "한국어를 처리하는 예시입니다ㅋ. 오픈코리안텍스트ㅎㅎㅎ"; CharFilter inputReader = new OpenKoreanTextNormalizer(new StringReader(query)); char[] tempBuff = new char[10]; StringBuilder actual = new StringBuilder(); while (tru...
[FOCAL] @Override public int OpenKoreanTextNormalizer.read(char[] cbuf, int off, int len) [CLASS] class OpenKoreanTextNormalizer extends BaseCharFilter [METRICS] loc=21 cc=6 branches=5 loops=0 returns=2 throws=3 nesting=1 [CALLS-INTERNAL] void initAttributes(); void prepareToRead() [CALLS-EXTERNAL] System.arraycopy/5 [...
/* static context [FOCAL] @Override public int OpenKoreanTextNormalizer.read(char[] cbuf, int off, int len) [THROWS-WHEN] IllegalArgumentException when off < 0 [THROWS-WHEN] IllegalArgumentException when !(off < 0) && off >= cbuf.length [THROWS-WHEN] IllegalArgumentException when !(off < 0) && !(off >= cbuf.length) && ...
/* static context [FOCAL] @Override public int OpenKoreanTextNormalizer.read(char[] cbuf, int off, int len) [THROWS-WHEN] IllegalArgumentException when off < 0 [THROWS-WHEN] IllegalArgumentException when !(off < 0) && off >= cbuf.length [THROWS-WHEN] IllegalArgumentException when !(off < 0) && !(off >= cbuf.length) && ...
true
ok
{"focal": {"class": "OpenKoreanTextNormalizer", "name": "read", "signature": "int read(char[] cbuf, int off, int len) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "cbuf", "type": "char[]"}, {"name": "off", "type": "int"}, {"name": "len", "type": "int"}], "return_type": "int...
141402922_2
class Absence extends SequentialGetStepSupplier.GetObjectChainedStepSupplier<T, Boolean, Object, Absence<T>> { private Absence(Function<T, ?> toBeAbsent) { super("Absence of " + (isLoggable(toBeAbsent) ? toBeAbsent.toString() : "<not described value>"), o -> ofNullable(o) ...
var start = currentTimeMillis(); assertThat(testContext.absence(new TestGetSupplier<>(new FunctionThatReturnsObject(ofSeconds(5)).run()), ofSeconds(10)), is(true)); var end = currentTimeMillis(); assertThat(new BigDecimal(end - start), closeTo(new BigDecim...
[FOCAL] private Absence.Absence(Function<T, ?> toBeAbsent) [CLASS] class Absence extends SequentialGetStepSupplier.GetObjectChainedStepSupplier<T, Boolean, Object, Absence<T>> [METRICS] loc=24 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] isLoggable/1 (inherited), Function<T, ?>.toString/0, ofNu...
/* static context [FOCAL] private Absence.Absence(Function<T, ?> toBeAbsent) [PATH1] if(StepFunction.class.isAssignableFrom(toBeAbsent.getClass()))=T [PATH2] if(StepFunction.class.isAssignableFrom(toBeAbsent.getClass()))=F [INPUTS] branches=toBeAbsent | result=- [COLLABORATORS] param toBeAbsent:Function<T, ?> toString/...
/* static context [FOCAL] private Absence.Absence(Function<T, ?> toBeAbsent) [PATH1] if(StepFunction.class.isAssignableFrom(toBeAbsent.getClass()))=T [PATH2] if(StepFunction.class.isAssignableFrom(toBeAbsent.getClass()))=F [INPUTS] branches=toBeAbsent | result=- [COLLABORATORS] param toBeAbsent:Function<T, ?> toString/...
true
ok
{"focal": {"class": "Absence", "name": "Absence", "signature": "Absence(Function<T, ?> toBeAbsent)", "start_line": 3, "modifiers": "private", "params": [{"name": "toBeAbsent", "type": "Function<T, ?>"}], "return_type": null}, "class_info": {"name": "Absence", "kind": "class", "modifiers": "", "superclass": "SequentialG...
141550213_24
class DosSantosPairwiseRankingLoss implements ILossFunction { public INDArray scoreArray(INDArray labels, INDArray preOutput, IActivation activationFn, INDArray mask) { INDArray scoreArr; INDArray output = activationFn.getActivation(preOutput.dup(), true); INDArray mPluss = Nd4j.zeros(output.shape()).ad...
INDArray label = Nd4j.create(1, 2); label.put(0, 0, 1); label.put(0, 1, 0); INDArray preOutput = Nd4j.create(label.shape()); preOutput.put(0, 0, 4); preOutput.put(0, 1, 0); INDArray mask = Nd4j.ones(1,1); IActivation tanH = new ActivationTanH(); DosSantosPairwiseRankingLos...
[FOCAL] public INDArray DosSantosPairwiseRankingLoss.scoreArray(INDArray labels, INDArray preOutput, IActivation activationFn, INDArray mask) [CLASS] class DosSantosPairwiseRankingLoss implements ILossFunction [METRICS] loc=34 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] IActivation.getActivati...
/* static context [FOCAL] public INDArray DosSantosPairwiseRankingLoss.scoreArray(INDArray labels, INDArray preOutput, IActivation activationFn, INDArray mask) [PATH1] for(i < maxNeg.length())=T -> exit loop -> if(mask != null)=T -> return scoreArr [PATH2] for(i < maxNeg.length())=F -> if(mask != null)=F -> return scor...
/* static context [FOCAL] public INDArray DosSantosPairwiseRankingLoss.scoreArray(INDArray labels, INDArray preOutput, IActivation activationFn, INDArray mask) [PATH1] for(i < maxNeg.length())=T -> exit loop -> if(mask != null)=T -> return scoreArr [PATH2] for(i < maxNeg.length())=F -> if(mask != null)=F -> return scor...
true
ok
{"focal": {"class": "DosSantosPairwiseRankingLoss", "name": "scoreArray", "signature": "INDArray scoreArray(INDArray labels, INDArray preOutput, IActivation activationFn, INDArray mask)", "start_line": 3, "modifiers": "public", "params": [{"name": "labels", "type": "INDArray"}, {"name": "preOutput", "type": "INDArray"}...
141591175_0
class MyJavaRulesDefinition implements RulesDefinition { @Override public void define(Context context) { NewRepository repository = context .createRepository(REPOSITORY_KEY, Java.KEY) .setName("Sonar Secrets Java"); List<Class> checks = RulesList.getChecks(); new RulesDefinitionAnnotationL...
MyJavaRulesDefinition rulesDefinition = new MyJavaRulesDefinition(); RulesDefinition.Context context = new RulesDefinition.Context(); rulesDefinition.define(context); RulesDefinition.Repository repository = context.repository(MyJavaRulesDefinition.REPOSITORY_KEY); assertThat(repository.name()).isEq...
[FOCAL] @Override public void MyJavaRulesDefinition.define(Context context) [CLASS] class MyJavaRulesDefinition implements RulesDefinition [METRICS] loc=14 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] void newRule(Class<?> ruleClass, NewRepository repository) [CALLS-EXTERNAL] context .createRep...
/* static context [FOCAL] @Override public void MyJavaRulesDefinition.define(Context context) [PATH1] foreach(Class ruleClass : checks)=T -> exit loop [PATH2] foreach(Class ruleClass : checks)=F [COLLABORATORS] param context:Context createRepository/2 [CALLS-INTERNAL] void newRule(Class<?> ruleClass, NewRepository repo...
/* static context [FOCAL] @Override public void MyJavaRulesDefinition.define(Context context) [PATH1] foreach(Class ruleClass : checks)=T -> exit loop [PATH2] foreach(Class ruleClass : checks)=F [COLLABORATORS] param context:Context createRepository/2 [CALLS-INTERNAL] void newRule(Class<?> ruleClass, NewRepository repo...
true
ok
{"focal": {"class": "MyJavaRulesDefinition", "name": "define", "signature": "void define(Context context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "context", "type": "Context"}], "return_type": "void"}, "class_info": {"name": "MyJavaRulesDefinition", "kind": "class", "modifiers": "", "sup...
141626961_1
class ItemsBuilder extends ItemsBuilderAbstraction { @Override public DateTime getNextAlarmDate(DateTime executionDate) { return getBuildingStrategy().getNextAlarmDate(executionDate); } @Override public List<Item> getItems(DateTime currentDate, DateTime executionDate); @Override public boo...
itemsBuilder.setBuildingStrategy(new SleepNowBuildingStrategy()); assertEquals(getDateTime("05/02/2011 02:30"), itemsBuilder.getNextAlarmDate(getDateTime("05/02/2011 01:00"))); assertEquals(getDateTime("06/02/2011 01:25"), itemsBuilder.getNextAlarmDate(getDateTime("05/02/2011 23:55"))); ...
[FOCAL] @Override public DateTime ItemsBuilder.getNextAlarmDate(DateTime executionDate) [CLASS] class ItemsBuilder extends ItemsBuilderAbstraction [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] getBuildingStrategy().getNextAlarmDate/1, getBuildingStrategy/0 (inherited) [INPUTS] br...
/* static context [FOCAL] @Override public DateTime ItemsBuilder.getNextAlarmDate(DateTime executionDate) [INPUTS] branches=- | result=executionDate [CALLS-EXTERNAL] getBuildingStrategy().getNextAlarmDate/1, getBuildingStrategy/0 (inherited) */
/* static context [FOCAL] @Override public DateTime ItemsBuilder.getNextAlarmDate(DateTime executionDate) [INPUTS] branches=- | result=executionDate [CALLS-EXTERNAL] getBuildingStrategy().getNextAlarmDate/1, getBuildingStrategy/0 (inherited) */ class ItemsBuilder extends ItemsBuilderAbstraction { @Override pub...
true
ok
{"focal": {"class": "ItemsBuilder", "name": "getNextAlarmDate", "signature": "DateTime getNextAlarmDate(DateTime executionDate)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "executionDate", "type": "DateTime"}], "return_type": "DateTime"}, "class_info": {"name": "ItemsBuilder", "kind": "class...
141633330_19
class WebSocket extends Transport { @Override public boolean isWritable() { return true; } public WebSocket(EngineIoWebSocket webSocket); @Override public void onRequest(HttpServletRequest request, HttpServletResponse response); @Override public void send(List<Packet<?>> packets); ...
final WebSocket webSocket = new WebSocket(Mockito.mock(EngineIoWebSocket.class)); assertTrue(webSocket.isWritable()); } }
[FOCAL] @Override public boolean WebSocket.isWritable() [CLASS] class WebSocket extends Transport [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] WebSocket(EngineIoWebSocket webSocket); void onRequest(HttpServletRequest request, HttpServletResponse response); void send(List<Packet<?...
/* static context [FOCAL] @Override public boolean WebSocket.isWritable() */
/* static context [FOCAL] @Override public boolean WebSocket.isWritable() */ class WebSocket extends Transport { @Override public boolean isWritable() { return true; } public WebSocket(EngineIoWebSocket webSocket); @Override public void onRequest(HttpServletRequest request, HttpServletRe...
true
ok
{"focal": {"class": "WebSocket", "name": "isWritable", "signature": "boolean isWritable()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "boolean"}, "class_info": {"name": "WebSocket", "kind": "class", "modifiers": "", "superclass": "Transport", "interfaces": null, "fields": [], "membe...
141671109_207
class Request { public T send() throws IOException { return web3jService.send(this, responseType); } public Request(); public Request(String method, List<S> params, Web3jService web3jService, Class<T> type); public String getJsonrpc(); public void setJsonrpc(Strin...
web3j.ethGetUncleByBlockNumberAndIndex( DefaultBlockParameter.valueOf(Numeric.toBigInt("0x29c")), BigInteger.ZERO).send(); verifyResult("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getUncleByBlockNumberAndIndex\"," + "\"params\":[\"0x29c\",\"0x0\"],\"id\":1}"); } }
[FOCAL] public T Request.send() [CLASS] class Request [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] web3jService.send/2 [EXCEPTIONS] declares IOException [COLLABORATORS] field web3jService send/2 [CLASS-MEMBERS] Request(); Request(String method, List<S> params, Web3jService web3j...
/* static context [FOCAL] public T Request.send() [COLLABORATORS] field web3jService send/2 [EXCEPTIONS] declares IOException [CALLS-EXTERNAL] web3jService.send/2 */
/* static context [FOCAL] public T Request.send() [COLLABORATORS] field web3jService send/2 [EXCEPTIONS] declares IOException [CALLS-EXTERNAL] web3jService.send/2 */ class Request { public T send() throws IOException { return web3jService.send(this, responseType); } public Request(); public ...
true
ok
{"focal": {"class": "Request", "name": "send", "signature": "T send() throws IOException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "T"}, "class_info": {"name": "Request", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "web3j", "type": "Web3j", ...
141752763_0
class CorsHandler implements HttpHandler { @Override public void handleRequest(HttpServerExchange exchange) throws Exception { HeaderMap responseHeaders = exchange.getResponseHeaders(); responseHeaders.add(HttpString.tryFromString("Access-Control-Allow-Origin"), "*"); handler.handleRequ...
corsHandler.handleRequest(dummyExchange); assertTrue(testHandler.hasCalled()); } }
[FOCAL] @Override public void CorsHandler.handleRequest(HttpServerExchange exchange) [CLASS] class CorsHandler implements HttpHandler [METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] HttpServerExchange.getResponseHeaders/0, HeaderMap.add/2, HttpString.tryFromString/1, handler.handle...
/* static context [FOCAL] @Override public void CorsHandler.handleRequest(HttpServerExchange exchange) [COLLABORATORS] param exchange:HttpServerExchange getResponseHeaders/0; field handler handleRequest/1 [EXCEPTIONS] declares Exception [CALLS-EXTERNAL] HttpServerExchange.getResponseHeaders/0, HeaderMap.add/2, HttpStri...
/* static context [FOCAL] @Override public void CorsHandler.handleRequest(HttpServerExchange exchange) [COLLABORATORS] param exchange:HttpServerExchange getResponseHeaders/0; field handler handleRequest/1 [EXCEPTIONS] declares Exception [CALLS-EXTERNAL] HttpServerExchange.getResponseHeaders/0, HeaderMap.add/2, HttpStri...
true
ok
{"focal": {"class": "CorsHandler", "name": "handleRequest", "signature": "void handleRequest(HttpServerExchange exchange) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "exchange", "type": "HttpServerExchange"}], "return_type": "void"}, "class_info": {"name": "CorsHandler", "ki...
142015901_2
class RouterFunctions { public static Builder route() { return new RouterFunctionBuilder(); } public static RouterFunction<T> route( RequestPredicate predicate, HandlerFunction<T> handlerFunction); public static RouterFunction<T> nest( RequestPredicate predicate, RouterFunction<T> routerFunction); public...
RouterFunction<ServerResponse> routerFunction1 = request -> Mono.empty(); RequestPredicate requestPredicate = request -> true; RouterFunction<ServerResponse> result = routerFunction1.andRoute(requestPredicate, this::handlerMethod); assertNotNull(result); MockServerRequest request = MockServerRequest.builder...
[FOCAL] public static Builder RouterFunctions.route() [CLASS] class RouterFunctions [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] RouterFunctionBuilder [CLASS-MEMBERS] RouterFunction<T> route(RequestPredicate predicate, HandlerFunction<T> handlerFunction); RouterFunction<T> nest(RequestPred...
/* static context [FOCAL] public static Builder RouterFunctions.route() [NEW] RouterFunctionBuilder */
/* static context [FOCAL] public static Builder RouterFunctions.route() [NEW] RouterFunctionBuilder */ class RouterFunctions { public static Builder route() { return new RouterFunctionBuilder(); } public static RouterFunction<T> route( RequestPredicate predicate, HandlerFunction<T> handlerFunction); public s...
true
ok
{"focal": {"class": "RouterFunctions", "name": "route", "signature": "Builder route()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Builder"}, "class_info": {"name": "RouterFunctions", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"...
142037766_2
class PartitionUtil { public static void greedyPartition(Collection<TestTime> testTimes, Set<TestContainer> testContainers) { if(testContainers.isEmpty()) { throw new IllegalArgumentException("Queue must be populated with a partition for each host"); } List<TestTime> sortedList...
Timestamp now = Timestamp.from(Clock.systemUTC().instant()); TestTime test1 = new TestTime("test1", 10, false, "host1", now); TestTime test2 = new TestTime("test2", 5, false, "host1", now); TestTime test3 = new TestTime("test3", 1, false, "host1", now); TestTime test4 = new TestT...
[FOCAL] public static void PartitionUtil.greedyPartition(Collection<TestTime> testTimes, Set<TestContainer> testContainers) [CLASS] class PartitionUtil [METRICS] loc=13 cc=2 branches=1 loops=0 returns=0 throws=1 nesting=1 [CALLS-INTERNAL] void greedyPartition(List<TestTime> sortedTestTimes, PriorityQueue<TestContainer>...
/* static context [FOCAL] public static void PartitionUtil.greedyPartition(Collection<TestTime> testTimes, Set<TestContainer> testContainers) [THROWS-WHEN] IllegalArgumentException when testContainers.isEmpty() [PATH1] if(testContainers.isEmpty())=T -> throw new IllegalArgumentException("Queue must be populated with a ...
/* static context [FOCAL] public static void PartitionUtil.greedyPartition(Collection<TestTime> testTimes, Set<TestContainer> testContainers) [THROWS-WHEN] IllegalArgumentException when testContainers.isEmpty() [PATH1] if(testContainers.isEmpty())=T -> throw new IllegalArgumentException("Queue must be populated with a ...
true
ok
{"focal": {"class": "PartitionUtil", "name": "greedyPartition", "signature": "void greedyPartition(Collection<TestTime> testTimes, Set<TestContainer> testContainers)", "start_line": 3, "modifiers": "public static", "params": [{"name": "testTimes", "type": "Collection<TestTime>"}, {"name": "testContainers", "type": "Set...
142085119_2
class HandshakeSessionHandler implements MinecraftSessionHandler { @VisibleForTesting static String cleanVhost(String hostname) { // Clean out any anything after any zero bytes (this includes BungeeCord forwarding and the // legacy Forge handshake indicator). String cleaned = hostname; int zeroIdx ...
assertEquals("localhost", cleanVhost("localhost" + HANDSHAKE_HOSTNAME_TOKEN)); assertEquals("mc.example.com", cleanVhost("mc.example.com" + HANDSHAKE_HOSTNAME_TOKEN)); } }
[FOCAL] @VisibleForTesting static String HandshakeSessionHandler.cleanVhost(String hostname) [CLASS] class HandshakeSessionHandler implements MinecraftSessionHandler [METRICS] loc=17 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] String.indexOf/1, String.substring/2, String.isEmpty/0, String.char...
/* static context [FOCAL] @VisibleForTesting static String HandshakeSessionHandler.cleanVhost(String hostname) [PATH1] if(zeroIdx > -1)=T -> if(!cleaned.isEmpty() && cleaned.charAt(cleaned.length() - 1) == '.')=T -> return cleaned [PATH2] if(zeroIdx > -1)=F -> if(!cleaned.isEmpty() && cleaned.charAt(cleaned.length() - ...
/* static context [FOCAL] @VisibleForTesting static String HandshakeSessionHandler.cleanVhost(String hostname) [PATH1] if(zeroIdx > -1)=T -> if(!cleaned.isEmpty() && cleaned.charAt(cleaned.length() - 1) == '.')=T -> return cleaned [PATH2] if(zeroIdx > -1)=F -> if(!cleaned.isEmpty() && cleaned.charAt(cleaned.length() - ...
true
ok
{"focal": {"class": "HandshakeSessionHandler", "name": "cleanVhost", "signature": "String cleanVhost(String hostname)", "start_line": 3, "modifiers": "@VisibleForTesting static", "params": [{"name": "hostname", "type": "String"}], "return_type": "String"}, "class_info": {"name": "HandshakeSessionHandler", "kind": "clas...
142101199_0
class Function { @FunctionName("HttpTrigger-Java") public HttpResponseMessage run( @HttpTrigger(name = "req", methods = {HttpMethod.GET, HttpMethod.POST}, authLevel = AuthorizationLevel.FUNCTION) HttpRequestMessage<Optional<String>> request, final ExecutionContext context) { con...
// Setup @SuppressWarnings("unchecked") final HttpRequestMessage<Optional<String>> req = mock(HttpRequestMessage.class); final Map<String, String> queryParams = new HashMap<>(); queryParams.put("name", "Azure"); doReturn(queryParams).when(req).getQueryParameters(); ...
[FOCAL] @FunctionName("HttpTrigger-Java") public HttpResponseMessage Function.run(HttpRequestMessage<Optional<String>> request, ExecutionContext context) [CLASS] class Function [METRICS] loc=16 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] context.getLogger().info/1, ExecutionContext.getLogger/0...
/* static context [FOCAL] @FunctionName("HttpTrigger-Java") public HttpResponseMessage Function.run(HttpRequestMessage<Optional<String>> request, ExecutionContext context) [PATH1] if(name == null)=T -> return request.createResponseBuilder(HttpStatus.BAD_REQUEST).body("Please ... [PATH2] if(name == null)=F -> return req...
/* static context [FOCAL] @FunctionName("HttpTrigger-Java") public HttpResponseMessage Function.run(HttpRequestMessage<Optional<String>> request, ExecutionContext context) [PATH1] if(name == null)=T -> return request.createResponseBuilder(HttpStatus.BAD_REQUEST).body("Please ... [PATH2] if(name == null)=F -> return req...
true
ok
{"focal": {"class": "Function", "name": "run", "signature": "HttpResponseMessage run(HttpRequestMessage<Optional<String>> request, ExecutionContext context)", "start_line": 3, "modifiers": "@FunctionName(\"HttpTrigger-Java\") public", "params": [{"name": "request", "type": "HttpRequestMessage<Optional<String>>"}, {"nam...
142141420_42
class AssetManagerImpl implements IAssetManager { @Override public Response urlValidate(Map<String, Object> asset, String field) { IURLManager urlManager = getURLManager(getProvider(asset)); Map<String, Object> fieldMap = urlManager.validateURL(getUrl(asset), field); Response response = new Respons...
Map<String, Object> asset = new HashMap<>(); asset.put(AssetParams.provider.name(), ""); asset.put(AssetParams.url.name(), "https://www.youtube.com/watch?v=nA1Aqp0sPQo"); try { assetManager.urlValidate(asset, "license"); } catch (ClientException e) { asser...
[FOCAL] @Override public Response AssetManagerImpl.urlValidate(Map<String, Object> asset, String field) [CLASS] class AssetManagerImpl implements IAssetManager [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] IURLManager getURLManager(String provider); String getProvider(Map<String,...
/* static context [FOCAL] @Override public Response AssetManagerImpl.urlValidate(Map<String, Object> asset, String field) [CALLS-INTERNAL] IURLManager getURLManager(String provider); String getProvider(Map<String, Object> asset); String getUrl(Map<String, Object> asset) [NEW] Response [CALLS-EXTERNAL] IURLManager.valid...
/* static context [FOCAL] @Override public Response AssetManagerImpl.urlValidate(Map<String, Object> asset, String field) [CALLS-INTERNAL] IURLManager getURLManager(String provider); String getProvider(Map<String, Object> asset); String getUrl(Map<String, Object> asset) [NEW] Response [CALLS-EXTERNAL] IURLManager.valid...
true
ok
{"focal": {"class": "AssetManagerImpl", "name": "urlValidate", "signature": "Response urlValidate(Map<String, Object> asset, String field)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "asset", "type": "Map<String, Object>"}, {"name": "field", "type": "String"}], "return_type": "Response"}, "c...
142195981_33
class Pattern3 implements PartialFunction3<A, B, C, R> { private Pattern3() { this(Pattern1.build()); } private Pattern3(); private Pattern3(Pattern1<Tuple3<A, B, C>, R> pattern); @Override public boolean isDefinedAt(A a, B b, C c); @Override public R apply(A a, B b, C c); public static Pattern3<...
Pattern3<Object, Object, Object, Object> pattern3 = Pattern3.build() .when((a, b, c) -> a.equals(b) && b.equals(c) && a.equals(c)).returns("a equals b equals c") .otherwise().returns("not equals"); assertAll(() -> assertEquals("a equals b equals c", pattern3.apply("a", "a", "a")), () ...
[FOCAL] private Pattern3.Pattern3() [CLASS] class Pattern3 implements PartialFunction3<A, B, C, R> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] Pattern1.build/0 [CLASS-MEMBERS] Pattern3(); Pattern3(Pattern1<Tuple3<A, B, C>, R> pattern); boolean isDefinedAt(A a, B b, C c); R appl...
/* static context [FOCAL] private Pattern3.Pattern3() [CALLS-EXTERNAL] Pattern1.build/0 */
/* static context [FOCAL] private Pattern3.Pattern3() [CALLS-EXTERNAL] Pattern1.build/0 */ class Pattern3 implements PartialFunction3<A, B, C, R> { private Pattern3() { this(Pattern1.build()); } private Pattern3(); private Pattern3(Pattern1<Tuple3<A, B, C>, R> pattern); @Override public boolean isDef...
true
ok
{"focal": {"class": "Pattern3", "name": "Pattern3", "signature": "Pattern3()", "start_line": 3, "modifiers": "private", "params": [], "return_type": null}, "class_info": {"name": "Pattern3", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "PartialFunction3<A, B, C, R>", "fields": [], "members": [{"n...
142735552_0
class SelectionManager { public SelectionManager(LauncherConfiguration conf, StatusManager statusManager, RequestManager requestManager) { this.conf = conf; this.statusManager = statusManager; this.requestManager = requestManager; } public SelectionManager(LauncherConfiguration conf, StatusManager ...
Node node1 = new Node("node1", null, ResourceDescriptor.newInstance(200, 200, 2, 3L), ResourceDescriptor.newInstance(0, 0, 0, 0L)); Node node2 = new Node("node2", null, ResourceDescriptor.newInstance(200, 200, 4, 0xFL), ResourceDescriptor.newInstance(0, 0, 0, 0L)); Node node3 = new Node("node3", null, Resou...
[FOCAL] public SelectionManager.SelectionManager(LauncherConfiguration conf, StatusManager statusManager, RequestManager requestManager) [CLASS] class SelectionManager [METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [FIELDS] write=conf, requestManager, statusManager [STATE] conf, requestManager, st...
class SelectionManager { public SelectionManager(LauncherConfiguration conf, StatusManager statusManager, RequestManager requestManager) { this.conf = conf; this.statusManager = statusManager; this.requestManager = requestManager; } public SelectionManager(LauncherConfiguration conf, StatusManager ...
false
ok
{"focal": {"class": "SelectionManager", "name": "SelectionManager", "signature": "SelectionManager(LauncherConfiguration conf, StatusManager statusManager, RequestManager requestManager)", "start_line": 3, "modifiers": "public", "params": [{"name": "conf", "type": "LauncherConfiguration"}, {"name": "statusManager", "ty...
142747385_9
class OSHDBBoundingBox implements Serializable { public long[] getLon() { return new long[]{minLon, maxLon}; } public OSHDBBoundingBox(long minLon, long minLat, long maxLon, long maxLat); public OSHDBBoundingBox(double minLon, double minLat, double maxLon, double maxLat); public OSHDBBoundingBox(int ...
OSHDBBoundingBox instance = new OSHDBBoundingBox(0.0, 89.0, 1.0, 90.0); long[] expResult = new long[]{0L, 10000000L}; long[] result = instance.getLon(); assertArrayEquals(expResult, result); } }
[FOCAL] public long[] OSHDBBoundingBox.getLon() [CLASS] class OSHDBBoundingBox implements Serializable [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] OSHDBBoundingBox(long minLon, long minLat, long maxLon, long maxLat); OSHDBBoundingBox(double minLon, double minLat, double maxLon, ...
/* static context [FOCAL] public long[] OSHDBBoundingBox.getLon() */
/* static context [FOCAL] public long[] OSHDBBoundingBox.getLon() */ class OSHDBBoundingBox implements Serializable { public long[] getLon() { return new long[]{minLon, maxLon}; } public OSHDBBoundingBox(long minLon, long minLat, long maxLon, long maxLat); public OSHDBBoundingBox(double minLon, double m...
true
ok
{"focal": {"class": "OSHDBBoundingBox", "name": "getLon", "signature": "long[] getLon()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "long[]"}, "class_info": {"name": "OSHDBBoundingBox", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Serializable", "fields": [], "members"...
142758232_6
class OrderRepository implements OrderDataSource { public OrderList getAllCachedOrderHistory() { return cachedOrderList; } private OrderRepository(@NonNull final BlockchainSource blockchainSource, @NonNull final EventLogger eventLogger, @NonNull final OrderDataSource.Remote remoteData, @NonNull final Orde...
assertNull(orderRepository.getAllCachedOrderHistory()); } }
[FOCAL] public OrderList OrderRepository.getAllCachedOrderHistory() [CLASS] class OrderRepository implements OrderDataSource [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] OrderRepository(BlockchainSource blockchainSource, EventLogger eventLogger, OrderDataSource.Remote remoteData,...
/* static context [FOCAL] public OrderList OrderRepository.getAllCachedOrderHistory() */
/* static context [FOCAL] public OrderList OrderRepository.getAllCachedOrderHistory() */ class OrderRepository implements OrderDataSource { public OrderList getAllCachedOrderHistory() { return cachedOrderList; } private OrderRepository(@NonNull final BlockchainSource blockchainSource, @NonNull final EventLogg...
true
ok
{"focal": {"class": "OrderRepository", "name": "getAllCachedOrderHistory", "signature": "OrderList getAllCachedOrderHistory()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "OrderList"}, "class_info": {"name": "OrderRepository", "kind": "class", "modifiers": "", "superclass": null, "interfaces":...
142763963_24
class RiceCompression { public List<Integer> decompress(int riceParameter, byte[] data) { BitSet bits = new BitSet(data.length * 8); for (int i = 0; i < data.length; i++) { BitSet bitsOfByte = BitSet.valueOf(makeArrayOfByte(data[i])); for (int j = 0; j < bitsOfByte.size(); ...
byte[] bytes = Base64.getDecoder().decode(data1); List<Integer> ls = riceCompression.decompress(parameter, bytes); Assert.assertEquals(336, ls.size()); } }
[FOCAL] public List<Integer> RiceCompression.decompress(int riceParameter, byte[] data) [CLASS] class RiceCompression [METRICS] loc=38 cc=9 branches=2 loops=6 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] byte[] makeArrayOfByte(byte byteVal) [CALLS-EXTERNAL] BitSet.valueOf/1, BitSet.size/0, BitSet.set/2, BitSet.get/1, ...
/* static context [FOCAL] public List<Integer> RiceCompression.decompress(int riceParameter, byte[] data) [PATH1] for(i < data.length)=T -> for(j < bitsOfByte.size())=F -> exit loop -> for(n < bits.size())=T -> while(bits.get(n++))=F -> for(i < range.size())=T -> if(range.get(i))=T -> exit loop -> exit loop -> for(i >=...
/* static context [FOCAL] public List<Integer> RiceCompression.decompress(int riceParameter, byte[] data) [PATH1] for(i < data.length)=T -> for(j < bitsOfByte.size())=F -> exit loop -> for(n < bits.size())=T -> while(bits.get(n++))=F -> for(i < range.size())=T -> if(range.get(i))=T -> exit loop -> exit loop -> for(i >=...
true
ok
{"focal": {"class": "RiceCompression", "name": "decompress", "signature": "List<Integer> decompress(int riceParameter, byte[] data)", "start_line": 3, "modifiers": "public", "params": [{"name": "riceParameter", "type": "int"}, {"name": "data", "type": "byte[]"}], "return_type": "List<Integer>"}, "class_info": {"name": ...
143078890_1
class TableReporter { static void processRowResult(Result result, Sketches sketches) { // System.out.println(result.toString()); long rowSize = 0; int columnCount = 0; for (Cell cell : result.rawCells()) { rowSize += estimatedSizeOfCell(cell); columnCount += 1; } sketches.rowSizeS...
TableReporter.Sketches sketches = new TableReporter.Sketches(); final int rows = 10; final int columns = 3; final int versions = 2; for (int i = 0; i < rows; i++) { TableReporter.processRowResult(Result.create(makeCells(Bytes.toBytes(i), columns, versions)), sketches); } sketches.print...
[FOCAL] static void TableReporter.processRowResult(Result result, Sketches sketches) [CLASS] class TableReporter [METRICS] loc=11 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] long estimatedSizeOfCell(Cell cell) [CALLS-EXTERNAL] Result.rawCells/0, sketches.rowSizeSketch.update/1, sketches.column...
/* static context [FOCAL] static void TableReporter.processRowResult(Result result, Sketches sketches) [PATH1] foreach(Cell cell : result.rawCells())=T -> exit loop [PATH2] foreach(Cell cell : result.rawCells())=F [INPUTS] branches=result | result=- [COLLABORATORS] param result:Result rawCells/0 [CALLS-INTERNAL] long e...
/* static context [FOCAL] static void TableReporter.processRowResult(Result result, Sketches sketches) [PATH1] foreach(Cell cell : result.rawCells())=T -> exit loop [PATH2] foreach(Cell cell : result.rawCells())=F [INPUTS] branches=result | result=- [COLLABORATORS] param result:Result rawCells/0 [CALLS-INTERNAL] long e...
true
ok
{"focal": {"class": "TableReporter", "name": "processRowResult", "signature": "void processRowResult(Result result, Sketches sketches)", "start_line": 3, "modifiers": "static", "params": [{"name": "result", "type": "Result"}, {"name": "sketches", "type": "Sketches"}], "return_type": "void"}, "class_info": {"name": "Tab...
143127772_1
class JdbcBatchLoader extends BaseJdbcLoader { @Override public void sort(ETLBucket bucket) { bucket.getParallelRows().addAll(batchGroup(bucket.getRows())); } @Override protected String getPluginName(); @Override public Pair<Boolean, List<DSubmitStatObject>> doLoad(ETLBucket bucket); } c...
List<ETLRow> rows = new ArrayList<>(); rows.add(new ETLRow(0, 0, "s", "t", MessageAction.DELETE, null, null, null)); rows.add(new ETLRow(0, 0, "s", "t", MessageAction.DELETE, null, null, null)); rows.add(new ETLRow(0, 0, "s", "t", MessageAction.INSERT, null, null, null)); rows.ad...
[FOCAL] @Override public void JdbcBatchLoader.sort(ETLBucket bucket) [CLASS] class JdbcBatchLoader extends BaseJdbcLoader [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] bucket.getParallelRows().addAll/1, ETLBucket.getParallelRows/0, batchGroup/1 (inherited), ETLBucket.getRows/0 [C...
/* static context [FOCAL] @Override public void JdbcBatchLoader.sort(ETLBucket bucket) [COLLABORATORS] param bucket:ETLBucket getParallelRows/0,getRows/0 [CALLS-EXTERNAL] bucket.getParallelRows().addAll/1, ETLBucket.getParallelRows/0, batchGroup/1 (inherited), ETLBucket.getRows/0 */
/* static context [FOCAL] @Override public void JdbcBatchLoader.sort(ETLBucket bucket) [COLLABORATORS] param bucket:ETLBucket getParallelRows/0,getRows/0 [CALLS-EXTERNAL] bucket.getParallelRows().addAll/1, ETLBucket.getParallelRows/0, batchGroup/1 (inherited), ETLBucket.getRows/0 */ class JdbcBatchLoader extends BaseJd...
true
ok
{"focal": {"class": "JdbcBatchLoader", "name": "sort", "signature": "void sort(ETLBucket bucket)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "bucket", "type": "ETLBucket"}], "return_type": "void"}, "class_info": {"name": "JdbcBatchLoader", "kind": "class", "modifiers": "", "superclass": "Bas...
143152220_23
class ControllerModel { public boolean match(String route) { for (String originalRoute : this.originalRoute) { if (this.matchShell(originalRoute, route)) { String routeWithoutShell = this.getRouteWithoutShell(originalRoute); String startRouteWithoutShell = thi...
ControllerModel cm = this.getControllerModelForMatchingTest("/*/route01/:parameter", "route01"); Assertions.assertFalse(cm.match("shell01/route02")); } }
[FOCAL] public boolean ControllerModel.match(String route) [CLASS] class ControllerModel [METRICS] loc=13 cc=4 branches=2 loops=1 returns=2 throws=0 nesting=3 [CALLS-INTERNAL] String getRouteWithoutShell(String route); boolean matchShell(String originalRoute, String route) [CALLS-EXTERNAL] String.equals/1 [FIELDS] read...
/* static context [FOCAL] public boolean ControllerModel.match(String route) [PATH1] foreach(String originalRoute : this.originalRoute)=T -> if(this.matchShell(originalRoute, route))=T -> if(routeWithoutShell.equals(startRouteWithoutShell))=F -> exit loop -> return false [PATH2] foreach(String originalRoute : this.orig...
/* static context [FOCAL] public boolean ControllerModel.match(String route) [PATH1] foreach(String originalRoute : this.originalRoute)=T -> if(this.matchShell(originalRoute, route))=T -> if(routeWithoutShell.equals(startRouteWithoutShell))=F -> exit loop -> return false [PATH2] foreach(String originalRoute : this.orig...
true
ok
{"focal": {"class": "ControllerModel", "name": "match", "signature": "boolean match(String route)", "start_line": 3, "modifiers": "public", "params": [{"name": "route", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "ControllerModel", "kind": "class", "modifiers": "", "superclass": null, "interfa...
143201223_37
class Time { public static org.joda.time.Duration parseDuration(String value) { return parseJodaDuration(value); } public static ValueProvider<org.joda.time.Duration> parseDuration(ValueProvider<String> value); public static long parseSeconds(String value); public static ValueProvider<Long> parseSeconds...
assertEquals(Time.parseDuration("5.5 seconds").getMillis(), 5500L); assertEquals(Time.parseDuration("5.5 SECONDS").getMillis(), 5500L); assertEquals(Time.parseDuration("1 hour").getMillis(), HOURS.toMillis(1)); assertEquals(Time.parseDuration("2 days").getMillis(), DAYS.toMillis(2)); assertEquals(Ti...
[FOCAL] public static org.joda.time.Duration Time.parseDuration(String value) [CLASS] class Time [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] org.joda.time.Duration parseJodaDuration(String value) [INPUTS] branches=- | result=value [DATAFLOW] value@param->L2 [CLASS-MEMBERS] Valu...
/* static context [FOCAL] public static org.joda.time.Duration Time.parseDuration(String value) [INPUTS] branches=- | result=value [CALLS-INTERNAL] org.joda.time.Duration parseJodaDuration(String value) */
/* static context [FOCAL] public static org.joda.time.Duration Time.parseDuration(String value) [INPUTS] branches=- | result=value [CALLS-INTERNAL] org.joda.time.Duration parseJodaDuration(String value) */ class Time { public static org.joda.time.Duration parseDuration(String value) { return parseJodaDuration(va...
true
ok
{"focal": {"class": "Time", "name": "parseDuration", "signature": "org.joda.time.Duration parseDuration(String value)", "start_line": 3, "modifiers": "public static", "params": [{"name": "value", "type": "String"}], "return_type": "org.joda.time.Duration"}, "class_info": {"name": "Time", "kind": "class", "modifiers": "...
143267111_2
class PolicyQueryResultAssembler { static FindPolicyQueryResult constructResult(List<PolicyView> policies) { return new FindPolicyQueryResult( policies.stream() .map(PolicyListItemDtoAssembler::map) .sorted(Comparator.comparing(PolicyListItemD...
PolicyQueryResultAssembler assembler = new PolicyQueryResultAssembler(); List<PolicyView> policies = new ArrayList<>(Arrays.asList( new PolicyView("1", LocalDate.of(2015,11,1), LocalDate.of(2016,10,30), "Tom Hanks"), new PolicyView("2", null, null, "Alanis Morissette"), ...
[FOCAL] static FindPolicyQueryResult PolicyQueryResultAssembler.constructResult(List<PolicyView> policies) [CLASS] class PolicyQueryResultAssembler [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] policies.stream() .map(PolicyListItemDtoAssembler::map) .....collect/1, policies.strea...
/* static context [FOCAL] static FindPolicyQueryResult PolicyQueryResultAssembler.constructResult(List<PolicyView> policies) [INPUTS] branches=- | result=policies [COLLABORATORS] param policies:List<PolicyView> stream/0 [NEW] FindPolicyQueryResult [CALLS-EXTERNAL] policies.stream() .map(PolicyListItemDtoAssembler::map)...
/* static context [FOCAL] static FindPolicyQueryResult PolicyQueryResultAssembler.constructResult(List<PolicyView> policies) [INPUTS] branches=- | result=policies [COLLABORATORS] param policies:List<PolicyView> stream/0 [NEW] FindPolicyQueryResult [CALLS-EXTERNAL] policies.stream() .map(PolicyListItemDtoAssembler::map)...
true
ok
{"focal": {"class": "PolicyQueryResultAssembler", "name": "constructResult", "signature": "FindPolicyQueryResult constructResult(List<PolicyView> policies)", "start_line": 3, "modifiers": "static", "params": [{"name": "policies", "type": "List<PolicyView>"}], "return_type": "FindPolicyQueryResult"}, "class_info": {"nam...
143269609_0
class GetReposUseCase extends BaseUseCase { public Flowable<List<Repos>> get(ReposParam param) { return reposRepository .all(param) .subscribeOn(executionThread) .observeOn(postExecutionThread); } @Inject public GetReposUseCase(ReposRepository userR...
ReposParam param = new ReposParam("testName"); List<Repos> listData = new ArrayList<>(); listData.add(new Repos("1", "repos test name", "repos test full name")); listData.add(new Repos("2", "repos test name 2", "repos test full name 2")); when(reposRepository.all(param)).thenR...
[FOCAL] public Flowable<List<Repos>> GetReposUseCase.get(ReposParam param) [CLASS] class GetReposUseCase extends BaseUseCase [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] reposRepository .all(param) .subscribeOn(executionThread).observeOn/1, reposRepository .all(param).subscribeO...
/* static context [FOCAL] public Flowable<List<Repos>> GetReposUseCase.get(ReposParam param) [INPUTS] branches=- | result=param, reposRepository [COLLABORATORS] field reposRepository:ReposRepository all/1 [FIELDS] read=reposRepository:ReposRepository [CALLS-EXTERNAL] reposRepository .all(param) .subscribeOn(executionTh...
/* static context [FOCAL] public Flowable<List<Repos>> GetReposUseCase.get(ReposParam param) [INPUTS] branches=- | result=param, reposRepository [COLLABORATORS] field reposRepository:ReposRepository all/1 [FIELDS] read=reposRepository:ReposRepository [CALLS-EXTERNAL] reposRepository .all(param) .subscribeOn(executionTh...
true
ok
{"focal": {"class": "GetReposUseCase", "name": "get", "signature": "Flowable<List<Repos>> get(ReposParam param)", "start_line": 3, "modifiers": "public", "params": [{"name": "param", "type": "ReposParam"}], "return_type": "Flowable<List<Repos>>"}, "class_info": {"name": "GetReposUseCase", "kind": "class", "modifiers": ...
143681096_3
class CEKRequestSignatureVerifier implements CEKRequestVerifier { @Override public void verify(HttpServletRequest request, CEKRequestMessage requestMessage, String requestJson, SystemContext system) { String baseEncoded64Signature = request.getHeader(CLOVA_SIGNATURE_REQUEST_HEADE...
doCallRealMethod().when(advice).handle(captor.capture()); String body = CEKRequestGenerator.requestBodyBuilder("data/signature_test_request.json", objectMapper) .customize(bindIntentRequest()) ...
[FOCAL] @Override public void CEKRequestSignatureVerifier.verify(HttpServletRequest request, CEKRequestMessage requestMessage, String requestJson, SystemContext system) [CLASS] class CEKRequestSignatureVerifier implements CEKRequestVerifier [METRICS] loc=22 cc=4 branches=2 loops=0 returns=1 throws=3 nesting=2 [CALLS-EX...
/* static context [FOCAL] @Override public void CEKRequestSignatureVerifier.verify(HttpServletRequest request, CEKRequestMessage requestMessage, String requestJson, SystemContext system) [THROWS-WHEN] SecurityException when StringUtils.isBlank(baseEncoded64Signature) [THROWS-WHEN] SecurityException when !StringUtils.is...
/* static context [FOCAL] @Override public void CEKRequestSignatureVerifier.verify(HttpServletRequest request, CEKRequestMessage requestMessage, String requestJson, SystemContext system) [THROWS-WHEN] SecurityException when StringUtils.isBlank(baseEncoded64Signature) [THROWS-WHEN] SecurityException when !StringUtils.is...
true
ok
{"focal": {"class": "CEKRequestSignatureVerifier", "name": "verify", "signature": "void verify(HttpServletRequest request, CEKRequestMessage requestMessage, String requestJson, SystemContext system)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "HttpServletRequest"}, {"name"...
143691055_0
class MaxTemperatureDriver extends Configured implements Tool { public int run(String[] args) throws Exception { if (args.length != 2) { System.err.printf("Usage: %s [generic options] <input> <output>\n", getClass().getSimpleName()); ToolRunner.printGenericCommandUsage(System.err); ...
Configuration conf = new Configuration(); //根据编辑好的xml配置文件创建Configuration实例 conf.set("fs.defaultFS", "file:///"); //设置文件系统为本地文件系统 conf.set("mapreduce.framework.name", "local"); //设置为使用本地作业运行器 conf.setInt("mapreduce.task.io.sort.mb", 1); //设置mapreduce中间输出使用环形缓冲区缓存在本地内存的大小,默认为100M ...
[FOCAL] public int MaxTemperatureDriver.run(String[] args) [CLASS] class MaxTemperatureDriver extends Configured implements Tool [METRICS] loc=22 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] System.err.printf/2, getClass().getSimpleName/0, getClass/0 (inherited), ToolRunner.printGenericCommandU...
/* static context [FOCAL] public int MaxTemperatureDriver.run(String[] args) [PATH1] if(args.length != 2)=T -> return -1 [PATH2] if(args.length != 2)=F -> return job.waitForCompletion(true) ? 0 : 1 [INPUTS] branches=args | result=- [EXCEPTIONS] declares Exception [NEW] Job, Path [CALLS-EXTERNAL] System.err.printf/2, ge...
/* static context [FOCAL] public int MaxTemperatureDriver.run(String[] args) [PATH1] if(args.length != 2)=T -> return -1 [PATH2] if(args.length != 2)=F -> return job.waitForCompletion(true) ? 0 : 1 [INPUTS] branches=args | result=- [EXCEPTIONS] declares Exception [NEW] Job, Path [CALLS-EXTERNAL] System.err.printf/2, ge...
true
ok
{"focal": {"class": "MaxTemperatureDriver", "name": "run", "signature": "int run(String[] args) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "args", "type": "String[]"}], "return_type": "int"}, "class_info": {"name": "MaxTemperatureDriver", "kind": "class", "modifiers": "", "superclass...
143692325_7
class CustomerService { public void savePreferredNotificationChannels(Customer customer, List<NotificationType> notificationChannels) { customer.setPreferredNotificationChannels(notificationChannels); customerRepository.save(customer); } public CustomerService(CustomerRepository customerR...
NotificationType channelOne = NotificationType.EMAIL; NotificationType channelTwo = NotificationType.FAX; CustomerRepository customerRepository = Mockito.mock(CustomerRepository.class); CustomerService customerService = new CustomerService(customerRepository); List<NotificationTy...
[FOCAL] public void CustomerService.savePreferredNotificationChannels(Customer customer, List<NotificationType> notificationChannels) [CLASS] class CustomerService [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] Customer.setPreferredNotificationChannels/1, customerRepository.save/1...
/* static context [FOCAL] public void CustomerService.savePreferredNotificationChannels(Customer customer, List<NotificationType> notificationChannels) [COLLABORATORS] param customer:Customer setPreferredNotificationChannels/1; field customerRepository save/1 [CALLS-EXTERNAL] Customer.setPreferredNotificationChannels/1...
/* static context [FOCAL] public void CustomerService.savePreferredNotificationChannels(Customer customer, List<NotificationType> notificationChannels) [COLLABORATORS] param customer:Customer setPreferredNotificationChannels/1; field customerRepository save/1 [CALLS-EXTERNAL] Customer.setPreferredNotificationChannels/1...
true
ok
{"focal": {"class": "CustomerService", "name": "savePreferredNotificationChannels", "signature": "void savePreferredNotificationChannels(Customer customer, List<NotificationType> notificationChannels)", "start_line": 3, "modifiers": "public", "params": [{"name": "customer", "type": "Customer"}, {"name": "notificationCh...
143705035_67
class ServerFactory { public static Server create(String serverType) throws EtiqetException { Server instance; try { instance = (Server) Class.forName(serverType).newInstance(); } catch (Exception e) { LOG.error(ERROR_CREATING_SERVER + serverType, e); thr...
String serverClassName = "com.neueda.etiqet.core.testing.FakeTestServer"; String configFile = "etiqet-core/src/test/resources/properties/testDefaultServer.properties"; String extraConfig = "src/test/resources/properties/test.properties"; try { Server server = ServerFactory.cr...
[FOCAL] public static Server ServerFactory.create(String serverType) [CLASS] class ServerFactory [METRICS] loc=10 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] Class.forName(serverType).newInstance/0, Class.forName/1, LOG.error/2 [NEW] EtiqetException [EXCEPTIONS] declares EtiqetException; throw...
/* static context [FOCAL] public static Server ServerFactory.create(String serverType) [THROWS-WHEN] EtiqetException when try-body throws [PATH1] try-body throws -> throw new EtiqetException(ERROR_CREATING_SERVER + serverType, e) [PATH2] return instance [INPUTS] branches=- | result=serverType [EXCEPTIONS] declares Etiq...
/* static context [FOCAL] public static Server ServerFactory.create(String serverType) [THROWS-WHEN] EtiqetException when try-body throws [PATH1] try-body throws -> throw new EtiqetException(ERROR_CREATING_SERVER + serverType, e) [PATH2] return instance [INPUTS] branches=- | result=serverType [EXCEPTIONS] declares Etiq...
true
ok
{"focal": {"class": "ServerFactory", "name": "create", "signature": "Server create(String serverType) throws EtiqetException", "start_line": 3, "modifiers": "public static", "params": [{"name": "serverType", "type": "String"}], "return_type": "Server"}, "class_info": {"name": "ServerFactory", "kind": "class", "modifier...
143836525_16
class AuthenticationService implements IAuthenticationService { public ConfigAttribute findConfigAttributesByUrl(HttpServletRequest authRequest) { return this.resourceConfigAttributes.keySet().stream() .filter(requestMatcher -> requestMatcher.matches(authRequest)) .map(reque...
AuthenticationService authenticationService = new AuthenticationService(this.resourceConfigAttributes); ConfigAttribute attributesByUrl = authenticationService .findConfigAttributesByUrl(new HttpServletRequestAuthWrapper(new MockHttpServletRequest(), "/users/1/order", "POST")); A...
[FOCAL] public ConfigAttribute AuthenticationService.findConfigAttributesByUrl(HttpServletRequest authRequest) [CLASS] class AuthenticationService implements IAuthenticationService [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] this.resourceConfigAttributes.keySet().stream() .filt...
/* static context [FOCAL] public ConfigAttribute AuthenticationService.findConfigAttributesByUrl(HttpServletRequest authRequest) [INPUTS] branches=- | result=authRequest, resourceConfigAttributes [COLLABORATORS] field resourceConfigAttributes:Map<RequestMatcher, ConfigAttribute> keySet/0,get/1; field requestMatcher mat...
/* static context [FOCAL] public ConfigAttribute AuthenticationService.findConfigAttributesByUrl(HttpServletRequest authRequest) [INPUTS] branches=- | result=authRequest, resourceConfigAttributes [COLLABORATORS] field resourceConfigAttributes:Map<RequestMatcher, ConfigAttribute> keySet/0,get/1; field requestMatcher mat...
true
ok
{"focal": {"class": "AuthenticationService", "name": "findConfigAttributesByUrl", "signature": "ConfigAttribute findConfigAttributesByUrl(HttpServletRequest authRequest)", "start_line": 3, "modifiers": "public", "params": [{"name": "authRequest", "type": "HttpServletRequest"}], "return_type": "ConfigAttribute"}, "class...
143847547_7
class UiInstanceService { public UiResponse findByInstanceId(HttpServletRequest request, String instanceId) { Map<String, AppEntity> appMap=appService.getCacheData(); UiResponse uiResponse = new UiResponse(); Long count; List<CombinedInstanceDto> instanceList; count = uiInst...
RegisterInstanceRequest registerInstanceRequest = RegisterInstanceUtil.setRegisterInstanceRequest(); RegisterInstanceResponse response = instanceService.registerInstance(registerInstanceRequest); Thread.sleep(2 * 1000); InstanceEntity testInstanceEntity = RegisterInstanceUtil.createTestI...
[FOCAL] public UiResponse UiInstanceService.findByInstanceId(HttpServletRequest request, String instanceId) [CLASS] class UiInstanceService [METRICS] loc=15 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] void setFinalStatus(CombinedInstanceDto combinedInstanceDto) [CALLS-EXTERNAL] appService.getC...
/* static context [FOCAL] public UiResponse UiInstanceService.findByInstanceId(HttpServletRequest request, String instanceId) [PATH1] foreach(CombinedInstanceDto combinedInstanceDto : instanceList)=T -> exit loop -> return UiResponseHelper.setUiResponse(uiResponse, count, instanceList) [PATH2] foreach(CombinedInstanceD...
/* static context [FOCAL] public UiResponse UiInstanceService.findByInstanceId(HttpServletRequest request, String instanceId) [PATH1] foreach(CombinedInstanceDto combinedInstanceDto : instanceList)=T -> exit loop -> return UiResponseHelper.setUiResponse(uiResponse, count, instanceList) [PATH2] foreach(CombinedInstanceD...
true
ok
{"focal": {"class": "UiInstanceService", "name": "findByInstanceId", "signature": "UiResponse findByInstanceId(HttpServletRequest request, String instanceId)", "start_line": 3, "modifiers": "public", "params": [{"name": "request", "type": "HttpServletRequest"}, {"name": "instanceId", "type": "String"}], "return_type": ...
143854187_2
class RpcValue implements RpcItem { @Override public BigInteger asInteger() { if (!(value.startsWith(HEX_PREFIX) || value.startsWith('-' + HEX_PREFIX))) { throw new RpcValueException("The value is not hex string."); } try { String sign = ""; if (valu...
assertThrows(RpcValueException.class, plainStringValue::asInteger); assertEquals(new BigInteger("0102030405", 16), bytesValue.asInteger()); assertEquals(new BigInteger("1234"), oddIntegerValue.asInteger()); assertEquals(new BigInteger("61731"), evenIntegerValue.asInteger()); asse...
[FOCAL] @Override public BigInteger RpcValue.asInteger() [CLASS] class RpcValue implements RpcItem [METRICS] loc=18 cc=4 branches=2 loops=0 returns=1 throws=2 nesting=2 [CALLS-EXTERNAL] value.startsWith/1, value.charAt/1, value.substring/2, value.substring/1, Bytes.cleanHexPrefix/1 [NEW] RpcValueException, BigInteger [...
/* static context [FOCAL] @Override public BigInteger RpcValue.asInteger() [THROWS-WHEN] RpcValueException when !(value.startsWith(HEX_PREFIX) || value.startsWith('-' + HEX_PREFIX)) [THROWS-WHEN] RpcValueException when !(!(value.startsWith(HEX_PREFIX) || value.startsWith('-' + HEX_PREFIX))) && try-body throws [PATH1] i...
/* static context [FOCAL] @Override public BigInteger RpcValue.asInteger() [THROWS-WHEN] RpcValueException when !(value.startsWith(HEX_PREFIX) || value.startsWith('-' + HEX_PREFIX)) [THROWS-WHEN] RpcValueException when !(!(value.startsWith(HEX_PREFIX) || value.startsWith('-' + HEX_PREFIX))) && try-body throws [PATH1] i...
true
ok
{"focal": {"class": "RpcValue", "name": "asInteger", "signature": "BigInteger asInteger()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "BigInteger"}, "class_info": {"name": "RpcValue", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "RpcItem", "fields": [{"name": ...
143965831_7
class VoiceCallEngine { public void useSpeaker() { mRtcEngine.setEnableSpeakerphone(true); } private VoiceCallEngine(); public static VoiceCallEngine getInstance(); public RtcEngine getmRtcEngine(); public void joinChannel(String channelID, EventHandler handler); public void leav...
VoiceCallEngine.getInstance().useSpeaker(); verify(VoiceCallEngine.getInstance().getmRtcEngine(), times(1)).setEnableSpeakerphone(true); } }
[FOCAL] public void VoiceCallEngine.useSpeaker() [CLASS] class VoiceCallEngine [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] RtcEngine.setEnableSpeakerphone/1 [FIELDS] read=mRtcEngine:RtcEngine [COLLABORATORS] field mRtcEngine:RtcEngine setEnableSpeakerphone/1 [DATAFLOW] this.mRt...
/* static context [FOCAL] public void VoiceCallEngine.useSpeaker() [COLLABORATORS] field mRtcEngine:RtcEngine setEnableSpeakerphone/1 [FIELDS] read=mRtcEngine:RtcEngine [CALLS-EXTERNAL] RtcEngine.setEnableSpeakerphone/1 */
/* static context [FOCAL] public void VoiceCallEngine.useSpeaker() [COLLABORATORS] field mRtcEngine:RtcEngine setEnableSpeakerphone/1 [FIELDS] read=mRtcEngine:RtcEngine [CALLS-EXTERNAL] RtcEngine.setEnableSpeakerphone/1 */ class VoiceCallEngine { public void useSpeaker() { mRtcEngine.setEnableSpeakerphone(...
true
ok
{"focal": {"class": "VoiceCallEngine", "name": "useSpeaker", "signature": "void useSpeaker()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "VoiceCallEngine", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "mNaviBeeAp...
144020195_62
class StreamingIngestClient implements IngestClient { @Override public IngestionResult ingestFromStream(StreamSourceInfo streamSourceInfo, IngestionProperties ingestionProperties) throws IngestionClientException, IngestionServiceException { Ensure.argIsNotNull(streamSourceInfo, "streamSourceInfo"); ...
InputStream inputStream = new ByteArrayInputStream(new byte[10]); StreamSourceInfo streamSourceInfo = new StreamSourceInfo(inputStream); ingestionProperties.setDataFormat(IngestionProperties.DATA_FORMAT.avro); ingestionProperties.setIngestionMapping("CsvMapping", IngestionMapping.Ingesti...
[FOCAL] @Override public IngestionResult StreamingIngestClient.ingestFromStream(StreamSourceInfo streamSourceInfo, IngestionProperties ingestionProperties) [CLASS] class StreamingIngestClient implements IngestClient [METRICS] loc=36 cc=3 branches=0 loops=0 returns=1 throws=2 nesting=1 [CALLS-INTERNAL] InputStream compr...
/* static context [FOCAL] @Override public IngestionResult StreamingIngestClient.ingestFromStream(StreamSourceInfo streamSourceInfo, IngestionProperties ingestionProperties) [THROWS-WHEN] IngestionClientException when try-body throws [THROWS-WHEN] IngestionServiceException when try-body throws [PATH1] try-body throws -...
/* static context [FOCAL] @Override public IngestionResult StreamingIngestClient.ingestFromStream(StreamSourceInfo streamSourceInfo, IngestionProperties ingestionProperties) [THROWS-WHEN] IngestionClientException when try-body throws [THROWS-WHEN] IngestionServiceException when try-body throws [PATH1] try-body throws -...
true
ok
{"focal": {"class": "StreamingIngestClient", "name": "ingestFromStream", "signature": "IngestionResult ingestFromStream(StreamSourceInfo streamSourceInfo, IngestionProperties ingestionProperties) throws IngestionClientException, IngestionServiceException", "start_line": 3, "modifiers": "@Override public", "params": [{"...
144143524_29
class MutableKeySet extends AbstractKeySet<K> { @Override public Iterator<K> iterator() { return new Iterator<>() { private final AbstractIterator<K, ?> itr = map().iterator(); @Override public boolean hasNext() { return itr.hasNext(); } ...
final Iterator<String> it = set.iterator(); assertTrue(it.hasNext()); assertEquals(KEY, it.next()); assertFalse(it.hasNext()); } }
[FOCAL] @Override public Iterator<K> MutableKeySet.iterator() [CLASS] class MutableKeySet extends AbstractKeySet<K> [METRICS] loc=21 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] map().iterator/0, map/0 (inherited), itr.hasNext/0, itr.next().getKey/0, itr.next/0, itr.remove/0 [NEW] Iterator<> [C...
/* static context [FOCAL] @Override public Iterator<K> MutableKeySet.iterator() [COLLABORATORS] field itr hasNext/0,next/0,remove/0 [NEW] Iterator<> [CALLS-EXTERNAL] map().iterator/0, map/0 (inherited), itr.hasNext/0, itr.next().getKey/0, itr.next/0, itr.remove/0 */
/* static context [FOCAL] @Override public Iterator<K> MutableKeySet.iterator() [COLLABORATORS] field itr hasNext/0,next/0,remove/0 [NEW] Iterator<> [CALLS-EXTERNAL] map().iterator/0, map/0 (inherited), itr.hasNext/0, itr.next().getKey/0, itr.next/0, itr.remove/0 */ class MutableKeySet extends AbstractKeySet<K> { ...
true
ok
{"focal": {"class": "MutableKeySet", "name": "iterator", "signature": "Iterator<K> iterator()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Iterator<K>"}, "class_info": {"name": "MutableKeySet", "kind": "class", "modifiers": "", "superclass": "AbstractKeySet<K>", "interfaces": null, ...
144361208_1
class BeanNameAspect { public int getCalled() { return called; } @Around("mypointcuts.MyPointcuts.beanNamePointcut()") public void trace(ProceedingJoinPoint proceedingJP); public void resetCalled(); @Autowired BeanNameAspect beanNameAspect; @Autowired SimpleService simpleService; @Autowired SimpleRepository...
assertThat(beanNameAspect.getCalled(), is(0)); simpleRepository.doSomething(); assertThat(beanNameAspect.getCalled(), is(0)); } }
[FOCAL] public int BeanNameAspect.getCalled() [CLASS] class BeanNameAspect [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] void trace(ProceedingJoinPoint proceedingJP); void resetCalled() [TEST] BeanNameAspectTest: @Test public void tracingOnRepsositoryIsNotCalled() [TEST-FIELDS] Be...
/* static context [FOCAL] public int BeanNameAspect.getCalled() */
/* static context [FOCAL] public int BeanNameAspect.getCalled() */ class BeanNameAspect { public int getCalled() { return called; } @Around("mypointcuts.MyPointcuts.beanNamePointcut()") public void trace(ProceedingJoinPoint proceedingJP); public void resetCalled(); @Autowired BeanNameAspect beanNameAspect; @...
true
ok
{"focal": {"class": "BeanNameAspect", "name": "getCalled", "signature": "int getCalled()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "BeanNameAspect", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "beanNameAspect",...
144435698_5
class OrganizationEntity extends EventSourced implements Organization { @Override public Completes<OrganizationState> renameTo(final String name) { return apply(new OrganizationRenamed(state.organizationId, name), () -> state); } public OrganizationEntity(final Id organizationId); public OrganizationE...
final OrganizationState state = Organization.sourcedWith(grid, DefaultName, DefaultDescription) .andThenTo(s -> grid.actorOf(Organization.class, address(s.id()))) .andThenTo(organization -> organization.renameTo(DefaultName + 1)) .await(); Assert.assertEqua...
[FOCAL] @Override public Completes<OrganizationState> OrganizationEntity.renameTo(String name) [CLASS] class OrganizationEntity extends EventSourced implements Organization [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] apply/2 (inherited) [NEW] OrganizationRenamed [INPUTS] branch...
/* static context [FOCAL] @Override public Completes<OrganizationState> OrganizationEntity.renameTo(String name) [INPUTS] branches=- | result=name [NEW] OrganizationRenamed [CALLS-EXTERNAL] apply/2 (inherited) */
/* static context [FOCAL] @Override public Completes<OrganizationState> OrganizationEntity.renameTo(String name) [INPUTS] branches=- | result=name [NEW] OrganizationRenamed [CALLS-EXTERNAL] apply/2 (inherited) */ class OrganizationEntity extends EventSourced implements Organization { @Override public Completes<Org...
true
ok
{"focal": {"class": "OrganizationEntity", "name": "renameTo", "signature": "Completes<OrganizationState> renameTo(String name)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "name", "type": "String"}], "return_type": "Completes<OrganizationState>"}, "class_info": {"name": "OrganizationEntity", ...
144561165_1
class UserController { @RequestMapping("/save") public boolean save() { boolean result = false; User user = new User(); user.setName("Adam"); user.setAge(19); user.setCtime(new Date().getTime()); user.setPwd("123456"); userRepository.save(user); r...
User user = new User(); user.setName("Adam"); user.setAge(19); user.setPwd("123456"); userRepository.save(user); System.out.println("userId:" + user.getId()); Assert.assertTrue(user.getId()>0); } }
[FOCAL] @RequestMapping("/save") public boolean UserController.save() [CLASS] class UserController [METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] User.setName/1, User.setAge/1, User.setCtime/1, new Date().getTime/0, User.setPwd/1, UserRepository.save/1, User.getId/0, System.out.p...
/* static context [FOCAL] @RequestMapping("/save") public boolean UserController.save() [COLLABORATORS] field userRepository:UserRepository save/1 [FIELDS] read=userRepository:UserRepository [NEW] User, Date [CALLS-EXTERNAL] User.setName/1, User.setAge/1, User.setCtime/1, new Date().getTime/0, User.setPwd/1, UserReposi...
/* static context [FOCAL] @RequestMapping("/save") public boolean UserController.save() [COLLABORATORS] field userRepository:UserRepository save/1 [FIELDS] read=userRepository:UserRepository [NEW] User, Date [CALLS-EXTERNAL] User.setName/1, User.setAge/1, User.setCtime/1, new Date().getTime/0, User.setPwd/1, UserReposi...
true
ok
{"focal": {"class": "UserController", "name": "save", "signature": "boolean save()", "start_line": 3, "modifiers": "@RequestMapping(\"/save\") public", "params": [], "return_type": "boolean"}, "class_info": {"name": "UserController", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{...
144737388_0
class Main extends AllDirectives { public Flow<String, String, NotUsed> addIndexFlow() { final Pair<Integer, String> seed = Pair.create(0, "start"); return Flow.of(String.class) .scan(seed, (acc, message) -> { Integer index = acc.first(); ...
final Main example = new Main(new Helper()); List<String> messages = Arrays.asList( "I say high, you say low", "You say why and I say I don't know", "Oh, no", "You say goodbye and I say hello" ); final Flow<String, String,...
[FOCAL] public Flow<String, String, NotUsed> Main.addIndexFlow() [CLASS] class Main extends AllDirectives [METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Pair.create/2, Flow.of(String.class) .scan(seed, (acc, message) -> { Int....map/1, Flow.of(String.class) .scan(seed, (acc, mess...
/* static context [FOCAL] public Flow<String, String, NotUsed> Main.addIndexFlow() [COLLABORATORS] field acc first/0 [CALLS-EXTERNAL] Pair.create/2, Flow.of(String.class) .scan(seed, (acc, message) -> { Int....map/1, Flow.of(String.class) .scan(seed, (acc, message) -> { Int....filterNot/1, Flow.of(String.class).scan/2,...
/* static context [FOCAL] public Flow<String, String, NotUsed> Main.addIndexFlow() [COLLABORATORS] field acc first/0 [CALLS-EXTERNAL] Pair.create/2, Flow.of(String.class) .scan(seed, (acc, message) -> { Int....map/1, Flow.of(String.class) .scan(seed, (acc, message) -> { Int....filterNot/1, Flow.of(String.class).scan/2,...
true
ok
{"focal": {"class": "Main", "name": "addIndexFlow", "signature": "Flow<String, String, NotUsed> addIndexFlow()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Flow<String, String, NotUsed>"}, "class_info": {"name": "Main", "kind": "class", "modifiers": "", "superclass": "AllDirectives", "interfa...
144749542_0
class SNMUtils { static String getMacAddr(String mac) { log.warn("searching mac in string '{}'", mac); if (mac == null) { return ""; } Pattern p = Pattern.compile("(?:[0-9a-fA-F]:?){12}"); Matcher m = p.matcher(mac); if (m.find()) { return m...
assertEquals("11:22:33:aa:bb:cc", SNMUtils.getMacAddr("xxx (192.168.178.1) at 11:22:33:aa:bb:cc [ether] on eth0")); assertEquals("11:22:33:aa:bb:cc", SNMUtils.getMacAddr("xxx (192.168.178.1) at 11:22:33:aa:bb:cc [ether] on eth0 aa:bb:cc:11:22:33")); assertEquals("", SNMUtils.getMacAddr("xxx (192...
[FOCAL] static String SNMUtils.getMacAddr(String mac) [CLASS] class SNMUtils [METRICS] loc=16 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1 [CALLS-EXTERNAL] log.warn/2, Pattern.compile/1, Pattern.matcher/1, Matcher.find/0, Matcher.group/0 [PATH1] if(mac == null)=F -> if(m.find())=T -> return m.group() [PATH2] if...
/* static context [FOCAL] static String SNMUtils.getMacAddr(String mac) [PATH1] if(mac == null)=F -> if(m.find())=T -> return m.group() [PATH2] if(mac == null)=T -> return "" [PATH3] if(mac == null)=F -> if(m.find())=F -> return "" [INPUTS] branches=mac | result=mac [CALLS-EXTERNAL] log.warn/2, Pattern.compile/1, Patte...
/* static context [FOCAL] static String SNMUtils.getMacAddr(String mac) [PATH1] if(mac == null)=F -> if(m.find())=T -> return m.group() [PATH2] if(mac == null)=T -> return "" [PATH3] if(mac == null)=F -> if(m.find())=F -> return "" [INPUTS] branches=mac | result=mac [CALLS-EXTERNAL] log.warn/2, Pattern.compile/1, Patte...
true
ok
{"focal": {"class": "SNMUtils", "name": "getMacAddr", "signature": "String getMacAddr(String mac)", "start_line": 3, "modifiers": "static", "params": [{"name": "mac", "type": "String"}], "return_type": "String"}, "class_info": {"name": "SNMUtils", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null...