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
19419350_42
class ScriptChunk { public byte[] toByteArray() { ByteArrayOutputStream stream = new ByteArrayOutputStream(); try { write(stream); } catch (IOException e) { // Should not happen as ByteArrayOutputStream does not throw IOException on write throw new Runtim...
byte[] expected = new byte[] { OP_IF }; byte[] actual = new ScriptChunk(OP_IF, null).toByteArray(); assertArrayEquals(expected, actual); } }
[FOCAL] public byte[] ScriptChunk.toByteArray() [CLASS] class ScriptChunk [METRICS] loc=10 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] void write(OutputStream stream) [CALLS-EXTERNAL] ByteArrayOutputStream.toByteArray/0 [NEW] ByteArrayOutputStream, RuntimeException [EXCEPTIONS] throws RuntimeE...
/* static context [FOCAL] public byte[] ScriptChunk.toByteArray() [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException(e) [PATH2] return stream.toByteArray() [EXCEPTIONS] throws RuntimeException; catches IOException e [CALLS-INTERNAL] void write(OutputStream stream) ...
/* static context [FOCAL] public byte[] ScriptChunk.toByteArray() [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException(e) [PATH2] return stream.toByteArray() [EXCEPTIONS] throws RuntimeException; catches IOException e [CALLS-INTERNAL] void write(OutputStream stream) ...
true
ok
{"focal": {"class": "ScriptChunk", "name": "toByteArray", "signature": "byte[] toByteArray()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "byte[]"}, "class_info": {"name": "ScriptChunk", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "RANDOM", "ty...
19436066_16
class ConfigUtils { public int getIntValue(Properties props, String key, int defaultValue) { return Integer.parseInt(getStringValue(props, key, Integer.toString(defaultValue))); } public List<String> getNormalizedPackages(String packages); String getNormalizedPackagePrefix(String packagePrefix); public...
assertThat(getIntValue(new Properties(), "key", 17), is(17)); } }
[FOCAL] public int ConfigUtils.getIntValue(Properties props, String key, int defaultValue) [CLASS] class ConfigUtils [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String getStringValue(Properties props, String propertyName, String defaultValue) [CALLS-EXTERNAL] Integer.parseInt/1...
/* static context [FOCAL] public int ConfigUtils.getIntValue(Properties props, String key, int defaultValue) [INPUTS] branches=- | result=defaultValue, key, props [CALLS-INTERNAL] String getStringValue(Properties props, String propertyName, String defaultValue) [CALLS-EXTERNAL] Integer.parseInt/1, Integer.toString/1 */...
/* static context [FOCAL] public int ConfigUtils.getIntValue(Properties props, String key, int defaultValue) [INPUTS] branches=- | result=defaultValue, key, props [CALLS-INTERNAL] String getStringValue(Properties props, String propertyName, String defaultValue) [CALLS-EXTERNAL] Integer.parseInt/1, Integer.toString/1 */...
true
ok
{"focal": {"class": "ConfigUtils", "name": "getIntValue", "signature": "int getIntValue(Properties props, String key, int defaultValue)", "start_line": 3, "modifiers": "public", "params": [{"name": "props", "type": "Properties"}, {"name": "key", "type": "String"}, {"name": "defaultValue", "type": "int"}], "return_type"...
19454960_0
class RewindableReader extends Reader { public int read(char[] cbuf, int off, int len) throws IOException { int charactersRead = wrappedReader.read(cbuf, off, len); if (charactersRead > 0) { if (rewindable && pos + charactersRead > buffer.length) { rewindable = false; } if (pos < ...
reader = newReaderInstance(EXAMPLE_INPUT_STRING, DEFAULT_BUFFER_SIZE); char[] buffer = new char[5]; reader.read(buffer); assertThat(SpinIoUtil.getStringFromReader(reader)).isEqualTo(EXAMPLE_INPUT_STRING.substring(5)); } }
[FOCAL] public int RewindableReader.read(char[] cbuf, int off, int len) [CLASS] class RewindableReader extends Reader [METRICS] loc=18 cc=4 branches=3 loops=0 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] wrappedReader.read/3, Math.min/2, System.arraycopy/5 [EXCEPTIONS] declares IOException [PATH1] if(charactersRead > ...
/* static context [FOCAL] public int RewindableReader.read(char[] cbuf, int off, int len) [PATH1] if(charactersRead > 0)=T -> if(rewindable && pos + charactersRead > buffer.length)=T -> if(pos < buffer.length)=T -> return charactersRead [PATH2] if(charactersRead > 0)=T -> if(rewindable && pos + charactersRead > buffer....
/* static context [FOCAL] public int RewindableReader.read(char[] cbuf, int off, int len) [PATH1] if(charactersRead > 0)=T -> if(rewindable && pos + charactersRead > buffer.length)=T -> if(pos < buffer.length)=T -> return charactersRead [PATH2] if(charactersRead > 0)=T -> if(rewindable && pos + charactersRead > buffer....
true
ok
{"focal": {"class": "RewindableReader", "name": "read", "signature": "int read(char[] cbuf, int off, int len) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "cbuf", "type": "char[]"}, {"name": "off", "type": "int"}, {"name": "len", "type": "int"}], "return_type": "int"}, "class_info": ...
19458722_0
class WXBizDataCrypt { public JSONObject decryptData(final String encryptedData, final String iv) { final byte[] aesKey = Base64.decodeBase64(sessionKey); final byte[] aesCipher = Base64.decodeBase64(encryptedData); final byte[] aesIV = Base64.decodeBase64(iv); final byte[] decryptedBytes = AESUtils.decrypt(...
String appId = "wx4f4bc4dec97d474b"; String sessionKey = "tiihtNczf5v6AKRyjwEUhQ=="; WXBizDataCrypt biz = new WXBizDataCrypt(appId, sessionKey); String encryptedData = "CiyLU1Aw2KjvrjMdj8YKliAjtP4gsMZM" + "QmRzooG2xrDcvSnxIMXFufNstNGTyaGS" + "9uT5geRa0W4oTOb1WT7fJlAC+oNPdbB+" + "3hVbJSRgv+4lGOETKU...
[FOCAL] public JSONObject WXBizDataCrypt.decryptData(String encryptedData, String iv) [CLASS] class WXBizDataCrypt [METRICS] loc=16 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] Base64.decodeBase64/1, AESUtils.decrypt/3, Charset.forName/1, JSON.parseObject/1, decrypted.getJSONObject("watermark")...
/* static context [FOCAL] public JSONObject WXBizDataCrypt.decryptData(String encryptedData, String iv) [THROWS-WHEN] IllegalArgumentException when !appId.equals(this.appid) [PATH1] if(!appId.equals(this.appid))=T -> throw new IllegalArgumentException("Invalid Buffer") [PATH2] if(!appId.equals(this.appid))=F -> return ...
/* static context [FOCAL] public JSONObject WXBizDataCrypt.decryptData(String encryptedData, String iv) [THROWS-WHEN] IllegalArgumentException when !appId.equals(this.appid) [PATH1] if(!appId.equals(this.appid))=T -> throw new IllegalArgumentException("Invalid Buffer") [PATH2] if(!appId.equals(this.appid))=F -> return ...
true
ok
{"focal": {"class": "WXBizDataCrypt", "name": "decryptData", "signature": "JSONObject decryptData(String encryptedData, String iv)", "start_line": 3, "modifiers": "public", "params": [{"name": "encryptedData", "type": "String"}, {"name": "iv", "type": "String"}], "return_type": "JSONObject"}, "class_info": {"name": "WX...
19480672_1
class StringTransforms { public static String trim(String input, final String toTrim) { if (input == null) return null; Preconditions.checkNotNull(toTrim); input = input.trim(); while (!input.isEmpty() && input.length() >= toTrim.length() && input.startsWith(toTrim)) input = input.substri...
final String input = " 111hello11 "; final String trimmed = StringTransforms.trim(input, "2"); Assert.assertEquals("111hello11", trimmed); } }
[FOCAL] public static String StringTransforms.trim(String input, String toTrim) [CLASS] class StringTransforms [METRICS] loc=19 cc=4 branches=1 loops=2 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] Preconditions.checkNotNull/1, String.trim/0, String.isEmpty/0, String.length/0, String.startsWith/1, String.substring/2, S...
/* static context [FOCAL] public static String StringTransforms.trim(String input, String toTrim) [PATH1] if(input == null)=F -> while(!input.isEmpty() && input.length() >= toTrim.length() && input.startsWith(toTrim))=T -> exit loop -> while(!input.isEmpty() && input.length() >= toTrim.length() && input.endsWith(toTrim...
/* static context [FOCAL] public static String StringTransforms.trim(String input, String toTrim) [PATH1] if(input == null)=F -> while(!input.isEmpty() && input.length() >= toTrim.length() && input.startsWith(toTrim))=T -> exit loop -> while(!input.isEmpty() && input.length() >= toTrim.length() && input.endsWith(toTrim...
true
ok
{"focal": {"class": "StringTransforms", "name": "trim", "signature": "String trim(String input, String toTrim)", "start_line": 3, "modifiers": "public static", "params": [{"name": "input", "type": "String"}, {"name": "toTrim", "type": "String"}], "return_type": "String"}, "class_info": {"name": "StringTransforms", "kin...
19481229_1
class DirectTupleSchema extends TupleSchema { public long createRecord() { return unsafe.allocateMemory(byteSize); } public DirectTupleSchema(Builder builder); public long getLong(long address, int index); public int getInt(long address, int index); public short getShort(long address...
DirectTupleSchema schema = TupleSchema.builder(). addField("aByte", Byte.TYPE). addField("aChar", Character.TYPE). addField("aInt", Integer.TYPE). addField("aShort", Short.TYPE). addField("aFloat", Float.TYPE). addFi...
[FOCAL] public long DirectTupleSchema.createRecord() [CLASS] class DirectTupleSchema extends TupleSchema [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] unsafe.allocateMemory/1 [COLLABORATORS] field unsafe allocateMemory/1 [CLASS-MEMBERS] DirectTupleSchema(Builder builder); long ge...
/* static context [FOCAL] public long DirectTupleSchema.createRecord() [COLLABORATORS] field unsafe allocateMemory/1 [CALLS-EXTERNAL] unsafe.allocateMemory/1 */
/* static context [FOCAL] public long DirectTupleSchema.createRecord() [COLLABORATORS] field unsafe allocateMemory/1 [CALLS-EXTERNAL] unsafe.allocateMemory/1 */ class DirectTupleSchema extends TupleSchema { public long createRecord() { return unsafe.allocateMemory(byteSize); } public DirectTupleS...
true
ok
{"focal": {"class": "DirectTupleSchema", "name": "createRecord", "signature": "long createRecord()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "long"}, "class_info": {"name": "DirectTupleSchema", "kind": "class", "modifiers": "", "superclass": "TupleSchema", "interfaces": null, "fields": [], ...
19537685_13
class WarpAutenticationManager { public void removeUser(String userName) throws CommunicationException { try { WebResource webResource = createRequestResource( "users/" + userName); webResource.delete(); } catch (UniformInterfaceException t) { ...
context.checking( new Expectations() { { oneOf(client).removeAllFilters(); oneOf(client).addFilter( with(equal(new BasicAuthFilter("admin", "lamepass")))); oneOf(client).re...
[FOCAL] public void WarpAutenticationManager.removeUser(String userName) [CLASS] class WarpAutenticationManager [METRICS] loc=10 cc=2 branches=0 loops=0 returns=0 throws=1 nesting=1 [CALLS-INTERNAL] WebResource createRequestResource(String resource) [CALLS-EXTERNAL] WebResource.delete/0 [NEW] CommunicationException [EX...
/* static context [FOCAL] public void WarpAutenticationManager.removeUser(String userName) [THROWS-WHEN] CommunicationException when try-body throws [PATH1] try-body throws -> throw new CommunicationException( "Exception when executing DELETE user: ... [INPUTS] branches=- | result=userName [EXCEPTIONS] declares Communi...
/* static context [FOCAL] public void WarpAutenticationManager.removeUser(String userName) [THROWS-WHEN] CommunicationException when try-body throws [PATH1] try-body throws -> throw new CommunicationException( "Exception when executing DELETE user: ... [INPUTS] branches=- | result=userName [EXCEPTIONS] declares Communi...
true
ok
{"focal": {"class": "WarpAutenticationManager", "name": "removeUser", "signature": "void removeUser(String userName) throws CommunicationException", "start_line": 3, "modifiers": "public", "params": [{"name": "userName", "type": "String"}], "return_type": "void"}, "class_info": {"name": "WarpAutenticationManager", "kin...
19547790_0
class TimberLoggerAdapter extends MarkerIgnoringBase { @Override public void debug(String msg) { log(LogType.DEBUG, msg, null); } TimberLoggerAdapter(String tag); @Override public boolean isTraceEnabled(); @Override public void trace(String msg); @Override public void trace(String format, Object ...
Timber.plant(new Timber.DebugTree()); logger.debug("Hello, world!"); List<LogItem> logs = ShadowLog.getLogs(); assertThat(logs).hasSize(1); LogItem log = logs.get(0); assertThat(log.type).isEqualTo(Log.DEBUG); assertThat(log.tag).isEqualTo("TimberLoggerAdapterTest"); assertThat(log.msg...
[FOCAL] @Override public void TimberLoggerAdapter.debug(String msg) [CLASS] class TimberLoggerAdapter extends MarkerIgnoringBase [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void log(LogType logType, String message, Throwable throwable) [DATAFLOW] msg@param->L3 [CLASS-MEMBERS] T...
/* static context [FOCAL] @Override public void TimberLoggerAdapter.debug(String msg) [CALLS-INTERNAL] void log(LogType logType, String message, Throwable throwable) */
/* static context [FOCAL] @Override public void TimberLoggerAdapter.debug(String msg) [CALLS-INTERNAL] void log(LogType logType, String message, Throwable throwable) */ class TimberLoggerAdapter extends MarkerIgnoringBase { @Override public void debug(String msg) { log(LogType.DEBUG, msg, null); } Timbe...
true
ok
{"focal": {"class": "TimberLoggerAdapter", "name": "debug", "signature": "void debug(String msg)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "msg", "type": "String"}], "return_type": "void"}, "class_info": {"name": "TimberLoggerAdapter", "kind": "class", "modifiers": "", "superclass": "Marke...
19551343_0
class SocketAddressParser { public static InetSocketAddress parse(String str) { String address, port; if (str.startsWith("[")) { int addressEnd = str.indexOf(']'); if (addressEnd == -1) throw new IllegalArgumentException(); if ((addressEnd + 2) > str.length()) throw new IllegalArgumentException...
InetSocketAddress address = SocketAddressParser.parse("198.51.100.1:443"); assertEquals(new InetSocketAddress("198.51.100.1", 443), address); } }
[FOCAL] public static InetSocketAddress SocketAddressParser.parse(String str) [CLASS] class SocketAddressParser [METRICS] loc=27 cc=6 branches=5 loops=0 returns=1 throws=4 nesting=2 [CALLS-EXTERNAL] String.startsWith/1, String.indexOf/1, String.length/0, String.substring/2, String.charAt/1, String.substring/1, String.s...
/* static context [FOCAL] public static InetSocketAddress SocketAddressParser.parse(String str) [THROWS-WHEN] IllegalArgumentException when str.startsWith("[") && addressEnd == -1 [THROWS-WHEN] IllegalArgumentException when str.startsWith("[") && !(addressEnd == -1) && (addressEnd + 2) > str.length() [THROWS-WHEN] Ille...
/* static context [FOCAL] public static InetSocketAddress SocketAddressParser.parse(String str) [THROWS-WHEN] IllegalArgumentException when str.startsWith("[") && addressEnd == -1 [THROWS-WHEN] IllegalArgumentException when str.startsWith("[") && !(addressEnd == -1) && (addressEnd + 2) > str.length() [THROWS-WHEN] Ille...
true
ok
{"focal": {"class": "SocketAddressParser", "name": "parse", "signature": "InetSocketAddress parse(String str)", "start_line": 3, "modifiers": "public static", "params": [{"name": "str", "type": "String"}], "return_type": "InetSocketAddress"}, "class_info": {"name": "SocketAddressParser", "kind": "class", "modifiers": "...
19576190_8
class LQEvent extends LQModel { public static boolean hasValidName(String name, boolean raiseException) { boolean valid = name == null || name.length() == 0 || (name.charAt(0) != '_' && !name.contains("$") && !name.contains(".") && !name.contains("\0")); if(!valid) { LiquidTools.excepti...
assertFalse( "Event name with \0", LQEvent.hasValidName("_custom_\0event", false) ); } }
[FOCAL] public static boolean LQEvent.hasValidName(String name, boolean raiseException) [CLASS] class LQEvent extends LQModel [METRICS] loc=7 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] String.length/0, String.charAt/1, String.contains/1, LiquidTools.exceptionOrLog/2 [PATH1] if(!valid)=T -> re...
/* static context [FOCAL] public static boolean LQEvent.hasValidName(String name, boolean raiseException) [PATH1] if(!valid)=T -> return valid [PATH2] if(!valid)=F -> return valid [INPUTS] branches=name | result=name [CALLS-EXTERNAL] String.length/0, String.charAt/1, String.contains/1, LiquidTools.exceptionOrLog/2 */
/* static context [FOCAL] public static boolean LQEvent.hasValidName(String name, boolean raiseException) [PATH1] if(!valid)=T -> return valid [PATH2] if(!valid)=F -> return valid [INPUTS] branches=name | result=name [CALLS-EXTERNAL] String.length/0, String.charAt/1, String.contains/1, LiquidTools.exceptionOrLog/2 */ c...
true
ok
{"focal": {"class": "LQEvent", "name": "hasValidName", "signature": "boolean hasValidName(String name, boolean raiseException)", "start_line": 3, "modifiers": "public static", "params": [{"name": "name", "type": "String"}, {"name": "raiseException", "type": "boolean"}], "return_type": "boolean"}, "class_info": {"name":...
19603587_1
class CodeCompleter { public List<CodeCompletionHint> complete(String incompletePath) { List<CodeCompletionHint> hints = new ArrayList<CodeCompletionHint>(); String objectPath = null; String prefix = null; String lastDelimiter = null; int lastSplit = splitter.lastSplit(incompletePath); if ...
List<CodeCompletionHint> hints = completer.complete("runtimeService.signalEventR"); Assert.assertEquals(4, hints.size()); } }
[FOCAL] public List<CodeCompletionHint> CodeCompleter.complete(String incompletePath) [CLASS] class CodeCompleter [METRICS] loc=27 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] List<Class<?>> resolveTypes(String[] path); List<CodeCompletionHint> completeForTypes(List<Class<?>> types, String pref...
/* static context [FOCAL] public List<CodeCompletionHint> CodeCompleter.complete(String incompletePath) [PATH1] if(lastSplit == -1)=T -> if(objectPath == null)=T -> return hints [PATH2] if(lastSplit == -1)=F -> if(objectPath == null)=F -> return hints [INPUTS] branches=incompletePath | result=incompletePath [COLLABORAT...
/* static context [FOCAL] public List<CodeCompletionHint> CodeCompleter.complete(String incompletePath) [PATH1] if(lastSplit == -1)=T -> if(objectPath == null)=T -> return hints [PATH2] if(lastSplit == -1)=F -> if(objectPath == null)=F -> return hints [INPUTS] branches=incompletePath | result=incompletePath [COLLABORAT...
true
ok
{"focal": {"class": "CodeCompleter", "name": "complete", "signature": "List<CodeCompletionHint> complete(String incompletePath)", "start_line": 3, "modifiers": "public", "params": [{"name": "incompletePath", "type": "String"}], "return_type": "List<CodeCompletionHint>"}, "class_info": {"name": "CodeCompleter", "kind": ...
19624760_12
class Tracks { public static Track reverse(Track track) { Track view = reverseView(track); return new DefaultTrack(view.getId(), view.getMetadata(), track.getWaypoints(), view.getSegments(), view.getStatistics()); } private Tracks(); public static LinkedTrackPoint getStartPoint(Track track); public sta...
Track track = toDefault(loadTrack()); Track rev1 = Tracks.reverse(track); Track rev2 = Tracks.reverse(rev1); assertEquals(track, rev2); } }
[FOCAL] public static Track Tracks.reverse(Track track) [CLASS] class Tracks [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Track reverseView(Track track) [CALLS-EXTERNAL] Track.getId/0, Track.getMetadata/0, Track.getWaypoints/0, Track.getSegments/0, Track.getStatistics/0 [NEW] De...
/* static context [FOCAL] public static Track Tracks.reverse(Track track) [INPUTS] branches=- | result=track [COLLABORATORS] param track:Track getWaypoints/0 [CALLS-INTERNAL] Track reverseView(Track track) [NEW] DefaultTrack [CALLS-EXTERNAL] Track.getId/0, Track.getMetadata/0, Track.getWaypoints/0, Track.getSegments/0,...
/* static context [FOCAL] public static Track Tracks.reverse(Track track) [INPUTS] branches=- | result=track [COLLABORATORS] param track:Track getWaypoints/0 [CALLS-INTERNAL] Track reverseView(Track track) [NEW] DefaultTrack [CALLS-EXTERNAL] Track.getId/0, Track.getMetadata/0, Track.getWaypoints/0, Track.getSegments/0,...
true
ok
{"focal": {"class": "Tracks", "name": "reverse", "signature": "Track reverse(Track track)", "start_line": 3, "modifiers": "public static", "params": [{"name": "track", "type": "Track"}], "return_type": "Track"}, "class_info": {"name": "Tracks", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "...
19628709_8
class TaxTransferer { public void transferTaxFor(Person person) { if (person == null) { taxService.sendErrorReport(); return; } taxService.transferTaxFor(person); } public TaxTransferer(TaxService taxService); @Mock TaxService taxService; @InjectMo...
// when systemUnderTest.transferTaxFor(null); // then verify(taxService).sendErrorReport(); verifyNoMoreInteractions(taxService); } }
[FOCAL] public void TaxTransferer.transferTaxFor(Person person) [CLASS] class TaxTransferer [METRICS] loc=7 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] TaxService.sendErrorReport/0, TaxService.transferTaxFor/1 [FIELDS] read=taxService:TaxService [PATH1] if(person == null)=T -> return [PATH2] i...
/* static context [FOCAL] public void TaxTransferer.transferTaxFor(Person person) [PATH1] if(person == null)=T -> return [PATH2] if(person == null)=F [INPUTS] branches=person | result=- [COLLABORATORS] field taxService:TaxService sendErrorReport/0,transferTaxFor/1 [FIELDS] read=taxService:TaxService [CALLS-EXTERNAL] Ta...
/* static context [FOCAL] public void TaxTransferer.transferTaxFor(Person person) [PATH1] if(person == null)=T -> return [PATH2] if(person == null)=F [INPUTS] branches=person | result=- [COLLABORATORS] field taxService:TaxService sendErrorReport/0,transferTaxFor/1 [FIELDS] read=taxService:TaxService [CALLS-EXTERNAL] Ta...
true
ok
{"focal": {"class": "TaxTransferer", "name": "transferTaxFor", "signature": "void transferTaxFor(Person person)", "start_line": 3, "modifiers": "public", "params": [{"name": "person", "type": "Person"}], "return_type": "void"}, "class_info": {"name": "TaxTransferer", "kind": "class", "modifiers": "", "superclass": null...
19634578_0
class SSTableIndexIndexer { public void index(final Path sstablePath) throws IOException { final FileSystem fileSystem = FileSystem.get(URI.create(sstablePath.toString()), configuration); final FileStatus fileStatus = fileSystem.getFileStatus(sstablePath); if (fileStatus.isDir()) { ...
// Create a temp dir... final File tmpDir = Files.createTempDir(); tmpDir.deleteOnExit(); // Copy the .Index.db file to the temp dir... File sampleFile = new File(getClass().getResource(INDEX_FILE).getFile()); File tmpSampleFile = new File(tmpDir, sampleFile.getName());...
[FOCAL] public void SSTableIndexIndexer.index(Path sstablePath) [CLASS] class SSTableIndexIndexer [METRICS] loc=58 cc=5 branches=3 loops=1 returns=0 throws=0 nesting=4 [CALLS-INTERNAL] void indexSingleFile(FileSystem fileSystem, Path sstablePath) [CALLS-EXTERNAL] FileSystem.get/2, URI.create/1, Path.toString/0, FileSys...
/* static context [FOCAL] public void SSTableIndexIndexer.index(Path sstablePath) [PATH1] if(fileStatus.isDir())=T -> foreach(FileStatus childStatus : statuses)=T -> exit loop [PATH2] if(fileStatus.isDir())=F -> if(sstablePath.toString().endsWith(SST_EXTENSION))=T -> if(fileSystem.exists(sstableIndexPath))=T [PATH3] if...
/* static context [FOCAL] public void SSTableIndexIndexer.index(Path sstablePath) [PATH1] if(fileStatus.isDir())=T -> foreach(FileStatus childStatus : statuses)=T -> exit loop [PATH2] if(fileStatus.isDir())=F -> if(sstablePath.toString().endsWith(SST_EXTENSION))=T -> if(fileSystem.exists(sstableIndexPath))=T [PATH3] if...
true
ok
{"focal": {"class": "SSTableIndexIndexer", "name": "index", "signature": "void index(Path sstablePath) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "sstablePath", "type": "Path"}], "return_type": "void"}, "class_info": {"name": "SSTableIndexIndexer", "kind": "class", "modifiers": "",...
19638422_1129
class TelemetryCommonConfigService { @VisibleForTesting void resolveLogPathReferences(Telemetry telemetry, List<VmLog> logs) { Map<String, Object> fluentAttributes = telemetry.getFluentAttributes(); if (CollectionUtils.isNotEmpty(logs)) { Properties props = new Properties(); ...
// GIVEN Telemetry telemetry = new Telemetry(); Map<String, Object> fluentAttributes = new HashMap<>(); fluentAttributes.put(SERVICE_LOG_FOLDER_PREFIX, "/var/log"); fluentAttributes.put(SERVER_LOG_FOLDER_PREFIX, "/custom/log"); fluentAttributes.put(AGENT_LOG_FOLDER_PREFIX...
[FOCAL] @VisibleForTesting void TelemetryCommonConfigService.resolveLogPathReferences(Telemetry telemetry, List<VmLog> logs) [CLASS] class TelemetryCommonConfigService [METRICS] loc=15 cc=3 branches=1 loops=1 returns=0 throws=0 nesting=2 [CALLS-EXTERNAL] Telemetry.getFluentAttributes/0, CollectionUtils.isNotEmpty/1, Pr...
/* static context [FOCAL] @VisibleForTesting void TelemetryCommonConfigService.resolveLogPathReferences(Telemetry telemetry, List<VmLog> logs) [PATH1] if(CollectionUtils.isNotEmpty(logs))=T -> foreach(VmLog log : logs)=T -> exit loop [PATH2] if(CollectionUtils.isNotEmpty(logs))=F [PATH3] if(CollectionUtils.isNotEmpty(l...
/* static context [FOCAL] @VisibleForTesting void TelemetryCommonConfigService.resolveLogPathReferences(Telemetry telemetry, List<VmLog> logs) [PATH1] if(CollectionUtils.isNotEmpty(logs))=T -> foreach(VmLog log : logs)=T -> exit loop [PATH2] if(CollectionUtils.isNotEmpty(logs))=F [PATH3] if(CollectionUtils.isNotEmpty(l...
true
ok
{"focal": {"class": "TelemetryCommonConfigService", "name": "resolveLogPathReferences", "signature": "void resolveLogPathReferences(Telemetry telemetry, List<VmLog> logs)", "start_line": 3, "modifiers": "@VisibleForTesting", "params": [{"name": "telemetry", "type": "Telemetry"}, {"name": "logs", "type": "List<VmLog>"}]...
19668829_0
class ArrayInputStream implements BufferedInputStream { @Override public final int read(ByteBuffer dst) throws IOException { int available = this.buf.remaining(); int size = java.lang.Math.min(dst.remaining(), available); if (size == 0) { // end of stream return ...
ArrayInputStream stream = new ArrayInputStream(ByteBuffer.allocate(0)); ByteBuffer dst = ByteBuffer.allocate(10); // read() should return -1 at the end of the stream // https://docs.oracle.com/javase/7/docs/api/java/nio/channels/ReadableByteChannel.html Assert.assertEquals(stream.read(dst), -1); ...
[FOCAL] @Override public final int ArrayInputStream.read(ByteBuffer dst) [CLASS] class ArrayInputStream implements BufferedInputStream [METRICS] loc=16 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] this.buf.remaining/0, java.lang.Math.min/2, ByteBuffer.remaining/0, this.buf.slice/0, ByteBuffer.l...
/* static context [FOCAL] @Override public final int ArrayInputStream.read(ByteBuffer dst) [PATH1] if(size == 0)=T -> return -1 [PATH2] if(size == 0)=F -> return size [INPUTS] branches=dst | result=dst [COLLABORATORS] field buf remaining/0,slice/0,position/1,position/0; param dst:ByteBuffer remaining/0,put/1 [EXCEPTION...
/* static context [FOCAL] @Override public final int ArrayInputStream.read(ByteBuffer dst) [PATH1] if(size == 0)=T -> return -1 [PATH2] if(size == 0)=F -> return size [INPUTS] branches=dst | result=dst [COLLABORATORS] field buf remaining/0,slice/0,position/1,position/0; param dst:ByteBuffer remaining/0,put/1 [EXCEPTION...
true
ok
{"focal": {"class": "ArrayInputStream", "name": "read", "signature": "int read(ByteBuffer dst) throws IOException", "start_line": 3, "modifiers": "@Override public final", "params": [{"name": "dst", "type": "ByteBuffer"}], "return_type": "int"}, "class_info": {"name": "ArrayInputStream", "kind": "class", "modifiers": "...
19685642_1
class ThrowErrorTree extends Timber.Tree { @Override protected boolean isLoggable(int priority) { return priority >= mLogPriority; } public ThrowErrorTree(); public ThrowErrorTree(int logPriority); public ThrowErrorTree(int logPriority, LogExclusionStrategy logExclusionStrategy); ...
ThrowErrorTree tree = new ThrowErrorTree(); assertTrue(tree.isLoggable(Log.ERROR)); assertFalse(tree.isLoggable(Log.WARN)); tree = new ThrowErrorTree(Log.INFO); assertTrue(tree.isLoggable(Log.INFO)); assertFalse(tree.isLoggable(Log.DEBUG)); } }
[FOCAL] @Override protected boolean ThrowErrorTree.isLoggable(int priority) [CLASS] class ThrowErrorTree extends Timber.Tree [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [INPUTS] branches=- | result=priority [DATAFLOW] priority@param->L3 [CLASS-MEMBERS] ThrowErrorTree(); ThrowErrorTree(int logPr...
/* static context [FOCAL] @Override protected boolean ThrowErrorTree.isLoggable(int priority) [INPUTS] branches=- | result=priority */
/* static context [FOCAL] @Override protected boolean ThrowErrorTree.isLoggable(int priority) [INPUTS] branches=- | result=priority */ class ThrowErrorTree extends Timber.Tree { @Override protected boolean isLoggable(int priority) { return priority >= mLogPriority; } public ThrowErrorTree(); ...
true
ok
{"focal": {"class": "ThrowErrorTree", "name": "isLoggable", "signature": "boolean isLoggable(int priority)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "priority", "type": "int"}], "return_type": "boolean"}, "class_info": {"name": "ThrowErrorTree", "kind": "class", "modifiers": "", "superc...
19688946_30
class MessageBroker extends ManageableComponent { public void addFactory(String id, FlexFactory factory) { if (id == null) { // Cannot add ''{0}'' with null id to the ''{1}'' ConfigurationException ex = new ConfigurationException(); ex.setMessage(Configuratio...
String id = "java"; JavaFactory expected = new JavaFactory(); try { broker.addFactory(id, expected); Assert.fail("ConfigurationException expected"); } catch (ConfigurationException ce) { int error = ConfigurationConstants.DUPLICATE_COMPONENT_ID; ...
[FOCAL] public void MessageBroker.addFactory(String id, FlexFactory factory) [CLASS] class MessageBroker extends ManageableComponent [METRICS] loc=24 cc=4 branches=3 loops=0 returns=1 throws=2 nesting=1 [CALLS-INTERNAL] FlexFactory getFactory(String id) [CALLS-EXTERNAL] ConfigurationException.setMessage/2, factories.pu...
/* static context [FOCAL] public void MessageBroker.addFactory(String id, FlexFactory factory) [THROWS-WHEN] ex when id == null [THROWS-WHEN] ex when !(id == null) && !(getFactory(id) == factory) && getFactory(id) != null [PATH2] if(id == null)=F -> if(getFactory(id) == factory)=T -> return */
/* static context [FOCAL] public void MessageBroker.addFactory(String id, FlexFactory factory) [THROWS-WHEN] ex when id == null [THROWS-WHEN] ex when !(id == null) && !(getFactory(id) == factory) && getFactory(id) != null [PATH2] if(id == null)=F -> if(getFactory(id) == factory)=T -> return */ class MessageBroker exten...
true
ok
{"focal": {"class": "MessageBroker", "name": "addFactory", "signature": "void addFactory(String id, FlexFactory factory)", "start_line": 3, "modifiers": "public", "params": [{"name": "id", "type": "String"}, {"name": "factory", "type": "FlexFactory"}], "return_type": "void"}, "class_info": {"name": "MessageBroker", "ki...
19691579_63
class CourseDAO { public void setCourses(List<Course> courses) { this.courses = courses; dataSource.save(courses); } public CourseDAO(DataSource<Course> dataSource); public void loadCourses(); public List<Course> getCourses(); public void updateCourse(Course course); publ...
List<Course> l = new ArrayList<>(); l.add(new Course("aaa")); dao.setCourses(l); assertEquals(1, dao.getCourses().size()); } }
[FOCAL] public void CourseDAO.setCourses(List<Course> courses) [CLASS] class CourseDAO [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] dataSource.save/1 [FIELDS] write=courses [COLLABORATORS] field dataSource save/1 [STATE] courses via getCourses() [DATAFLOW] courses@param->L2,L3 [...
/* static context [FOCAL] public void CourseDAO.setCourses(List<Course> courses) [COLLABORATORS] field dataSource save/1 [STATE] courses via getCourses() [FIELDS] write=courses [CALLS-EXTERNAL] dataSource.save/1 */
/* static context [FOCAL] public void CourseDAO.setCourses(List<Course> courses) [COLLABORATORS] field dataSource save/1 [STATE] courses via getCourses() [FIELDS] write=courses [CALLS-EXTERNAL] dataSource.save/1 */ class CourseDAO { public void setCourses(List<Course> courses) { this.courses = courses; ...
true
ok
{"focal": {"class": "CourseDAO", "name": "setCourses", "signature": "void setCourses(List<Course> courses)", "start_line": 3, "modifiers": "public", "params": [{"name": "courses", "type": "List<Course>"}], "return_type": "void"}, "class_info": {"name": "CourseDAO", "kind": "class", "modifiers": "", "superclass": null, ...
19715233_2
class BulldogUtil { public static String bytesToString(byte[] bytes, String encoding) { if(bytes == null) { throw new IllegalArgumentException("bytes may not be null in string conversion"); } if(bytes.length == 0) { return null; } try { return new String(bytes, encoding); } catch (Exception e) { ...
String string = BulldogUtil.bytesToString("Hello World".getBytes("ASCII")); TestCase.assertEquals("Hello World", string); string = BulldogUtil.bytesToString("Hello World".getBytes()); TestCase.assertEquals("Hello World", string); string = BulldogUtil.bytesToString(new byte[] {}); TestCase.assertNull(s...
[FOCAL] public static String BulldogUtil.bytesToString(byte[] bytes, String encoding) [CLASS] class BulldogUtil [METRICS] loc=13 cc=4 branches=2 loops=0 returns=2 throws=2 nesting=1 [NEW] IllegalArgumentException, String [EXCEPTIONS] throws IllegalArgumentException; catches Exception e [THROWS-WHEN] IllegalArgumentExce...
/* static context [FOCAL] public static String BulldogUtil.bytesToString(byte[] bytes, String encoding) [THROWS-WHEN] IllegalArgumentException when bytes == null [THROWS-WHEN] IllegalArgumentException when !(bytes == null) && !(bytes.length == 0) && try-body throws [PATH1] if(bytes == null)=F -> if(bytes.length == 0)=F...
/* static context [FOCAL] public static String BulldogUtil.bytesToString(byte[] bytes, String encoding) [THROWS-WHEN] IllegalArgumentException when bytes == null [THROWS-WHEN] IllegalArgumentException when !(bytes == null) && !(bytes.length == 0) && try-body throws [PATH1] if(bytes == null)=F -> if(bytes.length == 0)=F...
true
ok
{"focal": {"class": "BulldogUtil", "name": "bytesToString", "signature": "String bytesToString(byte[] bytes, String encoding)", "start_line": 3, "modifiers": "public static", "params": [{"name": "bytes", "type": "byte[]"}, {"name": "encoding", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Bulldo...
19733248_1
class UnpublishDocument { @OperationMethod(collector = DocumentModelCollector.class) public DocumentModel run(DocumentModel input) { DocumentModelList proxies = session.getProxies(input.getRef(), null); for (DocumentModel proxy : proxies) { session.removeDocument(proxy.getRef()); ...
OperationContext ctx = new OperationContext(session); ctx.setInput(fileToPublish); OperationChain chain = new OperationChain("testpublish"); chain.add(FetchContextDocument.ID); chain.add(PublishDocument.ID).set("target",section.getId()); DocumentModel publishedDoc = (Docu...
[FOCAL] @OperationMethod(collector = DocumentModelCollector.class) public DocumentModel UnpublishDocument.run(DocumentModel input) [CLASS] class UnpublishDocument [METRICS] loc=9 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] CoreSession.getProxies/2, DocumentModel.getRef/0, CoreSession.removeDoc...
/* static context [FOCAL] @OperationMethod(collector = DocumentModelCollector.class) public DocumentModel UnpublishDocument.run(DocumentModel input) [PATH1] foreach(DocumentModel proxy : proxies)=T -> exit loop -> return null [PATH2] foreach(DocumentModel proxy : proxies)=F -> return null [INPUTS] branches=input, sessi...
/* static context [FOCAL] @OperationMethod(collector = DocumentModelCollector.class) public DocumentModel UnpublishDocument.run(DocumentModel input) [PATH1] foreach(DocumentModel proxy : proxies)=T -> exit loop -> return null [PATH2] foreach(DocumentModel proxy : proxies)=F -> return null [INPUTS] branches=input, sessi...
true
ok
{"focal": {"class": "UnpublishDocument", "name": "run", "signature": "DocumentModel run(DocumentModel input)", "start_line": 3, "modifiers": "@OperationMethod(collector = DocumentModelCollector.class) public", "params": [{"name": "input", "type": "DocumentModel"}], "return_type": "DocumentModel"}, "class_info": {"name"...
19739444_17
class HandlebarsTemplateEngine extends TemplateEngine { @Override public String render(ModelAndView modelAndView) { String viewName = modelAndView.getViewName(); try { Template template = handlebars.compile(viewName); return template.apply(modelAndView.getModel()); ...
String templateVariable = "Hello Handlebars!"; Map<String, Object> model = new HashMap<>(); model.put("message", templateVariable); String expected = String.format("<h1>%s</h1>", templateVariable); String actual = new HandlebarsTemplateEngine().render(new ModelAndView(model, "hel...
[FOCAL] @Override public String HandlebarsTemplateEngine.render(ModelAndView modelAndView) [CLASS] class HandlebarsTemplateEngine extends TemplateEngine [METRICS] loc=10 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] ModelAndView.getViewName/0, handlebars.compile/1, Template.apply/1, ModelAndView...
/* static context [FOCAL] @Override public String HandlebarsTemplateEngine.render(ModelAndView modelAndView) [THROWS-WHEN] RuntimeIOException when try-body throws [PATH1] try-body throws -> throw new RuntimeIOException(e) [PATH2] return template.apply(modelAndView.getModel()) [INPUTS] branches=- | result=modelAndView [...
/* static context [FOCAL] @Override public String HandlebarsTemplateEngine.render(ModelAndView modelAndView) [THROWS-WHEN] RuntimeIOException when try-body throws [PATH1] try-body throws -> throw new RuntimeIOException(e) [PATH2] return template.apply(modelAndView.getModel()) [INPUTS] branches=- | result=modelAndView [...
true
ok
{"focal": {"class": "HandlebarsTemplateEngine", "name": "render", "signature": "String render(ModelAndView modelAndView)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "modelAndView", "type": "ModelAndView"}], "return_type": "String"}, "class_info": {"name": "HandlebarsTemplateEngine", "kind": ...
19746703_106
class LatLong implements Comparable<LatLong>, Serializable { @Override public int compareTo(LatLong latLong) { if (this.longitude > latLong.longitude) { return 1; } else if (this.longitude < latLong.longitude) { return -1; } else if (this.latitude > latLong.latitude) { return 1; } else if (this.lati...
LatLong latLong1 = new LatLong(LATITUDE, LONGITUDE); LatLong latLong2 = new LatLong(LATITUDE, LONGITUDE); LatLong latLong3 = new LatLong(LATITUDE, LATITUDE); LatLong latLong4 = new LatLong(LONGITUDE, LONGITUDE); Assert.assertEquals(0, latLong1.compareTo(latLong2)); TestUtils.notCompareToTest(latLong1, lat...
[FOCAL] @Override public int LatLong.compareTo(LatLong latLong) [CLASS] class LatLong implements Comparable<LatLong>, Serializable [METRICS] loc=13 cc=5 branches=4 loops=0 returns=5 throws=0 nesting=4 [FIELDS] read=latitude, longitude [PATH1] if(this.longitude > latLong.longitude)=F -> if(this.longitude < latLong.longi...
/* static context [FOCAL] @Override public int LatLong.compareTo(LatLong latLong) [PATH1] if(this.longitude > latLong.longitude)=F -> if(this.longitude < latLong.longitude)=F -> if(this.latitude > latLong.latitude)=F -> if(this.latitude < latLong.latitude)=T -> return -1 [PATH2] if(this.longitude > latLong.longitude)=T...
/* static context [FOCAL] @Override public int LatLong.compareTo(LatLong latLong) [PATH1] if(this.longitude > latLong.longitude)=F -> if(this.longitude < latLong.longitude)=F -> if(this.latitude > latLong.latitude)=F -> if(this.latitude < latLong.latitude)=T -> return -1 [PATH2] if(this.longitude > latLong.longitude)=T...
true
ok
{"focal": {"class": "LatLong", "name": "compareTo", "signature": "int compareTo(LatLong latLong)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "latLong", "type": "LatLong"}], "return_type": "int"}, "class_info": {"name": "LatLong", "kind": "class", "modifiers": "", "superclass": null, "interfa...
19748926_0
class SimpleCardStackAdapter extends CardStackAdapter { @Override public View getCardView(int position, CardModel model, View convertView, ViewGroup parent) { if(convertView == null) { LayoutInflater inflater = LayoutInflater.from(getContext()); convertView = inflater.inflate(R.layout.std_card_inner, parent,...
//given CardModel cardModel=initializeCardModel(); SimpleCardStackAdapter simpleCardStackAdapter=initializeSimpleCardStackAdapter(); View view=initializeView(); ViewGroup parent=mock(ViewGroup.class); initializeInflater(parent,view); //when View cardView=s...
[FOCAL] @Override public View SimpleCardStackAdapter.getCardView(int position, CardModel model, View convertView, ViewGroup parent) [CLASS] class SimpleCardStackAdapter extends CardStackAdapter [METRICS] loc=14 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] LayoutInflater.from/1, getContext/0 (in...
/* static context [FOCAL] @Override public View SimpleCardStackAdapter.getCardView(int position, CardModel model, View convertView, ViewGroup parent) [PATH1] if(convertView == null)=T -> return convertView [PATH2] if(convertView == null)=F -> return convertView [INPUTS] branches=convertView | result=convertView, parent...
/* static context [FOCAL] @Override public View SimpleCardStackAdapter.getCardView(int position, CardModel model, View convertView, ViewGroup parent) [PATH1] if(convertView == null)=T -> return convertView [PATH2] if(convertView == null)=F -> return convertView [INPUTS] branches=convertView | result=convertView, parent...
true
ok
{"focal": {"class": "SimpleCardStackAdapter", "name": "getCardView", "signature": "View getCardView(int position, CardModel model, View convertView, ViewGroup parent)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "position", "type": "int"}, {"name": "model", "type": "CardModel"}, {"name": "con...
19759384_20
class PartialSorter { public static <T> void partialSort(List<T> list, List<Integer> items, Comparator<? super T> c) { List<T> temp = Lists.newLinkedList(); for (int index : items) { temp.add(list.get(index)); } Collections.sort(temp, c); for (int i = 0; i < temp...
List<Integer> a = Lists.newArrayList(); a.add(100); a.add(2); a.add(92); a.add(1); a.add(0); PartialSorter.partialSort(a, Lists.newArrayList(1, 3, 4), new Comparator<Integer>() { @Override public int compare(Integer o1, Integer o2) { ...
[FOCAL] public static void PartialSorter.partialSort(List<T> list, List<Integer> items, Comparator<? super T> c) [CLASS] class PartialSorter [METRICS] loc=10 cc=3 branches=0 loops=2 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] Lists.newLinkedList/0, List<T>.add/1, List<T>.get/1, Collections.sort/2, List<T>.size/0, Lis...
/* static context [FOCAL] public static void PartialSorter.partialSort(List<T> list, List<Integer> items, Comparator<? super T> c) [PATH1] foreach(int index : items)=T -> exit loop -> for(i < temp.size())=F [PATH2] foreach(int index : items)=F -> for(i < temp.size())=T -> exit loop [INPUTS] branches=items | result=- [C...
/* static context [FOCAL] public static void PartialSorter.partialSort(List<T> list, List<Integer> items, Comparator<? super T> c) [PATH1] foreach(int index : items)=T -> exit loop -> for(i < temp.size())=F [PATH2] foreach(int index : items)=F -> for(i < temp.size())=T -> exit loop [INPUTS] branches=items | result=- [C...
true
ok
{"focal": {"class": "PartialSorter", "name": "partialSort", "signature": "void partialSort(List<T> list, List<Integer> items, Comparator<? super T> c)", "start_line": 3, "modifiers": "public static", "params": [{"name": "list", "type": "List<T>"}, {"name": "items", "type": "List<Integer>"}, {"name": "c", "type": "Compa...
19777812_9
class GalleryPageApiParser { public static Result parse(String body) throws ParseException { try { Matcher m; Result result = new Result(); JSONObject jo = new JSONObject(body); if (jo.has("error")) { throw new ParseException(jo.getString("er...
InputStream resource = GalleryPageApiParserTest.class.getResourceAsStream("GalleryPageApiParserTest.json"); BufferedSource source = Okio.buffer(Okio.source(resource)); String body = source.readUtf8(); GalleryPageApiParser.Result result = GalleryPageApiParser.parse(body); assertEquals("http://69.30....
[FOCAL] public static Result GalleryPageApiParser.parse(String body) [CLASS] class GalleryPageApiParser [METRICS] loc=35 cc=7 branches=5 loops=0 returns=1 throws=3 nesting=2 [CALLS-EXTERNAL] JSONObject.has/1, JSONObject.getString/1, PATTERN_IMAGE_URL.matcher/1, Matcher.find/0, StringUtils.unescapeXml/1, StringUtils.tri...
/* static context [FOCAL] public static Result GalleryPageApiParser.parse(String body) [THROWS-WHEN] ParseException when try-body throws [THROWS-WHEN] ParseException when jo.has("error") && throw new ParseException(jo.getString("error"), body) [THROWS-WHEN] ParseException when !jo.has("error") && m.find() && m.find() &...
/* static context [FOCAL] public static Result GalleryPageApiParser.parse(String body) [THROWS-WHEN] ParseException when try-body throws [THROWS-WHEN] ParseException when jo.has("error") && throw new ParseException(jo.getString("error"), body) [THROWS-WHEN] ParseException when !jo.has("error") && m.find() && m.find() &...
true
ok
{"focal": {"class": "GalleryPageApiParser", "name": "parse", "signature": "Result parse(String body) throws ParseException", "start_line": 3, "modifiers": "public static", "params": [{"name": "body", "type": "String"}], "return_type": "Result"}, "class_info": {"name": "GalleryPageApiParser", "kind": "class", "modifiers...
19781635_3
class TypedBaseAdapter extends BaseAdapter { @SuppressWarnings("unchecked") @Override public C getView(int position, View convertView, ViewGroup parent) { C view = null; if (convertView != null) { view = (C) convertView; } else { view = createView(); ...
// given final TestView mockView = Mockito.mock(TestView.class); TypedBaseAdapterExtension adapter = new TypedBaseAdapterExtension(new String[] { "hello" }, mockView); // when adapter.getView(0, null, null); // then assertTrue(adapter.isCreateViewCalled); ...
[FOCAL] @SuppressWarnings("unchecked") @Override public C TypedBaseAdapter.getView(int position, View convertView, ViewGroup parent) [CLASS] class TypedBaseAdapter extends BaseAdapter [METRICS] loc=12 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] C createView(); T getItem(int position) [CALLS-EX...
/* static context [FOCAL] @SuppressWarnings("unchecked") @Override public C TypedBaseAdapter.getView(int position, View convertView, ViewGroup parent) [PATH1] if(convertView != null)=T -> return view [PATH2] if(convertView != null)=F -> return view [INPUTS] branches=convertView | result=convertView | unused=parent [CAL...
/* static context [FOCAL] @SuppressWarnings("unchecked") @Override public C TypedBaseAdapter.getView(int position, View convertView, ViewGroup parent) [PATH1] if(convertView != null)=T -> return view [PATH2] if(convertView != null)=F -> return view [INPUTS] branches=convertView | result=convertView | unused=parent [CAL...
true
ok
{"focal": {"class": "TypedBaseAdapter", "name": "getView", "signature": "C getView(int position, View convertView, ViewGroup parent)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") @Override public", "params": [{"name": "position", "type": "int"}, {"name": "convertView", "type": "View"}, {"name": "par...
19786369_9
class DVEConfigCLI extends CLIBuilder { @Override public void close() { if (catHelper != null) { catHelper.close(); catHelper = null; } super.close(); } public DVEConfigCLI(String[] args); protected CatalogHelper getCatalogHelper(); public void cmd_dump(Scanner scanner); public void cmd_locate_ca...
final DVEClientToolTestConsole console = new DVEClientToolTestConsole(new DVEConfigCLI(null)); console.executeInteractiveCommand("delete catalog", "y"); console.executeCommand("setup localhost catalog 5 5"); // Create a CatalogDAO to verify the contents CatalogDAO c = CatalogDAOFactory.newInstance(); // ...
[FOCAL] @Override public void DVEConfigCLI.close() [CLASS] class DVEConfigCLI extends CLIBuilder [METRICS] loc=8 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] catHelper.close/0, CLIBuilder.close/0 [PATH1] if(catHelper != null)=T [PATH2] if(catHelper != null)=F [COLLABORATORS] field catHelper clo...
/* static context [FOCAL] @Override public void DVEConfigCLI.close() [PATH1] if(catHelper != null)=T [PATH2] if(catHelper != null)=F [COLLABORATORS] field catHelper close/0 [CALLS-EXTERNAL] catHelper.close/0, CLIBuilder.close/0 */
/* static context [FOCAL] @Override public void DVEConfigCLI.close() [PATH1] if(catHelper != null)=T [PATH2] if(catHelper != null)=F [COLLABORATORS] field catHelper close/0 [CALLS-EXTERNAL] catHelper.close/0, CLIBuilder.close/0 */ class DVEConfigCLI extends CLIBuilder { @Override public void close() { if (catHelpe...
true
ok
{"focal": {"class": "DVEConfigCLI", "name": "close", "signature": "void close()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "DVEConfigCLI", "kind": "class", "modifiers": "", "superclass": "CLIBuilder", "interfaces": null, "fields": [{"name": "TEST_PRO...
19789077_76
class SdbCassandraInstanceDao implements CassandraInstanceDao { @Override public void save(String ring, CassandraInstance instance) { PutAttributesRequest request = new PutAttributesRequest( domain(ring), String.valueOf(instance.getId()), buildSaveAttributes(instance)); client.putAttributes(request...
CassandraInstance instance = createMock(CassandraInstance.class); Capture<PutAttributesRequest> requestCapture = new Capture<PutAttributesRequest>(); expect(domainFactory.createFromRing(RING_NAME)).andReturn(domain(RING_NAME)); expect(instance.getId()).andReturn(ID).times(2); expect(instance.getData...
[FOCAL] @Override public void SdbCassandraInstanceDao.save(String ring, CassandraInstance instance) [CLASS] class SdbCassandraInstanceDao implements CassandraInstanceDao [METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] List<ReplaceableAttribute> buildSaveAttributes(CassandraInstance...
/* static context [FOCAL] @Override public void SdbCassandraInstanceDao.save(String ring, CassandraInstance instance) [COLLABORATORS] param instance:CassandraInstance getId/0; field client putAttributes/1 [CALLS-INTERNAL] List<ReplaceableAttribute> buildSaveAttributes(CassandraInstance instance); String domain(String r...
/* static context [FOCAL] @Override public void SdbCassandraInstanceDao.save(String ring, CassandraInstance instance) [COLLABORATORS] param instance:CassandraInstance getId/0; field client putAttributes/1 [CALLS-INTERNAL] List<ReplaceableAttribute> buildSaveAttributes(CassandraInstance instance); String domain(String r...
true
ok
{"focal": {"class": "SdbCassandraInstanceDao", "name": "save", "signature": "void save(String ring, CassandraInstance instance)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "ring", "type": "String"}, {"name": "instance", "type": "CassandraInstance"}], "return_type": "void"}, "class_info": {"n...
19802105_7
class HttpRedirectPolicyUtils { public static boolean shouldFollowRedirect(HttpRedirectPolicy redirectPolicy, URL currentURL, URL redirectURL) { return POLICY_CHECKERS.get(redirectPolicy).compare(currentURL, redirectURL) == 0; } private HttpRedirectPolicyUtils(); } class HttpRedirectPolicyUtils...
URL currentURL = new URL("http://example.com:8080/path"); URL redirectURL = new URL("http://example.com:8081/path"); assertFalse(shouldFollowRedirect(ORIGIN, currentURL, redirectURL)); } }
[FOCAL] public static boolean HttpRedirectPolicyUtils.shouldFollowRedirect(HttpRedirectPolicy redirectPolicy, URL currentURL, URL redirectURL) [CLASS] class HttpRedirectPolicyUtils [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] POLICY_CHECKERS.get(redirectPolicy).compare/2, POLICY...
/* static context [FOCAL] public static boolean HttpRedirectPolicyUtils.shouldFollowRedirect(HttpRedirectPolicy redirectPolicy, URL currentURL, URL redirectURL) [INPUTS] branches=- | result=currentURL, redirectPolicy, redirectURL [CALLS-EXTERNAL] POLICY_CHECKERS.get(redirectPolicy).compare/2, POLICY_CHECKERS.get/1 */
/* static context [FOCAL] public static boolean HttpRedirectPolicyUtils.shouldFollowRedirect(HttpRedirectPolicy redirectPolicy, URL currentURL, URL redirectURL) [INPUTS] branches=- | result=currentURL, redirectPolicy, redirectURL [CALLS-EXTERNAL] POLICY_CHECKERS.get(redirectPolicy).compare/2, POLICY_CHECKERS.get/1 */ c...
true
ok
{"focal": {"class": "HttpRedirectPolicyUtils", "name": "shouldFollowRedirect", "signature": "boolean shouldFollowRedirect(HttpRedirectPolicy redirectPolicy, URL currentURL, URL redirectURL)", "start_line": 3, "modifiers": "public static", "params": [{"name": "redirectPolicy", "type": "HttpRedirectPolicy"}, {"name": "cu...
19821698_135
class SenchaParseRequestStage extends ParseRequestStage { @Override protected <T> void doExecute(SelectContext<T> context) { super.doExecute(context); Map<String, List<String>> protocolParameters = context.getProtocolParameters(); // TODO: make symmetrical with AgRequestBuilder (name...
@SuppressWarnings("unchecked") MultivaluedMap<String, String> params = mock(MultivaluedMap.class); when(params.get("cayenneExp")).thenReturn(Collections.singletonList("{\"exp\" : \"address = '1 Main Street'\"}")); when(params.get(SenchaParseRequestStage.FILTER)).thenReturn(Collections.singletonList("[{\"proper...
[FOCAL] @Override protected void SenchaParseRequestStage.doExecute(SelectContext<T> context) [CLASS] class SenchaParseRequestStage extends ParseRequestStage [METRICS] loc=14 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] ParseRequestStage.doExecute/1, SelectContext<T>.getProtocolParameters/0, Sen...
/* static context [FOCAL] @Override protected void SenchaParseRequestStage.doExecute(SelectContext<T> context) [COLLABORATORS] param context:SelectContext<T> getProtocolParameters/0; field filterParser fromString/1 [CALLS-EXTERNAL] ParseRequestStage.doExecute/1, SelectContext<T>.getProtocolParameters/0, SenchaRequest.b...
/* static context [FOCAL] @Override protected void SenchaParseRequestStage.doExecute(SelectContext<T> context) [COLLABORATORS] param context:SelectContext<T> getProtocolParameters/0; field filterParser fromString/1 [CALLS-EXTERNAL] ParseRequestStage.doExecute/1, SelectContext<T>.getProtocolParameters/0, SenchaRequest.b...
true
ok
{"focal": {"class": "SenchaParseRequestStage", "name": "doExecute", "signature": "void doExecute(SelectContext<T> context)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "context", "type": "SelectContext<T>"}], "return_type": "void"}, "class_info": {"name": "SenchaParseRequestStage", "kind":...
19825381_78
class Cli implements Callable<Integer> { @SuppressWarnings("WeakerAccess") // Public API. public int run( String[] args ) { CommandLine cl = new CommandLine(this); cl.setUsageHelpAutoWidth(true); cl.setExecutionStrategy(new CommandLine.RunAll()); cl.setOverwrittenOptionsAllowed(...
Cli c = new Cli(); c.run( new String[] {} ); ManipulationSession session = (ManipulationSession) FieldUtils.readField( c, "session", true ); File defaultTarget = (File) FieldUtils.readField( c, "target", true ); assertEquals( "Session file should match", defaultTarget, session....
[FOCAL] @SuppressWarnings("WeakerAccess") // Public API. public int Cli.run(String[] args) [CLASS] class Cli implements Callable<Integer> [METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] CommandLine.setUsageHelpAutoWidth/1, CommandLine.setExecutionStrategy/1, CommandLine.setOverwrit...
/* static context [FOCAL] @SuppressWarnings("WeakerAccess") // Public API. public int Cli.run(String[] args) [INPUTS] branches=- | result=args [NEW] CommandLine, CommandLine.RunAll [CALLS-EXTERNAL] CommandLine.setUsageHelpAutoWidth/1, CommandLine.setExecutionStrategy/1, CommandLine.setOverwrittenOptionsAllowed/1, Comma...
/* static context [FOCAL] @SuppressWarnings("WeakerAccess") // Public API. public int Cli.run(String[] args) [INPUTS] branches=- | result=args [NEW] CommandLine, CommandLine.RunAll [CALLS-EXTERNAL] CommandLine.setUsageHelpAutoWidth/1, CommandLine.setExecutionStrategy/1, CommandLine.setOverwrittenOptionsAllowed/1, Comma...
true
ok
{"focal": {"class": "Cli", "name": "run", "signature": "int run(String[] args)", "start_line": 3, "modifiers": "@SuppressWarnings(\"WeakerAccess\") // Public API. public", "params": [{"name": "args", "type": "String[]"}], "return_type": "int"}, "class_info": {"name": "Cli", "kind": "class", "modifiers": "", "superclass...
19827565_2
class RvfReleaseDbSchemaNameGenerator { public static String generate(String releaseFilename) { if (releaseFilename != null && !releaseFilename.endsWith(".zip")) { return releaseFilename.replaceAll("-", "_"); } releaseFilename = releaseFilename.replace(".zip", ""); String[] splits = releaseFilename.split("...
assertEquals("rvf_intrf2_prod_20180731t120000z", generate("SnomedCT_InternationalRF2_PRODUCTION_20180731T120000Z.zip")); } }
[FOCAL] public static String RvfReleaseDbSchemaNameGenerator.generate(String releaseFilename) [CLASS] class RvfReleaseDbSchemaNameGenerator [METRICS] loc=25 cc=8 branches=4 loops=3 returns=2 throws=0 nesting=3 [CALLS-EXTERNAL] String.endsWith/1, String.replaceAll/2, String.replace/2, String.split/2, splits[i].toLowerCa...
/* static context [FOCAL] public static String RvfReleaseDbSchemaNameGenerator.generate(String releaseFilename) [PATH1] if(releaseFilename != null && !releaseFilename.endsWith(".zip"))=F -> for(i < splits.length)=T -> foreach(String word : REPLACEMENTS.keySet())=T -> if(splits[i].contains(word.toLowerCase()))=T -> exit...
/* static context [FOCAL] public static String RvfReleaseDbSchemaNameGenerator.generate(String releaseFilename) [PATH1] if(releaseFilename != null && !releaseFilename.endsWith(".zip"))=F -> for(i < splits.length)=T -> foreach(String word : REPLACEMENTS.keySet())=T -> if(splits[i].contains(word.toLowerCase()))=T -> exit...
true
ok
{"focal": {"class": "RvfReleaseDbSchemaNameGenerator", "name": "generate", "signature": "String generate(String releaseFilename)", "start_line": 3, "modifiers": "public static", "params": [{"name": "releaseFilename", "type": "String"}], "return_type": "String"}, "class_info": {"name": "RvfReleaseDbSchemaNameGenerator",...
19836152_70
class ExpressionTransform { public List transformList( List source, EvaluationContext evaluationContext, ExpressionEvaluationSummary summary, Map<String, Object> additionalContext) { List<Object> result = new ArrayList<>(); for (Object obj : source) { if (obj instanceof Map) { ...
List<Object> input = Collections.singletonList(Collections.singletonMap("key", "value")); List<?> evaluated = new ExpressionTransform(parserContext, parser, Function.identity()) .transformList( input, new StandardEvaluationContext(), new Expre...
[FOCAL] public List ExpressionTransform.transformList(List source, EvaluationContext evaluationContext, ExpressionEvaluationSummary summary, Map<String, Object> additionalContext) [CLASS] class ExpressionTransform [METRICS] loc=18 cc=4 branches=2 loops=1 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] Map<String, Object>...
/* static context [FOCAL] public List ExpressionTransform.transformList(List source, EvaluationContext evaluationContext, ExpressionEvaluationSummary summary, Map<String, Object> additionalContext) [PATH1] foreach(Object obj : source)=T -> if(obj instanceof Map)=F -> if(obj instanceof List)=T -> exit loop -> return res...
/* static context [FOCAL] public List ExpressionTransform.transformList(List source, EvaluationContext evaluationContext, ExpressionEvaluationSummary summary, Map<String, Object> additionalContext) [PATH1] foreach(Object obj : source)=T -> if(obj instanceof Map)=F -> if(obj instanceof List)=T -> exit loop -> return res...
true
ok
{"focal": {"class": "ExpressionTransform", "name": "transformList", "signature": "List transformList(List source, EvaluationContext evaluationContext, ExpressionEvaluationSummary summary, Map<String, Object> additionalContext)", "start_line": 3, "modifiers": "public", "params": [{"name": "source", "type": "List"}, {"na...
19851429_9
class ControlFieldExpression implements Expression<String, Document> { @Override public String evaluate(final Document target) { final String result = currentState.evaluate(target); return result != null && result.trim().length() > 0 ? result : null; } public ControlFieldExpression(final String specs); @Ov...
final Document document = newRecord(null, null); final ControlFieldExpression expression = new ControlFieldExpression(A_CONTROL_FIELD_NAME + "[00-05]"); expression.xpath = new OXPath(); assertNull(expression.evaluate(document)); } }
[FOCAL] @Override public String ControlFieldExpression.evaluate(Document target) [CLASS] class ControlFieldExpression implements Expression<String, Document> [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] currentState.evaluate/1, result.trim().length/0, String.trim/0 [INPUTS] bran...
/* static context [FOCAL] @Override public String ControlFieldExpression.evaluate(Document target) [INPUTS] branches=- | result=target [COLLABORATORS] field currentState evaluate/1 [CALLS-EXTERNAL] currentState.evaluate/1, result.trim().length/0, String.trim/0 */
/* static context [FOCAL] @Override public String ControlFieldExpression.evaluate(Document target) [INPUTS] branches=- | result=target [COLLABORATORS] field currentState evaluate/1 [CALLS-EXTERNAL] currentState.evaluate/1, result.trim().length/0, String.trim/0 */ class ControlFieldExpression implements Expression<Strin...
true
ok
{"focal": {"class": "ControlFieldExpression", "name": "evaluate", "signature": "String evaluate(Document target)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "target", "type": "Document"}], "return_type": "String"}, "class_info": {"name": "ControlFieldExpression", "kind": "class", "modifiers"...
19873472_1
class Utility { public static byte[] read(String filename) throws IOException { BufferedInputStream stream = new BufferedInputStream( new FileInputStream(filename)); byte[] content = read(stream); stream.close(); return (content); } ...
byte[] data = "abcdefhijklmnopqrstuvwxyz".getBytes(); InputStream in = new ByteArrayInputStream(data); byte[] result = Utility.read(in); assertArrayEquals(data, result); } }
[FOCAL] public static byte[] Utility.read(String filename) [CLASS] class Utility [METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] byte[] read(File file) [CALLS-EXTERNAL] BufferedInputStream.close/0 [NEW] BufferedInputStream, FileInputStream [EXCEPTIONS] declares IOException [INPUTS...
/* static context [FOCAL] public static byte[] Utility.read(String filename) [INPUTS] branches=- | result=filename [EXCEPTIONS] declares IOException [CALLS-INTERNAL] byte[] read(File file) [NEW] BufferedInputStream, FileInputStream [CALLS-EXTERNAL] BufferedInputStream.close/0 */
/* static context [FOCAL] public static byte[] Utility.read(String filename) [INPUTS] branches=- | result=filename [EXCEPTIONS] declares IOException [CALLS-INTERNAL] byte[] read(File file) [NEW] BufferedInputStream, FileInputStream [CALLS-EXTERNAL] BufferedInputStream.close/0 */ class Utility { public static byte[...
true
ok
{"focal": {"class": "Utility", "name": "read", "signature": "byte[] read(String filename) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "filename", "type": "String"}], "return_type": "byte[]"}, "class_info": {"name": "Utility", "kind": "class", "modifiers": "", "superclass": nu...
19961085_109
class ServiceStatus { public static Status getServiceStatus() { return getServiceStatus(serviceStatusCallback); } public static void setServiceStatusCallback(String name, ServiceStatusCallback serviceStatusCallback); public static void removeServiceStatusCallback(String name); public static Status getSe...
TestIdealStateAndExternalViewMatchServiceStatusCallback callback; // No ideal state = GOOD callback = buildTestISEVCallback(); callback.setExternalView(new ExternalView(TABLE_NAME)); assertEquals(callback.getServiceStatus(), ServiceStatus.Status.GOOD); // No external view = STARTING callba...
[FOCAL] public static Status ServiceStatus.getServiceStatus() [CLASS] class ServiceStatus [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Status getServiceStatus(String name) [CLASS-MEMBERS] void setServiceStatusCallback(String name, ServiceStatusCallback serviceStatusCallback); vo...
/* static context [FOCAL] public static Status ServiceStatus.getServiceStatus() [CALLS-INTERNAL] Status getServiceStatus(String name) */
/* static context [FOCAL] public static Status ServiceStatus.getServiceStatus() [CALLS-INTERNAL] Status getServiceStatus(String name) */ class ServiceStatus { public static Status getServiceStatus() { return getServiceStatus(serviceStatusCallback); } public static void setServiceStatusCallback(String name, ...
true
ok
{"focal": {"class": "ServiceStatus", "name": "getServiceStatus", "signature": "Status getServiceStatus()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Status"}, "class_info": {"name": "ServiceStatus", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{...
19975898_1
class VerdictConverter { public static Boolean toBoolean(Verdict verdict) { if(verdict == Verdict.INCONCLUSIVE) return null; if(verdict == Verdict.PASS) return true; return false; } public static Verdict toVerdict(Boolean bool); } class VerdictConverterTest { @Test public void TestVerdictToBoolean...
assertFalse(VerdictConverter.toBoolean(Verdict.FAIL)); assertTrue(VerdictConverter.toBoolean(Verdict.PASS)); assertNull(VerdictConverter.toBoolean(Verdict.INCONCLUSIVE)); } }
[FOCAL] public static Boolean VerdictConverter.toBoolean(Verdict verdict) [CLASS] class VerdictConverter [METRICS] loc=7 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1 [PATH1] if(verdict == Verdict.INCONCLUSIVE)=F -> if(verdict == Verdict.PASS)=T -> return true [PATH2] if(verdict == Verdict.INCONCLUSIVE)=T -> ret...
/* static context [FOCAL] public static Boolean VerdictConverter.toBoolean(Verdict verdict) [PATH1] if(verdict == Verdict.INCONCLUSIVE)=F -> if(verdict == Verdict.PASS)=T -> return true [PATH2] if(verdict == Verdict.INCONCLUSIVE)=T -> return null [PATH3] if(verdict == Verdict.INCONCLUSIVE)=F -> if(verdict == Verdict.PA...
/* static context [FOCAL] public static Boolean VerdictConverter.toBoolean(Verdict verdict) [PATH1] if(verdict == Verdict.INCONCLUSIVE)=F -> if(verdict == Verdict.PASS)=T -> return true [PATH2] if(verdict == Verdict.INCONCLUSIVE)=T -> return null [PATH3] if(verdict == Verdict.INCONCLUSIVE)=F -> if(verdict == Verdict.PA...
true
ok
{"focal": {"class": "VerdictConverter", "name": "toBoolean", "signature": "Boolean toBoolean(Verdict verdict)", "start_line": 3, "modifiers": "public static", "params": [{"name": "verdict", "type": "Verdict"}], "return_type": "Boolean"}, "class_info": {"name": "VerdictConverter", "kind": "class", "modifiers": "", "supe...
19995362_4
class LocaleUtil { public static String getLocaleCode(String localeStr) { Locale locale = FALLBACK; try { locale = (localeStr != null)? LocaleUtils.toLocale(localeStr):FALLBACK; } catch (IllegalArgumentException e) { logger.warn("cannot get locale from {}. Returning ...
assertThat(LocaleUtil.getLocaleCode("en_GB")).isEqualTo("en_GB"); } }
[FOCAL] public static String LocaleUtil.getLocaleCode(String localeStr) [CLASS] class LocaleUtil [METRICS] loc=9 cc=2 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] LocaleUtils.toLocale/1, logger.warn/2, Locale.toString/0 [EXCEPTIONS] catches IllegalArgumentException e [PATH1] try-body throws -> retur...
/* static context [FOCAL] public static String LocaleUtil.getLocaleCode(String localeStr) [PATH1] try-body throws -> return locale.toString() [INPUTS] branches=- | result=localeStr [EXCEPTIONS] catches IllegalArgumentException e [CALLS-EXTERNAL] LocaleUtils.toLocale/1, logger.warn/2, Locale.toString/0 */
/* static context [FOCAL] public static String LocaleUtil.getLocaleCode(String localeStr) [PATH1] try-body throws -> return locale.toString() [INPUTS] branches=- | result=localeStr [EXCEPTIONS] catches IllegalArgumentException e [CALLS-EXTERNAL] LocaleUtils.toLocale/1, logger.warn/2, Locale.toString/0 */ class LocaleUt...
true
ok
{"focal": {"class": "LocaleUtil", "name": "getLocaleCode", "signature": "String getLocaleCode(String localeStr)", "start_line": 3, "modifiers": "public static", "params": [{"name": "localeStr", "type": "String"}], "return_type": "String"}, "class_info": {"name": "LocaleUtil", "kind": "class", "modifiers": "", "supercla...
20076963_0
class BasicScript implements PhonScript, Cloneable { public BasicScript(String text) { super(); buffer.append(text); setupImports(); } public BasicScript(String text); public BasicScript(File file); protected StringBuffer getBuffer(); private void setupImports(); @Override public String getScript()...
final String script = "x = 1 + 1\n"; final BasicScript bs = new BasicScript(script); final PhonScriptContext ctx = bs.getContext(); final Scriptable scope = ctx.createImporterScope(); final Object val = ctx.exec(scope); Assert.assertEquals(Integer.class, val.getClass()); Assert.assertEquals(2, (int)...
[FOCAL] public BasicScript.BasicScript(String text) [CLASS] class BasicScript implements PhonScript, Cloneable [METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void setupImports() [CALLS-EXTERNAL] buffer.append/1 [COLLABORATORS] field buffer append/1 [DATAFLOW] text@param->L3 [CLASS...
/* static context [FOCAL] public BasicScript.BasicScript(String text) [COLLABORATORS] field buffer append/1 [CALLS-INTERNAL] void setupImports() [CALLS-EXTERNAL] buffer.append/1 */
/* static context [FOCAL] public BasicScript.BasicScript(String text) [COLLABORATORS] field buffer append/1 [CALLS-INTERNAL] void setupImports() [CALLS-EXTERNAL] buffer.append/1 */ class BasicScript implements PhonScript, Cloneable { public BasicScript(String text) { super(); buffer.append(text); setupImport...
true
ok
{"focal": {"class": "BasicScript", "name": "BasicScript", "signature": "BasicScript(String text)", "start_line": 3, "modifiers": "public", "params": [{"name": "text", "type": "String"}], "return_type": null}, "class_info": {"name": "BasicScript", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Phon...
20127629_1
class Customer extends BaseModel { public void setName(String name) { this.name = name; } public String toString(); public String getName(); public LocalDate getRegistered(); public void setRegistered(LocalDate registered); public String getComments(); public void setComments(String comments); p...
DelegateEbeanServer mock = new DelegateEbeanServer(); mock.withPersisting(true); MockiEbean.runWithMock(mock, () -> { Customer customer = new Customer(); customer.setName("jim"); //customer.setComments("first comment"); customer.save(); //customer.setComments("second comm...
[FOCAL] public void Customer.setName(String name) [CLASS] class Customer extends BaseModel [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [FIELDS] write=name [STATE] name via getName() [DATAFLOW] name@param->L2 [CLASS-MEMBERS] String toString(); String getName(); LocalDate getRegistered(); void se...
/* static context [FOCAL] public void Customer.setName(String name) [STATE] name via getName() [FIELDS] write=name */
/* static context [FOCAL] public void Customer.setName(String name) [STATE] name via getName() [FIELDS] write=name */ class Customer extends BaseModel { public void setName(String name) { this.name = name; } public String toString(); public String getName(); public LocalDate getRegistered(); public vo...
true
ok
{"focal": {"class": "Customer", "name": "setName", "signature": "void setName(String name)", "start_line": 3, "modifiers": "public", "params": [{"name": "name", "type": "String"}], "return_type": "void"}, "class_info": {"name": "Customer", "kind": "class", "modifiers": "", "superclass": "BaseModel", "interfaces": null,...
20132937_2
class UploadFile implements Serializable { public String getName() { return name; } public UploadFile(String name, String contentType, long size, byte[] contents); public String getId(); public void setName(String name); public String getContentType(); public void set...
uploadedFile.setName("flag.png"); assertEquals("flag.png", uploadedFile.getName()); } }
[FOCAL] public String UploadFile.getName() [CLASS] class UploadFile implements Serializable [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] UploadFile(String name, String contentType, long size, byte[] contents); String getId(); void setName(String name); String getContentType(); vo...
/* static context [FOCAL] public String UploadFile.getName() */
/* static context [FOCAL] public String UploadFile.getName() */ class UploadFile implements Serializable { public String getName() { return name; } public UploadFile(String name, String contentType, long size, byte[] contents); public String getId(); public void setName(Strin...
true
ok
{"focal": {"class": "UploadFile", "name": "getName", "signature": "String getName()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "UploadFile", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Serializable", "fields": [{"name": "uploadedFile...
20147131_4
class AtmosphereServerWebSocket extends AbstractServerWebSocket { @Override public <T> T unwrap(Class<T> clazz) { return AtmosphereResource.class.isAssignableFrom(clazz) ? clazz.cast(resource) : null; } public AtmosphereServerWebSocket(AtmosphereResource resource); @Override public Strin...
performer.onserver(new Action<ServerWebSocket>() { @Override public void on(ServerWebSocket ws) { assertThat(ws.unwrap(AtmosphereResource.class), instanceOf(AtmosphereResource.class)); performer.start(); } }) .connect(); } ...
[FOCAL] @Override public T AtmosphereServerWebSocket.unwrap(Class<T> clazz) [CLASS] class AtmosphereServerWebSocket extends AbstractServerWebSocket [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] AtmosphereResource.class.isAssignableFrom/1, Class<T>.cast/1 [INPUTS] branches=- | res...
/* static context [FOCAL] @Override public T AtmosphereServerWebSocket.unwrap(Class<T> clazz) [INPUTS] branches=- | result=clazz [COLLABORATORS] param clazz:Class<T> cast/1 [CALLS-EXTERNAL] AtmosphereResource.class.isAssignableFrom/1, Class<T>.cast/1 */
/* static context [FOCAL] @Override public T AtmosphereServerWebSocket.unwrap(Class<T> clazz) [INPUTS] branches=- | result=clazz [COLLABORATORS] param clazz:Class<T> cast/1 [CALLS-EXTERNAL] AtmosphereResource.class.isAssignableFrom/1, Class<T>.cast/1 */ class AtmosphereServerWebSocket extends AbstractServerWebSocket { ...
true
ok
{"focal": {"class": "AtmosphereServerWebSocket", "name": "unwrap", "signature": "T unwrap(Class<T> clazz)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "clazz", "type": "Class<T>"}], "return_type": "T"}, "class_info": {"name": "AtmosphereServerWebSocket", "kind": "class", "modifiers": "", "sup...
20175098_0
class RSGaussianBlurTransformation implements Transformation { @Override public Bitmap transform(Bitmap source) { if (Build.VERSION.SDK_INT < 17) { return source; } RenderScript rs = RenderScript.create(mContext); Allocation input = Allocation.createFromBitm...
Transformation t = getTransformation(); Bitmap copy = getCopyOfBitmap(); Bitmap bm = t.transform(copy); assertThat(bm).isNotNull(); } }
[FOCAL] @Override public Bitmap RSGaussianBlurTransformation.transform(Bitmap source) [CLASS] class RSGaussianBlurTransformation implements Transformation [METRICS] loc=16 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] RenderScript.create/1, Allocation.createFromBitmap/4, Allocation.createTyped/2...
/* static context [FOCAL] @Override public Bitmap RSGaussianBlurTransformation.transform(Bitmap source) [PATH1] if(Build.VERSION.SDK_INT < 17)=T -> return source [PATH2] if(Build.VERSION.SDK_INT < 17)=F -> return source [INPUTS] branches=- | result=source [CALLS-EXTERNAL] RenderScript.create/1, Allocation.createFromBit...
/* static context [FOCAL] @Override public Bitmap RSGaussianBlurTransformation.transform(Bitmap source) [PATH1] if(Build.VERSION.SDK_INT < 17)=T -> return source [PATH2] if(Build.VERSION.SDK_INT < 17)=F -> return source [INPUTS] branches=- | result=source [CALLS-EXTERNAL] RenderScript.create/1, Allocation.createFromBit...
true
ok
{"focal": {"class": "RSGaussianBlurTransformation", "name": "transform", "signature": "Bitmap transform(Bitmap source)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "source", "type": "Bitmap"}], "return_type": "Bitmap"}, "class_info": {"name": "RSGaussianBlurTransformation", "kind": "class", "...
20214352_40
class BuildState { public BuildState setAllEnabled(){ for (BuildStateEnum state : states.keySet()){ switch (state){ case BUILD_BROKEN: disable(state); break; case BUILD_FIXED: disable(state); break; default: enable(state); break; } }...
BuildState state = new BuildState(); assertTrue(state.noneEnabled()); state.setAllEnabled(); assertTrue(state.allEnabled()); } }
[FOCAL] public BuildState BuildState.setAllEnabled() [CLASS] class BuildState [METRICS] loc=16 cc=4 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] void disable(BuildStateEnum currentBuildState); void enable(BuildStateEnum currentBuildState) [CALLS-EXTERNAL] states.keySet/0 [PATH1] foreach(BuildStateEn...
/* static context [FOCAL] public BuildState BuildState.setAllEnabled() [PATH1] foreach(BuildStateEnum state : states.keySet())=T -> switch(state)=case BUILD_BROKEN -> exit loop -> return this [PATH2] foreach(BuildStateEnum state : states.keySet())=F -> return this [PATH3] foreach(BuildStateEnum state : states.keySet())...
/* static context [FOCAL] public BuildState BuildState.setAllEnabled() [PATH1] foreach(BuildStateEnum state : states.keySet())=T -> switch(state)=case BUILD_BROKEN -> exit loop -> return this [PATH2] foreach(BuildStateEnum state : states.keySet())=F -> return this [PATH3] foreach(BuildStateEnum state : states.keySet())...
true
ok
{"focal": {"class": "BuildState", "name": "setAllEnabled", "signature": "BuildState setAllEnabled()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "BuildState"}, "class_info": {"name": "BuildState", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members"...
20216746_5
class StaxUtils { public static boolean isStaxResult(Result result) { return (result instanceof StaxResult || (jaxp14Available && Jaxp14StaxHandler.isStaxResult(result))); } public static Source createCustomStaxSource(XMLStreamReader streamReader); public static Source createStaxSource(XMLStreamReader streamRea...
XMLOutputFactory outputFactory = XMLOutputFactory.newInstance(); XMLStreamWriter streamWriter = outputFactory.createXMLStreamWriter(new StringWriter()); StAXResult result = new StAXResult(streamWriter); assertTrue("Not a StAX Result", StaxUtils.isStaxResult(result)); } }
[FOCAL] public static boolean StaxUtils.isStaxResult(Result result) [CLASS] class StaxUtils [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Jaxp14StaxHandler.isStaxResult/1 [INPUTS] branches=- | result=result [DATAFLOW] result@param->L2 [CLASS-MEMBERS] Source createCustomStaxSource...
/* static context [FOCAL] public static boolean StaxUtils.isStaxResult(Result result) [INPUTS] branches=- | result=result [CALLS-EXTERNAL] Jaxp14StaxHandler.isStaxResult/1 */
/* static context [FOCAL] public static boolean StaxUtils.isStaxResult(Result result) [INPUTS] branches=- | result=result [CALLS-EXTERNAL] Jaxp14StaxHandler.isStaxResult/1 */ class StaxUtils { public static boolean isStaxResult(Result result) { return (result instanceof StaxResult || (jaxp14Available && Jaxp14StaxH...
true
ok
{"focal": {"class": "StaxUtils", "name": "isStaxResult", "signature": "boolean isStaxResult(Result result)", "start_line": 3, "modifiers": "public static", "params": [{"name": "result", "type": "Result"}], "return_type": "boolean"}, "class_info": {"name": "StaxUtils", "kind": "class", "modifiers": "", "superclass": nul...
20227177_0
class BaseBatchingStrategy implements BatchingStrategy<E, T> { @Override public void onDataPushed(Collection<E> dataCollection) { persistenceStrategy.add(dataCollection); } public BaseBatchingStrategy(PersistenceStrategy<E> persistenceStrategy); @Override public boolean isInitialized(); ...
PersistenceStrategy<Data> persistenceStrategy = mock(PersistenceStrategy.class); BaseBatchingStrategy<Data, Batch<Data>> baseBatchingStrategy = new BaseBatchingStrategy<Data, Batch<Data>>(persistenceStrategy) { @Override public void flush(boolean forced) { } ...
[FOCAL] @Override public void BaseBatchingStrategy.onDataPushed(Collection<E> dataCollection) [CLASS] class BaseBatchingStrategy implements BatchingStrategy<E, T> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] persistenceStrategy.add/1 [COLLABORATORS] field persistenceStrategy add...
/* static context [FOCAL] @Override public void BaseBatchingStrategy.onDataPushed(Collection<E> dataCollection) [COLLABORATORS] field persistenceStrategy add/1 [CALLS-EXTERNAL] persistenceStrategy.add/1 */
/* static context [FOCAL] @Override public void BaseBatchingStrategy.onDataPushed(Collection<E> dataCollection) [COLLABORATORS] field persistenceStrategy add/1 [CALLS-EXTERNAL] persistenceStrategy.add/1 */ class BaseBatchingStrategy implements BatchingStrategy<E, T> { @Override public void onDataPushed(Collect...
true
ok
{"focal": {"class": "BaseBatchingStrategy", "name": "onDataPushed", "signature": "void onDataPushed(Collection<E> dataCollection)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "dataCollection", "type": "Collection<E>"}], "return_type": "void"}, "class_info": {"name": "BaseBatchingStrategy", "k...
20236504_1
class Numek { public String text2number(String snumber) { // UK "and" hundreds/thousands/tens/units separator "five hundred and six" // UK/US "-" is tens and units separator // UK magnitudes are singular. Plural (milions) is informal/indefinite (e.g., there were millions of people) ...
System.out.println("text2number"); instance = new Numek(new Locale("en","US")); assertEquals("25", instance.text2number("twenty five")); assertEquals("0.01", instance.text2number("00.010")); assertEquals("2000025", instance.text2number("two million twenty five")); assertE...
[FOCAL] public String Numek.text2number(String snumber) [CLASS] class Numek [METRICS] loc=170 cc=32 branches=28 loops=2 returns=16 throws=4 nesting=5 [CALLS-INTERNAL] Double calc_and_sum_frac(String snumber); Integer getNumber(String[] elements, Integer i, Number number, Integer maxorder); Integer operateMagnitude(Stri...
class Numek { public String text2number(String snumber) { // UK "and" hundreds/thousands/tens/units separator "five hundred and six" // UK/US "-" is tens and units separator // UK magnitudes are singular. Plural (milions) is informal/indefinite (e.g., there were millions of people) ...
false
ok
{"focal": {"class": "Numek", "name": "text2number", "signature": "String text2number(String snumber)", "start_line": 3, "modifiers": "public", "params": [{"name": "snumber", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Numek", "kind": "class", "modifiers": "", "superclass": null, "interfaces": ...
20249391_68
class Whitebox { public static Method[] getMethods(Class<?> clazz, String... methodNames) { return WhiteboxImpl.getMethods(clazz, methodNames); } public static Field getField(Class<?> type, String fieldName); public static Field[] getFields(Class<?> clazz, String... fieldNames); public static Method getMethod(...
try { Whitebox.getMethods(ClassWithSeveralMethodsWithSameName.class, "notFound1", "notFound2", "notFound3"); } catch (MethodNotFoundException e) { assertEquals( "No methods matching the name(s) notFound1, notFound2 or notFound3 were found in the class hierarch...
[FOCAL] public static Method[] Whitebox.getMethods(Class<?> clazz, String... methodNames) [CLASS] class Whitebox [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] WhiteboxImpl.getMethods/2 [INPUTS] branches=- | result=clazz, methodNames [DATAFLOW] clazz@param->L2; methodNames@param->...
/* static context [FOCAL] public static Method[] Whitebox.getMethods(Class<?> clazz, String... methodNames) [INPUTS] branches=- | result=clazz, methodNames [CALLS-EXTERNAL] WhiteboxImpl.getMethods/2 */
/* static context [FOCAL] public static Method[] Whitebox.getMethods(Class<?> clazz, String... methodNames) [INPUTS] branches=- | result=clazz, methodNames [CALLS-EXTERNAL] WhiteboxImpl.getMethods/2 */ class Whitebox { public static Method[] getMethods(Class<?> clazz, String... methodNames) { return WhiteboxImpl.ge...
true
ok
{"focal": {"class": "Whitebox", "name": "getMethods", "signature": "Method[] getMethods(Class<?> clazz, String... methodNames)", "start_line": 3, "modifiers": "public static", "params": [{"name": "clazz", "type": "Class<?>"}, {"name": "methodNames", "type": "String..."}], "return_type": "Method[]"}, "class_info": {"nam...
20256052_0
class VariableStatementResolver implements StatementResolver { private void injectVariables(Map<String, String> variables, Statement statement) { if (statement instanceof VariablesAware) { ((VariablesAware) statement).setVariables(variables); } } public VariableStatementResolv...
VariableAwareFact factMock = mock(VariableAwareFact.class); variableStatementResolver.addStatement("a ${b} c", factMock, Fact.class); assertEquals(factMock, variableStatementResolver.resolveStatement("a value c", Fact.class)); Map<String, String> expectedVariables = new HashMap<String, S...
[FOCAL] private void VariableStatementResolver.injectVariables(Map<String, String> variables, Statement statement) [CLASS] class VariableStatementResolver implements StatementResolver [METRICS] loc=5 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] ((VariablesAware) statement).setVariables/1 [PATH1...
/* static context [FOCAL] private void VariableStatementResolver.injectVariables(Map<String, String> variables, Statement statement) [PATH1] if(statement instanceof VariablesAware)=T [PATH2] if(statement instanceof VariablesAware)=F [INPUTS] branches=statement | result=- [CALLS-EXTERNAL] ((VariablesAware) statement).se...
/* static context [FOCAL] private void VariableStatementResolver.injectVariables(Map<String, String> variables, Statement statement) [PATH1] if(statement instanceof VariablesAware)=T [PATH2] if(statement instanceof VariablesAware)=F [INPUTS] branches=statement | result=- [CALLS-EXTERNAL] ((VariablesAware) statement).se...
true
ok
{"focal": {"class": "VariableStatementResolver", "name": "injectVariables", "signature": "void injectVariables(Map<String, String> variables, Statement statement)", "start_line": 3, "modifiers": "private", "params": [{"name": "variables", "type": "Map<String, String>"}, {"name": "statement", "type": "Statement"}], "ret...
20281385_0
class PropertyUtil { public static String getProperty(String str) { String value = ""; String defaultValue = ""; if( !StringUtils.isNullOrEmpty(str) && str.startsWith("${") && str.endsWith("}") ) { String variable = str.trim().substring(2, str.length()-1); if( varia...
Assert.assertEquals("1", PropertyUtil.getProperty("${test:1}")); Assert.assertEquals("", PropertyUtil.getProperty("${test}")); System.setProperty("test", "2"); Assert.assertEquals("2", PropertyUtil.getProperty("${test}")); Assert.assertEquals("2", PropertyUtil.getProperty("${tes...
[FOCAL] public static String PropertyUtil.getProperty(String str) [CLASS] class PropertyUtil [METRICS] loc=20 cc=4 branches=3 loops=0 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] StringUtils.isNullOrEmpty/1, String.startsWith/1, String.endsWith/1, str.trim().substring/2, String.trim/0, String.length/0, String.contains...
/* static context [FOCAL] public static String PropertyUtil.getProperty(String str) [PATH1] if(!StringUtils.isNullOrEmpty(str) && str.startsWith("${") && str.endsWith("}"))=T -> if(variable.contains(":"))=T -> if(StringUtils.isNullOrEmpty(value))=T -> return value [PATH2] if(!StringUtils.isNullOrEmpty(str) && str.start...
/* static context [FOCAL] public static String PropertyUtil.getProperty(String str) [PATH1] if(!StringUtils.isNullOrEmpty(str) && str.startsWith("${") && str.endsWith("}"))=T -> if(variable.contains(":"))=T -> if(StringUtils.isNullOrEmpty(value))=T -> return value [PATH2] if(!StringUtils.isNullOrEmpty(str) && str.start...
true
ok
{"focal": {"class": "PropertyUtil", "name": "getProperty", "signature": "String getProperty(String str)", "start_line": 3, "modifiers": "public static", "params": [{"name": "str", "type": "String"}], "return_type": "String"}, "class_info": {"name": "PropertyUtil", "kind": "class", "modifiers": "", "superclass": null, "...
20303761_199
class RegionMergeTransaction { public boolean prepare(final RegionServerServices services) { if (!region_a.getTableDesc().getTableName() .equals(region_b.getTableDesc().getTableName())) { LOG.info("Can't merge regions " + region_a + "," + region_b + " because they do not belong to the sam...
HStore storeMock = Mockito.mock(HStore.class); when(storeMock.hasReferences()).thenReturn(true); when(storeMock.getFamily()).thenReturn(new HColumnDescriptor("cf")); when(storeMock.close()).thenReturn(ImmutableList.<StoreFile>of()); this.region_a.stores.put(Bytes.toBytes(""), storeMock); RegionM...
[FOCAL] public boolean RegionMergeTransaction.prepare(RegionServerServices services) [CLASS] class RegionMergeTransaction [METRICS] loc=50 cc=7 branches=5 loops=0 returns=7 throws=0 nesting=2 [CALLS-INTERNAL] HRegionInfo getMergedRegionInfo(HRegionInfo a, HRegionInfo b); boolean hasMergeQualifierInMeta(RegionServerServ...
/* static context [FOCAL] public boolean RegionMergeTransaction.prepare(RegionServerServices services) [PATH1] if(!region_a.getTableDesc().getTableName() .equals(region_b.getTableDesc().getTableName()))=F -> if(region_a.getRegionInfo().equals(region_b.getRegionInfo()))=F -> if(!forcible && !HRegionInfo.areAdjacent(regi...
/* static context [FOCAL] public boolean RegionMergeTransaction.prepare(RegionServerServices services) [PATH1] if(!region_a.getTableDesc().getTableName() .equals(region_b.getTableDesc().getTableName()))=F -> if(region_a.getRegionInfo().equals(region_b.getRegionInfo()))=F -> if(!forcible && !HRegionInfo.areAdjacent(regi...
true
ok
{"focal": {"class": "RegionMergeTransaction", "name": "prepare", "signature": "boolean prepare(RegionServerServices services)", "start_line": 3, "modifiers": "public", "params": [{"name": "services", "type": "RegionServerServices"}], "return_type": "boolean"}, "class_info": {"name": "RegionMergeTransaction", "kind": "c...
20320123_137
class Trace { public static Tracer trace(String desc, Parameter... parameters) { TraceCollector collector = _tracer.get(); if (collector == null) { return DO_NOTHING; } TracerImpl tracer = new TracerImpl(desc, parameters, collector.getNextId(), collector.getScope()); collector.add(tracer); ...
Trace.setStorage(new BaseTraceStorage(new BlurConfiguration()) { @Override public void store(TraceCollector collector) { assertEquals("test", collector.getId().getRootId()); assertEquals(3, collector.getTraces().size()); } @Override public void close() throws IOExcepti...
[FOCAL] public static Tracer Trace.trace(String desc, Parameter... parameters) [CLASS] class Trace [METRICS] loc=9 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] _tracer.get/0, TraceCollector.getNextId/0, TraceCollector.getScope/0, TraceCollector.add/1 [NEW] TracerImpl [PATH1] if(collector == nul...
/* static context [FOCAL] public static Tracer Trace.trace(String desc, Parameter... parameters) [PATH1] if(collector == null)=T -> return DO_NOTHING [PATH2] if(collector == null)=F -> return tracer [INPUTS] branches=- | result=desc, parameters [NEW] TracerImpl [CALLS-EXTERNAL] _tracer.get/0, TraceCollector.getNextId/0...
/* static context [FOCAL] public static Tracer Trace.trace(String desc, Parameter... parameters) [PATH1] if(collector == null)=T -> return DO_NOTHING [PATH2] if(collector == null)=F -> return tracer [INPUTS] branches=- | result=desc, parameters [NEW] TracerImpl [CALLS-EXTERNAL] _tracer.get/0, TraceCollector.getNextId/0...
true
ok
{"focal": {"class": "Trace", "name": "trace", "signature": "Tracer trace(String desc, Parameter... parameters)", "start_line": 3, "modifiers": "public static", "params": [{"name": "desc", "type": "String"}, {"name": "parameters", "type": "Parameter..."}], "return_type": "Tracer"}, "class_info": {"name": "Trace", "kind"...
20321029_18
class CronExpression { public ZonedDateTime nextTimeAfter(ZonedDateTime afterTime) { // will search for the next time within the next 4 years. If there is no // time matching, an InvalidArgumentException will be thrown (it is very // likely that the cron expression is invalid, like the Febr...
CronExpression cronExpr = new CronExpression("0 0 0 9W * *"); // 9 - is weekday in may ZonedDateTime after = ZonedDateTime.of(2012, 5, 2, 0, 0, 0, 0, zoneId); ZonedDateTime expected = ZonedDateTime.of(2012, 5, 9, 0, 0, 0, 0, zoneId); assertEquals(expected, cronExpr.nextTimeAfter...
[FOCAL] public ZonedDateTime CronExpression.nextTimeAfter(ZonedDateTime afterTime) [CLASS] class CronExpression [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] ZonedDateTime nextTimeAfter(ZonedDateTime afterTime, long durationInMillis) [CALLS-EXTERNAL] ZonedDateTime.plusYears/1 [IN...
/* static context [FOCAL] public ZonedDateTime CronExpression.nextTimeAfter(ZonedDateTime afterTime) [INPUTS] branches=- | result=afterTime [COLLABORATORS] param afterTime:ZonedDateTime plusYears/1 [CALLS-INTERNAL] ZonedDateTime nextTimeAfter(ZonedDateTime afterTime, long durationInMillis) [CALLS-EXTERNAL] ZonedDateTim...
/* static context [FOCAL] public ZonedDateTime CronExpression.nextTimeAfter(ZonedDateTime afterTime) [INPUTS] branches=- | result=afterTime [COLLABORATORS] param afterTime:ZonedDateTime plusYears/1 [CALLS-INTERNAL] ZonedDateTime nextTimeAfter(ZonedDateTime afterTime, long durationInMillis) [CALLS-EXTERNAL] ZonedDateTim...
true
ok
{"focal": {"class": "CronExpression", "name": "nextTimeAfter", "signature": "ZonedDateTime nextTimeAfter(ZonedDateTime afterTime)", "start_line": 3, "modifiers": "public", "params": [{"name": "afterTime", "type": "ZonedDateTime"}], "return_type": "ZonedDateTime"}, "class_info": {"name": "CronExpression", "kind": "class...
20332528_2
class Pig { public void execute(String path) { execute(path, (String) null, (Type) null, (Callback) null); } private Pig(Context context); Pig(Context context, WebViewWrapper webViewWrapper); public static Pig get(Context context); public void execute(String path, Callback<R> callb...
Pig pig = PigTestUtils.getMockedPiggie(); PigTestUtils.addMockHandler(pig, new MockWebViewWrapper.Handler(pig) { public void handle(String data) { send("1"); } }); stringReceived = false; stringReceivedError = null; stringReceived...
[FOCAL] public void Pig.execute(String path) [CLASS] class Pig [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void execute(String path, D data, Type responseType, Callback<R> callback) [DATAFLOW] path@param->L2 [CLASS-MEMBERS] Pig(Context context); Pig(Context context, WebViewWrap...
/* static context [FOCAL] public void Pig.execute(String path) [CALLS-INTERNAL] void execute(String path, D data, Type responseType, Callback<R> callback) */
/* static context [FOCAL] public void Pig.execute(String path) [CALLS-INTERNAL] void execute(String path, D data, Type responseType, Callback<R> callback) */ class Pig { public void execute(String path) { execute(path, (String) null, (Type) null, (Callback) null); } private Pig(Context context); ...
true
ok
{"focal": {"class": "Pig", "name": "execute", "signature": "void execute(String path)", "start_line": 3, "modifiers": "public", "params": [{"name": "path", "type": "String"}], "return_type": "void"}, "class_info": {"name": "Pig", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"nam...
20336406_9
class Game { public void addListener(AchievementListener listener) { listeners.add(listener); } public abstract void insertAchievement(Object user, Achievement a); public abstract void deleteAchievement(Object user, Achievement a); public abstract void updateAchievement(Object user, Achievement a); public abs...
AchievementListenerMock mock = new AchievementListenerMock(); Achievement a2 = new Point(10,"point"); game.addListener(mock); game.addAchievement("user",a2); mock.verifyReceivedAchievements("user",a2); } }
[FOCAL] public void Game.addListener(AchievementListener listener) [CLASS] class Game [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] listeners.add/1 [COLLABORATORS] field listeners add/1 [DATAFLOW] listener@param->L2 [CLASS-MEMBERS] void insertAchievement(Object user, Achievement ...
/* static context [FOCAL] public void Game.addListener(AchievementListener listener) [COLLABORATORS] field listeners add/1 [CALLS-EXTERNAL] listeners.add/1 */
/* static context [FOCAL] public void Game.addListener(AchievementListener listener) [COLLABORATORS] field listeners add/1 [CALLS-EXTERNAL] listeners.add/1 */ class Game { public void addListener(AchievementListener listener) { listeners.add(listener); } public abstract void insertAchievement(Object user, Achiev...
true
ok
{"focal": {"class": "Game", "name": "addListener", "signature": "void addListener(AchievementListener listener)", "start_line": 3, "modifiers": "public", "params": [{"name": "listener", "type": "AchievementListener"}], "return_type": "void"}, "class_info": {"name": "Game", "kind": "class", "modifiers": "", "superclass"...
20337377_1
class MessageService { public String getMessage() { return "Hello World!"; } private MessageService messageService; } class MessageServiceTest { private MessageService messageService; @Test public void getMessage_ShouldReturnMessage() {
assertEquals("Hello World!", messageService.getMessage()); } }
[FOCAL] public String MessageService.getMessage() [CLASS] class MessageService [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [TEST] MessageServiceTest: @Test public void getMessage_ShouldReturnMessage() [TEST-FIELDS] MessageService messageService
/* static context [FOCAL] public String MessageService.getMessage() */
/* static context [FOCAL] public String MessageService.getMessage() */ class MessageService { public String getMessage() { return "Hello World!"; } private MessageService messageService; } class MessageServiceTest { private MessageService messageService; @Test public void getMessag...
true
ok
{"focal": {"class": "MessageService", "name": "getMessage", "signature": "String getMessage()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "MessageService", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "messageS...
20356428_5
class AbstractTabOverlayHandler implements PacketHandler, TabOverlayHandler { @Override public <R> R enterContentOperationMode(ContentOperationMode<R> operationMode) { AbstractContentOperationModeHandler<?> handler; if (operationMode == ContentOperationMode.PASS_TROUGH) { handler = ...
SimpleTabOverlay tabOverlay = tabOverlayHandler.enterContentOperationMode(ContentOperationMode.SIMPLE); for (int size = 1; size <= 80; size++) { tabOverlay.setSize(size); assertEquals("Size check failed for size " + size, size, clientTabList.getSize()); tabOverlay....
[FOCAL] @Override public R AbstractTabOverlayHandler.enterContentOperationMode(ContentOperationMode<R> operationMode) [CLASS] class AbstractTabOverlayHandler implements PacketHandler, TabOverlayHandler [METRICS] loc=16 cc=4 branches=3 loops=0 returns=1 throws=1 nesting=3 [CALLS-INTERNAL] void scheduleUpdate() [CALLS-EX...
/* static context [FOCAL] @Override public R AbstractTabOverlayHandler.enterContentOperationMode(ContentOperationMode<R> operationMode) [THROWS-WHEN] UnsupportedOperationException when !(operationMode == ContentOperationMode.PASS_TROUGH) && !(operationMode == ContentOperationMode.SIMPLE) && !(operationMode == ContentOp...
/* static context [FOCAL] @Override public R AbstractTabOverlayHandler.enterContentOperationMode(ContentOperationMode<R> operationMode) [THROWS-WHEN] UnsupportedOperationException when !(operationMode == ContentOperationMode.PASS_TROUGH) && !(operationMode == ContentOperationMode.SIMPLE) && !(operationMode == ContentOp...
true
ok
{"focal": {"class": "AbstractTabOverlayHandler", "name": "enterContentOperationMode", "signature": "R enterContentOperationMode(ContentOperationMode<R> operationMode)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "operationMode", "type": "ContentOperationMode<R>"}], "return_type": "R"}, "class...
20374886_5
class BCryptPasswordEncoder implements PasswordEncoder { public boolean matches(CharSequence rawPassword, String encodedPassword) { if (encodedPassword == null || encodedPassword.length() == 0) { logger.warning("Empty encoded password"); return false; } if (!BCRYPT_PATTERN.matcher(encodedPassword).matche...
String rawPassword = "test"; boolean matched = this.instance.matches(rawPassword, "notmatched"); assertFalse(matched); } }
[FOCAL] public boolean BCryptPasswordEncoder.matches(CharSequence rawPassword, String encodedPassword) [CLASS] class BCryptPasswordEncoder implements PasswordEncoder [METRICS] loc=13 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1 [CALLS-EXTERNAL] String.length/0, logger.warning/1, BCRYPT_PATTERN.matcher(encodedPa...
/* static context [FOCAL] public boolean BCryptPasswordEncoder.matches(CharSequence rawPassword, String encodedPassword) [PATH1] if(encodedPassword == null || encodedPassword.length() == 0)=F -> if(!BCRYPT_PATTERN.matcher(encodedPassword).matches())=T -> return false [PATH2] if(encodedPassword == null || encodedPasswor...
/* static context [FOCAL] public boolean BCryptPasswordEncoder.matches(CharSequence rawPassword, String encodedPassword) [PATH1] if(encodedPassword == null || encodedPassword.length() == 0)=F -> if(!BCRYPT_PATTERN.matcher(encodedPassword).matches())=T -> return false [PATH2] if(encodedPassword == null || encodedPasswor...
true
ok
{"focal": {"class": "BCryptPasswordEncoder", "name": "matches", "signature": "boolean matches(CharSequence rawPassword, String encodedPassword)", "start_line": 3, "modifiers": "public", "params": [{"name": "rawPassword", "type": "CharSequence"}, {"name": "encodedPassword", "type": "String"}], "return_type": "boolean"},...
20426356_0
class BidRestService { @POST @Consumes("application/json") @Produces("application/json") public Bid addBid(Bid bid) { return bidService.addBid(bid); } @GET @Path("{id}") @Produces("application/json") public Bid getBid(@PathParam("id") Long id); @PUT @Path("{id}") @Consumes("applica...
WebTarget target = ClientBuilder.newClient() .target("http://localhost:8080/actionbazaar-rest-test/rest/bids"); // Save a new bid. Bid bid = new Bid(); bid.setBidder("nrahman"); bid.setItem("Test item"); bid.setAmount(130.75); bid = target.reques...
[FOCAL] @POST @Consumes("application/json") @Produces("application/json") public Bid BidRestService.addBid(Bid bid) [CLASS] class BidRestService [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] bidService.addBid/1 [INPUTS] branches=- | result=bid [COLLABORATORS] field bidService add...
/* static context [FOCAL] @POST @Consumes("application/json") @Produces("application/json") public Bid BidRestService.addBid(Bid bid) [INPUTS] branches=- | result=bid [COLLABORATORS] field bidService addBid/1 [CALLS-EXTERNAL] bidService.addBid/1 */
/* static context [FOCAL] @POST @Consumes("application/json") @Produces("application/json") public Bid BidRestService.addBid(Bid bid) [INPUTS] branches=- | result=bid [COLLABORATORS] field bidService addBid/1 [CALLS-EXTERNAL] bidService.addBid/1 */ class BidRestService { @POST @Consumes("application/json") ...
true
ok
{"focal": {"class": "BidRestService", "name": "addBid", "signature": "Bid addBid(Bid bid)", "start_line": 3, "modifiers": "@POST @Consumes(\"application/json\") @Produces(\"application/json\") public", "params": [{"name": "bid", "type": "Bid"}], "return_type": "Bid"}, "class_info": {"name": "BidRestService", "kind": "c...
20432793_28
class AWSRunInstancesOptions extends RunInstancesOptions { @Override public AWSRunInstancesOptions asType(String type) { launchSpecificationBuilder.instanceType(type); return AWSRunInstancesOptions.class.cast(super.asType(type)); } public AWSRunInstancesOptions inPlacementGroup(String placemen...
AWSRunInstancesOptions options = new AWSRunInstancesOptions(); options.asType(InstanceType.C1_XLARGE); assertEquals(options.buildFormParameters().get("InstanceType"), ImmutableList.of("c1.xlarge")); } }
[FOCAL] @Override public AWSRunInstancesOptions AWSRunInstancesOptions.asType(String type) [CLASS] class AWSRunInstancesOptions extends RunInstancesOptions [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] launchSpecificationBuilder.instanceType/1, AWSRunInstancesOptions.class.cast/1...
/* static context [FOCAL] @Override public AWSRunInstancesOptions AWSRunInstancesOptions.asType(String type) [INPUTS] branches=- | result=type [COLLABORATORS] field launchSpecificationBuilder instanceType/1 [CALLS-EXTERNAL] launchSpecificationBuilder.instanceType/1, AWSRunInstancesOptions.class.cast/1, RunInstancesOpti...
/* static context [FOCAL] @Override public AWSRunInstancesOptions AWSRunInstancesOptions.asType(String type) [INPUTS] branches=- | result=type [COLLABORATORS] field launchSpecificationBuilder instanceType/1 [CALLS-EXTERNAL] launchSpecificationBuilder.instanceType/1, AWSRunInstancesOptions.class.cast/1, RunInstancesOpti...
true
ok
{"focal": {"class": "AWSRunInstancesOptions", "name": "asType", "signature": "AWSRunInstancesOptions asType(String type)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "type", "type": "String"}], "return_type": "AWSRunInstancesOptions"}, "class_info": {"name": "AWSRunInstancesOptions", "kind": ...
20433857_36
class DIRClient implements TimeServerClient { public AddressMappingSet xtreemfs_address_mappings_get(InetSocketAddress server, final Auth authHeader, final UserCredentials userCreds, final String uuid) throws IOException, InterruptedException { return xtreemfs_address_mappings_get(server, authH...
dir1.donotAnswer = true; dir2.donotAnswer = true; try { DIRClient client = new DIRClient(testEnv.getDirClient(), servers, 5, 2); client.xtreemfs_address_mappings_get(null, RPCAuthentication.authNone, RPCAuthentication.userService, "*"); fail("Expected excepti...
[FOCAL] public AddressMappingSet DIRClient.xtreemfs_address_mappings_get(InetSocketAddress server, Auth authHeader, UserCredentials userCreds, String uuid) [CLASS] class DIRClient implements TimeServerClient [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] AddressMappingSet xtreemfs...
/* static context [FOCAL] public AddressMappingSet DIRClient.xtreemfs_address_mappings_get(InetSocketAddress server, Auth authHeader, UserCredentials userCreds, String uuid) [INPUTS] branches=- | result=authHeader, server, userCreds, uuid [EXCEPTIONS] declares IOException, InterruptedException [CALLS-INTERNAL] AddressM...
/* static context [FOCAL] public AddressMappingSet DIRClient.xtreemfs_address_mappings_get(InetSocketAddress server, Auth authHeader, UserCredentials userCreds, String uuid) [INPUTS] branches=- | result=authHeader, server, userCreds, uuid [EXCEPTIONS] declares IOException, InterruptedException [CALLS-INTERNAL] AddressM...
true
ok
{"focal": {"class": "DIRClient", "name": "xtreemfs_address_mappings_get", "signature": "AddressMappingSet xtreemfs_address_mappings_get(InetSocketAddress server, Auth authHeader, UserCredentials userCreds, String uuid) throws IOException, InterruptedException", "start_line": 3, "modifiers": "public", "params": [{"name"...
20439978_2
class ActionHandler { public abstract Percept performAction(Action action) throws ActExceptionpublic abstract Percept performAction(Action action) throws ActException; public abstract Percept performAction(Action action) throws ActExceptionpublic abstract boolean isSupportedByEntity(Action action); public abstract Pe...
Percept percept = handler.performAction(new Action("getX")); assertEquals(new Percept("getX", new Numeral(0)), percept); percept = handler.performAction(new Action("setX", new Numeral(1))); assertEquals(null, percept); percept = handler.performAction(new Action("getX")); assertEquals(new Percept("getX", n...
[FOCAL] public abstract Percept ActionHandler.performAction(Action action) [CLASS] class ActionHandler [METRICS] loc=1 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [EXCEPTIONS] declares ActException [CLASS-MEMBERS] boolean isSupportedByEntity(Action action); void reset() [TEST] ActionHandlerTest: @Test public v...
/* static context [FOCAL] public abstract Percept ActionHandler.performAction(Action action) [EXCEPTIONS] declares ActException */
/* static context [FOCAL] public abstract Percept ActionHandler.performAction(Action action) [EXCEPTIONS] declares ActException */ class ActionHandler { public abstract Percept performAction(Action action) throws ActExceptionpublic abstract Percept performAction(Action action) throws ActException; public abstract Per...
true
partial
{"focal": {"class": "ActionHandler", "name": "performAction", "signature": "Percept performAction(Action action) throws ActException", "start_line": 3, "modifiers": "public abstract", "params": [{"name": "action", "type": "Action"}], "return_type": "Percept"}, "class_info": {"name": "ActionHandler", "kind": "class", "m...
20456181_2
class RandomLoadBalancer implements LoadBalancer { @Override public ServerStats choose(List<ServerStats> availableServerStats) { int index = random.nextInt(availableServerStats.size()); return availableServerStats.get(index); } } class RandomLoadBalancerTest { @Test public void o...
ServerInstance serverInstance = new ServerInstance("dummy","dummy","localhost",false,-1,81); serverInstance.setAvailable(true); ServerStats serverStats = new ServerStats(); serverStats.setServerInstance(serverInstance); RandomLoadBalancer lb = new RandomLoadBalancer(); S...
[FOCAL] @Override public ServerStats RandomLoadBalancer.choose(List<ServerStats> availableServerStats) [CLASS] class RandomLoadBalancer implements LoadBalancer [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] random.nextInt/1, List<ServerStats>.size/0, List<ServerStats>.get/1 [INPUT...
/* static context [FOCAL] @Override public ServerStats RandomLoadBalancer.choose(List<ServerStats> availableServerStats) [INPUTS] branches=- | result=availableServerStats [COLLABORATORS] field random nextInt/1; param availableServerStats:List<ServerStats> size/0,get/1 [CALLS-EXTERNAL] random.nextInt/1, List<ServerStats...
/* static context [FOCAL] @Override public ServerStats RandomLoadBalancer.choose(List<ServerStats> availableServerStats) [INPUTS] branches=- | result=availableServerStats [COLLABORATORS] field random nextInt/1; param availableServerStats:List<ServerStats> size/0,get/1 [CALLS-EXTERNAL] random.nextInt/1, List<ServerStats...
true
ok
{"focal": {"class": "RandomLoadBalancer", "name": "choose", "signature": "ServerStats choose(List<ServerStats> availableServerStats)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "availableServerStats", "type": "List<ServerStats>"}], "return_type": "ServerStats"}, "class_info": {"name": "Rando...
20473418_5
class SequentialIntegerDataGenerator implements RuleBasedDataGenerator { @Override public DataValue getDataValue() { return new DataValue(columnRule.getType(), String.valueOf((counter.getAndIncrement() % (maxValue - minValue + 1)) + minValue)); } public SequentialIntegerDataGenerator(Column c...
Column columnA = new Column(); columnA.setType(INTEGER); columnA.setDataSequence(DataSequence.SEQUENTIAL); columnA.setMinValue(1); columnA.setMaxValue(3); generator = new SequentialIntegerDataGenerator(columnA); DataValue result1 = generator.getDataValue(); ...
[FOCAL] @Override public DataValue SequentialIntegerDataGenerator.getDataValue() [CLASS] class SequentialIntegerDataGenerator implements RuleBasedDataGenerator [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] columnRule.getType/0, String.valueOf/1, counter.getAndIncrement/0 [NEW] Da...
/* static context [FOCAL] @Override public DataValue SequentialIntegerDataGenerator.getDataValue() [COLLABORATORS] field columnRule getType/0; field counter getAndIncrement/0 [NEW] DataValue [CALLS-EXTERNAL] columnRule.getType/0, String.valueOf/1, counter.getAndIncrement/0 */
/* static context [FOCAL] @Override public DataValue SequentialIntegerDataGenerator.getDataValue() [COLLABORATORS] field columnRule getType/0; field counter getAndIncrement/0 [NEW] DataValue [CALLS-EXTERNAL] columnRule.getType/0, String.valueOf/1, counter.getAndIncrement/0 */ class SequentialIntegerDataGenerator implem...
true
ok
{"focal": {"class": "SequentialIntegerDataGenerator", "name": "getDataValue", "signature": "DataValue getDataValue()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "DataValue"}, "class_info": {"name": "SequentialIntegerDataGenerator", "kind": "class", "modifiers": "", "superclass": nul...
20499820_5
class Api { @NonNull @WorkerThread public CallResult<Depth> depth(@NonNull String pair) { final String serverPair = PairUtils.localToServer(pair); final String url = hostUrl + "/api/3/depth/" + serverPair; JsonObject response = guestApi.call(url); CallResult<Depth> result = ...
when(mockGuestApi.call(anyString())) .thenReturn(JSON_PARSER.parse("{\"success\":0," + " \"error\":\"Invalid pair name: btc_us\"}").getAsJsonObject()); CallResult<Depth> depthCallResult = testable.depth("BTC/US"); assertFalse(depthCallResult.isSuccess());...
[FOCAL] @NonNull @WorkerThread public CallResult<Depth> Api.depth(String pair) [CLASS] class Api [METRICS] loc=18 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] PairUtils.localToServer/1, guestApi.call/1, JsonObject.has/1, response.get(ERROR_KEY).getAsString/0, JsonObject.get/1, Depth.create/2, J...
/* static context [FOCAL] @NonNull @WorkerThread public CallResult<Depth> Api.depth(String pair) [PATH1] if(response == null || response.has(SUCCESS_KEY))=T -> return result [PATH2] if(response == null || response.has(SUCCESS_KEY))=F -> return result [INPUTS] branches=pair | result=- [COLLABORATORS] field guestApi call...
/* static context [FOCAL] @NonNull @WorkerThread public CallResult<Depth> Api.depth(String pair) [PATH1] if(response == null || response.has(SUCCESS_KEY))=T -> return result [PATH2] if(response == null || response.has(SUCCESS_KEY))=F -> return result [INPUTS] branches=pair | result=- [COLLABORATORS] field guestApi call...
true
ok
{"focal": {"class": "Api", "name": "depth", "signature": "CallResult<Depth> depth(String pair)", "start_line": 3, "modifiers": "@NonNull @WorkerThread public", "params": [{"name": "pair", "type": "String"}], "return_type": "CallResult<Depth>"}, "class_info": {"name": "Api", "kind": "class", "modifiers": "", "superclass...
20501508_0
class DemoController implements Serializable { public void updateIntModel(AjaxBehaviorEvent event) { intModel.setValue(intModel.getValue() + UPDATE_INT_VALUE); eduContext.update("int-model-changed"); } public DemoModel<String> getStringModel(); public DemoModel<Integer> getIntModel(); ...
final String initialStringValue = controller.getStringModel().getValue(); final int initialIntValue = controller.getIntModel().getValue(); controller.updateIntModel(mock(AjaxBehaviorEvent.class)); assertThat(controller.getStringModel().getValue(), is(initialStringValue)); assert...
[FOCAL] public void DemoController.updateIntModel(AjaxBehaviorEvent event) [CLASS] class DemoController implements Serializable [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] intModel.setValue/1, intModel.getValue/0, eduContext.update/1 [INPUTS] branches=- | result=- | unused=even...
/* static context [FOCAL] public void DemoController.updateIntModel(AjaxBehaviorEvent event) [INPUTS] branches=- | result=- | unused=event [COLLABORATORS] field intModel setValue/1,getValue/0; field eduContext update/1 [CALLS-EXTERNAL] intModel.setValue/1, intModel.getValue/0, eduContext.update/1 */
/* static context [FOCAL] public void DemoController.updateIntModel(AjaxBehaviorEvent event) [INPUTS] branches=- | result=- | unused=event [COLLABORATORS] field intModel setValue/1,getValue/0; field eduContext update/1 [CALLS-EXTERNAL] intModel.setValue/1, intModel.getValue/0, eduContext.update/1 */ class DemoControlle...
true
ok
{"focal": {"class": "DemoController", "name": "updateIntModel", "signature": "void updateIntModel(AjaxBehaviorEvent event)", "start_line": 3, "modifiers": "public", "params": [{"name": "event", "type": "AjaxBehaviorEvent"}], "return_type": "void"}, "class_info": {"name": "DemoController", "kind": "class", "modifiers": ...
20517345_6
class DiagnosticContextFilter implements Filter { @Override public void init(FilterConfig config) throws ServletException { String headerName = config.getInitParameter(CORRELATION_ID_HEADER_NAME_PARAM); if (headerName == null) { LOG.debug("Parameter {} not configured via filter config.", CORRELATION...
// setup DiagnosticContextFilter filter = new DiagnosticContextFilter(); String field = (String) ReflectionTestUtils.getField(DiagnosticContextFilter.class, CORRELATION_ID_HEADER_NAME_PARAM_FIELD_NAME); assertThat(field).isNotNull(); String nonDefaultParameter = "test"; when(this.config...
[FOCAL] @Override public void DiagnosticContextFilter.init(FilterConfig config) [CLASS] class DiagnosticContextFilter implements Filter [METRICS] loc=26 cc=4 branches=2 loops=0 returns=0 throws=0 nesting=2 [CALLS-EXTERNAL] FilterConfig.getInitParameter/1, LOG.debug/2, LOG.info/2, FilterConfig.getServletContext/0, org.s...
/* static context [FOCAL] @Override public void DiagnosticContextFilter.init(FilterConfig config) [PATH1] if(headerName == null)=T -> if(this.diagnosticContextFacade == null)=T -> try-body throws [PATH2] if(headerName == null)=F -> if(this.diagnosticContextFacade == null)=F [INPUTS] branches=config, CORRELATION_ID_HEAD...
/* static context [FOCAL] @Override public void DiagnosticContextFilter.init(FilterConfig config) [PATH1] if(headerName == null)=T -> if(this.diagnosticContextFacade == null)=T -> try-body throws [PATH2] if(headerName == null)=F -> if(this.diagnosticContextFacade == null)=F [INPUTS] branches=config, CORRELATION_ID_HEAD...
true
ok
{"focal": {"class": "DiagnosticContextFilter", "name": "init", "signature": "void init(FilterConfig config) throws ServletException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "config", "type": "FilterConfig"}], "return_type": "void"}, "class_info": {"name": "DiagnosticContextFilter", "kind"...
20522047_10
class KeyStoreOperations implements IKeyStoreOperations { @Override public <T> void updateOrCreateDTOList(List<T> toUpdate, KeySet keySet, JsonWriter<T> jsonWriter, List<Long> oids) { int i = 0; for (T type : toUpdate) { final String key = keySet.createKey(String.valueOf(oids.get(i))); localStorage.setItem...
KeyStoreOperations ops = new KeyStoreOperations(storage, keySetJsonReader, keySetJsonWriter); List<TestDto> list = new ArrayList<TestDto>(); list.add(new TestDto(1, "Test1")); list.add(new TestDto(2, "Test2")); list.add(new TestDto(3, "Test3")); KeySet keySet = new KeySet(TestDto.class, "user", "UC_LIST"); ...
[FOCAL] @Override public void KeyStoreOperations.updateOrCreateDTOList(List<T> toUpdate, KeySet keySet, JsonWriter<T> jsonWriter, List<Long> oids) [CLASS] class KeyStoreOperations implements IKeyStoreOperations [METRICS] loc=10 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] KeySet.createKey/1, St...
/* static context [FOCAL] @Override public void KeyStoreOperations.updateOrCreateDTOList(List<T> toUpdate, KeySet keySet, JsonWriter<T> jsonWriter, List<Long> oids) [PATH1] foreach(T type : toUpdate)=T -> exit loop [PATH2] foreach(T type : toUpdate)=F [INPUTS] branches=toUpdate | result=- [COLLABORATORS] param keySet:K...
/* static context [FOCAL] @Override public void KeyStoreOperations.updateOrCreateDTOList(List<T> toUpdate, KeySet keySet, JsonWriter<T> jsonWriter, List<Long> oids) [PATH1] foreach(T type : toUpdate)=T -> exit loop [PATH2] foreach(T type : toUpdate)=F [INPUTS] branches=toUpdate | result=- [COLLABORATORS] param keySet:K...
true
ok
{"focal": {"class": "KeyStoreOperations", "name": "updateOrCreateDTOList", "signature": "void updateOrCreateDTOList(List<T> toUpdate, KeySet keySet, JsonWriter<T> jsonWriter, List<Long> oids)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "toUpdate", "type": "List<T>"}, {"name": "keySet", "type...
20530482_7
class PatternMatcher { public static boolean match(Writable value, String regex) { if (value == null) { return false; } String valueStr = value.toString(); if (valueStr == null || valueStr.length() == 0) { return false; } // TODO: Remove Pattern.compile Pattern p = Pattern.compile(regex); Matc...
boolean check = PatternMatcher.match(null, UtilitiesConstantsTestInterface.REGEX); assertFalse(check); } }
[FOCAL] public static boolean PatternMatcher.match(Writable value, String regex) [CLASS] class PatternMatcher [METRICS] loc=15 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1 [CALLS-EXTERNAL] Writable.toString/0, String.length/0, Pattern.compile/1, Pattern.matcher/1, Matcher.matches/0 [PATH1] if(value == null)=F -...
/* static context [FOCAL] public static boolean PatternMatcher.match(Writable value, String regex) [PATH1] if(value == null)=F -> if(valueStr == null || valueStr.length() == 0)=T -> return false [PATH2] if(value == null)=F -> if(valueStr == null || valueStr.length() == 0)=F -> return m.matches() [PATH3] if(value == nul...
/* static context [FOCAL] public static boolean PatternMatcher.match(Writable value, String regex) [PATH1] if(value == null)=F -> if(valueStr == null || valueStr.length() == 0)=T -> return false [PATH2] if(value == null)=F -> if(valueStr == null || valueStr.length() == 0)=F -> return m.matches() [PATH3] if(value == nul...
true
ok
{"focal": {"class": "PatternMatcher", "name": "match", "signature": "boolean match(Writable value, String regex)", "start_line": 3, "modifiers": "public static", "params": [{"name": "value", "type": "Writable"}, {"name": "regex", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "PatternMatcher", "k...
20530820_70
class CassandraUtils { public static Object parseValue(final DataType type, final String value) { if (value == null) { return null; } switch (type.getName()) { case TEXT: case VARCHAR: case ASCII: return value; case INET: return type.parse("'" + value + "'"); case IN...
assertThat(CassandraUtils.parseValue(DataType.cint(), " 1 2 ")) .isEqualTo(12); } }
[FOCAL] public static Object CassandraUtils.parseValue(DataType type, String value) [CLASS] class CassandraUtils [METRICS] loc=23 cc=13 branches=2 loops=0 returns=5 throws=0 nesting=1 [CALLS-EXTERNAL] DataType.getName/0, DataType.parse/1, String.replaceAll/2 [PATH1] if(value == null)=F -> switch(type.getName())=case AS...
/* static context [FOCAL] public static Object CassandraUtils.parseValue(DataType type, String value) [PATH1] if(value == null)=F -> switch(type.getName())=case ASCII -> return value [PATH2] if(value == null)=T -> return null [PATH3] if(value == null)=F -> switch(type.getName())=case INET -> return type.parse("'" + val...
/* static context [FOCAL] public static Object CassandraUtils.parseValue(DataType type, String value) [PATH1] if(value == null)=F -> switch(type.getName())=case ASCII -> return value [PATH2] if(value == null)=T -> return null [PATH3] if(value == null)=F -> switch(type.getName())=case INET -> return type.parse("'" + val...
true
ok
{"focal": {"class": "CassandraUtils", "name": "parseValue", "signature": "Object parseValue(DataType type, String value)", "start_line": 3, "modifiers": "public static", "params": [{"name": "type", "type": "DataType"}, {"name": "value", "type": "String"}], "return_type": "Object"}, "class_info": {"name": "CassandraUtil...
20572012_144
class FunctionDefinitionEquality extends FunctionDefinitionHomogeneousSimple<Boolean, I> { @Override public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) { List<I> convertedArguments = new ArrayList<I>(); Status status = this.validateArguments(arguments, conv...
XPathYearMonthDuration dur1 = new XPathYearMonthDuration(1, 3, 5); XPathYearMonthDuration dur2 = new XPathYearMonthDuration(1, 3, 5); XPathYearMonthDuration differentDur = new XPathYearMonthDuration(-1, 4, 7); FunctionArgumentAttributeValue attrDur1 = null; FunctionArgumentAttributeValue attrDur2 = null; ...
[FOCAL] @Override public ExpressionResult FunctionDefinitionEquality.evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) [CLASS] class FunctionDefinitionEquality extends FunctionDefinitionHomogeneousSimple<Boolean, I> [METRICS] loc=21 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1 [CAL...
/* static context [FOCAL] @Override public ExpressionResult FunctionDefinitionEquality.evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) [PATH1] if(!status.getStatusCode().equals(StdStatusCode.STATUS_CODE_OK))=F -> if(this.isEqual(convertedArguments.get(0), convertedArguments.get(1)))=T ->...
/* static context [FOCAL] @Override public ExpressionResult FunctionDefinitionEquality.evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) [PATH1] if(!status.getStatusCode().equals(StdStatusCode.STATUS_CODE_OK))=F -> if(this.isEqual(convertedArguments.get(0), convertedArguments.get(1)))=T ->...
true
ok
{"focal": {"class": "FunctionDefinitionEquality", "name": "evaluate", "signature": "ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "evaluationContext", "type": "EvaluationContext"}, {"name": "argume...
20576090_0
class MissionLog { static String colorToHTML(int argb) { return String.format("#%06X", argb & 0xffffff); } public MissionLog(CharSequence actionText, CharSequence clockText); public MissionLog(CharSequence actionText); public CharSequence getActionText(); public CharSequence getCloc...
assertEquals("#C7EBFC", MissionLog.colorToHTML(0xffc7ebfc)); assertEquals("#C7EBFC", MissionLog.colorToHTML(0xc7ebfc)); assertEquals("#07EBFC", MissionLog.colorToHTML(0xff07ebfc)); assertEquals("#07EBFC", MissionLog.colorToHTML(0x7ebfc)); assertEquals("#00EBFC", MissionLog.colorT...
[FOCAL] static String MissionLog.colorToHTML(int argb) [CLASS] class MissionLog [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] String.format/2 [INPUTS] branches=- | result=argb [DATAFLOW] argb@param->L2 [CLASS-MEMBERS] MissionLog(CharSequence actionText, CharSequence clockText); M...
/* static context [FOCAL] static String MissionLog.colorToHTML(int argb) [INPUTS] branches=- | result=argb [CALLS-EXTERNAL] String.format/2 */
/* static context [FOCAL] static String MissionLog.colorToHTML(int argb) [INPUTS] branches=- | result=argb [CALLS-EXTERNAL] String.format/2 */ class MissionLog { static String colorToHTML(int argb) { return String.format("#%06X", argb & 0xffffff); } public MissionLog(CharSequence actionText, Char...
true
ok
{"focal": {"class": "MissionLog", "name": "colorToHTML", "signature": "String colorToHTML(int argb)", "start_line": 3, "modifiers": "static", "params": [{"name": "argb", "type": "int"}], "return_type": "String"}, "class_info": {"name": "MissionLog", "kind": "class", "modifiers": "", "superclass": null, "interfaces": nu...
20577351_0
class HoltWintersComputer { public double getAlpha() { return alpha; } public HoltWintersComputer(final double alpha); public HoltWintersComputer(final double alpha, final double beta); public HoltWintersComputer(final double alpha, final double beta, final double gamma, final int perio...
// series<-ts(c(315.42, 316.31, 316.50, 317.56, 318.13, 318.00, 316.39, 314.65, 313.68, 313.18, 314.66, 315.43)) final double[] series = {315.42, 316.31, 316.50, 317.56, 318.13, 318.00, 316.39, 314.65, 313.68, 313.18, 314.66, 315.43}; // smooth<-HoltWinters(co2, alpha=0.8, beta=FALSE, gamma=FAL...
[FOCAL] public double HoltWintersComputer.getAlpha() [CLASS] class HoltWintersComputer [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] HoltWintersComputer(double alpha); HoltWintersComputer(double alpha, double beta); HoltWintersComputer(double alpha, double beta, double gamma, int ...
/* static context [FOCAL] public double HoltWintersComputer.getAlpha() */
/* static context [FOCAL] public double HoltWintersComputer.getAlpha() */ class HoltWintersComputer { public double getAlpha() { return alpha; } public HoltWintersComputer(final double alpha); public HoltWintersComputer(final double alpha, final double beta); public HoltWintersComputer(...
true
ok
{"focal": {"class": "HoltWintersComputer", "name": "getAlpha", "signature": "double getAlpha()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "double"}, "class_info": {"name": "HoltWintersComputer", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "CO...
20582138_2
class JunitSuiteRunner extends ParentRunner<Runner> { @Override protected List<Runner> getChildren() { return fRunners; } public JunitSuiteRunner(Class<?> testClass); private static List<Runner> createRunners(Class<?> testClass); private static Map<String, List<CompleteBehaviour>> findSuitesInClass( Clas...
JunitSuiteRunner testee = new JunitSuiteRunner(ValidTestWithTwoDescriptions.class); List<Runner> actual = testee.getChildren(); assertEquals(createSuiteDescription("a thing"), actual.get(0).getDescription()); assertEquals(createSuiteDescription("another thing"), actual.get(1).getDescript...
[FOCAL] @Override protected List<Runner> JunitSuiteRunner.getChildren() [CLASS] class JunitSuiteRunner extends ParentRunner<Runner> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] JunitSuiteRunner(Class<?> testClass); List<Runner> createRunners(Class<?> testClass); Map<String, List<...
/* static context [FOCAL] @Override protected List<Runner> JunitSuiteRunner.getChildren() */
/* static context [FOCAL] @Override protected List<Runner> JunitSuiteRunner.getChildren() */ class JunitSuiteRunner extends ParentRunner<Runner> { @Override protected List<Runner> getChildren() { return fRunners; } public JunitSuiteRunner(Class<?> testClass); private static List<Runner> createRunners(Class<?...
true
ok
{"focal": {"class": "JunitSuiteRunner", "name": "getChildren", "signature": "List<Runner> getChildren()", "start_line": 3, "modifiers": "@Override protected", "params": [], "return_type": "List<Runner>"}, "class_info": {"name": "JunitSuiteRunner", "kind": "class", "modifiers": "", "superclass": "ParentRunner<Runner>", ...
20614852_6
class ColorUtils { public static String getRGB(float n) { return String.format(Locale.ENGLISH, "%.0f", n).replaceAll("\\.0*$", ""); } private ColorUtils(); public static String RGBToHex(int n); public static float[] RGBToHSB(@IntRange(from = 0, to = 255) int r, ...
assertEquals(ColorUtils.getRGB(0), "0"); assertEquals(ColorUtils.getRGB(100), "100"); assertEquals(ColorUtils.getRGB(255), "255"); assertEquals(ColorUtils.getRGB(0.10f), "0"); assertEquals(ColorUtils.getRGB(100.10f), "100"); assertEquals(ColorUtils.getRGB(255.10f), "255")...
[FOCAL] public static String ColorUtils.getRGB(float n) [CLASS] class ColorUtils [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] String.format(Locale.ENGLISH, "%.0f", n).replaceAll/2, String.format/3 [INPUTS] branches=- | result=n [DATAFLOW] n@param->L2 [CLASS-MEMBERS] ColorUtils()...
/* static context [FOCAL] public static String ColorUtils.getRGB(float n) [INPUTS] branches=- | result=n [CALLS-EXTERNAL] String.format(Locale.ENGLISH, "%.0f", n).replaceAll/2, String.format/3 */
/* static context [FOCAL] public static String ColorUtils.getRGB(float n) [INPUTS] branches=- | result=n [CALLS-EXTERNAL] String.format(Locale.ENGLISH, "%.0f", n).replaceAll/2, String.format/3 */ class ColorUtils { public static String getRGB(float n) { return String.format(Locale.ENGLISH, "%.0f", n).repla...
true
ok
{"focal": {"class": "ColorUtils", "name": "getRGB", "signature": "String getRGB(float n)", "start_line": 3, "modifiers": "public static", "params": [{"name": "n", "type": "float"}], "return_type": "String"}, "class_info": {"name": "ColorUtils", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "...
20645540_8
class Over extends EvalFunc<DataBag> { @Override public Schema outputSchema(Schema inputSch) { try { if (returnType == DataType.UNKNOWN) { return Schema.generateNestedSchema(DataType.BAG, DataType.NULL); } else { Schema outputTupleSchema = new Sch...
// No type Over func = new Over(); Schema in = Schema.generateNestedSchema(DataType.BAG, DataType.INTEGER); Schema out = func.outputSchema(in); assertEquals("{{NULL}}", out.toString()); // chararray func = new Over("chararray"); in = Schema.generateNested...
[FOCAL] @Override public Schema Over.outputSchema(Schema inputSch) [CLASS] class Over extends EvalFunc<DataBag> [METRICS] loc=16 cc=3 branches=1 loops=0 returns=2 throws=1 nesting=2 [CALLS-EXTERNAL] Schema.generateNestedSchema/2, getSchemaName/2 (inherited), this.getClass().getName().toLowerCase/0, this.getClass().getN...
/* static context [FOCAL] @Override public Schema Over.outputSchema(Schema inputSch) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException("Unable to create nested schema", fe) [PATH2] if(returnType == DataType.UNKNOWN)=T -> return Schema.generateNestedSchema(DataType...
/* static context [FOCAL] @Override public Schema Over.outputSchema(Schema inputSch) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException("Unable to create nested schema", fe) [PATH2] if(returnType == DataType.UNKNOWN)=T -> return Schema.generateNestedSchema(DataType...
true
ok
{"focal": {"class": "Over", "name": "outputSchema", "signature": "Schema outputSchema(Schema inputSch)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "inputSch", "type": "Schema"}], "return_type": "Schema"}, "class_info": {"name": "Over", "kind": "class", "modifiers": "", "superclass": "EvalFun...
20647901_31
class Hibernate4MemcachedRegionFactory implements RegionFactory { @Override public TimestampsRegion buildTimestampsRegion(String regionName, Properties properties) throws CacheException { return new TimestampMemcachedRegion(regionName, new OverridableReadOnlyPropertiesImpl(properties, c...
givenStart(); TimestampsRegion timestampsRegion = regionFactory.buildTimestampsRegion("UpdateTimestamps", properties); assertThat(timestampsRegion.getName()).isEqualTo("UpdateTimestamps"); assertThat(timestampsRegion).isExactlyInstanceOf(TimestampMemcachedRegion.class); } }
[FOCAL] @Override public TimestampsRegion Hibernate4MemcachedRegionFactory.buildTimestampsRegion(String regionName, Properties properties) [CLASS] class Hibernate4MemcachedRegionFactory implements RegionFactory [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] TimestampMemcachedRegion, Overrida...
/* static context [FOCAL] @Override public TimestampsRegion Hibernate4MemcachedRegionFactory.buildTimestampsRegion(String regionName, Properties properties) [INPUTS] branches=- | result=properties, regionName, hibernateCacheTimestamper, memcachedAdapter, settings [EXCEPTIONS] declares CacheException [FIELDS] read=hiber...
/* static context [FOCAL] @Override public TimestampsRegion Hibernate4MemcachedRegionFactory.buildTimestampsRegion(String regionName, Properties properties) [INPUTS] branches=- | result=properties, regionName, hibernateCacheTimestamper, memcachedAdapter, settings [EXCEPTIONS] declares CacheException [FIELDS] read=hiber...
true
ok
{"focal": {"class": "Hibernate4MemcachedRegionFactory", "name": "buildTimestampsRegion", "signature": "TimestampsRegion buildTimestampsRegion(String regionName, Properties properties) throws CacheException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "regionName", "type": "String"}, {"name": ...
20673421_39
class TransactionService { public static Transaction get(final Context context, final String number) throws NetLicensingException { CheckUtils.paramNotEmpty(number, "number"); return NetLicensingService.getInstance().get(context, Constants.Transaction.ENDPOINT_PATH + "/" + number, null, ...
final Transaction transaction = TransactionService.get(context, "TR001TEST"); assertNotNull(transaction); assertEquals("TR001TEST", transaction.getNumber()); assertEquals(true, transaction.getActive()); assertEquals(TransactionStatus.CLOSED, transaction.getStatus()); ass...
[FOCAL] public static Transaction TransactionService.get(Context context, String number) [CLASS] class TransactionService [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] CheckUtils.paramNotEmpty/2, NetLicensingService.getInstance().get/4, NetLicensingService.getInstance/0 [EXCEPTIO...
/* static context [FOCAL] public static Transaction TransactionService.get(Context context, String number) [INPUTS] branches=- | result=context, number [EXCEPTIONS] declares NetLicensingException [CALLS-EXTERNAL] CheckUtils.paramNotEmpty/2, NetLicensingService.getInstance().get/4, NetLicensingService.getInstance/0 */
/* static context [FOCAL] public static Transaction TransactionService.get(Context context, String number) [INPUTS] branches=- | result=context, number [EXCEPTIONS] declares NetLicensingException [CALLS-EXTERNAL] CheckUtils.paramNotEmpty/2, NetLicensingService.getInstance().get/4, NetLicensingService.getInstance/0 */ c...
true
ok
{"focal": {"class": "TransactionService", "name": "get", "signature": "Transaction get(Context context, String number) throws NetLicensingException", "start_line": 3, "modifiers": "public static", "params": [{"name": "context", "type": "Context"}, {"name": "number", "type": "String"}], "return_type": "Transaction"}, "c...
20707395_11
class Position { public final double getDistanceToPathKm(List<Position> positions) { if (positions.size() == 0) throw new RuntimeException("positions must not be empty"); else if (positions.size() == 1) return this.getDistanceToKm(positions.get(0)); else { ...
// positions to test Position p = new Position(-10, 150); // segment positions constituting a path Position sp1 = new Position(-30, 100); Position sp2 = new Position(-20, 120); Position sp3 = new Position(-30, 140); // path with two segments List<Positio...
[FOCAL] public final double Position.getDistanceToPathKm(List<Position> positions) [CLASS] class Position [METRICS] loc=15 cc=5 branches=3 loops=1 returns=2 throws=1 nesting=4 [CALLS-INTERNAL] double getDistanceToKm(Position position); double getDistanceToSegmentKm(Position p1, Position p2) [CALLS-EXTERNAL] List<Positi...
/* static context [FOCAL] public final double Position.getDistanceToPathKm(List<Position> positions) [THROWS-WHEN] RuntimeException when positions.size() == 0 [PATH1] if(positions.size() == 0)=F -> if(positions.size() == 1)=F -> for(i < positions.size() - 1)=T -> if(distance == null || d < distance)=T -> exit loop -> r...
/* static context [FOCAL] public final double Position.getDistanceToPathKm(List<Position> positions) [THROWS-WHEN] RuntimeException when positions.size() == 0 [PATH1] if(positions.size() == 0)=F -> if(positions.size() == 1)=F -> for(i < positions.size() - 1)=T -> if(distance == null || d < distance)=T -> exit loop -> r...
true
ok
{"focal": {"class": "Position", "name": "getDistanceToPathKm", "signature": "double getDistanceToPathKm(List<Position> positions)", "start_line": 3, "modifiers": "public final", "params": [{"name": "positions", "type": "List<Position>"}], "return_type": "double"}, "class_info": {"name": "Position", "kind": "class", "mo...
20710724_3
class Configuration { public FeatureMap getFeatureMap() { return featureMap; public FeatureMap getFeatureMap() { return featureMap; } public FeatureMap getFeatureMap() { return featureMap; public Configuration(); public FeatureMap getFeatureMap() { return featureMap; public Configuration(final boolean tracing); pub...
final Configuration config = new Configuration(this.getClass().getResourceAsStream(configResource), false); assertEquals(config.getFeatureMap(), r.featureMap); } }
[FOCAL] public FeatureMap Configuration.getFeatureMap() [CLASS] class Configuration [METRICS] loc=1 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Configuration(); Configuration(boolean tracing); Configuration(InputStream config, boolean tracing) [TEST] ConfigurationTest: @Test(dataProvider = "con...
/* static context [FOCAL] public FeatureMap Configuration.getFeatureMap() */
/* static context [FOCAL] public FeatureMap Configuration.getFeatureMap() */ class Configuration { public FeatureMap getFeatureMap() { return featureMap; public FeatureMap getFeatureMap() { return featureMap; } public FeatureMap getFeatureMap() { return featureMap; public Configuration(); public FeatureMap getFeatur...
true
ok
{"focal": {"class": "Configuration", "name": "getFeatureMap", "signature": "FeatureMap getFeatureMap()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "FeatureMap"}, "class_info": {"name": "Configuration", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "me...
20717348_1
class ResourceModifier { public static String modifyWorkFlowExtensions(String xmlContent) throws APIMigrationException { Writer stringWriter = new StringWriter(); Document doc = ResourceUtil.buildDocument(xmlContent, APIConstants.WORKFLOW_EXECUTOR_LOCATION); if (doc != null) { ...
String workFlowExtensions19 = IOUtils.toString(workflow19Stream); String modifiedWorkFlowExtensions = ResourceModifier.modifyWorkFlowExtensions(workFlowExtensions19); Document modifiedDoc = ResourceUtil.buildDocument(modifiedWorkFlowExtensions, "modifiedWorkFlowExtensions"); Document ex...
[FOCAL] public static String ResourceModifier.modifyWorkFlowExtensions(String xmlContent) [CLASS] class ResourceModifier [METRICS] loc=55 cc=5 branches=3 loops=0 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] ResourceUtil.buildDocument/2, Document.getDocumentElement/0, Element.getElementsByTagName/1, NodeList.getLength/...
/* static context [FOCAL] public static String ResourceModifier.modifyWorkFlowExtensions(String xmlContent) [PATH1] if(doc != null)=T -> if(subscriptionDeletionTag != null && subscriptionDeletionTag.getLength() == 0)=T -> if(applicationDeletionTag != null && applicationDeletionTag.getLength() == 0)=T -> try-body throws...
/* static context [FOCAL] public static String ResourceModifier.modifyWorkFlowExtensions(String xmlContent) [PATH1] if(doc != null)=T -> if(subscriptionDeletionTag != null && subscriptionDeletionTag.getLength() == 0)=T -> if(applicationDeletionTag != null && applicationDeletionTag.getLength() == 0)=T -> try-body throws...
true
ok
{"focal": {"class": "ResourceModifier", "name": "modifyWorkFlowExtensions", "signature": "String modifyWorkFlowExtensions(String xmlContent) throws APIMigrationException", "start_line": 3, "modifiers": "public static", "params": [{"name": "xmlContent", "type": "String"}], "return_type": "String"}, "class_info": {"name"...
20746753_2
class InstancesQueryHandler extends AbstractWorkerQueryHandler { public void setOutputFolder(String outputFolder) { this.outputFolder = outputFolder; } public InstancesQueryHandler(List<Worker> workers); public InstancesQueryHandler(List<Worker> workers, String lang); @Override protected File[] generateQuer...
//Get queries file Connection con = new Connection(); con.setName("a"); con.setEndpoint("http://test.com"); Worker worker = getWorker(con, 1, "1"); InstancesQueryHandler qh = new InstancesQueryHandler(Lists.newArrayList(worker)); qh.setOutputFolder(this.dir); ...
[FOCAL] public void InstancesQueryHandler.setOutputFolder(String outputFolder) [CLASS] class InstancesQueryHandler extends AbstractWorkerQueryHandler [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [FIELDS] write=outputFolder [STATE] outputFolder [DATAFLOW] outputFolder@param->L2 [CLASS-MEMBERS] In...
/* static context [FOCAL] public void InstancesQueryHandler.setOutputFolder(String outputFolder) [STATE] outputFolder [FIELDS] write=outputFolder */
/* static context [FOCAL] public void InstancesQueryHandler.setOutputFolder(String outputFolder) [STATE] outputFolder [FIELDS] write=outputFolder */ class InstancesQueryHandler extends AbstractWorkerQueryHandler { public void setOutputFolder(String outputFolder) { this.outputFolder = outputFolder; } public Inst...
true
ok
{"focal": {"class": "InstancesQueryHandler", "name": "setOutputFolder", "signature": "void setOutputFolder(String outputFolder)", "start_line": 3, "modifiers": "public", "params": [{"name": "outputFolder", "type": "String"}], "return_type": "void"}, "class_info": {"name": "InstancesQueryHandler", "kind": "class", "modi...
20811348_6
class SshUriPropertyProcessor { public Map<String, JGitEnvironmentProperties> getSshKeysByHostname() { return extractNestedProperties(this.sshUriProperties); } public SshUriPropertyProcessor(MultipleJGitEnvironmentProperties sshUriProperties); protected static String getHostname(String uri); private Map<Stri...
SshUriPropertyProcessor sshUriPropertyProcessor = new SshUriPropertyProcessor(mainRepoPropertiesFixture()); Map<String, JGitEnvironmentProperties> sshKeysByHostname = sshUriPropertyProcessor.getSshKeysByHostname(); assertThat(sshKeysByHostname.values()).hasSize(1); JGitEnvironmentProperties sshKey = sshKeysBy...
[FOCAL] public Map<String, JGitEnvironmentProperties> SshUriPropertyProcessor.getSshKeysByHostname() [CLASS] class SshUriPropertyProcessor [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Map<String, JGitEnvironmentProperties> extractNestedProperties(MultipleJGitEnvironmentPropertie...
/* static context [FOCAL] public Map<String, JGitEnvironmentProperties> SshUriPropertyProcessor.getSshKeysByHostname() [CALLS-INTERNAL] Map<String, JGitEnvironmentProperties> extractNestedProperties(MultipleJGitEnvironmentProperties uriProperties) [FIELDS] read=sshUriProperties */
/* static context [FOCAL] public Map<String, JGitEnvironmentProperties> SshUriPropertyProcessor.getSshKeysByHostname() [CALLS-INTERNAL] Map<String, JGitEnvironmentProperties> extractNestedProperties(MultipleJGitEnvironmentProperties uriProperties) [FIELDS] read=sshUriProperties */ class SshUriPropertyProcessor { publ...
true
ok
{"focal": {"class": "SshUriPropertyProcessor", "name": "getSshKeysByHostname", "signature": "Map<String, JGitEnvironmentProperties> getSshKeysByHostname()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Map<String, JGitEnvironmentProperties>"}, "class_info": {"name": "SshUriPropertyProcessor", "...
20855247_10
class SphereJsonUtils { public static <T> T readObject(final String jsonAsString, final TypeReference<T> typeReference) { return executing(() -> objectMapper.readValue(jsonAsString, typeReference)); } private SphereJsonUtils(); public static ObjectMapper newObjectMapper(); public static ...
final String jsonString = "\"en\""; final Locale locale = SphereJsonUtils.readObject(jsonString, TypeReferences.localeTypeReference()); assertThat(locale).isEqualTo(Locale.ENGLISH); } }
[FOCAL] public static T SphereJsonUtils.readObject(String jsonAsString, TypeReference<T> typeReference) [CLASS] class SphereJsonUtils [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] T executing(SupplierThrowingIOException<T> supplier) [CALLS-EXTERNAL] objectMapper.readValue/2 [INPU...
/* static context [FOCAL] public static T SphereJsonUtils.readObject(String jsonAsString, TypeReference<T> typeReference) [INPUTS] branches=- | result=jsonAsString, typeReference [COLLABORATORS] field objectMapper readValue/2 [CALLS-INTERNAL] T executing(SupplierThrowingIOException<T> supplier) [CALLS-EXTERNAL] objectM...
/* static context [FOCAL] public static T SphereJsonUtils.readObject(String jsonAsString, TypeReference<T> typeReference) [INPUTS] branches=- | result=jsonAsString, typeReference [COLLABORATORS] field objectMapper readValue/2 [CALLS-INTERNAL] T executing(SupplierThrowingIOException<T> supplier) [CALLS-EXTERNAL] objectM...
true
ok
{"focal": {"class": "SphereJsonUtils", "name": "readObject", "signature": "T readObject(String jsonAsString, TypeReference<T> typeReference)", "start_line": 3, "modifiers": "public static", "params": [{"name": "jsonAsString", "type": "String"}, {"name": "typeReference", "type": "TypeReference<T>"}], "return_type": "T"}...
20874043_4
class Highest extends Activation { @Override public void activate(RuleBlock ruleBlock) { if (FuzzyLite.isDebugging()) { FuzzyLite.logger().log(Level.FINE, "Activation: {0} {1}", new String[]{getClass().getName(), parameters()}); } TNorm conjunction = rule...
Engine engine = Console.mamdani(); InputVariable ambient = engine.getInputVariable(0); ambient.setValue(0.3); RuleBlock ruleBlock = engine.getRuleBlock(0); ruleBlock.setActivation(new Highest(1)); engine.process(); List<Rule> rules = engine.getRuleBlock(0).getRul...
[FOCAL] @Override public void Highest.activate(RuleBlock ruleBlock) [CLASS] class Highest extends Activation [METRICS] loc=29 cc=6 branches=3 loops=2 returns=0 throws=0 nesting=3 [CALLS-INTERNAL] String parameters() [CALLS-EXTERNAL] FuzzyLite.isDebugging/0, FuzzyLite.logger().log/3, FuzzyLite.logger/0, getClass().getNa...
/* static context [FOCAL] @Override public void Highest.activate(RuleBlock ruleBlock) [PATH1] if(FuzzyLite.isDebugging())=T -> foreach(Rule rule : ruleBlock.getRules())=T -> if(rule.isLoaded())=T -> if(Op.isGt(activationDegree, 0.0))=T -> exit loop -> while(!rulesToActivate.isEmpty() && activated++ < numberOfRules)=F [...
/* static context [FOCAL] @Override public void Highest.activate(RuleBlock ruleBlock) [PATH1] if(FuzzyLite.isDebugging())=T -> foreach(Rule rule : ruleBlock.getRules())=T -> if(rule.isLoaded())=T -> if(Op.isGt(activationDegree, 0.0))=T -> exit loop -> while(!rulesToActivate.isEmpty() && activated++ < numberOfRules)=F [...
true
ok
{"focal": {"class": "Highest", "name": "activate", "signature": "void activate(RuleBlock ruleBlock)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "ruleBlock", "type": "RuleBlock"}], "return_type": "void"}, "class_info": {"name": "Highest", "kind": "class", "modifiers": "", "superclass": "Activ...
20882897_131
class GeometricMeanCalculator implements Function<double[], Double> { @Override public Double apply(double[] x) { ArgChecker.notEmpty(x, "x"); int n = x.length; double mult = x[0]; for (int i = 1; i < n; i++) { mult *= x[i]; } return Math.pow(mult, 1. / n); } private static final...
assertThatIllegalArgumentException() .isThrownBy(() -> GEOMETRIC.apply(null)); } }
[FOCAL] @Override public Double GeometricMeanCalculator.apply(double[] x) [CLASS] class GeometricMeanCalculator implements Function<double[], Double> [METRICS] loc=10 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] ArgChecker.notEmpty/2, Math.pow/2 [PATH1] for(i < n)=T -> exit loop -> return Math....
/* static context [FOCAL] @Override public Double GeometricMeanCalculator.apply(double[] x) [PATH1] for(i < n)=T -> exit loop -> return Math.pow(mult, 1. / n) [PATH2] for(i < n)=F -> return Math.pow(mult, 1. / n) [INPUTS] branches=x | result=x [CALLS-EXTERNAL] ArgChecker.notEmpty/2, Math.pow/2 */
/* static context [FOCAL] @Override public Double GeometricMeanCalculator.apply(double[] x) [PATH1] for(i < n)=T -> exit loop -> return Math.pow(mult, 1. / n) [PATH2] for(i < n)=F -> return Math.pow(mult, 1. / n) [INPUTS] branches=x | result=x [CALLS-EXTERNAL] ArgChecker.notEmpty/2, Math.pow/2 */ class GeometricMeanCal...
true
ok
{"focal": {"class": "GeometricMeanCalculator", "name": "apply", "signature": "Double apply(double[] x)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "x", "type": "double[]"}], "return_type": "Double"}, "class_info": {"name": "GeometricMeanCalculator", "kind": "class", "modifiers": "", "supercl...
20893538_4
class TrivialTask extends AbstractSimpleTask { @Override public Void call() throws Exception { setState(ExecutionState.RUNNING); try { callable.call(); incrementProgress(); } catch (Exception e) { setState(ExecutionState.FAILED); throw e; ...
public void callableProgressTest() throws Exception { final Callable<?> mock = createMockCallable(); final ProgressListener listener = createMockListener(PENDING_REPORT, RUNNING_REPORT, INCREMENTED_REPORT, COMPLETED_REPORT); final Task t = new TrivialTask("Foo", mock); t.addListener...
[FOCAL] @Override public Void TrivialTask.call() [CLASS] class TrivialTask extends AbstractSimpleTask [METRICS] loc=14 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] setState/1 (inherited), callable.call/0, incrementProgress/0 (inherited) [EXCEPTIONS] declares Exception; throws throw e; catches E...
/* static context [FOCAL] @Override public Void TrivialTask.call() [THROWS-WHEN] e when try-body throws [PATH1] try-body throws -> throw e [PATH2] return null [COLLABORATORS] field callable call/0 [EXCEPTIONS] declares Exception; throws throw e; catches Exception e [CALLS-EXTERNAL] setState/1 (inherited), callable.call...
/* static context [FOCAL] @Override public Void TrivialTask.call() [THROWS-WHEN] e when try-body throws [PATH1] try-body throws -> throw e [PATH2] return null [COLLABORATORS] field callable call/0 [EXCEPTIONS] declares Exception; throws throw e; catches Exception e [CALLS-EXTERNAL] setState/1 (inherited), callable.call...
true
ok
{"focal": {"class": "TrivialTask", "name": "call", "signature": "Void call() throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Void"}, "class_info": {"name": "TrivialTask", "kind": "class", "modifiers": "", "superclass": "AbstractSimpleTask", "interfaces": null, "fields"...
20898148_15
class ObjectList { public static boolean equals( Object head1, Object head2){ if (head1 != null){ return head1.equals(head2); } else { return head2 == null; // both null is treated as equal } } private ObjectList(); public static Iterator iterator(Object head); public static ...
assertTrue( ObjectList.equals(a1, a2)); a1 = null; a2 = "one"; assertFalse( ObjectList.equals(a1, a2)); a1 = "one"; a2 = null; assertFalse( ObjectList.equals(a1, a2)); a1 = ObjectList.createList("one", "two"); a2 = null; assertFalse( ObjectList.equals(a1, a2)); a1...
[FOCAL] public static boolean ObjectList.equals(Object head1, Object head2) [CLASS] class ObjectList [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] Object.equals/1 [PATH1] if(head1 != null)=T -> return head1.equals(head2) [PATH2] if(head1 != null)=F -> return head2 == null [INPUTS...
/* static context [FOCAL] public static boolean ObjectList.equals(Object head1, Object head2) [PATH1] if(head1 != null)=T -> return head1.equals(head2) [PATH2] if(head1 != null)=F -> return head2 == null [INPUTS] branches=head1 | result=head1, head2 [CALLS-EXTERNAL] Object.equals/1 */
/* static context [FOCAL] public static boolean ObjectList.equals(Object head1, Object head2) [PATH1] if(head1 != null)=T -> return head1.equals(head2) [PATH2] if(head1 != null)=F -> return head2 == null [INPUTS] branches=head1 | result=head1, head2 [CALLS-EXTERNAL] Object.equals/1 */ class ObjectList { public stati...
true
ok
{"focal": {"class": "ObjectList", "name": "equals", "signature": "boolean equals(Object head1, Object head2)", "start_line": 3, "modifiers": "public static", "params": [{"name": "head1", "type": "Object"}, {"name": "head2", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "ObjectList", "kind": "cla...
20989862_0
class Futures { public static <T> CompletableFuture<T> afterTimeout(T value, long millis) { CompletableFuture<T> future = new CompletableFuture<>(); timer.newTimeout(t -> future.complete(value), millis, TimeUnit.MILLISECONDS); return future; } } class FuturesTest { @Test publ...
CountDownLatch latch = new CountDownLatch(1); Set<String> resultHolder = Collections.newSetFromMap(new ConcurrentHashMap<>()); CompletableFuture<String> slow = Futures.afterTimeout("slow", 1000); CompletableFuture<String> fast = Futures.afterTimeout("fast", 1); fast.acceptEither(...
[FOCAL] public static CompletableFuture<T> Futures.afterTimeout(T value, long millis) [CLASS] class Futures [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] timer.newTimeout/3, CompletableFuture<T>.complete/1 [NEW] CompletableFuture<> [COLLABORATORS] field timer newTimeout/3 [DATAFL...
/* static context [FOCAL] public static CompletableFuture<T> Futures.afterTimeout(T value, long millis) [COLLABORATORS] field timer newTimeout/3 [NEW] CompletableFuture<> [CALLS-EXTERNAL] timer.newTimeout/3, CompletableFuture<T>.complete/1 */
/* static context [FOCAL] public static CompletableFuture<T> Futures.afterTimeout(T value, long millis) [COLLABORATORS] field timer newTimeout/3 [NEW] CompletableFuture<> [CALLS-EXTERNAL] timer.newTimeout/3, CompletableFuture<T>.complete/1 */ class Futures { public static <T> CompletableFuture<T> afterTimeout(T va...
true
ok
{"focal": {"class": "Futures", "name": "afterTimeout", "signature": "CompletableFuture<T> afterTimeout(T value, long millis)", "start_line": 3, "modifiers": "public static", "params": [{"name": "value", "type": "T"}, {"name": "millis", "type": "long"}], "return_type": "CompletableFuture<T>"}, "class_info": {"name": "Fu...
20990716_0
class RelEx implements Translator, LabelProvider { public Sentence parse(String originalLiteral) { // StrTokenizer tokenizer = new StrTokenizer(originalLiteral); List<String> tokens = tokenizer.tokenize(originalLiteral); log.debug("Tokens: {}", tokens); Sentence sentence = RelexidFactory.eINSTANCE.create...
final Sentence sentence = relex.parse("Aku cinta kamu."); log.info("Sentence structure: {}", sentence); log.info("Sentence in English: {}", sentence.generate(Locale.ENGLISH, DICT_EN_US, relex)); log.info("Sentence in Indonesian: {}", sentence.generate(RelEx.INDONESIAN, DICT_ID_ID, relex)); assertEquals("(S (P...
[FOCAL] public Sentence RelEx.parse(String originalLiteral) [CLASS] class RelEx implements Translator, LabelProvider [METRICS] loc=127 cc=18 branches=9 loops=8 returns=1 throws=0 nesting=5 [CALLS-INTERNAL] List<Integer> findWalls(List<PartOfSpeech> parts); List<PartOfSpeech> createReplacementParts(EList<LexReplacement>...
class RelEx implements Translator, LabelProvider { public Sentence parse(String originalLiteral) { // StrTokenizer tokenizer = new StrTokenizer(originalLiteral); List<String> tokens = tokenizer.tokenize(originalLiteral); log.debug("Tokens: {}", tokens); Sentence sentence = RelexidFactory.eINSTANCE.create...
false
ok
{"focal": {"class": "RelEx", "name": "parse", "signature": "Sentence parse(String originalLiteral)", "start_line": 3, "modifiers": "public", "params": [{"name": "originalLiteral", "type": "String"}], "return_type": "Sentence"}, "class_info": {"name": "RelEx", "kind": "class", "modifiers": "", "superclass": null, "inter...
20991787_0
class ReactiveAudit { boolean isThreadNameMatch(String name) { if (name == null) return false; if (threadPattern == null) { return false; } if (historyThreadName.add(name)) { int now = ManagementFactory.getThreadMXBean().getThreadCount(); int old; for (; ; ) { old = statMaxThread.get()...
TestTools.strict.commit(); assertTrue(config.isThreadNameMatch(Thread.currentThread().getName())); } }
[FOCAL] boolean ReactiveAudit.isThreadNameMatch(String name) [CLASS] class ReactiveAudit [METRICS] loc=27 cc=7 branches=6 loops=1 returns=3 throws=0 nesting=4 [CALLS-EXTERNAL] historyThreadName.add/1, ManagementFactory.getThreadMXBean().getThreadCount/0, ManagementFactory.getThreadMXBean/0, statMaxThread.get/0, statMax...
/* static context [FOCAL] boolean ReactiveAudit.isThreadNameMatch(String name) [PATH1] if(name == null)=F -> if(threadPattern == null)=F -> if(historyThreadName.add(name))=T -> for(true)=T -> if(now > old)=T -> if(statMaxThread.compareAndSet(old, now))=T -> if(debug)=T -> return threadPattern.matcher(name).matches() [P...
/* static context [FOCAL] boolean ReactiveAudit.isThreadNameMatch(String name) [PATH1] if(name == null)=F -> if(threadPattern == null)=F -> if(historyThreadName.add(name))=T -> for(true)=T -> if(now > old)=T -> if(statMaxThread.compareAndSet(old, now))=T -> if(debug)=T -> return threadPattern.matcher(name).matches() [P...
true
ok
{"focal": {"class": "ReactiveAudit", "name": "isThreadNameMatch", "signature": "boolean isThreadNameMatch(String name)", "start_line": 3, "modifiers": "", "params": [{"name": "name", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "ReactiveAudit", "kind": "class", "modifiers": "", "superclass": nu...
21003796_53
class ScriptUpdatesAnalyzer { public ScriptUpdates calculateScriptUpdates() { // Iterate over the already executed scripts to find out whether the contents of some scripts has been modified // since the last update. We also map the executed scripts with their script counterparts, to be able to veri...
executedScripts(POSTPROCESSING_2, POSTPROCESSING_3); scripts(POSTPROCESSING_3_RENAMED_WITH_INDEX_1, POSTPROCESSING_2); calculateScriptUpdates(); assertPostProcessingScriptUpdate(POSTPROCESSING_SCRIPT_RENAMED, POSTPROCESSING_3, POSTPROCESSING_3_RENAMED_WITH_INDEX_1); } }
[FOCAL] public ScriptUpdates ScriptUpdatesAnalyzer.calculateScriptUpdates() [CLASS] class ScriptUpdatesAnalyzer [METRICS] loc=62 cc=14 branches=10 loops=3 returns=1 throws=0 nesting=5 [CALLS-INTERNAL] Script findNewScriptWithSameContent(ExecutedScript executedScript); Script findScriptWithSameName(ExecutedScript execut...
class ScriptUpdatesAnalyzer { public ScriptUpdates calculateScriptUpdates() { // Iterate over the already executed scripts to find out whether the contents of some scripts has been modified // since the last update. We also map the executed scripts with their script counterparts, to be able to veri...
false
ok
{"focal": {"class": "ScriptUpdatesAnalyzer", "name": "calculateScriptUpdates", "signature": "ScriptUpdates calculateScriptUpdates()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "ScriptUpdates"}, "class_info": {"name": "ScriptUpdatesAnalyzer", "kind": "class", "modifiers": "", "superclass": nul...
21019546_0
class TorConfig { public File getDataDir() { return dataDir; } public static TorConfig createDefault(File configDir); public static TorConfig createFlatConfig(File configDir); public static TorConfig createConfig(File installDir, File configDir, File dataDir); public File getInstallDir...
TorConfig config = new TorConfig.Builder(sampleFile, sampleFile).build(); assertEquals(new File(sampleFile, "lib/tor").getPath(), config.getDataDir().getPath()); } }
[FOCAL] public File TorConfig.getDataDir() [CLASS] class TorConfig [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] TorConfig createDefault(File configDir); TorConfig createFlatConfig(File configDir); TorConfig createConfig(File installDir, File configDir, File dataDir); File getInst...
/* static context [FOCAL] public File TorConfig.getDataDir() */
/* static context [FOCAL] public File TorConfig.getDataDir() */ class TorConfig { public File getDataDir() { return dataDir; } public static TorConfig createDefault(File configDir); public static TorConfig createFlatConfig(File configDir); public static TorConfig createConfig(File installD...
true
ok
{"focal": {"class": "TorConfig", "name": "getDataDir", "signature": "File getDataDir()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "File"}, "class_info": {"name": "TorConfig", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "sampleFile", "type": "...
21019797_28
class FrameworkScheduler extends Scheduler { boolean onStartJob(JobParameters params) { SchedulerConstraint constraint; try { constraint = fromBundle(params.getExtras()); } catch (Exception e) { JqLog.e(e, "bad bundle from framework job scheduler start callback."); ...
// see https://github.com/yigit/android-priority-jobqueue/issues/254 JobParameters params = mock(JobParameters.class); PersistableBundle badBundle = mock(PersistableBundle.class); when(badBundle.getString(anyString(), anyString())).thenThrow(new NullPointerException()); when(badB...
[FOCAL] boolean FrameworkScheduler.onStartJob(JobParameters params) [CLASS] class FrameworkScheduler extends Scheduler [METRICS] loc=12 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] SchedulerConstraint fromBundle(PersistableBundle bundle) [CALLS-EXTERNAL] JobParameters.getExtras/0, JqLog.e/2, Jq...
/* static context [FOCAL] boolean FrameworkScheduler.onStartJob(JobParameters params) [PATH1] try-body throws -> return false [PATH2] return start(constraint) [INPUTS] branches=- | result=params [COLLABORATORS] param params:JobParameters getExtras/0,getJobId/0 [EXCEPTIONS] catches Exception e [CALLS-INTERNAL] Scheduler...
/* static context [FOCAL] boolean FrameworkScheduler.onStartJob(JobParameters params) [PATH1] try-body throws -> return false [PATH2] return start(constraint) [INPUTS] branches=- | result=params [COLLABORATORS] param params:JobParameters getExtras/0,getJobId/0 [EXCEPTIONS] catches Exception e [CALLS-INTERNAL] Scheduler...
true
ok
{"focal": {"class": "FrameworkScheduler", "name": "onStartJob", "signature": "boolean onStartJob(JobParameters params)", "start_line": 3, "modifiers": "", "params": [{"name": "params", "type": "JobParameters"}], "return_type": "boolean"}, "class_info": {"name": "FrameworkScheduler", "kind": "class", "modifiers": "", "s...
21052744_4
class SpringSessionBackedSessionRegistry implements SessionRegistry { @Override public List<SessionInformation> getAllSessions(Object principal, boolean includeExpiredSessions) { Collection<S> sessions = this.sessionRepository.findByPrincipalName(name(principal)).values(); List<SessionInformation> infos = new Ar...
setUpSessions(); List<SessionInformation> allSessionInfos = this.sessionRegistry .getAllSessions((AuthenticatedPrincipal) () -> USER_NAME, true); assertThat(allSessionInfos).extracting("sessionId").containsExactly(SESSION_ID, SESSION_ID2); } }
[FOCAL] @Override public List<SessionInformation> SpringSessionBackedSessionRegistry.getAllSessions(Object principal, boolean includeExpiredSessions) [CLASS] class SpringSessionBackedSessionRegistry implements SessionRegistry [METRICS] loc=12 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] String ...
/* static context [FOCAL] @Override public List<SessionInformation> SpringSessionBackedSessionRegistry.getAllSessions(Object principal, boolean includeExpiredSessions) [PATH1] foreach(S session : sessions)=T -> if((includeExpiredSessions || !Boolean.TRUE.equals(session.getAttribute(SpringSessionBackedSessionInformation...
/* static context [FOCAL] @Override public List<SessionInformation> SpringSessionBackedSessionRegistry.getAllSessions(Object principal, boolean includeExpiredSessions) [PATH1] foreach(S session : sessions)=T -> if((includeExpiredSessions || !Boolean.TRUE.equals(session.getAttribute(SpringSessionBackedSessionInformation...
true
ok
{"focal": {"class": "SpringSessionBackedSessionRegistry", "name": "getAllSessions", "signature": "List<SessionInformation> getAllSessions(Object principal, boolean includeExpiredSessions)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "principal", "type": "Object"}, {"name": "includeExpiredSess...
21089070_4
class ClouderaAPIUtil { public static String extractNavigatorURL(String navigatorUrl) { Pattern compile = Pattern.compile("((?:ht|f)tps?\\:\\/\\/[^:]*:[0-9]*)"); Matcher matcher = compile.matcher(navigatorUrl); if (matcher.find()) { return matcher.group(0); } else { ...
assertEquals("http://domain:3333", ClouderaAPIUtil.extractNavigatorURL("http://domain:3333/api/v1/")); assertEquals("https://domain:3333", ClouderaAPIUtil.extractNavigatorURL("https://domain:3333/api/v1/")); assertEquals("http://sd01.sd02.domain:3333", ClouderaAPIUtil.extractNavigatorURL("http:/...
[FOCAL] public static String ClouderaAPIUtil.extractNavigatorURL(String navigatorUrl) [CLASS] class ClouderaAPIUtil [METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] Pattern.compile/1, Pattern.matcher/1, Matcher.find/0, Matcher.group/1 [PATH1] if(matcher.find())=T -> return matcher....
/* static context [FOCAL] public static String ClouderaAPIUtil.extractNavigatorURL(String navigatorUrl) [PATH1] if(matcher.find())=T -> return matcher.group(0) [PATH2] if(matcher.find())=F -> return navigatorUrl [INPUTS] branches=navigatorUrl | result=navigatorUrl [CALLS-EXTERNAL] Pattern.compile/1, Pattern.matcher/1, ...
/* static context [FOCAL] public static String ClouderaAPIUtil.extractNavigatorURL(String navigatorUrl) [PATH1] if(matcher.find())=T -> return matcher.group(0) [PATH2] if(matcher.find())=F -> return navigatorUrl [INPUTS] branches=navigatorUrl | result=navigatorUrl [CALLS-EXTERNAL] Pattern.compile/1, Pattern.matcher/1, ...
true
ok
{"focal": {"class": "ClouderaAPIUtil", "name": "extractNavigatorURL", "signature": "String extractNavigatorURL(String navigatorUrl)", "start_line": 3, "modifiers": "public static", "params": [{"name": "navigatorUrl", "type": "String"}], "return_type": "String"}, "class_info": {"name": "ClouderaAPIUtil", "kind": "class"...
21099161_9
class LinkNormalizer { public String normalize(String original, String extracted) { Validate.notBlank(original); Validate.notNull(extracted); URI originalUri = null; URI extractedUri = null; try { originalUri = new URI(original); extractedUri = new...
// Arrange String original = "http://www.foo.com/bar/baz"; String extracted = "../quux"; // Act String output = linkNormalizer.normalize(original, extracted); // Assert assertEquals("http://www.foo.com/quux", output); } }
[FOCAL] public String LinkNormalizer.normalize(String original, String extracted) [CLASS] class LinkNormalizer [METRICS] loc=37 cc=4 branches=2 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] String normalizePath(String originalPath, String extractedPath) [CALLS-EXTERNAL] Validate.notBlank/1, Validate.notNull/1, ...
/* static context [FOCAL] public String LinkNormalizer.normalize(String original, String extracted) [PATH1] if(!hasScheme)=T -> if(!hasHost)=T -> return retval.toString() [PATH2] try-body throws -> return null [PATH3] if(!hasScheme)=F -> if(!hasHost)=F -> return retval.toString() [INPUTS] branches=extracted | result=ex...
/* static context [FOCAL] public String LinkNormalizer.normalize(String original, String extracted) [PATH1] if(!hasScheme)=T -> if(!hasHost)=T -> return retval.toString() [PATH2] try-body throws -> return null [PATH3] if(!hasScheme)=F -> if(!hasHost)=F -> return retval.toString() [INPUTS] branches=extracted | result=ex...
true
ok
{"focal": {"class": "LinkNormalizer", "name": "normalize", "signature": "String normalize(String original, String extracted)", "start_line": 3, "modifiers": "public", "params": [{"name": "original", "type": "String"}, {"name": "extracted", "type": "String"}], "return_type": "String"}, "class_info": {"name": "LinkNormal...
21112886_7
class Lexer { public List<Token> lex(final InputStream stream) { try (final BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(stream))) { List<Token> tokens = tokenize(bufferedReader); tokens.add(Token.END_OF_INPUT); return tokens; } cat...
assertEquals(4, lex("a~i~").size()); assertEquals(4, lex("~i~b").size()); assertEquals(6, lex("~i~~id~").size()); assertEquals(7, lex("~i~ ~id~").size()); assertEquals(7, lex("~i~\n~id~").size()); assertEquals(7, lex("~i~\t~id~").size()); assertEquals(7, lex("~i~\...
[FOCAL] public List<Token> Lexer.lex(InputStream stream) [CLASS] class Lexer [METRICS] loc=12 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] List<Token> tokenize(BufferedReader bufferedReader) [CALLS-EXTERNAL] List<Token>.add/1 [NEW] BufferedReader, InputStreamReader, RuntimeException [EXCEPTIONS...
/* static context [FOCAL] public List<Token> Lexer.lex(InputStream stream) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException(e) [PATH2] return tokens [INPUTS] branches=- | result=stream [EXCEPTIONS] throws RuntimeException; catches Exception e [CALLS-INTERNAL] Lis...
/* static context [FOCAL] public List<Token> Lexer.lex(InputStream stream) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException(e) [PATH2] return tokens [INPUTS] branches=- | result=stream [EXCEPTIONS] throws RuntimeException; catches Exception e [CALLS-INTERNAL] Lis...
true
ok
{"focal": {"class": "Lexer", "name": "lex", "signature": "List<Token> lex(InputStream stream)", "start_line": 3, "modifiers": "public", "params": [{"name": "stream", "type": "InputStream"}], "return_type": "List<Token>"}, "class_info": {"name": "Lexer", "kind": "class", "modifiers": "", "superclass": null, "interfaces"...
21138894_2
class VirtualFileRepoCacheImpl implements VirtualFileRepoCache, Disposable { @Nullable @Override public GitRepository getRepoForRoot(@NotNull VirtualFile root) { Preconditions.checkArgument(root.isDirectory(), "%s is not a dir", root); return rootsVFileCache.get(root); } VirtualFileRepoCacheImpl(@...
setupRepo(); assertThat(cache.getRepoForRoot(repositoryRoot)).isEqualTo(repositoryMock); } }
[FOCAL] @Nullable @Override public GitRepository VirtualFileRepoCacheImpl.getRepoForRoot(VirtualFile root) [CLASS] class VirtualFileRepoCacheImpl implements VirtualFileRepoCache, Disposable [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Preconditions.checkArgument/3, VirtualFile.i...
/* static context [FOCAL] @Nullable @Override public GitRepository VirtualFileRepoCacheImpl.getRepoForRoot(VirtualFile root) [INPUTS] branches=- | result=root [COLLABORATORS] param root:VirtualFile isDirectory/0; field rootsVFileCache get/1 [CALLS-EXTERNAL] Preconditions.checkArgument/3, VirtualFile.isDirectory/0, root...
/* static context [FOCAL] @Nullable @Override public GitRepository VirtualFileRepoCacheImpl.getRepoForRoot(VirtualFile root) [INPUTS] branches=- | result=root [COLLABORATORS] param root:VirtualFile isDirectory/0; field rootsVFileCache get/1 [CALLS-EXTERNAL] Preconditions.checkArgument/3, VirtualFile.isDirectory/0, root...
true
ok
{"focal": {"class": "VirtualFileRepoCacheImpl", "name": "getRepoForRoot", "signature": "GitRepository getRepoForRoot(VirtualFile root)", "start_line": 3, "modifiers": "@Nullable @Override public", "params": [{"name": "root", "type": "VirtualFile"}], "return_type": "GitRepository"}, "class_info": {"name": "VirtualFileRe...