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
41247722_82
class ZipUtil { static long computeCrcOfCentralDir(RandomAccessFile raf, CentralDirectory dir) throws IOException { CRC32 crc = new CRC32(); long stillToRead = dir.size; raf.seek(dir.offset); int length = (int) Math.min(BUFFER_SIZE, stillToRead); byte[] buffer = ...
ZipFile zip = new ZipFile(zipFile); Enumeration<? extends ZipEntry> ref = zip.entries(); byte[] buffer = new byte[0x2000]; while (ref.hasMoreElements()) { ZipEntry refEntry = ref.nextElement(); if (refEntry.getSize() > 0) { File tmp = File.createTe...
[FOCAL] static long ZipUtil.computeCrcOfCentralDir(RandomAccessFile raf, CentralDirectory dir) [CLASS] class ZipUtil [METRICS] loc=19 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] RandomAccessFile.seek/1, Math.min/2, RandomAccessFile.read/3, CRC32.update/3, CRC32.getValue/0 [NEW] CRC32 [EXCEPTIO...
/* static context [FOCAL] static long ZipUtil.computeCrcOfCentralDir(RandomAccessFile raf, CentralDirectory dir) [PATH1] while(length != -1)=T -> if(stillToRead == 0)=F -> exit loop -> return crc.getValue() [PATH2] while(length != -1)=F -> return crc.getValue() [PATH3] while(length != -1)=T -> if(stillToRead == 0)=T ->...
/* static context [FOCAL] static long ZipUtil.computeCrcOfCentralDir(RandomAccessFile raf, CentralDirectory dir) [PATH1] while(length != -1)=T -> if(stillToRead == 0)=F -> exit loop -> return crc.getValue() [PATH2] while(length != -1)=F -> return crc.getValue() [PATH3] while(length != -1)=T -> if(stillToRead == 0)=T ->...
true
ok
{"focal": {"class": "ZipUtil", "name": "computeCrcOfCentralDir", "signature": "long computeCrcOfCentralDir(RandomAccessFile raf, CentralDirectory dir) throws IOException", "start_line": 3, "modifiers": "static", "params": [{"name": "raf", "type": "RandomAccessFile"}, {"name": "dir", "type": "CentralDirectory"}], "retur...
41250653_1
class BookmarksPresenter implements BookmarksContract.UserInteraction { @Override public void bookmarkMovie(Movie movie) { bookmarksStorage.bookmarkMovie(movie); } @Inject public BookmarksPresenter(BookmarksStorage bookmarksStorage); public void onResume(BookmarksContract.BookmarksView v...
presenter.bookmarkMovie(BOOKMARKED_MOVIE); verify(bookmarksStorage).bookmarkMovie(BOOKMARKED_MOVIE); } }
[FOCAL] @Override public void BookmarksPresenter.bookmarkMovie(Movie movie) [CLASS] class BookmarksPresenter implements BookmarksContract.UserInteraction [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] BookmarksStorage.bookmarkMovie/1 [FIELDS] read=bookmarksStorage:BookmarksStorage...
/* static context [FOCAL] @Override public void BookmarksPresenter.bookmarkMovie(Movie movie) [COLLABORATORS] field bookmarksStorage:BookmarksStorage bookmarkMovie/1 [FIELDS] read=bookmarksStorage:BookmarksStorage [CALLS-EXTERNAL] BookmarksStorage.bookmarkMovie/1 */
/* static context [FOCAL] @Override public void BookmarksPresenter.bookmarkMovie(Movie movie) [COLLABORATORS] field bookmarksStorage:BookmarksStorage bookmarkMovie/1 [FIELDS] read=bookmarksStorage:BookmarksStorage [CALLS-EXTERNAL] BookmarksStorage.bookmarkMovie/1 */ class BookmarksPresenter implements BookmarksContract...
true
ok
{"focal": {"class": "BookmarksPresenter", "name": "bookmarkMovie", "signature": "void bookmarkMovie(Movie movie)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "movie", "type": "Movie"}], "return_type": "void"}, "class_info": {"name": "BookmarksPresenter", "kind": "class", "modifiers": "", "sup...
41253781_127
class Option implements Iterable<T>, Serializable { public Option<T> orElse(T value) { return isDefined() ? this : of(value); } private Option(@Nullable T value); @Override public int hashCode(); @Override public boolean equals(@Nullable Object to); @Override public Iterator<T> itera...
Assertions.assertEquals("else", Option.none().orElse(Option.of("else")).get()); } }
[FOCAL] public Option<T> Option.orElse(T value) [CLASS] class Option implements Iterable<T>, Serializable [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Option<T> of(T value); boolean isDefined() [INPUTS] branches=- | result=value [DATAFLOW] value@param->L2 [CLASS-MEMBERS] Option(...
/* static context [FOCAL] public Option<T> Option.orElse(T value) [INPUTS] branches=- | result=value [CALLS-INTERNAL] Option<T> of(T value); boolean isDefined() */
/* static context [FOCAL] public Option<T> Option.orElse(T value) [INPUTS] branches=- | result=value [CALLS-INTERNAL] Option<T> of(T value); boolean isDefined() */ class Option implements Iterable<T>, Serializable { public Option<T> orElse(T value) { return isDefined() ? this : of(value); } privat...
true
ok
{"focal": {"class": "Option", "name": "orElse", "signature": "Option<T> orElse(T value)", "start_line": 3, "modifiers": "public", "params": [{"name": "value", "type": "T"}], "return_type": "Option<T>"}, "class_info": {"name": "Option", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Iterable<T>, Se...
41263845_144
class ConcurrentInvertedRadixTree implements InvertedRadixTree<O>, PrettyPrintable, Serializable { @Override public Iterable<KeyValuePair<O>> getKeyValuePairsForKeysPrefixing(final CharSequence document) { return new Iterable<KeyValuePair<O>>() { @Override public Iterator<KeyVal...
ConcurrentInvertedRadixTree<Integer> tree = new ConcurrentInvertedRadixTree<Integer>(getNodeFactory()); tree.put("1234567", 1); tree.put("1234568", 2); tree.put("123", 3); // ○ // └── ○ 123 (3) // └── ○ 456 // ├── ○ 7 (1) ...
[FOCAL] @Override public Iterable<KeyValuePair<O>> ConcurrentInvertedRadixTree.getKeyValuePairsForKeysPrefixing(CharSequence document) [CLASS] class ConcurrentInvertedRadixTree implements InvertedRadixTree<O>, PrettyPrintable, Serializable [METRICS] loc=21 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXT...
/* static context [FOCAL] @Override public Iterable<KeyValuePair<O>> ConcurrentInvertedRadixTree.getKeyValuePairsForKeysPrefixing(CharSequence document) [INPUTS] branches=- | result=document [COLLABORATORS] field radixTree scanForKeysAtStartOfInput/1; field matchesForCurrentSuffix hasNext/0,next/0 [NEW] Iterable<KeyVal...
/* static context [FOCAL] @Override public Iterable<KeyValuePair<O>> ConcurrentInvertedRadixTree.getKeyValuePairsForKeysPrefixing(CharSequence document) [INPUTS] branches=- | result=document [COLLABORATORS] field radixTree scanForKeysAtStartOfInput/1; field matchesForCurrentSuffix hasNext/0,next/0 [NEW] Iterable<KeyVal...
true
ok
{"focal": {"class": "ConcurrentInvertedRadixTree", "name": "getKeyValuePairsForKeysPrefixing", "signature": "Iterable<KeyValuePair<O>> getKeyValuePairsForKeysPrefixing(CharSequence document)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "document", "type": "CharSequence"}], "return_type": "Ite...
41263864_17
class Locks { public static <L extends Lock> boolean tryLockAll(Iterable<L> locks) { Deque<L> stack = new LinkedList<L>(); boolean success = false; try { for (L lock : locks) { success = lock.tryLock(); if (success) { stack.pus...
HoldCountLock lock1 = new HoldCountLock(new ReentrantLock()); HoldCountLock lock2 = new HoldCountLock(new ReentrantLock()) { @Override public boolean tryLock(long time, TimeUnit unit) throws InterruptedException { throw new InterruptedException(); } ...
[FOCAL] public static boolean Locks.tryLockAll(Iterable<L> locks) [CLASS] class Locks [METRICS] loc=25 cc=5 branches=2 loops=1 returns=1 throws=1 nesting=3 [CALLS-INTERNAL] void unlockAll(Iterable<L> locks) [CALLS-EXTERNAL] L.tryLock/0, Deque<L>.push/1 [NEW] LinkedList<L> [EXCEPTIONS] throws throw e; catches RuntimeExc...
/* static context [FOCAL] public static boolean Locks.tryLockAll(Iterable<L> locks) [THROWS-WHEN] e when try-body throws [PATH1] foreach(L lock : locks)=T -> if(success)=T -> exit loop -> if(!success)=T -> return success [PATH2] try-body throws -> throw e [PATH3] foreach(L lock : locks)=F -> if(!success)=F -> return su...
/* static context [FOCAL] public static boolean Locks.tryLockAll(Iterable<L> locks) [THROWS-WHEN] e when try-body throws [PATH1] foreach(L lock : locks)=T -> if(success)=T -> exit loop -> if(!success)=T -> return success [PATH2] try-body throws -> throw e [PATH3] foreach(L lock : locks)=F -> if(!success)=F -> return su...
true
ok
{"focal": {"class": "Locks", "name": "tryLockAll", "signature": "boolean tryLockAll(Iterable<L> locks)", "start_line": 3, "modifiers": "public static", "params": [{"name": "locks", "type": "Iterable<L>"}], "return_type": "boolean"}, "class_info": {"name": "Locks", "kind": "class", "modifiers": "", "superclass": null, "...
41286649_1
class XmlCreator extends AsyncTask<Void, Integer, Uri> { public static String cleanFilename(String fileName, String defaultName) { if (fileName == null || "".equals(fileName)) { fileName = defaultName; } else { fileName = fileName.replaceAll("\\W", ""); fileName ...
String dirty = ""; String clean = XmlCreator.cleanFilename(dirty, "Untitled"); Assert.assertEquals("Cleaned", "Untitled", clean); } }
[FOCAL] public static String XmlCreator.cleanFilename(String fileName, String defaultName) [CLASS] class XmlCreator extends AsyncTask<Void, Integer, Uri> [METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] "".equals/1, String.replaceAll/2, String.length/0 [PATH1] if(fileName == null ||...
/* static context [FOCAL] public static String XmlCreator.cleanFilename(String fileName, String defaultName) [PATH1] if(fileName == null || "".equals(fileName))=T -> return fileName [PATH2] if(fileName == null || "".equals(fileName))=F -> return fileName [INPUTS] branches=fileName | result=defaultName, fileName [CALLS-...
/* static context [FOCAL] public static String XmlCreator.cleanFilename(String fileName, String defaultName) [PATH1] if(fileName == null || "".equals(fileName))=T -> return fileName [PATH2] if(fileName == null || "".equals(fileName))=F -> return fileName [INPUTS] branches=fileName | result=defaultName, fileName [CALLS-...
true
ok
{"focal": {"class": "XmlCreator", "name": "cleanFilename", "signature": "String cleanFilename(String fileName, String defaultName)", "start_line": 3, "modifiers": "public static", "params": [{"name": "fileName", "type": "String"}, {"name": "defaultName", "type": "String"}], "return_type": "String"}, "class_info": {"nam...
41324285_8
class SmellMeasuresSensor implements Sensor { @Override public void execute(final SensorContext context) { final List<InputFile> inputFiles = Lists.newArrayList(this.fileSystem.inputFiles(this.javaFilesPredicate)); final SmellMeasurer measurer = new SmellMeasurer(context); for (final In...
final SmellMeasuresSensor sut = new SmellMeasuresSensor(this.fs); final File testFile = new File("src/test/resources/SmellMeasuresSensorTest_1.java"); Mockito.when(this.fs.inputFiles(this.predicate)) .thenReturn(ImmutableList.<InputFile> of(this.inputFile)); Mockito.when(this...
[FOCAL] @Override public void SmellMeasuresSensor.execute(SensorContext context) [CLASS] class SmellMeasuresSensor implements Sensor [METRICS] loc=8 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] Lists.newArrayList/1, this.fileSystem.inputFiles/1, SmellMeasurer.measure/1 [NEW] SmellMeasurer [FIEL...
/* static context [FOCAL] @Override public void SmellMeasuresSensor.execute(SensorContext context) [PATH1] foreach(InputFile inputFile : inputFiles)=T -> exit loop [PATH2] foreach(InputFile inputFile : inputFiles)=F [COLLABORATORS] field fileSystem inputFiles/1 [FIELDS] read=fileSystem, javaFilesPredicate [NEW] SmellMe...
/* static context [FOCAL] @Override public void SmellMeasuresSensor.execute(SensorContext context) [PATH1] foreach(InputFile inputFile : inputFiles)=T -> exit loop [PATH2] foreach(InputFile inputFile : inputFiles)=F [COLLABORATORS] field fileSystem inputFiles/1 [FIELDS] read=fileSystem, javaFilesPredicate [NEW] SmellMe...
true
ok
{"focal": {"class": "SmellMeasuresSensor", "name": "execute", "signature": "void execute(SensorContext context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "context", "type": "SensorContext"}], "return_type": "void"}, "class_info": {"name": "SmellMeasuresSensor", "kind": "class", "modifiers"...
41327255_9
class WordUtil { public static int[] getWordColors(List<LetterSource> letters, String word) { int[] colors = new int[word.length()]; if (letters == null) { for (int i = 0; i < colors.length; ++i) { colors[i] = COLOR_MISSING; } return colors; } SpelledWord spelledWord = Wor...
LetterSource letterO = TestUtil.createLetterSource("O"); LetterSource letterA = TestUtil.createLetterSource("A"); LetterSource letterB = TestUtil.createLetterSource("B"); LetterSource letterC = TestUtil.createLetterSource("C"); LetterSource letterD = TestUtil.createLetterSource("D"); letterD.ava...
[FOCAL] public static int[] WordUtil.getWordColors(List<LetterSource> letters, String word) [CLASS] class WordUtil [METRICS] loc=13 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2 [CALLS-INTERNAL] int[] getWordColors(List<SpelledLetter> letters) [CALLS-EXTERNAL] String.length/0, WordUtil.spell/2 [PATH1] if(letters...
/* static context [FOCAL] public static int[] WordUtil.getWordColors(List<LetterSource> letters, String word) [PATH1] if(letters == null)=T -> for(i < colors.length)=T -> exit loop -> return colors [PATH2] if(letters == null)=F -> return getWordColors(spelledWord.letters) [PATH3] if(letters == null)=T -> for(i < colors...
/* static context [FOCAL] public static int[] WordUtil.getWordColors(List<LetterSource> letters, String word) [PATH1] if(letters == null)=T -> for(i < colors.length)=T -> exit loop -> return colors [PATH2] if(letters == null)=F -> return getWordColors(spelledWord.letters) [PATH3] if(letters == null)=T -> for(i < colors...
true
ok
{"focal": {"class": "WordUtil", "name": "getWordColors", "signature": "int[] getWordColors(List<LetterSource> letters, String word)", "start_line": 3, "modifiers": "public static", "params": [{"name": "letters", "type": "List<LetterSource>"}, {"name": "word", "type": "String"}], "return_type": "int[]"}, "class_info": {...
41351929_2
class Snmp implements Session, CommandResponder { public USM getUSM() { MPv3 mp = (MPv3) getMessageProcessingModel(MPv3.ID); if (mp != null) { return (USM)mp.getSecurityModel(SecurityModel.SECURITY_MODEL_USM); } return null; } public Snmp(); public Snmp(TransportMapping transportMappin...
assertNotSame(snmpCommandGenerator.getUSM(), snmpCommandResponder.getUSM()); } }
[FOCAL] public USM Snmp.getUSM() [CLASS] class Snmp implements Session, CommandResponder [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] MessageProcessingModel getMessageProcessingModel(int messageProcessingModel) [CALLS-EXTERNAL] MPv3.getSecurityModel/1 [PATH1] if(mp != null)=T ->...
/* static context [FOCAL] public USM Snmp.getUSM() [PATH1] if(mp != null)=T -> return (USM)mp.getSecurityModel(SecurityModel.SECURITY_MODEL_USM) [PATH2] if(mp != null)=F -> return null [CALLS-INTERNAL] MessageProcessingModel getMessageProcessingModel(int messageProcessingModel) [CALLS-EXTERNAL] MPv3.getSecurityModel/1 ...
/* static context [FOCAL] public USM Snmp.getUSM() [PATH1] if(mp != null)=T -> return (USM)mp.getSecurityModel(SecurityModel.SECURITY_MODEL_USM) [PATH2] if(mp != null)=F -> return null [CALLS-INTERNAL] MessageProcessingModel getMessageProcessingModel(int messageProcessingModel) [CALLS-EXTERNAL] MPv3.getSecurityModel/1 ...
true
ok
{"focal": {"class": "Snmp", "name": "getUSM", "signature": "USM getUSM()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "USM"}, "class_info": {"name": "Snmp", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Session, CommandResponder", "fields": [{"name": "transportMappingCG"...
41361042_43
class Dump2HTMLCreator { public void dump(DumpMode mode, File dbDirectory, File htmlDirectory, @Nullable File imageDirectory) throws IOException { try (WikiDB db = new WikiDB(dbDirectory)) { if (mode == BOTH || mode == WRITE_TEMPLATES_AND_MODULES) { firstPass(db); ...
creator.dump(Dump2HTMLCreator.DumpMode.BOTH, dbDir, htmlDir, null); assertThat(dbDir).isDirectory(); assertThat(htmlDir).isDirectory(); assertThat(htmlDir.listFiles()).hasSize(3); } }
[FOCAL] public void Dump2HTMLCreator.dump(DumpMode mode, File dbDirectory, File htmlDirectory, File imageDirectory) [CLASS] class Dump2HTMLCreator [METRICS] loc=14 cc=4 branches=2 loops=0 returns=0 throws=1 nesting=2 [CALLS-INTERNAL] void firstPass(WikiDB db); void secondPass(WikiDB db, File htmlDirectory, File imageDi...
/* static context [FOCAL] public void Dump2HTMLCreator.dump(DumpMode mode, File dbDirectory, File htmlDirectory, File imageDirectory) [THROWS-WHEN] IOException when try-body throws [PATH1] try-body throws -> throw new IOException(e) [PATH2] if(mode == BOTH || mode == WRITE_TEMPLATES_AND_MODULES)=T -> if(mode == BOTH ||...
/* static context [FOCAL] public void Dump2HTMLCreator.dump(DumpMode mode, File dbDirectory, File htmlDirectory, File imageDirectory) [THROWS-WHEN] IOException when try-body throws [PATH1] try-body throws -> throw new IOException(e) [PATH2] if(mode == BOTH || mode == WRITE_TEMPLATES_AND_MODULES)=T -> if(mode == BOTH ||...
true
ok
{"focal": {"class": "Dump2HTMLCreator", "name": "dump", "signature": "void dump(DumpMode mode, File dbDirectory, File htmlDirectory, File imageDirectory) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "mode", "type": "DumpMode"}, {"name": "dbDirectory", "type": "File"}, {"name": "htmlD...
41395725_46
class CollectionUtil { public static String toString(final Collection<?> collection, final String separator) { if (collection == null || collection.isEmpty()) { // just return an empty String if the collection is null or empty return ""; } if (separator == null) { ...
Assert.assertEquals("", CollectionUtil.toString(Collections.emptyList(), ".")); } }
[FOCAL] public static String CollectionUtil.toString(Collection<?> collection, String separator) [CLASS] class CollectionUtil [METRICS] loc=26 cc=6 branches=4 loops=1 returns=3 throws=0 nesting=2 [CALLS-EXTERNAL] Collection<?>.isEmpty/0, Collection<?>.toString/0, Collection<?>.size/0, String.length/0, StringBuilder.app...
/* static context [FOCAL] public static String CollectionUtil.toString(Collection<?> collection, String separator) [PATH1] if(collection == null || collection.isEmpty())=F -> if(separator == null)=F -> foreach(Object collectionElement : collection)=T -> if(addSeparator)=T -> if(collectionElement != null)=T -> exit loop...
/* static context [FOCAL] public static String CollectionUtil.toString(Collection<?> collection, String separator) [PATH1] if(collection == null || collection.isEmpty())=F -> if(separator == null)=F -> foreach(Object collectionElement : collection)=T -> if(addSeparator)=T -> if(collectionElement != null)=T -> exit loop...
true
ok
{"focal": {"class": "CollectionUtil", "name": "toString", "signature": "String toString(Collection<?> collection, String separator)", "start_line": 3, "modifiers": "public static", "params": [{"name": "collection", "type": "Collection<?>"}, {"name": "separator", "type": "String"}], "return_type": "String"}, "class_info...
41414120_5
class RowKeyUtil { public static RowKey getEndRowKeyOfPrefix(RowKey prefixRowKey) { Util.checkRowKey(prefixRowKey); byte[] rowkeyBytes = prefixRowKey.toBytes(); Util.check(rowkeyBytes.length != 0); boolean isAllByteIsFF = true; for (byte b : rowkeyBytes) { if (...
try { RowKeyUtil.getEndRowKeyOfPrefix(null); Assert.fail(); } catch (Exception e) { //ignore. } try { RowKeyUtil.getEndRowKeyOfPrefix(new StringRowKey("")); Assert.fail(); } catch (Exception e) { //ignore. ...
[FOCAL] public static RowKey RowKeyUtil.getEndRowKeyOfPrefix(RowKey prefixRowKey) [CLASS] class RowKeyUtil [METRICS] loc=22 cc=4 branches=2 loops=1 returns=1 throws=1 nesting=2 [CALLS-EXTERNAL] Util.checkRowKey/1, RowKey.toBytes/0, Util.check/1, BytesUtil.increaseLastByte/1 [NEW] SimpleHBaseException, BytesRowKey [EXCE...
/* static context [FOCAL] public static RowKey RowKeyUtil.getEndRowKeyOfPrefix(RowKey prefixRowKey) [THROWS-WHEN] SimpleHBaseException when foreach(byte b : rowkeyBytes)=T && (b & 0xFF) != 0xFF && isAllByteIsFF [THROWS-WHEN] SimpleHBaseException when foreach(byte b : rowkeyBytes)=T && !((b & 0xFF) != 0xFF) && isAllByte...
/* static context [FOCAL] public static RowKey RowKeyUtil.getEndRowKeyOfPrefix(RowKey prefixRowKey) [THROWS-WHEN] SimpleHBaseException when foreach(byte b : rowkeyBytes)=T && (b & 0xFF) != 0xFF && isAllByteIsFF [THROWS-WHEN] SimpleHBaseException when foreach(byte b : rowkeyBytes)=T && !((b & 0xFF) != 0xFF) && isAllByte...
true
ok
{"focal": {"class": "RowKeyUtil", "name": "getEndRowKeyOfPrefix", "signature": "RowKey getEndRowKeyOfPrefix(RowKey prefixRowKey)", "start_line": 3, "modifiers": "public static", "params": [{"name": "prefixRowKey", "type": "RowKey"}], "return_type": "RowKey"}, "class_info": {"name": "RowKeyUtil", "kind": "class", "modif...
41423327_23
class StringUtil { public static int findWhitespace(CharSequence s) { return findWhitespace(s, 0); } private StringUtil(); public static String fixSizeString(int size, boolean alignLeft, char filler, long value); public static String fixSizeString(int size, boolean alignLeft, String s); public static ...
final String s = "Bla\n\r\n\r \thello \r\r\n\nblabla"; Assert.assertEquals(3, StringUtil.findWhitespace(s)); for (int i = 0; i < s.length(); i++) { final int expected = i <= 3 ? 3 : i < 9 ? i : i < 14 ? 14 : i < s.length() - 6 ? i : s.length(); Assert.assertEquals(expected, StringUtil.findWhitespace(s, i));...
[FOCAL] public static int StringUtil.findWhitespace(CharSequence s) [CLASS] class StringUtil [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] int findWhitespace(CharSequence s, int start) [INPUTS] branches=- | result=s [DATAFLOW] s@param->L2 [CLASS-MEMBERS] StringUtil(); String fixS...
/* static context [FOCAL] public static int StringUtil.findWhitespace(CharSequence s) [INPUTS] branches=- | result=s [CALLS-INTERNAL] int findWhitespace(CharSequence s, int start) */
/* static context [FOCAL] public static int StringUtil.findWhitespace(CharSequence s) [INPUTS] branches=- | result=s [CALLS-INTERNAL] int findWhitespace(CharSequence s, int start) */ class StringUtil { public static int findWhitespace(CharSequence s) { return findWhitespace(s, 0); } private StringUtil(); publ...
true
ok
{"focal": {"class": "StringUtil", "name": "findWhitespace", "signature": "int findWhitespace(CharSequence s)", "start_line": 3, "modifiers": "public static", "params": [{"name": "s", "type": "CharSequence"}], "return_type": "int"}, "class_info": {"name": "StringUtil", "kind": "class", "modifiers": "", "superclass": nul...
41460477_59
class PointHandlerDispatcher implements Runnable { @Override public void run() { try { AtomicInteger dispatchedCount = new AtomicInteger(0); long startMillis = System.currentTimeMillis(); digestsSize.set(digests.size()); // update size before flushing, so we show a higher value Iterato...
in.put(keyA, digestA); in.flush(); timeMillis.set(101L); subject.run(); assertThat(pointOut).hasSize(1); assertThat(blockedOut).hasSize(0); assertThat(backingStore).isEmpty(); ReportPoint point = pointOut.get(0); TestUtils.testKeyPointMatch(keyA, point); } }
[FOCAL] @Override public void PointHandlerDispatcher.run() [CLASS] class PointHandlerDispatcher implements Runnable [METRICS] loc=39 cc=4 branches=1 loops=1 returns=0 throws=0 nesting=4 [CALLS-EXTERNAL] System.currentTimeMillis/0, digestsSize.set/1, digests.size/0, digests.getRipeDigestsIterator/1, Iterator<HistogramKe...
/* static context [FOCAL] @Override public void PointHandlerDispatcher.run() [PATH1] while(index.hasNext())=T -> if(dispatchLimit != null && dispatchedCount.get() >= dispatchLimit)=F -> exit loop [PATH2] try-body throws [PATH3] while(index.hasNext())=F [PATH4] while(index.hasNext())=T -> if(dispatchLimit != null && dis...
/* static context [FOCAL] @Override public void PointHandlerDispatcher.run() [PATH1] while(index.hasNext())=T -> if(dispatchLimit != null && dispatchedCount.get() >= dispatchLimit)=F -> exit loop [PATH2] try-body throws [PATH3] while(index.hasNext())=F [PATH4] while(index.hasNext())=T -> if(dispatchLimit != null && dis...
true
ok
{"focal": {"class": "PointHandlerDispatcher", "name": "run", "signature": "void run()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "PointHandlerDispatcher", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Runnable", "fields": [{"na...
41486933_66
class PersistentMap implements Initialisable { public boolean containsKey(final K key) throws DataAccessLayerException { return (key != null && _dao.contains(key)); } public PersistentMap(final Class<K> k, final Class<V> v, final String name, final boolean bidirectional, final V defaultValue); public void ...
for (String key : TESTDATA1.keySet()) { assertTrue(map.containsKey(key)); } for (String key : TESTDATA4.keySet()) { assertTrue(!map.containsKey(key)); } } }
[FOCAL] public boolean PersistentMap.containsKey(K key) [CLASS] class PersistentMap implements Initialisable [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] _dao.contains/1 [EXCEPTIONS] declares DataAccessLayerException [INPUTS] branches=- | result=key [DATAFLOW] key@param->L2 [CLA...
/* static context [FOCAL] public boolean PersistentMap.containsKey(K key) [INPUTS] branches=- | result=key [EXCEPTIONS] declares DataAccessLayerException [CALLS-EXTERNAL] _dao.contains/1 */
/* static context [FOCAL] public boolean PersistentMap.containsKey(K key) [INPUTS] branches=- | result=key [EXCEPTIONS] declares DataAccessLayerException [CALLS-EXTERNAL] _dao.contains/1 */ class PersistentMap implements Initialisable { public boolean containsKey(final K key) throws DataAccessLayerException { retur...
true
ok
{"focal": {"class": "PersistentMap", "name": "containsKey", "signature": "boolean containsKey(K key) throws DataAccessLayerException", "start_line": 3, "modifiers": "public", "params": [{"name": "key", "type": "K"}], "return_type": "boolean"}, "class_info": {"name": "PersistentMap", "kind": "class", "modifiers": "", "s...
41505622_33
class AdmobAdapterCalculator { public boolean canShowAdAtPosition(int position, int fetchedAdsCount) { // Is this a valid position for an ad? // Is an ad for this position available? return isAdPosition(position) && isAdAvailable(position, fetchedAdsCount); } public int getNoOfDat...
setupAdmobAdapterCalculatorHelper(10, 0, 0); assertThat(admobAdapterCalculator.canShowAdAtPosition(0, 100), is(false)); } }
[FOCAL] public boolean AdmobAdapterCalculator.canShowAdAtPosition(int position, int fetchedAdsCount) [CLASS] class AdmobAdapterCalculator [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] boolean isAdAvailable(int position, int fetchedAdsCount); boolean isAdPosition(int position) [IN...
/* static context [FOCAL] public boolean AdmobAdapterCalculator.canShowAdAtPosition(int position, int fetchedAdsCount) [INPUTS] branches=- | result=fetchedAdsCount, position [CALLS-INTERNAL] boolean isAdAvailable(int position, int fetchedAdsCount); boolean isAdPosition(int position) */
/* static context [FOCAL] public boolean AdmobAdapterCalculator.canShowAdAtPosition(int position, int fetchedAdsCount) [INPUTS] branches=- | result=fetchedAdsCount, position [CALLS-INTERNAL] boolean isAdAvailable(int position, int fetchedAdsCount); boolean isAdPosition(int position) */ class AdmobAdapterCalculator { ...
true
ok
{"focal": {"class": "AdmobAdapterCalculator", "name": "canShowAdAtPosition", "signature": "boolean canShowAdAtPosition(int position, int fetchedAdsCount)", "start_line": 3, "modifiers": "public", "params": [{"name": "position", "type": "int"}, {"name": "fetchedAdsCount", "type": "int"}], "return_type": "boolean"}, "cla...
41547678_77
class ParamUtils { public static String getterName(FormalParameter formalParameter, SymbolResolver resolver) { return Property.getterName(formalParameter.getType(), formalParameter.getName(), resolver); } private ParamUtils(); public static boolean verifyOrder(List<ActualParam> actualParams)...
SymbolResolver resolver = new ComposedSymbolResolver(Collections.emptyList()); assertEquals("getFoo", ParamUtils.getterName(new FormalParameterSymbol(new ReferenceTypeUsage(ReflectionTypeDefinitionFactory.getInstance().getTypeDefinition(Boolean.class, resolver)), "foo"), DUMMY_RESOLVER)); assert...
[FOCAL] public static String ParamUtils.getterName(FormalParameter formalParameter, SymbolResolver resolver) [CLASS] class ParamUtils [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Property.getterName/3, FormalParameter.getType/0, FormalParameter.getName/0 [INPUTS] branches=- | re...
/* static context [FOCAL] public static String ParamUtils.getterName(FormalParameter formalParameter, SymbolResolver resolver) [INPUTS] branches=- | result=formalParameter, resolver [COLLABORATORS] param formalParameter:FormalParameter getType/0,getName/0 [CALLS-EXTERNAL] Property.getterName/3, FormalParameter.getType/...
/* static context [FOCAL] public static String ParamUtils.getterName(FormalParameter formalParameter, SymbolResolver resolver) [INPUTS] branches=- | result=formalParameter, resolver [COLLABORATORS] param formalParameter:FormalParameter getType/0,getName/0 [CALLS-EXTERNAL] Property.getterName/3, FormalParameter.getType/...
true
ok
{"focal": {"class": "ParamUtils", "name": "getterName", "signature": "String getterName(FormalParameter formalParameter, SymbolResolver resolver)", "start_line": 3, "modifiers": "public static", "params": [{"name": "formalParameter", "type": "FormalParameter"}, {"name": "resolver", "type": "SymbolResolver"}], "return_t...
41548314_0
class DCAwareFailoverRoundRobinPolicy implements LoadBalancingPolicy, CloseableLoadBalancingPolicy { public HostDistance distance(Host host) { String dc = dc(host); // If the connection has switched to the backup DC and fulfills // the requirement for a back switch, make it happen. if(!switchBackCanNeverHap...
int i=0; for(Host host:hosts){ policy.onUp(host); if(i<=2){ // dc1 is local assertEquals(policy.distance(host),HostDistance.LOCAL); }else{ assertTrue(policy.distance(host).equals(HostDistance.REMOTE) || policy.distance(host).equals(HostDistance.IGNORED)); } i++; } } }
[FOCAL] public HostDistance DCAwareFailoverRoundRobinPolicy.distance(Host host) [CLASS] class DCAwareFailoverRoundRobinPolicy implements LoadBalancingPolicy, CloseableLoadBalancingPolicy [METRICS] loc=20 cc=4 branches=3 loops=0 returns=3 throws=0 nesting=1 [CALLS-INTERNAL] String dc(Host host); boolean isLocal(String d...
/* static context [FOCAL] public HostDistance DCAwareFailoverRoundRobinPolicy.distance(Host host) [PATH1] if(!switchBackCanNeverHappen)=T -> if(isLocal(dc))=F -> if(dc(host).equals(localDc) || dc(host).equals(backupDc))=T -> return HostDistance.REMOTE [PATH2] if(!switchBackCanNeverHappen)=F -> if(isLocal(dc))=T -> retu...
/* static context [FOCAL] public HostDistance DCAwareFailoverRoundRobinPolicy.distance(Host host) [PATH1] if(!switchBackCanNeverHappen)=T -> if(isLocal(dc))=F -> if(dc(host).equals(localDc) || dc(host).equals(backupDc))=T -> return HostDistance.REMOTE [PATH2] if(!switchBackCanNeverHappen)=F -> if(isLocal(dc))=T -> retu...
true
ok
{"focal": {"class": "DCAwareFailoverRoundRobinPolicy", "name": "distance", "signature": "HostDistance distance(Host host)", "start_line": 4, "modifiers": "public", "params": [{"name": "host", "type": "Host"}], "return_type": "HostDistance"}, "class_info": {"name": "DCAwareFailoverRoundRobinPolicy", "kind": "class", "mo...
41627638_105
class Solution { public List<String> fizzBuzz(int n) { return IntStream.rangeClosed(1, n).boxed().map(i -> { boolean isFizz = i % 3 == 0; boolean isBuzz = i % 5 == 0; if (isFizz && isBuzz) { return "FizzBuzz"; } else if (isBuzz) { ...
Solution solution = new Solution(); List<String> strings = solution.fizzBuzz(3); assertThat(strings, hasItems("1", "2", "Fizz")); } }
[FOCAL] public List<String> Solution.fizzBuzz(int n) [CLASS] class Solution [METRICS] loc=15 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=3 [CALLS-EXTERNAL] IntStream.rangeClosed(1, n).boxed().map(i -> { boolean is....collect/1, IntStream.rangeClosed(1, n).boxed().map/1, IntStream.rangeClosed(1, n).boxed/0, IntSt...
/* static context [FOCAL] public List<String> Solution.fizzBuzz(int n) [INPUTS] branches=- | result=n [COLLABORATORS] field i toString/0 [CALLS-EXTERNAL] IntStream.rangeClosed(1, n).boxed().map(i -> { boolean is....collect/1, IntStream.rangeClosed(1, n).boxed().map/1, IntStream.rangeClosed(1, n).boxed/0, IntStream.rang...
/* static context [FOCAL] public List<String> Solution.fizzBuzz(int n) [INPUTS] branches=- | result=n [COLLABORATORS] field i toString/0 [CALLS-EXTERNAL] IntStream.rangeClosed(1, n).boxed().map(i -> { boolean is....collect/1, IntStream.rangeClosed(1, n).boxed().map/1, IntStream.rangeClosed(1, n).boxed/0, IntStream.rang...
true
ok
{"focal": {"class": "Solution", "name": "fizzBuzz", "signature": "List<String> fizzBuzz(int n)", "start_line": 3, "modifiers": "public", "params": [{"name": "n", "type": "int"}], "return_type": "List<String>"}, "class_info": {"name": "Solution", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, ...
41630081_12
class TodaysExpensePresenter { public void renderTodaysExpenses() { view.displayTodaysExpenses(expenses); } public TodaysExpensePresenter(TodaysExpenseView view, ExpenseDatabaseHelper expenseDatabaseHelper); public void renderTotalExpense(); private ExpenseDatabaseHelper database; private TodaysExp...
presenter.renderTodaysExpenses(); verify(view).displayTodaysExpenses(expenses); } }
[FOCAL] public void TodaysExpensePresenter.renderTodaysExpenses() [CLASS] class TodaysExpensePresenter [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] TodaysExpenseView.displayTodaysExpenses/1 [FIELDS] read=expenses:List<Expense>, view:TodaysExpenseView [COLLABORATORS] field view:T...
/* static context [FOCAL] public void TodaysExpensePresenter.renderTodaysExpenses() [COLLABORATORS] field view:TodaysExpenseView displayTodaysExpenses/1 [FIELDS] read=expenses:List<Expense>, view:TodaysExpenseView [CALLS-EXTERNAL] TodaysExpenseView.displayTodaysExpenses/1 */
/* static context [FOCAL] public void TodaysExpensePresenter.renderTodaysExpenses() [COLLABORATORS] field view:TodaysExpenseView displayTodaysExpenses/1 [FIELDS] read=expenses:List<Expense>, view:TodaysExpenseView [CALLS-EXTERNAL] TodaysExpenseView.displayTodaysExpenses/1 */ class TodaysExpensePresenter { public voi...
true
ok
{"focal": {"class": "TodaysExpensePresenter", "name": "renderTodaysExpenses", "signature": "void renderTodaysExpenses()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "TodaysExpensePresenter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": nul...
41633076_0
class ClassDefinitionDao { public Set<ClassDefinition> parseClassFiles(Path path) { Set<ClassDefinition> set = new HashSet<>(); try { Map<String, Path> stringPathMap = preloadClassDefs(path, set); for (Map.Entry<String, Path> stringPathEntry : stringPathMap.entrySet()) { ...
Set<ClassDefinition> classDefinitions = classDefinitionDao.parseClassFiles(null); Assertions.assertSame(classDefinitions.size(), 1); ClassDefinition c = classDefinitions.iterator().next(); Assertions.assertEquals(c.getName(), "ClassExample1"); Assertions.assertEquals(c.getDescrip...
[FOCAL] public Set<ClassDefinition> ClassDefinitionDao.parseClassFiles(Path path) [CLASS] class ClassDefinitionDao [METRICS] loc=35 cc=6 branches=2 loops=2 returns=1 throws=0 nesting=5 [CALLS-INTERNAL] Map<String, Path> preloadClassDefs(Path path, Set<ClassDefinition> set) [CALLS-EXTERNAL] Map<String, Path>.entrySet/0,...
/* static context [FOCAL] public Set<ClassDefinition> ClassDefinitionDao.parseClassFiles(Path path) [PATH1] foreach(Map.Entry<String, Path> stringPathEntry : stringPathMap.entrySet())=T -> foreach(ClassDefinition classDefinition : set)=T -> if(classDefinition.getName().equalsIgnoreCase(key))=T -> if(result.getLevelProg...
/* static context [FOCAL] public Set<ClassDefinition> ClassDefinitionDao.parseClassFiles(Path path) [PATH1] foreach(Map.Entry<String, Path> stringPathEntry : stringPathMap.entrySet())=T -> foreach(ClassDefinition classDefinition : set)=T -> if(classDefinition.getName().equalsIgnoreCase(key))=T -> if(result.getLevelProg...
true
ok
{"focal": {"class": "ClassDefinitionDao", "name": "parseClassFiles", "signature": "Set<ClassDefinition> parseClassFiles(Path path)", "start_line": 3, "modifiers": "public", "params": [{"name": "path", "type": "Path"}], "return_type": "Set<ClassDefinition>"}, "class_info": {"name": "ClassDefinitionDao", "kind": "class",...
41636618_2
class GenerateMojo extends AbstractMojo { @Nullable @SneakyThrows({ MalformedURLException.class, NoSuchAlgorithmException.class }) @VisibleForTesting Dependency findArtifactInRepository(Artifact artifact, ArtifactRepository repository) throws MojoExecutionException { String artifac...
GenerateMojo mojo = new GenerateMojo(); mojo.setLog(new SystemStreamLog()); Dependency dependency = mojo.findArtifactInRepository( new DefaultArtifact("org.spigotmc", "spigot-api", "1.8-R0.1-SNAPSHOT", "compile", "jar", "jar", new DefaultArtif...
[FOCAL] @Nullable @SneakyThrows({ MalformedURLException.class, NoSuchAlgorithmException.class }) @VisibleForTesting Dependency GenerateMojo.findArtifactInRepository(Artifact artifact, ArtifactRepository repository) [CLASS] class GenerateMojo extends AbstractMojo [METRICS] loc=66 cc=7 branches=2 loops=1 returns=2 throws...
/* static context [FOCAL] @Nullable @SneakyThrows({ MalformedURLException.class, NoSuchAlgorithmException.class }) @VisibleForTesting Dependency GenerateMojo.findArtifactInRepository(Artifact artifact, ArtifactRepository repository) [THROWS-WHEN] MojoExecutionException when artifact.isSnapshot() && try-body throws [PAT...
/* static context [FOCAL] @Nullable @SneakyThrows({ MalformedURLException.class, NoSuchAlgorithmException.class }) @VisibleForTesting Dependency GenerateMojo.findArtifactInRepository(Artifact artifact, ArtifactRepository repository) [THROWS-WHEN] MojoExecutionException when artifact.isSnapshot() && try-body throws [PAT...
true
ok
{"focal": {"class": "GenerateMojo", "name": "findArtifactInRepository", "signature": "Dependency findArtifactInRepository(Artifact artifact, ArtifactRepository repository) throws MojoExecutionException", "start_line": 3, "modifiers": "@Nullable @SneakyThrows({ MalformedURLException.class, NoSuchAlgorithmException.class...
41688821_1
class NavigatorCodeGenerator { MethodSpec handleParamActivity(String group, NavigableAnnotatedClass value) { TypeName activityTypeName = AndroidSpecificClassProvider.getActivityTypeName(); TypeName intentTypeName = AndroidSpecificClassProvider.getIntentTypeName(); String activityQualifiedNa...
String className = TestConstants.testPackageName + ".AA"; NavigableAnnotatedClass navigableAnnotatedClass = Mockito.mock(NavigableAnnotatedClass.class); TypeElement typeElement = Mockito.mock(TypeElement.class); Name name = Mockito.mock(Name.class); when(typeElement.getQualif...
[FOCAL] MethodSpec NavigatorCodeGenerator.handleParamActivity(String group, NavigableAnnotatedClass value) [CLASS] class NavigatorCodeGenerator [METRICS] loc=55 cc=9 branches=5 loops=3 returns=1 throws=1 nesting=2 [CALLS-INTERNAL] TypeName getTypeName(VariableElement param) [CALLS-EXTERNAL] AndroidSpecificClassProvider...
/* static context [FOCAL] MethodSpec NavigatorCodeGenerator.handleParamActivity(String group, NavigableAnnotatedClass value) [THROWS-WHEN] NotAllFieldsAreAnnotatedForResultException when foreach(VariableElement param : value.getParamAnnotatedFields().get(group))#1=T && param.getAnnotation(Param.class).forResult() && fo...
/* static context [FOCAL] MethodSpec NavigatorCodeGenerator.handleParamActivity(String group, NavigableAnnotatedClass value) [THROWS-WHEN] NotAllFieldsAreAnnotatedForResultException when foreach(VariableElement param : value.getParamAnnotatedFields().get(group))#1=T && param.getAnnotation(Param.class).forResult() && fo...
true
ok
{"focal": {"class": "NavigatorCodeGenerator", "name": "handleParamActivity", "signature": "MethodSpec handleParamActivity(String group, NavigableAnnotatedClass value)", "start_line": 3, "modifiers": "", "params": [{"name": "group", "type": "String"}, {"name": "value", "type": "NavigableAnnotatedClass"}], "return_type":...
41741864_2
class MultiPathTrie { public void addOrAppendPath(final String path, final T payload) { if (path == null) { return; } Collection<T> currentPayload = delegate.get(path); if (currentPayload == null) { currentPayload = new LinkedList<>(); delegate.a...
MultiPathTrie<String> multiPathTrie = new MultiPathTrie<>(); multiPathTrie.addOrAppendPath("/a/b/c", "abc1"); multiPathTrie.addOrAppendPath("/a/b/c", "abc2"); multiPathTrie.addOrAppendPath("/a/b", "ab1"); Collection<String> strings1 = multiPathTrie.get("/a/b/c"); Asse...
[FOCAL] public void MultiPathTrie.addOrAppendPath(String path, T payload) [CLASS] class MultiPathTrie [METRICS] loc=11 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] delegate.get/1, delegate.addPath/2, Collection<T>.add/1 [NEW] LinkedList<> [PATH1] if(path == null)=T -> return [PATH2] if(path == ...
/* static context [FOCAL] public void MultiPathTrie.addOrAppendPath(String path, T payload) [PATH1] if(path == null)=T -> return [PATH2] if(path == null)=F -> if(currentPayload == null)=T [PATH3] if(path == null)=F -> if(currentPayload == null)=F [INPUTS] branches=path | result=- [COLLABORATORS] field delegate get/1,ad...
/* static context [FOCAL] public void MultiPathTrie.addOrAppendPath(String path, T payload) [PATH1] if(path == null)=T -> return [PATH2] if(path == null)=F -> if(currentPayload == null)=T [PATH3] if(path == null)=F -> if(currentPayload == null)=F [INPUTS] branches=path | result=- [COLLABORATORS] field delegate get/1,ad...
true
ok
{"focal": {"class": "MultiPathTrie", "name": "addOrAppendPath", "signature": "void addOrAppendPath(String path, T payload)", "start_line": 3, "modifiers": "public", "params": [{"name": "path", "type": "String"}, {"name": "payload", "type": "T"}], "return_type": "void"}, "class_info": {"name": "MultiPathTrie", "kind": "...
41742830_0
class PokerUtils { public static double getChenScore(Card[] cards) { if (cards.length != 2) { throw new IllegalArgumentException("Invalid number of cards: " + cards.length); } // Analyze hole cards. int rank1 = cards[0].getRank(); int suit1 = cards[0].ge...
Card card1 = null; Card card2 = null; card1 = new Card(Card.ACE, Card.SPADES); card2 = new Card(Card.ACE, Card.HEARTS); Assert.assertEquals(20.0, PokerUtils.getChenScore(new Card[] {card1, card2}), DELTA); card1 = new Card(Card.ACE, Card.SPADES); card2 =...
[FOCAL] public static double PokerUtils.getChenScore(Card[] cards) [CLASS] class PokerUtils [METRICS] loc=69 cc=15 branches=14 loops=0 returns=1 throws=1 nesting=4 [CALLS-EXTERNAL] cards[0].getRank/0, cards[0].getSuit/0, cards[1].getRank/0, cards[1].getSuit/0, Math.max/2, Math.min/2, Math.round/1 [NEW] IllegalArgumentE...
/* static context [FOCAL] public static double PokerUtils.getChenScore(Card[] cards) [THROWS-WHEN] IllegalArgumentException when cards.length != 2 [PATH1] if(cards.length != 2)=F -> if(highRank == Card.ACE)=T -> if(isPair)=T -> if(score < 5.0)=T -> if(isSuited)=T -> if(gap == 1)=F -> if(gap == 2)=F -> if(gap == 3)=F ->...
/* static context [FOCAL] public static double PokerUtils.getChenScore(Card[] cards) [THROWS-WHEN] IllegalArgumentException when cards.length != 2 [PATH1] if(cards.length != 2)=F -> if(highRank == Card.ACE)=T -> if(isPair)=T -> if(score < 5.0)=T -> if(isSuited)=T -> if(gap == 1)=F -> if(gap == 2)=F -> if(gap == 3)=F ->...
true
ok
{"focal": {"class": "PokerUtils", "name": "getChenScore", "signature": "double getChenScore(Card[] cards)", "start_line": 3, "modifiers": "public static", "params": [{"name": "cards", "type": "Card[]"}], "return_type": "double"}, "class_info": {"name": "PokerUtils", "kind": "class", "modifiers": "", "superclass": null,...
41742943_7
class MessageParser { private static Data<?> parseData(byte[] data, int offset) throws SecsParseException { if (data.length < 2) { throw new SecsParseException("Invalid data length: " + data.length); } int formatByte = data[offset]; int formatCode = formatByte &...
Data<?> data = MessageParser.parseData("<U2>"); Assert.assertTrue(data instanceof U2); U2 u2 = (U2) data; Assert.assertEquals(0, u2.length()); data = MessageParser.parseData("<U2 0 1 65535>"); Assert.assertTrue(data instanceof U2); u2 = (U2) data; ...
[FOCAL] private static Data<?> MessageParser.parseData(byte[] data, int offset) [CLASS] class MessageParser [METRICS] loc=78 cc=22 branches=8 loops=0 returns=1 throws=5 nesting=1 [CALLS-INTERNAL] A parseA(byte[] data, int offset, int length); B parseB(byte[] data, int offset, int length); BOOLEAN parseBoolean(byte[] da...
/* static context [FOCAL] private static Data<?> MessageParser.parseData(byte[] data, int offset) [THROWS-WHEN] SecsParseException when data.length < 2 [THROWS-WHEN] SecsParseException when !(data.length < 2) && noOfLengthBytes < 1 || noOfLengthBytes > LENGTH_LENGTH [THROWS-WHEN] SecsParseException when !(data.length <...
/* static context [FOCAL] private static Data<?> MessageParser.parseData(byte[] data, int offset) [THROWS-WHEN] SecsParseException when data.length < 2 [THROWS-WHEN] SecsParseException when !(data.length < 2) && noOfLengthBytes < 1 || noOfLengthBytes > LENGTH_LENGTH [THROWS-WHEN] SecsParseException when !(data.length <...
true
ok
{"focal": {"class": "MessageParser", "name": "parseData", "signature": "Data<?> parseData(byte[] data, int offset) throws SecsParseException", "start_line": 3, "modifiers": "private static", "params": [{"name": "data", "type": "byte[]"}, {"name": "offset", "type": "int"}], "return_type": "Data<?>"}, "class_info": {"nam...
41754174_4
class ElectrumMultiWallet extends SmartMultiWallet implements WalletExtension, StratumChain.Listener { @Override public void markKeysAsUsed(Transaction tx) { wallet.lock(); wallet.lockKeychain(); try { KeyChainGroup group = wallet.getKeychain(); List<Object> oldC...
control.replay(); DeterministicKey key1 = wallet.currentReceiveKey(); Transaction tx1 = FakeTxBuilder.createFakeTx(params, Coin.CENT, key1.toAddress(params)); multiWallet.addPendingDownload(tx1.getHash()); multiWallet.receive(tx1, 0); DeterministicKey key2 = wallet.curren...
[FOCAL] @Override public void ElectrumMultiWallet.markKeysAsUsed(Transaction tx) [CLASS] class ElectrumMultiWallet extends SmartMultiWallet implements WalletExtension, StratumChain.Listener [METRICS] loc=28 cc=4 branches=0 loops=2 returns=0 throws=0 nesting=3 [CALLS-INTERNAL] List<Object> getCurrentKeys(KeyChainGroup k...
/* static context [FOCAL] @Override public void ElectrumMultiWallet.markKeysAsUsed(Transaction tx) [PATH1] while(!currentKeys.equals(oldCurrentKeys))=T -> foreach(Transaction oldTx : txs.values())=F -> exit loop [PATH2] while(!currentKeys.equals(oldCurrentKeys))=F [PATH3] try-body throws [PATH4] while(!currentKeys.equa...
/* static context [FOCAL] @Override public void ElectrumMultiWallet.markKeysAsUsed(Transaction tx) [PATH1] while(!currentKeys.equals(oldCurrentKeys))=T -> foreach(Transaction oldTx : txs.values())=F -> exit loop [PATH2] while(!currentKeys.equals(oldCurrentKeys))=F [PATH3] try-body throws [PATH4] while(!currentKeys.equa...
true
ok
{"focal": {"class": "ElectrumMultiWallet", "name": "markKeysAsUsed", "signature": "void markKeysAsUsed(Transaction tx)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "tx", "type": "Transaction"}], "return_type": "void"}, "class_info": {"name": "ElectrumMultiWallet", "kind": "class", "modifiers"...
41772834_20
class CommentParser { static Comment parse(String owningClass, String commentText) { return isBlank(commentText) ? Comment.createEmpty() : new Comment(parseElements(owningClass, commentText.trim())); } private static List<CommentElement> parseElements(String owningClass, String commentText); p...
List<CommentElement> elements = CommentParser.parse("TestClass", "{@value ClassName#member}").getElements(); assertEquals(1, elements.size()); assertEquals(new InlineValue(new Value("ClassName", "member")), elements.get(0)); } }
[FOCAL] static Comment CommentParser.parse(String owningClass, String commentText) [CLASS] class CommentParser [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] List<CommentElement> parseElements(String owningClass, String commentText) [CALLS-EXTERNAL] isBlank/1 (inherited), Comment....
/* static context [FOCAL] static Comment CommentParser.parse(String owningClass, String commentText) [INPUTS] branches=- | result=commentText, owningClass [CALLS-INTERNAL] List<CommentElement> parseElements(String owningClass, String commentText) [NEW] Comment [CALLS-EXTERNAL] isBlank/1 (inherited), Comment.createEmpty...
/* static context [FOCAL] static Comment CommentParser.parse(String owningClass, String commentText) [INPUTS] branches=- | result=commentText, owningClass [CALLS-INTERNAL] List<CommentElement> parseElements(String owningClass, String commentText) [NEW] Comment [CALLS-EXTERNAL] isBlank/1 (inherited), Comment.createEmpty...
true
ok
{"focal": {"class": "CommentParser", "name": "parse", "signature": "Comment parse(String owningClass, String commentText)", "start_line": 3, "modifiers": "static", "params": [{"name": "owningClass", "type": "String"}, {"name": "commentText", "type": "String"}], "return_type": "Comment"}, "class_info": {"name": "Comment...
41812613_1
class IdGenerator { public String increment(String fullId, int proposedCutoff) { StringBuilder mutable = new StringBuilder(fullId); if (proposedCutoff <= fullId.length()) { // First try normal incrementing for (int i = proposedCutoff - 1; i > 0; i--) { int n...
IdGenerator testGenerator = new IdGenerator(IdAlphabets.COLLECTION_ID, true); String[] inputs = new String[]{ "0000", "A", "AZ00", "Az00", "Zz00", "zz00", "zzz0", "zzzz" ...
[FOCAL] public String IdGenerator.increment(String fullId, int proposedCutoff) [CLASS] class IdGenerator [METRICS] loc=46 cc=8 branches=5 loops=2 returns=4 throws=0 nesting=3 [CALLS-EXTERNAL] String.length/0, mAlphabet.decodeDigit/1, StringBuilder.charAt/1, mAlphabet.radix/0, StringBuilder.setCharAt/2, mAlphabet.encode...
/* static context [FOCAL] public String IdGenerator.increment(String fullId, int proposedCutoff) [PATH1] if(proposedCutoff <= fullId.length())=T -> for(i > 0)=T -> if(newValue < mAlphabet.radix())#1=F -> exit loop -> if(proposedCutoff > 0)=T -> if(newValue < mAlphabet.leadingRadix())=F -> for(i < fullId.length())=T -> ...
/* static context [FOCAL] public String IdGenerator.increment(String fullId, int proposedCutoff) [PATH1] if(proposedCutoff <= fullId.length())=T -> for(i > 0)=T -> if(newValue < mAlphabet.radix())#1=F -> exit loop -> if(proposedCutoff > 0)=T -> if(newValue < mAlphabet.leadingRadix())=F -> for(i < fullId.length())=T -> ...
true
ok
{"focal": {"class": "IdGenerator", "name": "increment", "signature": "String increment(String fullId, int proposedCutoff)", "start_line": 3, "modifiers": "public", "params": [{"name": "fullId", "type": "String"}, {"name": "proposedCutoff", "type": "int"}], "return_type": "String"}, "class_info": {"name": "IdGenerator",...
41817706_439
class CloudHubArtifactDeployer implements ArtifactDeployer { protected Map<String, String> resolveProperties(Map<String, String> originalProperties, Map<String, String> properties, boolean overrideProperties) { if (properties != null) { if (!overridePropert...
Map<String, String> originalProperties = new HashMap<>(); originalProperties.put("foo", "bar"); Map<String, String> properties = new HashMap<>(); Map<String, String> resolvedProperties = cloudHubArtifactDeployer.resolveProperties(originalProperties, properties, true); assertThat("resolvedProperties ...
[FOCAL] protected Map<String, String> CloudHubArtifactDeployer.resolveProperties(Map<String, String> originalProperties, Map<String, String> properties, boolean overrideProperties) [CLASS] class CloudHubArtifactDeployer implements ArtifactDeployer [METRICS] loc=10 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=2 [C...
/* static context [FOCAL] protected Map<String, String> CloudHubArtifactDeployer.resolveProperties(Map<String, String> originalProperties, Map<String, String> properties, boolean overrideProperties) [PATH1] if(properties != null)=T -> if(!overrideProperties)=T -> return originalProperties [PATH2] if(properties != null)...
/* static context [FOCAL] protected Map<String, String> CloudHubArtifactDeployer.resolveProperties(Map<String, String> originalProperties, Map<String, String> properties, boolean overrideProperties) [PATH1] if(properties != null)=T -> if(!overrideProperties)=T -> return originalProperties [PATH2] if(properties != null)...
true
ok
{"focal": {"class": "CloudHubArtifactDeployer", "name": "resolveProperties", "signature": "Map<String, String> resolveProperties(Map<String, String> originalProperties, Map<String, String> properties, boolean overrideProperties)", "start_line": 3, "modifiers": "protected", "params": [{"name": "originalProperties", "typ...
41822437_0
class CustomIssueRegistry extends IssueRegistry { @Override public List<Issue> getIssues() { return mIssues; } public CustomIssueRegistry(); private CustomIssueRegistry mCustomIssueRegistry; } class CustomIssueRegistryTest { private CustomIssueRegistry mCustomIssueRegistry; @...
int size = mCustomIssueRegistry.getIssues().size(); assertThat(size).isEqualTo(3); } }
[FOCAL] @Override public List<Issue> CustomIssueRegistry.getIssues() [CLASS] class CustomIssueRegistry extends IssueRegistry [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] CustomIssueRegistry() [TEST] CustomIssueRegistryTest: @Test public void testNumberOfIssues() throws Exception ...
/* static context [FOCAL] @Override public List<Issue> CustomIssueRegistry.getIssues() */
/* static context [FOCAL] @Override public List<Issue> CustomIssueRegistry.getIssues() */ class CustomIssueRegistry extends IssueRegistry { @Override public List<Issue> getIssues() { return mIssues; } public CustomIssueRegistry(); private CustomIssueRegistry mCustomIssueRegistry; } cla...
true
ok
{"focal": {"class": "CustomIssueRegistry", "name": "getIssues", "signature": "List<Issue> getIssues()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "List<Issue>"}, "class_info": {"name": "CustomIssueRegistry", "kind": "class", "modifiers": "", "superclass": "IssueRegistry", "interface...
41889031_16
class ImportExportJsonHelper { public static List<SubscriptionItem> readFrom( final InputStream in, @Nullable final ImportExportEventListener eventListener) throws InvalidSourceException { if (in == null) { throw new InvalidSourceException("input is null"); } ...
final String emptySource = "{\"app_version\":\"0.11.6\",\"app_version_int\": 47,\"subscriptions\":[]}"; final List<SubscriptionItem> items = ImportExportJsonHelper.readFrom( new ByteArrayInputStream(emptySource.getBytes(StandardCharsets.UTF_8)), null); assertTrue...
[FOCAL] public static List<SubscriptionItem> ImportExportJsonHelper.readFrom(InputStream in, ImportExportEventListener eventListener) [CLASS] class ImportExportJsonHelper [METRICS] loc=43 cc=9 branches=6 loops=1 returns=1 throws=3 nesting=5 [CALLS-EXTERNAL] JsonParser.object().from/1, JsonParser.object/0, JsonObject.ha...
/* static context [FOCAL] public static List<SubscriptionItem> ImportExportJsonHelper.readFrom(InputStream in, ImportExportEventListener eventListener) [THROWS-WHEN] InvalidSourceException when in == null [THROWS-WHEN] InvalidSourceException when !(in == null) && try-body throws [THROWS-WHEN] InvalidSourceException whe...
/* static context [FOCAL] public static List<SubscriptionItem> ImportExportJsonHelper.readFrom(InputStream in, ImportExportEventListener eventListener) [THROWS-WHEN] InvalidSourceException when in == null [THROWS-WHEN] InvalidSourceException when !(in == null) && try-body throws [THROWS-WHEN] InvalidSourceException whe...
true
ok
{"focal": {"class": "ImportExportJsonHelper", "name": "readFrom", "signature": "List<SubscriptionItem> readFrom(InputStream in, ImportExportEventListener eventListener) throws InvalidSourceException", "start_line": 3, "modifiers": "public static", "params": [{"name": "in", "type": "InputStream"}, {"name": "eventListene...
41892061_2
class RecordingTransaction extends RecordingTransactionBase implements Transaction { public static RecordingTransaction wrap(Transaction tx) { return new RecordingTransaction(tx); } private RecordingTransaction(Transaction tx); private RecordingTransaction(Transaction tx, Predicate<LogEntry> filter); ...
TypedTransaction ttx = tl.wrap(rtx); ttx.mutate().row("r5").fam("cf5").qual("cq5").set("1"); ttx.mutate().row("r6").fam("cf6").qual("cq6").set("1"); List<LogEntry> entries = rtx.getTxLog().getLogEntries(); Assert.assertEquals(2, entries.size()); Assert.assertEquals("LogEntry{op=SET, row=r5, col=...
[FOCAL] public static RecordingTransaction RecordingTransaction.wrap(Transaction tx) [CLASS] class RecordingTransaction extends RecordingTransactionBase implements Transaction [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] RecordingTransaction [INPUTS] branches=- | result=tx [DATAFLOW] tx@pa...
/* static context [FOCAL] public static RecordingTransaction RecordingTransaction.wrap(Transaction tx) [INPUTS] branches=- | result=tx [NEW] RecordingTransaction */
/* static context [FOCAL] public static RecordingTransaction RecordingTransaction.wrap(Transaction tx) [INPUTS] branches=- | result=tx [NEW] RecordingTransaction */ class RecordingTransaction extends RecordingTransactionBase implements Transaction { public static RecordingTransaction wrap(Transaction tx) { retur...
true
ok
{"focal": {"class": "RecordingTransaction", "name": "wrap", "signature": "RecordingTransaction wrap(Transaction tx)", "start_line": 3, "modifiers": "public static", "params": [{"name": "tx", "type": "Transaction"}], "return_type": "RecordingTransaction"}, "class_info": {"name": "RecordingTransaction", "kind": "class", ...
41930098_3
class RateLimiter { public boolean tryAcquire() { // current time millis is not monotonic - it can jump back depending on user choice or NTP long now = System.nanoTime() / 1_000_000; // after this the request should be expired long toBeExpired = now - expireTime; synchroniz...
// fill the size - 100ms should be reasonable high RateLimiter rateLimiter = new RateLimiter(1, 100); assertTrue("Filling up", rateLimiter.tryAcquire()); Thread.sleep(50); // still is full - should fail assertFalse("Expired too early", rateLimiter.tryAcquire()); ...
[FOCAL] public boolean RateLimiter.tryAcquire() [CLASS] class RateLimiter [METRICS] loc=18 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] System.nanoTime/0 [PATH1] if(oldest < toBeExpired)=T -> return true [PATH2] if(oldest < toBeExpired)=F -> return false [DATAFLOW] now@L3->L6,L11; oldest@L9->L1...
/* static context [FOCAL] public boolean RateLimiter.tryAcquire() [PATH1] if(oldest < toBeExpired)=T -> return true [PATH2] if(oldest < toBeExpired)=F -> return false [CALLS-EXTERNAL] System.nanoTime/0 */
/* static context [FOCAL] public boolean RateLimiter.tryAcquire() [PATH1] if(oldest < toBeExpired)=T -> return true [PATH2] if(oldest < toBeExpired)=F -> return false [CALLS-EXTERNAL] System.nanoTime/0 */ class RateLimiter { public boolean tryAcquire() { // current time millis is not monotonic - it can jum...
true
ok
{"focal": {"class": "RateLimiter", "name": "tryAcquire", "signature": "boolean tryAcquire()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "RateLimiter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "THRESHOLD_MI...
41933697_30
class MarketConfigYamlRepository implements MarketConfigRepository { @Override public List<MarketConfig> findAll() { LOG.info(() -> "Fetching all Market configs..."); return ConfigurationManager.loadConfig(MarketsType.class, MARKETS_CONFIG_YAML_FILENAME) .getMarkets(); } @Override public Marke...
expect(ConfigurationManager.loadConfig(eq(MarketsType.class), eq(MARKETS_CONFIG_YAML_FILENAME))) .andReturn(allTheInternalMarketsConfig()); PowerMock.replayAll(); final MarketConfigRepository marketConfigRepository = new MarketConfigYamlRepository(); final List<MarketConfig> marketConfigItems ...
[FOCAL] @Override public List<MarketConfig> MarketConfigYamlRepository.findAll() [CLASS] class MarketConfigYamlRepository implements MarketConfigRepository [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] LOG.info/1, ConfigurationManager.loadConfig(MarketsType.class, MARKET....getMa...
/* static context [FOCAL] @Override public List<MarketConfig> MarketConfigYamlRepository.findAll() [CALLS-EXTERNAL] LOG.info/1, ConfigurationManager.loadConfig(MarketsType.class, MARKET....getMarkets/0, ConfigurationManager.loadConfig/2 */
/* static context [FOCAL] @Override public List<MarketConfig> MarketConfigYamlRepository.findAll() [CALLS-EXTERNAL] LOG.info/1, ConfigurationManager.loadConfig(MarketsType.class, MARKET....getMarkets/0, ConfigurationManager.loadConfig/2 */ class MarketConfigYamlRepository implements MarketConfigRepository { @Overrid...
true
ok
{"focal": {"class": "MarketConfigYamlRepository", "name": "findAll", "signature": "List<MarketConfig> findAll()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "List<MarketConfig>"}, "class_info": {"name": "MarketConfigYamlRepository", "kind": "class", "modifiers": "", "superclass": nul...
41963293_1
class App { public int calculateSomething() { return 0; } public static void main( String[] args ); } class AppTest { @Test public void testApp() {
assertEquals(0,new App().calculateSomething()); } }
[FOCAL] public int App.calculateSomething() [CLASS] class App [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] void main(String[] args) [TEST] AppTest: @Test public void testApp()
/* static context [FOCAL] public int App.calculateSomething() */
/* static context [FOCAL] public int App.calculateSomething() */ class App { public int calculateSomething() { return 0; } public static void main( String[] args ); } class AppTest { @Test public void testApp() {
true
ok
{"focal": {"class": "App", "name": "calculateSomething", "signature": "int calculateSomething()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "App", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "main"...
41971504_6
class Linky { public static String linkify(List<Link> links, String text) { //if(!hasLinks(links)) { return text; } int addedChars = 0; //offset for inserting for (Link link : links) { StringBuilder stringBuilder = new StringBuilder(text); int start = link.getStart(); int end = link...
//given no link links = new ArrayList<>(); final String expected = mockString; assertThat(linkify(links, mockString)).isEqualTo(expected); } }
[FOCAL] public static String Linky.linkify(List<Link> links, String text) [CLASS] class Linky [METRICS] loc=25 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] Link.getStart/0, Link.getEnd/0, Link.getHref/0, String.format/2, StringBuilder.insert/2, String.length/0, closeTag.length/0, StringBuilder....
/* static context [FOCAL] public static String Linky.linkify(List<Link> links, String text) [PATH1] foreach(Link link : links)=T -> exit loop -> return text [PATH2] foreach(Link link : links)=F -> return text [INPUTS] branches=links | result=text [COLLABORATORS] field closeTag length/0 [NEW] StringBuilder [CALLS-EXTERN...
/* static context [FOCAL] public static String Linky.linkify(List<Link> links, String text) [PATH1] foreach(Link link : links)=T -> exit loop -> return text [PATH2] foreach(Link link : links)=F -> return text [INPUTS] branches=links | result=text [COLLABORATORS] field closeTag length/0 [NEW] StringBuilder [CALLS-EXTERN...
true
ok
{"focal": {"class": "Linky", "name": "linkify", "signature": "String linkify(List<Link> links, String text)", "start_line": 3, "modifiers": "public static", "params": [{"name": "links", "type": "List<Link>"}, {"name": "text", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Linky", "kind": "class",...
41985062_6
class RxBroadcastReceiver { @CheckResult @NonNull // public static Observable<Intent> create(@NonNull final Context context, @NonNull final IntentFilter intentFilter) { checkNotNull(context, "context == null"); checkNotNull(intentFilter, "intentFilter == null"); return Observable.create(new Obser...
try { //noinspection ResourceType RxBroadcastReceiver.create(null, null); fail(); } catch (NullPointerException e) { assertThat(e).hasMessage("context == null"); } } }
[FOCAL] @CheckResult @NonNull // public static Observable<Intent> RxBroadcastReceiver.create(Context context, IntentFilter intentFilter) [CLASS] class RxBroadcastReceiver [METRICS] loc=23 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] checkNotNull/2 (inherited), Observable.create/1, subscriber.on...
/* static context [FOCAL] @CheckResult @NonNull // public static Observable<Intent> RxBroadcastReceiver.create(Context context, IntentFilter intentFilter) [INPUTS] branches=- | result=context, intentFilter [COLLABORATORS] field subscriber onNext/1,add/1; param context:Context registerReceiver/2,unregisterReceiver/1 [NE...
/* static context [FOCAL] @CheckResult @NonNull // public static Observable<Intent> RxBroadcastReceiver.create(Context context, IntentFilter intentFilter) [INPUTS] branches=- | result=context, intentFilter [COLLABORATORS] field subscriber onNext/1,add/1; param context:Context registerReceiver/2,unregisterReceiver/1 [NE...
true
ok
{"focal": {"class": "RxBroadcastReceiver", "name": "create", "signature": "Observable<Intent> create(Context context, IntentFilter intentFilter)", "start_line": 3, "modifiers": "@CheckResult @NonNull // public static", "params": [{"name": "context", "type": "Context"}, {"name": "intentFilter", "type": "IntentFilter"}],...
41985966_3
class JsonConfigurationLoader implements ConfigurationLoader { @Override public Configuration loadFileConfiguration(String filePath) throws IOException { File configurationFile = new File(filePath); String configurationJson = FileUtils.readFileToString(configurationFile); return loadJsonConfiguration(...
String configFilePath = "src/test/resources/stylechecker/WildCardAllow.json"; JsonConfigurationLoader loader = new JsonConfigurationLoader(); Configuration config = loader.loadFileConfiguration(configFilePath); String methodNameFormatValue = config.getAttribute(StyleName.METHOD_NAME_FORMAT); asser...
[FOCAL] @Override public Configuration JsonConfigurationLoader.loadFileConfiguration(String filePath) [CLASS] class JsonConfigurationLoader implements ConfigurationLoader [METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Configuration loadJsonConfiguration(String json) [CALLS-EXTERNA...
/* static context [FOCAL] @Override public Configuration JsonConfigurationLoader.loadFileConfiguration(String filePath) [INPUTS] branches=- | result=filePath [EXCEPTIONS] declares IOException [CALLS-INTERNAL] Configuration loadJsonConfiguration(String json) [NEW] File [CALLS-EXTERNAL] FileUtils.readFileToString/1 */
/* static context [FOCAL] @Override public Configuration JsonConfigurationLoader.loadFileConfiguration(String filePath) [INPUTS] branches=- | result=filePath [EXCEPTIONS] declares IOException [CALLS-INTERNAL] Configuration loadJsonConfiguration(String json) [NEW] File [CALLS-EXTERNAL] FileUtils.readFileToString/1 */ cl...
true
ok
{"focal": {"class": "JsonConfigurationLoader", "name": "loadFileConfiguration", "signature": "Configuration loadFileConfiguration(String filePath) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "filePath", "type": "String"}], "return_type": "Configuration"}, "class_info": {"n...
42019073_2
class Utils { public static double angleDifference(double angle1, double angle2) { return ((((angle1 - angle2) % (Math.PI * 2.0)) + (Math.PI * 3)) % (Math.PI * 2)) - Math.PI; } public static double getHeading(Quaternion quaternion); public static double pointDirection(double x1, double y1,...
assertEquals(Utils.angleDifference(Math.PI * 8.0, Math.PI), -Math.PI, 0.01); } }
[FOCAL] public static double Utils.angleDifference(double angle1, double angle2) [CLASS] class Utils [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [INPUTS] branches=- | result=angle1, angle2 [DATAFLOW] angle1@param->L3; angle2@param->L3 [CLASS-MEMBERS] double getHeading(Quaternion quaternion); do...
/* static context [FOCAL] public static double Utils.angleDifference(double angle1, double angle2) [INPUTS] branches=- | result=angle1, angle2 */
/* static context [FOCAL] public static double Utils.angleDifference(double angle1, double angle2) [INPUTS] branches=- | result=angle1, angle2 */ class Utils { public static double angleDifference(double angle1, double angle2) { return ((((angle1 - angle2) % (Math.PI * 2.0)) + (Math.PI * 3)) % (Math.PI...
true
ok
{"focal": {"class": "Utils", "name": "angleDifference", "signature": "double angleDifference(double angle1, double angle2)", "start_line": 3, "modifiers": "public static", "params": [{"name": "angle1", "type": "double"}, {"name": "angle2", "type": "double"}], "return_type": "double"}, "class_info": {"name": "Utils", "k...
42046027_47
class CCRay3 extends CCLine3Base { public double distanceSquared(final CCVector3 thePoint, final CCVector3 theStore) { final CCVector3 vectorA = new CCVector3(); vectorA.set(thePoint).subtractLocal(_myOrigin); final double t0 = _myDirection.dot(vectorA); if (t0 > 0) { // d = |P - (O + t*D)| vectorA.set(...
final CCRay3 ray1 = new CCRay3(); assertTrue(25.0 == ray1.distanceSquared(new CCVector3(0, 5, 3), null)); final CCVector3 store = new CCVector3(); assertTrue(9.0 == ray1.distanceSquared(new CCVector3(0, 3, 3), store)); assertEquals(new CCVector3(0, 0, 3), store); assertT...
[FOCAL] public double CCRay3.distanceSquared(CCVector3 thePoint, CCVector3 theStore) [CLASS] class CCRay3 extends CCLine3Base [METRICS] loc=22 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] vectorA.set(thePoint).subtractLocal/1, CCVector3.set/1, _myDirection.dot/1, vectorA.set(_myDirection).multi...
/* static context [FOCAL] public double CCRay3.distanceSquared(CCVector3 thePoint, CCVector3 theStore) [PATH1] if(t0 > 0)=T -> if(theStore != null)=T -> return lSQ [PATH2] if(t0 > 0)=F -> if(theStore != null)=F -> return lSQ [INPUTS] branches=theStore | result=- [COLLABORATORS] param theStore:CCVector3 set/1; param the...
/* static context [FOCAL] public double CCRay3.distanceSquared(CCVector3 thePoint, CCVector3 theStore) [PATH1] if(t0 > 0)=T -> if(theStore != null)=T -> return lSQ [PATH2] if(t0 > 0)=F -> if(theStore != null)=F -> return lSQ [INPUTS] branches=theStore | result=- [COLLABORATORS] param theStore:CCVector3 set/1; param the...
true
ok
{"focal": {"class": "CCRay3", "name": "distanceSquared", "signature": "double distanceSquared(CCVector3 thePoint, CCVector3 theStore)", "start_line": 3, "modifiers": "public", "params": [{"name": "thePoint", "type": "CCVector3"}, {"name": "theStore", "type": "CCVector3"}], "return_type": "double"}, "class_info": {"name...
42050188_32
class SymbolTableService extends AbstractService<SymbolTableService> { public boolean hasStartProd() { return getStartProd().isPresent(); } public SymbolTableService(ASTCDCompilationUnit compilationUnit); public SymbolTableService(CDDefinitionSymbol cdSymbol); @Override public String getSubPackage();...
CD4AnalysisParser cd4AnalysisParser = new CD4AnalysisParser(); Optional<ASTCDDefinition> astcdDefinition = cd4AnalysisParser.parse_StringCDDefinition( "<<startProd=\"_ast.ASTFoo\">> public classdiagram Bar {}"); assertTrue(astcdDefinition.isPresent()); assertFalse(cd4AnalysisParser.hasErrors());...
[FOCAL] public boolean SymbolTableService.hasStartProd() [CLASS] class SymbolTableService extends AbstractService<SymbolTableService> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Optional<String> getStartProd() [CALLS-EXTERNAL] getStartProd().isPresent/0 [CLASS-MEMBERS] SymbolTa...
class SymbolTableService extends AbstractService<SymbolTableService> { public boolean hasStartProd() { return getStartProd().isPresent(); } public SymbolTableService(ASTCDCompilationUnit compilationUnit); public SymbolTableService(CDDefinitionSymbol cdSymbol); @Override public String getSubPackage();...
false
ok
{"focal": {"class": "SymbolTableService", "name": "hasStartProd", "signature": "boolean hasStartProd()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "SymbolTableService", "kind": "class", "modifiers": "", "superclass": "AbstractService<SymbolTableService>", "i...
42050815_55
class SonarScannerExecutor extends AbstractBuildExecutor<SonarRunner> { @Override BuildResult execute(SonarRunner build, Configuration config, Map<String, String> adjustedProperties, CommandExecutor create) { return execute(build, config, adjustedProperties, new SonarScannerInstaller(config.locators()), create...
SonarRunner build = SonarRunner.create() .setProjectDir(new File(".")) .setProjectKey("SAMPLE") .setTimeoutSeconds(30) .setDebugLogs(true) .setRunnerVersion("1.3"); Map<String, String> props = new TreeMap<>(); props.put("sonar.jdbc.dialect", "h2"); props.put("sonar.projectK...
[FOCAL] @Override BuildResult SonarScannerExecutor.execute(SonarRunner build, Configuration config, Map<String, String> adjustedProperties, CommandExecutor create) [CLASS] class SonarScannerExecutor extends AbstractBuildExecutor<SonarRunner> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-IN...
/* static context [FOCAL] @Override BuildResult SonarScannerExecutor.execute(SonarRunner build, Configuration config, Map<String, String> adjustedProperties, CommandExecutor create) [INPUTS] branches=- | result=adjustedProperties, build, config, create [COLLABORATORS] param config:Configuration locators/0 [CALLS-INTERN...
/* static context [FOCAL] @Override BuildResult SonarScannerExecutor.execute(SonarRunner build, Configuration config, Map<String, String> adjustedProperties, CommandExecutor create) [INPUTS] branches=- | result=adjustedProperties, build, config, create [COLLABORATORS] param config:Configuration locators/0 [CALLS-INTERN...
true
ok
{"focal": {"class": "SonarScannerExecutor", "name": "execute", "signature": "BuildResult execute(SonarRunner build, Configuration config, Map<String, String> adjustedProperties, CommandExecutor create)", "start_line": 3, "modifiers": "@Override", "params": [{"name": "build", "type": "SonarRunner"}, {"name": "config", "...
42054620_2
class Fraction { static long gcd(long num, long den) { long left, right; if (num < den) { left = den; right = num; } else { left = num; right = den; } Function<LongBiFunction, LongBiFunction> lf = f -> (l, r) -> r == 0? l : f.a...
long gcd = gcd(784, 840); assertThat(gcd, is(56L)); } }
[FOCAL] static long Fraction.gcd(long num, long den) [CLASS] class Fraction [METRICS] loc=13 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] LongBiFunction zComb(Function<LongBiFunction, LongBiFunction> lf) [CALLS-EXTERNAL] f.apply/2, LongBiFunction.apply/2 [PATH1] if(num < den)=T -> return fun.ap...
/* static context [FOCAL] static long Fraction.gcd(long num, long den) [PATH1] if(num < den)=T -> return fun.apply(left, right) [PATH2] if(num < den)=F -> return fun.apply(left, right) [INPUTS] branches=den, num | result=den, num [COLLABORATORS] field f apply/2 [CALLS-INTERNAL] LongBiFunction zComb(Function<LongBiFunct...
/* static context [FOCAL] static long Fraction.gcd(long num, long den) [PATH1] if(num < den)=T -> return fun.apply(left, right) [PATH2] if(num < den)=F -> return fun.apply(left, right) [INPUTS] branches=den, num | result=den, num [COLLABORATORS] field f apply/2 [CALLS-INTERNAL] LongBiFunction zComb(Function<LongBiFunct...
true
ok
{"focal": {"class": "Fraction", "name": "gcd", "signature": "long gcd(long num, long den)", "start_line": 3, "modifiers": "static", "params": [{"name": "num", "type": "long"}, {"name": "den", "type": "long"}], "return_type": "long"}, "class_info": {"name": "Fraction", "kind": "class", "modifiers": "", "superclass": nul...
42057361_181
class TIntArrayList implements Externalizable, Cloneable { @Override public boolean equals(Object other) { if (other instanceof TIntArrayList) { return delegate.equals(((TIntArrayList) other).delegate); } return false; } public TIntArrayList(gnu.trove.list.array.TIntArrayList delegate); p...
assertEquals(new TIntArrayList(), new TIntArrayList()); assertNotEquals(new TIntArrayList(), new TIntArrayList().toString()); } }
[FOCAL] @Override public boolean TIntArrayList.equals(Object other) [CLASS] class TIntArrayList implements Externalizable, Cloneable [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] gnu.trove.list.array.TIntArrayList.equals/1 [FIELDS] read=delegate:gnu.trove.list.array.TIntArrayList...
/* static context [FOCAL] @Override public boolean TIntArrayList.equals(Object other) [PATH1] if(other instanceof TIntArrayList)=T -> return delegate.equals(((TIntArrayList) other).delegate) [PATH2] if(other instanceof TIntArrayList)=F -> return false [INPUTS] branches=other | result=other, delegate [COLLABORATORS] fie...
/* static context [FOCAL] @Override public boolean TIntArrayList.equals(Object other) [PATH1] if(other instanceof TIntArrayList)=T -> return delegate.equals(((TIntArrayList) other).delegate) [PATH2] if(other instanceof TIntArrayList)=F -> return false [INPUTS] branches=other | result=other, delegate [COLLABORATORS] fie...
true
ok
{"focal": {"class": "TIntArrayList", "name": "equals", "signature": "boolean equals(Object other)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "other", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "TIntArrayList", "kind": "class", "modifiers": "", "superclass": null, ...
42089429_26
class DefaultRxDockerClient implements RxDockerClient { @Override public HttpStatus checkAuth(final AuthConfig authConfig) { return checkAuthObs(authConfig).onErrorReturn(e -> { if (e instanceof ServiceException) { logger.info("checkAuth threw RestServiceCommunicationExcepti...
assumeTrue(System.getenv("CIRCLE_USERNAME") == null); HttpStatus httpStatus = client.checkAuth(AuthConfig.authConfig("xxx", "xxx", "xxxx")); assertThat(httpStatus.code(), is(equalTo(401))); assertThat(httpStatus.message(), is(equalTo("Unauthorized"))); } }
[FOCAL] @Override public HttpStatus DefaultRxDockerClient.checkAuth(AuthConfig authConfig) [CLASS] class DefaultRxDockerClient implements RxDockerClient [METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] Observable<HttpStatus> checkAuthObs(AuthConfig authConfig) [CALLS-EXTERNAL] chec...
class DefaultRxDockerClient implements RxDockerClient { @Override public HttpStatus checkAuth(final AuthConfig authConfig) { return checkAuthObs(authConfig).onErrorReturn(e -> { if (e instanceof ServiceException) { logger.info("checkAuth threw RestServiceCommunicationExcepti...
false
ok
{"focal": {"class": "DefaultRxDockerClient", "name": "checkAuth", "signature": "HttpStatus checkAuth(AuthConfig authConfig)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "authConfig", "type": "AuthConfig"}], "return_type": "HttpStatus"}, "class_info": {"name": "DefaultRxDockerClient", "kind": ...
42098141_0
class DoubleColumn implements Column<DoubleColumnId> { public static Builder builder(DoubleColumnId id) { return new Builder(id); } private DoubleColumn(DoubleColumnId id, DoubleStream values, Map<String, String> metaData); public static DoubleColumn of(DoubleColumnId id, double value); ...
DoubleColumn column = builder().add(1d).addAll(2, 9).add(0d).build(); assertMultipleValues(column); } }
[FOCAL] public static Builder DoubleColumn.builder(DoubleColumnId id) [CLASS] class DoubleColumn implements Column<DoubleColumnId> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] Builder [INPUTS] branches=- | result=id [DATAFLOW] id@param->L2 [CLASS-MEMBERS] DoubleColumn(DoubleColumnId id, Do...
/* static context [FOCAL] public static Builder DoubleColumn.builder(DoubleColumnId id) [INPUTS] branches=- | result=id [NEW] Builder */
/* static context [FOCAL] public static Builder DoubleColumn.builder(DoubleColumnId id) [INPUTS] branches=- | result=id [NEW] Builder */ class DoubleColumn implements Column<DoubleColumnId> { public static Builder builder(DoubleColumnId id) { return new Builder(id); } private DoubleColumn(DoubleC...
true
ok
{"focal": {"class": "DoubleColumn", "name": "builder", "signature": "Builder builder(DoubleColumnId id)", "start_line": 3, "modifiers": "public static", "params": [{"name": "id", "type": "DoubleColumnId"}], "return_type": "Builder"}, "class_info": {"name": "DoubleColumn", "kind": "class", "modifiers": "", "superclass":...
42109069_17
class PolicyIdpAccessEnforcer implements JsonMapper { public String authenticatingAuthority() { return federatedUser().getAuthenticatingAuthority(); } public void actionAllowed(PdpPolicy pdpPolicy, PolicyAccess policyAccess, String serviceProviderId, List<String> identityProviderIds); public b...
assertEquals(authenticatingAuthority, subject.authenticatingAuthority()); } }
[FOCAL] public String PolicyIdpAccessEnforcer.authenticatingAuthority() [CLASS] class PolicyIdpAccessEnforcer implements JsonMapper [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] FederatedUser federatedUser() [CALLS-EXTERNAL] federatedUser().getAuthenticatingAuthority/0 [CLASS-MEM...
/* static context [FOCAL] public String PolicyIdpAccessEnforcer.authenticatingAuthority() [CALLS-INTERNAL] FederatedUser federatedUser() [CALLS-EXTERNAL] federatedUser().getAuthenticatingAuthority/0 */
/* static context [FOCAL] public String PolicyIdpAccessEnforcer.authenticatingAuthority() [CALLS-INTERNAL] FederatedUser federatedUser() [CALLS-EXTERNAL] federatedUser().getAuthenticatingAuthority/0 */ class PolicyIdpAccessEnforcer implements JsonMapper { public String authenticatingAuthority() { return fe...
true
ok
{"focal": {"class": "PolicyIdpAccessEnforcer", "name": "authenticatingAuthority", "signature": "String authenticatingAuthority()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "PolicyIdpAccessEnforcer", "kind": "class", "modifiers": "", "superclass": null, "inte...
42175803_8
class AngelixSynthesis { public Optional<Map<AngelixLocation, Node>> repair(Map<AngelixLocation, Expression> original, AngelicForest angelicForest, Map<AngelixLocation, Multiset<Node>> components, ...
Multiset<Node> components = HashMultiset.create(); components.add(x); components.add(y); components.add(Library.ADD); components.add(Library.SUB); Map<AngelixLocation, Multiset<Node>> componentsMap = new HashMap<>(); componentsMap.put(loc1, components); A...
[FOCAL] public Optional<Map<AngelixLocation, Node>> AngelixSynthesis.repair(Map<AngelixLocation, Expression> original, AngelicForest angelicForest, Map<AngelixLocation, Multiset<Node>> components, SynthesisLevel level) [CLASS] class AngelixSynthesis [METRICS] loc=61 cc=9 branches=1 loops=7 returns=2 throws=0 nesting=4 ...
/* static context [FOCAL] public Optional<Map<AngelixLocation, Node>> AngelixSynthesis.repair(Map<AngelixLocation, Expression> original, AngelicForest angelicForest, Map<AngelixLocation, Multiset<Node>> components, SynthesisLevel level) [PATH1] foreach(AngelixLocation loc : locations)#1=T -> exit loop -> foreach(Map.En...
/* static context [FOCAL] public Optional<Map<AngelixLocation, Node>> AngelixSynthesis.repair(Map<AngelixLocation, Expression> original, AngelicForest angelicForest, Map<AngelixLocation, Multiset<Node>> components, SynthesisLevel level) [PATH1] foreach(AngelixLocation loc : locations)#1=T -> exit loop -> foreach(Map.En...
true
ok
{"focal": {"class": "AngelixSynthesis", "name": "repair", "signature": "Optional<Map<AngelixLocation, Node>> repair(Map<AngelixLocation, Expression> original, AngelicForest angelicForest, Map<AngelixLocation, Multiset<Node>> components, SynthesisLevel level)", "start_line": 3, "modifiers": "public", "params": [{"name":...
42182481_0
class JpaProcessor extends AbstractProcessor { @Override public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { Map<PersistentUnit, List<? extends AnnotationMirror>> units = new HashMap<PersistentUnit, List<? extends AnnotationMirror>>(); for (Element elem :...
JpaProcessor processor = new JpaProcessor(); Map<PersistentUnit, List<? extends AnnotationMirror>> units = new HashMap<>(); PersistentUnit pu = getTestPersitentUnit(); units.put(pu, Collections.emptyList()); URL url = this.getClass().getResource("/expected_persistence.xml"); ...
[FOCAL] @Override public boolean JpaProcessor.process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) [CLASS] class JpaProcessor extends AbstractProcessor [METRICS] loc=28 cc=6 branches=2 loops=1 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] PrintWriter appendResource(String resource); void process(W...
/* static context [FOCAL] @Override public boolean JpaProcessor.process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) [PATH1] foreach(Element elem : roundEnv.getElementsAnnotatedWith(PersistentUnit.class))=T -> exit loop -> if(!units.isEmpty())=T -> try-body throws -> if(useHibernate)=T -> return t...
/* static context [FOCAL] @Override public boolean JpaProcessor.process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) [PATH1] foreach(Element elem : roundEnv.getElementsAnnotatedWith(PersistentUnit.class))=T -> exit loop -> if(!units.isEmpty())=T -> try-body throws -> if(useHibernate)=T -> return t...
true
ok
{"focal": {"class": "JpaProcessor", "name": "process", "signature": "boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "annotations", "type": "Set<? extends TypeElement>"}, {"name": "roundEnv", "type": "RoundEnviron...
42186064_2
class ASMParameterAnalyzer implements ParameterAnalyzer { @Override public Parameter[] getParameters(InvokeTarget target) { return getParameters(target, null); } @Override @SuppressWarnings("unchecked") public Parameter[] getParameters(InvokeTarget target, Parameter[] parameters); private ThreadLocal<ASMParam...
ASMParameterAnalyzer analyzer = this.analyzer.get(); Class<?> controllerClass = ASMTestController.class; Object controller = controllerClass.newInstance(); InvokeTarget target = new InvokeTarget(null, controller, "method3"); Parameter[] parameters = analyzer.getParameters(target); Assert.assertEquals(3, p...
[FOCAL] @Override public Parameter[] ASMParameterAnalyzer.getParameters(InvokeTarget target) [CLASS] class ASMParameterAnalyzer implements ParameterAnalyzer [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Parameter[] getParameters(InvokeTarget target, Parameter[] parameters) [INPUT...
/* static context [FOCAL] @Override public Parameter[] ASMParameterAnalyzer.getParameters(InvokeTarget target) [INPUTS] branches=- | result=target [CALLS-INTERNAL] Parameter[] getParameters(InvokeTarget target, Parameter[] parameters) */
/* static context [FOCAL] @Override public Parameter[] ASMParameterAnalyzer.getParameters(InvokeTarget target) [INPUTS] branches=- | result=target [CALLS-INTERNAL] Parameter[] getParameters(InvokeTarget target, Parameter[] parameters) */ class ASMParameterAnalyzer implements ParameterAnalyzer { @Override public Para...
true
ok
{"focal": {"class": "ASMParameterAnalyzer", "name": "getParameters", "signature": "Parameter[] getParameters(InvokeTarget target)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "target", "type": "InvokeTarget"}], "return_type": "Parameter[]"}, "class_info": {"name": "ASMParameterAnalyzer", "kin...
42191480_0
class DividerItemDecoration extends RecyclerView.ItemDecoration { @Override public void onDrawOver(Canvas canvas, RecyclerView parent, RecyclerView.State state) { if (positionAdapter == null) { positionAdapter = new PositionAdapter(parent.getLayoutManager(), offset); } int childCount = parent.getC...
givenThatThereIsOneCellToRender(); Drawable drawableMock = mock(Drawable.class); when(drawableMock.mutate()).thenReturn(drawableMock); List<Layer> layers = getSingleDrawableLayer(drawableMock); dividerItemDecoration = new DividerItemDecoration(layers); dividerItemDecoration.onDrawOver(canvasMoc...
[FOCAL] @Override public void DividerItemDecoration.onDrawOver(Canvas canvas, RecyclerView parent, RecyclerView.State state) [CLASS] class DividerItemDecoration extends RecyclerView.ItemDecoration [METRICS] loc=14 cc=3 branches=1 loops=1 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] void drawDivider(Canvas canvas, View...
/* static context [FOCAL] @Override public void DividerItemDecoration.onDrawOver(Canvas canvas, RecyclerView parent, RecyclerView.State state) [PATH1] if(positionAdapter == null)=T -> for(i < childCount)=T -> exit loop [PATH2] if(positionAdapter == null)=F -> for(i < childCount)=F [INPUTS] branches=parent | result=- | ...
/* static context [FOCAL] @Override public void DividerItemDecoration.onDrawOver(Canvas canvas, RecyclerView parent, RecyclerView.State state) [PATH1] if(positionAdapter == null)=T -> for(i < childCount)=T -> exit loop [PATH2] if(positionAdapter == null)=F -> for(i < childCount)=F [INPUTS] branches=parent | result=- | ...
true
ok
{"focal": {"class": "DividerItemDecoration", "name": "onDrawOver", "signature": "void onDrawOver(Canvas canvas, RecyclerView parent, RecyclerView.State state)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "canvas", "type": "Canvas"}, {"name": "parent", "type": "RecyclerView"}, {"name": "state"...
42201162_17
class PrivateAccess { public static <T> T callDefaultConstructor(Class<T> klass) throws Throwable{ //TODO: not only should be atMostOnce in a test, but in the whole suite/archive if(klass == null){ throw new IllegalArgumentException("No specified class"); } //RuntimeS...
FooConstructor.counter = 0; PrivateAccess.callDefaultConstructor(FooConstructor.class); assertTrue(FooConstructor.counter > 0); } }
[FOCAL] public static T PrivateAccess.callDefaultConstructor(Class<T> klass) [CLASS] class PrivateAccess [METRICS] loc=34 cc=6 branches=2 loops=0 returns=1 throws=5 nesting=2 [CALLS-EXTERNAL] Class<T>.getDeclaredConstructor/0, Constructor<T>.setAccessible/1, Constructor<T>.newInstance/0, Class<T>.getName/0, InvocationT...
class PrivateAccess { public static <T> T callDefaultConstructor(Class<T> klass) throws Throwable{ //TODO: not only should be atMostOnce in a test, but in the whole suite/archive if(klass == null){ throw new IllegalArgumentException("No specified class"); } //RuntimeS...
false
ok
{"focal": {"class": "PrivateAccess", "name": "callDefaultConstructor", "signature": "T callDefaultConstructor(Class<T> klass) throws Throwable", "start_line": 3, "modifiers": "public static", "params": [{"name": "klass", "type": "Class<T>"}], "return_type": "T"}, "class_info": {"name": "PrivateAccess", "kind": "class",...
42250911_1
class Utils { @SafeVarargs public static <T> Optional<T> firstPresent(Supplier<Optional<T>>... optionals) { return Arrays.stream(optionals) .map(Supplier::get) .flatMap(Utils::stream) .findFirst(); } public static Stream<T> stream(Optional<T> optional); public static String toBase64(String content)...
@SuppressWarnings("unchecked") Supplier<Optional<String>> notCalled = mock(Supplier.class); when(notCalled.get()).thenReturn(Optional.empty()); Utils.firstPresent(() -> Optional.of("present"), notCalled); verifyZeroInteractions(notCalled); } }
[FOCAL] @SafeVarargs public static Optional<T> Utils.firstPresent(Supplier<Optional<T>>... optionals) [CLASS] class Utils [METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Arrays.stream(optionals) .map(Supplier::get) .flatMap(Uti....findFirst/0, Arrays.stream(optionals) .map(Supplier...
/* static context [FOCAL] @SafeVarargs public static Optional<T> Utils.firstPresent(Supplier<Optional<T>>... optionals) [INPUTS] branches=- | result=optionals [CALLS-EXTERNAL] Arrays.stream(optionals) .map(Supplier::get) .flatMap(Uti....findFirst/0, Arrays.stream(optionals) .map(Supplier::get).flatMap/1, Arrays.stream(...
/* static context [FOCAL] @SafeVarargs public static Optional<T> Utils.firstPresent(Supplier<Optional<T>>... optionals) [INPUTS] branches=- | result=optionals [CALLS-EXTERNAL] Arrays.stream(optionals) .map(Supplier::get) .flatMap(Uti....findFirst/0, Arrays.stream(optionals) .map(Supplier::get).flatMap/1, Arrays.stream(...
true
ok
{"focal": {"class": "Utils", "name": "firstPresent", "signature": "Optional<T> firstPresent(Supplier<Optional<T>>... optionals)", "start_line": 3, "modifiers": "@SafeVarargs public static", "params": [{"name": "optionals", "type": "Supplier<Optional<T>>..."}], "return_type": "Optional<T>"}, "class_info": {"name": "Util...
42256650_0
class VersionUtil { public static int compareVersions(String v1, String v2) { if (v1 == null && v2 == null) { return 0; } else if (v1 == null) { return -1; } else if (v2 == null) { return 1; } String[] v1Parts = v1.split("[.]"); String[] v2Parts = v2.split("[.]"); int maxLength = Math.max(v1...
assertEquals(VersionUtil.compareVersions("1.0", "1.0.0"), 0); assertEquals(VersionUtil.compareVersions("1.0", "1.0.1"), -1); assertEquals(VersionUtil.compareVersions("1.0", "0.0.0"), 1); assertEquals(VersionUtil.compareVersions("0.0.0.1", "1.0.0"), -1); assertEquals(VersionUtil.compareVersions(...
[FOCAL] public static int VersionUtil.compareVersions(String v1, String v2) [CLASS] class VersionUtil [METRICS] loc=44 cc=11 branches=7 loops=1 returns=6 throws=0 nesting=3 [CALLS-EXTERNAL] String.split/1, Math.max/2, Integer.parseInt/1 [EXCEPTIONS] catches NumberFormatException e [PATH1] if(v1 == null && v2 == null)=F...
/* static context [FOCAL] public static int VersionUtil.compareVersions(String v1, String v2) [PATH1] if(v1 == null && v2 == null)=F -> if(v1 == null)=F -> if(v2 == null)=F -> for(i < maxLength)=T -> if(i < v1Parts.length)=T -> try-body throws -> if(i < v2Parts.length)=T -> if(v1Int == v2Int)=T -> exit loop -> return 0...
/* static context [FOCAL] public static int VersionUtil.compareVersions(String v1, String v2) [PATH1] if(v1 == null && v2 == null)=F -> if(v1 == null)=F -> if(v2 == null)=F -> for(i < maxLength)=T -> if(i < v1Parts.length)=T -> try-body throws -> if(i < v2Parts.length)=T -> if(v1Int == v2Int)=T -> exit loop -> return 0...
true
ok
{"focal": {"class": "VersionUtil", "name": "compareVersions", "signature": "int compareVersions(String v1, String v2)", "start_line": 3, "modifiers": "public static", "params": [{"name": "v1", "type": "String"}, {"name": "v2", "type": "String"}], "return_type": "int"}, "class_info": {"name": "VersionUtil", "kind": "cla...
42271567_0
class MainActivity extends AppCompatActivity { public Toolbar getToolbar() { return toolbar; } @Override protected void onCreate(Bundle savedInstanceState); @Override public void onBackPressed(); @Override protected void onPause(); @Override protected void onResume(); private void ...
Toolbar expected = toolbar; Toolbar actual = activity.getToolbar(); assertEquals("Toolbar is different!", expected.hashCode(), actual.hashCode()); } }
[FOCAL] public Toolbar MainActivity.getToolbar() [CLASS] class MainActivity extends AppCompatActivity [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [FIELDS] read=toolbar:Toolbar [INPUTS] branches=- | result=toolbar [DATAFLOW] this.toolbar@param->L2 [CLASS-MEMBERS] void onCreate(Bundle savedInstan...
/* static context [FOCAL] public Toolbar MainActivity.getToolbar() [INPUTS] branches=- | result=toolbar [FIELDS] read=toolbar:Toolbar */
/* static context [FOCAL] public Toolbar MainActivity.getToolbar() [INPUTS] branches=- | result=toolbar [FIELDS] read=toolbar:Toolbar */ class MainActivity extends AppCompatActivity { public Toolbar getToolbar() { return toolbar; } @Override protected void onCreate(Bundle savedInstanceState); ...
true
ok
{"focal": {"class": "MainActivity", "name": "getToolbar", "signature": "Toolbar getToolbar()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Toolbar"}, "class_info": {"name": "MainActivity", "kind": "class", "modifiers": "", "superclass": "AppCompatActivity", "interfaces": null, "fields": [{"nam...
42273328_17
class HMAC { public static byte[] sign(String toSign, String secret) throws NoSuchAlgorithmException, InvalidKeySpecException, InvalidKeyException, UnsupportedEncodingException { validateParameters(toSign, secret); String password = secret; PBEKeySpec keySpec = new PBEKeySpec(password.toCharArray()); SecretKe...
try { byte[] Signature = HMAC.sign("Some_String", "Password"); assertNotNull(Signature); assertTrue(!Signature.toString().equals("SOME_STRING")); } catch (Exception e) { assertTrue(e instanceof Exception); } } }
[FOCAL] public static byte[] HMAC.sign(String toSign, String secret) [CLASS] class HMAC [METRICS] loc=15 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] void validateParameters(String toSign, String secret) [CALLS-EXTERNAL] String.toCharArray/0, SecretKeyFactory.getInstance/1, SecretKeyFactory.gen...
/* static context [FOCAL] public static byte[] HMAC.sign(String toSign, String secret) [INPUTS] branches=- | result=toSign [EXCEPTIONS] declares NoSuchAlgorithmException, InvalidKeySpecException, InvalidKeyException, UnsupportedEncodingException [CALLS-INTERNAL] void validateParameters(String toSign, String secret) [NE...
/* static context [FOCAL] public static byte[] HMAC.sign(String toSign, String secret) [INPUTS] branches=- | result=toSign [EXCEPTIONS] declares NoSuchAlgorithmException, InvalidKeySpecException, InvalidKeyException, UnsupportedEncodingException [CALLS-INTERNAL] void validateParameters(String toSign, String secret) [NE...
true
ok
{"focal": {"class": "HMAC", "name": "sign", "signature": "byte[] sign(String toSign, String secret) throws NoSuchAlgorithmException, InvalidKeySpecException, InvalidKeyException, UnsupportedEncodingException", "start_line": 3, "modifiers": "public static", "params": [{"name": "toSign", "type": "String"}, {"name": "secr...
42290369_549
class HdfsUtils { public static List<String> listDirs(Configuration hadoopConf, String pathname) throws IOException { return Arrays .stream(FileSystem.get(hadoopConf).listStatus(new Path(pathname))) .filter(FileStatus::isDirectory) .map(x -> x.getPath().toStr...
Path tempDir = Files.createTempDirectory(this.getClass().getSimpleName()); Path subDir1 = Files.createTempDirectory(tempDir, "list_me"); Path subDir2 = Files.createTempDirectory(tempDir, "list_me"); // when List<String> paths = HdfsUtils.listDirs(new Configuration(), tempDir.toS...
[FOCAL] public static List<String> HdfsUtils.listDirs(Configuration hadoopConf, String pathname) [CLASS] class HdfsUtils [METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Arrays .stream(FileSystem.get(hadoopConf).listStatus(new ....collect/1, Arrays .stream(FileSystem.get(hadoopConf)...
/* static context [FOCAL] public static List<String> HdfsUtils.listDirs(Configuration hadoopConf, String pathname) [INPUTS] branches=- | result=hadoopConf, pathname [COLLABORATORS] field x getPath/0 [EXCEPTIONS] declares IOException [NEW] Path [CALLS-EXTERNAL] Arrays .stream(FileSystem.get(hadoopConf).listStatus(new .....
/* static context [FOCAL] public static List<String> HdfsUtils.listDirs(Configuration hadoopConf, String pathname) [INPUTS] branches=- | result=hadoopConf, pathname [COLLABORATORS] field x getPath/0 [EXCEPTIONS] declares IOException [NEW] Path [CALLS-EXTERNAL] Arrays .stream(FileSystem.get(hadoopConf).listStatus(new .....
true
ok
{"focal": {"class": "HdfsUtils", "name": "listDirs", "signature": "List<String> listDirs(Configuration hadoopConf, String pathname) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "hadoopConf", "type": "Configuration"}, {"name": "pathname", "type": "String"}], "return_type": "Lis...
42304749_177
class JobNodeStorage { public void removeJobNodeIfExisted(final String node) { if (isJobNodeExisted(node)) { regCenter.remove(jobNodePath.getFullPath(node)); } } public JobNodeStorage(final CoordinatorRegistryCenter regCenter, final String jobName); public boolean isJobNo...
when(regCenter.isExisted("/test_job/config")).thenReturn(false); jobNodeStorage.removeJobNodeIfExisted("config"); verify(regCenter).isExisted("/test_job/config"); verify(regCenter, times(0)).remove("/test_job/config"); } }
[FOCAL] public void JobNodeStorage.removeJobNodeIfExisted(String node) [CLASS] class JobNodeStorage [METRICS] loc=5 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] boolean isJobNodeExisted(String node) [CALLS-EXTERNAL] CoordinatorRegistryCenter.remove/1, jobNodePath.getFullPath/1 [FIELDS] read=reg...
/* static context [FOCAL] public void JobNodeStorage.removeJobNodeIfExisted(String node) [PATH1] if(isJobNodeExisted(node))=T [PATH2] if(isJobNodeExisted(node))=F [INPUTS] branches=node | result=- [COLLABORATORS] field regCenter:CoordinatorRegistryCenter remove/1; field jobNodePath getFullPath/1 [CALLS-INTERNAL] boolea...
/* static context [FOCAL] public void JobNodeStorage.removeJobNodeIfExisted(String node) [PATH1] if(isJobNodeExisted(node))=T [PATH2] if(isJobNodeExisted(node))=F [INPUTS] branches=node | result=- [COLLABORATORS] field regCenter:CoordinatorRegistryCenter remove/1; field jobNodePath getFullPath/1 [CALLS-INTERNAL] boolea...
true
ok
{"focal": {"class": "JobNodeStorage", "name": "removeJobNodeIfExisted", "signature": "void removeJobNodeIfExisted(String node)", "start_line": 3, "modifiers": "public", "params": [{"name": "node", "type": "String"}], "return_type": "void"}, "class_info": {"name": "JobNodeStorage", "kind": "class", "modifiers": "", "sup...
42324543_6
class Topics { public static Topic getTopic(String name) { return new TopicImpl(new String[] {name}); } public static Topic getSubtopic(Topic topic, String field); public static Topic getTopic(String... fields); public static Topic parse(String s); public static String toString(Topic topic); } class...
Topic joe = Topics.getTopic("Joe"); Topic joebob = Topics.getTopic("Joe", "Bob"); Topic bobjoe = Topics.getTopic("Bob", "Joe"); assertTrue(!joebob.equals(bobjoe)); assertTrue(joebob.compareTo(bobjoe) > 0); assertTrue(bobjoe.compareTo(joebob) < 0); assertTrue(!joe.equals(joebob)); asser...
[FOCAL] public static Topic Topics.getTopic(String name) [CLASS] class Topics [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] TopicImpl [INPUTS] branches=- | result=name [DATAFLOW] name@param->L2 [CLASS-MEMBERS] Topic getSubtopic(Topic topic, String field); Topic getTopic(String... fields); T...
/* static context [FOCAL] public static Topic Topics.getTopic(String name) [INPUTS] branches=- | result=name [NEW] TopicImpl */
/* static context [FOCAL] public static Topic Topics.getTopic(String name) [INPUTS] branches=- | result=name [NEW] TopicImpl */ class Topics { public static Topic getTopic(String name) { return new TopicImpl(new String[] {name}); } public static Topic getSubtopic(Topic topic, String field); public static ...
true
ok
{"focal": {"class": "Topics", "name": "getTopic", "signature": "Topic getTopic(String name)", "start_line": 3, "modifiers": "public static", "params": [{"name": "name", "type": "String"}], "return_type": "Topic"}, "class_info": {"name": "Topics", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null,...
42427904_0
class BaseFilter extends Base { public BaseFilter(Map config) { super(config); this.config = config; this.nextFilter = null; this.outputs = new ArrayList<BaseOutput>(); final List<String> ifConditions = (List<String>) this.config.get("if"); if (ifConditions != null...
HashMap config = new HashMap(); config.put("remove_fields", new ArrayList(Arrays.asList("test1", "[a][b]"))); config.put("add_fields", new HashMap() {{ this.put("ok", true); this.put("[extra][value]", 11.11); this.put("[extra][metric][value]", 10); }})...
[FOCAL] public BaseFilter.BaseFilter(Map config) [CLASS] class BaseFilter extends Base [METRICS] loc=51 cc=9 branches=3 loops=3 returns=0 throws=0 nesting=3 [CALLS-INTERNAL] void prepare() [CALLS-EXTERNAL] this.config.get/1, List<String>.size/0, IF.add/1, log.fatal/2, IOException.getMessage/0, System.exit/1, Map.get/1,...
/* static context [FOCAL] public BaseFilter.BaseFilter(Map config) [PATH1] if(ifConditions != null)=T -> foreach(String c : ifConditions)=T -> try-body throws -> exit loop -> if(remove_fields != null)=T -> foreach(String field : remove_fields)=F -> if(add_fields != null)=T -> while(it.hasNext())=F [PATH2] if(ifConditio...
/* static context [FOCAL] public BaseFilter.BaseFilter(Map config) [PATH1] if(ifConditions != null)=T -> foreach(String c : ifConditions)=T -> try-body throws -> exit loop -> if(remove_fields != null)=T -> foreach(String field : remove_fields)=F -> if(add_fields != null)=T -> while(it.hasNext())=F [PATH2] if(ifConditio...
true
ok
{"focal": {"class": "BaseFilter", "name": "BaseFilter", "signature": "BaseFilter(Map config)", "start_line": 3, "modifiers": "public", "params": [{"name": "config", "type": "Map"}], "return_type": null}, "class_info": {"name": "BaseFilter", "kind": "class", "modifiers": "", "superclass": "Base", "interfaces": null, "fi...
42446819_0
class KVOperationSerializer extends TypeSerializer<KVOperation<K, V>> { @SuppressWarnings("unchecked") @Override public KVOperation<K, V> copy(KVOperation<K, V> from, KVOperation<K, V> to) { KVOperationType type = from.type; to.type = from.type; to.queryID = from.queryID; to.isPartOfTransaction = from.isPa...
Random rnd = new Random(); KVOperation<Integer, Integer>[] ops = gen.generate(1000); KVOperationSerializer<Integer, Integer> serializer = gen.getSerializer(); for (KVOperation<Integer, Integer> op : ops) { assertEquals(op, serializer.copy(op)); } for (KVOperation<Integer, Integer> op : ops) { asse...
[FOCAL] @SuppressWarnings("unchecked") @Override public KVOperation<K, V> KVOperationSerializer.copy(KVOperation<K, V> from, KVOperation<K, V> to) [CLASS] class KVOperationSerializer extends TypeSerializer<KVOperation<K, V>> [METRICS] loc=73 cc=26 branches=4 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] X copyW...
/* static context [FOCAL] @SuppressWarnings("unchecked") @Override public KVOperation<K, V> KVOperationSerializer.copy(KVOperation<K, V> from, KVOperation<K, V> to) [PATH1] if(to.isPartOfTransaction)=T -> switch(type)#1=case LOCK -> switch(type)#2=case SUPDATE -> switch(type)#3=case SKVRES -> return to [PATH2] if(to.is...
/* static context [FOCAL] @SuppressWarnings("unchecked") @Override public KVOperation<K, V> KVOperationSerializer.copy(KVOperation<K, V> from, KVOperation<K, V> to) [PATH1] if(to.isPartOfTransaction)=T -> switch(type)#1=case LOCK -> switch(type)#2=case SUPDATE -> switch(type)#3=case SKVRES -> return to [PATH2] if(to.is...
true
ok
{"focal": {"class": "KVOperationSerializer", "name": "copy", "signature": "KVOperation<K, V> copy(KVOperation<K, V> from, KVOperation<K, V> to)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") @Override public", "params": [{"name": "from", "type": "KVOperation<K, V>"}, {"name": "to", "type": "KVOperati...
42452274_0
class EmailValidator { public static boolean isValidEmail(String email){ if (null==email || "".equals(email)) return false; //Pattern p = Pattern.compile("\\w+@(\\w+.)+[a-z]{2,3}"); //简单匹配 Pattern p = Pattern.compile("\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*");//复杂匹配 Matc...
assertThat(EmailValidator.isValidEmail("name@email.com"), is(true)); } }
[FOCAL] public static boolean EmailValidator.isValidEmail(String email) [CLASS] class EmailValidator [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] "".equals/1, Pattern.compile/1, Pattern.matcher/1, Matcher.matches/0 [PATH1] if(null==email || "".equals(email))=T -> return false [P...
/* static context [FOCAL] public static boolean EmailValidator.isValidEmail(String email) [PATH1] if(null==email || "".equals(email))=T -> return false [PATH2] if(null==email || "".equals(email))=F -> return m.matches() [INPUTS] branches=email | result=email [CALLS-EXTERNAL] "".equals/1, Pattern.compile/1, Pattern.matc...
/* static context [FOCAL] public static boolean EmailValidator.isValidEmail(String email) [PATH1] if(null==email || "".equals(email))=T -> return false [PATH2] if(null==email || "".equals(email))=F -> return m.matches() [INPUTS] branches=email | result=email [CALLS-EXTERNAL] "".equals/1, Pattern.compile/1, Pattern.matc...
true
ok
{"focal": {"class": "EmailValidator", "name": "isValidEmail", "signature": "boolean isValidEmail(String email)", "start_line": 3, "modifiers": "public static", "params": [{"name": "email", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "EmailValidator", "kind": "class", "modifiers": "", "supercla...
42510870_0
class S3FactoryCreator extends AbstractServiceConnectorCreator<SpringCloudBlobStoreContext, S3ServiceInfo> { public SpringCloudBlobStoreContext create(S3ServiceInfo serviceInfo, ServiceConnectorConfig serviceConnectorConfig) { Properties storeProviderInitProperties = new Properties(); storeProvider...
S3ServiceInfo serviceInfo = createServiceInfo(); SpringCloudBlobStoreContext contextBuilder = testCreator.create(serviceInfo, null); assertConnectorProperties(serviceInfo, contextBuilder); } }
[FOCAL] public SpringCloudBlobStoreContext S3FactoryCreator.create(S3ServiceInfo serviceInfo, ServiceConnectorConfig serviceConnectorConfig) [CLASS] class S3FactoryCreator extends AbstractServiceConnectorCreator<SpringCloudBlobStoreContext, S3ServiceInfo> [METRICS] loc=12 cc=1 branches=0 loops=0 returns=1 throws=0 nest...
/* static context [FOCAL] public SpringCloudBlobStoreContext S3FactoryCreator.create(S3ServiceInfo serviceInfo, ServiceConnectorConfig serviceConnectorConfig) [INPUTS] branches=- | result=serviceInfo | unused=serviceConnectorConfig [COLLABORATORS] param serviceInfo:S3ServiceInfo isVirtualHostBuckets/0,getS3Host/0,getAc...
/* static context [FOCAL] public SpringCloudBlobStoreContext S3FactoryCreator.create(S3ServiceInfo serviceInfo, ServiceConnectorConfig serviceConnectorConfig) [INPUTS] branches=- | result=serviceInfo | unused=serviceConnectorConfig [COLLABORATORS] param serviceInfo:S3ServiceInfo isVirtualHostBuckets/0,getS3Host/0,getAc...
true
ok
{"focal": {"class": "S3FactoryCreator", "name": "create", "signature": "SpringCloudBlobStoreContext create(S3ServiceInfo serviceInfo, ServiceConnectorConfig serviceConnectorConfig)", "start_line": 3, "modifiers": "public", "params": [{"name": "serviceInfo", "type": "S3ServiceInfo"}, {"name": "serviceConnectorConfig", "...
42525744_6
class Socks5Server { public boolean readRequest() throws IOException { checkProtocolVersion(); boolean correct = true; command = Command.fromCommandNumber(in.read()); if (command == null) { correct = false; } if (in.read() != 0x00) { correc...
Socks5Server server = getAuthenticatedSocks5Server((byte) 0x05, (byte) 0x01, (byte) 0x00, (byte) 0x05, (byte) 0x01, (byte) 0x00, (byte) 0xA8, (byte) 0xC0, (byte) 0xA8, (byte) 0x01, (byte) 0x01); assertFalse(server.readRequest()); } }
[FOCAL] public boolean Socks5Server.readRequest() [CLASS] class Socks5Server [METRICS] loc=29 cc=6 branches=5 loops=0 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] void checkProtocolVersion(); void readDns(); void readInetAddress(int addressBytesLen) [CALLS-EXTERNAL] Command.fromCommandNumber/1, in.read/0 [EXCEPTIONS] ...
/* static context [FOCAL] public boolean Socks5Server.readRequest() [PATH1] if(command == null)=T -> if(in.read() != 0x00)=T -> if(atype == ATYPE_IPV4)=F -> if(atype == ATYPE_DNS)=F -> if(atype == ATYPE_IPV6)=T -> return correct [PATH2] if(command == null)=F -> if(in.read() != 0x00)=F -> if(atype == ATYPE_IPV4)=T -> re...
/* static context [FOCAL] public boolean Socks5Server.readRequest() [PATH1] if(command == null)=T -> if(in.read() != 0x00)=T -> if(atype == ATYPE_IPV4)=F -> if(atype == ATYPE_DNS)=F -> if(atype == ATYPE_IPV6)=T -> return correct [PATH2] if(command == null)=F -> if(in.read() != 0x00)=F -> if(atype == ATYPE_IPV4)=T -> re...
true
ok
{"focal": {"class": "Socks5Server", "name": "readRequest", "signature": "boolean readRequest() throws IOException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "Socks5Server", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": ...
42537834_1
class MyReducer implements redux.api.Reducer<Integer> { @Override public Integer reduce(Integer state, Object action) { return action instanceof Action ? reduce(state, (Action) action) : state; } private Integer reduce(Integer state, Action action); private MyReducer reducer; } class My...
assertThat(reducer.reduce(0, Action.INCREMENT), is(1)); } }
[FOCAL] @Override public Integer MyReducer.reduce(Integer state, Object action) [CLASS] class MyReducer implements redux.api.Reducer<Integer> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Integer reduce(Integer state, Action action) [INPUTS] branches=- | result=action, state [DAT...
/* static context [FOCAL] @Override public Integer MyReducer.reduce(Integer state, Object action) [INPUTS] branches=- | result=action, state [CALLS-INTERNAL] Integer reduce(Integer state, Action action) */
/* static context [FOCAL] @Override public Integer MyReducer.reduce(Integer state, Object action) [INPUTS] branches=- | result=action, state [CALLS-INTERNAL] Integer reduce(Integer state, Action action) */ class MyReducer implements redux.api.Reducer<Integer> { @Override public Integer reduce(Integer state, Ob...
true
ok
{"focal": {"class": "MyReducer", "name": "reduce", "signature": "Integer reduce(Integer state, Object action)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "state", "type": "Integer"}, {"name": "action", "type": "Object"}], "return_type": "Integer"}, "class_info": {"name": "MyReducer", "kind":...
42591563_14
class Patterns { public static List<Pattern> toStartsWithPatternList(List<String> list) { return toStartsWithPatternList(list.stream()); } public static List<Pattern> toStartsWithPatternList(String content); public static List<Pattern> toStartsWithPatternList(Stream<String> stream); } cl...
String[] array = {"cBioPortal", "GenomeNexus", "Make cBioPortal great again", "Also don't forget Genome Nexus"}; List<Pattern> patterns = Patterns.toStartsWithPatternList(Arrays.asList(array)); assertTrue(patterns.get(0).matcher("cBioPortal is amazing").matches()); assertFalse(patterns...
[FOCAL] public static List<Pattern> Patterns.toStartsWithPatternList(List<String> list) [CLASS] class Patterns [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] List<Pattern> toStartsWithPatternList(String content) [CALLS-EXTERNAL] List<String>.stream/0 [INPUTS] branches=- | result=l...
/* static context [FOCAL] public static List<Pattern> Patterns.toStartsWithPatternList(List<String> list) [INPUTS] branches=- | result=list [COLLABORATORS] param list:List<String> stream/0 [CALLS-INTERNAL] List<Pattern> toStartsWithPatternList(String content) [CALLS-EXTERNAL] List<String>.stream/0 */
/* static context [FOCAL] public static List<Pattern> Patterns.toStartsWithPatternList(List<String> list) [INPUTS] branches=- | result=list [COLLABORATORS] param list:List<String> stream/0 [CALLS-INTERNAL] List<Pattern> toStartsWithPatternList(String content) [CALLS-EXTERNAL] List<String>.stream/0 */ class Patterns { ...
true
ok
{"focal": {"class": "Patterns", "name": "toStartsWithPatternList", "signature": "List<Pattern> toStartsWithPatternList(List<String> list)", "start_line": 3, "modifiers": "public static", "params": [{"name": "list", "type": "List<String>"}], "return_type": "List<Pattern>"}, "class_info": {"name": "Patterns", "kind": "cl...
42615957_109
class MPUtility { public static boolean isAppDebuggable(Context context){ return ( 0 != ( context.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE ) ); } public static long getAvailableMemory(Context context); public static boolean isSystemMemoryLow(Context context); public sta...
Context context = Mockito.mock(Context.class); ApplicationInfo applicationInfo = Mockito.mock(ApplicationInfo.class); applicationInfo.flags = ApplicationInfo.FLAG_DEBUGGABLE; Mockito.when(context.getApplicationInfo()).thenReturn(applicationInfo); assertTrue(MPUtility.isAppDebugga...
[FOCAL] public static boolean MPUtility.isAppDebuggable(Context context) [CLASS] class MPUtility [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Context.getApplicationInfo/0 [INPUTS] branches=- | result=context [COLLABORATORS] param context:Context getApplicationInfo/0 [DATAFLOW] c...
/* static context [FOCAL] public static boolean MPUtility.isAppDebuggable(Context context) [INPUTS] branches=- | result=context [COLLABORATORS] param context:Context getApplicationInfo/0 [CALLS-EXTERNAL] Context.getApplicationInfo/0 */
/* static context [FOCAL] public static boolean MPUtility.isAppDebuggable(Context context) [INPUTS] branches=- | result=context [COLLABORATORS] param context:Context getApplicationInfo/0 [CALLS-EXTERNAL] Context.getApplicationInfo/0 */ class MPUtility { public static boolean isAppDebuggable(Context context){ ...
true
ok
{"focal": {"class": "MPUtility", "name": "isAppDebuggable", "signature": "boolean isAppDebuggable(Context context)", "start_line": 3, "modifiers": "public static", "params": [{"name": "context", "type": "Context"}], "return_type": "boolean"}, "class_info": {"name": "MPUtility", "kind": "class", "modifiers": "", "superc...
42624467_4
class LongTinyType { @Override public String toString() { return String.format("%s#%s", this.getClass().getSimpleName(), value); } public LongTinyType(long value); @Override public int hashCode(); @Override public boolean equals(Object obj); } class LongTinyTypeTest { @Test ...
final String expected = "Long"; final String toString = Samples.Long.of(1).toString(); Assert.assertTrue(toString.contains(expected)); } }
[FOCAL] @Override public String LongTinyType.toString() [CLASS] class LongTinyType [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] String.format/3, this.getClass().getSimpleName/0, this.getClass/0 [CLASS-MEMBERS] LongTinyType(long value); int hashCode(); boolean equals(Object obj) ...
/* static context [FOCAL] @Override public String LongTinyType.toString() [CALLS-EXTERNAL] String.format/3, this.getClass().getSimpleName/0, this.getClass/0 */
/* static context [FOCAL] @Override public String LongTinyType.toString() [CALLS-EXTERNAL] String.format/3, this.getClass().getSimpleName/0, this.getClass/0 */ class LongTinyType { @Override public String toString() { return String.format("%s#%s", this.getClass().getSimpleName(), value); } pub...
true
ok
{"focal": {"class": "LongTinyType", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "LongTinyType", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{...
42658356_25
class HibernateRequest { @SuppressWarnings("unchecked") public List<T> list() { return HibernateSessionFactory.doInTransaction(new IRequest<List<T>>() { @Override public List<T> doInTransaction(Session session) { return tuneCriteriaForList(createCriteria(session)...
H.saveOrUpdateAll(rootsAB()); List<Root> roots = createRootRequest().list(); assertThat(roots).isNotNull().hasSize(2); } }
[FOCAL] @SuppressWarnings("unchecked") public List<T> HibernateRequest.list() [CLASS] class HibernateRequest [METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Criteria createCriteria(Session session); Criteria tuneCriteriaForList(Criteria criteria) [CALLS-EXTERNAL] HibernateSessionFa...
/* static context [FOCAL] @SuppressWarnings("unchecked") public List<T> HibernateRequest.list() [CALLS-INTERNAL] Criteria createCriteria(Session session); Criteria tuneCriteriaForList(Criteria criteria) [NEW] IRequest<List<T>> [CALLS-EXTERNAL] HibernateSessionFactory.doInTransaction/1, tuneCriteriaForList(createCriteri...
/* static context [FOCAL] @SuppressWarnings("unchecked") public List<T> HibernateRequest.list() [CALLS-INTERNAL] Criteria createCriteria(Session session); Criteria tuneCriteriaForList(Criteria criteria) [NEW] IRequest<List<T>> [CALLS-EXTERNAL] HibernateSessionFactory.doInTransaction/1, tuneCriteriaForList(createCriteri...
true
ok
{"focal": {"class": "HibernateRequest", "name": "list", "signature": "List<T> list()", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public", "params": [], "return_type": "List<T>"}, "class_info": {"name": "HibernateRequest", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "f...
42678647_4
class JiraService { public List<String> extractIssuesFromMessage(String message) { List<String> issues = Lists.newArrayList(); Matcher matcher = ISSUE_PATTERN.matcher(message); while (matcher.find()) { issues.add(matcher.group(1)); } return issues; } ...
String message = "test(#TEST-1): issue related to #TEST-15289"; final List<String> issues = jiraService.extractIssuesFromMessage(message); assertThat(issues) .hasSize(2) .containsExactly("TEST-1", "TEST-15289"); } }
[FOCAL] public List<String> JiraService.extractIssuesFromMessage(String message) [CLASS] class JiraService [METRICS] loc=11 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] Lists.newArrayList/0, ISSUE_PATTERN.matcher/1, Matcher.find/0, List<String>.add/1, Matcher.group/1 [PATH1] while(matcher.find(...
/* static context [FOCAL] public List<String> JiraService.extractIssuesFromMessage(String message) [PATH1] while(matcher.find())=T -> exit loop -> return issues [PATH2] while(matcher.find())=F -> return issues [INPUTS] branches=message | result=- [CALLS-EXTERNAL] Lists.newArrayList/0, ISSUE_PATTERN.matcher/1, Matcher.f...
/* static context [FOCAL] public List<String> JiraService.extractIssuesFromMessage(String message) [PATH1] while(matcher.find())=T -> exit loop -> return issues [PATH2] while(matcher.find())=F -> return issues [INPUTS] branches=message | result=- [CALLS-EXTERNAL] Lists.newArrayList/0, ISSUE_PATTERN.matcher/1, Matcher.f...
true
ok
{"focal": {"class": "JiraService", "name": "extractIssuesFromMessage", "signature": "List<String> extractIssuesFromMessage(String message)", "start_line": 3, "modifiers": "public", "params": [{"name": "message", "type": "String"}], "return_type": "List<String>"}, "class_info": {"name": "JiraService", "kind": "class", "...
42691991_170
class NCMBPushService extends NCMBService { public void sendPushReceiptStatusInBackground(String pushId, ExecuteServiceCallback callback) { try { //null check if (pushId == null) { throw new NCMBException(NCMBException.INVALID_JSON, "pushId is must not be null."); ...
Assert.assertFalse(callbackFlag); NCMBPushService pushService = (NCMBPushService) NCMB.factory(NCMB.ServiceType.PUSH); pushService.sendPushReceiptStatusInBackground("7FrmPTBKSNtVjajm", new ExecuteServiceCallback() { @Override public void done(JSONObject json, NCMBExceptio...
[FOCAL] public void NCMBPushService.sendPushReceiptStatusInBackground(String pushId, ExecuteServiceCallback callback) [CLASS] class NCMBPushService extends NCMBService [METRICS] loc=40 cc=5 branches=2 loops=0 returns=0 throws=2 nesting=2 [CALLS-INTERNAL] RequestParams createRequestParams(String installationId, JSONObje...
/* static context [FOCAL] public void NCMBPushService.sendPushReceiptStatusInBackground(String pushId, ExecuteServiceCallback callback) [PATH1] if(pushId == null)=F -> try-body throws -> throw new NCMBException(NCMBException.INVALID_JSON, "prams invalid JSON") -> if(callback != null)=T [PATH2] if(pushId == null)=T -> t...
/* static context [FOCAL] public void NCMBPushService.sendPushReceiptStatusInBackground(String pushId, ExecuteServiceCallback callback) [PATH1] if(pushId == null)=F -> try-body throws -> throw new NCMBException(NCMBException.INVALID_JSON, "prams invalid JSON") -> if(callback != null)=T [PATH2] if(pushId == null)=T -> t...
true
ok
{"focal": {"class": "NCMBPushService", "name": "sendPushReceiptStatusInBackground", "signature": "void sendPushReceiptStatusInBackground(String pushId, ExecuteServiceCallback callback)", "start_line": 3, "modifiers": "public", "params": [{"name": "pushId", "type": "String"}, {"name": "callback", "type": "ExecuteService...
42741668_0
class Request { public static Request GET(String path) { return Requests.GET(path); } public static Request PUT(String path, String body); public static Request lazy(F0<Request> requestExpression); public abstract X match(Cases<X> cases); @Override public abstract int hashCode(); @Override public a...
ImmutableList<GuavaRequest> gets = ImmutableList.of(GET("foo")); gets = FluentIterable.from(gets).transform(modPath(path -> "/" + path)).toList(); assertThat(gets.size(), is(1)); assertThat(getPath(gets.get(0)), is("/foo")); } }
[FOCAL] public static Request Request.GET(String path) [CLASS] class Request [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Requests.GET/1 [INPUTS] branches=- | result=path [DATAFLOW] path@param->L3 [CLASS-MEMBERS] Request PUT(String path, String body); Request lazy(F0<Request> re...
/* static context [FOCAL] public static Request Request.GET(String path) [INPUTS] branches=- | result=path [CALLS-EXTERNAL] Requests.GET/1 */
/* static context [FOCAL] public static Request Request.GET(String path) [INPUTS] branches=- | result=path [CALLS-EXTERNAL] Requests.GET/1 */ class Request { public static Request GET(String path) { return Requests.GET(path); } public static Request PUT(String path, String body); public static Request la...
true
ok
{"focal": {"class": "Request", "name": "GET", "signature": "Request GET(String path)", "start_line": 3, "modifiers": "public static", "params": [{"name": "path", "type": "String"}], "return_type": "Request"}, "class_info": {"name": "Request", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fi...
42742666_46
class OAuth2Credentials { @Nullable public String getAuthorizationUrl() throws UnsupportedEncodingException { String authorizationCodeRequestUrl = authorizationCodeFlow.newAuthorizationUrl().setScopes(scopes).build(); if (redirectUri != null) { authorizationCodeReque...
OAuth2Credentials oAuth2Credentials = new OAuth2Credentials.Builder() .setClientSecrets("CLIENT_ID", "CLIENT_SECRET") .setRedirectUri("https://localhost:8181/OAuth2Callback") .setScopes(Arrays.asList(Scope.PROFILE)) .setCustomScopes(Arrays.asList("...
[FOCAL] @Nullable public String OAuth2Credentials.getAuthorizationUrl() [CLASS] class OAuth2Credentials [METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] authorizationCodeFlow.newAuthorizationUrl().setScopes(sco....build/0, authorizationCodeFlow.newAuthorizationUrl().setScopes/1, aut...
/* static context [FOCAL] @Nullable public String OAuth2Credentials.getAuthorizationUrl() [PATH1] if(redirectUri != null)=T -> return authorizationCodeRequestUrl [PATH2] if(redirectUri != null)=F -> return authorizationCodeRequestUrl [COLLABORATORS] field authorizationCodeFlow newAuthorizationUrl/0 [EXCEPTIONS] declare...
/* static context [FOCAL] @Nullable public String OAuth2Credentials.getAuthorizationUrl() [PATH1] if(redirectUri != null)=T -> return authorizationCodeRequestUrl [PATH2] if(redirectUri != null)=F -> return authorizationCodeRequestUrl [COLLABORATORS] field authorizationCodeFlow newAuthorizationUrl/0 [EXCEPTIONS] declare...
true
ok
{"focal": {"class": "OAuth2Credentials", "name": "getAuthorizationUrl", "signature": "String getAuthorizationUrl() throws UnsupportedEncodingException", "start_line": 3, "modifiers": "@Nullable public", "params": [], "return_type": "String"}, "class_info": {"name": "OAuth2Credentials", "kind": "class", "modifiers": "",...
42751387_138
class DigdagClient implements AutoCloseable { public InputStream getProjectArchive(Id projId, String revision) { WebTarget webTarget = target("/api/projects/{id}/archive") .resolveTemplate("id", projId) .queryParam("revision", revision); webTarget = addDisableDir...
String redirectUrl = String.format("https://%s:%d/redirect/pathname", mockWebServer.getHostName(), mockWebServer.getPort()); mockWebServer.enqueue(new MockResponse().setResponseCode(303).setHeader("Location", redirectUrl)); mockWebServer.enqueue(new MockResponse().setResponseCode(200).setBody("f...
[FOCAL] public InputStream DigdagClient.getProjectArchive(Id projId, String revision) [CLASS] class DigdagClient implements AutoCloseable [METRICS] loc=19 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] Response invokeWithRetry(Invocation request); T withFollowingRedirect(WebTarget initialWebTarge...
/* static context [FOCAL] public InputStream DigdagClient.getProjectArchive(Id projId, String revision) [INPUTS] branches=- | result=projId, revision [COLLABORATORS] field wt request/0; field lastResponse isPresent/0; field headers get/0 [CALLS-INTERNAL] Response invokeWithRetry(Invocation request); T withFollowingRedi...
/* static context [FOCAL] public InputStream DigdagClient.getProjectArchive(Id projId, String revision) [INPUTS] branches=- | result=projId, revision [COLLABORATORS] field wt request/0; field lastResponse isPresent/0; field headers get/0 [CALLS-INTERNAL] Response invokeWithRetry(Invocation request); T withFollowingRedi...
true
ok
{"focal": {"class": "DigdagClient", "name": "getProjectArchive", "signature": "InputStream getProjectArchive(Id projId, String revision)", "start_line": 3, "modifiers": "public", "params": [{"name": "projId", "type": "Id"}, {"name": "revision", "type": "String"}], "return_type": "InputStream"}, "class_info": {"name": "...
42751554_195
class UserDAO { public User getByEmail(String email) throws NotFoundException { User user = userRepository.findOneByEmail(email); if (user == null) { throw new NotFoundException("Could not find the user with the email '" + email + "'!"); } return user; } @Autow...
User user = createUser(); BDDMockito.given(userRepository.findOneByEmail(user.getEmail())).willReturn(user); User userFromDB = userDAO.getByEmail(user.getEmail()); Assert.assertEquals(user, userFromDB); } }
[FOCAL] public User UserDAO.getByEmail(String email) [CLASS] class UserDAO [METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] UserRepository.findOneByEmail/1 [NEW] NotFoundException [FIELDS] read=userRepository:UserRepository [EXCEPTIONS] declares NotFoundException; throws NotFoundExc...
/* static context [FOCAL] public User UserDAO.getByEmail(String email) [THROWS-WHEN] NotFoundException when user == null [PATH1] if(user == null)=T -> throw new NotFoundException("Could not find the user with the email '" + ... [PATH2] if(user == null)=F -> return user [INPUTS] branches=email, userRepository | result=e...
/* static context [FOCAL] public User UserDAO.getByEmail(String email) [THROWS-WHEN] NotFoundException when user == null [PATH1] if(user == null)=T -> throw new NotFoundException("Could not find the user with the email '" + ... [PATH2] if(user == null)=F -> return user [INPUTS] branches=email, userRepository | result=e...
true
ok
{"focal": {"class": "UserDAO", "name": "getByEmail", "signature": "User getByEmail(String email) throws NotFoundException", "start_line": 3, "modifiers": "public", "params": [{"name": "email", "type": "String"}], "return_type": "User"}, "class_info": {"name": "UserDAO", "kind": "class", "modifiers": "", "superclass": n...
42774632_5
class SortTokenParserAdapter { public SortNodeList parse(String sortExpression) { try { return createParser(sortExpression).parse(); } catch (ParseException | Error e) { throw new SortParsingException(e); } } private SortTokenParser createParser(String expre...
String sortExpression = "sort ( + employee.name, - company.code) "; SortNodeList sortNodeList = new SortTokenParserAdapter().parse(sortExpression); assertNotNull(sortNodeList); List<SortNode> sortNodes = sortNodeList.getNodes(); assertEquals(2, sortNodes.size()); SortNod...
[FOCAL] public SortNodeList SortTokenParserAdapter.parse(String sortExpression) [CLASS] class SortTokenParserAdapter [METRICS] loc=7 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] SortTokenParser createParser(String expression) [CALLS-EXTERNAL] createParser(sortExpression).parse/0 [NEW] SortParsi...
/* static context [FOCAL] public SortNodeList SortTokenParserAdapter.parse(String sortExpression) [THROWS-WHEN] SortParsingException when try-body throws [PATH1] try-body throws -> throw new SortParsingException(e) [PATH2] return createParser(sortExpression).parse() [INPUTS] branches=- | result=sortExpression [EXCEPTIO...
/* static context [FOCAL] public SortNodeList SortTokenParserAdapter.parse(String sortExpression) [THROWS-WHEN] SortParsingException when try-body throws [PATH1] try-body throws -> throw new SortParsingException(e) [PATH2] return createParser(sortExpression).parse() [INPUTS] branches=- | result=sortExpression [EXCEPTIO...
true
ok
{"focal": {"class": "SortTokenParserAdapter", "name": "parse", "signature": "SortNodeList parse(String sortExpression)", "start_line": 3, "modifiers": "public", "params": [{"name": "sortExpression", "type": "String"}], "return_type": "SortNodeList"}, "class_info": {"name": "SortTokenParserAdapter", "kind": "class", "mo...
42776453_23
class OverpassQuery extends AbstractOverpassQuery { public OverpassQuery output(int limit) { return output(BODY, CENTER, QT, limit); } public OverpassQuery(); OverpassQuery(OverpassQueryBuilder builder); public OverpassQuery format(OutputFormat outputFormat); public OverpassQuery t...
query.output(OutputVerbosity.META, OutputModificator.GEOM, OutputOrder.ASC, 100); verify(builder).append("; out meta geom asc 100"); } }
[FOCAL] public OverpassQuery OverpassQuery.output(int limit) [CLASS] class OverpassQuery extends AbstractOverpassQuery [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] OverpassQuery output(OutputVerbosity verbosity, OutputModificator modificator, OutputOrder order, int limit) [INPUT...
/* static context [FOCAL] public OverpassQuery OverpassQuery.output(int limit) [INPUTS] branches=- | result=limit [CALLS-INTERNAL] OverpassQuery output(OutputVerbosity verbosity, OutputModificator modificator, OutputOrder order, int limit) */
/* static context [FOCAL] public OverpassQuery OverpassQuery.output(int limit) [INPUTS] branches=- | result=limit [CALLS-INTERNAL] OverpassQuery output(OutputVerbosity verbosity, OutputModificator modificator, OutputOrder order, int limit) */ class OverpassQuery extends AbstractOverpassQuery { public OverpassQuery...
true
ok
{"focal": {"class": "OverpassQuery", "name": "output", "signature": "OverpassQuery output(int limit)", "start_line": 3, "modifiers": "public", "params": [{"name": "limit", "type": "int"}], "return_type": "OverpassQuery"}, "class_info": {"name": "OverpassQuery", "kind": "class", "modifiers": "", "superclass": "AbstractO...
42781657_9
class Dint { public static int firstDayOfMonth(int dint) { return compose(year(dint), month(dint), 1); } public static int create(int year, int month, int day); public static int create(Calendar calendar); public static int create(Date date); public static int compose(int year, int mon...
assertEquals(20140901, firstDayOfMonth(20140912)); } }
[FOCAL] public static int Dint.firstDayOfMonth(int dint) [CLASS] class Dint [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] int compose(int year, int month, int day); int month(int dint); int year(int dint) [INPUTS] branches=- | result=dint [DATAFLOW] dint@param->L2 [CLASS-MEMBERS]...
/* static context [FOCAL] public static int Dint.firstDayOfMonth(int dint) [INPUTS] branches=- | result=dint [CALLS-INTERNAL] int compose(int year, int month, int day); int month(int dint); int year(int dint) */
/* static context [FOCAL] public static int Dint.firstDayOfMonth(int dint) [INPUTS] branches=- | result=dint [CALLS-INTERNAL] int compose(int year, int month, int day); int month(int dint); int year(int dint) */ class Dint { public static int firstDayOfMonth(int dint) { return compose(year(dint), month(din...
true
ok
{"focal": {"class": "Dint", "name": "firstDayOfMonth", "signature": "int firstDayOfMonth(int dint)", "start_line": 3, "modifiers": "public static", "params": [{"name": "dint", "type": "int"}], "return_type": "int"}, "class_info": {"name": "Dint", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null,...
42785683_13
class Cargo implements Serializable { public Delivery getDelivery() { return delivery; } public Cargo(); public Cargo(TrackingId trackingId, RouteSpecification routeSpecification); public TrackingId getTrackingId(); public void setOrigin(Location origin); public Location getOrig...
Cargo cargo = populateCargoOnHamburg(); assertEquals(SampleLocations.HAMBURG, cargo.getDelivery() .getLastKnownLocation()); } }
[FOCAL] public Delivery Cargo.getDelivery() [CLASS] class Cargo implements Serializable [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Cargo(); Cargo(TrackingId trackingId, RouteSpecification routeSpecification); TrackingId getTrackingId(); void setOrigin(Location origin); Location...
/* static context [FOCAL] public Delivery Cargo.getDelivery() */
/* static context [FOCAL] public Delivery Cargo.getDelivery() */ class Cargo implements Serializable { public Delivery getDelivery() { return delivery; } public Cargo(); public Cargo(TrackingId trackingId, RouteSpecification routeSpecification); public TrackingId getTrackingId(); pu...
true
ok
{"focal": {"class": "Cargo", "name": "getDelivery", "signature": "Delivery getDelivery()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Delivery"}, "class_info": {"name": "Cargo", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Serializable", "fields": [{"name": "events", "...
42810825_0
class LoginCommand implements Command { @Override public void execute(Session session, Message msg) { if (session.getSessionUser() != null) { log.info("User {} already logged in.", session.getSessionUser()); return; } else { LoginMessage loginMsg = (LoginMes...
LoginCommand loginCommand = new LoginCommand(userStore, sessionManager); LoginMessage login = new LoginMessage(); login.setSender(123L); login.setLogin("Jack"); login.setPass("qwerty"); Session session = new Session(); loginCommand.execute(session, login); ...
[FOCAL] @Override public void LoginCommand.execute(Session session, Message msg) [CLASS] class LoginCommand implements Command [METRICS] loc=25 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=2 [CALLS-INTERNAL] void sendAcknowledge(Session session, String message) [CALLS-EXTERNAL] Session.getSessionUser/0, log.info/...
/* static context [FOCAL] @Override public void LoginCommand.execute(Session session, Message msg) [PATH1] if(session.getSessionUser() != null)=F -> if(user == null)=T -> return [PATH2] if(session.getSessionUser() != null)=T -> return [PATH3] if(session.getSessionUser() != null)=F -> if(user == null)=F [INPUTS] branche...
/* static context [FOCAL] @Override public void LoginCommand.execute(Session session, Message msg) [PATH1] if(session.getSessionUser() != null)=F -> if(user == null)=T -> return [PATH2] if(session.getSessionUser() != null)=T -> return [PATH3] if(session.getSessionUser() != null)=F -> if(user == null)=F [INPUTS] branche...
true
ok
{"focal": {"class": "LoginCommand", "name": "execute", "signature": "void execute(Session session, Message msg)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "session", "type": "Session"}, {"name": "msg", "type": "Message"}], "return_type": "void"}, "class_info": {"name": "LoginCommand", "kind...
42830433_0
class CheckstyleSourceCodeFileAnalyzerPlugin implements SourceCodeFileAnalyzerPlugin, ConfigurableAnalyzerPlugin { @Override public FileMetrics analyzeFile(String filepath, byte[] fileContent) { File fileToAnalyze = null; try { fileToAnalyze = createTempFile(fileContent, filepath); auditListene...
byte[] fileContent = IOUtils.toByteArray(getClass().getResourceAsStream("/CheckstyleAnalyzer.java.txt")); CheckstyleSourceCodeFileAnalyzerPlugin analyzer = new CheckstyleSourceCodeFileAnalyzerPlugin(); FileMetrics metrics = analyzer.analyzeFile("abc.java", fileContent); Assertions.assertEqual...
[FOCAL] @Override public FileMetrics CheckstyleSourceCodeFileAnalyzerPlugin.analyzeFile(String filepath, byte[] fileContent) [CLASS] class CheckstyleSourceCodeFileAnalyzerPlugin implements SourceCodeFileAnalyzerPlugin, ConfigurableAnalyzerPlugin [METRICS] loc=16 cc=3 branches=1 loops=0 returns=1 throws=1 nesting=2 [CAL...
/* static context [FOCAL] @Override public FileMetrics CheckstyleSourceCodeFileAnalyzerPlugin.analyzeFile(String filepath, byte[] fileContent) [PATH1] try-body throws -> throw new AnalyzerException(e) -> if(fileToAnalyze != null && !fileToAnalyze.delete())=T [PATH2] return auditListener.getMetrics() -> if(fileToAnalyze...
/* static context [FOCAL] @Override public FileMetrics CheckstyleSourceCodeFileAnalyzerPlugin.analyzeFile(String filepath, byte[] fileContent) [PATH1] try-body throws -> throw new AnalyzerException(e) -> if(fileToAnalyze != null && !fileToAnalyze.delete())=T [PATH2] return auditListener.getMetrics() -> if(fileToAnalyze...
true
ok
{"focal": {"class": "CheckstyleSourceCodeFileAnalyzerPlugin", "name": "analyzeFile", "signature": "FileMetrics analyzeFile(String filepath, byte[] fileContent)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "filepath", "type": "String"}, {"name": "fileContent", "type": "byte[]"}], "return_type"...
42854263_0
class RetainState implements Iterable<Object> { @SuppressWarnings("unchecked") public <T> T retain(int id, OnCreate<T> onCreate) { if (state == null) { state = new SparseArray<>(); } T item = (T) state.get(id); if (item == null) { item = onCreate.onCreate...
RetainState retainState = new RetainState(null); String result = retainState.retain(0, new RetainState.OnCreate<String>() { @Override public String onCreate() { return "test"; } }); assertEquals("test", result); } }
[FOCAL] @SuppressWarnings("unchecked") public T RetainState.retain(int id, OnCreate<T> onCreate) [CLASS] class RetainState implements Iterable<Object> [METRICS] loc=15 cc=4 branches=3 loops=0 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] state.get/1, OnCreate<T>.onCreate/0, ((RetainState) item).setIsRetaining/1, state....
/* static context [FOCAL] @SuppressWarnings("unchecked") public T RetainState.retain(int id, OnCreate<T> onCreate) [PATH1] if(state == null)=T -> if(item == null)=T -> if(item instanceof RetainState)=T -> return item [PATH2] if(state == null)=F -> if(item == null)=F -> return item [PATH3] if(state == null)=T -> if(item...
/* static context [FOCAL] @SuppressWarnings("unchecked") public T RetainState.retain(int id, OnCreate<T> onCreate) [PATH1] if(state == null)=T -> if(item == null)=T -> if(item instanceof RetainState)=T -> return item [PATH2] if(state == null)=F -> if(item == null)=F -> return item [PATH3] if(state == null)=T -> if(item...
true
ok
{"focal": {"class": "RetainState", "name": "retain", "signature": "T retain(int id, OnCreate<T> onCreate)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public", "params": [{"name": "id", "type": "int"}, {"name": "onCreate", "type": "OnCreate<T>"}], "return_type": "T"}, "class_info": {"name": "Retain...
42899767_43
class RegistryClients { public static RegistryClient createZookeeperClient(Config config) throws IOException { CuratorFramework client = CuratorFrameworkFactory.builder() .connectString(getZookeeperConnectionString(config)) .retryPolicy(new RetryOneTime(1000)) .build(); ...
MockitoAnnotations.initMocks(this); testingServer = new TestingServer(); when(config.getList(eq(REGISTRY_ZOOKEEPER_SERVERS))) .thenReturn(Arrays.asList(testingServer.getConnectString())); RegistryClient registryClient = RegistryClients.createZookeeperClient(config); a...
[FOCAL] public static RegistryClient RegistryClients.createZookeeperClient(Config config) [CLASS] class RegistryClients [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String getZookeeperConnectionString(Config config) [CALLS-EXTERNAL] CuratorFrameworkFactory.builder() .connectStri...
/* static context [FOCAL] public static RegistryClient RegistryClients.createZookeeperClient(Config config) [INPUTS] branches=- | result=config [EXCEPTIONS] declares IOException [CALLS-INTERNAL] String getZookeeperConnectionString(Config config) [NEW] RetryOneTime, ZookeeperRegistryClient, ObjectMapper [CALLS-EXTERNAL]...
/* static context [FOCAL] public static RegistryClient RegistryClients.createZookeeperClient(Config config) [INPUTS] branches=- | result=config [EXCEPTIONS] declares IOException [CALLS-INTERNAL] String getZookeeperConnectionString(Config config) [NEW] RetryOneTime, ZookeeperRegistryClient, ObjectMapper [CALLS-EXTERNAL]...
true
ok
{"focal": {"class": "RegistryClients", "name": "createZookeeperClient", "signature": "RegistryClient createZookeeperClient(Config config) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "config", "type": "Config"}], "return_type": "RegistryClient"}, "class_info": {"name": "Regist...
42985510_2
class RemoteConfigWithCacheFactory extends RemoteConfigFactory { public Path getPath() { return path; } public RemoteConfigWithCacheFactory(Path localConfigPath, ProcessInfo info, CuratorFramework client); public static RemoteConfigWithCacheFactory getInstance(); @Override protected IChangeableConfig ...
String name = "factory.ini"; File f = factory.getPath().resolve(name).toFile(); TestHelper.writeFile(ZookeeperUtil.newBytes("a=-1"), f); ProcessInfo info = factory.getInfo(); String path = ZKPaths.makePath(info.getPath(), name, info.getProfile()); final AtomicInteger num = new AtomicInteger(0); ...
[FOCAL] public Path RemoteConfigWithCacheFactory.getPath() [CLASS] class RemoteConfigWithCacheFactory extends RemoteConfigFactory [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] RemoteConfigWithCacheFactory(Path localConfigPath, ProcessInfo info, CuratorFramework client); RemoteConf...
/* static context [FOCAL] public Path RemoteConfigWithCacheFactory.getPath() */
/* static context [FOCAL] public Path RemoteConfigWithCacheFactory.getPath() */ class RemoteConfigWithCacheFactory extends RemoteConfigFactory { public Path getPath() { return path; } public RemoteConfigWithCacheFactory(Path localConfigPath, ProcessInfo info, CuratorFramework client); public static Remo...
true
ok
{"focal": {"class": "RemoteConfigWithCacheFactory", "name": "getPath", "signature": "Path getPath()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Path"}, "class_info": {"name": "RemoteConfigWithCacheFactory", "kind": "class", "modifiers": "", "superclass": "RemoteConfigFactory", "interfaces": ...
43031095_30
class LogSubscriber { @Before("classAnnotatedWithRxLogSubscriber(joinPoint) && onCompletedMethodExecution()") public void beforeOnCompletedExecution(JoinPoint joinPoint) { stopWatch.stop(); messageManager.printSubscriberOnCompleted(joinPoint.getTarget().getClass().getSimpleName(), stopWatch.getTota...
logSubscriber.beforeOnCompletedExecution(joinPoint); verify(stopWatch).stop(); verify(messageManager).printSubscriberOnCompleted(eq(subscriber.getClass().getSimpleName()), anyLong(), anyInt()); verify(counter).tally(); verify(counter).clear(); verify(stopWatch).getTotalTimeMillis(); ...
[FOCAL] @Before("classAnnotatedWithRxLogSubscriber(joinPoint) && onCompletedMethodExecution()") public void LogSubscriber.beforeOnCompletedExecution(JoinPoint joinPoint) [CLASS] class LogSubscriber [METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void resetCounters() [CALLS-EXTERNAL...
/* static context [FOCAL] @Before("classAnnotatedWithRxLogSubscriber(joinPoint) && onCompletedMethodExecution()") public void LogSubscriber.beforeOnCompletedExecution(JoinPoint joinPoint) [COLLABORATORS] field stopWatch:StopWatch stop/0,getTotalTimeMillis/0; field messageManager:MessageManager printSubscriberOnComplete...
/* static context [FOCAL] @Before("classAnnotatedWithRxLogSubscriber(joinPoint) && onCompletedMethodExecution()") public void LogSubscriber.beforeOnCompletedExecution(JoinPoint joinPoint) [COLLABORATORS] field stopWatch:StopWatch stop/0,getTotalTimeMillis/0; field messageManager:MessageManager printSubscriberOnComplete...
true
ok
{"focal": {"class": "LogSubscriber", "name": "beforeOnCompletedExecution", "signature": "void beforeOnCompletedExecution(JoinPoint joinPoint)", "start_line": 3, "modifiers": "@Before(\"classAnnotatedWithRxLogSubscriber(joinPoint) && onCompletedMethodExecution()\") public", "params": [{"name": "joinPoint", "type": "Join...
43075480_113
class EndpointManager { public synchronized void setDefaultEndpoint(Endpoint newEndpoint) { if (null == newEndpoint) { throw new NullPointerException("endpoint required!"); } URI uri = newEndpoint.getUri(); if (null == uri) { throw new IllegalArgumentException("Endpoint protocol not supported!"); } ...
// GIVEN a old and a new endpoint Endpoint oldEndpoint = EndpointManager.getEndpointManager().getDefaultEndpoint(); Endpoint endpoint = new CoapEndpoint.Builder().build(); // WHEN set the new default endpoint EndpointManager.getEndpointManager().setDefaultEndpoint(endpoint); // THEN get the same new defau...
[FOCAL] public synchronized void EndpointManager.setDefaultEndpoint(Endpoint newEndpoint) [CLASS] class EndpointManager [METRICS] loc=24 cc=7 branches=5 loops=0 returns=0 throws=3 nesting=2 [CALLS-EXTERNAL] Endpoint.getUri/0, URI.getScheme/0, CoAP.isSupportedScheme/1, endpoints.put/2, Endpoint.destroy/0, Endpoint.isSta...
/* static context [FOCAL] public synchronized void EndpointManager.setDefaultEndpoint(Endpoint newEndpoint) [THROWS-WHEN] NullPointerException when null == newEndpoint [THROWS-WHEN] IllegalArgumentException when !(null == newEndpoint) && null == uri [THROWS-WHEN] IllegalArgumentException when !(null == newEndpoint) && ...
/* static context [FOCAL] public synchronized void EndpointManager.setDefaultEndpoint(Endpoint newEndpoint) [THROWS-WHEN] NullPointerException when null == newEndpoint [THROWS-WHEN] IllegalArgumentException when !(null == newEndpoint) && null == uri [THROWS-WHEN] IllegalArgumentException when !(null == newEndpoint) && ...
true
ok
{"focal": {"class": "EndpointManager", "name": "setDefaultEndpoint", "signature": "void setDefaultEndpoint(Endpoint newEndpoint)", "start_line": 3, "modifiers": "public synchronized", "params": [{"name": "newEndpoint", "type": "Endpoint"}], "return_type": "void"}, "class_info": {"name": "EndpointManager", "kind": "clas...
43077304_2
class NestListParser { public static List<String> parseFunction(String str) { FunctionState state = FunctionState.START; ArrayList<String> list = new ArrayList<>(2); field.setLength(0); boolean parameters_ok = false; int quoteCount_InParentheses = 0; int leftNotMatc...
// t2("a", "a", ""); t2("a(b,c)", "a", "b,c"); t2("abc(b,c,d(e,f))", "abc", "b,c,d(e,f)"); //assertThrows(Throwable.class, () -> NestListParser.parseFunction("a,b,c")); } }
[FOCAL] public static List<String> NestListParser.parseFunction(String str) [CLASS] class NestListParser [METRICS] loc=69 cc=16 branches=12 loops=1 returns=1 throws=3 nesting=6 [CALLS-EXTERNAL] field.setLength/1, String.toCharArray/0, field.append/1, ArrayList<String>.add/1, field.toString/0, ArrayList<String>.size/0 [...
/* static context [FOCAL] public static List<String> NestListParser.parseFunction(String str) [THROWS-WHEN] RuntimeException when foreach(char c : str.toCharArray())=T && switch(state)=case START && !(c == whitespace) && parameters_ok [THROWS-WHEN] RuntimeException when foreach(char c : str.toCharArray())=T && switch(s...
/* static context [FOCAL] public static List<String> NestListParser.parseFunction(String str) [THROWS-WHEN] RuntimeException when foreach(char c : str.toCharArray())=T && switch(state)=case START && !(c == whitespace) && parameters_ok [THROWS-WHEN] RuntimeException when foreach(char c : str.toCharArray())=T && switch(s...
true
ok
{"focal": {"class": "NestListParser", "name": "parseFunction", "signature": "List<String> parseFunction(String str)", "start_line": 3, "modifiers": "public static", "params": [{"name": "str", "type": "String"}], "return_type": "List<String>"}, "class_info": {"name": "NestListParser", "kind": "class", "modifiers": "", "...
43088077_48
class InputStreamDelegateDecoder implements Decoder { @Override public Object decode(Response response, Type type) throws IOException, FeignException { if (type.equals(InputStream.class)) { byte[] body = response.body() != null ? Util.toByteArray(response.body().asInputS...
String returned = "string"; when(delegate.decode(any(), any())).thenReturn(returned); Response response = Response.create(200, "OK", ImmutableMap.of(), returned, StandardCharsets.UTF_8); String decodedObject = (String) inputStreamDelegateDecoder.decode(response, String.class); a...
[FOCAL] @Override public Object InputStreamDelegateDecoder.decode(Response response, Type type) [CLASS] class InputStreamDelegateDecoder implements Decoder [METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] Type.equals/1, Response.body/0, Util.toByteArray/1, response.body().asInputSt...
/* static context [FOCAL] @Override public Object InputStreamDelegateDecoder.decode(Response response, Type type) [PATH1] if(type.equals(InputStream.class))=T -> return new ByteArrayInputStream(body) [PATH2] if(type.equals(InputStream.class))=F -> return delegate.decode(response, type) [INPUTS] branches=type | result=r...
/* static context [FOCAL] @Override public Object InputStreamDelegateDecoder.decode(Response response, Type type) [PATH1] if(type.equals(InputStream.class))=T -> return new ByteArrayInputStream(body) [PATH2] if(type.equals(InputStream.class))=F -> return delegate.decode(response, type) [INPUTS] branches=type | result=r...
true
ok
{"focal": {"class": "InputStreamDelegateDecoder", "name": "decode", "signature": "Object decode(Response response, Type type) throws IOException, FeignException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "response", "type": "Response"}, {"name": "type", "type": "Type"}], "return_type": "Obj...
43089983_1
class BasicAuthorizationHeaderModifier implements HeaderModifier { @Override public boolean matches(Header header) { return "Authorization".equals(header.name()) && header.value().startsWith("Basic"); } public BasicAuthorizationHeaderModifier(Base64Decoder base64Decoder); ...
final Header header = new Header("Authorization", "Non basic header value"); assertThat(headerModifier.matches(header), is(false)); } }
[FOCAL] @Override public boolean BasicAuthorizationHeaderModifier.matches(Header header) [CLASS] class BasicAuthorizationHeaderModifier implements HeaderModifier [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] "Authorization".equals/1, Header.name/0, header.value().startsWith/1, He...
/* static context [FOCAL] @Override public boolean BasicAuthorizationHeaderModifier.matches(Header header) [INPUTS] branches=- | result=header [COLLABORATORS] param header:Header name/0,value/0 [CALLS-EXTERNAL] "Authorization".equals/1, Header.name/0, header.value().startsWith/1, Header.value/0 */
/* static context [FOCAL] @Override public boolean BasicAuthorizationHeaderModifier.matches(Header header) [INPUTS] branches=- | result=header [COLLABORATORS] param header:Header name/0,value/0 [CALLS-EXTERNAL] "Authorization".equals/1, Header.name/0, header.value().startsWith/1, Header.value/0 */ class BasicAuthorizat...
true
ok
{"focal": {"class": "BasicAuthorizationHeaderModifier", "name": "matches", "signature": "boolean matches(Header header)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "header", "type": "Header"}], "return_type": "boolean"}, "class_info": {"name": "BasicAuthorizationHeaderModifier", "kind": "cla...
43092584_0
class TCX2Workout { private List<Snapshot> snapshots(Workout workout) throws IOException { List<Snapshot> snapshots = new ArrayList<>(); if (navigator.descent("Track")) { while (navigator.descent("Trackpoint")) { if (snapshots.size() == 0) { workout.location.set(location()); } snapshots.add(...
Reader reader = new InputStreamReader(getClass().getResourceAsStream("/snapshots.tcx")); TCX2Workout to = new TCX2Workout(reader).workout(); Workout workout = to.getWorkout(); assertEquals(Mon_Jun_15_2015 + (60 * 1000), (long)workout.start.get()); assertEquals(3, (int)workout.duration.get()); assertEqual...
[FOCAL] private List<Snapshot> TCX2Workout.snapshots(Workout workout) [CLASS] class TCX2Workout [METRICS] loc=18 cc=4 branches=2 loops=1 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] Location location(); Snapshot snapshot() [CALLS-EXTERNAL] navigator.descent/1, List<Snapshot>.size/0, workout.location.set/1, List<Snapsh...
/* static context [FOCAL] private List<Snapshot> TCX2Workout.snapshots(Workout workout) [PATH1] if(navigator.descent("Track"))=T -> while(navigator.descent("Trackpoint"))=T -> if(snapshots.size() == 0)=T -> exit loop -> return snapshots [PATH2] if(navigator.descent("Track"))=F -> return snapshots [PATH3] if(navigator.d...
/* static context [FOCAL] private List<Snapshot> TCX2Workout.snapshots(Workout workout) [PATH1] if(navigator.descent("Track"))=T -> while(navigator.descent("Trackpoint"))=T -> if(snapshots.size() == 0)=T -> exit loop -> return snapshots [PATH2] if(navigator.descent("Track"))=F -> return snapshots [PATH3] if(navigator.d...
true
ok
{"focal": {"class": "TCX2Workout", "name": "snapshots", "signature": "List<Snapshot> snapshots(Workout workout) throws IOException", "start_line": 3, "modifiers": "private", "params": [{"name": "workout", "type": "Workout"}], "return_type": "List<Snapshot>"}, "class_info": {"name": "TCX2Workout", "kind": "class", "modi...
43098270_0
class MinersRule { public String computeCDM(String jsonStr, Map<String, byte[]> inputModels) throws Exception { Input input = null; try { input = mapper.readValue(jsonStr, Input.class); } catch (Exception e) { throw new Exception("Trying to read the json input:"+jso...
String inputStr = null; try { inputStr = getFileAsString("src/test/resources/minersRuleIn.json"); } catch (Exception e) { e.printStackTrace(); Assert.fail(); } byte[] model = null; try { model = getFileAsByteArray("src/test...
[FOCAL] public String MinersRule.computeCDM(String jsonStr, Map<String, byte[]> inputModels) [CLASS] class MinersRule [METRICS] loc=35 cc=4 branches=2 loops=0 returns=1 throws=3 nesting=1 [CALLS-INTERNAL] List<Double> convertToDoubleList(byte[] stressLimitsModel); void computeMinersCDM(CDM_TimeSeries currentCDM, Stress...
/* static context [FOCAL] public String MinersRule.computeCDM(String jsonStr, Map<String, byte[]> inputModels) [THROWS-WHEN] Exception when try-body throws [THROWS-WHEN] Exception when inputModels == null || !inputModels.containsKey(STRESS_LIMITS_MODEL_NAME) [THROWS-WHEN] Exception when !(inputModels == null || !inputM...
/* static context [FOCAL] public String MinersRule.computeCDM(String jsonStr, Map<String, byte[]> inputModels) [THROWS-WHEN] Exception when try-body throws [THROWS-WHEN] Exception when inputModels == null || !inputModels.containsKey(STRESS_LIMITS_MODEL_NAME) [THROWS-WHEN] Exception when !(inputModels == null || !inputM...
true
ok
{"focal": {"class": "MinersRule", "name": "computeCDM", "signature": "String computeCDM(String jsonStr, Map<String, byte[]> inputModels) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "jsonStr", "type": "String"}, {"name": "inputModels", "type": "Map<String, byte[]>"}], "return_type": "S...
43115247_7
class Json { public static JNumber jNumber(BigDecimal value) { return new JNumber(value); } private Json(); public static JString jString(String value); public static JBoolean jBoolean(boolean value); public static JNumber jNumber(int n); public static JNumber jNumber(double n); ...
Json.JNumber n1 = Json.jNumber(1); assertEquals(n1, Json.jNumber(1L)); assertEquals(n1, Json.jNumber(new Long(1L))); assertEquals(n1, Json.jNumber(new BigDecimal(1))); assertEquals(1, n1.asInt()); assertEquals(1L, n1.asLong()); assertEquals(1.0, n1.asDouble(), 0.0...
[FOCAL] public static JNumber Json.jNumber(BigDecimal value) [CLASS] class Json [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] JNumber [INPUTS] branches=- | result=value [DATAFLOW] value@param->L2 [CLASS-MEMBERS] Json(); JString jString(String value); JBoolean jBoolean(boolean value); JNumbe...
/* static context [FOCAL] public static JNumber Json.jNumber(BigDecimal value) [INPUTS] branches=- | result=value [NEW] JNumber */
/* static context [FOCAL] public static JNumber Json.jNumber(BigDecimal value) [INPUTS] branches=- | result=value [NEW] JNumber */ class Json { public static JNumber jNumber(BigDecimal value) { return new JNumber(value); } private Json(); public static JString jString(String value); publ...
true
ok
{"focal": {"class": "Json", "name": "jNumber", "signature": "JNumber jNumber(BigDecimal value)", "start_line": 3, "modifiers": "public static", "params": [{"name": "value", "type": "BigDecimal"}], "return_type": "JNumber"}, "class_info": {"name": "Json", "kind": "class", "modifiers": "", "superclass": null, "interfaces...
43193480_1
class HelloWorldModel { public String getMessage() { return message; } @PostConstruct protected void init(); private HelloWorldModel hello; private String slingId; } class TestHelloWorldModel { private HelloWorldModel hello; private String slingId; @Test public void te...
// some very basic junit tests String msg = hello.getMessage(); assertNotNull(msg); assertTrue(msg.length() > 0); } }
[FOCAL] public String HelloWorldModel.getMessage() [CLASS] class HelloWorldModel [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] void init() [TEST] TestHelloWorldModel: @Test public void testGetMessage() throws Exception [TEST-FIELDS] HelloWorldModel hello, String slingId
/* static context [FOCAL] public String HelloWorldModel.getMessage() */
/* static context [FOCAL] public String HelloWorldModel.getMessage() */ class HelloWorldModel { public String getMessage() { return message; } @PostConstruct protected void init(); private HelloWorldModel hello; private String slingId; } class TestHelloWorldModel { private HelloWor...
true
ok
{"focal": {"class": "HelloWorldModel", "name": "getMessage", "signature": "String getMessage()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "HelloWorldModel", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "hello"...
43246449_65
class StateServiceImpl implements StateService { @Transactional(readOnly = true) @Override public StateDTO getStateDtoByName(String name) { Assert.notNull(name); return converterService.convert(statesRepository.findByName(name), StateDTO.class); } @Transactional(readOnly = true) @Override public Sta...
//Given given(statesRepository.findByName(VALID_STATE_NAME)).willReturn(validStatesEntity); given(converterService.convert(validStatesEntity, StateDTO.class)).willReturn(validStateDTO); StateDTO expectedStateDTO = StateDTO.builder().id(VALID_STATE_ID).name(VALID_STATE_NAME).build(); ...
[FOCAL] @Transactional(readOnly = true) @Override public StateDTO StateServiceImpl.getStateDtoByName(String name) [CLASS] class StateServiceImpl implements StateService [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Assert.notNull/1, ConverterService.convert/2, StatesRepository.fi...
/* static context [FOCAL] @Transactional(readOnly = true) @Override public StateDTO StateServiceImpl.getStateDtoByName(String name) [INPUTS] branches=- | result=name, converterService, statesRepository [COLLABORATORS] field converterService:ConverterService convert/2; field statesRepository:StatesRepository findByName/...
/* static context [FOCAL] @Transactional(readOnly = true) @Override public StateDTO StateServiceImpl.getStateDtoByName(String name) [INPUTS] branches=- | result=name, converterService, statesRepository [COLLABORATORS] field converterService:ConverterService convert/2; field statesRepository:StatesRepository findByName/...
true
ok
{"focal": {"class": "StateServiceImpl", "name": "getStateDtoByName", "signature": "StateDTO getStateDtoByName(String name)", "start_line": 3, "modifiers": "@Transactional(readOnly = true) @Override public", "params": [{"name": "name", "type": "String"}], "return_type": "StateDTO"}, "class_info": {"name": "StateServiceI...
43254843_4
class Buffer implements Closeable { public void flush(Ingester ingester, boolean force) throws IOException { LOG.trace("flush(): force={}, bufferUsage={}", force, getBufferUsage()); flushInternal(ingester, force); } public Buffer(RecordFormatter recordFormatter); publi...
Buffer buffer = new Buffer(bufferConfig, recordFormatter); Ingester ingester = mock(Ingester.class); buffer.flush(ingester, false); verify(ingester, times(0)).ingest(anyString(), any(ByteBuffer.class)); Map<String, Object> data = new HashMap<>(); data.put("name", "koma...
[FOCAL] public void Buffer.flush(Ingester ingester, boolean force) [CLASS] class Buffer implements Closeable [METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] float getBufferUsage(); void flushInternal(Ingester ingester, boolean force) [CALLS-EXTERNAL] Logger.trace/3 [FIELDS] read=LO...
/* static context [FOCAL] public void Buffer.flush(Ingester ingester, boolean force) [EXCEPTIONS] declares IOException [CALLS-INTERNAL] float getBufferUsage(); void flushInternal(Ingester ingester, boolean force) [FIELDS] read=LOG:Logger [CALLS-EXTERNAL] Logger.trace/3 */
/* static context [FOCAL] public void Buffer.flush(Ingester ingester, boolean force) [EXCEPTIONS] declares IOException [CALLS-INTERNAL] float getBufferUsage(); void flushInternal(Ingester ingester, boolean force) [FIELDS] read=LOG:Logger [CALLS-EXTERNAL] Logger.trace/3 */ class Buffer implements Closeable { public...
true
ok
{"focal": {"class": "Buffer", "name": "flush", "signature": "void flush(Ingester ingester, boolean force) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "ingester", "type": "Ingester"}, {"name": "force", "type": "boolean"}], "return_type": "void"}, "class_info": {"name": "Buffer", "kin...
43287559_81
class AggregationHashChainTimeConsistencyRule extends BaseRule { public VerificationErrorCode getErrorCode() { return VerificationErrorCode.INT_02; } public VerificationResultCode verifySignature(VerificationContext context); private AggregationHashChainTimeConsistencyRule rule; } class Agg...
RuleResult result = rule.verify(build(TestUtil.loadSignature(SIGNATURE_AGGREGATION_HASH_CHAIN_INVALID_AGGREGATION_TIMES))); Assert.assertNotNull(result); Assert.assertEquals(result.getResultCode(), VerificationResultCode.FAIL); Assert.assertEquals(result.getErrorCode(), VerificationError...
[FOCAL] public VerificationErrorCode AggregationHashChainTimeConsistencyRule.getErrorCode() [CLASS] class AggregationHashChainTimeConsistencyRule extends BaseRule [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] VerificationResultCode verifySignature(VerificationContext context) [TES...
/* static context [FOCAL] public VerificationErrorCode AggregationHashChainTimeConsistencyRule.getErrorCode() */
/* static context [FOCAL] public VerificationErrorCode AggregationHashChainTimeConsistencyRule.getErrorCode() */ class AggregationHashChainTimeConsistencyRule extends BaseRule { public VerificationErrorCode getErrorCode() { return VerificationErrorCode.INT_02; } public VerificationResultCode verif...
true
ok
{"focal": {"class": "AggregationHashChainTimeConsistencyRule", "name": "getErrorCode", "signature": "VerificationErrorCode getErrorCode()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "VerificationErrorCode"}, "class_info": {"name": "AggregationHashChainTimeConsistencyRule", "kind": "class", "m...
43294683_52
class TermFactory { public static Term findTerm(String termName) { // normalise termName String normTermName; if (termName == null || StringUtils.isBlank(normTermName = normaliseTerm(termName))) { return null; } // try known term enums first Term term = findTermInEnum(normTermName, DwcTerm.values(), ...
assertEquals(findTerm("http://ns.adobe.com/xap/1.0/rights/Owner"), XmpRightsTerm.Owner); } }
[FOCAL] public static Term TermFactory.findTerm(String termName) [CLASS] class TermFactory [METRICS] loc=74 cc=18 branches=17 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] String normaliseTerm(String term); Term findTermInEnum(String termName, Collection<Term> vocab); Term findTermInEnum(String termName, Term[]...
/* static context [FOCAL] public static Term TermFactory.findTerm(String termName) [PATH1] if(termName == null || StringUtils.isBlank(normTermName = normaliseTerm(termName)))=F -> if(term == null)#1=T -> if(term == null)#2=T -> if(term ==null)#1=T -> if(term ==null)#2=T -> if(term == null)#3=T -> if(term == null)#4=T -...
/* static context [FOCAL] public static Term TermFactory.findTerm(String termName) [PATH1] if(termName == null || StringUtils.isBlank(normTermName = normaliseTerm(termName)))=F -> if(term == null)#1=T -> if(term == null)#2=T -> if(term ==null)#1=T -> if(term ==null)#2=T -> if(term == null)#3=T -> if(term == null)#4=T -...
true
ok
{"focal": {"class": "TermFactory", "name": "findTerm", "signature": "Term findTerm(String termName)", "start_line": 3, "modifiers": "public static", "params": [{"name": "termName", "type": "String"}], "return_type": "Term"}, "class_info": {"name": "TermFactory", "kind": "class", "modifiers": "", "superclass": null, "in...
43300131_6
class MainActivity extends AppCompatActivity implements MainView { @Override public void showResult(float result) { resultEditText.setText(String.valueOf(result)); } @Override protected void onCreate(Bundle savedInstanceState); private void init(); private void initSpinner(); @Override public void showError(...
EditText result = (EditText) activity.findViewById(R.id.result_editText); activity.showResult(12f); assertThat(result.getText().toString()).isEqualTo("12.0"); } }
[FOCAL] @Override public void MainActivity.showResult(float result) [CLASS] class MainActivity extends AppCompatActivity implements MainView [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] resultEditText.setText/1, String.valueOf/1 [COLLABORATORS] field resultEditText setText/1 [DA...
/* static context [FOCAL] @Override public void MainActivity.showResult(float result) [COLLABORATORS] field resultEditText setText/1 [CALLS-EXTERNAL] resultEditText.setText/1, String.valueOf/1 */
/* static context [FOCAL] @Override public void MainActivity.showResult(float result) [COLLABORATORS] field resultEditText setText/1 [CALLS-EXTERNAL] resultEditText.setText/1, String.valueOf/1 */ class MainActivity extends AppCompatActivity implements MainView { @Override public void showResult(float result) { res...
true
ok
{"focal": {"class": "MainActivity", "name": "showResult", "signature": "void showResult(float result)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "result", "type": "float"}], "return_type": "void"}, "class_info": {"name": "MainActivity", "kind": "class", "modifiers": "", "superclass": "AppCo...
43342956_3
class Check { public CheckError toCheckError(CONTEXT context) { return CheckError.of(errorType,errorCode,message(context)); } private Check(CheckErrorType errorType,int errorCode,IRender<CONTEXT,String> render); public static Check<CONTEXT> of(CheckErrorType errorType,int errorCode, IRender<CONTEXT,String> re...
assertEquals(400,Check.ParamInvalid.toCheckError().asHttpCode()); assertEquals(404,Check.NotFound.toCheckError().asHttpCode()); } }
[FOCAL] public CheckError Check.toCheckError(CONTEXT context) [CLASS] class Check [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String message(CONTEXT context) [CALLS-EXTERNAL] CheckError.of/3 [INPUTS] branches=- | result=context [DATAFLOW] context@param->L2 [CLASS-MEMBERS] Check...
/* static context [FOCAL] public CheckError Check.toCheckError(CONTEXT context) [INPUTS] branches=- | result=context [CALLS-INTERNAL] String message(CONTEXT context) [CALLS-EXTERNAL] CheckError.of/3 */
/* static context [FOCAL] public CheckError Check.toCheckError(CONTEXT context) [INPUTS] branches=- | result=context [CALLS-INTERNAL] String message(CONTEXT context) [CALLS-EXTERNAL] CheckError.of/3 */ class Check { public CheckError toCheckError(CONTEXT context) { return CheckError.of(errorType,errorCode,message(c...
true
ok
{"focal": {"class": "Check", "name": "toCheckError", "signature": "CheckError toCheckError(CONTEXT context)", "start_line": 3, "modifiers": "public", "params": [{"name": "context", "type": "CONTEXT"}], "return_type": "CheckError"}, "class_info": {"name": "Check", "kind": "class", "modifiers": "", "superclass": null, "i...