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
53330030_1
class StdSchedulerFactory implements SchedulerFactory { static Properties overrideWithSysProps(Properties props, Logger log) { Properties sysProps = null; try { sysProps = System.getProperties(); } catch (AccessControlException e) { log.warn( "Skippin...
Properties p = new Properties(); p.setProperty("nonsense1", "hello1"); p.setProperty("nonsense2", "hello2"); System.setProperty("nonsense1", "boo1"); String osName = System.getProperty("os.name"); Properties q = StdSchedulerFactory.overrideWithSysProps(p, NOPLogger.NOP_LOGGER); assert...
[FOCAL] static Properties StdSchedulerFactory.overrideWithSysProps(Properties props, Logger log) [CLASS] class StdSchedulerFactory implements SchedulerFactory [METRICS] loc=31 cc=5 branches=2 loops=1 returns=1 throws=0 nesting=3 [CALLS-EXTERNAL] System.getProperties/0, Logger.warn/2, Properties.propertyNames/0, Enumera...
/* static context [FOCAL] static Properties StdSchedulerFactory.overrideWithSysProps(Properties props, Logger log) [PATH1] try-body throws -> if(sysProps != null)=T -> while(en.hasMoreElements())=T -> if(name instanceof String && value instanceof String)=T -> exit loop -> return props [PATH2] if(sysProps != null)=F -> ...
/* static context [FOCAL] static Properties StdSchedulerFactory.overrideWithSysProps(Properties props, Logger log) [PATH1] try-body throws -> if(sysProps != null)=T -> while(en.hasMoreElements())=T -> if(name instanceof String && value instanceof String)=T -> exit loop -> return props [PATH2] if(sysProps != null)=F -> ...
true
ok
{"focal": {"class": "StdSchedulerFactory", "name": "overrideWithSysProps", "signature": "Properties overrideWithSysProps(Properties props, Logger log)", "start_line": 3, "modifiers": "static", "params": [{"name": "props", "type": "Properties"}, {"name": "log", "type": "Logger"}], "return_type": "Properties"}, "class_in...
53336998_2
class GetPeople extends RosieUseCase { public PaginatedCollection<Person> getAllPeopleInCache() { Collection<Person> allPeople; try { allPeople = peopleRepository.getAll(ReadPolicy.CACHE_ONLY); } catch (Exception e) { allPeople = new ArrayList<>(); } ...
//given Collection<Person> nonEmptyCacheList = new ArrayList<>(); nonEmptyCacheList.add(new Person(PERSON_NAME, PERSON_GENDER, PERSON_BIRTH_YEAR, PERSON_URL)); PaginatedCollection<Person> expectedPeopleList = PaginatedCollectionUtils.createPaginatedCollection( nonEmptyCac...
[FOCAL] public PaginatedCollection<Person> GetPeople.getAllPeopleInCache() [CLASS] class GetPeople extends RosieUseCase [METRICS] loc=19 cc=3 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] PeopleRepository.getAll/1, Page.withOffsetAndLimit/2, Collection<Person>.size/0, PaginatedCollection<Person>.setP...
/* static context [FOCAL] public PaginatedCollection<Person> GetPeople.getAllPeopleInCache() [PATH1] try-body throws -> if(allPeople == null)=T -> return allPeoplePaginated [PATH2] if(allPeople == null)=F -> return allPeoplePaginated [INPUTS] branches=peopleRepository | result=peopleRepository [COLLABORATORS] field peo...
/* static context [FOCAL] public PaginatedCollection<Person> GetPeople.getAllPeopleInCache() [PATH1] try-body throws -> if(allPeople == null)=T -> return allPeoplePaginated [PATH2] if(allPeople == null)=F -> return allPeoplePaginated [INPUTS] branches=peopleRepository | result=peopleRepository [COLLABORATORS] field peo...
true
ok
{"focal": {"class": "GetPeople", "name": "getAllPeopleInCache", "signature": "PaginatedCollection<Person> getAllPeopleInCache()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "PaginatedCollection<Person>"}, "class_info": {"name": "GetPeople", "kind": "class", "modifiers": "", "superclass": "Rosi...
53354223_6
class InternalIdToLongIterator implements EdgeIterator, ReusableInternalIdToLongIterator { public InternalIdToLongIterator(LongToInternalIntBiMap nodesIndexMap, EdgeTypeMask edgeTypeMask) { this.nodesIndexMap = nodesIndexMap; this.edgeTypeMask = edgeTypeMask; this.currentNodeId = 0; } public Intern...
LongToInternalIntBiMap nodesToIndexBiMap = new ArrayBasedLongToInternalIntBiMap(10, 0.5, -1, -1L, nullStatsReceiver); int n = 7; int[] expectedIndices = new int[n]; long[] expectedEntries = new long[n]; for (int i = 0; i < n; i++) { expectedIndices[i] = nodesToIndexBiMap.put(i); ...
[FOCAL] public InternalIdToLongIterator.InternalIdToLongIterator(LongToInternalIntBiMap nodesIndexMap, EdgeTypeMask edgeTypeMask) [CLASS] class InternalIdToLongIterator implements EdgeIterator, ReusableInternalIdToLongIterator [METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [FIELDS] write=currentNo...
/* static context [FOCAL] public InternalIdToLongIterator.InternalIdToLongIterator(LongToInternalIntBiMap nodesIndexMap, EdgeTypeMask edgeTypeMask) [STATE] currentNodeId, edgeTypeMask, nodesIndexMap [FIELDS] write=currentNodeId, edgeTypeMask, nodesIndexMap */
/* static context [FOCAL] public InternalIdToLongIterator.InternalIdToLongIterator(LongToInternalIntBiMap nodesIndexMap, EdgeTypeMask edgeTypeMask) [STATE] currentNodeId, edgeTypeMask, nodesIndexMap [FIELDS] write=currentNodeId, edgeTypeMask, nodesIndexMap */ class InternalIdToLongIterator implements EdgeIterator, Reus...
true
ok
{"focal": {"class": "InternalIdToLongIterator", "name": "InternalIdToLongIterator", "signature": "InternalIdToLongIterator(LongToInternalIntBiMap nodesIndexMap, EdgeTypeMask edgeTypeMask)", "start_line": 3, "modifiers": "public", "params": [{"name": "nodesIndexMap", "type": "LongToInternalIntBiMap"}, {"name": "edgeType...
53367115_69
class GraphResourceRepository extends GraphGenericRepository<ResourceEntity> implements ResourceRepository, ResourceHierarchicalRepository { @Override public <S extends ResourceEntity> S findOne(final Example<S> example) { throw new UnsupportedOperationException(MESSAGE); } @Override public Re...
List<ResourceEntity> resourceEntities = new ArrayList<>(); ResourceEntity resourceEntity1 = persistRandomResourcetoZone1AndAssert(); Long resourceId1 = resourceEntity1.getId(); resourceEntities.add(resourceEntity1); ResourceEntity resourceEntity2 = persistRandomResourcetoZone1A...
[FOCAL] @Override public S GraphResourceRepository.findOne(Example<S> example) [CLASS] class GraphResourceRepository extends GraphGenericRepository<ResourceEntity> implements ResourceRepository, ResourceHierarchicalRepository [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=1 nesting=0 [NEW] UnsupportedOperatio...
/* static context [FOCAL] @Override public S GraphResourceRepository.findOne(Example<S> example) [THROWS-WHEN] UnsupportedOperationException when always [INPUTS] branches=- | result=- | unused=example [EXCEPTIONS] throws UnsupportedOperationException [NEW] UnsupportedOperationException */
/* static context [FOCAL] @Override public S GraphResourceRepository.findOne(Example<S> example) [THROWS-WHEN] UnsupportedOperationException when always [INPUTS] branches=- | result=- | unused=example [EXCEPTIONS] throws UnsupportedOperationException [NEW] UnsupportedOperationException */ class GraphResourceRepository ...
true
ok
{"focal": {"class": "GraphResourceRepository", "name": "findOne", "signature": "S findOne(Example<S> example)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "example", "type": "Example<S>"}], "return_type": "S"}, "class_info": {"name": "GraphResourceRepository", "kind": "class", "modifiers": ""...
53430304_5
class RealWhorlwind extends Whorlwind { @Override public Observable<ReadResult> read(@NonNull String name) { return Observable.create(new FingerprintAuthOnSubscribe(fingerprintManager, storage, name, // readerScanning, dataLock, this)); } RealWhorlwind(Context context, FingerprintManager fingerpri...
shadowContext.grantPermissions(USE_FINGERPRINT); when(fingerprintManager.isHardwareDetected()).thenReturn(true); when(fingerprintManager.hasEnrolledFingerprints()).thenReturn(true); Observable<ReadResult> read = whorlwind.read("a"); shadowContext.denyPermissions(USE_FINGERPRINT); try { r...
[FOCAL] @Override public Observable<ReadResult> RealWhorlwind.read(String name) [CLASS] class RealWhorlwind extends Whorlwind [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Observable.create/1 [NEW] FingerprintAuthOnSubscribe [FIELDS] read=fingerprintManager:FingerprintManager, st...
/* static context [FOCAL] @Override public Observable<ReadResult> RealWhorlwind.read(String name) [INPUTS] branches=- | result=name, fingerprintManager, storage [FIELDS] read=fingerprintManager:FingerprintManager, storage:Storage [NEW] FingerprintAuthOnSubscribe [CALLS-EXTERNAL] Observable.create/1 */
/* static context [FOCAL] @Override public Observable<ReadResult> RealWhorlwind.read(String name) [INPUTS] branches=- | result=name, fingerprintManager, storage [FIELDS] read=fingerprintManager:FingerprintManager, storage:Storage [NEW] FingerprintAuthOnSubscribe [CALLS-EXTERNAL] Observable.create/1 */ class RealWhorlwi...
true
ok
{"focal": {"class": "RealWhorlwind", "name": "read", "signature": "Observable<ReadResult> read(String name)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "name", "type": "String"}], "return_type": "Observable<ReadResult>"}, "class_info": {"name": "RealWhorlwind", "kind": "class", "modifiers": ...
53431695_1
class Utils { public static float getHue(float value, float min, float max, int minColor, int maxColor) { float hue; if (min == max || value <= min) { hue = minColor; } else if (value > max) { hue = maxColor; } else { float colorValue = (value - m...
float hue = Utils.getHue(0, 0, 100, 120, 360); Assert.assertEquals(hue, 120, 0.1); hue = Utils.getHue(4, 1, 7, 90, 180); Assert.assertEquals(hue, 135, 0.1); } }
[FOCAL] public static float Utils.getHue(float value, float min, float max, int minColor, int maxColor) [CLASS] class Utils [METRICS] loc=18 cc=4 branches=3 loops=0 returns=1 throws=0 nesting=2 [PATH1] if(min == max || value <= min)=F -> if(value > max)=T -> if(result >= 360.0 || result < 0)=T -> return result [PATH2] ...
/* static context [FOCAL] public static float Utils.getHue(float value, float min, float max, int minColor, int maxColor) [PATH1] if(min == max || value <= min)=F -> if(value > max)=T -> if(result >= 360.0 || result < 0)=T -> return result [PATH2] if(min == max || value <= min)=T -> if(result >= 360.0 || result < 0)=F ...
/* static context [FOCAL] public static float Utils.getHue(float value, float min, float max, int minColor, int maxColor) [PATH1] if(min == max || value <= min)=F -> if(value > max)=T -> if(result >= 360.0 || result < 0)=T -> return result [PATH2] if(min == max || value <= min)=T -> if(result >= 360.0 || result < 0)=F ...
true
ok
{"focal": {"class": "Utils", "name": "getHue", "signature": "float getHue(float value, float min, float max, int minColor, int maxColor)", "start_line": 3, "modifiers": "public static", "params": [{"name": "value", "type": "float"}, {"name": "min", "type": "float"}, {"name": "max", "type": "float"}, {"name": "minColor"...
53478785_2
class LocalBroadcaster implements DownloadListener { public void onDownloadEnd(String torrentFile, int downloadState) { broadcast(DownloadEndBroadcast.createIntent(torrentFile, downloadState)); } public LocalBroadcaster(Context context); public void onDownloadStart(String torrentFile); p...
final String torrentFile = "file"; final int downloadState = 42; LocalBroadcaster localBroadcaster = new LocalBroadcaster(RuntimeEnvironment.application); localBroadcaster.onDownloadEnd(torrentFile, downloadState); LocalBroadcastManager localBroadcastManager = LocalBroadcastManag...
[FOCAL] public void LocalBroadcaster.onDownloadEnd(String torrentFile, int downloadState) [CLASS] class LocalBroadcaster implements DownloadListener [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void broadcast(Intent intent) [CALLS-EXTERNAL] DownloadEndBroadcast.createIntent/2 [D...
/* static context [FOCAL] public void LocalBroadcaster.onDownloadEnd(String torrentFile, int downloadState) [CALLS-INTERNAL] void broadcast(Intent intent) [CALLS-EXTERNAL] DownloadEndBroadcast.createIntent/2 */
/* static context [FOCAL] public void LocalBroadcaster.onDownloadEnd(String torrentFile, int downloadState) [CALLS-INTERNAL] void broadcast(Intent intent) [CALLS-EXTERNAL] DownloadEndBroadcast.createIntent/2 */ class LocalBroadcaster implements DownloadListener { public void onDownloadEnd(String torrentFile, int d...
true
ok
{"focal": {"class": "LocalBroadcaster", "name": "onDownloadEnd", "signature": "void onDownloadEnd(String torrentFile, int downloadState)", "start_line": 3, "modifiers": "public", "params": [{"name": "torrentFile", "type": "String"}, {"name": "downloadState", "type": "int"}], "return_type": "void"}, "class_info": {"name...
53502006_0
class TemplateInjector { public String injectToTemplate(String template, Object scope) { Mustache mustache = mustacheFactoryUnescapeHtml.compile(new StringReader(template), "template"); StringWriter result = new StringWriter(); try { mustache.execute(result, new Object[] { scop...
String varName = "testVar"; String varValue = "testVarValue"; String template = String.format("{{#lowercase}}{{%s}}{{/lowercase}}", varName); String result = templateInjector.injectToTemplate(template, singletonMap(varName, varValue)); assertThat(result).isEqualTo(varValue.toLow...
[FOCAL] public String TemplateInjector.injectToTemplate(String template, Object scope) [CLASS] class TemplateInjector [METRICS] loc=13 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] mustacheFactoryUnescapeHtml.compile/2, mustache.execute(result, new Object[] { scope, singletonM....flush/0, Mustac...
/* static context [FOCAL] public String TemplateInjector.injectToTemplate(String template, Object scope) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException(msg, e) [PATH2] return result.toString() [INPUTS] branches=- | result=scope, template [COLLABORATORS] field m...
/* static context [FOCAL] public String TemplateInjector.injectToTemplate(String template, Object scope) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException(msg, e) [PATH2] return result.toString() [INPUTS] branches=- | result=scope, template [COLLABORATORS] field m...
true
ok
{"focal": {"class": "TemplateInjector", "name": "injectToTemplate", "signature": "String injectToTemplate(String template, Object scope)", "start_line": 3, "modifiers": "public", "params": [{"name": "template", "type": "String"}, {"name": "scope", "type": "Object"}], "return_type": "String"}, "class_info": {"name": "Te...
53510819_2
class RxWear { public void resetDefaultTimeout() { timeoutTime = null; timeoutUnit = null; } public RxWear(@NonNull Context ctx); public void setDefaultTimeout(long time, @NonNull TimeUnit timeUnit); public Completable checkConnection(); public Single<GoogleApiClient> getWear...
rxWear.setDefaultTimeout(TIMEOUT_TIME, TIMEOUT_TIMEUNIT); rxWear.resetDefaultTimeout(); assertNull(rxWear.timeoutTime); assertNull(rxWear.timeoutUnit); } }
[FOCAL] public void RxWear.resetDefaultTimeout() [CLASS] class RxWear [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CLASS-MEMBERS] RxWear(Context ctx); void setDefaultTimeout(long time, TimeUnit timeUnit); Completable checkConnection(); Single<GoogleApiClient> getWearableClient(); Capability cap...
/* static context [FOCAL] public void RxWear.resetDefaultTimeout() */
/* static context [FOCAL] public void RxWear.resetDefaultTimeout() */ class RxWear { public void resetDefaultTimeout() { timeoutTime = null; timeoutUnit = null; } public RxWear(@NonNull Context ctx); public void setDefaultTimeout(long time, @NonNull TimeUnit timeUnit); public Com...
true
ok
{"focal": {"class": "RxWear", "name": "resetDefaultTimeout", "signature": "void resetDefaultTimeout()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "RxWear", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"nam...
53511222_34
class RecentEmojiManager implements RecentEmoji { @Override @SuppressWarnings({ "PMD.AvoidDeeplyNestedIfStmts", "checkstyle:nestedifdepth" }) @NonNull public Collection<Emoji> getRecentEmojis() { if (emojiList.size() == 0) { final String savedRecentEmojis = sharedPreferences.getString(RECENT_EMOJIS, ""); ...
assertThat(recentEmojiManager.getRecentEmojis()).isEmpty(); } }
[FOCAL] @Override @SuppressWarnings({ "PMD.AvoidDeeplyNestedIfStmts", "checkstyle:nestedifdepth" }) @NonNull public Collection<Emoji> RecentEmojiManager.getRecentEmojis() [CLASS] class RecentEmojiManager implements RecentEmoji [METRICS] loc=30 cc=6 branches=4 loops=1 returns=1 throws=0 nesting=5 [CALLS-EXTERNAL] emojiL...
/* static context [FOCAL] @Override @SuppressWarnings({ "PMD.AvoidDeeplyNestedIfStmts", "checkstyle:nestedifdepth" }) @NonNull public Collection<Emoji> RecentEmojiManager.getRecentEmojis() [PATH1] if(emojiList.size() == 0)=T -> if(savedRecentEmojis.length() > 0)=T -> while(stringTokenizer.hasMoreTokens())=T -> if(parts...
/* static context [FOCAL] @Override @SuppressWarnings({ "PMD.AvoidDeeplyNestedIfStmts", "checkstyle:nestedifdepth" }) @NonNull public Collection<Emoji> RecentEmojiManager.getRecentEmojis() [PATH1] if(emojiList.size() == 0)=T -> if(savedRecentEmojis.length() > 0)=T -> while(stringTokenizer.hasMoreTokens())=T -> if(parts...
true
ok
{"focal": {"class": "RecentEmojiManager", "name": "getRecentEmojis", "signature": "Collection<Emoji> getRecentEmojis()", "start_line": 3, "modifiers": "@Override @SuppressWarnings({ \"PMD.AvoidDeeplyNestedIfStmts\", \"checkstyle:nestedifdepth\" }) @NonNull public", "params": [], "return_type": "Collection<Emoji>"}, "cl...
53561724_0
class PostgreSQLJournal extends AbstractService implements Journal { @SneakyThrows @Override public <T extends Entity> Optional<T> get(UUID uuid) { Optional<T> result; Connection connection = dataSource.getConnection(); refreshConnectionRegistry(connection); PreparedStatemen...
assertEquals(serializationResult(TestClass.builder().pByte(Byte.MIN_VALUE).build()).pByte(), Byte.MIN_VALUE); assertEquals(serializationResult(TestClass.builder().pByte(Byte.MAX_VALUE).build()).pByte(), Byte.MAX_VALUE); assertEquals((byte)serializationResult(TestClass.builder().oByte(Byte.MIN_V...
[FOCAL] @SneakyThrows @Override public Optional<T> PostgreSQLJournal.get(UUID uuid) [CLASS] class PostgreSQLJournal extends AbstractService implements Journal [METRICS] loc=37 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] Layout getLayout(Class<? extends Entity> klass) [CALLS-EXTERNAL] dataSourc...
class PostgreSQLJournal extends AbstractService implements Journal { @SneakyThrows @Override public <T extends Entity> Optional<T> get(UUID uuid) { Optional<T> result; Connection connection = dataSource.getConnection(); refreshConnectionRegistry(connection); PreparedStatemen...
false
ok
{"focal": {"class": "PostgreSQLJournal", "name": "get", "signature": "Optional<T> get(UUID uuid)", "start_line": 3, "modifiers": "@SneakyThrows @Override public", "params": [{"name": "uuid", "type": "UUID"}], "return_type": "Optional<T>"}, "class_info": {"name": "PostgreSQLJournal", "kind": "class", "modifiers": "", "s...
53566183_5
class Functions { public static <T> Function<T,Integer> unpartitioned() { return zero(); } @SuppressWarnings("unchecked") public static UnaryOperator<T> identity(); @SuppressWarnings("unchecked") public static Function<T,Integer> zero(); public static void closeFunction(Object function); ...
String s = "hello"; assertEquals(Integer.valueOf(0), unpartitioned().apply(s)); Integer i = 42; assertEquals(Integer.valueOf(0), unpartitioned().apply(i)); Object o = new Object(); assertEquals(Integer.valueOf(0), unpartitioned().apply(o)); } }
[FOCAL] public static Function<T,Integer> Functions.unpartitioned() [CLASS] class Functions [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Function<T,Integer> zero() [CLASS-MEMBERS] UnaryOperator<T> identity(); Function<T,Integer> zero(); void closeFunction(Object function); Funct...
/* static context [FOCAL] public static Function<T,Integer> Functions.unpartitioned() [CALLS-INTERNAL] Function<T,Integer> zero() */
/* static context [FOCAL] public static Function<T,Integer> Functions.unpartitioned() [CALLS-INTERNAL] Function<T,Integer> zero() */ class Functions { public static <T> Function<T,Integer> unpartitioned() { return zero(); } @SuppressWarnings("unchecked") public static UnaryOperator<T> identity(); ...
true
ok
{"focal": {"class": "Functions", "name": "unpartitioned", "signature": "Function<T,Integer> unpartitioned()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Function<T,Integer>"}, "class_info": {"name": "Functions", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, ...
53590096_30
class DateUtils { public static String dateToStringWithFormat(Date dateToString, String dateFormat) { if (dateToString != null) { DateFormat simpleDateFormat = new SimpleDateFormat(dateFormat); return simpleDateFormat.format(dateToString); } else { return null; } } private DateUti...
String date = DateUtils.dateToStringWithFormat(null, DateFormatConstants.DATE_FORMAT_TIME); assertNull(date); } }
[FOCAL] public static String DateUtils.dateToStringWithFormat(Date dateToString, String dateFormat) [CLASS] class DateUtils [METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] DateFormat.format/1 [NEW] SimpleDateFormat [PATH1] if(dateToString != null)=T -> return simpleDateFormat.forma...
/* static context [FOCAL] public static String DateUtils.dateToStringWithFormat(Date dateToString, String dateFormat) [PATH1] if(dateToString != null)=T -> return simpleDateFormat.format(dateToString) [PATH2] if(dateToString != null)=F -> return null [INPUTS] branches=dateToString | result=dateFormat, dateToString [NEW...
/* static context [FOCAL] public static String DateUtils.dateToStringWithFormat(Date dateToString, String dateFormat) [PATH1] if(dateToString != null)=T -> return simpleDateFormat.format(dateToString) [PATH2] if(dateToString != null)=F -> return null [INPUTS] branches=dateToString | result=dateFormat, dateToString [NEW...
true
ok
{"focal": {"class": "DateUtils", "name": "dateToStringWithFormat", "signature": "String dateToStringWithFormat(Date dateToString, String dateFormat)", "start_line": 3, "modifiers": "public static", "params": [{"name": "dateToString", "type": "Date"}, {"name": "dateFormat", "type": "String"}], "return_type": "String"}, ...
53592496_0
class GetImageFragment extends WolmoFragment<T> { protected void selectImageFromGallery( @NonNull final OnImageReturnCallback onImageReturnCallback) { permissionManager.requestPermission(this, new PermissionListener() { @Override public void onPermissionsGranted() { ...
GetImageFragment.OnImageReturnCallback callbackMock = mock(GetImageFragment.OnImageReturnCallback.class); doAnswer(invocation -> { ((PermissionListener) invocation.getArgument(1)).onPermissionsGranted(); return null; }).when(mPermissionManagerMock).requestPermission(any(...
[FOCAL] protected void GetImageFragment.selectImageFromGallery(OnImageReturnCallback onImageReturnCallback) [CLASS] class GetImageFragment extends WolmoFragment<T> [METRICS] loc=17 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] int galleryErrorResId() [CALLS-EXTERNAL] permissionManager.requestPer...
/* static context [FOCAL] protected void GetImageFragment.selectImageFromGallery(OnImageReturnCallback onImageReturnCallback) [COLLABORATORS] field permissionManager requestPermission/3; field mImageProvider getImageFromGallery/3; param onImageReturnCallback:OnImageReturnCallback error/1 [CALLS-INTERNAL] int galleryErr...
/* static context [FOCAL] protected void GetImageFragment.selectImageFromGallery(OnImageReturnCallback onImageReturnCallback) [COLLABORATORS] field permissionManager requestPermission/3; field mImageProvider getImageFromGallery/3; param onImageReturnCallback:OnImageReturnCallback error/1 [CALLS-INTERNAL] int galleryErr...
true
ok
{"focal": {"class": "GetImageFragment", "name": "selectImageFromGallery", "signature": "void selectImageFromGallery(OnImageReturnCallback onImageReturnCallback)", "start_line": 3, "modifiers": "protected", "params": [{"name": "onImageReturnCallback", "type": "OnImageReturnCallback"}], "return_type": "void"}, "class_inf...
53645841_12
class SendMessageHelper { static long getNextSendingInMillis(Record record, long currentTimeMillis) { int delta = Const.MILLIS_PER_MINUTE; // используется, чтобы избежать повторной отправки в одно время. int repeatType = record.getRepeatType(); Calendar calendar = Calendar.getInstance(); ...
mRecord.setRepeatType(Record.REPEAT_TYPE_DAYS_IN_WEEK); mRecord.setDayOfWeek(mTodayOfWeek, false); mRecord.setDayOfWeek(Calendar.WEDNESDAY, true); mRecord.setHour(12); mRecord.setMinute(15); long sendingInMillis = SendMessageHelper.getNextSendingInMillis(mRecord, mTodayT...
[FOCAL] static long SendMessageHelper.getNextSendingInMillis(Record record, long currentTimeMillis) [CLASS] class SendMessageHelper [METRICS] loc=50 cc=9 branches=3 loops=5 returns=1 throws=0 nesting=3 [CALLS-EXTERNAL] Record.getRepeatType/0, Calendar.getInstance/0, Calendar.set/2, Record.getHour/0, Record.getMinute/0,...
/* static context [FOCAL] static long SendMessageHelper.getNextSendingInMillis(Record record, long currentTimeMillis) [PATH1] if(repeatType == Record.REPEAT_TYPE_HOURS_IN_DAY || repeatType == Record.REPEAT_TYPE_DAYS_IN_WEEK)=T -> while(timeInMillis < currentTimeMillis)=T -> exit loop -> while(timeInMillis - interval > ...
/* static context [FOCAL] static long SendMessageHelper.getNextSendingInMillis(Record record, long currentTimeMillis) [PATH1] if(repeatType == Record.REPEAT_TYPE_HOURS_IN_DAY || repeatType == Record.REPEAT_TYPE_DAYS_IN_WEEK)=T -> while(timeInMillis < currentTimeMillis)=T -> exit loop -> while(timeInMillis - interval > ...
true
ok
{"focal": {"class": "SendMessageHelper", "name": "getNextSendingInMillis", "signature": "long getNextSendingInMillis(Record record, long currentTimeMillis)", "start_line": 3, "modifiers": "static", "params": [{"name": "record", "type": "Record"}, {"name": "currentTimeMillis", "type": "long"}], "return_type": "long"}, "...
53684862_11
class BitmapUtils { public static void recycleBitmap(Bitmap bitmap){ if (bitmap != null && !bitmap.isRecycled()) bitmap.recycle(); } private BitmapUtils(); public static void recycleBitmapFromImageView(ImageView imageView); public static byte[] bitmapToBytes(Bitmap bitmap); ...
try{ Bitmap bitmap = null; BitmapUtils.recycleBitmap(bitmap); }catch(Exception e){ fail("no exception should be thrown"); } } }
[FOCAL] public static void BitmapUtils.recycleBitmap(Bitmap bitmap) [CLASS] class BitmapUtils [METRICS] loc=4 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] Bitmap.isRecycled/0, Bitmap.recycle/0 [PATH1] if(bitmap != null && !bitmap.isRecycled())=T [PATH2] if(bitmap != null && !bitmap.isRecycled()...
/* static context [FOCAL] public static void BitmapUtils.recycleBitmap(Bitmap bitmap) [PATH1] if(bitmap != null && !bitmap.isRecycled())=T [PATH2] if(bitmap != null && !bitmap.isRecycled())=F [INPUTS] branches=bitmap | result=- [COLLABORATORS] param bitmap:Bitmap isRecycled/0,recycle/0 [CALLS-EXTERNAL] Bitmap.isRecycle...
/* static context [FOCAL] public static void BitmapUtils.recycleBitmap(Bitmap bitmap) [PATH1] if(bitmap != null && !bitmap.isRecycled())=T [PATH2] if(bitmap != null && !bitmap.isRecycled())=F [INPUTS] branches=bitmap | result=- [COLLABORATORS] param bitmap:Bitmap isRecycled/0,recycle/0 [CALLS-EXTERNAL] Bitmap.isRecycle...
true
ok
{"focal": {"class": "BitmapUtils", "name": "recycleBitmap", "signature": "void recycleBitmap(Bitmap bitmap)", "start_line": 3, "modifiers": "public static", "params": [{"name": "bitmap", "type": "Bitmap"}], "return_type": "void"}, "class_info": {"name": "BitmapUtils", "kind": "class", "modifiers": "", "superclass": nul...
53690584_2
class ExpressionTokenizer { protected boolean isQuoted(String str, int pos) { int start = str.indexOf("\""); if(start < 0 || pos < start) { return false; } int end = str.indexOf("\"", start + 1); if(end < 0) { return false; } if(pos <=...
String str = "01234\"67890"; ExpressionTokenizer t = new ExpressionTokenizer(str); assertFalse(t.isQuoted(str, 11)); assertFalse(t.isQuoted(str, 15)); } }
[FOCAL] protected boolean ExpressionTokenizer.isQuoted(String str, int pos) [CLASS] class ExpressionTokenizer [METRICS] loc=15 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=1 [CALLS-EXTERNAL] String.indexOf/1, String.indexOf/2, isQuoted/2 (inherited), String.substring/1 [PATH1] if(start < 0 || pos < start)=F -> if...
/* static context [FOCAL] protected boolean ExpressionTokenizer.isQuoted(String str, int pos) [PATH1] if(start < 0 || pos < start)=F -> if(end < 0)=F -> if(pos <= end)=T -> return true [PATH2] if(start < 0 || pos < start)=T -> return false [PATH3] if(start < 0 || pos < start)=F -> if(end < 0)=F -> if(pos <= end)=F -> r...
/* static context [FOCAL] protected boolean ExpressionTokenizer.isQuoted(String str, int pos) [PATH1] if(start < 0 || pos < start)=F -> if(end < 0)=F -> if(pos <= end)=T -> return true [PATH2] if(start < 0 || pos < start)=T -> return false [PATH3] if(start < 0 || pos < start)=F -> if(end < 0)=F -> if(pos <= end)=F -> r...
true
ok
{"focal": {"class": "ExpressionTokenizer", "name": "isQuoted", "signature": "boolean isQuoted(String str, int pos)", "start_line": 3, "modifiers": "protected", "params": [{"name": "str", "type": "String"}, {"name": "pos", "type": "int"}], "return_type": "boolean"}, "class_info": {"name": "ExpressionTokenizer", "kind": ...
53691181_2
class ScrubGestureDetector implements View.OnTouchListener { @Override public boolean onTouch(View v, MotionEvent event) { if (!enabled) return false; final float x = event.getX(); final float y = event.getY(); switch (event.getActionMasked()) { case MotionEvent.ACT...
final long downTime = 0; // make just under the timeout final long moveTime = ScrubGestureDetector.LONG_PRESS_TIMEOUT_MS - 1; // make just over the touch-slop final float scrubX = 9, scrubY = 9; final MotionEvent down = getMotionEvent(MotionEvent.ACTION_DOWN, 0, 0, 0, 0);...
[FOCAL] @Override public boolean ScrubGestureDetector.onTouch(View v, MotionEvent event) [CLASS] class ScrubGestureDetector implements View.OnTouchListener [METRICS] loc=44 cc=8 branches=4 loops=0 returns=6 throws=0 nesting=3 [CALLS-EXTERNAL] MotionEvent.getX/0, MotionEvent.getY/0, MotionEvent.getActionMasked/0, Handle...
/* static context [FOCAL] @Override public boolean ScrubGestureDetector.onTouch(View v, MotionEvent event) [PATH1] if(!enabled)=F -> switch(event.getActionMasked())=case MotionEvent.ACTION_MOVE -> if(timeDelta >= LONG_PRESS_TIMEOUT_MS)=F -> if(deltaX >= touchSlop || deltaY >= touchSlop)=T -> return false [PATH2] if(!en...
/* static context [FOCAL] @Override public boolean ScrubGestureDetector.onTouch(View v, MotionEvent event) [PATH1] if(!enabled)=F -> switch(event.getActionMasked())=case MotionEvent.ACTION_MOVE -> if(timeDelta >= LONG_PRESS_TIMEOUT_MS)=F -> if(deltaX >= touchSlop || deltaY >= touchSlop)=T -> return false [PATH2] if(!en...
true
ok
{"focal": {"class": "ScrubGestureDetector", "name": "onTouch", "signature": "boolean onTouch(View v, MotionEvent event)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "v", "type": "View"}, {"name": "event", "type": "MotionEvent"}], "return_type": "boolean"}, "class_info": {"name": "ScrubGesture...
53703548_16
class AuthenticationProviderConfigurer extends SecurityConfigurerAdapter<Void, ServiceProviderBuilder> { @Override public void init(ServiceProviderBuilder builder) throws Exception { authenticationProviderBean = builder.getSharedObject(SAMLAuthenticationProvider.class); config = builder.getShar...
AuthenticationProviderConfigurer configurer = new AuthenticationProviderConfigurer(); configurer.init(builder); verify(builder).getSharedObject(eq(SAMLAuthenticationProvider.class)); verify(builder).getSharedObject(eq(SAMLSSOProperties.class)); } }
[FOCAL] @Override public void AuthenticationProviderConfigurer.init(ServiceProviderBuilder builder) [CLASS] class AuthenticationProviderConfigurer extends SecurityConfigurerAdapter<Void, ServiceProviderBuilder> [METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] ServiceProviderBuilder....
/* static context [FOCAL] @Override public void AuthenticationProviderConfigurer.init(ServiceProviderBuilder builder) [COLLABORATORS] param builder:ServiceProviderBuilder getSharedObject/1 [EXCEPTIONS] declares Exception [CALLS-EXTERNAL] ServiceProviderBuilder.getSharedObject/1, builder.getSharedObject(SAMLSSOPropertie...
/* static context [FOCAL] @Override public void AuthenticationProviderConfigurer.init(ServiceProviderBuilder builder) [COLLABORATORS] param builder:ServiceProviderBuilder getSharedObject/1 [EXCEPTIONS] declares Exception [CALLS-EXTERNAL] ServiceProviderBuilder.getSharedObject/1, builder.getSharedObject(SAMLSSOPropertie...
true
ok
{"focal": {"class": "AuthenticationProviderConfigurer", "name": "init", "signature": "void init(ServiceProviderBuilder builder) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "builder", "type": "ServiceProviderBuilder"}], "return_type": "void"}, "class_info": {"name": "Authenti...
53723623_0
class DefaultErrorBundle implements ErrorBundle { @Override public String getErrorMessage() { return (exception == null) ? DEFAULT_ERROR_MSG : this.exception.getMessage(); } public DefaultErrorBundle(Throwable exception); @Override public Throwable getException(); private DefaultErrorBundle defaultEr...
String message = "a message"; when(mockException.getMessage()).thenReturn(message); String result = defaultErrorBundle.getErrorMessage(); Assert.assertEquals(message, result); verify(mockException).getMessage(); } }
[FOCAL] @Override public String DefaultErrorBundle.getErrorMessage() [CLASS] class DefaultErrorBundle implements ErrorBundle [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] this.exception.getMessage/0 [FIELDS] read=exception [COLLABORATORS] field exception getMessage/0 [CLASS-MEMBE...
/* static context [FOCAL] @Override public String DefaultErrorBundle.getErrorMessage() [COLLABORATORS] field exception getMessage/0 [FIELDS] read=exception [CALLS-EXTERNAL] this.exception.getMessage/0 */
/* static context [FOCAL] @Override public String DefaultErrorBundle.getErrorMessage() [COLLABORATORS] field exception getMessage/0 [FIELDS] read=exception [CALLS-EXTERNAL] this.exception.getMessage/0 */ class DefaultErrorBundle implements ErrorBundle { @Override public String getErrorMessage() { return (excepti...
true
ok
{"focal": {"class": "DefaultErrorBundle", "name": "getErrorMessage", "signature": "String getErrorMessage()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "DefaultErrorBundle", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "ErrorB...
53726669_15
class PasswordEditText extends AppCompatEditText { public void togglePasswordVisibility() { setPasswordVisible(!passwordVisible); } public PasswordEditText(Context context); public PasswordEditText(Context context, AttributeSet attrs); public PasswordEditText(Context context, AttributeSet attrs, int ...
AttributeSet attrs = createCustomIconsAttributeSet(); PasswordEditText actual = new PasswordEditText(RuntimeEnvironment.application, attrs, 0); actual.togglePasswordVisibility(); assertThat(actual).hasToggle(R.drawable.ic_icon_square); } }
[FOCAL] public void PasswordEditText.togglePasswordVisibility() [CLASS] class PasswordEditText extends AppCompatEditText [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void setPasswordVisible(boolean visible) [CLASS-MEMBERS] PasswordEditText(Context context); PasswordEditText(Cont...
/* static context [FOCAL] public void PasswordEditText.togglePasswordVisibility() [CALLS-INTERNAL] void setPasswordVisible(boolean visible) */
/* static context [FOCAL] public void PasswordEditText.togglePasswordVisibility() [CALLS-INTERNAL] void setPasswordVisible(boolean visible) */ class PasswordEditText extends AppCompatEditText { public void togglePasswordVisibility() { setPasswordVisible(!passwordVisible); } public PasswordEditText(Context ...
true
ok
{"focal": {"class": "PasswordEditText", "name": "togglePasswordVisibility", "signature": "void togglePasswordVisibility()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "PasswordEditText", "kind": "class", "modifiers": "", "superclass": "AppCompatEditText", "inter...
53789166_0
class CollisionChecker { public boolean check(long time, int location) { if(currentInstant != time) { currentInstant = time; bitSet.clear(); } if(bitSet.get(location)) { return false; } bitSet.set(location); return true; } ...
CollisionChecker collisionChecker = new CollisionChecker(); Assert.assertTrue(collisionChecker.check(100, 1)); Assert.assertFalse(collisionChecker.check(100, 1)); for (int i = 0; i < 1000; i++) { Assert.assertTrue(collisionChecker.check(101, i)); Assert.assertFals...
[FOCAL] public boolean CollisionChecker.check(long time, int location) [CLASS] class CollisionChecker [METRICS] loc=12 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] bitSet.clear/0, bitSet.get/1, bitSet.set/1 [PATH1] if(currentInstant != time)=T -> if(bitSet.get(location))=T -> return false [PATH...
/* static context [FOCAL] public boolean CollisionChecker.check(long time, int location) [PATH1] if(currentInstant != time)=T -> if(bitSet.get(location))=T -> return false [PATH2] if(currentInstant != time)=F -> if(bitSet.get(location))=F -> return true [INPUTS] branches=location, time | result=- [COLLABORATORS] field ...
/* static context [FOCAL] public boolean CollisionChecker.check(long time, int location) [PATH1] if(currentInstant != time)=T -> if(bitSet.get(location))=T -> return false [PATH2] if(currentInstant != time)=F -> if(bitSet.get(location))=F -> return true [INPUTS] branches=location, time | result=- [COLLABORATORS] field ...
true
ok
{"focal": {"class": "CollisionChecker", "name": "check", "signature": "boolean check(long time, int location)", "start_line": 3, "modifiers": "public", "params": [{"name": "time", "type": "long"}, {"name": "location", "type": "int"}], "return_type": "boolean"}, "class_info": {"name": "CollisionChecker", "kind": "class"...
53823931_0
class KryoSerializer extends Serializer<T> implements Serializable { @Override public T copy(Kryo kryo, T original) { try { preSerialize(original); try(CopyStream output = new CopyStream(4096)) { HTMObjectOutput writer = serializer.getObjectOutput(output); ...
Tuple expected = new Tuple(42); Tuple actual = kryo.copy(expected); assertNotSame(expected, actual); assertEquals(expected, actual); } }
[FOCAL] @Override public T KryoSerializer.copy(Kryo kryo, T original) [CLASS] class KryoSerializer extends Serializer<T> implements Serializable [METRICS] loc=24 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=3 [CALLS-INTERNAL] void postDeSerialize(T t); void preSerialize(T t) [CALLS-EXTERNAL] serializer.getObjectO...
/* static context [FOCAL] @Override public T KryoSerializer.copy(Kryo kryo, T original) [THROWS-WHEN] KryoException when try-body throws [PATH1] try-body throws -> throw new KryoException(e) [PATH2] return t [INPUTS] branches=- | result=original | unused=kryo [COLLABORATORS] field serializer getObjectOutput/1,getObject...
/* static context [FOCAL] @Override public T KryoSerializer.copy(Kryo kryo, T original) [THROWS-WHEN] KryoException when try-body throws [PATH1] try-body throws -> throw new KryoException(e) [PATH2] return t [INPUTS] branches=- | result=original | unused=kryo [COLLABORATORS] field serializer getObjectOutput/1,getObject...
true
ok
{"focal": {"class": "KryoSerializer", "name": "copy", "signature": "T copy(Kryo kryo, T original)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "kryo", "type": "Kryo"}, {"name": "original", "type": "T"}], "return_type": "T"}, "class_info": {"name": "KryoSerializer", "kind": "class", "modifiers...
53846545_0
class SpaceSaving { public boolean inc(long key) { // find location for key int index = 0; FingerPrintAux hash = indices.getHash(key); // find current location of key in set index = (int) indices.getOrDefault(hash, -1); // if key is not in set if (index < argmin) { index = Math.max(0, argmin-1); /...
long key = 611; int n = 1<<10; int size = 1<<5; SpaceSaving ss = new SpaceSaving(n, size, 10); // increment same key size-1 times and make sure there are no overflows. for (int i=0; i < size - 1;++i) { System.out.println(i); assertEquals(ss.bound(key), i); assertFalse(ss.inc(key)); } // increme...
[FOCAL] public boolean SpaceSaving.inc(long key) [CLASS] class SpaceSaving [METRICS] loc=43 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] int getLastOfQuantity(int quantity, FingerPrintAux quantityHash); int incrementQuantity(int index, FingerPrintAux quantityHash); void put(FingerPrintAux hash,...
/* static context [FOCAL] public boolean SpaceSaving.inc(long key) [PATH1] if(index < argmin)=T -> if(quantity < n/size)=T -> return quantity == n/size [PATH2] if(index < argmin)=F -> if(quantity < n/size)=F -> return quantity == n/size [INPUTS] branches=key | result=key [COLLABORATORS] field indices getHash/1,getOrDef...
/* static context [FOCAL] public boolean SpaceSaving.inc(long key) [PATH1] if(index < argmin)=T -> if(quantity < n/size)=T -> return quantity == n/size [PATH2] if(index < argmin)=F -> if(quantity < n/size)=F -> return quantity == n/size [INPUTS] branches=key | result=key [COLLABORATORS] field indices getHash/1,getOrDef...
true
ok
{"focal": {"class": "SpaceSaving", "name": "inc", "signature": "boolean inc(long key)", "start_line": 3, "modifiers": "public", "params": [{"name": "key", "type": "long"}], "return_type": "boolean"}, "class_info": {"name": "SpaceSaving", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields"...
53877122_9
class TurbolinksSession implements TurbolinksScrollUpCallback { public Activity getActivity() { return activity; } private TurbolinksSession(final Context context); public static TurbolinksSession getNew(Context context); public static TurbolinksSession getDefault(Context context); p...
assertThat(turbolinksSession.getActivity()).isNull(); } }
[FOCAL] public Activity TurbolinksSession.getActivity() [CLASS] class TurbolinksSession implements TurbolinksScrollUpCallback [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [FIELDS] read=activity:Activity [INPUTS] branches=- | result=activity [DATAFLOW] this.activity@param->L2 [CLASS-MEMBERS] Turb...
/* static context [FOCAL] public Activity TurbolinksSession.getActivity() [INPUTS] branches=- | result=activity [FIELDS] read=activity:Activity */
/* static context [FOCAL] public Activity TurbolinksSession.getActivity() [INPUTS] branches=- | result=activity [FIELDS] read=activity:Activity */ class TurbolinksSession implements TurbolinksScrollUpCallback { public Activity getActivity() { return activity; } private TurbolinksSession(final Con...
true
ok
{"focal": {"class": "TurbolinksSession", "name": "getActivity", "signature": "Activity getActivity()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Activity"}, "class_info": {"name": "TurbolinksSession", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "TurbolinksScrollUpCall...
53932231_31
class Parser { public List<PatternRule> parse() { if (used) { throw new IllegalStateException("Parser.parse can only be called once per instance"); } used = true; return rules(); } public Parser(final List<Token> tokens, final Consumer<? super DslError> errorReporter); public Token getSubFunctionIde...
final List<Token> tokens = Arrays.asList( new Token(EXISTENCE, "existence", 0), new Token(IDENTIFIER, "test", 0), new Token(COLON, ":", 0), new Token(IDENTIFIER, "x", 0), new Token(PLUS, "+", 0), new Token(IDENTIFIER, "y", 0), new Token(ARROW, "->", 0), new Token(EOF, "", 0) ); fin...
[FOCAL] public List<PatternRule> Parser.parse() [CLASS] class Parser [METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] List<PatternRule> rules() [NEW] IllegalStateException [EXCEPTIONS] throws IllegalStateException [THROWS-WHEN] IllegalStateException when used [PATH1] if(used)=T -> t...
/* static context [FOCAL] public List<PatternRule> Parser.parse() [THROWS-WHEN] IllegalStateException when used [PATH1] if(used)=T -> throw new IllegalStateException("Parser.parse can only be called once per... [PATH2] if(used)=F -> return rules() [EXCEPTIONS] throws IllegalStateException [CALLS-INTERNAL] List<PatternR...
/* static context [FOCAL] public List<PatternRule> Parser.parse() [THROWS-WHEN] IllegalStateException when used [PATH1] if(used)=T -> throw new IllegalStateException("Parser.parse can only be called once per... [PATH2] if(used)=F -> return rules() [EXCEPTIONS] throws IllegalStateException [CALLS-INTERNAL] List<PatternR...
true
ok
{"focal": {"class": "Parser", "name": "parse", "signature": "List<PatternRule> parse()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<PatternRule>"}, "class_info": {"name": "Parser", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "errors", "ty...
53940095_2
class ScaldingInterpreter extends Interpreter { @Override public InterpreterResult interpret(String cmd, InterpreterContext contextInterpreter) { logger.info("Running Scalding command '" + cmd + "'"); if (cmd == null || cmd.trim().length() == 0) { return new InterpreterResult(Code.SUCCESS); } ...
assertEquals(InterpreterResult.Code.SUCCESS, repl.interpret("\"123\"\n.toInt", context).code()); } }
[FOCAL] @Override public InterpreterResult ScaldingInterpreter.interpret(String cmd, InterpreterContext contextInterpreter) [CLASS] class ScaldingInterpreter extends Interpreter [METRICS] loc=9 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] InterpreterResult interpret(String[] lines, InterpreterC...
/* static context [FOCAL] @Override public InterpreterResult ScaldingInterpreter.interpret(String cmd, InterpreterContext contextInterpreter) [PATH1] if(cmd == null || cmd.trim().length() == 0)=T -> return new InterpreterResult(Code.SUCCESS) [PATH2] if(cmd == null || cmd.trim().length() == 0)=F -> return interpret(cmd....
/* static context [FOCAL] @Override public InterpreterResult ScaldingInterpreter.interpret(String cmd, InterpreterContext contextInterpreter) [PATH1] if(cmd == null || cmd.trim().length() == 0)=T -> return new InterpreterResult(Code.SUCCESS) [PATH2] if(cmd == null || cmd.trim().length() == 0)=F -> return interpret(cmd....
true
ok
{"focal": {"class": "ScaldingInterpreter", "name": "interpret", "signature": "InterpreterResult interpret(String cmd, InterpreterContext contextInterpreter)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "cmd", "type": "String"}, {"name": "contextInterpreter", "type": "InterpreterContext"}], "r...
53950433_0
class MTIssueRegistry extends IssueRegistry { @Override public synchronized List<Issue> getIssues() { System.out.println("==== MT lint start ===="); return Arrays.asList( LogDetector.ISSUE, HashMapForJDK7Detector.ISSUE ); } private MTIssueRegistr...
int size = mtIssueRegistry.getIssues().size(); assertThat(size).isEqualTo(2); } }
[FOCAL] @Override public synchronized List<Issue> MTIssueRegistry.getIssues() [CLASS] class MTIssueRegistry extends IssueRegistry [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] System.out.println/1, Arrays.asList/2 [TEST] MTIssueRegistryTest: @Test public void testNumberOfIssues()...
/* static context [FOCAL] @Override public synchronized List<Issue> MTIssueRegistry.getIssues() [CALLS-EXTERNAL] System.out.println/1, Arrays.asList/2 */
/* static context [FOCAL] @Override public synchronized List<Issue> MTIssueRegistry.getIssues() [CALLS-EXTERNAL] System.out.println/1, Arrays.asList/2 */ class MTIssueRegistry extends IssueRegistry { @Override public synchronized List<Issue> getIssues() { System.out.println("==== MT lint start ===="); ...
true
ok
{"focal": {"class": "MTIssueRegistry", "name": "getIssues", "signature": "List<Issue> getIssues()", "start_line": 3, "modifiers": "@Override public synchronized", "params": [], "return_type": "List<Issue>"}, "class_info": {"name": "MTIssueRegistry", "kind": "class", "modifiers": "", "superclass": "IssueRegistry", "inte...
53966381_4
class LandscapeWatcher { @EventListener({ HeartbeatEvent.class }) public void discoverLandscape() { logger.debug("Discovering landscape"); List<String> applications = this.discoveryClient.getServices() .stream() .filter(this.applicationFilters) .collect(Collectors.toList()); Catalog catalog = thi...
when(this.discoveryClient.getServices()).thenReturn(Collections.singletonList("a")); when(this.catalog.getApplications()).thenReturn(Collections.singletonList("a")); ServiceInstance serviceInstance = new DefaultServiceInstance("a-1", "a", "host", 8080, false); when(this.discoveryClient.getInstances("a")).thenRe...
[FOCAL] @EventListener({ HeartbeatEvent.class }) public void LandscapeWatcher.discoverLandscape() [CLASS] class LandscapeWatcher [METRICS] loc=15 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void dispatchEventForDisappearedApplications(List<String> applications, Catalog catalog); void dispatchE...
/* static context [FOCAL] @EventListener({ HeartbeatEvent.class }) public void LandscapeWatcher.discoverLandscape() [COLLABORATORS] field discoveryClient:DiscoveryClient getServices/0; field catalogService:CatalogService getCatalog/0 [CALLS-INTERNAL] void dispatchEventForDisappearedApplications(List<String> application...
/* static context [FOCAL] @EventListener({ HeartbeatEvent.class }) public void LandscapeWatcher.discoverLandscape() [COLLABORATORS] field discoveryClient:DiscoveryClient getServices/0; field catalogService:CatalogService getCatalog/0 [CALLS-INTERNAL] void dispatchEventForDisappearedApplications(List<String> application...
true
ok
{"focal": {"class": "LandscapeWatcher", "name": "discoverLandscape", "signature": "void discoverLandscape()", "start_line": 3, "modifiers": "@EventListener({ HeartbeatEvent.class }) public", "params": [], "return_type": "void"}, "class_info": {"name": "LandscapeWatcher", "kind": "class", "modifiers": "", "superclass": ...
53976910_33
class RegexToGramQueryTranslator { public static GramBooleanQuery translate(String regex) throws com.google.re2j.PatternSyntaxException { return translate(regex, TranslatorUtils.DEFAULT_GRAM_LENGTH); } public static GramBooleanQuery translate(String regex, int gramLength); private static Rege...
String regex = "abc+"; GramBooleanQuery exactQuery = RegexToGramQueryTranslator.translate(regex); GramBooleanQuery expectedQuery = GramBooleanQuery.newLeafNode("abc"); printTranslatorResult(regex); Assert.assertEquals(expectedQuery, exactQuery); Assert.assertEquals(ex...
[FOCAL] public static GramBooleanQuery RegexToGramQueryTranslator.translate(String regex) [CLASS] class RegexToGramQueryTranslator [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] GramBooleanQuery translate(String regex, int gramLength) [EXCEPTIONS] declares com.google.re2j.PatternS...
/* static context [FOCAL] public static GramBooleanQuery RegexToGramQueryTranslator.translate(String regex) [INPUTS] branches=- | result=regex [EXCEPTIONS] declares com.google.re2j.PatternSyntaxException [CALLS-INTERNAL] GramBooleanQuery translate(String regex, int gramLength) */
/* static context [FOCAL] public static GramBooleanQuery RegexToGramQueryTranslator.translate(String regex) [INPUTS] branches=- | result=regex [EXCEPTIONS] declares com.google.re2j.PatternSyntaxException [CALLS-INTERNAL] GramBooleanQuery translate(String regex, int gramLength) */ class RegexToGramQueryTranslator { ...
true
ok
{"focal": {"class": "RegexToGramQueryTranslator", "name": "translate", "signature": "GramBooleanQuery translate(String regex) throws com.google.re2j.PatternSyntaxException", "start_line": 3, "modifiers": "public static", "params": [{"name": "regex", "type": "String"}], "return_type": "GramBooleanQuery"}, "class_info": ...
54034223_9
class RestUtils { public static <T> T post(URI url, Object request, Class<T> responseType) { Assert.notNull(url); Assert.notNull(responseType); return restTemplate.postForObject(url, request, responseType); } public static void setRestTemplate(RestTemplate restTemplate); publi...
Long id = RestUtils.post(baseUrl + "/demo/save", new Demo(2L, "sunhao"), Long.class, new Object[0]); Assert.assertEquals(2L, id.longValue()); } }
[FOCAL] public static T RestUtils.post(URI url, Object request, Class<T> responseType) [CLASS] class RestUtils [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Assert.notNull/1, restTemplate.postForObject/3 [INPUTS] branches=- | result=request, responseType, url [COLLABORATORS] fiel...
/* static context [FOCAL] public static T RestUtils.post(URI url, Object request, Class<T> responseType) [INPUTS] branches=- | result=request, responseType, url [COLLABORATORS] field restTemplate postForObject/3 [CALLS-EXTERNAL] Assert.notNull/1, restTemplate.postForObject/3 */
/* static context [FOCAL] public static T RestUtils.post(URI url, Object request, Class<T> responseType) [INPUTS] branches=- | result=request, responseType, url [COLLABORATORS] field restTemplate postForObject/3 [CALLS-EXTERNAL] Assert.notNull/1, restTemplate.postForObject/3 */ class RestUtils { public static <T> ...
true
ok
{"focal": {"class": "RestUtils", "name": "post", "signature": "T post(URI url, Object request, Class<T> responseType)", "start_line": 3, "modifiers": "public static", "params": [{"name": "url", "type": "URI"}, {"name": "request", "type": "Object"}, {"name": "responseType", "type": "Class<T>"}], "return_type": "T"}, "cl...
54064354_1
class IOReader { static String mimeTypeFromExtension(String path) { if (path == null || path.length() == 0) { return null; } final int indexOfDot = path.lastIndexOf('.'); if (indexOfDot == -1) { return null; } final String ext = path.subst...
assertThat(IOReader.mimeTypeFromExtension("file.zip"), is(nullValue())); assertThat(IOReader.mimeTypeFromExtension("file.abc"), is(nullValue())); } }
[FOCAL] static String IOReader.mimeTypeFromExtension(String path) [CLASS] class IOReader [METRICS] loc=42 cc=14 branches=3 loops=0 returns=14 throws=0 nesting=1 [CALLS-EXTERNAL] String.length/0, String.lastIndexOf/1, path.substring(indexOfDot + 1).toLowerCase/1, String.substring/1, Locale.getDefault/0 [PATH1] if(path =...
/* static context [FOCAL] static String IOReader.mimeTypeFromExtension(String path) [PATH1] if(path == null || path.length() == 0)=F -> if(indexOfDot == -1)=F -> switch(ext)=case "json" -> return "application/json" [PATH2] if(path == null || path.length() == 0)=T -> return null [PATH3] if(path == null || path.length() ...
/* static context [FOCAL] static String IOReader.mimeTypeFromExtension(String path) [PATH1] if(path == null || path.length() == 0)=F -> if(indexOfDot == -1)=F -> switch(ext)=case "json" -> return "application/json" [PATH2] if(path == null || path.length() == 0)=T -> return null [PATH3] if(path == null || path.length() ...
true
ok
{"focal": {"class": "IOReader", "name": "mimeTypeFromExtension", "signature": "String mimeTypeFromExtension(String path)", "start_line": 3, "modifiers": "static", "params": [{"name": "path", "type": "String"}], "return_type": "String"}, "class_info": {"name": "IOReader", "kind": "class", "modifiers": "", "superclass": ...
54069741_37
class EncoderUtils { public static List<BioAssemblyData> generateBioassemblies(StructureDataInterface structureDataInterface) { int numBioassemblies = structureDataInterface.getNumBioassemblies(); List<BioAssemblyData> outList = new ArrayList<>(); for (int i=0; i<numBioassemblies; i++) { BioAssemblyData bioa...
List<BioAssemblyData> bioAssemblyData = new ArrayList<>(); BioAssemblyData bioAssemblyOne = new BioAssemblyData("1"); bioAssemblyData.add(bioAssemblyOne); List<BioAssemblyTransformation> bioAssemblyOneTransforms = new ArrayList<>(); BioAssemblyTransformation bioassOneTransOne = new BioAssemblyTransformation()...
[FOCAL] public static List<BioAssemblyData> EncoderUtils.generateBioassemblies(StructureDataInterface structureDataInterface) [CLASS] class EncoderUtils [METRICS] loc=14 cc=3 branches=0 loops=2 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] void addTransform(BioAssemblyData bioassembly, int[] chainIndices, double[] tran...
/* static context [FOCAL] public static List<BioAssemblyData> EncoderUtils.generateBioassemblies(StructureDataInterface structureDataInterface) [PATH1] for(i<numBioassemblies)=T -> for(j<numTrans)=F -> exit loop -> return outList [PATH2] for(i<numBioassemblies)=F -> return outList [PATH3] for(i<numBioassemblies)=T -> f...
/* static context [FOCAL] public static List<BioAssemblyData> EncoderUtils.generateBioassemblies(StructureDataInterface structureDataInterface) [PATH1] for(i<numBioassemblies)=T -> for(j<numTrans)=F -> exit loop -> return outList [PATH2] for(i<numBioassemblies)=F -> return outList [PATH3] for(i<numBioassemblies)=T -> f...
true
ok
{"focal": {"class": "EncoderUtils", "name": "generateBioassemblies", "signature": "List<BioAssemblyData> generateBioassemblies(StructureDataInterface structureDataInterface)", "start_line": 3, "modifiers": "public static", "params": [{"name": "structureDataInterface", "type": "StructureDataInterface"}], "return_type": ...
54086678_0
class SimpleThreadpool { private SimpleThreadpool(int threadCount) { // Increment pool count poolCount.incrementAndGet(); this.runnables = new ConcurrentLinkedQueue<>(); this.execute = new AtomicBoolean(true); this.threads = new ArrayList<>(); for (int threadIndex = ...
int runnableCount = 10; SimpleThreadpool threadpool = SimpleThreadpool.getInstance(); final AtomicInteger count = new AtomicInteger(0); Runnable r = new Runnable() { @Override public void run() { count.getAndIncrement(); } }; ...
[FOCAL] private SimpleThreadpool.SimpleThreadpool(int threadCount) [CLASS] class SimpleThreadpool [METRICS] loc=12 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] poolCount.incrementAndGet/0, poolCount.get/0, SimpleThreadpoolThread.start/0, this.threads.add/1 [NEW] ConcurrentLinkedQueue<>, AtomicB...
/* static context [FOCAL] private SimpleThreadpool.SimpleThreadpool(int threadCount) [PATH1] for(threadIndex < threadCount)=T -> exit loop [PATH2] for(threadIndex < threadCount)=F [INPUTS] branches=threadCount | result=- [COLLABORATORS] field poolCount incrementAndGet/0,get/0; field threads add/1 [STATE] execute, runna...
/* static context [FOCAL] private SimpleThreadpool.SimpleThreadpool(int threadCount) [PATH1] for(threadIndex < threadCount)=T -> exit loop [PATH2] for(threadIndex < threadCount)=F [INPUTS] branches=threadCount | result=- [COLLABORATORS] field poolCount incrementAndGet/0,get/0; field threads add/1 [STATE] execute, runna...
true
ok
{"focal": {"class": "SimpleThreadpool", "name": "SimpleThreadpool", "signature": "SimpleThreadpool(int threadCount)", "start_line": 3, "modifiers": "private", "params": [{"name": "threadCount", "type": "int"}], "return_type": null}, "class_info": {"name": "SimpleThreadpool", "kind": "class", "modifiers": "", "superclas...
54088253_3
class ParaList implements Serializable { public ParaList(List<StoreParas> lists) { if ( lists == null ) throw new RuntimeException("lists can not be null"); this.lists = lists; this.size = lists.size(); } public ParaList(List<StoreParas> lists); public int getSize(); pub...
public void TestParaList() { int size = 3; List<StoreParas> list = new ArrayList<StoreParas>(size); for ( int i = 0 ; i < size ; i++) { list.add( new StoreParas(OpType.Put, Key.createKey("test-"+i), new BlockValue(("test-"+i).getBytes() ,i, (short ) 0)) ); } ...
[FOCAL] public ParaList.ParaList(List<StoreParas> lists) [CLASS] class ParaList implements Serializable [METRICS] loc=6 cc=2 branches=1 loops=0 returns=0 throws=1 nesting=1 [CALLS-EXTERNAL] List<StoreParas>.size/0 [NEW] RuntimeException [FIELDS] write=lists, size [EXCEPTIONS] throws RuntimeException [THROWS-WHEN] Runti...
/* static context [FOCAL] public ParaList.ParaList(List<StoreParas> lists) [THROWS-WHEN] RuntimeException when lists == null [PATH1] if(lists == null)=T -> throw new RuntimeException("lists can not be null") [PATH2] if(lists == null)=F [INPUTS] branches=lists | result=- [COLLABORATORS] param lists:List<StoreParas> size...
/* static context [FOCAL] public ParaList.ParaList(List<StoreParas> lists) [THROWS-WHEN] RuntimeException when lists == null [PATH1] if(lists == null)=T -> throw new RuntimeException("lists can not be null") [PATH2] if(lists == null)=F [INPUTS] branches=lists | result=- [COLLABORATORS] param lists:List<StoreParas> size...
true
ok
{"focal": {"class": "ParaList", "name": "ParaList", "signature": "ParaList(List<StoreParas> lists)", "start_line": 3, "modifiers": "public", "params": [{"name": "lists", "type": "List<StoreParas>"}], "return_type": null}, "class_info": {"name": "ParaList", "kind": "class", "modifiers": "", "superclass": null, "interfac...
54102761_87
class SSOLogoutServlet extends HttpServlet { @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { final String token = req.getParameter("authToken"); if (token == null) { resp.sendError(HttpServletResponse.SC_BAD_REQUEST, "Toke...
// given HttpServletRequest request = new MockHttpServletRequest("http://localhost:8080/sso/logout", null, 0, "POST", null); // when servlet.doPost(request, response); // when , verify(response).sendError(eq(HttpServletResponse.SC_BAD_REQUEST), eq("Toke...
[FOCAL] @Override protected void SSOLogoutServlet.doPost(HttpServletRequest req, HttpServletResponse resp) [CLASS] class SSOLogoutServlet extends HttpServlet [METRICS] loc=21 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] HttpServletRequest.getParameter/1, HttpServletResponse.sendError/2, Session...
/* static context [FOCAL] @Override protected void SSOLogoutServlet.doPost(HttpServletRequest req, HttpServletResponse resp) [PATH1] if(token == null)=T -> return [PATH2] if(token == null)=F -> if(session != null)=T [PATH3] if(token == null)=F -> if(session != null)=F [INPUTS] branches=req, sessionStore | result=- [COL...
/* static context [FOCAL] @Override protected void SSOLogoutServlet.doPost(HttpServletRequest req, HttpServletResponse resp) [PATH1] if(token == null)=T -> return [PATH2] if(token == null)=F -> if(session != null)=T [PATH3] if(token == null)=F -> if(session != null)=F [INPUTS] branches=req, sessionStore | result=- [COL...
true
ok
{"focal": {"class": "SSOLogoutServlet", "name": "doPost", "signature": "void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "req", "type": "HttpServletRequest"}, {"name": "resp", "type": "HttpServle...
54135763_1
class ClosedCaptionManagerFactory { public CaptionManager createCaptionManager(Context context) { if (androidVersion.isMarshmallowOrHigher()) { return ClosedCaptionManagerMarshmallow.newInstance(context); } else if (androidVersion.isKitKatOrHigher()) { return ClosedCaptionMa...
when(mockAndroidVersion.isKitKatOrHigher()).thenReturn(true); CaptionManager captionManager = closedCaptionManagerFactory.createCaptionManager(mockContext); assertThat(captionManager).isInstanceOf(ClosedCaptionManagerKitKat.class); } }
[FOCAL] public CaptionManager ClosedCaptionManagerFactory.createCaptionManager(Context context) [CLASS] class ClosedCaptionManagerFactory [METRICS] loc=9 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=2 [CALLS-EXTERNAL] androidVersion.isMarshmallowOrHigher/0, ClosedCaptionManagerMarshmallow.newInstance/1, androidVe...
/* static context [FOCAL] public CaptionManager ClosedCaptionManagerFactory.createCaptionManager(Context context) [PATH1] if(androidVersion.isMarshmallowOrHigher())=F -> if(androidVersion.isKitKatOrHigher())=T -> return ClosedCaptionManagerKitKat.newInstance(context) [PATH2] if(androidVersion.isMarshmallowOrHigher())=T...
/* static context [FOCAL] public CaptionManager ClosedCaptionManagerFactory.createCaptionManager(Context context) [PATH1] if(androidVersion.isMarshmallowOrHigher())=F -> if(androidVersion.isKitKatOrHigher())=T -> return ClosedCaptionManagerKitKat.newInstance(context) [PATH2] if(androidVersion.isMarshmallowOrHigher())=T...
true
ok
{"focal": {"class": "ClosedCaptionManagerFactory", "name": "createCaptionManager", "signature": "CaptionManager createCaptionManager(Context context)", "start_line": 3, "modifiers": "public", "params": [{"name": "context", "type": "Context"}], "return_type": "CaptionManager"}, "class_info": {"name": "ClosedCaptionManag...
54149022_115
class ProductBaselinesResource { @GET @ApiOperation(value = "Get product-baseline by id", response = ProductBaselineDTO.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of ProductBaselineDTO"), @ApiResponse(code = 401, message = "Un...
PartUsageLink partLink = new PartUsageLink(); List<PartLink> partLinks = Collections.singletonList(partLink); partLink.setComponent(partMaster); Mockito.when(productBaselineService.getBaseline(baseline.getId())) .thenReturn(baseline); Mockito.when(productService...
[FOCAL] @GET @ApiOperation(value = "Get product-baseline by id", response = ProductBaselineDTO.class) @ApiResponses(value = {... ProductBaselineDTO ProductBaselinesResource.getProductBaseline(String workspaceId, String ciId, int baselineId) [CLASS] class ProductBaselinesResource [METRICS] loc=48 cc=5 branches=0 loops=4...
class ProductBaselinesResource { @GET @ApiOperation(value = "Get product-baseline by id", response = ProductBaselineDTO.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of ProductBaselineDTO"), @ApiResponse(code = 401, message = "Un...
false
ok
{"focal": {"class": "ProductBaselinesResource", "name": "getProductBaseline", "signature": "ProductBaselineDTO getProductBaseline(String workspaceId, String ciId, int baselineId) throws EntityNotFoundException, UserNotActiveException, AccessRightException, WorkspaceNotEnabledException", "start_line": 3, "modifiers": "@...
54189483_34
class AbstractWagon implements Wagon { @Override public final void removeSessionListener(SessionListener sessionListener) { this.sessionListenerSupport.removeSessionListener(sessionListener); } protected AbstractWagon(boolean supportsDirectoryCopy); protected AbstractWagon(boolean suppor...
this.wagon.removeSessionListener(this.sessionListener); verify(this.sessionListenerSupport).removeSessionListener(this.sessionListener); } }
[FOCAL] @Override public final void AbstractWagon.removeSessionListener(SessionListener sessionListener) [CLASS] class AbstractWagon implements Wagon [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] SessionListenerSupport.removeSessionListener/1 [FIELDS] read=sessionListenerSupport:...
/* static context [FOCAL] @Override public final void AbstractWagon.removeSessionListener(SessionListener sessionListener) [COLLABORATORS] field sessionListenerSupport:SessionListenerSupport removeSessionListener/1 [FIELDS] read=sessionListenerSupport:SessionListenerSupport [CALLS-EXTERNAL] SessionListenerSupport.remov...
/* static context [FOCAL] @Override public final void AbstractWagon.removeSessionListener(SessionListener sessionListener) [COLLABORATORS] field sessionListenerSupport:SessionListenerSupport removeSessionListener/1 [FIELDS] read=sessionListenerSupport:SessionListenerSupport [CALLS-EXTERNAL] SessionListenerSupport.remov...
true
ok
{"focal": {"class": "AbstractWagon", "name": "removeSessionListener", "signature": "void removeSessionListener(SessionListener sessionListener)", "start_line": 3, "modifiers": "@Override public final", "params": [{"name": "sessionListener", "type": "SessionListener"}], "return_type": "void"}, "class_info": {"name": "Ab...
54218417_0
class VoiceService { public byte[] say(VoiceParameter param) { L.debug("#say: param=" + param); if (param == null) { throw new IllegalArgumentException("param is null."); } if (StringUtils.isBlank(param.getText())) { throw new IllegalArgumentException("param...
VoiceParameter param = new VoiceParameter(); param.setText("こんにちは"); byte[] result = _s.say(param); String md5 = "6863e3bcac79948b7c2cc24283d4571f"; assertThat(DigestUtils.md5Hex(result), is(md5)); } }
[FOCAL] public byte[] VoiceService.say(VoiceParameter param) [CLASS] class VoiceService [METRICS] loc=17 cc=3 branches=2 loops=0 returns=1 throws=2 nesting=1 [CALLS-EXTERNAL] L.debug/1, StringUtils.isBlank/1, VoiceParameter.getText/0, VoiceParameter.setText/1, param.getText().trim/0, _openJTalkRepo.createVoice/1 [NEW] ...
/* static context [FOCAL] public byte[] VoiceService.say(VoiceParameter param) [THROWS-WHEN] IllegalArgumentException when param == null [THROWS-WHEN] IllegalArgumentException when !(param == null) && StringUtils.isBlank(param.getText()) [PATH1] if(param == null)=F -> if(StringUtils.isBlank(param.getText()))=T -> throw...
/* static context [FOCAL] public byte[] VoiceService.say(VoiceParameter param) [THROWS-WHEN] IllegalArgumentException when param == null [THROWS-WHEN] IllegalArgumentException when !(param == null) && StringUtils.isBlank(param.getText()) [PATH1] if(param == null)=F -> if(StringUtils.isBlank(param.getText()))=T -> throw...
true
ok
{"focal": {"class": "VoiceService", "name": "say", "signature": "byte[] say(VoiceParameter param)", "start_line": 3, "modifiers": "public", "params": [{"name": "param", "type": "VoiceParameter"}], "return_type": "byte[]"}, "class_info": {"name": "VoiceService", "kind": "class", "modifiers": "", "superclass": null, "int...
54231507_31
class DecoratedOptions extends DecoratedChild<WebDriver.Options,DecoratedWebDriver> implements WebDriver.Options { @Override public WebDriver.Window window() { return new Activator<WebDriver.Window>().activate(getTopmostDecorated().createDecorated(getOriginal().window())); } public DecoratedOptions(final...
final WebDriver.Window window = mock(WebDriver.Window.class); verifyDecoratingFunction(WebDriver.Options::window, window, WebDriver.Window::maximize); } }
[FOCAL] @Override public WebDriver.Window DecoratedOptions.window() [CLASS] class DecoratedOptions extends DecoratedChild<WebDriver.Options,DecoratedWebDriver> implements WebDriver.Options [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] new Activator<WebDriver.Window>().activate/1,...
/* static context [FOCAL] @Override public WebDriver.Window DecoratedOptions.window() [NEW] Activator<WebDriver.Window> [CALLS-EXTERNAL] new Activator<WebDriver.Window>().activate/1, getTopmostDecorated().createDecorated/1, getTopmostDecorated/0 (inherited), getOriginal().window/0, getOriginal/0 (inherited) */
/* static context [FOCAL] @Override public WebDriver.Window DecoratedOptions.window() [NEW] Activator<WebDriver.Window> [CALLS-EXTERNAL] new Activator<WebDriver.Window>().activate/1, getTopmostDecorated().createDecorated/1, getTopmostDecorated/0 (inherited), getOriginal().window/0, getOriginal/0 (inherited) */ class De...
true
ok
{"focal": {"class": "DecoratedOptions", "name": "window", "signature": "WebDriver.Window window()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "WebDriver.Window"}, "class_info": {"name": "DecoratedOptions", "kind": "class", "modifiers": "", "superclass": "DecoratedChild<WebDriver.Opt...
54240230_0
class BooleanActions { @CheckResult @NonNull public static Action1<? super Boolean> not(@NonNull final Action1<? super Boolean> a1) { return new Action1<Boolean>() { @Override public void call(Boolean aBoolean) { a1.call(Boolean.FALSE.equals(aBoolean)); ...
Action1<? super Boolean> action1 = Mockito.mock(Action1.class); Action1<? super Boolean> action2 = BooleanActions.not(action1); action2.call(true); Mockito.verify(action1).call(false); action2.call(false); Mockito.verify(action1).call(true); } }
[FOCAL] @CheckResult @NonNull public static Action1<? super Boolean> BooleanActions.not(Action1<? super Boolean> a1) [CLASS] class BooleanActions [METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Action1<? super Boolean>.call/1, Boolean.FALSE.equals/1 [NEW] Action1<Boolean> [INPUTS]...
/* static context [FOCAL] @CheckResult @NonNull public static Action1<? super Boolean> BooleanActions.not(Action1<? super Boolean> a1) [INPUTS] branches=- | result=a1 [COLLABORATORS] param a1:Action1<? super Boolean> call/1 [NEW] Action1<Boolean> [CALLS-EXTERNAL] Action1<? super Boolean>.call/1, Boolean.FALSE.equals/1 ...
/* static context [FOCAL] @CheckResult @NonNull public static Action1<? super Boolean> BooleanActions.not(Action1<? super Boolean> a1) [INPUTS] branches=- | result=a1 [COLLABORATORS] param a1:Action1<? super Boolean> call/1 [NEW] Action1<Boolean> [CALLS-EXTERNAL] Action1<? super Boolean>.call/1, Boolean.FALSE.equals/1 ...
true
ok
{"focal": {"class": "BooleanActions", "name": "not", "signature": "Action1<? super Boolean> not(Action1<? super Boolean> a1)", "start_line": 3, "modifiers": "@CheckResult @NonNull public static", "params": [{"name": "a1", "type": "Action1<? super Boolean>"}], "return_type": "Action1<? super Boolean>"}, "class_info": {"...
54252267_125
class StatusLogger extends PeriodicStatusReporter { @Override public void initialize(Properties properties, QueryableStatusAggregator queryableStatusAggregator) { this.queryableStatusAggregator = queryableStatusAggregator; String periodString = properties.getProperty(REPORT_PERIOD_KEY); ...
IOException ioException = new IOException("This is an expected test exception"); Mockito.when(queryableStatusAggregator.statusReport(MOCK_QUERY)).thenThrow(ioException); statusLogger.initialize(getProperties(LogLevel.WARN), queryableStatusAggregator); statusLogger.start(); veri...
[FOCAL] @Override public void StatusLogger.initialize(Properties properties, QueryableStatusAggregator queryableStatusAggregator) [CLASS] class StatusLogger extends PeriodicStatusReporter [METRICS] loc=37 cc=7 branches=4 loops=0 returns=0 throws=6 nesting=1 [CALLS-EXTERNAL] Properties.getProperty/1, setPeriod/1 (inheri...
/* static context [FOCAL] @Override public void StatusLogger.initialize(Properties properties, QueryableStatusAggregator queryableStatusAggregator) [THROWS-WHEN] IllegalStateException when periodString == null [THROWS-WHEN] IllegalStateException when !(periodString == null) && try-body throws [THROWS-WHEN] IllegalState...
/* static context [FOCAL] @Override public void StatusLogger.initialize(Properties properties, QueryableStatusAggregator queryableStatusAggregator) [THROWS-WHEN] IllegalStateException when periodString == null [THROWS-WHEN] IllegalStateException when !(periodString == null) && try-body throws [THROWS-WHEN] IllegalState...
true
ok
{"focal": {"class": "StatusLogger", "name": "initialize", "signature": "void initialize(Properties properties, QueryableStatusAggregator queryableStatusAggregator)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "properties", "type": "Properties"}, {"name": "queryableStatusAggregator", "type": "...
54297956_1
class MainPresenter { public void onSaveButtonClick(String note) { if (note.isEmpty()) { return; } mModel.addNoteToList(note); mView.clearNoteEditText(); mView.updateRecyclerView(mModel.getNoteList()); } public MainPresenter(MainView view, MainModel mod...
String note = "note"; presenter.onSaveButtonClick(note); verify(model).addNoteToList(note); verify(view).clearNoteEditText(); verify(view).updateRecyclerView(model.getNoteList()); } }
[FOCAL] public void MainPresenter.onSaveButtonClick(String note) [CLASS] class MainPresenter [METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] String.isEmpty/0, mModel.addNoteToList/1, mView.clearNoteEditText/0, mView.updateRecyclerView/1, mModel.getNoteList/0 [PATH1] if(note.isEmpty...
/* static context [FOCAL] public void MainPresenter.onSaveButtonClick(String note) [PATH1] if(note.isEmpty())=T -> return [PATH2] if(note.isEmpty())=F [INPUTS] branches=note | result=- [COLLABORATORS] field mModel addNoteToList/1,getNoteList/0; field mView clearNoteEditText/0,updateRecyclerView/1 [CALLS-EXTERNAL] Strin...
/* static context [FOCAL] public void MainPresenter.onSaveButtonClick(String note) [PATH1] if(note.isEmpty())=T -> return [PATH2] if(note.isEmpty())=F [INPUTS] branches=note | result=- [COLLABORATORS] field mModel addNoteToList/1,getNoteList/0; field mView clearNoteEditText/0,updateRecyclerView/1 [CALLS-EXTERNAL] Strin...
true
ok
{"focal": {"class": "MainPresenter", "name": "onSaveButtonClick", "signature": "void onSaveButtonClick(String note)", "start_line": 3, "modifiers": "public", "params": [{"name": "note", "type": "String"}], "return_type": "void"}, "class_info": {"name": "MainPresenter", "kind": "class", "modifiers": "", "superclass": nu...
54311516_1
class RangeUtils { public static float getFloatValueInRange(float fromRangeMin, float fromRangeMax, float toRangeMin, float toRangeMax, float fromRangeValue) { float oldRange = (fromRangeMax - fromRangeMin); float newRange = (toRangeMax - toRangeMin); return (((fromRangeValue - fromRangeMin) * newR...
int fromMin = 0; int fromMax = 100; int toMin = 0; int toMax = 1; float result = RangeUtils.getFloatValueInRange(fromMin, fromMax, toMin, toMax, 50); Assert.assertTrue(result == 0.5f); } }
[FOCAL] public static float RangeUtils.getFloatValueInRange(float fromRangeMin, float fromRangeMax, float toRangeMin, float toRangeMax, float fromRangeValue) [CLASS] class RangeUtils [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [INPUTS] branches=- | result=fromRangeMax, fromRangeMin, fromRangeVa...
/* static context [FOCAL] public static float RangeUtils.getFloatValueInRange(float fromRangeMin, float fromRangeMax, float toRangeMin, float toRangeMax, float fromRangeValue) [INPUTS] branches=- | result=fromRangeMax, fromRangeMin, fromRangeValue, toRangeMax, toRangeMin */
/* static context [FOCAL] public static float RangeUtils.getFloatValueInRange(float fromRangeMin, float fromRangeMax, float toRangeMin, float toRangeMax, float fromRangeValue) [INPUTS] branches=- | result=fromRangeMax, fromRangeMin, fromRangeValue, toRangeMax, toRangeMin */ class RangeUtils { public static float get...
true
ok
{"focal": {"class": "RangeUtils", "name": "getFloatValueInRange", "signature": "float getFloatValueInRange(float fromRangeMin, float fromRangeMax, float toRangeMin, float toRangeMax, float fromRangeValue)", "start_line": 3, "modifiers": "public static", "params": [{"name": "fromRangeMin", "type": "float"}, {"name": "fr...
54370839_7
class ServiceDiscoveryRestEndpoint { private void publish(RoutingContext routingContext) { JsonObject json = routingContext.getBodyAsJson(); Record record = new Record(json); discovery.publish(record, ar -> { if (ar.failed()) { routingContext.fail(ar.cause()); } else { routing...
HelloService svc = new HelloServiceImpl("stuff"); ProxyHelper.registerService(HelloService.class, vertx, svc, "address"); Record record1 = EventBusService.createRecord("Hello", "address", HelloService.class, new JsonObject().put("key", "foo")); Record record2 = EventBusService.createRecord("Hello...
[FOCAL] private void ServiceDiscoveryRestEndpoint.publish(RoutingContext routingContext) [CLASS] class ServiceDiscoveryRestEndpoint [METRICS] loc=13 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] RoutingContext.getBodyAsJson/0, ServiceDiscovery.publish/2, ar.failed/0, RoutingContext.fail/1, ar.ca...
/* static context [FOCAL] private void ServiceDiscoveryRestEndpoint.publish(RoutingContext routingContext) [COLLABORATORS] param routingContext:RoutingContext getBodyAsJson/0,fail/1,response/0; field discovery:ServiceDiscovery publish/2; field ar failed/0,cause/0,result/0 [FIELDS] read=discovery:ServiceDiscovery [NEW] ...
/* static context [FOCAL] private void ServiceDiscoveryRestEndpoint.publish(RoutingContext routingContext) [COLLABORATORS] param routingContext:RoutingContext getBodyAsJson/0,fail/1,response/0; field discovery:ServiceDiscovery publish/2; field ar failed/0,cause/0,result/0 [FIELDS] read=discovery:ServiceDiscovery [NEW] ...
true
ok
{"focal": {"class": "ServiceDiscoveryRestEndpoint", "name": "publish", "signature": "void publish(RoutingContext routingContext)", "start_line": 3, "modifiers": "private", "params": [{"name": "routingContext", "type": "RoutingContext"}], "return_type": "void"}, "class_info": {"name": "ServiceDiscoveryRestEndpoint", "ki...
54371579_8
class RxPresenter extends Presenter<View> { public void add(Subscription subscription) { subscriptions.add(subscription); } public Observable<View> view(); public void remove(Subscription subscription); public void restartable(int restartableId, Func0<Subscription> factory); public voi...
RxPresenter presenter = new RxPresenter(); Subscription mock = Mockito.mock(Subscription.class); when(mock.isUnsubscribed()).thenReturn(false); presenter.add(mock); presenter.onDestroy(); verify(mock, times(1)).unsubscribe(); verify(mock, atLeastOnce()).isUnsubscr...
[FOCAL] public void RxPresenter.add(Subscription subscription) [CLASS] class RxPresenter extends Presenter<View> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] subscriptions.add/1 [COLLABORATORS] field subscriptions add/1 [DATAFLOW] subscription@param->L2 [CLASS-MEMBERS] Observabl...
/* static context [FOCAL] public void RxPresenter.add(Subscription subscription) [COLLABORATORS] field subscriptions add/1 [CALLS-EXTERNAL] subscriptions.add/1 */
/* static context [FOCAL] public void RxPresenter.add(Subscription subscription) [COLLABORATORS] field subscriptions add/1 [CALLS-EXTERNAL] subscriptions.add/1 */ class RxPresenter extends Presenter<View> { public void add(Subscription subscription) { subscriptions.add(subscription); } public Obse...
true
ok
{"focal": {"class": "RxPresenter", "name": "add", "signature": "void add(Subscription subscription)", "start_line": 3, "modifiers": "public", "params": [{"name": "subscription", "type": "Subscription"}], "return_type": "void"}, "class_info": {"name": "RxPresenter", "kind": "class", "modifiers": "", "superclass": "Prese...
54417824_7
class NetworkMapper { public List<com.nilhcem.devoxxfr.data.app.model.Session> toAppSessions(@Nullable List<Session> from, @NonNull Map<Integer, com.nilhcem.devoxxfr.data.app.model.Speaker> speakersMap) { if (from == null) { return null; } return stream(from).map(session -> new...
// Given LocalDateTime startAt = LocalDateTime.now(); Session session = new Session(1, startAt, 20, Room.EXHIBITION_FLOOR.id, singletonList(10), "title", "description"); Map<Integer, com.nilhcem.devoxxfr.data.app.model.Speaker> speakersMap = new HashMap<>(); speakersMap.put(10, n...
[FOCAL] public List<com.nilhcem.devoxxfr.data.app.model.Session> NetworkMapper.toAppSessions(List<Session> from, Map<Integer, com.nilhcem.devoxxfr.data.app.model.Speaker> speakersMap) [CLASS] class NetworkMapper [METRICS] loc=12 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] stream(from).map(sess...
/* static context [FOCAL] public List<com.nilhcem.devoxxfr.data.app.model.Session> NetworkMapper.toAppSessions(List<Session> from, Map<Integer, com.nilhcem.devoxxfr.data.app.model.Speaker> speakersMap) [PATH1] if(from == null)=T -> return null [PATH2] if(from == null)=F -> return stream(from).map(session -> new com.nil...
/* static context [FOCAL] public List<com.nilhcem.devoxxfr.data.app.model.Session> NetworkMapper.toAppSessions(List<Session> from, Map<Integer, com.nilhcem.devoxxfr.data.app.model.Speaker> speakersMap) [PATH1] if(from == null)=T -> return null [PATH2] if(from == null)=F -> return stream(from).map(session -> new com.nil...
true
ok
{"focal": {"class": "NetworkMapper", "name": "toAppSessions", "signature": "List<com.nilhcem.devoxxfr.data.app.model.Session> toAppSessions(List<Session> from, Map<Integer, com.nilhcem.devoxxfr.data.app.model.Speaker> speakersMap)", "start_line": 3, "modifiers": "public", "params": [{"name": "from", "type": "List<Sessi...
54438413_0
class PokedexPager { public Observable<List<PokemonItem>> pokemon() { return Observable.concat(nextRequests.map(new Func1<HttpUrl, Observable<Page<PokemonItem>>>() { @Override public Observable<Page<PokemonItem>> call(HttpUrl url) { Single<Page<PokemonItem>> call = u...
PokeService service = mock(PokeService.class); when(service.firstPokemonPage()).thenReturn(Single.just(Page.create(0, null, null, Arrays.asList( PokemonItem.create("bulbasaur", HttpUrl.parse("http://url")) )))); PokedexPager pager = new PokedexPager(service); Test...
[FOCAL] public Observable<List<PokemonItem>> PokedexPager.pokemon() [CLASS] class PokedexPager [METRICS] loc=26 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Observable.concat(nextRequests.map(new Func1<HttpUrl, Obs....map/1, Observable.concat(nextRequests.map(new Func1<HttpUrl, Obs....takeUntil...
/* static context [FOCAL] public Observable<List<PokemonItem>> PokedexPager.pokemon() [COLLABORATORS] field nextRequests map/1; field api firstPokemonPage/0,nextPokemonPage/1; field url toString/0; field nextPage set/1; field page next/0,results/0 [NEW] Func1<HttpUrl, Observable<Page<PokemonItem>>>, Action1<Page<Pokemo...
/* static context [FOCAL] public Observable<List<PokemonItem>> PokedexPager.pokemon() [COLLABORATORS] field nextRequests map/1; field api firstPokemonPage/0,nextPokemonPage/1; field url toString/0; field nextPage set/1; field page next/0,results/0 [NEW] Func1<HttpUrl, Observable<Page<PokemonItem>>>, Action1<Page<Pokemo...
true
ok
{"focal": {"class": "PokedexPager", "name": "pokemon", "signature": "Observable<List<PokemonItem>> pokemon()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Observable<List<PokemonItem>>"}, "class_info": {"name": "PokedexPager", "kind": "class", "modifiers": "", "superclass": null, "interfaces":...
54478052_12
class SignOut { public Observable<Void> execute() { return mRepository.query(new SessionQuery.SignOut()); } public SignOut(Repository<? extends User> repository); @Mock private Repository<ExampleUser> mMockRepository; private SignOut mTarget; } class SignOutTest { @Mock p...
// Setup when(mMockRepository.query(eq(new SessionQuery.SignOut()))) .thenReturn(Observable.empty()); // Execute mTarget.execute(); // Assert verify(mMockRepository, times(1)).query(eq(new SessionQuery.SignOut())); } }
[FOCAL] public Observable<Void> SignOut.execute() [CLASS] class SignOut [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] mRepository.query/1 [NEW] SessionQuery.SignOut [COLLABORATORS] field mRepository query/1 [CLASS-MEMBERS] SignOut(Repository<? extends User> repository) [TEST] Sig...
/* static context [FOCAL] public Observable<Void> SignOut.execute() [COLLABORATORS] field mRepository query/1 [NEW] SessionQuery.SignOut [CALLS-EXTERNAL] mRepository.query/1 */
/* static context [FOCAL] public Observable<Void> SignOut.execute() [COLLABORATORS] field mRepository query/1 [NEW] SessionQuery.SignOut [CALLS-EXTERNAL] mRepository.query/1 */ class SignOut { public Observable<Void> execute() { return mRepository.query(new SessionQuery.SignOut()); } public SignO...
true
ok
{"focal": {"class": "SignOut", "name": "execute", "signature": "Observable<Void> execute()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Observable<Void>"}, "class_info": {"name": "SignOut", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "mMockRep...
54492045_0
class Tools { public static boolean intToBool (int i) { return !(i == 0); } public static int getRandom(int min, int max); public static String getMethodName(final int depth); public static Transaction applyBIP69(Transaction transaction); public static List<TransactionSignature> getCha...
assertEquals(Tools.intToBool(1), true); assertEquals(Tools.intToBool(0), false); assertEquals(Tools.intToBool(2), true); assertEquals(Tools.intToBool(3), true); } }
[FOCAL] public static boolean Tools.intToBool(int i) [CLASS] class Tools [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [INPUTS] branches=- | result=i [DATAFLOW] i@param->L2 [CLASS-MEMBERS] int getRandom(int min, int max); String getMethodName(int depth); Transaction applyBIP69(Transaction transac...
/* static context [FOCAL] public static boolean Tools.intToBool(int i) [INPUTS] branches=- | result=i */
/* static context [FOCAL] public static boolean Tools.intToBool(int i) [INPUTS] branches=- | result=i */ class Tools { public static boolean intToBool (int i) { return !(i == 0); } public static int getRandom(int min, int max); public static String getMethodName(final int depth); public st...
true
ok
{"focal": {"class": "Tools", "name": "intToBool", "signature": "boolean intToBool(int i)", "start_line": 3, "modifiers": "public static", "params": [{"name": "i", "type": "int"}], "return_type": "boolean"}, "class_info": {"name": "Tools", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields...
54584892_4
class Schema implements AttributeContainer { public void setAttributes(List<Attribute> attributes) { attributeNamesMap.clear(); for (Attribute attribute : attributes) { String name = attribute.getName(); if (name == null) { LOG.warn("Attribute name was null, skipping name indexing");...
fail("Not yet implemented"); } }
[FOCAL] public void Schema.setAttributes(List<Attribute> attributes) [CLASS] class Schema implements AttributeContainer [METRICS] loc=14 cc=3 branches=1 loops=1 returns=0 throws=0 nesting=2 [CALLS-EXTERNAL] attributeNamesMap.clear/0, Attribute.getName/0, LOG.warn/1, attributeNamesMap.put/2, String.toLowerCase/0 [FIELDS...
/* static context [FOCAL] public void Schema.setAttributes(List<Attribute> attributes) [PATH1] foreach(Attribute attribute : attributes)=T -> if(name == null)=T -> exit loop [PATH2] foreach(Attribute attribute : attributes)=F [PATH3] foreach(Attribute attribute : attributes)=T -> if(name == null)=F -> exit loop [INPUTS...
/* static context [FOCAL] public void Schema.setAttributes(List<Attribute> attributes) [PATH1] foreach(Attribute attribute : attributes)=T -> if(name == null)=T -> exit loop [PATH2] foreach(Attribute attribute : attributes)=F [PATH3] foreach(Attribute attribute : attributes)=T -> if(name == null)=F -> exit loop [INPUTS...
true
ok
{"focal": {"class": "Schema", "name": "setAttributes", "signature": "void setAttributes(List<Attribute> attributes)", "start_line": 3, "modifiers": "public", "params": [{"name": "attributes", "type": "List<Attribute>"}], "return_type": "void"}, "class_info": {"name": "Schema", "kind": "class", "modifiers": "", "supercl...
54587242_1
class FilesArchiverFactory { public static FilesArchiver createFromURI(String uri) throws IOException { try { URI outputURI = new URI(uri); String scheme = outputURI.getScheme(); logger.info("Got scheme " + scheme + " for URI " + uri); if (scheme...
String tarFilePath = "testfolder.tar"; File tarFile = new File(tarFilePath); tarFile.delete(); FilesArchiver archiver = FilesArchiverFactory.createFromURI( tarFilePath); assertEquals("No scheme with tar extension should create a TarArchiver", archi...
[FOCAL] public static FilesArchiver FilesArchiverFactory.createFromURI(String uri) [CLASS] class FilesArchiverFactory [METRICS] loc=25 cc=6 branches=4 loops=0 returns=4 throws=2 nesting=2 [CALLS-INTERNAL] FilesArchiver makeDirectoryArchiver(File outputFile); FilesArchiver makeHdfsArchiver(String outputFolder); FilesArc...
/* static context [FOCAL] public static FilesArchiver FilesArchiverFactory.createFromURI(String uri) [THROWS-WHEN] IllegalArgumentException when try-body throws [THROWS-WHEN] IllegalArgumentException when !(scheme == null || scheme.equalsIgnoreCase(EMPTY_STRING)) && !scheme.equalsIgnoreCase(FILE_SCHEME) && !scheme.equa...
/* static context [FOCAL] public static FilesArchiver FilesArchiverFactory.createFromURI(String uri) [THROWS-WHEN] IllegalArgumentException when try-body throws [THROWS-WHEN] IllegalArgumentException when !(scheme == null || scheme.equalsIgnoreCase(EMPTY_STRING)) && !scheme.equalsIgnoreCase(FILE_SCHEME) && !scheme.equa...
true
ok
{"focal": {"class": "FilesArchiverFactory", "name": "createFromURI", "signature": "FilesArchiver createFromURI(String uri) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "uri", "type": "String"}], "return_type": "FilesArchiver"}, "class_info": {"name": "FilesArchiverFactory", "k...
54620819_7
class PackageList { @Nonnull @MustNotContainNull public List<Package> getPackages() { return this.packages; } public PackageList(@Nonnull @MustNotContainNull final File file, @Nonnull final String text, @Nonnull final ContentProvider contentProvider); @Nonnull static String removeComment(@Nonnull fi...
assertEquals(0, new PackageList(FAKE_FILE, "", STUB_CP).getPackages().size()); } }
[FOCAL] @Nonnull @MustNotContainNull public List<Package> PackageList.getPackages() [CLASS] class PackageList [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [FIELDS] read=packages [CLASS-MEMBERS] PackageList(File file, String text, ContentProvider contentProvider); String removeComment(String text...
/* static context [FOCAL] @Nonnull @MustNotContainNull public List<Package> PackageList.getPackages() [FIELDS] read=packages */
/* static context [FOCAL] @Nonnull @MustNotContainNull public List<Package> PackageList.getPackages() [FIELDS] read=packages */ class PackageList { @Nonnull @MustNotContainNull public List<Package> getPackages() { return this.packages; } public PackageList(@Nonnull @MustNotContainNull final File file, ...
true
ok
{"focal": {"class": "PackageList", "name": "getPackages", "signature": "List<Package> getPackages()", "start_line": 3, "modifiers": "@Nonnull @MustNotContainNull public", "params": [], "return_type": "List<Package>"}, "class_info": {"name": "PackageList", "kind": "class", "modifiers": "", "superclass": null, "interface...
54636367_72
class SignatureTypeResolver { static String resolveSignatureType(ValidationConclusion validationConclusion) { if (CollectionUtils.isEmpty(validationConclusion.getSignatures()) || isTstTypeContainer(validationConclusion)) { return NA; } String signatureFormat = validationConclus...
assertEquals(NA, resolveSignatureType(new ValidationConclusion())); } }
[FOCAL] static String SignatureTypeResolver.resolveSignatureType(ValidationConclusion validationConclusion) [CLASS] class SignatureTypeResolver [METRICS] loc=17 cc=5 branches=4 loops=0 returns=5 throws=0 nesting=1 [CALLS-INTERNAL] boolean isCades(String signatureFormat); boolean isDdoc(String signatureFormat); boolean ...
/* static context [FOCAL] static String SignatureTypeResolver.resolveSignatureType(ValidationConclusion validationConclusion) [PATH1] if(CollectionUtils.isEmpty(validationConclusion.getSignatures()) || isTstTypeContainer(validationConclusion))=F -> if(isDdoc(signatureFormat) || isXades(signatureFormat))=F -> if(isCades...
/* static context [FOCAL] static String SignatureTypeResolver.resolveSignatureType(ValidationConclusion validationConclusion) [PATH1] if(CollectionUtils.isEmpty(validationConclusion.getSignatures()) || isTstTypeContainer(validationConclusion))=F -> if(isDdoc(signatureFormat) || isXades(signatureFormat))=F -> if(isCades...
true
ok
{"focal": {"class": "SignatureTypeResolver", "name": "resolveSignatureType", "signature": "String resolveSignatureType(ValidationConclusion validationConclusion)", "start_line": 3, "modifiers": "static", "params": [{"name": "validationConclusion", "type": "ValidationConclusion"}], "return_type": "String"}, "class_info"...
54650297_55
class Expand implements ValueExpression { @Override public ImmutableList<Value> eval(final ParseState parseState, final Encoding encoding) { final ImmutableList<Value> baseList = bases.eval(parseState, encoding); if (baseList.isEmpty()) { return baseList; } return co...
ImmutableList<Value> result = exp(ref("a"), con(SIZE)).eval(createFromByteStream(DUMMY_STREAM).add(PARSEVALUE_2).add(PARSEVALUE_1), enc()); assertEquals(2 * SIZE, result.size); for (int i = 0; i < SIZE; i++) { assertEquals(VALUE_1, result.head.asNumeric().intValueExact()); ...
[FOCAL] @Override public ImmutableList<Value> Expand.eval(ParseState parseState, Encoding encoding) [CLASS] class Expand implements ValueExpression [METRICS] loc=11 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] Trampoline<ImmutableList<Value>> expand(ImmutableList<Value> baseList, int countValue...
/* static context [FOCAL] @Override public ImmutableList<Value> Expand.eval(ParseState parseState, Encoding encoding) [PATH1] if(baseList.isEmpty())=T -> return baseList [PATH2] if(baseList.isEmpty())=F -> return count.evalSingle(parseState, encoding) .filter(countValue -> !count... [INPUTS] branches=encoding, parseSta...
/* static context [FOCAL] @Override public ImmutableList<Value> Expand.eval(ParseState parseState, Encoding encoding) [PATH1] if(baseList.isEmpty())=T -> return baseList [PATH2] if(baseList.isEmpty())=F -> return count.evalSingle(parseState, encoding) .filter(countValue -> !count... [INPUTS] branches=encoding, parseSta...
true
ok
{"focal": {"class": "Expand", "name": "eval", "signature": "ImmutableList<Value> eval(ParseState parseState, Encoding encoding)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "parseState", "type": "ParseState"}, {"name": "encoding", "type": "Encoding"}], "return_type": "ImmutableList<Value>"}, ...
54671444_27
class ByteArrayParameter extends AbstractParameter<byte[][]> { @Override public byte[][] valueIn(String text, Type type) { if (text == null) return null; String[] values = text.split(regexSplitter); if (values.length == 0) return null; byte[][] arrays = new byte[values.length][]; for (int i=0; i<values...
ByteArrayParameter bap = new ByteArrayParameter("a", "aye", " "); byte[][] values = bap.valueIn("1", null); assertNull(values); values = bap.valueIn("1 4", null); assertNull(values); values = bap.valueIn("e 7", null); assertNull(values); values = bap.valu...
[FOCAL] @Override public byte[][] ByteArrayParameter.valueIn(String text, Type type) [CLASS] class ByteArrayParameter extends AbstractParameter<byte[][]> [METRICS] loc=18 cc=5 branches=3 loops=1 returns=4 throws=0 nesting=2 [CALLS-EXTERNAL] String.split/1, StringUtil.asByteArray/1 [PATH1] if(text == null)=F -> if(value...
/* static context [FOCAL] @Override public byte[][] ByteArrayParameter.valueIn(String text, Type type) [PATH1] if(text == null)=F -> if(values.length == 0)=F -> for(i<values.length)=T -> if(arrays[i] == null)=F -> exit loop -> return arrays [PATH2] if(text == null)=T -> return null [PATH3] if(text == null)=F -> if(valu...
/* static context [FOCAL] @Override public byte[][] ByteArrayParameter.valueIn(String text, Type type) [PATH1] if(text == null)=F -> if(values.length == 0)=F -> for(i<values.length)=T -> if(arrays[i] == null)=F -> exit loop -> return arrays [PATH2] if(text == null)=T -> return null [PATH3] if(text == null)=F -> if(valu...
true
ok
{"focal": {"class": "ByteArrayParameter", "name": "valueIn", "signature": "byte[][] valueIn(String text, Type type)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "text", "type": "String"}, {"name": "type", "type": "Type"}], "return_type": "byte[][]"}, "class_info": {"name": "ByteArrayParameter...
54709439_5
class OIDCUserManager { public Principal updateUser(IDTokenClaimsSet idToken, UserInfo userInfo) throws XWikiException, QueryException, OIDCException { // Check allowed/forbidden groups checkAllowedGroups(userInfo); Map<String, String> formatMap = createFormatMap(idToken, userI...
this.oldcore.getConfigurationSource().setProperty(OIDCClientConfiguration.PROP_GROUPS_ALLOWED, Arrays.asList("pgroup1", "pgroup2")); this.oldcore.getConfigurationSource().setProperty(OIDCClientConfiguration.PROP_GROUPS_CLAIM, "groupclaim"); this.oldcore.getConfigurationSource().setPr...
[FOCAL] public Principal OIDCUserManager.updateUser(IDTokenClaimsSet idToken, UserInfo userInfo) [CLASS] class OIDCUserManager [METRICS] loc=146 cc=17 branches=15 loops=0 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] Map<String, String> createFormatMap(IDTokenClaimsSet idToken, UserInfo userInfo); String formatSubjec(S...
class OIDCUserManager { public Principal updateUser(IDTokenClaimsSet idToken, UserInfo userInfo) throws XWikiException, QueryException, OIDCException { // Check allowed/forbidden groups checkAllowedGroups(userInfo); Map<String, String> formatMap = createFormatMap(idToken, userI...
false
ok
{"focal": {"class": "OIDCUserManager", "name": "updateUser", "signature": "Principal updateUser(IDTokenClaimsSet idToken, UserInfo userInfo) throws XWikiException, QueryException, OIDCException", "start_line": 3, "modifiers": "public", "params": [{"name": "idToken", "type": "IDTokenClaimsSet"}, {"name": "userInfo", "ty...
54712998_14
class MetaWeblog { public String newPost(String blogid, Post post, boolean publish) throws XmlRpcException { if (blogid == null || post == null || post.getDateCreated() == null || post.getDescription() == null || post.getTitle() == null) { throw new IllegalArgumentException( ...
Object[] pramas = {"1", configInfo.getUserName(), configInfo.getPassword(), ReflectUtil.toXMLRPCParams(post), true}; String postId = "2"; when(xmlRpcClient.execute(anyString(), any(Object[].class))).thenReturn(postId); assertThat(metaWeblog.newPost("1", post, true)).isEqualTo(postId); ...
[FOCAL] public String MetaWeblog.newPost(String blogid, Post post, boolean publish) [CLASS] class MetaWeblog [METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] Post.getDateCreated/0, Post.getDescription/0, Post.getTitle/0, ConfigInfo.getUserName/0, ConfigInfo.getPassword/0, ReflectUti...
/* static context [FOCAL] public String MetaWeblog.newPost(String blogid, Post post, boolean publish) [THROWS-WHEN] IllegalArgumentException when (blogid == null || post == null || post.getDateCreated() == null || post.getDescription() == null || post.getTitle() ... [PATH1] if((blogid == null || post == null || post.ge...
/* static context [FOCAL] public String MetaWeblog.newPost(String blogid, Post post, boolean publish) [THROWS-WHEN] IllegalArgumentException when (blogid == null || post == null || post.getDateCreated() == null || post.getDescription() == null || post.getTitle() ... [PATH1] if((blogid == null || post == null || post.ge...
true
ok
{"focal": {"class": "MetaWeblog", "name": "newPost", "signature": "String newPost(String blogid, Post post, boolean publish) throws XmlRpcException", "start_line": 3, "modifiers": "public", "params": [{"name": "blogid", "type": "String"}, {"name": "post", "type": "Post"}, {"name": "publish", "type": "boolean"}], "retur...
54755680_10
class PodcastDirectoryHelper { public static String getITunesId(Uri uri) { if (uri == null) { throw new IllegalArgumentException("uri is null"); } String id = ""; List<String> segments = uri.getPathSegments(); for (int i = 0; segments != null && i < segments.s...
Uri uri = Mockito.mock(Uri.class); when(uri.getPathSegments()).thenReturn( Arrays.asList("us", "podcast", "the-vergecast", "id430333725")); String id = PodcastDirectoryHelper.getITunesId(uri); Assert.assertEquals("430333725", id); } }
[FOCAL] public static String PodcastDirectoryHelper.getITunesId(Uri uri) [CLASS] class PodcastDirectoryHelper [METRICS] loc=18 cc=4 branches=2 loops=1 returns=1 throws=1 nesting=2 [CALLS-EXTERNAL] Uri.getPathSegments/0, List<String>.size/0, segments.get(i).startsWith/1, List<String>.get/1, segments.get(i).replace/2 [NE...
/* static context [FOCAL] public static String PodcastDirectoryHelper.getITunesId(Uri uri) [THROWS-WHEN] IllegalArgumentException when uri == null [PATH1] if(uri == null)=F -> for(segments != null && i < segments.size())=T -> if(segments.get(i).startsWith("id"))=F -> exit loop -> return id [PATH2] if(uri == null)=T -> ...
/* static context [FOCAL] public static String PodcastDirectoryHelper.getITunesId(Uri uri) [THROWS-WHEN] IllegalArgumentException when uri == null [PATH1] if(uri == null)=F -> for(segments != null && i < segments.size())=T -> if(segments.get(i).startsWith("id"))=F -> exit loop -> return id [PATH2] if(uri == null)=T -> ...
true
ok
{"focal": {"class": "PodcastDirectoryHelper", "name": "getITunesId", "signature": "String getITunesId(Uri uri)", "start_line": 3, "modifiers": "public static", "params": [{"name": "uri", "type": "Uri"}], "return_type": "String"}, "class_info": {"name": "PodcastDirectoryHelper", "kind": "class", "modifiers": "", "superc...
54767260_93
class GSSCallback extends SaslRpcServer.SaslGssCallbackHandler { boolean allowConnect(String principal) { String allowedPrincipals = conf.get(ServerConfig.ALLOW_CONNECT); if (allowedPrincipals == null) { return false; } String principalShortName; if (KerberosName.hasRulesBeenSet()) { ...
//Test with ruleset not set String validPrincipal = "hive@GCE.CLOUDERA.COM"; assertTrue("Authenticate valid user", callBack.allowConnect(validPrincipal)); String invalidPrincipal = "impala@GCE.CLOUDERA.COM"; assertFalse("Do not authenticate invalid user", callBack.allowConnect(invalidPrincipal)); ...
[FOCAL] boolean GSSCallback.allowConnect(String principal) [CLASS] class GSSCallback extends SaslRpcServer.SaslGssCallbackHandler [METRICS] loc=37 cc=8 branches=4 loops=1 returns=3 throws=0 nesting=3 [CALLS-INTERNAL] String getShortName(String principal); boolean comparePrincipals(String principal1, String principal2) ...
/* static context [FOCAL] boolean GSSCallback.allowConnect(String principal) [PATH1] if(allowedPrincipals == null)=F -> if(KerberosName.hasRulesBeenSet())=T -> try-body throws -> foreach(String item : items)=T -> if(comparePrincipals(item, principalShortName))=F -> exit loop -> return false [PATH2] if(allowedPrincipals...
/* static context [FOCAL] boolean GSSCallback.allowConnect(String principal) [PATH1] if(allowedPrincipals == null)=F -> if(KerberosName.hasRulesBeenSet())=T -> try-body throws -> foreach(String item : items)=T -> if(comparePrincipals(item, principalShortName))=F -> exit loop -> return false [PATH2] if(allowedPrincipals...
true
ok
{"focal": {"class": "GSSCallback", "name": "allowConnect", "signature": "boolean allowConnect(String principal)", "start_line": 3, "modifiers": "", "params": [{"name": "principal", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "GSSCallback", "kind": "class", "modifiers": "", "superclass": "SaslR...
54821190_1
class PackageListActivityPresenterImpl implements IPackageListActivityPresenter { @Override public void loadPackages(boolean refresh) { if (mView != null) { mView.hideContentView(); mView.showWaitDialog(); mPackageInteractor.getInstalledPackages(refresh) ...
ArrayList<InstalledPackageHeader> toReturn = new ArrayList<>(); toReturn.add(Mockito.mock(InstalledPackageHeader.class)); when(mPackageInteractor.getInstalledPackages(false)).thenReturn(Observable.just(toReturn)); mPresenter.loadPackages(false); verify(mView, times(1)).hideCon...
[FOCAL] @Override public void PackageListActivityPresenterImpl.loadPackages(boolean refresh) [CLASS] class PackageListActivityPresenterImpl implements IPackageListActivityPresenter [METRICS] loc=30 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=3 [CALLS-EXTERNAL] IPackageListView.hideContentView/0, IPackageListView...
/* static context [FOCAL] @Override public void PackageListActivityPresenterImpl.loadPackages(boolean refresh) [PATH1] if(mView != null)=T [PATH2] if(mView != null)=F [INPUTS] branches=mView | result=- [COLLABORATORS] field mView:IPackageListView hideContentView/0,showWaitDialog/0,setInstalledPackages/1,hideWaitDialog/...
/* static context [FOCAL] @Override public void PackageListActivityPresenterImpl.loadPackages(boolean refresh) [PATH1] if(mView != null)=T [PATH2] if(mView != null)=F [INPUTS] branches=mView | result=- [COLLABORATORS] field mView:IPackageListView hideContentView/0,showWaitDialog/0,setInstalledPackages/1,hideWaitDialog/...
true
ok
{"focal": {"class": "PackageListActivityPresenterImpl", "name": "loadPackages", "signature": "void loadPackages(boolean refresh)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "refresh", "type": "boolean"}], "return_type": "void"}, "class_info": {"name": "PackageListActivityPresenterImpl", "kin...
54830123_3
class SwaggerBasePathRewritingFilter extends SendResponseFilter { @Override public Object run() { RequestContext context = RequestContext.getCurrentContext(); context.getResponse().setCharacterEncoding("UTF-8"); String rewrittenResponse = rewriteBasePath(context); context.setRe...
MockHttpServletRequest request = new MockHttpServletRequest("GET", "/service1" + DEFAULT_URL); RequestContext context = RequestContext.getCurrentContext(); context.setRequest(request); MockHttpServletResponse response = new MockHttpServletResponse(); context.setResponse(response...
[FOCAL] @Override public Object SwaggerBasePathRewritingFilter.run() [CLASS] class SwaggerBasePathRewritingFilter extends SendResponseFilter [METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String rewriteBasePath(RequestContext context) [CALLS-EXTERNAL] RequestContext.getCurrentCont...
/* static context [FOCAL] @Override public Object SwaggerBasePathRewritingFilter.run() [CALLS-INTERNAL] String rewriteBasePath(RequestContext context) [CALLS-EXTERNAL] RequestContext.getCurrentContext/0, context.getResponse().setCharacterEncoding/1, RequestContext.getResponse/0, RequestContext.setResponseBody/1 */
/* static context [FOCAL] @Override public Object SwaggerBasePathRewritingFilter.run() [CALLS-INTERNAL] String rewriteBasePath(RequestContext context) [CALLS-EXTERNAL] RequestContext.getCurrentContext/0, context.getResponse().setCharacterEncoding/1, RequestContext.getResponse/0, RequestContext.setResponseBody/1 */ clas...
true
ok
{"focal": {"class": "SwaggerBasePathRewritingFilter", "name": "run", "signature": "Object run()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Object"}, "class_info": {"name": "SwaggerBasePathRewritingFilter", "kind": "class", "modifiers": "", "superclass": "SendResponseFilter", "inte...
54853773_0
class Utils { static Class<?> messageClass(Object message) { final Class<?> messageClass = message.getClass(); if (messageClass.isAnonymousClass() || messageClass.getSimpleName().contains("-$Lambda$") // Jack || messageClass.getSimpleName().contains("$$Lambda$")) ...
SAMType instance = new SAMType() { @Override public void doSmt() { } }; assertThat(Utils.messageClass(instance), CoreMatchers.<Class<?>>equalTo(SAMType.class)); } }
[FOCAL] static Class<?> Utils.messageClass(Object message) [CLASS] class Utils [METRICS] loc=11 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] Object.getClass/0, Class<?>.isAnonymousClass/0, messageClass.getSimpleName().contains/1, Class<?>.getSimpleName/0, Class<?>.getInterfaces/0 [PATH1] if((me...
/* static context [FOCAL] static Class<?> Utils.messageClass(Object message) [PATH1] if((messageClass.isAnonymousClass() || messageClass.getSimpleName().contains("-$Lambda$") // Jack || messageClass.getSim...)=T -> return messageClass.getInterfaces()[0] [PATH2] if((messageClass.isAnonymousClass() || messageClass.getSim...
/* static context [FOCAL] static Class<?> Utils.messageClass(Object message) [PATH1] if((messageClass.isAnonymousClass() || messageClass.getSimpleName().contains("-$Lambda$") // Jack || messageClass.getSim...)=T -> return messageClass.getInterfaces()[0] [PATH2] if((messageClass.isAnonymousClass() || messageClass.getSim...
true
ok
{"focal": {"class": "Utils", "name": "messageClass", "signature": "Class<?> messageClass(Object message)", "start_line": 3, "modifiers": "static", "params": [{"name": "message", "type": "Object"}], "return_type": "Class<?>"}, "class_info": {"name": "Utils", "kind": "class", "modifiers": "", "superclass": null, "interfa...
54889602_1
class PipelineUtils implements Serializable { public static Set<String> extractRequiredInputColumns(Transformer[] transformers) { Set<String> inputColumns = new HashSet<>(); //Add inputs for each transformer in the input set for(Transformer t : transformers) { inputColumns.addA...
Transformer t = createTransformer(Arrays.asList("a", "b", "c"), Arrays.asList("a1", "b1", "c")); Set<String> inputs = PipelineUtils.extractRequiredInputColumns(new Transformer[] {t}); assertEquals(inputs.size(), 3); assertTrue(inputs.containsAll(Arrays.asList("a","b","c"))); asse...
[FOCAL] public static Set<String> PipelineUtils.extractRequiredInputColumns(Transformer[] transformers) [CLASS] class PipelineUtils implements Serializable [METRICS] loc=20 cc=3 branches=0 loops=2 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] Set<String>.addAll/1, Transformer.getInputKeys/0, Transformer.getOutputKeys/0...
/* static context [FOCAL] public static Set<String> PipelineUtils.extractRequiredInputColumns(Transformer[] transformers) [PATH1] foreach(Transformer t : transformers)#1=T -> exit loop -> foreach(Transformer t : transformers)#2=F -> return inputColumns [PATH2] foreach(Transformer t : transformers)#1=F -> foreach(Transf...
/* static context [FOCAL] public static Set<String> PipelineUtils.extractRequiredInputColumns(Transformer[] transformers) [PATH1] foreach(Transformer t : transformers)#1=T -> exit loop -> foreach(Transformer t : transformers)#2=F -> return inputColumns [PATH2] foreach(Transformer t : transformers)#1=F -> foreach(Transf...
true
ok
{"focal": {"class": "PipelineUtils", "name": "extractRequiredInputColumns", "signature": "Set<String> extractRequiredInputColumns(Transformer[] transformers)", "start_line": 3, "modifiers": "public static", "params": [{"name": "transformers", "type": "Transformer[]"}], "return_type": "Set<String>"}, "class_info": {"nam...
54898732_267
class ConcurrentMapBasedLongToIntFunctionMemoizer extends ConcurrentMapBasedMemoizer<KEY, Integer> implements LongToIntFunction { @Override public int applyAsInt(final long value) { final KEY key = keyFunction.apply(value); return computeIfAbsent(key, givenKey -> Integer.valueOf(function.applyA...
// given final ConcurrentMap<Long, Integer> cache = new ConcurrentHashMap<>(); final LongToIntFunction function = input -> 123; final LongFunction<Long> keyFunction = Long::valueOf; // when final ConcurrentMapBasedLongToIntFunctionMemoizer<Long> memoizer = new Concurrent...
[FOCAL] @Override public int ConcurrentMapBasedLongToIntFunctionMemoizer.applyAsInt(long value) [CLASS] class ConcurrentMapBasedLongToIntFunctionMemoizer extends ConcurrentMapBasedMemoizer<KEY, Integer> implements LongToIntFunction [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] ke...
/* static context [FOCAL] @Override public int ConcurrentMapBasedLongToIntFunctionMemoizer.applyAsInt(long value) [INPUTS] branches=- | result=value [COLLABORATORS] field keyFunction apply/1; field function applyAsInt/1 [CALLS-EXTERNAL] keyFunction.apply/1, computeIfAbsent(key, givenKey -> Integer.valueOf(function....i...
/* static context [FOCAL] @Override public int ConcurrentMapBasedLongToIntFunctionMemoizer.applyAsInt(long value) [INPUTS] branches=- | result=value [COLLABORATORS] field keyFunction apply/1; field function applyAsInt/1 [CALLS-EXTERNAL] keyFunction.apply/1, computeIfAbsent(key, givenKey -> Integer.valueOf(function....i...
true
ok
{"focal": {"class": "ConcurrentMapBasedLongToIntFunctionMemoizer", "name": "applyAsInt", "signature": "int applyAsInt(long value)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "value", "type": "long"}], "return_type": "int"}, "class_info": {"name": "ConcurrentMapBasedLongToIntFunctionMemoizer"...
54903613_14
class CompassInstaller extends ScssFrameworkInstaller { protected void correctFilesImports(final File sourcesFolder, final int level) throws IOException { final File[] listFiles = sourcesFolder.listFiles(); if (listFiles == null) { return; } for (final File file : listFiles) { if (file.isDirectory()) { ...
// Prepare final CompassInstaller compassInstaller = new CompassInstaller( this.project, this.logger); // Level 0 final File scssFileLevel0 = this.folder.newFile(".scss"); FileUtils.write(scssFileLevel0, "@import \"compass/test0\"",Charset.defaultCharset()); ...
[FOCAL] protected void CompassInstaller.correctFilesImports(File sourcesFolder, int level) [CLASS] class CompassInstaller extends ScssFrameworkInstaller [METRICS] loc=13 cc=5 branches=3 loops=1 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] void correctFileImport(int level, File file) [CALLS-EXTERNAL] File.listFiles/0, ...
/* static context [FOCAL] protected void CompassInstaller.correctFilesImports(File sourcesFolder, int level) [PATH1] if(listFiles == null)=F -> foreach(File file : listFiles)=T -> if(file.isDirectory())=F -> if(file.getName().endsWith(".scss"))=T -> exit loop [PATH2] if(listFiles == null)=T -> return [PATH3] if(listFil...
/* static context [FOCAL] protected void CompassInstaller.correctFilesImports(File sourcesFolder, int level) [PATH1] if(listFiles == null)=F -> foreach(File file : listFiles)=T -> if(file.isDirectory())=F -> if(file.getName().endsWith(".scss"))=T -> exit loop [PATH2] if(listFiles == null)=T -> return [PATH3] if(listFil...
true
ok
{"focal": {"class": "CompassInstaller", "name": "correctFilesImports", "signature": "void correctFilesImports(File sourcesFolder, int level) throws IOException", "start_line": 3, "modifiers": "protected", "params": [{"name": "sourcesFolder", "type": "File"}, {"name": "level", "type": "int"}], "return_type": "void"}, "c...
54904766_6
class BitcoinScriptPatternParser { public static String getPaymentDestination(byte[] scriptPubKey) { if (scriptPubKey==null) { return null; } // test if anyone can spend output if (scriptPubKey.length==0) { return "anyone"; // need to check also ScriptSig for OP_TRUE } // test if standard transaction Bitcoin...
String result = BitcoinScriptPatternParser.getPaymentDestination(new byte[0]); assertEquals( "anyone",result,"Empty script means anyone can spend"); } }
[FOCAL] public static String BitcoinScriptPatternParser.getPaymentDestination(byte[] scriptPubKey) [CLASS] class BitcoinScriptPatternParser [METRICS] loc=44 cc=10 branches=9 loops=0 returns=10 throws=0 nesting=1 [CALLS-INTERNAL] String checkP2WPKH(byte[] scriptPubKey); String checkP2WPKHP2SH(byte[] scriptPubKey); Strin...
/* static context [FOCAL] public static String BitcoinScriptPatternParser.getPaymentDestination(byte[] scriptPubKey) [PATH1] if(scriptPubKey==null)=F -> if(scriptPubKey.length==0)=F -> if(payToHashSegwit!=null)=F -> if(payToP2WSHSegwit!=null)=F -> if(payToPubKeySegwit!=null)=F -> if(payToHash!=null)=F -> if(payToPubKey...
/* static context [FOCAL] public static String BitcoinScriptPatternParser.getPaymentDestination(byte[] scriptPubKey) [PATH1] if(scriptPubKey==null)=F -> if(scriptPubKey.length==0)=F -> if(payToHashSegwit!=null)=F -> if(payToP2WSHSegwit!=null)=F -> if(payToPubKeySegwit!=null)=F -> if(payToHash!=null)=F -> if(payToPubKey...
true
ok
{"focal": {"class": "BitcoinScriptPatternParser", "name": "getPaymentDestination", "signature": "String getPaymentDestination(byte[] scriptPubKey)", "start_line": 3, "modifiers": "public static", "params": [{"name": "scriptPubKey", "type": "byte[]"}], "return_type": "String"}, "class_info": {"name": "BitcoinScriptPatte...
54905500_2
class StandardJsonLogger implements JsonLogger { @Override public JsonLogger list(String key, List list) { try { jsonObject.add(key, gson.toJsonTree(list)); } catch (Exception e) { jsonObject.add(key, gson.toJsonTree(formatException(e))); } return this; } public StandardJsonLo...
List<String> list = new LinkedList<>(); list.add("value1"); list.add("value2"); logger.list("someList", list).log(); Mockito.verify(this.messageConsumer).accept(Mockito.contains("\"someList\":[\"value1\",\"value2\"]")); } }
[FOCAL] @Override public JsonLogger StandardJsonLogger.list(String key, List list) [CLASS] class StandardJsonLogger implements JsonLogger [METRICS] loc=10 cc=2 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] String formatException(Exception e) [CALLS-EXTERNAL] jsonObject.add/2, Gson.toJsonTree/1 [FIELD...
/* static context [FOCAL] @Override public JsonLogger StandardJsonLogger.list(String key, List list) [PATH1] try-body throws -> return this [COLLABORATORS] field jsonObject add/2; field gson:Gson toJsonTree/1 [EXCEPTIONS] catches Exception e [CALLS-INTERNAL] String formatException(Exception e) [FIELDS] read=gson:Gson [...
/* static context [FOCAL] @Override public JsonLogger StandardJsonLogger.list(String key, List list) [PATH1] try-body throws -> return this [COLLABORATORS] field jsonObject add/2; field gson:Gson toJsonTree/1 [EXCEPTIONS] catches Exception e [CALLS-INTERNAL] String formatException(Exception e) [FIELDS] read=gson:Gson [...
true
ok
{"focal": {"class": "StandardJsonLogger", "name": "list", "signature": "JsonLogger list(String key, List list)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "key", "type": "String"}, {"name": "list", "type": "List"}], "return_type": "JsonLogger"}, "class_info": {"name": "StandardJsonLogger", "...
54914992_6
class SlotListImpl implements SlotList<T> { @Override public Slot find(T listener) { for (Slot slot : list) { if (slot.listener() == listener) { return slot; } } return null; } @Override public int size(); @Override public boolean add...
assertEquals(slotList.find(listeners[3]).listener(), listeners[3]); assertThat(slotList.find(null), nullValue()); assertThat(slotList.find(mock(Runnable.class)), nullValue()); } }
[FOCAL] @Override public Slot SlotListImpl.find(T listener) [CLASS] class SlotListImpl implements SlotList<T> [METRICS] loc=9 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] Slot.listener/0 [PATH1] foreach(Slot slot : list)=T -> if(slot.listener() == listener)=F -> exit loop -> return null [PATH2]...
/* static context [FOCAL] @Override public Slot SlotListImpl.find(T listener) [PATH1] foreach(Slot slot : list)=T -> if(slot.listener() == listener)=F -> exit loop -> return null [PATH2] foreach(Slot slot : list)=T -> if(slot.listener() == listener)=T -> return slot [PATH3] foreach(Slot slot : list)=F -> return null [I...
/* static context [FOCAL] @Override public Slot SlotListImpl.find(T listener) [PATH1] foreach(Slot slot : list)=T -> if(slot.listener() == listener)=F -> exit loop -> return null [PATH2] foreach(Slot slot : list)=T -> if(slot.listener() == listener)=T -> return slot [PATH3] foreach(Slot slot : list)=F -> return null [I...
true
ok
{"focal": {"class": "SlotListImpl", "name": "find", "signature": "Slot find(T listener)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "listener", "type": "T"}], "return_type": "Slot"}, "class_info": {"name": "SlotListImpl", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "S...
54973527_552
class ChangeConfig extends AbstractConsoleController { @RequestMapping(value = {"/config/sentinel/check/" + CLUSTER_NAME_PATH_VARIABLE + "/stop/{maintainMinutes}", "/config/sentinel/check/" + CLUSTER_NAME_PATH_VARIABLE + "/stop"}, method = RequestMethod.POST) public RetMessage stopSentinelCheck(Htt...
AtomicInteger expectedMinutes = new AtomicInteger(0); Mockito.doAnswer(invocation -> { Integer minutes = invocation.getArgumentAt(1, Integer.class); Assert.assertEquals(minutes.intValue(), expectedMinutes.get()); return null; }).when(configService).stopSentine...
[FOCAL] @RequestMapping(value = {"/config/sentinel/check/" + CLUSTER_NAME_PATH_VARIABLE + "/stop/{maintainMinutes}", "/config... RetMessage ChangeConfig.stopSentinelCheck(HttpServletRequest request, String clusterName, Integer maintainMinutes) [CLASS] class ChangeConfig extends AbstractConsoleController [METRICS] loc=1...
/* static context [FOCAL] @RequestMapping(value = {"/config/sentinel/check/" + CLUSTER_NAME_PATH_VARIABLE + "/stop/{maintainMinutes}", "/config... RetMessage ChangeConfig.stopSentinelCheck(HttpServletRequest request, String clusterName, Integer maintainMinutes) [PATH1] if(null == maintainMinutes || maintainMinutes <= 0...
/* static context [FOCAL] @RequestMapping(value = {"/config/sentinel/check/" + CLUSTER_NAME_PATH_VARIABLE + "/stop/{maintainMinutes}", "/config... RetMessage ChangeConfig.stopSentinelCheck(HttpServletRequest request, String clusterName, Integer maintainMinutes) [PATH1] if(null == maintainMinutes || maintainMinutes <= 0...
true
ok
{"focal": {"class": "ChangeConfig", "name": "stopSentinelCheck", "signature": "RetMessage stopSentinelCheck(HttpServletRequest request, String clusterName, Integer maintainMinutes) throws DalException", "start_line": 3, "modifiers": "@RequestMapping(value = {\"/config/sentinel/check/\" + CLUSTER_NAME_PATH_VARIABLE + \"...
54976745_192
class Ellipsoid { public List<Vector3d> samplePoints(final long n) throws RuntimeException { if (!samplingInitialized()) { throw new RuntimeException("Sampling has not been initialized"); } final List<Vector3d> points = isotropicSampling.calculate(new double[] { a, b, c }, n); points.forEach(this::mapTo...
// SETUP final double a = 2.0; final double b = 3.0; final double c = 4.0; final Ellipsoid ellipsoid = new Ellipsoid(a, b, c); final Vector3dc centroid = new Vector3d(4, 5, 6); ellipsoid.setCentroid(centroid); final double sinAlpha = Math.sin(Math.PI / 4.0); final double cosAlpha = Math.cos(Math.PI / ...
[FOCAL] public List<Vector3d> Ellipsoid.samplePoints(long n) [CLASS] class Ellipsoid [METRICS] loc=10 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] boolean samplingInitialized() [CALLS-EXTERNAL] isotropicSampling.calculate/2, List<Vector3d>.forEach/1, p.add/1 [NEW] RuntimeException [EXCEPTIONS] ...
/* static context [FOCAL] public List<Vector3d> Ellipsoid.samplePoints(long n) [THROWS-WHEN] RuntimeException when !samplingInitialized() [PATH1] if(!samplingInitialized())=T -> throw new RuntimeException("Sampling has not been initialized") [PATH2] if(!samplingInitialized())=F -> return points [INPUTS] branches=- | re...
/* static context [FOCAL] public List<Vector3d> Ellipsoid.samplePoints(long n) [THROWS-WHEN] RuntimeException when !samplingInitialized() [PATH1] if(!samplingInitialized())=T -> throw new RuntimeException("Sampling has not been initialized") [PATH2] if(!samplingInitialized())=F -> return points [INPUTS] branches=- | re...
true
ok
{"focal": {"class": "Ellipsoid", "name": "samplePoints", "signature": "List<Vector3d> samplePoints(long n) throws RuntimeException", "start_line": 3, "modifiers": "public", "params": [{"name": "n", "type": "long"}], "return_type": "List<Vector3d>"}, "class_info": {"name": "Ellipsoid", "kind": "class", "modifiers": "", ...
54995528_0
class JSONApiConverter { public <T extends Resource> JSONApiObject<T> fromJson(String jsonObject) { JSONApiObject jsonApiObject = new JSONApiObject(); try { JSONObject json = new JSONObject(jsonObject); HashMap<String, Resource> includes = new HashMap<>(); if (j...
String json = fileLoader.getContent("jsons/conversation.json"); JSONApiObject<Conversation> result = subject.fromJson(json); assertFalse(result.hasErrors()); Conversation conversation = result.getData().get(0); assertEquals("4214653", conversation.getId()); assertEqual...
[FOCAL] public JSONApiObject<T> JSONApiConverter.fromJson(String jsonObject) [CLASS] class JSONApiConverter [METRICS] loc=96 cc=19 branches=13 loops=4 returns=1 throws=0 nesting=6 [CALLS-INTERNAL] Links linksFromJson(JSONObject linksJson); Resource resourceFromJson(JSONObject jsonObject, HashMap<String, Resource> inclu...
/* static context [FOCAL] public JSONApiObject<T> JSONApiConverter.fromJson(String jsonObject) [PATH1] if(json.isNull("errors"))=T -> if(!json.isNull("included"))=T -> for(i < included.length())#1=T -> exit loop -> for(i < included.length())#2=F -> if(!json.isNull("data"))=T -> if(data instanceof JSONObject)=F -> if(da...
/* static context [FOCAL] public JSONApiObject<T> JSONApiConverter.fromJson(String jsonObject) [PATH1] if(json.isNull("errors"))=T -> if(!json.isNull("included"))=T -> for(i < included.length())#1=T -> exit loop -> for(i < included.length())#2=F -> if(!json.isNull("data"))=T -> if(data instanceof JSONObject)=F -> if(da...
true
ok
{"focal": {"class": "JSONApiConverter", "name": "fromJson", "signature": "JSONApiObject<T> fromJson(String jsonObject)", "start_line": 3, "modifiers": "public", "params": [{"name": "jsonObject", "type": "String"}], "return_type": "JSONApiObject<T>"}, "class_info": {"name": "JSONApiConverter", "kind": "class", "modifier...
55090874_3
class DateUtils { public static Date calculateNextTermBeginAfter(Date after, Date startDate, boolean excludeFirstTerm, ValidRuntimes runtimes) { if (after == null) { return null; } if (startDate == null) { return null; } if (runtimes == null) { return null; } Calendar afterCal = Calendar.getIn...
Date startDate = Date.from(ZonedDateTime .ofLocal(LocalDate.of(2016, 9, 23).atStartOfDay(), ZoneId.systemDefault(), null) .toInstant()); ValidRuntimes runtimes = new ValidRuntimes(); runtimes.firstMinRuntimeCount = 6; runtimes.firstMinRuntimeType = IntervalType.MONTHS; runtimes.followingMinRuntimeCou...
[FOCAL] public static Date DateUtils.calculateNextTermBeginAfter(Date after, Date startDate, boolean excludeFirstTerm, ValidRuntimes runtimes) [CLASS] class DateUtils [METRICS] loc=51 cc=10 branches=6 loops=1 returns=4 throws=0 nesting=2 [CALLS-INTERNAL] boolean addToCalendar(Calendar calendar, IntervalType interval, i...
/* static context [FOCAL] public static Date DateUtils.calculateNextTermBeginAfter(Date after, Date startDate, boolean excludeFirstTerm, ValidRuntimes runtimes) [PATH1] if(after == null)=F -> if(startDate == null)=F -> if(runtimes == null)=F -> if(runtimes.fixedTerms)=T -> switch(runtimes.firstMinRuntimeType)=case WEEK...
/* static context [FOCAL] public static Date DateUtils.calculateNextTermBeginAfter(Date after, Date startDate, boolean excludeFirstTerm, ValidRuntimes runtimes) [PATH1] if(after == null)=F -> if(startDate == null)=F -> if(runtimes == null)=F -> if(runtimes.fixedTerms)=T -> switch(runtimes.firstMinRuntimeType)=case WEEK...
true
ok
{"focal": {"class": "DateUtils", "name": "calculateNextTermBeginAfter", "signature": "Date calculateNextTermBeginAfter(Date after, Date startDate, boolean excludeFirstTerm, ValidRuntimes runtimes)", "start_line": 3, "modifiers": "public static", "params": [{"name": "after", "type": "Date"}, {"name": "startDate", "type"...
55091967_9
class RealmAssetHelper { public void loadDatabaseToStorage(String databaseFolder, String databaseName, IRealmAssetHelperStorageListener listener) throws RuntimeException { mOsUtil.clearCache(); if (mOsUtil.isEmpty(databaseName)) { throw new RuntimeException("The database name is empty"...
IRealmAssetHelperStorageListener listener = Mockito.mock(IRealmAssetHelperStorageListener.class); Mockito.when(osUtil.getCurrentDbVersion(Mockito.any(Context.class), Mockito.anyString())).thenReturn(2); Mockito.when(osUtil.getAssetsDbVersion(Mockito.any(Context.class), Mockito.anyString(), Mocki...
[FOCAL] public void RealmAssetHelper.loadDatabaseToStorage(String databaseFolder, String databaseName, IRealmAssetHelperStorageListener listener) [CLASS] class RealmAssetHelper [METRICS] loc=48 cc=11 branches=10 loops=0 returns=0 throws=5 nesting=3 [CALLS-EXTERNAL] mOsUtil.clearCache/0, mOsUtil.isEmpty/1, mOsUtil.isDat...
/* static context [FOCAL] public void RealmAssetHelper.loadDatabaseToStorage(String databaseFolder, String databaseName, IRealmAssetHelperStorageListener listener) [THROWS-WHEN] RuntimeException when mOsUtil.isEmpty(databaseName) [THROWS-WHEN] RuntimeException when !mOsUtil.isEmpty(databaseName) && !mOsUtil.isDatabaseA...
/* static context [FOCAL] public void RealmAssetHelper.loadDatabaseToStorage(String databaseFolder, String databaseName, IRealmAssetHelperStorageListener listener) [THROWS-WHEN] RuntimeException when mOsUtil.isEmpty(databaseName) [THROWS-WHEN] RuntimeException when !mOsUtil.isEmpty(databaseName) && !mOsUtil.isDatabaseA...
true
ok
{"focal": {"class": "RealmAssetHelper", "name": "loadDatabaseToStorage", "signature": "void loadDatabaseToStorage(String databaseFolder, String databaseName, IRealmAssetHelperStorageListener listener) throws RuntimeException", "start_line": 3, "modifiers": "public", "params": [{"name": "databaseFolder", "type": "String...
55123394_4
class ProductGateway { @HystrixCommand(ignoreExceptions = RemoteCallException.class) public List<ProductDto> findAllProducts() { List<ProductDto> productDtos = productClient.findAllProducts(); try { Thread.sleep(2000L); } catch (InterruptedException e) { e.print...
List<ProductDto> productDtos = productGateway.findAllProducts(); assertThat(productDtos.isEmpty(), is(false)); } }
[FOCAL] @HystrixCommand(ignoreExceptions = RemoteCallException.class) public List<ProductDto> ProductGateway.findAllProducts() [CLASS] class ProductGateway [METRICS] loc=13 cc=2 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] productClient.findAllProducts/0, Thread.sleep/1, InterruptedException.printSt...
/* static context [FOCAL] @HystrixCommand(ignoreExceptions = RemoteCallException.class) public List<ProductDto> ProductGateway.findAllProducts() [PATH1] try-body throws -> return productDtos [COLLABORATORS] field productClient findAllProducts/0 [EXCEPTIONS] catches InterruptedException e [CALLS-EXTERNAL] productClient....
/* static context [FOCAL] @HystrixCommand(ignoreExceptions = RemoteCallException.class) public List<ProductDto> ProductGateway.findAllProducts() [PATH1] try-body throws -> return productDtos [COLLABORATORS] field productClient findAllProducts/0 [EXCEPTIONS] catches InterruptedException e [CALLS-EXTERNAL] productClient....
true
ok
{"focal": {"class": "ProductGateway", "name": "findAllProducts", "signature": "List<ProductDto> findAllProducts()", "start_line": 3, "modifiers": "@HystrixCommand(ignoreExceptions = RemoteCallException.class) public", "params": [], "return_type": "List<ProductDto>"}, "class_info": {"name": "ProductGateway", "kind": "cl...
55133617_5
class AnnotationVerifier { void verify(TypeElement type) { Validated validatedAnnotation = type.getAnnotation(Validated.class); if (validatedAnnotation == null) { abortWithError("Annotation processor for @" + Validated.class.getSimpleName() + " was invoked with a typ...
Set<Modifier> modSet = new HashSet<>(); modSet.add(Modifier.PROTECTED); Messager messager = mock(Messager.class); Elements element = mock(Elements.class); Types types = mock(Types.class); AnnotationVerifier verifier = new AnnotationVerifier(messager, element, types); ...
[FOCAL] void AnnotationVerifier.verify(TypeElement type) [CLASS] class AnnotationVerifier [METRICS] loc=30 cc=6 branches=5 loops=0 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] TypeMirror getTypeMirrorFromAnnotation(Validated validated, TypeElement type); boolean implementsAnnotation(TypeElement type); void abortWithEr...
/* static context [FOCAL] void AnnotationVerifier.verify(TypeElement type) [PATH1] if(validatedAnnotation == null)=F -> if(type.getModifiers().contains(Modifier.PRIVATE))=T -> if(type.getModifiers().contains(Modifier.PROTECTED) || type.getModifiers().contains(Modifier.DEFAULT))=T -> if(!CompilerUtils.packageNameOf(type...
/* static context [FOCAL] void AnnotationVerifier.verify(TypeElement type) [PATH1] if(validatedAnnotation == null)=F -> if(type.getModifiers().contains(Modifier.PRIVATE))=T -> if(type.getModifiers().contains(Modifier.PROTECTED) || type.getModifiers().contains(Modifier.DEFAULT))=T -> if(!CompilerUtils.packageNameOf(type...
true
ok
{"focal": {"class": "AnnotationVerifier", "name": "verify", "signature": "void verify(TypeElement type)", "start_line": 3, "modifiers": "", "params": [{"name": "type", "type": "TypeElement"}], "return_type": "void"}, "class_info": {"name": "AnnotationVerifier", "kind": "class", "modifiers": "", "superclass": null, "int...
55151975_5
class MockWebServerPlus implements TestRule { public List<MockResponse> enqueue(String... paths) { if (paths == null) { return null; } List<MockResponse> mockResponseList = new ArrayList<>(); for (String path : paths) { Fixture fixture = Fixture.parseFrom(path, parser); MockResponse...
server.enqueue(Fixtures.SIMPLE_NO_BODY); Response response = execute(); assertFixture(response).statusCode(200); } }
[FOCAL] public List<MockResponse> MockWebServerPlus.enqueue(String... paths) [CLASS] class MockWebServerPlus implements TestRule [METRICS] loc=13 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] Fixture.parseFrom/2, Fixture.toMockResponse/0, MockWebServer.enqueue/1, List<MockResponse>.add/1 [NEW] A...
/* static context [FOCAL] public List<MockResponse> MockWebServerPlus.enqueue(String... paths) [PATH1] if(paths == null)=F -> foreach(String path : paths)=T -> exit loop -> return mockResponseList [PATH2] if(paths == null)=T -> return null [PATH3] if(paths == null)=F -> foreach(String path : paths)=F -> return mockResp...
/* static context [FOCAL] public List<MockResponse> MockWebServerPlus.enqueue(String... paths) [PATH1] if(paths == null)=F -> foreach(String path : paths)=T -> exit loop -> return mockResponseList [PATH2] if(paths == null)=T -> return null [PATH3] if(paths == null)=F -> foreach(String path : paths)=F -> return mockResp...
true
ok
{"focal": {"class": "MockWebServerPlus", "name": "enqueue", "signature": "List<MockResponse> enqueue(String... paths)", "start_line": 3, "modifiers": "public", "params": [{"name": "paths", "type": "String..."}], "return_type": "List<MockResponse>"}, "class_info": {"name": "MockWebServerPlus", "kind": "class", "modifier...
55209260_2
class JSONUtil { public static <T> T toObject(String json, Class<T> clazz) { T object; try { object = mapper.readValue(json, clazz); } catch (Exception e) { LOGGER.error("JSON String Can't covert to Java Object!"); throw new RuntimeException(e); }...
JSONObject jsonObject = new JSONObject(1, "bysocket", 33); String jsonStr = JSONUtil.toJSONString(jsonObject); JSONObject resultObject = JSONUtil.toObject(jsonStr, JSONObject.class); Assert.assertEquals(jsonObject.toString(), resultObject.toString()); } }
[FOCAL] public static T JSONUtil.toObject(String json, Class<T> clazz) [CLASS] class JSONUtil [METRICS] loc=10 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] mapper.readValue/2, LOGGER.error/1 [NEW] RuntimeException [EXCEPTIONS] throws RuntimeException; catches Exception e [THROWS-WHEN] RuntimeEx...
/* static context [FOCAL] public static T JSONUtil.toObject(String json, Class<T> clazz) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException(e) [PATH2] return object [INPUTS] branches=- | result=clazz, json [COLLABORATORS] field mapper readValue/2 [EXCEPTIONS] throw...
/* static context [FOCAL] public static T JSONUtil.toObject(String json, Class<T> clazz) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException(e) [PATH2] return object [INPUTS] branches=- | result=clazz, json [COLLABORATORS] field mapper readValue/2 [EXCEPTIONS] throw...
true
ok
{"focal": {"class": "JSONUtil", "name": "toObject", "signature": "T toObject(String json, Class<T> clazz)", "start_line": 3, "modifiers": "public static", "params": [{"name": "json", "type": "String"}, {"name": "clazz", "type": "Class<T>"}], "return_type": "T"}, "class_info": {"name": "JSONUtil", "kind": "class", "modi...
55224431_4
class CuratorZookeeperClient extends AbstractZookeeperClient<CuratorWatcher> { @Override public List<String> getChildren(String path) { try { return client.getChildren().forPath(path); } catch (NoNodeException e) { return null; } catch (Exception e) { ...
String path = "/dubbo/org.apache.dubbo.demo.DemoService/providers"; curatorClient.create(path, false); curatorClient.create(path + "/provider1", false); curatorClient.create(path + "/provider2", false); List<String> children = curatorClient.getChildren(path); assertThat(...
[FOCAL] @Override public List<String> CuratorZookeeperClient.getChildren(String path) [CLASS] class CuratorZookeeperClient extends AbstractZookeeperClient<CuratorWatcher> [METRICS] loc=10 cc=3 branches=0 loops=0 returns=2 throws=1 nesting=1 [CALLS-EXTERNAL] client.getChildren().forPath/1, client.getChildren/0, Exceptio...
/* static context [FOCAL] @Override public List<String> CuratorZookeeperClient.getChildren(String path) [THROWS-WHEN] IllegalStateException when try-body throws [PATH1] try-body throws -> return null [PATH2] return client.getChildren().forPath(path) [PATH3] try-body throws -> throw new IllegalStateException(e.getMessag...
/* static context [FOCAL] @Override public List<String> CuratorZookeeperClient.getChildren(String path) [THROWS-WHEN] IllegalStateException when try-body throws [PATH1] try-body throws -> return null [PATH2] return client.getChildren().forPath(path) [PATH3] try-body throws -> throw new IllegalStateException(e.getMessag...
true
ok
{"focal": {"class": "CuratorZookeeperClient", "name": "getChildren", "signature": "List<String> getChildren(String path)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "path", "type": "String"}], "return_type": "List<String>"}, "class_info": {"name": "CuratorZookeeperClient", "kind": "class", "...
55231859_7
class SwaggerBasePathRewritingFilter extends SendResponseFilter { @Override public Object run() { RequestContext context = RequestContext.getCurrentContext(); if (!context.getResponseGZipped()) { context.getResponse().setCharacterEncoding("UTF-8"); } String rewritt...
MockHttpServletRequest request = new MockHttpServletRequest("GET", "/service1" + DEFAULT_URL); RequestContext context = RequestContext.getCurrentContext(); context.setRequest(request); MockHttpServletResponse response = new MockHttpServletResponse(); context.setResponseGZipped(f...
[FOCAL] @Override public Object SwaggerBasePathRewritingFilter.run() [CLASS] class SwaggerBasePathRewritingFilter extends SendResponseFilter [METRICS] loc=12 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] String rewriteBasePath(RequestContext context) [CALLS-EXTERNAL] RequestContext.getCurrentCon...
/* static context [FOCAL] @Override public Object SwaggerBasePathRewritingFilter.run() [PATH1] if(!context.getResponseGZipped())=T -> return null [PATH2] if(!context.getResponseGZipped())=F -> return null [CALLS-INTERNAL] String rewriteBasePath(RequestContext context) [CALLS-EXTERNAL] RequestContext.getCurrentContext/0...
/* static context [FOCAL] @Override public Object SwaggerBasePathRewritingFilter.run() [PATH1] if(!context.getResponseGZipped())=T -> return null [PATH2] if(!context.getResponseGZipped())=F -> return null [CALLS-INTERNAL] String rewriteBasePath(RequestContext context) [CALLS-EXTERNAL] RequestContext.getCurrentContext/0...
true
ok
{"focal": {"class": "SwaggerBasePathRewritingFilter", "name": "run", "signature": "Object run()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Object"}, "class_info": {"name": "SwaggerBasePathRewritingFilter", "kind": "class", "modifiers": "", "superclass": "SendResponseFilter", "inte...
55246521_78
class ITableRepositoryImpl implements ITableRepository { @Override public void createITable(Index index) { logger.info("Creating iTable for index: " + index.toString()); PreparedStatement createStmt = PreparedStatementFactory.getPreparedStatement(generateTableCreationSyntax(index), session)...
System.out.println("createITable"); Index index = Fixtures.createTestIndexOneField(); ITableRepository instance = new ITableRepositoryImpl(f.getSession()); boolean result = instance.iTableExists(index); assertEquals(false, result);//make sure it doesn't exist yet instanc...
[FOCAL] @Override public void ITableRepositoryImpl.createITable(Index index) [CLASS] class ITableRepositoryImpl implements ITableRepository [METRICS] loc=8 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] String generateTableCreationSyntax(Index index) [CALLS-EXTERNAL] Logger.info/1, Index.toString...
/* static context [FOCAL] @Override public void ITableRepositoryImpl.createITable(Index index) [COLLABORATORS] param index:Index toString/0; field session execute/1 [CALLS-INTERNAL] String generateTableCreationSyntax(Index index) [FIELDS] read=logger:Logger [NEW] BoundStatement [CALLS-EXTERNAL] Logger.info/1, Index.toS...
/* static context [FOCAL] @Override public void ITableRepositoryImpl.createITable(Index index) [COLLABORATORS] param index:Index toString/0; field session execute/1 [CALLS-INTERNAL] String generateTableCreationSyntax(Index index) [FIELDS] read=logger:Logger [NEW] BoundStatement [CALLS-EXTERNAL] Logger.info/1, Index.toS...
true
ok
{"focal": {"class": "ITableRepositoryImpl", "name": "createITable", "signature": "void createITable(Index index)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "index", "type": "Index"}], "return_type": "void"}, "class_info": {"name": "ITableRepositoryImpl", "kind": "class", "modifiers": "", "s...
55265221_1
class SortHelper { public boolean saveSortByPreference(Sort sort) { SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putString( PREF_SORT_BY_KEY, sort.toString() ); return editor.commit(); } @Inject public SortHelper(Shared...
sort = Sort.HIGHEST_RATED; mockSortHelper = createMockSharedPreference(); mockSortHelper.saveSortByPreference(sort); assertEquals(sort, mockSortHelper.getSortByPreference()); } }
[FOCAL] public boolean SortHelper.saveSortByPreference(Sort sort) [CLASS] class SortHelper [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] sharedPreferences.edit/0, SharedPreferences.Editor.putString/2, Sort.toString/0, SharedPreferences.Editor.commit/0 [COLLABORATORS] field shared...
/* static context [FOCAL] public boolean SortHelper.saveSortByPreference(Sort sort) [COLLABORATORS] field sharedPreferences edit/0; param sort:Sort toString/0 [CALLS-EXTERNAL] sharedPreferences.edit/0, SharedPreferences.Editor.putString/2, Sort.toString/0, SharedPreferences.Editor.commit/0 */
/* static context [FOCAL] public boolean SortHelper.saveSortByPreference(Sort sort) [COLLABORATORS] field sharedPreferences edit/0; param sort:Sort toString/0 [CALLS-EXTERNAL] sharedPreferences.edit/0, SharedPreferences.Editor.putString/2, Sort.toString/0, SharedPreferences.Editor.commit/0 */ class SortHelper { pu...
true
ok
{"focal": {"class": "SortHelper", "name": "saveSortByPreference", "signature": "boolean saveSortByPreference(Sort sort)", "start_line": 3, "modifiers": "public", "params": [{"name": "sort", "type": "Sort"}], "return_type": "boolean"}, "class_info": {"name": "SortHelper", "kind": "class", "modifiers": "", "superclass": ...
55321773_1
class HouseRepository implements HousesDomain.Repository { @Override public Observable<List<GoTHouse>> getList() { Observable<List<GoTHouse>> observable; if (localDataSource.isExpired()) { observable = networkDataSource.getAll() .doOnNext(houses -> { localDataSource.removeAll(h...
when(localDataSource.isExpired()).thenReturn(EXPIRED); when(networkDataSource.getAll()).thenReturn(getSevenHousesObservable()); repository.getList() .subscribe(list -> Assert.assertThat(list.size(), Is.is(7)), throwable -> fail()); verify(networkDataSource).getAll(); verify(localDataSource...
[FOCAL] @Override public Observable<List<GoTHouse>> HouseRepository.getList() [CLASS] class HouseRepository implements HousesDomain.Repository [METRICS] loc=20 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] HousesDomain.LocalDataSource.isExpired/0, networkDataSource.getAll() .doOnNext(houses -> {...
/* static context [FOCAL] @Override public Observable<List<GoTHouse>> HouseRepository.getList() [PATH1] if(localDataSource.isExpired())=T -> return observable [PATH2] if(localDataSource.isExpired())=F -> return observable [INPUTS] branches=localDataSource | result=localDataSource, networkDataSource [COLLABORATORS] fiel...
/* static context [FOCAL] @Override public Observable<List<GoTHouse>> HouseRepository.getList() [PATH1] if(localDataSource.isExpired())=T -> return observable [PATH2] if(localDataSource.isExpired())=F -> return observable [INPUTS] branches=localDataSource | result=localDataSource, networkDataSource [COLLABORATORS] fiel...
true
ok
{"focal": {"class": "HouseRepository", "name": "getList", "signature": "Observable<List<GoTHouse>> getList()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Observable<List<GoTHouse>>"}, "class_info": {"name": "HouseRepository", "kind": "class", "modifiers": "", "superclass": null, "in...
55332367_37
class KeyTree { public KeyTree.Node add(final String path) { KeyTree.Node parent = this.root; String key = path; if (path != null) { final int i = path.lastIndexOf('.'); if (i >= 0) { final String parentPath = path.substring(0, i); key...
final YamlConfiguration configuration = new YamlConfiguration(); final YamlConfigurationOptions options = new TestYamlConfigurationOptions(configuration); final KeyTree tree = new KeyTree(options); final String defaultnodekey = "defaultnodekey"; final String nodewithcommentkey = ...
[FOCAL] public KeyTree.Node KeyTree.add(String path) [CLASS] class KeyTree [METRICS] loc=16 cc=4 branches=3 loops=0 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] KeyTree.Node get(String path) [CALLS-EXTERNAL] String.lastIndexOf/1, String.substring/2, String.substring/1, this.add/1, KeyTree.Node.add/1 [FIELDS] read=root...
/* static context [FOCAL] public KeyTree.Node KeyTree.add(String path) [PATH1] if(path != null)=T -> if(i >= 0)=T -> if(parent == null)=T -> return parent.add(key) [PATH2] if(path != null)=F -> return parent.add(key) [PATH3] if(path != null)=T -> if(i >= 0)=F -> return parent.add(key) [PATH4] if(path != null)=T -> if(i...
/* static context [FOCAL] public KeyTree.Node KeyTree.add(String path) [PATH1] if(path != null)=T -> if(i >= 0)=T -> if(parent == null)=T -> return parent.add(key) [PATH2] if(path != null)=F -> return parent.add(key) [PATH3] if(path != null)=T -> if(i >= 0)=F -> return parent.add(key) [PATH4] if(path != null)=T -> if(i...
true
ok
{"focal": {"class": "KeyTree", "name": "add", "signature": "KeyTree.Node add(String path)", "start_line": 3, "modifiers": "public", "params": [{"name": "path", "type": "String"}], "return_type": "KeyTree.Node"}, "class_info": {"name": "KeyTree", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, ...
55332995_0
class TwilioAccess { public boolean send(final String to, final String body) { // Build a filter for the MessageList final List<NameValuePair> params = new ArrayList<>(); params.add(new BasicNameValuePair("Body", body)); params.add(new BasicNameValuePair("To", to)); params.a...
System.out.println("testFailCall"); TwilioAccess t = new TwilioAccess("1234567890", "1234567890", "1234567890"); assertFalse(t.send("1234567890", "This is the body")); } }
[FOCAL] public boolean TwilioAccess.send(String to, String body) [CLASS] class TwilioAccess [METRICS] loc=21 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] TwilioRestClient getTwilioRestClient() [CALLS-EXTERNAL] List<NameValuePair>.add/1, getTwilioRestClient().getAccount().getMessageFactory/0, ge...
/* static context [FOCAL] public boolean TwilioAccess.send(String to, String body) [PATH1] try-body throws -> return false [PATH2] return true [EXCEPTIONS] catches final Exception e [CALLS-INTERNAL] TwilioRestClient getTwilioRestClient() [NEW] ArrayList<>, BasicNameValuePair [CALLS-EXTERNAL] List<NameValuePair>.add/1, ...
/* static context [FOCAL] public boolean TwilioAccess.send(String to, String body) [PATH1] try-body throws -> return false [PATH2] return true [EXCEPTIONS] catches final Exception e [CALLS-INTERNAL] TwilioRestClient getTwilioRestClient() [NEW] ArrayList<>, BasicNameValuePair [CALLS-EXTERNAL] List<NameValuePair>.add/1, ...
true
ok
{"focal": {"class": "TwilioAccess", "name": "send", "signature": "boolean send(String to, String body)", "start_line": 3, "modifiers": "public", "params": [{"name": "to", "type": "String"}, {"name": "body", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "TwilioAccess", "kind": "class", "modifiers...
55380427_12
class SwaggerConfluenceConfig { public boolean isGenerateNumericPrefixes() { return generateNumericPrefixes; } public SwaggerConfluenceConfig(); public Integer getAncestorId(); public void setAncestorId(final Integer ancestorId); public String getAuthentication(); public void set...
assertTrue("Default Should \"true\"", swaggerConfluenceConfig.isGenerateNumericPrefixes()); } }
[FOCAL] public boolean SwaggerConfluenceConfig.isGenerateNumericPrefixes() [CLASS] class SwaggerConfluenceConfig [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] SwaggerConfluenceConfig(); Integer getAncestorId(); void setAncestorId(Integer ancestorId); String getAuthentication(); vo...
/* static context [FOCAL] public boolean SwaggerConfluenceConfig.isGenerateNumericPrefixes() */
/* static context [FOCAL] public boolean SwaggerConfluenceConfig.isGenerateNumericPrefixes() */ class SwaggerConfluenceConfig { public boolean isGenerateNumericPrefixes() { return generateNumericPrefixes; } public SwaggerConfluenceConfig(); public Integer getAncestorId(); public void set...
true
ok
{"focal": {"class": "SwaggerConfluenceConfig", "name": "isGenerateNumericPrefixes", "signature": "boolean isGenerateNumericPrefixes()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "SwaggerConfluenceConfig", "kind": "class", "modifiers": "", "superclass": null,...
55402141_1
class Note extends Home { public void onClickPlus() { if (onPlus) { if (plus > 0) { plus--; } onPlus = false; } else { plus++; onPlus = true; } } } class NoteTest { @Test public void onClickPlus_cance...
Note note = new Note(); note.onPlus = true; note.onClickPlus(); assertFalse(note.onPlus); assertEquals(note.plus, 0); } }
[FOCAL] public void Note.onClickPlus() [CLASS] class Note extends Home [METRICS] loc=11 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=2 [PATH1] if(onPlus)=T -> if(plus > 0)=T [PATH2] if(onPlus)=F [PATH3] if(onPlus)=T -> if(plus > 0)=F [TEST] NoteTest: @Test public void onClickPlus_cancel_plus_0()
/* static context [FOCAL] public void Note.onClickPlus() [PATH1] if(onPlus)=T -> if(plus > 0)=T [PATH2] if(onPlus)=F [PATH3] if(onPlus)=T -> if(plus > 0)=F */
/* static context [FOCAL] public void Note.onClickPlus() [PATH1] if(onPlus)=T -> if(plus > 0)=T [PATH2] if(onPlus)=F [PATH3] if(onPlus)=T -> if(plus > 0)=F */ class Note extends Home { public void onClickPlus() { if (onPlus) { if (plus > 0) { plus--; } on...
true
ok
{"focal": {"class": "Note", "name": "onClickPlus", "signature": "void onClickPlus()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "Note", "kind": "class", "modifiers": "", "superclass": "Home", "interfaces": null, "fields": [], "members": []}, "ast": {"sexp": "(m...
55493271_108
class CategoricalScale { public ScaleCategory scaleRawValue(int rawValue) throws EepOutOfRangeException { for(ScaleCategory category : categories) { if(category.fallsIntoCategory(rawValue)) { return category; } } throw new EepOutOfRangeException( "Raw value ''{0}...
ScaleCategory category1 = new ScaleCategory("Category 1", 0, 49, "CAT1", 1); ScaleCategory category2 = new ScaleCategory("Category 2", 50, 99, "CAT2", 2); Set<ScaleCategory> categories = new HashSet<ScaleCategory>(); categories.add(category1); categories.add(category2); CategoricalScale scale ...
[FOCAL] public ScaleCategory CategoricalScale.scaleRawValue(int rawValue) [CLASS] class CategoricalScale [METRICS] loc=14 cc=3 branches=1 loops=1 returns=1 throws=1 nesting=2 [CALLS-EXTERNAL] ScaleCategory.fallsIntoCategory/1 [NEW] EepOutOfRangeException [EXCEPTIONS] declares EepOutOfRangeException; throws EepOutOfRang...
/* static context [FOCAL] public ScaleCategory CategoricalScale.scaleRawValue(int rawValue) [THROWS-WHEN] EepOutOfRangeException when foreach(ScaleCategory category : categories)=T && !category.fallsIntoCategory(rawValue) [THROWS-WHEN] EepOutOfRangeException when foreach(ScaleCategory category : categories)=F [PATH1] f...
/* static context [FOCAL] public ScaleCategory CategoricalScale.scaleRawValue(int rawValue) [THROWS-WHEN] EepOutOfRangeException when foreach(ScaleCategory category : categories)=T && !category.fallsIntoCategory(rawValue) [THROWS-WHEN] EepOutOfRangeException when foreach(ScaleCategory category : categories)=F [PATH1] f...
true
ok
{"focal": {"class": "CategoricalScale", "name": "scaleRawValue", "signature": "ScaleCategory scaleRawValue(int rawValue) throws EepOutOfRangeException", "start_line": 3, "modifiers": "public", "params": [{"name": "rawValue", "type": "int"}], "return_type": "ScaleCategory"}, "class_info": {"name": "CategoricalScale", "k...
55498563_29
class RedisKeyValueStateProvider implements StateProvider { StateConfig getStateConfig(Map stormConf) throws Exception { StateConfig stateConfig = null; String providerConfig = null; ObjectMapper mapper = new ObjectMapper(); mapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetec...
RedisKeyValueStateProvider provider = new RedisKeyValueStateProvider(); Map<String, String> stormConf = new HashMap<>(); //stormConf.put(Config.TOPOLOGY_STATE_PROVIDER_CONFIG, "{\"keyClass\":\"String\"}"); RedisKeyValueStateProvider.StateConfig config = provider.getStateConfig(stormConf...
[FOCAL] StateConfig RedisKeyValueStateProvider.getStateConfig(Map stormConf) [CLASS] class RedisKeyValueStateProvider implements StateProvider [METRICS] loc=13 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] ObjectMapper.setVisibility/2, Map.containsKey/1, Map.get/1, ObjectMapper.readValue/2 [NEW]...
/* static context [FOCAL] StateConfig RedisKeyValueStateProvider.getStateConfig(Map stormConf) [PATH1] if(stormConf.containsKey(org.apache.storm.Config.TOPOLOGY_STATE_PROVIDER_CONFIG))=T -> return stateConfig [PATH2] if(stormConf.containsKey(org.apache.storm.Config.TOPOLOGY_STATE_PROVIDER_CONFIG))=F -> return stateConf...
/* static context [FOCAL] StateConfig RedisKeyValueStateProvider.getStateConfig(Map stormConf) [PATH1] if(stormConf.containsKey(org.apache.storm.Config.TOPOLOGY_STATE_PROVIDER_CONFIG))=T -> return stateConfig [PATH2] if(stormConf.containsKey(org.apache.storm.Config.TOPOLOGY_STATE_PROVIDER_CONFIG))=F -> return stateConf...
true
ok
{"focal": {"class": "RedisKeyValueStateProvider", "name": "getStateConfig", "signature": "StateConfig getStateConfig(Map stormConf) throws Exception", "start_line": 3, "modifiers": "", "params": [{"name": "stormConf", "type": "Map"}], "return_type": "StateConfig"}, "class_info": {"name": "RedisKeyValueStateProvider", "...
55504627_162
class MavenConfigurationExtractor { public static Map<String, Object> extract(Xpp3Dom root) { if (root == null) { return new HashMap<>(); } return getElement(root); } private MavenConfigurationExtractor(); private static Map<String, Object> getElement(Xpp3Dom ele...
// Given final Plugin fakePlugin = createFakePlugin("<a>" + "<b>b</b>" + "</a>"); // When final Map<String, Object> config = MavenConfigurationExtractor.extract((Xpp3Dom) fakePlugin.getConfiguration()); // Then final Map<String, Object> expected...
[FOCAL] public static Map<String, Object> MavenConfigurationExtractor.extract(Xpp3Dom root) [CLASS] class MavenConfigurationExtractor [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] Map<String, Object> getElement(Xpp3Dom element) [NEW] HashMap<> [PATH1] if(root == null)=T -> return...
/* static context [FOCAL] public static Map<String, Object> MavenConfigurationExtractor.extract(Xpp3Dom root) [PATH1] if(root == null)=T -> return new HashMap<>() [PATH2] if(root == null)=F -> return getElement(root) [INPUTS] branches=root | result=root [CALLS-INTERNAL] Map<String, Object> getElement(Xpp3Dom element) [...
/* static context [FOCAL] public static Map<String, Object> MavenConfigurationExtractor.extract(Xpp3Dom root) [PATH1] if(root == null)=T -> return new HashMap<>() [PATH2] if(root == null)=F -> return getElement(root) [INPUTS] branches=root | result=root [CALLS-INTERNAL] Map<String, Object> getElement(Xpp3Dom element) [...
true
ok
{"focal": {"class": "MavenConfigurationExtractor", "name": "extract", "signature": "Map<String, Object> extract(Xpp3Dom root)", "start_line": 3, "modifiers": "public static", "params": [{"name": "root", "type": "Xpp3Dom"}], "return_type": "Map<String, Object>"}, "class_info": {"name": "MavenConfigurationExtractor", "ki...
55520127_6
class SearchParameterResolver { public RuntimeSearchParam getSearchParameterDefinition(String dataType, String path) { return this.getSearchParameterDefinition(dataType, path, (RestSearchParameterTypeEnum)null); } public SearchParameterResolver(FhirContext context); public RuntimeSearchParam...
SearchParameterResolver resolver = new SearchParameterResolver(FhirContext.forR4()); RuntimeSearchParam param = resolver.getSearchParameterDefinition("ServiceRequest", "authoredOn", RestSearchParameterTypeEnum.DATE); assertNotNull(param); assertEquals("authored", param.g...
[FOCAL] public RuntimeSearchParam SearchParameterResolver.getSearchParameterDefinition(String dataType, String path) [CLASS] class SearchParameterResolver [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] RuntimeSearchParam getSearchParameterDefinition(String dataType, String path, R...
/* static context [FOCAL] public RuntimeSearchParam SearchParameterResolver.getSearchParameterDefinition(String dataType, String path) [INPUTS] branches=- | result=dataType, path [CALLS-INTERNAL] RuntimeSearchParam getSearchParameterDefinition(String dataType, String path, RestSearchParameterTypeEnum paramType) */
/* static context [FOCAL] public RuntimeSearchParam SearchParameterResolver.getSearchParameterDefinition(String dataType, String path) [INPUTS] branches=- | result=dataType, path [CALLS-INTERNAL] RuntimeSearchParam getSearchParameterDefinition(String dataType, String path, RestSearchParameterTypeEnum paramType) */ clas...
true
ok
{"focal": {"class": "SearchParameterResolver", "name": "getSearchParameterDefinition", "signature": "RuntimeSearchParam getSearchParameterDefinition(String dataType, String path)", "start_line": 3, "modifiers": "public", "params": [{"name": "dataType", "type": "String"}, {"name": "path", "type": "String"}], "return_typ...
55524213_0
class Circle implements Shape { @Override public Position getPosition() { return position; } public Circle(final int radius, final Position position); @Override public String getName(); @Override public double getArea(); } class CircleTest { @Test public void testCreateCir...
Position position = new Position(0, 1); Circle c = new Circle(1, position); final double expectedArea = 2 * Math.PI; assertEquals("Circle[area = " + expectedArea + "]", c.getDescription()); assertEquals(0, c.getPosition().getX()); assertEquals(1, c.getPosition().getY())...
[FOCAL] @Override public Position Circle.getPosition() [CLASS] class Circle implements Shape [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Circle(int radius, Position position); String getName(); double getArea() [TEST] CircleTest: @Test public void testCreateCircle()
/* static context [FOCAL] @Override public Position Circle.getPosition() */
/* static context [FOCAL] @Override public Position Circle.getPosition() */ class Circle implements Shape { @Override public Position getPosition() { return position; } public Circle(final int radius, final Position position); @Override public String getName(); @Override public doubl...
true
ok
{"focal": {"class": "Circle", "name": "getPosition", "signature": "Position getPosition()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Position"}, "class_info": {"name": "Circle", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Shape", "fields": [], "members": [...
55560812_32
class AlertTemplateValidator implements Validator<AlertTemplate> { @Override public void validate(AlertTemplate template) throws ValidationException { if (template.getDestination() == null || template.getDestination().trim().isEmpty()) { throw new ValidationException("Alert target can't be empty"); } if (te...
AlertTemplateValidator validator = new AlertTemplateValidator(); AlertTemplate template = new AlertTemplate((short)2); template.setMedia("http"); template.setSubject("hello"); template.setBody("hello $x"); template.setTemplateName("Template"); template.setDestination("htt://google.com"); try { valida...
[FOCAL] @Override public void AlertTemplateValidator.validate(AlertTemplate template) [CLASS] class AlertTemplateValidator implements Validator<AlertTemplate> [METRICS] loc=55 cc=20 branches=15 loops=2 returns=0 throws=12 nesting=4 [CALLS-EXTERNAL] AlertTemplate.getDestination/0, template.getDestination().trim().isEmpt...
/* static context [FOCAL] @Override public void AlertTemplateValidator.validate(AlertTemplate template) [THROWS-WHEN] ValidationException when template.getDestination() == null || template.getDestination().trim().isEmpty() [THROWS-WHEN] ValidationException when !(template.getDestination() == null || template.getDestina...
/* static context [FOCAL] @Override public void AlertTemplateValidator.validate(AlertTemplate template) [THROWS-WHEN] ValidationException when template.getDestination() == null || template.getDestination().trim().isEmpty() [THROWS-WHEN] ValidationException when !(template.getDestination() == null || template.getDestina...
true
ok
{"focal": {"class": "AlertTemplateValidator", "name": "validate", "signature": "void validate(AlertTemplate template) throws ValidationException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "template", "type": "AlertTemplate"}], "return_type": "void"}, "class_info": {"name": "AlertTemplateVal...
55638412_70
class TurfMeasurement { public static double bearing(@NonNull Point point1, @NonNull Point point2) { double lon1 = degreesToRadians(point1.longitude()); double lon2 = degreesToRadians(point2.longitude()); double lat1 = degreesToRadians(point1.latitude()); double lat2 = degreesToRadians(point2.latitu...
Point pt1 = Point.fromLngLat(-75.4, 39.4); Point pt2 = Point.fromLngLat(-75.534, 39.123); assertNotEquals(TurfMeasurement.bearing(pt1, pt2), 0, DELTA); } }
[FOCAL] public static double TurfMeasurement.bearing(Point point1, Point point2) [CLASS] class TurfMeasurement [METRICS] loc=12 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] degreesToRadians/1 (inherited), Point.longitude/0, Point.latitude/0, Math.sin/1, Math.cos/1, radiansToDegrees/1 (inherited...
class TurfMeasurement { public static double bearing(@NonNull Point point1, @NonNull Point point2) { double lon1 = degreesToRadians(point1.longitude()); double lon2 = degreesToRadians(point2.longitude()); double lat1 = degreesToRadians(point1.latitude()); double lat2 = degreesToRadians(point2.latitu...
false
ok
{"focal": {"class": "TurfMeasurement", "name": "bearing", "signature": "double bearing(Point point1, Point point2)", "start_line": 3, "modifiers": "public static", "params": [{"name": "point1", "type": "Point"}, {"name": "point2", "type": "Point"}], "return_type": "double"}, "class_info": {"name": "TurfMeasurement", "k...
55668012_0
class Session { synchronized int setSendingData(ByteBuffer data) { final int remaining = data.remaining(); sendingStream.write(data.array(), data.position(), data.remaining()); return remaining; } Session(int sourceIp, int sourcePort, int destinationIp, int destinationPort); synchronized void decreaseAmo...
final Session session = new Session(1, 2, 3, 4); final byte[] test = "Hello, World.".getBytes(); final ByteBuffer buffer = ByteBuffer.wrap(test); // Move position to 5 for (int i = 0; i < 5; i++) buffer.get(); session.setSendingData(buffer); final ...
[FOCAL] synchronized int Session.setSendingData(ByteBuffer data) [CLASS] class Session [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] ByteBuffer.remaining/0, sendingStream.write/3, ByteBuffer.array/0, ByteBuffer.position/0 [INPUTS] branches=- | result=data [COLLABORATORS] param da...
/* static context [FOCAL] synchronized int Session.setSendingData(ByteBuffer data) [INPUTS] branches=- | result=data [COLLABORATORS] param data:ByteBuffer remaining/0,array/0,position/0; field sendingStream write/3 [CALLS-EXTERNAL] ByteBuffer.remaining/0, sendingStream.write/3, ByteBuffer.array/0, ByteBuffer.position/0...
/* static context [FOCAL] synchronized int Session.setSendingData(ByteBuffer data) [INPUTS] branches=- | result=data [COLLABORATORS] param data:ByteBuffer remaining/0,array/0,position/0; field sendingStream write/3 [CALLS-EXTERNAL] ByteBuffer.remaining/0, sendingStream.write/3, ByteBuffer.array/0, ByteBuffer.position/0...
true
ok
{"focal": {"class": "Session", "name": "setSendingData", "signature": "int setSendingData(ByteBuffer data)", "start_line": 3, "modifiers": "synchronized", "params": [{"name": "data", "type": "ByteBuffer"}], "return_type": "int"}, "class_info": {"name": "Session", "kind": "class", "modifiers": "", "superclass": null, "i...
55673705_10
class ConstraintsModifier { public void looseConstraints(String stateId) { looseConstraints(stateId, 0f, false); } public ConstraintsModifier(Network network); public ConstraintsModifier(Network network, ConstraintsModifierConfig config); public void looseConstraints(String stateId, flo...
ConstraintsModifier constraintsModifier = new ConstraintsModifier(network, config); try { constraintsModifier.looseConstraints(null, violations); fail(); } catch (Throwable e) { } try { constraintsModifier.looseConstraints(StateManagerConstant...
[FOCAL] public void ConstraintsModifier.looseConstraints(String stateId) [CLASS] class ConstraintsModifier [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void looseConstraints(String stateId, float margin, boolean applyToBaseCase) [DATAFLOW] stateId@param->L2 [CLASS-MEMBERS] Const...
/* static context [FOCAL] public void ConstraintsModifier.looseConstraints(String stateId) [CALLS-INTERNAL] void looseConstraints(String stateId, float margin, boolean applyToBaseCase) */
/* static context [FOCAL] public void ConstraintsModifier.looseConstraints(String stateId) [CALLS-INTERNAL] void looseConstraints(String stateId, float margin, boolean applyToBaseCase) */ class ConstraintsModifier { public void looseConstraints(String stateId) { looseConstraints(stateId, 0f, false); } ...
true
ok
{"focal": {"class": "ConstraintsModifier", "name": "looseConstraints", "signature": "void looseConstraints(String stateId)", "start_line": 3, "modifiers": "public", "params": [{"name": "stateId", "type": "String"}], "return_type": "void"}, "class_info": {"name": "ConstraintsModifier", "kind": "class", "modifiers": "", ...
55705999_5
class ListUtils { public static void shiftItemsWithFixedDistance(List<?> list, int[] indexArray, int offset) { Arrays.sort(indexArray); int unionOffset = computeUnionOffset(list, indexArray, offset); shiftItemsDirectly(list, indexArray, unionOffset); } public static int[] toIntArra...
List<String> list = Arrays.asList("A", "B", "C", "D", "E"); ListUtils.shiftItemsWithFixedDistance(list, new int[]{1, 4}, 10); Assert.assertArrayEquals(new String[]{"A", "B", "C", "D", "E"}, list.toArray()); ListUtils.shiftItemsWithFixedDistance(list, new int[]{0, 2}, -10); Asser...
[FOCAL] public static void ListUtils.shiftItemsWithFixedDistance(List<?> list, int[] indexArray, int offset) [CLASS] class ListUtils [METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] int computeUnionOffset(List<?> list, int[] indexArray, int offset); void shiftItemsDirectly(List<?> l...
/* static context [FOCAL] public static void ListUtils.shiftItemsWithFixedDistance(List<?> list, int[] indexArray, int offset) [CALLS-INTERNAL] int computeUnionOffset(List<?> list, int[] indexArray, int offset); void shiftItemsDirectly(List<?> list, int[] indexArray, int offset) [CALLS-EXTERNAL] Arrays.sort/1 */
/* static context [FOCAL] public static void ListUtils.shiftItemsWithFixedDistance(List<?> list, int[] indexArray, int offset) [CALLS-INTERNAL] int computeUnionOffset(List<?> list, int[] indexArray, int offset); void shiftItemsDirectly(List<?> list, int[] indexArray, int offset) [CALLS-EXTERNAL] Arrays.sort/1 */ class ...
true
ok
{"focal": {"class": "ListUtils", "name": "shiftItemsWithFixedDistance", "signature": "void shiftItemsWithFixedDistance(List<?> list, int[] indexArray, int offset)", "start_line": 3, "modifiers": "public static", "params": [{"name": "list", "type": "List<?>"}, {"name": "indexArray", "type": "int[]"}, {"name": "offset", ...
55707462_42
class SmartTitleComparator extends AbstractMovieComparator { @Override public boolean areEqual(@NonNull Movie movie1, @NonNull Movie movie2) { val title1 = movie1.getTitle(); val title2 = movie2.getTitle(); for (StringModifier m1 : modifiers) { for (StringModifier m2 : modi...
assertTrue(comparator.areEqual( new Movie("The boy, who lived", 2010), new Movie("The boy who lived", 2010) )); assertTrue(comparator.areEqual( new Movie("Independence Day: Resurgence", 2016), new Movie("Independence Day Resurgence...
[FOCAL] @Override public boolean SmartTitleComparator.areEqual(Movie movie1, Movie movie2) [CLASS] class SmartTitleComparator extends AbstractMovieComparator [METRICS] loc=19 cc=4 branches=1 loops=2 returns=2 throws=0 nesting=3 [CALLS-EXTERNAL] Movie.getTitle/0, m1.modify(title1).equalsIgnoreCase/1, StringModifier.modi...
/* static context [FOCAL] @Override public boolean SmartTitleComparator.areEqual(Movie movie1, Movie movie2) [PATH1] foreach(StringModifier m1 : modifiers)=T -> foreach(StringModifier m2 : modifiers)=T -> if(result)=F -> exit loop -> exit loop -> return false [PATH2] foreach(StringModifier m1 : modifiers)=T -> foreach(...
/* static context [FOCAL] @Override public boolean SmartTitleComparator.areEqual(Movie movie1, Movie movie2) [PATH1] foreach(StringModifier m1 : modifiers)=T -> foreach(StringModifier m2 : modifiers)=T -> if(result)=F -> exit loop -> exit loop -> return false [PATH2] foreach(StringModifier m1 : modifiers)=T -> foreach(...
true
ok
{"focal": {"class": "SmartTitleComparator", "name": "areEqual", "signature": "boolean areEqual(Movie movie1, Movie movie2)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "movie1", "type": "Movie"}, {"name": "movie2", "type": "Movie"}], "return_type": "boolean"}, "class_info": {"name": "SmartTit...
55719869_4
class MuseHandler implements Closeable { void setFocusListener() { this.focusListener = new MuseDataListener() { @Override public void receiveMuseDataPacket(MuseDataPacket museDataPacket) { if (museDataPacket.getPacketType() == MuseDataPacketType.CONCENTRATION) { ...
class FocusHolder{ double focus; @Subscribe public void set(MuseHandler.FocusReading reading){ this.focus = reading.getFocus(); } } FocusHolder holder = new FocusHolder(); this.eventBus.register(holder); this.museHandler.setFoc...
[FOCAL] void MuseHandler.setFocusListener() [CLASS] class MuseHandler implements Closeable [METRICS] loc=19 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] museDataPacket.getPacketType/0, mConcentrationManager.addConcentrationValue/1, museDataPacket.getValues().get/1, museDataPacket.getValues/0, m...
/* static context [FOCAL] void MuseHandler.setFocusListener() [COLLABORATORS] field museDataPacket getPacketType/0,getValues/0; field mConcentrationManager addConcentrationValue/1,getConcentration/0; field muse:Muse registerDataListener/2 [STATE] focusListener via getFocusListener() [FIELDS] read=focusListener, muse:Mu...
/* static context [FOCAL] void MuseHandler.setFocusListener() [COLLABORATORS] field museDataPacket getPacketType/0,getValues/0; field mConcentrationManager addConcentrationValue/1,getConcentration/0; field muse:Muse registerDataListener/2 [STATE] focusListener via getFocusListener() [FIELDS] read=focusListener, muse:Mu...
true
ok
{"focal": {"class": "MuseHandler", "name": "setFocusListener", "signature": "void setFocusListener()", "start_line": 3, "modifiers": "", "params": [], "return_type": "void"}, "class_info": {"name": "MuseHandler", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Closeable", "fields": [{"name": "muse"...