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
22917907_1
class RangeEnforcer { public String enrichQueryString(String queryString) { int maxRange = getMaxRange(); return enforceRange(enforceRange(queryString , maxRange, fromRangePattern, "from", false), maxRange, toRangePattern, "to"); } private String enforceRange(String queryString, int maxRange, Pattern...
String queryString = "?from=50&to=150"; String result = enforcer.enrichQueryString(queryString); assertThat(result).isEqualTo("?from=50&to=100"); } }
[FOCAL] public String RangeEnforcer.enrichQueryString(String queryString) [CLASS] class RangeEnforcer [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String enforceRange(String queryString, int maxRange, Pattern rangePattern, String verb); String enforceRange(String queryString, in...
/* static context [FOCAL] public String RangeEnforcer.enrichQueryString(String queryString) [INPUTS] branches=- | result=queryString [CALLS-INTERNAL] String enforceRange(String queryString, int maxRange, Pattern rangePattern, String verb); String enforceRange(String queryString, int maxRange, Pattern rangePattern, Stri...
/* static context [FOCAL] public String RangeEnforcer.enrichQueryString(String queryString) [INPUTS] branches=- | result=queryString [CALLS-INTERNAL] String enforceRange(String queryString, int maxRange, Pattern rangePattern, String verb); String enforceRange(String queryString, int maxRange, Pattern rangePattern, Stri...
true
ok
{"focal": {"class": "RangeEnforcer", "name": "enrichQueryString", "signature": "String enrichQueryString(String queryString)", "start_line": 3, "modifiers": "public", "params": [{"name": "queryString", "type": "String"}], "return_type": "String"}, "class_info": {"name": "RangeEnforcer", "kind": "class", "modifiers": ""...
22944710_75
class DirtyCollection implements Collection<E> { @Override public boolean remove(final Object o) { if (delegate.remove(o)) { listener.onElementsRemoved(); return true; } return false; } public DirtyCollection(final Collection<E> delegate, final DirtyLis...
collection.remove("one"); verify(listener).onElementsRemoved(); assertThat(collection).containsOnly("two", "three"); } }
[FOCAL] @Override public boolean DirtyCollection.remove(Object o) [CLASS] class DirtyCollection implements Collection<E> [METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] Collection<String>.remove/1, DirtyListener.onElementsRemoved/0 [FIELDS] read=delegate:Collection<String>, listene...
/* static context [FOCAL] @Override public boolean DirtyCollection.remove(Object o) [PATH1] if(delegate.remove(o))=T -> return true [PATH2] if(delegate.remove(o))=F -> return false [INPUTS] branches=o, delegate | result=- [COLLABORATORS] field delegate:Collection<String> remove/1; field listener:DirtyListener onElement...
/* static context [FOCAL] @Override public boolean DirtyCollection.remove(Object o) [PATH1] if(delegate.remove(o))=T -> return true [PATH2] if(delegate.remove(o))=F -> return false [INPUTS] branches=o, delegate | result=- [COLLABORATORS] field delegate:Collection<String> remove/1; field listener:DirtyListener onElement...
true
ok
{"focal": {"class": "DirtyCollection", "name": "remove", "signature": "boolean remove(Object o)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "o", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "DirtyCollection", "kind": "class", "modifiers": "", "superclass": null, "int...
22944796_124
class DeleteResponseProtocolOp extends ProtocolOp { @Override public byte getType() { return OP_TYPE_DELETE_RESPONSE; } public DeleteResponseProtocolOp(int resultCode); public DeleteResponseProtocolOp(int resultCode, LocalizableMessage errorMessage); public DeleteResponseProtocolOp(int resultCode...
DeleteResponseProtocolOp deleteResponse = new DeleteResponseProtocolOp( resultCode); assertEquals(deleteResponse.getType(), OP_TYPE_DELETE_RESPONSE); } }
[FOCAL] @Override public byte DeleteResponseProtocolOp.getType() [CLASS] class DeleteResponseProtocolOp extends ProtocolOp [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [FIELDS] read=OP_TYPE_DELETE_RESPONSE:byte [INPUTS] branches=- | result=OP_TYPE_DELETE_RESPONSE [DATAFLOW] this.OP_TYPE_DELETE_R...
/* static context [FOCAL] @Override public byte DeleteResponseProtocolOp.getType() [INPUTS] branches=- | result=OP_TYPE_DELETE_RESPONSE [FIELDS] read=OP_TYPE_DELETE_RESPONSE:byte */
/* static context [FOCAL] @Override public byte DeleteResponseProtocolOp.getType() [INPUTS] branches=- | result=OP_TYPE_DELETE_RESPONSE [FIELDS] read=OP_TYPE_DELETE_RESPONSE:byte */ class DeleteResponseProtocolOp extends ProtocolOp { @Override public byte getType() { return OP_TYPE_DELETE_RESPONSE; } pu...
true
ok
{"focal": {"class": "DeleteResponseProtocolOp", "name": "getType", "signature": "byte getType()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "byte"}, "class_info": {"name": "DeleteResponseProtocolOp", "kind": "class", "modifiers": "", "superclass": "ProtocolOp", "interfaces": null, "...
22944804_331
class PacketFactory { public static Packet toPacket(byte[] octets) { // for old byte array approach we may have a array longer than packet so trim ByteBuffer down to just // packet length to prevent attribute parsing below from running off the end of the packet and onto unrelated // octets....
final String hex = "01 00 00 38 0f 40 3f 94 73 97 80 57 bd 83 d5 cb" + "98 f4 22 7a 01 06 6e 65 6d 6f 02 12 0d be 70 8d" + "93 d4 13 ce 31 96 e4 3f 78 2a 0a ee 04 06 c0 a8" + "01 10 05 06 00 00 00 03"; final ByteBuffer bfr = Utils.toBuffer(hex); dumpBfr(bfr); ...
[FOCAL] public static Packet PacketFactory.toPacket(byte[] octets) [CLASS] class PacketFactory [METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Packet toPacket(ByteBuffer data) [CALLS-EXTERNAL] ByteBuffer.wrap/3 [INPUTS] branches=- | result=octets [DATAFLOW] octets@param->L5,L6,L8; ...
/* static context [FOCAL] public static Packet PacketFactory.toPacket(byte[] octets) [INPUTS] branches=- | result=octets [CALLS-INTERNAL] Packet toPacket(ByteBuffer data) [CALLS-EXTERNAL] ByteBuffer.wrap/3 */
/* static context [FOCAL] public static Packet PacketFactory.toPacket(byte[] octets) [INPUTS] branches=- | result=octets [CALLS-INTERNAL] Packet toPacket(ByteBuffer data) [CALLS-EXTERNAL] ByteBuffer.wrap/3 */ class PacketFactory { public static Packet toPacket(byte[] octets) { // for old byte array approac...
true
ok
{"focal": {"class": "PacketFactory", "name": "toPacket", "signature": "Packet toPacket(byte[] octets)", "start_line": 3, "modifiers": "public static", "params": [{"name": "octets", "type": "byte[]"}], "return_type": "Packet"}, "class_info": {"name": "PacketFactory", "kind": "class", "modifiers": "", "superclass": null,...
22948530_116
class SearchResource extends ResourceBase { @GET @Path("{type: "+ ALL_TYPES_PATTERN + "}/_search") @Produces(MediaType.APPLICATION_JSON) public final Response search(@PathParam("type") String type, @QueryParam("q") String query) { if (isBlank(query)) { return Response.status(Respons...
assertEquals(SC_BAD_REQUEST, searchResource.search("person", "").getStatus()); assertEquals(SC_BAD_REQUEST, searchResource.search("work", "").getStatus()); } }
[FOCAL] @GET @Path("{type: "+ ALL_TYPES_PATTERN + "}/_search") @Produces(MediaType.APPLICATION_JSON) public final Response SearchResource.search(String type, String query) [CLASS] class SearchResource extends ResourceBase [METRICS] loc=36 cc=14 branches=2 loops=0 returns=13 throws=1 nesting=1 [CALLS-EXTERNAL] isBlank/1...
/* static context [FOCAL] @GET @Path("{type: "+ ALL_TYPES_PATTERN + "}/_search") @Produces(MediaType.APPLICATION_JSON) public final Response SearchResource.search(String type, String query) [THROWS-WHEN] RuntimeException when !isBlank(query) && switch(type)=default [PATH1] if(isBlank(query))=F -> switch(type)=case "wor...
/* static context [FOCAL] @GET @Path("{type: "+ ALL_TYPES_PATTERN + "}/_search") @Produces(MediaType.APPLICATION_JSON) public final Response SearchResource.search(String type, String query) [THROWS-WHEN] RuntimeException when !isBlank(query) && switch(type)=default [PATH1] if(isBlank(query))=F -> switch(type)=case "wor...
true
ok
{"focal": {"class": "SearchResource", "name": "search", "signature": "Response search(String type, String query)", "start_line": 3, "modifiers": "@GET @Path(\"{type: \"+ ALL_TYPES_PATTERN + \"}/_search\") @Produces(MediaType.APPLICATION_JSON) public final", "params": [{"name": "type", "type": "String"}, {"name": "query...
22964867_319
class UpdateAction extends DatabaseAction<T> { @Override public void apply(final DatabaseTemplate databaseTemplate) throws Throwable { final T item = item(); item.setVersion(item.getVersion() - 1); try { databaseTemplate.update(item); } catch (final PersistenceExcept...
// Given final StubItem item = new StubItem(); final Long itemVersion = randomLong(); final List<PersistenceExceptionHandler<?>> persistenceExceptionHandlers = Collections.EMPTY_LIST; final UpdateAction<StubItem> updateAction = new UpdateAction<>(item, persistenceExceptionHandler...
[FOCAL] @Override public void UpdateAction.apply(DatabaseTemplate databaseTemplate) [CLASS] class UpdateAction extends DatabaseAction<T> [METRICS] loc=10 cc=2 branches=0 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] item/0 (inherited), T.setVersion/1, T.getVersion/0, DatabaseTemplate.update/1, handlePersistence...
/* static context [FOCAL] @Override public void UpdateAction.apply(DatabaseTemplate databaseTemplate) [PATH1] try-body throws [COLLABORATORS] param databaseTemplate:DatabaseTemplate update/1 [EXCEPTIONS] declares Throwable; catches final PersistenceException e [CALLS-EXTERNAL] item/0 (inherited), T.setVersion/1, T.getV...
/* static context [FOCAL] @Override public void UpdateAction.apply(DatabaseTemplate databaseTemplate) [PATH1] try-body throws [COLLABORATORS] param databaseTemplate:DatabaseTemplate update/1 [EXCEPTIONS] declares Throwable; catches final PersistenceException e [CALLS-EXTERNAL] item/0 (inherited), T.setVersion/1, T.getV...
true
ok
{"focal": {"class": "UpdateAction", "name": "apply", "signature": "void apply(DatabaseTemplate databaseTemplate) throws Throwable", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "databaseTemplate", "type": "DatabaseTemplate"}], "return_type": "void"}, "class_info": {"name": "UpdateAction", "kind...
22970701_2
class Extractor { public RawParameters extract(final HttpServletRequest request) { final Map<String, String> contextMap = extractAllVars(request, contextList, PREFIX_VARIABLE_STRING_FUNCTION, true); final Map<TestType, String> identifierMap = extractAllVars(request, identifierList, IDENTIFIER_TEST_...
final Extractor extractor = getBasicExtractor(); final String fr = "fr"; final String userId = "123456"; final MockHttpServletRequest request = new MockHttpServletRequest(); request.addHeader(LANGUAGE_HEADER_NAME, fr); request.setParameter(USER_IDENTIFIER_QUERY_PARAM, us...
[FOCAL] public RawParameters Extractor.extract(HttpServletRequest request) [CLASS] class Extractor [METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] List<String> extractTest(HttpServletRequest request); Map<KeyType, String> extractAllVars(HttpServletRequest request, List<VariableTyp...
/* static context [FOCAL] public RawParameters Extractor.extract(HttpServletRequest request) [INPUTS] branches=- | result=request [CALLS-INTERNAL] List<String> extractTest(HttpServletRequest request); Map<KeyType, String> extractAllVars(HttpServletRequest request, List<VariableType> varList, Function<? super VariableTy...
/* static context [FOCAL] public RawParameters Extractor.extract(HttpServletRequest request) [INPUTS] branches=- | result=request [CALLS-INTERNAL] List<String> extractTest(HttpServletRequest request); Map<KeyType, String> extractAllVars(HttpServletRequest request, List<VariableType> varList, Function<? super VariableTy...
true
ok
{"focal": {"class": "Extractor", "name": "extract", "signature": "RawParameters extract(HttpServletRequest request)", "start_line": 3, "modifiers": "public", "params": [{"name": "request", "type": "HttpServletRequest"}], "return_type": "RawParameters"}, "class_info": {"name": "Extractor", "kind": "class", "modifiers": ...
22974847_14
class EnumProvider implements Provider<T> { @Override public List<String> getSuggestions(String prefix) { List<String> suggestions = Lists.newArrayList(); String test = simplify(prefix); for (T entry : enumClass.getEnumConstants()) { String name = simplify(entry.name()); ...
assertThat(provider.getSuggestions(""), containsInAnyOrder("small", "medium", "large", "very_large")); assertThat(provider.getSuggestions("s"), containsInAnyOrder("small")); assertThat(provider.getSuggestions("la"), containsInAnyOrder("large")); assertThat(provider.getSuggestions("very")...
[FOCAL] @Override public List<String> EnumProvider.getSuggestions(String prefix) [CLASS] class EnumProvider implements Provider<T> [METRICS] loc=14 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] String simplify(String t) [CALLS-EXTERNAL] Lists.newArrayList/0, enumClass.getEnumConstants/0, T.name/...
/* static context [FOCAL] @Override public List<String> EnumProvider.getSuggestions(String prefix) [PATH1] foreach(T entry : enumClass.getEnumConstants())=T -> if(name.startsWith(test))=T -> exit loop -> return suggestions [PATH2] foreach(T entry : enumClass.getEnumConstants())=F -> return suggestions [PATH3] foreach(T...
/* static context [FOCAL] @Override public List<String> EnumProvider.getSuggestions(String prefix) [PATH1] foreach(T entry : enumClass.getEnumConstants())=T -> if(name.startsWith(test))=T -> exit loop -> return suggestions [PATH2] foreach(T entry : enumClass.getEnumConstants())=F -> return suggestions [PATH3] foreach(T...
true
ok
{"focal": {"class": "EnumProvider", "name": "getSuggestions", "signature": "List<String> getSuggestions(String prefix)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "prefix", "type": "String"}], "return_type": "List<String>"}, "class_info": {"name": "EnumProvider", "kind": "class", "modifiers"...
22981257_263
class DriftDetector { static double diff(double a, double b) { Preconditions.checkArgument(a >= 0 && a < 360); Preconditions.checkArgument(b >= 0 && b < 360); double value; if (a < b) value = a + 360 - b; else value = a - b; if (value > 180) ...
assertEquals(10, diff(30, 20), PRECISION); } }
[FOCAL] static double DriftDetector.diff(double a, double b) [CLASS] class DriftDetector [METRICS] loc=14 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] Preconditions.checkArgument/1 [PATH1] if(a < b)=T -> if(value > 180)=T -> return 360 - value [PATH2] if(a < b)=F -> if(value > 180)=F -> return ...
/* static context [FOCAL] static double DriftDetector.diff(double a, double b) [PATH1] if(a < b)=T -> if(value > 180)=T -> return 360 - value [PATH2] if(a < b)=F -> if(value > 180)=F -> return value [INPUTS] branches=a, b | result=a, b [CALLS-EXTERNAL] Preconditions.checkArgument/1 */
/* static context [FOCAL] static double DriftDetector.diff(double a, double b) [PATH1] if(a < b)=T -> if(value > 180)=T -> return 360 - value [PATH2] if(a < b)=F -> if(value > 180)=F -> return value [INPUTS] branches=a, b | result=a, b [CALLS-EXTERNAL] Preconditions.checkArgument/1 */ class DriftDetector { static ...
true
ok
{"focal": {"class": "DriftDetector", "name": "diff", "signature": "double diff(double a, double b)", "start_line": 3, "modifiers": "static", "params": [{"name": "a", "type": "double"}, {"name": "b", "type": "double"}], "return_type": "double"}, "class_info": {"name": "DriftDetector", "kind": "class", "modifiers": "", "...
23001404_7
class UpdateEntitySchemaStatusCommand extends AbstractRestCommand { @Override public String run() { LOGGER.debug("run: enitty={}, version={}, status={}", entity, version, status); Error.reset(); Error.push(getClass().getSimpleName()); Error.push(entity); Error.push(versi...
UpdateEntitySchemaStatusCommand command = new UpdateEntitySchemaStatusCommand(metadata, null, null, null, null); String output = command.run(); Assert.assertNotNull(output); } }
[FOCAL] @Override public String UpdateEntitySchemaStatusCommand.run() [CLASS] class UpdateEntitySchemaStatusCommand extends AbstractRestCommand [METRICS] loc=19 cc=3 branches=0 loops=0 returns=3 throws=0 nesting=1 [CALLS-EXTERNAL] LOGGER.debug/4, Error.reset/0, Error.push/1, getClass().getSimpleName/0, getClass/0 (inhe...
/* static context [FOCAL] @Override public String UpdateEntitySchemaStatusCommand.run() [PATH1] try-body throws -> return e.toString() [PATH2] return getJSONParser().convert(md.getEntityMetadata(entity, version)).toSt... [PATH3] try-body throws -> return Error.get(RestMetadataConstants.ERR_REST_ERROR, e.toString()).toS...
/* static context [FOCAL] @Override public String UpdateEntitySchemaStatusCommand.run() [PATH1] try-body throws -> return e.toString() [PATH2] return getJSONParser().convert(md.getEntityMetadata(entity, version)).toSt... [PATH3] try-body throws -> return Error.get(RestMetadataConstants.ERR_REST_ERROR, e.toString()).toS...
true
ok
{"focal": {"class": "UpdateEntitySchemaStatusCommand", "name": "run", "signature": "String run()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "UpdateEntitySchemaStatusCommand", "kind": "class", "modifiers": "", "superclass": "AbstractRestCommand", "i...
23020824_110
class YahooLibFinanceService implements FinanceService { static Stock toStock(yahoofinance.Stock yahooFinanceStock) { StockQuote quote = yahooFinanceStock.getQuote(); return new Stock( yahooFinanceStock.getSymbol(), yahooFinanceStock.getName(), new PriceInfo( quote.getPrice(), quote.getChangeInPe...
yahoofinance.Stock yahooFinanceStock = new yahoofinance.Stock("MS.MI"); yahooFinanceStock.setName("Mediaset"); StockQuote quote = new StockQuote("MS.MI"); quote.setPrice(BigDecimal.ONE); quote.setPreviousClose(BigDecimal.TEN); quote.setAvgVolume(10L); quote.setAsk(new BigDecimal(2)); quote.setAskSize(3...
[FOCAL] static Stock YahooLibFinanceService.toStock(yahoofinance.Stock yahooFinanceStock) [CLASS] class YahooLibFinanceService implements FinanceService [METRICS] loc=15 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] BigDecimal nullSafe(Long avgVolume) [CALLS-EXTERNAL] yahoofinance.Stock.getQuote...
/* static context [FOCAL] static Stock YahooLibFinanceService.toStock(yahoofinance.Stock yahooFinanceStock) [INPUTS] branches=- | result=yahooFinanceStock [COLLABORATORS] param yahooFinanceStock:yahoofinance.Stock getQuote/0,getSymbol/0,getName/0 [CALLS-INTERNAL] BigDecimal nullSafe(Long avgVolume) [NEW] Stock, PriceIn...
/* static context [FOCAL] static Stock YahooLibFinanceService.toStock(yahoofinance.Stock yahooFinanceStock) [INPUTS] branches=- | result=yahooFinanceStock [COLLABORATORS] param yahooFinanceStock:yahoofinance.Stock getQuote/0,getSymbol/0,getName/0 [CALLS-INTERNAL] BigDecimal nullSafe(Long avgVolume) [NEW] Stock, PriceIn...
true
ok
{"focal": {"class": "YahooLibFinanceService", "name": "toStock", "signature": "Stock toStock(yahoofinance.Stock yahooFinanceStock)", "start_line": 3, "modifiers": "static", "params": [{"name": "yahooFinanceStock", "type": "yahoofinance.Stock"}], "return_type": "Stock"}, "class_info": {"name": "YahooLibFinanceService", ...
23040996_0
class JobDetailImpl implements Cloneable, java.io.Serializable, JobDetail { @Override public int hashCode() { JobKey key = getKey(); return key == null ? 0 : getKey().hashCode(); } public JobDetailImpl(); public JobDetailImpl(String name, Class<? extends Job> jobClass); publi...
JobDetailImpl job = new JobDetailImpl(); Assert.assertThat(job.hashCode(), Matchers.is(0)); job.setName("test"); Assert.assertThat(job.hashCode(), Matchers.not(Matchers.is(0))); job.setGroup("test"); Assert.assertThat(job.hashCode(), Matchers.not(Matchers.is(0))); } }
[FOCAL] @Override public int JobDetailImpl.hashCode() [CLASS] class JobDetailImpl implements Cloneable, java.io.Serializable, JobDetail [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] JobKey getKey() [CALLS-EXTERNAL] getKey().hashCode/0 [DATAFLOW] key@L3->L4 [CLASS-MEMBERS] JobDeta...
/* static context [FOCAL] @Override public int JobDetailImpl.hashCode() [CALLS-INTERNAL] JobKey getKey() [CALLS-EXTERNAL] getKey().hashCode/0 */
/* static context [FOCAL] @Override public int JobDetailImpl.hashCode() [CALLS-INTERNAL] JobKey getKey() [CALLS-EXTERNAL] getKey().hashCode/0 */ class JobDetailImpl implements Cloneable, java.io.Serializable, JobDetail { @Override public int hashCode() { JobKey key = getKey(); return key == nul...
true
ok
{"focal": {"class": "JobDetailImpl", "name": "hashCode", "signature": "int hashCode()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "JobDetailImpl", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Cloneable, java.io.Serializable, Job...
23043801_3
class Debug { public static void init(DebugOutput... outputs) { final DebugOutput out; final int length = outputs != null ? outputs.length : 0; if (length == 0) { out = null; } else { if (length == 1) { out = ...
final DebugOutputMock mock = new DebugOutputMock(true); Debug.init(mock); for (Level level : LEVELS) { assertCall(mock, level, new RuntimeException(), "Exception here", array("Exception here")); } assertEquals(LEVELS.length, mock.size()); } }
[FOCAL] public static void Debug.init(DebugOutput... outputs) [CLASS] class Debug [METRICS] loc=19 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=2 [CALLS-EXTERNAL] DebugOutputContainer.create/1 [PATH1] if(length == 0)=F -> if(length == 1)=T [PATH2] if(length == 0)=T [PATH3] if(length == 0)=F -> if(length == 1)=F [...
/* static context [FOCAL] public static void Debug.init(DebugOutput... outputs) [PATH1] if(length == 0)=F -> if(length == 1)=T [PATH2] if(length == 0)=T [PATH3] if(length == 0)=F -> if(length == 1)=F [INPUTS] branches=outputs | result=- [CALLS-EXTERNAL] DebugOutputContainer.create/1 */
/* static context [FOCAL] public static void Debug.init(DebugOutput... outputs) [PATH1] if(length == 0)=F -> if(length == 1)=T [PATH2] if(length == 0)=T [PATH3] if(length == 0)=F -> if(length == 1)=F [INPUTS] branches=outputs | result=- [CALLS-EXTERNAL] DebugOutputContainer.create/1 */ class Debug { public static ...
true
ok
{"focal": {"class": "Debug", "name": "init", "signature": "void init(DebugOutput... outputs)", "start_line": 3, "modifiers": "public static", "params": [{"name": "outputs", "type": "DebugOutput..."}], "return_type": "void"}, "class_info": {"name": "Debug", "kind": "class", "modifiers": "", "superclass": null, "interfac...
23062279_875
class PasswordHashCreatorBCrypt extends AbstractPasswordHashCreator { @Nonnull public String createPasswordHash (@Nonnull final IPasswordSalt aSalt, @Nonnull final String sPlainTextPassword) { ValueEnforcer.notNull (aSalt, "Salt"); ValueEnforcer.isInstanceOf (aSalt, PasswordSaltBCrypt.class, "Salt"); ...
final IPasswordSalt aSalt = new PasswordSaltBCrypt (); final String sPlainTextPassword = "123456"; final PasswordHashCreatorBCrypt a = new PasswordHashCreatorBCrypt (); final String sPW1 = a.createPasswordHash (aSalt, sPlainTextPassword); final String sPW2 = a.createPasswordHash (aSalt, sPlainTextPa...
[FOCAL] @Nonnull public String PasswordHashCreatorBCrypt.createPasswordHash(IPasswordSalt aSalt, String sPlainTextPassword) [CLASS] class PasswordHashCreatorBCrypt extends AbstractPasswordHashCreator [METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] ValueEnforcer.notNull/2, ValueEnfo...
/* static context [FOCAL] @Nonnull public String PasswordHashCreatorBCrypt.createPasswordHash(IPasswordSalt aSalt, String sPlainTextPassword) [INPUTS] branches=- | result=aSalt, sPlainTextPassword [COLLABORATORS] param aSalt:IPasswordSalt getSaltString/0 [CALLS-EXTERNAL] ValueEnforcer.notNull/2, ValueEnforcer.isInstanc...
/* static context [FOCAL] @Nonnull public String PasswordHashCreatorBCrypt.createPasswordHash(IPasswordSalt aSalt, String sPlainTextPassword) [INPUTS] branches=- | result=aSalt, sPlainTextPassword [COLLABORATORS] param aSalt:IPasswordSalt getSaltString/0 [CALLS-EXTERNAL] ValueEnforcer.notNull/2, ValueEnforcer.isInstanc...
true
ok
{"focal": {"class": "PasswordHashCreatorBCrypt", "name": "createPasswordHash", "signature": "String createPasswordHash(IPasswordSalt aSalt, String sPlainTextPassword)", "start_line": 3, "modifiers": "@Nonnull public", "params": [{"name": "aSalt", "type": "IPasswordSalt"}, {"name": "sPlainTextPassword", "type": "String"...
23063531_1
class WxCpMessageRouter { public WxCpXmlOutMessage route(final WxCpXmlMessage wxMessage) { if (isDuplicateMessage(wxMessage)) { // 如果是重复消息,那么就不做处理 return null; } final List<WxCpMessageRouterRule> matchRules = new ArrayList<WxCpMessageRouterRule>(); // 收集匹配的规则 for (final WxCpMessageRo...
StringBuffer sb = new StringBuffer(); WxCpMessageRouter router = new WxCpMessageRouter(null); prepare(false, sb, router); router.route(message); Assert.assertEquals(sb.toString(), expected); } }
[FOCAL] public WxCpXmlOutMessage WxCpMessageRouter.route(WxCpXmlMessage wxMessage) [CLASS] class WxCpMessageRouter [METRICS] loc=62 cc=9 branches=6 loops=2 returns=3 throws=0 nesting=3 [CALLS-INTERNAL] boolean isDuplicateMessage(WxCpXmlMessage wxMessage); void sessionEndAccess(WxCpXmlMessage wxMessage) [CALLS-EXTERNAL]...
/* static context [FOCAL] public WxCpXmlOutMessage WxCpMessageRouter.route(WxCpXmlMessage wxMessage) [PATH1] if(isDuplicateMessage(wxMessage))=F -> foreach(WxCpMessageRouterRule rule : rules)=T -> if(rule.test(wxMessage))=T -> if(!rule.isReEnter())=T -> if(matchRules.size() == 0)=F -> foreach(WxCpMessageRouterRule rule...
/* static context [FOCAL] public WxCpXmlOutMessage WxCpMessageRouter.route(WxCpXmlMessage wxMessage) [PATH1] if(isDuplicateMessage(wxMessage))=F -> foreach(WxCpMessageRouterRule rule : rules)=T -> if(rule.test(wxMessage))=T -> if(!rule.isReEnter())=T -> if(matchRules.size() == 0)=F -> foreach(WxCpMessageRouterRule rule...
true
ok
{"focal": {"class": "WxCpMessageRouter", "name": "route", "signature": "WxCpXmlOutMessage route(WxCpXmlMessage wxMessage)", "start_line": 3, "modifiers": "public", "params": [{"name": "wxMessage", "type": "WxCpXmlMessage"}], "return_type": "WxCpXmlOutMessage"}, "class_info": {"name": "WxCpMessageRouter", "kind": "class...
23088989_8
class IndexUtils { public static List<IndexMetadata> parseIndexMetadata(String serializedIndexMetadata) throws IOException { ObjectMapper jsonMapper = new DefaultIndexMapper(); TypeReference<List<IndexMetadata>> typeRef = new TypeReference<List<IndexMetadata>>() {}; return jsonMapper.readVa...
List<IndexMetadata> indexMetadataList = IndexUtils.parseIndexMetadata( "[ { \"retentionType\": \"yearly\", \"retentionPeriod\": 20, \"indexName\": \"index\" }," + "{ \"retentionType\": \"monthly\", \"retentionPeriod\": 20, \"indexName\": \"0\" }," + ...
[FOCAL] public static List<IndexMetadata> IndexUtils.parseIndexMetadata(String serializedIndexMetadata) [CLASS] class IndexUtils [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] ObjectMapper.readValue/2 [NEW] DefaultIndexMapper, TypeReference<List<IndexMetadata>> [EXCEPTIONS] declar...
/* static context [FOCAL] public static List<IndexMetadata> IndexUtils.parseIndexMetadata(String serializedIndexMetadata) [INPUTS] branches=- | result=serializedIndexMetadata [EXCEPTIONS] declares IOException [NEW] DefaultIndexMapper, TypeReference<List<IndexMetadata>> [CALLS-EXTERNAL] ObjectMapper.readValue/2 */
/* static context [FOCAL] public static List<IndexMetadata> IndexUtils.parseIndexMetadata(String serializedIndexMetadata) [INPUTS] branches=- | result=serializedIndexMetadata [EXCEPTIONS] declares IOException [NEW] DefaultIndexMapper, TypeReference<List<IndexMetadata>> [CALLS-EXTERNAL] ObjectMapper.readValue/2 */ class...
true
ok
{"focal": {"class": "IndexUtils", "name": "parseIndexMetadata", "signature": "List<IndexMetadata> parseIndexMetadata(String serializedIndexMetadata) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "serializedIndexMetadata", "type": "String"}], "return_type": "List<IndexMetadata>"...
23092563_5
class ScrimRenderer { void render(Canvas canvas, SlidrPosition position, Paint paint) { switch (position) { case LEFT: renderLeft(canvas, paint); break; case RIGHT: renderRight(canvas, paint); break; case TO...
when(decorView.getTop()).thenReturn(VERTICAL_TOP); renderer.render(canvas, SlidrPosition.VERTICAL, paint); verify(canvas).drawRect(0, BOTTOM, WIDTH, HEIGHT, paint); } }
[FOCAL] void ScrimRenderer.render(Canvas canvas, SlidrPosition position, Paint paint) [CLASS] class ScrimRenderer [METRICS] loc=22 cc=7 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] void renderBottom(Canvas canvas, Paint paint); void renderHorizontal(Canvas canvas, Paint paint); void renderLeft(Canva...
/* static context [FOCAL] void ScrimRenderer.render(Canvas canvas, SlidrPosition position, Paint paint) [PATH1] switch(position)=case LEFT [PATH2] switch(position)=case RIGHT [PATH3] switch(position)=case TOP [PATH4] switch(position)=case BOTTOM [PATH5] switch(position)=case VERTICAL [PATH6] switch(position)=case HORIZ...
/* static context [FOCAL] void ScrimRenderer.render(Canvas canvas, SlidrPosition position, Paint paint) [PATH1] switch(position)=case LEFT [PATH2] switch(position)=case RIGHT [PATH3] switch(position)=case TOP [PATH4] switch(position)=case BOTTOM [PATH5] switch(position)=case VERTICAL [PATH6] switch(position)=case HORIZ...
true
ok
{"focal": {"class": "ScrimRenderer", "name": "render", "signature": "void render(Canvas canvas, SlidrPosition position, Paint paint)", "start_line": 3, "modifiers": "", "params": [{"name": "canvas", "type": "Canvas"}, {"name": "position", "type": "SlidrPosition"}, {"name": "paint", "type": "Paint"}], "return_type": "vo...
23095954_4
class HandlerScheduler extends Scheduler { @Override @SuppressLint("NewApi") // Async will only be true when the API is available to call. public Disposable scheduleDirect(Runnable run, long delay, TimeUnit unit) { if (run == null) throw new NullPointerException("run == null"); if (unit == ...
CountingRunnable counter = new CountingRunnable(); scheduler.scheduleDirect(counter, 1, MINUTES); runUiThreadTasks(); assertEquals(0, counter.get()); idleMainLooper(1, MINUTES); runUiThreadTasks(); assertEquals(1, counter.get()); } }
[FOCAL] @Override @SuppressLint("NewApi") // Async will only be true when the API is available to call. public Disposable HandlerScheduler.scheduleDirect(Runnable run, long delay, TimeUnit unit) [CLASS] class HandlerScheduler extends Scheduler [METRICS] loc=15 cc=4 branches=3 loops=0 returns=1 throws=2 nesting=1 [CALLS...
/* static context [FOCAL] @Override @SuppressLint("NewApi") // Async will only be true when the API is available to call. public Disposable HandlerScheduler.scheduleDirect(Runnable run, long delay, TimeUnit unit) [THROWS-WHEN] NullPointerException when run == null [THROWS-WHEN] NullPointerException when !(run == null) ...
/* static context [FOCAL] @Override @SuppressLint("NewApi") // Async will only be true when the API is available to call. public Disposable HandlerScheduler.scheduleDirect(Runnable run, long delay, TimeUnit unit) [THROWS-WHEN] NullPointerException when run == null [THROWS-WHEN] NullPointerException when !(run == null) ...
true
ok
{"focal": {"class": "HandlerScheduler", "name": "scheduleDirect", "signature": "Disposable scheduleDirect(Runnable run, long delay, TimeUnit unit)", "start_line": 3, "modifiers": "@Override @SuppressLint(\"NewApi\") // Async will only be true when the API is available to call. public", "params": [{"name": "run", "type"...
23112526_19
class UseCase { public void execute(DisposableObserver<T> observer, Params params) { Preconditions.checkNotNull(observer); final Observable<T> observable = this.buildUseCaseObservable(params) .subscribeOn(Schedulers.from(threadExecutor)) .observeOn(postExecutionThread.getScheduler()); add...
useCase.execute(testObserver, Params.EMPTY); assertThat(testObserver.valuesCount).isZero(); } }
[FOCAL] public void UseCase.execute(DisposableObserver<T> observer, Params params) [CLASS] class UseCase [METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] Observable<T> buildUseCaseObservable(Params params); void addDisposable(Disposable disposable) [CALLS-EXTERNAL] Preconditions.che...
/* static context [FOCAL] public void UseCase.execute(DisposableObserver<T> observer, Params params) [COLLABORATORS] field postExecutionThread getScheduler/0 [CALLS-INTERNAL] Observable<T> buildUseCaseObservable(Params params); void addDisposable(Disposable disposable) [CALLS-EXTERNAL] Preconditions.checkNotNull/1, thi...
/* static context [FOCAL] public void UseCase.execute(DisposableObserver<T> observer, Params params) [COLLABORATORS] field postExecutionThread getScheduler/0 [CALLS-INTERNAL] Observable<T> buildUseCaseObservable(Params params); void addDisposable(Disposable disposable) [CALLS-EXTERNAL] Preconditions.checkNotNull/1, thi...
true
ok
{"focal": {"class": "UseCase", "name": "execute", "signature": "void execute(DisposableObserver<T> observer, Params params)", "start_line": 3, "modifiers": "public", "params": [{"name": "observer", "type": "DisposableObserver<T>"}, {"name": "params", "type": "Params"}], "return_type": "void"}, "class_info": {"name": "U...
23123512_33
class JavassistUtils { public static List<CtField> getAllInjectedFieldsForAnnotation(CtClass clazz, Class<? extends Annotation> annotationClazz) { List<CtField> result = new ArrayList<CtField>(); CtField[] allFields = clazz.getDeclaredFields(); for (CtField field : allFields) { if (field.hasA...
//GIVEN Class<TestClassWithAnnotatedFields> aClass = TestClassWithAnnotatedFields.class; //WHEN List<CtField> allInjectedFieldsForAnnotation2 = JavassistUtils.getAllInjectedFieldsForAnnotation( ClassPool.getDefault().get(aClass.getName()), Annotation2.class); //THEN assert...
[FOCAL] public static List<CtField> JavassistUtils.getAllInjectedFieldsForAnnotation(CtClass clazz, Class<? extends Annotation> annotationClazz) [CLASS] class JavassistUtils [METRICS] loc=11 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] CtClass.getDeclaredFields/0, CtField.hasAnnotation/1, List<...
/* static context [FOCAL] public static List<CtField> JavassistUtils.getAllInjectedFieldsForAnnotation(CtClass clazz, Class<? extends Annotation> annotationClazz) [PATH1] foreach(CtField field : allFields)=T -> if(field.hasAnnotation(annotationClazz))=T -> exit loop -> return result [PATH2] foreach(CtField field : allF...
/* static context [FOCAL] public static List<CtField> JavassistUtils.getAllInjectedFieldsForAnnotation(CtClass clazz, Class<? extends Annotation> annotationClazz) [PATH1] foreach(CtField field : allFields)=T -> if(field.hasAnnotation(annotationClazz))=T -> exit loop -> return result [PATH2] foreach(CtField field : allF...
true
ok
{"focal": {"class": "JavassistUtils", "name": "getAllInjectedFieldsForAnnotation", "signature": "List<CtField> getAllInjectedFieldsForAnnotation(CtClass clazz, Class<? extends Annotation> annotationClazz)", "start_line": 3, "modifiers": "public static", "params": [{"name": "clazz", "type": "CtClass"}, {"name": "annotat...
23175652_9
class ControllerBase implements Controller, JacksonJsonView, HTMLFilterProvider, JSONErrorPageRenderer, ValidatorProvider, TextRendererProvider, JacksonJsonParamReader { Filters getFilters() { return this.filters .computeIfAbsent( this.getClass(), (klass) -> { ...
try (final MyController controller = new MyController()) { final Filters filters = controller.getFilters(); assertThat(filters.getResponseFilters().size(), is(1)); } } }
[FOCAL] Filters ControllerBase.getFilters() [CLASS] class ControllerBase implements Controller, JacksonJsonView, HTMLFilterProvider, JSONErrorPageRenderer, ValidatorProvider, TextRendererProvider, JacksonJsonParamReader [METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] this.filters....
/* static context [FOCAL] Filters ControllerBase.getFilters() [COLLABORATORS] field filters computeIfAbsent/2 [FIELDS] read=filters [NEW] FilterScanner [CALLS-EXTERNAL] this.filters.computeIfAbsent/2, this.getClass/0, FilterScanner.scan/1, FilterScanner.build/0 */
/* static context [FOCAL] Filters ControllerBase.getFilters() [COLLABORATORS] field filters computeIfAbsent/2 [FIELDS] read=filters [NEW] FilterScanner [CALLS-EXTERNAL] this.filters.computeIfAbsent/2, this.getClass/0, FilterScanner.scan/1, FilterScanner.build/0 */ class ControllerBase implements Controller, JacksonJs...
true
ok
{"focal": {"class": "ControllerBase", "name": "getFilters", "signature": "Filters getFilters()", "start_line": 5, "modifiers": "", "params": [], "return_type": "Filters"}, "class_info": {"name": "ControllerBase", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Controller, JacksonJsonView, HTMLFilte...
23206290_28
class AppliedFix { public static Applier fromSource(CharSequence source, EndPosTable endPositions) { return new Applier(source, endPositions); } private AppliedFix(String snippet, boolean isRemoveLine); public CharSequence getNewCodeSnippet(); public boolean isRemoveLine(); final EndPosTable endPos...
AppliedFix.Applier applier = AppliedFix.fromSource("Hello", endPositions); SuggestedFix fix = SuggestedFix.replace(0, 6, "World!"); assertThrows(IllegalArgumentException.class, () -> applier.apply(fix)); } }
[FOCAL] public static Applier AppliedFix.fromSource(CharSequence source, EndPosTable endPositions) [CLASS] class AppliedFix [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] Applier [INPUTS] branches=- | result=endPositions, source [DATAFLOW] endPositions@param->L2; source@param->L2 [CLASS-MEMB...
/* static context [FOCAL] public static Applier AppliedFix.fromSource(CharSequence source, EndPosTable endPositions) [INPUTS] branches=- | result=endPositions, source [NEW] Applier */
/* static context [FOCAL] public static Applier AppliedFix.fromSource(CharSequence source, EndPosTable endPositions) [INPUTS] branches=- | result=endPositions, source [NEW] Applier */ class AppliedFix { public static Applier fromSource(CharSequence source, EndPosTable endPositions) { return new Applier(source, e...
true
ok
{"focal": {"class": "AppliedFix", "name": "fromSource", "signature": "Applier fromSource(CharSequence source, EndPosTable endPositions)", "start_line": 3, "modifiers": "public static", "params": [{"name": "source", "type": "CharSequence"}, {"name": "endPositions", "type": "EndPosTable"}], "return_type": "Applier"}, "cl...
23227907_129
class LanguageService implements ILanguageService { @Override public PagedMetadata<LanguageDto> getLanguages(RestListRequest requestList) { try { List<Lang> sysLangs = this.getLangManager().getAssignableLangs(); List<LanguageDto> langs = this.getLanguageDtoBuilder().convert(sysL...
PagedMetadata<LanguageDto> result = languageService.getLanguages(new RestListRequest()); assertThat(result.getBody()).hasSize(2); } }
[FOCAL] @Override public PagedMetadata<LanguageDto> LanguageService.getLanguages(RestListRequest requestList) [CLASS] class LanguageService implements ILanguageService [METRICS] loc=21 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] IDtoBuilder<Lang, LanguageDto> getLanguageDtoBuilder(); ILangMana...
/* static context [FOCAL] @Override public PagedMetadata<LanguageDto> LanguageService.getLanguages(RestListRequest requestList) [THROWS-WHEN] RestServerError when try-body throws [PATH1] try-body throws -> throw new RestServerError("error in search langs", t) [PATH2] return pagedMetadata [INPUTS] branches=- | result=re...
/* static context [FOCAL] @Override public PagedMetadata<LanguageDto> LanguageService.getLanguages(RestListRequest requestList) [THROWS-WHEN] RestServerError when try-body throws [PATH1] try-body throws -> throw new RestServerError("error in search langs", t) [PATH2] return pagedMetadata [INPUTS] branches=- | result=re...
true
ok
{"focal": {"class": "LanguageService", "name": "getLanguages", "signature": "PagedMetadata<LanguageDto> getLanguages(RestListRequest requestList)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "requestList", "type": "RestListRequest"}], "return_type": "PagedMetadata<LanguageDto>"}, "class_info"...
23229174_0
class StringUtil { public boolean isMD5(String test) { return test.matches("[a-fA-F0-9]{32}"); } public List<String> getMatchingLines(String textWithNewlines, String regex); public List<String> extractFromMatchingLines( String textWithNewlines, String regex); public List<String> extractFromMatchingLines( ...
StringUtil str = new StringUtil(); assertFalse(str.isMD5( "_9054025255fb1a26e4bc422aef54eb4")); assertFalse(str.isMD5( "z9054025255fb1a26e4bc422aef54eb4")); assertFalse(str.isMD5( "9054025255fb1a26e4bc422aef54eb4")); assertTrue(str.isMD5( "79054025255fb1a26e4bc422aef54eb4")); } }
[FOCAL] public boolean StringUtil.isMD5(String test) [CLASS] class StringUtil [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] String.matches/1 [INPUTS] branches=- | result=test [DATAFLOW] test@param->L2 [CLASS-MEMBERS] List<String> getMatchingLines(String textWithNewlines, String r...
/* static context [FOCAL] public boolean StringUtil.isMD5(String test) [INPUTS] branches=- | result=test [CALLS-EXTERNAL] String.matches/1 */
/* static context [FOCAL] public boolean StringUtil.isMD5(String test) [INPUTS] branches=- | result=test [CALLS-EXTERNAL] String.matches/1 */ class StringUtil { public boolean isMD5(String test) { return test.matches("[a-fA-F0-9]{32}"); } public List<String> getMatchingLines(String textWithNewlines, String regex...
true
ok
{"focal": {"class": "StringUtil", "name": "isMD5", "signature": "boolean isMD5(String test)", "start_line": 3, "modifiers": "public", "params": [{"name": "test", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "StringUtil", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, ...
23234361_0
class XSPARQLProcessor { public String process(final Reader is) throws RecognitionException, IOException, Exception { CommonTokenStream tokenStream = createTokenStream(is); if (this.numSyntaxErrors > 0) { throw new Exception("Errors for Lexer. Translation aborted."); } CommonTree tree =...
try { for (String filename : listFiles("examples")) { if (filename.endsWith(".xsparql")) { System.out.println("Testing " + filename + " ..."); Reader queryReader = loadReaderFromClasspath(filename); processor.process(queryReader); } } } catch (Recognit...
[FOCAL] public String XSPARQLProcessor.process(Reader is) [CLASS] class XSPARQLProcessor [METRICS] loc=41 cc=6 branches=5 loops=0 returns=1 throws=5 nesting=1 [CALLS-INTERNAL] CommonTokenStream createTokenStream(Reader is); CommonTree parse(CommonTokenStream tokenStream); CommonTree rewrite(CommonTokenStream tokenStrea...
/* static context [FOCAL] public String XSPARQLProcessor.process(Reader is) [THROWS-WHEN] Exception when this.numSyntaxErrors > 0 [THROWS-WHEN] Exception when !(this.numSyntaxErrors > 0) && this.numSyntaxErrors > 0 [THROWS-WHEN] Exception when !(this.numSyntaxErrors > 0) && !(this.numSyntaxErrors > 0) && this.numSyntax...
/* static context [FOCAL] public String XSPARQLProcessor.process(Reader is) [THROWS-WHEN] Exception when this.numSyntaxErrors > 0 [THROWS-WHEN] Exception when !(this.numSyntaxErrors > 0) && this.numSyntaxErrors > 0 [THROWS-WHEN] Exception when !(this.numSyntaxErrors > 0) && !(this.numSyntaxErrors > 0) && this.numSyntax...
true
ok
{"focal": {"class": "XSPARQLProcessor", "name": "process", "signature": "String process(Reader is) throws RecognitionException, IOException, Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "is", "type": "Reader"}], "return_type": "String"}, "class_info": {"name": "XSPARQLProcessor", "kind": "cla...
23257998_5
class XmlConfig extends Config { @Override public String getProperty(String key) { return (String) mConfiguration.getProperty(key); } public XmlConfig(); public XmlConfig(XmlConfig parent, HierarchicalConfiguration config); public XmlConfig(File file); @Override public boolean ...
assertTrue(mConfig.hasProperty("test-property")); assertEquals("Hello world!", mConfig.getProperty("test-property")); } }
[FOCAL] @Override public String XmlConfig.getProperty(String key) [CLASS] class XmlConfig extends Config [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] mConfiguration.getProperty/1 [INPUTS] branches=- | result=key [COLLABORATORS] field mConfiguration getProperty/1 [DATAFLOW] key@p...
/* static context [FOCAL] @Override public String XmlConfig.getProperty(String key) [INPUTS] branches=- | result=key [COLLABORATORS] field mConfiguration getProperty/1 [CALLS-EXTERNAL] mConfiguration.getProperty/1 */
/* static context [FOCAL] @Override public String XmlConfig.getProperty(String key) [INPUTS] branches=- | result=key [COLLABORATORS] field mConfiguration getProperty/1 [CALLS-EXTERNAL] mConfiguration.getProperty/1 */ class XmlConfig extends Config { @Override public String getProperty(String key) { ret...
true
ok
{"focal": {"class": "XmlConfig", "name": "getProperty", "signature": "String getProperty(String key)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "key", "type": "String"}], "return_type": "String"}, "class_info": {"name": "XmlConfig", "kind": "class", "modifiers": "", "superclass": "Config", ...
23260390_75
class SimonBeanUtils { public void setProperty(Object target, String property, Object value) { NestedResolver resolver = new NestedResolver(target, property); if (value instanceof String) { convertStringValue(resolver.getNestedTarget(), resolver.getProperty(), (String) value); } else { setObjectValue(res...
SeveralSettersIntBean bean = new SeveralSettersIntBean(); simonBeanUtils.setProperty(bean, "prop", "123"); Assert.assertEquals(bean.getIntVal(), 123); } }
[FOCAL] public void SimonBeanUtils.setProperty(Object target, String property, Object value) [CLASS] class SimonBeanUtils [METRICS] loc=9 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] void convertStringValue(Object target, String property, String strVal); void setObjectValue(Object target, Strin...
/* static context [FOCAL] public void SimonBeanUtils.setProperty(Object target, String property, Object value) [PATH1] if(value instanceof String)=T [PATH2] if(value instanceof String)=F [INPUTS] branches=value | result=- [CALLS-INTERNAL] void convertStringValue(Object target, String property, String strVal); void setO...
/* static context [FOCAL] public void SimonBeanUtils.setProperty(Object target, String property, Object value) [PATH1] if(value instanceof String)=T [PATH2] if(value instanceof String)=F [INPUTS] branches=value | result=- [CALLS-INTERNAL] void convertStringValue(Object target, String property, String strVal); void setO...
true
ok
{"focal": {"class": "SimonBeanUtils", "name": "setProperty", "signature": "void setProperty(Object target, String property, Object value)", "start_line": 3, "modifiers": "public", "params": [{"name": "target", "type": "Object"}, {"name": "property", "type": "String"}, {"name": "value", "type": "Object"}], "return_type"...
23304527_39
class CSSNumberHelper { @Nullable public static CSSSimpleValueWithUnit getValueWithUnit (@Nullable final String sCSSValue) { return getValueWithUnit (sCSSValue, true); } private CSSNumberHelper(); @Nullable public static ECSSUnit getMatchingUnitInclPercentage(@Nonnull final String sCSSValue); @Nul...
assertEquals (new CSSSimpleValueWithUnit (50, ECSSUnit.PERCENTAGE), CSSNumberHelper.getValueWithUnit ("50%", true)); assertEquals (new CSSSimpleValueWithUnit (50, ECSSUnit.LENGTH_MM), CSSNumberHelper.getValueWithUnit ("50mm", true)); assertEquals (new CSSSimpleValueWithUnit (50, ECSSUnit.LENGTH_CM), CSSNumb...
[FOCAL] @Nullable public static CSSSimpleValueWithUnit CSSNumberHelper.getValueWithUnit(String sCSSValue) [CLASS] class CSSNumberHelper [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] CSSSimpleValueWithUnit getValueWithUnit(String sCSSValue, boolean bWithPerc) [INPUTS] branches=- |...
/* static context [FOCAL] @Nullable public static CSSSimpleValueWithUnit CSSNumberHelper.getValueWithUnit(String sCSSValue) [INPUTS] branches=- | result=sCSSValue [CALLS-INTERNAL] CSSSimpleValueWithUnit getValueWithUnit(String sCSSValue, boolean bWithPerc) */
/* static context [FOCAL] @Nullable public static CSSSimpleValueWithUnit CSSNumberHelper.getValueWithUnit(String sCSSValue) [INPUTS] branches=- | result=sCSSValue [CALLS-INTERNAL] CSSSimpleValueWithUnit getValueWithUnit(String sCSSValue, boolean bWithPerc) */ class CSSNumberHelper { @Nullable public static CSSSimp...
true
ok
{"focal": {"class": "CSSNumberHelper", "name": "getValueWithUnit", "signature": "CSSSimpleValueWithUnit getValueWithUnit(String sCSSValue)", "start_line": 3, "modifiers": "@Nullable public static", "params": [{"name": "sCSSValue", "type": "String"}], "return_type": "CSSSimpleValueWithUnit"}, "class_info": {"name": "CSS...
23338118_10
class BoonServiceMethodCallHandler implements ServiceMethodHandler { @Override public void shutdown() { queueCallBackHandler.queueShutdown(); } public BoonServiceMethodCallHandler(final boolean invokeDynamic); @Override public Response<Object> receiveMethodCall(MethodCall<Object> methodC...
class MyService { boolean called; @QueueCallback(QueueCallbackType.SHUTDOWN) private void shutdown() { called = true; } } MyService myService = new MyService(); final BoonServiceMethodCallHandler boonServiceMethodCal...
[FOCAL] @Override public void BoonServiceMethodCallHandler.shutdown() [CLASS] class BoonServiceMethodCallHandler implements ServiceMethodHandler [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] queueCallBackHandler.queueShutdown/0 [COLLABORATORS] field queueCallBackHandler queueShut...
/* static context [FOCAL] @Override public void BoonServiceMethodCallHandler.shutdown() [COLLABORATORS] field queueCallBackHandler queueShutdown/0 [CALLS-EXTERNAL] queueCallBackHandler.queueShutdown/0 */
/* static context [FOCAL] @Override public void BoonServiceMethodCallHandler.shutdown() [COLLABORATORS] field queueCallBackHandler queueShutdown/0 [CALLS-EXTERNAL] queueCallBackHandler.queueShutdown/0 */ class BoonServiceMethodCallHandler implements ServiceMethodHandler { @Override public void shutdown() { ...
true
ok
{"focal": {"class": "BoonServiceMethodCallHandler", "name": "shutdown", "signature": "void shutdown()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "BoonServiceMethodCallHandler", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Serv...
23342644_5
class SixMonthlyExpiryDayValidator extends ExpiryDayValidator { protected int plusMonths() { return 6; } public SixMonthlyExpiryDayValidator(int expiryDays, String period); @Override protected LocalDate getMaxDateCanEdit(); protected int monthOfYear(int periodNumber); public String g...
LocalDate periodDate = new LocalDate(); int previousPeriodStart = getPreviousPeriodStart(); periodDate = periodDate.withMonthOfYear( previousPeriodStart == PREVIOUS_PERIOD_START_JANUARY ? DateTimeConstants.JANUARY : DateTimeConstants.JULY).withDayOfMonth(1...
[FOCAL] protected int SixMonthlyExpiryDayValidator.plusMonths() [CLASS] class SixMonthlyExpiryDayValidator extends ExpiryDayValidator [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] SixMonthlyExpiryDayValidator(int expiryDays, String period); LocalDate getMaxDateCanEdit(); int month...
/* static context [FOCAL] protected int SixMonthlyExpiryDayValidator.plusMonths() */
/* static context [FOCAL] protected int SixMonthlyExpiryDayValidator.plusMonths() */ class SixMonthlyExpiryDayValidator extends ExpiryDayValidator { protected int plusMonths() { return 6; } public SixMonthlyExpiryDayValidator(int expiryDays, String period); @Override protected LocalDate getM...
true
ok
{"focal": {"class": "SixMonthlyExpiryDayValidator", "name": "plusMonths", "signature": "int plusMonths()", "start_line": 3, "modifiers": "protected", "params": [], "return_type": "int"}, "class_info": {"name": "SixMonthlyExpiryDayValidator", "kind": "class", "modifiers": "", "superclass": "ExpiryDayValidator", "interfa...
23357238_13
class Query { public static rx.functions.Func1<Event, Boolean> parse(String query) { QueryLexer tokenSource = new QueryLexer(new ANTLRStringStream(query)); QueryParser queryParser = new QueryParser(new CommonTokenStream(tokenSource)); try { CommonTree tree = (CommonTree) queryPa...
assertTrue(Query.parse("not host = 1").call(Event.builder().withHost("2").build())); assertFalse(Query.parse("not host = 1").call(Event.builder().withHost("1").build())); assertTrue(Query.parse("host = 1 and state = 2").call(Event.builder().withHost("1").withState("2").build())); assertFalse(Qu...
[FOCAL] public static rx.functions.Func1<Event, Boolean> Query.parse(String query) [CLASS] class Query [METRICS] loc=10 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] Object getFilter(CommonTree tree, Event event) [CALLS-EXTERNAL] queryParser.expr().getTree/0, QueryParser.expr/0 [NEW] QueryLexer,...
/* static context [FOCAL] public static rx.functions.Func1<Event, Boolean> Query.parse(String query) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException(e) [PATH2] return (event) -> (boolean) getFilter(tree, event) [INPUTS] branches=- | result=query [EXCEPTIONS] thr...
/* static context [FOCAL] public static rx.functions.Func1<Event, Boolean> Query.parse(String query) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException(e) [PATH2] return (event) -> (boolean) getFilter(tree, event) [INPUTS] branches=- | result=query [EXCEPTIONS] thr...
true
ok
{"focal": {"class": "Query", "name": "parse", "signature": "rx.functions.Func1<Event, Boolean> parse(String query)", "start_line": 3, "modifiers": "public static", "params": [{"name": "query", "type": "String"}], "return_type": "rx.functions.Func1<Event, Boolean>"}, "class_info": {"name": "Query", "kind": "class", "mod...
23358011_19
class SchematronHelper { @Nullable public static SchematronOutputType applySchematron (@Nonnull final ISchematronResource aSchematron, @Nonnull final IReadableResource aXML) { ValueEnforcer.notNull (aSchematron, "SchematronResource"); ValueEnforcer.notNull (aXML, "XMLSource"); try { // App...
final SchematronOutputType aSO = SchematronHelper.applySchematron (SchematronResourceSCH.fromClassPath (VALID_SCHEMATRON + ".does.not.exist"), ...
[FOCAL] @Nullable public static SchematronOutputType SchematronHelper.applySchematron(ISchematronResource aSchematron, IReadableResource aXML) [CLASS] class SchematronHelper [METRICS] loc=20 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] ValueEnforcer.notNull/2, ISchematronResource.applySchematro...
/* static context [FOCAL] @Nullable public static SchematronOutputType SchematronHelper.applySchematron(ISchematronResource aSchematron, IReadableResource aXML) [THROWS-WHEN] IllegalArgumentException when try-body throws [PATH1] try-body throws -> throw new IllegalArgumentException ("Failed to apply Schematron " + aSch...
/* static context [FOCAL] @Nullable public static SchematronOutputType SchematronHelper.applySchematron(ISchematronResource aSchematron, IReadableResource aXML) [THROWS-WHEN] IllegalArgumentException when try-body throws [PATH1] try-body throws -> throw new IllegalArgumentException ("Failed to apply Schematron " + aSch...
true
ok
{"focal": {"class": "SchematronHelper", "name": "applySchematron", "signature": "SchematronOutputType applySchematron(ISchematronResource aSchematron, IReadableResource aXML)", "start_line": 3, "modifiers": "@Nullable public static", "params": [{"name": "aSchematron", "type": "ISchematronResource"}, {"name": "aXML", "t...
23374263_2
class GateTranslator extends SolverDecorator<ISolver> { public IConstr[] it(int y, int x1, int x2) throws ContradictionException { IConstr[] constrs = new IConstr[3]; IVecInt clause = new VecInt(5); // y &lt;=&gt; (x1 -> x2) // y -> (x1 -> x2) clause.push(-y).push(-x1).push(...
gator.it(1, 2, 3); assertTrue(gator.isSatisfiable(new VecInt(new int[] { 1, 2, 3 }))); } }
[FOCAL] public IConstr[] GateTranslator.it(int y, int x1, int x2) [CLASS] class GateTranslator extends SolverDecorator<ISolver> [METRICS] loc=20 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] IConstr processClause(IVecInt clause) [CALLS-EXTERNAL] clause.push(-y).push(-x1).push/1, clause.push(-y)....
/* static context [FOCAL] public IConstr[] GateTranslator.it(int y, int x1, int x2) [EXCEPTIONS] declares ContradictionException [CALLS-INTERNAL] IConstr processClause(IVecInt clause) [NEW] VecInt [CALLS-EXTERNAL] clause.push(-y).push(-x1).push/1, clause.push(-y).push/1, IVecInt.push/1, IVecInt.clear/0, clause.push(x1)...
/* static context [FOCAL] public IConstr[] GateTranslator.it(int y, int x1, int x2) [EXCEPTIONS] declares ContradictionException [CALLS-INTERNAL] IConstr processClause(IVecInt clause) [NEW] VecInt [CALLS-EXTERNAL] clause.push(-y).push(-x1).push/1, clause.push(-y).push/1, IVecInt.push/1, IVecInt.clear/0, clause.push(x1)...
true
ok
{"focal": {"class": "GateTranslator", "name": "it", "signature": "IConstr[] it(int y, int x1, int x2) throws ContradictionException", "start_line": 3, "modifiers": "public", "params": [{"name": "y", "type": "int"}, {"name": "x1", "type": "int"}, {"name": "x2", "type": "int"}], "return_type": "IConstr[]"}, "class_info":...
23437032_19
class ShortPropertyConverter extends AbstractPropertyConverter { @Override public Object convert(String value, Context context) { return Short.valueOf(value); } @Override public boolean supports(Class<?> type); private final ShortPropertyConverter converter; } class ShortPropertyConverterTest { pr...
assertThat((Short) converter.convert( Short.toString(Short.MIN_VALUE), null), is(equalTo(Short.MIN_VALUE))); assertThat((Short) converter.convert("0", null), is(equalTo((short) 0))); assertThat((Short) converter.convert( Short.toString(Short.MAX_VALUE), null), is(e...
[FOCAL] @Override public Object ShortPropertyConverter.convert(String value, Context context) [CLASS] class ShortPropertyConverter extends AbstractPropertyConverter [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Short.valueOf/1 [INPUTS] branches=- | result=value | unused=context [...
/* static context [FOCAL] @Override public Object ShortPropertyConverter.convert(String value, Context context) [INPUTS] branches=- | result=value | unused=context [CALLS-EXTERNAL] Short.valueOf/1 */
/* static context [FOCAL] @Override public Object ShortPropertyConverter.convert(String value, Context context) [INPUTS] branches=- | result=value | unused=context [CALLS-EXTERNAL] Short.valueOf/1 */ class ShortPropertyConverter extends AbstractPropertyConverter { @Override public Object convert(String value, Cont...
true
ok
{"focal": {"class": "ShortPropertyConverter", "name": "convert", "signature": "Object convert(String value, Context context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "value", "type": "String"}, {"name": "context", "type": "Context"}], "return_type": "Object"}, "class_info": {"name": "Shor...
23441735_17
class WDLHooks { public static void onNHPCHandleMaps(NetHandlerPlayClient sender, SPacketMaps packet) { listener.onNHPCHandleMaps(sender, packet); } private WDLHooks(); public static void onWorldClientTick(WorldClient sender); public static void onWorldClientRemoveEntityFromWorld(WorldClient sender, in...
doWithMockHooks(mock -> { makeMockWorld(); SPacketMaps packet = new SPacketMaps(0, (byte)0, false, Collections.emptyList(), new byte[0], 0, 0, 0, 0); clientPlayer.connection.handleMaps(packet); verify(mock).onNHPCHandleMaps(clientPlayer.connection, packet); }); } }
[FOCAL] public static void WDLHooks.onNHPCHandleMaps(NetHandlerPlayClient sender, SPacketMaps packet) [CLASS] class WDLHooks [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] listener.onNHPCHandleMaps/2 [COLLABORATORS] field listener onNHPCHandleMaps/2 [DATAFLOW] packet@param->L3; se...
/* static context [FOCAL] public static void WDLHooks.onNHPCHandleMaps(NetHandlerPlayClient sender, SPacketMaps packet) [COLLABORATORS] field listener onNHPCHandleMaps/2 [CALLS-EXTERNAL] listener.onNHPCHandleMaps/2 */
/* static context [FOCAL] public static void WDLHooks.onNHPCHandleMaps(NetHandlerPlayClient sender, SPacketMaps packet) [COLLABORATORS] field listener onNHPCHandleMaps/2 [CALLS-EXTERNAL] listener.onNHPCHandleMaps/2 */ class WDLHooks { public static void onNHPCHandleMaps(NetHandlerPlayClient sender, SPacketMaps pac...
true
ok
{"focal": {"class": "WDLHooks", "name": "onNHPCHandleMaps", "signature": "void onNHPCHandleMaps(NetHandlerPlayClient sender, SPacketMaps packet)", "start_line": 3, "modifiers": "public static", "params": [{"name": "sender", "type": "NetHandlerPlayClient"}, {"name": "packet", "type": "SPacketMaps"}], "return_type": "voi...
23442872_21
class MessageDispatcher extends CancellableLoop { public void addListener(MessageListener<T> messageListener, int limit) { if (DEBUG) { log.info("Adding listener."); } synchronized (mutex) { EventDispatcher<MessageListener<T>> eventDispatcher = messageListeners.add(messageListener, ...
int numberOfMessages = 100; final CountDownLatch latch = new CountDownLatch(numberOfMessages); MessageDispatcher<std_msgs.Int32> messageDispatcher = new MessageDispatcher<std_msgs.Int32>(lazyMessages, executorService); messageDispatcher.addListener(new MessageListener<std_msgs.Int32>() { ...
[FOCAL] public void MessageDispatcher.addListener(MessageListener<T> messageListener, int limit) [CLASS] class MessageDispatcher extends CancellableLoop [METRICS] loc=12 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=2 [CALLS-INTERNAL] SignalRunnable<MessageListener<T>> newSignalRunnable(LazyMessage<T> lazyMessage)...
/* static context [FOCAL] public void MessageDispatcher.addListener(MessageListener<T> messageListener, int limit) [PATH1] if(DEBUG)=T -> if(latchMode && latchedMessage != null)=T [PATH2] if(DEBUG)=F -> if(latchMode && latchedMessage != null)=F [COLLABORATORS] field messageListeners add/2 [CALLS-INTERNAL] SignalRunnabl...
/* static context [FOCAL] public void MessageDispatcher.addListener(MessageListener<T> messageListener, int limit) [PATH1] if(DEBUG)=T -> if(latchMode && latchedMessage != null)=T [PATH2] if(DEBUG)=F -> if(latchMode && latchedMessage != null)=F [COLLABORATORS] field messageListeners add/2 [CALLS-INTERNAL] SignalRunnabl...
true
ok
{"focal": {"class": "MessageDispatcher", "name": "addListener", "signature": "void addListener(MessageListener<T> messageListener, int limit)", "start_line": 3, "modifiers": "public", "params": [{"name": "messageListener", "type": "MessageListener<T>"}, {"name": "limit", "type": "int"}], "return_type": "void"}, "class_...
23466307_61
class FedoraProducer extends DefaultProducer { protected String getParam(String param) { if (hasParam(param)) { return param; }//end if else { return null; }//end else } public FedoraProducer(Endpoint endpoint); protected bo...
System.out.println("Testing getParam(String, String)"); String expected = "valid"; assertEquals("Parameter should have been returned", expected, this.producer.getParam(expected, "invalid")); assertEquals("Parameter should have been returned", expected, this.producer.getParam(exp...
[FOCAL] protected String FedoraProducer.getParam(String param) [CLASS] class FedoraProducer extends DefaultProducer [METRICS] loc=11 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] boolean hasParam(String param) [PATH1] if(hasParam(param))=T -> return param [PATH2] if(hasParam(param))=F -> return ...
/* static context [FOCAL] protected String FedoraProducer.getParam(String param) [PATH1] if(hasParam(param))=T -> return param [PATH2] if(hasParam(param))=F -> return null [INPUTS] branches=param | result=param [CALLS-INTERNAL] boolean hasParam(String param) */
/* static context [FOCAL] protected String FedoraProducer.getParam(String param) [PATH1] if(hasParam(param))=T -> return param [PATH2] if(hasParam(param))=F -> return null [INPUTS] branches=param | result=param [CALLS-INTERNAL] boolean hasParam(String param) */ class FedoraProducer extends DefaultProducer { protec...
true
ok
{"focal": {"class": "FedoraProducer", "name": "getParam", "signature": "String getParam(String param)", "start_line": 3, "modifiers": "protected", "params": [{"name": "param", "type": "String"}], "return_type": "String"}, "class_info": {"name": "FedoraProducer", "kind": "class", "modifiers": "", "superclass": "DefaultP...
23479380_0
class Flyweight { public static boolean bitSet(final AtomicBuffer buffer, final int offset, final int bitIndex) { return 0 != (buffer.getByte(offset) & (1 << bitIndex)); } public Flyweight(final ByteOrder byteOrder); protected ByteOrder byteOrder(); public int offset(); public in...
final byte bits = (byte)0b1000_0000; final int bufferIndex = 8; final int bitIndex = 7; aBuff.putByte(bufferIndex, bits); for (int i = 0; i < 8; i++) { boolean result = Flyweight.bitSet(aBuff, bufferIndex, i); if (bitIndex == i) { ...
[FOCAL] public static boolean Flyweight.bitSet(AtomicBuffer buffer, int offset, int bitIndex) [CLASS] class Flyweight [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] AtomicBuffer.getByte/1 [INPUTS] branches=- | result=bitIndex, buffer, offset [COLLABORATORS] param buffer:AtomicBuff...
/* static context [FOCAL] public static boolean Flyweight.bitSet(AtomicBuffer buffer, int offset, int bitIndex) [INPUTS] branches=- | result=bitIndex, buffer, offset [COLLABORATORS] param buffer:AtomicBuffer getByte/1 [CALLS-EXTERNAL] AtomicBuffer.getByte/1 */
/* static context [FOCAL] public static boolean Flyweight.bitSet(AtomicBuffer buffer, int offset, int bitIndex) [INPUTS] branches=- | result=bitIndex, buffer, offset [COLLABORATORS] param buffer:AtomicBuffer getByte/1 [CALLS-EXTERNAL] AtomicBuffer.getByte/1 */ class Flyweight { public static boolean bitSet(final A...
true
ok
{"focal": {"class": "Flyweight", "name": "bitSet", "signature": "boolean bitSet(AtomicBuffer buffer, int offset, int bitIndex)", "start_line": 3, "modifiers": "public static", "params": [{"name": "buffer", "type": "AtomicBuffer"}, {"name": "offset", "type": "int"}, {"name": "bitIndex", "type": "int"}], "return_type": "...
23487016_12
class MethodHandlerAccessorFactory implements AccessorFactory { @Override public <BEAN, R, P> Getter<BEAN, R, P> buildGetter(final Field field, ValueProcessor<R, P> valueProcessor) { return new MethodHandlerGetter<>(field, valueProcessor); } @Override public Getter<BEAN, R, P> buildGetter(final Method method, V...
final TestBean testBeanOne = new TestBean(); final Getter<TestBean, Long, Long> longGetter = factory.buildGetter(publicLongField, valueProcessor); testBeanOne.publicLong = 123456l; assertEquals(123456l, longGetter.getValue(testBeanOne).longValue()); } }
[FOCAL] @Override public Getter<BEAN, R, P> MethodHandlerAccessorFactory.buildGetter(Field field, ValueProcessor<R, P> valueProcessor) [CLASS] class MethodHandlerAccessorFactory implements AccessorFactory [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] MethodHandlerGetter<> [INPUTS] branches=...
/* static context [FOCAL] @Override public Getter<BEAN, R, P> MethodHandlerAccessorFactory.buildGetter(Field field, ValueProcessor<R, P> valueProcessor) [INPUTS] branches=- | result=field, valueProcessor [NEW] MethodHandlerGetter<> */
/* static context [FOCAL] @Override public Getter<BEAN, R, P> MethodHandlerAccessorFactory.buildGetter(Field field, ValueProcessor<R, P> valueProcessor) [INPUTS] branches=- | result=field, valueProcessor [NEW] MethodHandlerGetter<> */ class MethodHandlerAccessorFactory implements AccessorFactory { @Override public <...
true
ok
{"focal": {"class": "MethodHandlerAccessorFactory", "name": "buildGetter", "signature": "Getter<BEAN, R, P> buildGetter(Field field, ValueProcessor<R, P> valueProcessor)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "field", "type": "Field"}, {"name": "valueProcessor", "type": "ValueProcessor<...
23491281_1
class OAuthService { public static String getEmail(String accessToken) throws Exception { final String response = get("https://api.github.com/user/emails?access_token", accessToken); ObjectMapper objectMapper = new ObjectMapper(); final ArrayList<Map<String, Object>> emailList = objectMappe...
final String response = OAuthService.getEmail("xxx"); Assert.assertEquals("tommi.s.e.laukkanen@gmail.com", response); } }
[FOCAL] public static String OAuthService.getEmail(String accessToken) [CLASS] class OAuthService [METRICS] loc=14 cc=4 branches=2 loops=1 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] String get(String url, String accessToken) [CALLS-EXTERNAL] ObjectMapper.readValue/2, Map.containsKey/1, Map.get/1 [NEW] ObjectMapper [...
/* static context [FOCAL] public static String OAuthService.getEmail(String accessToken) [PATH1] foreach(Map email : emailList)=T -> if(email.containsKey("email") && email.containsKey("verified") && email.containsKey("primary"))=T -> if((Boolean) email.get("verified") && (Boolean) email.get("primary"))=T -> exit loop -...
/* static context [FOCAL] public static String OAuthService.getEmail(String accessToken) [PATH1] foreach(Map email : emailList)=T -> if(email.containsKey("email") && email.containsKey("verified") && email.containsKey("primary"))=T -> if((Boolean) email.get("verified") && (Boolean) email.get("primary"))=T -> exit loop -...
true
ok
{"focal": {"class": "OAuthService", "name": "getEmail", "signature": "String getEmail(String accessToken) throws Exception", "start_line": 3, "modifiers": "public static", "params": [{"name": "accessToken", "type": "String"}], "return_type": "String"}, "class_info": {"name": "OAuthService", "kind": "class", "modifiers"...
23502577_223
class InternalQueries { @NonNull public static List<Object> unmodifiableNonNullList(@Nullable Object[] args) { return args == null || args.length == 0 ? emptyList() : unmodifiableList(asList(args)); } private InternalQueries(); @NonNull public static List<...
List<String> unmodifiableList = InternalQueries.unmodifiableNonNullList(asList("1", "2", "3")); assertThatListIsImmutable(unmodifiableList); } }
[FOCAL] @NonNull public static List<Object> InternalQueries.unmodifiableNonNullList(Object[] args) [CLASS] class InternalQueries [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] emptyList/0 (inherited), unmodifiableList/1 (inherited), asList/1 (inherited) [INPUTS] branches=- | resul...
/* static context [FOCAL] @NonNull public static List<Object> InternalQueries.unmodifiableNonNullList(Object[] args) [INPUTS] branches=- | result=args [CALLS-EXTERNAL] emptyList/0 (inherited), unmodifiableList/1 (inherited), asList/1 (inherited) */
/* static context [FOCAL] @NonNull public static List<Object> InternalQueries.unmodifiableNonNullList(Object[] args) [INPUTS] branches=- | result=args [CALLS-EXTERNAL] emptyList/0 (inherited), unmodifiableList/1 (inherited), asList/1 (inherited) */ class InternalQueries { @NonNull public static List<Object> un...
true
ok
{"focal": {"class": "InternalQueries", "name": "unmodifiableNonNullList", "signature": "List<Object> unmodifiableNonNullList(Object[] args)", "start_line": 3, "modifiers": "@NonNull public static", "params": [{"name": "args", "type": "Object[]"}], "return_type": "List<Object>"}, "class_info": {"name": "InternalQueries"...
23505879_79
class CudaFloatDataBuffer extends BaseCudaDataBuffer { @Override public double getDouble(long i) { return super.getFloat(i); } public CudaFloatDataBuffer(Pointer pointer, Indexer indexer, long length); public CudaFloatDataBuffer(long length); public CudaFloatDataBuffer(long length, ...
DataBuffer create = Nd4j.createBuffer(new double[]{1,2,3,4},2); assertEquals(2,create.length()); assertEquals(4,create.underlyingLength()); assertEquals(2,create.offset()); assertEquals(3,create.getDouble(0),1e-1); assertEquals(4,create.getDouble(1),1e-1); } }
[FOCAL] @Override public double CudaFloatDataBuffer.getDouble(long i) [CLASS] class CudaFloatDataBuffer extends BaseCudaDataBuffer [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] BaseCudaDataBuffer.getFloat/1 [INPUTS] branches=- | result=i [DATAFLOW] i@param->L3 [CLASS-MEMBERS] Cud...
/* static context [FOCAL] @Override public double CudaFloatDataBuffer.getDouble(long i) [INPUTS] branches=- | result=i [CALLS-EXTERNAL] BaseCudaDataBuffer.getFloat/1 */
/* static context [FOCAL] @Override public double CudaFloatDataBuffer.getDouble(long i) [INPUTS] branches=- | result=i [CALLS-EXTERNAL] BaseCudaDataBuffer.getFloat/1 */ class CudaFloatDataBuffer extends BaseCudaDataBuffer { @Override public double getDouble(long i) { return super.getFloat(i); } ...
true
ok
{"focal": {"class": "CudaFloatDataBuffer", "name": "getDouble", "signature": "double getDouble(long i)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "i", "type": "long"}], "return_type": "double"}, "class_info": {"name": "CudaFloatDataBuffer", "kind": "class", "modifiers": "", "superclass": "B...
23556341_8
class RpSyncService { public static boolean shouldSync(Rp rp) { if (rp == null || !rp.isSyncClientFromOp()) return false; if (rp.getLastSynced() == null) return true; if ((Utils.addTimeToDate(rp.getLastSynced(), rp.getSyncClientPeriodInSeconds(), Calendar.SECOND).g...
Rp rp = new Rp(); rp.setSyncClientFromOp(true); rp.setSyncClientPeriodInSeconds(5 * 60); assertTrue(rpSyncService.shouldSync(rp)); } }
[FOCAL] public static boolean RpSyncService.shouldSync(Rp rp) [CLASS] class RpSyncService [METRICS] loc=12 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=1 [CALLS-EXTERNAL] Rp.isSyncClientFromOp/0, Rp.getLastSynced/0, Utils.addTimeToDate(rp.getLastSynced(), rp.getSyncClientP....getTime/0, Utils.addTimeToDate/3, Rp....
/* static context [FOCAL] public static boolean RpSyncService.shouldSync(Rp rp) [PATH1] if(rp == null || !rp.isSyncClientFromOp())=F -> if(rp.getLastSynced() == null)=F -> if(((Utils.addTimeToDate(rp.getLastSynced(), rp.getSyncClientPeriodInSeconds(), Calendar.SECOND).getTime() < new Date()....)=T -> return true [PATH2...
/* static context [FOCAL] public static boolean RpSyncService.shouldSync(Rp rp) [PATH1] if(rp == null || !rp.isSyncClientFromOp())=F -> if(rp.getLastSynced() == null)=F -> if(((Utils.addTimeToDate(rp.getLastSynced(), rp.getSyncClientPeriodInSeconds(), Calendar.SECOND).getTime() < new Date()....)=T -> return true [PATH2...
true
ok
{"focal": {"class": "RpSyncService", "name": "shouldSync", "signature": "boolean shouldSync(Rp rp)", "start_line": 3, "modifiers": "public static", "params": [{"name": "rp", "type": "Rp"}], "return_type": "boolean"}, "class_info": {"name": "RpSyncService", "kind": "class", "modifiers": "", "superclass": null, "interfac...
23597915_2
class MuleInstallMojo extends AbstractMuleMojo { public void renameFile(File orig, File dest) throws MojoExecutionException { try { Files.move(orig.toPath(), dest.toPath(), REPLACE_EXISTING); } catch (IOException e) { throw new MojoExecutionException(String.format("Could not...
String origFileName = "file.temp"; String destFileName = "file.zip"; File orig = temp.newFile(origFileName); File dest = new File(temp.getRoot(), destFileName); assertThat("Origin file should exist", orig.exists()); assertThat("Destination file should not exist", !dest.exists()); mojo.ren...
[FOCAL] public void MuleInstallMojo.renameFile(File orig, File dest) [CLASS] class MuleInstallMojo extends AbstractMuleMojo [METRICS] loc=8 cc=2 branches=0 loops=0 returns=0 throws=1 nesting=1 [CALLS-EXTERNAL] Files.move/3, File.toPath/0, String.format/3, File.getAbsolutePath/0 [NEW] MojoExecutionException [EXCEPTIONS]...
/* static context [FOCAL] public void MuleInstallMojo.renameFile(File orig, File dest) [THROWS-WHEN] MojoExecutionException when try-body throws [PATH1] try-body throws -> throw new MojoExecutionException(String.format("Could not rename %1s to %... [INPUTS] branches=- | result=dest, orig [COLLABORATORS] param orig:File...
/* static context [FOCAL] public void MuleInstallMojo.renameFile(File orig, File dest) [THROWS-WHEN] MojoExecutionException when try-body throws [PATH1] try-body throws -> throw new MojoExecutionException(String.format("Could not rename %1s to %... [INPUTS] branches=- | result=dest, orig [COLLABORATORS] param orig:File...
true
ok
{"focal": {"class": "MuleInstallMojo", "name": "renameFile", "signature": "void renameFile(File orig, File dest) throws MojoExecutionException", "start_line": 3, "modifiers": "public", "params": [{"name": "orig", "type": "File"}, {"name": "dest", "type": "File"}], "return_type": "void"}, "class_info": {"name": "MuleIns...
23610469_295
class TypeUtils { public static boolean isArray(Type type) { Utils.checkNotNull(type, "type"); boolean array; if (type instanceof Class) { array = ((Class<?>) type).isArray(); } else if (type instanceof GenericArrayType) { array = true; } else { array = false; } return array...
assertFalse(TypeUtils.isArray(Integer.class)); } }
[FOCAL] public static boolean TypeUtils.isArray(Type type) [CLASS] class TypeUtils [METRICS] loc=21 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] Utils.checkNotNull/2, ((Class<?>) type).isArray/0 [PATH1] if(type instanceof Class)=F -> if(type instanceof GenericArrayType)=T -> return array [PATH2...
/* static context [FOCAL] public static boolean TypeUtils.isArray(Type type) [PATH1] if(type instanceof Class)=F -> if(type instanceof GenericArrayType)=T -> return array [PATH2] if(type instanceof Class)=T -> return array [PATH3] if(type instanceof Class)=F -> if(type instanceof GenericArrayType)=F -> return array [IN...
/* static context [FOCAL] public static boolean TypeUtils.isArray(Type type) [PATH1] if(type instanceof Class)=F -> if(type instanceof GenericArrayType)=T -> return array [PATH2] if(type instanceof Class)=T -> return array [PATH3] if(type instanceof Class)=F -> if(type instanceof GenericArrayType)=F -> return array [IN...
true
ok
{"focal": {"class": "TypeUtils", "name": "isArray", "signature": "boolean isArray(Type type)", "start_line": 3, "modifiers": "public static", "params": [{"name": "type", "type": "Type"}], "return_type": "boolean"}, "class_info": {"name": "TypeUtils", "kind": "class", "modifiers": "", "superclass": null, "interfaces": n...
23615757_18
class TimedLRUCache implements Cache<K, V> { @Override public void clear() { entryTimes.clear(); keys.clear(); entries.clear(); } public TimedLRUCache(final int capacity, final long storeTime); @Override public V get(K key); @Override public synchronized void put(K key, V value); private boolean isExpi...
final int capacity = 2; final long storeTime = 1000; final String[] keys = new String[]{ "test1", "test2" }; final Integer[] values = new Integer[]{ 1, 2 }; Cache<String, Integer> cache = new TimedLRUCache<>(capacity, storeTime); for (int i = 0; i < keys.length; i ++) { cache.put(keys[i], values[i]); ...
[FOCAL] @Override public void TimedLRUCache.clear() [CLASS] class TimedLRUCache implements Cache<K, V> [METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] entryTimes.clear/0, keys.clear/0, entries.clear/0 [COLLABORATORS] field entryTimes clear/0; field keys clear/0; field entries clear...
/* static context [FOCAL] @Override public void TimedLRUCache.clear() [COLLABORATORS] field entryTimes clear/0; field keys clear/0; field entries clear/0 [CALLS-EXTERNAL] entryTimes.clear/0, keys.clear/0, entries.clear/0 */
/* static context [FOCAL] @Override public void TimedLRUCache.clear() [COLLABORATORS] field entryTimes clear/0; field keys clear/0; field entries clear/0 [CALLS-EXTERNAL] entryTimes.clear/0, keys.clear/0, entries.clear/0 */ class TimedLRUCache implements Cache<K, V> { @Override public void clear() { entryTimes.cle...
true
ok
{"focal": {"class": "TimedLRUCache", "name": "clear", "signature": "void clear()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "TimedLRUCache", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Cache<K, V>", "fields": [], "members": [...
23623214_56
class PropertiesLightblueClientConfiguration { public static LightblueClientConfiguration fromObject(Properties properties) { LightblueClientConfiguration config = new LightblueClientConfiguration(); config.setCaFilePath(properties.getProperty(CA_FILE_PATH_KEY)); config.setCertFilePath(pro...
Properties properties = new Properties(); properties.setProperty("compression", "NONE"); LightblueClientConfiguration config = PropertiesLightblueClientConfiguration.fromObject(properties); assertEquals(Compression.NONE, config.getCompression()); } }
[FOCAL] public static LightblueClientConfiguration PropertiesLightblueClientConfiguration.fromObject(Properties properties) [CLASS] class PropertiesLightblueClientConfiguration [METRICS] loc=29 cc=5 branches=4 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] LightblueClientConfiguration.setCaFilePath/1, Properties...
/* static context [FOCAL] public static LightblueClientConfiguration PropertiesLightblueClientConfiguration.fromObject(Properties properties) [PATH1] if(properties.containsKey(COMPRESSION))=T -> if(properties.containsKey(MONGO_READ_PREFERENCE))=T -> if(properties.containsKey(MONGO_WRITE_CONCERN))=T -> if(properties.con...
/* static context [FOCAL] public static LightblueClientConfiguration PropertiesLightblueClientConfiguration.fromObject(Properties properties) [PATH1] if(properties.containsKey(COMPRESSION))=T -> if(properties.containsKey(MONGO_READ_PREFERENCE))=T -> if(properties.containsKey(MONGO_WRITE_CONCERN))=T -> if(properties.con...
true
ok
{"focal": {"class": "PropertiesLightblueClientConfiguration", "name": "fromObject", "signature": "LightblueClientConfiguration fromObject(Properties properties)", "start_line": 3, "modifiers": "public static", "params": [{"name": "properties", "type": "Properties"}], "return_type": "LightblueClientConfiguration"}, "cla...
23653549_0
class CallStats { public void initialize(final int appId, final String appSecret, final String bridgeId, final ServerInfo serverInfo, final CallStatsInitListener callStatsInitListener) { if (StringUtils.isBlank(appSecret)) { logger.error("intialize: Arguments cannot be null "); throw new Illega...
callstatslib.initialize(appId, appSecret, "jit.si.345", serverInfo, listener); try { Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); } String msg = "SDK authentication successful"; Mockito.verify(listener).onInitialized(msg); } }
[FOCAL] public void CallStats.initialize(int appId, String appSecret, String bridgeId, ServerInfo serverInfo, CallStatsInitListener callStatsInitListener) [CLASS] class CallStats [METRICS] loc=9 cc=2 branches=1 loops=0 returns=0 throws=1 nesting=1 [CALLS-INTERNAL] void initialize(int appId, ICallStatsTokenGenerator tok...
/* static context [FOCAL] public void CallStats.initialize(int appId, String appSecret, String bridgeId, ServerInfo serverInfo, CallStatsInitListener callStatsInitListener) [THROWS-WHEN] IllegalArgumentException when StringUtils.isBlank(appSecret) [PATH1] if(StringUtils.isBlank(appSecret))=T -> throw new IllegalArgumen...
/* static context [FOCAL] public void CallStats.initialize(int appId, String appSecret, String bridgeId, ServerInfo serverInfo, CallStatsInitListener callStatsInitListener) [THROWS-WHEN] IllegalArgumentException when StringUtils.isBlank(appSecret) [PATH1] if(StringUtils.isBlank(appSecret))=T -> throw new IllegalArgumen...
true
ok
{"focal": {"class": "CallStats", "name": "initialize", "signature": "void initialize(int appId, String appSecret, String bridgeId, ServerInfo serverInfo, CallStatsInitListener callStatsInitListener)", "start_line": 3, "modifiers": "public", "params": [{"name": "appId", "type": "int"}, {"name": "appSecret", "type": "Str...
23680695_16
class IndexReWriter { public void optimizeIndecies(@Nonnull final List<String> intFields, @Nonnull final List<String> stringFields, @Nonnull final FlamdexWriter w) throws IOException, I...
/* make session 1 */ MockFlamdexReader r1 = new MockFlamdexReader(Arrays.asList("if1", "if2", "if3"), Arrays.asList("sf1"), Arrays.asList("if1", "if2"), 10); r1.addIntTerm("if1", 0, 0); r1.addIntTerm("if1", 1, 1); r1.addIntTe...
[FOCAL] public void IndexReWriter.optimizeIndecies(List<String> intFields, List<String> stringFields, FlamdexWriter w) [CLASS] class IndexReWriter [METRICS] loc=96 cc=15 branches=4 loops=10 returns=0 throws=0 nesting=5 [CALLS-INTERNAL] List<int[]> constructPerSessionNewToOldIdMappings(int[] oldToNewDocIdMapping); int[]...
class IndexReWriter { public void optimizeIndecies(@Nonnull final List<String> intFields, @Nonnull final List<String> stringFields, @Nonnull final FlamdexWriter w) throws IOException, I...
false
ok
{"focal": {"class": "IndexReWriter", "name": "optimizeIndecies", "signature": "void optimizeIndecies(List<String> intFields, List<String> stringFields, FlamdexWriter w) throws IOException, ImhotepOutOfMemoryException", "start_line": 3, "modifiers": "public", "params": [{"name": "intFields", "type": "List<String>"}, {"n...
23686634_8
class LoadingSupplier implements Supplier<T> { @Override public final T get() { try { previous = load(); } catch (Exception e) { LoggerFactory.getLogger(LoadingSupplier.class).error("Error looking up supplier value!", e); } return previous; } abs...
System.out.println("SupplierCache.permanent"); CacheManager cacheManager = CacheManager.createIfNeeded("TestCacheManager"); SupplierCache<Integer> cache = cacheManager.supplierCache("Groups", new RecordingSupplier(), 1, TimeUnit.HOURS); assertE...
[FOCAL] @Override public final T LoadingSupplier.get() [CLASS] class LoadingSupplier implements Supplier<T> [METRICS] loc=9 cc=2 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] T load() [CALLS-EXTERNAL] LoggerFactory.getLogger(LoadingSupplier.class).error/2, LoggerFactory.getLogger/1 [EXCEPTIONS] catch...
/* static context [FOCAL] @Override public final T LoadingSupplier.get() [PATH1] try-body throws -> return previous [EXCEPTIONS] catches Exception e [CALLS-INTERNAL] T load() [CALLS-EXTERNAL] LoggerFactory.getLogger(LoadingSupplier.class).error/2, LoggerFactory.getLogger/1 */
/* static context [FOCAL] @Override public final T LoadingSupplier.get() [PATH1] try-body throws -> return previous [EXCEPTIONS] catches Exception e [CALLS-INTERNAL] T load() [CALLS-EXTERNAL] LoggerFactory.getLogger(LoadingSupplier.class).error/2, LoggerFactory.getLogger/1 */ class LoadingSupplier implements Supplier<T...
true
ok
{"focal": {"class": "LoadingSupplier", "name": "get", "signature": "T get()", "start_line": 3, "modifiers": "@Override public final", "params": [], "return_type": "T"}, "class_info": {"name": "LoadingSupplier", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Supplier<T>", "fields": [], "members": [...
23703244_2
class Batch implements IBatch { public String getCurrentItem() { if (monitor == null) { return null; } Object currentItem = monitor.getCurrentItem(); if (currentItem == null) { return null; } return currentItem.toString(); } public Batch(String uuid); public Batch(String uuid, String name, St...
// assert with response with no monitor assertNull(new Batch("12345", "batchName", "batchGroup").getCurrentItem()); Batch batch = new Batch("12345"); assertNull(batch.getCurrentItem()); // create the progress monitor InProcessBatchProgressMonitor mockedProgressMonitor = mock(InProcessBatchProgressMonitor....
[FOCAL] public String Batch.getCurrentItem() [CLASS] class Batch implements IBatch [METRICS] loc=11 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1 [CALLS-EXTERNAL] monitor.getCurrentItem/0, Object.toString/0 [PATH1] if(monitor == null)=F -> if(currentItem == null)=T -> return null [PATH2] if(monitor == null)=F ->...
/* static context [FOCAL] public String Batch.getCurrentItem() [PATH1] if(monitor == null)=F -> if(currentItem == null)=T -> return null [PATH2] if(monitor == null)=F -> if(currentItem == null)=F -> return currentItem.toString() [PATH3] if(monitor == null)=T -> return null [COLLABORATORS] field monitor getCurrentItem/0...
/* static context [FOCAL] public String Batch.getCurrentItem() [PATH1] if(monitor == null)=F -> if(currentItem == null)=T -> return null [PATH2] if(monitor == null)=F -> if(currentItem == null)=F -> return currentItem.toString() [PATH3] if(monitor == null)=T -> return null [COLLABORATORS] field monitor getCurrentItem/0...
true
ok
{"focal": {"class": "Batch", "name": "getCurrentItem", "signature": "String getCurrentItem()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "Batch", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "IBatch", "fields": [], "members": [{"name": ...
23714731_0
class BooleanAlgebra { public boolean hasNDistinctWitnesses(P predicate, Integer numOfWitnesses) { // generate as many witnesses as requested for (int witnessID = 0; witnessID < numOfWitnesses; witnessID++) { try { // generate a witness for the predicate ...
CharPred integers = new CharPred('0', '9'); assertTrue(ba.hasNDistinctWitnesses(integers, 5)); assertTrue(ba.hasNDistinctWitnesses(integers, 0)); assertTrue(ba.hasNDistinctWitnesses(integers, 10)); assertFalse(ba.hasNDistinctWitnesses(integers, 11)); } }
[FOCAL] public boolean BooleanAlgebra.hasNDistinctWitnesses(P predicate, Integer numOfWitnesses) [CLASS] class BooleanAlgebra [METRICS] loc=24 cc=4 branches=1 loops=1 returns=3 throws=0 nesting=3 [CALLS-INTERNAL] P MkAnd(P p1, P p2); P MkAtom(S s); P MkNot(P p); S generateWitness(P p1) [CALLS-EXTERNAL] TimeoutException...
/* static context [FOCAL] public boolean BooleanAlgebra.hasNDistinctWitnesses(P predicate, Integer numOfWitnesses) [PATH1] for(witnessID < numOfWitnesses)=T -> if(witness != null)=T -> exit loop -> return true [PATH2] for(witnessID < numOfWitnesses)=T -> try-body throws -> return false [PATH3] for(witnessID < numOfWitn...
/* static context [FOCAL] public boolean BooleanAlgebra.hasNDistinctWitnesses(P predicate, Integer numOfWitnesses) [PATH1] for(witnessID < numOfWitnesses)=T -> if(witness != null)=T -> exit loop -> return true [PATH2] for(witnessID < numOfWitnesses)=T -> try-body throws -> return false [PATH3] for(witnessID < numOfWitn...
true
ok
{"focal": {"class": "BooleanAlgebra", "name": "hasNDistinctWitnesses", "signature": "boolean hasNDistinctWitnesses(P predicate, Integer numOfWitnesses)", "start_line": 3, "modifiers": "public", "params": [{"name": "predicate", "type": "P"}, {"name": "numOfWitnesses", "type": "Integer"}], "return_type": "boolean"}, "cla...
23737510_18
class PartialUriTemplate { public PartialUriTemplateComponents expand(Object... parameters) { List<String> variableNames = getVariableNames(); Map<String, Object> parameterMap = new LinkedHashMap<String, Object>(); int i = 0; for (String variableName : variableNames) { ...
final PartialUriTemplate template = new PartialUriTemplate("http://example" + ".com/events{/city}?eventName=Revo+Tour&location=Schlachthof{#section}"); Map<String, Object> val = new HashMap<String, Object>(); val.put("city", "Wiesbaden"); val.put("...
[FOCAL] public PartialUriTemplateComponents PartialUriTemplate.expand(Object... parameters) [CLASS] class PartialUriTemplate [METRICS] loc=14 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] List<String> getVariableNames(); PartialUriTemplateComponents getUriTemplateComponents(Map<String, ?> parame...
/* static context [FOCAL] public PartialUriTemplateComponents PartialUriTemplate.expand(Object... parameters) [PATH1] foreach(String variableName : variableNames)=T -> if(i < parameters.length)=T -> exit loop -> return getUriTemplateComponents(parameterMap, Collections.<String>emptyLis... [PATH2] foreach(String variabl...
/* static context [FOCAL] public PartialUriTemplateComponents PartialUriTemplate.expand(Object... parameters) [PATH1] foreach(String variableName : variableNames)=T -> if(i < parameters.length)=T -> exit loop -> return getUriTemplateComponents(parameterMap, Collections.<String>emptyLis... [PATH2] foreach(String variabl...
true
ok
{"focal": {"class": "PartialUriTemplate", "name": "expand", "signature": "PartialUriTemplateComponents expand(Object... parameters)", "start_line": 3, "modifiers": "public", "params": [{"name": "parameters", "type": "Object..."}], "return_type": "PartialUriTemplateComponents"}, "class_info": {"name": "PartialUriTemplat...
23744385_373
class TimeSeries extends Series implements Cloneable, Serializable { public Number getValue(int index) { return getRawDataItem(index).getValue(); } public TimeSeries(Comparable name); public TimeSeries(Comparable name, String domain, String range); public String getDomainDescription(); ...
Number value1 = this.seriesA.getValue(new Year(1999)); assertNull(value1); int value2 = this.seriesA.getValue(new Year(2000)).intValue(); assertEquals(102000, value2); } }
[FOCAL] public Number TimeSeries.getValue(int index) [CLASS] class TimeSeries extends Series implements Cloneable, Serializable [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] TimeSeriesDataItem getRawDataItem(int index) [CALLS-EXTERNAL] getRawDataItem(index).getValue/0 [INPUTS] br...
/* static context [FOCAL] public Number TimeSeries.getValue(int index) [INPUTS] branches=- | result=index [CALLS-INTERNAL] TimeSeriesDataItem getRawDataItem(int index) [CALLS-EXTERNAL] getRawDataItem(index).getValue/0 */
/* static context [FOCAL] public Number TimeSeries.getValue(int index) [INPUTS] branches=- | result=index [CALLS-INTERNAL] TimeSeriesDataItem getRawDataItem(int index) [CALLS-EXTERNAL] getRawDataItem(index).getValue/0 */ class TimeSeries extends Series implements Cloneable, Serializable { public Number getValue(in...
true
ok
{"focal": {"class": "TimeSeries", "name": "getValue", "signature": "Number getValue(int index)", "start_line": 3, "modifiers": "public", "params": [{"name": "index", "type": "int"}], "return_type": "Number"}, "class_info": {"name": "TimeSeries", "kind": "class", "modifiers": "", "superclass": "Series", "interfaces": "C...
23750297_2
class CheckOpenServiceFilter implements Filter, InitializingBean { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletResponse httpServletResponse = (HttpServletResponse)response; HttpServletRequest httpServletR...
MockHttpServletRequest request = new MockHttpServletRequest(); MockHttpServletResponse response = new MockHttpServletResponse(); response.setCharacterEncoding("UTF-8"); try { request.setMethod("POST"); request.addParameter("method", "user.add"); request.addParameter("version", "1.0.0"); filter.do...
[FOCAL] @Override public void CheckOpenServiceFilter.doFilter(ServletRequest request, ServletResponse response, FilterChain chain) [CLASS] class CheckOpenServiceFilter implements Filter, InitializingBean [METRICS] loc=84 cc=15 branches=14 loops=0 returns=0 throws=0 nesting=5 [CALLS-INTERNAL] Locale getLocale(ServletReq...
/* static context [FOCAL] @Override public void CheckOpenServiceFilter.doFilter(ServletRequest request, ServletResponse response, FilterChain chain) [PATH2] if(!StringUtils.hasText(format))=T -> if(!StringUtils.hasText(appkey))=T -> if(mainError == null)#1=T -> if(!Constants.HTTP_METHOD_GET.equals(httpMethod) && !Const...
/* static context [FOCAL] @Override public void CheckOpenServiceFilter.doFilter(ServletRequest request, ServletResponse response, FilterChain chain) [PATH2] if(!StringUtils.hasText(format))=T -> if(!StringUtils.hasText(appkey))=T -> if(mainError == null)#1=T -> if(!Constants.HTTP_METHOD_GET.equals(httpMethod) && !Const...
true
ok
{"focal": {"class": "CheckOpenServiceFilter", "name": "doFilter", "signature": "void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "ServletRequest"}, {"name": "...
23771701_0
class AuctionDataItemReader extends AbstractAuctionFileProcess implements ItemReader { @Override public Object readItem() { while (parser.hasNext()) { Auction auction = new Auction(); if (readAuctionItem(auction)) { return auction; } } ...
itemReader.open(null); int count = 0; Auction auction; while ((auction = ((Auction) itemReader.readItem())) != null) { count ++; assertNotNull(auction); AuctionFile auctionFile = AuctionFile.findById(1L); itemProcessor.getContext().setAuc...
[FOCAL] @Override public Object AuctionDataItemReader.readItem() [CLASS] class AuctionDataItemReader extends AbstractAuctionFileProcess implements ItemReader [METRICS] loc=10 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2 [CALLS-INTERNAL] boolean readAuctionItem(Auction auction) [CALLS-EXTERNAL] parser.hasNext/0 ...
/* static context [FOCAL] @Override public Object AuctionDataItemReader.readItem() [PATH1] while(parser.hasNext())=T -> if(readAuctionItem(auction))=F -> exit loop -> return null [PATH2] while(parser.hasNext())=T -> if(readAuctionItem(auction))=T -> return auction [PATH3] while(parser.hasNext())=F -> return null [COLLA...
/* static context [FOCAL] @Override public Object AuctionDataItemReader.readItem() [PATH1] while(parser.hasNext())=T -> if(readAuctionItem(auction))=F -> exit loop -> return null [PATH2] while(parser.hasNext())=T -> if(readAuctionItem(auction))=T -> return auction [PATH3] while(parser.hasNext())=F -> return null [COLLA...
true
ok
{"focal": {"class": "AuctionDataItemReader", "name": "readItem", "signature": "Object readItem()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Object"}, "class_info": {"name": "AuctionDataItemReader", "kind": "class", "modifiers": "", "superclass": "AbstractAuctionFileProcess", "inte...
23786714_6
class SwrveDeeplinkManager { protected void handleDeeplink(Bundle bundle) { if (bundle != null) { String url = bundle.getString(SWRVE_FB_TARGET_URL); if (SwrveHelper.isNotNullOrEmpty(url)) { Uri data = Uri.parse(url); this.handleDeeplink(data, SWRVE_A...
// 1. Test generic_campaign_event queued / sent // 2. Test message was shown // 3. Test message details were written to cache (for QA purposes) Bundle bundle = new Bundle(); bundle.putString("target_url","swrve://app?ad_content=295411&ad_source=facebook&ad_campaign=BlackFriday"...
[FOCAL] protected void SwrveDeeplinkManager.handleDeeplink(Bundle bundle) [CLASS] class SwrveDeeplinkManager [METRICS] loc=15 cc=4 branches=3 loops=0 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] void handleDeeplink(Uri data, String actionType); void loadCampaign(String campaignID, String actionType) [CALLS-EXTERNAL] B...
/* static context [FOCAL] protected void SwrveDeeplinkManager.handleDeeplink(Bundle bundle) [PATH1] if(bundle != null)=T -> if(SwrveHelper.isNotNullOrEmpty(url))=T -> return [PATH2] if(bundle != null)=T -> if(SwrveHelper.isNotNullOrEmpty(url))=F -> if(SwrveHelper.isNotNullOrEmpty(swrveCampaignId))=T [PATH3] if(bundle !...
/* static context [FOCAL] protected void SwrveDeeplinkManager.handleDeeplink(Bundle bundle) [PATH1] if(bundle != null)=T -> if(SwrveHelper.isNotNullOrEmpty(url))=T -> return [PATH2] if(bundle != null)=T -> if(SwrveHelper.isNotNullOrEmpty(url))=F -> if(SwrveHelper.isNotNullOrEmpty(swrveCampaignId))=T [PATH3] if(bundle !...
true
ok
{"focal": {"class": "SwrveDeeplinkManager", "name": "handleDeeplink", "signature": "void handleDeeplink(Bundle bundle)", "start_line": 3, "modifiers": "protected", "params": [{"name": "bundle", "type": "Bundle"}], "return_type": "void"}, "class_info": {"name": "SwrveDeeplinkManager", "kind": "class", "modifiers": "", "...
23803268_8
class SnapshotFileReader { public DataState readFuzzySnapshot() throws CRCValidationException, IOException { DataTree dt = new DataTree(); Map<Long, Integer> sessions = new HashMap<Long, Integer>(); InputStream snapIS = null; CheckedInputStream crcIn = null; try { ...
try { SnapshotFileReader r = new SnapshotFileReader(snap1, TS1); DataState snapshot; DataState fuzzyDataState = r.readFuzzySnapshot(); assertEquals(69,fuzzyDataState.getLastZxid()); Map<Long, Integer> sessions = fuzzyDataState.getSessions(); ...
[FOCAL] public DataState SnapshotFileReader.readFuzzySnapshot() [CLASS] class SnapshotFileReader [METRICS] loc=85 cc=11 branches=7 loops=2 returns=1 throws=3 nesting=2 [CALLS-EXTERNAL] Logger.info/1, getArchive/1 (inherited), FileHeader.deserialize/2, FileHeader.getMagic/0, InputArchive.readInt/1, InputArchive.readLong...
/* static context [FOCAL] public DataState SnapshotFileReader.readFuzzySnapshot() [PATH1] if(header.getMagic() != SNAP_MAGIC)=F -> while(count > 0)=T -> exit loop -> if(val != checkSum)=F -> if(snapIS != null)=T -> if(crcIn != null)=T -> while(it.hasNext())=T -> if(tempZxid > lastZxid)#1=T -> if(tempZxid > lastZxid)#2=...
/* static context [FOCAL] public DataState SnapshotFileReader.readFuzzySnapshot() [PATH1] if(header.getMagic() != SNAP_MAGIC)=F -> while(count > 0)=T -> exit loop -> if(val != checkSum)=F -> if(snapIS != null)=T -> if(crcIn != null)=T -> while(it.hasNext())=T -> if(tempZxid > lastZxid)#1=T -> if(tempZxid > lastZxid)#2=...
true
ok
{"focal": {"class": "SnapshotFileReader", "name": "readFuzzySnapshot", "signature": "DataState readFuzzySnapshot() throws CRCValidationException, IOException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "DataState"}, "class_info": {"name": "SnapshotFileReader", "kind": "class", "modifiers": ""...
23813195_25
class Burst { public static String friendlyName(Enum<?>[] arguments) { return friendlyName(arguments, new Annotation[0][0]); } private Burst(); public static Enum<?>[][] explodeArguments(TestConstructor constructor); public static Enum<?>[][] explodeArguments(Method method); public static String fri...
String actual = Burst.friendlyName(new Enum<?>[0]); assertThat(actual).isEqualTo(""); } }
[FOCAL] public static String Burst.friendlyName(Enum<?>[] arguments) [CLASS] class Burst [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String friendlyName(Enum<?>[] arguments, Annotation[][] argumentAnnotations) [INPUTS] branches=- | result=arguments [DATAFLOW] arguments@param->L...
/* static context [FOCAL] public static String Burst.friendlyName(Enum<?>[] arguments) [INPUTS] branches=- | result=arguments [CALLS-INTERNAL] String friendlyName(Enum<?>[] arguments, Annotation[][] argumentAnnotations) */
/* static context [FOCAL] public static String Burst.friendlyName(Enum<?>[] arguments) [INPUTS] branches=- | result=arguments [CALLS-INTERNAL] String friendlyName(Enum<?>[] arguments, Annotation[][] argumentAnnotations) */ class Burst { public static String friendlyName(Enum<?>[] arguments) { return friendlyName...
true
ok
{"focal": {"class": "Burst", "name": "friendlyName", "signature": "String friendlyName(Enum<?>[] arguments)", "start_line": 3, "modifiers": "public static", "params": [{"name": "arguments", "type": "Enum<?>[]"}], "return_type": "String"}, "class_info": {"name": "Burst", "kind": "class", "modifiers": "", "superclass": n...
23813803_2
class UserHandler extends Handler { @Doc("Sign up a user") @GET @Path("/signup") @HandleErrors({ @HandleError(code = 20000, exception = UsernameDuplicateException.class, description = "Username duplicate") }) public User signup( @QueryParam("username") @R...
User user = UserHandlerTester.signup("user1", "pass1", null, User.class); assertNotNull(user.id); assertEquals("user1", user.username); assertNull(user.password); } }
[FOCAL] @Doc("Sign up a user") @GET @Path("/signup") @HandleErrors({ @HandleError(code = 20000, exception = UsernameDuplicate... User UserHandler.signup(String username, String password, String email) [CLASS] class UserHandler extends Handler [METRICS] loc=28 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-...
/* static context [FOCAL] @Doc("Sign up a user") @GET @Path("/signup") @HandleErrors({ @HandleError(code = 20000, exception = UsernameDuplicate... User UserHandler.signup(String username, String password, String email) [THROWS-WHEN] UsernameDuplicateException when user != null [PATH1] if(user != null)=T -> throw new Us...
/* static context [FOCAL] @Doc("Sign up a user") @GET @Path("/signup") @HandleErrors({ @HandleError(code = 20000, exception = UsernameDuplicate... User UserHandler.signup(String username, String password, String email) [THROWS-WHEN] UsernameDuplicateException when user != null [PATH1] if(user != null)=T -> throw new Us...
true
ok
{"focal": {"class": "UserHandler", "name": "signup", "signature": "User signup(String username, String password, String email) throws UsernameDuplicateException", "start_line": 3, "modifiers": "@Doc(\"Sign up a user\") @GET @Path(\"/signup\") @HandleErrors({ @HandleError(code = 20000, exception = UsernameDuplicate...",...
23831132_127
class MapUtils { public static <K, V extends Comparable<? super V>> Map<K, V> sortByValue( Map<K, V> map) { return sortByValue(map, false); } public static K keyOfHighestValue(Map<K, V> map); public static LinkedHashMap<K, V> keysOfHighestValues( Map<K, V> map, int topN...
Random random = new Random(System.currentTimeMillis()); Map<String, Integer> testMap = new HashMap<String, Integer>(1000); for (int i = 0; i < 1000; ++i) { testMap.put("SomeString" + random.nextInt(), random.nextInt()); } testMap = MapUtils.sortByValue(testMap, true)...
[FOCAL] public static Map<K, V> MapUtils.sortByValue(Map<K, V> map) [CLASS] class MapUtils [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Map<K, V> sortByValue(Map<K, V> map, boolean reverse) [INPUTS] branches=- | result=map [DATAFLOW] map@param->L3 [CLASS-MEMBERS] K keyOfHighestV...
/* static context [FOCAL] public static Map<K, V> MapUtils.sortByValue(Map<K, V> map) [INPUTS] branches=- | result=map [CALLS-INTERNAL] Map<K, V> sortByValue(Map<K, V> map, boolean reverse) */
/* static context [FOCAL] public static Map<K, V> MapUtils.sortByValue(Map<K, V> map) [INPUTS] branches=- | result=map [CALLS-INTERNAL] Map<K, V> sortByValue(Map<K, V> map, boolean reverse) */ class MapUtils { public static <K, V extends Comparable<? super V>> Map<K, V> sortByValue( Map<K, V> map) { ...
true
ok
{"focal": {"class": "MapUtils", "name": "sortByValue", "signature": "Map<K, V> sortByValue(Map<K, V> map)", "start_line": 3, "modifiers": "public static", "params": [{"name": "map", "type": "Map<K, V>"}], "return_type": "Map<K, V>"}, "class_info": {"name": "MapUtils", "kind": "class", "modifiers": "", "superclass": nul...
23892158_12
class MethodInfo { Object getData() { return data; } private MethodInfo(Method method, Object instance); static MethodInfo newInstance(Method method, Object instance); private void parseMethodAnnotations(); Method getMethod(); int getViewType(); String getTitle(); Object getInstance(); } ...
class MyConfig { @Title("Reset") @Spinner({"one"}) public void foo() { } } Object instance = new MyConfig(); Method[] methods = instance.getClass().getDeclaredMethods(); MethodInfo methodInfo = MethodInfo.newInstance(methods[0], instance); assertThat(methodInfo.getData()).isNotNull...
[FOCAL] Object MethodInfo.getData() [CLASS] class MethodInfo [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] MethodInfo(Method method, Object instance); MethodInfo newInstance(Method method, Object instance); void parseMethodAnnotations(); Method getMethod(); int getViewType(); Stri...
/* static context [FOCAL] Object MethodInfo.getData() */
/* static context [FOCAL] Object MethodInfo.getData() */ class MethodInfo { Object getData() { return data; } private MethodInfo(Method method, Object instance); static MethodInfo newInstance(Method method, Object instance); private void parseMethodAnnotations(); Method getMethod(); int getViewT...
true
ok
{"focal": {"class": "MethodInfo", "name": "getData", "signature": "Object getData()", "start_line": 3, "modifiers": "", "params": [], "return_type": "Object"}, "class_info": {"name": "MethodInfo", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "MethodInfo", ...
23907761_7
class JohnzonJsonLogic { public JsonValue apply(final JsonValue logic, final JsonValue args) { if (logic.getValueType() != JsonValue.ValueType.OBJECT) { return logic; } final JsonObject object = logic.asJsonObject(); if (object.size() > 1) { return object; ...
final JsonObject value = builderFactory.createObjectBuilder() .add("a", 1) .add("b", 2) .build(); assertEquals( JsonValue.EMPTY_JSON_ARRAY, jsonLogic.apply( builderFactory.createObjectBuilder() ...
[FOCAL] public JsonValue JohnzonJsonLogic.apply(JsonValue logic, JsonValue args) [CLASS] class JohnzonJsonLogic [METRICS] loc=21 cc=5 branches=4 loops=0 returns=3 throws=2 nesting=1 [CALLS-EXTERNAL] JsonValue.getValueType/0, JsonValue.asJsonObject/0, JsonObject.size/0, JsonObject.keySet/0, Set<String>.size/0, keys.iter...
/* static context [FOCAL] public JsonValue JohnzonJsonLogic.apply(JsonValue logic, JsonValue args) [THROWS-WHEN] IllegalArgumentException when !(logic.getValueType() != JsonValue.ValueType.OBJECT) && !(object.size() > 1) && keys.size() != 1 [THROWS-WHEN] IllegalArgumentException when !(logic.getValueType() != JsonValue...
/* static context [FOCAL] public JsonValue JohnzonJsonLogic.apply(JsonValue logic, JsonValue args) [THROWS-WHEN] IllegalArgumentException when !(logic.getValueType() != JsonValue.ValueType.OBJECT) && !(object.size() > 1) && keys.size() != 1 [THROWS-WHEN] IllegalArgumentException when !(logic.getValueType() != JsonValue...
true
ok
{"focal": {"class": "JohnzonJsonLogic", "name": "apply", "signature": "JsonValue apply(JsonValue logic, JsonValue args)", "start_line": 3, "modifiers": "public", "params": [{"name": "logic", "type": "JsonValue"}, {"name": "args", "type": "JsonValue"}], "return_type": "JsonValue"}, "class_info": {"name": "JohnzonJsonLog...
23912550_0
class PrettySharedPreferences { protected StringEditor getStringEditor(String key) { TypeEditor typeEditor = TYPE_EDITOR_MAP.get(key); if (typeEditor == null) { typeEditor = new StringEditor(this, sharedPreferences, key); TYPE_EDITOR_MAP.put(key, typeEditor); } else ...
StringEditor stringEditor = mSharedPref.getStringEditor(TEST_KEY); assertThat(stringEditor).isInstanceOf(StringEditor.class); } }
[FOCAL] protected StringEditor PrettySharedPreferences.getStringEditor(String key) [CLASS] class PrettySharedPreferences [METRICS] loc=10 cc=3 branches=2 loops=0 returns=1 throws=1 nesting=2 [CALLS-EXTERNAL] TYPE_EDITOR_MAP.get/1, TYPE_EDITOR_MAP.put/2, String.format/2 [NEW] StringEditor, IllegalArgumentException [EXCE...
/* static context [FOCAL] protected StringEditor PrettySharedPreferences.getStringEditor(String key) [THROWS-WHEN] IllegalArgumentException when !(typeEditor == null) && !(typeEditor instanceof StringEditor) [PATH1] if(typeEditor == null)=F -> if(!(typeEditor instanceof StringEditor))=T -> throw new IllegalArgumentExce...
/* static context [FOCAL] protected StringEditor PrettySharedPreferences.getStringEditor(String key) [THROWS-WHEN] IllegalArgumentException when !(typeEditor == null) && !(typeEditor instanceof StringEditor) [PATH1] if(typeEditor == null)=F -> if(!(typeEditor instanceof StringEditor))=T -> throw new IllegalArgumentExce...
true
ok
{"focal": {"class": "PrettySharedPreferences", "name": "getStringEditor", "signature": "StringEditor getStringEditor(String key)", "start_line": 3, "modifiers": "protected", "params": [{"name": "key", "type": "String"}], "return_type": "StringEditor"}, "class_info": {"name": "PrettySharedPreferences", "kind": "class", ...
23930639_297
class MetricRegistryImpl extends MetricRegistry { @Override public <T extends Metric> T register(String name, T metric) throws IllegalArgumentException { checkNameIsNotNullOrEmpty(name); return register(Metadata.builder().withName(name).build(), true, metric); } public MetricRegistryI...
assertException("Metadata ['DefaultMetadata{name='%s', type=counter, unit='unit', reusable=true, description='description', displayName='display'}'] already registered, does not match provided ['DefaultMetadata{name='%s', type=counter, unit='unit', reusable=true, description='description', displayName='other'}'...
[FOCAL] @Override public T MetricRegistryImpl.register(String name, T metric) [CLASS] class MetricRegistryImpl extends MetricRegistry [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] T register(Metadata metadata, T metric, Tag... tags); void checkNameIsNotNullOrEmpty(String name) [C...
/* static context [FOCAL] @Override public T MetricRegistryImpl.register(String name, T metric) [INPUTS] branches=- | result=metric, name [EXCEPTIONS] declares IllegalArgumentException [CALLS-INTERNAL] T register(Metadata metadata, T metric, Tag... tags); void checkNameIsNotNullOrEmpty(String name) [CALLS-EXTERNAL] Met...
/* static context [FOCAL] @Override public T MetricRegistryImpl.register(String name, T metric) [INPUTS] branches=- | result=metric, name [EXCEPTIONS] declares IllegalArgumentException [CALLS-INTERNAL] T register(Metadata metadata, T metric, Tag... tags); void checkNameIsNotNullOrEmpty(String name) [CALLS-EXTERNAL] Met...
true
ok
{"focal": {"class": "MetricRegistryImpl", "name": "register", "signature": "T register(String name, T metric) throws IllegalArgumentException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "name", "type": "String"}, {"name": "metric", "type": "T"}], "return_type": "T"}, "class_info": {"name": "...
23952595_0
class ConcurrentCache implements Computable<K, V> { public V get(K key, Callable<V> callable) { Future<V> future = concurrentMap.get(key); if (future == null) { FutureTask<V> futureTask = new FutureTask<V>(callable); future = concurrentMap.putIfAbsent(key, futureTask); ...
final String key = "object"; Object result1 = cache.get(key, new Callable<Object>() { @Override public Object call() throws Exception { return new Object(); } }); Object result2 = cache.get(key, new Callable<Object>() { ...
[FOCAL] public V ConcurrentCache.get(K key, Callable<V> callable) [CLASS] class ConcurrentCache implements Computable<K, V> [METRICS] loc=18 cc=4 branches=2 loops=0 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] concurrentMap.get/1, concurrentMap.putIfAbsent/2, FutureTask<V>.run/0, Future<V>.get/0, concurrentMap.remove/...
/* static context [FOCAL] public V ConcurrentCache.get(K key, Callable<V> callable) [PATH1] if(future == null)#1=T -> if(future == null)#2=T -> try-body throws -> return null [PATH2] if(future == null)#1=F -> return future.get() [PATH3] if(future == null)#1=T -> if(future == null)#2=F -> return future.get() [INPUTS] br...
/* static context [FOCAL] public V ConcurrentCache.get(K key, Callable<V> callable) [PATH1] if(future == null)#1=T -> if(future == null)#2=T -> try-body throws -> return null [PATH2] if(future == null)#1=F -> return future.get() [PATH3] if(future == null)#1=T -> if(future == null)#2=F -> return future.get() [INPUTS] br...
true
ok
{"focal": {"class": "ConcurrentCache", "name": "get", "signature": "V get(K key, Callable<V> callable)", "start_line": 3, "modifiers": "public", "params": [{"name": "key", "type": "K"}, {"name": "callable", "type": "Callable<V>"}], "return_type": "V"}, "class_info": {"name": "ConcurrentCache", "kind": "class", "modifie...
23963494_27
class GuideProbeTargets implements Serializable, TargetContainer, OptionsList<SPTarget> { public static ImList<GuideProbeTargets> sortByGuider(final ImList<GuideProbeTargets> lst) { return lst.sort(GuiderComparator.instance); } private GuideProbeTargets(final GuideProbe guider, final OptionsList<...
ImList<GuideProbeTargets> lst = DefaultImList.create(fix.gpt_pwfs2, fix.gpt_gmos, fix.gpt_pwfs1); lst = GuideProbeTargets.sortByGuider(lst); assertSame(fix.gpt_gmos, lst.get(0)); assertSame(fix.gpt_pwfs1, lst.get(1)); assertSame(fix.gpt_pwfs2, lst.get(2)); lst = Default...
[FOCAL] public static ImList<GuideProbeTargets> GuideProbeTargets.sortByGuider(ImList<GuideProbeTargets> lst) [CLASS] class GuideProbeTargets implements Serializable, TargetContainer, OptionsList<SPTarget> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] ImList<GuideProbeTargets>.so...
/* static context [FOCAL] public static ImList<GuideProbeTargets> GuideProbeTargets.sortByGuider(ImList<GuideProbeTargets> lst) [INPUTS] branches=- | result=lst [COLLABORATORS] param lst:ImList<GuideProbeTargets> sort/1 [CALLS-EXTERNAL] ImList<GuideProbeTargets>.sort/1 */
/* static context [FOCAL] public static ImList<GuideProbeTargets> GuideProbeTargets.sortByGuider(ImList<GuideProbeTargets> lst) [INPUTS] branches=- | result=lst [COLLABORATORS] param lst:ImList<GuideProbeTargets> sort/1 [CALLS-EXTERNAL] ImList<GuideProbeTargets>.sort/1 */ class GuideProbeTargets implements Serializable...
true
ok
{"focal": {"class": "GuideProbeTargets", "name": "sortByGuider", "signature": "ImList<GuideProbeTargets> sortByGuider(ImList<GuideProbeTargets> lst)", "start_line": 3, "modifiers": "public static", "params": [{"name": "lst", "type": "ImList<GuideProbeTargets>"}], "return_type": "ImList<GuideProbeTargets>"}, "class_info...
23972840_3
class ApacheHttpClient implements HttpClient { @Override public HttpResponse execute(HttpRequest request) throws HttpRuntimeException { return execute(Preconditions.checkNotNull(request), Options.DEFAULT); } public ApacheHttpClient(); public ApacheHttpClient(HttpConfig config); private HttpClientCo...
httpClient = new ApacheHttpClient(); HttpRequest request = HttpRequest.newBuilder() .setMethod(Method.POST) .setUrl(testServer.baseHttpUrl()) .setBody(ExpectedHttpResponse.newBuilder().build()) .setCompression(Compression.GZIP) .build(); HttpRespo...
[FOCAL] @Override public HttpResponse ApacheHttpClient.execute(HttpRequest request) [CLASS] class ApacheHttpClient implements HttpClient [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] HttpResponse execute(HttpRequest request, Options options) [CALLS-EXTERNAL] Preconditions.checkNo...
/* static context [FOCAL] @Override public HttpResponse ApacheHttpClient.execute(HttpRequest request) [INPUTS] branches=- | result=request [EXCEPTIONS] declares HttpRuntimeException [CALLS-INTERNAL] HttpResponse execute(HttpRequest request, Options options) [CALLS-EXTERNAL] Preconditions.checkNotNull/1 */
/* static context [FOCAL] @Override public HttpResponse ApacheHttpClient.execute(HttpRequest request) [INPUTS] branches=- | result=request [EXCEPTIONS] declares HttpRuntimeException [CALLS-INTERNAL] HttpResponse execute(HttpRequest request, Options options) [CALLS-EXTERNAL] Preconditions.checkNotNull/1 */ class ApacheH...
true
ok
{"focal": {"class": "ApacheHttpClient", "name": "execute", "signature": "HttpResponse execute(HttpRequest request) throws HttpRuntimeException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "HttpRequest"}], "return_type": "HttpResponse"}, "class_info": {"name": "ApacheHttpCli...
23995230_9
class SentMapControl extends AbstractMapControl { public void addToSent(Short transmissionId, Segment segment) { // add to pending map dataMap.put(transmissionId, segment); } public SentMapControl(TransmissionSuccessListener listener, int maxEntries, int maxEntryOffset, ...
for (Short[] referenceGroup : referenceGroups) { Segment segment = new Segment(++dataId, serializeShorts(referenceGroup)); for (Short reference : referenceGroup) { handler.addToSent(reference, segment); } } int dataCount = 0; int refer...
[FOCAL] public void SentMapControl.addToSent(Short transmissionId, Segment segment) [CLASS] class SentMapControl extends AbstractMapControl [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] dataMap.put/2 [COLLABORATORS] field dataMap put/2 [DATAFLOW] segment@param->L3; transmissionId...
/* static context [FOCAL] public void SentMapControl.addToSent(Short transmissionId, Segment segment) [COLLABORATORS] field dataMap put/2 [CALLS-EXTERNAL] dataMap.put/2 */
/* static context [FOCAL] public void SentMapControl.addToSent(Short transmissionId, Segment segment) [COLLABORATORS] field dataMap put/2 [CALLS-EXTERNAL] dataMap.put/2 */ class SentMapControl extends AbstractMapControl { public void addToSent(Short transmissionId, Segment segment) { // add to pending map ...
true
ok
{"focal": {"class": "SentMapControl", "name": "addToSent", "signature": "void addToSent(Short transmissionId, Segment segment)", "start_line": 3, "modifiers": "public", "params": [{"name": "transmissionId", "type": "Short"}, {"name": "segment", "type": "Segment"}], "return_type": "void"}, "class_info": {"name": "SentMa...
24005183_2
class StringUtil { public static String arrayToJson(String[] array) { if (null == array) {return EMPTY_JSON_ARRAY;} StringWriter stringWriter = new StringWriter(); JSONWriter jsonWriter = new JSONWriter(stringWriter); try { jsonWriter.array(); for (String ...
assertEquals("[\"item1\",\"item2\"]", StringUtil.arrayToJson(new String[]{"item1","item2"})); } }
[FOCAL] public static String StringUtil.arrayToJson(String[] array) [CLASS] class StringUtil [METRICS] loc=21 cc=4 branches=1 loops=1 returns=3 throws=0 nesting=2 [CALLS-EXTERNAL] JSONWriter.array/0, JSONWriter.value/1, JSONWriter.endArray/0, LOG.error/3, StringWriter.toString/0 [NEW] StringWriter, JSONWriter [EXCEPTIO...
/* static context [FOCAL] public static String StringUtil.arrayToJson(String[] array) [PATH1] if(null == array)=F -> foreach(String item : array)=T -> exit loop -> return stringWriter.toString() [PATH2] if(null == array)=T -> return EMPTY_JSON_ARRAY [PATH3] if(null == array)=F -> try-body throws -> return EMPTY_JSON_AR...
/* static context [FOCAL] public static String StringUtil.arrayToJson(String[] array) [PATH1] if(null == array)=F -> foreach(String item : array)=T -> exit loop -> return stringWriter.toString() [PATH2] if(null == array)=T -> return EMPTY_JSON_ARRAY [PATH3] if(null == array)=F -> try-body throws -> return EMPTY_JSON_AR...
true
ok
{"focal": {"class": "StringUtil", "name": "arrayToJson", "signature": "String arrayToJson(String[] array)", "start_line": 3, "modifiers": "public static", "params": [{"name": "array", "type": "String[]"}], "return_type": "String"}, "class_info": {"name": "StringUtil", "kind": "class", "modifiers": "", "superclass": nul...
24016861_0
class ShapefileGeometryCursor extends GeometryCursor { @Override public Geometry next() { if (! hasNext()) { return null; } try { recordNumber = inputStream.readInt();//1 based int recLength = inputStream.readInt(); position += 8; ...
{ File file = getTestShapefile("polygons"); ShapefileGeometryCursor polygonShapefileCursor = new ShapefileGeometryCursor(file); GeometryCursor unionCursor = OperatorUnion.local().execute(polygonShapefileCursor, null, null); Geometry dissolvedGeometry = unionCur...
[FOCAL] @Override public Geometry ShapefileGeometryCursor.next() [CLASS] class ShapefileGeometryCursor extends GeometryCursor [METRICS] loc=25 cc=3 branches=1 loops=0 returns=3 throws=0 nesting=1 [CALLS-INTERNAL] boolean hasNext() [CALLS-EXTERNAL] inputStream.readInt/0, inputStream.read/1, importFromESRIShape.execute/3...
/* static context [FOCAL] @Override public Geometry ShapefileGeometryCursor.next() [PATH1] if(! hasNext())=F -> try-body throws -> return null [PATH2] if(! hasNext())=T -> return null [PATH3] if(! hasNext())=F -> return polyline [COLLABORATORS] field inputStream readInt/0,read/1; field importFromESRIShape execute/3 [EX...
/* static context [FOCAL] @Override public Geometry ShapefileGeometryCursor.next() [PATH1] if(! hasNext())=F -> try-body throws -> return null [PATH2] if(! hasNext())=T -> return null [PATH3] if(! hasNext())=F -> return polyline [COLLABORATORS] field inputStream readInt/0,read/1; field importFromESRIShape execute/3 [EX...
true
ok
{"focal": {"class": "ShapefileGeometryCursor", "name": "next", "signature": "Geometry next()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Geometry"}, "class_info": {"name": "ShapefileGeometryCursor", "kind": "class", "modifiers": "", "superclass": "GeometryCursor", "interfaces": nul...
24041094_6
class Driver implements DriverService { @Override public DriverInfo getInfo() { return info; } @Override public void scanForDevices(String settingsString, DriverDeviceScanListener listener); private void scanPrimaryAddress(DriverDeviceScanListener listener, Settings settings, MBusConnectio...
assertEquals("mbus", new Driver().getInfo().getId()); } }
[FOCAL] @Override public DriverInfo Driver.getInfo() [CLASS] class Driver implements DriverService [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] void scanForDevices(String settingsString, DriverDeviceScanListener listener); void scanPrimaryAddress(DriverDeviceScanListener listener...
/* static context [FOCAL] @Override public DriverInfo Driver.getInfo() */
/* static context [FOCAL] @Override public DriverInfo Driver.getInfo() */ class Driver implements DriverService { @Override public DriverInfo getInfo() { return info; } @Override public void scanForDevices(String settingsString, DriverDeviceScanListener listener); private void scanPrimaryA...
true
ok
{"focal": {"class": "Driver", "name": "getInfo", "signature": "DriverInfo getInfo()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "DriverInfo"}, "class_info": {"name": "Driver", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "DriverService", "fields": [], "members...
24084730_0
class LocalFileInputPlugin implements FileInputPlugin { private static List<String> listFiles(final PluginTask task) { // This |pathPrefixResolved| can still be a relative path from the working directory. // The path should not be normalized by Path#normalize to eliminate redundant name elements li...
final LocalFileInputPlugin.PluginTask task = buildTask("foofoo"); this.workdir.newFile("foofoo1"); this.workdir.newFile("FooFoo2"); this.workdir.newFile("barbar3"); this.workdir.newFolder("foofoo4"); this.workdir.newFile("foofoo4/foo"); this.workdir.newFile("foofo...
[FOCAL] private static List<String> LocalFileInputPlugin.listFiles(PluginTask task) [CLASS] class LocalFileInputPlugin implements FileInputPlugin [METRICS] loc=131 cc=4 branches=2 loops=0 returns=1 throws=1 nesting=6 [CALLS-INTERNAL] Path getRealCasePathOfDirectoryNoFollowLinks(Path dirNormalized); PathMatcher buildPat...
class LocalFileInputPlugin implements FileInputPlugin { private static List<String> listFiles(final PluginTask task) { // This |pathPrefixResolved| can still be a relative path from the working directory. // The path should not be normalized by Path#normalize to eliminate redundant name elements li...
false
ok
{"focal": {"class": "LocalFileInputPlugin", "name": "listFiles", "signature": "List<String> listFiles(PluginTask task)", "start_line": 3, "modifiers": "private static", "params": [{"name": "task", "type": "PluginTask"}], "return_type": "List<String>"}, "class_info": {"name": "LocalFileInputPlugin", "kind": "class", "mo...
24114062_3
class SimpleEV3Sound implements EV3Device { static int getFrequency(String note) throws EV3ScriptException { String cleanNote = note.trim().toUpperCase(); int length = cleanNote.length(); if ((length >= 2) && (length <= 5)) { char last = cleanNote.charAt(length - 1); // Sharp or not ? ...
Assert.assertEquals(SimpleEV3Sound.getFrequency("C1"), (int) 32.7032); Assert.assertEquals(SimpleEV3Sound.getFrequency("C1#"), (int) 34.6478); Assert.assertEquals(SimpleEV3Sound.getFrequency("C2"), (int) 65.4064); Assert.assertEquals(SimpleEV3Sound.getFrequency("A3"), 220); Assert.assertEquals(Simpl...
[FOCAL] static int SimpleEV3Sound.getFrequency(String note) [CLASS] class SimpleEV3Sound implements EV3Device [METRICS] loc=78 cc=20 branches=19 loops=0 returns=14 throws=1 nesting=4 [CALLS-INTERNAL] int getFrequency(int note, float octaveCoef, boolean isSharp) [CALLS-EXTERNAL] note.trim().toUpperCase/0, String.trim/0,...
/* static context [FOCAL] static int SimpleEV3Sound.getFrequency(String note) [THROWS-WHEN] EV3ScriptException when (length >= 2) && (length <= 5) && (octaveChar >= '1') && (octaveChar <= '7') && (length <= 4) || isSharp && !(c0 == 'D' && c1 == 'O') && !(c0 == 'R' && c1 == 'E') && !(c0 == 'M' && c1 == 'I') && !(c0 == '...
/* static context [FOCAL] static int SimpleEV3Sound.getFrequency(String note) [THROWS-WHEN] EV3ScriptException when (length >= 2) && (length <= 5) && (octaveChar >= '1') && (octaveChar <= '7') && (length <= 4) || isSharp && !(c0 == 'D' && c1 == 'O') && !(c0 == 'R' && c1 == 'E') && !(c0 == 'M' && c1 == 'I') && !(c0 == '...
true
ok
{"focal": {"class": "SimpleEV3Sound", "name": "getFrequency", "signature": "int getFrequency(String note) throws EV3ScriptException", "start_line": 3, "modifiers": "static", "params": [{"name": "note", "type": "String"}], "return_type": "int"}, "class_info": {"name": "SimpleEV3Sound", "kind": "class", "modifiers": "", ...
24145690_8
class ContentTypeService extends AbstractEntityTypeService<Content, ContentTypeDto> implements IComponentUsageService { @Override public PagedMetadata<ComponentUsageEntity> getComponentUsageDetails(String componentCode, RestListRequest restListRequest) { RestContentListRequest contentListRequest = new...
int pageSize = 2; this.restListRequest.setPageSize(pageSize); // creates paged data List<Integer> pageList = Arrays.asList(1, 2); ContentDto[][] utilizers = { { ContentMockHelper.mockContentDto(0), ContentMockHelper.mockContentDto(1) }, { Content...
[FOCAL] @Override public PagedMetadata<ComponentUsageEntity> ContentTypeService.getComponentUsageDetails(String componentCode, RestListRequest restListRequest) [CLASS] class ContentTypeService extends AbstractEntityTypeService<Content, ContentTypeDto> implements IComponentUsageService [METRICS] loc=17 cc=1 branches=0 l...
/* static context [FOCAL] @Override public PagedMetadata<ComponentUsageEntity> ContentTypeService.getComponentUsageDetails(String componentCode, RestListRequest restListRequest) [INPUTS] branches=- | result=restListRequest, contentService, httpSession, pagedMetadataMapper | unused=componentCode [COLLABORATORS] param re...
/* static context [FOCAL] @Override public PagedMetadata<ComponentUsageEntity> ContentTypeService.getComponentUsageDetails(String componentCode, RestListRequest restListRequest) [INPUTS] branches=- | result=restListRequest, contentService, httpSession, pagedMetadataMapper | unused=componentCode [COLLABORATORS] param re...
true
ok
{"focal": {"class": "ContentTypeService", "name": "getComponentUsageDetails", "signature": "PagedMetadata<ComponentUsageEntity> getComponentUsageDetails(String componentCode, RestListRequest restListRequest)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "componentCode", "type": "String"}, {"na...
24155908_0
class ElasticsearchHttpReporter extends ElasticsearchReporter { public static Builder forRegistryAndIndexPrefix(MetricRegistry registry, String elasticsearchIndexPrefix) { return new Builder(registry, elasticsearchIndexPrefix); } protected ElasticsearchHttpReporter(MetricRegistry regi...
reporter.stop(); reporter = ElasticsearchHttpReporter .forRegistryAndIndexPrefix(registry, "test") .withTimestampFieldName("@timeywimey") .withClock(Clock.defaultClock()).prefixedWith(prefix) .convertRatesTo(TimeUnit.SECONDS) ...
[FOCAL] public static Builder ElasticsearchHttpReporter.forRegistryAndIndexPrefix(MetricRegistry registry, String elasticsearchIndexPrefix) [CLASS] class ElasticsearchHttpReporter extends ElasticsearchReporter [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] Builder [INPUTS] branches=- | resul...
/* static context [FOCAL] public static Builder ElasticsearchHttpReporter.forRegistryAndIndexPrefix(MetricRegistry registry, String elasticsearchIndexPrefix) [INPUTS] branches=- | result=elasticsearchIndexPrefix, registry [NEW] Builder */
/* static context [FOCAL] public static Builder ElasticsearchHttpReporter.forRegistryAndIndexPrefix(MetricRegistry registry, String elasticsearchIndexPrefix) [INPUTS] branches=- | result=elasticsearchIndexPrefix, registry [NEW] Builder */ class ElasticsearchHttpReporter extends ElasticsearchReporter { public stati...
true
ok
{"focal": {"class": "ElasticsearchHttpReporter", "name": "forRegistryAndIndexPrefix", "signature": "Builder forRegistryAndIndexPrefix(MetricRegistry registry, String elasticsearchIndexPrefix)", "start_line": 3, "modifiers": "public static", "params": [{"name": "registry", "type": "MetricRegistry"}, {"name": "elasticsea...
24167016_1
class Modernizer { public Collection<ViolationOccurrence> check(ClassReader classReader) throws IOException { ModernizerClassVisitor classVisitor = new ModernizerClassVisitor( javaVersion, violations, exclusions, exclusionPatterns, ignorePackages, ignoreClassName...
ClassReader cr = new ClassReader(VectorTestClass.class.getName()); Collection<ViolationOccurrence> occurrences = createModernizer("1.0").check(cr); assertThat(occurrences).hasSize(0); } }
[FOCAL] public Collection<ViolationOccurrence> Modernizer.check(ClassReader classReader) [CLASS] class Modernizer [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] ClassReader.accept/2, ModernizerClassVisitor.getOccurrences/0 [NEW] ModernizerClassVisitor [FIELDS] read=violations:Map<...
/* static context [FOCAL] public Collection<ViolationOccurrence> Modernizer.check(ClassReader classReader) [INPUTS] branches=- | result=violations [COLLABORATORS] param classReader:ClassReader accept/2 [EXCEPTIONS] declares IOException [FIELDS] read=violations:Map<String, Violation> [NEW] ModernizerClassVisitor [CALLS-...
/* static context [FOCAL] public Collection<ViolationOccurrence> Modernizer.check(ClassReader classReader) [INPUTS] branches=- | result=violations [COLLABORATORS] param classReader:ClassReader accept/2 [EXCEPTIONS] declares IOException [FIELDS] read=violations:Map<String, Violation> [NEW] ModernizerClassVisitor [CALLS-...
true
ok
{"focal": {"class": "Modernizer", "name": "check", "signature": "Collection<ViolationOccurrence> check(ClassReader classReader) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "classReader", "type": "ClassReader"}], "return_type": "Collection<ViolationOccurrence>"}, "class_info": {"name...
24224646_14
class AnnotationsInfo { public AnnotationInfo get(String annotationName) { return classAnnotations.get(annotationName); } public AnnotationsInfo(Class<?> cls); public Collection<AnnotationInfo> list(); public AnnotationInfo get(Class<?> annotationNameClass); public void append(Annota...
AnnotationsInfo info = new AnnotationsInfo(UnrelatedClass.class); assertThat(info.get("org.neo4j.ogm.domain.gh827.PackagePrivateAnnotation").get("value")).isEqualTo("v"); } }
[FOCAL] public AnnotationInfo AnnotationsInfo.get(String annotationName) [CLASS] class AnnotationsInfo [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] classAnnotations.get/1 [INPUTS] branches=- | result=annotationName [COLLABORATORS] field classAnnotations get/1 [DATAFLOW] annotati...
/* static context [FOCAL] public AnnotationInfo AnnotationsInfo.get(String annotationName) [INPUTS] branches=- | result=annotationName [COLLABORATORS] field classAnnotations get/1 [CALLS-EXTERNAL] classAnnotations.get/1 */
/* static context [FOCAL] public AnnotationInfo AnnotationsInfo.get(String annotationName) [INPUTS] branches=- | result=annotationName [COLLABORATORS] field classAnnotations get/1 [CALLS-EXTERNAL] classAnnotations.get/1 */ class AnnotationsInfo { public AnnotationInfo get(String annotationName) { return cl...
true
ok
{"focal": {"class": "AnnotationsInfo", "name": "get", "signature": "AnnotationInfo get(String annotationName)", "start_line": 3, "modifiers": "public", "params": [{"name": "annotationName", "type": "String"}], "return_type": "AnnotationInfo"}, "class_info": {"name": "AnnotationsInfo", "kind": "class", "modifiers": "", ...
24272313_41
class Elevator implements DoorsListener { public Status status(){ return status; } public Elevator(DoorsDriver doorsDriver); public Elevator(int startingFloor, DoorsDriver doorsDriver); public int currentFloor(); public void pushButton(int floorNumber); @Override public void doo...
// given: // when: Status status = elevator.status(); // then: Assert.assertEquals(Status.AWAITING, status); } }
[FOCAL] public Status Elevator.status() [CLASS] class Elevator implements DoorsListener [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Elevator(DoorsDriver doorsDriver); Elevator(int startingFloor, DoorsDriver doorsDriver); int currentFloor(); void pushButton(int floorNumber); void...
/* static context [FOCAL] public Status Elevator.status() */
/* static context [FOCAL] public Status Elevator.status() */ class Elevator implements DoorsListener { public Status status(){ return status; } public Elevator(DoorsDriver doorsDriver); public Elevator(int startingFloor, DoorsDriver doorsDriver); public int currentFloor(); public vo...
true
ok
{"focal": {"class": "Elevator", "name": "status", "signature": "Status status()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Status"}, "class_info": {"name": "Elevator", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "DoorsListener", "fields": [{"name": "elevator", "type"...
24283381_1
class EcsTypeInspector { MatrixData getMatrixData() { assert model != null; return model.matrixData; } public EcsTypeInspector(List<URI> files, String resourcePrefix); SortedMap<String,List<RowTypeMapping>> getTypeMap(); boolean foundEcsClasses(); private List<EcsTypeData> findEcsTypes(ClassStore store)...
assertTypes(Arrays.asList("FactoryA"), inspector.getMatrixData().factoryColumns); } }
[FOCAL] MatrixData EcsTypeInspector.getMatrixData() [CLASS] class EcsTypeInspector [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] EcsTypeInspector(List<URI> files, String resourcePrefix); SortedMap<String,List<RowTypeMapping>> getTypeMap(); boolean foundEcsClasses(); List<EcsTypeDa...
/* static context [FOCAL] MatrixData EcsTypeInspector.getMatrixData() */
/* static context [FOCAL] MatrixData EcsTypeInspector.getMatrixData() */ class EcsTypeInspector { MatrixData getMatrixData() { assert model != null; return model.matrixData; } public EcsTypeInspector(List<URI> files, String resourcePrefix); SortedMap<String,List<RowTypeMapping>> getTypeMap(); boolean fou...
true
ok
{"focal": {"class": "EcsTypeInspector", "name": "getMatrixData", "signature": "MatrixData getMatrixData()", "start_line": 3, "modifiers": "", "params": [], "return_type": "MatrixData"}, "class_info": {"name": "EcsTypeInspector", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name...
24338315_29
class UserManager implements Serializable { public ResultCode registerUser(String email, String name, String password, boolean registrationConfirmed) { ResultCode checkResult = checkRegistrationPreconditions(email, name); if (checkResult != ResultCode.OK) { return checkResult; } String controlCode = gene...
Mockito.when(databaseModel.isEmailRegistered("carl@example.com")).thenReturn(false); Mockito.when(databaseModel.isUserNameRegistered("Carl")).thenReturn(false); Mockito.when(databaseModel.addUser(Mockito.notNull(User.class))).thenReturn(2); Mockito.when(emailSender.sendRegistrationEmail(Mockito.eq("carl@example...
[FOCAL] public ResultCode UserManager.registerUser(String email, String name, String password, boolean registrationConfirmed) [CLASS] class UserManager implements Serializable [METRICS] loc=31 cc=5 branches=4 loops=0 returns=5 throws=0 nesting=1 [CALLS-INTERNAL] ResultCode checkRegistrationPreconditions(String userEmai...
/* static context [FOCAL] public ResultCode UserManager.registerUser(String email, String name, String password, boolean registrationConfirmed) [PATH1] if(checkResult != ResultCode.OK)=F -> if(newUserId < 0)=F -> if(registrationConfirmed)=F -> if(emailSender.sendRegistrationEmail(email, name, newUserId, controlCode))=T...
/* static context [FOCAL] public ResultCode UserManager.registerUser(String email, String name, String password, boolean registrationConfirmed) [PATH1] if(checkResult != ResultCode.OK)=F -> if(newUserId < 0)=F -> if(registrationConfirmed)=F -> if(emailSender.sendRegistrationEmail(email, name, newUserId, controlCode))=T...
true
ok
{"focal": {"class": "UserManager", "name": "registerUser", "signature": "ResultCode registerUser(String email, String name, String password, boolean registrationConfirmed)", "start_line": 3, "modifiers": "public", "params": [{"name": "email", "type": "String"}, {"name": "name", "type": "String"}, {"name": "password", "...
24350958_6
class Reflections { public static Value<Method> method(Class<?> clazz, String method, Object... args) { Conditions.nonNull(clazz, "clazz"); Conditions.nonNullOrEmpty(method, "method"); try { if (args != null && args.length > 0) { Class<?>[] types = Stream.of(args...
MyObject object = new MyObject(); Value<Object> value = Reflections.invoke(object, "foo"); Assert.assertTrue(value.isPresent()); Assert.assertEquals(object.foo(), value.get()); Assert.assertEquals("foo", Reflections.invoke(MyObject.class, "bar").get()); } }
[FOCAL] public static Value<Method> Reflections.method(Class<?> clazz, String method, Object... args) [CLASS] class Reflections [METRICS] loc=13 cc=3 branches=1 loops=0 returns=3 throws=0 nesting=2 [CALLS-EXTERNAL] Conditions.nonNull/2, Conditions.nonNullOrEmpty/2, Stream.of(args).map(Object::getClass).toArray/1, Strea...
/* static context [FOCAL] public static Value<Method> Reflections.method(Class<?> clazz, String method, Object... args) [PATH1] try-body throws -> return Value.empty() [PATH2] if(args != null && args.length > 0)=T -> return Value.of(clazz.getDeclaredMethod(method, types)) [PATH3] if(args != null && args.length > 0)=F -...
/* static context [FOCAL] public static Value<Method> Reflections.method(Class<?> clazz, String method, Object... args) [PATH1] try-body throws -> return Value.empty() [PATH2] if(args != null && args.length > 0)=T -> return Value.of(clazz.getDeclaredMethod(method, types)) [PATH3] if(args != null && args.length > 0)=F -...
true
ok
{"focal": {"class": "Reflections", "name": "method", "signature": "Value<Method> method(Class<?> clazz, String method, Object... args)", "start_line": 3, "modifiers": "public static", "params": [{"name": "clazz", "type": "Class<?>"}, {"name": "method", "type": "String"}, {"name": "args", "type": "Object..."}], "return_...
24366887_1
class LunchParser { public static LunchParser getInstance() { if(instance == null) { instance = new LunchParser(); } return instance; } private LunchParser(); public void parse(); public ArrayList<LunchOffer> getLunchData(int mensaLocation); public List<Mensa> getLunchDataForAllMensas(); private...
LunchParser.getInstance(); LunchParser lp = LunchParser.getInstance(); Assert.assertNotNull(lp); } }
[FOCAL] public static LunchParser LunchParser.getInstance() [CLASS] class LunchParser [METRICS] loc=6 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [NEW] LunchParser [PATH1] if(instance == null)=T -> return instance [PATH2] if(instance == null)=F -> return instance [DATAFLOW] instance@L3->L5 [CLASS-MEMBERS] Lunc...
/* static context [FOCAL] public static LunchParser LunchParser.getInstance() [PATH1] if(instance == null)=T -> return instance [PATH2] if(instance == null)=F -> return instance [NEW] LunchParser */
/* static context [FOCAL] public static LunchParser LunchParser.getInstance() [PATH1] if(instance == null)=T -> return instance [PATH2] if(instance == null)=F -> return instance [NEW] LunchParser */ class LunchParser { public static LunchParser getInstance() { if(instance == null) { instance = new LunchParser();...
true
ok
{"focal": {"class": "LunchParser", "name": "getInstance", "signature": "LunchParser getInstance()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "LunchParser"}, "class_info": {"name": "LunchParser", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"nam...
24384638_0
class WordUtils { public static String getWordAtIndex(String text, Integer position) { int start = position; for (; start > 0; start--) { if (Character.isWhitespace(text.charAt(start - 1))) { break; } } if (start == position) { return StringUtils.EMPTY; } return text.substring(start, positi...
// Given String text = "Blah 123 Foobar"; // When String actual1 = WordUtils.getWordAtIndex(text, 8); String actual2 = WordUtils.getWordAtIndex(text, 7); String actual3 = WordUtils.getWordAtIndex(text, 6); String actual4 = WordUtils.getWordAtIndex(text, 5); String actual5 = WordUtils.getWordAtIndex(tex...
[FOCAL] public static String WordUtils.getWordAtIndex(String text, Integer position) [CLASS] class WordUtils [METRICS] loc=14 cc=4 branches=2 loops=1 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] Character.isWhitespace/1, String.charAt/1, String.substring/2 [PATH1] for(start > 0)=T -> if(Character.isWhitespace(text.cha...
/* static context [FOCAL] public static String WordUtils.getWordAtIndex(String text, Integer position) [PATH1] for(start > 0)=T -> if(Character.isWhitespace(text.charAt(start - 1)))=F -> exit loop -> if(start == position)=T -> return StringUtils.EMPTY [PATH2] for(start > 0)=F -> if(start == position)=F -> return text.s...
/* static context [FOCAL] public static String WordUtils.getWordAtIndex(String text, Integer position) [PATH1] for(start > 0)=T -> if(Character.isWhitespace(text.charAt(start - 1)))=F -> exit loop -> if(start == position)=T -> return StringUtils.EMPTY [PATH2] for(start > 0)=F -> if(start == position)=F -> return text.s...
true
ok
{"focal": {"class": "WordUtils", "name": "getWordAtIndex", "signature": "String getWordAtIndex(String text, Integer position)", "start_line": 3, "modifiers": "public static", "params": [{"name": "text", "type": "String"}, {"name": "position", "type": "Integer"}], "return_type": "String"}, "class_info": {"name": "WordUt...
24384732_31
class DynamoDbEncryptor implements DynamoDbEncryptionClient { private static byte[] toByteArray(ByteBuffer buffer) { buffer = buffer.duplicate(); // We can only return the array directly if: // 1. The ByteBuffer exposes an array // 2. The ByteBuffer starts at the beginning of the ar...
final byte[] expected = new byte[] {0, 1, 2, 3, 4, 5}; assertToByteArray("Wrap", expected, ByteBuffer.wrap(expected)); assertToByteArray("Wrap-RO", expected, ByteBuffer.wrap(expected).asReadOnlyBuffer()); assertToByteArray("Wrap-Truncated-Sliced", expected, ByteBuffer.wrap(new byte[] {0...
[FOCAL] private static byte[] DynamoDbEncryptor.toByteArray(ByteBuffer buffer) [CLASS] class DynamoDbEncryptor implements DynamoDbEncryptionClient [METRICS] loc=17 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] ByteBuffer.duplicate/0, ByteBuffer.hasArray/0, ByteBuffer.arrayOffset/0, ByteBuffer.ar...
/* static context [FOCAL] private static byte[] DynamoDbEncryptor.toByteArray(ByteBuffer buffer) [PATH1] if(buffer.hasArray() && buffer.arrayOffset() == 0)=T -> if(buffer.remaining() == result.length)=T -> return result [PATH2] if(buffer.hasArray() && buffer.arrayOffset() == 0)=F -> return result [PATH3] if(buffer.hasA...
/* static context [FOCAL] private static byte[] DynamoDbEncryptor.toByteArray(ByteBuffer buffer) [PATH1] if(buffer.hasArray() && buffer.arrayOffset() == 0)=T -> if(buffer.remaining() == result.length)=T -> return result [PATH2] if(buffer.hasArray() && buffer.arrayOffset() == 0)=F -> return result [PATH3] if(buffer.hasA...
true
ok
{"focal": {"class": "DynamoDbEncryptor", "name": "toByteArray", "signature": "byte[] toByteArray(ByteBuffer buffer)", "start_line": 3, "modifiers": "private static", "params": [{"name": "buffer", "type": "ByteBuffer"}], "return_type": "byte[]"}, "class_info": {"name": "DynamoDbEncryptor", "kind": "class", "modifiers": ...
24394186_4
class Certificates { public static String[] getCNs(X509Certificate cert) { try { final String subjectPrincipal = cert.getSubjectX500Principal().getName(X500Principal.RFC2253); final LinkedList<String> cnList = new LinkedList<String>(); final LdapName subjectDN = new Ldap...
X500Principal normal = new X500Principal("CN=abc,OU=ou,O=o,C=canada,EMAILADDRESS=bob@bob.com"); X500Principal bad1 = new X500Principal("CN=\"abc,CN=foo.com,\",OU=ou,O=o,C=canada,EMAILADDRESS=bob@bob.com"); X500Principal bad2 = new X500Principal("ou=\",CN=evil.ca,\", CN=good.net"); when...
[FOCAL] public static String[] Certificates.getCNs(X509Certificate cert) [CLASS] class Certificates [METRICS] loc=26 cc=8 branches=3 loops=1 returns=2 throws=0 nesting=5 [CALLS-EXTERNAL] cert.getSubjectX500Principal().getName/1, X509Certificate.getSubjectX500Principal/0, LdapName.getRdns/0, Rdn.toAttributes/0, Attribut...
/* static context [FOCAL] public static String[] Certificates.getCNs(X509Certificate cert) [PATH1] foreach(Rdn rds : subjectDN.getRdns())=T -> if(cn != null)=T -> try-body throws -> exit loop -> if(!cnList.isEmpty())=T -> return cnList.toArray(new String[cnList.size()]) [PATH2] foreach(Rdn rds : subjectDN.getRdns())=F ...
/* static context [FOCAL] public static String[] Certificates.getCNs(X509Certificate cert) [PATH1] foreach(Rdn rds : subjectDN.getRdns())=T -> if(cn != null)=T -> try-body throws -> exit loop -> if(!cnList.isEmpty())=T -> return cnList.toArray(new String[cnList.size()]) [PATH2] foreach(Rdn rds : subjectDN.getRdns())=F ...
true
ok
{"focal": {"class": "Certificates", "name": "getCNs", "signature": "String[] getCNs(X509Certificate cert)", "start_line": 3, "modifiers": "public static", "params": [{"name": "cert", "type": "X509Certificate"}], "return_type": "String[]"}, "class_info": {"name": "Certificates", "kind": "class", "modifiers": "", "superc...
24404221_752
class AmqpDestinationHelper { public static void setToAddressFromDestination(AmqpJmsMessageFacade message, JmsDestination destination) { message.setToAddress(getDestinationAddress(destination, message.getConnection())); // Clear any previous annotations about destination type, we will add proper a...
String testAddress = "testAddress"; JmsDestination destination = new JmsTemporaryQueue("testAddress"); AmqpJmsMessageFacade message = Mockito.mock(AmqpJmsMessageFacade.class); AmqpDestinationHelper.setToAddressFromDestination(message, destination); Mockito.verify(message).setTo...
[FOCAL] public static void AmqpDestinationHelper.setToAddressFromDestination(AmqpJmsMessageFacade message, JmsDestination destination) [CLASS] class AmqpDestinationHelper [METRICS] loc=9 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] String getDestinationAddress(JmsDestination destination, AmqpCo...
/* static context [FOCAL] public static void AmqpDestinationHelper.setToAddressFromDestination(AmqpJmsMessageFacade message, JmsDestination destination) [COLLABORATORS] param message:AmqpJmsMessageFacade setToAddress/1,getConnection/0,removeMessageAnnotation/1 [CALLS-INTERNAL] String getDestinationAddress(JmsDestinatio...
/* static context [FOCAL] public static void AmqpDestinationHelper.setToAddressFromDestination(AmqpJmsMessageFacade message, JmsDestination destination) [COLLABORATORS] param message:AmqpJmsMessageFacade setToAddress/1,getConnection/0,removeMessageAnnotation/1 [CALLS-INTERNAL] String getDestinationAddress(JmsDestinatio...
true
ok
{"focal": {"class": "AmqpDestinationHelper", "name": "setToAddressFromDestination", "signature": "void setToAddressFromDestination(AmqpJmsMessageFacade message, JmsDestination destination)", "start_line": 3, "modifiers": "public static", "params": [{"name": "message", "type": "AmqpJmsMessageFacade"}, {"name": "destinat...
24409108_3
class User extends TypedData implements Replier { public static UserPermanentDeleteResponse permanentDelete(String id) throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException { final URI uri = UriBuilder.newBuilder() .path("user_delete_...
String json = load("permanent_delete_response.json"); final UserPermanentDeleteResponse userPermanentDeleteResponse= mapper.readValue(json, UserPermanentDeleteResponse.class); assertEquals("123456", userPermanentDeleteResponse.getId()); } }
[FOCAL] public static UserPermanentDeleteResponse User.permanentDelete(String id) [CLASS] class User extends TypedData implements Replier [METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] UriBuilder.newBuilder() .path("user_delete_requests").build/0, UriBuilder.newBuilder().path/1, U...
/* static context [FOCAL] public static UserPermanentDeleteResponse User.permanentDelete(String id) [INPUTS] branches=- | result=id [EXCEPTIONS] declares AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException [NEW] HttpClient, UserPermanentDeleteRequest [CALLS-EXTERNAL] UriBuilde...
/* static context [FOCAL] public static UserPermanentDeleteResponse User.permanentDelete(String id) [INPUTS] branches=- | result=id [EXCEPTIONS] declares AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException [NEW] HttpClient, UserPermanentDeleteRequest [CALLS-EXTERNAL] UriBuilde...
true
ok
{"focal": {"class": "User", "name": "permanentDelete", "signature": "UserPermanentDeleteResponse permanentDelete(String id) throws AuthorizationException, ClientException, ServerException, InvalidException, RateLimitException", "start_line": 3, "modifiers": "public static", "params": [{"name": "id", "type": "String"}],...
24416383_24
class NumberMatcher extends CommonTokensMatcher { @Override public boolean matches(String s1, String s2) { if (s1 == null && s2 == null) return true; String no1 = removeNumbers.transform(s1); String no2 = removeNumbers.transform(s2); if (noNumbersRequireRestMatch && no1.length() == 0 && no2.length() == 0) { ...
NumberMatcher matcher = new NumberMatcher(); assertTrue(matcher.matches("Abraham Lincoln came 1834 to Ealing, 4 times in a row, riding 23 horses", "Abraham Lincoln came 1934 to Ealing, 4 times in a row, riding 23 horses")); // Also true would be: assertTrue(matcher.matches("Abraham Lincoln came 1834 to Eali...
[FOCAL] @Override public boolean NumberMatcher.matches(String s1, String s2) [CLASS] class NumberMatcher extends CommonTokensMatcher [METRICS] loc=12 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1 [CALLS-EXTERNAL] removeNumbers.transform/1, String.length/0, String.equals/1, CommonTokensMatcher.matches/2 [PATH1] i...
/* static context [FOCAL] @Override public boolean NumberMatcher.matches(String s1, String s2) [PATH1] if(s1 == null && s2 == null)=F -> if(noNumbersRequireRestMatch && no1.length() == 0 && no2.length() == 0)=T -> return (s1.equals(s2)) [PATH2] if(s1 == null && s2 == null)=T -> return true [PATH3] if(s1 == null && s2 =...
/* static context [FOCAL] @Override public boolean NumberMatcher.matches(String s1, String s2) [PATH1] if(s1 == null && s2 == null)=F -> if(noNumbersRequireRestMatch && no1.length() == 0 && no2.length() == 0)=T -> return (s1.equals(s2)) [PATH2] if(s1 == null && s2 == null)=T -> return true [PATH3] if(s1 == null && s2 =...
true
ok
{"focal": {"class": "NumberMatcher", "name": "matches", "signature": "boolean matches(String s1, String s2)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "s1", "type": "String"}, {"name": "s2", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "NumberMatcher", "kind": "clas...
24417776_49
class GroovyChange extends Change { public static Map<String, Object> createShellContext(ApplicationContext applicationContext, Log4JPrintStream output) { final Map<String, Object> shellContext = new HashMap<>(); // hybris 5 shellCon...
// given TestBean bean = prepareBean("bean"); TestBean beanWithAlias = prepareBean("beanWithAlias"); given(applicationContext.getBeanDefinitionNames()).willReturn(new String[]{ bean.name(), beanWithAlias.name() }); given(applicationContext.getAlias...
[FOCAL] public static Map<String, Object> GroovyChange.createShellContext(ApplicationContext applicationContext, Log4JPrintStream output) [CLASS] class GroovyChange extends Change [METRICS] loc=15 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] void bindSpringBeans(ApplicationContext applicationCo...
/* static context [FOCAL] public static Map<String, Object> GroovyChange.createShellContext(ApplicationContext applicationContext, Log4JPrintStream output) [CALLS-INTERNAL] void bindSpringBeans(ApplicationContext applicationContext, Map<String, Object> shellContext) [NEW] HashMap<> [CALLS-EXTERNAL] Map<String, Object>....
/* static context [FOCAL] public static Map<String, Object> GroovyChange.createShellContext(ApplicationContext applicationContext, Log4JPrintStream output) [CALLS-INTERNAL] void bindSpringBeans(ApplicationContext applicationContext, Map<String, Object> shellContext) [NEW] HashMap<> [CALLS-EXTERNAL] Map<String, Object>....
true
ok
{"focal": {"class": "GroovyChange", "name": "createShellContext", "signature": "Map<String, Object> createShellContext(ApplicationContext applicationContext, Log4JPrintStream output)", "start_line": 3, "modifiers": "public static", "params": [{"name": "applicationContext", "type": "ApplicationContext"}, {"name": "outpu...
24468283_0
class EmailReporter { public String generatePayload(String name, String email, String message, String category) throws Exception { if (email == null) email = ""; if (name == null) name = ""; String userEmail = email; String userName = name; if (userEmail.isEmpty()) { ...
EmailReporter reporter = new EmailReporter("token", "helpdeskemail"); String payload = reporter.generatePayload("name", "email", "hello\nworld", "General Feedback"); assertEquals("{\"personalizations\":[{\"subject\":\"tS Android: General Feedback\",\"to\":[{\"name\":\"Help Desk\",\"email\":\"hel...
[FOCAL] public String EmailReporter.generatePayload(String name, String email, String message, String category) [CLASS] class EmailReporter [METRICS] loc=45 cc=5 branches=4 loops=0 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] String.isEmpty/0, JSONObject.put/2, JSONArray.put/1, String.replaceAll/2, new JSONArray().put...
/* static context [FOCAL] public String EmailReporter.generatePayload(String name, String email, String message, String category) [PATH1] if(email == null)=T -> if(name == null)=T -> if(userEmail.isEmpty())=F -> if(userName.isEmpty())=T -> return json.toString() [PATH2] if(email == null)=F -> if(name == null)=F -> if(u...
/* static context [FOCAL] public String EmailReporter.generatePayload(String name, String email, String message, String category) [PATH1] if(email == null)=T -> if(name == null)=T -> if(userEmail.isEmpty())=F -> if(userName.isEmpty())=T -> return json.toString() [PATH2] if(email == null)=F -> if(name == null)=F -> if(u...
true
ok
{"focal": {"class": "EmailReporter", "name": "generatePayload", "signature": "String generatePayload(String name, String email, String message, String category) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "name", "type": "String"}, {"name": "email", "type": "String"}, {"name": "messag...
24477567_28
class NavigableMapOLogEntryOracle implements OLogEntryOracle { @Override public QuorumConfigurationWithSeqNum getLastQuorumConfig() { if (configMap.isEmpty()) { return new QuorumConfigurationWithSeqNum(QuorumConfiguration.EMPTY, 0); } else { final Map.Entry<Long, QuorumConfiguration> lastEntry ...
havingLogged( entries() .term(7).configurationAndSeqNum(firstConfig, 1)); havingTruncatedToSeqNum(1); assertThat(oracle.getLastQuorumConfig(), is(equalTo(configurationAndSeqNum(EMPTY, 0)))); havingLogged( entries() .term(8).configurationAndSeqNum(secondConfig, 2)...
[FOCAL] @Override public QuorumConfigurationWithSeqNum NavigableMapOLogEntryOracle.getLastQuorumConfig() [CLASS] class NavigableMapOLogEntryOracle implements OLogEntryOracle [METRICS] loc=9 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] configMap.isEmpty/0, configMap.lastEntry/0, Map.Entry<Long, ...
/* static context [FOCAL] @Override public QuorumConfigurationWithSeqNum NavigableMapOLogEntryOracle.getLastQuorumConfig() [PATH1] if(configMap.isEmpty())=T -> return new QuorumConfigurationWithSeqNum(QuorumConfiguration.EMPTY, 0) [PATH2] if(configMap.isEmpty())=F -> return new QuorumConfigurationWithSeqNum(lastEntry.g...
/* static context [FOCAL] @Override public QuorumConfigurationWithSeqNum NavigableMapOLogEntryOracle.getLastQuorumConfig() [PATH1] if(configMap.isEmpty())=T -> return new QuorumConfigurationWithSeqNum(QuorumConfiguration.EMPTY, 0) [PATH2] if(configMap.isEmpty())=F -> return new QuorumConfigurationWithSeqNum(lastEntry.g...
true
ok
{"focal": {"class": "NavigableMapOLogEntryOracle", "name": "getLastQuorumConfig", "signature": "QuorumConfigurationWithSeqNum getLastQuorumConfig()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "QuorumConfigurationWithSeqNum"}, "class_info": {"name": "NavigableMapOLogEntryOracle", "ki...
24478161_3
class ExceptionHandler implements Serializable { void verifyCaller(Callable<?> callable) { Method callMethod = getCallableMethod(callable.getClass()); for (Class<?> exceptionOrError : callMethod.getExceptionTypes()) { Preconditions.checkArgument(Exception.class.isAssignableFrom(exceptionOrError), ...
class A implements Callable<Object> { @SuppressWarnings("unused") @Override public Object call() throws IOException, InterruptedException { return null; } } class B extends A { } class C extends A { @SuppressWarnings("unused") @Override public Object call() th...
[FOCAL] void ExceptionHandler.verifyCaller(Callable<?> callable) [CLASS] class ExceptionHandler implements Serializable [METRICS] loc=11 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] Method getCallableMethod(Class<?> clazz); RetryInfo findMostSpecificRetryInfo(Set<RetryInfo> retryInfos, Class<? ...
/* static context [FOCAL] void ExceptionHandler.verifyCaller(Callable<?> callable) [PATH1] foreach(Class<?> exceptionOrError : callMethod.getExceptionTypes())=T -> exit loop [PATH2] foreach(Class<?> exceptionOrError : callMethod.getExceptionTypes())=F [INPUTS] branches=callable | result=- [COLLABORATORS] param callable...
/* static context [FOCAL] void ExceptionHandler.verifyCaller(Callable<?> callable) [PATH1] foreach(Class<?> exceptionOrError : callMethod.getExceptionTypes())=T -> exit loop [PATH2] foreach(Class<?> exceptionOrError : callMethod.getExceptionTypes())=F [INPUTS] branches=callable | result=- [COLLABORATORS] param callable...
true
ok
{"focal": {"class": "ExceptionHandler", "name": "verifyCaller", "signature": "void verifyCaller(Callable<?> callable)", "start_line": 3, "modifiers": "", "params": [{"name": "callable", "type": "Callable<?>"}], "return_type": "void"}, "class_info": {"name": "ExceptionHandler", "kind": "class", "modifiers": "", "supercl...
24499046_11
class GreenMailStandaloneRunner { public void doRun(Properties properties) { ServerSetup[] serverSetup = new PropertiesBasedServerSetupBuilder().build(properties); if (serverSetup.length == 0) { printUsage(System.out); } else { greenMail = new GreenMail(serverSetup...
GreenMailStandaloneRunner runner = new GreenMailStandaloneRunner(); final Properties properties = new Properties(); properties.setProperty(PropertiesBasedServerSetupBuilder.GREENMAIL_VERBOSE, ""); properties.setProperty("greenmail.setup.test.smtp", ""); properties.setProperty("gr...
[FOCAL] public void GreenMailStandaloneRunner.doRun(Properties properties) [CLASS] class GreenMailStandaloneRunner [METRICS] loc=14 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] void printUsage(PrintStream out) [CALLS-EXTERNAL] new PropertiesBasedServerSetupBuilder().build/1, log.info/3, BuildIn...
/* static context [FOCAL] public void GreenMailStandaloneRunner.doRun(Properties properties) [PATH1] if(serverSetup.length == 0)=T [PATH2] if(serverSetup.length == 0)=F [INPUTS] branches=properties | result=- [COLLABORATORS] field greenMail withConfiguration/1 [CALLS-INTERNAL] void printUsage(PrintStream out) [NEW] Pro...
/* static context [FOCAL] public void GreenMailStandaloneRunner.doRun(Properties properties) [PATH1] if(serverSetup.length == 0)=T [PATH2] if(serverSetup.length == 0)=F [INPUTS] branches=properties | result=- [COLLABORATORS] field greenMail withConfiguration/1 [CALLS-INTERNAL] void printUsage(PrintStream out) [NEW] Pro...
true
ok
{"focal": {"class": "GreenMailStandaloneRunner", "name": "doRun", "signature": "void doRun(Properties properties)", "start_line": 3, "modifiers": "public", "params": [{"name": "properties", "type": "Properties"}], "return_type": "void"}, "class_info": {"name": "GreenMailStandaloneRunner", "kind": "class", "modifiers": ...
24503341_1
class Tuple { @Override public int hashCode() { if ((this.first == null) && (this.second == null)) { return "".hashCode(); } return this.first == null ? this.second.hashCode() : this.first.hashCode() ^ this.second.hashCode(); } public Tuple(T firstValue, U secondValue); @Override public boolean equals...
Tuple<String, String> t1 = new Tuple<String, String>("S1", "S2"); Tuple<String, String> t2 = new Tuple<String, String>("S1", "S2"); assertEquals(t1.hashCode(), t2.hashCode()); Tuple<String, String> t3 = new Tuple<String, String>(null, null); t3.hashCode(); } }
[FOCAL] @Override public int Tuple.hashCode() [CLASS] class Tuple [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] "".hashCode/0, this.second.hashCode/0, this.first.hashCode/0 [FIELDS] read=first, second [PATH1] if((this.first == null) && (this.second == null))=T -> return "".hashCo...
/* static context [FOCAL] @Override public int Tuple.hashCode() [PATH1] if((this.first == null) && (this.second == null))=T -> return "".hashCode() [PATH2] if((this.first == null) && (this.second == null))=F -> return this.first == null ? this.second.hashCode() : this.first.hashCode()... [COLLABORATORS] field second ha...
/* static context [FOCAL] @Override public int Tuple.hashCode() [PATH1] if((this.first == null) && (this.second == null))=T -> return "".hashCode() [PATH2] if((this.first == null) && (this.second == null))=F -> return this.first == null ? this.second.hashCode() : this.first.hashCode()... [COLLABORATORS] field second ha...
true
ok
{"focal": {"class": "Tuple", "name": "hashCode", "signature": "int hashCode()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "Tuple", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Tuple", "ki...
24506674_59
class IntegerPolyfill { public static int compare(int x, int y) { return (x < y) ? -1 : ((x == y) ? 0 : 1); } } class TestIntegerPolyfill { @Test public void integer_edge_cases_work_as_expected() {
assertEquals(0, IntegerPolyfill.compare(Integer.MIN_VALUE, Integer.MIN_VALUE)); assertEquals(0, IntegerPolyfill.compare(Integer.MAX_VALUE, Integer.MAX_VALUE)); assertThat(IntegerPolyfill.compare(Integer.MIN_VALUE, Integer.MAX_VALUE), is(lessThan(0))); assertThat(IntegerPolyfill.compare(I...
[FOCAL] public static int IntegerPolyfill.compare(int x, int y) [CLASS] class IntegerPolyfill [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [INPUTS] branches=- | result=x, y [DATAFLOW] x@param->L2; y@param->L2 [TEST] TestIntegerPolyfill: @Test public void integer_edge_cases_work_as_expected()
/* static context [FOCAL] public static int IntegerPolyfill.compare(int x, int y) [INPUTS] branches=- | result=x, y */
/* static context [FOCAL] public static int IntegerPolyfill.compare(int x, int y) [INPUTS] branches=- | result=x, y */ class IntegerPolyfill { public static int compare(int x, int y) { return (x < y) ? -1 : ((x == y) ? 0 : 1); } } class TestIntegerPolyfill { @Test public void integer_edge_ca...
true
ok
{"focal": {"class": "IntegerPolyfill", "name": "compare", "signature": "int compare(int x, int y)", "start_line": 3, "modifiers": "public static", "params": [{"name": "x", "type": "int"}, {"name": "y", "type": "int"}], "return_type": "int"}, "class_info": {"name": "IntegerPolyfill", "kind": "class", "modifiers": "", "s...
24542374_0
class StatefulFactory implements BeanDefinitionRegistryPostProcessor, ApplicationContextAware { public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry reg) throws BeansException { logger.debug("postProcessBeanDefinitionRegistry : enter"); try { // Reflect over StatefulJ // Reflections r...
BeanDefinitionRegistry registry = new MockBeanDefinitionRegistryImpl(); BeanDefinition userRepo = BeanDefinitionBuilder .genericBeanDefinition(MockRepositoryFactoryBeanSupport.class) .getBeanDefinition(); userRepo.getPropertyValues().add("repositoryInterface", UserRepository.class.getName()); reg...
[FOCAL] public void StatefulFactory.postProcessBeanDefinitionRegistry(BeanDefinitionRegistry reg) [CLASS] class StatefulFactory implements BeanDefinitionRegistryPostProcessor, ApplicationContextAware [METRICS] loc=47 cc=3 branches=0 loops=1 returns=0 throws=1 nesting=2 [CALLS-INTERNAL] void buildFramework(String statef...
class StatefulFactory implements BeanDefinitionRegistryPostProcessor, ApplicationContextAware { public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry reg) throws BeansException { logger.debug("postProcessBeanDefinitionRegistry : enter"); try { // Reflect over StatefulJ // Reflections r...
false
ok
{"focal": {"class": "StatefulFactory", "name": "postProcessBeanDefinitionRegistry", "signature": "void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry reg) throws BeansException", "start_line": 3, "modifiers": "public", "params": [{"name": "reg", "type": "BeanDefinitionRegistry"}], "return_type": "void"}, "cla...
24580061_38
class ConvolutionalLayer extends LayerBase { @Override public LayerParameter generateParameterGradient(final Matrix input, final Matrix error) { final Matrix weightGradient = matrixFactory.create(kernelHeight * kernelWidth * inputChannel, outputShape[0]); for (int n = 0; n < input.getColumns(); ++n) { ...
final LayerParameter convolutionalLayerParams = convolutional3DLayer.generateParameterGradient(input3D, nextError3D); assertTrue(compare(expectedConvolutional3DLayerParams, convolutionalLayerParams, TOLERANCE)); } }
[FOCAL] @Override public LayerParameter ConvolutionalLayer.generateParameterGradient(Matrix input, Matrix error) [CLASS] class ConvolutionalLayer extends LayerBase [METRICS] loc=14 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] Matrix im2row(int imageIndex, Matrix input) [CALLS-EXTERNAL] MatrixFa...
/* static context [FOCAL] @Override public LayerParameter ConvolutionalLayer.generateParameterGradient(Matrix input, Matrix error) [PATH1] for(n < input.getColumns())=T -> exit loop -> return LayerParameter.newBuilder() .setWeightParam(weightGradient) .setBia... [PATH2] for(n < input.getColumns())=F -> return LayerPara...
/* static context [FOCAL] @Override public LayerParameter ConvolutionalLayer.generateParameterGradient(Matrix input, Matrix error) [PATH1] for(n < input.getColumns())=T -> exit loop -> return LayerParameter.newBuilder() .setWeightParam(weightGradient) .setBia... [PATH2] for(n < input.getColumns())=F -> return LayerPara...
true
ok
{"focal": {"class": "ConvolutionalLayer", "name": "generateParameterGradient", "signature": "LayerParameter generateParameterGradient(Matrix input, Matrix error)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "input", "type": "Matrix"}, {"name": "error", "type": "Matrix"}], "return_type": "Laye...
24587006_11
class StateMachine { @SuppressWarnings("unchecked") public Transition handleEvent(Transition last, E event) { final Object current = last.getState(); final Context context = last.getContext(); final String stateMachineId = context.stateMachineId(); Transition next; try...
final Transition requested = stateMachine.handleEvent(initialTransition, new RechargeEvent()); assertThat(requested).isNotNull(); assertThat(requested.getState().getClass()).isEqualTo(RECHARGE_REQUESTED_STATE.getClass()); final Optional<PinRechargedContext> pinRechagedContext = requeste...
[FOCAL] @SuppressWarnings("unchecked") public Transition StateMachine.handleEvent(Transition last, E event) [CLASS] class StateMachine [METRICS] loc=32 cc=3 branches=1 loops=0 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] Transition onError(E event, Context context, Exception e); Transition unhandled(Transition last, E...
/* static context [FOCAL] @SuppressWarnings("unchecked") public Transition StateMachine.handleEvent(Transition last, E event) [PATH1] try-body throws -> return next [PATH2] if(handleEvent != null)=T -> return next [PATH3] if(handleEvent != null)=F -> return next [INPUTS] branches=last | result=event, last [COLLABORATOR...
/* static context [FOCAL] @SuppressWarnings("unchecked") public Transition StateMachine.handleEvent(Transition last, E event) [PATH1] try-body throws -> return next [PATH2] if(handleEvent != null)=T -> return next [PATH3] if(handleEvent != null)=F -> return next [INPUTS] branches=last | result=event, last [COLLABORATOR...
true
ok
{"focal": {"class": "StateMachine", "name": "handleEvent", "signature": "Transition handleEvent(Transition last, E event)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public", "params": [{"name": "last", "type": "Transition"}, {"name": "event", "type": "E"}], "return_type": "Transition"}, "class_in...
24610319_1
class HapticInterfaceManager { public void refreshHapticData(View root) { if(proxyHolder.get() != null) { ISdl proxy = proxyHolder.get(); if (userHapticData == null) { List<HapticRect> hapticRects = new ArrayList<>(); findHapticRects(root, hapticRects...
View root = createViews(); hapticMgr.refreshHapticData(root); verify(mockProxy).sendRPC(captor.capture()); SendHapticData data = captor.getValue(); assertNotNull("SendHapticData RPC", data); List<HapticRect> list = data.getHapticRectData(); assertNotNull("List", l...
[FOCAL] public void HapticInterfaceManager.refreshHapticData(View root) [CLASS] class HapticInterfaceManager [METRICS] loc=14 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=2 [CALLS-INTERNAL] void findHapticRects(View root, List<HapticRect> hapticRects) [CALLS-EXTERNAL] proxyHolder.get/0, SendHapticData.setHapticRe...
/* static context [FOCAL] public void HapticInterfaceManager.refreshHapticData(View root) [PATH1] if(proxyHolder.get() != null)=T -> if(userHapticData == null)=T [PATH2] if(proxyHolder.get() != null)=F [PATH3] if(proxyHolder.get() != null)=T -> if(userHapticData == null)=F [COLLABORATORS] field proxyHolder get/0 [CALLS...
/* static context [FOCAL] public void HapticInterfaceManager.refreshHapticData(View root) [PATH1] if(proxyHolder.get() != null)=T -> if(userHapticData == null)=T [PATH2] if(proxyHolder.get() != null)=F [PATH3] if(proxyHolder.get() != null)=T -> if(userHapticData == null)=F [COLLABORATORS] field proxyHolder get/0 [CALLS...
true
ok
{"focal": {"class": "HapticInterfaceManager", "name": "refreshHapticData", "signature": "void refreshHapticData(View root)", "start_line": 3, "modifiers": "public", "params": [{"name": "root", "type": "View"}], "return_type": "void"}, "class_info": {"name": "HapticInterfaceManager", "kind": "class", "modifiers": "", "s...