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 |
|---|---|---|---|---|---|---|---|---|
1097987_0 | class MySimilarity extends DefaultSimilarity {
@Override
public float lengthNorm(String fieldName, int numTerms) {
if (numTerms < 20) {
// this shouldn't be possible, but be safe.
if (numTerms <= 0)
return 0;
// return ARR[numTerms];
retur... | MySimilarity s = new MySimilarity();
assertEquals(0, s.lengthNorm("test", 0), 1e-6);
assertEquals(0.289400, s.lengthNorm("test", 10), 1e-6);
assertEquals(0.234860, s.lengthNorm("test", 19), 1e-6);
assertEquals(0.223606, s.lengthNorm("test", 20), 1e-6);
}
} | [FOCAL] @Override public float MySimilarity.lengthNorm(String fieldName, int numTerms)
[CLASS] class MySimilarity extends DefaultSimilarity
[METRICS] loc=13 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=2
[CALLS-EXTERNAL] Math.sqrt/1
[PATH1] if(numTerms < 20)=T -> if(numTerms <= 0)=T -> return 0
[PATH2] if(numTerm... | /* static context
[FOCAL] @Override public float MySimilarity.lengthNorm(String fieldName, int numTerms)
[PATH1] if(numTerms < 20)=T -> if(numTerms <= 0)=T -> return 0
[PATH2] if(numTerms < 20)=F -> return (float) (1.0 / Math.sqrt(numTerms))
[PATH3] if(numTerms < 20)=T -> if(numTerms <= 0)=F -> return -0.00606f * numTe... | /* static context
[FOCAL] @Override public float MySimilarity.lengthNorm(String fieldName, int numTerms)
[PATH1] if(numTerms < 20)=T -> if(numTerms <= 0)=T -> return 0
[PATH2] if(numTerms < 20)=F -> return (float) (1.0 / Math.sqrt(numTerms))
[PATH3] if(numTerms < 20)=T -> if(numTerms <= 0)=F -> return -0.00606f * numTe... | true | ok | {"focal": {"class": "MySimilarity", "name": "lengthNorm", "signature": "float lengthNorm(String fieldName, int numTerms)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "fieldName", "type": "String"}, {"name": "numTerms", "type": "int"}], "return_type": "float"}, "class_info": {"name": "MySimila... |
1107344_0 | class AardvarkHelpMode extends GosuMode {
static void printHelp(PrintWriter out) {
out.println("Usage:");
out.println(" vark [-f FILE] [options] [targets...]");
out.println();
out.println("Options:");
IArgKeyList keys = Launch.factory().createArgKeyList();
for (IArgKey key : AardvarkO... | StringWriter writer = new StringWriter();
PrintWriter out = new PrintWriter(writer);
AardvarkHelpMode.printHelp(out);
String eol = System.getProperty("line.separator");
assertEquals(
"Usage:" + eol +
" vark [-f FILE] [options] [targets...]" + eol +
... | [FOCAL] static void AardvarkHelpMode.printHelp(PrintWriter out)
[CLASS] class AardvarkHelpMode extends GosuMode
[METRICS] loc=12 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] PrintWriter.println/1, PrintWriter.println/0, Launch.factory().createArgKeyList/0, Launch.factory/0, AardvarkOptions.getA... | /* static context
[FOCAL] static void AardvarkHelpMode.printHelp(PrintWriter out)
[PATH1] foreach(IArgKey key : AardvarkOptions.getArgKeys())=T -> exit loop
[PATH2] foreach(IArgKey key : AardvarkOptions.getArgKeys())=F
[COLLABORATORS] param out:PrintWriter println/1,println/0
[CALLS-EXTERNAL] PrintWriter.println/1, Pri... | /* static context
[FOCAL] static void AardvarkHelpMode.printHelp(PrintWriter out)
[PATH1] foreach(IArgKey key : AardvarkOptions.getArgKeys())=T -> exit loop
[PATH2] foreach(IArgKey key : AardvarkOptions.getArgKeys())=F
[COLLABORATORS] param out:PrintWriter println/1,println/0
[CALLS-EXTERNAL] PrintWriter.println/1, Pri... | true | ok | {"focal": {"class": "AardvarkHelpMode", "name": "printHelp", "signature": "void printHelp(PrintWriter out)", "start_line": 3, "modifiers": "static", "params": [{"name": "out", "type": "PrintWriter"}], "return_type": "void"}, "class_info": {"name": "AardvarkHelpMode", "kind": "class", "modifiers": "", "superclass": "Gos... |
1110934_2 | class CprAbbsResponseParser {
public List<String> extractCprNumbers(String soapResponse) throws CprAbbsException
{
int start = soapResponse.indexOf("<?xml");
if(start == -1) {
throw new CprAbbsException("Invalid message body on call to CPR Abbs");
}
String soapRespon... | CprAbbsResponseParser parser = new CprAbbsResponseParser();
List<String> extractCprNumbers = parser.extractCprNumbers(exampleResponseWithHeaders);
assertEquals(2, extractCprNumbers.size());
assertEquals("0101822231", extractCprNumbers.get(0));
assertEquals("0101821234", extractCp... | [FOCAL] public List<String> CprAbbsResponseParser.extractCprNumbers(String soapResponse)
[CLASS] class CprAbbsResponseParser
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-INTERNAL] List<String> extractCprNumbersWithoutHeaders(String soapResponse)
[CALLS-EXTERNAL] String.indexOf/1, String.s... | /* static context
[FOCAL] public List<String> CprAbbsResponseParser.extractCprNumbers(String soapResponse)
[THROWS-WHEN] CprAbbsException when start == -1
[PATH1] if(start == -1)=T -> throw new CprAbbsException("Invalid message body on call to CPR Abbs")
[PATH2] if(start == -1)=F -> return extractCprNumbersWithoutHeade... | /* static context
[FOCAL] public List<String> CprAbbsResponseParser.extractCprNumbers(String soapResponse)
[THROWS-WHEN] CprAbbsException when start == -1
[PATH1] if(start == -1)=T -> throw new CprAbbsException("Invalid message body on call to CPR Abbs")
[PATH2] if(start == -1)=F -> return extractCprNumbersWithoutHeade... | true | ok | {"focal": {"class": "CprAbbsResponseParser", "name": "extractCprNumbers", "signature": "List<String> extractCprNumbers(String soapResponse) throws CprAbbsException", "start_line": 3, "modifiers": "public", "params": [{"name": "soapResponse", "type": "String"}], "return_type": "List<String>"}, "class_info": {"name": "Cp... |
1116314_32 | class HasTypesCollectors {
public static <T extends HasTypes> Collector<T, ?, List<T>> closestTypes( T hasTypes )
{
return hasTypesToListCollector( hasTypes, new HasAssignableToType<>( hasTypes ) );
}
private HasTypesCollectors();
public static Collector<T, ?, Optional<T>> matchingType( ... | List<ValueType> list = new ArrayList<ValueType>()
{{
add( ValueType.of( String.class ) );
add( ValueType.of( Identity.class ) );
}};
List<ValueType> result = list.stream()
.collect( HasTypesCollectors.closestTypes( StringIdent... | [FOCAL] public static Collector<T, ?, List<T>> HasTypesCollectors.closestTypes(T hasTypes)
[CLASS] class HasTypesCollectors
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Collector<T, ?, List<T>> hasTypesToListCollector(T hasTypes, Predicate<T> assignableTypePredicate)
[NEW] HasAs... | /* static context
[FOCAL] public static Collector<T, ?, List<T>> HasTypesCollectors.closestTypes(T hasTypes)
[INPUTS] branches=- | result=hasTypes
[CALLS-INTERNAL] Collector<T, ?, List<T>> hasTypesToListCollector(T hasTypes, Predicate<T> assignableTypePredicate)
[NEW] HasAssignableToType<>
*/
| /* static context
[FOCAL] public static Collector<T, ?, List<T>> HasTypesCollectors.closestTypes(T hasTypes)
[INPUTS] branches=- | result=hasTypes
[CALLS-INTERNAL] Collector<T, ?, List<T>> hasTypesToListCollector(T hasTypes, Predicate<T> assignableTypePredicate)
[NEW] HasAssignableToType<>
*/
class HasTypesCollectors {... | true | ok | {"focal": {"class": "HasTypesCollectors", "name": "closestTypes", "signature": "Collector<T, ?, List<T>> closestTypes(T hasTypes)", "start_line": 3, "modifiers": "public static", "params": [{"name": "hasTypes", "type": "T"}], "return_type": "Collector<T, ?, List<T>>"}, "class_info": {"name": "HasTypesCollectors", "kind... |
1146205_24 | class ClientInputStream extends InputStream {
@Override
public int read() throws IOException {
return remote.read();
}
public ClientInputStream(RemoteInputStream remote);
@Override public int read(byte[] buf, int off, int len);
@Override public long skip(long n);
@Override public void close();
... | bi.reset();
byte[] r = new byte[100];
assertEquals(buf.length, ci.read(r));
for (int i = 0; i < buf.length; i++)
assertEquals(buf[i], r[i]);
assertEquals(-1, ci.read());
bi.reset();
r = new byte[0];
assertEquals(0, ci.read(r));
}
} | [FOCAL] @Override public int ClientInputStream.read()
[CLASS] class ClientInputStream extends InputStream
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] remote.read/0
[EXCEPTIONS] declares IOException
[COLLABORATORS] field remote read/0
[CLASS-MEMBERS] ClientInputStream(RemoteInpu... | /* static context
[FOCAL] @Override public int ClientInputStream.read()
[COLLABORATORS] field remote read/0
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] remote.read/0
*/
| /* static context
[FOCAL] @Override public int ClientInputStream.read()
[COLLABORATORS] field remote read/0
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] remote.read/0
*/
class ClientInputStream extends InputStream {
@Override
public int read() throws IOException {
return remote.read();
}
public Cli... | true | ok | {"focal": {"class": "ClientInputStream", "name": "read", "signature": "int read() throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "ClientInputStream", "kind": "class", "modifiers": "", "superclass": "InputStream", "interfaces": null, "fi... |
1149947_21 | class SCAInvoker extends BaseServiceHandler {
@Override
public void handleMessage(Exchange exchange) throws HandlerException {
// identify ourselves
exchange.getContext().setProperty(ExchangeCompletionEvent.GATEWAY_NAME, _bindingName, Scope.EXCHANGE)
.addLabels(BehaviorLabel.TRA... | V1SCABindingModel config = new V1SCABindingModel(SwitchYardNamespace.DEFAULT.uri()) {
@Override
public String getName() {
return "testBinding";
}
public CompositeReferenceModel getReference() {
return new V1CompositeReferenceModel()... | [FOCAL] @Override public void SCAInvoker.handleMessage(Exchange exchange)
[CLASS] class SCAInvoker extends BaseServiceHandler
[METRICS] loc=32 cc=6 branches=4 loops=0 returns=0 throws=3 nesting=3
[CALLS-INTERNAL] QName getTargetServiceName(Exchange exchange); void invokeLocal(Exchange exchange, ServiceReference targetR... | /* static context
[FOCAL] @Override public void SCAInvoker.handleMessage(Exchange exchange)
[THROWS-WHEN] SCAMessages.MESSAGES.referenceBindingNotStarted(_referenceName, _bi... when getState() != State.STARTED
[THROWS-WHEN] HandlerException when !(getState() != State.STARTED) && try-body throws
[THROWS-WHEN] HandlerExc... | /* static context
[FOCAL] @Override public void SCAInvoker.handleMessage(Exchange exchange)
[THROWS-WHEN] SCAMessages.MESSAGES.referenceBindingNotStarted(_referenceName, _bi... when getState() != State.STARTED
[THROWS-WHEN] HandlerException when !(getState() != State.STARTED) && try-body throws
[THROWS-WHEN] HandlerExc... | true | ok | {"focal": {"class": "SCAInvoker", "name": "handleMessage", "signature": "void handleMessage(Exchange exchange) throws HandlerException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "exchange", "type": "Exchange"}], "return_type": "void"}, "class_info": {"name": "SCAInvoker", "kind": "class", "... |
1155836_1 | class PaxLoggerImpl implements PaxLogger {
@Override
public LogLevel getLogLevel() {
Level level = m_delegate.getEffectiveLevel();
return getLogLevel(level);
}
PaxLoggerImpl(Bundle bundle, Logger delegate, String fqcn, PaxLoggingServiceImpl service, boolean printfFormatting);
@O... | Constructor<Logger> c = Logger.class.getDeclaredConstructor(String.class);
c.setAccessible(true);
Logger logger = c.newInstance("test");
PaxLoggerImpl loggerImpl = new PaxLoggerImpl(null, logger, null, null, false);
logger.setLevel(null);
assertEquals(LogLevel.AUDIT, lo... | [FOCAL] @Override public LogLevel PaxLoggerImpl.getLogLevel()
[CLASS] class PaxLoggerImpl implements PaxLogger
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] LogLevel getLogLevel(Level level)
[CALLS-EXTERNAL] m_delegate.getEffectiveLevel/0
[COLLABORATORS] field m_delegate getEffec... | class PaxLoggerImpl implements PaxLogger {
@Override
public LogLevel getLogLevel() {
Level level = m_delegate.getEffectiveLevel();
return getLogLevel(level);
}
PaxLoggerImpl(Bundle bundle, Logger delegate, String fqcn, PaxLoggingServiceImpl service, boolean printfFormatting);
@O... | false | ok | {"focal": {"class": "PaxLoggerImpl", "name": "getLogLevel", "signature": "LogLevel getLogLevel()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "LogLevel"}, "class_info": {"name": "PaxLoggerImpl", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "PaxLogger", "fields"... | |
1155961_9 | class StudyEJB3DAO extends AccessibleEJB3DAO<Study> implements StudyDAO {
public Study getByAccForUser(String acc, String userName) {
Query query = entityManager.createQuery("SELECT s " +
"FROM Study s join s.users user " +
"WHERE " +
"s.acc =:acc AND (user.userName =:userName"
+ " OR s.status =:st... | //Test for private study
Study study = dao.getByAccForUser("BII-ST-1", "test_user");
assertNotNull(study);
//Test for private study with curator user
study = dao.getByAccForUser("BII-ST-1", "curator");
assertNotNull(study);
//Test for private study with guest user
Exception exception = null;
try {
... | [FOCAL] public Study StudyEJB3DAO.getByAccForUser(String acc, String userName)
[CLASS] class StudyEJB3DAO extends AccessibleEJB3DAO<Study> implements StudyDAO
[METRICS] loc=21 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] entityManager.createQuery("SELECT s " + "FROM Study s joi....setParameter/... | /* static context
[FOCAL] public Study StudyEJB3DAO.getByAccForUser(String acc, String userName)
[THROWS-WHEN] BIIDAOException when try-body throws
[PATH1] try-body throws -> throw new BIIDAOException("Study with acc " + acc + " doesn't exist for u...
[PATH2] return study
[INPUTS] branches=- | result=acc, userName
[COL... | /* static context
[FOCAL] public Study StudyEJB3DAO.getByAccForUser(String acc, String userName)
[THROWS-WHEN] BIIDAOException when try-body throws
[PATH1] try-body throws -> throw new BIIDAOException("Study with acc " + acc + " doesn't exist for u...
[PATH2] return study
[INPUTS] branches=- | result=acc, userName
[COL... | true | ok | {"focal": {"class": "StudyEJB3DAO", "name": "getByAccForUser", "signature": "Study getByAccForUser(String acc, String userName)", "start_line": 3, "modifiers": "public", "params": [{"name": "acc", "type": "String"}, {"name": "userName", "type": "String"}], "return_type": "Study"}, "class_info": {"name": "StudyEJB3DAO",... |
1156021_8 | class PermissionManager {
public void setStudyOwners(CommandLine cmdl) {
String specs[] = cmdl.getOptionValues("o");
if (specs == null) {
return;
}
for (String spec : specs) {
setStudyOwners(spec);
}
}
public PermissionManager(EntityManager ... | Person user = createTestUser();
session.clear();
user.setId(null);
user.setUserName("zakmck1");
createTestUser(user);
session.clear();
user.setId(null);
user.setUserName("zakmck2");
createTestUser(user);
session.clear();
SimplePi... | [FOCAL] public void PermissionManager.setStudyOwners(CommandLine cmdl)
[CLASS] class PermissionManager
[METRICS] loc=9 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] void setStudyOwners(String spec)
[CALLS-EXTERNAL] CommandLine.getOptionValues/1
[PATH1] if(specs == null)=F -> foreach(String spec ... | /* static context
[FOCAL] public void PermissionManager.setStudyOwners(CommandLine cmdl)
[PATH1] if(specs == null)=F -> foreach(String spec : specs)=T -> exit loop
[PATH2] if(specs == null)=T -> return
[PATH3] if(specs == null)=F -> foreach(String spec : specs)=F
[INPUTS] branches=cmdl | result=-
[COLLABORATORS] param ... | /* static context
[FOCAL] public void PermissionManager.setStudyOwners(CommandLine cmdl)
[PATH1] if(specs == null)=F -> foreach(String spec : specs)=T -> exit loop
[PATH2] if(specs == null)=T -> return
[PATH3] if(specs == null)=F -> foreach(String spec : specs)=F
[INPUTS] branches=cmdl | result=-
[COLLABORATORS] param ... | true | ok | {"focal": {"class": "PermissionManager", "name": "setStudyOwners", "signature": "void setStudyOwners(CommandLine cmdl)", "start_line": 3, "modifiers": "public", "params": [{"name": "cmdl", "type": "CommandLine"}], "return_type": "void"}, "class_info": {"name": "PermissionManager", "kind": "class", "modifiers": "", "sup... |
1158118_0 | class DashOTransformer implements Transformer {
public static String decrypt(String input) {
if (isEmpty(input)) {
return input;
}
char[] inputChars = input.toCharArray();
int length = inputChars.length;
char[] inputCharsCopy = new char[length];
int j =... | final String outputActual = DashOTransformer.decrypt(input);
assertEquals(outputActual, outputExpected);
}
} | [FOCAL] public static String DashOTransformer.decrypt(String input)
[CLASS] class DashOTransformer implements Transformer
[METRICS] loc=21 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] boolean isEmpty(CharSequence cs)
[CALLS-EXTERNAL] String.toCharArray/0
[NEW] String
[PATH1] if(isEmpty(input))=... | /* static context
[FOCAL] public static String DashOTransformer.decrypt(String input)
[PATH1] if(isEmpty(input))=F -> while(j < length)=T -> exit loop -> return new String(inputCharsCopy)
[PATH2] if(isEmpty(input))=T -> return input
[PATH3] if(isEmpty(input))=F -> while(j < length)=F -> return new String(inputCharsCopy... | /* static context
[FOCAL] public static String DashOTransformer.decrypt(String input)
[PATH1] if(isEmpty(input))=F -> while(j < length)=T -> exit loop -> return new String(inputCharsCopy)
[PATH2] if(isEmpty(input))=T -> return input
[PATH3] if(isEmpty(input))=F -> while(j < length)=F -> return new String(inputCharsCopy... | true | ok | {"focal": {"class": "DashOTransformer", "name": "decrypt", "signature": "String decrypt(String input)", "start_line": 3, "modifiers": "public static", "params": [{"name": "input", "type": "String"}], "return_type": "String"}, "class_info": {"name": "DashOTransformer", "kind": "class", "modifiers": "", "superclass": nul... |
1158315_44 | class LocationEnhancementEngine extends AbstractEnhancementEngine<IOException,RuntimeException> implements EnhancementEngine, ServiceProperties {
@Override
public void computeEnhancements(ContentItem ci) throws EngineException {
IRI contentItemId = ci.getUri();
Graph graph = ci.getMetadata();
... | //create a content item
ContentItem ci = getContentItem("urn:org.apache:stanbol.enhancer:text:content-item:person", CONTEXT);
//add three text annotations to be consumed by this test
getTextAnnotation(ci, PERSON, CONTEXT, DBPEDIA_PERSON);
getTextAnnotation(ci, ORGANISATION, CONTE... | [FOCAL] @Override public void LocationEnhancementEngine.computeEnhancements(ContentItem ci)
[CLASS] class LocationEnhancementEngine extends AbstractEnhancementEngine<IOException,RuntimeException> implements EnhancementEngine, ServiceProperties
[METRICS] loc=117 cc=17 branches=10 loops=4 returns=0 throws=1 nesting=7
[CA... | class LocationEnhancementEngine extends AbstractEnhancementEngine<IOException,RuntimeException> implements EnhancementEngine, ServiceProperties {
@Override
public void computeEnhancements(ContentItem ci) throws EngineException {
IRI contentItemId = ci.getUri();
Graph graph = ci.getMetadata();
... | false | ok | {"focal": {"class": "LocationEnhancementEngine", "name": "computeEnhancements", "signature": "void computeEnhancements(ContentItem ci) throws EngineException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "ci", "type": "ContentItem"}], "return_type": "void"}, "class_info": {"name": "LocationEnh... | |
1161604_0 | class MulgaraConnector extends TriplestoreConnector {
@Override
public TriplestoreReader getReader() {
if (m_reader == null){
try{
open();
}
catch(TrippiException e){
logger.error(e.toString(),e);
}
}
return m_reader;
}
@Override public void close();
@Override public GraphElementFactory... | TriplestoreReader reader = _connector.getReader();
assertEquals(0, reader.countTriples(null, null, null, -1));
}
} | [FOCAL] @Override public TriplestoreReader MulgaraConnector.getReader()
[CLASS] class MulgaraConnector extends TriplestoreConnector
[METRICS] loc=12 cc=3 branches=1 loops=0 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] void open()
[CALLS-EXTERNAL] logger.error/2, TrippiException.toString/0
[EXCEPTIONS] catches TrippiEx... | /* static context
[FOCAL] @Override public TriplestoreReader MulgaraConnector.getReader()
[PATH1] if(m_reader == null)=T -> try-body throws -> return m_reader
[PATH2] if(m_reader == null)=F -> return m_reader
[EXCEPTIONS] catches TrippiException e
[CALLS-INTERNAL] void open()
[CALLS-EXTERNAL] logger.error/2, TrippiExce... | /* static context
[FOCAL] @Override public TriplestoreReader MulgaraConnector.getReader()
[PATH1] if(m_reader == null)=T -> try-body throws -> return m_reader
[PATH2] if(m_reader == null)=F -> return m_reader
[EXCEPTIONS] catches TrippiException e
[CALLS-INTERNAL] void open()
[CALLS-EXTERNAL] logger.error/2, TrippiExce... | true | ok | {"focal": {"class": "MulgaraConnector", "name": "getReader", "signature": "TriplestoreReader getReader()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "TriplestoreReader"}, "class_info": {"name": "MulgaraConnector", "kind": "class", "modifiers": "", "superclass": "TriplestoreConnector... |
1163806_197 | class CheckoutAction {
static String determineCheckoutPath(final FilePath workspacePath, final String localFolder) {
final FilePath combinedPath = new FilePath(workspacePath, localFolder);
final String result = combinedPath.getRemote();
return result;
}
public CheckoutAction(Strin... | final VirtualChannel vc = mock(VirtualChannel.class);
final String nixPath = "/opt/.jenkins/jobs/tfs-plugin/workspace";
final FilePath workspacePath = new FilePath(vc, nixPath);
final String actual = CheckoutAction.determineCheckoutPath(workspacePath, "../files");
Assert.assert... | [FOCAL] static String CheckoutAction.determineCheckoutPath(FilePath workspacePath, String localFolder)
[CLASS] class CheckoutAction
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] FilePath.getRemote/0
[NEW] FilePath
[INPUTS] branches=- | result=localFolder, workspacePath
[DATAFLOW]... | /* static context
[FOCAL] static String CheckoutAction.determineCheckoutPath(FilePath workspacePath, String localFolder)
[INPUTS] branches=- | result=localFolder, workspacePath
[NEW] FilePath
[CALLS-EXTERNAL] FilePath.getRemote/0
*/
| /* static context
[FOCAL] static String CheckoutAction.determineCheckoutPath(FilePath workspacePath, String localFolder)
[INPUTS] branches=- | result=localFolder, workspacePath
[NEW] FilePath
[CALLS-EXTERNAL] FilePath.getRemote/0
*/
class CheckoutAction {
static String determineCheckoutPath(final FilePath workspac... | true | ok | {"focal": {"class": "CheckoutAction", "name": "determineCheckoutPath", "signature": "String determineCheckoutPath(FilePath workspacePath, String localFolder)", "start_line": 3, "modifiers": "static", "params": [{"name": "workspacePath", "type": "FilePath"}, {"name": "localFolder", "type": "String"}], "return_type": "St... |
1164965_50 | class WebClassesFinder extends AbstractClassFinder {
public WebClassesFinder(ServletContext servletContext, ClassLoader classLoader, PackageFilter packageFilter)
{
super(servletContext, classLoader, packageFilter);
}
public WebClassesFinder(ServletContext servletContext, ClassLoader classLoader, Pa... |
// URLs of simulated directories and files
URL classesUrl = new URL("file:/somewhere/WEB-INF/classes/");
URL packageUrl = new URL("file:/somewhere/WEB-INF/classes/package/");
URL classUrl = new URL("file:/somewhere/WEB-INF/classes/package/TestClass.class");
// Contents of directories
... | [FOCAL] public WebClassesFinder.WebClassesFinder(ServletContext servletContext, ClassLoader classLoader, PackageFilter packageFilter)
[CLASS] class WebClassesFinder extends AbstractClassFinder
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[DATAFLOW] classLoader@param->L3; packageFilter@param->L3;... | /* static context
[FOCAL] public WebClassesFinder.WebClassesFinder(ServletContext servletContext, ClassLoader classLoader, PackageFilter packageFilter)
*/
| /* static context
[FOCAL] public WebClassesFinder.WebClassesFinder(ServletContext servletContext, ClassLoader classLoader, PackageFilter packageFilter)
*/
class WebClassesFinder extends AbstractClassFinder {
public WebClassesFinder(ServletContext servletContext, ClassLoader classLoader, PackageFilter packageFilter)... | true | ok | {"focal": {"class": "WebClassesFinder", "name": "WebClassesFinder", "signature": "WebClassesFinder(ServletContext servletContext, ClassLoader classLoader, PackageFilter packageFilter)", "start_line": 3, "modifiers": "public", "params": [{"name": "servletContext", "type": "ServletContext"}, {"name": "classLoader", "type... |
1165813_0 | class SSHPublicKeyExtractor {
public static String extract(final String pem, final String passPhrase) throws IOException {
final Object priv = PEMDecoder.decode(pem.toCharArray(), passPhrase);
if (priv instanceof RSAPrivateKey) {
return "ssh-rsa " + DatatypeConverter.printBase64Binary(R... | String pub = SSHPublicKeyExtractor.extract(RSA_PEM, null);
assertEquals(RSA_EXPECTED, pub);
}
} | [FOCAL] public static String SSHPublicKeyExtractor.extract(String pem, String passPhrase)
[CLASS] class SSHPublicKeyExtractor
[METRICS] loc=10 cc=3 branches=2 loops=0 returns=2 throws=1 nesting=1
[CALLS-EXTERNAL] PEMDecoder.decode/2, String.toCharArray/0, DatatypeConverter.printBase64Binary/1, RSASHA1Verify.encodeSSHRS... | /* static context
[FOCAL] public static String SSHPublicKeyExtractor.extract(String pem, String passPhrase)
[THROWS-WHEN] IOException when !(priv instanceof RSAPrivateKey) && !(priv instanceof DSAPrivateKey)
[PATH1] if(priv instanceof RSAPrivateKey)=F -> if(priv instanceof DSAPrivateKey)=T -> return "ssh-dss " + Dataty... | /* static context
[FOCAL] public static String SSHPublicKeyExtractor.extract(String pem, String passPhrase)
[THROWS-WHEN] IOException when !(priv instanceof RSAPrivateKey) && !(priv instanceof DSAPrivateKey)
[PATH1] if(priv instanceof RSAPrivateKey)=F -> if(priv instanceof DSAPrivateKey)=T -> return "ssh-dss " + Dataty... | true | ok | {"focal": {"class": "SSHPublicKeyExtractor", "name": "extract", "signature": "String extract(String pem, String passPhrase) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "pem", "type": "String"}, {"name": "passPhrase", "type": "String"}], "return_type": "String"}, "class_info":... |
1167439_0 | class CamelConsumerEndpoint extends ConsumerEndpoint implements AsyncProcessor {
public void process(final MessageExchange messageExchange) throws Exception {
final ContinuationData data = continuations.remove(messageExchange.getExchangeId());
if (data == null) {
logger.error("Unexpect... | // sending a message to start the producers and create the external endpoint
client.sendBody("direct:a", "<hello>world</hello>");
String endpointName =
jbiContainer.getRegistry().getExternalEndpointsForService(CamelConsumerEndpoint.SERVICE_NAME)[0].getEndpointName();
... | [FOCAL] public void CamelConsumerEndpoint.process(MessageExchange messageExchange)
[CLASS] class CamelConsumerEndpoint extends ConsumerEndpoint implements AsyncProcessor
[METRICS] loc=15 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] void processReponse(MessageExchange messageExchange, Exchange e... | /* static context
[FOCAL] public void CamelConsumerEndpoint.process(MessageExchange messageExchange)
[PATH1] if(data == null)=T
[PATH2] if(data == null)=F
[INPUTS] branches=messageExchange | result=-
[COLLABORATORS] field continuations remove/1; param messageExchange:MessageExchange getExchangeId/0; field binding runWi... | /* static context
[FOCAL] public void CamelConsumerEndpoint.process(MessageExchange messageExchange)
[PATH1] if(data == null)=T
[PATH2] if(data == null)=F
[INPUTS] branches=messageExchange | result=-
[COLLABORATORS] field continuations remove/1; param messageExchange:MessageExchange getExchangeId/0; field binding runWi... | true | ok | {"focal": {"class": "CamelConsumerEndpoint", "name": "process", "signature": "void process(MessageExchange messageExchange) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "messageExchange", "type": "MessageExchange"}], "return_type": "void"}, "class_info": {"name": "CamelConsumerEndpoint... |
1169309_3 | class FindBugsPlugin extends Plugin {
public static boolean isFindBugs2x(final MojoExecution mojoExecution) {
try {
String[] versions = StringUtils.split(mojoExecution.getVersion(), ".");
if (versions.length > 1) {
int major = Integer.parseInt(versions[0]);
... | MojoExecution execution = mock(MojoExecution.class);
when(execution.getVersion()).thenThrow(new NoSuchMethodError());
assertFalse(WRONG_MAVEN_DETECTION, FindBugsPlugin.isFindBugs2x(execution));
}
} | [FOCAL] public static boolean FindBugsPlugin.isFindBugs2x(MojoExecution mojoExecution)
[CLASS] class FindBugsPlugin extends Plugin
[METRICS] loc=14 cc=3 branches=1 loops=0 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] StringUtils.split/2, MojoExecution.getVersion/0, Integer.parseInt/1
[EXCEPTIONS] catches Throwable exc... | /* static context
[FOCAL] public static boolean FindBugsPlugin.isFindBugs2x(MojoExecution mojoExecution)
[PATH1] try-body throws -> return false
[PATH2] if(versions.length > 1)=T -> return major > 2 || (major == 2 && minor >= 4)
[PATH3] if(versions.length > 1)=F -> return false
[INPUTS] branches=mojoExecution | result=... | /* static context
[FOCAL] public static boolean FindBugsPlugin.isFindBugs2x(MojoExecution mojoExecution)
[PATH1] try-body throws -> return false
[PATH2] if(versions.length > 1)=T -> return major > 2 || (major == 2 && minor >= 4)
[PATH3] if(versions.length > 1)=F -> return false
[INPUTS] branches=mojoExecution | result=... | true | ok | {"focal": {"class": "FindBugsPlugin", "name": "isFindBugs2x", "signature": "boolean isFindBugs2x(MojoExecution mojoExecution)", "start_line": 3, "modifiers": "public static", "params": [{"name": "mojoExecution", "type": "MojoExecution"}], "return_type": "boolean"}, "class_info": {"name": "FindBugsPlugin", "kind": "clas... |
1171506_0 | class EventBus {
public void subscribe(Class<? extends Subscriber> subscriber) {
try {
monitor.lock();
if (subscriber.isAnnotationPresent(InterestedEvent.class)) {
InterestedEvent ann = subscriber.getAnnotation(InterestedEvent.class);
for (Class<? extends Event> interestedEvent : ann.events()) {
... | replay(this.consumerOne, this.consumerTwo, this.publisher);
assertFalse(bus.subscribers.containsKey(EventOne.class));
assertFalse(bus.subscribers.containsKey(EventTwo.class));
bus.subscribe(SubscriberOne.class);
bus.subscribe(SubscriberTwo.class);
assertTrue(bus.subscribers.containsKey(EventOne.class));
... | [FOCAL] public void EventBus.subscribe(Class<? extends Subscriber> subscriber)
[CLASS] class EventBus
[METRICS] loc=16 cc=5 branches=2 loops=1 returns=0 throws=0 nesting=4
[CALLS-EXTERNAL] monitor.lock/0, Class<? extends Subscriber>.isAnnotationPresent/1, Class<? extends Subscriber>.getAnnotation/1, InterestedEvent.eve... | /* static context
[FOCAL] public void EventBus.subscribe(Class<? extends Subscriber> subscriber)
[PATH1] if(subscriber.isAnnotationPresent(InterestedEvent.class))=T -> foreach(Class<? extends Event> interestedEvent : ann.events())=T -> if(!subscribers.containsKey(interestedEvent))=T -> exit loop
[PATH2] if(subscriber.i... | /* static context
[FOCAL] public void EventBus.subscribe(Class<? extends Subscriber> subscriber)
[PATH1] if(subscriber.isAnnotationPresent(InterestedEvent.class))=T -> foreach(Class<? extends Event> interestedEvent : ann.events())=T -> if(!subscribers.containsKey(interestedEvent))=T -> exit loop
[PATH2] if(subscriber.i... | true | ok | {"focal": {"class": "EventBus", "name": "subscribe", "signature": "void subscribe(Class<? extends Subscriber> subscriber)", "start_line": 3, "modifiers": "public", "params": [{"name": "subscriber", "type": "Class<? extends Subscriber>"}], "return_type": "void"}, "class_info": {"name": "EventBus", "kind": "class", "modi... |
1176274_2 | class TeleportPlayerJob extends BukkitRunnable {
boolean hasPlayerMoved() {
final double MAX_MOVE_TOLERANCE = 1.5;
return distance3D(player.getLocation(), originalLocation) > MAX_MOVE_TOLERANCE;
}
public TeleportPlayerJob(Player player, Location location);
@Override public void run();
boolean hasPlayerTak... | when(player.getLocation()).thenReturn(new Location(world, 5, 1, 3));
assertTrue(job.hasPlayerMoved());
}
} | [FOCAL] boolean TeleportPlayerJob.hasPlayerMoved()
[CLASS] class TeleportPlayerJob extends BukkitRunnable
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] double distance3D(Location pos1, Location pos2)
[CALLS-EXTERNAL] Player.getLocation/0
[FIELDS] read=player:Player
[INPUTS] branc... | /* static context
[FOCAL] boolean TeleportPlayerJob.hasPlayerMoved()
[INPUTS] branches=- | result=player
[COLLABORATORS] field player:Player getLocation/0
[CALLS-INTERNAL] double distance3D(Location pos1, Location pos2)
[FIELDS] read=player:Player
[CALLS-EXTERNAL] Player.getLocation/0
*/
| /* static context
[FOCAL] boolean TeleportPlayerJob.hasPlayerMoved()
[INPUTS] branches=- | result=player
[COLLABORATORS] field player:Player getLocation/0
[CALLS-INTERNAL] double distance3D(Location pos1, Location pos2)
[FIELDS] read=player:Player
[CALLS-EXTERNAL] Player.getLocation/0
*/
class TeleportPlayerJob extends... | true | ok | {"focal": {"class": "TeleportPlayerJob", "name": "hasPlayerMoved", "signature": "boolean hasPlayerMoved()", "start_line": 3, "modifiers": "", "params": [], "return_type": "boolean"}, "class_info": {"name": "TeleportPlayerJob", "kind": "class", "modifiers": "", "superclass": "BukkitRunnable", "interfaces": null, "fields... |
1181284_260 | class ScanDescriptorForHostClassesStage implements TransformStage {
@SuppressWarnings("unchecked")
public void execute(TransformContext context) throws PluginTransformationException {
XPath xpath = DocumentHelper.createXPath("//@class");
List<Attribute> attributes = xpath.selectNodes(context.ge... | when(registration.getMainInterfaceClasses()).thenReturn(new Class<?>[]{SomeInterface.class});
List<HostComponentRegistration> registrations = new ArrayList<HostComponentRegistration>(1);
registrations.add(registration);
final File plugin = new PluginJarBuilder("testUpgradeOfBundledPlugi... | [FOCAL] @SuppressWarnings("unchecked") public void ScanDescriptorForHostClassesStage.execute(TransformContext context)
[CLASS] class ScanDescriptorForHostClassesStage implements TransformStage
[METRICS] loc=27 cc=5 branches=3 loops=1 returns=0 throws=0 nesting=4
[CALLS-INTERNAL] void scanForHostComponents(TransformCont... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public void ScanDescriptorForHostClassesStage.execute(TransformContext context)
[PATH1] foreach(Attribute attr : attributes)=T -> if(dotpos > -1)=T -> if(context.getSystemExports().isExported(pkg))=T -> if(context.getPluginArtifact().doesResourceExist(pkgPath))=T... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public void ScanDescriptorForHostClassesStage.execute(TransformContext context)
[PATH1] foreach(Attribute attr : attributes)=T -> if(dotpos > -1)=T -> if(context.getSystemExports().isExported(pkg))=T -> if(context.getPluginArtifact().doesResourceExist(pkgPath))=T... | true | ok | {"focal": {"class": "ScanDescriptorForHostClassesStage", "name": "execute", "signature": "void execute(TransformContext context) throws PluginTransformationException", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public", "params": [{"name": "context", "type": "TransformContext"}], "return_type": "vo... |
1184582_8 | class ConverterUtils {
public String parseOutput(String right) {
return parseOutput(null, right);
}
public ConverterUtils(Spec spec);
private void addType(Spec spec, String name, String type);
public String parseOutput(String left, String right);
private String getStringRightSide(Str... | Spec spec = buildSpec();
spec.setOutput("Results");
ConverterUtils converter = new ConverterUtils(spec);
assertEquals("output.setAverage((math.getNumber() + physics.getNumber() + biology.getNumber()) / 3);", converter.parseOutput("average", "($math + $physics + $biology) / 3"));
... | [FOCAL] public String ConverterUtils.parseOutput(String right)
[CLASS] class ConverterUtils
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String parseOutput(String left, String right)
[INPUTS] branches=- | result=right
[DATAFLOW] right@param->L2
[CLASS-MEMBERS] ConverterUtils(Spe... | /* static context
[FOCAL] public String ConverterUtils.parseOutput(String right)
[INPUTS] branches=- | result=right
[CALLS-INTERNAL] String parseOutput(String left, String right)
*/
| /* static context
[FOCAL] public String ConverterUtils.parseOutput(String right)
[INPUTS] branches=- | result=right
[CALLS-INTERNAL] String parseOutput(String left, String right)
*/
class ConverterUtils {
public String parseOutput(String right) {
return parseOutput(null, right);
}
public Converte... | true | ok | {"focal": {"class": "ConverterUtils", "name": "parseOutput", "signature": "String parseOutput(String right)", "start_line": 3, "modifiers": "public", "params": [{"name": "right", "type": "String"}], "return_type": "String"}, "class_info": {"name": "ConverterUtils", "kind": "class", "modifiers": "", "superclass": null, ... |
1193862_8 | class IdeaProfileExporter extends ProfileExporter {
public void exportProfile(RulesProfile profile, Writer writer)
{
try {
appendXmlHeader(writer);
SortedMap<String, Rule> defaultRules = new TreeMap<String, Rule>(DefaultRules.get());
for (ActiveRule activeRule : pr... | RulesProfile profile = createSimpleProfile();
assertSimilar(exportProfile(profile), "simpleIdeaRulesToExport.xml");
}
} | [FOCAL] public void IdeaProfileExporter.exportProfile(RulesProfile profile, Writer writer)
[CLASS] class IdeaProfileExporter extends ProfileExporter
[METRICS] loc=29 cc=6 branches=2 loops=2 returns=0 throws=1 nesting=4
[CALLS-INTERNAL] void appendParameters(Writer writer, ActiveRule activeRule); void appendRule(Writer ... | /* static context
[FOCAL] public void IdeaProfileExporter.exportProfile(RulesProfile profile, Writer writer)
[THROWS-WHEN] SonarException when try-body throws
[PATH1] foreach(ActiveRule activeRule : profile.getActiveRulesByRepository(REPOSITORY_KEY))=T -> if(defaultRules.remove(rule.getKey()) == null || hasParameters)=... | /* static context
[FOCAL] public void IdeaProfileExporter.exportProfile(RulesProfile profile, Writer writer)
[THROWS-WHEN] SonarException when try-body throws
[PATH1] foreach(ActiveRule activeRule : profile.getActiveRulesByRepository(REPOSITORY_KEY))=T -> if(defaultRules.remove(rule.getKey()) == null || hasParameters)=... | true | ok | {"focal": {"class": "IdeaProfileExporter", "name": "exportProfile", "signature": "void exportProfile(RulesProfile profile, Writer writer)", "start_line": 3, "modifiers": "public", "params": [{"name": "profile", "type": "RulesProfile"}, {"name": "writer", "type": "Writer"}], "return_type": "void"}, "class_info": {"name"... |
1194243_15 | class XmlUtil {
public static void removeEntities(Reader reader, Writer writer)
throws IOException {
int curChar = -1;
StringBuffer ent = null;
if (reader == null) {
throw new IllegalArgumentException("null reader arg");
} else if (writer == null) {
... | try {
StringReader reader = new StringReader("&#;");
StringWriter writer = new StringWriter();
XmlUtil.removeEntities(reader, writer);
assertEquals("&#;", writer.toString());
} catch (Exception excep) {
fail("Unhandled exception: " + excep.getMessage());
}
}
} | [FOCAL] public static void XmlUtil.removeEntities(Reader reader, Writer writer)
[CLASS] class XmlUtil
[METRICS] loc=76 cc=16 branches=13 loops=1 returns=0 throws=2 nesting=9
[CALLS-EXTERNAL] Reader.read/0, StringBuffer.length/0, Writer.write/1, StringBuffer.toString/0, StringBuffer.setLength/1, StringBuffer.append/1, S... | /* static context
[FOCAL] public static void XmlUtil.removeEntities(Reader reader, Writer writer)
[THROWS-WHEN] IllegalArgumentException when reader == null
[THROWS-WHEN] IllegalArgumentException when !(reader == null) && writer == null
[PATH1] if(reader == null)=F -> if(writer == null)=F -> while((curChar = reader.rea... | /* static context
[FOCAL] public static void XmlUtil.removeEntities(Reader reader, Writer writer)
[THROWS-WHEN] IllegalArgumentException when reader == null
[THROWS-WHEN] IllegalArgumentException when !(reader == null) && writer == null
[PATH1] if(reader == null)=F -> if(writer == null)=F -> while((curChar = reader.rea... | true | ok | {"focal": {"class": "XmlUtil", "name": "removeEntities", "signature": "void removeEntities(Reader reader, Writer writer) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "reader", "type": "Reader"}, {"name": "writer", "type": "Writer"}], "return_type": "void"}, "class_info": {"nam... |
1195109_0 | class ListObject extends WeiboResponse implements java.io.Serializable {
public void setFullName(String fullName) {
this.fullName = fullName;
}
ListObject(Response res, Weibo weibo);
ListObject(Response res, Element elem, Weibo weibo);
ListObject(JSONObject json);
private void init(Response res, Elemen... | fail("Not yet implemented");
}
} | [FOCAL] public void ListObject.setFullName(String fullName)
[CLASS] class ListObject extends WeiboResponse implements java.io.Serializable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[FIELDS] write=fullName
[STATE] fullName via getFullName()
[DATAFLOW] fullName@param->L2
[CLASS-MEMBERS] ListObj... | /* static context
[FOCAL] public void ListObject.setFullName(String fullName)
[STATE] fullName via getFullName()
[FIELDS] write=fullName
*/
| /* static context
[FOCAL] public void ListObject.setFullName(String fullName)
[STATE] fullName via getFullName()
[FIELDS] write=fullName
*/
class ListObject extends WeiboResponse implements java.io.Serializable {
public void setFullName(String fullName) {
this.fullName = fullName;
}
ListObject(Response res, We... | true | ok | {"focal": {"class": "ListObject", "name": "setFullName", "signature": "void setFullName(String fullName)", "start_line": 3, "modifiers": "public", "params": [{"name": "fullName", "type": "String"}], "return_type": "void"}, "class_info": {"name": "ListObject", "kind": "class", "modifiers": "", "superclass": "WeiboRespon... |
1204957_0 | class JsonParser implements Parser {
@SuppressWarnings("ConstantConditions")
@Override
public List<MovieInfo> parseMovieInfo(String content, int maxCount, int posterCount, int backdropCount) throws ParseException {
// Minus
if (posterCount < 0) {
posterCount = Integer.MAX_VALUE;... | // Mock Movie
MovieFactory movieFactory = mock(MovieFactory.class);
MovieInfo movieInfo = mock(MovieInfo.class);
MovieImage movieImage = mock(MovieImage.class);
when(movieFactory.createMovieInfo()).thenReturn(movieInfo);
when(movieFactory.createMovieImage()).thenReturn(mo... | [FOCAL] @SuppressWarnings("ConstantConditions") @Override public List<MovieInfo> JsonParser.parseMovieInfo(String content, int maxCount, int posterCount, int backdropCount)
[CLASS] class JsonParser implements Parser
[METRICS] loc=112 cc=14 branches=7 loops=3 returns=2 throws=1 nesting=5
[CALLS-EXTERNAL] this.mapper.rea... | class JsonParser implements Parser {
@SuppressWarnings("ConstantConditions")
@Override
public List<MovieInfo> parseMovieInfo(String content, int maxCount, int posterCount, int backdropCount) throws ParseException {
// Minus
if (posterCount < 0) {
posterCount = Integer.MAX_VALUE;... | false | ok | {"focal": {"class": "JsonParser", "name": "parseMovieInfo", "signature": "List<MovieInfo> parseMovieInfo(String content, int maxCount, int posterCount, int backdropCount) throws ParseException", "start_line": 3, "modifiers": "@SuppressWarnings(\"ConstantConditions\") @Override public", "params": [{"name": "content", "t... | |
1205446_0 | class Utils {
public static long calculateNotifTime(Long nowMillis, int hourToNotify) {
DateTime now = new DateTime(nowMillis);
DateTime timeToNotify = new DateTime(nowMillis);
timeToNotify = timeToNotify.withHourOfDay(hourToNotify);
if (timeToNotify.isBefore(now)) {
tim... | DateTime time = new DateTime();
time = time.withHourOfDay(8);
DateTime notifyTime = new DateTime(Utils.calculateNotifTime(time.getMillis(), 7));
assertEquals(1000 * 60 * 60 * 23, notifyTime.getMillis() - time.getMillis());
notifyTime = new DateTime(Utils.calculateNotifTime(time... | [FOCAL] public static long Utils.calculateNotifTime(Long nowMillis, int hourToNotify)
[CLASS] class Utils
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] DateTime.withHourOfDay/1, DateTime.isBefore/1, DateTime.plusDays/1, DateTime.getMillis/0
[NEW] DateTime
[PATH1] if(timeToNotify.... | /* static context
[FOCAL] public static long Utils.calculateNotifTime(Long nowMillis, int hourToNotify)
[PATH1] if(timeToNotify.isBefore(now))=T -> return timeToNotify.getMillis()
[PATH2] if(timeToNotify.isBefore(now))=F -> return timeToNotify.getMillis()
[INPUTS] branches=hourToNotify, nowMillis | result=hourToNotify,... | /* static context
[FOCAL] public static long Utils.calculateNotifTime(Long nowMillis, int hourToNotify)
[PATH1] if(timeToNotify.isBefore(now))=T -> return timeToNotify.getMillis()
[PATH2] if(timeToNotify.isBefore(now))=F -> return timeToNotify.getMillis()
[INPUTS] branches=hourToNotify, nowMillis | result=hourToNotify,... | true | ok | {"focal": {"class": "Utils", "name": "calculateNotifTime", "signature": "long calculateNotifTime(Long nowMillis, int hourToNotify)", "start_line": 3, "modifiers": "public static", "params": [{"name": "nowMillis", "type": "Long"}, {"name": "hourToNotify", "type": "int"}], "return_type": "long"}, "class_info": {"name": "... |
1205842_1 | class GraphTaskOperations implements TaskOperationsDefinition {
@Override
public List<String> getOperations(String state) {
List<String> operationsList = new ArrayList<String>();
for (OperationsDefinition def : this.definition) {
if (state.equals(def.getName())) {
if ((def.getTransitions() != null)) {
... | List<String> tasks = operations.getOperations("READY");
Assert.assertEquals(2, tasks.size());
Assert.assertTrue(tasks.contains("claim"));
Assert.assertTrue(tasks.contains("suspend"));
}
} | [FOCAL] @Override public List<String> GraphTaskOperations.getOperations(String state)
[CLASS] class GraphTaskOperations implements TaskOperationsDefinition
[METRICS] loc=15 cc=5 branches=2 loops=2 returns=1 throws=0 nesting=4
[CALLS-EXTERNAL] String.equals/1, OperationsDefinition.getName/0, OperationsDefinition.getTran... | /* static context
[FOCAL] @Override public List<String> GraphTaskOperations.getOperations(String state)
[PATH1] foreach(OperationsDefinition def : this.definition)=T -> if(state.equals(def.getName()))=T -> if((def.getTransitions() != null))=T -> foreach(DestinationDefinition operations : def .getTransitions())=F -> exi... | /* static context
[FOCAL] @Override public List<String> GraphTaskOperations.getOperations(String state)
[PATH1] foreach(OperationsDefinition def : this.definition)=T -> if(state.equals(def.getName()))=T -> if((def.getTransitions() != null))=T -> foreach(DestinationDefinition operations : def .getTransitions())=F -> exi... | true | ok | {"focal": {"class": "GraphTaskOperations", "name": "getOperations", "signature": "List<String> getOperations(String state)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "state", "type": "String"}], "return_type": "List<String>"}, "class_info": {"name": "GraphTaskOperations", "kind": "class", "... |
1206855_188 | class JQueryUiTooltip extends JQueryDurableAjaxBehavior {
public JQueryUiTooltip setPosition(JsOption... options)
{
this.widget.setOption("position", asString(options));
return this;
}
public JQueryUiTooltip(JQueryResourceReference customJQueryUiTooltipJs);
public JQueryUiTooltip(String componentSelector, ... | JsOption my = new JsOption("my", "'left+15 center'");
JsOption at = new JsOption("at", "'right center'");
tooltip.setPosition(my, at);
verify(widget).setOption("position", "{my:'left+15 center',at:'right center'}");
}
} | [FOCAL] public JQueryUiTooltip JQueryUiTooltip.setPosition(JsOption... options)
[CLASS] class JQueryUiTooltip extends JQueryDurableAjaxBehavior
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String asString(JsOption... options)
[CALLS-EXTERNAL] JQueryUiWidget.setOption/2
[FIELDS] ... | /* static context
[FOCAL] public JQueryUiTooltip JQueryUiTooltip.setPosition(JsOption... options)
[COLLABORATORS] field widget:JQueryUiWidget setOption/2
[CALLS-INTERNAL] String asString(JsOption... options)
[FIELDS] read=widget:JQueryUiWidget
[CALLS-EXTERNAL] JQueryUiWidget.setOption/2
*/
| /* static context
[FOCAL] public JQueryUiTooltip JQueryUiTooltip.setPosition(JsOption... options)
[COLLABORATORS] field widget:JQueryUiWidget setOption/2
[CALLS-INTERNAL] String asString(JsOption... options)
[FIELDS] read=widget:JQueryUiWidget
[CALLS-EXTERNAL] JQueryUiWidget.setOption/2
*/
class JQueryUiTooltip extends... | true | ok | {"focal": {"class": "JQueryUiTooltip", "name": "setPosition", "signature": "JQueryUiTooltip setPosition(JsOption... options)", "start_line": 3, "modifiers": "public", "params": [{"name": "options", "type": "JsOption..."}], "return_type": "JQueryUiTooltip"}, "class_info": {"name": "JQueryUiTooltip", "kind": "class", "mo... |
1216286_1 | class QueryScriptEngine {
public void execute(String script) throws QueryScriptException {
try {
Context cx = Context.enter();
Scriptable scope = cx.initStandardObjects();
scope.put(ARAS_SCRIPT_ENGINE_CONTEXT, scope, arasCtx);
loadRhinoBinding(scope, cx);
... | final String query = "'x'='y'";
final String walkPredicate = "rdf:type";
ScriptEngineContext ctx = mock(ScriptEngineContext.class);
NodeSet nodeSet = mock(NodeSet.class);
when(ctx.query(anyString())).thenReturn(nodeSet);
when(nodeSet.walk(anyString())).thenReturn(nodeSe... | [FOCAL] public void QueryScriptEngine.execute(String script)
[CLASS] class QueryScriptEngine
[METRICS] loc=13 cc=2 branches=0 loops=0 returns=0 throws=1 nesting=1
[CALLS-INTERNAL] void loadRhinoBinding(Scriptable scope, Context cx)
[CALLS-EXTERNAL] Context.enter/0, Context.initStandardObjects/0, Scriptable.put/3, Conte... | /* static context
[FOCAL] public void QueryScriptEngine.execute(String script)
[THROWS-WHEN] QueryScriptException when try-body throws
[PATH1] try-body throws -> throw new QueryScriptException("Execution of query script failed.", e)
[EXCEPTIONS] declares QueryScriptException; throws QueryScriptException; catches Except... | /* static context
[FOCAL] public void QueryScriptEngine.execute(String script)
[THROWS-WHEN] QueryScriptException when try-body throws
[PATH1] try-body throws -> throw new QueryScriptException("Execution of query script failed.", e)
[EXCEPTIONS] declares QueryScriptException; throws QueryScriptException; catches Except... | true | ok | {"focal": {"class": "QueryScriptEngine", "name": "execute", "signature": "void execute(String script) throws QueryScriptException", "start_line": 3, "modifiers": "public", "params": [{"name": "script", "type": "String"}], "return_type": "void"}, "class_info": {"name": "QueryScriptEngine", "kind": "class", "modifiers": ... |
1228775_2 | class SpringApplicationBeanDefinitionParser extends AbstractSpringBeanDefinitionParser {
@Override
public Class<?> getBeanClass(Element element) {
return ApplicationDecorator.class;
}
@Override public void prepareInjection(Element element, BeanDefinitionBuilder bean);
}
class SpringApplicati... | SpringApplicationBeanDefinitionParser parserToTest = new SpringApplicationBeanDefinitionParser();
Class<?> beanClass = parserToTest.getBeanClass(null);
assertThat(beanClass, typeCompatibleWith(ApplicationDecorator.class));
}
} | [FOCAL] @Override public Class<?> SpringApplicationBeanDefinitionParser.getBeanClass(Element element)
[CLASS] class SpringApplicationBeanDefinitionParser extends AbstractSpringBeanDefinitionParser
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[INPUTS] branches=- | result=- | unused=element
[CLASS... | /* static context
[FOCAL] @Override public Class<?> SpringApplicationBeanDefinitionParser.getBeanClass(Element element)
[INPUTS] branches=- | result=- | unused=element
*/
| /* static context
[FOCAL] @Override public Class<?> SpringApplicationBeanDefinitionParser.getBeanClass(Element element)
[INPUTS] branches=- | result=- | unused=element
*/
class SpringApplicationBeanDefinitionParser extends AbstractSpringBeanDefinitionParser {
@Override
public Class<?> getBeanClass(Element elem... | true | ok | {"focal": {"class": "SpringApplicationBeanDefinitionParser", "name": "getBeanClass", "signature": "Class<?> getBeanClass(Element element)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "element", "type": "Element"}], "return_type": "Class<?>"}, "class_info": {"name": "SpringApplicationBeanDefin... |
1229527_2 | class BndUtils {
public static Properties parseInstructions( final String query )
throws MalformedURLException
{
final Properties instructions = new Properties();
if( query != null )
{
try
{
// just ignore for the moment and try out if we ... | Properties p = BndUtils.parseInstructions( "foo=bar&sing=sang&cheese=bacon" );
assertEquals( "bar", p.getProperty( "foo" ) );
assertEquals( "sang", p.getProperty( "sing" ) );
assertEquals( "bacon", p.getProperty( "cheese" ) );
}
} | [FOCAL] public static Properties BndUtils.parseInstructions(String query)
[CLASS] class BndUtils
[METRICS] loc=42 cc=6 branches=3 loops=1 returns=1 throws=1 nesting=5
[CALLS-INTERNAL] String verifyKey(String key); void throwAsMalformedURLException(String message, Exception cause)
[CALLS-EXTERNAL] String.split/1, segmen... | /* static context
[FOCAL] public static Properties BndUtils.parseInstructions(String query)
[PATH1] if(query != null)=T -> foreach(String segment : segments)=T -> if(segment.trim().length() > 0)=T -> if(matcher.matches())=T -> exit loop -> return instructions
[PATH2] if(query != null)=T -> foreach(String segment : segm... | /* static context
[FOCAL] public static Properties BndUtils.parseInstructions(String query)
[PATH1] if(query != null)=T -> foreach(String segment : segments)=T -> if(segment.trim().length() > 0)=T -> if(matcher.matches())=T -> exit loop -> return instructions
[PATH2] if(query != null)=T -> foreach(String segment : segm... | true | ok | {"focal": {"class": "BndUtils", "name": "parseInstructions", "signature": "Properties parseInstructions(String query) throws MalformedURLException", "start_line": 3, "modifiers": "public static", "params": [{"name": "query", "type": "String"}], "return_type": "Properties"}, "class_info": {"name": "BndUtils", "kind": "c... |
1231687_1 | class BitMask {
public boolean isBitSet(int bit) {
long bitMask = Long.rotateLeft(1, bit);
long result = this.bitMaskValue & bitMask;
if (result != 0) {
return true;
}
return false;
}
public BitMask();
public BitMask(long currentValue);
public... | for (int bitNumber = 0; bitNumber < 64; bitNumber++) {
long bitMask = Long.rotateLeft(1, bitNumber);
BitMask bm = new BitMask(bitMask);
assertEquals(true, bm.isBitSet(bitNumber));
}
}
} | [FOCAL] public boolean BitMask.isBitSet(int bit)
[CLASS] class BitMask
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] Long.rotateLeft/2
[FIELDS] read=bitMaskValue
[PATH1] if(result != 0)=T -> return true
[PATH2] if(result != 0)=F -> return false
[INPUTS] branches=bit | result=-
[D... | /* static context
[FOCAL] public boolean BitMask.isBitSet(int bit)
[PATH1] if(result != 0)=T -> return true
[PATH2] if(result != 0)=F -> return false
[INPUTS] branches=bit | result=-
[FIELDS] read=bitMaskValue
[CALLS-EXTERNAL] Long.rotateLeft/2
*/
| /* static context
[FOCAL] public boolean BitMask.isBitSet(int bit)
[PATH1] if(result != 0)=T -> return true
[PATH2] if(result != 0)=F -> return false
[INPUTS] branches=bit | result=-
[FIELDS] read=bitMaskValue
[CALLS-EXTERNAL] Long.rotateLeft/2
*/
class BitMask {
public boolean isBitSet(int bit) {
long bit... | true | ok | {"focal": {"class": "BitMask", "name": "isBitSet", "signature": "boolean isBitSet(int bit)", "start_line": 3, "modifiers": "public", "params": [{"name": "bit", "type": "int"}], "return_type": "boolean"}, "class_info": {"name": "BitMask", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields"... |
1251091_0 | class UrgBinner implements Binner {
public List<Float> getBinned()
{
if (last == -1)
return null;
return new ImmutableList.Builder<Float>().addAll(binned).build();
}
public UrgBinner(String channel, int bins, double fov);
public void setLidar(Lidar lidar);
public ... | for (int i = 1; i < 10; ++i)
{
UrgBinner ub1 = new UrgBinner("URG_RANGE", i, Math.PI);
assertEquals(ub1.getBinned().size(), i);
}
}
} | [FOCAL] public List<Float> UrgBinner.getBinned()
[CLASS] class UrgBinner implements Binner
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] new ImmutableList.Builder<Float>().addAll(binned).build/0, new ImmutableList.Builder<Float>().addAll/1
[NEW] ImmutableList.Builder<Float>
[PATH... | /* static context
[FOCAL] public List<Float> UrgBinner.getBinned()
[PATH1] if(last == -1)=T -> return null
[PATH2] if(last == -1)=F -> return new ImmutableList.Builder<Float>().addAll(binned).build()
[NEW] ImmutableList.Builder<Float>
[CALLS-EXTERNAL] new ImmutableList.Builder<Float>().addAll(binned).build/0, new Immut... | /* static context
[FOCAL] public List<Float> UrgBinner.getBinned()
[PATH1] if(last == -1)=T -> return null
[PATH2] if(last == -1)=F -> return new ImmutableList.Builder<Float>().addAll(binned).build()
[NEW] ImmutableList.Builder<Float>
[CALLS-EXTERNAL] new ImmutableList.Builder<Float>().addAll(binned).build/0, new Immut... | true | ok | {"focal": {"class": "UrgBinner", "name": "getBinned", "signature": "List<Float> getBinned()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<Float>"}, "class_info": {"name": "UrgBinner", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Binner", "fields": [], "members": [{... |
1251538_7 | class AbstractEnvironment implements EnvironmentConnector,
EnvironmentServiceProvider, TimeDriven {
@SuppressWarnings("unchecked")
@Override
public <T extends EnvironmentService> T getEnvironmentService(Class<T> type)
throws UnavailableServiceException {
// force NullPointerException if type is null
type.t... | final TestAbstractEnvironment envUnderTest = new TestAbstractEnvironment(mockStorage);
try {
@SuppressWarnings("unused")
final EnvironmentService envService = envUnderTest.getEnvironmentService(null);
fail("No exception thrown by AbstractEnvironment.getEnvironmentService(null), NullPointerException expecte... | [FOCAL] @SuppressWarnings("unchecked") @Override public T AbstractEnvironment.getEnvironmentService(Class<T> type)
[CLASS] class AbstractEnvironment implements EnvironmentConnector, EnvironmentServiceProvider, TimeDriven
[METRICS] loc=14 cc=3 branches=1 loops=1 returns=1 throws=1 nesting=2
[CALLS-EXTERNAL] Class<T>.toS... | /* static context
[FOCAL] @SuppressWarnings("unchecked") @Override public T AbstractEnvironment.getEnvironmentService(Class<T> type)
[THROWS-WHEN] UnavailableServiceException when foreach(EnvironmentService s : this.globalEnvironmentServices)=T && !type.isInstance(s)
[THROWS-WHEN] UnavailableServiceException when forea... | /* static context
[FOCAL] @SuppressWarnings("unchecked") @Override public T AbstractEnvironment.getEnvironmentService(Class<T> type)
[THROWS-WHEN] UnavailableServiceException when foreach(EnvironmentService s : this.globalEnvironmentServices)=T && !type.isInstance(s)
[THROWS-WHEN] UnavailableServiceException when forea... | true | ok | {"focal": {"class": "AbstractEnvironment", "name": "getEnvironmentService", "signature": "T getEnvironmentService(Class<T> type) throws UnavailableServiceException", "start_line": 4, "modifiers": "@SuppressWarnings(\"unchecked\") @Override public", "params": [{"name": "type", "type": "Class<T>"}], "return_type": "T"}, ... |
1251856_8 | class FileOperation implements FileAction {
boolean isIgnored(File file){
boolean ignore = false;
while(file != null){
String end = file.getAbsolutePath().substring(file.getAbsolutePath().lastIndexOf(System.getProperty("file.separator")) + 1);
for(String pathToIgnore: ignoredPaths){
ignore = end.matches... | // not sure why idea ide's would be a problem... TODO: testing this specifically smells like a bigger problem...
assertTrue(new FileOperation(".*\\.idea") {
public void onDirectory(File dir) throws IOException {}
public void onFile(File file) throws IOException {}
public void onNull(File nullFile) throws I... | [FOCAL] boolean FileOperation.isIgnored(File file)
[CLASS] class FileOperation implements FileAction
[METRICS] loc=14 cc=4 branches=1 loops=2 returns=2 throws=0 nesting=3
[CALLS-EXTERNAL] file.getAbsolutePath().substring/1, File.getAbsolutePath/0, file.getAbsolutePath().lastIndexOf/1, System.getProperty/1, String.match... | /* static context
[FOCAL] boolean FileOperation.isIgnored(File file)
[PATH1] while(file != null)=T -> foreach(String pathToIgnore : ignoredPaths)=T -> if(ignore)=F -> exit loop -> exit loop -> return ignore
[PATH2] while(file != null)=T -> foreach(String pathToIgnore : ignoredPaths)=T -> if(ignore)=T -> return true
[PA... | /* static context
[FOCAL] boolean FileOperation.isIgnored(File file)
[PATH1] while(file != null)=T -> foreach(String pathToIgnore : ignoredPaths)=T -> if(ignore)=F -> exit loop -> exit loop -> return ignore
[PATH2] while(file != null)=T -> foreach(String pathToIgnore : ignoredPaths)=T -> if(ignore)=T -> return true
[PA... | true | ok | {"focal": {"class": "FileOperation", "name": "isIgnored", "signature": "boolean isIgnored(File file)", "start_line": 3, "modifiers": "", "params": [{"name": "file", "type": "File"}], "return_type": "boolean"}, "class_info": {"name": "FileOperation", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "F... |
1269176_202 | class Snapshot {
public static Snapshot readSnapshot(IdReader reader, Snapshot oldSnapshot) throws IOException {
assert reader.idManager == oldSnapshot.idManager;
reader.readDiffs();
int snapshotId = reader.readInt();
boolean hasTool = reader.readBoolean();
Tool tool = hasTo... | System.out.println("readSnapshot");
IdManager idManager = new IdManager();
IdReader reader = new IdReader(new DataInputStream(new ByteArrayInputStream(emptyDiffEmpty)), idManager);
Snapshot oldSnapshot = idManager.getInitialSnapshot();
ImmutableArrayList<CellBackup> expCellBack... | [FOCAL] public static Snapshot Snapshot.readSnapshot(IdReader reader, Snapshot oldSnapshot)
[CLASS] class Snapshot
[METRICS] loc=97 cc=16 branches=9 loops=8 returns=1 throws=0 nesting=3
[CALLS-EXTERNAL] IdReader.readDiffs/0, IdReader.readInt/0, IdReader.readBoolean/0, IdReader.readTool/0, Environment.readEnvironment/2,... | class Snapshot {
public static Snapshot readSnapshot(IdReader reader, Snapshot oldSnapshot) throws IOException {
assert reader.idManager == oldSnapshot.idManager;
reader.readDiffs();
int snapshotId = reader.readInt();
boolean hasTool = reader.readBoolean();
Tool tool = hasTo... | false | ok | {"focal": {"class": "Snapshot", "name": "readSnapshot", "signature": "Snapshot readSnapshot(IdReader reader, Snapshot oldSnapshot) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "reader", "type": "IdReader"}, {"name": "oldSnapshot", "type": "Snapshot"}], "return_type": "Snapshot... | |
1273791_99 | class Tokenizer extends TokenizerBase {
@Override
public List<Token> tokenize(String text) {
return createTokenList(text);
}
public Tokenizer();
private Tokenizer(Builder builder);
private Tokenizer tokenizer;
}
class TokenizerTest {
private Tokenizer tokenizer;
@Test
... | List<Token> tokens = tokenizer.tokenize("合い方");
assertEquals(1, tokens.size());
Token token = tokens.get(0);
// Feature is escaped in quotes ("0,4")
assertEquals(
"名詞,普通名詞,一般,*,*,*,アイカタ,合方,合い方,アイカタ,合い方,アイカタ,和,*,*,*,*,アイカタ,アイカタ,アイカタ,アイカタ,*,*,\"0,4\",C2,*",
... | [FOCAL] @Override public List<Token> Tokenizer.tokenize(String text)
[CLASS] class Tokenizer extends TokenizerBase
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] createTokenList/1 (inherited)
[INPUTS] branches=- | result=text
[DATAFLOW] text@param->L3
[CLASS-MEMBERS] Tokenizer(); ... | /* static context
[FOCAL] @Override public List<Token> Tokenizer.tokenize(String text)
[INPUTS] branches=- | result=text
[CALLS-EXTERNAL] createTokenList/1 (inherited)
*/
| /* static context
[FOCAL] @Override public List<Token> Tokenizer.tokenize(String text)
[INPUTS] branches=- | result=text
[CALLS-EXTERNAL] createTokenList/1 (inherited)
*/
class Tokenizer extends TokenizerBase {
@Override
public List<Token> tokenize(String text) {
return createTokenList(text);
}
... | true | ok | {"focal": {"class": "Tokenizer", "name": "tokenize", "signature": "List<Token> tokenize(String text)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "text", "type": "String"}], "return_type": "List<Token>"}, "class_info": {"name": "Tokenizer", "kind": "class", "modifiers": "", "superclass": "Tok... |
1274071_4 | class AdaptationExecutor {
public static Result execute(List<AdaptationCommand> cmds) {
Result result = new Result();
for (AdaptationCommand cmd : cmds) {
try {
cmd.execute();
result.executedCmds.add(cmd);
} catch (KevoreeAdaptationException ... | List<AdaptationCommand> cmds = new ArrayList<>();
AdaptationCommand ok0 = new ExecSuccessCmd();
AdaptationCommand ok1 = new ExecSuccessCmd();
AdaptationCommand ok2 = new ExecSuccessCmd();
cmds.add(ok0);
cmds.add(ok1);
cmds.add(ok2);
cmds.add(new ExecFailCm... | [FOCAL] public static Result AdaptationExecutor.execute(List<AdaptationCommand> cmds)
[CLASS] class AdaptationExecutor
[METRICS] loc=15 cc=3 branches=0 loops=1 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] AdaptationCommand.execute/0, result.executedCmds.add/1
[NEW] Result
[EXCEPTIONS] catches KevoreeAdaptationExceptio... | /* static context
[FOCAL] public static Result AdaptationExecutor.execute(List<AdaptationCommand> cmds)
[PATH1] foreach(AdaptationCommand cmd : cmds)=T -> try-body throws -> return result
[PATH2] foreach(AdaptationCommand cmd : cmds)=F -> return result
[PATH3] foreach(AdaptationCommand cmd : cmds)=T -> exit loop -> ret... | /* static context
[FOCAL] public static Result AdaptationExecutor.execute(List<AdaptationCommand> cmds)
[PATH1] foreach(AdaptationCommand cmd : cmds)=T -> try-body throws -> return result
[PATH2] foreach(AdaptationCommand cmd : cmds)=F -> return result
[PATH3] foreach(AdaptationCommand cmd : cmds)=T -> exit loop -> ret... | true | ok | {"focal": {"class": "AdaptationExecutor", "name": "execute", "signature": "Result execute(List<AdaptationCommand> cmds)", "start_line": 3, "modifiers": "public static", "params": [{"name": "cmds", "type": "List<AdaptationCommand>"}], "return_type": "Result"}, "class_info": {"name": "AdaptationExecutor", "kind": "class"... |
1274332_10 | class LdapModule extends AbstractQuercusModule {
public static BooleanValue ldap_unbind (LdapLinkResource linkIdentifier)
{
// Avoid NPEs from this being called on non-existent linkIdentifiers.
if (linkIdentifier == null) {
return BooleanValue.create(false);
}
boolea... | BooleanValue result = LdapModule.ldap_unbind(null);
assertFalse("Unbinding should fail when link identifier is null", result.toBoolean());
}
} | [FOCAL] public static BooleanValue LdapModule.ldap_unbind(LdapLinkResource linkIdentifier)
[CLASS] class LdapModule extends AbstractQuercusModule
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] BooleanValue.create/1, LdapLinkResource.unbind/0
[PATH1] if(linkIdentifier == null)=T ->... | /* static context
[FOCAL] public static BooleanValue LdapModule.ldap_unbind(LdapLinkResource linkIdentifier)
[PATH1] if(linkIdentifier == null)=T -> return BooleanValue.create(false)
[PATH2] if(linkIdentifier == null)=F -> return BooleanValue.create(success)
[INPUTS] branches=linkIdentifier | result=linkIdentifier
[COL... | /* static context
[FOCAL] public static BooleanValue LdapModule.ldap_unbind(LdapLinkResource linkIdentifier)
[PATH1] if(linkIdentifier == null)=T -> return BooleanValue.create(false)
[PATH2] if(linkIdentifier == null)=F -> return BooleanValue.create(success)
[INPUTS] branches=linkIdentifier | result=linkIdentifier
[COL... | true | ok | {"focal": {"class": "LdapModule", "name": "ldap_unbind", "signature": "BooleanValue ldap_unbind(LdapLinkResource linkIdentifier)", "start_line": 3, "modifiers": "public static", "params": [{"name": "linkIdentifier", "type": "LdapLinkResource"}], "return_type": "BooleanValue"}, "class_info": {"name": "LdapModule", "kind... |
1287669_60 | class JsonAssert {
public static JsonAsserter with(String json) {
return new JsonAsserterImpl(JsonPath.parse(json).json());
}
public static JsonAsserter with(Reader reader);
public static JsonAsserter with(InputStream is);
public static CollectionMatcher collectionWithSize(Matcher<? super ... |
with(JSON).assertNotDefined("$.store.bicycle[?(@.color == 'red' )]");
}
} | [FOCAL] public static JsonAsserter JsonAssert.with(String json)
[CLASS] class JsonAssert
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] JsonPath.parse(json).json/0, JsonPath.parse/1
[NEW] JsonAsserterImpl
[INPUTS] branches=- | result=json
[DATAFLOW] json@param->L2
[CLASS-MEMBERS] ... | /* static context
[FOCAL] public static JsonAsserter JsonAssert.with(String json)
[INPUTS] branches=- | result=json
[NEW] JsonAsserterImpl
[CALLS-EXTERNAL] JsonPath.parse(json).json/0, JsonPath.parse/1
*/
| /* static context
[FOCAL] public static JsonAsserter JsonAssert.with(String json)
[INPUTS] branches=- | result=json
[NEW] JsonAsserterImpl
[CALLS-EXTERNAL] JsonPath.parse(json).json/0, JsonPath.parse/1
*/
class JsonAssert {
public static JsonAsserter with(String json) {
return new JsonAsserterImpl(JsonPath... | true | ok | {"focal": {"class": "JsonAssert", "name": "with", "signature": "JsonAsserter with(String json)", "start_line": 3, "modifiers": "public static", "params": [{"name": "json", "type": "String"}], "return_type": "JsonAsserter"}, "class_info": {"name": "JsonAssert", "kind": "class", "modifiers": "", "superclass": null, "inte... |
1293378_2 | class Population {
public float getMutation() {
return mutation;
}
public Population(int size, float crossoverRatio, float elitismRatio,
float mutationRatio);
public void evolve();
public Chromosome[] getPopulation();
public float getElitism();
public float getCrossover();
private Chromosome[] selectP... | Population pop = new Population(1024, 0.8f, 0.1f, 0.05f);
assertEquals(5, (int) (pop.getMutation() * 100));
pop = new Population(1024, 0.8f, 0.1f, 0.0f);
assertEquals(0, (int) (pop.getMutation() * 100));
pop = new Population(1024, 0.8f, 0.1f, 1.0f);
assertEquals(100, (int) (pop.getMutation() * 100));
... | [FOCAL] public float Population.getMutation()
[CLASS] class Population
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] Population(int size, float crossoverRatio, float elitismRatio, float mutationRatio); void evolve(); Chromosome[] getPopulation(); float getElitism(); float getCross... | /* static context
[FOCAL] public float Population.getMutation()
*/
| /* static context
[FOCAL] public float Population.getMutation()
*/
class Population {
public float getMutation() {
return mutation;
}
public Population(int size, float crossoverRatio, float elitismRatio,
float mutationRatio);
public void evolve();
public Chromosome[] getPopulation();
public float getEli... | true | ok | {"focal": {"class": "Population", "name": "getMutation", "signature": "float getMutation()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "float"}, "class_info": {"name": "Population", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "P... |
1294371_16 | class Paths {
public static String getParentOf(String path) {
int i = path.lastIndexOf(DELIM);
if (i == -1) return "";
if (i == 0) i = 1;
return path.substring(0, i);
}
public static String getNameOf(String path);
public static String appended(String path, String child);
public static String... | assertEquals("dir1/dir2", Paths.getParentOf("dir1/dir2/file"));
assertEquals("", Paths.getParentOf("file"));
assertEquals("c:", Paths.getParentOf("c:/file"));
assertEquals("/", Paths.getParentOf("/file"));
assertEquals("/dir", Paths.getParentOf("/dir/file"));
}
} | [FOCAL] public static String Paths.getParentOf(String path)
[CLASS] class Paths
[METRICS] loc=6 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] String.lastIndexOf/1, String.substring/2
[PATH1] if(i == -1)=F -> if(i == 0)=T -> return path.substring(0, i)
[PATH2] if(i == -1)=T -> return ""
[PATH3] i... | /* static context
[FOCAL] public static String Paths.getParentOf(String path)
[PATH1] if(i == -1)=F -> if(i == 0)=T -> return path.substring(0, i)
[PATH2] if(i == -1)=T -> return ""
[PATH3] if(i == -1)=F -> if(i == 0)=F -> return path.substring(0, i)
[INPUTS] branches=path | result=path
[CALLS-EXTERNAL] String.lastInde... | /* static context
[FOCAL] public static String Paths.getParentOf(String path)
[PATH1] if(i == -1)=F -> if(i == 0)=T -> return path.substring(0, i)
[PATH2] if(i == -1)=T -> return ""
[PATH3] if(i == -1)=F -> if(i == 0)=F -> return path.substring(0, i)
[INPUTS] branches=path | result=path
[CALLS-EXTERNAL] String.lastInde... | true | ok | {"focal": {"class": "Paths", "name": "getParentOf", "signature": "String getParentOf(String path)", "start_line": 3, "modifiers": "public static", "params": [{"name": "path", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Paths", "kind": "class", "modifiers": "", "superclass": null, "interfaces":... |
1307005_0 | class ExtendedTemporaryFolder extends ExternalResource {
public File newFolder(String folder) throws IOException {
return newFolder(new String[]{folder});
}
public ExtendedTemporaryFolder();
public ExtendedTemporaryFolder(File parentFolder);
@Override protected void before();
@Overr... | for (int i = 0; i < 1000; i++) {
File temporary = this.temporaryFolder.newFolder();
Assert.assertEquals(true, temporary.exists());
// Should writable
Assert.assertEquals(true, temporary.canWrite());
// Should writable
Assert.assertEquals(true, temporary.canRead());
}
}
} | [FOCAL] public File ExtendedTemporaryFolder.newFolder(String folder)
[CLASS] class ExtendedTemporaryFolder extends ExternalResource
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] File newFolder(String... folderNames)
[EXCEPTIONS] declares IOException
[INPUTS] branches=- | result=f... | /* static context
[FOCAL] public File ExtendedTemporaryFolder.newFolder(String folder)
[INPUTS] branches=- | result=folder
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] File newFolder(String... folderNames)
*/
| /* static context
[FOCAL] public File ExtendedTemporaryFolder.newFolder(String folder)
[INPUTS] branches=- | result=folder
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] File newFolder(String... folderNames)
*/
class ExtendedTemporaryFolder extends ExternalResource {
public File newFolder(String folder) throws... | true | ok | {"focal": {"class": "ExtendedTemporaryFolder", "name": "newFolder", "signature": "File newFolder(String folder) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "folder", "type": "String"}], "return_type": "File"}, "class_info": {"name": "ExtendedTemporaryFolder", "kind": "class", "modif... |
1312627_5 | class Version extends Service {
public static String getKernelRevision()
{
return KERNEL_VERSION.getRevision();
}
protected Version( String atrifactId, String version );
@Override public String toString();
public String getVersion();
public String getRevision();
private stati... | assertFalse( "Kernel revision not specified", "".equals( Version.getKernelRevision() ) );
}
} | [FOCAL] public static String Version.getKernelRevision()
[CLASS] class Version extends Service
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] KERNEL_VERSION.getRevision/0
[CLASS-MEMBERS] Version(String atrifactId, String version); String toString(); String getVersion(); String get... | /* static context
[FOCAL] public static String Version.getKernelRevision()
[CALLS-EXTERNAL] KERNEL_VERSION.getRevision/0
*/
| /* static context
[FOCAL] public static String Version.getKernelRevision()
[CALLS-EXTERNAL] KERNEL_VERSION.getRevision/0
*/
class Version extends Service {
public static String getKernelRevision()
{
return KERNEL_VERSION.getRevision();
}
protected Version( String atrifactId, String version );... | true | ok | {"focal": {"class": "Version", "name": "getKernelRevision", "signature": "String getKernelRevision()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "String"}, "class_info": {"name": "Version", "kind": "class", "modifiers": "", "superclass": "Service", "interfaces": null, "fields": [], "me... |
1313372_4 | class BetterMimeMessage extends MimeMessage {
protected boolean isAutomaticMessage() throws MessagingException {
String[] autoSubmittedHeaders = this.mimeMessage.getHeader(AUTO_SUBMITTED_HEADER);
if (autoSubmittedHeaders != null) {
for (String autoSubmittedHeader : autoSubmittedHeaders) {
if ("... | MimeMessage automatic = mock(MimeMessage.class);
when(automatic.getHeader("Auto-Submitted")).thenReturn(new String[]{"bart", "auto-replied"});
BetterMimeMessage instance = new BetterMimeMessage(automatic);
assertTrue(instance.isAutomaticMessage());
automatic = mock(MimeMessage.class);
when(auto... | [FOCAL] protected boolean BetterMimeMessage.isAutomaticMessage()
[CLASS] class BetterMimeMessage extends MimeMessage
[METRICS] loc=13 cc=4 branches=2 loops=1 returns=2 throws=0 nesting=3
[CALLS-EXTERNAL] this.mimeMessage.getHeader/1, "auto-generated".equalsIgnoreCase/1, "auto-replied".equalsIgnoreCase/1, String.startsW... | /* static context
[FOCAL] protected boolean BetterMimeMessage.isAutomaticMessage()
[PATH1] if(autoSubmittedHeaders != null)=T -> foreach(String autoSubmittedHeader : autoSubmittedHeaders)=T -> if(("auto-generated".equalsIgnoreCase(autoSubmittedHeader) || "auto-replied".equalsIgnoreCase(autoSubmittedHeader) || au...)=F ... | /* static context
[FOCAL] protected boolean BetterMimeMessage.isAutomaticMessage()
[PATH1] if(autoSubmittedHeaders != null)=T -> foreach(String autoSubmittedHeader : autoSubmittedHeaders)=T -> if(("auto-generated".equalsIgnoreCase(autoSubmittedHeader) || "auto-replied".equalsIgnoreCase(autoSubmittedHeader) || au...)=F ... | true | ok | {"focal": {"class": "BetterMimeMessage", "name": "isAutomaticMessage", "signature": "boolean isAutomaticMessage() throws MessagingException", "start_line": 3, "modifiers": "protected", "params": [], "return_type": "boolean"}, "class_info": {"name": "BetterMimeMessage", "kind": "class", "modifiers": "", "superclass": "M... |
1318639_2 | class OrbTrackerMemberDataServiceImpl extends RemoteServiceServlet implements
OrbTrackerMemberDataService, Watcher {
@Override
public String[] getJobsInProgress() throws NodeDoesNotExistException,
ZooKeeperConnectionException,
WatcherExc... | OrbTrackerMemberDataServiceImpl server = new OrbTrackerMemberDataServiceImpl();
int num_jobs = 10;
CountDownLatch jobsLatch = new CountDownLatch(1);
CountDownLatch updateLatch = new CountDownLatch(1);
CountDownLatch removeLatch = new CountDownLatch(1);
server.enterTestingMode(jobsLatch, removeLa... | [FOCAL] @Override public String[] OrbTrackerMemberDataServiceImpl.getJobsInProgress()
[CLASS] class OrbTrackerMemberDataServiceImpl extends RemoteServiceServlet implements OrbTrackerMemberDataService, Watcher
[METRICS] loc=20 cc=5 branches=2 loops=0 returns=1 throws=2 nesting=2
[CALLS-INTERNAL] void initializeJobMonito... | /* static context
[FOCAL] @Override public String[] OrbTrackerMemberDataServiceImpl.getJobsInProgress()
[THROWS-WHEN] ZooKeeperConnectionException when zk == null && try-body throws
[THROWS-WHEN] WatcherException when zk == null && jobsInProgressWatcher == null && try-body throws
[THROWS-WHEN] WatcherException when !(z... | /* static context
[FOCAL] @Override public String[] OrbTrackerMemberDataServiceImpl.getJobsInProgress()
[THROWS-WHEN] ZooKeeperConnectionException when zk == null && try-body throws
[THROWS-WHEN] WatcherException when zk == null && jobsInProgressWatcher == null && try-body throws
[THROWS-WHEN] WatcherException when !(z... | true | ok | {"focal": {"class": "OrbTrackerMemberDataServiceImpl", "name": "getJobsInProgress", "signature": "String[] getJobsInProgress() throws NodeDoesNotExistException, ZooKeeperConnectionException, WatcherException", "start_line": 4, "modifiers": "@Override public", "params": [], "return_type": "String[]"}, "class_info": {"na... |
1319605_35 | class DomainValidator implements ConstraintValidator<Domain, CharSequence> {
@Override
public boolean isValid(CharSequence domain, ConstraintValidatorContext context) {
Matcher matcher = DOMAIN_NAME_REGEX.matcher(domain);
if (matcher.matches()) {
domain = matcher.group(1);
... | assertTrue("b\u00fccher.ch in IDN should validate", validator.isValid("www.xn--bcher-kva.ch", null));
}
} | [FOCAL] @Override public boolean DomainValidator.isValid(CharSequence domain, ConstraintValidatorContext context)
[CLASS] class DomainValidator implements ConstraintValidator<Domain, CharSequence>
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] boolean isValidTld(String tld)
[CALLS... | /* static context
[FOCAL] @Override public boolean DomainValidator.isValid(CharSequence domain, ConstraintValidatorContext context)
[PATH1] if(matcher.matches())=T -> return isValidTld(domain.toString())
[PATH2] if(matcher.matches())=F -> return allowLocal && DOMAIN_LABEL.matcher(domain).matches()
[INPUTS] branches=dom... | /* static context
[FOCAL] @Override public boolean DomainValidator.isValid(CharSequence domain, ConstraintValidatorContext context)
[PATH1] if(matcher.matches())=T -> return isValidTld(domain.toString())
[PATH2] if(matcher.matches())=F -> return allowLocal && DOMAIN_LABEL.matcher(domain).matches()
[INPUTS] branches=dom... | true | ok | {"focal": {"class": "DomainValidator", "name": "isValid", "signature": "boolean isValid(CharSequence domain, ConstraintValidatorContext context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "domain", "type": "CharSequence"}, {"name": "context", "type": "ConstraintValidatorContext"}], "return_... |
1320181_158 | class InfrastructureRep extends DefaultRepBase {
public Datastore findDatastoreById(final Integer id)
{
assert id != null;
return datastoreDao.findById(id);
}
public InfrastructureRep();
public InfrastructureRep(final EntityManager entityManager);
public Datacenter findById... | Datastore datastore = datastoreGenerator.createUniqueInstance();
ds().persistAll(datastore);
EntityManager em = ds().createEntityManagerAndBeginRollbackTransaction();
InfrastructureRep rep = new InfrastructureRep(em);
assertNotNull(rep.findDatastoreById(datastore.getId()));
... | [FOCAL] public Datastore InfrastructureRep.findDatastoreById(Integer id)
[CLASS] class InfrastructureRep extends DefaultRepBase
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] datastoreDao.findById/1
[INPUTS] branches=- | result=id
[COLLABORATORS] field datastoreDao findById/1
[DAT... | class InfrastructureRep extends DefaultRepBase {
public Datastore findDatastoreById(final Integer id)
{
assert id != null;
return datastoreDao.findById(id);
}
public InfrastructureRep();
public InfrastructureRep(final EntityManager entityManager);
public Datacenter findById... | false | ok | {"focal": {"class": "InfrastructureRep", "name": "findDatastoreById", "signature": "Datastore findDatastoreById(Integer id)", "start_line": 3, "modifiers": "public", "params": [{"name": "id", "type": "Integer"}], "return_type": "Datastore"}, "class_info": {"name": "InfrastructureRep", "kind": "class", "modifiers": "", ... | |
1322545_0 | class Utility {
public static boolean validateUrl(String url) {
if (TextUtils.isEmpty(url)) {
return false;
}
pattern = Pattern.compile(URL_PATTERN);
matcher = pattern.matcher(url);
if (matcher.matches()) {
return true;
}
return false... | boolean actual = Utility.validateUrl("http://demo.ushahidi.com/smssync");
assertTrue("The provided URL is not a valid one", actual);
}
} | [FOCAL] public static boolean Utility.validateUrl(String url)
[CLASS] class Utility
[METRICS] loc=12 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[CALLS-EXTERNAL] TextUtils.isEmpty/1, Pattern.compile/1, pattern.matcher/1, matcher.matches/0
[PATH1] if(TextUtils.isEmpty(url))=F -> if(matcher.matches())=T -> retur... | /* static context
[FOCAL] public static boolean Utility.validateUrl(String url)
[PATH1] if(TextUtils.isEmpty(url))=F -> if(matcher.matches())=T -> return true
[PATH2] if(TextUtils.isEmpty(url))=T -> return false
[PATH3] if(TextUtils.isEmpty(url))=F -> if(matcher.matches())=F -> return false
[INPUTS] branches=url | resu... | /* static context
[FOCAL] public static boolean Utility.validateUrl(String url)
[PATH1] if(TextUtils.isEmpty(url))=F -> if(matcher.matches())=T -> return true
[PATH2] if(TextUtils.isEmpty(url))=T -> return false
[PATH3] if(TextUtils.isEmpty(url))=F -> if(matcher.matches())=F -> return false
[INPUTS] branches=url | resu... | true | ok | {"focal": {"class": "Utility", "name": "validateUrl", "signature": "boolean validateUrl(String url)", "start_line": 3, "modifiers": "public static", "params": [{"name": "url", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "Utility", "kind": "class", "modifiers": "", "superclass": null, "interfac... |
1328283_24 | class EchoReader implements Reader {
@Override
public void get(ByteBuffer key, ReaderResult result) throws IOException {
StringBuilder sb = new StringBuilder();
sb.append("Original value: ");
sb.append(BytesUtils.bytesToHexString(key));
sb.append(" Assigned to partition number: ");
sb.append(pa... | EchoReader r = new EchoReader(57);
ReaderResult result = new ReaderResult();
r.get(ByteBuffer.wrap(new byte[]{1, 2, 3}), result);
assertTrue(result.isFound());
assertEquals("Original value: 01 02 03 Assigned to partition number: 57", new String(result.getBuffer().array()));
}
} | [FOCAL] @Override public void EchoReader.get(ByteBuffer key, ReaderResult result)
[CLASS] class EchoReader implements Reader
[METRICS] loc=13 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] StringBuilder.append/1, BytesUtils.bytesToHexString/1, sb.toString().getBytes/0, StringBuilder.toString/0, R... | /* static context
[FOCAL] @Override public void EchoReader.get(ByteBuffer key, ReaderResult result)
[COLLABORATORS] param result:ReaderResult requiresBufferSize/1,getBuffer/0,found/0
[EXCEPTIONS] declares IOException
[NEW] StringBuilder
[CALLS-EXTERNAL] StringBuilder.append/1, BytesUtils.bytesToHexString/1, sb.toString... | /* static context
[FOCAL] @Override public void EchoReader.get(ByteBuffer key, ReaderResult result)
[COLLABORATORS] param result:ReaderResult requiresBufferSize/1,getBuffer/0,found/0
[EXCEPTIONS] declares IOException
[NEW] StringBuilder
[CALLS-EXTERNAL] StringBuilder.append/1, BytesUtils.bytesToHexString/1, sb.toString... | true | ok | {"focal": {"class": "EchoReader", "name": "get", "signature": "void get(ByteBuffer key, ReaderResult result) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "key", "type": "ByteBuffer"}, {"name": "result", "type": "ReaderResult"}], "return_type": "void"}, "class_info": {"name"... |
1338456_1 | class LabelCounters {
public void add(final LabelCounters diff)
{
if (diff.totalBytes != null) {
this.totalBytes += diff.totalBytes;
}
if (diff.totalMessages != null) {
this.totalMessages += diff.totalMessages;
}
if (diff.unreadMessages != null) {
this.unreadMessages += diff.unreadMessages;
}
... | LabelCounters c1 = new LabelCounters();
LabelCounters c2 = new LabelCounters();
LabelCounters c3 = new LabelCounters();
c1.setTotalBytes(123L);
c1.setTotalMessages(23L);
c1.setUnreadMessages(335L);
c2.setTotalBytes(223L);
c2.setTotalMessages(223L);
c2.setUnreadMessages(685L);
c3.setTotalBytes(1... | [FOCAL] public void LabelCounters.add(LabelCounters diff)
[CLASS] class LabelCounters
[METRICS] loc=14 cc=4 branches=3 loops=0 returns=0 throws=0 nesting=1
[FIELDS] read=totalBytes, totalMessages, unreadMessages | write=totalBytes, totalMessages, unreadMessages
[PATH1] if(diff.totalBytes != null)=T -> if(diff.totalMess... | /* static context
[FOCAL] public void LabelCounters.add(LabelCounters diff)
[PATH1] if(diff.totalBytes != null)=T -> if(diff.totalMessages != null)=T -> if(diff.unreadMessages != null)=T
[PATH2] if(diff.totalBytes != null)=F -> if(diff.totalMessages != null)=F -> if(diff.unreadMessages != null)=F
[INPUTS] branches=diff... | /* static context
[FOCAL] public void LabelCounters.add(LabelCounters diff)
[PATH1] if(diff.totalBytes != null)=T -> if(diff.totalMessages != null)=T -> if(diff.unreadMessages != null)=T
[PATH2] if(diff.totalBytes != null)=F -> if(diff.totalMessages != null)=F -> if(diff.unreadMessages != null)=F
[INPUTS] branches=diff... | true | ok | {"focal": {"class": "LabelCounters", "name": "add", "signature": "void add(LabelCounters diff)", "start_line": 3, "modifiers": "public", "params": [{"name": "diff", "type": "LabelCounters"}], "return_type": "void"}, "class_info": {"name": "LabelCounters", "kind": "class", "modifiers": "", "superclass": null, "interface... |
1341207_31 | class IntMsdRadixSort implements ArrayNonComparisonSort<Integer> {
@Nonnull
Integer getMaxAbsNumber(@Nonnull Integer[] numbers) {
Integer maxAbsNumber = 0;
for (Integer number : numbers) {
if (number >= 0) {
if (number > maxAbsNumber) {
maxAbsNumber = number;
}
} else if (number == Integer.MIN... | final IntMsdRadixSort sort = newSort();
assertEquals(Integer.valueOf(1), sort.getMaxAbsNumber(new Integer[]{1}));
assertEquals(Integer.valueOf(2), sort.getMaxAbsNumber(new Integer[]{-2}));
assertEquals(Integer.valueOf(Integer.MAX_VALUE), sort.getMaxAbsNumber(new Integer[]{Integer.MAX_VALUE, Integer.MIN_VALUE}))... | [FOCAL] @Nonnull Integer IntMsdRadixSort.getMaxAbsNumber(Integer[] numbers)
[CLASS] class IntMsdRadixSort implements ArrayNonComparisonSort<Integer>
[METRICS] loc=18 cc=6 branches=4 loops=1 returns=1 throws=0 nesting=4
[PATH1] foreach(Integer number : numbers)=T -> if(number >= 0)=F -> if(number == Integer.MIN_VALUE)=F... | /* static context
[FOCAL] @Nonnull Integer IntMsdRadixSort.getMaxAbsNumber(Integer[] numbers)
[PATH1] foreach(Integer number : numbers)=T -> if(number >= 0)=F -> if(number == Integer.MIN_VALUE)=F -> if(-number > maxAbsNumber)=T -> exit loop -> return maxAbsNumber
[PATH2] foreach(Integer number : numbers)=T -> if(number... | /* static context
[FOCAL] @Nonnull Integer IntMsdRadixSort.getMaxAbsNumber(Integer[] numbers)
[PATH1] foreach(Integer number : numbers)=T -> if(number >= 0)=F -> if(number == Integer.MIN_VALUE)=F -> if(-number > maxAbsNumber)=T -> exit loop -> return maxAbsNumber
[PATH2] foreach(Integer number : numbers)=T -> if(number... | true | ok | {"focal": {"class": "IntMsdRadixSort", "name": "getMaxAbsNumber", "signature": "Integer getMaxAbsNumber(Integer[] numbers)", "start_line": 3, "modifiers": "@Nonnull", "params": [{"name": "numbers", "type": "Integer[]"}], "return_type": "Integer"}, "class_info": {"name": "IntMsdRadixSort", "kind": "class", "modifiers": ... |
1342891_5 | class JndiTreeParser {
public CellTree parse(List<Property> model) {
stack.push(root);
parseSiblings(model, "");
return cellTree;
}
public JndiTreeParser();
SingleSelectionModel<JndiEntry> getSelectionModel();
private void parseSiblings(List<Property> siblings, String pa... | JndiTreeParser jtp = new JndiTreeParser();
ModelNode children = new ModelNode();
ModelNode inner = new ModelNode();
inner.get("class-name").set("org.acme.MyClass");
inner.get("value").set("org.acme.MyClass@xyz");
children.get("SomeEJB").set(inner);
ModelNode par... | [FOCAL] public CellTree JndiTreeParser.parse(List<Property> model)
[CLASS] class JndiTreeParser
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] void parseSiblings(List<Property> siblings, String parentURI)
[CALLS-EXTERNAL] stack.push/1
[COLLABORATORS] field stack push/1
[DATAFLOW] ... | /* static context
[FOCAL] public CellTree JndiTreeParser.parse(List<Property> model)
[COLLABORATORS] field stack push/1
[CALLS-INTERNAL] void parseSiblings(List<Property> siblings, String parentURI)
[CALLS-EXTERNAL] stack.push/1
*/
| /* static context
[FOCAL] public CellTree JndiTreeParser.parse(List<Property> model)
[COLLABORATORS] field stack push/1
[CALLS-INTERNAL] void parseSiblings(List<Property> siblings, String parentURI)
[CALLS-EXTERNAL] stack.push/1
*/
class JndiTreeParser {
public CellTree parse(List<Property> model) {
stack.... | true | ok | {"focal": {"class": "JndiTreeParser", "name": "parse", "signature": "CellTree parse(List<Property> model)", "start_line": 3, "modifiers": "public", "params": [{"name": "model", "type": "List<Property>"}], "return_type": "CellTree"}, "class_info": {"name": "JndiTreeParser", "kind": "class", "modifiers": "", "superclass"... |
1346655_17 | class Geometry {
public static Point offset(int amount, Point point) {
return offset(new Point(amount, amount), point);
}
public static Dimension increase(int amount, Dimension dimension);
public static Point offset(Point offset, Point point);
public static Point opposite(Point point);
}
... | Point originalPoint = new Point(0, 0);
Geometry.offset(11, originalPoint);
assertEquals(0, originalPoint.x);
assertEquals(0, originalPoint.y);
}
} | [FOCAL] public static Point Geometry.offset(int amount, Point point)
[CLASS] class Geometry
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Point offset(Point offset, Point point)
[NEW] Point
[INPUTS] branches=- | result=amount, point
[DATAFLOW] amount@param->L2; point@param->L2
[C... | /* static context
[FOCAL] public static Point Geometry.offset(int amount, Point point)
[INPUTS] branches=- | result=amount, point
[CALLS-INTERNAL] Point offset(Point offset, Point point)
[NEW] Point
*/
| /* static context
[FOCAL] public static Point Geometry.offset(int amount, Point point)
[INPUTS] branches=- | result=amount, point
[CALLS-INTERNAL] Point offset(Point offset, Point point)
[NEW] Point
*/
class Geometry {
public static Point offset(int amount, Point point) {
return offset(new Point(amount, am... | true | ok | {"focal": {"class": "Geometry", "name": "offset", "signature": "Point offset(int amount, Point point)", "start_line": 3, "modifiers": "public static", "params": [{"name": "amount", "type": "int"}, {"name": "point", "type": "Point"}], "return_type": "Point"}, "class_info": {"name": "Geometry", "kind": "class", "modifier... |
1350993_0 | class Smoothie {
public static synchronized SmoothieContainer getContainer() {
if (container == null) {
// This should really be done by a ServletContextListener when the webapp loads, but for now we are not modifying hudson-core, so bootstrap the container here.
return new Smoothie... | SmoothieContainer container = Smoothie.getContainer();
assertNotNull(container);
log.debug("Container: {}", container);
}
} | [FOCAL] public static synchronized SmoothieContainer Smoothie.getContainer()
[CLASS] class Smoothie
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] new SmoothieContainerBootstrap().bootstrap/0
[NEW] SmoothieContainerBootstrap
[PATH1] if(container == null)=T -> return new SmoothieCo... | /* static context
[FOCAL] public static synchronized SmoothieContainer Smoothie.getContainer()
[PATH1] if(container == null)=T -> return new SmoothieContainerBootstrap().bootstrap()
[PATH2] if(container == null)=F -> return container
[NEW] SmoothieContainerBootstrap
[CALLS-EXTERNAL] new SmoothieContainerBootstrap().boo... | /* static context
[FOCAL] public static synchronized SmoothieContainer Smoothie.getContainer()
[PATH1] if(container == null)=T -> return new SmoothieContainerBootstrap().bootstrap()
[PATH2] if(container == null)=F -> return container
[NEW] SmoothieContainerBootstrap
[CALLS-EXTERNAL] new SmoothieContainerBootstrap().boo... | true | ok | {"focal": {"class": "Smoothie", "name": "getContainer", "signature": "SmoothieContainer getContainer()", "start_line": 3, "modifiers": "public static synchronized", "params": [], "return_type": "SmoothieContainer"}, "class_info": {"name": "Smoothie", "kind": "class", "modifiers": "", "superclass": null, "interfaces": n... |
1358036_51 | class SparqlPreParser {
public Set<IRI> getReferredGraphs(String queryString, IRI defaultGraph) throws ParseException {
Set<IRI> referredGraphs;
JavaCCGeneratedSparqlPreParser parser = new JavaCCGeneratedSparqlPreParser(new StringReader(queryString));
SparqlUnit sparqlUnit;
sparqlUn... |
String queryStr = "PREFIX ns: <http://example.org/ns#> " +
"INSERT DATA { <http://example/book1> ns:price 42 }; " +
"DELETE DATA { GRAPH " + TEST_GRAPH.toString() + " { <http://example/book1> ns:price 42 } }";
SparqlPreParser parser;
parser = new SparqlPrePar... | [FOCAL] public Set<IRI> SparqlPreParser.getReferredGraphs(String queryString, IRI defaultGraph)
[CLASS] class SparqlPreParser
[METRICS] loc=35 cc=7 branches=5 loops=1 returns=2 throws=0 nesting=3
[CALLS-INTERNAL] boolean referringVariableNamedGraph(Query query)
[CALLS-EXTERNAL] JavaCCGeneratedSparqlPreParser.parse/0, S... | /* static context
[FOCAL] public Set<IRI> SparqlPreParser.getReferredGraphs(String queryString, IRI defaultGraph)
[PATH1] if(sparqlUnit.isQuery())=T -> if(dataSet != null)=T -> if(queryPattern != null)=T -> foreach(GraphPattern graphPattern : graphPatterns)=T -> exit loop -> if(referredGraphs.isEmpty())=T -> if(referri... | /* static context
[FOCAL] public Set<IRI> SparqlPreParser.getReferredGraphs(String queryString, IRI defaultGraph)
[PATH1] if(sparqlUnit.isQuery())=T -> if(dataSet != null)=T -> if(queryPattern != null)=T -> foreach(GraphPattern graphPattern : graphPatterns)=T -> exit loop -> if(referredGraphs.isEmpty())=T -> if(referri... | true | ok | {"focal": {"class": "SparqlPreParser", "name": "getReferredGraphs", "signature": "Set<IRI> getReferredGraphs(String queryString, IRI defaultGraph) throws ParseException", "start_line": 3, "modifiers": "public", "params": [{"name": "queryString", "type": "String"}, {"name": "defaultGraph", "type": "IRI"}], "return_type"... |
1361294_0 | class PersonRepo {
public List<Person> list() {
try (Connection con = ds.getConnection()) {
ArrayList<Person> persons = new ArrayList<Person>();
ResultSet rs = con.createStatement().executeQuery(QUERY);
while (rs.next()) {
persons.add(read(rs));
... | JdbcDataSource ds = new JdbcDataSource();
ds.setUrl("jdbc:h2:mem:person;DB_CLOSE_DELAY=-1");
new Migrator().prepare(ds);
PersonRepo personRepo = new PersonRepo();
personRepo.ds = ds;
List<Person> persons = personRepo.list();
Person person = persons.iterator().next... | [FOCAL] public List<Person> PersonRepo.list()
[CLASS] class PersonRepo
[METRICS] loc=12 cc=3 branches=0 loops=1 returns=1 throws=1 nesting=2
[CALLS-INTERNAL] Person read(ResultSet rs)
[CALLS-EXTERNAL] ds.getConnection/0, con.createStatement().executeQuery/1, Connection.createStatement/0, ResultSet.next/0, ArrayList<Per... | /* static context
[FOCAL] public List<Person> PersonRepo.list()
[THROWS-WHEN] RuntimeException when try-body throws
[PATH1] while(rs.next())=T -> exit loop -> return persons
[PATH2] try-body throws -> throw new RuntimeException(e.getMessage(), e)
[PATH3] while(rs.next())=F -> return persons
[COLLABORATORS] field ds get... | /* static context
[FOCAL] public List<Person> PersonRepo.list()
[THROWS-WHEN] RuntimeException when try-body throws
[PATH1] while(rs.next())=T -> exit loop -> return persons
[PATH2] try-body throws -> throw new RuntimeException(e.getMessage(), e)
[PATH3] while(rs.next())=F -> return persons
[COLLABORATORS] field ds get... | true | ok | {"focal": {"class": "PersonRepo", "name": "list", "signature": "List<Person> list()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<Person>"}, "class_info": {"name": "PersonRepo", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "r... |
1365016_6 | class KeyboardState {
public EnumSet<Key> getKeysReleasedSince(final KeyboardState previous) {
final EnumSet<Key> result = EnumSet.copyOf(previous._keysDown);
result.removeAll(_keysDown);
return result;
}
public KeyboardState(final EnumSet<Key> keysDown, final KeyEvent keyEvent)... | ks1 = new KeyboardState(EnumSet.of(Key.A, Key.B), KeyEvent.NOTHING);
ks2 = new KeyboardState(EnumSet.noneOf(Key.class), KeyEvent.NOTHING);
final EnumSet<Key> released = ks2.getKeysReleasedSince(ks1);
assertEquals("2 key", 2, released.size());
assertTrue("a released", released.c... | [FOCAL] public EnumSet<Key> KeyboardState.getKeysReleasedSince(KeyboardState previous)
[CLASS] class KeyboardState
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] EnumSet.copyOf/1, EnumSet<Key>.removeAll/1
[INPUTS] branches=- | result=previous
[DATAFLOW] previous@param->L2; result@... | /* static context
[FOCAL] public EnumSet<Key> KeyboardState.getKeysReleasedSince(KeyboardState previous)
[INPUTS] branches=- | result=previous
[CALLS-EXTERNAL] EnumSet.copyOf/1, EnumSet<Key>.removeAll/1
*/
| /* static context
[FOCAL] public EnumSet<Key> KeyboardState.getKeysReleasedSince(KeyboardState previous)
[INPUTS] branches=- | result=previous
[CALLS-EXTERNAL] EnumSet.copyOf/1, EnumSet<Key>.removeAll/1
*/
class KeyboardState {
public EnumSet<Key> getKeysReleasedSince(final KeyboardState previous) {
final ... | true | ok | {"focal": {"class": "KeyboardState", "name": "getKeysReleasedSince", "signature": "EnumSet<Key> getKeysReleasedSince(KeyboardState previous)", "start_line": 3, "modifiers": "public", "params": [{"name": "previous", "type": "KeyboardState"}], "return_type": "EnumSet<Key>"}, "class_info": {"name": "KeyboardState", "kind"... |
1365306_97 | class LocalDateTimeValue {
public static LocalDateTimeValue from(LocalDateTime value) {
LocalDateTimeValue result = new LocalDateTimeValue();
result.setValue(value);
return result;
}
public LocalDateTime getValue();
public void setValue(LocalDateTime value);
@Override publi... | LocalDateTimeValue value = LocalDateTimeValue.from(LOCAL_DATE_TIME);
assertEquals(LOCAL_DATE_TIME, value.getValue());
}
} | [FOCAL] public static LocalDateTimeValue LocalDateTimeValue.from(LocalDateTime value)
[CLASS] class LocalDateTimeValue
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] LocalDateTimeValue.setValue/1
[NEW] LocalDateTimeValue
[DATAFLOW] result@L2->L3,L4; value@param->L3
[CLASS-MEMBERS]... | /* static context
[FOCAL] public static LocalDateTimeValue LocalDateTimeValue.from(LocalDateTime value)
[NEW] LocalDateTimeValue
[CALLS-EXTERNAL] LocalDateTimeValue.setValue/1
*/
| /* static context
[FOCAL] public static LocalDateTimeValue LocalDateTimeValue.from(LocalDateTime value)
[NEW] LocalDateTimeValue
[CALLS-EXTERNAL] LocalDateTimeValue.setValue/1
*/
class LocalDateTimeValue {
public static LocalDateTimeValue from(LocalDateTime value) {
LocalDateTimeValue result = new LocalDat... | true | ok | {"focal": {"class": "LocalDateTimeValue", "name": "from", "signature": "LocalDateTimeValue from(LocalDateTime value)", "start_line": 3, "modifiers": "public static", "params": [{"name": "value", "type": "LocalDateTime"}], "return_type": "LocalDateTimeValue"}, "class_info": {"name": "LocalDateTimeValue", "kind": "class"... |
1365699_2 | class FilteringWordCount extends HadoopJob {
@Override
public int run(String[] args) throws Exception {
Map<String,String> parsedArgs = parseArgs(args);
Path inputPath = new Path(parsedArgs.get("--input"));
Path outputPath = new Path(parsedArgs.get("--output"));
Job wordCount = prepareJob(inputPa... |
File inputFile = getTestTempFile("lotr.txt");
File outputDir = getTestTempDir("output");
outputDir.delete();
writeLines(inputFile,
"One Ring to rule them all,",
"One Ring to find them,",
"One Ring to bring them all",
"and in the darkness bind them");
Configuration ... | [FOCAL] @Override public int FilteringWordCount.run(String[] args)
[CLASS] class FilteringWordCount extends HadoopJob
[METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] parseArgs/1 (inherited), Map<String,String>.get/1, prepareJob/10 (inherited), Job.waitForCompletion/1
[NEW] Path
[E... | /* static context
[FOCAL] @Override public int FilteringWordCount.run(String[] args)
[EXCEPTIONS] declares Exception
[NEW] Path
[CALLS-EXTERNAL] parseArgs/1 (inherited), Map<String,String>.get/1, prepareJob/10 (inherited), Job.waitForCompletion/1
*/
| /* static context
[FOCAL] @Override public int FilteringWordCount.run(String[] args)
[EXCEPTIONS] declares Exception
[NEW] Path
[CALLS-EXTERNAL] parseArgs/1 (inherited), Map<String,String>.get/1, prepareJob/10 (inherited), Job.waitForCompletion/1
*/
class FilteringWordCount extends HadoopJob {
@Override
public int... | true | ok | {"focal": {"class": "FilteringWordCount", "name": "run", "signature": "int run(String[] args) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "args", "type": "String[]"}], "return_type": "int"}, "class_info": {"name": "FilteringWordCount", "kind": "class", "modifiers": "", "supe... |
1367811_46 | class Functions {
public static boolean isAuthor(Job job) {
User user = User.current();
return !(user == null || job == null || job.getCreatedBy() == null) && job.getCreatedBy().equals(user.getId());
}
public Functions();
public String generateId();
public static boolean isModel(... | mockStatic(User.class);
User user = createMock(User.class);
expect(user.getId()).andReturn(USER);
expect(User.current()).andReturn(user);
Job job = createMock(FreeStyleProject.class);
expect(job.getCreatedBy()).andReturn("user").times(2);
replay(User.class, user, ... | [FOCAL] public static boolean Functions.isAuthor(Job job)
[CLASS] class Functions
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] User.current/0, Job.getCreatedBy/0, job.getCreatedBy().equals/1, User.getId/0
[INPUTS] branches=- | result=job
[COLLABORATORS] param job:Job getCreatedB... | class Functions {
public static boolean isAuthor(Job job) {
User user = User.current();
return !(user == null || job == null || job.getCreatedBy() == null) && job.getCreatedBy().equals(user.getId());
}
public Functions();
public String generateId();
public static boolean isModel(... | false | ok | {"focal": {"class": "Functions", "name": "isAuthor", "signature": "boolean isAuthor(Job job)", "start_line": 3, "modifiers": "public static", "params": [{"name": "job", "type": "Job"}], "return_type": "boolean"}, "class_info": {"name": "Functions", "kind": "class", "modifiers": "", "superclass": null, "interfaces": nul... | |
1379319_1 | class Physics {
public static PVector calculateImpulse(PVector v1, PVector v2,
float m1, float m2, float elasticity, PVector normal) {
assert v1 != null : "Physics.calculateImpulse: v1 must be a valid PVector";
assert v2 != null : "Physics.calculateImpulse: v2 must be a valid PVector";
assert normal != null... | MassedBeing being1 = new MyBeing(1.0f, 1.0f);
MassedBeing being2 = new MyBeing(1.0f, 1.0f);
// very simple case (body hits body of equal mass at rest, transferring velocity)
being1.setPosition(zeroVector());
being1.setVelocity(zeroVector());
being2.setPosition(makeVector(-1.0f,0.0f));
being2.setVelocit... | [FOCAL] public static PVector Physics.calculateImpulse(PVector v1, PVector v2, float m1, float m2, float elasticity, PVector normal)
[CLASS] class Physics
[METRICS] loc=15 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] PVector.sub/2, PVector.mult/1, PVector.dot/1, PVector.mult/2
[INPUTS] branches... | /* static context
[FOCAL] public static PVector Physics.calculateImpulse(PVector v1, PVector v2, float m1, float m2, float elasticity, PVector normal)
[INPUTS] branches=- | result=m1, m2, normal, v1, v2
[COLLABORATORS] param normal:PVector dot/1
[CALLS-EXTERNAL] PVector.sub/2, PVector.mult/1, PVector.dot/1, PVector.mul... | /* static context
[FOCAL] public static PVector Physics.calculateImpulse(PVector v1, PVector v2, float m1, float m2, float elasticity, PVector normal)
[INPUTS] branches=- | result=m1, m2, normal, v1, v2
[COLLABORATORS] param normal:PVector dot/1
[CALLS-EXTERNAL] PVector.sub/2, PVector.mult/1, PVector.dot/1, PVector.mul... | true | ok | {"focal": {"class": "Physics", "name": "calculateImpulse", "signature": "PVector calculateImpulse(PVector v1, PVector v2, float m1, float m2, float elasticity, PVector normal)", "start_line": 3, "modifiers": "public static", "params": [{"name": "v1", "type": "PVector"}, {"name": "v2", "type": "PVector"}, {"name": "m1",... |
1381837_0 | class ComplexityThresholdsUtils {
public static List<ComplexityThreshold> convertAbacusThresholdsToComplexityThresholds(String[] propertyThresholds) {
List<ComplexityThreshold> complexityThresholds = new ArrayList<ComplexityThreshold>();
String[] temp;
for (String propertyThreshold : propertyThresholds... |
List<ComplexityThreshold> complexityThresholds;
complexityThresholds = ComplexityThresholdsUtils.convertAbacusThresholdsToComplexityThresholds(new String[] {"Simple"});
Assert.assertNotNull(complexityThresholds);
Assert.assertEquals(complexityThresholds.size(), 1);
Assert.assertEquals(complexityTh... | [FOCAL] public static List<ComplexityThreshold> ComplexityThresholdsUtils.convertAbacusThresholdsToComplexityThresholds(String[] propertyThresholds)
[CLASS] class ComplexityThresholdsUtils
[METRICS] loc=16 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] String.split/1, Double.valueOf/1, List<Compl... | /* static context
[FOCAL] public static List<ComplexityThreshold> ComplexityThresholdsUtils.convertAbacusThresholdsToComplexityThresholds(String[] propertyThresholds)
[PATH1] foreach(String propertyThreshold : propertyThresholds)=T -> if(temp.length > 1)=T -> exit loop -> return complexityThresholds
[PATH2] foreach(Str... | /* static context
[FOCAL] public static List<ComplexityThreshold> ComplexityThresholdsUtils.convertAbacusThresholdsToComplexityThresholds(String[] propertyThresholds)
[PATH1] foreach(String propertyThreshold : propertyThresholds)=T -> if(temp.length > 1)=T -> exit loop -> return complexityThresholds
[PATH2] foreach(Str... | true | ok | {"focal": {"class": "ComplexityThresholdsUtils", "name": "convertAbacusThresholdsToComplexityThresholds", "signature": "List<ComplexityThreshold> convertAbacusThresholdsToComplexityThresholds(String[] propertyThresholds)", "start_line": 3, "modifiers": "public static", "params": [{"name": "propertyThresholds", "type": ... |
1381874_35 | class Documents {
public static String getId(Object document) {
return getAccessor(document).getId(document);
}
public static void registerAccessor(Class<?> documentType, DocumentAccessor accessor);
public static void setId(Object document, String id);
public static String getRevision(Object document);
public... | assertEquals("jsonNode_id", Documents.getId(nodeDoc));
}
} | [FOCAL] public static String Documents.getId(Object document)
[CLASS] class Documents
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] DocumentAccessor getAccessor(Class<?> documentType)
[CALLS-EXTERNAL] getAccessor(document).getId/1
[INPUTS] branches=- | result=document
[DATAFLOW] ... | /* static context
[FOCAL] public static String Documents.getId(Object document)
[INPUTS] branches=- | result=document
[CALLS-INTERNAL] DocumentAccessor getAccessor(Class<?> documentType)
[CALLS-EXTERNAL] getAccessor(document).getId/1
*/
| /* static context
[FOCAL] public static String Documents.getId(Object document)
[INPUTS] branches=- | result=document
[CALLS-INTERNAL] DocumentAccessor getAccessor(Class<?> documentType)
[CALLS-EXTERNAL] getAccessor(document).getId/1
*/
class Documents {
public static String getId(Object document) {
return getAcces... | true | ok | {"focal": {"class": "Documents", "name": "getId", "signature": "String getId(Object document)", "start_line": 3, "modifiers": "public static", "params": [{"name": "document", "type": "Object"}], "return_type": "String"}, "class_info": {"name": "Documents", "kind": "class", "modifiers": "", "superclass": null, "interfac... |
1387581_34 | class BPMN2ServiceUtil {
public static String getOperationName(TMessage message) {
String ret=Character.toLowerCase(message.getName().charAt(0))+
message.getName().substring(1);
ret = ret.replaceAll("Request", "");
ret = ret.replaceAll("Response", "");
ret = ret.replaceAll("Req", "");
ret = ret.rep... | TMessage m=new TMessage();
m.setName("BuyRequest");
String opName=BPMN2ServiceUtil.getOperationName(m);
if (opName == null) {
fail("No op name");
}
if (!opName.equals("buy")) {
fail("Expecting 'buy', but got: "+opName);
}
}
} | [FOCAL] public static String BPMN2ServiceUtil.getOperationName(TMessage message)
[CLASS] class BPMN2ServiceUtil
[METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Character.toLowerCase/1, message.getName().charAt/1, TMessage.getName/0, message.getName().substring/1, String.replaceAll... | /* static context
[FOCAL] public static String BPMN2ServiceUtil.getOperationName(TMessage message)
[INPUTS] branches=- | result=message
[COLLABORATORS] param message:TMessage getName/0
[CALLS-EXTERNAL] Character.toLowerCase/1, message.getName().charAt/1, TMessage.getName/0, message.getName().substring/1, String.replace... | /* static context
[FOCAL] public static String BPMN2ServiceUtil.getOperationName(TMessage message)
[INPUTS] branches=- | result=message
[COLLABORATORS] param message:TMessage getName/0
[CALLS-EXTERNAL] Character.toLowerCase/1, message.getName().charAt/1, TMessage.getName/0, message.getName().substring/1, String.replace... | true | ok | {"focal": {"class": "BPMN2ServiceUtil", "name": "getOperationName", "signature": "String getOperationName(TMessage message)", "start_line": 3, "modifiers": "public static", "params": [{"name": "message", "type": "TMessage"}], "return_type": "String"}, "class_info": {"name": "BPMN2ServiceUtil", "kind": "class", "modifie... |
1390800_7 | class PipLogParser {
static Map<String, String> parse(String installationLog, Log logger) {
Map<String, String> downloadedDependencies = new HashMap<>();
String[] lines = installationLog.split("\\R");
MutableBoolean expectingPackageFilePath = new MutableBoolean(false);
String packag... | // Build result map.
Map<String, String> expectedResult = new HashMap<String, String>() {{
put("ecopkg1", "ecoPkg1-3.11.tar.gz");
put("ecopkg2", "");
put("ecopkg3", "");
put("ecopkg4", "ecoPkg4-1.1.1-py2.py3-none-any.whl");
put("ecopkg5", "");
... | [FOCAL] static Map<String, String> PipLogParser.parse(String installationLog, Log logger)
[CLASS] class PipLogParser
[METRICS] loc=35 cc=6 branches=4 loops=1 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] String extractPackageName(Map<String, String> downloadedDependencies, Matcher matcher, String packageName, MutableBo... | /* static context
[FOCAL] static Map<String, String> PipLogParser.parse(String installationLog, Log logger)
[PATH1] foreach(String line : lines)=T -> if(matcher.find())#1=F -> if(matcher.find())#2=F -> if(matcher.find())#3=T -> exit loop -> if(expectingPackageFilePath.isTrue())=T -> return downloadedDependencies
[PATH2... | /* static context
[FOCAL] static Map<String, String> PipLogParser.parse(String installationLog, Log logger)
[PATH1] foreach(String line : lines)=T -> if(matcher.find())#1=F -> if(matcher.find())#2=F -> if(matcher.find())#3=T -> exit loop -> if(expectingPackageFilePath.isTrue())=T -> return downloadedDependencies
[PATH2... | true | ok | {"focal": {"class": "PipLogParser", "name": "parse", "signature": "Map<String, String> parse(String installationLog, Log logger)", "start_line": 3, "modifiers": "static", "params": [{"name": "installationLog", "type": "String"}, {"name": "logger", "type": "Log"}], "return_type": "Map<String, String>"}, "class_info": {"... |
1406218_11 | class TransformationContext implements Cloneable {
@Override
public TransformationContext clone()
{
TransformationContext newContext;
try {
newContext = (TransformationContext) super.clone();
} catch (CloneNotSupportedException e) {
// Should never happen
... | TransformationContext context = new TransformationContext();
context.setId("id");
context.setSyntax(Syntax.XWIKI_2_0);
XDOM xdom = new XDOM(Arrays.<Block>asList(new WordBlock("test")));
context.setXDOM(xdom);
TransformationContext newContext = context.clone();
as... | [FOCAL] @Override public TransformationContext TransformationContext.clone()
[CLASS] class TransformationContext implements Cloneable
[METRICS] loc=13 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] super.clone/0
[NEW] RuntimeException
[EXCEPTIONS] throws RuntimeException; catches CloneNotSupporte... | /* static context
[FOCAL] @Override public TransformationContext TransformationContext.clone()
[THROWS-WHEN] RuntimeException when try-body throws
[PATH1] try-body throws -> throw new RuntimeException("Failed to clone object", e)
[PATH2] return newContext
[EXCEPTIONS] throws RuntimeException; catches CloneNotSupportedE... | /* static context
[FOCAL] @Override public TransformationContext TransformationContext.clone()
[THROWS-WHEN] RuntimeException when try-body throws
[PATH1] try-body throws -> throw new RuntimeException("Failed to clone object", e)
[PATH2] return newContext
[EXCEPTIONS] throws RuntimeException; catches CloneNotSupportedE... | true | ok | {"focal": {"class": "TransformationContext", "name": "clone", "signature": "TransformationContext clone()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "TransformationContext"}, "class_info": {"name": "TransformationContext", "kind": "class", "modifiers": "", "superclass": null, "inte... |
1407946_8 | class PanLine extends JPanel {
public void setCustomWidthUnit(EnumWidthUnit enumWidthUnit) {
comboBoxWidthUnit.setSelectedItem(enumWidthUnit);
}
public PanLine();
public String getAlign();
public String getThickness();
public String getCustomWidth();
public String getCustomWidthUnit();
public String getCo... | JComboBox comboBox = new JComboBox();
for (EnumWidthUnit enumWidthUnit : EnumWidthUnit.values()) {
comboBox.addItem(enumWidthUnit);
}
comboBox.setSelectedIndex(0);
Whitebox.setInternalState(panLine, "comboBoxWidthUnit", comboBox);
panLine.setCustomWidthUnit(EnumWidthUnit.PIXEL);
String actual = ((EnumW... | [FOCAL] public void PanLine.setCustomWidthUnit(EnumWidthUnit enumWidthUnit)
[CLASS] class PanLine extends JPanel
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] comboBoxWidthUnit.setSelectedItem/1
[COLLABORATORS] field comboBoxWidthUnit setSelectedItem/1
[DATAFLOW] enumWidthUnit@pa... | /* static context
[FOCAL] public void PanLine.setCustomWidthUnit(EnumWidthUnit enumWidthUnit)
[COLLABORATORS] field comboBoxWidthUnit setSelectedItem/1
[CALLS-EXTERNAL] comboBoxWidthUnit.setSelectedItem/1
*/
| /* static context
[FOCAL] public void PanLine.setCustomWidthUnit(EnumWidthUnit enumWidthUnit)
[COLLABORATORS] field comboBoxWidthUnit setSelectedItem/1
[CALLS-EXTERNAL] comboBoxWidthUnit.setSelectedItem/1
*/
class PanLine extends JPanel {
public void setCustomWidthUnit(EnumWidthUnit enumWidthUnit) {
comboBoxWidthUn... | true | ok | {"focal": {"class": "PanLine", "name": "setCustomWidthUnit", "signature": "void setCustomWidthUnit(EnumWidthUnit enumWidthUnit)", "start_line": 3, "modifiers": "public", "params": [{"name": "enumWidthUnit", "type": "EnumWidthUnit"}], "return_type": "void"}, "class_info": {"name": "PanLine", "kind": "class", "modifiers"... |
1415645_1 | class CustomerStatementReader implements ItemReader<Statement> {
public Statement read() throws Exception, UnexpectedInputException,
ParseException {
Customer customer = customerReader.read();
if(customer == null) {
return null;
} else {
... | Customer customer = new Customer();
customer.setId(5l);
when(customerReader.read()).thenReturn(customer);
when(tickerDao.getTotalValueForCustomer(5l)).thenReturn(
new BigDecimal("500.00"));
when(tickerDao.getStocksForCustomer(5l)).thenReturn(
new ... | [FOCAL] public Statement CustomerStatementReader.read()
[CLASS] class CustomerStatementReader implements ItemReader<Statement>
[METRICS] loc=17 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] ItemReader<Customer>.read/0, Statement.setCustomer/1, Statement.setSecurityTotal/1, TickerDao.getTotalValu... | /* static context
[FOCAL] public Statement CustomerStatementReader.read()
[PATH1] if(customer == null)=T -> return null
[PATH2] if(customer == null)=F -> return statement
[INPUTS] branches=customerReader | result=-
[COLLABORATORS] field customerReader:ItemReader<Customer> read/0; field tickerDao:TickerDao getTotalValue... | /* static context
[FOCAL] public Statement CustomerStatementReader.read()
[PATH1] if(customer == null)=T -> return null
[PATH2] if(customer == null)=F -> return statement
[INPUTS] branches=customerReader | result=-
[COLLABORATORS] field customerReader:ItemReader<Customer> read/0; field tickerDao:TickerDao getTotalValue... | true | ok | {"focal": {"class": "CustomerStatementReader", "name": "read", "signature": "Statement read() throws Exception, UnexpectedInputException, ParseException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Statement"}, "class_info": {"name": "CustomerStatementReader", "kind": "class", "modifiers": ""... |
1421692_13 | class CollectionUtils {
public static <K, V> Map<K, List<V>> groupBy(Collection<V> list, Closure<K, V> closure) {
if (null == closure) {
throw new IllegalArgumentException("closure must not be null!");
}
Map<K, List<V>> ret = new HashMap<K, List<V>>();
if (null != list) {
for (V v : list) {
K k = cl... | Map<K, List<V>> map = CollectionUtils.groupBy(list, closure);
Assert.assertEquals(map, expected);
}
} | [FOCAL] public static Map<K, List<V>> CollectionUtils.groupBy(Collection<V> list, Closure<K, V> closure)
[CLASS] class CollectionUtils
[METRICS] loc=16 cc=5 branches=3 loops=1 returns=1 throws=1 nesting=3
[CALLS-EXTERNAL] Closure<K, V>.execute/1, Map<K, List<V>>.containsKey/1, Map<K, List<V>>.put/2, ret.get(k).add/1, M... | /* static context
[FOCAL] public static Map<K, List<V>> CollectionUtils.groupBy(Collection<V> list, Closure<K, V> closure)
[THROWS-WHEN] IllegalArgumentException when null == closure
[PATH1] if(null == closure)=F -> if(null != list)=T -> foreach(V v : list)=T -> if(!ret.containsKey(k))=T -> exit loop -> return ret
[PAT... | /* static context
[FOCAL] public static Map<K, List<V>> CollectionUtils.groupBy(Collection<V> list, Closure<K, V> closure)
[THROWS-WHEN] IllegalArgumentException when null == closure
[PATH1] if(null == closure)=F -> if(null != list)=T -> foreach(V v : list)=T -> if(!ret.containsKey(k))=T -> exit loop -> return ret
[PAT... | true | ok | {"focal": {"class": "CollectionUtils", "name": "groupBy", "signature": "Map<K, List<V>> groupBy(Collection<V> list, Closure<K, V> closure)", "start_line": 3, "modifiers": "public static", "params": [{"name": "list", "type": "Collection<V>"}, {"name": "closure", "type": "Closure<K, V>"}], "return_type": "Map<K, List<V>>... |
1443269_38 | class BlockCache {
public BlockCache(BlurMetrics metrics, boolean directAllocation, long totalMemory) {
this(metrics,directAllocation,totalMemory,_128M);
}
public BlockCache(BlurMetrics metrics, boolean directAllocation, long totalMemory);
public BlockCache(BlurMetrics metrics, boolean directAllocation,... | int blocksInTest = 2000000;
int blockSize = 1024;
int slabSize = blockSize * 4096;
long totalMemory = 2 * slabSize;
BlockCache blockCache = new BlockCache(new BlurMetrics(new Configuration()), true,totalMemory,slabSize,blockSize);
byte[] buffer = new byte[1024];
Random random = new... | [FOCAL] public BlockCache.BlockCache(BlurMetrics metrics, boolean directAllocation, long totalMemory)
[CLASS] class BlockCache
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[DATAFLOW] directAllocation@param->L2; metrics@param->L2; totalMemory@param->L2
[CLASS-MEMBERS] BlockCache(BlurMetrics metri... | /* static context
[FOCAL] public BlockCache.BlockCache(BlurMetrics metrics, boolean directAllocation, long totalMemory)
*/
| /* static context
[FOCAL] public BlockCache.BlockCache(BlurMetrics metrics, boolean directAllocation, long totalMemory)
*/
class BlockCache {
public BlockCache(BlurMetrics metrics, boolean directAllocation, long totalMemory) {
this(metrics,directAllocation,totalMemory,_128M);
}
public BlockCache(BlurMetric... | true | ok | {"focal": {"class": "BlockCache", "name": "BlockCache", "signature": "BlockCache(BlurMetrics metrics, boolean directAllocation, long totalMemory)", "start_line": 3, "modifiers": "public", "params": [{"name": "metrics", "type": "BlurMetrics"}, {"name": "directAllocation", "type": "boolean"}, {"name": "totalMemory", "typ... |
1446919_9 | class ScreenNameValidator extends ScreenNameValidatorDB {
public String checkName(String name) {
build();
String rval = checkName(name, malesDB);
if (rval == null) {
rval = checkName(name, femalesDB);
}
return rval;
}
public ScreenNameValidator();
private void build();
public String checkName(Stri... | Assert.assertTrue(validator.checkName("mary", false).equals("Mary"));
Assert.assertTrue(validator.checkName("JANE", false).equals("Jane"));
Assert.assertTrue(validator.checkName("lIZ", false).equals("Liz"));
Assert.assertTrue(validator.checkName("ShArOn", false).equals("Sharon"));
Assert.assertTrue(validator... | [FOCAL] public String ScreenNameValidator.checkName(String name)
[CLASS] class ScreenNameValidator extends ScreenNameValidatorDB
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] String checkName(String name, boolean isMale); void build()
[PATH1] if(rval == null)=T -> return rval
[PA... | /* static context
[FOCAL] public String ScreenNameValidator.checkName(String name)
[PATH1] if(rval == null)=T -> return rval
[PATH2] if(rval == null)=F -> return rval
[INPUTS] branches=name | result=name
[CALLS-INTERNAL] String checkName(String name, boolean isMale); void build()
*/
| /* static context
[FOCAL] public String ScreenNameValidator.checkName(String name)
[PATH1] if(rval == null)=T -> return rval
[PATH2] if(rval == null)=F -> return rval
[INPUTS] branches=name | result=name
[CALLS-INTERNAL] String checkName(String name, boolean isMale); void build()
*/
class ScreenNameValidator extends Sc... | true | ok | {"focal": {"class": "ScreenNameValidator", "name": "checkName", "signature": "String checkName(String name)", "start_line": 3, "modifiers": "public", "params": [{"name": "name", "type": "String"}], "return_type": "String"}, "class_info": {"name": "ScreenNameValidator", "kind": "class", "modifiers": "", "superclass": "S... |
1450115_60 | class Uri {
public String toRelativeUrl() {
StringBuilder sb = StringBuilderPool.DEFAULT.stringBuilder();
if (MiscUtils.isNonEmpty(path))
sb.append(path);
else
sb.append('/');
if (query != null)
sb.append('?').append(query);
return sb.toString();
}
public Uri(String schem... | Uri uri = new Uri("http", "user", "example.com", 44, null, "query=4", null);
String relativeUrl = uri.toRelativeUrl();
assertEquals(relativeUrl, "/?query=4", "toRelativeUrl returned incorrect url");
}
} | [FOCAL] public String Uri.toRelativeUrl()
[CLASS] class Uri
[METRICS] loc=11 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] StringBuilderPool.DEFAULT.stringBuilder/0, MiscUtils.isNonEmpty/1, StringBuilder.append/1, sb.append('?').append/1, StringBuilder.toString/0
[PATH1] if(MiscUtils.isNonEmpty(... | /* static context
[FOCAL] public String Uri.toRelativeUrl()
[PATH1] if(MiscUtils.isNonEmpty(path))=T -> if(query != null)=T -> return sb.toString()
[PATH2] if(MiscUtils.isNonEmpty(path))=F -> if(query != null)=F -> return sb.toString()
[CALLS-EXTERNAL] StringBuilderPool.DEFAULT.stringBuilder/0, MiscUtils.isNonEmpty/1, ... | /* static context
[FOCAL] public String Uri.toRelativeUrl()
[PATH1] if(MiscUtils.isNonEmpty(path))=T -> if(query != null)=T -> return sb.toString()
[PATH2] if(MiscUtils.isNonEmpty(path))=F -> if(query != null)=F -> return sb.toString()
[CALLS-EXTERNAL] StringBuilderPool.DEFAULT.stringBuilder/0, MiscUtils.isNonEmpty/1, ... | true | ok | {"focal": {"class": "Uri", "name": "toRelativeUrl", "signature": "String toRelativeUrl()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "Uri", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Uri", "ki... |
1452945_0 | class PrototypeWrapper {
public AbstractPE getPE(String keyValue) {
AbstractPE pe = null;
try {
pe = (AbstractPE) lookupTable.get(keyValue);
if (pe == null) {
pe = (AbstractPE) prototype.clone();
pe.initInstance();
}
//... | MockPE prototype = new MockPE();
PrototypeWrapper prototypeWrapper = new PrototypeWrapper(prototype,
new WallClock());
assertEquals(0, prototype.getInitializeCount());
MockPE instance = (MockPE)prototypeWrapper.getPE("asd");
assertNotNull(instance);
... | [FOCAL] public AbstractPE PrototypeWrapper.getPE(String keyValue)
[CLASS] class PrototypeWrapper
[METRICS] loc=17 cc=3 branches=1 loops=0 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] lookupTable.get/1, prototype.clone/0, AbstractPE.initInstance/0, lookupTable.set/3, prototype.getTtl/0, logger.error/2
[EXCEPTIONS] catc... | /* static context
[FOCAL] public AbstractPE PrototypeWrapper.getPE(String keyValue)
[PATH1] try-body throws -> return pe
[PATH2] if(pe == null)=T -> return pe
[PATH3] if(pe == null)=F -> return pe
[INPUTS] branches=keyValue | result=keyValue
[COLLABORATORS] field lookupTable get/1,set/3; field prototype clone/0,getTtl/... | /* static context
[FOCAL] public AbstractPE PrototypeWrapper.getPE(String keyValue)
[PATH1] try-body throws -> return pe
[PATH2] if(pe == null)=T -> return pe
[PATH3] if(pe == null)=F -> return pe
[INPUTS] branches=keyValue | result=keyValue
[COLLABORATORS] field lookupTable get/1,set/3; field prototype clone/0,getTtl/... | true | ok | {"focal": {"class": "PrototypeWrapper", "name": "getPE", "signature": "AbstractPE getPE(String keyValue)", "start_line": 3, "modifiers": "public", "params": [{"name": "keyValue", "type": "String"}], "return_type": "AbstractPE"}, "class_info": {"name": "PrototypeWrapper", "kind": "class", "modifiers": "", "superclass": ... |
1458461_1 | class MetadataTask {
public void setPropertyFile(File file) {
this.propertyFile = file;
}
public void setPersistenceUnit(String pU);
public void setConfigFile(File file);
public void setType(String type);
public void addConfiguredFileSet(FileSet fileSet);
public MetadataDescriptor createMetadataDescriptor();... | MetadataTask mdt = new MetadataTask();
assertNull(mdt.propertyFile);
File f = new File(".");
mdt.setPropertyFile(f);
assertSame(f, mdt.propertyFile);
}
} | [FOCAL] public void MetadataTask.setPropertyFile(File file)
[CLASS] class MetadataTask
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[FIELDS] write=propertyFile
[STATE] propertyFile
[DATAFLOW] file@param->L2
[CLASS-MEMBERS] void setPersistenceUnit(String pU); void setConfigFile(File file); void s... | /* static context
[FOCAL] public void MetadataTask.setPropertyFile(File file)
[STATE] propertyFile
[FIELDS] write=propertyFile
*/
| /* static context
[FOCAL] public void MetadataTask.setPropertyFile(File file)
[STATE] propertyFile
[FIELDS] write=propertyFile
*/
class MetadataTask {
public void setPropertyFile(File file) {
this.propertyFile = file;
}
public void setPersistenceUnit(String pU);
public void setConfigFile(File file);
public voi... | true | ok | {"focal": {"class": "MetadataTask", "name": "setPropertyFile", "signature": "void setPropertyFile(File file)", "start_line": 3, "modifiers": "public", "params": [{"name": "file", "type": "File"}], "return_type": "void"}, "class_info": {"name": "MetadataTask", "kind": "class", "modifiers": "", "superclass": null, "inter... |
1463490_1023 | class XMLScriptService implements ScriptService {
public String transform(Source xml, Source xslt)
{
return XMLUtils.transform(xml, xslt);
}
public XMLScriptService();
public static String escape(Object content);
public static String escapeForAttributeValue(Object content);
publi... | String d = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><a b='c'>d</a>";
String s = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ "<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>" +
"<xsl:output method='xml' omit-xml-declaration='yes'/>"
... | [FOCAL] public String XMLScriptService.transform(Source xml, Source xslt)
[CLASS] class XMLScriptService implements ScriptService
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] XMLUtils.transform/2
[INPUTS] branches=- | result=xml, xslt
[DATAFLOW] xml@param->L3; xslt@param->L3
[CL... | /* static context
[FOCAL] public String XMLScriptService.transform(Source xml, Source xslt)
[INPUTS] branches=- | result=xml, xslt
[CALLS-EXTERNAL] XMLUtils.transform/2
*/
| /* static context
[FOCAL] public String XMLScriptService.transform(Source xml, Source xslt)
[INPUTS] branches=- | result=xml, xslt
[CALLS-EXTERNAL] XMLUtils.transform/2
*/
class XMLScriptService implements ScriptService {
public String transform(Source xml, Source xslt)
{
return XMLUtils.transform(xml,... | true | ok | {"focal": {"class": "XMLScriptService", "name": "transform", "signature": "String transform(Source xml, Source xslt)", "start_line": 3, "modifiers": "public", "params": [{"name": "xml", "type": "Source"}, {"name": "xslt", "type": "Source"}], "return_type": "String"}, "class_info": {"name": "XMLScriptService", "kind": "... |
1469749_197 | class MetadataValue {
public void setConfidence(int value)
{
this.confidence = value;
}
public MetadataValue(TableRow row);
public MetadataValue();
public MetadataValue(MetadataField field);
public int getFieldId();
public void setFieldId(int fieldId);
public int getIte... | int value = 5;
mv.setConfidence(value);
assertThat("testSetConfidence 0",mv.getConfidence(), equalTo(value));
}
} | [FOCAL] public void MetadataValue.setConfidence(int value)
[CLASS] class MetadataValue
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[FIELDS] write=confidence
[STATE] confidence via getConfidence()
[DATAFLOW] value@param->L3
[CLASS-MEMBERS] MetadataValue(TableRow row); MetadataValue(); MetadataVa... | /* static context
[FOCAL] public void MetadataValue.setConfidence(int value)
[STATE] confidence via getConfidence()
[FIELDS] write=confidence
*/
| /* static context
[FOCAL] public void MetadataValue.setConfidence(int value)
[STATE] confidence via getConfidence()
[FIELDS] write=confidence
*/
class MetadataValue {
public void setConfidence(int value)
{
this.confidence = value;
}
public MetadataValue(TableRow row);
public MetadataValu... | true | ok | {"focal": {"class": "MetadataValue", "name": "setConfidence", "signature": "void setConfidence(int value)", "start_line": 3, "modifiers": "public", "params": [{"name": "value", "type": "int"}], "return_type": "void"}, "class_info": {"name": "MetadataValue", "kind": "class", "modifiers": "", "superclass": null, "interfa... |
1475915_4 | class TextTranslator {
public String translate(String text) {
for (TagTranslator translator : tagTranslators) {
text= translator.translate(text);
}
return text;
}
public TextTranslator(Mapping mapping);
private TextTranslator target;
}
class TextTranslatorTest {
private TextTranslator... | assertEquals("", target.translate(""));
assertEquals("", target.translate(null));
assertEquals("hello", target.translate("hello"));
assertEquals("<a href=\"\">click</a>", target.translate("<a href=''>click</a>"));
assertEquals("<a href=\"yahoo\">click</a>", target.translate("<a href='yahoo'>click</a... | [FOCAL] public String TextTranslator.translate(String text)
[CLASS] class TextTranslator
[METRICS] loc=6 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] TagTranslator.translate/1
[PATH1] foreach(TagTranslator translator : tagTranslators)=T -> exit loop -> return text
[PATH2] foreach(TagTranslator ... | /* static context
[FOCAL] public String TextTranslator.translate(String text)
[PATH1] foreach(TagTranslator translator : tagTranslators)=T -> exit loop -> return text
[PATH2] foreach(TagTranslator translator : tagTranslators)=F -> return text
[INPUTS] branches=- | result=text
[CALLS-EXTERNAL] TagTranslator.translate/1
... | /* static context
[FOCAL] public String TextTranslator.translate(String text)
[PATH1] foreach(TagTranslator translator : tagTranslators)=T -> exit loop -> return text
[PATH2] foreach(TagTranslator translator : tagTranslators)=F -> return text
[INPUTS] branches=- | result=text
[CALLS-EXTERNAL] TagTranslator.translate/1
... | true | ok | {"focal": {"class": "TextTranslator", "name": "translate", "signature": "String translate(String text)", "start_line": 3, "modifiers": "public", "params": [{"name": "text", "type": "String"}], "return_type": "String"}, "class_info": {"name": "TextTranslator", "kind": "class", "modifiers": "", "superclass": null, "inter... |
1481910_4 | class ResourceCodeWriter extends CodeWriter {
@Override
public OutputStream openBinary(JPackage pkg, String fileName) throws IOException {
FileObject resource = filer.createResource(StandardLocation.SOURCE_OUTPUT, pkg.name(), fileName);
return resource.openOutputStream();
}
public ResourceCodeWriter(Filer fi... | Filer filer = mock(Filer.class);
FileObject fileObject = mock(FileObject.class);
when(filer.createResource(Mockito.<Location> any(), anyString(), anyString())).thenReturn(fileObject);
ResourceCodeWriter resourceCodeWriter = new ResourceCodeWriter(filer);
JPackage jPackage = new JCodeModel()._package("some... | [FOCAL] @Override public OutputStream ResourceCodeWriter.openBinary(JPackage pkg, String fileName)
[CLASS] class ResourceCodeWriter extends CodeWriter
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] filer.createResource/3, JPackage.name/0, FileObject.openOutputStream/0
[EXCEPTIONS]... | /* static context
[FOCAL] @Override public OutputStream ResourceCodeWriter.openBinary(JPackage pkg, String fileName)
[INPUTS] branches=- | result=fileName, pkg
[COLLABORATORS] field filer createResource/3; param pkg:JPackage name/0
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] filer.createResource/3, JPackage.name... | /* static context
[FOCAL] @Override public OutputStream ResourceCodeWriter.openBinary(JPackage pkg, String fileName)
[INPUTS] branches=- | result=fileName, pkg
[COLLABORATORS] field filer createResource/3; param pkg:JPackage name/0
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] filer.createResource/3, JPackage.name... | true | ok | {"focal": {"class": "ResourceCodeWriter", "name": "openBinary", "signature": "OutputStream openBinary(JPackage pkg, String fileName) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "pkg", "type": "JPackage"}, {"name": "fileName", "type": "String"}], "return_type": "OutputStrea... |
1484463_8 | class RateTransform extends Transform {
@Override
public Object process(Object value)
{
Long time = System.currentTimeMillis();
if (this.lastValue == null) {
this.lastUpdate = time;
this.lastValue = value;
return null; // no value at this time
}
if (!(value instanceof Number)) {
thro... | RateTransform rt = new RateTransform();
assertEquals(null, rt.process(new Double(12)));
}
} | [FOCAL] @Override public Object RateTransform.process(Object value)
[CLASS] class RateTransform extends Transform
[METRICS] loc=38 cc=6 branches=5 loops=0 returns=3 throws=1 nesting=2
[CALLS-EXTERNAL] System.currentTimeMillis/0, String.format/3, Object.toString/0, value.getClass().getName/0, Object.getClass/0, ((Number... | /* static context
[FOCAL] @Override public Object RateTransform.process(Object value)
[THROWS-WHEN] IllegalArgumentException when !(this.lastValue == null) && !(value instanceof Number)
[PATH1] if(this.lastValue == null)=F -> if(!(value instanceof Number))=F -> if(timeChangeInSeconds == 0.0)=F -> if(Math.abs(rate) < EP... | /* static context
[FOCAL] @Override public Object RateTransform.process(Object value)
[THROWS-WHEN] IllegalArgumentException when !(this.lastValue == null) && !(value instanceof Number)
[PATH1] if(this.lastValue == null)=F -> if(!(value instanceof Number))=F -> if(timeChangeInSeconds == 0.0)=F -> if(Math.abs(rate) < EP... | true | ok | {"focal": {"class": "RateTransform", "name": "process", "signature": "Object process(Object value)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "value", "type": "Object"}], "return_type": "Object"}, "class_info": {"name": "RateTransform", "kind": "class", "modifiers": "", "superclass": "Trans... |
1493029_0 | class ClasspathResources extends JarResources {
public void loadResource(URL url) {
try {
// Is Local
loadResource( new File( url.toURI() ), "" );
} catch (IllegalArgumentException iae) {
// Is Remote
loadRemoteResource( url );
} catch (URISyn... | final String name = "test";
ClasspathResources jarResources = getClasspathResources(name);
URL resourceURL = jarResources.getResourceURL("test.properties");
Properties props = getProperties(resourceURL);
assertEquals("testval", props.getProperty("testkey"));
}
} | [FOCAL] public void ClasspathResources.loadResource(URL url)
[CLASS] class ClasspathResources extends JarResources
[METRICS] loc=11 cc=3 branches=0 loops=0 returns=0 throws=1 nesting=1
[CALLS-INTERNAL] void loadRemoteResource(URL url); void loadResource(File fol, String packName)
[CALLS-EXTERNAL] URL.toURI/0
[NEW] File... | /* static context
[FOCAL] public void ClasspathResources.loadResource(URL url)
[THROWS-WHEN] JclException when try-body throws
[PATH1] try-body throws -> throw new JclException( "URISyntaxException", e )
[COLLABORATORS] param url:URL toURI/0
[EXCEPTIONS] throws JclException; catches IllegalArgumentException iae, URISyn... | /* static context
[FOCAL] public void ClasspathResources.loadResource(URL url)
[THROWS-WHEN] JclException when try-body throws
[PATH1] try-body throws -> throw new JclException( "URISyntaxException", e )
[COLLABORATORS] param url:URL toURI/0
[EXCEPTIONS] throws JclException; catches IllegalArgumentException iae, URISyn... | true | ok | {"focal": {"class": "ClasspathResources", "name": "loadResource", "signature": "void loadResource(URL url)", "start_line": 3, "modifiers": "public", "params": [{"name": "url", "type": "URL"}], "return_type": "void"}, "class_info": {"name": "ClasspathResources", "kind": "class", "modifiers": "", "superclass": "JarResour... |
1495584_7 | class FunkyFunction implements ClassFunction<T> {
public T execute() {
try {
return constructor.newInstance(constructionArguments);
} catch (InvocationTargetException e) {
Throwable cause = e.getCause();
/*
* Due to constraints on the constructor, ca... | final int test = 2;
// @off
class Instantiated {{ assertEquals(2, test); }}
// @on
FunkyFunction<Instantiated> executor = new FunkyFunction<Instantiated>(Instantiated.class);
executor.execute();
}
} | [FOCAL] public T FunkyFunction.execute()
[CLASS] class FunkyFunction implements ClassFunction<T>
[METRICS] loc=18 cc=4 branches=1 loops=0 returns=1 throws=3 nesting=2
[CALLS-EXTERNAL] constructor.newInstance/1, Exception.getCause/0
[NEW] IllegalStateException
[EXCEPTIONS] throws throw ((Error) cause), throw ((RuntimeEx... | /* static context
[FOCAL] public T FunkyFunction.execute()
[THROWS-WHEN] ((Error) cause) when try-body throws && cause instanceof Error
[THROWS-WHEN] ((RuntimeException) cause) when try-body throws && !(cause instanceof Error)
[THROWS-WHEN] IllegalStateException when try-body throws
[PATH1] try-body throws -> if(cause ... | /* static context
[FOCAL] public T FunkyFunction.execute()
[THROWS-WHEN] ((Error) cause) when try-body throws && cause instanceof Error
[THROWS-WHEN] ((RuntimeException) cause) when try-body throws && !(cause instanceof Error)
[THROWS-WHEN] IllegalStateException when try-body throws
[PATH1] try-body throws -> if(cause ... | true | ok | {"focal": {"class": "FunkyFunction", "name": "execute", "signature": "T execute()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "T"}, "class_info": {"name": "FunkyFunction", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "ClassFunction<T>", "fields": [{"name": "NULL_PARAM_A... |
1502367_17 | class Converter {
public static List<Long> typeConvert(Iterable<String> list) {
List<Long> result = new ArrayList<Long>();
for (String element : list) {
if (StringUtils.isNotBlank(element)) {
result.add(NumberUtils.toLong(element));
}
}
return result;
}
}
class ConverterTest {
@Test
public voi... | ArrayList<String> a = Lists.newArrayList("1", "2", "3");
List<Long> b = Converter.typeConvert(a);
Assert.assertEquals(a.size(), b.size());
}
} | [FOCAL] public static List<Long> Converter.typeConvert(Iterable<String> list)
[CLASS] class Converter
[METRICS] loc=9 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] StringUtils.isNotBlank/1, List<Long>.add/1, NumberUtils.toLong/1
[NEW] ArrayList<Long>
[PATH1] foreach(String element : list)=T -> i... | /* static context
[FOCAL] public static List<Long> Converter.typeConvert(Iterable<String> list)
[PATH1] foreach(String element : list)=T -> if(StringUtils.isNotBlank(element))=T -> exit loop -> return result
[PATH2] foreach(String element : list)=F -> return result
[PATH3] foreach(String element : list)=T -> if(StringU... | /* static context
[FOCAL] public static List<Long> Converter.typeConvert(Iterable<String> list)
[PATH1] foreach(String element : list)=T -> if(StringUtils.isNotBlank(element))=T -> exit loop -> return result
[PATH2] foreach(String element : list)=F -> return result
[PATH3] foreach(String element : list)=T -> if(StringU... | true | ok | {"focal": {"class": "Converter", "name": "typeConvert", "signature": "List<Long> typeConvert(Iterable<String> list)", "start_line": 3, "modifiers": "public static", "params": [{"name": "list", "type": "Iterable<String>"}], "return_type": "List<Long>"}, "class_info": {"name": "Converter", "kind": "class", "modifiers": "... |
1511246_13 | class CompilingProxyFactory extends ProxyFactory {
@SuppressWarnings("unchecked")
public <T> T createProxy(T obj, final InvocationHandler handler) {
Class<?> c = obj.getClass();
Class<?> pc = getClassProxy(c);
Constructor<?> cons;
try {
cons = pc.getConstructor(new C... | createProxy(new ClassWithBridgeMethod()).clone();
assertEquals("clone = ClassWithBridgeMethod", buff.toString());
// even bridge methods should be intercepted (there are two clone methods)
callCloneMethods(0, new ClassWithBridgeMethod());
callCloneMethods(1, createProxy(new Class... | [FOCAL] @SuppressWarnings("unchecked") public T CompilingProxyFactory.createProxy(T obj, InvocationHandler handler)
[CLASS] class CompilingProxyFactory extends ProxyFactory
[METRICS] loc=16 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-INTERNAL] Class<?> getClassProxy(Class<?> c)
[CALLS-EXTERNAL] T.getCla... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public T CompilingProxyFactory.createProxy(T obj, InvocationHandler handler)
[THROWS-WHEN] ia when try-body throws
[PATH1] try-body throws -> throw ia
[PATH2] return (T) cons.newInstance(new Object[] { handler })
[INPUTS] branches=- | result=handler, obj
[COLLABO... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public T CompilingProxyFactory.createProxy(T obj, InvocationHandler handler)
[THROWS-WHEN] ia when try-body throws
[PATH1] try-body throws -> throw ia
[PATH2] return (T) cons.newInstance(new Object[] { handler })
[INPUTS] branches=- | result=handler, obj
[COLLABO... | true | ok | {"focal": {"class": "CompilingProxyFactory", "name": "createProxy", "signature": "T createProxy(T obj, InvocationHandler handler)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public", "params": [{"name": "obj", "type": "T"}, {"name": "handler", "type": "InvocationHandler"}], "return_type": "T"}, "c... |
1516026_123 | class CustomValidator implements FieldHookDefinition, ErrorMessageDefinition {
@Override
public boolean call(final Entity entity, final Object oldValue, final Object newValue) {
if (fieldHook.call(entity, oldValue, newValue)) {
return true;
}
if (entity.getError(fieldDefinit... | // given
Map<String, ErrorMessage> errors = Maps.newHashMap();
errors.put("another" + FIELD_NAME, new ErrorMessage(CUSTOM_MSG));
stubFieldHookDef(false, errors);
// when
boolean isValid = customValidator.call(entity, oldValue, newValue);
// then
assertFa... | [FOCAL] @Override public boolean CustomValidator.call(Entity entity, Object oldValue, Object newValue)
[CLASS] class CustomValidator implements FieldHookDefinition, ErrorMessageDefinition
[METRICS] loc=10 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] fieldHook.call/3, Entity.getError/1, FieldDef... | /* static context
[FOCAL] @Override public boolean CustomValidator.call(Entity entity, Object oldValue, Object newValue)
[PATH1] if(fieldHook.call(entity, oldValue, newValue))=F -> if(entity.getError(fieldDefinition.getName()) == null)=T -> return false
[PATH2] if(fieldHook.call(entity, oldValue, newValue))=T -> return... | /* static context
[FOCAL] @Override public boolean CustomValidator.call(Entity entity, Object oldValue, Object newValue)
[PATH1] if(fieldHook.call(entity, oldValue, newValue))=F -> if(entity.getError(fieldDefinition.getName()) == null)=T -> return false
[PATH2] if(fieldHook.call(entity, oldValue, newValue))=T -> return... | true | ok | {"focal": {"class": "CustomValidator", "name": "call", "signature": "boolean call(Entity entity, Object oldValue, Object newValue)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "entity", "type": "Entity"}, {"name": "oldValue", "type": "Object"}, {"name": "newValue", "type": "Object"}], "return... |
1520524_34 | class SingleMappingHandler implements IResults {
@Override
public synchronized AtomAtomMapping getFirstAtomMapping() {
if (allAtomMCS.iterator().hasNext()) {
return allAtomMCS.iterator().next();
}
return new AtomAtomMapping(source, target);
}
public SingleMappingHa... | ////////System.out.println("getFirstMapping");
IAtom atomSource = new Atom("R");
IAtom atomTarget = new Atom("R");
IAtomContainer source = new AtomContainer();
source.addAtom(atomSource);
IAtomContainer target = new AtomContainer();
target.addAtom(atomTarget);
... | [FOCAL] @Override public synchronized AtomAtomMapping SingleMappingHandler.getFirstAtomMapping()
[CLASS] class SingleMappingHandler implements IResults
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] allAtomMCS.iterator().hasNext/0, allAtomMCS.iterator/0, allAtomMCS.iterator().next... | /* static context
[FOCAL] @Override public synchronized AtomAtomMapping SingleMappingHandler.getFirstAtomMapping()
[PATH1] if(allAtomMCS.iterator().hasNext())=T -> return allAtomMCS.iterator().next()
[PATH2] if(allAtomMCS.iterator().hasNext())=F -> return new AtomAtomMapping(source, target)
[COLLABORATORS] field allAto... | /* static context
[FOCAL] @Override public synchronized AtomAtomMapping SingleMappingHandler.getFirstAtomMapping()
[PATH1] if(allAtomMCS.iterator().hasNext())=T -> return allAtomMCS.iterator().next()
[PATH2] if(allAtomMCS.iterator().hasNext())=F -> return new AtomAtomMapping(source, target)
[COLLABORATORS] field allAto... | true | ok | {"focal": {"class": "SingleMappingHandler", "name": "getFirstAtomMapping", "signature": "AtomAtomMapping getFirstAtomMapping()", "start_line": 3, "modifiers": "@Override public synchronized", "params": [], "return_type": "AtomAtomMapping"}, "class_info": {"name": "SingleMappingHandler", "kind": "class", "modifiers": ""... |
1535924_5 | class Activator implements BundleActivator, ServiceListener {
@Override
public void stop( BundleContext bundleContext ) throws Exception {
AccessManagerFactoryTracker managerFactoryTracker = getAccessManagerFactoryTracker();
if (null != managerFactoryTracker) {
managerFactoryTracke... | BundleContext bundleContext = mock(BundleContext.class);
final AccessManagerFactoryTracker accessManagerFactoryTracker = mock(AccessManagerFactoryTracker.class);
Activator activator = new Activator() {
@Override
protected AccessManagerFactoryTracker getAccessManagerFact... | [FOCAL] @Override public void Activator.stop(BundleContext bundleContext)
[CLASS] class Activator implements BundleActivator, ServiceListener
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] AccessManagerFactoryTracker getAccessManagerFactoryTracker()
[CALLS-EXTERNAL] AccessManagerF... | /* static context
[FOCAL] @Override public void Activator.stop(BundleContext bundleContext)
[PATH1] if(null != managerFactoryTracker)=T
[PATH2] if(null != managerFactoryTracker)=F
[INPUTS] branches=- | result=- | unused=bundleContext
[EXCEPTIONS] declares Exception
[CALLS-INTERNAL] AccessManagerFactoryTracker getAccess... | /* static context
[FOCAL] @Override public void Activator.stop(BundleContext bundleContext)
[PATH1] if(null != managerFactoryTracker)=T
[PATH2] if(null != managerFactoryTracker)=F
[INPUTS] branches=- | result=- | unused=bundleContext
[EXCEPTIONS] declares Exception
[CALLS-INTERNAL] AccessManagerFactoryTracker getAccess... | true | ok | {"focal": {"class": "Activator", "name": "stop", "signature": "void stop(BundleContext bundleContext) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "bundleContext", "type": "BundleContext"}], "return_type": "void"}, "class_info": {"name": "Activator", "kind": "class", "modifie... |
1548514_2 | class RubyKlassNavigator extends KlassNavigator<RubyModule> {
@Override
public List<Function> getFunctions(RubyModule clazz) {
// implemented as a fallback to Java through reified class, but maybe there's a better way to do this
return new ClassDescriptor(toJavaClass(clazz)).methods;
}
... | final ScriptingContainer ruby = createRubyInstance();
final RubyKlassNavigator navigator = new RubyKlassNavigator(ruby.getProvider().getRuntime(), ClassLoader.getSystemClassLoader());
final MyRubyModule myModule = new MyRubyModule(ruby.getRuntime(), new MyRubyClass(ruby.getRuntime()), true);
... | [FOCAL] @Override public List<Function> RubyKlassNavigator.getFunctions(RubyModule clazz)
[CLASS] class RubyKlassNavigator extends KlassNavigator<RubyModule>
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Class toJavaClass(RubyModule clazz)
[NEW] ClassDescriptor
[INPUTS] branches=... | /* static context
[FOCAL] @Override public List<Function> RubyKlassNavigator.getFunctions(RubyModule clazz)
[INPUTS] branches=- | result=clazz
[CALLS-INTERNAL] Class toJavaClass(RubyModule clazz)
[NEW] ClassDescriptor
*/
| /* static context
[FOCAL] @Override public List<Function> RubyKlassNavigator.getFunctions(RubyModule clazz)
[INPUTS] branches=- | result=clazz
[CALLS-INTERNAL] Class toJavaClass(RubyModule clazz)
[NEW] ClassDescriptor
*/
class RubyKlassNavigator extends KlassNavigator<RubyModule> {
@Override
public List<Functi... | true | ok | {"focal": {"class": "RubyKlassNavigator", "name": "getFunctions", "signature": "List<Function> getFunctions(RubyModule clazz)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "clazz", "type": "RubyModule"}], "return_type": "List<Function>"}, "class_info": {"name": "RubyKlassNavigator", "kind": "c... |
1553760_291 | class JavadocShortcutUriProcessor implements UriProcessor {
@Override
public String process(String uri) {
String newUri = preprocessUri(uri);
if (!newUri.equals(uri)) {
newUri = prependWithBasePackage(newUri);
if (SourceVersion.isName(newUri)) {
if (isPotentialPackageName(newUri)) {
return toPacka... | assertEquals("../index.html?org/eclipse/mylyn/wikitext/foo/package-summary.html", processor.process("@.foo"));
assertEquals("../index.html?org/eclipse/mylyn/wikitext/foo/bar/package-summary.html",
processor.process("@.foo.bar"));
}
} | [FOCAL] @Override public String JavadocShortcutUriProcessor.process(String uri)
[CLASS] class JavadocShortcutUriProcessor implements UriProcessor
[METRICS] loc=14 cc=4 branches=3 loops=0 returns=3 throws=0 nesting=3
[CALLS-INTERNAL] String prependWithBasePackage(String uri); String preprocessUri(String uri); String toP... | /* static context
[FOCAL] @Override public String JavadocShortcutUriProcessor.process(String uri)
[PATH1] if(!newUri.equals(uri))=T -> if(SourceVersion.isName(newUri))=T -> if(isPotentialPackageName(newUri))=T -> return toPackagePage(newUri)
[PATH2] if(!newUri.equals(uri))=F -> return uri
[PATH3] if(!newUri.equals(uri)... | /* static context
[FOCAL] @Override public String JavadocShortcutUriProcessor.process(String uri)
[PATH1] if(!newUri.equals(uri))=T -> if(SourceVersion.isName(newUri))=T -> if(isPotentialPackageName(newUri))=T -> return toPackagePage(newUri)
[PATH2] if(!newUri.equals(uri))=F -> return uri
[PATH3] if(!newUri.equals(uri)... | true | ok | {"focal": {"class": "JavadocShortcutUriProcessor", "name": "process", "signature": "String process(String uri)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "uri", "type": "String"}], "return_type": "String"}, "class_info": {"name": "JavadocShortcutUriProcessor", "kind": "class", "modifiers": ... |
1554165_0 | class ValueMap {
public HashMap<Enum, String> getDb() {
return db;
}
private ValueMap(List<Value> valueList);
public HashMap<String, Enum> getVal();
}
class ValueMapTest {
@Test
public void testGetDb() {
| System.out.println("getDb");
ValueMap instance = ValueMap.FINGERPRINT_TYPE;
HashMap<Enum, String> result = instance.getDb();
assertNotNull(result);
String dbValue = result.get(Fingerprint.Type.leftIndexFinger);
assertEquals("2", dbValue);
}
} | [FOCAL] public HashMap<Enum, String> ValueMap.getDb()
[CLASS] class ValueMap
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] ValueMap(List<Value> valueList); HashMap<String, Enum> getVal()
[TEST] ValueMapTest: @Test public void testGetDb() | /* static context
[FOCAL] public HashMap<Enum, String> ValueMap.getDb()
*/
| /* static context
[FOCAL] public HashMap<Enum, String> ValueMap.getDb()
*/
class ValueMap {
public HashMap<Enum, String> getDb() {
return db;
}
private ValueMap(List<Value> valueList);
public HashMap<String, Enum> getVal();
}
class ValueMapTest {
@Test
public void testGetDb() {
| true | ok | {"focal": {"class": "ValueMap", "name": "getDb", "signature": "HashMap<Enum, String> getDb()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "HashMap<Enum, String>"}, "class_info": {"name": "ValueMap", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "member... |
1555964_9 | class BitMask2 {
public boolean isBitSet(int bit) {
long bitMask = Long.rotateLeft(1, bit);
long result = this.bitMaskValue & bitMask;
if (result != 0) {
return true;
}
return false;
}
public BitMask2();
public BitMask2(long currentValue);
pub... | for (int bitNumber = 0; bitNumber < 64; bitNumber++) {
long bitMask = Long.rotateLeft(1, bitNumber);
BitMask2 bm = new BitMask2(bitMask);
assertEquals(true, bm.isBitSet(bitNumber));
}
}
} | [FOCAL] public boolean BitMask2.isBitSet(int bit)
[CLASS] class BitMask2
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] Long.rotateLeft/2
[FIELDS] read=bitMaskValue
[PATH1] if(result != 0)=T -> return true
[PATH2] if(result != 0)=F -> return false
[INPUTS] branches=bit | result=-
... | /* static context
[FOCAL] public boolean BitMask2.isBitSet(int bit)
[PATH1] if(result != 0)=T -> return true
[PATH2] if(result != 0)=F -> return false
[INPUTS] branches=bit | result=-
[FIELDS] read=bitMaskValue
[CALLS-EXTERNAL] Long.rotateLeft/2
*/
| /* static context
[FOCAL] public boolean BitMask2.isBitSet(int bit)
[PATH1] if(result != 0)=T -> return true
[PATH2] if(result != 0)=F -> return false
[INPUTS] branches=bit | result=-
[FIELDS] read=bitMaskValue
[CALLS-EXTERNAL] Long.rotateLeft/2
*/
class BitMask2 {
public boolean isBitSet(int bit) {
long b... | true | ok | {"focal": {"class": "BitMask2", "name": "isBitSet", "signature": "boolean isBitSet(int bit)", "start_line": 3, "modifiers": "public", "params": [{"name": "bit", "type": "int"}], "return_type": "boolean"}, "class_info": {"name": "BitMask2", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "field... |
1557148_32 | class CalendarUtil {
public static Calendar getCalendar(String yyyy, String mm, String dd) {
Calendar cal = Calendar.getInstance();
cal.set(Calendar.YEAR, Integer.valueOf(yyyy));
cal.set(Calendar.MONTH, Integer.valueOf(mm) - 1);
cal.set(Calendar.DATE, Integer.valueOf(dd));
c... | Calendar actual = CalendarUtil.getCalendar(2000, 2, 3, 4, 5, 6);
assertTrue(2000 == actual.get(Calendar.YEAR));
assertTrue(1 == actual.get(Calendar.MONTH));
assertTrue(3 == actual.get(Calendar.DATE));
assertTrue(4 == actual.get(Calendar.HOUR));
assertTrue(5 == actual.get(... | [FOCAL] public static Calendar CalendarUtil.getCalendar(String yyyy, String mm, String dd)
[CLASS] class CalendarUtil
[METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Calendar.getInstance/0, Calendar.set/2, Integer.valueOf/1
[DATAFLOW] cal@L2->L3,L4,L5,L6,L7,L8,L9,L10; dd@param->L5... | /* static context
[FOCAL] public static Calendar CalendarUtil.getCalendar(String yyyy, String mm, String dd)
[CALLS-EXTERNAL] Calendar.getInstance/0, Calendar.set/2, Integer.valueOf/1
*/
| /* static context
[FOCAL] public static Calendar CalendarUtil.getCalendar(String yyyy, String mm, String dd)
[CALLS-EXTERNAL] Calendar.getInstance/0, Calendar.set/2, Integer.valueOf/1
*/
class CalendarUtil {
public static Calendar getCalendar(String yyyy, String mm, String dd) {
Calendar cal = Calendar.get... | true | ok | {"focal": {"class": "CalendarUtil", "name": "getCalendar", "signature": "Calendar getCalendar(String yyyy, String mm, String dd)", "start_line": 3, "modifiers": "public static", "params": [{"name": "yyyy", "type": "String"}, {"name": "mm", "type": "String"}, {"name": "dd", "type": "String"}], "return_type": "Calendar"}... |
1558503_0 | class DateUtils {
public static Date create(int year, int month, int date) {
Calendar cal = Calendar.getInstance();
cal.clear();
cal.set(year, month - 1, date);
return cal.getTime();
}
public static Date create(int year, int month, int date, int hour, int minute, int second);
}
class DateUtilsTest {
@T... | Date date = DateUtils.create(2010, 4, 12);
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
assertThat(df.format(date), is("2010-04-12 00:00:00"));
}
} | [FOCAL] public static Date DateUtils.create(int year, int month, int date)
[CLASS] class DateUtils
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Calendar.getInstance/0, Calendar.clear/0, Calendar.set/3, Calendar.getTime/0
[DATAFLOW] cal@L2->L3,L4,L5; date@param->L4; month@param->... | /* static context
[FOCAL] public static Date DateUtils.create(int year, int month, int date)
[CALLS-EXTERNAL] Calendar.getInstance/0, Calendar.clear/0, Calendar.set/3, Calendar.getTime/0
*/
| /* static context
[FOCAL] public static Date DateUtils.create(int year, int month, int date)
[CALLS-EXTERNAL] Calendar.getInstance/0, Calendar.clear/0, Calendar.set/3, Calendar.getTime/0
*/
class DateUtils {
public static Date create(int year, int month, int date) {
Calendar cal = Calendar.getInstance();
cal.clea... | true | ok | {"focal": {"class": "DateUtils", "name": "create", "signature": "Date create(int year, int month, int date)", "start_line": 3, "modifiers": "public static", "params": [{"name": "year", "type": "int"}, {"name": "month", "type": "int"}, {"name": "date", "type": "int"}], "return_type": "Date"}, "class_info": {"name": "Dat... |
1574061_514 | class CategorizeFunction implements Function {
public Object evaluate(Object object) {
return evaluate(object, Object.class);
}
public CategorizeFunction();
public CategorizeFunction(List<Expression> parameters, Literal fallback);
public String getName();
public List<Expression> get... | System.out.println(" testPrecedingThresholds");
final String[] categories = {"low", "mid", "high", "super"};
final Double[] thresholds = {0.0, 50.0, 100.0};
setupParameters(categories, thresholds);
parameters.add(ff2.literal("preceding"));
Function fn = finder.findFun... | [FOCAL] public Object CategorizeFunction.evaluate(Object object)
[CLASS] class CategorizeFunction implements Function
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] T evaluate(Object object, Class<T> context)
[INPUTS] branches=- | result=object
[DATAFLOW] object@param->L2
[CLASS-M... | /* static context
[FOCAL] public Object CategorizeFunction.evaluate(Object object)
[INPUTS] branches=- | result=object
[CALLS-INTERNAL] T evaluate(Object object, Class<T> context)
*/
| /* static context
[FOCAL] public Object CategorizeFunction.evaluate(Object object)
[INPUTS] branches=- | result=object
[CALLS-INTERNAL] T evaluate(Object object, Class<T> context)
*/
class CategorizeFunction implements Function {
public Object evaluate(Object object) {
return evaluate(object, Object.class)... | true | ok | {"focal": {"class": "CategorizeFunction", "name": "evaluate", "signature": "Object evaluate(Object object)", "start_line": 3, "modifiers": "public", "params": [{"name": "object", "type": "Object"}], "return_type": "Object"}, "class_info": {"name": "CategorizeFunction", "kind": "class", "modifiers": "", "superclass": nu... |
1575956_121 | class BookKeeperAdmin implements AutoCloseable {
public static boolean areEntriesOfLedgerStoredInTheBookie(long ledgerId, BookieId bookieAddress,
LedgerManager ledgerManager) {
try {
LedgerMetadata ledgerMetadata = ledgerManager.readLedgerMetadata(ledgerId).get().getValue();
... | int lastEntryId = 10;
long ledgerId = 100L;
BookieId bookie0 = new BookieSocketAddress("bookie0:3181").toBookieId();
BookieId bookie1 = new BookieSocketAddress("bookie1:3181").toBookieId();
BookieId bookie2 = new BookieSocketAddress("bookie2:3181").toBookieId();
BookieId ... | [FOCAL] public static boolean BookKeeperAdmin.areEntriesOfLedgerStoredInTheBookie(long ledgerId, BookieId bookieAddress, LedgerManager ledgerManager)
[CLASS] class BookKeeperAdmin implements AutoCloseable
[METRICS] loc=20 cc=4 branches=1 loops=0 returns=2 throws=2 nesting=2
[CALLS-INTERNAL] boolean areEntriesOfLedgerSt... | class BookKeeperAdmin implements AutoCloseable {
public static boolean areEntriesOfLedgerStoredInTheBookie(long ledgerId, BookieId bookieAddress,
LedgerManager ledgerManager) {
try {
LedgerMetadata ledgerMetadata = ledgerManager.readLedgerMetadata(ledgerId).get().getValue();
... | false | ok | {"focal": {"class": "BookKeeperAdmin", "name": "areEntriesOfLedgerStoredInTheBookie", "signature": "boolean areEntriesOfLedgerStoredInTheBookie(long ledgerId, BookieId bookieAddress, LedgerManager ledgerManager)", "start_line": 3, "modifiers": "public static", "params": [{"name": "ledgerId", "type": "long"}, {"name": "... | |
1577630_11 | class ListMemoizer {
public M get(final ListNode<T> list) {
if (null == list) {
throw new IllegalArgumentException("null key");
}
return (null == helper)
? null
: helper.get(list);
}
public ListMemoizer(final Comparator<T> comparator);
... | ListMemoizer<String, Integer> m = createMemoizer();
assertNull(m.get(createList()));
assertNull(m.get(createList("foo")));
assertNull(m.get(createList("foo", "bar")));
}
} | [FOCAL] public M ListMemoizer.get(ListNode<T> list)
[CLASS] class ListMemoizer
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] helper.get/1
[NEW] IllegalArgumentException
[EXCEPTIONS] throws IllegalArgumentException
[THROWS-WHEN] IllegalArgumentException when null == list
[PATH1] i... | /* static context
[FOCAL] public M ListMemoizer.get(ListNode<T> list)
[THROWS-WHEN] IllegalArgumentException when null == list
[PATH1] if(null == list)=T -> throw new IllegalArgumentException("null key")
[PATH2] if(null == list)=F -> return (null == helper) ? null : helper.get(list)
[INPUTS] branches=list | result=list... | /* static context
[FOCAL] public M ListMemoizer.get(ListNode<T> list)
[THROWS-WHEN] IllegalArgumentException when null == list
[PATH1] if(null == list)=T -> throw new IllegalArgumentException("null key")
[PATH2] if(null == list)=F -> return (null == helper) ? null : helper.get(list)
[INPUTS] branches=list | result=list... | true | ok | {"focal": {"class": "ListMemoizer", "name": "get", "signature": "M get(ListNode<T> list)", "start_line": 3, "modifiers": "public", "params": [{"name": "list", "type": "ListNode<T>"}], "return_type": "M"}, "class_info": {"name": "ListMemoizer", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "f... |
1579900_0 | class Percentiler {
public int getPercentile (float value)
{
if (value < _min) {
return 0;
} else if (value > _max) {
return 100;
} else {
return _percentile[toBucketIndex(value)];
}
}
public Percentiler();
public Percentiler(in... | Percentiler tiler = createGaussian();
assertEquals(0, tiler.getPercentile(tiler.getMinScore()));
assertEquals(0, tiler.getPercentile(tiler.getMinScore()-1));
assertEquals(100, tiler.getPercentile(tiler.getMaxScore()));
assertEquals(100, tiler.getPercentile(tiler.getMaxScore()+1)... | [FOCAL] public int Percentiler.getPercentile(float value)
[CLASS] class Percentiler
[METRICS] loc=10 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=2
[CALLS-INTERNAL] int toBucketIndex(float value)
[PATH1] if(value < _min)=F -> if(value > _max)=T -> return 100
[PATH2] if(value < _min)=T -> return 0
[PATH3] if(value... | /* static context
[FOCAL] public int Percentiler.getPercentile(float value)
[PATH1] if(value < _min)=F -> if(value > _max)=T -> return 100
[PATH2] if(value < _min)=T -> return 0
[PATH3] if(value < _min)=F -> if(value > _max)=F -> return _percentile[toBucketIndex(value)]
[INPUTS] branches=value | result=value
[CALLS-INT... | /* static context
[FOCAL] public int Percentiler.getPercentile(float value)
[PATH1] if(value < _min)=F -> if(value > _max)=T -> return 100
[PATH2] if(value < _min)=T -> return 0
[PATH3] if(value < _min)=F -> if(value > _max)=F -> return _percentile[toBucketIndex(value)]
[INPUTS] branches=value | result=value
[CALLS-INT... | true | ok | {"focal": {"class": "Percentiler", "name": "getPercentile", "signature": "int getPercentile(float value)", "start_line": 3, "modifiers": "public", "params": [{"name": "value", "type": "float"}], "return_type": "int"}, "class_info": {"name": "Percentiler", "kind": "class", "modifiers": "", "superclass": null, "interface... |
1579936_3 | class GeneratedSourceMerger {
public String merge (String newlyGenerated, String previouslyGenerated)
throws Exception
{
// Extract the generated section names from the output and make sure they're all matched
Map<String, Section> sections = Maps.newLinkedHashMap();
Matcher m = ... | String disabled = "// GENERATED VARIABLE DISABLED\n" + before;
assertEquals(disabled, new GeneratedSourceMerger().merge(generated, disabled));
}
} | [FOCAL] public String GeneratedSourceMerger.merge(String newlyGenerated, String previouslyGenerated)
[CLASS] class GeneratedSourceMerger
[METRICS] loc=47 cc=6 branches=2 loops=3 returns=1 throws=0 nesting=3
[CALLS-INTERNAL] Section extractGeneratedSection(Matcher m, String input)
[CALLS-EXTERNAL] Maps.newLinkedHashMap/... | /* static context
[FOCAL] public String GeneratedSourceMerger.merge(String newlyGenerated, String previouslyGenerated)
[PATH1] while(m.find())#1=F -> while(m.find())#2=T -> if(newSection == null)=F -> if(existingSection.disabled)=T -> exit loop -> foreach(Section newSection : sections.values())=F -> return merged.toStr... | /* static context
[FOCAL] public String GeneratedSourceMerger.merge(String newlyGenerated, String previouslyGenerated)
[PATH1] while(m.find())#1=F -> while(m.find())#2=T -> if(newSection == null)=F -> if(existingSection.disabled)=T -> exit loop -> foreach(Section newSection : sections.values())=F -> return merged.toStr... | true | ok | {"focal": {"class": "GeneratedSourceMerger", "name": "merge", "signature": "String merge(String newlyGenerated, String previouslyGenerated) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "newlyGenerated", "type": "String"}, {"name": "previouslyGenerated", "type": "String"}], "return_type... |
1581151_6 | class MacAddress {
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final MacAddress that = (MacAddress) o;
return Arrays.equals(array, that.array);
}
public MacAddress(final long macAddress);
pu... |
assertTrue(new MacAddress(MAC_BYTES).equals(new MacAddress(MAC_BYTES)));
assertTrue(new MacAddress(MAC_HEX_STRING).equals(new MacAddress(MAC_BYTES)));
assertTrue(new MacAddress(MAC_DEC_STRING).equals(new MacAddress(MAC_BYTES)));
assertTrue(new MacAddress(MAC_BIN_STRING).equals(new MacAddress(MAC_BYTES)));
a... | [FOCAL] @Override public boolean MacAddress.equals(Object o)
[CLASS] class MacAddress
[METRICS] loc=14 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[CALLS-EXTERNAL] getClass/0 (inherited), Object.getClass/0, Arrays.equals/2
[PATH1] if(this == o)=F -> if(o == null || getClass() != o.getClass())=T -> return false... | /* static context
[FOCAL] @Override public boolean MacAddress.equals(Object o)
[PATH1] if(this == o)=F -> if(o == null || getClass() != o.getClass())=T -> return false
[PATH2] if(this == o)=T -> return true
[PATH3] if(this == o)=F -> if(o == null || getClass() != o.getClass())=F -> return Arrays.equals(array, that.arra... | /* static context
[FOCAL] @Override public boolean MacAddress.equals(Object o)
[PATH1] if(this == o)=F -> if(o == null || getClass() != o.getClass())=T -> return false
[PATH2] if(this == o)=T -> return true
[PATH3] if(this == o)=F -> if(o == null || getClass() != o.getClass())=F -> return Arrays.equals(array, that.arra... | true | ok | {"focal": {"class": "MacAddress", "name": "equals", "signature": "boolean equals(Object o)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "o", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "MacAddress", "kind": "class", "modifiers": "", "superclass": null, "interfaces": ... |
1583138_2 | class Paging {
public int getTotalPages() {
return totalPages;
}
public Paging(List<T> items, int itemsPerPage);
public Paging(T[] items, int itemsPerPage);
public int getCurrentPage();
public int getTotalItems();
public Object getItem(int index);
public void nextPage();
private int getLastPage();
publ... | Paging paging = new Paging(new Object[] {}, 2);
assertEquals(0, paging.getTotalPages());
paging = new Paging(new Object[] { 0, 1 }, 2);
assertEquals(1, paging.getTotalPages());
paging = new Paging(new Object[] { 0, 1, 2 }, 2);
assertEquals(2, paging.getTotalPages());
paging = new Paging(new Object[] { ... | [FOCAL] public int Paging.getTotalPages()
[CLASS] class Paging
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] Paging(List<T> items, int itemsPerPage); Paging(T[] items, int itemsPerPage); int getCurrentPage(); int getTotalItems(); Object getItem(int index); void nextPage(); int get... | /* static context
[FOCAL] public int Paging.getTotalPages()
*/
| /* static context
[FOCAL] public int Paging.getTotalPages()
*/
class Paging {
public int getTotalPages() {
return totalPages;
}
public Paging(List<T> items, int itemsPerPage);
public Paging(T[] items, int itemsPerPage);
public int getCurrentPage();
public int getTotalItems();
public Object getItem(int ind... | true | ok | {"focal": {"class": "Paging", "name": "getTotalPages", "signature": "int getTotalPages()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "Paging", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Paging", ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.