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
76209402_8
class Timestamp implements Comparable<Timestamp>, Cloneable { public long toLong() { long longRepresentation = this.wallTime; longRepresentation = longRepresentation << 16; //longRepresentation = (longRepresentation & 0xFFFFFFFFFFFF0000L); longRepresentation = (longRepresentatio...
Timestamp t = new Timestamp(); long tLong = t.toLong(); Timestamp t2 = t.add(1, (short)0); long t2Long = t2.toLong(); Timestamp t3 = t.add(0, (short)1); long t3Long = t3.toLong(); //make sure the order holds in 64-bit notation assertTrue(tLong < t2Long); ...
[FOCAL] public long Timestamp.toLong() [CLASS] class Timestamp implements Comparable<Timestamp>, Cloneable [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [FIELDS] read=logical, wallTime [DATAFLOW] longRepresentation@L3->L4; longRepresentation@L4->L6; longRepresentation@L6->L7 [CLASS-MEMBERS] Times...
/* static context [FOCAL] public long Timestamp.toLong() [FIELDS] read=logical, wallTime */
/* static context [FOCAL] public long Timestamp.toLong() [FIELDS] read=logical, wallTime */ class Timestamp implements Comparable<Timestamp>, Cloneable { public long toLong() { long longRepresentation = this.wallTime; longRepresentation = longRepresentation << 16; //longRepresentation =...
true
ok
{"focal": {"class": "Timestamp", "name": "toLong", "signature": "long toLong()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "long"}, "class_info": {"name": "Timestamp", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Comparable<Timestamp>, Cloneable", "fields": [{"name": "...
76267363_172
class ExceptionHandlingAsyncTaskExecutor implements AsyncTaskExecutor, InitializingBean, DisposableBean { @Override public void afterPropertiesSet() throws Exception { if (executor instanceof InitializingBean) { InitializingBean bean = (InitializingBean) executor; bean.after...
Throwable caught = catchThrowable(() -> { executor.afterPropertiesSet(); verify(task, never()).afterPropertiesSet(); }); assertThat(caught).isNull(); } }
[FOCAL] @Override public void ExceptionHandlingAsyncTaskExecutor.afterPropertiesSet() [CLASS] class ExceptionHandlingAsyncTaskExecutor implements AsyncTaskExecutor, InitializingBean, DisposableBean [METRICS] loc=7 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] InitializingBean.afterPropertiesSet/...
/* static context [FOCAL] @Override public void ExceptionHandlingAsyncTaskExecutor.afterPropertiesSet() [PATH1] if(executor instanceof InitializingBean)=T [PATH2] if(executor instanceof InitializingBean)=F [INPUTS] branches=executor | result=- [EXCEPTIONS] declares Exception [FIELDS] read=executor:ExceptionHandlingAsyn...
/* static context [FOCAL] @Override public void ExceptionHandlingAsyncTaskExecutor.afterPropertiesSet() [PATH1] if(executor instanceof InitializingBean)=T [PATH2] if(executor instanceof InitializingBean)=F [INPUTS] branches=executor | result=- [EXCEPTIONS] declares Exception [FIELDS] read=executor:ExceptionHandlingAsyn...
true
ok
{"focal": {"class": "ExceptionHandlingAsyncTaskExecutor", "name": "afterPropertiesSet", "signature": "void afterPropertiesSet() throws Exception", "start_line": 4, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "ExceptionHandlingAsyncTaskExecutor", "kind": "class", "modifi...
76278501_46
class RewardUtils { public static Pair<Integer, String> shippingSummary(final @NonNull Reward reward) { final String shippingType = reward.shippingType(); if (!RewardUtils.isShippable(reward) || shippingType == null) { return null; } switch (shippingType) { case Reward.SHIPPING_TYPE_ANY...
final Reward rewardWithNullShipping = RewardFactory.reward() .toBuilder() .shippingType(null) .build(); assertNull(RewardUtils.shippingSummary(rewardWithNullShipping)); final Reward rewardWithNoShipping = RewardFactory.reward(); assertNull(RewardUtils.shippingSummary(rewardWithNoShipp...
[FOCAL] public static Pair<Integer, String> RewardUtils.shippingSummary(Reward reward) [CLASS] class RewardUtils [METRICS] loc=23 cc=6 branches=3 loops=0 returns=6 throws=0 nesting=2 [CALLS-EXTERNAL] Reward.shippingType/0, RewardUtils.isShippable/1, Pair.create/2, Reward.shippingSingleLocation/0, ObjectUtils.isNotNull/...
/* static context [FOCAL] public static Pair<Integer, String> RewardUtils.shippingSummary(Reward reward) [PATH1] if(!RewardUtils.isShippable(reward) || shippingType == null)=F -> switch(shippingType)=case Reward.SHIPPING_TYPE_SINGLE_LOCA... -> if(ObjectUtils.isNotNull(location))=T -> return Pair.create(R.string.locatio...
/* static context [FOCAL] public static Pair<Integer, String> RewardUtils.shippingSummary(Reward reward) [PATH1] if(!RewardUtils.isShippable(reward) || shippingType == null)=F -> switch(shippingType)=case Reward.SHIPPING_TYPE_SINGLE_LOCA... -> if(ObjectUtils.isNotNull(location))=T -> return Pair.create(R.string.locatio...
true
ok
{"focal": {"class": "RewardUtils", "name": "shippingSummary", "signature": "Pair<Integer, String> shippingSummary(Reward reward)", "start_line": 3, "modifiers": "public static", "params": [{"name": "reward", "type": "Reward"}], "return_type": "Pair<Integer, String>"}, "class_info": {"name": "RewardUtils", "kind": "clas...
76279202_0
class Serialization { public static byte[] readDEROctetString(byte[] input) throws SerializationException { return readDEROctetString(new ByteArrayInputStream(input)); } private Serialization(); public static byte[] readDEROctetString(InputStream input); public static byte[][...
byte[] in, expected; in = new byte[] { 0x04, // TAG 0x06, // length 0x01, 0x02, 0x03, 0x04, 0x05, 0x05 // data }; expected = new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05, 0x05 }; assertEqualByteArrays(expected, Serialization.readDEROctetString(in...
[FOCAL] public static byte[] Serialization.readDEROctetString(byte[] input) [CLASS] class Serialization [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] byte[] readDEROctetString(InputStream input) [NEW] ByteArrayInputStream [EXCEPTIONS] declares SerializationException [INPUTS] bran...
/* static context [FOCAL] public static byte[] Serialization.readDEROctetString(byte[] input) [INPUTS] branches=- | result=input [EXCEPTIONS] declares SerializationException [CALLS-INTERNAL] byte[] readDEROctetString(InputStream input) [NEW] ByteArrayInputStream */
/* static context [FOCAL] public static byte[] Serialization.readDEROctetString(byte[] input) [INPUTS] branches=- | result=input [EXCEPTIONS] declares SerializationException [CALLS-INTERNAL] byte[] readDEROctetString(InputStream input) [NEW] ByteArrayInputStream */ class Serialization { public static byte[] readDE...
true
ok
{"focal": {"class": "Serialization", "name": "readDEROctetString", "signature": "byte[] readDEROctetString(byte[] input) throws SerializationException", "start_line": 3, "modifiers": "public static", "params": [{"name": "input", "type": "byte[]"}], "return_type": "byte[]"}, "class_info": {"name": "Serialization", "kind...
76284858_0
class AnnotationProcessor extends AbstractProcessor { @Override public synchronized void init(final ProcessingEnvironment processingEnv) { super.init(processingEnv); versionCode = processingEnv.getOptions().get(OPTION_VERSION_CODE); versionName = processingEnv.getOptions().get(OPTION_V...
annotationProcessor.init(processingEnvironment); verify(processingEnvironment).getMessager(); } }
[FOCAL] @Override public synchronized void AnnotationProcessor.init(ProcessingEnvironment processingEnv) [CLASS] class AnnotationProcessor extends AbstractProcessor [METRICS] loc=9 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] AbstractProcessor.init/1, processingEnv.getOptions().get/1, Processin...
/* static context [FOCAL] @Override public synchronized void AnnotationProcessor.init(ProcessingEnvironment processingEnv) [COLLABORATORS] param processingEnv:ProcessingEnvironment getOptions/0,getMessager/0 [STATE] messager [FIELDS] write=messager [CALLS-EXTERNAL] AbstractProcessor.init/1, processingEnv.getOptions().g...
/* static context [FOCAL] @Override public synchronized void AnnotationProcessor.init(ProcessingEnvironment processingEnv) [COLLABORATORS] param processingEnv:ProcessingEnvironment getOptions/0,getMessager/0 [STATE] messager [FIELDS] write=messager [CALLS-EXTERNAL] AbstractProcessor.init/1, processingEnv.getOptions().g...
true
ok
{"focal": {"class": "AnnotationProcessor", "name": "init", "signature": "void init(ProcessingEnvironment processingEnv)", "start_line": 3, "modifiers": "@Override public synchronized", "params": [{"name": "processingEnv", "type": "ProcessingEnvironment"}], "return_type": "void"}, "class_info": {"name": "AnnotationProce...
76307760_18
class AnagramDictionary { @VisibleForTesting static boolean isAnagram(String first, String second) { // // Your code here // return true; } public AnagramDictionary(InputStream wordListStream); public boolean isGoodWord(String word, String base); public ArrayL...
assertTrue(AnagramDictionary.isAnagram("a", "a")); } }
[FOCAL] @VisibleForTesting static boolean AnagramDictionary.isAnagram(String first, String second) [CLASS] class AnagramDictionary [METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [INPUTS] branches=- | result=- | unused=first, second [CLASS-MEMBERS] AnagramDictionary(InputStream wordListStream); boo...
/* static context [FOCAL] @VisibleForTesting static boolean AnagramDictionary.isAnagram(String first, String second) [INPUTS] branches=- | result=- | unused=first, second */
/* static context [FOCAL] @VisibleForTesting static boolean AnagramDictionary.isAnagram(String first, String second) [INPUTS] branches=- | result=- | unused=first, second */ class AnagramDictionary { @VisibleForTesting static boolean isAnagram(String first, String second) { // // Your code here...
true
ok
{"focal": {"class": "AnagramDictionary", "name": "isAnagram", "signature": "boolean isAnagram(String first, String second)", "start_line": 3, "modifiers": "@VisibleForTesting static", "params": [{"name": "first", "type": "String"}, {"name": "second", "type": "String"}], "return_type": "boolean"}, "class_info": {"name":...
76332085_0
class GtidSourceOffset implements SourceOffset { public static GtidSourceOffset parse(String offset) { // offset can be either json object or simple gtid-set if (offset.trim().startsWith("{")) { try { return mapper.readValue(offset, GtidSourceOffset.class); } catch (IOException e) { ...
assertThat(new GtidSourceOffset(gtidSet1), is(GtidSourceOffset.parse(gtidSet1))); } }
[FOCAL] public static GtidSourceOffset GtidSourceOffset.parse(String offset) [CLASS] class GtidSourceOffset implements SourceOffset [METRICS] loc=13 cc=3 branches=1 loops=0 returns=2 throws=1 nesting=2 [CALLS-EXTERNAL] offset.trim().startsWith/1, String.trim/0, mapper.readValue/2, Throwables.propagate/1 [NEW] GtidSourc...
/* static context [FOCAL] public static GtidSourceOffset GtidSourceOffset.parse(String offset) [THROWS-WHEN] Throwables.propagate(e) when offset.trim().startsWith("{") && try-body throws [PATH1] if(offset.trim().startsWith("{"))=T -> try-body throws -> throw Throwables.propagate(e) [PATH2] if(offset.trim().startsWith("...
/* static context [FOCAL] public static GtidSourceOffset GtidSourceOffset.parse(String offset) [THROWS-WHEN] Throwables.propagate(e) when offset.trim().startsWith("{") && try-body throws [PATH1] if(offset.trim().startsWith("{"))=T -> try-body throws -> throw Throwables.propagate(e) [PATH2] if(offset.trim().startsWith("...
true
ok
{"focal": {"class": "GtidSourceOffset", "name": "parse", "signature": "GtidSourceOffset parse(String offset)", "start_line": 3, "modifiers": "public static", "params": [{"name": "offset", "type": "String"}], "return_type": "GtidSourceOffset"}, "class_info": {"name": "GtidSourceOffset", "kind": "class", "modifiers": "",...
76341709_2
class LibConvertNumberUtils { public final static long convert2Long(Object value, long defaultValue) { if (value == null || "".equals(value.toString().trim())) { return defaultValue; } try { return Long.valueOf(value.toString()); } catch (Exception e) { ...
System.out.println("START: convert2Long"); Assert.assertEquals(6l,LibConvertNumberUtils.convert2Long(i,0l)); Assert.assertEquals(8l,LibConvertNumberUtils.convert2Long(l,0l)); Assert.assertEquals(3l,LibConvertNumberUtils.convert2Long(f,0l)); Assert.assertEquals(9l,LibConvertNumbe...
[FOCAL] public final static long LibConvertNumberUtils.convert2Long(Object value, long defaultValue) [CLASS] class LibConvertNumberUtils [METRICS] loc=15 cc=4 branches=1 loops=0 returns=4 throws=0 nesting=2 [CALLS-EXTERNAL] "".equals/1, value.toString().trim/0, Object.toString/0, Long.valueOf/1, Double.valueOf(value.to...
/* static context [FOCAL] public final static long LibConvertNumberUtils.convert2Long(Object value, long defaultValue) [PATH1] if(value == null || "".equals(value.toString().trim()))=F -> try-body throws -> return Double.valueOf(value.toString()).intValue() [PATH2] if(value == null || "".equals(value.toString().trim())...
/* static context [FOCAL] public final static long LibConvertNumberUtils.convert2Long(Object value, long defaultValue) [PATH1] if(value == null || "".equals(value.toString().trim()))=F -> try-body throws -> return Double.valueOf(value.toString()).intValue() [PATH2] if(value == null || "".equals(value.toString().trim())...
true
ok
{"focal": {"class": "LibConvertNumberUtils", "name": "convert2Long", "signature": "long convert2Long(Object value, long defaultValue)", "start_line": 3, "modifiers": "public final static", "params": [{"name": "value", "type": "Object"}, {"name": "defaultValue", "type": "long"}], "return_type": "long"}, "class_info": {"...
76346666_34
class DocumentRelationBuilderByKey implements DocumentRelationBuilder { @Override public Relationship buildRelation(Node parent, Node child, DocumentRelationContext context) { String documentKey = context.getDocumentKey(); if(StringUtils.isBlank(documentKey)) { return null; } RelationshipType relatio...
context.setDocumentKey("key"); Node parent = db.createNode(); parent.setProperty("type", "album"); Node child = db.createNode(); child.setProperty("type", "artist"); Relationship rel = this.docrel.buildRelation(parent, child, context); Assert.assertEquals(parent.getId(), rel.getStartNode().getId...
[FOCAL] @Override public Relationship DocumentRelationBuilderByKey.buildRelation(Node parent, Node child, DocumentRelationContext context) [CLASS] class DocumentRelationBuilderByKey implements DocumentRelationBuilder [METRICS] loc=34 cc=5 branches=4 loops=0 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] DocumentRelation...
/* static context [FOCAL] @Override public Relationship DocumentRelationBuilderByKey.buildRelation(Node parent, Node child, DocumentRelationContext context) [PATH1] if(StringUtils.isBlank(documentKey))=F -> if(rels.isEmpty())=T -> if(log.isDebugEnabled())#1=T -> return relationship [PATH2] if(StringUtils.isBlank(docume...
/* static context [FOCAL] @Override public Relationship DocumentRelationBuilderByKey.buildRelation(Node parent, Node child, DocumentRelationContext context) [PATH1] if(StringUtils.isBlank(documentKey))=F -> if(rels.isEmpty())=T -> if(log.isDebugEnabled())#1=T -> return relationship [PATH2] if(StringUtils.isBlank(docume...
true
ok
{"focal": {"class": "DocumentRelationBuilderByKey", "name": "buildRelation", "signature": "Relationship buildRelation(Node parent, Node child, DocumentRelationContext context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "parent", "type": "Node"}, {"name": "child", "type": "Node"}, {"name": "...
76375829_76
class Servo implements AutoCloseable { public void setAngleRange(double minAngle, double maxAngle) throws IOException { if (minAngle >= maxAngle) { throw new IllegalArgumentException("minAngle must be less than maxAngle"); } mMinAngle = minAngle; mMaxAngle = maxAngle; ...
Servo servo = new Servo(mPwm); final double minAngle = -100, maxAngle = 100; servo.setAngleRange(minAngle, maxAngle); assertEquals(minAngle, servo.getMinimumAngle(), EPSILON); assertEquals(maxAngle, servo.getMaximumAngle(), EPSILON); } }
[FOCAL] public void Servo.setAngleRange(double minAngle, double maxAngle) [CLASS] class Servo implements AutoCloseable [METRICS] loc=15 cc=4 branches=3 loops=0 returns=0 throws=1 nesting=2 [CALLS-INTERNAL] void updateDutyCycle() [NEW] IllegalArgumentException [EXCEPTIONS] declares IOException; throws IllegalArgumentExc...
/* static context [FOCAL] public void Servo.setAngleRange(double minAngle, double maxAngle) [THROWS-WHEN] IllegalArgumentException when minAngle >= maxAngle [PATH1] if(minAngle >= maxAngle)=F -> if(mAngle < mMinAngle)=F -> if(mAngle > mMaxAngle)=T [PATH2] if(minAngle >= maxAngle)=T -> throw new IllegalArgumentException...
/* static context [FOCAL] public void Servo.setAngleRange(double minAngle, double maxAngle) [THROWS-WHEN] IllegalArgumentException when minAngle >= maxAngle [PATH1] if(minAngle >= maxAngle)=F -> if(mAngle < mMinAngle)=F -> if(mAngle > mMaxAngle)=T [PATH2] if(minAngle >= maxAngle)=T -> throw new IllegalArgumentException...
true
ok
{"focal": {"class": "Servo", "name": "setAngleRange", "signature": "void setAngleRange(double minAngle, double maxAngle) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "minAngle", "type": "double"}, {"name": "maxAngle", "type": "double"}], "return_type": "void"}, "class_info": {"name":...
76405311_76
class MatchBody extends BaseMatchRule { @Override public boolean test(RecordedHttpRequest incomingRequest, RecordedHttpRequest expectedRequest) { String charSet1 = incomingRequest.getCharset(); String charSet2 = expectedRequest.getCharset(); RecordedHttpBody incomingBody = incomingRequest.getHttpBody()...
RecordedStringHttpBody stringHttpBody1 = new RecordedStringHttpBody("abc"); RecordedStringHttpBody stringHttpBody2 = new RecordedStringHttpBody("abcd"); RecordedHttpRequest recordedHttpRequest1 = new RecordedHttpRequest(null, null, null, stringHttpBody1); RecordedHttpRequest recordedHttpRequest2 = new R...
[FOCAL] @Override public boolean MatchBody.test(RecordedHttpRequest incomingRequest, RecordedHttpRequest expectedRequest) [CLASS] class MatchBody extends BaseMatchRule [METRICS] loc=20 cc=4 branches=2 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] RecordedHttpRequest.getCharset/0, RecordedHttpRequest.getHttpBody...
/* static context [FOCAL] @Override public boolean MatchBody.test(RecordedHttpRequest incomingRequest, RecordedHttpRequest expectedRequest) [THROWS-WHEN] RuntimeException when incomingBody == null && expectedBody == null && try-body throws [THROWS-WHEN] RuntimeException when incomingBody == null && !(expectedBody == nu...
/* static context [FOCAL] @Override public boolean MatchBody.test(RecordedHttpRequest incomingRequest, RecordedHttpRequest expectedRequest) [THROWS-WHEN] RuntimeException when incomingBody == null && expectedBody == null && try-body throws [THROWS-WHEN] RuntimeException when incomingBody == null && !(expectedBody == nu...
true
ok
{"focal": {"class": "MatchBody", "name": "test", "signature": "boolean test(RecordedHttpRequest incomingRequest, RecordedHttpRequest expectedRequest)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "incomingRequest", "type": "RecordedHttpRequest"}, {"name": "expectedRequest", "type": "RecordedHt...
76431952_1
class WindowIfChanged { public static <T, K> Observable<GroupedObservable<K, T>> create(Observable<T> upstream, Function<? super T, ? extends K> keySelector) { return new WindowIfChangedObservable<>(upstream, keySelector); } private WindowIfChanged(); private final Function<Message, String> userSe...
Observable<Message> messages = Observable.just(new Message("Bob", "Hello")); final AtomicInteger seen = new AtomicInteger(); WindowIfChanged.create(messages, userSelector) .switchMap( new Function<GroupedObservable<String, Message>, Observable<Notification<String>>>() { @Ov...
[FOCAL] public static Observable<GroupedObservable<K, T>> WindowIfChanged.create(Observable<T> upstream, Function<? super T, ? extends K> keySelector) [CLASS] class WindowIfChanged [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] WindowIfChangedObservable<> [INPUTS] branches=- | result=keySele...
/* static context [FOCAL] public static Observable<GroupedObservable<K, T>> WindowIfChanged.create(Observable<T> upstream, Function<? super T, ? extends K> keySelector) [INPUTS] branches=- | result=keySelector, upstream [NEW] WindowIfChangedObservable<> */
/* static context [FOCAL] public static Observable<GroupedObservable<K, T>> WindowIfChanged.create(Observable<T> upstream, Function<? super T, ? extends K> keySelector) [INPUTS] branches=- | result=keySelector, upstream [NEW] WindowIfChangedObservable<> */ class WindowIfChanged { public static <T, K> Observable<Grou...
true
ok
{"focal": {"class": "WindowIfChanged", "name": "create", "signature": "Observable<GroupedObservable<K, T>> create(Observable<T> upstream, Function<? super T, ? extends K> keySelector)", "start_line": 3, "modifiers": "public static", "params": [{"name": "upstream", "type": "Observable<T>"}, {"name": "keySelector", "type...
76436183_1
class LindenSchemaBuilder { public static LindenSchema build(File schemaFile) throws Exception { Preconditions.checkNotNull(schemaFile); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document dom = db.parse(schemaFile); dom.getD...
String schemaPath = TestLindenSchemaBuilder.class.getResource("/test_builder_schema.xml").getPath(); LindenSchema schema = LindenSchemaBuilder.build(new File(schemaPath)); Assert.assertEquals("aid", schema.getId()); Assert.assertEquals(9, schema.getFieldsSize()); Assert.assertTrue(schema.getFields(...
[FOCAL] public static LindenSchema LindenSchemaBuilder.build(File schemaFile) [CLASS] class LindenSchemaBuilder [METRICS] loc=21 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] LindenFieldSchema parseFiled(Element element); void verifyFieldSchema(LindenFieldSchema schema) [CALLS-EXTERNAL] Precondi...
/* static context [FOCAL] public static LindenSchema LindenSchemaBuilder.build(File schemaFile) [PATH1] for(i < colList.getLength())=T -> exit loop -> return lindenSchema [PATH2] for(i < colList.getLength())=F -> return lindenSchema [INPUTS] branches=schemaFile | result=- [EXCEPTIONS] declares Exception [CALLS-INTERNAL...
/* static context [FOCAL] public static LindenSchema LindenSchemaBuilder.build(File schemaFile) [PATH1] for(i < colList.getLength())=T -> exit loop -> return lindenSchema [PATH2] for(i < colList.getLength())=F -> return lindenSchema [INPUTS] branches=schemaFile | result=- [EXCEPTIONS] declares Exception [CALLS-INTERNAL...
true
ok
{"focal": {"class": "LindenSchemaBuilder", "name": "build", "signature": "LindenSchema build(File schemaFile) throws Exception", "start_line": 3, "modifiers": "public static", "params": [{"name": "schemaFile", "type": "File"}], "return_type": "LindenSchema"}, "class_info": {"name": "LindenSchemaBuilder", "kind": "class...
76474200_71
class TablePathUtils { public static Option<Path> getTablePath(FileSystem fs, Path path) throws HoodieException, IOException { LOG.info("Getting table path from path : " + path); FileStatus fileStatus = fs.getFileStatus(path); Path directory = fileStatus.isFile() ? fileStatus.getPath().getParent() : fil...
Path metadataFolder = new Path(tablePath, HoodieTableMetaClient.METAFOLDER_NAME); Option<Path> inferredTablePath = TablePathUtils.getTablePath(fs, metadataFolder); assertEquals(tablePath, inferredTablePath.get()); } }
[FOCAL] public static Option<Path> TablePathUtils.getTablePath(FileSystem fs, Path path) [CLASS] class TablePathUtils [METRICS] loc=20 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1 [CALLS-INTERNAL] Option<Path> getTablePathFromPartitionPath(FileSystem fs, Path partitionPath); Option<Path> getTablePathFromTableMe...
/* static context [FOCAL] public static Option<Path> TablePathUtils.getTablePath(FileSystem fs, Path path) [PATH1] if(TablePathUtils.hasTableMetadataFolder(fs, directory))=F -> if(tablePath.isPresent())=T -> return tablePath [PATH2] if(TablePathUtils.hasTableMetadataFolder(fs, directory))=T -> return Option.of(director...
/* static context [FOCAL] public static Option<Path> TablePathUtils.getTablePath(FileSystem fs, Path path) [PATH1] if(TablePathUtils.hasTableMetadataFolder(fs, directory))=F -> if(tablePath.isPresent())=T -> return tablePath [PATH2] if(TablePathUtils.hasTableMetadataFolder(fs, directory))=T -> return Option.of(director...
true
ok
{"focal": {"class": "TablePathUtils", "name": "getTablePath", "signature": "Option<Path> getTablePath(FileSystem fs, Path path) throws HoodieException, IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "fs", "type": "FileSystem"}, {"name": "path", "type": "Path"}], "return_type": "Option<...
76488267_34
class Filters { public static List<Track> mergeTracks(final List<Track> tracks) { final List<TrackSegment> segments = tracks.stream() .flatMap(Track::segments) .collect(toUnmodifiableList()); return tracks.isEmpty() ? List.of() : List.of( tracks.get(0).toBuilder() .segments(segments) .b...
final GPX gpx = nextGPX(new Random(1)).toBuilder() .addTrack(nextTrack(new Random(2))) .addTrack(nextTrack(new Random(3))) .addTrack(nextTrack(new Random(4))) .build(); final GPX merged = gpx.toBuilder() .trackFilter() .listMap(Filters::mergeTracks) .filter(Track::nonEmpty) .build() ....
[FOCAL] public static List<Track> Filters.mergeTracks(List<Track> tracks) [CLASS] class Filters [METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] tracks.stream() .flatMap(Track::segments).collect/1, tracks.stream().flatMap/1, List<Track>.stream/0, toUnmodifiableList/0 (inherited), L...
/* static context [FOCAL] public static List<Track> Filters.mergeTracks(List<Track> tracks) [INPUTS] branches=- | result=tracks [COLLABORATORS] param tracks:List<Track> stream/0,isEmpty/0,get/1 [CALLS-EXTERNAL] tracks.stream() .flatMap(Track::segments).collect/1, tracks.stream().flatMap/1, List<Track>.stream/0, toUnmod...
/* static context [FOCAL] public static List<Track> Filters.mergeTracks(List<Track> tracks) [INPUTS] branches=- | result=tracks [COLLABORATORS] param tracks:List<Track> stream/0,isEmpty/0,get/1 [CALLS-EXTERNAL] tracks.stream() .flatMap(Track::segments).collect/1, tracks.stream().flatMap/1, List<Track>.stream/0, toUnmod...
true
ok
{"focal": {"class": "Filters", "name": "mergeTracks", "signature": "List<Track> mergeTracks(List<Track> tracks)", "start_line": 3, "modifiers": "public static", "params": [{"name": "tracks", "type": "List<Track>"}], "return_type": "List<Track>"}, "class_info": {"name": "Filters", "kind": "class", "modifiers": "", "supe...
76591624_9
class ErrorException extends RuntimeException { public final int getCode() { return code; } public ErrorException(final int code); public ErrorException(final int code, @Nullable final String message); public ErrorException(final int code, @Nullable final Throwable cause); public ErrorException(final int ...
// Act: final ErrorException exception = new ErrorException(2, "Fatal error!"); // Assert: assertThat(exception.getCode(), is(2)); assertThat(exception.getMessage(), is("Fatal error!")); assertThat(exception.getCause(), is(nullValue())); } }
[FOCAL] public final int ErrorException.getCode() [CLASS] class ErrorException extends RuntimeException [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] ErrorException(int code); ErrorException(int code, String message); ErrorException(int code, Throwable cause); ErrorException(int c...
/* static context [FOCAL] public final int ErrorException.getCode() */
/* static context [FOCAL] public final int ErrorException.getCode() */ class ErrorException extends RuntimeException { public final int getCode() { return code; } public ErrorException(final int code); public ErrorException(final int code, @Nullable final String message); public ErrorException(final int cod...
true
ok
{"focal": {"class": "ErrorException", "name": "getCode", "signature": "int getCode()", "start_line": 3, "modifiers": "public final", "params": [], "return_type": "int"}, "class_info": {"name": "ErrorException", "kind": "class", "modifiers": "", "superclass": "RuntimeException", "interfaces": null, "fields": [], "member...
76600904_140
class AccountResourceImpl { @POST @Path("/login") public Response login(@HeaderParam("Authorization") String authHeader) { if (StringUtils.isBlank(authHeader)) { return Response.status(Response.Status.UNAUTHORIZED).build(); } Optional<Pair<String, String>> auth = process...
accountResource.uriInfo = new ResteasyUriInfo("account/login", "", ""); String header = "hmac test:testing"; when(accountService.authenticate("test", "testing")).thenReturn(Optional .empty()); Response response = accountResource.login(header); assertThat(response.get...
[FOCAL] @POST @Path("/login") public Response AccountResourceImpl.login(String authHeader) [CLASS] class AccountResourceImpl [METRICS] loc=21 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1 [CALLS-INTERNAL] NewCookie generateCookie(int maxAge, String header); Optional<Pair<String, String>> processAuthHeader(String...
/* static context [FOCAL] @POST @Path("/login") public Response AccountResourceImpl.login(String authHeader) [PATH1] if(StringUtils.isBlank(authHeader))=F -> if(!auth.isPresent())=T -> return Response.status(Response.Status.UNAUTHORIZED).build() [PATH2] if(StringUtils.isBlank(authHeader))=F -> if(!auth.isPresent())=F -...
/* static context [FOCAL] @POST @Path("/login") public Response AccountResourceImpl.login(String authHeader) [PATH1] if(StringUtils.isBlank(authHeader))=F -> if(!auth.isPresent())=T -> return Response.status(Response.Status.UNAUTHORIZED).build() [PATH2] if(StringUtils.isBlank(authHeader))=F -> if(!auth.isPresent())=F -...
true
ok
{"focal": {"class": "AccountResourceImpl", "name": "login", "signature": "Response login(String authHeader)", "start_line": 3, "modifiers": "@POST @Path(\"/login\") public", "params": [{"name": "authHeader", "type": "String"}], "return_type": "Response"}, "class_info": {"name": "AccountResourceImpl", "kind": "class", "...
76604873_18
class SharedPreferencesWrapper implements SharedPreferences { @Override @Nullable public String getString(@NonNull final String key, @Nullable final String defValue) { return preferences.getString(key, defValue); } public SharedPreferencesWrapper(@NonNull final SharedPreferences preferences); @NonNull public ...
// Arrange: final SharedPreferences mockPreferences = mock(SharedPreferences.class); final SharedPreferencesWrapper wrapper = new SharedPreferencesWrapper(mockPreferences); // Act: wrapper.getString(PREF_KEY, "Slovakia"); // Assert: verify(mockPreferences).getString(PREF_KEY, "Slovakia"); verifyNoMoreIn...
[FOCAL] @Override @Nullable public String SharedPreferencesWrapper.getString(String key, String defValue) [CLASS] class SharedPreferencesWrapper implements SharedPreferences [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] preferences.getString/2 [INPUTS] branches=- | result=defValu...
/* static context [FOCAL] @Override @Nullable public String SharedPreferencesWrapper.getString(String key, String defValue) [INPUTS] branches=- | result=defValue, key [COLLABORATORS] field preferences getString/2 [CALLS-EXTERNAL] preferences.getString/2 */
/* static context [FOCAL] @Override @Nullable public String SharedPreferencesWrapper.getString(String key, String defValue) [INPUTS] branches=- | result=defValue, key [COLLABORATORS] field preferences getString/2 [CALLS-EXTERNAL] preferences.getString/2 */ class SharedPreferencesWrapper implements SharedPreferences { ...
true
ok
{"focal": {"class": "SharedPreferencesWrapper", "name": "getString", "signature": "String getString(String key, String defValue)", "start_line": 3, "modifiers": "@Override @Nullable public", "params": [{"name": "key", "type": "String"}, {"name": "defValue", "type": "String"}], "return_type": "String"}, "class_info": {"...
76634121_13
class CompositeReadableBuffer implements ReadableBuffer { public CompositeReadableBuffer append(byte[] array) { validateAppendable(); if (array == null || array.length == 0) { throw new IllegalArgumentException("Array must not be empty or null"); } if (currentArray == ...
CompositeReadableBuffer empty = new CompositeReadableBuffer(); CompositeReadableBuffer buffer = new CompositeReadableBuffer(); try { buffer.append(empty); fail("Should not be able to append an empty composite"); } catch (IllegalArgumentException iae) {} } }
[FOCAL] public CompositeReadableBuffer CompositeReadableBuffer.append(byte[] array) [CLASS] class CompositeReadableBuffer implements ReadableBuffer [METRICS] loc=28 cc=4 branches=3 loops=0 returns=1 throws=1 nesting=2 [CALLS-INTERNAL] void maybeMoveToNextArray(); void validateAppendable() [CALLS-EXTERNAL] contents.add/...
/* static context [FOCAL] public CompositeReadableBuffer CompositeReadableBuffer.append(byte[] array) [THROWS-WHEN] IllegalArgumentException when array == null || array.length == 0 [PATH1] if(array == null || array.length == 0)=F -> if(currentArray == null)=F -> if(contents == null)=T -> return this [PATH2] if(array ==...
/* static context [FOCAL] public CompositeReadableBuffer CompositeReadableBuffer.append(byte[] array) [THROWS-WHEN] IllegalArgumentException when array == null || array.length == 0 [PATH1] if(array == null || array.length == 0)=F -> if(currentArray == null)=F -> if(contents == null)=T -> return this [PATH2] if(array ==...
true
ok
{"focal": {"class": "CompositeReadableBuffer", "name": "append", "signature": "CompositeReadableBuffer append(byte[] array)", "start_line": 3, "modifiers": "public", "params": [{"name": "array", "type": "byte[]"}], "return_type": "CompositeReadableBuffer"}, "class_info": {"name": "CompositeReadableBuffer", "kind": "cla...
76667858_0
class ServiceModel { public EntityResult<V> get(K id) throws RestDslException { return serviceDao.get(ServiceQuery.byId(id)); } public ServiceModel(PersistentServiceDao<V, K> serviceDao); protected PersistentServiceDao<V, K> getServiceDao(); public V getOne(K id); public EntityResult...
Mockito.when(mockedDao.get(Mockito.any())) .thenReturn(new EntityResult<>(Collections.emptyList(), 0L)); model.get((Long) null); Mockito.verify(mockedDao, Mockito.never()) .get(Mockito.any()); } }
[FOCAL] public EntityResult<V> ServiceModel.get(K id) [CLASS] class ServiceModel [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] serviceDao.get/1, ServiceQuery.byId/1 [EXCEPTIONS] declares RestDslException [INPUTS] branches=- | result=id [COLLABORATORS] field serviceDao get/1 [DATA...
/* static context [FOCAL] public EntityResult<V> ServiceModel.get(K id) [INPUTS] branches=- | result=id [COLLABORATORS] field serviceDao get/1 [EXCEPTIONS] declares RestDslException [CALLS-EXTERNAL] serviceDao.get/1, ServiceQuery.byId/1 */
/* static context [FOCAL] public EntityResult<V> ServiceModel.get(K id) [INPUTS] branches=- | result=id [COLLABORATORS] field serviceDao get/1 [EXCEPTIONS] declares RestDslException [CALLS-EXTERNAL] serviceDao.get/1, ServiceQuery.byId/1 */ class ServiceModel { public EntityResult<V> get(K id) throws RestDslExcepti...
true
ok
{"focal": {"class": "ServiceModel", "name": "get", "signature": "EntityResult<V> get(K id) throws RestDslException", "start_line": 3, "modifiers": "public", "params": [{"name": "id", "type": "K"}], "return_type": "EntityResult<V>"}, "class_info": {"name": "ServiceModel", "kind": "class", "modifiers": "", "superclass": ...
76684377_50
class SimpleListAdapter extends BaseListAdapter<A, VH, I> implements SimpleAdapter<I> { @Override public void registerOnDataSetSwapListener(@NonNull final OnDataSetSwapListener<List<I>> listener) { if (listeners == null) { this.listeners = new SwappableDataSetAdapterListeners<>(); } this.listeners.register...
// Arrange: final SimpleAdapterDataSet<String> mockDataSet = mock(TestDataSet.class); final SimpleListAdapter<TestAdapter, ViewHolder, String> adapter = new TestAdapter(context, mockDataSet); final OnDataSetSwapListener mockListener = mock(OnDataSetSwapListener.class); final List<String> items = Collections.e...
[FOCAL] @Override public void SimpleListAdapter.registerOnDataSetSwapListener(OnDataSetSwapListener<List<I>> listener) [CLASS] class SimpleListAdapter extends BaseListAdapter<A, VH, I> implements SimpleAdapter<I> [METRICS] loc=6 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] this.listeners.regist...
/* static context [FOCAL] @Override public void SimpleListAdapter.registerOnDataSetSwapListener(OnDataSetSwapListener<List<I>> listener) [PATH1] if(listeners == null)=T [PATH2] if(listeners == null)=F [COLLABORATORS] field listeners registerOnDataSetSwapListener/1 [STATE] listeners [FIELDS] read=listeners | write=liste...
/* static context [FOCAL] @Override public void SimpleListAdapter.registerOnDataSetSwapListener(OnDataSetSwapListener<List<I>> listener) [PATH1] if(listeners == null)=T [PATH2] if(listeners == null)=F [COLLABORATORS] field listeners registerOnDataSetSwapListener/1 [STATE] listeners [FIELDS] read=listeners | write=liste...
true
ok
{"focal": {"class": "SimpleListAdapter", "name": "registerOnDataSetSwapListener", "signature": "void registerOnDataSetSwapListener(OnDataSetSwapListener<List<I>> listener)", "start_line": 4, "modifiers": "@Override public", "params": [{"name": "listener", "type": "OnDataSetSwapListener<List<I>>"}], "return_type": "void...
76684614_12
class ItemSwipeHelper extends RecyclerViewItemHelper<ItemSwipeHelper.Interactor> { public boolean restoreHolder(@NonNull final RecyclerView.ViewHolder viewHolder, @Direction final int direction) { return restoreHolder(viewHolder, direction, null); } public ItemSwipeHelper(); private ItemSwipeHelper(final Inte...
// Arrange: final RecyclerView mockRecyclerView = mock(RecyclerView.class); final View itemView = new View(context); final TestHolder mockViewHolder = createMockHolder(mockRecyclerView, itemView, 0); when(mockViewHolder.getInteractiveView(ItemSwipeHelper.INTERACTION)).thenReturn(null); final ItemSwipeHelper...
[FOCAL] public boolean ItemSwipeHelper.restoreHolder(RecyclerView.ViewHolder viewHolder, int direction) [CLASS] class ItemSwipeHelper extends RecyclerViewItemHelper<ItemSwipeHelper.Interactor> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] boolean restoreHolder(RecyclerView.ViewHo...
/* static context [FOCAL] public boolean ItemSwipeHelper.restoreHolder(RecyclerView.ViewHolder viewHolder, int direction) [INPUTS] branches=- | result=direction, viewHolder [CALLS-INTERNAL] boolean restoreHolder(RecyclerView.ViewHolder viewHolder, int direction, Runnable animationCallback) */
/* static context [FOCAL] public boolean ItemSwipeHelper.restoreHolder(RecyclerView.ViewHolder viewHolder, int direction) [INPUTS] branches=- | result=direction, viewHolder [CALLS-INTERNAL] boolean restoreHolder(RecyclerView.ViewHolder viewHolder, int direction, Runnable animationCallback) */ class ItemSwipeHelper exte...
true
ok
{"focal": {"class": "ItemSwipeHelper", "name": "restoreHolder", "signature": "boolean restoreHolder(RecyclerView.ViewHolder viewHolder, int direction)", "start_line": 3, "modifiers": "public", "params": [{"name": "viewHolder", "type": "RecyclerView.ViewHolder"}, {"name": "direction", "type": "int"}], "return_type": "bo...
76877282_1
class MapUtil { public static <K, V extends Comparable<? super V>> Map<K, V> sortByValue(Map<K, V> map) { List<Map.Entry<K, V>> list = new ArrayList<>(map.entrySet()); List<Map.Entry<K, V>> sorted = Stream.of(list).sortBy(Map.Entry::getValue).toList(); Map<K, V> result = new LinkedHashMap...
Map<String, String> sorted = MapUtil.sortByValue(ru_map); Map.Entry<String, String> entry = sorted.entrySet().iterator().next(); String value = entry.getValue(); Assert.assertTrue(value.equals("Азеррбайджан")); } }
[FOCAL] public static Map<K, V> MapUtil.sortByValue(Map<K, V> map) [CLASS] class MapUtil [METRICS] loc=12 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] Map<K, V>.entrySet/0, Stream.of(list).sortBy(Map.Entry::getValue).toList/0, Stream.of(list).sortBy/1, Stream.of/1, Map<K, V>.put/2, Map.Entry<K,...
/* static context [FOCAL] public static Map<K, V> MapUtil.sortByValue(Map<K, V> map) [PATH1] foreach(Map.Entry<K, V> entry : sorted)=T -> exit loop -> return result [PATH2] foreach(Map.Entry<K, V> entry : sorted)=F -> return result [INPUTS] branches=map | result=- [COLLABORATORS] param map:Map<K, V> entrySet/0 [NEW] Ar...
/* static context [FOCAL] public static Map<K, V> MapUtil.sortByValue(Map<K, V> map) [PATH1] foreach(Map.Entry<K, V> entry : sorted)=T -> exit loop -> return result [PATH2] foreach(Map.Entry<K, V> entry : sorted)=F -> return result [INPUTS] branches=map | result=- [COLLABORATORS] param map:Map<K, V> entrySet/0 [NEW] Ar...
true
ok
{"focal": {"class": "MapUtil", "name": "sortByValue", "signature": "Map<K, V> sortByValue(Map<K, V> map)", "start_line": 3, "modifiers": "public static", "params": [{"name": "map", "type": "Map<K, V>"}], "return_type": "Map<K, V>"}, "class_info": {"name": "MapUtil", "kind": "class", "modifiers": "", "superclass": null,...
77005273_1
class Cluster { public void shutdown() { LOG.debug("Shutting down RpcServer and MembershipService"); rpcServer.shutdown(); membershipService.shutdown(); sharedResources.shutdown(); this.hasShutdown = true; } private Cluster(final IMessagingServer rpcServer, ...
useStaticFd = true; final int numNodes = 50; final int numFailingNodes = 12; final Endpoint seedEndpoint = Utils.hostFromParts("127.0.0.1", basePort); createCluster(numNodes, seedEndpoint); verifyCluster(numNodes); // Fail the first 3 nodes. final Set<Endp...
[FOCAL] public void Cluster.shutdown() [CLASS] class Cluster [METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] LOG.debug/1, rpcServer.shutdown/0, membershipService.shutdown/0, sharedResources.shutdown/0 [FIELDS] write=hasShutdown [COLLABORATORS] field rpcServer shutdown/0; field memb...
/* static context [FOCAL] public void Cluster.shutdown() [COLLABORATORS] field rpcServer shutdown/0; field membershipService shutdown/0; field sharedResources shutdown/0 [STATE] hasShutdown [FIELDS] write=hasShutdown [CALLS-EXTERNAL] LOG.debug/1, rpcServer.shutdown/0, membershipService.shutdown/0, sharedResources.shutd...
/* static context [FOCAL] public void Cluster.shutdown() [COLLABORATORS] field rpcServer shutdown/0; field membershipService shutdown/0; field sharedResources shutdown/0 [STATE] hasShutdown [FIELDS] write=hasShutdown [CALLS-EXTERNAL] LOG.debug/1, rpcServer.shutdown/0, membershipService.shutdown/0, sharedResources.shutd...
true
ok
{"focal": {"class": "Cluster", "name": "shutdown", "signature": "void shutdown()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "Cluster", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "GRPC_LOGGER", "type": "Logger"...
77008449_0
class ReplicationQueueHealthCheck implements HealthCheck { @Override public Result execute() { FormattingResultLog resultLog = new FormattingResultLog(); if(agentManager.getAgents().isEmpty()) { resultLog.info("No agents configured"); } for (Map.Entry<String, Agent...
when(agent1.isValid()).thenReturn(false); when(agent2.isValid()).thenReturn(false); Result result = healthCheck.execute(); assertEquals("Status should be OK", Result.Status.OK, result.getStatus()); assertEquals("Result should be ok", true, result.isOk()); } }
[FOCAL] @Override public Result ReplicationQueueHealthCheck.execute() [CLASS] class ReplicationQueueHealthCheck implements HealthCheck [METRICS] loc=28 cc=6 branches=4 loops=1 returns=1 throws=0 nesting=4 [CALLS-EXTERNAL] agentManager.getAgents().isEmpty/0, AgentManager.getAgents/0, FormattingResultLog.info/1, agentMan...
/* static context [FOCAL] @Override public Result ReplicationQueueHealthCheck.execute() [PATH1] if(agentManager.getAgents().isEmpty())=T -> foreach(Map.Entry<String, Agent> entry : agentManager.getAgents().entrySet())=T -> if(agent.isValid() && agent.isEnabled())=T -> if(!replicationQueue.entries().isEmpty())=T -> if(f...
/* static context [FOCAL] @Override public Result ReplicationQueueHealthCheck.execute() [PATH1] if(agentManager.getAgents().isEmpty())=T -> foreach(Map.Entry<String, Agent> entry : agentManager.getAgents().entrySet())=T -> if(agent.isValid() && agent.isEnabled())=T -> if(!replicationQueue.entries().isEmpty())=T -> if(f...
true
ok
{"focal": {"class": "ReplicationQueueHealthCheck", "name": "execute", "signature": "Result execute()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Result"}, "class_info": {"name": "ReplicationQueueHealthCheck", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Heal...
77030088_45
class Asn1BerParser { public static <T> T parse(ByteBuffer encoded, Class<T> containerClass) throws Asn1DecodingException { BerDataValue containerDataValue; try { containerDataValue = new ByteBufferBerDataValueReader(encoded).readDataValue(); } catch (BerDataValueFor...
assertEquals(2, parse("3006300430003000", SequenceWithSequenceOf.class).values.size()); } }
[FOCAL] public static T Asn1BerParser.parse(ByteBuffer encoded, Class<T> containerClass) [CLASS] class Asn1BerParser [METRICS] loc=13 cc=3 branches=1 loops=0 returns=1 throws=2 nesting=1 [CALLS-INTERNAL] T parse(BerDataValue container, Class<T> containerClass) [CALLS-EXTERNAL] new ByteBufferBerDataValueReader(encoded)....
/* static context [FOCAL] public static T Asn1BerParser.parse(ByteBuffer encoded, Class<T> containerClass) [THROWS-WHEN] Asn1DecodingException when try-body throws [THROWS-WHEN] Asn1DecodingException when containerDataValue == null [PATH1] try-body throws -> throw new Asn1DecodingException("Failed to decode top-level d...
/* static context [FOCAL] public static T Asn1BerParser.parse(ByteBuffer encoded, Class<T> containerClass) [THROWS-WHEN] Asn1DecodingException when try-body throws [THROWS-WHEN] Asn1DecodingException when containerDataValue == null [PATH1] try-body throws -> throw new Asn1DecodingException("Failed to decode top-level d...
true
ok
{"focal": {"class": "Asn1BerParser", "name": "parse", "signature": "T parse(ByteBuffer encoded, Class<T> containerClass) throws Asn1DecodingException", "start_line": 3, "modifiers": "public static", "params": [{"name": "encoded", "type": "ByteBuffer"}, {"name": "containerClass", "type": "Class<T>"}], "return_type": "T"...
77066767_41
class TimedSummaryNotifier implements Runnable { protected String createMessage(int nrAnalyzedBuilds, int nrRepairAttempts, int nrOfBuildsWithPatches, int[] nrOfPatchesPerTool, Date now) { String message = "Summary email from Repairnator. \n\n"; message += "This summary contains the operations of ...
int[] patchesPerTool = {1, 5, 10, 15, 20}; Date now = new Date(); String message = notifier.createMessage(100, 15, 51, patchesPerTool, now); String testMessage = "Summary email from Repairnator. \n\n" + "This summary contains the operations of Repairnator between " ...
[FOCAL] protected String TimedSummaryNotifier.createMessage(int nrAnalyzedBuilds, int nrRepairAttempts, int nrOfBuildsWithPatches, int[] nrOfPatchesPerTool, Date now) [CLASS] class TimedSummaryNotifier implements Runnable [METRICS] loc=24 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] this.lastNo...
/* static context [FOCAL] protected String TimedSummaryNotifier.createMessage(int nrAnalyzedBuilds, int nrRepairAttempts, int nrOfBuildsWithPatches, int[] nrOfPatchesPerTool, Date now) [PATH1] for(i < repairTools.length)=T -> exit loop -> return message [PATH2] for(i < repairTools.length)=F -> return message [INPUTS] b...
/* static context [FOCAL] protected String TimedSummaryNotifier.createMessage(int nrAnalyzedBuilds, int nrRepairAttempts, int nrOfBuildsWithPatches, int[] nrOfPatchesPerTool, Date now) [PATH1] for(i < repairTools.length)=T -> exit loop -> return message [PATH2] for(i < repairTools.length)=F -> return message [INPUTS] b...
true
ok
{"focal": {"class": "TimedSummaryNotifier", "name": "createMessage", "signature": "String createMessage(int nrAnalyzedBuilds, int nrRepairAttempts, int nrOfBuildsWithPatches, int[] nrOfPatchesPerTool, Date now)", "start_line": 3, "modifiers": "protected", "params": [{"name": "nrAnalyzedBuilds", "type": "int"}, {"name":...
77143465_33
class JacksonStyle extends AnnotatorStyle { @Override public void processSubTypeRule(TypeSpec.Builder typeSpec, TypeModel typeModel) { SubTypeModel subTypeModel = typeModel.getSubTypes(); AnnotationSpec.Builder typeInfoAnnotation = AnnotationSpec.builder(JsonTypeInfo.class) .ad...
TypeSpec.Builder builder = TypeSpec.classBuilder("Test"); TypeModel model = mock(TypeModel.class); Map<String, String> subTypes = new HashMap<>(); subTypes.put("A", "com.flipkart.lyrics.A"); subTypes.put("B", "com.flipkart.lyrics.B"); SubTypeModel subTypeModel = mock(Sub...
[FOCAL] @Override public void JacksonStyle.processSubTypeRule(TypeSpec.Builder typeSpec, TypeModel typeModel) [CLASS] class JacksonStyle extends AnnotatorStyle [METRICS] loc=25 cc=3 branches=1 loops=1 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] TypeModel.getSubTypes/0, AnnotationSpec.builder(JsonTypeInfo.class) .addM...
/* static context [FOCAL] @Override public void JacksonStyle.processSubTypeRule(TypeSpec.Builder typeSpec, TypeModel typeModel) [PATH1] if(subTypeModel.isVisible())=T -> foreach(Map.Entry<String, String> subType : subTypeModel.getSubTypeMapping().entrySet())=T -> exit loop [PATH2] if(subTypeModel.isVisible())=F -> fore...
/* static context [FOCAL] @Override public void JacksonStyle.processSubTypeRule(TypeSpec.Builder typeSpec, TypeModel typeModel) [PATH1] if(subTypeModel.isVisible())=T -> foreach(Map.Entry<String, String> subType : subTypeModel.getSubTypeMapping().entrySet())=T -> exit loop [PATH2] if(subTypeModel.isVisible())=F -> fore...
true
ok
{"focal": {"class": "JacksonStyle", "name": "processSubTypeRule", "signature": "void processSubTypeRule(TypeSpec.Builder typeSpec, TypeModel typeModel)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "typeSpec", "type": "TypeSpec.Builder"}, {"name": "typeModel", "type": "TypeModel"}], "return_ty...
77145569_121
class IntermediateNavigationProperty extends IntermediateModelElement implements IntermediateNavigationPropertyAccess, JPAAssociationAttribute { @Override public List<String> getProtectionPath(final String claimName) throws ODataJPAModelException { return new ArrayList<>(0); } IntermediateNavigation...
final IntermediateNavigationProperty property = new IntermediateNavigationProperty(new JPADefaultEdmNameBuilder( PUNIT_NAME), schema.getEntityType(JoinSource.class), createDummyAttribute(), schema); assertTrue(property.getProtectionPath("Bla").isEmpty()); } }
[FOCAL] @Override public List<String> IntermediateNavigationProperty.getProtectionPath(String claimName) [CLASS] class IntermediateNavigationProperty extends IntermediateModelElement implements IntermediateNavigationPropertyAccess, JPAAssociationAttribute [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesti...
/* static context [FOCAL] @Override public List<String> IntermediateNavigationProperty.getProtectionPath(String claimName) [INPUTS] branches=- | result=- | unused=claimName [EXCEPTIONS] declares ODataJPAModelException [NEW] ArrayList<> */
/* static context [FOCAL] @Override public List<String> IntermediateNavigationProperty.getProtectionPath(String claimName) [INPUTS] branches=- | result=- | unused=claimName [EXCEPTIONS] declares ODataJPAModelException [NEW] ArrayList<> */ class IntermediateNavigationProperty extends IntermediateModelElement implements ...
true
ok
{"focal": {"class": "IntermediateNavigationProperty", "name": "getProtectionPath", "signature": "List<String> getProtectionPath(String claimName) throws ODataJPAModelException", "start_line": 4, "modifiers": "@Override public", "params": [{"name": "claimName", "type": "String"}], "return_type": "List<String>"}, "class_...
77168103_6
class LifecycleScopes { public static <E> CompletableSource resolveScopeFromLifecycle( final LifecycleScopeProvider<E> provider) throws OutsideScopeException { return resolveScopeFromLifecycle(provider, true); } private LifecycleScopes(); public static CompletableSource resolveScopeFromLifecycle( ...
TestLifecycleScopeProvider lifecycle = TestLifecycleScopeProvider.createInitial(STOPPED); final RuntimeException expected = new RuntimeException("Expected"); AutoDisposePlugins.setOutsideScopeHandler( e -> { // Throw it back throw expected; }); testSource(resolveSco...
[FOCAL] public static CompletableSource LifecycleScopes.resolveScopeFromLifecycle(LifecycleScopeProvider<E> provider) [CLASS] class LifecycleScopes [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] CompletableSource resolveScopeFromLifecycle(LifecycleScopeProvider<E> provider, boolea...
/* static context [FOCAL] public static CompletableSource LifecycleScopes.resolveScopeFromLifecycle(LifecycleScopeProvider<E> provider) [INPUTS] branches=- | result=provider [EXCEPTIONS] declares OutsideScopeException [CALLS-INTERNAL] CompletableSource resolveScopeFromLifecycle(LifecycleScopeProvider<E> provider, boole...
/* static context [FOCAL] public static CompletableSource LifecycleScopes.resolveScopeFromLifecycle(LifecycleScopeProvider<E> provider) [INPUTS] branches=- | result=provider [EXCEPTIONS] declares OutsideScopeException [CALLS-INTERNAL] CompletableSource resolveScopeFromLifecycle(LifecycleScopeProvider<E> provider, boole...
true
ok
{"focal": {"class": "LifecycleScopes", "name": "resolveScopeFromLifecycle", "signature": "CompletableSource resolveScopeFromLifecycle(LifecycleScopeProvider<E> provider) throws OutsideScopeException", "start_line": 3, "modifiers": "public static", "params": [{"name": "provider", "type": "LifecycleScopeProvider<E>"}], "...
77321473_0
class Automator extends Item implements Serializable { void update(double delta) { if (!enabled || itemLevel == 0) return; tickTimer += delta; while (tickTimer >= actualTickRate) { tickTimer -= actualTickRate; generator.process(); } } private Autom...
World world = new World(); System.out.println("update()"); Currency c = new Currency.Builder(world) .build(); Generator g = new Generator.Builder(world) .generate(c) .build(); g.upgrade(); Automator a = new Automator.Build...
[FOCAL] void Automator.update(double delta) [CLASS] class Automator extends Item implements Serializable [METRICS] loc=9 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] generator.process/0 [PATH1] if(!enabled || itemLevel == 0)=F -> while(tickTimer >= actualTickRate)=T -> exit loop [PATH2] if(!ena...
/* static context [FOCAL] void Automator.update(double delta) [PATH1] if(!enabled || itemLevel == 0)=F -> while(tickTimer >= actualTickRate)=T -> exit loop [PATH2] if(!enabled || itemLevel == 0)=T -> return [PATH3] if(!enabled || itemLevel == 0)=F -> while(tickTimer >= actualTickRate)=F [INPUTS] branches=delta | result...
/* static context [FOCAL] void Automator.update(double delta) [PATH1] if(!enabled || itemLevel == 0)=F -> while(tickTimer >= actualTickRate)=T -> exit loop [PATH2] if(!enabled || itemLevel == 0)=T -> return [PATH3] if(!enabled || itemLevel == 0)=F -> while(tickTimer >= actualTickRate)=F [INPUTS] branches=delta | result...
true
ok
{"focal": {"class": "Automator", "name": "update", "signature": "void update(double delta)", "start_line": 3, "modifiers": "", "params": [{"name": "delta", "type": "double"}], "return_type": "void"}, "class_info": {"name": "Automator", "kind": "class", "modifiers": "", "superclass": "Item", "interfaces": "Serializable"...
77385607_83
class GraphApp { public void deleteElements() { try { if (g == null) { return; } LOGGER.info("deleting elements"); // note that this will succeed whether or not pluto exists g.V().has("name", "pluto").drop().iterate(); ...
app.createElements(); app.deleteElements(); assertFalse(g.V().has("name", "pluto").hasNext()); assertFalse(g.V().has("name", "jupiter").both("brother").has("name", "pluto").hasNext()); } }
[FOCAL] public void GraphApp.deleteElements() [CLASS] class GraphApp [METRICS] loc=18 cc=5 branches=3 loops=0 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] LOGGER.info/1, g.V().has("name", "pluto").drop().iterate/0, g.V().has("name", "pluto").drop/0, g.V().has/2, GraphTraversalSource.V/0, g.tx().commit/0, GraphTraversa...
/* static context [FOCAL] public void GraphApp.deleteElements() [PATH1] try-body throws -> if(supportsTransactions)#2=T [PATH2] if(g == null)=T -> return [PATH3] if(g == null)=F -> if(supportsTransactions)#1=T [PATH4] try-body throws -> if(supportsTransactions)#2=F [PATH5] if(g == null)=F -> if(supportsTransactions)#1=...
/* static context [FOCAL] public void GraphApp.deleteElements() [PATH1] try-body throws -> if(supportsTransactions)#2=T [PATH2] if(g == null)=T -> return [PATH3] if(g == null)=F -> if(supportsTransactions)#1=T [PATH4] try-body throws -> if(supportsTransactions)#2=F [PATH5] if(g == null)=F -> if(supportsTransactions)#1=...
true
ok
{"focal": {"class": "GraphApp", "name": "deleteElements", "signature": "void deleteElements()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "GraphApp", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "CONF_FILE", "typ...
77403831_1
class Pcf8574 implements AutoCloseable { public int readByte() { if (device == null) return 0; byte[] buffer = new byte[]{0}; try { device.read(buffer, 1); } catch (IOException e) { // ignore } return buffer[0]; } @VisibleForTesting Pcf8574(I2cDevice device); public sta...
pcf8574.readByte(); Mockito.verify(device).read(Matchers.any(byte[].class), Matchers.eq(1)); } }
[FOCAL] public int Pcf8574.readByte() [CLASS] class Pcf8574 implements AutoCloseable [METRICS] loc=12 cc=3 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] I2cDevice.read/2 [FIELDS] read=device:I2cDevice [EXCEPTIONS] catches IOException e [PATH1] if(device == null)=F -> try-body throws -> return buffer[...
/* static context [FOCAL] public int Pcf8574.readByte() [PATH1] if(device == null)=F -> try-body throws -> return buffer[0] [PATH2] if(device == null)=T -> return 0 [INPUTS] branches=device | result=- [COLLABORATORS] field device:I2cDevice read/2 [EXCEPTIONS] catches IOException e [FIELDS] read=device:I2cDevice [CALLS-...
/* static context [FOCAL] public int Pcf8574.readByte() [PATH1] if(device == null)=F -> try-body throws -> return buffer[0] [PATH2] if(device == null)=T -> return 0 [INPUTS] branches=device | result=- [COLLABORATORS] field device:I2cDevice read/2 [EXCEPTIONS] catches IOException e [FIELDS] read=device:I2cDevice [CALLS-...
true
ok
{"focal": {"class": "Pcf8574", "name": "readByte", "signature": "int readByte()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "Pcf8574", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "AutoCloseable", "fields": [{"name": "device", "type": "I2c...
77405221_59
class IsJsonNull extends AbstractJsonNodeMatcher<NullNode> { public static Matcher<JsonNode> jsonNull() { return INSTANCE; } private IsJsonNull(); @SuppressWarnings("unused") public static Matcher<JsonNode> jsonNull(final NullNode value); @Override protected boolean matchesNode(NullNode node, Descript...
final Matcher<JsonNode> sut = jsonNull(); final StringDescription description = new StringDescription(); sut.describeMismatch(NF.textNode("goat"), description); assertThat(description.toString(), is( "was not a null node, but a string node" )); } }
[FOCAL] public static Matcher<JsonNode> IsJsonNull.jsonNull() [CLASS] class IsJsonNull extends AbstractJsonNodeMatcher<NullNode> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] IsJsonNull(); Matcher<JsonNode> jsonNull(NullNode value); boolean matchesNode(NullNode node, Description m...
/* static context [FOCAL] public static Matcher<JsonNode> IsJsonNull.jsonNull() */
/* static context [FOCAL] public static Matcher<JsonNode> IsJsonNull.jsonNull() */ class IsJsonNull extends AbstractJsonNodeMatcher<NullNode> { public static Matcher<JsonNode> jsonNull() { return INSTANCE; } private IsJsonNull(); @SuppressWarnings("unused") public static Matcher<JsonNode> jsonNull(final...
true
ok
{"focal": {"class": "IsJsonNull", "name": "jsonNull", "signature": "Matcher<JsonNode> jsonNull()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Matcher<JsonNode>"}, "class_info": {"name": "IsJsonNull", "kind": "class", "modifiers": "", "superclass": "AbstractJsonNodeMatcher<NullNode>", "...
77435673_0
class AbstractStatisticsTSDBLoader { public void load() throws IOException { if (cleanDatabaseOnLoad) { doCreateEmptyDatabase(); } statValueCache.clear(); statValueEmpty.clear(); final StatArchiveReader reader = new StatArchiveReader(new File[] { archiveFileName }, statFilters, false); for (Obj...
TestMeasurementLoader testLoader = new TestMeasurementLoader(false, new File("src/test/resources/myStatisticsArchiveFile.gfs"), "SERVER666"); testLoader.load(); assertEquals("SERVER666", testLoader.geodeMemberName); assertEquals("src/test/resources/myStatisticsArchiveFile.gfs", testLoader.archiveFileName...
[FOCAL] public void AbstractStatisticsTSDBLoader.load() [CLASS] class AbstractStatisticsTSDBLoader [METRICS] loc=42 cc=5 branches=2 loops=2 returns=0 throws=0 nesting=2 [CALLS-INTERNAL] void doCompleteMeasurementLoad(); void doCreateEmptyDatabase(); void doLoadMeasurement(String measurementName, String measurementType,...
/* static context [FOCAL] public void AbstractStatisticsTSDBLoader.load() [PATH1] if(cleanDatabaseOnLoad)=T -> foreach(Object r : reader.getResourceInstList())=T -> if(statFilters != null && statFilters.length > 0 && !statFilters[0].typeMatches(ri.getType().getName()))=F -> for(measurementIndex < ri.getSampleCount())=F...
/* static context [FOCAL] public void AbstractStatisticsTSDBLoader.load() [PATH1] if(cleanDatabaseOnLoad)=T -> foreach(Object r : reader.getResourceInstList())=T -> if(statFilters != null && statFilters.length > 0 && !statFilters[0].typeMatches(ri.getType().getName()))=F -> for(measurementIndex < ri.getSampleCount())=F...
true
ok
{"focal": {"class": "AbstractStatisticsTSDBLoader", "name": "load", "signature": "void load() throws IOException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "AbstractStatisticsTSDBLoader", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null...
77481567_34
class StrategyExpertAdvisor implements ExpertAdvisor<C>, OrderEventListener { @Override public void newData(final C candleStick) { strategy.update(candleStick); switch (currentState) { case TRY_CREATE: currentOrder = creator.checkMarketEntry(this); if...
cut.newData(EXEMPLARY_CANDLE_STICK); verify(calculator).update(EXEMPLARY_CANDLE_STICK); } }
[FOCAL] @Override public void StrategyExpertAdvisor.newData(C candleStick) [CLASS] class StrategyExpertAdvisor implements ExpertAdvisor<C>, OrderEventListener [METRICS] loc=26 cc=7 branches=4 loops=0 returns=0 throws=1 nesting=2 [CALLS-EXTERNAL] strategy.update/1, PendingOrderCreator.checkMarketEntry/1, currentOrder.is...
/* static context [FOCAL] @Override public void StrategyExpertAdvisor.newData(C candleStick) [THROWS-WHEN] IllegalStateException when switch(currentState)=default [PATH1] switch(currentState)=case TRY_CREATE -> if(currentOrder.isPresent())=T [PATH2] switch(currentState)=case MANAGE_ORDER -> if(!currentOrder.isPresent()...
/* static context [FOCAL] @Override public void StrategyExpertAdvisor.newData(C candleStick) [THROWS-WHEN] IllegalStateException when switch(currentState)=default [PATH1] switch(currentState)=case TRY_CREATE -> if(currentOrder.isPresent())=T [PATH2] switch(currentState)=case MANAGE_ORDER -> if(!currentOrder.isPresent()...
true
ok
{"focal": {"class": "StrategyExpertAdvisor", "name": "newData", "signature": "void newData(C candleStick)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "candleStick", "type": "C"}], "return_type": "void"}, "class_info": {"name": "StrategyExpertAdvisor", "kind": "class", "modifiers": "", "super...
77492072_172
class MementoResource { public Link filterLinkParams(final Link link) { return filterLinkParams(link, !includeMementoDates); } public MementoResource(final ServiceBundler trellis, final boolean includeMementoDates); public ResponseBuilder getTimeMapBuilder(final SortedSet<Instant> mementos, ...
final MementoResource mr = new MementoResource(null, false); final Link link = fromUri("http://example.com/resource/memento/1").rel(MEMENTO) .param(DATETIME, ofInstant(now(), UTC).format(RFC_1123_DATE_TIME)).build(); assertFalse(mr.filterLinkParams(link).getParams().containsKey(DATET...
[FOCAL] public Link MementoResource.filterLinkParams(Link link) [CLASS] class MementoResource [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Link filterLinkParams(Link link, boolean filter) [INPUTS] branches=- | result=link [DATAFLOW] link@param->L2 [CLASS-MEMBERS] MementoResource...
/* static context [FOCAL] public Link MementoResource.filterLinkParams(Link link) [INPUTS] branches=- | result=link [CALLS-INTERNAL] Link filterLinkParams(Link link, boolean filter) */
/* static context [FOCAL] public Link MementoResource.filterLinkParams(Link link) [INPUTS] branches=- | result=link [CALLS-INTERNAL] Link filterLinkParams(Link link, boolean filter) */ class MementoResource { public Link filterLinkParams(final Link link) { return filterLinkParams(link, !includeMementoDates...
true
ok
{"focal": {"class": "MementoResource", "name": "filterLinkParams", "signature": "Link filterLinkParams(Link link)", "start_line": 3, "modifiers": "public", "params": [{"name": "link", "type": "Link"}], "return_type": "Link"}, "class_info": {"name": "MementoResource", "kind": "class", "modifiers": "", "superclass": null...
77541577_2
class LogzioSender { public void send(JsonObject jsonMessage) { // Return the json, while separating lines with \n logsQueue.enqueue(jsonMessage.toString().getBytes(StandardCharsets.UTF_8)); } private LogzioSender(HttpsRequestConfiguration httpsRequestConfiguration, int drainTimeout, bool...
String token = "aBcDeFgHiJkLmNoPqRsT"; String type = random(8); String loggerName = "simpleByteArrayAppending"; int drainTimeout = 2; String message1 = "Testing.." + random(5); String message2 = "Warning test.." + random(5); LogzioSender.Builder testSenderBuilde...
[FOCAL] public void LogzioSender.send(JsonObject jsonMessage) [CLASS] class LogzioSender [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] logsQueue.enqueue/1, jsonMessage.toString().getBytes/1, JsonObject.toString/0 [COLLABORATORS] field logsQueue enqueue/1; param jsonMessage:JsonOb...
/* static context [FOCAL] public void LogzioSender.send(JsonObject jsonMessage) [COLLABORATORS] field logsQueue enqueue/1; param jsonMessage:JsonObject toString/0 [CALLS-EXTERNAL] logsQueue.enqueue/1, jsonMessage.toString().getBytes/1, JsonObject.toString/0 */
/* static context [FOCAL] public void LogzioSender.send(JsonObject jsonMessage) [COLLABORATORS] field logsQueue enqueue/1; param jsonMessage:JsonObject toString/0 [CALLS-EXTERNAL] logsQueue.enqueue/1, jsonMessage.toString().getBytes/1, JsonObject.toString/0 */ class LogzioSender { public void send(JsonObject jsonM...
true
ok
{"focal": {"class": "LogzioSender", "name": "send", "signature": "void send(JsonObject jsonMessage)", "start_line": 3, "modifiers": "public", "params": [{"name": "jsonMessage", "type": "JsonObject"}], "return_type": "void"}, "class_info": {"name": "LogzioSender", "kind": "class", "modifiers": "", "superclass": null, "i...
77671214_1
class Example { public Example() { this(100); } public Example(); public Example(int maximum); public static void main(String[] args); public Set<Integer> getPrimes(Region<Integer, String> region, Execution execution); } class ExampleTest { @Test public void testExample() throws Exception {
Example example = new Example(10); Region<Integer, String> region = mock(Region.class); List<Integer> primes = Arrays.asList(1, 2, 3, 5, 7); ResultCollector resultCollector = mock(ResultCollector.class); when(resultCollector.getResult()).thenReturn(primes); Execution execution = mock(Execution....
[FOCAL] public Example.Example() [CLASS] class Example [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CLASS-MEMBERS] Example(); Example(int maximum); void main(String[] args); Set<Integer> getPrimes(Region<Integer, String> region, Execution execution) [TEST] ExampleTest: @Test public void testExa...
/* static context [FOCAL] public Example.Example() */
/* static context [FOCAL] public Example.Example() */ class Example { public Example() { this(100); } public Example(); public Example(int maximum); public static void main(String[] args); public Set<Integer> getPrimes(Region<Integer, String> region, Execution execution); } class ExampleTest { ...
true
ok
{"focal": {"class": "Example", "name": "Example", "signature": "Example()", "start_line": 3, "modifiers": "public", "params": [], "return_type": null}, "class_info": {"name": "Example", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Example", "kind": "const...
77675033_0
class AbstractGrpcServerFactory implements GrpcServerFactory { protected void configureServices(final T builder) { final Set<String> serviceNames = new LinkedHashSet<>(); // support health check if (this.properties.isHealthServiceEnabled()) { builder.addService(this.healthStatu...
final GrpcServerProperties properties = new GrpcServerProperties(); properties.setReflectionServiceEnabled(false); final NettyGrpcServerFactory serverFactory = new NettyGrpcServerFactory(properties, emptyList()); serverFactory.healthStatusManager = new HealthStatusManager(); se...
[FOCAL] protected void AbstractGrpcServerFactory.configureServices(T builder) [CLASS] class AbstractGrpcServerFactory implements GrpcServerFactory [METRICS] loc=25 cc=5 branches=3 loops=1 returns=0 throws=1 nesting=2 [CALLS-EXTERNAL] this.properties.isHealthServiceEnabled/0, T.addService/1, this.healthStatusManager.get...
/* static context [FOCAL] protected void AbstractGrpcServerFactory.configureServices(T builder) [THROWS-WHEN] IllegalStateException when this.properties.isHealthServiceEnabled() && this.properties.isReflectionServiceEnabled() && foreach(GrpcServiceDefinition service : this.serviceList)=T && !serviceNames.add(serviceNam...
/* static context [FOCAL] protected void AbstractGrpcServerFactory.configureServices(T builder) [THROWS-WHEN] IllegalStateException when this.properties.isHealthServiceEnabled() && this.properties.isReflectionServiceEnabled() && foreach(GrpcServiceDefinition service : this.serviceList)=T && !serviceNames.add(serviceNam...
true
ok
{"focal": {"class": "AbstractGrpcServerFactory", "name": "configureServices", "signature": "void configureServices(T builder)", "start_line": 3, "modifiers": "protected", "params": [{"name": "builder", "type": "T"}], "return_type": "void"}, "class_info": {"name": "AbstractGrpcServerFactory", "kind": "class", "modifiers...
77759012_13
class Slugs { public static String toSlug(String text) { if (null == text) { return null; } Matcher m = pattern.matcher(text); String result = m.replaceAll("-"); if (result.endsWith("-")) { // Remove the last char if it's a dash result = r...
String in = "2016-01-01 My Post?"; String result = Slugs.toSlug(in); String expected = "2016-01-01-my-post"; assertEquals(expected, result); } }
[FOCAL] public static String Slugs.toSlug(String text) [CLASS] class Slugs [METRICS] loc=12 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] pattern.matcher/1, Matcher.replaceAll/1, String.endsWith/1, String.substring/2, String.length/0, String.toLowerCase/0 [PATH1] if(null == text)=F -> if(result....
/* static context [FOCAL] public static String Slugs.toSlug(String text) [PATH1] if(null == text)=F -> if(result.endsWith("-"))=T -> return result.toLowerCase() [PATH2] if(null == text)=T -> return null [PATH3] if(null == text)=F -> if(result.endsWith("-"))=F -> return result.toLowerCase() [INPUTS] branches=text | resu...
/* static context [FOCAL] public static String Slugs.toSlug(String text) [PATH1] if(null == text)=F -> if(result.endsWith("-"))=T -> return result.toLowerCase() [PATH2] if(null == text)=T -> return null [PATH3] if(null == text)=F -> if(result.endsWith("-"))=F -> return result.toLowerCase() [INPUTS] branches=text | resu...
true
ok
{"focal": {"class": "Slugs", "name": "toSlug", "signature": "String toSlug(String text)", "start_line": 3, "modifiers": "public static", "params": [{"name": "text", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Slugs", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fi...
77796833_7
class Arguments { public boolean matches(Object... arguments) { int length = argumentMatchers.size(); if (length != arguments.length) return false; else for (int i = 0; i < length; i++) { ArgumentMatcher matcher = argumentMatchers.get(i); ...
List<ArgumentMatcher<?>> arguments = Arrays.asList( new EqualsMatcher<>(intValue), new EqualsMatcher<>(stringValue), new EqualsMatcher<>(nullValue) ); assertTrue(new Arguments(arguments).matches(1, stringValue, nullValue)); } }
[FOCAL] public boolean Arguments.matches(Object... arguments) [CLASS] class Arguments [METRICS] loc=13 cc=4 branches=2 loops=1 returns=3 throws=0 nesting=3 [CALLS-EXTERNAL] argumentMatchers.size/0, argumentMatchers.get/1, ArgumentMatcher.matches/1 [PATH1] if(length != arguments.length)=F -> for(i < length)=T -> if(!mat...
/* static context [FOCAL] public boolean Arguments.matches(Object... arguments) [PATH1] if(length != arguments.length)=F -> for(i < length)=T -> if(!matches)=F -> exit loop -> return true [PATH2] if(length != arguments.length)=T -> return false [PATH3] if(length != arguments.length)=F -> for(i < length)=F -> return tru...
/* static context [FOCAL] public boolean Arguments.matches(Object... arguments) [PATH1] if(length != arguments.length)=F -> for(i < length)=T -> if(!matches)=F -> exit loop -> return true [PATH2] if(length != arguments.length)=T -> return false [PATH3] if(length != arguments.length)=F -> for(i < length)=F -> return tru...
true
ok
{"focal": {"class": "Arguments", "name": "matches", "signature": "boolean matches(Object... arguments)", "start_line": 3, "modifiers": "public", "params": [{"name": "arguments", "type": "Object..."}], "return_type": "boolean"}, "class_info": {"name": "Arguments", "kind": "class", "modifiers": "", "superclass": null, "i...
77809403_6
class TraceQueue { public List<Span> consume() throws InterruptedException { List<Span> rc; synchronized (this) { // wait for an available span while (spans == null) { wait(); } rc = spans; spans = null; } return rc; } public void supply(Span span); priva...
long start = System.currentTimeMillis(); new Thread() { @Override @SneakyThrows public void run() { sleep(500); addTraces(2); } }.start(); queue.consume(); long total = System.currentTimeMillis() - start; Assert.assertTrue(total>=500); } }
[FOCAL] public List<Span> TraceQueue.consume() [CLASS] class TraceQueue [METRICS] loc=12 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] wait/0 (inherited) [EXCEPTIONS] declares InterruptedException [PATH1] while(spans == null)=T -> exit loop -> return rc [PATH2] while(spans == null)=F -> return r...
/* static context [FOCAL] public List<Span> TraceQueue.consume() [PATH1] while(spans == null)=T -> exit loop -> return rc [PATH2] while(spans == null)=F -> return rc [EXCEPTIONS] declares InterruptedException [CALLS-EXTERNAL] wait/0 (inherited) */
/* static context [FOCAL] public List<Span> TraceQueue.consume() [PATH1] while(spans == null)=T -> exit loop -> return rc [PATH2] while(spans == null)=F -> return rc [EXCEPTIONS] declares InterruptedException [CALLS-EXTERNAL] wait/0 (inherited) */ class TraceQueue { public List<Span> consume() throws InterruptedExce...
true
ok
{"focal": {"class": "TraceQueue", "name": "consume", "signature": "List<Span> consume() throws InterruptedException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<Span>"}, "class_info": {"name": "TraceQueue", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields...
77825195_26
class AdyenCheckCaptureAction extends AbstractWaitableAction<OrderProcessModel> { @Override public String execute(final OrderProcessModel process) { LOG.debug("Process: " + process.getCode() + " in step " + getClass().getSimpleName()); final OrderModel order = process.getOrder(); if (...
PaymentTransactionModel adyenTransaction = createAdyenTransaction(); List<PaymentTransactionEntryModel> transactionEntries = new ArrayList<>(); transactionEntries.add(createAuthorizedEntry()); transactionEntries.add(createCaptureReceivedEntry()); transactionEntries.add(createCap...
[FOCAL] @Override public String AdyenCheckCaptureAction.execute(OrderProcessModel process) [CLASS] class AdyenCheckCaptureAction extends AbstractWaitableAction<OrderProcessModel> [METRICS] loc=68 cc=6 branches=4 loops=1 returns=4 throws=0 nesting=2 [CALLS-EXTERNAL] LOG.debug/1, OrderProcessModel.getCode/0, getClass().g...
/* static context [FOCAL] @Override public String AdyenCheckCaptureAction.execute(OrderProcessModel process) [PATH1] if(order.getPaymentInfo().getAdyenPaymentMethod() == null)=F -> foreach(PaymentTransactionModel paymentTransactionModel : order.getPaymentTransactions())=T -> if(isErroneous || isRejected)=F -> if(transa...
/* static context [FOCAL] @Override public String AdyenCheckCaptureAction.execute(OrderProcessModel process) [PATH1] if(order.getPaymentInfo().getAdyenPaymentMethod() == null)=F -> foreach(PaymentTransactionModel paymentTransactionModel : order.getPaymentTransactions())=T -> if(isErroneous || isRejected)=F -> if(transa...
true
ok
{"focal": {"class": "AdyenCheckCaptureAction", "name": "execute", "signature": "String execute(OrderProcessModel process)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "process", "type": "OrderProcessModel"}], "return_type": "String"}, "class_info": {"name": "AdyenCheckCaptureAction", "kind": ...
77831813_6
class MigrationsFilter implements Iterable<MigrationFile> { @Override public Iterator<MigrationFile> iterator() { return origin.iterator(); } MigrationsFilter( @NonNull final Iterable<? extends MigrationFile> origin, final int versionStart, final int versionEnd );...
final Iterator<MigrationFile> iter = new MigrationsFilter( Arrays.asList( new MigrationFileFake(2), new MigrationFileFake(3), new MigrationFileFake(4), new MigrationFileFake(5) ), 3, 5 ).itera...
[FOCAL] @Override public Iterator<MigrationFile> MigrationsFilter.iterator() [CLASS] class MigrationsFilter implements Iterable<MigrationFile> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] origin.iterator/0 [COLLABORATORS] field origin iterator/0 [CLASS-MEMBERS] MigrationsFilter(...
/* static context [FOCAL] @Override public Iterator<MigrationFile> MigrationsFilter.iterator() [COLLABORATORS] field origin iterator/0 [CALLS-EXTERNAL] origin.iterator/0 */
/* static context [FOCAL] @Override public Iterator<MigrationFile> MigrationsFilter.iterator() [COLLABORATORS] field origin iterator/0 [CALLS-EXTERNAL] origin.iterator/0 */ class MigrationsFilter implements Iterable<MigrationFile> { @Override public Iterator<MigrationFile> iterator() { return origin.it...
true
ok
{"focal": {"class": "MigrationsFilter", "name": "iterator", "signature": "Iterator<MigrationFile> iterator()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Iterator<MigrationFile>"}, "class_info": {"name": "MigrationsFilter", "kind": "class", "modifiers": "", "superclass": null, "inte...
77838408_49
class AsyncDirectClientAuthenticator { public final CompletableFuture<List<U>> authenticate(final List<AsyncClient<? extends Credentials, U>> currentClients, final C context, final AsyncProfileManager<U, C> manager) { final Stream<AsyncClient<? extends Credentials...
final AsyncDirectClientAuthenticator<TestProfile, AsyncWebContext> authenticator = new AsyncDirectClientAuthenticator<>(AsyncProfileSave.SINGLE_PROFILE_SAVE, new AsyncSaveProfileToSessionDecision(true), new AsyncLoadProfileFromSessionDecision()); final AsyncWebContext webContext = webCo...
[FOCAL] public final CompletableFuture<List<U>> AsyncDirectClientAuthenticator.authenticate(List<AsyncClient<? extends Credentials, U>> currentClients, C context, AsyncProfileManager<U, C> manager) [CLASS] class AsyncDirectClientAuthenticator [METRICS] loc=27 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-...
/* static context [FOCAL] public final CompletableFuture<List<U>> AsyncDirectClientAuthenticator.authenticate(List<AsyncClient<? extends Credentials, U>> currentClients, C context, AsyncProfileManager<U, C> manager) [INPUTS] branches=- | result=context, currentClients, manager [COLLABORATORS] param currentClients:List<...
/* static context [FOCAL] public final CompletableFuture<List<U>> AsyncDirectClientAuthenticator.authenticate(List<AsyncClient<? extends Credentials, U>> currentClients, C context, AsyncProfileManager<U, C> manager) [INPUTS] branches=- | result=context, currentClients, manager [COLLABORATORS] param currentClients:List<...
true
ok
{"focal": {"class": "AsyncDirectClientAuthenticator", "name": "authenticate", "signature": "CompletableFuture<List<U>> authenticate(List<AsyncClient<? extends Credentials, U>> currentClients, C context, AsyncProfileManager<U, C> manager)", "start_line": 3, "modifiers": "public final", "params": [{"name": "currentClient...
77841232_34
class MediaScanServiceImpl implements MediaScanService { @Override public Map<Path, List<Media>> retrieveFiles() { log.info("Scanning for directories in {}", scanConfig.base_input_dir()); return scannerProvider.get() .searchIn(scanConfig.base_input_dir()) .withRecursion(...
assertThatExceptionOfType(RuntimeException.class).isThrownBy(() -> subject.retrieveFiles()); } }
[FOCAL] @Override public Map<Path, List<Media>> MediaScanServiceImpl.retrieveFiles() [CLASS] class MediaScanServiceImpl implements MediaScanService [METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] log.info/2, scanConfig.base_input_dir/0, scannerProvider.get() .searchIn(scanConfig.b...
/* static context [FOCAL] @Override public Map<Path, List<Media>> MediaScanServiceImpl.retrieveFiles() [COLLABORATORS] field scanConfig base_input_dir/0; field scannerProvider get/0 [CALLS-EXTERNAL] log.info/2, scanConfig.base_input_dir/0, scannerProvider.get() .searchIn(scanConfig.base_input_dir....collect/1, scannerP...
/* static context [FOCAL] @Override public Map<Path, List<Media>> MediaScanServiceImpl.retrieveFiles() [COLLABORATORS] field scanConfig base_input_dir/0; field scannerProvider get/0 [CALLS-EXTERNAL] log.info/2, scanConfig.base_input_dir/0, scannerProvider.get() .searchIn(scanConfig.base_input_dir....collect/1, scannerP...
true
ok
{"focal": {"class": "MediaScanServiceImpl", "name": "retrieveFiles", "signature": "Map<Path, List<Media>> retrieveFiles()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Map<Path, List<Media>>"}, "class_info": {"name": "MediaScanServiceImpl", "kind": "class", "modifiers": "", "supercla...
77936449_6
class EJB_03_rollback { public void createTwo(boolean rollback, String first, String second) { Foo foo = new Foo(first); Foo bar = new Foo(second); em.persist(foo); em.persist(bar); if(rollback) { ctx.setRollbackOnly(); //none should get persisted, as we rollb...
String first = "first"; String second = "second"; assertFalse(queriesEJB.isInDB(first)); assertFalse(queriesEJB.isInDB(second)); ejb.createTwo(true,first,second); //should rollback assertFalse(queriesEJB.isInDB(first)); assertFalse(queriesEJB.isInDB(second)); ...
[FOCAL] public void EJB_03_rollback.createTwo(boolean rollback, String first, String second) [CLASS] class EJB_03_rollback [METRICS] loc=12 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] em.persist/1, ctx.setRollbackOnly/0 [NEW] Foo [PATH1] if(rollback)=T [PATH2] if(rollback)=F [INPUTS] branches=...
/* static context [FOCAL] public void EJB_03_rollback.createTwo(boolean rollback, String first, String second) [PATH1] if(rollback)=T [PATH2] if(rollback)=F [INPUTS] branches=rollback | result=- [COLLABORATORS] field em persist/1; field ctx setRollbackOnly/0 [NEW] Foo [CALLS-EXTERNAL] em.persist/1, ctx.setRollbackOnly/...
/* static context [FOCAL] public void EJB_03_rollback.createTwo(boolean rollback, String first, String second) [PATH1] if(rollback)=T [PATH2] if(rollback)=F [INPUTS] branches=rollback | result=- [COLLABORATORS] field em persist/1; field ctx setRollbackOnly/0 [NEW] Foo [CALLS-EXTERNAL] em.persist/1, ctx.setRollbackOnly/...
true
ok
{"focal": {"class": "EJB_03_rollback", "name": "createTwo", "signature": "void createTwo(boolean rollback, String first, String second)", "start_line": 3, "modifiers": "public", "params": [{"name": "rollback", "type": "boolean"}, {"name": "first", "type": "String"}, {"name": "second", "type": "String"}], "return_type":...
78016530_0
class SuperFactory { public <T> T create(String fullName, Class<T> clazz) { IndraFactory<T> factory; if (fullName != null) { String[] parts = fullName.split(IndraFactory.FACTORY_SEPARATOR); String item; if (parts.length > 1) { factory = getFactor...
SuperFactory sf = new SuperFactory(); RelatednessFunction func = sf.create("cosine", RelatednessFunction.class); Assert.assertTrue(func != null); Assert.assertEquals(CosineRelatednessFunction.class, func.getClass()); } }
[FOCAL] public T SuperFactory.create(String fullName, Class<T> clazz) [CLASS] class SuperFactory [METRICS] loc=21 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=2 [CALLS-INTERNAL] IndraFactory<T> getFactory(String name, Class<T> clazz) [CALLS-EXTERNAL] String.split/1, String.substring/2, String.length/0, IndraFacto...
/* static context [FOCAL] public T SuperFactory.create(String fullName, Class<T> clazz) [PATH1] if(fullName != null)=T -> if(parts.length > 1)=T -> return factory != null ? factory.get(item) : null [PATH2] if(fullName != null)=F -> return factory != null ? factory.getDefault() : null [PATH3] if(fullName != null)=T -> i...
/* static context [FOCAL] public T SuperFactory.create(String fullName, Class<T> clazz) [PATH1] if(fullName != null)=T -> if(parts.length > 1)=T -> return factory != null ? factory.get(item) : null [PATH2] if(fullName != null)=F -> return factory != null ? factory.getDefault() : null [PATH3] if(fullName != null)=T -> i...
true
ok
{"focal": {"class": "SuperFactory", "name": "create", "signature": "T create(String fullName, Class<T> clazz)", "start_line": 3, "modifiers": "public", "params": [{"name": "fullName", "type": "String"}, {"name": "clazz", "type": "Class<T>"}], "return_type": "T"}, "class_info": {"name": "SuperFactory", "kind": "class", ...
78045492_1
class WebViewOverlay implements WebViewOverlayAPI { public String getUrl(String baseUrl, HashMap<String, String> params) throws WebViewOverlayException { String finalUrl = null; if (baseUrl instanceof String) { if (params == null || params.isEmpty()) { return baseUrl; ...
String url = "https://ptyagicodecamp.github.io"; HashMap<String, String> params = new HashMap<>(); params.put("param1", "1234"); params.put("param2", "testParam"); String expectedUrl = "https://ptyagicodecamp.github.io/?param1=1234&param2=testParam"; String actualUrl = "...
[FOCAL] public String WebViewOverlay.getUrl(String baseUrl, HashMap<String, String> params) [CLASS] class WebViewOverlay implements WebViewOverlayAPI [METRICS] loc=27 cc=5 branches=3 loops=1 returns=2 throws=1 nesting=4 [CALLS-EXTERNAL] HashMap<String, String>.isEmpty/0, HashMap<String, String>.entrySet/0, Map.Entry<St...
/* static context [FOCAL] public String WebViewOverlay.getUrl(String baseUrl, HashMap<String, String> params) [THROWS-WHEN] WebViewOverlayException when !(baseUrl instanceof String) [PATH1] if(baseUrl instanceof String)=T -> if(params == null || params.isEmpty())=F -> foreach(Map.Entry<String, String> attrib : params.e...
/* static context [FOCAL] public String WebViewOverlay.getUrl(String baseUrl, HashMap<String, String> params) [THROWS-WHEN] WebViewOverlayException when !(baseUrl instanceof String) [PATH1] if(baseUrl instanceof String)=T -> if(params == null || params.isEmpty())=F -> foreach(Map.Entry<String, String> attrib : params.e...
true
ok
{"focal": {"class": "WebViewOverlay", "name": "getUrl", "signature": "String getUrl(String baseUrl, HashMap<String, String> params) throws WebViewOverlayException", "start_line": 3, "modifiers": "public", "params": [{"name": "baseUrl", "type": "String"}, {"name": "params", "type": "HashMap<String, String>"}], "return_t...
78055963_4
class CustomOperation extends BaseOperation { @Override public byte[] toBytes() { byte[] feeBytes = fee.toBytes(); byte[] payerBytes = payer.toBytes(); List<Byte> requiredAuthsSerialized = new LinkedList<>(); if (this.requiredAuths != null) { for (UserAccount userAcc...
CustomOperation customOperation1 = new CustomOperation(fee, payer, operationId, requiredAuths, shortData); byte[] serialized1 = customOperation1.toBytes(); assertArrayEquals(EXPECTED_SERIALIZED_BYTES_1, serialized1); // test with some long data string to check if data length is serializ...
[FOCAL] @Override public byte[] CustomOperation.toBytes() [CLASS] class CustomOperation extends BaseOperation [METRICS] loc=18 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] AssetAmount.toBytes/0, UserAccount.toBytes/0, List<Byte>.addAll/1, Bytes.asList/1, Bytes.toArray/1, List<UserAccount>.size/...
/* static context [FOCAL] @Override public byte[] CustomOperation.toBytes() [PATH1] if(this.requiredAuths != null)=T -> foreach(UserAccount userAccount : this.requiredAuths)=T -> exit loop -> return Bytes.concat(feeBytes, payerBytes, requiredAuthsLength, requiredAut... [PATH2] if(this.requiredAuths != null)=F -> return...
/* static context [FOCAL] @Override public byte[] CustomOperation.toBytes() [PATH1] if(this.requiredAuths != null)=T -> foreach(UserAccount userAccount : this.requiredAuths)=T -> exit loop -> return Bytes.concat(feeBytes, payerBytes, requiredAuthsLength, requiredAut... [PATH2] if(this.requiredAuths != null)=F -> return...
true
ok
{"focal": {"class": "CustomOperation", "name": "toBytes", "signature": "byte[] toBytes()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "byte[]"}, "class_info": {"name": "CustomOperation", "kind": "class", "modifiers": "", "superclass": "BaseOperation", "interfaces": null, "fields": [{...
78089297_36
class UnErasureCodingAction extends ErasureCodingBase { @Override public void init(Map<String, String> args) { super.init(args); this.conf = getContext().getConf(); this.srcPath = args.get(FILE_PATH); this.ecPolicyName = REPLICATION_POLICY_NAME; if (args.containsKey(EC_TMP)) { this.ecTmpP...
String testDir = "/test_dir"; dfs.mkdirs(new Path(testDir)); dfs.setErasureCodingPolicy(new Path(testDir), ecPolicy.getName()); // create test file, its EC policy should be consistent with parent dir, i.e., ecPolicy. String srcPath = testDir + "/ec_file"; createTestFile(srcPath, 1000); dfsCl...
[FOCAL] @Override public void UnErasureCodingAction.init(Map<String, String> args) [CLASS] class UnErasureCodingAction extends ErasureCodingBase [METRICS] loc=14 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] ErasureCodingBase.init/1, getContext().getConf/0, getContext/0 (inherited), Map<String, ...
/* static context [FOCAL] @Override public void UnErasureCodingAction.init(Map<String, String> args) [PATH1] if(args.containsKey(EC_TMP))=T -> if(args.containsKey(BUF_SIZE) && !args.get(BUF_SIZE).isEmpty())=T [PATH2] if(args.containsKey(EC_TMP))=F -> if(args.containsKey(BUF_SIZE) && !args.get(BUF_SIZE).isEmpty())=F [IN...
/* static context [FOCAL] @Override public void UnErasureCodingAction.init(Map<String, String> args) [PATH1] if(args.containsKey(EC_TMP))=T -> if(args.containsKey(BUF_SIZE) && !args.get(BUF_SIZE).isEmpty())=T [PATH2] if(args.containsKey(EC_TMP))=F -> if(args.containsKey(BUF_SIZE) && !args.get(BUF_SIZE).isEmpty())=F [IN...
true
ok
{"focal": {"class": "UnErasureCodingAction", "name": "init", "signature": "void init(Map<String, String> args)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "args", "type": "Map<String, String>"}], "return_type": "void"}, "class_info": {"name": "UnErasureCodingAction", "kind": "class", "modifi...
78224452_1
class ChatPresenter extends Presenter<ChatPresenter.View> { @Override public void attachView(View view) { super.attachView(view); if (messages.size() == 0) { oldMessagesDisposable = chatService.getMessages() .repeatWhen(o -> o.concatMap(v -> Observable.interval(...
when(chatServiceMock.getMessages()).thenReturn(Observable.just(testMessages)); when(chatServiceMock.addMessage(chatMessageCaptor.capture())).thenReturn(Observable.just(testMessages.get(0))); when(chatPresenterViewMock.getNewMessage()).thenReturn(Observable.just(testMessageString)); chat...
[FOCAL] @Override public void ChatPresenter.attachView(View view) [CLASS] class ChatPresenter extends Presenter<ChatPresenter.View> [METRICS] loc=32 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=3 [CALLS-EXTERNAL] Presenter<ChatPresenter.View>.attachView/1, messages.size/0, chatService.getMessages() .repeatWhen(o ...
/* static context [FOCAL] @Override public void ChatPresenter.attachView(View view) [PATH1] if(messages.size() == 0)=T -> if(newMessagesDisposable == null || newMessagesDisposable.isDisposed())=T [PATH2] if(messages.size() == 0)=F -> if(newMessagesDisposable == null || newMessagesDisposable.isDisposed())=F [COLLABORATO...
/* static context [FOCAL] @Override public void ChatPresenter.attachView(View view) [PATH1] if(messages.size() == 0)=T -> if(newMessagesDisposable == null || newMessagesDisposable.isDisposed())=T [PATH2] if(messages.size() == 0)=F -> if(newMessagesDisposable == null || newMessagesDisposable.isDisposed())=F [COLLABORATO...
true
ok
{"focal": {"class": "ChatPresenter", "name": "attachView", "signature": "void attachView(View view)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "view", "type": "View"}], "return_type": "void"}, "class_info": {"name": "ChatPresenter", "kind": "class", "modifiers": "", "superclass": "Presenter...
78267831_15
class Cell { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Cell other = (Cell) obj; if (x != other.x) return false; if (y != other.y) return false; return true; } public Cell(...
System.out.println("equals"); Object obj = null; Cell instance = new Cell(2,3,State.LIVE); boolean expResult = false; boolean result = instance.equals(obj); assertEquals(expResult, result); } }
[FOCAL] @Override public boolean Cell.equals(Object obj) [CLASS] class Cell [METRICS] loc=15 cc=6 branches=5 loops=0 returns=6 throws=0 nesting=1 [CALLS-EXTERNAL] getClass/0 (inherited), Object.getClass/0 [PATH1] if(this == obj)=F -> if(obj == null)=F -> if(getClass() != obj.getClass())=F -> if(x != other.x)=F -> if(y ...
/* static context [FOCAL] @Override public boolean Cell.equals(Object obj) [PATH1] if(this == obj)=F -> if(obj == null)=F -> if(getClass() != obj.getClass())=F -> if(x != other.x)=F -> if(y != other.y)=T -> return false [PATH2] if(this == obj)=T -> return true [PATH3] if(this == obj)=F -> if(obj == null)=T -> return fa...
/* static context [FOCAL] @Override public boolean Cell.equals(Object obj) [PATH1] if(this == obj)=F -> if(obj == null)=F -> if(getClass() != obj.getClass())=F -> if(x != other.x)=F -> if(y != other.y)=T -> return false [PATH2] if(this == obj)=T -> return true [PATH3] if(this == obj)=F -> if(obj == null)=T -> return fa...
true
ok
{"focal": {"class": "Cell", "name": "equals", "signature": "boolean equals(Object obj)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "obj", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "Cell", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "f...
78291176_7
class TargetRange { public static TargetRange from(@IntRange(from = 0) int start, @IntRange(from = 0) int end) { if (end < start) { throw new IllegalArgumentException("The end of the range shouldn't be before the start"); } return new TargetRange(start, end); } private...
TargetRange targetRange = TargetRange.from(RANGE_ZERO, RANGE_TEN); TargetRange expectedResult = TargetRange.from(RANGE_ZERO, RANGE_FIVE); assertThat(targetRange).isNotEqualTo(expectedResult); } }
[FOCAL] public static TargetRange TargetRange.from(int start, int end) [CLASS] class TargetRange [METRICS] loc=7 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [NEW] IllegalArgumentException, TargetRange [EXCEPTIONS] throws IllegalArgumentException [THROWS-WHEN] IllegalArgumentException when end < start [PATH1] i...
/* static context [FOCAL] public static TargetRange TargetRange.from(int start, int end) [THROWS-WHEN] IllegalArgumentException when end < start [PATH1] if(end < start)=T -> throw new IllegalArgumentException("The end of the range shouldn't be bef... [PATH2] if(end < start)=F -> return new TargetRange(start, end) [INPU...
/* static context [FOCAL] public static TargetRange TargetRange.from(int start, int end) [THROWS-WHEN] IllegalArgumentException when end < start [PATH1] if(end < start)=T -> throw new IllegalArgumentException("The end of the range shouldn't be bef... [PATH2] if(end < start)=F -> return new TargetRange(start, end) [INPU...
true
ok
{"focal": {"class": "TargetRange", "name": "from", "signature": "TargetRange from(int start, int end)", "start_line": 3, "modifiers": "public static", "params": [{"name": "start", "type": "int"}, {"name": "end", "type": "int"}], "return_type": "TargetRange"}, "class_info": {"name": "TargetRange", "kind": "class", "modi...
78306233_0
class FlagParser { @NonNull public List<AutoModFlag> parseFlags(@NonNull String rawFlags) { final String[] splitFlags = rawFlags.split(","); final List<AutoModFlag> flags = new ArrayList<>(splitFlags.length); for (String rawFlag : splitFlags) { String[] parts = rawFlag.spli...
assertTrue(parseFlags("").isEmpty()); } }
[FOCAL] @NonNull public List<AutoModFlag> FlagParser.parseFlags(String rawFlags) [CLASS] class FlagParser [METRICS] loc=35 cc=7 branches=4 loops=2 returns=1 throws=0 nesting=3 [CALLS-EXTERNAL] String.split/1, String.split/2, parts[0].split/1, Integer.parseInt/1, AutoModFlag.builder() .startIndex(start).endIndex/1, Auto...
/* static context [FOCAL] @NonNull public List<AutoModFlag> FlagParser.parseFlags(String rawFlags) [PATH1] foreach(String rawFlag : splitFlags)=T -> if(parts.length != 2)=F -> if(indices.length != 2)=F -> foreach(String score : scores)=T -> if(scoreParts.length != 2)=F -> if(type != null)=T -> exit loop -> exit loop ->...
/* static context [FOCAL] @NonNull public List<AutoModFlag> FlagParser.parseFlags(String rawFlags) [PATH1] foreach(String rawFlag : splitFlags)=T -> if(parts.length != 2)=F -> if(indices.length != 2)=F -> foreach(String score : scores)=T -> if(scoreParts.length != 2)=F -> if(type != null)=T -> exit loop -> exit loop ->...
true
ok
{"focal": {"class": "FlagParser", "name": "parseFlags", "signature": "List<AutoModFlag> parseFlags(String rawFlags)", "start_line": 3, "modifiers": "@NonNull public", "params": [{"name": "rawFlags", "type": "String"}], "return_type": "List<AutoModFlag>"}, "class_info": {"name": "FlagParser", "kind": "class", "modifiers...
78359015_9
class ValiFieldText extends ValiFieldBase<String> { public ValiFieldText addMinLengthValidator(int minLength) { return addMinLengthValidator(getErrorRes(ValiFi.Builder.ERROR_RES_LENGTH_MIN), minLength); } public ValiFieldText(); public ValiFieldText(@Nullable String defaultValue); public ValiFieldText(@Null...
mField.set("1234"); mField.addMinLengthValidator("must be longer than 4 characters", 4); assertThat(mField.isValid(), is(true)); } }
[FOCAL] public ValiFieldText ValiFieldText.addMinLengthValidator(int minLength) [CLASS] class ValiFieldText extends ValiFieldBase<String> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] ValiFieldText addMinLengthValidator(int errorResource, int minLength) [CALLS-EXTERNAL] getErrorR...
/* static context [FOCAL] public ValiFieldText ValiFieldText.addMinLengthValidator(int minLength) [INPUTS] branches=- | result=minLength [CALLS-INTERNAL] ValiFieldText addMinLengthValidator(int errorResource, int minLength) [CALLS-EXTERNAL] getErrorRes/1 (inherited) */
/* static context [FOCAL] public ValiFieldText ValiFieldText.addMinLengthValidator(int minLength) [INPUTS] branches=- | result=minLength [CALLS-INTERNAL] ValiFieldText addMinLengthValidator(int errorResource, int minLength) [CALLS-EXTERNAL] getErrorRes/1 (inherited) */ class ValiFieldText extends ValiFieldBase<String> ...
true
ok
{"focal": {"class": "ValiFieldText", "name": "addMinLengthValidator", "signature": "ValiFieldText addMinLengthValidator(int minLength)", "start_line": 3, "modifiers": "public", "params": [{"name": "minLength", "type": "int"}], "return_type": "ValiFieldText"}, "class_info": {"name": "ValiFieldText", "kind": "class", "mo...
78391996_50
class FileOperator { public void read(long pos, Buffer sink, long byteCount) throws IOException { if (byteCount < 0) { throw new IndexOutOfBoundsException(); } while (byteCount > 0L) { try { // Read up to byteCount bytes. byteBuffer.l...
FileOperator operator = new FileOperator(randomAccessFile.getChannel()); Buffer buffer = new Buffer(); try { operator.read(0, buffer, -1L); fail(); } catch (IndexOutOfBoundsException ignored) { } } }
[FOCAL] public void FileOperator.read(long pos, Buffer sink, long byteCount) [CLASS] class FileOperator [METRICS] loc=23 cc=5 branches=2 loops=1 returns=0 throws=2 nesting=3 [CALLS-EXTERNAL] byteBuffer.limit/1, Math.min/2, fileChannel.read/2, byteBuffer.position/0, Buffer.write/3, byteBuffer.clear/0 [NEW] IndexOutOfBou...
/* static context [FOCAL] public void FileOperator.read(long pos, Buffer sink, long byteCount) [THROWS-WHEN] IndexOutOfBoundsException when byteCount < 0 [THROWS-WHEN] EOFException when !(byteCount < 0) && byteCount > 0L && fileChannel.read(byteBuffer, pos) == -1 [PATH1] if(byteCount < 0)=F -> while(byteCount > 0L)=T -...
/* static context [FOCAL] public void FileOperator.read(long pos, Buffer sink, long byteCount) [THROWS-WHEN] IndexOutOfBoundsException when byteCount < 0 [THROWS-WHEN] EOFException when !(byteCount < 0) && byteCount > 0L && fileChannel.read(byteBuffer, pos) == -1 [PATH1] if(byteCount < 0)=F -> while(byteCount > 0L)=T -...
true
ok
{"focal": {"class": "FileOperator", "name": "read", "signature": "void read(long pos, Buffer sink, long byteCount) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "pos", "type": "long"}, {"name": "sink", "type": "Buffer"}, {"name": "byteCount", "type": "long"}], "return_type": "void"}, ...
78418280_0
class RandomBookGenerator { public List<Book> generate(int howMany) { List<Book> books = new ArrayList<>(); for (int i = 0; i < howMany; i++) { books.add(randomBook()); } return books; } public Book randomBook(); private static String randomTitle(); pr...
List<Book> books = new RandomBookGenerator().generate(15); assertEquals(15, books.size()); for (Book book : books) { assertNotNull(book.getTitle()); assertNotNull(book.getAuthor()); assertNotEquals(0, book.getPublishDate().getTime()); } } }
[FOCAL] public List<Book> RandomBookGenerator.generate(int howMany) [CLASS] class RandomBookGenerator [METRICS] loc=9 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] Book randomBook() [CALLS-EXTERNAL] List<Book>.add/1 [NEW] ArrayList<> [PATH1] for(i < howMany)=T -> exit loop -> return books [PATH2...
/* static context [FOCAL] public List<Book> RandomBookGenerator.generate(int howMany) [PATH1] for(i < howMany)=T -> exit loop -> return books [PATH2] for(i < howMany)=F -> return books [INPUTS] branches=howMany | result=- [CALLS-INTERNAL] Book randomBook() [NEW] ArrayList<> [CALLS-EXTERNAL] List<Book>.add/1 */
/* static context [FOCAL] public List<Book> RandomBookGenerator.generate(int howMany) [PATH1] for(i < howMany)=T -> exit loop -> return books [PATH2] for(i < howMany)=F -> return books [INPUTS] branches=howMany | result=- [CALLS-INTERNAL] Book randomBook() [NEW] ArrayList<> [CALLS-EXTERNAL] List<Book>.add/1 */ class Ra...
true
ok
{"focal": {"class": "RandomBookGenerator", "name": "generate", "signature": "List<Book> generate(int howMany)", "start_line": 3, "modifiers": "public", "params": [{"name": "howMany", "type": "int"}], "return_type": "List<Book>"}, "class_info": {"name": "RandomBookGenerator", "kind": "class", "modifiers": "", "superclas...
78420352_45
class UIManagerModule extends ReactContextBaseJavaModule implements OnBatchCompleteListener, LifecycleEventListener, PerformanceCounter { @ReactMethod public void removeSubviewsFromContainerWithID(int containerTag) { mUIImplementation.removeSubviewsFromContainerWithID(containerTag); } public UIManage...
UIManagerModule uiManager = getUIManagerModule(); ReactRootView rootView = new ReactRootView(RuntimeEnvironment.application.getApplicationContext()); int rootTag = uiManager.addMeasuredRootView(rootView); final int containerTag = rootTag + 1; final int containerSiblingTag = containerTag + 1...
[FOCAL] @ReactMethod public void UIManagerModule.removeSubviewsFromContainerWithID(int containerTag) [CLASS] class UIManagerModule extends ReactContextBaseJavaModule implements OnBatchCompleteListener, LifecycleEventListener, PerformanceCounter [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS...
/* static context [FOCAL] @ReactMethod public void UIManagerModule.removeSubviewsFromContainerWithID(int containerTag) [COLLABORATORS] field mUIImplementation removeSubviewsFromContainerWithID/1 [CALLS-EXTERNAL] mUIImplementation.removeSubviewsFromContainerWithID/1 */
/* static context [FOCAL] @ReactMethod public void UIManagerModule.removeSubviewsFromContainerWithID(int containerTag) [COLLABORATORS] field mUIImplementation removeSubviewsFromContainerWithID/1 [CALLS-EXTERNAL] mUIImplementation.removeSubviewsFromContainerWithID/1 */ class UIManagerModule extends ReactContextBaseJavaM...
true
ok
{"focal": {"class": "UIManagerModule", "name": "removeSubviewsFromContainerWithID", "signature": "void removeSubviewsFromContainerWithID(int containerTag)", "start_line": 4, "modifiers": "@ReactMethod public", "params": [{"name": "containerTag", "type": "int"}], "return_type": "void"}, "class_info": {"name": "UIManager...
78444970_22
class JarnikPrim { public static <N> UndirectedGraph<N> compute(final UndirectedGraph<N> graph, final ToIntFunction<UndirectedGraph.Edge<N>> weighter) { final MutableUndirectedGraph<N> result = new MutableUndirectedGraph<>(); if (!graph.nodes().isEmpty()) { // chose arbitrary node to s...
final Map<UndirectedGraph.Edge<String>, Integer> w = new HashMap<>(); final MutableUndirectedGraph<String> g = new MutableUndirectedGraph<>(); g.addNode("a"); g.addNode("b"); w.put(g.addEdge("a", "b"), 10); final UndirectedGraph<String> mst = JarnikPrim.compute(g, w::get...
[FOCAL] public static UndirectedGraph<N> JarnikPrim.compute(UndirectedGraph<N> graph, ToIntFunction<UndirectedGraph.Edge<N>> weighter) [CLASS] class JarnikPrim [METRICS] loc=49 cc=6 branches=4 loops=1 returns=1 throws=1 nesting=3 [CALLS-EXTERNAL] graph.nodes().isEmpty/0, UndirectedGraph<N>.nodes/0, MutableUndirectedGra...
/* static context [FOCAL] public static UndirectedGraph<N> JarnikPrim.compute(UndirectedGraph<N> graph, ToIntFunction<UndirectedGraph.Edge<N>> weighter) [THROWS-WHEN] IllegalArgumentException when !graph.nodes().isEmpty() && result.nodes().size() < graph.nodes().size() && !edgeToAddMaybe.isPresent() [PATH1] if(!graph.n...
/* static context [FOCAL] public static UndirectedGraph<N> JarnikPrim.compute(UndirectedGraph<N> graph, ToIntFunction<UndirectedGraph.Edge<N>> weighter) [THROWS-WHEN] IllegalArgumentException when !graph.nodes().isEmpty() && result.nodes().size() < graph.nodes().size() && !edgeToAddMaybe.isPresent() [PATH1] if(!graph.n...
true
ok
{"focal": {"class": "JarnikPrim", "name": "compute", "signature": "UndirectedGraph<N> compute(UndirectedGraph<N> graph, ToIntFunction<UndirectedGraph.Edge<N>> weighter)", "start_line": 3, "modifiers": "public static", "params": [{"name": "graph", "type": "UndirectedGraph<N>"}, {"name": "weighter", "type": "ToIntFunctio...
78556475_1
class YamlConfiguration extends Configuration<YamlConfiguration> { public final void loadAndSave() { try { load(); save(); } catch (ConfigurationStoreException e) { if (e.getCause() instanceof NoSuchFileException) { postLoad(); sav...
class A extends YamlConfiguration { int i = 0; protected A() { super(configPath, YamlProperties.DEFAULT); } @Override protected void postLoad() { i++; } } A a = new A(); a.loadAndSave(); assertThat(a.i...
[FOCAL] public final void YamlConfiguration.loadAndSave() [CLASS] class YamlConfiguration extends Configuration<YamlConfiguration> [METRICS] loc=13 cc=3 branches=1 loops=0 returns=0 throws=1 nesting=2 [CALLS-EXTERNAL] load/0 (inherited), save/0 (inherited), ConfigurationStoreException.getCause/0, postLoad/0 (inherited)...
/* static context [FOCAL] public final void YamlConfiguration.loadAndSave() [THROWS-WHEN] e when try-body throws && !(e.getCause() instanceof NoSuchFileException) [PATH1] try-body throws -> if(e.getCause() instanceof NoSuchFileException)=F -> throw e [PATH2] try-body throws -> if(e.getCause() instanceof NoSuchFileExcep...
/* static context [FOCAL] public final void YamlConfiguration.loadAndSave() [THROWS-WHEN] e when try-body throws && !(e.getCause() instanceof NoSuchFileException) [PATH1] try-body throws -> if(e.getCause() instanceof NoSuchFileException)=F -> throw e [PATH2] try-body throws -> if(e.getCause() instanceof NoSuchFileExcep...
true
ok
{"focal": {"class": "YamlConfiguration", "name": "loadAndSave", "signature": "void loadAndSave()", "start_line": 3, "modifiers": "public final", "params": [], "return_type": "void"}, "class_info": {"name": "YamlConfiguration", "kind": "class", "modifiers": "", "superclass": "Configuration<YamlConfiguration>", "interfac...
78566008_3
class Result { public static <T> Result<T> error(Throwable error) { if (error == null) { throw new NullPointerException("mError == null"); } return new Result<>(null, error); } private Result(Response<T> response, Throwable error); public static Result<T> response...
try { Result.error(null); fail(); } catch (NullPointerException e) { assertThat(e).hasMessage("error == null"); } } }
[FOCAL] public static Result<T> Result.error(Throwable error) [CLASS] class Result [METRICS] loc=6 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [NEW] NullPointerException, Result<> [EXCEPTIONS] throws NullPointerException [THROWS-WHEN] NullPointerException when error == null [PATH1] if(error == null)=T -> throw...
/* static context [FOCAL] public static Result<T> Result.error(Throwable error) [THROWS-WHEN] NullPointerException when error == null [PATH1] if(error == null)=T -> throw new NullPointerException("mError == null") [PATH2] if(error == null)=F -> return new Result<>(null, error) [INPUTS] branches=error | result=error [EX...
/* static context [FOCAL] public static Result<T> Result.error(Throwable error) [THROWS-WHEN] NullPointerException when error == null [PATH1] if(error == null)=T -> throw new NullPointerException("mError == null") [PATH2] if(error == null)=F -> return new Result<>(null, error) [INPUTS] branches=error | result=error [EX...
true
ok
{"focal": {"class": "Result", "name": "error", "signature": "Result<T> error(Throwable error)", "start_line": 3, "modifiers": "public static", "params": [{"name": "error", "type": "Throwable"}], "return_type": "Result<T>"}, "class_info": {"name": "Result", "kind": "class", "modifiers": "", "superclass": null, "interfac...
78622784_26
class AxisRenderer { ArrayList<Integer> calculateValues(int min, int max, int step) { ArrayList<Integer> result = new ArrayList<>(); int pos = min; while (pos <= max) { result.add(pos); pos += step; } // Set max Y axis label in case isn't already there if (result.get(result.size() - 1) < max) resu...
ArrayList<Integer> toAssert = new ArrayList<>(); toAssert.add(0); toAssert.add(5); toAssert.add(10); assertEquals(toAssert, mXRndr.calculateValues(0, 8, 5)); } }
[FOCAL] ArrayList<Integer> AxisRenderer.calculateValues(int min, int max, int step) [CLASS] class AxisRenderer [METRICS] loc=14 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] ArrayList<Integer>.add/1, ArrayList<Integer>.get/1, ArrayList<Integer>.size/0 [NEW] ArrayList<> [PATH1] while(pos <= max)=...
/* static context [FOCAL] ArrayList<Integer> AxisRenderer.calculateValues(int min, int max, int step) [PATH1] while(pos <= max)=T -> exit loop -> if(result.get(result.size() - 1) < max)=T -> return result [PATH2] while(pos <= max)=F -> if(result.get(result.size() - 1) < max)=F -> return result [INPUTS] branches=max, mi...
/* static context [FOCAL] ArrayList<Integer> AxisRenderer.calculateValues(int min, int max, int step) [PATH1] while(pos <= max)=T -> exit loop -> if(result.get(result.size() - 1) < max)=T -> return result [PATH2] while(pos <= max)=F -> if(result.get(result.size() - 1) < max)=F -> return result [INPUTS] branches=max, mi...
true
ok
{"focal": {"class": "AxisRenderer", "name": "calculateValues", "signature": "ArrayList<Integer> calculateValues(int min, int max, int step)", "start_line": 3, "modifiers": "", "params": [{"name": "min", "type": "int"}, {"name": "max", "type": "int"}, {"name": "step", "type": "int"}], "return_type": "ArrayList<Integer>"...
78735130_2
class DatabaseService { public List<String> getTopContextWordsInYear(final String corpusName, final String table, final String word, final Integer year, final int limit) { final Corpus corpus = corpora.get(corpusName); final List<String> words = new ArrayList<>(); if (!corpus.hasMappingFor(word) || (year ...
assertEquals(Arrays.asList(new String[] { "arr" }), db.getTopContextWordsInYear(CORPUS, DatabaseService.SIMILARITY_TABLE, "foo", 1910, 1)); assertEquals(Arrays.asList(new String[] { "arr", "boo" }), db.getTopContextWordsInYear(CORPUS, DatabaseService.SIMILARITY_TABLE, "foo", 1910, 2)); } }
[FOCAL] public List<String> DatabaseService.getTopContextWordsInYear(String corpusName, String table, String word, Integer year, int limit) [CLASS] class DatabaseService [METRICS] loc=19 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] corpora.get/1, Corpus.hasMappingFor/1, Corpus.getIdFor/1, Strin...
/* static context [FOCAL] public List<String> DatabaseService.getTopContextWordsInYear(String corpusName, String table, String word, Integer year, int limit) [PATH1] if(!corpus.hasMappingFor(word) || (year == null))=F -> foreach(Integer wordId : con.createQuery(sql) .addParameter("givenWord", givenWordId) .addParameter...
/* static context [FOCAL] public List<String> DatabaseService.getTopContextWordsInYear(String corpusName, String table, String word, Integer year, int limit) [PATH1] if(!corpus.hasMappingFor(word) || (year == null))=F -> foreach(Integer wordId : con.createQuery(sql) .addParameter("givenWord", givenWordId) .addParameter...
true
ok
{"focal": {"class": "DatabaseService", "name": "getTopContextWordsInYear", "signature": "List<String> getTopContextWordsInYear(String corpusName, String table, String word, Integer year, int limit)", "start_line": 3, "modifiers": "public", "params": [{"name": "corpusName", "type": "String"}, {"name": "table", "type": "...
78756665_3
class XbelParser extends AbstractParser { @Override public Set<Link> parse(ParseContext context) throws IOException { DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); try { DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(new File(...
File path = new File(System.getProperty("user.dir"), "src"); path = new File(path, "test"); path = new File(path, "resources"); Set<Link> links = fixture.parse(new ParseContext(null, path.getAbsolutePath() + "/linksagogo.xbel", path.getAbsolutePath() + "/linksagogo.xbel")); assertNotNull(links); ...
[FOCAL] @Override public Set<Link> XbelParser.parse(ParseContext context) [CLASS] class XbelParser extends AbstractParser [METRICS] loc=16 cc=2 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] void parseNodeList(NodeList nodeList, Collection<String> labels) [CALLS-EXTERNAL] DocumentBuilderFactory.newIns...
/* static context [FOCAL] @Override public Set<Link> XbelParser.parse(ParseContext context) [PATH1] try-body throws -> return getLinks() [COLLABORATORS] param context:ParseContext getFileName/0 [EXCEPTIONS] declares IOException; catches ParserConfigurationException | SAXException ex [CALLS-INTERNAL] void parseNodeList(...
/* static context [FOCAL] @Override public Set<Link> XbelParser.parse(ParseContext context) [PATH1] try-body throws -> return getLinks() [COLLABORATORS] param context:ParseContext getFileName/0 [EXCEPTIONS] declares IOException; catches ParserConfigurationException | SAXException ex [CALLS-INTERNAL] void parseNodeList(...
true
ok
{"focal": {"class": "XbelParser", "name": "parse", "signature": "Set<Link> parse(ParseContext context) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "context", "type": "ParseContext"}], "return_type": "Set<Link>"}, "class_info": {"name": "XbelParser", "kind": "class", "modif...
78756993_29
class History extends AbstractList<T> implements List<T> { @Override public boolean addAll(int index, Collection<? extends T> c) { return elements.addAll(index, c); } History(); History(List<T> elements); @Nullable public K top(); @Nonnull public K fromTop(int offset); @Nu...
TestKey testKey1 = new TestKey("Hello"); TestKey testKey2 = new TestKey("World"); TestKey testKey3 = new TestKey("Kappa"); History history = History.of(testKey1); List<Object> objects = new ArrayList<>(2); objects.add(testKey2); objects.add(testKey3); tr...
[FOCAL] @Override public boolean History.addAll(int index, Collection<? extends T> c) [CLASS] class History extends AbstractList<T> implements List<T> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] elements.addAll/2 [INPUTS] branches=- | result=c, index [COLLABORATORS] field eleme...
/* static context [FOCAL] @Override public boolean History.addAll(int index, Collection<? extends T> c) [INPUTS] branches=- | result=c, index [COLLABORATORS] field elements addAll/2 [CALLS-EXTERNAL] elements.addAll/2 */
/* static context [FOCAL] @Override public boolean History.addAll(int index, Collection<? extends T> c) [INPUTS] branches=- | result=c, index [COLLABORATORS] field elements addAll/2 [CALLS-EXTERNAL] elements.addAll/2 */ class History extends AbstractList<T> implements List<T> { @Override public boolean addAll(...
true
ok
{"focal": {"class": "History", "name": "addAll", "signature": "boolean addAll(int index, Collection<? extends T> c)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "index", "type": "int"}, {"name": "c", "type": "Collection<? extends T>"}], "return_type": "boolean"}, "class_info": {"name": "Histo...
78768320_0
class TracingHandlerInterceptor extends HandlerInterceptorAdapter { static boolean isTraced(HttpServletRequest httpServletRequest) { // exclude pattern, span is not started in filter return httpServletRequest.getAttribute(TracingFilter.SERVER_SPAN_CONTEXT) instanceof SpanContext; } public ...
HttpServletRequest request = Mockito.mock(HttpServletRequest.class); Mockito.when(request.getAttribute(TracingFilter.SERVER_SPAN_CONTEXT)).thenReturn(Mockito.mock(SpanContext.class)); assertTrue(TracingHandlerInterceptor.isTraced(request)); } }
[FOCAL] static boolean TracingHandlerInterceptor.isTraced(HttpServletRequest httpServletRequest) [CLASS] class TracingHandlerInterceptor extends HandlerInterceptorAdapter [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] HttpServletRequest.getAttribute/1 [INPUTS] branches=- | result=...
/* static context [FOCAL] static boolean TracingHandlerInterceptor.isTraced(HttpServletRequest httpServletRequest) [INPUTS] branches=- | result=httpServletRequest [COLLABORATORS] param httpServletRequest:HttpServletRequest getAttribute/1 [CALLS-EXTERNAL] HttpServletRequest.getAttribute/1 */
/* static context [FOCAL] static boolean TracingHandlerInterceptor.isTraced(HttpServletRequest httpServletRequest) [INPUTS] branches=- | result=httpServletRequest [COLLABORATORS] param httpServletRequest:HttpServletRequest getAttribute/1 [CALLS-EXTERNAL] HttpServletRequest.getAttribute/1 */ class TracingHandlerIntercep...
true
ok
{"focal": {"class": "TracingHandlerInterceptor", "name": "isTraced", "signature": "boolean isTraced(HttpServletRequest httpServletRequest)", "start_line": 3, "modifiers": "static", "params": [{"name": "httpServletRequest", "type": "HttpServletRequest"}], "return_type": "boolean"}, "class_info": {"name": "TracingHandler...
78774547_9
class MetricBlockFilter extends Filter<ILoggingEvent> { @Override public FilterReply decide(ILoggingEvent event) { Marker eventMarker = event.getMarker(); if (isStarted() && eventMarker != null && eventMarker.contains(MetricPassFilter.METRIC_MARKER)) { return FilterReply.DENY; ...
LoggingEvent event = new LoggingEvent(); MetricBlockFilter filter = new MetricBlockFilter(); filter.start(); assertEquals(FilterReply.NEUTRAL, filter.decide(event)); } }
[FOCAL] @Override public FilterReply MetricBlockFilter.decide(ILoggingEvent event) [CLASS] class MetricBlockFilter extends Filter<ILoggingEvent> [METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] ILoggingEvent.getMarker/0, isStarted/0 (inherited), Marker.contains/1 [PATH1] if(isStarte...
/* static context [FOCAL] @Override public FilterReply MetricBlockFilter.decide(ILoggingEvent event) [PATH1] if(isStarted() && eventMarker != null && eventMarker.contains(MetricPassFilter.METRIC_MARKER))=T -> return FilterReply.DENY [PATH2] if(isStarted() && eventMarker != null && eventMarker.contains(MetricPassFilter....
/* static context [FOCAL] @Override public FilterReply MetricBlockFilter.decide(ILoggingEvent event) [PATH1] if(isStarted() && eventMarker != null && eventMarker.contains(MetricPassFilter.METRIC_MARKER))=T -> return FilterReply.DENY [PATH2] if(isStarted() && eventMarker != null && eventMarker.contains(MetricPassFilter....
true
ok
{"focal": {"class": "MetricBlockFilter", "name": "decide", "signature": "FilterReply decide(ILoggingEvent event)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "event", "type": "ILoggingEvent"}], "return_type": "FilterReply"}, "class_info": {"name": "MetricBlockFilter", "kind": "class", "modifi...
78776301_3
class ServletFilterHeaderSpanDecorator implements ServletFilterSpanDecorator { @Override public void onRequest(HttpServletRequest httpServletRequest, Span span) { for (HeaderEntry headerEntry : allowedHeaders) { String headerValue = httpServletRequest.getHeader(headerEntry.getHeader()); ...
decorator = new ServletFilterHeaderSpanDecorator(headerEntries, "HEADER."); Mockito.when(httpServletRequest.getHeader("If-Match")).thenReturn("10"); decorator.onRequest(httpServletRequest, span); Mockito.verify(span).setTag("HEADER.if-match", "10"); } }
[FOCAL] @Override public void ServletFilterHeaderSpanDecorator.onRequest(HttpServletRequest httpServletRequest, Span span) [CLASS] class ServletFilterHeaderSpanDecorator implements ServletFilterSpanDecorator [METRICS] loc=9 cc=3 branches=1 loops=1 returns=0 throws=0 nesting=2 [CALLS-INTERNAL] StringTag buildTag(String ...
/* static context [FOCAL] @Override public void ServletFilterHeaderSpanDecorator.onRequest(HttpServletRequest httpServletRequest, Span span) [PATH1] foreach(HeaderEntry headerEntry : allowedHeaders)=T -> if(headerValue != null && !headerValue.isEmpty())=T -> exit loop [PATH2] foreach(HeaderEntry headerEntry : allowedHe...
/* static context [FOCAL] @Override public void ServletFilterHeaderSpanDecorator.onRequest(HttpServletRequest httpServletRequest, Span span) [PATH1] foreach(HeaderEntry headerEntry : allowedHeaders)=T -> if(headerValue != null && !headerValue.isEmpty())=T -> exit loop [PATH2] foreach(HeaderEntry headerEntry : allowedHe...
true
ok
{"focal": {"class": "ServletFilterHeaderSpanDecorator", "name": "onRequest", "signature": "void onRequest(HttpServletRequest httpServletRequest, Span span)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "httpServletRequest", "type": "HttpServletRequest"}, {"name": "span", "type": "Span"}], "ret...
78808033_1
class ButtonPresenter extends PrivvyPresenter<ButtonContract.View, ButtonContract.Interactor> implements ButtonContract.Presenter { @Override public void incrementNumber() { Timber.d("Incrementing number"); int value = 1; getInteractor().incrementNumberBy(value); numberUpdateYok...
buttonPresenter.incrementNumber(); verify(mockYoke).changeNumber(eq(1)); } }
[FOCAL] @Override public void ButtonPresenter.incrementNumber() [CLASS] class ButtonPresenter extends PrivvyPresenter<ButtonContract.View, ButtonContract.Interactor> implements ButtonContract.Presenter [METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] Timber.d/1, getInteractor().incr...
/* static context [FOCAL] @Override public void ButtonPresenter.incrementNumber() [COLLABORATORS] field numberUpdateYoke changeNumber/1 [CALLS-EXTERNAL] Timber.d/1, getInteractor().incrementNumberBy/1, getInteractor/0 (inherited), numberUpdateYoke.changeNumber/1 */
/* static context [FOCAL] @Override public void ButtonPresenter.incrementNumber() [COLLABORATORS] field numberUpdateYoke changeNumber/1 [CALLS-EXTERNAL] Timber.d/1, getInteractor().incrementNumberBy/1, getInteractor/0 (inherited), numberUpdateYoke.changeNumber/1 */ class ButtonPresenter extends PrivvyPresenter<ButtonCo...
true
ok
{"focal": {"class": "ButtonPresenter", "name": "incrementNumber", "signature": "void incrementNumber()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "ButtonPresenter", "kind": "class", "modifiers": "", "superclass": "PrivvyPresenter<ButtonContract.View,...
78842132_808
class MessageService { public List<Message> getFilteredMessages(MessageSearchCriteria searchCriteria) { List<Message> messages = getMessages(searchCriteria); if (searchCriteria.isModuleAbsent()) { return messages.parallelStream() .filter(e -> e.getLocale().equals(searchCriteria.getLocale()) && e.ge...
String tenantId = "a.b.c"; final Tenant defaultTenant = new Tenant(Tenant.DEFAULT_TENANT); final MessageIdentity messageIdentity1 = MessageIdentity.builder() .code("code1") .locale(ENGLISH_INDIA) .module("module1") .tenant(defaultTenant) ...
[FOCAL] public List<Message> MessageService.getFilteredMessages(MessageSearchCriteria searchCriteria) [CLASS] class MessageService [METRICS] loc=17 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] List<Message> getMessages(MessageSearchCriteria searchCriteria) [CALLS-EXTERNAL] MessageSearchCriteria...
/* static context [FOCAL] public List<Message> MessageService.getFilteredMessages(MessageSearchCriteria searchCriteria) [PATH1] if(searchCriteria.isModuleAbsent())=T -> return messages.parallelStream() .filter(e -> e.getLocale().equals(searchC... [PATH2] if(searchCriteria.isModuleAbsent())=F -> return messages [INPUTS]...
/* static context [FOCAL] public List<Message> MessageService.getFilteredMessages(MessageSearchCriteria searchCriteria) [PATH1] if(searchCriteria.isModuleAbsent())=T -> return messages.parallelStream() .filter(e -> e.getLocale().equals(searchC... [PATH2] if(searchCriteria.isModuleAbsent())=F -> return messages [INPUTS]...
true
ok
{"focal": {"class": "MessageService", "name": "getFilteredMessages", "signature": "List<Message> getFilteredMessages(MessageSearchCriteria searchCriteria)", "start_line": 3, "modifiers": "public", "params": [{"name": "searchCriteria", "type": "MessageSearchCriteria"}], "return_type": "List<Message>"}, "class_info": {"n...
78846472_0
class MainPresenter extends ComponentPresenter<MainPresenter.View, MainComponent> { @Override public void onBindChange(@Nullable View view) { super.onBindChange(view); onView(v -> v.showBinderCounter(++bindCounter)); onView(v -> { if (doInit) { doInit = false...
MainPresenter mainPresenter = new MainPresenter(null); verify(view, never()).showBinderCounter(anyInt()); mainPresenter.onBindChange(view); verify(view).showBinderCounter(1); mainPresenter.onBindChange(null); mainPresenter.onBindChange(view); verify(view).showBind...
[FOCAL] @Override public void MainPresenter.onBindChange(View view) [CLASS] class MainPresenter extends ComponentPresenter<MainPresenter.View, MainComponent> [METRICS] loc=11 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] ComponentPresenter<MainPresenter.View, MainComponent>.onBindChange/1, onVie...
/* static context [FOCAL] @Override public void MainPresenter.onBindChange(View view) [COLLABORATORS] field v showBinderCounter/1,showFragment/1 [CALLS-EXTERNAL] ComponentPresenter<MainPresenter.View, MainComponent>.onBindChange/1, onView/1 (inherited), v.showBinderCounter/1, v.showFragment/1 */
/* static context [FOCAL] @Override public void MainPresenter.onBindChange(View view) [COLLABORATORS] field v showBinderCounter/1,showFragment/1 [CALLS-EXTERNAL] ComponentPresenter<MainPresenter.View, MainComponent>.onBindChange/1, onView/1 (inherited), v.showBinderCounter/1, v.showFragment/1 */ class MainPresenter ext...
true
ok
{"focal": {"class": "MainPresenter", "name": "onBindChange", "signature": "void onBindChange(View view)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "view", "type": "View"}], "return_type": "void"}, "class_info": {"name": "MainPresenter", "kind": "class", "modifiers": "", "superclass": "Compo...
78859100_2
class UserService { public boolean login(String username, String password) { List<String> permissions = apiClient.authenticate(username, password); return permissions.contains("ADMIN"); } @Inject public UserService(Application application); @RealClass @Inject UserService userService;...
when(apiClient.authenticate(username, password)).thenReturn(Lists.newArrayList("ADMIN")); assertTrue(userService.login(username, password)); } }
[FOCAL] public boolean UserService.login(String username, String password) [CLASS] class UserService [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] ApiClient.authenticate/2, List<String>.contains/1 [FIELDS] read=apiClient:ApiClient [INPUTS] branches=- | result=password, username, ...
/* static context [FOCAL] public boolean UserService.login(String username, String password) [INPUTS] branches=- | result=password, username, apiClient [COLLABORATORS] field apiClient:ApiClient authenticate/2 [FIELDS] read=apiClient:ApiClient [CALLS-EXTERNAL] ApiClient.authenticate/2, List<String>.contains/1 */
/* static context [FOCAL] public boolean UserService.login(String username, String password) [INPUTS] branches=- | result=password, username, apiClient [COLLABORATORS] field apiClient:ApiClient authenticate/2 [FIELDS] read=apiClient:ApiClient [CALLS-EXTERNAL] ApiClient.authenticate/2, List<String>.contains/1 */ class U...
true
ok
{"focal": {"class": "UserService", "name": "login", "signature": "boolean login(String username, String password)", "start_line": 3, "modifiers": "public", "params": [{"name": "username", "type": "String"}, {"name": "password", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "UserService", "kind":...
78957876_6
class SwaggerConverterUtils { public static String generateOAS3Definitions(String ballerinaSource, String serviceName) throws IOException, SwaggerConverterException { //Create empty swagger object. Swagger swagger = new Swagger(); String swaggerSource; BallerinaFile ball...
try { String oasDef = SwaggerConverterUtils.generateOAS3Definitions(invalidEchoServiceBal, null); Assert.fail("Error was not thrown for invalid ballerina service"); } catch (IOException e) { Assert.fail("Error while converting ballerina echo service to swagger definit...
[FOCAL] public static String SwaggerConverterUtils.generateOAS3Definitions(String ballerinaSource, String serviceName) [CLASS] class SwaggerConverterUtils [METRICS] loc=45 cc=7 branches=5 loops=1 returns=1 throws=1 nesting=4 [CALLS-INTERNAL] String getAlias(BLangCompilationUnit topCompilationUnit, String packageName) [...
/* static context [FOCAL] public static String SwaggerConverterUtils.generateOAS3Definitions(String ballerinaSource, String serviceName) [THROWS-WHEN] SwaggerConverterException when foreach(TopLevelNode topLevelNode : topCompilationUnit.getTopLevelNodes())=T && topLevelNode instanceof BLangEndpoint && topLevelNode inst...
/* static context [FOCAL] public static String SwaggerConverterUtils.generateOAS3Definitions(String ballerinaSource, String serviceName) [THROWS-WHEN] SwaggerConverterException when foreach(TopLevelNode topLevelNode : topCompilationUnit.getTopLevelNodes())=T && topLevelNode instanceof BLangEndpoint && topLevelNode inst...
true
ok
{"focal": {"class": "SwaggerConverterUtils", "name": "generateOAS3Definitions", "signature": "String generateOAS3Definitions(String ballerinaSource, String serviceName) throws IOException, SwaggerConverterException", "start_line": 3, "modifiers": "public static", "params": [{"name": "ballerinaSource", "type": "String"}...
78969853_5
class MakeUpRepositoryImpl implements MakeUpRepository { @Override public Observable<List<MakeUp>> searchMakeUp(final String brandName, final String productName) { return Observable.defer(() -> makeUpProductRestService.searchMakeUpProducts(brandName, productName)) .retry...
// Given when(makeUpProductRestService.searchMakeUpProducts(anyString(), anyString())).thenReturn (get403ForbiddenError().toList()); // When TestSubscriber<List<MakeUp>> subscriber = new TestSubscriber<>(); makeUpRepository.searchMakeUp(BRAND_COVERGIRL, PRODUCT_T...
[FOCAL] @Override public Observable<List<MakeUp>> MakeUpRepositoryImpl.searchMakeUp(String brandName, String productName) [CLASS] class MakeUpRepositoryImpl implements MakeUpRepository [METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] Observable.defer(() -> makeUpProductRestService....
/* static context [FOCAL] @Override public Observable<List<MakeUp>> MakeUpRepositoryImpl.searchMakeUp(String brandName, String productName) [INPUTS] branches=- | result=brandName, productName, makeUpProductRestService [COLLABORATORS] field makeUpProductRestService:MakeUpProductRestService searchMakeUpProducts/2; field ...
/* static context [FOCAL] @Override public Observable<List<MakeUp>> MakeUpRepositoryImpl.searchMakeUp(String brandName, String productName) [INPUTS] branches=- | result=brandName, productName, makeUpProductRestService [COLLABORATORS] field makeUpProductRestService:MakeUpProductRestService searchMakeUpProducts/2; field ...
true
ok
{"focal": {"class": "MakeUpRepositoryImpl", "name": "searchMakeUp", "signature": "Observable<List<MakeUp>> searchMakeUp(String brandName, String productName)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "brandName", "type": "String"}, {"name": "productName", "type": "String"}], "return_type":...
79060427_1213
class ExtractSedaActionHandler extends ActionHandler { @Override public ItemStatus execute(WorkerParameters params, HandlerIO ioParam) { checkMandatoryParameters(params); handlerIO = ioParam; final ItemStatus globalCompositeItemStatus = new ItemStatus(HANDLER_ID); UnitType work...
VitamThreadUtils.getVitamSession().setTenantId(TENANT_ID); prepareResponseOKForAdminManagementClientFindIngestContracts(INGEST_CONTRACT_NO_CHECK); final InputStream sedaLocal = new FileInputStream(PropertiesUtils.findFile(SIP_ADD_UNIT)); JsonNode parent = JsonHandler .getFr...
[FOCAL] @Override public ItemStatus ExtractSedaActionHandler.execute(WorkerParameters params, HandlerIO ioParam) [CLASS] class ExtractSedaActionHandler extends ActionHandler [METRICS] loc=224 cc=33 branches=12 loops=0 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] ObjectNode extractSEDA(LogbookLifeCyclesClient logbookLi...
class ExtractSedaActionHandler extends ActionHandler { @Override public ItemStatus execute(WorkerParameters params, HandlerIO ioParam) { checkMandatoryParameters(params); handlerIO = ioParam; final ItemStatus globalCompositeItemStatus = new ItemStatus(HANDLER_ID); UnitType work...
false
ok
{"focal": {"class": "ExtractSedaActionHandler", "name": "execute", "signature": "ItemStatus execute(WorkerParameters params, HandlerIO ioParam)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "params", "type": "WorkerParameters"}, {"name": "ioParam", "type": "HandlerIO"}], "return_type": "ItemSt...
79065628_16
class CouchbaseQueryUtil { public static Observable<AsyncN1qlQueryRow> executeN1qlQuery(AsyncBucket bucket, N1qlQuery query) { log.debug("Executing query: {}.", query.statement()); return bucket.query(query) .map(result -> Tuple.create(query, result)) .flatMap(tuple...
AsyncN1qlQueryRow mockRow = mock(AsyncN1qlQueryRow.class); when(mockResult.rows()).thenReturn(Observable.just(mockRow)); when(mockResult.finalSuccess()).thenReturn(Observable.just(true)); TestSubscriber<AsyncN1qlQueryRow> subscriber = new TestSubscriber<>(); executeN1qlQuery(m...
[FOCAL] public static Observable<AsyncN1qlQueryRow> CouchbaseQueryUtil.executeN1qlQuery(AsyncBucket bucket, N1qlQuery query) [CLASS] class CouchbaseQueryUtil [METRICS] loc=36 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] log.debug/2, N1qlQuery.statement/0, bucket.query(query) .map(result -> Tupl...
/* static context [FOCAL] public static Observable<AsyncN1qlQueryRow> CouchbaseQueryUtil.executeN1qlQuery(AsyncBucket bucket, N1qlQuery query) [INPUTS] branches=- | result=bucket, query [COLLABORATORS] param query:N1qlQuery statement/0; param bucket:AsyncBucket query/1; field tuple1 value2/0,value1/0; field tuple2 valu...
/* static context [FOCAL] public static Observable<AsyncN1qlQueryRow> CouchbaseQueryUtil.executeN1qlQuery(AsyncBucket bucket, N1qlQuery query) [INPUTS] branches=- | result=bucket, query [COLLABORATORS] param query:N1qlQuery statement/0; param bucket:AsyncBucket query/1; field tuple1 value2/0,value1/0; field tuple2 valu...
true
ok
{"focal": {"class": "CouchbaseQueryUtil", "name": "executeN1qlQuery", "signature": "Observable<AsyncN1qlQueryRow> executeN1qlQuery(AsyncBucket bucket, N1qlQuery query)", "start_line": 3, "modifiers": "public static", "params": [{"name": "bucket", "type": "AsyncBucket"}, {"name": "query", "type": "N1qlQuery"}], "return_...
79107120_1
class PageSearch extends Search { public PageSearch templates(String... resourceTypes) { query().bool().filter().terms("cq:template", resourceTypes); return this; } public PageSearch(ElasticSearchService elasticSearchService, String index); public PageSearch path(String path); public PageSearch ti...
underTest.templates("/apps/foo", "/apps/bar"); assertEquals("{\"query\":" + "{\"bool\":" + "{\"filter\":" + "[" + "{\"terms\":" + "{\"cq:template\":" + "[" + "\"/apps/foo\"," + "\"/apps/bar\"" + "]" ...
[FOCAL] public PageSearch PageSearch.templates(String... resourceTypes) [CLASS] class PageSearch extends Search [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] query().bool().filter().terms/2, query().bool().filter/0, query().bool/0, query/0 (inherited) [DATAFLOW] resourceTypes@par...
/* static context [FOCAL] public PageSearch PageSearch.templates(String... resourceTypes) [CALLS-EXTERNAL] query().bool().filter().terms/2, query().bool().filter/0, query().bool/0, query/0 (inherited) */
/* static context [FOCAL] public PageSearch PageSearch.templates(String... resourceTypes) [CALLS-EXTERNAL] query().bool().filter().terms/2, query().bool().filter/0, query().bool/0, query/0 (inherited) */ class PageSearch extends Search { public PageSearch templates(String... resourceTypes) { query().bool().filte...
true
ok
{"focal": {"class": "PageSearch", "name": "templates", "signature": "PageSearch templates(String... resourceTypes)", "start_line": 3, "modifiers": "public", "params": [{"name": "resourceTypes", "type": "String..."}], "return_type": "PageSearch"}, "class_info": {"name": "PageSearch", "kind": "class", "modifiers": "", "s...
79112912_0
class AlfrescoCoreAdminHandler extends CoreAdminHandler { NamedList<Object> actionFIX(SolrParams params) throws JSONException { String requestedCoreName = coreName(params); var wrapper = new Object() { final NamedList<Object> response = new SimpleOrderedMap<>(); }; ...
assertEquals(0, params.size()); NamedList<Object> actionResponse = admin.actionFIX(params); assertEquals(0, actionResponse.size()); } }
[FOCAL] NamedList<Object> AlfrescoCoreAdminHandler.actionFIX(SolrParams params) [CLASS] class AlfrescoCoreAdminHandler extends CoreAdminHandler [METRICS] loc=75 cc=6 branches=5 loops=0 returns=4 throws=0 nesting=2 [CALLS-INTERNAL] Collection<String> coreNames(); NamedList<Object> fixOnSpecificCore(String coreName, Long...
class AlfrescoCoreAdminHandler extends CoreAdminHandler { NamedList<Object> actionFIX(SolrParams params) throws JSONException { String requestedCoreName = coreName(params); var wrapper = new Object() { final NamedList<Object> response = new SimpleOrderedMap<>(); }; ...
false
ok
{"focal": {"class": "AlfrescoCoreAdminHandler", "name": "actionFIX", "signature": "NamedList<Object> actionFIX(SolrParams params) throws JSONException", "start_line": 3, "modifiers": "", "params": [{"name": "params", "type": "SolrParams"}], "return_type": "NamedList<Object>"}, "class_info": {"name": "AlfrescoCoreAdminH...
79124323_22
class LgoStreamingTradeService implements StreamingTradeService { public Observable<OpenOrders> getOpenOrders(CurrencyPair currencyPair) { return getOrderUpdates(currencyPair) .map( u -> u.getAllOpenOrders().values().stream() .filter(order -> order instance...
JsonNode snapshot = TestUtils.getJsonContent("/trade/orders-snapshot.json"); JsonNode update = TestUtils.getJsonContent("/trade/orders-update.json"); when(streamingService.subscribeChannel(anyString())) .thenReturn(Observable.just(snapshot, update)); Observable<OpenOrders> openOrders = service....
[FOCAL] public Observable<OpenOrders> LgoStreamingTradeService.getOpenOrders(CurrencyPair currencyPair) [CLASS] class LgoStreamingTradeService implements StreamingTradeService [METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Observable<LgoGroupedUserUpdate> getOrderUpdates(Currency...
/* static context [FOCAL] public Observable<OpenOrders> LgoStreamingTradeService.getOpenOrders(CurrencyPair currencyPair) [INPUTS] branches=- | result=currencyPair [COLLABORATORS] field u getAllOpenOrders/0 [CALLS-INTERNAL] Observable<LgoGroupedUserUpdate> getOrderUpdates(CurrencyPair currencyPair) [CALLS-EXTERNAL] get...
/* static context [FOCAL] public Observable<OpenOrders> LgoStreamingTradeService.getOpenOrders(CurrencyPair currencyPair) [INPUTS] branches=- | result=currencyPair [COLLABORATORS] field u getAllOpenOrders/0 [CALLS-INTERNAL] Observable<LgoGroupedUserUpdate> getOrderUpdates(CurrencyPair currencyPair) [CALLS-EXTERNAL] get...
true
ok
{"focal": {"class": "LgoStreamingTradeService", "name": "getOpenOrders", "signature": "Observable<OpenOrders> getOpenOrders(CurrencyPair currencyPair)", "start_line": 3, "modifiers": "public", "params": [{"name": "currencyPair", "type": "CurrencyPair"}], "return_type": "Observable<OpenOrders>"}, "class_info": {"name": ...
79145090_11
class JobScheduler { @RestrictTo(RestrictTo.Scope.LIBRARY) Scheduler getSchedulerForJob(Context context, JobInfo job) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { return getSchedulerForTag(context, JobSchedulerSchedulerV28.TAG); } if (Build.VERSION.SDK_INT >= Bui...
public void testSchedulerInApi21() { JobInfo api21Job = JobCreator.create(application).setRequiresCharging(true).build(); JobInfo api24Job = JobCreator.create(application).setPeriodic(15 * 60 * 1000L, 5 * 60 * 1000L).build(); JobInfo api26Job = JobCreator.create(application).setRequiresBatte...
[FOCAL] @RestrictTo(RestrictTo.Scope.LIBRARY) Scheduler JobScheduler.getSchedulerForJob(Context context, JobInfo job) [CLASS] class JobScheduler [METRICS] loc=45 cc=7 branches=5 loops=0 returns=6 throws=0 nesting=1 [CALLS-INTERNAL] Scheduler getSchedulerForTag(Context context, String tag) [CALLS-EXTERNAL] JobInfo.getNe...
/* static context [FOCAL] @RestrictTo(RestrictTo.Scope.LIBRARY) Scheduler JobScheduler.getSchedulerForJob(Context context, JobInfo job) [PATH1] if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)=F -> if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)=F -> if((Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && job.getNet...
/* static context [FOCAL] @RestrictTo(RestrictTo.Scope.LIBRARY) Scheduler JobScheduler.getSchedulerForJob(Context context, JobInfo job) [PATH1] if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)=F -> if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)=F -> if((Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && job.getNet...
true
ok
{"focal": {"class": "JobScheduler", "name": "getSchedulerForJob", "signature": "Scheduler getSchedulerForJob(Context context, JobInfo job)", "start_line": 3, "modifiers": "@RestrictTo(RestrictTo.Scope.LIBRARY)", "params": [{"name": "context", "type": "Context"}, {"name": "job", "type": "JobInfo"}], "return_type": "Sche...
79209085_104
class MediaStoreRequestHandler extends ContentStreamRequestHandler { static PicassoKind getPicassoKind(int targetWidth, int targetHeight) { if (targetWidth <= MICRO.width && targetHeight <= MICRO.height) { return MICRO; } else if (targetWidth <= MINI.width && targetHeight <= MINI.height) { return...
assertThat(getPicassoKind(513, 385)).isEqualTo(FULL); assertThat(getPicassoKind(1000, 1000)).isEqualTo(FULL); assertThat(getPicassoKind(1000, 384)).isEqualTo(FULL); assertThat(getPicassoKind(1000, 96)).isEqualTo(FULL); assertThat(getPicassoKind(96, 1000)).isEqualTo(FULL); } }
[FOCAL] static PicassoKind MediaStoreRequestHandler.getPicassoKind(int targetWidth, int targetHeight) [CLASS] class MediaStoreRequestHandler extends ContentStreamRequestHandler [METRICS] loc=8 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=2 [PATH1] if(targetWidth <= MICRO.width && targetHeight <= MICRO.height)=F -...
/* static context [FOCAL] static PicassoKind MediaStoreRequestHandler.getPicassoKind(int targetWidth, int targetHeight) [PATH1] if(targetWidth <= MICRO.width && targetHeight <= MICRO.height)=F -> if(targetWidth <= MINI.width && targetHeight <= MINI.height)=T -> return MINI [PATH2] if(targetWidth <= MICRO.width && targe...
/* static context [FOCAL] static PicassoKind MediaStoreRequestHandler.getPicassoKind(int targetWidth, int targetHeight) [PATH1] if(targetWidth <= MICRO.width && targetHeight <= MICRO.height)=F -> if(targetWidth <= MINI.width && targetHeight <= MINI.height)=T -> return MINI [PATH2] if(targetWidth <= MICRO.width && targe...
true
ok
{"focal": {"class": "MediaStoreRequestHandler", "name": "getPicassoKind", "signature": "PicassoKind getPicassoKind(int targetWidth, int targetHeight)", "start_line": 3, "modifiers": "static", "params": [{"name": "targetWidth", "type": "int"}, {"name": "targetHeight", "type": "int"}], "return_type": "PicassoKind"}, "cla...
79226461_2
class DecorationDelegate extends RecyclerView.ItemDecoration { @Override public void onDraw(@NonNull Canvas canvas, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) { int childCount = parent.getChildCount(); for (int i = 0; i < childCount; i++) { View child = parent.getChildAt(i);...
when(recyclerView.getChildAt(anyInt())).thenReturn(child); when(recyclerView.getChildCount()).thenReturn(3); when(recyclerView.getChildAdapterPosition(child)).thenReturn(-1); testAdapter.getItemDecoration().onDraw(canvas, recyclerView, state); verify(testAdapter, never()).drawDecoration(canvas, rec...
[FOCAL] @Override public void DecorationDelegate.onDraw(Canvas canvas, RecyclerView parent, RecyclerView.State state) [CLASS] class DecorationDelegate extends RecyclerView.ItemDecoration [METRICS] loc=12 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] RecyclerView.getChildCount/0, RecyclerView.get...
/* static context [FOCAL] @Override public void DecorationDelegate.onDraw(Canvas canvas, RecyclerView parent, RecyclerView.State state) [PATH1] for(i < childCount)=T -> if(adapterPosition < 0)=T -> return [PATH2] for(i < childCount)=T -> if(adapterPosition < 0)=F -> exit loop [PATH3] for(i < childCount)=F [INPUTS] bran...
/* static context [FOCAL] @Override public void DecorationDelegate.onDraw(Canvas canvas, RecyclerView parent, RecyclerView.State state) [PATH1] for(i < childCount)=T -> if(adapterPosition < 0)=T -> return [PATH2] for(i < childCount)=T -> if(adapterPosition < 0)=F -> exit loop [PATH3] for(i < childCount)=F [INPUTS] bran...
true
ok
{"focal": {"class": "DecorationDelegate", "name": "onDraw", "signature": "void onDraw(Canvas canvas, RecyclerView parent, RecyclerView.State state)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "canvas", "type": "Canvas"}, {"name": "parent", "type": "RecyclerView"}, {"name": "state", "type": "...
79246257_6
class HighestValue implements Transform { @Override public List<List<Transmutation>> apply(List<List<Transmutation>> stageInput) { final List<Transmutation> stageResult = new ArrayList<>(); // find highest value and if present, return, also setting the message code according to specified rules...
// ARRANGE HighestValue transform = ImmutableHighestValue.of(null, HighestValue.Display.ORIGINAL_TIMESTAMP); // ACT List<List<Transmutation>> results = transform.apply(transformationResults); // ASSERT assertThat(results, not(empty())); assertThat(results.get(0)...
[FOCAL] @Override public List<List<Transmutation>> HighestValue.apply(List<List<Transmutation>> stageInput) [CLASS] class HighestValue implements Transform [METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Transmutation processMetadata(Transmutation result) [CALLS-EXTERNAL] stageInp...
/* static context [FOCAL] @Override public List<List<Transmutation>> HighestValue.apply(List<List<Transmutation>> stageInput) [COLLABORATORS] param stageInput:List<List<Transmutation>> stream/0; field result value/0 [CALLS-INTERNAL] Transmutation processMetadata(Transmutation result) [NEW] ArrayList<>, BigDecimal [CALL...
/* static context [FOCAL] @Override public List<List<Transmutation>> HighestValue.apply(List<List<Transmutation>> stageInput) [COLLABORATORS] param stageInput:List<List<Transmutation>> stream/0; field result value/0 [CALLS-INTERNAL] Transmutation processMetadata(Transmutation result) [NEW] ArrayList<>, BigDecimal [CALL...
true
ok
{"focal": {"class": "HighestValue", "name": "apply", "signature": "List<List<Transmutation>> apply(List<List<Transmutation>> stageInput)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "stageInput", "type": "List<List<Transmutation>>"}], "return_type": "List<List<Transmutation>>"}, "class_info":...
79266038_228
class NativeProcessEnumeratorImpl implements NativeProcessEnumerator { @Override public List<NativeProcess> getProcesses() { return pidEnumerator .getPids() .stream() .map(processCollector::collect) .collect(Collectors.toList()); } public Native...
Map<Integer, String> pidDescriptions = new HashMap<>(); pidDescriptions.put(123, "toaster"); pidDescriptions.put(1, null); pidDescriptions.put(3848, "ayy"); List<Integer> expectedPids = new ArrayList<>(pidDescriptions.keySet()); // pass `new` list so that `enumerator` ca...
[FOCAL] @Override public List<NativeProcess> NativeProcessEnumeratorImpl.getProcesses() [CLASS] class NativeProcessEnumeratorImpl implements NativeProcessEnumerator [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] pidEnumerator .getPids() .stream() .map(processCollector:....collect/...
/* static context [FOCAL] @Override public List<NativeProcess> NativeProcessEnumeratorImpl.getProcesses() [INPUTS] branches=- | result=pidEnumerator [COLLABORATORS] field pidEnumerator:PidEnumerator getPids/0 [FIELDS] read=pidEnumerator:PidEnumerator [CALLS-EXTERNAL] pidEnumerator .getPids() .stream() .map(processColle...
/* static context [FOCAL] @Override public List<NativeProcess> NativeProcessEnumeratorImpl.getProcesses() [INPUTS] branches=- | result=pidEnumerator [COLLABORATORS] field pidEnumerator:PidEnumerator getPids/0 [FIELDS] read=pidEnumerator:PidEnumerator [CALLS-EXTERNAL] pidEnumerator .getPids() .stream() .map(processColle...
true
ok
{"focal": {"class": "NativeProcessEnumeratorImpl", "name": "getProcesses", "signature": "List<NativeProcess> getProcesses()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "List<NativeProcess>"}, "class_info": {"name": "NativeProcessEnumeratorImpl", "kind": "class", "modifiers": "", "su...
79304145_0
class EsDailySnapshotStore extends EsStore implements DailySnapshotStore { @Override public EsDailySnapshotInstance getInstanceById(String instanceId) throws Exception { SearchResponse response = this.retrieveByField("_id", instanceId, EsDailySnapshotInstance.class); if (response.getHits()....
EsDailySnapshotStoreFactory factory = new EsDailySnapshotStoreFactory(); EsDailySnapshotStore store = (EsDailySnapshotStore) factory.getDailyStore(DateTime.parse("2016-07-14")); EsDailySnapshotInstance inst = store.getInstanceById("i-9909451f"); Assert.assertEquals("i-9909451f", inst.get...
[FOCAL] @Override public EsDailySnapshotInstance EsDailySnapshotStore.getInstanceById(String instanceId) [CLASS] class EsDailySnapshotStore extends EsStore implements DailySnapshotStore [METRICS] loc=17 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] this.retrieveByField/3, response.getHits().tota...
/* static context [FOCAL] @Override public EsDailySnapshotInstance EsDailySnapshotStore.getInstanceById(String instanceId) [PATH1] if(response.getHits().totalHits() > 0)=T -> return inst [PATH2] if(response.getHits().totalHits() > 0)=F -> return null [INPUTS] branches=instanceId | result=instanceId [COLLABORATORS] fiel...
/* static context [FOCAL] @Override public EsDailySnapshotInstance EsDailySnapshotStore.getInstanceById(String instanceId) [PATH1] if(response.getHits().totalHits() > 0)=T -> return inst [PATH2] if(response.getHits().totalHits() > 0)=F -> return null [INPUTS] branches=instanceId | result=instanceId [COLLABORATORS] fiel...
true
ok
{"focal": {"class": "EsDailySnapshotStore", "name": "getInstanceById", "signature": "EsDailySnapshotInstance getInstanceById(String instanceId) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "instanceId", "type": "String"}], "return_type": "EsDailySnapshotInstance"}, "class_inf...
79304189_29
class InfluxDecoder { public static List<Point> pointsFromString(String dbName, String payload) { List<Point> dps = new ArrayList<>(); try { Iterable<String> splits = lineFromPayLoad(payload); for (String split : splits) { Builder builder = pointFromLine(Point.newBuilder(), dbName, split); if (build...
String testPoints = "cpu value=1i,value1=2i 1434055562000000000"; List<Point> dps = InfluxDecoder.pointsFromString("test", testPoints); assertEquals(1, dps.size()); Point dp = dps.get(0); assertEquals("cpu", dp.getMeasurementName()); assertEquals(0, dp.getTagsList().size()); assertEquals(1, dp.getValueL...
[FOCAL] public static List<Point> InfluxDecoder.pointsFromString(String dbName, String payload) [CLASS] class InfluxDecoder [METRICS] loc=17 cc=4 branches=1 loops=1 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] List<String> lineFromPayLoad(String payload); Point.Builder pointFromLine(Point.Builder builder, String dbNam...
/* static context [FOCAL] public static List<Point> InfluxDecoder.pointsFromString(String dbName, String payload) [PATH1] foreach(String split : splits)=T -> if(builder != null)=T -> exit loop -> return dps [PATH2] try-body throws -> return dps [PATH3] foreach(String split : splits)=F -> return dps [PATH4] foreach(Stri...
/* static context [FOCAL] public static List<Point> InfluxDecoder.pointsFromString(String dbName, String payload) [PATH1] foreach(String split : splits)=T -> if(builder != null)=T -> exit loop -> return dps [PATH2] try-body throws -> return dps [PATH3] foreach(String split : splits)=F -> return dps [PATH4] foreach(Stri...
true
ok
{"focal": {"class": "InfluxDecoder", "name": "pointsFromString", "signature": "List<Point> pointsFromString(String dbName, String payload)", "start_line": 3, "modifiers": "public static", "params": [{"name": "dbName", "type": "String"}, {"name": "payload", "type": "String"}], "return_type": "List<Point>"}, "class_info"...
79350243_60
class Extensions { @Nonnull @CheckReturnValue public static String append(@Nonnull String fileName, @Nonnull FileType fileType) { final String extension = fileType.getDefaultExtension(); if (fileName.endsWith(DELIMITER + extension)) { return fileName; } return fi...
// exercise final String actual = Extensions.append("foo.java", JavaFileType.INSTANCE); // verify assertThat(actual) .isEqualTo("foo.java"); } }
[FOCAL] @Nonnull @CheckReturnValue public static String Extensions.append(String fileName, FileType fileType) [CLASS] class Extensions [METRICS] loc=9 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] FileType.getDefaultExtension/0, String.endsWith/1 [PATH1] if(fileName.endsWith(DELIMITER + extensio...
/* static context [FOCAL] @Nonnull @CheckReturnValue public static String Extensions.append(String fileName, FileType fileType) [PATH1] if(fileName.endsWith(DELIMITER + extension))=T -> return fileName [PATH2] if(fileName.endsWith(DELIMITER + extension))=F -> return fileName + DELIMITER + extension [INPUTS] branches=fi...
/* static context [FOCAL] @Nonnull @CheckReturnValue public static String Extensions.append(String fileName, FileType fileType) [PATH1] if(fileName.endsWith(DELIMITER + extension))=T -> return fileName [PATH2] if(fileName.endsWith(DELIMITER + extension))=F -> return fileName + DELIMITER + extension [INPUTS] branches=fi...
true
ok
{"focal": {"class": "Extensions", "name": "append", "signature": "String append(String fileName, FileType fileType)", "start_line": 3, "modifiers": "@Nonnull @CheckReturnValue public static", "params": [{"name": "fileName", "type": "String"}, {"name": "fileType", "type": "FileType"}], "return_type": "String"}, "class_i...
79360334_91
class JTextPaneToolbox { public static ArrayList<Integer> getLinesBetween(JTextPane pane, int start, int end) throws BadLocationException { int startingline = transformToLineNumber(pane, start); ArrayList<Integer> lines = new ArrayList<>(); lines.add(startingline); String code = get...
JTextPane pane = new JTextPane(); pane.setText("12\n\n34\n5\n6"); ArrayList<Integer> linesBetween = JTextPaneToolbox.getLinesBetween(pane, 0, 5); int lines[] = {0,1,2}; assertEquals(lines.length, linesBetween.size()); for (int i = 0; i < lines.length; i++) { a...
[FOCAL] public static ArrayList<Integer> JTextPaneToolbox.getLinesBetween(JTextPane pane, int start, int end) [CLASS] class JTextPaneToolbox [METRICS] loc=13 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] String getText(JTextPane pane); int transformToLineNumber(JTextPane pane, int absPos) [CALLS...
/* static context [FOCAL] public static ArrayList<Integer> JTextPaneToolbox.getLinesBetween(JTextPane pane, int start, int end) [PATH1] for(start < end)=T -> if(code.charAt(start) == '\n')=T -> exit loop -> return lines [PATH2] for(start < end)=F -> return lines [PATH3] for(start < end)=T -> if(code.charAt(start) == '\...
/* static context [FOCAL] public static ArrayList<Integer> JTextPaneToolbox.getLinesBetween(JTextPane pane, int start, int end) [PATH1] for(start < end)=T -> if(code.charAt(start) == '\n')=T -> exit loop -> return lines [PATH2] for(start < end)=F -> return lines [PATH3] for(start < end)=T -> if(code.charAt(start) == '\...
true
ok
{"focal": {"class": "JTextPaneToolbox", "name": "getLinesBetween", "signature": "ArrayList<Integer> getLinesBetween(JTextPane pane, int start, int end) throws BadLocationException", "start_line": 3, "modifiers": "public static", "params": [{"name": "pane", "type": "JTextPane"}, {"name": "start", "type": "int"}, {"name"...
79403493_0
class MultiValue { public MultiValue(byte[]... values) { this(Arrays.asList(values)); } public MultiValue(byte[]... values); private MultiValue(List<byte[]> values); public byte[] toByteArray(); private void writeTo(OutputStream output); public static MultiValue from(byte[] ...
String sEntry1 = "Entry 1"; String sEntry2 = "Entry two"; MultiValue multiValue = new MultiValue(sEntry1.getBytes(), sEntry2.getBytes()); byte[] aBytes = multiValue.toByteArray(); int i = 0; // count of number of entries a...
[FOCAL] public MultiValue.MultiValue(byte[]... values) [CLASS] class MultiValue [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] Arrays.asList/1 [DATAFLOW] values@param->L3 [CLASS-MEMBERS] MultiValue(byte[]... values); MultiValue(List<byte[]> values); byte[] toByteArray(); void writ...
/* static context [FOCAL] public MultiValue.MultiValue(byte[]... values) [CALLS-EXTERNAL] Arrays.asList/1 */
/* static context [FOCAL] public MultiValue.MultiValue(byte[]... values) [CALLS-EXTERNAL] Arrays.asList/1 */ class MultiValue { public MultiValue(byte[]... values) { this(Arrays.asList(values)); } public MultiValue(byte[]... values); private MultiValue(List<byte[]> values); public b...
true
ok
{"focal": {"class": "MultiValue", "name": "MultiValue", "signature": "MultiValue(byte[]... values)", "start_line": 3, "modifiers": "public", "params": [{"name": "values", "type": "byte[]..."}], "return_type": null}, "class_info": {"name": "MultiValue", "kind": "class", "modifiers": "", "superclass": null, "interfaces":...
79467343_4
class RxTuples { public static <A, B, C, D, E> Function5<A, B, C, D, E, Quintet<A, B, C, D, E>> toQuintet() { return new Function5<A, B, C, D, E, Quintet<A, B, C, D, E>>() { @Override public Quintet<A, B, C, D, E> apply(A a, B b, C c, D d, E e) { return Quintet.with(...
Assert.assertEquals(true, RxTuples .<Integer, Integer, Integer, Integer, Integer> toQuintet().apply(1, 2, 3, 4, 5) .equals(RES_QUINTET)); Assert.assertEquals( true, RxTuples.<Integer, Integer, Integer, Integer, Integer> toQuintetFromQuartet...
[FOCAL] public static Function5<A, B, C, D, E, Quintet<A, B, C, D, E>> RxTuples.toQuintet() [CLASS] class RxTuples [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Quintet.with/5 [NEW] Function5<A, B, C, D, E, Quintet<A, B, C, D, E>> [CLASS-MEMBERS] RxTuples(); BiFunction<T, U, Pair...
class RxTuples { public static <A, B, C, D, E> Function5<A, B, C, D, E, Quintet<A, B, C, D, E>> toQuintet() { return new Function5<A, B, C, D, E, Quintet<A, B, C, D, E>>() { @Override public Quintet<A, B, C, D, E> apply(A a, B b, C c, D d, E e) { return Quintet.with(...
false
ok
{"focal": {"class": "RxTuples", "name": "toQuintet", "signature": "Function5<A, B, C, D, E, Quintet<A, B, C, D, E>> toQuintet()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Function5<A, B, C, D, E, Quintet<A, B, C, D, E>>"}, "class_info": {"name": "RxTuples", "kind": "class", "modifier...
79483816_1
class PublishRequestTracingHandler extends RequestHandler2 { @Override public void afterError(Request<?> request, Response<?> response, Exception e) { if (request.getOriginalRequestObject() instanceof PublishRequest) { Span span = tracing.tracer().nextSpan() .remoteEndpoint(Endpoint.newBuilder()...
PublishRequest publishRequest = new PublishRequest("topic", "1234"); Request request = new DefaultRequest(publishRequest, "amazon-sns"); handler.afterError(request, null, new Exception("Aw, snap!")); assertEquals( 1, spans.size() ); assertEquals(spans.getFirst().tags().get("error"), "Aw, snap!"); ...
[FOCAL] @Override public void PublishRequestTracingHandler.afterError(Request<?> request, Response<?> response, Exception e) [CLASS] class PublishRequestTracingHandler extends RequestHandler2 [METRICS] loc=12 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] Request<?>.getOriginalRequestObject/0, tr...
/* static context [FOCAL] @Override public void PublishRequestTracingHandler.afterError(Request<?> request, Response<?> response, Exception e) [PATH1] if(request.getOriginalRequestObject() instanceof PublishRequest)=T [PATH2] if(request.getOriginalRequestObject() instanceof PublishRequest)=F [INPUTS] branches=request |...
/* static context [FOCAL] @Override public void PublishRequestTracingHandler.afterError(Request<?> request, Response<?> response, Exception e) [PATH1] if(request.getOriginalRequestObject() instanceof PublishRequest)=T [PATH2] if(request.getOriginalRequestObject() instanceof PublishRequest)=F [INPUTS] branches=request |...
true
ok
{"focal": {"class": "PublishRequestTracingHandler", "name": "afterError", "signature": "void afterError(Request<?> request, Response<?> response, Exception e)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "Request<?>"}, {"name": "response", "type": "Response<?>"}, {"name": "...
79496898_9
class NewVersionCheckerGitHubImpl implements NewVersionChecker { @Override public UpdatePackageInfo findNewUpdateIfAvailable() throws GenericException { try { String currentVersion = getCurrentVersion(); if (VERSION_UNRESOLVED.equals(currentVersion) || DEV_VERSION.equals(currentVersion)) { // not spammin...
NewVersionCheckerGitHubImpl f = new NewVersionCheckerGitHubImpl(); f.setConfiguredVersion("0.0.0.1"); UpdatePackageInfo result = f.findNewUpdateIfAvailable(); assertNotNull(result); } }
[FOCAL] @Override public UpdatePackageInfo NewVersionCheckerGitHubImpl.findNewUpdateIfAvailable() [CLASS] class NewVersionCheckerGitHubImpl implements NewVersionChecker [METRICS] loc=31 cc=6 branches=4 loops=0 returns=5 throws=1 nesting=2 [CALLS-INTERNAL] String getCurrentVersion(); UpdatePackageInfo buildUpdatePackage...
/* static context [FOCAL] @Override public UpdatePackageInfo NewVersionCheckerGitHubImpl.findNewUpdateIfAvailable() [THROWS-WHEN] GenericException when try-body throws [PATH1] if(VERSION_UNRESOLVED.equals(currentVersion) || DEV_VERSION.equals(currentVersion))=F -> if(latestRelease.isDraft() || latestRelease.isPrereleas...
/* static context [FOCAL] @Override public UpdatePackageInfo NewVersionCheckerGitHubImpl.findNewUpdateIfAvailable() [THROWS-WHEN] GenericException when try-body throws [PATH1] if(VERSION_UNRESOLVED.equals(currentVersion) || DEV_VERSION.equals(currentVersion))=F -> if(latestRelease.isDraft() || latestRelease.isPrereleas...
true
ok
{"focal": {"class": "NewVersionCheckerGitHubImpl", "name": "findNewUpdateIfAvailable", "signature": "UpdatePackageInfo findNewUpdateIfAvailable() throws GenericException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "UpdatePackageInfo"}, "class_info": {"name": "NewVersionCheckerGitHub...
79514986_1
class ConfigureReader { public static Configure reader(String configueFileName) throws DocumentException { logger.info("Begin read configure[{}]", configueFileName); Configure configure = new Configure(); SAXReader reader = new SAXReader(); File file = new File(configueFileName); ...
try { ConfigureReader.reader("src/test/resources/configure_miss_topic.xml"); Assert.fail(); } catch (Exception e) { Assert.assertEquals(e.getMessage(), "mappings.mapping.datahubTopic is null"); } } }
[FOCAL] public static Configure ConfigureReader.reader(String configueFileName) [CLASS] class ConfigureReader [METRICS] loc=331 cc=51 branches=48 loops=2 returns=1 throws=13 nesting=3 [CALLS-INTERNAL] void paraseShardList(String shardListStr, List<String> shardIds); void parseConstColumnMap(String constColumnMapStr, Ma...
class ConfigureReader { public static Configure reader(String configueFileName) throws DocumentException { logger.info("Begin read configure[{}]", configueFileName); Configure configure = new Configure(); SAXReader reader = new SAXReader(); File file = new File(configueFileName); ...
false
ok
{"focal": {"class": "ConfigureReader", "name": "reader", "signature": "Configure reader(String configueFileName) throws DocumentException", "start_line": 3, "modifiers": "public static", "params": [{"name": "configueFileName", "type": "String"}], "return_type": "Configure"}, "class_info": {"name": "ConfigureReader", "k...
79539593_6
class CompositeRepositoryImpl implements EventRepository { @Override public <P extends PublishedEvent> EventKey recordAndPublish(P publishedEvent) throws EventStoreException, ConcurrentEventException { return recordAndPublishInternal(publishedEvent, Optional.empty(), entityEvent -> new DefaultConcurren...
mockCommon(intermediateEvent); EventKey previousEntityEventKey = new EventKey(); ConcurrencyResolver concurrencyResolver = mock(ConcurrencyResolver.class); Function<EntityEvent, ConcurrencyResolver<ConcurrentEventException>> factory = entityEvent -> concurrencyResolver; EventKe...
[FOCAL] @Override public EventKey CompositeRepositoryImpl.recordAndPublish(P publishedEvent) [CLASS] class CompositeRepositoryImpl implements EventRepository [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] EventKey recordAndPublishInternal(P publishedEvent, Optional<EventKey> previ...
/* static context [FOCAL] @Override public EventKey CompositeRepositoryImpl.recordAndPublish(P publishedEvent) [INPUTS] branches=- | result=publishedEvent [EXCEPTIONS] declares EventStoreException, ConcurrentEventException [CALLS-INTERNAL] EventKey recordAndPublishInternal(P publishedEvent, Optional<EventKey> previousE...
/* static context [FOCAL] @Override public EventKey CompositeRepositoryImpl.recordAndPublish(P publishedEvent) [INPUTS] branches=- | result=publishedEvent [EXCEPTIONS] declares EventStoreException, ConcurrentEventException [CALLS-INTERNAL] EventKey recordAndPublishInternal(P publishedEvent, Optional<EventKey> previousE...
true
ok
{"focal": {"class": "CompositeRepositoryImpl", "name": "recordAndPublish", "signature": "EventKey recordAndPublish(P publishedEvent) throws EventStoreException, ConcurrentEventException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "publishedEvent", "type": "P"}], "return_type": "EventKey"}, "...
79564911_1340
class SwiftObjectListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try { final AttributedList<Path> children = new AttributedList<Path>(); final int limit = Pref...
final Path container = new Path("test.cyberduck.ch", EnumSet.of(Path.Type.directory, Path.Type.volume)); container.attributes().setRegion("IAD"); final Path placeholder = new SwiftDirectoryFeature(session).mkdir(new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path....
[FOCAL] @Override public AttributedList<Path> SwiftObjectListService.list(Path directory, ListProgressListener listener) [CLASS] class SwiftObjectListService implements ListService [METRICS] loc=45 cc=10 branches=4 loops=2 returns=1 throws=3 nesting=5 [CALLS-EXTERNAL] PreferencesFactory.get().getInteger/1, PreferencesF...
/* static context [FOCAL] @Override public AttributedList<Path> SwiftObjectListService.list(Path directory, ListProgressListener listener) [THROWS-WHEN] SwiftExceptionMappingService when try-body throws [THROWS-WHEN] DefaultIOExceptionMappingService when try-body throws [THROWS-WHEN] SwiftExceptionMappingService when f...
/* static context [FOCAL] @Override public AttributedList<Path> SwiftObjectListService.list(Path directory, ListProgressListener listener) [THROWS-WHEN] SwiftExceptionMappingService when try-body throws [THROWS-WHEN] DefaultIOExceptionMappingService when try-body throws [THROWS-WHEN] SwiftExceptionMappingService when f...
true
ok
{"focal": {"class": "SwiftObjectListService", "name": "list", "signature": "AttributedList<Path> list(Path directory, ListProgressListener listener) throws BackgroundException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "directory", "type": "Path"}, {"name": "listener", "type": "ListProgress...
79602914_10
class PermissionRequestHandler extends RequestHandler { @Nullable public Location getLocation() { if (isPermissionGranted()) { return getRootRequest().device.location; } else { return null; } } protected PermissionRequestHandler(RootRequest rootRequest)...
RootRequest rootRequest = TestObjects.permissionGrantedLocationRequest(true); PermissionRequestHandler permissionRequestHandler = new PermissionRequestHandler(rootRequest) { @Override public RootResponse getResponse() { return new RootResponse(); } ...
[FOCAL] @Nullable public Location PermissionRequestHandler.getLocation() [CLASS] class PermissionRequestHandler extends RequestHandler [METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] boolean isPermissionGranted() [CALLS-EXTERNAL] getRootRequest/0 (inherited) [PATH1] if(isPermission...
/* static context [FOCAL] @Nullable public Location PermissionRequestHandler.getLocation() [PATH1] if(isPermissionGranted())=T -> return getRootRequest().device.location [PATH2] if(isPermissionGranted())=F -> return null [CALLS-INTERNAL] boolean isPermissionGranted() [CALLS-EXTERNAL] getRootRequest/0 (inherited) */
/* static context [FOCAL] @Nullable public Location PermissionRequestHandler.getLocation() [PATH1] if(isPermissionGranted())=T -> return getRootRequest().device.location [PATH2] if(isPermissionGranted())=F -> return null [CALLS-INTERNAL] boolean isPermissionGranted() [CALLS-EXTERNAL] getRootRequest/0 (inherited) */ cla...
true
ok
{"focal": {"class": "PermissionRequestHandler", "name": "getLocation", "signature": "Location getLocation()", "start_line": 3, "modifiers": "@Nullable public", "params": [], "return_type": "Location"}, "class_info": {"name": "PermissionRequestHandler", "kind": "class", "modifiers": "", "superclass": "RequestHandler", "...
79638652_6
class OauthJdbcRepository extends AbstractJdbcRepository implements OauthRepository { @Override public ClientDetails findClientDetails(String clientId) { final String sql = " select * from oauth_client_details where archived = 0 and client_id = ? "; final List<ClientDetails> list = jdbcTemplate...
String clientId = "oaoedd"; final ClientDetails clientDetails = oauthJdbcRepository.findClientDetails(clientId); assertNull(clientDetails); ClientDetails clientDetails1 = new ClientDetails(); clientDetails1.clientId(clientId); clientDetails1.clientSecret("Ole397dde2"); ...
[FOCAL] @Override public ClientDetails OauthJdbcRepository.findClientDetails(String clientId) [CLASS] class OauthJdbcRepository extends AbstractJdbcRepository implements OauthRepository [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] jdbcTemplate.query/3, List<ClientDetails>.isEmpt...
/* static context [FOCAL] @Override public ClientDetails OauthJdbcRepository.findClientDetails(String clientId) [INPUTS] branches=- | result=clientId [COLLABORATORS] field jdbcTemplate query/3 [CALLS-EXTERNAL] jdbcTemplate.query/3, List<ClientDetails>.isEmpty/0, List<ClientDetails>.get/1 */
/* static context [FOCAL] @Override public ClientDetails OauthJdbcRepository.findClientDetails(String clientId) [INPUTS] branches=- | result=clientId [COLLABORATORS] field jdbcTemplate query/3 [CALLS-EXTERNAL] jdbcTemplate.query/3, List<ClientDetails>.isEmpty/0, List<ClientDetails>.get/1 */ class OauthJdbcRepository ex...
true
ok
{"focal": {"class": "OauthJdbcRepository", "name": "findClientDetails", "signature": "ClientDetails findClientDetails(String clientId)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "clientId", "type": "String"}], "return_type": "ClientDetails"}, "class_info": {"name": "OauthJdbcRepository", "k...
79666748_1
class RxCurryingConsumer { public static <A, B> Function<A, Consumer<B>> curry(final BiConsumer<A, B> action) { return new Function<A, Consumer<B>>() { @Override public Consumer<B> apply(final A a) throws Exception { return new Consumer<B>() { @Ov...
Function<Integer, Consumer<Integer>> variable = RxCurryingConsumer .curry(new BiConsumer<Integer, Integer>() { @Override public void accept(Integer first, Integer second) { Assert.assertEquals(5, first + second); ...
[FOCAL] public static Function<A, Consumer<B>> RxCurryingConsumer.curry(BiConsumer<A, B> action) [CLASS] class RxCurryingConsumer [METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] BiConsumer<A, B>.accept/2 [NEW] Function<A, Consumer<B>>, Consumer<B> [INPUTS] branches=- | result=acti...
/* static context [FOCAL] public static Function<A, Consumer<B>> RxCurryingConsumer.curry(BiConsumer<A, B> action) [INPUTS] branches=- | result=action [COLLABORATORS] param action:BiConsumer<A, B> accept/2 [NEW] Function<A, Consumer<B>>, Consumer<B> [CALLS-EXTERNAL] BiConsumer<A, B>.accept/2 */
/* static context [FOCAL] public static Function<A, Consumer<B>> RxCurryingConsumer.curry(BiConsumer<A, B> action) [INPUTS] branches=- | result=action [COLLABORATORS] param action:BiConsumer<A, B> accept/2 [NEW] Function<A, Consumer<B>>, Consumer<B> [CALLS-EXTERNAL] BiConsumer<A, B>.accept/2 */ class RxCurryingConsumer...
true
ok
{"focal": {"class": "RxCurryingConsumer", "name": "curry", "signature": "Function<A, Consumer<B>> curry(BiConsumer<A, B> action)", "start_line": 3, "modifiers": "public static", "params": [{"name": "action", "type": "BiConsumer<A, B>"}], "return_type": "Function<A, Consumer<B>>"}, "class_info": {"name": "RxCurryingCons...