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 |
|---|---|---|---|---|---|---|---|---|
10269178_27 | class StepComparator extends AbstractStructureComparator<StepLink, Integer, StepInfo> {
public ScenarioDiffInfo compare(final String baseUseCaseName, final String baseScenarioName) {
this.baseUseCaseName = baseUseCaseName;
this.baseScenarioName = baseScenarioName;
final List<Step> baseSteps = loadSteps(parame... | List<Step> baseSteps = getSteps(PAGE_NAME_1, PAGE_NAME_1, PAGE_NAME_2);
List<Step> comparisonSteps = getSteps(PAGE_NAME_1);
initMocks(baseSteps, comparisonSteps, 0.0);
ScenarioDiffInfo scenarioDiffInfo = stepComparator.compare(USE_CASE_NAME, SCENARIO_NAME);
double expectedChangeRate = 200.0 / 3.0;
assert... | [FOCAL] public ScenarioDiffInfo StepComparator.compare(String baseUseCaseName, String baseScenarioName)
[CLASS] class StepComparator extends AbstractStructureComparator<StepLink, Integer, StepInfo>
[METRICS] loc=23 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] List<Step> loadSteps(String branchN... | /* static context
[FOCAL] public ScenarioDiffInfo StepComparator.compare(String baseUseCaseName, String baseScenarioName)
[INPUTS] branches=- | result=baseScenarioName
[COLLABORATORS] field parameters getBaseBranchName/0,getBaseBuildName/0,getComparisonConfiguration/0; field stepAndPagesAggregator calculateStepLinks/3
... | /* static context
[FOCAL] public ScenarioDiffInfo StepComparator.compare(String baseUseCaseName, String baseScenarioName)
[INPUTS] branches=- | result=baseScenarioName
[COLLABORATORS] field parameters getBaseBranchName/0,getBaseBuildName/0,getComparisonConfiguration/0; field stepAndPagesAggregator calculateStepLinks/3
... | true | ok | {"focal": {"class": "StepComparator", "name": "compare", "signature": "ScenarioDiffInfo compare(String baseUseCaseName, String baseScenarioName)", "start_line": 3, "modifiers": "public", "params": [{"name": "baseUseCaseName", "type": "String"}, {"name": "baseScenarioName", "type": "String"}], "return_type": "ScenarioDi... |
10277647_3 | class ModeParser {
static void parse(final String instructions,
final Set<PosixFilePermission> toAdd,
final Set<PosixFilePermission> toRemove) {
for (final String instruction : COMMA.split(instructions)) {
parseOne(instruction, toAdd, toRemove);
}
}
private ModeParser();
public static ... | final Set<PosixFilePermission> toAdd = EnumSet.noneOf(PosixFilePermission.class);
final Set<PosixFilePermission> toRemove = EnumSet.noneOf(PosixFilePermission.class);
ModeParser.parse(instruction, toAdd, toRemove);
assertThat(toAdd).isEqualTo(add);
assertThat(toRemove).isEqualTo(remove);
}
} | [FOCAL] static void ModeParser.parse(String instructions, Set<PosixFilePermission> toAdd, Set<PosixFilePermission> toRemove)
[CLASS] class ModeParser
[METRICS] loc=7 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] void parseOne(String instruction, Set<PosixFilePermission> toAdd, Set<PosixFilePermi... | /* static context
[FOCAL] static void ModeParser.parse(String instructions, Set<PosixFilePermission> toAdd, Set<PosixFilePermission> toRemove)
[PATH1] foreach(String instruction : COMMA.split(instructions))=T -> exit loop
[PATH2] foreach(String instruction : COMMA.split(instructions))=F
[INPUTS] branches=instructions |... | /* static context
[FOCAL] static void ModeParser.parse(String instructions, Set<PosixFilePermission> toAdd, Set<PosixFilePermission> toRemove)
[PATH1] foreach(String instruction : COMMA.split(instructions))=T -> exit loop
[PATH2] foreach(String instruction : COMMA.split(instructions))=F
[INPUTS] branches=instructions |... | true | ok | {"focal": {"class": "ModeParser", "name": "parse", "signature": "void parse(String instructions, Set<PosixFilePermission> toAdd, Set<PosixFilePermission> toRemove)", "start_line": 3, "modifiers": "static", "params": [{"name": "instructions", "type": "String"}, {"name": "toAdd", "type": "Set<PosixFilePermission>"}, {"na... |
10285025_16 | class ClassUtils {
public static Class<?> getElementsClassOf(Class<?> clazz) {
if (clazz.isArray()) {
return clazz.getComponentType();
}
if (Collection.class.isAssignableFrom(clazz)) {
// TODO check for annotation
logger.warn("In Java its not possible to ... | assertThat(getElementsClassOf(String[].class), is(typeCompatibleWith(String.class)));
assertThat(getElementsClassOf(Integer[].class), is(typeCompatibleWith(Integer.class)));
assertThat(getElementsClassOf(Contact[].class), is(typeCompatibleWith(Contact.class)));
}
} | [FOCAL] public static Class<?> ClassUtils.getElementsClassOf(Class<?> clazz)
[CLASS] class ClassUtils
[METRICS] loc=11 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[CALLS-EXTERNAL] Class<?>.isArray/0, Class<?>.getComponentType/0, Collection.class.isAssignableFrom/1, logger.warn/2
[PATH1] if(clazz.isArray())=F -... | /* static context
[FOCAL] public static Class<?> ClassUtils.getElementsClassOf(Class<?> clazz)
[PATH1] if(clazz.isArray())=F -> if(Collection.class.isAssignableFrom(clazz))=T -> return Object.class
[PATH2] if(clazz.isArray())=T -> return clazz.getComponentType()
[PATH3] if(clazz.isArray())=F -> if(Collection.class.isAs... | /* static context
[FOCAL] public static Class<?> ClassUtils.getElementsClassOf(Class<?> clazz)
[PATH1] if(clazz.isArray())=F -> if(Collection.class.isAssignableFrom(clazz))=T -> return Object.class
[PATH2] if(clazz.isArray())=T -> return clazz.getComponentType()
[PATH3] if(clazz.isArray())=F -> if(Collection.class.isAs... | true | ok | {"focal": {"class": "ClassUtils", "name": "getElementsClassOf", "signature": "Class<?> getElementsClassOf(Class<?> clazz)", "start_line": 3, "modifiers": "public static", "params": [{"name": "clazz", "type": "Class<?>"}], "return_type": "Class<?>"}, "class_info": {"name": "ClassUtils", "kind": "class", "modifiers": "",... |
10288113_13 | class Whassup {
public boolean hasBackupDB() {
return dbProvider.getDBFile() != null;
}
public Whassup(Context context);
Whassup(DecryptorFactory decryptorFactory, DBProvider dbProvider, DBOpener dbOpener);
public Cursor queryMessages();
public Cursor queryMessages(long timestamp, ... | when(dbProvider.getDBFile()).thenReturn(null);
assertThat(whassup.hasBackupDB()).isFalse();
when(dbProvider.getDBFile()).thenReturn(Fixtures.TEST_DB_1);
assertThat(whassup.hasBackupDB()).isTrue();
}
} | [FOCAL] public boolean Whassup.hasBackupDB()
[CLASS] class Whassup
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] DBProvider.getDBFile/0
[FIELDS] read=dbProvider:DBProvider
[INPUTS] branches=- | result=dbProvider
[COLLABORATORS] field dbProvider:DBProvider getDBFile/0
[DATAFLOW] t... | /* static context
[FOCAL] public boolean Whassup.hasBackupDB()
[INPUTS] branches=- | result=dbProvider
[COLLABORATORS] field dbProvider:DBProvider getDBFile/0
[FIELDS] read=dbProvider:DBProvider
[CALLS-EXTERNAL] DBProvider.getDBFile/0
*/
| /* static context
[FOCAL] public boolean Whassup.hasBackupDB()
[INPUTS] branches=- | result=dbProvider
[COLLABORATORS] field dbProvider:DBProvider getDBFile/0
[FIELDS] read=dbProvider:DBProvider
[CALLS-EXTERNAL] DBProvider.getDBFile/0
*/
class Whassup {
public boolean hasBackupDB() {
return dbProvider.getD... | true | ok | {"focal": {"class": "Whassup", "name": "hasBackupDB", "signature": "boolean hasBackupDB()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "Whassup", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "whassup", "type": ... |
10288749_43 | class PreCondition {
public static void notEmpty(String string, String errorMessage) {
if (string.isEmpty()) {
throw new IllegalArgumentException(errorMessage);
}
}
private PreCondition();
public static void isTrue(boolean expression, String errorMessageTemplate, Object..... | assertThatThrownBy(() -> PreCondition.notEmpty("", STATIC_ERROR_MESSAGE))
.isExactlyInstanceOf(IllegalArgumentException.class)
.hasMessage(STATIC_ERROR_MESSAGE);
}
} | [FOCAL] public static void PreCondition.notEmpty(String string, String errorMessage)
[CLASS] class PreCondition
[METRICS] loc=5 cc=2 branches=1 loops=0 returns=0 throws=1 nesting=1
[CALLS-EXTERNAL] String.isEmpty/0
[NEW] IllegalArgumentException
[EXCEPTIONS] throws IllegalArgumentException
[THROWS-WHEN] IllegalArgument... | /* static context
[FOCAL] public static void PreCondition.notEmpty(String string, String errorMessage)
[THROWS-WHEN] IllegalArgumentException when string.isEmpty()
[PATH1] if(string.isEmpty())=T -> throw new IllegalArgumentException(errorMessage)
[PATH2] if(string.isEmpty())=F
[INPUTS] branches=string | result=errorMes... | /* static context
[FOCAL] public static void PreCondition.notEmpty(String string, String errorMessage)
[THROWS-WHEN] IllegalArgumentException when string.isEmpty()
[PATH1] if(string.isEmpty())=T -> throw new IllegalArgumentException(errorMessage)
[PATH2] if(string.isEmpty())=F
[INPUTS] branches=string | result=errorMes... | true | ok | {"focal": {"class": "PreCondition", "name": "notEmpty", "signature": "void notEmpty(String string, String errorMessage)", "start_line": 3, "modifiers": "public static", "params": [{"name": "string", "type": "String"}, {"name": "errorMessage", "type": "String"}], "return_type": "void"}, "class_info": {"name": "PreCondit... |
10300045_0 | class EventDateComparator implements Comparator<EventAdapter.Item> {
@Override
public int compare(EventAdapter.Item event1, EventAdapter.Item event2) {
if (event1.getEvent().getStart() == null) {
if (event2.getEvent().getStart() == null) {
return 0;
} else {
... | assertEquals(1, comparator.compare(eventInApril, eventInMarch));
assertEquals(-1, comparator.compare(eventInMarch, eventInApril));
assertEquals(0, comparator.compare(eventInMarch, eventInMarch));
}
} | [FOCAL] @Override public int EventDateComparator.compare(EventAdapter.Item event1, EventAdapter.Item event2)
[CLASS] class EventDateComparator implements Comparator<EventAdapter.Item>
[METRICS] loc=14 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=2
[CALLS-EXTERNAL] event1.getEvent().getStart/0, EventAdapter.Item.g... | /* static context
[FOCAL] @Override public int EventDateComparator.compare(EventAdapter.Item event1, EventAdapter.Item event2)
[PATH1] if(event1.getEvent().getStart() == null)=T -> if(event2.getEvent().getStart() == null)#1=T -> return 0
[PATH2] if(event1.getEvent().getStart() == null)=F -> if(event2.getEvent().getStar... | /* static context
[FOCAL] @Override public int EventDateComparator.compare(EventAdapter.Item event1, EventAdapter.Item event2)
[PATH1] if(event1.getEvent().getStart() == null)=T -> if(event2.getEvent().getStart() == null)#1=T -> return 0
[PATH2] if(event1.getEvent().getStart() == null)=F -> if(event2.getEvent().getStar... | true | ok | {"focal": {"class": "EventDateComparator", "name": "compare", "signature": "int compare(EventAdapter.Item event1, EventAdapter.Item event2)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "event1", "type": "EventAdapter.Item"}, {"name": "event2", "type": "EventAdapter.Item"}], "return_type": "in... |
10311319_20 | class VanillaMappedFile implements VanillaMappedResource {
@Override
public synchronized void close() throws IOException {
if (this.fileChannel.isOpen()) {
long start = System.nanoTime();
this.fileChannel.close();
this.fileLifecycleListener.onEvent(EventType.CLOSE, t... | VanillaMappedCache<Integer> cache = new VanillaMappedCache(10000, true);
VanillaMappedBytes buffer = cache.put(1, newTempraryFile("vmc-4"), 256, 1);
buffer.reserve();
assertEquals(2, buffer.refCount());
buffer.release();
assertEquals(1, buffer.refCount());
cach... | [FOCAL] @Override public synchronized void VanillaMappedFile.close()
[CLASS] class VanillaMappedFile implements VanillaMappedResource
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] this.fileChannel.isOpen/0, System.nanoTime/0, this.fileChannel.close/0, this.fileLifecycleListener.o... | /* static context
[FOCAL] @Override public synchronized void VanillaMappedFile.close()
[PATH1] if(this.fileChannel.isOpen())=T
[PATH2] if(this.fileChannel.isOpen())=F
[COLLABORATORS] field fileChannel isOpen/0,close/0; field fileLifecycleListener onEvent/3
[EXCEPTIONS] declares IOException
[FIELDS] read=fileChannel, fi... | /* static context
[FOCAL] @Override public synchronized void VanillaMappedFile.close()
[PATH1] if(this.fileChannel.isOpen())=T
[PATH2] if(this.fileChannel.isOpen())=F
[COLLABORATORS] field fileChannel isOpen/0,close/0; field fileLifecycleListener onEvent/3
[EXCEPTIONS] declares IOException
[FIELDS] read=fileChannel, fi... | true | ok | {"focal": {"class": "VanillaMappedFile", "name": "close", "signature": "void close() throws IOException", "start_line": 3, "modifiers": "@Override public synchronized", "params": [], "return_type": "void"}, "class_info": {"name": "VanillaMappedFile", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "... |
10325227_3 | class ProtoServiceHandler {
public void handle(ServiceDescriptorProto service) throws IOException {
ImmutableList.Builder<ServiceHandlerData.Method> methods = ImmutableList.builder();
for (MethodDescriptorProto method : service.getMethodList()) {
ServiceHandlerData.Method methodData = new ServiceHandle... | // Triggering code generation
Descriptors.Descriptor searchRequestDescriptor = SearchRequest.getDescriptor();
DescriptorProtos.FileDescriptorProto protoFile = searchRequestDescriptor.getFile().toProto();
TypeMap types = TypeMap.of(protoFile);
ByteArrayOutputStream output = new ByteArrayOutputStream(... | [FOCAL] public void ProtoServiceHandler.handle(ServiceDescriptorProto service)
[CLASS] class ProtoServiceHandler
[METRICS] loc=33 cc=3 branches=1 loops=1 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] ImmutableList.builder/0, ServiceDescriptorProto.getMethodList/0, MethodDescriptorProto.getName/0, CaseFormat.UPPER_CAMEL... | class ProtoServiceHandler {
public void handle(ServiceDescriptorProto service) throws IOException {
ImmutableList.Builder<ServiceHandlerData.Method> methods = ImmutableList.builder();
for (MethodDescriptorProto method : service.getMethodList()) {
ServiceHandlerData.Method methodData = new ServiceHandle... | false | ok | {"focal": {"class": "ProtoServiceHandler", "name": "handle", "signature": "void handle(ServiceDescriptorProto service) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "service", "type": "ServiceDescriptorProto"}], "return_type": "void"}, "class_info": {"name": "ProtoServiceHandler", "ki... | |
10329619_35 | class OAuthUtils {
public static Map<String, String> decodeOAuthHeader(String header) {
Map<String, String> headerValues = new HashMap<String, String>();
if (header != null) {
Matcher m = OAUTH_HEADER.matcher(header);
if (m.matches()) {
if (AUTH_SCHEME.equals... | Map<String, String> parameters = OAuthUtils.decodeOAuthHeader("Bearer realm=\"example\"");
Map<String, String> expected = new HashMap<String, String>();
expected.put("realm", "example");
assertEquals(expected, parameters);
}
} | [FOCAL] public static Map<String, String> OAuthUtils.decodeOAuthHeader(String header)
[CLASS] class OAuthUtils
[METRICS] loc=19 cc=6 branches=4 loops=1 returns=1 throws=0 nesting=5
[CALLS-INTERNAL] String decodePercent(String s)
[CALLS-EXTERNAL] OAUTH_HEADER.matcher/1, Matcher.matches/0, AUTH_SCHEME.equalsIgnoreCase/1,... | /* static context
[FOCAL] public static Map<String, String> OAuthUtils.decodeOAuthHeader(String header)
[PATH1] if(header != null)=T -> if(m.matches())#1=T -> if(AUTH_SCHEME.equalsIgnoreCase(m.group(1)))=T -> foreach(String nvp : m.group(2).split("\\s*,\\s*"))=T -> if(m.matches())#2=T -> exit loop -> return headerValue... | /* static context
[FOCAL] public static Map<String, String> OAuthUtils.decodeOAuthHeader(String header)
[PATH1] if(header != null)=T -> if(m.matches())#1=T -> if(AUTH_SCHEME.equalsIgnoreCase(m.group(1)))=T -> foreach(String nvp : m.group(2).split("\\s*,\\s*"))=T -> if(m.matches())#2=T -> exit loop -> return headerValue... | true | ok | {"focal": {"class": "OAuthUtils", "name": "decodeOAuthHeader", "signature": "Map<String, String> decodeOAuthHeader(String header)", "start_line": 3, "modifiers": "public static", "params": [{"name": "header", "type": "String"}], "return_type": "Map<String, String>"}, "class_info": {"name": "OAuthUtils", "kind": "class"... |
10354997_2 | class LangIdV3 implements ILangIdClassifier {
@Override
public DetectedLanguage classify(CharSequence str, boolean normalizeConfidence) {
// Compute the features and apply NB
reset();
append(str);
return classify(normalizeConfidence);
}
public LangIdV3();
public LangIdV3(Model model);
@... | LangIdV3 langid = new LangIdV3();
for (String [] langString : new String [][] {
{"en", "Mike McCandless rocks the boat."},
{"pl", "W Szczebrzeszynie chrząszcz brzmi w trzcinie"},
{"it", "Piano italiano per la crescita: negoziato in Europa sugli investimenti «virtuosi»"}
}) {
... | [FOCAL] @Override public DetectedLanguage LangIdV3.classify(CharSequence str, boolean normalizeConfidence)
[CLASS] class LangIdV3 implements ILangIdClassifier
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] DetectedLanguage classify(boolean normalizeConfidence); void append(CharSeq... | /* static context
[FOCAL] @Override public DetectedLanguage LangIdV3.classify(CharSequence str, boolean normalizeConfidence)
[INPUTS] branches=- | result=normalizeConfidence
[CALLS-INTERNAL] DetectedLanguage classify(boolean normalizeConfidence); void append(CharSequence str); void reset()
*/
| /* static context
[FOCAL] @Override public DetectedLanguage LangIdV3.classify(CharSequence str, boolean normalizeConfidence)
[INPUTS] branches=- | result=normalizeConfidence
[CALLS-INTERNAL] DetectedLanguage classify(boolean normalizeConfidence); void append(CharSequence str); void reset()
*/
class LangIdV3 implements ... | true | ok | {"focal": {"class": "LangIdV3", "name": "classify", "signature": "DetectedLanguage classify(CharSequence str, boolean normalizeConfidence)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "str", "type": "CharSequence"}, {"name": "normalizeConfidence", "type": "boolean"}], "return_type": "Detected... |
10359213_76 | class WebConnector extends Connector {
public String getHttpEndpoint() {
return "http://" + getMyHostname() + ":" + httpPort;
}
public WebConnector();
public WebConnector(boolean http, int httpPort, boolean https, int httpsPort);
public WebConnector(Integer httpPort);
public void setLogFile(String filenam... | try {
MiniClient c = new MiniClient();
c.setConnectorEndpoint(connector.getHttpEndpoint());
c.setLogin(testAgent.getIdentifier(), testPass);
ClientResponse result = c.sendRequest("GET", "favicon.ico", "");
Assert.assertEquals(200, result.getHttpCode());
Assert.assertArrayEquals(SimpleTools.toByteAr... | [FOCAL] public String WebConnector.getHttpEndpoint()
[CLASS] class WebConnector extends Connector
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String getMyHostname()
[CLASS-MEMBERS] WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnec... | /* static context
[FOCAL] public String WebConnector.getHttpEndpoint()
[CALLS-INTERNAL] String getMyHostname()
*/
| /* static context
[FOCAL] public String WebConnector.getHttpEndpoint()
[CALLS-INTERNAL] String getMyHostname()
*/
class WebConnector extends Connector {
public String getHttpEndpoint() {
return "http://" + getMyHostname() + ":" + httpPort;
}
public WebConnector();
public WebConnector(boolean http, int httpPor... | true | ok | {"focal": {"class": "WebConnector", "name": "getHttpEndpoint", "signature": "String getHttpEndpoint()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "WebConnector", "kind": "class", "modifiers": "", "superclass": "Connector", "interfaces": null, "fields": [{"nam... |
10361643_1246 | class Xsd2UmlPluginHostAdapter implements Xsd2UmlPluginHost, Xsd2UmlHostedPlugin {
@Override
public String nameFromSimpleTypeRestriction(final QName simpleType, final QName base) {
return nameFromSchemaTypeName(simpleType).concat(" restricts ").concat(nameFromSchemaTypeName(base));
}
public X... | Assert.assertEquals("test restricts test", adapter.nameFromSimpleTypeRestriction(qName, qName));
}
} | [FOCAL] @Override public String Xsd2UmlPluginHostAdapter.nameFromSimpleTypeRestriction(QName simpleType, QName base)
[CLASS] class Xsd2UmlPluginHostAdapter implements Xsd2UmlPluginHost, Xsd2UmlHostedPlugin
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String nameFromSchemaTypeNam... | /* static context
[FOCAL] @Override public String Xsd2UmlPluginHostAdapter.nameFromSimpleTypeRestriction(QName simpleType, QName base)
[INPUTS] branches=- | result=base, simpleType
[CALLS-INTERNAL] String nameFromSchemaTypeName(QName name)
[CALLS-EXTERNAL] nameFromSchemaTypeName(simpleType).concat(" restricts ").concat... | /* static context
[FOCAL] @Override public String Xsd2UmlPluginHostAdapter.nameFromSimpleTypeRestriction(QName simpleType, QName base)
[INPUTS] branches=- | result=base, simpleType
[CALLS-INTERNAL] String nameFromSchemaTypeName(QName name)
[CALLS-EXTERNAL] nameFromSchemaTypeName(simpleType).concat(" restricts ").concat... | true | ok | {"focal": {"class": "Xsd2UmlPluginHostAdapter", "name": "nameFromSimpleTypeRestriction", "signature": "String nameFromSimpleTypeRestriction(QName simpleType, QName base)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "simpleType", "type": "QName"}, {"name": "base", "type": "QName"}], "return_ty... |
10367500_9 | class Portfolio {
public final String getPortfolioReview() {
final StringBuilder sb = new StringBuilder();
sb.append("<table class=\"shareValueTableDetails\">");
for (final Equity equity : getEquities()) {
sb.append("<tr><td width=200px><b>")
.append(equity.getCurrentName())
.append("</b></td><td wid... | portfolio.setEquities(createEquities());
final String actual = portfolio.getPortfolioReview();
assertNotNull(actual);
}
} | [FOCAL] public final String Portfolio.getPortfolioReview()
[CLASS] class Portfolio
[METRICS] loc=20 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] Double getTotalValue()
[CALLS-EXTERNAL] StringBuilder.append/1, getEquities/0 (inherited), sb.append("<tr><td width=200px><b>") .append(equity.getCu..... | /* static context
[FOCAL] public final String Portfolio.getPortfolioReview()
[PATH1] foreach(Equity equity : getEquities())=T -> if(equity.getCompany().getCurrency() != getCurrency())=T -> exit loop -> return sb.toString()
[PATH2] foreach(Equity equity : getEquities())=F -> return sb.toString()
[PATH3] foreach(Equity e... | /* static context
[FOCAL] public final String Portfolio.getPortfolioReview()
[PATH1] foreach(Equity equity : getEquities())=T -> if(equity.getCompany().getCurrency() != getCurrency())=T -> exit loop -> return sb.toString()
[PATH2] foreach(Equity equity : getEquities())=F -> return sb.toString()
[PATH3] foreach(Equity e... | true | ok | {"focal": {"class": "Portfolio", "name": "getPortfolioReview", "signature": "String getPortfolioReview()", "start_line": 3, "modifiers": "public final", "params": [], "return_type": "String"}, "class_info": {"name": "Portfolio", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name... |
10422484_9 | class ElasticSearchRelatedItemHttpGetRepository implements RelatedItemGetRepository {
public static Map<String,String> processResults(String responseBody) {
JSONParser parser = new JSONParser(JSONParser.MODE_RFC4627);
try {
JSONObject object = (JSONObject)parser.parse(responseBody);
... | Map<String,String> parsedDoc = ElasticSearchRelatedItemHttpGetRepository.processResults(FOUND_ONE_ONE_WITH_ERROR);
assertTrue(parsedDoc.size()==1);
assertTrue(parsedDoc.containsKey("1"));
assertTrue(parsedDoc.get("1").contains("a8f346c5ddbbd8d438bc40f0049cc7f8"));
}
} | [FOCAL] public static Map<String,String> ElasticSearchRelatedItemHttpGetRepository.processResults(String responseBody)
[CLASS] class ElasticSearchRelatedItemHttpGetRepository implements RelatedItemGetRepository
[METRICS] loc=15 cc=3 branches=1 loops=0 returns=3 throws=0 nesting=2
[CALLS-INTERNAL] Map<String,String> par... | /* static context
[FOCAL] public static Map<String,String> ElasticSearchRelatedItemHttpGetRepository.processResults(String responseBody)
[PATH1] try-body throws -> return Collections.EMPTY_MAP
[PATH2] if(results!=null && results instanceof JSONArray)=T -> return parseDocs((JSONArray)results)
[PATH3] if(results!=null &&... | /* static context
[FOCAL] public static Map<String,String> ElasticSearchRelatedItemHttpGetRepository.processResults(String responseBody)
[PATH1] try-body throws -> return Collections.EMPTY_MAP
[PATH2] if(results!=null && results instanceof JSONArray)=T -> return parseDocs((JSONArray)results)
[PATH3] if(results!=null &&... | true | ok | {"focal": {"class": "ElasticSearchRelatedItemHttpGetRepository", "name": "processResults", "signature": "Map<String,String> processResults(String responseBody)", "start_line": 3, "modifiers": "public static", "params": [{"name": "responseBody", "type": "String"}], "return_type": "Map<String,String>"}, "class_info": {"n... |
10445803_57 | class CollectionUtil {
public static boolean empty(String[] arr) {
if (arr == null || arr.length == 0) {
return true;
}
for (String s : arr) {
if (s != null && !"".equals(s)) {
return false;
}
}
return true;
}
pub... | Assert.assertTrue(CollectionUtil.empty(new String[]{"", null, ""}));
}
} | [FOCAL] public static boolean CollectionUtil.empty(String[] arr)
[CLASS] class CollectionUtil
[METRICS] loc=12 cc=4 branches=2 loops=1 returns=3 throws=0 nesting=2
[CALLS-EXTERNAL] "".equals/1
[PATH1] if(arr == null || arr.length == 0)=F -> foreach(String s : arr)=T -> if(s != null && !"".equals(s))=F -> exit loop -> r... | /* static context
[FOCAL] public static boolean CollectionUtil.empty(String[] arr)
[PATH1] if(arr == null || arr.length == 0)=F -> foreach(String s : arr)=T -> if(s != null && !"".equals(s))=F -> exit loop -> return true
[PATH2] if(arr == null || arr.length == 0)=F -> foreach(String s : arr)=T -> if(s != null && !"".eq... | /* static context
[FOCAL] public static boolean CollectionUtil.empty(String[] arr)
[PATH1] if(arr == null || arr.length == 0)=F -> foreach(String s : arr)=T -> if(s != null && !"".equals(s))=F -> exit loop -> return true
[PATH2] if(arr == null || arr.length == 0)=F -> foreach(String s : arr)=T -> if(s != null && !"".eq... | true | ok | {"focal": {"class": "CollectionUtil", "name": "empty", "signature": "boolean empty(String[] arr)", "start_line": 3, "modifiers": "public static", "params": [{"name": "arr", "type": "String[]"}], "return_type": "boolean"}, "class_info": {"name": "CollectionUtil", "kind": "class", "modifiers": "", "superclass": null, "in... |
10448161_121 | class FloatArrays {
public static float[] scale(float[] a1, float b) {
validateArray(a1);
float[] mul = new float[a1.length];
for (int i = 0; i < a1.length; i++) {
mul[i] = a1[i] * b;
}
return mul;
}
private FloatArrays();
public static boolean inRange(float d1, float d2, float ran... | float[] da = {1, -1, 3.1f, 0.0f, 0};
Assert.assertTrue(inDelta(FloatArrays.scale(da, 0), new float[]{0, 0, 0, 0, 0}));
Assert.assertTrue(inDelta(FloatArrays.scale(da, -1), new float[]{-1, 1, -3.1f, 0, 0.0f}));
Assert.assertTrue(inDelta(FloatArrays.scale(da, 4), new float[]{4, -4, 12.4f, 0.0f, 0.0f}));
... | [FOCAL] public static float[] FloatArrays.scale(float[] a1, float b)
[CLASS] class FloatArrays
[METRICS] loc=8 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] void validateArray(float... input)
[PATH1] for(i < a1.length)=T -> exit loop -> return mul
[PATH2] for(i < a1.length)=F -> return mul
[INPU... | /* static context
[FOCAL] public static float[] FloatArrays.scale(float[] a1, float b)
[PATH1] for(i < a1.length)=T -> exit loop -> return mul
[PATH2] for(i < a1.length)=F -> return mul
[INPUTS] branches=a1 | result=a1
[CALLS-INTERNAL] void validateArray(float... input)
*/
| /* static context
[FOCAL] public static float[] FloatArrays.scale(float[] a1, float b)
[PATH1] for(i < a1.length)=T -> exit loop -> return mul
[PATH2] for(i < a1.length)=F -> return mul
[INPUTS] branches=a1 | result=a1
[CALLS-INTERNAL] void validateArray(float... input)
*/
class FloatArrays {
public static float[] s... | true | ok | {"focal": {"class": "FloatArrays", "name": "scale", "signature": "float[] scale(float[] a1, float b)", "start_line": 3, "modifiers": "public static", "params": [{"name": "a1", "type": "float[]"}, {"name": "b", "type": "float"}], "return_type": "float[]"}, "class_info": {"name": "FloatArrays", "kind": "class", "modifier... |
10455939_33 | class MostSimilarGuess {
public double getNDGC() {
if (observations.isEmpty()) {
return 0.0;
}
TIntDoubleMap actual = new TIntDoubleHashMap();
for (KnownSim ks : known.getMostSimilar()) {
actual.put(ks.wpId2, ks.similarity);
}
int ranks[] = ne... | double ndgc = (
(0.80 + 0.00 / Math.log(2+1) + 0.95 / Math.log(4+1) + 0.91 / Math.log(7+1))
/ (0.95 + 0.91 / Math.log(2+1) + 0.80 / Math.log(4+1) + 0.00 / Math.log(7+1)));
assertEquals(ndgc, guess.getNDGC(), 0.001);
}
} | [FOCAL] public double MostSimilarGuess.getNDGC()
[CLASS] class MostSimilarGuess
[METRICS] loc=28 cc=5 branches=1 loops=3 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] observations.isEmpty/0, known.getMostSimilar/0, TIntDoubleMap.put/2, observations.size/0, observations.get/1, Math.log/1, TIntDoubleMap.get/1, Arrays.sor... | /* static context
[FOCAL] public double MostSimilarGuess.getNDGC()
[PATH1] if(observations.isEmpty())=F -> foreach(KnownSim ks : known.getMostSimilar())=T -> exit loop -> for(i < observations.size())=F -> for(i < scores.length)=F -> return s / t
[PATH2] if(observations.isEmpty())=F -> foreach(KnownSim ks : known.getMos... | /* static context
[FOCAL] public double MostSimilarGuess.getNDGC()
[PATH1] if(observations.isEmpty())=F -> foreach(KnownSim ks : known.getMostSimilar())=T -> exit loop -> for(i < observations.size())=F -> for(i < scores.length)=F -> return s / t
[PATH2] if(observations.isEmpty())=F -> foreach(KnownSim ks : known.getMos... | true | ok | {"focal": {"class": "MostSimilarGuess", "name": "getNDGC", "signature": "double getNDGC()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "double"}, "class_info": {"name": "MostSimilarGuess", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "guess", "t... |
10472733_48 | class ObservationParserUtility {
public Encounter getEncounterEntity(Date encounterDateTime,String formUuid,String providerId, int locationId, String userSystemId, Patient patient, String formDataUuid) {
Encounter encounter = new Encounter();
encounter.setProvider(getDummyProvider(providerId));
... | Date encounterDateTime = new Date();
final String formUuid = "formUuid";
String providerId = "providerId";
int locationId = 1;
String userSystemId = "userSystemId";
final EncounterType encounterType = new EncounterType(){{
setUuid("encounterTypeForObservation... | [FOCAL] public Encounter ObservationParserUtility.getEncounterEntity(Date encounterDateTime, String formUuid, String providerId, int locationId, String userSystemId, Patient patient, String formDataUuid)
[CLASS] class ObservationParserUtility
[METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-... | /* static context
[FOCAL] public Encounter ObservationParserUtility.getEncounterEntity(Date encounterDateTime, String formUuid, String providerId, int locationId, String userSystemId, Patient patient, String formDataUuid)
[CALLS-INTERNAL] EncounterType getDummyEncounterType(String formUuid); Location getDummyLocation(i... | /* static context
[FOCAL] public Encounter ObservationParserUtility.getEncounterEntity(Date encounterDateTime, String formUuid, String providerId, int locationId, String userSystemId, Patient patient, String formDataUuid)
[CALLS-INTERNAL] EncounterType getDummyEncounterType(String formUuid); Location getDummyLocation(i... | true | ok | {"focal": {"class": "ObservationParserUtility", "name": "getEncounterEntity", "signature": "Encounter getEncounterEntity(Date encounterDateTime, String formUuid, String providerId, int locationId, String userSystemId, Patient patient, String formDataUuid)", "start_line": 3, "modifiers": "public", "params": [{"name": "e... |
10472781_49 | class ClassUtils {
public static Method extractPossiblyGenericMethod(Class<?> clazz, Method sourceMethod)
{
Method exactMethod = extractMethod(clazz, sourceMethod);
if (exactMethod == null)
{
String methodName = sourceMethod.getName();
Class<?>[] parameterTypes =... | Method m = InnerThree.class.getMethod("getCollection");
Method method = ClassUtils.extractPossiblyGenericMethod(InnerOne.class, m);
Assert.assertEquals(InnerOne.class.getMethod("getCollection"), method);
}
} | [FOCAL] public static Method ClassUtils.extractPossiblyGenericMethod(Class<?> clazz, Method sourceMethod)
[CLASS] class ClassUtils
[METRICS] loc=22 cc=4 branches=2 loops=1 returns=3 throws=0 nesting=3
[CALLS-INTERNAL] Method extractMethod(Class<?> clazz, Method sourceMethod); boolean allSameType(Class<?>[] left, Class<... | /* static context
[FOCAL] public static Method ClassUtils.extractPossiblyGenericMethod(Class<?> clazz, Method sourceMethod)
[PATH1] if(exactMethod == null)=T -> foreach(Method method : clazz.getMethods())=T -> if(method.getName().equals(methodName) && allSameType(method.getParameterTypes(), parameterTypes))=F -> exit l... | /* static context
[FOCAL] public static Method ClassUtils.extractPossiblyGenericMethod(Class<?> clazz, Method sourceMethod)
[PATH1] if(exactMethod == null)=T -> foreach(Method method : clazz.getMethods())=T -> if(method.getName().equals(methodName) && allSameType(method.getParameterTypes(), parameterTypes))=F -> exit l... | true | ok | {"focal": {"class": "ClassUtils", "name": "extractPossiblyGenericMethod", "signature": "Method extractPossiblyGenericMethod(Class<?> clazz, Method sourceMethod)", "start_line": 3, "modifiers": "public static", "params": [{"name": "clazz", "type": "Class<?>"}, {"name": "sourceMethod", "type": "Method"}], "return_type": ... |
10476504_0 | class PluginRegisterService {
public CompletableFuture<Response> register(Long userId, PluginReqisterQuery pluginReqisterQuery, PluginUpdate pluginUpdate,
String authorization) {
validateSubscription(pluginReqisterQuery);
checkAuthServiceAvailable();... | PluginReqisterQuery pluginReqisterQuery = new PluginReqisterQuery();
pluginReqisterQuery.setReturnCommands(true);
pluginReqisterQuery.setReturnUpdatedCommands(true);
pluginReqisterQuery.setReturnNotifications(true);
PluginUpdate pluginUpdate = new PluginUpdate();
given(... | [FOCAL] public CompletableFuture<Response> PluginRegisterService.register(Long userId, PluginReqisterQuery pluginReqisterQuery, PluginUpdate pluginUpdate, String authorization)
[CLASS] class PluginRegisterService
[METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] CompletableFuture<Pl... | /* static context
[FOCAL] public CompletableFuture<Response> PluginRegisterService.register(Long userId, PluginReqisterQuery pluginReqisterQuery, PluginUpdate pluginUpdate, String authorization)
[INPUTS] branches=- | result=authorization, pluginReqisterQuery, pluginUpdate, userId
[COLLABORATORS] param pluginReqisterQue... | /* static context
[FOCAL] public CompletableFuture<Response> PluginRegisterService.register(Long userId, PluginReqisterQuery pluginReqisterQuery, PluginUpdate pluginUpdate, String authorization)
[INPUTS] branches=- | result=authorization, pluginReqisterQuery, pluginUpdate, userId
[COLLABORATORS] param pluginReqisterQue... | true | ok | {"focal": {"class": "PluginRegisterService", "name": "register", "signature": "CompletableFuture<Response> register(Long userId, PluginReqisterQuery pluginReqisterQuery, PluginUpdate pluginUpdate, String authorization)", "start_line": 3, "modifiers": "public", "params": [{"name": "userId", "type": "Long"}, {"name": "pl... |
10503489_2 | class IncitesParser extends AbstractTask {
@Override
public void run(TaskMonitor taskMonitor) throws Exception {
taskMonitor.setTitle("Loading InCites Network ...");
this.locationMap = new IncitesInstitutionLocationMap();
OPCPackage pkg;
try {
MonitoredFileInputStream fileInp... | boolean status = false;
String path = getClass().getResource("expected_citations.xlsx").getFile();
path = URLDecoder.decode(path,"UTF-8");
SocialNetwork socialNetwork = new SocialNetwork("test",Category.INCITES);
SocialNetworkAppManager appManager = new SocialNetworkAppManager();... | [FOCAL] @Override public void IncitesParser.run(TaskMonitor taskMonitor)
[CLASS] class IncitesParser extends AbstractTask
[METRICS] loc=43 cc=6 branches=3 loops=0 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] ArrayList<Author> getIdentifiedFacultyList(); ArrayList<Author> getUnidentifiedFacultyList(); ArrayList<Publica... | /* static context
[FOCAL] @Override public void IncitesParser.run(TaskMonitor taskMonitor)
[PATH1] if(getIgnoredRows() >= 1)=T -> if(getIdentifiedFacultyList().size() == 0)=T -> if(pubList == null)=T -> return
[PATH2] if(getIgnoredRows() >= 1)=F -> if(getIdentifiedFacultyList().size() == 0)=F -> if(pubList == null)=F
[... | /* static context
[FOCAL] @Override public void IncitesParser.run(TaskMonitor taskMonitor)
[PATH1] if(getIgnoredRows() >= 1)=T -> if(getIdentifiedFacultyList().size() == 0)=T -> if(pubList == null)=T -> return
[PATH2] if(getIgnoredRows() >= 1)=F -> if(getIdentifiedFacultyList().size() == 0)=F -> if(pubList == null)=F
[... | true | ok | {"focal": {"class": "IncitesParser", "name": "run", "signature": "void run(TaskMonitor taskMonitor) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "taskMonitor", "type": "TaskMonitor"}], "return_type": "void"}, "class_info": {"name": "IncitesParser", "kind": "class", "modifiers... |
10514209_0 | class MathUtil {
public static boolean isOdd(int number) {
return number % 2 == 1;
}
}
class MathUtilTest {
@Test
public void testOdd() {
| assertTrue(MathUtil.isOdd(3));
assertFalse(MathUtil.isOdd(4));
}
} | [FOCAL] public static boolean MathUtil.isOdd(int number)
[CLASS] class MathUtil
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[INPUTS] branches=- | result=number
[DATAFLOW] number@param->L2
[TEST] MathUtilTest: @Test public void testOdd() | /* static context
[FOCAL] public static boolean MathUtil.isOdd(int number)
[INPUTS] branches=- | result=number
*/
| /* static context
[FOCAL] public static boolean MathUtil.isOdd(int number)
[INPUTS] branches=- | result=number
*/
class MathUtil {
public static boolean isOdd(int number) {
return number % 2 == 1;
}
}
class MathUtilTest {
@Test
public void testOdd() {
| true | ok | {"focal": {"class": "MathUtil", "name": "isOdd", "signature": "boolean isOdd(int number)", "start_line": 3, "modifiers": "public static", "params": [{"name": "number", "type": "int"}], "return_type": "boolean"}, "class_info": {"name": "MathUtil", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null,... |
10522064_9 | class AMETICDummyAdapter extends BasicAuthServiceAdapter implements ExternalServiceAdapter {
@Override
public ServiceResponse[] getRaw(String attribute)
throws AttributeNotSupportedException, ServiceNotAvailableException, ServiceException {
if (!this.isConnected()) {
throw new ServiceNotAvailableException()... | AMETICDummyAdapter adapter = createAdapter();
// Set credentials
adapter.register("ameticadmin", "ameticpass");
// Make sure we can retrieve info still
ServiceResponse[] attendees = adapter.getRaw("/event/@me/173/@all");
assertTrue (attendees[0].getResponse().length() > 0);
}
} | [FOCAL] @Override public ServiceResponse[] AMETICDummyAdapter.getRaw(String attribute)
[CLASS] class AMETICDummyAdapter extends BasicAuthServiceAdapter implements ExternalServiceAdapter
[METRICS] loc=44 cc=5 branches=4 loops=0 returns=3 throws=2 nesting=3
[CALLS-INTERNAL] Boolean isConnected()
[CALLS-EXTERNAL] Attribut... | /* static context
[FOCAL] @Override public ServiceResponse[] AMETICDummyAdapter.getRaw(String attribute)
[THROWS-WHEN] ServiceNotAvailableException when !this.isConnected()
[THROWS-WHEN] AttributeNotSupportedException when this.isConnected() && !genericAttribute.equals(AttributeMap.EVENT_ATTENDEES) && !genericAttribute... | /* static context
[FOCAL] @Override public ServiceResponse[] AMETICDummyAdapter.getRaw(String attribute)
[THROWS-WHEN] ServiceNotAvailableException when !this.isConnected()
[THROWS-WHEN] AttributeNotSupportedException when this.isConnected() && !genericAttribute.equals(AttributeMap.EVENT_ATTENDEES) && !genericAttribute... | true | ok | {"focal": {"class": "AMETICDummyAdapter", "name": "getRaw", "signature": "ServiceResponse[] getRaw(String attribute) throws AttributeNotSupportedException, ServiceNotAvailableException, ServiceException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "attribute", "type": "String"}], "return_type... |
10522120_5116 | class BPMNFormGenerationModelProvider implements FormGenerationModelProvider<Definitions> {
@Override
public boolean accepts(final Diagram diagram) {
return this.definitionSetId.equals(diagram.getMetadata().getDefinitionSetId());
}
protected BPMNFormGenerationModelProvider();
@Inject publ... | assertTrue(tested.accepts(diagram));
}
} | [FOCAL] @Override public boolean BPMNFormGenerationModelProvider.accepts(Diagram diagram)
[CLASS] class BPMNFormGenerationModelProvider implements FormGenerationModelProvider<Definitions>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] this.definitionSetId.equals/1, diagram.getMeta... | /* static context
[FOCAL] @Override public boolean BPMNFormGenerationModelProvider.accepts(Diagram diagram)
[INPUTS] branches=- | result=diagram
[COLLABORATORS] field definitionSetId equals/1; param diagram:Diagram getMetadata/0
[FIELDS] read=definitionSetId
[CALLS-EXTERNAL] this.definitionSetId.equals/1, diagram.getMe... | /* static context
[FOCAL] @Override public boolean BPMNFormGenerationModelProvider.accepts(Diagram diagram)
[INPUTS] branches=- | result=diagram
[COLLABORATORS] field definitionSetId equals/1; param diagram:Diagram getMetadata/0
[FIELDS] read=definitionSetId
[CALLS-EXTERNAL] this.definitionSetId.equals/1, diagram.getMe... | true | ok | {"focal": {"class": "BPMNFormGenerationModelProvider", "name": "accepts", "signature": "boolean accepts(Diagram diagram)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "diagram", "type": "Diagram"}], "return_type": "boolean"}, "class_info": {"name": "BPMNFormGenerationModelProvider", "kind": "c... |
10532531_3 | class FilteredGuacamoleReader implements GuacamoleReader {
@Override
public GuacamoleInstruction readInstruction() throws GuacamoleException {
GuacamoleInstruction filteredInstruction;
// Read and filter instructions until no instructions are dropped
do {
// Read next ins... |
// Test string
final String test = "3.yes,1.A;2.no,1.B;3.yes,1.C;3.yes,1.D;4.nope,1.E;";
GuacamoleReader reader = new FilteredGuacamoleReader(new ReaderGuacamoleReader(new StringReader(test)),
new TestFilter());
GuacamoleIns... | [FOCAL] @Override public GuacamoleInstruction FilteredGuacamoleReader.readInstruction()
[CLASS] class FilteredGuacamoleReader implements GuacamoleReader
[METRICS] loc=21 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] reader.readInstruction/0, filter.filter/1
[EXCEPTIONS] declares GuacamoleExcepti... | /* static context
[FOCAL] @Override public GuacamoleInstruction FilteredGuacamoleReader.readInstruction()
[PATH1] if(unfilteredInstruction == null)=F -> do_while(filteredInstruction == null)=F -> return filteredInstruction
[PATH2] if(unfilteredInstruction == null)=T -> return null
[COLLABORATORS] field reader readInstr... | /* static context
[FOCAL] @Override public GuacamoleInstruction FilteredGuacamoleReader.readInstruction()
[PATH1] if(unfilteredInstruction == null)=F -> do_while(filteredInstruction == null)=F -> return filteredInstruction
[PATH2] if(unfilteredInstruction == null)=T -> return null
[COLLABORATORS] field reader readInstr... | true | ok | {"focal": {"class": "FilteredGuacamoleReader", "name": "readInstruction", "signature": "GuacamoleInstruction readInstruction() throws GuacamoleException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "GuacamoleInstruction"}, "class_info": {"name": "FilteredGuacamoleReader", "kind": "cl... |
10548179_61 | class SLCImage {
public double computeRangeResolution(double pixel) {
return ((rsr2x / 2.) / rangeBandwidth) * (computeDeltaRange(pixel) / mlRg);
}
public SLCImage();
public SLCImage(MetadataElement element);
public void parseResFile(File resFileName);
public double pix2tr(double pi... | Assert.assertEquals(rangeResolution_EXPECTED, master.computeRangeResolution(CORNER_REFLECTOR_4), eps05);
}
} | [FOCAL] public double SLCImage.computeRangeResolution(double pixel)
[CLASS] class SLCImage
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] double computeDeltaRange(double pixel)
[INPUTS] branches=- | result=pixel
[DATAFLOW] pixel@param->L2
[CLASS-MEMBERS] SLCImage(); SLCImage(Metad... | /* static context
[FOCAL] public double SLCImage.computeRangeResolution(double pixel)
[INPUTS] branches=- | result=pixel
[CALLS-INTERNAL] double computeDeltaRange(double pixel)
*/
| /* static context
[FOCAL] public double SLCImage.computeRangeResolution(double pixel)
[INPUTS] branches=- | result=pixel
[CALLS-INTERNAL] double computeDeltaRange(double pixel)
*/
class SLCImage {
public double computeRangeResolution(double pixel) {
return ((rsr2x / 2.) / rangeBandwidth) * (computeDeltaRan... | true | ok | {"focal": {"class": "SLCImage", "name": "computeRangeResolution", "signature": "double computeRangeResolution(double pixel)", "start_line": 3, "modifiers": "public", "params": [{"name": "pixel", "type": "double"}], "return_type": "double"}, "class_info": {"name": "SLCImage", "kind": "class", "modifiers": "", "superclas... |
10550221_4 | class Toggled implements NotificationSignal {
@Override
public int value()
{
if (mFlag != Notification.DEFAULT_VIBRATE && mFlag != Notification.DEFAULT_SOUND && mFlag != Notification.DEFAULT_LIGHTS)
{
throw new IllegalArgumentException("Notification signal flag is not valid: " +... | assertThat(new Toggled(Notification.DEFAULT_SOUND, true, new NoSignal()).value(), is(new NoSignal().value() | Notification.DEFAULT_SOUND));
assertThat(new Toggled(Notification.DEFAULT_SOUND, false, new NoSignal()).value(), is(new NoSignal().value()));
}
} | [FOCAL] @Override public int Toggled.value()
[CLASS] class Toggled implements NotificationSignal
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-INTERNAL] int addFlag(int flagSet, int flag); int removeFlag(int flagSet, int flag)
[CALLS-EXTERNAL] mOriginal.value/0
[NEW] IllegalArgumentExcepti... | /* static context
[FOCAL] @Override public int Toggled.value()
[THROWS-WHEN] IllegalArgumentException when mFlag != Notification.DEFAULT_VIBRATE && mFlag != Notification.DEFAULT_SOUND && mFlag != Notification.DEFAULT_LIGHTS
[PATH1] if(mFlag != Notification.DEFAULT_VIBRATE && mFlag != Notification.DEFAULT_SOUND && mFlag... | /* static context
[FOCAL] @Override public int Toggled.value()
[THROWS-WHEN] IllegalArgumentException when mFlag != Notification.DEFAULT_VIBRATE && mFlag != Notification.DEFAULT_SOUND && mFlag != Notification.DEFAULT_LIGHTS
[PATH1] if(mFlag != Notification.DEFAULT_VIBRATE && mFlag != Notification.DEFAULT_SOUND && mFlag... | true | ok | {"focal": {"class": "Toggled", "name": "value", "signature": "int value()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "Toggled", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "NotificationSignal", "fields": [], "members": [{"name"... |
10553586_1 | class MavenScm {
public boolean isEmpty() {
return this.connection == null && this.developerConnection == null && this.tag == null && this.url == null;
}
MavenScm(Builder builder);
public String getConnection();
public String getDeveloperConnection();
public String getTag();
public String getUrl();
}
cl... | MavenScm mavenScm = new MavenScm.Builder().connection("some-connection").build();
assertThat(mavenScm.isEmpty()).isFalse();
}
} | [FOCAL] public boolean MavenScm.isEmpty()
[CLASS] class MavenScm
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[FIELDS] read=connection, developerConnection, tag, url
[CLASS-MEMBERS] MavenScm(Builder builder); String getConnection(); String getDeveloperConnection(); String getTag(); String getUrl... | /* static context
[FOCAL] public boolean MavenScm.isEmpty()
[FIELDS] read=connection, developerConnection, tag, url
*/
| /* static context
[FOCAL] public boolean MavenScm.isEmpty()
[FIELDS] read=connection, developerConnection, tag, url
*/
class MavenScm {
public boolean isEmpty() {
return this.connection == null && this.developerConnection == null && this.tag == null && this.url == null;
}
MavenScm(Builder builder);
public St... | true | ok | {"focal": {"class": "MavenScm", "name": "isEmpty", "signature": "boolean isEmpty()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "MavenScm", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "MavenScm"... |
10564509_25 | class WorldObject extends EventExecutor {
public void setId(int id) { this.id = id; public void setId(int id) { this.id = id; }
public void setId(int id) { this.id = id; public WorldObject();
public void setId(int id) { this.id = id; public WorldObject(String name);
public void setId(int id) { this.id = id; public... | WorldObject worldObject1 = new WorldObject("Test Object");
worldObject1.setId(id);
Assert.assertEquals(id, worldObject1.getId());
}
} | [FOCAL] public void WorldObject.setId(int id)
[CLASS] class WorldObject extends EventExecutor
[METRICS] loc=1 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[FIELDS] write=id
[STATE] id via getId()
[DATAFLOW] id@param->L1
[CLASS-MEMBERS] WorldObject(); WorldObject(String name); Angle getAngle(); void setAngle(Ang... | /* static context
[FOCAL] public void WorldObject.setId(int id)
[STATE] id via getId()
[FIELDS] write=id
*/
| /* static context
[FOCAL] public void WorldObject.setId(int id)
[STATE] id via getId()
[FIELDS] write=id
*/
class WorldObject extends EventExecutor {
public void setId(int id) { this.id = id; public void setId(int id) { this.id = id; }
public void setId(int id) { this.id = id; public WorldObject();
public void setId... | true | ok | {"focal": {"class": "WorldObject", "name": "setId", "signature": "void setId(int id)", "start_line": 3, "modifiers": "public", "params": [{"name": "id", "type": "int"}], "return_type": "void"}, "class_info": {"name": "WorldObject", "kind": "class", "modifiers": "", "superclass": "EventExecutor", "interfaces": null, "fi... |
10597460_1979 | class ManagementService implements CacheManagerEventListener {
public static void registerMBeans(
net.sf.ehcache.CacheManager cacheManager,
MBeanServer mBeanServer,
boolean registerCacheManager,
boolean registerCaches,
boolean registerCacheConfigurations,... | mBeanServer = create14MBeanServer();
ManagementService.registerMBeans(manager, mBeanServer, true, true, true, true);
assertEquals(OBJECTS_IN_TEST_EHCACHE, mBeanServer.queryNames(new ObjectName("net.sf.ehcache:*"), null).size());
}
} | [FOCAL] public static void ManagementService.registerMBeans(net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics)
[CLASS] class ManagementService implements CacheManagerEventListener
... | /* static context
[FOCAL] public static void ManagementService.registerMBeans(net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics)
[EXCEPTIONS] declares CacheException
[NEW] Manageme... | /* static context
[FOCAL] public static void ManagementService.registerMBeans(net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics)
[EXCEPTIONS] declares CacheException
[NEW] Manageme... | true | ok | {"focal": {"class": "ManagementService", "name": "registerMBeans", "signature": "void registerMBeans(net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException", "sta... |
10609316_42 | class ReportLookup extends ResourceLookup {
@Override
public String getResourceType() {
return "reportUnit";
}
public ReportLookup();
public boolean alwaysPromptControls();
@Override public String toString();
}
class ReportLookupTest {
@Test
public void shouldAlwaysReturnR... | ReportLookup response = new ReportLookup();
assertThat(response.getResourceType(), is("reportUnit"));
}
} | [FOCAL] @Override public String ReportLookup.getResourceType()
[CLASS] class ReportLookup extends ResourceLookup
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] ReportLookup(); boolean alwaysPromptControls(); String toString()
[TEST] ReportLookupTest: @Test public void shouldAlwaysR... | /* static context
[FOCAL] @Override public String ReportLookup.getResourceType()
*/
| /* static context
[FOCAL] @Override public String ReportLookup.getResourceType()
*/
class ReportLookup extends ResourceLookup {
@Override
public String getResourceType() {
return "reportUnit";
}
public ReportLookup();
public boolean alwaysPromptControls();
@Override public String toS... | true | ok | {"focal": {"class": "ReportLookup", "name": "getResourceType", "signature": "String getResourceType()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "ReportLookup", "kind": "class", "modifiers": "", "superclass": "ResourceLookup", "interfaces": null, "... |
10609318_30 | class LZMACompressionFilter extends InputStream implements CompressionStream, Runnable {
@Override
public Map<String, String> getStreamMetadata() {
if(!closed) {
throw new IllegalStateException("Stream must be closed before getting metadata");
}
Map<String,String> m... | LZMACompressionFilter lzma = runCompressMode(new LzmaProfile(16 * 1024, 128,
Encoder.EMatchFinderTypeBT2));
Map<String, String> m = lzma.getStreamMetadata();
assertEquals("Uncompressed digest incorrect", "027e997e6b1dfc97b93eb28dc9a6804096d85873",
m.get(TransformC... | [FOCAL] @Override public Map<String, String> LZMACompressionFilter.getStreamMetadata()
[CLASS] class LZMACompressionFilter extends InputStream implements CompressionStream, Runnable
[METRICS] loc=20 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] compressedSize.getByteCount/0, uncompressedSize.get... | /* static context
[FOCAL] @Override public Map<String, String> LZMACompressionFilter.getStreamMetadata()
[THROWS-WHEN] IllegalStateException when !closed
[PATH1] if(!closed)=T -> throw new IllegalStateException("Stream must be closed before getting met...
[PATH2] if(!closed)=F -> return metadata
[COLLABORATORS] field c... | /* static context
[FOCAL] @Override public Map<String, String> LZMACompressionFilter.getStreamMetadata()
[THROWS-WHEN] IllegalStateException when !closed
[PATH1] if(!closed)=T -> throw new IllegalStateException("Stream must be closed before getting met...
[PATH2] if(!closed)=F -> return metadata
[COLLABORATORS] field c... | true | ok | {"focal": {"class": "LZMACompressionFilter", "name": "getStreamMetadata", "signature": "Map<String, String> getStreamMetadata()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Map<String, String>"}, "class_info": {"name": "LZMACompressionFilter", "kind": "class", "modifiers": "", "supe... |
10610797_3 | class PrimitiveUtils {
public static String getPrimitiveTypeNameFromWrapper(Class<?> type) {
return wrapperTypes.get(type);
}
private PrimitiveUtils();
public static Object getEmptyValue(Class<?> type);
public static Class<?> getWrapperType(Class<?> type);
public static boolean isPri... | assertPrimitiveName(Byte.TYPE, Byte.class);
assertPrimitiveName(Short.TYPE, Short.class);
assertPrimitiveName(Integer.TYPE, Integer.class);
assertPrimitiveName(Long.TYPE, Long.class);
assertPrimitiveName(Float.TYPE, Float.class);
assertPrimitiveName(Double.TYPE, Double.cl... | [FOCAL] public static String PrimitiveUtils.getPrimitiveTypeNameFromWrapper(Class<?> type)
[CLASS] class PrimitiveUtils
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] wrapperTypes.get/1
[INPUTS] branches=- | result=type
[COLLABORATORS] field wrapperTypes get/1
[DATAFLOW] type@para... | /* static context
[FOCAL] public static String PrimitiveUtils.getPrimitiveTypeNameFromWrapper(Class<?> type)
[INPUTS] branches=- | result=type
[COLLABORATORS] field wrapperTypes get/1
[CALLS-EXTERNAL] wrapperTypes.get/1
*/
| /* static context
[FOCAL] public static String PrimitiveUtils.getPrimitiveTypeNameFromWrapper(Class<?> type)
[INPUTS] branches=- | result=type
[COLLABORATORS] field wrapperTypes get/1
[CALLS-EXTERNAL] wrapperTypes.get/1
*/
class PrimitiveUtils {
public static String getPrimitiveTypeNameFromWrapper(Class<?> type) {... | true | ok | {"focal": {"class": "PrimitiveUtils", "name": "getPrimitiveTypeNameFromWrapper", "signature": "String getPrimitiveTypeNameFromWrapper(Class<?> type)", "start_line": 3, "modifiers": "public static", "params": [{"name": "type", "type": "Class<?>"}], "return_type": "String"}, "class_info": {"name": "PrimitiveUtils", "kind... |
10617959_1 | class VerseHelper {
static int positionToChapterIndex(int position) throws IllegalArgumentException {
if (position < 0) {
throw new IllegalArgumentException("Invalid position: " + position);
}
final int bookCount = Bible.getBookCount();
for (int bookIndex = 0; bookIndex... | Assert.assertEquals(0, VerseHelper.positionToChapterIndex(0));
Assert.assertEquals(49, VerseHelper.positionToChapterIndex(49));
Assert.assertEquals(0, VerseHelper.positionToChapterIndex(50));
Assert.assertEquals(5, VerseHelper.positionToChapterIndex(55));
Assert.assertEquals(21... | [FOCAL] static int VerseHelper.positionToChapterIndex(int position)
[CLASS] class VerseHelper
[METRICS] loc=16 cc=4 branches=2 loops=1 returns=1 throws=2 nesting=2
[CALLS-EXTERNAL] Bible.getBookCount/0, Bible.getChapterCount/1
[NEW] IllegalArgumentException
[EXCEPTIONS] declares IllegalArgumentException; throws Illegal... | /* static context
[FOCAL] static int VerseHelper.positionToChapterIndex(int position)
[THROWS-WHEN] IllegalArgumentException when position < 0
[THROWS-WHEN] IllegalArgumentException when !(position < 0) && bookIndex < bookCount && !(position < chapterCount)
[THROWS-WHEN] IllegalArgumentException when !(position < 0) &&... | /* static context
[FOCAL] static int VerseHelper.positionToChapterIndex(int position)
[THROWS-WHEN] IllegalArgumentException when position < 0
[THROWS-WHEN] IllegalArgumentException when !(position < 0) && bookIndex < bookCount && !(position < chapterCount)
[THROWS-WHEN] IllegalArgumentException when !(position < 0) &&... | true | ok | {"focal": {"class": "VerseHelper", "name": "positionToChapterIndex", "signature": "int positionToChapterIndex(int position) throws IllegalArgumentException", "start_line": 3, "modifiers": "static", "params": [{"name": "position", "type": "int"}], "return_type": "int"}, "class_info": {"name": "VerseHelper", "kind": "cla... |
10624930_17 | class UnifiedPushMessage implements Serializable {
public Criteria getCriteria() {
return criteria;
}
public void setCriteria(Criteria criteria);
public Config getConfig();
public void setConfig(Config config);
public Message getMessage();
public void setMessage(Message message);
... | final Map<String, Object> container = new LinkedHashMap<>();
final Map<String, Object> messageObject = new LinkedHashMap<>();
messageObject.put("alert", "Howdy");
messageObject.put("sound", "default");
messageObject.put("badge", 2);
container.put("message", messageObjec... | [FOCAL] public Criteria UnifiedPushMessage.getCriteria()
[CLASS] class UnifiedPushMessage implements Serializable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] void setCriteria(Criteria criteria); Config getConfig(); void setConfig(Config config); Message getMessage(); void setMes... | /* static context
[FOCAL] public Criteria UnifiedPushMessage.getCriteria()
*/
| /* static context
[FOCAL] public Criteria UnifiedPushMessage.getCriteria()
*/
class UnifiedPushMessage implements Serializable {
public Criteria getCriteria() {
return criteria;
}
public void setCriteria(Criteria criteria);
public Config getConfig();
public void setConfig(Config config);
... | true | ok | {"focal": {"class": "UnifiedPushMessage", "name": "getCriteria", "signature": "Criteria getCriteria()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Criteria"}, "class_info": {"name": "UnifiedPushMessage", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Serializable", "fiel... |
10637895_21 | class OrderedPartitionedKVEdgeConfigurer extends HadoopKeyValuesBasedBaseConf {
public static Builder newBuilder(String keyClassName, String valueClassName,
String partitionerClassName, Configuration partitionerConf) {
return new Builder(keyClassName, valueClassName, partitione... | try {
OrderedPartitionedKVEdgeConfigurer.newBuilder(null, "VALUE", "PARTITIONER", null);
fail("Expecting a null parameter list to fail");
} catch (NullPointerException npe) {
assertTrue(npe.getMessage().contains("cannot be null"));
}
try {
OrderedPartitionedKVEdgeConfigurer.newB... | [FOCAL] public static Builder OrderedPartitionedKVEdgeConfigurer.newBuilder(String keyClassName, String valueClassName, String partitionerClassName, Configuration partitionerConf)
[CLASS] class OrderedPartitionedKVEdgeConfigurer extends HadoopKeyValuesBasedBaseConf
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 thro... | /* static context
[FOCAL] public static Builder OrderedPartitionedKVEdgeConfigurer.newBuilder(String keyClassName, String valueClassName, String partitionerClassName, Configuration partitionerConf)
[INPUTS] branches=- | result=keyClassName, partitionerClassName, partitionerConf, valueClassName
[NEW] Builder
*/
| /* static context
[FOCAL] public static Builder OrderedPartitionedKVEdgeConfigurer.newBuilder(String keyClassName, String valueClassName, String partitionerClassName, Configuration partitionerConf)
[INPUTS] branches=- | result=keyClassName, partitionerClassName, partitionerConf, valueClassName
[NEW] Builder
*/
class Or... | true | ok | {"focal": {"class": "OrderedPartitionedKVEdgeConfigurer", "name": "newBuilder", "signature": "Builder newBuilder(String keyClassName, String valueClassName, String partitionerClassName, Configuration partitionerConf)", "start_line": 3, "modifiers": "public static", "params": [{"name": "keyClassName", "type": "String"},... |
10646587_49 | class SockJsSession {
public void onOpen(final SockJsSessionContext session) {
setState(State.OPEN);
service.onOpen(session);
updateTimestamp();
}
SockJsSession(final String sessionId, final SockJsService service);
public ChannelHandlerContext connectionContext();
public... | final SockJsService service = mock(SockJsService.class);
final SockJsSession sockJSSession = new SockJsSession("123", service);
final SockJsSessionContext session = mock(SockJsSessionContext.class);
sockJSSession.onOpen(session);
verify(service).onOpen(session);
assertTha... | [FOCAL] public void SockJsSession.onOpen(SockJsSessionContext session)
[CLASS] class SockJsSession
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void setState(State newState); void updateTimestamp()
[CALLS-EXTERNAL] service.onOpen/1
[COLLABORATORS] field service onOpen/1
[DATAFLO... | /* static context
[FOCAL] public void SockJsSession.onOpen(SockJsSessionContext session)
[COLLABORATORS] field service onOpen/1
[CALLS-INTERNAL] void setState(State newState); void updateTimestamp()
[CALLS-EXTERNAL] service.onOpen/1
*/
| /* static context
[FOCAL] public void SockJsSession.onOpen(SockJsSessionContext session)
[COLLABORATORS] field service onOpen/1
[CALLS-INTERNAL] void setState(State newState); void updateTimestamp()
[CALLS-EXTERNAL] service.onOpen/1
*/
class SockJsSession {
public void onOpen(final SockJsSessionContext session) {
... | true | ok | {"focal": {"class": "SockJsSession", "name": "onOpen", "signature": "void onOpen(SockJsSessionContext session)", "start_line": 3, "modifiers": "public", "params": [{"name": "session", "type": "SockJsSessionContext"}], "return_type": "void"}, "class_info": {"name": "SockJsSession", "kind": "class", "modifiers": "", "sup... |
10663360_43 | class Pool {
public byte[] getAndClear() {
writeLock.lock();
try {
size = 0;
return poolDigest.digest();
} finally {
writeLock.unlock();
}
}
private MessageDigest createDigest();
public long size();
public void add(int source, byt... | byte[] bytes = pool.getAndClear();
assertEquals(32, bytes.length);
}
} | [FOCAL] public byte[] Pool.getAndClear()
[CLASS] class Pool
[METRICS] loc=9 cc=2 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] writeLock.lock/0, poolDigest.digest/0, writeLock.unlock/0
[PATH1] return poolDigest.digest()
[PATH2] try-body throws
[COLLABORATORS] field writeLock lock/0,unlock/0; field po... | /* static context
[FOCAL] public byte[] Pool.getAndClear()
[PATH1] return poolDigest.digest()
[PATH2] try-body throws
[COLLABORATORS] field writeLock lock/0,unlock/0; field poolDigest digest/0
[CALLS-EXTERNAL] writeLock.lock/0, poolDigest.digest/0, writeLock.unlock/0
*/
| /* static context
[FOCAL] public byte[] Pool.getAndClear()
[PATH1] return poolDigest.digest()
[PATH2] try-body throws
[COLLABORATORS] field writeLock lock/0,unlock/0; field poolDigest digest/0
[CALLS-EXTERNAL] writeLock.lock/0, poolDigest.digest/0, writeLock.unlock/0
*/
class Pool {
public byte[] getAndClear() {
... | true | ok | {"focal": {"class": "Pool", "name": "getAndClear", "signature": "byte[] getAndClear()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "byte[]"}, "class_info": {"name": "Pool", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "pool", "type": "Pool", "mo... |
10667695_14 | class DatasetBuilder {
public static BuildFromFile file() {
return new DatasetBuilder().new BuildFromFile();
}
private DatasetBuilder();
public static BuildFromBuffer buffer();
@SuppressWarnings("unchecked") private static EntityLoader<T> getLoaderFor(Header header, ICache cache, Indirec... | IndirectDataset dataset = DatasetBuilder.file()
.configureDefaultCaches()
.build(Filename.LITE_PATTERN_V32);
assertEquals(LruCache.class, dataset.getCache(StringsCache).getClass());
assertEquals(LruCache.class, dataset.getCache(SignaturesCache).getClass());
... | [FOCAL] public static BuildFromFile DatasetBuilder.file()
[CLASS] class DatasetBuilder
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] BuildFromFile, DatasetBuilder
[CLASS-MEMBERS] DatasetBuilder(); BuildFromBuffer buffer(); EntityLoader<T> getLoaderFor(Header header, ICache cache, IndirectDa... | /* static context
[FOCAL] public static BuildFromFile DatasetBuilder.file()
[NEW] BuildFromFile, DatasetBuilder
*/
| /* static context
[FOCAL] public static BuildFromFile DatasetBuilder.file()
[NEW] BuildFromFile, DatasetBuilder
*/
class DatasetBuilder {
public static BuildFromFile file() {
return new DatasetBuilder().new BuildFromFile();
}
private DatasetBuilder();
public static BuildFromBuffer buffer();
... | true | ok | {"focal": {"class": "DatasetBuilder", "name": "file", "signature": "BuildFromFile file()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "BuildFromFile"}, "class_info": {"name": "DatasetBuilder", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "membe... |
10676833_32 | class DataSourceFactory {
public XQDataSource getDataSource() throws Exception {
XQueryDataSourceType dataSourceType = config.getDataSourceType();
XQDataSource dataSource = getXQDataSource(dataSourceType, config);
if (dataSourceType.connectionPropertiesAreSupported()) {
if (conf... | given(config.getDataSourceType()).willReturn(XQueryDataSourceType.SEDNA);
given(config.getDatabaseName()).willReturn(null);
factory.getDataSource();
verifyNoMoreInteractions(dataSource);
}
} | [FOCAL] public XQDataSource DataSourceFactory.getDataSource()
[CLASS] class DataSourceFactory
[METRICS] loc=16 cc=5 branches=4 loops=0 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] XQDataSource getXQDataSource(XQueryDataSourceType dataSourceType, XQueryRunConfig config)
[CALLS-EXTERNAL] XQueryRunConfig.getDataSourceTyp... | /* static context
[FOCAL] public XQDataSource DataSourceFactory.getDataSource()
[PATH1] if(dataSourceType.connectionPropertiesAreSupported())=T -> if(config.getHost() != null && config.getHost().length() > 0)=T -> if(config.getPort() != null && config.getPort().length() > 0)=T -> if(config.getDatabaseName() != null && ... | /* static context
[FOCAL] public XQDataSource DataSourceFactory.getDataSource()
[PATH1] if(dataSourceType.connectionPropertiesAreSupported())=T -> if(config.getHost() != null && config.getHost().length() > 0)=T -> if(config.getPort() != null && config.getPort().length() > 0)=T -> if(config.getDatabaseName() != null && ... | true | ok | {"focal": {"class": "DataSourceFactory", "name": "getDataSource", "signature": "XQDataSource getDataSource() throws Exception", "start_line": 3, "modifiers": "public", "params": [], "return_type": "XQDataSource"}, "class_info": {"name": "DataSourceFactory", "kind": "class", "modifiers": "", "superclass": null, "interfa... |
10692925_14 | class McqBaseManager {
public static String status() {
StringBuilder sb = new StringBuilder(512);
sb.append("\r\nreading_mcq(yangwm,true):\t");
sb.append(IS_ALL_READ.get());
return sb.toString();
}
public static void stopReadAll();
public static void startReadAll();
}
... | String result = McqBaseManager.status();
Assert.assertEquals("\r\nreading_mcq(yangwm,true):\ttrue", result);
ApiLogger.debug("testStatus result:" + result);
}
} | [FOCAL] public static String McqBaseManager.status()
[CLASS] class McqBaseManager
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] StringBuilder.append/1, IS_ALL_READ.get/0, StringBuilder.toString/0
[NEW] StringBuilder
[DATAFLOW] sb@L2->L3,L4,L5
[CLASS-MEMBERS] void stopReadAll(); v... | /* static context
[FOCAL] public static String McqBaseManager.status()
[NEW] StringBuilder
[CALLS-EXTERNAL] StringBuilder.append/1, IS_ALL_READ.get/0, StringBuilder.toString/0
*/
| /* static context
[FOCAL] public static String McqBaseManager.status()
[NEW] StringBuilder
[CALLS-EXTERNAL] StringBuilder.append/1, IS_ALL_READ.get/0, StringBuilder.toString/0
*/
class McqBaseManager {
public static String status() {
StringBuilder sb = new StringBuilder(512);
sb.append("\r\nreading... | true | ok | {"focal": {"class": "McqBaseManager", "name": "status", "signature": "String status()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "String"}, "class_info": {"name": "McqBaseManager", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"na... |
10711220_16 | class Index extends Searchable {
public Request clearIndexAsync(@Nullable CompletionHandler completionHandler) {
return clearIndexAsync(/* requestOptions: */ null, completionHandler);
}
protected Index(@NonNull Client client, @NonNull String rawIndexName);
@Override public String toString();... | index.clearIndexAsync(new AssertCompletionHandler() {
@Override
public void doRequestCompleted(JSONObject content, AlgoliaException error) {
if (error == null) {
index.waitTaskAsync(content.optString("taskID"), new AssertCompletionHandler() {
... | [FOCAL] public Request Index.clearIndexAsync(CompletionHandler completionHandler)
[CLASS] class Index extends Searchable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Request clearIndexAsync(RequestOptions requestOptions, CompletionHandler completionHandler)
[INPUTS] branches=- |... | class Index extends Searchable {
public Request clearIndexAsync(@Nullable CompletionHandler completionHandler) {
return clearIndexAsync(/* requestOptions: */ null, completionHandler);
}
protected Index(@NonNull Client client, @NonNull String rawIndexName);
@Override public String toString();... | false | ok | {"focal": {"class": "Index", "name": "clearIndexAsync", "signature": "Request clearIndexAsync(CompletionHandler completionHandler)", "start_line": 3, "modifiers": "public", "params": [{"name": "completionHandler", "type": "CompletionHandler"}], "return_type": "Request"}, "class_info": {"name": "Index", "kind": "class",... | |
10726093_2 | class ProjectManager {
private String getRootProjectName(String name){
if(name.contains("--")){
String type = null;
if(name.endsWith("column"))
type = "column";
else if(name.endsWith("row"))
type = "row";
String subset = name.substring(name.indexOf("--"), name.length()-type.length());
name = name... | String name = getRootProjectName("mouse_test_data.tsv--s1row");
assertThat(name, is("mouse_test_data.tsvrow"));
}
} | [FOCAL] private String ProjectManager.getRootProjectName(String name)
[CLASS] class ProjectManager
[METRICS] loc=13 cc=4 branches=3 loops=0 returns=1 throws=0 nesting=3
[CALLS-EXTERNAL] String.contains/1, String.endsWith/1, String.substring/2, String.indexOf/1, String.length/0, String.replace/2
[PATH1] if(name.contains... | /* static context
[FOCAL] private String ProjectManager.getRootProjectName(String name)
[PATH1] if(name.contains("--"))=T -> if(name.endsWith("column"))=F -> if(name.endsWith("row"))=T -> return name
[PATH2] if(name.contains("--"))=F -> return name
[PATH3] if(name.contains("--"))=T -> if(name.endsWith("column"))=T -> r... | /* static context
[FOCAL] private String ProjectManager.getRootProjectName(String name)
[PATH1] if(name.contains("--"))=T -> if(name.endsWith("column"))=F -> if(name.endsWith("row"))=T -> return name
[PATH2] if(name.contains("--"))=F -> return name
[PATH3] if(name.contains("--"))=T -> if(name.endsWith("column"))=T -> r... | true | ok | {"focal": {"class": "ProjectManager", "name": "getRootProjectName", "signature": "String getRootProjectName(String name)", "start_line": 3, "modifiers": "private", "params": [{"name": "name", "type": "String"}], "return_type": "String"}, "class_info": {"name": "ProjectManager", "kind": "class", "modifiers": "", "superc... |
10737956_21 | class SensorInstanceProvider implements InsertSensorOfferingListener {
public void init() throws InternalServiceException {
sensorPluginLoader = ServiceLoader.load(SensorInstanceFactory.class);
if (isMissingRepository()) {
throw new IllegalStateException("SensorInstanceProvider misses a... | SensorInstanceProvider provider = new SensorInstanceProvider();
setEmptyInMemoryRepositories(provider);
provider.init();
assertTrue(iterableToCollection(provider.getSensors()).isEmpty());
}
} | [FOCAL] public void SensorInstanceProvider.init()
[CLASS] class SensorInstanceProvider implements InsertSensorOfferingListener
[METRICS] loc=11 cc=3 branches=1 loops=1 returns=0 throws=1 nesting=1
[CALLS-INTERNAL] SensorPlugin initSensorInstance(SensorConfiguration sensorConfiguration); boolean isMissingRepository()
[C... | /* static context
[FOCAL] public void SensorInstanceProvider.init()
[THROWS-WHEN] IllegalStateException when isMissingRepository()
[PATH1] if(isMissingRepository())=F -> foreach(SensorConfiguration sensorConfiguration : configs)=T -> exit loop
[PATH2] if(isMissingRepository())=T -> throw new IllegalStateException("Sens... | /* static context
[FOCAL] public void SensorInstanceProvider.init()
[THROWS-WHEN] IllegalStateException when isMissingRepository()
[PATH1] if(isMissingRepository())=F -> foreach(SensorConfiguration sensorConfiguration : configs)=T -> exit loop
[PATH2] if(isMissingRepository())=T -> throw new IllegalStateException("Sens... | true | ok | {"focal": {"class": "SensorInstanceProvider", "name": "init", "signature": "void init() throws InternalServiceException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "SensorInstanceProvider", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "In... |
10741477_39 | class Buckets {
public final SortedSet<Long> getTimestamps() {
SortedSet<Long> result = new TreeSet<>(bucketList.keySet());
return result;
}
public Buckets();
public Buckets(final long secondsPerBucket);
public Map<Long, Bucket> getBucketList();
public void addQueryStatus(P ... | Buckets<IHasShortcut> testSubject = makeTestBuckets();
assertTrue("GetTimestamps", null != testSubject.getTimestamps());
}
} | [FOCAL] public final SortedSet<Long> Buckets.getTimestamps()
[CLASS] class Buckets
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] bucketList.keySet/0
[NEW] TreeSet<>
[COLLABORATORS] field bucketList keySet/0
[DATAFLOW] result@L2->L3
[CLASS-MEMBERS] Buckets(); Buckets(long secondsP... | /* static context
[FOCAL] public final SortedSet<Long> Buckets.getTimestamps()
[COLLABORATORS] field bucketList keySet/0
[NEW] TreeSet<>
[CALLS-EXTERNAL] bucketList.keySet/0
*/
| /* static context
[FOCAL] public final SortedSet<Long> Buckets.getTimestamps()
[COLLABORATORS] field bucketList keySet/0
[NEW] TreeSet<>
[CALLS-EXTERNAL] bucketList.keySet/0
*/
class Buckets {
public final SortedSet<Long> getTimestamps() {
SortedSet<Long> result = new TreeSet<>(bucketList.keySet());
... | true | ok | {"focal": {"class": "Buckets", "name": "getTimestamps", "signature": "SortedSet<Long> getTimestamps()", "start_line": 3, "modifiers": "public final", "params": [], "return_type": "SortedSet<Long>"}, "class_info": {"name": "Buckets", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"... |
10746583_101 | class ParallelAggregation {
public static RoaringBitmap xor(RoaringBitmap... bitmaps) {
return groupByKey(bitmaps)
.entrySet()
.parallelStream()
.collect(XOR);
}
public static SortedMap<Character, List<Container>> groupByKey(RoaringBitmap... bitmaps);
public static Roar... | RoaringBitmap one = testCase().withRunAt(0).withBitmapAt(1).withArrayAt(2).build();
RoaringBitmap two = testCase().withBitmapAt(0).withArrayAt(2).build();
RoaringBitmap three = testCase().withArrayAt(0).withBitmapAt(1).withArrayAt(2).build();
assertEquals(FastAggregation.xor(one, two, three), ParallelAg... | [FOCAL] public static RoaringBitmap ParallelAggregation.xor(RoaringBitmap... bitmaps)
[CLASS] class ParallelAggregation
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] SortedMap<Character, List<Container>> groupByKey(RoaringBitmap... bitmaps)
[CALLS-EXTERNAL] groupByKey(bitmaps) .e... | /* static context
[FOCAL] public static RoaringBitmap ParallelAggregation.xor(RoaringBitmap... bitmaps)
[INPUTS] branches=- | result=bitmaps
[CALLS-INTERNAL] SortedMap<Character, List<Container>> groupByKey(RoaringBitmap... bitmaps)
[CALLS-EXTERNAL] groupByKey(bitmaps) .entrySet() .parallelStream().collect/1, groupByKe... | /* static context
[FOCAL] public static RoaringBitmap ParallelAggregation.xor(RoaringBitmap... bitmaps)
[INPUTS] branches=- | result=bitmaps
[CALLS-INTERNAL] SortedMap<Character, List<Container>> groupByKey(RoaringBitmap... bitmaps)
[CALLS-EXTERNAL] groupByKey(bitmaps) .entrySet() .parallelStream().collect/1, groupByKe... | true | ok | {"focal": {"class": "ParallelAggregation", "name": "xor", "signature": "RoaringBitmap xor(RoaringBitmap... bitmaps)", "start_line": 3, "modifiers": "public static", "params": [{"name": "bitmaps", "type": "RoaringBitmap..."}], "return_type": "RoaringBitmap"}, "class_info": {"name": "ParallelAggregation", "kind": "class"... |
10761704_2 | class DayOfMonthMatcher extends FeatureMatcher<DateTime, Integer> {
public static Matcher<DateTime> onDayOfMonth(Matcher<Integer> dayMatcher)
{
return new DayOfMonthMatcher(dayMatcher);
}
public DayOfMonthMatcher(Matcher<Integer> subMatcher);
public static Matcher<DateTime> onDayOfMonth(... | assertThat(onDayOfMonth(10),
AllOf.<Matcher<DateTime>>allOf(
matches(DateTime.parse("20180710T010001Z")),
mismatches(DateTime.parse("20181001T005959Z"), "day of month was <1>"),
mismatches(DateTime.parse("20181011T010000Z"),... | [FOCAL] public static Matcher<DateTime> DayOfMonthMatcher.onDayOfMonth(Matcher<Integer> dayMatcher)
[CLASS] class DayOfMonthMatcher extends FeatureMatcher<DateTime, Integer>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] DayOfMonthMatcher
[INPUTS] branches=- | result=dayMatcher
[DATAFLOW] da... | /* static context
[FOCAL] public static Matcher<DateTime> DayOfMonthMatcher.onDayOfMonth(Matcher<Integer> dayMatcher)
[INPUTS] branches=- | result=dayMatcher
[NEW] DayOfMonthMatcher
*/
| /* static context
[FOCAL] public static Matcher<DateTime> DayOfMonthMatcher.onDayOfMonth(Matcher<Integer> dayMatcher)
[INPUTS] branches=- | result=dayMatcher
[NEW] DayOfMonthMatcher
*/
class DayOfMonthMatcher extends FeatureMatcher<DateTime, Integer> {
public static Matcher<DateTime> onDayOfMonth(Matcher<Integer> ... | true | ok | {"focal": {"class": "DayOfMonthMatcher", "name": "onDayOfMonth", "signature": "Matcher<DateTime> onDayOfMonth(Matcher<Integer> dayMatcher)", "start_line": 3, "modifiers": "public static", "params": [{"name": "dayMatcher", "type": "Matcher<Integer>"}], "return_type": "Matcher<DateTime>"}, "class_info": {"name": "DayOfMo... |
10762348_1 | class VanillaSharedReplicatedHashMap extends AbstractVanillaSharedHashMap<K, V> implements SharedHashMap<K, V>, ReplicaExternalizable<K, V>, EntryResolver<K, V>,
Closeable {
@NotNull
@Override
public Set<Entry<K, V>> entrySet() {
return new EntrySet();
}
public VanillaSharedReplic... | SharedHashMap map = map5();
Set s = map.entrySet();
assertEquals(5, s.size());
Iterator it = s.iterator();
while (it.hasNext()) {
Map.Entry e = (Map.Entry) it.next();
assertTrue(
(e.getKey().equals(JSR166TestCase.one) && e.getValue().eq... | [FOCAL] @NotNull @Override public Set<Entry<K, V>> VanillaSharedReplicatedHashMap.entrySet()
[CLASS] class VanillaSharedReplicatedHashMap extends AbstractVanillaSharedHashMap<K, V> implements SharedHashMap<K, V>, ReplicaExternalizable<K, V>, EntryResolver<K, V>, Closeable
[METRICS] loc=5 cc=1 branches=0 loops=0 returns... | /* static context
[FOCAL] @NotNull @Override public Set<Entry<K, V>> VanillaSharedReplicatedHashMap.entrySet()
[NEW] EntrySet
*/
| /* static context
[FOCAL] @NotNull @Override public Set<Entry<K, V>> VanillaSharedReplicatedHashMap.entrySet()
[NEW] EntrySet
*/
class VanillaSharedReplicatedHashMap extends AbstractVanillaSharedHashMap<K, V> implements SharedHashMap<K, V>, ReplicaExternalizable<K, V>, EntryResolver<K, V>,
Closeable {
@Not... | true | ok | {"focal": {"class": "VanillaSharedReplicatedHashMap", "name": "entrySet", "signature": "Set<Entry<K, V>> entrySet()", "start_line": 4, "modifiers": "@NotNull @Override public", "params": [], "return_type": "Set<Entry<K, V>>"}, "class_info": {"name": "VanillaSharedReplicatedHashMap", "kind": "class", "modifiers": "", "s... |
10772221_0 | class StaticFieldExporter {
@Deprecated
public static void export(Module module, List<Class<?>> classesToConvert) {
new StaticFieldExporter(module, null).export(classesToConvert);
}
public StaticFieldExporter(Module module, Configuration conf);
public void export(List<Class<?>> classesToConvert);
private bo... | Writer out = new StringWriter();
ArrayList<Class<?>> classesToConvert = new ArrayList<Class<?>>();
classesToConvert.add(TestClass.class);
Module module = new Module("mod");
new StaticFieldExporter(module, null).export(classesToConvert);
module.write(out);
out.close();
final String result = out.toStr... | [FOCAL] @Deprecated public static void StaticFieldExporter.export(Module module, List<Class<?>> classesToConvert)
[CLASS] class StaticFieldExporter
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] new StaticFieldExporter(module, null).export/1
[NEW] StaticFieldExporter
[DATAFLOW] cl... | /* static context
[FOCAL] @Deprecated public static void StaticFieldExporter.export(Module module, List<Class<?>> classesToConvert)
[NEW] StaticFieldExporter
[CALLS-EXTERNAL] new StaticFieldExporter(module, null).export/1
*/
| /* static context
[FOCAL] @Deprecated public static void StaticFieldExporter.export(Module module, List<Class<?>> classesToConvert)
[NEW] StaticFieldExporter
[CALLS-EXTERNAL] new StaticFieldExporter(module, null).export/1
*/
class StaticFieldExporter {
@Deprecated
public static void export(Module module, List<Class<... | true | ok | {"focal": {"class": "StaticFieldExporter", "name": "export", "signature": "void export(Module module, List<Class<?>> classesToConvert)", "start_line": 3, "modifiers": "@Deprecated public static", "params": [{"name": "module", "type": "Module"}, {"name": "classesToConvert", "type": "List<Class<?>>"}], "return_type": "vo... |
10785687_16 | class NumberNode {
public boolean isSimpleNumber() {
return isSimpleNumber;
}
public NumberNode(String number);
private void processPattern();
private boolean isNumberValueStar();
private void processAllPatternNumber();
private boolean isNumberValueNetworkPattern();
private v... | NumberNode node = new NumberNode("8/30");
assertFalse(node.isSimpleNumber());
assertNodeMatch(node, 8, 11, true);
assertNodeMatch(node, 0, 7, false);
assertNodeMatch(node, 12, 255, false);
}
} | [FOCAL] public boolean NumberNode.isSimpleNumber()
[CLASS] class NumberNode
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] NumberNode(String number); void processPattern(); boolean isNumberValueStar(); void processAllPatternNumber(); boolean isNumberValueNetworkPattern(); void proc... | /* static context
[FOCAL] public boolean NumberNode.isSimpleNumber()
*/
| /* static context
[FOCAL] public boolean NumberNode.isSimpleNumber()
*/
class NumberNode {
public boolean isSimpleNumber() {
return isSimpleNumber;
}
public NumberNode(String number);
private void processPattern();
private boolean isNumberValueStar();
private void processAllPatternNu... | true | ok | {"focal": {"class": "NumberNode", "name": "isSimpleNumber", "signature": "boolean isSimpleNumber()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "NumberNode", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{... |
10806441_91 | class DefaultSoyMsgBundleResolver implements SoyMsgBundleResolver {
public boolean isHotReloadMode() {
return hotReloadMode;
}
public Optional<SoyMsgBundle> resolve(final Optional<Locale> locale);
protected SoyMsgBundle createSoyMsgBundle(final Locale locale);
private Optional<? extends So... | Assert.assertFalse("debug should be off", defaultSoyMsgBundleResolver.isHotReloadMode());
}
} | [FOCAL] public boolean DefaultSoyMsgBundleResolver.isHotReloadMode()
[CLASS] class DefaultSoyMsgBundleResolver implements SoyMsgBundleResolver
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] Optional<SoyMsgBundle> resolve(Optional<Locale> locale); SoyMsgBundle createSoyMsgBundle(Loc... | /* static context
[FOCAL] public boolean DefaultSoyMsgBundleResolver.isHotReloadMode()
*/
| /* static context
[FOCAL] public boolean DefaultSoyMsgBundleResolver.isHotReloadMode()
*/
class DefaultSoyMsgBundleResolver implements SoyMsgBundleResolver {
public boolean isHotReloadMode() {
return hotReloadMode;
}
public Optional<SoyMsgBundle> resolve(final Optional<Locale> locale);
protect... | true | ok | {"focal": {"class": "DefaultSoyMsgBundleResolver", "name": "isHotReloadMode", "signature": "boolean isHotReloadMode()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "DefaultSoyMsgBundleResolver", "kind": "class", "modifiers": "", "superclass": null, "interfaces... |
10828921_31 | class JobEntity extends BaseEntity implements
FinishedJobProjection,
JobProjection,
JobRequestProjection,
JobMetadataProjection,
JobExecutionProjection,
JobApplicationsProjection,
JobClusterProjection,
JobCommandProjection,
JobSearchProjection,
V4JobRequestProjection,
JobSpec... | final String clientHost = UUID.randomUUID().toString();
this.jobEntity.setRequestApiClientHostname(clientHost);
Assertions.assertThat(this.jobEntity.getRequestApiClientHostname()).isPresent().contains(clientHost);
}
} | [FOCAL] @Override public Optional<String> JobEntity.getRequestApiClientHostname()
[CLASS] class JobEntity extends BaseEntity implements FinishedJobProjection, JobProjection, JobRequestProjection, JobMetadataProjection, JobExecutionProjection, JobApplicationsProjection, JobClusterProjection, JobCommandProjection, JobSea... | /* static context
[FOCAL] @Override public Optional<String> JobEntity.getRequestApiClientHostname()
[FIELDS] read=requestApiClientHostname
[CALLS-EXTERNAL] Optional.ofNullable/1
*/
| /* static context
[FOCAL] @Override public Optional<String> JobEntity.getRequestApiClientHostname()
[FIELDS] read=requestApiClientHostname
[CALLS-EXTERNAL] Optional.ofNullable/1
*/
class JobEntity extends BaseEntity implements
FinishedJobProjection,
JobProjection,
JobRequestProjection,
JobMetadataProjec... | true | ok | {"focal": {"class": "JobEntity", "name": "getRequestApiClientHostname", "signature": "Optional<String> getRequestApiClientHostname()", "start_line": 17, "modifiers": "@Override public", "params": [], "return_type": "Optional<String>"}, "class_info": {"name": "JobEntity", "kind": "class", "modifiers": "", "superclass": ... |
10837431_9 | class Entity_Feature_Association {
public int getPlace_id() {
return place_id;
}
public Entity_Feature_Association(int place_id, String place_type, int device_feature_id, int id, String device_feature);
public void setPlace_id(int placeId);
public String getPlace_type();
public void ... | Entity_Feature_Association feature_association = new Entity_Feature_Association(0, null, 0, 0, null);
int placeid = feature_association.getPlace_id();
Assert.assertEquals(0, placeid);
feature_association.setPlace_id(125);
placeid = feature_association.getPlace_id();
Asse... | [FOCAL] public int Entity_Feature_Association.getPlace_id()
[CLASS] class Entity_Feature_Association
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] Entity_Feature_Association(int place_id, String place_type, int device_feature_id, int id, String device_feature); void setPlace_id(in... | /* static context
[FOCAL] public int Entity_Feature_Association.getPlace_id()
*/
| /* static context
[FOCAL] public int Entity_Feature_Association.getPlace_id()
*/
class Entity_Feature_Association {
public int getPlace_id() {
return place_id;
}
public Entity_Feature_Association(int place_id, String place_type, int device_feature_id, int id, String device_feature);
public v... | true | ok | {"focal": {"class": "Entity_Feature_Association", "name": "getPlace_id", "signature": "int getPlace_id()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "Entity_Feature_Association", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields":... |
10873724_103 | class ArrayRule implements Rule<JPackage, JClass> {
@Override
public JClass apply(String nodeName, JsonNode node, JsonNode parent, JPackage jpackage, Schema schema) {
boolean uniqueItems = node.has("uniqueItems") && node.get("uniqueItems").asBoolean();
boolean rootSchemaIsArray = !schema.isGen... | JCodeModel codeModel = new JCodeModel();
JPackage jpackage = codeModel._package(getClass().getPackage().getName());
ObjectMapper mapper = new ObjectMapper();
ObjectNode itemsNode = mapper.createObjectNode();
itemsNode.put("type", "boolean");
ObjectNode propertyNode = m... | [FOCAL] @Override public JClass ArrayRule.apply(String nodeName, JsonNode node, JsonNode parent, JPackage jpackage, Schema schema)
[CLASS] class ArrayRule implements Rule<JPackage, JClass>
[METRICS] loc=26 cc=4 branches=3 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] String makeSingular(String nodeName)
[CALLS-... | /* static context
[FOCAL] @Override public JClass ArrayRule.apply(String nodeName, JsonNode node, JsonNode parent, JPackage jpackage, Schema schema)
[PATH1] if(node.has("items"))=T -> if(uniqueItems)=T -> if(rootSchemaIsArray)=T -> return arrayType
[PATH2] if(node.has("items"))=F -> if(uniqueItems)=F -> if(rootSchemaIs... | /* static context
[FOCAL] @Override public JClass ArrayRule.apply(String nodeName, JsonNode node, JsonNode parent, JPackage jpackage, Schema schema)
[PATH1] if(node.has("items"))=T -> if(uniqueItems)=T -> if(rootSchemaIsArray)=T -> return arrayType
[PATH2] if(node.has("items"))=F -> if(uniqueItems)=F -> if(rootSchemaIs... | true | ok | {"focal": {"class": "ArrayRule", "name": "apply", "signature": "JClass apply(String nodeName, JsonNode node, JsonNode parent, JPackage jpackage, Schema schema)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "nodeName", "type": "String"}, {"name": "node", "type": "JsonNode"}, {"name": "parent", ... |
10899610_2 | class AcronymGeneratorImpl implements AcronymGenerator {
@Override
public String generate(String givenNames, String surname) {
Assert.hasText(givenNames, "Given name is required");
Assert.hasText(surname, "Surname is required");
int wordsSize = 0;
wordsSize += givenNames.lengt... | String givenNames = "Eva";
String surname = "Järvinen";
String acronym = acronymGenerator.generate(givenNames, surname);
assertThat(acronym).isEqualTo("EVAJÄRVI");
}
} | [FOCAL] @Override public String AcronymGeneratorImpl.generate(String givenNames, String surname)
[CLASS] class AcronymGeneratorImpl implements AcronymGenerator
[METRICS] loc=29 cc=4 branches=3 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] Assert.hasText/2, String.length/0, StringUtils.upperCase/1, new StringBui... | /* static context
[FOCAL] @Override public String AcronymGeneratorImpl.generate(String givenNames, String surname)
[PATH1] if(wordsSize < DEFAULT_SIZE)=F -> if(givenNames.length() < 4)=T -> if(surname.length() < 4)=T -> return StringUtils.upperCase(builder.toString())
[PATH2] if(wordsSize < DEFAULT_SIZE)=T -> return St... | /* static context
[FOCAL] @Override public String AcronymGeneratorImpl.generate(String givenNames, String surname)
[PATH1] if(wordsSize < DEFAULT_SIZE)=F -> if(givenNames.length() < 4)=T -> if(surname.length() < 4)=T -> return StringUtils.upperCase(builder.toString())
[PATH2] if(wordsSize < DEFAULT_SIZE)=T -> return St... | true | ok | {"focal": {"class": "AcronymGeneratorImpl", "name": "generate", "signature": "String generate(String givenNames, String surname)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "givenNames", "type": "String"}, {"name": "surname", "type": "String"}], "return_type": "String"}, "class_info": {"name... |
10912209_41 | class HasCookieMatcher extends TypeSafeMatcher<WebDriver> {
@Factory
public static Matcher<WebDriver> hasCookie(String name) {
return new HasCookieMatcher(name);
}
protected HasCookieMatcher(String name);
@Override protected boolean matchesSafely(WebDriver wDriver);
@Override public ... | WebDriver driver = mock(WebDriver.class);
Options options = mock(Options.class);
Cookie cookie = new Cookie(cookieName, "oki-doki");
when(driver.manage()).thenReturn(options);
when(options.getCookieNamed(eq(cookieName))).thenReturn(cookie);
assertThat("Cookie not found... | [FOCAL] @Factory public static Matcher<WebDriver> HasCookieMatcher.hasCookie(String name)
[CLASS] class HasCookieMatcher extends TypeSafeMatcher<WebDriver>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] HasCookieMatcher
[INPUTS] branches=- | result=name
[DATAFLOW] name@param->L3
[CLASS-MEMBE... | /* static context
[FOCAL] @Factory public static Matcher<WebDriver> HasCookieMatcher.hasCookie(String name)
[INPUTS] branches=- | result=name
[NEW] HasCookieMatcher
*/
| /* static context
[FOCAL] @Factory public static Matcher<WebDriver> HasCookieMatcher.hasCookie(String name)
[INPUTS] branches=- | result=name
[NEW] HasCookieMatcher
*/
class HasCookieMatcher extends TypeSafeMatcher<WebDriver> {
@Factory
public static Matcher<WebDriver> hasCookie(String name) {
return n... | true | ok | {"focal": {"class": "HasCookieMatcher", "name": "hasCookie", "signature": "Matcher<WebDriver> hasCookie(String name)", "start_line": 3, "modifiers": "@Factory public static", "params": [{"name": "name", "type": "String"}], "return_type": "Matcher<WebDriver>"}, "class_info": {"name": "HasCookieMatcher", "kind": "class",... |
10932418_13 | class Connection {
public long addComment(long app, long record, String text, List<MentionDto> mentions) throws DBException {
JsonParser parser = new JsonParser();
String json;
try {
json = parser.generateForAddComment(app, record, text, mentions);
} catch (IOException e) {... | Connection db = getConnection();
long app = getAppId();
try {
List<Long> recordIds = insertRecords();
long record = recordIds.get(0);
List<MentionDto> mentions = new ArrayList<MentionDto>();
mentions.add(new MentionDto("kadoya", "USER"));
mentions.add(new MentionDto("sato", "USER"));
String text... | [FOCAL] public long Connection.addComment(long app, long record, String text, List<MentionDto> mentions)
[CLASS] class Connection
[METRICS] loc=17 cc=3 branches=0 loops=0 returns=1 throws=2 nesting=1
[CALLS-INTERNAL] String request(String method, String api, String body)
[CALLS-EXTERNAL] JsonParser.generateForAddCommen... | /* static context
[FOCAL] public long Connection.addComment(long app, long record, String text, List<MentionDto> mentions)
[THROWS-WHEN] ParseException when try-body throws
[PATH1] try-body throws -> throw new ParseException("failed to encode to json")
[PATH2] return parser.jsonToId(response)
[PATH3] try-body throws ->... | /* static context
[FOCAL] public long Connection.addComment(long app, long record, String text, List<MentionDto> mentions)
[THROWS-WHEN] ParseException when try-body throws
[PATH1] try-body throws -> throw new ParseException("failed to encode to json")
[PATH2] return parser.jsonToId(response)
[PATH3] try-body throws ->... | true | ok | {"focal": {"class": "Connection", "name": "addComment", "signature": "long addComment(long app, long record, String text, List<MentionDto> mentions) throws DBException", "start_line": 3, "modifiers": "public", "params": [{"name": "app", "type": "long"}, {"name": "record", "type": "long"}, {"name": "text", "type": "Stri... |
10937119_2 | class IdResource {
public long getId(final String agent) {
try {
return worker.getId(agent);
} catch (final InvalidUserAgentError e) {
LOGGER.error("Invalid user agent ({})", agent);
throw new SnowizardException(Response.Status.BAD_REQUEST,
"I... | when(worker.getId(AGENT)).thenThrow(new InvalidSystemClock());
try {
resources.client().target("/").request(MediaType.TEXT_PLAIN)
.header(HttpHeaders.USER_AGENT, AGENT)
.get(ClientResponse.class);
failBecauseExceptionWasNotThrown(InternalServerErrorExcept... | [FOCAL] public long IdResource.getId(String agent)
[CLASS] class IdResource
[METRICS] loc=13 cc=3 branches=0 loops=0 returns=1 throws=2 nesting=1
[CALLS-EXTERNAL] IdWorker.getId/1, LOGGER.error/2, InvalidSystemClock.getMessage/0
[NEW] SnowizardException
[FIELDS] read=worker:IdWorker
[EXCEPTIONS] throws SnowizardExcepti... | /* static context
[FOCAL] public long IdResource.getId(String agent)
[THROWS-WHEN] SnowizardException when try-body throws
[PATH1] try-body throws -> throw new SnowizardException(Response.Status.BAD_REQUEST, "Invalid User-A...
[PATH2] return worker.getId(agent)
[PATH3] try-body throws -> throw new SnowizardException(Re... | /* static context
[FOCAL] public long IdResource.getId(String agent)
[THROWS-WHEN] SnowizardException when try-body throws
[PATH1] try-body throws -> throw new SnowizardException(Response.Status.BAD_REQUEST, "Invalid User-A...
[PATH2] return worker.getId(agent)
[PATH3] try-body throws -> throw new SnowizardException(Re... | true | ok | {"focal": {"class": "IdResource", "name": "getId", "signature": "long getId(String agent)", "start_line": 3, "modifiers": "public", "params": [{"name": "agent", "type": "String"}], "return_type": "long"}, "class_info": {"name": "IdResource", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fie... |
10945339_20 | class GLFS {
@JniArg(cast = "glfs_fd_t *") long fd)@JniMethod
public static final native int glfs_fsync(
@JniArg(cast = "glfs_fd_t *") long fd);
@JniArg(cast = "glfs_fd_t *") long fd)@JniMethod(cast = "glfs_t *") public static final native long glfs_new(
@JniArg(cas... | int fsync = glfs_fsync(file);
System.out.println("FSYNC: " + fsync);
assertEquals(0, fsync);
}
} | [FOCAL] public static final native int GLFS.glfs_fsync(long fd)
[CLASS] class GLFS
[METRICS] loc=2 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CLASS-MEMBERS] long glfs_new(String volname); int glfs_set_volfile_server(long fs, String transport, String host, int port); int glfs_set_logging(long fs, String logfi... | class GLFS {
@JniArg(cast = "glfs_fd_t *") long fd)@JniMethod
public static final native int glfs_fsync(
@JniArg(cast = "glfs_fd_t *") long fd);
@JniArg(cast = "glfs_fd_t *") long fd)@JniMethod(cast = "glfs_t *") public static final native long glfs_new(
@JniArg(cas... | false | partial | {"focal": {"class": "GLFS", "name": "glfs_fsync", "signature": "int glfs_fsync(long fd)", "start_line": 4, "modifiers": "public static final native", "params": [{"name": "fd", "type": "long"}], "return_type": "int"}, "class_info": {"name": "GLFS", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null... | |
10974543_2 | class CheckerWithException {
public int checkValue(final int amount) {
if (amount == 0) {
throw new IllegalArgumentException("value is 0");
}
return 0;
}
private CheckerWithException checkerWithException;
}
class CheckerWithExceptionTest {
private CheckerWithExce... | assertThrows(IllegalArgumentException.class, () -> checkerWithException.checkValue(0));
}
} | [FOCAL] public int CheckerWithException.checkValue(int amount)
[CLASS] class CheckerWithException
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[NEW] IllegalArgumentException
[EXCEPTIONS] throws IllegalArgumentException
[THROWS-WHEN] IllegalArgumentException when amount == 0
[PATH1] if(amount == ... | /* static context
[FOCAL] public int CheckerWithException.checkValue(int amount)
[THROWS-WHEN] IllegalArgumentException when amount == 0
[PATH1] if(amount == 0)=T -> throw new IllegalArgumentException("value is 0")
[PATH2] if(amount == 0)=F -> return 0
[INPUTS] branches=amount | result=-
[EXCEPTIONS] throws IllegalArgu... | /* static context
[FOCAL] public int CheckerWithException.checkValue(int amount)
[THROWS-WHEN] IllegalArgumentException when amount == 0
[PATH1] if(amount == 0)=T -> throw new IllegalArgumentException("value is 0")
[PATH2] if(amount == 0)=F -> return 0
[INPUTS] branches=amount | result=-
[EXCEPTIONS] throws IllegalArgu... | true | ok | {"focal": {"class": "CheckerWithException", "name": "checkValue", "signature": "int checkValue(int amount)", "start_line": 3, "modifiers": "public", "params": [{"name": "amount", "type": "int"}], "return_type": "int"}, "class_info": {"name": "CheckerWithException", "kind": "class", "modifiers": "", "superclass": null, ... |
10983382_14 | class CircularArraySequence implements Sequence {
@Override
public Sequence tail() {
CircularArraySequence<T> tempSequence = new CircularArraySequence<T>(this);
if (backingArray[front]!=null){
tempSequence.backingArray[front] = null;
tempSequence.fillCount-=1;
if (front == backingArray.length-1){
te... | Sequence<String> seq2 = seq.tail();
assertTrue("empty sequence tail should empty seq", seq2.isEmpty());
seq.append("a");
seq.append("b");
seq.append("c");
seq.append("d");
seq.append("e");
Sequence<String> seq1 = seq.tail();
assertEquals("Length of... | [FOCAL] @Override public Sequence CircularArraySequence.tail()
[CLASS] class CircularArraySequence implements Sequence
[METRICS] loc=17 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=2
[NEW] CircularArraySequence<T>
[PATH1] if(backingArray[front]!=null)=T -> if(front == backingArray.length-1)=T -> return tempSequen... | /* static context
[FOCAL] @Override public Sequence CircularArraySequence.tail()
[PATH1] if(backingArray[front]!=null)=T -> if(front == backingArray.length-1)=T -> return tempSequence
[PATH2] if(backingArray[front]!=null)=F -> return tempSequence
[PATH3] if(backingArray[front]!=null)=T -> if(front == backingArray.lengt... | /* static context
[FOCAL] @Override public Sequence CircularArraySequence.tail()
[PATH1] if(backingArray[front]!=null)=T -> if(front == backingArray.length-1)=T -> return tempSequence
[PATH2] if(backingArray[front]!=null)=F -> return tempSequence
[PATH3] if(backingArray[front]!=null)=T -> if(front == backingArray.lengt... | true | ok | {"focal": {"class": "CircularArraySequence", "name": "tail", "signature": "Sequence tail()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Sequence"}, "class_info": {"name": "CircularArraySequence", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Sequence", "fields... |
11036770_0 | class PermissiveURI {
public static URI create(String s)
{
return URI.create(s.replace(" ", "%20"));
}
}
class PermissiveURITest {
@Test
public void simple() throws Exception
{
|
URI i = PermissiveURI.create("file:/funk");
assertEquals("/funk", Paths.get(i).toString());
}
} | [FOCAL] public static URI PermissiveURI.create(String s)
[CLASS] class PermissiveURI
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] URI.create/1, String.replace/2
[INPUTS] branches=- | result=s
[DATAFLOW] s@param->L4
[TEST] PermissiveURITest: @Test public void simple() throws Exce... | /* static context
[FOCAL] public static URI PermissiveURI.create(String s)
[INPUTS] branches=- | result=s
[CALLS-EXTERNAL] URI.create/1, String.replace/2
*/
| /* static context
[FOCAL] public static URI PermissiveURI.create(String s)
[INPUTS] branches=- | result=s
[CALLS-EXTERNAL] URI.create/1, String.replace/2
*/
class PermissiveURI {
public static URI create(String s)
{
return URI.create(s.replace(" ", "%20"));
}
}
class PermissiveURITest {
@Te... | true | ok | {"focal": {"class": "PermissiveURI", "name": "create", "signature": "URI create(String s)", "start_line": 3, "modifiers": "public static", "params": [{"name": "s", "type": "String"}], "return_type": "URI"}, "class_info": {"name": "PermissiveURI", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null,... |
11125589_88 | class SpringSecurityTokenStore implements AdapterTokenStore {
@Override
public void saveAccountInfo(OidcKeycloakAccount account) {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if (authentication != null) {
throw new IllegalStateException(... | OidcKeycloakAccount account = new SimpleKeycloakAccount(principal, Collections.singleton("FOO"), keycloakSecurityContext);
Authentication authentication;
store.saveAccountInfo(account);
authentication = SecurityContextHolder.getContext().getAuthentication();
assertNotNull(authe... | [FOCAL] @Override public void SpringSecurityTokenStore.saveAccountInfo(OidcKeycloakAccount account)
[CLASS] class SpringSecurityTokenStore implements AdapterTokenStore
[METRICS] loc=14 cc=2 branches=1 loops=0 returns=0 throws=1 nesting=1
[CALLS-EXTERNAL] SecurityContextHolder.getContext().getAuthentication/0, SecurityC... | /* static context
[FOCAL] @Override public void SpringSecurityTokenStore.saveAccountInfo(OidcKeycloakAccount account)
[THROWS-WHEN] IllegalStateException when authentication != null
[PATH1] if(authentication != null)=T -> throw new IllegalStateException(String.format("Went to save Keycloak acco...
[PATH2] if(authentica... | /* static context
[FOCAL] @Override public void SpringSecurityTokenStore.saveAccountInfo(OidcKeycloakAccount account)
[THROWS-WHEN] IllegalStateException when authentication != null
[PATH1] if(authentication != null)=T -> throw new IllegalStateException(String.format("Went to save Keycloak acco...
[PATH2] if(authentica... | true | ok | {"focal": {"class": "SpringSecurityTokenStore", "name": "saveAccountInfo", "signature": "void saveAccountInfo(OidcKeycloakAccount account)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "account", "type": "OidcKeycloakAccount"}], "return_type": "void"}, "class_info": {"name": "SpringSecurityTok... |
11128472_1 | class Invoice extends UdoDomainObject2<T> implements WithApplicationTenancyAny, WithApplicationTenancyPathPersisted {
@Programmatic
public InvoiceItem findFirstItemWithCharge(final Charge charge) {
for (InvoiceItem item : getItems()) {
if (item.getCharge().equals(charge)) {
... |
// given
InvoiceForTesting invoice = new InvoiceForTesting();
Charge charge1 = new Charge();
Charge charge2 = new Charge();
InvoiceItem itemWithCharge1 = new InvoiceItemForTesting(invoice);
itemWithCharge1.setCharge(charge1);
itemWithCharge1.setSequence(VT.bi(1))... | [FOCAL] @Programmatic public InvoiceItem Invoice.findFirstItemWithCharge(Charge charge)
[CLASS] class Invoice extends UdoDomainObject2<T> implements WithApplicationTenancyAny, WithApplicationTenancyPathPersisted
[METRICS] loc=9 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] getItems/0 (inherited)... | /* static context
[FOCAL] @Programmatic public InvoiceItem Invoice.findFirstItemWithCharge(Charge charge)
[PATH1] foreach(InvoiceItem item : getItems())=T -> if(item.getCharge().equals(charge))=F -> exit loop -> return null
[PATH2] foreach(InvoiceItem item : getItems())=T -> if(item.getCharge().equals(charge))=T -> ret... | /* static context
[FOCAL] @Programmatic public InvoiceItem Invoice.findFirstItemWithCharge(Charge charge)
[PATH1] foreach(InvoiceItem item : getItems())=T -> if(item.getCharge().equals(charge))=F -> exit loop -> return null
[PATH2] foreach(InvoiceItem item : getItems())=T -> if(item.getCharge().equals(charge))=T -> ret... | true | ok | {"focal": {"class": "Invoice", "name": "findFirstItemWithCharge", "signature": "InvoiceItem findFirstItemWithCharge(Charge charge)", "start_line": 3, "modifiers": "@Programmatic public", "params": [{"name": "charge", "type": "Charge"}], "return_type": "InvoiceItem"}, "class_info": {"name": "Invoice", "kind": "class", "... |
11140459_23 | class ParcelableAnalysis {
public ParcelableDescriptor analyze(ASTType astType) {
ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class);
return analyze(astType, parcelASTAnnotation);
}
@Inject public ParcelableAnalysis(Validator validator, Provider<Generators> generat... |
ParcelableDescriptor analysis = analyze(ConstructorConverterSerialization.class);
ASTParameter parameter = analysis.getConstructorPair().getConstructor().getParameters().get(0);
Map<ASTParameter,ASTType> converters = analysis.getConstructorPair().getConverters();
assertFalse(messager.... | [FOCAL] public ParcelableDescriptor ParcelableAnalysis.analyze(ASTType astType)
[CLASS] class ParcelableAnalysis
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] ParcelableDescriptor analyze(ASTType astType, ASTAnnotation parcelASTAnnotation)
[CALLS-EXTERNAL] ASTType.getASTAnnotatio... | /* static context
[FOCAL] public ParcelableDescriptor ParcelableAnalysis.analyze(ASTType astType)
[INPUTS] branches=- | result=astType
[COLLABORATORS] param astType:ASTType getASTAnnotation/1
[CALLS-INTERNAL] ParcelableDescriptor analyze(ASTType astType, ASTAnnotation parcelASTAnnotation)
[CALLS-EXTERNAL] ASTType.getAS... | /* static context
[FOCAL] public ParcelableDescriptor ParcelableAnalysis.analyze(ASTType astType)
[INPUTS] branches=- | result=astType
[COLLABORATORS] param astType:ASTType getASTAnnotation/1
[CALLS-INTERNAL] ParcelableDescriptor analyze(ASTType astType, ASTAnnotation parcelASTAnnotation)
[CALLS-EXTERNAL] ASTType.getAS... | true | ok | {"focal": {"class": "ParcelableAnalysis", "name": "analyze", "signature": "ParcelableDescriptor analyze(ASTType astType)", "start_line": 3, "modifiers": "public", "params": [{"name": "astType", "type": "ASTType"}], "return_type": "ParcelableDescriptor"}, "class_info": {"name": "ParcelableAnalysis", "kind": "class", "mo... |
11144122_0 | class Hello {
public String say() {
return hello;
}
public Hello(String s);
protected int notCalled();
}
class HelloTest {
@Test
public void shouldSayHello() throws InterruptedException {
| assertEquals("hi", new Hello("hi").say());
Thread.sleep(1000); // This guarantees that execution time of test will not be too close to zero
}
} | [FOCAL] public String Hello.say()
[CLASS] class Hello
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] Hello(String s); int notCalled()
[TEST] HelloTest: @Test public void shouldSayHello() throws InterruptedException | /* static context
[FOCAL] public String Hello.say()
*/
| /* static context
[FOCAL] public String Hello.say()
*/
class Hello {
public String say() {
return hello;
}
public Hello(String s);
protected int notCalled();
}
class HelloTest {
@Test
public void shouldSayHello() throws InterruptedException {
| true | ok | {"focal": {"class": "Hello", "name": "say", "signature": "String say()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "Hello", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Hello", "kind": "construc... |
11161563_1 | class BooleanConverter extends DefaultObjectConverter<Boolean> {
@Override
public Boolean fromString(String string, ConverterContext context) {
if (string.equalsIgnoreCase(getTrue())) {
return Boolean.TRUE;
}
else if (string.equalsIgnoreCase("true")) { // in case the applica... | Assert.assertEquals(Boolean.TRUE, _converter.fromString("true")); //NON-NLS
Assert.assertEquals(Boolean.TRUE, _converter.fromString("True")); //NON-NLS
Assert.assertEquals(Boolean.FALSE, _converter.fromString("false")); //NON-NLS
Assert.assertEquals(Boolean.FALSE, _converter.fromString(... | [FOCAL] @Override public Boolean BooleanConverter.fromString(String string, ConverterContext context)
[CLASS] class BooleanConverter extends DefaultObjectConverter<Boolean>
[METRICS] loc=18 cc=5 branches=4 loops=0 returns=5 throws=0 nesting=4
[CALLS-INTERNAL] String getFalse(); String getTrue()
[CALLS-EXTERNAL] String.... | /* static context
[FOCAL] @Override public Boolean BooleanConverter.fromString(String string, ConverterContext context)
[PATH1] if(string.equalsIgnoreCase(getTrue()))=F -> if(string.equalsIgnoreCase("true"))=F -> if(string.equalsIgnoreCase(getFalse()))=F -> if(string.equalsIgnoreCase("false"))=T -> return Boolean.FALSE... | /* static context
[FOCAL] @Override public Boolean BooleanConverter.fromString(String string, ConverterContext context)
[PATH1] if(string.equalsIgnoreCase(getTrue()))=F -> if(string.equalsIgnoreCase("true"))=F -> if(string.equalsIgnoreCase(getFalse()))=F -> if(string.equalsIgnoreCase("false"))=T -> return Boolean.FALSE... | true | ok | {"focal": {"class": "BooleanConverter", "name": "fromString", "signature": "Boolean fromString(String string, ConverterContext context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "string", "type": "String"}, {"name": "context", "type": "ConverterContext"}], "return_type": "Boolean"}, "class... |
11178914_16 | class LinkedRow extends Row {
public void removeIdAndRevision() {
remove(table.getPrimaryKeyColumn().get());
if (table.getRevisionColumn().isPresent()) {
remove(table.getRevisionColumn().get().getColumnName());
}
}
public Table getTable();
void setTable(Table table... | createTable("CREATE TABLE table1 (id INTEGER PRIMARY KEY, age INT, revision INT DEFAULT 0)");
Table table1 = lSql.table("table1");
table1.enableRevisionSupport();
LinkedRow row = table1.newLinkedRow(
"id", 1,
"age", 1,
"revision", 1
... | [FOCAL] public void LinkedRow.removeIdAndRevision()
[CLASS] class LinkedRow extends Row
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] remove/1 (inherited), table.getPrimaryKeyColumn().get/0, table.getPrimaryKeyColumn/0, table.getRevisionColumn().isPresent/0, table.getRevisionColu... | /* static context
[FOCAL] public void LinkedRow.removeIdAndRevision()
[PATH1] if(table.getRevisionColumn().isPresent())=T
[PATH2] if(table.getRevisionColumn().isPresent())=F
[COLLABORATORS] field table getPrimaryKeyColumn/0,getRevisionColumn/0
[CALLS-EXTERNAL] remove/1 (inherited), table.getPrimaryKeyColumn().get/0, ta... | /* static context
[FOCAL] public void LinkedRow.removeIdAndRevision()
[PATH1] if(table.getRevisionColumn().isPresent())=T
[PATH2] if(table.getRevisionColumn().isPresent())=F
[COLLABORATORS] field table getPrimaryKeyColumn/0,getRevisionColumn/0
[CALLS-EXTERNAL] remove/1 (inherited), table.getPrimaryKeyColumn().get/0, ta... | true | ok | {"focal": {"class": "LinkedRow", "name": "removeIdAndRevision", "signature": "void removeIdAndRevision()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "LinkedRow", "kind": "class", "modifiers": "", "superclass": "Row", "interfaces": null, "fields": [], "members":... |
11194069_0 | class Hook {
boolean isValid() {
try {
new URL(this.uri);
} catch (MalformedURLException ex) {
return false;
}
return this.command != null;
}
public Hook(String uri, FtpEventName command);
public Hook();
public long getId();
public Str... | Hook cut = new Hook("http://localhost", FtpEventName.EVERYTHING);
assertTrue(cut.isValid());
}
} | [FOCAL] boolean Hook.isValid()
[CLASS] class Hook
[METRICS] loc=8 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1
[NEW] URL
[FIELDS] read=command, uri
[EXCEPTIONS] catches MalformedURLException ex
[PATH1] try-body throws -> return false
[PATH2] return this.command != null
[CLASS-MEMBERS] Hook(String uri, FtpEventN... | /* static context
[FOCAL] boolean Hook.isValid()
[PATH1] try-body throws -> return false
[PATH2] return this.command != null
[EXCEPTIONS] catches MalformedURLException ex
[FIELDS] read=command, uri
[NEW] URL
*/
| /* static context
[FOCAL] boolean Hook.isValid()
[PATH1] try-body throws -> return false
[PATH2] return this.command != null
[EXCEPTIONS] catches MalformedURLException ex
[FIELDS] read=command, uri
[NEW] URL
*/
class Hook {
boolean isValid() {
try {
new URL(this.uri);
} catch (Malformed... | true | ok | {"focal": {"class": "Hook", "name": "isValid", "signature": "boolean isValid()", "start_line": 3, "modifiers": "", "params": [], "return_type": "boolean"}, "class_info": {"name": "Hook", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Hook", "kind": "constru... |
11198387_9 | class ThreadScope extends BaseScope {
@Override
public <T> Provider<T> scope(final Key<T> key, final Provider<T> unscoped) {
return new Provider<T>() {
@Override
public T get() {
Map<Key<?>, Object> map = getScopeMapForCurrentThread();
checkState(map != null, "No scope map found for the current threa... | ThreadScope scope = new ThreadScope();
Provider<String> prov = scope.scope(Key.get(String.class), new Provider<String>() {
@Override
public String get() {
return "dummy";
}
@Override
public String toString() {
return get();
}
});
Assert.assertEquals(prov.toString(), "dummy[ThreadScope... | [FOCAL] @Override public Provider<T> ThreadScope.scope(Key<T> key, Provider<T> unscoped)
[CLASS] class ThreadScope extends BaseScope
[METRICS] loc=16 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Map<Key<?>, Object> getScopeMapForCurrentThread()
[CALLS-EXTERNAL] checkState/2 (inherited), getScop... | /* static context
[FOCAL] @Override public Provider<T> ThreadScope.scope(Key<T> key, Provider<T> unscoped)
[INPUTS] branches=- | result=key, unscoped
[CALLS-INTERNAL] Map<Key<?>, Object> getScopeMapForCurrentThread()
[NEW] Provider<T>
[CALLS-EXTERNAL] checkState/2 (inherited), getScopedObject/3 (inherited), String.form... | /* static context
[FOCAL] @Override public Provider<T> ThreadScope.scope(Key<T> key, Provider<T> unscoped)
[INPUTS] branches=- | result=key, unscoped
[CALLS-INTERNAL] Map<Key<?>, Object> getScopeMapForCurrentThread()
[NEW] Provider<T>
[CALLS-EXTERNAL] checkState/2 (inherited), getScopedObject/3 (inherited), String.form... | true | ok | {"focal": {"class": "ThreadScope", "name": "scope", "signature": "Provider<T> scope(Key<T> key, Provider<T> unscoped)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "key", "type": "Key<T>"}, {"name": "unscoped", "type": "Provider<T>"}], "return_type": "Provider<T>"}, "class_info": {"name": "Thr... |
11206901_5 | class WmsMapElementHtmlHandler implements GenericElementHtmlHandler {
@Override
public String getHtmlFragment(JRHtmlExporterContext context,
JRGenericPrintElement element) {
Map<String, Object> contextMap = new HashMap<String, Object>();
contextMap.put("mapCanvasId", "map_canvas_" + element.hashCode... | JRGenericPrintElement element = mock(JRGenericPrintElement.class);
when(element.getParameterNames()).thenReturn(parameters.keySet());
when(element.getParameterValue(WmsRequestParameter.WMS_URL.name()))
.thenReturn(BASE_URL);
when(element.getParameterValue(WmsRequestParameter.LAYERS.name()))
... | [FOCAL] @Override public String WmsMapElementHtmlHandler.getHtmlFragment(JRHtmlExporterContext context, JRGenericPrintElement element)
[CLASS] class WmsMapElementHtmlHandler implements GenericElementHtmlHandler
[METRICS] loc=35 cc=4 branches=2 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] Map<String, Object>.pu... | /* static context
[FOCAL] @Override public String WmsMapElementHtmlHandler.getHtmlFragment(JRHtmlExporterContext context, JRGenericPrintElement element)
[THROWS-WHEN] RuntimeException when context.getExporter() instanceof JRXhtmlExporter && element.getModeValue() == ModeEnum.OPAQUE && try-body throws
[THROWS-WHEN] Runt... | /* static context
[FOCAL] @Override public String WmsMapElementHtmlHandler.getHtmlFragment(JRHtmlExporterContext context, JRGenericPrintElement element)
[THROWS-WHEN] RuntimeException when context.getExporter() instanceof JRXhtmlExporter && element.getModeValue() == ModeEnum.OPAQUE && try-body throws
[THROWS-WHEN] Runt... | true | ok | {"focal": {"class": "WmsMapElementHtmlHandler", "name": "getHtmlFragment", "signature": "String getHtmlFragment(JRHtmlExporterContext context, JRGenericPrintElement element)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "context", "type": "JRHtmlExporterContext"}, {"name": "element", "type": "... |
11217397_26 | class BuildMonitorDescriptor extends ViewDescriptor {
public FormValidation doCheckIncludeRegex(@QueryParameter String value) {
String v = Util.fixEmpty(value);
if (v != null) {
try {
Pattern.compile(v);
} catch (PatternSyntaxException pse) {
... | FormValidation result = validator.doCheckIncludeRegex(")");
assertThat(result.kind, is(ERROR));
assertThat(htmlDecoded(result.getMessage()), containsString("Unmatched closing ')'"));
}
} | [FOCAL] public FormValidation BuildMonitorDescriptor.doCheckIncludeRegex(String value)
[CLASS] class BuildMonitorDescriptor extends ViewDescriptor
[METRICS] loc=11 cc=3 branches=1 loops=0 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] Util.fixEmpty/1, Pattern.compile/1, FormValidation.error/1, PatternSyntaxException.get... | /* static context
[FOCAL] public FormValidation BuildMonitorDescriptor.doCheckIncludeRegex(String value)
[PATH1] if(v != null)=T -> try-body throws -> return FormValidation.error(pse.getMessage())
[PATH2] if(v != null)=F -> return FormValidation.ok()
[INPUTS] branches=value | result=-
[EXCEPTIONS] catches PatternSyntax... | /* static context
[FOCAL] public FormValidation BuildMonitorDescriptor.doCheckIncludeRegex(String value)
[PATH1] if(v != null)=T -> try-body throws -> return FormValidation.error(pse.getMessage())
[PATH2] if(v != null)=F -> return FormValidation.ok()
[INPUTS] branches=value | result=-
[EXCEPTIONS] catches PatternSyntax... | true | ok | {"focal": {"class": "BuildMonitorDescriptor", "name": "doCheckIncludeRegex", "signature": "FormValidation doCheckIncludeRegex(String value)", "start_line": 3, "modifiers": "public", "params": [{"name": "value", "type": "String"}], "return_type": "FormValidation"}, "class_info": {"name": "BuildMonitorDescriptor", "kind"... |
11219096_12 | class CardDeck extends CardList {
@Override
public boolean add(final Card card) {
if (size() == MAX_CARDS) {
throw new IllegalStateException("Card deck is already filled with "
+ MAX_CARDS + " cards.");
}
if (contains(card)) {
throw new IllegalArgumentException("Card " + card
+ " is already co... | assertThrows(IllegalStateException.class, () -> {
final CardDeck cards = new CardDeck(
"CJ SJ HJ CK CQ SK C7 C8 S7 H7 D7 DJ CA CT C9 SQ HA HK HQ S8 H8 H9 HT SA ST S9 D8 D9 DT DA DK DQ");
cards.add(Card.CJ);
});
}
} | [FOCAL] @Override public boolean CardDeck.add(Card card)
[CLASS] class CardDeck extends CardList
[METRICS] loc=14 cc=3 branches=2 loops=0 returns=1 throws=2 nesting=1
[CALLS-EXTERNAL] size/0 (inherited), contains/1 (inherited), CardList.add/1
[NEW] IllegalStateException, IllegalArgumentException
[EXCEPTIONS] throws Ill... | /* static context
[FOCAL] @Override public boolean CardDeck.add(Card card)
[THROWS-WHEN] IllegalStateException when size() == MAX_CARDS
[THROWS-WHEN] IllegalArgumentException when !(size() == MAX_CARDS) && contains(card)
[PATH1] if(size() == MAX_CARDS)=F -> if(contains(card))=T -> throw new IllegalArgumentException("Ca... | /* static context
[FOCAL] @Override public boolean CardDeck.add(Card card)
[THROWS-WHEN] IllegalStateException when size() == MAX_CARDS
[THROWS-WHEN] IllegalArgumentException when !(size() == MAX_CARDS) && contains(card)
[PATH1] if(size() == MAX_CARDS)=F -> if(contains(card))=T -> throw new IllegalArgumentException("Ca... | true | ok | {"focal": {"class": "CardDeck", "name": "add", "signature": "boolean add(Card card)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "card", "type": "Card"}], "return_type": "boolean"}, "class_info": {"name": "CardDeck", "kind": "class", "modifiers": "", "superclass": "CardList", "interfaces": nu... |
11226198_7 | class UncheckedFuture implements Future<V> {
public V getUnchecked() {
try {
return get();
} catch (Throwable pokemon) {
Util.pokeball(pokemon);
}
return null;
}
public UncheckedFuture(Future<V> future);
@Override public boolean cancel(boolean b);
@Override public boolean isCan... | final Object obj = new Object();
final Future<Object> theFutureNow = new TheFutureNow(obj);
Assert.assertEquals(obj, new UncheckedFuture(theFutureNow).getUnchecked());
}
} | [FOCAL] public V UncheckedFuture.getUnchecked()
[CLASS] class UncheckedFuture implements Future<V>
[METRICS] loc=8 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] V get()
[CALLS-EXTERNAL] Util.pokeball/1
[EXCEPTIONS] catches Throwable pokemon
[PATH1] try-body throws -> return null
[PATH2] return g... | /* static context
[FOCAL] public V UncheckedFuture.getUnchecked()
[PATH1] try-body throws -> return null
[PATH2] return get()
[EXCEPTIONS] catches Throwable pokemon
[CALLS-INTERNAL] V get()
[CALLS-EXTERNAL] Util.pokeball/1
*/
| /* static context
[FOCAL] public V UncheckedFuture.getUnchecked()
[PATH1] try-body throws -> return null
[PATH2] return get()
[EXCEPTIONS] catches Throwable pokemon
[CALLS-INTERNAL] V get()
[CALLS-EXTERNAL] Util.pokeball/1
*/
class UncheckedFuture implements Future<V> {
public V getUnchecked() {
try {
retu... | true | ok | {"focal": {"class": "UncheckedFuture", "name": "getUnchecked", "signature": "V getUnchecked()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "V"}, "class_info": {"name": "UncheckedFuture", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Future<V>", "fields": [], "members": [... |
11233417_148 | class SVTandemDuplicationAnnotationBuilder extends SVAnnotationBuilder {
@Override
public SVAnnotation build() {
final GenomeInterval changeInterval = svTandemDup.getGenomeInterval();
// Go over the different cases from most to least pathogenic step and return most pathogenic one.
if (changeInterval.overlaps... | final SVTandemDuplication svDup = new SVTandemDuplication(
new GenomePosition(jvData.getRefDict(), Strand.FWD, oma1.getChr(), 58968128),
new GenomePosition(jvData.getRefDict(), Strand.FWD, oma1.getChr(), 58994820),
0, 0, 0, 0
);
final SVAnnotation anno = new SVTandemDuplicationAnnotationBuilder(oma1, svD... | [FOCAL] @Override public SVAnnotation SVTandemDuplicationAnnotationBuilder.build()
[CLASS] class SVTandemDuplicationAnnotationBuilder extends SVAnnotationBuilder
[METRICS] loc=25 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=3
[CALLS-INTERNAL] ImmutableSet<VariantEffect> buildEffectSet(Collection<VariantEffect> ef... | /* static context
[FOCAL] @Override public SVAnnotation SVTandemDuplicationAnnotationBuilder.build()
[PATH1] if(changeInterval.overlapsWith(transcript.getTXRegion()))=F -> if(so.overlapsWithUpstreamRegion(changeInterval))=F -> if(so.overlapsWithDownstreamRegion(changeInterval))=T -> return new SVAnnotation(svTandemDup,... | /* static context
[FOCAL] @Override public SVAnnotation SVTandemDuplicationAnnotationBuilder.build()
[PATH1] if(changeInterval.overlapsWith(transcript.getTXRegion()))=F -> if(so.overlapsWithUpstreamRegion(changeInterval))=F -> if(so.overlapsWithDownstreamRegion(changeInterval))=T -> return new SVAnnotation(svTandemDup,... | true | ok | {"focal": {"class": "SVTandemDuplicationAnnotationBuilder", "name": "build", "signature": "SVAnnotation build()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "SVAnnotation"}, "class_info": {"name": "SVTandemDuplicationAnnotationBuilder", "kind": "class", "modifiers": "", "superclass":... |
11254311_793 | class TransferFsImage {
static MD5Hash getFileClient(String nnHostPort,
String queryString, List<File> localPaths,
Storage dstStorage, boolean getChecksum) throws IOException {
String str = HttpConfig.getSchemePrefix() + nnHostPort + "/getimage?" +
queryString;
LOG.info("Opening connecti... | Configuration conf = new HdfsConfiguration();
MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf)
.numDataNodes(0).build();
NNStorage mockStorage = Mockito.mock(NNStorage.class);
List<File> localPath = Collections.<File>singletonList(
new File("/xxxxx-does-not-exist/blah"));
... | [FOCAL] static MD5Hash TransferFsImage.getFileClient(String nnHostPort, String queryString, List<File> localPaths, Storage dstStorage, boolean getChecksum)
[CLASS] class TransferFsImage
[METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] MD5Hash doGetUrl(URL url, List<File> localPaths... | /* static context
[FOCAL] static MD5Hash TransferFsImage.getFileClient(String nnHostPort, String queryString, List<File> localPaths, Storage dstStorage, boolean getChecksum)
[INPUTS] branches=- | result=dstStorage, getChecksum, localPaths, nnHostPort, queryString
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] MD5Ha... | /* static context
[FOCAL] static MD5Hash TransferFsImage.getFileClient(String nnHostPort, String queryString, List<File> localPaths, Storage dstStorage, boolean getChecksum)
[INPUTS] branches=- | result=dstStorage, getChecksum, localPaths, nnHostPort, queryString
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] MD5Ha... | true | ok | {"focal": {"class": "TransferFsImage", "name": "getFileClient", "signature": "MD5Hash getFileClient(String nnHostPort, String queryString, List<File> localPaths, Storage dstStorage, boolean getChecksum) throws IOException", "start_line": 3, "modifiers": "static", "params": [{"name": "nnHostPort", "type": "String"}, {"n... |
11267509_1 | class GlideFutures {
public static <T> ListenableFuture<T> submit(final RequestBuilder<T> requestBuilder) {
return transformFromTargetAndResult(submitInternal(requestBuilder));
}
private GlideFutures();
public static ListenableFuture<Void> submitAndExecute(
final RequestManager requestManager,
... | // Load some unsupported model.
final ListenableFuture<Bitmap> future =
GlideFutures.submit(Glide.with(app).asBitmap().load(app));
// Make sure that it throws.
assertThrows(
ExecutionException.class,
new ThrowingRunnable() {
@Override
public void run() throws ... | [FOCAL] public static ListenableFuture<T> GlideFutures.submit(RequestBuilder<T> requestBuilder)
[CLASS] class GlideFutures
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] ListenableFuture<T> transformFromTargetAndResult(ListenableFuture<TargetAndResult<T>> future); ListenableFuture... | /* static context
[FOCAL] public static ListenableFuture<T> GlideFutures.submit(RequestBuilder<T> requestBuilder)
[INPUTS] branches=- | result=requestBuilder
[CALLS-INTERNAL] ListenableFuture<T> transformFromTargetAndResult(ListenableFuture<TargetAndResult<T>> future); ListenableFuture<TargetAndResult<T>> submitInterna... | /* static context
[FOCAL] public static ListenableFuture<T> GlideFutures.submit(RequestBuilder<T> requestBuilder)
[INPUTS] branches=- | result=requestBuilder
[CALLS-INTERNAL] ListenableFuture<T> transformFromTargetAndResult(ListenableFuture<TargetAndResult<T>> future); ListenableFuture<TargetAndResult<T>> submitInterna... | true | ok | {"focal": {"class": "GlideFutures", "name": "submit", "signature": "ListenableFuture<T> submit(RequestBuilder<T> requestBuilder)", "start_line": 3, "modifiers": "public static", "params": [{"name": "requestBuilder", "type": "RequestBuilder<T>"}], "return_type": "ListenableFuture<T>"}, "class_info": {"name": "GlideFutur... |
11275102_1 | class Utils {
public static long computeArraySUID(String name) {
ByteArrayOutputStream bout = new ByteArrayOutputStream();
DataOutputStream dout = new DataOutputStream(bout);
try {
dout.writeUTF(name);
dout.writeInt(Modifier.PUBLIC | Modifier.FINAL | Modifier.ABSTRAC... | Class<?> clazz = String[][].class;
assertEquals(ObjectStreamClass.lookup(clazz).getSerialVersionUID(), Utils.computeArraySUID(clazz.getName()));
}
} | [FOCAL] public static long Utils.computeArraySUID(String name)
[CLASS] class Utils
[METRICS] loc=23 cc=4 branches=0 loops=1 returns=1 throws=2 nesting=1
[CALLS-EXTERNAL] DataOutputStream.writeUTF/1, DataOutputStream.writeInt/1, DataOutputStream.flush/0, MessageDigest.getInstance/1, MessageDigest.digest/1, ByteArrayOutp... | /* static context
[FOCAL] public static long Utils.computeArraySUID(String name)
[THROWS-WHEN] Error when try-body throws
[PATH1] for(i >= 0)=T -> exit loop -> return hash
[PATH2] try-body throws -> throw new Error(ex)
[PATH3] for(i >= 0)=F -> return hash
[EXCEPTIONS] throws Error; catches IOException ex, NoSuchAlgorit... | /* static context
[FOCAL] public static long Utils.computeArraySUID(String name)
[THROWS-WHEN] Error when try-body throws
[PATH1] for(i >= 0)=T -> exit loop -> return hash
[PATH2] try-body throws -> throw new Error(ex)
[PATH3] for(i >= 0)=F -> return hash
[EXCEPTIONS] throws Error; catches IOException ex, NoSuchAlgorit... | true | ok | {"focal": {"class": "Utils", "name": "computeArraySUID", "signature": "long computeArraySUID(String name)", "start_line": 3, "modifiers": "public static", "params": [{"name": "name", "type": "String"}], "return_type": "long"}, "class_info": {"name": "Utils", "kind": "class", "modifiers": "", "superclass": null, "interf... |
11286308_6 | class PTFinancialValidator extends FinancialValidator {
@Override
public boolean isValid() {
// Must have exactly 9 numeric digits
if (this.financialID.length() != 9 || !this.financialID.matches("\\d+")) {
return false;
}
List<Character> firstDigits = Lists.characte... | PTFinancialValidator validator = new PTFinancialValidator("241250609");
assertTrue(validator.isValid());
}
} | [FOCAL] @Override public boolean PTFinancialValidator.isValid()
[CLASS] class PTFinancialValidator extends FinancialValidator
[METRICS] loc=48 cc=6 branches=4 loops=1 returns=4 throws=0 nesting=1
[CALLS-EXTERNAL] this.financialID.length/0, this.financialID.matches/1, Lists.charactersOf/1, firstDigits .stream() .map(c -... | /* static context
[FOCAL] @Override public boolean PTFinancialValidator.isValid()
[PATH1] if(this.financialID.length() != 9 || !this.financialID.matches("\\d+"))=F -> if(!validFirstDigit && !validDoubleDigits)=F -> for(i < this.financialID.length())=T -> exit loop -> if(checkSum == 0 || checkSum == 1)=T -> if(checkSum ... | /* static context
[FOCAL] @Override public boolean PTFinancialValidator.isValid()
[PATH1] if(this.financialID.length() != 9 || !this.financialID.matches("\\d+"))=F -> if(!validFirstDigit && !validDoubleDigits)=F -> for(i < this.financialID.length())=T -> exit loop -> if(checkSum == 0 || checkSum == 1)=T -> if(checkSum ... | true | ok | {"focal": {"class": "PTFinancialValidator", "name": "isValid", "signature": "boolean isValid()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "boolean"}, "class_info": {"name": "PTFinancialValidator", "kind": "class", "modifiers": "", "superclass": "FinancialValidator", "interfaces": n... |
11290309_30 | class RackInput implements Closeable {
public byte[] read(Integer length) throws IOException {
if (length == null) {
return readToEof();
} else {
return readTo(length);
}
}
public RackInput(InputStream inputStream);
public byte[] gets();
public void rewind();
@Override public voi... | assertThat(full.read(0)).isEqualTo(EMPTY_BYTES);
}
} | [FOCAL] public byte[] RackInput.read(Integer length)
[CLASS] class RackInput implements Closeable
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] byte[] readTo(int length); byte[] readToEof()
[EXCEPTIONS] declares IOException
[PATH1] if(length == null)=T -> return readToEof()
[PATH... | /* static context
[FOCAL] public byte[] RackInput.read(Integer length)
[PATH1] if(length == null)=T -> return readToEof()
[PATH2] if(length == null)=F -> return readTo(length)
[INPUTS] branches=length | result=length
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] byte[] readTo(int length); byte[] readToEof()
*/
| /* static context
[FOCAL] public byte[] RackInput.read(Integer length)
[PATH1] if(length == null)=T -> return readToEof()
[PATH2] if(length == null)=F -> return readTo(length)
[INPUTS] branches=length | result=length
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] byte[] readTo(int length); byte[] readToEof()
*/
cla... | true | ok | {"focal": {"class": "RackInput", "name": "read", "signature": "byte[] read(Integer length) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "length", "type": "Integer"}], "return_type": "byte[]"}, "class_info": {"name": "RackInput", "kind": "class", "modifiers": "", "superclass": null, "... |
11304836_0 | class CacheLoaderAdapter implements CacheLoader<K, V>, Factory<CacheLoader<K, V>> {
@Override
public Map<K, V> loadAll(final Iterable<? extends K> keys) throws CacheLoaderException
{
final Map<K, V> result = new HashMap<K, V>();
for (final K k : keys)
{
final V v = load(... | assertFalse(cache.iterator().hasNext());
assertEquals("foo", cache.get("foo"));
count.decrementAndGet();
cache.loadAll(new HashSet<String>(asList("a", "b")), true, null);
int retries = 100;
while (retries-- > 0 && count.get() != 2)
{
try
{... | [FOCAL] @Override public Map<K, V> CacheLoaderAdapter.loadAll(Iterable<? extends K> keys)
[CLASS] class CacheLoaderAdapter implements CacheLoader<K, V>, Factory<CacheLoader<K, V>>
[METRICS] loc=14 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] load/1 (inherited), Map<K, V>.put/2
[NEW] HashMap<K, ... | /* static context
[FOCAL] @Override public Map<K, V> CacheLoaderAdapter.loadAll(Iterable<? extends K> keys)
[PATH1] foreach(K k : keys)=T -> if(v != null)=T -> exit loop -> return result
[PATH2] foreach(K k : keys)=F -> return result
[PATH3] foreach(K k : keys)=T -> if(v != null)=F -> exit loop -> return result
[INPUTS... | /* static context
[FOCAL] @Override public Map<K, V> CacheLoaderAdapter.loadAll(Iterable<? extends K> keys)
[PATH1] foreach(K k : keys)=T -> if(v != null)=T -> exit loop -> return result
[PATH2] foreach(K k : keys)=F -> return result
[PATH3] foreach(K k : keys)=T -> if(v != null)=F -> exit loop -> return result
[INPUTS... | true | ok | {"focal": {"class": "CacheLoaderAdapter", "name": "loadAll", "signature": "Map<K, V> loadAll(Iterable<? extends K> keys) throws CacheLoaderException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "keys", "type": "Iterable<? extends K>"}], "return_type": "Map<K, V>"}, "class_info": {"name": "Cac... |
11304845_34 | class MethodSignature implements Serializable {
@Override
public boolean equals(Object o)
{
if (o == null)
{
return false;
}
if (o == this)
{
return true;
}
if (o.getClass() != getClass())
{
return false;
... | final MethodSignature sig = new MethodSignature(Echo.class.getMethod("echoBack", String.class));
assertTrue(sig.equals(sig));
assertFalse(sig.equals("echoBack"));
assertEquals(sig, new MethodSignature(Echo.class.getMethod("echoBack", String.class)));
assertEquals(sig, new MethodS... | [FOCAL] @Override public boolean MethodSignature.equals(Object o)
[CLASS] class MethodSignature implements Serializable
[METRICS] loc=18 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=1
[CALLS-EXTERNAL] Object.getClass/0, getClass/0 (inherited), other.internal.equals/1
[PATH1] if(o == null)=F -> if(o == this)=F -> ... | /* static context
[FOCAL] @Override public boolean MethodSignature.equals(Object o)
[PATH1] if(o == null)=F -> if(o == this)=F -> if(o.getClass() != getClass())=T -> return false
[PATH2] if(o == null)=F -> if(o == this)=T -> return true
[PATH3] if(o == null)=F -> if(o == this)=F -> if(o.getClass() != getClass())=F -> r... | /* static context
[FOCAL] @Override public boolean MethodSignature.equals(Object o)
[PATH1] if(o == null)=F -> if(o == this)=F -> if(o.getClass() != getClass())=T -> return false
[PATH2] if(o == null)=F -> if(o == this)=T -> return true
[PATH3] if(o == null)=F -> if(o == this)=F -> if(o.getClass() != getClass())=F -> r... | true | ok | {"focal": {"class": "MethodSignature", "name": "equals", "signature": "boolean equals(Object o)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "o", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "MethodSignature", "kind": "class", "modifiers": "", "superclass": null, "int... |
11309044_135 | class HMapKL implements MapKL<K>, Cloneable, Serializable {
@Override
public long dot(MapKL<K> m) {
long s = 0;
for (MapKL.Entry<K> e : m.entrySet()) {
K key = e.getKey();
if (this.containsKey(key)) {
s += this.get(key) * e.getValue();
}
}
return s;
}
@SuppressWarn... | HMapKL<String> m1 = new HMapKL<String>();
m1.put("1", 2L);
m1.put("2", 1L);
m1.put("3", 3L);
m1.put("" + Integer.MAX_VALUE, (long) Integer.MAX_VALUE);
HMapKL<String> m2 = new HMapKL<String>();
m2.put("1", 1L);
m2.put("2", 4L);
m2.put("4", 5L);
m2.put("" + Integer.MAX_VALUE, (l... | [FOCAL] @Override public long HMapKL.dot(MapKL<K> m)
[CLASS] class HMapKL implements MapKL<K>, Cloneable, Serializable
[METRICS] loc=14 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] boolean containsKey(K key); long get(K key)
[CALLS-EXTERNAL] MapKL<K>.entrySet/0, MapKL.Entry<K>.getKey/0, MapKL.E... | /* static context
[FOCAL] @Override public long HMapKL.dot(MapKL<K> m)
[PATH1] foreach(MapKL.Entry<K> e : m.entrySet())=T -> if(this.containsKey(key))=T -> exit loop -> return s
[PATH2] foreach(MapKL.Entry<K> e : m.entrySet())=F -> return s
[PATH3] foreach(MapKL.Entry<K> e : m.entrySet())=T -> if(this.containsKey(key))... | /* static context
[FOCAL] @Override public long HMapKL.dot(MapKL<K> m)
[PATH1] foreach(MapKL.Entry<K> e : m.entrySet())=T -> if(this.containsKey(key))=T -> exit loop -> return s
[PATH2] foreach(MapKL.Entry<K> e : m.entrySet())=F -> return s
[PATH3] foreach(MapKL.Entry<K> e : m.entrySet())=T -> if(this.containsKey(key))... | true | ok | {"focal": {"class": "HMapKL", "name": "dot", "signature": "long dot(MapKL<K> m)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "m", "type": "MapKL<K>"}], "return_type": "long"}, "class_info": {"name": "HMapKL", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "MapKL<K>, Clone... |
11324849_308 | class BasicEditDistance {
public static double getEditDistance(CharSequence s, CharSequence t) {
return getEditDistance(s, t, DEFAULT_OPERATIONS_WEIGHTS);
}
private BasicEditDistance();
public static double getEditDistance(CharSequence s,
CharSequence... | CharSequence s = "abc";
CharSequence t = "b";
assertEquals(2.0, getEditDistance(s, t), EPSILON);
assertEquals(2.0, getEditDistance(t, s), EPSILON);
}
} | [FOCAL] public static double BasicEditDistance.getEditDistance(CharSequence s, CharSequence t)
[CLASS] class BasicEditDistance
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] double getEditDistance(CharSequence s, CharSequence t, OperationsWeights operationsWeights)
[INPUTS] branch... | /* static context
[FOCAL] public static double BasicEditDistance.getEditDistance(CharSequence s, CharSequence t)
[INPUTS] branches=- | result=s, t
[CALLS-INTERNAL] double getEditDistance(CharSequence s, CharSequence t, OperationsWeights operationsWeights)
*/
| /* static context
[FOCAL] public static double BasicEditDistance.getEditDistance(CharSequence s, CharSequence t)
[INPUTS] branches=- | result=s, t
[CALLS-INTERNAL] double getEditDistance(CharSequence s, CharSequence t, OperationsWeights operationsWeights)
*/
class BasicEditDistance {
public static double getEditDi... | true | ok | {"focal": {"class": "BasicEditDistance", "name": "getEditDistance", "signature": "double getEditDistance(CharSequence s, CharSequence t)", "start_line": 3, "modifiers": "public static", "params": [{"name": "s", "type": "CharSequence"}, {"name": "t", "type": "CharSequence"}], "return_type": "double"}, "class_info": {"na... |
11337147_387 | class FinderFactory {
public Finder create(final Class<? extends ServerResource> clazz) {
final Finder finder = finders.get(clazz);
if (finder == null) {
throw new RuntimeException("Finder unimplemented for class " + clazz);
}
return finder;
}
public FinderFact... | final TimerEventTriggerResourceFinder timerEventTriggerResourceFinder = spy(new TimerEventTriggerResourceFinder());
doReturn(processAPI).when(timerEventTriggerResourceFinder).getProcessAPI(any(Request.class));
final ServerResource serverResource = timerEventTriggerResourceFinder.create(request, ... | [FOCAL] public Finder FinderFactory.create(Class<? extends ServerResource> clazz)
[CLASS] class FinderFactory
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] finders.get/1
[NEW] RuntimeException
[EXCEPTIONS] throws RuntimeException
[THROWS-WHEN] RuntimeException when finder == null... | /* static context
[FOCAL] public Finder FinderFactory.create(Class<? extends ServerResource> clazz)
[THROWS-WHEN] RuntimeException when finder == null
[PATH1] if(finder == null)=T -> throw new RuntimeException("Finder unimplemented for class " + clazz)
[PATH2] if(finder == null)=F -> return finder
[INPUTS] branches=cla... | /* static context
[FOCAL] public Finder FinderFactory.create(Class<? extends ServerResource> clazz)
[THROWS-WHEN] RuntimeException when finder == null
[PATH1] if(finder == null)=T -> throw new RuntimeException("Finder unimplemented for class " + clazz)
[PATH2] if(finder == null)=F -> return finder
[INPUTS] branches=cla... | true | ok | {"focal": {"class": "FinderFactory", "name": "create", "signature": "Finder create(Class<? extends ServerResource> clazz)", "start_line": 3, "modifiers": "public", "params": [{"name": "clazz", "type": "Class<? extends ServerResource>"}], "return_type": "Finder"}, "class_info": {"name": "FinderFactory", "kind": "class",... |
11367662_1 | class MapServiceLocator implements ServiceLocator {
@Override
public <T> T resolve(final Class<T> clazz) {
final Object component = resolve(clazz, true);
return clazz.cast(component);
}
MapServiceLocator();
MapServiceLocator(final Map<Class<?>, Object> initialComponents);
T resolveOrRegister(final Cla... | final Map<Class<?>, Object> initialComponents = new HashMap<Class<?>, Object>();
final ExecutorService executorService = Executors.newSingleThreadExecutor();
initialComponents.put(ExecutorService.class, executorService);
final Logger logger = LoggerFactory.getLogger("test-logger");
initialComponents.put(Logge... | [FOCAL] @Override public T MapServiceLocator.resolve(Class<T> clazz)
[CLASS] class MapServiceLocator implements ServiceLocator
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Object resolve(Class<?> clazz, boolean checkErrors)
[CALLS-EXTERNAL] Class<T>.cast/1
[INPUTS] branches=- | ... | /* static context
[FOCAL] @Override public T MapServiceLocator.resolve(Class<T> clazz)
[INPUTS] branches=- | result=clazz
[COLLABORATORS] param clazz:Class<T> cast/1
[CALLS-INTERNAL] Object resolve(Class<?> clazz, boolean checkErrors)
[CALLS-EXTERNAL] Class<T>.cast/1
*/
| /* static context
[FOCAL] @Override public T MapServiceLocator.resolve(Class<T> clazz)
[INPUTS] branches=- | result=clazz
[COLLABORATORS] param clazz:Class<T> cast/1
[CALLS-INTERNAL] Object resolve(Class<?> clazz, boolean checkErrors)
[CALLS-EXTERNAL] Class<T>.cast/1
*/
class MapServiceLocator implements ServiceLocator... | true | ok | {"focal": {"class": "MapServiceLocator", "name": "resolve", "signature": "T resolve(Class<T> clazz)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "clazz", "type": "Class<T>"}], "return_type": "T"}, "class_info": {"name": "MapServiceLocator", "kind": "class", "modifiers": "", "superclass": null... |
11384368_4 | class FileObjectUtils {
public static String getContentAsString(final FileObject file, final Charset charset) throws IOException {
try (final FileContent content = file.getContent()) {
return content.getString(charset);
}
}
private FileObjectUtils();
public static boolean... | Assert.assertEquals("This is a test file.",
FileObjectUtils.getContentAsString(
VFS.getManager().toFileObject(new File("src/test/resources/test-data/read-tests/file1.txt")),
(String) null));
}
} | [FOCAL] public static String FileObjectUtils.getContentAsString(FileObject file, Charset charset)
[CLASS] class FileObjectUtils
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] FileObject.getContent/0, FileContent.getString/1
[EXCEPTIONS] declares IOException
[INPUTS] branches=- | r... | /* static context
[FOCAL] public static String FileObjectUtils.getContentAsString(FileObject file, Charset charset)
[INPUTS] branches=- | result=charset, file
[COLLABORATORS] param file:FileObject getContent/0
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] FileObject.getContent/0, FileContent.getString/1
*/
| /* static context
[FOCAL] public static String FileObjectUtils.getContentAsString(FileObject file, Charset charset)
[INPUTS] branches=- | result=charset, file
[COLLABORATORS] param file:FileObject getContent/0
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] FileObject.getContent/0, FileContent.getString/1
*/
class F... | true | ok | {"focal": {"class": "FileObjectUtils", "name": "getContentAsString", "signature": "String getContentAsString(FileObject file, Charset charset) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "file", "type": "FileObject"}, {"name": "charset", "type": "Charset"}], "return_type": "S... |
11392749_29 | class Rewriters {
public static StringOperator replace(@NotNull final String what, @NotNull final String with) {
return new StringOperator() {
@Override
public String apply(final String arg) {
return Strings.replace(arg, what, with);
}
};
}
public static StringOperator replace(... | String str = "ABCDE";
assertThat(Rewriters.replace("YYY","TTT").apply(str)).isSameAs(str);
}
} | [FOCAL] public static StringOperator Rewriters.replace(String what, String with)
[CLASS] class Rewriters
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Strings.replace/3
[NEW] StringOperator
[INPUTS] branches=- | result=what, with
[DATAFLOW] what@param->L2; with@param->L2
[CLASS-M... | /* static context
[FOCAL] public static StringOperator Rewriters.replace(String what, String with)
[INPUTS] branches=- | result=what, with
[NEW] StringOperator
[CALLS-EXTERNAL] Strings.replace/3
*/
| /* static context
[FOCAL] public static StringOperator Rewriters.replace(String what, String with)
[INPUTS] branches=- | result=what, with
[NEW] StringOperator
[CALLS-EXTERNAL] Strings.replace/3
*/
class Rewriters {
public static StringOperator replace(@NotNull final String what, @NotNull final String with) {
re... | true | ok | {"focal": {"class": "Rewriters", "name": "replace", "signature": "StringOperator replace(String what, String with)", "start_line": 3, "modifiers": "public static", "params": [{"name": "what", "type": "String"}, {"name": "with", "type": "String"}], "return_type": "StringOperator"}, "class_info": {"name": "Rewriters", "k... |
11397182_17 | class AllowedMechanisms {
public static AllowedMechanisms fromBinaryEncoding(final byte[] binary) throws IllegalArgumentException {
final ArrayList<Long> mechs = new ArrayList<>();
try {
final LongBuffer lb = ByteBuffer.wrap(binary).order(ByteOrder.LITTLE_ENDIAN).asLongBuffer();
... | LOG.info(">testFromBinaryEncoding");
final Long[] expected = new Long[] { 0x00000040l, 0x00000000l, 0x00000250l, 0x252l, 624l, 0x81234567l };
final String binary =
"4000000000000000"
+ "0000000000000000"
+ "5002000000000000"
+ "... | [FOCAL] public static AllowedMechanisms AllowedMechanisms.fromBinaryEncoding(byte[] binary)
[CLASS] class AllowedMechanisms
[METRICS] loc=12 cc=3 branches=0 loops=1 returns=1 throws=1 nesting=2
[CALLS-EXTERNAL] ByteBuffer.wrap(binary).order(ByteOrder.LITTLE_ENDIAN).asLongBuffer/0, ByteBuffer.wrap(binary).order/1, ByteB... | /* static context
[FOCAL] public static AllowedMechanisms AllowedMechanisms.fromBinaryEncoding(byte[] binary)
[THROWS-WHEN] IllegalArgumentException when try-body throws
[PATH1] while(lb.hasRemaining())=T -> exit loop -> return new AllowedMechanisms(mechs)
[PATH2] try-body throws -> throw new IllegalArgumentException("... | /* static context
[FOCAL] public static AllowedMechanisms AllowedMechanisms.fromBinaryEncoding(byte[] binary)
[THROWS-WHEN] IllegalArgumentException when try-body throws
[PATH1] while(lb.hasRemaining())=T -> exit loop -> return new AllowedMechanisms(mechs)
[PATH2] try-body throws -> throw new IllegalArgumentException("... | true | ok | {"focal": {"class": "AllowedMechanisms", "name": "fromBinaryEncoding", "signature": "AllowedMechanisms fromBinaryEncoding(byte[] binary) throws IllegalArgumentException", "start_line": 3, "modifiers": "public static", "params": [{"name": "binary", "type": "byte[]"}], "return_type": "AllowedMechanisms"}, "class_info": {... |
11416570_5 | class MacUtils {
public static byte[] macAddress() {
byte[] override = getOverride();
return override != null ? override : realMacAddress();
}
public static byte[] getOverride();
public static byte[] realMacAddress();
}
class MacUtilsTest {
@Test
public void verifyOverride... | System.setProperty(MacUtils.OVERRIDE_MAC_PROP, "00:DE:AD:BE:EF:11");
byte[] mac = MacUtils.macAddress();
Assert.assertNotNull("Could not retrieve MAC", mac);
Assert.assertTrue("Invalid MAC address", mac.length == 6);
Assert.assertEquals("Unexpected MAC address", "[0, -34, -83, ... | [FOCAL] public static byte[] MacUtils.macAddress()
[CLASS] class MacUtils
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] byte[] getOverride(); byte[] realMacAddress()
[DATAFLOW] override@L2->L3
[CLASS-MEMBERS] byte[] getOverride(); byte[] realMacAddress()
[TEST] MacUtilsTest: @Tes... | /* static context
[FOCAL] public static byte[] MacUtils.macAddress()
[CALLS-INTERNAL] byte[] getOverride(); byte[] realMacAddress()
*/
| /* static context
[FOCAL] public static byte[] MacUtils.macAddress()
[CALLS-INTERNAL] byte[] getOverride(); byte[] realMacAddress()
*/
class MacUtils {
public static byte[] macAddress() {
byte[] override = getOverride();
return override != null ? override : realMacAddress();
}
public stat... | true | ok | {"focal": {"class": "MacUtils", "name": "macAddress", "signature": "byte[] macAddress()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "byte[]"}, "class_info": {"name": "MacUtils", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name":... |
11429654_9 | class InterleavedReader implements Closeable {
public Object read() throws IOException {
char[] buffer = new char[BUFFER_LENGTH];
reader.mark(BUFFER_LENGTH);
int count = 0;
int textEnd;
while (true) {
int r = reader.read(buffer, count, buffer.length - count);
if (r == -1) {
... | InterleavedReader reader = new InterleavedReader("////", new StringReader("abc///"));
assertEquals("abc", reader.read());
assertEquals("///", reader.read());
assertEquals(null, reader.read());
}
} | [FOCAL] public Object InterleavedReader.read()
[CLASS] class InterleavedReader implements Closeable
[METRICS] loc=44 cc=5 branches=4 loops=1 returns=3 throws=0 nesting=2
[CALLS-INTERNAL] int findPossibleMarker(char[] chars, int limit)
[CALLS-EXTERNAL] reader.mark/1, reader.read/3, marker.length/0, reader.reset/0, reade... | /* static context
[FOCAL] public Object InterleavedReader.read()
[PATH1] while(true)=T -> if(r == -1)=F -> if(possibleMarker != 0)=T -> if(count == 0)=T -> return null
[PATH2] while(true)=T -> if(r == -1)=T -> if(count == 0)=F -> return new String(buffer, 0, count)
[PATH3] while(true)=T -> if(r == -1)=F -> if(possibleM... | /* static context
[FOCAL] public Object InterleavedReader.read()
[PATH1] while(true)=T -> if(r == -1)=F -> if(possibleMarker != 0)=T -> if(count == 0)=T -> return null
[PATH2] while(true)=T -> if(r == -1)=T -> if(count == 0)=F -> return new String(buffer, 0, count)
[PATH3] while(true)=T -> if(r == -1)=F -> if(possibleM... | true | ok | {"focal": {"class": "InterleavedReader", "name": "read", "signature": "Object read() throws IOException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Object"}, "class_info": {"name": "InterleavedReader", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Closeable", "fields":... |
11450329_1 | class ReadOptimizedGraphity extends SocialGraph {
@Override
public void createFriendship(final Node following, final Node followed) {
// try to find the replica node of the user followed
Node followedReplica = null;
for (Relationship followship : following.getRelationships(
SocialGraphRelationshipType.FOLL... | // A follows: B, C, D, E
this.algorithm.createFriendship(this.USER_A, this.USER_B);
this.algorithm.createFriendship(this.USER_A, this.USER_C);
this.algorithm.createFriendship(this.USER_A, this.USER_D);
this.algorithm.createFriendship(this.USER_A, this.USER_E);
// B follows: A, D
this.algorithm.createFrie... | [FOCAL] @Override public void ReadOptimizedGraphity.createFriendship(Node following, Node followed)
[CLASS] class ReadOptimizedGraphity extends SocialGraph
[METRICS] loc=67 cc=8 branches=6 loops=2 returns=1 throws=0 nesting=4
[CALLS-INTERNAL] long getLastUpdateByReplica(Node userReplica)
[CALLS-EXTERNAL] Node.getRelati... | /* static context
[FOCAL] @Override public void ReadOptimizedGraphity.createFriendship(Node following, Node followed)
[PATH1] foreach(Relationship followship : following.getRelationships( SocialGraphRelationshipType.FOLLOW, Direction.OUT...)=T -> if(NeoUtils.getNextSingleNode(followedReplica, SocialGraphRelationshipTyp... | /* static context
[FOCAL] @Override public void ReadOptimizedGraphity.createFriendship(Node following, Node followed)
[PATH1] foreach(Relationship followship : following.getRelationships( SocialGraphRelationshipType.FOLLOW, Direction.OUT...)=T -> if(NeoUtils.getNextSingleNode(followedReplica, SocialGraphRelationshipTyp... | true | ok | {"focal": {"class": "ReadOptimizedGraphity", "name": "createFriendship", "signature": "void createFriendship(Node following, Node followed)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "following", "type": "Node"}, {"name": "followed", "type": "Node"}], "return_type": "void"}, "class_info": {... |
11451879_32 | class NamingUtil {
public static String getName(Network object) {
if (isFilled(object.getName()))
return object.getName();
return object.getObjectId();
}
public static String getName(Company object);
public static String getName(GroupOfLine object);
public static String getName(StopArea object);
public s... | public void testTimetableName() throws Exception
{
Timetable object = new Timetable();
object.setObjectId("test:Timetable:1");
object.setComment("test");
Assert.assertEquals(NamingUtil.getName(object),object.getComment(),"comment should be returned");
object.setComment("");
Assert.assertEquals(NamingUtil... | [FOCAL] public static String NamingUtil.getName(Network object)
[CLASS] class NamingUtil
[METRICS] loc=5 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] boolean isFilled(String data)
[CALLS-EXTERNAL] Network.getName/0, Network.getObjectId/0
[PATH1] if(isFilled(object.getName()))=T -> return object... | /* static context
[FOCAL] public static String NamingUtil.getName(Network object)
[PATH1] if(isFilled(object.getName()))=T -> return object.getName()
[PATH2] if(isFilled(object.getName()))=F -> return object.getObjectId()
[INPUTS] branches=object | result=object
[COLLABORATORS] param object:Network getName/0,getObjectI... | /* static context
[FOCAL] public static String NamingUtil.getName(Network object)
[PATH1] if(isFilled(object.getName()))=T -> return object.getName()
[PATH2] if(isFilled(object.getName()))=F -> return object.getObjectId()
[INPUTS] branches=object | result=object
[COLLABORATORS] param object:Network getName/0,getObjectI... | true | ok | {"focal": {"class": "NamingUtil", "name": "getName", "signature": "String getName(Network object)", "start_line": 3, "modifiers": "public static", "params": [{"name": "object", "type": "Network"}], "return_type": "String"}, "class_info": {"name": "NamingUtil", "kind": "class", "modifiers": "", "superclass": null, "inte... |
11452433_6 | class GsonProvider implements MessageBodyReader<T>, MessageBodyWriter<T> {
@Override
public T readFrom( Class<T> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType,
MultivaluedMap<String, String> httpHeaders,
InputStream entityStream ) throws IOException, WebApplicationException
... | GsonProvider<TestObject> testObjectProvider = new GsonProvider<TestObject>();
TestObject testObject = new TestObject( "foo" );
String json = new Gson().toJson( testObject );
ByteArrayInputStream inputStream = spy( new ByteArrayInputStream( json.getBytes( "UTF-8" ) ) );
testObjectProvider.readFrom( TestObject... | [FOCAL] @Override public T GsonProvider.readFrom(Class<T> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
[CLASS] class GsonProvider implements MessageBodyReader<T>, MessageBodyWriter<T>
[METRICS] loc=21 cc=3 branches=1 loops=0... | /* static context
[FOCAL] @Override public T GsonProvider.readFrom(Class<T> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
[PATH1] if(type.equals(genericType) || genericType == null)=T -> return gson.fromJson( reader, jsonType... | /* static context
[FOCAL] @Override public T GsonProvider.readFrom(Class<T> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
[PATH1] if(type.equals(genericType) || genericType == null)=T -> return gson.fromJson( reader, jsonType... | true | ok | {"focal": {"class": "GsonProvider", "name": "readFrom", "signature": "T readFrom(Class<T> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException, WebApplicationException", "start_line": 3, "modifiers": "@Override pu... |
11453959_8 | class ClassDefinitionUtils {
@SuppressWarnings("unchecked")
public static <T> Class<T> defineClass(String className, byte[] b, Class<?> neighbor, ClassLoader loader)
throws Exception {
Class<T> c = (Class<T>) DefineClassHelper.defineClass(className, b, 0, b.length, neighbor, loader, PROTECTION_DOMAIN... | byte[] b = ClassDefinitionUtils.readClass(className);
Class<?> c = ClassDefinitionUtils.defineClass(className, b, Objenesis.class, getClass().getClassLoader());
assertEquals(c.getName(), className);
}
} | [FOCAL] @SuppressWarnings("unchecked") public static Class<T> ClassDefinitionUtils.defineClass(String className, byte[] b, Class<?> neighbor, ClassLoader loader)
[CLASS] class ClassDefinitionUtils
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] DefineClassHelper.defineClass/7, Clas... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public static Class<T> ClassDefinitionUtils.defineClass(String className, byte[] b, Class<?> neighbor, ClassLoader loader)
[INPUTS] branches=- | result=b, className, loader, neighbor
[EXCEPTIONS] declares Exception
[CALLS-EXTERNAL] DefineClassHelper.defineClass/7... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public static Class<T> ClassDefinitionUtils.defineClass(String className, byte[] b, Class<?> neighbor, ClassLoader loader)
[INPUTS] branches=- | result=b, className, loader, neighbor
[EXCEPTIONS] declares Exception
[CALLS-EXTERNAL] DefineClassHelper.defineClass/7... | true | ok | {"focal": {"class": "ClassDefinitionUtils", "name": "defineClass", "signature": "Class<T> defineClass(String className, byte[] b, Class<?> neighbor, ClassLoader loader) throws Exception", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public static", "params": [{"name": "className", "type": "String"}, ... |
11459376_4 | class CassandraArchiveRepository implements ArchiveRepository {
protected Iterable<Row<String, String>> getRows(EnumSet<?> columns) throws Exception {
int shardCount = config.getShardCount();
List<Future<Rows<String, String>>> futures = new ArrayList<Future<Rows<String, String>>>();
for (i... | EnumSet<Columns> columns = EnumSet.of(Columns.module_id, Columns.module_name);
Rows<String, String> mockRows = mock(Rows.class);
Row<String, String> row1 = mock(Row.class);
Row<String, String> row2 = mock(Row.class);
List<Row<String, String>> rowList = Arrays.asList(row1, row2);
... | [FOCAL] protected Iterable<Row<String, String>> CassandraArchiveRepository.getRows(EnumSet<?> columns)
[CLASS] class CassandraArchiveRepository implements ArchiveRepository
[METRICS] loc=16 cc=3 branches=0 loops=2 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] String generateSelectByShardCql(EnumSet<?> columns, Integer ... | /* static context
[FOCAL] protected Iterable<Row<String, String>> CassandraArchiveRepository.getRows(EnumSet<?> columns)
[PATH1] for(i < shardCount)=T -> exit loop -> foreach(Future<Rows<String, String>> f : futures)=F -> return rows
[PATH2] for(i < shardCount)=F -> foreach(Future<Rows<String, String>> f : futures)=T -... | /* static context
[FOCAL] protected Iterable<Row<String, String>> CassandraArchiveRepository.getRows(EnumSet<?> columns)
[PATH1] for(i < shardCount)=T -> exit loop -> foreach(Future<Rows<String, String>> f : futures)=F -> return rows
[PATH2] for(i < shardCount)=F -> foreach(Future<Rows<String, String>> f : futures)=T -... | true | ok | {"focal": {"class": "CassandraArchiveRepository", "name": "getRows", "signature": "Iterable<Row<String, String>> getRows(EnumSet<?> columns) throws Exception", "start_line": 3, "modifiers": "protected", "params": [{"name": "columns", "type": "EnumSet<?>"}], "return_type": "Iterable<Row<String, String>>"}, "class_info":... |
11479356_0 | class ClientSideLoggingBehavior extends Behavior {
public static Builder newBuilder() {
return new Builder();
}
public ClientSideLoggingBehavior();
public ClientSideLoggingBehavior(final Map<String, Object> data);
private static IClientSideLoggingSettings settings();
public static B... | ClientSideLoggingBehavior.Builder b = ClientSideLoggingBehavior.newBuilder();
assertThat(b.build(), is(notNullValue()));
assertThat(b.data().size(), is(equalTo(0)));
}
} | [FOCAL] public static Builder ClientSideLoggingBehavior.newBuilder()
[CLASS] class ClientSideLoggingBehavior extends Behavior
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] Builder
[CLASS-MEMBERS] ClientSideLoggingBehavior(); ClientSideLoggingBehavior(Map<String, Object> data); IClientSideLo... | /* static context
[FOCAL] public static Builder ClientSideLoggingBehavior.newBuilder()
[NEW] Builder
*/
| /* static context
[FOCAL] public static Builder ClientSideLoggingBehavior.newBuilder()
[NEW] Builder
*/
class ClientSideLoggingBehavior extends Behavior {
public static Builder newBuilder() {
return new Builder();
}
public ClientSideLoggingBehavior();
public ClientSideLoggingBehavior(final M... | true | ok | {"focal": {"class": "ClientSideLoggingBehavior", "name": "newBuilder", "signature": "Builder newBuilder()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Builder"}, "class_info": {"name": "ClientSideLoggingBehavior", "kind": "class", "modifiers": "", "superclass": "Behavior", "interfaces"... |
11480369_2 | class SubstitutionPropertiesProvider extends CompositePropertiesProvider {
@Override
public Object getProperty(String key) {
return getProperty(key, null);
}
public SubstitutionPropertiesProvider(PropertiesProvider... delegates);
@Override public Object getProperty(String key, Object def... | SubstitutionPropertiesProvider provider = new SubstitutionPropertiesProvider(new MapPropertiesProvider(config), new SystemPropertiesProvider(), new EnvPropertiesProvider());
Assert.assertEquals(null, provider.getProperty(""));
Assert.assertEquals("value1", provider.getProperty("key1"));
... | [FOCAL] @Override public Object SubstitutionPropertiesProvider.getProperty(String key)
[CLASS] class SubstitutionPropertiesProvider extends CompositePropertiesProvider
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Object getProperty(String key, Object defaultValue)
[INPUTS] branc... | /* static context
[FOCAL] @Override public Object SubstitutionPropertiesProvider.getProperty(String key)
[INPUTS] branches=- | result=key
[CALLS-INTERNAL] Object getProperty(String key, Object defaultValue)
*/
| /* static context
[FOCAL] @Override public Object SubstitutionPropertiesProvider.getProperty(String key)
[INPUTS] branches=- | result=key
[CALLS-INTERNAL] Object getProperty(String key, Object defaultValue)
*/
class SubstitutionPropertiesProvider extends CompositePropertiesProvider {
@Override
public Object ge... | true | ok | {"focal": {"class": "SubstitutionPropertiesProvider", "name": "getProperty", "signature": "Object getProperty(String key)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "key", "type": "String"}], "return_type": "Object"}, "class_info": {"name": "SubstitutionPropertiesProvider", "kind": "class",... |
11525787_7 | class DefaultMetricsReader implements MetricsReader {
private MetricValue readQueueLength() {
MetricValue value = null;
Counter queueLength = metricRegistry
.counter(MetricName.QUEUE_LENGTH.getName());
if (queueLength != null) {
value = MetricVa... | System.out.println("testReadQueueLength");
DefaultMetricsReader reader = new DefaultMetricsReader();
MetricValue value = reader.readValue(MetricName.QUEUE_LENGTH);
assertThat(value, notNullValue());
assertThat(value.getUnit(), equalTo(MetricUnit.TUPLES));
... | [FOCAL] private MetricValue DefaultMetricsReader.readQueueLength()
[CLASS] class DefaultMetricsReader implements MetricsReader
[METRICS] loc=13 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] metricRegistry.counter/1, MetricName.QUEUE_LENGTH.getName/0, MetricValue.tuples/1, Long.valueOf( queueLeng... | /* static context
[FOCAL] private MetricValue DefaultMetricsReader.readQueueLength()
[PATH1] if(queueLength != null)=T -> return value
[PATH2] if(queueLength != null)=F -> return value
[COLLABORATORS] field metricRegistry counter/1
[CALLS-EXTERNAL] metricRegistry.counter/1, MetricName.QUEUE_LENGTH.getName/0, MetricValu... | /* static context
[FOCAL] private MetricValue DefaultMetricsReader.readQueueLength()
[PATH1] if(queueLength != null)=T -> return value
[PATH2] if(queueLength != null)=F -> return value
[COLLABORATORS] field metricRegistry counter/1
[CALLS-EXTERNAL] metricRegistry.counter/1, MetricName.QUEUE_LENGTH.getName/0, MetricValu... | true | ok | {"focal": {"class": "DefaultMetricsReader", "name": "readQueueLength", "signature": "MetricValue readQueueLength()", "start_line": 3, "modifiers": "private", "params": [], "return_type": "MetricValue"}, "class_info": {"name": "DefaultMetricsReader", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "M... |
11527775_8 | class ForceNoBulkScoringQuery extends Query {
@Override
public int hashCode() {
return Objects.hash(inner);
}
public ForceNoBulkScoringQuery(Query inner);
@Override public Query rewrite(IndexReader reader);
@Override public boolean equals(Object o);
public Query getWrappedQuery()... |
TermQuery tq1 = new TermQuery(new Term("f", "t"));
TermQuery tq2 = new TermQuery(new Term("f", "t2"));
TermQuery tq3 = new TermQuery(new Term("f", "t2"));
assertThat(new ForceNoBulkScoringQuery(tq1))
.isEqualTo(new ForceNoBulkScoringQuery(tq1));
assertThat(new F... | [FOCAL] @Override public int ForceNoBulkScoringQuery.hashCode()
[CLASS] class ForceNoBulkScoringQuery extends Query
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Objects.hash/1
[CLASS-MEMBERS] ForceNoBulkScoringQuery(Query inner); Query rewrite(IndexReader reader); boolean equals... | /* static context
[FOCAL] @Override public int ForceNoBulkScoringQuery.hashCode()
[CALLS-EXTERNAL] Objects.hash/1
*/
| /* static context
[FOCAL] @Override public int ForceNoBulkScoringQuery.hashCode()
[CALLS-EXTERNAL] Objects.hash/1
*/
class ForceNoBulkScoringQuery extends Query {
@Override
public int hashCode() {
return Objects.hash(inner);
}
public ForceNoBulkScoringQuery(Query inner);
@Override public... | true | ok | {"focal": {"class": "ForceNoBulkScoringQuery", "name": "hashCode", "signature": "int hashCode()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "ForceNoBulkScoringQuery", "kind": "class", "modifiers": "", "superclass": "Query", "interfaces": null, "fields"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.