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 |
|---|---|---|---|---|---|---|---|---|
153061118_9 | class RocketMQUtil {
@Deprecated
public static org.apache.rocketmq.common.message.Message convertToRocketMessage(
ObjectMapper objectMapper, String charset,
String destination, org.springframework.messaging.Message message) {
Object payloadObj = message.getPayload();
byte[] payl... | Message msgWithStringPayload = MessageBuilder.withPayload("test body")
.setHeader("test", 1)
.setHeader(RocketMQHeaders.TAGS, "tags")
.setHeader(RocketMQHeaders.KEYS, "my_keys")
.build();
org.apache.rocketmq.common.message.Message rocketMsg = RocketMQUtil.... | [FOCAL] @Deprecated public static org.apache.rocketmq.common.message.Message RocketMQUtil.convertToRocketMessage(ObjectMapper objectMapper, String charset, String destination, org.springframework.messaging.Message message)
[CLASS] class RocketMQUtil
[METRICS] loc=21 cc=4 branches=2 loops=0 returns=1 throws=1 nesting=3
... | /* static context
[FOCAL] @Deprecated public static org.apache.rocketmq.common.message.Message RocketMQUtil.convertToRocketMessage(ObjectMapper objectMapper, String charset, String destination, org.springframework.messaging.Message message)
[THROWS-WHEN] RuntimeException when !(payloadObj instanceof String) && !(payloa... | /* static context
[FOCAL] @Deprecated public static org.apache.rocketmq.common.message.Message RocketMQUtil.convertToRocketMessage(ObjectMapper objectMapper, String charset, String destination, org.springframework.messaging.Message message)
[THROWS-WHEN] RuntimeException when !(payloadObj instanceof String) && !(payloa... | true | ok | {"focal": {"class": "RocketMQUtil", "name": "convertToRocketMessage", "signature": "org.apache.rocketmq.common.message.Message convertToRocketMessage(ObjectMapper objectMapper, String charset, String destination, org.springframework.messaging.Message message)", "start_line": 3, "modifiers": "@Deprecated public static",... |
153085231_2 | class AccountManager {
void registerAccount(String dlt, Account account) throws IllegalKeyException, EmptyAccountException {
if (null == dlt) {
throw new IllegalKeyException();
} else if (null == account) {
throw new EmptyAccountException();
}
if (null == thi... | Assertions
.assertThatThrownBy(() -> this.accountManager.registerAccount(null, null))
.isInstanceOf(IllegalKeyException.class)
.hasMessage("DLT type is not found");
}
} | [FOCAL] void AccountManager.registerAccount(String dlt, Account account)
[CLASS] class AccountManager
[METRICS] loc=11 cc=4 branches=3 loops=0 returns=0 throws=2 nesting=2
[CALLS-EXTERNAL] this.accountMap.put/2
[NEW] IllegalKeyException, EmptyAccountException, HashMap<>
[FIELDS] read=accountMap | write=accountMap
[EXCE... | /* static context
[FOCAL] void AccountManager.registerAccount(String dlt, Account account)
[THROWS-WHEN] IllegalKeyException when null == dlt
[THROWS-WHEN] EmptyAccountException when !(null == dlt) && null == account
[PATH1] if(null == dlt)=F -> if(null == account)=T -> throw new EmptyAccountException()
[PATH2] if(null... | /* static context
[FOCAL] void AccountManager.registerAccount(String dlt, Account account)
[THROWS-WHEN] IllegalKeyException when null == dlt
[THROWS-WHEN] EmptyAccountException when !(null == dlt) && null == account
[PATH1] if(null == dlt)=F -> if(null == account)=T -> throw new EmptyAccountException()
[PATH2] if(null... | true | ok | {"focal": {"class": "AccountManager", "name": "registerAccount", "signature": "void registerAccount(String dlt, Account account) throws IllegalKeyException, EmptyAccountException", "start_line": 3, "modifiers": "", "params": [{"name": "dlt", "type": "String"}, {"name": "account", "type": "Account"}], "return_type": "vo... |
153088484_15 | class AccountCmd extends BaseCmd {
@CmdAnnotation(cmd = "ac_updatePassword", version = 1.0, description = "根据原密码修改账户密码/Modify the account password by the original password")
@Parameters(value = {
@Parameter(parameterName = "chainId", requestType = @TypeDescriptor(value = int.class), parameterDes = ... | try {
//创建未加密账户 create unencrypted account
List<String> accountList = CommonRpcOperation.createAccount(chainId, 1, password);
String address = accountList.get(0);
//为未设置密码的账户修改密码 change password for account
Map<String, Object> params = new HashMap<>()... | [FOCAL] @CmdAnnotation(cmd = "ac_updatePassword", version = 1.0, description = "根据原密码修改账户密码/Modify the account password by th... Response AccountCmd.updatePassword(Map params)
[CLASS] class AccountCmd extends BaseCmd
[METRICS] loc=48 cc=7 branches=2 loops=0 returns=3 throws=2 nesting=2
[CALLS-INTERNAL] void errorLogPro... | class AccountCmd extends BaseCmd {
@CmdAnnotation(cmd = "ac_updatePassword", version = 1.0, description = "根据原密码修改账户密码/Modify the account password by the original password")
@Parameters(value = {
@Parameter(parameterName = "chainId", requestType = @TypeDescriptor(value = int.class), parameterDes = ... | false | ok | {"focal": {"class": "AccountCmd", "name": "updatePassword", "signature": "Response updatePassword(Map params)", "start_line": 3, "modifiers": "@CmdAnnotation(cmd = \"ac_updatePassword\", version = 1.0, description = \"根据原密码修改账户密码/Modify the account password by th...", "params": [{"name": "params", "type": "Map"}], "ret... | |
153224042_12 | class FileUtils {
@Nullable
static String calculateMd5(@NonNull InputStream inputStream) {
MessageDigest digest;
try {
digest = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
VLog.w(e, "Exception while getting digest");
retur... | Assert.assertEquals("2a66a876a40630539e220890dc897550",
FileUtils.calculateMd5(getInputStream("com.wlqq.phantom.plugin.sample1_1.0.0.apk")));
}
} | [FOCAL] @Nullable static String FileUtils.calculateMd5(InputStream inputStream)
[CLASS] class FileUtils
[METRICS] loc=29 cc=4 branches=0 loops=1 returns=3 throws=0 nesting=2
[CALLS-EXTERNAL] MessageDigest.getInstance/1, VLog.w/2, InputStream.read/1, MessageDigest.update/3, MessageDigest.digest/0, BigInteger.toString/1,... | /* static context
[FOCAL] @Nullable static String FileUtils.calculateMd5(InputStream inputStream)
[PATH1] while((read = inputStream.read(buffer)) > 0)=T -> exit loop -> return output
[PATH2] try-body throws -> return null
[PATH3] while((read = inputStream.read(buffer)) > 0)=F -> return output
[INPUTS] branches=inputStr... | /* static context
[FOCAL] @Nullable static String FileUtils.calculateMd5(InputStream inputStream)
[PATH1] while((read = inputStream.read(buffer)) > 0)=T -> exit loop -> return output
[PATH2] try-body throws -> return null
[PATH3] while((read = inputStream.read(buffer)) > 0)=F -> return output
[INPUTS] branches=inputStr... | true | ok | {"focal": {"class": "FileUtils", "name": "calculateMd5", "signature": "String calculateMd5(InputStream inputStream)", "start_line": 3, "modifiers": "@Nullable static", "params": [{"name": "inputStream", "type": "InputStream"}], "return_type": "String"}, "class_info": {"name": "FileUtils", "kind": "class", "modifiers": ... |
153274035_4 | class HeaderUtils {
public static Long valueAsLong(Headers headers, String key) {
return asLong(value(headers, key));
}
private HeaderUtils();
public static Long asLong(byte[] value);
public static String asString(byte[] value);
public static String valueAsString(Headers headers, Str... | assertThat(valueAsLong(new RecordHeaders(), "some-invalid-key")).isNull();
}
} | [FOCAL] public static Long HeaderUtils.valueAsLong(Headers headers, String key)
[CLASS] class HeaderUtils
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Long asLong(byte[] value)
[CALLS-EXTERNAL] value/2 (inherited)
[INPUTS] branches=- | result=headers, key
[DATAFLOW] headers@para... | /* static context
[FOCAL] public static Long HeaderUtils.valueAsLong(Headers headers, String key)
[INPUTS] branches=- | result=headers, key
[CALLS-INTERNAL] Long asLong(byte[] value)
[CALLS-EXTERNAL] value/2 (inherited)
*/
| /* static context
[FOCAL] public static Long HeaderUtils.valueAsLong(Headers headers, String key)
[INPUTS] branches=- | result=headers, key
[CALLS-INTERNAL] Long asLong(byte[] value)
[CALLS-EXTERNAL] value/2 (inherited)
*/
class HeaderUtils {
public static Long valueAsLong(Headers headers, String key) {
re... | true | ok | {"focal": {"class": "HeaderUtils", "name": "valueAsLong", "signature": "Long valueAsLong(Headers headers, String key)", "start_line": 3, "modifiers": "public static", "params": [{"name": "headers", "type": "Headers"}, {"name": "key", "type": "String"}], "return_type": "Long"}, "class_info": {"name": "HeaderUtils", "kin... |
153278268_6 | class PokerHelper {
public static PokerSell checkPokerType(List<Poker> pokers) {
if(pokers != null && ! pokers.isEmpty()) {
sortPoker(pokers);
int[] levelTable = new int[20];
for(Poker poker: pokers) {
levelTable[poker.getLevel().getLevel()] ++;
}
int startIndex = -1;
int endIndex = -1;
... | pokers.clear();
Assert.assertNull(PokerHelper.checkPokerType(pokers).getSellPokers());
Assert.assertEquals(-1,PokerHelper.checkPokerType(pokers).getScore());
Assert.assertEquals(SellType.ILLEGAL,PokerHelper.checkPokerType(pokers).getSellType());
pokers.add(new Poker(PokerLevel.L... | [FOCAL] public static PokerSell PokerHelper.checkPokerType(List<Poker> pokers)
[CLASS] class PokerHelper
[METRICS] loc=121 cc=37 branches=34 loops=2 returns=18 throws=0 nesting=8
[CALLS-INTERNAL] void sortPoker(List<Poker> pokers)
[CALLS-EXTERNAL] List<Poker>.isEmpty/0, poker.getLevel().getLevel/0, Poker.getLevel/0, Po... | class PokerHelper {
public static PokerSell checkPokerType(List<Poker> pokers) {
if(pokers != null && ! pokers.isEmpty()) {
sortPoker(pokers);
int[] levelTable = new int[20];
for(Poker poker: pokers) {
levelTable[poker.getLevel().getLevel()] ++;
}
int startIndex = -1;
int endIndex = -1;
... | false | ok | {"focal": {"class": "PokerHelper", "name": "checkPokerType", "signature": "PokerSell checkPokerType(List<Poker> pokers)", "start_line": 3, "modifiers": "public static", "params": [{"name": "pokers", "type": "List<Poker>"}], "return_type": "PokerSell"}, "class_info": {"name": "PokerHelper", "kind": "class", "modifiers":... | |
153280357_3 | class MongoTokenStore implements TokenStore {
@Override
public void initializeSegment(TrackingToken token,
String processorName,
int segment) throws UnableToInitializeTokenException {
try {
AbstractTokenEntry<?> tokenEntry ... | GlobalSequenceTrackingToken testToken = new GlobalSequenceTrackingToken(100);
tokenStore.initializeSegment(testToken, testProcessorName, testSegment);
// Initializes the given token twice, causing the exception
assertThrows(
UnableToInitializeTokenException.class,
... | [FOCAL] @Override public void MongoTokenStore.initializeSegment(TrackingToken token, String processorName, int segment)
[CLASS] class MongoTokenStore implements TokenStore
[METRICS] loc=18 cc=3 branches=1 loops=0 returns=0 throws=1 nesting=2
[CALLS-INTERNAL] Document tokenEntryToDocument(AbstractTokenEntry<?> tokenEntr... | /* static context
[FOCAL] @Override public void MongoTokenStore.initializeSegment(TrackingToken token, String processorName, int segment)
[THROWS-WHEN] UnableToInitializeTokenException when try-body throws && ErrorCategory.fromErrorCode(exception.getError().getCode()) == ErrorCategory.DUPLICATE_KEY
[PATH1] try-body thr... | /* static context
[FOCAL] @Override public void MongoTokenStore.initializeSegment(TrackingToken token, String processorName, int segment)
[THROWS-WHEN] UnableToInitializeTokenException when try-body throws && ErrorCategory.fromErrorCode(exception.getError().getCode()) == ErrorCategory.DUPLICATE_KEY
[PATH1] try-body thr... | true | ok | {"focal": {"class": "MongoTokenStore", "name": "initializeSegment", "signature": "void initializeSegment(TrackingToken token, String processorName, int segment) throws UnableToInitializeTokenException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "token", "type": "TrackingToken"}, {"name": "pr... |
153314760_9 | class SpringHttpCommandBusConnector implements CommandBusConnector {
@Override
public <C> void send(Member destination, CommandMessage<? extends C> commandMessage) {
shutdownLatch.ifShuttingDown("JGroupsConnector is shutting down, no new commands will be sent.");
if (destination.local()) {
... | testSubject.send(DESTINATION, COMMAND_MESSAGE);
verify(executor).execute(any());
verify(serializer).serialize(COMMAND_MESSAGE.getMetaData(), byte[].class);
verify(serializer).serialize(COMMAND_MESSAGE.getPayload(), byte[].class);
HttpEntity<SpringHttpDispatchMessage<String>> ex... | [FOCAL] @Override public void SpringHttpCommandBusConnector.send(Member destination, CommandMessage<? extends C> commandMessage)
[CLASS] class SpringHttpCommandBusConnector implements CommandBusConnector
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] ResponseEntity<SpringHttpReply... | /* static context
[FOCAL] @Override public void SpringHttpCommandBusConnector.send(Member destination, CommandMessage<? extends C> commandMessage)
[PATH1] if(destination.local())=T
[PATH2] if(destination.local())=F
[INPUTS] branches=destination | result=-
[COLLABORATORS] field shutdownLatch ifShuttingDown/1; param dest... | /* static context
[FOCAL] @Override public void SpringHttpCommandBusConnector.send(Member destination, CommandMessage<? extends C> commandMessage)
[PATH1] if(destination.local())=T
[PATH2] if(destination.local())=F
[INPUTS] branches=destination | result=-
[COLLABORATORS] field shutdownLatch ifShuttingDown/1; param dest... | true | ok | {"focal": {"class": "SpringHttpCommandBusConnector", "name": "send", "signature": "void send(Member destination, CommandMessage<? extends C> commandMessage)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "destination", "type": "Member"}, {"name": "commandMessage", "type": "CommandMessage<? exte... |
153620926_0 | class DemoService {
@DbLog(resource = "demoResource", action = "demoAction")
public void sayHello() {
System.out.println("hello foo.\n");
}
@Autowired
private DemoService demoService;
@Autowired
@Qualifier("dbLogJdbcTemplate")
private JdbcTemplate jdbcTemplate;
}
class DemoSe... | // 清空数据
jdbcTemplate.update("delete from `log`");
demoService.sayHello();
// 检查 sayHello 是否在数据库里插入了正确的数据
Map<String, Object> result = jdbcTemplate.queryForMap("select * from `log`");
// 校验数据是否和预期的一致
Assert.assertEquals("demoResource", result.get("resource")); /... | [FOCAL] @DbLog(resource = "demoResource", action = "demoAction") public void DemoService.sayHello()
[CLASS] class DemoService
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] System.out.println/1
[TEST] DemoServiceTest: @Test public void sayHello()
[TEST-FIELDS] DemoService demoServ... | /* static context
[FOCAL] @DbLog(resource = "demoResource", action = "demoAction") public void DemoService.sayHello()
[CALLS-EXTERNAL] System.out.println/1
*/
| /* static context
[FOCAL] @DbLog(resource = "demoResource", action = "demoAction") public void DemoService.sayHello()
[CALLS-EXTERNAL] System.out.println/1
*/
class DemoService {
@DbLog(resource = "demoResource", action = "demoAction")
public void sayHello() {
System.out.println("hello foo.\n");
}
... | true | ok | {"focal": {"class": "DemoService", "name": "sayHello", "signature": "void sayHello()", "start_line": 3, "modifiers": "@DbLog(resource = \"demoResource\", action = \"demoAction\") public", "params": [], "return_type": "void"}, "class_info": {"name": "DemoService", "kind": "class", "modifiers": "", "superclass": null, "i... |
153720290_4 | class RequestServiceImpl implements JdbcRequestService {
@Override
public ApiResponse apply(JdbcExecutor sender, String user, String password) {
return apply(sender, JdbcJsonBuilder.buildAuthJson(user, password, ""));
}
@Override @SuppressWarnings("unchecked") public ApiResponse apply(JdbcExec... | String jsonString = "{\"database\":cube,\"requestType\":\"SQL\",\"auth\":\"authCode\",\"requestId\":\"93eceaf1-4e47-40a1-84e9-814404eb7ad5\",\"sql\":\"select * from tableA\"}";
JdbcExecutor mockJdbcExecutor = PowerMock.createMock(JdbcExecutor.class);
ApiResponse mockApiResponse = PowerMock.creat... | [FOCAL] @Override public ApiResponse RequestServiceImpl.apply(JdbcExecutor sender, String user, String password)
[CLASS] class RequestServiceImpl implements JdbcRequestService
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] ApiResponse apply(JdbcExecutor sender, String requestJson)... | /* static context
[FOCAL] @Override public ApiResponse RequestServiceImpl.apply(JdbcExecutor sender, String user, String password)
[INPUTS] branches=- | result=password, sender, user
[CALLS-INTERNAL] ApiResponse apply(JdbcExecutor sender, String requestJson)
[CALLS-EXTERNAL] JdbcJsonBuilder.buildAuthJson/3
*/
| /* static context
[FOCAL] @Override public ApiResponse RequestServiceImpl.apply(JdbcExecutor sender, String user, String password)
[INPUTS] branches=- | result=password, sender, user
[CALLS-INTERNAL] ApiResponse apply(JdbcExecutor sender, String requestJson)
[CALLS-EXTERNAL] JdbcJsonBuilder.buildAuthJson/3
*/
class Req... | true | ok | {"focal": {"class": "RequestServiceImpl", "name": "apply", "signature": "ApiResponse apply(JdbcExecutor sender, String user, String password)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "sender", "type": "JdbcExecutor"}, {"name": "user", "type": "String"}, {"name": "password", "type": "Strin... |
153720329_77 | class BaseByteArrayReader implements ByteArrayReader {
@Override
public void release() {
IoUtil.release(dataReader, lenReader, posReader);
}
public BaseByteArrayReader(ByteReader dataReader, LongReader posReader, IntReader lenReader);
@Override public boolean isReadable();
@Override ... | mockStatic(IoUtil.class);
new BaseByteArrayReader(dataReader, posReader, lenReader).release();
verifyStatic(IoUtil.class);
IoUtil.release(dataReader, lenReader, posReader);
}
} | [FOCAL] @Override public void BaseByteArrayReader.release()
[CLASS] class BaseByteArrayReader implements ByteArrayReader
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] IoUtil.release/3
[FIELDS] read=dataReader:ByteReader, lenReader:IntReader, posReader:LongReader
[DATAFLOW] this.d... | /* static context
[FOCAL] @Override public void BaseByteArrayReader.release()
[FIELDS] read=dataReader:ByteReader, lenReader:IntReader, posReader:LongReader
[CALLS-EXTERNAL] IoUtil.release/3
*/
| /* static context
[FOCAL] @Override public void BaseByteArrayReader.release()
[FIELDS] read=dataReader:ByteReader, lenReader:IntReader, posReader:LongReader
[CALLS-EXTERNAL] IoUtil.release/3
*/
class BaseByteArrayReader implements ByteArrayReader {
@Override
public void release() {
IoUtil.release(dataR... | true | ok | {"focal": {"class": "BaseByteArrayReader", "name": "release", "signature": "void release()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "BaseByteArrayReader", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "ByteArrayReader", "field... |
154016270_39 | class PmdSensor implements Sensor {
@Override
public boolean shouldExecuteOnProject(Project project) {
return (hasFilesToCheck(Type.MAIN, PmdConstants.REPOSITORY_KEY))
|| (hasFilesToCheck(Type.TEST, PmdConstants.TEST_REPOSITORY_KEY))
|| (hasFilesToCheck(Type.MAIN, PmdConstants.XML_REPOSITORY_KEY));
}
pu... | addOneJavaFile(Type.MAIN);
addOneXmlFile(Type.MAIN);
boolean shouldExecute = pmdSensor.shouldExecuteOnProject(project);
assertThat(shouldExecute).isTrue();
}
} | [FOCAL] @Override public boolean PmdSensor.shouldExecuteOnProject(Project project)
[CLASS] class PmdSensor implements Sensor
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] boolean hasFilesToCheck(Type type, String repositoryKey)
[INPUTS] branches=- | result=- | unused=project
[CLA... | /* static context
[FOCAL] @Override public boolean PmdSensor.shouldExecuteOnProject(Project project)
[INPUTS] branches=- | result=- | unused=project
[CALLS-INTERNAL] boolean hasFilesToCheck(Type type, String repositoryKey)
*/
| /* static context
[FOCAL] @Override public boolean PmdSensor.shouldExecuteOnProject(Project project)
[INPUTS] branches=- | result=- | unused=project
[CALLS-INTERNAL] boolean hasFilesToCheck(Type type, String repositoryKey)
*/
class PmdSensor implements Sensor {
@Override
public boolean shouldExecuteOnProject(Project... | true | ok | {"focal": {"class": "PmdSensor", "name": "shouldExecuteOnProject", "signature": "boolean shouldExecuteOnProject(Project project)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "project", "type": "Project"}], "return_type": "boolean"}, "class_info": {"name": "PmdSensor", "kind": "class", "modifi... |
154099498_57 | class ChannelServiceHttpClient {
@WorkerThread
@NonNull
public <T> LineApiResponse<T> postWithJson(
@NonNull Uri uri,
@NonNull Map<String, String> requestHeaders,
@NonNull String postData,
@NonNull ResponseDataParser<T> responseDataParser) {
return se... | Map<String, String> requestHeaders = new HashMap();
requestHeaders.put("headerKey1", "headerValue1");
requestHeaders.put("headerKey2", "headerValue2");
String postData = "{\"text\": \"hello\"}";
setResponseData("test".getBytes(CHARSET));
LineApiResponse<String> responseD... | [FOCAL] @WorkerThread @NonNull public LineApiResponse<T> ChannelServiceHttpClient.postWithJson(Uri uri, Map<String, String> requestHeaders, String postData, ResponseDataParser<T> responseDataParser)
[CLASS] class ChannelServiceHttpClient
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERN... | /* static context
[FOCAL] @WorkerThread @NonNull public LineApiResponse<T> ChannelServiceHttpClient.postWithJson(Uri uri, Map<String, String> requestHeaders, String postData, ResponseDataParser<T> responseDataParser)
[INPUTS] branches=- | result=postData, requestHeaders, responseDataParser, uri
[CALLS-INTERNAL] LineApi... | /* static context
[FOCAL] @WorkerThread @NonNull public LineApiResponse<T> ChannelServiceHttpClient.postWithJson(Uri uri, Map<String, String> requestHeaders, String postData, ResponseDataParser<T> responseDataParser)
[INPUTS] branches=- | result=postData, requestHeaders, responseDataParser, uri
[CALLS-INTERNAL] LineApi... | true | ok | {"focal": {"class": "ChannelServiceHttpClient", "name": "postWithJson", "signature": "LineApiResponse<T> postWithJson(Uri uri, Map<String, String> requestHeaders, String postData, ResponseDataParser<T> responseDataParser)", "start_line": 3, "modifiers": "@WorkerThread @NonNull public", "params": [{"name": "uri", "type"... |
154137427_0 | class DateUtils {
public static boolean dateIsBefore(String standDate, String desDate) {
try {
return YYYYMMDD_FORMAT.parse(desDate).before(YYYYMMDD_FORMAT.parse(standDate));
} catch (ParseException var3) {
var3.printStackTrace();
return false;
}
}
... | assertEquals(DateUtils.dateIsBefore("2017-12-26","2017-12-25"),true);
}
} | [FOCAL] public static boolean DateUtils.dateIsBefore(String standDate, String desDate)
[CLASS] class DateUtils
[METRICS] loc=8 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] YYYYMMDD_FORMAT.parse(desDate).before/1, YYYYMMDD_FORMAT.parse/1, ParseException.printStackTrace/0
[EXCEPTIONS] catches Par... | /* static context
[FOCAL] public static boolean DateUtils.dateIsBefore(String standDate, String desDate)
[PATH1] try-body throws -> return false
[PATH2] return YYYYMMDD_FORMAT.parse(desDate).before(YYYYMMDD_FORMAT.parse(standDa...
[INPUTS] branches=- | result=desDate, standDate
[EXCEPTIONS] catches ParseException var3
... | /* static context
[FOCAL] public static boolean DateUtils.dateIsBefore(String standDate, String desDate)
[PATH1] try-body throws -> return false
[PATH2] return YYYYMMDD_FORMAT.parse(desDate).before(YYYYMMDD_FORMAT.parse(standDa...
[INPUTS] branches=- | result=desDate, standDate
[EXCEPTIONS] catches ParseException var3
... | true | ok | {"focal": {"class": "DateUtils", "name": "dateIsBefore", "signature": "boolean dateIsBefore(String standDate, String desDate)", "start_line": 3, "modifiers": "public static", "params": [{"name": "standDate", "type": "String"}, {"name": "desDate", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "Da... |
154246246_56 | class WalletManager {
public static Wallet importWalletFromMnemonic(Metadata metadata, @Nullable String accountName, String mnemonic, String path, @Nullable List<EOSKeystore.PermissionObject> permissions, String password, boolean overwrite) {
if (metadata.getSource() == null)
metadata.setSource(Metadata.F... | String m;
m = "attack curtain frog balcony trash base twenty history cradle cruel illness attitude";
Wallet wallet = WalletManager.importWalletFromMnemonic(
new Metadata(ChainType.BITCOIN, Network.TESTNET, "name", "passwordHint"),
m, BIP44Util.BITCOIN_TESTNET_PATH, SampleKey.PASSWORD, true);... | [FOCAL] public static Wallet WalletManager.importWalletFromMnemonic(Metadata metadata, String accountName, String mnemonic, String path, List<EOSKeystore.PermissionObject> permissions, String password, boolean overwrite)
[CLASS] class WalletManager
[METRICS] loc=20 cc=5 branches=2 loops=0 returns=1 throws=0 nesting=1
[... | /* static context
[FOCAL] public static Wallet WalletManager.importWalletFromMnemonic(Metadata metadata, String accountName, String mnemonic, String path, List<EOSKeystore.PermissionObject> permissions, String password, boolean overwrite)
[PATH1] if(metadata.getSource() == null)=T -> switch(metadata.getChainType())=cas... | /* static context
[FOCAL] public static Wallet WalletManager.importWalletFromMnemonic(Metadata metadata, String accountName, String mnemonic, String path, List<EOSKeystore.PermissionObject> permissions, String password, boolean overwrite)
[PATH1] if(metadata.getSource() == null)=T -> switch(metadata.getChainType())=cas... | true | ok | {"focal": {"class": "WalletManager", "name": "importWalletFromMnemonic", "signature": "Wallet importWalletFromMnemonic(Metadata metadata, String accountName, String mnemonic, String path, List<EOSKeystore.PermissionObject> permissions, String password, boolean overwrite)", "start_line": 3, "modifiers": "public static",... |
154382730_14 | class StatisticServiceImpl implements StatisticService {
@Override
public Mono<Long> eventsCount(EventType type) {
return repository.findByEventType(type)
.map(r -> 1)
.reduce(0L, Long::sum);
}
@Autowired public StatisticServiceImpl(StatisticRepository repository,
... | StatisticDocument statisticDocument1 = new StatisticDocument();
statisticDocument1.setId("Stat1");
statisticDocument1.setEventType(EventType.SHORTENER_VIEWED);
StatisticDocument statisticDocument2 = new StatisticDocument();
statisticDocument2.setId("Stat2");
statisticDocument2.setEventType(Even... | [FOCAL] @Override public Mono<Long> StatisticServiceImpl.eventsCount(EventType type)
[CLASS] class StatisticServiceImpl implements StatisticService
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] repository.findByEventType(type) .map(r -> 1).reduce/2, repository.findByEventType(typ... | /* static context
[FOCAL] @Override public Mono<Long> StatisticServiceImpl.eventsCount(EventType type)
[INPUTS] branches=- | result=type, repository
[COLLABORATORS] field repository:StatisticRepository findByEventType/1
[FIELDS] read=repository:StatisticRepository
[CALLS-EXTERNAL] repository.findByEventType(type) .map(... | /* static context
[FOCAL] @Override public Mono<Long> StatisticServiceImpl.eventsCount(EventType type)
[INPUTS] branches=- | result=type, repository
[COLLABORATORS] field repository:StatisticRepository findByEventType/1
[FIELDS] read=repository:StatisticRepository
[CALLS-EXTERNAL] repository.findByEventType(type) .map(... | true | ok | {"focal": {"class": "StatisticServiceImpl", "name": "eventsCount", "signature": "Mono<Long> eventsCount(EventType type)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "type", "type": "EventType"}], "return_type": "Mono<Long>"}, "class_info": {"name": "StatisticServiceImpl", "kind": "class", "mo... |
154510460_4 | class Calculator {
public double subtraction(double firstOperand, double secondOperand) {
return firstOperand - secondOperand;
}
public double addition(double firstOperand, double secondOperand);
public double division(double firstOperand, double secondOperand);
public double multiplicatio... | double resultSub = mCalculator.subtraction(2d, 10d);
assertThat(resultSub, is(equalTo(-8d)));
}
} | [FOCAL] public double Calculator.subtraction(double firstOperand, double secondOperand)
[CLASS] class Calculator
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[INPUTS] branches=- | result=firstOperand, secondOperand
[DATAFLOW] firstOperand@param->L2; secondOperand@param->L2
[CLASS-MEMBERS] double... | /* static context
[FOCAL] public double Calculator.subtraction(double firstOperand, double secondOperand)
[INPUTS] branches=- | result=firstOperand, secondOperand
*/
| /* static context
[FOCAL] public double Calculator.subtraction(double firstOperand, double secondOperand)
[INPUTS] branches=- | result=firstOperand, secondOperand
*/
class Calculator {
public double subtraction(double firstOperand, double secondOperand) {
return firstOperand - secondOperand;
}
pub... | true | ok | {"focal": {"class": "Calculator", "name": "subtraction", "signature": "double subtraction(double firstOperand, double secondOperand)", "start_line": 3, "modifiers": "public", "params": [{"name": "firstOperand", "type": "double"}, {"name": "secondOperand", "type": "double"}], "return_type": "double"}, "class_info": {"na... |
154647700_15 | class VaadinConnectController {
@PostMapping(path = "/{service}/{method}", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseEntity<String> serveVaadinService(
@PathVariable("service") String serviceName,
@PathVariable("method") String methodName,
@RequestBody(required = false) Obj... | int inputValue = 222;
String expectedMessage = "OOPS";
class MyCustomException extends VaadinConnectException {
public MyCustomException() {
super(expectedMessage);
}
}
Method serviceMethodMock = createServiceMethodMockThatThrows(inputValue,
new InvocationTargetExceptio... | [FOCAL] @PostMapping(path = "/{service}/{method}", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public ResponseEntity<String> VaadinConnectController.serveVaadinService(String serviceName, String methodName, ObjectNode body)
[CLASS] class VaadinConnectController
[METRICS] loc=43 cc=5 branches=2 loops=0 returns=4 t... | /* static context
[FOCAL] @PostMapping(path = "/{service}/{method}", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public ResponseEntity<String> VaadinConnectController.serveVaadinService(String serviceName, String methodName, ObjectNode body)
[THROWS-WHEN] IllegalStateException when !(vaadinServiceData == null) &&... | /* static context
[FOCAL] @PostMapping(path = "/{service}/{method}", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public ResponseEntity<String> VaadinConnectController.serveVaadinService(String serviceName, String methodName, ObjectNode body)
[THROWS-WHEN] IllegalStateException when !(vaadinServiceData == null) &&... | true | ok | {"focal": {"class": "VaadinConnectController", "name": "serveVaadinService", "signature": "ResponseEntity<String> serveVaadinService(String serviceName, String methodName, ObjectNode body)", "start_line": 3, "modifiers": "@PostMapping(path = \"/{service}/{method}\", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) pub... |
154974836_3 | class FunctionalClass {
public <F> @NonNull FunctionalProperty<T, F> field(final @NonNull String name) {
final PropertyDescriptor descriptor = this.getPropertyDescriptor(name);
return new FunctionalProperty<>(descriptor);
}
public Supplier<T> getConstructor();
private PropertyDescripto... | assertThatExceptionOfType(IllegalArgumentException.class)
.isThrownBy(() -> of(Person.class).field("i"))
.withCauseInstanceOf(IntrospectionException.class)
.withMessageContaining("Unknown property: i")
.satisfies(
exception ... | [FOCAL] public FunctionalProperty<T, F> FunctionalClass.field(String name)
[CLASS] class FunctionalClass
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] PropertyDescriptor getPropertyDescriptor(String name)
[NEW] FunctionalProperty<>
[INPUTS] branches=- | result=name
[DATAFLOW] des... | /* static context
[FOCAL] public FunctionalProperty<T, F> FunctionalClass.field(String name)
[INPUTS] branches=- | result=name
[CALLS-INTERNAL] PropertyDescriptor getPropertyDescriptor(String name)
[NEW] FunctionalProperty<>
*/
| /* static context
[FOCAL] public FunctionalProperty<T, F> FunctionalClass.field(String name)
[INPUTS] branches=- | result=name
[CALLS-INTERNAL] PropertyDescriptor getPropertyDescriptor(String name)
[NEW] FunctionalProperty<>
*/
class FunctionalClass {
public <F> @NonNull FunctionalProperty<T, F> field(final @NonNu... | true | ok | {"focal": {"class": "FunctionalClass", "name": "field", "signature": "FunctionalProperty<T, F> field(String name)", "start_line": 3, "modifiers": "public", "params": [{"name": "name", "type": "String"}], "return_type": "FunctionalProperty<T, F>"}, "class_info": {"name": "FunctionalClass", "kind": "class", "modifiers": ... |
155078306_3 | class DataProxy {
protected static String map1stMatchingTagNames(SpanPack pack, String tagNames) {
if (StringUtil.isEmpty(tagNames)) {
return null;
}
return Arrays.stream(tagNames.split(","))
.map(tag -> pack.tags.getText(tag))
.filter(StringUtil:... | assertThat(DataProxy.map1stMatchingTagNames(pack, "tag1"), is(pack.tags.getText("tag1")));
assertThat(DataProxy.map1stMatchingTagNames(pack, "tag2"), is(pack.tags.getText("tag2")));
assertThat(DataProxy.map1stMatchingTagNames(pack, "tag1,tag2"), is(pack.tags.getText("tag1")));
assertThat... | [FOCAL] protected static String DataProxy.map1stMatchingTagNames(SpanPack pack, String tagNames)
[CLASS] class DataProxy
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] StringUtil.isEmpty/1, Arrays.stream(tagNames.split(",")) .map(tag -> pack.tags.....orElse/1, Arrays.stream(tagNam... | /* static context
[FOCAL] protected static String DataProxy.map1stMatchingTagNames(SpanPack pack, String tagNames)
[PATH1] if(StringUtil.isEmpty(tagNames))=T -> return null
[PATH2] if(StringUtil.isEmpty(tagNames))=F -> return Arrays.stream(tagNames.split(",")) .map(tag -> pack.tags.getText(ta...
[INPUTS] branches=tagNa... | /* static context
[FOCAL] protected static String DataProxy.map1stMatchingTagNames(SpanPack pack, String tagNames)
[PATH1] if(StringUtil.isEmpty(tagNames))=T -> return null
[PATH2] if(StringUtil.isEmpty(tagNames))=F -> return Arrays.stream(tagNames.split(",")) .map(tag -> pack.tags.getText(ta...
[INPUTS] branches=tagNa... | true | ok | {"focal": {"class": "DataProxy", "name": "map1stMatchingTagNames", "signature": "String map1stMatchingTagNames(SpanPack pack, String tagNames)", "start_line": 3, "modifiers": "protected static", "params": [{"name": "pack", "type": "SpanPack"}, {"name": "tagNames", "type": "String"}], "return_type": "String"}, "class_in... |
155195958_0 | class ID3 {
public boolean setTag(SongItem songItem) throws IOException, NotSupportedException {
ID3v23Tag tag = new ID3v23Tag();
tag.setTitle(songItem.name);
tag.setArtist(songItem.artist);
tag.setAlbumArtist(songItem.artist);
tag.setAlbum(songItem.album);
mp3File.s... | for (File testFile: testFileList) {
ID3 id3 = new ID3(testFile);
SongItem songItem = new SongItem();
songItem.name = testName;
songItem.artist = testArtist;
boolean result = id3.setTag(songItem);
Assert.assertEquals(result, true);
}... | [FOCAL] public boolean ID3.setTag(SongItem songItem)
[CLASS] class ID3
[METRICS] loc=20 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] ID3v23Tag.setTitle/1, ID3v23Tag.setArtist/1, ID3v23Tag.setAlbumArtist/1, ID3v23Tag.setAlbum/1, mp3File.setId3v2Tag/1, File.createTempFile/2, mp3File.save/1, File.... | /* static context
[FOCAL] public boolean ID3.setTag(SongItem songItem)
[PATH1] while((len = inputStream.read(buffer, 0, BUFFER_SIZE)) != -1)=T -> exit loop -> return tmpFile.delete()
[PATH2] while((len = inputStream.read(buffer, 0, BUFFER_SIZE)) != -1)=F -> return tmpFile.delete()
[COLLABORATORS] field mp3File setId3v2... | /* static context
[FOCAL] public boolean ID3.setTag(SongItem songItem)
[PATH1] while((len = inputStream.read(buffer, 0, BUFFER_SIZE)) != -1)=T -> exit loop -> return tmpFile.delete()
[PATH2] while((len = inputStream.read(buffer, 0, BUFFER_SIZE)) != -1)=F -> return tmpFile.delete()
[COLLABORATORS] field mp3File setId3v2... | true | ok | {"focal": {"class": "ID3", "name": "setTag", "signature": "boolean setTag(SongItem songItem) throws IOException, NotSupportedException", "start_line": 3, "modifiers": "public", "params": [{"name": "songItem", "type": "SongItem"}], "return_type": "boolean"}, "class_info": {"name": "ID3", "kind": "class", "modifiers": ""... |
155383451_87 | class AbstractApiDocService {
protected void preparePath(N path, ApiDocPath<N> apiDocPath, ApiDocInfo apiDocInfo, String basePath, String originalEndpoint, String serviceId) {
log.trace("Swagger Service Id: " + serviceId);
log.trace("Original Endpoint: " + originalEndpoint);
log.trace("Base... | List<Server> servers = new ArrayList<>();
servers.add(0, new Server().url("/apicatalog"));
ApiDocPath<PathItem> apiDocPath = new ApiDocPath<>();
OpenAPI openAPI = getDummyOpenApiObject(servers);
String apiDocContent = convertOpenApiToJson(openAPI);
RoutedService routedSe... | [FOCAL] protected void AbstractApiDocService.preparePath(N path, ApiDocPath<N> apiDocPath, ApiDocInfo apiDocInfo, String basePath, String originalEndpoint, String serviceId)
[CLASS] class AbstractApiDocService
[METRICS] loc=24 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] Pair<String, String> ge... | /* static context
[FOCAL] protected void AbstractApiDocService.preparePath(N path, ApiDocPath<N> apiDocPath, ApiDocInfo apiDocInfo, String basePath, String originalEndpoint, String serviceId)
[PATH1] if(route == null)#1=T -> if(route == null)#2=T
[PATH2] if(route == null)#1=F -> if(route == null)#2=F
[INPUTS] branches=... | /* static context
[FOCAL] protected void AbstractApiDocService.preparePath(N path, ApiDocPath<N> apiDocPath, ApiDocInfo apiDocInfo, String basePath, String originalEndpoint, String serviceId)
[PATH1] if(route == null)#1=T -> if(route == null)#2=T
[PATH2] if(route == null)#1=F -> if(route == null)#2=F
[INPUTS] branches=... | true | ok | {"focal": {"class": "AbstractApiDocService", "name": "preparePath", "signature": "void preparePath(N path, ApiDocPath<N> apiDocPath, ApiDocInfo apiDocInfo, String basePath, String originalEndpoint, String serviceId)", "start_line": 3, "modifiers": "protected", "params": [{"name": "path", "type": "N"}, {"name": "apiDocP... |
155449545_1 | class AccountNumber implements Serializable, Formattable, Comparable<AccountNumber> {
@Override
public void formatTo(Formatter formatter, int flags, int width, int precision) {
formatter.format("%s-%s", value / 1000, value % 1000);
}
private AccountNumber(int value);
public static Accoun... | assertEquals("123-123", String.format("%s", AccountNumber.of(123123)));
assertEquals("1234-321", String.format("%s", AccountNumber.of(1234321)));
}
} | [FOCAL] @Override public void AccountNumber.formatTo(Formatter formatter, int flags, int width, int precision)
[CLASS] class AccountNumber implements Serializable, Formattable, Comparable<AccountNumber>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] Formatter.format/3
[INPUTS] bra... | /* static context
[FOCAL] @Override public void AccountNumber.formatTo(Formatter formatter, int flags, int width, int precision)
[INPUTS] branches=- | result=- | unused=flags, width, precision
[COLLABORATORS] param formatter:Formatter format/3
[CALLS-EXTERNAL] Formatter.format/3
*/
| /* static context
[FOCAL] @Override public void AccountNumber.formatTo(Formatter formatter, int flags, int width, int precision)
[INPUTS] branches=- | result=- | unused=flags, width, precision
[COLLABORATORS] param formatter:Formatter format/3
[CALLS-EXTERNAL] Formatter.format/3
*/
class AccountNumber implements Serial... | true | ok | {"focal": {"class": "AccountNumber", "name": "formatTo", "signature": "void formatTo(Formatter formatter, int flags, int width, int precision)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "formatter", "type": "Formatter"}, {"name": "flags", "type": "int"}, {"name": "width", "type": "int"}, {"... |
155476310_2 | class SignatureUtils {
public static String awsV4BuildCanonicalRequestString(
HttpUriRequest httpMethod, String requestPayloadHexSha256Hash)
{
URI uri = httpMethod.getURI();
String httpRequestMethod = httpMethod.getMethod();
Map<String, String> headersMap = new HashMap<String, ... | final URI uri = new URI("" +
"https://test-eu-central-1-mountainduck.s3-eu-central-1.amazonaws.com:443/?max-keys=1000&prefix=a%2F&delimiter=%2F");
final String method = "GET";
final Map<String, String> headers = new HashMap<String, String>();
headers.put("date", "Mon, 18 ... | [FOCAL] public static String SignatureUtils.awsV4BuildCanonicalRequestString(HttpUriRequest httpMethod, String requestPayloadHexSha256Hash)
[CLASS] class SignatureUtils
[METRICS] loc=19 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] String awsV4BuildCanonicalRequestString(URI uri, String httpMeth... | /* static context
[FOCAL] public static String SignatureUtils.awsV4BuildCanonicalRequestString(HttpUriRequest httpMethod, String requestPayloadHexSha256Hash)
[PATH1] foreach(Header header : headers)=T -> exit loop -> return awsV4BuildCanonicalRequestString( uri, httpRequestMethod, headersMa...
[PATH2] foreach(Header he... | /* static context
[FOCAL] public static String SignatureUtils.awsV4BuildCanonicalRequestString(HttpUriRequest httpMethod, String requestPayloadHexSha256Hash)
[PATH1] foreach(Header header : headers)=T -> exit loop -> return awsV4BuildCanonicalRequestString( uri, httpRequestMethod, headersMa...
[PATH2] foreach(Header he... | true | ok | {"focal": {"class": "SignatureUtils", "name": "awsV4BuildCanonicalRequestString", "signature": "String awsV4BuildCanonicalRequestString(HttpUriRequest httpMethod, String requestPayloadHexSha256Hash)", "start_line": 3, "modifiers": "public static", "params": [{"name": "httpMethod", "type": "HttpUriRequest"}, {"name": "r... |
155618699_62 | class OutputFormatsHandler implements CliOptionHandler {
@Override
public void handle(String optionValue, Options options) {
Set<OutputFormat> formats = ImmutableSet.of(OutputFormat.STDOUT);
if (!StringUtils.isBlank(optionValue)) {
try {
String[] formatStrings = opt... | // given
Options options = new Options();
// when
underTest.handle("something", options);
// then
assertThat(options.getOutputFormats()).isEqualTo(of(OutputFormat.STDOUT));
}
} | [FOCAL] @Override public void OutputFormatsHandler.handle(String optionValue, Options options)
[CLASS] class OutputFormatsHandler implements CliOptionHandler
[METRICS] loc=15 cc=3 branches=1 loops=0 returns=0 throws=0 nesting=2
[CALLS-EXTERNAL] ImmutableSet.of/1, StringUtils.isBlank/1, String.split/1, Arrays.stream(for... | /* static context
[FOCAL] @Override public void OutputFormatsHandler.handle(String optionValue, Options options)
[PATH1] if(!StringUtils.isBlank(optionValue))=T -> try-body throws
[PATH2] if(!StringUtils.isBlank(optionValue))=F
[INPUTS] branches=optionValue | result=-
[COLLABORATORS] param options:Options setOutputForm... | /* static context
[FOCAL] @Override public void OutputFormatsHandler.handle(String optionValue, Options options)
[PATH1] if(!StringUtils.isBlank(optionValue))=T -> try-body throws
[PATH2] if(!StringUtils.isBlank(optionValue))=F
[INPUTS] branches=optionValue | result=-
[COLLABORATORS] param options:Options setOutputForm... | true | ok | {"focal": {"class": "OutputFormatsHandler", "name": "handle", "signature": "void handle(String optionValue, Options options)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "optionValue", "type": "String"}, {"name": "options", "type": "Options"}], "return_type": "void"}, "class_info": {"name": "... |
155886348_74 | class RouteUtils {
public boolean isArrivalEvent(@NonNull RouteProgress routeProgress, @NonNull Milestone milestone) {
if (!(milestone instanceof BannerInstructionMilestone)) {
return false;
}
boolean isValidArrivalManeuverType = upcomingStepIsArrivalManeuverType(routeProgress)
|| currentStep... | DirectionsRoute route = buildTestDirectionsRoute();
int first = 0;
int lastInstruction = 1;
RouteLeg routeLeg = route.legs().get(first);
List<LegStep> routeSteps = routeLeg.steps();
int currentStepIndex = routeSteps.size() - 2;
int upcomingStepIndex = routeSteps.size() - 1;
LegStep curre... | [FOCAL] public boolean RouteUtils.isArrivalEvent(RouteProgress routeProgress, Milestone milestone)
[CLASS] class RouteUtils
[METRICS] loc=18 cc=4 branches=3 loops=0 returns=3 throws=0 nesting=2
[CALLS-INTERNAL] boolean currentStepIsArrivalManeuverType(RouteProgress routeProgress); boolean hasValidInstructions(List<Bann... | /* static context
[FOCAL] public boolean RouteUtils.isArrivalEvent(RouteProgress routeProgress, Milestone milestone)
[PATH1] if(!(milestone instanceof BannerInstructionMilestone))=F -> if(isValidArrivalManeuverType)=T -> if(hasValidInstructions(bannerInstructions, currentInstructions))=T -> return currentInstructions.e... | /* static context
[FOCAL] public boolean RouteUtils.isArrivalEvent(RouteProgress routeProgress, Milestone milestone)
[PATH1] if(!(milestone instanceof BannerInstructionMilestone))=F -> if(isValidArrivalManeuverType)=T -> if(hasValidInstructions(bannerInstructions, currentInstructions))=T -> return currentInstructions.e... | true | ok | {"focal": {"class": "RouteUtils", "name": "isArrivalEvent", "signature": "boolean isArrivalEvent(RouteProgress routeProgress, Milestone milestone)", "start_line": 3, "modifiers": "public", "params": [{"name": "routeProgress", "type": "RouteProgress"}, {"name": "milestone", "type": "Milestone"}], "return_type": "boolean... |
155931552_1 | class UtilFunctions {
@CustomFunctionResolver("DensityCustomFunctionResolver0")
public static Double Density(List<Tuple> things) {
if(things == null || things.size() == 0)
return null;
double sumDensity = 0.0;
int numValidThings = 0;
Double density = null;
... | List<Tuple> t = new ArrayList<Tuple>();
assertNull(UtilFunctions.Density(t));
}
} | [FOCAL] @CustomFunctionResolver("DensityCustomFunctionResolver0") public static Double UtilFunctions.Density(List<Tuple> things)
[CLASS] class UtilFunctions
[METRICS] loc=29 cc=7 branches=4 loops=1 returns=2 throws=1 nesting=4
[CALLS-EXTERNAL] List<Tuple>.size/0, Tuple.isNull/1, Math.abs/1, Tuple.getDouble/1, StreamBas... | /* static context
[FOCAL] @CustomFunctionResolver("DensityCustomFunctionResolver0") public static Double UtilFunctions.Density(List<Tuple> things)
[THROWS-WHEN] StreamBaseRuntimeException when !(things == null || things.size() == 0) && try-body throws
[PATH1] if(things == null || things.size() == 0)=F -> foreach(Tuple ... | /* static context
[FOCAL] @CustomFunctionResolver("DensityCustomFunctionResolver0") public static Double UtilFunctions.Density(List<Tuple> things)
[THROWS-WHEN] StreamBaseRuntimeException when !(things == null || things.size() == 0) && try-body throws
[PATH1] if(things == null || things.size() == 0)=F -> foreach(Tuple ... | true | ok | {"focal": {"class": "UtilFunctions", "name": "Density", "signature": "Double Density(List<Tuple> things)", "start_line": 3, "modifiers": "@CustomFunctionResolver(\"DensityCustomFunctionResolver0\") public static", "params": [{"name": "things", "type": "List<Tuple>"}], "return_type": "Double"}, "class_info": {"name": "U... |
155961075_0 | class DefaultGraphQLInvocation implements GraphQLInvocation {
@Override
public Mono<ExecutionResult> invoke(GraphQLInvocationData invocationData, ServerWebExchange serverWebExchange) {
ExecutionInput.Builder executionInputBuilder = ExecutionInput.newExecutionInput()
.query(invocationDat... |
String query = "query myQuery {foo}";
String operationName = "myQuery";
Map<String, Object> variables = new LinkedHashMap<>();
DefaultGraphQLInvocation defaultGraphQLInvocation = new DefaultGraphQLInvocation();
ExecutionInputCustomizer executionInputCustomizer = mock(ExecutionI... | [FOCAL] @Override public Mono<ExecutionResult> DefaultGraphQLInvocation.invoke(GraphQLInvocationData invocationData, ServerWebExchange serverWebExchange)
[CLASS] class DefaultGraphQLInvocation implements GraphQLInvocation
[METRICS] loc=13 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] ExecutionIn... | /* static context
[FOCAL] @Override public Mono<ExecutionResult> DefaultGraphQLInvocation.invoke(GraphQLInvocationData invocationData, ServerWebExchange serverWebExchange)
[PATH1] if(dataLoaderRegistry != null)=T -> return customizedExecutionInputMono.flatMap(customizedExecutionInput -> Mo...
[PATH2] if(dataLoaderRegis... | /* static context
[FOCAL] @Override public Mono<ExecutionResult> DefaultGraphQLInvocation.invoke(GraphQLInvocationData invocationData, ServerWebExchange serverWebExchange)
[PATH1] if(dataLoaderRegistry != null)=T -> return customizedExecutionInputMono.flatMap(customizedExecutionInput -> Mo...
[PATH2] if(dataLoaderRegis... | true | ok | {"focal": {"class": "DefaultGraphQLInvocation", "name": "invoke", "signature": "Mono<ExecutionResult> invoke(GraphQLInvocationData invocationData, ServerWebExchange serverWebExchange)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "invocationData", "type": "GraphQLInvocationData"}, {"name": "se... |
156101856_17 | class PlantUMLClassDiagramGenerator {
public String generateDiagramText() throws ClassNotFoundException, IOException {
resolvedClasses.clear();
// read all classes from directories or jars
resolvedClasses.addAll(getAllDiagramClasses());
// sort all classes for a reliable sorted result
Collections.sort(resol... | String filename = "0018_blacklist_fields.txt";
URL testResourceURL = this.getClass().getClassLoader().getResource(filename);
String testResourceURLString = testResourceURL.toString();
String testClassPath = testResourceURLString.substring(0, testResourceURLString.length() - filename.length())
+ "../../src/t... | [FOCAL] public String PlantUMLClassDiagramGenerator.generateDiagramText()
[CLASS] class PlantUMLClassDiagramGenerator
[METRICS] loc=49 cc=4 branches=0 loops=3 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] Set<Class<?>> getAllDiagramClasses(); void addHideToggles(StringBuilder paramBuilder, Collection<UMLClass> paramCla... | class PlantUMLClassDiagramGenerator {
public String generateDiagramText() throws ClassNotFoundException, IOException {
resolvedClasses.clear();
// read all classes from directories or jars
resolvedClasses.addAll(getAllDiagramClasses());
// sort all classes for a reliable sorted result
Collections.sort(resol... | false | ok | {"focal": {"class": "PlantUMLClassDiagramGenerator", "name": "generateDiagramText", "signature": "String generateDiagramText() throws ClassNotFoundException, IOException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "PlantUMLClassDiagramGenerator", "kind": "cla... | |
156298013_124 | class Convert {
public static BigDecimal toSha(String number, Unit unit) {
return toSha(new BigDecimal(number), unit);
}
private Convert();
public static BigDecimal fromSha(String number, Unit unit);
public static BigDecimal fromSha(BigDecimal number, Unit unit);
public static BigDec... | assertThat(Convert.toSha("21", Convert.Unit.SHA), is(new BigDecimal("21")));
assertThat(Convert.toSha("21", Convert.Unit.KSHA), is(new BigDecimal("21000")));
assertThat(Convert.toSha("21", Convert.Unit.MSHA), is(new BigDecimal("21000000")));
assertThat(Convert.toSha("21", Convert.Unit.GS... | [FOCAL] public static BigDecimal Convert.toSha(String number, Unit unit)
[CLASS] class Convert
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] BigDecimal toSha(BigDecimal number, Unit unit)
[NEW] BigDecimal
[INPUTS] branches=- | result=number, unit
[DATAFLOW] number@param->L2; unit... | /* static context
[FOCAL] public static BigDecimal Convert.toSha(String number, Unit unit)
[INPUTS] branches=- | result=number, unit
[CALLS-INTERNAL] BigDecimal toSha(BigDecimal number, Unit unit)
[NEW] BigDecimal
*/
| /* static context
[FOCAL] public static BigDecimal Convert.toSha(String number, Unit unit)
[INPUTS] branches=- | result=number, unit
[CALLS-INTERNAL] BigDecimal toSha(BigDecimal number, Unit unit)
[NEW] BigDecimal
*/
class Convert {
public static BigDecimal toSha(String number, Unit unit) {
return toSha(ne... | true | ok | {"focal": {"class": "Convert", "name": "toSha", "signature": "BigDecimal toSha(String number, Unit unit)", "start_line": 3, "modifiers": "public static", "params": [{"name": "number", "type": "String"}, {"name": "unit", "type": "Unit"}], "return_type": "BigDecimal"}, "class_info": {"name": "Convert", "kind": "class", "... |
156317154_6 | class WildcardUtils {
@Nullable
public static LinearRange rangeOfMatch(String pattern, String str) {
List<LinearRange> literalRanges = getLiteralRanges(pattern);
int first = -1;
int pos = 0;
for (LinearRange literalRange: literalRanges) {
String literal = pattern.substring(literalRange.getFrom(), l... | assertEquals("1-3", rangeOfMatch("el", "hello").toString());
assertEquals(null, rangeOfMatch("tu", "hello"));
assertEquals("3-8", rangeOfMatch("lo*wo", "hello world").toString());
assertEquals("3-9", rangeOfMatch("lo*w?r", "hello world").toString());
assertEquals("12-37", rangeOfMatch("this*my*program", "hell... | [FOCAL] @Nullable public static LinearRange WildcardUtils.rangeOfMatch(String pattern, String str)
[CLASS] class WildcardUtils
[METRICS] loc=19 cc=4 branches=2 loops=1 returns=2 throws=0 nesting=3
[CALLS-INTERNAL] List<LinearRange> getLiteralRanges(String pattern); int indexOf(String str, String substr, int index)
[CAL... | /* static context
[FOCAL] @Nullable public static LinearRange WildcardUtils.rangeOfMatch(String pattern, String str)
[PATH1] foreach(LinearRange literalRange : literalRanges)=T -> if(index != -1)=T -> if(first == -1)=T -> exit loop -> return new LinearRange(first, pos)
[PATH2] foreach(LinearRange literalRange : literal... | /* static context
[FOCAL] @Nullable public static LinearRange WildcardUtils.rangeOfMatch(String pattern, String str)
[PATH1] foreach(LinearRange literalRange : literalRanges)=T -> if(index != -1)=T -> if(first == -1)=T -> exit loop -> return new LinearRange(first, pos)
[PATH2] foreach(LinearRange literalRange : literal... | true | ok | {"focal": {"class": "WildcardUtils", "name": "rangeOfMatch", "signature": "LinearRange rangeOfMatch(String pattern, String str)", "start_line": 3, "modifiers": "@Nullable public static", "params": [{"name": "pattern", "type": "String"}, {"name": "str", "type": "String"}], "return_type": "LinearRange"}, "class_info": {"... |
156459372_14 | class Exercise4 {
static <A> List<A> reverse(final List<A> list) {
return Lists.foldLeft(list, Collections.emptyList(),
(reversedList, item) -> Lists.prepend(item, reversedList)
);
}
static Integer maximum(final List<Integer> list);
static Integer minimum(final List<Int... | // given:
final List<Integer> list = asList(1, 2, 3, 4);
final List<Integer> expected = asList(4, 3, 2, 1);
// when:
final List<Integer> actual = Exercise4.reverse(list);
// then:
assertThat(actual, is(expected));
}
} | [FOCAL] static List<A> Exercise4.reverse(List<A> list)
[CLASS] class Exercise4
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Lists.foldLeft/3, Collections.emptyList/0, Lists.prepend/2
[INPUTS] branches=- | result=list
[DATAFLOW] list@param->L2
[CLASS-MEMBERS] Integer maximum(List... | /* static context
[FOCAL] static List<A> Exercise4.reverse(List<A> list)
[INPUTS] branches=- | result=list
[CALLS-EXTERNAL] Lists.foldLeft/3, Collections.emptyList/0, Lists.prepend/2
*/
| /* static context
[FOCAL] static List<A> Exercise4.reverse(List<A> list)
[INPUTS] branches=- | result=list
[CALLS-EXTERNAL] Lists.foldLeft/3, Collections.emptyList/0, Lists.prepend/2
*/
class Exercise4 {
static <A> List<A> reverse(final List<A> list) {
return Lists.foldLeft(list, Collections.emptyList(),
... | true | ok | {"focal": {"class": "Exercise4", "name": "reverse", "signature": "List<A> reverse(List<A> list)", "start_line": 3, "modifiers": "static", "params": [{"name": "list", "type": "List<A>"}], "return_type": "List<A>"}, "class_info": {"name": "Exercise4", "kind": "class", "modifiers": "", "superclass": null, "interfaces": nu... |
156601203_7 | class ThriftLogContext {
public static void setRequestHeader(RequestHeader header) {
threadLocal.get().setHeader(header);
}
private ThriftLogContext();
public static void newExecution();
public static long getTraceId();
public static void setTraceId(long traceId);
public static l... | RequestHeader requestHeader = new RequestHeader();
requestHeader.setTraceId(0xDEAD);
requestHeader.setSpanId(0xDEAF);
requestHeader.setSampled(true);
ThriftLogContext.setRequestHeader(requestHeader);
assertEquals(MDC.get(ThriftLogContext.TRACE_ID), "dead");
asse... | [FOCAL] public static void ThriftLogContext.setRequestHeader(RequestHeader header)
[CLASS] class ThriftLogContext
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] threadLocal.get().setHeader/1, threadLocal.get/0
[COLLABORATORS] field threadLocal get/0
[DATAFLOW] header@param->L2
[CL... | /* static context
[FOCAL] public static void ThriftLogContext.setRequestHeader(RequestHeader header)
[COLLABORATORS] field threadLocal get/0
[CALLS-EXTERNAL] threadLocal.get().setHeader/1, threadLocal.get/0
*/
| /* static context
[FOCAL] public static void ThriftLogContext.setRequestHeader(RequestHeader header)
[COLLABORATORS] field threadLocal get/0
[CALLS-EXTERNAL] threadLocal.get().setHeader/1, threadLocal.get/0
*/
class ThriftLogContext {
public static void setRequestHeader(RequestHeader header) {
threadLocal.... | true | ok | {"focal": {"class": "ThriftLogContext", "name": "setRequestHeader", "signature": "void setRequestHeader(RequestHeader header)", "start_line": 3, "modifiers": "public static", "params": [{"name": "header", "type": "RequestHeader"}], "return_type": "void"}, "class_info": {"name": "ThriftLogContext", "kind": "class", "mod... |
156606443_2 | class Sort {
public static void sortUnsigned(long[] data) {
sortUnsigned(data, 0, data.length);
}
public static void sortUnsigned(long[] data, int offset, int len);
}
class SortTest {
@Test
public void sortUnsignedShifted() {
| Random r = new Random(1);
for (int test = 0; test < 1000; test++) {
int len = r.nextBoolean() ? r.nextInt(10) : r.nextInt(1000);
int rotate = r.nextInt(60);
long[] data = new long[len];
long xor = 0;
for (int i = 0; i < len; i++) {
... | [FOCAL] public static void Sort.sortUnsigned(long[] data)
[CLASS] class Sort
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void sortUnsigned(long[] data, int offset, int len)
[DATAFLOW] data@param->L2
[CLASS-MEMBERS] void sortUnsigned(long[] data, int offset, int len)
[TEST] Sort... | /* static context
[FOCAL] public static void Sort.sortUnsigned(long[] data)
[CALLS-INTERNAL] void sortUnsigned(long[] data, int offset, int len)
*/
| /* static context
[FOCAL] public static void Sort.sortUnsigned(long[] data)
[CALLS-INTERNAL] void sortUnsigned(long[] data, int offset, int len)
*/
class Sort {
public static void sortUnsigned(long[] data) {
sortUnsigned(data, 0, data.length);
}
public static void sortUnsigned(long[] data, int off... | true | ok | {"focal": {"class": "Sort", "name": "sortUnsigned", "signature": "void sortUnsigned(long[] data)", "start_line": 3, "modifiers": "public static", "params": [{"name": "data", "type": "long[]"}], "return_type": "void"}, "class_info": {"name": "Sort", "kind": "class", "modifiers": "", "superclass": null, "interfaces": nul... |
156613410_3 | class Util {
public static String addForInterface(String interfaceType) {
if (interfaceType.contains("<")) {
return null;
}
return shortName(interfaceType);
}
static boolean isVoid(String type);
static boolean notVoid(String type);
static String classOfMethod(String method);
static Strin... | assertNull(Util.addForInterface("java.util.List<Some>"));
assertEquals("Bar", Util.addForInterface("com.foo.Bar"));
}
} | [FOCAL] public static String Util.addForInterface(String interfaceType)
[CLASS] class Util
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] String shortName(String fullType)
[CALLS-EXTERNAL] String.contains/1
[PATH1] if(interfaceType.contains("<"))=T -> return null
[PATH2] if(interf... | /* static context
[FOCAL] public static String Util.addForInterface(String interfaceType)
[PATH1] if(interfaceType.contains("<"))=T -> return null
[PATH2] if(interfaceType.contains("<"))=F -> return shortName(interfaceType)
[INPUTS] branches=interfaceType | result=interfaceType
[CALLS-INTERNAL] String shortName(String ... | /* static context
[FOCAL] public static String Util.addForInterface(String interfaceType)
[PATH1] if(interfaceType.contains("<"))=T -> return null
[PATH2] if(interfaceType.contains("<"))=F -> return shortName(interfaceType)
[INPUTS] branches=interfaceType | result=interfaceType
[CALLS-INTERNAL] String shortName(String ... | true | ok | {"focal": {"class": "Util", "name": "addForInterface", "signature": "String addForInterface(String interfaceType)", "start_line": 3, "modifiers": "public static", "params": [{"name": "interfaceType", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Util", "kind": "class", "modifiers": "", "supercla... |
156655880_128 | class StringUtils {
@SuppressWarnings("StringEquality")
public static boolean isEqual(String s1, String s2) {
if (s1 == null || s2 == null) {
return s1 == s2;
}
return s1.equals(s2);
}
}
class StringUtilsTest {
@Test
public void isEqual() throws Exception {
| assertThat(StringUtils.isEqual(null, "a")).isFalse();
assertThat(StringUtils.isEqual("a", null)).isFalse();
assertThat(StringUtils.isEqual("a", "b")).isFalse();
assertThat(StringUtils.isEqual("a", "A")).isFalse();
assertThat(StringUtils.isEqual("a", "a")).isTrue();
assert... | [FOCAL] @SuppressWarnings("StringEquality") public static boolean StringUtils.isEqual(String s1, String s2)
[CLASS] class StringUtils
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] String.equals/1
[PATH1] if(s1 == null || s2 == null)=T -> return s1 == s2
[PATH2] if(s1 == null || s... | /* static context
[FOCAL] @SuppressWarnings("StringEquality") public static boolean StringUtils.isEqual(String s1, String s2)
[PATH1] if(s1 == null || s2 == null)=T -> return s1 == s2
[PATH2] if(s1 == null || s2 == null)=F -> return s1.equals(s2)
[INPUTS] branches=s1, s2 | result=s1, s2
[CALLS-EXTERNAL] String.equals/1... | /* static context
[FOCAL] @SuppressWarnings("StringEquality") public static boolean StringUtils.isEqual(String s1, String s2)
[PATH1] if(s1 == null || s2 == null)=T -> return s1 == s2
[PATH2] if(s1 == null || s2 == null)=F -> return s1.equals(s2)
[INPUTS] branches=s1, s2 | result=s1, s2
[CALLS-EXTERNAL] String.equals/1... | true | ok | {"focal": {"class": "StringUtils", "name": "isEqual", "signature": "boolean isEqual(String s1, String s2)", "start_line": 3, "modifiers": "@SuppressWarnings(\"StringEquality\") public static", "params": [{"name": "s1", "type": "String"}, {"name": "s2", "type": "String"}], "return_type": "boolean"}, "class_info": {"name... |
156706507_0 | class MarkdownReplayer implements InteractionMonitor {
public void setPlaybackConversation(String conversation) {
this.filename = "no filename set";
int charPosn = -1;
int ctr = 0;
boolean again = true;
while (again) {
charPosn = conversation.indexOf(SERVIRTIUM_I... | MarkdownReplayer m = new MarkdownReplayer();
try {
m.setPlaybackConversation("oh noes");
fail("should have barfed");
} catch (UnsupportedOperationException e) {
assertEquals("No '## Interaction' found in conversation 'oh noes'. Wrong/empty script file?", e.get... | [FOCAL] public void MarkdownReplayer.setPlaybackConversation(String conversation)
[CLASS] class MarkdownReplayer implements InteractionMonitor
[METRICS] loc=26 cc=6 branches=4 loops=1 returns=0 throws=1 nesting=3
[CALLS-EXTERNAL] String.indexOf/2, String.length/0, String.substring/2, allMarkdownInteractions.add/1, SERV... | /* static context
[FOCAL] public void MarkdownReplayer.setPlaybackConversation(String conversation)
[THROWS-WHEN] UnsupportedOperationException when again && charPosn > -1 && charEndPosn == -1 && ctr == 0 && charPosn == -1 && ctr == 0
[THROWS-WHEN] UnsupportedOperationException when again && charPosn > -1 && charEndPos... | /* static context
[FOCAL] public void MarkdownReplayer.setPlaybackConversation(String conversation)
[THROWS-WHEN] UnsupportedOperationException when again && charPosn > -1 && charEndPosn == -1 && ctr == 0 && charPosn == -1 && ctr == 0
[THROWS-WHEN] UnsupportedOperationException when again && charPosn > -1 && charEndPos... | true | ok | {"focal": {"class": "MarkdownReplayer", "name": "setPlaybackConversation", "signature": "void setPlaybackConversation(String conversation)", "start_line": 3, "modifiers": "public", "params": [{"name": "conversation", "type": "String"}], "return_type": "void"}, "class_info": {"name": "MarkdownReplayer", "kind": "class",... |
156776643_78 | class Events {
public <T> void subscribe(Object token, Consumer<T> consumer) {
Set<Consumer<?>> set = subscriptions.get(token);
if (set == null) {
set = new LinkedHashSet<>();
subscriptions.put(token, set);
}
set.add(consumer);
}
public void unsubscribe(Object topic);
public void unsubscribe(Object ... | Consumer<String> consumer = stringConsumerMock();
events.subscribe(TOKEN, consumer);
events.publish(TOKEN, "hello");
events.tick();
Mockito.verify(consumer)
.accept("hello");
}
} | [FOCAL] public void Events.subscribe(Object token, Consumer<T> consumer)
[CLASS] class Events
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] subscriptions.get/1, subscriptions.put/2, Set<Consumer<?>>.add/1
[NEW] LinkedHashSet<>
[PATH1] if(set == null)=T
[PATH2] if(set == null)=F
[... | /* static context
[FOCAL] public void Events.subscribe(Object token, Consumer<T> consumer)
[PATH1] if(set == null)=T
[PATH2] if(set == null)=F
[INPUTS] branches=token | result=-
[COLLABORATORS] field subscriptions get/1,put/2
[NEW] LinkedHashSet<>
[CALLS-EXTERNAL] subscriptions.get/1, subscriptions.put/2, Set<Consumer<... | /* static context
[FOCAL] public void Events.subscribe(Object token, Consumer<T> consumer)
[PATH1] if(set == null)=T
[PATH2] if(set == null)=F
[INPUTS] branches=token | result=-
[COLLABORATORS] field subscriptions get/1,put/2
[NEW] LinkedHashSet<>
[CALLS-EXTERNAL] subscriptions.get/1, subscriptions.put/2, Set<Consumer<... | true | ok | {"focal": {"class": "Events", "name": "subscribe", "signature": "void subscribe(Object token, Consumer<T> consumer)", "start_line": 3, "modifiers": "public", "params": [{"name": "token", "type": "Object"}, {"name": "consumer", "type": "Consumer<T>"}], "return_type": "void"}, "class_info": {"name": "Events", "kind": "cl... |
156879211_11 | class CorePeripheral implements Peripheral {
@Override
public Single<Integer> readRssi() {
SingleSubject<Integer> scopedSubject = SingleSubject.create();
return scopedSubject
.doOnSubscribe(disposable -> processReadRssi(scopedSubject))
.doFinally(() -> clearReadRssiSubject(scopedSubject));... | readRssiTestObserver = corePeripheral.readRssi().test();
readRssiTestObserver.assertError(
throwable -> {
PeripheralError error = (PeripheralError) throwable;
return error != null && error.getCode() == DISCONNECTED;
});
}
} | [FOCAL] @Override public Single<Integer> CorePeripheral.readRssi()
[CLASS] class CorePeripheral implements Peripheral
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] void clearReadRssiSubject(SingleSubject<Integer> scopedSubject); void processReadRssi(SingleSubject<Integer> scopedS... | /* static context
[FOCAL] @Override public Single<Integer> CorePeripheral.readRssi()
[CALLS-INTERNAL] void clearReadRssiSubject(SingleSubject<Integer> scopedSubject); void processReadRssi(SingleSubject<Integer> scopedSubject)
[CALLS-EXTERNAL] SingleSubject.create/0, scopedSubject .doOnSubscribe(disposable -> processRea... | /* static context
[FOCAL] @Override public Single<Integer> CorePeripheral.readRssi()
[CALLS-INTERNAL] void clearReadRssiSubject(SingleSubject<Integer> scopedSubject); void processReadRssi(SingleSubject<Integer> scopedSubject)
[CALLS-EXTERNAL] SingleSubject.create/0, scopedSubject .doOnSubscribe(disposable -> processRea... | true | ok | {"focal": {"class": "CorePeripheral", "name": "readRssi", "signature": "Single<Integer> readRssi()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Single<Integer>"}, "class_info": {"name": "CorePeripheral", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Peripheral... |
157118635_2 | class HelloWorldMapper extends AbstractOIDCProtocolMapper implements OIDCAccessTokenMapper, OIDCIDTokenMapper, UserInfoTokenMapper {
@Override
public String getHelpText() {
return "Adds a hello world text to the claim";
}
@Override public String getDisplayCategory();
@Override public Strin... | assertThat(new HelloWorldMapper().getHelpText()).isNotBlank();
}
} | [FOCAL] @Override public String HelloWorldMapper.getHelpText()
[CLASS] class HelloWorldMapper extends AbstractOIDCProtocolMapper implements OIDCAccessTokenMapper, OIDCIDTokenMapper, UserInfoTokenMapper
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] String getDisplayCategory(); Stri... | /* static context
[FOCAL] @Override public String HelloWorldMapper.getHelpText()
*/
| /* static context
[FOCAL] @Override public String HelloWorldMapper.getHelpText()
*/
class HelloWorldMapper extends AbstractOIDCProtocolMapper implements OIDCAccessTokenMapper, OIDCIDTokenMapper, UserInfoTokenMapper {
@Override
public String getHelpText() {
return "Adds a hello world text to the claim";... | true | ok | {"focal": {"class": "HelloWorldMapper", "name": "getHelpText", "signature": "String getHelpText()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "HelloWorldMapper", "kind": "class", "modifiers": "", "superclass": "AbstractOIDCProtocolMapper", "interfac... |
157370190_20 | class Payslip {
public double getNet() {
final double ltbg = Math.max(Math.min(sal, 20000.0) - 5000, 0.0);
final double mtbg = Math.max(Math.min(sal, 40000) - 20000, 0.0);
final double utbg = Math.max(sal - 40000, 0.0);
return sal - (ltbg * 0.1 + mtbg * 0.2 + utbg * 0.4);
}
... | final Payslip payslip = new Payslip(50000);
assertEquals(40500, payslip.getNet(), 1e-6);
final Payslip payslip2 = new Payslip(60000);
assertEquals(46500, payslip2.getNet(), 1e-6);
}
} | [FOCAL] public double Payslip.getNet()
[CLASS] class Payslip
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Math.max/2, Math.min/2
[DATAFLOW] ltbg@L2->L5; mtbg@L3->L5; utbg@L4->L5
[CLASS-MEMBERS] Payslip(double slry)
[TEST] PayslipTest: @Test public void taxOnAmountInUpperTaxBrack... | /* static context
[FOCAL] public double Payslip.getNet()
[CALLS-EXTERNAL] Math.max/2, Math.min/2
*/
| /* static context
[FOCAL] public double Payslip.getNet()
[CALLS-EXTERNAL] Math.max/2, Math.min/2
*/
class Payslip {
public double getNet() {
final double ltbg = Math.max(Math.min(sal, 20000.0) - 5000, 0.0);
final double mtbg = Math.max(Math.min(sal, 40000) - 20000, 0.0);
final double utbg =... | true | ok | {"focal": {"class": "Payslip", "name": "getNet", "signature": "double getNet()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "double"}, "class_info": {"name": "Payslip", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Payslip", "kind... |
157413720_40 | class ExtendsDirectiveProcessor extends DirectiveProcessor<DiffableScope> {
@Override
@SuppressWarnings("unchecked")
public void process(DiffableScope scope, DirectiveNode node) {
validateArguments(node, 1, 1);
validateOptionArguments(node, "exclude", 0, 1);
validateOptionArguments(... | scope.put("f", ImmutableList.of(1L, 2L, 3L));
processor.process(scope, parse("@extends: { f: [ 4, 5 ] } -merge true"));
assertThat(scope.get("f")).isEqualTo(ImmutableList.of(1L, 2L, 3L, 4L, 5L));
}
} | [FOCAL] @Override @SuppressWarnings("unchecked") public void ExtendsDirectiveProcessor.process(DiffableScope scope, DirectiveNode node)
[CLASS] class ExtendsDirectiveProcessor extends DirectiveProcessor<DiffableScope>
[METRICS] loc=54 cc=6 branches=5 loops=0 returns=0 throws=2 nesting=4
[CALLS-INTERNAL] Object merge(Ob... | /* static context
[FOCAL] @Override @SuppressWarnings("unchecked") public void ExtendsDirectiveProcessor.process(DiffableScope scope, DirectiveNode node)
[THROWS-WHEN] GyroException when source == null
[THROWS-WHEN] GyroException when !(source == null) && !(source instanceof Map) && !(source instanceof Resource)
[PATH1... | /* static context
[FOCAL] @Override @SuppressWarnings("unchecked") public void ExtendsDirectiveProcessor.process(DiffableScope scope, DirectiveNode node)
[THROWS-WHEN] GyroException when source == null
[THROWS-WHEN] GyroException when !(source == null) && !(source instanceof Map) && !(source instanceof Resource)
[PATH1... | true | ok | {"focal": {"class": "ExtendsDirectiveProcessor", "name": "process", "signature": "void process(DiffableScope scope, DirectiveNode node)", "start_line": 3, "modifiers": "@Override @SuppressWarnings(\"unchecked\") public", "params": [{"name": "scope", "type": "DiffableScope"}, {"name": "node", "type": "DirectiveNode"}], ... |
157564875_4 | class DirectoryStructureReader {
public DirectoryStructure readDirectoryStructure(
String rootDirectory, String include, String exclude
) throws IOException {
FileFilter filter = FileFilter.of(rootDirectory, include, exclude);
List<FileEntry> allFilesEntries = directoryLister.listFiles(rootDirectory, filter);
... | createDirsAndFiles();
DirectoryStructure structure = reader.readDirectoryStructure(root.getName(), null, null);
assertStructure(structure)
.hasDirectories("dir1", "dir2", "dir3", "dir3/dir3X", "dir3/dir3Y")
.hasFiles("fileA", "fileB", "dir1/file1A", "dir1/file1B", "dir2/file2A", "dir3/dir3X/file3XA");
}
} | [FOCAL] public DirectoryStructure DirectoryStructureReader.readDirectoryStructure(String rootDirectory, String include, String exclude)
[CLASS] class DirectoryStructureReader
[METRICS] loc=18 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] FileFilter.of/3, directoryLister.listFiles/2, DirectoryStr... | /* static context
[FOCAL] public DirectoryStructure DirectoryStructureReader.readDirectoryStructure(String rootDirectory, String include, String exclude)
[PATH1] foreach(FileEntry fileEntry : allFilesEntries)=T -> if(fileEntry.isDirectory())=T -> exit loop -> return structureBuilder.build()
[PATH2] foreach(FileEntry fi... | /* static context
[FOCAL] public DirectoryStructure DirectoryStructureReader.readDirectoryStructure(String rootDirectory, String include, String exclude)
[PATH1] foreach(FileEntry fileEntry : allFilesEntries)=T -> if(fileEntry.isDirectory())=T -> exit loop -> return structureBuilder.build()
[PATH2] foreach(FileEntry fi... | true | ok | {"focal": {"class": "DirectoryStructureReader", "name": "readDirectoryStructure", "signature": "DirectoryStructure readDirectoryStructure(String rootDirectory, String include, String exclude) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "rootDirectory", "type": "String"}, {"name": "i... |
157572651_4 | class ReactiveResilience4JCircuitBreaker implements ReactiveCircuitBreaker {
@Override
public <T> Mono<T> run(Mono<T> toRun, Function<Throwable, Mono<T>> fallback) {
io.github.resilience4j.circuitbreaker.CircuitBreaker defaultCircuitBreaker = registry.circuitBreaker(id,
config.getCircuitBreakerConfig());
cir... | ReactiveCircuitBreaker cb = new ReactiveResilience4JCircuitBreakerFactory().create("foo");
assertThat(Mono.just("foobar").transform(it -> cb.run(it)).block()).isEqualTo("foobar");
}
} | [FOCAL] @Override public Mono<T> ReactiveResilience4JCircuitBreaker.run(Mono<T> toRun, Function<Throwable, Mono<T>> fallback)
[CLASS] class ReactiveResilience4JCircuitBreaker implements ReactiveCircuitBreaker
[METRICS] loc=18 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] registry.circuitBreaker/... | /* static context
[FOCAL] @Override public Mono<T> ReactiveResilience4JCircuitBreaker.run(Mono<T> toRun, Function<Throwable, Mono<T>> fallback)
[PATH1] if(fallback != null)=T -> return toReturn
[PATH2] if(fallback != null)=F -> return toReturn
[INPUTS] branches=fallback | result=fallback, toRun
[COLLABORATORS] field re... | /* static context
[FOCAL] @Override public Mono<T> ReactiveResilience4JCircuitBreaker.run(Mono<T> toRun, Function<Throwable, Mono<T>> fallback)
[PATH1] if(fallback != null)=T -> return toReturn
[PATH2] if(fallback != null)=F -> return toReturn
[INPUTS] branches=fallback | result=fallback, toRun
[COLLABORATORS] field re... | true | ok | {"focal": {"class": "ReactiveResilience4JCircuitBreaker", "name": "run", "signature": "Mono<T> run(Mono<T> toRun, Function<Throwable, Mono<T>> fallback)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "toRun", "type": "Mono<T>"}, {"name": "fallback", "type": "Function<Throwable, Mono<T>>"}], "re... |
157765359_1 | class EiDASCertificate {
public String addPsdAttibutes( String certificate, String privatekey, String passphrase, String organizationIdentifier, String ncaname, String ncaid, List<String> roles ) {
String pemCertificate = certificate.replaceAll("\\\\n", "\n");
EiDASCertificate eidascert... |
String orgId = null;
String ncaName = "Auth";
String ncaId = "Germany";
List<String> roles = new ArrayList<String>(Arrays.asList( "PSP_AS", "PSP_PI", "PSP_AI", "PSP_IC" ));
EiDASCertificate eidascert = new EiDASCertificate();
String certpem = eidascert.addPsdAttibutes( c, k, p, or... | [FOCAL] public String EiDASCertificate.addPsdAttibutes(String certificate, String privatekey, String passphrase, String organizationIdentifier, String ncaname, String ncaid, List<String> roles)
[CLASS] class EiDASCertificate
[METRICS] loc=47 cc=2 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] String.r... | class EiDASCertificate {
public String addPsdAttibutes( String certificate, String privatekey, String passphrase, String organizationIdentifier, String ncaname, String ncaid, List<String> roles ) {
String pemCertificate = certificate.replaceAll("\\\\n", "\n");
EiDASCertificate eidascert... | false | ok | {"focal": {"class": "EiDASCertificate", "name": "addPsdAttibutes", "signature": "String addPsdAttibutes(String certificate, String privatekey, String passphrase, String organizationIdentifier, String ncaname, String ncaid, List<String> roles)", "start_line": 3, "modifiers": "public", "params": [{"name": "certificate", ... | |
157848372_23 | class OngoingMissionRun {
public ReturnHelper<Result> returnResult() {
return new ReturnHelper<Result>(new ReturnResult());
}
public OngoingMissionRun(Mole mole, Mono<MissionHandle> handle);
public OngoingMissionRun and();
public void forget();
protected Mole mole();
public Mono<... | OngoingMissionRun.ReturnHelper<Result> resultReturnHelper = run.returnResult();
assertNotNull(resultReturnHelper.whenFinished());
assertThat(resultReturnHelper.whenFinished(), instanceOf(Result.class));
assertEquals(Result.SUCCESS, resultReturnHelper.whenFinished());
assertNotN... | [FOCAL] public ReturnHelper<Result> OngoingMissionRun.returnResult()
[CLASS] class OngoingMissionRun
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] ReturnHelper<Result>, ReturnResult
[CLASS-MEMBERS] OngoingMissionRun(Mole mole, Mono<MissionHandle> handle); OngoingMissionRun and(); void forge... | /* static context
[FOCAL] public ReturnHelper<Result> OngoingMissionRun.returnResult()
[NEW] ReturnHelper<Result>, ReturnResult
*/
| /* static context
[FOCAL] public ReturnHelper<Result> OngoingMissionRun.returnResult()
[NEW] ReturnHelper<Result>, ReturnResult
*/
class OngoingMissionRun {
public ReturnHelper<Result> returnResult() {
return new ReturnHelper<Result>(new ReturnResult());
}
public OngoingMissionRun(Mole mole, Mono... | true | ok | {"focal": {"class": "OngoingMissionRun", "name": "returnResult", "signature": "ReturnHelper<Result> returnResult()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "ReturnHelper<Result>"}, "class_info": {"name": "OngoingMissionRun", "kind": "class", "modifiers": "", "superclass": null, "interfaces... |
157902250_1306 | class HttpClient {
public String post(Map<String, String> parameters) {
OutputStreamWriter wr = null;
BufferedReader rd = null;
String response = "";
StringBuilder data = new StringBuilder();
try {
// Construct data
for (Map.Entry<String, String> entry : parameters.entrySet()) {
// skip ov... | Map<String, String> parameters = new TreeMap<>();
parameters.put("one", "one");
parameters.put("two", "two");
ByteArrayOutputStream stream = new ByteArrayOutputStream();
when(connection.getOutputStream()).thenReturn(stream);
when(connection.getInputStream()).thenReturn(new ByteArrayInputStream("response"... | [FOCAL] public String HttpClient.post(Map<String, String> parameters)
[CLASS] class HttpClient
[METRICS] loc=67 cc=9 branches=3 loops=2 returns=1 throws=0 nesting=3
[CALLS-EXTERNAL] Map<String, String>.entrySet/0, Map.Entry<String, String>.getKey/0, Map.Entry<String, String>.getValue/0, StringBuilder.append/1, URLEncod... | /* static context
[FOCAL] public String HttpClient.post(Map<String, String> parameters)
[PATH1] foreach(Map.Entry<String, String> entry : parameters.entrySet())=T -> if(entry.getKey() == null || entry.getValue() == null)=T -> exit loop -> while((line = rd.readLine()) != null)=F -> if(wr != null)=T -> try-body throws ->... | /* static context
[FOCAL] public String HttpClient.post(Map<String, String> parameters)
[PATH1] foreach(Map.Entry<String, String> entry : parameters.entrySet())=T -> if(entry.getKey() == null || entry.getValue() == null)=T -> exit loop -> while((line = rd.readLine()) != null)=F -> if(wr != null)=T -> try-body throws ->... | true | ok | {"focal": {"class": "HttpClient", "name": "post", "signature": "String post(Map<String, String> parameters)", "start_line": 3, "modifiers": "public", "params": [{"name": "parameters", "type": "Map<String, String>"}], "return_type": "String"}, "class_info": {"name": "HttpClient", "kind": "class", "modifiers": "", "super... |
157945047_38 | class SmcpDiscoveryQuery extends DiscoveryQuery {
@Override
public Set<Thing> get() throws InterruptedException, TechnologyException {
if (!mTimeout.isCancelled()) {
try {
mTimeout.get(mTimeoutInMs, TimeUnit.MILLISECONDS);
} catch (CancellationException | Timeou... | try {
SmcpTechnology techHosting = new SmcpTechnology(mContextA);
SmcpTechnology techBacking = new SmcpTechnology(mContextA);
MyLightBulb localFe = new MyLightBulb();
techHosting
.getServer()
.addLocalEndpoint(
... | [FOCAL] @Override public Set<Thing> SmcpDiscoveryQuery.get()
[CLASS] class SmcpDiscoveryQuery extends DiscoveryQuery
[METRICS] loc=29 cc=7 branches=4 loops=0 returns=1 throws=4 nesting=3
[CALLS-EXTERNAL] mTimeout.isCancelled/0, mTimeout.get/2
[NEW] TechnologyRuntimeException, TechnologyException, HashSet<>
[EXCEPTIONS]... | /* static context
[FOCAL] @Override public Set<Thing> SmcpDiscoveryQuery.get()
[THROWS-WHEN] (TechnologyException) mException when !mTimeout.isCancelled() && try-body throws && mException instanceof TechnologyException
[THROWS-WHEN] (RuntimeException) mException when !mTimeout.isCancelled() && try-body throws && !(mExc... | /* static context
[FOCAL] @Override public Set<Thing> SmcpDiscoveryQuery.get()
[THROWS-WHEN] (TechnologyException) mException when !mTimeout.isCancelled() && try-body throws && mException instanceof TechnologyException
[THROWS-WHEN] (RuntimeException) mException when !mTimeout.isCancelled() && try-body throws && !(mExc... | true | ok | {"focal": {"class": "SmcpDiscoveryQuery", "name": "get", "signature": "Set<Thing> get() throws InterruptedException, TechnologyException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Set<Thing>"}, "class_info": {"name": "SmcpDiscoveryQuery", "kind": "class", "modifiers": "", "supercl... |
158186574_12 | class JSONDecoder extends AbstractJSONDecoder {
@Override
public TEvent decode(String source) throws DecodeException {
JSONObject object = parse(source);
TEvent event = new TEvent();
decodeToEvent(event, object);
return event;
}
public void init();
@Override public ... | TEvent event = new TEvent();
JSONDecoder decoder = new JSONDecoder();
decoder.decode(simpleSource1, event, "tgt");
JSONObject o = (JSONObject)event.get("tgt");
Assert.assertEquals("name1", o.getString("name"));
Assert.assertEquals("type1", o.getString("type"));
}
} | [FOCAL] @Override public TEvent JSONDecoder.decode(String source)
[CLASS] class JSONDecoder extends AbstractJSONDecoder
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] JSONObject parse(String text); void decodeToEvent(TEvent event, JSONObject object)
[NEW] TEvent
[EXCEPTIONS] decla... | /* static context
[FOCAL] @Override public TEvent JSONDecoder.decode(String source)
[EXCEPTIONS] declares DecodeException
[CALLS-INTERNAL] JSONObject parse(String text); void decodeToEvent(TEvent event, JSONObject object)
[NEW] TEvent
*/
| /* static context
[FOCAL] @Override public TEvent JSONDecoder.decode(String source)
[EXCEPTIONS] declares DecodeException
[CALLS-INTERNAL] JSONObject parse(String text); void decodeToEvent(TEvent event, JSONObject object)
[NEW] TEvent
*/
class JSONDecoder extends AbstractJSONDecoder {
@Override
public TEvent d... | true | ok | {"focal": {"class": "JSONDecoder", "name": "decode", "signature": "TEvent decode(String source) throws DecodeException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "source", "type": "String"}], "return_type": "TEvent"}, "class_info": {"name": "JSONDecoder", "kind": "class", "modifiers": "", "... |
158213242_39 | class DefaultFormEntityProvider implements FormEntityProvider {
@Override
public Form getForm(ContainerRequestContext context) throws IOException {
final InputStream is = context.getEntityStream();
// Ensure stream can be restored for next interceptor
InputStream bufferedStream;
... | EasyMock.expect(context.getEntityStream()).andReturn(new ByteArrayInputStream("foo=bar".getBytes()));
EasyMock.expect(context.getMediaType()).andReturn(MediaType.APPLICATION_FORM_URLENCODED_TYPE);
context.setEntityStream(EasyMock.anyObject(InputStream.class));
EasyMock.replay(context);
... | [FOCAL] @Override public Form DefaultFormEntityProvider.getForm(ContainerRequestContext context)
[CLASS] class DefaultFormEntityProvider implements FormEntityProvider
[METRICS] loc=26 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] Form parseForm(String entity); String toString(InputStream bais, S... | /* static context
[FOCAL] @Override public Form DefaultFormEntityProvider.getForm(ContainerRequestContext context)
[PATH1] if(is.markSupported())=T -> return form
[PATH2] if(is.markSupported())=F -> return form
[INPUTS] branches=context | result=context
[COLLABORATORS] param context:ContainerRequestContext getEntityStr... | /* static context
[FOCAL] @Override public Form DefaultFormEntityProvider.getForm(ContainerRequestContext context)
[PATH1] if(is.markSupported())=T -> return form
[PATH2] if(is.markSupported())=F -> return form
[INPUTS] branches=context | result=context
[COLLABORATORS] param context:ContainerRequestContext getEntityStr... | true | ok | {"focal": {"class": "DefaultFormEntityProvider", "name": "getForm", "signature": "Form getForm(ContainerRequestContext context) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "context", "type": "ContainerRequestContext"}], "return_type": "Form"}, "class_info": {"name": "Defau... |
158267213_31 | class AuthorityService implements IAuthorityService {
@Override
public List<IAuthorityEntry> findByUri(IUser user, String uri) {
List<IAuthorityEntry> results = entryRepository.findByUsernameAndUriOrderByName(user.getUsername(), uri);
if (uri.endsWith("/")) {
uri = uri.substring(0, ... | String username = "user";
IUser user = new User();
user.setUsername(username);
String uri = "http://test.uri/";
String uriNoSlash = "http://test.uri";
IAuthorityEntry entry = new AuthorityEntry();
entry.setUri(uri);
List<IAuthorityEntry> entries = new Ar... | [FOCAL] @Override public List<IAuthorityEntry> AuthorityService.findByUri(IUser user, String uri)
[CLASS] class AuthorityService implements IAuthorityService
[METRICS] loc=11 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] AuthorityEntryRepository.findByUsernameAndUriOrderByName/2, IUser.getUserna... | /* static context
[FOCAL] @Override public List<IAuthorityEntry> AuthorityService.findByUri(IUser user, String uri)
[PATH1] if(uri.endsWith("/"))=T -> return results
[PATH2] if(uri.endsWith("/"))=F -> return results
[INPUTS] branches=uri | result=uri, user, entryRepository
[COLLABORATORS] field entryRepository:Authorit... | /* static context
[FOCAL] @Override public List<IAuthorityEntry> AuthorityService.findByUri(IUser user, String uri)
[PATH1] if(uri.endsWith("/"))=T -> return results
[PATH2] if(uri.endsWith("/"))=F -> return results
[INPUTS] branches=uri | result=uri, user, entryRepository
[COLLABORATORS] field entryRepository:Authorit... | true | ok | {"focal": {"class": "AuthorityService", "name": "findByUri", "signature": "List<IAuthorityEntry> findByUri(IUser user, String uri)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "user", "type": "IUser"}, {"name": "uri", "type": "String"}], "return_type": "List<IAuthorityEntry>"}, "class_info": ... |
158331158_16 | class ParameterValidator {
public static ParameterValidatorResult getSingleValue(Enumeration<String> input) {
return getSingleValue(input, null);
}
public static ParameterValidatorResult getSingleValue(Enumeration<String> input, String defaultValue);
public static ParameterValidatorResult getSingleValue(S... | String[] value = new String[0];
ParameterValidatorResult result = ParameterValidator.getSingleValue(value);
assertEquals(ParameterValidatorResult.RESULT.NONE, result.getResult());
}
} | [FOCAL] public static ParameterValidatorResult ParameterValidator.getSingleValue(Enumeration<String> input)
[CLASS] class ParameterValidator
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] ParameterValidatorResult getSingleValue(Enumeration<String> input, String defaultValue)
[INPU... | /* static context
[FOCAL] public static ParameterValidatorResult ParameterValidator.getSingleValue(Enumeration<String> input)
[INPUTS] branches=- | result=input
[CALLS-INTERNAL] ParameterValidatorResult getSingleValue(Enumeration<String> input, String defaultValue)
*/
| /* static context
[FOCAL] public static ParameterValidatorResult ParameterValidator.getSingleValue(Enumeration<String> input)
[INPUTS] branches=- | result=input
[CALLS-INTERNAL] ParameterValidatorResult getSingleValue(Enumeration<String> input, String defaultValue)
*/
class ParameterValidator {
public static Paramet... | true | ok | {"focal": {"class": "ParameterValidator", "name": "getSingleValue", "signature": "ParameterValidatorResult getSingleValue(Enumeration<String> input)", "start_line": 3, "modifiers": "public static", "params": [{"name": "input", "type": "Enumeration<String>"}], "return_type": "ParameterValidatorResult"}, "class_info": {"... |
158452696_4 | class AkkaStreamsDemo implements ReactiveStreamsDemo {
public static List<Integer> doParallelSquares() {
final ActorSystem system = ActorSystem.create("parallel-squares"); // 1
final Materializer mat = ActorMaterializer.create(system); // 2
List<Integer> squares = new ArrayList<>();
... | List result = demo.doParallelSquares()
.stream().sorted().collect(Collectors.toList());
assertArrayEquals(squares.toArray(), result.toArray());
}
} | [FOCAL] public static List<Integer> AkkaStreamsDemo.doParallelSquares()
[CLASS] class AkkaStreamsDemo implements ReactiveStreamsDemo
[METRICS] loc=15 cc=2 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] ActorSystem.create/1, ActorMaterializer.create/1, Source.range(1, 64) //2 .mapConcat(v -> Source.sin... | /* static context
[FOCAL] public static List<Integer> AkkaStreamsDemo.doParallelSquares()
[PATH1] try-body throws -> return squares
[EXCEPTIONS] catches Exception e
[NEW] ArrayList<>
[CALLS-EXTERNAL] ActorSystem.create/1, ActorMaterializer.create/1, Source.range(1, 64) //2 .mapConcat(v -> Source.single(v).....runForeac... | /* static context
[FOCAL] public static List<Integer> AkkaStreamsDemo.doParallelSquares()
[PATH1] try-body throws -> return squares
[EXCEPTIONS] catches Exception e
[NEW] ArrayList<>
[CALLS-EXTERNAL] ActorSystem.create/1, ActorMaterializer.create/1, Source.range(1, 64) //2 .mapConcat(v -> Source.single(v).....runForeac... | true | ok | {"focal": {"class": "AkkaStreamsDemo", "name": "doParallelSquares", "signature": "List<Integer> doParallelSquares()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "List<Integer>"}, "class_info": {"name": "AkkaStreamsDemo", "kind": "class", "modifiers": "", "superclass": null, "interfaces"... |
158543059_1442 | class LogTailScanner {
public LogTailInformation getTailInformation() throws UnderlyingStorageException
{
if ( logTailInformation == null )
{
try
{
logTailInformation = findLogTail();
}
catch ( IOException e )
{
... | // given
long txId = 11;
setupLogFiles( logFile( checkPoint(), checkPoint(), start(), commit( txId ) ) );
// when
LogTailInformation logTailInformation = tailScanner.getTailInformation();
// then
assertLatestCheckPoint( true, true, txId, endLogVersion, logTailIn... | [FOCAL] public LogTailInformation LogTailScanner.getTailInformation()
[CLASS] class LogTailScanner
[METRICS] loc=16 cc=3 branches=1 loops=0 returns=1 throws=1 nesting=2
[CALLS-INTERNAL] LogTailInformation findLogTail()
[NEW] UnderlyingStorageException
[EXCEPTIONS] declares UnderlyingStorageException; throws UnderlyingS... | /* static context
[FOCAL] public LogTailInformation LogTailScanner.getTailInformation()
[THROWS-WHEN] UnderlyingStorageException when logTailInformation == null && try-body throws
[PATH1] if(logTailInformation == null)=T -> try-body throws -> throw new UnderlyingStorageException( "Error encountered while parsing tr...
... | /* static context
[FOCAL] public LogTailInformation LogTailScanner.getTailInformation()
[THROWS-WHEN] UnderlyingStorageException when logTailInformation == null && try-body throws
[PATH1] if(logTailInformation == null)=T -> try-body throws -> throw new UnderlyingStorageException( "Error encountered while parsing tr...
... | true | ok | {"focal": {"class": "LogTailScanner", "name": "getTailInformation", "signature": "LogTailInformation getTailInformation() throws UnderlyingStorageException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "LogTailInformation"}, "class_info": {"name": "LogTailScanner", "kind": "class", "modifiers":... |
158546420_11 | class AutoColumn extends GenericColumn {
public GenericColumn getInternalColumn() {
return internalColumn;
}
public AutoColumn(String name);
private Consumer<String[]> createPostBuildListener();
@Override public Consumer<String[]> getPostBuildListener();
@Override public List<Transfo... | final String intAttr = "IntAttr";
AnchorTabular tabular = new AnchorTabularBuilderByName()
.addColumn(new AutoColumn(intAttr))
.build(getTestCSV());
assertEquals(1, tabular.getTabularInstances()[0].getTransformedValue(intAttr));
assertEquals(2, tabular.ge... | [FOCAL] public GenericColumn AutoColumn.getInternalColumn()
[CLASS] class AutoColumn extends GenericColumn
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] AutoColumn(String name); Consumer<String[]> createPostBuildListener(); Consumer<String[]> getPostBuildListener(); List<Transform... | /* static context
[FOCAL] public GenericColumn AutoColumn.getInternalColumn()
*/
| /* static context
[FOCAL] public GenericColumn AutoColumn.getInternalColumn()
*/
class AutoColumn extends GenericColumn {
public GenericColumn getInternalColumn() {
return internalColumn;
}
public AutoColumn(String name);
private Consumer<String[]> createPostBuildListener();
@Override pu... | true | ok | {"focal": {"class": "AutoColumn", "name": "getInternalColumn", "signature": "GenericColumn getInternalColumn()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "GenericColumn"}, "class_info": {"name": "AutoColumn", "kind": "class", "modifiers": "", "superclass": "GenericColumn", "interfaces": null... |
158547266_14 | class EnvvarSource extends PropertiesFormat implements ConfijSource {
public static EnvvarSource withPrefix(String prefix) {
return new EnvvarSource(prefix);
}
protected EnvvarSource(String prefix);
@Override public void override(ConfijNode rootNode);
}
class EnvvarSourceTest implements ConfijSource {
@Te... | String value1 = UUID.randomUUID() + "";
String value2 = UUID.randomUUID() + "";
SystemLambda.withEnvironmentVariable("A_PREFIX_xy", value1)
.and("A_PREFIX_others_fuu.", value2)
.and("A_PREFIXORNORATALL_xy", "fuuuuu")
.execute(() -> {
Config config = ConfijBuilder.of(Config.class)
.loadFrom... | [FOCAL] public static EnvvarSource EnvvarSource.withPrefix(String prefix)
[CLASS] class EnvvarSource extends PropertiesFormat implements ConfijSource
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] EnvvarSource
[INPUTS] branches=- | result=prefix
[DATAFLOW] prefix@param->L2
[CLASS-MEMBERS] En... | /* static context
[FOCAL] public static EnvvarSource EnvvarSource.withPrefix(String prefix)
[INPUTS] branches=- | result=prefix
[NEW] EnvvarSource
*/
| /* static context
[FOCAL] public static EnvvarSource EnvvarSource.withPrefix(String prefix)
[INPUTS] branches=- | result=prefix
[NEW] EnvvarSource
*/
class EnvvarSource extends PropertiesFormat implements ConfijSource {
public static EnvvarSource withPrefix(String prefix) {
return new EnvvarSource(prefix);
}
pro... | true | ok | {"focal": {"class": "EnvvarSource", "name": "withPrefix", "signature": "EnvvarSource withPrefix(String prefix)", "start_line": 3, "modifiers": "public static", "params": [{"name": "prefix", "type": "String"}], "return_type": "EnvvarSource"}, "class_info": {"name": "EnvvarSource", "kind": "class", "modifiers": "", "supe... |
158618423_2 | class SimpleStoreImpl implements SimpleStore {
@Override
public ListenableFuture<Void> clear() {
requireOpen();
return Futures.submitAsync(
() -> {
Exception isDead = isDead();
if (isDead != null) {
return Futures.immediateFailedFuture(isDead);
}
... | try (SimpleStore store = SimpleStoreFactory.create(directoryProvider, SAMPLE_SCOPE)) {
store.put(TEST_KEY, new byte[1]).get();
store.clear().get();
ListenableFuture<byte[]> empty = store.get(TEST_KEY);
assertThat(empty.get()).isEmpty();
}
}
} | [FOCAL] @Override public ListenableFuture<Void> SimpleStoreImpl.clear()
[CLASS] class SimpleStoreImpl implements SimpleStore
[METRICS] loc=27 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=3
[CALLS-INTERNAL] Exception isDead(); void requireOpen()
[CALLS-EXTERNAL] Futures.submitAsync/2, Futures.immediateFailedFuture... | /* static context
[FOCAL] @Override public ListenableFuture<Void> SimpleStoreImpl.clear()
[COLLABORATORS] field namespacedDirectory delete/0; field cache clear/0
[CALLS-INTERNAL] Exception isDead(); void requireOpen()
[CALLS-EXTERNAL] Futures.submitAsync/2, Futures.immediateFailedFuture/1, Objects.requireNonNull(namesp... | /* static context
[FOCAL] @Override public ListenableFuture<Void> SimpleStoreImpl.clear()
[COLLABORATORS] field namespacedDirectory delete/0; field cache clear/0
[CALLS-INTERNAL] Exception isDead(); void requireOpen()
[CALLS-EXTERNAL] Futures.submitAsync/2, Futures.immediateFailedFuture/1, Objects.requireNonNull(namesp... | true | ok | {"focal": {"class": "SimpleStoreImpl", "name": "clear", "signature": "ListenableFuture<Void> clear()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "ListenableFuture<Void>"}, "class_info": {"name": "SimpleStoreImpl", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "... |
158704131_0 | class JsonFormatter implements Formatter {
@Override
public String format(Object object) {
try {
return objectMapper.writeValueAsString(object);
} catch (JsonProcessingException e) {
// 解析失败返回非法参数异常
throw new IllegalArgumentException(e);
}
}
... | JsonFormatter formatter = new JsonFormatter();
Assert.assertEquals("{\"id\":1,\"name\":\"小马哥\"}", formatter.format(new User()));
}
} | [FOCAL] @Override public String JsonFormatter.format(Object object)
[CLASS] class JsonFormatter implements Formatter
[METRICS] loc=9 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] objectMapper.writeValueAsString/1
[NEW] IllegalArgumentException
[EXCEPTIONS] throws IllegalArgumentException; catche... | /* static context
[FOCAL] @Override public String JsonFormatter.format(Object object)
[THROWS-WHEN] IllegalArgumentException when try-body throws
[PATH1] try-body throws -> throw new IllegalArgumentException(e)
[PATH2] return objectMapper.writeValueAsString(object)
[INPUTS] branches=- | result=object
[COLLABORATORS] fi... | /* static context
[FOCAL] @Override public String JsonFormatter.format(Object object)
[THROWS-WHEN] IllegalArgumentException when try-body throws
[PATH1] try-body throws -> throw new IllegalArgumentException(e)
[PATH2] return objectMapper.writeValueAsString(object)
[INPUTS] branches=- | result=object
[COLLABORATORS] fi... | true | ok | {"focal": {"class": "JsonFormatter", "name": "format", "signature": "String format(Object object)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "object", "type": "Object"}], "return_type": "String"}, "class_info": {"name": "JsonFormatter", "kind": "class", "modifiers": "", "superclass": null, ... |
158831879_0 | class KnowNERLanguageConfigurator {
public List<String> run() throws KnowNERLanguageConfiguratorException {
List<String> errorMessages = new ArrayList<>();
for (KnowNERResourceChecker checker : checkerList) {
logger.info("Creating '" + language + "' KnowNER resources for " + checker.getClass().getSimpl... | KnowNERResourceChecker mockedChecker = mock(KnowNERResourceChecker.class);
when(mockedChecker.check()).thenReturn(new KnowNERResourceResult());
KnowNERLanguageConfigurator configurator = new KnowNERLanguageConfiguratorBuilder()
.setLanguage("de")
.setMainDir("")
.addResourceChecker(mockedChecker)
... | [FOCAL] public List<String> KnowNERLanguageConfigurator.run()
[CLASS] class KnowNERLanguageConfigurator
[METRICS] loc=11 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] logger.info/1, checker.getClass().getSimpleName/0, KnowNERResourceChecker.getClass/0, KnowNERResourceChecker.check/0, KnowNERReso... | /* static context
[FOCAL] public List<String> KnowNERLanguageConfigurator.run()
[PATH1] foreach(KnowNERResourceChecker checker : checkerList)=T -> if(!result.isSuccess())=T -> exit loop -> return errorMessages
[PATH2] foreach(KnowNERResourceChecker checker : checkerList)=F -> return errorMessages
[PATH3] foreach(KnowNE... | /* static context
[FOCAL] public List<String> KnowNERLanguageConfigurator.run()
[PATH1] foreach(KnowNERResourceChecker checker : checkerList)=T -> if(!result.isSuccess())=T -> exit loop -> return errorMessages
[PATH2] foreach(KnowNERResourceChecker checker : checkerList)=F -> return errorMessages
[PATH3] foreach(KnowNE... | true | ok | {"focal": {"class": "KnowNERLanguageConfigurator", "name": "run", "signature": "List<String> run() throws KnowNERLanguageConfiguratorException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<String>"}, "class_info": {"name": "KnowNERLanguageConfigurator", "kind": "class", "modifiers": "", "... |
158992067_14 | class KeyMatcher implements Matcher {
public String match(Set<String> sources, String target ) {
return sources.contains(target) || sources.isEmpty() ?
target :
matchMissingKey(sources,target);
}
private String[] getSegments(String s);
private boolean isBoundedT... | String nonExistentTarget = "A.X";
final String match = keyMatcher.match(listeners, nonExistentTarget);
assertEquals("A.*", match);
}
} | [FOCAL] public String KeyMatcher.match(Set<String> sources, String target)
[CLASS] class KeyMatcher implements Matcher
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String matchMissingKey(Set<String> sources, String target)
[CALLS-EXTERNAL] Set<String>.contains/1, Set<String>.isE... | /* static context
[FOCAL] public String KeyMatcher.match(Set<String> sources, String target)
[INPUTS] branches=- | result=sources, target
[COLLABORATORS] param sources:Set<String> contains/1,isEmpty/0
[CALLS-INTERNAL] String matchMissingKey(Set<String> sources, String target)
[CALLS-EXTERNAL] Set<String>.contains/1, Se... | /* static context
[FOCAL] public String KeyMatcher.match(Set<String> sources, String target)
[INPUTS] branches=- | result=sources, target
[COLLABORATORS] param sources:Set<String> contains/1,isEmpty/0
[CALLS-INTERNAL] String matchMissingKey(Set<String> sources, String target)
[CALLS-EXTERNAL] Set<String>.contains/1, Se... | true | ok | {"focal": {"class": "KeyMatcher", "name": "match", "signature": "String match(Set<String> sources, String target)", "start_line": 3, "modifiers": "public", "params": [{"name": "sources", "type": "Set<String>"}, {"name": "target", "type": "String"}], "return_type": "String"}, "class_info": {"name": "KeyMatcher", "kind":... |
159189646_3 | class SwaggerBasePathRewritingFilter extends SendResponseFilter {
@Override
public Object run() {
RequestContext context = RequestContext.getCurrentContext();
context.getResponse().setCharacterEncoding("UTF-8");
String rewrittenResponse = rewriteBasePath(context);
if (context.... | MockHttpServletRequest request = new MockHttpServletRequest("GET", "/service1" + DEFAULT_URL);
RequestContext context = RequestContext.getCurrentContext();
context.setRequest(request);
MockHttpServletResponse response = new MockHttpServletResponse();
context.setResponseGZipped(f... | [FOCAL] @Override public Object SwaggerBasePathRewritingFilter.run()
[CLASS] class SwaggerBasePathRewritingFilter extends SendResponseFilter
[METRICS] loc=18 cc=3 branches=1 loops=0 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] String rewriteBasePath(RequestContext context); byte[] gzipData(String content)
[CALLS-EXTER... | /* static context
[FOCAL] @Override public Object SwaggerBasePathRewritingFilter.run()
[PATH1] if(context.getResponseGZipped())=T -> try-body throws -> return null
[PATH2] if(context.getResponseGZipped())=F -> return null
[EXCEPTIONS] catches IOException e
[CALLS-INTERNAL] String rewriteBasePath(RequestContext context)... | /* static context
[FOCAL] @Override public Object SwaggerBasePathRewritingFilter.run()
[PATH1] if(context.getResponseGZipped())=T -> try-body throws -> return null
[PATH2] if(context.getResponseGZipped())=F -> return null
[EXCEPTIONS] catches IOException e
[CALLS-INTERNAL] String rewriteBasePath(RequestContext context)... | true | ok | {"focal": {"class": "SwaggerBasePathRewritingFilter", "name": "run", "signature": "Object run()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Object"}, "class_info": {"name": "SwaggerBasePathRewritingFilter", "kind": "class", "modifiers": "", "superclass": "SendResponseFilter", "inte... |
159208572_0 | class CustomerSync {
public boolean syncWithDataLayer(ExternalCustomer externalCustomer) {
CustomerMatches customerMatches;
if (externalCustomer.isCompany()) {
customerMatches = loadCompany(externalCustomer);
} else {
customerMatches = loadPerson(externalCustomer);
... | String externalId = "12345";
ExternalCustomer externalCustomer = createExternalCompany();
externalCustomer.setExternalId(externalId);
Customer customer = createCustomerWithSameCompanyAs(externalCustomer);
customer.setExternalId(externalId);
CustomerDataLayer db = mock(... | [FOCAL] public boolean CustomerSync.syncWithDataLayer(ExternalCustomer externalCustomer)
[CLASS] class CustomerSync
[METRICS] loc=38 cc=6 branches=4 loops=1 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] Customer createCustomer(Customer customer); Customer updateCustomer(Customer customer); CustomerMatches loadCompany(E... | /* static context
[FOCAL] public boolean CustomerSync.syncWithDataLayer(ExternalCustomer externalCustomer)
[PATH1] if(externalCustomer.isCompany())=T -> if(customer == null)=T -> if(customer.getInternalId() == null)=T -> if(customerMatches.hasDuplicates())=T -> foreach(Customer duplicate : customerMatches.getDuplicates... | /* static context
[FOCAL] public boolean CustomerSync.syncWithDataLayer(ExternalCustomer externalCustomer)
[PATH1] if(externalCustomer.isCompany())=T -> if(customer == null)=T -> if(customer.getInternalId() == null)=T -> if(customerMatches.hasDuplicates())=T -> foreach(Customer duplicate : customerMatches.getDuplicates... | true | ok | {"focal": {"class": "CustomerSync", "name": "syncWithDataLayer", "signature": "boolean syncWithDataLayer(ExternalCustomer externalCustomer)", "start_line": 3, "modifiers": "public", "params": [{"name": "externalCustomer", "type": "ExternalCustomer"}], "return_type": "boolean"}, "class_info": {"name": "CustomerSync", "k... |
159473524_4 | class RecipientServiceImpl implements RecipientService {
@Override
@CatAnnotation
public Recipient save(String accountName, Recipient recipient) {
recipient.setAccountName(accountName);
recipient.getScheduledNotifications().values()
.forEach(settings -> {
if (settings.getLastNotified() == null) {
... |
NotificationSettings remind = new NotificationSettings();
remind.setActive(true);
remind.setFrequency(Frequency.WEEKLY);
remind.setLastNotified(null);
NotificationSettings backup = new NotificationSettings();
backup.setActive(false);
backup.setFrequency(Frequency.MONTHLY);
backup.setLastNotified(new D... | [FOCAL] @Override @CatAnnotation public Recipient RecipientServiceImpl.save(String accountName, Recipient recipient)
[CLASS] class RecipientServiceImpl implements RecipientService
[METRICS] loc=18 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] Recipient.setAccountName/1, recipient.getScheduledNot... | /* static context
[FOCAL] @Override @CatAnnotation public Recipient RecipientServiceImpl.save(String accountName, Recipient recipient)
[INPUTS] branches=- | result=recipient
[COLLABORATORS] param recipient:Recipient setAccountName/1,getScheduledNotifications/0; field settings getLastNotified/0,setLastNotified/1; field ... | /* static context
[FOCAL] @Override @CatAnnotation public Recipient RecipientServiceImpl.save(String accountName, Recipient recipient)
[INPUTS] branches=- | result=recipient
[COLLABORATORS] param recipient:Recipient setAccountName/1,getScheduledNotifications/0; field settings getLastNotified/0,setLastNotified/1; field ... | true | ok | {"focal": {"class": "RecipientServiceImpl", "name": "save", "signature": "Recipient save(String accountName, Recipient recipient)", "start_line": 3, "modifiers": "@Override @CatAnnotation public", "params": [{"name": "accountName", "type": "String"}, {"name": "recipient", "type": "Recipient"}], "return_type": "Recipien... |
159519764_0 | class AdvertisementService {
@PreAuthorize("hasPermission(#id, 'com.sap.cp.appsec.domain.Advertisement', 'read')")
public Advertisement findById(Long id) throws NotFoundException {
Optional<Advertisement> advertisement = repository.findById(id);
if (!advertisement.isPresent()) {
Not... | Advertisement adsRead = service.findById(advertisementId);
assertThat(adsRead, is(notNullValue()));
}
} | [FOCAL] @PreAuthorize("hasPermission(#id, 'com.sap.cp.appsec.domain.Advertisement', 'read')") public Advertisement AdvertisementService.findById(Long id)
[CLASS] class AdvertisementService
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] repository.findById/1, Optional<Advertisemen... | /* static context
[FOCAL] @PreAuthorize("hasPermission(#id, 'com.sap.cp.appsec.domain.Advertisement', 'read')") public Advertisement AdvertisementService.findById(Long id)
[THROWS-WHEN] notFoundException when !advertisement.isPresent()
[PATH1] if(!advertisement.isPresent())=T -> throw notFoundException
[PATH2] if(!adve... | /* static context
[FOCAL] @PreAuthorize("hasPermission(#id, 'com.sap.cp.appsec.domain.Advertisement', 'read')") public Advertisement AdvertisementService.findById(Long id)
[THROWS-WHEN] notFoundException when !advertisement.isPresent()
[PATH1] if(!advertisement.isPresent())=T -> throw notFoundException
[PATH2] if(!adve... | true | ok | {"focal": {"class": "AdvertisementService", "name": "findById", "signature": "Advertisement findById(Long id) throws NotFoundException", "start_line": 3, "modifiers": "@PreAuthorize(\"hasPermission(#id, 'com.sap.cp.appsec.domain.Advertisement', 'read')\") public", "params": [{"name": "id", "type": "Long"}], "return_typ... |
159537834_32 | class GraphQLConverter {
<K extends Entity.Key<S>, S extends Specification> Mutation<?, ?, ?> convert(Event<K, S> event) {
var converter = (Converter<?, ?, ?, ?, K, S>) converters.get(event.getKey().getClass());
if (converter == null) {
throw new IllegalArgumentException("Unknown key class " + event.g... | var mutation = underTest.convert(Event.status(producerKey, statusEntry));
assertThat(mutation, is(instanceOf(ProducerStatusMutation.class)));
}
} | [FOCAL] Mutation<?, ?, ?> GraphQLConverter.convert(Event<K, S> event)
[CLASS] class GraphQLConverter
[METRICS] loc=19 cc=6 branches=5 loops=0 returns=3 throws=3 nesting=4
[CALLS-EXTERNAL] converters.get/1, event.getKey().getClass/0, Event<K, S>.getKey/0, var.convertSpecificationEvent/1, var.convertStatusEvent/1, var.co... | /* static context
[FOCAL] Mutation<?, ?, ?> GraphQLConverter.convert(Event<K, S> event)
[THROWS-WHEN] IllegalArgumentException when converter == null
[THROWS-WHEN] UnsupportedOperationException when !(converter == null) && !(event instanceof SpecificationEvent) && !(event instanceof StatusEvent) && !(event instanceof S... | /* static context
[FOCAL] Mutation<?, ?, ?> GraphQLConverter.convert(Event<K, S> event)
[THROWS-WHEN] IllegalArgumentException when converter == null
[THROWS-WHEN] UnsupportedOperationException when !(converter == null) && !(event instanceof SpecificationEvent) && !(event instanceof StatusEvent) && !(event instanceof S... | true | ok | {"focal": {"class": "GraphQLConverter", "name": "convert", "signature": "Mutation<?, ?, ?> convert(Event<K, S> event)", "start_line": 3, "modifiers": "", "params": [{"name": "event", "type": "Event<K, S>"}], "return_type": "Mutation<?, ?, ?>"}, "class_info": {"name": "GraphQLConverter", "kind": "class", "modifiers": ""... |
159544942_2 | class NativeSoftBodyUtil {
public static FloatBuffer mapVertexData(IntBuffer indexMap,
FloatBuffer inputBuffer, int numFloatsPerVertex) {
Validate.nonNull(indexMap, "index map");
Validate.positive(numFloatsPerVertex, "number of floats per vertex");
int numFloats = inputBuffer.li... | /*
* Exemple :
* mesh : P1\P3----P4
* ¦¯\_ ¦
* ¦ ¯\_¦
* P2----P6\P5
*
* with P1==P3 and P6==P5
* Buffers indexes : | 0| 1| 2| 3| 4| 5|
* >- JME PositionBuffer : [P1,P2,P3,P4,P5,P6]
... | [FOCAL] public static FloatBuffer NativeSoftBodyUtil.mapVertexData(IntBuffer indexMap, FloatBuffer inputBuffer, int numFloatsPerVertex)
[CLASS] class NativeSoftBodyUtil
[METRICS] loc=30 cc=4 branches=1 loops=2 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] Validate.nonNull/2, Validate.positive/2, FloatBuffer.limit/0, Bu... | /* static context
[FOCAL] public static FloatBuffer NativeSoftBodyUtil.mapVertexData(IntBuffer indexMap, FloatBuffer inputBuffer, int numFloatsPerVertex)
[PATH1] for(oldVIndex < numVertices)=T -> for(i < numFloatsPerVertex)=F -> if(newVIndex > lastNewVIndex)=T -> exit loop -> return result
[PATH2] for(oldVIndex < numVe... | /* static context
[FOCAL] public static FloatBuffer NativeSoftBodyUtil.mapVertexData(IntBuffer indexMap, FloatBuffer inputBuffer, int numFloatsPerVertex)
[PATH1] for(oldVIndex < numVertices)=T -> for(i < numFloatsPerVertex)=F -> if(newVIndex > lastNewVIndex)=T -> exit loop -> return result
[PATH2] for(oldVIndex < numVe... | true | ok | {"focal": {"class": "NativeSoftBodyUtil", "name": "mapVertexData", "signature": "FloatBuffer mapVertexData(IntBuffer indexMap, FloatBuffer inputBuffer, int numFloatsPerVertex)", "start_line": 3, "modifiers": "public static", "params": [{"name": "indexMap", "type": "IntBuffer"}, {"name": "inputBuffer", "type": "FloatBuf... |
159894918_4 | class Game2048BoardManager implements Serializable {
void action(Game2048Layout.Action action) {
saveStates(activityContext);
game2048ScoreManager.saveScore(getGame2048ScoreManager().calculateScore());
for (int i = 0; i < complexity; i++) {
List<Game2048Item> rowList = new Array... | initializeBoard();
initializeListener();
testBoardManagerInit();
fillBoardWithZero();
Game2048Layout.Action leftAction = Game2048Layout.Action.LEFT;
Game2048Layout.Action rightAction = Game2048Layout.Action.RIGHT;
Game2048Layout.Action upAction = Game2048Layout.Ac... | [FOCAL] void Game2048BoardManager.action(Game2048Layout.Action action)
[CLASS] class Game2048BoardManager implements Serializable
[METRICS] loc=60 cc=16 branches=5 loops=4 returns=0 throws=0 nesting=4
[CALLS-INTERNAL] Game2048ScoreManager getGame2048ScoreManager(); int getColIndexByAction(Game2048Layout.Action action, ... | /* static context
[FOCAL] void Game2048BoardManager.action(Game2048Layout.Action action)
[PATH1] for(i < complexity)=T -> for(j < complexity)#1=T -> if(item.getNumber() != 0)=T -> exit loop -> for(j < rowList.size())=T -> if(item.getNumber() != rowList.get(j).getNumber())=T -> exit loop -> for(j < complexity)#2=T -> if... | /* static context
[FOCAL] void Game2048BoardManager.action(Game2048Layout.Action action)
[PATH1] for(i < complexity)=T -> for(j < complexity)#1=T -> if(item.getNumber() != 0)=T -> exit loop -> for(j < rowList.size())=T -> if(item.getNumber() != rowList.get(j).getNumber())=T -> exit loop -> for(j < complexity)#2=T -> if... | true | ok | {"focal": {"class": "Game2048BoardManager", "name": "action", "signature": "void action(Game2048Layout.Action action)", "start_line": 3, "modifiers": "", "params": [{"name": "action", "type": "Game2048Layout.Action"}], "return_type": "void"}, "class_info": {"name": "Game2048BoardManager", "kind": "class", "modifiers": ... |
160156999_13 | class HelloWorldService extends MutinyGreeterGrpc.GreeterImplBase {
@Override
public Uni<HelloReply> sayHello(HelloRequest request) {
int count = counter.incrementAndGet();
String name = request.getName();
return Uni.createFrom().item("Hello " + name)
.map(res -> HelloRe... | GreeterGrpc.GreeterBlockingStub client = GreeterGrpc.newBlockingStub(channel);
HelloReply reply = client
.sayHello(HelloRequest.newBuilder().setName("neo-blocking").build());
assertThat(reply.getMessage()).isEqualTo("Hello neo-blocking");
}
} | [FOCAL] @Override public Uni<HelloReply> HelloWorldService.sayHello(HelloRequest request)
[CLASS] class HelloWorldService extends MutinyGreeterGrpc.GreeterImplBase
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] counter.incrementAndGet/0, HelloRequest.getName/0, Uni.createFrom().it... | /* static context
[FOCAL] @Override public Uni<HelloReply> HelloWorldService.sayHello(HelloRequest request)
[INPUTS] branches=- | result=request
[COLLABORATORS] field counter incrementAndGet/0; param request:HelloRequest getName/0
[CALLS-EXTERNAL] counter.incrementAndGet/0, HelloRequest.getName/0, Uni.createFrom().item... | /* static context
[FOCAL] @Override public Uni<HelloReply> HelloWorldService.sayHello(HelloRequest request)
[INPUTS] branches=- | result=request
[COLLABORATORS] field counter incrementAndGet/0; param request:HelloRequest getName/0
[CALLS-EXTERNAL] counter.incrementAndGet/0, HelloRequest.getName/0, Uni.createFrom().item... | true | ok | {"focal": {"class": "HelloWorldService", "name": "sayHello", "signature": "Uni<HelloReply> sayHello(HelloRequest request)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "HelloRequest"}], "return_type": "Uni<HelloReply>"}, "class_info": {"name": "HelloWorldService", "kind": "c... |
160219599_13 | class Range implements Iterable<E> {
public void merge(Range<E> range) {
first = min(first, range.getFirst());
last = max(last, range.getLast());
}
public Range(E element);
public Range(E first, E last);
public Range(E first, E last, IEnumerator<E> enumerator);
public Range... | Range<Integer> range;
(range = range(-10, 10)).merge(range(-20, -11));
assertEquals(range(-20, 10), range);
(range = range(-10, 10)).merge(range(-20, -10));
assertEquals(range(-20, 10), range);
(range = range(-10, 10)).merge(range(-10, 10));
assertEquals(range(... | [FOCAL] public void Range.merge(Range<E> range)
[CLASS] class Range implements Iterable<E>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] E max(E e1, E e2); E min(E e1, E e2)
[CALLS-EXTERNAL] Range<E>.getFirst/0, Range<E>.getLast/0
[COLLABORATORS] param range:Range<E> getFirst/0,g... | /* static context
[FOCAL] public void Range.merge(Range<E> range)
[COLLABORATORS] param range:Range<E> getFirst/0,getLast/0
[CALLS-INTERNAL] E max(E e1, E e2); E min(E e1, E e2)
[CALLS-EXTERNAL] Range<E>.getFirst/0, Range<E>.getLast/0
*/
| /* static context
[FOCAL] public void Range.merge(Range<E> range)
[COLLABORATORS] param range:Range<E> getFirst/0,getLast/0
[CALLS-INTERNAL] E max(E e1, E e2); E min(E e1, E e2)
[CALLS-EXTERNAL] Range<E>.getFirst/0, Range<E>.getLast/0
*/
class Range implements Iterable<E> {
public void merge(Range<E> range) {
... | true | ok | {"focal": {"class": "Range", "name": "merge", "signature": "void merge(Range<E> range)", "start_line": 3, "modifiers": "public", "params": [{"name": "range", "type": "Range<E>"}], "return_type": "void"}, "class_info": {"name": "Range", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Iterable<E>", "... |
160260778_2 | class Creator {
public Class createModel(CreatorConfig config) throws Exception {
this.config = config;
buildGraph();
generateAndCompileEvents();
generateAndCompileNodes();
return generateAndCompileSepConfig();
}
private void buildGraph();
private void generateA... | ConfigParser parser = new ConfigParser();
String outPkg = GenerationContext.SINGLETON.getPackageName();
String configDoc = ""
+ "outputPackage: " + outPkg + "\n"
+ "outputSepConfigClass: " + outPkg + ".MySepCfg\n"
+ "processorId: processor1\n"
... | [FOCAL] public Class Creator.createModel(CreatorConfig config)
[CLASS] class Creator
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Class generateAndCompileSepConfig(); void buildGraph(); void generateAndCompileEvents(); void generateAndCompileNodes()
[FIELDS] write=config
[EXCEPT... | /* static context
[FOCAL] public Class Creator.createModel(CreatorConfig config)
[STATE] config
[EXCEPTIONS] declares Exception
[CALLS-INTERNAL] Class generateAndCompileSepConfig(); void buildGraph(); void generateAndCompileEvents(); void generateAndCompileNodes()
[FIELDS] write=config
*/
| /* static context
[FOCAL] public Class Creator.createModel(CreatorConfig config)
[STATE] config
[EXCEPTIONS] declares Exception
[CALLS-INTERNAL] Class generateAndCompileSepConfig(); void buildGraph(); void generateAndCompileEvents(); void generateAndCompileNodes()
[FIELDS] write=config
*/
class Creator {
public Cl... | true | ok | {"focal": {"class": "Creator", "name": "createModel", "signature": "Class createModel(CreatorConfig config) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "config", "type": "CreatorConfig"}], "return_type": "Class"}, "class_info": {"name": "Creator", "kind": "class", "modifiers": "", "su... |
160304314_0 | class GithubCommentManager {
public int deleteComment(Predicate<Comment> commentPredicate) throws IOException {
List<Comment> comments = issueService.getComments(repoId, issueNumber);
int delCount = 0;
for (Comment c : comments) {
if (logger.isDebugEnabled()) {
logger.debug("pre filtered comment {} : {}... | when(mockIssue.getComments(repositoryId, prNum))
.thenReturn(Collections.singletonList(new Comment().setId(1).setBody("test")
.setUser(new User().setId(1))));
doNothing().when(mockIssue)
.deleteComment(repositoryId, 1);
GithubCommentManager manager = new GithubCommentManager(mockIssue, repositoryId... | [FOCAL] public int GithubCommentManager.deleteComment(Predicate<Comment> commentPredicate)
[CLASS] class GithubCommentManager
[METRICS] loc=21 cc=4 branches=2 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] issueService.getComments/2, logger.isDebugEnabled/0, logger.debug/4, c.getUser().getLogin/0, Comment.getUse... | /* static context
[FOCAL] public int GithubCommentManager.deleteComment(Predicate<Comment> commentPredicate)
[PATH1] foreach(Comment c : comments)=T -> if(logger.isDebugEnabled())=T -> if(!commentPredicate.test(c))=T -> exit loop -> return delCount
[PATH2] foreach(Comment c : comments)=T -> if(logger.isDebugEnabled())=... | /* static context
[FOCAL] public int GithubCommentManager.deleteComment(Predicate<Comment> commentPredicate)
[PATH1] foreach(Comment c : comments)=T -> if(logger.isDebugEnabled())=T -> if(!commentPredicate.test(c))=T -> exit loop -> return delCount
[PATH2] foreach(Comment c : comments)=T -> if(logger.isDebugEnabled())=... | true | ok | {"focal": {"class": "GithubCommentManager", "name": "deleteComment", "signature": "int deleteComment(Predicate<Comment> commentPredicate) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "commentPredicate", "type": "Predicate<Comment>"}], "return_type": "int"}, "class_info": {"name": "Gi... |
160760515_102 | class FavoriteService {
public void deleteFavorite(long favoriteId) {
Favorite favorite = favoriteRepository.findById(favoriteId).orElse(null);
checkUserOperatePermission(favorite);
favoriteRepository.delete(favorite);
}
public Favorite addFavorite(Favorite favorite);
public List<Favorite> searc... | long legalFavoriteId = 21L;
favoriteService.deleteFavorite(legalFavoriteId);
Assert.assertNull(favoriteRepository.findById(legalFavoriteId).orElse(null));
}
} | [FOCAL] public void FavoriteService.deleteFavorite(long favoriteId)
[CLASS] class FavoriteService
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void checkUserOperatePermission(Favorite favorite)
[CALLS-EXTERNAL] favoriteRepository.findById(favoriteId).orElse/1, FavoriteRepository... | /* static context
[FOCAL] public void FavoriteService.deleteFavorite(long favoriteId)
[COLLABORATORS] field favoriteRepository:FavoriteRepository findById/1,delete/1
[CALLS-INTERNAL] void checkUserOperatePermission(Favorite favorite)
[FIELDS] read=favoriteRepository:FavoriteRepository
[CALLS-EXTERNAL] favoriteRepositor... | /* static context
[FOCAL] public void FavoriteService.deleteFavorite(long favoriteId)
[COLLABORATORS] field favoriteRepository:FavoriteRepository findById/1,delete/1
[CALLS-INTERNAL] void checkUserOperatePermission(Favorite favorite)
[FIELDS] read=favoriteRepository:FavoriteRepository
[CALLS-EXTERNAL] favoriteRepositor... | true | ok | {"focal": {"class": "FavoriteService", "name": "deleteFavorite", "signature": "void deleteFavorite(long favoriteId)", "start_line": 3, "modifiers": "public", "params": [{"name": "favoriteId", "type": "long"}], "return_type": "void"}, "class_info": {"name": "FavoriteService", "kind": "class", "modifiers": "", "superclas... |
160777074_17 | class PullMessageFilterChain {
boolean needKeep(final PullRequest request, final Buffer message) {
for (PullMessageFilter filter : filters) {
if (filter.isActive(request, message) && !filter.match(request, message)) {
return false;
}
}
return true;
}
PullMessageFilterChain(final DynamicConfig con... | Whitebox.setInternalState(pullMessageFilterChain, "filters",
Lists.newArrayList(activeAndMatchFilter, activeAndMatchFilter));
PullRequest request = TestToolBox.createDefaultPullRequest();
Buffer buffer = TestToolBox.createDefaultBuffer();
boolean needKeep = pullMessageFilterChain.needKeep(request, buffer);
... | [FOCAL] boolean PullMessageFilterChain.needKeep(PullRequest request, Buffer message)
[CLASS] class PullMessageFilterChain
[METRICS] loc=8 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] PullMessageFilter.isActive/2, PullMessageFilter.match/2
[PATH1] foreach(PullMessageFilter filter : filters)=T ->... | /* static context
[FOCAL] boolean PullMessageFilterChain.needKeep(PullRequest request, Buffer message)
[PATH1] foreach(PullMessageFilter filter : filters)=T -> if(filter.isActive(request, message) && !filter.match(request, message))=F -> exit loop -> return true
[PATH2] foreach(PullMessageFilter filter : filters)=T -> ... | /* static context
[FOCAL] boolean PullMessageFilterChain.needKeep(PullRequest request, Buffer message)
[PATH1] foreach(PullMessageFilter filter : filters)=T -> if(filter.isActive(request, message) && !filter.match(request, message))=F -> exit loop -> return true
[PATH2] foreach(PullMessageFilter filter : filters)=T -> ... | true | ok | {"focal": {"class": "PullMessageFilterChain", "name": "needKeep", "signature": "boolean needKeep(PullRequest request, Buffer message)", "start_line": 3, "modifiers": "", "params": [{"name": "request", "type": "PullRequest"}, {"name": "message", "type": "Buffer"}], "return_type": "boolean"}, "class_info": {"name": "Pull... |
160877396_0 | class BorgInstallation {
File download(RunningMode.OSType osType) {
String[] binary = getBinary(osType);
if (binary == null) {
log.info("Can't download binary (no binary found for OS '" + osType + "'.");
return null;
}
return download(binary);
}
priv... | String version = new BorgVersion().getBinariesDownloadVersion();
checkDownload(RunningMode.OSType.LINUX, "borg-linux64-" + version);
checkDownload(RunningMode.OSType.MAC_OS, "borg-macosx64-" + version);
checkDownload(RunningMode.OSType.FREEBSD, "borg-freebsd64-" + version);
asser... | [FOCAL] File BorgInstallation.download(RunningMode.OSType osType)
[CLASS] class BorgInstallation
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] File download(String[] binary); String[] getBinary(RunningMode.OSType osType)
[CALLS-EXTERNAL] Logger.info/1
[FIELDS] read=log:Logger
[PA... | /* static context
[FOCAL] File BorgInstallation.download(RunningMode.OSType osType)
[PATH1] if(binary == null)=T -> return null
[PATH2] if(binary == null)=F -> return download(binary)
[INPUTS] branches=osType | result=osType
[CALLS-INTERNAL] File download(String[] binary); String[] getBinary(RunningMode.OSType osType)
... | /* static context
[FOCAL] File BorgInstallation.download(RunningMode.OSType osType)
[PATH1] if(binary == null)=T -> return null
[PATH2] if(binary == null)=F -> return download(binary)
[INPUTS] branches=osType | result=osType
[CALLS-INTERNAL] File download(String[] binary); String[] getBinary(RunningMode.OSType osType)
... | true | ok | {"focal": {"class": "BorgInstallation", "name": "download", "signature": "File download(RunningMode.OSType osType)", "start_line": 3, "modifiers": "", "params": [{"name": "osType", "type": "RunningMode.OSType"}], "return_type": "File"}, "class_info": {"name": "BorgInstallation", "kind": "class", "modifiers": "", "super... |
160931942_7 | class ExchangeRateUtil {
public JSONObject parseBlockchainInfoResponse(JSONObject response) {
JSONObject formattedRates = new JSONObject();
// loop through all returned currencies
Iterator<String> iter = response.keys();
while (iter.hasNext()) {
String fiatCode = iter.n... | JSONObject in = new JSONObject(readStringFromFile("exchange_rate_blockchain_info_response.json"));
JSONObject out = ExchangeRateUtil.getInstance().parseBlockchainInfoResponse(in);
assertEquals(2, out.length());
assertEquals(1E-8, out.getJSONObject("USD").getDouble("rate"));
}
} | [FOCAL] public JSONObject ExchangeRateUtil.parseBlockchainInfoResponse(JSONObject response)
[CLASS] class ExchangeRateUtil
[METRICS] loc=30 cc=4 branches=0 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] JSONObject.keys/0, Iterator<String>.hasNext/0, Iterator<String>.next/0, JSONObject.getJSONObject/1, JSONObject... | /* static context
[FOCAL] public JSONObject ExchangeRateUtil.parseBlockchainInfoResponse(JSONObject response)
[PATH1] while(iter.hasNext())=T -> try-body throws -> exit loop -> return formattedRates
[PATH2] while(iter.hasNext())=F -> return formattedRates
[INPUTS] branches=response | result=-
[COLLABORATORS] param resp... | /* static context
[FOCAL] public JSONObject ExchangeRateUtil.parseBlockchainInfoResponse(JSONObject response)
[PATH1] while(iter.hasNext())=T -> try-body throws -> exit loop -> return formattedRates
[PATH2] while(iter.hasNext())=F -> return formattedRates
[INPUTS] branches=response | result=-
[COLLABORATORS] param resp... | true | ok | {"focal": {"class": "ExchangeRateUtil", "name": "parseBlockchainInfoResponse", "signature": "JSONObject parseBlockchainInfoResponse(JSONObject response)", "start_line": 3, "modifiers": "public", "params": [{"name": "response", "type": "JSONObject"}], "return_type": "JSONObject"}, "class_info": {"name": "ExchangeRateUti... |
161138654_31 | class HttpClientTransport implements RestTransport {
@Segment(name = "transport", category = "network", library = "kamon")
@Override
public SagaResponse with(String address, String path, String method, Map<String, Map<String, String>> params) {
URIBuilder builder = new URIBuilder().setScheme("http").setHost(... | try {
transport.with("http://somewhere:9090", faultyResource, "DELETE", emptyMap());
expectFailing(TransportFailedException.class);
} catch (TransportFailedException e) {
assertThat(e.getMessage(), is("Network Error"));
}
}
} | [FOCAL] @Segment(name = "transport", category = "network", library = "kamon") @Override public SagaResponse HttpClientTransport.with(String address, String path, String method, Map<String, Map<String, String>> params)
[CLASS] class HttpClientTransport implements RestTransport
[METRICS] loc=35 cc=7 branches=3 loops=2 re... | /* static context
[FOCAL] @Segment(name = "transport", category = "network", library = "kamon") @Override public SagaResponse HttpClientTransport.with(String address, String path, String method, Map<String, Map<String, String>> params)
[THROWS-WHEN] TransportFailedException when params.containsKey("query") && foreach(E... | /* static context
[FOCAL] @Segment(name = "transport", category = "network", library = "kamon") @Override public SagaResponse HttpClientTransport.with(String address, String path, String method, Map<String, Map<String, String>> params)
[THROWS-WHEN] TransportFailedException when params.containsKey("query") && foreach(E... | true | ok | {"focal": {"class": "HttpClientTransport", "name": "with", "signature": "SagaResponse with(String address, String path, String method, Map<String, Map<String, String>> params)", "start_line": 3, "modifiers": "@Segment(name = \"transport\", category = \"network\", library = \"kamon\") @Override public", "params": [{"nam... |
161169958_4 | class RepositoryDataPollingService implements Runnable {
@Override
public void run() {
final PollingTimeslice pollingTimeslice = lastPolledService.getPollingTimeslice();
LOGGER.info("Start polling repository data: {}", pollingTimeslice);
pollProcessDefinitions(pollingTimeslice);
... |
// define polling cycle
when(lastPolledService.getPollingTimeslice())
.thenReturn(new PollingTimeslice(CUTOFF_TIME.date, START_TIME.date,
END_TIME.date));
... | [FOCAL] @Override public void RepositoryDataPollingService.run()
[CLASS] class RepositoryDataPollingService implements Runnable
[METRICS] loc=12 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void pollProcessDefinitions(PollingTimeslice pollingTimeslice)
[CALLS-EXTERNAL] LastPolledService.getPoll... | /* static context
[FOCAL] @Override public void RepositoryDataPollingService.run()
[COLLABORATORS] field lastPolledService:LastPolledService getPollingTimeslice/0,updatePollingTimeslice/1
[CALLS-INTERNAL] void pollProcessDefinitions(PollingTimeslice pollingTimeslice)
[FIELDS] read=lastPolledService:LastPolledService
[C... | /* static context
[FOCAL] @Override public void RepositoryDataPollingService.run()
[COLLABORATORS] field lastPolledService:LastPolledService getPollingTimeslice/0,updatePollingTimeslice/1
[CALLS-INTERNAL] void pollProcessDefinitions(PollingTimeslice pollingTimeslice)
[FIELDS] read=lastPolledService:LastPolledService
[C... | true | ok | {"focal": {"class": "RepositoryDataPollingService", "name": "run", "signature": "void run()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "RepositoryDataPollingService", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Runnable", "fi... |
161246688_26 | class CreditCardGenerator {
public CreditCardGenerator(){
this.type = null;
}
public CreditCardGenerator();
public CreditCardGenerator(String type);
public String generate();
private int generateCheckDigit(String number);
public String getType();
public void setType(String t... | for (int i=0;i<100;i++) {
CreditCardGenerator creditCardGenerator = new CreditCardGenerator();
String value = creditCardGenerator.generate();
switch (creditCardGenerator.getType()){
case "AMEX":
Assert.assertEquals(value.charAt(0),'3');
... | [FOCAL] public CreditCardGenerator.CreditCardGenerator()
[CLASS] class CreditCardGenerator
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[FIELDS] write=type
[STATE] type via getType()
[CLASS-MEMBERS] CreditCardGenerator(); CreditCardGenerator(String type); String generate(); int generateCheckDigi... | /* static context
[FOCAL] public CreditCardGenerator.CreditCardGenerator()
[STATE] type via getType()
[FIELDS] write=type
*/
| /* static context
[FOCAL] public CreditCardGenerator.CreditCardGenerator()
[STATE] type via getType()
[FIELDS] write=type
*/
class CreditCardGenerator {
public CreditCardGenerator(){
this.type = null;
}
public CreditCardGenerator();
public CreditCardGenerator(String type);
public String... | true | ok | {"focal": {"class": "CreditCardGenerator", "name": "CreditCardGenerator", "signature": "CreditCardGenerator()", "start_line": 3, "modifiers": "public", "params": [], "return_type": null}, "class_info": {"name": "CreditCardGenerator", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": []... |
161378406_0 | class RestliServerComponent extends BaseRestliServerComponent<RestRequest> implements RestliServerApi {
@Override
public void handleRequest(final Http.Request request, final RestliTransportCallback callback) throws Exception {
RestRequest restRequest = createRestRequest(request);
if (restRequest == null) {... | Capture<RequestContext> captureContext = newCapture();
_httpDispatcher.handleRequest(EasyMock.<RestRequest>anyObject(), capture(captureContext), anyObject());
expectLastCall();
replay(_httpDispatcher);
Http.Request request = createDefaultRequestBuilder().remoteAddress(remoteAddress).bodyRaw(new byt... | [FOCAL] @Override public void RestliServerComponent.handleRequest(Http.Request request, RestliTransportCallback callback)
[CLASS] class RestliServerComponent extends BaseRestliServerComponent<RestRequest> implements RestliServerApi
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] Re... | /* static context
[FOCAL] @Override public void RestliServerComponent.handleRequest(Http.Request request, RestliTransportCallback callback)
[PATH1] if(restRequest == null)=T
[PATH2] if(restRequest == null)=F
[INPUTS] branches=request | result=-
[COLLABORATORS] param callback:RestliTransportCallback onResponse/1; param ... | /* static context
[FOCAL] @Override public void RestliServerComponent.handleRequest(Http.Request request, RestliTransportCallback callback)
[PATH1] if(restRequest == null)=T
[PATH2] if(restRequest == null)=F
[INPUTS] branches=request | result=-
[COLLABORATORS] param callback:RestliTransportCallback onResponse/1; param ... | true | ok | {"focal": {"class": "RestliServerComponent", "name": "handleRequest", "signature": "void handleRequest(Http.Request request, RestliTransportCallback callback) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "Http.Request"}, {"name": "callback", "type": "Restli... |
161444854_18 | class AsyncSnapshotPersistence {
public void delete(final String transactionId) {
synchronized (COMMITTED_TRANSACTION_ID_BUFFER) {
COMMITTED_TRANSACTION_ID_BUFFER.get(0).add(transactionId);
}
}
public AsyncSnapshotPersistence(final DataSource dataSource);
private void del... | AsyncSnapshotPersistence asyncSnapshotPersistence = new AsyncSnapshotPersistence(dataSource);
asyncSnapshotPersistence.delete("1");
Thread.sleep(1000);
verify(statement).executeBatch();
verify(connection).commit();
}
} | [FOCAL] public void AsyncSnapshotPersistence.delete(String transactionId)
[CLASS] class AsyncSnapshotPersistence
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] COMMITTED_TRANSACTION_ID_BUFFER.get(0).add/1, COMMITTED_TRANSACTION_ID_BUFFER.get/1
[DATAFLOW] transactionId@param->L3
[C... | /* static context
[FOCAL] public void AsyncSnapshotPersistence.delete(String transactionId)
[CALLS-EXTERNAL] COMMITTED_TRANSACTION_ID_BUFFER.get(0).add/1, COMMITTED_TRANSACTION_ID_BUFFER.get/1
*/
| /* static context
[FOCAL] public void AsyncSnapshotPersistence.delete(String transactionId)
[CALLS-EXTERNAL] COMMITTED_TRANSACTION_ID_BUFFER.get(0).add/1, COMMITTED_TRANSACTION_ID_BUFFER.get/1
*/
class AsyncSnapshotPersistence {
public void delete(final String transactionId) {
synchronized (COMMITTED_TRANS... | true | ok | {"focal": {"class": "AsyncSnapshotPersistence", "name": "delete", "signature": "void delete(String transactionId)", "start_line": 3, "modifiers": "public", "params": [{"name": "transactionId", "type": "String"}], "return_type": "void"}, "class_info": {"name": "AsyncSnapshotPersistence", "kind": "class", "modifiers": ""... |
161474325_0 | class DestinationDetailsController {
@Timed
@RequestMapping(value = "/travel/destination-details/{city}", produces = MediaType.APPLICATION_JSON)
String getInfoAboutDestination(@PathVariable final String city) throws Exception {
return loader.get(city);
}
@Autowired public DestinationDetailsController(T... | //given
travelDestinationDetailsMock.addInfo("SUPER_CITY", "Beautiful Town");
//when
String res = destinationDetailsController.getInfoAboutDestination("SUPER_CITY");
//then
assertThat(res).isEqualTo("Beautiful Town");
}
} | [FOCAL] @Timed @RequestMapping(value = "/travel/destination-details/{city}", produces = MediaType.APPLICATION_JSON) String DestinationDetailsController.getInfoAboutDestination(String city)
[CLASS] class DestinationDetailsController
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] lo... | /* static context
[FOCAL] @Timed @RequestMapping(value = "/travel/destination-details/{city}", produces = MediaType.APPLICATION_JSON) String DestinationDetailsController.getInfoAboutDestination(String city)
[INPUTS] branches=- | result=city
[COLLABORATORS] field loader get/1
[EXCEPTIONS] declares Exception
[CALLS-EXTER... | /* static context
[FOCAL] @Timed @RequestMapping(value = "/travel/destination-details/{city}", produces = MediaType.APPLICATION_JSON) String DestinationDetailsController.getInfoAboutDestination(String city)
[INPUTS] branches=- | result=city
[COLLABORATORS] field loader get/1
[EXCEPTIONS] declares Exception
[CALLS-EXTER... | true | ok | {"focal": {"class": "DestinationDetailsController", "name": "getInfoAboutDestination", "signature": "String getInfoAboutDestination(String city) throws Exception", "start_line": 3, "modifiers": "@Timed @RequestMapping(value = \"/travel/destination-details/{city}\", produces = MediaType.APPLICATION_JSON)", "params": [{"... |
161493518_8 | class RawConfigParser implements ConfigParser<RawConfig, Config> {
@Override
public @NonNull Config parse(final @Nullable RawConfig config) {
Objects.requireNonNull(config);
final ProducerConfig producerConfig =
producerConfigParser.parse(config.producer, RawProducerConfig::new);
final Records... | // given
final RawConfig config = new RawConfig();
final ProducerConfig producerConfig = producerConfigParser.parse(new RawProducerConfig());
final RecordsConfig recordsConfig = recordsConfigParser.parse(new RawRecordsConfig());
config.maxInFlightRecords = 2;
config.inFlightRecordCheckIntervalMs... | [FOCAL] @Override public @NonNull Config RawConfigParser.parse(RawConfig config)
[CLASS] class RawConfigParser implements ConfigParser<RawConfig, Config>
[METRICS] loc=19 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Objects.requireNonNull/1, MockConfigParser<RawProducerConfig, ProducerConfig>.p... | /* static context
[FOCAL] @Override public @NonNull Config RawConfigParser.parse(RawConfig config)
[INPUTS] branches=- | result=config, producerConfigParser, recordsConfigParser
[COLLABORATORS] field producerConfigParser:MockConfigParser<RawProducerConfig, ProducerConfig> parse/2; field recordsConfigParser:MockConfigPa... | /* static context
[FOCAL] @Override public @NonNull Config RawConfigParser.parse(RawConfig config)
[INPUTS] branches=- | result=config, producerConfigParser, recordsConfigParser
[COLLABORATORS] field producerConfigParser:MockConfigParser<RawProducerConfig, ProducerConfig> parse/2; field recordsConfigParser:MockConfigPa... | true | ok | {"focal": {"class": "RawConfigParser", "name": "parse", "signature": "Config parse(RawConfig config)", "start_line": 3, "modifiers": "@Override public @NonNull", "params": [{"name": "config", "type": "RawConfig"}], "return_type": "Config"}, "class_info": {"name": "RawConfigParser", "kind": "class", "modifiers": "", "su... |
161649007_59 | class ScoreUtils {
public static double chiSquared(final double[] parentClassCounts, final double[][] childrenClassCounts) {
checkGainInputs(parentClassCounts, childrenClassCounts);
final double[] parentDistribution = ArrayUtilities.normalise(copy(parentClassCounts), true);
double sum = 0;
... | double v = ScoreUtils.chiSquared(new int[] {8, 4},
new int[][] {
{4, 2},
{4, 2},
});
Assert.assertEquals(0, v, 0.0);
}
} | [FOCAL] public static double ScoreUtils.chiSquared(double[] parentClassCounts, double[][] childrenClassCounts)
[CLASS] class ScoreUtils
[METRICS] loc=15 cc=3 branches=0 loops=2 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] void checkGainInputs(double[] parentClassCounts, double[][] childrenClassCounts)
[CALLS-EXTERNAL]... | /* static context
[FOCAL] public static double ScoreUtils.chiSquared(double[] parentClassCounts, double[][] childrenClassCounts)
[PATH1] for(i < childrenClassCounts.length)=T -> for(j < parentClassCounts.length)=F -> exit loop -> return sum
[PATH2] for(i < childrenClassCounts.length)=F -> return sum
[PATH3] for(i < chi... | /* static context
[FOCAL] public static double ScoreUtils.chiSquared(double[] parentClassCounts, double[][] childrenClassCounts)
[PATH1] for(i < childrenClassCounts.length)=T -> for(j < parentClassCounts.length)=F -> exit loop -> return sum
[PATH2] for(i < childrenClassCounts.length)=F -> return sum
[PATH3] for(i < chi... | true | ok | {"focal": {"class": "ScoreUtils", "name": "chiSquared", "signature": "double chiSquared(double[] parentClassCounts, double[][] childrenClassCounts)", "start_line": 3, "modifiers": "public static", "params": [{"name": "parentClassCounts", "type": "double[]"}, {"name": "childrenClassCounts", "type": "double[][]"}], "retu... |
161651256_6 | class CustomSeekProvider extends PlaybackSeekDataProvider {
@Override
public long[] getSeekPositions() {
if (!videoPlayerAdapter.canSeek()) return new long[0];
return splitIntoThirtySecondsParts(videoPlayerAdapter.getDuration());
}
CustomSeekProvider(VideoPlayerAdapter videoPlayerAda... | VideoPlayerAdapter videoPlayerAdapter = mock(VideoPlayerAdapter.class);
when(videoPlayerAdapter.canSeek()).thenReturn(true);
when(videoPlayerAdapter.getDuration()).thenReturn(130_000L);
CustomSeekProvider customSeekProvider = new CustomSeekProvider(videoPlayerAdapter);
long[] e... | [FOCAL] @Override public long[] CustomSeekProvider.getSeekPositions()
[CLASS] class CustomSeekProvider extends PlaybackSeekDataProvider
[METRICS] loc=5 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] long[] splitIntoThirtySecondsParts(long duration)
[CALLS-EXTERNAL] videoPlayerAdapter.canSeek/0, v... | /* static context
[FOCAL] @Override public long[] CustomSeekProvider.getSeekPositions()
[PATH1] if(!videoPlayerAdapter.canSeek())=T -> return new long[0]
[PATH2] if(!videoPlayerAdapter.canSeek())=F -> return splitIntoThirtySecondsParts(videoPlayerAdapter.getDuration())
[COLLABORATORS] field videoPlayerAdapter canSeek/0... | /* static context
[FOCAL] @Override public long[] CustomSeekProvider.getSeekPositions()
[PATH1] if(!videoPlayerAdapter.canSeek())=T -> return new long[0]
[PATH2] if(!videoPlayerAdapter.canSeek())=F -> return splitIntoThirtySecondsParts(videoPlayerAdapter.getDuration())
[COLLABORATORS] field videoPlayerAdapter canSeek/0... | true | ok | {"focal": {"class": "CustomSeekProvider", "name": "getSeekPositions", "signature": "long[] getSeekPositions()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "long[]"}, "class_info": {"name": "CustomSeekProvider", "kind": "class", "modifiers": "", "superclass": "PlaybackSeekDataProvider... |
161654269_3 | class TextSelection extends Selection {
public void applyStyle(OdfStyleBase style) throws InvalidNavigationException {
// append the specified style to the selection
if (validate() == false) {
throw new InvalidNavigationException("No matched string at this position");
}
OdfElement parentElement... | search = null;
search = new TextNavigation("delete", doc);
OdfOfficeAutomaticStyles autoStyles = null;
try {
autoStyles = doc.getContentDom().getAutomaticStyles();
} catch (Exception e1) {
Assert.fail("Failed with " + e1.getClass().getName() + ": '" + e1.getMessage() + "'");
}
//... | [FOCAL] public void TextSelection.applyStyle(OdfStyleBase style)
[CLASS] class TextSelection extends Selection
[METRICS] loc=12 cc=2 branches=1 loops=0 returns=0 throws=1 nesting=1
[CALLS-INTERNAL] OdfElement getContainerElement(); String getText(); boolean validate(); void appendStyle(int fromindex, int leftLength, No... | /* static context
[FOCAL] public void TextSelection.applyStyle(OdfStyleBase style)
[THROWS-WHEN] InvalidNavigationException when validate() == false
[PATH1] if(validate() == false)=T -> throw new InvalidNavigationException("No matched string at this position")
[PATH2] if(validate() == false)=F
[EXCEPTIONS] declares Inv... | /* static context
[FOCAL] public void TextSelection.applyStyle(OdfStyleBase style)
[THROWS-WHEN] InvalidNavigationException when validate() == false
[PATH1] if(validate() == false)=T -> throw new InvalidNavigationException("No matched string at this position")
[PATH2] if(validate() == false)=F
[EXCEPTIONS] declares Inv... | true | ok | {"focal": {"class": "TextSelection", "name": "applyStyle", "signature": "void applyStyle(OdfStyleBase style) throws InvalidNavigationException", "start_line": 3, "modifiers": "public", "params": [{"name": "style", "type": "OdfStyleBase"}], "return_type": "void"}, "class_info": {"name": "TextSelection", "kind": "class",... |
161757837_7 | class FileUtil extends cn.hutool.core.io.FileUtil {
public static String getFileNameNoEx(String filename) {
if ((filename != null) && (filename.length() > 0)) {
int dot = filename.lastIndexOf('.');
if ((dot > -1) && (dot < (filename.length()))) {
return filename.subs... | assertEquals("foo", getFileNameNoEx("foo"));
assertEquals("bar", getFileNameNoEx("bar.txt"));
}
} | [FOCAL] public static String FileUtil.getFileNameNoEx(String filename)
[CLASS] class FileUtil extends cn.hutool.core.io.FileUtil
[METRICS] loc=9 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] String.length/0, String.lastIndexOf/1, String.substring/2
[PATH1] if((filename != null) && (filename.leng... | /* static context
[FOCAL] public static String FileUtil.getFileNameNoEx(String filename)
[PATH1] if((filename != null) && (filename.length() > 0))=T -> if((dot > -1) && (dot < (filename.length())))=T -> return filename.substring(0, dot)
[PATH2] if((filename != null) && (filename.length() > 0))=F -> return filename
[PAT... | /* static context
[FOCAL] public static String FileUtil.getFileNameNoEx(String filename)
[PATH1] if((filename != null) && (filename.length() > 0))=T -> if((dot > -1) && (dot < (filename.length())))=T -> return filename.substring(0, dot)
[PATH2] if((filename != null) && (filename.length() > 0))=F -> return filename
[PAT... | true | ok | {"focal": {"class": "FileUtil", "name": "getFileNameNoEx", "signature": "String getFileNameNoEx(String filename)", "start_line": 3, "modifiers": "public static", "params": [{"name": "filename", "type": "String"}], "return_type": "String"}, "class_info": {"name": "FileUtil", "kind": "class", "modifiers": "", "superclass... |
161790867_0 | class SelectionManager {
public SelectionManager(
ApplicationMaster am, Configuration conf,
StatusManager statusManager, RequestManager requestManager) {
this.am = am;
this.conf = conf.getLauncherConfig();
this.statusManager = statusManager;
this.requestManager = requestManager;
}
pu... | 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(ApplicationMaster am, Configuration conf, StatusManager statusManager, RequestManager requestManager)
[CLASS] class SelectionManager
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] Configuration.getLauncherConfig/0
[FIELDS] write=am,... | class SelectionManager {
public SelectionManager(
ApplicationMaster am, Configuration conf,
StatusManager statusManager, RequestManager requestManager) {
this.am = am;
this.conf = conf.getLauncherConfig();
this.statusManager = statusManager;
this.requestManager = requestManager;
}
pu... | false | ok | {"focal": {"class": "SelectionManager", "name": "SelectionManager", "signature": "SelectionManager(ApplicationMaster am, Configuration conf, StatusManager statusManager, RequestManager requestManager)", "start_line": 3, "modifiers": "public", "params": [{"name": "am", "type": "ApplicationMaster"}, {"name": "conf", "typ... | |
161804680_8 | class OwnerNameService {
public boolean shouldContainOwnerName(IbanAccountReference ibanAccountReference, SpiAccountAccess accountAccess) {
SpiAdditionalInformationAccess spiAdditionalInformationAccess = accountAccess.getSpiAdditionalInformationAccess();
if (spiAdditionalInformationAccess != null &... | IbanAccountReference accountReference = new IbanAccountReference(IBAN_FIRST_ACCOUNT, CURRENCY_EUR);
SpiAccountAccess accountAccessAvailableAccounts = jsonReader.getObjectFromFile("json/account/additional-account-information/spi-account-access-available-accounts.json", SpiAccountAccess.class);
b... | [FOCAL] public boolean OwnerNameService.shouldContainOwnerName(IbanAccountReference ibanAccountReference, SpiAccountAccess accountAccess)
[CLASS] class OwnerNameService
[METRICS] loc=11 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] boolean containsAccountReferenceWithIban(List<SpiAccountReferenc... | /* static context
[FOCAL] public boolean OwnerNameService.shouldContainOwnerName(IbanAccountReference ibanAccountReference, SpiAccountAccess accountAccess)
[PATH1] if(spiAdditionalInformationAccess != null && spiAdditionalInformationAccess.getOwnerName() != null)=T -> return ownerName.isEmpty() || containsAccountRefere... | /* static context
[FOCAL] public boolean OwnerNameService.shouldContainOwnerName(IbanAccountReference ibanAccountReference, SpiAccountAccess accountAccess)
[PATH1] if(spiAdditionalInformationAccess != null && spiAdditionalInformationAccess.getOwnerName() != null)=T -> return ownerName.isEmpty() || containsAccountRefere... | true | ok | {"focal": {"class": "OwnerNameService", "name": "shouldContainOwnerName", "signature": "boolean shouldContainOwnerName(IbanAccountReference ibanAccountReference, SpiAccountAccess accountAccess)", "start_line": 3, "modifiers": "public", "params": [{"name": "ibanAccountReference", "type": "IbanAccountReference"}, {"name"... |
161828855_11 | class PuppetTask implements Task {
@Override
public void execute(Context ctx) throws Exception {
PuppetResult result;
try {
result = getResult(ctx);
} catch (Exception ex) {
// Determine if task should fail gracefully
if (ignoreErrors != null && ign... | MockContext ctx = new MockContext(buildDbQueryConfig());
// Set ignoreErrors = true
UtilsTest.injectVariable(task, "action", "bad_action");
UtilsTest.injectVariable(task, "ignoreErrors", true);
// Normally, this should throw an exception
task.execute(ctx);
// M... | [FOCAL] @Override public void PuppetTask.execute(Context ctx)
[CLASS] class PuppetTask implements Task
[METRICS] loc=19 cc=3 branches=1 loops=0 returns=0 throws=1 nesting=2
[CALLS-INTERNAL] PuppetResult getResult(Context ctx)
[CALLS-EXTERNAL] Exception.getMessage/0, Context.setVariable/2, ObjectMapper.convertValue/2
[N... | /* static context
[FOCAL] @Override public void PuppetTask.execute(Context ctx)
[THROWS-WHEN] ex when try-body throws && !(ignoreErrors != null && ignoreErrors)
[PATH1] try-body throws -> if(ignoreErrors != null && ignoreErrors)=F -> throw ex
[PATH2] try-body throws -> if(ignoreErrors != null && ignoreErrors)=T
[COLLAB... | /* static context
[FOCAL] @Override public void PuppetTask.execute(Context ctx)
[THROWS-WHEN] ex when try-body throws && !(ignoreErrors != null && ignoreErrors)
[PATH1] try-body throws -> if(ignoreErrors != null && ignoreErrors)=F -> throw ex
[PATH2] try-body throws -> if(ignoreErrors != null && ignoreErrors)=T
[COLLAB... | true | ok | {"focal": {"class": "PuppetTask", "name": "execute", "signature": "void execute(Context ctx) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "ctx", "type": "Context"}], "return_type": "void"}, "class_info": {"name": "PuppetTask", "kind": "class", "modifiers": "", "superclass": n... |
162030403_1 | class UUIDValidator implements ConstraintValidator<ValidUUID, String> {
@Override
public boolean isValid(String uuid, ConstraintValidatorContext context) {
return pattern.matcher(uuid).matches();
}
@Override public void initialize(ValidUUID constraint);
private static final UUIDValidator ... | Assertions.assertThat(validator.isValid("3a1757d0", null)).isFalse();
}
} | [FOCAL] @Override public boolean UUIDValidator.isValid(String uuid, ConstraintValidatorContext context)
[CLASS] class UUIDValidator implements ConstraintValidator<ValidUUID, String>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] pattern.matcher(uuid).matches/0, pattern.matcher/1
[... | /* static context
[FOCAL] @Override public boolean UUIDValidator.isValid(String uuid, ConstraintValidatorContext context)
[INPUTS] branches=- | result=uuid | unused=context
[COLLABORATORS] field pattern matcher/1
[CALLS-EXTERNAL] pattern.matcher(uuid).matches/0, pattern.matcher/1
*/
| /* static context
[FOCAL] @Override public boolean UUIDValidator.isValid(String uuid, ConstraintValidatorContext context)
[INPUTS] branches=- | result=uuid | unused=context
[COLLABORATORS] field pattern matcher/1
[CALLS-EXTERNAL] pattern.matcher(uuid).matches/0, pattern.matcher/1
*/
class UUIDValidator implements Const... | true | ok | {"focal": {"class": "UUIDValidator", "name": "isValid", "signature": "boolean isValid(String uuid, ConstraintValidatorContext context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "uuid", "type": "String"}, {"name": "context", "type": "ConstraintValidatorContext"}], "return_type": "boolean"},... |
162051749_345 | class InfoboxTypeMapper {
private InfoboxTypeMapper() {
// no instance
}
private InfoboxTypeMapper();
private static final Map<String, String> loadMapping(final int colIdx);
public static LocationType getLocationType(String infoboxName);
public static String getConLLType(String infob... | assertNull(getConLLType("doesNotExist"));
assertNull(getLocationType("doesNotExist"));
assertEquals("LOC", getConLLType("country"));
assertEquals(COUNTRY, getLocationType("country"));
}
} | [FOCAL] private InfoboxTypeMapper.InfoboxTypeMapper()
[CLASS] class InfoboxTypeMapper
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CLASS-MEMBERS] InfoboxTypeMapper(); Map<String, String> loadMapping(int colIdx); LocationType getLocationType(String infoboxName); String getConLLType(String infobo... | /* static context
[FOCAL] private InfoboxTypeMapper.InfoboxTypeMapper()
*/
| /* static context
[FOCAL] private InfoboxTypeMapper.InfoboxTypeMapper()
*/
class InfoboxTypeMapper {
private InfoboxTypeMapper() {
// no instance
}
private InfoboxTypeMapper();
private static final Map<String, String> loadMapping(final int colIdx);
public static LocationType getLocationT... | true | ok | {"focal": {"class": "InfoboxTypeMapper", "name": "InfoboxTypeMapper", "signature": "InfoboxTypeMapper()", "start_line": 3, "modifiers": "private", "params": [], "return_type": null}, "class_info": {"name": "InfoboxTypeMapper", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "memb... |
162158820_2 | class SUtil {
public static URI toURI(URL url)
{
if(url==null)
return null;
URI ret = null;
try
{
ret = url.toURI();
}
catch(Exception e)
{
throw new RuntimeException(e);
}
return ret;
}
public static final SecureRandom getSecureRandom();
public static String[] getStringArray(String... | URI uri = SUtil.toURI("tcp-mtp://fe80:0:0:0:8cf:5aff:feeb:f199%eth0:42716");
Assert.assertEquals("tcp-mtp", uri.getScheme());
Assert.assertEquals("[fe80:0:0:0:8cf:5aff:feeb:f199%eth0]", uri.getHost());
Assert.assertEquals(42716, uri.getPort());
}
} | [FOCAL] public static URI SUtil.toURI(URL url)
[CLASS] class SUtil
[METRICS] loc=16 cc=3 branches=1 loops=0 returns=2 throws=1 nesting=1
[CALLS-EXTERNAL] URL.toURI/0
[NEW] RuntimeException
[EXCEPTIONS] throws RuntimeException; catches Exception e
[THROWS-WHEN] RuntimeException when !(url==null) && try-body throws
[PATH... | class SUtil {
public static URI toURI(URL url)
{
if(url==null)
return null;
URI ret = null;
try
{
ret = url.toURI();
}
catch(Exception e)
{
throw new RuntimeException(e);
}
return ret;
}
public static final SecureRandom getSecureRandom();
public static String[] getStringArray(String... | false | ok | {"focal": {"class": "SUtil", "name": "toURI", "signature": "URI toURI(URL url)", "start_line": 3, "modifiers": "public static", "params": [{"name": "url", "type": "URL"}], "return_type": "URI"}, "class_info": {"name": "SUtil", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "memb... | |
162236965_22 | class GridBase implements Grid, EventTarget {
@Override
public void spanRow(int count, int rowIndex, int colIndex) {
if (count <= 0 || count > getRowCount() || rowIndex >= getRowCount() || colIndex >= columnCount) {
return;
}
final SpreadsheetCell cell = rows.get(rowIndex).g... | grid.spanRow(0, 0, 0);
assertEquals(1, grid.getRows().get(0).get(0).getRowSpan());
grid.spanRow(-1, -1, -1);
grid.spanRow(0, -1, 0);
grid.spanRow(0, 0, -1);
grid.spanRow(-1, 0, 0);
grid.spanRow(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE);
gri... | [FOCAL] @Override public void GridBase.spanRow(int count, int rowIndex, int colIndex)
[CLASS] class GridBase implements Grid, EventTarget
[METRICS] loc=17 cc=5 branches=2 loops=2 returns=1 throws=0 nesting=3
[CALLS-INTERNAL] int getRowCount()
[CALLS-EXTERNAL] rows.get(rowIndex).get/1, rows.get/1, SpreadsheetCell.getCol... | /* static context
[FOCAL] @Override public void GridBase.spanRow(int count, int rowIndex, int colIndex)
[PATH1] if(count <= 0 || count > getRowCount() || rowIndex >= getRowCount() || colIndex >= columnCount)=F -> for(row < rowIndex + rowSpan && row < getRowCount())=T -> for(col < colIndex + colSpan && col < columnCount... | /* static context
[FOCAL] @Override public void GridBase.spanRow(int count, int rowIndex, int colIndex)
[PATH1] if(count <= 0 || count > getRowCount() || rowIndex >= getRowCount() || colIndex >= columnCount)=F -> for(row < rowIndex + rowSpan && row < getRowCount())=T -> for(col < colIndex + colSpan && col < columnCount... | true | ok | {"focal": {"class": "GridBase", "name": "spanRow", "signature": "void spanRow(int count, int rowIndex, int colIndex)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "count", "type": "int"}, {"name": "rowIndex", "type": "int"}, {"name": "colIndex", "type": "int"}], "return_type": "void"}, "class_... |
162272754_69 | class RegisterRenterController {
@PostMapping(value = ENDPOINT)
public ResponseEntity registerRenter(@RequestBody Renter renter) {
ResponseEntity responseEntity;
final HttpResponse httpResponse = adapter.registerRenter(renter);
switch (httpResponse.getStatus()) {
case CREATE... | final RegisterRenterController controller = new RegisterRenterController(
new MockRegisterRenterInputPort());
Renter renter = new Renter();
renter.setFirstName("John");
renter.setLastName("Doe");
renter.setEmail("john.doe@email.com");
final ResponseEntity<?> r... | [FOCAL] @PostMapping(value = ENDPOINT) public ResponseEntity RegisterRenterController.registerRenter(Renter renter)
[CLASS] class RegisterRenterController
[METRICS] loc=22 cc=4 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] adapter.registerRenter/1, HttpResponse.getStatus/0, ResponseEntity .created(UR... | /* static context
[FOCAL] @PostMapping(value = ENDPOINT) public ResponseEntity RegisterRenterController.registerRenter(Renter renter)
[PATH1] switch(httpResponse.getStatus())=case CREATED -> return responseEntity
[PATH2] switch(httpResponse.getStatus())=case CONFLICT -> return responseEntity
[PATH3] switch(httpResponse... | /* static context
[FOCAL] @PostMapping(value = ENDPOINT) public ResponseEntity RegisterRenterController.registerRenter(Renter renter)
[PATH1] switch(httpResponse.getStatus())=case CREATED -> return responseEntity
[PATH2] switch(httpResponse.getStatus())=case CONFLICT -> return responseEntity
[PATH3] switch(httpResponse... | true | ok | {"focal": {"class": "RegisterRenterController", "name": "registerRenter", "signature": "ResponseEntity registerRenter(Renter renter)", "start_line": 3, "modifiers": "@PostMapping(value = ENDPOINT) public", "params": [{"name": "renter", "type": "Renter"}], "return_type": "ResponseEntity"}, "class_info": {"name": "Regist... |
162297452_5 | class SimpleCassandraVersion implements Comparable<SimpleCassandraVersion> {
public static SimpleCassandraVersion create(String version)
{
String stripped = SNAPSHOT.matcher(version).replaceFirst("");
Matcher matcher = pattern.matcher(stripped);
if (!matcher.matches())
throw... | SimpleCassandraVersion alpha = SimpleCassandraVersion.create("4.0-alpha5-SNAPSHOT");
assertThat(alpha.major).isEqualTo(4);
assertThat(alpha.minor).isEqualTo(0);
assertThat(alpha.patch).isEqualTo(0);
}
} | [FOCAL] public static SimpleCassandraVersion SimpleCassandraVersion.create(String version)
[CLASS] class SimpleCassandraVersion implements Comparable<SimpleCassandraVersion>
[METRICS] loc=20 cc=3 branches=1 loops=0 returns=1 throws=2 nesting=1
[CALLS-EXTERNAL] SNAPSHOT.matcher(version).replaceFirst/1, SNAPSHOT.matcher/... | /* static context
[FOCAL] public static SimpleCassandraVersion SimpleCassandraVersion.create(String version)
[THROWS-WHEN] IllegalArgumentException when !matcher.matches()
[THROWS-WHEN] IllegalArgumentException when matcher.matches() && try-body throws
[PATH1] if(!matcher.matches())=F -> try-body throws -> throw new Il... | /* static context
[FOCAL] public static SimpleCassandraVersion SimpleCassandraVersion.create(String version)
[THROWS-WHEN] IllegalArgumentException when !matcher.matches()
[THROWS-WHEN] IllegalArgumentException when matcher.matches() && try-body throws
[PATH1] if(!matcher.matches())=F -> try-body throws -> throw new Il... | true | ok | {"focal": {"class": "SimpleCassandraVersion", "name": "create", "signature": "SimpleCassandraVersion create(String version)", "start_line": 3, "modifiers": "public static", "params": [{"name": "version", "type": "String"}], "return_type": "SimpleCassandraVersion"}, "class_info": {"name": "SimpleCassandraVersion", "kind... |
162325477_17 | class StaticHexRegexDataHandler extends HexRegexDataHandler {
@Override
public Optional<byte[]> handle(final byte[] data) {
final String encoded = BaseEncoding.base16().encode(data);
final boolean matches = hexRegex.matcher(encoded).matches();
if (matches) {
return Optional... | final Optional<byte[]> handleResult = dataHandler.handle(DEFAULT_TEST_DATA);
assertThat(handleResult, is(optionalWithValue(equalTo(base16().decode(RESPONSE_DATA)))));
}
} | [FOCAL] @Override public Optional<byte[]> StaticHexRegexDataHandler.handle(byte[] data)
[CLASS] class StaticHexRegexDataHandler extends HexRegexDataHandler
[METRICS] loc=11 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] BaseEncoding.base16().encode/1, BaseEncoding.base16/0, hexRegex.matcher(encod... | /* static context
[FOCAL] @Override public Optional<byte[]> StaticHexRegexDataHandler.handle(byte[] data)
[PATH1] if(matches)=T -> return Optional.of(base16().decode(responseData.toUpperCase()))
[PATH2] if(matches)=F -> return Optional.empty()
[INPUTS] branches=data | result=-
[COLLABORATORS] field hexRegex matcher/1; ... | /* static context
[FOCAL] @Override public Optional<byte[]> StaticHexRegexDataHandler.handle(byte[] data)
[PATH1] if(matches)=T -> return Optional.of(base16().decode(responseData.toUpperCase()))
[PATH2] if(matches)=F -> return Optional.empty()
[INPUTS] branches=data | result=-
[COLLABORATORS] field hexRegex matcher/1; ... | true | ok | {"focal": {"class": "StaticHexRegexDataHandler", "name": "handle", "signature": "Optional<byte[]> handle(byte[] data)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "data", "type": "byte[]"}], "return_type": "Optional<byte[]>"}, "class_info": {"name": "StaticHexRegexDataHandler", "kind": "class... |
162388276_15 | class GenericUtils {
public static <T> Class<T> ancestorGenericClass(Class<T> clazz) {
ParameterizedType genericSuperclass = firstParameterizedType(clazz);
Class<T> genericClass = (Class<T>) genericSuperclass.getActualTypeArguments()[0];
return genericClass;
}
public static Class<T... | Assertions.assertThrows(RuntimeException.class, () -> GenericUtils.ancestorGenericClass(AAA.class));
Assertions.assertSame(LinkedList.class, GenericUtils.ancestorGenericClass(BBB.class));
Assertions.assertSame(LinkedList.class, GenericUtils.ancestorGenericClass(CCC.class));
Assertions.as... | [FOCAL] public static Class<T> GenericUtils.ancestorGenericClass(Class<T> clazz)
[CLASS] class GenericUtils
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] ParameterizedType firstParameterizedType(Class<T> clazz)
[CALLS-EXTERNAL] ParameterizedType.getActualTypeArguments/0
[INPUTS] ... | /* static context
[FOCAL] public static Class<T> GenericUtils.ancestorGenericClass(Class<T> clazz)
[INPUTS] branches=- | result=clazz
[CALLS-INTERNAL] ParameterizedType firstParameterizedType(Class<T> clazz)
[CALLS-EXTERNAL] ParameterizedType.getActualTypeArguments/0
*/
| /* static context
[FOCAL] public static Class<T> GenericUtils.ancestorGenericClass(Class<T> clazz)
[INPUTS] branches=- | result=clazz
[CALLS-INTERNAL] ParameterizedType firstParameterizedType(Class<T> clazz)
[CALLS-EXTERNAL] ParameterizedType.getActualTypeArguments/0
*/
class GenericUtils {
public static <T> Class... | true | ok | {"focal": {"class": "GenericUtils", "name": "ancestorGenericClass", "signature": "Class<T> ancestorGenericClass(Class<T> clazz)", "start_line": 3, "modifiers": "public static", "params": [{"name": "clazz", "type": "Class<T>"}], "return_type": "Class<T>"}, "class_info": {"name": "GenericUtils", "kind": "class", "modifie... |
162389327_6 | class FootballPlayerFacadeREST extends AbstractFacade<FootballPlayer> {
@PUT
@Path("{id}")
@Consumes({MediaType.APPLICATION_JSON})
@Transactional(Transactional.TxType.REQUIRES_NEW)
public void edit(
@PathParam("id") Integer id, FootballPlayer entity) {
super.edit(entity);
}
... | System.out.println("edit");
FootballPlayer player = target.path("24").request().get(
new GenericTypeFootballPlayerImpl());
player.setPrice(new BigInteger("150"));
Response response = target.path("24").request().put(Entity.
entity(player,
... | [FOCAL] @PUT @Path("{id}") @Consumes({MediaType.APPLICATION_JSON}) @Transactional(Transactional.TxType.REQUIRES_NEW) public void FootballPlayerFacadeREST.edit(Integer id, FootballPlayer entity)
[CLASS] class FootballPlayerFacadeREST extends AbstractFacade<FootballPlayer>
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=... | /* static context
[FOCAL] @PUT @Path("{id}") @Consumes({MediaType.APPLICATION_JSON}) @Transactional(Transactional.TxType.REQUIRES_NEW) public void FootballPlayerFacadeREST.edit(Integer id, FootballPlayer entity)
[INPUTS] branches=- | result=- | unused=id
[CALLS-EXTERNAL] AbstractFacade<FootballPlayer>.edit/1
*/
| /* static context
[FOCAL] @PUT @Path("{id}") @Consumes({MediaType.APPLICATION_JSON}) @Transactional(Transactional.TxType.REQUIRES_NEW) public void FootballPlayerFacadeREST.edit(Integer id, FootballPlayer entity)
[INPUTS] branches=- | result=- | unused=id
[CALLS-EXTERNAL] AbstractFacade<FootballPlayer>.edit/1
*/
class F... | true | ok | {"focal": {"class": "FootballPlayerFacadeREST", "name": "edit", "signature": "void edit(Integer id, FootballPlayer entity)", "start_line": 3, "modifiers": "@PUT @Path(\"{id}\") @Consumes({MediaType.APPLICATION_JSON}) @Transactional(Transactional.TxType.REQUIRES_NEW) public", "params": [{"name": "id", "type": "Integer"}... |
162538669_4 | class MetaUtil {
public static DefaultRequest convertOldProtocolHeaderToRequest(RequestHeader header, DefaultRequest request) {
request.setRemoteAppkey(header.getClientAppkey());
request.setClientIp(header.getClientIp());
TransportTraceInfo transportTraceInfo = new TransportTraceInfo(header... | DefaultRequest request = new DefaultRequest();
request.setServiceInterface(Echo.Iface.class);
MetaUtil.convertOldProtocolHeaderToRequest(requestHeader, request);
Assert.assertEquals(request.getRemoteAppkey(), "com.sankuai.mock2");
Assert.assertEquals(request.getClientIp(), "127.0... | [FOCAL] public static DefaultRequest MetaUtil.convertOldProtocolHeaderToRequest(RequestHeader header, DefaultRequest request)
[CLASS] class MetaUtil
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] DefaultRequest.setRemoteAppkey/1, RequestHeader.getClientAppkey/0, DefaultRequest.se... | /* static context
[FOCAL] public static DefaultRequest MetaUtil.convertOldProtocolHeaderToRequest(RequestHeader header, DefaultRequest request)
[INPUTS] branches=- | result=request
[COLLABORATORS] param request:DefaultRequest setRemoteAppkey/1,setClientIp/1,setTransportTraceInfo/1; param header:RequestHeader getClientA... | /* static context
[FOCAL] public static DefaultRequest MetaUtil.convertOldProtocolHeaderToRequest(RequestHeader header, DefaultRequest request)
[INPUTS] branches=- | result=request
[COLLABORATORS] param request:DefaultRequest setRemoteAppkey/1,setClientIp/1,setTransportTraceInfo/1; param header:RequestHeader getClientA... | true | ok | {"focal": {"class": "MetaUtil", "name": "convertOldProtocolHeaderToRequest", "signature": "DefaultRequest convertOldProtocolHeaderToRequest(RequestHeader header, DefaultRequest request)", "start_line": 3, "modifiers": "public static", "params": [{"name": "header", "type": "RequestHeader"}, {"name": "request", "type": "... |
162657716_191 | class JsonRpc2_0Rx {
public Observable<PlatonBlock> replayBlocksObservable(
DefaultBlockParameter startBlock, DefaultBlockParameter endBlock,
boolean fullTransactionObjects) {
return replayBlocksObservable(startBlock, endBlock, fullTransactionObjects, true);
}
public JsonR... |
List<PlatonBlock> ethBlocks = Arrays.asList(createBlock(0), createBlock(1), createBlock(2));
OngoingStubbing<PlatonBlock> stubbing =
when(web3jService.send(any(Request.class), eq(PlatonBlock.class)));
for (PlatonBlock ethBlock : ethBlocks) {
stubbing = stubbing.then... | [FOCAL] public Observable<PlatonBlock> JsonRpc2_0Rx.replayBlocksObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock, boolean fullTransactionObjects)
[CLASS] class JsonRpc2_0Rx
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Observable<PlatonBlock> replayBloc... | /* static context
[FOCAL] public Observable<PlatonBlock> JsonRpc2_0Rx.replayBlocksObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock, boolean fullTransactionObjects)
[INPUTS] branches=- | result=endBlock, fullTransactionObjects, startBlock
[CALLS-INTERNAL] Observable<PlatonBlock> replayBlocksOb... | /* static context
[FOCAL] public Observable<PlatonBlock> JsonRpc2_0Rx.replayBlocksObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock, boolean fullTransactionObjects)
[INPUTS] branches=- | result=endBlock, fullTransactionObjects, startBlock
[CALLS-INTERNAL] Observable<PlatonBlock> replayBlocksOb... | true | ok | {"focal": {"class": "JsonRpc2_0Rx", "name": "replayBlocksObservable", "signature": "Observable<PlatonBlock> replayBlocksObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock, boolean fullTransactionObjects)", "start_line": 3, "modifiers": "public", "params": [{"name": "startBlock", "type": "Defaul... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.