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
129740723_0
class ReaderFromFile { public ArrayList<Integer> getDepots() { return depots; } public ReaderFromFile(String fileName); private void setProblemSpecification(); public ArrayList<Point> getClientCoords(); public ArrayList<Integer> getClientDemands(); public int getNumberOfClients(); public CVRPSpecificatio...
setFile("./input/tests/correctTest.vrp"); assertEquals(reader.getDepots().size(), 1); } }
[FOCAL] public ArrayList<Integer> ReaderFromFile.getDepots() [CLASS] class ReaderFromFile [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] ReaderFromFile(String fileName); void setProblemSpecification(); ArrayList<Point> getClientCoords(); ArrayList<Integer> getClientDemands(); int g...
/* static context [FOCAL] public ArrayList<Integer> ReaderFromFile.getDepots() */
/* static context [FOCAL] public ArrayList<Integer> ReaderFromFile.getDepots() */ class ReaderFromFile { public ArrayList<Integer> getDepots() { return depots; } public ReaderFromFile(String fileName); private void setProblemSpecification(); public ArrayList<Point> getClientCoords(); public ArrayList<Integ...
true
ok
{"focal": {"class": "ReaderFromFile", "name": "getDepots", "signature": "ArrayList<Integer> getDepots()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "ArrayList<Integer>"}, "class_info": {"name": "ReaderFromFile", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields...
129769092_246
class CommonUtils { public static boolean allHaveSameLength(Object... arrays) { if (arrays.length < 1) { return true; } int length = Array.getLength(arrays[0]); for (Object array : arrays) { if (Array.getLength(array) != length) { return fals...
int i = 1; String s = "s"; assertThat(allHaveSameLength(i, s), is(false)); } }
[FOCAL] public static boolean CommonUtils.allHaveSameLength(Object... arrays) [CLASS] class CommonUtils [METRICS] loc=14 cc=4 branches=2 loops=1 returns=3 throws=0 nesting=2 [CALLS-EXTERNAL] Array.getLength/1 [PATH1] if(arrays.length < 1)=F -> foreach(Object array : arrays)=T -> if(Array.getLength(array) != length)=F -...
/* static context [FOCAL] public static boolean CommonUtils.allHaveSameLength(Object... arrays) [PATH1] if(arrays.length < 1)=F -> foreach(Object array : arrays)=T -> if(Array.getLength(array) != length)=F -> exit loop -> return true [PATH2] if(arrays.length < 1)=F -> foreach(Object array : arrays)=T -> if(Array.getLen...
/* static context [FOCAL] public static boolean CommonUtils.allHaveSameLength(Object... arrays) [PATH1] if(arrays.length < 1)=F -> foreach(Object array : arrays)=T -> if(Array.getLength(array) != length)=F -> exit loop -> return true [PATH2] if(arrays.length < 1)=F -> foreach(Object array : arrays)=T -> if(Array.getLen...
true
ok
{"focal": {"class": "CommonUtils", "name": "allHaveSameLength", "signature": "boolean allHaveSameLength(Object... arrays)", "start_line": 3, "modifiers": "public static", "params": [{"name": "arrays", "type": "Object..."}], "return_type": "boolean"}, "class_info": {"name": "CommonUtils", "kind": "class", "modifiers": "...
129771138_842
class ConsentEntity extends InstanceDependableEntity implements Authorisable { public boolean isWrongConsentData() { return CollectionUtils.isEmpty(psuDataList) || tppInformation == null || tppInformation.getTppInfo() == null; } @PostLoad public void consentPo...
// Given ConsentEntity aisConsent = buildConsent(Collections.emptyList(), TPP_INFO, false); // When boolean actual = aisConsent.isWrongConsentData(); // Then assertTrue(actual); } }
[FOCAL] public boolean ConsentEntity.isWrongConsentData() [CLASS] class ConsentEntity extends InstanceDependableEntity implements Authorisable [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] CollectionUtils.isEmpty/1, tppInformation.getTppInfo/0 [COLLABORATORS] field tppInformation...
/* static context [FOCAL] public boolean ConsentEntity.isWrongConsentData() [COLLABORATORS] field tppInformation getTppInfo/0 [CALLS-EXTERNAL] CollectionUtils.isEmpty/1, tppInformation.getTppInfo/0 */
/* static context [FOCAL] public boolean ConsentEntity.isWrongConsentData() [COLLABORATORS] field tppInformation getTppInfo/0 [CALLS-EXTERNAL] CollectionUtils.isEmpty/1, tppInformation.getTppInfo/0 */ class ConsentEntity extends InstanceDependableEntity implements Authorisable { public boolean isWrongConsentData()...
true
ok
{"focal": {"class": "ConsentEntity", "name": "isWrongConsentData", "signature": "boolean isWrongConsentData()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "ConsentEntity", "kind": "class", "modifiers": "", "superclass": "InstanceDependableEntity", "interfaces...
129848791_18
class WeaverObserveOnComponentAbstract implements WeaverObserveOnComponent<T> { protected String getSchedulerName() { Object[] args = getJoinPoint().getArgs(); if (args == null || args.length == 0) return null; RxScheduler rxScheduler = RxScheduler.fromClass(args[0].getClass()); return rxScheduler != null...
when(proceedingJoinPoint.getArgs()).thenReturn(new Object[]{Schedulers.io()}); assertEquals(RxScheduler.IO.name(), weaverComponent.getSchedulerName()); } }
[FOCAL] protected String WeaverObserveOnComponentAbstract.getSchedulerName() [CLASS] class WeaverObserveOnComponentAbstract implements WeaverObserveOnComponent<T> [METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] ProceedingJoinPoint getJoinPoint() [CALLS-EXTERNAL] getJoinPoint().getA...
/* static context [FOCAL] protected String WeaverObserveOnComponentAbstract.getSchedulerName() [PATH1] if(args == null || args.length == 0)=T -> return null [PATH2] if(args == null || args.length == 0)=F -> return rxScheduler != null ? rxScheduler.name() : args[0].getClass().getSi... [CALLS-INTERNAL] ProceedingJoinPoin...
/* static context [FOCAL] protected String WeaverObserveOnComponentAbstract.getSchedulerName() [PATH1] if(args == null || args.length == 0)=T -> return null [PATH2] if(args == null || args.length == 0)=F -> return rxScheduler != null ? rxScheduler.name() : args[0].getClass().getSi... [CALLS-INTERNAL] ProceedingJoinPoin...
true
ok
{"focal": {"class": "WeaverObserveOnComponentAbstract", "name": "getSchedulerName", "signature": "String getSchedulerName()", "start_line": 3, "modifiers": "protected", "params": [], "return_type": "String"}, "class_info": {"name": "WeaverObserveOnComponentAbstract", "kind": "class", "modifiers": "", "superclass": null...
129892661_69
class LotteryTicket { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } LotteryTicket other = (LotteryTicket) obj; if (lotteryNumbers == null) { ...
PlayerDetails details1 = new PlayerDetails("bob@foo.bar", "1212-121212", "+34332322"); LotteryNumbers numbers1 = LotteryNumbers.create(new HashSet<>(Arrays.asList(1, 2, 3, 4))); LotteryTicket ticket1 = new LotteryTicket(new LotteryTicketId(), details1, numbers1); PlayerDetails details2 = new PlayerDetai...
[FOCAL] @Override public boolean LotteryTicket.equals(Object obj) [CLASS] class LotteryTicket [METRICS] loc=28 cc=10 branches=9 loops=0 returns=8 throws=0 nesting=2 [CALLS-EXTERNAL] getClass/0 (inherited), Object.getClass/0, lotteryNumbers.equals/1, playerDetails.equals/1 [PATH1] if(this == obj)=F -> if(obj == null)=F ...
/* static context [FOCAL] @Override public boolean LotteryTicket.equals(Object obj) [PATH1] if(this == obj)=F -> if(obj == null)=F -> if(getClass() != obj.getClass())=F -> if(lotteryNumbers == null)=T -> if(other.lotteryNumbers != null)=F -> if(playerDetails == null)=T -> if(other.playerDetails != null)=T -> return fal...
/* static context [FOCAL] @Override public boolean LotteryTicket.equals(Object obj) [PATH1] if(this == obj)=F -> if(obj == null)=F -> if(getClass() != obj.getClass())=F -> if(lotteryNumbers == null)=T -> if(other.lotteryNumbers != null)=F -> if(playerDetails == null)=T -> if(other.playerDetails != null)=T -> return fal...
true
ok
{"focal": {"class": "LotteryTicket", "name": "equals", "signature": "boolean equals(Object obj)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "obj", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "LotteryTicket", "kind": "class", "modifiers": "", "superclass": null, "int...
129954828_55
class JerseyInvocation implements javax.ws.rs.client.Invocation { ClientRequest request() { return requestContext; } private JerseyInvocation(final Builder builder); private JerseyInvocation(final Builder builder, final boolean copyRequestContext); private static Map<String, EntityPrese...
final Client client = ClientBuilder.newClient(); final Invocation.Builder builder = client.target("http://localhost:8080/mypath").request(); final JerseyInvocation invocation = (JerseyInvocation) builder .header("foo", "bar").header("foo", null).header("bar", "foo") ...
[FOCAL] ClientRequest JerseyInvocation.request() [CLASS] class JerseyInvocation implements javax.ws.rs.client.Invocation [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] JerseyInvocation(Builder builder); JerseyInvocation(Builder builder, boolean copyRequestContext); Map<String, Enti...
/* static context [FOCAL] ClientRequest JerseyInvocation.request() */
/* static context [FOCAL] ClientRequest JerseyInvocation.request() */ class JerseyInvocation implements javax.ws.rs.client.Invocation { ClientRequest request() { return requestContext; } private JerseyInvocation(final Builder builder); private JerseyInvocation(final Builder builder, final bo...
true
ok
{"focal": {"class": "JerseyInvocation", "name": "request", "signature": "ClientRequest request()", "start_line": 3, "modifiers": "", "params": [], "return_type": "ClientRequest"}, "class_info": {"name": "JerseyInvocation", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "javax.ws.rs.client.Invocatio...
129972128_93
class ApiRequest { JSONObject getBody() { return body; } private ApiRequest(Builder builder); RequestMethod getRequestMethod(); String getPath(); Map<String, String> getHeaders(); } class ApiRequestTest { @Test public void setBody_verifyBody() {
JSONObject body = new JSONObject(); ApiRequest apiRequest = new ApiRequest.Builder(ApiRequest.RequestMethod.POST, "/") .setBody(body) .build(); assertEquals(body, apiRequest.getBody()); } }
[FOCAL] JSONObject ApiRequest.getBody() [CLASS] class ApiRequest [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] ApiRequest(Builder builder); RequestMethod getRequestMethod(); String getPath(); Map<String, String> getHeaders() [TEST] ApiRequestTest: @Test public void setBody_verifyB...
/* static context [FOCAL] JSONObject ApiRequest.getBody() */
/* static context [FOCAL] JSONObject ApiRequest.getBody() */ class ApiRequest { JSONObject getBody() { return body; } private ApiRequest(Builder builder); RequestMethod getRequestMethod(); String getPath(); Map<String, String> getHeaders(); } class ApiRequestTest { @Test ...
true
ok
{"focal": {"class": "ApiRequest", "name": "getBody", "signature": "JSONObject getBody()", "start_line": 3, "modifiers": "", "params": [], "return_type": "JSONObject"}, "class_info": {"name": "ApiRequest", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "ApiRe...
130000911_104
class RLP { public static byte[] encode(Object input) { Value val = new Value(input); if (val.isList()) { List<Object> inputArray = val.asList(); if (inputArray.isEmpty()) { return encodeLength(inputArray.size(), OFFSET_SHORT_LIST); } ...
String result = Hex.toHexString(encode(0xED)); String expected = "81ed"; assertEquals(expected, result); } }
[FOCAL] public static byte[] RLP.encode(Object input) [CLASS] class RLP [METRICS] loc=23 cc=5 branches=3 loops=1 returns=4 throws=0 nesting=2 [CALLS-INTERNAL] byte[] encodeLength(int length, int offset); byte[] toBytes(Object input) [CALLS-EXTERNAL] Value.isList/0, Value.asList/0, List<Object>.isEmpty/0, List<Object>.s...
/* static context [FOCAL] public static byte[] RLP.encode(Object input) [PATH1] if(val.isList())=T -> if(inputArray.isEmpty())=F -> foreach(Object object : inputArray)=T -> exit loop -> return concatenate(prefix, output) [PATH2] if(val.isList())=F -> if(inputAsBytes.length == 1 && (inputAsBytes[0] & 0xff) < 0x80)=T -> ...
/* static context [FOCAL] public static byte[] RLP.encode(Object input) [PATH1] if(val.isList())=T -> if(inputArray.isEmpty())=F -> foreach(Object object : inputArray)=T -> exit loop -> return concatenate(prefix, output) [PATH2] if(val.isList())=F -> if(inputAsBytes.length == 1 && (inputAsBytes[0] & 0xff) < 0x80)=T -> ...
true
ok
{"focal": {"class": "RLP", "name": "encode", "signature": "byte[] encode(Object input)", "start_line": 3, "modifiers": "public static", "params": [{"name": "input", "type": "Object"}], "return_type": "byte[]"}, "class_info": {"name": "RLP", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fiel...
130200142_1
class AppController extends Application { public String getMeasureId() { return String.format("%s_measure_%s_%s", Utils.getAndroidID(getContentResolver()), Utils.getUniversalTimestamp(), Utils.getSaltString(16)); } @Override public void onCreate(); public String getAzureConnection(); publi...
String valid = String.format("%s_measure_%s_%s", "AndroidUUID", Utils.getUniversalTimestamp(), Utils.getSaltString(16)); String invalidId = "9e58cfb935e72628_measure1_1545035746888_CetMsJLZJvUsTboi"; String[] array = valid.split("_"); Assert.assertEquals("Measure ID schema is not corre...
[FOCAL] public String AppController.getMeasureId() [CLASS] class AppController extends Application [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] String.format/4, Utils.getAndroidID/1, getContentResolver/0 (inherited), Utils.getUniversalTimestamp/0, Utils.getSaltString/1 [CLASS-ME...
/* static context [FOCAL] public String AppController.getMeasureId() [CALLS-EXTERNAL] String.format/4, Utils.getAndroidID/1, getContentResolver/0 (inherited), Utils.getUniversalTimestamp/0, Utils.getSaltString/1 */
/* static context [FOCAL] public String AppController.getMeasureId() [CALLS-EXTERNAL] String.format/4, Utils.getAndroidID/1, getContentResolver/0 (inherited), Utils.getUniversalTimestamp/0, Utils.getSaltString/1 */ class AppController extends Application { public String getMeasureId() { return String.forma...
true
ok
{"focal": {"class": "AppController", "name": "getMeasureId", "signature": "String getMeasureId()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "AppController", "kind": "class", "modifiers": "", "superclass": "Application", "interfaces": null, "fields": [{"name"...
130308047_3
class LogAwareExceptionHandler implements ExceptionHandler { @Override public void onException(String summary, Throwable error) { zlgSupplier.get().w(summary, error); } LogAwareExceptionHandler(Supplier<Zlg> zlgSupplier); } class LogAwareExceptionHandlerTest { @Test public void test() {
final MockLogTarget logTarget = new MockLogTarget(); final LogAwareExceptionHandler handler = new LogAwareExceptionHandler(logTarget::logger); final String summary = "summary"; final Throwable error = new RuntimeException("error"); handler.onException(summary, error); logTarget.entries...
[FOCAL] @Override public void LogAwareExceptionHandler.onException(String summary, Throwable error) [CLASS] class LogAwareExceptionHandler implements ExceptionHandler [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] zlgSupplier.get().w/2, zlgSupplier.get/0 [COLLABORATORS] field zlgS...
/* static context [FOCAL] @Override public void LogAwareExceptionHandler.onException(String summary, Throwable error) [COLLABORATORS] field zlgSupplier get/0 [CALLS-EXTERNAL] zlgSupplier.get().w/2, zlgSupplier.get/0 */
/* static context [FOCAL] @Override public void LogAwareExceptionHandler.onException(String summary, Throwable error) [COLLABORATORS] field zlgSupplier get/0 [CALLS-EXTERNAL] zlgSupplier.get().w/2, zlgSupplier.get/0 */ class LogAwareExceptionHandler implements ExceptionHandler { @Override public void onException(S...
true
ok
{"focal": {"class": "LogAwareExceptionHandler", "name": "onException", "signature": "void onException(String summary, Throwable error)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "summary", "type": "String"}, {"name": "error", "type": "Throwable"}], "return_type": "void"}, "class_info": {"na...
130383787_0
class DataService { public List<CardBin> getCardBins(){ CardBinRequest.Builder request = CardBinRequest.newBuilder(); request.setUserName(rpcUserName); request.setPassword(rpcPassword); CardBinResponse response = client.execute(CARD_BIN_SERVICE_NAME, request.build(), CardBinResponse.class); return response....
assertEquals(service.getCardBins().size(), 4856); } }
[FOCAL] public List<CardBin> DataService.getCardBins() [CLASS] class DataService [METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] CardBinRequest.newBuilder/0, CardBinRequest.Builder.setUserName/1, CardBinRequest.Builder.setPassword/1, client.execute/3, CardBinRequest.Builder.build/0...
/* static context [FOCAL] public List<CardBin> DataService.getCardBins() [COLLABORATORS] field client execute/3 [CALLS-EXTERNAL] CardBinRequest.newBuilder/0, CardBinRequest.Builder.setUserName/1, CardBinRequest.Builder.setPassword/1, client.execute/3, CardBinRequest.Builder.build/0, CardBinResponse.getCardBinList/0 */
/* static context [FOCAL] public List<CardBin> DataService.getCardBins() [COLLABORATORS] field client execute/3 [CALLS-EXTERNAL] CardBinRequest.newBuilder/0, CardBinRequest.Builder.setUserName/1, CardBinRequest.Builder.setPassword/1, client.execute/3, CardBinRequest.Builder.build/0, CardBinResponse.getCardBinList/0 */ ...
true
ok
{"focal": {"class": "DataService", "name": "getCardBins", "signature": "List<CardBin> getCardBins()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<CardBin>"}, "class_info": {"name": "DataService", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name":...
130464600_4
class CannedPropertyValidators { public static StringPropertyValidationRules textValidator() { return new StringPropertyValidationRules(false, 32); } public static BooleanPropertyValidationRules boolValidator(); public static PinPropertyValidationRules pinValidator(); public static PinProp...
StringPropertyValidationRules validator = CannedPropertyValidators.textValidator(); assertFalse(validator.hasChoices()); assertThat(validator.choices()).isEmpty(); assertTrue(validator.isValueValid("")); assertTrue(validator.isValueValid("This is text")); assertFalse(vali...
[FOCAL] public static StringPropertyValidationRules CannedPropertyValidators.textValidator() [CLASS] class CannedPropertyValidators [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] StringPropertyValidationRules [CLASS-MEMBERS] BooleanPropertyValidationRules boolValidator(); PinPropertyValidati...
/* static context [FOCAL] public static StringPropertyValidationRules CannedPropertyValidators.textValidator() [NEW] StringPropertyValidationRules */
/* static context [FOCAL] public static StringPropertyValidationRules CannedPropertyValidators.textValidator() [NEW] StringPropertyValidationRules */ class CannedPropertyValidators { public static StringPropertyValidationRules textValidator() { return new StringPropertyValidationRules(false, 32); } ...
true
ok
{"focal": {"class": "CannedPropertyValidators", "name": "textValidator", "signature": "StringPropertyValidationRules textValidator()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "StringPropertyValidationRules"}, "class_info": {"name": "CannedPropertyValidators", "kind": "class", "modifi...
130481756_44
class AssetResponseHttpMessageConverter implements HttpMessageConverter<AssetResponse> { @Override public void write(AssetResponse assetResponse, @Nullable MediaType mediaType, HttpOutputMessage httpOutputMessage) throws IOException { // Get meta data Asset asset = assetResponse.getAsset(); AssetMetaData me...
AssetResponse assetResponse = new AssetResponse(asset); MockHttpOutputMessage outputMessage = new MockHttpOutputMessage(); conv.write(assetResponse, MediaType.TEXT_PLAIN, outputMessage); assertEquals(asset.getMetaData().getContentType(), outputMessage.getHeaders().getContentType().toString()); assertTrue(...
[FOCAL] @Override public void AssetResponseHttpMessageConverter.write(AssetResponse assetResponse, MediaType mediaType, HttpOutputMessage httpOutputMessage) [CLASS] class AssetResponseHttpMessageConverter implements HttpMessageConverter<AssetResponse> [METRICS] loc=18 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=...
/* static context [FOCAL] @Override public void AssetResponseHttpMessageConverter.write(AssetResponse assetResponse, MediaType mediaType, HttpOutputMessage httpOutputMessage) [INPUTS] branches=- | result=- | unused=mediaType [COLLABORATORS] param assetResponse:AssetResponse getAsset/0; param httpOutputMessage:HttpOutpu...
/* static context [FOCAL] @Override public void AssetResponseHttpMessageConverter.write(AssetResponse assetResponse, MediaType mediaType, HttpOutputMessage httpOutputMessage) [INPUTS] branches=- | result=- | unused=mediaType [COLLABORATORS] param assetResponse:AssetResponse getAsset/0; param httpOutputMessage:HttpOutpu...
true
ok
{"focal": {"class": "AssetResponseHttpMessageConverter", "name": "write", "signature": "void write(AssetResponse assetResponse, MediaType mediaType, HttpOutputMessage httpOutputMessage) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "assetResponse", "type": "AssetResponse"}, ...
130492560_2
class JsonNodeSerde implements Serde<JsonNode>, Serializer<JsonNode>, Deserializer<JsonNode> { @Override public JsonNode deserialize(String topic, byte[] data) { if (data == null) { return null; } try { return mapper.readTree(data); } catch (Exception e) ...
byte[] json = StreamUtils.copyToByteArray(getClass().getResourceAsStream("JsonNodeSerdeTest.json")); JsonNode node = new JsonNodeSerde().deserialize(null, json); assertThat(node.get("schema").get("name").textValue()).isEqualTo("fb-connect.public.players.Envelope"); assertThat(node.get("...
[FOCAL] @Override public JsonNode JsonNodeSerde.deserialize(String topic, byte[] data) [CLASS] class JsonNodeSerde implements Serde<JsonNode>, Serializer<JsonNode>, Deserializer<JsonNode> [METRICS] loc=11 cc=3 branches=1 loops=0 returns=2 throws=1 nesting=1 [CALLS-EXTERNAL] mapper.readTree/1 [NEW] SerializationExceptio...
/* static context [FOCAL] @Override public JsonNode JsonNodeSerde.deserialize(String topic, byte[] data) [THROWS-WHEN] SerializationException when !(data == null) && try-body throws [PATH1] if(data == null)=F -> try-body throws -> throw new SerializationException("Error deserializing from " + new String... [PATH2] if(d...
/* static context [FOCAL] @Override public JsonNode JsonNodeSerde.deserialize(String topic, byte[] data) [THROWS-WHEN] SerializationException when !(data == null) && try-body throws [PATH1] if(data == null)=F -> try-body throws -> throw new SerializationException("Error deserializing from " + new String... [PATH2] if(d...
true
ok
{"focal": {"class": "JsonNodeSerde", "name": "deserialize", "signature": "JsonNode deserialize(String topic, byte[] data)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "topic", "type": "String"}, {"name": "data", "type": "byte[]"}], "return_type": "JsonNode"}, "class_info": {"name": "JsonNodeS...
130509793_1
class MessageUtil { public static String colored(String message) { return message != null ? ChatColor.translateAlternateColorCodes('&', message) : null; } private MessageUtil(); public static List<String> colored(List<String> messages); } class MessageUtilTest { @Test public void coloredListTest(...
List<String> expected = Arrays.asList("§7Hello!", "§cHow are you?", "§6I'm fine, thanks!"); List<String> actual = MessageUtil.colored( Arrays.asList("&7Hello!", null, "&cHow are you?", null, "&6I'm fine, thanks!")); Assert.assertEquals(expected, actual); } }
[FOCAL] public static String MessageUtil.colored(String message) [CLASS] class MessageUtil [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] ChatColor.translateAlternateColorCodes/2 [INPUTS] branches=- | result=message [DATAFLOW] message@param->L2 [CLASS-MEMBERS] MessageUtil(); List<...
/* static context [FOCAL] public static String MessageUtil.colored(String message) [INPUTS] branches=- | result=message [CALLS-EXTERNAL] ChatColor.translateAlternateColorCodes/2 */
/* static context [FOCAL] public static String MessageUtil.colored(String message) [INPUTS] branches=- | result=message [CALLS-EXTERNAL] ChatColor.translateAlternateColorCodes/2 */ class MessageUtil { public static String colored(String message) { return message != null ? ChatColor.translateAlternateColorCodes('...
true
ok
{"focal": {"class": "MessageUtil", "name": "colored", "signature": "String colored(String message)", "start_line": 3, "modifiers": "public static", "params": [{"name": "message", "type": "String"}], "return_type": "String"}, "class_info": {"name": "MessageUtil", "kind": "class", "modifiers": "", "superclass": null, "in...
130510170_0
class HtmlUtils { public static String getHtmlCharset(byte[] htmlContent) { String charset = Charset.defaultCharset().name(); return getHtmlCharset(htmlContent, charset); } public static String getHtmlCharset(byte[] htmlContent, String defaultCharset); public static String getHeadStr(S...
for (String currentCharset : charsets) { String html = "<html><meta charset=\"" + currentCharset + "\"/><body></body></html>"; String charset = HtmlUtils.getHtmlCharset(html.getBytes(currentCharset)); Assert.assertEquals(currentCharset, charset); } } }
[FOCAL] public static String HtmlUtils.getHtmlCharset(byte[] htmlContent) [CLASS] class HtmlUtils [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String getHtmlCharset(byte[] htmlContent, String defaultCharset) [CALLS-EXTERNAL] Charset.defaultCharset().name/0, Charset.defaultCharse...
/* static context [FOCAL] public static String HtmlUtils.getHtmlCharset(byte[] htmlContent) [INPUTS] branches=- | result=htmlContent [CALLS-INTERNAL] String getHtmlCharset(byte[] htmlContent, String defaultCharset) [CALLS-EXTERNAL] Charset.defaultCharset().name/0, Charset.defaultCharset/0 */
/* static context [FOCAL] public static String HtmlUtils.getHtmlCharset(byte[] htmlContent) [INPUTS] branches=- | result=htmlContent [CALLS-INTERNAL] String getHtmlCharset(byte[] htmlContent, String defaultCharset) [CALLS-EXTERNAL] Charset.defaultCharset().name/0, Charset.defaultCharset/0 */ class HtmlUtils { publ...
true
ok
{"focal": {"class": "HtmlUtils", "name": "getHtmlCharset", "signature": "String getHtmlCharset(byte[] htmlContent)", "start_line": 3, "modifiers": "public static", "params": [{"name": "htmlContent", "type": "byte[]"}], "return_type": "String"}, "class_info": {"name": "HtmlUtils", "kind": "class", "modifiers": "", "supe...
130603282_52
class AdapterWorkerManagement { public void stopStreamAdapter(AdapterStreamDescription adapterStreamDescription) throws AdapterException { stopAdapter(adapterStreamDescription); } public Collection<Protocol> getAllProtocols(); public Protocol getProtocol(String id); public Collection<Adap...
String expected = "Adapter with id http://test.de was not found in this container and cannot be stopped."; AdapterStreamDescription asd = new GenericAdapterStreamDescription(); asd.setUri("http://test.de"); AdapterWorkerManagement adapterManagement = new AdapterWorkerManagement(); ...
[FOCAL] public void AdapterWorkerManagement.stopStreamAdapter(AdapterStreamDescription adapterStreamDescription) [CLASS] class AdapterWorkerManagement [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void stopAdapter(AdapterDescription adapterDescription) [EXCEPTIONS] declares Adapt...
/* static context [FOCAL] public void AdapterWorkerManagement.stopStreamAdapter(AdapterStreamDescription adapterStreamDescription) [EXCEPTIONS] declares AdapterException [CALLS-INTERNAL] void stopAdapter(AdapterDescription adapterDescription) */
/* static context [FOCAL] public void AdapterWorkerManagement.stopStreamAdapter(AdapterStreamDescription adapterStreamDescription) [EXCEPTIONS] declares AdapterException [CALLS-INTERNAL] void stopAdapter(AdapterDescription adapterDescription) */ class AdapterWorkerManagement { public void stopStreamAdapter(Adapter...
true
ok
{"focal": {"class": "AdapterWorkerManagement", "name": "stopStreamAdapter", "signature": "void stopStreamAdapter(AdapterStreamDescription adapterStreamDescription) throws AdapterException", "start_line": 3, "modifiers": "public", "params": [{"name": "adapterStreamDescription", "type": "AdapterStreamDescription"}], "ret...
130709430_86
class ExpectedLevelResolver implements Function<LogDefinition, LogLevel> { @Override public LogLevel apply(LogDefinition definition) { return min(definition.getLevel(), definition.getIfEnabledLevel()); } public static ExpectedLevelResolver getInstance(); private LogLevel min(LogLevel level...
// given LogDefinition definition = givenLogDefinition(ERROR, WARN); // when LogLevel level = expectedLevelResolver.apply(definition); // then assertThat(level, is(WARN)); } }
[FOCAL] @Override public LogLevel ExpectedLevelResolver.apply(LogDefinition definition) [CLASS] class ExpectedLevelResolver implements Function<LogDefinition, LogLevel> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] LogLevel min(LogLevel level1, LogLevel level2) [CALLS-EXTERNAL] L...
/* static context [FOCAL] @Override public LogLevel ExpectedLevelResolver.apply(LogDefinition definition) [INPUTS] branches=- | result=definition [COLLABORATORS] param definition:LogDefinition getLevel/0,getIfEnabledLevel/0 [CALLS-INTERNAL] LogLevel min(LogLevel level1, LogLevel level2) [CALLS-EXTERNAL] LogDefinition.g...
/* static context [FOCAL] @Override public LogLevel ExpectedLevelResolver.apply(LogDefinition definition) [INPUTS] branches=- | result=definition [COLLABORATORS] param definition:LogDefinition getLevel/0,getIfEnabledLevel/0 [CALLS-INTERNAL] LogLevel min(LogLevel level1, LogLevel level2) [CALLS-EXTERNAL] LogDefinition.g...
true
ok
{"focal": {"class": "ExpectedLevelResolver", "name": "apply", "signature": "LogLevel apply(LogDefinition definition)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "definition", "type": "LogDefinition"}], "return_type": "LogLevel"}, "class_info": {"name": "ExpectedLevelResolver", "kind": "class...
130728684_27
class CredHubCredentialsGenerator implements CredentialGenerator { @Override public Mono<Void> deleteString(String applicationId, String serviceInstanceId, String descriptor) { return credHubOperations.credentials() .deleteByName(new SimpleCredentialName(applicationId, serviceInstanceId, descriptor)); } publ...
given(this.credHubOperations.credentials()) .willReturn(credHubCredentialOperations); given(this.credHubCredentialOperations.deleteByName(any())) .willReturn(Mono.empty()); StepVerifier.create(generator.deleteString("foo", "bar", "hello")) .verifyComplete(); verify(credHubCredentialOperations).delet...
[FOCAL] @Override public Mono<Void> CredHubCredentialsGenerator.deleteString(String applicationId, String serviceInstanceId, String descriptor) [CLASS] class CredHubCredentialsGenerator implements CredentialGenerator [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] credHubOperations...
/* static context [FOCAL] @Override public Mono<Void> CredHubCredentialsGenerator.deleteString(String applicationId, String serviceInstanceId, String descriptor) [INPUTS] branches=- | result=applicationId, descriptor, serviceInstanceId, credHubOperations [COLLABORATORS] field credHubOperations:ReactiveCredHubOperations...
/* static context [FOCAL] @Override public Mono<Void> CredHubCredentialsGenerator.deleteString(String applicationId, String serviceInstanceId, String descriptor) [INPUTS] branches=- | result=applicationId, descriptor, serviceInstanceId, credHubOperations [COLLABORATORS] field credHubOperations:ReactiveCredHubOperations...
true
ok
{"focal": {"class": "CredHubCredentialsGenerator", "name": "deleteString", "signature": "Mono<Void> deleteString(String applicationId, String serviceInstanceId, String descriptor)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "applicationId", "type": "String"}, {"name": "serviceInstanceId", "t...
130898702_15
class HelmPathUtils { public String filename(final TokenMatcher.State state) { return match(state, "filename"); } public String contentFilePath(final TokenMatcher.State state); public String extension(final TokenMatcher.State state); private String match(final TokenMatcher.State state, final String name...
Map<String, String> map = new HashMap<>(); map.put("filename", FILENAME); when(state.getTokens()).thenReturn(map); String result = underTest.filename(state); assertThat(result, is(equalTo(FILENAME))); } }
[FOCAL] public String HelmPathUtils.filename(TokenMatcher.State state) [CLASS] class HelmPathUtils [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String match(TokenMatcher.State state, String name) [INPUTS] branches=- | result=state [DATAFLOW] state@param->L2 [CLASS-MEMBERS] Strin...
/* static context [FOCAL] public String HelmPathUtils.filename(TokenMatcher.State state) [INPUTS] branches=- | result=state [CALLS-INTERNAL] String match(TokenMatcher.State state, String name) */
/* static context [FOCAL] public String HelmPathUtils.filename(TokenMatcher.State state) [INPUTS] branches=- | result=state [CALLS-INTERNAL] String match(TokenMatcher.State state, String name) */ class HelmPathUtils { public String filename(final TokenMatcher.State state) { return match(state, "filename"); } ...
true
ok
{"focal": {"class": "HelmPathUtils", "name": "filename", "signature": "String filename(TokenMatcher.State state)", "start_line": 3, "modifiers": "public", "params": [{"name": "state", "type": "TokenMatcher.State"}], "return_type": "String"}, "class_info": {"name": "HelmPathUtils", "kind": "class", "modifiers": "", "sup...
130912988_0
class Query { public Expression getExpression() { return expression; } public Query(); public Query(Expression expression); public Query purge(); public void setExpression(Expression expression); public int getSkip(); public Query skip(int skip); public int getLimit(); ...
//Should handle multiple spaces properly final var searchQuery = parse("hi my name is ryan"); assertThat(searchQuery.getExpression()) .asInstanceOf(type(SearchQuery.class)) .extracting(SearchQuery::getTerm) .isEqualTo("hi my name is ryan"...
[FOCAL] public Expression Query.getExpression() [CLASS] class Query [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Query(); Query(Expression expression); Query purge(); void setExpression(Expression expression); int getSkip(); Query skip(int skip); int getLimit(); Query limit(int l...
/* static context [FOCAL] public Expression Query.getExpression() */
/* static context [FOCAL] public Expression Query.getExpression() */ class Query { public Expression getExpression() { return expression; } public Query(); public Query(Expression expression); public Query purge(); public void setExpression(Expression expression); public int get...
true
ok
{"focal": {"class": "Query", "name": "getExpression", "signature": "Expression getExpression()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Expression"}, "class_info": {"name": "Query", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "objectMapper...
131008831_23
class NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod /** * @param timeout value of 0 results in no timeout */ public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, ...
RCTDeviceEventEmitter emitter = mock(RCTDeviceEventEmitter.class); ReactApplicationContext context = mock(ReactApplicationContext.class); when(context.getJSModule(any(Class.class))).thenReturn(emitter); OkHttpClient httpClient = mock(OkHttpClient.class); when(httpClient.newCall(any(Request.class)))...
[FOCAL] @ReactMethod /** * @param timeout value of 0 results in no timeout */ public void NetworkingModule.sendRequest(String method, String url, int requestId, ReadableArray headers, ReadableMap data, String responseType, boolean useIncrementalUpdates, int timeout, boolean withCredentials) [CLASS] class NetworkingModu...
class NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod /** * @param timeout value of 0 results in no timeout */ public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, ...
false
ok
{"focal": {"class": "NetworkingModule", "name": "sendRequest", "signature": "void sendRequest(String method, String url, int requestId, ReadableArray headers, ReadableMap data, String responseType, boolean useIncrementalUpdates, int timeout, boolean withCredentials)", "start_line": 3, "modifiers": "@ReactMethod /** * @...
131024664_16
class ThresholdFactory { public static ThresholdSha256Condition constructMOfNCondition( final int thresholdM, int numSubCondtionsN, final List<Condition> subconditions ) { Objects.requireNonNull(subconditions, "subconditions must not be null!"); if (thresholdM < 0) { throw new IllegalArgumentE...
try { ThresholdFactory.constructMOfNCondition(1, 2, null); } catch (NullPointerException e) { assertThat(e.getMessage(), is("subconditions must not be null!")); throw e; } } }
[FOCAL] public static ThresholdSha256Condition ThresholdFactory.constructMOfNCondition(int thresholdM, int numSubCondtionsN, List<Condition> subconditions) [CLASS] class ThresholdFactory [METRICS] loc=15 cc=3 branches=2 loops=0 returns=1 throws=2 nesting=1 [CALLS-EXTERNAL] Objects.requireNonNull/2, List<Condition>.size...
/* static context [FOCAL] public static ThresholdSha256Condition ThresholdFactory.constructMOfNCondition(int thresholdM, int numSubCondtionsN, List<Condition> subconditions) [THROWS-WHEN] IllegalArgumentException when thresholdM < 0 [THROWS-WHEN] IllegalArgumentException when !(thresholdM < 0) && subconditions.size() !...
/* static context [FOCAL] public static ThresholdSha256Condition ThresholdFactory.constructMOfNCondition(int thresholdM, int numSubCondtionsN, List<Condition> subconditions) [THROWS-WHEN] IllegalArgumentException when thresholdM < 0 [THROWS-WHEN] IllegalArgumentException when !(thresholdM < 0) && subconditions.size() !...
true
ok
{"focal": {"class": "ThresholdFactory", "name": "constructMOfNCondition", "signature": "ThresholdSha256Condition constructMOfNCondition(int thresholdM, int numSubCondtionsN, List<Condition> subconditions)", "start_line": 3, "modifiers": "public static", "params": [{"name": "thresholdM", "type": "int"}, {"name": "numSub...
131061409_9
class Position implements Comparable<Position> { public static Position of(String contig, int pos, ImmutableMap<String, Integer> contigs) { return new AutoValue_Position(contig, pos, contigs); } public static ImmutableList<Position> fromFile(Path file); public static ImmutableList<Position> fromFile(Path ...
ImmutableMap<String, Integer> contigs = ImmutableMap.of("chr1", 0, "chr10", 1, "chr11", 2); assertThrows(NullPointerException.class, () -> Position.of(null, 0, contigs)); assertThrows(NullPointerException.class, () -> Position.of("chr1", 0, null)); } }
[FOCAL] public static Position Position.of(String contig, int pos, ImmutableMap<String, Integer> contigs) [CLASS] class Position implements Comparable<Position> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] AutoValue_Position [INPUTS] branches=- | result=contig, contigs, pos [DATAFLOW] cont...
/* static context [FOCAL] public static Position Position.of(String contig, int pos, ImmutableMap<String, Integer> contigs) [INPUTS] branches=- | result=contig, contigs, pos [NEW] AutoValue_Position */
/* static context [FOCAL] public static Position Position.of(String contig, int pos, ImmutableMap<String, Integer> contigs) [INPUTS] branches=- | result=contig, contigs, pos [NEW] AutoValue_Position */ class Position implements Comparable<Position> { public static Position of(String contig, int pos, ImmutableMap<Str...
true
ok
{"focal": {"class": "Position", "name": "of", "signature": "Position of(String contig, int pos, ImmutableMap<String, Integer> contigs)", "start_line": 3, "modifiers": "public static", "params": [{"name": "contig", "type": "String"}, {"name": "pos", "type": "int"}, {"name": "contigs", "type": "ImmutableMap<String, Integ...
131105127_23
class RandomGen implements FieldDataProvider<Object, GENERATED_INSTANCE> { public GENERATED_INSTANCE generate() { return generate(null); } private RandomGen( InstanceProvider<GENERATED_INSTANCE> pInstanceProvider, Map<String, FieldDataProvider<GENERATED_INSTANCE, ?>> pDataProviders, List<OnGenerateCallbac...
// Given LoremIpsumFieldDataProvider<TestPerson> loremIpsumFieldDataProvider = mock(LoremIpsumFieldDataProvider.class); given(mFactory.getLoremIpsumFieldDataProvider(20, 22)).willReturn(loremIpsumFieldDataProvider); final String EXPECTED_VALUE = "Lorem ipsum and stuff"; given(loremIpsumFieldDataProvider.gener...
[FOCAL] public GENERATED_INSTANCE RandomGen.generate() [CLASS] class RandomGen implements FieldDataProvider<Object, GENERATED_INSTANCE> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] GENERATED_INSTANCE generate(Object unused) [CLASS-MEMBERS] RandomGen(InstanceProvider<GENERATED_IN...
/* static context [FOCAL] public GENERATED_INSTANCE RandomGen.generate() [CALLS-INTERNAL] GENERATED_INSTANCE generate(Object unused) */
/* static context [FOCAL] public GENERATED_INSTANCE RandomGen.generate() [CALLS-INTERNAL] GENERATED_INSTANCE generate(Object unused) */ class RandomGen implements FieldDataProvider<Object, GENERATED_INSTANCE> { public GENERATED_INSTANCE generate() { return generate(null); } private RandomGen( InstanceProvider...
true
ok
{"focal": {"class": "RandomGen", "name": "generate", "signature": "GENERATED_INSTANCE generate()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "GENERATED_INSTANCE"}, "class_info": {"name": "RandomGen", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "FieldDataProvider<Object...
131139519_0
class Env extends NativeObject implements Closeable { public Stat stat() { MDBX_stat rc = new MDBX_stat(); mdbx_env_stat(pointer(), rc, JNI.SIZEOF_STAT); return new Stat(rc); } public Env(String path); public Env(); public static String version(); private static long create(); public void open(String ...
String path = tmp.newFolder().getCanonicalPath(); try (Env env = new Env()) { env.open(path); env.setMapSize(1048576L); try (Database db = env.openDatabase()) { db.put(new byte[]{1}, new byte[]{1}); db.put(new byte[]{2}, new byte[]{1}); Stat stat = env.stat(); S...
[FOCAL] public Stat Env.stat() [CLASS] class Env extends NativeObject implements Closeable [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] mdbx_env_stat/3 (inherited), pointer/0 (inherited) [NEW] MDBX_stat, Stat [DATAFLOW] rc@L2->L3,L4 [CLASS-MEMBERS] Env(String path); Env(); Strin...
/* static context [FOCAL] public Stat Env.stat() [NEW] MDBX_stat, Stat [CALLS-EXTERNAL] mdbx_env_stat/3 (inherited), pointer/0 (inherited) */
/* static context [FOCAL] public Stat Env.stat() [NEW] MDBX_stat, Stat [CALLS-EXTERNAL] mdbx_env_stat/3 (inherited), pointer/0 (inherited) */ class Env extends NativeObject implements Closeable { public Stat stat() { MDBX_stat rc = new MDBX_stat(); mdbx_env_stat(pointer(), rc, JNI.SIZEOF_STAT); return new Stat(...
true
ok
{"focal": {"class": "Env", "name": "stat", "signature": "Stat stat()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Stat"}, "class_info": {"name": "Env", "kind": "class", "modifiers": "", "superclass": "NativeObject", "interfaces": "Closeable", "fields": [{"name": "tmp", "type": "TemporaryFolde...
131246500_63
class UZExceptionUtil { public static UZException getExceptionPlayback(String msg) { Exception exception = new Exception(UZException.ERR_24 + " " + msg); UZException uzException = new UZException(); uzException.setErrorCode(UZException.ERR_CODE_24); uzException.setException(exceptio...
String testMessage = "Test Message"; UZException testException = UZExceptionUtil.getExceptionPlayback(testMessage); assertNotNull(testException); assertNotNull(testException.getMessage()); assertNotNull(testException.getException()); assertEquals(testException.getErrorCod...
[FOCAL] public static UZException UZExceptionUtil.getExceptionPlayback(String msg) [CLASS] class UZExceptionUtil [METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] UZException.setErrorCode/1, UZException.setException/1 [NEW] Exception, UZException [DATAFLOW] exception@L2->L5; msg@para...
/* static context [FOCAL] public static UZException UZExceptionUtil.getExceptionPlayback(String msg) [NEW] Exception, UZException [CALLS-EXTERNAL] UZException.setErrorCode/1, UZException.setException/1 */
/* static context [FOCAL] public static UZException UZExceptionUtil.getExceptionPlayback(String msg) [NEW] Exception, UZException [CALLS-EXTERNAL] UZException.setErrorCode/1, UZException.setException/1 */ class UZExceptionUtil { public static UZException getExceptionPlayback(String msg) { Exception excepti...
true
ok
{"focal": {"class": "UZExceptionUtil", "name": "getExceptionPlayback", "signature": "UZException getExceptionPlayback(String msg)", "start_line": 3, "modifiers": "public static", "params": [{"name": "msg", "type": "String"}], "return_type": "UZException"}, "class_info": {"name": "UZExceptionUtil", "kind": "class", "mod...
131336637_12
class ExpressionParser { VariableNode variableNode() { consume("${"); char c = 0; StringBuilder varName = new StringBuilder(); Expression defaultExpr = null; LOOP: while ((c = la()) >= 0) { switch (c) { case 0: throw...
VariableNode node = new ExpressionParser("${my.var:tacos${my.other.var:42}}").variableNode(); Assertions.assertThat(node).isNotNull(); Assertions.assertThat(node.getVariableName()).isEqualTo("my.var"); Expression defaultExpr1 = node.getDefaultExpression(); assertThat(defaultExpr...
[FOCAL] VariableNode ExpressionParser.variableNode() [CLASS] class ExpressionParser [METRICS] loc=28 cc=5 branches=1 loops=1 returns=1 throws=1 nesting=2 [CALLS-INTERNAL] Expression expression(boolean isSubExpression); char la(); void consume(String expected) [CALLS-EXTERNAL] StringBuilder.append/1, StringBuilder.toStr...
/* static context [FOCAL] VariableNode ExpressionParser.variableNode() [THROWS-WHEN] IllegalArgumentException when (c = la()) >= 0 && switch(c)=case 0 [PATH1] while((c = la()) >= 0)=T -> switch(c)=case ':' -> exit loop -> return new VariableNode(varName.toString(), defaultExpr) [PATH2] while((c = la()) >= 0)=T -> switc...
/* static context [FOCAL] VariableNode ExpressionParser.variableNode() [THROWS-WHEN] IllegalArgumentException when (c = la()) >= 0 && switch(c)=case 0 [PATH1] while((c = la()) >= 0)=T -> switch(c)=case ':' -> exit loop -> return new VariableNode(varName.toString(), defaultExpr) [PATH2] while((c = la()) >= 0)=T -> switc...
true
ok
{"focal": {"class": "ExpressionParser", "name": "variableNode", "signature": "VariableNode variableNode()", "start_line": 3, "modifiers": "", "params": [], "return_type": "VariableNode"}, "class_info": {"name": "ExpressionParser", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "...
131477673_6
class ServerConfiguration { @Bean public Server server(){ Server server = new Server(); if(server.getPort()==0){ int nonSecurePort = Integer.valueOf(propertyResolver.getProperty("server.port", propertyResolver.getProperty("port", "8080"))); server.setPort(nonSecurePort)...
assertNotNull(server); assertEquals(8092,server.getPort()); assertEquals(10,server.getHeartTime()); assertEquals(1000,server.getMaxCount()); assertEquals("127.0.0.1",server.getIp()); assertEquals("dev",server.getTag()); assertEquals("redisProxy",server.getServiceI...
[FOCAL] @Bean public Server ServerConfiguration.server() [CLASS] class ServerConfiguration [METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] Server.getPort/0, Integer.valueOf/1, propertyResolver.getProperty/2, Server.setPort/1 [NEW] Server [PATH1] if(server.getPort()==0)=T -> return ...
/* static context [FOCAL] @Bean public Server ServerConfiguration.server() [PATH1] if(server.getPort()==0)=T -> return server [PATH2] if(server.getPort()==0)=F -> return server [COLLABORATORS] field propertyResolver getProperty/2 [NEW] Server [CALLS-EXTERNAL] Server.getPort/0, Integer.valueOf/1, propertyResolver.getPro...
/* static context [FOCAL] @Bean public Server ServerConfiguration.server() [PATH1] if(server.getPort()==0)=T -> return server [PATH2] if(server.getPort()==0)=F -> return server [COLLABORATORS] field propertyResolver getProperty/2 [NEW] Server [CALLS-EXTERNAL] Server.getPort/0, Integer.valueOf/1, propertyResolver.getPro...
true
ok
{"focal": {"class": "ServerConfiguration", "name": "server", "signature": "Server server()", "start_line": 3, "modifiers": "@Bean public", "params": [], "return_type": "Server"}, "class_info": {"name": "ServerConfiguration", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "...
131537435_0
class DisjointSet { protected R find(R e) { R parent = matches.get(e); if (parent == null) { return null; } if (!parent.equals(e)) { R tmp = find(parent); if (!parent.equals(tmp)) { parent = tmp; matches.put(e, par...
Integer root1 = ds.find(0); Integer root2 = ds.find(1); assertNotEquals(root1, root2); for (int i = 0; i < 10; i++) { assertEquals((i % 2) == 0 ? root1 : root2, ds.find(i)); } } }
[FOCAL] protected R DisjointSet.find(R e) [CLASS] class DisjointSet [METRICS] loc=15 cc=4 branches=3 loops=0 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] matches.get/1, R.equals/1, find/1 (inherited), matches.put/2 [PATH1] if(parent == null)=F -> if(!parent.equals(e))=T -> if(!parent.equals(tmp))=T -> return parent [P...
/* static context [FOCAL] protected R DisjointSet.find(R e) [PATH1] if(parent == null)=F -> if(!parent.equals(e))=T -> if(!parent.equals(tmp))=T -> return parent [PATH2] if(parent == null)=T -> return null [PATH3] if(parent == null)=F -> if(!parent.equals(e))=F -> return parent [PATH4] if(parent == null)=F -> if(!paren...
/* static context [FOCAL] protected R DisjointSet.find(R e) [PATH1] if(parent == null)=F -> if(!parent.equals(e))=T -> if(!parent.equals(tmp))=T -> return parent [PATH2] if(parent == null)=T -> return null [PATH3] if(parent == null)=F -> if(!parent.equals(e))=F -> return parent [PATH4] if(parent == null)=F -> if(!paren...
true
ok
{"focal": {"class": "DisjointSet", "name": "find", "signature": "R find(R e)", "start_line": 3, "modifiers": "protected", "params": [{"name": "e", "type": "R"}], "return_type": "R"}, "class_info": {"name": "DisjointSet", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "ds",...
131561161_1
class AkkaEngineProvider implements ReactiveStreamsEngine { public static AkkaEngine provider() { AkkaEngine engine = null; // Double checked locking to initialize the weak reference the first time this method // is invoked. if (cachedEngine == null) { synchronized (mutex) { if (cached...
AkkaEngine engine = AkkaEngineProvider.provider(); ActorSystem system = ((ActorMaterializer) engine.materializer).system(); Publisher<Done> publisher = Source.tick( Duration.create(100, TimeUnit.MILLISECONDS), Duration.create(100, TimeUnit.MILLISECONDS), Done.get...
[FOCAL] public static AkkaEngine AkkaEngineProvider.provider() [CLASS] class AkkaEngineProvider implements ReactiveStreamsEngine [METRICS] loc=32 cc=6 branches=5 loops=0 returns=1 throws=0 nesting=4 [CALLS-INTERNAL] AkkaEngine createEngine() [CALLS-EXTERNAL] cachedEngine.get/0 [NEW] WeakReference<> [PATH1] if(cachedEng...
/* static context [FOCAL] public static AkkaEngine AkkaEngineProvider.provider() [PATH1] if(cachedEngine == null)#1=T -> if(cachedEngine == null)#2=T -> if(engine == null)#1=T -> if(engine == null)#2=T -> if(engine == null)#3=T -> return engine [PATH2] if(cachedEngine == null)#1=F -> if(engine == null)#1=F -> return en...
/* static context [FOCAL] public static AkkaEngine AkkaEngineProvider.provider() [PATH1] if(cachedEngine == null)#1=T -> if(cachedEngine == null)#2=T -> if(engine == null)#1=T -> if(engine == null)#2=T -> if(engine == null)#3=T -> return engine [PATH2] if(cachedEngine == null)#1=F -> if(engine == null)#1=F -> return en...
true
ok
{"focal": {"class": "AkkaEngineProvider", "name": "provider", "signature": "AkkaEngine provider()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "AkkaEngine"}, "class_info": {"name": "AkkaEngineProvider", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "ReactiveStreams...
131745127_9
class Time { public static LocalDate parseDate(String date) { if (date == null) { throw new IllegalArgumentException("Date must not be null."); } String datePattern = "[0-3]?[0-9]-[0-1]?[0-9]-[1-2][0-9]{3}"; if (!date.matches(datePattern)) { throw ne...
String date = "27-07-2000"; LocalDate parsedDate = Time.parseDate(date); assertEquals("Failed to parse year from date", 2000, parsedDate.getYear()); assertEquals("Failed to parse month from date", 7, parsedDate.getMonth().getValue()); assertEquals("Failed to parse day from date...
[FOCAL] public static LocalDate Time.parseDate(String date) [CLASS] class Time [METRICS] loc=12 cc=3 branches=2 loops=0 returns=1 throws=2 nesting=1 [CALLS-EXTERNAL] String.matches/1, LocalDate.parse/2 [NEW] IllegalArgumentException [EXCEPTIONS] throws IllegalArgumentException [THROWS-WHEN] IllegalArgumentException whe...
/* static context [FOCAL] public static LocalDate Time.parseDate(String date) [THROWS-WHEN] IllegalArgumentException when date == null [THROWS-WHEN] IllegalArgumentException when !(date == null) && !date.matches(datePattern) [PATH1] if(date == null)=F -> if(!date.matches(datePattern))=T -> throw new IllegalArgumentExce...
/* static context [FOCAL] public static LocalDate Time.parseDate(String date) [THROWS-WHEN] IllegalArgumentException when date == null [THROWS-WHEN] IllegalArgumentException when !(date == null) && !date.matches(datePattern) [PATH1] if(date == null)=F -> if(!date.matches(datePattern))=T -> throw new IllegalArgumentExce...
true
ok
{"focal": {"class": "Time", "name": "parseDate", "signature": "LocalDate parseDate(String date)", "start_line": 3, "modifiers": "public static", "params": [{"name": "date", "type": "String"}], "return_type": "LocalDate"}, "class_info": {"name": "Time", "kind": "class", "modifiers": "", "superclass": null, "interfaces":...
131759992_13
class AsyncTrampoline { public static <T> CompletionStage<T> asyncWhile( final Predicate<? super T> shouldContinue, final Function<? super T, ? extends CompletionStage<T>> fn, final T initialValue) { return TrampolineInternal.trampoline(shouldContinue, fn, initialValue); } private AsyncTr...
Assert.assertEquals( AsyncTrampoline.<Integer>asyncWhile( i -> i != null && i < 10, i -> { Integer next; if (i == null) { next = 5; } else if (i == 4) { next = null; } else { next ...
[FOCAL] public static CompletionStage<T> AsyncTrampoline.asyncWhile(Predicate<? super T> shouldContinue, Function<? super T, ? extends CompletionStage<T>> fn, T initialValue) [CLASS] class AsyncTrampoline [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] TrampolineInternal.trampoline...
/* static context [FOCAL] public static CompletionStage<T> AsyncTrampoline.asyncWhile(Predicate<? super T> shouldContinue, Function<? super T, ? extends CompletionStage<T>> fn, T initialValue) [INPUTS] branches=- | result=fn, initialValue, shouldContinue [CALLS-EXTERNAL] TrampolineInternal.trampoline/3 */
/* static context [FOCAL] public static CompletionStage<T> AsyncTrampoline.asyncWhile(Predicate<? super T> shouldContinue, Function<? super T, ? extends CompletionStage<T>> fn, T initialValue) [INPUTS] branches=- | result=fn, initialValue, shouldContinue [CALLS-EXTERNAL] TrampolineInternal.trampoline/3 */ class AsyncTr...
true
ok
{"focal": {"class": "AsyncTrampoline", "name": "asyncWhile", "signature": "CompletionStage<T> asyncWhile(Predicate<? super T> shouldContinue, Function<? super T, ? extends CompletionStage<T>> fn, T initialValue)", "start_line": 3, "modifiers": "public static", "params": [{"name": "shouldContinue", "type": "Predicate<? ...
131884789_3
class Race { public static void start(Context context, String[] urls, Listener listener) { Prober prober = new GoProber(context); start(prober, urls, listener); } static void start(Prober prober, String[] urls, Listener listener); } class RaceTest { @Test public void HalfFail() throws Exception {...
final int N = 7; String[] urls = new String[N]; for (int i = 0; i < N; ++i) { urls[i] = String.format("%d", i); } Semaphore done = new Semaphore(0); Race.start(new HalfProber(), urls, (int index) -> { assertTrue(index >= 0); assertTrue(index < N); // Only the even-numbere...
[FOCAL] public static void Race.start(Context context, String[] urls, Listener listener) [CLASS] class Race [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void start(Prober prober, String[] urls, Listener listener) [NEW] GoProber [DATAFLOW] context@param->L2; listener@param->L3; p...
/* static context [FOCAL] public static void Race.start(Context context, String[] urls, Listener listener) [CALLS-INTERNAL] void start(Prober prober, String[] urls, Listener listener) [NEW] GoProber */
/* static context [FOCAL] public static void Race.start(Context context, String[] urls, Listener listener) [CALLS-INTERNAL] void start(Prober prober, String[] urls, Listener listener) [NEW] GoProber */ class Race { public static void start(Context context, String[] urls, Listener listener) { Prober prober = new ...
true
ok
{"focal": {"class": "Race", "name": "start", "signature": "void start(Context context, String[] urls, Listener listener)", "start_line": 3, "modifiers": "public static", "params": [{"name": "context", "type": "Context"}, {"name": "urls", "type": "String[]"}, {"name": "listener", "type": "Listener"}], "return_type": "vo...
131964676_7
class FileSelectorArrayRow extends JPanel { public static File fallback(File currentDir){ while(!currentDir.exists() && currentDir.getParentFile() != null){ currentDir = currentDir.getParentFile(); } return currentDir; } FileSelectorArrayRow(FileSelectorArrayPanel pa...
final File inputNormal = new File(Directories.getPluginDirectory()); final File inputNormal2 = new File("/sys/kernel"); final File inputNoParent = new File("/"); final File inputNoParentOver = new File("/sys"); final File inputNonExistent = new File(Directories.getXdgJrdBaseDir()...
[FOCAL] public static File FileSelectorArrayRow.fallback(File currentDir) [CLASS] class FileSelectorArrayRow extends JPanel [METRICS] loc=7 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] File.exists/0, File.getParentFile/0 [PATH1] while(!currentDir.exists() && currentDir.getParentFile() != null)=...
/* static context [FOCAL] public static File FileSelectorArrayRow.fallback(File currentDir) [PATH1] while(!currentDir.exists() && currentDir.getParentFile() != null)=T -> exit loop -> return currentDir [PATH2] while(!currentDir.exists() && currentDir.getParentFile() != null)=F -> return currentDir [INPUTS] branches=cur...
/* static context [FOCAL] public static File FileSelectorArrayRow.fallback(File currentDir) [PATH1] while(!currentDir.exists() && currentDir.getParentFile() != null)=T -> exit loop -> return currentDir [PATH2] while(!currentDir.exists() && currentDir.getParentFile() != null)=F -> return currentDir [INPUTS] branches=cur...
true
ok
{"focal": {"class": "FileSelectorArrayRow", "name": "fallback", "signature": "File fallback(File currentDir)", "start_line": 3, "modifiers": "public static", "params": [{"name": "currentDir", "type": "File"}], "return_type": "File"}, "class_info": {"name": "FileSelectorArrayRow", "kind": "class", "modifiers": "", "supe...
132126497_30
class AttributeValidator extends BaseValidator { @Override public ValidationResults validate(Rule rule) { ValidationResults results = new ValidationResults(); checkEmptyOrNullNames(rule, results); checkName(rule, results); checkUniquenessOfAttributes(rule, results); chec...
// given Rule rule = new Rule(new LinkedHashSet<>(Arrays.asList( new Attribute("ruleName", String.class, "ruleName"), new Attribute("startDate", ZonedDateTime.class, ZonedDateTime.parse("2012-01-05T00:00:00+12:34")) )), Collections.emptyList(), null, Collections.e...
[FOCAL] @Override public ValidationResults AttributeValidator.validate(Rule rule) [CLASS] class AttributeValidator extends BaseValidator [METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] void checkDates(Rule rule, ValidationResults results); void checkEmptyOrNullNames(Rule rule, Vali...
/* static context [FOCAL] @Override public ValidationResults AttributeValidator.validate(Rule rule) [CALLS-INTERNAL] void checkDates(Rule rule, ValidationResults results); void checkEmptyOrNullNames(Rule rule, ValidationResults results); void checkName(Rule rule, ValidationResults results); void checkUniquenessOfAttrib...
/* static context [FOCAL] @Override public ValidationResults AttributeValidator.validate(Rule rule) [CALLS-INTERNAL] void checkDates(Rule rule, ValidationResults results); void checkEmptyOrNullNames(Rule rule, ValidationResults results); void checkName(Rule rule, ValidationResults results); void checkUniquenessOfAttrib...
true
ok
{"focal": {"class": "AttributeValidator", "name": "validate", "signature": "ValidationResults validate(Rule rule)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "rule", "type": "Rule"}], "return_type": "ValidationResults"}, "class_info": {"name": "AttributeValidator", "kind": "class", "modifier...
132161673_0
class KafkaComputerLauncher extends ComputerLauncher { public void setEnableSSL(boolean enableSSL) { this.enableSSL = enableSSL; } public KafkaComputerLauncher(); public KafkaComputerLauncher(String kafkaUsername, String sslTruststoreLocation, String sslKeystoreLocation); @DataBoundConst...
GlobalKafkaConfiguration g = GlobalKafkaConfiguration.get(); String kafkaURL = kafka.getBootstrapServers().split("//")[1]; String zookeeperURL = kafka.getContainerIpAddress() + ":" + kafka.getMappedPort(2181); g.setBrokerURL(kafkaURL); g.setZookeeperURL(zookeeperURL); g.s...
[FOCAL] public void KafkaComputerLauncher.setEnableSSL(boolean enableSSL) [CLASS] class KafkaComputerLauncher extends ComputerLauncher [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [FIELDS] write=enableSSL [STATE] enableSSL via getEnableSSL() [DATAFLOW] enableSSL@param->L2 [CLASS-MEMBERS] KafkaCo...
/* static context [FOCAL] public void KafkaComputerLauncher.setEnableSSL(boolean enableSSL) [STATE] enableSSL via getEnableSSL() [FIELDS] write=enableSSL */
/* static context [FOCAL] public void KafkaComputerLauncher.setEnableSSL(boolean enableSSL) [STATE] enableSSL via getEnableSSL() [FIELDS] write=enableSSL */ class KafkaComputerLauncher extends ComputerLauncher { public void setEnableSSL(boolean enableSSL) { this.enableSSL = enableSSL; } public Ka...
true
ok
{"focal": {"class": "KafkaComputerLauncher", "name": "setEnableSSL", "signature": "void setEnableSSL(boolean enableSSL)", "start_line": 3, "modifiers": "public", "params": [{"name": "enableSSL", "type": "boolean"}], "return_type": "void"}, "class_info": {"name": "KafkaComputerLauncher", "kind": "class", "modifiers": ""...
132241610_0
class App implements RequestHandler<Object, Object> { public Object handleRequest(final Object input, final Context context) { Map<String, String> headers = new HashMap<>(); headers.put("Content-Type", "application/json"); headers.put("X-Custom-Header", "application/json"); try { ...
App app = new App(); GatewayResponse result = (GatewayResponse) app.handleRequest(null, null); assertEquals(result.getStatusCode(), 200); assertEquals(result.getHeaders().get("Content-Type"), "application/json"); String content = result.getBody(); assertNotNull(content); ...
[FOCAL] public Object App.handleRequest(Object input, Context context) [CLASS] class App implements RequestHandler<Object, Object> [METRICS] loc=12 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] String getPageContents(String address) [CALLS-EXTERNAL] Map<String, String>.put/2, String.format/2 [NE...
/* static context [FOCAL] public Object App.handleRequest(Object input, Context context) [PATH1] try-body throws -> return new GatewayResponse("{}", headers, 500) [PATH2] return new GatewayResponse(output, headers, 200) [INPUTS] branches=- | result=- | unused=input, context [EXCEPTIONS] catches IOException e [CALLS-INT...
/* static context [FOCAL] public Object App.handleRequest(Object input, Context context) [PATH1] try-body throws -> return new GatewayResponse("{}", headers, 500) [PATH2] return new GatewayResponse(output, headers, 200) [INPUTS] branches=- | result=- | unused=input, context [EXCEPTIONS] catches IOException e [CALLS-INT...
true
ok
{"focal": {"class": "App", "name": "handleRequest", "signature": "Object handleRequest(Object input, Context context)", "start_line": 3, "modifiers": "public", "params": [{"name": "input", "type": "Object"}, {"name": "context", "type": "Context"}], "return_type": "Object"}, "class_info": {"name": "App", "kind": "class"...
132370832_55
class UnitQueryWithinUnittype { public static boolean match( String fixedOp, String varOp, Parameter.Operator op, Parameter.ParameterDataType type) { // If fixedOp == null, varOp can match only if null and operator is EQ, or the opposite. if (fixedOp == null) { return (Parameter.Operator.EQ.equal...
// Given: final String fixedOp = "1"; final String varOp = "2"; final Parameter.Operator op = Parameter.Operator.LT; final Parameter.ParameterDataType dataType = Parameter.ParameterDataType.NUMBER; // When: boolean match = UnitQueryWithinUnittype.match(fixedOp, varOp, op, dataType); //...
[FOCAL] public static boolean UnitQueryWithinUnittype.match(String fixedOp, String varOp, Parameter.Operator op, Parameter.ParameterDataType type) [CLASS] class UnitQueryWithinUnittype [METRICS] loc=51 cc=10 branches=7 loops=0 returns=10 throws=0 nesting=3 [CALLS-INTERNAL] boolean matchWildcardString(String fixedOp, St...
/* static context [FOCAL] public static boolean UnitQueryWithinUnittype.match(String fixedOp, String varOp, Parameter.Operator op, Parameter.ParameterDataType type) [PATH1] if(fixedOp == null)=F -> if(varOp == null)=F -> switch(type)=case TEXT -> if(Parameter.Operator.EQ.equals(op))=F -> if(Parameter.Operator.NE.equals...
/* static context [FOCAL] public static boolean UnitQueryWithinUnittype.match(String fixedOp, String varOp, Parameter.Operator op, Parameter.ParameterDataType type) [PATH1] if(fixedOp == null)=F -> if(varOp == null)=F -> switch(type)=case TEXT -> if(Parameter.Operator.EQ.equals(op))=F -> if(Parameter.Operator.NE.equals...
true
ok
{"focal": {"class": "UnitQueryWithinUnittype", "name": "match", "signature": "boolean match(String fixedOp, String varOp, Parameter.Operator op, Parameter.ParameterDataType type)", "start_line": 3, "modifiers": "public static", "params": [{"name": "fixedOp", "type": "String"}, {"name": "varOp", "type": "String"}, {"nam...
132376292_19
class CloudflareAccessService { public void processAuthRequest(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { try { if(isRequestFilteringDisabled()) { log.debug("Plugin filters are disabled or not configured yet, bypassing auth process"); ...
HttpServletRequest httpRequest = mock(HttpServletRequest.class); when(httpRequest.getHeader(CloudflareToken.CF_ACCESS_JWT_HEADER)).thenReturn(authContext.getValidToken()); when(httpRequest.getRequestURI()).thenReturn(AuthenticationErrorServlet.PATH); HttpServletResponse httpResponse = mock(HttpServletResponse....
[FOCAL] public void CloudflareAccessService.processAuthRequest(HttpServletRequest request, HttpServletResponse response, FilterChain chain) [CLASS] class CloudflareAccessService [METRICS] loc=57 cc=9 branches=7 loops=0 returns=7 throws=0 nesting=2 [CALLS-INTERNAL] CloudflareToken getValidTokenFromRequest(HttpServletReq...
/* static context [FOCAL] public void CloudflareAccessService.processAuthRequest(HttpServletRequest request, HttpServletResponse response, FilterChain chain) [PATH1] if(isRequestFilteringDisabled())=F -> if(isAtlassianFlowEnabled(request))=F -> if(isWhitelisted(request))=F -> if(token.isNotPresent())=F -> if(sessionAlr...
/* static context [FOCAL] public void CloudflareAccessService.processAuthRequest(HttpServletRequest request, HttpServletResponse response, FilterChain chain) [PATH1] if(isRequestFilteringDisabled())=F -> if(isAtlassianFlowEnabled(request))=F -> if(isWhitelisted(request))=F -> if(token.isNotPresent())=F -> if(sessionAlr...
true
ok
{"focal": {"class": "CloudflareAccessService", "name": "processAuthRequest", "signature": "void processAuthRequest(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException", "start_line": 3, "modifiers": "public", "params": [{"name": "request", "type": "HttpServl...
132562896_2
class RefererService { public String buildRedirectUri(String referer, String targetPath) { if(isInvalidTargetPath(targetPath)) { throw new BadTargetPathException("Illegal target_path"); } return UriComponentsBuilder.fromUriString(referer) .replacePath(targetPath...
String redirectUri = refererService.buildRedirectUri("http://my_custom_referer", "/my_custom_path"); assertThat(redirectUri, is(equalTo("http://my_custom_referer/my_custom_path"))); } }
[FOCAL] public String RefererService.buildRedirectUri(String referer, String targetPath) [CLASS] class RefererService [METRICS] loc=10 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] boolean isInvalidTargetPath(String targetPath) [CALLS-EXTERNAL] UriComponentsBuilder.fromUriString(referer) .replac...
/* static context [FOCAL] public String RefererService.buildRedirectUri(String referer, String targetPath) [THROWS-WHEN] BadTargetPathException when isInvalidTargetPath(targetPath) [PATH1] if(isInvalidTargetPath(targetPath))=T -> throw new BadTargetPathException("Illegal target_path") [PATH2] if(isInvalidTargetPath(tar...
/* static context [FOCAL] public String RefererService.buildRedirectUri(String referer, String targetPath) [THROWS-WHEN] BadTargetPathException when isInvalidTargetPath(targetPath) [PATH1] if(isInvalidTargetPath(targetPath))=T -> throw new BadTargetPathException("Illegal target_path") [PATH2] if(isInvalidTargetPath(tar...
true
ok
{"focal": {"class": "RefererService", "name": "buildRedirectUri", "signature": "String buildRedirectUri(String referer, String targetPath)", "start_line": 3, "modifiers": "public", "params": [{"name": "referer", "type": "String"}, {"name": "targetPath", "type": "String"}], "return_type": "String"}, "class_info": {"name...
132573384_9
class SongPublicationService { public void publishSong(final Song song) { songsRepository.storeSong(song); publicationNotifier.onSongPublished(song); } public Optional<Song> getSong(final String songIdentifier); private static final Song SONG; @Mock private SongsRepository son...
songPublicationService.publishSong(SONG); verify(songsRepository).storeSong(SONG); verify(publicationNotifier).onSongPublished(SONG); } }
[FOCAL] public void SongPublicationService.publishSong(Song song) [CLASS] class SongPublicationService [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] SongsRepository.storeSong/1, PublicationNotifier.onSongPublished/1 [FIELDS] read=publicationNotifier:PublicationNotifier, songsRepo...
/* static context [FOCAL] public void SongPublicationService.publishSong(Song song) [COLLABORATORS] field songsRepository:SongsRepository storeSong/1; field publicationNotifier:PublicationNotifier onSongPublished/1 [FIELDS] read=publicationNotifier:PublicationNotifier, songsRepository:SongsRepository [CALLS-EXTERNAL] S...
/* static context [FOCAL] public void SongPublicationService.publishSong(Song song) [COLLABORATORS] field songsRepository:SongsRepository storeSong/1; field publicationNotifier:PublicationNotifier onSongPublished/1 [FIELDS] read=publicationNotifier:PublicationNotifier, songsRepository:SongsRepository [CALLS-EXTERNAL] S...
true
ok
{"focal": {"class": "SongPublicationService", "name": "publishSong", "signature": "void publishSong(Song song)", "start_line": 3, "modifiers": "public", "params": [{"name": "song", "type": "Song"}], "return_type": "void"}, "class_info": {"name": "SongPublicationService", "kind": "class", "modifiers": "", "superclass": ...
132587382_43
class Partner { public static synchronized Partner get(Context context) { if (!sSearched) { PackageManager pm = context.getPackageManager(); final Intent intent = new Intent(ACTION_PARTNER_CUSTOMIZATION); List<ResolveInfo> receivers; if (VERSION.SDK_INT >= VE...
Partner partner = Partner.get(mContext); assertNull("Partner should be null", partner); } }
[FOCAL] public static synchronized Partner Partner.get(Context context) [CLASS] class Partner [METRICS] loc=36 cc=7 branches=4 loops=1 returns=1 throws=0 nesting=4 [CALLS-EXTERNAL] Context.getPackageManager/0, PackageManager.queryBroadcastReceivers/2, PackageManager.getResourcesForApplication/1, Log.w/2 [NEW] Intent, P...
/* static context [FOCAL] public static synchronized Partner Partner.get(Context context) [PATH1] if(!sSearched)=T -> if(VERSION.SDK_INT >= VERSION_CODES.N)=T -> foreach(ResolveInfo info : receivers)=T -> if(info.activityInfo == null)=F -> if((appInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0)=T -> try-body throws -> e...
/* static context [FOCAL] public static synchronized Partner Partner.get(Context context) [PATH1] if(!sSearched)=T -> if(VERSION.SDK_INT >= VERSION_CODES.N)=T -> foreach(ResolveInfo info : receivers)=T -> if(info.activityInfo == null)=F -> if((appInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0)=T -> try-body throws -> e...
true
ok
{"focal": {"class": "Partner", "name": "get", "signature": "Partner get(Context context)", "start_line": 3, "modifiers": "public static synchronized", "params": [{"name": "context", "type": "Context"}], "return_type": "Partner"}, "class_info": {"name": "Partner", "kind": "class", "modifiers": "", "superclass": null, "i...
132600378_21
class CommentUtils { public static boolean isEndMatchWithInlineCommentedCDATA(String trimmedContent) { if (trimmedContent.endsWith(CDATA_SIMPLE_END)) { int offset = trimmedContent.length()- 4; while (trimmedContent.charAt(offset) <= ' ' && trimmedCont...
org.junit.Assert.assertTrue(CommentUtils.isEndMatchWithInlineCommentedCDATA("fkdjslkfjsl //"+CommentUtils.CDATA_SIMPLE_END)); org.junit.Assert.assertTrue(CommentUtils.isEndMatchWithInlineCommentedCDATA("fkdjslkfjsl // "+CommentUtils.CDATA_SIMPLE_END)); org.junit.Assert.assertTrue(CommentUtils.is...
[FOCAL] public static boolean CommentUtils.isEndMatchWithInlineCommentedCDATA(String trimmedContent) [CLASS] class CommentUtils [METRICS] loc=19 cc=4 branches=2 loops=1 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] String.endsWith/1, String.length/0, String.charAt/1, String.startsWith/2 [PATH1] if(trimmedContent.endsWi...
/* static context [FOCAL] public static boolean CommentUtils.isEndMatchWithInlineCommentedCDATA(String trimmedContent) [PATH1] if(trimmedContent.endsWith(CDATA_SIMPLE_END))=T -> while(trimmedContent.charAt(offset) <= ' ' && trimmedContent.charAt(offset) != '\n')=T -> exit loop -> if(trimmedContent.startsWith(INLINE_SCR...
/* static context [FOCAL] public static boolean CommentUtils.isEndMatchWithInlineCommentedCDATA(String trimmedContent) [PATH1] if(trimmedContent.endsWith(CDATA_SIMPLE_END))=T -> while(trimmedContent.charAt(offset) <= ' ' && trimmedContent.charAt(offset) != '\n')=T -> exit loop -> if(trimmedContent.startsWith(INLINE_SCR...
true
ok
{"focal": {"class": "CommentUtils", "name": "isEndMatchWithInlineCommentedCDATA", "signature": "boolean isEndMatchWithInlineCommentedCDATA(String trimmedContent)", "start_line": 3, "modifiers": "public static", "params": [{"name": "trimmedContent", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "...
132620967_162
class PropertyUtils { public static String stringProperty(Configuration conf, Property property) { return conf.get(property.key(), (String) property.defaultValue()); } private PropertyUtils(); public static boolean booleanProperty(Configuration conf, Property property); public static int intProperty(C...
when(property.key()).thenReturn("unset"); when(property.defaultValue()).thenReturn("default"); assertThat(stringProperty(conf, property)).isEqualTo("default"); } }
[FOCAL] public static String PropertyUtils.stringProperty(Configuration conf, Property property) [CLASS] class PropertyUtils [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Configuration.get/2, Property.key/0, Property.defaultValue/0 [INPUTS] branches=- | result=conf, property [COL...
/* static context [FOCAL] public static String PropertyUtils.stringProperty(Configuration conf, Property property) [INPUTS] branches=- | result=conf, property [COLLABORATORS] param conf:Configuration get/2; param property:Property key/0,defaultValue/0 [CALLS-EXTERNAL] Configuration.get/2, Property.key/0, Property.defau...
/* static context [FOCAL] public static String PropertyUtils.stringProperty(Configuration conf, Property property) [INPUTS] branches=- | result=conf, property [COLLABORATORS] param conf:Configuration get/2; param property:Property key/0,defaultValue/0 [CALLS-EXTERNAL] Configuration.get/2, Property.key/0, Property.defau...
true
ok
{"focal": {"class": "PropertyUtils", "name": "stringProperty", "signature": "String stringProperty(Configuration conf, Property property)", "start_line": 3, "modifiers": "public static", "params": [{"name": "conf", "type": "Configuration"}, {"name": "property", "type": "Property"}], "return_type": "String"}, "class_inf...
132733058_1
class SkeletonBuffer { @Override public String toString() { if (document.getFxomRoot() == null) { return I18N.getString("skeleton.empty"); } else { construct(); StringBuilder code = new StringBuilder(); code.append(header); code.appen...
EditorController editorController = new EditorController(); final URL fxmlURL = SkeletonBufferTest.class.getResource("ControllerWithSimplePackage.fxml"); final String fxmlText = FXOMDocument.readContentFromURL(fxmlURL); editorController.setFxmlTextAndLocation(fxmlText, fxmlURL, false); ...
[FOCAL] @Override public String SkeletonBuffer.toString() [CLASS] class SkeletonBuffer [METRICS] loc=37 cc=5 branches=3 loops=1 returns=2 throws=0 nesting=3 [CALLS-INTERNAL] void construct() [CALLS-EXTERNAL] document.getFxomRoot/0, I18N.getString/1, StringBuilder.append/1, code.append(INDENT).append("@FXML // ResourceB...
/* static context [FOCAL] @Override public String SkeletonBuffer.toString() [PATH1] if(document.getFxomRoot() == null)=F -> foreach(String importStatement : imports)=T -> exit loop -> if(textType == TEXT_TYPE.WITH_COMMENTS && textFormat == FORMAT_TYPE.FULL)=F -> if(textFormat == FORMAT_TYPE.FULL)=T -> return code.toStr...
/* static context [FOCAL] @Override public String SkeletonBuffer.toString() [PATH1] if(document.getFxomRoot() == null)=F -> foreach(String importStatement : imports)=T -> exit loop -> if(textType == TEXT_TYPE.WITH_COMMENTS && textFormat == FORMAT_TYPE.FULL)=F -> if(textFormat == FORMAT_TYPE.FULL)=T -> return code.toStr...
true
ok
{"focal": {"class": "SkeletonBuffer", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "SkeletonBuffer", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members"...
132811956_1179
class OlapUnitResourceConverter extends ResourceConverterImpl<OlapUnit, ClientOlapUnit> { @Override protected ClientOlapUnit resourceSpecificFieldsToClient(ClientOlapUnit client, OlapUnit serverObject, ToClientConversionOptions options) { client.setMdxQuery(serverObject.getMdxQuery()); ...
ClientOlapUnit clientObject = new ClientOlapUnit(); OlapUnit serverObject = new OlapUnitImpl(); serverObject.setMdxQuery(EXPECTED_MDX_QUERY); serverObject.setOlapClientConnection(serverConnection); final ClientOlapUnit result = converter.resourceSpecificFieldsToClient(clientObjec...
[FOCAL] @Override protected ClientOlapUnit OlapUnitResourceConverter.resourceSpecificFieldsToClient(ClientOlapUnit client, OlapUnit serverObject, ToClientConversionOptions options) [CLASS] class OlapUnitResourceConverter extends ResourceConverterImpl<OlapUnit, ClientOlapUnit> [METRICS] loc=10 cc=1 branches=0 loops=0 re...
/* static context [FOCAL] @Override protected ClientOlapUnit OlapUnitResourceConverter.resourceSpecificFieldsToClient(ClientOlapUnit client, OlapUnit serverObject, ToClientConversionOptions options) [INPUTS] branches=- | result=client [COLLABORATORS] param client:ClientOlapUnit setMdxQuery/1,setOlapConnection/1; param ...
/* static context [FOCAL] @Override protected ClientOlapUnit OlapUnitResourceConverter.resourceSpecificFieldsToClient(ClientOlapUnit client, OlapUnit serverObject, ToClientConversionOptions options) [INPUTS] branches=- | result=client [COLLABORATORS] param client:ClientOlapUnit setMdxQuery/1,setOlapConnection/1; param ...
true
ok
{"focal": {"class": "OlapUnitResourceConverter", "name": "resourceSpecificFieldsToClient", "signature": "ClientOlapUnit resourceSpecificFieldsToClient(ClientOlapUnit client, OlapUnit serverObject, ToClientConversionOptions options)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "client", "ty...
132873186_1
class InsertedMethods { static boolean endsWith(String str, int len, int hashCode) { if (str.length() < len) return false; return str.substring(str.length() - len).hashCode() == hashCode; } public static boolean startsWith(String str, int len, int hashCode); } class InsertedMethodsTest ...
assertTrue(InsertedMethods.endsWith("ich hasse Menschen", "Menschen".length(), "Menschen".hashCode())); assertTrue(InsertedMethods.endsWith("hasse", "hasse".length(), "hasse".hashCode())); assertFalse(InsertedMethods.endsWith("cancer", "aidsfgd".length(), "aidsfgd".hashCode())); } }
[FOCAL] static boolean InsertedMethods.endsWith(String str, int len, int hashCode) [CLASS] class InsertedMethods [METRICS] loc=5 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] String.length/0, str.substring(str.length() - len).hashCode/0, String.substring/1 [PATH1] if(str.length() < len)=T -> ret...
/* static context [FOCAL] static boolean InsertedMethods.endsWith(String str, int len, int hashCode) [PATH1] if(str.length() < len)=T -> return false [PATH2] if(str.length() < len)=F -> return str.substring(str.length() - len).hashCode() == hashCode [INPUTS] branches=len, str | result=hashCode, len, str [CALLS-EXTERNAL...
/* static context [FOCAL] static boolean InsertedMethods.endsWith(String str, int len, int hashCode) [PATH1] if(str.length() < len)=T -> return false [PATH2] if(str.length() < len)=F -> return str.substring(str.length() - len).hashCode() == hashCode [INPUTS] branches=len, str | result=hashCode, len, str [CALLS-EXTERNAL...
true
ok
{"focal": {"class": "InsertedMethods", "name": "endsWith", "signature": "boolean endsWith(String str, int len, int hashCode)", "start_line": 3, "modifiers": "static", "params": [{"name": "str", "type": "String"}, {"name": "len", "type": "int"}, {"name": "hashCode", "type": "int"}], "return_type": "boolean"}, "class_inf...
132938098_42
class StringHelper { public static String truncate(String input, int length) { if (input != null) { if (input.length() > length) { return input.substring(0, length); } else { return input; } } else { return null; } } private St...
// Tests the suite of truncate methods assertEquals("This", StringHelper.truncate(sentence, 4)); assertEquals("Foo", StringHelper.truncate("Foo", 4)); assertNull(StringHelper.truncate(null, 50)); assertEquals("nce.", StringHelper.truncateAtEnd(sentence, 4)); assertEquals("Foo", StringH...
[FOCAL] public static String StringHelper.truncate(String input, int length) [CLASS] class StringHelper [METRICS] loc=18 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=2 [CALLS-EXTERNAL] String.length/0, String.substring/2 [PATH1] if(input != null)=T -> if(input.length() > length)=T -> return input.substring(0, len...
class StringHelper { public static String truncate(String input, int length) { if (input != null) { if (input.length() > length) { return input.substring(0, length); } else { return input; } } else { return null; } } private St...
false
ok
{"focal": {"class": "StringHelper", "name": "truncate", "signature": "String truncate(String input, int length)", "start_line": 3, "modifiers": "public static", "params": [{"name": "input", "type": "String"}, {"name": "length", "type": "int"}], "return_type": "String"}, "class_info": {"name": "StringHelper", "kind": "c...
132952801_3
class GraphQLTemplate { public <T> GraphQLResponseEntity<T> mutate(GraphQLRequestEntity requestEntity, Class<T> responseClass) throws GraphQLException { return execute(GraphQLMethod.MUTATE, requestEntity, responseClass); } public GraphQLTemplate(); public GraphQLTemplate(final ObjectMapperFa...
server.enqueue(new MockResponse().setBody("{\n" + " \"data\": {\n" + " \"test\": {\n" + " \"testString\": \"String\"\n" + " }\n" + " }," + " \"errors\": null" + "}" )); s...
[FOCAL] public GraphQLResponseEntity<T> GraphQLTemplate.mutate(GraphQLRequestEntity requestEntity, Class<T> responseClass) [CLASS] class GraphQLTemplate [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] GraphQLResponseEntity<T> execute(GraphQLMethod method, GraphQLRequestEntity reque...
/* static context [FOCAL] public GraphQLResponseEntity<T> GraphQLTemplate.mutate(GraphQLRequestEntity requestEntity, Class<T> responseClass) [INPUTS] branches=- | result=requestEntity, responseClass [EXCEPTIONS] declares GraphQLException [CALLS-INTERNAL] GraphQLResponseEntity<T> execute(GraphQLMethod method, GraphQLReq...
/* static context [FOCAL] public GraphQLResponseEntity<T> GraphQLTemplate.mutate(GraphQLRequestEntity requestEntity, Class<T> responseClass) [INPUTS] branches=- | result=requestEntity, responseClass [EXCEPTIONS] declares GraphQLException [CALLS-INTERNAL] GraphQLResponseEntity<T> execute(GraphQLMethod method, GraphQLReq...
true
ok
{"focal": {"class": "GraphQLTemplate", "name": "mutate", "signature": "GraphQLResponseEntity<T> mutate(GraphQLRequestEntity requestEntity, Class<T> responseClass) throws GraphQLException", "start_line": 3, "modifiers": "public", "params": [{"name": "requestEntity", "type": "GraphQLRequestEntity"}, {"name": "responseCla...
133016017_1
class Puller { void pull(String elementId, Queue<Item> queue, CompletableFuture resultFuture, int count) { dbClient.getNextAfterId(elementId) .thenAccept(item -> { if (isValid(item)) { queue.offer(item); if (queue.size() == count) { resultFuture.co...
CountDownLatch l = new CountDownLatch(1); Puller puller = new Puller(); CompletionStage<Queue<Item>> list = puller.list(10); list.thenAccept(q -> { MatcherAssert.assertThat(q, Matchers.allOf( Matchers.hasSize(10), Matchers.contains( Matchers.hasProperty("id", Matchers.equalTo("2")), ...
[FOCAL] void Puller.pull(String elementId, Queue<Item> queue, CompletableFuture resultFuture, int count) [CLASS] class Puller [METRICS] loc=18 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=2 [CALLS-INTERNAL] boolean isValid(Item item) [CALLS-EXTERNAL] dbClient.getNextAfterId(elementId).thenAccept/1, dbClient.getNe...
/* static context [FOCAL] void Puller.pull(String elementId, Queue<Item> queue, CompletableFuture resultFuture, int count) [COLLABORATORS] field dbClient getNextAfterId/1; param queue:Queue<Item> offer/1,size/0; param resultFuture:CompletableFuture complete/1; field item getId/0 [CALLS-INTERNAL] boolean isValid(Item it...
/* static context [FOCAL] void Puller.pull(String elementId, Queue<Item> queue, CompletableFuture resultFuture, int count) [COLLABORATORS] field dbClient getNextAfterId/1; param queue:Queue<Item> offer/1,size/0; param resultFuture:CompletableFuture complete/1; field item getId/0 [CALLS-INTERNAL] boolean isValid(Item it...
true
ok
{"focal": {"class": "Puller", "name": "pull", "signature": "void pull(String elementId, Queue<Item> queue, CompletableFuture resultFuture, int count)", "start_line": 3, "modifiers": "", "params": [{"name": "elementId", "type": "String"}, {"name": "queue", "type": "Queue<Item>"}, {"name": "resultFuture", "type": "Comple...
133022875_117
class SumFunction extends AggregateFunction<JsonNode, Double> { @Override public Double compute() { return sum; } @Override public AggregateFunction addValue(JsonNode value); @Override public AggregateFunction<JsonNode, Double> merge(AggregateFunction<JsonNode, Double> newValue); } class...
SumFunction sumFunction =new SumFunction(); assertThat(sumFunction.compute()).isEqualTo(0); } }
[FOCAL] @Override public Double SumFunction.compute() [CLASS] class SumFunction extends AggregateFunction<JsonNode, Double> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] AggregateFunction addValue(JsonNode value); AggregateFunction<JsonNode, Double> merge(AggregateFunction<JsonNod...
/* static context [FOCAL] @Override public Double SumFunction.compute() */
/* static context [FOCAL] @Override public Double SumFunction.compute() */ class SumFunction extends AggregateFunction<JsonNode, Double> { @Override public Double compute() { return sum; } @Override public AggregateFunction addValue(JsonNode value); @Override public AggregateFunction<JsonN...
true
ok
{"focal": {"class": "SumFunction", "name": "compute", "signature": "Double compute()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Double"}, "class_info": {"name": "SumFunction", "kind": "class", "modifiers": "", "superclass": "AggregateFunction<JsonNode, Double>", "interfaces": null...
133025905_1
class CrawlStatusUpdaterBolt extends AbstractStatusUpdaterBolt implements RemovalListener<String, List<Tuple>>, BulkProcessor.Listener { protected String getIndexName(Metadata md) { String crawlId = md.getFirstValue("n52.crawl.id"); return indexName.replace("*", crawlId.toLowerCase()); } ...
String statusIndex = "crawlstatus"; CrawlStatusUpdaterBolt bolt = new CrawlStatusUpdaterBolt(statusIndex); Metadata md = new Metadata(); md.setValue("n52.crawl.id", "tEstCrawl"); assertEquals(bolt.getIndexName(md), "crawlstatus"); } }
[FOCAL] protected String CrawlStatusUpdaterBolt.getIndexName(Metadata md) [CLASS] class CrawlStatusUpdaterBolt extends AbstractStatusUpdaterBolt implements RemovalListener<String, List<Tuple>>, BulkProcessor.Listener [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Metadata.getFirst...
/* static context [FOCAL] protected String CrawlStatusUpdaterBolt.getIndexName(Metadata md) [INPUTS] branches=- | result=md [COLLABORATORS] param md:Metadata getFirstValue/1; field indexName replace/2 [CALLS-EXTERNAL] Metadata.getFirstValue/1, indexName.replace/2, String.toLowerCase/0 */
/* static context [FOCAL] protected String CrawlStatusUpdaterBolt.getIndexName(Metadata md) [INPUTS] branches=- | result=md [COLLABORATORS] param md:Metadata getFirstValue/1; field indexName replace/2 [CALLS-EXTERNAL] Metadata.getFirstValue/1, indexName.replace/2, String.toLowerCase/0 */ class CrawlStatusUpdaterBolt ex...
true
ok
{"focal": {"class": "CrawlStatusUpdaterBolt", "name": "getIndexName", "signature": "String getIndexName(Metadata md)", "start_line": 4, "modifiers": "protected", "params": [{"name": "md", "type": "Metadata"}], "return_type": "String"}, "class_info": {"name": "CrawlStatusUpdaterBolt", "kind": "class", "modifiers": "", "...
133030793_0
class SimpleSelector extends AbstractSelector { @SuppressWarnings("unchecked") public void registerCandidates(Class<?> candidateType, Set candidates) { Collection existed = this.candidatesByType.get(candidateType); if (existed == null) { this.candidatesByType.put(candidateType, candidates); } else { exis...
// Given SimpleSelector simpleSelector = new SimpleSelector(); Set<Handler> handlers = new HashSet<>(); handlers.add(new NoAnno1Handler()); handlers.add(new NoAnno2Handler()); simpleSelector.registerCandidates(Handler.class, handlers); // When Handler winner = simpleSelector.select(new Object(), Handle...
[FOCAL] @SuppressWarnings("unchecked") public void SimpleSelector.registerCandidates(Class<?> candidateType, Set candidates) [CLASS] class SimpleSelector extends AbstractSelector [METRICS] loc=9 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] this.candidatesByType.get/1, this.candidatesByType.put/...
/* static context [FOCAL] @SuppressWarnings("unchecked") public void SimpleSelector.registerCandidates(Class<?> candidateType, Set candidates) [PATH1] if(existed == null)=T [PATH2] if(existed == null)=F [INPUTS] branches=candidateType | result=- [COLLABORATORS] field candidatesByType get/1,put/2 [FIELDS] read=candidate...
/* static context [FOCAL] @SuppressWarnings("unchecked") public void SimpleSelector.registerCandidates(Class<?> candidateType, Set candidates) [PATH1] if(existed == null)=T [PATH2] if(existed == null)=F [INPUTS] branches=candidateType | result=- [COLLABORATORS] field candidatesByType get/1,put/2 [FIELDS] read=candidate...
true
ok
{"focal": {"class": "SimpleSelector", "name": "registerCandidates", "signature": "void registerCandidates(Class<?> candidateType, Set candidates)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public", "params": [{"name": "candidateType", "type": "Class<?>"}, {"name": "candidates", "type": "Set"}], "...
133047162_129
class Message { public Optional<String> header(final String name) { if ( name == null ) { throw new NullPointerException("null name"); } return headers(name).stream().findFirst(); } private T self(); public abstract String item(); public abstract Request request(); public R map(final Function<T, R> m...
assertThat(new MessageMock() .header("TEST-header", "value") ) .hasHeader("test-header", "value"); } }
[FOCAL] public Optional<String> Message.header(String name) [CLASS] class Message [METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] T headers(Map<String, ? extends Collection<String>> headers) [CALLS-EXTERNAL] headers(name).stream().findFirst/0, headers(name).stream/0 [NEW] NullPoint...
/* static context [FOCAL] public Optional<String> Message.header(String name) [THROWS-WHEN] NullPointerException when name == null [PATH1] if(name == null)=T -> throw new NullPointerException("null name") [PATH2] if(name == null)=F -> return headers(name).stream().findFirst() [INPUTS] branches=name | result=name [EXCEP...
/* static context [FOCAL] public Optional<String> Message.header(String name) [THROWS-WHEN] NullPointerException when name == null [PATH1] if(name == null)=T -> throw new NullPointerException("null name") [PATH2] if(name == null)=F -> return headers(name).stream().findFirst() [INPUTS] branches=name | result=name [EXCEP...
true
ok
{"focal": {"class": "Message", "name": "header", "signature": "Optional<String> header(String name)", "start_line": 3, "modifiers": "public", "params": [{"name": "name", "type": "String"}], "return_type": "Optional<String>"}, "class_info": {"name": "Message", "kind": "class", "modifiers": "", "superclass": null, "inter...
133134007_2489
class ApiClient extends JavaTimeFormatter { public List<Pair> parameterToPairs(String collectionFormat, String name, Object value){ List<Pair> params = new ArrayList<Pair>(); // preconditions if (name == null || name.isEmpty() || value == null) return params; Collection valueCollection; if (val...
Map<String, String> collectionFormatMap = new HashMap<String, String>(); collectionFormatMap.put("csv", ","); collectionFormatMap.put("tsv", "\t"); collectionFormatMap.put("ssv", " "); collectionFormatMap.put("pipes", "\\|"); collectionFormatMap.put("", ","); // no format...
[FOCAL] public List<Pair> ApiClient.parameterToPairs(String collectionFormat, String name, Object value) [CLASS] class ApiClient extends JavaTimeFormatter [METRICS] loc=52 cc=11 branches=8 loops=2 returns=5 throws=0 nesting=4 [CALLS-INTERNAL] String parameterToString(Object param) [CALLS-EXTERNAL] String.isEmpty/0, Lis...
/* static context [FOCAL] public List<Pair> ApiClient.parameterToPairs(String collectionFormat, String name, Object value) [PATH4] if(name == null || name.isEmpty() || value == null)=T -> return params [PATH5] if(name == null || name.isEmpty() || value == null)=F -> if(value instanceof Collection)=F -> return params */...
/* static context [FOCAL] public List<Pair> ApiClient.parameterToPairs(String collectionFormat, String name, Object value) [PATH4] if(name == null || name.isEmpty() || value == null)=T -> return params [PATH5] if(name == null || name.isEmpty() || value == null)=F -> if(value instanceof Collection)=F -> return params */...
true
ok
{"focal": {"class": "ApiClient", "name": "parameterToPairs", "signature": "List<Pair> parameterToPairs(String collectionFormat, String name, Object value)", "start_line": 3, "modifiers": "public", "params": [{"name": "collectionFormat", "type": "String"}, {"name": "name", "type": "String"}, {"name": "value", "type": "O...
133145968_1
class MembershipRecord implements Externalizable { public boolean isOverrides(MembershipRecord r0) { if (r0 == null) { return isAlive() || isLeaving(); } if (!Objects.equals(member.id(), r0.member.id())) { throw new IllegalArgumentException("Can't compare records for different members"); ...
MembershipRecord r1Dead1 = new MembershipRecord(member, DEAD, 1); assertFalse(r1Dead1.isOverrides(r0Null)); assertTrue(r1Dead1.isOverrides(r0Alive0)); assertTrue(r1Dead1.isOverrides(r0Alive1)); assertTrue(r1Dead1.isOverrides(r0Alive2)); assertTrue(r1Dead1.isOverrides(r0Suspect0)); assertT...
[FOCAL] public boolean MembershipRecord.isOverrides(MembershipRecord r0) [CLASS] class MembershipRecord implements Externalizable [METRICS] loc=22 cc=7 branches=6 loops=0 returns=6 throws=1 nesting=1 [CALLS-INTERNAL] boolean equals(Object that); boolean isAlive(); boolean isDead(); boolean isLeaving(); boolean isSuspec...
/* static context [FOCAL] public boolean MembershipRecord.isOverrides(MembershipRecord r0) [THROWS-WHEN] IllegalArgumentException when !(r0 == null) && !Objects.equals(member.id(), r0.member.id()) [PATH1] if(r0 == null)=F -> if(!Objects.equals(member.id(), r0.member.id()))=F -> if(this.equals(r0))=F -> if(r0.isDead())=...
/* static context [FOCAL] public boolean MembershipRecord.isOverrides(MembershipRecord r0) [THROWS-WHEN] IllegalArgumentException when !(r0 == null) && !Objects.equals(member.id(), r0.member.id()) [PATH1] if(r0 == null)=F -> if(!Objects.equals(member.id(), r0.member.id()))=F -> if(this.equals(r0))=F -> if(r0.isDead())=...
true
ok
{"focal": {"class": "MembershipRecord", "name": "isOverrides", "signature": "boolean isOverrides(MembershipRecord r0)", "start_line": 3, "modifiers": "public", "params": [{"name": "r0", "type": "MembershipRecord"}], "return_type": "boolean"}, "class_info": {"name": "MembershipRecord", "kind": "class", "modifiers": "", ...
133151090_2
class EventManager implements IEventManager { public boolean hasEventHandler(Class eventHandlerClass) { Optional<IEventHandler> eventHandler = getEventHandlers().stream().filter(h -> h.getClass().getName().equalsIgnoreCase(eventHandlerClass.getName())).findFirst(); return eventHandler.isPresent(); ...
Assertions.assertTrue(eventManager.hasEventHandler(SimpleEventHandler.class), "should fine a eventHandler for class SimpleEventHandler"); } }
[FOCAL] public boolean EventManager.hasEventHandler(Class eventHandlerClass) [CLASS] class EventManager implements IEventManager [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] getEventHandlers().stream().filter(h -> h.getClass().getN....findFirst/0, getEventHandlers().stream().fil...
/* static context [FOCAL] public boolean EventManager.hasEventHandler(Class eventHandlerClass) [INPUTS] branches=- | result=eventHandlerClass [COLLABORATORS] field h getClass/0; param eventHandlerClass:Class getName/0 [CALLS-EXTERNAL] getEventHandlers().stream().filter(h -> h.getClass().getN....findFirst/0, getEventHan...
/* static context [FOCAL] public boolean EventManager.hasEventHandler(Class eventHandlerClass) [INPUTS] branches=- | result=eventHandlerClass [COLLABORATORS] field h getClass/0; param eventHandlerClass:Class getName/0 [CALLS-EXTERNAL] getEventHandlers().stream().filter(h -> h.getClass().getN....findFirst/0, getEventHan...
true
ok
{"focal": {"class": "EventManager", "name": "hasEventHandler", "signature": "boolean hasEventHandler(Class eventHandlerClass)", "start_line": 3, "modifiers": "public", "params": [{"name": "eventHandlerClass", "type": "Class"}], "return_type": "boolean"}, "class_info": {"name": "EventManager", "kind": "class", "modifier...
133386452_9
class QRCodeUtils { public static String createHotspotInfo(String ssid, int port, String password) throws JSONException { JSONObject hotspotQRCode = new JSONObject(); hotspotQRCode.put(SSID, ssid); hotspotQRCode.put(PORT, port); if (password == null) { hotspotQRCode.put...
String ssid = "DeviceSSID"; int port = 3; String password = "password"; String hotspotInfo = QRCodeUtils.createHotspotInfo(ssid, port, password); JSONObject hotspotInfoJson = new JSONObject(hotspotInfo); assertTrue(hotspotInfoJson.get(QRCodeUtils.SSID).equals(ssid)); ...
[FOCAL] public static String QRCodeUtils.createHotspotInfo(String ssid, int port, String password) [CLASS] class QRCodeUtils [METRICS] loc=13 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] JSONObject.put/2, JSONObject.toString/0 [NEW] JSONObject [EXCEPTIONS] declares JSONException [PATH1] if(pass...
/* static context [FOCAL] public static String QRCodeUtils.createHotspotInfo(String ssid, int port, String password) [PATH1] if(password == null)=T -> return hotspotQRCode.toString() [PATH2] if(password == null)=F -> return hotspotQRCode.toString() [INPUTS] branches=password | result=- [EXCEPTIONS] declares JSONExcepti...
/* static context [FOCAL] public static String QRCodeUtils.createHotspotInfo(String ssid, int port, String password) [PATH1] if(password == null)=T -> return hotspotQRCode.toString() [PATH2] if(password == null)=F -> return hotspotQRCode.toString() [INPUTS] branches=password | result=- [EXCEPTIONS] declares JSONExcepti...
true
ok
{"focal": {"class": "QRCodeUtils", "name": "createHotspotInfo", "signature": "String createHotspotInfo(String ssid, int port, String password) throws JSONException", "start_line": 3, "modifiers": "public static", "params": [{"name": "ssid", "type": "String"}, {"name": "port", "type": "int"}, {"name": "password", "type"...
133447770_225
class DefaultMediaClock implements MediaClock { @Override public PlaybackParameters setPlaybackParameters(PlaybackParameters playbackParameters) { if (rendererClock != null) { playbackParameters = rendererClock.setPlaybackParameters(playbackParameters); } standaloneMediaClock.setPlaybackParameter...
mediaClock.setPlaybackParameters(TEST_PLAYBACK_PARAMETERS); mediaClock.setPlaybackParameters(TEST_PLAYBACK_PARAMETERS); verify(listener, times(2)).onPlaybackParametersChanged(TEST_PLAYBACK_PARAMETERS); } }
[FOCAL] @Override public PlaybackParameters DefaultMediaClock.setPlaybackParameters(PlaybackParameters playbackParameters) [CLASS] class DefaultMediaClock implements MediaClock [METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] rendererClock.setPlaybackParameters/1, standaloneMediaClo...
/* static context [FOCAL] @Override public PlaybackParameters DefaultMediaClock.setPlaybackParameters(PlaybackParameters playbackParameters) [PATH1] if(rendererClock != null)=T -> return playbackParameters [PATH2] if(rendererClock != null)=F -> return playbackParameters [INPUTS] branches=- | result=playbackParameters [...
/* static context [FOCAL] @Override public PlaybackParameters DefaultMediaClock.setPlaybackParameters(PlaybackParameters playbackParameters) [PATH1] if(rendererClock != null)=T -> return playbackParameters [PATH2] if(rendererClock != null)=F -> return playbackParameters [INPUTS] branches=- | result=playbackParameters [...
true
ok
{"focal": {"class": "DefaultMediaClock", "name": "setPlaybackParameters", "signature": "PlaybackParameters setPlaybackParameters(PlaybackParameters playbackParameters)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "playbackParameters", "type": "PlaybackParameters"}], "return_type": "PlaybackPa...
133448635_2
class BaseSwitchController implements SwitchController { protected static HashMap<String, String> mapSimpleTable( String rawPacket, String[] colNames, String[] mapNames) { HashMap<String, String> colMap = new HashMap<>(); String[] lines = rawPacket.split("\n"); int headerLine = 0; if (lines.len...
String raw = "Port         Name               Status       Vlan       Duplex  Speed Type\n" + "Gi1/0/1                         connected    routed     a-full  a-100 10/100/1000BaseTX"; String[] colNames = {"Port", "Name", "Status", "Vlan", "Duplex", "Speed", "Type"}; String[] mapNames = {"i...
[FOCAL] protected static HashMap<String, String> BaseSwitchController.mapSimpleTable(String rawPacket, String[] colNames, String[] mapNames) [CLASS] class BaseSwitchController implements SwitchController [METRICS] loc=55 cc=8 branches=6 loops=1 returns=1 throws=0 nesting=5 [CALLS-INTERNAL] int getFirstWhiteSpace(String...
/* static context [FOCAL] protected static HashMap<String, String> BaseSwitchController.mapSimpleTable(String rawPacket, String[] colNames, String[] mapNames) [PATH1] if(lines.length >= headerLine + 2)=T -> for(i < colNames.length)=T -> if((i + 1) >= colNames.length)=F -> if(Character.isWhitespace(values.charAt(lastSec...
/* static context [FOCAL] protected static HashMap<String, String> BaseSwitchController.mapSimpleTable(String rawPacket, String[] colNames, String[] mapNames) [PATH1] if(lines.length >= headerLine + 2)=T -> for(i < colNames.length)=T -> if((i + 1) >= colNames.length)=F -> if(Character.isWhitespace(values.charAt(lastSec...
true
ok
{"focal": {"class": "BaseSwitchController", "name": "mapSimpleTable", "signature": "HashMap<String, String> mapSimpleTable(String rawPacket, String[] colNames, String[] mapNames)", "start_line": 3, "modifiers": "protected static", "params": [{"name": "rawPacket", "type": "String"}, {"name": "colNames", "type": "String[...
133662794_5
class GeoHashUtil { public static List<String> coverBoundingBox(String geometryWKT, int length) { List<String> list = new ArrayList<>(); Geometry geometry; try { geometry = reader.read(geometryWKT); // returns the bounding box Envelope e = geometry.getEnvelopeInternal(); Coverage c = GeoHash.coverB...
List<String> results = GeoHashUtil.coverBoundingBox(52.449732623925755,113.309593200683594,52.45559096922489,3.3178329467773445, 5); String[] resultArr = results.toArray(new String[results.size()]); System.out.println(results); String[] expectedArr = new String[] { "9yzf6", "9yzf7", "9yzfd", "9yzfe", "9yzff", "...
[FOCAL] public static List<String> GeoHashUtil.coverBoundingBox(String geometryWKT, int length) [CLASS] class GeoHashUtil [METRICS] loc=16 cc=2 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] WKTReader.read/1, Geometry.getEnvelopeInternal/0, GeoHash.coverBoundingBox/5, ParseException.getMaxY/0, ParseEx...
/* static context [FOCAL] public static List<String> GeoHashUtil.coverBoundingBox(String geometryWKT, int length) [PATH1] try-body throws -> return list [INPUTS] branches=- | result=geometryWKT, length, reader [COLLABORATORS] field reader:WKTReader read/1 [EXCEPTIONS] catches ParseException e [FIELDS] read=reader:WKTRe...
/* static context [FOCAL] public static List<String> GeoHashUtil.coverBoundingBox(String geometryWKT, int length) [PATH1] try-body throws -> return list [INPUTS] branches=- | result=geometryWKT, length, reader [COLLABORATORS] field reader:WKTReader read/1 [EXCEPTIONS] catches ParseException e [FIELDS] read=reader:WKTRe...
true
ok
{"focal": {"class": "GeoHashUtil", "name": "coverBoundingBox", "signature": "List<String> coverBoundingBox(String geometryWKT, int length)", "start_line": 3, "modifiers": "public static", "params": [{"name": "geometryWKT", "type": "String"}, {"name": "length", "type": "int"}], "return_type": "List<String>"}, "class_inf...
133752946_16
class RedisMsInstService implements IMsInstService { @Override public Boolean removeMsInst(Long instId) { String key = String.valueOf(instId); TacInst tacInst = hashOperations.get(getMainKey(), key); if (tacInst != null) { hashOperations.delete(getMainKey() + tacInst.getMsC...
Boolean success = redisMsInstService.removeMsInst(1L); assertTrue(success); TacInst tacMsInst = redisMsInstService.getTacMsInst(1L); assertNull(tacMsInst); } }
[FOCAL] @Override public Boolean RedisMsInstService.removeMsInst(Long instId) [CLASS] class RedisMsInstService implements IMsInstService [METRICS] loc=12 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] String getMainKey() [CALLS-EXTERNAL] String.valueOf/1, hashOperations.get/2, hashOperations.dele...
/* static context [FOCAL] @Override public Boolean RedisMsInstService.removeMsInst(Long instId) [PATH1] if(tacInst != null)=T -> return true [PATH2] if(tacInst != null)=F -> return true [INPUTS] branches=instId | result=- [COLLABORATORS] field hashOperations get/2,delete/2 [CALLS-INTERNAL] String getMainKey() [CALLS-EX...
/* static context [FOCAL] @Override public Boolean RedisMsInstService.removeMsInst(Long instId) [PATH1] if(tacInst != null)=T -> return true [PATH2] if(tacInst != null)=F -> return true [INPUTS] branches=instId | result=- [COLLABORATORS] field hashOperations get/2,delete/2 [CALLS-INTERNAL] String getMainKey() [CALLS-EX...
true
ok
{"focal": {"class": "RedisMsInstService", "name": "removeMsInst", "signature": "Boolean removeMsInst(Long instId)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "instId", "type": "Long"}], "return_type": "Boolean"}, "class_info": {"name": "RedisMsInstService", "kind": "class", "modifiers": "", ...
133753413_102
class InjectSetter { public InjectSetter(Inject inject) { this.inject = inject; } public InjectSetter(Inject inject); public void injectSetter(ClassFile targetClass, Class<?> targetApiClass, Field field, String exportedName, Number setter); public int getInjectedSetters(); } class InjectSetterTest { @Te...
Inject inject = mock(Inject.class); when(inject.findImportMethodOnApi(any(Class.class), anyString(), any(Boolean.class))) .thenReturn(APIClass.class.getDeclaredMethod("setTest", int.class)); when(inject.createLoadForTypeIndex(any(Instructions.class), any(Type.class), anyInt())) .thenReturn(mock(Instructio...
[FOCAL] public InjectSetter.InjectSetter(Inject inject) [CLASS] class InjectSetter [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [FIELDS] write=inject [STATE] inject [DATAFLOW] inject@param->L3 [CLASS-MEMBERS] InjectSetter(Inject inject); void injectSetter(ClassFile targetClass, Class<?> targetAp...
/* static context [FOCAL] public InjectSetter.InjectSetter(Inject inject) [STATE] inject [FIELDS] write=inject */
/* static context [FOCAL] public InjectSetter.InjectSetter(Inject inject) [STATE] inject [FIELDS] write=inject */ class InjectSetter { public InjectSetter(Inject inject) { this.inject = inject; } public InjectSetter(Inject inject); public void injectSetter(ClassFile targetClass, Class<?> targetApiClass, Fiel...
true
ok
{"focal": {"class": "InjectSetter", "name": "InjectSetter", "signature": "InjectSetter(Inject inject)", "start_line": 3, "modifiers": "public", "params": [{"name": "inject", "type": "Inject"}], "return_type": null}, "class_info": {"name": "InjectSetter", "kind": "class", "modifiers": "", "superclass": null, "interfaces...
133849229_5
class Elasticsearch implements SearchPlatform { @Override public boolean isSearchPlatformConfiguration(String indexName, File file) { return file.isFile() && file.getName().equals("index-shape.json"); } @Override public void beforeStart(final Map<String, Object> configuration); @Override p...
File configFile = tempFolder.newFile("index-shape.json"); assertTrue(platform.isSearchPlatformConfiguration(INDEX_NAME, configFile)); } }
[FOCAL] @Override public boolean Elasticsearch.isSearchPlatformConfiguration(String indexName, File file) [CLASS] class Elasticsearch implements SearchPlatform [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] File.isFile/0, file.getName().equals/1, File.getName/0 [INPUTS] branches=-...
/* static context [FOCAL] @Override public boolean Elasticsearch.isSearchPlatformConfiguration(String indexName, File file) [INPUTS] branches=- | result=file | unused=indexName [COLLABORATORS] param file:File isFile/0,getName/0 [CALLS-EXTERNAL] File.isFile/0, file.getName().equals/1, File.getName/0 */
/* static context [FOCAL] @Override public boolean Elasticsearch.isSearchPlatformConfiguration(String indexName, File file) [INPUTS] branches=- | result=file | unused=indexName [COLLABORATORS] param file:File isFile/0,getName/0 [CALLS-EXTERNAL] File.isFile/0, file.getName().equals/1, File.getName/0 */ class Elasticsear...
true
ok
{"focal": {"class": "Elasticsearch", "name": "isSearchPlatformConfiguration", "signature": "boolean isSearchPlatformConfiguration(String indexName, File file)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "indexName", "type": "String"}, {"name": "file", "type": "File"}], "return_type": "boolea...
134143184_310
class SystemService { public void replaceAnchor(byte[] anchorBytes) throws InvalidAnchorInstanceException, AnchorUploadException, MalformedAnchorException, ConfigurationDownloadException, ConfigurationVerifier.ConfigurationVerificationException { uploadAnchor(anchorBytes, true); ...
byte[] anchorBytes = FileUtils.readFileToByteArray(ANCHOR_FILE); try { systemService.replaceAnchor(anchorBytes); } catch (Exception e) { fail("Should not fail"); } } }
[FOCAL] public void SystemService.replaceAnchor(byte[] anchorBytes) [CLASS] class SystemService [METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void uploadAnchor(byte[] anchorBytes, boolean shouldVerifyAnchorInstance) [EXCEPTIONS] declares InvalidAnchorInstanceException, AnchorUplo...
/* static context [FOCAL] public void SystemService.replaceAnchor(byte[] anchorBytes) [EXCEPTIONS] declares InvalidAnchorInstanceException, AnchorUploadException, MalformedAnchorException, ConfigurationDownloadException, ConfigurationVerifier.ConfigurationVerificationException [CALLS-INTERNAL] void uploadAnchor(byte[] ...
/* static context [FOCAL] public void SystemService.replaceAnchor(byte[] anchorBytes) [EXCEPTIONS] declares InvalidAnchorInstanceException, AnchorUploadException, MalformedAnchorException, ConfigurationDownloadException, ConfigurationVerifier.ConfigurationVerificationException [CALLS-INTERNAL] void uploadAnchor(byte[] ...
true
ok
{"focal": {"class": "SystemService", "name": "replaceAnchor", "signature": "void replaceAnchor(byte[] anchorBytes) throws InvalidAnchorInstanceException, AnchorUploadException, MalformedAnchorException, ConfigurationDownloadExceptio...", "start_line": 3, "modifiers": "public", "params": [{"name": "anchorBytes", "type":...
134160731_57
class ExpressionConfigSourceInterceptor implements ConfigSourceInterceptor { @Override public ConfigValue getValue(final ConfigSourceInterceptorContext context, final String name) { return getValue(context, name, 1); } private ConfigValue getValue(final ConfigSourceInterceptorContext context, ...
SmallRyeConfig config = buildConfig("my.prop", "1234", "expression", "${my.prop}${my.prop}"); assertEquals("12341234", config.getValue("expression", String.class)); } }
[FOCAL] @Override public ConfigValue ExpressionConfigSourceInterceptor.getValue(ConfigSourceInterceptorContext context, String name) [CLASS] class ExpressionConfigSourceInterceptor implements ConfigSourceInterceptor [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] ConfigValue getVal...
/* static context [FOCAL] @Override public ConfigValue ExpressionConfigSourceInterceptor.getValue(ConfigSourceInterceptorContext context, String name) [INPUTS] branches=- | result=context, name [CALLS-INTERNAL] ConfigValue getValue(ConfigSourceInterceptorContext context, String name, int depth) */
/* static context [FOCAL] @Override public ConfigValue ExpressionConfigSourceInterceptor.getValue(ConfigSourceInterceptorContext context, String name) [INPUTS] branches=- | result=context, name [CALLS-INTERNAL] ConfigValue getValue(ConfigSourceInterceptorContext context, String name, int depth) */ class ExpressionConfi...
true
ok
{"focal": {"class": "ExpressionConfigSourceInterceptor", "name": "getValue", "signature": "ConfigValue getValue(ConfigSourceInterceptorContext context, String name)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "context", "type": "ConfigSourceInterceptorContext"}, {"name": "name", "type": "Str...
134287037_0
class WorkflowFacade { public <T extends DiagramElement> Optional<T> findDiagramElement(EObject semanticElement, Class<T> clazz) { return findDiagramElement(semanticElement).map(elem -> safeCast(elem, clazz)); } public WorkflowFacade(Resource coffeeResource, Resource notationResource); public Resource getSema...
Resource coffeeResource = loadResource("SuperBrewer3000.coffee"); Resource notationResource = loadResource("SuperBrewer3000.coffeenotation"); WorkflowFacade facade = new WorkflowFacade(coffeeResource, notationResource); Machine machine = (Machine) coffeeResource.getContents().get(0); Workflow workflow = mach...
[FOCAL] public Optional<T> WorkflowFacade.findDiagramElement(EObject semanticElement, Class<T> clazz) [CLASS] class WorkflowFacade [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Optional<DiagramElement> findDiagramElement(EObject semanticElement); T safeCast(Object obj, Class<T> c...
/* static context [FOCAL] public Optional<T> WorkflowFacade.findDiagramElement(EObject semanticElement, Class<T> clazz) [INPUTS] branches=- | result=clazz, semanticElement [CALLS-INTERNAL] Optional<DiagramElement> findDiagramElement(EObject semanticElement); T safeCast(Object obj, Class<T> clazz) [CALLS-EXTERNAL] findD...
/* static context [FOCAL] public Optional<T> WorkflowFacade.findDiagramElement(EObject semanticElement, Class<T> clazz) [INPUTS] branches=- | result=clazz, semanticElement [CALLS-INTERNAL] Optional<DiagramElement> findDiagramElement(EObject semanticElement); T safeCast(Object obj, Class<T> clazz) [CALLS-EXTERNAL] findD...
true
ok
{"focal": {"class": "WorkflowFacade", "name": "findDiagramElement", "signature": "Optional<T> findDiagramElement(EObject semanticElement, Class<T> clazz)", "start_line": 3, "modifiers": "public", "params": [{"name": "semanticElement", "type": "EObject"}, {"name": "clazz", "type": "Class<T>"}], "return_type": "Optional<...
134362666_15
class RMap extends RCollection { public void putTTL(String key, String mkey, byte[] value, int ttl) throws KitDBException { byte[] mkey_b = mkey.getBytes(charset); checkTxStart(); try (CloseLock ignored = checkClose()) { byte[] key_b = getKey(key); LockEntity lockEnt...
String head = "putTTL0"; RMap map = db.getMap(); int num = 10 * 10000; try { log.debug("start"); for (int i = 0; i < num; i++) { map.putTTL(head, "hello" + i, ("world" + i).getBytes(), 4); if (i == num - 10) { T...
[FOCAL] public void RMap.putTTL(String key, String mkey, byte[] value, int ttl) [CLASS] class RMap extends RCollection [METRICS] loc=51 cc=7 branches=4 loops=0 returns=0 throws=1 nesting=4 [CALLS-INTERNAL] Meta addCheck(byte[] key_b, byte[] k_v); byte[] getKey(String key) [CALLS-EXTERNAL] String.getBytes/1, checkTxStar...
/* static context [FOCAL] public void RMap.putTTL(String key, String mkey, byte[] value, int ttl) [THROWS-WHEN] e when try-body throws [PATH1] if(ttl != -1)#1=T -> if(metaV != null)=T -> if(ttl != -1)#2=T -> if(metaV.getTimestamp() != -1)=T [PATH2] if(ttl != -1)#1=F -> if(metaV != null)=F -> if(metaV.getTimestamp() != ...
/* static context [FOCAL] public void RMap.putTTL(String key, String mkey, byte[] value, int ttl) [THROWS-WHEN] e when try-body throws [PATH1] if(ttl != -1)#1=T -> if(metaV != null)=T -> if(ttl != -1)#2=T -> if(metaV.getTimestamp() != -1)=T [PATH2] if(ttl != -1)#1=F -> if(metaV != null)=F -> if(metaV.getTimestamp() != ...
true
ok
{"focal": {"class": "RMap", "name": "putTTL", "signature": "void putTTL(String key, String mkey, byte[] value, int ttl) throws KitDBException", "start_line": 3, "modifiers": "public", "params": [{"name": "key", "type": "String"}, {"name": "mkey", "type": "String"}, {"name": "value", "type": "byte[]"}, {"name": "ttl", "...
134390462_249
class BasicSoundPlayer implements Runnable, SoundPlayer { @Override public AudioInputStream getAudioStream() { return this.audioStream; } protected BasicSoundPlayer(byte[] audioData, AudioFormat format, int loopCount); @Override public void run(); private void runListener(); @Override public void start(); ...
byte[] in = new byte[getFormat().getFrameSize() * 100]; byte[] out = new byte[in.length]; fillBuffer(in); BasicSoundPlayer player = new BasicSoundPlayer(in, getFormat(), 1); try (AudioInputStream ais = player.getAudioStream()) { player.start(); int amount = readAll(out, ais); Assertions.assertEqu...
[FOCAL] @Override public AudioInputStream BasicSoundPlayer.getAudioStream() [CLASS] class BasicSoundPlayer implements Runnable, SoundPlayer [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [FIELDS] read=audioStream [CLASS-MEMBERS] BasicSoundPlayer(byte[] audioData, AudioFormat format, int loopCount)...
/* static context [FOCAL] @Override public AudioInputStream BasicSoundPlayer.getAudioStream() [FIELDS] read=audioStream */
/* static context [FOCAL] @Override public AudioInputStream BasicSoundPlayer.getAudioStream() [FIELDS] read=audioStream */ class BasicSoundPlayer implements Runnable, SoundPlayer { @Override public AudioInputStream getAudioStream() { return this.audioStream; } protected BasicSoundPlayer(byte[] audioData, Audio...
true
ok
{"focal": {"class": "BasicSoundPlayer", "name": "getAudioStream", "signature": "AudioInputStream getAudioStream()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "AudioInputStream"}, "class_info": {"name": "BasicSoundPlayer", "kind": "class", "modifiers": "", "superclass": null, "interf...
134450682_60
class LinkageProblemCauseAnnotator { public static void annotate( ClassPathBuilder classPathBuilder, ClassPathResult rootResult, Iterable<LinkageProblem> linkageProblems) throws IOException { checkNotNull(classPathBuilder); checkNotNull(rootResult); checkNotNull(linkageProblems); ...
DependencyGraphBuilder dependencyGraphBuilder = new DependencyGraphBuilder( ImmutableList.of( "https://repo.spring.io/milestone", RepositoryUtility.CENTRAL.getUrl())); ClassPathBuilder classPathBuilderWithSpring = new ClassPathBuilder(dependencyGraphBuilder); // io.proj...
[FOCAL] public static void LinkageProblemCauseAnnotator.annotate(ClassPathBuilder classPathBuilder, ClassPathResult rootResult, Iterable<LinkageProblem> linkageProblems) [CLASS] class LinkageProblemCauseAnnotator [METRICS] loc=68 cc=7 branches=5 loops=1 returns=0 throws=0 nesting=4 [CALLS-EXTERNAL] checkNotNull/1 (inhe...
/* static context [FOCAL] public static void LinkageProblemCauseAnnotator.annotate(ClassPathBuilder classPathBuilder, ClassPathResult rootResult, Iterable<LinkageProblem> linkageProblems) [PATH1] foreach(LinkageProblem linkageProblem : linkageProblems)=T -> if(subtreeResult == null)=T -> if(entryInSubtree == null)=F ->...
/* static context [FOCAL] public static void LinkageProblemCauseAnnotator.annotate(ClassPathBuilder classPathBuilder, ClassPathResult rootResult, Iterable<LinkageProblem> linkageProblems) [PATH1] foreach(LinkageProblem linkageProblem : linkageProblems)=T -> if(subtreeResult == null)=T -> if(entryInSubtree == null)=F ->...
true
ok
{"focal": {"class": "LinkageProblemCauseAnnotator", "name": "annotate", "signature": "void annotate(ClassPathBuilder classPathBuilder, ClassPathResult rootResult, Iterable<LinkageProblem> linkageProblems) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "classPathBuilder", "type":...
134457882_12
class HashUtils { public static String byte2hex(byte[] byteArray) { StringBuilder sb = new StringBuilder(); for (byte b : byteArray) { sb.append(String.format("%02X", b)); } return sb.toString(); } public static byte[] getShaHash(String input); public static byte[] hashPassword(String pa...
byte[] byteArray = new byte[1]; byteArray[0] = -1; assertEquals("FF", HashUtils.byte2hex(byteArray)); } }
[FOCAL] public static String HashUtils.byte2hex(byte[] byteArray) [CLASS] class HashUtils [METRICS] loc=7 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] StringBuilder.append/1, String.format/2, StringBuilder.toString/0 [NEW] StringBuilder [PATH1] foreach(byte b : byteArray)=T -> exit loop -> retu...
/* static context [FOCAL] public static String HashUtils.byte2hex(byte[] byteArray) [PATH1] foreach(byte b : byteArray)=T -> exit loop -> return sb.toString() [PATH2] foreach(byte b : byteArray)=F -> return sb.toString() [INPUTS] branches=byteArray | result=- [NEW] StringBuilder [CALLS-EXTERNAL] StringBuilder.append/1,...
/* static context [FOCAL] public static String HashUtils.byte2hex(byte[] byteArray) [PATH1] foreach(byte b : byteArray)=T -> exit loop -> return sb.toString() [PATH2] foreach(byte b : byteArray)=F -> return sb.toString() [INPUTS] branches=byteArray | result=- [NEW] StringBuilder [CALLS-EXTERNAL] StringBuilder.append/1,...
true
ok
{"focal": {"class": "HashUtils", "name": "byte2hex", "signature": "String byte2hex(byte[] byteArray)", "start_line": 3, "modifiers": "public static", "params": [{"name": "byteArray", "type": "byte[]"}], "return_type": "String"}, "class_info": {"name": "HashUtils", "kind": "class", "modifiers": "", "superclass": null, "...
134469679_364
class RecordWriter { public static void putFromJson(final String json, final Record record) { final JsonObject jsonObject = gson.fromJson(json, JsonObject.class); // JSON data from CCL is presumed to be all upper-case final String recordNameUpper = record.getName().toUpperCase(Locale.getDef...
final String json = "{\"REPLY\":{\"VAR_LIST\":[{\"F8_FIELD\":987.654000},{\"F8_FIELD\":321.098000}]}}"; final Structure listStructure = mockStructure(F8_FIELD); final Field listField = mockField("VAR_LIST", DataType.DYNAMIC_LIST, listStructure); when(listField.getListSize()).thenReturn(...
[FOCAL] public static void RecordWriter.putFromJson(String json, Record record) [CLASS] class RecordWriter [METRICS] loc=9 cc=2 branches=1 loops=0 returns=0 throws=1 nesting=1 [CALLS-INTERNAL] void putFromJsonObject(JsonElement json, Record record) [CALLS-EXTERNAL] gson.fromJson/2, record.getName().toUpperCase/1, Recor...
/* static context [FOCAL] public static void RecordWriter.putFromJson(String json, Record record) [THROWS-WHEN] IllegalArgumentException when !jsonObject.has(recordNameUpper) [PATH1] if(!jsonObject.has(recordNameUpper))=T -> throw new IllegalArgumentException("JSON does not contain record " + reco... [PATH2] if(!jsonOb...
/* static context [FOCAL] public static void RecordWriter.putFromJson(String json, Record record) [THROWS-WHEN] IllegalArgumentException when !jsonObject.has(recordNameUpper) [PATH1] if(!jsonObject.has(recordNameUpper))=T -> throw new IllegalArgumentException("JSON does not contain record " + reco... [PATH2] if(!jsonOb...
true
ok
{"focal": {"class": "RecordWriter", "name": "putFromJson", "signature": "void putFromJson(String json, Record record)", "start_line": 3, "modifiers": "public static", "params": [{"name": "json", "type": "String"}, {"name": "record", "type": "Record"}], "return_type": "void"}, "class_info": {"name": "RecordWriter", "kin...
134503849_73
class SiteToSiteSender { public TransactionCompletion sendFiles() throws IOException { Transaction transaction = siteToSiteClient.createTransaction(TransferDirection.SEND); try { DataPacketDto.getDataPacketStream(input).forEachOrdered(d -> { try { tra...
DataPacketDto dataPacketDto = new DataPacketDto("test-data".getBytes(StandardCharsets.UTF_8)).putAttribute("key", "value"); objectMapper.writeValue(data, Arrays.stream(new DataPacketDto[]{dataPacketDto}).collect(Collectors.toList())); assertEquals(transactionCompletion, senderSupplier.get().send...
[FOCAL] public TransactionCompletion SiteToSiteSender.sendFiles() [CLASS] class SiteToSiteSender [METRICS] loc=20 cc=3 branches=1 loops=0 returns=1 throws=2 nesting=2 [CALLS-EXTERNAL] SiteToSiteClient.createTransaction/1, DataPacketDto.getDataPacketStream(input).forEachOrdered/1, DataPacketDto.getDataPacketStream/1, Tr...
/* static context [FOCAL] public TransactionCompletion SiteToSiteSender.sendFiles() [THROWS-WHEN] (IOException) cause when try-body throws && cause instanceof IOException [THROWS-WHEN] IOException when try-body throws && !(cause instanceof IOException) [PATH1] try-body throws -> if(cause instanceof IOException)=T -> th...
/* static context [FOCAL] public TransactionCompletion SiteToSiteSender.sendFiles() [THROWS-WHEN] (IOException) cause when try-body throws && cause instanceof IOException [THROWS-WHEN] IOException when try-body throws && !(cause instanceof IOException) [PATH1] try-body throws -> if(cause instanceof IOException)=T -> th...
true
ok
{"focal": {"class": "SiteToSiteSender", "name": "sendFiles", "signature": "TransactionCompletion sendFiles() throws IOException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "TransactionCompletion"}, "class_info": {"name": "SiteToSiteSender", "kind": "class", "modifiers": "", "superclass": null...
134537813_83
class BufferStreamApi extends BaseStreamApi implements NeovimBufferApi { @Override public CompletableFuture<Object> getVar(String name) { return sendWithGenericResponse( prepareMessage(GET_VAR).addArgument(name) ); } public BufferStreamApi(ReactiveRpcStreamer reactiveR...
// Happy case var varVal = "value"; assertNormalBehavior( () -> CompletableFuture.completedFuture(new ResponseMessage(1, null, varVal)), () -> bufferStreamApi.getVar("name"), request -> assertMethodAndArguments(request, NeovimBufferApi.GET_VAR, buf...
[FOCAL] @Override public CompletableFuture<Object> BufferStreamApi.getVar(String name) [CLASS] class BufferStreamApi extends BaseStreamApi implements NeovimBufferApi [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] RequestMessage.Builder prepareMessage(String name) [CALLS-EXTERNAL] ...
/* static context [FOCAL] @Override public CompletableFuture<Object> BufferStreamApi.getVar(String name) [INPUTS] branches=- | result=name [CALLS-INTERNAL] RequestMessage.Builder prepareMessage(String name) [CALLS-EXTERNAL] sendWithGenericResponse/1 (inherited), prepareMessage(GET_VAR).addArgument/1 */
/* static context [FOCAL] @Override public CompletableFuture<Object> BufferStreamApi.getVar(String name) [INPUTS] branches=- | result=name [CALLS-INTERNAL] RequestMessage.Builder prepareMessage(String name) [CALLS-EXTERNAL] sendWithGenericResponse/1 (inherited), prepareMessage(GET_VAR).addArgument/1 */ class BufferStre...
true
ok
{"focal": {"class": "BufferStreamApi", "name": "getVar", "signature": "CompletableFuture<Object> getVar(String name)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "name", "type": "String"}], "return_type": "CompletableFuture<Object>"}, "class_info": {"name": "BufferStreamApi", "kind": "class",...
134601948_44
class X509SvidValidator { public static void verifyChain( @NonNull final List<X509Certificate> chain, @NonNull final BundleSource<X509Bundle> x509BundleSource) throws CertificateException, BundleNotFoundException { val trustDomain = CertificateUtils.getTrustDomain(chain...
HashSet<X509Certificate> x509Authorities = new HashSet<>(); x509Authorities.add(otherRootCa.getCertificate()); val x509Bundle = new X509Bundle(TrustDomain.of("example.org"), x509Authorities); try { X509SvidValidator.verifyChain(chain, x509Bundle); fail("exception...
[FOCAL] public static void X509SvidValidator.verifyChain(List<X509Certificate> chain, BundleSource<X509Bundle> x509BundleSource) [CLASS] class X509SvidValidator [METRICS] loc=14 cc=2 branches=0 loops=0 returns=0 throws=1 nesting=1 [CALLS-EXTERNAL] CertificateUtils.getTrustDomain/1, BundleSource<X509Bundle>.getBundleFor...
/* static context [FOCAL] public static void X509SvidValidator.verifyChain(List<X509Certificate> chain, BundleSource<X509Bundle> x509BundleSource) [THROWS-WHEN] CertificateException when try-body throws [PATH1] try-body throws -> throw new CertificateException("Cert chain cannot be verified", e) [COLLABORATORS] param x...
/* static context [FOCAL] public static void X509SvidValidator.verifyChain(List<X509Certificate> chain, BundleSource<X509Bundle> x509BundleSource) [THROWS-WHEN] CertificateException when try-body throws [PATH1] try-body throws -> throw new CertificateException("Cert chain cannot be verified", e) [COLLABORATORS] param x...
true
ok
{"focal": {"class": "X509SvidValidator", "name": "verifyChain", "signature": "void verifyChain(List<X509Certificate> chain, BundleSource<X509Bundle> x509BundleSource) throws CertificateException, BundleNotFoundException", "start_line": 3, "modifiers": "public static", "params": [{"name": "chain", "type": "List<X509Cert...
134685359_4
class YamlSourceFormatter { public String format(String source) { return format(source, null); } public String format(String source, YamlSourceFormatterConfig config); private String appendOrphanedComments(String result, CommentsRescueContext context, SnakeYamlConfig internalConfig); priva...
/* prepare */ String source = "# I am line 1\napiVersion: v1\n# I am line 3\nkind: Pod\nmetadata:\n name: busybox-sleep"; String expected = "# I am line 1\napiVersion: v1\n# I am line 3\nkind: Pod\nmetadata:\n name: busybox-sleep"; /* execute */ String result = formatt...
[FOCAL] public String YamlSourceFormatter.format(String source) [CLASS] class YamlSourceFormatter [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String format(String source, YamlSourceFormatterConfig config) [INPUTS] branches=- | result=source [DATAFLOW] source@param->L2 [CLASS-ME...
/* static context [FOCAL] public String YamlSourceFormatter.format(String source) [INPUTS] branches=- | result=source [CALLS-INTERNAL] String format(String source, YamlSourceFormatterConfig config) */
/* static context [FOCAL] public String YamlSourceFormatter.format(String source) [INPUTS] branches=- | result=source [CALLS-INTERNAL] String format(String source, YamlSourceFormatterConfig config) */ class YamlSourceFormatter { public String format(String source) { return format(source, null); } ...
true
ok
{"focal": {"class": "YamlSourceFormatter", "name": "format", "signature": "String format(String source)", "start_line": 3, "modifiers": "public", "params": [{"name": "source", "type": "String"}], "return_type": "String"}, "class_info": {"name": "YamlSourceFormatter", "kind": "class", "modifiers": "", "superclass": null...
134724121_6
class AnnotationELPProcessor { static String buildNonBooleanOutcomeMessage(Object outcome, String expression) { return "Expression " + expression + " should evaluate to boolean but evaluated to " + (outcome == null? " null" : (outcome.getClass() + " " + outcome)); } public static Stri...
String msg = AnnotationELPProcessor.buildNonBooleanOutcomeMessage(null, "abc"); assertEquals("Expression abc should evaluate to boolean but evaluated to null", msg); } }
[FOCAL] static String AnnotationELPProcessor.buildNonBooleanOutcomeMessage(Object outcome, String expression) [CLASS] class AnnotationELPProcessor [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Object.getClass/0 [INPUTS] branches=- | result=expression, outcome [DATAFLOW] expressio...
/* static context [FOCAL] static String AnnotationELPProcessor.buildNonBooleanOutcomeMessage(Object outcome, String expression) [INPUTS] branches=- | result=expression, outcome [CALLS-EXTERNAL] Object.getClass/0 */
/* static context [FOCAL] static String AnnotationELPProcessor.buildNonBooleanOutcomeMessage(Object outcome, String expression) [INPUTS] branches=- | result=expression, outcome [CALLS-EXTERNAL] Object.getClass/0 */ class AnnotationELPProcessor { static String buildNonBooleanOutcomeMessage(Object outcome, String ex...
true
ok
{"focal": {"class": "AnnotationELPProcessor", "name": "buildNonBooleanOutcomeMessage", "signature": "String buildNonBooleanOutcomeMessage(Object outcome, String expression)", "start_line": 3, "modifiers": "static", "params": [{"name": "outcome", "type": "Object"}, {"name": "expression", "type": "String"}], "return_type...
134827539_27
class GattCallbackLogger implements LogControl { public void onServicesDiscovered(BluetoothGatt gatt, int status) { if (loggingEnabled) { final String methodName = "onServicesDiscovered()"; int index = 1; int max = 3; lo...
cut.setLoggingEnabled(false); cut.onServicesDiscovered(gatt, 1); verifyLogNotCalled(); cut.setLoggingEnabled(true); cut.onServicesDiscovered(gatt, 1); verifyLogEngine().log(Mockito.anyString()); } }
[FOCAL] public void GattCallbackLogger.onServicesDiscovered(BluetoothGatt gatt, int status) [CLASS] class GattCallbackLogger implements LogControl [METRICS] loc=17 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] void logDeviceInfo(BluetoothGatt gatt, String methodName, int position, int max); void...
/* static context [FOCAL] public void GattCallbackLogger.onServicesDiscovered(BluetoothGatt gatt, int status) [PATH1] if(loggingEnabled)=T [PATH2] if(loggingEnabled)=F [COLLABORATORS] field btStringMapper getServices/1 [CALLS-INTERNAL] void logDeviceInfo(BluetoothGatt gatt, String methodName, int position, int max); vo...
/* static context [FOCAL] public void GattCallbackLogger.onServicesDiscovered(BluetoothGatt gatt, int status) [PATH1] if(loggingEnabled)=T [PATH2] if(loggingEnabled)=F [COLLABORATORS] field btStringMapper getServices/1 [CALLS-INTERNAL] void logDeviceInfo(BluetoothGatt gatt, String methodName, int position, int max); vo...
true
ok
{"focal": {"class": "GattCallbackLogger", "name": "onServicesDiscovered", "signature": "void onServicesDiscovered(BluetoothGatt gatt, int status)", "start_line": 3, "modifiers": "public", "params": [{"name": "gatt", "type": "BluetoothGatt"}, {"name": "status", "type": "int"}], "return_type": "void"}, "class_info": {"na...
134843777_1
class PdfContentImagePreprocessor { public boolean removeImagesAlphaChannel(PDDocument document) { this.document = document; imagesWereChanged = false; try { removeImagesAlphaChannelUnsafe(); return imagesWereChanged; } catch (Exception e) { retur...
InputStream stream = AlterPDFParserTest.class.getResourceAsStream("/test-documents/transp_scanned.pdf"); PDDocument doc = PDDocument.load(stream); PdfContentImagePreprocessor preproc = new PdfContentImagePreprocessor(); boolean hasReplaced = preproc.removeImagesAlphaChannel(doc); ...
[FOCAL] public boolean PdfContentImagePreprocessor.removeImagesAlphaChannel(PDDocument document) [CLASS] class PdfContentImagePreprocessor [METRICS] loc=10 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] void removeImagesAlphaChannelUnsafe() [FIELDS] write=document [EXCEPTIONS] catches Exception e...
/* static context [FOCAL] public boolean PdfContentImagePreprocessor.removeImagesAlphaChannel(PDDocument document) [PATH1] try-body throws -> return false [PATH2] return imagesWereChanged [STATE] document [EXCEPTIONS] catches Exception e [CALLS-INTERNAL] void removeImagesAlphaChannelUnsafe() [FIELDS] write=document */
/* static context [FOCAL] public boolean PdfContentImagePreprocessor.removeImagesAlphaChannel(PDDocument document) [PATH1] try-body throws -> return false [PATH2] return imagesWereChanged [STATE] document [EXCEPTIONS] catches Exception e [CALLS-INTERNAL] void removeImagesAlphaChannelUnsafe() [FIELDS] write=document */ ...
true
ok
{"focal": {"class": "PdfContentImagePreprocessor", "name": "removeImagesAlphaChannel", "signature": "boolean removeImagesAlphaChannel(PDDocument document)", "start_line": 3, "modifiers": "public", "params": [{"name": "document", "type": "PDDocument"}], "return_type": "boolean"}, "class_info": {"name": "PdfContentImageP...
134900749_22
class OpenMetricsExporter implements Exporter { @Override public StringBuilder exportOneMetric(MetricRegistry.Type scope, MetricID metricID) { alreadyExportedNames.set(new HashSet<>()); MetricRegistry registry = MetricRegistries.get(scope); Map<MetricID, Metric> metricMap = registry.get...
OpenMetricsExporter exporter = new OpenMetricsExporter(); MetricRegistry baseRegistry = MetricRegistries.get(MetricRegistry.Type.BASE); Gauge gauge = new MGaugeImpl(JmxWorker.instance(), "java.lang:type=Runtime/Uptime"); Metadata metadata = new ExtendedMetadata("jvm.uptime", "display na...
[FOCAL] @Override public StringBuilder OpenMetricsExporter.exportOneMetric(MetricRegistry.Type scope, MetricID metricID) [CLASS] class OpenMetricsExporter implements Exporter [METRICS] loc=16 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] void exposeEntries(MetricRegistry.Type scope, StringBuilde...
/* static context [FOCAL] @Override public StringBuilder OpenMetricsExporter.exportOneMetric(MetricRegistry.Type scope, MetricID metricID) [COLLABORATORS] field alreadyExportedNames set/1 [CALLS-INTERNAL] void exposeEntries(MetricRegistry.Type scope, StringBuilder sb, MetricRegistry registry, Map<MetricID, Metric> metr...
/* static context [FOCAL] @Override public StringBuilder OpenMetricsExporter.exportOneMetric(MetricRegistry.Type scope, MetricID metricID) [COLLABORATORS] field alreadyExportedNames set/1 [CALLS-INTERNAL] void exposeEntries(MetricRegistry.Type scope, StringBuilder sb, MetricRegistry registry, Map<MetricID, Metric> metr...
true
ok
{"focal": {"class": "OpenMetricsExporter", "name": "exportOneMetric", "signature": "StringBuilder exportOneMetric(MetricRegistry.Type scope, MetricID metricID)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "scope", "type": "MetricRegistry.Type"}, {"name": "metricID", "type": "MetricID"}], "ret...
134901201_9
class FilteredIndexView implements IndexView { public boolean accepts(DotName className) { final boolean accept; final MatchHandler match = new MatchHandler(className); if (match.isQualifiedNameExcluded()) { /* * A FQCN or pattern that *fully* matched the FQCN was ...
Map<String, Object> properties = new HashMap<>(); properties.put(OASConfig.SCAN_CLASSES, "(?:pkgA.My(Bean|Class))$"); properties.put(OASConfig.SCAN_EXCLUDE_PACKAGES, "com.example"); OpenApiConfig config = IndexScannerTestBase.dynamicConfig(properties); FilteredIndexView view = ne...
[FOCAL] public boolean FilteredIndexView.accepts(DotName className) [CLASS] class FilteredIndexView implements IndexView [METRICS] loc=59 cc=8 branches=7 loops=0 returns=1 throws=0 nesting=7 [CALLS-EXTERNAL] MatchHandler.isQualifiedNameExcluded/0, MatchHandler.isQualifiedNameIncluded/0, MatchHandler.isSimpleNameExclude...
/* static context [FOCAL] public boolean FilteredIndexView.accepts(DotName className) [PATH1] if(match.isQualifiedNameExcluded())=F -> if(match.isQualifiedNameIncluded())=F -> if(match.isSimpleNameExcluded())=F -> if(match.isSimpleNameIncluded())=F -> if(match.isPackageExcluded())=F -> if(match.isPackageIncluded())=F -...
/* static context [FOCAL] public boolean FilteredIndexView.accepts(DotName className) [PATH1] if(match.isQualifiedNameExcluded())=F -> if(match.isQualifiedNameIncluded())=F -> if(match.isSimpleNameExcluded())=F -> if(match.isSimpleNameIncluded())=F -> if(match.isPackageExcluded())=F -> if(match.isPackageIncluded())=F -...
true
ok
{"focal": {"class": "FilteredIndexView", "name": "accepts", "signature": "boolean accepts(DotName className)", "start_line": 3, "modifiers": "public", "params": [{"name": "className", "type": "DotName"}], "return_type": "boolean"}, "class_info": {"name": "FilteredIndexView", "kind": "class", "modifiers": "", "superclas...
134973177_0
class StringUtil { @Nullable public static String compressText(String text) { String repeatedSequence = ""; int maxRepeat = 0; String[] split = text.split("\n"); for (String s1 : split) { int repeat = 0; for (String s2 : split) { if (!""....
Assert.assertEquals("【悲報】", StringUtil.compressText("【悲報】\n【悲報】\n【悲報】\n【悲報】")); Assert.assertEquals("【悲報】", StringUtil.compressText("【悲報】 \n【悲報】\n【悲報】 \n【悲報】 ")); Assert.assertNull(StringUtil.compressText("【悲報】\n【悲報】\n【悲報】")); Assert.assertEquals("[゚д゚]", StringUtil.compressText("[...
[FOCAL] @Nullable public static String StringUtil.compressText(String text) [CLASS] class StringUtil [METRICS] loc=23 cc=6 branches=3 loops=2 returns=2 throws=0 nesting=3 [CALLS-EXTERNAL] String.split/1, "".equals/1, String.trim/0, s1.trim().equals/1, Math.max/2 [PATH1] foreach(String s1 : split)=T -> foreach(String s2...
/* static context [FOCAL] @Nullable public static String StringUtil.compressText(String text) [PATH1] foreach(String s1 : split)=T -> foreach(String s2 : split)=T -> if(!"".equals(s2.trim()) && s1.trim().equals(s2.trim()))=T -> exit loop -> if((maxRepeat = Math.max(maxRepeat, repeat)) == repeat)=T -> exit loop -> if(ma...
/* static context [FOCAL] @Nullable public static String StringUtil.compressText(String text) [PATH1] foreach(String s1 : split)=T -> foreach(String s2 : split)=T -> if(!"".equals(s2.trim()) && s1.trim().equals(s2.trim()))=T -> exit loop -> if((maxRepeat = Math.max(maxRepeat, repeat)) == repeat)=T -> exit loop -> if(ma...
true
ok
{"focal": {"class": "StringUtil", "name": "compressText", "signature": "String compressText(String text)", "start_line": 3, "modifiers": "@Nullable public static", "params": [{"name": "text", "type": "String"}], "return_type": "String"}, "class_info": {"name": "StringUtil", "kind": "class", "modifiers": "", "superclass...
135174794_16
class SlangSensor implements Sensor { @Override public void execute(SensorContext sensorContext) { DurationStatistics statistics = new DurationStatistics(sensorContext.config()); FileSystem fileSystem = sensorContext.fileSystem(); FilePredicate mainFilePredicate = fileSystem.predicates().and( fil...
InputFile inputFile = createInputFile("file1.slang", "" + "fun f() { print(\"string literal\"); print(\"string literal\"); print(\"string literal\"); }"); context.fileSystem().add(inputFile); CheckFactory checkFactory = checkFactory("S1192"); sensor(checkFactory).execute(context); Collection<I...
[FOCAL] @Override public void SlangSensor.execute(SensorContext sensorContext) [CLASS] class SlangSensor implements Sensor [METRICS] loc=25 cc=3 branches=1 loops=0 returns=0 throws=0 nesting=2 [CALLS-INTERNAL] ASTConverter astConverter(SensorContext sensorContext); List<TreeVisitor<InputFileContext>> visitors(SensorCon...
/* static context [FOCAL] @Override public void SlangSensor.execute(SensorContext sensorContext) [PATH1] try-body throws -> if(success)=T [PATH2] if(success)=F [INPUTS] branches=sensorContext | result=- [COLLABORATORS] param sensorContext:SensorContext config/0,fileSystem/0; field language getKey/0,getName/0 [CALLS-INT...
/* static context [FOCAL] @Override public void SlangSensor.execute(SensorContext sensorContext) [PATH1] try-body throws -> if(success)=T [PATH2] if(success)=F [INPUTS] branches=sensorContext | result=- [COLLABORATORS] param sensorContext:SensorContext config/0,fileSystem/0; field language getKey/0,getName/0 [CALLS-INT...
true
ok
{"focal": {"class": "SlangSensor", "name": "execute", "signature": "void execute(SensorContext sensorContext)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "sensorContext", "type": "SensorContext"}], "return_type": "void"}, "class_info": {"name": "SlangSensor", "kind": "class", "modifiers": ""...
135205277_5
class DispatchManager extends Thread { public synchronized void subscribe(String name, DispatchChannel dispatchChannel) { Optional<DispatchChannel> previous = Optional.fromNullable(subscriptions.get(name)); subscriptions.put(name, dispatchChannel); try { pubSubConnection.subscribe(name); } cat...
DispatchChannel fooChannel = mock(DispatchChannel.class); DispatchChannel barChannel = mock(DispatchChannel.class); dispatchManager.subscribe("foo", fooChannel); dispatchManager.subscribe("bar", barChannel); pubSubReplyInputStream.write(new PubSubReply(PubSubReply.Type.SUBSCRIBE, "foo", Optional.<...
[FOCAL] public synchronized void DispatchManager.subscribe(String name, DispatchChannel dispatchChannel) [CLASS] class DispatchManager extends Thread [METRICS] loc=14 cc=3 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] void dispatchUnsubscription(String name, DispatchChannel channel) [CALLS-EXTERNAL] ...
/* static context [FOCAL] public synchronized void DispatchManager.subscribe(String name, DispatchChannel dispatchChannel) [PATH1] try-body throws -> if(previous.isPresent())=T [PATH2] if(previous.isPresent())=F [INPUTS] branches=name | result=- [COLLABORATORS] field subscriptions get/1,put/2; field pubSubConnection:Pu...
/* static context [FOCAL] public synchronized void DispatchManager.subscribe(String name, DispatchChannel dispatchChannel) [PATH1] try-body throws -> if(previous.isPresent())=T [PATH2] if(previous.isPresent())=F [INPUTS] branches=name | result=- [COLLABORATORS] field subscriptions get/1,put/2; field pubSubConnection:Pu...
true
ok
{"focal": {"class": "DispatchManager", "name": "subscribe", "signature": "void subscribe(String name, DispatchChannel dispatchChannel)", "start_line": 3, "modifiers": "public synchronized", "params": [{"name": "name", "type": "String"}, {"name": "dispatchChannel", "type": "DispatchChannel"}], "return_type": "void"}, "c...
135256100_4
class CssRuleSensor implements Sensor { @Override public void execute(SensorContext context) { reportOldNodeProperty(context); List<InputFile> inputFiles = getInputFiles(context); if (inputFiles.isEmpty()) { LOG.info("No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is ski...
addInputFile("invalid-json-response.css"); sensor.execute(context); assertThat(String.join("\n", logTester.logs(LoggerLevel.DEBUG))) .contains("Failed to parse response"); assertThat(String.join("\n", logTester.logs(LoggerLevel.ERROR))) .contains("Failure during CSS analysis"); } }
[FOCAL] @Override public void CssRuleSensor.execute(SensorContext context) [CLASS] class CssRuleSensor implements Sensor [METRICS] loc=27 cc=4 branches=2 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] File createLinterConfig(SensorContext context); List<InputFile> getInputFiles(SensorContext context); void analy...
/* static context [FOCAL] @Override public void CssRuleSensor.execute(SensorContext context) [PATH1] if(inputFiles.isEmpty())=F -> try-body throws -> if(serverRunning && configFile != null)=T [PATH2] if(inputFiles.isEmpty())=T -> return [PATH3] if(inputFiles.isEmpty())=F -> if(serverRunning && configFile != null)=F [IN...
/* static context [FOCAL] @Override public void CssRuleSensor.execute(SensorContext context) [PATH1] if(inputFiles.isEmpty())=F -> try-body throws -> if(serverRunning && configFile != null)=T [PATH2] if(inputFiles.isEmpty())=T -> return [PATH3] if(inputFiles.isEmpty())=F -> if(serverRunning && configFile != null)=F [IN...
true
ok
{"focal": {"class": "CssRuleSensor", "name": "execute", "signature": "void execute(SensorContext context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "context", "type": "SensorContext"}], "return_type": "void"}, "class_info": {"name": "CssRuleSensor", "kind": "class", "modifiers": "", "super...
135262635_18
class RSQLQueryDslSupport extends RSQLJPASupport { public static BooleanExpression toPredicate(final String rsqlQuery, final Path qClazz) { return toPredicate(rsqlQuery, qClazz, null); } public RSQLQueryDslSupport(); public RSQLQueryDslSupport(Map<String, EntityManager> entityManagerMap); public static Bool...
String rsql = "name=notlike='ber'"; List<User> users = (List<User>) userRepository.findAll(toPredicate(rsql, QUser.user)); long count = users.size(); log.info("rsql: {} -> count: {}", rsql, count); assertThat(rsql, count, is(8l)); rsql = "company.name=notlike='Inc'"; users = (List<User>) userRepository.f...
[FOCAL] public static BooleanExpression RSQLQueryDslSupport.toPredicate(String rsqlQuery, Path qClazz) [CLASS] class RSQLQueryDslSupport extends RSQLJPASupport [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] BooleanExpression toPredicate(String rsqlQuery, Path qClazz, Map<String, S...
/* static context [FOCAL] public static BooleanExpression RSQLQueryDslSupport.toPredicate(String rsqlQuery, Path qClazz) [INPUTS] branches=- | result=qClazz, rsqlQuery [CALLS-INTERNAL] BooleanExpression toPredicate(String rsqlQuery, Path qClazz, Map<String, String> propertyPathMapper) */
/* static context [FOCAL] public static BooleanExpression RSQLQueryDslSupport.toPredicate(String rsqlQuery, Path qClazz) [INPUTS] branches=- | result=qClazz, rsqlQuery [CALLS-INTERNAL] BooleanExpression toPredicate(String rsqlQuery, Path qClazz, Map<String, String> propertyPathMapper) */ class RSQLQueryDslSupport exten...
true
ok
{"focal": {"class": "RSQLQueryDslSupport", "name": "toPredicate", "signature": "BooleanExpression toPredicate(String rsqlQuery, Path qClazz)", "start_line": 3, "modifiers": "public static", "params": [{"name": "rsqlQuery", "type": "String"}, {"name": "qClazz", "type": "Path"}], "return_type": "BooleanExpression"}, "cla...
135270285_2
class FileUtil { public static BufferedWriter asBufferedWriter(String fileName) throws IOException { Validate.notBlank(fileName, "filename is blank"); return Files.newBufferedWriter(getPath(fileName), Charsets.UTF_8); } public static byte[] toByteArray(final File file); public static String toString(final Fil...
Path tempPath = FileUtil.createTempFile(); try (BufferedWriter bw = FileUtil.asBufferedWriter(tempPath.toString())) { assertThat(bw).isNotNull(); } try (BufferedWriter bw = FileUtil.asBufferedWriter(tempPath)) { assertThat(bw).isNotNull(); } } }
[FOCAL] public static BufferedWriter FileUtil.asBufferedWriter(String fileName) [CLASS] class FileUtil [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Path getPath(String filePath) [CALLS-EXTERNAL] Validate.notBlank/2, Files.newBufferedWriter/2 [EXCEPTIONS] declares IOException [IN...
/* static context [FOCAL] public static BufferedWriter FileUtil.asBufferedWriter(String fileName) [INPUTS] branches=- | result=fileName [EXCEPTIONS] declares IOException [CALLS-INTERNAL] Path getPath(String filePath) [CALLS-EXTERNAL] Validate.notBlank/2, Files.newBufferedWriter/2 */
/* static context [FOCAL] public static BufferedWriter FileUtil.asBufferedWriter(String fileName) [INPUTS] branches=- | result=fileName [EXCEPTIONS] declares IOException [CALLS-INTERNAL] Path getPath(String filePath) [CALLS-EXTERNAL] Validate.notBlank/2, Files.newBufferedWriter/2 */ class FileUtil { public static Buf...
true
ok
{"focal": {"class": "FileUtil", "name": "asBufferedWriter", "signature": "BufferedWriter asBufferedWriter(String fileName) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "fileName", "type": "String"}], "return_type": "BufferedWriter"}, "class_info": {"name": "FileUtil", "kind": ...
135332674_4
class DecrypterManager { public synchronized void decryptSaved(CapillaryHandler handler, Object extra) { List<byte[]> ciphertexts = ciphertextStorage.get(); ciphertextStorage.clear(); for (byte[] data : ciphertexts) { decrypt(data, handler, extra); } } DecrypterManager( Context con...
// Lock the screen. when(utils.isScreenLocked(context)).thenReturn(true); // No saved ciphertexts. decrypterManager.decryptSaved(handler, extra); verifyZeroInteractions(handler); // Save ciphertexts. int ciphertextCount = 10; ciphertextBuilder.setIsAuthKey(true); byte[] ciphertextB...
[FOCAL] public synchronized void DecrypterManager.decryptSaved(CapillaryHandler handler, Object extra) [CLASS] class DecrypterManager [METRICS] loc=7 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] void decrypt(byte[] ciphertext, CapillaryHandler handler, Object extra) [CALLS-EXTERNAL] CiphertextS...
/* static context [FOCAL] public synchronized void DecrypterManager.decryptSaved(CapillaryHandler handler, Object extra) [PATH1] foreach(byte[] data : ciphertexts)=T -> exit loop [PATH2] foreach(byte[] data : ciphertexts)=F [INPUTS] branches=ciphertextStorage | result=- [COLLABORATORS] field ciphertextStorage:Ciphertex...
/* static context [FOCAL] public synchronized void DecrypterManager.decryptSaved(CapillaryHandler handler, Object extra) [PATH1] foreach(byte[] data : ciphertexts)=T -> exit loop [PATH2] foreach(byte[] data : ciphertexts)=F [INPUTS] branches=ciphertextStorage | result=- [COLLABORATORS] field ciphertextStorage:Ciphertex...
true
ok
{"focal": {"class": "DecrypterManager", "name": "decryptSaved", "signature": "void decryptSaved(CapillaryHandler handler, Object extra)", "start_line": 3, "modifiers": "public synchronized", "params": [{"name": "handler", "type": "CapillaryHandler"}, {"name": "extra", "type": "Object"}], "return_type": "void"}, "class_...
135337255_5
class OrderBook { public SortedSet<WorkingOrder> findMatches(WorkingOrder order) { // Matching only compares price on the opposite side, not entry time MatchingOrderDecorator compare = new MatchingOrderDecorator(order, order.getSource()); SortedSet<WorkingOrder> matches = null; switch (order.getSide(...
Instant entryTime1 = clock.instant(); final WorkingOrder order1 = new WorkingOrder( new TestOrder("C1", symbol, Side.Sell, 3, OrdType.Limit, new BigDecimal("12.95")), userId, "Order" + 1, entryTime1); orderBook.addOrder(order1); Instant entryTime2 = clock.instant(); final WorkingOrd...
[FOCAL] public SortedSet<WorkingOrder> OrderBook.findMatches(WorkingOrder order) [CLASS] class OrderBook [METRICS] loc=16 cc=3 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] WorkingOrder.getSource/0, WorkingOrder.getSide/0, offers.headSet/2, bids.headSet/2 [NEW] MatchingOrderDecorator, IllegalArgument...
/* static context [FOCAL] public SortedSet<WorkingOrder> OrderBook.findMatches(WorkingOrder order) [THROWS-WHEN] IllegalArgumentException when switch(order.getSide())=default [PATH1] switch(order.getSide())=case Buy -> return matches [PATH2] switch(order.getSide())=default -> throw new IllegalArgumentException("Invalid...
/* static context [FOCAL] public SortedSet<WorkingOrder> OrderBook.findMatches(WorkingOrder order) [THROWS-WHEN] IllegalArgumentException when switch(order.getSide())=default [PATH1] switch(order.getSide())=case Buy -> return matches [PATH2] switch(order.getSide())=default -> throw new IllegalArgumentException("Invalid...
true
ok
{"focal": {"class": "OrderBook", "name": "findMatches", "signature": "SortedSet<WorkingOrder> findMatches(WorkingOrder order)", "start_line": 3, "modifiers": "public", "params": [{"name": "order", "type": "WorkingOrder"}], "return_type": "SortedSet<WorkingOrder>"}, "class_info": {"name": "OrderBook", "kind": "class", "...
135401010_56
class DefaultObjectFactory implements ObjectFactory, Serializable { @Override public <T> T create(Class<T> type) { return create(type, null, null); } @SuppressWarnings("unchecked") @Override public T create(Class<T> type, List<Class<?>> constructorArgTypes, List<Object> constructorArgs); @Override publi...
DefaultObjectFactory defaultObjectFactory = new DefaultObjectFactory(); SortedSet sortedSet = defaultObjectFactory.create(SortedSet.class); Assert.assertTrue(" sortedSet should be TreeSet", sortedSet instanceof TreeSet); } }
[FOCAL] @Override public T DefaultObjectFactory.create(Class<T> type) [CLASS] class DefaultObjectFactory implements ObjectFactory, Serializable [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] T create(Class<T> type, List<Class<?>> constructorArgTypes, List<Object> constructorArgs) ...
/* static context [FOCAL] @Override public T DefaultObjectFactory.create(Class<T> type) [INPUTS] branches=- | result=type [CALLS-INTERNAL] T create(Class<T> type, List<Class<?>> constructorArgTypes, List<Object> constructorArgs) */
/* static context [FOCAL] @Override public T DefaultObjectFactory.create(Class<T> type) [INPUTS] branches=- | result=type [CALLS-INTERNAL] T create(Class<T> type, List<Class<?>> constructorArgTypes, List<Object> constructorArgs) */ class DefaultObjectFactory implements ObjectFactory, Serializable { @Override publi...
true
ok
{"focal": {"class": "DefaultObjectFactory", "name": "create", "signature": "T create(Class<T> type)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "type", "type": "Class<T>"}], "return_type": "T"}, "class_info": {"name": "DefaultObjectFactory", "kind": "class", "modifiers": "", "superclass": nu...
135418301_0
class Parse { public static HashMap<String, Integer> parseJ48(String treeResult) { HashMap<String, Integer> hm = new HashMap<String, Integer>(); //Split the string at each new line char (Regex to take into account different line end chars depending on OS) String[] lines = treeResult.spl...
System.out.println("parseJ48"); String treeResult = "J48 pruned tree\r\n------------------\r\n\r\n" + "GP: physician-fee-freeze = n: democrat (253.41/3.75)\r\n" + "GP: physician-fee-freeze = y\r\n" + "| GP: synfuels-corporation-cutback = n: republican (145.71/4.0)\r...
[FOCAL] public static HashMap<String, Integer> Parse.parseJ48(String treeResult) [CLASS] class Parse [METRICS] loc=30 cc=4 branches=2 loops=1 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] int countOccurrences(String string, char ch) [CALLS-EXTERNAL] String.split/1, String.matches/1, HashMap<String, Integer>.put/2, line...
/* static context [FOCAL] public static HashMap<String, Integer> Parse.parseJ48(String treeResult) [PATH1] foreach(String line : lines)=T -> if(line.matches("[\\|\\ ]*GP:\\ [\\x20-\\x7E]+"))=T -> if(level == 0)=T -> exit loop -> return hm [PATH2] foreach(String line : lines)=F -> return hm [PATH3] foreach(String line :...
/* static context [FOCAL] public static HashMap<String, Integer> Parse.parseJ48(String treeResult) [PATH1] foreach(String line : lines)=T -> if(line.matches("[\\|\\ ]*GP:\\ [\\x20-\\x7E]+"))=T -> if(level == 0)=T -> exit loop -> return hm [PATH2] foreach(String line : lines)=F -> return hm [PATH3] foreach(String line :...
true
ok
{"focal": {"class": "Parse", "name": "parseJ48", "signature": "HashMap<String, Integer> parseJ48(String treeResult)", "start_line": 3, "modifiers": "public static", "params": [{"name": "treeResult", "type": "String"}], "return_type": "HashMap<String, Integer>"}, "class_info": {"name": "Parse", "kind": "class", "modifie...
135513706_41
class ChordStructureGenerator implements IChordStructureGenerator { public List<ProgressionType> getProgressionTypes(QueueItem queueItem) { List<ProgressionType> progressionTypes = new ArrayList<ProgressionType>(); for (ProgressionUnit progressionUnit : queueItem.getProgression().getStructure()) ...
setupTest(); List<ProgressionUnit.ProgressionType> progressionTypes = chordStructureGenerator.getProgressionTypes(mQueueItem); List<ProgressionUnit.ProgressionType> expected = new ArrayList<ProgressionUnit.ProgressionType>(); expected.add(ProgressionUnit.ProgressionType.VERSE); ...
[FOCAL] public List<ProgressionType> ChordStructureGenerator.getProgressionTypes(QueueItem queueItem) [CLASS] class ChordStructureGenerator implements IChordStructureGenerator [METRICS] loc=13 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] queueItem.getProgression().getStructure/0, QueueItem.getP...
/* static context [FOCAL] public List<ProgressionType> ChordStructureGenerator.getProgressionTypes(QueueItem queueItem) [PATH1] foreach(ProgressionUnit progressionUnit : queueItem.getProgression().getStructure())=T -> if(!progressionTypes.contains(progressionUnit.getType()))=T -> exit loop -> return progressionTypes [P...
/* static context [FOCAL] public List<ProgressionType> ChordStructureGenerator.getProgressionTypes(QueueItem queueItem) [PATH1] foreach(ProgressionUnit progressionUnit : queueItem.getProgression().getStructure())=T -> if(!progressionTypes.contains(progressionUnit.getType()))=T -> exit loop -> return progressionTypes [P...
true
ok
{"focal": {"class": "ChordStructureGenerator", "name": "getProgressionTypes", "signature": "List<ProgressionType> getProgressionTypes(QueueItem queueItem)", "start_line": 3, "modifiers": "public", "params": [{"name": "queueItem", "type": "QueueItem"}], "return_type": "List<ProgressionType>"}, "class_info": {"name": "Ch...
135566897_8
class AbstractAnsibleRulesDefinition implements RulesDefinition { protected abstract String getRuleDefinitionPath()protected abstract String getRuleDefinitionPath(); protected abstract String getRuleDefinitionPath()@Override public void define(RulesDefinition.Context context); protected abstract String getRuleDefinit...
AbstractAnsibleRulesDefinition definition = new AnsibleExtraRulesDefinition(); assertEquals("org/sonar/l10n/ansible/rules/ansible-extras", definition.getRuleDefinitionPath()); testDefineWithExistingRules(definition, true); } }
[FOCAL] protected abstract String AbstractAnsibleRulesDefinition.getRuleDefinitionPath() [CLASS] class AbstractAnsibleRulesDefinition implements RulesDefinition [METRICS] loc=1 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CLASS-MEMBERS] void define(RulesDefinition.Context context); List<String> getRuleKeys(); ...
/* static context [FOCAL] protected abstract String AbstractAnsibleRulesDefinition.getRuleDefinitionPath() */
/* static context [FOCAL] protected abstract String AbstractAnsibleRulesDefinition.getRuleDefinitionPath() */ class AbstractAnsibleRulesDefinition implements RulesDefinition { protected abstract String getRuleDefinitionPath()protected abstract String getRuleDefinitionPath(); protected abstract String getRuleDefinitio...
true
partial
{"focal": {"class": "AbstractAnsibleRulesDefinition", "name": "getRuleDefinitionPath", "signature": "String getRuleDefinitionPath()", "start_line": 3, "modifiers": "protected abstract", "params": [], "return_type": "String"}, "class_info": {"name": "AbstractAnsibleRulesDefinition", "kind": "class", "modifiers": "", "su...
135579677_293
class BooleanResponse extends FFDCResponseBase { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof BooleanResponse)) { return false; } if (!...
Map<String, Object> propertyMap; BooleanResponse testObject = new BooleanResponse(); assertTrue(testObject.getExceptionProperties() == null); propertyMap = null; testObject = new BooleanResponse(); testObject.setExceptionProperties(propertyMap); assertT...
[FOCAL] @Override public boolean BooleanResponse.equals(Object objectToCompare) [CLASS] class BooleanResponse extends FFDCResponseBase [METRICS] loc=19 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=1 [CALLS-INTERNAL] boolean isFlag() [CALLS-EXTERNAL] FFDCResponseBase.equals/1, BooleanResponse.isFlag/0 [PATH1] if(t...
/* static context [FOCAL] @Override public boolean BooleanResponse.equals(Object objectToCompare) [PATH1] if(this == objectToCompare)=F -> if(!(objectToCompare instanceof BooleanResponse))=F -> if(!super.equals(objectToCompare))=T -> return false [PATH2] if(this == objectToCompare)=T -> return true [PATH3] if(this == o...
/* static context [FOCAL] @Override public boolean BooleanResponse.equals(Object objectToCompare) [PATH1] if(this == objectToCompare)=F -> if(!(objectToCompare instanceof BooleanResponse))=F -> if(!super.equals(objectToCompare))=T -> return false [PATH2] if(this == objectToCompare)=T -> return true [PATH3] if(this == o...
true
ok
{"focal": {"class": "BooleanResponse", "name": "equals", "signature": "boolean equals(Object objectToCompare)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "objectToCompare", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "BooleanResponse", "kind": "class", "modifiers": ...
135676228_1
class BaseConfigurationFactory implements ConfigurationFactory<T, U> { @Override public Pair<T, U> build(ConfigurationSourceProvider provider, String path) throws IOException, ConfigurationException { try (InputStream input = provider.open(requireNonNull(path))) { final JsonNode node = obje...
try { factory.build(emptyFile); failBecauseExceptionWasNotThrown(ConfigurationParsingException.class); } catch (ConfigurationParsingException e) { assertThat(e.getMessage()) .containsOnlyOnce(" * GJEXConfiguration at " + emptyFile.toString() + " mu...
[FOCAL] @Override public Pair<T, U> BaseConfigurationFactory.build(ConfigurationSourceProvider provider, String path) [CLASS] class BaseConfigurationFactory implements ConfigurationFactory<T, U> [METRICS] loc=19 cc=3 branches=1 loops=0 returns=1 throws=2 nesting=2 [CALLS-INTERNAL] JsonParser createParser(InputStream in...
/* static context [FOCAL] @Override public Pair<T, U> BaseConfigurationFactory.build(ConfigurationSourceProvider provider, String path) [THROWS-WHEN] ConfigurationParsingException .builder("Malformed " + formatName) .... when try-body throws [THROWS-WHEN] ConfigurationParsingException .builder("Malformed " + formatName...
/* static context [FOCAL] @Override public Pair<T, U> BaseConfigurationFactory.build(ConfigurationSourceProvider provider, String path) [THROWS-WHEN] ConfigurationParsingException .builder("Malformed " + formatName) .... when try-body throws [THROWS-WHEN] ConfigurationParsingException .builder("Malformed " + formatName...
true
ok
{"focal": {"class": "BaseConfigurationFactory", "name": "build", "signature": "Pair<T, U> build(ConfigurationSourceProvider provider, String path) throws IOException, ConfigurationException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "provider", "type": "ConfigurationSourceProvider"}, {"name...
135796936_4
class BookController { @PostMapping public ResponseEntity<Void> createNewBook(@Valid @RequestBody BookRequest bookRequest, UriComponentsBuilder uriComponentsBuilder) { Long primaryKey = bookService.createNewBook(bookRequest); UriComponents uriComponents = uriComponentsBuilder.path("/api/books/{id}").build...
BookRequest bookRequest = new BookRequest(); bookRequest.setAuthor("Duke"); bookRequest.setIsbn("1337"); bookRequest.setTitle("Java 11"); when(bookService.createNewBook(bookRequestArgumentCaptor.capture())).thenReturn(1L); this.mockMvc .perform(post("/api/books") .contentType(Me...
[FOCAL] @PostMapping public ResponseEntity<Void> BookController.createNewBook(BookRequest bookRequest, UriComponentsBuilder uriComponentsBuilder) [CLASS] class BookController [METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] BookService.createNewBook/1, uriComponentsBuilder.path("/a...
/* static context [FOCAL] @PostMapping public ResponseEntity<Void> BookController.createNewBook(BookRequest bookRequest, UriComponentsBuilder uriComponentsBuilder) [COLLABORATORS] field bookService:BookService createNewBook/1; param uriComponentsBuilder:UriComponentsBuilder path/1 [FIELDS] read=bookService:BookService ...
/* static context [FOCAL] @PostMapping public ResponseEntity<Void> BookController.createNewBook(BookRequest bookRequest, UriComponentsBuilder uriComponentsBuilder) [COLLABORATORS] field bookService:BookService createNewBook/1; param uriComponentsBuilder:UriComponentsBuilder path/1 [FIELDS] read=bookService:BookService ...
true
ok
{"focal": {"class": "BookController", "name": "createNewBook", "signature": "ResponseEntity<Void> createNewBook(BookRequest bookRequest, UriComponentsBuilder uriComponentsBuilder)", "start_line": 3, "modifiers": "@PostMapping public", "params": [{"name": "bookRequest", "type": "BookRequest"}, {"name": "uriComponentsBui...
135928914_9
class TicketRegistryDecorator extends AbstractTicketRegistry { @Override public int serviceTicketCount() { if (this.ticketRegistry instanceof TicketRegistryState) { return ((TicketRegistryState) this.ticketRegistry).serviceTicketCount(); } logger.debug("Ticket registry {} do...
TicketRegistry registryState = Mockito.mock(TicketRegistry.class, withSettings().extraInterfaces(TicketRegistryState.class)); when(((TicketRegistryState)registryState).serviceTicketCount()).thenReturn(123); decorator = new TicketRegistryDecorator(registryState, cache); assertEquals(123, ...
[FOCAL] @Override public int TicketRegistryDecorator.serviceTicketCount() [CLASS] class TicketRegistryDecorator extends AbstractTicketRegistry [METRICS] loc=9 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] ((TicketRegistryState) this.ticketRegistry).serviceTicketCount/0, logger.debug/2, this.tick...
/* static context [FOCAL] @Override public int TicketRegistryDecorator.serviceTicketCount() [PATH1] if(this.ticketRegistry instanceof TicketRegistryState)=T -> return ((TicketRegistryState) this.ticketRegistry).serviceTicketCount() [PATH2] if(this.ticketRegistry instanceof TicketRegistryState)=F -> return super.service...
/* static context [FOCAL] @Override public int TicketRegistryDecorator.serviceTicketCount() [PATH1] if(this.ticketRegistry instanceof TicketRegistryState)=T -> return ((TicketRegistryState) this.ticketRegistry).serviceTicketCount() [PATH2] if(this.ticketRegistry instanceof TicketRegistryState)=F -> return super.service...
true
ok
{"focal": {"class": "TicketRegistryDecorator", "name": "serviceTicketCount", "signature": "int serviceTicketCount()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "TicketRegistryDecorator", "kind": "class", "modifiers": "", "superclass": "AbstractTicketRe...
135972985_19
class GanderIMDB implements GanderStorage { public static GanderIMDB getInstance() { return INSTANCE; } private GanderIMDB(); @Override public TransactionDao getTransactionDao(); } class GanderIMDBTest { @Test public void getInstance_shouldReturnSingleton() {
assertThat(GanderIMDB.getInstance()).isEqualTo(GanderIMDB.getInstance()); } }
[FOCAL] public static GanderIMDB GanderIMDB.getInstance() [CLASS] class GanderIMDB implements GanderStorage [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] GanderIMDB(); TransactionDao getTransactionDao() [TEST] GanderIMDBTest: @Test public void getInstance_shouldReturnSingleton()
/* static context [FOCAL] public static GanderIMDB GanderIMDB.getInstance() */
/* static context [FOCAL] public static GanderIMDB GanderIMDB.getInstance() */ class GanderIMDB implements GanderStorage { public static GanderIMDB getInstance() { return INSTANCE; } private GanderIMDB(); @Override public TransactionDao getTransactionDao(); } class GanderIMDBTest { @T...
true
ok
{"focal": {"class": "GanderIMDB", "name": "getInstance", "signature": "GanderIMDB getInstance()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "GanderIMDB"}, "class_info": {"name": "GanderIMDB", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "GanderStorage", "fields":...
136013354_0
class MavlinkPacketReader { public MavlinkPacket next() throws IOException { while (in.next()) { byte[] frame = in.frame(); switch (frame[0] & 0xff) { case MavlinkPacket.MAGIC_V1: return MavlinkPacket.fromV1Bytes(frame); case Mavli...
MavlinkPacket expected = MavlinkPacket.createSignedMavlink2Packet( 0, 0, 0, 0, 0, new byte[255], 0, 0, new byte[32]); InputStream in = new ByteArrayInputStream(expected.getRawBytes()); MavlinkPacketReader reader = new MavlinkPacketReader(in); MavlinkPacket actual = reade...
[FOCAL] public MavlinkPacket MavlinkPacketReader.next() [CLASS] class MavlinkPacketReader [METRICS] loc=15 cc=4 branches=1 loops=1 returns=2 throws=1 nesting=2 [CALLS-EXTERNAL] in.next/0, in.frame/0, MavlinkPacket.fromV1Bytes/1, MavlinkPacket.fromV2Bytes/1, in.drop/0 [NEW] EOFException [EXCEPTIONS] declares IOException...
/* static context [FOCAL] public MavlinkPacket MavlinkPacketReader.next() [THROWS-WHEN] EOFException when in.next() && switch(frame[0] & 0xff)=default [THROWS-WHEN] EOFException when !in.next() [PATH1] while(in.next())=T -> switch(frame[0] & 0xff)=default -> exit loop -> throw new EOFException("End of stream") [PATH2] ...
/* static context [FOCAL] public MavlinkPacket MavlinkPacketReader.next() [THROWS-WHEN] EOFException when in.next() && switch(frame[0] & 0xff)=default [THROWS-WHEN] EOFException when !in.next() [PATH1] while(in.next())=T -> switch(frame[0] & 0xff)=default -> exit loop -> throw new EOFException("End of stream") [PATH2] ...
true
ok
{"focal": {"class": "MavlinkPacketReader", "name": "next", "signature": "MavlinkPacket next() throws IOException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "MavlinkPacket"}, "class_info": {"name": "MavlinkPacketReader", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null...