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 |
|---|---|---|---|---|---|---|---|---|
32634272_14 | class OptimizerUtil {
public static boolean isWithinBounds (int[] rgParams, int[] rgLowerBound, int[] rgUpperBound)
{
// sanity checks...
OptimizerUtil.checkBoundVars (rgLowerBound, rgUpperBound);
if (rgParams == null)
throw new NullPointerException ("The argument rgParams must not be null.");
if (rgPara... | Assert.assertTrue (OptimizerUtil.isWithinBounds (new int[] { 8, 16, 8 }, m_rgLowerBounds, m_rgUpperBounds, m_listConstraints));
}
} | [FOCAL] public static boolean OptimizerUtil.isWithinBounds(int[] rgParams, int[] rgLowerBound, int[] rgUpperBound)
[CLASS] class OptimizerUtil
[METRICS] loc=18 cc=5 branches=3 loops=1 returns=2 throws=2 nesting=2
[CALLS-EXTERNAL] OptimizerUtil.checkBoundVars/2
[NEW] NullPointerException, RuntimeException
[EXCEPTIONS] t... | /* static context
[FOCAL] public static boolean OptimizerUtil.isWithinBounds(int[] rgParams, int[] rgLowerBound, int[] rgUpperBound)
[THROWS-WHEN] NullPointerException when rgParams == null
[THROWS-WHEN] RuntimeException when !(rgParams == null) && rgParams.length != rgLowerBound.length
[PATH1] if(rgParams == null)=F -... | /* static context
[FOCAL] public static boolean OptimizerUtil.isWithinBounds(int[] rgParams, int[] rgLowerBound, int[] rgUpperBound)
[THROWS-WHEN] NullPointerException when rgParams == null
[THROWS-WHEN] RuntimeException when !(rgParams == null) && rgParams.length != rgLowerBound.length
[PATH1] if(rgParams == null)=F -... | true | ok | {"focal": {"class": "OptimizerUtil", "name": "isWithinBounds", "signature": "boolean isWithinBounds(int[] rgParams, int[] rgLowerBound, int[] rgUpperBound)", "start_line": 3, "modifiers": "public static", "params": [{"name": "rgParams", "type": "int[]"}, {"name": "rgLowerBound", "type": "int[]"}, {"name": "rgUpperBound... |
32648170_0 | class Messages {
public String getString(String key) {
try {
return res_bund.getString(key);
} catch (MissingResourceException e) {
return '!' + key + '!';
}
}
public Messages(String countryTag);
public void setBUNDLE_NAME(String bn);
}
class Message... | Messages m = new Messages("en");
assertNotNull(m);
assertFalse(m.getString("Report.Distribution").startsWith("!"));
assertTrue(m.getString("NONEXISTENT.KEY.SHOULD.BE.SOURROUNDED.BY.EXCLAMATION.MARKS").startsWith("!"));
}
} | [FOCAL] public String Messages.getString(String key)
[CLASS] class Messages
[METRICS] loc=7 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] res_bund.getString/1
[EXCEPTIONS] catches MissingResourceException e
[PATH1] try-body throws -> return '!' + key + '!'
[PATH2] return res_bund.getString(key)
... | /* static context
[FOCAL] public String Messages.getString(String key)
[PATH1] try-body throws -> return '!' + key + '!'
[PATH2] return res_bund.getString(key)
[INPUTS] branches=- | result=key
[COLLABORATORS] field res_bund getString/1
[EXCEPTIONS] catches MissingResourceException e
[CALLS-EXTERNAL] res_bund.getString/... | /* static context
[FOCAL] public String Messages.getString(String key)
[PATH1] try-body throws -> return '!' + key + '!'
[PATH2] return res_bund.getString(key)
[INPUTS] branches=- | result=key
[COLLABORATORS] field res_bund getString/1
[EXCEPTIONS] catches MissingResourceException e
[CALLS-EXTERNAL] res_bund.getString/... | true | ok | {"focal": {"class": "Messages", "name": "getString", "signature": "String getString(String key)", "start_line": 3, "modifiers": "public", "params": [{"name": "key", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Messages", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, ... |
32677360_2 | class DownloadXmlTask extends AsyncTask<String, Void, List<Project>> {
@Override
protected void onPostExecute(List<Project> result) {
listViewController.updateListView(result);
}
public DownloadXmlTask(ProjectParser projectParser, ListViewController listViewController, ProjectStorageControlle... | Project project1 = new Project();
Project project2 = new Project();
List<Project> projects = asList(project1, project2);
downloadXmlTask.onPostExecute(projects);
verify(listViewController).updateListView(projects);
}
} | [FOCAL] @Override protected void DownloadXmlTask.onPostExecute(List<Project> result)
[CLASS] class DownloadXmlTask extends AsyncTask<String, Void, List<Project>>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] ListViewController.updateListView/1
[FIELDS] read=listViewController:Lis... | /* static context
[FOCAL] @Override protected void DownloadXmlTask.onPostExecute(List<Project> result)
[COLLABORATORS] field listViewController:ListViewController updateListView/1
[FIELDS] read=listViewController:ListViewController
[CALLS-EXTERNAL] ListViewController.updateListView/1
*/
| /* static context
[FOCAL] @Override protected void DownloadXmlTask.onPostExecute(List<Project> result)
[COLLABORATORS] field listViewController:ListViewController updateListView/1
[FIELDS] read=listViewController:ListViewController
[CALLS-EXTERNAL] ListViewController.updateListView/1
*/
class DownloadXmlTask extends As... | true | ok | {"focal": {"class": "DownloadXmlTask", "name": "onPostExecute", "signature": "void onPostExecute(List<Project> result)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "result", "type": "List<Project>"}], "return_type": "void"}, "class_info": {"name": "DownloadXmlTask", "kind": "class", "modif... |
32693202_87 | class SettingsRepositoryImpl implements SettingsRepository {
@Override public Set<String> unset(String data) {
Set<String> errors = new HashSet<>();
Map<String, Set<String>> values = TextUtils.parseAssignment(data);
values.keySet().forEach(
k -> {
String ... | assertThat(settingsRepository.unset("missing_key"), hasSize(1));
}
} | [FOCAL] @Override public Set<String> SettingsRepositoryImpl.unset(String data)
[CLASS] class SettingsRepositoryImpl implements SettingsRepository
[METRICS] loc=20 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] void requestPromptRefresh()
[CALLS-EXTERNAL] TextUtils.parseAssignment/1, values.keySet... | /* static context
[FOCAL] @Override public Set<String> SettingsRepositoryImpl.unset(String data)
[COLLABORATORS] field k toUpperCase/0; field filtersAware unsetFilter/1; field settingsAware unsetSetting/1
[CALLS-INTERNAL] void requestPromptRefresh()
[NEW] HashSet<>
[CALLS-EXTERNAL] TextUtils.parseAssignment/1, values.k... | /* static context
[FOCAL] @Override public Set<String> SettingsRepositoryImpl.unset(String data)
[COLLABORATORS] field k toUpperCase/0; field filtersAware unsetFilter/1; field settingsAware unsetSetting/1
[CALLS-INTERNAL] void requestPromptRefresh()
[NEW] HashSet<>
[CALLS-EXTERNAL] TextUtils.parseAssignment/1, values.k... | true | ok | {"focal": {"class": "SettingsRepositoryImpl", "name": "unset", "signature": "Set<String> unset(String data)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "data", "type": "String"}], "return_type": "Set<String>"}, "class_info": {"name": "SettingsRepositoryImpl", "kind": "class", "modifiers": ""... |
32714807_6 | class StringUtils {
public static String addTrailingIfNeeded(String s, String trailing) {
String value = s;
if ((null != s) && (null != trailing)) {
if (isTruthy(s) && !s.endsWith(trailing)) {
value = s + trailing;
}
}
return value;
}
... | Assert.assertEquals("hello", StringUtils.addTrailingIfNeeded("hello", null));
}
} | [FOCAL] public static String StringUtils.addTrailingIfNeeded(String s, String trailing)
[CLASS] class StringUtils
[METRICS] loc=9 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] boolean isTruthy(String s)
[CALLS-EXTERNAL] String.endsWith/1
[PATH1] if((null != s) && (null != trailing))=T -> if(isTr... | /* static context
[FOCAL] public static String StringUtils.addTrailingIfNeeded(String s, String trailing)
[PATH1] if((null != s) && (null != trailing))=T -> if(isTruthy(s) && !s.endsWith(trailing))=T -> return value
[PATH2] if((null != s) && (null != trailing))=F -> return value
[PATH3] if((null != s) && (null != trail... | /* static context
[FOCAL] public static String StringUtils.addTrailingIfNeeded(String s, String trailing)
[PATH1] if((null != s) && (null != trailing))=T -> if(isTruthy(s) && !s.endsWith(trailing))=T -> return value
[PATH2] if((null != s) && (null != trailing))=F -> return value
[PATH3] if((null != s) && (null != trail... | true | ok | {"focal": {"class": "StringUtils", "name": "addTrailingIfNeeded", "signature": "String addTrailingIfNeeded(String s, String trailing)", "start_line": 3, "modifiers": "public static", "params": [{"name": "s", "type": "String"}, {"name": "trailing", "type": "String"}], "return_type": "String"}, "class_info": {"name": "St... |
32731947_1 | class PostsPresenter {
public void loadPostsFromAPI() {
postsAPI.getPostsObservable().subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers
.mainThread())
.subscribe(new Subscriber<List<Post>>() {
... |
//create mocks
Observable<List<Post>> postsObservable = (Observable<List<Post>>) mock(Observable.class);
//define return values
when(postsPresenter.postsAPI.getPostsObservable()).thenReturn(postsObservable);
when(postsObservable.subscribeOn(Schedulers.io())).thenReturn(postsObs... | [FOCAL] public void PostsPresenter.loadPostsFromAPI()
[CLASS] class PostsPresenter
[METRICS] loc=20 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] postsAPI.getPostsObservable().subscribeOn(Schedulers.io()....subscribe/1, postsAPI.getPostsObservable().subscribeOn(Schedulers.io()).observeOn/1, post... | /* static context
[FOCAL] public void PostsPresenter.loadPostsFromAPI()
[COLLABORATORS] field postsAPI getPostsObservable/0
[NEW] Subscriber<List<Post>>, NewPostsEvent, ErrorEvent
[CALLS-EXTERNAL] postsAPI.getPostsObservable().subscribeOn(Schedulers.io()....subscribe/1, postsAPI.getPostsObservable().subscribeOn(Schedul... | /* static context
[FOCAL] public void PostsPresenter.loadPostsFromAPI()
[COLLABORATORS] field postsAPI getPostsObservable/0
[NEW] Subscriber<List<Post>>, NewPostsEvent, ErrorEvent
[CALLS-EXTERNAL] postsAPI.getPostsObservable().subscribeOn(Schedulers.io()....subscribe/1, postsAPI.getPostsObservable().subscribeOn(Schedul... | true | ok | {"focal": {"class": "PostsPresenter", "name": "loadPostsFromAPI", "signature": "void loadPostsFromAPI()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "PostsPresenter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "... |
32753016_28 | class Version {
@Override
public String toString() {
return osType.label + "-" + versionSingleNumber;
}
public Version(OsType osType, int version);
public Version(String osString, String versionString);
private static int parseToSingleInt(String version);
private static int pars... | Version version = new Version("iOS", "1.2.4");
assertEquals("iOS-10204", version.toString());
version = new Version("iOS", "1.1.1");
assertEquals("iOS-10101", version.toString());
version = Version.UNKNOWN_VERSION;
assertEquals("unknown-0", version.toString());
}
} | [FOCAL] @Override public String Version.toString()
[CLASS] class Version
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] Version(OsType osType, int version); Version(String osString, String versionString); int parseToSingleInt(String version); int parse(String[] parts); boolean larg... | /* static context
[FOCAL] @Override public String Version.toString()
*/
| /* static context
[FOCAL] @Override public String Version.toString()
*/
class Version {
@Override
public String toString() {
return osType.label + "-" + versionSingleNumber;
}
public Version(OsType osType, int version);
public Version(String osString, String versionString);
private ... | true | ok | {"focal": {"class": "Version", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "Version", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "V... |
32771134_7 | class ActionCreator {
public final void createEditTodoAction(long todoId, String newDescription) {
DataBundle<TodoAction.DataKeys> bundle = new DataBundle<>();
bundle.put(TodoAction.DataKeys.ID, todoId);
bundle.put(TodoAction.DataKeys.DESCRIPTION, newDescription);
actionBus.post(new... | final AtomicBoolean testDone = new AtomicBoolean(false);
actionBus.register(new Object() {
@Subscribe
public void addTodo(TodoAction action) {
assertThat(action.getData().get(TodoAction.DataKeys.ID, -1)).isEqualTo(10);
assertThat(action.getData().... | [FOCAL] public final void ActionCreator.createEditTodoAction(long todoId, String newDescription)
[CLASS] class ActionCreator
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] DataBundle<TodoAction.DataKeys>.put/2, ActionBus.post/1
[NEW] DataBundle<>, TodoAction
[FIELDS] read=actionBu... | /* static context
[FOCAL] public final void ActionCreator.createEditTodoAction(long todoId, String newDescription)
[COLLABORATORS] field actionBus:ActionBus post/1
[FIELDS] read=actionBus:ActionBus
[NEW] DataBundle<>, TodoAction
[CALLS-EXTERNAL] DataBundle<TodoAction.DataKeys>.put/2, ActionBus.post/1
*/
| /* static context
[FOCAL] public final void ActionCreator.createEditTodoAction(long todoId, String newDescription)
[COLLABORATORS] field actionBus:ActionBus post/1
[FIELDS] read=actionBus:ActionBus
[NEW] DataBundle<>, TodoAction
[CALLS-EXTERNAL] DataBundle<TodoAction.DataKeys>.put/2, ActionBus.post/1
*/
class ActionCre... | true | ok | {"focal": {"class": "ActionCreator", "name": "createEditTodoAction", "signature": "void createEditTodoAction(long todoId, String newDescription)", "start_line": 3, "modifiers": "public final", "params": [{"name": "todoId", "type": "long"}, {"name": "newDescription", "type": "String"}], "return_type": "void"}, "class_in... |
32777313_11 | class BDXR2IdentifierFactory implements IIdentifierFactory {
@Nullable
public BDXR2ProcessIdentifier createProcessIdentifier (@Nullable final String sScheme, @Nullable final String sValue)
{
final String sRealScheme = nullNotEmpty (sScheme);
final String sRealValue = nullNotEmpty (isProcessIdentifierCase... | final BDXR2IdentifierFactory aIF = BDXR2IdentifierFactory.INSTANCE;
assertNotNull (aIF.createProcessIdentifier (null, null));
assertNotNull (aIF.createProcessIdentifier (null, "any"));
assertNotNull (aIF.createProcessIdentifier (null, ""));
assertNotNull (aIF.createProcessIdentifier ("", ""));
a... | [FOCAL] @Nullable public BDXR2ProcessIdentifier BDXR2IdentifierFactory.createProcessIdentifier(String sScheme, String sValue)
[CLASS] class BDXR2IdentifierFactory implements IIdentifierFactory
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] boolean isProcessIdentifierCaseInsensiti... | /* static context
[FOCAL] @Nullable public BDXR2ProcessIdentifier BDXR2IdentifierFactory.createProcessIdentifier(String sScheme, String sValue)
[PATH1] if(isProcessIdentifierSchemeValid (sRealScheme) && isProcessIdentifierValueValid (sRealValue))=T -> return new BDXR2ProcessIdentifier (sRealScheme, sRealValue)
[PATH2] ... | /* static context
[FOCAL] @Nullable public BDXR2ProcessIdentifier BDXR2IdentifierFactory.createProcessIdentifier(String sScheme, String sValue)
[PATH1] if(isProcessIdentifierSchemeValid (sRealScheme) && isProcessIdentifierValueValid (sRealValue))=T -> return new BDXR2ProcessIdentifier (sRealScheme, sRealValue)
[PATH2] ... | true | ok | {"focal": {"class": "BDXR2IdentifierFactory", "name": "createProcessIdentifier", "signature": "BDXR2ProcessIdentifier createProcessIdentifier(String sScheme, String sValue)", "start_line": 3, "modifiers": "@Nullable public", "params": [{"name": "sScheme", "type": "String"}, {"name": "sValue", "type": "String"}], "retur... |
32784502_8 | class CryptTool {
public static byte[] derivePublicKey(byte[] privateKey) {
return NaCl.derivePublicKey(privateKey);
}
public static EncryptResult encryptTextMessage(String text, byte[] senderPrivateKey, byte[] recipientPublicKey);
public static EncryptResult encryptImageMessage(EncryptResult encryptResult, Upl... | Key privateKey = Key.decodeKey(Common.myPrivateKey);
Key publicKey = Key.decodeKey(Common.myPublicKey);
byte[] derivedPublicKey = CryptTool.derivePublicKey(privateKey.key);
Assert.assertNotNull("derived public key", derivedPublicKey);
Assert.assertEquals(derivedPublicKey, publicKey.key);
}
} | [FOCAL] public static byte[] CryptTool.derivePublicKey(byte[] privateKey)
[CLASS] class CryptTool
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] NaCl.derivePublicKey/1
[INPUTS] branches=- | result=privateKey
[DATAFLOW] privateKey@param->L2
[CLASS-MEMBERS] EncryptResult encryptText... | /* static context
[FOCAL] public static byte[] CryptTool.derivePublicKey(byte[] privateKey)
[INPUTS] branches=- | result=privateKey
[CALLS-EXTERNAL] NaCl.derivePublicKey/1
*/
| /* static context
[FOCAL] public static byte[] CryptTool.derivePublicKey(byte[] privateKey)
[INPUTS] branches=- | result=privateKey
[CALLS-EXTERNAL] NaCl.derivePublicKey/1
*/
class CryptTool {
public static byte[] derivePublicKey(byte[] privateKey) {
return NaCl.derivePublicKey(privateKey);
}
public static Encry... | true | ok | {"focal": {"class": "CryptTool", "name": "derivePublicKey", "signature": "byte[] derivePublicKey(byte[] privateKey)", "start_line": 3, "modifiers": "public static", "params": [{"name": "privateKey", "type": "byte[]"}], "return_type": "byte[]"}, "class_info": {"name": "CryptTool", "kind": "class", "modifiers": "", "supe... |
32790574_2 | class MyOlciPixelOp extends PixelOperator {
static String findWaveBand(Product product, boolean fail, double centralWavelength, double maxDeltaWavelength, String... bandNames) {
Band[] bands = product.getBands();
String bestBand = null;
double minDelta = Double.MAX_VALUE;
for (Band ... | Product product = new Product("dummy", "dummy", 10, 10);
addBand(product, "a");
addBand(product, "b");
addBand(product, "c");
addBand(product, "d");
addBand(product, "e");
addBand(product, "f");
addBand(product, "g");
addBand(product, "h");
... | [FOCAL] static String MyOlciPixelOp.findWaveBand(Product product, boolean fail, double centralWavelength, double maxDeltaWavelength, String... bandNames)
[CLASS] class MyOlciPixelOp extends PixelOperator
[METRICS] loc=28 cc=8 branches=5 loops=2 returns=3 throws=1 nesting=3
[CALLS-EXTERNAL] Product.getBands/0, Band.getS... | /* static context
[FOCAL] static String MyOlciPixelOp.findWaveBand(Product product, boolean fail, double centralWavelength, double maxDeltaWavelength, String... bandNames)
[THROWS-WHEN] OperatorException when foreach(Band band : bands)=T && bandWavelength > 0.0 && delta < minDelta && delta <= maxDeltaWavelength && !(be... | /* static context
[FOCAL] static String MyOlciPixelOp.findWaveBand(Product product, boolean fail, double centralWavelength, double maxDeltaWavelength, String... bandNames)
[THROWS-WHEN] OperatorException when foreach(Band band : bands)=T && bandWavelength > 0.0 && delta < minDelta && delta <= maxDeltaWavelength && !(be... | true | ok | {"focal": {"class": "MyOlciPixelOp", "name": "findWaveBand", "signature": "String findWaveBand(Product product, boolean fail, double centralWavelength, double maxDeltaWavelength, String... bandNames)", "start_line": 3, "modifiers": "static", "params": [{"name": "product", "type": "Product"}, {"name": "fail", "type": "b... |
32790911_1 | class SMPSettings implements ISMPSettings {
public boolean isDirectoryIntegrationRequired ()
{
return m_aSettings.getAsBoolean (SMPServerConfiguration.KEY_SMP_DIRECTORY_INTEGRATION_REQUIRED,
SMPServerConfiguration.DEFAULT_SMP_DIRECTORY_INTEGRATION_REQUIRED);
}
public ... | final SMPSettings aSettings = new SMPSettings ();
assertTrue (aSettings.isDirectoryIntegrationRequired ());
}
} | [FOCAL] public boolean SMPSettings.isDirectoryIntegrationRequired()
[CLASS] class SMPSettings implements ISMPSettings
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] m_aSettings.getAsBoolean/2
[COLLABORATORS] field m_aSettings getAsBoolean/2
[CLASS-MEMBERS] SMPSettings(); ObjectTyp... | /* static context
[FOCAL] public boolean SMPSettings.isDirectoryIntegrationRequired()
[COLLABORATORS] field m_aSettings getAsBoolean/2
[CALLS-EXTERNAL] m_aSettings.getAsBoolean/2
*/
| /* static context
[FOCAL] public boolean SMPSettings.isDirectoryIntegrationRequired()
[COLLABORATORS] field m_aSettings getAsBoolean/2
[CALLS-EXTERNAL] m_aSettings.getAsBoolean/2
*/
class SMPSettings implements ISMPSettings {
public boolean isDirectoryIntegrationRequired ()
{
return m_aSettings.getAsBoolean (S... | true | ok | {"focal": {"class": "SMPSettings", "name": "isDirectoryIntegrationRequired", "signature": "boolean isDirectoryIntegrationRequired()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "SMPSettings", "kind": "class", "modifiers": "", "superclass": null, "interfaces":... |
32794630_1 | class UtilBase {
static String mangleIndexPage(String data, String mainJS, String mainClass) {
Pattern loadClass = Pattern.compile("loadClass *\\( *[\"']" + mainClass);
Matcher loadClassMatcher = loadClass.matcher(data);
if (loadClassMatcher.find()) {
return data;
}
... | String data = "\n"
+ "<html>\n" +
" <head>\n" +
" </head>\n" +
" <body>\n" +
" <h1>H1</h1>\n" +
"<!-- ${browser.bootstrap} -->\n" +
" </body>\n" +
"</html>";
String res = UtilBase.mangleIn... | [FOCAL] static String UtilBase.mangleIndexPage(String data, String mainJS, String mainClass)
[CLASS] class UtilBase
[METRICS] loc=14 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] String invokeSnippet(String mainJS, String mainClass)
[CALLS-EXTERNAL] Pattern.compile/1, Pattern.matcher/1, Matcher.... | /* static context
[FOCAL] static String UtilBase.mangleIndexPage(String data, String mainJS, String mainClass)
[PATH1] if(loadClassMatcher.find())=T -> return data
[PATH2] if(loadClassMatcher.find())=F -> return newText
[INPUTS] branches=data, mainClass | result=data, mainClass, mainJS
[CALLS-INTERNAL] String invokeSni... | /* static context
[FOCAL] static String UtilBase.mangleIndexPage(String data, String mainJS, String mainClass)
[PATH1] if(loadClassMatcher.find())=T -> return data
[PATH2] if(loadClassMatcher.find())=F -> return newText
[INPUTS] branches=data, mainClass | result=data, mainClass, mainJS
[CALLS-INTERNAL] String invokeSni... | true | ok | {"focal": {"class": "UtilBase", "name": "mangleIndexPage", "signature": "String mangleIndexPage(String data, String mainJS, String mainClass)", "start_line": 3, "modifiers": "static", "params": [{"name": "data", "type": "String"}, {"name": "mainJS", "type": "String"}, {"name": "mainClass", "type": "String"}], "return_t... |
32802417_0 | class ReflectionUtils {
public static boolean hasSuperClass(Class<?> classA, Class<?> classB) {
// end recursion
if (classA.equals(classB))
return true;
boolean superclass = false;
// check superclass
Class<?> superClass = classA.getSuperclass();
if (superClass != null) {
if (superClass.equals(cla... | assertTrue(ReflectionUtils.hasSuperClass(URI.class, Object.class));
assertFalse(ReflectionUtils.hasSuperClass(Object.class, URI.class));
assertTrue(ReflectionUtils.hasSuperClass(Object.class, Object.class));
assertTrue(ReflectionUtils.hasSuperClass(URI.class, URI.class));
assertTrue(ReflectionUtils.hasSuperC... | [FOCAL] public static boolean ReflectionUtils.hasSuperClass(Class<?> classA, Class<?> classB)
[CLASS] class ReflectionUtils
[METRICS] loc=32 cc=7 branches=5 loops=1 returns=4 throws=0 nesting=3
[CALLS-EXTERNAL] Class<?>.equals/1, Class<?>.getSuperclass/0, hasSuperClass/2 (inherited), Class<?>.getInterfaces/0
[PATH1] if... | /* static context
[FOCAL] public static boolean ReflectionUtils.hasSuperClass(Class<?> classA, Class<?> classB)
[PATH1] if(classA.equals(classB))=F -> if(superClass != null)=T -> if(superClass.equals(classB))=T -> if(!superclass)=T -> foreach(Class<?> interfaze : interfaces)=T -> if(interfaze.equals(classB))=T -> retur... | /* static context
[FOCAL] public static boolean ReflectionUtils.hasSuperClass(Class<?> classA, Class<?> classB)
[PATH1] if(classA.equals(classB))=F -> if(superClass != null)=T -> if(superClass.equals(classB))=T -> if(!superclass)=T -> foreach(Class<?> interfaze : interfaces)=T -> if(interfaze.equals(classB))=T -> retur... | true | ok | {"focal": {"class": "ReflectionUtils", "name": "hasSuperClass", "signature": "boolean hasSuperClass(Class<?> classA, Class<?> classB)", "start_line": 3, "modifiers": "public static", "params": [{"name": "classA", "type": "Class<?>"}, {"name": "classB", "type": "Class<?>"}], "return_type": "boolean"}, "class_info": {"na... |
32823958_24 | class ExecutorEnvironmentalVariables {
public List<Protos.Environment.Variable> getList() {
return envList;
}
public ExecutorEnvironmentalVariables(Configuration configuration);
public ExecutorEnvironmentalVariables(Configuration configuration, long lNodeId);
private void populateEnvMap... | int ram = 2048;
Mockito.when(configuration.getMem()).thenReturn((double) ram);
ExecutorEnvironmentalVariables env = new ExecutorEnvironmentalVariables(configuration);
for (Protos.Environment.Variable var : env.getList()) {
if (var.getName().equals(ExecutorEnvironmentalVariab... | [FOCAL] public List<Protos.Environment.Variable> ExecutorEnvironmentalVariables.getList()
[CLASS] class ExecutorEnvironmentalVariables
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] ExecutorEnvironmentalVariables(Configuration configuration); ExecutorEnvironmentalVariables(Configur... | /* static context
[FOCAL] public List<Protos.Environment.Variable> ExecutorEnvironmentalVariables.getList()
*/
| /* static context
[FOCAL] public List<Protos.Environment.Variable> ExecutorEnvironmentalVariables.getList()
*/
class ExecutorEnvironmentalVariables {
public List<Protos.Environment.Variable> getList() {
return envList;
}
public ExecutorEnvironmentalVariables(Configuration configuration);
publ... | true | ok | {"focal": {"class": "ExecutorEnvironmentalVariables", "name": "getList", "signature": "List<Protos.Environment.Variable> getList()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<Protos.Environment.Variable>"}, "class_info": {"name": "ExecutorEnvironmentalVariables", "kind": "class", "modif... |
32834215_0 | class MvpBasePresenter implements MvpPresenter<V> {
@UiThread @Override public void attachView(V view) {
viewRef = new WeakReference<V>(view);
presenterDestroyed = false;
}
@Deprecated @UiThread public V getView();
@Deprecated @UiThread public boolean isViewAttached();
@Deprecated @UiThread @Overrid... | MvpBasePresenter<MvpView> presenter = new MvpBasePresenter<>();
MvpView mvpView = new MvpView() {
};
Assert.assertFalse(presenter.isViewAttached());
presenter.attachView(mvpView);
Assert.assertTrue(presenter.isViewAttached());
}
} | [FOCAL] @UiThread @Override public void MvpBasePresenter.attachView(V view)
[CLASS] class MvpBasePresenter implements MvpPresenter<V>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[NEW] WeakReference<V>
[DATAFLOW] view@param->L2
[CLASS-MEMBERS] V getView(); boolean isViewAttached(); void detachVi... | /* static context
[FOCAL] @UiThread @Override public void MvpBasePresenter.attachView(V view)
[NEW] WeakReference<V>
*/
| /* static context
[FOCAL] @UiThread @Override public void MvpBasePresenter.attachView(V view)
[NEW] WeakReference<V>
*/
class MvpBasePresenter implements MvpPresenter<V> {
@UiThread @Override public void attachView(V view) {
viewRef = new WeakReference<V>(view);
presenterDestroyed = false;
}
@Deprecated... | true | ok | {"focal": {"class": "MvpBasePresenter", "name": "attachView", "signature": "void attachView(V view)", "start_line": 3, "modifiers": "@UiThread @Override public", "params": [{"name": "view", "type": "V"}], "return_type": "void"}, "class_info": {"name": "MvpBasePresenter", "kind": "class", "modifiers": "", "superclass": ... |
32848140_150 | class UniverseUtil {
public UniverseQuery convertQuery(String text, UniverseClient client, String token)
throws UniverseException {
StringBuilder select = new StringBuilder();
StringBuilder universe = new StringBuilder();
StringBuilder buf = new StringBuilder();
StringBuilder resultObj = new St... | String request1 = "universe [testUniverse];\n" +
"select [Measure].[name5]\n" +
"where [Filter].[name3];";
String request2 = "universe [testUniverse];\n" +
"select [Measure].[name5]\n" +
"where [Measure].[name5] > 2 and [Filter].[name3];";
String request3 = "universe [testUni... | [FOCAL] public UniverseQuery UniverseUtil.convertQuery(String text, UniverseClient client, String token)
[CLASS] class UniverseUtil
[METRICS] loc=313 cc=67 branches=54 loops=3 returns=1 throws=3 nesting=11
[CALLS-INTERNAL] OptionalInt parseInt(String toParse); String parseResultObj(String resultObj, Map<String, Univers... | class UniverseUtil {
public UniverseQuery convertQuery(String text, UniverseClient client, String token)
throws UniverseException {
StringBuilder select = new StringBuilder();
StringBuilder universe = new StringBuilder();
StringBuilder buf = new StringBuilder();
StringBuilder resultObj = new St... | false | ok | {"focal": {"class": "UniverseUtil", "name": "convertQuery", "signature": "UniverseQuery convertQuery(String text, UniverseClient client, String token) throws UniverseException", "start_line": 3, "modifiers": "public", "params": [{"name": "text", "type": "String"}, {"name": "client", "type": "UniverseClient"}, {"name": ... | |
32870652_2 | class Window {
private void processSample() {
lastProcessedSpectrum = pushedSamples;
FFTSignalProcessing.ProcessingResult result = signalProcessing.processSample(window,
aWeighting, true);
// Move result by 1 backward
if(windowResults.length > 1) {
System... | final int sampleRate = 44100;
double p0 = 32767.;
double dbFsReference = -20 * Math.log10(p0);
// Reference spectrum
double[] refSpl = {-66, -68.04, -67.52, -45.97, -31.96, -37.13, -49.21, -35.29, -43.01,
-42.95, -48.65, -49.04, -53.27, -52.15, -52.65, -52.8, -52.... | [FOCAL] private void Window.processSample()
[CLASS] class Window
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] signalProcessing.processSample/3, System.arraycopy/5
[PATH1] if(windowResults.length > 1)=T
[PATH2] if(windowResults.length > 1)=F
[COLLABORATORS] field signalProcessin... | /* static context
[FOCAL] private void Window.processSample()
[PATH1] if(windowResults.length > 1)=T
[PATH2] if(windowResults.length > 1)=F
[COLLABORATORS] field signalProcessing processSample/3
[CALLS-EXTERNAL] signalProcessing.processSample/3, System.arraycopy/5
*/
| /* static context
[FOCAL] private void Window.processSample()
[PATH1] if(windowResults.length > 1)=T
[PATH2] if(windowResults.length > 1)=F
[COLLABORATORS] field signalProcessing processSample/3
[CALLS-EXTERNAL] signalProcessing.processSample/3, System.arraycopy/5
*/
class Window {
private void processSample() {
... | true | ok | {"focal": {"class": "Window", "name": "processSample", "signature": "void processSample()", "start_line": 3, "modifiers": "private", "params": [], "return_type": "void"}, "class_info": {"name": "Window", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "STANDARD_FREQUENCIES_... |
32895424_36 | class ListGcsBuckets {
public static void listGcsBuckets(String googleAccessKeyId, String googleAccessKeySecret) {
// String googleAccessKeyId = "your-google-access-key-id";
// String googleAccessKeySecret = "your-google-access-key-secret";
// Create a BasicAWSCredentials using Cloud Storage HMAC crede... | ListGcsBuckets.listGcsBuckets(KEY_ID, SECRET_KEY);
String output = bout.toString();
assertThat(output, CoreMatchers.containsString("Buckets:"));
}
} | [FOCAL] public static void ListGcsBuckets.listGcsBuckets(String googleAccessKeyId, String googleAccessKeySecret)
[CLASS] class ListGcsBuckets
[METRICS] loc=32 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] AmazonS3ClientBuilder.standard() .withEndpointConfigurati....build/0, AmazonS3ClientBuilder... | /* static context
[FOCAL] public static void ListGcsBuckets.listGcsBuckets(String googleAccessKeyId, String googleAccessKeySecret)
[PATH1] foreach(Bucket bucket : buckets)=T -> exit loop
[PATH2] foreach(Bucket bucket : buckets)=F
[INPUTS] branches=googleAccessKeyId, googleAccessKeySecret | result=-
[NEW] BasicAWSCreden... | /* static context
[FOCAL] public static void ListGcsBuckets.listGcsBuckets(String googleAccessKeyId, String googleAccessKeySecret)
[PATH1] foreach(Bucket bucket : buckets)=T -> exit loop
[PATH2] foreach(Bucket bucket : buckets)=F
[INPUTS] branches=googleAccessKeyId, googleAccessKeySecret | result=-
[NEW] BasicAWSCreden... | true | ok | {"focal": {"class": "ListGcsBuckets", "name": "listGcsBuckets", "signature": "void listGcsBuckets(String googleAccessKeyId, String googleAccessKeySecret)", "start_line": 3, "modifiers": "public static", "params": [{"name": "googleAccessKeyId", "type": "String"}, {"name": "googleAccessKeySecret", "type": "String"}], "re... |
32935706_259 | class NotificationManagerImpl extends BasePresenter implements NotificationManager,
NotificationItem.ActionDelegate,
Notification.NotificationObserver,
... | Notification notification = new Notification("test message", PROGRESS);
manager.showNotification(notification);
reset(view);
manager.onValueChanged();
verify(view).setNotificationCount(eq(1));
reset(view);
notification.setStatus(FINISHED);
reset(view);... | [FOCAL] @Override public void NotificationManagerImpl.onValueChanged()
[CLASS] class NotificationManagerImpl extends BasePresenter implements NotificationManager, NotificationItem.ActionDelegate, Notification.NotificationObserver, NotificationManagerView.ActionDelegate, NotificationMessageStack.ActionDelegate, HasView
... | /* static context
[FOCAL] @Override public void NotificationManagerImpl.onValueChanged()
[PATH1] foreach(Notification notification : notifications)=T -> if(!notification.isRead())=T -> if(!inProgress)=T -> exit loop
[PATH2] foreach(Notification notification : notifications)=T -> if(!notification.isRead())=F -> if(!inPr... | /* static context
[FOCAL] @Override public void NotificationManagerImpl.onValueChanged()
[PATH1] foreach(Notification notification : notifications)=T -> if(!notification.isRead())=T -> if(!inProgress)=T -> exit loop
[PATH2] foreach(Notification notification : notifications)=T -> if(!notification.isRead())=F -> if(!inPr... | true | ok | {"focal": {"class": "NotificationManagerImpl", "name": "onValueChanged", "signature": "void onValueChanged()", "start_line": 8, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "NotificationManagerImpl", "kind": "class", "modifiers": "", "superclass": "BasePresenter", "inter... |
32935729_404 | class DockerFileFactory {
@NotNull
public VirtualFile newInstance(@NotNull String href) {
return newInstance(href, NAME, PATH);
}
@Inject public DockerFileFactory(ProjectServiceClient projectServiceClient,
DtoFactory dtoFactory,
AppCon... | VirtualFile fileNode = factory.newInstance(SOME_TEXT);
verify(dtoFactory).createDto(Link.class);
verify(link).withHref(SOME_TEXT);
verify(link).withRel(GET_CONTENT);
verify(dtoFactory).createDto(ItemReference.class);
verify(itemReference).withName(NAME);
verify... | [FOCAL] @NotNull public VirtualFile DockerFileFactory.newInstance(String href)
[CLASS] class DockerFileFactory
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] VirtualFile newInstance(String href, String name, String path)
[INPUTS] branches=- | result=href
[DATAFLOW] href@param->L3
... | /* static context
[FOCAL] @NotNull public VirtualFile DockerFileFactory.newInstance(String href)
[INPUTS] branches=- | result=href
[CALLS-INTERNAL] VirtualFile newInstance(String href, String name, String path)
*/
| /* static context
[FOCAL] @NotNull public VirtualFile DockerFileFactory.newInstance(String href)
[INPUTS] branches=- | result=href
[CALLS-INTERNAL] VirtualFile newInstance(String href, String name, String path)
*/
class DockerFileFactory {
@NotNull
public VirtualFile newInstance(@NotNull String href) {
... | true | ok | {"focal": {"class": "DockerFileFactory", "name": "newInstance", "signature": "VirtualFile newInstance(String href)", "start_line": 3, "modifiers": "@NotNull public", "params": [{"name": "href", "type": "String"}], "return_type": "VirtualFile"}, "class_info": {"name": "DockerFileFactory", "kind": "class", "modifiers": "... |
32954678_11 | class Access {
public boolean isControlled() {
return CONTROLLED.equalsIgnoreCase(value);
}
public Access(String accessType);
public boolean isOpen();
public boolean isOther();
}
class AccessTest {
@Test
public void test_missing_access_type() {
| val sut = new Access("");
assertThat(sut.isControlled()).isTrue();
}
} | [FOCAL] public boolean Access.isControlled()
[CLASS] class Access
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] CONTROLLED.equalsIgnoreCase/1
[CLASS-MEMBERS] Access(String accessType); boolean isOpen(); boolean isOther()
[TEST] AccessTest: @Test public void test_missing_access_ty... | /* static context
[FOCAL] public boolean Access.isControlled()
[CALLS-EXTERNAL] CONTROLLED.equalsIgnoreCase/1
*/
| /* static context
[FOCAL] public boolean Access.isControlled()
[CALLS-EXTERNAL] CONTROLLED.equalsIgnoreCase/1
*/
class Access {
public boolean isControlled() {
return CONTROLLED.equalsIgnoreCase(value);
}
public Access(String accessType);
public boolean isOpen();
public boolean isOther();
}
class Ac... | true | ok | {"focal": {"class": "Access", "name": "isControlled", "signature": "boolean isControlled()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "Access", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Acc... |
32957224_43 | class ConfigurationAlgorithm {
public static void configure(final Definitions definitions) {
// Identify configured gateways
final Set<Gateway> reconfiguredGatewaySet = findConfiguredGateways(definitions);
// Find and remove absent sequence flows
prune(definitions, (Set) findAbsen... |
// Obtain the test document
Unmarshaller unmarshaller = context.createUnmarshaller();
unmarshaller.setProperty(IDResolver.class.getName(), new DefinitionsIDResolver());
Definitions definitions = (Definitions) unmarshaller.unmarshal(trivialGatewayFile);
// Exercise the method
... | [FOCAL] public static void ConfigurationAlgorithm.configure(Definitions definitions)
[CLASS] class ConfigurationAlgorithm
[METRICS] loc=19 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] Set<FlowElement> findOrphans(Definitions definitions); Set<Gateway> findConfiguredGateways(Definitions definiti... | /* static context
[FOCAL] public static void ConfigurationAlgorithm.configure(Definitions definitions)
[PATH1] foreach(Gateway gateway : reconfiguredGatewaySet)=T -> exit loop
[PATH2] foreach(Gateway gateway : reconfiguredGatewaySet)=F
[INPUTS] branches=definitions | result=-
[CALLS-INTERNAL] Set<FlowElement> findOrpha... | /* static context
[FOCAL] public static void ConfigurationAlgorithm.configure(Definitions definitions)
[PATH1] foreach(Gateway gateway : reconfiguredGatewaySet)=T -> exit loop
[PATH2] foreach(Gateway gateway : reconfiguredGatewaySet)=F
[INPUTS] branches=definitions | result=-
[CALLS-INTERNAL] Set<FlowElement> findOrpha... | true | ok | {"focal": {"class": "ConfigurationAlgorithm", "name": "configure", "signature": "void configure(Definitions definitions)", "start_line": 3, "modifiers": "public static", "params": [{"name": "definitions", "type": "Definitions"}], "return_type": "void"}, "class_info": {"name": "ConfigurationAlgorithm", "kind": "class", ... |
32975439_411 | class DistCpUtils {
public static void preserve(FileSystem targetFS, Path path,
CopyListingFileStatus srcFileStatus,
EnumSet<FileAttribute> attributes,
boolean preserveRawXattrs) throws IOException {
// If not preserving a... | FileSystem fs = FileSystem.get(config);
EnumSet<FileAttribute> attributes = EnumSet.noneOf(FileAttribute.class);
Path dst = new Path("/tmp/dest2");
Path src = new Path("/tmp/src2");
createFile(fs, src);
createFile(fs, dst);
fs.setPermission(src, fullPerm);
fs.setOwner(src, "somebody",... | [FOCAL] public static void DistCpUtils.preserve(FileSystem targetFS, Path path, CopyListingFileStatus srcFileStatus, EnumSet<FileAttribute> attributes, boolean preserveRawXattrs)
[CLASS] class DistCpUtils
[METRICS] loc=78 cc=14 branches=12 loops=1 returns=0 throws=0 nesting=4
[CALLS-INTERNAL] List<AclEntry> getAcl(File... | class DistCpUtils {
public static void preserve(FileSystem targetFS, Path path,
CopyListingFileStatus srcFileStatus,
EnumSet<FileAttribute> attributes,
boolean preserveRawXattrs) throws IOException {
// If not preserving a... | false | ok | {"focal": {"class": "DistCpUtils", "name": "preserve", "signature": "void preserve(FileSystem targetFS, Path path, CopyListingFileStatus srcFileStatus, EnumSet<FileAttribute> attributes, boolean preserveRawXattrs) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "targetFS", "type"... | |
32976823_59 | class RobotsFactory {
@Beta
@Nonnull
public Client createClient() {
Client client = ClientBuilder.newClient()
.register(new FollowRedirectsFilter(config.getMaxRedirectHops()))
.register(new HttpStatusHandler())
.register(new LoggingClientFilter(this.g... | Client client = factory.createClient();
assertThat(client, notNullValue());
}
} | [FOCAL] @Beta @Nonnull public Client RobotsFactory.createClient()
[CLASS] class RobotsFactory
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] ClientBuilder.newClient() .register(new FollowRedirectsFi....register/1, ClientBuilder.newClient().register/1, ClientBuilder.newClient/0, R... | /* static context
[FOCAL] @Beta @Nonnull public Client RobotsFactory.createClient()
[INPUTS] branches=- | result=config
[COLLABORATORS] field config:RobotsConfig getMaxRedirectHops/0,getReadTimeoutMillis/0
[FIELDS] read=config:RobotsConfig
[NEW] FollowRedirectsFilter, HttpStatusHandler, LoggingClientFilter
[CALLS-EXTER... | /* static context
[FOCAL] @Beta @Nonnull public Client RobotsFactory.createClient()
[INPUTS] branches=- | result=config
[COLLABORATORS] field config:RobotsConfig getMaxRedirectHops/0,getReadTimeoutMillis/0
[FIELDS] read=config:RobotsConfig
[NEW] FollowRedirectsFilter, HttpStatusHandler, LoggingClientFilter
[CALLS-EXTER... | true | ok | {"focal": {"class": "RobotsFactory", "name": "createClient", "signature": "Client createClient()", "start_line": 3, "modifiers": "@Beta @Nonnull public", "params": [], "return_type": "Client"}, "class_info": {"name": "RobotsFactory", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{... |
33024207_3 | class SequencingConcern extends ConcernOf<ShippingService> implements ShippingService {
@Override
public int makeBooking( Cargo cargo, Voyage voyage )
{
int ok = next.makeBooking( cargo, voyage );
if( ok < 0 )
{
return ok;
}
Property<Integer> gen = genera... | SingletonAssembler assembler = new SingletonAssembler(
module -> module.transients( ShippingServiceTestComposite.class )
);
ShippingService shippingService = createMock( ShippingService.class );
Cargo cargo = createMock( Cargo.class );
Voyage voyage = createMock( Voya... | [FOCAL] @Override public int SequencingConcern.makeBooking(Cargo cargo, Voyage voyage)
[CLASS] class SequencingConcern extends ConcernOf<ShippingService> implements ShippingService
[METRICS] loc=13 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] next.makeBooking/2, generator.sequence/0, Property<I... | /* static context
[FOCAL] @Override public int SequencingConcern.makeBooking(Cargo cargo, Voyage voyage)
[PATH1] if(ok < 0)=T -> return ok
[PATH2] if(ok < 0)=F -> return ok
[INPUTS] branches=cargo, voyage | result=cargo, voyage
[COLLABORATORS] field next makeBooking/2; field generator sequence/0
[CALLS-EXTERNAL] next.m... | /* static context
[FOCAL] @Override public int SequencingConcern.makeBooking(Cargo cargo, Voyage voyage)
[PATH1] if(ok < 0)=T -> return ok
[PATH2] if(ok < 0)=F -> return ok
[INPUTS] branches=cargo, voyage | result=cargo, voyage
[COLLABORATORS] field next makeBooking/2; field generator sequence/0
[CALLS-EXTERNAL] next.m... | true | ok | {"focal": {"class": "SequencingConcern", "name": "makeBooking", "signature": "int makeBooking(Cargo cargo, Voyage voyage)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "cargo", "type": "Cargo"}, {"name": "voyage", "type": "Voyage"}], "return_type": "int"}, "class_info": {"name": "SequencingCon... |
33030494_0 | class Queue {
public boolean isEmpty() {
return head == tail;
}
public Queue();
public Queue(int queueSize);
public void enqueue(Object element);
public Object dequeue();
public boolean isFull();
}
class QueueTest {
@Test
public void testIsEmpty() throws QueueOverflow... | Queue queue = new Queue();
Assert.assertTrue(queue.isEmpty());
queue.enqueue(1);
Assert.assertFalse(queue.isEmpty());
}
} | [FOCAL] public boolean Queue.isEmpty()
[CLASS] class Queue
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] Queue(); Queue(int queueSize); void enqueue(Object element); Object dequeue(); boolean isFull()
[TEST] QueueTest: @Test public void testIsEmpty() throws QueueOverflowException | /* static context
[FOCAL] public boolean Queue.isEmpty()
*/
| /* static context
[FOCAL] public boolean Queue.isEmpty()
*/
class Queue {
public boolean isEmpty() {
return head == tail;
}
public Queue();
public Queue(int queueSize);
public void enqueue(Object element);
public Object dequeue();
public boolean isFull();
}
class QueueTest {
... | true | ok | {"focal": {"class": "Queue", "name": "isEmpty", "signature": "boolean isEmpty()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "Queue", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Queue", "kind":... |
33046639_32 | class WiktionaryResource extends AbstractResource {
public boolean containsEntity(Entity entity) {
Set<WordEntry> entries = WiktionaryUtils.entityToWords(wkt, entity);
if (entries.size() == 0) {
return false;
}
else {
return true;
}
}
public ... | wiktionaryGerman.setIsCaseSensitive(true);
assertTrue("Auto", wiktionaryGerman.containsEntity(new Entity("Baum", Entity.PoS.n)));
assertTrue("Auto", wiktionaryGerman.containsEntity(new Entity("Auto", Entity.PoS.n)));
assertFalse("auto", wiktionaryGerman.containsEntity(new Entity("auto", Entity.PoS.n)));
asser... | [FOCAL] public boolean WiktionaryResource.containsEntity(Entity entity)
[CLASS] class WiktionaryResource extends AbstractResource
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] WiktionaryUtils.entityToWords/2, Set<WordEntry>.size/0
[PATH1] if(entries.size() == 0)=T -> return false... | /* static context
[FOCAL] public boolean WiktionaryResource.containsEntity(Entity entity)
[PATH1] if(entries.size() == 0)=T -> return false
[PATH2] if(entries.size() == 0)=F -> return true
[INPUTS] branches=entity | result=-
[CALLS-EXTERNAL] WiktionaryUtils.entityToWords/2, Set<WordEntry>.size/0
*/
| /* static context
[FOCAL] public boolean WiktionaryResource.containsEntity(Entity entity)
[PATH1] if(entries.size() == 0)=T -> return false
[PATH2] if(entries.size() == 0)=F -> return true
[INPUTS] branches=entity | result=-
[CALLS-EXTERNAL] WiktionaryUtils.entityToWords/2, Set<WordEntry>.size/0
*/
class WiktionaryReso... | true | ok | {"focal": {"class": "WiktionaryResource", "name": "containsEntity", "signature": "boolean containsEntity(Entity entity)", "start_line": 3, "modifiers": "public", "params": [{"name": "entity", "type": "Entity"}], "return_type": "boolean"}, "class_info": {"name": "WiktionaryResource", "kind": "class", "modifiers": "", "s... |
33052737_2 | class Page {
public static Page allPages() {
return new Page(ALL_PAGES, ALL_PAGES);
}
private Page(int start, int end);
public static Page singlePage(int page);
public static Page pageRange(int start, int end);
}
class PageTest {
@Test
public void testAllPages() throws Excepti... | Page page = Page.allPages();
assertTrue(page.start < 0);
assertTrue(page.end < 0);
assertEquals(page.start, page.end);
}
} | [FOCAL] public static Page Page.allPages()
[CLASS] class Page
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] Page
[CLASS-MEMBERS] Page(int start, int end); Page singlePage(int page); Page pageRange(int start, int end)
[TEST] PageTest: @Test public void testAllPages() throws Exception | /* static context
[FOCAL] public static Page Page.allPages()
[NEW] Page
*/
| /* static context
[FOCAL] public static Page Page.allPages()
[NEW] Page
*/
class Page {
public static Page allPages() {
return new Page(ALL_PAGES, ALL_PAGES);
}
private Page(int start, int end);
public static Page singlePage(int page);
public static Page pageRange(int start, int end);
}... | true | ok | {"focal": {"class": "Page", "name": "allPages", "signature": "Page allPages()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Page"}, "class_info": {"name": "Page", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Page", "kind":... |
33053071_10 | class LocalDBSessionFactory implements DBSessionFactory {
@Override
public DBSession createSession() throws JasDBException {
if(StringUtils.stringNotEmpty(instance)) {
return new LocalDBSession(instance);
} else {
return new LocalDBSession();
}
}
@Overri... | LocalDBSessionFactory localDBSessionFactory = new LocalDBSessionFactory();
localDBSessionFactory.createSession().addInstance("testInstance");
DBSession session = localDBSessionFactory.createSession("testInstance");
assertThat(session.getInstanceId(), is("testInstance"));
}
} | [FOCAL] @Override public DBSession LocalDBSessionFactory.createSession()
[CLASS] class LocalDBSessionFactory implements DBSessionFactory
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] StringUtils.stringNotEmpty/1
[NEW] LocalDBSession
[EXCEPTIONS] declares JasDBException
[PATH1] if... | /* static context
[FOCAL] @Override public DBSession LocalDBSessionFactory.createSession()
[PATH1] if(StringUtils.stringNotEmpty(instance))=T -> return new LocalDBSession(instance)
[PATH2] if(StringUtils.stringNotEmpty(instance))=F -> return new LocalDBSession()
[EXCEPTIONS] declares JasDBException
[NEW] LocalDBSession... | /* static context
[FOCAL] @Override public DBSession LocalDBSessionFactory.createSession()
[PATH1] if(StringUtils.stringNotEmpty(instance))=T -> return new LocalDBSession(instance)
[PATH2] if(StringUtils.stringNotEmpty(instance))=F -> return new LocalDBSession()
[EXCEPTIONS] declares JasDBException
[NEW] LocalDBSession... | true | ok | {"focal": {"class": "LocalDBSessionFactory", "name": "createSession", "signature": "DBSession createSession() throws JasDBException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "DBSession"}, "class_info": {"name": "LocalDBSessionFactory", "kind": "class", "modifiers": "", "superclass... |
33053133_7 | class MapperInfoHandler extends AnnotationHandlerBase {
@SuppressWarnings("rawtypes")
public void configureOutputKeyValue(Job job, Class<? extends Mapper> mapperClass,
MapperInfo map, boolean isMapOnly) {
MaraAnnotationUtil util = MaraAnnotationUtil.INSTANCE;
// Try and work it out from the generics
Type[]... | handler.configureOutputKeyValue(job, TestMapperSubclassTest.class, null, true);
verify(job).setMapOutputKeyClass(Text.class);
verify(job).setMapOutputValueClass(NullWritable.class);
verify(job).setOutputKeyClass(Text.class);
verify(job).setOutputValueClass(NullWritable.class);
}
} | [FOCAL] @SuppressWarnings("rawtypes") public void MapperInfoHandler.configureOutputKeyValue(Job job, Class<? extends Mapper> mapperClass, MapperInfo map, boolean isMapOnly)
[CLASS] class MapperInfoHandler extends AnnotationHandlerBase
[METRICS] loc=45 cc=10 branches=9 loops=0 returns=0 throws=0 nesting=3
[CALLS-EXTERNA... | /* static context
[FOCAL] @SuppressWarnings("rawtypes") public void MapperInfoHandler.configureOutputKeyValue(Job job, Class<? extends Mapper> mapperClass, MapperInfo map, boolean isMapOnly)
[PATH1] if(params != null && params.length == 2)=T -> if(map != null && map.output().key() != void.class)=F -> if(params != null ... | /* static context
[FOCAL] @SuppressWarnings("rawtypes") public void MapperInfoHandler.configureOutputKeyValue(Job job, Class<? extends Mapper> mapperClass, MapperInfo map, boolean isMapOnly)
[PATH1] if(params != null && params.length == 2)=T -> if(map != null && map.output().key() != void.class)=F -> if(params != null ... | true | ok | {"focal": {"class": "MapperInfoHandler", "name": "configureOutputKeyValue", "signature": "void configureOutputKeyValue(Job job, Class<? extends Mapper> mapperClass, MapperInfo map, boolean isMapOnly)", "start_line": 3, "modifiers": "@SuppressWarnings(\"rawtypes\") public", "params": [{"name": "job", "type": "Job"}, {"n... |
33075946_8 | class PathLengthComparator extends PathBasedComparator {
@Override
public double getSimilarity(Entity e1, Entity e2)
throws SimilarityException, LexicalSemanticResourceException
{
// entity overrides the equals method with a usable variant
if (e1.equals(e2)) {
return 0.0;
... | LexSemResourceComparator comparator = new PathLengthComparator(germanet);
Set<Entity> entitiesAuto = germanet.getEntity("Auto", PoS.n);
Set<Entity> entitiesBagger = germanet.getEntity("Bagger", PoS.n);
Set<Entity> entitiesSchnell = germanet.getEntity("schnell", PoS.adj);
assert... | [FOCAL] @Override public double PathLengthComparator.getSimilarity(Entity e1, Entity e2)
[CLASS] class PathLengthComparator extends PathBasedComparator
[METRICS] loc=17 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[CALLS-EXTERNAL] Entity.equals/1, getShortestPathLength/2 (inherited)
[EXCEPTIONS] declares Simila... | /* static context
[FOCAL] @Override public double PathLengthComparator.getSimilarity(Entity e1, Entity e2)
[PATH1] if(e1.equals(e2))=F -> if(convertToRelatedness)=T -> return (diameter - distance) / diameter
[PATH2] if(e1.equals(e2))=T -> return 0.0
[PATH3] if(e1.equals(e2))=F -> if(convertToRelatedness)=F -> return di... | /* static context
[FOCAL] @Override public double PathLengthComparator.getSimilarity(Entity e1, Entity e2)
[PATH1] if(e1.equals(e2))=F -> if(convertToRelatedness)=T -> return (diameter - distance) / diameter
[PATH2] if(e1.equals(e2))=T -> return 0.0
[PATH3] if(e1.equals(e2))=F -> if(convertToRelatedness)=F -> return di... | true | ok | {"focal": {"class": "PathLengthComparator", "name": "getSimilarity", "signature": "double getSimilarity(Entity e1, Entity e2) throws SimilarityException, LexicalSemanticResourceException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "e1", "type": "Entity"}, {"name": "e2", "type": "Entity"}], "... |
33082868_6 | class RecipientServiceImpl implements RecipientService {
@Override
public List<Recipient> findReadyToNotify(NotificationType type) {
switch (type) {
case BACKUP:
return repository.findReadyForBackup();
case REMIND:
return repository.findReadyForRemind();
default:
throw new IllegalArgumentExcep... | final List<Recipient> recipients = ImmutableList.of(new Recipient());
when(repository.findReadyForRemind()).thenReturn(recipients);
List<Recipient> found = recipientService.findReadyToNotify(NotificationType.REMIND);
assertEquals(recipients, found);
}
} | [FOCAL] @Override public List<Recipient> RecipientServiceImpl.findReadyToNotify(NotificationType type)
[CLASS] class RecipientServiceImpl implements RecipientService
[METRICS] loc=11 cc=3 branches=1 loops=0 returns=2 throws=1 nesting=1
[CALLS-EXTERNAL] RecipientRepository.findReadyForBackup/0, RecipientRepository.findR... | /* static context
[FOCAL] @Override public List<Recipient> RecipientServiceImpl.findReadyToNotify(NotificationType type)
[THROWS-WHEN] IllegalArgumentException when switch(type)=default
[PATH1] switch(type)=case BACKUP -> return repository.findReadyForBackup()
[PATH2] switch(type)=case REMIND -> return repository.findR... | /* static context
[FOCAL] @Override public List<Recipient> RecipientServiceImpl.findReadyToNotify(NotificationType type)
[THROWS-WHEN] IllegalArgumentException when switch(type)=default
[PATH1] switch(type)=case BACKUP -> return repository.findReadyForBackup()
[PATH2] switch(type)=case REMIND -> return repository.findR... | true | ok | {"focal": {"class": "RecipientServiceImpl", "name": "findReadyToNotify", "signature": "List<Recipient> findReadyToNotify(NotificationType type)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "type", "type": "NotificationType"}], "return_type": "List<Recipient>"}, "class_info": {"name": "Recipie... |
33100783_0 | class JarTransformer {
public void transform(@Nonnull ClassPath inputPath) throws IOException {
SCAN:
{
for (ClassPathArchive inputArchive : inputPath) {
LOG.debug("Scanning archive {}", inputArchive);
for (ClassPathResource inputResource : inputArchive)... | processor.setSkipManifest(true);
// processor.add(new PathFilterJarProcessor(Collections.singleton("META-INF/jarjar-testdata.properties")));
transformer.transform(classPath);
Method m = getMethod(outputFile, "org.anarres.jarjar.testdata.pkg0.Main", "main", String[].class);
m.inv... | [FOCAL] public void JarTransformer.transform(ClassPath inputPath)
[CLASS] class JarTransformer
[METRICS] loc=46 cc=8 branches=3 loops=4 returns=0 throws=0 nesting=4
[CALLS-INTERNAL] Transformable newTransformable(ClassPathResource inputResource); void addDirs(JarOutputStream outputJarStream, String name)
[CALLS-EXTERNA... | /* static context
[FOCAL] public void JarTransformer.transform(ClassPath inputPath)
[PATH1] foreach(ClassPathArchive inputArchive : inputPath)#1=T -> foreach(ClassPathResource inputResource : inputArchive)#1=F -> exit loop -> foreach(ClassPathArchive inputArchive : inputPath)#2=T -> foreach(ClassPathResource inputResou... | /* static context
[FOCAL] public void JarTransformer.transform(ClassPath inputPath)
[PATH1] foreach(ClassPathArchive inputArchive : inputPath)#1=T -> foreach(ClassPathResource inputResource : inputArchive)#1=F -> exit loop -> foreach(ClassPathArchive inputArchive : inputPath)#2=T -> foreach(ClassPathResource inputResou... | true | ok | {"focal": {"class": "JarTransformer", "name": "transform", "signature": "void transform(ClassPath inputPath) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "inputPath", "type": "ClassPath"}], "return_type": "void"}, "class_info": {"name": "JarTransformer", "kind": "class", "modifiers":... |
33119850_1 | class AlternateFreeRegexFileMatcher implements AlternateFileMatcher {
public boolean matches(@NotNull String filename) {
return names.contains(filename);
}
public AlternateFreeRegexFileMatcher(String currentFilename, AlternateConfiguration configuration);
public boolean canProcess();
@No... | // prepare test
AlternateConfiguration configuration = new AlternateConfiguration();
configuration.freeRegexActive = true;
configuration.genericRegexActive = false;
configuration.freeRegexItems.clear();
// java file finds Test and properties
configuration.freeRege... | [FOCAL] public boolean AlternateFreeRegexFileMatcher.matches(String filename)
[CLASS] class AlternateFreeRegexFileMatcher implements AlternateFileMatcher
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] names.contains/1
[INPUTS] branches=- | result=filename
[COLLABORATORS] field nam... | /* static context
[FOCAL] public boolean AlternateFreeRegexFileMatcher.matches(String filename)
[INPUTS] branches=- | result=filename
[COLLABORATORS] field names contains/1
[CALLS-EXTERNAL] names.contains/1
*/
| /* static context
[FOCAL] public boolean AlternateFreeRegexFileMatcher.matches(String filename)
[INPUTS] branches=- | result=filename
[COLLABORATORS] field names contains/1
[CALLS-EXTERNAL] names.contains/1
*/
class AlternateFreeRegexFileMatcher implements AlternateFileMatcher {
public boolean matches(@NotNull Str... | true | ok | {"focal": {"class": "AlternateFreeRegexFileMatcher", "name": "matches", "signature": "boolean matches(String filename)", "start_line": 3, "modifiers": "public", "params": [{"name": "filename", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "AlternateFreeRegexFileMatcher", "kind": "class", "modifi... |
33125888_3 | class BigIntegers {
public static BigInteger[] random(BigInteger from, BigInteger to, Random rnd, int size, int bits) {
InputValidation.begin()
.when(from == null, "from is null")
.when(to == null, "to is null")
.when(from != null && to != null && from.compareTo(to) >= 0, "from not less than to")
.when(... | BigInteger[] bigs = BigIntegers.random(
BigInteger.ZERO,
BigInteger.TEN,
new Random(),
1000,
4);
Set<BigInteger> numerals = new HashSet<BigInteger>(Arrays.asList(bigs));
Set<BigInteger> expected = new HashSet<BigInteger>(Arrays.asList(
BigInteger.valueOf(0),
BigInteger.valueOf(1),
... | [FOCAL] public static BigInteger[] BigIntegers.random(BigInteger from, BigInteger to, Random rnd, int size, int bits)
[CLASS] class BigIntegers
[METRICS] loc=15 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] InputValidation.begin() .when(from == null, "from is null....validate/0, InputValidation.... | /* static context
[FOCAL] public static BigInteger[] BigIntegers.random(BigInteger from, BigInteger to, Random rnd, int size, int bits)
[PATH1] for(i < bigs.length)=T -> exit loop -> return bigs
[PATH2] for(i < bigs.length)=F -> return bigs
[INPUTS] branches=size | result=size
[COLLABORATORS] param from:BigInteger comp... | /* static context
[FOCAL] public static BigInteger[] BigIntegers.random(BigInteger from, BigInteger to, Random rnd, int size, int bits)
[PATH1] for(i < bigs.length)=T -> exit loop -> return bigs
[PATH2] for(i < bigs.length)=F -> return bigs
[INPUTS] branches=size | result=size
[COLLABORATORS] param from:BigInteger comp... | true | ok | {"focal": {"class": "BigIntegers", "name": "random", "signature": "BigInteger[] random(BigInteger from, BigInteger to, Random rnd, int size, int bits)", "start_line": 3, "modifiers": "public static", "params": [{"name": "from", "type": "BigInteger"}, {"name": "to", "type": "BigInteger"}, {"name": "rnd", "type": "Random... |
33135232_0 | class CollectionSizer {
public static int getCollectionSize( String range, int collectionSize )
{
int min = Integer.parseInt( range.split( "-" )[0] );
int max = Integer.parseInt( range.split( "-" )[1] );
if ( min == 0 && max == 0 )
{
return 0;
}
if ( ... | assertThat( CollectionSizer.getCollectionSize( "1-10", 20 ) ).isBetween( 0, 9 );
assertThat( CollectionSizer.getCollectionSize( "1-10", 5 ) ).isBetween( 0, 4 );
assertThat( CollectionSizer.getCollectionSize( "0-0", 5 ) ).isEqualTo( 0 );
assertThat( CollectionSizer.getCollectionSize( "10-... | [FOCAL] public static int CollectionSizer.getCollectionSize(String range, int collectionSize)
[CLASS] class CollectionSizer
[METRICS] loc=18 cc=4 branches=3 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] Integer.parseInt/1, String.split/1, ints().rangeClosed( min, max ).get/0, ints().rangeClosed/2, ints/0 (inher... | /* static context
[FOCAL] public static int CollectionSizer.getCollectionSize(String range, int collectionSize)
[PATH1] if(min == 0 && max == 0)=F -> if(min > collectionSize)=T -> if(max > collectionSize)=T -> return min == max ? min : ints().rangeClosed( min, max ).get() - 1
[PATH2] if(min == 0 && max == 0)=T -> retur... | /* static context
[FOCAL] public static int CollectionSizer.getCollectionSize(String range, int collectionSize)
[PATH1] if(min == 0 && max == 0)=F -> if(min > collectionSize)=T -> if(max > collectionSize)=T -> return min == max ? min : ints().rangeClosed( min, max ).get() - 1
[PATH2] if(min == 0 && max == 0)=T -> retur... | true | ok | {"focal": {"class": "CollectionSizer", "name": "getCollectionSize", "signature": "int getCollectionSize(String range, int collectionSize)", "start_line": 3, "modifiers": "public static", "params": [{"name": "range", "type": "String"}, {"name": "collectionSize", "type": "int"}], "return_type": "int"}, "class_info": {"na... |
33147632_256 | class LoggingCallback extends Callback<T> {
@Override
public void failure(TwitterException exception) {
logger.e(TweetUi.LOGTAG, exception.getMessage(), exception);
if (cb != null) {
cb.failure(exception);
}
}
LoggingCallback(Callback cb, Logger logger);
stat... | final Callback<Tweet> developerCallback = mock(Callback.class);
final Logger logger = mock(Logger.class);
final LoggingCallback<Tweet> cb = new TestLoggingCallback<>(developerCallback, logger);
cb.failure(new TwitterException(TEST_MESSAGE));
verify(logger).e(any(String.class), an... | [FOCAL] @Override public void LoggingCallback.failure(TwitterException exception)
[CLASS] class LoggingCallback extends Callback<T>
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] logger.e/3, TwitterException.getMessage/0, cb.failure/1
[PATH1] if(cb != null)=T
[PATH2] if(cb != null... | /* static context
[FOCAL] @Override public void LoggingCallback.failure(TwitterException exception)
[PATH1] if(cb != null)=T
[PATH2] if(cb != null)=F
[COLLABORATORS] param exception:TwitterException getMessage/0; field cb failure/1
[CALLS-EXTERNAL] logger.e/3, TwitterException.getMessage/0, cb.failure/1
*/
| /* static context
[FOCAL] @Override public void LoggingCallback.failure(TwitterException exception)
[PATH1] if(cb != null)=T
[PATH2] if(cb != null)=F
[COLLABORATORS] param exception:TwitterException getMessage/0; field cb failure/1
[CALLS-EXTERNAL] logger.e/3, TwitterException.getMessage/0, cb.failure/1
*/
class Loggin... | true | ok | {"focal": {"class": "LoggingCallback", "name": "failure", "signature": "void failure(TwitterException exception)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "exception", "type": "TwitterException"}], "return_type": "void"}, "class_info": {"name": "LoggingCallback", "kind": "class", "modifier... |
33194850_3 | class RestClient {
public ApiVersion getApiVersion()
throws IOException, ServerIOException {
return cloudApi.getApiVersion();
}
public RestClient(final Credentials credentials);
public RestClient(final Credentials credentials, final OkHttpClient client);
public RestClient(fi... | ApiVersion apiVersion = client.getApiVersion();
logger.info("apiVersion: " + apiVersion);
assertThat(apiVersion.getBuild(), not(isEmptyOrNullString()));
assertTrue("2.12.22".equalsIgnoreCase(apiVersion.getBuild()));
assertTrue("v1".equalsIgnoreCase(apiVersion.getApiVersion()));
... | [FOCAL] public ApiVersion RestClient.getApiVersion()
[CLASS] class RestClient
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] cloudApi.getApiVersion/0
[EXCEPTIONS] declares IOException, ServerIOException
[COLLABORATORS] field cloudApi getApiVersion/0
[CLASS-MEMBERS] RestClient(Cred... | /* static context
[FOCAL] public ApiVersion RestClient.getApiVersion()
[COLLABORATORS] field cloudApi getApiVersion/0
[EXCEPTIONS] declares IOException, ServerIOException
[CALLS-EXTERNAL] cloudApi.getApiVersion/0
*/
| /* static context
[FOCAL] public ApiVersion RestClient.getApiVersion()
[COLLABORATORS] field cloudApi getApiVersion/0
[EXCEPTIONS] declares IOException, ServerIOException
[CALLS-EXTERNAL] cloudApi.getApiVersion/0
*/
class RestClient {
public ApiVersion getApiVersion()
throws IOException, ServerIOExcept... | true | ok | {"focal": {"class": "RestClient", "name": "getApiVersion", "signature": "ApiVersion getApiVersion() throws IOException, ServerIOException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "ApiVersion"}, "class_info": {"name": "RestClient", "kind": "class", "modifiers": "", "superclass": null, "inte... |
33263136_2 | class MetricCollectorResource {
@POST
@Consumes({MediaType.APPLICATION_JSON})
public Response doPost(
List<Map<String, Object>> events,
@QueryParam(_CLUSTER) final String cluster
) throws IOException
{
if (Strings.isNullOrEmpty(cluster)) {
return Response.status(Response.Status.BAD_REQ... | List<Map<String, Object>> in = buildTestEvent("xxx");
Response resp = resource.doPost(in, TEST_CLUSTER);
Assert.assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), resp.getStatus());
}
} | [FOCAL] @POST @Consumes({MediaType.APPLICATION_JSON}) public Response MetricCollectorResource.doPost(List<Map<String, Object>> events, String cluster)
[CLASS] class MetricCollectorResource
[METRICS] loc=73 cc=6 branches=3 loops=1 returns=5 throws=0 nesting=2
[CALLS-EXTERNAL] Strings.isNullOrEmpty/1, Response.status(Res... | /* static context
[FOCAL] @POST @Consumes({MediaType.APPLICATION_JSON}) public Response MetricCollectorResource.doPost(List<Map<String, Object>> events, String cluster)
[PATH1] if(Strings.isNullOrEmpty(cluster))=F -> if(events == null || events.isEmpty())=F -> foreach(Map<String, Object> event : events)=T -> if(feedNam... | /* static context
[FOCAL] @POST @Consumes({MediaType.APPLICATION_JSON}) public Response MetricCollectorResource.doPost(List<Map<String, Object>> events, String cluster)
[PATH1] if(Strings.isNullOrEmpty(cluster))=F -> if(events == null || events.isEmpty())=F -> foreach(Map<String, Object> event : events)=T -> if(feedNam... | true | ok | {"focal": {"class": "MetricCollectorResource", "name": "doPost", "signature": "Response doPost(List<Map<String, Object>> events, String cluster) throws IOException", "start_line": 3, "modifiers": "@POST @Consumes({MediaType.APPLICATION_JSON}) public", "params": [{"name": "events", "type": "List<Map<String, Object>>"}, ... |
33272606_2 | class Graph implements GraphInterface {
@Override
public boolean equals(Object obj) {
if (obj == null)
return false;
if (obj == this)
return true;
if (obj.getClass() != this.getClass())
return false;
Graph b = (Graph) obj;
return nodeSet.equals(b.getAllNodes()) && getAllEdges().equals(b.getAllE... | Graph testGraphCopy = copyGraph();
AB.setAttribute("label", "BA");
assertFalse(testGraph.equals(testGraphCopy));
}
} | [FOCAL] @Override public boolean Graph.equals(Object obj)
[CLASS] class Graph implements GraphInterface
[METRICS] loc=12 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=1
[CALLS-INTERNAL] Set<EdgeInterface> getAllEdges()
[CALLS-EXTERNAL] Object.getClass/0, this.getClass/0, nodeSet.equals/1, Graph.getAllNodes/0, getA... | /* static context
[FOCAL] @Override public boolean Graph.equals(Object obj)
[PATH1] if(obj == null)=F -> if(obj == this)=F -> if(obj.getClass() != this.getClass())=T -> return false
[PATH2] if(obj == null)=F -> if(obj == this)=T -> return true
[PATH3] if(obj == null)=F -> if(obj == this)=F -> if(obj.getClass() != this.... | /* static context
[FOCAL] @Override public boolean Graph.equals(Object obj)
[PATH1] if(obj == null)=F -> if(obj == this)=F -> if(obj.getClass() != this.getClass())=T -> return false
[PATH2] if(obj == null)=F -> if(obj == this)=T -> return true
[PATH3] if(obj == null)=F -> if(obj == this)=F -> if(obj.getClass() != this.... | true | ok | {"focal": {"class": "Graph", "name": "equals", "signature": "boolean equals(Object obj)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "obj", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "Graph", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Graph... |
33314734_92 | class CustomExceptionHandler implements Thread.UncaughtExceptionHandler {
Map<String, StoredException> getStoredExceptions(){
if(exceptionPersister != null) {
return exceptionPersister.loadAll();
} else {
return null;
}
}
CustomExceptionHandler(Context con... | ExceptionPersister mockExceptionPersister = mock(ExceptionPersister.class);
CustomExceptionHandler customExceptionHandler = new CustomExceptionHandler(null, null, false);
customExceptionHandler.exceptionPersister = mockExceptionPersister;
customExceptionHandler.getStoredExceptions();
... | [FOCAL] Map<String, StoredException> CustomExceptionHandler.getStoredExceptions()
[CLASS] class CustomExceptionHandler implements Thread.UncaughtExceptionHandler
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] exceptionPersister.loadAll/0
[PATH1] if(exceptionPersister != null)=T ->... | /* static context
[FOCAL] Map<String, StoredException> CustomExceptionHandler.getStoredExceptions()
[PATH1] if(exceptionPersister != null)=T -> return exceptionPersister.loadAll()
[PATH2] if(exceptionPersister != null)=F -> return null
[COLLABORATORS] field exceptionPersister loadAll/0
[CALLS-EXTERNAL] exceptionPersist... | /* static context
[FOCAL] Map<String, StoredException> CustomExceptionHandler.getStoredExceptions()
[PATH1] if(exceptionPersister != null)=T -> return exceptionPersister.loadAll()
[PATH2] if(exceptionPersister != null)=F -> return null
[COLLABORATORS] field exceptionPersister loadAll/0
[CALLS-EXTERNAL] exceptionPersist... | true | ok | {"focal": {"class": "CustomExceptionHandler", "name": "getStoredExceptions", "signature": "Map<String, StoredException> getStoredExceptions()", "start_line": 3, "modifiers": "", "params": [], "return_type": "Map<String, StoredException>"}, "class_info": {"name": "CustomExceptionHandler", "kind": "class", "modifiers": "... |
33324205_6 | class PlainOntologyIdStoreConfiguration extends ResourceLoader implements
OntologyIdStoreConfiguration {
@Override
public Map<String, OntologyIdInfo> getInfos() {
return Collections.unmodifiableMap(infos);
}
@Inject PlainOntologyIdStoreConfiguration(@Named("PlainOntologyIdStoreConfigurationResource") String ... | String longPattern = "long:00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
String storeConfig = "testOntologyName \t foo:000000 \t 41 \t 48 ... | [FOCAL] @Override public Map<String, OntologyIdInfo> PlainOntologyIdStoreConfiguration.getInfos()
[CLASS] class PlainOntologyIdStoreConfiguration extends ResourceLoader implements OntologyIdStoreConfiguration
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Collections.unmodifiableM... | /* static context
[FOCAL] @Override public Map<String, OntologyIdInfo> PlainOntologyIdStoreConfiguration.getInfos()
[CALLS-EXTERNAL] Collections.unmodifiableMap/1
*/
| /* static context
[FOCAL] @Override public Map<String, OntologyIdInfo> PlainOntologyIdStoreConfiguration.getInfos()
[CALLS-EXTERNAL] Collections.unmodifiableMap/1
*/
class PlainOntologyIdStoreConfiguration extends ResourceLoader implements
OntologyIdStoreConfiguration {
@Override
public Map<String, OntologyIdInfo>... | true | ok | {"focal": {"class": "PlainOntologyIdStoreConfiguration", "name": "getInfos", "signature": "Map<String, OntologyIdInfo> getInfos()", "start_line": 4, "modifiers": "@Override public", "params": [], "return_type": "Map<String, OntologyIdInfo>"}, "class_info": {"name": "PlainOntologyIdStoreConfiguration", "kind": "class", ... |
33360686_25 | class AnnotationHelper {
public ReturnType extractReturnType(final Method annotatedMethod) {
EdmFunctionImport functionImport = annotatedMethod.getAnnotation(EdmFunctionImport.class);
ReturnType returnType = new ReturnType();
if (functionImport.returnType().isCollection()) {
returnType.setMultiplic... | Method method = FunctionExecutor.class.getMethod("findNames", String.class);
ReturnType returnType = annotationHelper.extractReturnType(method);
Assert.assertEquals("Names", returnType.getTypeName().getName());
}
} | [FOCAL] public ReturnType AnnotationHelper.extractReturnType(Method annotatedMethod)
[CLASS] class AnnotationHelper
[METRICS] loc=28 cc=5 branches=2 loops=0 returns=1 throws=1 nesting=1
[CALLS-INTERNAL] Class<?> determineAnnotatedClass(EdmFunctionImport functionImport, Method annotatedMethod); EdmSimpleTypeKind mapType... | /* static context
[FOCAL] public ReturnType AnnotationHelper.extractReturnType(Method annotatedMethod)
[THROWS-WHEN] UnsupportedOperationException when functionImport.returnType().isCollection() && switch(functionImport.returnType().type())=default
[INPUTS] branches=annotatedMethod | result=annotatedMethod
*/
| /* static context
[FOCAL] public ReturnType AnnotationHelper.extractReturnType(Method annotatedMethod)
[THROWS-WHEN] UnsupportedOperationException when functionImport.returnType().isCollection() && switch(functionImport.returnType().type())=default
[INPUTS] branches=annotatedMethod | result=annotatedMethod
*/
class Ann... | true | ok | {"focal": {"class": "AnnotationHelper", "name": "extractReturnType", "signature": "ReturnType extractReturnType(Method annotatedMethod)", "start_line": 3, "modifiers": "public", "params": [{"name": "annotatedMethod", "type": "Method"}], "return_type": "ReturnType"}, "class_info": {"name": "AnnotationHelper", "kind": "c... |
33374862_1 | class SomeClass {
public String saySomething()
{
return "Hello World!";
}
}
class SomeClassTest {
@Test
public void testDoSomething()
{
| SomeClass sc = new SomeClass();
Assert.assertEquals("Hello World!", sc.saySomething());
}
} | [FOCAL] public String SomeClass.saySomething()
[CLASS] class SomeClass
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[TEST] SomeClassTest: @Test public void testDoSomething() | /* static context
[FOCAL] public String SomeClass.saySomething()
*/
| /* static context
[FOCAL] public String SomeClass.saySomething()
*/
class SomeClass {
public String saySomething()
{
return "Hello World!";
}
}
class SomeClassTest {
@Test
public void testDoSomething()
{
| true | ok | {"focal": {"class": "SomeClass", "name": "saySomething", "signature": "String saySomething()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "SomeClass", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": []}, "ast"... |
33383826_25 | class InMemoryPermissionsImpl implements PermissionsInterface {
@Override
public boolean isSharing(User user) {
final String userKey = userKey(user);
return user.getEntries().stream().anyMatch(e -> {
if (e instanceof Workflow) {
final Map<String, Role> map = resource... | // Nothing shared at all
Assert.assertFalse(inMemoryPermissions.isSharing(johnDoeUser));
// Share with Jane
final Permission permission = new Permission("jane", Role.OWNER);
inMemoryPermissions.setPermission(johnDoeUser, fooWorkflow, permission);
Assert.assertTrue(inMemo... | [FOCAL] @Override public boolean InMemoryPermissionsImpl.isSharing(User user)
[CLASS] class InMemoryPermissionsImpl implements PermissionsInterface
[METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] String userKey(User user)
[CALLS-EXTERNAL] user.getEntries().stream().anyMatch/1, use... | /* static context
[FOCAL] @Override public boolean InMemoryPermissionsImpl.isSharing(User user)
[INPUTS] branches=- | result=user
[COLLABORATORS] param user:User getEntries/0; field resourceToUsersAndRolesMap get/1
[CALLS-INTERNAL] String userKey(User user)
[CALLS-EXTERNAL] user.getEntries().stream().anyMatch/1, user.g... | /* static context
[FOCAL] @Override public boolean InMemoryPermissionsImpl.isSharing(User user)
[INPUTS] branches=- | result=user
[COLLABORATORS] param user:User getEntries/0; field resourceToUsersAndRolesMap get/1
[CALLS-INTERNAL] String userKey(User user)
[CALLS-EXTERNAL] user.getEntries().stream().anyMatch/1, user.g... | true | ok | {"focal": {"class": "InMemoryPermissionsImpl", "name": "isSharing", "signature": "boolean isSharing(User user)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "user", "type": "User"}], "return_type": "boolean"}, "class_info": {"name": "InMemoryPermissionsImpl", "kind": "class", "modifiers": "", ... |
33397227_35 | class NMHeartBeatHandler extends BaseInterceptor {
@Override
public void beforeRMNodeEventHandled(RMNodeEvent event, RMContext context) {
switch (event.getType()) {
case STARTED:
// Since the RMNode was just started, it should not have a non-zero capacity
RMNode rmNode = context.getRMNode... | resetNodeTotalCapability(nodeOne, 0, 0);
resetNodeTotalCapability(nodeTwo, 2, 512);
Offer offerOne = TestObjectFactory.getOffer("localhost-one", "slave-one", "mock", "offer-one", 1.0, 512.0);
Offer offerTwo = TestObjectFactory.getOffer("localhost-two", "slave-two", "mock", "offer-two", 3.0, 1024.0);
... | [FOCAL] @Override public void NMHeartBeatHandler.beforeRMNodeEventHandled(RMNodeEvent event, RMContext context)
[CLASS] class NMHeartBeatHandler extends BaseInterceptor
[METRICS] loc=25 cc=4 branches=2 loops=0 returns=0 throws=0 nesting=2
[CALLS-INTERNAL] boolean isNonZeroCapacityNode(RMNode node); void handleStatusUpd... | /* static context
[FOCAL] @Override public void NMHeartBeatHandler.beforeRMNodeEventHandled(RMNodeEvent event, RMContext context)
[PATH1] switch(event.getType())=case STARTED -> if(isNonZeroCapacityNode(rmNode))=T
[PATH2] switch(event.getType())=case STATUS_UPDATE
[PATH3] switch(event.getType())=default
[PATH4] switch(... | /* static context
[FOCAL] @Override public void NMHeartBeatHandler.beforeRMNodeEventHandled(RMNodeEvent event, RMContext context)
[PATH1] switch(event.getType())=case STARTED -> if(isNonZeroCapacityNode(rmNode))=T
[PATH2] switch(event.getType())=case STATUS_UPDATE
[PATH3] switch(event.getType())=default
[PATH4] switch(... | true | ok | {"focal": {"class": "NMHeartBeatHandler", "name": "beforeRMNodeEventHandled", "signature": "void beforeRMNodeEventHandled(RMNodeEvent event, RMContext context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "event", "type": "RMNodeEvent"}, {"name": "context", "type": "RMContext"}], "return_type... |
33401991_77 | class RestoCardViewHolder extends CardViewHolder {
@Override
public void populate(Card card) {
super.populate(card);
RestoMenuCard menuCard = card.checkCard(Card.Type.RESTO);
RestoMenu menu = menuCard.getRestoMenu();
RestoChoice choice = menuCard.getRestoChoice();
Strin... | View view = inflate(activityContext, R.layout.home_card_resto);
RestoCardViewHolder viewHolder = new RestoCardViewHolder(view, adapter);
RestoMenuCard card = generate(RestoMenuCard.class);
viewHolder.populate(card);
MenuTable table = view.findViewById(R.id.menu_table);
R... | [FOCAL] @Override public void RestoCardViewHolder.populate(Card card)
[CLASS] class RestoCardViewHolder extends CardViewHolder
[METRICS] loc=24 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] CardViewHolder.populate/1, Card.checkCard/1, RestoMenuCard.getRestoMenu/0, RestoMenuCard.getRestoChoice/0,... | /* static context
[FOCAL] @Override public void RestoCardViewHolder.populate(Card card)
[COLLABORATORS] param card:Card checkCard/1; field itemView getResources/0,getContext/0,setOnClickListener/1; field toolbar setTitle/1,getContext/0; field table setMenu/2
[NEW] Intent
[CALLS-EXTERNAL] CardViewHolder.populate/1, Card... | /* static context
[FOCAL] @Override public void RestoCardViewHolder.populate(Card card)
[COLLABORATORS] param card:Card checkCard/1; field itemView getResources/0,getContext/0,setOnClickListener/1; field toolbar setTitle/1,getContext/0; field table setMenu/2
[NEW] Intent
[CALLS-EXTERNAL] CardViewHolder.populate/1, Card... | true | ok | {"focal": {"class": "RestoCardViewHolder", "name": "populate", "signature": "void populate(Card card)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "card", "type": "Card"}], "return_type": "void"}, "class_info": {"name": "RestoCardViewHolder", "kind": "class", "modifiers": "", "superclass": "C... |
33453737_3 | class DocumentOutputUtil {
public static String getIframeAdminContentWrapperTemplate() throws IOException {
try (InputStream templateStream =
DocumentOutputUtil.class.getClassLoader().getResourceAsStream(IFRAME_CONTENT_WRAPPER_TEMPLATE_PATH)) {
return IOUtils.toString(templ... |
String iframeTemplate = DocumentOutputUtil.getIframeAdminContentWrapperTemplate();
Document document = Jsoup.parse(iframeTemplate, "testBase");
// assert that there is iframeElement and that it uses the expeted context variables
Elements wrapperElement = document.select("div");
... | [FOCAL] public static String DocumentOutputUtil.getIframeAdminContentWrapperTemplate()
[CLASS] class DocumentOutputUtil
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] DocumentOutputUtil.class.getClassLoader().getResourceAsStream/1, DocumentOutputUtil.class.getClassLoader/0, IOUtil... | /* static context
[FOCAL] public static String DocumentOutputUtil.getIframeAdminContentWrapperTemplate()
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] DocumentOutputUtil.class.getClassLoader().getResourceAsStream/1, DocumentOutputUtil.class.getClassLoader/0, IOUtils.toString/2
*/
| /* static context
[FOCAL] public static String DocumentOutputUtil.getIframeAdminContentWrapperTemplate()
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] DocumentOutputUtil.class.getClassLoader().getResourceAsStream/1, DocumentOutputUtil.class.getClassLoader/0, IOUtils.toString/2
*/
class DocumentOutputUtil {
pu... | true | ok | {"focal": {"class": "DocumentOutputUtil", "name": "getIframeAdminContentWrapperTemplate", "signature": "String getIframeAdminContentWrapperTemplate() throws IOException", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "String"}, "class_info": {"name": "DocumentOutputUtil", "kind": "class", ... |
33492382_4 | class App implements Parcelable, Comparable<App> {
public boolean matches(String filter) {
return filter != null && title.contains(filter);
}
public App(String title);
private App(Parcel in);
@Override public int compareTo(App app);
@Override public boolean equals(Object o);
@Ov... | // Given
App app = new App("MyTitle");
// When
boolean result = app.matches("");
// Then
assertThat(result).isTrue();
}
} | [FOCAL] public boolean App.matches(String filter)
[CLASS] class App implements Parcelable, Comparable<App>
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] title.contains/1
[INPUTS] branches=- | result=filter
[COLLABORATORS] field title contains/1
[DATAFLOW] filter@param->L2
[CLASS-... | /* static context
[FOCAL] public boolean App.matches(String filter)
[INPUTS] branches=- | result=filter
[COLLABORATORS] field title contains/1
[CALLS-EXTERNAL] title.contains/1
*/
| /* static context
[FOCAL] public boolean App.matches(String filter)
[INPUTS] branches=- | result=filter
[COLLABORATORS] field title contains/1
[CALLS-EXTERNAL] title.contains/1
*/
class App implements Parcelable, Comparable<App> {
public boolean matches(String filter) {
return filter != null && title.conta... | true | ok | {"focal": {"class": "App", "name": "matches", "signature": "boolean matches(String filter)", "start_line": 3, "modifiers": "public", "params": [{"name": "filter", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "App", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Parcelable,... |
33500369_8 | class Person {
public String getName() {
return name;
}
public Person(String name);
}
class PersonTest {
@Test
public void canConstructAPersonWithAName() {
| Person person = new Person("Harry");
assertEquals("Harry", person.getName());
}
} | [FOCAL] public String Person.getName()
[CLASS] class Person
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] Person(String name)
[TEST] PersonTest: @Test public void canConstructAPersonWithAName() | /* static context
[FOCAL] public String Person.getName()
*/
| /* static context
[FOCAL] public String Person.getName()
*/
class Person {
public String getName() {
return name;
}
public Person(String name);
}
class PersonTest {
@Test
public void canConstructAPersonWithAName() {
| true | ok | {"focal": {"class": "Person", "name": "getName", "signature": "String getName()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "Person", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Person", "kind"... |
33547254_5 | class ExceptionProcessorImpl implements ExceptionProcessor {
@Override
public <T extends Exception> InternalResponse<Object> process(final T ex,
final InternalRequest<Object> req,
... | ApplicationContextImpl context = getApplicationContextWithBody();
ResponseStub response = new ResponseStub();
response.setOutputStream(new ByteArrayOutputStream());
RequestStub request = new RequestStub();
request.setAccept(singletonList(PLAIN_TEXT));
Map<HeaderName, St... | [FOCAL] @Override public InternalResponse<Object> ExceptionProcessorImpl.process(T ex, InternalRequest<Object> req, InternalResponse<Object> resp)
[CLASS] class ExceptionProcessorImpl implements ExceptionProcessor
[METRICS] loc=15 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] Optional<InternalEx... | /* static context
[FOCAL] @Override public InternalResponse<Object> ExceptionProcessorImpl.process(T ex, InternalRequest<Object> req, InternalResponse<Object> resp)
[PATH1] if(isNull(handler))=T -> return resp
[PATH2] if(isNull(handler))=F -> return resp
[INPUTS] branches=ex | result=resp
[COLLABORATORS] param ex:T get... | /* static context
[FOCAL] @Override public InternalResponse<Object> ExceptionProcessorImpl.process(T ex, InternalRequest<Object> req, InternalResponse<Object> resp)
[PATH1] if(isNull(handler))=T -> return resp
[PATH2] if(isNull(handler))=F -> return resp
[INPUTS] branches=ex | result=resp
[COLLABORATORS] param ex:T get... | true | ok | {"focal": {"class": "ExceptionProcessorImpl", "name": "process", "signature": "InternalResponse<Object> process(T ex, InternalRequest<Object> req, InternalResponse<Object> resp) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "ex", "type": "T"}, {"name": "req", "type": "Internal... |
33547660_1 | class Naming {
public static boolean isQname(String s) {
int len = s.length();
if (len == 0)
return false;
if (!isNameStartCharNs(s.charAt(0)))
return false;
for (int i = 1; i < len; i++) {
char c = s.charAt(i);
if (!isNameCharNs(c)) {
if (c == ':' && ++i < len && isNa... | Assert.assertFalse(Naming.isQname("foo::"));
}
} | [FOCAL] public static boolean Naming.isQname(String s)
[CLASS] class Naming
[METRICS] loc=20 cc=8 branches=5 loops=2 returns=6 throws=0 nesting=5
[CALLS-INTERNAL] boolean isNameCharNs(char c); boolean isNameStartCharNs(char c)
[CALLS-EXTERNAL] String.length/0, String.charAt/1
[PATH1] if(len == 0)=F -> if(!isNameStartCh... | /* static context
[FOCAL] public static boolean Naming.isQname(String s)
[PATH1] if(len == 0)=F -> if(!isNameStartCharNs(s.charAt(0)))=F -> for(i < len)#1=T -> if(!isNameCharNs(c))=T -> if(c == ':' && ++i < len && isNameStartCharNs(s.charAt(i)))=T -> for(i < len)#2=T -> if(!isNameCharNs(s.charAt(i)))=F -> exit loop -> ... | /* static context
[FOCAL] public static boolean Naming.isQname(String s)
[PATH1] if(len == 0)=F -> if(!isNameStartCharNs(s.charAt(0)))=F -> for(i < len)#1=T -> if(!isNameCharNs(c))=T -> if(c == ':' && ++i < len && isNameStartCharNs(s.charAt(i)))=T -> for(i < len)#2=T -> if(!isNameCharNs(s.charAt(i)))=F -> exit loop -> ... | true | ok | {"focal": {"class": "Naming", "name": "isQname", "signature": "boolean isQname(String s)", "start_line": 3, "modifiers": "public static", "params": [{"name": "s", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "Naming", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fi... |
33559545_59 | class CompositeDelayFunction implements DelayFunction<R, X> {
@Override
public Duration computeDelay(final R result, final X failure, final ExecutionContext context) {
return functions.stream()
.map(function -> function.computeDelay(result, failure, context))
.filter(Obj... | when(second.computeDelay(eq("2"), any(), any())).thenReturn(Duration.ofSeconds(2));
assertEquals(Duration.ofSeconds(2), unit.computeDelay("2", null, null));
}
} | [FOCAL] @Override public Duration CompositeDelayFunction.computeDelay(R result, X failure, ExecutionContext context)
[CLASS] class CompositeDelayFunction implements DelayFunction<R, X>
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] functions.stream() .map(function -> function.comp... | /* static context
[FOCAL] @Override public Duration CompositeDelayFunction.computeDelay(R result, X failure, ExecutionContext context)
[INPUTS] branches=- | result=context, failure, result
[COLLABORATORS] field functions stream/0; field function computeDelay/3
[CALLS-EXTERNAL] functions.stream() .map(function -> functi... | /* static context
[FOCAL] @Override public Duration CompositeDelayFunction.computeDelay(R result, X failure, ExecutionContext context)
[INPUTS] branches=- | result=context, failure, result
[COLLABORATORS] field functions stream/0; field function computeDelay/3
[CALLS-EXTERNAL] functions.stream() .map(function -> functi... | true | ok | {"focal": {"class": "CompositeDelayFunction", "name": "computeDelay", "signature": "Duration computeDelay(R result, X failure, ExecutionContext context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "result", "type": "R"}, {"name": "failure", "type": "X"}, {"name": "context", "type": "Executio... |
33591418_10 | class NewRelocatorMethodAdapter extends AnalyzingMethodNode {
@Override
public void visitEnd() {
AbstractInsnNode next = instructions.getFirst();
boolean removeFrame = false;
int stackSize = 0;
while (next != null) {
AbstractInsnNode node = next;
next = ... | adapter.visitCode();
adapter.visitFrame(F_NEW, 0, EMPTY_OBJECTS, 0, EMPTY_OBJECTS);
adapter.visitInsn(NOP);
adapter.visitFrame(F_NEW, 0, EMPTY_OBJECTS, 0, EMPTY_OBJECTS);
adapter.visitInsn(RETURN);
adapter.visitMaxs(0, 0);
adapter.visitEnd();
InOrder inOr... | [FOCAL] @Override public void NewRelocatorMethodAdapter.visitEnd()
[CLASS] class NewRelocatorMethodAdapter extends AnalyzingMethodNode
[METRICS] loc=517 cc=206 branches=48 loops=1 returns=0 throws=0 nesting=6
[CALLS-INTERNAL] int getInvokeDelta(String desc); int getTypeSize(String desc); int handleFrame(FrameNode node)... | class NewRelocatorMethodAdapter extends AnalyzingMethodNode {
@Override
public void visitEnd() {
AbstractInsnNode next = instructions.getFirst();
boolean removeFrame = false;
int stackSize = 0;
while (next != null) {
AbstractInsnNode node = next;
next = ... | false | ok | {"focal": {"class": "NewRelocatorMethodAdapter", "name": "visitEnd", "signature": "void visitEnd()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "NewRelocatorMethodAdapter", "kind": "class", "modifiers": "", "superclass": "AnalyzingMethodNode", "interfa... | |
33645738_0 | class WordsApiDataProvider implements DataProvider {
@Override
public Observable<Pair<String, Response<RhymesResponse>>> rhymes(final String word) {
return apiService.rhymes(word)
.map(new Func1<Response<RhymesResponse>, Pair<String, Response<RhymesResponse>>>() {
@O... | Response<RhymesResponse> response = Response.success(new RhymesResponse(new Rhymes(
Arrays.asList("hi", "bye", "sigh"))));
String word = "high";
when(apiService.rhymes(word)).thenReturn(Observable.just(response));
Pair<String, Response<RhymesResponse>> pair =
... | [FOCAL] @Override public Observable<Pair<String, Response<RhymesResponse>>> WordsApiDataProvider.rhymes(String word)
[CLASS] class WordsApiDataProvider implements DataProvider
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] apiService.rhymes(word).map/1, ApiService.rhymes/1
[NEW] ... | /* static context
[FOCAL] @Override public Observable<Pair<String, Response<RhymesResponse>>> WordsApiDataProvider.rhymes(String word)
[INPUTS] branches=- | result=word, apiService
[COLLABORATORS] field apiService:ApiService rhymes/1
[FIELDS] read=apiService:ApiService
[NEW] Func1<Response<RhymesResponse>, Pair<String,... | /* static context
[FOCAL] @Override public Observable<Pair<String, Response<RhymesResponse>>> WordsApiDataProvider.rhymes(String word)
[INPUTS] branches=- | result=word, apiService
[COLLABORATORS] field apiService:ApiService rhymes/1
[FIELDS] read=apiService:ApiService
[NEW] Func1<Response<RhymesResponse>, Pair<String,... | true | ok | {"focal": {"class": "WordsApiDataProvider", "name": "rhymes", "signature": "Observable<Pair<String, Response<RhymesResponse>>> rhymes(String word)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "word", "type": "String"}], "return_type": "Observable<Pair<String, Response<RhymesResponse>>>"}, "cl... |
33670015_1 | class FileBasedLexicon implements Lexicon {
public Sentiment get(String key) {
final String value = properties.getProperty(key);
return value == null ? Sentiment.NEUTRAL : Sentiment.valueOf(value);
}
public FileBasedLexicon(String fileName);
@Override public String toString();
}
class FileBasedLexiconTest... | final FileBasedLexicon lexicon = new FileBasedLexicon("lexicon.properties");
assertEquals(Sentiment.HAPPY, lexicon.get("devoxx"));
assertEquals(Sentiment.SAD, lexicon.get("framework"));
}
} | [FOCAL] public Sentiment FileBasedLexicon.get(String key)
[CLASS] class FileBasedLexicon implements Lexicon
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] properties.getProperty/1, Sentiment.valueOf/1
[INPUTS] branches=- | result=key
[COLLABORATORS] field properties getProperty/1
... | /* static context
[FOCAL] public Sentiment FileBasedLexicon.get(String key)
[INPUTS] branches=- | result=key
[COLLABORATORS] field properties getProperty/1
[CALLS-EXTERNAL] properties.getProperty/1, Sentiment.valueOf/1
*/
| /* static context
[FOCAL] public Sentiment FileBasedLexicon.get(String key)
[INPUTS] branches=- | result=key
[COLLABORATORS] field properties getProperty/1
[CALLS-EXTERNAL] properties.getProperty/1, Sentiment.valueOf/1
*/
class FileBasedLexicon implements Lexicon {
public Sentiment get(String key) {
final String va... | true | ok | {"focal": {"class": "FileBasedLexicon", "name": "get", "signature": "Sentiment get(String key)", "start_line": 3, "modifiers": "public", "params": [{"name": "key", "type": "String"}], "return_type": "Sentiment"}, "class_info": {"name": "FileBasedLexicon", "kind": "class", "modifiers": "", "superclass": null, "interface... |
33675294_8 | class FirmwareService {
public UpdateFirmwareResponseDto updateFirmware(final DlmsConnectionHolder conn, final DlmsDevice device,
final String firmwareIdentification) throws OsgpException {
LOGGER.info("Updating firmware of device {} to firmware with identification {}", device,
... | // Arrange
final String firmwareIdentification = "fw";
when(this.firmwareFileCachingRepository.retrieve(firmwareIdentification)).thenReturn(null);
// Act
try {
this.firmwareService.updateFirmware(this.dlmsConnectionHolderMock, this.dlmsDeviceMock,
... | [FOCAL] public UpdateFirmwareResponseDto FirmwareService.updateFirmware(DlmsConnectionHolder conn, DlmsDevice device, String firmwareIdentification)
[CLASS] class FirmwareService
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] UpdateFirmwareResponseDto executeFirmwareUpdate(DlmsCon... | /* static context
[FOCAL] public UpdateFirmwareResponseDto FirmwareService.updateFirmware(DlmsConnectionHolder conn, DlmsDevice device, String firmwareIdentification)
[INPUTS] branches=- | result=conn, device, firmwareIdentification
[EXCEPTIONS] declares OsgpException
[CALLS-INTERNAL] UpdateFirmwareResponseDto executeF... | /* static context
[FOCAL] public UpdateFirmwareResponseDto FirmwareService.updateFirmware(DlmsConnectionHolder conn, DlmsDevice device, String firmwareIdentification)
[INPUTS] branches=- | result=conn, device, firmwareIdentification
[EXCEPTIONS] declares OsgpException
[CALLS-INTERNAL] UpdateFirmwareResponseDto executeF... | true | ok | {"focal": {"class": "FirmwareService", "name": "updateFirmware", "signature": "UpdateFirmwareResponseDto updateFirmware(DlmsConnectionHolder conn, DlmsDevice device, String firmwareIdentification) throws OsgpException", "start_line": 3, "modifiers": "public", "params": [{"name": "conn", "type": "DlmsConnectionHolder"},... |
33766200_0 | class Policy extends PolicyDef {
@Override
public EvaluationResult evaluate(EvaluationContext evaluationContext) throws EvaluationException {
/*
* First check to see if we are valid. If not, return an error status immediately
*/
if (!this.validate()) {
return new E... | PolicyDef policy = createPolicy();
EvaluationResult evaluationResult = policy.evaluate(evaluationContext);
Collection<IdReference> policyIdentifiers = getPolicyIdentifiers(evaluationResult);
assertEquals(1, policyIdentifiers.size());
assertEquals(Decision.INDETERMINATE, evalua... | [FOCAL] @Override public EvaluationResult Policy.evaluate(EvaluationContext evaluationContext)
[CLASS] class Policy extends PolicyDef
[METRICS] loc=57 cc=9 branches=6 loops=0 returns=4 throws=0 nesting=1
[CALLS-INTERNAL] CombiningAlgorithm<Rule> getRuleCombiningAlgorithm(); List<CombiningElement<Rule>> getCombiningRule... | /* static context
[FOCAL] @Override public EvaluationResult Policy.evaluate(EvaluationContext evaluationContext)
[PATH1] if(!this.validate())=F -> if(evaluationContext.isTracing())#1=T -> switch(thisMatchResult.getMatchCode())=case MATCH -> if(evaluationContext.getRequest().getReturnPolicyIdList())=T -> if(evaluationRe... | /* static context
[FOCAL] @Override public EvaluationResult Policy.evaluate(EvaluationContext evaluationContext)
[PATH1] if(!this.validate())=F -> if(evaluationContext.isTracing())#1=T -> switch(thisMatchResult.getMatchCode())=case MATCH -> if(evaluationContext.getRequest().getReturnPolicyIdList())=T -> if(evaluationRe... | true | ok | {"focal": {"class": "Policy", "name": "evaluate", "signature": "EvaluationResult evaluate(EvaluationContext evaluationContext) throws EvaluationException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "evaluationContext", "type": "EvaluationContext"}], "return_type": "EvaluationResult"}, "class... |
33769933_17 | class JkPathTree implements Closeable {
public JkPathTree importTree(JkPathTree tree, CopyOption... copyOptions) {
createIfNotExist();
if (tree.exists()) {
tree.stream().filter(excludeRootFilter()).forEach(path -> {
Path target = this.getRoot().resolve(tree.getRoot().rel... | Path dirSample = Files.createTempDirectory("sample");
JkPathTree tree = JkPathTree.of(dirSample);
tree.importTree(JkPathTree.ofZip(createSampleZip()));
assertTrue(Files.isDirectory(tree.get("subfolder")));
assertTrue(Files.isRegularFile(tree.get("subfolder").resolve("sample.txt")... | [FOCAL] public JkPathTree JkPathTree.importTree(JkPathTree tree, CopyOption... copyOptions)
[CLASS] class JkPathTree implements Closeable
[METRICS] loc=14 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] JkPathTree createIfNotExist(); Path getRoot(); Predicate<Path> excludeRootFilter()
[CALLS-EXTER... | /* static context
[FOCAL] public JkPathTree JkPathTree.importTree(JkPathTree tree, CopyOption... copyOptions)
[PATH1] if(tree.exists())=T -> return this
[PATH2] if(tree.exists())=F -> return this
[INPUTS] branches=tree | result=-
[COLLABORATORS] param tree:JkPathTree exists/0,stream/0,getRoot/0
[CALLS-INTERNAL] JkPathT... | /* static context
[FOCAL] public JkPathTree JkPathTree.importTree(JkPathTree tree, CopyOption... copyOptions)
[PATH1] if(tree.exists())=T -> return this
[PATH2] if(tree.exists())=F -> return this
[INPUTS] branches=tree | result=-
[COLLABORATORS] param tree:JkPathTree exists/0,stream/0,getRoot/0
[CALLS-INTERNAL] JkPathT... | true | ok | {"focal": {"class": "JkPathTree", "name": "importTree", "signature": "JkPathTree importTree(JkPathTree tree, CopyOption... copyOptions)", "start_line": 3, "modifiers": "public", "params": [{"name": "tree", "type": "JkPathTree"}, {"name": "copyOptions", "type": "CopyOption..."}], "return_type": "JkPathTree"}, "class_inf... |
33776978_8 | class SplayTree {
public boolean find(int key) {
splay(key);
return root.key == key;
}
private void splay(int key);
public void add(int key, Object elem);
public void delete(int elem);
private void print(SplayNode node);
static SplayTree tree;
static Random rand;
s... | for (int n = 0; n < 10; n++) {
for (int i = 0; i < inserted.length; i++) {
assertTrue(tree.find(inserted[i]));
}
}
for (int i = 0; i < 1000; i++) {
assertFalse(tree.find(rand.nextInt(inserted.length) + inserted.length + 1));
}
}
} | [FOCAL] public boolean SplayTree.find(int key)
[CLASS] class SplayTree
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] void splay(int key)
[INPUTS] branches=- | result=key
[DATAFLOW] key@param->L2,L3
[CLASS-MEMBERS] void splay(int key); void add(int key, Object elem); void delete(i... | /* static context
[FOCAL] public boolean SplayTree.find(int key)
[INPUTS] branches=- | result=key
[CALLS-INTERNAL] void splay(int key)
*/
| /* static context
[FOCAL] public boolean SplayTree.find(int key)
[INPUTS] branches=- | result=key
[CALLS-INTERNAL] void splay(int key)
*/
class SplayTree {
public boolean find(int key) {
splay(key);
return root.key == key;
}
private void splay(int key);
public void add(int key, Object ... | true | ok | {"focal": {"class": "SplayTree", "name": "find", "signature": "boolean find(int key)", "start_line": 3, "modifiers": "public", "params": [{"name": "key", "type": "int"}], "return_type": "boolean"}, "class_info": {"name": "SplayTree", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{... |
33782165_29 | class AbstractDogecoinParams extends NetworkParameters implements AuxPoWNetworkParameters {
protected long calculateNewDifficultyTargetInner(int previousHeight, final Block prev,
final Block nextBlock, final Block blockIntervalAgo) {
return this.calculateNewDifficultyTargetInner(previousHeight,... | int previousHeight = 239;
long previousBlockTime = 1386475638; // Block 239
long lastRetargetDifficulty = 0x1e0ffff0;
long lastRetargetTime = 1386474927; // Block 1
long nextDifficulty = 0x1e00ffff;
long newDifficulty =
params.calculateNewDifficultyTargetInner... | [FOCAL] protected long AbstractDogecoinParams.calculateNewDifficultyTargetInner(int previousHeight, Block prev, Block nextBlock, Block blockIntervalAgo)
[CLASS] class AbstractDogecoinParams extends NetworkParameters implements AuxPoWNetworkParameters
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
... | /* static context
[FOCAL] protected long AbstractDogecoinParams.calculateNewDifficultyTargetInner(int previousHeight, Block prev, Block nextBlock, Block blockIntervalAgo)
[INPUTS] branches=- | result=blockIntervalAgo, nextBlock, prev, previousHeight
[COLLABORATORS] param prev:Block getTimeSeconds/0,getDifficultyTarget/... | /* static context
[FOCAL] protected long AbstractDogecoinParams.calculateNewDifficultyTargetInner(int previousHeight, Block prev, Block nextBlock, Block blockIntervalAgo)
[INPUTS] branches=- | result=blockIntervalAgo, nextBlock, prev, previousHeight
[COLLABORATORS] param prev:Block getTimeSeconds/0,getDifficultyTarget/... | true | ok | {"focal": {"class": "AbstractDogecoinParams", "name": "calculateNewDifficultyTargetInner", "signature": "long calculateNewDifficultyTargetInner(int previousHeight, Block prev, Block nextBlock, Block blockIntervalAgo)", "start_line": 3, "modifiers": "protected", "params": [{"name": "previousHeight", "type": "int"}, {"na... |
33813213_4 | class AttrsDecorator implements Decorator {
@Override
public void apply(View view, View parent, String name, Context context, AttributeSet attributeSet) {
if (!clazz().isAssignableFrom(view.getClass())) {
return;
}
values = obtainAttributes(context, attributeSet);
i... | TypedArray typedArray = mockTypedArray(1, false);// we suppose we dont have custom attr here
spyWithTypedArray(typedArray);
String name = "android.widget.TextView";
attrsDecorator.apply(textView, parent, name, context, attributeSet);
assertThat(attrsDecorator.values).isNotNull();... | [FOCAL] @Override public void AttrsDecorator.apply(View view, View parent, String name, Context context, AttributeSet attributeSet)
[CLASS] class AttrsDecorator implements Decorator
[METRICS] loc=21 cc=6 branches=3 loops=1 returns=2 throws=0 nesting=3
[CALLS-INTERNAL] Class<T> clazz(); TypedArray obtainAttributes(Conte... | /* static context
[FOCAL] @Override public void AttrsDecorator.apply(View view, View parent, String name, Context context, AttributeSet attributeSet)
[PATH1] if(!clazz().isAssignableFrom(view.getClass()))=F -> if(values == null || values.length() == 0)=F -> for(i < values.length())=T -> if(values.hasValue(i) && values.... | /* static context
[FOCAL] @Override public void AttrsDecorator.apply(View view, View parent, String name, Context context, AttributeSet attributeSet)
[PATH1] if(!clazz().isAssignableFrom(view.getClass()))=F -> if(values == null || values.length() == 0)=F -> for(i < values.length())=T -> if(values.hasValue(i) && values.... | true | ok | {"focal": {"class": "AttrsDecorator", "name": "apply", "signature": "void apply(View view, View parent, String name, Context context, AttributeSet attributeSet)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "view", "type": "View"}, {"name": "parent", "type": "View"}, {"name": "name", "type": "... |
33816473_0 | class RedmineClient {
public int getIssueCount() throws IOException {
Request request = new Request.Builder()
.url(url + "/issues.json")
.build();
Response response = client.newCall(request).execute();
JSONObject jsonObject = new JSONObject(response.body().s... | RedmineClient redmineClient = new RedmineClient(
redmineContainer.getRedmineUrl());
assertEquals(
"The issue count can be retrieved.",
0,
redmineClient.getIssueCount());
}
} | [FOCAL] public int RedmineClient.getIssueCount()
[CLASS] class RedmineClient
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] new Request.Builder() .url(url + "/issues.json").build/0, new Request.Builder().url/1, client.newCall(request).execute/0, client.newCall/1, response.body().s... | /* static context
[FOCAL] public int RedmineClient.getIssueCount()
[COLLABORATORS] field client newCall/1
[EXCEPTIONS] declares IOException
[NEW] Request.Builder, JSONObject
[CALLS-EXTERNAL] new Request.Builder() .url(url + "/issues.json").build/0, new Request.Builder().url/1, client.newCall(request).execute/0, client.... | /* static context
[FOCAL] public int RedmineClient.getIssueCount()
[COLLABORATORS] field client newCall/1
[EXCEPTIONS] declares IOException
[NEW] Request.Builder, JSONObject
[CALLS-EXTERNAL] new Request.Builder() .url(url + "/issues.json").build/0, new Request.Builder().url/1, client.newCall(request).execute/0, client.... | true | ok | {"focal": {"class": "RedmineClient", "name": "getIssueCount", "signature": "int getIssueCount() throws IOException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "RedmineClient", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{... |
33829862_43 | class Version {
@Override
public String toString() {
if (StringUtils.isBlank(customName)) {
if (lowNumber == 0) {
return String.format("%s.%s", bigNumber, intermediateNumber);
}
return String.format("%s.%s.%s", bigNumber, intermediateNumber, lowNumber... | Version version1 = new Version("4-dev");
assertEquals("4.0-dev", version1.toString());
}
} | [FOCAL] @Override public String Version.toString()
[CLASS] class Version
[METRICS] loc=14 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=2
[CALLS-EXTERNAL] StringUtils.isBlank/1, String.format/3, String.format/4, String.format/5
[PATH1] if(StringUtils.isBlank(customName))=T -> if(lowNumber == 0)#1=T -> return Strin... | /* static context
[FOCAL] @Override public String Version.toString()
[PATH1] if(StringUtils.isBlank(customName))=T -> if(lowNumber == 0)#1=T -> return String.format("%s.%s", bigNumber, intermediateNumber)
[PATH2] if(StringUtils.isBlank(customName))=F -> if(lowNumber == 0)#2=T -> return String.format("%s.%s-%s", bigNumb... | /* static context
[FOCAL] @Override public String Version.toString()
[PATH1] if(StringUtils.isBlank(customName))=T -> if(lowNumber == 0)#1=T -> return String.format("%s.%s", bigNumber, intermediateNumber)
[PATH2] if(StringUtils.isBlank(customName))=F -> if(lowNumber == 0)#2=T -> return String.format("%s.%s-%s", bigNumb... | true | ok | {"focal": {"class": "Version", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "Version", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "V... |
33854851_43 | class WootricCustomMessage implements Parcelable {
public String getPlaceholderForScore(int scoreValue, String surveyType, int surveyTypeScale) {
final Score score = new Score(scoreValue, surveyType, surveyTypeScale);
if(score.isDetractor() && getDetractorPlaceholder() != null) {
retur... | assertThat(customMessage.getPlaceholderForScore(4, "CES", 0)).isEqualTo("passive_prompt_text");
assertThat(customMessage.getPlaceholderForScore(5, "CES", 0)).isEqualTo("passive_prompt_text");
}
} | [FOCAL] public String WootricCustomMessage.getPlaceholderForScore(int scoreValue, String surveyType, int surveyTypeScale)
[CLASS] class WootricCustomMessage implements Parcelable
[METRICS] loc=13 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=3
[CALLS-INTERNAL] String getDetractorPlaceholder(); String getPassivePla... | /* static context
[FOCAL] public String WootricCustomMessage.getPlaceholderForScore(int scoreValue, String surveyType, int surveyTypeScale)
[PATH1] if(score.isDetractor() && getDetractorPlaceholder() != null)=F -> if(score.isPassive() && getPassivePlaceholder() != null)=F -> if(score.isPromoter() && getPromoterPlacehol... | /* static context
[FOCAL] public String WootricCustomMessage.getPlaceholderForScore(int scoreValue, String surveyType, int surveyTypeScale)
[PATH1] if(score.isDetractor() && getDetractorPlaceholder() != null)=F -> if(score.isPassive() && getPassivePlaceholder() != null)=F -> if(score.isPromoter() && getPromoterPlacehol... | true | ok | {"focal": {"class": "WootricCustomMessage", "name": "getPlaceholderForScore", "signature": "String getPlaceholderForScore(int scoreValue, String surveyType, int surveyTypeScale)", "start_line": 3, "modifiers": "public", "params": [{"name": "scoreValue", "type": "int"}, {"name": "surveyType", "type": "String"}, {"name":... |
33856324_2 | class MsgObject {
@Override
public String toString() {
StringBuilder str = new StringBuilder();
getGroupValueHandler(getClass()).appendToString(this, str);
return str.toString();
}
private static GroupHandler getGroupValueHandler(Class<?> javaClass);
@SuppressWarnings("rawt... | assertEquals("ArrayMsg [strings=null, ints=null, basics=null]", new ArrayMsg(null, null, null).toString());
assertEquals("ArrayMsg [strings=[], ints=[], basics=[]]",
new ArrayMsg(new String[0], new int[0], new Basic[0]).toString());
assertEquals("ArrayMsg [strings=[a], ints=[1],... | [FOCAL] @Override public String MsgObject.toString()
[CLASS] class MsgObject
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] GroupHandler getGroupValueHandler(Class<?> javaClass)
[CALLS-EXTERNAL] getGroupValueHandler(getClass()).appendToString/2, getClass/0 (inherited), StringBuild... | /* static context
[FOCAL] @Override public String MsgObject.toString()
[CALLS-INTERNAL] GroupHandler getGroupValueHandler(Class<?> javaClass)
[NEW] StringBuilder
[CALLS-EXTERNAL] getGroupValueHandler(getClass()).appendToString/2, getClass/0 (inherited), StringBuilder.toString/0
*/
| /* static context
[FOCAL] @Override public String MsgObject.toString()
[CALLS-INTERNAL] GroupHandler getGroupValueHandler(Class<?> javaClass)
[NEW] StringBuilder
[CALLS-EXTERNAL] getGroupValueHandler(getClass()).appendToString/2, getClass/0 (inherited), StringBuilder.toString/0
*/
class MsgObject {
@Override
p... | true | ok | {"focal": {"class": "MsgObject", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "MsgObject", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name"... |
33861662_2 | class ModuleClass2 {
int neg(final int stuff) {
return -stuff;
}
public int negDoubleStuff(final int stuff);
ModuleClass2 testTarget;
}
class ModuleClass2Test {
ModuleClass2 testTarget;
@Test
public void neg() throws Exception {
| int any = anyInt();
assertEquals(-any, testTarget.neg(any));
}
} | [FOCAL] int ModuleClass2.neg(int stuff)
[CLASS] class ModuleClass2
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[INPUTS] branches=- | result=stuff
[DATAFLOW] stuff@param->L2
[CLASS-MEMBERS] int negDoubleStuff(int stuff)
[TEST] ModuleClass2Test: @Test public void neg() throws Exception
[TEST-FIEL... | /* static context
[FOCAL] int ModuleClass2.neg(int stuff)
[INPUTS] branches=- | result=stuff
*/
| /* static context
[FOCAL] int ModuleClass2.neg(int stuff)
[INPUTS] branches=- | result=stuff
*/
class ModuleClass2 {
int neg(final int stuff) {
return -stuff;
}
public int negDoubleStuff(final int stuff);
ModuleClass2 testTarget;
}
class ModuleClass2Test {
ModuleClass2 testTarget;
... | true | ok | {"focal": {"class": "ModuleClass2", "name": "neg", "signature": "int neg(int stuff)", "start_line": 3, "modifiers": "", "params": [{"name": "stuff", "type": "int"}], "return_type": "int"}, "class_info": {"name": "ModuleClass2", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name"... |
33926359_0 | class Debouncer {
public static boolean debounce(final String identifier, final Runnable r, final int millis) {
if(getInstance().runnables.containsKey(identifier)) {
// debounce
Log.d(TAG, String.format("Debouncing runnable with identifier \"%s\"", identifier));
Runnable... | final String identifier = "test";
final Counter counter = new Counter();
final Runnable r1 = new Runnable() {
@Override
public void run() {
Log.i(TAG, String.format("Runnable with identifier \"%s\" ran", identifier));
counter.increment();... | [FOCAL] public static boolean Debouncer.debounce(String identifier, Runnable r, int millis)
[CLASS] class Debouncer
[METRICS] loc=12 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] Debouncer getInstance()
[CALLS-EXTERNAL] getInstance().runnables.containsKey/1, Log.d/2, String.format/2, getInstance... | /* static context
[FOCAL] public static boolean Debouncer.debounce(String identifier, Runnable r, int millis)
[PATH1] if(getInstance().runnables.containsKey(identifier))=T -> return true
[PATH2] if(getInstance().runnables.containsKey(identifier))=F -> return true
[INPUTS] branches=identifier | result=-
[CALLS-INTERNAL]... | /* static context
[FOCAL] public static boolean Debouncer.debounce(String identifier, Runnable r, int millis)
[PATH1] if(getInstance().runnables.containsKey(identifier))=T -> return true
[PATH2] if(getInstance().runnables.containsKey(identifier))=F -> return true
[INPUTS] branches=identifier | result=-
[CALLS-INTERNAL]... | true | ok | {"focal": {"class": "Debouncer", "name": "debounce", "signature": "boolean debounce(String identifier, Runnable r, int millis)", "start_line": 3, "modifiers": "public static", "params": [{"name": "identifier", "type": "String"}, {"name": "r", "type": "Runnable"}, {"name": "millis", "type": "int"}], "return_type": "bool... |
33955440_0 | class BoxBookmark extends BoxItem {
public static BoxBookmark createFromId(String bookmarkId) {
JsonObject object = new JsonObject();
object.add(FIELD_ID, bookmarkId);
object.add(FIELD_TYPE, TYPE);
return new BoxBookmark(object);
}
public BoxBookmark();
public BoxBook... | // given
String expectedId = "5";
String expectedType = BoxBookmark.TYPE;
// when
BoxBookmark bookmark = BoxBookmark.createFromId(expectedId);
String id = bookmark.getId();
String type = bookmark.getType();
// then
Assert.assertEquals(expectedId,... | [FOCAL] public static BoxBookmark BoxBookmark.createFromId(String bookmarkId)
[CLASS] class BoxBookmark extends BoxItem
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] JsonObject.add/2
[NEW] JsonObject, BoxBookmark
[DATAFLOW] bookmarkId@param->L3; object@L2->L3,L4,L5
[CLASS-MEMBERS... | /* static context
[FOCAL] public static BoxBookmark BoxBookmark.createFromId(String bookmarkId)
[NEW] JsonObject, BoxBookmark
[CALLS-EXTERNAL] JsonObject.add/2
*/
| /* static context
[FOCAL] public static BoxBookmark BoxBookmark.createFromId(String bookmarkId)
[NEW] JsonObject, BoxBookmark
[CALLS-EXTERNAL] JsonObject.add/2
*/
class BoxBookmark extends BoxItem {
public static BoxBookmark createFromId(String bookmarkId) {
JsonObject object = new JsonObject();
ob... | true | ok | {"focal": {"class": "BoxBookmark", "name": "createFromId", "signature": "BoxBookmark createFromId(String bookmarkId)", "start_line": 3, "modifiers": "public static", "params": [{"name": "bookmarkId", "type": "String"}], "return_type": "BoxBookmark"}, "class_info": {"name": "BoxBookmark", "kind": "class", "modifiers": "... |
33957901_11 | class ServiceSettings {
static long getNextNextStartTimeFor(long start, long end) {
DateTime now = DateTime.now();
Interval interval = SyncthingUtils.getIntervalForRange(now, start, end);
if (interval.isAfter(now)) {
//Interval hasnt started yet
return interval.getSt... | long now = DateTime.parse("2015-03-21T14:12:00").getMillis();//2:12pm
DateTimeUtils.setCurrentMillisFixed(now);
//before interval is interval start when start < end
long start = parseTime("15:12"); //3:12pm
long end = parseTime("16:12");//4:12pm
assertThat(getNextNextS... | [FOCAL] static long ServiceSettings.getNextNextStartTimeFor(long start, long end)
[CLASS] class ServiceSettings
[METRICS] loc=13 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] DateTime.now/0, SyncthingUtils.getIntervalForRange/3, Interval.isAfter/1, Interval.getStartMillis/0, interval.getStart().... | /* static context
[FOCAL] static long ServiceSettings.getNextNextStartTimeFor(long start, long end)
[PATH1] if(interval.isAfter(now))=T -> return interval.getStartMillis()
[PATH2] if(interval.isAfter(now))=F -> return interval.getStart().plusDays(1).getMillis()
[INPUTS] branches=end, start | result=end, start
[CALLS-EX... | /* static context
[FOCAL] static long ServiceSettings.getNextNextStartTimeFor(long start, long end)
[PATH1] if(interval.isAfter(now))=T -> return interval.getStartMillis()
[PATH2] if(interval.isAfter(now))=F -> return interval.getStart().plusDays(1).getMillis()
[INPUTS] branches=end, start | result=end, start
[CALLS-EX... | true | ok | {"focal": {"class": "ServiceSettings", "name": "getNextNextStartTimeFor", "signature": "long getNextNextStartTimeFor(long start, long end)", "start_line": 3, "modifiers": "static", "params": [{"name": "start", "type": "long"}, {"name": "end", "type": "long"}], "return_type": "long"}, "class_info": {"name": "ServiceSett... |
33978966_38 | class Lazy {
public List<Thing> getList() {
return this.list;
}
public Lazy(List<Thing> list);
}
class LazyTest {
@Test
public void shouldRespectWithNull() {
| Lazy item = new LazyBuilder().withList((List<Thing>)null).build();
assertNull(item.getList());
}
} | [FOCAL] public List<Thing> Lazy.getList()
[CLASS] class Lazy
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[FIELDS] read=list
[CLASS-MEMBERS] Lazy(List<Thing> list)
[TEST] LazyTest: @Test public void shouldRespectWithNull() | /* static context
[FOCAL] public List<Thing> Lazy.getList()
[FIELDS] read=list
*/
| /* static context
[FOCAL] public List<Thing> Lazy.getList()
[FIELDS] read=list
*/
class Lazy {
public List<Thing> getList() {
return this.list;
}
public Lazy(List<Thing> list);
}
class LazyTest {
@Test
public void shouldRespectWithNull() {
| true | ok | {"focal": {"class": "Lazy", "name": "getList", "signature": "List<Thing> getList()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<Thing>"}, "class_info": {"name": "Lazy", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Lazy", "k... |
33989963_26 | class HighlighterVisitor extends SubscriptionVisitor {
private void highlight(SyntaxToken token, TypeOfText type) {
highlighting.highlight(token.line(), token.column(), token.endLine(), token.endColumn(), type);
}
public HighlighterVisitor(SensorContext sensorContext);
@Override public Set<Kind> nodesToVisit(... | highlight(" /**Comment*/ ");
assertHighlighting(2, 12, TypeOfText.STRUCTURED_COMMENT);
}
} | [FOCAL] private void HighlighterVisitor.highlight(SyntaxToken token, TypeOfText type)
[CLASS] class HighlighterVisitor extends SubscriptionVisitor
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] highlighting.highlight/5, SyntaxToken.line/0, SyntaxToken.column/0, SyntaxToken.endLine... | /* static context
[FOCAL] private void HighlighterVisitor.highlight(SyntaxToken token, TypeOfText type)
[COLLABORATORS] field highlighting highlight/5; param token:SyntaxToken line/0,column/0,endLine/0,endColumn/0
[CALLS-EXTERNAL] highlighting.highlight/5, SyntaxToken.line/0, SyntaxToken.column/0, SyntaxToken.endLine/0... | /* static context
[FOCAL] private void HighlighterVisitor.highlight(SyntaxToken token, TypeOfText type)
[COLLABORATORS] field highlighting highlight/5; param token:SyntaxToken line/0,column/0,endLine/0,endColumn/0
[CALLS-EXTERNAL] highlighting.highlight/5, SyntaxToken.line/0, SyntaxToken.column/0, SyntaxToken.endLine/0... | true | ok | {"focal": {"class": "HighlighterVisitor", "name": "highlight", "signature": "void highlight(SyntaxToken token, TypeOfText type)", "start_line": 3, "modifiers": "private", "params": [{"name": "token", "type": "SyntaxToken"}, {"name": "type", "type": "TypeOfText"}], "return_type": "void"}, "class_info": {"name": "Highlig... |
34034770_5 | class JWTFilter extends GenericFilterBean {
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
throws IOException, ServletException {
HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
String ... | MockHttpServletRequest request = new MockHttpServletRequest();
request.setRequestURI("/api/test");
MockHttpServletResponse response = new MockHttpServletResponse();
MockFilterChain filterChain = new MockFilterChain();
jwtFilter.doFilter(request, response, filterChain);
as... | [FOCAL] @Override public void JWTFilter.doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
[CLASS] class JWTFilter extends GenericFilterBean
[METRICS] loc=11 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] String resolveToken(HttpServletRequest reques... | /* static context
[FOCAL] @Override public void JWTFilter.doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
[PATH1] if(StringUtils.hasText(jwt) && this.tokenProvider.validateToken(jwt))=T
[PATH2] if(StringUtils.hasText(jwt) && this.tokenProvider.validateToken(jwt))=F
[INP... | /* static context
[FOCAL] @Override public void JWTFilter.doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
[PATH1] if(StringUtils.hasText(jwt) && this.tokenProvider.validateToken(jwt))=T
[PATH2] if(StringUtils.hasText(jwt) && this.tokenProvider.validateToken(jwt))=F
[INP... | true | ok | {"focal": {"class": "JWTFilter", "name": "doFilter", "signature": "void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "servletRequest", "type": "ServletRequest... |
34039690_3 | class DateUtilExtensions {
public static Calendar previous(Calendar self) {
Calendar result = (Calendar) self.clone();
result.add(Calendar.DATE, -1);
return result;
}
public static int getAt(Date self, int field);
public static Calendar toCalendar(Date self);
public static ... | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
Calendar calendar = Calendar.getInstance();
calendar.setTime(sdf.parse("20180101"));
assertEquals("20171231", sdf.format(DateUtilExtensions.previous(calendar).getTime()));
}
} | [FOCAL] public static Calendar DateUtilExtensions.previous(Calendar self)
[CLASS] class DateUtilExtensions
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Calendar.clone/0, Calendar.add/2
[INPUTS] branches=- | result=self
[COLLABORATORS] param self:Calendar clone/0
[DATAFLOW] resul... | /* static context
[FOCAL] public static Calendar DateUtilExtensions.previous(Calendar self)
[INPUTS] branches=- | result=self
[COLLABORATORS] param self:Calendar clone/0
[CALLS-EXTERNAL] Calendar.clone/0, Calendar.add/2
*/
| /* static context
[FOCAL] public static Calendar DateUtilExtensions.previous(Calendar self)
[INPUTS] branches=- | result=self
[COLLABORATORS] param self:Calendar clone/0
[CALLS-EXTERNAL] Calendar.clone/0, Calendar.add/2
*/
class DateUtilExtensions {
public static Calendar previous(Calendar self) {
Calendar... | true | ok | {"focal": {"class": "DateUtilExtensions", "name": "previous", "signature": "Calendar previous(Calendar self)", "start_line": 3, "modifiers": "public static", "params": [{"name": "self", "type": "Calendar"}], "return_type": "Calendar"}, "class_info": {"name": "DateUtilExtensions", "kind": "class", "modifiers": "", "supe... |
34044841_37 | class ComplaintTypeService {
@Transactional
public ComplaintType createComplaintType(ComplaintType complaintType) {
return complaintTypeRepository.save(complaintType);
}
@Autowired public ComplaintTypeService(ComplaintTypeRepository complaintTypeRepository);
public ComplaintType findBy(L... | ComplaintType complaintType = new ComplaintTypeBuilder().withDefaults().withName("Roads").build();
complaintTypeService.createComplaintType(complaintType);
verify(complaintTypeRepository).save(complaintType);
}
} | [FOCAL] @Transactional public ComplaintType ComplaintTypeService.createComplaintType(ComplaintType complaintType)
[CLASS] class ComplaintTypeService
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] ComplaintTypeRepository.save/1
[FIELDS] read=complaintTypeRepository:ComplaintTypeRep... | /* static context
[FOCAL] @Transactional public ComplaintType ComplaintTypeService.createComplaintType(ComplaintType complaintType)
[INPUTS] branches=- | result=complaintType, complaintTypeRepository
[COLLABORATORS] field complaintTypeRepository:ComplaintTypeRepository save/1
[FIELDS] read=complaintTypeRepository:Compl... | /* static context
[FOCAL] @Transactional public ComplaintType ComplaintTypeService.createComplaintType(ComplaintType complaintType)
[INPUTS] branches=- | result=complaintType, complaintTypeRepository
[COLLABORATORS] field complaintTypeRepository:ComplaintTypeRepository save/1
[FIELDS] read=complaintTypeRepository:Compl... | true | ok | {"focal": {"class": "ComplaintTypeService", "name": "createComplaintType", "signature": "ComplaintType createComplaintType(ComplaintType complaintType)", "start_line": 3, "modifiers": "@Transactional public", "params": [{"name": "complaintType", "type": "ComplaintType"}], "return_type": "ComplaintType"}, "class_info": ... |
34112580_0 | class CustomIssueRegistry extends IssueRegistry {
@Override public List<Issue> getIssues() {
return Arrays.asList(
HelloWorldDetector.ISSUE,
IdPrefixDetector.ISSUE,
StringReferencesDetector.ISSUE,
ClassNamesDetector.ISSUE,
LayoutNamesDetector.ISSUE
);
}
}
class Cus... | CustomIssueRegistry customIssueRegistry = new CustomIssueRegistry();
List<Issue> actual = customIssueRegistry.getIssues();
assertThat(actual).containsExactly(
HelloWorldDetector.ISSUE,
IdPrefixDetector.ISSUE,
StringReferencesDetector.ISSUE,
ClassNamesDetector.ISSUE,
... | [FOCAL] @Override public List<Issue> CustomIssueRegistry.getIssues()
[CLASS] class CustomIssueRegistry extends IssueRegistry
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Arrays.asList/5
[TEST] CustomIssueRegistryTest: @Test public void testGetIssues() throws Exception | /* static context
[FOCAL] @Override public List<Issue> CustomIssueRegistry.getIssues()
[CALLS-EXTERNAL] Arrays.asList/5
*/
| /* static context
[FOCAL] @Override public List<Issue> CustomIssueRegistry.getIssues()
[CALLS-EXTERNAL] Arrays.asList/5
*/
class CustomIssueRegistry extends IssueRegistry {
@Override public List<Issue> getIssues() {
return Arrays.asList(
HelloWorldDetector.ISSUE,
IdPrefixDetector.ISSUE,
S... | true | ok | {"focal": {"class": "CustomIssueRegistry", "name": "getIssues", "signature": "List<Issue> getIssues()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "List<Issue>"}, "class_info": {"name": "CustomIssueRegistry", "kind": "class", "modifiers": "", "superclass": "IssueRegistry", "interface... |
34138670_0 | class SegmentedIdGenerator implements IdGenerator {
@Override // IdGenerator
public synchronized long nextValue() {
if (offset == 0) {
newSegment();
}
if (++offset == SEGMENT_SIZE){
offset = 0;
}
return ++value;
}
public SegmentedIdGenerator(long initialValue,
... | final long initialValue = 1000;
final long serviceInitialValue = -1;
final long maxValue = 10000000;
IdGeneratorService service = new LocalIdService(serviceInitialValue);
SegmentedIdGenerator id = new SegmentedIdGenerator(initialValue, service);
for (long i = initialValue + 1; i <= maxValue; i+... | [FOCAL] @Override // IdGenerator public synchronized long SegmentedIdGenerator.nextValue()
[CLASS] class SegmentedIdGenerator implements IdGenerator
[METRICS] loc=10 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] void newSegment()
[PATH1] if(offset == 0)=T -> if(++offset == SEGMENT_SIZE)=T -> ret... | /* static context
[FOCAL] @Override // IdGenerator public synchronized long SegmentedIdGenerator.nextValue()
[PATH1] if(offset == 0)=T -> if(++offset == SEGMENT_SIZE)=T -> return ++value
[PATH2] if(offset == 0)=F -> if(++offset == SEGMENT_SIZE)=F -> return ++value
[CALLS-INTERNAL] void newSegment()
*/
| /* static context
[FOCAL] @Override // IdGenerator public synchronized long SegmentedIdGenerator.nextValue()
[PATH1] if(offset == 0)=T -> if(++offset == SEGMENT_SIZE)=T -> return ++value
[PATH2] if(offset == 0)=F -> if(++offset == SEGMENT_SIZE)=F -> return ++value
[CALLS-INTERNAL] void newSegment()
*/
class SegmentedId... | true | ok | {"focal": {"class": "SegmentedIdGenerator", "name": "nextValue", "signature": "long nextValue()", "start_line": 3, "modifiers": "@Override // IdGenerator public synchronized", "params": [], "return_type": "long"}, "class_info": {"name": "SegmentedIdGenerator", "kind": "class", "modifiers": "", "superclass": null, "inte... |
34202547_6 | class MapBuilder {
public MapBuilder<K, V> put(final K key, final V value) {
this.internalMap.put(key, value);
return this;
}
public static MapBuilder<K, V> newHashMap();
public static MapBuilder<K, V> newLinkedHashMap();
public static MapBuilder<K, V> newUnmodifableMap(final Provi... | final MapBuilder<String, String> mapBuilder = MapBuilder.newHashMap();
Assertions.assertNotNull(mapBuilder);
mapBuilder.put("Hello", "World");
Assertions.assertTrue(mapBuilder.get().containsKey("Hello"));
Assertions.assertTrue(mapBuilder.get().get("Hello").equals("World"));
}... | [FOCAL] public MapBuilder<K, V> MapBuilder.put(K key, V value)
[CLASS] class MapBuilder
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] this.internalMap.put/2
[FIELDS] read=internalMap
[COLLABORATORS] field internalMap put/2
[DATAFLOW] key@param->L2; value@param->L2
[CLASS-MEMBERS]... | /* static context
[FOCAL] public MapBuilder<K, V> MapBuilder.put(K key, V value)
[COLLABORATORS] field internalMap put/2
[FIELDS] read=internalMap
[CALLS-EXTERNAL] this.internalMap.put/2
*/
| /* static context
[FOCAL] public MapBuilder<K, V> MapBuilder.put(K key, V value)
[COLLABORATORS] field internalMap put/2
[FIELDS] read=internalMap
[CALLS-EXTERNAL] this.internalMap.put/2
*/
class MapBuilder {
public MapBuilder<K, V> put(final K key, final V value) {
this.internalMap.put(key, value);
... | true | ok | {"focal": {"class": "MapBuilder", "name": "put", "signature": "MapBuilder<K, V> put(K key, V value)", "start_line": 3, "modifiers": "public", "params": [{"name": "key", "type": "K"}, {"name": "value", "type": "V"}], "return_type": "MapBuilder<K, V>"}, "class_info": {"name": "MapBuilder", "kind": "class", "modifiers": "... |
34206566_4 | class NewsSerializer implements Serializer<News> {
@Override
public byte[] serialize(String topic, News data) {
try {
return mapper.writeValueAsBytes(data);
} catch (JsonProcessingException ex) {
throw new SerializationException("Could not transform Object to JSON: " + e... | NewsSerializer serializer = new NewsSerializer();
UUID uuid = UUID.randomUUID();
News news = new News(uuid, "Test Author", "Test TitleÄÖÜ", "Test test test");
byte[] bytes = serializer.serialize("", news);
News reparsedNews = mapper.readValue(bytes, News.class);
assertTha... | [FOCAL] @Override public byte[] NewsSerializer.serialize(String topic, News data)
[CLASS] class NewsSerializer implements Serializer<News>
[METRICS] loc=8 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] ObjectMapper.writeValueAsBytes/1, JsonProcessingException.getMessage/0
[NEW] SerializationExcep... | /* static context
[FOCAL] @Override public byte[] NewsSerializer.serialize(String topic, News data)
[THROWS-WHEN] SerializationException when try-body throws
[PATH1] try-body throws -> throw new SerializationException("Could not transform Object to JSON: " +...
[PATH2] return mapper.writeValueAsBytes(data)
[INPUTS] bra... | /* static context
[FOCAL] @Override public byte[] NewsSerializer.serialize(String topic, News data)
[THROWS-WHEN] SerializationException when try-body throws
[PATH1] try-body throws -> throw new SerializationException("Could not transform Object to JSON: " +...
[PATH2] return mapper.writeValueAsBytes(data)
[INPUTS] bra... | true | ok | {"focal": {"class": "NewsSerializer", "name": "serialize", "signature": "byte[] serialize(String topic, News data)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "topic", "type": "String"}, {"name": "data", "type": "News"}], "return_type": "byte[]"}, "class_info": {"name": "NewsSerializer", "ki... |
34212608_2 | class Routing {
public static <T extends Route> T build(Class<T> routeType, Consumer<String> consumer) {
PathImplementor implementor = RoutingImpl.getImplementorByClass(routeType);
if (implementor == null) {
throw new IllegalArgumentException("Invalid route type: " + routeType);
... | new StringRouteImpl().parse();
SavingConsumer consumer = new SavingConsumer();
StringRoute route = Routing.build(StringRoute.class, consumer);
route.path("baz");
assertEquals("foo/baz/bar", consumer.consumed);
route.nondeterminatePath("bazz");
assertEquals("foo... | [FOCAL] public static T Routing.build(Class<T> routeType, Consumer<String> consumer)
[CLASS] class Routing
[METRICS] loc=12 cc=3 branches=2 loops=0 returns=1 throws=2 nesting=1
[CALLS-EXTERNAL] RoutingImpl.getImplementorByClass/1, PathImplementor.write/1
[NEW] IllegalArgumentException
[EXCEPTIONS] throws IllegalArgumen... | /* static context
[FOCAL] public static T Routing.build(Class<T> routeType, Consumer<String> consumer)
[THROWS-WHEN] IllegalArgumentException when implementor == null
[THROWS-WHEN] IllegalArgumentException when !(implementor == null) && result == null
[PATH1] if(implementor == null)=F -> if(result == null)=T -> throw n... | /* static context
[FOCAL] public static T Routing.build(Class<T> routeType, Consumer<String> consumer)
[THROWS-WHEN] IllegalArgumentException when implementor == null
[THROWS-WHEN] IllegalArgumentException when !(implementor == null) && result == null
[PATH1] if(implementor == null)=F -> if(result == null)=T -> throw n... | true | ok | {"focal": {"class": "Routing", "name": "build", "signature": "T build(Class<T> routeType, Consumer<String> consumer)", "start_line": 3, "modifiers": "public static", "params": [{"name": "routeType", "type": "Class<T>"}, {"name": "consumer", "type": "Consumer<String>"}], "return_type": "T"}, "class_info": {"name": "Rout... |
34216921_28 | class PlayerCreator {
Hero createPlayer(ShipConfig shipConfig, boolean shouldSpawnOnGalaxySpawnPosition, RespawnState respawnState, SolGame game, boolean isMouseControl, boolean isNewShip) {
Vector2 position = findPlayerSpawnPosition(shipConfig, shouldSpawnOnGalaxySpawnPosition, game);
game.getCam(... | int shipConfigMoney = 42;
when(shipConfig.getMoney()).thenReturn(shipConfigMoney);
respawnState.setRespawnMoney(0);
playerCreator.createPlayer(shipConfig, false, respawnState, solGame, false, false);
verifyBuildNewFar(shipConfiguration().withMoney(shipConfigMoney));
}
} | [FOCAL] Hero PlayerCreator.createPlayer(ShipConfig shipConfig, boolean shouldSpawnOnGalaxySpawnPosition, RespawnState respawnState, SolGame game, boolean isMouseControl, boolean isNewShip)
[CLASS] class PlayerCreator
[METRICS] loc=11 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] Hero configureAn... | /* static context
[FOCAL] Hero PlayerCreator.createPlayer(ShipConfig shipConfig, boolean shouldSpawnOnGalaxySpawnPosition, RespawnState respawnState, SolGame game, boolean isMouseControl, boolean isNewShip)
[PATH1] if(isMouseControl)=T -> return hero
[PATH2] if(isMouseControl)=F -> return hero
[INPUTS] branches=isMouse... | /* static context
[FOCAL] Hero PlayerCreator.createPlayer(ShipConfig shipConfig, boolean shouldSpawnOnGalaxySpawnPosition, RespawnState respawnState, SolGame game, boolean isMouseControl, boolean isNewShip)
[PATH1] if(isMouseControl)=T -> return hero
[PATH2] if(isMouseControl)=F -> return hero
[INPUTS] branches=isMouse... | true | ok | {"focal": {"class": "PlayerCreator", "name": "createPlayer", "signature": "Hero createPlayer(ShipConfig shipConfig, boolean shouldSpawnOnGalaxySpawnPosition, RespawnState respawnState, SolGame game, boolean isMouseControl, boolean isNewShip)", "start_line": 3, "modifiers": "", "params": [{"name": "shipConfig", "type": ... |
34217961_0 | class SketchInteractionListener implements RainbowInputController.RainbowInteractionListener {
@Override
public void onSketchTouched(MotionEvent event) {
if (hasPaintListener()) {
paintListener.onPaintingStart();
}
inkPerformer.reset();
}
SketchInteractionListener... | sketchInteractionListener.onSketchTouched(motionEvent);
verify(inkPerformer).reset();
}
} | [FOCAL] @Override public void SketchInteractionListener.onSketchTouched(MotionEvent event)
[CLASS] class SketchInteractionListener implements RainbowInputController.RainbowInteractionListener
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] boolean hasPaintListener()
[CALLS-EXTERNAL... | /* static context
[FOCAL] @Override public void SketchInteractionListener.onSketchTouched(MotionEvent event)
[PATH1] if(hasPaintListener())=T
[PATH2] if(hasPaintListener())=F
[INPUTS] branches=- | result=- | unused=event
[COLLABORATORS] field paintListener onPaintingStart/0; field inkPerformer:InkPerformer reset/0
[CAL... | /* static context
[FOCAL] @Override public void SketchInteractionListener.onSketchTouched(MotionEvent event)
[PATH1] if(hasPaintListener())=T
[PATH2] if(hasPaintListener())=F
[INPUTS] branches=- | result=- | unused=event
[COLLABORATORS] field paintListener onPaintingStart/0; field inkPerformer:InkPerformer reset/0
[CAL... | true | ok | {"focal": {"class": "SketchInteractionListener", "name": "onSketchTouched", "signature": "void onSketchTouched(MotionEvent event)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "event", "type": "MotionEvent"}], "return_type": "void"}, "class_info": {"name": "SketchInteractionListener", "kind": ... |
34336359_71 | class CamelExchangeBus implements ExchangeBus {
@Override
public void init(ServiceDomain domain) {
if (_logger.isDebugEnabled()) {
_logger.debug("Initialization of CamelExchangeBus for domain " + domain.getName());
}
SimpleRegistry registry = _camelContext.getWritebleRegist... | RuntimeErrorInterceptor interceptor = new RuntimeErrorInterceptor(
false, ExchangeInterceptor.PROVIDER);
_camelContext.getWritebleRegistry().put("interceptor", interceptor);
_provider.init(_domain);
ServiceReference ref = registerInOutService("inOut");
Exchange ex... | [FOCAL] @Override public void CamelExchangeBus.init(ServiceDomain domain)
[CLASS] class CamelExchangeBus implements ExchangeBus
[METRICS] loc=17 cc=3 branches=1 loops=1 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] _logger.isDebugEnabled/0, _logger.debug/1, ServiceDomain.getName/0, SwitchYardCamelContextImpl.getWritebl... | /* static context
[FOCAL] @Override public void CamelExchangeBus.init(ServiceDomain domain)
[PATH1] if(_logger.isDebugEnabled())=T -> foreach(Processors processor : Processors.values())=T -> exit loop
[PATH2] if(_logger.isDebugEnabled())=F -> foreach(Processors processor : Processors.values())=F
[COLLABORATORS] param d... | /* static context
[FOCAL] @Override public void CamelExchangeBus.init(ServiceDomain domain)
[PATH1] if(_logger.isDebugEnabled())=T -> foreach(Processors processor : Processors.values())=T -> exit loop
[PATH2] if(_logger.isDebugEnabled())=F -> foreach(Processors processor : Processors.values())=F
[COLLABORATORS] param d... | true | ok | {"focal": {"class": "CamelExchangeBus", "name": "init", "signature": "void init(ServiceDomain domain)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "domain", "type": "ServiceDomain"}], "return_type": "void"}, "class_info": {"name": "CamelExchangeBus", "kind": "class", "modifiers": "", "supercl... |
34374370_4 | class HTraceConfiguration {
public abstract String get(String key)public abstract String get(String key);
public abstract String get(String key)public static HTraceConfiguration fromMap(Map<String, String> conf);
public abstract String get(String key)public static HTraceConfiguration fromKeyValuePairs(String... pairs... | System.setProperty("supercalifragilistic.property", "1");
System.setProperty("htrace.supercalifragilistic.property", "2");
System.setProperty("foo.htrace.supercalifragilistic.property", "3");
JavaPropertyConfiguration conf =
new JavaPropertyConfiguration.Builder().
addPrefix("foo.htrace.")... | [FOCAL] public abstract String HTraceConfiguration.get(String key)
[CLASS] class HTraceConfiguration
[METRICS] loc=1 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CLASS-MEMBERS] HTraceConfiguration fromMap(Map<String, String> conf); HTraceConfiguration fromKeyValuePairs(String... pairs); String get(String key, ... | /* static context
[FOCAL] public abstract String HTraceConfiguration.get(String key)
*/
| /* static context
[FOCAL] public abstract String HTraceConfiguration.get(String key)
*/
class HTraceConfiguration {
public abstract String get(String key)public abstract String get(String key);
public abstract String get(String key)public static HTraceConfiguration fromMap(Map<String, String> conf);
public abstract S... | true | partial | {"focal": {"class": "HTraceConfiguration", "name": "get", "signature": "String get(String key)", "start_line": 3, "modifiers": "public abstract", "params": [{"name": "key", "type": "String"}], "return_type": "String"}, "class_info": {"name": "HTraceConfiguration", "kind": "class", "modifiers": "", "superclass": null, "... |
34382546_8 | class WeightedMovingAverage {
public List<DataPoint> learn() {
List<DataPoint> result = new ArrayList<>(dataPoints.size());
EvictingQueue<Double> window = EvictingQueue.create(weights.length);
int endHalf = weights.length / 2;
// add zeros to the beginning
for (int i = 0;... | List<DataPoint> points = Arrays.asList(new DataPoint(1D, 0L), new DataPoint(1D, 5L),
new DataPoint(1D, 10L), new DataPoint(1D, 15L), new DataPoint(1D, 20L), new DataPoint(1D, 25L),
new DataPoint(1D, 30L));
WeightedMovingAverage weightedMovingAverage = new WeightedMovingA... | [FOCAL] public List<DataPoint> WeightedMovingAverage.learn()
[CLASS] class WeightedMovingAverage
[METRICS] loc=35 cc=6 branches=1 loops=4 returns=1 throws=0 nesting=3
[CALLS-EXTERNAL] dataPoints.size/0, EvictingQueue.create/1, List<DataPoint>.add/1, dataPoints.get(i).getTimestamp/0, dataPoints.get/1, EvictingQueue<Doub... | /* static context
[FOCAL] public List<DataPoint> WeightedMovingAverage.learn()
[PATH1] for(i < (weights.length - endHalf) - 1)=F -> for(i < dataPoints.size())#1=T -> if(window.remainingCapacity() == 0)=T -> while(iterator.hasNext())=F -> exit loop -> for(i < dataPoints.size())#2=F -> return result
[PATH2] for(i < (weig... | /* static context
[FOCAL] public List<DataPoint> WeightedMovingAverage.learn()
[PATH1] for(i < (weights.length - endHalf) - 1)=F -> for(i < dataPoints.size())#1=T -> if(window.remainingCapacity() == 0)=T -> while(iterator.hasNext())=F -> exit loop -> for(i < dataPoints.size())#2=F -> return result
[PATH2] for(i < (weig... | true | ok | {"focal": {"class": "WeightedMovingAverage", "name": "learn", "signature": "List<DataPoint> learn()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<DataPoint>"}, "class_info": {"name": "WeightedMovingAverage", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields... |
34383946_7 | class ReleaseDetails {
@Override
public String toString() {
return "ReleaseDetails [id=" + this.id + ", version=" + this.version + ", buildDate=" + this.buildDate + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
private ReleaseDetails();
private ReleaseDetails(final String id, final String ve... | ReleaseDetails instance = ReleaseDetails.byId(NAME);
String dateFormat = "yyyy-MM-dd";
SimpleDateFormat formatter = new SimpleDateFormat(dateFormat);
Date date = formatter.parse("2011-07-31");
assertEquals("ReleaseDetails [id=" + NAME + ", version=0.0.0-TEST, buildDate=" + date.toString() + "]",
instance.... | [FOCAL] @Override public String ReleaseDetails.toString()
[CLASS] class ReleaseDetails
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[FIELDS] read=buildDate, id, version
[CLASS-MEMBERS] ReleaseDetails(); ReleaseDetails(String id, String version, Date buildDate); String getId(); String getVersion(... | /* static context
[FOCAL] @Override public String ReleaseDetails.toString()
[FIELDS] read=buildDate, id, version
*/
| /* static context
[FOCAL] @Override public String ReleaseDetails.toString()
[FIELDS] read=buildDate, id, version
*/
class ReleaseDetails {
@Override
public String toString() {
return "ReleaseDetails [id=" + this.id + ", version=" + this.version + ", buildDate=" + this.buildDate + "]"; //$NON-NLS-1$ //$NON-NLS-2$ /... | true | ok | {"focal": {"class": "ReleaseDetails", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "ReleaseDetails", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "NA... |
34387413_4 | class CrawlingStrategy {
public boolean isCrawable(URL url, int depth) {
if (url != null && !visitedUrls.contains(url) && isCrawlingAllowed(url) && depth < crawlerMaxDepth) {
visitedUrls.add(url);
if(url.getPath().endsWith("/")){
try {
visitedUrls... | try {
URL url = new URL("http://jcertif.com/lab/2014/05/04/il-etait-une-fois-le-lab.html");
assertFalse(strategy.isCrawable(url, 11));
} catch (MalformedURLException ex) {
Logger.getLogger(CrawlingStrategyTest.class.getName()).log(Level.SEVERE, null, ex);
... | [FOCAL] public boolean CrawlingStrategy.isCrawable(URL url, int depth)
[CLASS] class CrawlingStrategy
[METRICS] loc=14 cc=4 branches=2 loops=0 returns=2 throws=0 nesting=3
[CALLS-INTERNAL] boolean isCrawlingAllowed(URL url)
[CALLS-EXTERNAL] visitedUrls.contains/1, visitedUrls.add/1, url.getPath().endsWith/1, URL.getPat... | /* static context
[FOCAL] public boolean CrawlingStrategy.isCrawable(URL url, int depth)
[PATH1] if(url != null && !visitedUrls.contains(url) && isCrawlingAllowed(url) && depth < crawlerMaxDepth)=T -> if(url.getPath().endsWith("/"))=T -> try-body throws -> return true
[PATH2] if(url != null && !visitedUrls.contains(url... | /* static context
[FOCAL] public boolean CrawlingStrategy.isCrawable(URL url, int depth)
[PATH1] if(url != null && !visitedUrls.contains(url) && isCrawlingAllowed(url) && depth < crawlerMaxDepth)=T -> if(url.getPath().endsWith("/"))=T -> try-body throws -> return true
[PATH2] if(url != null && !visitedUrls.contains(url... | true | ok | {"focal": {"class": "CrawlingStrategy", "name": "isCrawable", "signature": "boolean isCrawable(URL url, int depth)", "start_line": 3, "modifiers": "public", "params": [{"name": "url", "type": "URL"}, {"name": "depth", "type": "int"}], "return_type": "boolean"}, "class_info": {"name": "CrawlingStrategy", "kind": "class"... |
34409518_236 | class AbstractRsJs {
String getJsFilename(String classname, String fwk) {
String path = classname.replaceAll("\\.", File.separator);
if (null != fwk) {
return File.separator + path + "." + fwk + Constants.JS;
}
return File.separator + path + Constants.JS;
}
abstract List<InputStream> getStreams();
@GET... | System.out.println("getJsFilename");
String classname = "p1.p2.p3.Cls1";
String expResult = "/p1/p2/p3/Cls1.fwk.js";
String result = instance.getJsFilename(classname, "fwk");
assertThat(result).isEqualTo(expResult);
}
} | [FOCAL] String AbstractRsJs.getJsFilename(String classname, String fwk)
[CLASS] class AbstractRsJs
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] String.replaceAll/2
[PATH1] if(null != fwk)=T -> return File.separator + path + "." + fwk + Constants.JS
[PATH2] if(null != fwk)=F -> r... | /* static context
[FOCAL] String AbstractRsJs.getJsFilename(String classname, String fwk)
[PATH1] if(null != fwk)=T -> return File.separator + path + "." + fwk + Constants.JS
[PATH2] if(null != fwk)=F -> return File.separator + path + Constants.JS
[INPUTS] branches=fwk | result=classname, fwk
[CALLS-EXTERNAL] String.re... | /* static context
[FOCAL] String AbstractRsJs.getJsFilename(String classname, String fwk)
[PATH1] if(null != fwk)=T -> return File.separator + path + "." + fwk + Constants.JS
[PATH2] if(null != fwk)=F -> return File.separator + path + Constants.JS
[INPUTS] branches=fwk | result=classname, fwk
[CALLS-EXTERNAL] String.re... | true | ok | {"focal": {"class": "AbstractRsJs", "name": "getJsFilename", "signature": "String getJsFilename(String classname, String fwk)", "start_line": 3, "modifiers": "", "params": [{"name": "classname", "type": "String"}, {"name": "fwk", "type": "String"}], "return_type": "String"}, "class_info": {"name": "AbstractRsJs", "kind... |
34430212_3 | class EncryCredentialAuthenticationHandler extends
AbstractPreAndPostProcessingAuthenticationHandler {
@Override
protected boolean doAuthentication(KnightCredential credential) throws AuthenticationException {
//不支持的凭据直接返回false.
if(!this.supports(credential)){
return false;
... |
/**
* 测试异常输入情况。
*/
Assert.assertFalse(handler.authenticate(null));
Credential credential = Mockito.mock(Credential.class);
Assert.assertFalse(handler.authenticate(credential));
/**
* 测试解密失败抛出异常的情况。
*/
EncryCredential encryCredential = new EncryCredential("sssddaf");
EncryCredentialManage... | [FOCAL] @Override protected boolean EncryCredentialAuthenticationHandler.doAuthentication(KnightCredential credential)
[CLASS] class EncryCredentialAuthenticationHandler extends AbstractPreAndPostProcessingAuthenticationHandler
[METRICS] loc=23 cc=5 branches=3 loops=0 returns=4 throws=0 nesting=3
[CALLS-INTERNAL] boole... | /* static context
[FOCAL] @Override protected boolean EncryCredentialAuthenticationHandler.doAuthentication(KnightCredential credential)
[PATH1] if(!this.supports(credential))=F -> if(credential!=null && credential instanceof KnightEncryCredential)=T -> try-body throws -> return false
[PATH2] if(!this.supports(credenti... | /* static context
[FOCAL] @Override protected boolean EncryCredentialAuthenticationHandler.doAuthentication(KnightCredential credential)
[PATH1] if(!this.supports(credential))=F -> if(credential!=null && credential instanceof KnightEncryCredential)=T -> try-body throws -> return false
[PATH2] if(!this.supports(credenti... | true | ok | {"focal": {"class": "EncryCredentialAuthenticationHandler", "name": "doAuthentication", "signature": "boolean doAuthentication(KnightCredential credential) throws AuthenticationException", "start_line": 4, "modifiers": "@Override protected", "params": [{"name": "credential", "type": "KnightCredential"}], "return_type":... |
34430581_0 | class SampleBlazegraphCustomFunctionRemote {
public static void loadDataFromResource(final RemoteRepositoryManager repo,
final String namespace, final String resource) throws Exception {
final InputStream is = SampleBlazegraphCustomFunctionRemote.class
.getResourceAsStream(resource);
if (is == null) {
t... |
final String namespace = "test";
final Properties journalProperties = new Properties();
{
journalProperties.setProperty(Journal.Options.BUFFER_MODE,
BufferMode.MemStore.name());
}
Journal m_indexManager = new Journal(journalProperti... | [FOCAL] public static void SampleBlazegraphCustomFunctionRemote.loadDataFromResource(RemoteRepositoryManager repo, String namespace, String resource)
[CLASS] class SampleBlazegraphCustomFunctionRemote
[METRICS] loc=14 cc=3 branches=1 loops=0 returns=0 throws=1 nesting=1
[CALLS-EXTERNAL] SampleBlazegraphCustomFunctionRe... | /* static context
[FOCAL] public static void SampleBlazegraphCustomFunctionRemote.loadDataFromResource(RemoteRepositoryManager repo, String namespace, String resource)
[THROWS-WHEN] IOException when is == null
[PATH1] if(is == null)=T -> throw new IOException("Could not locate resource: " + resource)
[PATH2] if(is == n... | /* static context
[FOCAL] public static void SampleBlazegraphCustomFunctionRemote.loadDataFromResource(RemoteRepositoryManager repo, String namespace, String resource)
[THROWS-WHEN] IOException when is == null
[PATH1] if(is == null)=T -> throw new IOException("Could not locate resource: " + resource)
[PATH2] if(is == n... | true | ok | {"focal": {"class": "SampleBlazegraphCustomFunctionRemote", "name": "loadDataFromResource", "signature": "void loadDataFromResource(RemoteRepositoryManager repo, String namespace, String resource) throws Exception", "start_line": 3, "modifiers": "public static", "params": [{"name": "repo", "type": "RemoteRepositoryMana... |
34446334_72 | class EndpointUtil {
public static String decodeClientURI(String clientUri) {
return clientUri.startsWith(Constants.URI_CLIENT_PREFIX)
? clientUri.substring(Constants.URI_CLIENT_PREFIX.length()): clientUri;
}
public static String encodeEndpoint(String uri, String operation);
pu... | assertEquals(URI, EndpointUtil.decodeClientURI(Constants.URI_CLIENT_PREFIX + URI));
}
} | [FOCAL] public static String EndpointUtil.decodeClientURI(String clientUri)
[CLASS] class EndpointUtil
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] String.startsWith/1, String.substring/1, Constants.URI_CLIENT_PREFIX.length/0
[INPUTS] branches=- | result=clientUri
[DATAFLOW] cli... | /* static context
[FOCAL] public static String EndpointUtil.decodeClientURI(String clientUri)
[INPUTS] branches=- | result=clientUri
[CALLS-EXTERNAL] String.startsWith/1, String.substring/1, Constants.URI_CLIENT_PREFIX.length/0
*/
| /* static context
[FOCAL] public static String EndpointUtil.decodeClientURI(String clientUri)
[INPUTS] branches=- | result=clientUri
[CALLS-EXTERNAL] String.startsWith/1, String.substring/1, Constants.URI_CLIENT_PREFIX.length/0
*/
class EndpointUtil {
public static String decodeClientURI(String clientUri) {
... | true | ok | {"focal": {"class": "EndpointUtil", "name": "decodeClientURI", "signature": "String decodeClientURI(String clientUri)", "start_line": 3, "modifiers": "public static", "params": [{"name": "clientUri", "type": "String"}], "return_type": "String"}, "class_info": {"name": "EndpointUtil", "kind": "class", "modifiers": "", "... |
34456739_2 | class Form {
public boolean save() {
return save(null);
}
protected Form(Builder<S, D> builder);
public void display(Bundle bundle);
public void display();
public void forceSave();
public boolean save(Bundle bundle);
public void forceSave(Bundle bundle);
private static f... | AuthModelSource source = new AuthModelSource(null);
AuthModelDrain drain = new AuthModelDrain(null);
Form form = new Form.Builder<>(source, drain, mapper).build();
assertNull(drain.getDrain());
form.display();
assertFalse(form.save());
source.getSource().email... | [FOCAL] public boolean Form.save()
[CLASS] class Form
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] boolean save(Bundle bundle)
[CLASS-MEMBERS] Form(Builder<S, D> builder); void display(Bundle bundle); void display(); void forceSave(); boolean save(Bundle bundle); void forceSave(... | /* static context
[FOCAL] public boolean Form.save()
[CALLS-INTERNAL] boolean save(Bundle bundle)
*/
| /* static context
[FOCAL] public boolean Form.save()
[CALLS-INTERNAL] boolean save(Bundle bundle)
*/
class Form {
public boolean save() {
return save(null);
}
protected Form(Builder<S, D> builder);
public void display(Bundle bundle);
public void display();
public void forceSave();
... | true | ok | {"focal": {"class": "Form", "name": "save", "signature": "boolean save()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "Form", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "EMAIL", "type": "String", "modifiers":... |
34482253_0 | class RoomManager {
public Set<String> getRooms() {
return new HashSet<String>(rooms.keySet());
}
public RoomManager(RoomHandler roomHandler, KurentoClientProvider kcProvider);
public Set<UserParticipant> joinRoom(String userName, String roomName, boolean dataChannels,
boolean webParticipant, Kure... | assertThat(manager.getRooms(), not(hasItem(roomx)));
exception.expect(RoomException.class);
exception.expectMessage(containsString("must be created before"));
userJoinRoom(roomx, userx, pidx, false);
assertThat(manager.getRooms(), not(hasItem(roomx)));
}
} | [FOCAL] public Set<String> RoomManager.getRooms()
[CLASS] class RoomManager
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] String[].keySet/0
[NEW] HashSet<String>
[FIELDS] read=rooms:String[]
[INPUTS] branches=- | result=rooms
[COLLABORATORS] field rooms:String[] keySet/0
[DATAFLO... | class RoomManager {
public Set<String> getRooms() {
return new HashSet<String>(rooms.keySet());
}
public RoomManager(RoomHandler roomHandler, KurentoClientProvider kcProvider);
public Set<UserParticipant> joinRoom(String userName, String roomName, boolean dataChannels,
boolean webParticipant, Kure... | false | ok | {"focal": {"class": "RoomManager", "name": "getRooms", "signature": "Set<String> getRooms()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Set<String>"}, "class_info": {"name": "RoomManager", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "SDP_WEB_... | |
34520372_0 | class BrokerApiVersionInterceptor extends HandlerInterceptorAdapter {
public boolean preHandle(HttpServletRequest request, HttpServletResponse response,
Object handler) throws ServiceBrokerApiVersionException {
if (version != null && !anyVersionAllowed()) {
String apiVersion = request.getHeader(version.getBro... | BrokerApiVersionInterceptor interceptor = new BrokerApiVersionInterceptor(null);
assertTrue(interceptor.preHandle(request, response, null));
}
} | [FOCAL] public boolean BrokerApiVersionInterceptor.preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
[CLASS] class BrokerApiVersionInterceptor extends HandlerInterceptorAdapter
[METRICS] loc=10 cc=3 branches=2 loops=0 returns=1 throws=1 nesting=2
[CALLS-INTERNAL] boolean anyVersionAllo... | /* static context
[FOCAL] public boolean BrokerApiVersionInterceptor.preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
[THROWS-WHEN] ServiceBrokerApiVersionException when version != null && !anyVersionAllowed() && !version.getApiVersion().equals(apiVersion)
[PATH1] if(version != null &... | /* static context
[FOCAL] public boolean BrokerApiVersionInterceptor.preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
[THROWS-WHEN] ServiceBrokerApiVersionException when version != null && !anyVersionAllowed() && !version.getApiVersion().equals(apiVersion)
[PATH1] if(version != null &... | true | ok | {"focal": {"class": "BrokerApiVersionInterceptor", "name": "preHandle", "signature": "boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws ServiceBrokerApiVersionException", "start_line": 3, "modifiers": "public", "params": [{"name": "request", "type": "HttpServletRequest"}... |
34537449_0 | class CvsMapper {
public String map(Observation observation) {
return observation.getId() + SEPARATOR + observation.getName() + SEPARATOR + observation.getTime();
//TODO: Add escaping logic if name contains double quotes or commas
}
}
class CvsMapperTest {
@Test
public void testBadData() {
| assertThat(new CvsMapper().map(new Observation(1, "name\"with\"quotes", "1", null)), nullValue());
}
} | [FOCAL] public String CvsMapper.map(Observation observation)
[CLASS] class CvsMapper
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Observation.getId/0, Observation.getName/0, Observation.getTime/0
[INPUTS] branches=- | result=observation
[COLLABORATORS] param observation:Observat... | /* static context
[FOCAL] public String CvsMapper.map(Observation observation)
[INPUTS] branches=- | result=observation
[COLLABORATORS] param observation:Observation getId/0,getName/0,getTime/0
[CALLS-EXTERNAL] Observation.getId/0, Observation.getName/0, Observation.getTime/0
*/
| /* static context
[FOCAL] public String CvsMapper.map(Observation observation)
[INPUTS] branches=- | result=observation
[COLLABORATORS] param observation:Observation getId/0,getName/0,getTime/0
[CALLS-EXTERNAL] Observation.getId/0, Observation.getName/0, Observation.getTime/0
*/
class CvsMapper {
public String map... | true | ok | {"focal": {"class": "CvsMapper", "name": "map", "signature": "String map(Observation observation)", "start_line": 3, "modifiers": "public", "params": [{"name": "observation", "type": "Observation"}], "return_type": "String"}, "class_info": {"name": "CvsMapper", "kind": "class", "modifiers": "", "superclass": null, "int... |
34568856_0 | class StorageAccess {
public String safeFilename(String filename) {
// Remove bad characters from filenames
filename = filename.replaceAll("[*?/<>&!#$+\"'{}:@\\\\]",""); // Removes bad characters
filename = filename.replaceAll("\\s{2,}", " "); // Removes double spaces
return filena... | String input = "This is a <*bad*> /Filename\\ & who knows what it wull do!! # $ + \" ' { } : @ ";
String output;
String expected = "This is a bad Filename who knows what it wull do";
StorageAccess storageAccess = new StorageAccess();
output = storageAccess.safeFilename(input);
... | [FOCAL] public String StorageAccess.safeFilename(String filename)
[CLASS] class StorageAccess
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] String.replaceAll/2, String.trim/0
[INPUTS] branches=- | result=filename
[DATAFLOW] filename@param->L3; filename@L3->L4; filename@L4->L5
[CL... | /* static context
[FOCAL] public String StorageAccess.safeFilename(String filename)
[INPUTS] branches=- | result=filename
[CALLS-EXTERNAL] String.replaceAll/2, String.trim/0
*/
| /* static context
[FOCAL] public String StorageAccess.safeFilename(String filename)
[INPUTS] branches=- | result=filename
[CALLS-EXTERNAL] String.replaceAll/2, String.trim/0
*/
class StorageAccess {
public String safeFilename(String filename) {
// Remove bad characters from filenames
filename = fil... | true | ok | {"focal": {"class": "StorageAccess", "name": "safeFilename", "signature": "String safeFilename(String filename)", "start_line": 3, "modifiers": "public", "params": [{"name": "filename", "type": "String"}], "return_type": "String"}, "class_info": {"name": "StorageAccess", "kind": "class", "modifiers": "", "superclass": ... |
34579789_4 | class RetrofitServiceMethod {
public List<MethodSpec> generateCodeWithRetryStaleIfRequired() {
MethodSpec methodSpec = generateCode(false);
if (!canAppendStaleHeader()) {
return singletonList(methodSpec);
}
return asList(methodSpec, generateCode(true));
}
public RetrofitServiceMethod(Exe... | List<MethodSpec> methodSpecs = singleMethodInfo(Foo5.class).generateCodeWithRetryStaleIfRequired();
assertEquals("@retrofit.http.GET(\"/hoge\")\n"
+ "@retrofit.http.Headers(\"Cache-Control: max-stale=86400\")\n"
+ "public abstract rx.Observable<java.lang.String> bar$$RetryStale(java.util... | [FOCAL] public List<MethodSpec> RetrofitServiceMethod.generateCodeWithRetryStaleIfRequired()
[CLASS] class RetrofitServiceMethod
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] MethodSpec generateCode(boolean withRetryStaleHeader); boolean canAppendStaleHeader()
[CALLS-EXTERNAL] si... | /* static context
[FOCAL] public List<MethodSpec> RetrofitServiceMethod.generateCodeWithRetryStaleIfRequired()
[PATH1] if(!canAppendStaleHeader())=T -> return singletonList(methodSpec)
[PATH2] if(!canAppendStaleHeader())=F -> return asList(methodSpec, generateCode(true))
[CALLS-INTERNAL] MethodSpec generateCode(boolean... | /* static context
[FOCAL] public List<MethodSpec> RetrofitServiceMethod.generateCodeWithRetryStaleIfRequired()
[PATH1] if(!canAppendStaleHeader())=T -> return singletonList(methodSpec)
[PATH2] if(!canAppendStaleHeader())=F -> return asList(methodSpec, generateCode(true))
[CALLS-INTERNAL] MethodSpec generateCode(boolean... | true | ok | {"focal": {"class": "RetrofitServiceMethod", "name": "generateCodeWithRetryStaleIfRequired", "signature": "List<MethodSpec> generateCodeWithRetryStaleIfRequired()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<MethodSpec>"}, "class_info": {"name": "RetrofitServiceMethod", "kind": "class", ... |
34582928_61 | class NetworkUtils {
public static String getAbsoluteUrl(String url) {
String absoluteUrl = url;
if (!TextUtils.isEmpty(absoluteUrl) && !absoluteUrl.startsWith("http")) {
absoluteUrl = StringUtils.appendOptional(BuildConfig.WS_ENDPOINT, absoluteUrl);
}
return absoluteUr... | // Given
String url = "/imgs/nilhcem.jpg";
// When
String result = NetworkUtils.getAbsoluteUrl(url);
// Then
assertThat(result).isEqualTo(BuildConfig.WS_ENDPOINT + url);
}
} | [FOCAL] public static String NetworkUtils.getAbsoluteUrl(String url)
[CLASS] class NetworkUtils
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] TextUtils.isEmpty/1, String.startsWith/1, StringUtils.appendOptional/2
[PATH1] if(!TextUtils.isEmpty(absoluteUrl) && !absoluteUrl.startsWi... | /* static context
[FOCAL] public static String NetworkUtils.getAbsoluteUrl(String url)
[PATH1] if(!TextUtils.isEmpty(absoluteUrl) && !absoluteUrl.startsWith("http"))=T -> return absoluteUrl
[PATH2] if(!TextUtils.isEmpty(absoluteUrl) && !absoluteUrl.startsWith("http"))=F -> return absoluteUrl
[INPUTS] branches=url | res... | /* static context
[FOCAL] public static String NetworkUtils.getAbsoluteUrl(String url)
[PATH1] if(!TextUtils.isEmpty(absoluteUrl) && !absoluteUrl.startsWith("http"))=T -> return absoluteUrl
[PATH2] if(!TextUtils.isEmpty(absoluteUrl) && !absoluteUrl.startsWith("http"))=F -> return absoluteUrl
[INPUTS] branches=url | res... | true | ok | {"focal": {"class": "NetworkUtils", "name": "getAbsoluteUrl", "signature": "String getAbsoluteUrl(String url)", "start_line": 3, "modifiers": "public static", "params": [{"name": "url", "type": "String"}], "return_type": "String"}, "class_info": {"name": "NetworkUtils", "kind": "class", "modifiers": "", "superclass": n... |
34623357_10 | class FavoriteSurface {
public boolean isEmpty() {
return surface == null && surfaceGroup == null && !allRounder && !none;
}
public FavoriteSurface(PlayerPerformance performance);
private static int getMaxWonPctGapIndex(List<SurfaceWonPct> surfaces);
private void setSurface(Surface surface);
private void se... | FavoriteSurface favoriteSurface = new FavoriteSurface(performance(
new WonLost(0, 1),
new WonLost(1, 1),
new WonLost(1, 1),
new WonLost(0, 0)
));
assertThat(favoriteSurface.isEmpty()).isTrue();
assertThat(favoriteSurface).hasToString("");
}
} | [FOCAL] public boolean FavoriteSurface.isEmpty()
[CLASS] class FavoriteSurface
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] FavoriteSurface(PlayerPerformance performance); int getMaxWonPctGapIndex(List<SurfaceWonPct> surfaces); void setSurface(Surface surface); void setSurfaceGro... | /* static context
[FOCAL] public boolean FavoriteSurface.isEmpty()
*/
| /* static context
[FOCAL] public boolean FavoriteSurface.isEmpty()
*/
class FavoriteSurface {
public boolean isEmpty() {
return surface == null && surfaceGroup == null && !allRounder && !none;
}
public FavoriteSurface(PlayerPerformance performance);
private static int getMaxWonPctGapIndex(List<SurfaceWonPct> ... | true | ok | {"focal": {"class": "FavoriteSurface", "name": "isEmpty", "signature": "boolean isEmpty()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "FavoriteSurface", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "OFFSET", "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.