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
43356615_97
class Tracker { Tracker setParam(String key, Closure value) { return processSetParam(key, value); } public Tracker(); Tracker(boolean registerNeeded); public Tracker(android.content.Context context); Tracker(android.content.Context context, boolean registerNeeded); public Tr...
ParamOption options = new ParamOption().setPersistent(true).setAppend(true); tracker.setParam(key, 1) .setParam(key, "test"); tracker.setParam(key, 1, options) .setParam(key, 67, options); assertEquals(1, buffer.getVolatileParams().size()); assert...
[FOCAL] Tracker Tracker.setParam(String key, Closure value) [CLASS] class Tracker [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Tracker processSetParam(String key, Closure value) [INPUTS] branches=- | result=key, value [DATAFLOW] key@param->L2; value@param->L2 [CLASS-MEMBERS] Tra...
class Tracker { Tracker setParam(String key, Closure value) { return processSetParam(key, value); } public Tracker(); Tracker(boolean registerNeeded); public Tracker(android.content.Context context); Tracker(android.content.Context context, boolean registerNeeded); public Tr...
false
ok
{"focal": {"class": "Tracker", "name": "setParam", "signature": "Tracker setParam(String key, Closure value)", "start_line": 3, "modifiers": "", "params": [{"name": "key", "type": "String"}, {"name": "value", "type": "Closure"}], "return_type": "Tracker"}, "class_info": {"name": "Tracker", "kind": "class", "modifiers":...
43357646_0
class RoboVMWebService { public void getProducts(Action<List<Product>> completion) { Objects.requireNonNull(completion); if (products != null) { ActionWrapper.WRAPPER.invoke(completion, products); } else { api.products().enqueue(new Callback<ProductsResponse>() { ...
Call<ProductsResponse> call = api.products(); ProductsResponse response = call.execute().body(); assertTrue(response.isSuccess()); List<Product> products = response.getProducts(); assertNotNull(products); assertEquals(products.size(), 2); Product menJavaTShirt ...
[FOCAL] public void RoboVMWebService.getProducts(Action<List<Product>> completion) [CLASS] class RoboVMWebService [METRICS] loc=34 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=3 [CALLS-EXTERNAL] Objects.requireNonNull/1, ActionWrapper.WRAPPER.invoke/2, api.products().enqueue/1, RoboVMAPI.products/0, response.isSu...
/* static context [FOCAL] public void RoboVMWebService.getProducts(Action<List<Product>> completion) [PATH1] if(products != null)=T [PATH2] if(products != null)=F [COLLABORATORS] field api:RoboVMAPI products/0; field response isSuccess/0,body/0; field t printStackTrace/0 [FIELDS] read=api:RoboVMAPI [NEW] Callback<Produ...
/* static context [FOCAL] public void RoboVMWebService.getProducts(Action<List<Product>> completion) [PATH1] if(products != null)=T [PATH2] if(products != null)=F [COLLABORATORS] field api:RoboVMAPI products/0; field response isSuccess/0,body/0; field t printStackTrace/0 [FIELDS] read=api:RoboVMAPI [NEW] Callback<Produ...
true
ok
{"focal": {"class": "RoboVMWebService", "name": "getProducts", "signature": "void getProducts(Action<List<Product>> completion)", "start_line": 3, "modifiers": "public", "params": [{"name": "completion", "type": "Action<List<Product>>"}], "return_type": "void"}, "class_info": {"name": "RoboVMWebService", "kind": "class...
43367865_1
class LRS { public String LRS(String query) { String[] suffixes = new String[query.length()]; for(int i = 0; i < query.length(); i++) { suffixes[i] = query.substring(i); } Arrays.sort(suffixes); Pair answer = new Pair(); answer.count = 0; for(int i = 0; i < suffixes.length - 1; i++) { Pair...
String test = "bananabanana"; String answer = lrs.LRS(test); String expected = "banana"; assertTrue(answer.equals(expected)); } }
[FOCAL] public String LRS.LRS(String query) [CLASS] class LRS [METRICS] loc=19 cc=4 branches=1 loops=2 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] Pair lcp(String a, String b) [CALLS-EXTERNAL] String.length/0, String.substring/1, Arrays.sort/1 [NEW] Pair [PATH1] for(i < query.length())=F -> for(i < suffixes.length - ...
/* static context [FOCAL] public String LRS.LRS(String query) [PATH1] for(i < query.length())=F -> for(i < suffixes.length - 1)=T -> if(candidate.count > answer.count)=T -> exit loop -> return answer.value [PATH2] for(i < query.length())=T -> exit loop -> for(i < suffixes.length - 1)=F -> return answer.value [PATH3] fo...
/* static context [FOCAL] public String LRS.LRS(String query) [PATH1] for(i < query.length())=F -> for(i < suffixes.length - 1)=T -> if(candidate.count > answer.count)=T -> exit loop -> return answer.value [PATH2] for(i < query.length())=T -> exit loop -> for(i < suffixes.length - 1)=F -> return answer.value [PATH3] fo...
true
ok
{"focal": {"class": "LRS", "name": "LRS", "signature": "String LRS(String query)", "start_line": 3, "modifiers": "public", "params": [{"name": "query", "type": "String"}], "return_type": "String"}, "class_info": {"name": "LRS", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name"...
43368910_4
class Types { public static Class<?> getRawType(Type type) { if (type instanceof Class<?>) { // Type is a normal class. return (Class<?>) type; } else if (type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; ...
try { Types.getRawType(null); fail("An IllegalArgumentException must have occurred as we passed a null object to this method"); } catch (IllegalArgumentException ex) { assertTrue(ex.getMessage().startsWith("Expected a Class, ParameterizedType, or GenericArrayType")); ...
[FOCAL] public static Class<?> Types.getRawType(Type type) [CLASS] class Types [METRICS] loc=32 cc=7 branches=6 loops=0 returns=5 throws=2 nesting=5 [CALLS-EXTERNAL] ParameterizedType.getRawType/0, ((GenericArrayType) type).getGenericComponentType/0, Array.newInstance(getRawType(componentType), 0).getClass/0, Array.new...
/* static context [FOCAL] public static Class<?> Types.getRawType(Type type) [THROWS-WHEN] IllegalArgumentException when !(type instanceof Class<?>) && type instanceof ParameterizedType && !(rawType instanceof Class) [THROWS-WHEN] IllegalArgumentException when !(type instanceof Class<?>) && !(type instanceof Parameteri...
/* static context [FOCAL] public static Class<?> Types.getRawType(Type type) [THROWS-WHEN] IllegalArgumentException when !(type instanceof Class<?>) && type instanceof ParameterizedType && !(rawType instanceof Class) [THROWS-WHEN] IllegalArgumentException when !(type instanceof Class<?>) && !(type instanceof Parameteri...
true
ok
{"focal": {"class": "Types", "name": "getRawType", "signature": "Class<?> getRawType(Type type)", "start_line": 3, "modifiers": "public static", "params": [{"name": "type", "type": "Type"}], "return_type": "Class<?>"}, "class_info": {"name": "Types", "kind": "class", "modifiers": "", "superclass": null, "interfaces": n...
43388015_0
class NaturalOrder implements Comparator<String> { @Override public int compare(String o1, String o2) { return compareStrings(o1, o2); } public static final int compareStrings(String s1, String s2); } class NaturalOrderTest { @Test public void testCompare() {
System.out.println("compare"); String s1 = "i"; String s2 = "I"; int expResult = 0; int result = NaturalOrder.compareStrings(s1, s2); assertEquals(expResult, result); s1 = "ISAAC metadata (ISAAC)"; s2 = "health concept"; result = NaturalOrder.compareStrings(s1, s2)...
[FOCAL] @Override public int NaturalOrder.compare(String o1, String o2) [CLASS] class NaturalOrder implements Comparator<String> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] int compareStrings(String s1, String s2) [INPUTS] branches=- | result=o1, o2 [DATAFLOW] o1@param->L3; o2@...
/* static context [FOCAL] @Override public int NaturalOrder.compare(String o1, String o2) [INPUTS] branches=- | result=o1, o2 [CALLS-INTERNAL] int compareStrings(String s1, String s2) */
/* static context [FOCAL] @Override public int NaturalOrder.compare(String o1, String o2) [INPUTS] branches=- | result=o1, o2 [CALLS-INTERNAL] int compareStrings(String s1, String s2) */ class NaturalOrder implements Comparator<String> { @Override public int compare(String o1, String o2) { return compareSt...
true
ok
{"focal": {"class": "NaturalOrder", "name": "compare", "signature": "int compare(String o1, String o2)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "o1", "type": "String"}, {"name": "o2", "type": "String"}], "return_type": "int"}, "class_info": {"name": "NaturalOrder", "kind": "class", "modif...
43398044_198
class ProjectRestApi extends ApiBase implements ProjectApi { @Override public void getTasksForProjectAsync(final String projectId, final FutureCallback<ResourceList<Task>> responseCallback) throws IOException { final String path = String.format("%s/%s/tasks", getBasePath(), projectId); R...
Task task1 = new Task(); task1.setId("task1"); Task task2 = new Task(); task2.setId("task2"); Task task3 = new Task(); task3.setId("task3"); String nextPageLink = "nextPageLink"; ResourceList<Task> taskResourceList = new ResourceList<>(Arrays.asList(task1, task2), nextPageLink, null)...
[FOCAL] @Override public void ProjectRestApi.getTasksForProjectAsync(String projectId, FutureCallback<ResourceList<Task>> responseCallback) [CLASS] class ProjectRestApi extends ApiBase implements ProjectApi [METRICS] loc=35 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=2 [CALLS-INTERNAL] String getBasePath() [CALL...
/* static context [FOCAL] @Override public void ProjectRestApi.getTasksForProjectAsync(String projectId, FutureCallback<ResourceList<Task>> responseCallback) [COLLABORATORS] field result getItems/0,getNextPageLink/0; param responseCallback:FutureCallback<ResourceList<Task>> onSuccess/1,onFailure/1 [EXCEPTIONS] declares...
/* static context [FOCAL] @Override public void ProjectRestApi.getTasksForProjectAsync(String projectId, FutureCallback<ResourceList<Task>> responseCallback) [COLLABORATORS] field result getItems/0,getNextPageLink/0; param responseCallback:FutureCallback<ResourceList<Task>> onSuccess/1,onFailure/1 [EXCEPTIONS] declares...
true
ok
{"focal": {"class": "ProjectRestApi", "name": "getTasksForProjectAsync", "signature": "void getTasksForProjectAsync(String projectId, FutureCallback<ResourceList<Task>> responseCallback) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "projectId", "type": "String"}, {"name": "...
43430328_1
class PermissionPresenter { public void requestReadContactsPermission() { checkAndRequestPermission(Action.READ_CONTACTS); } public PermissionPresenter(PermissionAction permissionAction, PermissionCallbacks permissionCallbacks); public void requestReadContactsPermissionAfterRationale(); ...
when(permissionAction.hasSelfPermission(READ_CONTACTS)).thenReturn(false); when(permissionAction.shouldShowRequestPermissionRationale(READ_CONTACTS)).thenReturn(true); permissionPresenter.requestReadContactsPermission(); verify(permissionCallbacks).showRationale(Action.ACTION_CODE_READ_...
[FOCAL] public void PermissionPresenter.requestReadContactsPermission() [CLASS] class PermissionPresenter [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void checkAndRequestPermission(Action action) [CLASS-MEMBERS] PermissionPresenter(PermissionAction permissionAction, PermissionC...
/* static context [FOCAL] public void PermissionPresenter.requestReadContactsPermission() [CALLS-INTERNAL] void checkAndRequestPermission(Action action) */
/* static context [FOCAL] public void PermissionPresenter.requestReadContactsPermission() [CALLS-INTERNAL] void checkAndRequestPermission(Action action) */ class PermissionPresenter { public void requestReadContactsPermission() { checkAndRequestPermission(Action.READ_CONTACTS); } public Permissio...
true
ok
{"focal": {"class": "PermissionPresenter", "name": "requestReadContactsPermission", "signature": "void requestReadContactsPermission()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "PermissionPresenter", "kind": "class", "modifiers": "", "superclass": null, "inte...
43502922_10
class Translator { public Task translate(InternalTask in) { Task out = null; if (in != null) { out = new Task(); out.uuid = in.uuid; out.description = in.description; out.done = in.status == InternalTask.Status.Completed; out.urgency = in....
assertTrue(mTranslator.translate(null) == null); } }
[FOCAL] public Task Translator.translate(InternalTask in) [CLASS] class Translator [METRICS] loc=11 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [NEW] Task [PATH1] if(in != null)=T -> return out [PATH2] if(in != null)=F -> return out [INPUTS] branches=in | result=- [DATAFLOW] in@param->L3,L5,L6,L7,L8; out@L2->L...
/* static context [FOCAL] public Task Translator.translate(InternalTask in) [PATH1] if(in != null)=T -> return out [PATH2] if(in != null)=F -> return out [INPUTS] branches=in | result=- [NEW] Task */
/* static context [FOCAL] public Task Translator.translate(InternalTask in) [PATH1] if(in != null)=T -> return out [PATH2] if(in != null)=F -> return out [INPUTS] branches=in | result=- [NEW] Task */ class Translator { public Task translate(InternalTask in) { Task out = null; if (in != null) { ...
true
ok
{"focal": {"class": "Translator", "name": "translate", "signature": "Task translate(InternalTask in)", "start_line": 3, "modifiers": "public", "params": [{"name": "in", "type": "InternalTask"}], "return_type": "Task"}, "class_info": {"name": "Translator", "kind": "class", "modifiers": "", "superclass": null, "interface...
43504026_27
class WebXmlParameters { public String getAjaxProcessingTextOnRequest() { return ajaxProcessingTextOnRequest; } public WebXmlParameters(final ExternalContext externalContext); private boolean readBooleanParameter(final String parameter, final ExternalContext context); private String read...
assertEquals(WebXmlParameters.DEFAULT_AJAX_PROCESSING_TEXT, new WebXmlParameters(defaultValueExternalContext).getAjaxProcessingTextOnRequest()); assertEquals(OVERRIDDEN_AJAX_PROCESSING_TEXT, new WebXmlParameters(overriddenValueExternalContext).getAjaxProcessingTextOnRequest()); } }
[FOCAL] public String WebXmlParameters.getAjaxProcessingTextOnRequest() [CLASS] class WebXmlParameters [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] WebXmlParameters(ExternalContext externalContext); boolean readBooleanParameter(String parameter, ExternalContext context); String r...
/* static context [FOCAL] public String WebXmlParameters.getAjaxProcessingTextOnRequest() */
/* static context [FOCAL] public String WebXmlParameters.getAjaxProcessingTextOnRequest() */ class WebXmlParameters { public String getAjaxProcessingTextOnRequest() { return ajaxProcessingTextOnRequest; } public WebXmlParameters(final ExternalContext externalContext); private boolean readBoo...
true
ok
{"focal": {"class": "WebXmlParameters", "name": "getAjaxProcessingTextOnRequest", "signature": "String getAjaxProcessingTextOnRequest()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "WebXmlParameters", "kind": "class", "modifiers": "", "superclass": null, "inte...
43563629_9
class AmazonAppStoreRule implements IEnvironmentBasedRule { @Override public boolean shouldAllowFeedbackPrompt(@NonNull final IEnvironment environment) { return environment.isAmazonAppStoreInstalled(); } @NonNull @Override public String getDescription(); private AmazonAppStoreRule amazonA...
// Arrange when(environment.isAmazonAppStoreInstalled()).thenReturn(true); // Act final boolean isEnvironmentRuleSatisfied = amazonAppStoreRule.shouldAllowFeedbackPrompt(environment); // Assert assertTrue("Environment based rule should be satisfied", isEnvironmentRuleSa...
[FOCAL] @Override public boolean AmazonAppStoreRule.shouldAllowFeedbackPrompt(IEnvironment environment) [CLASS] class AmazonAppStoreRule implements IEnvironmentBasedRule [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] IEnvironment.isAmazonAppStoreInstalled/0 [INPUTS] branches=- | r...
/* static context [FOCAL] @Override public boolean AmazonAppStoreRule.shouldAllowFeedbackPrompt(IEnvironment environment) [INPUTS] branches=- | result=environment [COLLABORATORS] param environment:IEnvironment isAmazonAppStoreInstalled/0 [CALLS-EXTERNAL] IEnvironment.isAmazonAppStoreInstalled/0 */
/* static context [FOCAL] @Override public boolean AmazonAppStoreRule.shouldAllowFeedbackPrompt(IEnvironment environment) [INPUTS] branches=- | result=environment [COLLABORATORS] param environment:IEnvironment isAmazonAppStoreInstalled/0 [CALLS-EXTERNAL] IEnvironment.isAmazonAppStoreInstalled/0 */ class AmazonAppStoreR...
true
ok
{"focal": {"class": "AmazonAppStoreRule", "name": "shouldAllowFeedbackPrompt", "signature": "boolean shouldAllowFeedbackPrompt(IEnvironment environment)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "environment", "type": "IEnvironment"}], "return_type": "boolean"}, "class_info": {"name": "Ama...
43568553_0
class SchemaVersion implements Comparable<SchemaVersion> { public int compareTo(SchemaVersion other) { if(this.version.equalsIgnoreCase(other.version) || this.version == V_ANY.version || other.version == V_ANY.version) { return 0; } String[] v1Splits = this.version.split("\\.")...
SchemaVersion schemaVersion1 = new SchemaVersion(); SchemaVersion schemaVersion2 = new SchemaVersion(); schemaVersion1.version = "1.0"; schemaVersion2.version = "1.0"; assertEquals(0, schemaVersion1.compareTo(schemaVersion2)); schemaVersion1.version = "1.0"; schemaVersion2.version ...
[FOCAL] public int SchemaVersion.compareTo(SchemaVersion other) [CLASS] class SchemaVersion implements Comparable<SchemaVersion> [METRICS] loc=28 cc=6 branches=3 loops=2 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] this.version.equalsIgnoreCase/1, this.version.split/1, other.version.split/1, Integer.parseInt/1, Intege...
/* static context [FOCAL] public int SchemaVersion.compareTo(SchemaVersion other) [PATH1] if(this.version.equalsIgnoreCase(other.version) || this.version == V_ANY.version || other.version == V_ANY.version)=F -> foreach(String v1Split : v1Splits)=T -> exit loop -> foreach(String v2Split : v2Splits)=F -> if(v1Splits.leng...
/* static context [FOCAL] public int SchemaVersion.compareTo(SchemaVersion other) [PATH1] if(this.version.equalsIgnoreCase(other.version) || this.version == V_ANY.version || other.version == V_ANY.version)=F -> foreach(String v1Split : v1Splits)=T -> exit loop -> foreach(String v2Split : v2Splits)=F -> if(v1Splits.leng...
true
ok
{"focal": {"class": "SchemaVersion", "name": "compareTo", "signature": "int compareTo(SchemaVersion other)", "start_line": 3, "modifiers": "public", "params": [{"name": "other", "type": "SchemaVersion"}], "return_type": "int"}, "class_info": {"name": "SchemaVersion", "kind": "class", "modifiers": "", "superclass": null...
43569889_0
class CryptoUtil { static long getLong(final byte[] bytes) { return new BigInteger(bytes).longValue(); } public static byte[] convertDEREncodedSignatureToJWSConcatenated(final byte[] derEncodedSignatureValue); public static byte[] convertJWSConcatenatedToDEREncodedSignature(final byte[] concatenatedSigna...
Assert.assertEquals(CryptoUtil.getLong(bytes), expected); } }
[FOCAL] static long CryptoUtil.getLong(byte[] bytes) [CLASS] class CryptoUtil [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] new BigInteger(bytes).longValue/0 [NEW] BigInteger [INPUTS] branches=- | result=bytes [DATAFLOW] bytes@param->L3 [CLASS-MEMBERS] byte[] convertDEREncodedSig...
/* static context [FOCAL] static long CryptoUtil.getLong(byte[] bytes) [INPUTS] branches=- | result=bytes [NEW] BigInteger [CALLS-EXTERNAL] new BigInteger(bytes).longValue/0 */
/* static context [FOCAL] static long CryptoUtil.getLong(byte[] bytes) [INPUTS] branches=- | result=bytes [NEW] BigInteger [CALLS-EXTERNAL] new BigInteger(bytes).longValue/0 */ class CryptoUtil { static long getLong(final byte[] bytes) { return new BigInteger(bytes).longValue(); } public static byte[] conv...
true
ok
{"focal": {"class": "CryptoUtil", "name": "getLong", "signature": "long getLong(byte[] bytes)", "start_line": 3, "modifiers": "static", "params": [{"name": "bytes", "type": "byte[]"}], "return_type": "long"}, "class_info": {"name": "CryptoUtil", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, ...
43591538_6
class PlacesViewModel implements IPlacesViewModel { @Override public Observable<Boolean> fetchAllPlaces() { return mPlacesApi.placesResult() .map(googleSearchResult -> { allPlaces = googleSearchResult.results; mPlaces.onNext(googleSearchResult.res...
AtomicInteger atomicInteger = new AtomicInteger(0); when(placesApi.placesResult()).thenReturn( Observable.create(subscriber -> { if (atomicInteger.getAndIncrement() < 3) { subscriber.onError(new Exception()); } else { ...
[FOCAL] @Override public Observable<Boolean> PlacesViewModel.fetchAllPlaces() [CLASS] class PlacesViewModel implements IPlacesViewModel [METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] mPlacesApi.placesResult() .map(googleSearchResult -> { al....retry/1, mPlacesApi.placesResult() ....
/* static context [FOCAL] @Override public Observable<Boolean> PlacesViewModel.fetchAllPlaces() [COLLABORATORS] field mPlacesApi placesResult/0; field mPlaces onNext/1 [CALLS-EXTERNAL] mPlacesApi.placesResult() .map(googleSearchResult -> { al....retry/1, mPlacesApi.placesResult() .map(googleSearchResult -> { al....time...
/* static context [FOCAL] @Override public Observable<Boolean> PlacesViewModel.fetchAllPlaces() [COLLABORATORS] field mPlacesApi placesResult/0; field mPlaces onNext/1 [CALLS-EXTERNAL] mPlacesApi.placesResult() .map(googleSearchResult -> { al....retry/1, mPlacesApi.placesResult() .map(googleSearchResult -> { al....time...
true
ok
{"focal": {"class": "PlacesViewModel", "name": "fetchAllPlaces", "signature": "Observable<Boolean> fetchAllPlaces()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Observable<Boolean>"}, "class_info": {"name": "PlacesViewModel", "kind": "class", "modifiers": "", "superclass": null, "in...
43645816_99
class LogFormatter { public <Message extends PMessage<Message, Field>, Field extends PField> String format(Message message) { ByteArrayOutputStream out = new ByteArrayOutputStream(); formatTo(out, message); return new String(out.toByteArray(), StandardCharsets.UTF_8); } public ...
OptionalFields credentials = OptionalFields .builder() .setStringValue("username") .setBinaryValue(Binary.fromBase64("password")) .build(); LogFormatter formatter = new LogFormatter(true, (writer, field, value) -> { if (field.g...
[FOCAL] public String LogFormatter.format(Message message) [CLASS] class LogFormatter [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] void formatTo(OutputStream out, Message message) [CALLS-EXTERNAL] ByteArrayOutputStream.toByteArray/0 [NEW] ByteArrayOutputStream, String [DATAFLOW]...
/* static context [FOCAL] public String LogFormatter.format(Message message) [CALLS-INTERNAL] void formatTo(OutputStream out, Message message) [NEW] ByteArrayOutputStream, String [CALLS-EXTERNAL] ByteArrayOutputStream.toByteArray/0 */
/* static context [FOCAL] public String LogFormatter.format(Message message) [CALLS-INTERNAL] void formatTo(OutputStream out, Message message) [NEW] ByteArrayOutputStream, String [CALLS-EXTERNAL] ByteArrayOutputStream.toByteArray/0 */ class LogFormatter { public <Message extends PMessage<Message, Field>, Field ext...
true
ok
{"focal": {"class": "LogFormatter", "name": "format", "signature": "String format(Message message)", "start_line": 3, "modifiers": "public", "params": [{"name": "message", "type": "Message"}], "return_type": "String"}, "class_info": {"name": "LogFormatter", "kind": "class", "modifiers": "", "superclass": null, "interfa...
43682339_3
class TargetFactory { @VisibleForTesting protected File findImageFile(String imageFile) { File foundImageFile = findImageFile(folderToScan, imageFile); // creating non existing file to avoid NPE return foundImageFile == null ? new File(imageFile) : foundImageFile; } public void...
// user mistakenly added "/" in front of relative file name File f1 = targetFactory.findImageFile("/" + FILE_PATH); assertTrue(f1.exists()); File f2 = targetFactory.findImageFile("\\" + FILE_PATH_BACKSLASHED); assertTrue(f2.exists()); } }
[FOCAL] @VisibleForTesting protected File TargetFactory.findImageFile(String imageFile) [CLASS] class TargetFactory [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] File findImageFile(File lookupFolder, String lookupTarget) [NEW] File [INPUTS] branches=- | result=imageFile [DATAFLOW...
/* static context [FOCAL] @VisibleForTesting protected File TargetFactory.findImageFile(String imageFile) [INPUTS] branches=- | result=imageFile [CALLS-INTERNAL] File findImageFile(File lookupFolder, String lookupTarget) [NEW] File */
/* static context [FOCAL] @VisibleForTesting protected File TargetFactory.findImageFile(String imageFile) [INPUTS] branches=- | result=imageFile [CALLS-INTERNAL] File findImageFile(File lookupFolder, String lookupTarget) [NEW] File */ class TargetFactory { @VisibleForTesting protected File findImageFile(String...
true
ok
{"focal": {"class": "TargetFactory", "name": "findImageFile", "signature": "File findImageFile(String imageFile)", "start_line": 3, "modifiers": "@VisibleForTesting protected", "params": [{"name": "imageFile", "type": "String"}], "return_type": "File"}, "class_info": {"name": "TargetFactory", "kind": "class", "modifier...
43688721_56
class AutosleepServiceInstanceService implements ServiceInstanceService { @Override public UpdateServiceInstanceResponse updateServiceInstance( UpdateServiceInstanceRequest request) throws ServiceInstanceUpdateNotSupportedException, ServiceBrokerException, ServiceInstanceDoesNotExistExc...
// given transient service with secret exists transient_service_with_secret_exist_in_database(); // when user gives auto enrollment without secret UpdateServiceInstanceRequest updateRequest = getUpdateRequestWithArbitraryParams( singletonMap(Config.ServiceInstanceParamet...
[FOCAL] @Override public UpdateServiceInstanceResponse AutosleepServiceInstanceService.updateServiceInstance(UpdateServiceInstanceRequest request) [CLASS] class AutosleepServiceInstanceService implements ServiceInstanceService [METRICS] loc=48 cc=6 branches=5 loops=0 returns=1 throws=4 nesting=5 [CALLS-INTERNAL] T cons...
/* static context [FOCAL] @Override public UpdateServiceInstanceResponse AutosleepServiceInstanceService.updateServiceInstance(UpdateServiceInstanceRequest request) [THROWS-WHEN] ServiceInstanceDoesNotExistException when spaceEnrollerConfig == null */
/* static context [FOCAL] @Override public UpdateServiceInstanceResponse AutosleepServiceInstanceService.updateServiceInstance(UpdateServiceInstanceRequest request) [THROWS-WHEN] ServiceInstanceDoesNotExistException when spaceEnrollerConfig == null */ class AutosleepServiceInstanceService implements ServiceInstanceServ...
true
ok
{"focal": {"class": "AutosleepServiceInstanceService", "name": "updateServiceInstance", "signature": "UpdateServiceInstanceResponse updateServiceInstance(UpdateServiceInstanceRequest request) throws ServiceInstanceUpdateNotSupportedException, ServiceBrokerException, ServiceInstanceDoesNotExistException", "start_line": ...
43734923_111
class ConstructConsequentVisitor extends AbstractQueryModelVisitor<RuntimeException> { public Set<StatementPattern> getConsequents() { return consequentStatementPatterns; } public Set<StatementPattern> getBnodes(); @Override public void meet(Projection projection); @Override public void me...
Extension extension = new Extension(new SingletonSet(), new ExtensionElem(new ValueConstant(FOAF.PERSON), "x"), new ExtensionElem(new ValueConstant(RDF.TYPE), "y"), new ExtensionElem(new ValueConstant(OWL.CLASS), "z")); Projection projection = new Projecti...
[FOCAL] public Set<StatementPattern> ConstructConsequentVisitor.getConsequents() [CLASS] class ConstructConsequentVisitor extends AbstractQueryModelVisitor<RuntimeException> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Set<StatementPattern> getBnodes(); void meet(Projection proje...
/* static context [FOCAL] public Set<StatementPattern> ConstructConsequentVisitor.getConsequents() */
/* static context [FOCAL] public Set<StatementPattern> ConstructConsequentVisitor.getConsequents() */ class ConstructConsequentVisitor extends AbstractQueryModelVisitor<RuntimeException> { public Set<StatementPattern> getConsequents() { return consequentStatementPatterns; } public Set<StatementPat...
true
ok
{"focal": {"class": "ConstructConsequentVisitor", "name": "getConsequents", "signature": "Set<StatementPattern> getConsequents()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Set<StatementPattern>"}, "class_info": {"name": "ConstructConsequentVisitor", "kind": "class", "modifiers": "", "superc...
43792695_1
class MamircConnector { static byte[] makePongIfPing(byte[] line) { // Skip prefix, if any int i = 0; if (line.length >= 1 && line[i] == ':') { i++; while (i < line.length && line[i] != ' ') i++; while (i < line.length && line[i] == ' ') i++; } // Check that next 4 characters are "PING" ...
String[][] cases = { {null, ""}, {null, "PONG"}, {null, "PINGU"}, {null, " PING"}, {null, " :abc PING"}, {null, "PING:def"}, {null, "abc WHAT PING"}, {null, "STOPPING"}, {null, ":nick!user@host PRIVMSG #chan :PING"}, {"PONG", "PING"}, {"PONG", ":prefix PING"}, {"PONG ", ":pre PIN...
[FOCAL] static byte[] MamircConnector.makePongIfPing(byte[] line) [CLASS] class MamircConnector [METRICS] loc=21 cc=5 branches=2 loops=2 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] Arrays.copyOfRange/3 [PATH1] if(line.length >= 1 && line[i] == ':')=T -> while(i < line.length && line[i] != ' ')=T -> exit loop -> while...
/* static context [FOCAL] static byte[] MamircConnector.makePongIfPing(byte[] line) [PATH1] if(line.length >= 1 && line[i] == ':')=T -> while(i < line.length && line[i] != ' ')=T -> exit loop -> while(i < line.length && line[i] == ' ')=F -> if((line.length - i >= 4 && (line[i + 0] & 0xDF) == 'P' && (line[i + 1] & 0xDF)...
/* static context [FOCAL] static byte[] MamircConnector.makePongIfPing(byte[] line) [PATH1] if(line.length >= 1 && line[i] == ':')=T -> while(i < line.length && line[i] != ' ')=T -> exit loop -> while(i < line.length && line[i] == ' ')=F -> if((line.length - i >= 4 && (line[i + 0] & 0xDF) == 'P' && (line[i + 1] & 0xDF)...
true
ok
{"focal": {"class": "MamircConnector", "name": "makePongIfPing", "signature": "byte[] makePongIfPing(byte[] line)", "start_line": 3, "modifiers": "static", "params": [{"name": "line", "type": "byte[]"}], "return_type": "byte[]"}, "class_info": {"name": "MamircConnector", "kind": "class", "modifiers": "", "superclass": ...
43826822_0
class RiverService { public boolean embarkTourists(int n) throws RiverServiceException { processInstance = ksession.startProcess("com.yahoo.sorelmitra.EmbarkTourists"); int state = processInstance.getState(); LOG.info("Process state is " + state); if (state != ProcessInstance.STATE_...
Assert.assertEquals(10, cutter.getEmptySeats()); boolean result; result = rs.embarkTourists(6); Assert.assertTrue(result); Assert.assertEquals(4, cutter.getEmptySeats()); result = rs.embarkTourists(6); Assert.assertFalse(result); Assert.assertEquals(4, ...
[FOCAL] public boolean RiverService.embarkTourists(int n) [CLASS] class RiverService [METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] ksession.startProcess/1, processInstance.getState/0, LOG.info/1 [NEW] RiverServiceException [EXCEPTIONS] declares RiverServiceException; throws River...
/* static context [FOCAL] public boolean RiverService.embarkTourists(int n) [THROWS-WHEN] RiverServiceException when state != ProcessInstance.STATE_COMPLETED [PATH1] if(state != ProcessInstance.STATE_COMPLETED)=T -> throw new RiverServiceException("Process state is not COMPLETED, but " + ... [PATH2] if(state != Process...
/* static context [FOCAL] public boolean RiverService.embarkTourists(int n) [THROWS-WHEN] RiverServiceException when state != ProcessInstance.STATE_COMPLETED [PATH1] if(state != ProcessInstance.STATE_COMPLETED)=T -> throw new RiverServiceException("Process state is not COMPLETED, but " + ... [PATH2] if(state != Process...
true
ok
{"focal": {"class": "RiverService", "name": "embarkTourists", "signature": "boolean embarkTourists(int n) throws RiverServiceException", "start_line": 3, "modifiers": "public", "params": [{"name": "n", "type": "int"}], "return_type": "boolean"}, "class_info": {"name": "RiverService", "kind": "class", "modifiers": "", "...
43829671_3
class CoordinatesDao extends BaseDao { public List<DNCWorkCoordinate> getCoordinates() { SessionWrapper session = getCurrentSourceSession(); try { Query getCoordinates = session.getNamedQuery("getCoordinates"); List<DNCWorkCoordinate> coordinateList = getCoordinates ...
dao.executeSQLQueryForSource("create table vwTestCoordinates(patientId int, sourceTable varchar(100), sourceColumn varchar(100), idInSourceTable int, pkColumnName varchar(100), type varchar(100), updateTime varchar(100))"); dao.executeSQLQueryForSource("insert into vwTestCoordinates values(5, 'patientDo...
[FOCAL] public List<DNCWorkCoordinate> CoordinatesDao.getCoordinates() [CLASS] class CoordinatesDao extends BaseDao [METRICS] loc=15 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] getCurrentSourceSession/0 (inherited), SessionWrapper.getNamedQuery/1, getCoordinates .setResultTransformer(Transform...
/* static context [FOCAL] public List<DNCWorkCoordinate> CoordinatesDao.getCoordinates() [PATH1] try-body throws -> return new ArrayList<>() [PATH2] return coordinateList [EXCEPTIONS] catches Exception ex [NEW] ArrayList<> [CALLS-EXTERNAL] getCurrentSourceSession/0 (inherited), SessionWrapper.getNamedQuery/1, getCoordi...
/* static context [FOCAL] public List<DNCWorkCoordinate> CoordinatesDao.getCoordinates() [PATH1] try-body throws -> return new ArrayList<>() [PATH2] return coordinateList [EXCEPTIONS] catches Exception ex [NEW] ArrayList<> [CALLS-EXTERNAL] getCurrentSourceSession/0 (inherited), SessionWrapper.getNamedQuery/1, getCoordi...
true
ok
{"focal": {"class": "CoordinatesDao", "name": "getCoordinates", "signature": "List<DNCWorkCoordinate> getCoordinates()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<DNCWorkCoordinate>"}, "class_info": {"name": "CoordinatesDao", "kind": "class", "modifiers": "", "superclass": "BaseDao", "i...
43832779_133
class ParkController { @SuppressWarnings("unchecked") @RequestMapping("/{token}*") public String userFront(@PathVariable String token, @RequestParam(required = false) String tag, @RequestParam(required = false) String q, @RequestParam(required = false) Integer page, ...
ParkController controller = new ParkController(); Map<String, Object>[] filteredStbs = new HashMap[1]; Map<String, Object>[] allStbs = new HashMap[2]; Map<String, Object> stb1 = new HashMap<String, Object>(); stb1.put(MetaStb.ID, "sample"); stb1.put(MetaStb.TAGS, Arrays.a...
[FOCAL] @SuppressWarnings("unchecked") @RequestMapping("/{token}*") public String ParkController.userFront(String token, String tag, String q, Integer page, Integer size, Boolean asc, String[] sort, Model model, HttpSession session) [CLASS] class ParkController [METRICS] loc=127 cc=15 branches=12 loops=2 returns=2 thro...
class ParkController { @SuppressWarnings("unchecked") @RequestMapping("/{token}*") public String userFront(@PathVariable String token, @RequestParam(required = false) String tag, @RequestParam(required = false) String q, @RequestParam(required = false) Integer page, ...
false
ok
{"focal": {"class": "ParkController", "name": "userFront", "signature": "String userFront(String token, String tag, String q, Integer page, Integer size, Boolean asc, String[] sort, Model model, HttpSession session) throws CerealException", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") @RequestMapping...
43901081_9
class TaskModel { public Task get(int index) { return taskManager.get(index); } public TaskModel(ClientModel clientModel, TaskManager taskManager); @Handler public void selectedClientChanged(SelectedClientChangedEvent event); public void subscribe(Object listener); public void unsubs...
assertEquals(task1, model.get(0)); assertEquals(task2, model.get(1)); } }
[FOCAL] public Task TaskModel.get(int index) [CLASS] class TaskModel [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] TestTaskManager.get/1 [FIELDS] read=taskManager:TestTaskManager [INPUTS] branches=- | result=index, taskManager [COLLABORATORS] field taskManager:TestTaskManager get...
/* static context [FOCAL] public Task TaskModel.get(int index) [INPUTS] branches=- | result=index, taskManager [COLLABORATORS] field taskManager:TestTaskManager get/1 [FIELDS] read=taskManager:TestTaskManager [CALLS-EXTERNAL] TestTaskManager.get/1 */
/* static context [FOCAL] public Task TaskModel.get(int index) [INPUTS] branches=- | result=index, taskManager [COLLABORATORS] field taskManager:TestTaskManager get/1 [FIELDS] read=taskManager:TestTaskManager [CALLS-EXTERNAL] TestTaskManager.get/1 */ class TaskModel { public Task get(int index) { return ta...
true
ok
{"focal": {"class": "TaskModel", "name": "get", "signature": "Task get(int index)", "start_line": 3, "modifiers": "public", "params": [{"name": "index", "type": "int"}], "return_type": "Task"}, "class_info": {"name": "TaskModel", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"nam...
43913943_40
class LoginPresenter extends AbstractPresenter<ILoginView> { public void onLoginClick() { logger.debug("onLoginClick() called"); getView().showProgress(); call = loginModule.login(login, password); call.enqueue( data -> getView().advance(), error -> {...
initPresenter(); when(loginModule.login(anyString(), anyString())).thenReturn(Call.error(new PasswordException())); presenter.onLoginClick(); verify(view).setPasswordErrorVisible(true); } }
[FOCAL] public void LoginPresenter.onLoginClick() [CLASS] class LoginPresenter extends AbstractPresenter<ILoginView> [METRICS] loc=21 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=3 [CALLS-EXTERNAL] logger.debug/1, getView().showProgress/0, getView/0 (inherited), LoginModule.login/2, call.enqueue/2, getView().adva...
/* static context [FOCAL] public void LoginPresenter.onLoginClick() [COLLABORATORS] field loginModule:LoginModule login/2; field call enqueue/2 [FIELDS] read=loginModule:LoginModule [CALLS-EXTERNAL] logger.debug/1, getView().showProgress/0, getView/0 (inherited), LoginModule.login/2, call.enqueue/2, getView().advance/0...
/* static context [FOCAL] public void LoginPresenter.onLoginClick() [COLLABORATORS] field loginModule:LoginModule login/2; field call enqueue/2 [FIELDS] read=loginModule:LoginModule [CALLS-EXTERNAL] logger.debug/1, getView().showProgress/0, getView/0 (inherited), LoginModule.login/2, call.enqueue/2, getView().advance/0...
true
ok
{"focal": {"class": "LoginPresenter", "name": "onLoginClick", "signature": "void onLoginClick()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "LoginPresenter", "kind": "class", "modifiers": "", "superclass": "AbstractPresenter<ILoginView>", "interfaces": null, "f...
43923787_43
class PropertiesLoader { public static Properties load(final String path) { try { InputStream input = null; try { final Resource resource = new ClassPathResource(path); input = resource.getInputStream(); } catch (final IOException e) { ...
final String path = "/context.properties"; final String notFoundPath = "/context_notfound.properties"; final String classPath = "classpath:context.properties"; try { PropertiesLoader.load(notFoundPath); } catch (final Throwable e) { Assert.assertEquals(e i...
[FOCAL] public static Properties PropertiesLoader.load(String path) [CLASS] class PropertiesLoader [METRICS] loc=22 cc=4 branches=1 loops=0 returns=1 throws=1 nesting=2 [CALLS-EXTERNAL] Resource.getInputStream/0, PropertiesLoader.load/1, ResourceUtils.getFile/1, IOException.getMessage/0 [NEW] ClassPathResource, LoaderE...
/* static context [FOCAL] public static Properties PropertiesLoader.load(String path) [THROWS-WHEN] LoaderException when try-body throws [PATH1] try-body throws -> if(input != null)=T -> return properties [PATH2] try-body throws -> throw new LoaderException("加载属性文件异常: " + e.getMessage(), e) [PATH3] if(input != null)=F ...
/* static context [FOCAL] public static Properties PropertiesLoader.load(String path) [THROWS-WHEN] LoaderException when try-body throws [PATH1] try-body throws -> if(input != null)=T -> return properties [PATH2] try-body throws -> throw new LoaderException("加载属性文件异常: " + e.getMessage(), e) [PATH3] if(input != null)=F ...
true
ok
{"focal": {"class": "PropertiesLoader", "name": "load", "signature": "Properties load(String path)", "start_line": 3, "modifiers": "public static", "params": [{"name": "path", "type": "String"}], "return_type": "Properties"}, "class_info": {"name": "PropertiesLoader", "kind": "class", "modifiers": "", "superclass": nul...
43952556_16
class DefaultDatabaseAccessor implements DatabaseAccessor { public void createDatabase() throws StorageExistsException { this.fileStructure.initializeStorage(storage, attributes, ATTRIBUTE_VERSION); } DefaultDatabaseAccessor(String version, String databaseName, Storage storage); DefaultDat...
DefaultDatabaseAccessor accessor = new DefaultDatabaseAccessor("x.y", "myDb", storage, extraAttributes("custom", "myValue"), fileStructure, recordStructure); accessor.createDatabase(); ArgumentCaptor<Map<String, String>> actualAtts = ArgumentCaptor.forClass(Map.class); verify(fileStr...
[FOCAL] public void DefaultDatabaseAccessor.createDatabase() [CLASS] class DefaultDatabaseAccessor implements DatabaseAccessor [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] this.fileStructure.initializeStorage/3 [FIELDS] read=fileStructure [EXCEPTIONS] declares StorageExistsExcep...
/* static context [FOCAL] public void DefaultDatabaseAccessor.createDatabase() [COLLABORATORS] field fileStructure initializeStorage/3 [EXCEPTIONS] declares StorageExistsException [FIELDS] read=fileStructure [CALLS-EXTERNAL] this.fileStructure.initializeStorage/3 */
/* static context [FOCAL] public void DefaultDatabaseAccessor.createDatabase() [COLLABORATORS] field fileStructure initializeStorage/3 [EXCEPTIONS] declares StorageExistsException [FIELDS] read=fileStructure [CALLS-EXTERNAL] this.fileStructure.initializeStorage/3 */ class DefaultDatabaseAccessor implements DatabaseAcce...
true
ok
{"focal": {"class": "DefaultDatabaseAccessor", "name": "createDatabase", "signature": "void createDatabase() throws StorageExistsException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "DefaultDatabaseAccessor", "kind": "class", "modifiers": "", "superclass": nul...
44007584_141
class UrlUtils { public static Map<String, String> convertSubscribe(Map<String, String> subscribe) { Map<String, String> newSubscribe = new HashMap<String, String>(); for (Map.Entry<String, String> entry : subscribe.entrySet()) { String serviceName = entry.getKey(); String s...
String key = "perf/dubbo.test.api.HelloService:1.0.0"; Map<String, String> subscribe = new HashMap<String, String>(); subscribe.put(key, null); Map<String, String> newSubscribe = UrlUtils.convertSubscribe(subscribe); assertEquals(subscribe, newSubscribe); } }
[FOCAL] public static Map<String, String> UrlUtils.convertSubscribe(Map<String, String> subscribe) [CLASS] class UrlUtils [METRICS] loc=25 cc=5 branches=3 loops=1 returns=1 throws=0 nesting=3 [CALLS-EXTERNAL] Map<String, String>.entrySet/0, Map.Entry<String, String>.getKey/0, Map.Entry<String, String>.getValue/0, Strin...
/* static context [FOCAL] public static Map<String, String> UrlUtils.convertSubscribe(Map<String, String> subscribe) [PATH1] foreach(Map.Entry<String, String> entry : subscribe.entrySet())=T -> if(!serviceName.contains(":") && !serviceName.contains("/"))=T -> if(group != null && group.length() > 0)=T -> if(version != n...
/* static context [FOCAL] public static Map<String, String> UrlUtils.convertSubscribe(Map<String, String> subscribe) [PATH1] foreach(Map.Entry<String, String> entry : subscribe.entrySet())=T -> if(!serviceName.contains(":") && !serviceName.contains("/"))=T -> if(group != null && group.length() > 0)=T -> if(version != n...
true
ok
{"focal": {"class": "UrlUtils", "name": "convertSubscribe", "signature": "Map<String, String> convertSubscribe(Map<String, String> subscribe)", "start_line": 3, "modifiers": "public static", "params": [{"name": "subscribe", "type": "Map<String, String>"}], "return_type": "Map<String, String>"}, "class_info": {"name": "...
44013219_19
class ProcessEnginePluginEvent extends Event<T> { public static PreInitEvent preInit(ProcessEngineConfigurationImpl processEngineConfiguration) { return new PreInitEvent(processEngineConfiguration); } protected ProcessEnginePluginEvent(T data, Class<S> type); public static PostInitEvent postInit(Process...
camundaEventBus.register(new AbstractProcessEnginePlugin() { @Override public void preInit(ProcessEngineConfigurationImpl processEngineConfiguration) { processEngineConfiguration.getBeans(); } }); camundaEventBus.notify(ProcessEnginePluginEvent.preInit(processEngineConfiguration))...
[FOCAL] public static PreInitEvent ProcessEnginePluginEvent.preInit(ProcessEngineConfigurationImpl processEngineConfiguration) [CLASS] class ProcessEnginePluginEvent extends Event<T> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] PreInitEvent [INPUTS] branches=- | result=processEngineConfigu...
/* static context [FOCAL] public static PreInitEvent ProcessEnginePluginEvent.preInit(ProcessEngineConfigurationImpl processEngineConfiguration) [INPUTS] branches=- | result=processEngineConfiguration [NEW] PreInitEvent */
/* static context [FOCAL] public static PreInitEvent ProcessEnginePluginEvent.preInit(ProcessEngineConfigurationImpl processEngineConfiguration) [INPUTS] branches=- | result=processEngineConfiguration [NEW] PreInitEvent */ class ProcessEnginePluginEvent extends Event<T> { public static PreInitEvent preInit(ProcessEn...
true
ok
{"focal": {"class": "ProcessEnginePluginEvent", "name": "preInit", "signature": "PreInitEvent preInit(ProcessEngineConfigurationImpl processEngineConfiguration)", "start_line": 3, "modifiers": "public static", "params": [{"name": "processEngineConfiguration", "type": "ProcessEngineConfigurationImpl"}], "return_type": "...
44013289_4
class TypeUtils { public static boolean equals(@Nullable Object left, @Nullable Object right) { if (left == right) { return true; } if (left == null || right == null) { return false; } // handle arrays on both sides as special case for efficiency Class<?> leftClass = left.getClass(...
Integer[] integers1 = new Integer[]{Integer.valueOf(1), Integer.valueOf(2)}; Integer[] integers2 = new Integer[]{Integer.valueOf(1), Integer.valueOf(2), new Integer(3)}; int[] ints1 = {1, 2}; int[] ints2 = {1, 2, 3}; List<Integer> lintegers = asList(Integer.valueOf(1), Integer.va...
[FOCAL] public static boolean TypeUtils.equals(Object left, Object right) [CLASS] class TypeUtils [METRICS] loc=38 cc=12 branches=11 loops=0 returns=9 throws=0 nesting=3 [CALLS-INTERNAL] List primitiveArrayToList(Object array); boolean arrayEqual(Object left, Object right); boolean equals(int[] left, int[] right) [CALL...
class TypeUtils { public static boolean equals(@Nullable Object left, @Nullable Object right) { if (left == right) { return true; } if (left == null || right == null) { return false; } // handle arrays on both sides as special case for efficiency Class<?> leftClass = left.getClass(...
false
ok
{"focal": {"class": "TypeUtils", "name": "equals", "signature": "boolean equals(Object left, Object right)", "start_line": 3, "modifiers": "public static", "params": [{"name": "left", "type": "Object"}, {"name": "right", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "TypeUtils", "kind": "class",...
44064037_42
class Load8BitRegisterAIntoHLAddress extends Instruction { @Override public void execute() { byte registerValue = z80.get8BitRegisterValue(Register.A); int address = z80.get16BitRegisterValue(Register.HL); mmu.writeByte(address, registerValue); z80.setLastInstructionExecutionTime(2); } Load8Bi...
Instruction instruction = new Load8BitRegisterAIntoHLAddress(z80, mmu); instruction.execute(); assertEquals(2, z80.getLastInstructionExecutionTime()); } }
[FOCAL] @Override public void Load8BitRegisterAIntoHLAddress.execute() [CLASS] class Load8BitRegisterAIntoHLAddress extends Instruction [METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] z80.get8BitRegisterValue/1, z80.get16BitRegisterValue/1, mmu.writeByte/2, z80.setLastInstructionEx...
/* static context [FOCAL] @Override public void Load8BitRegisterAIntoHLAddress.execute() [COLLABORATORS] field z80 get8BitRegisterValue/1,get16BitRegisterValue/1,setLastInstructionExecutionTime/1; field mmu writeByte/2 [CALLS-EXTERNAL] z80.get8BitRegisterValue/1, z80.get16BitRegisterValue/1, mmu.writeByte/2, z80.setLas...
/* static context [FOCAL] @Override public void Load8BitRegisterAIntoHLAddress.execute() [COLLABORATORS] field z80 get8BitRegisterValue/1,get16BitRegisterValue/1,setLastInstructionExecutionTime/1; field mmu writeByte/2 [CALLS-EXTERNAL] z80.get8BitRegisterValue/1, z80.get16BitRegisterValue/1, mmu.writeByte/2, z80.setLas...
true
ok
{"focal": {"class": "Load8BitRegisterAIntoHLAddress", "name": "execute", "signature": "void execute()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "Load8BitRegisterAIntoHLAddress", "kind": "class", "modifiers": "", "superclass": "Instruction", "interfa...
44124366_61
class DefaultFilterDialect implements JoinFilterDialect, SubqueryFilterDialect { @Override public Map<String, FilterExpression> parseTypedExpression(String path, MultivaluedMap<String, String> filterParams) throws ParseException { Map<String, FilterExpression> expressionMap = new HashMap<>(...
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<>(); queryParams.add( "filter[book.awards][hasnomember]", "awards1" ); assertEquals( "{book=book.awards HASNOMEMBER [awards1]}", dialect.parseTypedExpressi...
[FOCAL] @Override public Map<String, FilterExpression> DefaultFilterDialect.parseTypedExpression(String path, MultivaluedMap<String, String> filterParams) [CLASS] class DefaultFilterDialect implements JoinFilterDialect, SubqueryFilterDialect [METRICS] loc=19 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-I...
/* static context [FOCAL] @Override public Map<String, FilterExpression> DefaultFilterDialect.parseTypedExpression(String path, MultivaluedMap<String, String> filterParams) [PATH1] foreach(FilterPredicate filterPredicate : filterPredicates)=T -> if(filterExpression != null)=T -> exit loop -> return expressionMap [PATH2...
/* static context [FOCAL] @Override public Map<String, FilterExpression> DefaultFilterDialect.parseTypedExpression(String path, MultivaluedMap<String, String> filterParams) [PATH1] foreach(FilterPredicate filterPredicate : filterPredicates)=T -> if(filterExpression != null)=T -> exit loop -> return expressionMap [PATH2...
true
ok
{"focal": {"class": "DefaultFilterDialect", "name": "parseTypedExpression", "signature": "Map<String, FilterExpression> parseTypedExpression(String path, MultivaluedMap<String, String> filterParams) throws ParseException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "path", "type": "String"}, ...
44130574_4
class EtcdClient implements InitializingBean, DisposableBean { public EtcdResponse put(final String key, final String value) throws EtcdException { UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(KEYSPACE); builder.pathSegment(key); MultiValueMap<String, String> payload = new LinkedMultiValue...
server.expect(MockRestRequestMatchers.requestTo("http://localhost:2379/v2/keys/sample?ttl=60")) .andExpect(MockRestRequestMatchers.method(HttpMethod.PUT)) .andExpect(MockRestRequestMatchers.content().contentType(MediaType.APPLICATION_FORM_URLENCODED)) .andExpect(MockRestRequestMatchers.content().string("v...
[FOCAL] public EtcdResponse EtcdClient.put(String key, String value) [CLASS] class EtcdClient implements InitializingBean, DisposableBean [METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] T execute(UriComponentsBuilder uriTemplate, HttpMethod method, MultiValueMap<String, String> req...
/* static context [FOCAL] public EtcdResponse EtcdClient.put(String key, String value) [EXCEPTIONS] declares EtcdException [CALLS-INTERNAL] T execute(UriComponentsBuilder uriTemplate, HttpMethod method, MultiValueMap<String, String> requestData, Class<T> responseType) [NEW] LinkedMultiValueMap<> [CALLS-EXTERNAL] UriCom...
/* static context [FOCAL] public EtcdResponse EtcdClient.put(String key, String value) [EXCEPTIONS] declares EtcdException [CALLS-INTERNAL] T execute(UriComponentsBuilder uriTemplate, HttpMethod method, MultiValueMap<String, String> requestData, Class<T> responseType) [NEW] LinkedMultiValueMap<> [CALLS-EXTERNAL] UriCom...
true
ok
{"focal": {"class": "EtcdClient", "name": "put", "signature": "EtcdResponse put(String key, String value) throws EtcdException", "start_line": 3, "modifiers": "public", "params": [{"name": "key", "type": "String"}, {"name": "value", "type": "String"}], "return_type": "EtcdResponse"}, "class_info": {"name": "EtcdClient"...
44133514_1
class BundleUtils { public static boolean equals(Bundle left, Bundle right) { if (left == right) { return true; } if (left == null || right == null) { return false; } final Set<String> leftSet = left.keySet(); final Set<St...
final Bundle left = new Bundle(); left.putInt("int", 9); left.putDouble("double", 1.D); final Bundle right = new Bundle(); right.putInt("int2", 9); right.putDouble("double", 1.D); assertFalse(BundleUtils.equals(left, right)); } }
[FOCAL] public static boolean BundleUtils.equals(Bundle left, Bundle right) [CLASS] class BundleUtils [METRICS] loc=49 cc=10 branches=8 loops=1 returns=8 throws=0 nesting=3 [CALLS-EXTERNAL] Bundle.keySet/0, Set<String>.size/0, Set<String>.contains/1, Bundle.get/1, BundleUtils.equals/2, Object.equals/1 [PATH1] if(left =...
/* static context [FOCAL] public static boolean BundleUtils.equals(Bundle left, Bundle right) [PATH1] if(left == right)=F -> if(left == null || right == null)=F -> if(leftSet.size() != rightSet.size())=F -> foreach(String key : leftSet)=T -> if(!rightSet.contains(key))=F -> if(leftValue instanceof Bundle)=T -> if(!(rig...
/* static context [FOCAL] public static boolean BundleUtils.equals(Bundle left, Bundle right) [PATH1] if(left == right)=F -> if(left == null || right == null)=F -> if(leftSet.size() != rightSet.size())=F -> foreach(String key : leftSet)=T -> if(!rightSet.contains(key))=F -> if(leftValue instanceof Bundle)=T -> if(!(rig...
true
ok
{"focal": {"class": "BundleUtils", "name": "equals", "signature": "boolean equals(Bundle left, Bundle right)", "start_line": 3, "modifiers": "public static", "params": [{"name": "left", "type": "Bundle"}, {"name": "right", "type": "Bundle"}], "return_type": "boolean"}, "class_info": {"name": "BundleUtils", "kind": "cla...
44167878_7
class Utils { public static String trimPreffix(String s, String preffix) { if (Strings.isNullOrEmpty(preffix)) return s; return s.startsWith(preffix) ? s.substring(preffix.length()) : s; } public static boolean isNull(Object object); public static boolean atLeastOneIsNull(Object... objects); public static...
assertEquals("toto", Utils.trimPreffix("toto", "titi")); assertEquals("toto", Utils.trimPreffix("tititoto", "titi")); assertEquals("tototiti", Utils.trimPreffix("tototiti", "titi")); assertEquals("toto", Utils.trimPreffix("toto", "")); assertEquals("", Utils.trimPreffix("titi", "titi")); assertEquals("", Ut...
[FOCAL] public static String Utils.trimPreffix(String s, String preffix) [CLASS] class Utils [METRICS] loc=5 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] Strings.isNullOrEmpty/1, String.startsWith/1, String.substring/1, String.length/0 [PATH1] if(Strings.isNullOrEmpty(preffix))=T -> return s [P...
/* static context [FOCAL] public static String Utils.trimPreffix(String s, String preffix) [PATH1] if(Strings.isNullOrEmpty(preffix))=T -> return s [PATH2] if(Strings.isNullOrEmpty(preffix))=F -> return s.startsWith(preffix) ? s.substring(preffix.length()) : s [INPUTS] branches=preffix | result=preffix, s [CALLS-EXTERN...
/* static context [FOCAL] public static String Utils.trimPreffix(String s, String preffix) [PATH1] if(Strings.isNullOrEmpty(preffix))=T -> return s [PATH2] if(Strings.isNullOrEmpty(preffix))=F -> return s.startsWith(preffix) ? s.substring(preffix.length()) : s [INPUTS] branches=preffix | result=preffix, s [CALLS-EXTERN...
true
ok
{"focal": {"class": "Utils", "name": "trimPreffix", "signature": "String trimPreffix(String s, String preffix)", "start_line": 3, "modifiers": "public static", "params": [{"name": "s", "type": "String"}, {"name": "preffix", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Utils", "kind": "class", "...
44190749_14
class UserManagementController extends AbstractUserAndContractsController { @RequestMapping(value = TgolKeyStore.EDIT_USER_URL, method = RequestMethod.POST) @Secured(TgolKeyStore.ROLE_ADMIN_KEY) protected String submitEditUserForm( @ModelAttribute(TgolKeyStore.CREATE_USER_COMMAND_KEY) CreateUse...
setUpMockRoleDataService(); setUpMockUserDataService(false, false, false); setUpMockAuthenticationContext(); // Finally the form is conform and the admin page is returned CreateUserCommand createUserCommand = createUserCommandFactory.getNewCreateUserCommand(); createUser...
[FOCAL] @RequestMapping(value = TgolKeyStore.EDIT_USER_URL, method = RequestMethod.POST) @Secured(TgolKeyStore.ROLE_ADMIN_KEY... String UserManagementController.submitEditUserForm(CreateUserCommand createUserCommand, BindingResult result, HttpServletRequest request, Model model) [CLASS] class UserManagementController e...
/* static context [FOCAL] @RequestMapping(value = TgolKeyStore.EDIT_USER_URL, method = RequestMethod.POST) @Secured(TgolKeyStore.ROLE_ADMIN_KEY... String UserManagementController.submitEditUserForm(CreateUserCommand createUserCommand, BindingResult result, HttpServletRequest request, Model model) */
/* static context [FOCAL] @RequestMapping(value = TgolKeyStore.EDIT_USER_URL, method = RequestMethod.POST) @Secured(TgolKeyStore.ROLE_ADMIN_KEY... String UserManagementController.submitEditUserForm(CreateUserCommand createUserCommand, BindingResult result, HttpServletRequest request, Model model) */ class UserManagemen...
true
ok
{"focal": {"class": "UserManagementController", "name": "submitEditUserForm", "signature": "String submitEditUserForm(CreateUserCommand createUserCommand, BindingResult result, HttpServletRequest request, Model model) throws Exception", "start_line": 3, "modifiers": "@RequestMapping(value = TgolKeyStore.EDIT_USER_URL, ...
44196774_1
class PostsPresenter { public void loadPostsFromAPI() { /* postsAPI.getPostsObservable().retryWhen(new Function<Observable<? extends Throwable>, Observable<?>>() { @Override public Observable<?> apply(Observable<? extends Throwable> errorNotification) { return erro...
//create mocks Observable<List<Post>> postsObservable = (Observable<List<Post>>) mock(Observable.class); //define return values when(postsPresenter.postsAPI.getPostsObservable()).thenReturn(postsObservable); when(postsObservable.subscribeOn(Schedulers.io())).thenReturn(postsObs...
[FOCAL] public void PostsPresenter.loadPostsFromAPI() [CLASS] class PostsPresenter [METRICS] loc=82 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] Function<Observable<? extends Throwable>, Observable<?>> exponentialBackoffForExceptions(long initialDelay, int numRetries, TimeUnit unit, Class<? ext...
/* static context [FOCAL] public void PostsPresenter.loadPostsFromAPI() [COLLABORATORS] field postsAPI getPostsObservable/0 [CALLS-INTERNAL] Function<Observable<? extends Throwable>, Observable<?>> exponentialBackoffForExceptions(long initialDelay, int numRetries, TimeUnit unit, Class<? extends Throwable>... errorTypes...
/* static context [FOCAL] public void PostsPresenter.loadPostsFromAPI() [COLLABORATORS] field postsAPI getPostsObservable/0 [CALLS-INTERNAL] Function<Observable<? extends Throwable>, Observable<?>> exponentialBackoffForExceptions(long initialDelay, int numRetries, TimeUnit unit, Class<? extends Throwable>... errorTypes...
true
ok
{"focal": {"class": "PostsPresenter", "name": "loadPostsFromAPI", "signature": "void loadPostsFromAPI()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "PostsPresenter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "...
44250608_23
class FlowFilter implements HttpFilter { @Override public void doFilter(final HttpServletRequest request, final HttpServletResponse response, final FilterChain chain) throws IOException, ServletException { flow.readFrom(request::getHeader); if (isLegacyRequest(request)) { ...
assertThrows(IllegalArgumentException.class, () -> filter.doFilter(mock(ServletRequest.class), mock(HttpServletResponse.class), null)); } }
[FOCAL] @Override public void FlowFilter.doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain) [CLASS] class FlowFilter implements HttpFilter [METRICS] loc=9 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] boolean isLegacyRequest(HttpServletRequest request) [CALLS-E...
/* static context [FOCAL] @Override public void FlowFilter.doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain) [PATH1] if(isLegacyRequest(request))=T [PATH2] if(isLegacyRequest(request))=F [INPUTS] branches=request | result=- [COLLABORATORS] field flow:Flow readFrom/1,writeTo/1; param ...
/* static context [FOCAL] @Override public void FlowFilter.doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain) [PATH1] if(isLegacyRequest(request))=T [PATH2] if(isLegacyRequest(request))=F [INPUTS] branches=request | result=- [COLLABORATORS] field flow:Flow readFrom/1,writeTo/1; param ...
true
ok
{"focal": {"class": "FlowFilter", "name": "doFilter", "signature": "void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "HttpServletRequest"}, {"name": "...
44253742_143
class NomadEndpoint implements NomadServer<T> { @Override public AcceptRejectResponse rollback(RollbackMessage message) throws NomadException { return server.rollback(message); } public NomadEndpoint(InetSocketAddress address, NomadServer<T> server); public InetSocketAddress getAddress(); @Override ...
when(server.rollback(rollbackMessage)).thenReturn(acceptRejectResponse); NomadEndpoint<String> namedServer = new NomadEndpoint<>(name, server); assertEquals(acceptRejectResponse, namedServer.rollback(rollbackMessage)); verify(server).rollback(rollbackMessage); } }
[FOCAL] @Override public AcceptRejectResponse NomadEndpoint.rollback(RollbackMessage message) [CLASS] class NomadEndpoint implements NomadServer<T> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] NomadServer<String>.rollback/1 [FIELDS] read=server:NomadServer<String> [EXCEPTIONS] d...
/* static context [FOCAL] @Override public AcceptRejectResponse NomadEndpoint.rollback(RollbackMessage message) [INPUTS] branches=- | result=message, server [COLLABORATORS] field server:NomadServer<String> rollback/1 [EXCEPTIONS] declares NomadException [FIELDS] read=server:NomadServer<String> [CALLS-EXTERNAL] NomadSer...
/* static context [FOCAL] @Override public AcceptRejectResponse NomadEndpoint.rollback(RollbackMessage message) [INPUTS] branches=- | result=message, server [COLLABORATORS] field server:NomadServer<String> rollback/1 [EXCEPTIONS] declares NomadException [FIELDS] read=server:NomadServer<String> [CALLS-EXTERNAL] NomadSer...
true
ok
{"focal": {"class": "NomadEndpoint", "name": "rollback", "signature": "AcceptRejectResponse rollback(RollbackMessage message) throws NomadException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "message", "type": "RollbackMessage"}], "return_type": "AcceptRejectResponse"}, "class_info": {"name...
44253783_1032
class MetadataTotalsInterceptor extends MetadataMetricsInterceptorImpl { private int getValue(String key, AdaptrisMessage msg) { if (!msg.headersContainsKey(key)) { return 0; } return Integer.parseInt(msg.getMetadataValue(key)); } public MetadataTotalsInterceptor(); public MetadataTotalsIn...
LifecycleHelper.init(metricsInterceptor); LifecycleHelper.start(metricsInterceptor); AdaptrisMessage message = createMessage(); assertEquals(0, metricsInterceptor.getStats().size()); submitMessage(message); // Make sure there is 1 message in the cache assertEquals(1, metricsInterceptor.getS...
[FOCAL] private int MetadataTotalsInterceptor.getValue(String key, AdaptrisMessage msg) [CLASS] class MetadataTotalsInterceptor extends MetadataMetricsInterceptorImpl [METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] AdaptrisMessage.headersContainsKey/1, Integer.parseInt/1, AdaptrisM...
/* static context [FOCAL] private int MetadataTotalsInterceptor.getValue(String key, AdaptrisMessage msg) [PATH1] if(!msg.headersContainsKey(key))=T -> return 0 [PATH2] if(!msg.headersContainsKey(key))=F -> return Integer.parseInt(msg.getMetadataValue(key)) [INPUTS] branches=key, msg | result=key, msg [COLLABORATORS] p...
/* static context [FOCAL] private int MetadataTotalsInterceptor.getValue(String key, AdaptrisMessage msg) [PATH1] if(!msg.headersContainsKey(key))=T -> return 0 [PATH2] if(!msg.headersContainsKey(key))=F -> return Integer.parseInt(msg.getMetadataValue(key)) [INPUTS] branches=key, msg | result=key, msg [COLLABORATORS] p...
true
ok
{"focal": {"class": "MetadataTotalsInterceptor", "name": "getValue", "signature": "int getValue(String key, AdaptrisMessage msg)", "start_line": 3, "modifiers": "private", "params": [{"name": "key", "type": "String"}, {"name": "msg", "type": "AdaptrisMessage"}], "return_type": "int"}, "class_info": {"name": "MetadataTo...
44263579_1
class InventoryService { public InventoryCategory getCategory(String name) { if (name == null) { return null; } return inventoryRepository.findByName(name); } public List<InventoryCategory> getAllCategories(); public void addCategory(InventoryCategory category); @Inject private Inven...
InventoryCategory category = inventoryService.getCategory("default_category"); Assert.assertEquals("default description", category.getCategoryDescription()); category = inventoryService.getCategory("extra_category"); Assert.assertEquals(1002, category.getId()); Assert.assertEqual...
[FOCAL] public InventoryCategory InventoryService.getCategory(String name) [CLASS] class InventoryService [METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] inventoryRepository.findByName/1 [PATH1] if(name == null)=T -> return null [PATH2] if(name == null)=F -> return inventoryReposit...
/* static context [FOCAL] public InventoryCategory InventoryService.getCategory(String name) [PATH1] if(name == null)=T -> return null [PATH2] if(name == null)=F -> return inventoryRepository.findByName(name) [INPUTS] branches=name | result=name [COLLABORATORS] field inventoryRepository findByName/1 [CALLS-EXTERNAL] in...
/* static context [FOCAL] public InventoryCategory InventoryService.getCategory(String name) [PATH1] if(name == null)=T -> return null [PATH2] if(name == null)=F -> return inventoryRepository.findByName(name) [INPUTS] branches=name | result=name [COLLABORATORS] field inventoryRepository findByName/1 [CALLS-EXTERNAL] in...
true
ok
{"focal": {"class": "InventoryService", "name": "getCategory", "signature": "InventoryCategory getCategory(String name)", "start_line": 3, "modifiers": "public", "params": [{"name": "name", "type": "String"}], "return_type": "InventoryCategory"}, "class_info": {"name": "InventoryService", "kind": "class", "modifiers": ...
44293742_1
class WXBizMsgCrypt { String encrypt(String randomStr, String text) throws AesException { ByteGroup byteCollector = new ByteGroup(); byte[] randomStrBytes = randomStr.getBytes(CHARSET); byte[] textBytes = text.getBytes(CHARSET); byte[] networkBytesOrder = getNetworkBytesOrder(textBytes.length); byte[] corpi...
try { WXBizMsgCrypt pc = new WXBizMsgCrypt(token, encodingAesKey, corpId); assertEquals(afterAesEncrypt2, pc.encrypt(randomStr, replyMsg2)); } catch (AesException e) { e.printStackTrace(); fail("no异常"); } } }
[FOCAL] String WXBizMsgCrypt.encrypt(String randomStr, String text) [CLASS] class WXBizMsgCrypt [METRICS] loc=39 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] byte[] getNetworkBytesOrder(int sourceNumber) [CALLS-EXTERNAL] String.getBytes/1, ByteGroup.addBytes/1, PKCS7Encoder.encode/1, ByteGroup....
/* static context [FOCAL] String WXBizMsgCrypt.encrypt(String randomStr, String text) [THROWS-WHEN] AesException when try-body throws [PATH1] try-body throws -> throw new AesException(AesException.EncryptAESError) [PATH2] return base64Encrypted [COLLABORATORS] field corpId:String getBytes/1; field base64 encodeToString...
/* static context [FOCAL] String WXBizMsgCrypt.encrypt(String randomStr, String text) [THROWS-WHEN] AesException when try-body throws [PATH1] try-body throws -> throw new AesException(AesException.EncryptAESError) [PATH2] return base64Encrypted [COLLABORATORS] field corpId:String getBytes/1; field base64 encodeToString...
true
ok
{"focal": {"class": "WXBizMsgCrypt", "name": "encrypt", "signature": "String encrypt(String randomStr, String text) throws AesException", "start_line": 3, "modifiers": "", "params": [{"name": "randomStr", "type": "String"}, {"name": "text", "type": "String"}], "return_type": "String"}, "class_info": {"name": "WXBizMsgC...
44308560_186
class Events { static Map<String, String> ensureOrderedMapOfStringsToStrings(final Map<?, ?> map) { final Map<String, String> result = new LinkedHashMap<>(); map.forEach((key, value) -> result.put((String) key, (String) value)); return result; } static URI toFileUri(final String so...
final Map<?, ?> map = ImmutableMap.of("x", "a", "y", new Object()); assertThatExceptionOfType(ClassCastException.class) .isThrownBy(() -> Events.ensureOrderedMapOfStringsToStrings(map)); } }
[FOCAL] static Map<String, String> Events.ensureOrderedMapOfStringsToStrings(Map<?, ?> map) [CLASS] class Events [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Map<?, ?>.forEach/1, Map<String, String>.put/2 [NEW] LinkedHashMap<> [COLLABORATORS] param map:Map<?, ?> forEach/1 [DATAF...
/* static context [FOCAL] static Map<String, String> Events.ensureOrderedMapOfStringsToStrings(Map<?, ?> map) [COLLABORATORS] param map:Map<?, ?> forEach/1 [NEW] LinkedHashMap<> [CALLS-EXTERNAL] Map<?, ?>.forEach/1, Map<String, String>.put/2 */
/* static context [FOCAL] static Map<String, String> Events.ensureOrderedMapOfStringsToStrings(Map<?, ?> map) [COLLABORATORS] param map:Map<?, ?> forEach/1 [NEW] LinkedHashMap<> [CALLS-EXTERNAL] Map<?, ?>.forEach/1, Map<String, String>.put/2 */ class Events { static Map<String, String> ensureOrderedMapOfStringsToS...
true
ok
{"focal": {"class": "Events", "name": "ensureOrderedMapOfStringsToStrings", "signature": "Map<String, String> ensureOrderedMapOfStringsToStrings(Map<?, ?> map)", "start_line": 3, "modifiers": "static", "params": [{"name": "map", "type": "Map<?, ?>"}], "return_type": "Map<String, String>"}, "class_info": {"name": "Event...
44336879_2
class ReLinkerInstance { protected File getWorkaroundLibFile(final Context context, final String library, final String version) { final String libName = libraryLoader.mapLibraryName(library); if (TextUtils.isEmpty(vers...
final ReLinkerInstance instance = new ReLinkerInstance(testLoader, testInstaller); final String libName = testLoader.mapLibraryName(TEST_LIB); final File libFile = new File(libDir, libName); assertThat(instance.getWorkaroundLibFile(context, TEST_LIB, null), is(libFile)); final F...
[FOCAL] protected File ReLinkerInstance.getWorkaroundLibFile(Context context, String library, String version) [CLASS] class ReLinkerInstance [METRICS] loc=11 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] File getWorkaroundLibDir(Context context) [CALLS-EXTERNAL] libraryLoader.mapLibraryName/1, T...
/* static context [FOCAL] protected File ReLinkerInstance.getWorkaroundLibFile(Context context, String library, String version) [PATH1] if(TextUtils.isEmpty(version))=T -> return new File(getWorkaroundLibDir(context), libName) [PATH2] if(TextUtils.isEmpty(version))=F -> return new File(getWorkaroundLibDir(context), lib...
/* static context [FOCAL] protected File ReLinkerInstance.getWorkaroundLibFile(Context context, String library, String version) [PATH1] if(TextUtils.isEmpty(version))=T -> return new File(getWorkaroundLibDir(context), libName) [PATH2] if(TextUtils.isEmpty(version))=F -> return new File(getWorkaroundLibDir(context), lib...
true
ok
{"focal": {"class": "ReLinkerInstance", "name": "getWorkaroundLibFile", "signature": "File getWorkaroundLibFile(Context context, String library, String version)", "start_line": 3, "modifiers": "protected", "params": [{"name": "context", "type": "Context"}, {"name": "library", "type": "String"}, {"name": "version", "typ...
44343498_11
class TranslatorFactory extends BaseComponentFactory<Translator, TranslatorConfiguration> { public static Translator buildTranslator() throws ToolkitException { return buildTranslator(null, null); } public TranslatorFactory(); public TranslatorFactory(Properties properties); public Tr...
Properties properties = new Properties(); properties.setProperty(TranslatorConfiguration.TRANSLATOR_CLASS_NAME_KEY, FakeTranslator.class.getName()); Translator translator = TranslatorFactory.buildTranslator(null, properties); assertNotNull("Translator was not built.", translator); } ...
[FOCAL] public static Translator TranslatorFactory.buildTranslator() [CLASS] class TranslatorFactory extends BaseComponentFactory<Translator, TranslatorConfiguration> [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Translator buildTranslator(String appName, Properties properties) [...
/* static context [FOCAL] public static Translator TranslatorFactory.buildTranslator() [EXCEPTIONS] declares ToolkitException [CALLS-INTERNAL] Translator buildTranslator(String appName, Properties properties) */
/* static context [FOCAL] public static Translator TranslatorFactory.buildTranslator() [EXCEPTIONS] declares ToolkitException [CALLS-INTERNAL] Translator buildTranslator(String appName, Properties properties) */ class TranslatorFactory extends BaseComponentFactory<Translator, TranslatorConfiguration> { public stat...
true
ok
{"focal": {"class": "TranslatorFactory", "name": "buildTranslator", "signature": "Translator buildTranslator() throws ToolkitException", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Translator"}, "class_info": {"name": "TranslatorFactory", "kind": "class", "modifiers": "", "superclass": ...
44431868_10
class AuthObservable { @Deprecated public Observable<AuthToken> getToken(final Context context, final String email, final String scope) { return Observable.create(new Observable.OnSubscribe<AuthToken>() { @Override public void call(Subscriber<? super AuthToken> observer) { ...
Exception e = new Exception(); when(GoogleAuthUtil.getToken(context, "email", scope)).thenThrow(e); sut.getToken(context, "email", scope).subscribe(testSubscriber); testSubscriber.assertError(e); } }
[FOCAL] @Deprecated public Observable<AuthToken> AuthObservable.getToken(Context context, String email, String scope) [CLASS] class AuthObservable [METRICS] loc=18 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] Observable.create/1, GoogleAuthUtil.getToken/3, observer.isUnsubscribed/0, observer.on...
/* static context [FOCAL] @Deprecated public Observable<AuthToken> AuthObservable.getToken(Context context, String email, String scope) [INPUTS] branches=- | result=context, email, scope [COLLABORATORS] field observer isUnsubscribed/0,onNext/1,onCompleted/0,onError/1 [NEW] Observable.OnSubscribe<AuthToken>, AuthToken [...
/* static context [FOCAL] @Deprecated public Observable<AuthToken> AuthObservable.getToken(Context context, String email, String scope) [INPUTS] branches=- | result=context, email, scope [COLLABORATORS] field observer isUnsubscribed/0,onNext/1,onCompleted/0,onError/1 [NEW] Observable.OnSubscribe<AuthToken>, AuthToken [...
true
ok
{"focal": {"class": "AuthObservable", "name": "getToken", "signature": "Observable<AuthToken> getToken(Context context, String email, String scope)", "start_line": 3, "modifiers": "@Deprecated public", "params": [{"name": "context", "type": "Context"}, {"name": "email", "type": "String"}, {"name": "scope", "type": "Str...
44431891_7
class PreferencesHelper { public int getAutoRefreshInterval() { return Integer.valueOf(mSettingsPref.getString(mResources.getString(R.string.preferences_settings_key_auto_refresh_interval), "3")); } @Inject public PreferencesHelper(Context context); public void clear(); public void saveS...
assertThat(mPreferencesHelper.getAutoRefreshInterval()).isEqualTo(3); } }
[FOCAL] public int PreferencesHelper.getAutoRefreshInterval() [CLASS] class PreferencesHelper [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Integer.valueOf/1, mSettingsPref.getString/2, mResources.getString/1 [COLLABORATORS] field mSettingsPref getString/2; field mResources getSt...
/* static context [FOCAL] public int PreferencesHelper.getAutoRefreshInterval() [COLLABORATORS] field mSettingsPref getString/2; field mResources getString/1 [CALLS-EXTERNAL] Integer.valueOf/1, mSettingsPref.getString/2, mResources.getString/1 */
/* static context [FOCAL] public int PreferencesHelper.getAutoRefreshInterval() [COLLABORATORS] field mSettingsPref getString/2; field mResources getString/1 [CALLS-EXTERNAL] Integer.valueOf/1, mSettingsPref.getString/2, mResources.getString/1 */ class PreferencesHelper { public int getAutoRefreshInterval() { ...
true
ok
{"focal": {"class": "PreferencesHelper", "name": "getAutoRefreshInterval", "signature": "int getAutoRefreshInterval()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "PreferencesHelper", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fiel...
44437701_4
class Singleton { @SuppressWarnings("unchecked") public static <T extends Singleton> T getInstance(Class<T> clazz) { Singleton singleton; Lock lock; (lock = GLOBAL_LOCK.readLock()).lock(); //1st locking try { singleton = CACHE.get(clazz); //1st reading ...
D d = D.getInstance(); byte[] buffer; try (ByteArrayOutputStream bout = new ByteArrayOutputStream(); ObjectOutputStream oout = new ObjectOutputStream(bout)) { oout.writeObject(new DWrapper(d)); oout.flush(); buffer = bout.toByteArray(); ...
[FOCAL] @SuppressWarnings("unchecked") public static T Singleton.getInstance(Class<T> clazz) [CLASS] class Singleton [METRICS] loc=27 cc=5 branches=2 loops=0 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] Object createInstance(Class<? extends Singleton> clazz) [CALLS-EXTERNAL] (lock = GLOBAL_LOCK.readLock()).lock/0, GLO...
/* static context [FOCAL] @SuppressWarnings("unchecked") public static T Singleton.getInstance(Class<T> clazz) [PATH1] if(singleton == null)#1=T -> if(singleton == null)#2=T -> return (T)singleton [PATH2] try-body throws [PATH3] if(singleton == null)#1=F -> return (T)singleton [PATH4] if(singleton == null)#1=T -> if(si...
/* static context [FOCAL] @SuppressWarnings("unchecked") public static T Singleton.getInstance(Class<T> clazz) [PATH1] if(singleton == null)#1=T -> if(singleton == null)#2=T -> return (T)singleton [PATH2] try-body throws [PATH3] if(singleton == null)#1=F -> return (T)singleton [PATH4] if(singleton == null)#1=T -> if(si...
true
ok
{"focal": {"class": "Singleton", "name": "getInstance", "signature": "T getInstance(Class<T> clazz)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public static", "params": [{"name": "clazz", "type": "Class<T>"}], "return_type": "T"}, "class_info": {"name": "Singleton", "kind": "class", "modifiers": ...
44453405_2
class ArgsToVote { public static Vote parse(String[] arguments) { return parse(arguments, null); } public static Vote parse(String[] arguments, Map<String, String> additionalArgs); } class ArgsToVoteTest { @Test void handlesInvalidRequest() {
assertThrows(IllegalArgumentException.class, () -> { ArgsToVote.parse(new String[0]); }); } }
[FOCAL] public static Vote ArgsToVote.parse(String[] arguments) [CLASS] class ArgsToVote [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Vote parse(String[] arguments, Map<String, String> additionalArgs) [INPUTS] branches=- | result=arguments [DATAFLOW] arguments@param->L2 [CLASS-M...
/* static context [FOCAL] public static Vote ArgsToVote.parse(String[] arguments) [INPUTS] branches=- | result=arguments [CALLS-INTERNAL] Vote parse(String[] arguments, Map<String, String> additionalArgs) */
/* static context [FOCAL] public static Vote ArgsToVote.parse(String[] arguments) [INPUTS] branches=- | result=arguments [CALLS-INTERNAL] Vote parse(String[] arguments, Map<String, String> additionalArgs) */ class ArgsToVote { public static Vote parse(String[] arguments) { return parse(arguments, null); ...
true
ok
{"focal": {"class": "ArgsToVote", "name": "parse", "signature": "Vote parse(String[] arguments)", "start_line": 3, "modifiers": "public static", "params": [{"name": "arguments", "type": "String[]"}], "return_type": "Vote"}, "class_info": {"name": "ArgsToVote", "kind": "class", "modifiers": "", "superclass": null, "inte...
44465166_89
class CorelexFeatureExtractor extends WordFeatureExtractor { @Override public Set<Feature> getWordFeatures(TextAnnotation ta, int wordPosition) throws EdisonException { if (data.size() == 0) loadDataFromClassPath(); String lemma = WordHelpers.getLemma(ta, wordPosition); S...
TextAnnotation ta = DummyTextAnnotationGenerator.generateAnnotatedTextAnnotation(false, 3); assertEquals(CorelexFeatureExtractor.instance.getWordFeatures(ta, 1).toString(), "[cae]"); // construction assertEquals(CorelexFeatureExtractor.instance.getWordFeatures(ta, 20).toString(), "[avt]"); // p...
[FOCAL] @Override public Set<Feature> CorelexFeatureExtractor.getWordFeatures(TextAnnotation ta, int wordPosition) [CLASS] class CorelexFeatureExtractor extends WordFeatureExtractor [METRICS] loc=15 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] void loadDataFromClassPath() [CALLS-EXTERNAL] data....
/* static context [FOCAL] @Override public Set<Feature> CorelexFeatureExtractor.getWordFeatures(TextAnnotation ta, int wordPosition) [PATH1] if(data.size() == 0)=T -> if(data.containsKey(lemma))=T -> return features [PATH2] if(data.size() == 0)=F -> if(data.containsKey(lemma))=F -> return features [INPUTS] branches=ta,...
/* static context [FOCAL] @Override public Set<Feature> CorelexFeatureExtractor.getWordFeatures(TextAnnotation ta, int wordPosition) [PATH1] if(data.size() == 0)=T -> if(data.containsKey(lemma))=T -> return features [PATH2] if(data.size() == 0)=F -> if(data.containsKey(lemma))=F -> return features [INPUTS] branches=ta,...
true
ok
{"focal": {"class": "CorelexFeatureExtractor", "name": "getWordFeatures", "signature": "Set<Feature> getWordFeatures(TextAnnotation ta, int wordPosition) throws EdisonException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "ta", "type": "TextAnnotation"}, {"name": "wordPosition", "type": "int"...
44519815_18
class Slice extends AbstractSlice { @Override public void reset() { super.reset(); m_lastValues.clear(); } protected Slice(); public Slice(/*@ non_null @*/ Function func, /*@ non_null @*/ Processor proc, Function clean_func); public Slice(/*@ non_null @*/ Function func, /*@ non_null @*/...
Slice sli = new Slice(Numbers.isEven, new Sum()); QueueSource source = new QueueSource().setEvents(1, 1, 6, 2, 3); Connector.connect(source, sli); Pullable p = sli.getPullableOutput(); Map<Object,Object> map; for (int k = 0; k < 2; k++) { assertEquals(0, sli.getActiveSliceCount()); map = (Map<Object...
[FOCAL] @Override public void Slice.reset() [CLASS] class Slice extends AbstractSlice [METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] AbstractSlice.reset/0, m_lastValues.clear/0 [COLLABORATORS] field m_lastValues clear/0 [CLASS-MEMBERS] Slice(); Slice(Function func, Processor proc,...
/* static context [FOCAL] @Override public void Slice.reset() [COLLABORATORS] field m_lastValues clear/0 [CALLS-EXTERNAL] AbstractSlice.reset/0, m_lastValues.clear/0 */
/* static context [FOCAL] @Override public void Slice.reset() [COLLABORATORS] field m_lastValues clear/0 [CALLS-EXTERNAL] AbstractSlice.reset/0, m_lastValues.clear/0 */ class Slice extends AbstractSlice { @Override public void reset() { super.reset(); m_lastValues.clear(); } protected Slice(); pu...
true
ok
{"focal": {"class": "Slice", "name": "reset", "signature": "void reset()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "Slice", "kind": "class", "modifiers": "", "superclass": "AbstractSlice", "interfaces": null, "fields": [], "members": [{"name": "Slic...
44525387_28
class ModelNodeResult extends ModelNode { public final ModelNode value() { return get(Constants.RESULT); } @Deprecated public ModelNodeResult(); public ModelNodeResult(ModelNode original); private String adjustAssertMessage(String message); public final boolean isSuccess(); publ...
ModelNodeResult result = new ModelNodeResult(DEFINED_RESULT_BOOLEAN); assertTrue(result.booleanValue()); assertTrue(result.booleanValue(false)); result = new ModelNodeResult(DEFINED_RESULT_NUMBER); assertEquals(13, result.intValue()); assertEquals(13L, result.longValue()...
[FOCAL] public final ModelNode ModelNodeResult.value() [CLASS] class ModelNodeResult extends ModelNode [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] get/1 (inherited) [CLASS-MEMBERS] ModelNodeResult(); ModelNodeResult(ModelNode original); String adjustAssertMessage(String message...
/* static context [FOCAL] public final ModelNode ModelNodeResult.value() [CALLS-EXTERNAL] get/1 (inherited) */
/* static context [FOCAL] public final ModelNode ModelNodeResult.value() [CALLS-EXTERNAL] get/1 (inherited) */ class ModelNodeResult extends ModelNode { public final ModelNode value() { return get(Constants.RESULT); } @Deprecated public ModelNodeResult(); public ModelNodeResult(ModelNode ori...
true
ok
{"focal": {"class": "ModelNodeResult", "name": "value", "signature": "ModelNode value()", "start_line": 3, "modifiers": "public final", "params": [], "return_type": "ModelNode"}, "class_info": {"name": "ModelNodeResult", "kind": "class", "modifiers": "", "superclass": "ModelNode", "interfaces": null, "fields": [{"name"...
44565647_8
class ControlledPwmServlet extends AbstractPwmServlet implements PwmServlet { public abstract Class<? extends ProcessAction> getProcessActionsClass( )public abstract Class<? extends ProcessAction> getProcessActionsClass( ); public abstract Class<? extends ProcessAction> getProcessActionsClass( )public String servletU...
final Map<Class<? extends ControlledPwmServlet>, Map<String, Method>> dataMap = getClassAndMethods(); for ( final Class<? extends ControlledPwmServlet> controlledPwmServlet : dataMap.keySet() ) { final Class<? extends AbstractPwmServlet.ProcessAction> processActionsClass = controlle...
[FOCAL] public abstract Class<? extends ProcessAction> ControlledPwmServlet.getProcessActionsClass() [CLASS] class ControlledPwmServlet extends AbstractPwmServlet implements PwmServlet [METRICS] loc=1 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CLASS-MEMBERS] String servletUriRemainder(PwmRequest pwmRequest, ...
/* static context [FOCAL] public abstract Class<? extends ProcessAction> ControlledPwmServlet.getProcessActionsClass() */
/* static context [FOCAL] public abstract Class<? extends ProcessAction> ControlledPwmServlet.getProcessActionsClass() */ class ControlledPwmServlet extends AbstractPwmServlet implements PwmServlet { public abstract Class<? extends ProcessAction> getProcessActionsClass( )public abstract Class<? extends ProcessAction> ...
true
partial
{"focal": {"class": "ControlledPwmServlet", "name": "getProcessActionsClass", "signature": "Class<? extends ProcessAction> getProcessActionsClass()", "start_line": 3, "modifiers": "public abstract", "params": [], "return_type": "Class<? extends ProcessAction>"}, "class_info": {"name": "ControlledPwmServlet", "kind": "c...
44586882_134
class PebbleTemplateService implements TemplateService { @Override public @NonNull String mergeTemplateIntoString(final @NonNull String templateReference, final @NonNull Map<String, Object> model) throws IOException, TemplateException { final Strin...
//Arrange final Map<String, Object> modelObject = new ImmutableMap.Builder<String, Object>().build(); assertions.assertThat(modelObject).isNotNull(); expectedException.expect(NullPointerException.class); //Act templateService.mergeTemplateIntoString(null, modelObject); ...
[FOCAL] @Override public @NonNull String PebbleTemplateService.mergeTemplateIntoString(String templateReference, Map<String, Object> model) [CLASS] class PebbleTemplateService implements TemplateService [METRICS] loc=23 cc=3 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] String expectedTemplateExtensi...
/* static context [FOCAL] @Override public @NonNull String PebbleTemplateService.mergeTemplateIntoString(String templateReference, Map<String, Object> model) [THROWS-WHEN] TemplateException when trimmedTemplateReference.contains(".") && try-body throws [THROWS-WHEN] TemplateException when !trimmedTemplateReference.cont...
/* static context [FOCAL] @Override public @NonNull String PebbleTemplateService.mergeTemplateIntoString(String templateReference, Map<String, Object> model) [THROWS-WHEN] TemplateException when trimmedTemplateReference.contains(".") && try-body throws [THROWS-WHEN] TemplateException when !trimmedTemplateReference.cont...
true
ok
{"focal": {"class": "PebbleTemplateService", "name": "mergeTemplateIntoString", "signature": "String mergeTemplateIntoString(String templateReference, Map<String, Object> model) throws IOException, TemplateException", "start_line": 3, "modifiers": "@Override public @NonNull", "params": [{"name": "templateReference", "t...
44603117_13
class DataSourceService { @PreAuthorize("hasAuthority(#datasourceName+'_MANAGE') or hasAuthority('SYS_MANAGE_DATASOURCE')") public int deleteDataSource(String datasourceName) { checkNotNull(datasourceName); if(isStaticDataSource(datasourceName)) return 0; DBDataSource datasourceCondition = new DBDataSource();...
final DBDataSource datasourceCondition = new DBDataSource(); datasourceCondition.setOwner(uttestuser); datasourceCondition.setName(uttestdatasource1); datasourceCondition.setType("druid"); datasourceCondition.setEndpoint("http://endpoint.test.com"); datasourceCondition.setCreateTime(new Date()); ...
[FOCAL] @PreAuthorize("hasAuthority(#datasourceName+'_MANAGE') or hasAuthority('SYS_MANAGE_DATASOURCE')") public int DataSourceService.deleteDataSource(String datasourceName) [CLASS] class DataSourceService [METRICS] loc=20 cc=4 branches=3 loops=0 returns=3 throws=0 nesting=2 [CALLS-INTERNAL] boolean isStaticDataSource...
/* static context [FOCAL] @PreAuthorize("hasAuthority(#datasourceName+'_MANAGE') or hasAuthority('SYS_MANAGE_DATASOURCE')") public int DataSourceService.deleteDataSource(String datasourceName) [PATH1] if(isStaticDataSource(datasourceName))=F -> if(list.size()>0)=T -> if(result >= 0)=T -> return result [PATH2] if(isStat...
/* static context [FOCAL] @PreAuthorize("hasAuthority(#datasourceName+'_MANAGE') or hasAuthority('SYS_MANAGE_DATASOURCE')") public int DataSourceService.deleteDataSource(String datasourceName) [PATH1] if(isStaticDataSource(datasourceName))=F -> if(list.size()>0)=T -> if(result >= 0)=T -> return result [PATH2] if(isStat...
true
ok
{"focal": {"class": "DataSourceService", "name": "deleteDataSource", "signature": "int deleteDataSource(String datasourceName)", "start_line": 3, "modifiers": "@PreAuthorize(\"hasAuthority(#datasourceName+'_MANAGE') or hasAuthority('SYS_MANAGE_DATASOURCE')\") public", "params": [{"name": "datasourceName", "type": "Stri...
44646140_1
class Checks { public static void checkNotNull(@Nullable Object object, @NonNull String message) { if (object == null) { throw new NullPointerException(message); } } private Checks(); } class ChecksTest { @Test public void checkNotNullNegative() {
try { checkNotNull(null, "Throw me!"); failBecauseExceptionWasNotThrown(NullPointerException.class); } catch (NullPointerException expected) { assertThat(expected).hasMessage("Throw me!"); } } }
[FOCAL] public static void Checks.checkNotNull(Object object, String message) [CLASS] class Checks [METRICS] loc=5 cc=2 branches=1 loops=0 returns=0 throws=1 nesting=1 [NEW] NullPointerException [EXCEPTIONS] throws NullPointerException [THROWS-WHEN] NullPointerException when object == null [PATH1] if(object == null)=T ...
/* static context [FOCAL] public static void Checks.checkNotNull(Object object, String message) [THROWS-WHEN] NullPointerException when object == null [PATH1] if(object == null)=T -> throw new NullPointerException(message) [PATH2] if(object == null)=F [INPUTS] branches=object | result=message [EXCEPTIONS] throws NullPo...
/* static context [FOCAL] public static void Checks.checkNotNull(Object object, String message) [THROWS-WHEN] NullPointerException when object == null [PATH1] if(object == null)=T -> throw new NullPointerException(message) [PATH2] if(object == null)=F [INPUTS] branches=object | result=message [EXCEPTIONS] throws NullPo...
true
ok
{"focal": {"class": "Checks", "name": "checkNotNull", "signature": "void checkNotNull(Object object, String message)", "start_line": 3, "modifiers": "public static", "params": [{"name": "object", "type": "Object"}, {"name": "message", "type": "String"}], "return_type": "void"}, "class_info": {"name": "Checks", "kind": ...
44676582_3
class ClassUtils { public static <T, R> Method getReferencedMethod(Class<T> clazz, ReadMethodRef<T, R> methodRef) { return findReferencedMethod(clazz, methodRef::call); } @SuppressWarnings("unchecked") public static Method getReferencedMethod(Class<T> clazz, WriteMethodRef<T, A1> methodRef); @...
Method getter = ClassUtils.getReferencedMethod(Sample.class, Sample::getProperty); assertThat(getter.getDeclaringClass()).isEqualTo(Sample.class); assertThat(getter.getName()).isEqualTo("getProperty"); Method setter = ClassUtils.getReferencedMethod(Sample.class, Sample::setProperty); ...
[FOCAL] public static Method ClassUtils.getReferencedMethod(Class<T> clazz, ReadMethodRef<T, R> methodRef) [CLASS] class ClassUtils [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Method findReferencedMethod(Class<T> clazz, Consumer<T> invoker) [INPUTS] branches=- | result=clazz, m...
/* static context [FOCAL] public static Method ClassUtils.getReferencedMethod(Class<T> clazz, ReadMethodRef<T, R> methodRef) [INPUTS] branches=- | result=clazz, methodRef [CALLS-INTERNAL] Method findReferencedMethod(Class<T> clazz, Consumer<T> invoker) */
/* static context [FOCAL] public static Method ClassUtils.getReferencedMethod(Class<T> clazz, ReadMethodRef<T, R> methodRef) [INPUTS] branches=- | result=clazz, methodRef [CALLS-INTERNAL] Method findReferencedMethod(Class<T> clazz, Consumer<T> invoker) */ class ClassUtils { public static <T, R> Method getReference...
true
ok
{"focal": {"class": "ClassUtils", "name": "getReferencedMethod", "signature": "Method getReferencedMethod(Class<T> clazz, ReadMethodRef<T, R> methodRef)", "start_line": 3, "modifiers": "public static", "params": [{"name": "clazz", "type": "Class<T>"}, {"name": "methodRef", "type": "ReadMethodRef<T, R>"}], "return_type"...
44723874_1
class Request implements Comparable<Request<T>> { public int getTrafficStatsTag() { return mDefaultTrafficStatsTag; } @Deprecated public Request(String url, Response.ErrorListener listener); public Request(int method, String url, Response.ErrorListener listener); public void setParams(M...
UrlParseRequest nullUrl = new UrlParseRequest(null); assertEquals(0, nullUrl.getTrafficStatsTag()); UrlParseRequest emptyUrl = new UrlParseRequest(""); assertEquals(0, emptyUrl.getTrafficStatsTag()); UrlParseRequest noHost = new UrlParseRequest("http:///"); assertEquals(0...
[FOCAL] public int Request.getTrafficStatsTag() [CLASS] class Request implements Comparable<Request<T>> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Request(String url, Response.ErrorListener listener); Request(int method, String url, Response.ErrorListener listener); void setPar...
/* static context [FOCAL] public int Request.getTrafficStatsTag() */
/* static context [FOCAL] public int Request.getTrafficStatsTag() */ class Request implements Comparable<Request<T>> { public int getTrafficStatsTag() { return mDefaultTrafficStatsTag; } @Deprecated public Request(String url, Response.ErrorListener listener); public Request(int method, Strin...
true
ok
{"focal": {"class": "Request", "name": "getTrafficStatsTag", "signature": "int getTrafficStatsTag()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "Request", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Comparable<Request<T>>", "fields": [],...
44750616_34
class TimeStampRecorder implements RecordedTimeStamps { public void responseBodyCompleted() { responseBodyCompleted = timeProvider.currentTimeInMillis(); } public TimeStampRecorder(TimeProvider timeProvider); public void recordCreatedRequest(); public void startWriteHeaders(); public void completedWriteHead...
timeStampRecorder.responseBodyCompleted(); assertEquals(5005, timeStampRecorder.getResponseBodyCompleted()); } }
[FOCAL] public void TimeStampRecorder.responseBodyCompleted() [CLASS] class TimeStampRecorder implements RecordedTimeStamps [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] TimeProviderForTesting.currentTimeInMillis/0 [FIELDS] read=timeProvider:TimeProviderForTesting [COLLABORATORS]...
/* static context [FOCAL] public void TimeStampRecorder.responseBodyCompleted() [COLLABORATORS] field timeProvider:TimeProviderForTesting currentTimeInMillis/0 [FIELDS] read=timeProvider:TimeProviderForTesting [CALLS-EXTERNAL] TimeProviderForTesting.currentTimeInMillis/0 */
/* static context [FOCAL] public void TimeStampRecorder.responseBodyCompleted() [COLLABORATORS] field timeProvider:TimeProviderForTesting currentTimeInMillis/0 [FIELDS] read=timeProvider:TimeProviderForTesting [CALLS-EXTERNAL] TimeProviderForTesting.currentTimeInMillis/0 */ class TimeStampRecorder implements RecordedTi...
true
ok
{"focal": {"class": "TimeStampRecorder", "name": "responseBodyCompleted", "signature": "void responseBodyCompleted()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "TimeStampRecorder", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "RecordedTi...
44764619_1
class ShmackUtils { public static ExecuteResult runOnMaster(String executable, String... arguments) throws ExecuteException, IOException { return runOnMaster(ExecExceptionHandling.THROW_EXCEPTION_IF_EXIT_CODE_NOT_0, executable, arguments); } public static String determineScriptDir(); public static void syncF...
ExecuteResult result = ShmackUtils.runOnMaster("hostname"); // example hostname: ip-10-0-7-102.us-west-1.compute.internal assertTrue("Hostname of aws-node: " + result, result.getStandardOutput().contains("compute.internal")); } }
[FOCAL] public static ExecuteResult ShmackUtils.runOnMaster(String executable, String... arguments) [CLASS] class ShmackUtils [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] ExecuteResult runOnMaster(ExecExceptionHandling exceptionHandling, String executable, String... arguments) [...
/* static context [FOCAL] public static ExecuteResult ShmackUtils.runOnMaster(String executable, String... arguments) [INPUTS] branches=- | result=arguments, executable [EXCEPTIONS] declares ExecuteException, IOException [CALLS-INTERNAL] ExecuteResult runOnMaster(ExecExceptionHandling exceptionHandling, String executab...
/* static context [FOCAL] public static ExecuteResult ShmackUtils.runOnMaster(String executable, String... arguments) [INPUTS] branches=- | result=arguments, executable [EXCEPTIONS] declares ExecuteException, IOException [CALLS-INTERNAL] ExecuteResult runOnMaster(ExecExceptionHandling exceptionHandling, String executab...
true
ok
{"focal": {"class": "ShmackUtils", "name": "runOnMaster", "signature": "ExecuteResult runOnMaster(String executable, String... arguments) throws ExecuteException, IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "executable", "type": "String"}, {"name": "arguments", "type": "String..."}]...
44804216_0
class TermuxActivity extends Activity implements ServiceConnection { static LinkedHashSet<CharSequence> extractUrls(String text) { StringBuilder regex_sb = new StringBuilder(); regex_sb.append("("); // Begin first matching group. regex_sb.append("(?:"); ...
assertUrlsAre("hello http://example.com world", "http://example.com"); assertUrlsAre("http://example.com\nhttp://another.com", "http://example.com", "http://another.com"); assertUrlsAre("hello http://example.com world and http://more.example.com with secure https://more.example.com", ...
[FOCAL] static LinkedHashSet<CharSequence> TermuxActivity.extractUrls(String text) [CLASS] class TermuxActivity extends Activity implements ServiceConnection [METRICS] loc=86 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] StringBuilder.append/1, Pattern.compile/2, StringBuilder.toString/0, Patter...
class TermuxActivity extends Activity implements ServiceConnection { static LinkedHashSet<CharSequence> extractUrls(String text) { StringBuilder regex_sb = new StringBuilder(); regex_sb.append("("); // Begin first matching group. regex_sb.append("(?:"); ...
false
ok
{"focal": {"class": "TermuxActivity", "name": "extractUrls", "signature": "LinkedHashSet<CharSequence> extractUrls(String text)", "start_line": 3, "modifiers": "static", "params": [{"name": "text", "type": "String"}], "return_type": "LinkedHashSet<CharSequence>"}, "class_info": {"name": "TermuxActivity", "kind": "class...
44820217_1
class Lists { public static <F, T> List<T> transform(List<F> fromList, Function<? super F, ? extends T> function) { return (fromList instanceof RandomAccess) ? new TransformingRandomAccessList<>(fromList, function) : new TransformingSequentialList<>(fromList, function); ...
List<String> fromList = new LinkedList<>(); fromList.add("1"); fromList.add("2"); fromList.add("3"); fromList.add("4"); List<Integer> toList = Lists.transform(fromList, Integer::parseInt); assertEquals(toList.size(), fromList.size()); System.out.println(...
[FOCAL] public static List<T> Lists.transform(List<F> fromList, Function<? super F, ? extends T> function) [CLASS] class Lists [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] TransformingRandomAccessList<>, TransformingSequentialList<> [INPUTS] branches=- | result=fromList, function [DATAFLOW...
/* static context [FOCAL] public static List<T> Lists.transform(List<F> fromList, Function<? super F, ? extends T> function) [INPUTS] branches=- | result=fromList, function [NEW] TransformingRandomAccessList<>, TransformingSequentialList<> */
/* static context [FOCAL] public static List<T> Lists.transform(List<F> fromList, Function<? super F, ? extends T> function) [INPUTS] branches=- | result=fromList, function [NEW] TransformingRandomAccessList<>, TransformingSequentialList<> */ class Lists { public static <F, T> List<T> transform(List<F> fromList, F...
true
ok
{"focal": {"class": "Lists", "name": "transform", "signature": "List<T> transform(List<F> fromList, Function<? super F, ? extends T> function)", "start_line": 3, "modifiers": "public static", "params": [{"name": "fromList", "type": "List<F>"}, {"name": "function", "type": "Function<? super F, ? extends T>"}], "return_t...
44829848_4
class InstanceController implements RouterNanoHTTPD.UriResponder { @Override public Response get(RouterNanoHTTPD.UriResource uriResource, Map<String, String> map, NanoHTTPD.IHTTPSession ihttpSession) { return ResponseGenerator.generateMethodNotAllowedResponse(); } @Override public Response...
InstanceController instanceController = new InstanceController(); NanoHTTPD.Response response = instanceController.get(null,null,null); String body = IOUtils.toString(response.getData()); assertEquals("Error, method not allowed", body); assertEquals(NanoHTTPD.Response.Status.ME...
[FOCAL] @Override public Response InstanceController.get(RouterNanoHTTPD.UriResource uriResource, Map<String, String> map, NanoHTTPD.IHTTPSession ihttpSession) [CLASS] class InstanceController implements RouterNanoHTTPD.UriResponder [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] R...
/* static context [FOCAL] @Override public Response InstanceController.get(RouterNanoHTTPD.UriResource uriResource, Map<String, String> map, NanoHTTPD.IHTTPSession ihttpSession) [INPUTS] branches=- | result=- | unused=uriResource, map, ihttpSession [CALLS-EXTERNAL] ResponseGenerator.generateMethodNotAllowedResponse/0 *...
/* static context [FOCAL] @Override public Response InstanceController.get(RouterNanoHTTPD.UriResource uriResource, Map<String, String> map, NanoHTTPD.IHTTPSession ihttpSession) [INPUTS] branches=- | result=- | unused=uriResource, map, ihttpSession [CALLS-EXTERNAL] ResponseGenerator.generateMethodNotAllowedResponse/0 *...
true
ok
{"focal": {"class": "InstanceController", "name": "get", "signature": "Response get(RouterNanoHTTPD.UriResource uriResource, Map<String, String> map, NanoHTTPD.IHTTPSession ihttpSession)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "uriResource", "type": "RouterNanoHTTPD.UriResource"}, {"name...
44838366_3
class RxPalette { @CheckResult @NonNull public static Single<Palette> generate(@NonNull final Bitmap bitmap) { return Single.fromCallable(new Callable<Palette>() { @Override public Palette call() throws Exception { return Palette.from(bitmap).generate(); ...
TestSubscriber<Palette> testSubscriber = new TestSubscriber<>(); Palette.Builder nullBuilder = null; //noinspection ConstantConditions RxPalette.generate(nullBuilder) .test() .assertError(NullPointerException.class); } }
[FOCAL] @CheckResult @NonNull public static Single<Palette> RxPalette.generate(Bitmap bitmap) [CLASS] class RxPalette [METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Single.fromCallable/1, Palette.from(bitmap).generate/0, Palette.from/1 [NEW] Callable<Palette> [INPUTS] branches=- |...
/* static context [FOCAL] @CheckResult @NonNull public static Single<Palette> RxPalette.generate(Bitmap bitmap) [INPUTS] branches=- | result=bitmap [NEW] Callable<Palette> [CALLS-EXTERNAL] Single.fromCallable/1, Palette.from(bitmap).generate/0, Palette.from/1 */
/* static context [FOCAL] @CheckResult @NonNull public static Single<Palette> RxPalette.generate(Bitmap bitmap) [INPUTS] branches=- | result=bitmap [NEW] Callable<Palette> [CALLS-EXTERNAL] Single.fromCallable/1, Palette.from(bitmap).generate/0, Palette.from/1 */ class RxPalette { @CheckResult @NonNull public s...
true
ok
{"focal": {"class": "RxPalette", "name": "generate", "signature": "Single<Palette> generate(Bitmap bitmap)", "start_line": 3, "modifiers": "@CheckResult @NonNull public static", "params": [{"name": "bitmap", "type": "Bitmap"}], "return_type": "Single<Palette>"}, "class_info": {"name": "RxPalette", "kind": "class", "mod...
44871316_100
class Automation extends BaseOpenMessage { protected static void checkRangeType(String where, Type type, String bus) { checkNotNull(where, "invalid null value: [where]"); checkNotNull(type, "invalid null value: [type]"); checkNotNull(bus, "invalid null value: [bus]"); checkArgument(...
assertThat(captureThrowable(() -> checkRangeType("10", Type.POINT_TO_POINT, NO_BUS))) .isInstanceOf(IllegalArgumentException.class) .hasMessage("value must be between 11 and 99"); assertThat(captureThrowable(() -> checkRangeType("100", Type.POINT_TO_POINT, NO_BUS))) ...
[FOCAL] protected static void Automation.checkRangeType(String where, Type type, String bus) [CLASS] class Automation extends BaseOpenMessage [METRICS] loc=43 cc=9 branches=1 loops=0 returns=0 throws=1 nesting=1 [CALLS-EXTERNAL] checkNotNull/2 (inherited), checkArgument/2 (inherited), String.length/0, WHERE_GENERAL_VAL...
/* static context [FOCAL] protected static void Automation.checkRangeType(String where, Type type, String bus) [THROWS-WHEN] IllegalArgumentException when switch(type)=default [PATH1] switch(type)=default -> throw new IllegalArgumentException("invalid type") [PATH2] switch(type)=case GENERAL [PATH3] switch(type)=case G...
/* static context [FOCAL] protected static void Automation.checkRangeType(String where, Type type, String bus) [THROWS-WHEN] IllegalArgumentException when switch(type)=default [PATH1] switch(type)=default -> throw new IllegalArgumentException("invalid type") [PATH2] switch(type)=case GENERAL [PATH3] switch(type)=case G...
true
ok
{"focal": {"class": "Automation", "name": "checkRangeType", "signature": "void checkRangeType(String where, Type type, String bus)", "start_line": 3, "modifiers": "protected static", "params": [{"name": "where", "type": "String"}, {"name": "type", "type": "Type"}, {"name": "bus", "type": "String"}], "return_type": "voi...
44872273_23
class SnackbarBuilder { @SuppressWarnings("WeakerAccess") public SnackbarBuilder appendMessage(CharSequence message) { initialiseAppendMessages(); appendMessages.append(message); return this; } public SnackbarBuilder(View view); public SnackbarBuilder(Activity activity); public SnackbarBuil...
SnackbarBuilder builder = createBuilder(); builder.appendMessage("message", Color.RED); assertThatMessagesWithColorsAppended(builder, "message", Color.RED); } }
[FOCAL] @SuppressWarnings("WeakerAccess") public SnackbarBuilder SnackbarBuilder.appendMessage(CharSequence message) [CLASS] class SnackbarBuilder [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] void initialiseAppendMessages() [CALLS-EXTERNAL] appendMessages.append/1 [COLLABORATORS...
/* static context [FOCAL] @SuppressWarnings("WeakerAccess") public SnackbarBuilder SnackbarBuilder.appendMessage(CharSequence message) [COLLABORATORS] field appendMessages append/1 [CALLS-INTERNAL] void initialiseAppendMessages() [CALLS-EXTERNAL] appendMessages.append/1 */
/* static context [FOCAL] @SuppressWarnings("WeakerAccess") public SnackbarBuilder SnackbarBuilder.appendMessage(CharSequence message) [COLLABORATORS] field appendMessages append/1 [CALLS-INTERNAL] void initialiseAppendMessages() [CALLS-EXTERNAL] appendMessages.append/1 */ class SnackbarBuilder { @SuppressWarnings("...
true
ok
{"focal": {"class": "SnackbarBuilder", "name": "appendMessage", "signature": "SnackbarBuilder appendMessage(CharSequence message)", "start_line": 3, "modifiers": "@SuppressWarnings(\"WeakerAccess\") public", "params": [{"name": "message", "type": "CharSequence"}], "return_type": "SnackbarBuilder"}, "class_info": {"name...
44934002_1
class Pointer implements AutoCloseable { protected Deallocator deallocator() { return deallocator; } public Pointer(); public Pointer(final Pointer p); public Pointer(final Buffer b); private native void allocate(Buffer b); void init(long allocatedAddress, long allocatedCapaci...
System.out.println("Deallocator"); final boolean[] failed = { false }; ExecutorService pool = Executors.newFixedThreadPool(24); for (int i = 0; i < 24; i++) { pool.execute(new Runnable() { @Override public void run() { try { ...
[FOCAL] protected Deallocator Pointer.deallocator() [CLASS] class Pointer implements AutoCloseable [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Pointer(); Pointer(Pointer p); Pointer(Buffer b); void allocate(Buffer b); void init(long allocatedAddress, long allocatedCapacity, long...
/* static context [FOCAL] protected Deallocator Pointer.deallocator() */
/* static context [FOCAL] protected Deallocator Pointer.deallocator() */ class Pointer implements AutoCloseable { protected Deallocator deallocator() { return deallocator; } public Pointer(); public Pointer(final Pointer p); public Pointer(final Buffer b); private native void alloc...
true
ok
{"focal": {"class": "Pointer", "name": "deallocator", "signature": "Deallocator deallocator()", "start_line": 3, "modifiers": "protected", "params": [], "return_type": "Deallocator"}, "class_info": {"name": "Pointer", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "AutoCloseable", "fields": [{"name...
44944683_0
class EntityResultBean { String getKey() { if (contentInputBean != null) { return contentInputBean.getKey(); } return null; } EntityResultBean(ContentInputBean contentInputBean); Object getResult(); } class EntityResultBeanTest { @Test public void testGetEntityLogInputBean() throw...
ContentInputBean contentInputBean = new ContentInputBean("", "auditKey", new DateTime(), null); EntityResultBean entityResultBean = new EntityResultBean(contentInputBean); Assert.assertEquals(entityResultBean.getKey(), "auditKey"); } }
[FOCAL] String EntityResultBean.getKey() [CLASS] class EntityResultBean [METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] contentInputBean.getKey/0 [PATH1] if(contentInputBean != null)=T -> return contentInputBean.getKey() [PATH2] if(contentInputBean != null)=F -> return null [COLLAB...
/* static context [FOCAL] String EntityResultBean.getKey() [PATH1] if(contentInputBean != null)=T -> return contentInputBean.getKey() [PATH2] if(contentInputBean != null)=F -> return null [COLLABORATORS] field contentInputBean getKey/0 [CALLS-EXTERNAL] contentInputBean.getKey/0 */
/* static context [FOCAL] String EntityResultBean.getKey() [PATH1] if(contentInputBean != null)=T -> return contentInputBean.getKey() [PATH2] if(contentInputBean != null)=F -> return null [COLLABORATORS] field contentInputBean getKey/0 [CALLS-EXTERNAL] contentInputBean.getKey/0 */ class EntityResultBean { String get...
true
ok
{"focal": {"class": "EntityResultBean", "name": "getKey", "signature": "String getKey()", "start_line": 3, "modifiers": "", "params": [], "return_type": "String"}, "class_info": {"name": "EntityResultBean", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Ent...
44976376_0
class RxActivityLauncher { Observable<ActivityResult> startActivityForResult( final Action3<Intent, Integer, Bundle> launchActivityAction, final Intent intent, final int requestCode, final Bundle options) { final PublishSubject<ActivityResult> subject = createSubjectIfNotExist(requ...
doThrow(ActivityNotFoundException.class).when(launchAction) .call(any(Intent.class), anyInt(), any(Bundle.class)); final RxActivityLauncher launcher = new RxActivityLauncher(); final TestSubscriber<ActivityResult> testSubscriber = TestSubscriber.create(); launcher.startA...
[FOCAL] Observable<ActivityResult> RxActivityLauncher.startActivityForResult(Action3<Intent, Integer, Bundle> launchActivityAction, Intent intent, int requestCode, Bundle options) [CLASS] class RxActivityLauncher [METRICS] loc=13 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] PublishSubject<Activ...
/* static context [FOCAL] Observable<ActivityResult> RxActivityLauncher.startActivityForResult(Action3<Intent, Integer, Bundle> launchActivityAction, Intent intent, int requestCode, Bundle options) [PATH1] try-body throws -> return Observable.error(e) [PATH2] return subject [INPUTS] branches=- | result=requestCode [COL...
/* static context [FOCAL] Observable<ActivityResult> RxActivityLauncher.startActivityForResult(Action3<Intent, Integer, Bundle> launchActivityAction, Intent intent, int requestCode, Bundle options) [PATH1] try-body throws -> return Observable.error(e) [PATH2] return subject [INPUTS] branches=- | result=requestCode [COL...
true
ok
{"focal": {"class": "RxActivityLauncher", "name": "startActivityForResult", "signature": "Observable<ActivityResult> startActivityForResult(Action3<Intent, Integer, Bundle> launchActivityAction, Intent intent, int requestCode, Bundle options)", "start_line": 3, "modifiers": "", "params": [{"name": "launchActivityAction...
45028592_110
class Tokenizer { void train(final InstanceList instList, final Pipe myPipe) { final long s1 = System.currentTimeMillis(); // set up model model = new CRF(myPipe, null); model.addStatesForLabelsConnectedAsIn(instList); // get trainer final CRFTrainerByLabelLikelihood crfTrainer = new CRFTrainerByLabelLi...
final Tokenizer tokenizer = new Tokenizer(); final List<String> trainDataORG = readLinesFromFile(FILENAME_TRAIN_DATA_ORG); final List<String> trainDataTOK = readLinesFromFile(FILENAME_TRAIN_DATA_TOK); final InstanceList trainData = tokenizer.makeTrainingData(trainDataORG, trainDataTOK); final Pipe trainPipe ...
[FOCAL] void Tokenizer.train(InstanceList instList, Pipe myPipe) [CLASS] class Tokenizer [METRICS] loc=25 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] System.currentTimeMillis/0, model.addStatesForLabelsConnectedAsIn/1, CRFTrainerByLabelLikelihood.train/1, Logger.info/1, model.getInputPipe().ge...
/* static context [FOCAL] void Tokenizer.train(InstanceList instList, Pipe myPipe) [COLLABORATORS] field model addStatesForLabelsConnectedAsIn/1,getInputPipe/0 [FIELDS] read=LOGGER:Logger [NEW] CRF, CRFTrainerByLabelLikelihood [CALLS-EXTERNAL] System.currentTimeMillis/0, model.addStatesForLabelsConnectedAsIn/1, CRFTrai...
/* static context [FOCAL] void Tokenizer.train(InstanceList instList, Pipe myPipe) [COLLABORATORS] field model addStatesForLabelsConnectedAsIn/1,getInputPipe/0 [FIELDS] read=LOGGER:Logger [NEW] CRF, CRFTrainerByLabelLikelihood [CALLS-EXTERNAL] System.currentTimeMillis/0, model.addStatesForLabelsConnectedAsIn/1, CRFTrai...
true
ok
{"focal": {"class": "Tokenizer", "name": "train", "signature": "void train(InstanceList instList, Pipe myPipe)", "start_line": 3, "modifiers": "", "params": [{"name": "instList", "type": "InstanceList"}, {"name": "myPipe", "type": "Pipe"}], "return_type": "void"}, "class_info": {"name": "Tokenizer", "kind": "class", "m...
45078096_2
class ManifestExportPageController { public void setSaveManifestPath(String pPath) { if (isSaveManifestPathEnabled()) { mSaveManifestPath = pPath; } } public ManifestExportPageController(); public void setGenerateManifest(boolean pGenerate); public void setSaveManifes...
mTested.setGenerateManifest(true); mTested.setSaveManifest(true); mTested.setSaveManifestPath(PATH_VALUE); assertEquals("the save path should have been set", PATH_VALUE, mTested.getSaveManifestPath()); } }
[FOCAL] public void ManifestExportPageController.setSaveManifestPath(String pPath) [CLASS] class ManifestExportPageController [METRICS] loc=5 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] boolean isSaveManifestPathEnabled() [PATH1] if(isSaveManifestPathEnabled())=T [PATH2] if(isSaveManifestPathE...
/* static context [FOCAL] public void ManifestExportPageController.setSaveManifestPath(String pPath) [PATH1] if(isSaveManifestPathEnabled())=T [PATH2] if(isSaveManifestPathEnabled())=F [CALLS-INTERNAL] boolean isSaveManifestPathEnabled() */
/* static context [FOCAL] public void ManifestExportPageController.setSaveManifestPath(String pPath) [PATH1] if(isSaveManifestPathEnabled())=T [PATH2] if(isSaveManifestPathEnabled())=F [CALLS-INTERNAL] boolean isSaveManifestPathEnabled() */ class ManifestExportPageController { public void setSaveManifestPath(Strin...
true
ok
{"focal": {"class": "ManifestExportPageController", "name": "setSaveManifestPath", "signature": "void setSaveManifestPath(String pPath)", "start_line": 3, "modifiers": "public", "params": [{"name": "pPath", "type": "String"}], "return_type": "void"}, "class_info": {"name": "ManifestExportPageController", "kind": "class...
45120221_14
class AccountController extends BusinessController implements Accountblservice { @Override public ResultMessage delete(String ID) { try { return account.delete(ID); } catch (RemoteException e) { if (ExceptionHandler.myExceptionHandler(myType, this)) { return delete(ID); } } return ResultMessag...
fail("Not yet implemented"); } }
[FOCAL] @Override public ResultMessage AccountController.delete(String ID) [CLASS] class AccountController extends BusinessController implements Accountblservice [METRICS] loc=11 cc=3 branches=1 loops=0 returns=3 throws=0 nesting=2 [CALLS-EXTERNAL] account.delete/1, ExceptionHandler.myExceptionHandler/2, delete/1 (inhe...
/* static context [FOCAL] @Override public ResultMessage AccountController.delete(String ID) [PATH1] try-body throws -> if(ExceptionHandler.myExceptionHandler(myType, this))=T -> return delete(ID) [PATH2] try-body throws -> if(ExceptionHandler.myExceptionHandler(myType, this))=F -> return ResultMessage.FAIL [PATH3] ret...
/* static context [FOCAL] @Override public ResultMessage AccountController.delete(String ID) [PATH1] try-body throws -> if(ExceptionHandler.myExceptionHandler(myType, this))=T -> return delete(ID) [PATH2] try-body throws -> if(ExceptionHandler.myExceptionHandler(myType, this))=F -> return ResultMessage.FAIL [PATH3] ret...
true
ok
{"focal": {"class": "AccountController", "name": "delete", "signature": "ResultMessage delete(String ID)", "start_line": 4, "modifiers": "@Override public", "params": [{"name": "ID", "type": "String"}], "return_type": "ResultMessage"}, "class_info": {"name": "AccountController", "kind": "class", "modifiers": "", "super...
45165644_119
class VideoResource { public String getDetails(Integer id, String... fields) throws Exception { if (fields.length == 0) { return videos.get(id).toString(); } return fieldJsonMapper.toJson(videos.get(id), fields); } public VideoResource(FieldJsonMapper fieldJsonMapper, ...
String actualDetails = resource.getDetails(1); String expectedDetails = "{\"id\": 1,\"title\": \"Avatar\",\"length\": 178,\"description\": " + "\"epic science fiction film\",\"director\": \"James Cameron\",\"language\": \"English\",}"; assertEquals(expectedDetails, actualDetails...
[FOCAL] public String VideoResource.getDetails(Integer id, String... fields) [CLASS] class VideoResource [METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] videos.get(id).toString/0, videos.get/1, FieldJsonMapper.toJson/2 [FIELDS] read=fieldJsonMapper:FieldJsonMapper [EXCEPTIONS] decl...
/* static context [FOCAL] public String VideoResource.getDetails(Integer id, String... fields) [PATH1] if(fields.length == 0)=T -> return videos.get(id).toString() [PATH2] if(fields.length == 0)=F -> return fieldJsonMapper.toJson(videos.get(id), fields) [INPUTS] branches=fields | result=fields, id, fieldJsonMapper [COL...
/* static context [FOCAL] public String VideoResource.getDetails(Integer id, String... fields) [PATH1] if(fields.length == 0)=T -> return videos.get(id).toString() [PATH2] if(fields.length == 0)=F -> return fieldJsonMapper.toJson(videos.get(id), fields) [INPUTS] branches=fields | result=fields, id, fieldJsonMapper [COL...
true
ok
{"focal": {"class": "VideoResource", "name": "getDetails", "signature": "String getDetails(Integer id, String... fields) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "id", "type": "Integer"}, {"name": "fields", "type": "String..."}], "return_type": "String"}, "class_info": {"name": "Vi...
45222397_6
class AssertParcelable { public static <T extends Parcelable> void assertThatObjectParcelable(T object) { if (object == null) { throw new NullPointerException("object == null"); } final Parcel parcel = Parcel.obtain(); try { object.writeToParcel(parcel, 0);...
ClassWithOkParcelableImplButNoEquals object = new ClassWithOkParcelableImplButNoEquals("yo"); try { AssertParcelable.assertThatObjectParcelable(object); failBecauseExceptionWasNotThrown(AssertionError.class); } catch (AssertionError expected) { assertThat(exp...
[FOCAL] public static void AssertParcelable.assertThatObjectParcelable(T object) [CLASS] class AssertParcelable [METRICS] loc=48 cc=10 branches=3 loops=0 returns=0 throws=6 nesting=3 [CALLS-EXTERNAL] Parcel.obtain/0, T.writeToParcel/2, Parcel.setDataPosition/1, object.getClass().getDeclaredField/1, T.getClass/0, Modifi...
/* static context [FOCAL] public static void AssertParcelable.assertThatObjectParcelable(T object) [THROWS-WHEN] NullPointerException when object == null [THROWS-WHEN] AssertionError when !(object == null) && try-body throws [THROWS-WHEN] AssertionError when !(object == null) && !Modifier.isPublic(creatorField.getModif...
/* static context [FOCAL] public static void AssertParcelable.assertThatObjectParcelable(T object) [THROWS-WHEN] NullPointerException when object == null [THROWS-WHEN] AssertionError when !(object == null) && try-body throws [THROWS-WHEN] AssertionError when !(object == null) && !Modifier.isPublic(creatorField.getModif...
true
ok
{"focal": {"class": "AssertParcelable", "name": "assertThatObjectParcelable", "signature": "void assertThatObjectParcelable(T object)", "start_line": 3, "modifiers": "public static", "params": [{"name": "object", "type": "T"}], "return_type": "void"}, "class_info": {"name": "AssertParcelable", "kind": "class", "modifie...
45225736_44
class ScrapConsumerLoader { public static <K> ScrapConsumerLoader<K> byConveyorName(String name) { return Conveyor.byName(name).scrapConsumer(); } public ScrapConsumerLoader(Consumer<ScrapConsumer<K, ?>> globalPlacer, ScrapConsumer<K, ?> consumer); public ScrapConsumerLoader<K> first(ScrapConsumer<K, ?> consu...
AssemblingConveyor<Integer,String,String> ac = new AssemblingConveyor<>(); ac.setName("test"); ScrapConsumerLoader<Integer> scl = ScrapConsumerLoader.byConveyorName("test",new IgnoreScrap<>()); assertNotNull(scl); } }
[FOCAL] public static ScrapConsumerLoader<K> ScrapConsumerLoader.byConveyorName(String name) [CLASS] class ScrapConsumerLoader [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Conveyor.byName(name).scrapConsumer/0, Conveyor.byName/1 [INPUTS] branches=- | result=name [DATAFLOW] name@...
/* static context [FOCAL] public static ScrapConsumerLoader<K> ScrapConsumerLoader.byConveyorName(String name) [INPUTS] branches=- | result=name [CALLS-EXTERNAL] Conveyor.byName(name).scrapConsumer/0, Conveyor.byName/1 */
/* static context [FOCAL] public static ScrapConsumerLoader<K> ScrapConsumerLoader.byConveyorName(String name) [INPUTS] branches=- | result=name [CALLS-EXTERNAL] Conveyor.byName(name).scrapConsumer/0, Conveyor.byName/1 */ class ScrapConsumerLoader { public static <K> ScrapConsumerLoader<K> byConveyorName(String name)...
true
ok
{"focal": {"class": "ScrapConsumerLoader", "name": "byConveyorName", "signature": "ScrapConsumerLoader<K> byConveyorName(String name)", "start_line": 3, "modifiers": "public static", "params": [{"name": "name", "type": "String"}], "return_type": "ScrapConsumerLoader<K>"}, "class_info": {"name": "ScrapConsumerLoader", "...
45239946_67
class QueryEngine extends TemplateMetaData { public List<Record> perform(String query, boolean explain) throws SQLException { // QueryProcessor queryProcessor = new QueryProcessor(context); QueryProcessor queryProcessor = new QueryProcessor(context, knowledgeCache, introspectCache); QueryPa...
String query = "select \n" + " o_bp/data[at0001]/events[at0006]/data[at0003]/items[at0005]/value/magnitude as max_systolic,\n" + " o_bp/data[at0001]/events[at0006]/data[at0003]/items[at0004]/value/magnitude as max_diastolic,\n" + " o_bp/data[at0001]/even...
[FOCAL] public List<Record> QueryEngine.perform(String query, boolean explain) [CLASS] class QueryEngine extends TemplateMetaData [METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] QueryParser.pass1/0, QueryParser.pass2/0, QueryProcessor.execute/3 [NEW] QueryProcessor, QueryParser [F...
/* static context [FOCAL] public List<Record> QueryEngine.perform(String query, boolean explain) [INPUTS] branches=- | result=explain, query, context, introspectCache, serverNodeId [EXCEPTIONS] declares SQLException [FIELDS] read=context:DSLContext, introspectCache:I_IntrospectCache, serverNodeId:String [NEW] QueryProc...
/* static context [FOCAL] public List<Record> QueryEngine.perform(String query, boolean explain) [INPUTS] branches=- | result=explain, query, context, introspectCache, serverNodeId [EXCEPTIONS] declares SQLException [FIELDS] read=context:DSLContext, introspectCache:I_IntrospectCache, serverNodeId:String [NEW] QueryProc...
true
ok
{"focal": {"class": "QueryEngine", "name": "perform", "signature": "List<Record> perform(String query, boolean explain) throws SQLException", "start_line": 3, "modifiers": "public", "params": [{"name": "query", "type": "String"}, {"name": "explain", "type": "boolean"}], "return_type": "List<Record>"}, "class_info": {"n...
45257264_47
class RemoteGitHelper { public void installGit(SshConnection connection, SystemSpecification os) throws IOException { if (isGitInstalled(connection)) { return; } if (!SystemSpecification.UBUNTU.equals(os.getDistributionName())) { throw new UnsupportedOperationException( "Only ubuntu is supported for...
when(connection.tryExecute("which", "git")).thenReturn( new ExecutionResult(0, "", "")); remoteGitHelper.installGit(connection, SystemSpecification.UBUNTU_1404); verify(connection, never()).execute("sudo", "apt-get", "-y", "install", "git"); } }
[FOCAL] public void RemoteGitHelper.installGit(SshConnection connection, SystemSpecification os) [CLASS] class RemoteGitHelper [METRICS] loc=17 cc=4 branches=3 loops=0 returns=1 throws=2 nesting=1 [CALLS-INTERNAL] boolean isGitInstalled(SshConnection connection) [CALLS-EXTERNAL] SystemSpecification.UBUNTU.equals/1, Sys...
/* static context [FOCAL] public void RemoteGitHelper.installGit(SshConnection connection, SystemSpecification os) [THROWS-WHEN] UnsupportedOperationException when !isGitInstalled(connection) && !SystemSpecification.UBUNTU.equals(os.getDistributionName()) [THROWS-WHEN] IOException when !isGitInstalled(connection) && !(...
/* static context [FOCAL] public void RemoteGitHelper.installGit(SshConnection connection, SystemSpecification os) [THROWS-WHEN] UnsupportedOperationException when !isGitInstalled(connection) && !SystemSpecification.UBUNTU.equals(os.getDistributionName()) [THROWS-WHEN] IOException when !isGitInstalled(connection) && !(...
true
ok
{"focal": {"class": "RemoteGitHelper", "name": "installGit", "signature": "void installGit(SshConnection connection, SystemSpecification os) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "connection", "type": "SshConnection"}, {"name": "os", "type": "SystemSpecification"}], "return_ty...
45304947_10
class VideoUploadedEventCodec implements MessageCodec<VideoUploadedEvent, VideoUploadedEvent> { @Override public String name() { return "VideoUploadedEvent Codec"; } @Override public void encodeToWire(Buffer buffer, VideoUploadedEvent s); @Override public VideoUploadedEvent decodeFromWire(...
VideoUploadedEventCodec codec = new VideoUploadedEventCodec(); assertThat(codec.name()).isEqualTo("VideoUploadedEvent Codec"); } }
[FOCAL] @Override public String VideoUploadedEventCodec.name() [CLASS] class VideoUploadedEventCodec implements MessageCodec<VideoUploadedEvent, VideoUploadedEvent> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] void encodeToWire(Buffer buffer, VideoUploadedEvent s); VideoUploadedE...
/* static context [FOCAL] @Override public String VideoUploadedEventCodec.name() */
/* static context [FOCAL] @Override public String VideoUploadedEventCodec.name() */ class VideoUploadedEventCodec implements MessageCodec<VideoUploadedEvent, VideoUploadedEvent> { @Override public String name() { return "VideoUploadedEvent Codec"; } @Override public void encodeToWire(Buffer bu...
true
ok
{"focal": {"class": "VideoUploadedEventCodec", "name": "name", "signature": "String name()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "VideoUploadedEventCodec", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "MessageCodec<Video...
45334811_21
class DomaEventEntityListener extends NullEntityListener<T> implements ApplicationEventPublisherAware { @Override public void postDelete(T t, PostDeleteContext<T> context) { this.eventPublisher.publishEvent(new PostDeleteEvent<>(t, context)); } @Override public void preInsert(T t, PreInsertContext<T> context)...
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(); context.register(DomaEventEntityListener.class); context.register(DomaEventListenerFactory.class); context.register(PostDeleteHandler.class); context.refresh(); DomaEventEntityListener<Entity> entityListener = context ...
[FOCAL] @Override public void DomaEventEntityListener.postDelete(T t, PostDeleteContext<T> context) [CLASS] class DomaEventEntityListener extends NullEntityListener<T> implements ApplicationEventPublisherAware [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] this.eventPublisher.publ...
/* static context [FOCAL] @Override public void DomaEventEntityListener.postDelete(T t, PostDeleteContext<T> context) [COLLABORATORS] field eventPublisher publishEvent/1 [FIELDS] read=eventPublisher [NEW] PostDeleteEvent<> [CALLS-EXTERNAL] this.eventPublisher.publishEvent/1 */
/* static context [FOCAL] @Override public void DomaEventEntityListener.postDelete(T t, PostDeleteContext<T> context) [COLLABORATORS] field eventPublisher publishEvent/1 [FIELDS] read=eventPublisher [NEW] PostDeleteEvent<> [CALLS-EXTERNAL] this.eventPublisher.publishEvent/1 */ class DomaEventEntityListener extends Null...
true
ok
{"focal": {"class": "DomaEventEntityListener", "name": "postDelete", "signature": "void postDelete(T t, PostDeleteContext<T> context)", "start_line": 4, "modifiers": "@Override public", "params": [{"name": "t", "type": "T"}, {"name": "context", "type": "PostDeleteContext<T>"}], "return_type": "void"}, "class_info": {"n...
45340108_21
class Ipv4FieldFactory extends AbstractFieldFactory<String> { @Override public String newInstance(int uniqueId) { return AddressUtils.longToIpv4(longFactory.newInstance(uniqueId)); } public Ipv4FieldFactory(String address); @Override public String toString(); private LongFieldFactory cidrToLongFactory(Strin...
Ipv4FieldFactory factory = new Ipv4FieldFactory("127.0.0.0/30"); assertEquals(factory.newInstance(0), "127.0.0.0"); assertEquals(factory.newInstance(1), "127.0.0.1"); assertEquals(factory.newInstance(2), "127.0.0.2"); assertEquals(factory.newInstance(3), "127.0.0.3"); assertEquals(factory.newInstance(4), "1...
[FOCAL] @Override public String Ipv4FieldFactory.newInstance(int uniqueId) [CLASS] class Ipv4FieldFactory extends AbstractFieldFactory<String> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] AddressUtils.longToIpv4/1, longFactory.newInstance/1 [INPUTS] branches=- | result=uniqueId ...
/* static context [FOCAL] @Override public String Ipv4FieldFactory.newInstance(int uniqueId) [INPUTS] branches=- | result=uniqueId [COLLABORATORS] field longFactory newInstance/1 [CALLS-EXTERNAL] AddressUtils.longToIpv4/1, longFactory.newInstance/1 */
/* static context [FOCAL] @Override public String Ipv4FieldFactory.newInstance(int uniqueId) [INPUTS] branches=- | result=uniqueId [COLLABORATORS] field longFactory newInstance/1 [CALLS-EXTERNAL] AddressUtils.longToIpv4/1, longFactory.newInstance/1 */ class Ipv4FieldFactory extends AbstractFieldFactory<String> { @Ove...
true
ok
{"focal": {"class": "Ipv4FieldFactory", "name": "newInstance", "signature": "String newInstance(int uniqueId)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "uniqueId", "type": "int"}], "return_type": "String"}, "class_info": {"name": "Ipv4FieldFactory", "kind": "class", "modifiers": "", "super...
45384078_1
class NumberConverter { public static void serialize(final double value, final JsonWriter sw) { sw.writeDouble(value); } static void write4(final int value, final byte[] buf, final int pos); static void write3(final int number, final byte[] buf, int pos); static void write2(final int value, final byte[] buf, f...
final Random rnd = new Random(1337); final List<Long> collection = new ArrayList<Long>(); for (long i = 1L; i <= 1000000000000000000L; i *= 10) { collection.add(i); // 1000000 collection.add(-i); // -1000000 for (int r = 0; r < 100; r+...
[FOCAL] public static void NumberConverter.serialize(double value, JsonWriter sw) [CLASS] class NumberConverter [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] JsonWriter.writeDouble/1 [COLLABORATORS] param sw:JsonWriter writeDouble/1 [DATAFLOW] sw@param->L2; value@param->L2 [CLASS...
class NumberConverter { public static void serialize(final double value, final JsonWriter sw) { sw.writeDouble(value); } static void write4(final int value, final byte[] buf, final int pos); static void write3(final int number, final byte[] buf, int pos); static void write2(final int value, final byte[] buf, f...
false
ok
{"focal": {"class": "NumberConverter", "name": "serialize", "signature": "void serialize(double value, JsonWriter sw)", "start_line": 3, "modifiers": "public static", "params": [{"name": "value", "type": "double"}, {"name": "sw", "type": "JsonWriter"}], "return_type": "void"}, "class_info": {"name": "NumberConverter", ...
45396840_8
class Repository { public synchronized boolean updateList(UUID uuid, GroceryList updatedList) { updatedList.setId(uuid); groceryLists.replaceAll(list -> uuid.equals(list.getId()) ? updatedList : list); save(); return groceryLists.contains(updatedList); } public Repository(...
emptyRepository.createList(groceryList); groceryList.setSettled(true); groceryList.setShoppingItems(new Item[] { ITEM_SOY_MILK }); assertTrue(emptyRepository.updateList(groceryList.getId(), groceryList)); Optional<GroceryList> updatedList = emptyRepository.getList(groceryList.ge...
[FOCAL] public synchronized boolean Repository.updateList(UUID uuid, GroceryList updatedList) [CLASS] class Repository [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] void save() [CALLS-EXTERNAL] GroceryList.setId/1, groceryLists.replaceAll/1, UUID.equals/1, list.getId/0, groceryLi...
/* static context [FOCAL] public synchronized boolean Repository.updateList(UUID uuid, GroceryList updatedList) [INPUTS] branches=- | result=updatedList [COLLABORATORS] param updatedList:GroceryList setId/1; field groceryLists replaceAll/1,contains/1; param uuid:UUID equals/1; field list getId/0 [CALLS-INTERNAL] void s...
/* static context [FOCAL] public synchronized boolean Repository.updateList(UUID uuid, GroceryList updatedList) [INPUTS] branches=- | result=updatedList [COLLABORATORS] param updatedList:GroceryList setId/1; field groceryLists replaceAll/1,contains/1; param uuid:UUID equals/1; field list getId/0 [CALLS-INTERNAL] void s...
true
ok
{"focal": {"class": "Repository", "name": "updateList", "signature": "boolean updateList(UUID uuid, GroceryList updatedList)", "start_line": 3, "modifiers": "public synchronized", "params": [{"name": "uuid", "type": "UUID"}, {"name": "updatedList", "type": "GroceryList"}], "return_type": "boolean"}, "class_info": {"nam...
45433519_67
class OntologyHierarchiesPresenterImpl implements OntologyHierarchiesView.Presenter, OntologyHierarchySelectionChangedEvent.OntologyHierarchySelectionChangedEventHandler, AppRatingSelected.AppRatingSelected...
AppRatingSelected eventMock = mock(AppRatingSelected.class); App appMock = mock(App.class); when(eventMock.getApp()).thenReturn(appMock); int mockScore = 3; when(eventMock.getScore()).thenReturn(mockScore); /*** CALL METHOD UNDER TEST ***/ uut.onAppRatingSelected...
[FOCAL] @Override public void OntologyHierarchiesPresenterImpl.onAppRatingSelected(AppRatingSelected event) [CLASS] class OntologyHierarchiesPresenterImpl implements OntologyHierarchiesView.Presenter, OntologyHierarchySelectionChangedEvent.OntologyHierarchySelectionChangedEventHandler, AppRatingSelected.AppRatingSelect...
class OntologyHierarchiesPresenterImpl implements OntologyHierarchiesView.Presenter, OntologyHierarchySelectionChangedEvent.OntologyHierarchySelectionChangedEventHandler, AppRatingSelected.AppRatingSelected...
false
ok
{"focal": {"class": "OntologyHierarchiesPresenterImpl", "name": "onAppRatingSelected", "signature": "void onAppRatingSelected(AppRatingSelected event)", "start_line": 9, "modifiers": "@Override public", "params": [{"name": "event", "type": "AppRatingSelected"}], "return_type": "void"}, "class_info": {"name": "OntologyH...
45471150_4
class CalendarDataFactoryImpl extends CalendarDataFactory { @Override public VisibleMonths create(Date month, int rows) { Calendar calendar = setToFirstDayOf(month); List<Day> lastMonth = calculateLastMonth(calendar); List<Day> currentMonth = calculateCurrentMonth(calendar); Lis...
Calendar calendar = Calendar.getInstance(); calendar.set(2015, 10, 2); // oct 2015, has 31 days, jan has 31, first day was sun VisibleMonths months = CalendarDataFactory.getInstance(Locale.GERMANY).create(calendar.getTime(), SIX_ROWS); assertThat(months.getLastMonth().size()).isEqualTo...
[FOCAL] @Override public VisibleMonths CalendarDataFactoryImpl.create(Date month, int rows) [CLASS] class CalendarDataFactoryImpl extends CalendarDataFactory [METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Calendar setToFirstDayOf(Date month); List<Day> calculateCurrentMonth(Calend...
/* static context [FOCAL] @Override public VisibleMonths CalendarDataFactoryImpl.create(Date month, int rows) [INPUTS] branches=- | result=month, rows [CALLS-INTERNAL] Calendar setToFirstDayOf(Date month); List<Day> calculateCurrentMonth(Calendar calendar); List<Day> calculateLastMonth(Calendar calendar); List<Day> cal...
/* static context [FOCAL] @Override public VisibleMonths CalendarDataFactoryImpl.create(Date month, int rows) [INPUTS] branches=- | result=month, rows [CALLS-INTERNAL] Calendar setToFirstDayOf(Date month); List<Day> calculateCurrentMonth(Calendar calendar); List<Day> calculateLastMonth(Calendar calendar); List<Day> cal...
true
ok
{"focal": {"class": "CalendarDataFactoryImpl", "name": "create", "signature": "VisibleMonths create(Date month, int rows)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "month", "type": "Date"}, {"name": "rows", "type": "int"}], "return_type": "VisibleMonths"}, "class_info": {"name": "CalendarD...
45477569_4
class AccountApiController { @RequestMapping(value = "account/testLogin", method = {RequestMethod.POST}) public Result<Void> testLogin(ExampleAccount account) throws Exception { return Result.createSuccess(); } @RequestMapping(value = "account/login", method = RequestMethod.POST) @Account(fals...
/** * 未登陆 */ httpClientAdapter.setAccountToken(null); apiManager.accountApi.testNotLoginData(); Result<Void> result = apiManager.accountApi.testLogin(); Assert.assertEquals(result.getStatus(), Result.ACCOUNT_ERROR); } }
[FOCAL] @RequestMapping(value = "account/testLogin", method = {RequestMethod.POST}) public Result<Void> AccountApiController.testLogin(ExampleAccount account) [CLASS] class AccountApiController [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Result.createSuccess/0 [EXCEPTIONS] decl...
/* static context [FOCAL] @RequestMapping(value = "account/testLogin", method = {RequestMethod.POST}) public Result<Void> AccountApiController.testLogin(ExampleAccount account) [INPUTS] branches=- | result=- | unused=account [EXCEPTIONS] declares Exception [CALLS-EXTERNAL] Result.createSuccess/0 */
/* static context [FOCAL] @RequestMapping(value = "account/testLogin", method = {RequestMethod.POST}) public Result<Void> AccountApiController.testLogin(ExampleAccount account) [INPUTS] branches=- | result=- | unused=account [EXCEPTIONS] declares Exception [CALLS-EXTERNAL] Result.createSuccess/0 */ class AccountApiCont...
true
ok
{"focal": {"class": "AccountApiController", "name": "testLogin", "signature": "Result<Void> testLogin(ExampleAccount account) throws Exception", "start_line": 3, "modifiers": "@RequestMapping(value = \"account/testLogin\", method = {RequestMethod.POST}) public", "params": [{"name": "account", "type": "ExampleAccount"}]...
45489191_6
class DockerProvisioningStrategy extends NodeProvisioner.Strategy { @VisibleForTesting protected static boolean notAllowedStrategy(DockerSlaveTemplate template) { if (isNull(template)) { LOG.debug("Skipping DockerProvisioningStrategy because: template is null"); return true; ...
final DockerSlaveTemplate template = new DockerSlaveTemplate("id"); template.setRetentionStrategy(null); assertThat(notAllowedStrategy(template), is(true)); } }
[FOCAL] @VisibleForTesting protected static boolean DockerProvisioningStrategy.notAllowedStrategy(DockerSlaveTemplate template) [CLASS] class DockerProvisioningStrategy extends NodeProvisioner.Strategy [METRICS] loc=32 cc=6 branches=5 loops=0 returns=5 throws=0 nesting=2 [CALLS-EXTERNAL] isNull/1 (inherited), LOG.debug...
/* static context [FOCAL] @VisibleForTesting protected static boolean DockerProvisioningStrategy.notAllowedStrategy(DockerSlaveTemplate template) [PATH1] if(isNull(template))=F -> if(isNull(retentionStrategy))=T -> if(retentionStrategy instanceof DockerOnceRetentionStrategy)=T -> if(template.getNumExecutors() == 1)=T -...
/* static context [FOCAL] @VisibleForTesting protected static boolean DockerProvisioningStrategy.notAllowedStrategy(DockerSlaveTemplate template) [PATH1] if(isNull(template))=F -> if(isNull(retentionStrategy))=T -> if(retentionStrategy instanceof DockerOnceRetentionStrategy)=T -> if(template.getNumExecutors() == 1)=T -...
true
ok
{"focal": {"class": "DockerProvisioningStrategy", "name": "notAllowedStrategy", "signature": "boolean notAllowedStrategy(DockerSlaveTemplate template)", "start_line": 3, "modifiers": "@VisibleForTesting protected static", "params": [{"name": "template", "type": "DockerSlaveTemplate"}], "return_type": "boolean"}, "class...
45489240_10
class CoordinatesParser { @NonNull public static GeoPoint parse(@NonNull String input) throws IllegalArgumentException { Result result = parseWithResult(input); return result.coordinates; } @NonNull static List<Token> lex(@NonNull String input); private static void lexUtmOrGprs(Lis...
double testLatitude = 39.095973; double testLongitude = -94.573414; GeoPoint actual = CoordinatesParser.parse("15N 363936 4328605"); assertEquals("Failed to parse 15N 363936 4328605", testLatitude, actual.getLatitude(), 0.000005); assertEquals("Failed to parse 15N 363936 4328605"...
[FOCAL] @NonNull public static GeoPoint CoordinatesParser.parse(String input) [CLASS] class CoordinatesParser [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Result parseWithResult(String input) [EXCEPTIONS] declares IllegalArgumentException [INPUTS] branches=- | result=input [DATA...
/* static context [FOCAL] @NonNull public static GeoPoint CoordinatesParser.parse(String input) [INPUTS] branches=- | result=input [EXCEPTIONS] declares IllegalArgumentException [CALLS-INTERNAL] Result parseWithResult(String input) */
/* static context [FOCAL] @NonNull public static GeoPoint CoordinatesParser.parse(String input) [INPUTS] branches=- | result=input [EXCEPTIONS] declares IllegalArgumentException [CALLS-INTERNAL] Result parseWithResult(String input) */ class CoordinatesParser { @NonNull public static GeoPoint parse(@NonNull Str...
true
ok
{"focal": {"class": "CoordinatesParser", "name": "parse", "signature": "GeoPoint parse(String input) throws IllegalArgumentException", "start_line": 3, "modifiers": "@NonNull public static", "params": [{"name": "input", "type": "String"}], "return_type": "GeoPoint"}, "class_info": {"name": "CoordinatesParser", "kind": ...
45502729_34
class Strings { public static boolean empty( String value ) { return value == null || "".equals(value); } public static String diff( String original, String revised ); public static int count( String source, String regex ); public static boolean nonEmpty(String value); public static ...
Assert.assertEquals( true, Strings.empty( null ) ); assertEquals( true, Strings.empty( "" ) ); assertEquals( false, Strings.empty( "asdf" ) ); } }
[FOCAL] public static boolean Strings.empty(String value) [CLASS] class Strings [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] "".equals/1 [INPUTS] branches=- | result=value [DATAFLOW] value@param->L3 [CLASS-MEMBERS] String diff(String original, String revised); int count(String s...
/* static context [FOCAL] public static boolean Strings.empty(String value) [INPUTS] branches=- | result=value [CALLS-EXTERNAL] "".equals/1 */
/* static context [FOCAL] public static boolean Strings.empty(String value) [INPUTS] branches=- | result=value [CALLS-EXTERNAL] "".equals/1 */ class Strings { public static boolean empty( String value ) { return value == null || "".equals(value); } public static String diff( String original, Str...
true
ok
{"focal": {"class": "Strings", "name": "empty", "signature": "boolean empty(String value)", "start_line": 3, "modifiers": "public static", "params": [{"name": "value", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "Strings", "kind": "class", "modifiers": "", "superclass": null, "interfaces": nul...
45510398_66
class Config { private void mergeConfigsFromClasspath() throws IOException { List<String> dirs = Arrays.asList( "META-INF/flexovm/" + os + "/" + sliceArch, "META-INF/flexovm/" + os); // The algorithm below preserves the order of config data from the // class...
File tmpDir = createTempDir(); File cacheDir = new File(tmpDir, "cache"); File p1 = createMergeConfig(tmpDir, "p1", "Foo", OS.macosx, Arch.x86, false); File p2 = createMergeConfig(tmpDir, "p2", "Wooz", OS.linux, Arch.x86, false); // Create a jar file with both x86 and x86_64 by f...
[FOCAL] private void Config.mergeConfigsFromClasspath() [CLASS] class Config [METRICS] loc=35 cc=4 branches=1 loops=2 returns=0 throws=0 nesting=3 [CALLS-INTERNAL] File extractIfNeeded(Path path); void mergeConfig(Config from, Config to) [CALLS-EXTERNAL] Arrays.asList/2, clazzes.getPaths/0, Path.contains/1, Builder.rea...
class Config { private void mergeConfigsFromClasspath() throws IOException { List<String> dirs = Arrays.asList( "META-INF/flexovm/" + os + "/" + sliceArch, "META-INF/flexovm/" + os); // The algorithm below preserves the order of config data from the // class...
false
ok
{"focal": {"class": "Config", "name": "mergeConfigsFromClasspath", "signature": "void mergeConfigsFromClasspath() throws IOException", "start_line": 3, "modifiers": "private", "params": [], "return_type": "void"}, "class_info": {"name": "Config", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null,...
45519303_4
class MainViewModel extends ViewModel { public void onClickButtonRecyclerView() { attachedActivity.startActivity(AndroidVersionsActivity.class); } MainViewModel(@NonNull ActivityComponent activityComponent, @Nullable State savedInstanceState); public void onClickButtonClic...
viewModel.onClickButtonRecyclerView(); verify(attachedActivity).startActivity(AndroidVersionsActivity.class); } }
[FOCAL] public void MainViewModel.onClickButtonRecyclerView() [CLASS] class MainViewModel extends ViewModel [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] attachedActivity.startActivity/1 [COLLABORATORS] field attachedActivity startActivity/1 [CLASS-MEMBERS] MainViewModel(Activity...
/* static context [FOCAL] public void MainViewModel.onClickButtonRecyclerView() [COLLABORATORS] field attachedActivity startActivity/1 [CALLS-EXTERNAL] attachedActivity.startActivity/1 */
/* static context [FOCAL] public void MainViewModel.onClickButtonRecyclerView() [COLLABORATORS] field attachedActivity startActivity/1 [CALLS-EXTERNAL] attachedActivity.startActivity/1 */ class MainViewModel extends ViewModel { public void onClickButtonRecyclerView() { attachedActivity.startActivity(Androi...
true
ok
{"focal": {"class": "MainViewModel", "name": "onClickButtonRecyclerView", "signature": "void onClickButtonRecyclerView()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "MainViewModel", "kind": "class", "modifiers": "", "superclass": "ViewModel", "interfaces": null...
45526710_11
class ImageUtil { public static BufferedImage loadEmbeddedBase64Image(String imageDataUri) { try { byte[] buffer = getEmbeddedBase64Image(imageDataUri); if (buffer != null) { return ImageIO.read(new ByteArrayInputStream(buffer)); } } catch (IOExce...
String onePixel = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAACXBIWXMAAC4jAAAuIwF4pT92AAAADElEQVQI12P4//8/AAX+Av7czFnnAAAAAElFTkSuQmCC"; BufferedImage result = ImageUtil.loadEmbeddedBase64Image(onePixel); Assert.assertThat(result.getHeight(), is(1)); Assert.ass...
[FOCAL] public static BufferedImage ImageUtil.loadEmbeddedBase64Image(String imageDataUri) [CLASS] class ImageUtil [METRICS] loc=11 cc=3 branches=1 loops=0 returns=2 throws=0 nesting=2 [CALLS-INTERNAL] byte[] getEmbeddedBase64Image(String imageDataUri) [CALLS-EXTERNAL] ImageIO.read/1, XRLog.log/3 [NEW] ByteArrayInputSt...
/* static context [FOCAL] public static BufferedImage ImageUtil.loadEmbeddedBase64Image(String imageDataUri) [PATH1] try-body throws -> return null [PATH2] if(buffer != null)=T -> return ImageIO.read(new ByteArrayInputStream(buffer)) [PATH3] if(buffer != null)=F -> return null [INPUTS] branches=imageDataUri | result=im...
/* static context [FOCAL] public static BufferedImage ImageUtil.loadEmbeddedBase64Image(String imageDataUri) [PATH1] try-body throws -> return null [PATH2] if(buffer != null)=T -> return ImageIO.read(new ByteArrayInputStream(buffer)) [PATH3] if(buffer != null)=F -> return null [INPUTS] branches=imageDataUri | result=im...
true
ok
{"focal": {"class": "ImageUtil", "name": "loadEmbeddedBase64Image", "signature": "BufferedImage loadEmbeddedBase64Image(String imageDataUri)", "start_line": 3, "modifiers": "public static", "params": [{"name": "imageDataUri", "type": "String"}], "return_type": "BufferedImage"}, "class_info": {"name": "ImageUtil", "kind...
45527579_10
class FederatedUserApprovalHandler implements UserApprovalHandler { @Override public boolean isApproved(AuthorizationRequest authorizationRequest, Authentication userAuthentication) { //by default, we don't show the consent screen as EB just did this return true; } @Override public AuthorizationReques...
assertTrue(subject.isApproved(request, authentication)); } }
[FOCAL] @Override public boolean FederatedUserApprovalHandler.isApproved(AuthorizationRequest authorizationRequest, Authentication userAuthentication) [CLASS] class FederatedUserApprovalHandler implements UserApprovalHandler [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [INPUTS] branches=- | resu...
/* static context [FOCAL] @Override public boolean FederatedUserApprovalHandler.isApproved(AuthorizationRequest authorizationRequest, Authentication userAuthentication) [INPUTS] branches=- | result=- | unused=authorizationRequest, userAuthentication */
/* static context [FOCAL] @Override public boolean FederatedUserApprovalHandler.isApproved(AuthorizationRequest authorizationRequest, Authentication userAuthentication) [INPUTS] branches=- | result=- | unused=authorizationRequest, userAuthentication */ class FederatedUserApprovalHandler implements UserApprovalHandler {...
true
ok
{"focal": {"class": "FederatedUserApprovalHandler", "name": "isApproved", "signature": "boolean isApproved(AuthorizationRequest authorizationRequest, Authentication userAuthentication)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "authorizationRequest", "type": "AuthorizationRequest"}, {"name...
45610821_3
class PasswordHash { public static boolean verify(byte[] password, String argon2Hash) throws IOException { Argon2Hash input = Argon2Hash.parse(argon2Hash); // Convert algorithm name to algorithm ID int algorithmId = Argon2Parameters.ARGON2_i; for (Map.Entry<Integer, String> entry: A...
System.out.println("Testing Argon2 hash verification using various algorithm parameters."); PasswordHash.verify("password".getBytes(StandardCharsets.UTF_8), "$argon2i$v=19$m=65536,t=2,p=1$c29tZXNhbHQ$wWKIMhR9lyDFvRz9YTZweHKfbftvj+qf+YFY4NeBbtA"); PasswordHash.verify("password".ge...
[FOCAL] public static boolean PasswordHash.verify(byte[] password, String argon2Hash) [CLASS] class PasswordHash [METRICS] loc=22 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] Argon2Hash hash(byte[] password, Argon2Parameters parameters) [CALLS-EXTERNAL] Argon2Hash.parse/1, ALGORITHM_NAME_MAP.en...
/* static context [FOCAL] public static boolean PasswordHash.verify(byte[] password, String argon2Hash) [PATH1] foreach(Map.Entry<Integer, String> entry : ALGORITHM_NAME_MAP.entrySet())=T -> if(entry.getValue().equals(input.getAlgorithm()))=F -> exit loop -> return input.hashEquals(expectedHash) [PATH2] foreach(Map.Ent...
/* static context [FOCAL] public static boolean PasswordHash.verify(byte[] password, String argon2Hash) [PATH1] foreach(Map.Entry<Integer, String> entry : ALGORITHM_NAME_MAP.entrySet())=T -> if(entry.getValue().equals(input.getAlgorithm()))=F -> exit loop -> return input.hashEquals(expectedHash) [PATH2] foreach(Map.Ent...
true
ok
{"focal": {"class": "PasswordHash", "name": "verify", "signature": "boolean verify(byte[] password, String argon2Hash) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "password", "type": "byte[]"}, {"name": "argon2Hash", "type": "String"}], "return_type": "boolean"}, "class_info"...
45615254_2
class KeyAllocationStrategy { public byte[] getKey(int messageNum) { return keys.get(messageNum % uniqueKeys); } public KeyAllocationStrategy(KeyAllocationStrategyDefinition strategyDefinition); @Override public String toString(); private byte[] asByteArray(int i); } class KeyAllocatio...
KeyAllocationStrategy s0 = getStrategy(KeyAllocationType.fair, 2); assertThat(s0.getKey(0), equalTo(s0.getKey(0))); // consistency assertThat(s0.getKey(0), equalTo(s0.getKey(2))); // modulo around uniqueKeys assertThat(s0.getKey(0), not(equalTo(s0.getKey(1)))); KeyAllocationStra...
[FOCAL] public byte[] KeyAllocationStrategy.getKey(int messageNum) [CLASS] class KeyAllocationStrategy [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] keys.get/1 [INPUTS] branches=- | result=messageNum [COLLABORATORS] field keys get/1 [DATAFLOW] messageNum@param->L2 [CLASS-MEMBERS]...
/* static context [FOCAL] public byte[] KeyAllocationStrategy.getKey(int messageNum) [INPUTS] branches=- | result=messageNum [COLLABORATORS] field keys get/1 [CALLS-EXTERNAL] keys.get/1 */
/* static context [FOCAL] public byte[] KeyAllocationStrategy.getKey(int messageNum) [INPUTS] branches=- | result=messageNum [COLLABORATORS] field keys get/1 [CALLS-EXTERNAL] keys.get/1 */ class KeyAllocationStrategy { public byte[] getKey(int messageNum) { return keys.get(messageNum % uniqueKeys); } ...
true
ok
{"focal": {"class": "KeyAllocationStrategy", "name": "getKey", "signature": "byte[] getKey(int messageNum)", "start_line": 3, "modifiers": "public", "params": [{"name": "messageNum", "type": "int"}], "return_type": "byte[]"}, "class_info": {"name": "KeyAllocationStrategy", "kind": "class", "modifiers": "", "superclass"...
45644056_5
class MetricsTrackingOngoingRequest extends ForwardingOngoingRequest implements TrackedOngoingRequest { @Override public void drop() { metrics.drop(); super.drop(); } MetricsTrackingOngoingRequest( RequestMetrics metrics, OngoingRequest ongoingRequest); @Override public void reply(Res...
request.drop(); verify(delegate).drop(); } }
[FOCAL] @Override public void MetricsTrackingOngoingRequest.drop() [CLASS] class MetricsTrackingOngoingRequest extends ForwardingOngoingRequest implements TrackedOngoingRequest [METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] metrics.drop/0, ForwardingOngoingRequest.drop/0 [COLLABOR...
/* static context [FOCAL] @Override public void MetricsTrackingOngoingRequest.drop() [COLLABORATORS] field metrics drop/0 [CALLS-EXTERNAL] metrics.drop/0, ForwardingOngoingRequest.drop/0 */
/* static context [FOCAL] @Override public void MetricsTrackingOngoingRequest.drop() [COLLABORATORS] field metrics drop/0 [CALLS-EXTERNAL] metrics.drop/0, ForwardingOngoingRequest.drop/0 */ class MetricsTrackingOngoingRequest extends ForwardingOngoingRequest implements TrackedOngoingRequest { @Override public void...
true
ok
{"focal": {"class": "MetricsTrackingOngoingRequest", "name": "drop", "signature": "void drop()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "MetricsTrackingOngoingRequest", "kind": "class", "modifiers": "", "superclass": "ForwardingOngoingRequest", "in...
45681674_2
class SwiftAstScanner { public static SourceFile scanSingleFile(File file, SquidAstVisitor<SwiftGrammar>... visitors) { if (!file.isFile()) { throw new IllegalArgumentException("File '" + file + "' not found."); } AstScanner<SwiftGrammar> scanner = create(new SwiftConfiguration(...
SourceFile file = SwiftAstScanner.scanSingleFile(new File("src/test/resources/Test.swift")); assertThat(file.getInt(SwiftMetric.COMMENT_LINES), is(3)); } }
[FOCAL] public static SourceFile SwiftAstScanner.scanSingleFile(File file, SquidAstVisitor<SwiftGrammar>... visitors) [CLASS] class SwiftAstScanner [METRICS] loc=13 cc=3 branches=2 loops=0 returns=1 throws=2 nesting=1 [CALLS-INTERNAL] AstScanner<SwiftGrammar> create(SwiftConfiguration conf, SquidAstVisitor<SwiftGrammar...
/* static context [FOCAL] public static SourceFile SwiftAstScanner.scanSingleFile(File file, SquidAstVisitor<SwiftGrammar>... visitors) [THROWS-WHEN] IllegalArgumentException when !file.isFile() [THROWS-WHEN] IllegalStateException when file.isFile() && sources.size() != 1 [PATH1] if(!file.isFile())=F -> if(sources.size...
/* static context [FOCAL] public static SourceFile SwiftAstScanner.scanSingleFile(File file, SquidAstVisitor<SwiftGrammar>... visitors) [THROWS-WHEN] IllegalArgumentException when !file.isFile() [THROWS-WHEN] IllegalStateException when file.isFile() && sources.size() != 1 [PATH1] if(!file.isFile())=F -> if(sources.size...
true
ok
{"focal": {"class": "SwiftAstScanner", "name": "scanSingleFile", "signature": "SourceFile scanSingleFile(File file, SquidAstVisitor<SwiftGrammar>... visitors)", "start_line": 3, "modifiers": "public static", "params": [{"name": "file", "type": "File"}, {"name": "visitors", "type": "SquidAstVisitor<SwiftGrammar>..."}], ...
45682878_0
class GameController implements IModelChangedListener, Parcelable { public void deleteNote(int row, int col, int value) { GameCell c = gameBoard.getCell(row,col); c.deleteNote(value); //notifyListeners(); } public GameController(); public GameController(SharedPreferences pref...
controller.setNote(1, 2, 5); controller.setNote(1, 2, 9); controller.deleteNote(1, 2, 5); boolean[] result = {false, false, false, false, false, false, false, false, true}; assertArrayEquals(result, controller.getNotes(1, 2)); } }
[FOCAL] public void GameController.deleteNote(int row, int col, int value) [CLASS] class GameController implements IModelChangedListener, Parcelable [METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] gameBoard.getCell/2, GameCell.deleteNote/1 [COLLABORATORS] field gameBoard getCell/2 ...
/* static context [FOCAL] public void GameController.deleteNote(int row, int col, int value) [COLLABORATORS] field gameBoard getCell/2 [CALLS-EXTERNAL] gameBoard.getCell/2, GameCell.deleteNote/1 */
/* static context [FOCAL] public void GameController.deleteNote(int row, int col, int value) [COLLABORATORS] field gameBoard getCell/2 [CALLS-EXTERNAL] gameBoard.getCell/2, GameCell.deleteNote/1 */ class GameController implements IModelChangedListener, Parcelable { public void deleteNote(int row, int col, int valu...
true
ok
{"focal": {"class": "GameController", "name": "deleteNote", "signature": "void deleteNote(int row, int col, int value)", "start_line": 3, "modifiers": "public", "params": [{"name": "row", "type": "int"}, {"name": "col", "type": "int"}, {"name": "value", "type": "int"}], "return_type": "void"}, "class_info": {"name": "G...
45692123_0
class StrFormatUtil { public static String parseCharset(String target){ Matcher matcher = charsetPattern.matcher(target); if (matcher.find()){ return matcher.group(1); } return ""; } public static String info(String pattern,Object... params); public static S...
String t = "text/html; charset=utf-16;text/html; charset=utf-8"; String r = StrFormatUtil.parseCharset(t); System.out.println(r); Assert.assertTrue("utf-8".equals(r)); } }
[FOCAL] public static String StrFormatUtil.parseCharset(String target) [CLASS] class StrFormatUtil [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] charsetPattern.matcher/1, Matcher.find/0, Matcher.group/1 [PATH1] if(matcher.find())=T -> return matcher.group(1) [PATH2] if(matcher.fi...
/* static context [FOCAL] public static String StrFormatUtil.parseCharset(String target) [PATH1] if(matcher.find())=T -> return matcher.group(1) [PATH2] if(matcher.find())=F -> return "" [INPUTS] branches=target | result=target [COLLABORATORS] field charsetPattern matcher/1 [CALLS-EXTERNAL] charsetPattern.matcher/1, Ma...
/* static context [FOCAL] public static String StrFormatUtil.parseCharset(String target) [PATH1] if(matcher.find())=T -> return matcher.group(1) [PATH2] if(matcher.find())=F -> return "" [INPUTS] branches=target | result=target [COLLABORATORS] field charsetPattern matcher/1 [CALLS-EXTERNAL] charsetPattern.matcher/1, Ma...
true
ok
{"focal": {"class": "StrFormatUtil", "name": "parseCharset", "signature": "String parseCharset(String target)", "start_line": 3, "modifiers": "public static", "params": [{"name": "target", "type": "String"}], "return_type": "String"}, "class_info": {"name": "StrFormatUtil", "kind": "class", "modifiers": "", "superclass...
45700808_1
class UserProfileBridge implements LockReactBridge { private void put(String key, Map<String, Object> map, WritableMap into) { if (map == null || map.isEmpty()) { return; } final WritableMap writableMap = Arguments.createMap(); for (Map.Entry<String, Object> entry: map....
final HashMap<String, Object> user = Maps.newHashMap(); user.put("first_name", "John"); user.put("last_name", "Doe"); user.put("friend_count", 14); final HashMap<String, Object> app = Maps.newHashMap(); app.put("subscription", "bronze"); final UserProfile profil...
[FOCAL] private void UserProfileBridge.put(String key, Map<String, Object> map, WritableMap into) [CLASS] class UserProfileBridge implements LockReactBridge [METRICS] loc=11 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] void put(String key, List<?> list, WritableMap into) [CALLS-EXTERNAL] Map<St...
/* static context [FOCAL] private void UserProfileBridge.put(String key, Map<String, Object> map, WritableMap into) [PATH1] if(map == null || map.isEmpty())=F -> foreach(Map.Entry<String, Object> entry : map.entrySet())=T -> exit loop [PATH2] if(map == null || map.isEmpty())=T -> return [PATH3] if(map == null || map.is...
/* static context [FOCAL] private void UserProfileBridge.put(String key, Map<String, Object> map, WritableMap into) [PATH1] if(map == null || map.isEmpty())=F -> foreach(Map.Entry<String, Object> entry : map.entrySet())=T -> exit loop [PATH2] if(map == null || map.isEmpty())=T -> return [PATH3] if(map == null || map.is...
true
ok
{"focal": {"class": "UserProfileBridge", "name": "put", "signature": "void put(String key, Map<String, Object> map, WritableMap into)", "start_line": 3, "modifiers": "private", "params": [{"name": "key", "type": "String"}, {"name": "map", "type": "Map<String, Object>"}, {"name": "into", "type": "WritableMap"}], "return...
45705189_1
class GeoLocationUtils { public static GeoLocation centralLocation(List<GeoLocation> geoLocations) { Objects.requireNonNull(geoLocations); if (geoLocations.isEmpty()) { return null; } int locationCount = geoLocations.size(); if (locationCount == 1) { return geoLocations.iterator().next(); } doub...
List<GeoLocation> locations = new ArrayList<>(); locations.add(new GeoLocation(121.612016711363d, 32)); locations.add(new GeoLocation(121.849004871905, 31)); GeoLocation centralLocation = GeoLocationUtils.centralLocation(locations); assertEquals(121.73, centralLocation.getLatitude(), 0.001); assertEquals(31...
[FOCAL] public static GeoLocation GeoLocationUtils.centralLocation(List<GeoLocation> geoLocations) [CLASS] class GeoLocationUtils [METRICS] loc=36 cc=4 branches=2 loops=1 returns=3 throws=0 nesting=1 [CALLS-EXTERNAL] Objects.requireNonNull/1, List<GeoLocation>.isEmpty/0, List<GeoLocation>.size/0, geoLocations.iterator(...
/* static context [FOCAL] public static GeoLocation GeoLocationUtils.centralLocation(List<GeoLocation> geoLocations) [PATH1] if(geoLocations.isEmpty())=F -> if(locationCount == 1)=F -> foreach(GeoLocation geoLocation : geoLocations)=T -> exit loop -> return new GeoLocation(midPointLatitude, midPointLongitude) [PATH2] i...
/* static context [FOCAL] public static GeoLocation GeoLocationUtils.centralLocation(List<GeoLocation> geoLocations) [PATH1] if(geoLocations.isEmpty())=F -> if(locationCount == 1)=F -> foreach(GeoLocation geoLocation : geoLocations)=T -> exit loop -> return new GeoLocation(midPointLatitude, midPointLongitude) [PATH2] i...
true
ok
{"focal": {"class": "GeoLocationUtils", "name": "centralLocation", "signature": "GeoLocation centralLocation(List<GeoLocation> geoLocations)", "start_line": 3, "modifiers": "public static", "params": [{"name": "geoLocations", "type": "List<GeoLocation>"}], "return_type": "GeoLocation"}, "class_info": {"name": "GeoLocat...
45721011_231
class NacosCoordinator implements ClusterRegister, ClusterNodesQuery { @Override public List<RemoteInstance> queryRemoteNodes() { List<RemoteInstance> result = new ArrayList<>(); try { List<Instance> instances = namingService.selectInstances(config.getServiceName(), true); ...
List<Instance> instances = mockInstance(); when(namingService.selectInstances(anyString(), anyBoolean())).thenReturn(instances); List<RemoteInstance> remoteInstances = coordinator.queryRemoteNodes(); assertEquals(remoteInstances.size(), instances.size()); } }
[FOCAL] @Override public List<RemoteInstance> NacosCoordinator.queryRemoteNodes() [CLASS] class NacosCoordinator implements ClusterRegister, ClusterNodesQuery [METRICS] loc=19 cc=3 branches=1 loops=0 returns=1 throws=1 nesting=3 [CALLS-EXTERNAL] NamingService.selectInstances/2, config.getServiceName/0, CollectionUtils....
/* static context [FOCAL] @Override public List<RemoteInstance> NacosCoordinator.queryRemoteNodes() [THROWS-WHEN] ServiceQueryException when try-body throws [PATH1] try-body throws -> throw new ServiceQueryException(e.getErrMsg()) [PATH2] if(CollectionUtils.isNotEmpty(instances))=T -> return result [PATH3] if(Collectio...
/* static context [FOCAL] @Override public List<RemoteInstance> NacosCoordinator.queryRemoteNodes() [THROWS-WHEN] ServiceQueryException when try-body throws [PATH1] try-body throws -> throw new ServiceQueryException(e.getErrMsg()) [PATH2] if(CollectionUtils.isNotEmpty(instances))=T -> return result [PATH3] if(Collectio...
true
ok
{"focal": {"class": "NacosCoordinator", "name": "queryRemoteNodes", "signature": "List<RemoteInstance> queryRemoteNodes()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "List<RemoteInstance>"}, "class_info": {"name": "NacosCoordinator", "kind": "class", "modifiers": "", "superclass": n...
45732211_6
class EmbeddingsPipeline { public static void main(String[] args) throws IOException, UIMAException { String inputDir = args.length > 0 ? args[0] : DEFAULT_SOURCE; CollectionReaderDescription reader = createReaderDescription(TextReader.class, TextReader.PARAM_SOURCE...
int expectedSize = 28; int dimensionality = 50; EmbeddingsPipeline.TARGET_FILE.delete(); EmbeddingsPipeline.main(new String[] {}); List<String> output = Files.readAllLines(EmbeddingsPipeline.TARGET_FILE.toPath()); assertEquals(expectedSize, output.size()); asser...
[FOCAL] public static void EmbeddingsPipeline.main(String[] args) [CLASS] class EmbeddingsPipeline [METRICS] loc=19 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] createReaderDescription/5 (inherited), createEngineDescription/1 (inherited), createEngineDescription/3 (inherited), createEngineDescr...
/* static context [FOCAL] public static void EmbeddingsPipeline.main(String[] args) [EXCEPTIONS] declares IOException, UIMAException [CALLS-EXTERNAL] createReaderDescription/5 (inherited), createEngineDescription/1 (inherited), createEngineDescription/3 (inherited), createEngineDescription/7 (inherited), SimplePipeline...
/* static context [FOCAL] public static void EmbeddingsPipeline.main(String[] args) [EXCEPTIONS] declares IOException, UIMAException [CALLS-EXTERNAL] createReaderDescription/5 (inherited), createEngineDescription/1 (inherited), createEngineDescription/3 (inherited), createEngineDescription/7 (inherited), SimplePipeline...
true
ok
{"focal": {"class": "EmbeddingsPipeline", "name": "main", "signature": "void main(String[] args) throws IOException, UIMAException", "start_line": 3, "modifiers": "public static", "params": [{"name": "args", "type": "String[]"}], "return_type": "void"}, "class_info": {"name": "EmbeddingsPipeline", "kind": "class", "mod...