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 |
|---|---|---|---|---|---|---|---|---|
13899_11 | class IoUtils {
public static String readString(InputStream in, String charset) throws IOException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
int c;
while ((c = in.read()) > 0) {
out.write(c);
}
return new String(out.toByteArray(), charset);
}
private IoUtils();
public static int s... | final String first = "Hi there";
final String second = "Have a nice day!";
byte[] firstBytes = first.getBytes();
byte[] secondBytes = second.getBytes();
byte[] newBytes = new byte[firstBytes.length + secondBytes.length + 1];
System.arraycopy(firstBytes, 0, newBytes, 0, firstBytes.length);
System.arraycopy... | [FOCAL] public static String IoUtils.readString(InputStream in, String charset)
[CLASS] class IoUtils
[METRICS] loc=9 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] InputStream.read/0, ByteArrayOutputStream.write/1, ByteArrayOutputStream.toByteArray/0
[NEW] ByteArrayOutputStream, String
[EXCEPTIO... | /* static context
[FOCAL] public static String IoUtils.readString(InputStream in, String charset)
[PATH1] while((c = in.read()) > 0)=T -> exit loop -> return new String(out.toByteArray(), charset)
[PATH2] while((c = in.read()) > 0)=F -> return new String(out.toByteArray(), charset)
[INPUTS] branches=in | result=charset... | /* static context
[FOCAL] public static String IoUtils.readString(InputStream in, String charset)
[PATH1] while((c = in.read()) > 0)=T -> exit loop -> return new String(out.toByteArray(), charset)
[PATH2] while((c = in.read()) > 0)=F -> return new String(out.toByteArray(), charset)
[INPUTS] branches=in | result=charset... | true | ok | {"focal": {"class": "IoUtils", "name": "readString", "signature": "String readString(InputStream in, String charset) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "in", "type": "InputStream"}, {"name": "charset", "type": "String"}], "return_type": "String"}, "class_info": {"nam... |
32578_0 | class LookupManagerImpl implements LookupManager {
public List<LabelValue> getAllRoles() {
List<Role> roles = dao.getRoles();
List<LabelValue> list = new ArrayList<LabelValue>();
for (Role role1 : roles) {
list.add(new LabelValue(role1.getName(), role1.getName()));
}
... | log.debug("entered 'testGetAllRoles' method");
// set expected behavior on dao
Role role = new Role(Constants.ADMIN_ROLE);
final List<Role> testData = new ArrayList<Role>();
testData.add(role);
context.checking(new Expectations() {{
one(lookupDao).getRoles();... | [FOCAL] public List<LabelValue> LookupManagerImpl.getAllRoles()
[CLASS] class LookupManagerImpl implements LookupManager
[METRICS] loc=10 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] dao.getRoles/0, List<LabelValue>.add/1, Role.getName/0
[NEW] ArrayList<LabelValue>, LabelValue
[PATH1] foreach(R... | /* static context
[FOCAL] public List<LabelValue> LookupManagerImpl.getAllRoles()
[PATH1] foreach(Role role1 : roles)=T -> exit loop -> return list
[PATH2] foreach(Role role1 : roles)=F -> return list
[COLLABORATORS] field dao getRoles/0
[NEW] ArrayList<LabelValue>, LabelValue
[CALLS-EXTERNAL] dao.getRoles/0, List<Labe... | /* static context
[FOCAL] public List<LabelValue> LookupManagerImpl.getAllRoles()
[PATH1] foreach(Role role1 : roles)=T -> exit loop -> return list
[PATH2] foreach(Role role1 : roles)=F -> return list
[COLLABORATORS] field dao getRoles/0
[NEW] ArrayList<LabelValue>, LabelValue
[CALLS-EXTERNAL] dao.getRoles/0, List<Labe... | true | ok | {"focal": {"class": "LookupManagerImpl", "name": "getAllRoles", "signature": "List<LabelValue> getAllRoles()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<LabelValue>"}, "class_info": {"name": "LookupManagerImpl", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Lookup... |
56670_0 | class ClasspathScanner {
protected String getPackage() {
return pkg;
}
public ClasspathScanner(String pkg, boolean subpackages);
public ClasspathScanner(String pkg);
private void sanitizePackage(String pkgName);
protected ClassLoader getClassLoader();
protected boolean isJARPath... | scanner = new ClasspathScanner("org.hibernate.*");
assertEquals("Package was sanitized", "org/hibernate", scanner.getPackage());
}
} | [FOCAL] protected String ClasspathScanner.getPackage()
[CLASS] class ClasspathScanner
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] ClasspathScanner(String pkg, boolean subpackages); ClasspathScanner(String pkg); void sanitizePackage(String pkgName); ClassLoader getClassLoader(); ... | /* static context
[FOCAL] protected String ClasspathScanner.getPackage()
*/
| /* static context
[FOCAL] protected String ClasspathScanner.getPackage()
*/
class ClasspathScanner {
protected String getPackage() {
return pkg;
}
public ClasspathScanner(String pkg, boolean subpackages);
public ClasspathScanner(String pkg);
private void sanitizePackage(String pkgName);... | true | ok | {"focal": {"class": "ClasspathScanner", "name": "getPackage", "signature": "String getPackage()", "start_line": 3, "modifiers": "protected", "params": [], "return_type": "String"}, "class_info": {"name": "ClasspathScanner", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "s... |
56904_58 | class ForeignKeyListHolder {
public List<U> get() {
if (this.loaded == null) {
if (this.parent.isNew() || UnitTesting.isEnabled()) {
// parent is brand new, so don't bother hitting the database
this.loaded = new ArrayList<U>();
} else {
if (!UoW.isOpen()) {
throw new... | DummyDomainObject parent = new DummyDomainObject();
ForeignKeyListHolder<DummyDomainObject, DummyDomainObject> h = //
new ForeignKeyListHolder<DummyDomainObject, DummyDomainObject>(parent, null, null, null);
parent.setId(1l);
Assert.assertEquals(0, h.get().size());
}
} | [FOCAL] public List<U> ForeignKeyListHolder.get()
[CLASS] class ForeignKeyListHolder
[METRICS] loc=40 cc=8 branches=7 loops=0 returns=1 throws=2 nesting=5
[CALLS-INTERNAL] void eagerlyLoad(MapToList<Long, U> byParentId, Collection<Long> idsToLoad)
[CALLS-EXTERNAL] this.parent.isNew/0, UnitTesting.isEnabled/0, UoW.isOpe... | /* static context
[FOCAL] public List<U> ForeignKeyListHolder.get()
[THROWS-WHEN] DisconnectedException when this.loaded == null && !(this.parent.isNew() || UnitTesting.isEnabled()) && !UoW.isOpen()
[THROWS-WHEN] IllegalStateException when this.loaded == null && !(this.parent.isNew() || UnitTesting.isEnabled()) && UoW.... | /* static context
[FOCAL] public List<U> ForeignKeyListHolder.get()
[THROWS-WHEN] DisconnectedException when this.loaded == null && !(this.parent.isNew() || UnitTesting.isEnabled()) && !UoW.isOpen()
[THROWS-WHEN] IllegalStateException when this.loaded == null && !(this.parent.isNew() || UnitTesting.isEnabled()) && UoW.... | true | ok | {"focal": {"class": "ForeignKeyListHolder", "name": "get", "signature": "List<U> get()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<U>"}, "class_info": {"name": "ForeignKeyListHolder", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"n... |
74217_5 | class RecordPackageClassScanner {
public List<Class<?>> scan(List<String> packages) {
List<Class<?>> classes = new ArrayList<Class<?>>();
for (String packageName : packages) {
for (Class clazz : findClassesInPackage(packageName)) {
if (hasRecordAnnoation(clazz))
... | RecordPackageClassScanner scanner = new RecordPackageClassScanner();
List<Class<?>> classes = scanner.scan(Arrays.<String>asList("flapjack.test", "flapjack.test2"));
assertNotNull(classes);
assertTrue(classes.contains(User.class));
assertTrue(classes.contains(Phone.class));
... | [FOCAL] public List<Class<?>> RecordPackageClassScanner.scan(List<String> packages)
[CLASS] class RecordPackageClassScanner
[METRICS] loc=10 cc=4 branches=1 loops=2 returns=1 throws=0 nesting=3
[CALLS-INTERNAL] List<Class> findClassesInPackage(String packageName); boolean hasRecordAnnoation(Class clazz)
[CALLS-EXTERNAL... | /* static context
[FOCAL] public List<Class<?>> RecordPackageClassScanner.scan(List<String> packages)
[PATH1] foreach(String packageName : packages)=T -> foreach(Class clazz : findClassesInPackage(packageName))=T -> if(hasRecordAnnoation(clazz))=T -> exit loop -> exit loop -> return classes
[PATH2] foreach(String packa... | /* static context
[FOCAL] public List<Class<?>> RecordPackageClassScanner.scan(List<String> packages)
[PATH1] foreach(String packageName : packages)=T -> foreach(Class clazz : findClassesInPackage(packageName))=T -> if(hasRecordAnnoation(clazz))=T -> exit loop -> exit loop -> return classes
[PATH2] foreach(String packa... | true | ok | {"focal": {"class": "RecordPackageClassScanner", "name": "scan", "signature": "List<Class<?>> scan(List<String> packages)", "start_line": 3, "modifiers": "public", "params": [{"name": "packages", "type": "List<String>"}], "return_type": "List<Class<?>>"}, "class_info": {"name": "RecordPackageClassScanner", "kind": "cla... |
88960_47 | class PlainFormatter implements JSLintResultFormatter {
public String format(JSLintResult result) {
StringBuilder sb = new StringBuilder();
for (Issue issue : result.getIssues()) {
sb.append(outputOneIssue(issue));
}
return sb.toString();
}
public String footer(... | String nl = System.getProperty("line.separator");
String name = "foo/bar.js";
Issue issue = new IssueBuilder(name, 0, 0, "oops").evidence("BANG").build();
JSLintResult result = new JSLintResult.ResultBuilder(name).addIssue(issue).build();
StringBuilder sb = new StringBuilder(name... | [FOCAL] public String PlainFormatter.format(JSLintResult result)
[CLASS] class PlainFormatter implements JSLintResultFormatter
[METRICS] loc=7 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] String outputOneIssue(Issue issue)
[CALLS-EXTERNAL] JSLintResult.getIssues/0, StringBuilder.append/1, Strin... | /* static context
[FOCAL] public String PlainFormatter.format(JSLintResult result)
[PATH1] foreach(Issue issue : result.getIssues())=T -> exit loop -> return sb.toString()
[PATH2] foreach(Issue issue : result.getIssues())=F -> return sb.toString()
[INPUTS] branches=result | result=-
[COLLABORATORS] param result:JSLintR... | /* static context
[FOCAL] public String PlainFormatter.format(JSLintResult result)
[PATH1] foreach(Issue issue : result.getIssues())=T -> exit loop -> return sb.toString()
[PATH2] foreach(Issue issue : result.getIssues())=F -> return sb.toString()
[INPUTS] branches=result | result=-
[COLLABORATORS] param result:JSLintR... | true | ok | {"focal": {"class": "PlainFormatter", "name": "format", "signature": "String format(JSLintResult result)", "start_line": 3, "modifiers": "public", "params": [{"name": "result", "type": "JSLintResult"}], "return_type": "String"}, "class_info": {"name": "PlainFormatter", "kind": "class", "modifiers": "", "superclass": nu... |
97620_0 | class ClassName {
public String get() {
return this.fullClassNameWithGenerics;
}
public ClassName(String fullClassNameWithGenerics);
public String toString();
public String getSimpleName();
public String getPackageName();
public List<String> getGenericsWithoutBounds();
public List<String> getGenericsWithB... | assertThat(//
new ClassName("java.util.Map<K, V>.Entry<K, V>").get(),
is("java.util.Map.Entry<K, V>"));
assertThat(//
new ClassName("java.util.Foo<K extends java.util.Bar<K>>.Entry<K extends java.util.Bar<K>>").get(),
is("java.util.Foo.Entry<K extends java.util.Bar<K>>"));
}
} | [FOCAL] public String ClassName.get()
[CLASS] class ClassName
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[FIELDS] read=fullClassNameWithGenerics
[CLASS-MEMBERS] ClassName(String fullClassNameWithGenerics); String toString(); String getSimpleName(); String getPackageName(); List<String> getGene... | /* static context
[FOCAL] public String ClassName.get()
[FIELDS] read=fullClassNameWithGenerics
*/
| /* static context
[FOCAL] public String ClassName.get()
[FIELDS] read=fullClassNameWithGenerics
*/
class ClassName {
public String get() {
return this.fullClassNameWithGenerics;
}
public ClassName(String fullClassNameWithGenerics);
public String toString();
public String getSimpleName();
public String getPa... | true | ok | {"focal": {"class": "ClassName", "name": "get", "signature": "String get()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "ClassName", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "ClassName", "kind... |
103035_6 | class JMXAgent implements NotificationListener {
public static boolean unregisterMBean(ObjectName oName) {
boolean unregistered = false;
if (null != oName) {
try {
if (mbs.isRegistered(oName)) {
log.debug("Mbean is registered");
mbs.unregisterMBean(oName);
//set flag based on registration st... | logger.info("Default jmx domain: {}", JMXFactory.getDefaultDomain());
JMXAgent agent = new JMXAgent();
agent.init();
MBeanServer mbs = JMXFactory.getMBeanServer();
//create a new mbean for this instance
ObjectName oName = JMXFactory.createMBean(
"org.red5.server.net.rtmp.RTMPMinaConnection",
"connec... | [FOCAL] public static boolean JMXAgent.unregisterMBean(ObjectName oName)
[CLASS] class JMXAgent implements NotificationListener
[METRICS] loc=19 cc=4 branches=2 loops=0 returns=1 throws=0 nesting=3
[CALLS-EXTERNAL] mbs.isRegistered/1, log.debug/1, mbs.unregisterMBean/1, log.warn/2
[EXCEPTIONS] catches Exception e
[PATH... | /* static context
[FOCAL] public static boolean JMXAgent.unregisterMBean(ObjectName oName)
[PATH1] if(null != oName)=T -> try-body throws -> return unregistered
[PATH2] if(null != oName)=F -> return unregistered
[PATH3] if(null != oName)=T -> if(mbs.isRegistered(oName))=T -> return unregistered
[PATH4] if(null != oName... | /* static context
[FOCAL] public static boolean JMXAgent.unregisterMBean(ObjectName oName)
[PATH1] if(null != oName)=T -> try-body throws -> return unregistered
[PATH2] if(null != oName)=F -> return unregistered
[PATH3] if(null != oName)=T -> if(mbs.isRegistered(oName))=T -> return unregistered
[PATH4] if(null != oName... | true | ok | {"focal": {"class": "JMXAgent", "name": "unregisterMBean", "signature": "boolean unregisterMBean(ObjectName oName)", "start_line": 3, "modifiers": "public static", "params": [{"name": "oName", "type": "ObjectName"}], "return_type": "boolean"}, "class_info": {"name": "JMXAgent", "kind": "class", "modifiers": "", "superc... |
121672_32 | class Fields implements Comparable, Iterable<Comparable>, Serializable, Comparator<Tuple> {
public Fields appendSelector( Fields fields )
{
return appendInternal( fields, true );
}
protected Fields( Kind kind );
public Fields();
@ConstructorProperties({"fields"}) public Fields( Comparab... | Fields fieldA = new Fields( 0, -1 );
Fields fieldB = new Fields( -1 );
try
{
Fields appended = fieldA.appendSelector( fieldB );
fail();
}
catch( Exception exception )
{
// ignore
}
}
} | [FOCAL] public Fields Fields.appendSelector(Fields fields)
[CLASS] class Fields implements Comparable, Iterable<Comparable>, Serializable, Comparator<Tuple>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Fields appendInternal(Fields fields, boolean isSelect)
[INPUTS] branches=- | ... | /* static context
[FOCAL] public Fields Fields.appendSelector(Fields fields)
[INPUTS] branches=- | result=fields
[CALLS-INTERNAL] Fields appendInternal(Fields fields, boolean isSelect)
*/
| /* static context
[FOCAL] public Fields Fields.appendSelector(Fields fields)
[INPUTS] branches=- | result=fields
[CALLS-INTERNAL] Fields appendInternal(Fields fields, boolean isSelect)
*/
class Fields implements Comparable, Iterable<Comparable>, Serializable, Comparator<Tuple> {
public Fields appendSelector( Field... | true | ok | {"focal": {"class": "Fields", "name": "appendSelector", "signature": "Fields appendSelector(Fields fields)", "start_line": 3, "modifiers": "public", "params": [{"name": "fields", "type": "Fields"}], "return_type": "Fields"}, "class_info": {"name": "Fields", "kind": "class", "modifiers": "", "superclass": null, "interfa... |
123235_12 | class PubkeyUtils {
public static KeyPair recoverKeyPair(byte[] encoded) throws NoSuchAlgorithmException,
InvalidKeySpecException {
final String algo = getAlgorithmForOid(getOidFromPkcs8Encoded(encoded));
final KeySpec privKeySpec = new PKCS8EncodedKeySpec(encoded);
final KeyFactory kf = KeyFactory.getInst... | KeyPair kp = PubkeyUtils.recoverKeyPair(DSA_KEY_PKCS8);
DSAPublicKey pubKey = (DSAPublicKey) kp.getPublic();
assertEquals(DSA_KEY_pub, pubKey.getY());
DSAParams params = pubKey.getParams();
assertEquals(params.getG(), DSA_KEY_G);
assertEquals(params.getP(), DSA_KEY_P);
assertEquals(params.getQ(), DSA_K... | [FOCAL] public static KeyPair PubkeyUtils.recoverKeyPair(byte[] encoded)
[CLASS] class PubkeyUtils
[METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] PublicKey recoverPublicKey(KeyFactory kf, PrivateKey priv); String getAlgorithmForOid(String oid); String getOidFromPkcs8Encoded(byte[... | /* static context
[FOCAL] public static KeyPair PubkeyUtils.recoverKeyPair(byte[] encoded)
[INPUTS] branches=- | result=encoded
[EXCEPTIONS] declares NoSuchAlgorithmException, InvalidKeySpecException
[CALLS-INTERNAL] PublicKey recoverPublicKey(KeyFactory kf, PrivateKey priv); String getAlgorithmForOid(String oid); Stri... | /* static context
[FOCAL] public static KeyPair PubkeyUtils.recoverKeyPair(byte[] encoded)
[INPUTS] branches=- | result=encoded
[EXCEPTIONS] declares NoSuchAlgorithmException, InvalidKeySpecException
[CALLS-INTERNAL] PublicKey recoverPublicKey(KeyFactory kf, PrivateKey priv); String getAlgorithmForOid(String oid); Stri... | true | ok | {"focal": {"class": "PubkeyUtils", "name": "recoverKeyPair", "signature": "KeyPair recoverKeyPair(byte[] encoded) throws NoSuchAlgorithmException, InvalidKeySpecException", "start_line": 3, "modifiers": "public static", "params": [{"name": "encoded", "type": "byte[]"}], "return_type": "KeyPair"}, "class_info": {"name":... |
135867_7 | class LoginController extends UIController {
@SuppressWarnings("unchecked")
public ModelAndView logIn(HttpServletRequest request, HttpServletResponse response, LoginCommand login,
BindException errors) throws Exception {
// Checking whether logged in
ApplicationState state = getAppl... | LoginCommand loginCom = new LoginCommand();
loginCom.setUsername("test1");
loginCom.setPassword("yes");
loginController = (LoginController) context.getBean("loginController");
ModelAndView mav = loginController.logIn(request, response, loginCom, new BindException(loginCom, "test"... | [FOCAL] @SuppressWarnings("unchecked") public ModelAndView LoginController.logIn(HttpServletRequest request, HttpServletResponse response, LoginCommand login, BindException errors)
[CLASS] class LoginController extends UIController
[METRICS] loc=35 cc=6 branches=5 loops=0 returns=4 throws=0 nesting=3
[CALLS-INTERNAL] M... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public ModelAndView LoginController.logIn(HttpServletRequest request, HttpServletResponse response, LoginCommand login, BindException errors)
[PATH1] if(state.getCurrentUser() != null)=F -> if(!errors.hasErrors())=T -> if(user != null)=T -> if(login.isAutoLogin()... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public ModelAndView LoginController.logIn(HttpServletRequest request, HttpServletResponse response, LoginCommand login, BindException errors)
[PATH1] if(state.getCurrentUser() != null)=F -> if(!errors.hasErrors())=T -> if(user != null)=T -> if(login.isAutoLogin()... | true | ok | {"focal": {"class": "LoginController", "name": "logIn", "signature": "ModelAndView logIn(HttpServletRequest request, HttpServletResponse response, LoginCommand login, BindException errors) throws Exception", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public", "params": [{"name": "request", "type": ... |
149511_10 | class SVNState implements State {
public boolean isUnderRevisionControl() {
return true;
}
protected SVNState(String state);
public boolean isCheckedOut();
public boolean isDeleted();
@Override public String toString();
protected boolean contains(String msg, String searchString);
}
class SVNStat... | assertFalse("Files in Unknown State should not be under revision control", SVNState.UNKNOWN.isUnderRevisionControl());
assertTrue("Files in Checked In State should be under revision control", VERSIONED.isUnderRevisionControl());
assertTrue("Files in Added State should be under revision control", SVNState.AD... | [FOCAL] public boolean SVNState.isUnderRevisionControl()
[CLASS] class SVNState implements State
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] SVNState(String state); boolean isCheckedOut(); boolean isDeleted(); String toString(); boolean contains(String msg, String searchString)
... | /* static context
[FOCAL] public boolean SVNState.isUnderRevisionControl()
*/
| /* static context
[FOCAL] public boolean SVNState.isUnderRevisionControl()
*/
class SVNState implements State {
public boolean isUnderRevisionControl() {
return true;
}
protected SVNState(String state);
public boolean isCheckedOut();
public boolean isDeleted();
@Override public String toString();
... | true | ok | {"focal": {"class": "SVNState", "name": "isUnderRevisionControl", "signature": "boolean isUnderRevisionControl()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "SVNState", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "State", "fields": []... |
152134_28 | class UserManagerBean implements UserManager {
public User findByUsername(String username) {
Query query = em.createNamedQuery("findUserByUsername");
query.setParameter("username", username);
return (User) query.getSingleResult();
}
public User create(String username, String passwo... | EntityManager em = createMock(EntityManager.class);
Query q = createMock(Query.class);
User user = createDummyUser(username);
expect(em.createNamedQuery("findUserByUsername"))
.andReturn(q);
expect(q.setParameter("username", username)).andReturn(q);
expec... | [FOCAL] public User UserManagerBean.findByUsername(String username)
[CLASS] class UserManagerBean implements UserManager
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] em.createNamedQuery/1, Query.setParameter/2, Query.getSingleResult/0
[COLLABORATORS] field em createNamedQuery/1
... | /* static context
[FOCAL] public User UserManagerBean.findByUsername(String username)
[COLLABORATORS] field em createNamedQuery/1
[CALLS-EXTERNAL] em.createNamedQuery/1, Query.setParameter/2, Query.getSingleResult/0
*/
| /* static context
[FOCAL] public User UserManagerBean.findByUsername(String username)
[COLLABORATORS] field em createNamedQuery/1
[CALLS-EXTERNAL] em.createNamedQuery/1, Query.setParameter/2, Query.getSingleResult/0
*/
class UserManagerBean implements UserManager {
public User findByUsername(String username) {
... | true | ok | {"focal": {"class": "UserManagerBean", "name": "findByUsername", "signature": "User findByUsername(String username)", "start_line": 3, "modifiers": "public", "params": [{"name": "username", "type": "String"}], "return_type": "User"}, "class_info": {"name": "UserManagerBean", "kind": "class", "modifiers": "", "superclas... |
160996_95 | class PlainMailboxManager implements MailboxManager {
public void transportMessage( Who recipient, Message msg ) throws Exception
{
if (msg.getMessageId() != null)
throw new IllegalStateException( "message has already been sent" );
msg.setMessageId( idGen.next() );
//Log.report( "MailboxManager.send",... | // test sending a message that has already been sent (has a message id)
assertNull( transport.what );
assertNull( transport.recipient );
assertNull( transport.msg );
Message msg = constructAddMessage();
assertNull( msg.getMessageId() );
msg.setMessageId( 1L );
// this should trigger msg already s... | [FOCAL] public void PlainMailboxManager.transportMessage(Who recipient, Message msg)
[CLASS] class PlainMailboxManager implements MailboxManager
[METRICS] loc=11 cc=2 branches=1 loops=0 returns=0 throws=1 nesting=1
[CALLS-EXTERNAL] Message.getMessageId/0, Message.setMessageId/1, idGen.next/0, MyTransportMessage.transpo... | /* static context
[FOCAL] public void PlainMailboxManager.transportMessage(Who recipient, Message msg)
[THROWS-WHEN] IllegalStateException when msg.getMessageId() != null
[PATH1] if(msg.getMessageId() != null)=T -> throw new IllegalStateException( "message has already been sent" )
[PATH2] if(msg.getMessageId() != null)... | /* static context
[FOCAL] public void PlainMailboxManager.transportMessage(Who recipient, Message msg)
[THROWS-WHEN] IllegalStateException when msg.getMessageId() != null
[PATH1] if(msg.getMessageId() != null)=T -> throw new IllegalStateException( "message has already been sent" )
[PATH2] if(msg.getMessageId() != null)... | true | ok | {"focal": {"class": "PlainMailboxManager", "name": "transportMessage", "signature": "void transportMessage(Who recipient, Message msg) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "recipient", "type": "Who"}, {"name": "msg", "type": "Message"}], "return_type": "void"}, "class_info": {"... |
160999_86 | class VerifyingFileFactory {
public File create(String path) {
File file = new File(path);
return validate(file);
}
public VerifyingFileFactory(Builder builder);
public File validate(File file);
private void doFailForNonExistingPath(File file);
private void doWarnForRelativeP... | VerifyingFileFactory vff = new VerifyingFileFactory.Builder(log).warnForRelativePath().build();
vff.create("./an/intended/relative/path");
// assertFalse(log.hasWarned);
}
} | [FOCAL] public File VerifyingFileFactory.create(String path)
[CLASS] class VerifyingFileFactory
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] File validate(File file)
[NEW] File
[INPUTS] branches=- | result=path
[DATAFLOW] file@L2->L3; path@param->L2
[CLASS-MEMBERS] VerifyingFile... | /* static context
[FOCAL] public File VerifyingFileFactory.create(String path)
[INPUTS] branches=- | result=path
[CALLS-INTERNAL] File validate(File file)
[NEW] File
*/
| /* static context
[FOCAL] public File VerifyingFileFactory.create(String path)
[INPUTS] branches=- | result=path
[CALLS-INTERNAL] File validate(File file)
[NEW] File
*/
class VerifyingFileFactory {
public File create(String path) {
File file = new File(path);
return validate(file);
}
publi... | true | ok | {"focal": {"class": "VerifyingFileFactory", "name": "create", "signature": "File create(String path)", "start_line": 3, "modifiers": "public", "params": [{"name": "path", "type": "String"}], "return_type": "File"}, "class_info": {"name": "VerifyingFileFactory", "kind": "class", "modifiers": "", "superclass": null, "int... |
161005_337 | class WikiPermission extends Permission implements Serializable {
public String toString()
{
return "(\"" + this.getClass().getName() + "\",\"" + m_wiki + "\",\"" + getActions() + "\")";
}
public WikiPermission( String wiki, String actions );
public boolean equals( Object obj );
publ... | WikiPermission p1 = new WikiPermission("*", "createPages,createGroups,editProfile");
String result = "(\"org.apache.wiki.auth.permissions.WikiPermission\",\"*\",\"creategroups,createpages,editprofile\")";
Assertions.assertEquals(result, p1.toString());
}
} | [FOCAL] public String WikiPermission.toString()
[CLASS] class WikiPermission extends Permission implements Serializable
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String getActions()
[CALLS-EXTERNAL] this.getClass().getName/0, this.getClass/0
[CLASS-MEMBERS] WikiPermission(Str... | /* static context
[FOCAL] public String WikiPermission.toString()
[CALLS-INTERNAL] String getActions()
[CALLS-EXTERNAL] this.getClass().getName/0, this.getClass/0
*/
| /* static context
[FOCAL] public String WikiPermission.toString()
[CALLS-INTERNAL] String getActions()
[CALLS-EXTERNAL] this.getClass().getName/0, this.getClass/0
*/
class WikiPermission extends Permission implements Serializable {
public String toString()
{
return "(\"" + this.getClass().getName() + "... | true | ok | {"focal": {"class": "WikiPermission", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "WikiPermission", "kind": "class", "modifiers": "", "superclass": "Permission", "interfaces": "Serializable", "fields": [], "... |
161180_0 | class Convert {
public static final byte[] toBytes(int i){
if(i < INT_N_65535 || i > INT_P_65535) {
return Integer.toString(i).getBytes();
}
final int absi = Math.abs(i);
final byte[] cachedData = i2b_65535[absi];
final byte[] data;
if(cachedData == null) {
data = Integer.toString(absi).getBytes();
... | Log.log("Testing number to bytes conversion ...");
byte[] javadata = null;
byte[] data = null;
// test MIN
int n;
n=Integer.MIN_VALUE;
javadata = Integer.toString(n).getBytes();
data = Convert.toBytes(n);
assertEquals (data.length, javadata.length, "buffer length");
for(int j=0; j<data.length;j++)... | [FOCAL] public static final byte[] Convert.toBytes(int i)
[CLASS] class Convert
[METRICS] loc=16 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] byte[] getNegativeNumberBytes(byte[] unsigned)
[CALLS-EXTERNAL] Integer.toString(i).getBytes/0, Integer.toString/1, Math.abs/1, Integer.toString(absi).ge... | /* static context
[FOCAL] public static final byte[] Convert.toBytes(int i)
[PATH1] if(i < INT_N_65535 || i > INT_P_65535)=F -> if(cachedData == null)=T -> return i >= 0 ? data : getNegativeNumberBytes(data)
[PATH2] if(i < INT_N_65535 || i > INT_P_65535)=T -> return Integer.toString(i).getBytes()
[PATH3] if(i < INT_N_6... | /* static context
[FOCAL] public static final byte[] Convert.toBytes(int i)
[PATH1] if(i < INT_N_65535 || i > INT_P_65535)=F -> if(cachedData == null)=T -> return i >= 0 ? data : getNegativeNumberBytes(data)
[PATH2] if(i < INT_N_65535 || i > INT_P_65535)=T -> return Integer.toString(i).getBytes()
[PATH3] if(i < INT_N_6... | true | ok | {"focal": {"class": "Convert", "name": "toBytes", "signature": "byte[] toBytes(int i)", "start_line": 3, "modifiers": "public static final", "params": [{"name": "i", "type": "int"}], "return_type": "byte[]"}, "class_info": {"name": "Convert", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fi... |
168535_2 | class GuestbookNavigation {
public Entry getPrevious() {
Entry previous = null;
for (Entry entry : entryDao.readAll()) {
if (entry.getId().equals(current.getId()) && previous != null) {
return previous;
}
previous = entry;
}
return... | expect(daoMock.readAll()).andReturn(new ArrayList<Entry>());
replay(daoMock);
assertNull(classUnderTest.getPrevious());
verify(daoMock);
}
} | [FOCAL] public Entry GuestbookNavigation.getPrevious()
[CLASS] class GuestbookNavigation
[METRICS] loc=10 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] entryDao.readAll/0, entry.getId().equals/1, Entry.getId/0, current.getId/0
[PATH1] foreach(Entry entry : entryDao.readAll())=T -> if(entry.getId... | /* static context
[FOCAL] public Entry GuestbookNavigation.getPrevious()
[PATH1] foreach(Entry entry : entryDao.readAll())=T -> if(entry.getId().equals(current.getId()) && previous != null)=F -> exit loop -> return null
[PATH2] foreach(Entry entry : entryDao.readAll())=T -> if(entry.getId().equals(current.getId()) && p... | /* static context
[FOCAL] public Entry GuestbookNavigation.getPrevious()
[PATH1] foreach(Entry entry : entryDao.readAll())=T -> if(entry.getId().equals(current.getId()) && previous != null)=F -> exit loop -> return null
[PATH2] foreach(Entry entry : entryDao.readAll())=T -> if(entry.getId().equals(current.getId()) && p... | true | ok | {"focal": {"class": "GuestbookNavigation", "name": "getPrevious", "signature": "Entry getPrevious()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Entry"}, "class_info": {"name": "GuestbookNavigation", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name":... |
169928_3 | class SeasonPassManager {
public int sizeOfToDoList() {
return toDoList.size();
}
public SeasonPassManager(Schedule schedule);
public void setNumberOfRecorders(int number);
public Program createNewSeasonPass(String programName, int channel);
private boolean conflictsWithExistingSchedule(Program program);
p... | assertEquals(0, seasonPassManager.sizeOfToDoList());
}
} | [FOCAL] public int SeasonPassManager.sizeOfToDoList()
[CLASS] class SeasonPassManager
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] toDoList.size/0
[COLLABORATORS] field toDoList size/0
[CLASS-MEMBERS] SeasonPassManager(Schedule schedule); void setNumberOfRecorders(int number); P... | /* static context
[FOCAL] public int SeasonPassManager.sizeOfToDoList()
[COLLABORATORS] field toDoList size/0
[CALLS-EXTERNAL] toDoList.size/0
*/
| /* static context
[FOCAL] public int SeasonPassManager.sizeOfToDoList()
[COLLABORATORS] field toDoList size/0
[CALLS-EXTERNAL] toDoList.size/0
*/
class SeasonPassManager {
public int sizeOfToDoList() {
return toDoList.size();
}
public SeasonPassManager(Schedule schedule);
public void setNumberOfRecorders(int ... | true | ok | {"focal": {"class": "SeasonPassManager", "name": "sizeOfToDoList", "signature": "int sizeOfToDoList()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "SeasonPassManager", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "... |
175376_3 | class Parser {
Expr parseYieldExpr() {
return new Expr.Yield(parseOptionalTestList());
}
public Parser(Scanner scanner);
private boolean is(String t);
private boolean at(String t);
private Object value();
private void expect(String token);
int line();
Suite parseFileInput();
ExprList pars... | assertEquals("Suite[Expr(Yield(Lit(None)))]", parse("(yield)\n"));
}
} | [FOCAL] Expr Parser.parseYieldExpr()
[CLASS] class Parser
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] ExprList parseOptionalTestList()
[NEW] Expr.Yield
[CLASS-MEMBERS] Parser(Scanner scanner); boolean is(String t); boolean at(String t); Object value(); void expect(String token)... | /* static context
[FOCAL] Expr Parser.parseYieldExpr()
[CALLS-INTERNAL] ExprList parseOptionalTestList()
[NEW] Expr.Yield
*/
| /* static context
[FOCAL] Expr Parser.parseYieldExpr()
[CALLS-INTERNAL] ExprList parseOptionalTestList()
[NEW] Expr.Yield
*/
class Parser {
Expr parseYieldExpr() {
return new Expr.Yield(parseOptionalTestList());
}
public Parser(Scanner scanner);
private boolean is(String t);
private boolean at(String ... | true | ok | {"focal": {"class": "Parser", "name": "parseYieldExpr", "signature": "Expr parseYieldExpr()", "start_line": 3, "modifiers": "", "params": [], "return_type": "Expr"}, "class_info": {"name": "Parser", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Parser", "k... |
184604_0 | class CharacterUtil {
public static int count(String text) {
return text.length();
}
private CharacterUtil();
public static boolean isExceedingLengthLimitation(String text);
}
class CharacterUtilTest {
@Test
void testCount() throws Exception {
| String str;
int expectedLength;
str = "a quick brown fox jumped over the lazy dog.";
expectedLength = str.length();
assertEquals(expectedLength, CharacterUtil.count(str));
str = "café";
expectedLength = 4;
assertEquals(expectedLength, CharacterUtil.count(... | [FOCAL] public static int CharacterUtil.count(String text)
[CLASS] class CharacterUtil
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] String.length/0
[INPUTS] branches=- | result=text
[DATAFLOW] text@param->L2
[CLASS-MEMBERS] CharacterUtil(); boolean isExceedingLengthLimitation(St... | class CharacterUtil {
public static int count(String text) {
return text.length();
}
private CharacterUtil();
public static boolean isExceedingLengthLimitation(String text);
}
class CharacterUtilTest {
@Test
void testCount() throws Exception {
| false | ok | {"focal": {"class": "CharacterUtil", "name": "count", "signature": "int count(String text)", "start_line": 3, "modifiers": "public static", "params": [{"name": "text", "type": "String"}], "return_type": "int"}, "class_info": {"name": "CharacterUtil", "kind": "class", "modifiers": "", "superclass": null, "interfaces": n... | |
206320_1 | class AccuRevRemoveCommand extends AbstractAccuRevCommand {
public RemoveScmResult remove( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
throws ScmException
{
return (RemoveScmResult) execute( repository, fileSet, parameters );
}
public AccuRevRe... | final ScmFileSet testFileSet = new ScmFileSet( basedir, new File( "src/main/java/Foo.java" ) );
List<File> removedFiles = Collections.singletonList( new File( "removed/file" ) );
when( accurev.defunct( basedir, testFileSet.getFileList(), "A deleted file" ) ).thenReturn( removedFiles );
... | [FOCAL] public RemoveScmResult AccuRevRemoveCommand.remove(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)
[CLASS] class AccuRevRemoveCommand extends AbstractAccuRevCommand
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] execute/3 (inherited)
[EX... | /* static context
[FOCAL] public RemoveScmResult AccuRevRemoveCommand.remove(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)
[INPUTS] branches=- | result=fileSet, parameters, repository
[EXCEPTIONS] declares ScmException
[CALLS-EXTERNAL] execute/3 (inherited)
*/
| /* static context
[FOCAL] public RemoveScmResult AccuRevRemoveCommand.remove(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)
[INPUTS] branches=- | result=fileSet, parameters, repository
[EXCEPTIONS] declares ScmException
[CALLS-EXTERNAL] execute/3 (inherited)
*/
class AccuRevRemoveCo... | true | ok | {"focal": {"class": "AccuRevRemoveCommand", "name": "remove", "signature": "RemoveScmResult remove(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException", "start_line": 3, "modifiers": "public", "params": [{"name": "repository", "type": "ScmProviderRepository"}, {"name"... |
206322_31 | class LineEndingsUtils {
@Nullable
public static String getLineEndingCharacters( @Nullable String lineEnding )
throws AssemblyFormattingException
{
String value = lineEnding;
if ( lineEnding != null )
{
try
{
value = LineEndings.val... | assertEquals( null, LineEndings.keep.getLineEndingCharacters() );
}
} | [FOCAL] @Nullable public static String LineEndingsUtils.getLineEndingCharacters(String lineEnding)
[CLASS] class LineEndingsUtils
[METRICS] loc=22 cc=3 branches=1 loops=0 returns=1 throws=1 nesting=2
[CALLS-EXTERNAL] LineEndings.valueOf( lineEnding ).getLineEndingCharacters/0, LineEndings.valueOf/1
[NEW] AssemblyFormat... | /* static context
[FOCAL] @Nullable public static String LineEndingsUtils.getLineEndingCharacters(String lineEnding)
[THROWS-WHEN] AssemblyFormattingException when lineEnding != null && try-body throws
[PATH1] if(lineEnding != null)=T -> try-body throws -> throw new AssemblyFormattingException( "Illegal lineEnding spec... | /* static context
[FOCAL] @Nullable public static String LineEndingsUtils.getLineEndingCharacters(String lineEnding)
[THROWS-WHEN] AssemblyFormattingException when lineEnding != null && try-body throws
[PATH1] if(lineEnding != null)=T -> try-body throws -> throw new AssemblyFormattingException( "Illegal lineEnding spec... | true | ok | {"focal": {"class": "LineEndingsUtils", "name": "getLineEndingCharacters", "signature": "String getLineEndingCharacters(String lineEnding) throws AssemblyFormattingException", "start_line": 3, "modifiers": "@Nullable public static", "params": [{"name": "lineEnding", "type": "String"}], "return_type": "String"}, "class_... |
206350_846 | class CallbackDescriptor implements Serializable {
public LifecycleEvent getCallbackType() {
return callbackType;
}
public CallbackDescriptor(LifecycleEvent callbackType);
public void clear();
public Collection<String> getCallbackMethods();
public void addCallbackMethod(String method... | CallbackDescriptor m = new CallbackDescriptor(LifecycleEvent.POST_LOAD);
assertEquals(LifecycleEvent.POST_LOAD, m.getCallbackType());
}
} | [FOCAL] public LifecycleEvent CallbackDescriptor.getCallbackType()
[CLASS] class CallbackDescriptor implements Serializable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] CallbackDescriptor(LifecycleEvent callbackType); void clear(); Collection<String> getCallbackMethods(); void ad... | /* static context
[FOCAL] public LifecycleEvent CallbackDescriptor.getCallbackType()
*/
| /* static context
[FOCAL] public LifecycleEvent CallbackDescriptor.getCallbackType()
*/
class CallbackDescriptor implements Serializable {
public LifecycleEvent getCallbackType() {
return callbackType;
}
public CallbackDescriptor(LifecycleEvent callbackType);
public void clear();
public ... | true | ok | {"focal": {"class": "CallbackDescriptor", "name": "getCallbackType", "signature": "LifecycleEvent getCallbackType()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "LifecycleEvent"}, "class_info": {"name": "CallbackDescriptor", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "... |
206364_39 | class DBDictionary implements Configurable, ConnectionDecorator, JoinSyntaxes,
LoggingConnectionDecorator.SQLWarningHandler, IdentifierConfiguration {
public String toSnakeCase(final String name) {
final StringBuilder out = new StringBuilder(name.length() + 3);
final boolean isDelimited = name.... | final DBDictionary dictionary = new DBDictionary();
assertEquals("foo", dictionary.toSnakeCase("foo"));
assertEquals("foo_bar", dictionary.toSnakeCase("fooBar"));
assertEquals("fooba_r", dictionary.toSnakeCase("FoobaR"));
assertEquals("o_f_o_ob", dictionary.toSnakeCase("oFOOb"));... | [FOCAL] public String DBDictionary.toSnakeCase(String name)
[CLASS] class DBDictionary implements Configurable, ConnectionDecorator, JoinSyntaxes, LoggingConnectionDecorator.SQLWarningHandler, IdentifierConfiguration
[METRICS] loc=25 cc=6 branches=4 loops=1 returns=1 throws=0 nesting=3
[CALLS-INTERNAL] String getLeadin... | class DBDictionary implements Configurable, ConnectionDecorator, JoinSyntaxes,
LoggingConnectionDecorator.SQLWarningHandler, IdentifierConfiguration {
public String toSnakeCase(final String name) {
final StringBuilder out = new StringBuilder(name.length() + 3);
final boolean isDelimited = name.... | false | ok | {"focal": {"class": "DBDictionary", "name": "toSnakeCase", "signature": "String toSnakeCase(String name)", "start_line": 4, "modifiers": "public", "params": [{"name": "name", "type": "String"}], "return_type": "String"}, "class_info": {"name": "DBDictionary", "kind": "class", "modifiers": "", "superclass": null, "inter... | |
206402_426 | class ResponseCachingPolicy {
public boolean isResponseCacheable(final String httpMethod, final HttpResponse response) {
boolean cacheable = false;
if (!HeaderConstants.GET_METHOD.equals(httpMethod) && !HeaderConstants.HEAD_METHOD.equals(httpMethod)) {
if (LOG.isDebugEnabled()) {
... |
Assert.assertFalse(policy.isResponseCacheable("PUT", response));
Assert.assertFalse(policy.isResponseCacheable("get", response));
}
} | [FOCAL] public boolean ResponseCachingPolicy.isResponseCacheable(String httpMethod, HttpResponse response)
[CLASS] class ResponseCachingPolicy
[METRICS] loc=78 cc=19 branches=17 loops=1 returns=11 throws=0 nesting=4
[CALLS-INTERNAL] boolean isExplicitlyCacheable(HttpResponse response); boolean isExplicitlyNonCacheable(... | /* static context
[FOCAL] public boolean ResponseCachingPolicy.isResponseCacheable(String httpMethod, HttpResponse response)
[PATH1] if(!HeaderConstants.GET_METHOD.equals(httpMethod) && !HeaderConstants.HEAD_METHOD.equals(httpMethod))=F -> if(CACHEABLE_STATUS_CODES.contains(status))=T -> if(contentLength != null)=T -> ... | /* static context
[FOCAL] public boolean ResponseCachingPolicy.isResponseCacheable(String httpMethod, HttpResponse response)
[PATH1] if(!HeaderConstants.GET_METHOD.equals(httpMethod) && !HeaderConstants.HEAD_METHOD.equals(httpMethod))=F -> if(CACHEABLE_STATUS_CODES.contains(status))=T -> if(contentLength != null)=T -> ... | true | ok | {"focal": {"class": "ResponseCachingPolicy", "name": "isResponseCacheable", "signature": "boolean isResponseCacheable(String httpMethod, HttpResponse response)", "start_line": 3, "modifiers": "public", "params": [{"name": "httpMethod", "type": "String"}, {"name": "response", "type": "HttpResponse"}], "return_type": "bo... |
206403_0 | class JsonWriter {
void write(Node node, int maxLevels) throws RepositoryException, IOException {
write(node, 0, maxLevels);
}
JsonWriter(Writer writer);
void write(Collection<Node> nodes, int maxLevels);
private void write(Node node, int currentLevel, int maxLevels);
private void ... | StringWriter writer = new StringWriter();
JsonWriter jsonWriter = new JsonWriter(writer);
Node parent = createMock(Node.class);
Property doubleProperty = createMock(Property.class);
Value doublePropertyValue = createMock(Value.class);
expect(doubleProperty.getType()).and... | [FOCAL] void JsonWriter.write(Node node, int maxLevels)
[CLASS] class JsonWriter
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void write(Node node, int currentLevel, int maxLevels)
[EXCEPTIONS] declares RepositoryException, IOException
[DATAFLOW] maxLevels@param->L2; node@param-... | /* static context
[FOCAL] void JsonWriter.write(Node node, int maxLevels)
[EXCEPTIONS] declares RepositoryException, IOException
[CALLS-INTERNAL] void write(Node node, int currentLevel, int maxLevels)
*/
| /* static context
[FOCAL] void JsonWriter.write(Node node, int maxLevels)
[EXCEPTIONS] declares RepositoryException, IOException
[CALLS-INTERNAL] void write(Node node, int currentLevel, int maxLevels)
*/
class JsonWriter {
void write(Node node, int maxLevels) throws RepositoryException, IOException {
write... | true | ok | {"focal": {"class": "JsonWriter", "name": "write", "signature": "void write(Node node, int maxLevels) throws RepositoryException, IOException", "start_line": 3, "modifiers": "", "params": [{"name": "node", "type": "Node"}, {"name": "maxLevels", "type": "int"}], "return_type": "void"}, "class_info": {"name": "JsonWriter... |
206418_92 | class ParallelBuildsManager implements BuildsManager, Contextualizable {
public void checkoutProject( int projectId, String projectName, File workingDirectory, String scmRootUrl,
String scmUsername, String scmPassword, BuildDefinition defaultBuildDefinition,
... | setupMockOverallBuildQueues();
BuildDefinition buildDef = new BuildDefinition();
buildDef.setId( 1 );
buildDef.setSchedule( getSchedule( 1, 1, 2 ) );
setupCheckoutProjectBuildQueuesAreEmpty();
buildsManager.checkoutProject( 1, "continuum-project-test-1",
... | [FOCAL] public void ParallelBuildsManager.checkoutProject(int projectId, String projectName, File workingDirectory, String scmRootUrl, String scmUsername, String scmPassword, BuildDefinition defaultBuildDefinition, List<Project> subProjects)
[CLASS] class ParallelBuildsManager implements BuildsManager, Contextualizable... | class ParallelBuildsManager implements BuildsManager, Contextualizable {
public void checkoutProject( int projectId, String projectName, File workingDirectory, String scmRootUrl,
String scmUsername, String scmPassword, BuildDefinition defaultBuildDefinition,
... | false | ok | {"focal": {"class": "ParallelBuildsManager", "name": "checkoutProject", "signature": "void checkoutProject(int projectId, String projectName, File workingDirectory, String scmRootUrl, String scmUsername, String scmPassword, BuildDefinition defaultBuildDefinition, List<Project> subProjects) throws BuildManagerException"... | |
206437_62 | class CipherTextHandler {
public byte[] decrypt( EncryptionKey key, EncryptedData data, KeyUsage usage ) throws KerberosException
{
LOG_KRB.debug( "Decrypting data using key {} and usage {}", key.getKeyType(), usage );
EncryptionEngine engine = getEngine( key );
return engine.getDecryp... | CipherTextHandler lockBox = new CipherTextHandler();
KerberosPrincipal principal = new KerberosPrincipal( "erodriguez@EXAMPLE.COM" );
KerberosKey kerberosKey = new KerberosKey( principal, "badpassword".toCharArray(), "DES" );
EncryptionKey key = new EncryptionKey( EncryptionType.DES_CBC_... | [FOCAL] public byte[] CipherTextHandler.decrypt(EncryptionKey key, EncryptedData data, KeyUsage usage)
[CLASS] class CipherTextHandler
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] EncryptionEngine getEngine(EncryptionKey key)
[CALLS-EXTERNAL] LOG_KRB.debug/3, EncryptionKey.getKe... | /* static context
[FOCAL] public byte[] CipherTextHandler.decrypt(EncryptionKey key, EncryptedData data, KeyUsage usage)
[INPUTS] branches=- | result=data, key, usage
[COLLABORATORS] param key:EncryptionKey getKeyType/0
[EXCEPTIONS] declares KerberosException
[CALLS-INTERNAL] EncryptionEngine getEngine(EncryptionKey ke... | /* static context
[FOCAL] public byte[] CipherTextHandler.decrypt(EncryptionKey key, EncryptedData data, KeyUsage usage)
[INPUTS] branches=- | result=data, key, usage
[COLLABORATORS] param key:EncryptionKey getKeyType/0
[EXCEPTIONS] declares KerberosException
[CALLS-INTERNAL] EncryptionEngine getEngine(EncryptionKey ke... | true | ok | {"focal": {"class": "CipherTextHandler", "name": "decrypt", "signature": "byte[] decrypt(EncryptionKey key, EncryptedData data, KeyUsage usage) throws KerberosException", "start_line": 3, "modifiers": "public", "params": [{"name": "key", "type": "EncryptionKey"}, {"name": "data", "type": "EncryptedData"}, {"name": "usa... |
206444_108 | class AcidTxnCleanerService implements MetastoreTaskThread {
@Override
public void run() {
TxnStore.MutexAPI.LockHandle handle = null;
try {
handle = txnHandler.getMutexAPI().acquireLock(TxnStore.MUTEX_KEY.TxnCleaner.name());
long start = System.currentTimeMillis();
txnHandler.cleanEmptyA... | for (int i = 0; i < 5; ++i) {
openNonEmptyThenAbort();
}
Assert.assertEquals(5 + 1, getTxnCount());
Thread.sleep(txnHandler.getOpenTxnTimeOutMillis() * 2);
underTest.run();
// deletes only the initial (committed) TXNS record
Assert.assertEquals(5, getTxnCount());
Assert.assertTru... | [FOCAL] @Override public void AcidTxnCleanerService.run()
[CLASS] class AcidTxnCleanerService implements MetastoreTaskThread
[METRICS] loc=16 cc=3 branches=1 loops=0 returns=0 throws=0 nesting=2
[CALLS-INTERNAL] long elapsedSince(long start)
[CALLS-EXTERNAL] txnHandler.getMutexAPI().acquireLock/1, TxnStore.getMutexAPI/... | /* static context
[FOCAL] @Override public void AcidTxnCleanerService.run()
[PATH1] try-body throws -> if(handle != null)=T
[PATH2] if(handle != null)=F
[INPUTS] branches=txnHandler | result=-
[COLLABORATORS] field txnHandler:TxnStore getMutexAPI/0,cleanEmptyAbortedAndCommittedTxns/0
[EXCEPTIONS] catches Throwable t
[C... | /* static context
[FOCAL] @Override public void AcidTxnCleanerService.run()
[PATH1] try-body throws -> if(handle != null)=T
[PATH2] if(handle != null)=F
[INPUTS] branches=txnHandler | result=-
[COLLABORATORS] field txnHandler:TxnStore getMutexAPI/0,cleanEmptyAbortedAndCommittedTxns/0
[EXCEPTIONS] catches Throwable t
[C... | true | ok | {"focal": {"class": "AcidTxnCleanerService", "name": "run", "signature": "void run()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "AcidTxnCleanerService", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "MetastoreTaskThread", "field... |
206451_6 | class XPath20ExpressionRuntime implements ExpressionLanguageRuntime {
@SuppressWarnings("unchecked")
public List evaluate(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException {
List result;
Object someRes = null;
try {
someRes = evaluate(cexp, ... | String insertElementName="InsertedNode";
OXPath20ExpressionBPEL20 exp = compile("$reallyEmptyVar/"+insertElementName);
exp.setInsertMissingData(true);
// Setup root node
_rootNode = DOMUtils.stringToDOM("<tns:ApplicationData xmlns:tns=\"http://foobar\"/>");
... | [FOCAL] @SuppressWarnings("unchecked") public List XPath20ExpressionRuntime.evaluate(OExpression cexp, EvaluationContext ctx)
[CLASS] class XPath20ExpressionRuntime implements ExpressionLanguageRuntime
[METRICS] loc=63 cc=12 branches=9 loops=1 returns=1 throws=0 nesting=4
[CALLS-INTERNAL] Object evaluate(OExpression ce... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public List XPath20ExpressionRuntime.evaluate(OExpression cexp, EvaluationContext ctx)
[PATH1] try-body throws -> if(someRes instanceof List)=F -> if(someRes instanceof NodeList)=T -> if(__log.isDebugEnabled())#2=T -> for(m < retVal.getLength())=T -> if(val.getNo... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public List XPath20ExpressionRuntime.evaluate(OExpression cexp, EvaluationContext ctx)
[PATH1] try-body throws -> if(someRes instanceof List)=F -> if(someRes instanceof NodeList)=T -> if(__log.isDebugEnabled())#2=T -> for(m < retVal.getLength())=T -> if(val.getNo... | true | ok | {"focal": {"class": "XPath20ExpressionRuntime", "name": "evaluate", "signature": "List evaluate(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public", "params": [{"name": "cexp", "type": "OExpression"}, {"name": "ctx... |
206452_15 | class UIAction extends ActionSupport implements UIActionPreparable, UISecurityEnforced, RequestAware {
public static String cleanTextKey(String s) {
if (s == null || s.isEmpty()) {
return s;
}
// escape HTML
return StringEscapeUtils.escapeHtml4(cleanExpressions(s));
... | assertEquals(null,UIAction.cleanTextKey(null));
assertEquals("",UIAction.cleanTextKey(""));
assertEquals("a",UIAction.cleanTextKey("a"));
assertEquals("$",UIAction.cleanTextKey("$"));
assertEquals("%",UIAction.cleanTextKey("%"));
assertEquals("%$",UIAction.cleanTextKey("%... | [FOCAL] public static String UIAction.cleanTextKey(String s)
[CLASS] class UIAction extends ActionSupport implements UIActionPreparable, UISecurityEnforced, RequestAware
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] String cleanExpressions(String s)
[CALLS-EXTERNAL] String.isEmpt... | /* static context
[FOCAL] public static String UIAction.cleanTextKey(String s)
[PATH1] if(s == null || s.isEmpty())=T -> return s
[PATH2] if(s == null || s.isEmpty())=F -> return StringEscapeUtils.escapeHtml4(cleanExpressions(s))
[INPUTS] branches=s | result=s
[CALLS-INTERNAL] String cleanExpressions(String s)
[CALLS-E... | /* static context
[FOCAL] public static String UIAction.cleanTextKey(String s)
[PATH1] if(s == null || s.isEmpty())=T -> return s
[PATH2] if(s == null || s.isEmpty())=F -> return StringEscapeUtils.escapeHtml4(cleanExpressions(s))
[INPUTS] branches=s | result=s
[CALLS-INTERNAL] String cleanExpressions(String s)
[CALLS-E... | true | ok | {"focal": {"class": "UIAction", "name": "cleanTextKey", "signature": "String cleanTextKey(String s)", "start_line": 3, "modifiers": "public static", "params": [{"name": "s", "type": "String"}], "return_type": "String"}, "class_info": {"name": "UIAction", "kind": "class", "modifiers": "", "superclass": "ActionSupport", ... |
206483_66 | class ModelMerger {
protected void mergeContributor_Roles( Contributor target, Contributor source, boolean sourceDominant,
Map<Object, Object> context )
{
target.setRoles( merge( target.getRoles(), source.getRoles(), sourceDominant, e -> e ) );
}
publ... | Contributor target = new Contributor();
target.setRoles( Arrays.asList( "first", "second", "third" ) );
Contributor source = new Contributor();
source.setRoles( Arrays.asList( "first", "second", "third" ) );
modelMerger.mergeContributor_Roles( target, source, true, null );
... | [FOCAL] protected void ModelMerger.mergeContributor_Roles(Contributor target, Contributor source, boolean sourceDominant, Map<Object, Object> context)
[CLASS] class ModelMerger
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void merge(Model target, Model source, boolean sourceDomi... | class ModelMerger {
protected void mergeContributor_Roles( Contributor target, Contributor source, boolean sourceDominant,
Map<Object, Object> context )
{
target.setRoles( merge( target.getRoles(), source.getRoles(), sourceDominant, e -> e ) );
}
publ... | false | ok | {"focal": {"class": "ModelMerger", "name": "mergeContributor_Roles", "signature": "void mergeContributor_Roles(Contributor target, Contributor source, boolean sourceDominant, Map<Object, Object> context)", "start_line": 3, "modifiers": "protected", "params": [{"name": "target", "type": "Contributor"}, {"name": "source"... | |
206633_1000 | class BeanFilter {
public Object createFilteredBean(Object data, Set<String> fields) {
return createFilteredBean(data, fields, "");
}
@SuppressWarnings("unchecked") private Object createFilteredBean(Object data, Set<String> fields, String fieldName);
public Set<String> processBeanFields(Collection<String>... | SimpleBean data = new SimpleBean().setI(5);
SimpleBeanInterface dataBean = (SimpleBeanInterface) beanDelegator.createDelegator(data);
SimpleBeanInterface newData = (SimpleBeanInterface) beanFilter.createFilteredBean(
dataBean, ImmutableSet.<String>of("i"));
assertEquals(5, newData.getI());
... | [FOCAL] public Object BeanFilter.createFilteredBean(Object data, Set<String> fields)
[CLASS] class BeanFilter
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Object createFilteredBean(Object data, Set<String> fields, String fieldName)
[INPUTS] branches=- | result=data, fields
[DATA... | /* static context
[FOCAL] public Object BeanFilter.createFilteredBean(Object data, Set<String> fields)
[INPUTS] branches=- | result=data, fields
[CALLS-INTERNAL] Object createFilteredBean(Object data, Set<String> fields, String fieldName)
*/
| /* static context
[FOCAL] public Object BeanFilter.createFilteredBean(Object data, Set<String> fields)
[INPUTS] branches=- | result=data, fields
[CALLS-INTERNAL] Object createFilteredBean(Object data, Set<String> fields, String fieldName)
*/
class BeanFilter {
public Object createFilteredBean(Object data, Set<String... | true | ok | {"focal": {"class": "BeanFilter", "name": "createFilteredBean", "signature": "Object createFilteredBean(Object data, Set<String> fields)", "start_line": 3, "modifiers": "public", "params": [{"name": "data", "type": "Object"}, {"name": "fields", "type": "Set<String>"}], "return_type": "Object"}, "class_info": {"name": "... |
206635_4 | class PluginMetadataParser {
public Set<MojoDescriptor> parseMojoDescriptors( File metadataFile )
throws PluginMetadataParseException
{
Set<MojoDescriptor> descriptors = new HashSet<>();
try ( Reader reader = ReaderFactory.newXmlReader( metadataFile ) )
{
PluginMet... | File metadataFile = getMetadataFile( "test2.mojos.xml" );
Set<MojoDescriptor> descriptors = new PluginMetadataParser().parseMojoDescriptors( metadataFile );
assertEquals( 1, descriptors.size() );
MojoDescriptor desc = descriptors.iterator().next();
assertTrue( d... | [FOCAL] public Set<MojoDescriptor> PluginMetadataParser.parseMojoDescriptors(File metadataFile)
[CLASS] class PluginMetadataParser
[METRICS] loc=31 cc=4 branches=1 loops=1 returns=1 throws=1 nesting=3
[CALLS-INTERNAL] MojoDescriptor asDescriptor(File metadataFile, Mojo mojo)
[CALLS-EXTERNAL] ReaderFactory.newXmlReader/... | /* static context
[FOCAL] public Set<MojoDescriptor> PluginMetadataParser.parseMojoDescriptors(File metadataFile)
[THROWS-WHEN] PluginMetadataParseException when try-body throws
[PATH1] if(mojos != null)=T -> foreach(Mojo mojo : mojos)=T -> exit loop -> return descriptors
[PATH2] try-body throws -> throw new PluginMeta... | /* static context
[FOCAL] public Set<MojoDescriptor> PluginMetadataParser.parseMojoDescriptors(File metadataFile)
[THROWS-WHEN] PluginMetadataParseException when try-body throws
[PATH1] if(mojos != null)=T -> foreach(Mojo mojo : mojos)=T -> exit loop -> return descriptors
[PATH2] try-body throws -> throw new PluginMeta... | true | ok | {"focal": {"class": "PluginMetadataParser", "name": "parseMojoDescriptors", "signature": "Set<MojoDescriptor> parseMojoDescriptors(File metadataFile) throws PluginMetadataParseException", "start_line": 3, "modifiers": "public", "params": [{"name": "metadataFile", "type": "File"}], "return_type": "Set<MojoDescriptor>"},... |
209853_134 | class BancoDoBrasil extends AbstractBanco implements Banco {
@Override
public String geraCodigoDeBarrasPara(Boleto boleto) {
Beneficiario beneficiario = boleto.getBeneficiario();
String numeroConvenio = beneficiario.getNumeroConvenio();
if (numeroConvenio == null
|| numeroConve... | this.banco = new BancoDoBrasil();
this.boleto = this.boleto.comBanco(this.banco);
assertEquals("3860", this.banco.geraCodigoDeBarrasPara(this.boleto).substring(5, 9));
}
} | [FOCAL] @Override public String BancoDoBrasil.geraCodigoDeBarrasPara(Boleto boleto)
[CLASS] class BancoDoBrasil extends AbstractBanco implements Banco
[METRICS] loc=34 cc=6 branches=5 loops=0 returns=1 throws=2 nesting=1
[CALLS-EXTERNAL] Boleto.getBeneficiario/0, Beneficiario.getNumeroConvenio/0, String.isEmpty/0, Stri... | /* static context
[FOCAL] @Override public String BancoDoBrasil.geraCodigoDeBarrasPara(Boleto boleto)
[THROWS-WHEN] IllegalArgumentException when numeroConvenio == null || numeroConvenio.isEmpty()
[THROWS-WHEN] IllegalArgumentException when !(numeroConvenio == null || numeroConvenio.isEmpty()) && numeroPosicoesConvenio... | /* static context
[FOCAL] @Override public String BancoDoBrasil.geraCodigoDeBarrasPara(Boleto boleto)
[THROWS-WHEN] IllegalArgumentException when numeroConvenio == null || numeroConvenio.isEmpty()
[THROWS-WHEN] IllegalArgumentException when !(numeroConvenio == null || numeroConvenio.isEmpty()) && numeroPosicoesConvenio... | true | ok | {"focal": {"class": "BancoDoBrasil", "name": "geraCodigoDeBarrasPara", "signature": "String geraCodigoDeBarrasPara(Boleto boleto)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "boleto", "type": "Boleto"}], "return_type": "String"}, "class_info": {"name": "BancoDoBrasil", "kind": "class", "modi... |
213337_470 | class Domain {
public abstract SortedSetModel<AdverseEvent> getAdverseEvents()public abstract SortedSetModel<AdverseEvent> getAdverseEvents();
public abstract SortedSetModel<AdverseEvent> getAdverseEvents()public abstract List<EntityCategory> getCategories();
public abstract SortedSetModel<AdverseEvent> getAdverseEve... | AdverseEvent ade = new AdverseEvent("a", AdverseEvent.convertVarType(Variable.Type.RATE));
assertEquals(0, d_domain.getAdverseEvents().size());
d_domain.getAdverseEvents().add(ade);
assertEquals(1, d_domain.getAdverseEvents().size());
assertEquals(Collections.singletonList(ade), d_domain.getAdverseEvents());
... | [FOCAL] public abstract SortedSetModel<AdverseEvent> Domain.getAdverseEvents()
[CLASS] class Domain
[METRICS] loc=1 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CLASS-MEMBERS] List<EntityCategory> getCategories(); ObservableList<? extends Entity> getCategoryContents(EntityCategory node); EntityCategory getCate... | /* static context
[FOCAL] public abstract SortedSetModel<AdverseEvent> Domain.getAdverseEvents()
*/
| /* static context
[FOCAL] public abstract SortedSetModel<AdverseEvent> Domain.getAdverseEvents()
*/
class Domain {
public abstract SortedSetModel<AdverseEvent> getAdverseEvents()public abstract SortedSetModel<AdverseEvent> getAdverseEvents();
public abstract SortedSetModel<AdverseEvent> getAdverseEvents()public abstr... | true | partial | {"focal": {"class": "Domain", "name": "getAdverseEvents", "signature": "SortedSetModel<AdverseEvent> getAdverseEvents()", "start_line": 3, "modifiers": "public abstract", "params": [], "return_type": "SortedSetModel<AdverseEvent>"}, "class_info": {"name": "Domain", "kind": "class", "modifiers": "", "superclass": null, ... |
219850_20 | class WikiParser extends BrainParser {
public void setUseCanonicalFormat(boolean useCanonicalFormat) {
this.useCanonicalFormat = useCanonicalFormat;
}
@Override public Note parse(final InputStream inputStream);
private boolean isEmptyPage(final String page);
private BufferedReader createRe... | wikiParser.setUseCanonicalFormat(true);
List<Note> notes = readNotes("* Arthur Dent\n" +
"\n" +
"He's a jerk.\n" +
"A complete kneebiter.");
assertEquals(1, notes.size());
Note root = notes.get(0);
assertEquals("Arthur Dent", root.g... | [FOCAL] public void WikiParser.setUseCanonicalFormat(boolean useCanonicalFormat)
[CLASS] class WikiParser extends BrainParser
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[FIELDS] write=useCanonicalFormat
[STATE] useCanonicalFormat
[DATAFLOW] useCanonicalFormat@param->L2
[CLASS-MEMBERS] Note par... | /* static context
[FOCAL] public void WikiParser.setUseCanonicalFormat(boolean useCanonicalFormat)
[STATE] useCanonicalFormat
[FIELDS] write=useCanonicalFormat
*/
| /* static context
[FOCAL] public void WikiParser.setUseCanonicalFormat(boolean useCanonicalFormat)
[STATE] useCanonicalFormat
[FIELDS] write=useCanonicalFormat
*/
class WikiParser extends BrainParser {
public void setUseCanonicalFormat(boolean useCanonicalFormat) {
this.useCanonicalFormat = useCanonicalFor... | true | ok | {"focal": {"class": "WikiParser", "name": "setUseCanonicalFormat", "signature": "void setUseCanonicalFormat(boolean useCanonicalFormat)", "start_line": 3, "modifiers": "public", "params": [{"name": "useCanonicalFormat", "type": "boolean"}], "return_type": "void"}, "class_info": {"name": "WikiParser", "kind": "class", "... |
225207_7 | class NMRFaultOutInterceptor extends AbstractPhaseInterceptor<NMRMessage> {
public void handleMessage(NMRMessage message) throws Fault {
message.put(org.apache.cxf.message.Message.RESPONSE_CODE, new Integer(500));
NSStack nsStack = new NSStack();
nsStack.push();
t... | PhaseInterceptor<NMRMessage> interceptor = new NMRFaultOutInterceptor();
try {
NMRMessage msg = new NMRMessage(new MessageImpl());
interceptor.handleMessage(msg);
fail("Should have thrown an exception");
} catch (IllegalStateException e) {
// ok
... | [FOCAL] public void NMRFaultOutInterceptor.handleMessage(NMRMessage message)
[CLASS] class NMRFaultOutInterceptor extends AbstractPhaseInterceptor<NMRMessage>
[METRICS] loc=34 cc=5 branches=2 loops=1 returns=0 throws=1 nesting=4
[CALLS-INTERNAL] Fault getFault(NMRMessage message); XMLStreamWriter getWriter(NMRMessage m... | /* static context
[FOCAL] public void NMRFaultOutInterceptor.handleMessage(NMRMessage message)
[THROWS-WHEN] Fault when try-body throws
[PATH1] if(!jbiFault.hasDetails())=F -> for(i < details.getLength())=T -> if(details.item(i) instanceof Element)=F -> exit loop
[PATH2] try-body throws -> throw new Fault(new Message("... | /* static context
[FOCAL] public void NMRFaultOutInterceptor.handleMessage(NMRMessage message)
[THROWS-WHEN] Fault when try-body throws
[PATH1] if(!jbiFault.hasDetails())=F -> for(i < details.getLength())=T -> if(details.item(i) instanceof Element)=F -> exit loop
[PATH2] try-body throws -> throw new Fault(new Message("... | true | ok | {"focal": {"class": "NMRFaultOutInterceptor", "name": "handleMessage", "signature": "void handleMessage(NMRMessage message) throws Fault", "start_line": 3, "modifiers": "public", "params": [{"name": "message", "type": "NMRMessage"}], "return_type": "void"}, "class_info": {"name": "NMRFaultOutInterceptor", "kind": "clas... |
225211_0 | class OsgiLocator {
public static <T> Class<? extends T> locate(Class<T> factoryId) {
return locate(factoryId, factoryId.getName());
}
private OsgiLocator();
public static void unregister(String id, Callable<Class> factory);
public static void register(String id, Callable<Class> factory)... | System.setProperty(OsgiLocator.TIMEOUT, "0");
System.setProperty("Factory", "org.apache.servicemix.specs.locator.MockCallable");
Class clazz = OsgiLocator.locate(Object.class, "Factory");
assertNotNull("Expected to find a class", clazz);
assertEquals("Got the wrong class", MockCa... | [FOCAL] public static Class<? extends T> OsgiLocator.locate(Class<T> factoryId)
[CLASS] class OsgiLocator
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Class<? extends T> locate(Class<T> factoryClass, String factoryId)
[CALLS-EXTERNAL] Class<T>.getName/0
[INPUTS] branches=- | res... | /* static context
[FOCAL] public static Class<? extends T> OsgiLocator.locate(Class<T> factoryId)
[INPUTS] branches=- | result=factoryId
[COLLABORATORS] param factoryId:Class<T> getName/0
[CALLS-INTERNAL] Class<? extends T> locate(Class<T> factoryClass, String factoryId)
[CALLS-EXTERNAL] Class<T>.getName/0
*/
| /* static context
[FOCAL] public static Class<? extends T> OsgiLocator.locate(Class<T> factoryId)
[INPUTS] branches=- | result=factoryId
[COLLABORATORS] param factoryId:Class<T> getName/0
[CALLS-INTERNAL] Class<? extends T> locate(Class<T> factoryClass, String factoryId)
[CALLS-EXTERNAL] Class<T>.getName/0
*/
class Osg... | true | ok | {"focal": {"class": "OsgiLocator", "name": "locate", "signature": "Class<? extends T> locate(Class<T> factoryId)", "start_line": 3, "modifiers": "public static", "params": [{"name": "factoryId", "type": "Class<T>"}], "return_type": "Class<? extends T>"}, "class_info": {"name": "OsgiLocator", "kind": "class", "modifiers... |
229738_123 | class Sneaky {
@CheckReturnValue
@Nonnull
public static DummyException throwAnyway(Throwable t) {
if (t instanceof Error) {
throw (Error) t;
}
if (t instanceof RuntimeException) {
throw (RuntimeException) t;
}
if (t instanceof IOException) {... | RuntimeException rex = new IllegalArgumentException();
assertThatThrownBy(() -> Sneaky.throwAnyway(rex))
.isSameAs(rex);
}
} | [FOCAL] @CheckReturnValue @Nonnull public static DummyException Sneaky.throwAnyway(Throwable t)
[CLASS] class Sneaky
[METRICS] loc=28 cc=6 branches=5 loops=0 returns=1 throws=4 nesting=1
[CALLS-INTERNAL] void throwEvadingChecks(Throwable throwable)
[CALLS-EXTERNAL] Thread.currentThread().interrupt/0, Thread.currentThre... | /* static context
[FOCAL] @CheckReturnValue @Nonnull public static DummyException Sneaky.throwAnyway(Throwable t)
[THROWS-WHEN] (Error) t when t instanceof Error
[THROWS-WHEN] (RuntimeException) t when !(t instanceof Error) && t instanceof RuntimeException
[THROWS-WHEN] UncheckedIOException when !(t instanceof Error) &... | /* static context
[FOCAL] @CheckReturnValue @Nonnull public static DummyException Sneaky.throwAnyway(Throwable t)
[THROWS-WHEN] (Error) t when t instanceof Error
[THROWS-WHEN] (RuntimeException) t when !(t instanceof Error) && t instanceof RuntimeException
[THROWS-WHEN] UncheckedIOException when !(t instanceof Error) &... | true | ok | {"focal": {"class": "Sneaky", "name": "throwAnyway", "signature": "DummyException throwAnyway(Throwable t)", "start_line": 3, "modifiers": "@CheckReturnValue @Nonnull public static", "params": [{"name": "t", "type": "Throwable"}], "return_type": "DummyException"}, "class_info": {"name": "Sneaky", "kind": "class", "modi... |
231990_1 | class ContributorHelper {
public static List<String> parseTrack(String track) {
Pattern pattern = Pattern.compile("(.+)(\\((F|f)eat(\\. |\\.| |uring )(.+))\\)");
Matcher matcher = pattern.matcher(track);
boolean matches = matcher.matches();
if (matches) {
String title = ... | assertEquals(singletonList("A"), parseTrack("A"));
assertEquals(asList("A", "B"), parseTrack("A (feat. B)"));
assertEquals(asList("A", "B"), parseTrack("A (Feat. B)"));
assertEquals(asList("A", "B"), parseTrack("A (featuring B)"));
assertEquals(asList("A", "B"), parseTrack("A (Fe... | [FOCAL] public static List<String> ContributorHelper.parseTrack(String track)
[CLASS] class ContributorHelper
[METRICS] loc=21 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[CALLS-INTERNAL] List<String> createContributorList(String lead, String featuring)
[CALLS-EXTERNAL] Pattern.compile/1, Pattern.matcher/1, Ma... | /* static context
[FOCAL] public static List<String> ContributorHelper.parseTrack(String track)
[PATH1] if(matches)#1=F -> if(matches)#2=T -> return createContributorList(title, featuring)
[PATH2] if(matches)#1=F -> if(matches)#2=F -> return singletonList(track)
[PATH3] if(matches)#1=T -> return createContributorList(t... | /* static context
[FOCAL] public static List<String> ContributorHelper.parseTrack(String track)
[PATH1] if(matches)#1=F -> if(matches)#2=T -> return createContributorList(title, featuring)
[PATH2] if(matches)#1=F -> if(matches)#2=F -> return singletonList(track)
[PATH3] if(matches)#1=T -> return createContributorList(t... | true | ok | {"focal": {"class": "ContributorHelper", "name": "parseTrack", "signature": "List<String> parseTrack(String track)", "start_line": 3, "modifiers": "public static", "params": [{"name": "track", "type": "String"}], "return_type": "List<String>"}, "class_info": {"name": "ContributorHelper", "kind": "class", "modifiers": "... |
235076_9 | class ResourceHashModel implements TemplateHashModelEx, TemplateScalarModel, ResourceTemplate {
@Override
public String getAsString() throws TemplateModelException {
if (resource.getURI() == null) {
return INVALID_URL; // b-nodes return null and their ids are useless
} else... |
Resource resource = ModelFactory.createDefaultModel().createResource();
ResourceHashModel resourceHashModel = new ResourceHashModel(resource);
assertEquals("Unexpected URI", ResourceHashModel.INVALID_URL,
resourceHashModel.getAsString());
}
} | [FOCAL] @Override public String ResourceHashModel.getAsString()
[CLASS] class ResourceHashModel implements TemplateHashModelEx, TemplateScalarModel, ResourceTemplate
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] resource.getURI/0
[EXCEPTIONS] declares TemplateModelException
[PATH... | /* static context
[FOCAL] @Override public String ResourceHashModel.getAsString()
[PATH1] if(resource.getURI() == null)=T -> return INVALID_URL
[PATH2] if(resource.getURI() == null)=F -> return resource.getURI()
[COLLABORATORS] field resource getURI/0
[EXCEPTIONS] declares TemplateModelException
[CALLS-EXTERNAL] resour... | /* static context
[FOCAL] @Override public String ResourceHashModel.getAsString()
[PATH1] if(resource.getURI() == null)=T -> return INVALID_URL
[PATH2] if(resource.getURI() == null)=F -> return resource.getURI()
[COLLABORATORS] field resource getURI/0
[EXCEPTIONS] declares TemplateModelException
[CALLS-EXTERNAL] resour... | true | ok | {"focal": {"class": "ResourceHashModel", "name": "getAsString", "signature": "String getAsString() throws TemplateModelException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "ResourceHashModel", "kind": "class", "modifiers": "", "superclass": null, "... |
237920_1 | class CreateDeleteProjectAction extends AvailableLaterObject<Void> {
public void setProjects(Projects projects) {
this.projects = projects;
}
public CreateDeleteProjectAction(ProjectDir dir, boolean delete);
@Override public Void calculate();
private CreateDeleteProjectAction action;
ProjectDir dir;
}
c... | Projects projects = Mockito.mock(Projects.class);
action = new CreateDeleteProjectAction(dir, true);
action.setProjects(projects);
AvailableLaterWaiter.await(action);
Mockito.verify(projects).remove(dir);
Mockito.verifyNoMoreInteractions(projects);
}
} | [FOCAL] public void CreateDeleteProjectAction.setProjects(Projects projects)
[CLASS] class CreateDeleteProjectAction extends AvailableLaterObject<Void>
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[FIELDS] write=projects
[STATE] projects
[DATAFLOW] projects@param->L2
[CLASS-MEMBERS] CreateDelete... | /* static context
[FOCAL] public void CreateDeleteProjectAction.setProjects(Projects projects)
[STATE] projects
[FIELDS] write=projects
*/
| /* static context
[FOCAL] public void CreateDeleteProjectAction.setProjects(Projects projects)
[STATE] projects
[FIELDS] write=projects
*/
class CreateDeleteProjectAction extends AvailableLaterObject<Void> {
public void setProjects(Projects projects) {
this.projects = projects;
}
public CreateDeleteProjectActio... | true | ok | {"focal": {"class": "CreateDeleteProjectAction", "name": "setProjects", "signature": "void setProjects(Projects projects)", "start_line": 3, "modifiers": "public", "params": [{"name": "projects", "type": "Projects"}], "return_type": "void"}, "class_info": {"name": "CreateDeleteProjectAction", "kind": "class", "modifier... |
240464_2 | class EJBException extends RuntimeException {
public String getMessage() {
if (causeException == null) return super.getMessage();
StringBuilder sb = new StringBuilder();
if (super.getMessage() != null) {
sb.append(super.getMessage());
sb.append("; ");
}
... |
Assert.assertEquals(null, exceptionDefaultConstructor.getMessage());
Assert.assertEquals(null, exceptionWithNullMessage.getMessage());
Assert.assertEquals("msg", exceptionWithMessage.getMessage());
Assert.assertEquals("msg; nested exception is: java.lang.Exception: cause", exceptionW... | [FOCAL] public String EJBException.getMessage()
[CLASS] class EJBException extends RuntimeException
[METRICS] loc=16 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] RuntimeException.getMessage/0, StringBuilder.append/1, causeException.toString/0, StringBuilder.toString/0
[NEW] StringBuilder
[PATH1... | /* static context
[FOCAL] public String EJBException.getMessage()
[PATH1] if(causeException == null)=F -> if(super.getMessage() != null)=T -> return sb.toString()
[PATH2] if(causeException == null)=T -> return super.getMessage()
[PATH3] if(causeException == null)=F -> if(super.getMessage() != null)=F -> return sb.toStr... | /* static context
[FOCAL] public String EJBException.getMessage()
[PATH1] if(causeException == null)=F -> if(super.getMessage() != null)=T -> return sb.toString()
[PATH2] if(causeException == null)=T -> return super.getMessage()
[PATH3] if(causeException == null)=F -> if(super.getMessage() != null)=F -> return sb.toStr... | true | ok | {"focal": {"class": "EJBException", "name": "getMessage", "signature": "String getMessage()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "EJBException", "kind": "class", "modifiers": "", "superclass": "RuntimeException", "interfaces": null, "fields": [{"name":... |
240466_0 | class PropertyEditors {
public static boolean canConvert(final String type, final ClassLoader classLoader) {
if (type == null) {
throw new NullPointerException("type is null");
}
if (classLoader == null) {
throw new NullPointerException("classLoader is null");
... | assertTrue(PropertyEditors.canConvert(Blue.class));
}
} | [FOCAL] public static boolean PropertyEditors.canConvert(String type, ClassLoader classLoader)
[CLASS] class PropertyEditors
[METRICS] loc=14 cc=4 branches=2 loops=0 returns=1 throws=3 nesting=1
[CALLS-EXTERNAL] REGISTRY.findConverter/1, Class.forName/3
[NEW] NullPointerException, PropertyEditorException
[EXCEPTIONS] t... | /* static context
[FOCAL] public static boolean PropertyEditors.canConvert(String type, ClassLoader classLoader)
[THROWS-WHEN] NullPointerException when type == null
[THROWS-WHEN] NullPointerException when !(type == null) && classLoader == null
[THROWS-WHEN] PropertyEditorException when !(type == null) && !(classLoader... | /* static context
[FOCAL] public static boolean PropertyEditors.canConvert(String type, ClassLoader classLoader)
[THROWS-WHEN] NullPointerException when type == null
[THROWS-WHEN] NullPointerException when !(type == null) && classLoader == null
[THROWS-WHEN] PropertyEditorException when !(type == null) && !(classLoader... | true | ok | {"focal": {"class": "PropertyEditors", "name": "canConvert", "signature": "boolean canConvert(String type, ClassLoader classLoader)", "start_line": 3, "modifiers": "public static", "params": [{"name": "type", "type": "String"}, {"name": "classLoader", "type": "ClassLoader"}], "return_type": "boolean"}, "class_info": {"... |
247823_30 | class NewCookieHeaderDelegate implements HeaderDelegate<NewCookie> {
public String toString(NewCookie cookie) {
if (cookie == null) {
throw new IllegalArgumentException(Messages.getMessage("cookieIsNull")); //$NON-NLS-1$
}
return buildCookie(cookie.getName(), cookie.getValue(), ... | RuntimeDelegate rd = RuntimeDelegate.getInstance();
HeaderDelegate<NewCookie> newCookieHeaderDelegate =
rd.createHeaderDelegate(NewCookie.class);
if (newCookieHeaderDelegate == null) {
fail("NewCookie header delegate is not regestered in RuntimeDelegateImpl");
}
... | [FOCAL] public String NewCookieHeaderDelegate.toString(NewCookie cookie)
[CLASS] class NewCookieHeaderDelegate implements HeaderDelegate<NewCookie>
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-INTERNAL] String buildCookie(String name, String value, String path, String domain, int version,... | /* static context
[FOCAL] public String NewCookieHeaderDelegate.toString(NewCookie cookie)
[THROWS-WHEN] IllegalArgumentException when cookie == null
[PATH1] if(cookie == null)=T -> throw new IllegalArgumentException(Messages.getMessage("cookieIsNull"))
[PATH2] if(cookie == null)=F -> return buildCookie(cookie.getName(... | /* static context
[FOCAL] public String NewCookieHeaderDelegate.toString(NewCookie cookie)
[THROWS-WHEN] IllegalArgumentException when cookie == null
[PATH1] if(cookie == null)=T -> throw new IllegalArgumentException(Messages.getMessage("cookieIsNull"))
[PATH2] if(cookie == null)=F -> return buildCookie(cookie.getName(... | true | ok | {"focal": {"class": "NewCookieHeaderDelegate", "name": "toString", "signature": "String toString(NewCookie cookie)", "start_line": 3, "modifiers": "public", "params": [{"name": "cookie", "type": "NewCookie"}], "return_type": "String"}, "class_info": {"name": "NewCookieHeaderDelegate", "kind": "class", "modifiers": "", ... |
279216_19 | class Search extends Command<Result> {
public Result send(Connection connection) throws DespotifyException {
/* Create channel callback */
ChannelCallback callback = new ChannelCallback();
byte[] utf8Bytes = query.getBytes(Charset.forName("UTF8"));
/* Create channel and buffer. */
Channel chann... | Result result = (Result)manager.send(new Search(store, "Johnny Cash"));
assertTrue(result.getTotalTracks() > 2000);
assertEquals(100, result.getTracks().size());
// todo assert a bit. at least we know there was no exception.
System.currentTimeMillis();
}
} | [FOCAL] public Result Search.send(Connection connection)
[CLASS] class Search extends Command<Result>
[METRICS] loc=55 cc=4 branches=3 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] query.getBytes/1, Charset.forName/1, ByteBuffer.allocate/1, ByteBuffer.putShort/1, Channel.getId/0, ByteBuffer.putInt/1, ByteBuffer... | /* static context
[FOCAL] public Result Search.send(Connection connection)
[THROWS-WHEN] IllegalArgumentException when offset < 0
[PATH1] if(offset < 0)=F -> if(log.isInfoEnabled())=T -> if(log.isDebugEnabled())=T -> return Result.fromXMLElement(root, store)
[PATH2] if(offset < 0)=T -> throw new IllegalArgumentExceptio... | /* static context
[FOCAL] public Result Search.send(Connection connection)
[THROWS-WHEN] IllegalArgumentException when offset < 0
[PATH1] if(offset < 0)=F -> if(log.isInfoEnabled())=T -> if(log.isDebugEnabled())=T -> return Result.fromXMLElement(root, store)
[PATH2] if(offset < 0)=T -> throw new IllegalArgumentExceptio... | true | ok | {"focal": {"class": "Search", "name": "send", "signature": "Result send(Connection connection) throws DespotifyException", "start_line": 3, "modifiers": "public", "params": [{"name": "connection", "type": "Connection"}], "return_type": "Result"}, "class_info": {"name": "Search", "kind": "class", "modifiers": "", "super... |
283187_21 | class SLF4JBridgeHandler extends Handler {
public static void install() {
LogManager.getLogManager().getLogger("").addHandler(new SLF4JBridgeHandler());
}
public SLF4JBridgeHandler();
private static java.util.logging.Logger getRootLogger();
public static void uninstall();
public stat... | SLF4JBridgeHandler.install();
String resourceBundleName = "org.slf4j.bridge.testLogStrings";
ResourceBundle bundle = ResourceBundle.getBundle(resourceBundleName);
String resourceKey = "resource_key";
String expectedMsg = bundle.getString(resourceKey);
String msg = resour... | [FOCAL] public static void SLF4JBridgeHandler.install()
[CLASS] class SLF4JBridgeHandler extends Handler
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] LogManager.getLogManager().getLogger("").addHandler/1, LogManager.getLogManager().getLogger/1, LogManager.getLogManager/0
[NEW] S... | /* static context
[FOCAL] public static void SLF4JBridgeHandler.install()
[NEW] SLF4JBridgeHandler
[CALLS-EXTERNAL] LogManager.getLogManager().getLogger("").addHandler/1, LogManager.getLogManager().getLogger/1, LogManager.getLogManager/0
*/
| /* static context
[FOCAL] public static void SLF4JBridgeHandler.install()
[NEW] SLF4JBridgeHandler
[CALLS-EXTERNAL] LogManager.getLogManager().getLogger("").addHandler/1, LogManager.getLogManager().getLogger/1, LogManager.getLogManager/0
*/
class SLF4JBridgeHandler extends Handler {
public static void install() {
... | true | ok | {"focal": {"class": "SLF4JBridgeHandler", "name": "install", "signature": "void install()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "void"}, "class_info": {"name": "SLF4JBridgeHandler", "kind": "class", "modifiers": "", "superclass": "Handler", "interfaces": null, "fields": [{"name":... |
283325_37 | class TargetLengthBasedClassNameAbbreviator implements Abbreviator {
public String abbreviate(String fqClassName) {
StringBuilder buf = new StringBuilder(targetLength);
if (fqClassName == null) {
throw new IllegalArgumentException("Class name may not be null");
}
int in... | {
TargetLengthBasedClassNameAbbreviator abbreviator = new TargetLengthBasedClassNameAbbreviator(100);
String name = "hello";
assertEquals(name, abbreviator.abbreviate(name));
}
{
TargetLengthBasedClassNameAbbreviator abbreviator = new TargetLengthB... | [FOCAL] public String TargetLengthBasedClassNameAbbreviator.abbreviate(String fqClassName)
[CLASS] class TargetLengthBasedClassNameAbbreviator implements Abbreviator
[METRICS] loc=38 cc=6 branches=4 loops=1 returns=3 throws=1 nesting=2
[CALLS-INTERNAL] int computeDotIndexes(String className, int[] dotArray); void compu... | /* static context
[FOCAL] public String TargetLengthBasedClassNameAbbreviator.abbreviate(String fqClassName)
[THROWS-WHEN] IllegalArgumentException when fqClassName == null
[PATH1] if(fqClassName == null)=F -> if(inLen < targetLength)=F -> if(dotCount == 0)=F -> for(i <= dotCount)=T -> if(i == 0)=T -> exit loop -> retu... | /* static context
[FOCAL] public String TargetLengthBasedClassNameAbbreviator.abbreviate(String fqClassName)
[THROWS-WHEN] IllegalArgumentException when fqClassName == null
[PATH1] if(fqClassName == null)=F -> if(inLen < targetLength)=F -> if(dotCount == 0)=F -> for(i <= dotCount)=T -> if(i == 0)=T -> exit loop -> retu... | true | ok | {"focal": {"class": "TargetLengthBasedClassNameAbbreviator", "name": "abbreviate", "signature": "String abbreviate(String fqClassName)", "start_line": 3, "modifiers": "public", "params": [{"name": "fqClassName", "type": "String"}], "return_type": "String"}, "class_info": {"name": "TargetLengthBasedClassNameAbbreviator"... |
291242_13 | class MessageConveyor implements IMessageConveyor {
public <E extends Enum<?>> String getMessage(E key, Object... args)
throws MessageConveyorException {
Class<? extends Enum<?>> declaringClass = key.getDeclaringClass();
String declaringClassName = declaringClass.getName();
CAL10NBundle rb = ... |
MessageConveyor mc = new MessageConveyor(Locale.CHINA);
try {
mc.getMessage(Colors.BLUE);
fail("missing exception");
} catch (MessageConveyorException e) {
assertEquals(
"Failed to locate resource bundle [colors] for locale [zh_CN] for enum type [ch.qos.cal10n.sample.Colors]",
... | [FOCAL] public String MessageConveyor.getMessage(E key, Object... args)
[CLASS] class MessageConveyor implements IMessageConveyor
[METRICS] loc=24 cc=4 branches=3 loops=0 returns=3 throws=0 nesting=2
[CALLS-INTERNAL] CAL10NBundle lookupResourceBundleByEnumClassAndLocale(Class<E> declaringClass)
[CALLS-EXTERNAL] E.getDe... | /* static context
[FOCAL] public String MessageConveyor.getMessage(E key, Object... args)
[PATH1] if(rb == null || rb.hasChanged())=T -> if(value == null)=F -> if(args == null || args.length == 0)=T -> return value
[PATH2] if(rb == null || rb.hasChanged())=F -> if(value == null)=T -> return "No key found for " + keyAsS... | /* static context
[FOCAL] public String MessageConveyor.getMessage(E key, Object... args)
[PATH1] if(rb == null || rb.hasChanged())=T -> if(value == null)=F -> if(args == null || args.length == 0)=T -> return value
[PATH2] if(rb == null || rb.hasChanged())=F -> if(value == null)=T -> return "No key found for " + keyAsS... | true | ok | {"focal": {"class": "MessageConveyor", "name": "getMessage", "signature": "String getMessage(E key, Object... args) throws MessageConveyorException", "start_line": 3, "modifiers": "public", "params": [{"name": "key", "type": "E"}, {"name": "args", "type": "Object..."}], "return_type": "String"}, "class_info": {"name": ... |
291570_20 | class AbstractAuthenticator implements Authenticator, LogoutAware {
public final AuthenticationInfo authenticate(AuthenticationToken token) throws AuthenticationException {
if (token == null) {
throw new IllegalArgumentException("Method argument (authentication token) cannot be null.");
... | AuthenticationInfo authcInfo = abstractAuthenticator.authenticate(newToken());
assertNotNull(authcInfo);
}
} | [FOCAL] public final AuthenticationInfo AbstractAuthenticator.authenticate(AuthenticationToken token)
[CLASS] class AbstractAuthenticator implements Authenticator, LogoutAware
[METRICS] loc=51 cc=9 branches=6 loops=0 returns=1 throws=3 nesting=3
[CALLS-INTERNAL] AuthenticationInfo doAuthenticate(AuthenticationToken tok... | /* static context
[FOCAL] public final AuthenticationInfo AbstractAuthenticator.authenticate(AuthenticationToken token)
[THROWS-WHEN] IllegalArgumentException when token == null
[THROWS-WHEN] ae when !(token == null) && try-body throws && t instanceof AuthenticationException && ae == null && log.isWarnEnabled() && try-... | /* static context
[FOCAL] public final AuthenticationInfo AbstractAuthenticator.authenticate(AuthenticationToken token)
[THROWS-WHEN] IllegalArgumentException when token == null
[THROWS-WHEN] ae when !(token == null) && try-body throws && t instanceof AuthenticationException && ae == null && log.isWarnEnabled() && try-... | true | ok | {"focal": {"class": "AbstractAuthenticator", "name": "authenticate", "signature": "AuthenticationInfo authenticate(AuthenticationToken token) throws AuthenticationException", "start_line": 3, "modifiers": "public final", "params": [{"name": "token", "type": "AuthenticationToken"}], "return_type": "AuthenticationInfo"},... |
293812_0 | class PrettyFormatter implements Reporter, Formatter {
@Override
public void close() {
out.close();
}
public PrettyFormatter(Appendable out, boolean monochrome, boolean executing);
public void setMonochrome(boolean monochrome);
@Override public void uri(String uri);
@Override pub... | PrintStream out = mock(PrintStream.class);
Formatter formatter = new PrettyFormatter(out, true, true);
formatter.close();
verify(out).flush();
verify(out).close();
}
} | [FOCAL] @Override public void PrettyFormatter.close()
[CLASS] class PrettyFormatter implements Reporter, Formatter
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] out.close/0
[COLLABORATORS] field out close/0
[CLASS-MEMBERS] PrettyFormatter(Appendable out, boolean monochrome, boole... | /* static context
[FOCAL] @Override public void PrettyFormatter.close()
[COLLABORATORS] field out close/0
[CALLS-EXTERNAL] out.close/0
*/
| /* static context
[FOCAL] @Override public void PrettyFormatter.close()
[COLLABORATORS] field out close/0
[CALLS-EXTERNAL] out.close/0
*/
class PrettyFormatter implements Reporter, Formatter {
@Override
public void close() {
out.close();
}
public PrettyFormatter(Appendable out, boolean monoch... | true | ok | {"focal": {"class": "PrettyFormatter", "name": "close", "signature": "void close()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "PrettyFormatter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Reporter, Formatter", "fields": [{"n... |
298328_9 | class AnsiRenderer {
public static String render(final String input) throws IllegalArgumentException {
try {
return render(input, new StringBuilder(input.length())).toString();
} catch (IOException e) {
// Cannot happen because StringBuilder does not throw IOException
... | // Check the ansi() render method.
String str = ansi().render("@|bold Hello|@").toString();
System.out.println(str);
assertEquals(ansi().a(INTENSITY_BOLD).a("Hello").reset().toString(), str);
}
} | [FOCAL] public static String AnsiRenderer.render(String input)
[CLASS] class AnsiRenderer
[METRICS] loc=8 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-INTERNAL] Appendable render(String input, Appendable target)
[CALLS-EXTERNAL] render(input, new StringBuilder(input.length())).toString/0, String.length/0... | /* static context
[FOCAL] public static String AnsiRenderer.render(String input)
[THROWS-WHEN] IllegalArgumentException when try-body throws
[PATH1] try-body throws -> throw new IllegalArgumentException(e)
[PATH2] return render(input, new StringBuilder(input.length())).toString()
[INPUTS] branches=- | result=input
[EXC... | /* static context
[FOCAL] public static String AnsiRenderer.render(String input)
[THROWS-WHEN] IllegalArgumentException when try-body throws
[PATH1] try-body throws -> throw new IllegalArgumentException(e)
[PATH2] return render(input, new StringBuilder(input.length())).toString()
[INPUTS] branches=- | result=input
[EXC... | true | ok | {"focal": {"class": "AnsiRenderer", "name": "render", "signature": "String render(String input) throws IllegalArgumentException", "start_line": 3, "modifiers": "public static", "params": [{"name": "input", "type": "String"}], "return_type": "String"}, "class_info": {"name": "AnsiRenderer", "kind": "class", "modifiers":... |
315033_36 | class TransactionalInterceptor implements MethodInterceptor {
public Object invoke(MethodInvocation invocation) throws Throwable {
final Method method = invocation.getMethod();
if(method == null) {
return null;
}
Transactional txa = method.getAnnotation(Transactional.class);
if (txa == null... | final MethodInvocation invocation = mockery.mock(MethodInvocation.class);
mockery.checking(new Expectations() {
{
Sequence seq = mockery.sequence("newTx");
exactly(1).of(invocation).getMethod();
will(returnValue(propagtedIsolatedTransaction));
inSequence(seq);
exac... | [FOCAL] public Object TransactionalInterceptor.invoke(MethodInvocation invocation)
[CLASS] class TransactionalInterceptor implements MethodInterceptor
[METRICS] loc=32 cc=7 branches=5 loops=0 returns=3 throws=1 nesting=2
[CALLS-EXTERNAL] MethodInvocation.getMethod/0, Method.getAnnotation/1, MethodInvocation.proceed/0, ... | /* static context
[FOCAL] public Object TransactionalInterceptor.invoke(MethodInvocation invocation)
[THROWS-WHEN] ex when !(method == null) && !(txa == null) && tx == null || !txa.propagationRequired() && try-body throws && transactionStarted
[THROWS-WHEN] ex when !(method == null) && !(txa == null) && tx == null || !... | /* static context
[FOCAL] public Object TransactionalInterceptor.invoke(MethodInvocation invocation)
[THROWS-WHEN] ex when !(method == null) && !(txa == null) && tx == null || !txa.propagationRequired() && try-body throws && transactionStarted
[THROWS-WHEN] ex when !(method == null) && !(txa == null) && tx == null || !... | true | ok | {"focal": {"class": "TransactionalInterceptor", "name": "invoke", "signature": "Object invoke(MethodInvocation invocation) throws Throwable", "start_line": 3, "modifiers": "public", "params": [{"name": "invocation", "type": "MethodInvocation"}], "return_type": "Object"}, "class_info": {"name": "TransactionalInterceptor... |
320367_0 | class Hello {
public static int times(int x, int y)
{
return new HelloWorldJNI().timesHello(x, y);
}
}
class HelloTest {
@Test public final void testTimes()
{
| Assert.assertEquals(42, Hello.times(3, 14));
}
} | [FOCAL] public static int Hello.times(int x, int y)
[CLASS] class Hello
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] new HelloWorldJNI().timesHello/2
[NEW] HelloWorldJNI
[INPUTS] branches=- | result=x, y
[DATAFLOW] x@param->L3; y@param->L3
[TEST] HelloTest: @Test public final vo... | /* static context
[FOCAL] public static int Hello.times(int x, int y)
[INPUTS] branches=- | result=x, y
[NEW] HelloWorldJNI
[CALLS-EXTERNAL] new HelloWorldJNI().timesHello/2
*/
| /* static context
[FOCAL] public static int Hello.times(int x, int y)
[INPUTS] branches=- | result=x, y
[NEW] HelloWorldJNI
[CALLS-EXTERNAL] new HelloWorldJNI().timesHello/2
*/
class Hello {
public static int times(int x, int y)
{
return new HelloWorldJNI().timesHello(x, y);
}
}
class HelloTest {... | true | ok | {"focal": {"class": "Hello", "name": "times", "signature": "int times(int x, int y)", "start_line": 3, "modifiers": "public static", "params": [{"name": "x", "type": "int"}, {"name": "y", "type": "int"}], "return_type": "int"}, "class_info": {"name": "Hello", "kind": "class", "modifiers": "", "superclass": null, "inter... |
320690_7 | class ReflectionSourcePropertyFactory implements SourcePropertyFactory {
@Override
public SourceProperty getSourceProperty( String expression ) {
if ( isIdentifier( expression ) ) {
return new ReflectionSourceProperty( expression );
} else {
return null;
}
}
public ReflectionSourcePropertyFactory();
... | assertNull( factory.getSourceProperty( "23skidoo" ) );
}
} | [FOCAL] @Override public SourceProperty ReflectionSourcePropertyFactory.getSourceProperty(String expression)
[CLASS] class ReflectionSourcePropertyFactory implements SourcePropertyFactory
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] boolean isIdentifier(String expression)
[NEW] ... | /* static context
[FOCAL] @Override public SourceProperty ReflectionSourcePropertyFactory.getSourceProperty(String expression)
[PATH1] if(isIdentifier( expression ))=T -> return new ReflectionSourceProperty( expression )
[PATH2] if(isIdentifier( expression ))=F -> return null
[INPUTS] branches=expression | result=expre... | /* static context
[FOCAL] @Override public SourceProperty ReflectionSourcePropertyFactory.getSourceProperty(String expression)
[PATH1] if(isIdentifier( expression ))=T -> return new ReflectionSourceProperty( expression )
[PATH2] if(isIdentifier( expression ))=F -> return null
[INPUTS] branches=expression | result=expre... | true | ok | {"focal": {"class": "ReflectionSourcePropertyFactory", "name": "getSourceProperty", "signature": "SourceProperty getSourceProperty(String expression)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "expression", "type": "String"}], "return_type": "SourceProperty"}, "class_info": {"name": "Reflec... |
324985_0 | class MistletoeCore {
public boolean hasAssociatedFailures(Description d) {
List<Failure> failureList = result.getFailures();
for (Failure f : failureList) {
if (f.getDescription().equals(d)) {
return true;
}
if (description.isTest()) {
return false;
}
List<Desc... | MistletoeCore mCore = new MistletoeCore(MyCollection.class);
mCore.run();
Description description = mCore.getDescription();
assertTrue(mCore.hasAssociatedFailures(description));
Map<Description, Boolean> map = new HashMap<Description, Boolean>();
doCheck(map, mCore, description);
f... | [FOCAL] public boolean MistletoeCore.hasAssociatedFailures(Description d)
[CLASS] class MistletoeCore
[METRICS] loc=19 cc=6 branches=3 loops=2 returns=4 throws=0 nesting=3
[CALLS-EXTERNAL] result.getFailures/0, f.getDescription().equals/1, Failure.getDescription/0, description.isTest/0, Description.getChildren/0, hasAs... | /* static context
[FOCAL] public boolean MistletoeCore.hasAssociatedFailures(Description d)
[PATH1] foreach(Failure f : failureList)=T -> if(f.getDescription().equals(d))=F -> if(description.isTest())=F -> foreach(Description child : descriptionList)=T -> if(hasAssociatedFailures(child))=F -> exit loop -> exit loop -> ... | /* static context
[FOCAL] public boolean MistletoeCore.hasAssociatedFailures(Description d)
[PATH1] foreach(Failure f : failureList)=T -> if(f.getDescription().equals(d))=F -> if(description.isTest())=F -> foreach(Description child : descriptionList)=T -> if(hasAssociatedFailures(child))=F -> exit loop -> exit loop -> ... | true | ok | {"focal": {"class": "MistletoeCore", "name": "hasAssociatedFailures", "signature": "boolean hasAssociatedFailures(Description d)", "start_line": 3, "modifiers": "public", "params": [{"name": "d", "type": "Description"}], "return_type": "boolean"}, "class_info": {"name": "MistletoeCore", "kind": "class", "modifiers": ""... |
327391_1 | class ArrayBuilder {
@SuppressWarnings({"unchecked"})
public ArrayBuilder<T> add(T... elements) {
if (elements == null) return this;
if (array == null) {
array = elements;
return this;
}
T[] newArray = (T[]) Array.newInstance(array.getClass().getComponent... | assertEquals(new ArrayBuilder<Integer>().add(1, 2).add(3).add(4, 5, 6).get(), new Integer[] {1, 2, 3, 4, 5, 6});
assertEquals(new ArrayBuilder<Integer>().add(1, 2).addNonNulls(3, null, 4, null).get(), new Integer[] {1, 2, 3, 4});
}
} | [FOCAL] @SuppressWarnings({"unchecked"}) public ArrayBuilder<T> ArrayBuilder.add(T... elements)
[CLASS] class ArrayBuilder
[METRICS] loc=13 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[CALLS-EXTERNAL] Array.newInstance/2, array.getClass().getComponentType/0, array.getClass/0, System.arraycopy/5
[PATH1] if(elem... | /* static context
[FOCAL] @SuppressWarnings({"unchecked"}) public ArrayBuilder<T> ArrayBuilder.add(T... elements)
[PATH1] if(elements == null)=F -> if(array == null)=T -> return this
[PATH2] if(elements == null)=T -> return this
[PATH3] if(elements == null)=F -> if(array == null)=F -> return this
[INPUTS] branches=elem... | /* static context
[FOCAL] @SuppressWarnings({"unchecked"}) public ArrayBuilder<T> ArrayBuilder.add(T... elements)
[PATH1] if(elements == null)=F -> if(array == null)=T -> return this
[PATH2] if(elements == null)=T -> return this
[PATH3] if(elements == null)=F -> if(array == null)=F -> return this
[INPUTS] branches=elem... | true | ok | {"focal": {"class": "ArrayBuilder", "name": "add", "signature": "ArrayBuilder<T> add(T... elements)", "start_line": 3, "modifiers": "@SuppressWarnings({\"unchecked\"}) public", "params": [{"name": "elements", "type": "T..."}], "return_type": "ArrayBuilder<T>"}, "class_info": {"name": "ArrayBuilder", "kind": "class", "m... |
327472_155 | class SaveQueryCommand implements DynamicCommand {
@Override
public boolean accept(final ConsoleState state) {
Assertions.checkNotNull("state", state);
if (state.getActiveCommand() == null && state.getInput().trim().startsWith("save ")) { return true; }
return false;
}
@Overrid... | final ConsoleState state = new ConsoleState(null);
state.setInput("add save");
assertThat(command.accept(state), is(false));
}
} | [FOCAL] @Override public boolean SaveQueryCommand.accept(ConsoleState state)
[CLASS] class SaveQueryCommand implements DynamicCommand
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] Assertions.checkNotNull/2, ConsoleState.getActiveCommand/0, state.getInput().trim().startsWith/1, st... | /* static context
[FOCAL] @Override public boolean SaveQueryCommand.accept(ConsoleState state)
[PATH1] if(state.getActiveCommand() == null && state.getInput().trim().startsWith("save "))=T -> return true
[PATH2] if(state.getActiveCommand() == null && state.getInput().trim().startsWith("save "))=F -> return false
[INPUT... | /* static context
[FOCAL] @Override public boolean SaveQueryCommand.accept(ConsoleState state)
[PATH1] if(state.getActiveCommand() == null && state.getInput().trim().startsWith("save "))=T -> return true
[PATH2] if(state.getActiveCommand() == null && state.getInput().trim().startsWith("save "))=F -> return false
[INPUT... | true | ok | {"focal": {"class": "SaveQueryCommand", "name": "accept", "signature": "boolean accept(ConsoleState state)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "state", "type": "ConsoleState"}], "return_type": "boolean"}, "class_info": {"name": "SaveQueryCommand", "kind": "class", "modifiers": "", "s... |
331792_7 | class NodePath extends ComponentSupport {
@Nullable
public NodePath parent() {
int i = path.lastIndexOf(Node.SEPARATOR);
if (i == 0) {
return this;
}
else if (i == -1) {
return null;
}
else {
return new NodePath(path.substring(0, i));
}
}
public NodePath(final St... | assertNull(new NodePath("foo").parent());
}
} | [FOCAL] @Nullable public NodePath NodePath.parent()
[CLASS] class NodePath extends ComponentSupport
[METRICS] loc=13 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=2
[CALLS-EXTERNAL] path.lastIndexOf/1, path.substring/2
[NEW] NodePath
[PATH1] if(i == 0)=F -> if(i == -1)=T -> return null
[PATH2] if(i == 0)=T -> retu... | /* static context
[FOCAL] @Nullable public NodePath NodePath.parent()
[PATH1] if(i == 0)=F -> if(i == -1)=T -> return null
[PATH2] if(i == 0)=T -> return this
[PATH3] if(i == 0)=F -> if(i == -1)=F -> return new NodePath(path.substring(0, i))
[COLLABORATORS] field path lastIndexOf/1,substring/2
[NEW] NodePath
[CALLS-EXT... | /* static context
[FOCAL] @Nullable public NodePath NodePath.parent()
[PATH1] if(i == 0)=F -> if(i == -1)=T -> return null
[PATH2] if(i == 0)=T -> return this
[PATH3] if(i == 0)=F -> if(i == -1)=F -> return new NodePath(path.substring(0, i))
[COLLABORATORS] field path lastIndexOf/1,substring/2
[NEW] NodePath
[CALLS-EXT... | true | ok | {"focal": {"class": "NodePath", "name": "parent", "signature": "NodePath parent()", "start_line": 3, "modifiers": "@Nullable public", "params": [], "return_type": "NodePath"}, "class_info": {"name": "NodePath", "kind": "class", "modifiers": "", "superclass": "ComponentSupport", "interfaces": null, "fields": [], "member... |
335218_30 | class SatzFactory {
public static Satz getSatz(final int satzart) {
return getSatz(new SatzTyp(satzart));
}
private SatzFactory();
private static void registerDefault();
public static void reset();
public static void register(final Class<? extends Satz> clazz, final int satzart);
... | Teildatensatz one = SatzFactory.getSatz(100).getTeildatensatz(4);
Teildatensatz two = SatzFactory.getSatz(100).getTeildatensatz(4);
assertNotSame(one, two);
Feld oneIban = one.getFeld(Bezeichner.IBAN1);
Feld twoIban = two.getFeld(Bezeichner.IBAN1);
assertNotSame(oneIban, ... | [FOCAL] public static Satz SatzFactory.getSatz(int satzart)
[CLASS] class SatzFactory
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Satz getSatz(SatzTyp satztyp)
[NEW] SatzTyp
[INPUTS] branches=- | result=satzart
[DATAFLOW] satzart@param->L2
[CLASS-MEMBERS] SatzFactory(); void re... | /* static context
[FOCAL] public static Satz SatzFactory.getSatz(int satzart)
[INPUTS] branches=- | result=satzart
[CALLS-INTERNAL] Satz getSatz(SatzTyp satztyp)
[NEW] SatzTyp
*/
| /* static context
[FOCAL] public static Satz SatzFactory.getSatz(int satzart)
[INPUTS] branches=- | result=satzart
[CALLS-INTERNAL] Satz getSatz(SatzTyp satztyp)
[NEW] SatzTyp
*/
class SatzFactory {
public static Satz getSatz(final int satzart) {
return getSatz(new SatzTyp(satzart));
}
private Sa... | true | ok | {"focal": {"class": "SatzFactory", "name": "getSatz", "signature": "Satz getSatz(int satzart)", "start_line": 3, "modifiers": "public static", "params": [{"name": "satzart", "type": "int"}], "return_type": "Satz"}, "class_info": {"name": "SatzFactory", "kind": "class", "modifiers": "", "superclass": null, "interfaces":... |
336330_27 | class MatrixView extends AbstractMatrix {
@Override
public Matrix viewPart(int[] offset, int[] size) {
if (offset[ROW] < ROW) {
throw new IndexException(offset[ROW], ROW);
}
if (offset[ROW] + size[ROW] > rowSize()) {
throw new IndexException(offset[ROW] + size[ROW], rowSize());
}
if... | int[] offset = {1, 1};
int[] size = {2, 1};
Matrix view = test.viewPart(offset, size);
int[] c = view.size();
for (int row = 0; row < c[ROW]; row++) {
for (int col = 0; col < c[COL]; col++) {
assertEquals("value[" + row + "][" + col + ']',
values[row + 2][col + 2], view.get... | [FOCAL] @Override public Matrix MatrixView.viewPart(int[] offset, int[] size)
[CLASS] class MatrixView extends AbstractMatrix
[METRICS] loc=19 cc=5 branches=4 loops=0 returns=1 throws=4 nesting=1
[CALLS-EXTERNAL] rowSize/0 (inherited), columnSize/0 (inherited), int[].clone/0
[NEW] IndexException, MatrixView
[FIELDS] re... | /* static context
[FOCAL] @Override public Matrix MatrixView.viewPart(int[] offset, int[] size)
[THROWS-WHEN] IndexException when offset[ROW] < ROW
[THROWS-WHEN] IndexException when !(offset[ROW] < ROW) && offset[ROW] + size[ROW] > rowSize()
[THROWS-WHEN] IndexException when !(offset[ROW] < ROW) && !(offset[ROW] + size... | /* static context
[FOCAL] @Override public Matrix MatrixView.viewPart(int[] offset, int[] size)
[THROWS-WHEN] IndexException when offset[ROW] < ROW
[THROWS-WHEN] IndexException when !(offset[ROW] < ROW) && offset[ROW] + size[ROW] > rowSize()
[THROWS-WHEN] IndexException when !(offset[ROW] < ROW) && !(offset[ROW] + size... | true | ok | {"focal": {"class": "MatrixView", "name": "viewPart", "signature": "Matrix viewPart(int[] offset, int[] size)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "offset", "type": "int[]"}, {"name": "size", "type": "int[]"}], "return_type": "Matrix"}, "class_info": {"name": "MatrixView", "kind": "cl... |
338815_32 | class HistoryDialogModel {
protected boolean isCurrentRevisionSelected() {
return myRightRevisionIndex == 0;
}
public HistoryDialogModel(IdeaGateway gw, LocalVcs vcs, VirtualFile f);
public List<Revision> getRevisions();
private void initRevisionsCache();
protected List<Revision> getRevisionsCache()... | m.selectRevisions(1, 2);
assertFalse(m.isCurrentRevisionSelected());
m.selectRevisions(2, 2);
assertTrue(m.isCurrentRevisionSelected());
m.selectRevisions(-1, -1);
assertTrue(m.isCurrentRevisionSelected());
}
} | [FOCAL] protected boolean HistoryDialogModel.isCurrentRevisionSelected()
[CLASS] class HistoryDialogModel
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] HistoryDialogModel(IdeaGateway gw, LocalVcs vcs, VirtualFile f); List<Revision> getRevisions(); void initRevisionsCache(); List<R... | /* static context
[FOCAL] protected boolean HistoryDialogModel.isCurrentRevisionSelected()
*/
| /* static context
[FOCAL] protected boolean HistoryDialogModel.isCurrentRevisionSelected()
*/
class HistoryDialogModel {
protected boolean isCurrentRevisionSelected() {
return myRightRevisionIndex == 0;
}
public HistoryDialogModel(IdeaGateway gw, LocalVcs vcs, VirtualFile f);
public List<Revision> getRe... | true | ok | {"focal": {"class": "HistoryDialogModel", "name": "isCurrentRevisionSelected", "signature": "boolean isCurrentRevisionSelected()", "start_line": 3, "modifiers": "protected", "params": [], "return_type": "boolean"}, "class_info": {"name": "HistoryDialogModel", "kind": "class", "modifiers": "", "superclass": null, "inter... |
339284_3 | class SystemPropertySource extends SourceSupport {
public Model load() throws Exception {
if (name == null) {
throw new MissingPropertyException("name");
}
String value = System.getProperty(name);
if (value == null) {
log.trace("Unable to load; property not set: {}", name);
return... | try {
SystemPropertySource s = new SystemPropertySource();
s.load();
fail();
}
catch (ConfigurationException expected) {
}
}
} | [FOCAL] public Model SystemPropertySource.load()
[CLASS] class SystemPropertySource extends SourceSupport
[METRICS] loc=30 cc=6 branches=4 loops=0 returns=2 throws=2 nesting=2
[CALLS-EXTERNAL] System.getProperty/1, log.trace/2, File.exists/0, file.toURI().toURL/0, File.toURI/0, load/1 (inherited)
[NEW] MissingPropertyE... | /* static context
[FOCAL] public Model SystemPropertySource.load()
[THROWS-WHEN] MissingPropertyException when name == null
[THROWS-WHEN] ConfigurationException when !(name == null) && !(value == null) && try-body throws && file.exists() && url == null
[THROWS-WHEN] ConfigurationException when !(name == null) && !(valu... | /* static context
[FOCAL] public Model SystemPropertySource.load()
[THROWS-WHEN] MissingPropertyException when name == null
[THROWS-WHEN] ConfigurationException when !(name == null) && !(value == null) && try-body throws && file.exists() && url == null
[THROWS-WHEN] ConfigurationException when !(name == null) && !(valu... | true | ok | {"focal": {"class": "SystemPropertySource", "name": "load", "signature": "Model load() throws Exception", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Model"}, "class_info": {"name": "SystemPropertySource", "kind": "class", "modifiers": "", "superclass": "SourceSupport", "interfaces": null, "fi... |
339856_0 | class FlightToTripNotificationsSplitter {
@Splitter
public List<TripNotification> generateTripNotificationsFrom(FlightNotification flightNotification,
@Header("affectedTrips") List<Trip> affectedTrips) {
List<TripNotification> notifications = new ArrayList<TripNotification>(affectedTrips.size()... | FlightNotification flightNotification = new FlightNotification("Flight is cancelled", mock(Flight.class));
List<Trip> affectedTrips = new ArrayList<Trip>(5);
affectedTrips.add(new Trip(Collections.singletonList(mock(Leg.class))));
List<TripNotification> notifications = splitter.generateT... | [FOCAL] @Splitter public List<TripNotification> FlightToTripNotificationsSplitter.generateTripNotificationsFrom(FlightNotification flightNotification, List<Trip> affectedTrips)
[CLASS] class FlightToTripNotificationsSplitter
[METRICS] loc=9 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] List<Trip... | /* static context
[FOCAL] @Splitter public List<TripNotification> FlightToTripNotificationsSplitter.generateTripNotificationsFrom(FlightNotification flightNotification, List<Trip> affectedTrips)
[PATH1] foreach(Trip trip : affectedTrips)=T -> exit loop -> return notifications
[PATH2] foreach(Trip trip : affectedTrips)=... | /* static context
[FOCAL] @Splitter public List<TripNotification> FlightToTripNotificationsSplitter.generateTripNotificationsFrom(FlightNotification flightNotification, List<Trip> affectedTrips)
[PATH1] foreach(Trip trip : affectedTrips)=T -> exit loop -> return notifications
[PATH2] foreach(Trip trip : affectedTrips)=... | true | ok | {"focal": {"class": "FlightToTripNotificationsSplitter", "name": "generateTripNotificationsFrom", "signature": "List<TripNotification> generateTripNotificationsFrom(FlightNotification flightNotification, List<Trip> affectedTrips)", "start_line": 3, "modifiers": "@Splitter public", "params": [{"name": "flightNotificatio... |
357827_0 | class TiTATimeConverter {
public static Long getString2Duration(String time) throws ParseException {
String[] timeArray = time.split(":");
if (timeArray.length != C_THREE) {
throw new ParseException("", 0);
}
try {
long millis;
millis = Integer.pa... | // CHECKSTYLE:OFF
GregorianCalendar c1 = new GregorianCalendar();
GregorianCalendar c2 = new GregorianCalendar();
c1.set(2009, GregorianCalendar.JANUARY, 10, 10, 23, 15);
c2.set(2009, GregorianCalendar.JANUARY, 10, 0, 0, 0);
Long l = c1.getTimeInMillis() - c2.getTimeInMi... | [FOCAL] public static Long TiTATimeConverter.getString2Duration(String time)
[CLASS] class TiTATimeConverter
[METRICS] loc=16 cc=3 branches=1 loops=0 returns=1 throws=2 nesting=1
[CALLS-EXTERNAL] String.split/1, Integer.parseInt/1
[NEW] ParseException
[EXCEPTIONS] declares ParseException; throws ParseException; catches... | /* static context
[FOCAL] public static Long TiTATimeConverter.getString2Duration(String time)
[THROWS-WHEN] ParseException when timeArray.length != C_THREE
[THROWS-WHEN] ParseException when !(timeArray.length != C_THREE) && try-body throws
[PATH1] if(timeArray.length != C_THREE)=F -> try-body throws -> throw new Parse... | /* static context
[FOCAL] public static Long TiTATimeConverter.getString2Duration(String time)
[THROWS-WHEN] ParseException when timeArray.length != C_THREE
[THROWS-WHEN] ParseException when !(timeArray.length != C_THREE) && try-body throws
[PATH1] if(timeArray.length != C_THREE)=F -> try-body throws -> throw new Parse... | true | ok | {"focal": {"class": "TiTATimeConverter", "name": "getString2Duration", "signature": "Long getString2Duration(String time) throws ParseException", "start_line": 3, "modifiers": "public static", "params": [{"name": "time", "type": "String"}], "return_type": "Long"}, "class_info": {"name": "TiTATimeConverter", "kind": "cl... |
358370_14 | class JulImportCallable extends AbstractProgressingCallable<Long> {
@Override
@SuppressWarnings({"PMD.AvoidInstantiatingObjectsInLoops", "PMD.CloseResource"})
public Long call()
throws Exception
{
if(!inputFile.isFile())
{
throw new IllegalArgumentException("'" + inputFile.getAbsolutePath() + "' is not a ... | createTempFile("/testcases/log.xml");
AppendOpStub buffer = new AppendOpStub();
JulImportCallable instance = new JulImportCallable(inputFile, buffer);
long result = instance.call();
if(logger.isInfoEnabled()) logger.info("Call returned {}.", result);
if(logger.isDebugEnabled()) logger.debug("Appended events... | [FOCAL] @Override @SuppressWarnings({"PMD.AvoidInstantiatingObjectsInLoops", "PMD.CloseResource"}) public Long JulImportCallable.call()
[CLASS] class JulImportCallable extends AbstractProgressingCallable<Long>
[METRICS] loc=56 cc=7 branches=5 loops=1 returns=1 throws=2 nesting=3
[CALLS-EXTERNAL] File.isFile/0, File.get... | /* static context
[FOCAL] @Override @SuppressWarnings({"PMD.AvoidInstantiatingObjectsInLoops", "PMD.CloseResource"}) public Long JulImportCallable.call()
[THROWS-WHEN] IllegalArgumentException when !inputFile.isFile()
[THROWS-WHEN] IllegalArgumentException when inputFile.isFile() && !inputFile.canRead()
[PATH1] if(!inp... | /* static context
[FOCAL] @Override @SuppressWarnings({"PMD.AvoidInstantiatingObjectsInLoops", "PMD.CloseResource"}) public Long JulImportCallable.call()
[THROWS-WHEN] IllegalArgumentException when !inputFile.isFile()
[THROWS-WHEN] IllegalArgumentException when inputFile.isFile() && !inputFile.canRead()
[PATH1] if(!inp... | true | ok | {"focal": {"class": "JulImportCallable", "name": "call", "signature": "Long call() throws Exception", "start_line": 3, "modifiers": "@Override @SuppressWarnings({\"PMD.AvoidInstantiatingObjectsInLoops\", \"PMD.CloseResource\"}) public", "params": [], "return_type": "Long"}, "class_info": {"name": "JulImportCallable", "... |
363849_3 | class OAuth {
public static HttpParameters decodeForm(String form) {
HttpParameters params = new HttpParameters();
if (isEmpty(form)) {
return params;
}
for (String nvp : form.split("\\&")) {
int equals = nvp.indexOf('=');
String name;
... | HttpParameters params = OAuth.decodeForm("one=" + reservedCharactersEncoded
+ "&" + "one=another&"
+ reservedCharactersEncoded + "=" + rfc3986UnreservedCharacters);
assertTrue(params.size() == 3);
Iterator<String> iter1 = params.get("one").iterator();
as... | [FOCAL] public static HttpParameters OAuth.decodeForm(String form)
[CLASS] class OAuth
[METRICS] loc=21 cc=4 branches=2 loops=1 returns=2 throws=0 nesting=2
[CALLS-INTERNAL] String percentDecode(String s); boolean isEmpty(String str)
[CALLS-EXTERNAL] String.split/1, String.indexOf/1, String.substring/2, String.substrin... | /* static context
[FOCAL] public static HttpParameters OAuth.decodeForm(String form)
[PATH1] if(isEmpty(form))=F -> foreach(String nvp : form.split("\\&"))=T -> if(equals < 0)=T -> exit loop -> return params
[PATH2] if(isEmpty(form))=T -> return params
[PATH3] if(isEmpty(form))=F -> foreach(String nvp : form.split("\\&... | /* static context
[FOCAL] public static HttpParameters OAuth.decodeForm(String form)
[PATH1] if(isEmpty(form))=F -> foreach(String nvp : form.split("\\&"))=T -> if(equals < 0)=T -> exit loop -> return params
[PATH2] if(isEmpty(form))=T -> return params
[PATH3] if(isEmpty(form))=F -> foreach(String nvp : form.split("\\&... | true | ok | {"focal": {"class": "OAuth", "name": "decodeForm", "signature": "HttpParameters decodeForm(String form)", "start_line": 3, "modifiers": "public static", "params": [{"name": "form", "type": "String"}], "return_type": "HttpParameters"}, "class_info": {"name": "OAuth", "kind": "class", "modifiers": "", "superclass": null,... |
369176_0 | class ApacheResponse implements Response {
public URI getLocation() {
try {
String location = getHeaders().getFirst("Location");
if(location == null || location.equals(""))
return getRequest().getURI();
else
return new URI(location);
} catch (URISyntaxException e) {
throw new RestfulieExceptio... | URI origin = new URI("http://default.com");
when(request.getURI()).thenReturn(origin);
assertEquals( origin, response.getLocation() );
}
} | [FOCAL] public URI ApacheResponse.getLocation()
[CLASS] class ApacheResponse implements Response
[METRICS] loc=11 cc=3 branches=1 loops=0 returns=2 throws=1 nesting=2
[CALLS-INTERNAL] Headers getHeaders(); Request getRequest()
[CALLS-EXTERNAL] getHeaders().getFirst/1, String.equals/1, getRequest().getURI/0
[NEW] URI, R... | /* static context
[FOCAL] public URI ApacheResponse.getLocation()
[THROWS-WHEN] RestfulieException when try-body throws
[PATH1] try-body throws -> throw new RestfulieException("Invalid URI received as a response", e)
[PATH2] if(location == null || location.equals(""))=T -> return getRequest().getURI()
[PATH3] if(locati... | /* static context
[FOCAL] public URI ApacheResponse.getLocation()
[THROWS-WHEN] RestfulieException when try-body throws
[PATH1] try-body throws -> throw new RestfulieException("Invalid URI received as a response", e)
[PATH2] if(location == null || location.equals(""))=T -> return getRequest().getURI()
[PATH3] if(locati... | true | ok | {"focal": {"class": "ApacheResponse", "name": "getLocation", "signature": "URI getLocation()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "URI"}, "class_info": {"name": "ApacheResponse", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Response", "fields": [{"name": "respon... |
376975_19 | class CollectionUtil {
public static boolean isEmpty(Collection<?> collection) {
return collection == null || collection.isEmpty();
}
public static Enumeration<T> createEnumerationFromIterator(Iterator<T> it);
public static T first(List<T> list);
}
class CollectionUtilTest {
@Test
public void testIsEmpty_n... | Assert.assertTrue(CollectionUtil.isEmpty(null));
}
} | [FOCAL] public static boolean CollectionUtil.isEmpty(Collection<?> collection)
[CLASS] class CollectionUtil
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Collection<?>.isEmpty/0
[INPUTS] branches=- | result=collection
[COLLABORATORS] param collection:Collection<?> isEmpty/0
[DATA... | /* static context
[FOCAL] public static boolean CollectionUtil.isEmpty(Collection<?> collection)
[INPUTS] branches=- | result=collection
[COLLABORATORS] param collection:Collection<?> isEmpty/0
[CALLS-EXTERNAL] Collection<?>.isEmpty/0
*/
| /* static context
[FOCAL] public static boolean CollectionUtil.isEmpty(Collection<?> collection)
[INPUTS] branches=- | result=collection
[COLLABORATORS] param collection:Collection<?> isEmpty/0
[CALLS-EXTERNAL] Collection<?>.isEmpty/0
*/
class CollectionUtil {
public static boolean isEmpty(Collection<?> collection) {... | true | ok | {"focal": {"class": "CollectionUtil", "name": "isEmpty", "signature": "boolean isEmpty(Collection<?> collection)", "start_line": 3, "modifiers": "public static", "params": [{"name": "collection", "type": "Collection<?>"}], "return_type": "boolean"}, "class_info": {"name": "CollectionUtil", "kind": "class", "modifiers":... |
403568_5 | class Union extends GeoAggregateFunction {
@Override
protected void add(Geometry geometry) {
if (result == null) {
result = geometry;
} else {
if (geometry != null) {
result = result.union(geometry);
}
}
}
@Override protected ... | union.add(createPoint(3, 5));
union.add(createPoint(5, 3));
Object result = union.getResult();
assertThat(result, is(not(nullValue())));
Geometry geomResult = GeoDB.gFromWKB((byte[]) result);
assertThat(geomResult.getArea(), is(0.0));
assertTrue(geomResult.contai... | [FOCAL] @Override protected void Union.add(Geometry geometry)
[CLASS] class Union extends GeoAggregateFunction
[METRICS] loc=10 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=2
[CALLS-EXTERNAL] result.union/1
[PATH1] if(result == null)=F -> if(geometry != null)=T
[PATH2] if(result == null)=T
[PATH3] if(result == nu... | /* static context
[FOCAL] @Override protected void Union.add(Geometry geometry)
[PATH1] if(result == null)=F -> if(geometry != null)=T
[PATH2] if(result == null)=T
[PATH3] if(result == null)=F -> if(geometry != null)=F
[INPUTS] branches=geometry | result=-
[COLLABORATORS] field result union/1
[CALLS-EXTERNAL] result.un... | /* static context
[FOCAL] @Override protected void Union.add(Geometry geometry)
[PATH1] if(result == null)=F -> if(geometry != null)=T
[PATH2] if(result == null)=T
[PATH3] if(result == null)=F -> if(geometry != null)=F
[INPUTS] branches=geometry | result=-
[COLLABORATORS] field result union/1
[CALLS-EXTERNAL] result.un... | true | ok | {"focal": {"class": "Union", "name": "add", "signature": "void add(Geometry geometry)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "geometry", "type": "Geometry"}], "return_type": "void"}, "class_info": {"name": "Union", "kind": "class", "modifiers": "", "superclass": "GeoAggregateFunction... |
446195_3 | class RangeFunctions {
public static boolean isBetween(long reading, long floor, long ceiling) {
return reading < ceiling && reading > floor;
}
public static boolean isAbove(long reading, long value);
public static boolean isBelow(long reading, long value);
}
class RangeFunctionsTest {
@Test
public void te... | assertThat(RangeFunctions.isBetween(2,1,3), is(true));
assertThat(RangeFunctions.isBetween(1,1,3), is(false));
assertThat(RangeFunctions.isBetween(3,1,3), is(false));
}
} | [FOCAL] public static boolean RangeFunctions.isBetween(long reading, long floor, long ceiling)
[CLASS] class RangeFunctions
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[INPUTS] branches=- | result=ceiling, floor, reading
[DATAFLOW] ceiling@param->L2; floor@param->L2; reading@param->L2
[CLASS-ME... | /* static context
[FOCAL] public static boolean RangeFunctions.isBetween(long reading, long floor, long ceiling)
[INPUTS] branches=- | result=ceiling, floor, reading
*/
| /* static context
[FOCAL] public static boolean RangeFunctions.isBetween(long reading, long floor, long ceiling)
[INPUTS] branches=- | result=ceiling, floor, reading
*/
class RangeFunctions {
public static boolean isBetween(long reading, long floor, long ceiling) {
return reading < ceiling && reading > floor;
}
... | true | ok | {"focal": {"class": "RangeFunctions", "name": "isBetween", "signature": "boolean isBetween(long reading, long floor, long ceiling)", "start_line": 3, "modifiers": "public static", "params": [{"name": "reading", "type": "long"}, {"name": "floor", "type": "long"}, {"name": "ceiling", "type": "long"}], "return_type": "boo... |
459348_101 | class HeaderGenerator {
public void setHeaders(final Message message,
final Map<String, String> msgMap,
final DataType dataType,
final String address,
final @NonNull PersonRecord contact,
... | Message message = new MimeMessage();
Map<String, String> map = new HashMap<String, String>();
Date sent = new Date();
PersonRecord person = new PersonRecord(0, null, null, null);
map.put(Telephony.BaseMmsColumns._ID, "id");
map.put(Telephony.BaseMmsColumns.MESSAGE_TYPE,... | [FOCAL] public void HeaderGenerator.setHeaders(Message message, Map<String, String> msgMap, DataType dataType, String address, PersonRecord contact, Date sentDate, int status)
[CLASS] class HeaderGenerator
[METRICS] loc=23 cc=4 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] String createMessageId(Date... | /* static context
[FOCAL] public void HeaderGenerator.setHeaders(Message message, Map<String, String> msgMap, DataType dataType, String address, PersonRecord contact, Date sentDate, int status)
[PATH1] switch(dataType)=case SMS
[PATH2] switch(dataType)=case MMS
[PATH3] switch(dataType)=case CALLLOG
[PATH4] switch(dataT... | /* static context
[FOCAL] public void HeaderGenerator.setHeaders(Message message, Map<String, String> msgMap, DataType dataType, String address, PersonRecord contact, Date sentDate, int status)
[PATH1] switch(dataType)=case SMS
[PATH2] switch(dataType)=case MMS
[PATH3] switch(dataType)=case CALLLOG
[PATH4] switch(dataT... | true | ok | {"focal": {"class": "HeaderGenerator", "name": "setHeaders", "signature": "void setHeaders(Message message, Map<String, String> msgMap, DataType dataType, String address, PersonRecord contact, Date sentDate, int status) throws MessagingException", "start_line": 3, "modifiers": "public", "params": [{"name": "message", "... |
466802_0 | class UserAccount {
public String getBiography() {
return biography;
}
public UserAccount();
public Long getAccountId();
public void setAccountId(Long accountId);
public Date getAccountCreationDate();
public void setAccountCreationDate(Date accountCreationDate);
public String... | UserAccountManager mgr = new UserAccountManager();
String bio = "Round the rugged rock the ragged rascal ran.";
mgr.createAndStoreUserAccount("johntestbio.smith", "testmyotherpasswordcleartext", "johntestbio@smith.com",
bio);
assertEquals(bio, mgr.getBiography("johntestbi... | [FOCAL] public String UserAccount.getBiography()
[CLASS] class UserAccount
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] UserAccount(); Long getAccountId(); void setAccountId(Long accountId); Date getAccountCreationDate(); void setAccountCreationDate(Date accountCreationDate); Str... | /* static context
[FOCAL] public String UserAccount.getBiography()
*/
| /* static context
[FOCAL] public String UserAccount.getBiography()
*/
class UserAccount {
public String getBiography() {
return biography;
}
public UserAccount();
public Long getAccountId();
public void setAccountId(Long accountId);
public Date getAccountCreationDate();
public vo... | true | ok | {"focal": {"class": "UserAccount", "name": "getBiography", "signature": "String getBiography()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "UserAccount", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "log", "typ... |
473362_6 | class CollocReducer extends MapReduceBase implements Reducer<GramKey,Gram,Gram,Gram> {
@Override
public void reduce(GramKey key,
Iterator<Gram> values,
OutputCollector<Gram,Gram> output,
Reporter reporter) throws IOException {
Gram.Type keyTyp... | // test input, input[*][0] is the key,
// input[*][1..n] are the values passed in via
// the iterator.
Gram[][] input = {
{new Gram("the", UNIGRAM), new Gram("the", UNIGRAM), new Gram("the", UNIGRAM)},
{new Gram("the", HEAD), new Gram("the best", NGRAM), new Gram("the worst", NGRAM)},
... | [FOCAL] @Override public void CollocReducer.reduce(GramKey key, Iterator<Gram> values, OutputCollector<Gram,Gram> output, Reporter reporter)
[CLASS] class CollocReducer extends MapReduceBase implements Reducer<GramKey,Gram,Gram,Gram>
[METRICS] loc=18 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=2
[CALLS-INTERNAL]... | /* static context
[FOCAL] @Override public void CollocReducer.reduce(GramKey key, Iterator<Gram> values, OutputCollector<Gram,Gram> output, Reporter reporter)
[PATH1] if(keyType == Gram.Type.UNIGRAM)=F -> if(keyType == Gram.Type.HEAD || keyType == Gram.Type.TAIL)=T
[PATH2] if(keyType == Gram.Type.UNIGRAM)=T
[PATH3] if(... | /* static context
[FOCAL] @Override public void CollocReducer.reduce(GramKey key, Iterator<Gram> values, OutputCollector<Gram,Gram> output, Reporter reporter)
[PATH1] if(keyType == Gram.Type.UNIGRAM)=F -> if(keyType == Gram.Type.HEAD || keyType == Gram.Type.TAIL)=T
[PATH2] if(keyType == Gram.Type.UNIGRAM)=T
[PATH3] if(... | true | ok | {"focal": {"class": "CollocReducer", "name": "reduce", "signature": "void reduce(GramKey key, Iterator<Gram> values, OutputCollector<Gram,Gram> output, Reporter reporter) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "key", "type": "GramKey"}, {"name": "values", "type": "Ite... |
474905_0 | class Customer {
public void setName(String name) {
this.name = name;
}
public Customer();
public Customer(String name);
public Long getId();
public String getName();
public boolean isArchived();
public void setArchived(boolean archived);
private static EntityManagerFactory emf;
private EntityManager ... |
try {
Customer customer = new Customer("Bob");
em.persist(customer);
em.flush();
em.detach(customer);
customer.setName("Bo");
em.merge(customer);
em.flush();
fail("Expected ConstraintViolationException wasn't thrown.");
} catch (ConstraintViolationException e) {
assertEquals(1, e.getCo... | [FOCAL] public void Customer.setName(String name)
[CLASS] class Customer
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[FIELDS] write=name
[STATE] name via getName()
[DATAFLOW] name@param->L2
[CLASS-MEMBERS] Customer(); Customer(String name); Long getId(); String getName(); boolean isArchived(); ... | /* static context
[FOCAL] public void Customer.setName(String name)
[STATE] name via getName()
[FIELDS] write=name
*/
| /* static context
[FOCAL] public void Customer.setName(String name)
[STATE] name via getName()
[FIELDS] write=name
*/
class Customer {
public void setName(String name) {
this.name = name;
}
public Customer();
public Customer(String name);
public Long getId();
public String getName();
public boolean isArch... | true | ok | {"focal": {"class": "Customer", "name": "setName", "signature": "void setName(String name)", "start_line": 3, "modifiers": "public", "params": [{"name": "name", "type": "String"}], "return_type": "void"}, "class_info": {"name": "Customer", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "field... |
478661_36 | class CSVParser {
public String[] parseLine(String nextLine) throws IOException {
return parseLine(nextLine, false);
}
public CSVParser();
public CSVParser(char separator);
public CSVParser(char separator, char quotechar);
public CSVParser(char separator, char quotechar, char escap... | csvParser = new CSVParser(CSVParser.DEFAULT_SEPARATOR,
CSVParser.DEFAULT_QUOTE_CHARACTER,
CSVParser.DEFAULT_ESCAPE_CHARACTER,
CSVParser.DEFAULT_STRICT_QUOTES,
CSVParser.DEFAULT_IGNORE_LEADING_WHITESPACE,
true);
String testSt... | [FOCAL] public String[] CSVParser.parseLine(String nextLine)
[CLASS] class CSVParser
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String[] parseLine(String nextLine, boolean multi)
[EXCEPTIONS] declares IOException
[INPUTS] branches=- | result=nextLine
[DATAFLOW] nextLine@param-... | /* static context
[FOCAL] public String[] CSVParser.parseLine(String nextLine)
[INPUTS] branches=- | result=nextLine
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] String[] parseLine(String nextLine, boolean multi)
*/
| /* static context
[FOCAL] public String[] CSVParser.parseLine(String nextLine)
[INPUTS] branches=- | result=nextLine
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] String[] parseLine(String nextLine, boolean multi)
*/
class CSVParser {
public String[] parseLine(String nextLine) throws IOException {
ret... | true | ok | {"focal": {"class": "CSVParser", "name": "parseLine", "signature": "String[] parseLine(String nextLine) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "nextLine", "type": "String"}], "return_type": "String[]"}, "class_info": {"name": "CSVParser", "kind": "class", "modifiers": "", "supe... |
489859_415 | class RestAnnotationProcessor implements Function<Invocation, HttpRequest> {
@Override
public GeneratedHttpRequest apply(Invocation invocation) {
checkNotNull(invocation, "invocation");
inputParamValidator.validateMethodParametersOrThrow(invocation);
Optional<URI> endpoint = Optional.absent();... | Invokable<?, ?> method = method(TestFormReplace.class, "oneForm", String.class);
Object form = processor.apply(Invocation.create(method, ImmutableList.<Object> of("robot")))
.getPayload().getRawContent();
assertEquals(form, "x-amz-copy-source=/robot");
}
} | [FOCAL] @Override public GeneratedHttpRequest RestAnnotationProcessor.apply(Invocation invocation)
[CLASS] class RestAnnotationProcessor implements Function<Invocation, HttpRequest>
[METRICS] loc=148 cc=30 branches=25 loops=4 returns=1 throws=1 nesting=4
[CALLS-INTERNAL] GeneratedHttpRequest decorateRequest(GeneratedHt... | class RestAnnotationProcessor implements Function<Invocation, HttpRequest> {
@Override
public GeneratedHttpRequest apply(Invocation invocation) {
checkNotNull(invocation, "invocation");
inputParamValidator.validateMethodParametersOrThrow(invocation);
Optional<URI> endpoint = Optional.absent();... | false | ok | {"focal": {"class": "RestAnnotationProcessor", "name": "apply", "signature": "GeneratedHttpRequest apply(Invocation invocation)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "invocation", "type": "Invocation"}], "return_type": "GeneratedHttpRequest"}, "class_info": {"name": "RestAnnotationProc... | |
500697_95 | class TransformedMultivariateNormalSummary extends AbstractObservable implements MultivariateNormalSummary {
public boolean getDefined() {
return d_isDefined;
}
public TransformedMultivariateNormalSummary(MultivariateNormalSummary nested, double[][] matrix);
public double[] getMeanVector();
public double[][]... | TransformedMultivariateNormalSummary summary = new TransformedMultivariateNormalSummary(d_nested , TRANSFORM);
assertFalse(summary.getDefined());
d_results.makeSamplesAvailable();
assertTrue(summary.getDefined());
}
} | [FOCAL] public boolean TransformedMultivariateNormalSummary.getDefined()
[CLASS] class TransformedMultivariateNormalSummary extends AbstractObservable implements MultivariateNormalSummary
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] TransformedMultivariateNormalSummary(Multivaria... | /* static context
[FOCAL] public boolean TransformedMultivariateNormalSummary.getDefined()
*/
| /* static context
[FOCAL] public boolean TransformedMultivariateNormalSummary.getDefined()
*/
class TransformedMultivariateNormalSummary extends AbstractObservable implements MultivariateNormalSummary {
public boolean getDefined() {
return d_isDefined;
}
public TransformedMultivariateNormalSummary(MultivariateN... | true | ok | {"focal": {"class": "TransformedMultivariateNormalSummary", "name": "getDefined", "signature": "boolean getDefined()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "TransformedMultivariateNormalSummary", "kind": "class", "modifiers": "", "superclass": "Abstract... |
500806_607 | class JmsEndpointComponent extends AbstractEndpointComponent {
@Override
protected Endpoint createEndpoint(String resourcePath, Map<String, String> parameters, TestContext context) {
JmsEndpoint endpoint;
if (resourcePath.startsWith("sync:")) {
endpoint = new JmsSyncEndpoint();
... | JmsEndpointComponent component = new JmsEndpointComponent();
try {
reset(referenceResolver);
component.createEndpoint("jms:queuename?param1=¶m2=value2", context);
Assert.fail("Missing exception due to invalid endpoint uri");
} catch (CitrusRuntimeException... | [FOCAL] @Override protected Endpoint JmsEndpointComponent.createEndpoint(String resourcePath, Map<String, String> parameters, TestContext context)
[CLASS] class JmsEndpointComponent extends AbstractEndpointComponent
[METRICS] loc=30 cc=5 branches=4 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] String.startsWith... | /* static context
[FOCAL] @Override protected Endpoint JmsEndpointComponent.createEndpoint(String resourcePath, Map<String, String> parameters, TestContext context)
[PATH1] if(resourcePath.startsWith("sync:"))=T -> if(resourcePath.contains("topic:"))=T -> if(resourcePath.indexOf(':') > 0)=T -> if(context.getReferenceRe... | /* static context
[FOCAL] @Override protected Endpoint JmsEndpointComponent.createEndpoint(String resourcePath, Map<String, String> parameters, TestContext context)
[PATH1] if(resourcePath.startsWith("sync:"))=T -> if(resourcePath.contains("topic:"))=T -> if(resourcePath.indexOf(':') > 0)=T -> if(context.getReferenceRe... | true | ok | {"focal": {"class": "JmsEndpointComponent", "name": "createEndpoint", "signature": "Endpoint createEndpoint(String resourcePath, Map<String, String> parameters, TestContext context)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "resourcePath", "type": "String"}, {"name": "parameters", "type... |
508590_3 | class PropertyGraphSail extends SailBase {
void setFirstClassEdges(final boolean firstClassEdges) {
this.firstClassEdges = firstClassEdges;
}
public PropertyGraphSail(final Graph graph);
public PropertyGraphSail(final Graph graph,
final boolean firstClassEdges);
... | sail.setFirstClassEdges(false);
sc.close();
sc = sail.getConnection();
for (Statement st : get(null, null, null)) {
System.out.println("st: " + st);
}
assertEquals(30, sc.size());
assertEquals(30, count(null, null, null));
assertEquals(6, co... | [FOCAL] void PropertyGraphSail.setFirstClassEdges(boolean firstClassEdges)
[CLASS] class PropertyGraphSail extends SailBase
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[FIELDS] write=firstClassEdges
[STATE] firstClassEdges
[DATAFLOW] firstClassEdges@param->L2
[CLASS-MEMBERS] PropertyGraphSail(G... | /* static context
[FOCAL] void PropertyGraphSail.setFirstClassEdges(boolean firstClassEdges)
[STATE] firstClassEdges
[FIELDS] write=firstClassEdges
*/
| /* static context
[FOCAL] void PropertyGraphSail.setFirstClassEdges(boolean firstClassEdges)
[STATE] firstClassEdges
[FIELDS] write=firstClassEdges
*/
class PropertyGraphSail extends SailBase {
void setFirstClassEdges(final boolean firstClassEdges) {
this.firstClassEdges = firstClassEdges;
}
publi... | true | ok | {"focal": {"class": "PropertyGraphSail", "name": "setFirstClassEdges", "signature": "void setFirstClassEdges(boolean firstClassEdges)", "start_line": 3, "modifiers": "", "params": [{"name": "firstClassEdges", "type": "boolean"}], "return_type": "void"}, "class_info": {"name": "PropertyGraphSail", "kind": "class", "modi... |
511297_48 | class CassandraHostConfigurator implements Serializable {
public CassandraHost[] buildCassandraHosts() {
if (this.hosts == null) {
throw new IllegalArgumentException("Need to define at least one host in order to apply configuration.");
}
String[] hostVals = hosts.split(",");
CassandraHost[] cas... | CassandraHostConfigurator cassandraHostConfigurator = new CassandraHostConfigurator("localhost:9170");
CassandraHost[] cassandraHosts = cassandraHostConfigurator.buildCassandraHosts();
assertEquals(1, cassandraHosts.length);
}
} | [FOCAL] public CassandraHost[] CassandraHostConfigurator.buildCassandraHosts()
[CLASS] class CassandraHostConfigurator implements Serializable
[METRICS] loc=13 cc=3 branches=1 loops=1 returns=1 throws=1 nesting=1
[CALLS-INTERNAL] void applyConfig(CassandraHost cassandraHost)
[CALLS-EXTERNAL] hosts.split/1, hostVals[x].... | /* static context
[FOCAL] public CassandraHost[] CassandraHostConfigurator.buildCassandraHosts()
[THROWS-WHEN] IllegalArgumentException when this.hosts == null
[PATH1] if(this.hosts == null)=F -> for(x<hostVals.length)=T -> exit loop -> return cassandraHosts
[PATH2] if(this.hosts == null)=T -> throw new IllegalArgument... | /* static context
[FOCAL] public CassandraHost[] CassandraHostConfigurator.buildCassandraHosts()
[THROWS-WHEN] IllegalArgumentException when this.hosts == null
[PATH1] if(this.hosts == null)=F -> for(x<hostVals.length)=T -> exit loop -> return cassandraHosts
[PATH2] if(this.hosts == null)=T -> throw new IllegalArgument... | true | ok | {"focal": {"class": "CassandraHostConfigurator", "name": "buildCassandraHosts", "signature": "CassandraHost[] buildCassandraHosts()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "CassandraHost[]"}, "class_info": {"name": "CassandraHostConfigurator", "kind": "class", "modifiers": "", "superclass... |
520146_100 | class SEAGrid implements PlanetaryGrid {
@Override
public long getBinIndex(double lat, double lon) {
final int row = getRowIndex(lat);
final int col = getColIndex(lon, row);
return baseBin[row] + col;
}
public SEAGrid();
public SEAGrid(int numRows);
public static int... | // 3, 8, 12, 12, 8, 3
SEAGrid grid = new SEAGrid(6);
assertEquals(0, grid.getBinIndex(+75.0, -500.0));
assertEquals(0, grid.getBinIndex(+100, -120.0));
assertEquals(0, grid.getBinIndex(+75.0, -120.0));
assertEquals(2, grid.getBinIndex(+75.0, +120.0));
assertEqual... | [FOCAL] @Override public long SEAGrid.getBinIndex(double lat, double lon)
[CLASS] class SEAGrid implements PlanetaryGrid
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] int getColIndex(double lon, int row); int getRowIndex(long binIndex)
[INPUTS] branches=- | result=lat, lon
[DATAF... | /* static context
[FOCAL] @Override public long SEAGrid.getBinIndex(double lat, double lon)
[INPUTS] branches=- | result=lat, lon
[CALLS-INTERNAL] int getColIndex(double lon, int row); int getRowIndex(long binIndex)
*/
| /* static context
[FOCAL] @Override public long SEAGrid.getBinIndex(double lat, double lon)
[INPUTS] branches=- | result=lat, lon
[CALLS-INTERNAL] int getColIndex(double lon, int row); int getRowIndex(long binIndex)
*/
class SEAGrid implements PlanetaryGrid {
@Override
public long getBinIndex(double lat, doubl... | true | ok | {"focal": {"class": "SEAGrid", "name": "getBinIndex", "signature": "long getBinIndex(double lat, double lon)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "lat", "type": "double"}, {"name": "lon", "type": "double"}], "return_type": "long"}, "class_info": {"name": "SEAGrid", "kind": "class", "m... |
526139_189 | class GeometryTracker {
boolean hasValidArea() {
return area != null && !area.isEmpty();
}
GeometryTracker();
Rectangle2D getArea();
void add(Point2D.Double point);
private GeometryTracker tracker;
}
class GeometryTrackerTest {
private GeometryTracker tracker;
@Test
... | assertFalse(tracker.hasValidArea());
}
} | [FOCAL] boolean GeometryTracker.hasValidArea()
[CLASS] class GeometryTracker
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] area.isEmpty/0
[COLLABORATORS] field area isEmpty/0
[CLASS-MEMBERS] GeometryTracker(); Rectangle2D getArea(); void add(Point2D.Double point)
[TEST] GeometryT... | /* static context
[FOCAL] boolean GeometryTracker.hasValidArea()
[COLLABORATORS] field area isEmpty/0
[CALLS-EXTERNAL] area.isEmpty/0
*/
| /* static context
[FOCAL] boolean GeometryTracker.hasValidArea()
[COLLABORATORS] field area isEmpty/0
[CALLS-EXTERNAL] area.isEmpty/0
*/
class GeometryTracker {
boolean hasValidArea() {
return area != null && !area.isEmpty();
}
GeometryTracker();
Rectangle2D getArea();
void add(Point2... | true | ok | {"focal": {"class": "GeometryTracker", "name": "hasValidArea", "signature": "boolean hasValidArea()", "start_line": 3, "modifiers": "", "params": [], "return_type": "boolean"}, "class_info": {"name": "GeometryTracker", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "tracke... |
533032_1 | class DocIdSetCardinality implements Cloneable, Comparable<DocIdSetCardinality> {
public void orWith(DocIdSetCardinality other) {
min = Math.max(min, other.min);
max = Math.min(1.0, max + other.max);
}
DocIdSetCardinality(double minCardinality, double maxCardinality);
public static DocIdSetCardinal... | DocIdSetCardinality c;
c = new DocIdSetCardinality(0.1, 0.2);
c.orWith(new DocIdSetCardinality(0.1, 0.2));
DocSetAssertions.assertRange(0.1, 0.4, c);
c = new DocIdSetCardinality(0.8, 0.9);
c.orWith(new DocIdSetCardinality(0.8, 0.9));
DocSetAssertions.assertRange(0.8, 1.0, c);
}
} | [FOCAL] public void DocIdSetCardinality.orWith(DocIdSetCardinality other)
[CLASS] class DocIdSetCardinality implements Cloneable, Comparable<DocIdSetCardinality>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] Math.max/2, Math.min/2
[DATAFLOW] other@param->L2,L3
[CLASS-MEMBERS] Doc... | /* static context
[FOCAL] public void DocIdSetCardinality.orWith(DocIdSetCardinality other)
[CALLS-EXTERNAL] Math.max/2, Math.min/2
*/
| /* static context
[FOCAL] public void DocIdSetCardinality.orWith(DocIdSetCardinality other)
[CALLS-EXTERNAL] Math.max/2, Math.min/2
*/
class DocIdSetCardinality implements Cloneable, Comparable<DocIdSetCardinality> {
public void orWith(DocIdSetCardinality other) {
min = Math.max(min, other.min);
max = Math.m... | true | ok | {"focal": {"class": "DocIdSetCardinality", "name": "orWith", "signature": "void orWith(DocIdSetCardinality other)", "start_line": 3, "modifiers": "public", "params": [{"name": "other", "type": "DocIdSetCardinality"}], "return_type": "void"}, "class_info": {"name": "DocIdSetCardinality", "kind": "class", "modifiers": ""... |
536958_2 | class WebXmlIntegrator implements Integrator {
Node createFilterNode(Document doc) {
Node filterNode = doc.createElement("filter");
Node filterNameNode = doc.createElement("filter-name");
filterNameNode.appendChild(doc.createTextNode("infrared"));
Node filterClassNode = doc.createElement("filter-class");
fi... | WebXmlIntegrator web = new WebXmlIntegrator();
Document doc = createEmptyDocument();
Node n = web.createFilterNode(doc);
doc.appendChild(n);
String expected = " <filter><filter-name>infrared</filter-name>"+
"<filter-class>"+WebXmlIntegrator.FILTER_CLASS+"</filter-class>"+
"</filter... | [FOCAL] Node WebXmlIntegrator.createFilterNode(Document doc)
[CLASS] class WebXmlIntegrator implements Integrator
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Document.createElement/1, Node.appendChild/1, Document.createTextNode/1
[INPUTS] branches=- | result=doc
[COLLABORATORS... | /* static context
[FOCAL] Node WebXmlIntegrator.createFilterNode(Document doc)
[INPUTS] branches=- | result=doc
[COLLABORATORS] param doc:Document createElement/1,createTextNode/1
[CALLS-EXTERNAL] Document.createElement/1, Node.appendChild/1, Document.createTextNode/1
*/
| /* static context
[FOCAL] Node WebXmlIntegrator.createFilterNode(Document doc)
[INPUTS] branches=- | result=doc
[COLLABORATORS] param doc:Document createElement/1,createTextNode/1
[CALLS-EXTERNAL] Document.createElement/1, Node.appendChild/1, Document.createTextNode/1
*/
class WebXmlIntegrator implements Integrator {
... | true | ok | {"focal": {"class": "WebXmlIntegrator", "name": "createFilterNode", "signature": "Node createFilterNode(Document doc)", "start_line": 3, "modifiers": "", "params": [{"name": "doc", "type": "Document"}], "return_type": "Node"}, "class_info": {"name": "WebXmlIntegrator", "kind": "class", "modifiers": "", "superclass": nu... |
542927_85 | class Production {
public Object[] getJobIds() {
return workflow.getJobIds();
}
public Production(String id,
String name,
String outputPath,
String stagingPath,
boolean autoStaging,
Produ... | Production production = new Production("9A3F", "Toasting", null, null,
false, new ProductionRequest("test", "ewa"),
new MyWorkflowItem(new JobID("34627985F47", 4)));
assertArrayEquals(new Object[]{new JobID("3... | [FOCAL] public Object[] Production.getJobIds()
[CLASS] class Production
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] workflow.getJobIds/0
[COLLABORATORS] field workflow getJobIds/0
[CLASS-MEMBERS] Production(String id, String name, String outputPath, String stagingPath, boolean ... | /* static context
[FOCAL] public Object[] Production.getJobIds()
[COLLABORATORS] field workflow getJobIds/0
[CALLS-EXTERNAL] workflow.getJobIds/0
*/
| /* static context
[FOCAL] public Object[] Production.getJobIds()
[COLLABORATORS] field workflow getJobIds/0
[CALLS-EXTERNAL] workflow.getJobIds/0
*/
class Production {
public Object[] getJobIds() {
return workflow.getJobIds();
}
public Production(String id,
String name,
... | true | ok | {"focal": {"class": "Production", "name": "getJobIds", "signature": "Object[] getJobIds()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Object[]"}, "class_info": {"name": "Production", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": ... |
551254_19 | class FileUtil {
public static File createTempDirectory() throws IOException {
File tmp = File.createTempFile("bpelunit", "");
tmp.delete();
tmp.mkdir();
return tmp;
}
private FileUtil();
public static byte[] readFile(File f);
public static String getFileNameWithoutSuffix(String fileName);
}
class Fi... | File f = null;
try {
f = FileUtil.createTempDirectory();
assertTrue(f.exists());
assertTrue(f.isDirectory());
assertEquals(0, f.list().length);
} finally {
if (f != null) {
f.delete();
}
}
}
} | [FOCAL] public static File FileUtil.createTempDirectory()
[CLASS] class FileUtil
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] File.createTempFile/2, File.delete/0, File.mkdir/0
[EXCEPTIONS] declares IOException
[DATAFLOW] tmp@L2->L3,L4,L5
[CLASS-MEMBERS] FileUtil(); byte[] readF... | /* static context
[FOCAL] public static File FileUtil.createTempDirectory()
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] File.createTempFile/2, File.delete/0, File.mkdir/0
*/
| /* static context
[FOCAL] public static File FileUtil.createTempDirectory()
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] File.createTempFile/2, File.delete/0, File.mkdir/0
*/
class FileUtil {
public static File createTempDirectory() throws IOException {
File tmp = File.createTempFile("bpelunit", "");
tmp.de... | true | ok | {"focal": {"class": "FileUtil", "name": "createTempDirectory", "signature": "File createTempDirectory() throws IOException", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "File"}, "class_info": {"name": "FileUtil", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "... |
558963_40 | class HTTPCache {
public HTTPResponse execute(final HTTPRequest request) {
return execute(request, helper.isEndToEndReloadRequest(request));
}
public HTTPCache(CacheStorage storage, ResponseResolver resolver);
public void clear();
public CacheStorage getStorage();
public ResponseReso... | URI requestUri = URI.create("http://host1/some");
URI contentLocationUri = URI.create("http://host2/some/content/location");
URI locationUri = URI.create("http://host3/some/location");
HTTPRequest request = new HTTPRequest(requestUri, HTTPMethod.POST);
Headers responseHeaders = ... | [FOCAL] public HTTPResponse HTTPCache.execute(HTTPRequest request)
[CLASS] class HTTPCache
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] HTTPResponse execute(HTTPRequest request, boolean force)
[CALLS-EXTERNAL] helper.isEndToEndReloadRequest/1
[INPUTS] branches=- | result=request... | /* static context
[FOCAL] public HTTPResponse HTTPCache.execute(HTTPRequest request)
[INPUTS] branches=- | result=request
[COLLABORATORS] field helper isEndToEndReloadRequest/1
[CALLS-INTERNAL] HTTPResponse execute(HTTPRequest request, boolean force)
[CALLS-EXTERNAL] helper.isEndToEndReloadRequest/1
*/
| /* static context
[FOCAL] public HTTPResponse HTTPCache.execute(HTTPRequest request)
[INPUTS] branches=- | result=request
[COLLABORATORS] field helper isEndToEndReloadRequest/1
[CALLS-INTERNAL] HTTPResponse execute(HTTPRequest request, boolean force)
[CALLS-EXTERNAL] helper.isEndToEndReloadRequest/1
*/
class HTTPCache ... | true | ok | {"focal": {"class": "HTTPCache", "name": "execute", "signature": "HTTPResponse execute(HTTPRequest request)", "start_line": 3, "modifiers": "public", "params": [{"name": "request", "type": "HTTPRequest"}], "return_type": "HTTPResponse"}, "class_info": {"name": "HTTPCache", "kind": "class", "modifiers": "", "superclass"... |
574877_37 | class JsonErrorResponseHandler implements HttpResponseHandler<AmazonServiceException> {
@Override
public AmazonServiceException handle(HttpResponse response) throws Exception {
JsonContent jsonContent = JsonContent.createJsonContent(response, jsonFactory);
byte[] rawContent = jsonContent.getRa... | httpResponse.setStatusCode(500);
expectUnmarshallerMatches();
when(unmarshaller.unmarshall(any(JsonNode.class)))
.thenReturn(new CustomException("error"));
AmazonServiceException ase = responseHandler.handle(httpResponse);
assertEquals(ErrorType.Service, ase.get... | [FOCAL] @Override public AmazonServiceException JsonErrorResponseHandler.handle(HttpResponse response)
[CLASS] class JsonErrorResponseHandler implements HttpResponseHandler<AmazonServiceException>
[METRICS] loc=28 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] AmazonServiceException createExcepti... | /* static context
[FOCAL] @Override public AmazonServiceException JsonErrorResponseHandler.handle(HttpResponse response)
[PATH1] if(ase.getErrorMessage() == null)=T -> if(requestId != null)=T -> return ase
[PATH2] if(ase.getErrorMessage() == null)=F -> if(requestId != null)=F -> return ase
[INPUTS] branches=response, e... | /* static context
[FOCAL] @Override public AmazonServiceException JsonErrorResponseHandler.handle(HttpResponse response)
[PATH1] if(ase.getErrorMessage() == null)=T -> if(requestId != null)=T -> return ase
[PATH2] if(ase.getErrorMessage() == null)=F -> if(requestId != null)=F -> return ase
[INPUTS] branches=response, e... | true | ok | {"focal": {"class": "JsonErrorResponseHandler", "name": "handle", "signature": "AmazonServiceException handle(HttpResponse response) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "response", "type": "HttpResponse"}], "return_type": "AmazonServiceException"}, "class_info": {"na... |
578435_68 | class Strings {
public static String dasherize(String word) {
return word.replaceAll("_", "-");
}
public static String tableize(String word);
public static String pluralize(String word);
public static String singularize(String word);
public static String underscore(String word);
public static String... | for (Map.Entry<String, String> entry : underscoresToDashes_.entrySet()) {
assertEquals(entry.getValue(), Strings.dasherize(entry.getKey()));
}
}
} | [FOCAL] public static String Strings.dasherize(String word)
[CLASS] class Strings
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] String.replaceAll/2
[INPUTS] branches=- | result=word
[DATAFLOW] word@param->L2
[CLASS-MEMBERS] String tableize(String word); String pluralize(String wo... | /* static context
[FOCAL] public static String Strings.dasherize(String word)
[INPUTS] branches=- | result=word
[CALLS-EXTERNAL] String.replaceAll/2
*/
| /* static context
[FOCAL] public static String Strings.dasherize(String word)
[INPUTS] branches=- | result=word
[CALLS-EXTERNAL] String.replaceAll/2
*/
class Strings {
public static String dasherize(String word) {
return word.replaceAll("_", "-");
}
public static String tableize(String word);
public stati... | true | ok | {"focal": {"class": "Strings", "name": "dasherize", "signature": "String dasherize(String word)", "start_line": 3, "modifiers": "public static", "params": [{"name": "word", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Strings", "kind": "class", "modifiers": "", "superclass": null, "interfaces":... |
581866_1 | class Messages {
public static IOTransition.IOLetter fullLetter(String message) {
Matcher matcher = lettersPattern.matcher(message);
if (matcher.matches()) {
if (matcher.group(1).equals("^")) {
if (matcher.group(2) == null) {
return new IOTransition.IOLetter(new Message(matcher.group... | IOTransition.IOLetter letter = Messages.fullLetter("^a<-b.m");
Assertions.assertThat(letter.label.toString()).isEqualTo("b -> a.m");
Assertions.assertThat(letter.type).isEqualTo(IOAlphabetType.INTERNAL);
}
} | [FOCAL] public static IOTransition.IOLetter Messages.fullLetter(String message)
[CLASS] class Messages
[METRICS] loc=32 cc=8 branches=7 loops=0 returns=7 throws=1 nesting=4
[CALLS-INTERNAL] IllegalArgumentException rejectLetter(String message)
[CALLS-EXTERNAL] lettersPattern.matcher/1, Matcher.matches/0, matcher.group(... | /* static context
[FOCAL] public static IOTransition.IOLetter Messages.fullLetter(String message)
[THROWS-WHEN] rejectLetter(message) when !matcher.matches()
[PATH1] if(matcher.matches())=T -> if(matcher.group(1).equals("^"))=T -> if(matcher.group(2) == null)=F -> if(matcher.group(4).equals("->"))#1=T -> return new IOT... | /* static context
[FOCAL] public static IOTransition.IOLetter Messages.fullLetter(String message)
[THROWS-WHEN] rejectLetter(message) when !matcher.matches()
[PATH1] if(matcher.matches())=T -> if(matcher.group(1).equals("^"))=T -> if(matcher.group(2) == null)=F -> if(matcher.group(4).equals("->"))#1=T -> return new IOT... | true | ok | {"focal": {"class": "Messages", "name": "fullLetter", "signature": "IOTransition.IOLetter fullLetter(String message)", "start_line": 3, "modifiers": "public static", "params": [{"name": "message", "type": "String"}], "return_type": "IOTransition.IOLetter"}, "class_info": {"name": "Messages", "kind": "class", "modifiers... |
585380_4 | class KUID extends ByteArray<KUID> implements Identifier,
Key<KUID>, Xor<KUID>, Negation<KUID>, Cloneable, Digestable {
public boolean isCloserTo(KUID key, KUID otherId) {
return compareTo(key, otherId) < 0;
}
private KUID(byte[] key);
public static KUID createRandom(int length);
public static KU... | for (int i = 0; i < 1000; i++) {
KUID lookupId = KUID.createRandom(20);
KUID[] contacts = new KUID[] {
KUID.createRandom(lookupId),
KUID.createRandom(lookupId)
};
Arrays.sort(contacts, new XorComparator(lookupId));
TestCase.assertTrue(contacts[0].is... | [FOCAL] public boolean KUID.isCloserTo(KUID key, KUID otherId)
[CLASS] class KUID extends ByteArray<KUID> implements Identifier, Key<KUID>, Xor<KUID>, Negation<KUID>, Cloneable, Digestable
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] int compareTo(KUID key, KUID otherId)
[INPUTS... | /* static context
[FOCAL] public boolean KUID.isCloserTo(KUID key, KUID otherId)
[INPUTS] branches=- | result=key, otherId
[CALLS-INTERNAL] int compareTo(KUID key, KUID otherId)
*/
| /* static context
[FOCAL] public boolean KUID.isCloserTo(KUID key, KUID otherId)
[INPUTS] branches=- | result=key, otherId
[CALLS-INTERNAL] int compareTo(KUID key, KUID otherId)
*/
class KUID extends ByteArray<KUID> implements Identifier,
Key<KUID>, Xor<KUID>, Negation<KUID>, Cloneable, Digestable {
public bool... | true | ok | {"focal": {"class": "KUID", "name": "isCloserTo", "signature": "boolean isCloserTo(KUID key, KUID otherId)", "start_line": 4, "modifiers": "public", "params": [{"name": "key", "type": "KUID"}, {"name": "otherId", "type": "KUID"}], "return_type": "boolean"}, "class_info": {"name": "KUID", "kind": "class", "modifiers": "... |
589869_0 | class DpmPixel {
public void reset(int i, int j) {
this.i = i;
this.j = j;
x = 0;
y = 0;
detector = 0;
view_zenith = 0.0;
sun_zenith = 0.0;
delta_azimuth = 0.0;
sun_azimuth = 0.0;
mus = 0.0;
muv = 0.0;
airMass = 0.0;
... | final DpmPixel dpmPixel = new DpmPixel(0,0);
dpmPixel.x = 3;
dpmPixel.y = 4;
dpmPixel.i = 5;
dpmPixel.j = 6;
dpmPixel.detector = 7;
dpmPixel.view_zenith = 8.0;
dpmPixel.sun_zenith = 9.0;
dpmPixel.delta_azimuth = 10.0;
dpmPixel.sun_azimuth ... | [FOCAL] public void DpmPixel.reset(int i, int j)
[CLASS] class DpmPixel
[METRICS] loc=35 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1
[FIELDS] write=i, j
[PATH1] for(n < Constants.L1_BAND_NUM)=T -> exit loop
[PATH2] for(n < Constants.L1_BAND_NUM)=F
[STATE] i, j
[DATAFLOW] i@param->L2; j@param->L3; n@L25->L25,L2... | /* static context
[FOCAL] public void DpmPixel.reset(int i, int j)
[PATH1] for(n < Constants.L1_BAND_NUM)=T -> exit loop
[PATH2] for(n < Constants.L1_BAND_NUM)=F
[STATE] i, j
[FIELDS] write=i, j
*/
| /* static context
[FOCAL] public void DpmPixel.reset(int i, int j)
[PATH1] for(n < Constants.L1_BAND_NUM)=T -> exit loop
[PATH2] for(n < Constants.L1_BAND_NUM)=F
[STATE] i, j
[FIELDS] write=i, j
*/
class DpmPixel {
public void reset(int i, int j) {
this.i = i;
this.j = j;
x = 0;
y ... | true | ok | {"focal": {"class": "DpmPixel", "name": "reset", "signature": "void reset(int i, int j)", "start_line": 3, "modifiers": "public", "params": [{"name": "i", "type": "int"}, {"name": "j", "type": "int"}], "return_type": "void"}, "class_info": {"name": "DpmPixel", "kind": "class", "modifiers": "", "superclass": null, "inte... |
590532_4 | class ParticipantIDParser {
public static String encode(String raw) {
String[] parts = parseId(raw);
return shorten(toBigInteger(parts[0])) + "-" +
shorten(toBigInteger(parts[1], parts[2])) + "-" +
shorten(new BigInteger(parts[3]));
}
private static BigInteger toBigInteger(String ip);
private s... |
String raw = "moho://127.0.0.1:8080/call/" + Math.abs(new UUID().getTime());
assertEquals(raw, ParticipantIDParser.decode(ParticipantIDParser.encode(raw)));
raw = "moho://34.67.128.98:80/call/" + Math.abs(new UUID().getTime());
assertEquals(raw, ParticipantIDParser.decode(ParticipantIDParser.encode(raw)))... | [FOCAL] public static String ParticipantIDParser.encode(String raw)
[CLASS] class ParticipantIDParser
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] BigInteger toBigInteger(String ip); BigInteger toBigInteger(String port, String type); String shorten(BigInteger number); String[] p... | /* static context
[FOCAL] public static String ParticipantIDParser.encode(String raw)
[INPUTS] branches=- | result=raw
[CALLS-INTERNAL] BigInteger toBigInteger(String ip); BigInteger toBigInteger(String port, String type); String shorten(BigInteger number); String[] parseId(String raw)
[NEW] BigInteger
*/
| /* static context
[FOCAL] public static String ParticipantIDParser.encode(String raw)
[INPUTS] branches=- | result=raw
[CALLS-INTERNAL] BigInteger toBigInteger(String ip); BigInteger toBigInteger(String port, String type); String shorten(BigInteger number); String[] parseId(String raw)
[NEW] BigInteger
*/
class Partici... | true | ok | {"focal": {"class": "ParticipantIDParser", "name": "encode", "signature": "String encode(String raw)", "start_line": 3, "modifiers": "public static", "params": [{"name": "raw", "type": "String"}], "return_type": "String"}, "class_info": {"name": "ParticipantIDParser", "kind": "class", "modifiers": "", "superclass": nul... |
591784_24 | class DefaultUpdateCheckManager implements UpdateCheckManager, Service {
public void checkMetadata( RepositorySystemSession session, UpdateCheck<Metadata, MetadataTransferException> check )
{
if ( check.getLocalLastUpdated() != 0
&& !isUpdatedRequired( session, check.getLocalLastUpdated(), ... | UpdateCheck<Metadata, MetadataTransferException> check = newMetadataCheck();
check.setPolicy( RepositoryPolicy.UPDATE_POLICY_NEVER );
session.setNotFoundCachingEnabled( true );
check.getFile().delete();
assertEquals( check.getFile().getAbsolutePath(), false, check.getFile().exis... | [FOCAL] public void DefaultUpdateCheckManager.checkMetadata(RepositorySystemSession session, UpdateCheck<Metadata, MetadataTransferException> check)
[CLASS] class DefaultUpdateCheckManager implements UpdateCheckManager, Service
[METRICS] loc=113 cc=16 branches=15 loops=0 returns=1 throws=1 nesting=6
[CALLS-INTERNAL] Ar... | /* static context
[FOCAL] public void DefaultUpdateCheckManager.checkMetadata(RepositorySystemSession session, UpdateCheck<Metadata, MetadataTransferException> check)
[THROWS-WHEN] IllegalArgumentException when !(check.getLocalLastUpdated() != 0 && !isUpdatedRequired( session, check.getLocalLastUpdated(), check.getPoli... | /* static context
[FOCAL] public void DefaultUpdateCheckManager.checkMetadata(RepositorySystemSession session, UpdateCheck<Metadata, MetadataTransferException> check)
[THROWS-WHEN] IllegalArgumentException when !(check.getLocalLastUpdated() != 0 && !isUpdatedRequired( session, check.getLocalLastUpdated(), check.getPoli... | true | ok | {"focal": {"class": "DefaultUpdateCheckManager", "name": "checkMetadata", "signature": "void checkMetadata(RepositorySystemSession session, UpdateCheck<Metadata, MetadataTransferException> check)", "start_line": 3, "modifiers": "public", "params": [{"name": "session", "type": "RepositorySystemSession"}, {"name": "check... |
597631_48 | class FractionalIdentityScorer extends AbstractScorer implements PairwiseSequenceScorer<S, C> {
@Override
public int getMinScore() {
return 0;
}
public FractionalIdentityScorer(PairwiseSequenceAligner<S, C> aligner);
public FractionalIdentityScorer(SequencePair<S, C> pair);
@Overrid... | assertEquals(scorer1.getMinScore(), 0);
assertEquals(scorer2.getMinScore(), 0);
}
} | [FOCAL] @Override public int FractionalIdentityScorer.getMinScore()
[CLASS] class FractionalIdentityScorer extends AbstractScorer implements PairwiseSequenceScorer<S, C>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] FractionalIdentityScorer(PairwiseSequenceAligner<S, C> aligner); ... | /* static context
[FOCAL] @Override public int FractionalIdentityScorer.getMinScore()
*/
| /* static context
[FOCAL] @Override public int FractionalIdentityScorer.getMinScore()
*/
class FractionalIdentityScorer extends AbstractScorer implements PairwiseSequenceScorer<S, C> {
@Override
public int getMinScore() {
return 0;
}
public FractionalIdentityScorer(PairwiseSequenceAligner<S, ... | true | ok | {"focal": {"class": "FractionalIdentityScorer", "name": "getMinScore", "signature": "int getMinScore()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "FractionalIdentityScorer", "kind": "class", "modifiers": "", "superclass": "AbstractScorer", "interfaces... |
608316_15 | class StateManagerImpl implements StateManager {
@Override
public boolean isNew(Persistent persistent) {
return isNew;
}
public StateManagerImpl();
public void setManagedPersistent(Persistent persistent);
@Override public void setNew(Persistent persistent);
@Override public void clearNew(Persisten... | //newly created objects should be new
Assert.assertTrue(persistent.isNew());
}
} | [FOCAL] @Override public boolean StateManagerImpl.isNew(Persistent persistent)
[CLASS] class StateManagerImpl implements StateManager
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[INPUTS] branches=- | result=- | unused=persistent
[CLASS-MEMBERS] StateManagerImpl(); void setManagedPersistent(Pers... | /* static context
[FOCAL] @Override public boolean StateManagerImpl.isNew(Persistent persistent)
[INPUTS] branches=- | result=- | unused=persistent
*/
| /* static context
[FOCAL] @Override public boolean StateManagerImpl.isNew(Persistent persistent)
[INPUTS] branches=- | result=- | unused=persistent
*/
class StateManagerImpl implements StateManager {
@Override
public boolean isNew(Persistent persistent) {
return isNew;
}
public StateManagerImpl();
pub... | true | ok | {"focal": {"class": "StateManagerImpl", "name": "isNew", "signature": "boolean isNew(Persistent persistent)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "persistent", "type": "Persistent"}], "return_type": "boolean"}, "class_info": {"name": "StateManagerImpl", "kind": "class", "modifiers": ""... |
608843_3 | class OSMemory implements IMemorySystem {
IndexOutOfBoundsExceptionpublic native void setIntArray(int address, int[] ints, int offset,
int length, boolean swap) throws NullPointerException,
IndexOutOfBoundsException;
IndexOutOfBoundsExceptionprivate OSMemory();
... | )
public void testSetIntArray() {
IMemorySystem memory = Platform.getMemorySystem();
int[] values = { 3, 7, 31, 127, 8191, 131071, 524287, 2147483647 };
int[] swappedValues = new int[values.length];
for (int i = 0; i < values.length; ++i) {
swappedValues[i] =... | [FOCAL] void OSMemory.setIntArray(int address, int[] ints, int offset, int length, boolean swap)
[CLASS] class OSMemory implements IMemorySystem
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[EXCEPTIONS] declares NullPointerException, IndexOutOfBoundsException
[CLASS-MEMBERS] IndexOutOfBoundsExce... | /* static context
[FOCAL] void OSMemory.setIntArray(int address, int[] ints, int offset, int length, boolean swap)
[EXCEPTIONS] declares NullPointerException, IndexOutOfBoundsException
*/
| /* static context
[FOCAL] void OSMemory.setIntArray(int address, int[] ints, int offset, int length, boolean swap)
[EXCEPTIONS] declares NullPointerException, IndexOutOfBoundsException
*/
class OSMemory implements IMemorySystem {
IndexOutOfBoundsExceptionpublic native void setIntArray(int address, int[] in... | true | partial | {"focal": {"class": "OSMemory", "name": "setIntArray", "signature": "void setIntArray(int address, int[] ints, int offset, int length, boolean swap) throws NullPointerException, IndexOutOfBoundsException", "start_line": 3, "modifiers": "", "params": [{"name": "address", "type": "int"}, {"name": "ints", "type": "int[]"}... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.