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 |
|---|---|---|---|---|---|---|---|---|
8920316_6 | class AdhocProject implements Project,
FileOwnerQueryImplementation, ProjectConfiguration,
ProjectActionPerformer, ActionProvider, LogicalViewProvider {
public List<Favorite> favorites() {
List<Favorite> favorites = new ArrayList<>();
try {
Preferences forProject = prefe... | java.util.List<Favorite> favs = new ArrayList<>();
char[] chars = new char[]{'d', 'c', 'b', 'a'};
int ix = 1;
for (char c : chars) {
favs.add(new Favorite(ix *= 10, "foo/" + c));
}
project.saveFavorites(favs);
java.util.List<Favorite> nue = project.fav... | [FOCAL] public List<Favorite> AdhocProject.favorites()
[CLASS] class AdhocProject implements Project, FileOwnerQueryImplementation, ProjectConfiguration, ProjectActionPerformer, ActionProvider, LogicalViewProvider
[METRICS] loc=24 cc=6 branches=3 loops=1 returns=1 throws=0 nesting=5
[CALLS-INTERNAL] Preferences prefere... | /* static context
[FOCAL] public List<Favorite> AdhocProject.favorites()
[PATH1] if(forProject != null)=T -> foreach(String ch : s)=T -> if(forFile != null)=T -> if(val > 0 && name != null)=T -> exit loop -> return favorites
[PATH2] try-body throws -> return favorites
[PATH3] if(forProject != null)=F -> return favorite... | /* static context
[FOCAL] public List<Favorite> AdhocProject.favorites()
[PATH1] if(forProject != null)=T -> foreach(String ch : s)=T -> if(forFile != null)=T -> if(val > 0 && name != null)=T -> exit loop -> return favorites
[PATH2] try-body throws -> return favorites
[PATH3] if(forProject != null)=F -> return favorite... | true | ok | {"focal": {"class": "AdhocProject", "name": "favorites", "signature": "List<Favorite> favorites()", "start_line": 5, "modifiers": "public", "params": [], "return_type": "List<Favorite>"}, "class_info": {"name": "AdhocProject", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Project, FileOwnerQueryI... |
8975145_19 | class TwoSecondIntersectionFinder implements FragmentIntersectionFinder {
public long[] sampleNumbers(Track track, Movie movie) {
List<TimeToSampleBox.Entry> entries = track.getDecodingTimeEntries();
double trackLength = 0;
for (Track thisTrack : movie.getTracks()) {
double thi... | Movie m = MovieCreator.build(Channels.newChannel(TwoSecondIntersectionFinderTest.class.getResourceAsStream("/Beethoven - Bagatelle op.119 no.11 i.m4a")));
TwoSecondIntersectionFinder intersectionFinder = new TwoSecondIntersectionFinder();
long[] s = intersectionFinder.sampleNumbers(m.getTracks()... | [FOCAL] public long[] TwoSecondIntersectionFinder.sampleNumbers(Track track, Movie movie)
[CLASS] class TwoSecondIntersectionFinder implements FragmentIntersectionFinder
[METRICS] loc=43 cc=9 branches=4 loops=4 returns=1 throws=0 nesting=3
[CALLS-INTERNAL] long getDuration(Track track)
[CALLS-EXTERNAL] Track.getDecodin... | /* static context
[FOCAL] public long[] TwoSecondIntersectionFinder.sampleNumbers(Track track, Movie movie)
[PATH1] foreach(Track thisTrack : movie.getTracks())=T -> if(trackLength < thisTracksLength)=T -> exit loop -> if(fragmentCount < 1)=T -> foreach(TimeToSampleBox.Entry entry : entries)=T -> for(i < entry.getCount... | /* static context
[FOCAL] public long[] TwoSecondIntersectionFinder.sampleNumbers(Track track, Movie movie)
[PATH1] foreach(Track thisTrack : movie.getTracks())=T -> if(trackLength < thisTracksLength)=T -> exit loop -> if(fragmentCount < 1)=T -> foreach(TimeToSampleBox.Entry entry : entries)=T -> for(i < entry.getCount... | true | ok | {"focal": {"class": "TwoSecondIntersectionFinder", "name": "sampleNumbers", "signature": "long[] sampleNumbers(Track track, Movie movie)", "start_line": 3, "modifiers": "public", "params": [{"name": "track", "type": "Track"}, {"name": "movie", "type": "Movie"}], "return_type": "long[]"}, "class_info": {"name": "TwoSeco... |
9004636_25 | class FellowPlayer extends ReferencePoint {
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
FellowPlayer other = (FellowPlayer) obj;
if (mId != other.mId)
return false;
if (mNickname == null)
{
if (other.mNickname != null)
... | fellowPlayerCompare = new FellowPlayer(5, null, true, 130.7, 70.3, 0);
assert(!fellowPlayerCompare.equals(fellowPlayerOriginal));
}
} | [FOCAL] @Override public boolean FellowPlayer.equals(Object obj)
[CLASS] class FellowPlayer extends ReferencePoint
[METRICS] loc=24 cc=11 branches=10 loops=0 returns=9 throws=0 nesting=2
[CALLS-EXTERNAL] ReferencePoint.equals/1, mNickname.equals/1, Double.doubleToLongBits/1, mStatus.equals/1
[PATH1] if(this == obj)=F -... | /* static context
[FOCAL] @Override public boolean FellowPlayer.equals(Object obj)
[PATH1] if(this == obj)=F -> if(!super.equals(obj))=F -> if(mId != other.mId)=F -> if(mNickname == null)=T -> if(other.mNickname != null)=F -> if(Double.doubleToLongBits(mOrientation) != Double.doubleToLongBits(other.mOrientation))=F -> ... | /* static context
[FOCAL] @Override public boolean FellowPlayer.equals(Object obj)
[PATH1] if(this == obj)=F -> if(!super.equals(obj))=F -> if(mId != other.mId)=F -> if(mNickname == null)=T -> if(other.mNickname != null)=F -> if(Double.doubleToLongBits(mOrientation) != Double.doubleToLongBits(other.mOrientation))=F -> ... | true | ok | {"focal": {"class": "FellowPlayer", "name": "equals", "signature": "boolean equals(Object obj)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "obj", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "FellowPlayer", "kind": "class", "modifiers": "", "superclass": "ReferencePo... |
9020655_0 | class GuavaUtils {
public static <T> boolean isPresent(T t){
Optional<T>optionalObj = Optional.fromNullable(t);
return optionalObj.isPresent();
}
}
class GuavaUtilsTest {
@Test
public void isPresentTest(){
| B1 b = null;
assertEquals(false, GuavaUtils.isPresent(b));
b = new B1();
assertEquals(true, GuavaUtils.isPresent(b));
}
} | [FOCAL] public static boolean GuavaUtils.isPresent(T t)
[CLASS] class GuavaUtils
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Optional.fromNullable/1, Optional<T>.isPresent/0
[INPUTS] branches=- | result=t
[DATAFLOW] optionalObj@L2->L3; t@param->L2
[TEST] GuavaUtilsTest: @Test p... | /* static context
[FOCAL] public static boolean GuavaUtils.isPresent(T t)
[INPUTS] branches=- | result=t
[CALLS-EXTERNAL] Optional.fromNullable/1, Optional<T>.isPresent/0
*/
| /* static context
[FOCAL] public static boolean GuavaUtils.isPresent(T t)
[INPUTS] branches=- | result=t
[CALLS-EXTERNAL] Optional.fromNullable/1, Optional<T>.isPresent/0
*/
class GuavaUtils {
public static <T> boolean isPresent(T t){
Optional<T>optionalObj = Optional.fromNullable(t);
return optionalObj.isPresent... | true | ok | {"focal": {"class": "GuavaUtils", "name": "isPresent", "signature": "boolean isPresent(T t)", "start_line": 3, "modifiers": "public static", "params": [{"name": "t", "type": "T"}], "return_type": "boolean"}, "class_info": {"name": "GuavaUtils", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "... |
9040104_3 | class LicenseResolver {
public static License read(final String license) {
final String trimmedLicense = license.trim();
if (sLicenses.containsKey(trimmedLicense)) {
return sLicenses.get(trimmedLicense);
} else {
throw new IllegalStateException(String.format("no such... | final License license = LicenseResolver.read("MIT License");
assertNotNull(license);
assertEquals("MIT License", license.getName());
}
} | [FOCAL] public static License LicenseResolver.read(String license)
[CLASS] class LicenseResolver
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] String.trim/0, sLicenses.containsKey/1, sLicenses.get/1, String.format/2
[NEW] IllegalStateException
[EXCEPTIONS] throws IllegalStateExce... | /* static context
[FOCAL] public static License LicenseResolver.read(String license)
[THROWS-WHEN] IllegalStateException when !sLicenses.containsKey(trimmedLicense)
[PATH1] if(sLicenses.containsKey(trimmedLicense))=T -> return sLicenses.get(trimmedLicense)
[PATH2] if(sLicenses.containsKey(trimmedLicense))=F -> throw ne... | /* static context
[FOCAL] public static License LicenseResolver.read(String license)
[THROWS-WHEN] IllegalStateException when !sLicenses.containsKey(trimmedLicense)
[PATH1] if(sLicenses.containsKey(trimmedLicense))=T -> return sLicenses.get(trimmedLicense)
[PATH2] if(sLicenses.containsKey(trimmedLicense))=F -> throw ne... | true | ok | {"focal": {"class": "LicenseResolver", "name": "read", "signature": "License read(String license)", "start_line": 3, "modifiers": "public static", "params": [{"name": "license", "type": "String"}], "return_type": "License"}, "class_info": {"name": "LicenseResolver", "kind": "class", "modifiers": "", "superclass": null,... |
9054533_480 | class StateManager implements RouteAndActivityStateGetter, IterationStartsListener, RuinListener, InsertionStartsListener, JobInsertedListener, InsertionEndsListener {
public StateId createStateId(String name) {
if (createdStateIds.containsKey(name)) return createdStateIds.get(name);
if (stateIndex... | StateManager stateManager = new StateManager(vrpMock);
StateId stateId = stateManager.createStateId("foo-state");
Assert.assertEquals(21, stateId.getIndex());
}
} | [FOCAL] public StateId StateManager.createStateId(String name)
[CLASS] class StateManager implements RouteAndActivityStateGetter, IterationStartsListener, RuinListener, InsertionStartsListener, JobInsertedListener, InsertionEndsListener
[METRICS] loc=14 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERN... | /* static context
[FOCAL] public StateId StateManager.createStateId(String name)
[PATH1] if(createdStateIds.containsKey(name))=F -> if(stateIndexCounter >= activityStates[0].length)=T -> return id
[PATH2] if(createdStateIds.containsKey(name))=T -> return createdStateIds.get(name)
[PATH3] if(createdStateIds.containsKey(... | /* static context
[FOCAL] public StateId StateManager.createStateId(String name)
[PATH1] if(createdStateIds.containsKey(name))=F -> if(stateIndexCounter >= activityStates[0].length)=T -> return id
[PATH2] if(createdStateIds.containsKey(name))=T -> return createdStateIds.get(name)
[PATH3] if(createdStateIds.containsKey(... | true | ok | {"focal": {"class": "StateManager", "name": "createStateId", "signature": "StateId createStateId(String name)", "start_line": 3, "modifiers": "public", "params": [{"name": "name", "type": "String"}], "return_type": "StateId"}, "class_info": {"name": "StateManager", "kind": "class", "modifiers": "", "superclass": null, ... |
9078409_10 | class CloseableIterators {
public static <T> CloseableIterator<T> limit(final CloseableIterator<T> iterator, final int limitSize) {
return wrap(Iterators.limit(iterator, limitSize), iterator);
}
private CloseableIterators();
public static CloseableIterator<T> fromStream(Stream<T> stream);
... | CloseableIterator<Integer> firstThree = limit(testIterator(), 3);
assertTrue(elementsEqual(asList(1, 2, 3).iterator(), firstThree));
assertFalse(firstThree.hasNext());
firstThree.close();
}
} | [FOCAL] public static CloseableIterator<T> CloseableIterators.limit(CloseableIterator<T> iterator, int limitSize)
[CLASS] class CloseableIterators
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] CloseableIterator<T> wrap(Iterator<T> iterator, AutoCloseable closeable)
[CALLS-EXTERNA... | /* static context
[FOCAL] public static CloseableIterator<T> CloseableIterators.limit(CloseableIterator<T> iterator, int limitSize)
[INPUTS] branches=- | result=iterator, limitSize
[CALLS-INTERNAL] CloseableIterator<T> wrap(Iterator<T> iterator, AutoCloseable closeable)
[CALLS-EXTERNAL] Iterators.limit/2
*/
| /* static context
[FOCAL] public static CloseableIterator<T> CloseableIterators.limit(CloseableIterator<T> iterator, int limitSize)
[INPUTS] branches=- | result=iterator, limitSize
[CALLS-INTERNAL] CloseableIterator<T> wrap(Iterator<T> iterator, AutoCloseable closeable)
[CALLS-EXTERNAL] Iterators.limit/2
*/
class Close... | true | ok | {"focal": {"class": "CloseableIterators", "name": "limit", "signature": "CloseableIterator<T> limit(CloseableIterator<T> iterator, int limitSize)", "start_line": 3, "modifiers": "public static", "params": [{"name": "iterator", "type": "CloseableIterator<T>"}, {"name": "limitSize", "type": "int"}], "return_type": "Close... |
9078421_24 | class FeatureRegistry {
public AccumuloFeatureConfig transformForClass(Class<? extends Feature> clazz) {
AccumuloFeatureConfig featureConfig = classToTransform.get(clazz);
if(featureConfig == null) {
for(Map.Entry<Class, AccumuloFeatureConfig> clazzes : classToTransform.entrySet()) {
... |
FeatureRegistry registry = new FeatureRegistry(new MetricFeatureConfig());
assertNotNull(registry.transformForClass(MyTestFeature.class));
}
} | [FOCAL] public AccumuloFeatureConfig FeatureRegistry.transformForClass(Class<? extends Feature> clazz)
[CLASS] class FeatureRegistry
[METRICS] loc=13 cc=4 branches=2 loops=1 returns=1 throws=0 nesting=3
[CALLS-EXTERNAL] classToTransform.get/1, classToTransform.entrySet/0, clazzes.getKey().isAssignableFrom/1, Map.Entry<... | /* static context
[FOCAL] public AccumuloFeatureConfig FeatureRegistry.transformForClass(Class<? extends Feature> clazz)
[PATH1] if(featureConfig == null)=T -> foreach(Map.Entry<Class, AccumuloFeatureConfig> clazzes : classToTransform.entrySet())=T -> if(clazzes.getKey().isAssignableFrom(clazz))=T -> exit loop -> retur... | /* static context
[FOCAL] public AccumuloFeatureConfig FeatureRegistry.transformForClass(Class<? extends Feature> clazz)
[PATH1] if(featureConfig == null)=T -> foreach(Map.Entry<Class, AccumuloFeatureConfig> clazzes : classToTransform.entrySet())=T -> if(clazzes.getKey().isAssignableFrom(clazz))=T -> exit loop -> retur... | true | ok | {"focal": {"class": "FeatureRegistry", "name": "transformForClass", "signature": "AccumuloFeatureConfig transformForClass(Class<? extends Feature> clazz)", "start_line": 3, "modifiers": "public", "params": [{"name": "clazz", "type": "Class<? extends Feature>"}], "return_type": "AccumuloFeatureConfig"}, "class_info": {"... |
9090323_0 | class ZNodePath extends ZNodeLabelVector {
public static String canonicalize(final String path) {
final int length = path.length();
int lastSlash = -1;
StringBuilder builder = null;
for (int i=0; i<length; ++i) {
char c = path.charAt(i);
if ((c == SLASH) || (... | assertEquals("/", ZNodePath.canonicalize("/"));
assertEquals("/", ZNodePath.canonicalize("//"));
assertEquals("/", ZNodePath.canonicalize("///"));
assertEquals("/a", ZNodePath.canonicalize("/a"));
assertEquals("/a", ZNodePath.canonicalize("/a/"));
assertEquals("/", ZNodeP... | [FOCAL] public static String ZNodePath.canonicalize(String path)
[CLASS] class ZNodePath extends ZNodeLabelVector
[METRICS] loc=70 cc=19 branches=16 loops=2 returns=1 throws=3 nesting=8
[CALLS-EXTERNAL] String.length/0, String.charAt/1, new StringBuilder(length).append/3, ZNodeLabel.validated/3, ZNodeLabel.self().equal... | /* static context
[FOCAL] public static String ZNodePath.canonicalize(String path)
[THROWS-WHEN] IllegalArgumentException when i<length && (c == SLASH) || (i == length - 1) && i > 0 && (c == SLASH) && (lastSlash == i-1) && builder == null && c == SLASH && builder == null && canonicalized.isEmpty()
[THROWS-WHEN] Illegal... | /* static context
[FOCAL] public static String ZNodePath.canonicalize(String path)
[THROWS-WHEN] IllegalArgumentException when i<length && (c == SLASH) || (i == length - 1) && i > 0 && (c == SLASH) && (lastSlash == i-1) && builder == null && c == SLASH && builder == null && canonicalized.isEmpty()
[THROWS-WHEN] Illegal... | true | ok | {"focal": {"class": "ZNodePath", "name": "canonicalize", "signature": "String canonicalize(String path)", "start_line": 3, "modifiers": "public static", "params": [{"name": "path", "type": "String"}], "return_type": "String"}, "class_info": {"name": "ZNodePath", "kind": "class", "modifiers": "", "superclass": "ZNodeLab... |
9120355_0 | class NameUtilities {
public static String getFullName(Class c) {
if (c == null) {
throw new IllegalArgumentException("class cannot be null");
}
StringBuilder name = new StringBuilder();
name.append(c.getPackage().getName()).append(".");
Class klaus = c;
List<Class> enclosingClasses = new ArrayList<C... | String expected =
NameUtilitiesTest.class.getPackage().getName()+"."
+ NameUtilitiesTest.class.getSimpleName()+"."
+ "Inner"
;
String name = NameUtilities.getFullName(Inner.class);
Assert.assertEquals(expected, name);
}
} | [FOCAL] public static String NameUtilities.getFullName(Class c)
[CLASS] class NameUtilities
[METRICS] loc=22 cc=4 branches=1 loops=2 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] name.append(c.getPackage().getName()).append/1, StringBuilder.append/1, c.getPackage().getName/0, Class.getPackage/0, Class.getEnclosingClass... | /* static context
[FOCAL] public static String NameUtilities.getFullName(Class c)
[THROWS-WHEN] IllegalArgumentException when c == null
[PATH1] if(c == null)=F -> while((klaus = klaus.getEnclosingClass()) != null)=T -> exit loop -> for(i >= 0)=F -> return name.toString()
[PATH2] if(c == null)=T -> throw new IllegalArgu... | /* static context
[FOCAL] public static String NameUtilities.getFullName(Class c)
[THROWS-WHEN] IllegalArgumentException when c == null
[PATH1] if(c == null)=F -> while((klaus = klaus.getEnclosingClass()) != null)=T -> exit loop -> for(i >= 0)=F -> return name.toString()
[PATH2] if(c == null)=T -> throw new IllegalArgu... | true | ok | {"focal": {"class": "NameUtilities", "name": "getFullName", "signature": "String getFullName(Class c)", "start_line": 3, "modifiers": "public static", "params": [{"name": "c", "type": "Class"}], "return_type": "String"}, "class_info": {"name": "NameUtilities", "kind": "class", "modifiers": "", "superclass": null, "inte... |
9121658_5 | class QueryUtils {
public static PrefixMapping usedPrefixes(Query query, PrefixMapping global) {
PrefixMapping local = query.getPrefixMapping();
PrefixMapping pm = global == null ? local : new PrefixMapping2(global, local);
PrefixMapping result = usedReferencePrefixes(query, pm);
re... | Query query = QueryFactory.create(String.join("\n",
"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>",
"PREFIX foo: <http://example.org/foo/>",
"PREFIX bar: <http://example.org/bar/>",
"PREFIX baz: <http://example.org/baz/>",
"SELECT * {",
... | [FOCAL] public static PrefixMapping QueryUtils.usedPrefixes(Query query, PrefixMapping global)
[CLASS] class QueryUtils
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] PrefixMapping usedReferencePrefixes(Query query, PrefixMapping pm)
[CALLS-EXTERNAL] Query.getPrefixMapping/0
[NEW]... | /* static context
[FOCAL] public static PrefixMapping QueryUtils.usedPrefixes(Query query, PrefixMapping global)
[INPUTS] branches=- | result=global, query
[COLLABORATORS] param query:Query getPrefixMapping/0
[CALLS-INTERNAL] PrefixMapping usedReferencePrefixes(Query query, PrefixMapping pm)
[NEW] PrefixMapping2
[CALLS... | /* static context
[FOCAL] public static PrefixMapping QueryUtils.usedPrefixes(Query query, PrefixMapping global)
[INPUTS] branches=- | result=global, query
[COLLABORATORS] param query:Query getPrefixMapping/0
[CALLS-INTERNAL] PrefixMapping usedReferencePrefixes(Query query, PrefixMapping pm)
[NEW] PrefixMapping2
[CALLS... | true | ok | {"focal": {"class": "QueryUtils", "name": "usedPrefixes", "signature": "PrefixMapping usedPrefixes(Query query, PrefixMapping global)", "start_line": 3, "modifiers": "public static", "params": [{"name": "query", "type": "Query"}, {"name": "global", "type": "PrefixMapping"}], "return_type": "PrefixMapping"}, "class_info... |
9143933_12 | class HashBasedHipsterGraph implements HipsterMutableGraph<V,E> {
@Override
public boolean remove(V v){
// Remove all edges related to v
Set<GraphEdge<V, E>> edges = this.connected.get(v);
if (edges == null) return false;
for(Iterator<GraphEdge<V,E>> it = edges.iterator(); it.h... | graph.remove("v1");
assertFalse(Sets.newHashSet(graph.vertices()).contains("v1"));
}
} | [FOCAL] @Override public boolean HashBasedHipsterGraph.remove(V v)
[CLASS] class HashBasedHipsterGraph implements HipsterMutableGraph<V,E>
[METRICS] loc=22 cc=5 branches=2 loops=2 returns=2 throws=0 nesting=3
[CALLS-EXTERNAL] this.connected.get/1, Set<GraphEdge<V, E>>.iterator/0, Iterator<GraphEdge<V,E>>.hasNext/0, Ite... | /* static context
[FOCAL] @Override public boolean HashBasedHipsterGraph.remove(V v)
[PATH1] if(edges == null)=F -> for(it.hasNext())=T -> for(it2.hasNext())=T -> if(edge2.getVertex1().equals(v) || edge2.getVertex2().equals(v))=T -> exit loop -> exit loop -> return true
[PATH2] if(edges == null)=T -> return false
[PATH... | /* static context
[FOCAL] @Override public boolean HashBasedHipsterGraph.remove(V v)
[PATH1] if(edges == null)=F -> for(it.hasNext())=T -> for(it2.hasNext())=T -> if(edge2.getVertex1().equals(v) || edge2.getVertex2().equals(v))=T -> exit loop -> exit loop -> return true
[PATH2] if(edges == null)=T -> return false
[PATH... | true | ok | {"focal": {"class": "HashBasedHipsterGraph", "name": "remove", "signature": "boolean remove(V v)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "v", "type": "V"}], "return_type": "boolean"}, "class_info": {"name": "HashBasedHipsterGraph", "kind": "class", "modifiers": "", "superclass": null, "i... |
9158616_17 | class OrderMapper1_12 implements OrderMapper {
@Override
public EncounterTransaction.DrugOrder mapDrugOrder(DrugOrder openMRSDrugOrder) {
EncounterTransaction.DrugOrder drugOrder = new EncounterTransaction.DrugOrder();
drugOrder.setUuid(openMRSDrugOrder.getUuid());
if (openMRSDrugOrder.... |
DrugOrder openMrsDrugOrder = drugOrder(CareSetting.CareSettingType.OUTPATIENT, 3, "3-0-2", 5, "before meals", "boil in water", null, "ORD-100");
Concept concept = concept("newConcept", "newConceptDataType", "newConceptUuid");
openMrsDrugOrder.setConcept(concept);
EncounterTransaction.D... | [FOCAL] @Override public EncounterTransaction.DrugOrder OrderMapper1_12.mapDrugOrder(DrugOrder openMRSDrugOrder)
[CLASS] class OrderMapper1_12 implements OrderMapper
[METRICS] loc=69 cc=7 branches=6 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] String getConceptName(Concept concept)
[CALLS-EXTERNAL] EncounterTr... | class OrderMapper1_12 implements OrderMapper {
@Override
public EncounterTransaction.DrugOrder mapDrugOrder(DrugOrder openMRSDrugOrder) {
EncounterTransaction.DrugOrder drugOrder = new EncounterTransaction.DrugOrder();
drugOrder.setUuid(openMRSDrugOrder.getUuid());
if (openMRSDrugOrder.... | false | ok | {"focal": {"class": "OrderMapper1_12", "name": "mapDrugOrder", "signature": "EncounterTransaction.DrugOrder mapDrugOrder(DrugOrder openMRSDrugOrder)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "openMRSDrugOrder", "type": "DrugOrder"}], "return_type": "EncounterTransaction.DrugOrder"}, "class... | |
9165045_20 | class ShapePathReader implements ElementReader<ShapePath> {
@Override
public ShapePath read(Resource resource) {
checkNotNull(resource);
ShapePathImpl.ShapePathImplBuilder shapePathBuilder = ShapePathImpl.builder();
shapePathBuilder.element(resource);
shapePathBuilder.jenaPat... | assertThat(ShapePathReader.create().read(shaclPath).asSparqlPropertyPath())
.isEqualTo(propertyPathString);
}
} | [FOCAL] @Override public ShapePath ShapePathReader.read(Resource resource)
[CLASS] class ShapePathReader implements ElementReader<ShapePath>
[METRICS] loc=12 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Path readPath(Resource resource)
[CALLS-EXTERNAL] checkNotNull/1 (inherited), ShapePathImpl.... | /* static context
[FOCAL] @Override public ShapePath ShapePathReader.read(Resource resource)
[CALLS-INTERNAL] Path readPath(Resource resource)
[CALLS-EXTERNAL] checkNotNull/1 (inherited), ShapePathImpl.builder/0, ShapePathImpl.ShapePathImplBuilder.element/1, ShapePathImpl.ShapePathImplBuilder.jenaPath/1, ShapePathImpl.... | /* static context
[FOCAL] @Override public ShapePath ShapePathReader.read(Resource resource)
[CALLS-INTERNAL] Path readPath(Resource resource)
[CALLS-EXTERNAL] checkNotNull/1 (inherited), ShapePathImpl.builder/0, ShapePathImpl.ShapePathImplBuilder.element/1, ShapePathImpl.ShapePathImplBuilder.jenaPath/1, ShapePathImpl.... | true | ok | {"focal": {"class": "ShapePathReader", "name": "read", "signature": "ShapePath read(Resource resource)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "resource", "type": "Resource"}], "return_type": "ShapePath"}, "class_info": {"name": "ShapePathReader", "kind": "class", "modifiers": "", "super... |
9178484_0 | class ModelRef {
static
public boolean validateId(String id){
return (id != null) && (id).matches(REGEX_ID);
}
public ModelRef(ModelRef modelRef);
public ModelRef(Principal owner, String id);
@Override public int hashCode();
@Override public boolean equals(Object object);
public Principal getOwner();
pr... | assertTrue(ModelRef.validateId("com.mycompany.Test"));
assertTrue(ModelRef.validateId("Test_v1"));
assertTrue(ModelRef.validateId("Test_v1.0"));
assertFalse(ModelRef.validateId("."));
assertFalse(ModelRef.validateId("-Test"));
}
} | [FOCAL] static public boolean ModelRef.validateId(String id)
[CLASS] class ModelRef
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] (id).matches/1
[INPUTS] branches=- | result=id
[DATAFLOW] id@param->L3
[CLASS-MEMBERS] ModelRef(ModelRef modelRef); ModelRef(Principal owner, String i... | /* static context
[FOCAL] static public boolean ModelRef.validateId(String id)
[INPUTS] branches=- | result=id
[CALLS-EXTERNAL] (id).matches/1
*/
| /* static context
[FOCAL] static public boolean ModelRef.validateId(String id)
[INPUTS] branches=- | result=id
[CALLS-EXTERNAL] (id).matches/1
*/
class ModelRef {
static
public boolean validateId(String id){
return (id != null) && (id).matches(REGEX_ID);
}
public ModelRef(ModelRef modelRef);
public ModelRef(... | true | ok | {"focal": {"class": "ModelRef", "name": "validateId", "signature": "boolean validateId(String id)", "start_line": 3, "modifiers": "static public", "params": [{"name": "id", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "ModelRef", "kind": "class", "modifiers": "", "superclass": null, "interfaces... |
9196478_7 | class JDBCMessageStore implements MessageStore {
@Override
public Message findByMessageId(String messageId, String messageDirection) {
Map<String,Object> fields = new HashMap<>();
fields.put("message_id",messageId);
fields.put("message_box",messageDirection);
List<Message> messa... | String contentType = "application/soap+xml";
File body = fileFromClasspath("simple-as4-receipt.xml");
String messageId = "testSoapMessage1";
assertStoredMessage(messageId, contentType, body, MessageType.SIGNAL_MESSAGE_WITH_USER_MESSAGE);
messageStore.updateMessage(messageId, Ebms... | [FOCAL] @Override public Message JDBCMessageStore.findByMessageId(String messageId, String messageDirection)
[CLASS] class JDBCMessageStore implements MessageStore
[METRICS] loc=11 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] Map<String,Object>.put/2, repositoryManager.selectMessageBy/1, List<M... | /* static context
[FOCAL] @Override public Message JDBCMessageStore.findByMessageId(String messageId, String messageDirection)
[PATH1] if(messages.size() > 0)=T -> return messages.get(0)
[PATH2] if(messages.size() > 0)=F -> return null
[COLLABORATORS] field repositoryManager selectMessageBy/1
[NEW] HashMap<>
[CALLS-EXT... | /* static context
[FOCAL] @Override public Message JDBCMessageStore.findByMessageId(String messageId, String messageDirection)
[PATH1] if(messages.size() > 0)=T -> return messages.get(0)
[PATH2] if(messages.size() > 0)=F -> return null
[COLLABORATORS] field repositoryManager selectMessageBy/1
[NEW] HashMap<>
[CALLS-EXT... | true | ok | {"focal": {"class": "JDBCMessageStore", "name": "findByMessageId", "signature": "Message findByMessageId(String messageId, String messageDirection)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "messageId", "type": "String"}, {"name": "messageDirection", "type": "String"}], "return_type": "Mes... |
9239163_1 | class HK2VerticleLoader extends AbstractVerticle {
@Override
public void stop(Future<Void> stopFuture) throws Exception {
classLoader = null;
parent = null;
Future<Void> future = Future.future();
future.setHandler(result -> {
// Destroy the service locator
... |
Verticle verticle = create(TestStopFailVerticle.class.getName());
verticle.stop(stopFuture);
verify(stopFuture, never()).complete();
verify(stopFuture).fail(any(Throwable.class));
}
} | [FOCAL] @Override public void HK2VerticleLoader.stop(Future<Void> stopFuture)
[CLASS] class HK2VerticleLoader extends AbstractVerticle
[METRICS] loc=32 cc=3 branches=1 loops=0 returns=0 throws=0 nesting=2
[CALLS-EXTERNAL] Future.future/0, Future<Void>.setHandler/1, ServiceLocatorFactory.getInstance().destroy/1, Service... | /* static context
[FOCAL] @Override public void HK2VerticleLoader.stop(Future<Void> stopFuture)
[PATH1] try-body throws
[PATH2] if(realVerticle != null)=T
[PATH3] if(realVerticle != null)=F
[COLLABORATORS] field result succeeded/0; param stopFuture:Future<Void> complete/0,fail/1; field realVerticle stop/1
[STATE] paren... | /* static context
[FOCAL] @Override public void HK2VerticleLoader.stop(Future<Void> stopFuture)
[PATH1] try-body throws
[PATH2] if(realVerticle != null)=T
[PATH3] if(realVerticle != null)=F
[COLLABORATORS] field result succeeded/0; param stopFuture:Future<Void> complete/0,fail/1; field realVerticle stop/1
[STATE] paren... | true | ok | {"focal": {"class": "HK2VerticleLoader", "name": "stop", "signature": "void stop(Future<Void> stopFuture) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "stopFuture", "type": "Future<Void>"}], "return_type": "void"}, "class_info": {"name": "HK2VerticleLoader", "kind": "class", ... |
9239473_13 | class DefaultJerseyOptions implements JerseyOptions, JerseyServerOptions {
@Override
public Set<Class<?>> getComponents() {
Set<Class<?>> set = new HashSet<>();
ClassLoader cl = Thread.currentThread().getContextClassLoader();
Consumer<JsonArray> reader = array -> {
if (arra... |
config.put(DefaultJerseyOptions.CONFIG_COMPONENTS, new JsonArray().add(MyObj.class.getName() + ".invalid"));
options.getComponents();
fail();
}
} | [FOCAL] @Override public Set<Class<?>> DefaultJerseyOptions.getComponents()
[CLASS] class DefaultJerseyOptions implements JerseyOptions, JerseyServerOptions
[METRICS] loc=25 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=3
[CALLS-EXTERNAL] Thread.currentThread().getContextClassLoader/0, Thread.currentThread/0, arra... | /* static context
[FOCAL] @Override public Set<Class<?>> DefaultJerseyOptions.getComponents()
[COLLABORATORS] field array size/0,getString/1; field config:JsonObject getJsonArray/2
[FIELDS] read=config:JsonObject
[NEW] HashSet<>, RuntimeException
[CALLS-EXTERNAL] Thread.currentThread().getContextClassLoader/0, Thread.c... | /* static context
[FOCAL] @Override public Set<Class<?>> DefaultJerseyOptions.getComponents()
[COLLABORATORS] field array size/0,getString/1; field config:JsonObject getJsonArray/2
[FIELDS] read=config:JsonObject
[NEW] HashSet<>, RuntimeException
[CALLS-EXTERNAL] Thread.currentThread().getContextClassLoader/0, Thread.c... | true | ok | {"focal": {"class": "DefaultJerseyOptions", "name": "getComponents", "signature": "Set<Class<?>> getComponents()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Set<Class<?>>"}, "class_info": {"name": "DefaultJerseyOptions", "kind": "class", "modifiers": "", "superclass": null, "interf... |
9270640_1 | class UserAccount extends BaseAuditableEntity implements SocialUserDetails {
public boolean isAuthor(){
for (UserRoleType role : getRoles()) {
if (role == UserRoleType.ROLE_AUTHOR){
return true;
}
}
return false;
}
public UserAccount();
... | UserAccount normalUser = new UserAccount();
assertFalse(normalUser.isAuthor());
UserRoleType[] roles = new UserRoleType[]{UserRoleType.ROLE_USER, UserRoleType.ROLE_AUTHOR};
UserAccount author = new UserAccount("1234", roles);
assertTrue(author.isAuthor());
}
} | [FOCAL] public boolean UserAccount.isAuthor()
[CLASS] class UserAccount extends BaseAuditableEntity implements SocialUserDetails
[METRICS] loc=8 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2
[CALLS-INTERNAL] UserRoleType[] getRoles()
[PATH1] foreach(UserRoleType role : getRoles())=T -> if(role == UserRoleType.RO... | /* static context
[FOCAL] public boolean UserAccount.isAuthor()
[PATH1] foreach(UserRoleType role : getRoles())=T -> if(role == UserRoleType.ROLE_AUTHOR)=F -> exit loop -> return false
[PATH2] foreach(UserRoleType role : getRoles())=T -> if(role == UserRoleType.ROLE_AUTHOR)=T -> return true
[PATH3] foreach(UserRoleType... | /* static context
[FOCAL] public boolean UserAccount.isAuthor()
[PATH1] foreach(UserRoleType role : getRoles())=T -> if(role == UserRoleType.ROLE_AUTHOR)=F -> exit loop -> return false
[PATH2] foreach(UserRoleType role : getRoles())=T -> if(role == UserRoleType.ROLE_AUTHOR)=T -> return true
[PATH3] foreach(UserRoleType... | true | ok | {"focal": {"class": "UserAccount", "name": "isAuthor", "signature": "boolean isAuthor()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "UserAccount", "kind": "class", "modifiers": "", "superclass": "BaseAuditableEntity", "interfaces": "SocialUserDetails", "fiel... |
9272141_1 | class ReentrantScope extends AbstractScope {
public boolean inScope() {
List<?> l = this.lists.get();
return l != null && !l.isEmpty();
}
public ReentrantScope();
public ReentrantScope(Provider<String> injectionInfoProvider);
Object[] includeStackTrace(Object... scopeContents);... | final int limit = 10;
StringBuilder constant = new StringBuilder("hello");
final boolean[] ran = new boolean[1];
//Recursively enter the scope multiple times, and ensure that the
//most recent values are the ones which are available
class One implements ThrowingFunction<I... | [FOCAL] public boolean ReentrantScope.inScope()
[CLASS] class ReentrantScope extends AbstractScope
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] this.lists.get/0, List<?>.isEmpty/0
[FIELDS] read=lists
[COLLABORATORS] field lists get/0
[DATAFLOW] l@L2->L3
[CLASS-MEMBERS] Reentrant... | /* static context
[FOCAL] public boolean ReentrantScope.inScope()
[COLLABORATORS] field lists get/0
[FIELDS] read=lists
[CALLS-EXTERNAL] this.lists.get/0, List<?>.isEmpty/0
*/
| /* static context
[FOCAL] public boolean ReentrantScope.inScope()
[COLLABORATORS] field lists get/0
[FIELDS] read=lists
[CALLS-EXTERNAL] this.lists.get/0, List<?>.isEmpty/0
*/
class ReentrantScope extends AbstractScope {
public boolean inScope() {
List<?> l = this.lists.get();
return l != null && !... | true | ok | {"focal": {"class": "ReentrantScope", "name": "inScope", "signature": "boolean inScope()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "ReentrantScope", "kind": "class", "modifiers": "", "superclass": "AbstractScope", "interfaces": null, "fields": [{"name": "d... |
9272724_6 | class Migration {
private void rollback(MongoDatabase db, Document agg) {
CountDownLatch latch = new CountDownLatch(backupQueryForCollection.size() - 1);
Document rollbacks = new Document();
agg.append("rollback", rollbacks);
for (String s : backupQueryForCollection.keySet()) {
... | Function<Class<? extends MigrationWorker>, MigrationWorker> convert = deps.get()::getInstance;
Migration[] m = new Migration[1];
new MigrationBuilder("stuff-new", 12, (mig) -> {
m[0] = (Migration) mig;
return null;
}).backup("stuff", new Document("index", new Doc... | [FOCAL] private void Migration.rollback(MongoDatabase db, Document agg)
[CLASS] class Migration
[METRICS] loc=44 cc=3 branches=0 loops=1 returns=0 throws=0 nesting=3
[CALLS-INTERNAL] Document appendThrowable(Throwable thrown); String backupCollectionName(String collectionName)
[CALLS-EXTERNAL] backupQueryForCollection.... | /* static context
[FOCAL] private void Migration.rollback(MongoDatabase db, Document agg)
[PATH1] foreach(String s : backupQueryForCollection.keySet())=T -> exit loop -> try-body throws
[PATH2] foreach(String s : backupQueryForCollection.keySet())=F
[COLLABORATORS] field backupQueryForCollection size/0,keySet/0; param ... | /* static context
[FOCAL] private void Migration.rollback(MongoDatabase db, Document agg)
[PATH1] foreach(String s : backupQueryForCollection.keySet())=T -> exit loop -> try-body throws
[PATH2] foreach(String s : backupQueryForCollection.keySet())=F
[COLLABORATORS] field backupQueryForCollection size/0,keySet/0; param ... | true | ok | {"focal": {"class": "Migration", "name": "rollback", "signature": "void rollback(MongoDatabase db, Document agg)", "start_line": 3, "modifiers": "private", "params": [{"name": "db", "type": "MongoDatabase"}, {"name": "agg", "type": "Document"}], "return_type": "void"}, "class_info": {"name": "Migration", "kind": "class... |
9291388_5 | class ProgressButton extends CompoundButton {
public void setPinned(boolean pinned) {
setChecked(pinned);
invalidate();
}
public ProgressButton(Context context);
public ProgressButton(Context context, AttributeSet attrs);
public ProgressButton(Context context, AttributeSet attrs, int defStyle);
... | button.setPinned(true);
CompoundButton.OnCheckedChangeListener publisher =
mock(CompoundButton.OnCheckedChangeListener.class);
button.setOnCheckedChangeListener(publisher);
button.toggle();
verify(publisher).onCheckedChanged(button, false);
}
} | [FOCAL] public void ProgressButton.setPinned(boolean pinned)
[CLASS] class ProgressButton extends CompoundButton
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] setChecked/1 (inherited), invalidate/0 (inherited)
[DATAFLOW] pinned@param->L2
[CLASS-MEMBERS] ProgressButton(Context con... | /* static context
[FOCAL] public void ProgressButton.setPinned(boolean pinned)
[CALLS-EXTERNAL] setChecked/1 (inherited), invalidate/0 (inherited)
*/
| /* static context
[FOCAL] public void ProgressButton.setPinned(boolean pinned)
[CALLS-EXTERNAL] setChecked/1 (inherited), invalidate/0 (inherited)
*/
class ProgressButton extends CompoundButton {
public void setPinned(boolean pinned) {
setChecked(pinned);
invalidate();
}
public ProgressButton(Context c... | true | ok | {"focal": {"class": "ProgressButton", "name": "setPinned", "signature": "void setPinned(boolean pinned)", "start_line": 3, "modifiers": "public", "params": [{"name": "pinned", "type": "boolean"}], "return_type": "void"}, "class_info": {"name": "ProgressButton", "kind": "class", "modifiers": "", "superclass": "CompoundB... |
9294731_46 | class HydroMetadataHandler extends MetadataHandler {
protected Collection<SosTimeseries> getAvailableTimeseries(XmlObject result_xb,
SosTimeseries timeserie,
SOSMetadata metadata) throws XmlExc... | Collection<SosTimeseries> timeseries = seam.getAvailableTimeseries();
assertThat(timeseries.size(), is(140));
}
} | [FOCAL] protected Collection<SosTimeseries> HydroMetadataHandler.getAvailableTimeseries(XmlObject result_xb, SosTimeseries timeserie, SOSMetadata metadata)
[CLASS] class HydroMetadataHandler extends MetadataHandler
[METRICS] loc=36 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] String getAttribut... | /* static context
[FOCAL] protected Collection<SosTimeseries> HydroMetadataHandler.getAvailableTimeseries(XmlObject result_xb, SosTimeseries timeserie, SOSMetadata metadata)
[PATH1] if(response == null || response.length ==0)=T -> foreach(XmlObject xmlObject : response)=T -> exit loop -> return timeseries
[PATH2] if(re... | /* static context
[FOCAL] protected Collection<SosTimeseries> HydroMetadataHandler.getAvailableTimeseries(XmlObject result_xb, SosTimeseries timeserie, SOSMetadata metadata)
[PATH1] if(response == null || response.length ==0)=T -> foreach(XmlObject xmlObject : response)=T -> exit loop -> return timeseries
[PATH2] if(re... | true | ok | {"focal": {"class": "HydroMetadataHandler", "name": "getAvailableTimeseries", "signature": "Collection<SosTimeseries> getAvailableTimeseries(XmlObject result_xb, SosTimeseries timeserie, SOSMetadata metadata) throws XmlException, IOException", "start_line": 3, "modifiers": "protected", "params": [{"name": "result_xb", ... |
9306260_2 | class PropertyTypeValidator implements ConfigHelperValidator {
@Override
public void validate(ConfigHelper configHelper) throws RuntimeException
{
for (String propertyName : configHelper.getPropertyNames())
{
Class<?> desiredType = configHelper.getPropertyType(propertyName);
... | Properties properties = new Properties();
properties.put("property", "false");
MappedConfiguration<String, Object> configuration = Mockito.mock(MappedConfiguration.class);
ConfigHelper configHelper = new ConfigHelper(properties);
configHelper.add("property", configuration);
... | [FOCAL] @Override public void PropertyTypeValidator.validate(ConfigHelper configHelper)
[CLASS] class PropertyTypeValidator implements ConfigHelperValidator
[METRICS] loc=27 cc=4 branches=2 loops=1 returns=0 throws=0 nesting=2
[CALLS-EXTERNAL] ConfigHelper.getPropertyNames/0, ConfigHelper.getPropertyType/1, ConfigHelpe... | /* static context
[FOCAL] @Override public void PropertyTypeValidator.validate(ConfigHelper configHelper)
[PATH1] foreach(String propertyName : configHelper.getPropertyNames())=T -> if(desiredType == null)=F -> if(desiredType == Object.class)=T -> exit loop
[PATH2] foreach(String propertyName : configHelper.getProperty... | /* static context
[FOCAL] @Override public void PropertyTypeValidator.validate(ConfigHelper configHelper)
[PATH1] foreach(String propertyName : configHelper.getPropertyNames())=T -> if(desiredType == null)=F -> if(desiredType == Object.class)=T -> exit loop
[PATH2] foreach(String propertyName : configHelper.getProperty... | true | ok | {"focal": {"class": "PropertyTypeValidator", "name": "validate", "signature": "void validate(ConfigHelper configHelper) throws RuntimeException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "configHelper", "type": "ConfigHelper"}], "return_type": "void"}, "class_info": {"name": "PropertyTypeVa... |
9318794_6 | class LogStore extends ChangeSupport {
@Process(actionType = FollowLogFile.class)
public void follow(final Dispatcher.Channel channel) {
if (activeLogFile == null) {
channel.nack(new IllegalStateException("Unable to follow: No active log file!"));
return;
}
navi... | LogFile logFile = new LogFile("server.log", Collections.<String>emptyList(), 0);
store.states.put(logFile.getName(), logFile);
store.activate(logFile);
store.follow(NoopChannel.INSTANCE);
assertFalse(store.pauseFollow);
LogFile activeLogFile = store.getActiveLogFile();
... | [FOCAL] @Process(actionType = FollowLogFile.class) public void LogStore.follow(Dispatcher.Channel channel)
[CLASS] class LogStore extends ChangeSupport
[METRICS] loc=11 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] void navigate(NavigateInLogFile action, Dispatcher.Channel channel); void startFo... | /* static context
[FOCAL] @Process(actionType = FollowLogFile.class) public void LogStore.follow(Dispatcher.Channel channel)
[PATH1] if(activeLogFile == null)=T -> return
[PATH2] if(activeLogFile == null)=F
[COLLABORATORS] param channel:Dispatcher.Channel nack/1; field activeLogFile setFollow/1
[CALLS-INTERNAL] void na... | /* static context
[FOCAL] @Process(actionType = FollowLogFile.class) public void LogStore.follow(Dispatcher.Channel channel)
[PATH1] if(activeLogFile == null)=T -> return
[PATH2] if(activeLogFile == null)=F
[COLLABORATORS] param channel:Dispatcher.Channel nack/1; field activeLogFile setFollow/1
[CALLS-INTERNAL] void na... | true | ok | {"focal": {"class": "LogStore", "name": "follow", "signature": "void follow(Dispatcher.Channel channel)", "start_line": 3, "modifiers": "@Process(actionType = FollowLogFile.class) public", "params": [{"name": "channel", "type": "Dispatcher.Channel"}], "return_type": "void"}, "class_info": {"name": "LogStore", "kind": "... |
9327416_435 | class JsonLinkConsumer {
public List<String> readLinks(final JsonReader reader, final EdmEntitySet entitySet) throws EntityProviderException {
List<String> links = null;
int openedObjects = 0;
try {
String nextName;
if (reader.peek() == JsonToken.BEGIN_ARRAY) {
nextName = FormatJson.... | final String links = "{\"d\":{\"results\":[{\"uri\":\"http://somelink\"}]}}";
JsonReader reader = new JsonReader(new InputStreamReader(createContentAsStream(links)));
assertEquals(Arrays.asList("http://somelink"), new JsonLinkConsumer().readLinks(reader, null));
}
} | [FOCAL] public List<String> JsonLinkConsumer.readLinks(JsonReader reader, EdmEntitySet entitySet)
[CLASS] class JsonLinkConsumer
[METRICS] loc=52 cc=13 branches=7 loops=1 returns=1 throws=4 nesting=3
[CALLS-INTERNAL] List<String> readLinksArray(JsonReader reader)
[CALLS-EXTERNAL] JsonReader.peek/0, JsonReader.beginObje... | /* static context
[FOCAL] public List<String> JsonLinkConsumer.readLinks(JsonReader reader, EdmEntitySet entitySet)
[THROWS-WHEN] EntityProviderException when try-body throws
[THROWS-WHEN] EntityProviderException when reader.peek() == JsonToken.BEGIN_ARRAY && FormatJson.D.equals(nextName) && reader.peek() == JsonToken.... | /* static context
[FOCAL] public List<String> JsonLinkConsumer.readLinks(JsonReader reader, EdmEntitySet entitySet)
[THROWS-WHEN] EntityProviderException when try-body throws
[THROWS-WHEN] EntityProviderException when reader.peek() == JsonToken.BEGIN_ARRAY && FormatJson.D.equals(nextName) && reader.peek() == JsonToken.... | true | ok | {"focal": {"class": "JsonLinkConsumer", "name": "readLinks", "signature": "List<String> readLinks(JsonReader reader, EdmEntitySet entitySet) throws EntityProviderException", "start_line": 3, "modifiers": "public", "params": [{"name": "reader", "type": "JsonReader"}, {"name": "entitySet", "type": "EdmEntitySet"}], "retu... |
9327555_9 | class FaviconDownloader {
public String downloadFaviconFromPage(String pageUrl, String directory, String fileName) {
// Try to extract the favicon URL from the page specified in the feed
String faviconUrl = null;
try {
final FaviconExtractor extractor = new FaviconExtractor(page... | // Download from page
FaviconDownloader downloader = new FaviconDownloader();
String tempDir = System.getProperty("java.io.tmpdir");
String filename = downloader.downloadFaviconFromPage("http://abstrusegoose.com", tempDir, "favicon");
assertNotNull(filename);
assertTrue(n... | [FOCAL] public String FaviconDownloader.downloadFaviconFromPage(String pageUrl, String directory, String fileName)
[CLASS] class FaviconDownloader
[METRICS] loc=43 cc=6 branches=3 loops=1 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] String downloadFavicon(String faviconUrl, String directory, String fileName); String g... | /* static context
[FOCAL] public String FaviconDownloader.downloadFaviconFromPage(String pageUrl, String directory, String fileName)
[PATH1] try-body throws -> if(faviconUrl != null)=T -> while(localFilename == null && iterator.hasNext())=T -> exit loop -> if(log.isInfoEnabled())=T -> if(localFilename != null)=T -> ret... | /* static context
[FOCAL] public String FaviconDownloader.downloadFaviconFromPage(String pageUrl, String directory, String fileName)
[PATH1] try-body throws -> if(faviconUrl != null)=T -> while(localFilename == null && iterator.hasNext())=T -> exit loop -> if(log.isInfoEnabled())=T -> if(localFilename != null)=T -> ret... | true | ok | {"focal": {"class": "FaviconDownloader", "name": "downloadFaviconFromPage", "signature": "String downloadFaviconFromPage(String pageUrl, String directory, String fileName)", "start_line": 3, "modifiers": "public", "params": [{"name": "pageUrl", "type": "String"}, {"name": "directory", "type": "String"}, {"name": "fileN... |
9340593_0 | class SPARQLValidator {
public Model validate(OntModel toBeValidated, String query) {
OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM, ModelFactory.createDefaultModel());
NIFNamespaces.addRLOGPrefix(model);
model.setNsPrefix("mylog", logPrefix);
QueryExecut... | OntModel output = null;
OntModel correct = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM, ModelFactory.createDefaultModel());
correct.read(SPARQLValidator.class.getClassLoader().getResourceAsStream("nif-correct-model.ttl"), "", "Turtle");
output = SPARQLValidator.getInstance()... | [FOCAL] public Model SPARQLValidator.validate(OntModel toBeValidated, String query)
[CLASS] class SPARQLValidator
[METRICS] loc=36 cc=8 branches=6 loops=1 returns=1 throws=0 nesting=7
[CALLS-EXTERNAL] ModelFactory.createOntologyModel/2, ModelFactory.createDefaultModel/0, NIFNamespaces.addRLOGPrefix/1, OntModel.setNsPre... | /* static context
[FOCAL] public Model SPARQLValidator.validate(OntModel toBeValidated, String query)
[PATH1] for(rs.hasNext())=T -> if(RLOGIndividuals.FATAL.getUri().equals(uri))=F -> if(RLOGIndividuals.ERROR.getUri().equals(uri))=F -> if(RLOGIndividuals.WARN.getUri().equals(uri))=F -> if(RLOGIndividuals.INFO.getUri()... | /* static context
[FOCAL] public Model SPARQLValidator.validate(OntModel toBeValidated, String query)
[PATH1] for(rs.hasNext())=T -> if(RLOGIndividuals.FATAL.getUri().equals(uri))=F -> if(RLOGIndividuals.ERROR.getUri().equals(uri))=F -> if(RLOGIndividuals.WARN.getUri().equals(uri))=F -> if(RLOGIndividuals.INFO.getUri()... | true | ok | {"focal": {"class": "SPARQLValidator", "name": "validate", "signature": "Model validate(OntModel toBeValidated, String query)", "start_line": 3, "modifiers": "public", "params": [{"name": "toBeValidated", "type": "OntModel"}, {"name": "query", "type": "String"}], "return_type": "Model"}, "class_info": {"name": "SPARQLV... |
9349244_1 | class RateThisApp {
public static void stopRateDialog(final Context context){
setOptOut(context, true);
}
public static void init(Config config);
public static void setCallback(Callback callback);
public static void onCreate(Context context);
@Deprecated public static void onStart(Cont... | Context context = RuntimeEnvironment.application.getApplicationContext();
RateThisApp.stopRateDialog(context);
// check shared pref
SharedPreferences sharedPreferences = RuntimeEnvironment.application.getSharedPreferences(
PREF_NAME, Context.MODE_PRIVATE);
Assert... | [FOCAL] public static void RateThisApp.stopRateDialog(Context context)
[CLASS] class RateThisApp
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void setOptOut(Context context, boolean optOut)
[DATAFLOW] context@param->L2
[CLASS-MEMBERS] void init(Config config); void setCallback(C... | /* static context
[FOCAL] public static void RateThisApp.stopRateDialog(Context context)
[CALLS-INTERNAL] void setOptOut(Context context, boolean optOut)
*/
| /* static context
[FOCAL] public static void RateThisApp.stopRateDialog(Context context)
[CALLS-INTERNAL] void setOptOut(Context context, boolean optOut)
*/
class RateThisApp {
public static void stopRateDialog(final Context context){
setOptOut(context, true);
}
public static void init(Config conf... | true | ok | {"focal": {"class": "RateThisApp", "name": "stopRateDialog", "signature": "void stopRateDialog(Context context)", "start_line": 3, "modifiers": "public static", "params": [{"name": "context", "type": "Context"}], "return_type": "void"}, "class_info": {"name": "RateThisApp", "kind": "class", "modifiers": "", "superclass... |
9349347_3 | class CommonUtils {
public static String padRight(String inputString, int size, char paddingChar) {
final String stringToPad;
if (inputString == null) {
stringToPad = "";
}
else {
stringToPad = inputString;
}
StringBuilder padded = new StringBuilder(stringToPad);
while (padded.length() < size) ... | assertEquals(" ", CommonUtils.padRight(null, 5));
}
} | [FOCAL] public static String CommonUtils.padRight(String inputString, int size, char paddingChar)
[CLASS] class CommonUtils
[METRICS] loc=17 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] StringBuilder.length/0, StringBuilder.append/1, StringBuilder.toString/0
[NEW] StringBuilder
[PATH1] if(input... | /* static context
[FOCAL] public static String CommonUtils.padRight(String inputString, int size, char paddingChar)
[PATH1] if(inputString == null)=T -> while(padded.length() < size)=T -> exit loop -> return padded.toString()
[PATH2] if(inputString == null)=F -> while(padded.length() < size)=F -> return padded.toString... | /* static context
[FOCAL] public static String CommonUtils.padRight(String inputString, int size, char paddingChar)
[PATH1] if(inputString == null)=T -> while(padded.length() < size)=T -> exit loop -> return padded.toString()
[PATH2] if(inputString == null)=F -> while(padded.length() < size)=F -> return padded.toString... | true | ok | {"focal": {"class": "CommonUtils", "name": "padRight", "signature": "String padRight(String inputString, int size, char paddingChar)", "start_line": 3, "modifiers": "public static", "params": [{"name": "inputString", "type": "String"}, {"name": "size", "type": "int"}, {"name": "paddingChar", "type": "char"}], "return_t... |
9349893_0 | class LibreOfficeLauncherHelper {
public static String getOperatingSystem(String operatingSystemIndentifier) {
// JOptionPane.showMessageDialog(null, operatingSystemIndentifier, "Info",
// JOptionPane.ERROR_MESSAGE);
if ("linux".equalsIgnoreCase(operatingSystemIndentifier)) {
return OS_LINUX;
}... | assertEquals(LibreOfficeLauncherHelper.OS_LINUX, LibreOfficeLauncherHelper.getOperatingSystem("linux"));
assertEquals(LibreOfficeLauncherHelper.OS_LINUX, LibreOfficeLauncherHelper.getOperatingSystem("Linux"));
assertEquals(LibreOfficeLauncherHelper.OS_WINDOWS, LibreOfficeLauncherHelper.getOperatingSystem("... | [FOCAL] public static String LibreOfficeLauncherHelper.getOperatingSystem(String operatingSystemIndentifier)
[CLASS] class LibreOfficeLauncherHelper
[METRICS] loc=14 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=2
[CALLS-EXTERNAL] "linux".equalsIgnoreCase/1, operatingSystemIndentifier.toLowerCase().contains/1, Str... | /* static context
[FOCAL] public static String LibreOfficeLauncherHelper.getOperatingSystem(String operatingSystemIndentifier)
[PATH1] if("linux".equalsIgnoreCase(operatingSystemIndentifier))=F -> if(operatingSystemIndentifier != null && operatingSystemIndentifier.toLowerCase().contains("windows"))=F -> if(operatingSys... | /* static context
[FOCAL] public static String LibreOfficeLauncherHelper.getOperatingSystem(String operatingSystemIndentifier)
[PATH1] if("linux".equalsIgnoreCase(operatingSystemIndentifier))=F -> if(operatingSystemIndentifier != null && operatingSystemIndentifier.toLowerCase().contains("windows"))=F -> if(operatingSys... | true | ok | {"focal": {"class": "LibreOfficeLauncherHelper", "name": "getOperatingSystem", "signature": "String getOperatingSystem(String operatingSystemIndentifier)", "start_line": 3, "modifiers": "public static", "params": [{"name": "operatingSystemIndentifier", "type": "String"}], "return_type": "String"}, "class_info": {"name"... |
9365128_63 | class ScalableQuantity extends Quantity<N> {
@Override
public String toString() {
double valuePan = getNumber().doubleValue();
final double scaleFactor = getScaleFactor().doubleValue();
int i = getBasePower();
if (valuePan > 1.0) { // need to scale the value down
while (valuePan ... | Assert.assertEquals(new MetricScalableQuantity(100.0, 2, "b").toString(), "100.00 Mb");
Assert.assertEquals(new MetricScalableQuantity(100.0, -2, "b").toString(), "100.00 μb");
}
} | [FOCAL] @Override public String ScalableQuantity.toString()
[CLASS] class ScalableQuantity extends Quantity<N>
[METRICS] loc=18 cc=4 branches=1 loops=2 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] N getScaleFactor(); String getScalePrefix(int power); int getBasePower(); int getMaxPower(); int getMinPower()
[CALLS-EXTE... | /* static context
[FOCAL] @Override public String ScalableQuantity.toString()
[PATH1] if(valuePan > 1.0)=T -> while(valuePan >= scaleFactor && i < getMaxPower())=T -> exit loop -> return String.format(Locale.US, "%.2f", valuePan) + " " + getScalePrefix(i...
[PATH2] if(valuePan > 1.0)=F -> while(valuePan < 1.0 && i > ge... | /* static context
[FOCAL] @Override public String ScalableQuantity.toString()
[PATH1] if(valuePan > 1.0)=T -> while(valuePan >= scaleFactor && i < getMaxPower())=T -> exit loop -> return String.format(Locale.US, "%.2f", valuePan) + " " + getScalePrefix(i...
[PATH2] if(valuePan > 1.0)=F -> while(valuePan < 1.0 && i > ge... | true | ok | {"focal": {"class": "ScalableQuantity", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "ScalableQuantity", "kind": "class", "modifiers": "", "superclass": "Quantity<N>", "interfaces": null, "fields": ... |
9369619_41 | class ObjectMapperProvider {
public ObjectMapper mapper() {
return mapper;
}
public ObjectMapperProvider();
public static ObjectMapperProvider defaults();
static KasperReason translateOldErrorToKasperReason(final ObjectNode root);
public ObjectWriter objectWriter();
public Object... | // Given
final String jsonIso8601 = "\"2013-08-06T07:35:00.123Z\"";
// When
final DateTime actual = ObjectMapperProvider.INSTANCE.mapper().readValue(
jsonIso8601,
DateTime.class
);
// Then
final DateTime expectedDateTime = new Dat... | [FOCAL] public ObjectMapper ObjectMapperProvider.mapper()
[CLASS] class ObjectMapperProvider
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] ObjectMapperProvider(); ObjectMapperProvider defaults(); KasperReason translateOldErrorToKasperReason(ObjectNode root); ObjectWriter objectWri... | /* static context
[FOCAL] public ObjectMapper ObjectMapperProvider.mapper()
*/
| /* static context
[FOCAL] public ObjectMapper ObjectMapperProvider.mapper()
*/
class ObjectMapperProvider {
public ObjectMapper mapper() {
return mapper;
}
public ObjectMapperProvider();
public static ObjectMapperProvider defaults();
static KasperReason translateOldErrorToKasperReason(fi... | true | ok | {"focal": {"class": "ObjectMapperProvider", "name": "mapper", "signature": "ObjectMapper mapper()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "ObjectMapper"}, "class_info": {"name": "ObjectMapperProvider", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"... |
9373411_52 | class CastingAst2CodeConverter extends AbstractAst2CodeConverter {
protected IdentifierData cast(Type goalType, IdentifierData oldId) throws IntermediateCodeGeneratorException {
if (oldId.getIdentifier().startsWith("#")) {
IdentifierData tmpId = icg.generateTempIdentifier(oldId.getType());
icg.addQuadruple(Qu... | try {
when(converter.icg.generateTempIdentifier(any(StringType.class)))
.thenReturn(new IdentifierData("tmp", new StringType(0l)));
converter.cast(new StringType(0l), new IdentifierData("test",
new ArrayType(new LongType(), 0)));
fail();
} catch (IntermediateCodeGeneratorException e) {
... | [FOCAL] protected IdentifierData CastingAst2CodeConverter.cast(Type goalType, IdentifierData oldId)
[CLASS] class CastingAst2CodeConverter extends AbstractAst2CodeConverter
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] oldId.getIdentifier().startsWith/1, IdentifierData.getIdenti... | /* static context
[FOCAL] protected IdentifierData CastingAst2CodeConverter.cast(Type goalType, IdentifierData oldId)
[PATH1] if(oldId.getIdentifier().startsWith("#"))=T -> return newId
[PATH2] if(oldId.getIdentifier().startsWith("#"))=F -> return newId
[INPUTS] branches=oldId | result=goalType
[COLLABORATORS] param ol... | /* static context
[FOCAL] protected IdentifierData CastingAst2CodeConverter.cast(Type goalType, IdentifierData oldId)
[PATH1] if(oldId.getIdentifier().startsWith("#"))=T -> return newId
[PATH2] if(oldId.getIdentifier().startsWith("#"))=F -> return newId
[INPUTS] branches=oldId | result=goalType
[COLLABORATORS] param ol... | true | ok | {"focal": {"class": "CastingAst2CodeConverter", "name": "cast", "signature": "IdentifierData cast(Type goalType, IdentifierData oldId) throws IntermediateCodeGeneratorException", "start_line": 3, "modifiers": "protected", "params": [{"name": "goalType", "type": "Type"}, {"name": "oldId", "type": "IdentifierData"}], "re... |
9386489_21 | class LogFilterApplier {
public String apply(String text, String logLevel) {
if (System.getProperties().containsKey(OFF_SWITCH)) {
return text;
}
boolean displayDebugInfo = showDebugInfo();
if (config == null) config = configLoader.loadConfiguration(displayDebugInfo);
... | config.setTimestampPattern("yyyy/MM/dd");
assertEquals("", applier.apply("", MockLogLevel.INFO.name()));
}
} | [FOCAL] public String LogFilterApplier.apply(String text, String logLevel)
[CLASS] class LogFilterApplier
[METRICS] loc=27 cc=7 branches=5 loops=1 returns=3 throws=0 nesting=2
[CALLS-INTERNAL] boolean showDebugInfo()
[CALLS-EXTERNAL] System.getProperties().containsKey/1, System.getProperties/0, configLoader.loadConfigu... | /* static context
[FOCAL] public String LogFilterApplier.apply(String text, String logLevel)
[PATH1] if(System.getProperties().containsKey(OFF_SWITCH))=F -> if(config == null)=T -> if(displayDebugInfo)#1=T -> foreach(LogEntryFilter filter : filters)=T -> if(displayDebugInfo)#2=T -> if(StringUtils.isBlank(result))=F -> ... | /* static context
[FOCAL] public String LogFilterApplier.apply(String text, String logLevel)
[PATH1] if(System.getProperties().containsKey(OFF_SWITCH))=F -> if(config == null)=T -> if(displayDebugInfo)#1=T -> foreach(LogEntryFilter filter : filters)=T -> if(displayDebugInfo)#2=T -> if(StringUtils.isBlank(result))=F -> ... | true | ok | {"focal": {"class": "LogFilterApplier", "name": "apply", "signature": "String apply(String text, String logLevel)", "start_line": 3, "modifiers": "public", "params": [{"name": "text", "type": "String"}, {"name": "logLevel", "type": "String"}], "return_type": "String"}, "class_info": {"name": "LogFilterApplier", "kind":... |
9408774_14 | class LogInjector {
public Log defaultLogger() {
return (level, debug) ->
(level == LogLevel.ERROR ? SYS_ERR : SYS_OUT)
.print(level, debug);
}
static LogInjector inst();
private static LogInjector createInstance();
}
class LogInjectorTest {
@Test
public void testDefaultLog... | // Make sure basic logging works OOTB
final String msg = "Success! " + hashCode();
borrowSout(
()-> LogInjector.DEFAULT.log(LogLevel.INFO, msg)
, lines->
Assert.assertEquals("[INFO] " + msg, lines.first())
);
assertTrue("Failed", !failed);
... | [FOCAL] public Log LogInjector.defaultLogger()
[CLASS] class LogInjector
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] (level == LogLevel.ERROR ? SYS_ERR : SYS_OUT).print/2
[CLASS-MEMBERS] LogInjector inst(); LogInjector createInstance()
[TEST] LogInjectorTest: @Test public void ... | /* static context
[FOCAL] public Log LogInjector.defaultLogger()
[CALLS-EXTERNAL] (level == LogLevel.ERROR ? SYS_ERR : SYS_OUT).print/2
*/
| /* static context
[FOCAL] public Log LogInjector.defaultLogger()
[CALLS-EXTERNAL] (level == LogLevel.ERROR ? SYS_ERR : SYS_OUT).print/2
*/
class LogInjector {
public Log defaultLogger() {
return (level, debug) ->
(level == LogLevel.ERROR ? SYS_ERR : SYS_OUT)
.print(level, debug);
}
stati... | true | ok | {"focal": {"class": "LogInjector", "name": "defaultLogger", "signature": "Log defaultLogger()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Log"}, "class_info": {"name": "LogInjector", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": ... |
9434210_1 | class UriBuilderImpl extends UriBuilder {
@Override
public UriBuilder replaceQueryParam(String name, Object... values) {
checkSsp();
if (queryParams == null) {
queryParams = UriComponent.decodeQuery(query.toString(), false);
query.setLength(0);
}
name =... | URI uri = new UriBuilderImpl().path("http://localhost/").replaceQueryParam("foo", "test").build();
assertEquals("http://localhost/?foo=test", uri.toString());
}
} | [FOCAL] @Override public UriBuilder UriBuilderImpl.replaceQueryParam(String name, Object... values)
[CLASS] class UriBuilderImpl extends UriBuilder
[METRICS] loc=25 cc=5 branches=3 loops=1 returns=2 throws=1 nesting=2
[CALLS-INTERNAL] String encode(String s, UriComponent.Type type); void checkSsp()
[CALLS-EXTERNAL] Uri... | /* static context
[FOCAL] @Override public UriBuilder UriBuilderImpl.replaceQueryParam(String name, Object... values)
[THROWS-WHEN] IllegalArgumentException when queryParams == null && !(values == null) && foreach(Object value : values)=T && value == null
[THROWS-WHEN] IllegalArgumentException when !(queryParams == nul... | /* static context
[FOCAL] @Override public UriBuilder UriBuilderImpl.replaceQueryParam(String name, Object... values)
[THROWS-WHEN] IllegalArgumentException when queryParams == null && !(values == null) && foreach(Object value : values)=T && value == null
[THROWS-WHEN] IllegalArgumentException when !(queryParams == nul... | true | ok | {"focal": {"class": "UriBuilderImpl", "name": "replaceQueryParam", "signature": "UriBuilder replaceQueryParam(String name, Object... values)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "name", "type": "String"}, {"name": "values", "type": "Object..."}], "return_type": "UriBuilder"}, "class_i... |
9454656_0 | class TemplateDebugger {
public String render() {
STGroupFile templateGroup = new STGroupFile(templateGroupFile);
ST template = templateGroup.getInstanceOf(templateName);
if (template == null) {
throw new IllegalStateException(
String.format(
"The template named [%s] does not exist in the templat... |
ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
InputStream yaml = getClass().getResourceAsStream(
"/yaml/templateDebugger.yml");
TemplateDebugger debugger = mapper.readValue(yaml,
TemplateDebugger.class);
assertNotNull(debugger);
String rendered = debugger.render();
assertNotNull(render... | [FOCAL] public String TemplateDebugger.render()
[CLASS] class TemplateDebugger
[METRICS] loc=33 cc=8 branches=1 loops=3 returns=1 throws=1 nesting=2
[CALLS-EXTERNAL] STGroupFile.getInstanceOf/1, String.format/3, variables.entrySet/0, ST.add/2, Entry<String, List<Map<String, String>>>.getKey/0, Entry<String, List<Map<St... | /* static context
[FOCAL] public String TemplateDebugger.render()
[THROWS-WHEN] IllegalStateException when template == null
[PATH1] if(template == null)=F -> foreach(Map.Entry<String, String> entry : variables.entrySet())=T -> try-body throws -> exit loop -> foreach(Map.Entry<String, Map<String, String>> entry : servic... | /* static context
[FOCAL] public String TemplateDebugger.render()
[THROWS-WHEN] IllegalStateException when template == null
[PATH1] if(template == null)=F -> foreach(Map.Entry<String, String> entry : variables.entrySet())=T -> try-body throws -> exit loop -> foreach(Map.Entry<String, Map<String, String>> entry : servic... | true | ok | {"focal": {"class": "TemplateDebugger", "name": "render", "signature": "String render()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "TemplateDebugger", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name"... |
9478484_0 | class IssueRegistry extends com.android.tools.lint.client.api.IssueRegistry {
@Override public List<Issue> getIssues() {
return Arrays.asList(InjectedFieldInJobNotTransientDetector.ISSUE);
}
}
class IssueRegistryTest {
@Test public void issues() throws Exception {
| assertThat(new IssueRegistry().getIssues()).contains(
InjectedFieldInJobNotTransientDetector.ISSUE);
}
} | [FOCAL] @Override public List<Issue> IssueRegistry.getIssues()
[CLASS] class IssueRegistry extends com.android.tools.lint.client.api.IssueRegistry
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Arrays.asList/1
[TEST] IssueRegistryTest: @Test public void issues() throws Exception | /* static context
[FOCAL] @Override public List<Issue> IssueRegistry.getIssues()
[CALLS-EXTERNAL] Arrays.asList/1
*/
| /* static context
[FOCAL] @Override public List<Issue> IssueRegistry.getIssues()
[CALLS-EXTERNAL] Arrays.asList/1
*/
class IssueRegistry extends com.android.tools.lint.client.api.IssueRegistry {
@Override public List<Issue> getIssues() {
return Arrays.asList(InjectedFieldInJobNotTransientDetector.ISSUE);
}
}
... | true | ok | {"focal": {"class": "IssueRegistry", "name": "getIssues", "signature": "List<Issue> getIssues()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "List<Issue>"}, "class_info": {"name": "IssueRegistry", "kind": "class", "modifiers": "", "superclass": "com.android.tools.lint.client.api.Issu... |
9502782_0 | class ScheduledTasks {
@Scheduled(fixedRate = 5000)
public void reportCurrentTime() {
log.info("The time is now {}", dateFormat.format(new Date()));
}
@SpyBean ScheduledTasks tasks;
}
class ScheduledTasksTest {
@SpyBean ScheduledTasks tasks;
@Test
public void reportCurrentTime() {
| await().atMost(Duration.TEN_SECONDS).untilAsserted(() -> {
verify(tasks, atLeast(2)).reportCurrentTime();
});
}
} | [FOCAL] @Scheduled(fixedRate = 5000) public void ScheduledTasks.reportCurrentTime()
[CLASS] class ScheduledTasks
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] log.info/2, dateFormat.format/1
[NEW] Date
[COLLABORATORS] field dateFormat format/1
[TEST] ScheduledTasksTest: @Test pub... | /* static context
[FOCAL] @Scheduled(fixedRate = 5000) public void ScheduledTasks.reportCurrentTime()
[COLLABORATORS] field dateFormat format/1
[NEW] Date
[CALLS-EXTERNAL] log.info/2, dateFormat.format/1
*/
| /* static context
[FOCAL] @Scheduled(fixedRate = 5000) public void ScheduledTasks.reportCurrentTime()
[COLLABORATORS] field dateFormat format/1
[NEW] Date
[CALLS-EXTERNAL] log.info/2, dateFormat.format/1
*/
class ScheduledTasks {
@Scheduled(fixedRate = 5000)
public void reportCurrentTime() {
log.info("The time is ... | true | ok | {"focal": {"class": "ScheduledTasks", "name": "reportCurrentTime", "signature": "void reportCurrentTime()", "start_line": 3, "modifiers": "@Scheduled(fixedRate = 5000) public", "params": [], "return_type": "void"}, "class_info": {"name": "ScheduledTasks", "kind": "class", "modifiers": "", "superclass": null, "interface... |
9519880_0 | class WebExceptionHandlerOperationsImpl implements
WebExceptionHandlerOperations {
public String getHandledExceptionList() {
String webXmlPath = pathResolver.getIdentifier(
LogicalPath.getInstance(Path.SRC_MAIN_WEBAPP, ""),
WEB_MVC_CONFIG);
Validate.isTrue(f... |
String result;
String expected;
/*
* Test 1 - Encuentra excepciones instanciadas en el archivo de
* configuración EXC_WEB_XML
*/
expect(
pathResolver.getIdentifier(
LogicalPath.getInstance(Path.SRC_MAIN_WEBAPP, ""),
... | [FOCAL] public String WebExceptionHandlerOperationsImpl.getHandledExceptionList()
[CLASS] class WebExceptionHandlerOperationsImpl implements WebExceptionHandlerOperations
[METRICS] loc=37 cc=3 branches=0 loops=1 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] PathResolver.getIdentifier/2, LogicalPath.getInstance/2, Valid... | /* static context
[FOCAL] public String WebExceptionHandlerOperationsImpl.getHandledExceptionList()
[THROWS-WHEN] IllegalStateException when try-body throws
[PATH1] foreach(Element element : simpleMappingException)=T -> exit loop -> return exceptionList.toString()
[PATH2] try-body throws -> throw new IllegalStateExcept... | /* static context
[FOCAL] public String WebExceptionHandlerOperationsImpl.getHandledExceptionList()
[THROWS-WHEN] IllegalStateException when try-body throws
[PATH1] foreach(Element element : simpleMappingException)=T -> exit loop -> return exceptionList.toString()
[PATH2] try-body throws -> throw new IllegalStateExcept... | true | ok | {"focal": {"class": "WebExceptionHandlerOperationsImpl", "name": "getHandledExceptionList", "signature": "String getHandledExceptionList()", "start_line": 4, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "WebExceptionHandlerOperationsImpl", "kind": "class", "modifiers": "", "supe... |
9530230_2 | class Recommendations extends SimpleBenchmark {
public Map<Integer, List<Integer>> calculateRecommendations(int reps) {
Map<Integer, List<Integer>> results = null;
for (int i = 0; i < reps; i++) {
results = lambdaRecommendations.calculateRecommendations();
}
return resul... | GSLambdaRecommendations recommendations = new GSLambdaRecommendations(makePurchases());
MutableMap<Integer, MutableList<Integer>> results = recommendations.calculateRecommendations();
Assert.assertEquals(4, results.get(5).get(0).intValue());
Assert.assertEquals(5, results.g... | [FOCAL] public Map<Integer, List<Integer>> Recommendations.calculateRecommendations(int reps)
[CLASS] class Recommendations extends SimpleBenchmark
[METRICS] loc=7 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] lambdaRecommendations.calculateRecommendations/0
[PATH1] for(i < reps)=T -> exit loop ... | /* static context
[FOCAL] public Map<Integer, List<Integer>> Recommendations.calculateRecommendations(int reps)
[PATH1] for(i < reps)=T -> exit loop -> return results
[PATH2] for(i < reps)=F -> return results
[INPUTS] branches=reps | result=-
[COLLABORATORS] field lambdaRecommendations calculateRecommendations/0
[CALLS... | /* static context
[FOCAL] public Map<Integer, List<Integer>> Recommendations.calculateRecommendations(int reps)
[PATH1] for(i < reps)=T -> exit loop -> return results
[PATH2] for(i < reps)=F -> return results
[INPUTS] branches=reps | result=-
[COLLABORATORS] field lambdaRecommendations calculateRecommendations/0
[CALLS... | true | ok | {"focal": {"class": "Recommendations", "name": "calculateRecommendations", "signature": "Map<Integer, List<Integer>> calculateRecommendations(int reps)", "start_line": 3, "modifiers": "public", "params": [{"name": "reps", "type": "int"}], "return_type": "Map<Integer, List<Integer>>"}, "class_info": {"name": "Recommenda... |
9545480_17 | class InstrumentedInvokerFactory {
public Invoker create(Object service, Invoker rootInvoker) {
List<Method> timedmethods = new ArrayList<>();
List<Method> meteredmethods = new ArrayList<>();
List<Method> exceptionmeteredmethods = new ArrayList<>();
for (Method m : service.getClas... |
Timer timer = testMetricRegistry.timer("timed");
Meter meter = testMetricRegistry.meter("metered");
when(mockMetricRegistry.timer(anyString())).thenReturn(timer);
when(mockMetricRegistry.meter(anyString())).thenReturn(meter);
long oldtimervalue = timer.getCount();
long ... | [FOCAL] public Invoker InstrumentedInvokerFactory.create(Object service, Invoker rootInvoker)
[CLASS] class InstrumentedInvokerFactory
[METRICS] loc=37 cc=8 branches=6 loops=1 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] Invoker exceptionMetered(Invoker invoker, List<Method> meteredMethods); Invoker metered(Invoker in... | /* static context
[FOCAL] public Invoker InstrumentedInvokerFactory.create(Object service, Invoker rootInvoker)
[PATH1] foreach(Method m : service.getClass().getMethods())=T -> if(m.isAnnotationPresent(Timed.class))=T -> if(m.isAnnotationPresent(Metered.class))=T -> if(m.isAnnotationPresent(ExceptionMetered.class))=T -... | /* static context
[FOCAL] public Invoker InstrumentedInvokerFactory.create(Object service, Invoker rootInvoker)
[PATH1] foreach(Method m : service.getClass().getMethods())=T -> if(m.isAnnotationPresent(Timed.class))=T -> if(m.isAnnotationPresent(Metered.class))=T -> if(m.isAnnotationPresent(ExceptionMetered.class))=T -... | true | ok | {"focal": {"class": "InstrumentedInvokerFactory", "name": "create", "signature": "Invoker create(Object service, Invoker rootInvoker)", "start_line": 3, "modifiers": "public", "params": [{"name": "service", "type": "Object"}, {"name": "rootInvoker", "type": "Invoker"}], "return_type": "Invoker"}, "class_info": {"name":... |
9546194_0 | class Greeter {
public String sayHello() {
return "Hello world!";
}
private Greeter greeter;
}
class GreeterTest {
private Greeter greeter;
@Test
public void greeterSaysHello() {
| assertThat(greeter.sayHello(), containsString("Hello"));
}
} | [FOCAL] public String Greeter.sayHello()
[CLASS] class Greeter
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[TEST] GreeterTest: @Test public void greeterSaysHello()
[TEST-FIELDS] Greeter greeter | /* static context
[FOCAL] public String Greeter.sayHello()
*/
| /* static context
[FOCAL] public String Greeter.sayHello()
*/
class Greeter {
public String sayHello() {
return "Hello world!";
}
private Greeter greeter;
}
class GreeterTest {
private Greeter greeter;
@Test
public void greeterSaysHello() {
| true | ok | {"focal": {"class": "Greeter", "name": "sayHello", "signature": "String sayHello()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "Greeter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "greeter", "type": "Greeter... |
9553726_84 | class DiscountFactor {
public static BigDecimal calculate(RateAndPeriods rateAndPeriods) {
Objects.requireNonNull(rateAndPeriods);
// (1-(1+r)^n)/1-(1+rate)
final BigDecimal ONE = CalculationContext.one();
BigDecimal div = ONE.min(ONE.add(rateAndPeriods.getRate().get()));
Bi... | assertEquals(1, DiscountFactor.calculate(RateAndPeriods.of(0.00,0)).intValueExact());
assertEquals(1, DiscountFactor.calculate(RateAndPeriods.of(0.00,1)).intValueExact());
assertEquals(1, DiscountFactor.calculate(RateAndPeriods.of(0.00,10)).intValueExact());
}
} | [FOCAL] public static BigDecimal DiscountFactor.calculate(RateAndPeriods rateAndPeriods)
[CLASS] class DiscountFactor
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Objects.requireNonNull/1, CalculationContext.one/0, BigDecimal.min/1, BigDecimal.add/1, rateAndPeriods.getRate().get... | /* static context
[FOCAL] public static BigDecimal DiscountFactor.calculate(RateAndPeriods rateAndPeriods)
[INPUTS] branches=- | result=rateAndPeriods
[COLLABORATORS] param rateAndPeriods:RateAndPeriods getRate/0,getPeriods/0
[CALLS-EXTERNAL] Objects.requireNonNull/1, CalculationContext.one/0, BigDecimal.min/1, BigDeci... | /* static context
[FOCAL] public static BigDecimal DiscountFactor.calculate(RateAndPeriods rateAndPeriods)
[INPUTS] branches=- | result=rateAndPeriods
[COLLABORATORS] param rateAndPeriods:RateAndPeriods getRate/0,getPeriods/0
[CALLS-EXTERNAL] Objects.requireNonNull/1, CalculationContext.one/0, BigDecimal.min/1, BigDeci... | true | ok | {"focal": {"class": "DiscountFactor", "name": "calculate", "signature": "BigDecimal calculate(RateAndPeriods rateAndPeriods)", "start_line": 3, "modifiers": "public static", "params": [{"name": "rateAndPeriods", "type": "RateAndPeriods"}], "return_type": "BigDecimal"}, "class_info": {"name": "DiscountFactor", "kind": "... |
9577793_0 | class RequestParams {
public static Builder builder (String resource) {
return new Builder(resource);
}
public RequestParams(
String resource,
String primaryKey,
String primaryKeyValue,
String column,
String columnValue,
String query,
List<N... | assertThrows(IllegalStateException.class, () -> RequestParams.builder(resource).value("x"));
}
} | [FOCAL] public static Builder RequestParams.builder(String resource)
[CLASS] class RequestParams
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] Builder
[INPUTS] branches=- | result=resource
[DATAFLOW] resource@param->L2
[CLASS-MEMBERS] RequestParams(String resource, String primaryKey, String... | /* static context
[FOCAL] public static Builder RequestParams.builder(String resource)
[INPUTS] branches=- | result=resource
[NEW] Builder
*/
| /* static context
[FOCAL] public static Builder RequestParams.builder(String resource)
[INPUTS] branches=- | result=resource
[NEW] Builder
*/
class RequestParams {
public static Builder builder (String resource) {
return new Builder(resource);
}
public RequestParams(
String resource,
... | true | ok | {"focal": {"class": "RequestParams", "name": "builder", "signature": "Builder builder(String resource)", "start_line": 3, "modifiers": "public static", "params": [{"name": "resource", "type": "String"}], "return_type": "Builder"}, "class_info": {"name": "RequestParams", "kind": "class", "modifiers": "", "superclass": n... |
9580819_6 | class TkInbox implements Take {
@Override
public Response act(final Request req) throws IOException {
final String query = new RqHref.Smart(new RqHref.Base(req)).single(
"q", ""
);
return new RsPage(
"/xsl/inbox.xsl",
this.base,
req,
... | final String urn = "urn:test:2";
final MkBase base = new MkBase();
final Aliases aliases = base.user(new URN(urn)).aliases();
aliases.add("test2");
final Inbox inbox = aliases.iterate().iterator().next().inbox();
final Bout first = inbox.bout(inbox.start());
final... | [FOCAL] @Override public Response TkInbox.act(Request req)
[CLASS] class TkInbox implements Take
[METRICS] loc=14 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Iterable<XeSource> bouts(Request req, String query)
[CALLS-EXTERNAL] new RqHref.Smart(new RqHref.Base(req)).single/2
[NEW] RqHref.Smart,... | /* static context
[FOCAL] @Override public Response TkInbox.act(Request req)
[INPUTS] branches=- | result=req
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] Iterable<XeSource> bouts(Request req, String query)
[FIELDS] read=base
[NEW] RqHref.Smart, RqHref.Base, RsPage, XeAppend, XeLink, Href
[CALLS-EXTERNAL] new RqH... | /* static context
[FOCAL] @Override public Response TkInbox.act(Request req)
[INPUTS] branches=- | result=req
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] Iterable<XeSource> bouts(Request req, String query)
[FIELDS] read=base
[NEW] RqHref.Smart, RqHref.Base, RsPage, XeAppend, XeLink, Href
[CALLS-EXTERNAL] new RqH... | true | ok | {"focal": {"class": "TkInbox", "name": "act", "signature": "Response act(Request req) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "req", "type": "Request"}], "return_type": "Response"}, "class_info": {"name": "TkInbox", "kind": "class", "modifiers": "", "superclass": null,... |
9583260_14 | class XeFlow implements Flow {
@Override
public void binding(final String name, final String type) {
this.dirs.xpath(this.start).strict(1).addIf("bindings").up().xpath(
String.format(
"bindings[not(binding[name='%s' and type=%s])]",
name, XeOntology.escapeXPa... | final Directives dirs = new Directives().add("f");
final Flow flow = new XeFlow(dirs, "/f");
flow.binding("emp", "Employee");
flow.binding("one", "One");
MatcherAssert.assertThat(
XhtmlMatchers.xhtml(new Xembler(dirs).xml()),
XhtmlMatchers.hasXPaths(
... | [FOCAL] @Override public void XeFlow.binding(String name, String type)
[CLASS] class XeFlow implements Flow
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] this.dirs.xpath(this.start).strict(1).addIf("bindings").u....set/1, this.dirs.xpath(this.start).strict(1).addIf("bindings").u.... | /* static context
[FOCAL] @Override public void XeFlow.binding(String name, String type)
[COLLABORATORS] field dirs xpath/1
[FIELDS] read=dirs, start
[CALLS-EXTERNAL] this.dirs.xpath(this.start).strict(1).addIf("bindings").u....set/1, this.dirs.xpath(this.start).strict(1).addIf("bindings").u....add/1, this.dirs.xpath(t... | /* static context
[FOCAL] @Override public void XeFlow.binding(String name, String type)
[COLLABORATORS] field dirs xpath/1
[FIELDS] read=dirs, start
[CALLS-EXTERNAL] this.dirs.xpath(this.start).strict(1).addIf("bindings").u....set/1, this.dirs.xpath(this.start).strict(1).addIf("bindings").u....add/1, this.dirs.xpath(t... | true | ok | {"focal": {"class": "XeFlow", "name": "binding", "signature": "void binding(String name, String type)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "name", "type": "String"}, {"name": "type", "type": "String"}], "return_type": "void"}, "class_info": {"name": "XeFlow", "kind": "class", "modifie... |
9602474_1 | class FederationController {
public String getRepositoryName() throws RepositoryException{
Session repositorySession = newSession();
try {
return repositorySession.getRepository().getDescriptor(org.modeshape.jcr.api.Repository.REPOSITORY_NAME);
} finally {
repository... | assertEquals("federated-repository", federationController.getRepositoryName());
}
} | [FOCAL] public String FederationController.getRepositoryName()
[CLASS] class FederationController
[METRICS] loc=8 cc=2 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] Session newSession()
[CALLS-EXTERNAL] repositorySession.getRepository().getDescriptor/1, Session.getRepository/0, Session.logout/0
[EXCE... | /* static context
[FOCAL] public String FederationController.getRepositoryName()
[PATH1] return repositorySession.getRepository().getDescriptor(org.modeshape.jcr.a...
[PATH2] try-body throws
[EXCEPTIONS] declares RepositoryException
[CALLS-INTERNAL] Session newSession()
[CALLS-EXTERNAL] repositorySession.getRepository(... | /* static context
[FOCAL] public String FederationController.getRepositoryName()
[PATH1] return repositorySession.getRepository().getDescriptor(org.modeshape.jcr.a...
[PATH2] try-body throws
[EXCEPTIONS] declares RepositoryException
[CALLS-INTERNAL] Session newSession()
[CALLS-EXTERNAL] repositorySession.getRepository(... | true | ok | {"focal": {"class": "FederationController", "name": "getRepositoryName", "signature": "String getRepositoryName() throws RepositoryException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "FederationController", "kind": "class", "modifiers": "", "superclass": nu... |
9617158_0 | class RDAPCLI {
public static Type guessQueryType(String query) {
try {
if (query.matches("^\\d+$")) {
return Type.AUTNUM;
}
if (query.matches("^[\\d\\.:/]+$")) {
return Type.IP;
}
if (DomainName.of(query).getLevelSize() > 1) {
return Type.DOMAIN;
}
... | assertEquals(RDAPCLI.Type.AUTNUM,RDAPCLI.guessQueryType("12345"));
assertEquals(RDAPCLI.Type.IP,RDAPCLI.guessQueryType("127.0.0.0/8"));
assertEquals(RDAPCLI.Type.DOMAIN, RDAPCLI.guessQueryType("foo.example"));
assertEquals(RDAPCLI.Type.ENTITY,RDAPCLI.guessQueryType("handle"));
}
} | [FOCAL] public static Type RDAPCLI.guessQueryType(String query)
[CLASS] class RDAPCLI
[METRICS] loc=17 cc=5 branches=3 loops=0 returns=5 throws=0 nesting=2
[CALLS-EXTERNAL] String.matches/1, DomainName.of(query).getLevelSize/0, DomainName.of/1, LOGGER.debug/2
[EXCEPTIONS] catches IllegalArgumentException iae
[PATH1] if... | /* static context
[FOCAL] public static Type RDAPCLI.guessQueryType(String query)
[PATH1] if(query.matches("^\\d+$"))=F -> if(query.matches("^[\\d\\.:/]+$"))=F -> if(DomainName.of(query).getLevelSize() > 1)=T -> return Type.DOMAIN
[PATH2] try-body throws -> return Type.ENTITY
[PATH3] if(query.matches("^\\d+$"))=T -> re... | /* static context
[FOCAL] public static Type RDAPCLI.guessQueryType(String query)
[PATH1] if(query.matches("^\\d+$"))=F -> if(query.matches("^[\\d\\.:/]+$"))=F -> if(DomainName.of(query).getLevelSize() > 1)=T -> return Type.DOMAIN
[PATH2] try-body throws -> return Type.ENTITY
[PATH3] if(query.matches("^\\d+$"))=T -> re... | true | ok | {"focal": {"class": "RDAPCLI", "name": "guessQueryType", "signature": "Type guessQueryType(String query)", "start_line": 3, "modifiers": "public static", "params": [{"name": "query", "type": "String"}], "return_type": "Type"}, "class_info": {"name": "RDAPCLI", "kind": "class", "modifiers": "", "superclass": null, "inte... |
9634917_6 | class OpenPathwayCommonsTask extends AbstractTask {
public String getPathwayCommonsURL() {
EnrichmentMap map = emManager.getEnrichmentMap(network.getSUID());
if(map == null)
return null;
int port = Integer.parseInt(cy3props.getProperties().getProperty("rest.port"));
String pcBaseUri = propertyManager.ge... | CyNetwork network = networkManager.getNetwork(map.getNetworkID());
CyNode node = TestUtils.getNodes(network).get("TOP1_PLUS100");
propertyManager.setValue(PropertyManager.PATHWAY_COMMONS_URL, "http://pathway.commons/paint");
@SuppressWarnings("deprecation")
String returnUri = URLEncoder.encode("http://loca... | [FOCAL] public String OpenPathwayCommonsTask.getPathwayCommonsURL()
[CLASS] class OpenPathwayCommonsTask extends AbstractTask
[METRICS] loc=36 cc=4 branches=2 loops=0 returns=3 throws=0 nesting=2
[CALLS-INTERNAL] String getNodeLabel(EnrichmentMap map)
[CALLS-EXTERNAL] emManager.getEnrichmentMap/1, network.getSUID/0, In... | /* static context
[FOCAL] public String OpenPathwayCommonsTask.getPathwayCommonsURL()
[PATH1] if(map == null)=F -> try-body throws -> return null
[PATH2] if(map == null)=F -> if(node == null)=T -> return pcUri
[PATH3] if(map == null)=T -> return null
[PATH4] if(map == null)=F -> if(node == null)=F -> return pcUri
[COLL... | /* static context
[FOCAL] public String OpenPathwayCommonsTask.getPathwayCommonsURL()
[PATH1] if(map == null)=F -> try-body throws -> return null
[PATH2] if(map == null)=F -> if(node == null)=T -> return pcUri
[PATH3] if(map == null)=T -> return null
[PATH4] if(map == null)=F -> if(node == null)=F -> return pcUri
[COLL... | true | ok | {"focal": {"class": "OpenPathwayCommonsTask", "name": "getPathwayCommonsURL", "signature": "String getPathwayCommonsURL()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "OpenPathwayCommonsTask", "kind": "class", "modifiers": "", "superclass": "AbstractTask", "in... |
9650789_1 | class VerticaBulkLoaderMeta extends BaseStepMeta implements StepMetaInterface, ProvidesModelerMeta {
public String getXML() {
StringBuilder retval = new StringBuilder();
retval.append( " " + XMLHandler.addTagValue( "connection", databaseMeta == null ? "" : databaseMeta.getName() ) );
retval.append( "... | VerticaBulkLoaderMeta vbl = new VerticaBulkLoaderMeta();
vbl.setDefault();
vbl.setFieldDatabase( new String[] { "fieldDB1", "fieldDB2", "fieldDB3", "fieldDB4", "fieldDB5" } );
vbl.setFieldStream( new String[] { "fieldStr1", "fieldStr2", "fieldStr3" } );
try {
vbl.getXML();
fail( "Before... | [FOCAL] public String VerticaBulkLoaderMeta.getXML()
[CLASS] class VerticaBulkLoaderMeta extends BaseStepMeta implements StepMetaInterface, ProvidesModelerMeta
[METRICS] loc=26 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] StringBuilder.append/1, XMLHandler.addTagValue/2, databaseMeta.getName/0,... | /* static context
[FOCAL] public String VerticaBulkLoaderMeta.getXML()
[PATH1] for(i < fieldDatabase.length)=T -> exit loop -> return retval.toString()
[PATH2] for(i < fieldDatabase.length)=F -> return retval.toString()
[COLLABORATORS] field databaseMeta getName/0
[NEW] StringBuilder
[CALLS-EXTERNAL] StringBuilder.appe... | /* static context
[FOCAL] public String VerticaBulkLoaderMeta.getXML()
[PATH1] for(i < fieldDatabase.length)=T -> exit loop -> return retval.toString()
[PATH2] for(i < fieldDatabase.length)=F -> return retval.toString()
[COLLABORATORS] field databaseMeta getName/0
[NEW] StringBuilder
[CALLS-EXTERNAL] StringBuilder.appe... | true | ok | {"focal": {"class": "VerticaBulkLoaderMeta", "name": "getXML", "signature": "String getXML()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "VerticaBulkLoaderMeta", "kind": "class", "modifiers": "", "superclass": "BaseStepMeta", "interfaces": "StepMetaInterface,... |
9657943_0 | class Stats {
@GET
@Produces(MediaType.APPLICATION_JSON)
public String getStats()
{
StatsManager statsManager = this.statsManager;
if (this.statsManager != null)
{
return JSONSerializer.serializeStatistics(statsManager.getStatistics()).toJSONString();
}
... | Map<String, Object> fakeStats = new HashMap<>();
fakeStats.put("stat1", "value1");
fakeStats.put("stat2", "value2");
VideobridgeStatistics videobridgeStatistics = mock(VideobridgeStatistics.class);
when(videobridgeStatistics.getStats()).thenReturn(fakeStats);
when(statsMa... | [FOCAL] @GET @Produces(MediaType.APPLICATION_JSON) public String Stats.getStats()
[CLASS] class Stats
[METRICS] loc=12 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] JSONSerializer.serializeStatistics(statsManager.getStatis....toJSONString/0, JSONSerializer.serializeStatistics/1, StatsManager.get... | /* static context
[FOCAL] @GET @Produces(MediaType.APPLICATION_JSON) public String Stats.getStats()
[PATH1] if(this.statsManager != null)=T -> return JSONSerializer.serializeStatistics(statsManager.getStatistics()).to...
[PATH2] if(this.statsManager != null)=F -> return new JSONObject().toJSONString()
[INPUTS] branches... | /* static context
[FOCAL] @GET @Produces(MediaType.APPLICATION_JSON) public String Stats.getStats()
[PATH1] if(this.statsManager != null)=T -> return JSONSerializer.serializeStatistics(statsManager.getStatistics()).to...
[PATH2] if(this.statsManager != null)=F -> return new JSONObject().toJSONString()
[INPUTS] branches... | true | ok | {"focal": {"class": "Stats", "name": "getStats", "signature": "String getStats()", "start_line": 3, "modifiers": "@GET @Produces(MediaType.APPLICATION_JSON) public", "params": [], "return_type": "String"}, "class_info": {"name": "Stats", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields"... |
9667687_64 | class AccessControlQueries {
public ExecutionResult findAdminForResource( String resourceName )
{
String query = "MATCH (resource:Resource {name:{resourceName}})\n" +
"MATCH p=(resource)-[:WORKS_FOR|HAS_ACCOUNT*1..2]-(company)\n" +
" -[:CHILD_OF*0..3... | // Account-10 is associated with One-ManShop
// One-ManShop-CHILD_OF->Subsidiary-CHILD_OF->AcquiredLtd->CHILD_OF->BigCompany
// Liz is a member of:
// Group-6, which has ALLOWED_DO_NOT_INHERIT to OneManShop
// Group-5, which has DENIED on AcquiredLtd
// Group-4, wh... | [FOCAL] public ExecutionResult AccessControlQueries.findAdminForResource(String resourceName)
[CLASS] class AccessControlQueries
[METRICS] loc=18 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Map<String, Object>.put/2, executionEngine.execute/2
[NEW] HashMap<>
[COLLABORATORS] field executionEngi... | /* static context
[FOCAL] public ExecutionResult AccessControlQueries.findAdminForResource(String resourceName)
[COLLABORATORS] field executionEngine execute/2
[NEW] HashMap<>
[CALLS-EXTERNAL] Map<String, Object>.put/2, executionEngine.execute/2
*/
| /* static context
[FOCAL] public ExecutionResult AccessControlQueries.findAdminForResource(String resourceName)
[COLLABORATORS] field executionEngine execute/2
[NEW] HashMap<>
[CALLS-EXTERNAL] Map<String, Object>.put/2, executionEngine.execute/2
*/
class AccessControlQueries {
public ExecutionResult findAdminForRe... | true | ok | {"focal": {"class": "AccessControlQueries", "name": "findAdminForResource", "signature": "ExecutionResult findAdminForResource(String resourceName)", "start_line": 3, "modifiers": "public", "params": [{"name": "resourceName", "type": "String"}], "return_type": "ExecutionResult"}, "class_info": {"name": "AccessControlQu... |
9685461_21 | class APIReader {
public String executePostUrl() throws IOException {
return executePostUrl("");
}
public APIReader(UriBuilder uriBuilder);
public APIReader(String url);
public APIReader(URL url);
public APIReader setHeader(String header, String value);
public String executeGet... | //Given
when(mockConnection.getInputStream()).thenReturn(IOUtils.toInputStream("response"));
//When
String response = apiReader.executePostUrl();
//Then
assertThat(response, is("response"));
}
} | [FOCAL] public String APIReader.executePostUrl()
[CLASS] class APIReader
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String executePostUrl(String urlParameters)
[EXCEPTIONS] declares IOException
[CLASS-MEMBERS] APIReader(UriBuilder uriBuilder); APIReader(String url); APIReader(... | /* static context
[FOCAL] public String APIReader.executePostUrl()
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] String executePostUrl(String urlParameters)
*/
| /* static context
[FOCAL] public String APIReader.executePostUrl()
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] String executePostUrl(String urlParameters)
*/
class APIReader {
public String executePostUrl() throws IOException {
return executePostUrl("");
}
public APIReader(UriBuilder uriBu... | true | ok | {"focal": {"class": "APIReader", "name": "executePostUrl", "signature": "String executePostUrl() throws IOException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "APIReader", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{... |
9702026_7 | class PathUtil {
public static Path getUserIgnoreDir()
{
return getUserSubdirectory(IGNORE_DIRECTORY_NAME);
}
public static Path getWindupUserDir();
public static Path getWindupHome();
public static void setWindupHome(Path windupHome);
public static Path getUserCacheDir();
publ... | Assert.assertEquals(Paths.get("ignore"), PathUtil.getUserIgnoreDir());
setUserHome("/foo");
Assert.assertEquals(Paths.get("/foo", ".mta", "ignore"), PathUtil.getUserIgnoreDir());
}
} | [FOCAL] public static Path PathUtil.getUserIgnoreDir()
[CLASS] class PathUtil
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Path getUserSubdirectory(String subdirectory)
[CLASS-MEMBERS] Path getWindupUserDir(); Path getWindupHome(); void setWindupHome(Path windupHome); Path getUs... | /* static context
[FOCAL] public static Path PathUtil.getUserIgnoreDir()
[CALLS-INTERNAL] Path getUserSubdirectory(String subdirectory)
*/
| /* static context
[FOCAL] public static Path PathUtil.getUserIgnoreDir()
[CALLS-INTERNAL] Path getUserSubdirectory(String subdirectory)
*/
class PathUtil {
public static Path getUserIgnoreDir()
{
return getUserSubdirectory(IGNORE_DIRECTORY_NAME);
}
public static Path getWindupUserDir();
pu... | true | ok | {"focal": {"class": "PathUtil", "name": "getUserIgnoreDir", "signature": "Path getUserIgnoreDir()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Path"}, "class_info": {"name": "PathUtil", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "windu... |
9706311_22 | class GatewaySelector {
public Gateway select() {
return closestGateway();
}
public GatewaySelector(List<Gateway> gateways);
public Gateway select(int nClosest);
private Gateway closestGateway();
private TreeMap<Integer, Set<Gateway>> calculateOffsets();
private int timezoneDista... | when(ConfigHelper.getCurrentTimezone()).thenReturn(timezone);
gatewaySelector = new GatewaySelector(gatewayList);
ArrayList<String> gateways = new ArrayList<>();
gateways.add(gatewaySelector.select(0).getName());
gateways.add(gatewaySelector.select(1).getName());
assertT... | [FOCAL] public Gateway GatewaySelector.select()
[CLASS] class GatewaySelector
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Gateway closestGateway()
[CLASS-MEMBERS] GatewaySelector(List<Gateway> gateways); Gateway select(int nClosest); Gateway closestGateway(); TreeMap<Integer, S... | /* static context
[FOCAL] public Gateway GatewaySelector.select()
[CALLS-INTERNAL] Gateway closestGateway()
*/
| /* static context
[FOCAL] public Gateway GatewaySelector.select()
[CALLS-INTERNAL] Gateway closestGateway()
*/
class GatewaySelector {
public Gateway select() {
return closestGateway();
}
public GatewaySelector(List<Gateway> gateways);
public Gateway select(int nClosest);
private Gateway... | true | ok | {"focal": {"class": "GatewaySelector", "name": "select", "signature": "Gateway select()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Gateway"}, "class_info": {"name": "GatewaySelector", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "TAG", "type"... |
9708055_10 | class CeSymmMain {
public static List<String> parseInputStructures(String filename)
throws FileNotFoundException {
File file = new File(filename);
Scanner s = new Scanner(file);
List<String> structures = new ArrayList<String>();
while (s.hasNext()) {
String name = s.next();
if (name.startsWith("#"))... | URL url = CeSymmMainTest.class.getResource("/cesymmtest.txt");
String filename = url.getFile();
List<String> names = CeSymmMain.parseInputStructures(filename);
assertEquals(6,names.size());
int i = 0;
assertEquals("d1ijqa1",names.get(i++));
assertEquals("1G6S",names.get(i++));
assertEquals("1MER.A",n... | [FOCAL] public static List<String> CeSymmMain.parseInputStructures(String filename)
[CLASS] class CeSymmMain
[METRICS] loc=18 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] Scanner.hasNext/0, Scanner.next/0, String.startsWith/1, Scanner.nextLine/0, List<String>.add/1, Scanner.close/0
[NEW] File, ... | /* static context
[FOCAL] public static List<String> CeSymmMain.parseInputStructures(String filename)
[PATH1] while(s.hasNext())=T -> if(name.startsWith("#"))=T -> exit loop -> return structures
[PATH2] while(s.hasNext())=F -> return structures
[PATH3] while(s.hasNext())=T -> if(name.startsWith("#"))=F -> exit loop -> ... | /* static context
[FOCAL] public static List<String> CeSymmMain.parseInputStructures(String filename)
[PATH1] while(s.hasNext())=T -> if(name.startsWith("#"))=T -> exit loop -> return structures
[PATH2] while(s.hasNext())=F -> return structures
[PATH3] while(s.hasNext())=T -> if(name.startsWith("#"))=F -> exit loop -> ... | true | ok | {"focal": {"class": "CeSymmMain", "name": "parseInputStructures", "signature": "List<String> parseInputStructures(String filename) throws FileNotFoundException", "start_line": 3, "modifiers": "public static", "params": [{"name": "filename", "type": "String"}], "return_type": "List<String>"}, "class_info": {"name": "CeS... |
9713275_247 | class DuplicateOperations {
public void markDirectoryAs(Path directory, Tag tag) {
if (!isDirectory(directory)) {
logger.warn("Directory {} not valid, aborting.", directory);
return;
}
try {
int addCount = 0;
Iterator<Path> iter = Files.newDirectoryStream(directory).iterator();
while (iter.hasN... | createTempTestFiles(3);
dupOp.markDirectoryAs(tempDirectory, TAG_FOO);
verify(imageRepository, times(3)).getByPath(any(Path.class));
verify(filterRepository, never()).store(any(FilterRecord.class));
}
} | [FOCAL] public void DuplicateOperations.markDirectoryAs(Path directory, Tag tag)
[CLASS] class DuplicateOperations
[METRICS] loc=23 cc=5 branches=2 loops=1 returns=1 throws=0 nesting=3
[CALLS-INTERNAL] boolean isDirectory(Path directory); void markAs(Result result, Tag tag)
[CALLS-EXTERNAL] logger.warn/2, Files.newDire... | /* static context
[FOCAL] public void DuplicateOperations.markDirectoryAs(Path directory, Tag tag)
[PATH1] if(!isDirectory(directory))=F -> while(iter.hasNext())=T -> if(Files.isRegularFile(current))=T -> exit loop
[PATH2] if(!isDirectory(directory))=T -> return
[PATH3] if(!isDirectory(directory))=F -> try-body throws
... | /* static context
[FOCAL] public void DuplicateOperations.markDirectoryAs(Path directory, Tag tag)
[PATH1] if(!isDirectory(directory))=F -> while(iter.hasNext())=T -> if(Files.isRegularFile(current))=T -> exit loop
[PATH2] if(!isDirectory(directory))=T -> return
[PATH3] if(!isDirectory(directory))=F -> try-body throws
... | true | ok | {"focal": {"class": "DuplicateOperations", "name": "markDirectoryAs", "signature": "void markDirectoryAs(Path directory, Tag tag)", "start_line": 3, "modifiers": "public", "params": [{"name": "directory", "type": "Path"}, {"name": "tag", "type": "Tag"}], "return_type": "void"}, "class_info": {"name": "DuplicateOperatio... |
9721255_36 | class Peer {
public ListenableFuture<Block> getBlock(Sha256Hash blockHash) throws IOException {
// This does not need to be locked.
log.info("Request to fetch block {}", blockHash);
GetDataMessage getdata = new GetDataMessage(params);
getdata.addBlock(blockHash);
return send... | control.replay();
connect();
Block b1 = createFakeBlock(blockStore).block;
blockChain.add(b1);
Block b2 = makeSolvedTestBlock(b1);
Block b3 = makeSolvedTestBlock(b2);
// Request the block.
Future<Block> resultFuture = peer.getBlock(b3.getHash())... | [FOCAL] public ListenableFuture<Block> Peer.getBlock(Sha256Hash blockHash)
[CLASS] class Peer
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] ListenableFuture sendSingleGetData(GetDataMessage getdata)
[CALLS-EXTERNAL] log.info/2, GetDataMessage.addBlock/1
[NEW] GetDataMessage
[EXCE... | /* static context
[FOCAL] public ListenableFuture<Block> Peer.getBlock(Sha256Hash blockHash)
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] ListenableFuture sendSingleGetData(GetDataMessage getdata)
[NEW] GetDataMessage
[CALLS-EXTERNAL] log.info/2, GetDataMessage.addBlock/1
*/
| /* static context
[FOCAL] public ListenableFuture<Block> Peer.getBlock(Sha256Hash blockHash)
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] ListenableFuture sendSingleGetData(GetDataMessage getdata)
[NEW] GetDataMessage
[CALLS-EXTERNAL] log.info/2, GetDataMessage.addBlock/1
*/
class Peer {
public ListenableFut... | true | ok | {"focal": {"class": "Peer", "name": "getBlock", "signature": "ListenableFuture<Block> getBlock(Sha256Hash blockHash) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "blockHash", "type": "Sha256Hash"}], "return_type": "ListenableFuture<Block>"}, "class_info": {"name": "Peer", "kind": "cl... |
9731550_14 | class BerInteger {
public int decode(InputStream iStream, boolean explicit) throws IOException {
int codeLength = 0;
if (explicit) {
codeLength += id.decodeAndCheck(iStream);
}
BerLength length = new BerLength();
codeLength += length.decode(iStream);
if (length.val < 1 || length.val > 8) {
throw... | byte[] byteCode = new byte[] { 0x02, 0x02, 0x15, (byte) 0xb3 };
ByteArrayInputStream berInputStream = new ByteArrayInputStream(byteCode);
BerInteger asn1Integer = new BerInteger();
asn1Integer.decode(berInputStream, true);
Assert.assertEquals(5555, asn1Integer.val);
}
} | [FOCAL] public int BerInteger.decode(InputStream iStream, boolean explicit)
[CLASS] class BerInteger
[METRICS] loc=30 cc=5 branches=3 loops=1 returns=1 throws=2 nesting=1
[CALLS-EXTERNAL] id.decodeAndCheck/1, BerLength.decode/1, InputStream.read/3
[NEW] BerLength, IOException
[EXCEPTIONS] declares IOException; throws I... | /* static context
[FOCAL] public int BerInteger.decode(InputStream iStream, boolean explicit)
[THROWS-WHEN] IOException when explicit && length.val < 1 || length.val > 8
[THROWS-WHEN] IOException when explicit && !(length.val < 1 || length.val > 8) && iStream.read(byteCode, 0, length.val) < length.val
[THROWS-WHEN] IOE... | /* static context
[FOCAL] public int BerInteger.decode(InputStream iStream, boolean explicit)
[THROWS-WHEN] IOException when explicit && length.val < 1 || length.val > 8
[THROWS-WHEN] IOException when explicit && !(length.val < 1 || length.val > 8) && iStream.read(byteCode, 0, length.val) < length.val
[THROWS-WHEN] IOE... | true | ok | {"focal": {"class": "BerInteger", "name": "decode", "signature": "int decode(InputStream iStream, boolean explicit) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "iStream", "type": "InputStream"}, {"name": "explicit", "type": "boolean"}], "return_type": "int"}, "class_info": {"name": ... |
9754885_0 | class ScorePair {
public ScorePair(MatchingConfig mc) {
this.mc = mc;
vt = new VectorTable(mc);
modifiers = new ArrayList<Modifier>();
observed_vectors = new Hashtable<MatchVector, Long>();
}
public ScorePair(MatchingConfig mc);
public void addScoreModifier(Modifier sm);
public MatchResult scorePair(Re... |
// set up the records
Record rec1 = new Record(1, "foo");
Record rec2 = new Record(2, "foo");
rec1.addDemographic("(Identifier) Old OpenMRS Identifier", "111,222,333");
rec2.addDemographic("(Identifier) Old OpenMRS Identifier", "222,444,555");
// add the identifier demographic for scoring
MatchingCo... | [FOCAL] public ScorePair.ScorePair(MatchingConfig mc)
[CLASS] class ScorePair
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[NEW] VectorTable, ArrayList<Modifier>, Hashtable<MatchVector, Long>
[FIELDS] write=mc
[STATE] mc
[DATAFLOW] mc@param->L2,L3
[CLASS-MEMBERS] ScorePair(MatchingConfig mc); vo... | /* static context
[FOCAL] public ScorePair.ScorePair(MatchingConfig mc)
[STATE] mc
[FIELDS] write=mc
[NEW] VectorTable, ArrayList<Modifier>, Hashtable<MatchVector, Long>
*/
| /* static context
[FOCAL] public ScorePair.ScorePair(MatchingConfig mc)
[STATE] mc
[FIELDS] write=mc
[NEW] VectorTable, ArrayList<Modifier>, Hashtable<MatchVector, Long>
*/
class ScorePair {
public ScorePair(MatchingConfig mc) {
this.mc = mc;
vt = new VectorTable(mc);
modifiers = new ArrayList<Modifier>();
ob... | true | ok | {"focal": {"class": "ScorePair", "name": "ScorePair", "signature": "ScorePair(MatchingConfig mc)", "start_line": 3, "modifiers": "public", "params": [{"name": "mc", "type": "MatchingConfig"}], "return_type": null}, "class_info": {"name": "ScorePair", "kind": "class", "modifiers": "", "superclass": null, "interfaces": n... |
9755019_5 | class QualityInvestmentPlanService {
public QualityInvestmentPlan computeInvestmentPlan(QualityAnalysis analysis, String basePackage, int investmentInMinutes) {
Multimap<Double, QualityViolation> violationsByProfit = ArrayListMultimap.create();
for (QualityViolation violation : filterViolationsByArtefactName... | QualityInvestmentPlan qualityInvestmentPlan = investmentPlanService.computeInvestmentPlan(analysis, "", 80);
QualityInvestmentPlanEntry[] investments = qualityInvestmentPlan.getEntries().toArray(new QualityInvestmentPlanEntry[0]);
assertThat(investments).hasSize(3);
assertThat(investments[0].getArtefact... | [FOCAL] public QualityInvestmentPlan QualityInvestmentPlanService.computeInvestmentPlan(QualityAnalysis analysis, String basePackage, int investmentInMinutes)
[CLASS] class QualityInvestmentPlanService
[METRICS] loc=52 cc=8 branches=2 loops=5 returns=1 throws=0 nesting=3
[CALLS-INTERNAL] Collection<QualityViolation> fi... | /* static context
[FOCAL] public QualityInvestmentPlan QualityInvestmentPlanService.computeInvestmentPlan(QualityAnalysis analysis, String basePackage, int investmentInMinutes)
[PATH1] foreach(QualityViolation violation : filterViolationsByArtefactNameStartingWith(basePackage, analysis.getViolation...)=T -> if(Math.rou... | /* static context
[FOCAL] public QualityInvestmentPlan QualityInvestmentPlanService.computeInvestmentPlan(QualityAnalysis analysis, String basePackage, int investmentInMinutes)
[PATH1] foreach(QualityViolation violation : filterViolationsByArtefactNameStartingWith(basePackage, analysis.getViolation...)=T -> if(Math.rou... | true | ok | {"focal": {"class": "QualityInvestmentPlanService", "name": "computeInvestmentPlan", "signature": "QualityInvestmentPlan computeInvestmentPlan(QualityAnalysis analysis, String basePackage, int investmentInMinutes)", "start_line": 3, "modifiers": "public", "params": [{"name": "analysis", "type": "QualityAnalysis"}, {"na... |
9775946_3 | class WisePageFactory {
public static <T> T initElements(WebDriver driver, Class<T> clazz) {
T instance = instantiatePage(driver, clazz);
return initElements(driver, instance);
}
private WisePageFactory();
public static T initElements(SearchContext searchContext, T instance);
private static T instantiatePa... | DummyPageWithNoArgConstructor page = WisePageFactory.initElements(this.driver, DummyPageWithNoArgConstructor.class);
assertNotNull(page.getDummyComponent());
}
} | [FOCAL] public static T WisePageFactory.initElements(WebDriver driver, Class<T> clazz)
[CLASS] class WisePageFactory
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] T initElements(SearchContext searchContext, T instance); T instantiatePage(WebDriver driver, Class<T> clazz)
[INPUTS]... | /* static context
[FOCAL] public static T WisePageFactory.initElements(WebDriver driver, Class<T> clazz)
[INPUTS] branches=- | result=clazz, driver
[CALLS-INTERNAL] T initElements(SearchContext searchContext, T instance); T instantiatePage(WebDriver driver, Class<T> clazz)
*/
| /* static context
[FOCAL] public static T WisePageFactory.initElements(WebDriver driver, Class<T> clazz)
[INPUTS] branches=- | result=clazz, driver
[CALLS-INTERNAL] T initElements(SearchContext searchContext, T instance); T instantiatePage(WebDriver driver, Class<T> clazz)
*/
class WisePageFactory {
public static <T>... | true | ok | {"focal": {"class": "WisePageFactory", "name": "initElements", "signature": "T initElements(WebDriver driver, Class<T> clazz)", "start_line": 3, "modifiers": "public static", "params": [{"name": "driver", "type": "WebDriver"}, {"name": "clazz", "type": "Class<T>"}], "return_type": "T"}, "class_info": {"name": "WisePage... |
9779351_36 | class LexOperator {
public Token read() throws IOException, LexerException
{
int index = in_stream.getPosition();
int line = in_stream.getLine();
int col = in_stream.getCol();
int next = in_stream.peek();
if (next == -1) {
// end of stream!
throw... | String str = "a&=b|c|=d&e^=f^g;";
LexerStream ls = new LexerStream(new StringReader(str));
LexOperator lex = new LexOperator(new BaseTokenFactory(), ls);
ls.read();
Token tok = lex.read();
assertEquals(TokenType.BitwiseAndAssign, tok.getType());
assertEquals(1... | [FOCAL] public Token LexOperator.read()
[CLASS] class LexOperator
[METRICS] loc=271 cc=67 branches=28 loops=0 returns=63 throws=2 nesting=5
[CALLS-EXTERNAL] in_stream.getPosition/0, in_stream.getLine/0, in_stream.getCol/0, in_stream.peek/0, in_stream.peek/1, Character.isDigit/1, in_stream.read/0, factory.create/5, fact... | class LexOperator {
public Token read() throws IOException, LexerException
{
int index = in_stream.getPosition();
int line = in_stream.getLine();
int col = in_stream.getCol();
int next = in_stream.peek();
if (next == -1) {
// end of stream!
throw... | false | ok | {"focal": {"class": "LexOperator", "name": "read", "signature": "Token read() throws IOException, LexerException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Token"}, "class_info": {"name": "LexOperator", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], ... | |
9797598_3 | class DefaultRegisteredServiceMfaRoleProcessorImpl implements RegisteredServiceMfaRoleProcessor {
public List<MultiFactorAuthenticationRequestContext> resolve(@NotNull final Authentication authentication,
@NotNull final WebApplicationService targetSe... | final WebApplicationService was = getTargetService();
final Authentication auth = getAuthentication(true);
final RegisteredService rswa = TestUtils.getRegisteredService("test1");
final DefaultRegisteredServiceProperty prop = new DefaultRegisteredServiceProperty();
prop.setValue... | [FOCAL] public List<MultiFactorAuthenticationRequestContext> DefaultRegisteredServiceMfaRoleProcessorImpl.resolve(Authentication authentication, WebApplicationService targetService)
[CLASS] class DefaultRegisteredServiceMfaRoleProcessorImpl implements RegisteredServiceMfaRoleProcessor
[METRICS] loc=57 cc=13 branches=10... | /* static context
[FOCAL] public List<MultiFactorAuthenticationRequestContext> DefaultRegisteredServiceMfaRoleProcessorImpl.resolve(Authentication authentication, WebApplicationService targetService)
[PATH1] if(authentication != null && targetService != null)=T -> if(serviceMfaData == null || !serviceMfaData.isValid())... | /* static context
[FOCAL] public List<MultiFactorAuthenticationRequestContext> DefaultRegisteredServiceMfaRoleProcessorImpl.resolve(Authentication authentication, WebApplicationService targetService)
[PATH1] if(authentication != null && targetService != null)=T -> if(serviceMfaData == null || !serviceMfaData.isValid())... | true | ok | {"focal": {"class": "DefaultRegisteredServiceMfaRoleProcessorImpl", "name": "resolve", "signature": "List<MultiFactorAuthenticationRequestContext> resolve(Authentication authentication, WebApplicationService targetService)", "start_line": 3, "modifiers": "public", "params": [{"name": "authentication", "type": "Authenti... |
9812178_36 | class Schooljaar implements IBeginEinddatumEntiteit, Comparable<Schooljaar>,
Serializable {
public static Schooljaar parse(String value)
{
Pattern[] patterns = new Pattern[] {officieel, kort};
for (Pattern pattern : patterns)
{
Matcher matcher = pattern.matcher(value);
if (!matcher.matches())
{
... | assertThat(Schooljaar.parse("2008A2009"), is(nullValue()));
}
} | [FOCAL] public static Schooljaar Schooljaar.parse(String value)
[CLASS] class Schooljaar implements IBeginEinddatumEntiteit, Comparable<Schooljaar>, Serializable
[METRICS] loc=22 cc=4 branches=2 loops=1 returns=3 throws=0 nesting=2
[CALLS-EXTERNAL] Pattern.matcher/1, Matcher.matches/0, Matcher.group/1, TimeUtil.getInst... | /* static context
[FOCAL] public static Schooljaar Schooljaar.parse(String value)
[PATH1] foreach(Pattern pattern : patterns)=T -> if(!matcher.matches())=T -> exit loop -> return null
[PATH2] foreach(Pattern pattern : patterns)=T -> if(!matcher.matches())=F -> if(startJaar == null)=F -> return Schooljaar.valueOf(date)
... | /* static context
[FOCAL] public static Schooljaar Schooljaar.parse(String value)
[PATH1] foreach(Pattern pattern : patterns)=T -> if(!matcher.matches())=T -> exit loop -> return null
[PATH2] foreach(Pattern pattern : patterns)=T -> if(!matcher.matches())=F -> if(startJaar == null)=F -> return Schooljaar.valueOf(date)
... | true | ok | {"focal": {"class": "Schooljaar", "name": "parse", "signature": "Schooljaar parse(String value)", "start_line": 4, "modifiers": "public static", "params": [{"name": "value", "type": "String"}], "return_type": "Schooljaar"}, "class_info": {"name": "Schooljaar", "kind": "class", "modifiers": "", "superclass": null, "inte... |
9821876_552 | class DoubleConverter implements Converter<Double> {
@Override
public Double convert(String value, Class<? extends Double> type) {
if (isNullOrEmpty(value)) {
return null;
}
try {
return getNumberFormat().parse(value).doubleValue();
} catch (ParseException e) {
throw new ConversionException(new Con... | assertThat(converter.convert("10,00", Double.class), is(equalTo(new Double("10.00"))));
assertThat(converter.convert("10,01", Double.class), is(equalTo(new Double("10.01"))));
}
} | [FOCAL] @Override public Double DoubleConverter.convert(String value, Class<? extends Double> type)
[CLASS] class DoubleConverter implements Converter<Double>
[METRICS] loc=12 cc=3 branches=1 loops=0 returns=2 throws=1 nesting=1
[CALLS-INTERNAL] NumberFormat getNumberFormat()
[CALLS-EXTERNAL] isNullOrEmpty/1 (inherited... | /* static context
[FOCAL] @Override public Double DoubleConverter.convert(String value, Class<? extends Double> type)
[THROWS-WHEN] ConversionException when !isNullOrEmpty(value) && try-body throws
[PATH1] if(isNullOrEmpty(value))=F -> try-body throws -> throw new ConversionException(new ConversionMessage(INVALID_MESSA... | /* static context
[FOCAL] @Override public Double DoubleConverter.convert(String value, Class<? extends Double> type)
[THROWS-WHEN] ConversionException when !isNullOrEmpty(value) && try-body throws
[PATH1] if(isNullOrEmpty(value))=F -> try-body throws -> throw new ConversionException(new ConversionMessage(INVALID_MESSA... | true | ok | {"focal": {"class": "DoubleConverter", "name": "convert", "signature": "Double convert(String value, Class<? extends Double> type)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "value", "type": "String"}, {"name": "type", "type": "Class<? extends Double>"}], "return_type": "Double"}, "class_in... |
9854553_37 | class ClassUtils {
public static String determineQualifiedName(String className) {
String readableClassName = StringUtils.removeWhitespace(className);
if (readableClassName == null) {
throw new IllegalArgumentException("readableClassName must not be null.");
} else if (readab... |
String className = "org.jadira.bindings.core.utils.string.ClassUtilsTest";
assertEquals("org.jadira.bindings.core.utils.string.ClassUtilsTest", ClassUtils.determineQualifiedName(className));
assertEquals("org.jadira.bindings.core.utils.string.ClassUtilsTest", ClassUtils.determi... | [FOCAL] public static String ClassUtils.determineQualifiedName(String className)
[CLASS] class ClassUtils
[METRICS] loc=28 cc=5 branches=3 loops=1 returns=1 throws=1 nesting=3
[CALLS-EXTERNAL] StringUtils.removeWhitespace/1, String.endsWith/1, String.substring/2, String.length/0, StringBuilder.append/1, PRIMITIVE_MAPPI... | /* static context
[FOCAL] public static String ClassUtils.determineQualifiedName(String className)
[THROWS-WHEN] IllegalArgumentException when readableClassName == null
[PATH1] if(readableClassName == null)=F -> if(readableClassName.endsWith("[]"))=T -> while(readableClassName.endsWith("[]"))=T -> exit loop -> if(abbre... | /* static context
[FOCAL] public static String ClassUtils.determineQualifiedName(String className)
[THROWS-WHEN] IllegalArgumentException when readableClassName == null
[PATH1] if(readableClassName == null)=F -> if(readableClassName.endsWith("[]"))=T -> while(readableClassName.endsWith("[]"))=T -> exit loop -> if(abbre... | true | ok | {"focal": {"class": "ClassUtils", "name": "determineQualifiedName", "signature": "String determineQualifiedName(String className)", "start_line": 3, "modifiers": "public static", "params": [{"name": "className", "type": "String"}], "return_type": "String"}, "class_info": {"name": "ClassUtils", "kind": "class", "modifie... |
9882334_4 | class HttpClient {
public HttpRequestBuilder post() {
return new RB(Method.POST);
}
public HttpClient();
public HttpClient(boolean compress, int maxChunkSize, int threads,
int maxInitialLineLength, int maxHeadersSize, boolean followRedirects,
CharSequence userAgent, L... | final AM am = new AM();
final String ur = "http://foo.bar:" + server.httpPort() + "/foo";
client.addActivityMonitor(am);
final DeferredAssertions assertions = new DeferredAssertions();
final Set<StateType> stateTypes = new HashSet<>();
final String[] xheader = new String[... | [FOCAL] public HttpRequestBuilder HttpClient.post()
[CLASS] class HttpClient
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] RB
[CLASS-MEMBERS] HttpClient(); HttpClient(boolean compress, int maxChunkSize, int threads, int maxInitialLineLength, int maxHeadersSize, boolean followRedirects, Char... | /* static context
[FOCAL] public HttpRequestBuilder HttpClient.post()
[NEW] RB
*/
| /* static context
[FOCAL] public HttpRequestBuilder HttpClient.post()
[NEW] RB
*/
class HttpClient {
public HttpRequestBuilder post() {
return new RB(Method.POST);
}
public HttpClient();
public HttpClient(boolean compress, int maxChunkSize, int threads,
int maxInitialLineLength, ... | true | ok | {"focal": {"class": "HttpClient", "name": "post", "signature": "HttpRequestBuilder post()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "HttpRequestBuilder"}, "class_info": {"name": "HttpClient", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "serv... |
9884445_95 | class OneToManyAnnotationHandler extends AbstractEntityAnnotationHandler {
@Override
public void handle(EntityMetaData metaData, Annotation annotation, Method method) {
Class<?> elementType = getElementType(method.getGenericReturnType());
CollectionMetaData collectionMetaData = new CollectionMetaData(metaData.ge... | Method method = DummyModel.class.getDeclaredMethod("getChildren");
handler.handle(metaData, annotation, method);
CollectionMetaData data = new CollectionMetaData(DummyModel.class, "children", DummyModel.class, Set.class, true);
verify(metaData).addCollection(data);
}
} | [FOCAL] @Override public void OneToManyAnnotationHandler.handle(EntityMetaData metaData, Annotation annotation, Method method)
[CLASS] class OneToManyAnnotationHandler extends AbstractEntityAnnotationHandler
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] getElementType/1 (inherite... | /* static context
[FOCAL] @Override public void OneToManyAnnotationHandler.handle(EntityMetaData metaData, Annotation annotation, Method method)
[INPUTS] branches=- | result=- | unused=annotation
[COLLABORATORS] param method:Method getGenericReturnType/0,getReturnType/0; param metaData:EntityMetaData getEntityClass/0,a... | /* static context
[FOCAL] @Override public void OneToManyAnnotationHandler.handle(EntityMetaData metaData, Annotation annotation, Method method)
[INPUTS] branches=- | result=- | unused=annotation
[COLLABORATORS] param method:Method getGenericReturnType/0,getReturnType/0; param metaData:EntityMetaData getEntityClass/0,a... | true | ok | {"focal": {"class": "OneToManyAnnotationHandler", "name": "handle", "signature": "void handle(EntityMetaData metaData, Annotation annotation, Method method)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "metaData", "type": "EntityMetaData"}, {"name": "annotation", "type": "Annotation"}, {"name... |
9897034_1 | class PubService {
public Beer findBeerById(final long id) {
return beerRepository.findOne(id);
}
public long getBeersCount();
public Beer createBeer(final String name, final int alcoholPercentage);
public BrewingCompany createBrewingCompany(final String name);
public Iterable<Beer> ge... | service.populateData();
for (Beer beer : service.getAllBeers()) {
Beer foundBeer = service.findBeerById(beer.getId());
assertNotNull(foundBeer);
}
}
} | [FOCAL] public Beer PubService.findBeerById(long id)
[CLASS] class PubService
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] beerRepository.findOne/1
[INPUTS] branches=- | result=id
[COLLABORATORS] field beerRepository findOne/1
[DATAFLOW] id@param->L2
[CLASS-MEMBERS] long getBeer... | /* static context
[FOCAL] public Beer PubService.findBeerById(long id)
[INPUTS] branches=- | result=id
[COLLABORATORS] field beerRepository findOne/1
[CALLS-EXTERNAL] beerRepository.findOne/1
*/
| /* static context
[FOCAL] public Beer PubService.findBeerById(long id)
[INPUTS] branches=- | result=id
[COLLABORATORS] field beerRepository findOne/1
[CALLS-EXTERNAL] beerRepository.findOne/1
*/
class PubService {
public Beer findBeerById(final long id) {
return beerRepository.findOne(id);
}
publi... | true | ok | {"focal": {"class": "PubService", "name": "findBeerById", "signature": "Beer findBeerById(long id)", "start_line": 3, "modifiers": "public", "params": [{"name": "id", "type": "long"}], "return_type": "Beer"}, "class_info": {"name": "PubService", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, ... |
9909566_12 | class ExportFileWriter {
public void write(final RpslObject object, final List<Tag> tags) throws IOException {
if (exportFilter.shouldExport(object)) {
final String filename = filenameStrategy.getFilename(object.getType());
if (filename != null) {
final Writer writer... | subject.write(RpslObject.parse("mntner: DEV-MNT1"), Collections.EMPTY_LIST);
subject.write(RpslObject.parse("mntner: DEV-MNT2"), Collections.EMPTY_LIST);
subject.write(RpslObject.parse("mntner: DEV-MNT3"), Collections.EMPTY_LIST);
subject.write(RpslObject.parse("mntner: DEV-MNT4"), Colle... | [FOCAL] public void ExportFileWriter.write(RpslObject object, List<Tag> tags)
[CLASS] class ExportFileWriter
[METRICS] loc=19 cc=5 branches=4 loops=0 returns=0 throws=0 nesting=4
[CALLS-INTERNAL] Writer getWriter(String filename)
[CALLS-EXTERNAL] ExportFilter.shouldExport/1, FilenameStrategy.getFilename/1, RpslObject.g... | /* static context
[FOCAL] public void ExportFileWriter.write(RpslObject object, List<Tag> tags)
[PATH1] if(exportFilter.shouldExport(object))=T -> if(filename != null)=T -> if(decoratedObject != null)=T -> if(!tags.isEmpty())=T
[PATH2] if(exportFilter.shouldExport(object))=F
[PATH3] if(exportFilter.shouldExport(object)... | /* static context
[FOCAL] public void ExportFileWriter.write(RpslObject object, List<Tag> tags)
[PATH1] if(exportFilter.shouldExport(object))=T -> if(filename != null)=T -> if(decoratedObject != null)=T -> if(!tags.isEmpty())=T
[PATH2] if(exportFilter.shouldExport(object))=F
[PATH3] if(exportFilter.shouldExport(object)... | true | ok | {"focal": {"class": "ExportFileWriter", "name": "write", "signature": "void write(RpslObject object, List<Tag> tags) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "object", "type": "RpslObject"}, {"name": "tags", "type": "List<Tag>"}], "return_type": "void"}, "class_info": {"name": "E... |
9910980_2 | class ModelInterchangeMojo extends AbstractMojo {
public void execute() throws MojoExecutionException {
getLog().info("Running BPMN-MIWG test suite...");
if (!outputDirectory.exists()) {
outputDirectory.mkdirs();
}
try {
Collection<String> inputFolders = new LinkedList<String>();
if (!resources.isE... | Resource res = new Resource();
res.setDirectory("src/test/invalid-resources");
mojo.resources.add(res);
mojo.application = "Yaoqiang BPMN Editor 2.2.6";
mojo.execute();
assertTrue(overview.exists());
Document document = docBuilder.parse(overview);
XPathExpression xpath = createXpathExpression("//div[@... | [FOCAL] public void ModelInterchangeMojo.execute()
[CLASS] class ModelInterchangeMojo extends AbstractMojo
[METRICS] loc=33 cc=6 branches=2 loops=1 returns=0 throws=0 nesting=3
[CALLS-EXTERNAL] getLog().info/1, getLog/0 (inherited), outputDirectory.exists/0, outputDirectory.mkdirs/0, resources.isEmpty/0, Resource.getDi... | /* static context
[FOCAL] public void ModelInterchangeMojo.execute()
[PATH1] if(!outputDirectory.exists())=T -> if(!resources.isEmpty())=T -> foreach(Resource resource : resources)=T -> exit loop -> try-body throws
[PATH2] if(!outputDirectory.exists())=F -> if(!resources.isEmpty())=F
[PATH3] if(!outputDirectory.exists(... | /* static context
[FOCAL] public void ModelInterchangeMojo.execute()
[PATH1] if(!outputDirectory.exists())=T -> if(!resources.isEmpty())=T -> foreach(Resource resource : resources)=T -> exit loop -> try-body throws
[PATH2] if(!outputDirectory.exists())=F -> if(!resources.isEmpty())=F
[PATH3] if(!outputDirectory.exists(... | true | ok | {"focal": {"class": "ModelInterchangeMojo", "name": "execute", "signature": "void execute() throws MojoExecutionException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "ModelInterchangeMojo", "kind": "class", "modifiers": "", "superclass": "AbstractMojo", "interf... |
9917257_48 | class CassandraClusterCreator extends AbstractServiceConnectorCreator<Cluster, CassandraServiceInfo> {
@Override
public Cluster create(CassandraServiceInfo serviceInfo,
ServiceConnectorConfig serviceConnectorConfig) {
Builder builder = Cluster.builder()
.addContactPoints(serviceInfo.getContactPoints().toAr... |
CassandraServiceInfo info = new CassandraServiceInfo("local",
Collections.singletonList("127.0.0.1"), 9142);
CassandraClusterConfig config = new CassandraClusterConfig();
config.setCompression(ProtocolOptions.Compression.NONE);
config.setPoolingOptions(new PoolingOptions().setPoolTimeoutMillis(1234));
c... | [FOCAL] @Override public Cluster CassandraClusterCreator.create(CassandraServiceInfo serviceInfo, ServiceConnectorConfig serviceConnectorConfig)
[CLASS] class CassandraClusterCreator extends AbstractServiceConnectorCreator<Cluster, CassandraServiceInfo>
[METRICS] loc=43 cc=7 branches=6 loops=0 returns=1 throws=0 nestin... | /* static context
[FOCAL] @Override public Cluster CassandraClusterCreator.create(CassandraServiceInfo serviceInfo, ServiceConnectorConfig serviceConnectorConfig)
[PATH1] if(StringUtils.hasText(serviceInfo.getUsername()))=T -> if(serviceConnectorConfig instanceof CassandraClusterConfig)=T -> if(config.getCompression() ... | /* static context
[FOCAL] @Override public Cluster CassandraClusterCreator.create(CassandraServiceInfo serviceInfo, ServiceConnectorConfig serviceConnectorConfig)
[PATH1] if(StringUtils.hasText(serviceInfo.getUsername()))=T -> if(serviceConnectorConfig instanceof CassandraClusterConfig)=T -> if(config.getCompression() ... | true | ok | {"focal": {"class": "CassandraClusterCreator", "name": "create", "signature": "Cluster create(CassandraServiceInfo serviceInfo, ServiceConnectorConfig serviceConnectorConfig)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "serviceInfo", "type": "CassandraServiceInfo"}, {"name": "serviceConnecto... |
9922054_3 | class MyWidget extends Composite {
public void loadDataFromRpc() {
MyServiceAsync service = GWT.create(MyService.class);
service.getData(new AsyncCallback<String>() {
@Override
public void onSuccess(String result) {
data.setText(result);
}
@Override
public void onFailur... | doAnswer(returnSuccess("some data")).when(myService).getData(any(AsyncCallback.class));
widget.loadDataFromRpc();
verify(widget.data).setText("some data");
}
} | [FOCAL] public void MyWidget.loadDataFromRpc()
[CLASS] class MyWidget extends Composite
[METRICS] loc=12 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] GWT.create/1, MyServiceAsync.getData/1, data.setText/1
[NEW] AsyncCallback<String>
[COLLABORATORS] field data setText/1
[DATAFLOW] service@L2->L3... | /* static context
[FOCAL] public void MyWidget.loadDataFromRpc()
[COLLABORATORS] field data setText/1
[NEW] AsyncCallback<String>
[CALLS-EXTERNAL] GWT.create/1, MyServiceAsync.getData/1, data.setText/1
*/
| /* static context
[FOCAL] public void MyWidget.loadDataFromRpc()
[COLLABORATORS] field data setText/1
[NEW] AsyncCallback<String>
[CALLS-EXTERNAL] GWT.create/1, MyServiceAsync.getData/1, data.setText/1
*/
class MyWidget extends Composite {
public void loadDataFromRpc() {
MyServiceAsync service = GWT.create(MySer... | true | ok | {"focal": {"class": "MyWidget", "name": "loadDataFromRpc", "signature": "void loadDataFromRpc()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "MyWidget", "kind": "class", "modifiers": "", "superclass": "Composite", "interfaces": null, "fields": [{"name": "dataPro... |
9922058_6 | class EventBinderWriter {
void writeDoBindEventHandlers(JClassType target, SourceWriter writer, TypeOracle typeOracle)
throws UnableToCompleteException {
writeBindMethodHeader(writer, target.getQualifiedSourceName());
for (JMethod method : target.getInheritableMethods()) {
EventHandler annotation... | JClassType paramType = getEventType(AbstractEvent.class);
when(paramType.isAbstract()).thenReturn(true);
JMethod method = newMethod("myMethod", paramType);
when(target.getInheritableMethods()).thenReturn(new JMethod[] {method});
try {
writer.writeDoBindEventHandlers(target, output, t... | [FOCAL] void EventBinderWriter.writeDoBindEventHandlers(JClassType target, SourceWriter writer, TypeOracle typeOracle)
[CLASS] class EventBinderWriter
[METRICS] loc=11 cc=3 branches=1 loops=1 returns=0 throws=0 nesting=2
[CALLS-INTERNAL] void writeBindMethodFooter(SourceWriter writer); void writeBindMethodHeader(Source... | /* static context
[FOCAL] void EventBinderWriter.writeDoBindEventHandlers(JClassType target, SourceWriter writer, TypeOracle typeOracle)
[PATH1] foreach(JMethod method : target.getInheritableMethods())=T -> if(annotation != null)=T -> exit loop
[PATH2] foreach(JMethod method : target.getInheritableMethods())=F
[PATH3] ... | /* static context
[FOCAL] void EventBinderWriter.writeDoBindEventHandlers(JClassType target, SourceWriter writer, TypeOracle typeOracle)
[PATH1] foreach(JMethod method : target.getInheritableMethods())=T -> if(annotation != null)=T -> exit loop
[PATH2] foreach(JMethod method : target.getInheritableMethods())=F
[PATH3] ... | true | ok | {"focal": {"class": "EventBinderWriter", "name": "writeDoBindEventHandlers", "signature": "void writeDoBindEventHandlers(JClassType target, SourceWriter writer, TypeOracle typeOracle) throws UnableToCompleteException", "start_line": 3, "modifiers": "", "params": [{"name": "target", "type": "JClassType"}, {"name": "writ... |
9941578_49 | class NetworkStatusRetriever {
NetworkStatus retrieveNetworkStatus() {
if (merlinsBeard.isConnected()) {
return NetworkStatus.newAvailableInstance();
} else {
return NetworkStatus.newUnavailableInstance();
}
}
NetworkStatusRetriever(MerlinsBeard merlinsBea... | given(merlinsBeards.isConnected()).willReturn(DISCONNECTED);
NetworkStatus networkStatus = networkStatusRetriever.retrieveNetworkStatus();
assertThat(networkStatus).isEqualTo(NetworkStatus.newUnavailableInstance());
}
} | [FOCAL] NetworkStatus NetworkStatusRetriever.retrieveNetworkStatus()
[CLASS] class NetworkStatusRetriever
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] merlinsBeard.isConnected/0, NetworkStatus.newAvailableInstance/0, NetworkStatus.newUnavailableInstance/0
[PATH1] if(merlinsBeard... | /* static context
[FOCAL] NetworkStatus NetworkStatusRetriever.retrieveNetworkStatus()
[PATH1] if(merlinsBeard.isConnected())=T -> return NetworkStatus.newAvailableInstance()
[PATH2] if(merlinsBeard.isConnected())=F -> return NetworkStatus.newUnavailableInstance()
[COLLABORATORS] field merlinsBeard isConnected/0
[CALLS... | /* static context
[FOCAL] NetworkStatus NetworkStatusRetriever.retrieveNetworkStatus()
[PATH1] if(merlinsBeard.isConnected())=T -> return NetworkStatus.newAvailableInstance()
[PATH2] if(merlinsBeard.isConnected())=F -> return NetworkStatus.newUnavailableInstance()
[COLLABORATORS] field merlinsBeard isConnected/0
[CALLS... | true | ok | {"focal": {"class": "NetworkStatusRetriever", "name": "retrieveNetworkStatus", "signature": "NetworkStatus retrieveNetworkStatus()", "start_line": 3, "modifiers": "", "params": [], "return_type": "NetworkStatus"}, "class_info": {"name": "NetworkStatusRetriever", "kind": "class", "modifiers": "", "superclass": null, "in... |
9949199_0 | class ParentDirectoryAuthorScoreStrategy implements ScoreStrategy<AuthorScore> {
@NotNull
@Override
public AuthorScore score(BookImportContext context) {
try {
File file = context.getFile();
String dirName = file.getParentFile().getName();
String[] rawTokens = sp... | BookImportContext bookImportContext = createMock(BookImportContext.class);
File mock = createMock(File.class);
File parent = createMock(File.class);
expect(mock.getParentFile()).andReturn(parent);
expect(parent.getName()).andReturn("Christopher, Matt");
expect(bookImpor... | [FOCAL] @NotNull @Override public AuthorScore ParentDirectoryAuthorScoreStrategy.score(BookImportContext context)
[CLASS] class ParentDirectoryAuthorScoreStrategy implements ScoreStrategy<AuthorScore>
[METRICS] loc=30 cc=4 branches=1 loops=1 returns=2 throws=0 nesting=3
[CALLS-INTERNAL] String[] splitAuthorNameTokens(S... | /* static context
[FOCAL] @NotNull @Override public AuthorScore ParentDirectoryAuthorScoreStrategy.score(BookImportContext context)
[PATH1] foreach(String token : tokens)=T -> if(nameTokens.length == 2)=T -> exit loop -> return new AuthorScore(authors, ParentDirectoryAuthorScoreStrategy.class)
[PATH2] try-body throws -... | /* static context
[FOCAL] @NotNull @Override public AuthorScore ParentDirectoryAuthorScoreStrategy.score(BookImportContext context)
[PATH1] foreach(String token : tokens)=T -> if(nameTokens.length == 2)=T -> exit loop -> return new AuthorScore(authors, ParentDirectoryAuthorScoreStrategy.class)
[PATH2] try-body throws -... | true | ok | {"focal": {"class": "ParentDirectoryAuthorScoreStrategy", "name": "score", "signature": "AuthorScore score(BookImportContext context)", "start_line": 3, "modifiers": "@NotNull @Override public", "params": [{"name": "context", "type": "BookImportContext"}], "return_type": "AuthorScore"}, "class_info": {"name": "ParentDi... |
9965237_0 | class SnappyDecompressor {
public static Buffer decompress(byte[] in) {
return decompress(in, 0, in.length, null);
}
private SnappyDecompressor();
public static Buffer decompress(byte[] in, Buffer out);
public static Buffer decompress(byte[] in, int offset, int length);
public static Buffer decompress(Buffe... |
byte[] data = new byte[2];
try {
SnappyDecompressor.decompress(data);
Assert.fail("Exception was expected");
}
catch(FormatViolationException e) {
// the input data is invalid on offset 1
Assert.assertEquals(1, e.getOffset());
}
}
} | [FOCAL] public static Buffer SnappyDecompressor.decompress(byte[] in)
[CLASS] class SnappyDecompressor
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Buffer decompress(byte[] in, int offset, int length, Buffer out)
[INPUTS] branches=- | result=in
[DATAFLOW] in@param->L2
[CLASS-MEM... | /* static context
[FOCAL] public static Buffer SnappyDecompressor.decompress(byte[] in)
[INPUTS] branches=- | result=in
[CALLS-INTERNAL] Buffer decompress(byte[] in, int offset, int length, Buffer out)
*/
| /* static context
[FOCAL] public static Buffer SnappyDecompressor.decompress(byte[] in)
[INPUTS] branches=- | result=in
[CALLS-INTERNAL] Buffer decompress(byte[] in, int offset, int length, Buffer out)
*/
class SnappyDecompressor {
public static Buffer decompress(byte[] in) {
return decompress(in, 0, in.length, nul... | true | ok | {"focal": {"class": "SnappyDecompressor", "name": "decompress", "signature": "Buffer decompress(byte[] in)", "start_line": 3, "modifiers": "public static", "params": [{"name": "in", "type": "byte[]"}], "return_type": "Buffer"}, "class_info": {"name": "SnappyDecompressor", "kind": "class", "modifiers": "", "superclass":... |
10016717_11 | class SpannersService {
@PreAuthorize("hasPermission(#spanner, 'owner')")
public void update(Spanner spanner) {
restTemplate.put("/{0}", spanner, spanner.getId());
}
public SpannersService(RestTemplateBuilder builder,
@Value("${app.service.url.spanners}") String roo... | server.expect(requestTo("/1")).andExpect(method(PUT))
.andRespond(withStatus(HttpStatus.OK));
Spanner update = aSpanner().withId(1L).build();
service.update(update);
// Check that the server received the message
server.verify();
}
} | [FOCAL] @PreAuthorize("hasPermission(#spanner, 'owner')") public void SpannersService.update(Spanner spanner)
[CLASS] class SpannersService
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] restTemplate.put/3, Spanner.getId/0
[COLLABORATORS] field restTemplate put/3; param spanner:Sp... | /* static context
[FOCAL] @PreAuthorize("hasPermission(#spanner, 'owner')") public void SpannersService.update(Spanner spanner)
[COLLABORATORS] field restTemplate put/3; param spanner:Spanner getId/0
[CALLS-EXTERNAL] restTemplate.put/3, Spanner.getId/0
*/
| /* static context
[FOCAL] @PreAuthorize("hasPermission(#spanner, 'owner')") public void SpannersService.update(Spanner spanner)
[COLLABORATORS] field restTemplate put/3; param spanner:Spanner getId/0
[CALLS-EXTERNAL] restTemplate.put/3, Spanner.getId/0
*/
class SpannersService {
@PreAuthorize("hasPermission(#spann... | true | ok | {"focal": {"class": "SpannersService", "name": "update", "signature": "void update(Spanner spanner)", "start_line": 3, "modifiers": "@PreAuthorize(\"hasPermission(#spanner, 'owner')\") public", "params": [{"name": "spanner", "type": "Spanner"}], "return_type": "void"}, "class_info": {"name": "SpannersService", "kind": ... |
10035739_213 | class CreateTableGenerator extends AbstractSqlGenerator<CreateTableStatement> {
public Sql[] generateSql(CreateTableStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
StringBuffer buffer = new StringBuffer();
buffer.append("CREATE TABLE ").append(database.escapeTable... | for (Database database : TestContext.getInstance().getAllDatabases()) {
if (database instanceof SybaseASADatabase) {
CreateTableStatement statement = new CreateTableStatement(SCHEMA_NAME, TABLE_NAME);
statement.addColumn(
COLUMN_NAME1,
TypeConverterFactory.getInstance().findType... | [FOCAL] public Sql[] CreateTableGenerator.generateSql(CreateTableStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain)
[CLASS] class CreateTableGenerator extends AbstractSqlGenerator<CreateTableStatement>
[METRICS] loc=210 cc=36 branches=31 loops=4 returns=1 throws=0 nesting=4
[CALLS-INTERNAL] bo... | class CreateTableGenerator extends AbstractSqlGenerator<CreateTableStatement> {
public Sql[] generateSql(CreateTableStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
StringBuffer buffer = new StringBuffer();
buffer.append("CREATE TABLE ").append(database.escapeTable... | false | ok | {"focal": {"class": "CreateTableGenerator", "name": "generateSql", "signature": "Sql[] generateSql(CreateTableStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain)", "start_line": 3, "modifiers": "public", "params": [{"name": "statement", "type": "CreateTableStatement"}, {"name": "database", "typ... | |
10040960_712 | class DelegatingImageExtension implements ImageExtension {
public ListenableFuture<Image> createImage(final ImageTemplate template) {
ListenableFuture<Image> future = delegate.createImage(template);
// Populate the default image credentials, if missing
future = Futures.transform(future, new Funct... | ImageCacheSupplier imageCache = createMock(ImageCacheSupplier.class);
ImageExtension delegate = createMock(ImageExtension.class);
AddDefaultCredentialsToImage credsToImage = createMock(AddDefaultCredentialsToImage.class);
ImageTemplate template = new ImageTemplateImpl("test") {
};
I... | [FOCAL] public ListenableFuture<Image> DelegatingImageExtension.createImage(ImageTemplate template)
[CLASS] class DelegatingImageExtension implements ImageExtension
[METRICS] loc=46 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] delegate.createImage/1, Futures.transform/2, input.getDefaultCredent... | /* static context
[FOCAL] public ListenableFuture<Image> DelegatingImageExtension.createImage(ImageTemplate template)
[INPUTS] branches=- | result=template
[COLLABORATORS] field delegate createImage/1; field input getDefaultCredentials/0; field credentialStore get/1; param template:ImageTemplate getName/0; field addDef... | /* static context
[FOCAL] public ListenableFuture<Image> DelegatingImageExtension.createImage(ImageTemplate template)
[INPUTS] branches=- | result=template
[COLLABORATORS] field delegate createImage/1; field input getDefaultCredentials/0; field credentialStore get/1; param template:ImageTemplate getName/0; field addDef... | true | ok | {"focal": {"class": "DelegatingImageExtension", "name": "createImage", "signature": "ListenableFuture<Image> createImage(ImageTemplate template)", "start_line": 3, "modifiers": "public", "params": [{"name": "template", "type": "ImageTemplate"}], "return_type": "ListenableFuture<Image>"}, "class_info": {"name": "Delegat... |
10057936_5 | class PollexorRequestTransformer implements RequestTransformer {
@NonNull @Override public Request transformRequest(@NonNull Request request) {
if (request.resourceId != 0) {
return request; // Don't transform resource requests.
}
Uri uri = request.uri;
if (uri == null) {
throw new Illega... | Request input = new Request.Builder(IMAGE_URI).resize(50, 50).build();
Request output = transformer.transformRequest(input);
assertThat(output).isNotSameAs(input);
assertThat(output.hasSize()).isFalse();
String expected = Thumbor.create(HOST).buildImage(IMAGE).resize(50, 50).toUrl();
assertThat... | [FOCAL] @NonNull @Override public Request PollexorRequestTransformer.transformRequest(Request request)
[CLASS] class PollexorRequestTransformer implements RequestTransformer
[METRICS] loc=45 cc=8 branches=7 loops=0 returns=4 throws=1 nesting=1
[CALLS-EXTERNAL] getClass().getCanonicalName/0, getClass/0 (inherited), Uri.... | /* static context
[FOCAL] @NonNull @Override public Request PollexorRequestTransformer.transformRequest(Request request)
[THROWS-WHEN] IllegalArgumentException when !(request.resourceId != 0) && uri == null
[PATH1] if(request.resourceId != 0)=F -> if(uri == null)=F -> if(!"https".equals(scheme) && !"http".equals(scheme... | /* static context
[FOCAL] @NonNull @Override public Request PollexorRequestTransformer.transformRequest(Request request)
[THROWS-WHEN] IllegalArgumentException when !(request.resourceId != 0) && uri == null
[PATH1] if(request.resourceId != 0)=F -> if(uri == null)=F -> if(!"https".equals(scheme) && !"http".equals(scheme... | true | ok | {"focal": {"class": "PollexorRequestTransformer", "name": "transformRequest", "signature": "Request transformRequest(Request request)", "start_line": 3, "modifiers": "@NonNull @Override public", "params": [{"name": "request", "type": "Request"}], "return_type": "Request"}, "class_info": {"name": "PollexorRequestTransfo... |
10062583_26 | class DatastoreHelper {
public static Key.Builder makeKey(Object... elements) {
Key.Builder key = Key.newBuilder();
PartitionId partitionId = null;
for (int pathIndex = 0; pathIndex < elements.length; pathIndex += 2) {
PathElement.Builder pathElement = PathElement.newBuilder();
Object element... | assertEquals(
Key.newBuilder()
.addPath(Key.PathElement.newBuilder().setKind("Foo").setName("hi"))
.build(),
makeKey("Foo", "hi").build());
}
} | [FOCAL] public static Key.Builder DatastoreHelper.makeKey(Object... elements)
[CLASS] class DatastoreHelper
[METRICS] loc=50 cc=12 branches=9 loops=1 returns=1 throws=3 nesting=7
[CALLS-EXTERNAL] Key.newBuilder/0, PathElement.newBuilder/0, Key.getPartitionId/0, PartitionId.equals/1, Key.Builder.addAllPath/1, ((Key) ele... | /* static context
[FOCAL] public static Key.Builder DatastoreHelper.makeKey(Object... elements)
[THROWS-WHEN] IllegalArgumentException when pathIndex < elements.length && element instanceof Key && !(partitionId == null) && !partitionId.equals(subKey.getPartitionId())
[THROWS-WHEN] IllegalArgumentException when pathInde... | /* static context
[FOCAL] public static Key.Builder DatastoreHelper.makeKey(Object... elements)
[THROWS-WHEN] IllegalArgumentException when pathIndex < elements.length && element instanceof Key && !(partitionId == null) && !partitionId.equals(subKey.getPartitionId())
[THROWS-WHEN] IllegalArgumentException when pathInde... | true | ok | {"focal": {"class": "DatastoreHelper", "name": "makeKey", "signature": "Key.Builder makeKey(Object... elements)", "start_line": 3, "modifiers": "public static", "params": [{"name": "elements", "type": "Object..."}], "return_type": "Key.Builder"}, "class_info": {"name": "DatastoreHelper", "kind": "class", "modifiers": "... |
10064418_31 | class FileSystemTemplateLocator extends FilePathTemplateLocator {
public static Builder builder() {
return new Builder();
}
public FileSystemTemplateLocator(int priority, String rootPath);
public FileSystemTemplateLocator(int priority, String rootPath,
String suffix);
@Overr... |
TemplateLocator locator = FileSystemTemplateLocator.builder()
.setPriority(1).setRootPath("src/test/resources/locator/file")
.setSuffix("foo").build();
// Just to init the locator
MustacheEngineBuilder.newBuilder().addTemplateLocator(locator)
.se... | [FOCAL] public static Builder FileSystemTemplateLocator.builder()
[CLASS] class FileSystemTemplateLocator extends FilePathTemplateLocator
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] Builder
[CLASS-MEMBERS] FileSystemTemplateLocator(int priority, String rootPath); FileSystemTemplateLocator... | /* static context
[FOCAL] public static Builder FileSystemTemplateLocator.builder()
[NEW] Builder
*/
| /* static context
[FOCAL] public static Builder FileSystemTemplateLocator.builder()
[NEW] Builder
*/
class FileSystemTemplateLocator extends FilePathTemplateLocator {
public static Builder builder() {
return new Builder();
}
public FileSystemTemplateLocator(int priority, String rootPath);
pub... | true | ok | {"focal": {"class": "FileSystemTemplateLocator", "name": "builder", "signature": "Builder builder()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Builder"}, "class_info": {"name": "FileSystemTemplateLocator", "kind": "class", "modifiers": "", "superclass": "FilePathTemplateLocator", "in... |
10065023_0 | class HelloWorld implements ActionBlock {
public int execute(FlowContext ctx) throws FlowExecutionException {
String name = (String) ctx.get(IN_NAME);
String message = "Hello World! ";
if (name != null) {
message += name;
}
logger.debug("Message: {}", message);
ctx.put(OUT_MESSAGE, message);
... |
HelloWorld helloWorld = new HelloWorld();
FlowContext context = new FlowContext();
context.put("name", "John");
try {
int result = helloWorld.execute(context);
context.get("message");
assertEquals(ActionBlock.NEXT, result);
assertEquals("Hello World! John", context.get("message"));
... | [FOCAL] public int HelloWorld.execute(FlowContext ctx)
[CLASS] class HelloWorld implements ActionBlock
[METRICS] loc=16 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] FlowContext.get/1, logger.debug/2, FlowContext.put/2
[EXCEPTIONS] declares FlowExecutionException
[PATH1] if(name != null)=T -> re... | /* static context
[FOCAL] public int HelloWorld.execute(FlowContext ctx)
[PATH1] if(name != null)=T -> return NEXT
[PATH2] if(name != null)=F -> return NEXT
[INPUTS] branches=ctx | result=-
[COLLABORATORS] param ctx:FlowContext get/1,put/2
[EXCEPTIONS] declares FlowExecutionException
[CALLS-EXTERNAL] FlowContext.get/1,... | /* static context
[FOCAL] public int HelloWorld.execute(FlowContext ctx)
[PATH1] if(name != null)=T -> return NEXT
[PATH2] if(name != null)=F -> return NEXT
[INPUTS] branches=ctx | result=-
[COLLABORATORS] param ctx:FlowContext get/1,put/2
[EXCEPTIONS] declares FlowExecutionException
[CALLS-EXTERNAL] FlowContext.get/1,... | true | ok | {"focal": {"class": "HelloWorld", "name": "execute", "signature": "int execute(FlowContext ctx) throws FlowExecutionException", "start_line": 3, "modifiers": "public", "params": [{"name": "ctx", "type": "FlowContext"}], "return_type": "int"}, "class_info": {"name": "HelloWorld", "kind": "class", "modifiers": "", "super... |
10075325_3 | class ExecuteRequest extends Request implements IObserver {
public void updateStatusError(String errorMessage) {
StatusType status = StatusType.Factory.newInstance();
net.opengis.ows.x11.ExceptionReportDocument.ExceptionReport excRep = status
.addNewProcessFailed().addNewExceptionReport();
excRep.setVersion... |
FileInputStream fis = new FileInputStream(new File("src/test/resources/LRDTCCorruptInputResponseDocStatusTrue.xml"));
// parse the InputStream to create a Document
Document doc = fac.newDocumentBuilder().parse(fis);
ExecuteRequest request = new ExecuteRequest(doc);
String exceptionText = "TestError"... | [FOCAL] public void ExecuteRequest.updateStatusError(String errorMessage)
[CLASS] class ExecuteRequest extends Request implements IObserver
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void updateStatus(StatusType status)
[CALLS-EXTERNAL] StatusType.Factory.newInstance/0, statu... | /* static context
[FOCAL] public void ExecuteRequest.updateStatusError(String errorMessage)
[CALLS-INTERNAL] void updateStatus(StatusType status)
[CALLS-EXTERNAL] StatusType.Factory.newInstance/0, status .addNewProcessFailed().addNewExceptionReport/0, StatusType.addNewProcessFailed/0, net.opengis.ows.x11.ExceptionRepor... | /* static context
[FOCAL] public void ExecuteRequest.updateStatusError(String errorMessage)
[CALLS-INTERNAL] void updateStatus(StatusType status)
[CALLS-EXTERNAL] StatusType.Factory.newInstance/0, status .addNewProcessFailed().addNewExceptionReport/0, StatusType.addNewProcessFailed/0, net.opengis.ows.x11.ExceptionRepor... | true | ok | {"focal": {"class": "ExecuteRequest", "name": "updateStatusError", "signature": "void updateStatusError(String errorMessage)", "start_line": 3, "modifiers": "public", "params": [{"name": "errorMessage", "type": "String"}], "return_type": "void"}, "class_info": {"name": "ExecuteRequest", "kind": "class", "modifiers": ""... |
10081109_107 | class RollupEvent {
public Rollup getRollup() {
return rollup;
}
public RollupEvent(Locator loc, Rollup rollup, String unit, String gran, long ts);
public Locator getLocator();
public String getUnit();
public String getGranularityName();
public long getTimestamp();
public voi... | Assert.assertSame(rollup, event.getRollup());
}
} | [FOCAL] public Rollup RollupEvent.getRollup()
[CLASS] class RollupEvent
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[FIELDS] read=rollup:Rollup
[INPUTS] branches=- | result=rollup
[DATAFLOW] this.rollup@param->L2
[CLASS-MEMBERS] RollupEvent(Locator loc, Rollup rollup, String unit, String gran, ... | /* static context
[FOCAL] public Rollup RollupEvent.getRollup()
[INPUTS] branches=- | result=rollup
[FIELDS] read=rollup:Rollup
*/
| /* static context
[FOCAL] public Rollup RollupEvent.getRollup()
[INPUTS] branches=- | result=rollup
[FIELDS] read=rollup:Rollup
*/
class RollupEvent {
public Rollup getRollup() {
return rollup;
}
public RollupEvent(Locator loc, Rollup rollup, String unit, String gran, long ts);
public Locato... | true | ok | {"focal": {"class": "RollupEvent", "name": "getRollup", "signature": "Rollup getRollup()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Rollup"}, "class_info": {"name": "RollupEvent", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "locator", "type"... |
10085184_0 | class MavenRepositories {
public static List<RemoteRepository> getRemoteRepositories(MavenContainer container, Settings settings)
{
Set<RemoteRepository> remoteRepos = new HashSet<>();
remoteRepos.addAll(container.getEnabledRepositoriesFromProfile(settings));
// central repository is added if ... | SettingsBuilder settingsBuilder = new DefaultSettingsBuilderFactory().newInstance();
SettingsBuildingRequest settingsRequest = new DefaultSettingsBuildingRequest();
settingsRequest.setUserSettingsFile(new File("src/test/resources/profiles/mirror-settings.xml"));
Settings settings = settingsBuild... | [FOCAL] public static List<RemoteRepository> MavenRepositories.getRemoteRepositories(MavenContainer container, Settings settings)
[CLASS] class MavenRepositories
[METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Optional<String> getCentralMirrorURL(Settings settings); RemoteReposito... | /* static context
[FOCAL] public static List<RemoteRepository> MavenRepositories.getRemoteRepositories(MavenContainer container, Settings settings)
[COLLABORATORS] param container:MavenContainer getEnabledRepositoriesFromProfile/1
[CALLS-INTERNAL] Optional<String> getCentralMirrorURL(Settings settings); RemoteRepositor... | /* static context
[FOCAL] public static List<RemoteRepository> MavenRepositories.getRemoteRepositories(MavenContainer container, Settings settings)
[COLLABORATORS] param container:MavenContainer getEnabledRepositoriesFromProfile/1
[CALLS-INTERNAL] Optional<String> getCentralMirrorURL(Settings settings); RemoteRepositor... | true | ok | {"focal": {"class": "MavenRepositories", "name": "getRemoteRepositories", "signature": "List<RemoteRepository> getRemoteRepositories(MavenContainer container, Settings settings)", "start_line": 3, "modifiers": "public static", "params": [{"name": "container", "type": "MavenContainer"}, {"name": "settings", "type": "Set... |
10113030_56 | class Renderer {
public GoogleMap getMap() {
return mMap;
}
public Renderer(GoogleMap map,
Context context,
MarkerManager markerManager,
PolygonManager polygonManager,
PolylineManager polylineManager,
... | assertEquals(mMap1, mRenderer.getMap());
}
} | [FOCAL] public GoogleMap Renderer.getMap()
[CLASS] class Renderer
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] Renderer(GoogleMap map, Context context, MarkerManager markerManager, PolygonManager polygonManager, PolylineManager polylineManager, GroundOverlayManager groundOverlayM... | /* static context
[FOCAL] public GoogleMap Renderer.getMap()
*/
| /* static context
[FOCAL] public GoogleMap Renderer.getMap()
*/
class Renderer {
public GoogleMap getMap() {
return mMap;
}
public Renderer(GoogleMap map,
Context context,
MarkerManager markerManager,
PolygonManager polygonManager,
... | true | ok | {"focal": {"class": "Renderer", "name": "getMap", "signature": "GoogleMap getMap()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "GoogleMap"}, "class_info": {"name": "Renderer", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "mMap1", "type": "Googl... |
10116915_0 | class ExternalSystemRecentTaskListModel extends DefaultListModel {
@SuppressWarnings("unchecked")
public void setFirst(@Nonnull ExternalTaskExecutionInfo task) {
insertElementAt(task, 0);
for (int i = 1; i < size(); i++) {
if (task.equals(getElementAt(i))) {
remove(i);
break;
}
... | List<ExternalTaskExecutionInfo> tasks = ContainerUtilRt.newArrayList();
for (int i = 0; i <= ExternalSystemConstants.RECENT_TASKS_NUMBER; i++) {
new ExternalTaskExecutionInfo(new ExternalSystemTaskExecutionSettings(), "task" + i);
}
myModel.setTasks(tasks);
myModel.setFirst(new ExternalTaskEx... | [FOCAL] @SuppressWarnings("unchecked") public void ExternalSystemRecentTaskListModel.setFirst(ExternalTaskExecutionInfo task)
[CLASS] class ExternalSystemRecentTaskListModel extends DefaultListModel
[METRICS] loc=11 cc=3 branches=1 loops=1 returns=0 throws=0 nesting=2
[CALLS-INTERNAL] void ensureSize(int elementsNumber... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public void ExternalSystemRecentTaskListModel.setFirst(ExternalTaskExecutionInfo task)
[PATH1] for(i < size())=T -> if(task.equals(getElementAt(i)))=F -> exit loop
[PATH2] for(i < size())=F
[PATH3] for(i < size())=T -> if(task.equals(getElementAt(i)))=T
[INPUTS] ... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public void ExternalSystemRecentTaskListModel.setFirst(ExternalTaskExecutionInfo task)
[PATH1] for(i < size())=T -> if(task.equals(getElementAt(i)))=F -> exit loop
[PATH2] for(i < size())=F
[PATH3] for(i < size())=T -> if(task.equals(getElementAt(i)))=T
[INPUTS] ... | true | ok | {"focal": {"class": "ExternalSystemRecentTaskListModel", "name": "setFirst", "signature": "void setFirst(ExternalTaskExecutionInfo task)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public", "params": [{"name": "task", "type": "ExternalTaskExecutionInfo"}], "return_type": "void"}, "class_info": {"n... |
10144081_34 | class EasyRandom extends Random {
public <T> T nextObject(final Class<T> type) {
return doPopulateBean(type, new RandomizationContext(type, parameters));
}
public EasyRandom();
public EasyRandom(final EasyRandomParameters easyRandomParameters);
public Stream<T> objects(final Class<T> ty... | HashSet<TestEnum> distinctEnumBeans = new HashSet<>();
for (int i = 0; i < 10; i++) {
distinctEnumBeans.add(easyRandom.nextObject(TestEnum.class));
}
assertThat(distinctEnumBeans.size()).isGreaterThan(1);
}
} | [FOCAL] public T EasyRandom.nextObject(Class<T> type)
[CLASS] class EasyRandom extends Random
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] T doPopulateBean(Class<T> type, RandomizationContext context)
[NEW] RandomizationContext
[INPUTS] branches=- | result=type
[DATAFLOW] type@p... | /* static context
[FOCAL] public T EasyRandom.nextObject(Class<T> type)
[INPUTS] branches=- | result=type
[CALLS-INTERNAL] T doPopulateBean(Class<T> type, RandomizationContext context)
[NEW] RandomizationContext
*/
| /* static context
[FOCAL] public T EasyRandom.nextObject(Class<T> type)
[INPUTS] branches=- | result=type
[CALLS-INTERNAL] T doPopulateBean(Class<T> type, RandomizationContext context)
[NEW] RandomizationContext
*/
class EasyRandom extends Random {
public <T> T nextObject(final Class<T> type) {
return doPo... | true | ok | {"focal": {"class": "EasyRandom", "name": "nextObject", "signature": "T nextObject(Class<T> type)", "start_line": 3, "modifiers": "public", "params": [{"name": "type", "type": "Class<T>"}], "return_type": "T"}, "class_info": {"name": "EasyRandom", "kind": "class", "modifiers": "", "superclass": "Random", "interfaces": ... |
10189028_10 | class ConsistentReportServiceImpl implements ConsistentReportService {
public List<ConsistentReportDO> queryConsistentReport(Map params) {
return consistentReportDao.queryConsistentReport(params);
}
public void setConsistentReportDao(ConsistentReportDao consistentReportDao);
public Integer sav... | // Map params = new HashMap();
// params.put("errorType", "read");
// params.put("pageSize", 2);
// params.put("startRow", 0);
// List<ConsistentReportDO> reportList = consistentReportService.queryConsistentReport(params);
// assertTrue(reportList != null);
// assertEqua... | [FOCAL] public List<ConsistentReportDO> ConsistentReportServiceImpl.queryConsistentReport(Map params)
[CLASS] class ConsistentReportServiceImpl implements ConsistentReportService
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] consistentReportDao.queryConsistentReport/1
[INPUTS] br... | /* static context
[FOCAL] public List<ConsistentReportDO> ConsistentReportServiceImpl.queryConsistentReport(Map params)
[INPUTS] branches=- | result=params
[COLLABORATORS] field consistentReportDao queryConsistentReport/1
[CALLS-EXTERNAL] consistentReportDao.queryConsistentReport/1
*/
| /* static context
[FOCAL] public List<ConsistentReportDO> ConsistentReportServiceImpl.queryConsistentReport(Map params)
[INPUTS] branches=- | result=params
[COLLABORATORS] field consistentReportDao queryConsistentReport/1
[CALLS-EXTERNAL] consistentReportDao.queryConsistentReport/1
*/
class ConsistentReportServiceImpl ... | true | ok | {"focal": {"class": "ConsistentReportServiceImpl", "name": "queryConsistentReport", "signature": "List<ConsistentReportDO> queryConsistentReport(Map params)", "start_line": 3, "modifiers": "public", "params": [{"name": "params", "type": "Map"}], "return_type": "List<ConsistentReportDO>"}, "class_info": {"name": "Consis... |
10192655_5 | class XMLParser extends AbstractXMLParser {
public static SushiEvent generateEventFromXML(String filePath) throws XMLParsingException {
Document doc = readXMLDocument(filePath);
return generateEvent(doc, null);
}
public static SushiEvent generateEventFromXML(String filePath, String pathToXSD);
public static S... | SushiEventType eventTyp = new SushiEventType("EventTaxonomy");
eventTyp.setXMLName("EventTaxonomy");
eventTyp.setTimestampName("location.timestamp");
eventTyp.save();
SushiEvent event = XMLParser.generateEventFromXML(filePathToXMLWithHierarchicalTimestamp);
assertNotNull(event);
Calendar cal = Calendar.ge... | [FOCAL] public static SushiEvent XMLParser.generateEventFromXML(String filePath)
[CLASS] class XMLParser extends AbstractXMLParser
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] SushiEvent generateEvent(Document doc, String pathToXSD)
[CALLS-EXTERNAL] readXMLDocument/1 (inherited)... | /* static context
[FOCAL] public static SushiEvent XMLParser.generateEventFromXML(String filePath)
[INPUTS] branches=- | result=filePath
[EXCEPTIONS] declares XMLParsingException
[CALLS-INTERNAL] SushiEvent generateEvent(Document doc, String pathToXSD)
[CALLS-EXTERNAL] readXMLDocument/1 (inherited)
*/
| /* static context
[FOCAL] public static SushiEvent XMLParser.generateEventFromXML(String filePath)
[INPUTS] branches=- | result=filePath
[EXCEPTIONS] declares XMLParsingException
[CALLS-INTERNAL] SushiEvent generateEvent(Document doc, String pathToXSD)
[CALLS-EXTERNAL] readXMLDocument/1 (inherited)
*/
class XMLParser e... | true | ok | {"focal": {"class": "XMLParser", "name": "generateEventFromXML", "signature": "SushiEvent generateEventFromXML(String filePath) throws XMLParsingException", "start_line": 3, "modifiers": "public static", "params": [{"name": "filePath", "type": "String"}], "return_type": "SushiEvent"}, "class_info": {"name": "XMLParser"... |
10195984_2 | class Index implements Iterable<IndexItem<A,I>> {
public static <A extends Annotation,I> Index<A,I> load(Class<A> annotation, Class<I> instanceType) throws IllegalArgumentException {
return load(annotation, instanceType, Thread.currentThread().getContextClassLoader());
}
private Index(Class<A> an... | TestUtils.makeSource(src, "x.A",
"import java.lang.annotation.*;",
"@Retention(RetentionPolicy.RUNTIME)",
"@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})",
"@net.java.sezpoz.Indexable",
"public @interface A {",
... | [FOCAL] public static Index<A,I> Index.load(Class<A> annotation, Class<I> instanceType)
[CLASS] class Index implements Iterable<IndexItem<A,I>>
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Index<A,I> load(Class<A> annotation, Class<I> instanceType, ClassLoader loader)
[CALLS-EXT... | /* static context
[FOCAL] public static Index<A,I> Index.load(Class<A> annotation, Class<I> instanceType)
[INPUTS] branches=- | result=annotation, instanceType
[EXCEPTIONS] declares IllegalArgumentException
[CALLS-INTERNAL] Index<A,I> load(Class<A> annotation, Class<I> instanceType, ClassLoader loader)
[CALLS-EXTERNAL]... | /* static context
[FOCAL] public static Index<A,I> Index.load(Class<A> annotation, Class<I> instanceType)
[INPUTS] branches=- | result=annotation, instanceType
[EXCEPTIONS] declares IllegalArgumentException
[CALLS-INTERNAL] Index<A,I> load(Class<A> annotation, Class<I> instanceType, ClassLoader loader)
[CALLS-EXTERNAL]... | true | ok | {"focal": {"class": "Index", "name": "load", "signature": "Index<A,I> load(Class<A> annotation, Class<I> instanceType) throws IllegalArgumentException", "start_line": 3, "modifiers": "public static", "params": [{"name": "annotation", "type": "Class<A>"}, {"name": "instanceType", "type": "Class<I>"}], "return_type": "In... |
10227537_1 | class AuthenticationUtil {
public static void configureAuthentication(String role) {
Collection<GrantedAuthority> authorities = AuthorityUtils.createAuthorityList(role);
Authentication authentication = new UsernamePasswordAuthenticationToken(
USERNAME,
role,
... | AuthenticationUtil.configureAuthentication(ROLE);
Authentication currentAuthentication = SecurityContextHolder.getContext().getAuthentication();
assertThat(currentAuthentication.getAuthorities()).hasSize(1);
assertThat(currentAuthentication.getAuthorities().iterator().next().getAuthorit... | [FOCAL] public static void AuthenticationUtil.configureAuthentication(String role)
[CLASS] class AuthenticationUtil
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] AuthorityUtils.createAuthorityList/1, SecurityContextHolder.getContext().setAuthentication/1, SecurityContextHolder.ge... | /* static context
[FOCAL] public static void AuthenticationUtil.configureAuthentication(String role)
[FIELDS] read=USERNAME:String
[NEW] UsernamePasswordAuthenticationToken
[CALLS-EXTERNAL] AuthorityUtils.createAuthorityList/1, SecurityContextHolder.getContext().setAuthentication/1, SecurityContextHolder.getContext/0
*... | /* static context
[FOCAL] public static void AuthenticationUtil.configureAuthentication(String role)
[FIELDS] read=USERNAME:String
[NEW] UsernamePasswordAuthenticationToken
[CALLS-EXTERNAL] AuthorityUtils.createAuthorityList/1, SecurityContextHolder.getContext().setAuthentication/1, SecurityContextHolder.getContext/0
*... | true | ok | {"focal": {"class": "AuthenticationUtil", "name": "configureAuthentication", "signature": "void configureAuthentication(String role)", "start_line": 3, "modifiers": "public static", "params": [{"name": "role", "type": "String"}], "return_type": "void"}, "class_info": {"name": "AuthenticationUtil", "kind": "class", "mod... |
10230369_33 | class SimpleServiceLoader {
public static <T> ImmutableList<T> load(Class<? extends T> service, ClassLoader loader) {
String resourceName = "META-INF/services/" + service.getName();
List<URL> resourceUrls;
try {
resourceUrls = Collections.list(loader.getResources(resourceName));
} catch (IOExce... | ClassLoader loader = loaderForJarWithEntries(CharSequence.class.getName(), "java.lang.Thread");
try {
SimpleServiceLoader.load(CharSequence.class, loader);
fail();
} catch (ServiceConfigurationError expected) {
assertThat(expected).hasMessageThat().startsWith("Class java.lang.Thread is no... | [FOCAL] public static ImmutableList<T> SimpleServiceLoader.load(Class<? extends T> service, ClassLoader loader)
[CLASS] class SimpleServiceLoader
[METRICS] loc=18 cc=4 branches=0 loops=1 returns=1 throws=2 nesting=2
[CALLS-INTERNAL] ImmutableList<T> providersFromUrl(URL resourceUrl, Class<T> service, ClassLoader loader... | /* static context
[FOCAL] public static ImmutableList<T> SimpleServiceLoader.load(Class<? extends T> service, ClassLoader loader)
[THROWS-WHEN] ServiceConfigurationError when try-body throws
[THROWS-WHEN] ServiceConfigurationError when foreach(URL resourceUrl : resourceUrls)=T && try-body throws
[PATH1] foreach(URL res... | /* static context
[FOCAL] public static ImmutableList<T> SimpleServiceLoader.load(Class<? extends T> service, ClassLoader loader)
[THROWS-WHEN] ServiceConfigurationError when try-body throws
[THROWS-WHEN] ServiceConfigurationError when foreach(URL resourceUrl : resourceUrls)=T && try-body throws
[PATH1] foreach(URL res... | true | ok | {"focal": {"class": "SimpleServiceLoader", "name": "load", "signature": "ImmutableList<T> load(Class<? extends T> service, ClassLoader loader)", "start_line": 3, "modifiers": "public static", "params": [{"name": "service", "type": "Class<? extends T>"}, {"name": "loader", "type": "ClassLoader"}], "return_type": "Immuta... |
10262572_39 | class AS2HttpHelper {
@Nullable
public static String getCleanContentType (@Nullable final String sContentType)
{
final ContentType aCT = parseContentType (sContentType);
return aCT != null ? aCT.toString () : null;
}
private AS2HttpHelper();
@Nullable public static ContentType parseContentType(@... | assertNull (AS2HttpHelper.getCleanContentType (null));
assertNull (AS2HttpHelper.getCleanContentType (""));
assertNull (AS2HttpHelper.getCleanContentType (" "));
assertNull (AS2HttpHelper.getCleanContentType ("abc"));
assertNull (AS2HttpHelper.getCleanContentType ("abc/"));
assertEquals ("abc... | [FOCAL] @Nullable public static String AS2HttpHelper.getCleanContentType(String sContentType)
[CLASS] class AS2HttpHelper
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] ContentType parseContentType(String sContentType)
[CALLS-EXTERNAL] ContentType.toString/0
[INPUTS] branches=- | ... | /* static context
[FOCAL] @Nullable public static String AS2HttpHelper.getCleanContentType(String sContentType)
[INPUTS] branches=- | result=sContentType
[CALLS-INTERNAL] ContentType parseContentType(String sContentType)
[CALLS-EXTERNAL] ContentType.toString/0
*/
| /* static context
[FOCAL] @Nullable public static String AS2HttpHelper.getCleanContentType(String sContentType)
[INPUTS] branches=- | result=sContentType
[CALLS-INTERNAL] ContentType parseContentType(String sContentType)
[CALLS-EXTERNAL] ContentType.toString/0
*/
class AS2HttpHelper {
@Nullable
public static Strin... | true | ok | {"focal": {"class": "AS2HttpHelper", "name": "getCleanContentType", "signature": "String getCleanContentType(String sContentType)", "start_line": 3, "modifiers": "@Nullable public static", "params": [{"name": "sContentType", "type": "String"}], "return_type": "String"}, "class_info": {"name": "AS2HttpHelper", "kind": "... |
10264172_22 | class InverseSquaredLinkFunction implements Fn {
@Override
public double evaluate(final double[] x) {
if (x.length > 1) {
throw new AIFHError("The inverse squared link function can only accept one parameter.");
}
return -Math.pow(x[0], -2);
}
}
class TestInverseSquare... | final InverseSquaredLinkFunction fn = new InverseSquaredLinkFunction();
final double[] x = {2};
final double y = fn.evaluate(x);
assertEquals(-0.25, y, AIFH.DEFAULT_PRECISION);
}
} | [FOCAL] @Override public double InverseSquaredLinkFunction.evaluate(double[] x)
[CLASS] class InverseSquaredLinkFunction implements Fn
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] Math.pow/2
[NEW] AIFHError
[EXCEPTIONS] throws AIFHError
[THROWS-WHEN] AIFHError when x.length > 1
... | /* static context
[FOCAL] @Override public double InverseSquaredLinkFunction.evaluate(double[] x)
[THROWS-WHEN] AIFHError when x.length > 1
[PATH1] if(x.length > 1)=T -> throw new AIFHError("The inverse squared link function can only accept on...
[PATH2] if(x.length > 1)=F -> return -Math.pow(x[0], -2)
[INPUTS] branche... | /* static context
[FOCAL] @Override public double InverseSquaredLinkFunction.evaluate(double[] x)
[THROWS-WHEN] AIFHError when x.length > 1
[PATH1] if(x.length > 1)=T -> throw new AIFHError("The inverse squared link function can only accept on...
[PATH2] if(x.length > 1)=F -> return -Math.pow(x[0], -2)
[INPUTS] branche... | true | ok | {"focal": {"class": "InverseSquaredLinkFunction", "name": "evaluate", "signature": "double evaluate(double[] x)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "x", "type": "double[]"}], "return_type": "double"}, "class_info": {"name": "InverseSquaredLinkFunction", "kind": "class", "modifiers": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.