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 |
|---|---|---|---|---|---|---|---|---|
26698596_2 | class ConfigLoader {
public T getTestConfig() {
try {
LOGGER.info(String.format("Loading config from: %s", configFileName));
final String substitutedString = substitutor.replace(new String(
ByteStreams.toByteArray(this.getClass().getClassLoader().getResourceAsStr... | ConfigLoader<DummyConfiguration> dummyConfigurationConfigLoader = new ConfigLoader<>(
DummyConfiguration.class,
CONFIG_FILE,
varNotFound
);
assertThat(dummyConfigurationConfigLoader.getTestConfig().getSomeDummyEnvAttribute(), CoreMatchers.is("defau... | [FOCAL] public T ConfigLoader.getTestConfig()
[CLASS] class ConfigLoader
[METRICS] loc=12 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] LOGGER.info/1, String.format/2, substitutor.replace/1, ByteStreams.toByteArray/1, this.getClass().getClassLoader().getResourceAsStream/1, this.getClass().getCla... | /* static context
[FOCAL] public T ConfigLoader.getTestConfig()
[THROWS-WHEN] RuntimeException when try-body throws
[PATH1] try-body throws -> throw new RuntimeException(e)
[PATH2] return reader.readValue(substitutedString)
[COLLABORATORS] field substitutor replace/1; field reader readValue/1
[EXCEPTIONS] throws Runtim... | /* static context
[FOCAL] public T ConfigLoader.getTestConfig()
[THROWS-WHEN] RuntimeException when try-body throws
[PATH1] try-body throws -> throw new RuntimeException(e)
[PATH2] return reader.readValue(substitutedString)
[COLLABORATORS] field substitutor replace/1; field reader readValue/1
[EXCEPTIONS] throws Runtim... | true | ok | {"focal": {"class": "ConfigLoader", "name": "getTestConfig", "signature": "T getTestConfig()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "T"}, "class_info": {"name": "ConfigLoader", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "CONFIG_FILE", "t... |
26727748_0 | class CapacityOverviewController extends Controller<CapacityOverviewView> implements FetchUnitsEvent.Handler {
@Override
public void onUnitsFetched(FetchUnitsEvent event) {
units = new ArrayList<>(event.getUnits());
sortUnits(Unit.Properties.name, true);
}
public CapacityOverviewContr... | capacityOverviewController.onUnitsFetched(mockEvent);
verify(mockView).setUnits(setUnitsArgument.capture());
assertFalse(setUnitsArgument.getValue().isEmpty());
}
} | [FOCAL] @Override public void CapacityOverviewController.onUnitsFetched(FetchUnitsEvent event)
[CLASS] class CapacityOverviewController extends Controller<CapacityOverviewView> implements FetchUnitsEvent.Handler
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void sortUnits(Unit.Pr... | /* static context
[FOCAL] @Override public void CapacityOverviewController.onUnitsFetched(FetchUnitsEvent event)
[COLLABORATORS] param event:FetchUnitsEvent getUnits/0
[CALLS-INTERNAL] void sortUnits(Unit.Properties property, boolean ascending)
[NEW] ArrayList<>
[CALLS-EXTERNAL] FetchUnitsEvent.getUnits/0
*/
| /* static context
[FOCAL] @Override public void CapacityOverviewController.onUnitsFetched(FetchUnitsEvent event)
[COLLABORATORS] param event:FetchUnitsEvent getUnits/0
[CALLS-INTERNAL] void sortUnits(Unit.Properties property, boolean ascending)
[NEW] ArrayList<>
[CALLS-EXTERNAL] FetchUnitsEvent.getUnits/0
*/
class Capa... | true | ok | {"focal": {"class": "CapacityOverviewController", "name": "onUnitsFetched", "signature": "void onUnitsFetched(FetchUnitsEvent event)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "event", "type": "FetchUnitsEvent"}], "return_type": "void"}, "class_info": {"name": "CapacityOverviewController", ... |
26745548_501 | class GatewayContextResolver {
public GatewayContext resolve(GatewayConfigDocument gatewayConfigDoc)
throws Exception {
return resolve(gatewayConfigDoc, System.getProperties());
}
public GatewayContextResolver(File configDir, File webDir, File tempDir);
public GatewayContextResol... | boolean sawExpectedEx = false;
String expectedLogMessage = "Exception .* caught loading file .*truststore-JCEKS.db.* you may need to specify " +
"\"<type>JCEKS</type>\" in the gateway configuration file";
String expected = "Invalid keystore format";
LogMessageInspector i... | [FOCAL] public GatewayContext GatewayContextResolver.resolve(GatewayConfigDocument gatewayConfigDoc)
[CLASS] class GatewayContextResolver
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] GatewayContext resolve(GatewayConfigDocument gatewayConfigDoc, Properties configuration)
[CALLS-... | /* static context
[FOCAL] public GatewayContext GatewayContextResolver.resolve(GatewayConfigDocument gatewayConfigDoc)
[INPUTS] branches=- | result=gatewayConfigDoc
[EXCEPTIONS] declares Exception
[CALLS-INTERNAL] GatewayContext resolve(GatewayConfigDocument gatewayConfigDoc, Properties configuration)
[CALLS-EXTERNAL] ... | /* static context
[FOCAL] public GatewayContext GatewayContextResolver.resolve(GatewayConfigDocument gatewayConfigDoc)
[INPUTS] branches=- | result=gatewayConfigDoc
[EXCEPTIONS] declares Exception
[CALLS-INTERNAL] GatewayContext resolve(GatewayConfigDocument gatewayConfigDoc, Properties configuration)
[CALLS-EXTERNAL] ... | true | ok | {"focal": {"class": "GatewayContextResolver", "name": "resolve", "signature": "GatewayContext resolve(GatewayConfigDocument gatewayConfigDoc) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "gatewayConfigDoc", "type": "GatewayConfigDocument"}], "return_type": "GatewayContext"}, "class_inf... |
26768771_42 | class LoremIpsum {
public int getNumWords()
{
return words == null ? 0 : words.length;
}
public LoremIpsum();
public LoremIpsum(final String text_);
public int getNumParagraphs();
public int getNumSentences();
public String getText();
public String getParagraph(final int i_);
public String getSentence(... | Assert.assertEquals(EXPECTED_WORDS.length, loremIpsum.getNumWords());
}
} | [FOCAL] public int LoremIpsum.getNumWords()
[CLASS] class LoremIpsum
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] LoremIpsum(); LoremIpsum(String text_); int getNumParagraphs(); int getNumSentences(); String getText(); String getParagraph(int i_); String getSentence(int i_); Stri... | /* static context
[FOCAL] public int LoremIpsum.getNumWords()
*/
| /* static context
[FOCAL] public int LoremIpsum.getNumWords()
*/
class LoremIpsum {
public int getNumWords()
{
return words == null ? 0 : words.length;
}
public LoremIpsum();
public LoremIpsum(final String text_);
public int getNumParagraphs();
public int getNumSentences();
public String getText();
publ... | true | ok | {"focal": {"class": "LoremIpsum", "name": "getNumWords", "signature": "int getNumWords()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "LoremIpsum", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "RAW_TEXT", "type": "... |
26810298_359 | class DocumentFlattener {
public List<EntityObject> flatten(Object document) throws InvalidPathException
{
if (pathToEntity == null) {
return Arrays.asList(new EntityObject(document));
}
List<EntityObject> entityNodes = new ArrayList<>(entitiesPerDocument);
EntityObject root = new EntityObject(document);
... | DocumentFlattener df = new DocumentFlattener(new Path(new String[0]), 1);
List<EntityObject> records = df.flatten(taxon);
assertEquals("01", 1, records.size());
assertTrue("02", records.get(0).getEntity() == taxon);
assertTrue("03", records.get(0).getDocument() == taxon);
}
} | [FOCAL] public List<EntityObject> DocumentFlattener.flatten(Object document)
[CLASS] class DocumentFlattener
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] void flatten(EntityObject node, Path path, List<EntityObject> entities)
[CALLS-EXTERNAL] Arrays.asList/1
[NEW] EntityObject,... | /* static context
[FOCAL] public List<EntityObject> DocumentFlattener.flatten(Object document)
[PATH1] if(pathToEntity == null)=T -> return Arrays.asList(new EntityObject(document))
[PATH2] if(pathToEntity == null)=F -> return entityNodes
[INPUTS] branches=- | result=document
[EXCEPTIONS] declares InvalidPathException
... | /* static context
[FOCAL] public List<EntityObject> DocumentFlattener.flatten(Object document)
[PATH1] if(pathToEntity == null)=T -> return Arrays.asList(new EntityObject(document))
[PATH2] if(pathToEntity == null)=F -> return entityNodes
[INPUTS] branches=- | result=document
[EXCEPTIONS] declares InvalidPathException
... | true | ok | {"focal": {"class": "DocumentFlattener", "name": "flatten", "signature": "List<EntityObject> flatten(Object document) throws InvalidPathException", "start_line": 3, "modifiers": "public", "params": [{"name": "document", "type": "Object"}], "return_type": "List<EntityObject>"}, "class_info": {"name": "DocumentFlattener"... |
26845372_0 | class JsonPointerEditor {
public JsonNode getValue() {
return root.at(pointer);
}
public JsonPointerEditor( JsonNode root, JsonPointer pointer );
public JsonNode getRoot();
public JsonNode setValue( JsonNode value );
private ObjectMapper mapper;
JsonNodeFactory factory;
}
class JsonPointerEdit... | JsonNode node = mapper.readValue("{\"key\": {\"sub\": \"value\"}}", JsonNode.class);
JsonPointer pointer = JsonPointer.compile("/key/sub");
JsonPointerEditor editor = new JsonPointerEditor(node, pointer);
assertThat("value", equalTo(editor.getValue().asText()));
}
} | [FOCAL] public JsonNode JsonPointerEditor.getValue()
[CLASS] class JsonPointerEditor
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] root.at/1
[COLLABORATORS] field root at/1
[CLASS-MEMBERS] JsonPointerEditor(JsonNode root, JsonPointer pointer); JsonNode getRoot(); JsonNode setValu... | /* static context
[FOCAL] public JsonNode JsonPointerEditor.getValue()
[COLLABORATORS] field root at/1
[CALLS-EXTERNAL] root.at/1
*/
| /* static context
[FOCAL] public JsonNode JsonPointerEditor.getValue()
[COLLABORATORS] field root at/1
[CALLS-EXTERNAL] root.at/1
*/
class JsonPointerEditor {
public JsonNode getValue() {
return root.at(pointer);
}
public JsonPointerEditor( JsonNode root, JsonPointer pointer );
public JsonNode getRoot()... | true | ok | {"focal": {"class": "JsonPointerEditor", "name": "getValue", "signature": "JsonNode getValue()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "JsonNode"}, "class_info": {"name": "JsonPointerEditor", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "ma... |
26861802_25 | class ReadOnlyStore extends AbstractStore {
@Nonnegative
@Override
public <V> int appendValue(SingleFeatureBean feature, V value) {
throw e.get();
}
public ReadOnlyStore();
@Override public void save();
@Override public void containerFor(Id id, SingleFeatureBean container);
@... | assertThat(
catchThrowable(() -> store.appendValue(mock(SingleFeatureBean.class), mock(Object.class)))
).isExactlyInstanceOf(READONLY_EXCEPTION_TYPE);
}
} | [FOCAL] @Nonnegative @Override public int ReadOnlyStore.appendValue(SingleFeatureBean feature, V value)
[CLASS] class ReadOnlyStore extends AbstractStore
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=1 nesting=0
[CALLS-EXTERNAL] e.get/0
[EXCEPTIONS] throws throw e.get()
[THROWS-WHEN] e.get() when always
[INP... | /* static context
[FOCAL] @Nonnegative @Override public int ReadOnlyStore.appendValue(SingleFeatureBean feature, V value)
[THROWS-WHEN] e.get() when always
[INPUTS] branches=- | result=- | unused=feature, value
[COLLABORATORS] field e get/0
[EXCEPTIONS] throws throw e.get()
[CALLS-EXTERNAL] e.get/0
*/
| /* static context
[FOCAL] @Nonnegative @Override public int ReadOnlyStore.appendValue(SingleFeatureBean feature, V value)
[THROWS-WHEN] e.get() when always
[INPUTS] branches=- | result=- | unused=feature, value
[COLLABORATORS] field e get/0
[EXCEPTIONS] throws throw e.get()
[CALLS-EXTERNAL] e.get/0
*/
class ReadOnlySto... | true | ok | {"focal": {"class": "ReadOnlyStore", "name": "appendValue", "signature": "int appendValue(SingleFeatureBean feature, V value)", "start_line": 3, "modifiers": "@Nonnegative @Override public", "params": [{"name": "feature", "type": "SingleFeatureBean"}, {"name": "value", "type": "V"}], "return_type": "int"}, "class_info"... |
26862250_20 | class DefaultOAuth2ClientDetailsEntityService implements ClientDetailsEntityService {
@Override
public ClientDetailsEntity updateClient(ClientDetailsEntity oldClient, ClientDetailsEntity newClient) throws IllegalArgumentException {
if (oldClient != null && newClient != null) {
for (String uri : newClient.getRe... |
ClientDetailsEntity oldClient = Mockito.mock(ClientDetailsEntity.class);
ClientDetailsEntity newClient = Mockito.mock(ClientDetailsEntity.class);
Mockito.when(newClient.isAllowRefresh()).thenReturn(true);
// scopes returned by client entities are Strings
@SuppressWarnings("unchecked")
Set<String> scopes ... | [FOCAL] @Override public ClientDetailsEntity DefaultOAuth2ClientDetailsEntityService.updateClient(ClientDetailsEntity oldClient, ClientDetailsEntity newClient)
[CLASS] class DefaultOAuth2ClientDetailsEntityService implements ClientDetailsEntityService
[METRICS] loc=43 cc=12 branches=6 loops=2 returns=1 throws=5 nesting... | /* static context
[FOCAL] @Override public ClientDetailsEntity DefaultOAuth2ClientDetailsEntityService.updateClient(ClientDetailsEntity oldClient, ClientDetailsEntity newClient)
[THROWS-WHEN] IllegalArgumentException when oldClient != null && newClient != null && foreach(String uri : newClient.getRegisteredRedirectUri(... | /* static context
[FOCAL] @Override public ClientDetailsEntity DefaultOAuth2ClientDetailsEntityService.updateClient(ClientDetailsEntity oldClient, ClientDetailsEntity newClient)
[THROWS-WHEN] IllegalArgumentException when oldClient != null && newClient != null && foreach(String uri : newClient.getRegisteredRedirectUri(... | true | ok | {"focal": {"class": "DefaultOAuth2ClientDetailsEntityService", "name": "updateClient", "signature": "ClientDetailsEntity updateClient(ClientDetailsEntity oldClient, ClientDetailsEntity newClient) throws IllegalArgumentException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "oldClient", "type":... |
26873147_130 | class TopicManagerImpl implements TopicManager {
@Override
public CompletableFuture<Void> createTopic(
String clusterId,
String topicName,
int partitionsCount,
short replicationFactor,
Map<String, String> configs) {
requireNonNull(topicName);
NewTopic createTopicRequest =
... | expect(clusterManager.getCluster(CLUSTER_ID)).andReturn(completedFuture(Optional.empty()));
replay(clusterManager);
try {
topicManager.createTopic(
CLUSTER_ID,
TOPIC_1.getName(),
TOPIC_1.getPartitions().size(),
TOPIC_1.getReplicationFactor(),
singleto... | [FOCAL] @Override public CompletableFuture<Void> TopicManagerImpl.createTopic(String clusterId, String topicName, int partitionsCount, short replicationFactor, Map<String, String> configs)
[CLASS] class TopicManagerImpl implements TopicManager
[METRICS] loc=19 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS... | /* static context
[FOCAL] @Override public CompletableFuture<Void> TopicManagerImpl.createTopic(String clusterId, String topicName, int partitionsCount, short replicationFactor, Map<String, String> configs)
[INPUTS] branches=- | result=clusterId, configs, partitionsCount, replicationFactor, topicName, adminClient, clus... | /* static context
[FOCAL] @Override public CompletableFuture<Void> TopicManagerImpl.createTopic(String clusterId, String topicName, int partitionsCount, short replicationFactor, Map<String, String> configs)
[INPUTS] branches=- | result=clusterId, configs, partitionsCount, replicationFactor, topicName, adminClient, clus... | true | ok | {"focal": {"class": "TopicManagerImpl", "name": "createTopic", "signature": "CompletableFuture<Void> createTopic(String clusterId, String topicName, int partitionsCount, short replicationFactor, Map<String, String> configs)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "clusterId", "type": "St... |
26888367_24 | class OHCacheBuilder {
public OHCacheBuilder<K, V> segmentCount(int segmentCount)
{
if (segmentCount < -1)
throw new IllegalArgumentException("segmentCount:" + segmentCount);
this.segmentCount = segmentCount;
return this;
}
private OHCacheBuilder();
private st... | int cpus = Runtime.getRuntime().availableProcessors();
int segments = cpus * 2;
while (Integer.bitCount(segments) != 1)
segments++;
OHCacheBuilder<String, String> builder = OHCacheBuilder.newBuilder();
Assert.assertEquals(builder.getSegmentCount(), segments);
... | [FOCAL] public OHCacheBuilder<K, V> OHCacheBuilder.segmentCount(int segmentCount)
[CLASS] class OHCacheBuilder
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[NEW] IllegalArgumentException
[FIELDS] write=segmentCount
[EXCEPTIONS] throws IllegalArgumentException
[THROWS-WHEN] IllegalArgumentExcepti... | /* static context
[FOCAL] public OHCacheBuilder<K, V> OHCacheBuilder.segmentCount(int segmentCount)
[THROWS-WHEN] IllegalArgumentException when segmentCount < -1
[PATH1] if(segmentCount < -1)=T -> throw new IllegalArgumentException("segmentCount:" + segmentCount)
[PATH2] if(segmentCount < -1)=F -> return this
[INPUTS] ... | /* static context
[FOCAL] public OHCacheBuilder<K, V> OHCacheBuilder.segmentCount(int segmentCount)
[THROWS-WHEN] IllegalArgumentException when segmentCount < -1
[PATH1] if(segmentCount < -1)=T -> throw new IllegalArgumentException("segmentCount:" + segmentCount)
[PATH2] if(segmentCount < -1)=F -> return this
[INPUTS] ... | true | ok | {"focal": {"class": "OHCacheBuilder", "name": "segmentCount", "signature": "OHCacheBuilder<K, V> segmentCount(int segmentCount)", "start_line": 3, "modifiers": "public", "params": [{"name": "segmentCount", "type": "int"}], "return_type": "OHCacheBuilder<K, V>"}, "class_info": {"name": "OHCacheBuilder", "kind": "class",... |
26904455_9 | class WebPushFrameListener extends Http2FrameAdapter {
void shutdown() {
monitoredStreams.values().stream().forEach(client -> client.ctx.close());
monitoredStreams.clear();
acksStreams.values().stream().forEach(client -> client.ctx.close());
acksStreams.clear();
}
WebPush... | final String subscriptionId = "subscriptionId";
final String pushResourceId = "pushResourceId";
final ChannelHandlerContext ctx = mockChannelHandlerContext(subscriptionId);
final Http2ConnectionEncoder encoder = mockEncoder(w -> w.thenReturn(pushPath(pushResourceId))
.the... | [FOCAL] void WebPushFrameListener.shutdown()
[CLASS] class WebPushFrameListener extends Http2FrameAdapter
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] monitoredStreams.values().stream().forEach/1, monitoredStreams.values().stream/0, monitoredStreams.values/0, client.ctx.close/0,... | /* static context
[FOCAL] void WebPushFrameListener.shutdown()
[COLLABORATORS] field monitoredStreams values/0,clear/0; field acksStreams values/0,clear/0
[CALLS-EXTERNAL] monitoredStreams.values().stream().forEach/1, monitoredStreams.values().stream/0, monitoredStreams.values/0, client.ctx.close/0, monitoredStreams.cl... | /* static context
[FOCAL] void WebPushFrameListener.shutdown()
[COLLABORATORS] field monitoredStreams values/0,clear/0; field acksStreams values/0,clear/0
[CALLS-EXTERNAL] monitoredStreams.values().stream().forEach/1, monitoredStreams.values().stream/0, monitoredStreams.values/0, client.ctx.close/0, monitoredStreams.cl... | true | ok | {"focal": {"class": "WebPushFrameListener", "name": "shutdown", "signature": "void shutdown()", "start_line": 3, "modifiers": "", "params": [], "return_type": "void"}, "class_info": {"name": "WebPushFrameListener", "kind": "class", "modifiers": "", "superclass": "Http2FrameAdapter", "interfaces": null, "fields": [{"nam... |
26907542_0 | class FilterConverterHelper {
public static Date dateConvert(String value) {
if (value == null) {
return null;
}
Map<String, String> formats = new HashMap<>();
formats.put("dd.MM.yyyy HH:mm", "^\\d{2}\\.\\d{2}\\.\\d{4}\\s+\\d{2}:\\d{2}$");
formats.put("dd-MM-y... | for (Map.Entry<String, String> entry : asserts.entrySet()){
Date expected = new SimpleDateFormat(entry.getValue()).parse(entry.getKey());
assertEquals(expected, FilterConverterHelper.dateConvert(entry.getKey()));
}
}
} | [FOCAL] public static Date FilterConverterHelper.dateConvert(String value)
[CLASS] class FilterConverterHelper
[METRICS] loc=36 cc=6 branches=3 loops=1 returns=3 throws=0 nesting=4
[CALLS-EXTERNAL] Map<String, String>.put/2, Map<String, String>.entrySet/0, value.trim().matches/1, String.trim/0, Map.Entry<String, String... | /* static context
[FOCAL] public static Date FilterConverterHelper.dateConvert(String value)
[PATH1] if(value == null)=F -> foreach(Map.Entry<String, String> format : formats.entrySet())=T -> try-body throws -> exit loop -> return null
[PATH2] if(value == null)=F -> foreach(Map.Entry<String, String> format : formats.en... | /* static context
[FOCAL] public static Date FilterConverterHelper.dateConvert(String value)
[PATH1] if(value == null)=F -> foreach(Map.Entry<String, String> format : formats.entrySet())=T -> try-body throws -> exit loop -> return null
[PATH2] if(value == null)=F -> foreach(Map.Entry<String, String> format : formats.en... | true | ok | {"focal": {"class": "FilterConverterHelper", "name": "dateConvert", "signature": "Date dateConvert(String value)", "start_line": 3, "modifiers": "public static", "params": [{"name": "value", "type": "String"}], "return_type": "Date"}, "class_info": {"name": "FilterConverterHelper", "kind": "class", "modifiers": "", "su... |
26921116_545 | class SammonMapping {
public static SammonMapping of(double[][] proximity) {
return of(proximity, new Properties());
}
public SammonMapping(double stress, double[][] coordinates);
public static SammonMapping of(double[][] proximity, int k);
public static SammonMapping of(double[][] proxi... | System.out.println("learn");
double[][] points = {
{-41.5471709650684, 18.9187013341311},
{40.7205435629563, 17.8623927312285},
{49.9308397575605, 26.6606879579547},
{-10.3370642672217, 9.00224445858628},
{-35.0083289866438, -3.70032099791862}... | [FOCAL] public static SammonMapping SammonMapping.of(double[][] proximity)
[CLASS] class SammonMapping
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] SammonMapping of(double[][] proximity, int k)
[NEW] Properties
[INPUTS] branches=- | result=proximity
[DATAFLOW] proximity@param->L... | /* static context
[FOCAL] public static SammonMapping SammonMapping.of(double[][] proximity)
[INPUTS] branches=- | result=proximity
[CALLS-INTERNAL] SammonMapping of(double[][] proximity, int k)
[NEW] Properties
*/
| /* static context
[FOCAL] public static SammonMapping SammonMapping.of(double[][] proximity)
[INPUTS] branches=- | result=proximity
[CALLS-INTERNAL] SammonMapping of(double[][] proximity, int k)
[NEW] Properties
*/
class SammonMapping {
public static SammonMapping of(double[][] proximity) {
return of(proxi... | true | ok | {"focal": {"class": "SammonMapping", "name": "of", "signature": "SammonMapping of(double[][] proximity)", "start_line": 3, "modifiers": "public static", "params": [{"name": "proximity", "type": "double[][]"}], "return_type": "SammonMapping"}, "class_info": {"name": "SammonMapping", "kind": "class", "modifiers": "", "su... |
26949678_0 | class TrackResource {
static Predicate<TargetInfo> createTargetFilterPredicate(Set<Integer> mmsis, Set<Area> baseAreas, Set<Area> areas) {
Predicate<TargetInfo> mmsiPredicate = null;
if (mmsis != null && mmsis.size() > 0) {
mmsiPredicate = targetInfo -> mmsis.contains(targetInfo.getMms... | Predicate<TargetInfo> predicate = TrackResource.createTargetFilterPredicate(
Sets.newHashSet(219000000, 219000001, 219000002),
Sets.newHashSet(
BoundingBox.create(Position.create(55.0, 10.0), Position.create(56.2, 12), CoordinateSystem.CARTESIAN)
),
... | [FOCAL] static Predicate<TargetInfo> TrackResource.createTargetFilterPredicate(Set<Integer> mmsis, Set<Area> baseAreas, Set<Area> areas)
[CLASS] class TrackResource
[METRICS] loc=34 cc=9 branches=8 loops=0 returns=4 throws=0 nesting=3
[CALLS-EXTERNAL] Set<Integer>.size/0, Set<Integer>.contains/1, targetInfo.getMmsi/0, ... | /* static context
[FOCAL] static Predicate<TargetInfo> TrackResource.createTargetFilterPredicate(Set<Integer> mmsis, Set<Area> baseAreas, Set<Area> areas)
[PATH1] if(mmsis != null && mmsis.size() > 0)=T -> if(baseAreas != null && baseAreas.size() > 0)=T -> if(areas != null && areas.size() > 0)=T -> if(baseAreaPredicate... | /* static context
[FOCAL] static Predicate<TargetInfo> TrackResource.createTargetFilterPredicate(Set<Integer> mmsis, Set<Area> baseAreas, Set<Area> areas)
[PATH1] if(mmsis != null && mmsis.size() > 0)=T -> if(baseAreas != null && baseAreas.size() > 0)=T -> if(areas != null && areas.size() > 0)=T -> if(baseAreaPredicate... | true | ok | {"focal": {"class": "TrackResource", "name": "createTargetFilterPredicate", "signature": "Predicate<TargetInfo> createTargetFilterPredicate(Set<Integer> mmsis, Set<Area> baseAreas, Set<Area> areas)", "start_line": 3, "modifiers": "static", "params": [{"name": "mmsis", "type": "Set<Integer>"}, {"name": "baseAreas", "typ... |
26951043_22 | class DBConsumer extends JCasAnnotator_ImplBase {
@Override
public void process(JCas jcas) {
Integer documentID = documentMapperService.saveDocument(jcas,
analysisBatch, bStoreDocText, bStoreCAS, bInsertAnnotationContainmentLinks, setTypesToIgnore);
if (documentID != null && xmiOutputDirectory != null
&&... | // JCas jCas =
// JCasFactory.createJCasFromPath("src/main/resources/org/apache/ctakes/ytex/types/TypeSystem.xml");
String text = "Title: US Abdomen\n\nDr. Doolitle asked patient\nto take a deep breath\nand exhale slowly. Patient coughed. Prescribed acetominophen";
AnalysisEngine engine = TestUtils.createToke... | [FOCAL] @Override public void DBConsumer.process(JCas jcas)
[CLASS] class DBConsumer extends JCasAnnotator_ImplBase
[METRICS] loc=34 cc=7 branches=3 loops=0 returns=0 throws=0 nesting=5
[CALLS-EXTERNAL] documentMapperService.saveDocument/6, xmiOutputDirectory.length/0, File.exists/0, File.isDirectory/0, log.error/1, In... | /* static context
[FOCAL] @Override public void DBConsumer.process(JCas jcas)
[PATH1] if(documentID != null && xmiOutputDirectory != null && xmiOutputDirectory.length() > 0)=T -> if(!dirOut.exists() && !dirOut.isDirectory())=F -> try-body throws -> if(writer != null)=T
[PATH2] if(documentID != null && xmiOutputDirector... | /* static context
[FOCAL] @Override public void DBConsumer.process(JCas jcas)
[PATH1] if(documentID != null && xmiOutputDirectory != null && xmiOutputDirectory.length() > 0)=T -> if(!dirOut.exists() && !dirOut.isDirectory())=F -> try-body throws -> if(writer != null)=T
[PATH2] if(documentID != null && xmiOutputDirector... | true | ok | {"focal": {"class": "DBConsumer", "name": "process", "signature": "void process(JCas jcas)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "jcas", "type": "JCas"}], "return_type": "void"}, "class_info": {"name": "DBConsumer", "kind": "class", "modifiers": "", "superclass": "JCasAnnotator_ImplBas... |
26956394_29 | class FileHelper {
public static boolean endsWithJarOrApkExtension(@NonNull String filePath) {
checkPreconditionsOnFilePath(filePath);
int initialCharacterOfAnExtensionIndex = filePath.lastIndexOf(DOT_SEPARATOR);
if (initialCharacterOfAnExtensionIndex == -1)
return false;
... | // WHEN + THEN
assertFalse(endsWithJarOrApkExtension(TEST_FILE_EXTENSION_NOT_FOR_A_CONTAINER));
}
} | [FOCAL] public static boolean FileHelper.endsWithJarOrApkExtension(String filePath)
[CLASS] class FileHelper
[METRICS] loc=13 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] void checkPreconditionsOnFilePath(String filePath)
[CALLS-EXTERNAL] String.lastIndexOf/1, String.substring/1, String.equalsI... | /* static context
[FOCAL] public static boolean FileHelper.endsWithJarOrApkExtension(String filePath)
[PATH1] if(initialCharacterOfAnExtensionIndex == -1)=T -> return false
[PATH2] if(initialCharacterOfAnExtensionIndex == -1)=F -> return fileExtension.equalsIgnoreCase(APK_EXTENSION) || fileExtension.equa...
[INPUTS] br... | /* static context
[FOCAL] public static boolean FileHelper.endsWithJarOrApkExtension(String filePath)
[PATH1] if(initialCharacterOfAnExtensionIndex == -1)=T -> return false
[PATH2] if(initialCharacterOfAnExtensionIndex == -1)=F -> return fileExtension.equalsIgnoreCase(APK_EXTENSION) || fileExtension.equa...
[INPUTS] br... | true | ok | {"focal": {"class": "FileHelper", "name": "endsWithJarOrApkExtension", "signature": "boolean endsWithJarOrApkExtension(String filePath)", "start_line": 3, "modifiers": "public static", "params": [{"name": "filePath", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "FileHelper", "kind": "class", "m... |
26958185_99 | class CsvBeanReader extends AbstractCsvReader implements ICsvBeanReader {
public <T> T read(final Class<T> clazz, final String... nameMapping) throws IOException {
if( clazz == null ) {
throw new NullPointerException("clazz should not be null");
} else if( nameMapping == null ) {
throw new NullPointerExc... |
final String[] header = beanReader.getHeader(true);
assertArrayEquals(HEADER, header);
assertEquals(JOHN, beanReader.read(CustomerBean.class, header, READ_PROCESSORS));
assertEquals(BOB, beanReader.read(CustomerBean.class, header, READ_PROCESSORS));
assertEquals(ALICE, beanReader.read(CustomerBean.class... | [FOCAL] public T CsvBeanReader.read(Class<T> clazz, String... nameMapping)
[CLASS] class CsvBeanReader extends AbstractCsvReader implements ICsvBeanReader
[METRICS] loc=10 cc=3 branches=2 loops=0 returns=1 throws=2 nesting=2
[CALLS-INTERNAL] T instantiateBean(Class<T> clazz); T readIntoBean(T bean, String[] nameMapping... | /* static context
[FOCAL] public T CsvBeanReader.read(Class<T> clazz, String... nameMapping)
[THROWS-WHEN] NullPointerException when clazz == null
[THROWS-WHEN] NullPointerException when !(clazz == null) && nameMapping == null
[PATH1] if(clazz == null)=F -> if(nameMapping == null)=T -> throw new NullPointerException("n... | /* static context
[FOCAL] public T CsvBeanReader.read(Class<T> clazz, String... nameMapping)
[THROWS-WHEN] NullPointerException when clazz == null
[THROWS-WHEN] NullPointerException when !(clazz == null) && nameMapping == null
[PATH1] if(clazz == null)=F -> if(nameMapping == null)=T -> throw new NullPointerException("n... | true | ok | {"focal": {"class": "CsvBeanReader", "name": "read", "signature": "T read(Class<T> clazz, String... nameMapping) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "clazz", "type": "Class<T>"}, {"name": "nameMapping", "type": "String..."}], "return_type": "T"}, "class_info": {"name": "CsvB... |
26971627_67 | class MrsImage implements AutoCloseable {
public long getWidth()
{
return getMetadata().getPixelBounds(getZoomlevel()).getWidth();
}
private MrsImage(MrsImageDataProvider provider, int zoomlevel);
@SuppressWarnings("squid:S1166") // Exceptions are ignored. This is OK. public static MrsImage open(MrsImageDataProvi... | Assert.fail("Not yet implemented");
}
} | [FOCAL] public long MrsImage.getWidth()
[CLASS] class MrsImage implements AutoCloseable
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] MrsPyramidMetadata getMetadata(); int getZoomlevel()
[CALLS-EXTERNAL] getMetadata().getPixelBounds(getZoomlevel()).getWidth/0, getMetadata().getPi... | /* static context
[FOCAL] public long MrsImage.getWidth()
[CALLS-INTERNAL] MrsPyramidMetadata getMetadata(); int getZoomlevel()
[CALLS-EXTERNAL] getMetadata().getPixelBounds(getZoomlevel()).getWidth/0, getMetadata().getPixelBounds/1
*/
| /* static context
[FOCAL] public long MrsImage.getWidth()
[CALLS-INTERNAL] MrsPyramidMetadata getMetadata(); int getZoomlevel()
[CALLS-EXTERNAL] getMetadata().getPixelBounds(getZoomlevel()).getWidth/0, getMetadata().getPixelBounds/1
*/
class MrsImage implements AutoCloseable {
public long getWidth()
{
return getMeta... | true | ok | {"focal": {"class": "MrsImage", "name": "getWidth", "signature": "long getWidth()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "long"}, "class_info": {"name": "MrsImage", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "AutoCloseable", "fields": [{"name": "epsilon", "type":... |
27013933_3 | class Reflection {
public static <T> List<Field> getDeclaredFields(Class<T> clazz, Class<? super T> upToExcluding){
return getAllFields(clazz, Optional.<Class<? super T>>ofNullable(upToExcluding), Predicates.alwaysTrue());
}
public static List<Field> getAllFields(Class<T> clazz);
public static List<Field> getAl... | List<Field> declaredFields = Reflection.getAllFields(ClassC.class, Object.class, new FieldAnnotationPredicate(InjectView.class));
assertEquals(2, declaredFields.size());
declaredFields = Reflection.getAllFields(ClassC.class, new FieldAnnotationPredicate(InjectAttribute.class));
assertEquals(1, declaredFields.... | [FOCAL] public static List<Field> Reflection.getDeclaredFields(Class<T> clazz, Class<? super T> upToExcluding)
[CLASS] class Reflection
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] List<Field> getAllFields(Class<T> clazz, Class<? super T> upToExcluding, Predicate<? super Field> ... | /* static context
[FOCAL] public static List<Field> Reflection.getDeclaredFields(Class<T> clazz, Class<? super T> upToExcluding)
[INPUTS] branches=- | result=clazz, upToExcluding
[CALLS-INTERNAL] List<Field> getAllFields(Class<T> clazz, Class<? super T> upToExcluding, Predicate<? super Field> filter)
[CALLS-EXTERNAL] O... | /* static context
[FOCAL] public static List<Field> Reflection.getDeclaredFields(Class<T> clazz, Class<? super T> upToExcluding)
[INPUTS] branches=- | result=clazz, upToExcluding
[CALLS-INTERNAL] List<Field> getAllFields(Class<T> clazz, Class<? super T> upToExcluding, Predicate<? super Field> filter)
[CALLS-EXTERNAL] O... | true | ok | {"focal": {"class": "Reflection", "name": "getDeclaredFields", "signature": "List<Field> getDeclaredFields(Class<T> clazz, Class<? super T> upToExcluding)", "start_line": 3, "modifiers": "public static", "params": [{"name": "clazz", "type": "Class<T>"}, {"name": "upToExcluding", "type": "Class<? super T>"}], "return_ty... |
27024702_0 | class KeywordPartitioner implements Iterator<List<E>> {
public static <T> Stream<List<T>> partition(final Stream<T> stream, final Predicate<T> partitionSeparator) {
return new KeywordPartitioner<>(stream, partitionSeparator).asStream();
}
public KeywordPartitioner(final Stream<E> stream, final Pr... | assertEquals(asList(asList("Foo", "Bar", "ON"), asList("OFF", "was")),
partition(
Stream.of("Foo", "Bar", "ON", "Fire", "OFF", "was", "destroyed"),
s -> s.length() > 3)
.collect(Collectors.toList()));
assert... | [FOCAL] public static Stream<List<T>> KeywordPartitioner.partition(Stream<T> stream, Predicate<T> partitionSeparator)
[CLASS] class KeywordPartitioner implements Iterator<List<E>>
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] new KeywordPartitioner<>(stream, partitionSeparator).a... | /* static context
[FOCAL] public static Stream<List<T>> KeywordPartitioner.partition(Stream<T> stream, Predicate<T> partitionSeparator)
[INPUTS] branches=- | result=partitionSeparator, stream
[NEW] KeywordPartitioner<>
[CALLS-EXTERNAL] new KeywordPartitioner<>(stream, partitionSeparator).asStream/0
*/
| /* static context
[FOCAL] public static Stream<List<T>> KeywordPartitioner.partition(Stream<T> stream, Predicate<T> partitionSeparator)
[INPUTS] branches=- | result=partitionSeparator, stream
[NEW] KeywordPartitioner<>
[CALLS-EXTERNAL] new KeywordPartitioner<>(stream, partitionSeparator).asStream/0
*/
class KeywordPart... | true | ok | {"focal": {"class": "KeywordPartitioner", "name": "partition", "signature": "Stream<List<T>> partition(Stream<T> stream, Predicate<T> partitionSeparator)", "start_line": 3, "modifiers": "public static", "params": [{"name": "stream", "type": "Stream<T>"}, {"name": "partitionSeparator", "type": "Predicate<T>"}], "return_... |
27135187_45 | class XsdDataItem {
public XsdType getXsdType() {
return _xsdType;
}
public XsdDataItem(final CobolDataItem cobolDataItem,
final Cob2XsdConfig config, final XsdDataItem parent,
final int order, final List < String > nonUniqueCobolNames,
final RecognizerErrorHan... | CobolDataItem dataItem = new CobolDataItem("COBOL-CONDITION");
dataItem.setLevelNumber(88);
XsdDataItem xsdDataItem = new XsdDataItem(dataItem, defaultConfig,
null, 0, new ArrayList < String >(), _errorHandler);
assertEquals(XsdType.ENUM, xsdDataItem.getXsdType());
... | [FOCAL] public XsdType XsdDataItem.getXsdType()
[CLASS] class XsdDataItem
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] XsdDataItem(CobolDataItem cobolDataItem, Cob2XsdConfig config, XsdDataItem parent, int order, List < String > nonUniqueCobolNames, RecognizerErrorHandler errorHa... | /* static context
[FOCAL] public XsdType XsdDataItem.getXsdType()
*/
| /* static context
[FOCAL] public XsdType XsdDataItem.getXsdType()
*/
class XsdDataItem {
public XsdType getXsdType() {
return _xsdType;
}
public XsdDataItem(final CobolDataItem cobolDataItem,
final Cob2XsdConfig config, final XsdDataItem parent,
final int order, final List... | true | ok | {"focal": {"class": "XsdDataItem", "name": "getXsdType", "signature": "XsdType getXsdType()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "XsdType"}, "class_info": {"name": "XsdDataItem", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "_errorHandle... |
27135253_0 | class JUnitExporter extends ICitLabTestSuiteExporter {
@Override
public void generateOutput(TestSuite input, String fileName) {
new CVSExporter().generateOutput(input, fileName);
try {
JUnitTemplateWizard junitWizard = new JUnitTemplateWizard(
PlatformUI.getWorkbench(),
input,
fileName);
WizardDi... | JUnitExporter junitExporter = new JUnitExporter();
String testSuiteFileName = tmpDir.newFolder("test").getPath() + "/" + testSuiteName;
//assert that file does not exists before
assertTrue(! Files.exists(Paths.get(testSuiteFileName)));
//then call the generateOutput method
junitExporter.generateOutput(testS... | [FOCAL] @Override public void JUnitExporter.generateOutput(TestSuite input, String fileName)
[CLASS] class JUnitExporter extends ICitLabTestSuiteExporter
[METRICS] loc=18 cc=2 branches=0 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] new CVSExporter().generateOutput/2, PlatformUI.getWorkbench/0, Display.getDefau... | /* static context
[FOCAL] @Override public void JUnitExporter.generateOutput(TestSuite input, String fileName)
[PATH1] try-body throws
[EXCEPTIONS] catches Exception e
[NEW] CVSExporter, JUnitTemplateWizard, WizardDialog
[CALLS-EXTERNAL] new CVSExporter().generateOutput/2, PlatformUI.getWorkbench/0, Display.getDefault(... | /* static context
[FOCAL] @Override public void JUnitExporter.generateOutput(TestSuite input, String fileName)
[PATH1] try-body throws
[EXCEPTIONS] catches Exception e
[NEW] CVSExporter, JUnitTemplateWizard, WizardDialog
[CALLS-EXTERNAL] new CVSExporter().generateOutput/2, PlatformUI.getWorkbench/0, Display.getDefault(... | true | ok | {"focal": {"class": "JUnitExporter", "name": "generateOutput", "signature": "void generateOutput(TestSuite input, String fileName)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "input", "type": "TestSuite"}, {"name": "fileName", "type": "String"}], "return_type": "void"}, "class_info": {"name"... |
27145359_0 | class KDEPathFinder {
public static String[] getConfigPaths() {
return runKDE4Config("config");
}
public static String[] getIconPaths();
private static String[] runKDE4Config(String path);
}
class KDEPathFinderTest {
@Test
public void testGetConfigPaths() {
| String[] configPaths = KDEPathFinder.getConfigPaths();
Assert.assertTrue("Expected the KDE Path Finder to find at "
+ "least one path where configuration is stored.",
configPaths.length > 0);
for (String configPath : configPaths) {
Assert.assertTrue("Expected all paths to have non-zero "
+ "length... | [FOCAL] public static String[] KDEPathFinder.getConfigPaths()
[CLASS] class KDEPathFinder
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String[] runKDE4Config(String path)
[CLASS-MEMBERS] String[] getIconPaths(); String[] runKDE4Config(String path)
[TEST] KDEPathFinderTest: @Test... | /* static context
[FOCAL] public static String[] KDEPathFinder.getConfigPaths()
[CALLS-INTERNAL] String[] runKDE4Config(String path)
*/
| /* static context
[FOCAL] public static String[] KDEPathFinder.getConfigPaths()
[CALLS-INTERNAL] String[] runKDE4Config(String path)
*/
class KDEPathFinder {
public static String[] getConfigPaths() {
return runKDE4Config("config");
}
public static String[] getIconPaths();
private static String[] runKDE4Config(S... | true | ok | {"focal": {"class": "KDEPathFinder", "name": "getConfigPaths", "signature": "String[] getConfigPaths()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "String[]"}, "class_info": {"name": "KDEPathFinder", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": []... |
27191143_8 | class RxPresenter extends Presenter<View> {
public void add(Subscription subscription) {
subscriptions.add(subscription);
}
public Observable<View> view();
public void remove(Subscription subscription);
public void restartable(int restartableId, Func0<Subscription> factory);
public voi... | RxPresenter presenter = new RxPresenter();
Subscription mock = Mockito.mock(Subscription.class);
when(mock.isUnsubscribed()).thenReturn(false);
presenter.add(mock);
presenter.onDestroy();
verify(mock, times(1)).unsubscribe();
verify(mock, atLeastOnce()).isUnsubscr... | [FOCAL] public void RxPresenter.add(Subscription subscription)
[CLASS] class RxPresenter extends Presenter<View>
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] subscriptions.add/1
[COLLABORATORS] field subscriptions add/1
[DATAFLOW] subscription@param->L2
[CLASS-MEMBERS] Observabl... | /* static context
[FOCAL] public void RxPresenter.add(Subscription subscription)
[COLLABORATORS] field subscriptions add/1
[CALLS-EXTERNAL] subscriptions.add/1
*/
| /* static context
[FOCAL] public void RxPresenter.add(Subscription subscription)
[COLLABORATORS] field subscriptions add/1
[CALLS-EXTERNAL] subscriptions.add/1
*/
class RxPresenter extends Presenter<View> {
public void add(Subscription subscription) {
subscriptions.add(subscription);
}
public Obse... | true | ok | {"focal": {"class": "RxPresenter", "name": "add", "signature": "void add(Subscription subscription)", "start_line": 3, "modifiers": "public", "params": [{"name": "subscription", "type": "Subscription"}], "return_type": "void"}, "class_info": {"name": "RxPresenter", "kind": "class", "modifiers": "", "superclass": "Prese... |
27195248_0 | class EntityImporter {
public void importData() throws IOException {
String statementsWriter = getSettings().getProperty(STATEMENTS_WRITER_KEY,
FileStatementsWriter.class.getSimpleName());
if (statementsWriter.indexOf('.') < 0) {
statementsWriter = "org.fastnate.generator.statements." + statementsWriter;
... | final Properties settings = createDefaultSettings();
final EntityImporter entityImporter = new EntityImporter(settings);
final EntityManagerFactory emf = Persistence.createEntityManagerFactory("test", settings);
try {
final EntityManager em = emf.createEntityManager();
try {
try (Connection connectio... | [FOCAL] public void EntityImporter.importData()
[CLASS] class EntityImporter
[METRICS] loc=31 cc=7 branches=2 loops=0 returns=0 throws=4 nesting=3
[CALLS-INTERNAL] Properties getSettings(); void importData(Connection connection); void importData(EntitySqlGenerator generator, Connection connection)
[CALLS-EXTERNAL] getS... | /* static context
[FOCAL] public void EntityImporter.importData()
[THROWS-WHEN] IOException when statementsWriter.indexOf('.') < 0 && try-body throws
[THROWS-WHEN] IllegalArgumentException when statementsWriter.indexOf('.') < 0 && try-body throws
[THROWS-WHEN] IOException when !(statementsWriter.indexOf('.') < 0) && tr... | /* static context
[FOCAL] public void EntityImporter.importData()
[THROWS-WHEN] IOException when statementsWriter.indexOf('.') < 0 && try-body throws
[THROWS-WHEN] IllegalArgumentException when statementsWriter.indexOf('.') < 0 && try-body throws
[THROWS-WHEN] IOException when !(statementsWriter.indexOf('.') < 0) && tr... | true | ok | {"focal": {"class": "EntityImporter", "name": "importData", "signature": "void importData() throws IOException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "EntityImporter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], ... |
27202384_1 | class Common {
public static ArrayList<Long> getRetweeters(long tweetID) throws Exception {
return getUsers(tweetID, RETWEETERS_URL);
}
public static ArrayList<Long> getFavoriters(long tweetID);
private static ArrayList<Long> getUsers(long tweetID, String url);
private static JSONObject ge... | ArrayList<Long> retweeters = Common.getRetweeters(TWEET_ID);
assertNotNull(retweeters);
assertEquals(retweeters.size(), 2);
}
} | [FOCAL] public static ArrayList<Long> Common.getRetweeters(long tweetID)
[CLASS] class Common
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] ArrayList<Long> getUsers(long tweetID, String url)
[EXCEPTIONS] declares Exception
[INPUTS] branches=- | result=tweetID
[DATAFLOW] tweetID@p... | /* static context
[FOCAL] public static ArrayList<Long> Common.getRetweeters(long tweetID)
[INPUTS] branches=- | result=tweetID
[EXCEPTIONS] declares Exception
[CALLS-INTERNAL] ArrayList<Long> getUsers(long tweetID, String url)
*/
| /* static context
[FOCAL] public static ArrayList<Long> Common.getRetweeters(long tweetID)
[INPUTS] branches=- | result=tweetID
[EXCEPTIONS] declares Exception
[CALLS-INTERNAL] ArrayList<Long> getUsers(long tweetID, String url)
*/
class Common {
public static ArrayList<Long> getRetweeters(long tweetID) throws Exce... | true | ok | {"focal": {"class": "Common", "name": "getRetweeters", "signature": "ArrayList<Long> getRetweeters(long tweetID) throws Exception", "start_line": 3, "modifiers": "public static", "params": [{"name": "tweetID", "type": "long"}], "return_type": "ArrayList<Long>"}, "class_info": {"name": "Common", "kind": "class", "modifi... |
27207708_1 | class EbeanParsedConfig {
public Map<String, List<String>> getDatasourceModels() {
return datasourceModels;
}
public EbeanParsedConfig(String defaultDatasource, Map<String, List<String>> datasourceModels);
public String getDefaultDatasource();
public static EbeanParsedConfig parseFromCon... | EbeanParsedConfig config = parse(ImmutableMap.of(
"ebean.default", "a,b"
));
assertThat(config.getDatasourceModels().get("default"), hasItems("a", "b"));
}
} | [FOCAL] public Map<String, List<String>> EbeanParsedConfig.getDatasourceModels()
[CLASS] class EbeanParsedConfig
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] EbeanParsedConfig(String defaultDatasource, Map<String, List<String>> datasourceModels); String getDefaultDatasource(); Eb... | /* static context
[FOCAL] public Map<String, List<String>> EbeanParsedConfig.getDatasourceModels()
*/
| /* static context
[FOCAL] public Map<String, List<String>> EbeanParsedConfig.getDatasourceModels()
*/
class EbeanParsedConfig {
public Map<String, List<String>> getDatasourceModels() {
return datasourceModels;
}
public EbeanParsedConfig(String defaultDatasource, Map<String, List<String>> datasour... | true | ok | {"focal": {"class": "EbeanParsedConfig", "name": "getDatasourceModels", "signature": "Map<String, List<String>> getDatasourceModels()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Map<String, List<String>>"}, "class_info": {"name": "EbeanParsedConfig", "kind": "class", "modifiers": "", "superc... |
27217073_30 | class DataSourceAccessor {
public DcSearchResponse search(final Map<String, Object> query) {
Map<String, Object> requestQuery = null;
if (query != null) {
requestQuery = new HashMap<String, Object>(query);
} else {
requestQuery = new HashMap<String, Object>();
... | EsIndex index = esClient.idxAdmin("index_for_test");
assertNotNull(index);
DataSourceAccessor dsa = new DataSourceAccessor(index, "TypeForTest", "RoutingIdTest");
dsa.create("id00001", new HashMap<Object, Object>());
dsa.create("id00002", new HashMap<Object, Object>());
d... | [FOCAL] public DcSearchResponse DataSourceAccessor.search(Map<String, Object> query)
[CLASS] class DataSourceAccessor
[METRICS] loc=17 cc=4 branches=2 loops=0 returns=1 throws=1 nesting=1
[CALLS-INTERNAL] long count(Map<String, Object> query)
[CALLS-EXTERNAL] Map<String, Object>.containsKey/1, Map<String, Object>.put/2... | /* static context
[FOCAL] public DcSearchResponse DataSourceAccessor.search(Map<String, Object> query)
[THROWS-WHEN] DcCoreException.Server.ES_RETRY_OVER.params(e.getMessage()) when query != null && !requestQuery.containsKey("size") && try-body throws
[THROWS-WHEN] DcCoreException.Server.ES_RETRY_OVER.params(e.getMessa... | /* static context
[FOCAL] public DcSearchResponse DataSourceAccessor.search(Map<String, Object> query)
[THROWS-WHEN] DcCoreException.Server.ES_RETRY_OVER.params(e.getMessage()) when query != null && !requestQuery.containsKey("size") && try-body throws
[THROWS-WHEN] DcCoreException.Server.ES_RETRY_OVER.params(e.getMessa... | true | ok | {"focal": {"class": "DataSourceAccessor", "name": "search", "signature": "DcSearchResponse search(Map<String, Object> query)", "start_line": 3, "modifiers": "public", "params": [{"name": "query", "type": "Map<String, Object>"}], "return_type": "DcSearchResponse"}, "class_info": {"name": "DataSourceAccessor", "kind": "c... |
27224427_2 | class StandardXRoadConsumerMessageExtractor implements WebServiceMessageExtractor {
public XRoadMessage<XmlObject> extractData(WebServiceMessage response) throws IOException {
Node kehaNode;
try {
SaajSoapMessage message = (SaajSoapMessage) response;
SOAPMessage mes = message.getSaajMessage();
... | // xml elements in a single row, but base64binary part on different rows (PEM format)
XRoadMessage message1 = EXTRACTOR.extractData(new SaajSoapMessage(getMessageFromString("extractor/EarestFail1.xml")));
assertEquals(RESULT_PEM_FORMAT, message1.getContent().toString());
// manually for... | [FOCAL] public XRoadMessage<XmlObject> StandardXRoadConsumerMessageExtractor.extractData(WebServiceMessage response)
[CLASS] class StandardXRoadConsumerMessageExtractor implements WebServiceMessageExtractor
[METRICS] loc=89 cc=15 branches=8 loops=4 returns=1 throws=2 nesting=5
[CALLS-INTERNAL] Node getKehaNode(NodeList... | /* static context
[FOCAL] public XRoadMessage<XmlObject> StandardXRoadConsumerMessageExtractor.extractData(WebServiceMessage response)
[THROWS-WHEN] RuntimeException when try-body throws
[THROWS-WHEN] RuntimeException when kehaNode instanceof javax.xml.soap.Text && kehaNodes.getLength() > 1 && i < kehaNodes.getLength()... | /* static context
[FOCAL] public XRoadMessage<XmlObject> StandardXRoadConsumerMessageExtractor.extractData(WebServiceMessage response)
[THROWS-WHEN] RuntimeException when try-body throws
[THROWS-WHEN] RuntimeException when kehaNode instanceof javax.xml.soap.Text && kehaNodes.getLength() > 1 && i < kehaNodes.getLength()... | true | ok | {"focal": {"class": "StandardXRoadConsumerMessageExtractor", "name": "extractData", "signature": "XRoadMessage<XmlObject> extractData(WebServiceMessage response) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "response", "type": "WebServiceMessage"}], "return_type": "XRoadMessage<XmlOb... |
27284166_3 | class Board extends Observable {
abstract int numPieces()abstract int numPieces();
abstract int numPieces() void clear(int N);
abstract int numPieces() void copy(Board board);
abstract int numPieces()abstract int size();
abstract int numPieces() Square get(int r, int c);
abstract int numPieces()abstract Square get(in... | int N = 4;
MutableBoard board = new MutableBoard(N);
assertEquals(16, board.numPieces());
board.set(0, 2, RED);
board.set(1, 2, BLUE);
board.set(2, 2, RED);
board.set(3, 2, BLUE);
assertEquals(20, board.numPieces());
}
} | [FOCAL] abstract int Board.numPieces()
[CLASS] class Board extends Observable
[METRICS] loc=1 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CLASS-MEMBERS] void clear(int N); void copy(Board board); int size(); Square get(int r, int c); Square get(int n); Side whoseMove(); boolean exists(int r, int c); boolean e... | /* static context
[FOCAL] abstract int Board.numPieces()
*/
| /* static context
[FOCAL] abstract int Board.numPieces()
*/
class Board extends Observable {
abstract int numPieces()abstract int numPieces();
abstract int numPieces() void clear(int N);
abstract int numPieces() void copy(Board board);
abstract int numPieces()abstract int size();
abstract int numPieces() Square get(i... | true | partial | {"focal": {"class": "Board", "name": "numPieces", "signature": "int numPieces()", "start_line": 3, "modifiers": "abstract", "params": [], "return_type": "int"}, "class_info": {"name": "Board", "kind": "class", "modifiers": "", "superclass": "Observable", "interfaces": null, "fields": [{"name": "NL", "type": "String", "... |
27287531_4 | class SquarifiedPacking {
@VisibleForTesting
@Nonnull
static Rect newBounds(@Nonnull Rect bounds, double fraction, double priorFraction) {
verify(fraction + priorFraction <= 1 + EPSILON, "fraction (%d) & prior fraction (%d) more than 1 + EPSILON ", fraction, priorFraction);
if (bounds.isEm... | Rect rect = SquarifiedPacking.newBounds(new Rect(787, 1045, 915, 1047), 0.006106064544560274, 0.9457072296133543);
assertEquals(new Rect(908, 1045, 909, 1047), rect);
}
} | [FOCAL] @VisibleForTesting @Nonnull static Rect SquarifiedPacking.newBounds(Rect bounds, double fraction, double priorFraction)
[CLASS] class SquarifiedPacking
[METRICS] loc=26 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] verify/4 (inherited), Rect.isEmpty/0, Rect.width/0, Rect.height/0, round/... | /* static context
[FOCAL] @VisibleForTesting @Nonnull static Rect SquarifiedPacking.newBounds(Rect bounds, double fraction, double priorFraction)
[PATH1] if(bounds.isEmpty())=F -> if(bounds.width() >= bounds.height())=T -> return newBounds
[PATH2] if(bounds.isEmpty())=T -> return bounds
[PATH3] if(bounds.isEmpty())=F -... | /* static context
[FOCAL] @VisibleForTesting @Nonnull static Rect SquarifiedPacking.newBounds(Rect bounds, double fraction, double priorFraction)
[PATH1] if(bounds.isEmpty())=F -> if(bounds.width() >= bounds.height())=T -> return newBounds
[PATH2] if(bounds.isEmpty())=T -> return bounds
[PATH3] if(bounds.isEmpty())=F -... | true | ok | {"focal": {"class": "SquarifiedPacking", "name": "newBounds", "signature": "Rect newBounds(Rect bounds, double fraction, double priorFraction)", "start_line": 3, "modifiers": "@VisibleForTesting @Nonnull static", "params": [{"name": "bounds", "type": "Rect"}, {"name": "fraction", "type": "double"}, {"name": "priorFract... |
27344072_3 | class VESID implements Comparable <VESID> {
public static boolean isValidPart (@Nullable final String sPart)
{
return StringHelper.hasText (sPart) && RegExHelper.stringMatchesPattern (REGEX_PART, sPart);
}
public VESID(@Nonnull @Nonempty final String sGroupID,
@Nonnull @Nonempty final Str... | assertTrue (VESID.isValidPart ("com"));
assertTrue (VESID.isValidPart ("com.helger"));
assertTrue (VESID.isValidPart ("01234"));
assertTrue (VESID.isValidPart ("1.2.3.4.5"));
assertTrue (VESID.isValidPart ("ph-as4"));
assertTrue (VESID.isValidPart ("-.___"));
assertFalse (VESID.isValidPart ... | [FOCAL] public static boolean VESID.isValidPart(String sPart)
[CLASS] class VESID implements Comparable <VESID>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] StringHelper.hasText/1, RegExHelper.stringMatchesPattern/2
[INPUTS] branches=- | result=sPart
[DATAFLOW] sPart@param->L3
[... | /* static context
[FOCAL] public static boolean VESID.isValidPart(String sPart)
[INPUTS] branches=- | result=sPart
[CALLS-EXTERNAL] StringHelper.hasText/1, RegExHelper.stringMatchesPattern/2
*/
| /* static context
[FOCAL] public static boolean VESID.isValidPart(String sPart)
[INPUTS] branches=- | result=sPart
[CALLS-EXTERNAL] StringHelper.hasText/1, RegExHelper.stringMatchesPattern/2
*/
class VESID implements Comparable <VESID> {
public static boolean isValidPart (@Nullable final String sPart)
{
return... | true | ok | {"focal": {"class": "VESID", "name": "isValidPart", "signature": "boolean isValidPart(String sPart)", "start_line": 3, "modifiers": "public static", "params": [{"name": "sPart", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "VESID", "kind": "class", "modifiers": "", "superclass": null, "interfac... |
27377253_0 | class MessageExtras {
public DeltaExtras getDelta() {
return delta;
}
public MessageExtras(final JsonObject jsonObject);
private MessageExtras(final JsonObject jsonObject, final DeltaExtras delta);
public JsonObject asJsonObject();
void write(MessagePacker packer);
static Messa... | final JsonObject objectA = new JsonObject();
objectA.addProperty("someKey", "someValue");
final JsonObject objectB = new JsonObject();
objectB.addProperty("someOtherKey", "someValue");
final MessageExtras messageExtras = new MessageExtras(objectA);
assertNull(messageExt... | [FOCAL] public DeltaExtras MessageExtras.getDelta()
[CLASS] class MessageExtras
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] MessageExtras(JsonObject jsonObject); MessageExtras(JsonObject jsonObject, DeltaExtras delta); JsonObject asJsonObject(); void write(MessagePacker packer);... | /* static context
[FOCAL] public DeltaExtras MessageExtras.getDelta()
*/
| /* static context
[FOCAL] public DeltaExtras MessageExtras.getDelta()
*/
class MessageExtras {
public DeltaExtras getDelta() {
return delta;
}
public MessageExtras(final JsonObject jsonObject);
private MessageExtras(final JsonObject jsonObject, final DeltaExtras delta);
public JsonObjec... | true | ok | {"focal": {"class": "MessageExtras", "name": "getDelta", "signature": "DeltaExtras getDelta()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "DeltaExtras"}, "class_info": {"name": "MessageExtras", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": ... |
27392543_546 | class MultiHopFlowCompiler extends BaseFlowToJobSpecCompiler {
@Override
public Dag<JobExecutionPlan> compileFlow(Spec spec) {
Preconditions.checkNotNull(spec);
Preconditions.checkArgument(spec instanceof FlowSpec, "MultiHopFlowCompiler only accepts FlowSpecs");
long startTime = System.nanoTime();
... | FlowSpec spec = createFlowSpec("flow/flow2.conf", "LocalFS-1", "HDFS-3,HDFS-4", false, false);
Dag<JobExecutionPlan> jobDag = this.specCompiler.compileFlow(spec);
Assert.assertEquals(jobDag.getNodes().size(), 4);
Assert.assertEquals(jobDag.getEndNodes().size(), 2);
Assert.assertEquals(jobDag.getSta... | [FOCAL] @Override public Dag<JobExecutionPlan> MultiHopFlowCompiler.compileFlow(Spec spec)
[CLASS] class MultiHopFlowCompiler extends BaseFlowToJobSpecCompiler
[METRICS] loc=62 cc=7 branches=3 loops=2 returns=4 throws=0 nesting=4
[CALLS-INTERNAL] List<FlowSpec> splitFlowSpec(FlowSpec flowSpec)
[CALLS-EXTERNAL] Precondi... | class MultiHopFlowCompiler extends BaseFlowToJobSpecCompiler {
@Override
public Dag<JobExecutionPlan> compileFlow(Spec spec) {
Preconditions.checkNotNull(spec);
Preconditions.checkArgument(spec instanceof FlowSpec, "MultiHopFlowCompiler only accepts FlowSpecs");
long startTime = System.nanoTime();
... | false | ok | {"focal": {"class": "MultiHopFlowCompiler", "name": "compileFlow", "signature": "Dag<JobExecutionPlan> compileFlow(Spec spec)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "spec", "type": "Spec"}], "return_type": "Dag<JobExecutionPlan>"}, "class_info": {"name": "MultiHopFlowCompiler", "kind": ... | |
27403772_0 | class VersionComparator implements Comparator<String>, Serializable {
@Override
public int compare(@Nullable final String pStr1, @Nullable final String pStr2)
{
int result = 0;
if (pStr1 == null) {
if (pStr2 != null) {
result = 1;
}
}
... | VersionComparator testee = new VersionComparator();
Assert.assertTrue(testee.compare("6.1", "6.1.2") < 0);
Assert.assertTrue(testee.compare("6.1.2", "6.1") > 0);
Assert.assertTrue(testee.compare("6.2", "6.1.2") > 0);
Assert.assertTrue(testee.compare("6.1.2", "6.2") < 0);
... | [FOCAL] @Override public int VersionComparator.compare(String pStr1, String pStr2)
[CLASS] class VersionComparator implements Comparator<String>, Serializable
[METRICS] loc=56 cc=11 branches=10 loops=0 returns=1 throws=0 nesting=9
[CALLS-EXTERNAL] PATTERN.matcher/1, Matcher.matches/0, Integer.parseInt/1, Matcher.group/... | /* static context
[FOCAL] @Override public int VersionComparator.compare(String pStr1, String pStr2)
[PATH1] if(pStr1 == null)=F -> if(pStr2 == null)=F -> if(matcher1.matches() && matcher2.matches())=T -> if(major1 > major2)=F -> if(major1 < major2)=F -> if(minor1 > minor2)=F -> if(minor1 < minor2)=F -> if(micro1 > mic... | /* static context
[FOCAL] @Override public int VersionComparator.compare(String pStr1, String pStr2)
[PATH1] if(pStr1 == null)=F -> if(pStr2 == null)=F -> if(matcher1.matches() && matcher2.matches())=T -> if(major1 > major2)=F -> if(major1 < major2)=F -> if(minor1 > minor2)=F -> if(minor1 < minor2)=F -> if(micro1 > mic... | true | ok | {"focal": {"class": "VersionComparator", "name": "compare", "signature": "int compare(String pStr1, String pStr2)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "pStr1", "type": "String"}, {"name": "pStr2", "type": "String"}], "return_type": "int"}, "class_info": {"name": "VersionComparator", "... |
27404315_0 | class ConsulServerUtils {
public static String fixIPv6Address(String address) {
try {
InetAddress inetAdr = InetAddress.getByName(address);
if (inetAdr instanceof Inet6Address) {
return "[" + inetAdr.getHostName() + "]";
}
return address;
}
catch (UnknownHostException e) {
log.debug("Not Inet... | String s1 = ConsulServerUtils.fixIPv6Address("fc00:ec:cd::242:ac11:c");
assertThat(s1).isEqualTo("[fc00:ec:cd:0:0:242:ac11:c]");
String s2 = ConsulServerUtils.fixIPv6Address("[fc00:ec:cd::242:ac11:c]");
assertThat(s2).isEqualTo("[fc00:ec:cd:0:0:242:ac11:c]");
String s3 = ConsulServerUtils.fixIPv6Address("19... | [FOCAL] public static String ConsulServerUtils.fixIPv6Address(String address)
[CLASS] class ConsulServerUtils
[METRICS] loc=13 cc=3 branches=1 loops=0 returns=3 throws=0 nesting=2
[CALLS-EXTERNAL] InetAddress.getByName/1, InetAddress.getHostName/0, log.debug/1
[EXCEPTIONS] catches UnknownHostException e
[PATH1] try-bod... | /* static context
[FOCAL] public static String ConsulServerUtils.fixIPv6Address(String address)
[PATH1] try-body throws -> return address
[PATH2] if(inetAdr instanceof Inet6Address)=T -> return "[" + inetAdr.getHostName() + "]"
[PATH3] if(inetAdr instanceof Inet6Address)=F -> return address
[INPUTS] branches=address | ... | /* static context
[FOCAL] public static String ConsulServerUtils.fixIPv6Address(String address)
[PATH1] try-body throws -> return address
[PATH2] if(inetAdr instanceof Inet6Address)=T -> return "[" + inetAdr.getHostName() + "]"
[PATH3] if(inetAdr instanceof Inet6Address)=F -> return address
[INPUTS] branches=address | ... | true | ok | {"focal": {"class": "ConsulServerUtils", "name": "fixIPv6Address", "signature": "String fixIPv6Address(String address)", "start_line": 3, "modifiers": "public static", "params": [{"name": "address", "type": "String"}], "return_type": "String"}, "class_info": {"name": "ConsulServerUtils", "kind": "class", "modifiers": "... |
27408825_1 | class MessageUtil {
public static String replaceVars(String msg, HashMap<String, String> vars){
boolean error = false;
for(String s:vars.keySet()){
try{
msg.replace("{$"+s+"}", vars.get(s));
}catch(Exception e){
MessageManager.getInstance().de... | String expected = "&6Game starting in 10";
String test = MessageUtil.replaceVars(messageConfig.getString("messages.game.countdown", ""), "t-10");
assertThat(test, is(expected));
}
} | [FOCAL] public static String MessageUtil.replaceVars(String msg, HashMap<String, String> vars)
[CLASS] class MessageUtil
[METRICS] loc=17 cc=4 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] HashMap<String, String>.keySet/0, String.replace/2, HashMap<String, String>.get/1, MessageManager.getInstance().... | /* static context
[FOCAL] public static String MessageUtil.replaceVars(String msg, HashMap<String, String> vars)
[PATH1] foreach(String s : vars.keySet())=T -> try-body throws -> exit loop -> if(error)=T -> return msg
[PATH2] foreach(String s : vars.keySet())=F -> if(error)=F -> return msg
[INPUTS] branches=vars | resu... | /* static context
[FOCAL] public static String MessageUtil.replaceVars(String msg, HashMap<String, String> vars)
[PATH1] foreach(String s : vars.keySet())=T -> try-body throws -> exit loop -> if(error)=T -> return msg
[PATH2] foreach(String s : vars.keySet())=F -> if(error)=F -> return msg
[INPUTS] branches=vars | resu... | true | ok | {"focal": {"class": "MessageUtil", "name": "replaceVars", "signature": "String replaceVars(String msg, HashMap<String, String> vars)", "start_line": 3, "modifiers": "public static", "params": [{"name": "msg", "type": "String"}, {"name": "vars", "type": "HashMap<String, String>"}], "return_type": "String"}, "class_info"... |
27416566_3 | class RateLimitBundle implements ConfiguredBundle<T>, ConfigurationStrategy<T> {
public void run(T configuration, Environment environment, JedisPool jedisPool) throws Exception {
this.jedisPool = jedisPool;
run(configuration, environment);
}
@Override public void run(T configuration, Environment environment);
... | bundle.run(configuration, environment, jedisPool);
verify(jerseyEnvironment).register(any(RateLimitFilter.class));
}
} | [FOCAL] public void RateLimitBundle.run(T configuration, Environment environment, JedisPool jedisPool)
[CLASS] class RateLimitBundle implements ConfiguredBundle<T>, ConfigurationStrategy<T>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void run(T configuration, Environment enviro... | /* static context
[FOCAL] public void RateLimitBundle.run(T configuration, Environment environment, JedisPool jedisPool)
[STATE] jedisPool
[EXCEPTIONS] declares Exception
[CALLS-INTERNAL] void run(T configuration, Environment environment)
[FIELDS] write=jedisPool
*/
| /* static context
[FOCAL] public void RateLimitBundle.run(T configuration, Environment environment, JedisPool jedisPool)
[STATE] jedisPool
[EXCEPTIONS] declares Exception
[CALLS-INTERNAL] void run(T configuration, Environment environment)
[FIELDS] write=jedisPool
*/
class RateLimitBundle implements ConfiguredBundle<T>,... | true | ok | {"focal": {"class": "RateLimitBundle", "name": "run", "signature": "void run(T configuration, Environment environment, JedisPool jedisPool) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "configuration", "type": "T"}, {"name": "environment", "type": "Environment"}, {"name": "jedisPool", ... |
27490105_0 | class GeometryUtils {
public static Point2D getConnectorPosition(final GConnector connector, final SkinLookup skinLookup) {
final GConnectorSkin connectorSkin = skinLookup.lookupConnector(connector);
final GNode parent = connector.getParent();
final GNodeSkin nodeSkin = skinLookup.lookupN... | // Should return the absolute position of the center of the connector.
final Point2D target = new Point2D(NODE_X + CONNECTOR_CENTER_X, NODE_Y + CONNECTOR_CENTER_Y);
assertEquals(GeometryUtils.getConnectorPosition(connector, skinLookup), target);
}
} | [FOCAL] public static Point2D GeometryUtils.getConnectorPosition(GConnector connector, SkinLookup skinLookup)
[CLASS] class GeometryUtils
[METRICS] loc=22 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] double moveOnPixel(double position)
[CALLS-EXTERNAL] SkinLookup.lookupConnector/1, GConnector.g... | /* static context
[FOCAL] public static Point2D GeometryUtils.getConnectorPosition(GConnector connector, SkinLookup skinLookup)
[PATH1] if(nodeSkin == null)=T -> return null
[PATH2] if(nodeSkin == null)=F -> return new Point2D(moveOnPixel(nodeX + connectorX), moveOnPixel(nodeY + co...
[INPUTS] branches=connector, skinL... | /* static context
[FOCAL] public static Point2D GeometryUtils.getConnectorPosition(GConnector connector, SkinLookup skinLookup)
[PATH1] if(nodeSkin == null)=T -> return null
[PATH2] if(nodeSkin == null)=F -> return new Point2D(moveOnPixel(nodeX + connectorX), moveOnPixel(nodeY + co...
[INPUTS] branches=connector, skinL... | true | ok | {"focal": {"class": "GeometryUtils", "name": "getConnectorPosition", "signature": "Point2D getConnectorPosition(GConnector connector, SkinLookup skinLookup)", "start_line": 3, "modifiers": "public static", "params": [{"name": "connector", "type": "GConnector"}, {"name": "skinLookup", "type": "SkinLookup"}], "return_typ... |
27503648_8 | class TemporaryTokenCache {
public String generateTemporaryToken(String key, int secondsToLive) {
return generateTemporaryToken(key, secondsToLive, null);
}
@Inject public TemporaryTokenCache(TokenGenerator tokenGenerator, CacheBuilderProvider cacheBuilderProvider);
public String generateTemporaryToken(... |
expect(mockGenerator.generate()).andReturn(TOKEN).once();
replay(mockGenerator);
String token = tokenCache.generateTemporaryToken(KEY, 10);
assertTrue(null != token);
assertTrue(TOKEN.equals(token));
}
} | [FOCAL] public String TemporaryTokenCache.generateTemporaryToken(String key, int secondsToLive)
[CLASS] class TemporaryTokenCache
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String generateTemporaryToken(String key, int secondsToLive, Object context)
[INPUTS] branches=- | resul... | /* static context
[FOCAL] public String TemporaryTokenCache.generateTemporaryToken(String key, int secondsToLive)
[INPUTS] branches=- | result=key, secondsToLive
[CALLS-INTERNAL] String generateTemporaryToken(String key, int secondsToLive, Object context)
*/
| /* static context
[FOCAL] public String TemporaryTokenCache.generateTemporaryToken(String key, int secondsToLive)
[INPUTS] branches=- | result=key, secondsToLive
[CALLS-INTERNAL] String generateTemporaryToken(String key, int secondsToLive, Object context)
*/
class TemporaryTokenCache {
public String generateTemporar... | true | ok | {"focal": {"class": "TemporaryTokenCache", "name": "generateTemporaryToken", "signature": "String generateTemporaryToken(String key, int secondsToLive)", "start_line": 3, "modifiers": "public", "params": [{"name": "key", "type": "String"}, {"name": "secondsToLive", "type": "int"}], "return_type": "String"}, "class_info... |
27507850_2204 | class IpsecUtil {
@VisibleForTesting
@Nonnull
static IpsecSession getIpsecSession(
Configuration initiatorOwner,
Configuration peerOwner,
IpsecStaticPeerConfig initiator,
IpsecPeerConfig candidatePeer) {
IpsecSession.Builder ipsecSessionBuilder = IpsecSession.builder();
ipsecSess... | NetworkFactory nf = new NetworkFactory();
Configuration.Builder cb = nf.configurationBuilder();
IpsecStaticPeerConfig.Builder ipsecPeerConfigBuilder = IpsecStaticPeerConfig.builder();
assertTrue(
getIpsecSession(
cb.setConfigurationFormat(AWS).build(),
cb.setConf... | [FOCAL] @VisibleForTesting @Nonnull static IpsecSession IpsecUtil.getIpsecSession(Configuration initiatorOwner, Configuration peerOwner, IpsecStaticPeerConfig initiator, IpsecPeerConfig candidatePeer)
[CLASS] class IpsecUtil
[METRICS] loc=23 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] void neg... | /* static context
[FOCAL] @VisibleForTesting @Nonnull static IpsecSession IpsecUtil.getIpsecSession(Configuration initiatorOwner, Configuration peerOwner, IpsecStaticPeerConfig initiator, IpsecPeerConfig candidatePeer)
[PATH1] if(ipsecSessionBuilder.getNegotiatedIkeP1Proposal() == null || ipsecSessionBuilder.getNegotia... | /* static context
[FOCAL] @VisibleForTesting @Nonnull static IpsecSession IpsecUtil.getIpsecSession(Configuration initiatorOwner, Configuration peerOwner, IpsecStaticPeerConfig initiator, IpsecPeerConfig candidatePeer)
[PATH1] if(ipsecSessionBuilder.getNegotiatedIkeP1Proposal() == null || ipsecSessionBuilder.getNegotia... | true | ok | {"focal": {"class": "IpsecUtil", "name": "getIpsecSession", "signature": "IpsecSession getIpsecSession(Configuration initiatorOwner, Configuration peerOwner, IpsecStaticPeerConfig initiator, IpsecPeerConfig candidatePeer)", "start_line": 3, "modifiers": "@VisibleForTesting @Nonnull static", "params": [{"name": "initiat... |
27514348_3 | class JacksonSerializer implements Serializer<T> {
@Override
public byte[] serialize(T event)
{
try {
return objectMapper.writeValueAsBytes(event);
}
catch (JsonProcessingException e) {
throw Throwables.propagate(e);
}
}
public JacksonSerializer(ObjectMapper objectMapper);
pr... | final String outputString = "{\"timestamp\":\"2014-01-01T00:00:00.000Z\",\"at\":2}";
objectMapper.registerModule(new JodaModule());
final Serializer<MmxAuctionSummary> serializer = new JacksonSerializer<>(objectMapper);
final byte[] eventBytes = serializer.serialize(sampleEventValid);
final String ... | [FOCAL] @Override public byte[] JacksonSerializer.serialize(T event)
[CLASS] class JacksonSerializer implements Serializer<T>
[METRICS] loc=10 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] ObjectMapper.writeValueAsBytes/1, Throwables.propagate/1
[FIELDS] read=objectMapper:ObjectMapper
[EXCEPTION... | /* static context
[FOCAL] @Override public byte[] JacksonSerializer.serialize(T event)
[THROWS-WHEN] Throwables.propagate(e) when try-body throws
[PATH1] try-body throws -> throw Throwables.propagate(e)
[PATH2] return objectMapper.writeValueAsBytes(event)
[INPUTS] branches=- | result=event, objectMapper
[COLLABORATORS]... | /* static context
[FOCAL] @Override public byte[] JacksonSerializer.serialize(T event)
[THROWS-WHEN] Throwables.propagate(e) when try-body throws
[PATH1] try-body throws -> throw Throwables.propagate(e)
[PATH2] return objectMapper.writeValueAsBytes(event)
[INPUTS] branches=- | result=event, objectMapper
[COLLABORATORS]... | true | ok | {"focal": {"class": "JacksonSerializer", "name": "serialize", "signature": "byte[] serialize(T event)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "event", "type": "T"}], "return_type": "byte[]"}, "class_info": {"name": "JacksonSerializer", "kind": "class", "modifiers": "", "superclass": null... |
27533072_1 | class HashUtil {
public static String md5Hex (String message) {
try {
MessageDigest md =
MessageDigest.getInstance("MD5");
return hex (md.digest(message.getBytes("CP1252")));
} catch (NoSuchAlgorithmException e) {
} catch (UnsupportedEncodingExcep... | String md5 = HashUtil.md5Hex("stevehu@gmail.com");
Assert.assertEquals(md5, "417bed6d9644f12d8bc709059c225c27");
}
} | [FOCAL] public static String HashUtil.md5Hex(String message)
[CLASS] class HashUtil
[METRICS] loc=10 cc=3 branches=0 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] String hex(byte[] array)
[CALLS-EXTERNAL] MessageDigest.getInstance/1, MessageDigest.digest/1, String.getBytes/1
[EXCEPTIONS] catches NoSuchAlgorithm... | /* static context
[FOCAL] public static String HashUtil.md5Hex(String message)
[PATH1] try-body throws -> return null
[PATH2] return hex (md.digest(message.getBytes("CP1252")))
[INPUTS] branches=- | result=message
[EXCEPTIONS] catches NoSuchAlgorithmException e, UnsupportedEncodingException e
[CALLS-INTERNAL] String he... | /* static context
[FOCAL] public static String HashUtil.md5Hex(String message)
[PATH1] try-body throws -> return null
[PATH2] return hex (md.digest(message.getBytes("CP1252")))
[INPUTS] branches=- | result=message
[EXCEPTIONS] catches NoSuchAlgorithmException e, UnsupportedEncodingException e
[CALLS-INTERNAL] String he... | true | ok | {"focal": {"class": "HashUtil", "name": "md5Hex", "signature": "String md5Hex(String message)", "start_line": 3, "modifiers": "public static", "params": [{"name": "message", "type": "String"}], "return_type": "String"}, "class_info": {"name": "HashUtil", "kind": "class", "modifiers": "", "superclass": null, "interfaces... |
27534295_1 | class VertxEventLoopExecutionContext implements ExecutionContext {
public static ExecutionContext create(Vertx vertx) {
return new VertxEventLoopExecutionContext(vertx);
}
private VertxEventLoopExecutionContext(Vertx vertx);
@Override public void execute(Runnable runnable);
@Override public void repor... | Async async = tc.async();
final Context context = Vertx.currentContext();
tc.assertNull(context);
final Promise.DefaultPromise<String> promise = new Promise.DefaultPromise<>();
promise.onComplete(ScalaUtils.toFunction1(v -> {
tc.assertNotNull(Vertx.currentContext());
async.complete();
... | [FOCAL] public static ExecutionContext VertxEventLoopExecutionContext.create(Vertx vertx)
[CLASS] class VertxEventLoopExecutionContext implements ExecutionContext
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] VertxEventLoopExecutionContext
[INPUTS] branches=- | result=vertx
[DATAFLOW] vertx... | /* static context
[FOCAL] public static ExecutionContext VertxEventLoopExecutionContext.create(Vertx vertx)
[INPUTS] branches=- | result=vertx
[NEW] VertxEventLoopExecutionContext
*/
| /* static context
[FOCAL] public static ExecutionContext VertxEventLoopExecutionContext.create(Vertx vertx)
[INPUTS] branches=- | result=vertx
[NEW] VertxEventLoopExecutionContext
*/
class VertxEventLoopExecutionContext implements ExecutionContext {
public static ExecutionContext create(Vertx vertx) {
return new... | true | ok | {"focal": {"class": "VertxEventLoopExecutionContext", "name": "create", "signature": "ExecutionContext create(Vertx vertx)", "start_line": 3, "modifiers": "public static", "params": [{"name": "vertx", "type": "Vertx"}], "return_type": "ExecutionContext"}, "class_info": {"name": "VertxEventLoopExecutionContext", "kind":... |
27570630_0 | class PoiExcelWriter {
public void process(Resource inputResource, Resource outputResource) {
SXSSFWorkbook wb = new SXSSFWorkbook(flushSize);
try {
wb.setCompressTempFiles(true); // temp files will be gzipped
final Sheet sh = wb.createSheet();
InputStreamReader... | PoiExcelWriter poiExcelWriter = new PoiExcelWriter(20);
final Resource fileSystemResource = new FileSystemResource(destination_file);
poiExcelWriter.process(new FileSystemResource(sourceFile), fileSystemResource);
XSSFWorkbook xssfWorkbook = new XSSFWorkbook(fileSystemResource.getInputS... | [FOCAL] public void PoiExcelWriter.process(Resource inputResource, Resource outputResource)
[CLASS] class PoiExcelWriter
[METRICS] loc=25 cc=3 branches=1 loops=0 returns=0 throws=0 nesting=2
[CALLS-INTERNAL] void createRow(String string, Sheet sh, CreationHelper createHelper)
[CALLS-EXTERNAL] SXSSFWorkbook.setCompressT... | /* static context
[FOCAL] public void PoiExcelWriter.process(Resource inputResource, Resource outputResource)
[PATH1] try-body throws -> if(wb != null)=T
[PATH2] if(wb != null)=F
[COLLABORATORS] param inputResource:Resource getInputStream/0; param outputResource:Resource getFile/0
[EXCEPTIONS] catches IOException e
[CA... | /* static context
[FOCAL] public void PoiExcelWriter.process(Resource inputResource, Resource outputResource)
[PATH1] try-body throws -> if(wb != null)=T
[PATH2] if(wb != null)=F
[COLLABORATORS] param inputResource:Resource getInputStream/0; param outputResource:Resource getFile/0
[EXCEPTIONS] catches IOException e
[CA... | true | ok | {"focal": {"class": "PoiExcelWriter", "name": "process", "signature": "void process(Resource inputResource, Resource outputResource)", "start_line": 3, "modifiers": "public", "params": [{"name": "inputResource", "type": "Resource"}, {"name": "outputResource", "type": "Resource"}], "return_type": "void"}, "class_info": ... |
27583882_1 | class PBKDF2Strategy extends AbstractHashingStrategy implements JDBCHashStrategy {
@Override
public String computeHash(String password, String salt, int version) {
int iterations = DEFAULT_ITERATIONS;
if (version >= 0) {
if (nonces == null) {
// the nonce version is not available
th... | JDBCHashStrategy strategy = new PBKDF2Strategy(vertx);
strategy.setNonces(new JsonArray().add(1000));
String hashedPassword = strategy.computeHash("Paulo", "123456", 0);
assertTrue(JDBCHashStrategy.isEqual("39698770CC0B0B0553E9B74216FAE2C7C31B81D40940FA50601D7998B81820F86CEE7CD84CC1D06D06D832C5BACA45D3... | [FOCAL] @Override public String PBKDF2Strategy.computeHash(String password, String salt, int version)
[CLASS] class PBKDF2Strategy extends AbstractHashingStrategy implements JDBCHashStrategy
[METRICS] loc=35 cc=6 branches=4 loops=0 returns=2 throws=2 nesting=2
[CALLS-EXTERNAL] nonces.size/0, nonces.getInteger/1, String... | /* static context
[FOCAL] @Override public String PBKDF2Strategy.computeHash(String password, String salt, int version)
[THROWS-WHEN] VertxException when version >= 0 && nonces == null
[THROWS-WHEN] VertxException when version >= 0 && !(nonces == null) && version < nonces.size() && try-body throws
[THROWS-WHEN] VertxEx... | /* static context
[FOCAL] @Override public String PBKDF2Strategy.computeHash(String password, String salt, int version)
[THROWS-WHEN] VertxException when version >= 0 && nonces == null
[THROWS-WHEN] VertxException when version >= 0 && !(nonces == null) && version < nonces.size() && try-body throws
[THROWS-WHEN] VertxEx... | true | ok | {"focal": {"class": "PBKDF2Strategy", "name": "computeHash", "signature": "String computeHash(String password, String salt, int version)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "password", "type": "String"}, {"name": "salt", "type": "String"}, {"name": "version", "type": "int"}], "return... |
27609596_139 | class AwsClientFactory implements AutoCloseable {
AWSCredentialsProvider createCredentialsProvider(String name, String accountId) {
final AWSCredentialsProvider dflt = new DefaultAWSCredentialsProviderChain();
final Config cfg = getConfig(name, "credentials");
if (cfg.hasPath("role-arn")) {
return ... | AwsClientFactory factory = new AwsClientFactory(config);
AWSCredentialsProvider creds = factory.createCredentialsProvider(null, null);
Assert.assertTrue(creds instanceof DefaultAWSCredentialsProviderChain);
}
} | [FOCAL] AWSCredentialsProvider AwsClientFactory.createCredentialsProvider(String name, String accountId)
[CLASS] class AwsClientFactory implements AutoCloseable
[METRICS] loc=12 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=2
[CALLS-INTERNAL] AWSCredentialsProvider createAssumeRoleProvider(Config cfg, String accou... | /* static context
[FOCAL] AWSCredentialsProvider AwsClientFactory.createCredentialsProvider(String name, String accountId)
[PATH1] if(cfg.hasPath("role-arn"))=F -> if(accountId != null)=T -> return dflt
[PATH2] if(cfg.hasPath("role-arn"))=T -> return createAssumeRoleProvider(cfg, accountId, dflt)
[PATH3] if(cfg.hasPath... | /* static context
[FOCAL] AWSCredentialsProvider AwsClientFactory.createCredentialsProvider(String name, String accountId)
[PATH1] if(cfg.hasPath("role-arn"))=F -> if(accountId != null)=T -> return dflt
[PATH2] if(cfg.hasPath("role-arn"))=T -> return createAssumeRoleProvider(cfg, accountId, dflt)
[PATH3] if(cfg.hasPath... | true | ok | {"focal": {"class": "AwsClientFactory", "name": "createCredentialsProvider", "signature": "AWSCredentialsProvider createCredentialsProvider(String name, String accountId)", "start_line": 3, "modifiers": "", "params": [{"name": "name", "type": "String"}, {"name": "accountId", "type": "String"}], "return_type": "AWSCrede... |
27622439_69 | class ConcurrentManaged implements Managed<T> {
@Override
public Stage<Void> stop() {
if (!state.compareAndSet(ManagedState.STARTED, ManagedState.STOPPED)) {
return stopFuture;
}
stopReferenceFuture.complete(this.reference.getAndSet(null));
// release self-reference.
release();
retu... | underTest.state.set(ConcurrentManaged.ManagedState.STARTED);
underTest.reference.set(reference);
assertEquals(stopFuture, underTest.stop());
assertNull(underTest.reference.get());
verify(underTest).release();
}
} | [FOCAL] @Override public Stage<Void> ConcurrentManaged.stop()
[CLASS] class ConcurrentManaged implements Managed<T>
[METRICS] loc=12 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] void release()
[CALLS-EXTERNAL] state.compareAndSet/2, Completable<Object>.complete/1, Object.getAndSet/1
[FIELDS] re... | /* static context
[FOCAL] @Override public Stage<Void> ConcurrentManaged.stop()
[PATH1] if(!state.compareAndSet(ManagedState.STARTED, ManagedState.STOPPED))=T -> return stopFuture
[PATH2] if(!state.compareAndSet(ManagedState.STARTED, ManagedState.STOPPED))=F -> return stopFuture
[INPUTS] branches=- | result=stopFuture
... | /* static context
[FOCAL] @Override public Stage<Void> ConcurrentManaged.stop()
[PATH1] if(!state.compareAndSet(ManagedState.STARTED, ManagedState.STOPPED))=T -> return stopFuture
[PATH2] if(!state.compareAndSet(ManagedState.STARTED, ManagedState.STOPPED))=F -> return stopFuture
[INPUTS] branches=- | result=stopFuture
... | true | ok | {"focal": {"class": "ConcurrentManaged", "name": "stop", "signature": "Stage<Void> stop()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Stage<Void>"}, "class_info": {"name": "ConcurrentManaged", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Managed<T>", "fields... |
27653357_4 | class Route {
public boolean matches(String path) {
return pathPattern.matcher(path).matches();
}
private Route(String path, Pattern pathPattern, List<String> keywords);
public static Pattern compile(String pattern, List<String> keywords);
public static Route build(String pattern);
public Pattern pa... | Route matches1 = Route.build("/api/people/:person");
assertTrue(matches1.matches("/api/people/jeff"));
}
} | [FOCAL] public boolean Route.matches(String path)
[CLASS] class Route
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] pathPattern.matcher(path).matches/0, pathPattern.matcher/1
[INPUTS] branches=- | result=path
[COLLABORATORS] field pathPattern matcher/1
[DATAFLOW] path@param->L2
[... | /* static context
[FOCAL] public boolean Route.matches(String path)
[INPUTS] branches=- | result=path
[COLLABORATORS] field pathPattern matcher/1
[CALLS-EXTERNAL] pathPattern.matcher(path).matches/0, pathPattern.matcher/1
*/
| /* static context
[FOCAL] public boolean Route.matches(String path)
[INPUTS] branches=- | result=path
[COLLABORATORS] field pathPattern matcher/1
[CALLS-EXTERNAL] pathPattern.matcher(path).matches/0, pathPattern.matcher/1
*/
class Route {
public boolean matches(String path) {
return pathPattern.matcher(path).mat... | true | ok | {"focal": {"class": "Route", "name": "matches", "signature": "boolean matches(String path)", "start_line": 3, "modifiers": "public", "params": [{"name": "path", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "Route", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "field... |
27674753_1 | class SubClassSupportInstanceInitializer implements InstanceInitializer {
@SuppressWarnings("unchecked")
public <T> Class<T> getClass(T entity) {
// get the first class in the hierarchy that is actually in the index
Class<T> clazz = (Class<T>) entity.getClass();
if ( !clazz.isAnnotationPresent( InIndex.class )... | SubClassSupportInstanceInitializer initializer = SubClassSupportInstanceInitializer.INSTANCE;
WithoutInIndex withoutInIndex = new WithoutInIndex();
assertEquals(
WithoutInIndex.class, initializer.getClass( withoutInIndex )
);
}
} | [FOCAL] @SuppressWarnings("unchecked") public Class<T> SubClassSupportInstanceInitializer.getClass(T entity)
[CLASS] class SubClassSupportInstanceInitializer implements InstanceInitializer
[METRICS] loc=16 cc=5 branches=3 loops=1 returns=2 throws=0 nesting=3
[CALLS-EXTERNAL] T.getClass/0, Class<T>.isAnnotationPresent/1... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public Class<T> SubClassSupportInstanceInitializer.getClass(T entity)
[PATH1] if(!clazz.isAnnotationPresent( InIndex.class ))=T -> while((clazz = (Class<T>) clazz.getSuperclass()) != null)=T -> if(clazz.isAnnotationPresent( InIndex.class ))=F -> exit loop -> if(c... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public Class<T> SubClassSupportInstanceInitializer.getClass(T entity)
[PATH1] if(!clazz.isAnnotationPresent( InIndex.class ))=T -> while((clazz = (Class<T>) clazz.getSuperclass()) != null)=T -> if(clazz.isAnnotationPresent( InIndex.class ))=F -> exit loop -> if(c... | true | ok | {"focal": {"class": "SubClassSupportInstanceInitializer", "name": "getClass", "signature": "Class<T> getClass(T entity)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public", "params": [{"name": "entity", "type": "T"}], "return_type": "Class<T>"}, "class_info": {"name": "SubClassSupportInstanceIniti... |
27683023_125 | class WindSpeed {
public BigDecimal getValue(WindSpeedUnit unit) {
BigDecimal value = null;
switch (unit) {
case KNOTS:
value = knots;
break;
case METRES_PER_SECOND:
value = metresPerSecond;
break;
... | testee = new WindSpeed(new BigDecimal("0.5"));
new BigDecimalEquals().assertEquals(new BigDecimal("1"), testee.getValue(WindSpeedUnit.BEAUFORT_SCALE));
testee = new WindSpeed(new BigDecimal("3.4"));
new BigDecimalEquals().assertEquals(new BigDecimal("1"), testee.getValue(WindSpeedUnit.B... | [FOCAL] public BigDecimal WindSpeed.getValue(WindSpeedUnit unit)
[CLASS] class WindSpeed
[METRICS] loc=23 cc=6 branches=1 loops=0 returns=1 throws=0 nesting=1
[PATH1] switch(unit)=case KNOTS -> return value
[PATH2] switch(unit)=case METRES_PER_SECOND -> return value
[PATH3] switch(unit)=case KILOMETRES_PER_HOUR -> retu... | /* static context
[FOCAL] public BigDecimal WindSpeed.getValue(WindSpeedUnit unit)
[PATH1] switch(unit)=case KNOTS -> return value
[PATH2] switch(unit)=case METRES_PER_SECOND -> return value
[PATH3] switch(unit)=case KILOMETRES_PER_HOUR -> return value
[PATH4] switch(unit)=case MILES_PER_HOUR -> return value
[PATH5] sw... | /* static context
[FOCAL] public BigDecimal WindSpeed.getValue(WindSpeedUnit unit)
[PATH1] switch(unit)=case KNOTS -> return value
[PATH2] switch(unit)=case METRES_PER_SECOND -> return value
[PATH3] switch(unit)=case KILOMETRES_PER_HOUR -> return value
[PATH4] switch(unit)=case MILES_PER_HOUR -> return value
[PATH5] sw... | true | ok | {"focal": {"class": "WindSpeed", "name": "getValue", "signature": "BigDecimal getValue(WindSpeedUnit unit)", "start_line": 3, "modifiers": "public", "params": [{"name": "unit", "type": "WindSpeedUnit"}], "return_type": "BigDecimal"}, "class_info": {"name": "WindSpeed", "kind": "class", "modifiers": "", "superclass": nu... |
27683112_56 | class FunctionFactory {
private static Function parseVALUE(ConfigThingy conf, FunctionLibrary funcLib,
DialogLibrary dialogLib, Map<Object, Object> context)
{
Function valueNameFun;
// TODO doesn't work as described. Exception isn't thrown by 0 or more than 1 parameters.
try
{
valueName... | Function f = FunctionFactory.parse(new ConfigThingy("VALUE", "\"value1\" \"value2\""), funcLib, dialogLib, context);
assertTrue(f instanceof ValueFunction);
}
} | [FOCAL] private static Function FunctionFactory.parseVALUE(ConfigThingy conf, FunctionLibrary funcLib, DialogLibrary dialogLib, Map<Object, Object> context)
[CLASS] class FunctionFactory
[METRICS] loc=18 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-INTERNAL] Function parse(ConfigThingy conf, FunctionLibr... | /* static context
[FOCAL] private static Function FunctionFactory.parseVALUE(ConfigThingy conf, FunctionLibrary funcLib, DialogLibrary dialogLib, Map<Object, Object> context)
[THROWS-WHEN] ConfigurationErrorException when try-body throws
[PATH1] try-body throws -> throw new ConfigurationErrorException(L.m( "Funktion vo... | /* static context
[FOCAL] private static Function FunctionFactory.parseVALUE(ConfigThingy conf, FunctionLibrary funcLib, DialogLibrary dialogLib, Map<Object, Object> context)
[THROWS-WHEN] ConfigurationErrorException when try-body throws
[PATH1] try-body throws -> throw new ConfigurationErrorException(L.m( "Funktion vo... | true | ok | {"focal": {"class": "FunctionFactory", "name": "parseVALUE", "signature": "Function parseVALUE(ConfigThingy conf, FunctionLibrary funcLib, DialogLibrary dialogLib, Map<Object, Object> context)", "start_line": 3, "modifiers": "private static", "params": [{"name": "conf", "type": "ConfigThingy"}, {"name": "funcLib", "typ... |
27715709_10 | class ResourcePermission extends Permission {
@Override
public boolean implies(Permission p) {
if (!(p instanceof ResourcePermission))
return false;
ResourcePermission qp = (ResourcePermission) p;
/*
* Condition 1: The action flag of the queried permission was set in the granted permission
*/
int qu... | ResourcePermission rp;
ResourcePermission rp2;
// 11P
rp = new ResourcePermission("path=*", "*");
rp2 = new ResourcePermission("path=*", "*");
assertTrue(rp.implies(rp2));
// 12P
rp = new ResourcePermission("path=*", "*");
rp2 = new ResourcePermission("path=myPath/*", "*");
assertTrue(rp.implies(r... | [FOCAL] @Override public boolean ResourcePermission.implies(Permission p)
[CLASS] class ResourcePermission extends Permission
[METRICS] loc=209 cc=36 branches=31 loops=1 returns=10 throws=0 nesting=9
[CALLS-INTERNAL] Class<?> getClass(String typename); String getGrantPath(String queryPath)
[CALLS-EXTERNAL] this.type.eq... | class ResourcePermission extends Permission {
@Override
public boolean implies(Permission p) {
if (!(p instanceof ResourcePermission))
return false;
ResourcePermission qp = (ResourcePermission) p;
/*
* Condition 1: The action flag of the queried permission was set in the granted permission
*/
int qu... | false | ok | {"focal": {"class": "ResourcePermission", "name": "implies", "signature": "boolean implies(Permission p)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "p", "type": "Permission"}], "return_type": "boolean"}, "class_info": {"name": "ResourcePermission", "kind": "class", "modifiers": "", "supercl... | |
27721932_273 | class MultipleNodeAssert extends FactoryBasedNavigableIterableAssert<MultipleNodeAssert, Iterable<Node>, Node, SingleNodeAssert> {
public AbstractListAssert<?, List<? extends String>, String, ObjectAssert<String>> extractingText() {
isNotNull();
List<String> values = new ArrayList<>();
fo... |
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<feed>" +
" <title>My Simple Feed</title>" +
" <entry attr1=\"value1\" />" +
" <entry attr1=\"value2\"/>" +
" <entry />" +
" <entry attr1=\"valu... | [FOCAL] public AbstractListAssert<?, List<? extends String>, String, ObjectAssert<String>> MultipleNodeAssert.extractingText()
[CLASS] class MultipleNodeAssert extends FactoryBasedNavigableIterableAssert<MultipleNodeAssert, Iterable<Node>, Node, SingleNodeAssert>
[METRICS] loc=18 cc=3 branches=1 loops=1 returns=1 throw... | /* static context
[FOCAL] public AbstractListAssert<?, List<? extends String>, String, ObjectAssert<String>> MultipleNodeAssert.extractingText()
[PATH1] foreach(Node node : actual)=T -> if(textContent != null)=T -> exit loop -> return newListAssertInstance(values).as(description)
[PATH2] foreach(Node node : actual)=F -... | /* static context
[FOCAL] public AbstractListAssert<?, List<? extends String>, String, ObjectAssert<String>> MultipleNodeAssert.extractingText()
[PATH1] foreach(Node node : actual)=T -> if(textContent != null)=T -> exit loop -> return newListAssertInstance(values).as(description)
[PATH2] foreach(Node node : actual)=F -... | true | ok | {"focal": {"class": "MultipleNodeAssert", "name": "extractingText", "signature": "AbstractListAssert<?, List<? extends String>, String, ObjectAssert<String>> extractingText()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "AbstractListAssert<?, List<? extends String>, String, ObjectAssert<String... |
27728683_0 | class Utils {
static public int getMiddleIndex(int beginIndex, int endIndex)
{
return beginIndex + (endIndex - beginIndex) / 2;
}
static public void main(String[] args);
static public int[] getRandomIntArray(Random rand, int size);
static public Integer[] getRandomIntegerArray(Random r... | assertEquals(5, Utils.getMiddleIndex(0, 10));
}
} | [FOCAL] static public int Utils.getMiddleIndex(int beginIndex, int endIndex)
[CLASS] class Utils
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[INPUTS] branches=- | result=beginIndex, endIndex
[DATAFLOW] beginIndex@param->L3; endIndex@param->L3
[CLASS-MEMBERS] void main(String[] args); int[] getR... | /* static context
[FOCAL] static public int Utils.getMiddleIndex(int beginIndex, int endIndex)
[INPUTS] branches=- | result=beginIndex, endIndex
*/
| /* static context
[FOCAL] static public int Utils.getMiddleIndex(int beginIndex, int endIndex)
[INPUTS] branches=- | result=beginIndex, endIndex
*/
class Utils {
static public int getMiddleIndex(int beginIndex, int endIndex)
{
return beginIndex + (endIndex - beginIndex) / 2;
}
static public vo... | true | ok | {"focal": {"class": "Utils", "name": "getMiddleIndex", "signature": "int getMiddleIndex(int beginIndex, int endIndex)", "start_line": 3, "modifiers": "static public", "params": [{"name": "beginIndex", "type": "int"}, {"name": "endIndex", "type": "int"}], "return_type": "int"}, "class_info": {"name": "Utils", "kind": "c... |
27764873_17 | class SimpleConsumer {
public TopicAndPartition getTopicAndPartition() {
return topicAndPartition;
}
public SimpleConsumer(TalosConsumerConfig consumerConfig,
TopicAndPartition topicAndPartition, MessageService.Iface messageClient,
String consumerIdPrefix);
public SimpleConsumer(TalosConsume... | assertEquals(topicAndPartition, simpleConsumer.getTopicAndPartition());
}
} | [FOCAL] public TopicAndPartition SimpleConsumer.getTopicAndPartition()
[CLASS] class SimpleConsumer
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[FIELDS] read=topicAndPartition:TopicAndPartition
[INPUTS] branches=- | result=topicAndPartition
[DATAFLOW] this.topicAndPartition@param->L2
[CLASS-MEM... | /* static context
[FOCAL] public TopicAndPartition SimpleConsumer.getTopicAndPartition()
[INPUTS] branches=- | result=topicAndPartition
[FIELDS] read=topicAndPartition:TopicAndPartition
*/
| /* static context
[FOCAL] public TopicAndPartition SimpleConsumer.getTopicAndPartition()
[INPUTS] branches=- | result=topicAndPartition
[FIELDS] read=topicAndPartition:TopicAndPartition
*/
class SimpleConsumer {
public TopicAndPartition getTopicAndPartition() {
return topicAndPartition;
}
public SimpleCons... | true | ok | {"focal": {"class": "SimpleConsumer", "name": "getTopicAndPartition", "signature": "TopicAndPartition getTopicAndPartition()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "TopicAndPartition"}, "class_info": {"name": "SimpleConsumer", "kind": "class", "modifiers": "", "superclass": null, "interf... |
27773224_0 | class Boxer {
@SuppressWarnings("unchecked")
public static <T> Boxer<T> from(T object) {
for(String target : defaultWrappers.keySet()){
try{
if(Class.forName(target).isAssignableFrom(object.getClass())){
return defaultWrappers.get(target).getDeclaredConst... | Assertions.assertThat(Boxer.from(null))
.isNull();
}
} | [FOCAL] @SuppressWarnings("unchecked") public static Boxer<T> Boxer.from(T object)
[CLASS] class Boxer
[METRICS] loc=30 cc=9 branches=4 loops=2 returns=3 throws=0 nesting=4
[CALLS-EXTERNAL] defaultWrappers.keySet/0, Class.forName(target).isAssignableFrom/1, Class.forName/1, T.getClass/0, defaultWrappers.get(target).get... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public static Boxer<T> Boxer.from(T object)
[PATH1] foreach(String target : defaultWrappers.keySet())=T -> try-body throws -> exit loop -> if(wrappers.containsKey(object.getClass()))=F -> foreach(Class wrapperClass : wrappers.keySet())=T -> if(wrapperClass.isAssi... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public static Boxer<T> Boxer.from(T object)
[PATH1] foreach(String target : defaultWrappers.keySet())=T -> try-body throws -> exit loop -> if(wrappers.containsKey(object.getClass()))=F -> foreach(Class wrapperClass : wrappers.keySet())=T -> if(wrapperClass.isAssi... | true | ok | {"focal": {"class": "Boxer", "name": "from", "signature": "Boxer<T> from(T object)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public static", "params": [{"name": "object", "type": "T"}], "return_type": "Boxer<T>"}, "class_info": {"name": "Boxer", "kind": "class", "modifiers": "", "superclass": nu... |
27785546_57 | class SnifferInputStream extends InputStream {
@Override
public int read() throws IOException {
snifferSocket.checkConnectionAllowed(0);
long start = System.currentTimeMillis();
int bytesDown = 0;
try {
int read = delegate.read();
if (read != -1) bytesDow... |
ByteArrayInputStream bais = new ByteArrayInputStream(DATA);
SnifferInputStream sis = new SnifferInputStream(snifferSocket, bais);
int read;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
while ((read = sis.read()) != -1) {
baos.write(read);
}
... | [FOCAL] @Override public int SnifferInputStream.read()
[CLASS] class SnifferInputStream extends InputStream
[METRICS] loc=14 cc=3 branches=1 loops=0 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] void sleepIfRequired(int bytesDown)
[CALLS-EXTERNAL] SnifferSocketImpl.checkConnectionAllowed/1, System.currentTimeMillis/0, ... | /* static context
[FOCAL] @Override public int SnifferInputStream.read()
[PATH1] if(read != -1)=T -> return read
[PATH2] try-body throws
[PATH3] if(read != -1)=F -> return read
[COLLABORATORS] field snifferSocket:SnifferSocketImpl checkConnectionAllowed/1,logSocket/3; field delegate read/0
[EXCEPTIONS] declares IOExcep... | /* static context
[FOCAL] @Override public int SnifferInputStream.read()
[PATH1] if(read != -1)=T -> return read
[PATH2] try-body throws
[PATH3] if(read != -1)=F -> return read
[COLLABORATORS] field snifferSocket:SnifferSocketImpl checkConnectionAllowed/1,logSocket/3; field delegate read/0
[EXCEPTIONS] declares IOExcep... | true | ok | {"focal": {"class": "SnifferInputStream", "name": "read", "signature": "int read() throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "SnifferInputStream", "kind": "class", "modifiers": "", "superclass": "InputStream", "interfaces": null, "... |
27789592_28 | class PathVisitor {
public Optional<String> visitPath(ExecutableElement element) {
String aggregatedPath = emptyToNull(
aggregate(
currentPath(element).orElse(""),
element.getEnclosingElement()
)
);
return Optional.ofNullable(aggregate... | ExecutableElement method = methodElements.of(
"java.lang.String",
"toString"
);
assertThat(visitor.visitPath(method).isPresent()).isFalse();
}
} | [FOCAL] public Optional<String> PathVisitor.visitPath(ExecutableElement element)
[CLASS] class PathVisitor
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Optional<String> currentPath(Element element); String aggregate(String acc, Element element)
[CALLS-EXTERNAL] emptyToNull/1 (in... | /* static context
[FOCAL] public Optional<String> PathVisitor.visitPath(ExecutableElement element)
[INPUTS] branches=- | result=element
[COLLABORATORS] param element:ExecutableElement getEnclosingElement/0
[CALLS-INTERNAL] Optional<String> currentPath(Element element); String aggregate(String acc, Element element)
[CAL... | /* static context
[FOCAL] public Optional<String> PathVisitor.visitPath(ExecutableElement element)
[INPUTS] branches=- | result=element
[COLLABORATORS] param element:ExecutableElement getEnclosingElement/0
[CALLS-INTERNAL] Optional<String> currentPath(Element element); String aggregate(String acc, Element element)
[CAL... | true | ok | {"focal": {"class": "PathVisitor", "name": "visitPath", "signature": "Optional<String> visitPath(ExecutableElement element)", "start_line": 3, "modifiers": "public", "params": [{"name": "element", "type": "ExecutableElement"}], "return_type": "Optional<String>"}, "class_info": {"name": "PathVisitor", "kind": "class", "... |
27811092_45 | class ReserveServiceImpl implements ReserveService {
@Override
public void cancel(String reserveNo) throws BusinessException {
Reserve reserve = findOneWithTourInfo(reserveNo);
String transfer = reserve.getTransfer();
if (Reserve.TRANSFERED.equals(transfer)) {
ResultMessage... | Reserve reserve = new Reserve("001");
reserve.setAdultCount(1);
reserve.setChildCount(2);
TourInfo tour = new TourInfo("01");
reserve.setTourInfo(tour);
reserve.setTransfer(Reserve.NOT_TRANSFERED);
when(reserveRepository.findById("001")).thenReturn(Optional.of(
... | [FOCAL] @Override public void ReserveServiceImpl.cancel(String reserveNo)
[CLASS] class ReserveServiceImpl implements ReserveService
[METRICS] loc=35 cc=4 branches=3 loops=0 returns=0 throws=3 nesting=1
[CALLS-INTERNAL] Reserve findOneWithTourInfo(String reserveNo)
[CALLS-EXTERNAL] Reserve.getTransfer/0, Reserve.TRANSF... | /* static context
[FOCAL] @Override public void ReserveServiceImpl.cancel(String reserveNo)
[THROWS-WHEN] BusinessException when Reserve.TRANSFERED.equals(transfer)
[THROWS-WHEN] BusinessException when !Reserve.TRANSFERED.equals(transfer) && tourInfoSharedService.isOverPaymentLimit(info)
[THROWS-WHEN] BusinessException... | /* static context
[FOCAL] @Override public void ReserveServiceImpl.cancel(String reserveNo)
[THROWS-WHEN] BusinessException when Reserve.TRANSFERED.equals(transfer)
[THROWS-WHEN] BusinessException when !Reserve.TRANSFERED.equals(transfer) && tourInfoSharedService.isOverPaymentLimit(info)
[THROWS-WHEN] BusinessException... | true | ok | {"focal": {"class": "ReserveServiceImpl", "name": "cancel", "signature": "void cancel(String reserveNo) throws BusinessException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "reserveNo", "type": "String"}], "return_type": "void"}, "class_info": {"name": "ReserveServiceImpl", "kind": "class", ... |
27824737_1 | class MatrixUtils {
public static double min(double[][] matrix) {
return Stream.of(matrix)
.mapToDouble(MatrixUtils::min)
.min().getAsDouble();
}
public static double max(double[][] matrix);
public static double max(double[] array);
public static double min(double[] array);
public static double[][] t... | double min = min(MATRIX);
assertEquals(1d, min, 0d);
}
} | [FOCAL] public static double MatrixUtils.min(double[][] matrix)
[CLASS] class MatrixUtils
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Stream.of(matrix) .mapToDouble(MatrixUtils::min) .min().getAsDouble/0, Stream.of(matrix) .mapToDouble(MatrixUtils::min).min/0, Stream.of(matrix)... | /* static context
[FOCAL] public static double MatrixUtils.min(double[][] matrix)
[INPUTS] branches=- | result=matrix
[CALLS-EXTERNAL] Stream.of(matrix) .mapToDouble(MatrixUtils::min) .min().getAsDouble/0, Stream.of(matrix) .mapToDouble(MatrixUtils::min).min/0, Stream.of(matrix).mapToDouble/1, Stream.of/1
*/
| /* static context
[FOCAL] public static double MatrixUtils.min(double[][] matrix)
[INPUTS] branches=- | result=matrix
[CALLS-EXTERNAL] Stream.of(matrix) .mapToDouble(MatrixUtils::min) .min().getAsDouble/0, Stream.of(matrix) .mapToDouble(MatrixUtils::min).min/0, Stream.of(matrix).mapToDouble/1, Stream.of/1
*/
class Matr... | true | ok | {"focal": {"class": "MatrixUtils", "name": "min", "signature": "double min(double[][] matrix)", "start_line": 3, "modifiers": "public static", "params": [{"name": "matrix", "type": "double[][]"}], "return_type": "double"}, "class_info": {"name": "MatrixUtils", "kind": "class", "modifiers": "", "superclass": null, "inte... |
27840419_29 | class ModelRecord {
public void delete(T model){
SingleRecordConfiguration configuration = setupDeleteConfiguration(new SingleRecordConfiguration(), model);
final DeleteCallback deleteCallback = DeleteCallback.createFromConfiguration(configuration, eventProcessor, httpReport, model);
config... | final Object object = new Object();
when(modelRecord.setupDeleteConfiguration(any(SingleRecordConfiguration.class), eq(object))).thenReturn(singleRecordConfiguration);
doCallRealMethod().when(modelRecord).delete(object);
modelRecord.delete(object);
verify(modelRecord).setupDelet... | [FOCAL] public void ModelRecord.delete(T model)
[CLASS] class ModelRecord
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] SingleRecordConfiguration setupDeleteConfiguration(SingleRecordConfiguration configuration, T model)
[CALLS-EXTERNAL] DeleteCallback.createFromConfiguration/4, ... | /* static context
[FOCAL] public void ModelRecord.delete(T model)
[CALLS-INTERNAL] SingleRecordConfiguration setupDeleteConfiguration(SingleRecordConfiguration configuration, T model)
[NEW] SingleRecordConfiguration
[CALLS-EXTERNAL] DeleteCallback.createFromConfiguration/4, SingleRecordConfiguration.performAsynchronous... | /* static context
[FOCAL] public void ModelRecord.delete(T model)
[CALLS-INTERNAL] SingleRecordConfiguration setupDeleteConfiguration(SingleRecordConfiguration configuration, T model)
[NEW] SingleRecordConfiguration
[CALLS-EXTERNAL] DeleteCallback.createFromConfiguration/4, SingleRecordConfiguration.performAsynchronous... | true | ok | {"focal": {"class": "ModelRecord", "name": "delete", "signature": "void delete(T model)", "start_line": 3, "modifiers": "public", "params": [{"name": "model", "type": "T"}], "return_type": "void"}, "class_info": {"name": "ModelRecord", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": ... |
27879839_9 | class PJDatum extends PJ implements GeodeticDatum, PrimeMeridian, Ellipsoid {
public Unit<Length> getLinearUnit(final boolean vertical) {
final double factor = getLinearUnitToMetre(vertical);
int i = Arrays.binarySearch(LINEAR_FACTORS, factor);
if (i < 0) {
i = ~i;
i... | PJDatum pj;
pj = new PJDatum(null, "+proj=merc +to_meter=" + (1 + PJDatum.EPS/2));
assertSame(Units.METRE, pj.getLinearUnit(false));
pj = new PJDatum(null, "+proj=merc +to_meter=" + (1000 - PJDatum.EPS/2));
assertSame(Units.KILOMETRE, pj.getLinearUnit(false));
}
} | [FOCAL] public Unit<Length> PJDatum.getLinearUnit(boolean vertical)
[CLASS] class PJDatum extends PJ implements GeodeticDatum, PrimeMeridian, Ellipsoid
[METRICS] loc=13 cc=4 branches=3 loops=0 returns=2 throws=0 nesting=3
[CALLS-EXTERNAL] getLinearUnitToMetre/1 (inherited), Arrays.binarySearch/2, abs/1 (inherited), Dou... | /* static context
[FOCAL] public Unit<Length> PJDatum.getLinearUnit(boolean vertical)
[PATH1] if(i < 0)=T -> if(i == LINEAR_FACTORS.length || !(abs(factor - LINEAR_FACTORS[i]) <= EPS))=T -> if(i == 0 || !(abs(factor - LINEAR_FACTORS[--i]) <= EPS))=T -> return (factor == 0 || Double.isNaN(factor)) ? null : Units.METRE.m... | /* static context
[FOCAL] public Unit<Length> PJDatum.getLinearUnit(boolean vertical)
[PATH1] if(i < 0)=T -> if(i == LINEAR_FACTORS.length || !(abs(factor - LINEAR_FACTORS[i]) <= EPS))=T -> if(i == 0 || !(abs(factor - LINEAR_FACTORS[--i]) <= EPS))=T -> return (factor == 0 || Double.isNaN(factor)) ? null : Units.METRE.m... | true | ok | {"focal": {"class": "PJDatum", "name": "getLinearUnit", "signature": "Unit<Length> getLinearUnit(boolean vertical)", "start_line": 3, "modifiers": "public", "params": [{"name": "vertical", "type": "boolean"}], "return_type": "Unit<Length>"}, "class_info": {"name": "PJDatum", "kind": "class", "modifiers": "", "superclas... |
27984624_8 | class FreeMarker implements TemplateEngine {
@Override
public String get(String resource, Object args) {
Template template = getTemplate(resource);
return processTemplate(args, template);
}
@Override public String get(String resource);
protected static Template getTemplate(String t... | // prepare
Map<String, Object> param = new HashMap<>();
param.put("deptno", 30);
param.put("job", "SALESMAN");
// execute
String result = new FreeMarker().get("ftl/selectByArgs.sql", param);
// assert
String[] results = result.split("\n");
int i... | [FOCAL] @Override public String FreeMarker.get(String resource, Object args)
[CLASS] class FreeMarker implements TemplateEngine
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String processTemplate(Object context, Template template); Template getTemplate(String templateName)
[INPU... | /* static context
[FOCAL] @Override public String FreeMarker.get(String resource, Object args)
[INPUTS] branches=- | result=args, resource
[CALLS-INTERNAL] String processTemplate(Object context, Template template); Template getTemplate(String templateName)
*/
| /* static context
[FOCAL] @Override public String FreeMarker.get(String resource, Object args)
[INPUTS] branches=- | result=args, resource
[CALLS-INTERNAL] String processTemplate(Object context, Template template); Template getTemplate(String templateName)
*/
class FreeMarker implements TemplateEngine {
@Override
... | true | ok | {"focal": {"class": "FreeMarker", "name": "get", "signature": "String get(String resource, Object args)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "resource", "type": "String"}, {"name": "args", "type": "Object"}], "return_type": "String"}, "class_info": {"name": "FreeMarker", "kind": "clas... |
27988806_2 | class TypeUtils {
public static Type[] getGenericsTypesByClass(Class clazz, Type type) {
Class targetClass = clazz;
while (targetClass != null) {
for (Type in : targetClass.getGenericInterfaces()) {
if (in instanceof ParameterizedType &&
type.equa... | Class<? extends Serializer> clazz = SerializerImpl.class;
Type[] types = TypeUtils.getGenericsTypesByClass(clazz, Serializer.class);
assertThat(types.length).isEqualTo(2);
assertThat(types[0].getTypeName()).isEqualTo("java.lang.String");
assertThat(types[1].getTypeName()).isEqual... | [FOCAL] public static Type[] TypeUtils.getGenericsTypesByClass(Class clazz, Type type)
[CLASS] class TypeUtils
[METRICS] loc=18 cc=5 branches=2 loops=2 returns=2 throws=1 nesting=3
[CALLS-EXTERNAL] Class.getGenericInterfaces/0, Type.equals/1, ((ParameterizedType) in).getRawType/0, ((ParameterizedType) in).getActualType... | /* static context
[FOCAL] public static Type[] TypeUtils.getGenericsTypesByClass(Class clazz, Type type)
[THROWS-WHEN] UnsupportedOperationException when targetClass != null && foreach(Type in : targetClass.getGenericInterfaces())=T && !(in instanceof ParameterizedType && type.equals(((ParameterizedType) in).getRawType... | /* static context
[FOCAL] public static Type[] TypeUtils.getGenericsTypesByClass(Class clazz, Type type)
[THROWS-WHEN] UnsupportedOperationException when targetClass != null && foreach(Type in : targetClass.getGenericInterfaces())=T && !(in instanceof ParameterizedType && type.equals(((ParameterizedType) in).getRawType... | true | ok | {"focal": {"class": "TypeUtils", "name": "getGenericsTypesByClass", "signature": "Type[] getGenericsTypesByClass(Class clazz, Type type)", "start_line": 3, "modifiers": "public static", "params": [{"name": "clazz", "type": "Class"}, {"name": "type", "type": "Type"}], "return_type": "Type[]"}, "class_info": {"name": "Ty... |
27989980_3 | class Calculator {
@WebMethod
public float mul(float a, float b) {
return a * b;
}
@WebMethod public float sum(float a, float b);
@WebMethod public float div(float a, float b);
@WebMethod public float sub(float a, float b);
}
class CalculatorTest {
@Test
public void testMul(... | Calculator calculator = new Calculator();
assertEquals(0.0F, (float) calculator.mul(1, 0), -1);
}
} | [FOCAL] @WebMethod public float Calculator.mul(float a, float b)
[CLASS] class Calculator
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[INPUTS] branches=- | result=a, b
[DATAFLOW] a@param->L3; b@param->L3
[CLASS-MEMBERS] float sum(float a, float b); float div(float a, float b); float sub(float a... | /* static context
[FOCAL] @WebMethod public float Calculator.mul(float a, float b)
[INPUTS] branches=- | result=a, b
*/
| /* static context
[FOCAL] @WebMethod public float Calculator.mul(float a, float b)
[INPUTS] branches=- | result=a, b
*/
class Calculator {
@WebMethod
public float mul(float a, float b) {
return a * b;
}
@WebMethod public float sum(float a, float b);
@WebMethod public float div(float a, flo... | true | ok | {"focal": {"class": "Calculator", "name": "mul", "signature": "float mul(float a, float b)", "start_line": 3, "modifiers": "@WebMethod public", "params": [{"name": "a", "type": "float"}, {"name": "b", "type": "float"}], "return_type": "float"}, "class_info": {"name": "Calculator", "kind": "class", "modifiers": "", "sup... |
28071993_7 | class RxSharedPreferences {
@CheckResult @NonNull
public Preference<Float> getFloat(@NonNull String key) {
return getFloat(key, DEFAULT_FLOAT);
}
private RxSharedPreferences(final SharedPreferences preferences);
@CheckResult @NonNull public static RxSharedPreferences create(@NonNull SharedPreferences ... | try {
rxPreferences.getFloat("key", null);
fail();
} catch (NullPointerException e) {
assertThat(e).hasMessage("defaultValue == null");
}
}
} | [FOCAL] @CheckResult @NonNull public Preference<Float> RxSharedPreferences.getFloat(String key)
[CLASS] class RxSharedPreferences
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Preference<Float> getFloat(String key, Float defaultValue)
[INPUTS] branches=- | result=key
[DATAFLOW] k... | /* static context
[FOCAL] @CheckResult @NonNull public Preference<Float> RxSharedPreferences.getFloat(String key)
[INPUTS] branches=- | result=key
[CALLS-INTERNAL] Preference<Float> getFloat(String key, Float defaultValue)
*/
| /* static context
[FOCAL] @CheckResult @NonNull public Preference<Float> RxSharedPreferences.getFloat(String key)
[INPUTS] branches=- | result=key
[CALLS-INTERNAL] Preference<Float> getFloat(String key, Float defaultValue)
*/
class RxSharedPreferences {
@CheckResult @NonNull
public Preference<Float> getFloat(@NonN... | true | ok | {"focal": {"class": "RxSharedPreferences", "name": "getFloat", "signature": "Preference<Float> getFloat(String key)", "start_line": 3, "modifiers": "@CheckResult @NonNull public", "params": [{"name": "key", "type": "String"}], "return_type": "Preference<Float>"}, "class_info": {"name": "RxSharedPreferences", "kind": "c... |
28075895_4 | class CollectionUtil {
public static boolean hasElements(Collection<?> collection){
return collection != null && !collection.isEmpty();
}
public static boolean isNullOrEmpty(Collection<?> collection);
}
class CollectionUtilTest {
@Test
public void shouldReturnFalseIfCollectionIsEmpty(){
| List<String> emptyList = new ArrayList<String>();
Assert.assertFalse(CollectionUtil.hasElements(emptyList));
}
} | [FOCAL] public static boolean CollectionUtil.hasElements(Collection<?> collection)
[CLASS] class CollectionUtil
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Collection<?>.isEmpty/0
[INPUTS] branches=- | result=collection
[COLLABORATORS] param collection:Collection<?> isEmpty/0
[... | /* static context
[FOCAL] public static boolean CollectionUtil.hasElements(Collection<?> collection)
[INPUTS] branches=- | result=collection
[COLLABORATORS] param collection:Collection<?> isEmpty/0
[CALLS-EXTERNAL] Collection<?>.isEmpty/0
*/
| /* static context
[FOCAL] public static boolean CollectionUtil.hasElements(Collection<?> collection)
[INPUTS] branches=- | result=collection
[COLLABORATORS] param collection:Collection<?> isEmpty/0
[CALLS-EXTERNAL] Collection<?>.isEmpty/0
*/
class CollectionUtil {
public static boolean hasElements(Collection<?> colle... | true | ok | {"focal": {"class": "CollectionUtil", "name": "hasElements", "signature": "boolean hasElements(Collection<?> collection)", "start_line": 3, "modifiers": "public static", "params": [{"name": "collection", "type": "Collection<?>"}], "return_type": "boolean"}, "class_info": {"name": "CollectionUtil", "kind": "class", "mod... |
28086563_0 | class DataService {
public abstract Collection<Product> getAllProducts()public abstract Collection<Product> getAllProducts();
public abstract Collection<Product> getAllProducts()public abstract Collection<Category> getAllCategories();
public abstract Collection<Product> getAllProducts()public abstract void updateProd... | assertFalse(service.getAllProducts().isEmpty());
}
} | [FOCAL] public abstract Collection<Product> DataService.getAllProducts()
[CLASS] class DataService
[METRICS] loc=1 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CLASS-MEMBERS] Collection<Category> getAllCategories(); void updateProduct(Product p); void deleteProduct(int productId); Product getProductById(int pr... | /* static context
[FOCAL] public abstract Collection<Product> DataService.getAllProducts()
*/
| /* static context
[FOCAL] public abstract Collection<Product> DataService.getAllProducts()
*/
class DataService {
public abstract Collection<Product> getAllProducts()public abstract Collection<Product> getAllProducts();
public abstract Collection<Product> getAllProducts()public abstract Collection<Category> getAllCat... | true | partial | {"focal": {"class": "DataService", "name": "getAllProducts", "signature": "Collection<Product> getAllProducts()", "start_line": 3, "modifiers": "public abstract", "params": [], "return_type": "Collection<Product>"}, "class_info": {"name": "DataService", "kind": "class", "modifiers": "", "superclass": null, "interfaces"... |
28129477_0 | class NodeManager {
public Node getOrCreateNode(Manager manager, String key, GraphDatabaseService db)
{
// Federates requests to a graph node data management object
return manager.getOrCreateNode(key, db);
}
public NodeManager();
public static Map<String, Object> getNodeFromGloba... | GraphDatabaseService db = setUpDb();
NodeManager nodeManager = new NodeManager();
NodeManager.globalNodeCache.invalidateAll();
DataNodeManager.dataCache.invalidateAll();
DataNodeManager dataNodeManager = new DataNodeManager();
// Write some nodes to the database
... | [FOCAL] public Node NodeManager.getOrCreateNode(Manager manager, String key, GraphDatabaseService db)
[CLASS] class NodeManager
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Manager.getOrCreateNode/2
[INPUTS] branches=- | result=db, key, manager
[COLLABORATORS] param manager:Mana... | /* static context
[FOCAL] public Node NodeManager.getOrCreateNode(Manager manager, String key, GraphDatabaseService db)
[INPUTS] branches=- | result=db, key, manager
[COLLABORATORS] param manager:Manager getOrCreateNode/2
[CALLS-EXTERNAL] Manager.getOrCreateNode/2
*/
| /* static context
[FOCAL] public Node NodeManager.getOrCreateNode(Manager manager, String key, GraphDatabaseService db)
[INPUTS] branches=- | result=db, key, manager
[COLLABORATORS] param manager:Manager getOrCreateNode/2
[CALLS-EXTERNAL] Manager.getOrCreateNode/2
*/
class NodeManager {
public Node getOrCreateNode... | true | ok | {"focal": {"class": "NodeManager", "name": "getOrCreateNode", "signature": "Node getOrCreateNode(Manager manager, String key, GraphDatabaseService db)", "start_line": 3, "modifiers": "public", "params": [{"name": "manager", "type": "Manager"}, {"name": "key", "type": "String"}, {"name": "db", "type": "GraphDatabaseServ... |
28138459_13 | class AnnotationDtoInfoResolver extends BaseDtoInfoResolver {
@Override
public <D, I> I resolveId(D dto, Class<I> aggregateIdClass) {
ParameterHolder<D> parameterHolder = getIdParameterHolder(dto, aggregateIdClass);
return createIdentifier(aggregateIdClass, parameterHolder.uniqueElement(dto),
... | when(domainRegistry.getFactory(Case2DtoVO.class)).thenReturn(new Case2DtoVOFactory());
Case2DtoVO id = underTest.resolveId(new Case2Dto(firstName, birthDate), Case2DtoVO.class);
assertThat(id).isNotNull();
assertThat(id).isEqualTo(new Case2DtoVO(firstName, birthDate));
}
} | [FOCAL] @Override public I AnnotationDtoInfoResolver.resolveId(D dto, Class<I> aggregateIdClass)
[CLASS] class AnnotationDtoInfoResolver extends BaseDtoInfoResolver
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] ParameterHolder<D> getIdParameterHolder(D dto, Class<I> aggregateIdCl... | /* static context
[FOCAL] @Override public I AnnotationDtoInfoResolver.resolveId(D dto, Class<I> aggregateIdClass)
[INPUTS] branches=- | result=aggregateIdClass, dto
[CALLS-INTERNAL] ParameterHolder<D> getIdParameterHolder(D dto, Class<I> aggregateIdClass)
[CALLS-EXTERNAL] createIdentifier/3 (inherited), ParameterHolde... | /* static context
[FOCAL] @Override public I AnnotationDtoInfoResolver.resolveId(D dto, Class<I> aggregateIdClass)
[INPUTS] branches=- | result=aggregateIdClass, dto
[CALLS-INTERNAL] ParameterHolder<D> getIdParameterHolder(D dto, Class<I> aggregateIdClass)
[CALLS-EXTERNAL] createIdentifier/3 (inherited), ParameterHolde... | true | ok | {"focal": {"class": "AnnotationDtoInfoResolver", "name": "resolveId", "signature": "I resolveId(D dto, Class<I> aggregateIdClass)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "dto", "type": "D"}, {"name": "aggregateIdClass", "type": "Class<I>"}], "return_type": "I"}, "class_info": {"name": "A... |
28146647_4 | class GeometricDistribution {
public static double getProb(int x, double p) {
return Math.pow(2, getLog2Prob(x, p));
}
private GeometricDistribution();
public static double getLog2Prob(int x, double p);
}
class GeometricDistributionTest {
@Test
public void testGetProb() {
| assertEquals(GeometricDistribution.getProb(1, .1), .1, 1E-10);
assertEquals(GeometricDistribution.getLog2Prob(1, .1),
DoubleMath.log2(.1), 1E-10);
assertEquals(GeometricDistribution.getProb(2, .1), .09, 1E-10);
assertEquals(GeometricDistribution.getLog2Prob(2, .1),
DoubleMath.log2(.09), 1E-10);
}
} | [FOCAL] public static double GeometricDistribution.getProb(int x, double p)
[CLASS] class GeometricDistribution
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] double getLog2Prob(int x, double p)
[CALLS-EXTERNAL] Math.pow/2
[INPUTS] branches=- | result=p, x
[DATAFLOW] p@param->L2; ... | /* static context
[FOCAL] public static double GeometricDistribution.getProb(int x, double p)
[INPUTS] branches=- | result=p, x
[CALLS-INTERNAL] double getLog2Prob(int x, double p)
[CALLS-EXTERNAL] Math.pow/2
*/
| /* static context
[FOCAL] public static double GeometricDistribution.getProb(int x, double p)
[INPUTS] branches=- | result=p, x
[CALLS-INTERNAL] double getLog2Prob(int x, double p)
[CALLS-EXTERNAL] Math.pow/2
*/
class GeometricDistribution {
public static double getProb(int x, double p) {
return Math.pow(2, getLog2... | true | ok | {"focal": {"class": "GeometricDistribution", "name": "getProb", "signature": "double getProb(int x, double p)", "start_line": 3, "modifiers": "public static", "params": [{"name": "x", "type": "int"}, {"name": "p", "type": "double"}], "return_type": "double"}, "class_info": {"name": "GeometricDistribution", "kind": "cla... |
28174434_1 | class MultiProtocol extends AbstractProtocol<T> {
@Override
public ProtocolMonitor<T> createMonitor(String name) {
return new MultiProtocolMonitor<T>(name, this);
}
public MultiProtocol(final List<Protocol<MultiProtocolMonitor<T>>> protocols);
private final MultiProtocol<Object> protocol... | ProtocolMonitor<Object> monitor = this.protocol.createMonitor("abc");
Assert.assertEquals("IdleState", monitor.getStateInfo());
monitor.read((byte) 0x8a);
Assert.assertEquals("RunningState", monitor.getStateInfo());
monitor.read((byte) 0x8a);
Assert.assertEquals("Running... | [FOCAL] @Override public ProtocolMonitor<T> MultiProtocol.createMonitor(String name)
[CLASS] class MultiProtocol extends AbstractProtocol<T>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] MultiProtocolMonitor<T>
[INPUTS] branches=- | result=name
[DATAFLOW] name@param->L3
[CLASS-MEMBERS] Mult... | /* static context
[FOCAL] @Override public ProtocolMonitor<T> MultiProtocol.createMonitor(String name)
[INPUTS] branches=- | result=name
[NEW] MultiProtocolMonitor<T>
*/
| /* static context
[FOCAL] @Override public ProtocolMonitor<T> MultiProtocol.createMonitor(String name)
[INPUTS] branches=- | result=name
[NEW] MultiProtocolMonitor<T>
*/
class MultiProtocol extends AbstractProtocol<T> {
@Override
public ProtocolMonitor<T> createMonitor(String name) {
return new MultiPr... | true | ok | {"focal": {"class": "MultiProtocol", "name": "createMonitor", "signature": "ProtocolMonitor<T> createMonitor(String name)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "name", "type": "String"}], "return_type": "ProtocolMonitor<T>"}, "class_info": {"name": "MultiProtocol", "kind": "class", "mo... |
28176479_21 | class NubitsURI {
public String getLabel() {
return (String) parameterMap.get(FIELD_LABEL);
}
public NubitsURI(String uri);
public NubitsURI(@Nullable NetworkParameters params, String input);
private void parseParameters(@Nullable NetworkParameters params, String addressToken, String[] ... | assertNull(new NubitsURI(MainNetParams.get(), NubitsURI.NUBITS_SCHEME + ":" + MAINNET_GOOD_ADDRESS
+ "?label=").getLabel());
}
} | [FOCAL] public String NubitsURI.getLabel()
[CLASS] class NubitsURI
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] parameterMap.get/1
[COLLABORATORS] field parameterMap get/1
[CLASS-MEMBERS] NubitsURI(String uri); NubitsURI(NetworkParameters params, String input); void parseParamet... | /* static context
[FOCAL] public String NubitsURI.getLabel()
[COLLABORATORS] field parameterMap get/1
[CALLS-EXTERNAL] parameterMap.get/1
*/
| /* static context
[FOCAL] public String NubitsURI.getLabel()
[COLLABORATORS] field parameterMap get/1
[CALLS-EXTERNAL] parameterMap.get/1
*/
class NubitsURI {
public String getLabel() {
return (String) parameterMap.get(FIELD_LABEL);
}
public NubitsURI(String uri);
public NubitsURI(@Nullable ... | true | ok | {"focal": {"class": "NubitsURI", "name": "getLabel", "signature": "String getLabel()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "NubitsURI", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "testObject", "type": "... |
28190686_4 | class DomainResource {
@RequestMapping(value = "/rest/domains/{id}",
method = RequestMethod.DELETE,
produces = MediaType.APPLICATION_JSON_VALUE)
@Timed
public void delete(@PathVariable String id) {
log.debug("REST request to delete Domain : {}", id);
domainRepository... | // Initialize the database
domainRepository.save(domain);
// Get the domain
restDomainMockMvc.perform(delete("/app/rest/domains/{id}", domain.getId())
.accept(TestUtil.APPLICATION_JSON_UTF8))
.andExpect(status().isOk());
// Validate the database ... | [FOCAL] @RequestMapping(value = "/rest/domains/{id}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VA... void DomainResource.delete(String id)
[CLASS] class DomainResource
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] log.debug/2, DomainRepository.delete/1... | /* static context
[FOCAL] @RequestMapping(value = "/rest/domains/{id}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VA... void DomainResource.delete(String id)
[COLLABORATORS] field domainRepository:DomainRepository delete/1
[FIELDS] read=domainRepository:DomainRepository
[CALLS-EXTERNAL] log.d... | /* static context
[FOCAL] @RequestMapping(value = "/rest/domains/{id}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VA... void DomainResource.delete(String id)
[COLLABORATORS] field domainRepository:DomainRepository delete/1
[FIELDS] read=domainRepository:DomainRepository
[CALLS-EXTERNAL] log.d... | true | ok | {"focal": {"class": "DomainResource", "name": "delete", "signature": "void delete(String id)", "start_line": 3, "modifiers": "@RequestMapping(value = \"/rest/domains/{id}\", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VA...", "params": [{"name": "id", "type": "String"}], "return_type": "void"},... |
28275464_0 | class OperatorExpression extends Expression {
@Override
public Value evaluate(final State state) throws SetlException {
ArrayDeque<Value> values = new ArrayDeque<>(numberOfOperators);
ArrayDeque<Value> valuesForReplay = new ArrayDeque<>(numberOfOperators);
for (int i = 0; i < numberOfO... | // given
FragmentList<AOperator> operators = new FragmentList<>();
addNumber(operators, 10);
addNumber(operators, 20);
operators.add(Sum.S);
// when
EvaluationResult result = evaluate(operators);
// then
assertEquals("10 + 20", result.getExpressi... | [FOCAL] @Override public Value OperatorExpression.evaluate(State state)
[CLASS] class OperatorExpression extends Expression
[METRICS] loc=42 cc=7 branches=1 loops=4 returns=1 throws=1 nesting=4
[CALLS-INTERNAL] void appendExpression(State state, StringBuilder sb, int maxOperatorDepth)
[CALLS-EXTERNAL] operators.get/1, ... | /* static context
[FOCAL] @Override public Value OperatorExpression.evaluate(State state)
[THROWS-WHEN] se when i < numberOfOperators && try-body throws && j > 0 && j <= i && j < numberOfOperators && j < numberOfOperators && operators.get(j) instanceof AZeroOperator
[THROWS-WHEN] se when i < numberOfOperators && try-bo... | /* static context
[FOCAL] @Override public Value OperatorExpression.evaluate(State state)
[THROWS-WHEN] se when i < numberOfOperators && try-body throws && j > 0 && j <= i && j < numberOfOperators && j < numberOfOperators && operators.get(j) instanceof AZeroOperator
[THROWS-WHEN] se when i < numberOfOperators && try-bo... | true | ok | {"focal": {"class": "OperatorExpression", "name": "evaluate", "signature": "Value evaluate(State state) throws SetlException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "state", "type": "State"}], "return_type": "Value"}, "class_info": {"name": "OperatorExpression", "kind": "class", "modifie... |
28275474_19 | class PhoneNumberUtil {
public final String formatCommon(final String pphoneNumber) {
return this.formatCommon(this.parsePhoneNumber(pphoneNumber));
}
public PhoneNumberUtil();
public PhoneNumberUtil(final String pcountryCode);
public final void setCountryCode(final String pcountryCode);
public fin... | Assert.assertNull("Should be null", this.phoneNumberUtil.formatCommon((PhoneNumberData) null));
for (final Entry<PhoneNumberInterface, String> testCase : PhoneNumberUtilTestCases
.getFormatCommonCases().entrySet()) {
final String formatedNumber = this.phoneNumberUtil.formatCommon(testCase.getKey()... | [FOCAL] public final String PhoneNumberUtil.formatCommon(String pphoneNumber)
[CLASS] class PhoneNumberUtil
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] PhoneNumberData parsePhoneNumber(String pphoneNumber); ValueWithPos<String> formatCommon(ValueWithPos<String> pphoneNumber)
[I... | class PhoneNumberUtil {
public final String formatCommon(final String pphoneNumber) {
return this.formatCommon(this.parsePhoneNumber(pphoneNumber));
}
public PhoneNumberUtil();
public PhoneNumberUtil(final String pcountryCode);
public final void setCountryCode(final String pcountryCode);
public fin... | false | ok | {"focal": {"class": "PhoneNumberUtil", "name": "formatCommon", "signature": "String formatCommon(String pphoneNumber)", "start_line": 3, "modifiers": "public final", "params": [{"name": "pphoneNumber", "type": "String"}], "return_type": "String"}, "class_info": {"name": "PhoneNumberUtil", "kind": "class", "modifiers": ... | |
28305374_290 | class GuestService {
public Map<String, String> customizeVM(HttpInputs httpInputs, VmInputs vmInputs, GuestInputs guestInputs, boolean isWin)
throws Exception {
ConnectionResources connectionResources = new ConnectionResources(httpInputs, vmInputs);
try {
ManagedObjectRefere... | whenNew(MorObjectHandler.class).withNoArguments().thenReturn(morObjectHandlerMock);
when(httpInputsMock.isCloseSession()).thenReturn(true);
when(morObjectHandlerMock.getMor(any(ConnectionResources.class), anyString(), anyString())).thenReturn(vmMorMock);
whenNew(GuestConfigSpecs.class).w... | [FOCAL] public Map<String, String> GuestService.customizeVM(HttpInputs httpInputs, VmInputs vmInputs, GuestInputs guestInputs, boolean isWin)
[CLASS] class GuestService
[METRICS] loc=29 cc=4 branches=2 loops=0 returns=3 throws=0 nesting=2
[CALLS-EXTERNAL] new MorObjectHandler().getMor/3, ManagedObjectType.VIRTUAL_MACHI... | /* static context
[FOCAL] public Map<String, String> GuestService.customizeVM(HttpInputs httpInputs, VmInputs vmInputs, GuestInputs guestInputs, boolean isWin)
[PATH1] try-body throws -> return ResponseUtils.getResultsMap(ex.toString(), Outputs.RETURN_CODE_FAIL... -> if(httpInputs.isCloseSession())=T
[PATH2] if(vmMor !... | /* static context
[FOCAL] public Map<String, String> GuestService.customizeVM(HttpInputs httpInputs, VmInputs vmInputs, GuestInputs guestInputs, boolean isWin)
[PATH1] try-body throws -> return ResponseUtils.getResultsMap(ex.toString(), Outputs.RETURN_CODE_FAIL... -> if(httpInputs.isCloseSession())=T
[PATH2] if(vmMor !... | true | ok | {"focal": {"class": "GuestService", "name": "customizeVM", "signature": "Map<String, String> customizeVM(HttpInputs httpInputs, VmInputs vmInputs, GuestInputs guestInputs, boolean isWin) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "httpInputs", "type": "HttpInputs"}, {"name": "vmInput... |
28312494_8 | class Wasp {
@SuppressWarnings("unchecked")
public <T> T create(Class<T> service) {
if (service == null) {
throw new NullPointerException("service param may not be null");
}
if (!service.isInterface()) {
throw new IllegalArgumentException("Only interface type is supported");
}
Netwo... | MockResponse response = new MockResponse()
.addHeader("Content-Type", "application/json; charset=utf-8")
.setBody("{\n" +
" \"no\": 123,\n" +
" \"name\": \"Hello\"\n" +
"}");
server.enqueue(response);
MyApiPost myApi = new Wasp.Builder(context)
... | [FOCAL] @SuppressWarnings("unchecked") public T Wasp.create(Class<T> service)
[CLASS] class Wasp
[METRICS] loc=11 cc=3 branches=2 loops=0 returns=1 throws=2 nesting=1
[CALLS-EXTERNAL] Class<T>.isInterface/0, NetworkHandler.newInstance/2, NetworkHandler.getProxyClass/0
[NEW] NullPointerException, IllegalArgumentExceptio... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public T Wasp.create(Class<T> service)
[THROWS-WHEN] NullPointerException when service == null
[THROWS-WHEN] IllegalArgumentException when !(service == null) && !service.isInterface()
[PATH1] if(service == null)=F -> if(!service.isInterface())=T -> throw new Ille... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public T Wasp.create(Class<T> service)
[THROWS-WHEN] NullPointerException when service == null
[THROWS-WHEN] IllegalArgumentException when !(service == null) && !service.isInterface()
[PATH1] if(service == null)=F -> if(!service.isInterface())=T -> throw new Ille... | true | ok | {"focal": {"class": "Wasp", "name": "create", "signature": "T create(Class<T> service)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public", "params": [{"name": "service", "type": "Class<T>"}], "return_type": "T"}, "class_info": {"name": "Wasp", "kind": "class", "modifiers": "", "superclass": null,... |
28325219_1 | class ClientTokenService {
@Transactional(propagation = Propagation.REQUIRED)
public void save(ClientToken ct) {
ctd.save(ct);
}
public ClientToken findByEmail(String email);
public ClientToken findByToken(String token);
public boolean checkTokenBelongToUser(String token, int u_id);
... | ClientToken ct = newInstence();
us.save(ct.getUser());
assertThat(ct.getUser().getId(), not(0));
cts.save(ct);
assertThat(ct.getId(), not(0));
}
} | [FOCAL] @Transactional(propagation = Propagation.REQUIRED) public void ClientTokenService.save(ClientToken ct)
[CLASS] class ClientTokenService
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] ctd.save/1
[COLLABORATORS] field ctd save/1
[DATAFLOW] ct@param->L3
[CLASS-MEMBERS] Client... | /* static context
[FOCAL] @Transactional(propagation = Propagation.REQUIRED) public void ClientTokenService.save(ClientToken ct)
[COLLABORATORS] field ctd save/1
[CALLS-EXTERNAL] ctd.save/1
*/
| /* static context
[FOCAL] @Transactional(propagation = Propagation.REQUIRED) public void ClientTokenService.save(ClientToken ct)
[COLLABORATORS] field ctd save/1
[CALLS-EXTERNAL] ctd.save/1
*/
class ClientTokenService {
@Transactional(propagation = Propagation.REQUIRED)
public void save(ClientToken ct) {
... | true | ok | {"focal": {"class": "ClientTokenService", "name": "save", "signature": "void save(ClientToken ct)", "start_line": 3, "modifiers": "@Transactional(propagation = Propagation.REQUIRED) public", "params": [{"name": "ct", "type": "ClientToken"}], "return_type": "void"}, "class_info": {"name": "ClientTokenService", "kind": "... |
28344352_1 | class SchemaFormAvroConverter implements ConverterConstants, SchemaFormConstants {
public RecordField createSchemaFormFromSchema(String schemaString) throws IOException {
ObjectMapper mapper = new ObjectMapper();
JsonNode node = mapper.readTree(schemaString);
Schema.Parser parser = new Sche... | SchemaFormAvroConverter converter =
new SchemaFormAvroConverter(new TestCtlSource());
String typeCtlReferencesSchema = TestAvroSchemas.getSchemaJson(TestAvroSchemas.TYPE_CTL_REFERENCES);
RecordField schemaForm = converter.createSchemaFormFromSchema(typeCtlReferencesSchema);
... | [FOCAL] public RecordField SchemaFormAvroConverter.createSchemaFormFromSchema(String schemaString)
[CLASS] class SchemaFormAvroConverter implements ConverterConstants, SchemaFormConstants
[METRICS] loc=22 cc=4 branches=2 loops=1 returns=1 throws=0 nesting=3
[CALLS-INTERNAL] RecordField createSchemaFormFromSchema(Schema... | /* static context
[FOCAL] public RecordField SchemaFormAvroConverter.createSchemaFormFromSchema(String schemaString)
[PATH1] if(hasCtl)=T -> if(dependenciesNode != null && dependenciesNode.isArray())=T -> for(i<dependenciesNode.size())=T -> exit loop -> return createSchemaFormFromSchema(schema, fqns)
[PATH2] if(hasCtl)... | /* static context
[FOCAL] public RecordField SchemaFormAvroConverter.createSchemaFormFromSchema(String schemaString)
[PATH1] if(hasCtl)=T -> if(dependenciesNode != null && dependenciesNode.isArray())=T -> for(i<dependenciesNode.size())=T -> exit loop -> return createSchemaFormFromSchema(schema, fqns)
[PATH2] if(hasCtl)... | true | ok | {"focal": {"class": "SchemaFormAvroConverter", "name": "createSchemaFormFromSchema", "signature": "RecordField createSchemaFormFromSchema(String schemaString) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "schemaString", "type": "String"}], "return_type": "RecordField"}, "class_info":... |
28358565_2 | class ActivitiParser implements Parser {
@Override
public ProcessDefinition parse(InputStream in) throws ParserException {
if (in == null) {
throw new NullPointerException("Input cannot be null");
}
try {
SAXParserFactory spf = SAXParserFactory.newInstance();
... | InputStream in = ClassLoader.getSystemResourceAsStream("complex2.bpmn");
Parser p = new ActivitiParser();
ProcessDefinition pd = p.parse(in);
assertNotNull(pd);
SubProcess sp1 = (SubProcess) pd.getChild("reserveSubprocess");
assertNotNull(sp1);
assertEqu... | [FOCAL] @Override public ProcessDefinition ActivitiParser.parse(InputStream in)
[CLASS] class ActivitiParser implements Parser
[METRICS] loc=18 cc=3 branches=1 loops=0 returns=1 throws=2 nesting=1
[CALLS-EXTERNAL] SAXParserFactory.newInstance/0, SAXParserFactory.newSAXParser/0, SAXParser.parse/2
[NEW] NullPointerExcept... | /* static context
[FOCAL] @Override public ProcessDefinition ActivitiParser.parse(InputStream in)
[THROWS-WHEN] NullPointerException when in == null
[THROWS-WHEN] ParserException when !(in == null) && try-body throws
[PATH1] if(in == null)=F -> try-body throws -> throw new ParserException("Parsing error", e)
[PATH2] if... | /* static context
[FOCAL] @Override public ProcessDefinition ActivitiParser.parse(InputStream in)
[THROWS-WHEN] NullPointerException when in == null
[THROWS-WHEN] ParserException when !(in == null) && try-body throws
[PATH1] if(in == null)=F -> try-body throws -> throw new ParserException("Parsing error", e)
[PATH2] if... | true | ok | {"focal": {"class": "ActivitiParser", "name": "parse", "signature": "ProcessDefinition parse(InputStream in) throws ParserException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "in", "type": "InputStream"}], "return_type": "ProcessDefinition"}, "class_info": {"name": "ActivitiParser", "kind":... |
28407415_15 | class JMSCacheMessageListener implements MessageListener {
protected boolean checkNamespaceAware() {
try {
Class.forName("com.tridion.util.NamespacePrefixWrapper", false, this.getClass().getClassLoader());
LOG.info("This tridion version is namespace aware (Tridion version is 8.5+)")... | JMSCacheMessageListener messageListener = (JMSCacheMessageListener) applicationContext.getBean
("cacheMessageListener");
assertNotNull(messageListener);
}
} | [FOCAL] protected boolean JMSCacheMessageListener.checkNamespaceAware()
[CLASS] class JMSCacheMessageListener implements MessageListener
[METRICS] loc=10 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] Class.forName/3, this.getClass().getClassLoader/0, this.getClass/0, LOG.info/1
[EXCEPTIONS] catc... | /* static context
[FOCAL] protected boolean JMSCacheMessageListener.checkNamespaceAware()
[PATH1] try-body throws -> return false
[PATH2] return true
[EXCEPTIONS] catches ClassNotFoundException e
[CALLS-EXTERNAL] Class.forName/3, this.getClass().getClassLoader/0, this.getClass/0, LOG.info/1
*/
| /* static context
[FOCAL] protected boolean JMSCacheMessageListener.checkNamespaceAware()
[PATH1] try-body throws -> return false
[PATH2] return true
[EXCEPTIONS] catches ClassNotFoundException e
[CALLS-EXTERNAL] Class.forName/3, this.getClass().getClassLoader/0, this.getClass/0, LOG.info/1
*/
class JMSCacheMessageList... | true | ok | {"focal": {"class": "JMSCacheMessageListener", "name": "checkNamespaceAware", "signature": "boolean checkNamespaceAware()", "start_line": 3, "modifiers": "protected", "params": [], "return_type": "boolean"}, "class_info": {"name": "JMSCacheMessageListener", "kind": "class", "modifiers": "", "superclass": null, "interfa... |
28450866_6 | class Swipe {
public int getSwipedThreshold() {
return swipedThreshold;
}
public Swipe();
public Swipe(int swipingThreshold, int swipedThreshold);
public void setListener(SwipeListener swipeListener);
public Observable<SwipeEvent> observe();
public boolean dispatchTouchEvent(final MotionEvent eve... | simulateSwipedHorizontally(swipe.getSwipedThreshold() + MIN_MOTION_CHANGE);
assertThat(swipeEvent).isEqualTo(SwipeEvent.SWIPED_RIGHT);
}
} | [FOCAL] public int Swipe.getSwipedThreshold()
[CLASS] class Swipe
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] Swipe(); Swipe(int swipingThreshold, int swipedThreshold); void setListener(SwipeListener swipeListener); Observable<SwipeEvent> observe(); boolean dispatchTouchEvent(Mo... | /* static context
[FOCAL] public int Swipe.getSwipedThreshold()
*/
| /* static context
[FOCAL] public int Swipe.getSwipedThreshold()
*/
class Swipe {
public int getSwipedThreshold() {
return swipedThreshold;
}
public Swipe();
public Swipe(int swipingThreshold, int swipedThreshold);
public void setListener(SwipeListener swipeListener);
public Observable<SwipeEvent> o... | true | ok | {"focal": {"class": "Swipe", "name": "getSwipedThreshold", "signature": "int getSwipedThreshold()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "Swipe", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "MIN_MOTION_CHANG... |
28464672_8 | class Cartographer {
public String toJson(Map<?, ?> map) {
StringWriter stringWriter = new StringWriter();
try {
toJson(map, stringWriter);
} catch (IOException e) {
throw new AssertionError(e); // No I/O writing to a Buffer.
}
return stringWriter.toString();
}
Cartographer(boo... | // Exercise a bug where primitive arrays would throw an IOException.
// https://github.com/segmentio/analytics-android/issues/507
Map<String, Object> map =
ImmutableMap.<String, Object>builder().put("a", new int[] {1, 2}).build();
assertThat(cartographer.toJson(map))
.isEqualTo("{\n" + ... | [FOCAL] public String Cartographer.toJson(Map<?, ?> map)
[CLASS] class Cartographer
[METRICS] loc=9 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-INTERNAL] void toJson(Map<?, ?> map, Writer writer)
[CALLS-EXTERNAL] StringWriter.toString/0
[NEW] StringWriter, AssertionError
[EXCEPTIONS] throws AssertionErr... | /* static context
[FOCAL] public String Cartographer.toJson(Map<?, ?> map)
[THROWS-WHEN] AssertionError when try-body throws
[PATH1] try-body throws -> throw new AssertionError(e)
[PATH2] return stringWriter.toString()
[EXCEPTIONS] throws AssertionError; catches IOException e
[CALLS-INTERNAL] void toJson(Map<?, ?> map,... | /* static context
[FOCAL] public String Cartographer.toJson(Map<?, ?> map)
[THROWS-WHEN] AssertionError when try-body throws
[PATH1] try-body throws -> throw new AssertionError(e)
[PATH2] return stringWriter.toString()
[EXCEPTIONS] throws AssertionError; catches IOException e
[CALLS-INTERNAL] void toJson(Map<?, ?> map,... | true | ok | {"focal": {"class": "Cartographer", "name": "toJson", "signature": "String toJson(Map<?, ?> map)", "start_line": 3, "modifiers": "public", "params": [{"name": "map", "type": "Map<?, ?>"}], "return_type": "String"}, "class_info": {"name": "Cartographer", "kind": "class", "modifiers": "", "superclass": null, "interfaces"... |
28546353_6 | class PdfStreamResult extends StrutsResultSupport {
LinkedHashSet<String> stringToSet(final String str) {
final LinkedHashSet<String> set;
if (str == null || str.trim().isEmpty()) {
set = null;
} else {
set = new LinkedHashSet<>();
String[] split = str.sp... | Assert.assertNotNull(pdfStreamResult);
final String paths = "";
LinkedHashSet<String> set = pdfStreamResult.stringToSet(paths);
Assert.assertNull(set);
}
} | [FOCAL] LinkedHashSet<String> PdfStreamResult.stringToSet(String str)
[CLASS] class PdfStreamResult extends StrutsResultSupport
[METRICS] loc=16 cc=4 branches=2 loops=1 returns=1 throws=0 nesting=3
[CALLS-EXTERNAL] str.trim().isEmpty/0, String.trim/0, String.split/1, String.isEmpty/0, LinkedHashSet<String>.add/1
[NEW] ... | /* static context
[FOCAL] LinkedHashSet<String> PdfStreamResult.stringToSet(String str)
[PATH1] if(str == null || str.trim().isEmpty())=F -> foreach(String s : split)=T -> if(!trimmed.isEmpty())=T -> exit loop -> return set
[PATH2] if(str == null || str.trim().isEmpty())=T -> return set
[PATH3] if(str == null || str.tr... | /* static context
[FOCAL] LinkedHashSet<String> PdfStreamResult.stringToSet(String str)
[PATH1] if(str == null || str.trim().isEmpty())=F -> foreach(String s : split)=T -> if(!trimmed.isEmpty())=T -> exit loop -> return set
[PATH2] if(str == null || str.trim().isEmpty())=T -> return set
[PATH3] if(str == null || str.tr... | true | ok | {"focal": {"class": "PdfStreamResult", "name": "stringToSet", "signature": "LinkedHashSet<String> stringToSet(String str)", "start_line": 3, "modifiers": "", "params": [{"name": "str", "type": "String"}], "return_type": "LinkedHashSet<String>"}, "class_info": {"name": "PdfStreamResult", "kind": "class", "modifiers": ""... |
28546707_3 | class Note extends EzRgx {
public int orderStartAtA() {
if ("a".equals(name)) {
if("#".equals(sign)){
return 1;
}
else if("b".equals(sign)){
return 12;
}
else
return 0;
}
else if ("b"... | Note note_aD2 = new Note("folder/a#2.wav");
assertEquals("a", note_aD2.name);
assertEquals("#", note_aD2.sign);
assertEquals(2, note_aD2.octave);
assertEquals(1, note_aD2.instance);
assertEquals(1, note_aD2.orderStartAtA());
}
} | [FOCAL] public int Note.orderStartAtA()
[CLASS] class Note extends EzRgx
[METRICS] loc=79 cc=22 branches=21 loops=0 returns=22 throws=0 nesting=9
[CALLS-EXTERNAL] "a".equals/1, "#".equals/1, "b".equals/1, "c".equals/1, "d".equals/1, "e".equals/1, "f".equals/1, "g".equals/1
[PATH1] if("a".equals(name))=F -> if("b".equal... | /* static context
[FOCAL] public int Note.orderStartAtA()
[PATH1] if("a".equals(name))=F -> if("b".equals(name))=F -> if("c".equals(name))=F -> if("d".equals(name))=F -> if("e".equals(name))=F -> if("f".equals(name))=F -> if("g".equals(name))=T -> if("#".equals(sign))#7=F -> if("b".equals(sign))#7=T -> return 9
[PATH2]... | /* static context
[FOCAL] public int Note.orderStartAtA()
[PATH1] if("a".equals(name))=F -> if("b".equals(name))=F -> if("c".equals(name))=F -> if("d".equals(name))=F -> if("e".equals(name))=F -> if("f".equals(name))=F -> if("g".equals(name))=T -> if("#".equals(sign))#7=F -> if("b".equals(sign))#7=T -> return 9
[PATH2]... | true | ok | {"focal": {"class": "Note", "name": "orderStartAtA", "signature": "int orderStartAtA()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "Note", "kind": "class", "modifiers": "", "superclass": "EzRgx", "interfaces": null, "fields": [], "members": [{"name": "Note", "ki... |
28556746_29 | class DfuSerializers {
public static <V> TypeSerializer<V> forCodec(final Codec<V> codec) {
return new CodecSerializer<>(requireNonNull(codec, "codec"));
}
private DfuSerializers();
public static Codec<S> forSerializer(final TypeToken<S> type);
public static Codec<V> forSerializer(final ... | final TypeSerializerCollection serializers = TypeSerializerCollection.defaults().childBuilder()
.register(VEC3I_TYPE, DfuSerializers.forCodec(VEC3I_CODEC))
.build();
final ConfigurationNode testElement = BasicConfigurationNode.root(ConfigurationOptions.defaults().withSerializers... | [FOCAL] public static TypeSerializer<V> DfuSerializers.forCodec(Codec<V> codec)
[CLASS] class DfuSerializers
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] requireNonNull/2 (inherited)
[NEW] CodecSerializer<>
[INPUTS] branches=- | result=codec
[DATAFLOW] codec@param->L2
[CLASS-MEM... | /* static context
[FOCAL] public static TypeSerializer<V> DfuSerializers.forCodec(Codec<V> codec)
[INPUTS] branches=- | result=codec
[NEW] CodecSerializer<>
[CALLS-EXTERNAL] requireNonNull/2 (inherited)
*/
| /* static context
[FOCAL] public static TypeSerializer<V> DfuSerializers.forCodec(Codec<V> codec)
[INPUTS] branches=- | result=codec
[NEW] CodecSerializer<>
[CALLS-EXTERNAL] requireNonNull/2 (inherited)
*/
class DfuSerializers {
public static <V> TypeSerializer<V> forCodec(final Codec<V> codec) {
return ne... | true | ok | {"focal": {"class": "DfuSerializers", "name": "forCodec", "signature": "TypeSerializer<V> forCodec(Codec<V> codec)", "start_line": 3, "modifiers": "public static", "params": [{"name": "codec", "type": "Codec<V>"}], "return_type": "TypeSerializer<V>"}, "class_info": {"name": "DfuSerializers", "kind": "class", "modifiers... |
28560583_2 | class Bloom1Filter {
public void merge(Bloom1Filter that) {
this.bitSet.putAll(that.bitSet);
}
public Bloom1Filter(long maxNumEntries);
public Bloom1Filter(long maxNumEntries, double fpp);
public Bloom1Filter(List<Long> serializedBloom);
static int optimalNumOfHashFunctions(long n, long m);
stat... | Bloom1Filter bf = new Bloom1Filter(10000);
String val = "bloo";
String val1 = "bloom fil";
String val2 = "bloom filter";
String val3 = "cuckoo filter";
bf.addString(val);
bf.addString(val1);
bf.addString(val2);
bf.addString(val3);
Bloom1Filter bf2 = new Bloom1Filter(10000);
... | [FOCAL] public void Bloom1Filter.merge(Bloom1Filter that)
[CLASS] class Bloom1Filter
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] this.bitSet.putAll/1
[FIELDS] read=bitSet
[COLLABORATORS] field bitSet putAll/1
[DATAFLOW] that@param->L2
[CLASS-MEMBERS] Bloom1Filter(long maxNumEnt... | /* static context
[FOCAL] public void Bloom1Filter.merge(Bloom1Filter that)
[COLLABORATORS] field bitSet putAll/1
[FIELDS] read=bitSet
[CALLS-EXTERNAL] this.bitSet.putAll/1
*/
| /* static context
[FOCAL] public void Bloom1Filter.merge(Bloom1Filter that)
[COLLABORATORS] field bitSet putAll/1
[FIELDS] read=bitSet
[CALLS-EXTERNAL] this.bitSet.putAll/1
*/
class Bloom1Filter {
public void merge(Bloom1Filter that) {
this.bitSet.putAll(that.bitSet);
}
public Bloom1Filter(long maxNumEntri... | true | ok | {"focal": {"class": "Bloom1Filter", "name": "merge", "signature": "void merge(Bloom1Filter that)", "start_line": 3, "modifiers": "public", "params": [{"name": "that", "type": "Bloom1Filter"}], "return_type": "void"}, "class_info": {"name": "Bloom1Filter", "kind": "class", "modifiers": "", "superclass": null, "interface... |
28565575_3 | class IoUtils {
public static File toFile(Uri uri) {
if (uri != null && isFile(uri)) {
return new File(uri.getPath());
}
return null;
}
public static boolean saveFile(File file, byte[] content);
public static boolean saveBitmap(File file, Bitmap bitmap,
... | Assert.assertNotEquals(IoUtils.toFile(Uri.fromFile(new File("."))), new File("."));
Assert.assertEquals(IoUtils.toFile(Uri.fromFile(new File("."))), new File(".").getAbsoluteFile());
Assert.assertEquals(IoUtils.toFile(Uri.fromFile(new File("/etc"))), new File("/etc"));
Assert.assertEqual... | [FOCAL] public static File IoUtils.toFile(Uri uri)
[CLASS] class IoUtils
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] boolean isFile(Uri uri)
[CALLS-EXTERNAL] Uri.getPath/0
[NEW] File
[PATH1] if(uri != null && isFile(uri))=T -> return new File(uri.getPath())
[PATH2] if(uri != nu... | /* static context
[FOCAL] public static File IoUtils.toFile(Uri uri)
[PATH1] if(uri != null && isFile(uri))=T -> return new File(uri.getPath())
[PATH2] if(uri != null && isFile(uri))=F -> return null
[INPUTS] branches=uri | result=uri
[COLLABORATORS] param uri:Uri getPath/0
[CALLS-INTERNAL] boolean isFile(Uri uri)
[NEW... | /* static context
[FOCAL] public static File IoUtils.toFile(Uri uri)
[PATH1] if(uri != null && isFile(uri))=T -> return new File(uri.getPath())
[PATH2] if(uri != null && isFile(uri))=F -> return null
[INPUTS] branches=uri | result=uri
[COLLABORATORS] param uri:Uri getPath/0
[CALLS-INTERNAL] boolean isFile(Uri uri)
[NEW... | true | ok | {"focal": {"class": "IoUtils", "name": "toFile", "signature": "File toFile(Uri uri)", "start_line": 3, "modifiers": "public static", "params": [{"name": "uri", "type": "Uri"}], "return_type": "File"}, "class_info": {"name": "IoUtils", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [... |
28589967_4 | class EmbeddedDatabaseRule extends EmbeddedDatabaseCreatorImpl implements TestRule {
public static Builder h2() {
return Builder.h2();
}
public EmbeddedDatabaseRule();
private EmbeddedDatabaseRule(final boolean autoCommit,
final String name,
... | final EmbeddedDatabaseRule.Builder builder = EmbeddedDatabaseRule.h2();
assertNotNull(builder);
builder.withInitialSqlFromResource(null, null);
}
} | [FOCAL] public static Builder EmbeddedDatabaseRule.h2()
[CLASS] class EmbeddedDatabaseRule extends EmbeddedDatabaseCreatorImpl implements TestRule
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Builder.h2/0
[CLASS-MEMBERS] EmbeddedDatabaseRule(); EmbeddedDatabaseRule(boolean autoC... | /* static context
[FOCAL] public static Builder EmbeddedDatabaseRule.h2()
[CALLS-EXTERNAL] Builder.h2/0
*/
| /* static context
[FOCAL] public static Builder EmbeddedDatabaseRule.h2()
[CALLS-EXTERNAL] Builder.h2/0
*/
class EmbeddedDatabaseRule extends EmbeddedDatabaseCreatorImpl implements TestRule {
public static Builder h2() {
return Builder.h2();
}
public EmbeddedDatabaseRule();
private EmbeddedD... | true | ok | {"focal": {"class": "EmbeddedDatabaseRule", "name": "h2", "signature": "Builder h2()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Builder"}, "class_info": {"name": "EmbeddedDatabaseRule", "kind": "class", "modifiers": "", "superclass": "EmbeddedDatabaseCreatorImpl", "interfaces": "Test... |
28598239_31 | class GfsUriUtils {
@Nonnull
public static String getRepository(URI uri) {
checkScheme(uri);
String path = uri.getPath();
if(path.length() > 1 && path.endsWith("/") && !path.endsWith(":/"))
path = path.substring(0, path.length() - 1);
return path;
}
static void checkScheme(URI uri);
@N... | assertEquals("/c:/", GfsUriUtils.getRepository(URI.create("gfs:/c:/")));
assertEquals("/c:/windows/path", GfsUriUtils.getRepository(URI.create("gfs:/c:/windows/path")));
assertEquals("/c:/windows/path", GfsUriUtils.getRepository(URI.create("gfs:/c:/windows/path/")));
assertEquals("/c:/windows/path", Gfs... | [FOCAL] @Nonnull public static String GfsUriUtils.getRepository(URI uri)
[CLASS] class GfsUriUtils
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] void checkScheme(URI uri)
[CALLS-EXTERNAL] URI.getPath/0, String.length/0, String.endsWith/1, String.substring/2
[PATH1] if(path.length... | /* static context
[FOCAL] @Nonnull public static String GfsUriUtils.getRepository(URI uri)
[PATH1] if(path.length() > 1 && path.endsWith("/") && !path.endsWith(":/"))=T -> return path
[PATH2] if(path.length() > 1 && path.endsWith("/") && !path.endsWith(":/"))=F -> return path
[INPUTS] branches=uri | result=uri
[COLLABO... | /* static context
[FOCAL] @Nonnull public static String GfsUriUtils.getRepository(URI uri)
[PATH1] if(path.length() > 1 && path.endsWith("/") && !path.endsWith(":/"))=T -> return path
[PATH2] if(path.length() > 1 && path.endsWith("/") && !path.endsWith(":/"))=F -> return path
[INPUTS] branches=uri | result=uri
[COLLABO... | true | ok | {"focal": {"class": "GfsUriUtils", "name": "getRepository", "signature": "String getRepository(URI uri)", "start_line": 3, "modifiers": "@Nonnull public static", "params": [{"name": "uri", "type": "URI"}], "return_type": "String"}, "class_info": {"name": "GfsUriUtils", "kind": "class", "modifiers": "", "superclass": nu... |
28691699_230 | class Optional {
@NotNull
@SuppressWarnings("unchecked")
public Stream<T> stream() {
if (!isPresent()) return Stream.empty();
return Stream.of(value);
}
private Optional();
private Optional(T value);
@NotNull @Contract("_ -> new") public static Optional<T> of(@NotNull T ... | long count = Optional.of(10).stream().count();
assertThat(count, is(1L));
}
} | [FOCAL] @NotNull @SuppressWarnings("unchecked") public Stream<T> Optional.stream()
[CLASS] class Optional
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] boolean isPresent()
[CALLS-EXTERNAL] Stream.empty/0, Stream.of/1
[PATH1] if(!isPresent())=T -> return Stream.empty()
[PATH2] if(... | /* static context
[FOCAL] @NotNull @SuppressWarnings("unchecked") public Stream<T> Optional.stream()
[PATH1] if(!isPresent())=T -> return Stream.empty()
[PATH2] if(!isPresent())=F -> return Stream.of(value)
[CALLS-INTERNAL] boolean isPresent()
[CALLS-EXTERNAL] Stream.empty/0, Stream.of/1
*/
| /* static context
[FOCAL] @NotNull @SuppressWarnings("unchecked") public Stream<T> Optional.stream()
[PATH1] if(!isPresent())=T -> return Stream.empty()
[PATH2] if(!isPresent())=F -> return Stream.of(value)
[CALLS-INTERNAL] boolean isPresent()
[CALLS-EXTERNAL] Stream.empty/0, Stream.of/1
*/
class Optional {
@NotNu... | true | ok | {"focal": {"class": "Optional", "name": "stream", "signature": "Stream<T> stream()", "start_line": 3, "modifiers": "@NotNull @SuppressWarnings(\"unchecked\") public", "params": [], "return_type": "Stream<T>"}, "class_info": {"name": "Optional", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "... |
28714528_15 | class ResourceLocalizer implements Localizer {
@Override
public String formatMoney(String amount, String currencyCode)
{
if (amount == null || amount.isEmpty())
{
return "";
}
try
{
float value = Float.valueOf(amount);
if (value ==... | assertEquals("1,234.57 $", UNDER_TEST.formatMoney("1234.567", "USD"));
}
} | [FOCAL] @Override public String ResourceLocalizer.formatMoney(String amount, String currencyCode)
[CLASS] class ResourceLocalizer implements Localizer
[METRICS] loc=27 cc=4 branches=2 loops=0 returns=3 throws=1 nesting=2
[CALLS-EXTERNAL] String.isEmpty/0, Float.valueOf/1, Currency.getInstance/1, DecimalFormat.getInstan... | /* static context
[FOCAL] @Override public String ResourceLocalizer.formatMoney(String amount, String currencyCode)
[THROWS-WHEN] IllegalArgumentException when !(amount == null || amount.isEmpty()) && try-body throws
[PATH1] if(amount == null || amount.isEmpty())=F -> try-body throws -> throw new IllegalArgumentExcepti... | /* static context
[FOCAL] @Override public String ResourceLocalizer.formatMoney(String amount, String currencyCode)
[THROWS-WHEN] IllegalArgumentException when !(amount == null || amount.isEmpty()) && try-body throws
[PATH1] if(amount == null || amount.isEmpty())=F -> try-body throws -> throw new IllegalArgumentExcepti... | true | ok | {"focal": {"class": "ResourceLocalizer", "name": "formatMoney", "signature": "String formatMoney(String amount, String currencyCode)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "amount", "type": "String"}, {"name": "currencyCode", "type": "String"}], "return_type": "String"}, "class_info": {... |
28738447_272 | class FilterOptimizeTransformer implements ITupleFilterTransformer {
@Override
public TupleFilter transform(TupleFilter tupleFilter) {
if (tupleFilter == null || !(tupleFilter instanceof IOptimizeableTupleFilter))
return tupleFilter;
else
return ((IOptimizeableTupleFilte... | TupleFilter or = new LogicalTupleFilter(TupleFilter.FilterOperatorEnum.AND);
TupleFilter a = ConstantTupleFilter.FALSE;
TupleFilter b = ConstantTupleFilter.FALSE;
or.addChild(a);
or.addChild(b);
or = new FilterOptimizeTransformer().transform(or);
Assert.assertEqu... | [FOCAL] @Override public TupleFilter FilterOptimizeTransformer.transform(TupleFilter tupleFilter)
[CLASS] class FilterOptimizeTransformer implements ITupleFilterTransformer
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] ((IOptimizeableTupleFilter) tupleFilter).acceptOptimizeTransf... | /* static context
[FOCAL] @Override public TupleFilter FilterOptimizeTransformer.transform(TupleFilter tupleFilter)
[PATH1] if(tupleFilter == null || !(tupleFilter instanceof IOptimizeableTupleFilter))=T -> return tupleFilter
[PATH2] if(tupleFilter == null || !(tupleFilter instanceof IOptimizeableTupleFilter))=F -> ret... | /* static context
[FOCAL] @Override public TupleFilter FilterOptimizeTransformer.transform(TupleFilter tupleFilter)
[PATH1] if(tupleFilter == null || !(tupleFilter instanceof IOptimizeableTupleFilter))=T -> return tupleFilter
[PATH2] if(tupleFilter == null || !(tupleFilter instanceof IOptimizeableTupleFilter))=F -> ret... | true | ok | {"focal": {"class": "FilterOptimizeTransformer", "name": "transform", "signature": "TupleFilter transform(TupleFilter tupleFilter)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "tupleFilter", "type": "TupleFilter"}], "return_type": "TupleFilter"}, "class_info": {"name": "FilterOptimizeTransfor... |
28745639_3 | class SimulatedStepperMotor implements GpioCompHwEmulation, SimulatedTimeListerner {
private void doStep() {
Long currentTime = SimulatedTime.INST.getRequestingTime();
byte currentBinaryState = getBinaryState();
if (logger.isTraceEnabled())
logger.info("Do Step : previous["+previousBinaryState+"] current["+c... | SimulatedStepperMotor dut = new SimulatedStepperMotor(getBuilderFor(buildProperty().setStepsPerRotation(1024)));
byte[] half_step_sequence = new byte[8];
half_step_sequence[0] = (byte) 0b0001;
half_step_sequence[1] = (byte) 0b0011;
half_step_sequence[2] = (byte) 0b0010;
half_... | [FOCAL] private void SimulatedStepperMotor.doStep()
[CLASS] class SimulatedStepperMotor implements GpioCompHwEmulation, SimulatedTimeListerner
[METRICS] loc=55 cc=15 branches=14 loops=0 returns=0 throws=0 nesting=8
[CALLS-INTERNAL] boolean doStep(int previousSeqIdx, int currentSeqIdx, int nbStep); byte getBinaryState()... | /* static context
[FOCAL] private void SimulatedStepperMotor.doStep()
[CALLS-INTERNAL] boolean doStep(int previousSeqIdx, int currentSeqIdx, int nbStep); byte getBinaryState()
*/
| /* static context
[FOCAL] private void SimulatedStepperMotor.doStep()
[CALLS-INTERNAL] boolean doStep(int previousSeqIdx, int currentSeqIdx, int nbStep); byte getBinaryState()
*/
class SimulatedStepperMotor implements GpioCompHwEmulation, SimulatedTimeListerner {
private void doStep() {
Long currentTime = Simulated... | true | ok | {"focal": {"class": "SimulatedStepperMotor", "name": "doStep", "signature": "void doStep()", "start_line": 3, "modifiers": "private", "params": [], "return_type": "void"}, "class_info": {"name": "SimulatedStepperMotor", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "GpioCompHwEmulation, SimulatedT... |
28772513_2 | class CollectionUtil {
public static <T> T getFirstOrNull(List<T> list) {
if (list == null || list.isEmpty()) {
return null;
}
return list.get(0);
}
private CollectionUtil();
public static Map<K, V> asHashMap(List<V> list, ListExtractor<K, V> extractor);
}
class... | assertNull(CollectionUtil.getFirstOrNull(null), "Calling with null should result in null");
assertNull(CollectionUtil.getFirstOrNull(Collections.emptyList()), "Calling with an empty list shall result in null");
}
} | [FOCAL] public static T CollectionUtil.getFirstOrNull(List<T> list)
[CLASS] class CollectionUtil
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] List<T>.isEmpty/0, List<T>.get/1
[PATH1] if(list == null || list.isEmpty())=T -> return null
[PATH2] if(list == null || list.isEmpty())=F... | /* static context
[FOCAL] public static T CollectionUtil.getFirstOrNull(List<T> list)
[PATH1] if(list == null || list.isEmpty())=T -> return null
[PATH2] if(list == null || list.isEmpty())=F -> return list.get(0)
[INPUTS] branches=list | result=list
[COLLABORATORS] param list:List<T> isEmpty/0,get/1
[CALLS-EXTERNAL] Li... | /* static context
[FOCAL] public static T CollectionUtil.getFirstOrNull(List<T> list)
[PATH1] if(list == null || list.isEmpty())=T -> return null
[PATH2] if(list == null || list.isEmpty())=F -> return list.get(0)
[INPUTS] branches=list | result=list
[COLLABORATORS] param list:List<T> isEmpty/0,get/1
[CALLS-EXTERNAL] Li... | true | ok | {"focal": {"class": "CollectionUtil", "name": "getFirstOrNull", "signature": "T getFirstOrNull(List<T> list)", "start_line": 3, "modifiers": "public static", "params": [{"name": "list", "type": "List<T>"}], "return_type": "T"}, "class_info": {"name": "CollectionUtil", "kind": "class", "modifiers": "", "superclass": nul... |
28776576_22 | class YarnLocalCluster implements MiniCluster {
public Integer getNumNodeManagers() {
return numNodeManagers;
}
private YarnLocalCluster(Builder builder);
public String getTestName();
public Integer getNumLocalDirs();
public Integer getNumLogDirs();
public String getResourceManag... | assertEquals(Integer.parseInt(propertyParser.getProperty(ConfigVars.YARN_NUM_NODE_MANAGERS_KEY)),
(int) yarnLocalCluster.getNumNodeManagers());
}
} | [FOCAL] public Integer YarnLocalCluster.getNumNodeManagers()
[CLASS] class YarnLocalCluster implements MiniCluster
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] YarnLocalCluster(Builder builder); String getTestName(); Integer getNumLocalDirs(); Integer getNumLogDirs(); String getR... | /* static context
[FOCAL] public Integer YarnLocalCluster.getNumNodeManagers()
*/
| /* static context
[FOCAL] public Integer YarnLocalCluster.getNumNodeManagers()
*/
class YarnLocalCluster implements MiniCluster {
public Integer getNumNodeManagers() {
return numNodeManagers;
}
private YarnLocalCluster(Builder builder);
public String getTestName();
public Integer getNumL... | true | ok | {"focal": {"class": "YarnLocalCluster", "name": "getNumNodeManagers", "signature": "Integer getNumNodeManagers()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Integer"}, "class_info": {"name": "YarnLocalCluster", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "MiniCluster"... |
28776939_96 | class DeviceInfo {
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DeviceInfo rhs = (DeviceInfo) o;
return new EqualsBuilder()
.a... | // given
DeviceInfo deviceInfo1 = new DeviceInfo(
STANDARD_VERSION, VENDOR_EXTENSION_ID, VENDOR_EXTENSION_VERSION, VENDOR_EXTENSION_DESC,
FUNCTIONAL_MODE, OPERATIONS_SUPPORTED, EVENTS_SUPPORTED, DEVICE_PROPERTIES_SUPPORTED,
LIST_1, IMAGE_FORMATS, MANUFACTU... | [FOCAL] @Override public boolean DeviceInfo.equals(Object o)
[CLASS] class DeviceInfo
[METRICS] loc=29 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[CALLS-EXTERNAL] getClass/0 (inherited), Object.getClass/0, new EqualsBuilder() .append(standardVersion, rhs.standard....isEquals/0, new EqualsBuilder() .append(sta... | /* static context
[FOCAL] @Override public boolean DeviceInfo.equals(Object o)
[PATH1] if(this == o)=F -> if(o == null || getClass() != o.getClass())=T -> return false
[PATH2] if(this == o)=T -> return true
[PATH3] if(this == o)=F -> if(o == null || getClass() != o.getClass())=F -> return new EqualsBuilder() .append(st... | /* static context
[FOCAL] @Override public boolean DeviceInfo.equals(Object o)
[PATH1] if(this == o)=F -> if(o == null || getClass() != o.getClass())=T -> return false
[PATH2] if(this == o)=T -> return true
[PATH3] if(this == o)=F -> if(o == null || getClass() != o.getClass())=F -> return new EqualsBuilder() .append(st... | true | ok | {"focal": {"class": "DeviceInfo", "name": "equals", "signature": "boolean equals(Object o)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "o", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "DeviceInfo", "kind": "class", "modifiers": "", "superclass": null, "interfaces": ... |
28790580_0 | class BookResource {
@POST
@Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response create(Book book) {
if (bookDao.create(book).isPresent()) {
return Response.status(NO_CONTENT).build();
}
return Response.status(BAD_REQUEST)
.entity(format(BOOK_EXISTS_MSG, bo... | when(bookDaoMock.create(book)).thenReturn(Optional.of(book));
Response response = resource.create(book);
assertEquals(NO_CONTENT.getStatusCode(), response.getStatus());
}
} | [FOCAL] @POST @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public Response BookResource.create(Book book)
[CLASS] class BookResource
[METRICS] loc=11 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] bookDao.create(book).isPresent/0, bookDao.create/1, Response.status(NO_CONTENT... | /* static context
[FOCAL] @POST @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public Response BookResource.create(Book book)
[PATH1] if(bookDao.create(book).isPresent())=T -> return Response.status(NO_CONTENT).build()
[PATH2] if(bookDao.create(book).isPresent())=F -> return Response.status(BAD_REQU... | /* static context
[FOCAL] @POST @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public Response BookResource.create(Book book)
[PATH1] if(bookDao.create(book).isPresent())=T -> return Response.status(NO_CONTENT).build()
[PATH2] if(bookDao.create(book).isPresent())=F -> return Response.status(BAD_REQU... | true | ok | {"focal": {"class": "BookResource", "name": "create", "signature": "Response create(Book book)", "start_line": 3, "modifiers": "@POST @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public", "params": [{"name": "book", "type": "Book"}], "return_type": "Response"}, "class_info": {"name": "BookResource... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.