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
21148694_16
class CellTimestampComparator implements Comparator<Cell> { public int compare(Cell o1, Cell o2) { return Long.valueOf(o1.getTimestamp()).compareTo(o2.getTimestamp()); } } class CellTimestampComparatorTest { @Test public void test_equal() {
// mocking Cell cell1 = Mockito.mock(Cell.class); Mockito.when(cell1.getTimestamp()).thenReturn(13945345808L); Cell cell2 = Mockito.mock(Cell.class); Mockito.when(cell2.getTimestamp()).thenReturn(13945345808L); CellTimestampComparator comparator = new CellTimestampComparator(); // actual c...
[FOCAL] public int CellTimestampComparator.compare(Cell o1, Cell o2) [CLASS] class CellTimestampComparator implements Comparator<Cell> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Long.valueOf(o1.getTimestamp()).compareTo/1, Long.valueOf/1, Cell.getTimestamp/0 [INPUTS] branches=...
/* static context [FOCAL] public int CellTimestampComparator.compare(Cell o1, Cell o2) [INPUTS] branches=- | result=o1, o2 [COLLABORATORS] param o1:Cell getTimestamp/0; param o2:Cell getTimestamp/0 [CALLS-EXTERNAL] Long.valueOf(o1.getTimestamp()).compareTo/1, Long.valueOf/1, Cell.getTimestamp/0 */
/* static context [FOCAL] public int CellTimestampComparator.compare(Cell o1, Cell o2) [INPUTS] branches=- | result=o1, o2 [COLLABORATORS] param o1:Cell getTimestamp/0; param o2:Cell getTimestamp/0 [CALLS-EXTERNAL] Long.valueOf(o1.getTimestamp()).compareTo/1, Long.valueOf/1, Cell.getTimestamp/0 */ class CellTimestampCo...
true
ok
{"focal": {"class": "CellTimestampComparator", "name": "compare", "signature": "int compare(Cell o1, Cell o2)", "start_line": 3, "modifiers": "public", "params": [{"name": "o1", "type": "Cell"}, {"name": "o2", "type": "Cell"}], "return_type": "int"}, "class_info": {"name": "CellTimestampComparator", "kind": "class", "m...
21153865_10
class SearchTool extends AbstractAuthBasedThriftServiceClient { protected static Output getQuestions(String query) { // ?:What is blue? // ?:"What is blue?" // ?:What is blue Matcher matcher = PATTERN.matcher(query); List<String> questions = new ArrayList<>(); while (matcher.find()) { ...
String q1 = "?:What is blue? ?:What is green?"; Output output = SearchTool.getQuestions(q1); assertEquals("What is blue?", output.items.get(0)); assertEquals("What is green?", output.items.get(1)); assertEquals("", output.query); String q2 = "colors ?:\"What is red?\" ?:...
[FOCAL] protected static Output SearchTool.getQuestions(String query) [CLASS] class SearchTool extends AbstractAuthBasedThriftServiceClient [METRICS] loc=17 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] PATTERN.matcher/1, Matcher.find/0, Matcher.group/0, String.replaceFirst/2, Pattern.quote/1, g...
/* static context [FOCAL] protected static Output SearchTool.getQuestions(String query) [PATH1] while(matcher.find())=T -> exit loop -> return new Output(query, questions) [PATH2] while(matcher.find())=F -> return new Output(query, questions) [INPUTS] branches=query | result=query [NEW] ArrayList<>, Output [CALLS-EXTER...
/* static context [FOCAL] protected static Output SearchTool.getQuestions(String query) [PATH1] while(matcher.find())=T -> exit loop -> return new Output(query, questions) [PATH2] while(matcher.find())=F -> return new Output(query, questions) [INPUTS] branches=query | result=query [NEW] ArrayList<>, Output [CALLS-EXTER...
true
ok
{"focal": {"class": "SearchTool", "name": "getQuestions", "signature": "Output getQuestions(String query)", "start_line": 3, "modifiers": "protected static", "params": [{"name": "query", "type": "String"}], "return_type": "Output"}, "class_info": {"name": "SearchTool", "kind": "class", "modifiers": "", "superclass": "A...
21180741_325
class FhirSystemDaoR4 extends BaseHapiFhirSystemDao<Bundle, Meta> { @Transactional(propagation = Propagation.NEVER) @Override public Bundle transaction(RequestDetails theRequestDetails, Bundle theRequest) { return myTransactionProcessor.transaction(theRequestDetails, theRequest); } @Override @PostConstruct pub...
Bundle inputBundle = new Bundle(); inputBundle.setType(Bundle.BundleType.TRANSACTION); Encounter enc1 = new Encounter(); enc1.addIdentifier().setSystem("urn:foo").setValue("12345"); inputBundle .addEntry() .setResource(enc1) .getRequest() .setMethod(HTTPVerb.PUT) .setUrl("Encounter?identifier=...
[FOCAL] @Transactional(propagation = Propagation.NEVER) @Override public Bundle FhirSystemDaoR4.transaction(RequestDetails theRequestDetails, Bundle theRequest) [CLASS] class FhirSystemDaoR4 extends BaseHapiFhirSystemDao<Bundle, Meta> [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL]...
/* static context [FOCAL] @Transactional(propagation = Propagation.NEVER) @Override public Bundle FhirSystemDaoR4.transaction(RequestDetails theRequestDetails, Bundle theRequest) [INPUTS] branches=- | result=theRequest, theRequestDetails [COLLABORATORS] field myTransactionProcessor transaction/2 [CALLS-EXTERNAL] myTran...
/* static context [FOCAL] @Transactional(propagation = Propagation.NEVER) @Override public Bundle FhirSystemDaoR4.transaction(RequestDetails theRequestDetails, Bundle theRequest) [INPUTS] branches=- | result=theRequest, theRequestDetails [COLLABORATORS] field myTransactionProcessor transaction/2 [CALLS-EXTERNAL] myTran...
true
ok
{"focal": {"class": "FhirSystemDaoR4", "name": "transaction", "signature": "Bundle transaction(RequestDetails theRequestDetails, Bundle theRequest)", "start_line": 3, "modifiers": "@Transactional(propagation = Propagation.NEVER) @Override public", "params": [{"name": "theRequestDetails", "type": "RequestDetails"}, {"na...
21182169_0
class UriQueryParser { public static Map<String, List<String>> getUrlParameters(String url) { try { final Map<String, List<String>> query_pairs = new LinkedHashMap<String, List<String>>(); final String[] pairs = getQuery(url).split("&"); for (String pair : pairs) { ...
String uri = "/stuff/test?param1=itworked&param2=rad&param1=cool"; Map<String, List<String>> params = UriQueryParser.getUrlParameters(uri); assertNotNull(params); assertEquals(2, params.get("param1").size()); assertEquals("itworked", params.get("param1").get(0)); asser...
[FOCAL] public static Map<String, List<String>> UriQueryParser.getUrlParameters(String url) [CLASS] class UriQueryParser [METRICS] loc=20 cc=4 branches=1 loops=1 returns=1 throws=1 nesting=3 [CALLS-INTERNAL] String getQuery(String uri) [CALLS-EXTERNAL] getQuery(url).split/1, String.indexOf/1, URLDecoder.decode/2, Strin...
/* static context [FOCAL] public static Map<String, List<String>> UriQueryParser.getUrlParameters(String url) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] foreach(String pair : pairs)=T -> if(!query_pairs.containsKey(key))=T -> exit loop -> return query_pairs [PATH2] try-body throws -> throw new RuntimeE...
/* static context [FOCAL] public static Map<String, List<String>> UriQueryParser.getUrlParameters(String url) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] foreach(String pair : pairs)=T -> if(!query_pairs.containsKey(key))=T -> exit loop -> return query_pairs [PATH2] try-body throws -> throw new RuntimeE...
true
ok
{"focal": {"class": "UriQueryParser", "name": "getUrlParameters", "signature": "Map<String, List<String>> getUrlParameters(String url)", "start_line": 3, "modifiers": "public static", "params": [{"name": "url", "type": "String"}], "return_type": "Map<String, List<String>>"}, "class_info": {"name": "UriQueryParser", "ki...
21190869_0
class AuroraTableNameServiceImpl implements AuroraTableNameService<T> { @Override public Try<TableName> resolveTableNameByHint(T hint) { Validate.notNull(hint); TableName tableName = tableNameResolver.apply(hint); if (tableNames != null && !containsInTableNames(tableName)) { ...
AuroraTableNameService<Integer> atns = AuroraTableNameServiceFactory.create(new AbstractTableNameResolver<Integer>("user") { @Override protected String getSuffixName(Integer hint) { return Integer.toString(hint % 2); } }); TableName tableName1 ...
[FOCAL] @Override public Try<TableName> AuroraTableNameServiceImpl.resolveTableNameByHint(T hint) [CLASS] class AuroraTableNameServiceImpl implements AuroraTableNameService<T> [METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] boolean containsInTableNames(TableName tableName) [CALLS-...
/* static context [FOCAL] @Override public Try<TableName> AuroraTableNameServiceImpl.resolveTableNameByHint(T hint) [PATH1] if(tableNames != null && !containsInTableNames(tableName))=T -> return Try.ofFailure(new IllegalArgumentException(String.format("hint(%s) ... [PATH2] if(tableNames != null && !containsInTableNames...
/* static context [FOCAL] @Override public Try<TableName> AuroraTableNameServiceImpl.resolveTableNameByHint(T hint) [PATH1] if(tableNames != null && !containsInTableNames(tableName))=T -> return Try.ofFailure(new IllegalArgumentException(String.format("hint(%s) ... [PATH2] if(tableNames != null && !containsInTableNames...
true
ok
{"focal": {"class": "AuroraTableNameServiceImpl", "name": "resolveTableNameByHint", "signature": "Try<TableName> resolveTableNameByHint(T hint)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "hint", "type": "T"}], "return_type": "Try<TableName>"}, "class_info": {"name": "AuroraTableNameServiceI...
21193524_24
class Util { public static String toLinux(String s) { return s.replace("\r\n", "\n"); } private Util(); public static boolean isSingleValue(SqlCall call); public static void discard(Object o); public static void discard(int i); public static void discard(boolean b); public static void discard(do...
String[] before = { "Get a dose of her in jackboots and kilt", "She's killer-diller when she's dressed to the hilt", "She's the kind of a girl that makes The News of The World", "Yes you could say she was attractively built.", "Yeah yeah yeah." }; String[] after = { ...
[FOCAL] public static String Util.toLinux(String s) [CLASS] class Util [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] String.replace/2 [INPUTS] branches=- | result=s [DATAFLOW] s@param->L2 [CLASS-MEMBERS] Util(); boolean isSingleValue(SqlCall call); void discard(Object o); void di...
class Util { public static String toLinux(String s) { return s.replace("\r\n", "\n"); } private Util(); public static boolean isSingleValue(SqlCall call); public static void discard(Object o); public static void discard(int i); public static void discard(boolean b); public static void discard(do...
false
ok
{"focal": {"class": "Util", "name": "toLinux", "signature": "String toLinux(String s)", "start_line": 3, "modifiers": "public static", "params": [{"name": "s", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Util", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields":...
21217047_173
class InPlaceRightRotator implements Rotator<E, MutableBinaryTreeNode<E>> { @Override public void rotate(ParentReference<MutableBinaryTreeNode<E>> reference, MutableBinaryTreeNode<E> currentRoot) { final MutableBinaryTreeNodeImpl<E> root = (MutableBinaryTreeNodeImpl<E>)currentRoot; final Mutabl...
final ParentReferenceFactoryImpl<String> factory = new ParentReferenceFactoryImpl<>(); final MutableBinaryTreeNodeImpl<String> a = new MutableBinaryTreeNodeImpl<>("a"); final MutableBinaryTreeNodeImpl<String> c = new MutableBinaryTreeNodeImpl<>("c"); final MutableBinaryTreeNodeImpl<Strin...
[FOCAL] @Override public void InPlaceRightRotator.rotate(ParentReference<MutableBinaryTreeNode<E>> reference, MutableBinaryTreeNode<E> currentRoot) [CLASS] class InPlaceRightRotator implements Rotator<E, MutableBinaryTreeNode<E>> [METRICS] loc=22 cc=3 branches=2 loops=0 returns=0 throws=1 nesting=2 [CALLS-EXTERNAL] Mut...
/* static context [FOCAL] @Override public void InPlaceRightRotator.rotate(ParentReference<MutableBinaryTreeNode<E>> reference, MutableBinaryTreeNode<E> currentRoot) [THROWS-WHEN] IllegalStateException when pivot == null [PATH1] if(pivot == null)=T -> throw new IllegalStateException("No pivot node") [PATH2] if(pivot ==...
/* static context [FOCAL] @Override public void InPlaceRightRotator.rotate(ParentReference<MutableBinaryTreeNode<E>> reference, MutableBinaryTreeNode<E> currentRoot) [THROWS-WHEN] IllegalStateException when pivot == null [PATH1] if(pivot == null)=T -> throw new IllegalStateException("No pivot node") [PATH2] if(pivot ==...
true
ok
{"focal": {"class": "InPlaceRightRotator", "name": "rotate", "signature": "void rotate(ParentReference<MutableBinaryTreeNode<E>> reference, MutableBinaryTreeNode<E> currentRoot)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "reference", "type": "ParentReference<MutableBinaryTreeNode<E>>"}, {"n...
21235372_2
class Fibo { public static int fibo(int n) { if (n < 0) { throw new IllegalArgumentException("n must be positive"); } if (n <= 1) { return n; } return fibo(n - 1) + fibo(n - 2); } @Parameter(0) public int x; @Parameter(1) public i...
assumeThat(expectedException).isNotNull(); assertWhen((p) -> Fibo.fibo(p), x).throwException( instanceOf(expectedException)); } }
[FOCAL] public static int Fibo.fibo(int n) [CLASS] class Fibo [METRICS] loc=9 cc=3 branches=2 loops=0 returns=2 throws=1 nesting=1 [CALLS-EXTERNAL] fibo/1 (inherited) [NEW] IllegalArgumentException [EXCEPTIONS] throws IllegalArgumentException [THROWS-WHEN] IllegalArgumentException when n < 0 [PATH1] if(n < 0)=F -> if(n...
/* static context [FOCAL] public static int Fibo.fibo(int n) [THROWS-WHEN] IllegalArgumentException when n < 0 [PATH1] if(n < 0)=F -> if(n <= 1)=T -> return n [PATH2] if(n < 0)=T -> throw new IllegalArgumentException("n must be positive") [PATH3] if(n < 0)=F -> if(n <= 1)=F -> return fibo(n - 1) + fibo(n - 2) [INPUTS] ...
/* static context [FOCAL] public static int Fibo.fibo(int n) [THROWS-WHEN] IllegalArgumentException when n < 0 [PATH1] if(n < 0)=F -> if(n <= 1)=T -> return n [PATH2] if(n < 0)=T -> throw new IllegalArgumentException("n must be positive") [PATH3] if(n < 0)=F -> if(n <= 1)=F -> return fibo(n - 1) + fibo(n - 2) [INPUTS] ...
true
ok
{"focal": {"class": "Fibo", "name": "fibo", "signature": "int fibo(int n)", "start_line": 3, "modifiers": "public static", "params": [{"name": "n", "type": "int"}], "return_type": "int"}, "class_info": {"name": "Fibo", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "x", "t...
21242302_0
class TemplateImpl implements Template { @Override public String getTemplateStringWithoutColumnNames() { return templateStringWithoutColumnNames; } TemplateImpl(); TemplateImpl(String template); private static boolean isEscaped(int index, char[] chars); @Override public String...
assertEquals("http://ex.org/", new TemplateImpl("http://ex.org/").getTemplateStringWithoutColumnNames()); assertEquals("http://ex.org/{}", new TemplateImpl("http://ex.org/{name}").getTemplateStringWithoutColumnNames()); assertEquals("http://ex.org/{}/", ...
[FOCAL] @Override public String TemplateImpl.getTemplateStringWithoutColumnNames() [CLASS] class TemplateImpl implements Template [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] TemplateImpl(); TemplateImpl(String template); boolean isEscaped(int index, char[] chars); String getStri...
/* static context [FOCAL] @Override public String TemplateImpl.getTemplateStringWithoutColumnNames() */
/* static context [FOCAL] @Override public String TemplateImpl.getTemplateStringWithoutColumnNames() */ class TemplateImpl implements Template { @Override public String getTemplateStringWithoutColumnNames() { return templateStringWithoutColumnNames; } TemplateImpl(); TemplateImpl(Strin...
true
ok
{"focal": {"class": "TemplateImpl", "name": "getTemplateStringWithoutColumnNames", "signature": "String getTemplateStringWithoutColumnNames()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "TemplateImpl", "kind": "class", "modifiers": "", "superclass":...
21248236_23
class LitecoinAddressValidator implements ICryptoAddressValidator { @Override public boolean isAddressValid(String address) { if (address.startsWith("L") || address.startsWith("3") || address.startsWith("M")) { try { Base58.decodeToBigInteger(address); Base58...
LitecoinAddressValidator lav = new LitecoinAddressValidator(); String address = "MMR2PV6EqX617NYzVsztfMFRZTr6zDHWQx"; boolean isValid = lav.isAddressValid(address); Assert.assertTrue(isValid); } }
[FOCAL] @Override public boolean LitecoinAddressValidator.isAddressValid(String address) [CLASS] class LitecoinAddressValidator implements ICryptoAddressValidator [METRICS] loc=23 cc=5 branches=2 loops=0 returns=5 throws=0 nesting=3 [CALLS-EXTERNAL] String.startsWith/1, Base58.decodeToBigInteger/1, Base58.decodeChecked...
/* static context [FOCAL] @Override public boolean LitecoinAddressValidator.isAddressValid(String address) [PATH1] if(address.startsWith("L") || address.startsWith("3") || address.startsWith("M"))=F -> if(address.toLowerCase().startsWith("ltc1"))=T -> try-body throws -> return false [PATH2] if(address.startsWith("L") |...
/* static context [FOCAL] @Override public boolean LitecoinAddressValidator.isAddressValid(String address) [PATH1] if(address.startsWith("L") || address.startsWith("3") || address.startsWith("M"))=F -> if(address.toLowerCase().startsWith("ltc1"))=T -> try-body throws -> return false [PATH2] if(address.startsWith("L") |...
true
ok
{"focal": {"class": "LitecoinAddressValidator", "name": "isAddressValid", "signature": "boolean isAddressValid(String address)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "address", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "LitecoinAddressValidator", "kind": "cla...
21252787_66
class NodeRef implements Bounded, Comparable<NodeRef> { public static void checkValidPath(final String path) { if (path == null) { throw new IllegalArgumentException("null path"); } if (path.isEmpty()) { throw new IllegalArgumentException("empty path"); } ...
assertThrows(IllegalArgumentException.class, () -> NodeRef.checkValidPath(null)); } }
[FOCAL] public static void NodeRef.checkValidPath(String path) [CLASS] class NodeRef implements Bounded, Comparable<NodeRef> [METRICS] loc=11 cc=4 branches=3 loops=0 returns=0 throws=3 nesting=1 [CALLS-EXTERNAL] String.isEmpty/0, String.charAt/1, String.length/0 [NEW] IllegalArgumentException [EXCEPTIONS] throws Illega...
/* static context [FOCAL] public static void NodeRef.checkValidPath(String path) [THROWS-WHEN] IllegalArgumentException when path == null [THROWS-WHEN] IllegalArgumentException when !(path == null) && path.isEmpty() [THROWS-WHEN] IllegalArgumentException when !(path == null) && !path.isEmpty() && path.charAt(path.lengt...
/* static context [FOCAL] public static void NodeRef.checkValidPath(String path) [THROWS-WHEN] IllegalArgumentException when path == null [THROWS-WHEN] IllegalArgumentException when !(path == null) && path.isEmpty() [THROWS-WHEN] IllegalArgumentException when !(path == null) && !path.isEmpty() && path.charAt(path.lengt...
true
ok
{"focal": {"class": "NodeRef", "name": "checkValidPath", "signature": "void checkValidPath(String path)", "start_line": 3, "modifiers": "public static", "params": [{"name": "path", "type": "String"}], "return_type": "void"}, "class_info": {"name": "NodeRef", "kind": "class", "modifiers": "", "superclass": null, "interf...
21257044_10
class ServerInstanceContext { public static ServerInstanceContext initialize() { try { return new ServerInstanceContext(); } catch (Exception e) { LOGGER.warn("Caught exception initializing AWS Instance Context.",e); return null; } } private Ser...
Assert.assertNull(ServerInstanceContext.initialize()); } }
[FOCAL] public static ServerInstanceContext ServerInstanceContext.initialize() [CLASS] class ServerInstanceContext [METRICS] loc=8 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] LOGGER.warn/2 [NEW] ServerInstanceContext [EXCEPTIONS] catches Exception e [PATH1] try-body throws -> return null [PATH...
/* static context [FOCAL] public static ServerInstanceContext ServerInstanceContext.initialize() [PATH1] try-body throws -> return null [PATH2] return new ServerInstanceContext() [EXCEPTIONS] catches Exception e [NEW] ServerInstanceContext [CALLS-EXTERNAL] LOGGER.warn/2 */
/* static context [FOCAL] public static ServerInstanceContext ServerInstanceContext.initialize() [PATH1] try-body throws -> return null [PATH2] return new ServerInstanceContext() [EXCEPTIONS] catches Exception e [NEW] ServerInstanceContext [CALLS-EXTERNAL] LOGGER.warn/2 */ class ServerInstanceContext { public stat...
true
ok
{"focal": {"class": "ServerInstanceContext", "name": "initialize", "signature": "ServerInstanceContext initialize()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "ServerInstanceContext"}, "class_info": {"name": "ServerInstanceContext", "kind": "class", "modifiers": "", "superclass": null...
21266289_82
class CommodityActionService { public int getMonthlyValue(Commodity commodity, Date startingDate, Date endDate, DataElementType dataElementType) { SQLiteOpenHelper openHelper = LmisSqliteOpenHelper.getInstance(context); int commodityActionValueQuantity = 0; try { Dao<CommodityAc...
Commodity commodity = commodityService.all().get(1); Calendar calendar = Calendar.getInstance(); calendar.set(2014, Calendar.APRIL, 01); Date startDate = calendar.getTime(); calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); Date endDa...
[FOCAL] public int CommodityActionService.getMonthlyValue(Commodity commodity, Date startingDate, Date endDate, DataElementType dataElementType) [CLASS] class CommodityActionService [METRICS] loc=27 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] List<String> monthlyPeriods(Date startDate, Date en...
/* static context [FOCAL] public int CommodityActionService.getMonthlyValue(Commodity commodity, Date startingDate, Date endDate, DataElementType dataElementType) [PATH1] try-body throws -> throw new LmisException(e) -> return commodityActionValueQuantity [INPUTS] branches=- | result=endDate, startingDate [COLLABORATOR...
/* static context [FOCAL] public int CommodityActionService.getMonthlyValue(Commodity commodity, Date startingDate, Date endDate, DataElementType dataElementType) [PATH1] try-body throws -> throw new LmisException(e) -> return commodityActionValueQuantity [INPUTS] branches=- | result=endDate, startingDate [COLLABORATOR...
true
ok
{"focal": {"class": "CommodityActionService", "name": "getMonthlyValue", "signature": "int getMonthlyValue(Commodity commodity, Date startingDate, Date endDate, DataElementType dataElementType)", "start_line": 3, "modifiers": "public", "params": [{"name": "commodity", "type": "Commodity"}, {"name": "startingDate", "typ...
21285858_2
class MesosNimbus implements INimbus { public Map<String, List<TaskInfo>> getTasksToLaunch(Topologies topologies, Map<String, Collection<WorkerSlot>> slots, Map<String, AggregatedOffers> aggregatedOffersPerNod...
TopologyDetails t1 = TestUtils.constructTopologyDetails("t1", MesosNimbusTest.DEFAULT_WORKER_COUNT, MesosCommon.DEFAULT_WORKER_CPU, Meso...
[FOCAL] public Map<String, List<TaskInfo>> MesosNimbus.getTasksToLaunch(Topologies topologies, Map<String, Collection<WorkerSlot>> slots, Map<String, AggregatedOffers> aggregatedOffersPerNode) [CLASS] class MesosNimbus implements INimbus [METRICS] loc=120 cc=10 branches=5 loops=3 returns=1 throws=0 nesting=4 [CALLS-INT...
class MesosNimbus implements INimbus { public Map<String, List<TaskInfo>> getTasksToLaunch(Topologies topologies, Map<String, Collection<WorkerSlot>> slots, Map<String, AggregatedOffers> aggregatedOffersPerNod...
false
ok
{"focal": {"class": "MesosNimbus", "name": "getTasksToLaunch", "signature": "Map<String, List<TaskInfo>> getTasksToLaunch(Topologies topologies, Map<String, Collection<WorkerSlot>> slots, Map<String, AggregatedOffers> aggregatedOffersPerNode)", "start_line": 3, "modifiers": "public", "params": [{"name": "topologies", "...
21330228_66
class GroovyshCommand implements CliCommand { @Override public int run(@Nonnull ProcessStream process) throws CmdLineException { IO io = new IO(new BufferedInputStream(process.in()), process.out(), process.err()); // Do not use .inputrc as jline does not interpret it correctly: https://github...
stdin("D.runtime.threads.size()%n"); run("groovysh", "--in", "threaddump:" + logPath); assertThat(err.toString(), equalTo("")); assertThat(out.toString(), containsString(" 18%n")); assertThat(this, succeeded()); } }
[FOCAL] @Override public int GroovyshCommand.run(ProcessStream process) [CLASS] class GroovyshCommand implements CliCommand [METRICS] loc=17 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Collection<String> getImports(); void configureHistory(ProcessStream process, Groovysh groovysh) [CALLS-EXTER...
/* static context [FOCAL] @Override public int GroovyshCommand.run(ProcessStream process) [INPUTS] branches=- | result=process [COLLABORATORS] param process:ProcessStream in/0,out/0,err/0 [EXCEPTIONS] declares CmdLineException [CALLS-INTERNAL] Collection<String> getImports(); void configureHistory(ProcessStream process...
/* static context [FOCAL] @Override public int GroovyshCommand.run(ProcessStream process) [INPUTS] branches=- | result=process [COLLABORATORS] param process:ProcessStream in/0,out/0,err/0 [EXCEPTIONS] declares CmdLineException [CALLS-INTERNAL] Collection<String> getImports(); void configureHistory(ProcessStream process...
true
ok
{"focal": {"class": "GroovyshCommand", "name": "run", "signature": "int run(ProcessStream process) throws CmdLineException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "process", "type": "ProcessStream"}], "return_type": "int"}, "class_info": {"name": "GroovyshCommand", "kind": "class", "modi...
21352848_115
class CreateCandidatesMapper implements MapFunction<ParsedWikiDocument, WikiDocumentOutput> { public static int closestIdentifierPosition(List<Integer> positions, int wordIdx) { if (positions.isEmpty()) { return -1; } Iterator<Integer> it = positions.iterator(); int bestPos = it.next(); int...
List<Integer> positions = Arrays.asList(10); int actual = CreateCandidatesMapper.closestIdentifierPosition(positions, 4); assertEquals(10, actual); } }
[FOCAL] public static int CreateCandidatesMapper.closestIdentifierPosition(List<Integer> positions, int wordIdx) [CLASS] class CreateCandidatesMapper implements MapFunction<ParsedWikiDocument, WikiDocumentOutput> [METRICS] loc=19 cc=4 branches=2 loops=1 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] List<Integer>.isEmpt...
/* static context [FOCAL] public static int CreateCandidatesMapper.closestIdentifierPosition(List<Integer> positions, int wordIdx) [PATH1] if(positions.isEmpty())=F -> while(it.hasNext())=T -> if(dist < bestDist)=T -> exit loop -> return bestPos [PATH2] if(positions.isEmpty())=T -> return -1 [PATH3] if(positions.isEmpt...
/* static context [FOCAL] public static int CreateCandidatesMapper.closestIdentifierPosition(List<Integer> positions, int wordIdx) [PATH1] if(positions.isEmpty())=F -> while(it.hasNext())=T -> if(dist < bestDist)=T -> exit loop -> return bestPos [PATH2] if(positions.isEmpty())=T -> return -1 [PATH3] if(positions.isEmpt...
true
ok
{"focal": {"class": "CreateCandidatesMapper", "name": "closestIdentifierPosition", "signature": "int closestIdentifierPosition(List<Integer> positions, int wordIdx)", "start_line": 3, "modifiers": "public static", "params": [{"name": "positions", "type": "List<Integer>"}, {"name": "wordIdx", "type": "int"}], "return_ty...
21357013_15
class ProtoDOMBuilder { public static ProtoNode buildDOM(byte[] data) throws ProtoReaderException { ProtoStreamNode node = new ProtoStreamNode(-1, data); return node; } private ProtoDOMBuilder(); public static ProtoNode buildDOM(byte[] data, int startOffset, int dataSize); priva...
ByteArrayOutputStream subOut = new ByteArrayOutputStream(); ByteArrayOutputStream out = new ByteArrayOutputStream(); ProtoWriter pw = new ProtoWriter(out); pw.put(TEST_TAG_1); pw.put(CoreTags.TAG_STREAM, subOut); pw.put(TEST_TAG_2, "test"); pw.flush(); Pro...
[FOCAL] public static ProtoNode ProtoDOMBuilder.buildDOM(byte[] data) [CLASS] class ProtoDOMBuilder [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] ProtoStreamNode [EXCEPTIONS] declares ProtoReaderException [INPUTS] branches=- | result=data [DATAFLOW] data@param->L2; node@L2->L3 [CLASS-MEMBER...
/* static context [FOCAL] public static ProtoNode ProtoDOMBuilder.buildDOM(byte[] data) [INPUTS] branches=- | result=data [EXCEPTIONS] declares ProtoReaderException [NEW] ProtoStreamNode */
/* static context [FOCAL] public static ProtoNode ProtoDOMBuilder.buildDOM(byte[] data) [INPUTS] branches=- | result=data [EXCEPTIONS] declares ProtoReaderException [NEW] ProtoStreamNode */ class ProtoDOMBuilder { public static ProtoNode buildDOM(byte[] data) throws ProtoReaderException { ProtoStreamNode n...
true
ok
{"focal": {"class": "ProtoDOMBuilder", "name": "buildDOM", "signature": "ProtoNode buildDOM(byte[] data) throws ProtoReaderException", "start_line": 3, "modifiers": "public static", "params": [{"name": "data", "type": "byte[]"}], "return_type": "ProtoNode"}, "class_info": {"name": "ProtoDOMBuilder", "kind": "class", "m...
21357853_0
class DateTimeUtils { public static String iso8601UTCFromDate(Date date) { if (date == null) { return ""; } TimeZone tz = TimeZone.getTimeZone("UTC"); DateFormat formatter = ISO8601_FORMAT.get(); formatter.setTimeZone(tz); String iso8601date = formatter....
// Arrange TimeZone.setDefault(TimeZone.getTimeZone("GMT+2:00")); Date date = new Date(mDefaultDate); String expected = "2019-07-30T10:54:18+00:00"; // Act String actual = DateTimeUtils.iso8601UTCFromDate(date); // Assert assertThat(actual).isEqualTo(exp...
[FOCAL] public static String DateTimeUtils.iso8601UTCFromDate(Date date) [CLASS] class DateTimeUtils [METRICS] loc=13 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] TimeZone.getTimeZone/1, ISO8601_FORMAT.get/0, DateFormat.setTimeZone/1, DateFormat.format/1, String.replace/2 [PATH1] if(date == nul...
/* static context [FOCAL] public static String DateTimeUtils.iso8601UTCFromDate(Date date) [PATH1] if(date == null)=T -> return "" [PATH2] if(date == null)=F -> return iso8601date.replace("+0000", "+00:00") [INPUTS] branches=date | result=date [CALLS-EXTERNAL] TimeZone.getTimeZone/1, ISO8601_FORMAT.get/0, DateFormat.se...
/* static context [FOCAL] public static String DateTimeUtils.iso8601UTCFromDate(Date date) [PATH1] if(date == null)=T -> return "" [PATH2] if(date == null)=F -> return iso8601date.replace("+0000", "+00:00") [INPUTS] branches=date | result=date [CALLS-EXTERNAL] TimeZone.getTimeZone/1, ISO8601_FORMAT.get/0, DateFormat.se...
true
ok
{"focal": {"class": "DateTimeUtils", "name": "iso8601UTCFromDate", "signature": "String iso8601UTCFromDate(Date date)", "start_line": 3, "modifiers": "public static", "params": [{"name": "date", "type": "Date"}], "return_type": "String"}, "class_info": {"name": "DateTimeUtils", "kind": "class", "modifiers": "", "superc...
21363553_1
class JMHAssertions { public static JMHRunBuilderAssert assertJMH() { return new RunBuilderAssert(); } private JMHAssertions(); public static JMHRunResultsAssert assertJMH(Options options); public static JMHRunResultsAssert assertJMH(Collection<RunResult> results); public static JMHR...
assertJMH().hasResults(); } }
[FOCAL] public static JMHRunBuilderAssert JMHAssertions.assertJMH() [CLASS] class JMHAssertions [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] RunBuilderAssert [CLASS-MEMBERS] JMHAssertions(); JMHRunResultsAssert assertJMH(Options options); JMHRunResultsAssert assertJMH(Collection<RunResult>...
/* static context [FOCAL] public static JMHRunBuilderAssert JMHAssertions.assertJMH() [NEW] RunBuilderAssert */
/* static context [FOCAL] public static JMHRunBuilderAssert JMHAssertions.assertJMH() [NEW] RunBuilderAssert */ class JMHAssertions { public static JMHRunBuilderAssert assertJMH() { return new RunBuilderAssert(); } private JMHAssertions(); public static JMHRunResultsAssert assertJMH(Options ...
true
ok
{"focal": {"class": "JMHAssertions", "name": "assertJMH", "signature": "JMHRunBuilderAssert assertJMH()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "JMHRunBuilderAssert"}, "class_info": {"name": "JMHAssertions", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, ...
21366948_53
class MetaverseLogicalIdGenerator implements ILogicalIdGenerator { @Override public String generateId( IHasProperties propertiesNode ) { Set<String> propertyKeys = getLogicalIdPropertyKeys(); if ( propertiesNode.getPropertyKeys().size() == 0 ) { return null; } String logicalId = null; ...
String[] logicalIdKeys = new String[] { "name", "type", "dataSource" }; idGenerator = new MetaverseLogicalIdGenerator( logicalIdKeys ); String expected = "{\"dataSource\":{\"name\":\"Sampledata\",\"type\":\"Database Connection\"}," + "\"name\":\"SALES_DATA\",\"type\":\"Database Table\"}"; when( ...
[FOCAL] @Override public String MetaverseLogicalIdGenerator.generateId(IHasProperties propertiesNode) [CLASS] class MetaverseLogicalIdGenerator implements ILogicalIdGenerator [METRICS] loc=52 cc=9 branches=7 loops=1 returns=2 throws=0 nesting=6 [CALLS-INTERNAL] DateFormat getDateFormat(); Set<String> getLogicalIdProper...
/* static context [FOCAL] @Override public String MetaverseLogicalIdGenerator.generateId(IHasProperties propertiesNode) [PATH1] if(propertiesNode.getPropertyKeys().size() == 0)=F -> if(propertyKeys != null && propertyKeys.size() > 0)=T -> if(propertyKeys.size() > 0)=T -> foreach(String key : propertyKeys)=T -> if(i++ >...
/* static context [FOCAL] @Override public String MetaverseLogicalIdGenerator.generateId(IHasProperties propertiesNode) [PATH1] if(propertiesNode.getPropertyKeys().size() == 0)=F -> if(propertyKeys != null && propertyKeys.size() > 0)=T -> if(propertyKeys.size() > 0)=T -> foreach(String key : propertyKeys)=T -> if(i++ >...
true
ok
{"focal": {"class": "MetaverseLogicalIdGenerator", "name": "generateId", "signature": "String generateId(IHasProperties propertiesNode)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "propertiesNode", "type": "IHasProperties"}], "return_type": "String"}, "class_info": {"name": "MetaverseLogical...
21367254_93
class Linear extends TransferFunction implements Serializable { @Override public double getDerivative(double net) { return this.slope; } public Linear(); public Linear(double slope); public Linear(Properties properties); public double getSlope(); public void setSlope(double slope); @Override public dou...
double result = instance.getDerivative(input); assertEquals(1, result, 0.0); } }
[FOCAL] @Override public double Linear.getDerivative(double net) [CLASS] class Linear extends TransferFunction implements Serializable [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [FIELDS] read=slope [INPUTS] branches=- | result=- | unused=net [CLASS-MEMBERS] Linear(); Linear(double slope); Line...
/* static context [FOCAL] @Override public double Linear.getDerivative(double net) [INPUTS] branches=- | result=- | unused=net [FIELDS] read=slope */
/* static context [FOCAL] @Override public double Linear.getDerivative(double net) [INPUTS] branches=- | result=- | unused=net [FIELDS] read=slope */ class Linear extends TransferFunction implements Serializable { @Override public double getDerivative(double net) { return this.slope; } public Linear(); public...
true
ok
{"focal": {"class": "Linear", "name": "getDerivative", "signature": "double getDerivative(double net)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "net", "type": "double"}], "return_type": "double"}, "class_info": {"name": "Linear", "kind": "class", "modifiers": "", "superclass": "TransferFun...
21388581_1
class RdbmsReader extends AbstractRdbmsComponentRuntime { public static Map<Integer, String> getSqlColumnEntityHints(String sql) { Map<Integer, String> columnEntityHints = new HashMap<Integer, String>(); String columns = sql.substring(sql.toLowerCase().indexOf("select") + 6, getFromIndex(sql)); ...
String sql = "select\r\n ISNULL(a,ISNULL(z,'')) /*COLA*/, 'lastName, firstName'/*COLB*/, c/* COLC */, d /* \"COL D\" */ from test;"; Map<Integer, String> hints = RdbmsReader.getSqlColumnEntityHints(sql); assertEquals(hints.get(1), "COLA"); assertEquals(hints.get(2), "COLB"); as...
[FOCAL] public static Map<Integer, String> RdbmsReader.getSqlColumnEntityHints(String sql) [CLASS] class RdbmsReader extends AbstractRdbmsComponentRuntime [METRICS] loc=23 cc=4 branches=2 loops=1 returns=1 throws=1 nesting=3 [CALLS-INTERNAL] int countColumnSeparatingCommas(String value); int getFromIndex(String sql) [C...
/* static context [FOCAL] public static Map<Integer, String> RdbmsReader.getSqlColumnEntityHints(String sql) [THROWS-WHEN] MisconfiguredException when columns.indexOf("/*", commentIdx) != -1 && entity.contains(".") && used.contains(entity) [PATH1] while(columns.indexOf("/*", commentIdx) != -1)=T -> if(entity.contains("...
/* static context [FOCAL] public static Map<Integer, String> RdbmsReader.getSqlColumnEntityHints(String sql) [THROWS-WHEN] MisconfiguredException when columns.indexOf("/*", commentIdx) != -1 && entity.contains(".") && used.contains(entity) [PATH1] while(columns.indexOf("/*", commentIdx) != -1)=T -> if(entity.contains("...
true
ok
{"focal": {"class": "RdbmsReader", "name": "getSqlColumnEntityHints", "signature": "Map<Integer, String> getSqlColumnEntityHints(String sql)", "start_line": 3, "modifiers": "public static", "params": [{"name": "sql", "type": "String"}], "return_type": "Map<Integer, String>"}, "class_info": {"name": "RdbmsReader", "kind...
21394954_5
class BootErrorCollector { public OperationStepHandler getReadBootErrorsHandler() { return this.listBootErrorsHandler; } public BootErrorCollector(); void addFailureDescription(final ModelNode operation, final ModelNode failureDescription); private ModelNode getErrors(); } class BootE...
BootErrorCollector instance = new BootErrorCollector(); BootErrorCollector.ListBootErrorsHandler handler = (BootErrorCollector.ListBootErrorsHandler) instance.getReadBootErrorsHandler(); assertThat(handler, is(notNullValue())); OperationEntry entry = createOperationEntry(true, false); ...
[FOCAL] public OperationStepHandler BootErrorCollector.getReadBootErrorsHandler() [CLASS] class BootErrorCollector [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [FIELDS] read=listBootErrorsHandler [CLASS-MEMBERS] BootErrorCollector(); void addFailureDescription(ModelNode operation, ModelNode fail...
/* static context [FOCAL] public OperationStepHandler BootErrorCollector.getReadBootErrorsHandler() [FIELDS] read=listBootErrorsHandler */
/* static context [FOCAL] public OperationStepHandler BootErrorCollector.getReadBootErrorsHandler() [FIELDS] read=listBootErrorsHandler */ class BootErrorCollector { public OperationStepHandler getReadBootErrorsHandler() { return this.listBootErrorsHandler; } public BootErrorCollector(); vo...
true
ok
{"focal": {"class": "BootErrorCollector", "name": "getReadBootErrorsHandler", "signature": "OperationStepHandler getReadBootErrorsHandler()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "OperationStepHandler"}, "class_info": {"name": "BootErrorCollector", "kind": "class", "modifiers": "", "supe...
21432552_2
class OpenRtbValidator { public boolean validate(BidRequest request, BidResponse.Builder response) { return !OpenRtbUtils.removeBids(response, bid -> validate(request, bid)); } @Inject public OpenRtbValidator(MetricRegistry metricRegistry); public boolean validate(BidRequest request, Bid.Builder bid); ...
BidResponse.Builder response = testResponse(testBid() .addAllAdomain(asList("adv0.com", "adv2.com", "adv3.com")) .addAllAttr(asList(CreativeAttribute.SURVEYS))); validator.validate(requestBanner, response); assertThat(OpenRtbUtils.bids(response)).isEmpty(); } }
[FOCAL] public boolean OpenRtbValidator.validate(BidRequest request, BidResponse.Builder response) [CLASS] class OpenRtbValidator [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] boolean validate(BidRequest request, Bid.Builder bid) [CALLS-EXTERNAL] OpenRtbUtils.removeBids/2 [INPUTS...
/* static context [FOCAL] public boolean OpenRtbValidator.validate(BidRequest request, BidResponse.Builder response) [INPUTS] branches=- | result=request, response [CALLS-INTERNAL] boolean validate(BidRequest request, Bid.Builder bid) [CALLS-EXTERNAL] OpenRtbUtils.removeBids/2 */
/* static context [FOCAL] public boolean OpenRtbValidator.validate(BidRequest request, BidResponse.Builder response) [INPUTS] branches=- | result=request, response [CALLS-INTERNAL] boolean validate(BidRequest request, Bid.Builder bid) [CALLS-EXTERNAL] OpenRtbUtils.removeBids/2 */ class OpenRtbValidator { public bool...
true
ok
{"focal": {"class": "OpenRtbValidator", "name": "validate", "signature": "boolean validate(BidRequest request, BidResponse.Builder response)", "start_line": 3, "modifiers": "public", "params": [{"name": "request", "type": "BidRequest"}, {"name": "response", "type": "BidResponse.Builder"}], "return_type": "boolean"}, "c...
21458450_10
class RPCServiceImpl extends RemoteServiceServlet implements RPCService { public void removeWindowsEventData(String windowSession, String windowId) { String lookupKey = windowSession + ApplicationLocalStore.OBJECT_DELIMITER + windowId; ApplicationLocalStore.getInstance().deleteAll(lookupKey); } protected void ...
String windowSession = "windowSessionId"; String windowId1 = "windowId1"; String windowId2 = "windowId2"; String generatedKey1 = windowSession + ApplicationLocalStore.OBJECT_DELIMITER + windowId1; String generatedKey2 = windowSession + ApplicationLocalStore.OBJECT_DELIMITER + windowId2; ApplicationLocalS...
[FOCAL] public void RPCServiceImpl.removeWindowsEventData(String windowSession, String windowId) [CLASS] class RPCServiceImpl extends RemoteServiceServlet implements RPCService [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] ApplicationLocalStore.getInstance().deleteAll/1, Applicat...
/* static context [FOCAL] public void RPCServiceImpl.removeWindowsEventData(String windowSession, String windowId) [CALLS-EXTERNAL] ApplicationLocalStore.getInstance().deleteAll/1, ApplicationLocalStore.getInstance/0 */
/* static context [FOCAL] public void RPCServiceImpl.removeWindowsEventData(String windowSession, String windowId) [CALLS-EXTERNAL] ApplicationLocalStore.getInstance().deleteAll/1, ApplicationLocalStore.getInstance/0 */ class RPCServiceImpl extends RemoteServiceServlet implements RPCService { public void removeWindow...
true
ok
{"focal": {"class": "RPCServiceImpl", "name": "removeWindowsEventData", "signature": "void removeWindowsEventData(String windowSession, String windowId)", "start_line": 3, "modifiers": "public", "params": [{"name": "windowSession", "type": "String"}, {"name": "windowId", "type": "String"}], "return_type": "void"}, "cla...
21462033_32
class InfinityExponentialBackoffManager implements BackoffManager { public void reset(@NonNull final String providerName, @NonNull final Operation operation) { OPFLog.logMethod(providerName, operation); getManagerByOperation(operation).reset(providerName, operation); } ...
for (final Operation operation : Operation.values()) { for (int i = 0; i < NUM_OF_TRIES; ++i) { manager.getTryDelay(PROVIDER_A, operation); manager.getTryDelay(PROVIDER_B, operation); } manager.reset(PROVIDER_A, operation); assertTr...
[FOCAL] public void InfinityExponentialBackoffManager.reset(String providerName, Operation operation) [CLASS] class InfinityExponentialBackoffManager implements BackoffManager [METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] BackoffManager getManagerByOperation(Operation operation) ...
/* static context [FOCAL] public void InfinityExponentialBackoffManager.reset(String providerName, Operation operation) [CALLS-INTERNAL] BackoffManager getManagerByOperation(Operation operation) [CALLS-EXTERNAL] OPFLog.logMethod/2, getManagerByOperation(operation).reset/2 */
/* static context [FOCAL] public void InfinityExponentialBackoffManager.reset(String providerName, Operation operation) [CALLS-INTERNAL] BackoffManager getManagerByOperation(Operation operation) [CALLS-EXTERNAL] OPFLog.logMethod/2, getManagerByOperation(operation).reset/2 */ class InfinityExponentialBackoffManager impl...
true
ok
{"focal": {"class": "InfinityExponentialBackoffManager", "name": "reset", "signature": "void reset(String providerName, Operation operation)", "start_line": 3, "modifiers": "public", "params": [{"name": "providerName", "type": "String"}, {"name": "operation", "type": "Operation"}], "return_type": "void"}, "class_info":...
21477166_0
class ChineseWordTokenizer implements WordTokenizer { @Override public List<String> tokenize(final String sentence) { return TOKENIZER.tokenize(sentence); } private static final Logger LOGGER; } class ChineseWordTokenizerTest { private static final Logger LOGGER; @Test public v...
final long time = System.currentTimeMillis(); final WordTokenizer tokenizer = new ChineseWordTokenizer(); LOGGER.info("load time: " + (System.currentTimeMillis() - time) + " ms"); assertEquals(Arrays.asList("弹道导弹"), tokenizer.tokenize("弹道导弹")); assertEquals(Arrays.asList("我", "...
[FOCAL] @Override public List<String> ChineseWordTokenizer.tokenize(String sentence) [CLASS] class ChineseWordTokenizer implements WordTokenizer [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] TOKENIZER.tokenize/1 [INPUTS] branches=- | result=sentence [DATAFLOW] sentence@param->L3 ...
/* static context [FOCAL] @Override public List<String> ChineseWordTokenizer.tokenize(String sentence) [INPUTS] branches=- | result=sentence [CALLS-EXTERNAL] TOKENIZER.tokenize/1 */
/* static context [FOCAL] @Override public List<String> ChineseWordTokenizer.tokenize(String sentence) [INPUTS] branches=- | result=sentence [CALLS-EXTERNAL] TOKENIZER.tokenize/1 */ class ChineseWordTokenizer implements WordTokenizer { @Override public List<String> tokenize(final String sentence) { ret...
true
ok
{"focal": {"class": "ChineseWordTokenizer", "name": "tokenize", "signature": "List<String> tokenize(String sentence)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "sentence", "type": "String"}], "return_type": "List<String>"}, "class_info": {"name": "ChineseWordTokenizer", "kind": "class", "mo...
21499094_4
class XmlDecoder implements UaDecoder { @Override public StatusCode decodeStatusCode(String field) { if (nextStartElement(field)) { UInteger value = Unsigned.uint(0); if (nextStartElement("Code")) { value = decodeUInt32(null); requireNextEndEleme...
XmlDecoder decoder = new XmlDecoder(); decoder.setInput(new ByteArrayInputStream("<Value><Code>0</Code></Value>".getBytes())); assertEquals(decoder.decodeStatusCode("Value").getValue(), 0); decoder.setInput(new ByteArrayInputStream("<Value><Code>1</Code></Value>".getBytes())); ...
[FOCAL] @Override public StatusCode XmlDecoder.decodeStatusCode(String field) [CLASS] class XmlDecoder implements UaDecoder [METRICS] loc=17 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=2 [CALLS-INTERNAL] UInteger decodeUInt32(String field); boolean nextStartElement(String element); void requireNextEndElement(Str...
/* static context [FOCAL] @Override public StatusCode XmlDecoder.decodeStatusCode(String field) [PATH1] if(nextStartElement(field))=T -> if(nextStartElement("Code"))=T -> return new StatusCode(value) [PATH2] if(nextStartElement(field))=F -> return new StatusCode(0) [PATH3] if(nextStartElement(field))=T -> if(nextStartE...
/* static context [FOCAL] @Override public StatusCode XmlDecoder.decodeStatusCode(String field) [PATH1] if(nextStartElement(field))=T -> if(nextStartElement("Code"))=T -> return new StatusCode(value) [PATH2] if(nextStartElement(field))=F -> return new StatusCode(0) [PATH3] if(nextStartElement(field))=T -> if(nextStartE...
true
ok
{"focal": {"class": "XmlDecoder", "name": "decodeStatusCode", "signature": "StatusCode decodeStatusCode(String field)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "field", "type": "String"}], "return_type": "StatusCode"}, "class_info": {"name": "XmlDecoder", "kind": "class", "modifiers": "", ...
21500212_4
class UtilAll { public static int getPid() { RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean(); String name = runtime.getName(); // format: "pid@hostname" try { return Integer.parseInt(name.substring(0, name.indexOf('@'))); } catch (Exception e) { ...
int pid = UtilAll.getPid(); System.out.println("PID = " + pid); assertTrue(pid > 0); } }
[FOCAL] public static int UtilAll.getPid() [CLASS] class UtilAll [METRICS] loc=10 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] ManagementFactory.getRuntimeMXBean/0, RuntimeMXBean.getName/0, Integer.parseInt/1, String.substring/2, String.indexOf/1 [EXCEPTIONS] catches Exception e [PATH1] try-bod...
/* static context [FOCAL] public static int UtilAll.getPid() [PATH1] try-body throws -> return -1 [PATH2] return Integer.parseInt(name.substring(0, name.indexOf('@'))) [EXCEPTIONS] catches Exception e [CALLS-EXTERNAL] ManagementFactory.getRuntimeMXBean/0, RuntimeMXBean.getName/0, Integer.parseInt/1, String.substring/2,...
/* static context [FOCAL] public static int UtilAll.getPid() [PATH1] try-body throws -> return -1 [PATH2] return Integer.parseInt(name.substring(0, name.indexOf('@'))) [EXCEPTIONS] catches Exception e [CALLS-EXTERNAL] ManagementFactory.getRuntimeMXBean/0, RuntimeMXBean.getName/0, Integer.parseInt/1, String.substring/2,...
true
ok
{"focal": {"class": "UtilAll", "name": "getPid", "signature": "int getPid()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "int"}, "class_info": {"name": "UtilAll", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "offset2FileNam...
21548299_5
class AttributeMunger { public void transformSensorStringReplacingWithPublicAddressAndPort( final EntityAndAttribute<String> targetToUpdate, final Optional<EntityAndAttribute<Integer>> optionalTargetPort, final Iterable<? extends AttributeSensor<String>> targetsToMatch, ...
final AttributeSensor<String> TARGET_HOSTNAME = new BasicAttributeSensor<String>(String.class, "hostname"); final AttributeSensor<String> OTHER_HOSTNAME = new BasicAttributeSensor<String>(String.class, "otherhostname"); final AttributeSensor<Integer> TARGET_PORT = new BasicAttributeSensor<Intege...
[FOCAL] public void AttributeMunger.transformSensorStringReplacingWithPublicAddressAndPort(EntityAndAttribute<String> targetToUpdate, Optional<EntityAndAttribute<Integer>> optionalTargetPort, Iterable<? extends AttributeSensor<String>> targetsToMatch, EntityAndAttribute<String> replacementSource) [CLASS] class Attribut...
/* static context [FOCAL] public void AttributeMunger.transformSensorStringReplacingWithPublicAddressAndPort(EntityAndAttribute<String> targetToUpdate, Optional<EntityAndAttribute<Integer>> optionalTargetPort, Iterable<? extends AttributeSensor<String>> targetsToMatch, EntityAndAttribute<String> replacementSource) [PAT...
/* static context [FOCAL] public void AttributeMunger.transformSensorStringReplacingWithPublicAddressAndPort(EntityAndAttribute<String> targetToUpdate, Optional<EntityAndAttribute<Integer>> optionalTargetPort, Iterable<? extends AttributeSensor<String>> targetsToMatch, EntityAndAttribute<String> replacementSource) [PAT...
true
ok
{"focal": {"class": "AttributeMunger", "name": "transformSensorStringReplacingWithPublicAddressAndPort", "signature": "void transformSensorStringReplacingWithPublicAddressAndPort(EntityAndAttribute<String> targetToUpdate, Optional<EntityAndAttribute<Integer>> optionalTargetPort, Iterable<? extends AttributeSensor<Strin...
21556616_137
class BufferedReader extends Reader { public String readLine() { verifyNotClosed(); /* has the underlying stream been exhausted? */ if (pos == end && fillBuf() == -1) return null; for (int charPos = pos; charPos < end; charPos++) { char ch = buf[charPos]; ...
BufferedReader br = getBufferedReader(); char currentChar; char[] line = new char[8192]; int index = -1; br.mark(8192); while ((currentChar = (char) br.read()) != '\n') { line[++index] = currentChar; } // drop the unused characters in line buf...
[FOCAL] public String BufferedReader.readLine() [CLASS] class BufferedReader extends Reader [METRICS] loc=73 cc=16 branches=13 loops=3 returns=7 throws=0 nesting=5 [CALLS-INTERNAL] int fillBuf(); void verifyNotClosed() [CALLS-EXTERNAL] StringBuilder.append/3, StringBuilder.toString/0, StringBuilder.length/0 [NEW] Strin...
/* static context [FOCAL] public String BufferedReader.readLine() [PATH1] if(pos == end && fillBuf() == -1)=F -> for(charPos < end)#1=T -> if(ch > '\r')=F -> if(ch == '\n')=F -> if(ch == '\r')=F -> exit loop -> while(true)=T -> if(eol == '\n')=F -> if(fillBuf() == -1)=F -> for(charPos < end)#2=T -> if(eol == '\0')#1=F ...
/* static context [FOCAL] public String BufferedReader.readLine() [PATH1] if(pos == end && fillBuf() == -1)=F -> for(charPos < end)#1=T -> if(ch > '\r')=F -> if(ch == '\n')=F -> if(ch == '\r')=F -> exit loop -> while(true)=T -> if(eol == '\n')=F -> if(fillBuf() == -1)=F -> for(charPos < end)#2=T -> if(eol == '\0')#1=F ...
true
ok
{"focal": {"class": "BufferedReader", "name": "readLine", "signature": "String readLine()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "BufferedReader", "kind": "class", "modifiers": "", "superclass": "Reader", "interfaces": null, "fields": [{"name": "testFile...
21580302_82
class MappingController { public ComponentFormSet mapUserSubmissionToEntry(SubmissionFormTemplate template, UserSubmission userSubmission) throws MappingException { ComponentFormSet componentFormSet = new ComponentFormSet(); ComponentAll mainComponent = new ComponentAll(); Component component = new Component(...
setupMockService(); SubmissionFormTemplate template = new SubmissionFormTemplate(); template.setSections(new ArrayList<>()); SubmissionFormSection section = new SubmissionFormSection(); section.setFields(new ArrayList<>()); SubmissionFormField submissionFormField = new SubmissionFormField(); submissionF...
[FOCAL] public ComponentFormSet MappingController.mapUserSubmissionToEntry(SubmissionFormTemplate template, UserSubmission userSubmission) [CLASS] class MappingController [METRICS] loc=28 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] void mapTemplateSections(SubmissionFormTemplate template, Comp...
/* static context [FOCAL] public ComponentFormSet MappingController.mapUserSubmissionToEntry(SubmissionFormTemplate template, UserSubmission userSubmission) [PATH1] foreach(ComponentContact contact : componentFormSet.getPrimary().getContacts())=T -> if(!contactMap.containsKey(key))=T -> exit loop -> return componentFor...
/* static context [FOCAL] public ComponentFormSet MappingController.mapUserSubmissionToEntry(SubmissionFormTemplate template, UserSubmission userSubmission) [PATH1] foreach(ComponentContact contact : componentFormSet.getPrimary().getContacts())=T -> if(!contactMap.containsKey(key))=T -> exit loop -> return componentFor...
true
ok
{"focal": {"class": "MappingController", "name": "mapUserSubmissionToEntry", "signature": "ComponentFormSet mapUserSubmissionToEntry(SubmissionFormTemplate template, UserSubmission userSubmission) throws MappingException", "start_line": 3, "modifiers": "public", "params": [{"name": "template", "type": "SubmissionFormTe...
21600105_14
class SyncService { List<Snapshot> calculateMissingSnapshots( Collection<Snapshot> sourceSnapshots, Set<SnapshotEntry> availableSnapshots) { List<Snapshot> result = new ArrayList<>(); HashSet<Integer> availableSnapshotNrs = new HashSet<>(); for (SnapshotEntry e : ava...
ArrayList<Snapshot> snapshots = new ArrayList<>(); snapshots.add(new Snapshot(1, null, null)); Snapshot snapshot3 = new Snapshot(3, null, null); snapshots.add(snapshot3); Set<SnapshotEntry> snapshotNumbers = new HashSet<>(); snapshotNumbers.add(new SnapshotEntry(1, null...
[FOCAL] List<Snapshot> SyncService.calculateMissingSnapshots(Collection<Snapshot> sourceSnapshots, Set<SnapshotEntry> availableSnapshots) [CLASS] class SyncService [METRICS] loc=15 cc=4 branches=1 loops=2 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] HashSet<Integer>.add/1, HashSet<Integer>.contains/1, List<Snapshot>.a...
/* static context [FOCAL] List<Snapshot> SyncService.calculateMissingSnapshots(Collection<Snapshot> sourceSnapshots, Set<SnapshotEntry> availableSnapshots) [PATH1] foreach(SnapshotEntry e : availableSnapshots)=F -> foreach(Snapshot s : sourceSnapshots)=T -> if(!availableSnapshotNrs.contains(s.nr))=T -> exit loop -> ret...
/* static context [FOCAL] List<Snapshot> SyncService.calculateMissingSnapshots(Collection<Snapshot> sourceSnapshots, Set<SnapshotEntry> availableSnapshots) [PATH1] foreach(SnapshotEntry e : availableSnapshots)=F -> foreach(Snapshot s : sourceSnapshots)=T -> if(!availableSnapshotNrs.contains(s.nr))=T -> exit loop -> ret...
true
ok
{"focal": {"class": "SyncService", "name": "calculateMissingSnapshots", "signature": "List<Snapshot> calculateMissingSnapshots(Collection<Snapshot> sourceSnapshots, Set<SnapshotEntry> availableSnapshots)", "start_line": 3, "modifiers": "", "params": [{"name": "sourceSnapshots", "type": "Collection<Snapshot>"}, {"name":...
21621670_3
class RelocationInformationRequiredInfoValidation extends GenericValidation { @Override public boolean validate(AttributedDocumentEvent event) { boolean valid = true; TravelRelocationDocument document = (TravelRelocationDocument) event.getDocument(); // Check to see if from country is...
TravelRelocationDocument document = new TravelRelocationDocument(); ActualExpense expense = new ActualExpense(); expense.setExpenseAmount(new KualiDecimal(100)); document.addActualExpense(expense); document.setFromCountryCode(validation.USA_COUNTRY_CODE); AttributedDocum...
[FOCAL] @Override public boolean RelocationInformationRequiredInfoValidation.validate(AttributedDocumentEvent event) [CLASS] class RelocationInformationRequiredInfoValidation extends GenericValidation [METRICS] loc=33 cc=6 branches=5 loops=0 returns=3 throws=0 nesting=2 [CALLS-EXTERNAL] AttributedDocumentEvent.getDocum...
/* static context [FOCAL] @Override public boolean RelocationInformationRequiredInfoValidation.validate(AttributedDocumentEvent event) [PATH1] if(document.getFromCountryCode() != null && document.getFromCountryCode().equals(USA_COUNTRY_CODE))=T -> if(!valid)#1=F -> if(document.getToCountryCode() != null && document.get...
/* static context [FOCAL] @Override public boolean RelocationInformationRequiredInfoValidation.validate(AttributedDocumentEvent event) [PATH1] if(document.getFromCountryCode() != null && document.getFromCountryCode().equals(USA_COUNTRY_CODE))=T -> if(!valid)#1=F -> if(document.getToCountryCode() != null && document.get...
true
ok
{"focal": {"class": "RelocationInformationRequiredInfoValidation", "name": "validate", "signature": "boolean validate(AttributedDocumentEvent event)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "event", "type": "AttributedDocumentEvent"}], "return_type": "boolean"}, "class_info": {"name": "Re...
21631528_12
class AuthenticationInsight implements Parcelable { public String getRegulationEnvironment() { return mRegulationEnvironment; } public AuthenticationInsight(); private AuthenticationInsight(Parcel in); static AuthenticationInsight fromJson(JSONObject json); @Override public int desc...
AuthenticationInsight insight = AuthenticationInsight.CREATOR.createFromParcel(Parcel.obtain()); assertEquals(null, insight.getRegulationEnvironment()); } }
[FOCAL] public String AuthenticationInsight.getRegulationEnvironment() [CLASS] class AuthenticationInsight implements Parcelable [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] AuthenticationInsight(); AuthenticationInsight(Parcel in); AuthenticationInsight fromJson(JSONObject json)...
/* static context [FOCAL] public String AuthenticationInsight.getRegulationEnvironment() */
/* static context [FOCAL] public String AuthenticationInsight.getRegulationEnvironment() */ class AuthenticationInsight implements Parcelable { public String getRegulationEnvironment() { return mRegulationEnvironment; } public AuthenticationInsight(); private AuthenticationInsight(Parcel in)...
true
ok
{"focal": {"class": "AuthenticationInsight", "name": "getRegulationEnvironment", "signature": "String getRegulationEnvironment()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "AuthenticationInsight", "kind": "class", "modifiers": "", "superclass": null, "interf...
21634100_460
class SdkInputStream extends InputStream implements MetricAware { protected final void abortIfNeeded() { if (Thread.interrupted()) { try { abort(); // execute subclass specific abortion logic } catch (IOException e) { LogFactory.getLog(getClass()).deb...
final List<Integer> abortionCount = new ArrayList<Integer>(); Thread t = new Thread(new Runnable() { @Override public void run() { ByteArrayInputStream bais = new ByteArrayInputStream( "Content".getBytes(StringUtils.UTF8)); ...
[FOCAL] protected final void SdkInputStream.abortIfNeeded() [CLASS] class SdkInputStream extends InputStream implements MetricAware [METRICS] loc=10 cc=3 branches=1 loops=0 returns=0 throws=1 nesting=2 [CALLS-INTERNAL] void abort() [CALLS-EXTERNAL] Thread.interrupted/0, LogFactory.getLog(getClass()).debug/2, LogFactory...
/* static context [FOCAL] protected final void SdkInputStream.abortIfNeeded() [THROWS-WHEN] AbortedException when Thread.interrupted() && try-body throws [THROWS-WHEN] AbortedException when Thread.interrupted() [PATH1] if(Thread.interrupted())=T -> try-body throws -> throw new AbortedException() [PATH2] if(Thread.inter...
/* static context [FOCAL] protected final void SdkInputStream.abortIfNeeded() [THROWS-WHEN] AbortedException when Thread.interrupted() && try-body throws [THROWS-WHEN] AbortedException when Thread.interrupted() [PATH1] if(Thread.interrupted())=T -> try-body throws -> throw new AbortedException() [PATH2] if(Thread.inter...
true
ok
{"focal": {"class": "SdkInputStream", "name": "abortIfNeeded", "signature": "void abortIfNeeded()", "start_line": 3, "modifiers": "protected final", "params": [], "return_type": "void"}, "class_info": {"name": "SdkInputStream", "kind": "class", "modifiers": "", "superclass": "InputStream", "interfaces": "MetricAware", ...
21654705_0
class EtutorCVSReader { public static List<String> readUNummer(BufferedReader reader) throws IOException { final List<String> uNummern = new ArrayList<>(); String line; while ((line = reader.readLine()) != null) { // use comma as separator String[] record = line.sp...
final URL url = this.getClass().getResource(TEST_ETUTOR_EXPORT); BufferedReader bufferedReader = new BufferedReader(new FileReader(new File(url.getFile()))); List<String> uNummern = EtutorCVSReader.readUNummer(bufferedReader); bufferedReader.close(); Assert.assertNotNull(uNum...
[FOCAL] public static List<String> EtutorCVSReader.readUNummer(BufferedReader reader) [CLASS] class EtutorCVSReader [METRICS] loc=18 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] BufferedReader.readLine/0, String.split/1, record[0].toUpperCase().startsWith/1, record[0].toUpperCase/0, List<String...
/* static context [FOCAL] public static List<String> EtutorCVSReader.readUNummer(BufferedReader reader) [PATH1] while((line = reader.readLine()) != null)=T -> if(record.length > 0 && record[0].toUpperCase().startsWith("U"))=T -> exit loop -> return uNummern [PATH2] while((line = reader.readLine()) != null)=F -> return ...
/* static context [FOCAL] public static List<String> EtutorCVSReader.readUNummer(BufferedReader reader) [PATH1] while((line = reader.readLine()) != null)=T -> if(record.length > 0 && record[0].toUpperCase().startsWith("U"))=T -> exit loop -> return uNummern [PATH2] while((line = reader.readLine()) != null)=F -> return ...
true
ok
{"focal": {"class": "EtutorCVSReader", "name": "readUNummer", "signature": "List<String> readUNummer(BufferedReader reader) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "reader", "type": "BufferedReader"}], "return_type": "List<String>"}, "class_info": {"name": "EtutorCVSReade...
21668967_1
class ElasticsearchQuery implements SimpleQuery<ElasticsearchQuery<K>>, Fetchable<K> { @Override public ElasticsearchQuery<K> where(Predicate... o) { return queryMixin.where(o); } public ElasticsearchQuery(Client client, Function<SearchHit, K> transformer, ElasticsearchSerializer serializer);...
assertQuery(user.firstName.eq("Jaakko"), u1); assertQuery(user.firstName.equalsIgnoreCase("jaakko"), u1); assertQuery(user.lastName.eq("Aakkonen"), u3); assertQuery(user.firstName.in("Jaakko","Teppo"), u1); assertQuery(user.lastName.in("Aakkonen", "BeekkoNen"), u3, u4); ...
[FOCAL] @Override public ElasticsearchQuery<K> ElasticsearchQuery.where(Predicate... o) [CLASS] class ElasticsearchQuery implements SimpleQuery<ElasticsearchQuery<K>>, Fetchable<K> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] queryMixin.where/1 [INPUTS] branches=- | result=o [CO...
/* static context [FOCAL] @Override public ElasticsearchQuery<K> ElasticsearchQuery.where(Predicate... o) [INPUTS] branches=- | result=o [COLLABORATORS] field queryMixin where/1 [CALLS-EXTERNAL] queryMixin.where/1 */
/* static context [FOCAL] @Override public ElasticsearchQuery<K> ElasticsearchQuery.where(Predicate... o) [INPUTS] branches=- | result=o [COLLABORATORS] field queryMixin where/1 [CALLS-EXTERNAL] queryMixin.where/1 */ class ElasticsearchQuery implements SimpleQuery<ElasticsearchQuery<K>>, Fetchable<K> { @Override ...
true
ok
{"focal": {"class": "ElasticsearchQuery", "name": "where", "signature": "ElasticsearchQuery<K> where(Predicate... o)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "o", "type": "Predicate..."}], "return_type": "ElasticsearchQuery<K>"}, "class_info": {"name": "ElasticsearchQuery", "kind": "class...
21765334_3
class XmlParser { public static List<Object[]> parse(CharSequence xml, String... fields) { List<Object[]> list = new ArrayList<>(); StringBuilder sb = new StringBuilder(); if (xml != null && xml.length() != 0) { Map<String, Integer> fieldMap = new HashMap<>(fields.length); ...
assertEquals(new Object[]{ "test&<>", "1" }, XmlParser.parse("<e><name>test&amp;&lt;&gt;</name><age>1</age></e>", "name", "age").get(0)); assertEquals(new Object[]{ "test&<>", "1" }, XmlParser.parse("<e><age>1</age><name>test&amp;&lt;&gt;</name></e>", "name", "age").get(0)); assertEquals(new Obj...
[FOCAL] public static List<Object[]> XmlParser.parse(CharSequence xml, String... fields) [CLASS] class XmlParser [METRICS] loc=74 cc=14 branches=7 loops=3 returns=1 throws=2 nesting=6 [CALLS-EXTERNAL] CharSequence.length/0, Map<String, Integer>.put/2, CharSequenceUtils.indexOf/3, CharSequence.charAt/1, xml.subSequence(...
/* static context [FOCAL] public static List<Object[]> XmlParser.parse(CharSequence xml, String... fields) [THROWS-WHEN] IllegalStateException when xml != null && xml.length() != 0 && i < fields.length && i < xml.length() && i < xml.length() && switch(c)=case '<' && !key && xml.charAt(i + 1) != '/' || !tag.equals(field...
/* static context [FOCAL] public static List<Object[]> XmlParser.parse(CharSequence xml, String... fields) [THROWS-WHEN] IllegalStateException when xml != null && xml.length() != 0 && i < fields.length && i < xml.length() && i < xml.length() && switch(c)=case '<' && !key && xml.charAt(i + 1) != '/' || !tag.equals(field...
true
ok
{"focal": {"class": "XmlParser", "name": "parse", "signature": "List<Object[]> parse(CharSequence xml, String... fields)", "start_line": 3, "modifiers": "public static", "params": [{"name": "xml", "type": "CharSequence"}, {"name": "fields", "type": "String..."}], "return_type": "List<Object[]>"}, "class_info": {"name":...
21765535_41
class FightCalculator { public Fight attack(UUID attackerId, UUID defenderId, UUID planetId, Ships attackingShips, Ships defendingShips, long round) { LOGGER.debug("Fight between {} and {}", attackingShips, defendingShips); Ships remainingDefendingShips = fight(attackingShips, defendingShips); ...
Fight fight = sut.attack(ATTACKER_ID, DEFENDER_ID, PLANET_ID, new Ships(new Ship(ShipType.MOSQUITO, 3)), new Ships(new Ship(ShipType.MOSQUITO, 5)), ROUND); assertThat(fight.getRemainingAttackerShips().countByType(ShipType.MOSQUITO), is(0L)); assertThat(fight.getRemainingDefenderShips().countByT...
[FOCAL] public Fight FightCalculator.attack(UUID attackerId, UUID defenderId, UUID planetId, Ships attackingShips, Ships defendingShips, long round) [CLASS] class FightCalculator [METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Ships fight(Ships attackingShips, Ships defendingShips...
/* static context [FOCAL] public Fight FightCalculator.attack(UUID attackerId, UUID defenderId, UUID planetId, Ships attackingShips, Ships defendingShips, long round) [INPUTS] branches=- | result=attackerId, attackingShips, defenderId, defendingShips, planetId, round [COLLABORATORS] field uuidFactory create/0 [CALLS-IN...
/* static context [FOCAL] public Fight FightCalculator.attack(UUID attackerId, UUID defenderId, UUID planetId, Ships attackingShips, Ships defendingShips, long round) [INPUTS] branches=- | result=attackerId, attackingShips, defenderId, defendingShips, planetId, round [COLLABORATORS] field uuidFactory create/0 [CALLS-IN...
true
ok
{"focal": {"class": "FightCalculator", "name": "attack", "signature": "Fight attack(UUID attackerId, UUID defenderId, UUID planetId, Ships attackingShips, Ships defendingShips, long round)", "start_line": 3, "modifiers": "public", "params": [{"name": "attackerId", "type": "UUID"}, {"name": "defenderId", "type": "UUID"}...
21770648_34
class JdbcStore implements Store { @Override public List<Message> dequeueOut(String id, int offset) { Validate.notNull(id); Validate.isTrue(offset >= 0); List<byte[]> serializedMessages = outQueue.dequeueOut(id, offset); return serializedMessages.stream() .map(d...
List<Message> actual = fixture.dequeueOut("id", 0); assertTrue(actual.isEmpty()); } }
[FOCAL] @Override public List<Message> JdbcStore.dequeueOut(String id, int offset) [CLASS] class JdbcStore implements Store [METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Validate.notNull/1, Validate.isTrue/1, outQueue.dequeueOut/2, serializedMessages.stream() .map(d -> (Message)...
/* static context [FOCAL] @Override public List<Message> JdbcStore.dequeueOut(String id, int offset) [INPUTS] branches=- | result=id, offset [COLLABORATORS] field outQueue dequeueOut/2; field serializer deserialize/1 [CALLS-EXTERNAL] Validate.notNull/1, Validate.isTrue/1, outQueue.dequeueOut/2, serializedMessages.strea...
/* static context [FOCAL] @Override public List<Message> JdbcStore.dequeueOut(String id, int offset) [INPUTS] branches=- | result=id, offset [COLLABORATORS] field outQueue dequeueOut/2; field serializer deserialize/1 [CALLS-EXTERNAL] Validate.notNull/1, Validate.isTrue/1, outQueue.dequeueOut/2, serializedMessages.strea...
true
ok
{"focal": {"class": "JdbcStore", "name": "dequeueOut", "signature": "List<Message> dequeueOut(String id, int offset)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "id", "type": "String"}, {"name": "offset", "type": "int"}], "return_type": "List<Message>"}, "class_info": {"name": "JdbcStore", "...
21775167_46
class IssuesSearchRequest extends SearchRequest { public IssuesSearchRequest setRepo(String repo, String userName) { add(new KeyValueStringSearchItem("repo", userName + "/" + repo)); return this; } public IssuesSearchRequest setIsOpen(boolean isOpen); public IssuesSearchRequest setIsPullRequest(Boolea...
String s = builder.setRepo("gitskarios", "alorma").build(); assertThat(s).contains("repo:alorma/gitskarios"); } }
[FOCAL] public IssuesSearchRequest IssuesSearchRequest.setRepo(String repo, String userName) [CLASS] class IssuesSearchRequest extends SearchRequest [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] add/1 (inherited) [NEW] KeyValueStringSearchItem [DATAFLOW] repo@param->L2; userName@...
/* static context [FOCAL] public IssuesSearchRequest IssuesSearchRequest.setRepo(String repo, String userName) [NEW] KeyValueStringSearchItem [CALLS-EXTERNAL] add/1 (inherited) */
/* static context [FOCAL] public IssuesSearchRequest IssuesSearchRequest.setRepo(String repo, String userName) [NEW] KeyValueStringSearchItem [CALLS-EXTERNAL] add/1 (inherited) */ class IssuesSearchRequest extends SearchRequest { public IssuesSearchRequest setRepo(String repo, String userName) { add(new KeyValue...
true
ok
{"focal": {"class": "IssuesSearchRequest", "name": "setRepo", "signature": "IssuesSearchRequest setRepo(String repo, String userName)", "start_line": 3, "modifiers": "public", "params": [{"name": "repo", "type": "String"}, {"name": "userName", "type": "String"}], "return_type": "IssuesSearchRequest"}, "class_info": {"n...
21788064_0
class FragmentFileSet { public void run() throws IOException { FlatPackageWriterImpl flatPackageWriter = new FlatPackageWriterImpl(0); flatPackageWriter.setDebugOutput(debug); flatPackageWriter.setOutputDirectory(outputDir); Movie movie = new Movie(); for (File input : input...
File tmpDir = createTmpDir(); File outputDir = createTmpDir(); copyResource("/smoothstreaming/audio-96000.mp4", tmpDir); copyResource("/smoothstreaming/video-128h-75kbps.mp4", tmpDir); copyResource("/smoothstreaming/video-192h-155kbps.mp4", tmpDir); copyResource("/smooths...
[FOCAL] public void FragmentFileSet.run() [CLASS] class FragmentFileSet [METRICS] loc=15 cc=3 branches=0 loops=2 returns=0 throws=0 nesting=2 [CALLS-EXTERNAL] FlatPackageWriterImpl.setDebugOutput/1, FlatPackageWriterImpl.setOutputDirectory/1, System.err.println/1, File.getAbsolutePath/0, MovieCreator.build/1, Movie.get...
/* static context [FOCAL] public void FragmentFileSet.run() [PATH1] foreach(File input : inputFiles)=T -> foreach(Track track : m.getTracks())=F -> exit loop [PATH2] foreach(File input : inputFiles)=F [PATH3] foreach(File input : inputFiles)=T -> foreach(Track track : m.getTracks())=T -> exit loop -> exit loop [EXCEPTI...
/* static context [FOCAL] public void FragmentFileSet.run() [PATH1] foreach(File input : inputFiles)=T -> foreach(Track track : m.getTracks())=F -> exit loop [PATH2] foreach(File input : inputFiles)=F [PATH3] foreach(File input : inputFiles)=T -> foreach(Track track : m.getTracks())=T -> exit loop -> exit loop [EXCEPTI...
true
ok
{"focal": {"class": "FragmentFileSet", "name": "run", "signature": "void run() throws IOException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "FragmentFileSet", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [...
21797449_58
class ColorUtils { public static String toRGBCode(final Color color) { return String.format("#%02X%02X%02X", // (int) (color.getRed() * 255), // (int) (color.getGreen() * 255), // (int) (color.getBlue() * 255)); } private ColorUtils(); public s...
assertEquals("#000000", ColorUtils.toRGBCode(Color.BLACK)); assertEquals("#FFFFFF", ColorUtils.toRGBCode(Color.WHITE)); assertEquals("#0A0B0C", ColorUtils.toRGBCode(Color.web("#0a0b0c"))); } }
[FOCAL] public static String ColorUtils.toRGBCode(Color color) [CLASS] class ColorUtils [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] String.format/4, Color.getRed/0, Color.getGreen/0, Color.getBlue/0 [INPUTS] branches=- | result=color [COLLABORATORS] param color:Color getRed/0,g...
/* static context [FOCAL] public static String ColorUtils.toRGBCode(Color color) [INPUTS] branches=- | result=color [COLLABORATORS] param color:Color getRed/0,getGreen/0,getBlue/0 [CALLS-EXTERNAL] String.format/4, Color.getRed/0, Color.getGreen/0, Color.getBlue/0 */
/* static context [FOCAL] public static String ColorUtils.toRGBCode(Color color) [INPUTS] branches=- | result=color [COLLABORATORS] param color:Color getRed/0,getGreen/0,getBlue/0 [CALLS-EXTERNAL] String.format/4, Color.getRed/0, Color.getGreen/0, Color.getBlue/0 */ class ColorUtils { public static String toRGBCod...
true
ok
{"focal": {"class": "ColorUtils", "name": "toRGBCode", "signature": "String toRGBCode(Color color)", "start_line": 3, "modifiers": "public static", "params": [{"name": "color", "type": "Color"}], "return_type": "String"}, "class_info": {"name": "ColorUtils", "kind": "class", "modifiers": "", "superclass": null, "interf...
21825681_23
class GridFeature extends AbstractDiscreteFeature<GeoPosition, GridCell4D> { public MapFeature extractMapFeature(Set<String> varIds, RegularGrid targetGrid, Double elevation, DateTime time) throws DataReadingException { GridDomain domain = getDomain(); /* * Find the elevation ...
int startX = 10; int startY = 20; int xSize = 10; int ySize = 10; RegularGrid targetGrid = new RegularGridImpl(startX - 0.5, startY - 0.5, startX + xSize + 0.5, startY + ySize + 0.5, null, xSize + 1, ySize + 1); /* * Useful check that the target...
[FOCAL] public MapFeature GridFeature.extractMapFeature(Set<String> varIds, RegularGrid targetGrid, Double elevation, DateTime time) [CLASS] class GridFeature extends AbstractDiscreteFeature<GeoPosition, GridCell4D> [METRICS] loc=77 cc=7 branches=4 loops=1 returns=1 throws=2 nesting=2 [CALLS-INTERNAL] Array4D<Number> g...
/* static context [FOCAL] public MapFeature GridFeature.extractMapFeature(Set<String> varIds, RegularGrid targetGrid, Double elevation, DateTime time) [THROWS-WHEN] DataReadingException when zAxis != null && timeAxis != null && varIds == null && foreach(String varId : varIds)=T && !getVariableIds().contains(varId) [THR...
/* static context [FOCAL] public MapFeature GridFeature.extractMapFeature(Set<String> varIds, RegularGrid targetGrid, Double elevation, DateTime time) [THROWS-WHEN] DataReadingException when zAxis != null && timeAxis != null && varIds == null && foreach(String varId : varIds)=T && !getVariableIds().contains(varId) [THR...
true
ok
{"focal": {"class": "GridFeature", "name": "extractMapFeature", "signature": "MapFeature extractMapFeature(Set<String> varIds, RegularGrid targetGrid, Double elevation, DateTime time) throws DataReadingException", "start_line": 3, "modifiers": "public", "params": [{"name": "varIds", "type": "Set<String>"}, {"name": "ta...
21833183_42
class FileListSorter implements Comparator<LayoutElementParcelable> { @Override public int compare(LayoutElementParcelable file1, LayoutElementParcelable file2) { /*File f1; if(!file1.hasSymlink()) { f1=new File(file1.getDesc()); } else { f1=new File(file1.getSymlink()); } F...
FileListSorter fileListSorter = new FileListSorter(-1, 2, 1); LayoutElementParcelable file1 = new LayoutElementParcelable( ApplicationProvider.getApplicationContext(), "abc1.txt", "C:\\AmazeFileManager\\abc1", "user", "symlink", "10...
[FOCAL] @Override public int FileListSorter.compare(LayoutElementParcelable file1, LayoutElementParcelable file2) [CLASS] class FileListSorter implements Comparator<LayoutElementParcelable> [METRICS] loc=75 cc=14 branches=13 loops=0 returns=12 throws=0 nesting=6 [CALLS-INTERNAL] String getExtension(String a); boolean i...
/* static context [FOCAL] @Override public int FileListSorter.compare(LayoutElementParcelable file1, LayoutElementParcelable file2) [PATH1] if(dirsOnTop == 0)=F -> if(dirsOnTop == 1)=T -> if(isDirectory(file1) && !isDirectory(file2))#2=F -> if(isDirectory(file2) && !isDirectory(file1))#2=F -> if(sort == 0)=F -> if(sort...
/* static context [FOCAL] @Override public int FileListSorter.compare(LayoutElementParcelable file1, LayoutElementParcelable file2) [PATH1] if(dirsOnTop == 0)=F -> if(dirsOnTop == 1)=T -> if(isDirectory(file1) && !isDirectory(file2))#2=F -> if(isDirectory(file2) && !isDirectory(file1))#2=F -> if(sort == 0)=F -> if(sort...
true
ok
{"focal": {"class": "FileListSorter", "name": "compare", "signature": "int compare(LayoutElementParcelable file1, LayoutElementParcelable file2)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "file1", "type": "LayoutElementParcelable"}, {"name": "file2", "type": "LayoutElementParcelable"}], "re...
21858951_204
class IOUtilities extends Static { public static Path toPath(Object candidate) throws IOException, IllegalArgumentException { if (candidate == null) { return null; } if (candidate instanceof Path) { return (Path) candidate; } if (candidate instanceof...
Path pathObj = Files.createTempFile("path", ".tmp"); File fileObj = File.createTempFile("file", ".tmp"); URI uriObj = URI.create("file:/tmp"); URL urlFileObj = new URL("file:/tmp"); try { //convert to Path assertNull(IOUtilities.toPath(null)); ...
[FOCAL] public static Path IOUtilities.toPath(Object candidate) [CLASS] class IOUtilities extends Static [METRICS] loc=51 cc=11 branches=9 loops=0 returns=8 throws=2 nesting=6 [CALLS-INTERNAL] String toSafeURI(String candidate) [CALLS-EXTERNAL] URI.create/1, String.valueOf/1, URI.getScheme/0, Paths.get/1, Object.toStri...
/* static context [FOCAL] public static Path IOUtilities.toPath(Object candidate) [THROWS-WHEN] IllegalArgumentException when !(candidate == null) && !(candidate instanceof Path) && !(candidate instanceof CharSequence) && !(candidate instanceof URL) && !(candidate instanceof File) && !(candidate instanceof URI) */
/* static context [FOCAL] public static Path IOUtilities.toPath(Object candidate) [THROWS-WHEN] IllegalArgumentException when !(candidate == null) && !(candidate instanceof Path) && !(candidate instanceof CharSequence) && !(candidate instanceof URL) && !(candidate instanceof File) && !(candidate instanceof URI) */ clas...
true
ok
{"focal": {"class": "IOUtilities", "name": "toPath", "signature": "Path toPath(Object candidate) throws IOException, IllegalArgumentException", "start_line": 3, "modifiers": "public static", "params": [{"name": "candidate", "type": "Object"}], "return_type": "Path"}, "class_info": {"name": "IOUtilities", "kind": "class...
21860658_55
class SimplePDP { public boolean isAuthorized(final String ip, final String referer) { final String toEvaluate = replaceVariablesInRule(ip, referer); boolean result = false; try { result = (Boolean)SCRIPT_ENGINE.eval(toEvaluate); } catch (ScriptException ex) { ...
final SimplePDP pdp = new SimplePDP(RULE1); assertFalse(pdp.isAuthorized("17.15.25.3", "test")); } }
[FOCAL] public boolean SimplePDP.isAuthorized(String ip, String referer) [CLASS] class SimplePDP [METRICS] loc=10 cc=2 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] String replaceVariablesInRule(String ip, String referer) [CALLS-EXTERNAL] SCRIPT_ENGINE.eval/1, LOGGER.log/3 [EXCEPTIONS] catches Script...
/* static context [FOCAL] public boolean SimplePDP.isAuthorized(String ip, String referer) [PATH1] try-body throws -> return result [INPUTS] branches=- | result=ip, referer [EXCEPTIONS] catches ScriptException ex [CALLS-INTERNAL] String replaceVariablesInRule(String ip, String referer) [CALLS-EXTERNAL] SCRIPT_ENGINE.ev...
/* static context [FOCAL] public boolean SimplePDP.isAuthorized(String ip, String referer) [PATH1] try-body throws -> return result [INPUTS] branches=- | result=ip, referer [EXCEPTIONS] catches ScriptException ex [CALLS-INTERNAL] String replaceVariablesInRule(String ip, String referer) [CALLS-EXTERNAL] SCRIPT_ENGINE.ev...
true
ok
{"focal": {"class": "SimplePDP", "name": "isAuthorized", "signature": "boolean isAuthorized(String ip, String referer)", "start_line": 3, "modifiers": "public", "params": [{"name": "ip", "type": "String"}, {"name": "referer", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "SimplePDP", "kind": "cl...
21907146_11
class InstantMapper extends TypedMapper<Instant> { @Override protected Instant extractByIndex(ResultSet r, int index) throws SQLException { final Timestamp timestamp = calendar.isPresent() ? r.getTimestamp(index, cloneCalendar()) : r.getTimestamp(index); return timestamp == null ? null : timest...
when(resultSet.getTimestamp(1)).thenReturn(null); Instant actual = new InstantMapper().extractByIndex(resultSet, 1); assertThat(actual).isNull(); } }
[FOCAL] @Override protected Instant InstantMapper.extractByIndex(ResultSet r, int index) [CLASS] class InstantMapper extends TypedMapper<Instant> [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Calendar cloneCalendar() [CALLS-EXTERNAL] calendar.isPresent/0, ResultSet.getTimestamp/2...
/* static context [FOCAL] @Override protected Instant InstantMapper.extractByIndex(ResultSet r, int index) [INPUTS] branches=- | result=index, r [COLLABORATORS] field calendar isPresent/0; param r:ResultSet getTimestamp/2,getTimestamp/1 [EXCEPTIONS] declares SQLException [CALLS-INTERNAL] Calendar cloneCalendar() [CALLS...
/* static context [FOCAL] @Override protected Instant InstantMapper.extractByIndex(ResultSet r, int index) [INPUTS] branches=- | result=index, r [COLLABORATORS] field calendar isPresent/0; param r:ResultSet getTimestamp/2,getTimestamp/1 [EXCEPTIONS] declares SQLException [CALLS-INTERNAL] Calendar cloneCalendar() [CALLS...
true
ok
{"focal": {"class": "InstantMapper", "name": "extractByIndex", "signature": "Instant extractByIndex(ResultSet r, int index) throws SQLException", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "r", "type": "ResultSet"}, {"name": "index", "type": "int"}], "return_type": "Instant"}, "class_info"...
21910720_11
class GoogleAppsSdkUtils { public static User retrieveUser(Directory directoryClient, String userKey) throws IOException { LOG.debug("retrieveUser() - {}", userKey); Directory.Users.Get request = null; try { request = directoryClient.users().get(userKey); } catch (IOEx...
User user = GoogleAppsSdkUtils.retrieveUser(directoryClient, TEST_USER); assertEquals("Test", user.getName().getGivenName()); } }
[FOCAL] public static User GoogleAppsSdkUtils.retrieveUser(Directory directoryClient, String userKey) [CLASS] class GoogleAppsSdkUtils [METRICS] loc=13 cc=2 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] Object execute(DirectoryRequest request) [CALLS-EXTERNAL] LOG.debug/2, directoryClient.users().get...
/* static context [FOCAL] public static User GoogleAppsSdkUtils.retrieveUser(Directory directoryClient, String userKey) [PATH1] try-body throws -> return (User) execute(request) [INPUTS] branches=- | result=directoryClient, userKey [COLLABORATORS] param directoryClient:Directory users/0 [EXCEPTIONS] declares IOExceptio...
/* static context [FOCAL] public static User GoogleAppsSdkUtils.retrieveUser(Directory directoryClient, String userKey) [PATH1] try-body throws -> return (User) execute(request) [INPUTS] branches=- | result=directoryClient, userKey [COLLABORATORS] param directoryClient:Directory users/0 [EXCEPTIONS] declares IOExceptio...
true
ok
{"focal": {"class": "GoogleAppsSdkUtils", "name": "retrieveUser", "signature": "User retrieveUser(Directory directoryClient, String userKey) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "directoryClient", "type": "Directory"}, {"name": "userKey", "type": "String"}], "return_ty...
21919832_0
class StringFormatUtils { public static String addAtEndIfNotPresent(final String string, final String suffix) { return string == null ? suffix : !string.endsWith(suffix) ? string + suffix : string; } private StringFormatUtils(); private final String string; private final String suffix; ...
assertEquals(expected, StringFormatUtils.addAtEndIfNotPresent(string, suffix)); } }
[FOCAL] public static String StringFormatUtils.addAtEndIfNotPresent(String string, String suffix) [CLASS] class StringFormatUtils [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] String.endsWith/1 [INPUTS] branches=- | result=string, suffix [DATAFLOW] string@param->L2; suffix@param-...
/* static context [FOCAL] public static String StringFormatUtils.addAtEndIfNotPresent(String string, String suffix) [INPUTS] branches=- | result=string, suffix [CALLS-EXTERNAL] String.endsWith/1 */
/* static context [FOCAL] public static String StringFormatUtils.addAtEndIfNotPresent(String string, String suffix) [INPUTS] branches=- | result=string, suffix [CALLS-EXTERNAL] String.endsWith/1 */ class StringFormatUtils { public static String addAtEndIfNotPresent(final String string, final String suffix) { ...
true
ok
{"focal": {"class": "StringFormatUtils", "name": "addAtEndIfNotPresent", "signature": "String addAtEndIfNotPresent(String string, String suffix)", "start_line": 3, "modifiers": "public static", "params": [{"name": "string", "type": "String"}, {"name": "suffix", "type": "String"}], "return_type": "String"}, "class_info"...
21921396_10
class ServiceElementFactory { public static ServiceElement create(final ServiceSignature signature, File configFile) throws IOException, ConfigurationException, ...
ServiceDeployment deployment = new ServiceDeployment(); deployment.setConfig(getConfigDir()+"/PlannedConfig.groovy"); ServiceElement service = ServiceElementFactory.create(deployment, new File(getConfigDir()+"/PlannedConfig.groovy")); Assert.assertTrue(service.getPlanned()==10); ...
[FOCAL] public static ServiceElement ServiceElementFactory.create(ServiceSignature signature, File configFile) [CLASS] class ServiceElementFactory [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] ServiceElement create(ServiceDeployment deployment, File configFile) [CALLS-EXTERNAL] S...
/* static context [FOCAL] public static ServiceElement ServiceElementFactory.create(ServiceSignature signature, File configFile) [INPUTS] branches=- | result=configFile, signature [COLLABORATORS] param signature:ServiceSignature getDeployment/0 [EXCEPTIONS] declares IOException, ConfigurationException, ResolverExceptio...
/* static context [FOCAL] public static ServiceElement ServiceElementFactory.create(ServiceSignature signature, File configFile) [INPUTS] branches=- | result=configFile, signature [COLLABORATORS] param signature:ServiceSignature getDeployment/0 [EXCEPTIONS] declares IOException, ConfigurationException, ResolverExceptio...
true
ok
{"focal": {"class": "ServiceElementFactory", "name": "create", "signature": "ServiceElement create(ServiceSignature signature, File configFile) throws IOException, ConfigurationException, ResolverException, URISyntaxException", "start_line": 3, "modifiers": "public static", "params": [{"name": "signature", "type": "Ser...
21942754_2
class CloudFoundryAppServiceDiscoveryClient extends CloudFoundryDiscoveryClient { @Override public List<ServiceInstance> getInstances(String serviceId) { return getCloudFoundryService().getApplicationInstances(serviceId) .filter(tuple -> tuple.getT1().getUrls().stream().anyMatch(this::isInternalDomain)).map(tu...
String serviceId = "billing"; ApplicationDetail applicationDetail = ApplicationDetail.builder().id("billing1").name("billing").instances(1) .memoryLimit(1024).stack("cflinux2").diskQuota(1024).requestedState("Running").runningInstances(1) .urls("billing.apps.example.com", "billing.apps.internal").build(); ...
[FOCAL] @Override public List<ServiceInstance> CloudFoundryAppServiceDiscoveryClient.getInstances(String serviceId) [CLASS] class CloudFoundryAppServiceDiscoveryClient extends CloudFoundryDiscoveryClient [METRICS] loc=17 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] getCloudFoundryService().getA...
/* static context [FOCAL] @Override public List<ServiceInstance> CloudFoundryAppServiceDiscoveryClient.getInstances(String serviceId) [INPUTS] branches=- | result=serviceId [COLLABORATORS] field tuple getT1/0,getT2/0 [NEW] HashMap<>, DefaultServiceInstance [CALLS-EXTERNAL] getCloudFoundryService().getApplicationInstanc...
/* static context [FOCAL] @Override public List<ServiceInstance> CloudFoundryAppServiceDiscoveryClient.getInstances(String serviceId) [INPUTS] branches=- | result=serviceId [COLLABORATORS] field tuple getT1/0,getT2/0 [NEW] HashMap<>, DefaultServiceInstance [CALLS-EXTERNAL] getCloudFoundryService().getApplicationInstanc...
true
ok
{"focal": {"class": "CloudFoundryAppServiceDiscoveryClient", "name": "getInstances", "signature": "List<ServiceInstance> getInstances(String serviceId)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "serviceId", "type": "String"}], "return_type": "List<ServiceInstance>"}, "class_info": {"name":...
21967508_32
class BaseUploader { public final boolean uploadGlucoseDataSets(List<GlucoseDataSet> glucoseDataSets) { if (glucoseDataSets == null) { return true; } boolean output = true; for (GlucoseDataSet glucoseDataSet : glucoseDataSets) { try { output &...
List<GlucoseDataSet> list = Lists.newArrayList( mockGlucoseDataSet(), mockGlucoseDataSet(), mockGlucoseDataSet()); mockUploader.uploadGlucoseDataSets(list); assertThat(mockUploader.glucoseDataSets, hasSize(3)); } }
[FOCAL] public final boolean BaseUploader.uploadGlucoseDataSets(List<GlucoseDataSet> glucoseDataSets) [CLASS] class BaseUploader [METRICS] loc=15 cc=4 branches=1 loops=1 returns=2 throws=0 nesting=2 [CALLS-INTERNAL] boolean doUpload(GlucoseDataSet glucoseDataSet) [CALLS-EXTERNAL] log.error/2 [EXCEPTIONS] catches IOExce...
/* static context [FOCAL] public final boolean BaseUploader.uploadGlucoseDataSets(List<GlucoseDataSet> glucoseDataSets) [PATH1] if(glucoseDataSets == null)=F -> foreach(GlucoseDataSet glucoseDataSet : glucoseDataSets)=T -> try-body throws -> exit loop -> return output [PATH2] if(glucoseDataSets == null)=T -> return tru...
/* static context [FOCAL] public final boolean BaseUploader.uploadGlucoseDataSets(List<GlucoseDataSet> glucoseDataSets) [PATH1] if(glucoseDataSets == null)=F -> foreach(GlucoseDataSet glucoseDataSet : glucoseDataSets)=T -> try-body throws -> exit loop -> return output [PATH2] if(glucoseDataSets == null)=T -> return tru...
true
ok
{"focal": {"class": "BaseUploader", "name": "uploadGlucoseDataSets", "signature": "boolean uploadGlucoseDataSets(List<GlucoseDataSet> glucoseDataSets)", "start_line": 3, "modifiers": "public final", "params": [{"name": "glucoseDataSets", "type": "List<GlucoseDataSet>"}], "return_type": "boolean"}, "class_info": {"name"...
21977200_13
class EchoCommandHandler { String applyReplacements(StringBuilder builder) { boolean prepand = false; if(builder.length() >= 1 && builder.charAt(0) == '\\'){ //our regexpr doesn't work if a special char is at the beginning! builder.insert(0, '_'); prepand = true; } //\c if(builder.indexOf("\\c") !...
assertEquals(" \u0007", applyReplacement(" \\a")); assertEquals(" \b", applyReplacement(" \\b")); assertEquals(" \u001B", applyReplacement(" \\e")); assertEquals(" \f", applyReplacement(" \\f")); assertEquals(" \n", applyReplacement(" \\n")); assertEquals(" \r", applyReplacement(" \\r")); assertEquals(" \...
[FOCAL] String EchoCommandHandler.applyReplacements(StringBuilder builder) [CLASS] class EchoCommandHandler [METRICS] loc=49 cc=8 branches=3 loops=4 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] StringBuilder.length/0, StringBuilder.charAt/1, StringBuilder.insert/2, StringBuilder.indexOf/1, StringBuilder.replace/3, REP...
/* static context [FOCAL] String EchoCommandHandler.applyReplacements(StringBuilder builder) [PATH1] if(builder.length() >= 1 && builder.charAt(0) == '\\')=T -> if(builder.indexOf("\\c") != -1)=T -> foreach(Entry<String, String> replacement : REPLACEMENTS.entrySet())=T -> while(m.find())=F -> exit loop -> while(octal.f...
/* static context [FOCAL] String EchoCommandHandler.applyReplacements(StringBuilder builder) [PATH1] if(builder.length() >= 1 && builder.charAt(0) == '\\')=T -> if(builder.indexOf("\\c") != -1)=T -> foreach(Entry<String, String> replacement : REPLACEMENTS.entrySet())=T -> while(m.find())=F -> exit loop -> while(octal.f...
true
ok
{"focal": {"class": "EchoCommandHandler", "name": "applyReplacements", "signature": "String applyReplacements(StringBuilder builder)", "start_line": 3, "modifiers": "", "params": [{"name": "builder", "type": "StringBuilder"}], "return_type": "String"}, "class_info": {"name": "EchoCommandHandler", "kind": "class", "modi...
21980975_88
class LuceneProxyNodeQuery extends Query { @Override public void setBoost(final float b) { nodeQuery.setBoost(b); } public LuceneProxyNodeQuery(final NodeQuery nq); @Override public Weight createWeight(final IndexSearcher searcher); @Override public Query rewrite(final IndexReader reader); @Overri...
final float boost = 2.5f; this.addDocument("\"aaa ccc\" \"one five\" . \"aaa bbb\" \"ccc eee\" ."); BooleanQuery bq1 = new BooleanQuery(); NodeTermQuery tq = new NodeTermQuery(new Term (DEFAULT_TEST_FIELD, "one")); tq.setBoost(boost); bq1.add(new LuceneProxyNodeQuery(tq), Occur.MUST); bq1....
[FOCAL] @Override public void LuceneProxyNodeQuery.setBoost(float b) [CLASS] class LuceneProxyNodeQuery extends Query [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] nodeQuery.setBoost/1 [COLLABORATORS] field nodeQuery setBoost/1 [DATAFLOW] b@param->L3 [CLASS-MEMBERS] LuceneProxyNo...
/* static context [FOCAL] @Override public void LuceneProxyNodeQuery.setBoost(float b) [COLLABORATORS] field nodeQuery setBoost/1 [CALLS-EXTERNAL] nodeQuery.setBoost/1 */
/* static context [FOCAL] @Override public void LuceneProxyNodeQuery.setBoost(float b) [COLLABORATORS] field nodeQuery setBoost/1 [CALLS-EXTERNAL] nodeQuery.setBoost/1 */ class LuceneProxyNodeQuery extends Query { @Override public void setBoost(final float b) { nodeQuery.setBoost(b); } public LuceneProxy...
true
ok
{"focal": {"class": "LuceneProxyNodeQuery", "name": "setBoost", "signature": "void setBoost(float b)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "b", "type": "float"}], "return_type": "void"}, "class_info": {"name": "LuceneProxyNodeQuery", "kind": "class", "modifiers": "", "superclass": "Que...
21993347_98
class TagsBuilder { public T withTag(String k, String v) { extraTags.add(new BasicTag(k, v)); return (T) this; } protected TagsBuilder(); public T withTag(String k, Boolean v); public T withTag(String k, Enum<E> v); public T withTag(Tag t); public T withTags(String... tags); public T withTag...
Id id = new Builder() .withTag(new BasicTag("k", "v")) .build(); Assertions.assertEquals(newId("k", "v"), id); } }
[FOCAL] public T TagsBuilder.withTag(String k, String v) [CLASS] class TagsBuilder [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] extraTags.add/1 [NEW] BasicTag [COLLABORATORS] field extraTags add/1 [DATAFLOW] k@param->L2; v@param->L2 [CLASS-MEMBERS] TagsBuilder(); T withTag(Strin...
/* static context [FOCAL] public T TagsBuilder.withTag(String k, String v) [COLLABORATORS] field extraTags add/1 [NEW] BasicTag [CALLS-EXTERNAL] extraTags.add/1 */
/* static context [FOCAL] public T TagsBuilder.withTag(String k, String v) [COLLABORATORS] field extraTags add/1 [NEW] BasicTag [CALLS-EXTERNAL] extraTags.add/1 */ class TagsBuilder { public T withTag(String k, String v) { extraTags.add(new BasicTag(k, v)); return (T) this; } protected TagsBuilder(); ...
true
ok
{"focal": {"class": "TagsBuilder", "name": "withTag", "signature": "T withTag(String k, String v)", "start_line": 3, "modifiers": "public", "params": [{"name": "k", "type": "String"}, {"name": "v", "type": "String"}], "return_type": "T"}, "class_info": {"name": "TagsBuilder", "kind": "class", "modifiers": "", "supercla...
21996028_0
class Card { public String getIssueKey() { return MatcherUtils.singleMatch(desc, "browse/([\\w-]+)"); } private Card(); public Card(Swimlane swimlane, String name); public Card(Issue issue, String jiraUrl); public Card(Swimlane swimlane, Issue issue, String jiraUrl); public St...
String issueKey = "HW-34305"; Card card = new Card(new Swimlane(new Board("board-name"), "swim-lane"), new Issue(issueKey), "jira-url"); assertEquals(issueKey, card.getIssueKey()); } }
[FOCAL] public String Card.getIssueKey() [CLASS] class Card [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] MatcherUtils.singleMatch/2 [CLASS-MEMBERS] Card(); Card(Swimlane swimlane, String name); Card(Issue issue, String jiraUrl); Card(Swimlane swimlane, Issue issue, String jiraUr...
/* static context [FOCAL] public String Card.getIssueKey() [CALLS-EXTERNAL] MatcherUtils.singleMatch/2 */
/* static context [FOCAL] public String Card.getIssueKey() [CALLS-EXTERNAL] MatcherUtils.singleMatch/2 */ class Card { public String getIssueKey() { return MatcherUtils.singleMatch(desc, "browse/([\\w-]+)"); } private Card(); public Card(Swimlane swimlane, String name); public Card(Issu...
true
ok
{"focal": {"class": "Card", "name": "getIssueKey", "signature": "String getIssueKey()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "Card", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Card", "kin...
22027221_0
class Util { public static int countChars(String string, int character) { int count = 0; int currIndex = 0; while (true) { currIndex = string.indexOf(character, currIndex); if (currIndex == -1) break; ++currIndex; // Start next search from next character ++count; } return count; } static ...
assertTrue(Util.countChars("abcxdefxghix", 'x') == 3); assertTrue(Util.countChars("", 'x') == 0); assertTrue(Util.countChars("abc\ndef", '\n') == 1); } }
[FOCAL] public static int Util.countChars(String string, int character) [CLASS] class Util [METRICS] loc=12 cc=2 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] String.indexOf/2 [PATH1] while(true)=T -> if(currIndex == -1)=T -> return count [INPUTS] branches=character, string | result=- [DATAFLOW] char...
/* static context [FOCAL] public static int Util.countChars(String string, int character) [PATH1] while(true)=T -> if(currIndex == -1)=T -> return count [INPUTS] branches=character, string | result=- [CALLS-EXTERNAL] String.indexOf/2 */
/* static context [FOCAL] public static int Util.countChars(String string, int character) [PATH1] while(true)=T -> if(currIndex == -1)=T -> return count [INPUTS] branches=character, string | result=- [CALLS-EXTERNAL] String.indexOf/2 */ class Util { public static int countChars(String string, int character) { int c...
true
ok
{"focal": {"class": "Util", "name": "countChars", "signature": "int countChars(String string, int character)", "start_line": 3, "modifiers": "public static", "params": [{"name": "string", "type": "String"}, {"name": "character", "type": "int"}], "return_type": "int"}, "class_info": {"name": "Util", "kind": "class", "mo...
22045363_246
class AlosAV2Metadata extends XmlMetadata { @Override public int getRasterHeight() { if (height == 0) { try { height = Integer.parseInt(getAttributeValue(AlosAV2Constants.PATH_IMG_NUM_ROWS, AlosAV2Constants.STRING_ZERO)); } catch (NumberFormatException e) { ...
assertEquals(200, metadata.getRasterHeight()); } }
[FOCAL] @Override public int AlosAV2Metadata.getRasterHeight() [CLASS] class AlosAV2Metadata extends XmlMetadata [METRICS] loc=11 cc=3 branches=1 loops=0 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] Integer.parseInt/1, getAttributeValue/2 (inherited), warn/2 (inherited) [EXCEPTIONS] catches NumberFormatException e [PA...
/* static context [FOCAL] @Override public int AlosAV2Metadata.getRasterHeight() [PATH1] if(height == 0)=T -> try-body throws -> return height [PATH2] if(height == 0)=F -> return height [EXCEPTIONS] catches NumberFormatException e [CALLS-EXTERNAL] Integer.parseInt/1, getAttributeValue/2 (inherited), warn/2 (inherited) ...
/* static context [FOCAL] @Override public int AlosAV2Metadata.getRasterHeight() [PATH1] if(height == 0)=T -> try-body throws -> return height [PATH2] if(height == 0)=F -> return height [EXCEPTIONS] catches NumberFormatException e [CALLS-EXTERNAL] Integer.parseInt/1, getAttributeValue/2 (inherited), warn/2 (inherited) ...
true
ok
{"focal": {"class": "AlosAV2Metadata", "name": "getRasterHeight", "signature": "int getRasterHeight()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "AlosAV2Metadata", "kind": "class", "modifiers": "", "superclass": "XmlMetadata", "interfaces": null, "fie...
22080403_1
class AvroExhibit { public static Exhibit create(GenericRecord record) { Schema schema = record.getSchema(); ExhibitDescriptor desc = createDescriptor(schema); List<Object> attrValues = Lists.newArrayListWithExpectedSize(desc.attributes().size()); for (int i = 0; i < desc.attributes().size(); i++) { ...
GenericData.Record in1 = new GenericData.Record(inner); in1.put("f1", null); in1.put("f2", true); in1.put("f3", 1729); GenericData.Record in2 = new GenericData.Record(inner); in2.put("f1", "josh"); in2.put("f3", 29); List<GenericData.Record> recs = Lists.newArrayList(in1, in2); Gener...
[FOCAL] public static Exhibit AvroExhibit.create(GenericRecord record) [CLASS] class AvroExhibit [METRICS] loc=29 cc=7 branches=2 loops=4 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] ExhibitDescriptor createDescriptor(Schema schema); GenericRecord getInnerRecord(GenericRecord record) [CALLS-EXTERNAL] GenericRecord.get...
/* static context [FOCAL] public static Exhibit AvroExhibit.create(GenericRecord record) [PATH1] for(i < desc.attributes().size())=T -> if(val != null && desc.attributes().get(i).type == FieldType.STRING)=T -> exit loop -> foreach(String frameName : desc.frames().keySet())=T -> if(raw != null)=T -> foreach(GenericRecor...
/* static context [FOCAL] public static Exhibit AvroExhibit.create(GenericRecord record) [PATH1] for(i < desc.attributes().size())=T -> if(val != null && desc.attributes().get(i).type == FieldType.STRING)=T -> exit loop -> foreach(String frameName : desc.frames().keySet())=T -> if(raw != null)=T -> foreach(GenericRecor...
true
ok
{"focal": {"class": "AvroExhibit", "name": "create", "signature": "Exhibit create(GenericRecord record)", "start_line": 3, "modifiers": "public static", "params": [{"name": "record", "type": "GenericRecord"}], "return_type": "Exhibit"}, "class_info": {"name": "AvroExhibit", "kind": "class", "modifiers": "", "superclass...
22095939_158
class MemoryChannel extends BasicChannelSemantics { @Override public void configure(Context context) { try { capacity = context.getInteger("capacity", defaultCapacity); } catch(NumberFormatException e) { capacity = defaultCapacity; LOGGER.warn("Invalid capacity specified, initializing cha...
Context context = new Context(); Map<String, String> parms = new HashMap<String, String>(); parms.put("byteCapacity", "2000"); parms.put("byteCapacityBufferPercentage", "20"); context.putAll(parms); Configurables.configure(channel, context); byte[] eventBody = new byte[405]; Transacti...
[FOCAL] @Override public void MemoryChannel.configure(Context context) [CLASS] class MemoryChannel extends BasicChannelSemantics [METRICS] loc=91 cc=16 branches=8 loops=0 returns=0 throws=0 nesting=4 [CALLS-INTERNAL] void resizeQueue(int capacity) [CALLS-EXTERNAL] Context.getInteger/2, LOGGER.warn/2, Preconditions.chec...
/* static context [FOCAL] @Override public void MemoryChannel.configure(Context context) [PATH1] try-body throws -> if(capacity <= 0)=T -> try-body throws -> if(transCapacity <= 0)=T -> try-body throws -> try-body throws -> try-body throws -> if(queue != null)=T -> if(bytesRemaining == null)=F -> if(byteCapacity > last...
/* static context [FOCAL] @Override public void MemoryChannel.configure(Context context) [PATH1] try-body throws -> if(capacity <= 0)=T -> try-body throws -> if(transCapacity <= 0)=T -> try-body throws -> try-body throws -> try-body throws -> if(queue != null)=T -> if(bytesRemaining == null)=F -> if(byteCapacity > last...
true
ok
{"focal": {"class": "MemoryChannel", "name": "configure", "signature": "void configure(Context context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "context", "type": "Context"}], "return_type": "void"}, "class_info": {"name": "MemoryChannel", "kind": "class", "modifiers": "", "superclass": ...
22102786_119
class DefaultRiskAnalysis implements RiskAnalysis { @Override public Result analyze() { checkState(!analyzed); analyzed = true; Result result = analyzeIsFinal(); if (result != Result.OK) return result; return analyzeIsStandard(); } private Default...
Transaction tx = new Transaction(params); tx.addInput(params.getGenesisBlock().getTransactions().get(0).getOutput(0)); // A pay to address output tx.addOutput(Coin.CENT, ScriptBuilder.createOutputScript(key1.toAddress(params))); // A pay to pubkey output tx.addOutput(Coin...
[FOCAL] @Override public Result DefaultRiskAnalysis.analyze() [CLASS] class DefaultRiskAnalysis implements RiskAnalysis [METRICS] loc=11 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] Result analyzeIsFinal(); Result analyzeIsStandard() [CALLS-EXTERNAL] checkState/1 (inherited) [PATH1] if(result !...
/* static context [FOCAL] @Override public Result DefaultRiskAnalysis.analyze() [PATH1] if(result != Result.OK)=T -> return result [PATH2] if(result != Result.OK)=F -> return analyzeIsStandard() [CALLS-INTERNAL] Result analyzeIsFinal(); Result analyzeIsStandard() [CALLS-EXTERNAL] checkState/1 (inherited) */
/* static context [FOCAL] @Override public Result DefaultRiskAnalysis.analyze() [PATH1] if(result != Result.OK)=T -> return result [PATH2] if(result != Result.OK)=F -> return analyzeIsStandard() [CALLS-INTERNAL] Result analyzeIsFinal(); Result analyzeIsStandard() [CALLS-EXTERNAL] checkState/1 (inherited) */ class Defau...
true
ok
{"focal": {"class": "DefaultRiskAnalysis", "name": "analyze", "signature": "Result analyze()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Result"}, "class_info": {"name": "DefaultRiskAnalysis", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "RiskAnalysis", "fiel...
22104852_1
class ConcordanceArrayWindowSearcher { public void search(IndexSearcher searcher, String fieldName, Query mainQuery, Query filterQuery, Analyzer analyzer, ArrayWindowVisitor visitor, DocIdBuilder docIdBuilder) throws IllegalArgumentException, TargetTokenNotFoundExcepti...
String[] docs = new String[]{"aa ba ca da ea fa", "ba ca da ga fa ea"}; Analyzer analyzer = getAnalyzer( MockTokenFilter.EMPTY_STOPSET, 50, 100); Directory directory = getDirectory(analyzer, docs); IndexReader reader = DirectoryReader.open(directory); IndexSearcher indexSearcher = new IndexS...
[FOCAL] public void ConcordanceArrayWindowSearcher.search(IndexSearcher searcher, String fieldName, Query mainQuery, Query filterQuery, Analyzer analyzer, ArrayWindowVisitor visitor, DocIdBuilder docIdBuilder) [CLASS] class ConcordanceArrayWindowSearcher [METRICS] loc=26 cc=3 branches=2 loops=0 returns=0 throws=0 nesti...
/* static context [FOCAL] public void ConcordanceArrayWindowSearcher.search(IndexSearcher searcher, String fieldName, Query mainQuery, Query filterQuery, Analyzer analyzer, ArrayWindowVisitor visitor, DocIdBuilder docIdBuilder) [PATH1] if(mainQuery instanceof SpanQuery)=F -> if(filterQuery != null)=T [PATH2] if(mainQue...
/* static context [FOCAL] public void ConcordanceArrayWindowSearcher.search(IndexSearcher searcher, String fieldName, Query mainQuery, Query filterQuery, Analyzer analyzer, ArrayWindowVisitor visitor, DocIdBuilder docIdBuilder) [PATH1] if(mainQuery instanceof SpanQuery)=F -> if(filterQuery != null)=T [PATH2] if(mainQue...
true
ok
{"focal": {"class": "ConcordanceArrayWindowSearcher", "name": "search", "signature": "void search(IndexSearcher searcher, String fieldName, Query mainQuery, Query filterQuery, Analyzer analyzer, ArrayWindowVisitor visitor, DocIdBuilder docIdBuilder) throws IllegalArgumentException, TargetTokenNotFoundException, IOExcep...
22248638_1
class ClassUtils { public static void getClassesWithAnnotation(String packageName, Class<? extends Annotation> annotationClass, ClassVisitor visitor) throws ClassLoadingException { LOGGER.trace("Finding classes with...
try { List<Class<?>> classes = new ArrayList<>(); ClassUtils.getClassesWithAnnotation( "org.junit.runner.notification", RunListener.ThreadSafe.class, classes::add ); assertThat(classes.size(), greaterThan(0)); } catch (ClassLoadingException e) { e.prin...
[FOCAL] public static void ClassUtils.getClassesWithAnnotation(String packageName, Class<? extends Annotation> annotationClass, ClassVisitor visitor) [CLASS] class ClassUtils [METRICS] loc=28 cc=5 branches=2 loops=1 returns=0 throws=2 nesting=4 [CALLS-INTERNAL] ClassLoader getClassLoader(); void findClassesInFile(File ...
/* static context [FOCAL] public static void ClassUtils.getClassesWithAnnotation(String packageName, Class<? extends Annotation> annotationClass, ClassVisitor visitor) [THROWS-WHEN] ClassLoadingException when try-body throws [THROWS-WHEN] ClassLoadingException when resources.hasMoreElements() && !("jar".equals(protocol...
/* static context [FOCAL] public static void ClassUtils.getClassesWithAnnotation(String packageName, Class<? extends Annotation> annotationClass, ClassVisitor visitor) [THROWS-WHEN] ClassLoadingException when try-body throws [THROWS-WHEN] ClassLoadingException when resources.hasMoreElements() && !("jar".equals(protocol...
true
ok
{"focal": {"class": "ClassUtils", "name": "getClassesWithAnnotation", "signature": "void getClassesWithAnnotation(String packageName, Class<? extends Annotation> annotationClass, ClassVisitor visitor) throws ClassLoadingException", "start_line": 3, "modifiers": "public static", "params": [{"name": "packageName", "type"...
22254856_57
class CompositeNotifier implements Notifier { @Override public Mono<Void> notify(InstanceEvent event) { return Flux.fromIterable(delegates).flatMap((d) -> d.notify(event).onErrorResume((error) -> { log.warn("Unexpected exception while triggering notifications. Notification might not be sent.", error); return...
TestNotifier notifier1 = new TestNotifier(); TestNotifier notifier2 = new TestNotifier(); CompositeNotifier compositeNotifier = new CompositeNotifier(Arrays.asList(notifier1, notifier2)); StepVerifier.create(compositeNotifier.notify(APP_DOWN)).verifyComplete(); assertThat(notifier1.getEvents()).containsOnly...
[FOCAL] @Override public Mono<Void> CompositeNotifier.notify(InstanceEvent event) [CLASS] class CompositeNotifier implements Notifier [METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Flux.fromIterable(delegates).flatMap((d) -> d.notify(even....then/0, Flux.fromIterable(delegates).fl...
/* static context [FOCAL] @Override public Mono<Void> CompositeNotifier.notify(InstanceEvent event) [INPUTS] branches=- | result=event [COLLABORATORS] field d notify/1 [CALLS-EXTERNAL] Flux.fromIterable(delegates).flatMap((d) -> d.notify(even....then/0, Flux.fromIterable(delegates).flatMap/1, Flux.fromIterable/1, d.not...
/* static context [FOCAL] @Override public Mono<Void> CompositeNotifier.notify(InstanceEvent event) [INPUTS] branches=- | result=event [COLLABORATORS] field d notify/1 [CALLS-EXTERNAL] Flux.fromIterable(delegates).flatMap((d) -> d.notify(even....then/0, Flux.fromIterable(delegates).flatMap/1, Flux.fromIterable/1, d.not...
true
ok
{"focal": {"class": "CompositeNotifier", "name": "notify", "signature": "Mono<Void> notify(InstanceEvent event)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "event", "type": "InstanceEvent"}], "return_type": "Mono<Void>"}, "class_info": {"name": "CompositeNotifier", "kind": "class", "modifier...
22266761_0
class Statistics { public String getMeteringPointName() { return meteringPointName; } public Statistics(String meteringPointName); public void addValue(long actual); public BigDecimal average(); public BigDecimal standardDeviation(); public List<Average> getAverages(); public long getCounter(); public lo...
assertThat(classUnderTests.getMeteringPointName(), is(METERING_POINT_NAME)); } }
[FOCAL] public String Statistics.getMeteringPointName() [CLASS] class Statistics [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Statistics(String meteringPointName); void addValue(long actual); BigDecimal average(); BigDecimal standardDeviation(); List<Average> getAverages(); long ...
/* static context [FOCAL] public String Statistics.getMeteringPointName() */
/* static context [FOCAL] public String Statistics.getMeteringPointName() */ class Statistics { public String getMeteringPointName() { return meteringPointName; } public Statistics(String meteringPointName); public void addValue(long actual); public BigDecimal average(); public BigDecimal standardDeviation(...
true
ok
{"focal": {"class": "Statistics", "name": "getMeteringPointName", "signature": "String getMeteringPointName()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "Statistics", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name...
22269384_141
class ClassificationDistribution extends AbstractOryxResource { @GET @Path("{datum}") @Produces({MediaType.TEXT_PLAIN, "text/csv", MediaType.APPLICATION_JSON}) public List<IDValue> get(@PathParam("datum") String datum) throws OryxServingException { check(datum != null && !datum.isEmpty(), "Missing input da...
List<IDValue> recs = target("/classificationDistribution/A,-5,").request() .accept(MediaType.APPLICATION_JSON_TYPE).get(LIST_ID_VALUE_TYPE); Assert.assertEquals("X", recs.get(0).getID()); Assert.assertEquals((1.0 / 6.0 + 2 * (100.0 / 1400.0)) / 3, recs.get(0).getValue(), ...
[FOCAL] @GET @Path("{datum}") @Produces({MediaType.TEXT_PLAIN, "text/csv", MediaType.APPLICATION_JSON}) public List<IDValue> ClassificationDistribution.get(String datum) [CLASS] class ClassificationDistribution extends AbstractOryxResource [METRICS] loc=22 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXT...
/* static context [FOCAL] @GET @Path("{datum}") @Produces({MediaType.TEXT_PLAIN, "text/csv", MediaType.APPLICATION_JSON}) public List<IDValue> ClassificationDistribution.get(String datum) [PATH1] for(i < probabilities.length)=T -> exit loop -> return result [PATH2] for(i < probabilities.length)=F -> return result [INPU...
/* static context [FOCAL] @GET @Path("{datum}") @Produces({MediaType.TEXT_PLAIN, "text/csv", MediaType.APPLICATION_JSON}) public List<IDValue> ClassificationDistribution.get(String datum) [PATH1] for(i < probabilities.length)=T -> exit loop -> return result [PATH2] for(i < probabilities.length)=F -> return result [INPU...
true
ok
{"focal": {"class": "ClassificationDistribution", "name": "get", "signature": "List<IDValue> get(String datum) throws OryxServingException", "start_line": 3, "modifiers": "@GET @Path(\"{datum}\") @Produces({MediaType.TEXT_PLAIN, \"text/csv\", MediaType.APPLICATION_JSON}) public", "params": [{"name": "datum", "type": "S...
22289790_6
class ExceptionUtils { public static String toString(Throwable error) { if (error == null) return null; StringWriter stringWriter = new StringWriter(); PrintWriter printWriter = new PrintWriter(stringWriter); error.printStackTrace(printWriter); return stringWrit...
Exception ex = new Exception("Erf"); String str = ExceptionUtils.toString(ex); assertThat(str).startsWith("" + "java.lang.Exception: Erf\n" + "\tat tzatziki.util.ExceptionUtilsTest.toString_should_return_the_stacktrace(ExceptionUtilsTest.java:"); } }
[FOCAL] public static String ExceptionUtils.toString(Throwable error) [CLASS] class ExceptionUtils [METRICS] loc=9 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] Throwable.printStackTrace/1, StringWriter.toString/0 [NEW] StringWriter, PrintWriter [PATH1] if(error == null)=T -> return null [PATH2]...
/* static context [FOCAL] public static String ExceptionUtils.toString(Throwable error) [PATH1] if(error == null)=T -> return null [PATH2] if(error == null)=F -> return stringWriter.toString() [INPUTS] branches=error | result=- [COLLABORATORS] param error:Throwable printStackTrace/1 [NEW] StringWriter, PrintWriter [CAL...
/* static context [FOCAL] public static String ExceptionUtils.toString(Throwable error) [PATH1] if(error == null)=T -> return null [PATH2] if(error == null)=F -> return stringWriter.toString() [INPUTS] branches=error | result=- [COLLABORATORS] param error:Throwable printStackTrace/1 [NEW] StringWriter, PrintWriter [CAL...
true
ok
{"focal": {"class": "ExceptionUtils", "name": "toString", "signature": "String toString(Throwable error)", "start_line": 3, "modifiers": "public static", "params": [{"name": "error", "type": "Throwable"}], "return_type": "String"}, "class_info": {"name": "ExceptionUtils", "kind": "class", "modifiers": "", "superclass":...
22292873_19
class CommentsConverter implements Converter { private String getPostContents(String title, String description) { if (StringUtils.isEmpty(title)) { return description; } if (StringUtils.isEmpty(description)) { return title; } return title + "\n\n" +...
Comment comment = convertComments("comment-default.json").get(0); assertThat(comment.getAuthor(), equalTo("awesomesaucetester")); assertThat(comment.getPostContents(), equalTo("first reply lol")); assertThat(comment.isScoreHidden(), equalTo(true)); assertThat(comment.getScore(),...
[FOCAL] private String CommentsConverter.getPostContents(String title, String description) [CLASS] class CommentsConverter implements Converter [METRICS] loc=11 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1 [CALLS-EXTERNAL] StringUtils.isEmpty/1 [PATH1] if(StringUtils.isEmpty(title))=F -> if(StringUtils.isEmpty(...
/* static context [FOCAL] private String CommentsConverter.getPostContents(String title, String description) [PATH1] if(StringUtils.isEmpty(title))=F -> if(StringUtils.isEmpty(description))=T -> return title [PATH2] if(StringUtils.isEmpty(title))=T -> return description [PATH3] if(StringUtils.isEmpty(title))=F -> if(St...
/* static context [FOCAL] private String CommentsConverter.getPostContents(String title, String description) [PATH1] if(StringUtils.isEmpty(title))=F -> if(StringUtils.isEmpty(description))=T -> return title [PATH2] if(StringUtils.isEmpty(title))=T -> return description [PATH3] if(StringUtils.isEmpty(title))=F -> if(St...
true
ok
{"focal": {"class": "CommentsConverter", "name": "getPostContents", "signature": "String getPostContents(String title, String description)", "start_line": 3, "modifiers": "private", "params": [{"name": "title", "type": "String"}, {"name": "description", "type": "String"}], "return_type": "String"}, "class_info": {"name...
22318767_3
class JsonRpcClient { @NotNull public RequestBuilder<Object> createRequest() { return new RequestBuilder<Object>(transport, mapper); } public JsonRpcClient(@NotNull Transport transport); public JsonRpcClient(@NotNull Transport transport, @NotNull ObjectMapper mapper); @NotNull publi...
JsonRpcClient client = initClient("add_player"); Boolean result = client.createRequest() .id("asd671") .method("add") .param("player", new Player("Kevin", "Shattenkirk", new Team("St. Louis Blues", "NHL"), 22, Position.DEFENDER, ...
[FOCAL] @NotNull public RequestBuilder<Object> JsonRpcClient.createRequest() [CLASS] class JsonRpcClient [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] RequestBuilder<Object> [CLASS-MEMBERS] JsonRpcClient(Transport transport); JsonRpcClient(Transport transport, ObjectMapper mapper); Notifica...
/* static context [FOCAL] @NotNull public RequestBuilder<Object> JsonRpcClient.createRequest() [NEW] RequestBuilder<Object> */
/* static context [FOCAL] @NotNull public RequestBuilder<Object> JsonRpcClient.createRequest() [NEW] RequestBuilder<Object> */ class JsonRpcClient { @NotNull public RequestBuilder<Object> createRequest() { return new RequestBuilder<Object>(transport, mapper); } public JsonRpcClient(@NotNull T...
true
ok
{"focal": {"class": "JsonRpcClient", "name": "createRequest", "signature": "RequestBuilder<Object> createRequest()", "start_line": 3, "modifiers": "@NotNull public", "params": [], "return_type": "RequestBuilder<Object>"}, "class_info": {"name": "JsonRpcClient", "kind": "class", "modifiers": "", "superclass": null, "int...
22337952_55
class ConcurrentCache implements Cache { @Override public void init() { if (mCache == null) { return; } synchronized (this) { Billing.debug(TAG, "Initializing cache"); mCache.init(); } } ConcurrentCache(@Nullable Cache cache); ...
final Cache mockCache = mock(Cache.class); final ConcurrentCache cache = new ConcurrentCache(mockCache); cache.init(); verify(mockCache, times(1)).init(); } }
[FOCAL] @Override public void ConcurrentCache.init() [CLASS] class ConcurrentCache implements Cache [METRICS] loc=10 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] Billing.debug/2, mCache.init/0 [PATH1] if(mCache == null)=T -> return [PATH2] if(mCache == null)=F [COLLABORATORS] field mCache init/...
/* static context [FOCAL] @Override public void ConcurrentCache.init() [PATH1] if(mCache == null)=T -> return [PATH2] if(mCache == null)=F [COLLABORATORS] field mCache init/0 [CALLS-EXTERNAL] Billing.debug/2, mCache.init/0 */
/* static context [FOCAL] @Override public void ConcurrentCache.init() [PATH1] if(mCache == null)=T -> return [PATH2] if(mCache == null)=F [COLLABORATORS] field mCache init/0 [CALLS-EXTERNAL] Billing.debug/2, mCache.init/0 */ class ConcurrentCache implements Cache { @Override public void init() { if (m...
true
ok
{"focal": {"class": "ConcurrentCache", "name": "init", "signature": "void init()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "ConcurrentCache", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Cache", "fields": [], "members": [{"na...
22342877_72
class UrlBeaconUrlCompressor { public static byte[] compress(String urlString) throws MalformedURLException { byte[] compressedBytes = null; if (urlString != null) { // Figure the compressed bytes can't be longer than the original string. byte[] byteBuffer = new byte[urlStri...
String testURL = "http://google.ca"; byte[] expectedBytes = {0x02, 'g', 'o', 'o', 'g', 'l', 'e', '.', 'c', 'a'}; assertTrue(Arrays.equals(expectedBytes, UrlBeaconUrlCompressor.compress(testURL))); } }
[FOCAL] public static byte[] UrlBeaconUrlCompressor.compress(String urlString) [CLASS] class UrlBeaconUrlCompressor [METRICS] loc=101 cc=12 branches=10 loops=1 returns=1 throws=2 nesting=5 [CALLS-INTERNAL] byte encodedByteForTopLevelDomain(String tld) [CALLS-EXTERNAL] String.length/0, Arrays.fill/2, Pattern.compile/1, ...
/* static context [FOCAL] public static byte[] UrlBeaconUrlCompressor.compress(String urlString) [PATH1] if(urlString != null)=T -> if(urlMatcher.matches())=T -> if(protocol.equalsIgnoreCase(URL_PROTOCOL_HTTP))=T -> if(domains != null)=T -> for(domainIndex < writableDomainsCount)=T -> if(domainIndex > 0)=T -> exit loop...
/* static context [FOCAL] public static byte[] UrlBeaconUrlCompressor.compress(String urlString) [PATH1] if(urlString != null)=T -> if(urlMatcher.matches())=T -> if(protocol.equalsIgnoreCase(URL_PROTOCOL_HTTP))=T -> if(domains != null)=T -> for(domainIndex < writableDomainsCount)=T -> if(domainIndex > 0)=T -> exit loop...
true
ok
{"focal": {"class": "UrlBeaconUrlCompressor", "name": "compress", "signature": "byte[] compress(String urlString) throws MalformedURLException", "start_line": 3, "modifiers": "public static", "params": [{"name": "urlString", "type": "String"}], "return_type": "byte[]"}, "class_info": {"name": "UrlBeaconUrlCompressor", ...
22344826_5
class ButtonWithProgressVM extends SimpleButtonVM implements ProgressButtonVM { @Override public void showLoading() { loading = true; notifyShowProgress(); } public ButtonWithProgressVM(int layoutId, boolean enabled, int clickableResId, int[] enableDisableResIds, ButtonCommand actionCommand, int imageView...
ButtonWithProgressVM buttonWithProgressVM = (ButtonWithProgressVM) buttonVM; buttonWithProgressVM.registerListener(mockedButtonVMListener); buttonWithProgressVM.showLoading(); verify(mockedButtonVMListener).onProgressValueChanged(true, buttonWithProgressVM); } }
[FOCAL] @Override public void ButtonWithProgressVM.showLoading() [CLASS] class ButtonWithProgressVM extends SimpleButtonVM implements ProgressButtonVM [METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void notifyShowProgress() [CLASS-MEMBERS] ButtonWithProgressVM(int layoutId, boolea...
/* static context [FOCAL] @Override public void ButtonWithProgressVM.showLoading() [CALLS-INTERNAL] void notifyShowProgress() */
/* static context [FOCAL] @Override public void ButtonWithProgressVM.showLoading() [CALLS-INTERNAL] void notifyShowProgress() */ class ButtonWithProgressVM extends SimpleButtonVM implements ProgressButtonVM { @Override public void showLoading() { loading = true; notifyShowProgress(); } public ButtonWithProgr...
true
ok
{"focal": {"class": "ButtonWithProgressVM", "name": "showLoading", "signature": "void showLoading()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "ButtonWithProgressVM", "kind": "class", "modifiers": "", "superclass": "SimpleButtonVM", "interfaces": "Pr...
22384317_54
class DiffSyncController { @SuppressWarnings({ "unchecked", "rawtypes" }) @RequestMapping( value="${spring.diffsync.path:}/{resource}", method=RequestMethod.PATCH) public Patch patch(@PathVariable("resource") String resource, @RequestBody Patch patch) throws PatchException { PersistenceCallback<?> persisten...
TodoRepository todoRepository = todoRepository(); MockMvc mvc = mockMvc(todoRepository); mvc.perform( patch(RESOURCE_PATH + "/2") .content(resource("patch-change-entity-id")) .accept(JSON_PATCH) .contentType(JSON_PATCH)) .andExpect(status().isOk()) .andExpect(content().string("[]")) .a...
[FOCAL] @SuppressWarnings({ "unchecked", "rawtypes" }) @RequestMapping( value="${spring.diffsync.path:}/{resource}", method=R... Patch DiffSyncController.patch(String resource, Patch patch) [CLASS] class DiffSyncController [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Patch apply...
/* static context [FOCAL] @SuppressWarnings({ "unchecked", "rawtypes" }) @RequestMapping( value="${spring.diffsync.path:}/{resource}", method=R... Patch DiffSyncController.patch(String resource, Patch patch) [INPUTS] branches=- | result=patch, resource [COLLABORATORS] field callbackRegistry findPersistenceCallback/1 [E...
/* static context [FOCAL] @SuppressWarnings({ "unchecked", "rawtypes" }) @RequestMapping( value="${spring.diffsync.path:}/{resource}", method=R... Patch DiffSyncController.patch(String resource, Patch patch) [INPUTS] branches=- | result=patch, resource [COLLABORATORS] field callbackRegistry findPersistenceCallback/1 [E...
true
ok
{"focal": {"class": "DiffSyncController", "name": "patch", "signature": "Patch patch(String resource, Patch patch) throws PatchException", "start_line": 3, "modifiers": "@SuppressWarnings({ \"unchecked\", \"rawtypes\" }) @RequestMapping( value=\"${spring.diffsync.path:}/{resource}\", method=R...", "params": [{"name": "...
22395060_25
class SpreadProcessingSystem extends BaseEntitySystem { protected abstract void process(int entityId)protected abstract void process(int entityId); protected abstract void process(int entityId)public SpreadProcessingSystem(Aspect.Builder aspect, float roundTripTime); protected abstract void process(int entityId)publ...
final World world = bakeWorld(new MySpreadProcessingSystem(10, 1)); world.delta=0.09f; world.process(); assertAllPenguinsPoked(0); } }
[FOCAL] protected abstract void SpreadProcessingSystem.process(int entityId) [CLASS] class SpreadProcessingSystem extends BaseEntitySystem [METRICS] loc=1 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CLASS-MEMBERS] SpreadProcessingSystem(Aspect.Builder aspect, float roundTripTime); SpreadProcessingSystem(float...
/* static context [FOCAL] protected abstract void SpreadProcessingSystem.process(int entityId) */
/* static context [FOCAL] protected abstract void SpreadProcessingSystem.process(int entityId) */ class SpreadProcessingSystem extends BaseEntitySystem { protected abstract void process(int entityId)protected abstract void process(int entityId); protected abstract void process(int entityId)public SpreadProcessingSys...
true
partial
{"focal": {"class": "SpreadProcessingSystem", "name": "process", "signature": "void process(int entityId)", "start_line": 3, "modifiers": "protected abstract", "params": [{"name": "entityId", "type": "int"}], "return_type": "void"}, "class_info": {"name": "SpreadProcessingSystem", "kind": "class", "modifiers": "", "sup...
22412169_0
class ElasticsearchClientConfiguration { public static Settings getSettings(ConnectorClusterConfig configuration) { Map<String, String> setting = new HashMap<String, String>(); setting.put(NODE_DATA.getElasticSearchOption(), recoverdOptionValue(configuration.getConnectorOptions(), NODE_DATA)); ...
Map<String, String> connectorOptions = new HashMap<>(); connectorOptions.put(NODE_DATA.getManifestOption(), "true"); connectorOptions.put(NODE_MASTER.getManifestOption(), "true"); Map<String, String> clusterOptions = new HashMap<>(); clusterOptions.put(HOST.getManifestOption()...
[FOCAL] public static Settings ElasticsearchClientConfiguration.getSettings(ConnectorClusterConfig configuration) [CLASS] class ElasticsearchClientConfiguration [METRICS] loc=14 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String recoverdOptionValue(Map<String, String> configuration, Configurat...
/* static context [FOCAL] public static Settings ElasticsearchClientConfiguration.getSettings(ConnectorClusterConfig configuration) [COLLABORATORS] param configuration:ConnectorClusterConfig getConnectorOptions/0,getClusterOptions/0 [CALLS-INTERNAL] String recoverdOptionValue(Map<String, String> configuration, Configur...
/* static context [FOCAL] public static Settings ElasticsearchClientConfiguration.getSettings(ConnectorClusterConfig configuration) [COLLABORATORS] param configuration:ConnectorClusterConfig getConnectorOptions/0,getClusterOptions/0 [CALLS-INTERNAL] String recoverdOptionValue(Map<String, String> configuration, Configur...
true
ok
{"focal": {"class": "ElasticsearchClientConfiguration", "name": "getSettings", "signature": "Settings getSettings(ConnectorClusterConfig configuration)", "start_line": 3, "modifiers": "public static", "params": [{"name": "configuration", "type": "ConnectorClusterConfig"}], "return_type": "Settings"}, "class_info": {"na...
22424494_3
class OpenstackAgentProperties extends AgentLifeCycleAdapter { @Override public void afterAgentConfigurationLoaded(@NotNull BuildAgent agent) { try { if ("true".equals(agentConfiguration.getConfigurationParameters().get(OpenstackCloudParameters.AGENT_METADATA_DISABLE))) { LO...
Map<String, String> parameters = new HashMap<String, String>(); parameters.put(OpenstackCloudParameters.AGENT_METADATA_DISABLE, "true"); prepareAgentProperties("meta_data_noUserData.json", parameters).afterAgentConfigurationLoaded(null); Assert.assertTrue(Lo4jBeanAppender.contains("Opens...
[FOCAL] @Override public void OpenstackAgentProperties.afterAgentConfigurationLoaded(BuildAgent agent) [CLASS] class OpenstackAgentProperties extends AgentLifeCycleAdapter [METRICS] loc=49 cc=9 branches=5 loops=1 returns=1 throws=0 nesting=4 [CALLS-INTERNAL] String readDataFromUrl(String sURL) [CALLS-EXTERNAL] "true".e...
/* static context [FOCAL] @Override public void OpenstackAgentProperties.afterAgentConfigurationLoaded(BuildAgent agent) [PATH1] if("true".equals(agentConfiguration.getConfigurationParameters().get(OpenstackCloudParameters.AGENT_METADATA_DISABLE)))=F -> if(uuid != null)=T -> if(name != null)=T -> if(teamCityUserData !=...
/* static context [FOCAL] @Override public void OpenstackAgentProperties.afterAgentConfigurationLoaded(BuildAgent agent) [PATH1] if("true".equals(agentConfiguration.getConfigurationParameters().get(OpenstackCloudParameters.AGENT_METADATA_DISABLE)))=F -> if(uuid != null)=T -> if(name != null)=T -> if(teamCityUserData !=...
true
ok
{"focal": {"class": "OpenstackAgentProperties", "name": "afterAgentConfigurationLoaded", "signature": "void afterAgentConfigurationLoaded(BuildAgent agent)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "agent", "type": "BuildAgent"}], "return_type": "void"}, "class_info": {"name": "OpenstackAg...
22430910_1
class DefaultConfigurator implements Configuration<Map<String, Object>> { @Override public void configure(final Configurable configurable) { currentState.configure(configurable); } @SuppressWarnings("unchecked") @Override public T getParameter(final String name, final T defaultValue); void transitionTo(final ...
final File configurationFile = File.createTempFile(randomString(), ".yaml"); final Map<String, Object> configuration = createSampleConfiguration(configurationFile); System.setProperty( DefaultConfigurator.CONFIGURATION_FILE_SYSTEM_PROPERTY, configurationFile.getAbsolutePath()); cut.configure(dummy...
[FOCAL] @Override public void DefaultConfigurator.configure(Configurable configurable) [CLASS] class DefaultConfigurator implements Configuration<Map<String, Object>> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] currentState.configure/1 [COLLABORATORS] field currentState configu...
/* static context [FOCAL] @Override public void DefaultConfigurator.configure(Configurable configurable) [COLLABORATORS] field currentState configure/1 [CALLS-EXTERNAL] currentState.configure/1 */
/* static context [FOCAL] @Override public void DefaultConfigurator.configure(Configurable configurable) [COLLABORATORS] field currentState configure/1 [CALLS-EXTERNAL] currentState.configure/1 */ class DefaultConfigurator implements Configuration<Map<String, Object>> { @Override public void configure(final Configur...
true
ok
{"focal": {"class": "DefaultConfigurator", "name": "configure", "signature": "void configure(Configurable configurable)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "configurable", "type": "Configurable"}], "return_type": "void"}, "class_info": {"name": "DefaultConfigurator", "kind": "class",...
22441031_2
class ViewHelper { public String renderPluginDashboard(PluginContext context) { return renderPluginTemplate(context, context.getDashboardPath()); } @Autowired public ViewHelper(WebfrontEngine pluginsEngine, ApplicationContext context); public String renderPluginWidgetContent(PluginContext co...
assertEquals("<p>Hello, World!</p>Hey", viewHelper.renderPluginDashboard(getContext("test-started"))); } }
[FOCAL] public String ViewHelper.renderPluginDashboard(PluginContext context) [CLASS] class ViewHelper [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String renderPluginTemplate(PluginContext context, String templatePath) [CALLS-EXTERNAL] PluginContext.getDashboardPath/0 [INPUTS] ...
/* static context [FOCAL] public String ViewHelper.renderPluginDashboard(PluginContext context) [INPUTS] branches=- | result=context [COLLABORATORS] param context:PluginContext getDashboardPath/0 [CALLS-INTERNAL] String renderPluginTemplate(PluginContext context, String templatePath) [CALLS-EXTERNAL] PluginContext.getD...
/* static context [FOCAL] public String ViewHelper.renderPluginDashboard(PluginContext context) [INPUTS] branches=- | result=context [COLLABORATORS] param context:PluginContext getDashboardPath/0 [CALLS-INTERNAL] String renderPluginTemplate(PluginContext context, String templatePath) [CALLS-EXTERNAL] PluginContext.getD...
true
ok
{"focal": {"class": "ViewHelper", "name": "renderPluginDashboard", "signature": "String renderPluginDashboard(PluginContext context)", "start_line": 3, "modifiers": "public", "params": [{"name": "context", "type": "PluginContext"}], "return_type": "String"}, "class_info": {"name": "ViewHelper", "kind": "class", "modifi...
22527647_2
class TailTypeInjector { public List<TailType> getTailTypeFromArgs(String... types) { List<TailType> tailers = new LinkedList<TailType>(); TailType tailType = null; for (String type : types) { if ("".equals(type)) { System.out.println("------------- WARNING -----...
TailTypeInjector inj = new TailTypeInjector(); List<TailType> tailTypeFromArgs = inj.getTailTypeFromArgs("NoopTailType"); assertTrue(tailTypeFromArgs.get(0) instanceof NoopTailType); } }
[FOCAL] public List<TailType> TailTypeInjector.getTailTypeFromArgs(String... types) [CLASS] class TailTypeInjector [METRICS] loc=23 cc=4 branches=1 loops=1 returns=1 throws=1 nesting=3 [CALLS-EXTERNAL] "".equals/1, System.out.println/1, List<TailType>.add/1, Class.forName/1, Class<?>.newInstance/0, ClassNotFoundExcepti...
/* static context [FOCAL] public List<TailType> TailTypeInjector.getTailTypeFromArgs(String... types) [THROWS-WHEN] RuntimeException when foreach(String type : types)=T && !("".equals(type)) && try-body throws [PATH1] foreach(String type : types)=T -> if("".equals(type))=T -> exit loop -> return tailers [PATH2] foreach...
/* static context [FOCAL] public List<TailType> TailTypeInjector.getTailTypeFromArgs(String... types) [THROWS-WHEN] RuntimeException when foreach(String type : types)=T && !("".equals(type)) && try-body throws [PATH1] foreach(String type : types)=T -> if("".equals(type))=T -> exit loop -> return tailers [PATH2] foreach...
true
ok
{"focal": {"class": "TailTypeInjector", "name": "getTailTypeFromArgs", "signature": "List<TailType> getTailTypeFromArgs(String... types)", "start_line": 3, "modifiers": "public", "params": [{"name": "types", "type": "String..."}], "return_type": "List<TailType>"}, "class_info": {"name": "TailTypeInjector", "kind": "cla...
22542759_31
class MetadataEntity implements Iterable<MetadataEntity.KeyValue> { public static Builder builder() { return new Builder(); } private MetadataEntity(LinkedHashMap<String, String> details, String type); public MetadataEntity(MetadataEntity metadataEntity); public static MetadataEntity ofNamespace(Stri...
// empty builder should fail try { MetadataEntity.builder().build(); Assert.fail(); } catch (IllegalArgumentException e) { // expected } // test that builder builds metadata entity correctly MetadataEntity metadataEntity = MetadataEntity.builder().append(MetadataEntity.NAMESPAC...
[FOCAL] public static Builder MetadataEntity.builder() [CLASS] class MetadataEntity implements Iterable<MetadataEntity.KeyValue> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] Builder [CLASS-MEMBERS] MetadataEntity(LinkedHashMap<String, String> details, String type); MetadataEntity(MetadataE...
/* static context [FOCAL] public static Builder MetadataEntity.builder() [NEW] Builder */
/* static context [FOCAL] public static Builder MetadataEntity.builder() [NEW] Builder */ class MetadataEntity implements Iterable<MetadataEntity.KeyValue> { public static Builder builder() { return new Builder(); } private MetadataEntity(LinkedHashMap<String, String> details, String type); public Metad...
true
ok
{"focal": {"class": "MetadataEntity", "name": "builder", "signature": "Builder builder()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Builder"}, "class_info": {"name": "MetadataEntity", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Iterable<MetadataEntity.KeyValu...
22614011_1
class RosettaMapperFactory implements ResultSetMapperFactory { @Override public boolean accepts(@SuppressWarnings("rawtypes") Class type, StatementContext ctx) { return !(type.isPrimitive() || type.isArray() || type.isAnnotation() || BuiltInArgumentFactory.canAccept(type)); } @Override @SuppressWarnings({...
assertThat(mapperFactory.accepts(Integer.TYPE, null)).isFalse(); } }
[FOCAL] @Override public boolean RosettaMapperFactory.accepts(Class type, StatementContext ctx) [CLASS] class RosettaMapperFactory implements ResultSetMapperFactory [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Class.isPrimitive/0, Class.isArray/0, Class.isAnnotation/0, BuiltInAr...
/* static context [FOCAL] @Override public boolean RosettaMapperFactory.accepts(Class type, StatementContext ctx) [INPUTS] branches=- | result=type | unused=ctx [COLLABORATORS] param type:Class isPrimitive/0,isArray/0,isAnnotation/0 [CALLS-EXTERNAL] Class.isPrimitive/0, Class.isArray/0, Class.isAnnotation/0, BuiltInArg...
/* static context [FOCAL] @Override public boolean RosettaMapperFactory.accepts(Class type, StatementContext ctx) [INPUTS] branches=- | result=type | unused=ctx [COLLABORATORS] param type:Class isPrimitive/0,isArray/0,isAnnotation/0 [CALLS-EXTERNAL] Class.isPrimitive/0, Class.isArray/0, Class.isAnnotation/0, BuiltInArg...
true
ok
{"focal": {"class": "RosettaMapperFactory", "name": "accepts", "signature": "boolean accepts(Class type, StatementContext ctx)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "type", "type": "Class"}, {"name": "ctx", "type": "StatementContext"}], "return_type": "boolean"}, "class_info": {"name":...
22661024_1
class MongoStore extends StoreBase { @Override public String[] keys() throws IOException { /* create the empty array list */ List<String> keys = new ArrayList<String>(); /* build the query */ BasicDBObject sessionKeyQuery = new BasicDBObject(); sessionKeyQuery.put(appContextProperty, this.getName()); ...
/* get the keys. this should always return a list, even if it's empty */ String[] keys = this.mongoStore.keys(); assertNotNull(keys); } }
[FOCAL] @Override public String[] MongoStore.keys() [CLASS] class MongoStore extends StoreBase [METRICS] loc=19 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] String getName() [CALLS-EXTERNAL] BasicDBObject.put/2, this.collection.find/2, DBCursor.hasNext/0, mongoSessionKeys.next().get("_id").toSt...
/* static context [FOCAL] @Override public String[] MongoStore.keys() [PATH1] while(mongoSessionKeys.hasNext())=T -> exit loop -> return keys.toArray(new String[keys.size()]) [PATH2] while(mongoSessionKeys.hasNext())=F -> return keys.toArray(new String[keys.size()]) [COLLABORATORS] field collection find/2 [EXCEPTIONS] ...
/* static context [FOCAL] @Override public String[] MongoStore.keys() [PATH1] while(mongoSessionKeys.hasNext())=T -> exit loop -> return keys.toArray(new String[keys.size()]) [PATH2] while(mongoSessionKeys.hasNext())=F -> return keys.toArray(new String[keys.size()]) [COLLABORATORS] field collection find/2 [EXCEPTIONS] ...
true
ok
{"focal": {"class": "MongoStore", "name": "keys", "signature": "String[] keys() throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String[]"}, "class_info": {"name": "MongoStore", "kind": "class", "modifiers": "", "superclass": "StoreBase", "interfaces": null, "fields":...
22686950_5
class Filtering { public static String filter(String input, Map<String, String> variables) { if (variables.isEmpty()) { return input; } if (input == null || input.isEmpty()) { return input; } String current = input; String last = input; while (current.contains("${") && curre...
String out = Filtering.filter("hello ${world} ${period}", new FluentMap<>() .add("name", "vert.x") .add("world", "${name}")); assertThat(out).isEqualTo("hello vert.x ${period}"); } }
[FOCAL] public static String Filtering.filter(String input, Map<String, String> variables) [CLASS] class Filtering [METRICS] loc=28 cc=6 branches=3 loops=2 returns=4 throws=0 nesting=2 [CALLS-EXTERNAL] Map<String, String>.isEmpty/0, String.isEmpty/0, String.contains/1, Map<String, String>.entrySet/0, String.replace/2, ...
/* static context [FOCAL] public static String Filtering.filter(String input, Map<String, String> variables) [PATH1] if(variables.isEmpty())=F -> if(input == null || input.isEmpty())=F -> while(current.contains("${") && current.contains("}"))=T -> foreach(Map.Entry<String, String> entry : variables.entrySet())=T -> exi...
/* static context [FOCAL] public static String Filtering.filter(String input, Map<String, String> variables) [PATH1] if(variables.isEmpty())=F -> if(input == null || input.isEmpty())=F -> while(current.contains("${") && current.contains("}"))=T -> foreach(Map.Entry<String, String> entry : variables.entrySet())=T -> exi...
true
ok
{"focal": {"class": "Filtering", "name": "filter", "signature": "String filter(String input, Map<String, String> variables)", "start_line": 3, "modifiers": "public static", "params": [{"name": "input", "type": "String"}, {"name": "variables", "type": "Map<String, String>"}], "return_type": "String"}, "class_info": {"na...
22693515_14
class OWLAxiomRenamer implements OWLAxiomVisitor { public OWLAxiom rename(OWLAxiom axiom){ Map<OWLEntity, OWLEntity> renaming = new HashMap<>(); expressionRenamer = new OWLClassExpressionRenamer(df, renaming); boolean multipleClasses = axiom.getClassesInSignature().size() > 1; expressionRenamer.setMultipleCla...
StringRenderer.setRenderer(rendering); OWLAxiom ax1 = df.getOWLSubClassOfAxiom(clsA, clsB); OWLAxiom ax2 = df.getOWLSubClassOfAxiom(clsB, clsC); System.out.print(ax1 + "->");ax1 = renamer.rename(ax1);System.out.println(ax1); System.out.print(ax2 + "->");ax2 = renamer.rename(ax2);System.out.println(ax1); ...
[FOCAL] public OWLAxiom OWLAxiomRenamer.rename(OWLAxiom axiom) [CLASS] class OWLAxiomRenamer implements OWLAxiomVisitor [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] axiom.getClassesInSignature().size/0, OWLAxiom.getClassesInSignature/0, expressionRenamer.setMultipleClasses/1, OW...
/* static context [FOCAL] public OWLAxiom OWLAxiomRenamer.rename(OWLAxiom axiom) [COLLABORATORS] param axiom:OWLAxiom getClassesInSignature/0,accept/1; field expressionRenamer setMultipleClasses/1 [FIELDS] read=df:OWLDataFactory [NEW] HashMap<>, OWLClassExpressionRenamer [CALLS-EXTERNAL] axiom.getClassesInSignature().s...
/* static context [FOCAL] public OWLAxiom OWLAxiomRenamer.rename(OWLAxiom axiom) [COLLABORATORS] param axiom:OWLAxiom getClassesInSignature/0,accept/1; field expressionRenamer setMultipleClasses/1 [FIELDS] read=df:OWLDataFactory [NEW] HashMap<>, OWLClassExpressionRenamer [CALLS-EXTERNAL] axiom.getClassesInSignature().s...
true
ok
{"focal": {"class": "OWLAxiomRenamer", "name": "rename", "signature": "OWLAxiom rename(OWLAxiom axiom)", "start_line": 3, "modifiers": "public", "params": [{"name": "axiom", "type": "OWLAxiom"}], "return_type": "OWLAxiom"}, "class_info": {"name": "OWLAxiomRenamer", "kind": "class", "modifiers": "", "superclass": null, ...
22725357_0
class HtmlUnitHtmlFetcher implements HtmlFetcher { @Override public String fetch(String url) { try{ LOGGER.debug("url:"+url); HtmlPage htmlPage = WEB_CLIENT.getPage(url); String html = htmlPage.getBody().asXml(); LOGGER.debug("html:"+html); re...
HtmlFetcher htmlFetcher = new HtmlUnitHtmlFetcher(); String html = htmlFetcher.fetch("http://apdplat.org"); assertEquals(true, html.contains("APDPlat的主要特性如下")); assertEquals(true, html.contains("1、jsearch:高性能的全文检索工具包")); assertEquals(true, html.contains("2、Java分布式中文分词组件 - word...
[FOCAL] @Override public String HtmlUnitHtmlFetcher.fetch(String url) [CLASS] class HtmlUnitHtmlFetcher implements HtmlFetcher [METRICS] loc=13 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] LOGGER.debug/1, WEB_CLIENT.getPage/1, htmlPage.getBody().asXml/0, HtmlPage.getBody/0, LOGGER.error/2 [EXCE...
/* static context [FOCAL] @Override public String HtmlUnitHtmlFetcher.fetch(String url) [PATH1] try-body throws -> return "" [PATH2] return html [INPUTS] branches=- | result=url [EXCEPTIONS] catches Exception e [CALLS-EXTERNAL] LOGGER.debug/1, WEB_CLIENT.getPage/1, htmlPage.getBody().asXml/0, HtmlPage.getBody/0, LOGGER...
/* static context [FOCAL] @Override public String HtmlUnitHtmlFetcher.fetch(String url) [PATH1] try-body throws -> return "" [PATH2] return html [INPUTS] branches=- | result=url [EXCEPTIONS] catches Exception e [CALLS-EXTERNAL] LOGGER.debug/1, WEB_CLIENT.getPage/1, htmlPage.getBody().asXml/0, HtmlPage.getBody/0, LOGGER...
true
ok
{"focal": {"class": "HtmlUnitHtmlFetcher", "name": "fetch", "signature": "String fetch(String url)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "url", "type": "String"}], "return_type": "String"}, "class_info": {"name": "HtmlUnitHtmlFetcher", "kind": "class", "modifiers": "", "superclass": nu...
22734513_237
class RequireJsBundleListener implements BundleListener { public void init() { this.serviceRegistrationMap = new ConcurrentHashMap<>(); this.requireConfigMap = new ConcurrentHashMap<>(); this.bundleContext.addBundleListener( this ); for ( Bundle bundle : this.bundleContext.getBundles() ) { th...
Bundle mockBundleNoClientSide = this.createMockBundle( "non-client-side-bundle", "0.1", Bundle.ACTIVE ); Bundle mockBundleWithPackageJson = this.createMockPackageJsonBundle( "lib1", "1.0", Bundle.ACTIVE ); Bundle mockBundleWithRequireJson = this.createMockRequireJsonBundle( "lib2", "2.0", Bundle.ACTIVE ); ...
[FOCAL] public void RequireJsBundleListener.init() [CLASS] class RequireJsBundleListener implements BundleListener [METRICS] loc=10 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] boolean addBundle(Bundle bundle) [CALLS-EXTERNAL] this.bundleContext.addBundleListener/1, this.bundleContext.getBundle...
/* static context [FOCAL] public void RequireJsBundleListener.init() [PATH1] foreach(Bundle bundle : this.bundleContext.getBundles())=T -> exit loop [PATH2] foreach(Bundle bundle : this.bundleContext.getBundles())=F [COLLABORATORS] field bundleContext addBundleListener/1,getBundles/0 [STATE] requireConfigMap, serviceRe...
/* static context [FOCAL] public void RequireJsBundleListener.init() [PATH1] foreach(Bundle bundle : this.bundleContext.getBundles())=T -> exit loop [PATH2] foreach(Bundle bundle : this.bundleContext.getBundles())=F [COLLABORATORS] field bundleContext addBundleListener/1,getBundles/0 [STATE] requireConfigMap, serviceRe...
true
ok
{"focal": {"class": "RequireJsBundleListener", "name": "init", "signature": "void init()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "RequireJsBundleListener", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "BundleListener", "fields": [{"na...
22750538_1
class NodeManager { public boolean setNodeProperty(Long id, String key, Object value, GraphDatabaseService graphDb) { boolean success = true; // Update the node's property in cache Map<String, Object> node = globalNodeCache.getIfPresent(id); if(node == null) { ...
GraphDatabaseService db = setUpDb(); NodeManager nodeManager = new NodeManager(); NodeManager.globalNodeCache.invalidateAll(); DataNodeManager.dataCache.invalidateAll(); DataNodeManager dataNodeManager = new DataNodeManager(); // Write some nodes to the database ...
[FOCAL] public boolean NodeManager.setNodeProperty(Long id, String key, Object value, GraphDatabaseService graphDb) [CLASS] class NodeManager [METRICS] loc=27 cc=4 branches=3 loops=0 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] boolean addNodeToCache(BiConsumer<GraphDatabaseService, Cache<Long, HashMap<String, Object>...
/* static context [FOCAL] public boolean NodeManager.setNodeProperty(Long id, String key, Object value, GraphDatabaseService graphDb) [PATH1] if(node == null)=T -> if(success)=T -> if(node != null)=T -> return success [PATH2] if(node == null)=F -> if(node != null)=F -> return success [PATH3] if(node == null)=T -> if(su...
/* static context [FOCAL] public boolean NodeManager.setNodeProperty(Long id, String key, Object value, GraphDatabaseService graphDb) [PATH1] if(node == null)=T -> if(success)=T -> if(node != null)=T -> return success [PATH2] if(node == null)=F -> if(node != null)=F -> return success [PATH3] if(node == null)=T -> if(su...
true
ok
{"focal": {"class": "NodeManager", "name": "setNodeProperty", "signature": "boolean setNodeProperty(Long id, String key, Object value, GraphDatabaseService graphDb)", "start_line": 3, "modifiers": "public", "params": [{"name": "id", "type": "Long"}, {"name": "key", "type": "String"}, {"name": "value", "type": "Object"}...
22760763_9
class RoaringInspection { public static RoaringBitmap[] extract(RoaringBitmap bitmap, int[] ukeys) { RoaringArray array = bitmap.highLowContainer; short[] keys = intToShortKeys(ukeys); RoaringBitmap[] extract = new RoaringBitmap[keys.length]; for (int i = 0; i < keys.length; i++) { ...
RoaringBitmap bitmap1 = new RoaringBitmap(); Random r = new Random(123); for (int i = 0; i < 3_000_000; i += 65_536) { if (r.nextBoolean()) { bitmap1.add(i); } } RoaringBitmap bitmap2 = new RoaringBitmap(); bitmap2.flip(0, 3_000_00...
[FOCAL] public static RoaringBitmap[] RoaringInspection.extract(RoaringBitmap bitmap, int[] ukeys) [CLASS] class RoaringInspection [METRICS] loc=13 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] short[] intToShortKeys(int[] ukeys) [CALLS-EXTERNAL] RoaringArray.getContainer/1, extract[i].highLowCo...
/* static context [FOCAL] public static RoaringBitmap[] RoaringInspection.extract(RoaringBitmap bitmap, int[] ukeys) [PATH1] for(i < keys.length)=T -> if(container != null)=T -> exit loop -> return extract [PATH2] for(i < keys.length)=F -> return extract [PATH3] for(i < keys.length)=T -> if(container != null)=F -> exit...
/* static context [FOCAL] public static RoaringBitmap[] RoaringInspection.extract(RoaringBitmap bitmap, int[] ukeys) [PATH1] for(i < keys.length)=T -> if(container != null)=T -> exit loop -> return extract [PATH2] for(i < keys.length)=F -> return extract [PATH3] for(i < keys.length)=T -> if(container != null)=F -> exit...
true
ok
{"focal": {"class": "RoaringInspection", "name": "extract", "signature": "RoaringBitmap[] extract(RoaringBitmap bitmap, int[] ukeys)", "start_line": 3, "modifiers": "public static", "params": [{"name": "bitmap", "type": "RoaringBitmap"}, {"name": "ukeys", "type": "int[]"}], "return_type": "RoaringBitmap[]"}, "class_inf...
22789601_112
class Moshi { @CheckReturnValue public <T> JsonAdapter<T> adapter(Type type) { return adapter(type, Util.NO_ANNOTATIONS); } Moshi(Builder builder); @CheckReturnValue public JsonAdapter<T> adapter(Class<T> type); @CheckReturnValue public JsonAdapter<T> adapter(Type type, Class<? extends Annotation> ...
Moshi moshi = new Moshi.Builder().add(LocalizedBooleanAdapter.FACTORY).build(); Baguette baguette = new Baguette(); baguette.avecBeurre = true; baguette.withButter = true; JsonAdapter<Baguette> adapter = moshi.adapter(Baguette.class); assertThat(adapter.toJson(baguette)) .isEqualTo("{\...
[FOCAL] @CheckReturnValue public JsonAdapter<T> Moshi.adapter(Type type) [CLASS] class Moshi [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] JsonAdapter<T> adapter(Type type, Class<? extends Annotation> annotationType) [INPUTS] branches=- | result=type [DATAFLOW] type@param->L3 [CL...
/* static context [FOCAL] @CheckReturnValue public JsonAdapter<T> Moshi.adapter(Type type) [INPUTS] branches=- | result=type [CALLS-INTERNAL] JsonAdapter<T> adapter(Type type, Class<? extends Annotation> annotationType) */
/* static context [FOCAL] @CheckReturnValue public JsonAdapter<T> Moshi.adapter(Type type) [INPUTS] branches=- | result=type [CALLS-INTERNAL] JsonAdapter<T> adapter(Type type, Class<? extends Annotation> annotationType) */ class Moshi { @CheckReturnValue public <T> JsonAdapter<T> adapter(Type type) { return ad...
true
ok
{"focal": {"class": "Moshi", "name": "adapter", "signature": "JsonAdapter<T> adapter(Type type)", "start_line": 3, "modifiers": "@CheckReturnValue public", "params": [{"name": "type", "type": "Type"}], "return_type": "JsonAdapter<T>"}, "class_info": {"name": "Moshi", "kind": "class", "modifiers": "", "superclass": null...
22790488_229
class VideoResource { public String getDetails(Integer id, String... fields) throws Exception { if (fields.length == 0) { return videos.get(id).toString(); } return fieldJsonMapper.toJson(videos.get(id), fields); } public VideoResource(FieldJsonMapper fieldJsonMapper, Map<Integer, Video> vide...
var fields = new String[]{"id", "title", "length"}; var expectedDetails = "{\"id\": 1,\"title\": \"Avatar\",\"length\": 178}"; Mockito.when(fieldJsonMapper.toJson(Matchers.any(Video.class), Matchers.eq(fields))).thenReturn(expectedDetails); var actualFieldsDetails = resource.getDetails(2, fields); ...
[FOCAL] public String VideoResource.getDetails(Integer id, String... fields) [CLASS] class VideoResource [METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] videos.get(id).toString/0, videos.get/1, FieldJsonMapper.toJson/2 [FIELDS] read=fieldJsonMapper:FieldJsonMapper [EXCEPTIONS] decl...
/* static context [FOCAL] public String VideoResource.getDetails(Integer id, String... fields) [PATH1] if(fields.length == 0)=T -> return videos.get(id).toString() [PATH2] if(fields.length == 0)=F -> return fieldJsonMapper.toJson(videos.get(id), fields) [INPUTS] branches=fields | result=fields, id, fieldJsonMapper [COL...
/* static context [FOCAL] public String VideoResource.getDetails(Integer id, String... fields) [PATH1] if(fields.length == 0)=T -> return videos.get(id).toString() [PATH2] if(fields.length == 0)=F -> return fieldJsonMapper.toJson(videos.get(id), fields) [INPUTS] branches=fields | result=fields, id, fieldJsonMapper [COL...
true
ok
{"focal": {"class": "VideoResource", "name": "getDetails", "signature": "String getDetails(Integer id, String... fields) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "id", "type": "Integer"}, {"name": "fields", "type": "String..."}], "return_type": "String"}, "class_info": {"name": "Vi...
22794824_19
class MapGenerator implements Generator<Map<K, V>> { @Override public Map<K, V> next() { final int size = randomValues.randomInteger(sizeRange.lowerBound(), sizeRange.upperBound()); final HashMap<K, V> map = new HashMap<>(); int misses = 0; while (map.size() < size) { ...
final Generator<Map<Integer, Integer>> generator = RDG.map(generatingRandomIntegers(), generatingRandomIntegers(), -1); assertThat(generator.next()).isEmpty(); } }
[FOCAL] @Override public Map<K, V> MapGenerator.next() [CLASS] class MapGenerator implements Generator<Map<K, V>> [METRICS] loc=21 cc=5 branches=3 loops=1 returns=1 throws=2 nesting=3 [CALLS-EXTERNAL] randomValues.randomInteger/2, sizeRange.lowerBound/0, sizeRange.upperBound/0, HashMap<K, V>.size/0, generatorOfK.next/0...
/* static context [FOCAL] @Override public Map<K, V> MapGenerator.next() [THROWS-WHEN] NullPointerException when map.size() < size && key == null [THROWS-WHEN] IllegalStateException when map.size() < size && !(key == null) && map.size() == sizeBeforePut && ++misses > 2000 [PATH1] while(map.size() < size)=T -> if(key ==...
/* static context [FOCAL] @Override public Map<K, V> MapGenerator.next() [THROWS-WHEN] NullPointerException when map.size() < size && key == null [THROWS-WHEN] IllegalStateException when map.size() < size && !(key == null) && map.size() == sizeBeforePut && ++misses > 2000 [PATH1] while(map.size() < size)=T -> if(key ==...
true
ok
{"focal": {"class": "MapGenerator", "name": "next", "signature": "Map<K, V> next()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Map<K, V>"}, "class_info": {"name": "MapGenerator", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Generator<Map<K, V>>", "fields": [...
22815625_10
class SpecialMath { public static double evaluatePolynomial(double x, double[] coefficients) { double value = 0.0; for (int i = 0; i < coefficients.length; i++) value = value * x + coefficients[i]; return value; } public static double getMachineEpsilon(); public static double calculateCompleteEllipti...
assertEquals(evaluatePolynomial(5, new double[] {3, 0, 1 }), 76.0, 0.00001); assertEquals(evaluatePolynomial(0.13, new double[] {0.7, -6.6, 4.1, 0.3, -3.43, -1}), -1.43368133549, 0.000001); } }
[FOCAL] public static double SpecialMath.evaluatePolynomial(double x, double[] coefficients) [CLASS] class SpecialMath [METRICS] loc=10 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [PATH1] for(i < coefficients.length)=T -> exit loop -> return value [PATH2] for(i < coefficients.length)=F -> return value [INPUTS]...
/* static context [FOCAL] public static double SpecialMath.evaluatePolynomial(double x, double[] coefficients) [PATH1] for(i < coefficients.length)=T -> exit loop -> return value [PATH2] for(i < coefficients.length)=F -> return value [INPUTS] branches=coefficients | result=coefficients, x */
/* static context [FOCAL] public static double SpecialMath.evaluatePolynomial(double x, double[] coefficients) [PATH1] for(i < coefficients.length)=T -> exit loop -> return value [PATH2] for(i < coefficients.length)=F -> return value [INPUTS] branches=coefficients | result=coefficients, x */ class SpecialMath { publi...
true
ok
{"focal": {"class": "SpecialMath", "name": "evaluatePolynomial", "signature": "double evaluatePolynomial(double x, double[] coefficients)", "start_line": 3, "modifiers": "public static", "params": [{"name": "x", "type": "double"}, {"name": "coefficients", "type": "double[]"}], "return_type": "double"}, "class_info": {"...
22824768_4
class CFMLParser { public CFScriptStatement parseScript(String cfscript) throws ParseException, IOException { CommonTokenStream tokens = createTokenStream(cfscript); ScriptBlockContext scriptBlockContext = parseScriptBlockContext(tokens); CFScriptStatement result = scriptVisitor.visit(scriptBlockContext); if ...
String script = "var x = 1; y =; createObject('java','java.lang.String');"; CFScriptStatement scriptStatement = null; try { scriptStatement = fCfmlParser.parseScript(script); } catch (Exception e) { // TODO Auto-generated catch block return; } // assertNotNull(scriptStatement); } }
[FOCAL] public CFScriptStatement CFMLParser.parseScript(String cfscript) [CLASS] class CFMLParser [METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] CommonTokenStream createTokenStream(String cfscript); ScriptBlockContext parseScriptBlockContext(String cfscript) [CALLS-EXTERNAL] scrip...
/* static context [FOCAL] public CFScriptStatement CFMLParser.parseScript(String cfscript) [PATH1] if(result != null)=T -> return result [PATH2] if(result != null)=F -> return result [INPUTS] branches=cfscript | result=cfscript [COLLABORATORS] field scriptVisitor visit/1 [EXCEPTIONS] declares ParseException, IOExceptio...
/* static context [FOCAL] public CFScriptStatement CFMLParser.parseScript(String cfscript) [PATH1] if(result != null)=T -> return result [PATH2] if(result != null)=F -> return result [INPUTS] branches=cfscript | result=cfscript [COLLABORATORS] field scriptVisitor visit/1 [EXCEPTIONS] declares ParseException, IOExceptio...
true
ok
{"focal": {"class": "CFMLParser", "name": "parseScript", "signature": "CFScriptStatement parseScript(String cfscript) throws ParseException, IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "cfscript", "type": "String"}], "return_type": "CFScriptStatement"}, "class_info": {"name": "CFMLParser",...
22829409_13
class TinyORM implements Closeable { public <T extends Row<?>> Paginated<T> searchBySQLWithPager(@NonNull final Class<T> klass, final String sql, final List<Object> params, final long entriesPerPage) { return searchBySQLWithPager(klass, sql, params, entriesPerPage, getReadConnection()); } public TinyORM(Conn...
IntStream.rangeClosed(1, 10).forEach(i -> { try { this.orm.insert(Member.class).value("name", "m" + i) .executeSelect(); } catch (Exception e) { throw new RuntimeException(e); } }); { Paginated<Member> paginated = this.orm.searchBySQLWithPager( Member.class, "SELECT * FROM `member` O...
[FOCAL] public Paginated<T> TinyORM.searchBySQLWithPager(Class<T> klass, String sql, List<Object> params, long entriesPerPage) [CLASS] class TinyORM implements Closeable [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Connection getReadConnection(); Paginated<T> searchBySQLWithPage...
class TinyORM implements Closeable { public <T extends Row<?>> Paginated<T> searchBySQLWithPager(@NonNull final Class<T> klass, final String sql, final List<Object> params, final long entriesPerPage) { return searchBySQLWithPager(klass, sql, params, entriesPerPage, getReadConnection()); } public TinyORM(Conn...
false
ok
{"focal": {"class": "TinyORM", "name": "searchBySQLWithPager", "signature": "Paginated<T> searchBySQLWithPager(Class<T> klass, String sql, List<Object> params, long entriesPerPage)", "start_line": 3, "modifiers": "public", "params": [{"name": "klass", "type": "Class<T>"}, {"name": "sql", "type": "String"}, {"name": "pa...
22835310_14
class LevelTranslator { public Level fromString(String[] string) { Tile[][] field; Level level = new Level(); int indexOfProperties = 0; for (; string[indexOfProperties].charAt(0) != '#'; indexOfProperties++) { switch (indexOfProperties) { case 0: ...
Level resultingLevel = sut.fromString(levelAsString); assertThat(resultingLevel, is(level)); } }
[FOCAL] public Level LevelTranslator.fromString(String[] string) [CLASS] class LevelTranslator [METRICS] loc=35 cc=6 branches=1 loops=2 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] Tile[][] getTiles(String[] stringsForField, Level level) [CALLS-EXTERNAL] string[indexOfProperties].charAt/1, Level.setId/1, Integer.parse...
/* static context [FOCAL] public Level LevelTranslator.fromString(String[] string) [PATH1] for(string[indexOfProperties].charAt(0) != '#')=T -> switch(indexOfProperties)=case 0 -> exit loop -> for(i < string.length)=F -> return level [PATH2] for(string[indexOfProperties].charAt(0) != '#')=F -> for(i < string.length)=T ...
/* static context [FOCAL] public Level LevelTranslator.fromString(String[] string) [PATH1] for(string[indexOfProperties].charAt(0) != '#')=T -> switch(indexOfProperties)=case 0 -> exit loop -> for(i < string.length)=F -> return level [PATH2] for(string[indexOfProperties].charAt(0) != '#')=F -> for(i < string.length)=T ...
true
ok
{"focal": {"class": "LevelTranslator", "name": "fromString", "signature": "Level fromString(String[] string)", "start_line": 3, "modifiers": "public", "params": [{"name": "string", "type": "String[]"}], "return_type": "Level"}, "class_info": {"name": "LevelTranslator", "kind": "class", "modifiers": "", "superclass": nu...
22880877_4
class AeSimpleSHA1 { @Nullable public static String SHA1(String text) { try { final MessageDigest md = MessageDigest.getInstance("SHA-1"); //noinspection CharsetObjectCanBeUsed - NOTE fix not applicable on API16 md.update(text.getBytes("iso-8859-1"), 0, text.length()...
final String sha1ForProbe = AeSimpleSHA1.SHA1("probe"); assertThat(sha1ForProbe).isEqualTo("a949c530710f9fca76b45776267c68967fa891e7"); } }
[FOCAL] @Nullable public static String AeSimpleSHA1.SHA1(String text) [CLASS] class AeSimpleSHA1 [METRICS] loc=13 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] String convertToHex(byte[] data) [CALLS-EXTERNAL] MessageDigest.getInstance/1, MessageDigest.update/3, String.getBytes/1, String.length/...
/* static context [FOCAL] @Nullable public static String AeSimpleSHA1.SHA1(String text) [PATH1] try-body throws -> return null [PATH2] return convertToHex(sha1hash) [EXCEPTIONS] catches NoSuchAlgorithmException | UnsupportedEncodingException e [CALLS-INTERNAL] String convertToHex(byte[] data) [CALLS-EXTERNAL] MessageDi...
/* static context [FOCAL] @Nullable public static String AeSimpleSHA1.SHA1(String text) [PATH1] try-body throws -> return null [PATH2] return convertToHex(sha1hash) [EXCEPTIONS] catches NoSuchAlgorithmException | UnsupportedEncodingException e [CALLS-INTERNAL] String convertToHex(byte[] data) [CALLS-EXTERNAL] MessageDi...
true
ok
{"focal": {"class": "AeSimpleSHA1", "name": "SHA1", "signature": "String SHA1(String text)", "start_line": 3, "modifiers": "@Nullable public static", "params": [{"name": "text", "type": "String"}], "return_type": "String"}, "class_info": {"name": "AeSimpleSHA1", "kind": "class", "modifiers": "", "superclass": null, "in...
22882266_64
class BundleContextServiceListener implements ServiceListener { @Override public void serviceChanged( ServiceEvent serviceEvent ) { if ( referenceToInstanceMap.containsKey( serviceEvent.getServiceReference() ) ) { Object instance = referenceToInstanceMap.get( serviceEvent.getServiceReference() ); L...
Object instance = mock( Object.class ); referenceToInstanceMap.put( serviceReference, instance ); DelayedInstanceNotifier delayedInstanceNotifier = mock( DelayedInstanceNotifier.class ); when( delayedInstanceNotifierFactory.create( instance, LifecycleEvent.STOP ) ) .thenReturn( delayedInstanceNoti...
[FOCAL] @Override public void BundleContextServiceListener.serviceChanged(ServiceEvent serviceEvent) [CLASS] class BundleContextServiceListener implements ServiceListener [METRICS] loc=17 cc=4 branches=2 loops=0 returns=0 throws=0 nesting=2 [CALLS-EXTERNAL] Map<ServiceReference, Object>.containsKey/1, ServiceEvent.getS...
/* static context [FOCAL] @Override public void BundleContextServiceListener.serviceChanged(ServiceEvent serviceEvent) [PATH1] if(referenceToInstanceMap.containsKey( serviceEvent.getServiceReference() ))=T -> switch(serviceEvent.getType())=case ServiceEvent.MODIFIED [PATH2] if(referenceToInstanceMap.containsKey( servic...
/* static context [FOCAL] @Override public void BundleContextServiceListener.serviceChanged(ServiceEvent serviceEvent) [PATH1] if(referenceToInstanceMap.containsKey( serviceEvent.getServiceReference() ))=T -> switch(serviceEvent.getType())=case ServiceEvent.MODIFIED [PATH2] if(referenceToInstanceMap.containsKey( servic...
true
ok
{"focal": {"class": "BundleContextServiceListener", "name": "serviceChanged", "signature": "void serviceChanged(ServiceEvent serviceEvent)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "serviceEvent", "type": "ServiceEvent"}], "return_type": "void"}, "class_info": {"name": "BundleContextServic...
22910855_18
class Timeslot { @Override public String toString() { String endToConcatenate = end != null ? " - " + end : ""; return start + endToConcatenate; } @JsonCreator public Timeslot(@JsonProperty("start") String start, @JsonProperty("end") String end); public Timeslot(String start); ...
Timeslot timeslot = new Timeslot("15:30"); String formatedTimeslot = timeslot.toString(); assertEquals("15:30", formatedTimeslot); } }
[FOCAL] @Override public String Timeslot.toString() [CLASS] class Timeslot [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [DATAFLOW] endToConcatenate@L3->L4 [CLASS-MEMBERS] Timeslot(String start, String end); Timeslot(String start); String getStart(); String getEnd() [TEST] TimeslotTest: @Test pub...
/* static context [FOCAL] @Override public String Timeslot.toString() */
/* static context [FOCAL] @Override public String Timeslot.toString() */ class Timeslot { @Override public String toString() { String endToConcatenate = end != null ? " - " + end : ""; return start + endToConcatenate; } @JsonCreator public Timeslot(@JsonProperty("start") String start,...
true
ok
{"focal": {"class": "Timeslot", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "Timeslot", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": ...