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
16338894_1
class ScopedEventBus implements EventBus, Serializable { @Override public <T> void subscribe(EventBusListener<T> listener) { subscribe(listener, true); } public ScopedEventBus(EventScope scope); public ScopedEventBus(EventScope scope, EventBus parentEventBus); @PreDestroy void destr...
assertThrows(IllegalArgumentException.class, () -> sessionEventBus.subscribe(new InvalidListener2())); } }
[FOCAL] @Override public void ScopedEventBus.subscribe(EventBusListener<T> listener) [CLASS] class ScopedEventBus implements EventBus, Serializable [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void subscribe(EventBusListener<T> listener, String topic) [DATAFLOW] listener@param->...
/* static context [FOCAL] @Override public void ScopedEventBus.subscribe(EventBusListener<T> listener) [CALLS-INTERNAL] void subscribe(EventBusListener<T> listener, String topic) */
/* static context [FOCAL] @Override public void ScopedEventBus.subscribe(EventBusListener<T> listener) [CALLS-INTERNAL] void subscribe(EventBusListener<T> listener, String topic) */ class ScopedEventBus implements EventBus, Serializable { @Override public <T> void subscribe(EventBusListener<T> listener) { ...
true
ok
{"focal": {"class": "ScopedEventBus", "name": "subscribe", "signature": "void subscribe(EventBusListener<T> listener)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "listener", "type": "EventBusListener<T>"}], "return_type": "void"}, "class_info": {"name": "ScopedEventBus", "kind": "class", "mo...
16346614_1
class TransactionUtils { public static boolean checkEssentiallyEqual(Transaction unsignedTransaction, Transaction signedTransaction) { // Check there are the same number of transactionInputs and transactionOutputs List<TransactionInput> unsignedTransactionInputs = unsignedTransaction.getInputs(); List<Tr...
// Check that a transaction is essentially equal to itself Transaction dummy1 = FakeTxBuilder.createFakeTx(PARAMS, Coin.COIN, ADDRESS1); Transaction tx1 = new Transaction(PARAMS); tx1.addInput(dummy1.getOutput(0)); tx1.addOutput(Coin.COIN, ADDRESS1); // Different inputs, same outputs Trans...
[FOCAL] public static boolean TransactionUtils.checkEssentiallyEqual(Transaction unsignedTransaction, Transaction signedTransaction) [CLASS] class TransactionUtils [METRICS] loc=43 cc=10 branches=5 loops=4 returns=6 throws=0 nesting=2 [CALLS-INTERNAL] boolean checkTransactionInputs(TransactionInput txInputToCheck, List...
/* static context [FOCAL] public static boolean TransactionUtils.checkEssentiallyEqual(Transaction unsignedTransaction, Transaction signedTransaction) [PATH1] if((unsignedTransactionInputs.size() != signedTransactionInputs.size() || unsignedTransactionOutputs.size() != signedTra...)=F -> foreach(TransactionInput unsign...
/* static context [FOCAL] public static boolean TransactionUtils.checkEssentiallyEqual(Transaction unsignedTransaction, Transaction signedTransaction) [PATH1] if((unsignedTransactionInputs.size() != signedTransactionInputs.size() || unsignedTransactionOutputs.size() != signedTra...)=F -> foreach(TransactionInput unsign...
true
ok
{"focal": {"class": "TransactionUtils", "name": "checkEssentiallyEqual", "signature": "boolean checkEssentiallyEqual(Transaction unsignedTransaction, Transaction signedTransaction)", "start_line": 3, "modifiers": "public static", "params": [{"name": "unsignedTransaction", "type": "Transaction"}, {"name": "signedTransac...
16362553_65
class OvsdbPortUpdateCommand extends AbstractTransactionCommand { @VisibleForTesting void updateInterfaces(Interface interfaceUpdate, final OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder) { Column<GenericTableSchema, String> typeColumn = interfaceUpdate.getTypeColumn...
Interface interfaceUpdate = mock(Interface.class); Column<GenericTableSchema, String> typeColumn = mock(Column.class); when(interfaceUpdate.getTypeColumn()).thenReturn(typeColumn); when(typeColumn.getData()).thenReturn(OVSDB_INTERFACE_TYPE); doNothing().when(ovsdbPortUpdateComman...
[FOCAL] @VisibleForTesting void OvsdbPortUpdateCommand.updateInterfaces(Interface interfaceUpdate, OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder) [CLASS] class OvsdbPortUpdateCommand extends AbstractTransactionCommand [METRICS] loc=8 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-IN...
class OvsdbPortUpdateCommand extends AbstractTransactionCommand { @VisibleForTesting void updateInterfaces(Interface interfaceUpdate, final OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder) { Column<GenericTableSchema, String> typeColumn = interfaceUpdate.getTypeColumn...
false
ok
{"focal": {"class": "OvsdbPortUpdateCommand", "name": "updateInterfaces", "signature": "void updateInterfaces(Interface interfaceUpdate, OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder)", "start_line": 3, "modifiers": "@VisibleForTesting", "params": [{"name": "interfaceUpdate", "type": "Interface"...
16381579_0
class Version { public static boolean isEditionNewer(String testFW) { return isEditionNewer(testFW, getVersion()); } public static String getVersion(); public static LocalDate getReleasedDate(); static int[] getVersionNumbers(String ver); public static boolean isEditionNewer(String tes...
assertFalse(Version.isEditionNewer("5.0.5", "5.0.6")); assertFalse(Version.isEditionNewer("5.0.5", "5.0.5")); assertTrue(Version.isEditionNewer("5.0.5", "5.0.4")); assertTrue(Version.isEditionNewer("6.0.0", "5.0.4")); } }
[FOCAL] public static boolean Version.isEditionNewer(String testFW) [CLASS] class Version [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String getVersion(); boolean isEditionNewer(String testFW, String baseFW) [INPUTS] branches=- | result=testFW [DATAFLOW] testFW@param->L2 [CLASS...
/* static context [FOCAL] public static boolean Version.isEditionNewer(String testFW) [INPUTS] branches=- | result=testFW [CALLS-INTERNAL] String getVersion(); boolean isEditionNewer(String testFW, String baseFW) */
/* static context [FOCAL] public static boolean Version.isEditionNewer(String testFW) [INPUTS] branches=- | result=testFW [CALLS-INTERNAL] String getVersion(); boolean isEditionNewer(String testFW, String baseFW) */ class Version { public static boolean isEditionNewer(String testFW) { return isEditionNewer...
true
ok
{"focal": {"class": "Version", "name": "isEditionNewer", "signature": "boolean isEditionNewer(String testFW)", "start_line": 3, "modifiers": "public static", "params": [{"name": "testFW", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "Version", "kind": "class", "modifiers": "", "superclass": nul...
16389681_7
class RealBufferedSink implements BufferedSink { @Override public long writeAll(Source source) throws IOException { if (source == null) throw new IllegalArgumentException("source == null"); long totalBytesRead = 0; for (long readCount; (readCount = source.read(buffer, Segment.SIZE)) != -1; ) { tota...
MockSink mockSink = new MockSink(); BufferedSink bufferedSink = Okio.buffer(mockSink); bufferedSink.buffer().writeUtf8("abc"); assertEquals(3, bufferedSink.writeAll(new Buffer().writeUtf8("def"))); assertEquals(6, bufferedSink.buffer().size()); assertEquals("abcdef", bufferedSink.buffer().read...
[FOCAL] @Override public long RealBufferedSink.writeAll(Source source) [CLASS] class RealBufferedSink implements BufferedSink [METRICS] loc=9 cc=3 branches=1 loops=1 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] BufferedSink emitCompleteSegments() [CALLS-EXTERNAL] Source.read/2 [NEW] IllegalArgumentException [EXCEPTION...
/* static context [FOCAL] @Override public long RealBufferedSink.writeAll(Source source) [THROWS-WHEN] IllegalArgumentException when source == null [PATH1] if(source == null)=F -> for((readCount = source.read(buffer, Segment.SIZE)) != -1)=T -> exit loop -> return totalBytesRead [PATH2] if(source == null)=T -> throw new...
/* static context [FOCAL] @Override public long RealBufferedSink.writeAll(Source source) [THROWS-WHEN] IllegalArgumentException when source == null [PATH1] if(source == null)=F -> for((readCount = source.read(buffer, Segment.SIZE)) != -1)=T -> exit loop -> return totalBytesRead [PATH2] if(source == null)=T -> throw new...
true
ok
{"focal": {"class": "RealBufferedSink", "name": "writeAll", "signature": "long writeAll(Source source) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "source", "type": "Source"}], "return_type": "long"}, "class_info": {"name": "RealBufferedSink", "kind": "class", "modifiers":...
16390035_19
class ProxyRequireField extends RequireField { public static ProxyRequireField parse(String fieldValue) { ProxyRequireField result = new ProxyRequireField(); result.addFeatures(RequireField.parseFeatures(fieldValue)); return result; } public ProxyRequireField(); @Override pub...
System.out.println("RTSP message Proxy-Require field parse test..."); String[] rfs = new String[] { "Proxy-Require:f1,f2", "Proxy-Require: f1,f2", "proxy-require: f1,f2", }; int i = 0; ProxyRequireField rf; for (; i < ...
[FOCAL] public static ProxyRequireField ProxyRequireField.parse(String fieldValue) [CLASS] class ProxyRequireField extends RequireField [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] ProxyRequireField.addFeatures/1, RequireField.parseFeatures/1 [NEW] ProxyRequireField [DATAFLOW] f...
/* static context [FOCAL] public static ProxyRequireField ProxyRequireField.parse(String fieldValue) [NEW] ProxyRequireField [CALLS-EXTERNAL] ProxyRequireField.addFeatures/1, RequireField.parseFeatures/1 */
/* static context [FOCAL] public static ProxyRequireField ProxyRequireField.parse(String fieldValue) [NEW] ProxyRequireField [CALLS-EXTERNAL] ProxyRequireField.addFeatures/1, RequireField.parseFeatures/1 */ class ProxyRequireField extends RequireField { public static ProxyRequireField parse(String fieldValue) { ...
true
ok
{"focal": {"class": "ProxyRequireField", "name": "parse", "signature": "ProxyRequireField parse(String fieldValue)", "start_line": 3, "modifiers": "public static", "params": [{"name": "fieldValue", "type": "String"}], "return_type": "ProxyRequireField"}, "class_info": {"name": "ProxyRequireField", "kind": "class", "mod...
16391713_2
class DefaultConverter implements Converter<byte[]> { @Nonnull @Override public byte[] getRawForm(@Nullable byte[] value) { if (value == null) { return "null".getBytes(StandardCharsets.UTF_8); } return value; } } class DefaultConverterTest { @Test public v...
byte[] someContent = "test".getBytes(StandardCharsets.UTF_8); Assert.assertThat(new DefaultConverter().getRawForm(someContent), CoreMatchers.equalTo(someContent)); } }
[FOCAL] @Nonnull @Override public byte[] DefaultConverter.getRawForm(byte[] value) [CLASS] class DefaultConverter implements Converter<byte[]> [METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] "null".getBytes/1 [PATH1] if(value == null)=T -> return "null".getBytes(StandardCharsets.UT...
/* static context [FOCAL] @Nonnull @Override public byte[] DefaultConverter.getRawForm(byte[] value) [PATH1] if(value == null)=T -> return "null".getBytes(StandardCharsets.UTF_8) [PATH2] if(value == null)=F -> return value [INPUTS] branches=value | result=value [CALLS-EXTERNAL] "null".getBytes/1 */
/* static context [FOCAL] @Nonnull @Override public byte[] DefaultConverter.getRawForm(byte[] value) [PATH1] if(value == null)=T -> return "null".getBytes(StandardCharsets.UTF_8) [PATH2] if(value == null)=F -> return value [INPUTS] branches=value | result=value [CALLS-EXTERNAL] "null".getBytes/1 */ class DefaultConvert...
true
ok
{"focal": {"class": "DefaultConverter", "name": "getRawForm", "signature": "byte[] getRawForm(byte[] value)", "start_line": 3, "modifiers": "@Nonnull @Override public", "params": [{"name": "value", "type": "byte[]"}], "return_type": "byte[]"}, "class_info": {"name": "DefaultConverter", "kind": "class", "modifiers": "",...
16395045_211
class SplitLogWorker extends ZooKeeperListener implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); } public SplitLogWorker(ZooKeeperWatcher watcher, Configuration conf, RegionServerServices server, Ta...
LOG.info("testAcquireMultiTasks"); SplitLogCounters.resetCounters(); final String TATAS = "tatas"; final ServerName RS = ServerName.valueOf("rs,1,1"); final int maxTasks = 3; Configuration testConf = HBaseConfiguration.create(TEST_UTIL.getConfiguration()); testConf.setInt("hbase.regionserver...
[FOCAL] public void SplitLogWorker.start() [CLASS] class SplitLogWorker extends ZooKeeperListener implements Runnable [METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] worker.start/0 [NEW] Thread [COLLABORATORS] field worker start/0 [DATAFLOW] worker@L2->L4 [CLASS-MEMBERS] SplitLogWo...
/* static context [FOCAL] public void SplitLogWorker.start() [COLLABORATORS] field worker start/0 [NEW] Thread [CALLS-EXTERNAL] worker.start/0 */
/* static context [FOCAL] public void SplitLogWorker.start() [COLLABORATORS] field worker start/0 [NEW] Thread [CALLS-EXTERNAL] worker.start/0 */ class SplitLogWorker extends ZooKeeperListener implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWor...
true
ok
{"focal": {"class": "SplitLogWorker", "name": "start", "signature": "void start()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "SplitLogWorker", "kind": "class", "modifiers": "", "superclass": "ZooKeeperListener", "interfaces": "Runnable", "fields": [{"name": "L...
16404471_0
class AbstractVectorCreator implements VectorCreator { @Override public SubsetVectors[] getVectors(String[][] wordsets, SegmentationDefinition[] definitions) { SubsetProbabilities probabilities[] = supplier.getProbabilities(wordsets, definitions); return createVectors(wordsets, definitions, pro...
SegmentationDefinition definitions[] = new SegmentationDefinition[probabilities.length]; for (int i = 0; i < definitions.length; ++i) { definitions[i] = subsetCreator.getSubsetDefinition(wordsetSize); } SubsetVectors vectors[] = vectorCreator.getVectors(new String[probabiliti...
[FOCAL] @Override public SubsetVectors[] AbstractVectorCreator.getVectors(String[][] wordsets, SegmentationDefinition[] definitions) [CLASS] class AbstractVectorCreator implements VectorCreator [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] SubsetVectors[] createVectors(String[][]...
/* static context [FOCAL] @Override public SubsetVectors[] AbstractVectorCreator.getVectors(String[][] wordsets, SegmentationDefinition[] definitions) [INPUTS] branches=- | result=definitions, wordsets [COLLABORATORS] field supplier getProbabilities/2 [CALLS-INTERNAL] SubsetVectors[] createVectors(String[][] wordsets, ...
/* static context [FOCAL] @Override public SubsetVectors[] AbstractVectorCreator.getVectors(String[][] wordsets, SegmentationDefinition[] definitions) [INPUTS] branches=- | result=definitions, wordsets [COLLABORATORS] field supplier getProbabilities/2 [CALLS-INTERNAL] SubsetVectors[] createVectors(String[][] wordsets, ...
true
ok
{"focal": {"class": "AbstractVectorCreator", "name": "getVectors", "signature": "SubsetVectors[] getVectors(String[][] wordsets, SegmentationDefinition[] definitions)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "wordsets", "type": "String[][]"}, {"name": "definitions", "type": "SegmentationD...
16425010_23
class BpmnModelExporter { public String toBpmnXml(FlowBuilder flowBuilder) { return toBpmnXml(flowBuilder.getDefinition()); } public BpmnModel toBpmnModel(FlowBuilder flowBuilder); public BpmnModel toBpmnModel(FlowDefinition definition); public String toBpmnXml(FlowDefinition definition); public Strin...
// given: BpmnModelExporter bpmnModelExporter = new BpmnModelExporter(); FlowBuilder emptyFlow = new BpmnFlowBuilder() { @Override public void define() {} @Override public String getId() { return "emptyFlow"; } }; // when: String bpmnXml = bpmnModelExporter...
[FOCAL] public String BpmnModelExporter.toBpmnXml(FlowBuilder flowBuilder) [CLASS] class BpmnModelExporter [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String toBpmnXml(FlowDefinition definition) [CALLS-EXTERNAL] FlowBuilder.getDefinition/0 [INPUTS] branches=- | result=flowBuild...
/* static context [FOCAL] public String BpmnModelExporter.toBpmnXml(FlowBuilder flowBuilder) [INPUTS] branches=- | result=flowBuilder [COLLABORATORS] param flowBuilder:FlowBuilder getDefinition/0 [CALLS-INTERNAL] String toBpmnXml(FlowDefinition definition) [CALLS-EXTERNAL] FlowBuilder.getDefinition/0 */
/* static context [FOCAL] public String BpmnModelExporter.toBpmnXml(FlowBuilder flowBuilder) [INPUTS] branches=- | result=flowBuilder [COLLABORATORS] param flowBuilder:FlowBuilder getDefinition/0 [CALLS-INTERNAL] String toBpmnXml(FlowDefinition definition) [CALLS-EXTERNAL] FlowBuilder.getDefinition/0 */ class BpmnModel...
true
ok
{"focal": {"class": "BpmnModelExporter", "name": "toBpmnXml", "signature": "String toBpmnXml(FlowBuilder flowBuilder)", "start_line": 3, "modifiers": "public", "params": [{"name": "flowBuilder", "type": "FlowBuilder"}], "return_type": "String"}, "class_info": {"name": "BpmnModelExporter", "kind": "class", "modifiers": ...
16429916_0
class RestApiAdminClient { public String getServerContext() throws AxisFault { try { String returnValue = ReadWSDLPrefix(); if (returnValue != null && !returnValue.isEmpty()) { return returnValue; } else { return stub.getServerContext(); } } catch (Exception e) { handleException(bundle.getS...
String pathToAxis2Xml = getClass().getResource("/").getPath(); System.setProperty(CONF_LOCATION, pathToAxis2Xml); RestApiAdminClient restApiAdminClient = Mockito.mock(RestApiAdminClient.class); Mockito.when(restApiAdminClient.getServerContext()).thenCallRealMethod(); String serv...
[FOCAL] public String RestApiAdminClient.getServerContext() [CLASS] class RestApiAdminClient [METRICS] loc=13 cc=3 branches=1 loops=0 returns=3 throws=0 nesting=2 [CALLS-INTERNAL] String ReadWSDLPrefix(); void handleException(String msg, Exception e) [CALLS-EXTERNAL] String.isEmpty/0, stub.getServerContext/0, bundle.ge...
/* static context [FOCAL] public String RestApiAdminClient.getServerContext() [PATH1] try-body throws -> return null [PATH2] if(returnValue != null && !returnValue.isEmpty())=T -> return returnValue [PATH3] if(returnValue != null && !returnValue.isEmpty())=F -> return stub.getServerContext() [COLLABORATORS] field stub ...
/* static context [FOCAL] public String RestApiAdminClient.getServerContext() [PATH1] try-body throws -> return null [PATH2] if(returnValue != null && !returnValue.isEmpty())=T -> return returnValue [PATH3] if(returnValue != null && !returnValue.isEmpty())=F -> return stub.getServerContext() [COLLABORATORS] field stub ...
true
ok
{"focal": {"class": "RestApiAdminClient", "name": "getServerContext", "signature": "String getServerContext() throws AxisFault", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "RestApiAdminClient", "kind": "class", "modifiers": "", "superclass": null, "interfaces"...
16432662_0
class FlinkPartitioner implements Partitioner { static int computePartition(Object key, int numPartitions, int maxParallelism) { int group = murmurHash(key.hashCode()) % maxParallelism; return (group * numPartitions) / maxParallelism; } private static int toPositive(int number); public void configure(...
Random random = new Random(42L); byte[] id = new byte[16]; int maxParallelism = 10393; int numPartitions = 1983; for (int i = 0; i < 40; i++) { random.nextBytes(id); String encoded = Base64.getEncoder().encodeToString(id); int testPartition = FlinkPartitioner.computePartition(encod...
[FOCAL] static int FlinkPartitioner.computePartition(Object key, int numPartitions, int maxParallelism) [CLASS] class FlinkPartitioner implements Partitioner [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] int murmurHash(int code) [CALLS-EXTERNAL] Object.hashCode/0 [INPUTS] branche...
/* static context [FOCAL] static int FlinkPartitioner.computePartition(Object key, int numPartitions, int maxParallelism) [INPUTS] branches=- | result=key, maxParallelism, numPartitions [CALLS-INTERNAL] int murmurHash(int code) [CALLS-EXTERNAL] Object.hashCode/0 */
/* static context [FOCAL] static int FlinkPartitioner.computePartition(Object key, int numPartitions, int maxParallelism) [INPUTS] branches=- | result=key, maxParallelism, numPartitions [CALLS-INTERNAL] int murmurHash(int code) [CALLS-EXTERNAL] Object.hashCode/0 */ class FlinkPartitioner implements Partitioner { sta...
true
ok
{"focal": {"class": "FlinkPartitioner", "name": "computePartition", "signature": "int computePartition(Object key, int numPartitions, int maxParallelism)", "start_line": 3, "modifiers": "static", "params": [{"name": "key", "type": "Object"}, {"name": "numPartitions", "type": "int"}, {"name": "maxParallelism", "type": "...
16433054_3
class IntegerField extends AbstractNumberField<IntegerField, Integer> { @Override public Integer getValue() { return value; } public IntegerField(); public IntegerField(String caption); @Override protected void userInputToValue(String str); @Override public IntegerField withBlur...
assertThat(fieldUnderTest.getValue(), is((Integer) null)); } }
[FOCAL] @Override public Integer IntegerField.getValue() [CLASS] class IntegerField extends AbstractNumberField<IntegerField, Integer> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] IntegerField(); IntegerField(String caption); void userInputToValue(String str); IntegerField withBl...
/* static context [FOCAL] @Override public Integer IntegerField.getValue() */
/* static context [FOCAL] @Override public Integer IntegerField.getValue() */ class IntegerField extends AbstractNumberField<IntegerField, Integer> { @Override public Integer getValue() { return value; } public IntegerField(); public IntegerField(String caption); @Override protected...
true
ok
{"focal": {"class": "IntegerField", "name": "getValue", "signature": "Integer getValue()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Integer"}, "class_info": {"name": "IntegerField", "kind": "class", "modifiers": "", "superclass": "AbstractNumberField<IntegerField, Integer>", "inte...
16442741_0
class VersionChecker { public static VersionCheckResult checkVersion(String localVersion) { String remoteVersion = getVersion(); if (remoteVersion == null || remoteVersion.isEmpty()) { return VersionCheckResult.error(); } Integer[] iLocalVersion = parseVersion(localVer...
String version = VersionChecker.getVersion(); assertNotNull("Version string is null", version); } }
[FOCAL] public static VersionCheckResult VersionChecker.checkVersion(String localVersion) [CLASS] class VersionChecker [METRICS] loc=24 cc=5 branches=3 loops=1 returns=4 throws=0 nesting=3 [CALLS-INTERNAL] Integer[] parseVersion(String localVersion); String getVersion() [CALLS-EXTERNAL] String.isEmpty/0, VersionCheckRe...
/* static context [FOCAL] public static VersionCheckResult VersionChecker.checkVersion(String localVersion) [PATH1] if(remoteVersion == null || remoteVersion.isEmpty())=F -> for(i < Math.max(iLocalVersion.length, iRemoteVersion.length))=T -> if(local < remote)=F -> if(local > remote)=F -> exit loop -> return VersionChe...
/* static context [FOCAL] public static VersionCheckResult VersionChecker.checkVersion(String localVersion) [PATH1] if(remoteVersion == null || remoteVersion.isEmpty())=F -> for(i < Math.max(iLocalVersion.length, iRemoteVersion.length))=T -> if(local < remote)=F -> if(local > remote)=F -> exit loop -> return VersionChe...
true
ok
{"focal": {"class": "VersionChecker", "name": "checkVersion", "signature": "VersionCheckResult checkVersion(String localVersion)", "start_line": 3, "modifiers": "public static", "params": [{"name": "localVersion", "type": "String"}], "return_type": "VersionCheckResult"}, "class_info": {"name": "VersionChecker", "kind":...
16446099_10
class SemVerComparator implements Comparator<String> { @Override public int compare(String version1, String version2) { // "Build metadata SHOULD be ignored when determining version precedence. // Thus two versions that differ only in the build metadata, have the same precedence." String v1WithoutBuildMetadata...
Assertions.assertEquals(-1, Integer.signum(semVerComparator.compare("1.23.4", "1.23.5"))); Assertions.assertEquals(-1, Integer.signum(semVerComparator.compare("1.23.4", "1.24.4"))); Assertions.assertEquals(-1, Integer.signum(semVerComparator.compare("1.23", "1.23.4"))); Assertions.assertEquals(-1, Integer.signu...
[FOCAL] @Override public int SemVerComparator.compare(String version1, String version2) [CLASS] class SemVerComparator implements Comparator<String> [METRICS] loc=17 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] int compare(String v1MajorMinorPatch, String v1PreReleaseVersion, String v2MajorMino...
/* static context [FOCAL] @Override public int SemVerComparator.compare(String version1, String version2) [PATH1] if(v1WithoutBuildMetadata.equals(v2WithoutBuildMetadata))=T -> return 0 [PATH2] if(v1WithoutBuildMetadata.equals(v2WithoutBuildMetadata))=F -> return compare(v1MajorMinorPatch, v1PreReleaseVersion, v2MajorM...
/* static context [FOCAL] @Override public int SemVerComparator.compare(String version1, String version2) [PATH1] if(v1WithoutBuildMetadata.equals(v2WithoutBuildMetadata))=T -> return 0 [PATH2] if(v1WithoutBuildMetadata.equals(v2WithoutBuildMetadata))=F -> return compare(v1MajorMinorPatch, v1PreReleaseVersion, v2MajorM...
true
ok
{"focal": {"class": "SemVerComparator", "name": "compare", "signature": "int compare(String version1, String version2)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "version1", "type": "String"}, {"name": "version2", "type": "String"}], "return_type": "int"}, "class_info": {"name": "SemVerComp...
16451749_4
class EasyJaSubProperty { public static String getOptionDescription(EasyJaSubInputOption optionIndex) { return InputOptions[optionIndex.ordinal()]; } private EasyJaSubProperty(); private static InputStream getPropertiesResourceStream(String name); public static String getName(); public static String getVers...
assertNotNull(EasyJaSubProperty .getOptionDescription(EasyJaSubInputOption.dictionary)); assertNotNull(EasyJaSubProperty .getOptionDescription(EasyJaSubInputOption.furigana)); assertNotNull(EasyJaSubProperty .getOptionDescription(EasyJaSubInputOption.approxdiff)); } }
[FOCAL] public static String EasyJaSubProperty.getOptionDescription(EasyJaSubInputOption optionIndex) [CLASS] class EasyJaSubProperty [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] EasyJaSubInputOption.ordinal/0 [INPUTS] branches=- | result=optionIndex [COLLABORATORS] param option...
/* static context [FOCAL] public static String EasyJaSubProperty.getOptionDescription(EasyJaSubInputOption optionIndex) [INPUTS] branches=- | result=optionIndex [COLLABORATORS] param optionIndex:EasyJaSubInputOption ordinal/0 [CALLS-EXTERNAL] EasyJaSubInputOption.ordinal/0 */
/* static context [FOCAL] public static String EasyJaSubProperty.getOptionDescription(EasyJaSubInputOption optionIndex) [INPUTS] branches=- | result=optionIndex [COLLABORATORS] param optionIndex:EasyJaSubInputOption ordinal/0 [CALLS-EXTERNAL] EasyJaSubInputOption.ordinal/0 */ class EasyJaSubProperty { public static S...
true
ok
{"focal": {"class": "EasyJaSubProperty", "name": "getOptionDescription", "signature": "String getOptionDescription(EasyJaSubInputOption optionIndex)", "start_line": 3, "modifiers": "public static", "params": [{"name": "optionIndex", "type": "EasyJaSubInputOption"}], "return_type": "String"}, "class_info": {"name": "Eas...
16458851_218
class GeneticConfiguration implements Comparable<GeneticConfiguration> { public void mutate() { Aspect aspect = aspects.get((int) (Math.random() * aspects.size())); aspect.setRandomly(this); } public GeneticConfiguration(Configuration config); public GeneticConfiguration(Configuration config, int mu...
GeneticConfiguration conf = new GeneticConfiguration(config1.copy()); conf.mutate(); Configuration rand = conf.getConfiguration(); int diffs = countDifferences(config1, rand); if (diffs == 0) { // this happens every now and then by accident. when it does, we // give it a second try. ...
[FOCAL] public void GeneticConfiguration.mutate() [CLASS] class GeneticConfiguration implements Comparable<GeneticConfiguration> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] aspects.get/1, Math.random/0, aspects.size/0, Aspect.setRandomly/1 [COLLABORATORS] field aspects get/1,si...
/* static context [FOCAL] public void GeneticConfiguration.mutate() [COLLABORATORS] field aspects get/1,size/0 [CALLS-EXTERNAL] aspects.get/1, Math.random/0, aspects.size/0, Aspect.setRandomly/1 */
/* static context [FOCAL] public void GeneticConfiguration.mutate() [COLLABORATORS] field aspects get/1,size/0 [CALLS-EXTERNAL] aspects.get/1, Math.random/0, aspects.size/0, Aspect.setRandomly/1 */ class GeneticConfiguration implements Comparable<GeneticConfiguration> { public void mutate() { Aspect aspect = asp...
true
ok
{"focal": {"class": "GeneticConfiguration", "name": "mutate", "signature": "void mutate()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "GeneticConfiguration", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Comparable<GeneticConfiguration>",...
16460789_6
class ArmorDAO extends OwnedIdentifiableTableDAO<Long, Armor> { @Override public void update(OwnedObject<Long, Armor> rowData) throws DataAccessException { try { beginTransaction(); itemDAO.update(OwnedObject.of(rowData.getOwnerId(), (Item) rowData.getObject())); sup...
Armor toUpdate = m_armor2; setValues(m_armor2, m_armor2.getId(), "Larger Hat", 2.0, true, 11, 25, 101, 12, 21, "Hat thing", Size.MEDIUM); dao.update(getTestCharacterId(), toUpdate); Armor updated = dao.find(toUpdate.getId()); assertEquals(toUpdate, updated); ...
[FOCAL] @Override public void ArmorDAO.update(OwnedObject<Long, Armor> rowData) [CLASS] class ArmorDAO extends OwnedIdentifiableTableDAO<Long, Armor> [METRICS] loc=11 cc=2 branches=0 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] beginTransaction/0 (inherited), itemDAO.update/1, OwnedObject.of/2, OwnedObject<Lon...
/* static context [FOCAL] @Override public void ArmorDAO.update(OwnedObject<Long, Armor> rowData) [PATH1] try-body throws [COLLABORATORS] field itemDAO update/1; param rowData:OwnedObject<Long, Armor> getOwnerId/0,getObject/0 [EXCEPTIONS] declares DataAccessException [CALLS-EXTERNAL] beginTransaction/0 (inherited), ite...
/* static context [FOCAL] @Override public void ArmorDAO.update(OwnedObject<Long, Armor> rowData) [PATH1] try-body throws [COLLABORATORS] field itemDAO update/1; param rowData:OwnedObject<Long, Armor> getOwnerId/0,getObject/0 [EXCEPTIONS] declares DataAccessException [CALLS-EXTERNAL] beginTransaction/0 (inherited), ite...
true
ok
{"focal": {"class": "ArmorDAO", "name": "update", "signature": "void update(OwnedObject<Long, Armor> rowData) throws DataAccessException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "rowData", "type": "OwnedObject<Long, Armor>"}], "return_type": "void"}, "class_info": {"name": "ArmorDAO", "ki...
16477640_0
class BusinessLogic { public Book getFullBook(Book book) { if (book.getId() != null) { Book bookById = dao.getBookById(book.getId()); return bookById; } else if (book.getName() != null) { return dao.getBookByName(book.getName()); } else { retu...
BusinessLogic logic = new BusinessLogic(); logic.setDao(dao); Book actualBook1 = logic.getFullBook(new Book(1L, null, null)); verify(dao).getBookById(1L); assertEquals(book1, actualBook1); Book actualBook2 = logic.getFullBook(new Book(null, "Java For Middle", null)); ...
[FOCAL] public Book BusinessLogic.getFullBook(Book book) [CLASS] class BusinessLogic [METRICS] loc=10 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=2 [CALLS-EXTERNAL] Book.getId/0, DAO.getBookById/1, Book.getName/0, DAO.getBookByName/1 [FIELDS] read=dao:DAO [PATH1] if(book.getId() != null)=F -> if(book.getName() !...
/* static context [FOCAL] public Book BusinessLogic.getFullBook(Book book) [PATH1] if(book.getId() != null)=F -> if(book.getName() != null)=T -> return dao.getBookByName(book.getName()) [PATH2] if(book.getId() != null)=T -> return bookById [PATH3] if(book.getId() != null)=F -> if(book.getName() != null)=F -> return nul...
/* static context [FOCAL] public Book BusinessLogic.getFullBook(Book book) [PATH1] if(book.getId() != null)=F -> if(book.getName() != null)=T -> return dao.getBookByName(book.getName()) [PATH2] if(book.getId() != null)=T -> return bookById [PATH3] if(book.getId() != null)=F -> if(book.getName() != null)=F -> return nul...
true
ok
{"focal": {"class": "BusinessLogic", "name": "getFullBook", "signature": "Book getFullBook(Book book)", "start_line": 3, "modifiers": "public", "params": [{"name": "book", "type": "Book"}], "return_type": "Book"}, "class_info": {"name": "BusinessLogic", "kind": "class", "modifiers": "", "superclass": null, "interfaces"...
16477702_5
class ParseStreamManagement { public static Failed failed(XmlPullParser parser) throws XmlPullParserException, IOException { ParserUtils.assertAtStartTag(parser); String name; StanzaError.Condition condition = null; List<StanzaErrorTextElement> textElements = new ArrayList<>(4); ...
StanzaError.Condition errorCondition = StanzaError.Condition.unexpected_request; String failedStanza = XMLBuilder.create("failed") .a("xmlns", "urn:xmpp:sm:3") .element(errorCondition.toString(), StanzaError.ERROR_CONDITION_AND_TEXT_NAMESPACE) .asString(o...
[FOCAL] public static Failed ParseStreamManagement.failed(XmlPullParser parser) [CLASS] class ParseStreamManagement [METRICS] loc=37 cc=6 branches=4 loops=1 returns=1 throws=0 nesting=4 [CALLS-EXTERNAL] ParserUtils.assertAtStartTag/1, XmlPullParser.next/0, XmlPullParser.getName/0, XmlPullParser.getNamespace/0, StanzaEr...
/* static context [FOCAL] public static Failed ParseStreamManagement.failed(XmlPullParser parser) [PATH1] while(true)=T -> switch(event)=case END_ELEMENT -> if(Failed.ELEMENT.equals(name))=T -> return new Failed(condition, textElements) [INPUTS] branches=parser | result=parser [COLLABORATORS] param parser:XmlPullParser...
/* static context [FOCAL] public static Failed ParseStreamManagement.failed(XmlPullParser parser) [PATH1] while(true)=T -> switch(event)=case END_ELEMENT -> if(Failed.ELEMENT.equals(name))=T -> return new Failed(condition, textElements) [INPUTS] branches=parser | result=parser [COLLABORATORS] param parser:XmlPullParser...
true
ok
{"focal": {"class": "ParseStreamManagement", "name": "failed", "signature": "Failed failed(XmlPullParser parser) throws XmlPullParserException, IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "parser", "type": "XmlPullParser"}], "return_type": "Failed"}, "class_info": {"name": "ParseStr...
16479425_1
class WelcomeAdapter extends FragmentStatePagerAdapter { @Override public int getCount() { return fragments.size(); } @Inject WelcomeAdapter(@Named(BaseActivityModule.ACTIVITY_FRAGMENT_MANAGER) FragmentManager fm, RequirementsChecker requirementsChecker); void setupFragments(Fragment in...
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), androidVersion); when(requirementsChecker.isInitialSetupCheckPassed()).thenReturn(initialSetupCheckPassed); when(requirementsChecker.isPlayCheckPassed()).thenReturn(playCheckPassed); when(requirementsChecker.isPermissionCheckPassed(...
[FOCAL] @Override public int WelcomeAdapter.getCount() [CLASS] class WelcomeAdapter extends FragmentStatePagerAdapter [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] fragments.size/0 [COLLABORATORS] field fragments size/0 [CLASS-MEMBERS] WelcomeAdapter(FragmentManager fm, Requireme...
/* static context [FOCAL] @Override public int WelcomeAdapter.getCount() [COLLABORATORS] field fragments size/0 [CALLS-EXTERNAL] fragments.size/0 */
/* static context [FOCAL] @Override public int WelcomeAdapter.getCount() [COLLABORATORS] field fragments size/0 [CALLS-EXTERNAL] fragments.size/0 */ class WelcomeAdapter extends FragmentStatePagerAdapter { @Override public int getCount() { return fragments.size(); } @Inject WelcomeAdapter(@Na...
true
ok
{"focal": {"class": "WelcomeAdapter", "name": "getCount", "signature": "int getCount()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "WelcomeAdapter", "kind": "class", "modifiers": "", "superclass": "FragmentStatePagerAdapter", "interfaces": null, "field...
16481293_2
class HistoryManagerImpl implements HistoryManager { @Override public void setHistorySize(int size) { if(size < 1) { throw new IllegalArgumentException("History max size value invalid: " + size); } if(size > 50) { // warning log LOG.info("History size is...
System.out.println("setHistorySize"); HistoryManagerImpl instance = new HistoryManagerImpl(); instance.setHistorySize(HistoryManager.DEFAULT_HISTORY_SIZE); for(int i=0; i<10; i++) { RequestBean request = new RequestBean(); request.setUrl(new URL(...
[FOCAL] @Override public void HistoryManagerImpl.setHistorySize(int size) [CLASS] class HistoryManagerImpl implements HistoryManager [METRICS] loc=36 cc=8 branches=6 loops=1 returns=1 throws=1 nesting=3 [CALLS-INTERNAL] void updateOptions() [CALLS-EXTERNAL] LOG.info/1, data.size/0, data.removeLast/0 [NEW] IllegalArgume...
/* static context [FOCAL] @Override public void HistoryManagerImpl.setHistorySize(int size) [THROWS-WHEN] IllegalArgumentException when size < 1 [PATH1] if(size < 1)=F -> if(size > 50)=T -> if(maxSize == size)=F -> if(maxSize > size)=T -> if(cursor >= size)=T -> if(data.size() > size)=T -> for(i<diff)=T -> exit loop [P...
/* static context [FOCAL] @Override public void HistoryManagerImpl.setHistorySize(int size) [THROWS-WHEN] IllegalArgumentException when size < 1 [PATH1] if(size < 1)=F -> if(size > 50)=T -> if(maxSize == size)=F -> if(maxSize > size)=T -> if(cursor >= size)=T -> if(data.size() > size)=T -> for(i<diff)=T -> exit loop [P...
true
ok
{"focal": {"class": "HistoryManagerImpl", "name": "setHistorySize", "signature": "void setHistorySize(int size)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "size", "type": "int"}], "return_type": "void"}, "class_info": {"name": "HistoryManagerImpl", "kind": "class", "modifiers": "", "supercl...
16492034_58
class ApacheErrorLogPlugin extends LogFileTailPlugin { public TrackEvent processLine(FileInfo info, String line) { ApacheErrorLogEntry entry = new ApacheErrorLogEntry(); if (!entry.parse(line)) { return null; } return newTrackEvent(System.currentTimeMillis(), //XXX pars...
String line = "[Wed Jan 21 20:47:35 2004] [Error] This is a test message"; TrackEvent event = plugin.processLine(mockFileInfo, line); assertNotNull(event); assertEquals(3, event.getLevel()); assertEquals("This is a test message", event.getMessage()); } }
[FOCAL] public TrackEvent ApacheErrorLogPlugin.processLine(FileInfo info, String line) [CLASS] class ApacheErrorLogPlugin extends LogFileTailPlugin [METRICS] loc=11 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] ApacheErrorLogEntry.parse/1, newTrackEvent/4 (inherited), System.currentTimeMillis/0,...
/* static context [FOCAL] public TrackEvent ApacheErrorLogPlugin.processLine(FileInfo info, String line) [PATH1] if(!entry.parse(line))=T -> return null [PATH2] if(!entry.parse(line))=F -> return newTrackEvent(System.currentTimeMillis(), //XXX parse entry.timeSta... [INPUTS] branches=line | result=info [COLLABORATORS] ...
/* static context [FOCAL] public TrackEvent ApacheErrorLogPlugin.processLine(FileInfo info, String line) [PATH1] if(!entry.parse(line))=T -> return null [PATH2] if(!entry.parse(line))=F -> return newTrackEvent(System.currentTimeMillis(), //XXX parse entry.timeSta... [INPUTS] branches=line | result=info [COLLABORATORS] ...
true
ok
{"focal": {"class": "ApacheErrorLogPlugin", "name": "processLine", "signature": "TrackEvent processLine(FileInfo info, String line)", "start_line": 3, "modifiers": "public", "params": [{"name": "info", "type": "FileInfo"}, {"name": "line", "type": "String"}], "return_type": "TrackEvent"}, "class_info": {"name": "Apache...
16501680_0
class GoogleAnalyticsDataPublisher { public static String buildPayloadString(Object o) { String queryString = ""; Class<?> clazz = o.getClass(); Field[] fields = clazz.getDeclaredFields(); for(int i=0; i<fields.length; i++) { fields[i].setAccessible(true); ...
GoogleAnalyticsData data = new GoogleAnalyticsData .DataBuilder("trackingId", "1", "clientId", GoogleAnalyticsConstants.HIT_TYPE_PAGEVIEW) .setDocumentPath("/") .setDocumentHostName("localhost.com") .setDocumentTitle("Home Page") .b...
[FOCAL] public static String GoogleAnalyticsDataPublisher.buildPayloadString(Object o) [CLASS] class GoogleAnalyticsDataPublisher [METRICS] loc=23 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] String encodeString(String queryString); String getFieldValue(Field f, Object o) [CALLS-EXTERNAL] Objec...
/* static context [FOCAL] public static String GoogleAnalyticsDataPublisher.buildPayloadString(Object o) [PATH1] for(i<fields.length)=T -> if(fieldValue == null)=T -> exit loop -> return queryString [PATH2] for(i<fields.length)=F -> return queryString [PATH3] for(i<fields.length)=T -> if(fieldValue == null)=F -> exit l...
/* static context [FOCAL] public static String GoogleAnalyticsDataPublisher.buildPayloadString(Object o) [PATH1] for(i<fields.length)=T -> if(fieldValue == null)=T -> exit loop -> return queryString [PATH2] for(i<fields.length)=F -> return queryString [PATH3] for(i<fields.length)=T -> if(fieldValue == null)=F -> exit l...
true
ok
{"focal": {"class": "GoogleAnalyticsDataPublisher", "name": "buildPayloadString", "signature": "String buildPayloadString(Object o)", "start_line": 3, "modifiers": "public static", "params": [{"name": "o", "type": "Object"}], "return_type": "String"}, "class_info": {"name": "GoogleAnalyticsDataPublisher", "kind": "clas...
16511407_1
class EmbeddedDescriptor extends TynamoPropertyDescriptorImpl implements IdentifierDescriptor { @Override public Object clone() { return new EmbeddedDescriptor(this); } public EmbeddedDescriptor(Class beanType, TynamoPropertyDescriptor descriptor, TynamoClassDescriptor embeddedClassDescriptor); private Embe...
EmbeddedDescriptor embeddedDescriptor = new EmbeddedDescriptor(Embeddor.class, new TynamoPropertyDescriptorImpl(Embeddor.class, "embeddee", Embeddee.class), new TynamoClassDescriptorImpl(Embeddee.class)); embeddedDescriptor.getEmbeddedClassDescriptor().getPropertyDescriptors().add(new TynamoPropertyDescrip...
[FOCAL] @Override public Object EmbeddedDescriptor.clone() [CLASS] class EmbeddedDescriptor extends TynamoPropertyDescriptorImpl implements IdentifierDescriptor [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] EmbeddedDescriptor [CLASS-MEMBERS] EmbeddedDescriptor(Class beanType, TynamoProperty...
/* static context [FOCAL] @Override public Object EmbeddedDescriptor.clone() [NEW] EmbeddedDescriptor */
/* static context [FOCAL] @Override public Object EmbeddedDescriptor.clone() [NEW] EmbeddedDescriptor */ class EmbeddedDescriptor extends TynamoPropertyDescriptorImpl implements IdentifierDescriptor { @Override public Object clone() { return new EmbeddedDescriptor(this); } public EmbeddedDescriptor(Class bean...
true
ok
{"focal": {"class": "EmbeddedDescriptor", "name": "clone", "signature": "Object clone()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Object"}, "class_info": {"name": "EmbeddedDescriptor", "kind": "class", "modifiers": "", "superclass": "TynamoPropertyDescriptorImpl", "interfaces": "...
16538895_16
class CifarDAO extends DatasetsDAO { public static long selectCount() { String SELECT_COUNT = "SELECT COUNT(*) FROM CIFAR"; return Yank.queryScalar(SELECT_COUNT, Long.class, null); } public static void init(String dataFilesDir); public static int dropTable(); public static int getTrainTestSplit();...
long count = CifarDAO.selectCount(); assertThat(count, equalTo(60000L)); } }
[FOCAL] public static long CifarDAO.selectCount() [CLASS] class CifarDAO extends DatasetsDAO [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Yank.queryScalar/3 [DATAFLOW] SELECT_COUNT@L3->L5 [CLASS-MEMBERS] void init(String dataFilesDir); int dropTable(); int getTrainTestSplit(); i...
/* static context [FOCAL] public static long CifarDAO.selectCount() [CALLS-EXTERNAL] Yank.queryScalar/3 */
/* static context [FOCAL] public static long CifarDAO.selectCount() [CALLS-EXTERNAL] Yank.queryScalar/3 */ class CifarDAO extends DatasetsDAO { public static long selectCount() { String SELECT_COUNT = "SELECT COUNT(*) FROM CIFAR"; return Yank.queryScalar(SELECT_COUNT, Long.class, null); } public stati...
true
ok
{"focal": {"class": "CifarDAO", "name": "selectCount", "signature": "long selectCount()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "long"}, "class_info": {"name": "CifarDAO", "kind": "class", "modifiers": "", "superclass": "DatasetsDAO", "interfaces": null, "fields": [], "members": [{...
16547484_367
class CollectionChangeListener implements ICollectionChangeListener { @Override public boolean monitorOneOf(ChangedCollections changedCollections) { SortedSet<String> collectionPathSet = convertSetToComparePath(changedCollections); return !Sets.intersection( Sets.newHashSet(Iterables.transform(getMonitored...
Set<AnalysedSyncCollection> monitored = ImmutableSet.of( AnalysedSyncCollection.builder() .collectionId(CollectionId.of(1)) .collectionPath("an") .syncKey(new SyncKey("1")) .build(), AnalysedSyncCollection.builder() .collectionId(CollectionId.of(2)) .collectionPath("other") ...
[FOCAL] @Override public boolean CollectionChangeListener.monitorOneOf(ChangedCollections changedCollections) [CLASS] class CollectionChangeListener implements ICollectionChangeListener [METRICS] loc=12 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Set<AnalysedSyncCollection> getMonitoredCollect...
/* static context [FOCAL] @Override public boolean CollectionChangeListener.monitorOneOf(ChangedCollections changedCollections) [INPUTS] branches=- | result=changedCollections [COLLABORATORS] field input getCollectionPath/0 [CALLS-INTERNAL] Set<AnalysedSyncCollection> getMonitoredCollections(); SortedSet<String> conver...
/* static context [FOCAL] @Override public boolean CollectionChangeListener.monitorOneOf(ChangedCollections changedCollections) [INPUTS] branches=- | result=changedCollections [COLLABORATORS] field input getCollectionPath/0 [CALLS-INTERNAL] Set<AnalysedSyncCollection> getMonitoredCollections(); SortedSet<String> conver...
true
ok
{"focal": {"class": "CollectionChangeListener", "name": "monitorOneOf", "signature": "boolean monitorOneOf(ChangedCollections changedCollections)", "start_line": 4, "modifiers": "@Override public", "params": [{"name": "changedCollections", "type": "ChangedCollections"}], "return_type": "boolean"}, "class_info": {"name"...
16563359_1
class ArchaiusTypeConfigurationResolver implements TypeConfigurationResolver { @Override public ComponentConfigurationResolver getConfigurationFactory(final String componentType) { ComponentConfigurationResolver factory = overrides.get(componentType); if (factory != null) return fac...
Properties properties = new Properties(); properties.put("id1.sometype.a", "_a1"); properties.put("id2.sometype", "{\"type\":\"_type\",\"a\":\"_a2\"}"); properties.put("id3.sometype", "{\"type\":\"_type\",\"a\":\"_a3\"}"); System.out.println(properties); properti...
[FOCAL] @Override public ComponentConfigurationResolver ArchaiusTypeConfigurationResolver.getConfigurationFactory(String componentType) [CLASS] class ArchaiusTypeConfigurationResolver implements TypeConfigurationResolver [METRICS] loc=64 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=4 [CALLS-EXTERNAL] overrides.ge...
/* static context [FOCAL] @Override public ComponentConfigurationResolver ArchaiusTypeConfigurationResolver.getConfigurationFactory(String componentType) [PATH1] if(factory != null)=T -> return factory [PATH2] if(factory != null)=F -> return new ComponentConfigurationResolver() { @Override public Configurati... [INPUTS...
/* static context [FOCAL] @Override public ComponentConfigurationResolver ArchaiusTypeConfigurationResolver.getConfigurationFactory(String componentType) [PATH1] if(factory != null)=T -> return factory [PATH2] if(factory != null)=F -> return new ComponentConfigurationResolver() { @Override public Configurati... [INPUTS...
true
ok
{"focal": {"class": "ArchaiusTypeConfigurationResolver", "name": "getConfigurationFactory", "signature": "ComponentConfigurationResolver getConfigurationFactory(String componentType)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "componentType", "type": "String"}], "return_type": "ComponentCon...
16569959_4
class Document2004 implements IDocument, IElement { @Override public String getContent() { if(hasBeenCalledBefore ){ return txt.toString(); }else{ hasBeenCalledBefore = true; } txt.append(this.getUri()); txt.append(getDocumentHead()); txt...
IDocument myDoc = new Document2004(); assertEquals(myDoc.getContent(), myDoc.getContent()); assertEquals(myDoc.getContent(), myDoc.getContent()); } }
[FOCAL] @Override public String Document2004.getContent() [CLASS] class Document2004 implements IDocument, IElement [METRICS] loc=18 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] IBody getBody(); Object getDocumentHead(); String getUri(); String setUpPageOrientation(String txt) [CALLS-EXTERNAL] ...
/* static context [FOCAL] @Override public String Document2004.getContent() [PATH1] if(hasBeenCalledBefore)=T -> return txt.toString() [PATH2] if(hasBeenCalledBefore)=F -> return finalString [COLLABORATORS] field txt toString/0,append/1 [CALLS-INTERNAL] IBody getBody(); Object getDocumentHead(); String getUri(); String...
/* static context [FOCAL] @Override public String Document2004.getContent() [PATH1] if(hasBeenCalledBefore)=T -> return txt.toString() [PATH2] if(hasBeenCalledBefore)=F -> return finalString [COLLABORATORS] field txt toString/0,append/1 [CALLS-INTERNAL] IBody getBody(); Object getDocumentHead(); String getUri(); String...
true
ok
{"focal": {"class": "Document2004", "name": "getContent", "signature": "String getContent()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "Document2004", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "IDocument, IElement", "field...
16594787_20
class GroupByElement extends SqlQueryBuilderElement { public static Optional<GroupByElement> createGroupByElement(SqlQueryBuilderAccess queryBuilderAccess) { final QueryParameter queryParameter = queryBuilderAccess.getQueryParameter(); if (queryParameter.getGroups().isEmpty()) { return ...
final DimensionTable dimensionTable = new DimensionTable("testDimension", "testDimensionName"); dimensionTable.addTableColumn("testColumn", ColumnDataType.STRING, "TESTINFONAME"); dimensionTable.addTableColumn("testColumn2", ColumnDataType.STRING, "TESTINFONAME2"); final SelectElement se...
[FOCAL] public static Optional<GroupByElement> GroupByElement.createGroupByElement(SqlQueryBuilderAccess queryBuilderAccess) [CLASS] class GroupByElement extends SqlQueryBuilderElement [METRICS] loc=25 cc=7 branches=5 loops=1 returns=2 throws=1 nesting=4 [CALLS-EXTERNAL] SqlQueryBuilderAccess.getQueryParameter/0, query...
/* static context [FOCAL] public static Optional<GroupByElement> GroupByElement.createGroupByElement(SqlQueryBuilderAccess queryBuilderAccess) [THROWS-WHEN] IllegalArgumentException when !(queryParameter.getGroups().isEmpty()) && foreach(Pair<String, String> group : queryParameter.getGroups())=T && !StringUtils.isBlank...
/* static context [FOCAL] public static Optional<GroupByElement> GroupByElement.createGroupByElement(SqlQueryBuilderAccess queryBuilderAccess) [THROWS-WHEN] IllegalArgumentException when !(queryParameter.getGroups().isEmpty()) && foreach(Pair<String, String> group : queryParameter.getGroups())=T && !StringUtils.isBlank...
true
ok
{"focal": {"class": "GroupByElement", "name": "createGroupByElement", "signature": "Optional<GroupByElement> createGroupByElement(SqlQueryBuilderAccess queryBuilderAccess)", "start_line": 3, "modifiers": "public static", "params": [{"name": "queryBuilderAccess", "type": "SqlQueryBuilderAccess"}], "return_type": "Option...
16641539_18
class URIBuilder { public URIBuilder setRawFragment(final String rawFragment) { _rawFragment = rawFragment; return this; } public URIBuilder(); public URIBuilder(final String uri); public URIBuilder(final URI uri); private static URI toUri(final String uri); private vo...
// Arrange final URIBuilder uriBuilder = new URIBuilder("scheme://user@host:8000/path?a=1#fragment"); // Act uriBuilder.setRawFragment("new-fragment"); // Assert assertEquals("scheme", uriBuilder.getScheme()); assertEquals("//user@host:8000/path?a=1", uriBuilder...
[FOCAL] public URIBuilder URIBuilder.setRawFragment(String rawFragment) [CLASS] class URIBuilder [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [DATAFLOW] rawFragment@param->L2 [CLASS-MEMBERS] URIBuilder(); URIBuilder(String uri); URIBuilder(URI uri); URI toUri(String uri); void init(URI uri); Str...
/* static context [FOCAL] public URIBuilder URIBuilder.setRawFragment(String rawFragment) */
/* static context [FOCAL] public URIBuilder URIBuilder.setRawFragment(String rawFragment) */ class URIBuilder { public URIBuilder setRawFragment(final String rawFragment) { _rawFragment = rawFragment; return this; } public URIBuilder(); public URIBuilder(final String uri); publi...
true
ok
{"focal": {"class": "URIBuilder", "name": "setRawFragment", "signature": "URIBuilder setRawFragment(String rawFragment)", "start_line": 3, "modifiers": "public", "params": [{"name": "rawFragment", "type": "String"}], "return_type": "URIBuilder"}, "class_info": {"name": "URIBuilder", "kind": "class", "modifiers": "", "s...
16677474_0
class Caller { public static boolean isAsynchronous(Object receiver, String method, Object... args) { Info i = store.get(); return i.receiver != null && receiver==i.receiver.get() && method.equals(i.method) && arrayShallowEquals(i.args, args); } private static boolean arrayShallowEquals(Re...
assertFalse(Caller.isAsynchronous("hello", "isEmpty")); } }
[FOCAL] public static boolean Caller.isAsynchronous(Object receiver, String method, Object... args) [CLASS] class Caller [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] boolean arrayShallowEquals(Reference<Object>[] a, Object[] b) [CALLS-EXTERNAL] store.get/0, i.receiver.get/0, Str...
/* static context [FOCAL] public static boolean Caller.isAsynchronous(Object receiver, String method, Object... args) [INPUTS] branches=- | result=args, method, receiver [COLLABORATORS] field store get/0 [CALLS-INTERNAL] boolean arrayShallowEquals(Reference<Object>[] a, Object[] b) [CALLS-EXTERNAL] store.get/0, i.recei...
/* static context [FOCAL] public static boolean Caller.isAsynchronous(Object receiver, String method, Object... args) [INPUTS] branches=- | result=args, method, receiver [COLLABORATORS] field store get/0 [CALLS-INTERNAL] boolean arrayShallowEquals(Reference<Object>[] a, Object[] b) [CALLS-EXTERNAL] store.get/0, i.recei...
true
ok
{"focal": {"class": "Caller", "name": "isAsynchronous", "signature": "boolean isAsynchronous(Object receiver, String method, Object... args)", "start_line": 3, "modifiers": "public static", "params": [{"name": "receiver", "type": "Object"}, {"name": "method", "type": "String"}, {"name": "args", "type": "Object..."}], "...
16687794_64
class FlexyPoolDataSource implements DataSource, LifeCycleCallback, ConnectionPoolCallback, Closeable { @Override public <T> T unwrap(Class<T> iface) throws SQLException { return targetDataSource.unwrap(iface); } public FlexyPoolDataSource(final Configuration<T> configuration, ...
Class<?> clazz = getClass(); flexyPoolDataSource.unwrap(clazz); verify(dataSource, times(1)).unwrap(same(clazz)); } }
[FOCAL] @Override public T FlexyPoolDataSource.unwrap(Class<T> iface) [CLASS] class FlexyPoolDataSource implements DataSource, LifeCycleCallback, ConnectionPoolCallback, Closeable [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] targetDataSource.unwrap/1 [EXCEPTIONS] declares SQLExc...
/* static context [FOCAL] @Override public T FlexyPoolDataSource.unwrap(Class<T> iface) [INPUTS] branches=- | result=iface [COLLABORATORS] field targetDataSource unwrap/1 [EXCEPTIONS] declares SQLException [CALLS-EXTERNAL] targetDataSource.unwrap/1 */
/* static context [FOCAL] @Override public T FlexyPoolDataSource.unwrap(Class<T> iface) [INPUTS] branches=- | result=iface [COLLABORATORS] field targetDataSource unwrap/1 [EXCEPTIONS] declares SQLException [CALLS-EXTERNAL] targetDataSource.unwrap/1 */ class FlexyPoolDataSource implements DataSource, LifeCycleCallback, ...
true
ok
{"focal": {"class": "FlexyPoolDataSource", "name": "unwrap", "signature": "T unwrap(Class<T> iface) throws SQLException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "iface", "type": "Class<T>"}], "return_type": "T"}, "class_info": {"name": "FlexyPoolDataSource", "kind": "class", "modifiers": ...
16709732_2
class MappingPattern implements Serializable { @Override public boolean equals(Object obj) { if (obj instanceof MappingPattern) { MappingPattern otherPattern = (MappingPattern) obj; if (this.method.equals(otherPattern.getMethod()) && this.pattern.toString().equals(otherPattern.g...
// GIVEN String path = "/v0.1/me"; Pattern p1 = Pattern.compile(path); MappingPattern pattern1 = new MappingPattern(p1, "GET"); Pattern p2 = Pattern.compile(path + "/emails"); MappingPattern pattern2 = new MappingPattern(p2, "GET"); // WHEN boolean equals...
[FOCAL] @Override public boolean MappingPattern.equals(Object obj) [CLASS] class MappingPattern implements Serializable [METRICS] loc=14 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=2 [CALLS-EXTERNAL] this.method.equals/1, MappingPattern.getMethod/0, this.pattern.toString().equals/1, this.pattern.toString/0, othe...
/* static context [FOCAL] @Override public boolean MappingPattern.equals(Object obj) [PATH1] if(obj instanceof MappingPattern)=T -> if(this.method.equals(otherPattern.getMethod()) && this.pattern.toString().equals(otherPattern.getPattern().toString()))=T -> return true [PATH2] if(obj instanceof MappingPattern)=F -> ret...
/* static context [FOCAL] @Override public boolean MappingPattern.equals(Object obj) [PATH1] if(obj instanceof MappingPattern)=T -> if(this.method.equals(otherPattern.getMethod()) && this.pattern.toString().equals(otherPattern.getPattern().toString()))=T -> return true [PATH2] if(obj instanceof MappingPattern)=F -> ret...
true
ok
{"focal": {"class": "MappingPattern", "name": "equals", "signature": "boolean equals(Object obj)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "obj", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "MappingPattern", "kind": "class", "modifiers": "", "superclass": null, "i...
16709910_56
class HttpRequestHandler extends SimpleChannelUpstreamHandler { protected HttpResponse handleRegister(HttpRequest req) { HttpResponse response = null; try { ClientCredentials creds = auth.issueClientCredentials(req); ObjectMapper mapper = new ObjectMapper(); Stri...
// GIVEN HttpRequest req = mock(HttpRequest.class); AuthorizationServer auth = mock(AuthorizationServer.class); OAuthException ex = new OAuthException(Response.NAME_OR_SCOPE_OR_URI_IS_NULL, HttpResponseStatus.BAD_REQUEST); willThrow(ex).given(auth).issueClientCred...
[FOCAL] protected HttpResponse HttpRequestHandler.handleRegister(HttpRequest req) [CLASS] class HttpRequestHandler extends SimpleChannelUpstreamHandler [METRICS] loc=26 cc=6 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] void invokeExceptionHandler(Exception ex, HttpRequest request) [CALLS-EXTERNAL] a...
/* static context [FOCAL] protected HttpResponse HttpRequestHandler.handleRegister(HttpRequest req) [PATH1] try-body throws -> if(response == null)=T -> return response [PATH2] if(response == null)=F -> return response [INPUTS] branches=req | result=req [COLLABORATORS] field auth issueClientCredentials/1 [EXCEPTIONS] c...
/* static context [FOCAL] protected HttpResponse HttpRequestHandler.handleRegister(HttpRequest req) [PATH1] try-body throws -> if(response == null)=T -> return response [PATH2] if(response == null)=F -> return response [INPUTS] branches=req | result=req [COLLABORATORS] field auth issueClientCredentials/1 [EXCEPTIONS] c...
true
ok
{"focal": {"class": "HttpRequestHandler", "name": "handleRegister", "signature": "HttpResponse handleRegister(HttpRequest req)", "start_line": 3, "modifiers": "protected", "params": [{"name": "req", "type": "HttpRequest"}], "return_type": "HttpResponse"}, "class_info": {"name": "HttpRequestHandler", "kind": "class", "m...
16775240_20
class JmsMapMessage extends JmsMessage implements MapMessage { @Override public boolean itemExists(String name) throws JMSException { initializeReading(); return map.containsKey(name); } public JmsMapMessage(JmsMessageFacade facade); @Override public JmsMessage copy(); public...
JmsMapMessage mapMessage = factory.createMapMessage(); mapMessage.setString("exists", "test"); mapMessage = (JmsMapMessage) mapMessage.copy(); assertTrue(mapMessage.itemExists("exists")); assertFalse(mapMessage.itemExists("doesntExist")); } }
[FOCAL] @Override public boolean JmsMapMessage.itemExists(String name) [CLASS] class JmsMapMessage extends JmsMessage implements MapMessage [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] void initializeReading() [CALLS-EXTERNAL] map.containsKey/1 [EXCEPTIONS] declares JMSException...
/* static context [FOCAL] @Override public boolean JmsMapMessage.itemExists(String name) [INPUTS] branches=- | result=name [COLLABORATORS] field map containsKey/1 [EXCEPTIONS] declares JMSException [CALLS-INTERNAL] void initializeReading() [CALLS-EXTERNAL] map.containsKey/1 */
/* static context [FOCAL] @Override public boolean JmsMapMessage.itemExists(String name) [INPUTS] branches=- | result=name [COLLABORATORS] field map containsKey/1 [EXCEPTIONS] declares JMSException [CALLS-INTERNAL] void initializeReading() [CALLS-EXTERNAL] map.containsKey/1 */ class JmsMapMessage extends JmsMessage imp...
true
ok
{"focal": {"class": "JmsMapMessage", "name": "itemExists", "signature": "boolean itemExists(String name) throws JMSException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "name", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "JmsMapMessage", "kind": "class", "modifiers"...
16791473_0
class Person { public String getName() { int firstComma = name.indexOf(","); return WordUtils.capitalizeFully(name.substring(firstComma + 1).trim() + " " + name.substring(0, firstComma).trim()); } public Person(String name, String phone); public Person(String name, String phone, Stri...
assertEquals("Stephen R Adelman", person.getName()); } }
[FOCAL] public String Person.getName() [CLASS] class Person [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] name.indexOf/1, WordUtils.capitalizeFully/1, name.substring(firstComma + 1).trim/0, name.substring/1, name.substring(0, firstComma).trim/0, name.substring/2 [COLLABORATORS] f...
/* static context [FOCAL] public String Person.getName() [COLLABORATORS] field name indexOf/1,substring/1,substring/2 [CALLS-EXTERNAL] name.indexOf/1, WordUtils.capitalizeFully/1, name.substring(firstComma + 1).trim/0, name.substring/1, name.substring(0, firstComma).trim/0, name.substring/2 */
/* static context [FOCAL] public String Person.getName() [COLLABORATORS] field name indexOf/1,substring/1,substring/2 [CALLS-EXTERNAL] name.indexOf/1, WordUtils.capitalizeFully/1, name.substring(firstComma + 1).trim/0, name.substring/1, name.substring(0, firstComma).trim/0, name.substring/2 */ class Person { publi...
true
ok
{"focal": {"class": "Person", "name": "getName", "signature": "String getName()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "Person", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "person", "type": "Person", "mo...
16810766_33
class TransactionBroadcast { public ListenableFuture<Transaction> broadcast() { log.info("Waiting for {} peers required for broadcast ...", minConnections); ListenableFuture<PeerGroup> peerAvailabilityFuture = peerGroup.waitForPeers(minConnections); peerAvailabilityFuture.addListener(new En...
InboundMessageQueuer[] channels = { connectPeer(1), connectPeer(2), connectPeer(3), connectPeer(4) }; Transaction tx = new Transaction(params); TransactionBroadcast broadcast = new TransactionBroadcast(peerGroup, tx); ListenableFuture<Transaction> future = broadcast.broadcast(); ...
[FOCAL] public ListenableFuture<Transaction> TransactionBroadcast.broadcast() [CLASS] class TransactionBroadcast [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] log.info/2, peerGroup.waitForPeers/1, ListenableFuture<PeerGroup>.addListener/2 [NEW] EnoughAvailablePeers [COLLABORATORS...
/* static context [FOCAL] public ListenableFuture<Transaction> TransactionBroadcast.broadcast() [COLLABORATORS] field peerGroup waitForPeers/1 [NEW] EnoughAvailablePeers [CALLS-EXTERNAL] log.info/2, peerGroup.waitForPeers/1, ListenableFuture<PeerGroup>.addListener/2 */
/* static context [FOCAL] public ListenableFuture<Transaction> TransactionBroadcast.broadcast() [COLLABORATORS] field peerGroup waitForPeers/1 [NEW] EnoughAvailablePeers [CALLS-EXTERNAL] log.info/2, peerGroup.waitForPeers/1, ListenableFuture<PeerGroup>.addListener/2 */ class TransactionBroadcast { public Listenabl...
true
ok
{"focal": {"class": "TransactionBroadcast", "name": "broadcast", "signature": "ListenableFuture<Transaction> broadcast()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "ListenableFuture<Transaction>"}, "class_info": {"name": "TransactionBroadcast", "kind": "class", "modifiers": "", "superclass":...
16841282_37
class NetworkImageView extends ImageView { public void setImageUrl(String url, ImageLoader imageLoader) { mUrl = url; mImageLoader = imageLoader; // The URL has potentially changed. See if we need to load it. loadImageIfNecessary(false); } public NetworkImageView(Context c...
mNIV.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); mNIV.setImageUrl("http://foo", mMockImageLoader); assertEquals("http://foo", mMockImageLoader.lastRequestUrl); assertEquals(0, mMockImageLoader.lastMaxWidth); assertEquals(0, mMockImageL...
[FOCAL] public void NetworkImageView.setImageUrl(String url, ImageLoader imageLoader) [CLASS] class NetworkImageView extends ImageView [METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void loadImageIfNecessary(boolean isInLayoutPass) [DATAFLOW] imageLoader@param->L3; url@param->L2 [...
/* static context [FOCAL] public void NetworkImageView.setImageUrl(String url, ImageLoader imageLoader) [CALLS-INTERNAL] void loadImageIfNecessary(boolean isInLayoutPass) */
/* static context [FOCAL] public void NetworkImageView.setImageUrl(String url, ImageLoader imageLoader) [CALLS-INTERNAL] void loadImageIfNecessary(boolean isInLayoutPass) */ class NetworkImageView extends ImageView { public void setImageUrl(String url, ImageLoader imageLoader) { mUrl = url; mImageL...
true
ok
{"focal": {"class": "NetworkImageView", "name": "setImageUrl", "signature": "void setImageUrl(String url, ImageLoader imageLoader)", "start_line": 3, "modifiers": "public", "params": [{"name": "url", "type": "String"}, {"name": "imageLoader", "type": "ImageLoader"}], "return_type": "void"}, "class_info": {"name": "Netw...
16842086_1
class OcsInterfaceUtils extends InterfaceUtils { public Network selectManagementNetworkWhiteAndBlackOnly(Computer computer) { List<Network> possibleNetworks = new ArrayList<>(); for (Network network : computer.getNetworks()) { if (!network.getIPAddress().isEmpty()) { if ...
assertNotNull(helper.selectManagementNetworkWhiteAndBlackOnly(computerWhite)); assertEquals(IP_WHITE, helper.selectManagementNetworkWhiteAndBlackOnly(computerWhite).getIPAddress()); assertNull(helper.selectManagementNetworkWhiteAndBlackOnly(computerDefault)); assertNull(helper...
[FOCAL] public Network OcsInterfaceUtils.selectManagementNetworkWhiteAndBlackOnly(Computer computer) [CLASS] class OcsInterfaceUtils extends InterfaceUtils [METRICS] loc=33 cc=7 branches=5 loops=1 returns=4 throws=0 nesting=3 [CALLS-EXTERNAL] Computer.getNetworks/0, network.getIPAddress().isEmpty/0, Network.getIPAddres...
/* static context [FOCAL] public Network OcsInterfaceUtils.selectManagementNetworkWhiteAndBlackOnly(Computer computer) [PATH1] foreach(Network network : computer.getNetworks())=T -> if(!network.getIPAddress().isEmpty())=T -> if(isIpWhiteListed(network.getIPAddress()) && !isIpBlackListed(network.getIPAddress()))=T -> ex...
/* static context [FOCAL] public Network OcsInterfaceUtils.selectManagementNetworkWhiteAndBlackOnly(Computer computer) [PATH1] foreach(Network network : computer.getNetworks())=T -> if(!network.getIPAddress().isEmpty())=T -> if(isIpWhiteListed(network.getIPAddress()) && !isIpBlackListed(network.getIPAddress()))=T -> ex...
true
ok
{"focal": {"class": "OcsInterfaceUtils", "name": "selectManagementNetworkWhiteAndBlackOnly", "signature": "Network selectManagementNetworkWhiteAndBlackOnly(Computer computer)", "start_line": 3, "modifiers": "public", "params": [{"name": "computer", "type": "Computer"}], "return_type": "Network"}, "class_info": {"name":...
16842589_1
class EasyAdapterUtil { public static ItemViewHolder createViewHolder(View view, Class<? extends ItemViewHolder> itemViewHolderClass) { try { Constructor<? extends ItemViewHolder> constructor = itemViewHolderClass.getConstructor(View.class); return constructor.newInstance(view); ...
View view = new View(RuntimeEnvironment.application); RuntimeException exception = null; try { //Should throw a RuntimeException because the constructor is invalid EasyAdapterUtil.createViewHolder(view, InvalidItemViewHolder.class); } catch (RuntimeException e) { ...
[FOCAL] public static ItemViewHolder EasyAdapterUtil.createViewHolder(View view, Class<? extends ItemViewHolder> itemViewHolderClass) [CLASS] class EasyAdapterUtil [METRICS] loc=15 cc=5 branches=0 loops=0 returns=1 throws=4 nesting=1 [CALLS-EXTERNAL] Class<? extends ItemViewHolder>.getConstructor/1, Constructor<? exten...
/* static context [FOCAL] public static ItemViewHolder EasyAdapterUtil.createViewHolder(View view, Class<? extends ItemViewHolder> itemViewHolderClass) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException(e) [PATH2] return constructor.newInstance(view) [PATH3] try-bo...
/* static context [FOCAL] public static ItemViewHolder EasyAdapterUtil.createViewHolder(View view, Class<? extends ItemViewHolder> itemViewHolderClass) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException(e) [PATH2] return constructor.newInstance(view) [PATH3] try-bo...
true
ok
{"focal": {"class": "EasyAdapterUtil", "name": "createViewHolder", "signature": "ItemViewHolder createViewHolder(View view, Class<? extends ItemViewHolder> itemViewHolderClass)", "start_line": 3, "modifiers": "public static", "params": [{"name": "view", "type": "View"}, {"name": "itemViewHolderClass", "type": "Class<? ...
16858994_1
class MinutesChoices { public static int normalizeSeconds(int secondsPerAlarm) { return pickerChoiceToSeconds(secondsToPickerChoice(secondsPerAlarm)); } MinutesChoices(); static int secondsToMinutesPluralizationQuantity(int seconds); final void updateLocale(); static int pickerChoic...
assertThat("negative seconds", MinutesChoices.normalizeSeconds(-90), is(30)); assertThat("0 seconds", MinutesChoices.normalizeSeconds(0), is(30)); assertThat("just over 90 seconds", MinutesChoices.normalizeSeconds(91), is(90)); assertThat("almost 2 minutes", MinutesChoices.normalizeSecon...
[FOCAL] public static int MinutesChoices.normalizeSeconds(int secondsPerAlarm) [CLASS] class MinutesChoices [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] int pickerChoiceToSeconds(int choice); int secondsToPickerChoice(int secondsPerAlarm) [INPUTS] branches=- | result=secondsPerA...
/* static context [FOCAL] public static int MinutesChoices.normalizeSeconds(int secondsPerAlarm) [INPUTS] branches=- | result=secondsPerAlarm [CALLS-INTERNAL] int pickerChoiceToSeconds(int choice); int secondsToPickerChoice(int secondsPerAlarm) */
/* static context [FOCAL] public static int MinutesChoices.normalizeSeconds(int secondsPerAlarm) [INPUTS] branches=- | result=secondsPerAlarm [CALLS-INTERNAL] int pickerChoiceToSeconds(int choice); int secondsToPickerChoice(int secondsPerAlarm) */ class MinutesChoices { public static int normalizeSeconds(int secon...
true
ok
{"focal": {"class": "MinutesChoices", "name": "normalizeSeconds", "signature": "int normalizeSeconds(int secondsPerAlarm)", "start_line": 3, "modifiers": "public static", "params": [{"name": "secondsPerAlarm", "type": "int"}], "return_type": "int"}, "class_info": {"name": "MinutesChoices", "kind": "class", "modifiers":...
16863086_7
class IntPreference extends BasePreference { public void set(final int value) { mPreferences.edit().putInt(mKey, value).apply(); } public IntPreference(final SharedPreferences preferences, final String key); public IntPreference(final SharedPreferences preferences, final String key, int defa...
mPreference.set(mTestValue); assertTrue(mPreference.isSet()); } }
[FOCAL] public void IntPreference.set(int value) [CLASS] class IntPreference extends BasePreference [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] mPreferences.edit().putInt(mKey, value).apply/0, mPreferences.edit().putInt/2, mPreferences.edit/0 [COLLABORATORS] field mPreferences ...
/* static context [FOCAL] public void IntPreference.set(int value) [COLLABORATORS] field mPreferences edit/0 [CALLS-EXTERNAL] mPreferences.edit().putInt(mKey, value).apply/0, mPreferences.edit().putInt/2, mPreferences.edit/0 */
/* static context [FOCAL] public void IntPreference.set(int value) [COLLABORATORS] field mPreferences edit/0 [CALLS-EXTERNAL] mPreferences.edit().putInt(mKey, value).apply/0, mPreferences.edit().putInt/2, mPreferences.edit/0 */ class IntPreference extends BasePreference { public void set(final int value) { ...
true
ok
{"focal": {"class": "IntPreference", "name": "set", "signature": "void set(int value)", "start_line": 3, "modifiers": "public", "params": [{"name": "value", "type": "int"}], "return_type": "void"}, "class_info": {"name": "IntPreference", "kind": "class", "modifiers": "", "superclass": "BasePreference", "interfaces": nu...
16945152_20
class AbstractFileTransport extends AbstractTransport { synchronized File createMessageFile(String baseName) throws IOException { int suffix = -1; File file; do { suffix++; StringBuilder sb = new StringBuilder(baseName); if (suffix > 0) { ...
File f0 = transport.createMessageFile(BASE_NAME); File f1 = transport.createMessageFile(BASE_NAME); Assert.assertEquals("base-name.ext", f0.getName()); Assert.assertEquals("base-name-1.ext", f1.getName()); } }
[FOCAL] synchronized File AbstractFileTransport.createMessageFile(String baseName) [CLASS] class AbstractFileTransport extends AbstractTransport [METRICS] loc=17 cc=4 branches=2 loops=1 returns=1 throws=1 nesting=2 [CALLS-INTERNAL] String getFilenameExtension() [CALLS-EXTERNAL] sb.append('-').append/1, StringBuilder.ap...
/* static context [FOCAL] synchronized File AbstractFileTransport.createMessageFile(String baseName) [THROWS-WHEN] IOException when suffix > 0 && !file.exists() && ! file.createNewFile() [THROWS-WHEN] IOException when !(suffix > 0) && !file.exists() && ! file.createNewFile() [PATH1] if(suffix > 0)=T -> do_while(file.ex...
/* static context [FOCAL] synchronized File AbstractFileTransport.createMessageFile(String baseName) [THROWS-WHEN] IOException when suffix > 0 && !file.exists() && ! file.createNewFile() [THROWS-WHEN] IOException when !(suffix > 0) && !file.exists() && ! file.createNewFile() [PATH1] if(suffix > 0)=T -> do_while(file.ex...
true
ok
{"focal": {"class": "AbstractFileTransport", "name": "createMessageFile", "signature": "File createMessageFile(String baseName) throws IOException", "start_line": 3, "modifiers": "synchronized", "params": [{"name": "baseName", "type": "String"}], "return_type": "File"}, "class_info": {"name": "AbstractFileTransport", "...
16946884_14
class JavaFXGraphicsEnvironment implements GraphicsEnvironment<Canvas> { @Override public double getLineWidth(Canvas canvas) { return canvas.getGraphicsContext2D().getLineWidth(); } @Override public void arc(Canvas canvas, double centerX, double centerY, double startAngle, double radius, doubl...
double lw = 20; graphicsContext2D.setLineWidth(lw); double lineWidth = graphicsContext2D.getLineWidth(); assertEquals(lineWidth, lw); } }
[FOCAL] @Override public double JavaFXGraphicsEnvironment.getLineWidth(Canvas canvas) [CLASS] class JavaFXGraphicsEnvironment implements GraphicsEnvironment<Canvas> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] canvas.getGraphicsContext2D().getLineWidth/0, Canvas.getGraphicsConte...
/* static context [FOCAL] @Override public double JavaFXGraphicsEnvironment.getLineWidth(Canvas canvas) [INPUTS] branches=- | result=canvas [COLLABORATORS] param canvas:Canvas getGraphicsContext2D/0 [CALLS-EXTERNAL] canvas.getGraphicsContext2D().getLineWidth/0, Canvas.getGraphicsContext2D/0 */
/* static context [FOCAL] @Override public double JavaFXGraphicsEnvironment.getLineWidth(Canvas canvas) [INPUTS] branches=- | result=canvas [COLLABORATORS] param canvas:Canvas getGraphicsContext2D/0 [CALLS-EXTERNAL] canvas.getGraphicsContext2D().getLineWidth/0, Canvas.getGraphicsContext2D/0 */ class JavaFXGraphicsEnvir...
true
ok
{"focal": {"class": "JavaFXGraphicsEnvironment", "name": "getLineWidth", "signature": "double getLineWidth(Canvas canvas)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "canvas", "type": "Canvas"}], "return_type": "double"}, "class_info": {"name": "JavaFXGraphicsEnvironment", "kind": "class", "...
16970593_83
class AttributesReferToExistingAttributesValidator extends AbstractMonitoringValidator<MetricEntityTypeDescriptor> { @Override public <T> List<ConstraintViolation<T>> validate( MonitoringValidationContext context, MetricEntityTypeDescriptor entity, DescriptorPathImpl path) { Preconditions.che...
doReturn(ImmutableList.of("attr1", "attr2", "builtIn1", "builtIn2")) .when(entity).getMutableAttributeNames(); addEntity(entity); assertTrue(validator.validate(context, entity, root).isEmpty()); } }
[FOCAL] @Override public List<ConstraintViolation<T>> AttributesReferToExistingAttributesValidator.validate(MonitoringValidationContext context, MetricEntityTypeDescriptor entity, DescriptorPathImpl path) [CLASS] class AttributesReferToExistingAttributesValidator extends AbstractMonitoringValidator<MetricEntityTypeDesc...
/* static context [FOCAL] @Override public List<ConstraintViolation<T>> AttributesReferToExistingAttributesValidator.validate(MonitoringValidationContext context, MetricEntityTypeDescriptor entity, DescriptorPathImpl path) [COLLABORATORS] param entity:MetricEntityTypeDescriptor getImmutableAttributeNames/0,getMutableAt...
/* static context [FOCAL] @Override public List<ConstraintViolation<T>> AttributesReferToExistingAttributesValidator.validate(MonitoringValidationContext context, MetricEntityTypeDescriptor entity, DescriptorPathImpl path) [COLLABORATORS] param entity:MetricEntityTypeDescriptor getImmutableAttributeNames/0,getMutableAt...
true
ok
{"focal": {"class": "AttributesReferToExistingAttributesValidator", "name": "validate", "signature": "List<ConstraintViolation<T>> validate(MonitoringValidationContext context, MetricEntityTypeDescriptor entity, DescriptorPathImpl path)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "context", ...
16983824_3
class UrlConnectionClient implements Client { @Override public Response execute(Request request) throws IOException { HttpURLConnection connection = openConnection(request); prepareRequest(connection, request); Response response = readResponse(connection); return followRedirect...
given(connection.getURL()).willReturn(new URL(URL)); given(connection.getResponseCode()).willReturn(400); Map<String, List<String>> responseHeaderFields = new LinkedHashMap<String, List<String>>(); given(connection.getHeaderFields()).willReturn(responseHeaderFields, Collections.<String, ...
[FOCAL] @Override public Response UrlConnectionClient.execute(Request request) [CLASS] class UrlConnectionClient implements Client [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] HttpURLConnection openConnection(Request request); Response followRedirectsIfNecessary(Request original...
/* static context [FOCAL] @Override public Response UrlConnectionClient.execute(Request request) [INPUTS] branches=- | result=request [EXCEPTIONS] declares IOException [CALLS-INTERNAL] HttpURLConnection openConnection(Request request); Response followRedirectsIfNecessary(Request originalRequest, Response originalRespon...
/* static context [FOCAL] @Override public Response UrlConnectionClient.execute(Request request) [INPUTS] branches=- | result=request [EXCEPTIONS] declares IOException [CALLS-INTERNAL] HttpURLConnection openConnection(Request request); Response followRedirectsIfNecessary(Request originalRequest, Response originalRespon...
true
ok
{"focal": {"class": "UrlConnectionClient", "name": "execute", "signature": "Response execute(Request request) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "Request"}], "return_type": "Response"}, "class_info": {"name": "UrlConnectionClient", "kind": "clas...
17025957_31
class PojoSink extends NamedSink { @Override public void processRow(Row currentRow) { this.unmappedFields = new HashMap<>(); Object targetObject = convert(this.target, currentRow); if (currentRow.hasChildren() && this.childrenType != null) { mapChildren(targetObject, current...
CachingConsumer consumer = new CachingConsumer(); PojoSink sink = new PojoSink(DeveloperWithAnnotatedField.class, consumer, null); final String expectedName = "duke"; final int expectedAge = 42; Row programming = new Row(); programming.addColumn(-1, "name", expectedName...
[FOCAL] @Override public void PojoSink.processRow(Row currentRow) [CLASS] class PojoSink extends NamedSink [METRICS] loc=12 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] Object convert(Class pojoType, Row currentRow); void mapChildren(Object parent, List<Row> children) [CALLS-EXTERNAL] Row.hasCh...
/* static context [FOCAL] @Override public void PojoSink.processRow(Row currentRow) [PATH1] if(currentRow.hasChildren() && this.childrenType != null)=T -> if(!this.unmappedFields.isEmpty() && this.devNullConsumer != null)=T [PATH2] if(currentRow.hasChildren() && this.childrenType != null)=F -> if(!this.unmappedFields.i...
/* static context [FOCAL] @Override public void PojoSink.processRow(Row currentRow) [PATH1] if(currentRow.hasChildren() && this.childrenType != null)=T -> if(!this.unmappedFields.isEmpty() && this.devNullConsumer != null)=T [PATH2] if(currentRow.hasChildren() && this.childrenType != null)=F -> if(!this.unmappedFields.i...
true
ok
{"focal": {"class": "PojoSink", "name": "processRow", "signature": "void processRow(Row currentRow)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "currentRow", "type": "Row"}], "return_type": "void"}, "class_info": {"name": "PojoSink", "kind": "class", "modifiers": "", "superclass": "NamedSink...
17033876_0
class DatastoreSynonymCatalog extends AbstractReferenceData implements SynonymCatalog { @Override public String getMasterTerm(String term) { if (StringUtils.isNullOrEmpty(term)) { return null; } final Cache<String, String> cache = getMasterTermCache(); String resul...
assertEquals(null, _dataStoreBasedSynonymCatalog.getMasterTerm("region")); assertEquals("DNK", _dataStoreBasedSynonymCatalog.getMasterTerm("Denmark")); assertEquals("GBR", _dataStoreBasedSynonymCatalog.getMasterTerm("Great Britain")); assertEquals("DNK", _dataStoreBasedSynonymCatalog.getMasterTerm("DK")); } }
[FOCAL] @Override public String DatastoreSynonymCatalog.getMasterTerm(String term) [CLASS] class DatastoreSynonymCatalog extends AbstractReferenceData implements SynonymCatalog [METRICS] loc=69 cc=9 branches=7 loops=1 returns=2 throws=0 nesting=6 [CALLS-INTERNAL] Cache<String, String> getMasterTermCache(); Datastore ge...
/* static context [FOCAL] @Override public String DatastoreSynonymCatalog.getMasterTerm(String term) [PATH1] if(StringUtils.isNullOrEmpty(term))=F -> if(result == null)=T -> for(i < columns.length)=T -> if(column.getType().isNumber())=T -> if(numberValue != null)=T -> exit loop -> if(filterItems.isEmpty())=F -> if(data...
/* static context [FOCAL] @Override public String DatastoreSynonymCatalog.getMasterTerm(String term) [PATH1] if(StringUtils.isNullOrEmpty(term))=F -> if(result == null)=T -> for(i < columns.length)=T -> if(column.getType().isNumber())=T -> if(numberValue != null)=T -> exit loop -> if(filterItems.isEmpty())=F -> if(data...
true
ok
{"focal": {"class": "DatastoreSynonymCatalog", "name": "getMasterTerm", "signature": "String getMasterTerm(String term)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "term", "type": "String"}], "return_type": "String"}, "class_info": {"name": "DatastoreSynonymCatalog", "kind": "class", "modifi...
17034809_78
class VersionComparator implements Comparator<String> { public boolean isComparable(String str) { return str.matches("\\d+\\.\\d+(\\.\\d+)?(\\-[A-Z0-9]+)?"); } @Override public int compare(final String o1, final String o2); } class VersionComparatorTest { @Test public void testIsCompara...
final VersionComparator comparator = new VersionComparator(); assertTrue(comparator.isComparable("1.2.3")); assertTrue(comparator.isComparable("423423.43252.3432")); assertTrue(comparator.isComparable("1.2")); assertTrue(comparator.isComparable("1.2.3-FOO")); assertTrue(c...
[FOCAL] public boolean VersionComparator.isComparable(String str) [CLASS] class VersionComparator implements Comparator<String> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] String.matches/1 [INPUTS] branches=- | result=str [DATAFLOW] str@param->L2 [CLASS-MEMBERS] int compare(Str...
/* static context [FOCAL] public boolean VersionComparator.isComparable(String str) [INPUTS] branches=- | result=str [CALLS-EXTERNAL] String.matches/1 */
/* static context [FOCAL] public boolean VersionComparator.isComparable(String str) [INPUTS] branches=- | result=str [CALLS-EXTERNAL] String.matches/1 */ class VersionComparator implements Comparator<String> { public boolean isComparable(String str) { return str.matches("\\d+\\.\\d+(\\.\\d+)?(\\-[A-Z0-9]+)...
true
ok
{"focal": {"class": "VersionComparator", "name": "isComparable", "signature": "boolean isComparable(String str)", "start_line": 3, "modifiers": "public", "params": [{"name": "str", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "VersionComparator", "kind": "class", "modifiers": "", "superclass": ...
17090302_8
class TuneService { public List<Tune> getAll() { log.debug("Retrieve all items"); return tunesRepository.getTunes(); } public List<Tune> getByGenre(String genre); public List<Tune> getByArtist(String artist); public void store(Tune tune); public void remove(Tune tune); @InjectMocks private TuneService tu...
List<Tune> all = tuneService.getAll(); Assertions.assertThat(all).hasSize(1); Mockito.verify(tunesRepository).getTunes(); } }
[FOCAL] public List<Tune> TuneService.getAll() [CLASS] class TuneService [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Logger.debug/1, TunesRepository.getTunes/0 [FIELDS] read=log:Logger, tunesRepository:TunesRepository [INPUTS] branches=- | result=tunesRepository [COLLABORATORS]...
/* static context [FOCAL] public List<Tune> TuneService.getAll() [INPUTS] branches=- | result=tunesRepository [COLLABORATORS] field tunesRepository:TunesRepository getTunes/0 [FIELDS] read=log:Logger, tunesRepository:TunesRepository [CALLS-EXTERNAL] Logger.debug/1, TunesRepository.getTunes/0 */
/* static context [FOCAL] public List<Tune> TuneService.getAll() [INPUTS] branches=- | result=tunesRepository [COLLABORATORS] field tunesRepository:TunesRepository getTunes/0 [FIELDS] read=log:Logger, tunesRepository:TunesRepository [CALLS-EXTERNAL] Logger.debug/1, TunesRepository.getTunes/0 */ class TuneService { pu...
true
ok
{"focal": {"class": "TuneService", "name": "getAll", "signature": "List<Tune> getAll()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<Tune>"}, "class_info": {"name": "TuneService", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "tuneService", ...
17132838_2
class RotatingFileWriter implements Flushable, Closeable { private boolean rotate() throws IOException { // rename the current file File oldFile = new File(mLogFile.toString() + ".old"); File newFile = new File(mLogFile.toString()); if (newFile.renameTo(oldFile)) { Buffe...
int lineSepLen = System.getProperty("line.separator").length(); File f = File.createTempFile("log", null); RotatingFileWriter w = new RotatingFileWriter(f, 3000, 2); w.println(StringUtils.randomString(512)); w.println(StringUtils.randomString(512)); w.println(StringUtils....
[FOCAL] private boolean RotatingFileWriter.rotate() [CLASS] class RotatingFileWriter implements Flushable, Closeable [METRICS] loc=37 cc=5 branches=2 loops=1 returns=2 throws=0 nesting=4 [CALLS-EXTERNAL] mLogFile.toString/0, File.renameTo/1, BufferedReader.readLine/0, FileWriter.write/1, DataUtils.close/1, File.delete/...
/* static context [FOCAL] private boolean RotatingFileWriter.rotate() [PATH1] if(newFile.renameTo(oldFile))=T -> while((line = oldLog.readLine()) != null)=T -> if(lineCount > mDeleteOld)=T -> exit loop -> return true [PATH2] if(newFile.renameTo(oldFile))=F -> return mLogFile.delete() [PATH3] if(newFile.renameTo(oldFile...
/* static context [FOCAL] private boolean RotatingFileWriter.rotate() [PATH1] if(newFile.renameTo(oldFile))=T -> while((line = oldLog.readLine()) != null)=T -> if(lineCount > mDeleteOld)=T -> exit loop -> return true [PATH2] if(newFile.renameTo(oldFile))=F -> return mLogFile.delete() [PATH3] if(newFile.renameTo(oldFile...
true
ok
{"focal": {"class": "RotatingFileWriter", "name": "rotate", "signature": "boolean rotate() throws IOException", "start_line": 3, "modifiers": "private", "params": [], "return_type": "boolean"}, "class_info": {"name": "RotatingFileWriter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Flushable, C...
17169550_117
class IssueFormatter implements Formatter { public String getSummaryData(TestSummary summary) { if (summary.hasFailed()) { StringBuffer sb = new StringBuffer("\n\n"); sb.append("Script: ").append(summary.getScriptName()); sb.append("\nFailures: ").append(summary.getFailures()); sb.append(...
String expected = "\n\nScript: test\nFailures: 1\nErrors: 0"; assertEquals(expected, formatter.getSummaryData(ReportUtil.getTestSummary())); } }
[FOCAL] public String IssueFormatter.getSummaryData(TestSummary summary) [CLASS] class IssueFormatter implements Formatter [METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] TestSummary.hasFailed/0, sb.append("Script: ").append/1, StringBuffer.append/1, TestSummary.getScriptName/0, s...
/* static context [FOCAL] public String IssueFormatter.getSummaryData(TestSummary summary) [PATH1] if(summary.hasFailed())=T -> return sb.toString() [PATH2] if(summary.hasFailed())=F -> return "" [INPUTS] branches=summary | result=- [COLLABORATORS] param summary:TestSummary hasFailed/0,getScriptName/0,getFailures/0,get...
/* static context [FOCAL] public String IssueFormatter.getSummaryData(TestSummary summary) [PATH1] if(summary.hasFailed())=T -> return sb.toString() [PATH2] if(summary.hasFailed())=F -> return "" [INPUTS] branches=summary | result=- [COLLABORATORS] param summary:TestSummary hasFailed/0,getScriptName/0,getFailures/0,get...
true
ok
{"focal": {"class": "IssueFormatter", "name": "getSummaryData", "signature": "String getSummaryData(TestSummary summary)", "start_line": 3, "modifiers": "public", "params": [{"name": "summary", "type": "TestSummary"}], "return_type": "String"}, "class_info": {"name": "IssueFormatter", "kind": "class", "modifiers": "", ...
17182007_35
class EnumUtil { static public Field getEnumField(PMMLObject object, Enum<?> value){ Class<?> clazz = object.getClass(); while(clazz != null){ Field[] fields = clazz.getDeclaredFields(); for(Field field : fields){ if((field.getType()).equals(value.getClass())){ return field; } } claz...
DataField dataField = new DataField(); assertEquals(PMMLAttributes.DATAFIELD_CYCLIC, EnumUtil.getEnumField(dataField, DataField.Cyclic.ZERO)); } }
[FOCAL] static public Field EnumUtil.getEnumField(PMMLObject object, Enum<?> value) [CLASS] class EnumUtil [METRICS] loc=19 cc=4 branches=1 loops=2 returns=1 throws=1 nesting=3 [CALLS-EXTERNAL] PMMLObject.getClass/0, Class<?>.getDeclaredFields/0, (field.getType()).equals/1, Field.getType/0, Enum<?>.getClass/0, Class<?>...
/* static context [FOCAL] static public Field EnumUtil.getEnumField(PMMLObject object, Enum<?> value) [THROWS-WHEN] IllegalArgumentException when clazz != null && foreach(Field field : fields)=T && !((field.getType()).equals(value.getClass())) [THROWS-WHEN] IllegalArgumentException when clazz != null && foreach(Field f...
/* static context [FOCAL] static public Field EnumUtil.getEnumField(PMMLObject object, Enum<?> value) [THROWS-WHEN] IllegalArgumentException when clazz != null && foreach(Field field : fields)=T && !((field.getType()).equals(value.getClass())) [THROWS-WHEN] IllegalArgumentException when clazz != null && foreach(Field f...
true
ok
{"focal": {"class": "EnumUtil", "name": "getEnumField", "signature": "Field getEnumField(PMMLObject object, Enum<?> value)", "start_line": 3, "modifiers": "static public", "params": [{"name": "object", "type": "PMMLObject"}, {"name": "value", "type": "Enum<?>"}], "return_type": "Field"}, "class_info": {"name": "EnumUti...
17194860_2
class CORSFilter extends BaseAlwaysPostRequestFilter { @Override protected void doFilter(HttpServletRequest request, HttpServletResponse response) { if(corsConfiguration.isEnabled()) { response.addHeader("Access-Control-Allow-Origin", corsConfiguration.getOrigin()); response.addHeader("Ac...
when(corsConfiguration.isEnabled()).thenReturn(false); corsFilter.doFilter(null, response); verify(response, never()).addHeader(anyString(), anyString()); } }
[FOCAL] @Override protected void CORSFilter.doFilter(HttpServletRequest request, HttpServletResponse response) [CLASS] class CORSFilter extends BaseAlwaysPostRequestFilter [METRICS] loc=10 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] CORSConfiguration.isEnabled/0, HttpServletResponse.addHeader/...
/* static context [FOCAL] @Override protected void CORSFilter.doFilter(HttpServletRequest request, HttpServletResponse response) [PATH1] if(corsConfiguration.isEnabled())=T [PATH2] if(corsConfiguration.isEnabled())=F [INPUTS] branches=corsConfiguration | result=- | unused=request [COLLABORATORS] field corsConfiguration...
/* static context [FOCAL] @Override protected void CORSFilter.doFilter(HttpServletRequest request, HttpServletResponse response) [PATH1] if(corsConfiguration.isEnabled())=T [PATH2] if(corsConfiguration.isEnabled())=F [INPUTS] branches=corsConfiguration | result=- | unused=request [COLLABORATORS] field corsConfiguration...
true
ok
{"focal": {"class": "CORSFilter", "name": "doFilter", "signature": "void doFilter(HttpServletRequest request, HttpServletResponse response)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "request", "type": "HttpServletRequest"}, {"name": "response", "type": "HttpServletResponse"}], "return_t...
17224370_806
class GeneralAdminInp extends AbstractIRODSPackingInstruction { public static GeneralAdminInp instanceForAddUser(final User user) throws JargonException { if (user == null) { throw new JargonException("null user"); } if (user.getName().isEmpty()) { throw new JargonException("blank user name"); } if...
User user = new User(); user.setName("test"); user.setUserDN("dn"); user.setUserType(UserTypeEnum.RODS_USER); GeneralAdminInp pi = GeneralAdminInp.instanceForAddUser(user); Assert.assertEquals("incorrect api type", GeneralAdminInp.GEN_ADMIN_INP_API_NBR, pi.getApiNumber()); } }
[FOCAL] public static GeneralAdminInp GeneralAdminInp.instanceForAddUser(User user) [CLASS] class GeneralAdminInp extends AbstractIRODSPackingInstruction [METRICS] loc=17 cc=4 branches=3 loops=0 returns=1 throws=3 nesting=1 [CALLS-EXTERNAL] user.getName().isEmpty/0, User.getName/0, User.getUserType/0, user.getUserType(...
/* static context [FOCAL] public static GeneralAdminInp GeneralAdminInp.instanceForAddUser(User user) [THROWS-WHEN] JargonException when user == null [THROWS-WHEN] JargonException when !(user == null) && user.getName().isEmpty() [THROWS-WHEN] JargonException when !(user == null) && !(user.getName().isEmpty()) && user.g...
/* static context [FOCAL] public static GeneralAdminInp GeneralAdminInp.instanceForAddUser(User user) [THROWS-WHEN] JargonException when user == null [THROWS-WHEN] JargonException when !(user == null) && user.getName().isEmpty() [THROWS-WHEN] JargonException when !(user == null) && !(user.getName().isEmpty()) && user.g...
true
ok
{"focal": {"class": "GeneralAdminInp", "name": "instanceForAddUser", "signature": "GeneralAdminInp instanceForAddUser(User user) throws JargonException", "start_line": 3, "modifiers": "public static", "params": [{"name": "user", "type": "User"}], "return_type": "GeneralAdminInp"}, "class_info": {"name": "GeneralAdminIn...
17224385_23
class ConfigurationServiceImpl extends AbstractConveyorComponentService implements ConfigurationService { @Override public List<ConfigurationProperty> listConfigurationProperties() throws ConveyorExecutionException { log.info("listConfigurationProperties()"); try { return configurationPropertyDAO.findAll()...
String testKey1 = "testAddConfigurationProperty1"; String testKey2 = "testAddConfigurationProperty2"; String testValue = "testAddConfigurationPropertyValue"; ConfigurationProperty configProperty = new ConfigurationProperty(); configProperty.setPropertyKey(testKey1); configProperty.setPropertyValue(testValue...
[FOCAL] @Override public List<ConfigurationProperty> ConfigurationServiceImpl.listConfigurationProperties() [CLASS] class ConfigurationServiceImpl extends AbstractConveyorComponentService implements ConfigurationService [METRICS] loc=11 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] log.info/1, c...
/* static context [FOCAL] @Override public List<ConfigurationProperty> ConfigurationServiceImpl.listConfigurationProperties() [THROWS-WHEN] ConveyorExecutionException when try-body throws [PATH1] try-body throws -> throw new ConveyorExecutionException(e) [PATH2] return configurationPropertyDAO.findAll() [COLLABORATORS]...
/* static context [FOCAL] @Override public List<ConfigurationProperty> ConfigurationServiceImpl.listConfigurationProperties() [THROWS-WHEN] ConveyorExecutionException when try-body throws [PATH1] try-body throws -> throw new ConveyorExecutionException(e) [PATH2] return configurationPropertyDAO.findAll() [COLLABORATORS]...
true
ok
{"focal": {"class": "ConfigurationServiceImpl", "name": "listConfigurationProperties", "signature": "List<ConfigurationProperty> listConfigurationProperties() throws ConveyorExecutionException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "List<ConfigurationProperty>"}, "class_info": ...
17250332_4
class PatternRefMatcher implements RefMatcher { @Override @SuppressWarnings("SimplifiableIfStatement") public Result match(Ref ref, Ref contextRef) { Node propertyPattern = pattern.property(); Pattern parentPattern = pattern.parent(); if (parentPattern == null) { // th...
RefMatcher m = createMatcher(".(sub1)"); Assert.assertFalse(matches(m, r1, r12)); Assert.assertFalse(matches(m, r2, r12)); Assert.assertFalse(matches(m, r11, r12)); Assert.assertFalse(matches(m, r12, r12)); Assert.assertFalse(matches(m, r21, r12)); Assert....
[FOCAL] @Override @SuppressWarnings("SimplifiableIfStatement") public Result PatternRefMatcher.match(Ref ref, Ref contextRef) [CLASS] class PatternRefMatcher implements RefMatcher [METRICS] loc=37 cc=6 branches=5 loops=0 returns=6 throws=0 nesting=1 [CALLS-INTERNAL] RefMatcher withPattern(Pattern pattern); Result creat...
/* static context [FOCAL] @Override @SuppressWarnings("SimplifiableIfStatement") public Result PatternRefMatcher.match(Ref ref, Ref contextRef) [PATH1] if(parentPattern == null)=F -> if(!matchRefWithNonRootPattern(ref, propertyPattern, contextRef))=F -> if(ref.isRoot())=F -> if(parentMatchResult.isMatch())=F -> if(prop...
/* static context [FOCAL] @Override @SuppressWarnings("SimplifiableIfStatement") public Result PatternRefMatcher.match(Ref ref, Ref contextRef) [PATH1] if(parentPattern == null)=F -> if(!matchRefWithNonRootPattern(ref, propertyPattern, contextRef))=F -> if(ref.isRoot())=F -> if(parentMatchResult.isMatch())=F -> if(prop...
true
ok
{"focal": {"class": "PatternRefMatcher", "name": "match", "signature": "Result match(Ref ref, Ref contextRef)", "start_line": 3, "modifiers": "@Override @SuppressWarnings(\"SimplifiableIfStatement\") public", "params": [{"name": "ref", "type": "Ref"}, {"name": "contextRef", "type": "Ref"}], "return_type": "Result"}, "c...
17270540_24
class RaindropConverter { String convert(int number) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); } private RaindropConverter raindropConverter; } class RaindropConverterTest { private RaindropConverter raindropConverter; @Ignor...
assertEquals("Pling", raindropConverter.convert(3)); } }
[FOCAL] String RaindropConverter.convert(int number) [CLASS] class RaindropConverter [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=1 nesting=0 [NEW] UnsupportedOperationException [EXCEPTIONS] throws UnsupportedOperationException [THROWS-WHEN] UnsupportedOperationException when always [INPUTS] branches=- | re...
/* static context [FOCAL] String RaindropConverter.convert(int number) [THROWS-WHEN] UnsupportedOperationException when always [INPUTS] branches=- | result=- | unused=number [EXCEPTIONS] throws UnsupportedOperationException [NEW] UnsupportedOperationException */
/* static context [FOCAL] String RaindropConverter.convert(int number) [THROWS-WHEN] UnsupportedOperationException when always [INPUTS] branches=- | result=- | unused=number [EXCEPTIONS] throws UnsupportedOperationException [NEW] UnsupportedOperationException */ class RaindropConverter { String convert(int number)...
true
ok
{"focal": {"class": "RaindropConverter", "name": "convert", "signature": "String convert(int number)", "start_line": 3, "modifiers": "", "params": [{"name": "number", "type": "int"}], "return_type": "String"}, "class_info": {"name": "RaindropConverter", "kind": "class", "modifiers": "", "superclass": null, "interfaces"...
17273013_16
class EventsStatusChecker { public CalculationBounds autoCalcAndSetDatesBounds(Date startDate, Date endDate) throws InvalidAlgorithmParameterException { endDateToLastEventConsistencyCheck(endDate); if (currentTunedConfEnd.equals(DateFactory.dateAtZero())) {//No previous calculation ...
simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); Date previousStart = simpleDateFormat.parse("2009-12-21"); Date previousEnd = simpleDateFormat.parse("2015-12-20"); EasyMock.expect(tunedConf.getLastCalculationStart()).andReturn(previousStart); EasyMock.ex...
[FOCAL] public CalculationBounds EventsStatusChecker.autoCalcAndSetDatesBounds(Date startDate, Date endDate) [CLASS] class EventsStatusChecker [METRICS] loc=51 cc=6 branches=5 loops=0 returns=5 throws=1 nesting=1 [CALLS-INTERNAL] void endDateToLastEventConsistencyCheck(Date endDate) [CALLS-EXTERNAL] currentTunedConfEnd...
/* static context [FOCAL] public CalculationBounds EventsStatusChecker.autoCalcAndSetDatesBounds(Date startDate, Date endDate) [THROWS-WHEN] RuntimeException when !(currentTunedConfEnd.equals(DateFactory.dateAtZero())) && !((startDate.compareTo(currentTunedConfEnd) > 0 || endDate.compareTo(currentTunedConfStart) < 0 ||...
/* static context [FOCAL] public CalculationBounds EventsStatusChecker.autoCalcAndSetDatesBounds(Date startDate, Date endDate) [THROWS-WHEN] RuntimeException when !(currentTunedConfEnd.equals(DateFactory.dateAtZero())) && !((startDate.compareTo(currentTunedConfEnd) > 0 || endDate.compareTo(currentTunedConfStart) < 0 ||...
true
ok
{"focal": {"class": "EventsStatusChecker", "name": "autoCalcAndSetDatesBounds", "signature": "CalculationBounds autoCalcAndSetDatesBounds(Date startDate, Date endDate) throws InvalidAlgorithmParameterException", "start_line": 3, "modifiers": "public", "params": [{"name": "startDate", "type": "Date"}, {"name": "endDate"...
17278009_94
class TemplatedComponent extends BaseComponent<ResourceComponent<?>> { @Override public Configuration loadResourceConfiguration() throws Exception { ConfigurationDefinition configDef = context.getResourceType().getResourceConfigurationDefinition(); if (configDef.getDefaultTemplate().getConfigu...
@Test public void loadResourceConfigurationWithType() throws Exception { //tell the method story as it happens: mock or create dependencies and configure //those dependencies to get the method under test to completion. ResourceContext mockResourceContext = mock(ResourceContext.class); ...
[FOCAL] @Override public Configuration TemplatedComponent.loadResourceConfiguration() [CLASS] class TemplatedComponent extends BaseComponent<ResourceComponent<?>> [METRICS] loc=34 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=2 [CALLS-EXTERNAL] context.getResourceType().getResourceConfigurationDefinition/0, contex...
/* static context [FOCAL] @Override public Configuration TemplatedComponent.loadResourceConfiguration() [PATH1] if(configDef.getDefaultTemplate().getConfiguration().get(TYPE_CONFIGURATION) != null)=F -> if(configDef.getDefaultTemplate().getConfiguration().get(NAME_CONFIGURATION) != null)=T -> return configuration [PATH...
/* static context [FOCAL] @Override public Configuration TemplatedComponent.loadResourceConfiguration() [PATH1] if(configDef.getDefaultTemplate().getConfiguration().get(TYPE_CONFIGURATION) != null)=F -> if(configDef.getDefaultTemplate().getConfiguration().get(NAME_CONFIGURATION) != null)=T -> return configuration [PATH...
true
ok
{"focal": {"class": "TemplatedComponent", "name": "loadResourceConfiguration", "signature": "Configuration loadResourceConfiguration() throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Configuration"}, "class_info": {"name": "TemplatedComponent", "kind": "class", "modifi...
17288475_46
class RendererBuilder { int getViewTypeCount() { return prototypes.size(); } public RendererBuilder(); public RendererBuilder(Renderer<T> renderer); public RendererBuilder(Collection<? extends Renderer<? extends T>> prototypes); public final List<Renderer<? extends T>> getPrototypes(); public fi...
assertEquals(prototypes.size(), rendererBuilder.getViewTypeCount()); } }
[FOCAL] int RendererBuilder.getViewTypeCount() [CLASS] class RendererBuilder [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] List<Renderer<Object>>.size/0 [FIELDS] read=prototypes:List<Renderer<Object>> [INPUTS] branches=- | result=prototypes [COLLABORATORS] field prototypes:List<R...
/* static context [FOCAL] int RendererBuilder.getViewTypeCount() [INPUTS] branches=- | result=prototypes [COLLABORATORS] field prototypes:List<Renderer<Object>> size/0 [FIELDS] read=prototypes:List<Renderer<Object>> [CALLS-EXTERNAL] List<Renderer<Object>>.size/0 */
/* static context [FOCAL] int RendererBuilder.getViewTypeCount() [INPUTS] branches=- | result=prototypes [COLLABORATORS] field prototypes:List<Renderer<Object>> size/0 [FIELDS] read=prototypes:List<Renderer<Object>> [CALLS-EXTERNAL] List<Renderer<Object>>.size/0 */ class RendererBuilder { int getViewTypeCount() { ...
true
ok
{"focal": {"class": "RendererBuilder", "name": "getViewTypeCount", "signature": "int getViewTypeCount()", "start_line": 3, "modifiers": "", "params": [], "return_type": "int"}, "class_info": {"name": "RendererBuilder", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "render...
17310686_358
class PartiallyRepeatableHttpEntity extends HttpEntityWrapper { @Override public InputStream getContent() throws IOException { // If the wrapped stream is repeatable return it directly. if( replayBuffer == null ) { return wrappedEntity.getContent(); // Else if the buffer has overflowed } else...
String data = "0123456789"; BasicHttpEntity basic; PartiallyRepeatableHttpEntity replay; InputStream stream1, stream2; String text; basic = new BasicHttpEntity(); basic.setContent( new ByteArrayInputStream( data.getBytes( StandardCharsets.UTF_8 ) ) ); replay = new PartiallyRepeatableHtt...
[FOCAL] @Override public InputStream PartiallyRepeatableHttpEntity.getContent() [CLASS] class PartiallyRepeatableHttpEntity extends HttpEntityWrapper [METRICS] loc=15 cc=4 branches=3 loops=0 returns=2 throws=1 nesting=3 [CALLS-EXTERNAL] wrappedEntity.getContent/0 [NEW] IOException, ReplayStream [EXCEPTIONS] declares IO...
/* static context [FOCAL] @Override public InputStream PartiallyRepeatableHttpEntity.getContent() [THROWS-WHEN] IOException when !(replayBuffer == null) && finalStream != null [PATH1] if(replayBuffer == null)=F -> if(finalStream != null)=F -> if(wrappedStream == null)=T -> return new ReplayStream() [PATH2] if(replayBuf...
/* static context [FOCAL] @Override public InputStream PartiallyRepeatableHttpEntity.getContent() [THROWS-WHEN] IOException when !(replayBuffer == null) && finalStream != null [PATH1] if(replayBuffer == null)=F -> if(finalStream != null)=F -> if(wrappedStream == null)=T -> return new ReplayStream() [PATH2] if(replayBuf...
true
ok
{"focal": {"class": "PartiallyRepeatableHttpEntity", "name": "getContent", "signature": "InputStream getContent() throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "InputStream"}, "class_info": {"name": "PartiallyRepeatableHttpEntity", "kind": "class", "modifiers": "", ...
17342981_0
class StringUtils { public static String reverse(String text) { if (text == null) { return null; } return new StringBuilder(text).reverse().toString(); } } class StringUtilsTest { @Test public void testReverseNull() throws Exception {
assertNull(reverse(null)); } }
[FOCAL] public static String StringUtils.reverse(String text) [CLASS] class StringUtils [METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] new StringBuilder(text).reverse().toString/0, new StringBuilder(text).reverse/0 [NEW] StringBuilder [PATH1] if(text == null)=T -> return null [PAT...
/* static context [FOCAL] public static String StringUtils.reverse(String text) [PATH1] if(text == null)=T -> return null [PATH2] if(text == null)=F -> return new StringBuilder(text).reverse().toString() [INPUTS] branches=text | result=text [NEW] StringBuilder [CALLS-EXTERNAL] new StringBuilder(text).reverse().toString...
/* static context [FOCAL] public static String StringUtils.reverse(String text) [PATH1] if(text == null)=T -> return null [PATH2] if(text == null)=F -> return new StringBuilder(text).reverse().toString() [INPUTS] branches=text | result=text [NEW] StringBuilder [CALLS-EXTERNAL] new StringBuilder(text).reverse().toString...
true
ok
{"focal": {"class": "StringUtils", "name": "reverse", "signature": "String reverse(String text)", "start_line": 3, "modifiers": "public static", "params": [{"name": "text", "type": "String"}], "return_type": "String"}, "class_info": {"name": "StringUtils", "kind": "class", "modifiers": "", "superclass": null, "interfac...
17363232_37
class NMEAParser extends NMEATalkerIds implements ParserInfo, ChecksumProvider { public <I> void parse(I input, NMEAObserver data, AISObserver aisData) throws IOException { parse(input, true, null, data, aisData); } public NMEAParser(); @Rule("c letter c decimal c letter c 'PTCH'") prote...
try { String[] nmeas = new String[] { "$GPBWC,081837,,,,,,T,,M,,N,*13\r\n", "$GPBWC,220516,5130.02,N,00046.34,W,213.8,T,218.0,M,0004.6,N,EGLM*21\r\n", "$GPBWC,010003,1248.4128,S,03827.6978,W,338.4,T,1.5,M,0.314,N,BA01,A*61\r\n" }; ...
[FOCAL] public void NMEAParser.parse(I input, NMEAObserver data, AISObserver aisData) [CLASS] class NMEAParser extends NMEATalkerIds implements ParserInfo, ChecksumProvider [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void parse(I input, boolean liveClock, Supplier origin, NMEAO...
class NMEAParser extends NMEATalkerIds implements ParserInfo, ChecksumProvider { public <I> void parse(I input, NMEAObserver data, AISObserver aisData) throws IOException { parse(input, true, null, data, aisData); } public NMEAParser(); @Rule("c letter c decimal c letter c 'PTCH'") prote...
false
ok
{"focal": {"class": "NMEAParser", "name": "parse", "signature": "void parse(I input, NMEAObserver data, AISObserver aisData) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "input", "type": "I"}, {"name": "data", "type": "NMEAObserver"}, {"name": "aisData", "type": "AISObserver"}], "ret...
17403485_0
class JsonObjectArrayWrapper extends TypedJsonArray<T> { @Override public <O extends JsonElementWrapper> O wrap(JsonArray jsonElement) { throw new IllegalStateException("cannot wrap Typed Element with empty type"); } public JsonObjectArrayWrapper(); public O wrap(JsonArray jsonArray, Cla...
try { arrayWrapper.wrap(jar); fail("Should not wrap not typed Json"); } catch (IllegalStateException ex) { assertThat(ex.getMessage()) .isEqualTo("cannot wrap Typed Element with empty type"); } } }
[FOCAL] @Override public O JsonObjectArrayWrapper.wrap(JsonArray jsonElement) [CLASS] class JsonObjectArrayWrapper extends TypedJsonArray<T> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=1 nesting=0 [NEW] IllegalStateException [EXCEPTIONS] throws IllegalStateException [THROWS-WHEN] IllegalStateException when...
/* static context [FOCAL] @Override public O JsonObjectArrayWrapper.wrap(JsonArray jsonElement) [THROWS-WHEN] IllegalStateException when always [INPUTS] branches=- | result=- | unused=jsonElement [EXCEPTIONS] throws IllegalStateException [NEW] IllegalStateException */
/* static context [FOCAL] @Override public O JsonObjectArrayWrapper.wrap(JsonArray jsonElement) [THROWS-WHEN] IllegalStateException when always [INPUTS] branches=- | result=- | unused=jsonElement [EXCEPTIONS] throws IllegalStateException [NEW] IllegalStateException */ class JsonObjectArrayWrapper extends TypedJsonArray...
true
ok
{"focal": {"class": "JsonObjectArrayWrapper", "name": "wrap", "signature": "O wrap(JsonArray jsonElement)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "jsonElement", "type": "JsonArray"}], "return_type": "O"}, "class_info": {"name": "JsonObjectArrayWrapper", "kind": "class", "modifiers": "", ...
17404938_337
class SqlParser { public SqlNode parse() { outer: for (; ; ) { tokenType = tokenizer.next(); token = tokenizer.getToken(); switch (tokenType) { case WHITESPACE: { parseWhitespace(); break; } case WORD: case QUOTE: ...
ExpressionEvaluator evaluator = new ExpressionEvaluator(); ArrayList<String> list = new ArrayList<>(); list.add("aaa"); list.add("bbb"); list.add("ccc"); evaluator.add("names", new Value(List.class, list)); String testSql = "select * from aaa where /*%for n : names*/name = /*n*/'a' /...
[FOCAL] public SqlNode SqlParser.parse() [CLASS] class SqlParser [METRICS] loc=168 cc=38 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] void parseBindVariableBlockComment(); void parseClosedParens(); void parseComment(); void parseEOL(); void parseElseBlockComment(); void parseElseifBlockComment(); vo...
/* static context [FOCAL] public SqlNode SqlParser.parse() [PATH1] for(true)=T -> switch(tokenType)=case EOF -> return rootNode [PATH2] for(true)=T -> switch(tokenType)=case DELIMITER -> return rootNode [COLLABORATORS] field tokenizer next/0,getToken/0 [CALLS-EXTERNAL] tokenizer.next/0, tokenizer.getToken/0 */
/* static context [FOCAL] public SqlNode SqlParser.parse() [PATH1] for(true)=T -> switch(tokenType)=case EOF -> return rootNode [PATH2] for(true)=T -> switch(tokenType)=case DELIMITER -> return rootNode [COLLABORATORS] field tokenizer next/0,getToken/0 [CALLS-EXTERNAL] tokenizer.next/0, tokenizer.getToken/0 */ class Sq...
true
ok
{"focal": {"class": "SqlParser", "name": "parse", "signature": "SqlNode parse()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "SqlNode"}, "class_info": {"name": "SqlParser", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "config", "type": "MockConf...
17416853_3
class InvestigationViewState { public ResponsibilityEntry.State getState() { return state; } public InvestigationViewState(ResponsibilityEntry.State state, String name, String comment); public InvestigationViewState(); public String getDescription(); private String getCommentTruncat...
//given InvestigationViewState viewState = new InvestigationViewState(ResponsibilityEntry.State.TAKEN, NAME, null); //when ResponsibilityEntry.State description = viewState.getState(); //then assertEquals(ResponsibilityEntry.State.TAKEN, description); } }
[FOCAL] public ResponsibilityEntry.State InvestigationViewState.getState() [CLASS] class InvestigationViewState [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] InvestigationViewState(ResponsibilityEntry.State state, String name, String comment); InvestigationViewState(); String getD...
/* static context [FOCAL] public ResponsibilityEntry.State InvestigationViewState.getState() */
/* static context [FOCAL] public ResponsibilityEntry.State InvestigationViewState.getState() */ class InvestigationViewState { public ResponsibilityEntry.State getState() { return state; } public InvestigationViewState(ResponsibilityEntry.State state, String name, String comment); public Inv...
true
ok
{"focal": {"class": "InvestigationViewState", "name": "getState", "signature": "ResponsibilityEntry.State getState()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "ResponsibilityEntry.State"}, "class_info": {"name": "InvestigationViewState", "kind": "class", "modifiers": "", "superclass": null,...
17443465_20
class Operazione { public Oggetto extract(String text) { Oggetto risultato = null; if (this.operazione.equals("E-mails")) { risultato = getEmails(text); } else if (this.operazione.equals("numbers")) { risultato = getNumbers(text); } else if (this.operazione....
String testo = "45592 48118 "; Operazione opNumbers = new Operazione("numbers","+39","IT"); risultato = opNumbers.extract(testo); ArrayList<String> numbers = risultato.getOggettiTrovati(); assert(numbers.size()==0); for (String value : numbers) { // System.ou...
[FOCAL] public Oggetto Operazione.extract(String text) [CLASS] class Operazione [METRICS] loc=14 cc=5 branches=4 loops=0 returns=1 throws=0 nesting=4 [CALLS-INTERNAL] Oggetto getEmails(String text); Oggetto getIdentificationNumbers(String text); Oggetto getNumbers(String text); Oggetto getSites(String text) [CALLS-EXTE...
/* static context [FOCAL] public Oggetto Operazione.extract(String text) [PATH1] if(this.operazione.equals("E-mails"))=F -> if(this.operazione.equals("numbers"))=F -> if(this.operazione.equals("URLs"))=F -> if(this.operazione.equals("Identification_Numbers"))=T -> return (risultato == null) ? new Oggetto() : risultato ...
/* static context [FOCAL] public Oggetto Operazione.extract(String text) [PATH1] if(this.operazione.equals("E-mails"))=F -> if(this.operazione.equals("numbers"))=F -> if(this.operazione.equals("URLs"))=F -> if(this.operazione.equals("Identification_Numbers"))=T -> return (risultato == null) ? new Oggetto() : risultato ...
true
ok
{"focal": {"class": "Operazione", "name": "extract", "signature": "Oggetto extract(String text)", "start_line": 3, "modifiers": "public", "params": [{"name": "text", "type": "String"}], "return_type": "Oggetto"}, "class_info": {"name": "Operazione", "kind": "class", "modifiers": "", "superclass": null, "interfaces": nu...
17452733_36
class DGAEdgeTTTOutputFormat extends DGAAbstractEdgeOutputFormat<Text, Text, Text> { @Override public TextEdgeWriter<Text, Text, Text> createEdgeWriter(TaskAttemptContext context) throws IOException, InterruptedException { DGALoggingUtil.setDGALogLevel(getConf()); return new TTTEdgeWriter(); ...
TextEdgeWriter<Text, Text, Text> writer = createEdgeWriter(rw); conf.set(WRITE_EDGE_VALUE, "true"); conf.set(WRITE_VERTEX_VALUE, "true"); conf.set(FIELD_DELIMITER, "\t"); writer.setConf(conf); writer.initialize(tac); writer.writeEdge(vertex.getId(), vertex.getValu...
[FOCAL] @Override public TextEdgeWriter<Text, Text, Text> DGAEdgeTTTOutputFormat.createEdgeWriter(TaskAttemptContext context) [CLASS] class DGAEdgeTTTOutputFormat extends DGAAbstractEdgeOutputFormat<Text, Text, Text> [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] DGALoggingUtil.se...
/* static context [FOCAL] @Override public TextEdgeWriter<Text, Text, Text> DGAEdgeTTTOutputFormat.createEdgeWriter(TaskAttemptContext context) [INPUTS] branches=- | result=- | unused=context [EXCEPTIONS] declares IOException, InterruptedException [NEW] TTTEdgeWriter [CALLS-EXTERNAL] DGALoggingUtil.setDGALogLevel/1, ge...
/* static context [FOCAL] @Override public TextEdgeWriter<Text, Text, Text> DGAEdgeTTTOutputFormat.createEdgeWriter(TaskAttemptContext context) [INPUTS] branches=- | result=- | unused=context [EXCEPTIONS] declares IOException, InterruptedException [NEW] TTTEdgeWriter [CALLS-EXTERNAL] DGALoggingUtil.setDGALogLevel/1, ge...
true
ok
{"focal": {"class": "DGAEdgeTTTOutputFormat", "name": "createEdgeWriter", "signature": "TextEdgeWriter<Text, Text, Text> createEdgeWriter(TaskAttemptContext context) throws IOException, InterruptedException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "context", "type": "TaskAttemptContext"}]...
17455532_49
class EditDistance { public static int[] wordDistance(String s1, String s2, int chunkLen) { MinimalPerfectHash mph = new MinimalPerfectHash(true); // case sensitive TokenArray a1 = new TokenArray(mph, s1); TokenArray a2 = new TokenArray(mph, s2); EditSequence seq = new EditSequence(...
System.out.println("wordDistance"); String s1 = "p a t a t a"; String s2 = "a p t a"; int expResult = 3; int[] result = EditDistance.wordDistance(s1, s2, 10); assertEquals(expResult, result[2]); } }
[FOCAL] public static int[] EditDistance.wordDistance(String s1, String s2, int chunkLen) [CLASS] class EditDistance [METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] TokenArray.length/0, EditSequence.length/0 [NEW] MinimalPerfectHash, TokenArray, EditSequence [INPUTS] branches=- | r...
/* static context [FOCAL] public static int[] EditDistance.wordDistance(String s1, String s2, int chunkLen) [INPUTS] branches=- | result=chunkLen, s1, s2 [NEW] MinimalPerfectHash, TokenArray, EditSequence [CALLS-EXTERNAL] TokenArray.length/0, EditSequence.length/0 */
/* static context [FOCAL] public static int[] EditDistance.wordDistance(String s1, String s2, int chunkLen) [INPUTS] branches=- | result=chunkLen, s1, s2 [NEW] MinimalPerfectHash, TokenArray, EditSequence [CALLS-EXTERNAL] TokenArray.length/0, EditSequence.length/0 */ class EditDistance { public static int[] wordDi...
true
ok
{"focal": {"class": "EditDistance", "name": "wordDistance", "signature": "int[] wordDistance(String s1, String s2, int chunkLen)", "start_line": 3, "modifiers": "public static", "params": [{"name": "s1", "type": "String"}, {"name": "s2", "type": "String"}, {"name": "chunkLen", "type": "int"}], "return_type": "int[]"}, ...
17477111_338
class OrderDependencyResultComparator extends ResultComparator<OrderDependencyResult> { @Override protected int compare(OrderDependencyResult od1, OrderDependencyResult od2, String sortProperty) { if (LHS_COLUMN.equals(sortProperty)) { return od1.getLhs().toString() .compa...
OrderDependencyResultComparator resultComparator = new OrderDependencyResultComparator(OrderDependencyResultComparator.RHS_OCCURRENCE_RATIO, true); assertTrue(resultComparator.compare(od1, od2) > 0); } }
[FOCAL] @Override protected int OrderDependencyResultComparator.compare(OrderDependencyResult od1, OrderDependencyResult od2, String sortProperty) [CLASS] class OrderDependencyResultComparator extends ResultComparator<OrderDependencyResult> [METRICS] loc=34 cc=10 branches=9 loops=0 returns=10 throws=0 nesting=1 [CALLS-...
/* static context [FOCAL] @Override protected int OrderDependencyResultComparator.compare(OrderDependencyResult od1, OrderDependencyResult od2, String sortProperty) [PATH1] if(LHS_COLUMN.equals(sortProperty))=F -> if(RHS_COLUMN.equals(sortProperty))=F -> if(LHS_COLUMN_RATIO.equals(sortProperty))=F -> if(RHS_COLUMN_RATI...
/* static context [FOCAL] @Override protected int OrderDependencyResultComparator.compare(OrderDependencyResult od1, OrderDependencyResult od2, String sortProperty) [PATH1] if(LHS_COLUMN.equals(sortProperty))=F -> if(RHS_COLUMN.equals(sortProperty))=F -> if(LHS_COLUMN_RATIO.equals(sortProperty))=F -> if(RHS_COLUMN_RATI...
true
ok
{"focal": {"class": "OrderDependencyResultComparator", "name": "compare", "signature": "int compare(OrderDependencyResult od1, OrderDependencyResult od2, String sortProperty)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "od1", "type": "OrderDependencyResult"}, {"name": "od2", "type": "Orde...
17488986_14
class Distance { public static double getSquaredDistanceToSegment( final double pFromX, final double pFromY, final double pAX, final double pAY, final double pBX, final double pBY ) { return getSquaredDistanceToProjection(pFromX, pFromY, pAX, pAY, pBX, pBY, getPr...
final int xA = 100; final int yA = 200; Assert.assertEquals(0, Distance.getSquaredDistanceToSegment(xA, yA, xA, yA, xA, yA), mDelta); Assert.assertEquals(10 * 10, Distance.getSquaredDistanceToSegment(xA, yA, xA + 10, yA, xA + 10, yA), mDelta); Assert.assertEquals(20 * 20, Distance.getSquaredDistan...
[FOCAL] public static double Distance.getSquaredDistanceToSegment(double pFromX, double pFromY, double pAX, double pAY, double pBX, double pBY) [CLASS] class Distance [METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] double getProjectionFactorToSegment(double pFromX, double pFromY, d...
/* static context [FOCAL] public static double Distance.getSquaredDistanceToSegment(double pFromX, double pFromY, double pAX, double pAY, double pBX, double pBY) [INPUTS] branches=- | result=pAX, pAY, pBX, pBY, pFromX, pFromY [CALLS-INTERNAL] double getProjectionFactorToSegment(double pFromX, double pFromY, double pAX,...
/* static context [FOCAL] public static double Distance.getSquaredDistanceToSegment(double pFromX, double pFromY, double pAX, double pAY, double pBX, double pBY) [INPUTS] branches=- | result=pAX, pAY, pBX, pBY, pFromX, pFromY [CALLS-INTERNAL] double getProjectionFactorToSegment(double pFromX, double pFromY, double pAX,...
true
ok
{"focal": {"class": "Distance", "name": "getSquaredDistanceToSegment", "signature": "double getSquaredDistanceToSegment(double pFromX, double pFromY, double pAX, double pAY, double pBX, double pBY)", "start_line": 3, "modifiers": "public static", "params": [{"name": "pFromX", "type": "double"}, {"name": "pFromY", "type...
17491095_19
class EnumGenerator extends SpecialFileGenerator { @Override public SingleResult generate(Class<?> javaClass) throws SingleFileGeneratorException { List<String> constants = new ArrayList<>(); for (Enum constant : ((Class<Enum<?>>) javaClass).getEnumConstants()) { constants.add(constant.name()); } StjsJ...
EnumGenerator generator = new EnumGenerator(); String source = generator.generate(TestEnumWithValues.class).getSource(); assertThat(source, containsString("return 'Test'")); assertThat(source, containsString("return 'Bla'")); assertThat(source, containsString("return 42")); assertThat(source, containsStr...
[FOCAL] @Override public SingleResult EnumGenerator.generate(Class<?> javaClass) [CLASS] class EnumGenerator extends SpecialFileGenerator [METRICS] loc=19 cc=3 branches=0 loops=2 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] Map<String, Object> getEnumConstValueGetters(Class<? extends Enum> enumClass) [CALLS-EXTERNAL] ...
/* static context [FOCAL] @Override public SingleResult EnumGenerator.generate(Class<?> javaClass) [PATH1] foreach(Enum constant : ((Class<Enum<?>>) javaClass).getEnumConstants())=T -> exit loop -> foreach(String constantAndGetterName : enumConstValueGetters.keySet())=F -> return new JavaScriptResult(builder.create()) ...
/* static context [FOCAL] @Override public SingleResult EnumGenerator.generate(Class<?> javaClass) [PATH1] foreach(Enum constant : ((Class<Enum<?>>) javaClass).getEnumConstants())=T -> exit loop -> foreach(String constantAndGetterName : enumConstValueGetters.keySet())=F -> return new JavaScriptResult(builder.create()) ...
true
ok
{"focal": {"class": "EnumGenerator", "name": "generate", "signature": "SingleResult generate(Class<?> javaClass) throws SingleFileGeneratorException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "javaClass", "type": "Class<?>"}], "return_type": "SingleResult"}, "class_info": {"name": "EnumGene...
17505473_57
class UsergroupClient { @SuppressWarnings("unchecked") public List<String> update(UsergroupUpdateParam param) { if (param.getUsrgrpid() == null || param.getUsrgrpid().length() == 0) { throw new IllegalArgumentException("usrgrpid is required."); } JSONObject params = JSONObj...
// 存在しないusrgrpidを指定した場合 UsergroupUpdateParam param = new UsergroupUpdateParam(); param.setUsrgrpid("999999"); try { client.usergroup().update(param); //fail(); // エラーは発生しない } catch (Exception ignore) { log.trace(ignore.getMessage()); }...
[FOCAL] @SuppressWarnings("unchecked") public List<String> UsergroupClient.update(UsergroupUpdateParam param) [CLASS] class UsergroupClient [METRICS] loc=22 cc=4 branches=3 loops=0 returns=1 throws=1 nesting=2 [CALLS-EXTERNAL] UsergroupUpdateParam.getUsrgrpid/0, param.getUsrgrpid().length/0, JSONObject.fromObject/2, ac...
/* static context [FOCAL] @SuppressWarnings("unchecked") public List<String> UsergroupClient.update(UsergroupUpdateParam param) [THROWS-WHEN] IllegalArgumentException when param.getUsrgrpid() == null || param.getUsrgrpid().length() == 0 [PATH1] if(param.getUsrgrpid() == null || param.getUsrgrpid().length() == 0)=F -> i...
/* static context [FOCAL] @SuppressWarnings("unchecked") public List<String> UsergroupClient.update(UsergroupUpdateParam param) [THROWS-WHEN] IllegalArgumentException when param.getUsrgrpid() == null || param.getUsrgrpid().length() == 0 [PATH1] if(param.getUsrgrpid() == null || param.getUsrgrpid().length() == 0)=F -> i...
true
ok
{"focal": {"class": "UsergroupClient", "name": "update", "signature": "List<String> update(UsergroupUpdateParam param)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public", "params": [{"name": "param", "type": "UsergroupUpdateParam"}], "return_type": "List<String>"}, "class_info": {"name": "Usergro...
17517472_48
class App { public String post(final String content) throws Exception { final var request = HttpRequest.newBuilder() .uri(URI.create(url)) .header("X-Meta-Var", "FooBar") .POST(BodyPublishers.ofString(content)) .build(); final var cl...
try (final var server = new MockWebServer()) { server.enqueue(new MockResponse().setBody("world")); final var app = new App(server.url("/").url().toExternalForm()); assertEquals("world", app.post("hello")); assertEquals(1, server.getRequestCount()); ...
[FOCAL] public String App.post(String content) [CLASS] class App [METRICS] loc=12 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] HttpRequest.newBuilder() .uri(URI.create(url)) .header("X....build/0, HttpRequest.newBuilder() .uri(URI.create(url)) .header("X....POST/1, HttpRequest.newBuilder() .uri...
/* static context [FOCAL] public String App.post(String content) [INPUTS] branches=- | result=content [EXCEPTIONS] declares Exception [CALLS-EXTERNAL] HttpRequest.newBuilder() .uri(URI.create(url)) .header("X....build/0, HttpRequest.newBuilder() .uri(URI.create(url)) .header("X....POST/1, HttpRequest.newBuilder() .uri(...
/* static context [FOCAL] public String App.post(String content) [INPUTS] branches=- | result=content [EXCEPTIONS] declares Exception [CALLS-EXTERNAL] HttpRequest.newBuilder() .uri(URI.create(url)) .header("X....build/0, HttpRequest.newBuilder() .uri(URI.create(url)) .header("X....POST/1, HttpRequest.newBuilder() .uri(...
true
ok
{"focal": {"class": "App", "name": "post", "signature": "String post(String content) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "content", "type": "String"}], "return_type": "String"}, "class_info": {"name": "App", "kind": "class", "modifiers": "", "superclass": null, "interfaces": n...
17517521_312
class NullClaim implements Claim { @Override public Map<String, Object> asMap() throws JWTDecodeException { return null; } @Override public boolean isNull(); @Override public Boolean asBoolean(); @Override public Integer asInt(); @Override public Long asLong(); @Override public...
assertThat(claim.asMap(), is(nullValue())); } }
[FOCAL] @Override public Map<String, Object> NullClaim.asMap() [CLASS] class NullClaim implements Claim [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [EXCEPTIONS] declares JWTDecodeException [CLASS-MEMBERS] boolean isNull(); Boolean asBoolean(); Integer asInt(); Long asLong(); Double asDouble(); ...
/* static context [FOCAL] @Override public Map<String, Object> NullClaim.asMap() [EXCEPTIONS] declares JWTDecodeException */
/* static context [FOCAL] @Override public Map<String, Object> NullClaim.asMap() [EXCEPTIONS] declares JWTDecodeException */ class NullClaim implements Claim { @Override public Map<String, Object> asMap() throws JWTDecodeException { return null; } @Override public boolean isNull(); @Overri...
true
ok
{"focal": {"class": "NullClaim", "name": "asMap", "signature": "Map<String, Object> asMap() throws JWTDecodeException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Map<String, Object>"}, "class_info": {"name": "NullClaim", "kind": "class", "modifiers": "", "superclass": null, "interf...
17547888_0
class Vector { public int getMaxRows() { return packedValues.length; } public Vector(final int length); public Vector(final Vector A); public Vector(final long[] values); public Vector plus(final Vector B, final Vector result); public Vector minus(final Vector B, final Vector result); ...
// ARRANGE final Vector A = new Vector(4); // ACT final int result = A.getMaxRows(); // ASSERT Assert.assertEquals(4, result, 0); } }
[FOCAL] public int Vector.getMaxRows() [CLASS] class Vector [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Vector(int length); Vector(Vector A); Vector(long[] values); Vector plus(Vector B, Vector result); Vector minus(Vector B, Vector result); double dotProduct(Vector B); Vector m...
/* static context [FOCAL] public int Vector.getMaxRows() */
/* static context [FOCAL] public int Vector.getMaxRows() */ class Vector { public int getMaxRows() { return packedValues.length; } public Vector(final int length); public Vector(final Vector A); public Vector(final long[] values); public Vector plus(final Vector B, final Vector result); ...
true
ok
{"focal": {"class": "Vector", "name": "getMaxRows", "signature": "int getMaxRows()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "Vector", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Vector", "kind"...
17575379_17
class CORSFilter implements Filter { public static String join(final Collection<String> elements, final String joinSeparator) { String separator = ","; if (elements == null) { return null; } if (joinSeparator != null) { separator = joinSeparator; } StringBuilder buffer = new StringBuilder(); bo...
Set<String> elements = new LinkedHashSet<>(); String separator = ","; elements.add(null); elements.add(null); String join = CORSFilter.join(elements, separator); Assert.assertTrue("".equals(join)); } }
[FOCAL] public static String CORSFilter.join(Collection<String> elements, String joinSeparator) [CLASS] class CORSFilter implements Filter [METRICS] loc=25 cc=6 branches=4 loops=1 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] StringBuilder.append/1, StringBuilder.toString/0 [NEW] StringBuilder [PATH1] if(elements == nu...
/* static context [FOCAL] public static String CORSFilter.join(Collection<String> elements, String joinSeparator) [PATH1] if(elements == null)=F -> if(joinSeparator != null)=T -> foreach(String element : elements)=T -> if(!isFirst)=T -> if(element != null)=T -> exit loop -> return buffer.toString() [PATH2] if(elements ...
/* static context [FOCAL] public static String CORSFilter.join(Collection<String> elements, String joinSeparator) [PATH1] if(elements == null)=F -> if(joinSeparator != null)=T -> foreach(String element : elements)=T -> if(!isFirst)=T -> if(element != null)=T -> exit loop -> return buffer.toString() [PATH2] if(elements ...
true
ok
{"focal": {"class": "CORSFilter", "name": "join", "signature": "String join(Collection<String> elements, String joinSeparator)", "start_line": 3, "modifiers": "public static", "params": [{"name": "elements", "type": "Collection<String>"}, {"name": "joinSeparator", "type": "String"}], "return_type": "String"}, "class_in...
17592978_1
class PaypalService { public PaypalResponse completePayment(PaperightCreditTransaction transaction, String token, String payerId) { Profile user = new BaseProfile.Builder(apiUser, apiPassword).signature(apiSignature).build(); /* create new instance of paypal nvp */ Environment environment; if (sandbox) { e...
PaperightCreditTransaction transaction = new PaperightCreditTransaction(); transaction.setNumberOfCredits(new BigDecimal(123).setScale(0)); PaypalResponse response = paypalService.completePayment(transaction, "EC-786270384N085350D", "ZHTTV47G8KZ8Y"); if (response.isSuccessful()) { System.out.println("Token: ...
[FOCAL] public PaypalResponse PaypalService.completePayment(PaperightCreditTransaction transaction, String token, String payerId) [CLASS] class PaypalService [METRICS] loc=36 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] new BaseProfile.Builder(apiUser, apiPassword).signature(a....build/0, new B...
/* static context [FOCAL] public PaypalResponse PaypalService.completePayment(PaperightCreditTransaction transaction, String token, String payerId) [PATH1] if(sandbox)=T -> return paypalResponse [PATH2] if(sandbox)=F -> return paypalResponse [COLLABORATORS] field paperightCreditService paperightCreditsInBaseCurrency/1;...
/* static context [FOCAL] public PaypalResponse PaypalService.completePayment(PaperightCreditTransaction transaction, String token, String payerId) [PATH1] if(sandbox)=T -> return paypalResponse [PATH2] if(sandbox)=F -> return paypalResponse [COLLABORATORS] field paperightCreditService paperightCreditsInBaseCurrency/1;...
true
ok
{"focal": {"class": "PaypalService", "name": "completePayment", "signature": "PaypalResponse completePayment(PaperightCreditTransaction transaction, String token, String payerId)", "start_line": 3, "modifiers": "public", "params": [{"name": "transaction", "type": "PaperightCreditTransaction"}, {"name": "token", "type":...
17612803_365
class Loderunner implements Field { @Override public void tick() { Set<Player> die = new HashSet<>(); heroesGo(); die.addAll(getDied()); enemiesGo(); die.addAll(getDied()); die.addAll(bricksGo()); for (Player player : die) { player.event(E...
shouldMoveLeft(); hero.left(); game.tick(); assertE("☼☼☼☼☼" + "☼ ☼" + "☼◄ ☼" + "☼###☼" + "☼☼☼☼☼"); } }
[FOCAL] @Override public void Loderunner.tick() [CLASS] class Loderunner implements Field [METRICS] loc=16 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] List<Player> bricksGo(); Set<Player> getDied(); void enemiesGo(); void heroesGo() [CALLS-EXTERNAL] Set<Player>.addAll/1, Player.event/1 [NEW] H...
/* static context [FOCAL] @Override public void Loderunner.tick() [PATH1] foreach(Player player : die)=T -> exit loop [PATH2] foreach(Player player : die)=F [CALLS-INTERNAL] List<Player> bricksGo(); Set<Player> getDied(); void enemiesGo(); void heroesGo() [NEW] HashSet<> [CALLS-EXTERNAL] Set<Player>.addAll/1, Player.ev...
/* static context [FOCAL] @Override public void Loderunner.tick() [PATH1] foreach(Player player : die)=T -> exit loop [PATH2] foreach(Player player : die)=F [CALLS-INTERNAL] List<Player> bricksGo(); Set<Player> getDied(); void enemiesGo(); void heroesGo() [NEW] HashSet<> [CALLS-EXTERNAL] Set<Player>.addAll/1, Player.ev...
true
ok
{"focal": {"class": "Loderunner", "name": "tick", "signature": "void tick()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "Loderunner", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Field", "fields": [{"name": "game", "type": "Lod...
17621324_2
class OrderController extends RestActionSupport implements ModelDriven<Object> { public HttpHeaders create() { log.debug("Create new order: {}", model); ordersService.save(model); return new DefaultHttpHeaders("success") .setLocationId(model.getId()); } public HttpHeade...
request.setParameter("clientName", "Grace Hopper"); request.setParameter("amount", "85"); ActionProxy proxy = getActionProxy("POST", "/data/order.json"); OrderController orderController = (OrderController) proxy.getAction(); proxy.execute(); assertThat(orderController.h...
[FOCAL] public HttpHeaders OrderController.create() [CLASS] class OrderController extends RestActionSupport implements ModelDriven<Object> [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] log.debug/2, ordersService.save/1, new DefaultHttpHeaders("success").setLocationId/1, model.get...
/* static context [FOCAL] public HttpHeaders OrderController.create() [COLLABORATORS] field ordersService save/1; field model getId/0 [NEW] DefaultHttpHeaders [CALLS-EXTERNAL] log.debug/2, ordersService.save/1, new DefaultHttpHeaders("success").setLocationId/1, model.getId/0 */
/* static context [FOCAL] public HttpHeaders OrderController.create() [COLLABORATORS] field ordersService save/1; field model getId/0 [NEW] DefaultHttpHeaders [CALLS-EXTERNAL] log.debug/2, ordersService.save/1, new DefaultHttpHeaders("success").setLocationId/1, model.getId/0 */ class OrderController extends RestActionS...
true
ok
{"focal": {"class": "OrderController", "name": "create", "signature": "HttpHeaders create()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "HttpHeaders"}, "class_info": {"name": "OrderController", "kind": "class", "modifiers": "", "superclass": "RestActionSupport", "interfaces": "ModelDriven<Obj...
17626803_1
class CreateComplexMeasurement { public ActionPossibility canCreate(ApplicationUser user) { boolean possible = user != null && user.getName() != null && !user.getName().isEmpty(); return new ActionPossibility(possible, "Anonymous user cannot create complex measurement", HttpStatus.UNAUTHORIZED); } public Measu...
user = new ApplicationUser(""); Assert.assertFalse(uut.canCreate(user).isPossible()); user.setName("TestUser"); Assert.assertTrue(uut.canCreate(user).isPossible()); } }
[FOCAL] public ActionPossibility CreateComplexMeasurement.canCreate(ApplicationUser user) [CLASS] class CreateComplexMeasurement [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] ApplicationUser.getName/0, user.getName().isEmpty/0 [NEW] ActionPossibility [INPUTS] branches=- | result=...
/* static context [FOCAL] public ActionPossibility CreateComplexMeasurement.canCreate(ApplicationUser user) [INPUTS] branches=- | result=user [COLLABORATORS] param user:ApplicationUser getName/0 [NEW] ActionPossibility [CALLS-EXTERNAL] ApplicationUser.getName/0, user.getName().isEmpty/0 */
/* static context [FOCAL] public ActionPossibility CreateComplexMeasurement.canCreate(ApplicationUser user) [INPUTS] branches=- | result=user [COLLABORATORS] param user:ApplicationUser getName/0 [NEW] ActionPossibility [CALLS-EXTERNAL] ApplicationUser.getName/0, user.getName().isEmpty/0 */ class CreateComplexMeasuremen...
true
ok
{"focal": {"class": "CreateComplexMeasurement", "name": "canCreate", "signature": "ActionPossibility canCreate(ApplicationUser user)", "start_line": 3, "modifiers": "public", "params": [{"name": "user", "type": "ApplicationUser"}], "return_type": "ActionPossibility"}, "class_info": {"name": "CreateComplexMeasurement", ...
17627721_1
class ConceptBreakdown { public Iterable<ConceptBreakdown> getChildBreakdownInfos() { return childBreakdown; } ConceptBreakdown(String conceptCode); ConceptBreakdown(String parentConceptCode, String conceptCode); public String getConceptCode(); public void setConceptCode(String co...
boolean childFound = false; for (ConceptBreakdown childBreakdown : root.getChildBreakdownInfos()) { if (childBreakdown.equals(child)) { childFound = true; } } assertTrue(childFound); } }
[FOCAL] public Iterable<ConceptBreakdown> ConceptBreakdown.getChildBreakdownInfos() [CLASS] class ConceptBreakdown [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] ConceptBreakdown(String conceptCode); ConceptBreakdown(String parentConceptCode, String conceptCode); String getConceptC...
/* static context [FOCAL] public Iterable<ConceptBreakdown> ConceptBreakdown.getChildBreakdownInfos() */
/* static context [FOCAL] public Iterable<ConceptBreakdown> ConceptBreakdown.getChildBreakdownInfos() */ class ConceptBreakdown { public Iterable<ConceptBreakdown> getChildBreakdownInfos() { return childBreakdown; } ConceptBreakdown(String conceptCode); ConceptBreakdown(String parentConcep...
true
ok
{"focal": {"class": "ConceptBreakdown", "name": "getChildBreakdownInfos", "signature": "Iterable<ConceptBreakdown> getChildBreakdownInfos()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Iterable<ConceptBreakdown>"}, "class_info": {"name": "ConceptBreakdown", "kind": "class", "modifiers": "", "...
17662022_131
class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMessageListener, PersistedDataHost { public void editOpenOfferStart(OpenOffer openOffer, ResultHandler resultHandler, ErrorMessageHandler errorMessageHandler) { if (o...
P2PService p2PService = mock(P2PService.class); OfferBookService offerBookService = mock(OfferBookService.class); when(p2PService.getPeerManager()).thenReturn(mock(PeerManager.class)); final OpenOfferManager manager = new OpenOfferManager(null, null, null, p2PService, nu...
[FOCAL] public void OpenOfferManager.editOpenOfferStart(OpenOffer openOffer, ResultHandler resultHandler, ErrorMessageHandler errorMessageHandler) [CLASS] class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMessageListener, PersistedDataHost [METRICS] loc=22 cc=3 branches=2 loops=0 returns=1 throws=0...
/* static context [FOCAL] public void OpenOfferManager.editOpenOfferStart(OpenOffer openOffer, ResultHandler resultHandler, ErrorMessageHandler errorMessageHandler) [PATH1] if(offersToBeEdited.containsKey(openOffer.getId()))=T -> return [PATH2] if(offersToBeEdited.containsKey(openOffer.getId()))=F -> if(openOffer.isDea...
/* static context [FOCAL] public void OpenOfferManager.editOpenOfferStart(OpenOffer openOffer, ResultHandler resultHandler, ErrorMessageHandler errorMessageHandler) [PATH1] if(offersToBeEdited.containsKey(openOffer.getId()))=T -> return [PATH2] if(offersToBeEdited.containsKey(openOffer.getId()))=F -> if(openOffer.isDea...
true
ok
{"focal": {"class": "OpenOfferManager", "name": "editOpenOfferStart", "signature": "void editOpenOfferStart(OpenOffer openOffer, ResultHandler resultHandler, ErrorMessageHandler errorMessageHandler)", "start_line": 3, "modifiers": "public", "params": [{"name": "openOffer", "type": "OpenOffer"}, {"name": "resultHandler"...
17670446_25
class VcfRecordProtoToVariantConverter implements Converter<VcfSliceProtos.VcfRecord, Variant> { @Override public Variant convert(VcfSliceProtos.VcfRecord vcfRecord) { return convert(vcfRecord, "0", 0); } public VcfRecordProtoToVariantConverter(VcfSliceProtos.Fields fields, Map<String, Intege...
Variant variant = Variant.newBuilder("1", 5000, 5000, "A", "C").setStudyId(studyId) .setFilter("nopass") .setQuality("50") .setSampleDataKeys(Collections.emptyList()) .setSamples(Collections.emptyList()) .setFileId(fileId) ...
[FOCAL] @Override public Variant VcfRecordProtoToVariantConverter.convert(VcfSliceProtos.VcfRecord vcfRecord) [CLASS] class VcfRecordProtoToVariantConverter implements Converter<VcfSliceProtos.VcfRecord, Variant> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Variant convert(VcfSl...
/* static context [FOCAL] @Override public Variant VcfRecordProtoToVariantConverter.convert(VcfSliceProtos.VcfRecord vcfRecord) [INPUTS] branches=- | result=vcfRecord [CALLS-INTERNAL] Variant convert(VcfSliceProtos.VcfRecord vcfRecord, String chromosome, int slicePosition) */
/* static context [FOCAL] @Override public Variant VcfRecordProtoToVariantConverter.convert(VcfSliceProtos.VcfRecord vcfRecord) [INPUTS] branches=- | result=vcfRecord [CALLS-INTERNAL] Variant convert(VcfSliceProtos.VcfRecord vcfRecord, String chromosome, int slicePosition) */ class VcfRecordProtoToVariantConverter impl...
true
ok
{"focal": {"class": "VcfRecordProtoToVariantConverter", "name": "convert", "signature": "Variant convert(VcfSliceProtos.VcfRecord vcfRecord)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "vcfRecord", "type": "VcfSliceProtos.VcfRecord"}], "return_type": "Variant"}, "class_info": {"name": "VcfRe...
17684716_10
class BagriXQItemAccessor extends BagriXQCloseable implements XQItemAccessor { @Override public String getItemAsString(Properties props) throws XQException { if (closed) { throw new XQException(ex_item_closed); } if (value == null) { throw new XQException("Value is not accessible"); } props = chec...
XQExpression xqe = xqc.createExpression(); XQSequence xqs = xqe.executeQuery("<e a='Hello world!'/>/@*"); xqs.next(); try { xqs.getItemAsString(new Properties()); fail("A-XQIA-8.1: serialization process fails when sequence contains a top-level attribute"); } catch (XQException xq) { ...
[FOCAL] @Override public String BagriXQItemAccessor.getItemAsString(Properties props) [CLASS] class BagriXQItemAccessor extends BagriXQCloseable implements XQItemAccessor [METRICS] loc=12 cc=3 branches=2 loops=0 returns=1 throws=2 nesting=1 [CALLS-INTERNAL] Properties checkOutputProperties(Properties props) [CALLS-EXTE...
/* static context [FOCAL] @Override public String BagriXQItemAccessor.getItemAsString(Properties props) [THROWS-WHEN] XQException when closed [THROWS-WHEN] XQException when !closed && value == null [PATH1] if(closed)=F -> if(value == null)=T -> throw new XQException("Value is not accessible") [PATH2] if(closed)=T -> th...
/* static context [FOCAL] @Override public String BagriXQItemAccessor.getItemAsString(Properties props) [THROWS-WHEN] XQException when closed [THROWS-WHEN] XQException when !closed && value == null [PATH1] if(closed)=F -> if(value == null)=T -> throw new XQException("Value is not accessible") [PATH2] if(closed)=T -> th...
true
ok
{"focal": {"class": "BagriXQItemAccessor", "name": "getItemAsString", "signature": "String getItemAsString(Properties props) throws XQException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "props", "type": "Properties"}], "return_type": "String"}, "class_info": {"name": "BagriXQItemAccessor",...
17705626_1
class TagNamesConverter implements ParamConverter<TagNames> { @Override public TagNames fromString(String value) { String[] tokens = value.split(",", -1); Set<String> names = Arrays.stream(tokens).map(token -> { if (token.trim().isEmpty()) { throw new IllegalArgument...
assertEquals(tags, new TagNamesConverter().fromString(value).getNames()); } }
[FOCAL] @Override public TagNames TagNamesConverter.fromString(String value) [CLASS] class TagNamesConverter implements ParamConverter<TagNames> [METRICS] loc=19 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] String.split/2, Arrays.stream(tokens).map(token -> { if (token.trim().isE....collect/1, ...
/* static context [FOCAL] @Override public TagNames TagNamesConverter.fromString(String value) [INPUTS] branches=- | result=value [COLLABORATORS] field token trim/0,split/2 [NEW] IllegalArgumentException, TagNames [CALLS-EXTERNAL] String.split/2, Arrays.stream(tokens).map(token -> { if (token.trim().isE....collect/1, A...
/* static context [FOCAL] @Override public TagNames TagNamesConverter.fromString(String value) [INPUTS] branches=- | result=value [COLLABORATORS] field token trim/0,split/2 [NEW] IllegalArgumentException, TagNames [CALLS-EXTERNAL] String.split/2, Arrays.stream(tokens).map(token -> { if (token.trim().isE....collect/1, A...
true
ok
{"focal": {"class": "TagNamesConverter", "name": "fromString", "signature": "TagNames fromString(String value)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "value", "type": "String"}], "return_type": "TagNames"}, "class_info": {"name": "TagNamesConverter", "kind": "class", "modifiers": "", "s...
17714013_2
class RecodeRulesConverter implements ReverseConverter<IDataSet, TransferRuleDescriptor> { @Override public TransferRuleDescriptor convert(IDataSet source) { Collection<RecodeRule> result = new ArrayList<>(); try { for (String tableName : source.getTableNames()) { IT...
DictionaryNamedPath dictionaryNamedPath = new DictionaryNamedPath(null, "testDictionary"); DefaultTable table = new DefaultTable(new DefaultTableMetaData( dictionaryNamedPath.getDictionaryName(), new Column[]{new Column("from.c1", DataType.UNKNOWN), new Column("c2", DataT...
[FOCAL] @Override public TransferRuleDescriptor RecodeRulesConverter.convert(IDataSet source) [CLASS] class RecodeRulesConverter implements ReverseConverter<IDataSet, TransferRuleDescriptor> [METRICS] loc=24 cc=4 branches=1 loops=1 returns=1 throws=1 nesting=3 [CALLS-INTERNAL] Collection<RecodeRule> createRecodeRules(D...
/* static context [FOCAL] @Override public TransferRuleDescriptor RecodeRulesConverter.convert(IDataSet source) [PATH1] foreach(String tableName : source.getTableNames())=T -> if(columnCount >= MIN_COLUMN_COUNT)=T -> exit loop -> return new TransferRuleDescriptor(result) [PATH2] foreach(String tableName : source.getTab...
/* static context [FOCAL] @Override public TransferRuleDescriptor RecodeRulesConverter.convert(IDataSet source) [PATH1] foreach(String tableName : source.getTableNames())=T -> if(columnCount >= MIN_COLUMN_COUNT)=T -> exit loop -> return new TransferRuleDescriptor(result) [PATH2] foreach(String tableName : source.getTab...
true
ok
{"focal": {"class": "RecodeRulesConverter", "name": "convert", "signature": "TransferRuleDescriptor convert(IDataSet source)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "source", "type": "IDataSet"}], "return_type": "TransferRuleDescriptor"}, "class_info": {"name": "RecodeRulesConverter", "k...
17717497_57
class User extends BaseEntity implements UserEntry { public String getPassword() { return password; } public void setRoleName(String roleName); public String getRoleName(); public String getEmail(); public void setEmail(String email); public String getName(); public void setNam...
entity.setPassword("123123"); assertEquals("123123", entity.getPassword()); } }
[FOCAL] public String User.getPassword() [CLASS] class User extends BaseEntity implements UserEntry [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] void setRoleName(String roleName); String getRoleName(); String getEmail(); void setEmail(String email); String getName(); void setName...
/* static context [FOCAL] public String User.getPassword() */
/* static context [FOCAL] public String User.getPassword() */ class User extends BaseEntity implements UserEntry { public String getPassword() { return password; } public void setRoleName(String roleName); public String getRoleName(); public String getEmail(); public void setEmail(Stri...
true
ok
{"focal": {"class": "User", "name": "getPassword", "signature": "String getPassword()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "User", "kind": "class", "modifiers": "", "superclass": "BaseEntity", "interfaces": "UserEntry", "fields": [{"name": "entity", "t...
17759402_25
class Byte { public String aHex() { String first = translate(this.bits.substring(0, 4)); String second = translate(this.bits.substring(4, 8)); return first + second; } public Byte(String bits); private String translate(String fourBits); @Override public String toString(); } class ByteTest { @Test pu...
// no es necesario recoger el resultado en una variable Byte b = new Byte("10011110"); assertThat(b.aHex(),is("9E")); } }
[FOCAL] public String Byte.aHex() [CLASS] class Byte [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String translate(String fourBits) [CALLS-EXTERNAL] this.bits.substring/2 [FIELDS] read=bits [COLLABORATORS] field bits substring/2 [DATAFLOW] first@L2->L4; second@L3->L4 [CLASS-MEMB...
/* static context [FOCAL] public String Byte.aHex() [COLLABORATORS] field bits substring/2 [CALLS-INTERNAL] String translate(String fourBits) [FIELDS] read=bits [CALLS-EXTERNAL] this.bits.substring/2 */
/* static context [FOCAL] public String Byte.aHex() [COLLABORATORS] field bits substring/2 [CALLS-INTERNAL] String translate(String fourBits) [FIELDS] read=bits [CALLS-EXTERNAL] this.bits.substring/2 */ class Byte { public String aHex() { String first = translate(this.bits.substring(0, 4)); String second = transl...
true
ok
{"focal": {"class": "Byte", "name": "aHex", "signature": "String aHex()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "Byte", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Byte", "kind": "construct...
17775087_4
class BasicNetwork implements Network { @Override public NetworkResponse performRequest(Request<?> request) throws VolleyError { long requestStart = SystemClock.elapsedRealtime(); while (true) { HttpResponse httpResponse = null; byte[] responseContents = null; ...
MockHttpStack mockHttpStack = new MockHttpStack(); mockHttpStack.setExceptionToThrow(new ConnectTimeoutException()); BasicNetwork httpNetwork = new BasicNetwork(mockHttpStack); Request<String> request = buildRequest(); request.setRetryPolicy(mMockRetryPolicy); doThrow(new...
[FOCAL] @Override public NetworkResponse BasicNetwork.performRequest(Request<?> request) [CLASS] class BasicNetwork implements Network [METRICS] loc=96 cc=18 branches=10 loops=1 returns=3 throws=6 nesting=7 [CALLS-INTERNAL] Map<String, String> convertHeaders(Header[] headers); byte[] entityToBytes(HttpEntity entity); v...
/* static context [FOCAL] @Override public NetworkResponse BasicNetwork.performRequest(Request<?> request) [THROWS-WHEN] RuntimeException when true && try-body throws [THROWS-WHEN] ClientError when true && try-body throws && httpResponse != null && responseContents != null && !(statusCode == HttpStatus.SC_UNAUTHORIZED ...
/* static context [FOCAL] @Override public NetworkResponse BasicNetwork.performRequest(Request<?> request) [THROWS-WHEN] RuntimeException when true && try-body throws [THROWS-WHEN] ClientError when true && try-body throws && httpResponse != null && responseContents != null && !(statusCode == HttpStatus.SC_UNAUTHORIZED ...
true
ok
{"focal": {"class": "BasicNetwork", "name": "performRequest", "signature": "NetworkResponse performRequest(Request<?> request) throws VolleyError", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "Request<?>"}], "return_type": "NetworkResponse"}, "class_info": {"name": "BasicNet...
17787462_1
class IdDecoder extends AsyncTask<String, Integer, Lyrics> { @Override protected Lyrics doInBackground(String... strings) { String url = strings[0]; String artist; String track; if (url == null) return new Lyrics(ERROR); if (url.contains("//www.soundhound.com...
Lyrics result = idDecoder.doInBackground("http://shz.am/t54008130"); assertNotNull(result); assertEquals(result.getArtist(), "Tycho"); assertEquals(result.getTitle(), "A Walk"); } }
[FOCAL] @Override protected Lyrics IdDecoder.doInBackground(String... strings) [CLASS] class IdDecoder extends AsyncTask<String, Integer, Lyrics> [METRICS] loc=54 cc=8 branches=4 loops=0 returns=6 throws=0 nesting=4 [CALLS-EXTERNAL] String.contains/1, getUrlAsString/1 (inherited), String.indexOf/1, html.substring(prece...
/* static context [FOCAL] @Override protected Lyrics IdDecoder.doInBackground(String... strings) [PATH1] if(url == null)=F -> if(url.contains("//www.soundhound.com/"))=F -> if(url.contains("//shz.am/"))=F -> if(url.contains("//play.google.com/store/music/"))=T -> try-body throws -> return new Lyrics(ERROR) [PATH2] if(u...
/* static context [FOCAL] @Override protected Lyrics IdDecoder.doInBackground(String... strings) [PATH1] if(url == null)=F -> if(url.contains("//www.soundhound.com/"))=F -> if(url.contains("//shz.am/"))=F -> if(url.contains("//play.google.com/store/music/"))=T -> try-body throws -> return new Lyrics(ERROR) [PATH2] if(u...
true
ok
{"focal": {"class": "IdDecoder", "name": "doInBackground", "signature": "Lyrics doInBackground(String... strings)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "strings", "type": "String..."}], "return_type": "Lyrics"}, "class_info": {"name": "IdDecoder", "kind": "class", "modifiers": "", "...
17794452_0
class HelloWorld { public static String hello() { return "Hello World"; } @HelloAnnotation("hello") public String hello(@HelloAnnotation("par") String par); } class HelloWorldTest { @Test public void extraClassPathClassStaticTest() {
Assert.assertEquals("Assert class from target/extra is used.", "Hello World Extra", HelloWorld.hello()); } }
[FOCAL] public static String HelloWorld.hello() [CLASS] class HelloWorld [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] String hello(String par) [TEST] HelloWorldTest: @Test public void extraClassPathClassStaticTest()
/* static context [FOCAL] public static String HelloWorld.hello() */
/* static context [FOCAL] public static String HelloWorld.hello() */ class HelloWorld { public static String hello() { return "Hello World"; } @HelloAnnotation("hello") public String hello(@HelloAnnotation("par") String par); } class HelloWorldTest { @Test public void extraClassPathClas...
true
ok
{"focal": {"class": "HelloWorld", "name": "hello", "signature": "String hello()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "String"}, "class_info": {"name": "HelloWorld", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "hell...
17801020_1
class LinkedBufferOutput extends BufferedOutput { public byte[] toByteArray() { byte[] bytes = new byte[size + filled]; int off = 0; for (Link l : link) { System.arraycopy(l.buffer, l.offset, bytes, off, l.size); off += l.size; } if (filled > 0) { ...
ByteArrayOutputStream bo = new ByteArrayOutputStream(); DataOutputStream o1 = new DataOutputStream(bo); LinkedBufferOutput o2 = new LinkedBufferOutput(10); o1.writeByte((byte)2); o2.writeByte((byte)2); o1.writeShort((short)2); o2.writeShort((short)2); o1.w...
[FOCAL] public byte[] LinkedBufferOutput.toByteArray() [CLASS] class LinkedBufferOutput extends BufferedOutput [METRICS] loc=12 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] System.arraycopy/5 [PATH1] foreach(Link l : link)=T -> exit loop -> if(filled > 0)=T -> return bytes [PATH2] foreach(Link ...
/* static context [FOCAL] public byte[] LinkedBufferOutput.toByteArray() [PATH1] foreach(Link l : link)=T -> exit loop -> if(filled > 0)=T -> return bytes [PATH2] foreach(Link l : link)=F -> if(filled > 0)=F -> return bytes [CALLS-EXTERNAL] System.arraycopy/5 */
/* static context [FOCAL] public byte[] LinkedBufferOutput.toByteArray() [PATH1] foreach(Link l : link)=T -> exit loop -> if(filled > 0)=T -> return bytes [PATH2] foreach(Link l : link)=F -> if(filled > 0)=F -> return bytes [CALLS-EXTERNAL] System.arraycopy/5 */ class LinkedBufferOutput extends BufferedOutput { pu...
true
ok
{"focal": {"class": "LinkedBufferOutput", "name": "toByteArray", "signature": "byte[] toByteArray()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "byte[]"}, "class_info": {"name": "LinkedBufferOutput", "kind": "class", "modifiers": "", "superclass": "BufferedOutput", "interfaces": null, "fields...
17835696_31
class RepositoryFeatures { protected boolean isValidEndpointPath(String endpointName) { char[] charArray = endpointName.toCharArray(); for (int i = 0; i < charArray.length; i++) { char c = charArray[i]; if (i == 0) { if (c != '/') { return...
RepositoryFeatures features = new RepositoryFeatures(); assertFalse(features.isValidEndpointPath("parents")); assertFalse(features.isValidEndpointPath("/123parents")); assertFalse(features.isValidEndpointPath("/par?ents")); } }
[FOCAL] protected boolean RepositoryFeatures.isValidEndpointPath(String endpointName) [CLASS] class RepositoryFeatures [METRICS] loc=16 cc=5 branches=3 loops=1 returns=3 throws=0 nesting=3 [CALLS-EXTERNAL] String.toCharArray/0, Character.isAlphabetic/1 [PATH1] for(i < charArray.length)=T -> if(i == 0)=T -> if(c != '/')...
/* static context [FOCAL] protected boolean RepositoryFeatures.isValidEndpointPath(String endpointName) [PATH1] for(i < charArray.length)=T -> if(i == 0)=T -> if(c != '/')=F -> exit loop -> return true [PATH2] for(i < charArray.length)=T -> if(i == 0)=F -> if(!(Character.isAlphabetic(c) || c == '_' || c == '-'))=T -> r...
/* static context [FOCAL] protected boolean RepositoryFeatures.isValidEndpointPath(String endpointName) [PATH1] for(i < charArray.length)=T -> if(i == 0)=T -> if(c != '/')=F -> exit loop -> return true [PATH2] for(i < charArray.length)=T -> if(i == 0)=F -> if(!(Character.isAlphabetic(c) || c == '_' || c == '-'))=T -> r...
true
ok
{"focal": {"class": "RepositoryFeatures", "name": "isValidEndpointPath", "signature": "boolean isValidEndpointPath(String endpointName)", "start_line": 3, "modifiers": "protected", "params": [{"name": "endpointName", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "RepositoryFeatures", "kind": "cl...
17895094_359
class DefaultRegionWidgetPermissionEvaluator extends AbstractModelPermissionEvaluator<RegionWidget> { @Override public boolean hasPermission(Authentication authentication, RegionWidget regionWidget, Permission permission) { return hasPermission(authentication, regionWidget, permission, false); } ...
RaveSecurityContext raveSecurityContext = new RaveSecurityContext(VALID_USER_ID, "java.lang.String"); expect(mockAuthentication.getPrincipal()).andReturn(user); replay(mockAuthentication); defaultRegionWidgetPermissionEvaluator.hasPermission(mockAuthentication, raveSecurityContext, Regi...
[FOCAL] @Override public boolean DefaultRegionWidgetPermissionEvaluator.hasPermission(Authentication authentication, RegionWidget regionWidget, Permission permission) [CLASS] class DefaultRegionWidgetPermissionEvaluator extends AbstractModelPermissionEvaluator<RegionWidget> [METRICS] loc=4 cc=1 branches=0 loops=0 retur...
/* static context [FOCAL] @Override public boolean DefaultRegionWidgetPermissionEvaluator.hasPermission(Authentication authentication, RegionWidget regionWidget, Permission permission) [INPUTS] branches=- | result=authentication, permission, regionWidget [CALLS-INTERNAL] boolean hasPermission(Authentication authenticat...
/* static context [FOCAL] @Override public boolean DefaultRegionWidgetPermissionEvaluator.hasPermission(Authentication authentication, RegionWidget regionWidget, Permission permission) [INPUTS] branches=- | result=authentication, permission, regionWidget [CALLS-INTERNAL] boolean hasPermission(Authentication authenticat...
true
ok
{"focal": {"class": "DefaultRegionWidgetPermissionEvaluator", "name": "hasPermission", "signature": "boolean hasPermission(Authentication authentication, RegionWidget regionWidget, Permission permission)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "authentication", "type": "Authentication"},...
17905830_5
class PreMalletParallelization extends Thread { String parse(String wikiOrigText, WikiIDTitlePair id_title, boolean csvOrReadable) throws CompilerException, LinkTargetException, EngineException { WikiConfig config = DefaultConfigEn.generate(); WtEngineImpl engine = new WtEngineImpl(config); // Retrieve a p...
// FIXME russisch, zeilenende vom buffered reader macht Probleme String test = this.parsedWikiTextReadable; if (test.endsWith("\n")) { test = test.substring(0, test.length() - 1); } String test2; test2 = this.pm.parse(inputWikiOriginal, new WikiIDTitlePair(0, "test"), false); assertThat(test2).isEqua...
[FOCAL] String PreMalletParallelization.parse(String wikiOrigText, WikiIDTitlePair id_title, boolean csvOrReadable) [CLASS] class PreMalletParallelization extends Thread [METRICS] loc=19 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] DefaultConfigEn.generate/0, PageTitle.make/2, WikiIDTitlePair.g...
/* static context [FOCAL] String PreMalletParallelization.parse(String wikiOrigText, WikiIDTitlePair id_title, boolean csvOrReadable) [INPUTS] branches=- | result=id_title, wikiOrigText [COLLABORATORS] param id_title:WikiIDTitlePair getWikiTitle/0 [EXCEPTIONS] declares CompilerException, LinkTargetException, EngineExce...
/* static context [FOCAL] String PreMalletParallelization.parse(String wikiOrigText, WikiIDTitlePair id_title, boolean csvOrReadable) [INPUTS] branches=- | result=id_title, wikiOrigText [COLLABORATORS] param id_title:WikiIDTitlePair getWikiTitle/0 [EXCEPTIONS] declares CompilerException, LinkTargetException, EngineExce...
true
ok
{"focal": {"class": "PreMalletParallelization", "name": "parse", "signature": "String parse(String wikiOrigText, WikiIDTitlePair id_title, boolean csvOrReadable) throws CompilerException, LinkTargetException, EngineException", "start_line": 3, "modifiers": "", "params": [{"name": "wikiOrigText", "type": "String"}, {"na...
17912611_38
class Future implements java.util.concurrent.Future<T> { private T get(int msecs) throws ExecutionException, TimeoutException { try { return Objects.uncheckedCast(qiFutureCallGet(_fut, msecs)); } catch (Exception exception) { Throwable throwable = exception; ...
System.out.println("testGetTimeoutSuccess..."); Future<String> fut = null; // Call a 2s long function try { fut = proxy.call("longReply", "plaf"); } catch (DynamicCallException e) { System.out.println("Error calling answer function : " + e.getMess...
[FOCAL] private T Future.get(int msecs) [CLASS] class Future implements java.util.concurrent.Future<T> [METRICS] loc=33 cc=7 branches=4 loops=1 returns=1 throws=4 nesting=4 [CALLS-INTERNAL] Object qiFutureCallGet(long pFuture, int msecs) [CALLS-EXTERNAL] Objects.uncheckedCast/1, NativeTools.obtainRealException/1, Throw...
/* static context [FOCAL] private T Future.get(int msecs) [THROWS-WHEN] (CancellationException) throwable when try-body throws && throwable != null && throwable instanceof CancellationException [THROWS-WHEN] (TimeoutException) throwable when try-body throws && throwable != null && !(throwable instanceof CancellationExc...
/* static context [FOCAL] private T Future.get(int msecs) [THROWS-WHEN] (CancellationException) throwable when try-body throws && throwable != null && throwable instanceof CancellationException [THROWS-WHEN] (TimeoutException) throwable when try-body throws && throwable != null && !(throwable instanceof CancellationExc...
true
ok
{"focal": {"class": "Future", "name": "get", "signature": "T get(int msecs) throws ExecutionException, TimeoutException", "start_line": 3, "modifiers": "private", "params": [{"name": "msecs", "type": "int"}], "return_type": "T"}, "class_info": {"name": "Future", "kind": "class", "modifiers": "", "superclass": null, "in...
17919097_179
class JobPlanner { TaskDag createTaskDag() { long start = System.currentTimeMillis(); TaskDag taskDag = new TaskDag(); List<ProvisionerAction> actionOrder = actions.getActionOrder().get(clusterAction); for (Node node : nodeMap.values()) { if (!shouldPlanNode(node.getId())) { continue; ...
Service s1 = Service.builder().setName("s1").build(); Node node1 = new Node("node1", "1", ImmutableSet.<Service>of(s1), NodeProperties.builder().setHostname("host1").addIPAddress("access_v4", "ip1").build()); Node node2 = new Node("node2", "1", ImmutableSet.<Service>of(s1), ...
[FOCAL] TaskDag JobPlanner.createTaskDag() [CLASS] class JobPlanner [METRICS] loc=21 cc=5 branches=2 loops=2 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] boolean shouldPlanNode(String nodeId); boolean shouldPlanService(String serviceName); void addDependencies(TaskDag taskDag, List<ProvisionerAction> actionOrder, Serv...
/* static context [FOCAL] TaskDag JobPlanner.createTaskDag() [PATH1] foreach(Node node : nodeMap.values())=T -> if(!shouldPlanNode(node.getId()))=F -> foreach(Service service : node.getServices())=T -> if(!shouldPlanService(service.getName()))=T -> exit loop -> exit loop -> return taskDag [PATH2] foreach(Node node : no...
/* static context [FOCAL] TaskDag JobPlanner.createTaskDag() [PATH1] foreach(Node node : nodeMap.values())=T -> if(!shouldPlanNode(node.getId()))=F -> foreach(Service service : node.getServices())=T -> if(!shouldPlanService(service.getName()))=T -> exit loop -> exit loop -> return taskDag [PATH2] foreach(Node node : no...
true
ok
{"focal": {"class": "JobPlanner", "name": "createTaskDag", "signature": "TaskDag createTaskDag()", "start_line": 3, "modifiers": "", "params": [], "return_type": "TaskDag"}, "class_info": {"name": "JobPlanner", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "CHEF_ACTION", ...