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 |
|---|---|---|---|---|---|---|---|---|
14892701_84 | class DiskDGraph implements DGraph<String>, FastWalkable<String, DNode<String>> {
public boolean equals(Object other)
{
if(!(other instanceof DGraph<?>))
return false;
DGraph<Object> oth = (DGraph<Object>) other;
if(! oth.level().equals(level()))
return false;
if(size() != oth.size())
return ... | Global.randomSeed();
DGraph<String> g1 = new DiskDGraph(r());
DTGraph<String, String> g2 = new MapDTGraph<String, String>();
assertFalse(g1.equals(g2));
assertFalse(g2.equals(g1));
}
} | [FOCAL] public boolean DiskDGraph.equals(Object other)
[CLASS] class DiskDGraph implements DGraph<String>, FastWalkable<String, DNode<String>>
[METRICS] loc=40 cc=11 branches=7 loops=3 returns=8 throws=0 nesting=2
[CALLS-INTERNAL] Class<? extends DGraph<String>> level(); List<? extends DNode<String>> nodes(); Set<Strin... | /* static context
[FOCAL] public boolean DiskDGraph.equals(Object other)
[PATH1] if(!(other instanceof DGraph<?>))=F -> if(! oth.level().equals(level()))=F -> if(size() != oth.size())=F -> if(numLinks() != oth.numLinks())=F -> if(labels().size() != oth.labels().size())=F -> foreach(DNode<String> node : nodes())=T -> if... | /* static context
[FOCAL] public boolean DiskDGraph.equals(Object other)
[PATH1] if(!(other instanceof DGraph<?>))=F -> if(! oth.level().equals(level()))=F -> if(size() != oth.size())=F -> if(numLinks() != oth.numLinks())=F -> if(labels().size() != oth.labels().size())=F -> foreach(DNode<String> node : nodes())=T -> if... | true | ok | {"focal": {"class": "DiskDGraph", "name": "equals", "signature": "boolean equals(Object other)", "start_line": 3, "modifiers": "public", "params": [{"name": "other", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "DiskDGraph", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "D... |
14894883_34 | class Decomposer {
public Map<Path,Object> decompose(Map<Path,Object> structures) {
if (structures == null) {
throw new IllegalArgumentException("structures is null");
}
Map<Path,Object> decomposed = new HashMap<Path,Object>(structures.size());
for (Map.Entry<Path,Objec... | Map<Path,Object> structures = new HashMap<Path,Object>();
Map<String,Object> nestedMap = new HashMap<String,Object>();
nestedMap.put("y", "test");
structures.put(DefaultPath.fromStrings("x"), nestedMap);
Map<Path,Object> expected = new HashMap<Path,Object>();
expected.p... | [FOCAL] public Map<Path,Object> Decomposer.decompose(Map<Path,Object> structures)
[CLASS] class Decomposer
[METRICS] loc=30 cc=6 branches=3 loops=2 returns=1 throws=1 nesting=2
[CALLS-INTERNAL] Map<Path,Object> decomposeStructure(Object structure)
[CALLS-EXTERNAL] Map<Path,Object>.size/0, Map<Path,Object>.entrySet/0, M... | /* static context
[FOCAL] public Map<Path,Object> Decomposer.decompose(Map<Path,Object> structures)
[THROWS-WHEN] IllegalArgumentException when structures == null
[PATH1] if(structures == null)=F -> foreach(Map.Entry<Path,Object> entry : structures.entrySet())=T -> if(structure == null)=F -> if(Types.isSimple(structure... | /* static context
[FOCAL] public Map<Path,Object> Decomposer.decompose(Map<Path,Object> structures)
[THROWS-WHEN] IllegalArgumentException when structures == null
[PATH1] if(structures == null)=F -> foreach(Map.Entry<Path,Object> entry : structures.entrySet())=T -> if(structure == null)=F -> if(Types.isSimple(structure... | true | ok | {"focal": {"class": "Decomposer", "name": "decompose", "signature": "Map<Path,Object> decompose(Map<Path,Object> structures)", "start_line": 3, "modifiers": "public", "params": [{"name": "structures", "type": "Map<Path,Object>"}], "return_type": "Map<Path,Object>"}, "class_info": {"name": "Decomposer", "kind": "class",... |
14920951_3 | class ReflectionHelper {
public static void parseServiceMetadataString(String metadataField, Map<String, List<String>> metadata) {
StringBuffer sb = new StringBuffer(metadataField);
int dot = 0;
int nextEquals = sb.indexOf(EQUALS_STRING, dot);
while (nextEquals > 0) {
S... | HashMap<String, List<String>> metadata = new HashMap<String, List<String>>();
try {
ReflectionHelper.parseServiceMetadataString(BADLY_FORMED_METADATA, metadata);
Assert.fail("Should have failed due to parse");
}
catch (IllegalStateException ise) {
... | [FOCAL] public static void ReflectionHelper.parseServiceMetadataString(String metadataField, Map<String, List<String>> metadata)
[CLASS] class ReflectionHelper
[METRICS] loc=55 cc=7 branches=5 loops=1 returns=0 throws=1 nesting=3
[CALLS-EXTERNAL] StringBuffer.indexOf/2, StringBuffer.substring/2, StringBuffer.charAt/1, ... | class ReflectionHelper {
public static void parseServiceMetadataString(String metadataField, Map<String, List<String>> metadata) {
StringBuffer sb = new StringBuffer(metadataField);
int dot = 0;
int nextEquals = sb.indexOf(EQUALS_STRING, dot);
while (nextEquals > 0) {
S... | false | ok | {"focal": {"class": "ReflectionHelper", "name": "parseServiceMetadataString", "signature": "void parseServiceMetadataString(String metadataField, Map<String, List<String>> metadata)", "start_line": 3, "modifiers": "public static", "params": [{"name": "metadataField", "type": "String"}, {"name": "metadata", "type": "Map... | |
14965293_1 | class Protocol {
public static int parseInt(ByteBuffer buf, byte delimiter) {
int sign = 1;
if (buf.get(buf.position()) == (byte)'-') {
buf.get();
sign = -1;
}
int result = 0;
for (;;) {
byte ch = buf.get();
if (ch == delimiter) {
break;
}
result *= 10;... | assertEquals(-123, parseInt("-123\1"));
assertEquals( 0, parseInt("0\1"));
assertEquals( 123, parseInt("123\1"));
}
} | [FOCAL] public static int Protocol.parseInt(ByteBuffer buf, byte delimiter)
[CLASS] class Protocol
[METRICS] loc=17 cc=3 branches=2 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] ByteBuffer.get/1, ByteBuffer.position/0, ByteBuffer.get/0
[PATH1] if(buf.get(buf.position()) == (byte)'-')=T -> for(true)=T -> if(ch =... | /* static context
[FOCAL] public static int Protocol.parseInt(ByteBuffer buf, byte delimiter)
[PATH1] if(buf.get(buf.position()) == (byte)'-')=T -> for(true)=T -> if(ch == delimiter)=T -> return sign * result
[PATH2] if(buf.get(buf.position()) == (byte)'-')=F -> for(true)=T -> if(ch == delimiter)=T -> return sign * res... | /* static context
[FOCAL] public static int Protocol.parseInt(ByteBuffer buf, byte delimiter)
[PATH1] if(buf.get(buf.position()) == (byte)'-')=T -> for(true)=T -> if(ch == delimiter)=T -> return sign * result
[PATH2] if(buf.get(buf.position()) == (byte)'-')=F -> for(true)=T -> if(ch == delimiter)=T -> return sign * res... | true | ok | {"focal": {"class": "Protocol", "name": "parseInt", "signature": "int parseInt(ByteBuffer buf, byte delimiter)", "start_line": 3, "modifiers": "public static", "params": [{"name": "buf", "type": "ByteBuffer"}, {"name": "delimiter", "type": "byte"}], "return_type": "int"}, "class_info": {"name": "Protocol", "kind": "cla... |
14969366_10 | class Base64 {
public static byte[] fromBase64String(final String encoded) {
if (encoded == null) {
return new byte[0];
}
try {
return decode(encoded, NO_OPTIONS);
} catch (IOException e) {
e.printStackTrace(System.err);
return new by... | byte[] foobarBytes = "foobar".getBytes();
String encoded = new String(encodeBase64(foobarBytes, false), Constants.CHARSET);
assertEquals("foobar (encoded) should be decoded the same way as in commons-codec",
new String(decodeBase64(encoded.getBytes(Constants.CHARSET))),
... | [FOCAL] public static byte[] Base64.fromBase64String(String encoded)
[CLASS] class Base64
[METRICS] loc=12 cc=3 branches=1 loops=0 returns=3 throws=0 nesting=1
[CALLS-INTERNAL] byte[] decode(String s, int options)
[CALLS-EXTERNAL] IOException.printStackTrace/1
[EXCEPTIONS] catches IOException e
[PATH1] if(encoded == nu... | /* static context
[FOCAL] public static byte[] Base64.fromBase64String(String encoded)
[PATH1] if(encoded == null)=F -> try-body throws -> return new byte[0]
[PATH2] if(encoded == null)=T -> return new byte[0]
[PATH3] if(encoded == null)=F -> return decode(encoded, NO_OPTIONS)
[INPUTS] branches=encoded | result=encoded... | /* static context
[FOCAL] public static byte[] Base64.fromBase64String(String encoded)
[PATH1] if(encoded == null)=F -> try-body throws -> return new byte[0]
[PATH2] if(encoded == null)=T -> return new byte[0]
[PATH3] if(encoded == null)=F -> return decode(encoded, NO_OPTIONS)
[INPUTS] branches=encoded | result=encoded... | true | ok | {"focal": {"class": "Base64", "name": "fromBase64String", "signature": "byte[] fromBase64String(String encoded)", "start_line": 3, "modifiers": "public static", "params": [{"name": "encoded", "type": "String"}], "return_type": "byte[]"}, "class_info": {"name": "Base64", "kind": "class", "modifiers": "", "superclass": n... |
14975201_0 | class MyResource {
@GET
@Produces(MediaType.TEXT_PLAIN)
public String getIt() {
return "Got it!";
}
@GET @Path("/empty") public Response empty();
private HttpServer server;
private WebTarget target;
}
class MyResourceTest {
private HttpServer server;
private WebTarget t... | String responseMsg = target.path("myresource").request().get(String.class);
assertEquals("Got it!", responseMsg);
}
} | [FOCAL] @GET @Produces(MediaType.TEXT_PLAIN) public String MyResource.getIt()
[CLASS] class MyResource
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] Response empty()
[TEST] MyResourceTest: @Test public void testGetIt()
[TEST-FIELDS] HttpServer server, WebTarget target | /* static context
[FOCAL] @GET @Produces(MediaType.TEXT_PLAIN) public String MyResource.getIt()
*/
| /* static context
[FOCAL] @GET @Produces(MediaType.TEXT_PLAIN) public String MyResource.getIt()
*/
class MyResource {
@GET
@Produces(MediaType.TEXT_PLAIN)
public String getIt() {
return "Got it!";
}
@GET @Path("/empty") public Response empty();
private HttpServer server;
private W... | true | ok | {"focal": {"class": "MyResource", "name": "getIt", "signature": "String getIt()", "start_line": 3, "modifiers": "@GET @Produces(MediaType.TEXT_PLAIN) public", "params": [], "return_type": "String"}, "class_info": {"name": "MyResource", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": ... |
14996402_11 | class CellProvider {
public List<Cell> getCellsOnPath(Iterable<?> sourcePath) {
return getCellsOnPath(sourcePath.iterator());
}
private CellProvider(Mapper<?, ?> enclosingMapper);
public static CellProvider fromMapper(Mapper<?, ?> mapper);
public List<Cell> getCells(final HasParent<?> source);
publi... | assertTrue(provider.getCellsOnPath(Collections.emptyList()).isEmpty());
}
} | [FOCAL] public List<Cell> CellProvider.getCellsOnPath(Iterable<?> sourcePath)
[CLASS] class CellProvider
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] List<Cell> getCellsOnPath(Iterator<?> sourcePath)
[CALLS-EXTERNAL] Iterable<?>.iterator/0
[INPUTS] branches=- | result=sourcePath... | /* static context
[FOCAL] public List<Cell> CellProvider.getCellsOnPath(Iterable<?> sourcePath)
[INPUTS] branches=- | result=sourcePath
[COLLABORATORS] param sourcePath:Iterable<?> iterator/0
[CALLS-INTERNAL] List<Cell> getCellsOnPath(Iterator<?> sourcePath)
[CALLS-EXTERNAL] Iterable<?>.iterator/0
*/
| /* static context
[FOCAL] public List<Cell> CellProvider.getCellsOnPath(Iterable<?> sourcePath)
[INPUTS] branches=- | result=sourcePath
[COLLABORATORS] param sourcePath:Iterable<?> iterator/0
[CALLS-INTERNAL] List<Cell> getCellsOnPath(Iterator<?> sourcePath)
[CALLS-EXTERNAL] Iterable<?>.iterator/0
*/
class CellProvider... | true | ok | {"focal": {"class": "CellProvider", "name": "getCellsOnPath", "signature": "List<Cell> getCellsOnPath(Iterable<?> sourcePath)", "start_line": 3, "modifiers": "public", "params": [{"name": "sourcePath", "type": "Iterable<?>"}], "return_type": "List<Cell>"}, "class_info": {"name": "CellProvider", "kind": "class", "modifi... |
14997161_0 | class ServletMappings {
@Nonnull
public String getClassForURL(@Nonnull String path) {
String servletName = findServletName(path);
for (ClassMapping entry : servlets) {
if (entry != null && servletName.equals(entry.getServletName())) {
return entry.getClassWithPackage();
}
}
return DEFAULT_... | List<Entry<String,String>> tests;
ServletMappings mappings = getTestMappings();
tests = makeMappingsList(
"/fruit/summer/index.html", "myservlets.watermelon",
"/fruit/summer/index.abc", "myservlets.watermelon",
"/seedlist", "myservlets.list",
"/seedlist/pear.abc", ... | [FOCAL] @Nonnull public String ServletMappings.getClassForURL(String path)
[CLASS] class ServletMappings
[METRICS] loc=12 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2
[CALLS-INTERNAL] String findServletName(String path)
[CALLS-EXTERNAL] String.equals/1, ClassMapping.getServletName/0, ClassMapping.getClassWithPa... | /* static context
[FOCAL] @Nonnull public String ServletMappings.getClassForURL(String path)
[PATH1] foreach(ClassMapping entry : servlets)=T -> if(entry != null && servletName.equals(entry.getServletName()))=F -> exit loop -> return DEFAULT_SERVLET
[PATH2] foreach(ClassMapping entry : servlets)=T -> if(entry != null &... | /* static context
[FOCAL] @Nonnull public String ServletMappings.getClassForURL(String path)
[PATH1] foreach(ClassMapping entry : servlets)=T -> if(entry != null && servletName.equals(entry.getServletName()))=F -> exit loop -> return DEFAULT_SERVLET
[PATH2] foreach(ClassMapping entry : servlets)=T -> if(entry != null &... | true | ok | {"focal": {"class": "ServletMappings", "name": "getClassForURL", "signature": "String getClassForURL(String path)", "start_line": 3, "modifiers": "@Nonnull public", "params": [{"name": "path", "type": "String"}], "return_type": "String"}, "class_info": {"name": "ServletMappings", "kind": "class", "modifiers": "", "supe... |
15032904_120 | class InterfaceMap {
@SuppressWarnings("unchecked")
public static <T> T createInstance(Class<T> interfaceClass, Map<String, Object> backingMap) {
return (T) Proxy.newProxyInstance(interfaceClass.getClassLoader(), new Class[] { interfaceClass },
new BackingMapInvocationHandler(backingMap, interfaceClass... | setSomeValues(q);
setSomeOtherValues(q);
PossibleProperties other = InterfaceMap.createInstance(PossibleProperties.class, new HashMap<String, Object>(map));
assertEquals(q, other);
assertEquals(other, q);
}
} | [FOCAL] @SuppressWarnings("unchecked") public static T InterfaceMap.createInstance(Class<T> interfaceClass, Map<String, Object> backingMap)
[CLASS] class InterfaceMap
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Proxy.newProxyInstance/3, Class<T>.getClassLoader/0
[NEW] BackingMa... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public static T InterfaceMap.createInstance(Class<T> interfaceClass, Map<String, Object> backingMap)
[INPUTS] branches=- | result=backingMap, interfaceClass
[COLLABORATORS] param interfaceClass:Class<T> getClassLoader/0
[NEW] BackingMapInvocationHandler
[CALLS-EX... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public static T InterfaceMap.createInstance(Class<T> interfaceClass, Map<String, Object> backingMap)
[INPUTS] branches=- | result=backingMap, interfaceClass
[COLLABORATORS] param interfaceClass:Class<T> getClassLoader/0
[NEW] BackingMapInvocationHandler
[CALLS-EX... | true | ok | {"focal": {"class": "InterfaceMap", "name": "createInstance", "signature": "T createInstance(Class<T> interfaceClass, Map<String, Object> backingMap)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public static", "params": [{"name": "interfaceClass", "type": "Class<T>"}, {"name": "backingMap", "type"... |
15040596_16 | class Sender {
public CompletableFuture<Result> send(Message message) {
try {
HttpRequest request = HttpRequest.newBuilder()
.uri(uri)
.header("Authorization", authorizationHeader)
.header("... | MockResponse success = new MockResponse().setResponseCode(200)
.setBody(fixture("fixtures/response-success.json"));
MockResponse error = new MockResponse().setResponseCode(503);
server.enqueue(error);
server.enqueue(error);
server.enqueue(error);
se... | [FOCAL] public CompletableFuture<Result> Sender.send(Message message)
[CLASS] class Sender
[METRICS] loc=42 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=3
[CALLS-INTERNAL] HttpClient getClient()
[CALLS-EXTERNAL] HttpRequest.newBuilder() .uri(uri) .header("Authorization....build/0, HttpRequest.newBuilder() .uri(ur... | /* static context
[FOCAL] public CompletableFuture<Result> Sender.send(Message message)
[PATH1] try-body throws -> return CompletableFuture.failedFuture(e)
[PATH2] return retry.executeCompletionStage(executorService, () -> getClient().sen...
[INPUTS] branches=- | result=message, mapper
[COLLABORATORS] param message:Mes... | /* static context
[FOCAL] public CompletableFuture<Result> Sender.send(Message message)
[PATH1] try-body throws -> return CompletableFuture.failedFuture(e)
[PATH2] return retry.executeCompletionStage(executorService, () -> getClient().sen...
[INPUTS] branches=- | result=message, mapper
[COLLABORATORS] param message:Mes... | true | ok | {"focal": {"class": "Sender", "name": "send", "signature": "CompletableFuture<Result> send(Message message)", "start_line": 3, "modifiers": "public", "params": [{"name": "message", "type": "Message"}], "return_type": "CompletableFuture<Result>"}, "class_info": {"name": "Sender", "kind": "class", "modifiers": "", "super... |
15042909_0 | class Migratron {
public void updateMigration(Migration update) {
updateMigration = update;
}
public void addMigration(int versionCode,Migration migration);
public void migrate();
@SneakyThrows(NameNotFoundException.class) private int appVersion();
private Migratron migratron;
pri... | //given
Migration update = mock(Migration.class);
migratron.updateMigration(update);
//when
migratron.migrate();
//then
verify(update,times(1)).migrate(eq(Robolectric.application));
}
} | [FOCAL] public void Migratron.updateMigration(Migration update)
[CLASS] class Migratron
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[DATAFLOW] update@param->L2
[CLASS-MEMBERS] void addMigration(int versionCode, Migration migration); void migrate(); int appVersion()
[TEST] MigratronTest: @Test p... | /* static context
[FOCAL] public void Migratron.updateMigration(Migration update)
*/
| /* static context
[FOCAL] public void Migratron.updateMigration(Migration update)
*/
class Migratron {
public void updateMigration(Migration update) {
updateMigration = update;
}
public void addMigration(int versionCode,Migration migration);
public void migrate();
@SneakyThrows(NameNotFoun... | true | ok | {"focal": {"class": "Migratron", "name": "updateMigration", "signature": "void updateMigration(Migration update)", "start_line": 3, "modifiers": "public", "params": [{"name": "update", "type": "Migration"}], "return_type": "void"}, "class_info": {"name": "Migratron", "kind": "class", "modifiers": "", "superclass": null... |
15057896_8 | class JsonSerializer implements Serializer {
@Override
public byte[] serialize(Event event) throws RedisSerializerException {
JsonObject jsonObject = new JsonObject();
for (Map.Entry<String, String> entry : event.getHeaders().entrySet()) {
jsonObject.addProperty(entry.getKey(), entr... | String res = serialize(new HashMap<String, String>());
assertTrue(res.equals("{}"));
}
} | [FOCAL] @Override public byte[] JsonSerializer.serialize(Event event)
[CLASS] class JsonSerializer implements Serializer
[METRICS] loc=8 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] event.getHeaders().entrySet/0, Event.getHeaders/0, JsonObject.addProperty/2, Map.Entry<String, String>.getKey/0, ... | /* static context
[FOCAL] @Override public byte[] JsonSerializer.serialize(Event event)
[PATH1] foreach(Map.Entry<String, String> entry : event.getHeaders().entrySet())=T -> exit loop -> return jsonObject.toString().getBytes()
[PATH2] foreach(Map.Entry<String, String> entry : event.getHeaders().entrySet())=F -> return ... | /* static context
[FOCAL] @Override public byte[] JsonSerializer.serialize(Event event)
[PATH1] foreach(Map.Entry<String, String> entry : event.getHeaders().entrySet())=T -> exit loop -> return jsonObject.toString().getBytes()
[PATH2] foreach(Map.Entry<String, String> entry : event.getHeaders().entrySet())=F -> return ... | true | ok | {"focal": {"class": "JsonSerializer", "name": "serialize", "signature": "byte[] serialize(Event event) throws RedisSerializerException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "event", "type": "Event"}], "return_type": "byte[]"}, "class_info": {"name": "JsonSerializer", "kind": "class", "... |
15070657_18 | class FieldBuilder {
public Collection<Field> createFields(Collection<TokenStream> tokenStreams,
FieldDescription fieldDescription) throws FieldBuildingException {
TokenStream tokenStream = createFieldTokenStream(tokenStreams,
fieldDescription);
this.fieldDescription = fieldDescription;
String fieldNam... |
fieldDescription.setIndex(FieldBuilder.FIELD_INDEX_YES);
fieldDescription.setStored(FieldBuilder.FIELD_STORE_YES);
tokenStreams.remove(1);
expect(filterBuilder.filter(isA(TokenStream.class), isA(Collection.class))).andReturn(tokenStream1);
replay(filterBuilder);
Collection<Field> fields = fieldBu... | [FOCAL] public Collection<Field> FieldBuilder.createFields(Collection<TokenStream> tokenStreams, FieldDescription fieldDescription)
[CLASS] class FieldBuilder
[METRICS] loc=68 cc=7 branches=5 loops=1 returns=1 throws=0 nesting=3
[CALLS-INTERNAL] Collection<Field> createStoredFields(String fieldName, TokenStream tokenSt... | /* static context
[FOCAL] public Collection<Field> FieldBuilder.createFields(Collection<TokenStream> tokenStreams, FieldDescription fieldDescription)
[PATH1] if(!coverField)=F -> while(termCoverBuilder.increaseCoverSubset())=T -> if(store)#2=T -> if(fieldIndex != Field.Index.NO && (!unique || !store))#2=T -> exit loop ... | /* static context
[FOCAL] public Collection<Field> FieldBuilder.createFields(Collection<TokenStream> tokenStreams, FieldDescription fieldDescription)
[PATH1] if(!coverField)=F -> while(termCoverBuilder.increaseCoverSubset())=T -> if(store)#2=T -> if(fieldIndex != Field.Index.NO && (!unique || !store))#2=T -> exit loop ... | true | ok | {"focal": {"class": "FieldBuilder", "name": "createFields", "signature": "Collection<Field> createFields(Collection<TokenStream> tokenStreams, FieldDescription fieldDescription) throws FieldBuildingException", "start_line": 3, "modifiers": "public", "params": [{"name": "tokenStreams", "type": "Collection<TokenStream>"}... |
15070661_39 | class ForEachBlock extends RutaBlock {
@Override
public ScriptApply apply(RutaStream stream, InferenceCrowd crowd) {
BlockApply result = new BlockApply(this);
getEnvironment().ensureMaterializedInitialValues(new MatchContext(this), stream);
crowd.beginVisit(this, result);
setRuleElementAnchor();
... | String script = "CONDITION isSmall() = REGEXP(\".\");\n";
script += "FOREACH(num) NUM{} {\n";
script += "num{isSmall()-> T1};";
script += "}";
CAS cas = RutaTestUtils.getCAS("1 22 333");
Ruta.apply(cas, script);
RutaTestUtils.assertAnnotationsEquals(cas, 1, 1, "1");
}
} | [FOCAL] @Override public ScriptApply ForEachBlock.apply(RutaStream stream, InferenceCrowd crowd)
[CLASS] class ForEachBlock extends RutaBlock
[METRICS] loc=42 cc=9 branches=5 loops=3 returns=1 throws=0 nesting=5
[CALLS-INTERNAL] void setRuleElementAnchor()
[CALLS-EXTERNAL] getEnvironment().ensureMaterializedInitialValu... | /* static context
[FOCAL] @Override public ScriptApply ForEachBlock.apply(RutaStream stream, InferenceCrowd crowd)
[PATH1] if(direction != null)=T -> if(!leftToRight)=T -> foreach(AbstractRuleMatch<? extends AbstractRule> eachMatch : list)=T -> if(eachMatch.matched())=T -> if(matchedAnnotations == null || matchedAnnota... | /* static context
[FOCAL] @Override public ScriptApply ForEachBlock.apply(RutaStream stream, InferenceCrowd crowd)
[PATH1] if(direction != null)=T -> if(!leftToRight)=T -> foreach(AbstractRuleMatch<? extends AbstractRule> eachMatch : list)=T -> if(eachMatch.matched())=T -> if(matchedAnnotations == null || matchedAnnota... | true | ok | {"focal": {"class": "ForEachBlock", "name": "apply", "signature": "ScriptApply apply(RutaStream stream, InferenceCrowd crowd)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "stream", "type": "RutaStream"}, {"name": "crowd", "type": "InferenceCrowd"}], "return_type": "ScriptApply"}, "class_info"... |
15070665_72 | class AnalysisEngineFactory {
public static AnalysisEngineDescription createEngineDescription(PearSpecifier pearSpecifier,
Object... configurationData) throws InvalidXMLException, IOException {
ConfigurationParameterFactory.ensureParametersComeInPairs(configurationData);
if (configurationData ... | {
AnalysisEngineDescription desc1 = AnalysisEngineFactory.createEngineDescription(
PristineAnnotatorClass.class, (Object[]) null);
assertTrue(
"Multiple deployment should be allowed on " + desc1.getAnnotatorImplementationName(),
desc1.getAnalysisEngineMetaData()... | [FOCAL] public static AnalysisEngineDescription AnalysisEngineFactory.createEngineDescription(PearSpecifier pearSpecifier, Object... configurationData)
[CLASS] class AnalysisEngineFactory
[METRICS] loc=24 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] ConfigurationParameterFactory.ensureParameter... | class AnalysisEngineFactory {
public static AnalysisEngineDescription createEngineDescription(PearSpecifier pearSpecifier,
Object... configurationData) throws InvalidXMLException, IOException {
ConfigurationParameterFactory.ensureParametersComeInPairs(configurationData);
if (configurationData ... | false | ok | {"focal": {"class": "AnalysisEngineFactory", "name": "createEngineDescription", "signature": "AnalysisEngineDescription createEngineDescription(PearSpecifier pearSpecifier, Object... configurationData) throws InvalidXMLException, IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "pearSpec... | |
15078952_47 | class OrderPreservingMap implements Map<K, V>, Cloneable {
public Object[] keyArray() {
return this.orderKeys.toArray();
}
public OrderPreservingMap();
@SuppressWarnings("unchecked") public OrderPreservingMap(OrderPreservingMap<K, V> other);
public OrderPreservingMap(Map<K, V> map, Coll... | Object[] keyArray = map.keyArray();
for (int i = 0; i < keys.length; i++) {
assertEquals("map.keyArray()[" + i + "]", keys[i], keyArray[i]);
}
}
} | [FOCAL] public Object[] OrderPreservingMap.keyArray()
[CLASS] class OrderPreservingMap implements Map<K, V>, Cloneable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] this.orderKeys.toArray/0
[FIELDS] read=orderKeys
[COLLABORATORS] field orderKeys toArray/0
[CLASS-MEMBERS] OrderPre... | /* static context
[FOCAL] public Object[] OrderPreservingMap.keyArray()
[COLLABORATORS] field orderKeys toArray/0
[FIELDS] read=orderKeys
[CALLS-EXTERNAL] this.orderKeys.toArray/0
*/
| /* static context
[FOCAL] public Object[] OrderPreservingMap.keyArray()
[COLLABORATORS] field orderKeys toArray/0
[FIELDS] read=orderKeys
[CALLS-EXTERNAL] this.orderKeys.toArray/0
*/
class OrderPreservingMap implements Map<K, V>, Cloneable {
public Object[] keyArray() {
return this.orderKeys.toArray();
... | true | ok | {"focal": {"class": "OrderPreservingMap", "name": "keyArray", "signature": "Object[] keyArray()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Object[]"}, "class_info": {"name": "OrderPreservingMap", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Map<K, V>, Cloneable", "fi... |
15090793_3 | class Cloner {
@SuppressWarnings("unchecked")
public static <T> T shallowCopy(T original) {
Class<? extends T> clazz = (Class<? extends T>) original.getClass();
BeanClass<? extends T> beanClass = (BeanClass<? extends T>) classes.get(clazz);
if (beanClass == null) {
beanClass = BeanClass.buildFrom(claz... | G g = new G();
g.setA("aaa");
g.setB(5);
g.setC(null);
g.setD(new D("abcD"));
g.setF(true);
g.setG("ggg");
G clone = Cloner.shallowCopy(g);
Assert.assertEquals(g, clone);
}
} | [FOCAL] @SuppressWarnings("unchecked") public static T Cloner.shallowCopy(T original)
[CLASS] class Cloner
[METRICS] loc=13 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] E shallowCopyHelper(T original, BeanClass<E> beanClass)
[CALLS-EXTERNAL] T.getClass/0, classes.get/1, BeanClass.buildFrom/1, c... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public static T Cloner.shallowCopy(T original)
[PATH1] if(beanClass == null)=T -> return shallowCopyHelper(original, beanClass)
[PATH2] if(beanClass == null)=F -> return shallowCopyHelper(original, beanClass)
[INPUTS] branches=original | result=original
[COLLABOR... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public static T Cloner.shallowCopy(T original)
[PATH1] if(beanClass == null)=T -> return shallowCopyHelper(original, beanClass)
[PATH2] if(beanClass == null)=F -> return shallowCopyHelper(original, beanClass)
[INPUTS] branches=original | result=original
[COLLABOR... | true | ok | {"focal": {"class": "Cloner", "name": "shallowCopy", "signature": "T shallowCopy(T original)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public static", "params": [{"name": "original", "type": "T"}], "return_type": "T"}, "class_info": {"name": "Cloner", "kind": "class", "modifiers": "", "superclas... |
15092109_3 | class ClientLibOptimizerServlet extends SlingSafeMethodsServlet {
private List<String> getSortedDependentCategories(Set<String> originalCategories, LibraryType type, List<String> existingCategories) {
final Collection<ClientLibrary> libraries = htmlLibraryManager.getLibraries(
originalCateg... | ClientLibrary clientLibraryA = new MockClientLibraryBuilder(MockClientLibraryBuilder.MockClientLibraryType.CSS, "categoryA").getClientLibrary();
ClientLibrary clientLibraryB = new MockClientLibraryBuilder(MockClientLibraryBuilder.MockClientLibraryType.JSANDCSS, "categoryB").setDependentLibraries(clientLibraryA).ge... | [FOCAL] private List<String> ClientLibOptimizerServlet.getSortedDependentCategories(Set<String> originalCategories, LibraryType type, List<String> existingCategories)
[CLASS] class ClientLibOptimizerServlet extends SlingSafeMethodsServlet
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTER... | /* static context
[FOCAL] private List<String> ClientLibOptimizerServlet.getSortedDependentCategories(Set<String> originalCategories, LibraryType type, List<String> existingCategories)
[INPUTS] branches=- | result=existingCategories, originalCategories, type
[COLLABORATORS] field htmlLibraryManager getLibraries/4; para... | /* static context
[FOCAL] private List<String> ClientLibOptimizerServlet.getSortedDependentCategories(Set<String> originalCategories, LibraryType type, List<String> existingCategories)
[INPUTS] branches=- | result=existingCategories, originalCategories, type
[COLLABORATORS] field htmlLibraryManager getLibraries/4; para... | true | ok | {"focal": {"class": "ClientLibOptimizerServlet", "name": "getSortedDependentCategories", "signature": "List<String> getSortedDependentCategories(Set<String> originalCategories, LibraryType type, List<String> existingCategories)", "start_line": 3, "modifiers": "private", "params": [{"name": "originalCategories", "type":... |
15104745_22 | class DataConverter {
public String convert(Object val) {
if (val == null) {
return null;
}
String converted;
if (val instanceof String) {
converted = val.toString();
} else if (val instanceof InetAddress) {
converted = val.toString();
} else if (val instanceof UUID) {
converted = val.toStri... | assertEquals("1393832026821", converter.convert(BigInteger.valueOf(1393832026821L)));
}
} | [FOCAL] public String DataConverter.convert(Object val)
[CLASS] class DataConverter
[METRICS] loc=49 cc=14 branches=13 loops=0 returns=2 throws=0 nesting=12
[CALLS-EXTERNAL] Object.toString/0, dateFomrat.get().format/1, dateFomrat.get/0, timeFormatter.format/1, Double.toString/1, Boolean.toString/1, Integer.toString/1,... | /* static context
[FOCAL] public String DataConverter.convert(Object val)
[PATH1] if(val == null)=F -> if(val instanceof String)=F -> if(val instanceof InetAddress)=F -> if(val instanceof UUID)=F -> if(val instanceof Date)=F -> if(val instanceof LocalDateTime)=F -> if(val instanceof BigInteger)=F -> if(val instanceof D... | /* static context
[FOCAL] public String DataConverter.convert(Object val)
[PATH1] if(val == null)=F -> if(val instanceof String)=F -> if(val instanceof InetAddress)=F -> if(val instanceof UUID)=F -> if(val instanceof Date)=F -> if(val instanceof LocalDateTime)=F -> if(val instanceof BigInteger)=F -> if(val instanceof D... | true | ok | {"focal": {"class": "DataConverter", "name": "convert", "signature": "String convert(Object val)", "start_line": 3, "modifiers": "public", "params": [{"name": "val", "type": "Object"}], "return_type": "String"}, "class_info": {"name": "DataConverter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": ... |
15106163_0 | class XmlUtil {
public static <T> T extractFromXml(@Nonnull File xmlFile, String xPath, Class<T> clazz)
throws IOException {
return Objects.requireNonNull(FileUtil.executeIoOperation(new ThreadUtil.Operation<T>() {
@Nonnull
@Override
public T run() throws IOE... | File tempDir = null;
try {
tempDir = FileUtil.createTemporaryDirectory("test-xml");
File testFile = new File(tempDir, "test.xml");
FileUtil.writeFile(testFile, getBytes("test.xml"));
Assert.assertEquals(
"Failed XmlUtil.extractFromXml... | [FOCAL] public static T XmlUtil.extractFromXml(File xmlFile, String xPath, Class<T> clazz)
[CLASS] class XmlUtil
[METRICS] loc=16 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] T internalExtractFromXml(InputStream xmlInputStream, String xPath, Class<T> clazz)
[CALLS-EXTERNAL] Objects.requireNonNu... | class XmlUtil {
public static <T> T extractFromXml(@Nonnull File xmlFile, String xPath, Class<T> clazz)
throws IOException {
return Objects.requireNonNull(FileUtil.executeIoOperation(new ThreadUtil.Operation<T>() {
@Nonnull
@Override
public T run() throws IOE... | false | ok | {"focal": {"class": "XmlUtil", "name": "extractFromXml", "signature": "T extractFromXml(File xmlFile, String xPath, Class<T> clazz) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "xmlFile", "type": "File"}, {"name": "xPath", "type": "String"}, {"name": "clazz", "type": "Class<T>... | |
15106392_80 | class DisplayHierarchyNode {
public List<DisplayHierarchyNode> siblings() {
return siblings;
}
public DisplayHierarchyNode( PropertyPath pathTo, DisplayHierarchyNode parent,
DisplayRdfNode rdfNode, ShortNameRenderer shortNameRenderer );
public PropertyPath pa... | assertEquals( 0, dhn.siblings().size() );
assertFalse( dhn.hasSiblings() );
Resource r0 = ResourceFactory.createResource( "http://example/foo#r0");
DisplayHierarchyNode c1 = new DisplayHierarchyNode( new PropertyPath(), null, new DisplayRdfNode( rm.page(), r0 ), null );
dhn.add... | [FOCAL] public List<DisplayHierarchyNode> DisplayHierarchyNode.siblings()
[CLASS] class DisplayHierarchyNode
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] DisplayHierarchyNode(PropertyPath pathTo, DisplayHierarchyNode parent, DisplayRdfNode rdfNode, ShortNameRenderer shortNameRend... | /* static context
[FOCAL] public List<DisplayHierarchyNode> DisplayHierarchyNode.siblings()
*/
| /* static context
[FOCAL] public List<DisplayHierarchyNode> DisplayHierarchyNode.siblings()
*/
class DisplayHierarchyNode {
public List<DisplayHierarchyNode> siblings() {
return siblings;
}
public DisplayHierarchyNode( PropertyPath pathTo, DisplayHierarchyNode parent,
... | true | ok | {"focal": {"class": "DisplayHierarchyNode", "name": "siblings", "signature": "List<DisplayHierarchyNode> siblings()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<DisplayHierarchyNode>"}, "class_info": {"name": "DisplayHierarchyNode", "kind": "class", "modifiers": "", "superclass": null, "... |
15120144_1 | class DefaultWordCounter implements WordCounter {
@Override
public int countChars (Note note) {
String titleAndContent = note.getTitle() + "\n" + note.getContent();
return Observable
.from(sanitizeTextForWordsAndCharsCount(note, titleAndContent).split(""))
.filter(s -> !s.matches("\\s"))
... | Note note = getNote(1L, "one two", "three four five\nAnother line");
assertEquals(30, new DefaultWordCounter().countChars(note));
}
} | [FOCAL] @Override public int DefaultWordCounter.countChars(Note note)
[CLASS] class DefaultWordCounter implements WordCounter
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Note.getTitle/0, Note.getContent/0, Observable .from(sanitizeTextForWordsAndCharsCount(note, ....single/0, O... | /* static context
[FOCAL] @Override public int DefaultWordCounter.countChars(Note note)
[INPUTS] branches=- | result=note
[COLLABORATORS] param note:Note getTitle/0,getContent/0; field s matches/1
[CALLS-EXTERNAL] Note.getTitle/0, Note.getContent/0, Observable .from(sanitizeTextForWordsAndCharsCount(note, ....single/0,... | /* static context
[FOCAL] @Override public int DefaultWordCounter.countChars(Note note)
[INPUTS] branches=- | result=note
[COLLABORATORS] param note:Note getTitle/0,getContent/0; field s matches/1
[CALLS-EXTERNAL] Note.getTitle/0, Note.getContent/0, Observable .from(sanitizeTextForWordsAndCharsCount(note, ....single/0,... | true | ok | {"focal": {"class": "DefaultWordCounter", "name": "countChars", "signature": "int countChars(Note note)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "note", "type": "Note"}], "return_type": "int"}, "class_info": {"name": "DefaultWordCounter", "kind": "class", "modifiers": "", "superclass": nu... |
15132790_17 | class Hashing {
public static int hashcode(Object o) {
return o == null ? 0 : o.hashCode();
}
private static MessageDigest getSHA1MessageDigest();
private static MessageDigest getSHA256MessageDigest();
public static int identityHash(int h);
public static int juHashMapHash(int h);
p... | assertEquals(Boolean.FALSE.hashCode(), Hashing.hashcode(false));
assertEquals(Boolean.TRUE.hashCode(), Hashing.hashcode(true));
assertEquals(Byte.valueOf((byte) -1).hashCode(), Hashing.hashcode((byte) -1));
assertEquals(Character.valueOf('a').hashCode(), Hashing.hashcode('a'));
... | [FOCAL] public static int Hashing.hashcode(Object o)
[CLASS] class Hashing
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Object.hashCode/0
[INPUTS] branches=- | result=o
[DATAFLOW] o@param->L2
[CLASS-MEMBERS] MessageDigest getSHA1MessageDigest(); MessageDigest getSHA256MessageDig... | /* static context
[FOCAL] public static int Hashing.hashcode(Object o)
[INPUTS] branches=- | result=o
[CALLS-EXTERNAL] Object.hashCode/0
*/
| /* static context
[FOCAL] public static int Hashing.hashcode(Object o)
[INPUTS] branches=- | result=o
[CALLS-EXTERNAL] Object.hashCode/0
*/
class Hashing {
public static int hashcode(Object o) {
return o == null ? 0 : o.hashCode();
}
private static MessageDigest getSHA1MessageDigest();
private... | true | ok | {"focal": {"class": "Hashing", "name": "hashcode", "signature": "int hashcode(Object o)", "start_line": 3, "modifiers": "public static", "params": [{"name": "o", "type": "Object"}], "return_type": "int"}, "class_info": {"name": "Hashing", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields... |
15137325_82 | class NubMatchingServiceImpl implements NameUsageMatchingService, NameUsageMatchingService2 {
@VisibleForTesting
protected static void interpretGenus(ParsedName pn, String genus) {
// test if name has an abbreviated genus
if (pn != null && !Strings.isNullOrEmpty(genus) && pn.getGenusOrAbove() != null && ge... | ParsedName pn = new ParsedName();
pn.setGenusOrAbove("P.");
pn.setSpecificEpithet("concolor");
NubMatchingServiceImpl.interpretGenus(pn, "Puma");
assertEquals("Puma concolor", pn.canonicalName());
pn.setGenusOrAbove("P.");
NubMatchingServiceImpl.interpretGenus(pn, "Felis");
assertEqual... | [FOCAL] @VisibleForTesting protected static void NubMatchingServiceImpl.interpretGenus(ParsedName pn, String genus)
[CLASS] class NubMatchingServiceImpl implements NameUsageMatchingService, NameUsageMatchingService2
[METRICS] loc=12 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=2
[CALLS-EXTERNAL] Strings.isNullOrE... | /* static context
[FOCAL] @VisibleForTesting protected static void NubMatchingServiceImpl.interpretGenus(ParsedName pn, String genus)
[PATH1] if(pn != null && !Strings.isNullOrEmpty(genus) && pn.getGenusOrAbove() != null && genus.length() > 1)=T -> if((pn.getGenusOrAbove().length() == 2 && pn.getGenusOrAbove().charAt(1... | /* static context
[FOCAL] @VisibleForTesting protected static void NubMatchingServiceImpl.interpretGenus(ParsedName pn, String genus)
[PATH1] if(pn != null && !Strings.isNullOrEmpty(genus) && pn.getGenusOrAbove() != null && genus.length() > 1)=T -> if((pn.getGenusOrAbove().length() == 2 && pn.getGenusOrAbove().charAt(1... | true | ok | {"focal": {"class": "NubMatchingServiceImpl", "name": "interpretGenus", "signature": "void interpretGenus(ParsedName pn, String genus)", "start_line": 3, "modifiers": "@VisibleForTesting protected static", "params": [{"name": "pn", "type": "ParsedName"}, {"name": "genus", "type": "String"}], "return_type": "void"}, "cl... |
15138385_7 | class InBloomFilterTool extends SingleJobTool<InBloomFilterOptions> {
@Override
protected Class<? extends Mapper> getMapperClass() {
return InBloomFilterMapper.class;
}
@Override protected String getName();
@Override protected void validateOptions();
@Override protected Class<? extends... | Job job=inBloomFilterTool.createJob(new String[] {
"-input",
"/basekb-sandbox/someLocation",
"-k",
"7",
"-output",
"/basekb-sandbox/anotherLocation",
"-bloomFilter",
"/camels/"
... | [FOCAL] @Override protected Class<? extends Mapper> InBloomFilterTool.getMapperClass()
[CLASS] class InBloomFilterTool extends SingleJobTool<InBloomFilterOptions>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] String getName(); void validateOptions(); Class<? extends Writable> getM... | /* static context
[FOCAL] @Override protected Class<? extends Mapper> InBloomFilterTool.getMapperClass()
*/
| /* static context
[FOCAL] @Override protected Class<? extends Mapper> InBloomFilterTool.getMapperClass()
*/
class InBloomFilterTool extends SingleJobTool<InBloomFilterOptions> {
@Override
protected Class<? extends Mapper> getMapperClass() {
return InBloomFilterMapper.class;
}
@Override protect... | true | ok | {"focal": {"class": "InBloomFilterTool", "name": "getMapperClass", "signature": "Class<? extends Mapper> getMapperClass()", "start_line": 3, "modifiers": "@Override protected", "params": [], "return_type": "Class<? extends Mapper>"}, "class_info": {"name": "InBloomFilterTool", "kind": "class", "modifiers": "", "supercl... |
15162009_6 | class BaseHandler {
protected static final boolean isValidNeutronID(String id) {
if (id == null) {
return false;
}
boolean isValid = false;
logger.trace("id - {}, length - {} ", id, id.length());
/**
* check the string length
* if length is 36 i... | assertFalse(BaseHandler.isValidNeutronID(nullString));
assertTrue(BaseHandler.isValidNeutronID(uuid));
assertTrue(BaseHandler.isValidNeutronID(tenantId));
assertTrue(BaseHandler.isValidNeutronID(neutronId));
}
} | [FOCAL] protected static final boolean BaseHandler.isValidNeutronID(String id)
[CLASS] class BaseHandler
[METRICS] loc=28 cc=5 branches=3 loops=0 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] logger.trace/3, String.length/0, UUID.fromString/1, UUID.toString/0, String.equalsIgnoreCase/1, logger.error/2
[EXCEPTIONS] catc... | /* static context
[FOCAL] protected static final boolean BaseHandler.isValidNeutronID(String id)
[PATH1] if(id == null)=F -> if(id.length() == UUID_LEN)=T -> try-body throws -> return isValid
[PATH2] if(id == null)=T -> return false
[PATH3] if(id == null)=F -> if(id.length() == UUID_LEN)=F -> if((id.length() > 0) && (i... | /* static context
[FOCAL] protected static final boolean BaseHandler.isValidNeutronID(String id)
[PATH1] if(id == null)=F -> if(id.length() == UUID_LEN)=T -> try-body throws -> return isValid
[PATH2] if(id == null)=T -> return false
[PATH3] if(id == null)=F -> if(id.length() == UUID_LEN)=F -> if((id.length() > 0) && (i... | true | ok | {"focal": {"class": "BaseHandler", "name": "isValidNeutronID", "signature": "boolean isValidNeutronID(String id)", "start_line": 3, "modifiers": "protected static final", "params": [{"name": "id", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "BaseHandler", "kind": "class", "modifiers": "", "sup... |
15209448_1 | class StructuredJsonExamplesMessageBodyReader implements MessageBodyReader<ExamplesIterable> {
@Override
public ExamplesIterable readFrom(Class<ExamplesIterable> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOExcep... |
final CountDownLatch readThreadIsReadyLatch = new CountDownLatch(1);
final Exchanger<Example> exampleExchanger = new Exchanger<Example>();
final PipedInputStream pipedInputStream = new PipedInputStream(); //the reading thread will read from this stream
final PipedOutputStream pipedOutputStream = new PipedOutp... | [FOCAL] @Override public ExamplesIterable StructuredJsonExamplesMessageBodyReader.readFrom(Class<ExamplesIterable> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
[CLASS] class StructuredJsonExamplesMessageBodyReader implements... | /* static context
[FOCAL] @Override public ExamplesIterable StructuredJsonExamplesMessageBodyReader.readFrom(Class<ExamplesIterable> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
[PATH1] if(LOGGER.isDebugEnabled())=T -> if(ht... | /* static context
[FOCAL] @Override public ExamplesIterable StructuredJsonExamplesMessageBodyReader.readFrom(Class<ExamplesIterable> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
[PATH1] if(LOGGER.isDebugEnabled())=T -> if(ht... | true | ok | {"focal": {"class": "StructuredJsonExamplesMessageBodyReader", "name": "readFrom", "signature": "ExamplesIterable readFrom(Class<ExamplesIterable> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException, WebApplicati... |
15221298_30 | class ExternalDescriptionLoader {
public void addHtmlDescription(RulesDefinition.NewRule rule) {
URL resource = ExternalDescriptionLoader.class.getResource(resourceBasePath + "/" + rule.key() + ".html");
if (resource != null) {
addHtmlDescription(rule, resource);
}
}
pu... |
// given
final ExternalDescriptionLoader loader = new ExternalDescriptionLoader(LANGUAGE_KEY);
final NewRule rule = repository.createRule("ruleWithoutExternalInfo").setName("name1");
// when
final Throwable thrown = catchThrowable(() -> loader.addHtmlDescription(rule, new URL("... | [FOCAL] public void ExternalDescriptionLoader.addHtmlDescription(RulesDefinition.NewRule rule)
[CLASS] class ExternalDescriptionLoader
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] void addHtmlDescription(RulesDefinition.NewRule rule, URL resource)
[CALLS-EXTERNAL] ExternalDescri... | /* static context
[FOCAL] public void ExternalDescriptionLoader.addHtmlDescription(RulesDefinition.NewRule rule)
[PATH1] if(resource != null)=T
[PATH2] if(resource != null)=F
[INPUTS] branches=rule | result=-
[COLLABORATORS] param rule:RulesDefinition.NewRule key/0
[CALLS-INTERNAL] void addHtmlDescription(RulesDefiniti... | /* static context
[FOCAL] public void ExternalDescriptionLoader.addHtmlDescription(RulesDefinition.NewRule rule)
[PATH1] if(resource != null)=T
[PATH2] if(resource != null)=F
[INPUTS] branches=rule | result=-
[COLLABORATORS] param rule:RulesDefinition.NewRule key/0
[CALLS-INTERNAL] void addHtmlDescription(RulesDefiniti... | true | ok | {"focal": {"class": "ExternalDescriptionLoader", "name": "addHtmlDescription", "signature": "void addHtmlDescription(RulesDefinition.NewRule rule)", "start_line": 3, "modifiers": "public", "params": [{"name": "rule", "type": "RulesDefinition.NewRule"}], "return_type": "void"}, "class_info": {"name": "ExternalDescriptio... |
15227263_10 | class MercatorProjection {
public static long pixelXToTileX(double pixelX, byte zoomLevel) {
return (long) Math.min(Math.max(pixelX / Tile.TILE_SIZE, 0), Math.pow(2, zoomLevel) - 1);
}
private MercatorProjection();
public static double calculateGroundResolution(double latitude, byte zoomLevel);
public static... | for (byte zoomLevel = ZOOM_LEVEL_MIN; zoomLevel <= ZOOM_LEVEL_MAX; ++zoomLevel) {
Assert.assertEquals(0, MercatorProjection.pixelXToTileX(0, zoomLevel));
}
}
} | [FOCAL] public static long MercatorProjection.pixelXToTileX(double pixelX, byte zoomLevel)
[CLASS] class MercatorProjection
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Math.min/2, Math.max/2, Math.pow/2
[INPUTS] branches=- | result=pixelX, zoomLevel
[DATAFLOW] pixelX@param->L2;... | /* static context
[FOCAL] public static long MercatorProjection.pixelXToTileX(double pixelX, byte zoomLevel)
[INPUTS] branches=- | result=pixelX, zoomLevel
[CALLS-EXTERNAL] Math.min/2, Math.max/2, Math.pow/2
*/
| /* static context
[FOCAL] public static long MercatorProjection.pixelXToTileX(double pixelX, byte zoomLevel)
[INPUTS] branches=- | result=pixelX, zoomLevel
[CALLS-EXTERNAL] Math.min/2, Math.max/2, Math.pow/2
*/
class MercatorProjection {
public static long pixelXToTileX(double pixelX, byte zoomLevel) {
return (long... | true | ok | {"focal": {"class": "MercatorProjection", "name": "pixelXToTileX", "signature": "long pixelXToTileX(double pixelX, byte zoomLevel)", "start_line": 3, "modifiers": "public static", "params": [{"name": "pixelX", "type": "double"}, {"name": "zoomLevel", "type": "byte"}], "return_type": "long"}, "class_info": {"name": "Mer... |
15284049_26 | class CreateEdgeLogEntry implements LogEntry {
@Override
public void appendToLog(LogOutput dbLog) {
dbLog.newEdge(edge);
StreamIterator.stream(edge.properties())
.filter(property -> !propertiesToIgnore.contains(property.key()))
.forEach(dbLog::newProperty);
}
publi... | Edge edge = edge().withProperty("prop1", "value")
.withProperty("prop2", "value")
.withProperty("prop3", "value")
.build();
CreateEdgeLogEntry instance = new CreateEdgeLogEntry(edge);
LogOutput dbLog = mock(LogOutput.class);
instance.app... | [FOCAL] @Override public void CreateEdgeLogEntry.appendToLog(LogOutput dbLog)
[CLASS] class CreateEdgeLogEntry implements LogEntry
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] LogOutput.newEdge/1, StreamIterator.stream(edge.properties()) .filter(property....forEach/1, StreamIter... | /* static context
[FOCAL] @Override public void CreateEdgeLogEntry.appendToLog(LogOutput dbLog)
[COLLABORATORS] param dbLog:LogOutput newEdge/1; field edge properties/0; field propertiesToIgnore contains/1; field property key/0
[CALLS-EXTERNAL] LogOutput.newEdge/1, StreamIterator.stream(edge.properties()) .filter(prope... | /* static context
[FOCAL] @Override public void CreateEdgeLogEntry.appendToLog(LogOutput dbLog)
[COLLABORATORS] param dbLog:LogOutput newEdge/1; field edge properties/0; field propertiesToIgnore contains/1; field property key/0
[CALLS-EXTERNAL] LogOutput.newEdge/1, StreamIterator.stream(edge.properties()) .filter(prope... | true | ok | {"focal": {"class": "CreateEdgeLogEntry", "name": "appendToLog", "signature": "void appendToLog(LogOutput dbLog)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "dbLog", "type": "LogOutput"}], "return_type": "void"}, "class_info": {"name": "CreateEdgeLogEntry", "kind": "class", "modifiers": "", ... |
15289581_19 | class StandardExceptionPropagator implements ExceptionPropagator {
@Override
public RuntimeException propagateException(Object key,
ExceptionInformation exceptionInformation) {
long expiry = exceptionInformation.getUntil();
String txt = "";
if (expiry > 0) {... | System.currentTimeMillis();
RuntimeException t = STANDARD_PROPAGATOR.propagateException(
null, toInfo(new RuntimeException("serious thing"), Long.MAX_VALUE));
assertTrue(t.toString().contains("expiry=ETERNAL"));
}
} | [FOCAL] @Override public RuntimeException StandardExceptionPropagator.propagateException(Object key, ExceptionInformation exceptionInformation)
[CLASS] class StandardExceptionPropagator implements ExceptionPropagator
[METRICS] loc=15 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] String formatMil... | /* static context
[FOCAL] @Override public RuntimeException StandardExceptionPropagator.propagateException(Object key, ExceptionInformation exceptionInformation)
[PATH1] if(expiry > 0)=T -> if(expiry == ExpiryTimeValues.ETERNAL)=T -> return new CacheLoaderException(txt + exceptionInformation.getException(),...
[PATH2] ... | /* static context
[FOCAL] @Override public RuntimeException StandardExceptionPropagator.propagateException(Object key, ExceptionInformation exceptionInformation)
[PATH1] if(expiry > 0)=T -> if(expiry == ExpiryTimeValues.ETERNAL)=T -> return new CacheLoaderException(txt + exceptionInformation.getException(),...
[PATH2] ... | true | ok | {"focal": {"class": "StandardExceptionPropagator", "name": "propagateException", "signature": "RuntimeException propagateException(Object key, ExceptionInformation exceptionInformation)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "key", "type": "Object"}, {"name": "exceptionInformation", "ty... |
15292023_0 | class RandomAccessPattern extends AbstractEternalAccessPattern {
@Override
public int next() {
return rng.nextInt(upper);
}
public RandomAccessPattern(int _upper);
}
class RandomAccessPatternTest {
@Test
public void test0() throws Exception {
| RandomAccessPattern p = new RandomAccessPattern(1);
assertTrue(p.isEternal());
assertTrue(p.hasNext());
assertEquals(0, p.next());
assertTrue(p.isEternal());
assertTrue(p.hasNext());
assertEquals(0, p.next());
}
} | [FOCAL] @Override public int RandomAccessPattern.next()
[CLASS] class RandomAccessPattern extends AbstractEternalAccessPattern
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] rng.nextInt/1
[COLLABORATORS] field rng nextInt/1
[CLASS-MEMBERS] RandomAccessPattern(int _upper)
[TEST] Ra... | /* static context
[FOCAL] @Override public int RandomAccessPattern.next()
[COLLABORATORS] field rng nextInt/1
[CALLS-EXTERNAL] rng.nextInt/1
*/
| /* static context
[FOCAL] @Override public int RandomAccessPattern.next()
[COLLABORATORS] field rng nextInt/1
[CALLS-EXTERNAL] rng.nextInt/1
*/
class RandomAccessPattern extends AbstractEternalAccessPattern {
@Override
public int next() {
return rng.nextInt(upper);
}
public RandomAccessPattern(int _upper... | true | ok | {"focal": {"class": "RandomAccessPattern", "name": "next", "signature": "int next()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "RandomAccessPattern", "kind": "class", "modifiers": "", "superclass": "AbstractEternalAccessPattern", "interfaces": null, "... |
15293721_6 | class JavaToHumanTranslator {
public String humanize(final Method method) {
if (method.isAnnotationPresent(Text.class)) {
return method.getAnnotation(Text.class).value();
} else {
return humanize(method.getName());
}
}
public String humanize(Class<?> classUn... | JavaToHumanTranslator tested = new JavaToHumanTranslator();
Assert.assertEquals("Underscores are replaced by space",tested.humanize("underscores_are_replaced_by_space"));
}
} | [FOCAL] public String JavaToHumanTranslator.humanize(Method method)
[CLASS] class JavaToHumanTranslator
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] String humanize(Class<?> classUnderTest)
[CALLS-EXTERNAL] Method.isAnnotationPresent/1, method.getAnnotation(Text.class).value/0, ... | /* static context
[FOCAL] public String JavaToHumanTranslator.humanize(Method method)
[PATH1] if(method.isAnnotationPresent(Text.class))=T -> return method.getAnnotation(Text.class).value()
[PATH2] if(method.isAnnotationPresent(Text.class))=F -> return humanize(method.getName())
[INPUTS] branches=method | result=method... | /* static context
[FOCAL] public String JavaToHumanTranslator.humanize(Method method)
[PATH1] if(method.isAnnotationPresent(Text.class))=T -> return method.getAnnotation(Text.class).value()
[PATH2] if(method.isAnnotationPresent(Text.class))=F -> return humanize(method.getName())
[INPUTS] branches=method | result=method... | true | ok | {"focal": {"class": "JavaToHumanTranslator", "name": "humanize", "signature": "String humanize(Method method)", "start_line": 3, "modifiers": "public", "params": [{"name": "method", "type": "Method"}], "return_type": "String"}, "class_info": {"name": "JavaToHumanTranslator", "kind": "class", "modifiers": "", "superclas... |
15303802_2 | class OpusToWaveConverter {
public void convert(URL pdmlUrl, File waveFileDir, SampleRate sampleRate, Channels channels) throws Exception {
if (!waveFileDir.isDirectory())
throw new IllegalArgumentException();
Pdml pdml = new PdmlReader().unmarshall(pdmlUrl);
RtpStream[] streams... | URL pdmlUrl = RtpExtracterTest.class.getResource("sipcall.pdml");
Assert.assertNotNull(pdmlUrl);
File[] waveFiles = new File[2];
for (int i=0; i<waveFiles.length; ++i)
waveFiles[i] = File.createTempFile(OpusToWaveConverterTest.class.getSimpleName(), ".wav");
try {
... | [FOCAL] public void OpusToWaveConverter.convert(URL pdmlUrl, File waveFileDir, SampleRate sampleRate, Channels channels)
[CLASS] class OpusToWaveConverter
[METRICS] loc=10 cc=3 branches=1 loops=1 returns=0 throws=1 nesting=1
[CALLS-INTERNAL] void decodeOneStream(File waveFile, SampleRate sampleRate, Channels channels, ... | /* static context
[FOCAL] public void OpusToWaveConverter.convert(URL pdmlUrl, File waveFileDir, SampleRate sampleRate, Channels channels)
[THROWS-WHEN] IllegalArgumentException when !waveFileDir.isDirectory()
[PATH1] if(!waveFileDir.isDirectory())=F -> for(i<streams.length)=T -> exit loop
[PATH2] if(!waveFileDir.isDir... | /* static context
[FOCAL] public void OpusToWaveConverter.convert(URL pdmlUrl, File waveFileDir, SampleRate sampleRate, Channels channels)
[THROWS-WHEN] IllegalArgumentException when !waveFileDir.isDirectory()
[PATH1] if(!waveFileDir.isDirectory())=F -> for(i<streams.length)=T -> exit loop
[PATH2] if(!waveFileDir.isDir... | true | ok | {"focal": {"class": "OpusToWaveConverter", "name": "convert", "signature": "void convert(URL pdmlUrl, File waveFileDir, SampleRate sampleRate, Channels channels) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "pdmlUrl", "type": "URL"}, {"name": "waveFileDir", "type": "File"}, {"name": "s... |
15322987_4 | class EmployeeResource {
@GET
@Produces({ "application/json", "application/xml" })
@Path("{id}")
public Employee get(@PathParam("id") int id) {
if (id < bean.getEmployees().size())
return bean.getEmployees().get(id);
else
return null;
}
@GET @Produces({ "application/xml... | JsonArray json = target.request().accept(MediaType.APPLICATION_JSON).get(JsonArray.class);
assertEquals(3, json.size());
for(int i = 0; i < json.size(); i++) {
JsonObject obj = json.getJsonObject(i);
String name = obj.getString("name");
int age = obj.getInt("age"... | [FOCAL] @GET @Produces({ "application/json", "application/xml" }) @Path("{id}") public Employee EmployeeResource.get(int id)
[CLASS] class EmployeeResource
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] bean.getEmployees().size/0, bean.getEmployees/0, bean.getEmployees().get/1
[PA... | /* static context
[FOCAL] @GET @Produces({ "application/json", "application/xml" }) @Path("{id}") public Employee EmployeeResource.get(int id)
[PATH1] if(id < bean.getEmployees().size())=T -> return bean.getEmployees().get(id)
[PATH2] if(id < bean.getEmployees().size())=F -> return null
[INPUTS] branches=id | result=id... | /* static context
[FOCAL] @GET @Produces({ "application/json", "application/xml" }) @Path("{id}") public Employee EmployeeResource.get(int id)
[PATH1] if(id < bean.getEmployees().size())=T -> return bean.getEmployees().get(id)
[PATH2] if(id < bean.getEmployees().size())=F -> return null
[INPUTS] branches=id | result=id... | true | ok | {"focal": {"class": "EmployeeResource", "name": "get", "signature": "Employee get(int id)", "start_line": 3, "modifiers": "@GET @Produces({ \"application/json\", \"application/xml\" }) @Path(\"{id}\") public", "params": [{"name": "id", "type": "int"}], "return_type": "Employee"}, "class_info": {"name": "EmployeeResourc... |
15373368_79 | class NumberOfTradesCriterion extends AbstractAnalysisCriterion {
@Override
public double calculate(TimeSeries series, TradingRecord tradingRecord) {
return tradingRecord.getTradeCount();
}
@Override public double calculate(TimeSeries series, Trade trade);
@Override public boolean betterTh... | Trade trade = new Trade();
NumberOfTradesCriterion tradesCriterion = new NumberOfTradesCriterion();
assertEquals(1d, tradesCriterion.calculate(null, trade), TATestsUtils.TA_OFFSET);
}
} | [FOCAL] @Override public double NumberOfTradesCriterion.calculate(TimeSeries series, TradingRecord tradingRecord)
[CLASS] class NumberOfTradesCriterion extends AbstractAnalysisCriterion
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] TradingRecord.getTradeCount/0
[INPUTS] branches=... | /* static context
[FOCAL] @Override public double NumberOfTradesCriterion.calculate(TimeSeries series, TradingRecord tradingRecord)
[INPUTS] branches=- | result=tradingRecord | unused=series
[COLLABORATORS] param tradingRecord:TradingRecord getTradeCount/0
[CALLS-EXTERNAL] TradingRecord.getTradeCount/0
*/
| /* static context
[FOCAL] @Override public double NumberOfTradesCriterion.calculate(TimeSeries series, TradingRecord tradingRecord)
[INPUTS] branches=- | result=tradingRecord | unused=series
[COLLABORATORS] param tradingRecord:TradingRecord getTradeCount/0
[CALLS-EXTERNAL] TradingRecord.getTradeCount/0
*/
class NumberO... | true | ok | {"focal": {"class": "NumberOfTradesCriterion", "name": "calculate", "signature": "double calculate(TimeSeries series, TradingRecord tradingRecord)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "series", "type": "TimeSeries"}, {"name": "tradingRecord", "type": "TradingRecord"}], "return_type": ... |
15374337_40 | class EngineConfiguration {
static protected List<String> getPropertyAsList(Properties props, String key) {
List<String> retVal = null;
String listProp = props.getProperty(key);
if (listProp != null) {
String[] valueArray = listProp.split(",\\s*");
retVal = Arrays.as... | System.out.println("getPropertyAsList");
Properties props = new Properties();
String key = "testProp";
props.setProperty(key, "alpha, beta, gamma");
List<String> expResult = Arrays.asList("alpha", "beta", "gamma");
List<String> result = EngineConfiguration.getPropertyAs... | [FOCAL] static protected List<String> EngineConfiguration.getPropertyAsList(Properties props, String key)
[CLASS] class EngineConfiguration
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] Properties.getProperty/1, String.split/1, Arrays.asList/1
[PATH1] if(listProp != null)=T -> re... | /* static context
[FOCAL] static protected List<String> EngineConfiguration.getPropertyAsList(Properties props, String key)
[PATH1] if(listProp != null)=T -> return retVal
[PATH2] if(listProp != null)=F -> return retVal
[INPUTS] branches=key, props | result=key, props
[COLLABORATORS] param props:Properties getProperty/... | /* static context
[FOCAL] static protected List<String> EngineConfiguration.getPropertyAsList(Properties props, String key)
[PATH1] if(listProp != null)=T -> return retVal
[PATH2] if(listProp != null)=F -> return retVal
[INPUTS] branches=key, props | result=key, props
[COLLABORATORS] param props:Properties getProperty/... | true | ok | {"focal": {"class": "EngineConfiguration", "name": "getPropertyAsList", "signature": "List<String> getPropertyAsList(Properties props, String key)", "start_line": 3, "modifiers": "static protected", "params": [{"name": "props", "type": "Properties"}, {"name": "key", "type": "String"}], "return_type": "List<String>"}, "... |
15403409_1 | class GCodeWord implements Comparable {
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof GCodeWord)) return false;
GCodeWord gCodeWord = (GCodeWord) o;
if (!word.equals(gCodeWord.word)) return false;
return true;
}
publi... | GCodeWord t1 = new GCodeWord("G4", null);
GCodeWord t2 = new GCodeWord("G4", null);
assertTrue("Same GCode must return equal", t1.equals(t2));
t1 = new GCodeWord("G4", 12.0);
t2 = new GCodeWord("G4", 13.0);
assertTrue("Same GCode must return equal", t1.equals(t2));
}... | [FOCAL] @Override public boolean GCodeWord.equals(Object o)
[CLASS] class GCodeWord implements Comparable
[METRICS] loc=8 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=1
[CALLS-EXTERNAL] word.equals/1
[PATH1] if(this == o)=F -> if(!(o instanceof GCodeWord))=F -> if(!word.equals(gCodeWord.word))=T -> return false
[... | /* static context
[FOCAL] @Override public boolean GCodeWord.equals(Object o)
[PATH1] if(this == o)=F -> if(!(o instanceof GCodeWord))=F -> if(!word.equals(gCodeWord.word))=T -> return false
[PATH2] if(this == o)=T -> return true
[PATH3] if(this == o)=F -> if(!(o instanceof GCodeWord))=T -> return false
[PATH4] if(this... | /* static context
[FOCAL] @Override public boolean GCodeWord.equals(Object o)
[PATH1] if(this == o)=F -> if(!(o instanceof GCodeWord))=F -> if(!word.equals(gCodeWord.word))=T -> return false
[PATH2] if(this == o)=T -> return true
[PATH3] if(this == o)=F -> if(!(o instanceof GCodeWord))=T -> return false
[PATH4] if(this... | true | ok | {"focal": {"class": "GCodeWord", "name": "equals", "signature": "boolean equals(Object o)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "o", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "GCodeWord", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "C... |
15416636_13 | class BarcodeExtractor {
public String extractFromPdf(String input) {
if (input != null && input.endsWith(".pdf")) {
Matcher m = p.matcher(input);
if (m.find())
return m.group();
}
return "";
}
public String extract(String input);
}
class B... | assertThat(instance.extractFromPdf(null), equalTo(""));
}
} | [FOCAL] public String BarcodeExtractor.extractFromPdf(String input)
[CLASS] class BarcodeExtractor
[METRICS] loc=8 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] String.endsWith/1, p.matcher/1, Matcher.find/0, Matcher.group/0
[PATH1] if(input != null && input.endsWith(".pdf"))=T -> if(m.find())=T... | /* static context
[FOCAL] public String BarcodeExtractor.extractFromPdf(String input)
[PATH1] if(input != null && input.endsWith(".pdf"))=T -> if(m.find())=T -> return m.group()
[PATH2] if(input != null && input.endsWith(".pdf"))=F -> return ""
[PATH3] if(input != null && input.endsWith(".pdf"))=T -> if(m.find())=F -> ... | /* static context
[FOCAL] public String BarcodeExtractor.extractFromPdf(String input)
[PATH1] if(input != null && input.endsWith(".pdf"))=T -> if(m.find())=T -> return m.group()
[PATH2] if(input != null && input.endsWith(".pdf"))=F -> return ""
[PATH3] if(input != null && input.endsWith(".pdf"))=T -> if(m.find())=F -> ... | true | ok | {"focal": {"class": "BarcodeExtractor", "name": "extractFromPdf", "signature": "String extractFromPdf(String input)", "start_line": 3, "modifiers": "public", "params": [{"name": "input", "type": "String"}], "return_type": "String"}, "class_info": {"name": "BarcodeExtractor", "kind": "class", "modifiers": "", "superclas... |
15472368_4 | class LogBuffer {
public Logs parallel() {
Collection<Dir> dirs = initalizeDirs();
Stream<Log> result = null;
for (Dir d : dirs) {
Stream<Log> stream = Guavas.toStream(new Dirs.LogIterator(d), true);
if (result == null) {
result = stream;
} else {
result = Stream.concat(... | Log[] written = LogUtil.writeList(logBuffer, 1, 5000).toArray(new Log[0]);
Log[] logs = logBuffer.parallel().stream()
.sorted().collect(Collectors.toList()).toArray(new Log[0]);
assertArrayEquals(logs, written);
}
} | [FOCAL] public Logs LogBuffer.parallel()
[CLASS] class LogBuffer
[METRICS] loc=16 cc=4 branches=2 loops=1 returns=2 throws=0 nesting=2
[CALLS-INTERNAL] Collection<Dir> initalizeDirs()
[CALLS-EXTERNAL] Guavas.toStream/2, Stream.concat/2, Stream.empty/0
[NEW] Dirs.LogIterator, Logs
[PATH1] foreach(Dir d : dirs)=T -> if(r... | /* static context
[FOCAL] public Logs LogBuffer.parallel()
[PATH1] foreach(Dir d : dirs)=T -> if(result == null)#1=T -> exit loop -> if(result == null)#2=T -> return new Logs(Stream.empty())
[PATH2] foreach(Dir d : dirs)=F -> if(result == null)#2=F -> return new Logs(result)
[PATH3] foreach(Dir d : dirs)=T -> if(result... | /* static context
[FOCAL] public Logs LogBuffer.parallel()
[PATH1] foreach(Dir d : dirs)=T -> if(result == null)#1=T -> exit loop -> if(result == null)#2=T -> return new Logs(Stream.empty())
[PATH2] foreach(Dir d : dirs)=F -> if(result == null)#2=F -> return new Logs(result)
[PATH3] foreach(Dir d : dirs)=T -> if(result... | true | ok | {"focal": {"class": "LogBuffer", "name": "parallel", "signature": "Logs parallel()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Logs"}, "class_info": {"name": "LogBuffer", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "logBuffer", "type": "LogBu... |
15475337_118 | class PatternGenerator {
@Nonnull
public static String acceptStrings(@Nonnull String[] input) {
StringBuilder builder = new StringBuilder();
builder.append("(");
for (int i = 0; i < input.length; i++) {
builder.append(Pattern.quote(input[i]));
if (i < input.len... | String[] input = new String[3];
input[0] = "foo";
input[1] = "bar";
input[2] = "baz";
String regex = PatternGenerator.acceptStrings(input);
Pattern pattern = Pattern.compile(regex);
assertTrue(pattern.matcher("foo").find());
assertTrue(pattern.matcher("b... | [FOCAL] @Nonnull public static String PatternGenerator.acceptStrings(String[] input)
[CLASS] class PatternGenerator
[METRICS] loc=17 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] StringBuilder.append/1, Pattern.quote/1, StringBuilder.toString/0
[NEW] StringBuilder
[PATH1] for(i < input.length)=T... | /* static context
[FOCAL] @Nonnull public static String PatternGenerator.acceptStrings(String[] input)
[PATH1] for(i < input.length)=T -> if(i < input.length - 1)=T -> exit loop -> return builder.toString()
[PATH2] for(i < input.length)=F -> return builder.toString()
[PATH3] for(i < input.length)=T -> if(i < input.leng... | /* static context
[FOCAL] @Nonnull public static String PatternGenerator.acceptStrings(String[] input)
[PATH1] for(i < input.length)=T -> if(i < input.length - 1)=T -> exit loop -> return builder.toString()
[PATH2] for(i < input.length)=F -> return builder.toString()
[PATH3] for(i < input.length)=T -> if(i < input.leng... | true | ok | {"focal": {"class": "PatternGenerator", "name": "acceptStrings", "signature": "String acceptStrings(String[] input)", "start_line": 3, "modifiers": "@Nonnull public static", "params": [{"name": "input", "type": "String[]"}], "return_type": "String"}, "class_info": {"name": "PatternGenerator", "kind": "class", "modifier... |
15491874_16 | class RxViewBinder {
public void bind() {
unbind();
compositeDisposable = new CompositeDisposable();
bindInternal(compositeDisposable);
}
public void unbind();
protected abstract void bindInternal(@NonNull final CompositeDisposable compositeDisposable);
private RxViewBinde... | binder.bind();
// The test subscriber changes with each bind.
TestObserver<String> firstTestObserver = testObserver;
testObserver = null;
binder.bind();
testSubject.onNext("testString");
assertNotNull(firstTestObserver);
assertNotNull(testObserver);
... | [FOCAL] public void RxViewBinder.bind()
[CLASS] class RxViewBinder
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void bindInternal(CompositeDisposable compositeDisposable); void unbind()
[NEW] CompositeDisposable
[DATAFLOW] compositeDisposable@L3->L4
[CLASS-MEMBERS] void unbind()... | /* static context
[FOCAL] public void RxViewBinder.bind()
[CALLS-INTERNAL] void bindInternal(CompositeDisposable compositeDisposable); void unbind()
[NEW] CompositeDisposable
*/
| /* static context
[FOCAL] public void RxViewBinder.bind()
[CALLS-INTERNAL] void bindInternal(CompositeDisposable compositeDisposable); void unbind()
[NEW] CompositeDisposable
*/
class RxViewBinder {
public void bind() {
unbind();
compositeDisposable = new CompositeDisposable();
bindInternal... | true | ok | {"focal": {"class": "RxViewBinder", "name": "bind", "signature": "void bind()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "RxViewBinder", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "binder", "type": "RxViewBind... |
15496005_2 | class Dhcp6Options implements Iterable<Dhcp6Option> {
public boolean contains(@Nonnull Class<? extends Dhcp6Option> type) {
return !options.get(Dhcp6OptionsRegistry.getInstance().getOptionTag(type)).isEmpty();
}
public boolean isEmpty();
@Override public Iterator<Dhcp6Option> iterator();
@... | Dhcp6Options options = new Dhcp6Options();
options.add(StatusCodeOption.create((short) 0));
assertTrue(options.contains(StatusCodeOption.class));
}
} | [FOCAL] public boolean Dhcp6Options.contains(Class<? extends Dhcp6Option> type)
[CLASS] class Dhcp6Options implements Iterable<Dhcp6Option>
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] options.get(Dhcp6OptionsRegistry.getInstance().getOptionT....isEmpty/0, options.get/1, Dhcp6Op... | /* static context
[FOCAL] public boolean Dhcp6Options.contains(Class<? extends Dhcp6Option> type)
[INPUTS] branches=- | result=type
[COLLABORATORS] field options get/1
[CALLS-EXTERNAL] options.get(Dhcp6OptionsRegistry.getInstance().getOptionT....isEmpty/0, options.get/1, Dhcp6OptionsRegistry.getInstance().getOptionTag/... | /* static context
[FOCAL] public boolean Dhcp6Options.contains(Class<? extends Dhcp6Option> type)
[INPUTS] branches=- | result=type
[COLLABORATORS] field options get/1
[CALLS-EXTERNAL] options.get(Dhcp6OptionsRegistry.getInstance().getOptionT....isEmpty/0, options.get/1, Dhcp6OptionsRegistry.getInstance().getOptionTag/... | true | ok | {"focal": {"class": "Dhcp6Options", "name": "contains", "signature": "boolean contains(Class<? extends Dhcp6Option> type)", "start_line": 3, "modifiers": "public", "params": [{"name": "type", "type": "Class<? extends Dhcp6Option>"}], "return_type": "boolean"}, "class_info": {"name": "Dhcp6Options", "kind": "class", "mo... |
15523927_4 | class ArchonStorage {
public void addARC(String arcPath) throws Exception {
log.info("Persisting new arc-file: " + arcPath);
String[] splitPath = splitPath(arcPath);
String folder = splitPath[0];
String arcId = splitPath[1];
boolean aRCIDExist = aRCIDExist(arcId);
... |
ArcVO arc = null;
try{
arc = storage.getArcByID(arcFile1);
fail();
}
catch (Exception e){
//Expected
}
storage.addARC(arcFile1);
arc = storage.getArcByID("arcfile1");
assertEquals(arcFile1, arc.getFileName());
... | [FOCAL] public void ArchonStorage.addARC(String arcPath)
[CLASS] class ArchonStorage
[METRICS] loc=36 cc=3 branches=1 loops=0 returns=0 throws=2 nesting=1
[CALLS-INTERNAL] String[] splitPath(String fullFilePath); boolean aRCIDExist(String arcID); void closeStatement(PreparedStatement stmt)
[CALLS-EXTERNAL] Logger.info/... | /* static context
[FOCAL] public void ArchonStorage.addARC(String arcPath)
[THROWS-WHEN] IllegalArgumentException when aRCIDExist
[THROWS-WHEN] e when !aRCIDExist && try-body throws
[PATH1] if(aRCIDExist)=F -> try-body throws -> throw e
[PATH2] if(aRCIDExist)=T -> throw new IllegalArgumentException("ArcID already exist... | /* static context
[FOCAL] public void ArchonStorage.addARC(String arcPath)
[THROWS-WHEN] IllegalArgumentException when aRCIDExist
[THROWS-WHEN] e when !aRCIDExist && try-body throws
[PATH1] if(aRCIDExist)=F -> try-body throws -> throw e
[PATH2] if(aRCIDExist)=T -> throw new IllegalArgumentException("ArcID already exist... | true | ok | {"focal": {"class": "ArchonStorage", "name": "addARC", "signature": "void addARC(String arcPath) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "arcPath", "type": "String"}], "return_type": "void"}, "class_info": {"name": "ArchonStorage", "kind": "class", "modifiers": "", "superclass": n... |
15554335_4 | class EventValidator {
public Validated validateEvent(VersionedEventsModel eventsModel, ObjectNode eventNode) {
final EventModel ingressEvent = EventModel.builder(eventNode, false).build();
Validated.ValidatedBuilder builder = Validated.build();
LOG.inc("validated_events");
if (even... |
Mockito.when(eventsProvider.getCurrentEventsVersion(tenantId))
.thenReturn(version, version);
Mockito.when(eventsProvider.getEvents(Mockito.any(EventsProcessorId.class)))
.thenReturn(Arrays.asList(event));
ObjectNode instance = mapper.createObjectNode();
... | [FOCAL] public Validated EventValidator.validateEvent(VersionedEventsModel eventsModel, ObjectNode eventNode)
[CLASS] class EventValidator
[METRICS] loc=44 cc=7 branches=5 loops=1 returns=1 throws=0 nesting=5
[CALLS-EXTERNAL] EventModel.builder(eventNode, false).build/0, EventModel.builder/2, Validated.build/0, LOG.inc... | /* static context
[FOCAL] public Validated EventValidator.validateEvent(VersionedEventsModel eventsModel, ObjectNode eventNode)
[PATH1] if(eventsModel == null || eventsModel.getEventsModel() == null)=F -> if(modelEvent == null)=F -> foreach(Map.Entry<String, ValueType> ingressField : ingressFields.entrySet())=T -> if(i... | /* static context
[FOCAL] public Validated EventValidator.validateEvent(VersionedEventsModel eventsModel, ObjectNode eventNode)
[PATH1] if(eventsModel == null || eventsModel.getEventsModel() == null)=F -> if(modelEvent == null)=F -> foreach(Map.Entry<String, ValueType> ingressField : ingressFields.entrySet())=T -> if(i... | true | ok | {"focal": {"class": "EventValidator", "name": "validateEvent", "signature": "Validated validateEvent(VersionedEventsModel eventsModel, ObjectNode eventNode)", "start_line": 3, "modifiers": "public", "params": [{"name": "eventsModel", "type": "VersionedEventsModel"}, {"name": "eventNode", "type": "ObjectNode"}], "return... |
15555290_0 | class ElasticSearchSearchIndex extends ElasticSearchSearchIndexBase {
public String createJsonForElement(Graph graph, Element element, Authorizations authorizations) {
try {
String indexName = getIndexName(element);
IndexInfo indexInfo = ensureIndexCreatedAndInitialized(indexName, g... | Metadata prop1Metadata = new Metadata();
prop1Metadata.add("metadata1", "metadata1Value", VISIBILITY_A);
String expectedLargeValue = IOUtils.toString(new LargeStringInputStream(LARGE_PROPERTY_VALUE_SIZE));
PropertyValue propSmall = new StreamingPropertyValue(new ByteArrayInputStream("va... | [FOCAL] public String ElasticSearchSearchIndex.createJsonForElement(Graph graph, Element element, Authorizations authorizations)
[CLASS] class ElasticSearchSearchIndex extends ElasticSearchSearchIndexBase
[METRICS] loc=9 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-INTERNAL] XContentBuilder buildJsonCont... | /* static context
[FOCAL] public String ElasticSearchSearchIndex.createJsonForElement(Graph graph, Element element, Authorizations authorizations)
[THROWS-WHEN] SecureGraphException when try-body throws
[PATH1] try-body throws -> throw new SecureGraphException("Could not create JSON for element", e)
[PATH2] return buil... | /* static context
[FOCAL] public String ElasticSearchSearchIndex.createJsonForElement(Graph graph, Element element, Authorizations authorizations)
[THROWS-WHEN] SecureGraphException when try-body throws
[PATH1] try-body throws -> throw new SecureGraphException("Could not create JSON for element", e)
[PATH2] return buil... | true | ok | {"focal": {"class": "ElasticSearchSearchIndex", "name": "createJsonForElement", "signature": "String createJsonForElement(Graph graph, Element element, Authorizations authorizations)", "start_line": 3, "modifiers": "public", "params": [{"name": "graph", "type": "Graph"}, {"name": "element", "type": "Element"}, {"name":... |
15590153_0 | class CSVToARFFHeaderMapTask implements OptionHandler, Serializable {
public Instances getHeader() {
return makeStructure();
}
public CSVToARFFHeaderMapTask();
public CSVToARFFHeaderMapTask(boolean suppressQuantileOptions);
public CSVToARFFHeaderMapTask(boolean suppressQuantileOptions,
boolean s... | // tests getting a header without any processing of incoming
// CSV data - i.e. all attributes are assumed to be numeric
CSVToARFFHeaderMapTask task = new CSVToARFFHeaderMapTask();
// task.setOptions(args);
Instances i = task.getHeader(10, null);
for (int j = 0; j < i.numAttributes(); j++) {
... | [FOCAL] public Instances CSVToARFFHeaderMapTask.getHeader()
[CLASS] class CSVToARFFHeaderMapTask implements OptionHandler, Serializable
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Instances makeStructure()
[CLASS-MEMBERS] CSVToARFFHeaderMapTask(); CSVToARFFHeaderMapTask(boolean... | /* static context
[FOCAL] public Instances CSVToARFFHeaderMapTask.getHeader()
[CALLS-INTERNAL] Instances makeStructure()
*/
| /* static context
[FOCAL] public Instances CSVToARFFHeaderMapTask.getHeader()
[CALLS-INTERNAL] Instances makeStructure()
*/
class CSVToARFFHeaderMapTask implements OptionHandler, Serializable {
public Instances getHeader() {
return makeStructure();
}
public CSVToARFFHeaderMapTask();
public CSVToARFFHea... | true | ok | {"focal": {"class": "CSVToARFFHeaderMapTask", "name": "getHeader", "signature": "Instances getHeader()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Instances"}, "class_info": {"name": "CSVToARFFHeaderMapTask", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "OptionHandler,... |
15590229_0 | class Utils {
static String toDebugString(final byte[] bytes, final int len, final Charset charset) {
if (charset == null) {
return toDebugString(new String(bytes, 0, len, Charset.defaultCharset()));
}
return toDebugString(new String(bytes, 0, len, charset));
}
private ... | assertEquals(toDebugString(null), "null");
assertEquals(toDebugString((Object) null), "null");
assertEquals(toDebugString("ABC"), "ABC");
final char[] chars = new char[1000];
Arrays.fill(chars, 'x');
final int length = toDebugString(String.valueOf(chars)).length();
... | [FOCAL] static String Utils.toDebugString(byte[] bytes, int len, Charset charset)
[CLASS] class Utils
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] String toDebugString(String string)
[CALLS-EXTERNAL] Charset.defaultCharset/0
[NEW] String
[PATH1] if(charset == null)=T -> return t... | /* static context
[FOCAL] static String Utils.toDebugString(byte[] bytes, int len, Charset charset)
[PATH1] if(charset == null)=T -> return toDebugString(new String(bytes, 0, len, Charset.defaultCharset()))
[PATH2] if(charset == null)=F -> return toDebugString(new String(bytes, 0, len, charset))
[INPUTS] branches=chars... | /* static context
[FOCAL] static String Utils.toDebugString(byte[] bytes, int len, Charset charset)
[PATH1] if(charset == null)=T -> return toDebugString(new String(bytes, 0, len, Charset.defaultCharset()))
[PATH2] if(charset == null)=F -> return toDebugString(new String(bytes, 0, len, charset))
[INPUTS] branches=chars... | true | ok | {"focal": {"class": "Utils", "name": "toDebugString", "signature": "String toDebugString(byte[] bytes, int len, Charset charset)", "start_line": 3, "modifiers": "static", "params": [{"name": "bytes", "type": "byte[]"}, {"name": "len", "type": "int"}, {"name": "charset", "type": "Charset"}], "return_type": "String"}, "c... |
15596189_0 | class CommandHelper {
public static String getRawCommand(String chatMessage) {
Preconditions.checkArgument(chatMessage.charAt(0) == '/',
"getRawCommand('%s') requires a command, starting with a slash, to be passed!",
chatMessage);
String result;
int spaceInd... | assertThat(CommandHelper.getRawCommand("/help"), is("help"));
assertThat(CommandHelper.getRawCommand("/help test"), is("help"));
assertThat(CommandHelper.getRawCommand("/minecraft:help"), is("minecraft:help"));
assertThat(CommandHelper.getRawCommand("/minecraft:help test"), is("minecraft... | [FOCAL] public static String CommandHelper.getRawCommand(String chatMessage)
[CLASS] class CommandHelper
[METRICS] loc=15 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] Preconditions.checkArgument/3, String.charAt/1, String.indexOf/1, String.substring/1, String.substring/2, String.toLowerCase/0
[... | /* static context
[FOCAL] public static String CommandHelper.getRawCommand(String chatMessage)
[PATH1] if(spaceIndex == -1)=T -> return result.toLowerCase()
[PATH2] if(spaceIndex == -1)=F -> return result.toLowerCase()
[INPUTS] branches=chatMessage | result=chatMessage
[CALLS-EXTERNAL] Preconditions.checkArgument/3, St... | /* static context
[FOCAL] public static String CommandHelper.getRawCommand(String chatMessage)
[PATH1] if(spaceIndex == -1)=T -> return result.toLowerCase()
[PATH2] if(spaceIndex == -1)=F -> return result.toLowerCase()
[INPUTS] branches=chatMessage | result=chatMessage
[CALLS-EXTERNAL] Preconditions.checkArgument/3, St... | true | ok | {"focal": {"class": "CommandHelper", "name": "getRawCommand", "signature": "String getRawCommand(String chatMessage)", "start_line": 3, "modifiers": "public static", "params": [{"name": "chatMessage", "type": "String"}], "return_type": "String"}, "class_info": {"name": "CommandHelper", "kind": "class", "modifiers": "",... |
15611804_5 | class FilePreferences implements Preferences, LifecycleCallback {
@Override
public <T> T get(String key, Class<T> clazz) {
return rootNode.get(key, clazz);
}
public FilePreferences(File preferencesFile);
@Override public void put(String key, Object value);
@Override public void merge... | FilePreferences filePreferences = getPreferencesFile("morePropertiesThanPojoPreferences.json");
FakePojo fakePojo = filePreferences.get(USELESS_POJO_KEY, FakePojo.class);
assertThat(FakePojo.getDumbInstance()).isEqualToComparingFieldByField(fakePojo);
OtherPojo otherPojo = filePrefere... | [FOCAL] @Override public T FilePreferences.get(String key, Class<T> clazz)
[CLASS] class FilePreferences implements Preferences, LifecycleCallback
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] rootNode.get/2
[INPUTS] branches=- | result=clazz, key
[COLLABORATORS] field rootNode g... | /* static context
[FOCAL] @Override public T FilePreferences.get(String key, Class<T> clazz)
[INPUTS] branches=- | result=clazz, key
[COLLABORATORS] field rootNode get/2
[CALLS-EXTERNAL] rootNode.get/2
*/
| /* static context
[FOCAL] @Override public T FilePreferences.get(String key, Class<T> clazz)
[INPUTS] branches=- | result=clazz, key
[COLLABORATORS] field rootNode get/2
[CALLS-EXTERNAL] rootNode.get/2
*/
class FilePreferences implements Preferences, LifecycleCallback {
@Override
public <T> T get(String key, C... | true | ok | {"focal": {"class": "FilePreferences", "name": "get", "signature": "T get(String key, Class<T> clazz)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "key", "type": "String"}, {"name": "clazz", "type": "Class<T>"}], "return_type": "T"}, "class_info": {"name": "FilePreferences", "kind": "class", ... |
15684181_47 | class ObjectHolder {
public ObjectHolder() {
}
public ObjectHolder();
public ObjectHolder(final T value);
public T getValue();
public void setValue(final T value);
}
class ObjectHolderTest {
@Test
public void testObjectHolder() {
| final ObjectHolder<Integer> it = new ObjectHolder<>();
assertNull(it.getValue());
}
} | [FOCAL] public ObjectHolder.ObjectHolder()
[CLASS] class ObjectHolder
[METRICS] loc=2 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CLASS-MEMBERS] ObjectHolder(); ObjectHolder(T value); T getValue(); void setValue(T value)
[TEST] ObjectHolderTest: @Test public void testObjectHolder() | /* static context
[FOCAL] public ObjectHolder.ObjectHolder()
*/
| /* static context
[FOCAL] public ObjectHolder.ObjectHolder()
*/
class ObjectHolder {
public ObjectHolder() {
}
public ObjectHolder();
public ObjectHolder(final T value);
public T getValue();
public void setValue(final T value);
}
class ObjectHolderTest {
@Test
public void testObj... | true | ok | {"focal": {"class": "ObjectHolder", "name": "ObjectHolder", "signature": "ObjectHolder()", "start_line": 3, "modifiers": "public", "params": [], "return_type": null}, "class_info": {"name": "ObjectHolder", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Obje... |
15693035_46 | class Main {
static Matcher validateZkUrl(final String zkUrl) {
final Matcher matcher = zkURLPattern.matcher(zkUrl);
if (!matcher.matches()) {
throw new SystemExitException(String.format("Invalid zk url format: '%s' expected '%s'", zkUrl, validZkUrl), 7);
}
return match... | final Matcher m = validateZkUrl("zk://host:2181/cassandra-mesos/ring1");
assertThat(m.group(1)).isEqualTo("host:2181");
assertThat(m.group(2)).isEqualTo("/cassandra-mesos/ring1");
}
} | [FOCAL] static Matcher Main.validateZkUrl(String zkUrl)
[CLASS] class Main
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] zkURLPattern.matcher/1, Matcher.matches/0, String.format/3
[NEW] SystemExitException
[EXCEPTIONS] throws SystemExitException
[THROWS-WHEN] SystemExitException ... | /* static context
[FOCAL] static Matcher Main.validateZkUrl(String zkUrl)
[THROWS-WHEN] SystemExitException when !matcher.matches()
[PATH1] if(!matcher.matches())=T -> throw new SystemExitException(String.format("Invalid zk url format: '%s' ...
[PATH2] if(!matcher.matches())=F -> return matcher
[INPUTS] branches=zkUrl ... | /* static context
[FOCAL] static Matcher Main.validateZkUrl(String zkUrl)
[THROWS-WHEN] SystemExitException when !matcher.matches()
[PATH1] if(!matcher.matches())=T -> throw new SystemExitException(String.format("Invalid zk url format: '%s' ...
[PATH2] if(!matcher.matches())=F -> return matcher
[INPUTS] branches=zkUrl ... | true | ok | {"focal": {"class": "Main", "name": "validateZkUrl", "signature": "Matcher validateZkUrl(String zkUrl)", "start_line": 3, "modifiers": "static", "params": [{"name": "zkUrl", "type": "String"}], "return_type": "Matcher"}, "class_info": {"name": "Main", "kind": "class", "modifiers": "", "superclass": null, "interfaces": ... |
15698466_508 | class ProxyForURI implements Function<URI, Proxy> {
@Override
public Proxy apply(URI endpoint) {
if (!useProxyForSockets && "socket".equals(endpoint.getScheme())) {
return Proxy.NO_PROXY;
}
if (config.getProxy().isPresent()) {
SocketAddress addr = new InetSocketAddress(config.... | ProxyConfig config = new MyProxyConfig(false, false, Proxy.Type.DIRECT, noHostAndPort, noCreds);
URI uri = new URI("socket://ssh.example.com:22");
assertEquals(new ProxyForURI(config).apply(uri), Proxy.NO_PROXY);
}
} | [FOCAL] @Override public Proxy ProxyForURI.apply(URI endpoint)
[CLASS] class ProxyForURI implements Function<URI, Proxy>
[METRICS] loc=32 cc=6 branches=5 loops=0 returns=5 throws=0 nesting=2
[CALLS-INTERNAL] Proxy getDefaultProxy(URI endpoint)
[CALLS-EXTERNAL] "socket".equals/1, URI.getScheme/0, config.getProxy().isPre... | /* static context
[FOCAL] @Override public Proxy ProxyForURI.apply(URI endpoint)
[PATH1] if(!useProxyForSockets && "socket".equals(endpoint.getScheme()))=F -> if(config.getProxy().isPresent())=F -> if(config.isJvmProxyEnabled())=F -> if(config.useSystem())=T -> return getDefaultProxy(endpoint)
[PATH2] if(!useProxyForSo... | /* static context
[FOCAL] @Override public Proxy ProxyForURI.apply(URI endpoint)
[PATH1] if(!useProxyForSockets && "socket".equals(endpoint.getScheme()))=F -> if(config.getProxy().isPresent())=F -> if(config.isJvmProxyEnabled())=F -> if(config.useSystem())=T -> return getDefaultProxy(endpoint)
[PATH2] if(!useProxyForSo... | true | ok | {"focal": {"class": "ProxyForURI", "name": "apply", "signature": "Proxy apply(URI endpoint)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "endpoint", "type": "URI"}], "return_type": "Proxy"}, "class_info": {"name": "ProxyForURI", "kind": "class", "modifiers": "", "superclass": null, "interface... |
15717111_2 | class DiscoveryClient {
public Map<String, MetaData> findInstances() {
Map<String, MetaData> instances = new TreeMap<String, MetaData>();
init();
try {
for (String path : filters) {
logger.debug("checking entries with path filter: " + path);
//... | DiscoveryClient client = new TestableDiscoveryClient(null, basePath, "/b/bb");
instances = client.findInstances();
Assert.assertEquals(2, instances.size());
Assert.assertTrue(instances.containsKey(basePath + "/" + "b/bb/bbb"));
}
} | [FOCAL] public Map<String, MetaData> DiscoveryClient.findInstances()
[CLASS] class DiscoveryClient
[METRICS] loc=27 cc=4 branches=1 loops=1 returns=1 throws=1 nesting=3
[CALLS-INTERNAL] void init(); void processPath(Map<String, MetaData> instances, String currentRoot, String[] segments)
[CALLS-EXTERNAL] logger.debug/1,... | /* static context
[FOCAL] public Map<String, MetaData> DiscoveryClient.findInstances()
[THROWS-WHEN] Throwables.propagate(e) when try-body throws
[PATH1] foreach(String path : filters)=T -> if(segments.length > 0 && "".equalsIgnoreCase(segments[0]))=T -> exit loop -> return instances
[PATH2] try-body throws -> throw Th... | /* static context
[FOCAL] public Map<String, MetaData> DiscoveryClient.findInstances()
[THROWS-WHEN] Throwables.propagate(e) when try-body throws
[PATH1] foreach(String path : filters)=T -> if(segments.length > 0 && "".equalsIgnoreCase(segments[0]))=T -> exit loop -> return instances
[PATH2] try-body throws -> throw Th... | true | ok | {"focal": {"class": "DiscoveryClient", "name": "findInstances", "signature": "Map<String, MetaData> findInstances()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Map<String, MetaData>"}, "class_info": {"name": "DiscoveryClient", "kind": "class", "modifiers": "", "superclass": null, "interfaces... |
15722026_3 | class PaginationParams {
@SuppressWarnings("checkstyle:MultipleStringLiterals")
public static PaginationParams previousPage(@NonNull PagedResponse.Pagination pagination) throws IllegalArgumentException {
if (pagination.getPreviousUri() == null) {
return null;
}
try {
... | // Given
PagedResponse.Pagination pagination = new PagedResponse.Pagination();
pagination.setPreviousUri("/path");
// When
PaginationParams.previousPage(pagination);
// Then
Assertions.fail("Should throw an " + IllegalArgumentException.class);
}
} | [FOCAL] @SuppressWarnings("checkstyle:MultipleStringLiterals") public static PaginationParams PaginationParams.previousPage(PagedResponse.Pagination pagination)
[CLASS] class PaginationParams
[METRICS] loc=12 cc=3 branches=1 loops=0 returns=2 throws=1 nesting=1
[CALLS-INTERNAL] PaginationParams copyLimitAndOrder(Pagina... | /* static context
[FOCAL] @SuppressWarnings("checkstyle:MultipleStringLiterals") public static PaginationParams PaginationParams.previousPage(PagedResponse.Pagination pagination)
[THROWS-WHEN] IllegalArgumentException when !(pagination.getPreviousUri() == null) && try-body throws
[PATH1] if(pagination.getPreviousUri() ... | /* static context
[FOCAL] @SuppressWarnings("checkstyle:MultipleStringLiterals") public static PaginationParams PaginationParams.previousPage(PagedResponse.Pagination pagination)
[THROWS-WHEN] IllegalArgumentException when !(pagination.getPreviousUri() == null) && try-body throws
[PATH1] if(pagination.getPreviousUri() ... | true | ok | {"focal": {"class": "PaginationParams", "name": "previousPage", "signature": "PaginationParams previousPage(PagedResponse.Pagination pagination) throws IllegalArgumentException", "start_line": 3, "modifiers": "@SuppressWarnings(\"checkstyle:MultipleStringLiterals\") public static", "params": [{"name": "pagination", "ty... |
15728671_30 | class BitDatum extends Datum {
@Override
public int size() {
return size;
}
public BitDatum(byte val);
public BitDatum(byte[] bytes);
@Override public char asChar();
@Override public int asInt4();
@Override public long asInt8();
@Override public byte asByte();
@Override public byte[] asByte... | Datum d = DatumFactory.createBit((byte) 1);
assertEquals(1, d.size());
}
} | [FOCAL] @Override public int BitDatum.size()
[CLASS] class BitDatum extends Datum
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] BitDatum(byte val); BitDatum(byte[] bytes); char asChar(); int asInt4(); long asInt8(); byte asByte(); byte[] asByteArray(); float asFloat4(); double asF... | /* static context
[FOCAL] @Override public int BitDatum.size()
*/
| /* static context
[FOCAL] @Override public int BitDatum.size()
*/
class BitDatum extends Datum {
@Override
public int size() {
return size;
}
public BitDatum(byte val);
public BitDatum(byte[] bytes);
@Override public char asChar();
@Override public int asInt4();
@Override public long asInt8();
... | true | ok | {"focal": {"class": "BitDatum", "name": "size", "signature": "int size()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "BitDatum", "kind": "class", "modifiers": "", "superclass": "Datum", "interfaces": null, "fields": [], "members": [{"name": "BitDatum",... |
15729898_5 | class OutboundApi {
@GET
@Path("/outbound")
@Produces("application/json")
/**
* retrieve the news posted by an individual participant
* fetch a participant news
* @param id uniquely identifies the participant (required)
* @return List<Outbound>
*/
public List<Outbound> getOutbound(@PathPar... | assertTrue("Fetch outbound feed did not return expected results.", api.getOutbound(TEST_FROM).equals(outFeed));
}
} | [FOCAL] @GET @Path("/outbound") @Produces("application/json") /** * retrieve the news posted by an individual participant * f... List<Outbound> OutboundApi.getOutbound(LongParam id)
[CLASS] class OutboundApi
[METRICS] loc=12 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] outboundService.getOutbou... | /* static context
[FOCAL] @GET @Path("/outbound") @Produces("application/json") /** * retrieve the news posted by an individual participant * f... List<Outbound> OutboundApi.getOutbound(LongParam id)
[INPUTS] branches=- | result=id
[COLLABORATORS] field outboundService getOutbound/1; param id:LongParam get/0
[CALLS-EXT... | /* static context
[FOCAL] @GET @Path("/outbound") @Produces("application/json") /** * retrieve the news posted by an individual participant * f... List<Outbound> OutboundApi.getOutbound(LongParam id)
[INPUTS] branches=- | result=id
[COLLABORATORS] field outboundService getOutbound/1; param id:LongParam get/0
[CALLS-EXT... | true | ok | {"focal": {"class": "OutboundApi", "name": "getOutbound", "signature": "List<Outbound> getOutbound(LongParam id)", "start_line": 3, "modifiers": "@GET @Path(\"/outbound\") @Produces(\"application/json\") /** * retrieve the news posted by an individual participant * f...", "params": [{"name": "id", "type": "LongParam"}]... |
15751803_10 | class CautiousStrategy extends Strategy {
@Override
public Move nextMove(int availableMana, int currentHealth, List<Card> availableCards) {
if (currentHealth < 20) {
return new Move(lowestCard(availableMana, availableCards), Action.HEALING);
} else {
return new Move(high... | assertThat(strategy.nextMove(withMana(10), andHealth(1), fromCards(1, 2, 3, 8, 9)), is(move(card(1), HEALING)));
assertThat(strategy.nextMove(withMana(9), andHealth(2), fromCards(2, 3, 8, 9)), is(move(card(2), HEALING)));
assertThat(strategy.nextMove(withMana(7), andHealth(4), fromCards(3, 8, 9)... | [FOCAL] @Override public Move CautiousStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)
[CLASS] class CautiousStrategy extends Strategy
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] lowestCard/2 (inherited), highestCard/2 (inherited)
[NEW] Move
[P... | /* static context
[FOCAL] @Override public Move CautiousStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)
[PATH1] if(currentHealth < 20)=T -> return new Move(lowestCard(availableMana, availableCards), Action.HEALING)
[PATH2] if(currentHealth < 20)=F -> return new Move(highestCard(availa... | /* static context
[FOCAL] @Override public Move CautiousStrategy.nextMove(int availableMana, int currentHealth, List<Card> availableCards)
[PATH1] if(currentHealth < 20)=T -> return new Move(lowestCard(availableMana, availableCards), Action.HEALING)
[PATH2] if(currentHealth < 20)=F -> return new Move(highestCard(availa... | true | ok | {"focal": {"class": "CautiousStrategy", "name": "nextMove", "signature": "Move nextMove(int availableMana, int currentHealth, List<Card> availableCards)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "availableMana", "type": "int"}, {"name": "currentHealth", "type": "int"}, {"name": "availableC... |
15779685_47 | class Skeleton {
public static SkeletonOutput skeleton(List<Point2d> polygon) {
return skeleton(polygon, null);
}
public static VisualDebugger initVisualDebugger();
public static SkeletonOutput skeleton(List<Point2d> polygon, List<List<Point2d>> holes);
public static SkeletonOutput skeleto... |
vd.clear();
List<Point2d> polygon = new ArrayList<Point2d>();
polygon.add(new Point2d(50, 50));
polygon.add(new Point2d(150, 50));
polygon.add(new Point2d(150, 100));
polygon.add(new Point2d(50, 100));
List<Point2d> expected = new ArrayList<Point2d>();
... | [FOCAL] public static SkeletonOutput Skeleton.skeleton(List<Point2d> polygon)
[CLASS] class Skeleton
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] SkeletonOutput skeleton(List<Point2d> polygon, List<List<Point2d>> holes)
[INPUTS] branches=- | result=polygon
[DATAFLOW] polygon@par... | /* static context
[FOCAL] public static SkeletonOutput Skeleton.skeleton(List<Point2d> polygon)
[INPUTS] branches=- | result=polygon
[CALLS-INTERNAL] SkeletonOutput skeleton(List<Point2d> polygon, List<List<Point2d>> holes)
*/
| /* static context
[FOCAL] public static SkeletonOutput Skeleton.skeleton(List<Point2d> polygon)
[INPUTS] branches=- | result=polygon
[CALLS-INTERNAL] SkeletonOutput skeleton(List<Point2d> polygon, List<List<Point2d>> holes)
*/
class Skeleton {
public static SkeletonOutput skeleton(List<Point2d> polygon) {
... | true | ok | {"focal": {"class": "Skeleton", "name": "skeleton", "signature": "SkeletonOutput skeleton(List<Point2d> polygon)", "start_line": 3, "modifiers": "public static", "params": [{"name": "polygon", "type": "List<Point2d>"}], "return_type": "SkeletonOutput"}, "class_info": {"name": "Skeleton", "kind": "class", "modifiers": "... |
15784931_0 | class ExtraBinderGenerator extends BaseGenerator {
String emitHumanDescription(List<Binding> bindings) {
StringBuilder builder = new StringBuilder();
switch (bindings.size()) {
case 1:
builder.append(bindings.get(0).getDescription());
break;
case 2:
builder
.ap... | Binding one = new TestBinding("one");
Binding two = new TestBinding("two");
Binding three = new TestBinding("three");
String actual1 = extraBinderGenerator.emitHumanDescription(asList(one));
assertThat(actual1).isEqualTo("one");
String actual2 = extraBinderGenerator.emitHumanDescription(asList... | [FOCAL] String ExtraBinderGenerator.emitHumanDescription(List<Binding> bindings)
[CLASS] class ExtraBinderGenerator extends BaseGenerator
[METRICS] loc=27 cc=6 branches=3 loops=1 returns=1 throws=0 nesting=3
[CALLS-EXTERNAL] List<Binding>.size/0, StringBuilder.append/1, bindings.get(0).getDescription/0, List<Binding>.g... | /* static context
[FOCAL] String ExtraBinderGenerator.emitHumanDescription(List<Binding> bindings)
[PATH1] switch(bindings.size())=default -> for(i < count)=T -> if(i != 0)=T -> if(i == count - 1)=T -> exit loop -> return builder.toString()
[PATH2] switch(bindings.size())=default -> for(i < count)=T -> if(i != 0)=F -> ... | /* static context
[FOCAL] String ExtraBinderGenerator.emitHumanDescription(List<Binding> bindings)
[PATH1] switch(bindings.size())=default -> for(i < count)=T -> if(i != 0)=T -> if(i == count - 1)=T -> exit loop -> return builder.toString()
[PATH2] switch(bindings.size())=default -> for(i < count)=T -> if(i != 0)=F -> ... | true | ok | {"focal": {"class": "ExtraBinderGenerator", "name": "emitHumanDescription", "signature": "String emitHumanDescription(List<Binding> bindings)", "start_line": 3, "modifiers": "", "params": [{"name": "bindings", "type": "List<Binding>"}], "return_type": "String"}, "class_info": {"name": "ExtraBinderGenerator", "kind": "c... |
15800167_1 | class Utils {
public static Attributes mergeAndNormalize(Attributes... attrsList) {
SpecificCharacterSet globalCs = null;
for (Attributes attrs : attrsList) {
SpecificCharacterSet cs = attrs.getSpecificCharacterSet();
if (globalCs == null) {
globalCs = cs... |
Attributes patientAttrs = new Attributes();
patientAttrs.setString(Tag.PatientID, VR.LO, "patID");
patientAttrs.setString(Tag.IssuerOfPatientID, VR.LO, "issuer");
Attributes otherids = new Attributes();
otherids.setString(Tag.PatientID, VR.LO, "otherID");
patientAttrs.ne... | [FOCAL] public static Attributes Utils.mergeAndNormalize(Attributes... attrsList)
[CLASS] class Utils
[METRICS] loc=47 cc=9 branches=6 loops=2 returns=1 throws=0 nesting=7
[CALLS-INTERNAL] void convertToUTF8(Attributes... attrsList)
[CALLS-EXTERNAL] Attributes.getSpecificCharacterSet/0, SpecificCharacterSet.equals/1, S... | /* static context
[FOCAL] public static Attributes Utils.mergeAndNormalize(Attributes... attrsList)
[PATH1] foreach(Attributes attrs : attrsList)#1=T -> if(globalCs == null)=F -> if(!cs.equals(globalCs))=T -> if(!(globalCs.containsASCII() && cs.isASCII()))=T -> if(globalCs.isUTF8())=F -> if(cs.isUTF8())=F -> if(globalC... | /* static context
[FOCAL] public static Attributes Utils.mergeAndNormalize(Attributes... attrsList)
[PATH1] foreach(Attributes attrs : attrsList)#1=T -> if(globalCs == null)=F -> if(!cs.equals(globalCs))=T -> if(!(globalCs.containsASCII() && cs.isASCII()))=T -> if(globalCs.isUTF8())=F -> if(cs.isUTF8())=F -> if(globalC... | true | ok | {"focal": {"class": "Utils", "name": "mergeAndNormalize", "signature": "Attributes mergeAndNormalize(Attributes... attrsList)", "start_line": 3, "modifiers": "public static", "params": [{"name": "attrsList", "type": "Attributes..."}], "return_type": "Attributes"}, "class_info": {"name": "Utils", "kind": "class", "modif... |
15801589_0 | class HttpServiceFactoryImpl implements ServiceFactory {
public Object getService( final Bundle bundle, final ServiceRegistration serviceRegistration )
{
LOG.info( "Binding bundle: [" + bundle + "] to http service" );
return createService( bundle );
}
public void ungetService( final Bu... | // prepare
replay( m_bundle, m_serviceRegistration, m_httpService );
// execute
Object result = m_underTest.getService( m_bundle, m_serviceRegistration );
assertNotNull( "expect not null", result );
// verify
verify( m_bundle, m_serviceRegistration, m_httpService ... | [FOCAL] public Object HttpServiceFactoryImpl.getService(Bundle bundle, ServiceRegistration serviceRegistration)
[CLASS] class HttpServiceFactoryImpl implements ServiceFactory
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] HttpService createService(Bundle bundle)
[CALLS-EXTERNAL] L... | /* static context
[FOCAL] public Object HttpServiceFactoryImpl.getService(Bundle bundle, ServiceRegistration serviceRegistration)
[INPUTS] branches=- | result=bundle | unused=serviceRegistration
[CALLS-INTERNAL] HttpService createService(Bundle bundle)
[CALLS-EXTERNAL] LOG.info/1
*/
| /* static context
[FOCAL] public Object HttpServiceFactoryImpl.getService(Bundle bundle, ServiceRegistration serviceRegistration)
[INPUTS] branches=- | result=bundle | unused=serviceRegistration
[CALLS-INTERNAL] HttpService createService(Bundle bundle)
[CALLS-EXTERNAL] LOG.info/1
*/
class HttpServiceFactoryImpl impleme... | true | ok | {"focal": {"class": "HttpServiceFactoryImpl", "name": "getService", "signature": "Object getService(Bundle bundle, ServiceRegistration serviceRegistration)", "start_line": 3, "modifiers": "public", "params": [{"name": "bundle", "type": "Bundle"}, {"name": "serviceRegistration", "type": "ServiceRegistration"}], "return_... |
15801780_4 | class RollbackCommand extends RollbackListCommand implements CommandSuccessIndicator {
void setRollbackCommandConf(RollbackCommandConf rollbackCommandConf) {
this.rollbackCommandConf = rollbackCommandConf;
}
public RollbackCommand(EnvSettings envSettings);
@SuppressWarnings("unchecked") prot... | command.setRollbackCommandConf(new RollbackCommandConf(RollbackCommandConf.Action.STOP_ON, "010.patch1"));
command.execute();
Assert.assertArrayEquals(new Integer[]{ }, dbValues());
}
} | [FOCAL] void RollbackCommand.setRollbackCommandConf(RollbackCommandConf rollbackCommandConf)
[CLASS] class RollbackCommand extends RollbackListCommand implements CommandSuccessIndicator
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[FIELDS] write=rollbackCommandConf
[STATE] rollbackCommandConf
[D... | /* static context
[FOCAL] void RollbackCommand.setRollbackCommandConf(RollbackCommandConf rollbackCommandConf)
[STATE] rollbackCommandConf
[FIELDS] write=rollbackCommandConf
*/
| /* static context
[FOCAL] void RollbackCommand.setRollbackCommandConf(RollbackCommandConf rollbackCommandConf)
[STATE] rollbackCommandConf
[FIELDS] write=rollbackCommandConf
*/
class RollbackCommand extends RollbackListCommand implements CommandSuccessIndicator {
void setRollbackCommandConf(RollbackCommandConf rol... | true | ok | {"focal": {"class": "RollbackCommand", "name": "setRollbackCommandConf", "signature": "void setRollbackCommandConf(RollbackCommandConf rollbackCommandConf)", "start_line": 3, "modifiers": "", "params": [{"name": "rollbackCommandConf", "type": "RollbackCommandConf"}], "return_type": "void"}, "class_info": {"name": "Roll... |
15802014_105 | class APNS {
public static ApnsServiceBuilder newService() {
return new ApnsServiceBuilder();
}
private APNS();
public static PayloadBuilder newPayload();
}
class APNSTest {
@Test
public void newServiceGetNewInstances() {
| assertNotSame(APNS.newService(), APNS.newService());
}
} | [FOCAL] public static ApnsServiceBuilder APNS.newService()
[CLASS] class APNS
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] ApnsServiceBuilder
[CLASS-MEMBERS] APNS(); PayloadBuilder newPayload()
[TEST] APNSTest: @Test public void newServiceGetNewInstances() | /* static context
[FOCAL] public static ApnsServiceBuilder APNS.newService()
[NEW] ApnsServiceBuilder
*/
| /* static context
[FOCAL] public static ApnsServiceBuilder APNS.newService()
[NEW] ApnsServiceBuilder
*/
class APNS {
public static ApnsServiceBuilder newService() {
return new ApnsServiceBuilder();
}
private APNS();
public static PayloadBuilder newPayload();
}
class APNSTest {
@Test
... | true | ok | {"focal": {"class": "APNS", "name": "newService", "signature": "ApnsServiceBuilder newService()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "ApnsServiceBuilder"}, "class_info": {"name": "APNS", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "mem... |
15830023_4 | class TimeSum {
public void reset() {
hours = 0;
minutes = 0;
}
public void set(int hours, int minutes);
public void add(int hoursToAdd, int minutesToAdd);
public void substract(int hoursToSubstract, int minutesToSubstract);
public void addOrSubstract(TimeSum timeSum);
private void balance();
@Override pu... | set(-1, 0);
underTest.reset();
assertTime("0:00");
}
} | [FOCAL] public void TimeSum.reset()
[CLASS] class TimeSum
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CLASS-MEMBERS] void set(int hours, int minutes); void add(int hoursToAdd, int minutesToAdd); void substract(int hoursToSubstract, int minutesToSubstract); void addOrSubstract(TimeSum timeSum);... | /* static context
[FOCAL] public void TimeSum.reset()
*/
| /* static context
[FOCAL] public void TimeSum.reset()
*/
class TimeSum {
public void reset() {
hours = 0;
minutes = 0;
}
public void set(int hours, int minutes);
public void add(int hoursToAdd, int minutesToAdd);
public void substract(int hoursToSubstract, int minutesToSubstract);
public void addOrSubstract... | true | ok | {"focal": {"class": "TimeSum", "name": "reset", "signature": "void reset()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "TimeSum", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "underTest", "type": "TimeSum", "modi... |
15831475_79 | class Synset extends PointerTarget implements DictionaryElement {
public List<Pointer> getPointers() {
return pointers;
}
public Synset(Dictionary dictionary, POS pos);
public Synset(Dictionary dictionary, POS pos, long offset);
public DictionaryElementType getType();
public Object ... | Synset hyponym = new Synset(dictionary, POS.NOUN, 100);
Pointer hyponymPtr = new Pointer(PointerType.HYPONYM, testObj, hyponym);
testObj.getPointers().add(0, hyponymPtr);
ListIterator<Pointer> i = testObj.getPointers().listIterator();
Assert.assertTrue(i.hasNext());
Asser... | [FOCAL] public List<Pointer> Synset.getPointers()
[CLASS] class Synset extends PointerTarget implements DictionaryElement
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] Synset(Dictionary dictionary, POS pos); Synset(Dictionary dictionary, POS pos, long offset); DictionaryElementTyp... | /* static context
[FOCAL] public List<Pointer> Synset.getPointers()
*/
| /* static context
[FOCAL] public List<Pointer> Synset.getPointers()
*/
class Synset extends PointerTarget implements DictionaryElement {
public List<Pointer> getPointers() {
return pointers;
}
public Synset(Dictionary dictionary, POS pos);
public Synset(Dictionary dictionary, POS pos, long o... | true | ok | {"focal": {"class": "Synset", "name": "getPointers", "signature": "List<Pointer> getPointers()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<Pointer>"}, "class_info": {"name": "Synset", "kind": "class", "modifiers": "", "superclass": "PointerTarget", "interfaces": "DictionaryElement", "fi... |
15841047_19 | class WorkflowKernel {
public ItemCollection process(final ItemCollection workitem) throws PluginException, ModelException {
// check document context
if (workitem == null)
throw new ProcessingErrorException(WorkflowKernel.class.getSimpleName(), UNDEFINED_WORKITEM,
... | ItemCollection itemCollectionProcessed = null;
ItemCollection itemCollection = new ItemCollection();
itemCollection.replaceItemValue("txtTitel", "Hello");
itemCollection.setTaskID(100);
itemCollection.setEventID(10);
itemCollection.replaceItemValue("$modelversion", MokMod... | [FOCAL] public ItemCollection WorkflowKernel.process(ItemCollection workitem)
[CLASS] class WorkflowKernel
[METRICS] loc=53 cc=7 branches=5 loops=1 returns=1 throws=3 nesting=1
[CALLS-INTERNAL] ItemCollection loadEvent(ItemCollection documentContext); ItemCollection processEvent(ItemCollection documentContext, ItemColl... | /* static context
[FOCAL] public ItemCollection WorkflowKernel.process(ItemCollection workitem)
[THROWS-WHEN] ProcessingErrorException when workitem == null
[THROWS-WHEN] ProcessingErrorException when !(workitem == null) && workitem.getTaskID() <= 0
[THROWS-WHEN] ProcessingErrorException when !(workitem == null) && !(w... | /* static context
[FOCAL] public ItemCollection WorkflowKernel.process(ItemCollection workitem)
[THROWS-WHEN] ProcessingErrorException when workitem == null
[THROWS-WHEN] ProcessingErrorException when !(workitem == null) && workitem.getTaskID() <= 0
[THROWS-WHEN] ProcessingErrorException when !(workitem == null) && !(w... | true | ok | {"focal": {"class": "WorkflowKernel", "name": "process", "signature": "ItemCollection process(ItemCollection workitem) throws PluginException, ModelException", "start_line": 3, "modifiers": "public", "params": [{"name": "workitem", "type": "ItemCollection"}], "return_type": "ItemCollection"}, "class_info": {"name": "Wo... |
15841325_4 | class DisplayHelperBase implements DisplayHelper {
protected final Context getContext() {
return mContext;
}
public DisplayHelperBase(final Context context);
protected final Display getDefaultDisplay();
@SuppressWarnings("deprecation") @Override public int getDisplayAngle();
@SuppressWarnings("deprecation")... | assertNotNull(new DisplayHelperBase(Robolectric.application).getContext());
}
} | [FOCAL] protected final Context DisplayHelperBase.getContext()
[CLASS] class DisplayHelperBase implements DisplayHelper
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] DisplayHelperBase(Context context); Display getDefaultDisplay(); int getDisplayAngle(); Point getDisplaySize(); Poi... | /* static context
[FOCAL] protected final Context DisplayHelperBase.getContext()
*/
| /* static context
[FOCAL] protected final Context DisplayHelperBase.getContext()
*/
class DisplayHelperBase implements DisplayHelper {
protected final Context getContext() {
return mContext;
}
public DisplayHelperBase(final Context context);
protected final Display getDefaultDisplay();
@SuppressWarnings("dep... | true | ok | {"focal": {"class": "DisplayHelperBase", "name": "getContext", "signature": "Context getContext()", "start_line": 3, "modifiers": "protected final", "params": [], "return_type": "Context"}, "class_info": {"name": "DisplayHelperBase", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "DisplayHelper", "... |
15845284_1 | class ChooseGroupActivity extends ListActivity {
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
Group g = (Group) getListView().getAdapter().getItem(position);
if (!g.isSectionHeader()) {
DataSource.getInstance().storeGroup(g);
In... | // create a Group that is a section header
Group g = new Group("groupName");
g.setSectionHeader(true);
g.setId(0);
// set adapter
GroupListAdapter groupListAdapter = new GroupListAdapter(mActivity, new Group[] { g });
mActivity.getListView().setAdapter(groupListA... | [FOCAL] @Override protected void ChooseGroupActivity.onListItemClick(ListView l, View v, int position, long id)
[CLASS] class ChooseGroupActivity extends ListActivity
[METRICS] loc=13 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] getListView().getAdapter().getItem/1, getListView().getAdapter/0, ... | /* static context
[FOCAL] @Override protected void ChooseGroupActivity.onListItemClick(ListView l, View v, int position, long id)
[PATH1] if(!g.isSectionHeader())=T
[PATH2] if(!g.isSectionHeader())=F
[INPUTS] branches=position | result=- | unused=l, v, id
[NEW] Intent
[CALLS-EXTERNAL] getListView().getAdapter().getItem... | /* static context
[FOCAL] @Override protected void ChooseGroupActivity.onListItemClick(ListView l, View v, int position, long id)
[PATH1] if(!g.isSectionHeader())=T
[PATH2] if(!g.isSectionHeader())=F
[INPUTS] branches=position | result=- | unused=l, v, id
[NEW] Intent
[CALLS-EXTERNAL] getListView().getAdapter().getItem... | true | ok | {"focal": {"class": "ChooseGroupActivity", "name": "onListItemClick", "signature": "void onListItemClick(ListView l, View v, int position, long id)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "l", "type": "ListView"}, {"name": "v", "type": "View"}, {"name": "position", "type": "int"}, {"n... |
15861701_165 | class NodeMaxPartitionLimitConstraint extends HardConstraint {
@Override
boolean isAssignmentValid(AssignableNode node, AssignableReplica replica,
ClusterContext clusterContext) {
boolean exceedMaxPartitionLimit =
node.getMaxPartition() < 0 || node.getAssignedReplicaCount() < node.getMaxPartition... | when(_testNode.getAssignedReplicaCount()).thenReturn(10);
when(_testNode.getMaxPartition()).thenReturn(5);
Assert.assertFalse(_constraint.isAssignmentValid(_testNode, _testReplica, _clusterContext));
}
} | [FOCAL] @Override boolean NodeMaxPartitionLimitConstraint.isAssignmentValid(AssignableNode node, AssignableReplica replica, ClusterContext clusterContext)
[CLASS] class NodeMaxPartitionLimitConstraint extends HardConstraint
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Assignabl... | /* static context
[FOCAL] @Override boolean NodeMaxPartitionLimitConstraint.isAssignmentValid(AssignableNode node, AssignableReplica replica, ClusterContext clusterContext)
[INPUTS] branches=- | result=node, replica | unused=clusterContext
[COLLABORATORS] param node:AssignableNode getMaxPartition/0,getAssignedReplicaCo... | /* static context
[FOCAL] @Override boolean NodeMaxPartitionLimitConstraint.isAssignmentValid(AssignableNode node, AssignableReplica replica, ClusterContext clusterContext)
[INPUTS] branches=- | result=node, replica | unused=clusterContext
[COLLABORATORS] param node:AssignableNode getMaxPartition/0,getAssignedReplicaCo... | true | ok | {"focal": {"class": "NodeMaxPartitionLimitConstraint", "name": "isAssignmentValid", "signature": "boolean isAssignmentValid(AssignableNode node, AssignableReplica replica, ClusterContext clusterContext)", "start_line": 3, "modifiers": "@Override", "params": [{"name": "node", "type": "AssignableNode"}, {"name": "replica... |
15878497_18 | class JavaCode extends Code {
public String methodReturns(String method) {
return getMethodPart(method, 2);
}
public JavaCode();
public String typeName();
private Matcher getTypeNameMatcher();
public boolean isClass();
public Collection<String> typeAnnotations();
public Collection<String> import... | String method = "m" + someValue();
String returns = someValue();
code.add("public class C {");
code.add(" public %s %s(int foo) {", returns, method);
code.add(" }");
code.add("}");
assertEquals("Returns", returns, code.methodReturns(method));
assertEquals("Returns of non-existing meth... | [FOCAL] public String JavaCode.methodReturns(String method)
[CLASS] class JavaCode extends Code
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String getMethodPart(String method, int part)
[INPUTS] branches=- | result=method
[DATAFLOW] method@param->L2
[CLASS-MEMBERS] JavaCode(); ... | /* static context
[FOCAL] public String JavaCode.methodReturns(String method)
[INPUTS] branches=- | result=method
[CALLS-INTERNAL] String getMethodPart(String method, int part)
*/
| /* static context
[FOCAL] public String JavaCode.methodReturns(String method)
[INPUTS] branches=- | result=method
[CALLS-INTERNAL] String getMethodPart(String method, int part)
*/
class JavaCode extends Code {
public String methodReturns(String method) {
return getMethodPart(method, 2);
}
public JavaCode()... | true | ok | {"focal": {"class": "JavaCode", "name": "methodReturns", "signature": "String methodReturns(String method)", "start_line": 3, "modifiers": "public", "params": [{"name": "method", "type": "String"}], "return_type": "String"}, "class_info": {"name": "JavaCode", "kind": "class", "modifiers": "", "superclass": "Code", "int... |
15904020_1 | class ValidatorMain {
static Date getEarliestDate(Optional<Date> o, Date d){
if (o.isPresent()){
d = o.get().before(d) ? o.get() : d;
}
return d;
}
public static void main(String[] args);
public static String getValidationSummary(ValidationResult result);
public static String getValidationReport(Validat... |
Optional<Date> o = Optional.of(new Date(10L));
Date d = new Date(0L);
Date returned = ValidatorMain.getEarliestDate(o, d);
assertSame(d, returned);
}
} | [FOCAL] static Date ValidatorMain.getEarliestDate(Optional<Date> o, Date d)
[CLASS] class ValidatorMain
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] Optional<Date>.isPresent/0, o.get().before/1, Optional<Date>.get/0
[PATH1] if(o.isPresent())=T -> return d
[PATH2] if(o.isPresent(... | /* static context
[FOCAL] static Date ValidatorMain.getEarliestDate(Optional<Date> o, Date d)
[PATH1] if(o.isPresent())=T -> return d
[PATH2] if(o.isPresent())=F -> return d
[INPUTS] branches=o | result=d, o
[COLLABORATORS] param o:Optional<Date> isPresent/0,get/0
[CALLS-EXTERNAL] Optional<Date>.isPresent/0, o.get().be... | /* static context
[FOCAL] static Date ValidatorMain.getEarliestDate(Optional<Date> o, Date d)
[PATH1] if(o.isPresent())=T -> return d
[PATH2] if(o.isPresent())=F -> return d
[INPUTS] branches=o | result=d, o
[COLLABORATORS] param o:Optional<Date> isPresent/0,get/0
[CALLS-EXTERNAL] Optional<Date>.isPresent/0, o.get().be... | true | ok | {"focal": {"class": "ValidatorMain", "name": "getEarliestDate", "signature": "Date getEarliestDate(Optional<Date> o, Date d)", "start_line": 3, "modifiers": "static", "params": [{"name": "o", "type": "Optional<Date>"}, {"name": "d", "type": "Date"}], "return_type": "Date"}, "class_info": {"name": "ValidatorMain", "kind... |
15912903_21 | class JaroBagFuzzyMatcher implements FuzzyMatcher {
@Override
public boolean sequencesMatching(final String phrase1, final String phrase2) {
final String phrase1LowerCase = removeNonAlphanumeric(phrase1).toLowerCase();
final String phrase2LowerCase = removeNonAlphanumeric(phrase2).toLowerCase()... | assertThat(matcher.sequencesMatching("t,e,r,r,o,r,i,s,t", "terrorist"), is(true));
}
} | [FOCAL] @Override public boolean JaroBagFuzzyMatcher.sequencesMatching(String phrase1, String phrase2)
[CLASS] class JaroBagFuzzyMatcher implements FuzzyMatcher
[METRICS] loc=17 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=2
[CALLS-INTERNAL] String removeNonAlphanumeric(String str); double compareBags(List<String... | /* static context
[FOCAL] @Override public boolean JaroBagFuzzyMatcher.sequencesMatching(String phrase1, String phrase2)
[PATH1] if(phrase1Bag.size() == 1 && phrase2Bag.size() == 1)=F -> if(phrase1Bag.size() < phrase2Bag.size())=T -> return compareBags(phrase1Bag, phrase2Bag) >= BAG_MIN_MATCH_FACTOR
[PATH2] if(phrase1B... | /* static context
[FOCAL] @Override public boolean JaroBagFuzzyMatcher.sequencesMatching(String phrase1, String phrase2)
[PATH1] if(phrase1Bag.size() == 1 && phrase2Bag.size() == 1)=F -> if(phrase1Bag.size() < phrase2Bag.size())=T -> return compareBags(phrase1Bag, phrase2Bag) >= BAG_MIN_MATCH_FACTOR
[PATH2] if(phrase1B... | true | ok | {"focal": {"class": "JaroBagFuzzyMatcher", "name": "sequencesMatching", "signature": "boolean sequencesMatching(String phrase1, String phrase2)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "phrase1", "type": "String"}, {"name": "phrase2", "type": "String"}], "return_type": "boolean"}, "class_... |
15928650_0 | class FileDownloadAction implements Action {
String sanitizeInputPath( String value ) {
if (value != null && value.toUpperCase().contains("WEB-INF")) {
return null;
}
return value;
}
public String execute();
public void setInputPath(String value);
public InputStream getInputStream();
private FileDownl... | assertEquals("foo", fileDownloadAction.sanitizeInputPath("foo"));
}
} | [FOCAL] String FileDownloadAction.sanitizeInputPath(String value)
[CLASS] class FileDownloadAction implements Action
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] value.toUpperCase().contains/1, String.toUpperCase/0
[PATH1] if(value != null && value.toUpperCase().contains("WEB-IN... | /* static context
[FOCAL] String FileDownloadAction.sanitizeInputPath(String value)
[PATH1] if(value != null && value.toUpperCase().contains("WEB-INF"))=T -> return null
[PATH2] if(value != null && value.toUpperCase().contains("WEB-INF"))=F -> return value
[INPUTS] branches=value | result=value
[CALLS-EXTERNAL] value.t... | /* static context
[FOCAL] String FileDownloadAction.sanitizeInputPath(String value)
[PATH1] if(value != null && value.toUpperCase().contains("WEB-INF"))=T -> return null
[PATH2] if(value != null && value.toUpperCase().contains("WEB-INF"))=F -> return value
[INPUTS] branches=value | result=value
[CALLS-EXTERNAL] value.t... | true | ok | {"focal": {"class": "FileDownloadAction", "name": "sanitizeInputPath", "signature": "String sanitizeInputPath(String value)", "start_line": 3, "modifiers": "", "params": [{"name": "value", "type": "String"}], "return_type": "String"}, "class_info": {"name": "FileDownloadAction", "kind": "class", "modifiers": "", "super... |
15951171_0 | class HzUnitOfWorkJournal implements UnitOfWorkJournal<K> {
public void append(final K id, final UnitOfWork uow) {
checkNotNull(id);
checkNotNull(uow);
final AggregateRootHistory history = getHistoryFor(id);
if (!history.getLastVersion().equals(uow.getTargetVersion())){
throw new ConcurrentModificationExce... |
UUID id = UUID.randomUUID();
Command command = new IncreaseInventory(UUID.randomUUID(), id, 1, 0L);
Event event1 = new InventoryIncreased(id, 1);
List<Event> events = Arrays.asList(event1);
UnitOfWork t = UnitOfWork.create(UUID.randomUUID(), command, events);
AggregateRootHistory toStore = new AggregateR... | [FOCAL] public void HzUnitOfWorkJournal.append(K id, UnitOfWork uow)
[CLASS] class HzUnitOfWorkJournal implements UnitOfWorkJournal<K>
[METRICS] loc=15 cc=2 branches=1 loops=0 returns=0 throws=1 nesting=1
[CALLS-INTERNAL] AggregateRootHistory getHistoryFor(K id)
[CALLS-EXTERNAL] checkNotNull/1 (inherited), history.getL... | /* static context
[FOCAL] public void HzUnitOfWorkJournal.append(K id, UnitOfWork uow)
[THROWS-WHEN] ConcurrentModificationException when !history.getLastVersion().equals(uow.getTargetVersion())
[PATH1] if(!history.getLastVersion().equals(uow.getTargetVersion()))=T -> throw new ConcurrentModificationException(String.fo... | /* static context
[FOCAL] public void HzUnitOfWorkJournal.append(K id, UnitOfWork uow)
[THROWS-WHEN] ConcurrentModificationException when !history.getLastVersion().equals(uow.getTargetVersion())
[PATH1] if(!history.getLastVersion().equals(uow.getTargetVersion()))=T -> throw new ConcurrentModificationException(String.fo... | true | ok | {"focal": {"class": "HzUnitOfWorkJournal", "name": "append", "signature": "void append(K id, UnitOfWork uow)", "start_line": 3, "modifiers": "public", "params": [{"name": "id", "type": "K"}, {"name": "uow", "type": "UnitOfWork"}], "return_type": "void"}, "class_info": {"name": "HzUnitOfWorkJournal", "kind": "class", "m... |
15958676_25 | class Utils {
public static String getArrayDimensionString(Object array) {
if (!array.getClass().isArray()) {
return "";
}
StringBuilder sb = new StringBuilder();
Object current = array;
int len = Array.getLength(current);
sb.append('[').append(len).appe... | String[][][] value = new String[5][4][3];
String expected = "[5][4][3]";
String actual = Utils.getArrayDimensionString(value);
assertEquals(expected, actual);
}
} | [FOCAL] public static String Utils.getArrayDimensionString(Object array)
[CLASS] class Utils
[METRICS] loc=21 cc=4 branches=2 loops=1 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] array.getClass().isArray/0, Object.getClass/0, Array.getLength/1, sb.append('[').append(len).append/1, sb.append('[').append/1, StringBuilde... | /* static context
[FOCAL] public static String Utils.getArrayDimensionString(Object array)
[PATH1] if(!array.getClass().isArray())=F -> while(len > 0)=T -> if((current == null) || !current.getClass().isArray())=F -> exit loop -> return sb.toString()
[PATH2] if(!array.getClass().isArray())=T -> return ""
[PATH3] if(!arr... | /* static context
[FOCAL] public static String Utils.getArrayDimensionString(Object array)
[PATH1] if(!array.getClass().isArray())=F -> while(len > 0)=T -> if((current == null) || !current.getClass().isArray())=F -> exit loop -> return sb.toString()
[PATH2] if(!array.getClass().isArray())=T -> return ""
[PATH3] if(!arr... | true | ok | {"focal": {"class": "Utils", "name": "getArrayDimensionString", "signature": "String getArrayDimensionString(Object array)", "start_line": 3, "modifiers": "public static", "params": [{"name": "array", "type": "Object"}], "return_type": "String"}, "class_info": {"name": "Utils", "kind": "class", "modifiers": "", "superc... |
15979754_15 | class SystemPropertiesBean implements CommandListener {
@Command
public String osVersion() {
return System.getProperty("os.version");
}
@Command public String home();
@Command public String home(@Exists @Directory File file);
@Command public String user();
@Command public String di... | assertEquals(System.getProperty("os.version"), main.exec("osVersion"));
}
} | [FOCAL] @Command public String SystemPropertiesBean.osVersion()
[CLASS] class SystemPropertiesBean implements CommandListener
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] System.getProperty/1
[CLASS-MEMBERS] String home(); String home(File file); String user(); String dir(); Str... | /* static context
[FOCAL] @Command public String SystemPropertiesBean.osVersion()
[CALLS-EXTERNAL] System.getProperty/1
*/
| /* static context
[FOCAL] @Command public String SystemPropertiesBean.osVersion()
[CALLS-EXTERNAL] System.getProperty/1
*/
class SystemPropertiesBean implements CommandListener {
@Command
public String osVersion() {
return System.getProperty("os.version");
}
@Command public String home();
... | true | ok | {"focal": {"class": "SystemPropertiesBean", "name": "osVersion", "signature": "String osVersion()", "start_line": 3, "modifiers": "@Command public", "params": [], "return_type": "String"}, "class_info": {"name": "SystemPropertiesBean", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "CommandListener... |
15997656_31 | class HttpUtil {
public static Response post(String url)
throws URISyntaxException, UnsupportedEncodingException, HttpException {
return postParams(new HttpPost(url), new ArrayList<NameValuePair>(), null, null);
}
public static Response get(String url);
public static Response get(Strin... | Response response = HttpUtil.post(URL, POST_KEY_VALUE_PAIRS, USERNAME, PASSWORD, REQ_HEADERS);
assertNotNull(response);
}
} | [FOCAL] public static Response HttpUtil.post(String url)
[CLASS] class HttpUtil
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Response postParams(HttpPost httpRequest, List<NameValuePair> queryParams, Credentials credentials, Header[] requestHeaders)
[NEW] HttpPost, ArrayList<Nam... | class HttpUtil {
public static Response post(String url)
throws URISyntaxException, UnsupportedEncodingException, HttpException {
return postParams(new HttpPost(url), new ArrayList<NameValuePair>(), null, null);
}
public static Response get(String url);
public static Response get(Strin... | false | ok | {"focal": {"class": "HttpUtil", "name": "post", "signature": "Response post(String url) throws URISyntaxException, UnsupportedEncodingException, HttpException", "start_line": 3, "modifiers": "public static", "params": [{"name": "url", "type": "String"}], "return_type": "Response"}, "class_info": {"name": "HttpUtil", "k... | |
16004885_1 | class MigrationsInDir implements Migrations {
@Override
public Iterable<File> asIterable() {
ArrayList<File> list = new ArrayList<File>(Arrays.asList(migrationFiles));
Collections.sort(list, comparator);
return list;
}
public MigrationsInDir(File directory);
public MigrationsInDir(File directory, Compara... | Iterator<File> iterator = migrations.asIterable().iterator();
assertStartsWithNumber(iterator.next(), 1);
assertStartsWithNumber(iterator.next(), 2);
assertStartsWithNumber(iterator.next(), 3);
}
} | [FOCAL] @Override public Iterable<File> MigrationsInDir.asIterable()
[CLASS] class MigrationsInDir implements Migrations
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Arrays.asList/1, Collections.sort/2
[NEW] ArrayList<File>
[DATAFLOW] list@L3->L4,L5
[CLASS-MEMBERS] MigrationsInD... | /* static context
[FOCAL] @Override public Iterable<File> MigrationsInDir.asIterable()
[NEW] ArrayList<File>
[CALLS-EXTERNAL] Arrays.asList/1, Collections.sort/2
*/
| /* static context
[FOCAL] @Override public Iterable<File> MigrationsInDir.asIterable()
[NEW] ArrayList<File>
[CALLS-EXTERNAL] Arrays.asList/1, Collections.sort/2
*/
class MigrationsInDir implements Migrations {
@Override
public Iterable<File> asIterable() {
ArrayList<File> list = new ArrayList<File>(Arrays.asList(... | true | ok | {"focal": {"class": "MigrationsInDir", "name": "asIterable", "signature": "Iterable<File> asIterable()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Iterable<File>"}, "class_info": {"name": "MigrationsInDir", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Migrat... |
16006160_9 | class StringFunctions {
public static String urlDecode(final String encoded, final Charset charset) throws MyRuleException {
final byte[] buff = new byte[encoded.length()]; // バイト長は文字列長を超えない。
int buffIndex = 0;
for (int i = 0; i < encoded.length(); i++) {
if (encoded.charAt(i) =... | Assert.assertEquals("てすとスレ", StringFunctions.urlDecode("%82%C4%82%B7%82%C6%83X%83%8C", Charset.forName("Shift_JIS")));
Assert.assertEquals("名無し", StringFunctions.urlDecode("%96%BC%96%B3%82%B5", Charset.forName("Shift_JIS")));
Assert.assertEquals("新規スレッド作成", StringFunctions.urlDecode("%90V%8BK%83... | [FOCAL] public static String StringFunctions.urlDecode(String encoded, Charset charset)
[CLASS] class StringFunctions
[METRICS] loc=25 cc=7 branches=4 loops=1 returns=1 throws=3 nesting=4
[CALLS-INTERNAL] boolean allowed(char c)
[CALLS-EXTERNAL] String.length/0, String.charAt/1, String.substring/1, Integer.parseInt/2, ... | /* static context
[FOCAL] public static String StringFunctions.urlDecode(String encoded, Charset charset)
[THROWS-WHEN] MyRuleException when i < encoded.length() && encoded.charAt(i) == '%' && i + 2 >= encoded.length()
[THROWS-WHEN] MyRuleException when i < encoded.length() && encoded.charAt(i) == '%' && !(i + 2 >= enc... | /* static context
[FOCAL] public static String StringFunctions.urlDecode(String encoded, Charset charset)
[THROWS-WHEN] MyRuleException when i < encoded.length() && encoded.charAt(i) == '%' && i + 2 >= encoded.length()
[THROWS-WHEN] MyRuleException when i < encoded.length() && encoded.charAt(i) == '%' && !(i + 2 >= enc... | true | ok | {"focal": {"class": "StringFunctions", "name": "urlDecode", "signature": "String urlDecode(String encoded, Charset charset) throws MyRuleException", "start_line": 3, "modifiers": "public static", "params": [{"name": "encoded", "type": "String"}, {"name": "charset", "type": "Charset"}], "return_type": "String"}, "class_... |
16037437_0 | class DaggerComponentProviderFactory implements IoCComponentProviderFactory {
@Override
public IoCComponentProvider getComponentProvider(Class<?> clazz) {
return getComponentProvider(null, clazz);
}
public DaggerComponentProviderFactory(ResourceConfig config, ObjectGraph objectGraph, Object[]... | ResourceConfig config = new DefaultResourceConfig();
ObjectGraph objectGraph = ObjectGraph.create(SomeInjectableProvidesModule.class,
new SomeOtherInjectableProvidesModule());
IoCComponentProviderFactory factory = new DaggerComponentProviderFactory(config, objectGraph,
... | [FOCAL] @Override public IoCComponentProvider DaggerComponentProviderFactory.getComponentProvider(Class<?> clazz)
[CLASS] class DaggerComponentProviderFactory implements IoCComponentProviderFactory
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] IoCComponentProvider getComponentPro... | /* static context
[FOCAL] @Override public IoCComponentProvider DaggerComponentProviderFactory.getComponentProvider(Class<?> clazz)
[INPUTS] branches=- | result=clazz
[CALLS-INTERNAL] IoCComponentProvider getComponentProvider(ComponentContext componentContext, Class<?> clazz)
*/
| /* static context
[FOCAL] @Override public IoCComponentProvider DaggerComponentProviderFactory.getComponentProvider(Class<?> clazz)
[INPUTS] branches=- | result=clazz
[CALLS-INTERNAL] IoCComponentProvider getComponentProvider(ComponentContext componentContext, Class<?> clazz)
*/
class DaggerComponentProviderFactory imp... | true | ok | {"focal": {"class": "DaggerComponentProviderFactory", "name": "getComponentProvider", "signature": "IoCComponentProvider getComponentProvider(Class<?> clazz)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "clazz", "type": "Class<?>"}], "return_type": "IoCComponentProvider"}, "class_info": {"nam... |
16047008_14 | class StringStack implements Iterable<String> {
public int size() {
return start_byte.size() - 1;
}
public StringStack(String... xs);
public StringStack(Iterable<String> xs);
public boolean isEmpty();
public boolean contains(String o);
public boolean add(String e);
public void clear();
public String get... | assertEquals(0, new StringStack().size());
assertEquals(1, new StringStack("moo").size());
assertEquals(2, new StringStack("foo", "bar").size());
}
} | [FOCAL] public int StringStack.size()
[CLASS] class StringStack implements Iterable<String>
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] start_byte.size/0
[COLLABORATORS] field start_byte size/0
[CLASS-MEMBERS] StringStack(String... xs); StringStack(Iterable<String> xs); boolean... | /* static context
[FOCAL] public int StringStack.size()
[COLLABORATORS] field start_byte size/0
[CALLS-EXTERNAL] start_byte.size/0
*/
| /* static context
[FOCAL] public int StringStack.size()
[COLLABORATORS] field start_byte size/0
[CALLS-EXTERNAL] start_byte.size/0
*/
class StringStack implements Iterable<String> {
public int size() {
return start_byte.size() - 1;
}
public StringStack(String... xs);
public StringStack(Iterable<String> xs);
... | true | ok | {"focal": {"class": "StringStack", "name": "size", "signature": "int size()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "StringStack", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Iterable<String>", "fields": [], "members": [{"name": "Str... |
16050719_0 | class Gantt extends AbstractComponent implements HasComponents {
public TimeZone getTimeZone() {
if (timezone == null) {
return getCalendar().getTimeZone();
}
return timezone;
}
public Gantt();
@Override public void attach();
@Override public GanttState getSta... | TimeZone timezone = TimeZone.getTimeZone("Asia/Tehran");
Locale locale = Locale.GERMANY;
DateTime week1_2014 = new DateTime(2014, 1, 1, 0, 0, 0, 000,
DateTimeZone.forTimeZone(timezone));
DateTime week2_2014 = new DateTime(2014, 1, 6, 0, 0, 0, 000,
DateTi... | [FOCAL] public TimeZone Gantt.getTimeZone()
[CLASS] class Gantt extends AbstractComponent implements HasComponents
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] Calendar getCalendar()
[CALLS-EXTERNAL] getCalendar().getTimeZone/0
[PATH1] if(timezone == null)=T -> return getCalenda... | class Gantt extends AbstractComponent implements HasComponents {
public TimeZone getTimeZone() {
if (timezone == null) {
return getCalendar().getTimeZone();
}
return timezone;
}
public Gantt();
@Override public void attach();
@Override public GanttState getSta... | false | ok | {"focal": {"class": "Gantt", "name": "getTimeZone", "signature": "TimeZone getTimeZone()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "TimeZone"}, "class_info": {"name": "Gantt", "kind": "class", "modifiers": "", "superclass": "AbstractComponent", "interfaces": "HasComponents", "fields": [], "... | |
16057180_0 | class KPiece implements Iterable<KUnitSquare> {
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + height;
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + pieceId;
result = prime * result
+ ((unitSquares == nul... | KPiece rot = KPieces.TETRAMINO_T_1;
int r0 = rot.hashCode(); // 0deg
rot = rot.rotatedNinetyDegrees();
int r90 = rot.hashCode(); // 90deg
rot = rot.rotatedNinetyDegrees();
Assert.assertTrue(!(r90 == r0));
int r180 = rot.hashCode(); // 180deg
rot = rot.rotatedNinetyDegrees();
Assert.assertTrue(!(... | [FOCAL] @Override public int KPiece.hashCode()
[CLASS] class KPiece implements Iterable<KUnitSquare>
[METRICS] loc=12 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] name.hashCode/0, unitSquares.hashCode/0
[COLLABORATORS] field name hashCode/0; field unitSquares hashCode/0
[DATAFLOW] prime@L3->L5,... | /* static context
[FOCAL] @Override public int KPiece.hashCode()
[COLLABORATORS] field name hashCode/0; field unitSquares hashCode/0
[CALLS-EXTERNAL] name.hashCode/0, unitSquares.hashCode/0
*/
| /* static context
[FOCAL] @Override public int KPiece.hashCode()
[COLLABORATORS] field name hashCode/0; field unitSquares hashCode/0
[CALLS-EXTERNAL] name.hashCode/0, unitSquares.hashCode/0
*/
class KPiece implements Iterable<KUnitSquare> {
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
... | true | ok | {"focal": {"class": "KPiece", "name": "hashCode", "signature": "int hashCode()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "KPiece", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Iterable<KUnitSquare>", "fields": [], "members": [... |
16077092_0 | class CategoricalAttribute extends Attribute {
public List<String> getCategoricalInstances() {
return ImmutableList.copyOf(categoricalInstances);
}
@JsonCreator public CategoricalAttribute(@NotBlank @JsonProperty("name") String name,
@JsonProperty("categoricalInsta... | assertEquals("Nominal values were not set properly", nominal_values, field.getCategoricalInstances());
assertEquals("Instance name not set properly", name, field.getName());
int index = 0;
for(String v : nominal_values) {
assertEquals("Known value must be unchanged", index, ... | [FOCAL] public List<String> CategoricalAttribute.getCategoricalInstances()
[CLASS] class CategoricalAttribute extends Attribute
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] ImmutableList.copyOf/1
[CLASS-MEMBERS] CategoricalAttribute(String name, List<String> pcategoricalInstance... | /* static context
[FOCAL] public List<String> CategoricalAttribute.getCategoricalInstances()
[CALLS-EXTERNAL] ImmutableList.copyOf/1
*/
| /* static context
[FOCAL] public List<String> CategoricalAttribute.getCategoricalInstances()
[CALLS-EXTERNAL] ImmutableList.copyOf/1
*/
class CategoricalAttribute extends Attribute {
public List<String> getCategoricalInstances() {
return ImmutableList.copyOf(categoricalInstances);
}
@JsonCreator p... | true | ok | {"focal": {"class": "CategoricalAttribute", "name": "getCategoricalInstances", "signature": "List<String> getCategoricalInstances()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<String>"}, "class_info": {"name": "CategoricalAttribute", "kind": "class", "modifiers": "", "superclass": "Attr... |
16091126_6 | class Hits implements Closeable {
public float[] weightHistogram(int firstindex,
int lastindex,
int start,
int stop,
int stepsize,
int dedup... | for (int q = 0; q < 300; q++) {
int start = (int)Math.round(Math.random() * MAXVALUE);
int end = start + (int)(Math.round(Math.random() * MAXVALUE) % (MAXVALUE - start));
if (end < start) {
throw new RuntimeException("end < start");
}
i... | [FOCAL] public float[] Hits.weightHistogram(int firstindex, int lastindex, int start, int stop, int stepsize, int dedup, Float minweight, Boolean isPlus, boolean extension)
[CLASS] class Hits implements Closeable
[METRICS] loc=76 cc=16 branches=10 loops=5 returns=1 throws=0 nesting=5
[CALLS-INTERNAL] IntBP getLASBuffer... | /* static context
[FOCAL] public float[] Hits.weightHistogram(int firstindex, int lastindex, int start, int stop, int stepsize, int dedup, Float minweight, Boolean isPlus, boolean extension)
[PATH1] for(j < output.length)=T -> exit loop -> if(!extension)=F -> for(i < p[1])#2=T -> if(dedup != 0)#2=T -> if(pos == lastpos... | /* static context
[FOCAL] public float[] Hits.weightHistogram(int firstindex, int lastindex, int start, int stop, int stepsize, int dedup, Float minweight, Boolean isPlus, boolean extension)
[PATH1] for(j < output.length)=T -> exit loop -> if(!extension)=F -> for(i < p[1])#2=T -> if(dedup != 0)#2=T -> if(pos == lastpos... | true | ok | {"focal": {"class": "Hits", "name": "weightHistogram", "signature": "float[] weightHistogram(int firstindex, int lastindex, int start, int stop, int stepsize, int dedup, Float minweight, Boolean isPlus, boolean extension) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "firstindex", "ty... |
16100959_68 | class IndexingUtils {
public static byte[] getByteContent(Resource resource, String sourceURL)
throws RegistryException {
try {
InputStream is = null;
if (sourceURL != null) {
is = new URL(sourceURL).openStream();
} else {
Object content = resource.getContent();... | ResourceImpl resource = mock(ResourceImpl.class);
String contentString = "Testing Content";
when(resource.getContent()).thenReturn(contentString);
when(resource.getContentStream()).thenReturn(null);
byte[] byteContent = IndexingUtils.getByteContent(resource, null);
assert... | [FOCAL] public static byte[] IndexingUtils.getByteContent(Resource resource, String sourceURL)
[CLASS] class IndexingUtils
[METRICS] loc=28 cc=7 branches=5 loops=0 returns=4 throws=2 nesting=5
[CALLS-INTERNAL] byte[] readBytesFromInputSteam(InputStream in)
[CALLS-EXTERNAL] new URL(sourceURL).openStream/0, Resource.getC... | /* static context
[FOCAL] public static byte[] IndexingUtils.getByteContent(Resource resource, String sourceURL)
[THROWS-WHEN] RegistryException when try-body throws
[THROWS-WHEN] RegistryException when !(sourceURL != null) && !(null == content) && is == null && !(content instanceof byte[]) && !(content instanceof Stri... | /* static context
[FOCAL] public static byte[] IndexingUtils.getByteContent(Resource resource, String sourceURL)
[THROWS-WHEN] RegistryException when try-body throws
[THROWS-WHEN] RegistryException when !(sourceURL != null) && !(null == content) && is == null && !(content instanceof byte[]) && !(content instanceof Stri... | true | ok | {"focal": {"class": "IndexingUtils", "name": "getByteContent", "signature": "byte[] getByteContent(Resource resource, String sourceURL) throws RegistryException", "start_line": 3, "modifiers": "public static", "params": [{"name": "resource", "type": "Resource"}, {"name": "sourceURL", "type": "String"}], "return_type": ... |
16115996_3 | class CoinChangeSolution {
public static int countOptimal(int[] coins, int amt) {
// solutions[i] contains the no. of solutions for value i.
// We build from bottom up using the base case (n = 0)
int solutions[] = new int[amt + 1];
solutions[0] = 1;
for (Integer i : coins)
for (int j = ... |
int coins[] = { 2, 5, 3, 6, 10, 7, 8, 12, 17, 19, 20 };
assertEquals(227491942, CoinChangeSolution.countOptimal(coins, 250));
}
} | [FOCAL] public static int CoinChangeSolution.countOptimal(int[] coins, int amt)
[CLASS] class CoinChangeSolution
[METRICS] loc=13 cc=3 branches=0 loops=2 returns=1 throws=0 nesting=2
[PATH1] foreach(Integer i : coins)=T -> for(j <= amt)=F -> exit loop -> return solutions[amt]
[PATH2] foreach(Integer i : coins)=F -> ret... | /* static context
[FOCAL] public static int CoinChangeSolution.countOptimal(int[] coins, int amt)
[PATH1] foreach(Integer i : coins)=T -> for(j <= amt)=F -> exit loop -> return solutions[amt]
[PATH2] foreach(Integer i : coins)=F -> return solutions[amt]
[PATH3] foreach(Integer i : coins)=T -> for(j <= amt)=T -> exit lo... | /* static context
[FOCAL] public static int CoinChangeSolution.countOptimal(int[] coins, int amt)
[PATH1] foreach(Integer i : coins)=T -> for(j <= amt)=F -> exit loop -> return solutions[amt]
[PATH2] foreach(Integer i : coins)=F -> return solutions[amt]
[PATH3] foreach(Integer i : coins)=T -> for(j <= amt)=T -> exit lo... | true | ok | {"focal": {"class": "CoinChangeSolution", "name": "countOptimal", "signature": "int countOptimal(int[] coins, int amt)", "start_line": 3, "modifiers": "public static", "params": [{"name": "coins", "type": "int[]"}, {"name": "amt", "type": "int"}], "return_type": "int"}, "class_info": {"name": "CoinChangeSolution", "kin... |
16121108_8 | class Domain extends BaseEntity {
public String getIdentifierPrefix() {
StringBuilder sb = new StringBuilder();
URL baseUrl = this.getRuntime().getServerBaseUrl();
// protocol
Boolean httpsEnabled = getBooleanAttribute("https.identifier.enabled");
final String protocol;
if (httpsEnabled != null) {
pro... | URL url = new URL("http://example1.com/jos-webapp/");
domain.getRuntime().setServerBaseUrl(url);
domain.setName("example1.com");
domain.setType(Domain.TYPE_SUBDOMAIN);
assertEquals("http://", domain.getIdentifierPrefix());
}
} | [FOCAL] public String Domain.getIdentifierPrefix()
[CLASS] class Domain extends BaseEntity
[METRICS] loc=29 cc=4 branches=2 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] Boolean getBooleanAttribute(String attributeName); DomainRuntime getRuntime(); String getName(); int getType(); void appendMemberPath(StringBu... | /* static context
[FOCAL] public String Domain.getIdentifierPrefix()
[PATH1] if(httpsEnabled != null)=T -> switch(getType())=case Domain.TYPE_SUBDOMAIN -> return sb.toString()
[PATH2] if(httpsEnabled != null)=F -> switch(getType())=case Domain.TYPE_SUBDIRECTORY -> return sb.toString()
[PATH3] if(httpsEnabled != null)=T... | /* static context
[FOCAL] public String Domain.getIdentifierPrefix()
[PATH1] if(httpsEnabled != null)=T -> switch(getType())=case Domain.TYPE_SUBDOMAIN -> return sb.toString()
[PATH2] if(httpsEnabled != null)=F -> switch(getType())=case Domain.TYPE_SUBDIRECTORY -> return sb.toString()
[PATH3] if(httpsEnabled != null)=T... | true | ok | {"focal": {"class": "Domain", "name": "getIdentifierPrefix", "signature": "String getIdentifierPrefix()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "Domain", "kind": "class", "modifiers": "", "superclass": "BaseEntity", "interfaces": null, "fields": [{"name":... |
16132708_5 | class ContextAwareSail extends SailWrapper {
@Override
public SailConnection getConnection() throws SailException {
return new ContextAwareSailConnection(super.getConnection(),context);
}
public ContextAwareSail(Sail baseSail, Resource context);
protected ContextAwareSail cas;
}
class ... | final SailConnection con = cas.getConnection();
try {
con.begin();
assertTrue(hasStatement(con, null, null, null));
con.clear();
assertFalse(hasStatement(con, null, null, null));
con.commit();
} catch (final Throwable t) {
... | [FOCAL] @Override public SailConnection ContextAwareSail.getConnection()
[CLASS] class ContextAwareSail extends SailWrapper
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] SailWrapper.getConnection/0
[NEW] ContextAwareSailConnection
[EXCEPTIONS] declares SailException
[CLASS-MEMBER... | /* static context
[FOCAL] @Override public SailConnection ContextAwareSail.getConnection()
[EXCEPTIONS] declares SailException
[NEW] ContextAwareSailConnection
[CALLS-EXTERNAL] SailWrapper.getConnection/0
*/
| /* static context
[FOCAL] @Override public SailConnection ContextAwareSail.getConnection()
[EXCEPTIONS] declares SailException
[NEW] ContextAwareSailConnection
[CALLS-EXTERNAL] SailWrapper.getConnection/0
*/
class ContextAwareSail extends SailWrapper {
@Override
public SailConnection getConnection() throws Sai... | true | ok | {"focal": {"class": "ContextAwareSail", "name": "getConnection", "signature": "SailConnection getConnection() throws SailException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "SailConnection"}, "class_info": {"name": "ContextAwareSail", "kind": "class", "modifiers": "", "superclass"... |
16156598_0 | class JsonMessageConverter implements MessageConverter {
@Override
public String toDDP(final Object object) {
final String json = GSON.toJson(object, object.getClass());
final StringBuilder buffer = new StringBuilder(json);
buffer.insert(1, "\"msg\":\"" + MessageRegistry.get(object.getC... | MyTestClass foo = new MyTestClass();
foo.setName("Hello, world!");
foo.setDate(new Date());
JsonMessageConverter converter = new JsonMessageConverter();
String result = converter.toDDP(foo);
System.out.println(result);
Assert.assertTrue(result.contains("Hello, wor... | [FOCAL] @Override public String JsonMessageConverter.toDDP(Object object)
[CLASS] class JsonMessageConverter implements MessageConverter
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] GSON.toJson/2, Object.getClass/0, StringBuilder.insert/2, MessageRegistry.get/1, StringBuilder.to... | /* static context
[FOCAL] @Override public String JsonMessageConverter.toDDP(Object object)
[INPUTS] branches=- | result=object
[NEW] StringBuilder
[CALLS-EXTERNAL] GSON.toJson/2, Object.getClass/0, StringBuilder.insert/2, MessageRegistry.get/1, StringBuilder.toString/0
*/
| /* static context
[FOCAL] @Override public String JsonMessageConverter.toDDP(Object object)
[INPUTS] branches=- | result=object
[NEW] StringBuilder
[CALLS-EXTERNAL] GSON.toJson/2, Object.getClass/0, StringBuilder.insert/2, MessageRegistry.get/1, StringBuilder.toString/0
*/
class JsonMessageConverter implements MessageC... | true | ok | {"focal": {"class": "JsonMessageConverter", "name": "toDDP", "signature": "String toDDP(Object object)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "object", "type": "Object"}], "return_type": "String"}, "class_info": {"name": "JsonMessageConverter", "kind": "class", "modifiers": "", "supercl... |
16162461_3 | class SinaUserBaseInfoDaoImpl implements SinaUserBaseInfoDao {
public SinaUserBaseInfoDaoImpl(List<String> tokens) {
this.tokens = tokens;
user = new Users();
}
public SinaUserBaseInfoDaoImpl(List<String> tokens);
@Override public User getUserBaseInfo(String uid);
private String getRandomToken();
}
class... |
List<String> tokens = new ArrayList<String>();
tokens.add("2.00eEQZzBdcZIJCdb7f41b1ebOlNq3B");
tokens.add("2.0000onHtdcZIJC5ded8d28dc0CtU8F");
SinaUserBaseInfoDao sinaUserBaseinfoDao = new SinaUserBaseInfoDaoImpl(tokens);
// User userInfo = sinaUserBaseinfoDao.getUserBaseInfo("1768044590");
// assertEqu... | [FOCAL] public SinaUserBaseInfoDaoImpl.SinaUserBaseInfoDaoImpl(List<String> tokens)
[CLASS] class SinaUserBaseInfoDaoImpl implements SinaUserBaseInfoDao
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[NEW] Users
[FIELDS] write=tokens
[STATE] tokens
[DATAFLOW] tokens@param->L2
[CLASS-MEMBERS] SinaU... | /* static context
[FOCAL] public SinaUserBaseInfoDaoImpl.SinaUserBaseInfoDaoImpl(List<String> tokens)
[STATE] tokens
[FIELDS] write=tokens
[NEW] Users
*/
| /* static context
[FOCAL] public SinaUserBaseInfoDaoImpl.SinaUserBaseInfoDaoImpl(List<String> tokens)
[STATE] tokens
[FIELDS] write=tokens
[NEW] Users
*/
class SinaUserBaseInfoDaoImpl implements SinaUserBaseInfoDao {
public SinaUserBaseInfoDaoImpl(List<String> tokens) {
this.tokens = tokens;
user = new Users();
... | true | ok | {"focal": {"class": "SinaUserBaseInfoDaoImpl", "name": "SinaUserBaseInfoDaoImpl", "signature": "SinaUserBaseInfoDaoImpl(List<String> tokens)", "start_line": 3, "modifiers": "public", "params": [{"name": "tokens", "type": "List<String>"}], "return_type": null}, "class_info": {"name": "SinaUserBaseInfoDaoImpl", "kind": "... |
16185077_9 | class Encoder {
public static AztecCode encode(byte[] data) {
return encode(data, DEFAULT_EC_PERCENT, DEFAULT_AZTEC_LAYERS);
}
private Encoder();
public static AztecCode encode(byte[] data, int minECCPercent, int userSpecifiedLayers);
private static void drawBullsEye(BitMatrix matrix, int center, int ... | // Compact(4) con hold 608 bits of information, but at most 504 can be data. Rest must
// be error correction
String alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
// encodes as 26 * 5 * 4 = 520 bits of data
String alphabet4 = alphabet + alphabet + alphabet + alphabet;
byte[] data = alphabet4.getByte... | [FOCAL] public static AztecCode Encoder.encode(byte[] data)
[CLASS] class Encoder
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] AztecCode encode(byte[] data, int minECCPercent, int userSpecifiedLayers)
[INPUTS] branches=- | result=data
[DATAFLOW] data@param->L2
[CLASS-MEMBERS] En... | /* static context
[FOCAL] public static AztecCode Encoder.encode(byte[] data)
[INPUTS] branches=- | result=data
[CALLS-INTERNAL] AztecCode encode(byte[] data, int minECCPercent, int userSpecifiedLayers)
*/
| /* static context
[FOCAL] public static AztecCode Encoder.encode(byte[] data)
[INPUTS] branches=- | result=data
[CALLS-INTERNAL] AztecCode encode(byte[] data, int minECCPercent, int userSpecifiedLayers)
*/
class Encoder {
public static AztecCode encode(byte[] data) {
return encode(data, DEFAULT_EC_PERCENT, DEFAU... | true | ok | {"focal": {"class": "Encoder", "name": "encode", "signature": "AztecCode encode(byte[] data)", "start_line": 3, "modifiers": "public static", "params": [{"name": "data", "type": "byte[]"}], "return_type": "AztecCode"}, "class_info": {"name": "Encoder", "kind": "class", "modifiers": "", "superclass": null, "interfaces":... |
16189524_3 | class MeasurementsResource {
@POST
@Path("/{resource}")
@Timed
public Collection<Collection<MeasurementDTO>> getMeasurements(
ResultDescriptorDTO descriptorDTO,
@PathParam("resource") Resource resource,
@QueryParam("start") Optional<TimestampParam> start,
... |
final Results<Measurement> results = new Results<>();
when(
m_repository.select(
eq(Context.DEFAULT_CONTEXT),
eq(new Resource("localhost")),
eq(Optional.of(Timestamp.fromEpochSeconds(900000000))),
... | [FOCAL] @POST @Path("/{resource}") @Timed public Collection<Collection<MeasurementDTO>> MeasurementsResource.getMeasurements(ResultDescriptorDTO descriptorDTO, Resource resource, Optional<TimestampParam> start, Optional<TimestampParam> end, Optional<DurationParam> resolution, Optional<String> contextId)
[CLASS] class M... | /* static context
[FOCAL] @POST @Path("/{resource}") @Timed public Collection<Collection<MeasurementDTO>> MeasurementsResource.getMeasurements(ResultDescriptorDTO descriptorDTO, Resource resource, Optional<TimestampParam> start, Optional<TimestampParam> end, Optional<DurationParam> resolution, Optional<String> contextI... | /* static context
[FOCAL] @POST @Path("/{resource}") @Timed public Collection<Collection<MeasurementDTO>> MeasurementsResource.getMeasurements(ResultDescriptorDTO descriptorDTO, Resource resource, Optional<TimestampParam> start, Optional<TimestampParam> end, Optional<DurationParam> resolution, Optional<String> contextI... | true | ok | {"focal": {"class": "MeasurementsResource", "name": "getMeasurements", "signature": "Collection<Collection<MeasurementDTO>> getMeasurements(ResultDescriptorDTO descriptorDTO, Resource resource, Optional<TimestampParam> start, Optional<TimestampParam> end, Optional<DurationParam> resolution, Optional<String> contextId)"... |
16204287_28 | class IrmGPCM extends AbstractItemResponseModel {
public double probability(double theta, double[] iparam, int category, double D){
double t = numer(theta, iparam, category, D);
double b = denom(theta, iparam, D);
return t/b;
}
public IrmGPCM(double discrimination, double[] step, ... | System.out.println("Probability test");
double[] theta = {-4.0, -3.9, -3.8, -3.7, -3.6, -3.5, -3.4, -3.3, -3.2, -3.1, -3.0, -2.9, -2.8, -2.7, -2.6,
-2.5, -2.4, -2.3, -2.2, -2.1, -2.0, -1.9, -1.8, -1.7, -1.6, -1.5, -1.4, -1.3, -1.2, -1.1,
-1.0, -0.9, -0.8, -0.7, -0.6, -0.... | [FOCAL] public double IrmGPCM.probability(double theta, double[] iparam, int category, double D)
[CLASS] class IrmGPCM extends AbstractItemResponseModel
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] double denom(double theta, double[] iparam, double D); double numer(double theta,... | class IrmGPCM extends AbstractItemResponseModel {
public double probability(double theta, double[] iparam, int category, double D){
double t = numer(theta, iparam, category, D);
double b = denom(theta, iparam, D);
return t/b;
}
public IrmGPCM(double discrimination, double[] step, ... | false | ok | {"focal": {"class": "IrmGPCM", "name": "probability", "signature": "double probability(double theta, double[] iparam, int category, double D)", "start_line": 3, "modifiers": "public", "params": [{"name": "theta", "type": "double"}, {"name": "iparam", "type": "double[]"}, {"name": "category", "type": "int"}, {"name": "D... | |
16283971_24 | class Sort {
public int[] sort(int[] m)
{
if (m.length <= 1)
return m;
int middle = m.length / 2;
int[] left = Arrays.copyOf(m,middle);
int[] right = Arrays.copyOfRange(m,middle,m.length);
right = sort(right);
left = sort(left);
int[... | for (int i = 0; i < 50; i++) {
int[] random = getEqualArray(new Random().nextInt(200)+1);
assertArrayEquals(sort(random), new Sort().sort(random));
}
}
} | [FOCAL] public int[] Sort.sort(int[] m)
[CLASS] class Sort
[METRICS] loc=14 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] int[] merge(int[] left, int[] right)
[CALLS-EXTERNAL] Arrays.copyOf/2, Arrays.copyOfRange/3, sort/1 (inherited)
[PATH1] if(m.length <= 1)=T -> return m
[PATH2] if(m.length <=... | /* static context
[FOCAL] public int[] Sort.sort(int[] m)
[PATH1] if(m.length <= 1)=T -> return m
[PATH2] if(m.length <= 1)=F -> return result
[INPUTS] branches=m | result=m
[CALLS-INTERNAL] int[] merge(int[] left, int[] right)
[CALLS-EXTERNAL] Arrays.copyOf/2, Arrays.copyOfRange/3, sort/1 (inherited)
*/
| /* static context
[FOCAL] public int[] Sort.sort(int[] m)
[PATH1] if(m.length <= 1)=T -> return m
[PATH2] if(m.length <= 1)=F -> return result
[INPUTS] branches=m | result=m
[CALLS-INTERNAL] int[] merge(int[] left, int[] right)
[CALLS-EXTERNAL] Arrays.copyOf/2, Arrays.copyOfRange/3, sort/1 (inherited)
*/
class Sort {
... | true | ok | {"focal": {"class": "Sort", "name": "sort", "signature": "int[] sort(int[] m)", "start_line": 3, "modifiers": "public", "params": [{"name": "m", "type": "int[]"}], "return_type": "int[]"}, "class_info": {"name": "Sort", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [... |
16293572_17 | class RedisStore extends AbstractLifecycle implements RedisStoreManagement, Store {
@Override
public String[] keys() {
return this.lockTemplate.withReadLock(new LockTemplate.LockedOperation<String[]>() {
@Override
public String[] invoke() {
try {
... | Set<String> response = new HashSet<String>(Arrays.asList("test-id"));
when(this.jedisClient.getSessions(SESSIONS_KEY)).thenReturn(response);
String[] result = this.store.keys();
assertEquals(1, result.length);
assertArrayEquals(new String[]{"test-id"}, result);
}
} | [FOCAL] @Override public String[] RedisStore.keys()
[CLASS] class RedisStore extends AbstractLifecycle implements RedisStoreManagement, Store
[METRICS] loc=16 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] String getSessionKeyPrefix()
[CALLS-EXTERNAL] this.lockTemplate.withReadLock/1, RedisStore.... | /* static context
[FOCAL] @Override public String[] RedisStore.keys()
[COLLABORATORS] field lockTemplate withReadLock/1
[CALLS-INTERNAL] String getSessionKeyPrefix()
[FIELDS] read=lockTemplate
[NEW] LockTemplate.LockedOperation<String[]>
[CALLS-EXTERNAL] this.lockTemplate.withReadLock/1, RedisStore.this.jedisClient.get... | /* static context
[FOCAL] @Override public String[] RedisStore.keys()
[COLLABORATORS] field lockTemplate withReadLock/1
[CALLS-INTERNAL] String getSessionKeyPrefix()
[FIELDS] read=lockTemplate
[NEW] LockTemplate.LockedOperation<String[]>
[CALLS-EXTERNAL] this.lockTemplate.withReadLock/1, RedisStore.this.jedisClient.get... | true | ok | {"focal": {"class": "RedisStore", "name": "keys", "signature": "String[] keys()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String[]"}, "class_info": {"name": "RedisStore", "kind": "class", "modifiers": "", "superclass": "AbstractLifecycle", "interfaces": "RedisStoreManagement, Sto... |
16294920_10 | class RaftSessionInvoker {
public CompletableFuture<byte[]> invoke(PrimitiveOperation operation) {
CompletableFuture<byte[]> future = new CompletableFuture<>();
switch (operation.id().type()) {
case COMMAND:
context.execute(() -> invokeCommand(operation, future));
break;
case QUER... | RaftSessionConnection connection = mock(RaftSessionConnection.class);
when(connection.command(any(CommandRequest.class)))
.thenReturn(CompletableFuture.completedFuture(CommandResponse.builder()
.withStatus(RaftResponse.Status.OK)
.withIndex(10)
.withResult("Hello worl... | [FOCAL] public CompletableFuture<byte[]> RaftSessionInvoker.invoke(PrimitiveOperation operation)
[CLASS] class RaftSessionInvoker
[METRICS] loc=14 cc=3 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-INTERNAL] void invokeCommand(PrimitiveOperation operation, CompletableFuture<byte[]> future); void invokeQuery(Pr... | /* static context
[FOCAL] public CompletableFuture<byte[]> RaftSessionInvoker.invoke(PrimitiveOperation operation)
[THROWS-WHEN] IllegalArgumentException when switch(operation.id().type())=default
[PATH1] switch(operation.id().type())=case COMMAND -> return future
[PATH2] switch(operation.id().type())=default -> throw ... | /* static context
[FOCAL] public CompletableFuture<byte[]> RaftSessionInvoker.invoke(PrimitiveOperation operation)
[THROWS-WHEN] IllegalArgumentException when switch(operation.id().type())=default
[PATH1] switch(operation.id().type())=case COMMAND -> return future
[PATH2] switch(operation.id().type())=default -> throw ... | true | ok | {"focal": {"class": "RaftSessionInvoker", "name": "invoke", "signature": "CompletableFuture<byte[]> invoke(PrimitiveOperation operation)", "start_line": 3, "modifiers": "public", "params": [{"name": "operation", "type": "PrimitiveOperation"}], "return_type": "CompletableFuture<byte[]>"}, "class_info": {"name": "RaftSes... |
16319386_107 | class DefaultBuildContextState implements Serializable {
public static DefaultBuildContextState emptyState() {
return new DefaultBuildContextState(Collections.<String, Serializable>emptyMap() // configuration
, Collections.<Object, ResourceHolder<?>>emptyMap() // inputs //
, Collections.<File>emp... | Assert.assertTrue(DefaultBuildContextState.loadFrom(temp.newFile()).configuration.isEmpty());
}
} | [FOCAL] public static DefaultBuildContextState DefaultBuildContextState.emptyState()
[CLASS] class DefaultBuildContextState implements Serializable
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Collections.emptyMap/0, Collections.emptySet/0
[NEW] DefaultBuildContextState
[CLASS-... | /* static context
[FOCAL] public static DefaultBuildContextState DefaultBuildContextState.emptyState()
[NEW] DefaultBuildContextState
[CALLS-EXTERNAL] Collections.emptyMap/0, Collections.emptySet/0
*/
| /* static context
[FOCAL] public static DefaultBuildContextState DefaultBuildContextState.emptyState()
[NEW] DefaultBuildContextState
[CALLS-EXTERNAL] Collections.emptyMap/0, Collections.emptySet/0
*/
class DefaultBuildContextState implements Serializable {
public static DefaultBuildContextState emptyState() {
r... | true | ok | {"focal": {"class": "DefaultBuildContextState", "name": "emptyState", "signature": "DefaultBuildContextState emptyState()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "DefaultBuildContextState"}, "class_info": {"name": "DefaultBuildContextState", "kind": "class", "modifiers": "", "super... |
16338837_0 | class Upper {
@Path("rest/upper/{param}")
@GET
public String toUpper(@PathParam("param") String param) {
return param.toUpperCase();
}
}
class UpperTest {
@Test
public void testUpper() {
| Upper upper = new Upper();
assertEquals("FOO",upper.toUpper("foo"));
}
} | [FOCAL] @Path("rest/upper/{param}") @GET public String Upper.toUpper(String param)
[CLASS] class Upper
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] String.toUpperCase/0
[INPUTS] branches=- | result=param
[DATAFLOW] param@param->L4
[TEST] UpperTest: @Test public void testUpper() | /* static context
[FOCAL] @Path("rest/upper/{param}") @GET public String Upper.toUpper(String param)
[INPUTS] branches=- | result=param
[CALLS-EXTERNAL] String.toUpperCase/0
*/
| /* static context
[FOCAL] @Path("rest/upper/{param}") @GET public String Upper.toUpper(String param)
[INPUTS] branches=- | result=param
[CALLS-EXTERNAL] String.toUpperCase/0
*/
class Upper {
@Path("rest/upper/{param}")
@GET
public String toUpper(@PathParam("param") String param) {
return param.toUp... | true | ok | {"focal": {"class": "Upper", "name": "toUpper", "signature": "String toUpper(String param)", "start_line": 3, "modifiers": "@Path(\"rest/upper/{param}\") @GET public", "params": [{"name": "param", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Upper", "kind": "class", "modifiers": "", "superclass... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.