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 |
|---|---|---|---|---|---|---|---|---|
184650438_19 | class SearchDataSourceServlet extends SlingSafeMethodsServlet {
protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException {
final String PARAMETER_OFFSET = "_commerce_offset";
final String PARAMETER_LIMIT = "_commerce_limit";
final String PA... | dataSourceProperties.put("path", TEST_PATH);
dataSourceProperties.put("path", TEST_PATH);
results.add(mock(Resource.class));
when(request.getParameter("root")).thenReturn("rootPath");
rootResourceProperties.put(CommerceConstants.PN_COMMERCE_TYPE, Constants.CATEGORY);
root... | [FOCAL] protected void SearchDataSourceServlet.doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)
[CLASS] class SearchDataSourceServlet extends SlingSafeMethodsServlet
[METRICS] loc=40 cc=3 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] request.getResource().getChild/1, SlingHtt... | /* static context
[FOCAL] protected void SearchDataSourceServlet.doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)
[PATH1] if(rootCategoryId != null)=T -> try-body throws
[PATH2] if(rootCategoryId != null)=F
[INPUTS] branches=request | result=-
[COLLABORATORS] param request:SlingHttpServletReque... | /* static context
[FOCAL] protected void SearchDataSourceServlet.doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)
[PATH1] if(rootCategoryId != null)=T -> try-body throws
[PATH2] if(rootCategoryId != null)=F
[INPUTS] branches=request | result=-
[COLLABORATORS] param request:SlingHttpServletReque... | true | ok | {"focal": {"class": "SearchDataSourceServlet", "name": "doGet", "signature": "void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException", "start_line": 3, "modifiers": "protected", "params": [{"name": "request", "type": "SlingHttpServletRequest"}, {"name": "response", "type": "Sl... |
185218009_0 | class AdditionalBuildCommands {
public static AdditionalBuildCommands load(Path file) throws IOException {
logger.entering(file);
AdditionalBuildCommands result = new AdditionalBuildCommands();
result.contents = new HashMap<>();
try (BufferedReader reader = Files.newBufferedReader(... | String filename = "bad-section.txt";
assertThrows(IllegalArgumentException.class, () -> {
AdditionalBuildCommands.load(getPath(filename));
});
}
} | [FOCAL] public static AdditionalBuildCommands AdditionalBuildCommands.load(Path file)
[CLASS] class AdditionalBuildCommands
[METRICS] loc=41 cc=7 branches=4 loops=1 returns=1 throws=1 nesting=5
[CALLS-EXTERNAL] logger.entering/1, Files.newBufferedReader/1, BufferedReader.readLine/0, logger.finest/1, AdditionalBuildComm... | /* static context
[FOCAL] public static AdditionalBuildCommands AdditionalBuildCommands.load(Path file)
[THROWS-WHEN] ioe when try-body throws
[PATH1] while((line = reader.readLine()) != null)=T -> if(currentSection != null && sectionStart == null)=F -> if(currentSection != null)=F -> if(sectionStart != null)=T -> exit... | /* static context
[FOCAL] public static AdditionalBuildCommands AdditionalBuildCommands.load(Path file)
[THROWS-WHEN] ioe when try-body throws
[PATH1] while((line = reader.readLine()) != null)=T -> if(currentSection != null && sectionStart == null)=F -> if(currentSection != null)=F -> if(sectionStart != null)=T -> exit... | true | ok | {"focal": {"class": "AdditionalBuildCommands", "name": "load", "signature": "AdditionalBuildCommands load(Path file) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "file", "type": "Path"}], "return_type": "AdditionalBuildCommands"}, "class_info": {"name": "AdditionalBuildCommand... |
185263418_0 | class Federation {
@NotNull
public static SchemaTransformer transform(final GraphQLSchema schema) {
return new SchemaTransformer(schema);
}
private Federation();
public static SchemaTransformer transform(final TypeDefinitionRegistry typeRegistry, final RuntimeWiring runtimeWiring);
p... | final GraphQLSchema federated = Federation.transform(emptySDL)
.build();
Assertions.assertEquals("directive @extends on OBJECT | INTERFACE\n" +
"\n" +
"directive @external on FIELD_DEFINITION\n" +
"\n" +
"directive @key(fiel... | [FOCAL] @NotNull public static SchemaTransformer Federation.transform(GraphQLSchema schema)
[CLASS] class Federation
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] SchemaTransformer
[INPUTS] branches=- | result=schema
[DATAFLOW] schema@param->L3
[CLASS-MEMBERS] Federation(); SchemaTransforme... | /* static context
[FOCAL] @NotNull public static SchemaTransformer Federation.transform(GraphQLSchema schema)
[INPUTS] branches=- | result=schema
[NEW] SchemaTransformer
*/
| /* static context
[FOCAL] @NotNull public static SchemaTransformer Federation.transform(GraphQLSchema schema)
[INPUTS] branches=- | result=schema
[NEW] SchemaTransformer
*/
class Federation {
@NotNull
public static SchemaTransformer transform(final GraphQLSchema schema) {
return new SchemaTransformer(s... | true | ok | {"focal": {"class": "Federation", "name": "transform", "signature": "SchemaTransformer transform(GraphQLSchema schema)", "start_line": 3, "modifiers": "@NotNull public static", "params": [{"name": "schema", "type": "GraphQLSchema"}], "return_type": "SchemaTransformer"}, "class_info": {"name": "Federation", "kind": "cla... |
185394887_8 | class MultiArray {
public static <O> MultiArray<O> wrap(final O elements, final int[] dimensions) {
return wrap(elements, 0, dimensions);
}
protected MultiArray(final T elements, final int[] dimensions, final int offset);
@SuppressWarnings("unchecked") public static MultiArray<O> wrap(final ... | assertThrows(IllegalArgumentException.class, () -> MultiArray.wrap("Foo", 0, new int[] { 1, 2, 3 })); // elements no array
assertThrows(IllegalArgumentException.class, () -> MultiArray.wrap("Foo", 0)); // elements no array
assertThrows(IllegalArgumentException.class, () -> MultiArray.wrap(new St... | [FOCAL] public static MultiArray<O> MultiArray.wrap(O elements, int[] dimensions)
[CLASS] class MultiArray
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] MultiArray<O> wrap(O elements, int offset, int[] dimensions)
[INPUTS] branches=- | result=dimensions, elements
[DATAFLOW] dimen... | /* static context
[FOCAL] public static MultiArray<O> MultiArray.wrap(O elements, int[] dimensions)
[INPUTS] branches=- | result=dimensions, elements
[CALLS-INTERNAL] MultiArray<O> wrap(O elements, int offset, int[] dimensions)
*/
| /* static context
[FOCAL] public static MultiArray<O> MultiArray.wrap(O elements, int[] dimensions)
[INPUTS] branches=- | result=dimensions, elements
[CALLS-INTERNAL] MultiArray<O> wrap(O elements, int offset, int[] dimensions)
*/
class MultiArray {
public static <O> MultiArray<O> wrap(final O elements, final int[... | true | ok | {"focal": {"class": "MultiArray", "name": "wrap", "signature": "MultiArray<O> wrap(O elements, int[] dimensions)", "start_line": 3, "modifiers": "public static", "params": [{"name": "elements", "type": "O"}, {"name": "dimensions", "type": "int[]"}], "return_type": "MultiArray<O>"}, "class_info": {"name": "MultiArray", ... |
185565206_0 | class ConfigHelper {
public static String findConnectorLibPath(String dbType) {
DbType type = DbType.valueOf(dbType);
URL resource = Thread.currentThread().getContextClassLoader().getResource("logback.xml");
_LOG.info("jar resource: {}", resource);
if (resource != null) {
try {
File file = new File(res... | String path = ConfigHelper.findConnectorLibPath("Oracle");
Assert.assertTrue(path.contains("ojdbc"));
}
} | [FOCAL] public static String ConfigHelper.findConnectorLibPath(String dbType)
[CLASS] class ConfigHelper
[METRICS] loc=15 cc=3 branches=1 loops=0 returns=1 throws=2 nesting=2
[CALLS-EXTERNAL] DbType.valueOf/1, Thread.currentThread().getContextClassLoader().getResource/1, Thread.currentThread().getContextClassLoader/0, ... | /* static context
[FOCAL] public static String ConfigHelper.findConnectorLibPath(String dbType)
[THROWS-WHEN] RuntimeException when resource != null && try-body throws
[THROWS-WHEN] RuntimeException when !(resource != null)
[PATH1] if(resource != null)=T -> try-body throws -> throw new RuntimeException("找不到驱动文件,请联系开发者"... | /* static context
[FOCAL] public static String ConfigHelper.findConnectorLibPath(String dbType)
[THROWS-WHEN] RuntimeException when resource != null && try-body throws
[THROWS-WHEN] RuntimeException when !(resource != null)
[PATH1] if(resource != null)=T -> try-body throws -> throw new RuntimeException("找不到驱动文件,请联系开发者"... | true | ok | {"focal": {"class": "ConfigHelper", "name": "findConnectorLibPath", "signature": "String findConnectorLibPath(String dbType)", "start_line": 3, "modifiers": "public static", "params": [{"name": "dbType", "type": "String"}], "return_type": "String"}, "class_info": {"name": "ConfigHelper", "kind": "class", "modifiers": "... |
185576294_6 | class SynchronizedMarkHolder extends MarkHolder {
@Override
public synchronized void event(
long gen, String eventName, String tagName, long tagId, long nanoTime) {
writeNnss(gen + EVENT_N2S2_OP, nanoTime, tagId, eventName, tagName);
}
SynchronizedMarkHolder();
SynchronizedMarkHolder(int maxEv... | mh.event(gen, "task1", 8);
mh.event(gen, "task2", 5);
List<Mark> marks = mh.read(false);
assertEquals(2, marks.size());
List<Mark> expected = Arrays.asList(Mark.event(gen, 8, "task1"), Mark.event(gen, 5, "task2"));
assertEquals(expected, marks);
}
} | [FOCAL] @Override public synchronized void SynchronizedMarkHolder.event(long gen, String eventName, String tagName, long tagId, long nanoTime)
[CLASS] class SynchronizedMarkHolder extends MarkHolder
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void writeNnss(long genOp, long n0,... | /* static context
[FOCAL] @Override public synchronized void SynchronizedMarkHolder.event(long gen, String eventName, String tagName, long tagId, long nanoTime)
[CALLS-INTERNAL] void writeNnss(long genOp, long n0, long n1, String s0, String s1)
*/
| /* static context
[FOCAL] @Override public synchronized void SynchronizedMarkHolder.event(long gen, String eventName, String tagName, long tagId, long nanoTime)
[CALLS-INTERNAL] void writeNnss(long genOp, long n0, long n1, String s0, String s1)
*/
class SynchronizedMarkHolder extends MarkHolder {
@Override
public ... | true | ok | {"focal": {"class": "SynchronizedMarkHolder", "name": "event", "signature": "void event(long gen, String eventName, String tagName, long tagId, long nanoTime)", "start_line": 3, "modifiers": "@Override public synchronized", "params": [{"name": "gen", "type": "long"}, {"name": "eventName", "type": "String"}, {"name": "t... |
185739179_51 | class PmdSensor implements Sensor {
@Override
public void execute(SensorContext context) {
if (shouldExecuteOnProject()) {
for (RuleViolation violation : executor.execute()) {
pmdViolationRecorder.saveViolation(violation, context);
}
}
}
public ... |
// given
addOneJavaFile(Type.MAIN);
final RuleViolation pmdViolation = violation();
final Report report = report(pmdViolation);
when(executor.execute()).thenReturn(report);
// when
pmdSensor.execute(sensorContext);
// then
verify(pmdViolationRec... | [FOCAL] @Override public void PmdSensor.execute(SensorContext context)
[CLASS] class PmdSensor implements Sensor
[METRICS] loc=8 cc=3 branches=1 loops=1 returns=0 throws=0 nesting=2
[CALLS-INTERNAL] boolean shouldExecuteOnProject()
[CALLS-EXTERNAL] PmdExecutor.execute/0, PmdViolationRecorder.saveViolation/2
[FIELDS] re... | /* static context
[FOCAL] @Override public void PmdSensor.execute(SensorContext context)
[PATH1] if(shouldExecuteOnProject())=T -> foreach(RuleViolation violation : executor.execute())=T -> exit loop
[PATH2] if(shouldExecuteOnProject())=F
[PATH3] if(shouldExecuteOnProject())=T -> foreach(RuleViolation violation : execu... | /* static context
[FOCAL] @Override public void PmdSensor.execute(SensorContext context)
[PATH1] if(shouldExecuteOnProject())=T -> foreach(RuleViolation violation : executor.execute())=T -> exit loop
[PATH2] if(shouldExecuteOnProject())=F
[PATH3] if(shouldExecuteOnProject())=T -> foreach(RuleViolation violation : execu... | true | ok | {"focal": {"class": "PmdSensor", "name": "execute", "signature": "void execute(SensorContext context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "context", "type": "SensorContext"}], "return_type": "void"}, "class_info": {"name": "PmdSensor", "kind": "class", "modifiers": "", "superclass": ... |
185821779_6 | class OAuthUserProvider extends AbstractProvider<OAuthUser> {
@Override
public OAuthUser take() {
var user = userSessionRepository.take().getUser();
if (user instanceof OAuthUser) {
return (OAuthUser) user;
}
throw new NoUserFoundException("No OAuth users found in the repository.");
}
... |
var oAuthUser1 = new OAuthUserImpl(null,
TEST_USER_1,
TEST_PW,
ACCESS_TOKEN,
REFRESH_TOKEN,
SCOPE,
CLIENT_ID,
USER_ID,
US_REGION
);
var userSession = new UserSessionImpl(oAuthUser1);
when(repo.take()).thenReturn(userSession, userSession, u... | [FOCAL] @Override public OAuthUser OAuthUserProvider.take()
[CLASS] class OAuthUserProvider extends AbstractProvider<OAuthUser>
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] userSessionRepository.take().getUser/0, userSessionRepository.take/0
[NEW] NoUserFoundException
[EXCEPTIO... | /* static context
[FOCAL] @Override public OAuthUser OAuthUserProvider.take()
[THROWS-WHEN] NoUserFoundException when !(user instanceof OAuthUser)
[PATH1] if(user instanceof OAuthUser)=T -> return (OAuthUser) user
[PATH2] if(user instanceof OAuthUser)=F -> throw new NoUserFoundException("No OAuth users found in the rep... | /* static context
[FOCAL] @Override public OAuthUser OAuthUserProvider.take()
[THROWS-WHEN] NoUserFoundException when !(user instanceof OAuthUser)
[PATH1] if(user instanceof OAuthUser)=T -> return (OAuthUser) user
[PATH2] if(user instanceof OAuthUser)=F -> throw new NoUserFoundException("No OAuth users found in the rep... | true | ok | {"focal": {"class": "OAuthUserProvider", "name": "take", "signature": "OAuthUser take()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "OAuthUser"}, "class_info": {"name": "OAuthUserProvider", "kind": "class", "modifiers": "", "superclass": "AbstractProvider<OAuthUser>", "interfaces": ... |
185828241_1 | class EmployeeRepository {
public boolean exists(long id) {
String sqlQuery = "select count(*) from employees where id = ?";
//noinspection ConstantConditions: return value is always an int, so NPE is impossible here
int result = jdbcTemplate.queryForObject(sqlQuery, Integer.class, id);
return resu... | boolean exists = employeeRepository.exists(-1);
assertThat(exists).isFalse();
}
} | [FOCAL] public boolean EmployeeRepository.exists(long id)
[CLASS] class EmployeeRepository
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] JdbcTemplate.queryForObject/3
[FIELDS] read=jdbcTemplate:JdbcTemplate
[INPUTS] branches=- | result=id, jdbcTemplate
[COLLABORATORS] field jdbcT... | /* static context
[FOCAL] public boolean EmployeeRepository.exists(long id)
[INPUTS] branches=- | result=id, jdbcTemplate
[COLLABORATORS] field jdbcTemplate:JdbcTemplate queryForObject/3
[FIELDS] read=jdbcTemplate:JdbcTemplate
[CALLS-EXTERNAL] JdbcTemplate.queryForObject/3
*/
| /* static context
[FOCAL] public boolean EmployeeRepository.exists(long id)
[INPUTS] branches=- | result=id, jdbcTemplate
[COLLABORATORS] field jdbcTemplate:JdbcTemplate queryForObject/3
[FIELDS] read=jdbcTemplate:JdbcTemplate
[CALLS-EXTERNAL] JdbcTemplate.queryForObject/3
*/
class EmployeeRepository {
public boolea... | true | ok | {"focal": {"class": "EmployeeRepository", "name": "exists", "signature": "boolean exists(long id)", "start_line": 3, "modifiers": "public", "params": [{"name": "id", "type": "long"}], "return_type": "boolean"}, "class_info": {"name": "EmployeeRepository", "kind": "class", "modifiers": "", "superclass": null, "interface... |
185871137_25 | class AbstractResponseDecoder implements ResponseDecoder {
@SuppressWarnings("unchecked")
@Override
public <T> T decode(Response response, Class<T> type) {
try {
if (byte[].class.equals(type)) {
return (T) response.toByteArray();
} else if (InputStream.class.isAssignableFrom(type)) {
... | this.decoder.decode(this.response, FileInputStream.class);
verify(response, times(1)).body();
}
} | [FOCAL] @SuppressWarnings("unchecked") @Override public T AbstractResponseDecoder.decode(Response response, Class<T> type)
[CLASS] class AbstractResponseDecoder implements ResponseDecoder
[METRICS] loc=23 cc=5 branches=3 loops=0 returns=4 throws=1 nesting=3
[CALLS-INTERNAL] T decodeInternal(Response response, Class<T> ... | /* static context
[FOCAL] @SuppressWarnings("unchecked") @Override public T AbstractResponseDecoder.decode(Response response, Class<T> type)
[THROWS-WHEN] FeignException when try-body throws
[PATH1] if(byte[].class.equals(type))=F -> if(InputStream.class.isAssignableFrom(type))=F -> if(response == null || response.body... | /* static context
[FOCAL] @SuppressWarnings("unchecked") @Override public T AbstractResponseDecoder.decode(Response response, Class<T> type)
[THROWS-WHEN] FeignException when try-body throws
[PATH1] if(byte[].class.equals(type))=F -> if(InputStream.class.isAssignableFrom(type))=F -> if(response == null || response.body... | true | ok | {"focal": {"class": "AbstractResponseDecoder", "name": "decode", "signature": "T decode(Response response, Class<T> type)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") @Override public", "params": [{"name": "response", "type": "Response"}, {"name": "type", "type": "Class<T>"}], "return_type": "T"}, ... |
186282860_2 | class ml2en {
public String convert(String input, boolean capitalize) {
return transliterate(input, capitalize);
}
public ml2en();
public void initVars();
String transliterate(String input, boolean capitalize);
String _replaceModifiedGlyphs(Map glyphs, String input);
String jo... | ml2en m = new ml2en();
assertEquals("Oru phranchu ganithashaasthrajnjanum bhauthikashaasthrajnjanum raashtreeyakkaaranumaayirunnu lasaare kaarnottu.",
m.convert("ഒരു ഫ്രഞ്ച് ഗണിതശാസ്ത്രജ്ഞനും ഭൗതികശാസ്ത്രജ്ഞനും രാഷ്ട്രീയക്കാരനുമായിരുന്നു ലസാരെ കാർനോട്ട്."));
assertEquals("2019 e... | [FOCAL] public String ml2en.convert(String input, boolean capitalize)
[CLASS] class ml2en
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String transliterate(String input, boolean capitalize)
[INPUTS] branches=- | result=capitalize, input
[DATAFLOW] capitalize@param->L2; input@par... | /* static context
[FOCAL] public String ml2en.convert(String input, boolean capitalize)
[INPUTS] branches=- | result=capitalize, input
[CALLS-INTERNAL] String transliterate(String input, boolean capitalize)
*/
| /* static context
[FOCAL] public String ml2en.convert(String input, boolean capitalize)
[INPUTS] branches=- | result=capitalize, input
[CALLS-INTERNAL] String transliterate(String input, boolean capitalize)
*/
class ml2en {
public String convert(String input, boolean capitalize) {
return transliterate(inpu... | true | ok | {"focal": {"class": "ml2en", "name": "convert", "signature": "String convert(String input, boolean capitalize)", "start_line": 3, "modifiers": "public", "params": [{"name": "input", "type": "String"}, {"name": "capitalize", "type": "boolean"}], "return_type": "String"}, "class_info": {"name": "ml2en", "kind": "class", ... |
186347363_1 | class RevokeTokenService {
public void revokeToken(TokenTypeHint tokenTypeHint, String token, String clientId) {
if (TokenTypeHint.refresh_token.equals(tokenTypeHint)) {
revokeRefreshToken(token, clientId);
} else {
revokeAccessToken(token, clientId);
}
}
pr... | // given
String token = "accessToken";
doReturn(this.authentication).when(tokenStore).readAuthentication(token);
// when
revokeTokenService.revokeToken(TokenTypeHint.access_token, token, clientId);
// then
verify(tokenStore).readAuthentication(token);
v... | [FOCAL] public void RevokeTokenService.revokeToken(TokenTypeHint tokenTypeHint, String token, String clientId)
[CLASS] class RevokeTokenService
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] void revokeAccessToken(String token, String clientId); void revokeRefreshToken(String toke... | /* static context
[FOCAL] public void RevokeTokenService.revokeToken(TokenTypeHint tokenTypeHint, String token, String clientId)
[PATH1] if(TokenTypeHint.refresh_token.equals(tokenTypeHint))=T
[PATH2] if(TokenTypeHint.refresh_token.equals(tokenTypeHint))=F
[INPUTS] branches=tokenTypeHint | result=-
[CALLS-INTERNAL] voi... | /* static context
[FOCAL] public void RevokeTokenService.revokeToken(TokenTypeHint tokenTypeHint, String token, String clientId)
[PATH1] if(TokenTypeHint.refresh_token.equals(tokenTypeHint))=T
[PATH2] if(TokenTypeHint.refresh_token.equals(tokenTypeHint))=F
[INPUTS] branches=tokenTypeHint | result=-
[CALLS-INTERNAL] voi... | true | ok | {"focal": {"class": "RevokeTokenService", "name": "revokeToken", "signature": "void revokeToken(TokenTypeHint tokenTypeHint, String token, String clientId)", "start_line": 3, "modifiers": "public", "params": [{"name": "tokenTypeHint", "type": "TokenTypeHint"}, {"name": "token", "type": "String"}, {"name": "clientId", "... |
186361323_1 | class StrKit {
public static String firstCharToUpperCase(String str) {
char firstChar = str.charAt(0);
if (firstChar >= 'a' && firstChar <= 'z') {
char[] arr = str.toCharArray();
arr[0] -= ('a' - 'A');
return new String(arr);
}
return str;
}
... | Assert.assertEquals("BAZ", StrKit.firstCharToUpperCase("BAZ"));
Assert.assertEquals("Foo", StrKit.firstCharToUpperCase("foo"));
}
} | [FOCAL] public static String StrKit.firstCharToUpperCase(String str)
[CLASS] class StrKit
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] String.charAt/1, String.toCharArray/0
[NEW] String
[PATH1] if(firstChar >= 'a' && firstChar <= 'z')=T -> return new String(arr)
[PATH2] if(first... | /* static context
[FOCAL] public static String StrKit.firstCharToUpperCase(String str)
[PATH1] if(firstChar >= 'a' && firstChar <= 'z')=T -> return new String(arr)
[PATH2] if(firstChar >= 'a' && firstChar <= 'z')=F -> return str
[INPUTS] branches=str | result=str
[NEW] String
[CALLS-EXTERNAL] String.charAt/1, String.to... | /* static context
[FOCAL] public static String StrKit.firstCharToUpperCase(String str)
[PATH1] if(firstChar >= 'a' && firstChar <= 'z')=T -> return new String(arr)
[PATH2] if(firstChar >= 'a' && firstChar <= 'z')=F -> return str
[INPUTS] branches=str | result=str
[NEW] String
[CALLS-EXTERNAL] String.charAt/1, String.to... | true | ok | {"focal": {"class": "StrKit", "name": "firstCharToUpperCase", "signature": "String firstCharToUpperCase(String str)", "start_line": 3, "modifiers": "public static", "params": [{"name": "str", "type": "String"}], "return_type": "String"}, "class_info": {"name": "StrKit", "kind": "class", "modifiers": "", "superclass": n... |
186387230_2 | class CertificationImporter {
abstract Certification load()abstract Certification load();
abstract Certification load()public CertificationImporter();
abstract Certification load()abstract String getName();
}
class CertificationImporterTest {
@Test
void testImporters() {
| var service = this.engine.getService(CertificationService.class);
service.loadImporters();
for (var certificationId : service.getImporters().keySet()) {
var certification = service.load(certificationId);
assertNotNull(certification);
assertFalse(certification.getControls().isEmpty());
... | [FOCAL] abstract Certification CertificationImporter.load()
[CLASS] class CertificationImporter
[METRICS] loc=1 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CLASS-MEMBERS] CertificationImporter(); String getName()
[TEST] CertificationImporterTest: @Test void testImporters() | /* static context
[FOCAL] abstract Certification CertificationImporter.load()
*/
| /* static context
[FOCAL] abstract Certification CertificationImporter.load()
*/
class CertificationImporter {
abstract Certification load()abstract Certification load();
abstract Certification load()public CertificationImporter();
abstract Certification load()abstract String getName();
}
class CertificationImpor... | true | partial | {"focal": {"class": "CertificationImporter", "name": "load", "signature": "Certification load()", "start_line": 3, "modifiers": "abstract", "params": [], "return_type": "Certification"}, "class_info": {"name": "CertificationImporter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [... |
186525996_1 | class Friend {
public Friend() {
}
public Friend();
public Friend(Long userId1, Long userId2, Integer status);
public Friend(Long userId1, Long userId2);
public Friend(Long id, Long userId1, Long userId2);
public Long getUserId1();
public void setStatus(Integer status);
public... | Friend friend = new Friend(1L, 1L, 1L);
Assert.assertEquals((Long)1L, friend.getId());
Friend friend2 = new Friend(1L, 1L, 1);
Assert.assertEquals((Integer)1, friend2.getStatus());
}
} | [FOCAL] public Friend.Friend()
[CLASS] class Friend
[METRICS] loc=2 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CLASS-MEMBERS] Friend(); Friend(Long userId1, Long userId2, Integer status); Friend(Long userId1, Long userId2); Friend(Long id, Long userId1, Long userId2); Long getUserId1(); void setStatus(Intege... | /* static context
[FOCAL] public Friend.Friend()
*/
| /* static context
[FOCAL] public Friend.Friend()
*/
class Friend {
public Friend() {
}
public Friend();
public Friend(Long userId1, Long userId2, Integer status);
public Friend(Long userId1, Long userId2);
public Friend(Long id, Long userId1, Long userId2);
public Long getUserId1();
... | true | ok | {"focal": {"class": "Friend", "name": "Friend", "signature": "Friend()", "start_line": 3, "modifiers": "public", "params": [], "return_type": null}, "class_info": {"name": "Friend", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Friend", "kind": "constructo... |
186556620_53 | class WebConfigurer implements ServletContextInitializer, WebServerFactoryCustomizer<WebServerFactory> {
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
if (env.getActiveProfiles().length != 0) {
log.info("Web application configuration, using profile... | env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION);
webConfigurer.onStartup(servletContext);
verify(servletContext, never()).addServlet(eq("H2Console"), any(WebServlet.class));
}
} | [FOCAL] @Override public void WebConfigurer.onStartup(ServletContext servletContext)
[CLASS] class WebConfigurer implements ServletContextInitializer, WebServerFactoryCustomizer<WebServerFactory>
[METRICS] loc=11 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] void initH2Console(ServletContext ser... | /* static context
[FOCAL] @Override public void WebConfigurer.onStartup(ServletContext servletContext)
[PATH1] if(env.getActiveProfiles().length != 0)=T -> if(env.acceptsProfiles(Profiles.of(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)))=T
[PATH2] if(env.getActiveProfiles().length != 0)=F -> if(env.acceptsProfiles(Pro... | /* static context
[FOCAL] @Override public void WebConfigurer.onStartup(ServletContext servletContext)
[PATH1] if(env.getActiveProfiles().length != 0)=T -> if(env.acceptsProfiles(Profiles.of(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)))=T
[PATH2] if(env.getActiveProfiles().length != 0)=F -> if(env.acceptsProfiles(Pro... | true | ok | {"focal": {"class": "WebConfigurer", "name": "onStartup", "signature": "void onStartup(ServletContext servletContext) throws ServletException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "servletContext", "type": "ServletContext"}], "return_type": "void"}, "class_info": {"name": "WebConfigure... |
186642789_1 | class CompanyFixed {
public EmployeeFixed findEmployeeById(String id)
{
return this.employees.stream()
.filter(e -> e.getId().equals(id))
.findFirst()
.orElse(null);
}
public CompanyFixed(String newName);
public String getName();
public... | /*
* TEST SMELL: No assertions
*/
this.company.addEmployee(new EmployeeFixed("123", "Dave", 100_000.00));
this.company.addEmployee(new EmployeeFixed("456", "Alice", 100_000.00));
this.company.addEmployee(new EmployeeFixed("789", "Bob", 100_000.00));
Employee... | [FOCAL] public EmployeeFixed CompanyFixed.findEmployeeById(String id)
[CLASS] class CompanyFixed
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] this.employees.stream() .filter(e -> e.getId().equals(id)....orElse/1, this.employees.stream() .filter(e -> e.getId().equals(id)).findFir... | /* static context
[FOCAL] public EmployeeFixed CompanyFixed.findEmployeeById(String id)
[INPUTS] branches=- | result=id
[COLLABORATORS] field employees stream/0; field e getId/0
[FIELDS] read=employees
[CALLS-EXTERNAL] this.employees.stream() .filter(e -> e.getId().equals(id)....orElse/1, this.employees.stream() .filte... | /* static context
[FOCAL] public EmployeeFixed CompanyFixed.findEmployeeById(String id)
[INPUTS] branches=- | result=id
[COLLABORATORS] field employees stream/0; field e getId/0
[FIELDS] read=employees
[CALLS-EXTERNAL] this.employees.stream() .filter(e -> e.getId().equals(id)....orElse/1, this.employees.stream() .filte... | true | ok | {"focal": {"class": "CompanyFixed", "name": "findEmployeeById", "signature": "EmployeeFixed findEmployeeById(String id)", "start_line": 3, "modifiers": "public", "params": [{"name": "id", "type": "String"}], "return_type": "EmployeeFixed"}, "class_info": {"name": "CompanyFixed", "kind": "class", "modifiers": "", "super... |
186955716_0 | class ReservationClient {
public Flux<Reservation> getAllReservations() {
return this.client.get()
.uri("http://localhost:8080/reservations")
.retrieve()
.bodyToFlux(Reservation.class);
}
@Autowired
private ReservationClient client;
@Autowired
private ObjectMapper objectMapper;
}
class ReservationC... | /*
List<Reservation> reservations = Arrays.asList(new Reservation("1", "Jane"), new Reservation("2", "John"));
List<String> validNames = reservations.stream().map(r -> r.getReservationName()).collect(Collectors.toList());
String json = this.jsonFrom(reservations);
WireMock.stubFor(WireMock.get(WireMock.urlEq... | [FOCAL] public Flux<Reservation> ReservationClient.getAllReservations()
[CLASS] class ReservationClient
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] this.client.get() .uri("http://localhost:8080/reservation....bodyToFlux/1, this.client.get() .uri("http://localhost:8080/reservati... | /* static context
[FOCAL] public Flux<Reservation> ReservationClient.getAllReservations()
[INPUTS] branches=- | result=client
[COLLABORATORS] field client:ReservationClient get/0
[FIELDS] read=client:ReservationClient
[CALLS-EXTERNAL] this.client.get() .uri("http://localhost:8080/reservation....bodyToFlux/1, this.clien... | /* static context
[FOCAL] public Flux<Reservation> ReservationClient.getAllReservations()
[INPUTS] branches=- | result=client
[COLLABORATORS] field client:ReservationClient get/0
[FIELDS] read=client:ReservationClient
[CALLS-EXTERNAL] this.client.get() .uri("http://localhost:8080/reservation....bodyToFlux/1, this.clien... | true | ok | {"focal": {"class": "ReservationClient", "name": "getAllReservations", "signature": "Flux<Reservation> getAllReservations()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Flux<Reservation>"}, "class_info": {"name": "ReservationClient", "kind": "class", "modifiers": "", "superclass": null, "inte... |
186978836_31 | class GroupKey {
public static String getKeyTenant(String dataId, String group, String tenant) {
return doGetKey(dataId, group, tenant);
}
public static String getKey(String dataId, String group);
public static String getKey(String dataId, String group, String datumStr);
private static Str... |
// Act
final String actual = GroupKey.getKeyTenant("\u0000\u0000", "%+", null);
// Assert result
Assert.assertEquals("\u0000\u0000+%25%2B", actual);
}
} | [FOCAL] public static String GroupKey.getKeyTenant(String dataId, String group, String tenant)
[CLASS] class GroupKey
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String doGetKey(String dataId, String group, String datumStr)
[INPUTS] branches=- | result=dataId, group, tenant
[DA... | /* static context
[FOCAL] public static String GroupKey.getKeyTenant(String dataId, String group, String tenant)
[INPUTS] branches=- | result=dataId, group, tenant
[CALLS-INTERNAL] String doGetKey(String dataId, String group, String datumStr)
*/
| /* static context
[FOCAL] public static String GroupKey.getKeyTenant(String dataId, String group, String tenant)
[INPUTS] branches=- | result=dataId, group, tenant
[CALLS-INTERNAL] String doGetKey(String dataId, String group, String datumStr)
*/
class GroupKey {
public static String getKeyTenant(String dataId, Str... | true | ok | {"focal": {"class": "GroupKey", "name": "getKeyTenant", "signature": "String getKeyTenant(String dataId, String group, String tenant)", "start_line": 3, "modifiers": "public static", "params": [{"name": "dataId", "type": "String"}, {"name": "group", "type": "String"}, {"name": "tenant", "type": "String"}], "return_type... |
187556247_613 | class Spoon extends ApplicationWindow implements AddUndoPositionInterface, TabListener, SpoonInterface,
OverwritePrompter, PDIObserver, LifeEventHandler, XulEventSource, XulEventHandler, PartitionSchemasProvider {
public void openFile() {
openFile( false );
}
private Spoon();
private Spoon( Repository... | String repositoryName = null;
String fileName = "fileName";
setLoadLastUsedJobLocalWithRepository( false, repositoryName, null, fileName, false );
verify( spoon ).openFile( fileName, false );
}
} | [FOCAL] public void Spoon.openFile()
[CLASS] class Spoon extends ApplicationWindow implements AddUndoPositionInterface, TabListener, SpoonInterface, OverwritePrompter, PDIObserver, LifeEventHandler, XulEventSource, XulEventHandler, PartitionSchemasProvider
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nest... | class Spoon extends ApplicationWindow implements AddUndoPositionInterface, TabListener, SpoonInterface,
OverwritePrompter, PDIObserver, LifeEventHandler, XulEventSource, XulEventHandler, PartitionSchemasProvider {
public void openFile() {
openFile( false );
}
private Spoon();
private Spoon( Repository... | false | ok | {"focal": {"class": "Spoon", "name": "openFile", "signature": "void openFile()", "start_line": 4, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "Spoon", "kind": "class", "modifiers": "", "superclass": "ApplicationWindow", "interfaces": "AddUndoPositionInterface, TabListener, SpoonI... | |
187590023_3 | class PersonServiceImpl implements PersonService {
@CacheEvict(value = "people", key = "#id")
@Override
public void remove(Long id) {
log.info("删除了id、key为" + id + "的数据缓存");
}
@Cacheable(value = "people" , key = "#person.id") @Override public Person save(Person person);
@CacheEvict(valu... | Person p = new Person(5, "name1", 12, "address1");
personService.save(p);
log.info("缓存中一个缓存 id = 5 的 Person 对象");
personService.remove(5L);
log.info("删除一个缓存 id = 5 的 Person 对象");
Person person = personService.findOne(p);
log.info("从数据库中抓取一个 id = 2 的对象,并存入缓存");
... | [FOCAL] @CacheEvict(value = "people", key = "#id") @Override public void PersonServiceImpl.remove(Long id)
[CLASS] class PersonServiceImpl implements PersonService
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] log.info/1
[DATAFLOW] id@param->L4
[CLASS-MEMBERS] Person save(Person ... | /* static context
[FOCAL] @CacheEvict(value = "people", key = "#id") @Override public void PersonServiceImpl.remove(Long id)
[CALLS-EXTERNAL] log.info/1
*/
| /* static context
[FOCAL] @CacheEvict(value = "people", key = "#id") @Override public void PersonServiceImpl.remove(Long id)
[CALLS-EXTERNAL] log.info/1
*/
class PersonServiceImpl implements PersonService {
@CacheEvict(value = "people", key = "#id")
@Override
public void remove(Long id) {
log.info(... | true | ok | {"focal": {"class": "PersonServiceImpl", "name": "remove", "signature": "void remove(Long id)", "start_line": 3, "modifiers": "@CacheEvict(value = \"people\", key = \"#id\") @Override public", "params": [{"name": "id", "type": "Long"}], "return_type": "void"}, "class_info": {"name": "PersonServiceImpl", "kind": "class"... |
187595602_12 | class WindowsProxyUtils {
static ProxyProvider createInternalProxy(final DeploymentConfiguration config, final RegistryQueryResult queryResult) throws IOException {
final String autoConfigUrl = queryResult.getValue(AUTO_CONFIG_URL_VAL);
if (autoConfigUrl != null) {
LOG.debug("Registry v... | //given
final DeploymentConfiguration config = new DeploymentConfiguration();
final Map<String, RegistryValue> proxyRegistryEntries = new HashMap<>();
proxyRegistryEntries.put(PROXY_ENABLED_VAL, new RegistryValue(PROXY_ENABLED_VAL, REG_DWORD, "0x0"));
final RegistryQueryResult qu... | [FOCAL] static ProxyProvider WindowsProxyUtils.createInternalProxy(DeploymentConfiguration config, RegistryQueryResult queryResult)
[CLASS] class WindowsProxyUtils
[METRICS] loc=24 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=3
[CALLS-INTERNAL] ProxyConfigurationImpl getProxyConfiguration(RegistryQueryResult quer... | /* static context
[FOCAL] static ProxyProvider WindowsProxyUtils.createInternalProxy(DeploymentConfiguration config, RegistryQueryResult queryResult)
[PATH1] if(autoConfigUrl != null)=F -> if(proxyEnabledValue)=T -> if(proxyServerValue != null)=T -> return new ConfigBasedProvider(proxyConfiguration)
[PATH2] if(autoConf... | /* static context
[FOCAL] static ProxyProvider WindowsProxyUtils.createInternalProxy(DeploymentConfiguration config, RegistryQueryResult queryResult)
[PATH1] if(autoConfigUrl != null)=F -> if(proxyEnabledValue)=T -> if(proxyServerValue != null)=T -> return new ConfigBasedProvider(proxyConfiguration)
[PATH2] if(autoConf... | true | ok | {"focal": {"class": "WindowsProxyUtils", "name": "createInternalProxy", "signature": "ProxyProvider createInternalProxy(DeploymentConfiguration config, RegistryQueryResult queryResult) throws IOException", "start_line": 3, "modifiers": "static", "params": [{"name": "config", "type": "DeploymentConfiguration"}, {"name":... |
187648701_0 | class PlaceOpObjectHelper {
protected static void generateDiff(OpObject editObject, String field, Map<String, Object> change,
Map<String, Object> current, Map<String, Object> oldM, Map<String, Object> newM) {
TreeSet<String> removedTags = new TreeSet<>(oldM.keySet());
removedTags.removeAll(newM.keySet());
fo... | OpObject opObject = null;
String field = F_TAGS + ".";
Map<String, Object> change = new TreeMap<>();
Map<String, Object> current = new TreeMap<>();
Map<String, Object> oldM = new TreeMap<>();
oldM.put("addr:city", "台北市");
oldM.put("amenity", "cafe");
oldM.put("http://touat.com.tw", "running");
Map<Str... | [FOCAL] protected static void PlaceOpObjectHelper.generateDiff(OpObject editObject, String field, Map<String, Object> change, Map<String, Object> current, Map<String, Object> oldM, Map<String, Object> newM)
[CLASS] class PlaceOpObjectHelper
[METRICS] loc=19 cc=5 branches=2 loops=2 returns=0 throws=0 nesting=3
[CALLS-IN... | /* static context
[FOCAL] protected static void PlaceOpObjectHelper.generateDiff(OpObject editObject, String field, Map<String, Object> change, Map<String, Object> current, Map<String, Object> oldM, Map<String, Object> newM)
[PATH1] foreach(String removedTag : removedTags)=F -> foreach(String tag : newM.keySet())=T -> ... | /* static context
[FOCAL] protected static void PlaceOpObjectHelper.generateDiff(OpObject editObject, String field, Map<String, Object> change, Map<String, Object> current, Map<String, Object> oldM, Map<String, Object> newM)
[PATH1] foreach(String removedTag : removedTags)=F -> foreach(String tag : newM.keySet())=T -> ... | true | ok | {"focal": {"class": "PlaceOpObjectHelper", "name": "generateDiff", "signature": "void generateDiff(OpObject editObject, String field, Map<String, Object> change, Map<String, Object> current, Map<String, Object> oldM, Map<String, Object> newM)", "start_line": 3, "modifiers": "protected static", "params": [{"name": "edit... |
187765477_5 | class HttpSource extends AbstractSource<HttpResourceId> implements NonListenableSource<HttpResourceId> {
@Override
public LoadedResource loadIfModified(HttpResourceId resourceId, SourceVersion version) {
var cacheControl = resourceId.getCacheControl();
if (version == SourceVersion.EMPTY || cach... | var response = aResponse().withStatus(200).withHeader("ETag", "1ab");
stubFor(headPath().willReturn(response));
stubFor(getPath().willReturn(response.withBody("init")));
var source = Http.builder().receiveBufferSize(5).build();
var id = Http.url(defaultURL(), ETAG_HEAD);
... | [FOCAL] @Override public LoadedResource HttpSource.loadIfModified(HttpResourceId resourceId, SourceVersion version)
[CLASS] class HttpSource extends AbstractSource<HttpResourceId> implements NonListenableSource<HttpResourceId>
[METRICS] loc=17 cc=6 branches=5 loops=0 returns=5 throws=0 nesting=5
[CALLS-INTERNAL] Loaded... | /* static context
[FOCAL] @Override public LoadedResource HttpSource.loadIfModified(HttpResourceId resourceId, SourceVersion version)
[PATH1] if(version == SourceVersion.EMPTY || cacheControl == CacheControlStrategy.NONE)=F -> if(cacheControl == CacheControlStrategy.ETAG)=F -> if(cacheControl == CacheControlStrategy.IF... | /* static context
[FOCAL] @Override public LoadedResource HttpSource.loadIfModified(HttpResourceId resourceId, SourceVersion version)
[PATH1] if(version == SourceVersion.EMPTY || cacheControl == CacheControlStrategy.NONE)=F -> if(cacheControl == CacheControlStrategy.ETAG)=F -> if(cacheControl == CacheControlStrategy.IF... | true | ok | {"focal": {"class": "HttpSource", "name": "loadIfModified", "signature": "LoadedResource loadIfModified(HttpResourceId resourceId, SourceVersion version)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "resourceId", "type": "HttpResourceId"}, {"name": "version", "type": "SourceVersion"}], "retur... |
187767967_2 | class JavaTypeInspector implements ITypeInspector {
@Override
public boolean isCollection(Type type) {
if (type instanceof Class)
{
var clazz = (Class)type;
if (clazz.isArray()) {
return true;
}
if (Collection.class.isAssignableFr... | var type = TestJavaTypeInspector.class.getMethod("test1").getGenericReturnType();
assertTrue(_typeInspector.isCollection(type));
}
} | [FOCAL] @Override public boolean JavaTypeInspector.isCollection(Type type)
[CLASS] class JavaTypeInspector implements ITypeInspector
[METRICS] loc=20 cc=5 branches=4 loops=0 returns=4 throws=0 nesting=2
[CALLS-EXTERNAL] var.isArray/0, Collection.class.isAssignableFrom/1, isCollection/1 (inherited), ((ParameterizedType)... | /* static context
[FOCAL] @Override public boolean JavaTypeInspector.isCollection(Type type)
[PATH1] if(type instanceof Class)=T -> if(clazz.isArray())=F -> if(Collection.class.isAssignableFrom(clazz))=T -> return true
[PATH2] if(type instanceof Class)=F -> if(type instanceof ParameterizedType)=T -> return isCollection... | /* static context
[FOCAL] @Override public boolean JavaTypeInspector.isCollection(Type type)
[PATH1] if(type instanceof Class)=T -> if(clazz.isArray())=F -> if(Collection.class.isAssignableFrom(clazz))=T -> return true
[PATH2] if(type instanceof Class)=F -> if(type instanceof ParameterizedType)=T -> return isCollection... | true | ok | {"focal": {"class": "JavaTypeInspector", "name": "isCollection", "signature": "boolean isCollection(Type type)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "type", "type": "Type"}], "return_type": "boolean"}, "class_info": {"name": "JavaTypeInspector", "kind": "class", "modifiers": "", "super... |
187873041_1 | class DefaultDatabasePermissionManagement extends ClusterSynchronizedPermissionManagement implements DefaultSynchronizedPermissionManagement, DefaultPermissionManagement {
@Override
public Collection<IPermissionGroup> getGroups() {
for (IPermissionGroup permissionGroup : this.permissionGroupsMap.values... | String groupName = "Test", userName = "Tester", permission = "test.permission", groupPermission = "role.permission";
new File("build/h2database.mv.db").delete();
new File("build/group_permissions.json").delete();
AbstractDatabaseProvider databaseProvider = new H2DatabaseProvider("build... | [FOCAL] @Override public Collection<IPermissionGroup> DefaultDatabasePermissionManagement.getGroups()
[CLASS] class DefaultDatabasePermissionManagement extends ClusterSynchronizedPermissionManagement implements DefaultSynchronizedPermissionManagement, DefaultPermissionManagement
[METRICS] loc=10 cc=3 branches=1 loops=1... | class DefaultDatabasePermissionManagement extends ClusterSynchronizedPermissionManagement implements DefaultSynchronizedPermissionManagement, DefaultPermissionManagement {
@Override
public Collection<IPermissionGroup> getGroups() {
for (IPermissionGroup permissionGroup : this.permissionGroupsMap.values... | false | ok | {"focal": {"class": "DefaultDatabasePermissionManagement", "name": "getGroups", "signature": "Collection<IPermissionGroup> getGroups()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Collection<IPermissionGroup>"}, "class_info": {"name": "DefaultDatabasePermissionManagement", "kind": "... | |
187946264_2 | class RouterFunctions {
public static <T extends ServerResponse> RouterFunction<T> route(
RequestPredicate predicate, HandlerFunction<T> handlerFunction) {
return new DefaultRouterFunction<>(predicate, handlerFunction);
}
public static RouterFunction<T> nest(
RequestPredicate predicate, RouterFunction<T> ... | RouterFunction<ServerResponse> routerFunction1 = request -> Mono.empty();
RequestPredicate requestPredicate = request -> true;
RouterFunction<ServerResponse> result = routerFunction1.andRoute(requestPredicate, this::handlerMethod);
assertNotNull(result);
MockServerRequest request = MockServerRequest.builder... | [FOCAL] public static RouterFunction<T> RouterFunctions.route(RequestPredicate predicate, HandlerFunction<T> handlerFunction)
[CLASS] class RouterFunctions
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] DefaultRouterFunction<>
[INPUTS] branches=- | result=handlerFunction, predicate
[DATAFLOW... | /* static context
[FOCAL] public static RouterFunction<T> RouterFunctions.route(RequestPredicate predicate, HandlerFunction<T> handlerFunction)
[INPUTS] branches=- | result=handlerFunction, predicate
[NEW] DefaultRouterFunction<>
*/
| /* static context
[FOCAL] public static RouterFunction<T> RouterFunctions.route(RequestPredicate predicate, HandlerFunction<T> handlerFunction)
[INPUTS] branches=- | result=handlerFunction, predicate
[NEW] DefaultRouterFunction<>
*/
class RouterFunctions {
public static <T extends ServerResponse> RouterFunction<T> ro... | true | ok | {"focal": {"class": "RouterFunctions", "name": "route", "signature": "RouterFunction<T> route(RequestPredicate predicate, HandlerFunction<T> handlerFunction)", "start_line": 3, "modifiers": "public static", "params": [{"name": "predicate", "type": "RequestPredicate"}, {"name": "handlerFunction", "type": "HandlerFunctio... |
187972412_38 | class MessageServiceImpl implements MessageService {
@Override
public List<MessageView> queryMessageByTopic(String topic, final long begin, final long end) {
DefaultMQPullConsumer consumer = new DefaultMQPullConsumer(MixAll.TOOLS_CONSUMER_GROUP, null);
List<MessageView> messageViewList = Lists.... | final String messageId = msgId;
List<MessageView> messageViewList = null;
for (int i = 0; i < 10; i++) {
messageViewList = messageService.queryMessageByTopic(TEST_CONSOLE_TOPIC, System.currentTimeMillis() - 100000, System.currentTimeMillis());
if (CollectionUtils.isEmpty(... | [FOCAL] @Override public List<MessageView> MessageServiceImpl.queryMessageByTopic(String topic, long begin, long end)
[CLASS] class MessageServiceImpl implements MessageService
[METRICS] loc=69 cc=10 branches=2 loops=2 returns=1 throws=1 nesting=6
[CALLS-EXTERNAL] Lists.newArrayList/0, DefaultMQPullConsumer.start/0, De... | /* static context
[FOCAL] @Override public List<MessageView> MessageServiceImpl.queryMessageByTopic(String topic, long begin, long end)
[THROWS-WHEN] Throwables.propagate(e) when try-body throws
[PATH1] foreach(MessageQueue mq : mqs)=T -> for(offset <= maxOffset)=T -> if(messageViewList.size() > 2000)=F -> switch(pullR... | /* static context
[FOCAL] @Override public List<MessageView> MessageServiceImpl.queryMessageByTopic(String topic, long begin, long end)
[THROWS-WHEN] Throwables.propagate(e) when try-body throws
[PATH1] foreach(MessageQueue mq : mqs)=T -> for(offset <= maxOffset)=T -> if(messageViewList.size() > 2000)=F -> switch(pullR... | true | ok | {"focal": {"class": "MessageServiceImpl", "name": "queryMessageByTopic", "signature": "List<MessageView> queryMessageByTopic(String topic, long begin, long end)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "topic", "type": "String"}, {"name": "begin", "type": "long"}, {"name": "end", "type": ... |
188058370_0 | class StringUtil {
public static boolean isNullOrEmpty(String str) {
return str == null || str.isEmpty();
}
}
class StringUtilTest {
@Test
public void testIsNullOrEmpty() {
| boolean isEmpty = StringUtil.isNullOrEmpty("aaa");
Assert.assertFalse(isEmpty);
}
} | [FOCAL] public static boolean StringUtil.isNullOrEmpty(String str)
[CLASS] class StringUtil
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] String.isEmpty/0
[INPUTS] branches=- | result=str
[DATAFLOW] str@param->L2
[TEST] StringUtilTest: @Test public void testIsNullOrEmpty() | /* static context
[FOCAL] public static boolean StringUtil.isNullOrEmpty(String str)
[INPUTS] branches=- | result=str
[CALLS-EXTERNAL] String.isEmpty/0
*/
| /* static context
[FOCAL] public static boolean StringUtil.isNullOrEmpty(String str)
[INPUTS] branches=- | result=str
[CALLS-EXTERNAL] String.isEmpty/0
*/
class StringUtil {
public static boolean isNullOrEmpty(String str) {
return str == null || str.isEmpty();
}
}
class StringUtilTest {
@Test
public voi... | true | ok | {"focal": {"class": "StringUtil", "name": "isNullOrEmpty", "signature": "boolean isNullOrEmpty(String str)", "start_line": 3, "modifiers": "public static", "params": [{"name": "str", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "StringUtil", "kind": "class", "modifiers": "", "superclass": null,... |
188081982_21 | class HandResolver {
public Hand hand(CardSet cardSet) {
List<Card> handCards = cardSet.getSortedCards();
// Figure our high card by same color
SUIT colorCandidate = handCards.get(0).getSuit();
boolean allSameColor = handCards.stream()
.allMatch(card -> card.getSuit... | CardSet cardSet = new CardSet(
aCard(HEART, EIGHT),
aCard(DIAMOND, EIGHT),
aCard(CLUB, NINE),
aCard(SPADE, TEN),
aCard(HEART, JACK));
Hand hand = handResolver.hand(cardSet);
assertThat(hand)
.hasRan... | [FOCAL] public Hand HandResolver.hand(CardSet cardSet)
[CLASS] class HandResolver
[METRICS] loc=74 cc=11 branches=10 loops=0 returns=10 throws=0 nesting=4
[CALLS-EXTERNAL] CardSet.getSortedCards/0, handCards.get(0).getSuit/0, List<Card>.get/1, handCards.stream().allMatch/1, List<Card>.stream/0, card.getSuit().equals/1,... | /* static context
[FOCAL] public Hand HandResolver.hand(CardSet cardSet)
[PATH1] if(allSameColor)=F -> if(ranks.size() == 5)=T -> if((firstOrdinal + 1 == secondOrdinal && secondOrdinal + 1 == thirdOrdinal && thirdOrdinal + 1 == fourthOrdinal && fourt...)#2=F -> if(ranks.size() == 2)=F -> if(ranks.size() == 3)=T -> if((... | /* static context
[FOCAL] public Hand HandResolver.hand(CardSet cardSet)
[PATH1] if(allSameColor)=F -> if(ranks.size() == 5)=T -> if((firstOrdinal + 1 == secondOrdinal && secondOrdinal + 1 == thirdOrdinal && thirdOrdinal + 1 == fourthOrdinal && fourt...)#2=F -> if(ranks.size() == 2)=F -> if(ranks.size() == 3)=T -> if((... | true | ok | {"focal": {"class": "HandResolver", "name": "hand", "signature": "Hand hand(CardSet cardSet)", "start_line": 3, "modifiers": "public", "params": [{"name": "cardSet", "type": "CardSet"}], "return_type": "Hand"}, "class_info": {"name": "HandResolver", "kind": "class", "modifiers": "", "superclass": null, "interfaces": nu... |
188223092_16 | class ModelRepository {
public void addModel(final String modeluri, final EObject model) throws IOException {
final Resource resource = resourceSet.createResource(createURI(modeluri));
resourceSet.getResources().add(resource);
resource.getContents().add(model);
resource.save(null);
}
... | repository.addModel("SuperBrewer3000.json", CoffeeFactory.eINSTANCE.createBrewingUnit());
assertTrue(repository.hasModel("SuperBrewer3000.json"));
}
} | [FOCAL] public void ModelRepository.addModel(String modeluri, EObject model)
[CLASS] class ModelRepository
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] URI createURI(String modeluri)
[CALLS-EXTERNAL] resourceSet.createResource/1, resourceSet.getResources().add/1, resourceSet.get... | /* static context
[FOCAL] public void ModelRepository.addModel(String modeluri, EObject model)
[COLLABORATORS] field resourceSet createResource/1,getResources/0
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] URI createURI(String modeluri)
[CALLS-EXTERNAL] resourceSet.createResource/1, resourceSet.getResources().add... | /* static context
[FOCAL] public void ModelRepository.addModel(String modeluri, EObject model)
[COLLABORATORS] field resourceSet createResource/1,getResources/0
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] URI createURI(String modeluri)
[CALLS-EXTERNAL] resourceSet.createResource/1, resourceSet.getResources().add... | true | ok | {"focal": {"class": "ModelRepository", "name": "addModel", "signature": "void addModel(String modeluri, EObject model) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "modeluri", "type": "String"}, {"name": "model", "type": "EObject"}], "return_type": "void"}, "class_info": {"name": "Mo... |
188229074_0 | class UcManageKeyListImpl extends AbstractKeyListUc implements UcManageKeyList {
@Override
@RolesAllowed(ApplicationAccessControlConfig.PERMISSION_SAVE_KEY_LIST)
public KeyListEto saveKeyList(KeyListEto keyList) {
Objects.requireNonNull(keyList, "keyList");
KeyListEntity keyListEntity = getBeanMapper()... |
TestUtil.login("admin", ApplicationAccessControlConfig.PERMISSION_FIND_KEY_LIST,
ApplicationAccessControlConfig.PERMISSION_SAVE_KEY_LIST);
KeyListEto keyList = this.keymanagement.findKeyListByKey(KeyListCountryTestAspect.KEY_COUNTRY);
KeyListCountryTestAspect.verifyCountry(keyList);
keyList.set... | [FOCAL] @Override @RolesAllowed(ApplicationAccessControlConfig.PERMISSION_SAVE_KEY_LIST) public KeyListEto UcManageKeyListImpl.saveKeyList(KeyListEto keyList)
[CLASS] class UcManageKeyListImpl extends AbstractKeyListUc implements UcManageKeyList
[METRICS] loc=24 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=1
[CAL... | /* static context
[FOCAL] @Override @RolesAllowed(ApplicationAccessControlConfig.PERMISSION_SAVE_KEY_LIST) public KeyListEto UcManageKeyListImpl.saveKeyList(KeyListEto keyList)
[PATH1] if(id != null)=T -> if((permission != null) && !permission.isEmpty())=T -> return getBeanMapper().map(resultEntity, KeyListEto.class)
[... | /* static context
[FOCAL] @Override @RolesAllowed(ApplicationAccessControlConfig.PERMISSION_SAVE_KEY_LIST) public KeyListEto UcManageKeyListImpl.saveKeyList(KeyListEto keyList)
[PATH1] if(id != null)=T -> if((permission != null) && !permission.isEmpty())=T -> return getBeanMapper().map(resultEntity, KeyListEto.class)
[... | true | ok | {"focal": {"class": "UcManageKeyListImpl", "name": "saveKeyList", "signature": "KeyListEto saveKeyList(KeyListEto keyList)", "start_line": 3, "modifiers": "@Override @RolesAllowed(ApplicationAccessControlConfig.PERMISSION_SAVE_KEY_LIST) public", "params": [{"name": "keyList", "type": "KeyListEto"}], "return_type": "Key... |
188279001_0 | class PokemonToPokemonResponseAssembler {
public PokemonResponse assemble(Pokemon data) {
return PokemonResponse.builder()
.name(data.getName())
.abilities(data.getAbilities())
.baseExperience(data.getBaseExperience())
.weight(data.getWeight())
.height(data.getHeight())
... | Pokemon pokemon = from("a valid pokemon", Pokemon.class);
PokemonResponse pokemonResponse = pokemonToPokemonResponseAssembler.assemble(pokemon);
assertThat(pokemonResponse, notNullValue());
assertThat(
pokemonResponse.getAbilities(), equalTo(Arrays.asList(Ability.LIMBER, Ability.OVERGROW)));
... | [FOCAL] public PokemonResponse PokemonToPokemonResponseAssembler.assemble(Pokemon data)
[CLASS] class PokemonToPokemonResponseAssembler
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] PokemonResponse.builder() .name(data.getName()) .abilitie....build/0, PokemonResponse.builder() .n... | /* static context
[FOCAL] public PokemonResponse PokemonToPokemonResponseAssembler.assemble(Pokemon data)
[INPUTS] branches=- | result=data
[COLLABORATORS] param data:Pokemon getName/0,getAbilities/0,getBaseExperience/0,getWeight/0,getHeight/0
[CALLS-EXTERNAL] PokemonResponse.builder() .name(data.getName()) .abilitie..... | /* static context
[FOCAL] public PokemonResponse PokemonToPokemonResponseAssembler.assemble(Pokemon data)
[INPUTS] branches=- | result=data
[COLLABORATORS] param data:Pokemon getName/0,getAbilities/0,getBaseExperience/0,getWeight/0,getHeight/0
[CALLS-EXTERNAL] PokemonResponse.builder() .name(data.getName()) .abilitie..... | true | ok | {"focal": {"class": "PokemonToPokemonResponseAssembler", "name": "assemble", "signature": "PokemonResponse assemble(Pokemon data)", "start_line": 3, "modifiers": "public", "params": [{"name": "data", "type": "Pokemon"}], "return_type": "PokemonResponse"}, "class_info": {"name": "PokemonToPokemonResponseAssembler", "kin... |
188292946_0 | class ServiceLoaderProvider {
public static <T> T get(Class<T> supplier) {
return getSupplier(requireNonNull(supplier, "supplier is required"));
}
private ServiceLoaderProvider();
private static T getSupplier(Class<T> supplier);
public static T getUnique(Class<T> supplier);
public st... | assertThrows(ProviderNotFoundException.class, () -> ServiceLoaderProvider.get(Unicorn.class));
}
} | [FOCAL] public static T ServiceLoaderProvider.get(Class<T> supplier)
[CLASS] class ServiceLoaderProvider
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] T getSupplier(Class<T> supplier)
[CALLS-EXTERNAL] requireNonNull/2 (inherited)
[INPUTS] branches=- | result=supplier
[DATAFLOW] s... | /* static context
[FOCAL] public static T ServiceLoaderProvider.get(Class<T> supplier)
[INPUTS] branches=- | result=supplier
[CALLS-INTERNAL] T getSupplier(Class<T> supplier)
[CALLS-EXTERNAL] requireNonNull/2 (inherited)
*/
| /* static context
[FOCAL] public static T ServiceLoaderProvider.get(Class<T> supplier)
[INPUTS] branches=- | result=supplier
[CALLS-INTERNAL] T getSupplier(Class<T> supplier)
[CALLS-EXTERNAL] requireNonNull/2 (inherited)
*/
class ServiceLoaderProvider {
public static <T> T get(Class<T> supplier) {
return g... | true | ok | {"focal": {"class": "ServiceLoaderProvider", "name": "get", "signature": "T get(Class<T> supplier)", "start_line": 3, "modifiers": "public static", "params": [{"name": "supplier", "type": "Class<T>"}], "return_type": "T"}, "class_info": {"name": "ServiceLoaderProvider", "kind": "class", "modifiers": "", "superclass": n... |
188402392_0 | class StandardOPCUAService extends AbstractControllerService implements OPCUAService {
@Override
public byte[] getValue(List<String> tagNames, String returnTimestamp, boolean excludeNullValue,
String nullValueString) throws ProcessException {
try {
if (opcClient =... | runner.setProperty(service, StandardOPCUAService.ENDPOINT, endpoint);
runner.setProperty(service, StandardOPCUAService.SECURITY_POLICY, "Basic256Sha256");
runner.setProperty(service, StandardOPCUAService.SECURITY_MODE, "SignAndEncrypt");
runner.setProperty(service, StandardOPCUAService.A... | [FOCAL] @Override public byte[] StandardOPCUAService.getValue(List<String> tagNames, String returnTimestamp, boolean excludeNullValue, String nullValueString)
[CLASS] class StandardOPCUAService extends AbstractControllerService implements OPCUAService
[METRICS] loc=30 cc=4 branches=1 loops=1 returns=1 throws=2 nesting=... | /* static context
[FOCAL] @Override public byte[] StandardOPCUAService.getValue(List<String> tagNames, String returnTimestamp, boolean excludeNullValue, String nullValueString)
[THROWS-WHEN] ProcessException when try-body throws
[THROWS-WHEN] ProcessException when opcClient == null && throw new ProcessException("OPC Cl... | /* static context
[FOCAL] @Override public byte[] StandardOPCUAService.getValue(List<String> tagNames, String returnTimestamp, boolean excludeNullValue, String nullValueString)
[THROWS-WHEN] ProcessException when try-body throws
[THROWS-WHEN] ProcessException when opcClient == null && throw new ProcessException("OPC Cl... | true | ok | {"focal": {"class": "StandardOPCUAService", "name": "getValue", "signature": "byte[] getValue(List<String> tagNames, String returnTimestamp, boolean excludeNullValue, String nullValueString) throws ProcessException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "tagNames", "type": "List<String>... |
188429680_19 | class Example implements Serializable {
public boolean isMultiSentenceInstruction() {
int fromIndex = 0;
int dotInd;
while ((dotInd = instructionUtterance.indexOf(".", fromIndex)) >= 0){
if (!instructionUtterance.substring(dotInd + 1).trim().isEmpty() && // The dot isn't the end of the utterance.
Strin... |
List<String> multiSentenceInstructions = Arrays.asList(
"a. a",
"aaa. bbb.",
"aaa. bbb. "
);
List<String> nonMultiSentenceInstructions = Arrays.asList(
"",
"a.",
"a. ",
"a b. ",
... | [FOCAL] public boolean Example.isMultiSentenceInstruction()
[CLASS] class Example implements Serializable
[METRICS] loc=12 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] instructionUtterance.indexOf/2, instructionUtterance.substring(dotInd + 1).trim().isEmpty/0, instructionUtterance.substring(dot... | /* static context
[FOCAL] public boolean Example.isMultiSentenceInstruction()
[PATH1] while((dotInd = instructionUtterance.indexOf(".", fromIndex)) >= 0)=T -> if((!instructionUtterance.substring(dotInd + 1).trim().isEmpty() && // The dot isn't the end of the utterance. StringUti...)=F -> exit loop -> return false
[PATH... | /* static context
[FOCAL] public boolean Example.isMultiSentenceInstruction()
[PATH1] while((dotInd = instructionUtterance.indexOf(".", fromIndex)) >= 0)=T -> if((!instructionUtterance.substring(dotInd + 1).trim().isEmpty() && // The dot isn't the end of the utterance. StringUti...)=F -> exit loop -> return false
[PATH... | true | ok | {"focal": {"class": "Example", "name": "isMultiSentenceInstruction", "signature": "boolean isMultiSentenceInstruction()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "Example", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Serializable",... |
188534881_1 | class ServerSelector {
Optional<String> select(String version) {
if (version.isEmpty()) {
// of nullable since map could be empty
return Optional.ofNullable(m.lastEntry().getValue());
}
// strip "v" at head of string
version = version.substring(1);
int separatorIndex = version.indexOf(".");
if (sepa... | ServerSelector ssArt = new ServerSelector(() -> new AdaptiveRadixTree<>(APIVersionBinaryComparable.INSTANCE));
ServerSelector ssRbt = new ServerSelector(() -> new TreeMap<>(APIVersionComparator.INSTANCE));
// add API versions
ssArt.addServer(new APIVersion(1, 1), "hosta:port");
ssArt.addServer(new APIVersion... | [FOCAL] Optional<String> ServerSelector.select(String version)
[CLASS] class ServerSelector
[METRICS] loc=26 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=1
[CALLS-EXTERNAL] String.isEmpty/0, Optional.ofNullable/1, m.lastEntry().getValue/0, m.lastEntry/0, String.substring/1, String.indexOf/1, String.split/1, Integ... | /* static context
[FOCAL] Optional<String> ServerSelector.select(String version)
[PATH1] if(version.isEmpty())=F -> if(separatorIndex != -1)=F -> if(entry == null || entry.getKey().major != major)=T -> return Optional.empty()
[PATH2] if(version.isEmpty())=T -> return Optional.ofNullable(m.lastEntry().getValue())
[PATH3... | /* static context
[FOCAL] Optional<String> ServerSelector.select(String version)
[PATH1] if(version.isEmpty())=F -> if(separatorIndex != -1)=F -> if(entry == null || entry.getKey().major != major)=T -> return Optional.empty()
[PATH2] if(version.isEmpty())=T -> return Optional.ofNullable(m.lastEntry().getValue())
[PATH3... | true | ok | {"focal": {"class": "ServerSelector", "name": "select", "signature": "Optional<String> select(String version)", "start_line": 3, "modifiers": "", "params": [{"name": "version", "type": "String"}], "return_type": "Optional<String>"}, "class_info": {"name": "ServerSelector", "kind": "class", "modifiers": "", "superclass"... |
188592933_0 | class GenericRetryExecution implements RetryExecution {
public Optional<Long> nextDelay() {
if (lastAttemptIndex == 0) {
lastAttemptIndex++;
return Optional.of(0L);
}
if (genericRetry.getMaxAttempts() > -1 && lastAttemptIndex >= genericRetry.getMaxAttempts()) {
... | assertThat(getDefaultRetryExecution().nextDelay().get()).isEqualTo(0);
}
} | [FOCAL] public Optional<Long> GenericRetryExecution.nextDelay()
[CLASS] class GenericRetryExecution implements RetryExecution
[METRICS] loc=17 cc=5 branches=4 loops=0 returns=3 throws=0 nesting=2
[CALLS-EXTERNAL] Optional.of/1, genericRetry.getMaxAttempts/0, Optional.empty/0, genericRetry.getIntervalMultiplier/0, gener... | /* static context
[FOCAL] public Optional<Long> GenericRetryExecution.nextDelay()
[PATH1] if(lastAttemptIndex == 0)=F -> if(genericRetry.getMaxAttempts() > -1 && lastAttemptIndex >= genericRetry.getMaxAttempts())=F -> if(lastAttemptIndex > 1)=T -> if(genericRetry.getMaxInterval() > -1 && currentInterval > genericRetry.... | /* static context
[FOCAL] public Optional<Long> GenericRetryExecution.nextDelay()
[PATH1] if(lastAttemptIndex == 0)=F -> if(genericRetry.getMaxAttempts() > -1 && lastAttemptIndex >= genericRetry.getMaxAttempts())=F -> if(lastAttemptIndex > 1)=T -> if(genericRetry.getMaxInterval() > -1 && currentInterval > genericRetry.... | true | ok | {"focal": {"class": "GenericRetryExecution", "name": "nextDelay", "signature": "Optional<Long> nextDelay()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Optional<Long>"}, "class_info": {"name": "GenericRetryExecution", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "RetryE... |
188643956_0 | class Inventory extends BaseAggregate {
public static Inventory create(String productId, String productName) {
return Inventory.builder()
.id(newUuid())
.productId(productId)
.productName(productName)
.remains(0)
.createdAt(Ins... | assertNotNull(Inventory.create("12345", "name"));
}
} | [FOCAL] public static Inventory Inventory.create(String productId, String productName)
[CLASS] class Inventory extends BaseAggregate
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Inventory.builder() .id(newUuid()) .productId(productId) ....build/0, Inventory.builder() .id(newUuid... | /* static context
[FOCAL] public static Inventory Inventory.create(String productId, String productName)
[INPUTS] branches=- | result=productId, productName
[CALLS-EXTERNAL] Inventory.builder() .id(newUuid()) .productId(productId) ....build/0, Inventory.builder() .id(newUuid()) .productId(productId) ....createdAt/1, In... | /* static context
[FOCAL] public static Inventory Inventory.create(String productId, String productName)
[INPUTS] branches=- | result=productId, productName
[CALLS-EXTERNAL] Inventory.builder() .id(newUuid()) .productId(productId) ....build/0, Inventory.builder() .id(newUuid()) .productId(productId) ....createdAt/1, In... | true | ok | {"focal": {"class": "Inventory", "name": "create", "signature": "Inventory create(String productId, String productName)", "start_line": 3, "modifiers": "public static", "params": [{"name": "productId", "type": "String"}, {"name": "productName", "type": "String"}], "return_type": "Inventory"}, "class_info": {"name": "In... |
188644064_0 | class Product extends BaseAggregate {
public static Product create(String name, String description, BigDecimal price, String categoryId) {
Product product = Product.builder()
.id(newUuid())
.name(name)
.description(description)
.price(price)
... | Product product = Product.create("name", "desc", BigDecimal.valueOf(12.0), "123456");
assertNotNull(product);
}
} | [FOCAL] public static Product Product.create(String name, String description, BigDecimal price, String categoryId)
[CLASS] class Product extends BaseAggregate
[METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Product.builder() .id(newUuid()) .name(name) .description....build/0, Prod... | /* static context
[FOCAL] public static Product Product.create(String name, String description, BigDecimal price, String categoryId)
[INPUTS] branches=- | result=categoryId, description, name, price
[NEW] ProductCreatedEvent
[CALLS-EXTERNAL] Product.builder() .id(newUuid()) .name(name) .description....build/0, Product.... | /* static context
[FOCAL] public static Product Product.create(String name, String description, BigDecimal price, String categoryId)
[INPUTS] branches=- | result=categoryId, description, name, price
[NEW] ProductCreatedEvent
[CALLS-EXTERNAL] Product.builder() .id(newUuid()) .name(name) .description....build/0, Product.... | true | ok | {"focal": {"class": "Product", "name": "create", "signature": "Product create(String name, String description, BigDecimal price, String categoryId)", "start_line": 3, "modifiers": "public static", "params": [{"name": "name", "type": "String"}, {"name": "description", "type": "String"}, {"name": "price", "type": "BigDec... |
189012247_10 | class KafkaMessageHandlerRegistry implements IKafkaMessageHandlerRegistry<T> {
@Override
public List<IKafkaMessageHandler<T>> getForTopicOrFail(String topic) {
List<IKafkaMessageHandler<T>> topicKafkaMessageHandlers = getForTopic(topic);
if (topicKafkaMessageHandlers.isEmpty()) {
throw new IllegalSta... | assertThrows(IllegalStateException.class, () -> kafkaMessageHandlerRegistry.getForTopicOrFail("UNKNOWN"));
}
} | [FOCAL] @Override public List<IKafkaMessageHandler<T>> KafkaMessageHandlerRegistry.getForTopicOrFail(String topic)
[CLASS] class KafkaMessageHandlerRegistry implements IKafkaMessageHandlerRegistry<T>
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-INTERNAL] List<IKafkaMessageHandler<T>> getF... | /* static context
[FOCAL] @Override public List<IKafkaMessageHandler<T>> KafkaMessageHandlerRegistry.getForTopicOrFail(String topic)
[THROWS-WHEN] IllegalStateException when topicKafkaMessageHandlers.isEmpty()
[PATH1] if(topicKafkaMessageHandlers.isEmpty())=T -> throw new IllegalStateException("No handler found for top... | /* static context
[FOCAL] @Override public List<IKafkaMessageHandler<T>> KafkaMessageHandlerRegistry.getForTopicOrFail(String topic)
[THROWS-WHEN] IllegalStateException when topicKafkaMessageHandlers.isEmpty()
[PATH1] if(topicKafkaMessageHandlers.isEmpty())=T -> throw new IllegalStateException("No handler found for top... | true | ok | {"focal": {"class": "KafkaMessageHandlerRegistry", "name": "getForTopicOrFail", "signature": "List<IKafkaMessageHandler<T>> getForTopicOrFail(String topic)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "topic", "type": "String"}], "return_type": "List<IKafkaMessageHandler<T>>"}, "class_info": ... |
189027594_176 | class WxMpCardServiceImpl implements WxMpCardService {
@Override
public String decryptCardCode(String encryptCode) throws WxErrorException {
JsonObject param = new JsonObject();
param.addProperty("encrypt_code", encryptCode);
String responseContent = this.wxMpService.post(CARD_CODE_DECRYPT, param.toStr... | String encryptCode = "pd0vTUHSHc9tMUCL2gXABcUmINm6yxqJh0y9Phsy63E=";
String cardCode = this.wxService.getCardService().decryptCardCode(encryptCode);
assertNotNull(cardCode);
System.out.println(cardCode);
}
} | [FOCAL] @Override public String WxMpCardServiceImpl.decryptCardCode(String encryptCode)
[CLASS] class WxMpCardServiceImpl implements WxMpCardService
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] JsonObject.addProperty/2, this.wxMpService.post/2, JsonObject.toString/0, new JsonPa... | /* static context
[FOCAL] @Override public String WxMpCardServiceImpl.decryptCardCode(String encryptCode)
[COLLABORATORS] field wxMpService post/2
[EXCEPTIONS] declares WxErrorException
[FIELDS] read=wxMpService
[NEW] JsonObject, JsonParser
[CALLS-EXTERNAL] JsonObject.addProperty/2, this.wxMpService.post/2, JsonObject.... | /* static context
[FOCAL] @Override public String WxMpCardServiceImpl.decryptCardCode(String encryptCode)
[COLLABORATORS] field wxMpService post/2
[EXCEPTIONS] declares WxErrorException
[FIELDS] read=wxMpService
[NEW] JsonObject, JsonParser
[CALLS-EXTERNAL] JsonObject.addProperty/2, this.wxMpService.post/2, JsonObject.... | true | ok | {"focal": {"class": "WxMpCardServiceImpl", "name": "decryptCardCode", "signature": "String decryptCardCode(String encryptCode) throws WxErrorException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "encryptCode", "type": "String"}], "return_type": "String"}, "class_info": {"name": "WxMpCardServ... |
189191730_26 | class ArchiveIdentifierPattern extends ArchiveIdentifier {
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + Objects.hash(pattern.pattern(), patternType);
return result;
}
public ArchiveIdentifierPattern(fi... | final ArchiveIdentifierPattern ai1 = new ArchiveIdentifierPattern(ArchiveType.JAVA,
PatternType.PATTERN_ON_FILENAME, "abc");
final ArchiveIdentifierPattern ai2 = new ArchiveIdentifierPattern(ArchiveType.JAVA,
PatternType.PATTERN_ON_FILENAME, "def");
Assert.assertN... | [FOCAL] @Override public int ArchiveIdentifierPattern.hashCode()
[CLASS] class ArchiveIdentifierPattern extends ArchiveIdentifier
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] ArchiveIdentifier.hashCode/0, Objects.hash/2, pattern.pattern/0
[COLLABORATORS] field pattern pattern/0
... | /* static context
[FOCAL] @Override public int ArchiveIdentifierPattern.hashCode()
[COLLABORATORS] field pattern pattern/0
[CALLS-EXTERNAL] ArchiveIdentifier.hashCode/0, Objects.hash/2, pattern.pattern/0
*/
| /* static context
[FOCAL] @Override public int ArchiveIdentifierPattern.hashCode()
[COLLABORATORS] field pattern pattern/0
[CALLS-EXTERNAL] ArchiveIdentifier.hashCode/0, Objects.hash/2, pattern.pattern/0
*/
class ArchiveIdentifierPattern extends ArchiveIdentifier {
@Override
public int hashCode() {
fin... | true | ok | {"focal": {"class": "ArchiveIdentifierPattern", "name": "hashCode", "signature": "int hashCode()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "ArchiveIdentifierPattern", "kind": "class", "modifiers": "", "superclass": "ArchiveIdentifier", "interfaces": ... |
189204070_1 | class RoomServiceImpl implements RoomService {
@Override
public List<Room> findRoomsByType(String type) {
if (roomTypes.contains(type)) {
return roomRepo.findRoomsByRoomType(type);
} else {
throw new RoomServiceException("Room type: " + type + " not found!");
}
}
public RoomServiceImpl(RoomRepo room... | RoomRepo repo = mock(RoomRepo.class);
RoomServiceImpl service = new RoomServiceImpl(repo, roomTypes);
verify(repo, times(0)).findRoomsByRoomType(any());
expectedException.expect(RoomServiceException.class);
expectedException.expectMessage("Room type: NOT FOUND not found!");
service.findRoomsByType("NOT FOUN... | [FOCAL] @Override public List<Room> RoomServiceImpl.findRoomsByType(String type)
[CLASS] class RoomServiceImpl implements RoomService
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] List<String>.contains/1, roomRepo.findRoomsByRoomType/1
[NEW] RoomServiceException
[FIELDS] read=roo... | /* static context
[FOCAL] @Override public List<Room> RoomServiceImpl.findRoomsByType(String type)
[THROWS-WHEN] RoomServiceException when !roomTypes.contains(type)
[PATH1] if(roomTypes.contains(type))=T -> return roomRepo.findRoomsByRoomType(type)
[PATH2] if(roomTypes.contains(type))=F -> throw new RoomServiceExceptio... | /* static context
[FOCAL] @Override public List<Room> RoomServiceImpl.findRoomsByType(String type)
[THROWS-WHEN] RoomServiceException when !roomTypes.contains(type)
[PATH1] if(roomTypes.contains(type))=T -> return roomRepo.findRoomsByRoomType(type)
[PATH2] if(roomTypes.contains(type))=F -> throw new RoomServiceExceptio... | true | ok | {"focal": {"class": "RoomServiceImpl", "name": "findRoomsByType", "signature": "List<Room> findRoomsByType(String type)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "type", "type": "String"}], "return_type": "List<Room>"}, "class_info": {"name": "RoomServiceImpl", "kind": "class", "modifiers"... |
189356507_1 | class LogProducerProvider extends AbstractClientProvider<LogProducer> {
@Override
protected void closeClient() {
if (client != null) {
// close the producer.
while (true) {
try {
client.close();
break;
} catch (InterruptedException e) {
// ignore interrupt signal to avoid io thread lea... | LogProducerProvider producerProvider = new LogProducerProvider(
"test-project", "test-endpoint", "test-ak", "test-secret", 1, 100);
LogProducer producer = Mockito.mock(LogProducer.class);
Whitebox.setInternalState(producerProvider, "client", producer);
Mockito.doThrow(new InterruptedException()).doNothing... | [FOCAL] @Override protected void LogProducerProvider.closeClient()
[CLASS] class LogProducerProvider extends AbstractClientProvider<LogProducer>
[METRICS] loc=18 cc=4 branches=1 loops=1 returns=0 throws=0 nesting=3
[CALLS-EXTERNAL] client.close/0, LOGGER.warn/2
[EXCEPTIONS] catches InterruptedException e, ProducerExcep... | /* static context
[FOCAL] @Override protected void LogProducerProvider.closeClient()
[PATH1] if(client != null)=T -> while(true)=T -> try-body throws
[PATH2] if(client != null)=F
[COLLABORATORS] field client close/0
[EXCEPTIONS] catches InterruptedException e, ProducerException e
[CALLS-EXTERNAL] client.close/0, LOGGER... | /* static context
[FOCAL] @Override protected void LogProducerProvider.closeClient()
[PATH1] if(client != null)=T -> while(true)=T -> try-body throws
[PATH2] if(client != null)=F
[COLLABORATORS] field client close/0
[EXCEPTIONS] catches InterruptedException e, ProducerException e
[CALLS-EXTERNAL] client.close/0, LOGGER... | true | ok | {"focal": {"class": "LogProducerProvider", "name": "closeClient", "signature": "void closeClient()", "start_line": 3, "modifiers": "@Override protected", "params": [], "return_type": "void"}, "class_info": {"name": "LogProducerProvider", "kind": "class", "modifiers": "", "superclass": "AbstractClientProvider<LogProduce... |
189556566_0 | class StringUtil {
public static String getSizeString(long size){
if(size < 1024){
return String.format(Locale.getDefault(), "%d B", size);
}else if(size < 1024 * 1024){
float sizeK = size / 1024f;
return String.format(Locale.getDefault(), "%.2f KB", sizeK);
... | String msg = StringUtil.getSizeString(102400);
assertEquals("100.00 KB", msg);
}
} | [FOCAL] public static String StringUtil.getSizeString(long size)
[CLASS] class StringUtil
[METRICS] loc=15 cc=5 branches=4 loops=0 returns=5 throws=0 nesting=4
[CALLS-EXTERNAL] String.format/3, Locale.getDefault/0
[PATH1] if(size < 1024)=F -> if(size < 1024 * 1024)=F -> if(size < 1024 * 1024 * 1024)=F -> if(size / 1024... | /* static context
[FOCAL] public static String StringUtil.getSizeString(long size)
[PATH1] if(size < 1024)=F -> if(size < 1024 * 1024)=F -> if(size < 1024 * 1024 * 1024)=F -> if(size / 1024 < 1024 * 1024 * 1024)=T -> return String.format(Locale.getDefault(), "%.2f GB", sizeG)
[PATH2] if(size < 1024)=T -> return String.... | /* static context
[FOCAL] public static String StringUtil.getSizeString(long size)
[PATH1] if(size < 1024)=F -> if(size < 1024 * 1024)=F -> if(size < 1024 * 1024 * 1024)=F -> if(size / 1024 < 1024 * 1024 * 1024)=T -> return String.format(Locale.getDefault(), "%.2f GB", sizeG)
[PATH2] if(size < 1024)=T -> return String.... | true | ok | {"focal": {"class": "StringUtil", "name": "getSizeString", "signature": "String getSizeString(long size)", "start_line": 3, "modifiers": "public static", "params": [{"name": "size", "type": "long"}], "return_type": "String"}, "class_info": {"name": "StringUtil", "kind": "class", "modifiers": "", "superclass": null, "in... |
189605649_51 | class NativeRequest extends AdRequest<NativeRequest, UnifiedNativeAdRequestParams> {
@SuppressWarnings("WeakerAccess")
public boolean containsAssetType(MediaAssetType assetType) {
return mediaAssetTypes.isEmpty()
|| mediaAssetTypes.contains(assetType)
|| mediaAssetTypes.... | NativeRequest nativeRequest = new NativeRequest.Builder()
.setMediaAssetTypes(MediaAssetType.Icon, MediaAssetType.Image)
.build();
assertTrue(nativeRequest.containsAssetType(MediaAssetType.Icon));
assertTrue(nativeRequest.containsAssetType(MediaAssetType.Image));
... | [FOCAL] @SuppressWarnings("WeakerAccess") public boolean NativeRequest.containsAssetType(MediaAssetType assetType)
[CLASS] class NativeRequest extends AdRequest<NativeRequest, UnifiedNativeAdRequestParams>
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] mediaAssetTypes.isEmpty/0, m... | /* static context
[FOCAL] @SuppressWarnings("WeakerAccess") public boolean NativeRequest.containsAssetType(MediaAssetType assetType)
[INPUTS] branches=- | result=assetType
[COLLABORATORS] field mediaAssetTypes isEmpty/0,contains/1
[CALLS-EXTERNAL] mediaAssetTypes.isEmpty/0, mediaAssetTypes.contains/1
*/
| /* static context
[FOCAL] @SuppressWarnings("WeakerAccess") public boolean NativeRequest.containsAssetType(MediaAssetType assetType)
[INPUTS] branches=- | result=assetType
[COLLABORATORS] field mediaAssetTypes isEmpty/0,contains/1
[CALLS-EXTERNAL] mediaAssetTypes.isEmpty/0, mediaAssetTypes.contains/1
*/
class NativeReq... | true | ok | {"focal": {"class": "NativeRequest", "name": "containsAssetType", "signature": "boolean containsAssetType(MediaAssetType assetType)", "start_line": 3, "modifiers": "@SuppressWarnings(\"WeakerAccess\") public", "params": [{"name": "assetType", "type": "MediaAssetType"}], "return_type": "boolean"}, "class_info": {"name":... |
189841989_2 | class Combinator {
public static <T> Stream<List<Optional<T>>> combinations(List<T> list) {
long n = (long) Math.pow(2, list.size());
return StreamSupport.stream(new Spliterators.AbstractSpliterator<>(n, Spliterator.SIZED) {
long i = 0;
@Override
public boolean... | List<List<Optional<String>>> combinations = Combinator
.combinations(List.of("a", "b", "c"))
.collect(Collectors.toList());
assertEquals(8, combinations.size());
assertSameSize(3, combinations);
assertContains(List.of(Optional.empty(), Optional.empty(), ... | [FOCAL] public static Stream<List<Optional<T>>> Combinator.combinations(List<T> list)
[CLASS] class Combinator
[METRICS] loc=26 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=3
[CALLS-EXTERNAL] Math.pow/2, List<T>.size/0, StreamSupport.stream/2, Long.bitCount/1, List<Optional<T>>.add/1, Optional.of/1, List<T>.get/1... | /* static context
[FOCAL] public static Stream<List<Optional<T>>> Combinator.combinations(List<T> list)
[INPUTS] branches=- | result=list
[COLLABORATORS] param list:List<T> size/0,get/1; field action accept/1
[NEW] Spliterators.AbstractSpliterator<>, ArrayList<>
[CALLS-EXTERNAL] Math.pow/2, List<T>.size/0, StreamSuppor... | /* static context
[FOCAL] public static Stream<List<Optional<T>>> Combinator.combinations(List<T> list)
[INPUTS] branches=- | result=list
[COLLABORATORS] param list:List<T> size/0,get/1; field action accept/1
[NEW] Spliterators.AbstractSpliterator<>, ArrayList<>
[CALLS-EXTERNAL] Math.pow/2, List<T>.size/0, StreamSuppor... | true | ok | {"focal": {"class": "Combinator", "name": "combinations", "signature": "Stream<List<Optional<T>>> combinations(List<T> list)", "start_line": 3, "modifiers": "public static", "params": [{"name": "list", "type": "List<T>"}], "return_type": "Stream<List<Optional<T>>>"}, "class_info": {"name": "Combinator", "kind": "class"... |
189845277_4 | class RouterFunctions {
public static Builder route() {
return new RouterFunctionBuilder();
}
public static RouterFunction<T> route(
RequestPredicate predicate, HandlerFunction<T> handlerFunction);
public static RouterFunction<T> nest(
RequestPredicate predicate, RouterFunction<T> routerFunction);
public... | HandlerFunction<ServerResponse> handlerFunction = request -> ServerResponse.ok().build();
RouterFunction<ServerResponse> routerFunction1 = request -> Optional.empty();
RouterFunction<ServerResponse> routerFunction2 = request -> Optional.of(handlerFunction);
RouterFunction<ServerResponse> result = routerFunctio... | [FOCAL] public static Builder RouterFunctions.route()
[CLASS] class RouterFunctions
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] RouterFunctionBuilder
[CLASS-MEMBERS] RouterFunction<T> route(RequestPredicate predicate, HandlerFunction<T> handlerFunction); RouterFunction<T> nest(RequestPred... | /* static context
[FOCAL] public static Builder RouterFunctions.route()
[NEW] RouterFunctionBuilder
*/
| /* static context
[FOCAL] public static Builder RouterFunctions.route()
[NEW] RouterFunctionBuilder
*/
class RouterFunctions {
public static Builder route() {
return new RouterFunctionBuilder();
}
public static RouterFunction<T> route(
RequestPredicate predicate, HandlerFunction<T> handlerFunction);
public s... | true | ok | {"focal": {"class": "RouterFunctions", "name": "route", "signature": "Builder route()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Builder"}, "class_info": {"name": "RouterFunctions", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"... |
190100311_0 | class AccountCreateImpl implements AccountCreate {
@Nonnull
@Override
public String create() throws IdentityException {
Validate.notNull(account.getUsername(), "username must be set");
Validate.notNull(account.getFirstName(), "first name must be set");
Validate.notNull(account.getLa... |
new Expectations() {{
systemService.currentTimeMillis();
result = 1563200810123L;
times = 1;
passwordService.createPasswordHash("test_pwd");
result = "test_pwd_hash";
times = 1;
}};
String result = accountCreate
... | [FOCAL] @Nonnull @Override public String AccountCreateImpl.create()
[CLASS] class AccountCreateImpl implements AccountCreate
[METRICS] loc=18 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Validate.notNull/2, account.getUsername/0, account.getFirstName/0, account.getLastName/0, account.getPasswor... | /* static context
[FOCAL] @Nonnull @Override public String AccountCreateImpl.create()
[COLLABORATORS] field account getUsername/0,getFirstName/0,getLastName/0,getPasswordHash/0,getEmail/0,getDescription/0; field systemService:SystemService currentTimeMillis/0; field storage:Storage createAccount/1
[EXCEPTIONS] declares... | /* static context
[FOCAL] @Nonnull @Override public String AccountCreateImpl.create()
[COLLABORATORS] field account getUsername/0,getFirstName/0,getLastName/0,getPasswordHash/0,getEmail/0,getDescription/0; field systemService:SystemService currentTimeMillis/0; field storage:Storage createAccount/1
[EXCEPTIONS] declares... | true | ok | {"focal": {"class": "AccountCreateImpl", "name": "create", "signature": "String create() throws IdentityException", "start_line": 3, "modifiers": "@Nonnull @Override public", "params": [], "return_type": "String"}, "class_info": {"name": "AccountCreateImpl", "kind": "class", "modifiers": "", "superclass": null, "interf... |
190168097_216 | class AwsRDSInstanceContainer extends AwsContainer {
@ChaosExperiment(experimentType = ExperimentType.STATE)
public void restartInstance (Experiment experiment) {
experiment.setCheckContainerHealth(() -> awsRDSPlatform.getInstanceStatus(dbInstanceIdentifier));
awsRDSPlatform.restartInstance(dbI... | awsRDSInstanceContainer.restartInstance(experiment);
verify(experiment, times(1)).setCheckContainerHealth(any());
verify(awsRDSPlatform, times(1)).restartInstance(dbInstanceIdentifier);
}
} | [FOCAL] @ChaosExperiment(experimentType = ExperimentType.STATE) public void AwsRDSInstanceContainer.restartInstance(Experiment experiment)
[CLASS] class AwsRDSInstanceContainer extends AwsContainer
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] Experiment.setCheckContainerHealth/1... | /* static context
[FOCAL] @ChaosExperiment(experimentType = ExperimentType.STATE) public void AwsRDSInstanceContainer.restartInstance(Experiment experiment)
[COLLABORATORS] param experiment:Experiment setCheckContainerHealth/1; field awsRDSPlatform:AwsRDSPlatform getInstanceStatus/1,restartInstance/1
[FIELDS] read=awsR... | /* static context
[FOCAL] @ChaosExperiment(experimentType = ExperimentType.STATE) public void AwsRDSInstanceContainer.restartInstance(Experiment experiment)
[COLLABORATORS] param experiment:Experiment setCheckContainerHealth/1; field awsRDSPlatform:AwsRDSPlatform getInstanceStatus/1,restartInstance/1
[FIELDS] read=awsR... | true | ok | {"focal": {"class": "AwsRDSInstanceContainer", "name": "restartInstance", "signature": "void restartInstance(Experiment experiment)", "start_line": 3, "modifiers": "@ChaosExperiment(experimentType = ExperimentType.STATE) public", "params": [{"name": "experiment", "type": "Experiment"}], "return_type": "void"}, "class_i... |
190197552_1 | class Neo4jDriverProperties {
public URI getUri() {
return this.uri;
}
public void setUri(URI uri);
public Authentication getAuthentication();
public void setAuthentication(
Authentication authentication);
public PoolSettings getPool();
public void setPool(PoolSettings pool);
public DriverSettings getConf... |
Neo4jDriverProperties driverProperties = new Neo4jDriverProperties();
assertThat(driverProperties.getUri()).isNull();
}
} | [FOCAL] public URI Neo4jDriverProperties.getUri()
[CLASS] class Neo4jDriverProperties
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[FIELDS] read=uri
[CLASS-MEMBERS] void setUri(URI uri); Authentication getAuthentication(); void setAuthentication(Authentication authentication); PoolSettings getPo... | /* static context
[FOCAL] public URI Neo4jDriverProperties.getUri()
[FIELDS] read=uri
*/
| /* static context
[FOCAL] public URI Neo4jDriverProperties.getUri()
[FIELDS] read=uri
*/
class Neo4jDriverProperties {
public URI getUri() {
return this.uri;
}
public void setUri(URI uri);
public Authentication getAuthentication();
public void setAuthentication(
Authentication authentication);
public PoolSe... | true | ok | {"focal": {"class": "Neo4jDriverProperties", "name": "getUri", "signature": "URI getUri()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "URI"}, "class_info": {"name": "Neo4jDriverProperties", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "context"... |
190209753_0 | class HllUtil {
public static double pow2(int p) {
if (p < 0) {
return 1.0 / (1L << -p);
}
if (p > 0) {
return 1L << p;
}
return 1.0;
}
public static long murmurHash64A(byte[] data, int seed);
}
class HllUtilTest {
@Test
public vo... | assertThat(HllUtil.pow2(0)).isEqualTo(1.0);
assertThat(HllUtil.pow2(8)).isEqualTo(256.0);
assertThat(HllUtil.pow2(-8)).isEqualTo(0.00390625);
}
} | [FOCAL] public static double HllUtil.pow2(int p)
[CLASS] class HllUtil
[METRICS] loc=10 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[PATH1] if(p < 0)=F -> if(p > 0)=T -> return 1L << p
[PATH2] if(p < 0)=T -> return 1.0 / (1L << -p)
[PATH3] if(p < 0)=F -> if(p > 0)=F -> return 1.0
[INPUTS] branches=p | result=p... | /* static context
[FOCAL] public static double HllUtil.pow2(int p)
[PATH1] if(p < 0)=F -> if(p > 0)=T -> return 1L << p
[PATH2] if(p < 0)=T -> return 1.0 / (1L << -p)
[PATH3] if(p < 0)=F -> if(p > 0)=F -> return 1.0
[INPUTS] branches=p | result=p
*/
| /* static context
[FOCAL] public static double HllUtil.pow2(int p)
[PATH1] if(p < 0)=F -> if(p > 0)=T -> return 1L << p
[PATH2] if(p < 0)=T -> return 1.0 / (1L << -p)
[PATH3] if(p < 0)=F -> if(p > 0)=F -> return 1.0
[INPUTS] branches=p | result=p
*/
class HllUtil {
public static double pow2(int p) {
if (p ... | true | ok | {"focal": {"class": "HllUtil", "name": "pow2", "signature": "double pow2(int p)", "start_line": 3, "modifiers": "public static", "params": [{"name": "p", "type": "int"}], "return_type": "double"}, "class_info": {"name": "HllUtil", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "... |
190267909_31 | class LocalityAwareRandomPartitioner extends LocalityAwarePartitioner {
@Override
public int partition(Object messageKey, List<PartitionInfo> partitions) {
if (localPartitions == null || isTimeToRefresh()) {
checkAndAssignLocalPartitions(partitions);
// set next refresh time
updateNextRefresh... | List<PartitionInfo> partitions = Arrays.asList(
new PartitionInfo("topix", 0, new Node(0, "0", 9092, "us-east-1a"), null, null),
new PartitionInfo("topix", 1, new Node(1, "0", 9092, "us-east-1e"), null, null),
new PartitionInfo("topix", 3, new Node(2, "0", 9092, "us-east-1d"), null, null),
... | [FOCAL] @Override public int LocalityAwareRandomPartitioner.partition(Object messageKey, List<PartitionInfo> partitions)
[CLASS] class LocalityAwareRandomPartitioner extends LocalityAwarePartitioner
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] isTimeToRefresh/0 (inherited), che... | /* static context
[FOCAL] @Override public int LocalityAwareRandomPartitioner.partition(Object messageKey, List<PartitionInfo> partitions)
[PATH1] if(localPartitions == null || isTimeToRefresh())=T -> return localPartitions.get(Math.abs(random.nextInt() % localPartitions.siz...
[PATH2] if(localPartitions == null || isT... | /* static context
[FOCAL] @Override public int LocalityAwareRandomPartitioner.partition(Object messageKey, List<PartitionInfo> partitions)
[PATH1] if(localPartitions == null || isTimeToRefresh())=T -> return localPartitions.get(Math.abs(random.nextInt() % localPartitions.siz...
[PATH2] if(localPartitions == null || isT... | true | ok | {"focal": {"class": "LocalityAwareRandomPartitioner", "name": "partition", "signature": "int partition(Object messageKey, List<PartitionInfo> partitions)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "messageKey", "type": "Object"}, {"name": "partitions", "type": "List<PartitionInfo>"}], "retu... |
190303335_18 | class S3FileSystem extends FileSystem implements Comparable<S3FileSystem> {
public String getKey() {
return key;
}
public S3FileSystem(S3FileSystemProvider provider, String key, AmazonS3 client, String endpoint);
@Override public S3FileSystemProvider provider();
@Override public void clo... | String fileName = "βeta.png";
String expected = "https://bucket.s3.eu-west-1.amazonaws.com/%CE%B2eta.png";
AmazonS3 amazonS3Client = AmazonS3ClientBuilder.standard()
.withRegion(Regions.EU_WEST_1)
.build();
S3FileSystem s3FileSystem = new S3FileSystem(nul... | [FOCAL] public String S3FileSystem.getKey()
[CLASS] class S3FileSystem extends FileSystem implements Comparable<S3FileSystem>
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] S3FileSystem(S3FileSystemProvider provider, String key, AmazonS3 client, String endpoint); S3FileSystemProvid... | /* static context
[FOCAL] public String S3FileSystem.getKey()
*/
| /* static context
[FOCAL] public String S3FileSystem.getKey()
*/
class S3FileSystem extends FileSystem implements Comparable<S3FileSystem> {
public String getKey() {
return key;
}
public S3FileSystem(S3FileSystemProvider provider, String key, AmazonS3 client, String endpoint);
@Override publ... | true | ok | {"focal": {"class": "S3FileSystem", "name": "getKey", "signature": "String getKey()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "S3FileSystem", "kind": "class", "modifiers": "", "superclass": "FileSystem", "interfaces": "Comparable<S3FileSystem>", "fields": [... |
190335075_411 | class InsnList {
public AbstractInsnNode[] toArray() {
int currentInsnIndex = 0;
AbstractInsnNode currentInsn = firstInsn;
AbstractInsnNode[] insnNodeArray = new AbstractInsnNode[size];
while (currentInsn != null) {
insnNodeArray[currentInsnIndex] = currentInsn;
currentInsn.index = curren... | InsnList insnList = newInsnList(insn1, insn2);
AbstractInsnNode[] insnArray = insnList.toArray();
assertArrayEquals(new AbstractInsnNode[] {insn1, insn2}, insnArray);
}
} | [FOCAL] public AbstractInsnNode[] InsnList.toArray()
[CLASS] class InsnList
[METRICS] loc=11 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[PATH1] while(currentInsn != null)=T -> exit loop -> return insnNodeArray
[PATH2] while(currentInsn != null)=F -> return insnNodeArray
[DATAFLOW] currentInsn@L3->L5,L6,L7,L8;... | /* static context
[FOCAL] public AbstractInsnNode[] InsnList.toArray()
[PATH1] while(currentInsn != null)=T -> exit loop -> return insnNodeArray
[PATH2] while(currentInsn != null)=F -> return insnNodeArray
*/
| /* static context
[FOCAL] public AbstractInsnNode[] InsnList.toArray()
[PATH1] while(currentInsn != null)=T -> exit loop -> return insnNodeArray
[PATH2] while(currentInsn != null)=F -> return insnNodeArray
*/
class InsnList {
public AbstractInsnNode[] toArray() {
int currentInsnIndex = 0;
AbstractInsnNode cu... | true | ok | {"focal": {"class": "InsnList", "name": "toArray", "signature": "AbstractInsnNode[] toArray()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "AbstractInsnNode[]"}, "class_info": {"name": "InsnList", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "in... |
190419065_18 | class PluginManagerUtils {
public static String appendPathOntoUrl(Object urlString, Object... pathSection) {
String[] args = new String[pathSection.length];
for (int i = 0; i < pathSection.length; ++i) {
requireNonNull(pathSection[i]);
args[i] = pathSection[i].toString();
... | String result = PluginManagerUtils.appendPathOntoUrl("http://bob.com:8080/", "path/to/", "file.json");
assertThat(result).isEqualTo("http://bob.com:8080/path/to/file.json");
}
} | [FOCAL] public static String PluginManagerUtils.appendPathOntoUrl(Object urlString, Object... pathSection)
[CLASS] class PluginManagerUtils
[METRICS] loc=8 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] String appendPathOntoUrl(String urlString, String... pathSection)
[CALLS-EXTERNAL] requireNonN... | /* static context
[FOCAL] public static String PluginManagerUtils.appendPathOntoUrl(Object urlString, Object... pathSection)
[PATH1] for(i < pathSection.length)=T -> exit loop -> return appendPathOntoUrl(urlString.toString(), args)
[PATH2] for(i < pathSection.length)=F -> return appendPathOntoUrl(urlString.toString(), ... | /* static context
[FOCAL] public static String PluginManagerUtils.appendPathOntoUrl(Object urlString, Object... pathSection)
[PATH1] for(i < pathSection.length)=T -> exit loop -> return appendPathOntoUrl(urlString.toString(), args)
[PATH2] for(i < pathSection.length)=F -> return appendPathOntoUrl(urlString.toString(), ... | true | ok | {"focal": {"class": "PluginManagerUtils", "name": "appendPathOntoUrl", "signature": "String appendPathOntoUrl(Object urlString, Object... pathSection)", "start_line": 3, "modifiers": "public static", "params": [{"name": "urlString", "type": "Object"}, {"name": "pathSection", "type": "Object..."}], "return_type": "Strin... |
190664284_131 | class WorkerRegistryV2 implements WorkerRegistry, WorkerEventSubscriber {
@Override
public int getNumRunningWorkers() {
if(logger.isDebugEnabled()) { logger.debug("In getNumRunningWorkers"); }
int cnt = jobToWorkerInfoMap.values().stream()
.map(workerList -> workerList.strea... |
WorkerRegistryV2 workerRegistryV2 = new WorkerRegistryV2();
LifecycleEventPublisher eventPublisher = new LifecycleEventPublisherImpl(new AuditEventSubscriberLoggingImpl(), new StatusEventSubscriberLoggingImpl(), new DummyWorkerEventSubscriberImpl(workerRegistryV2));
Map<StageScalingPolicy.Scali... | [FOCAL] @Override public int WorkerRegistryV2.getNumRunningWorkers()
[CLASS] class WorkerRegistryV2 implements WorkerRegistry, WorkerEventSubscriber
[METRICS] loc=13 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] logger.isDebugEnabled/0, logger.debug/1, jobToWorkerInfoMap.values().stream() .map(w... | /* static context
[FOCAL] @Override public int WorkerRegistryV2.getNumRunningWorkers()
[PATH1] if(logger.isDebugEnabled())#1=T -> if(logger.isDebugEnabled())#2=T -> return cnt
[PATH2] if(logger.isDebugEnabled())#1=F -> if(logger.isDebugEnabled())#2=F -> return cnt
[COLLABORATORS] field jobToWorkerInfoMap values/0; fiel... | /* static context
[FOCAL] @Override public int WorkerRegistryV2.getNumRunningWorkers()
[PATH1] if(logger.isDebugEnabled())#1=T -> if(logger.isDebugEnabled())#2=T -> return cnt
[PATH2] if(logger.isDebugEnabled())#1=F -> if(logger.isDebugEnabled())#2=F -> return cnt
[COLLABORATORS] field jobToWorkerInfoMap values/0; fiel... | true | ok | {"focal": {"class": "WorkerRegistryV2", "name": "getNumRunningWorkers", "signature": "int getNumRunningWorkers()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "WorkerRegistryV2", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Worker... |
190686426_1 | class Calculator {
public int add(int n1,int n2) {
return n1+n2;
}
Calculator calculator;
}
class CalculatorTest {
Calculator calculator;
@Test
public void add2() {
| int actual = calculator.add(12, 12);
int expected = 25;
assertNotEquals(expected, actual);
}
} | [FOCAL] public int Calculator.add(int n1, int n2)
[CLASS] class Calculator
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[INPUTS] branches=- | result=n1, n2
[DATAFLOW] n1@param->L2; n2@param->L2
[TEST] CalculatorTest: @Test public void add2()
[TEST-FIELDS] Calculator calculator | /* static context
[FOCAL] public int Calculator.add(int n1, int n2)
[INPUTS] branches=- | result=n1, n2
*/
| /* static context
[FOCAL] public int Calculator.add(int n1, int n2)
[INPUTS] branches=- | result=n1, n2
*/
class Calculator {
public int add(int n1,int n2) {
return n1+n2;
}
Calculator calculator;
}
class CalculatorTest {
Calculator calculator;
@Test
public void add2() {
| true | ok | {"focal": {"class": "Calculator", "name": "add", "signature": "int add(int n1, int n2)", "start_line": 3, "modifiers": "public", "params": [{"name": "n1", "type": "int"}, {"name": "n2", "type": "int"}], "return_type": "int"}, "class_info": {"name": "Calculator", "kind": "class", "modifiers": "", "superclass": null, "in... |
190690143_17 | class JsCacheBuilder {
public JsApiCache buildFrom(Map<String, Object> registeredApis) {
JsApiCache.Builder builder = new JsApiCache.Builder();
for(String apiBaseName : registeredApis.keySet()) {
appendObject(builder, apiBaseName, registeredApis.get(apiBaseName));
}
return builder.build();
}
private v... | JsCacheBuilder cacheBuilder = new JsCacheBuilder();
Map<String, Object> apis = new HashMap<>();
apis.put("api1", new ObjectWithFunctionReturningArray());
JsApiCache cache = cacheBuilder.buildFrom(apis);
ApiEntry classEntry = cache.get("--classes").get(Foo.class.getName());
assertThat(classEntry).isInstanc... | [FOCAL] public JsApiCache JsCacheBuilder.buildFrom(Map<String, Object> registeredApis)
[CLASS] class JsCacheBuilder
[METRICS] loc=9 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] void appendObject(JsApiCache.Builder apiBuilder, String apiBaseName, Object apiObject)
[CALLS-EXTERNAL] Map<String, Ob... | /* static context
[FOCAL] public JsApiCache JsCacheBuilder.buildFrom(Map<String, Object> registeredApis)
[PATH1] foreach(String apiBaseName : registeredApis.keySet())=T -> exit loop -> return builder.build()
[PATH2] foreach(String apiBaseName : registeredApis.keySet())=F -> return builder.build()
[INPUTS] branches=regi... | /* static context
[FOCAL] public JsApiCache JsCacheBuilder.buildFrom(Map<String, Object> registeredApis)
[PATH1] foreach(String apiBaseName : registeredApis.keySet())=T -> exit loop -> return builder.build()
[PATH2] foreach(String apiBaseName : registeredApis.keySet())=F -> return builder.build()
[INPUTS] branches=regi... | true | ok | {"focal": {"class": "JsCacheBuilder", "name": "buildFrom", "signature": "JsApiCache buildFrom(Map<String, Object> registeredApis)", "start_line": 3, "modifiers": "public", "params": [{"name": "registeredApis", "type": "Map<String, Object>"}], "return_type": "JsApiCache"}, "class_info": {"name": "JsCacheBuilder", "kind"... |
190718318_3 | class Warehouse {
public void addProduct(String name, int price) throws WarehouseException {
if (price < 0) {
throw new IllegalArgumentException("The product's price cannot be negative.");
}
Product product = new Product(name, price);
productDao.addProduct(product);
... | // given
String name = "test";
int price = -123;
// when/then
assertThrows(IllegalArgumentException.class, () -> warehouse.addProduct(name, price));
}
} | [FOCAL] public void Warehouse.addProduct(String name, int price)
[CLASS] class Warehouse
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=0 throws=1 nesting=1
[CALLS-EXTERNAL] productDao.addProduct/1
[NEW] IllegalArgumentException, Product
[EXCEPTIONS] declares WarehouseException; throws IllegalArgumentException
[THROWS... | /* static context
[FOCAL] public void Warehouse.addProduct(String name, int price)
[THROWS-WHEN] IllegalArgumentException when price < 0
[PATH1] if(price < 0)=T -> throw new IllegalArgumentException("The product's price cannot be negativ...
[PATH2] if(price < 0)=F
[INPUTS] branches=price | result=-
[COLLABORATORS] fiel... | /* static context
[FOCAL] public void Warehouse.addProduct(String name, int price)
[THROWS-WHEN] IllegalArgumentException when price < 0
[PATH1] if(price < 0)=T -> throw new IllegalArgumentException("The product's price cannot be negativ...
[PATH2] if(price < 0)=F
[INPUTS] branches=price | result=-
[COLLABORATORS] fiel... | true | ok | {"focal": {"class": "Warehouse", "name": "addProduct", "signature": "void addProduct(String name, int price) throws WarehouseException", "start_line": 3, "modifiers": "public", "params": [{"name": "name", "type": "String"}, {"name": "price", "type": "int"}], "return_type": "void"}, "class_info": {"name": "Warehouse", "... |
190783541_11 | class BackupUploadService implements IBackupUploadService {
@Override
public void startUploading(IDicomWebClient webClient, BackupState backupState) throws IBackupUploader.BackupException {
scheduleUploadWithDelay(webClient, backupState);
}
public BackupUploadService(IBackupUploader backupUploader, Backu... | doThrow(new DicomWebException("Reason", HttpStatus.INTERNAL_SERVER_ERROR_500, Status.ProcessingFailure))
.doNothing().when(webClientMock).stowRs(any(InputStream.class));
when(backupUploaderMock.doReadBackup(eq(UNIQUE_FILE_NAME))).thenReturn(backupInputStream);
backupUploadService.startUploading(web... | [FOCAL] @Override public void BackupUploadService.startUploading(IDicomWebClient webClient, BackupState backupState)
[CLASS] class BackupUploadService implements IBackupUploadService
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void scheduleUploadWithDelay(IDicomWebClient webCli... | /* static context
[FOCAL] @Override public void BackupUploadService.startUploading(IDicomWebClient webClient, BackupState backupState)
[EXCEPTIONS] declares IBackupUploader.BackupException
[CALLS-INTERNAL] void scheduleUploadWithDelay(IDicomWebClient webClient, BackupState backupState)
*/
| /* static context
[FOCAL] @Override public void BackupUploadService.startUploading(IDicomWebClient webClient, BackupState backupState)
[EXCEPTIONS] declares IBackupUploader.BackupException
[CALLS-INTERNAL] void scheduleUploadWithDelay(IDicomWebClient webClient, BackupState backupState)
*/
class BackupUploadService impl... | true | ok | {"focal": {"class": "BackupUploadService", "name": "startUploading", "signature": "void startUploading(IDicomWebClient webClient, BackupState backupState) throws IBackupUploader.BackupException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "webClient", "type": "IDicomWebClient"}, {"name": "bac... |
191232069_5 | class MaxHeapAllocationPerfVerifier implements VerifiablePerformanceIssue<ExpectMaxHeapAllocation, Allocation> {
@Override
public PerfIssue verifyPerfIssue(ExpectMaxHeapAllocation annotation, Allocation measuredAllocation) {
Allocation maxExpectedAllocation = new Allocation(annotation.value(), annotat... |
// GIVEN
ExpectMaxHeapAllocation annotation = JvmAnnotationBuilder.expectMaxHeapAllocation(3.75 * 1024
, AllocationUnit.MEGA_BYTE);
// 3.75 giga bytes
Allocation measuredAllocation = Allocation.ofBy... | [FOCAL] @Override public PerfIssue MaxHeapAllocationPerfVerifier.verifyPerfIssue(ExpectMaxHeapAllocation annotation, Allocation measuredAllocation)
[CLASS] class MaxHeapAllocationPerfVerifier implements VerifiablePerformanceIssue<ExpectMaxHeapAllocation, Allocation>
[METRICS] loc=19 cc=2 branches=1 loops=0 returns=2 th... | /* static context
[FOCAL] @Override public PerfIssue MaxHeapAllocationPerfVerifier.verifyPerfIssue(ExpectMaxHeapAllocation annotation, Allocation measuredAllocation)
[PATH1] if(maxExpectedAllocation.isLessThan(measuredAllocation))=T -> return new PerfIssue(description)
[PATH2] if(maxExpectedAllocation.isLessThan(measur... | /* static context
[FOCAL] @Override public PerfIssue MaxHeapAllocationPerfVerifier.verifyPerfIssue(ExpectMaxHeapAllocation annotation, Allocation measuredAllocation)
[PATH1] if(maxExpectedAllocation.isLessThan(measuredAllocation))=T -> return new PerfIssue(description)
[PATH2] if(maxExpectedAllocation.isLessThan(measur... | true | ok | {"focal": {"class": "MaxHeapAllocationPerfVerifier", "name": "verifyPerfIssue", "signature": "PerfIssue verifyPerfIssue(ExpectMaxHeapAllocation annotation, Allocation measuredAllocation)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "annotation", "type": "ExpectMaxHeapAllocation"}, {"name": "m... |
191553604_1044 | class Dispatcher extends FencedRpcEndpoint<DispatcherId> implements
DispatcherGateway, LeaderContender, SubmittedJobGraphStore.SubmittedJobGraphListener {
@Override
public void onAddedJobGraph(final JobID jobId) {
runAsync(
() -> {
if (!jobManagerRunnerFutures.containsKey(jobId)) {
// IMPORTANT: onAdd... | dispatcher = createAndStartDispatcher(heartbeatServices, haServices, new ExpectedJobIdJobManagerRunnerFactory(TEST_JOB_ID, createdJobManagerRunnerLatch));
final FlinkException expectedFailure = new FlinkException("Expected failure");
submittedJobGraphStore.setRecoveryFailure(expectedFailure);
dispatcherLeader... | [FOCAL] @Override public void Dispatcher.onAddedJobGraph(JobID jobId)
[CLASS] class Dispatcher extends FencedRpcEndpoint<DispatcherId> implements DispatcherGateway, LeaderContender, SubmittedJobGraphStore.SubmittedJobGraphListener
[METRICS] loc=39 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=2
[CALLS-INTERNAL] Co... | class Dispatcher extends FencedRpcEndpoint<DispatcherId> implements
DispatcherGateway, LeaderContender, SubmittedJobGraphStore.SubmittedJobGraphListener {
@Override
public void onAddedJobGraph(final JobID jobId) {
runAsync(
() -> {
if (!jobManagerRunnerFutures.containsKey(jobId)) {
// IMPORTANT: onAdd... | false | ok | {"focal": {"class": "Dispatcher", "name": "onAddedJobGraph", "signature": "void onAddedJobGraph(JobID jobId)", "start_line": 4, "modifiers": "@Override public", "params": [{"name": "jobId", "type": "JobID"}], "return_type": "void"}, "class_info": {"name": "Dispatcher", "kind": "class", "modifiers": "", "superclass": "F... | |
191586445_1 | class WebSocketEndpoint {
@OnClose
public void onClose(Session session, @PathParam("username") String username) {
sessions.remove(username);
broadcaster.removeSession(session);
broadcaster.broadcast("#User: " + username + " left");
LOGGER.info(username + " is offline!");
}
... | webSocketEndpoint.onClose(session, "user2");
Mockito.verify(broadcaster).removeSession(session);
Mockito.verify(broadcaster).broadcast("#User: user2 left");
}
} | [FOCAL] @OnClose public void WebSocketEndpoint.onClose(Session session, String username)
[CLASS] class WebSocketEndpoint
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] sessions.remove/1, Broadcaster.removeSession/1, Broadcaster.broadcast/1, LOGGER.info/1
[FIELDS] read=broadcaster:... | /* static context
[FOCAL] @OnClose public void WebSocketEndpoint.onClose(Session session, String username)
[COLLABORATORS] field sessions remove/1; field broadcaster:Broadcaster removeSession/1,broadcast/1
[FIELDS] read=broadcaster:Broadcaster
[CALLS-EXTERNAL] sessions.remove/1, Broadcaster.removeSession/1, Broadcaster... | /* static context
[FOCAL] @OnClose public void WebSocketEndpoint.onClose(Session session, String username)
[COLLABORATORS] field sessions remove/1; field broadcaster:Broadcaster removeSession/1,broadcast/1
[FIELDS] read=broadcaster:Broadcaster
[CALLS-EXTERNAL] sessions.remove/1, Broadcaster.removeSession/1, Broadcaster... | true | ok | {"focal": {"class": "WebSocketEndpoint", "name": "onClose", "signature": "void onClose(Session session, String username)", "start_line": 3, "modifiers": "@OnClose public", "params": [{"name": "session", "type": "Session"}, {"name": "username", "type": "String"}], "return_type": "void"}, "class_info": {"name": "WebSocke... |
192009782_4 | class PopTokenBuilderUtils {
public static RSAPrivateKey encryptedKeyPemStringToRsaPrivateKey(String encryptedPrivateKeyPemString, String privateKeyPassword)
throws PopPrivateKeyParseException {
if (StringUtils.isBlank(encryptedPrivateKeyPemString)) {
throw new IllegalArgumentExcep... | // perform an action
RSAPrivateKey rsaPrivateKey = PopTokenBuilderUtils.encryptedKeyPemStringToRsaPrivateKey(aes256EncryptedPrivateKeyPemString,
privateKeyPassword);
// validate the results
assertNotNull("The rsaPrivateKey should not be null", rsaPrivateKey);
}
} | [FOCAL] public static RSAPrivateKey PopTokenBuilderUtils.encryptedKeyPemStringToRsaPrivateKey(String encryptedPrivateKeyPemString, String privateKeyPassword)
[CLASS] class PopTokenBuilderUtils
[METRICS] loc=24 cc=7 branches=3 loops=0 returns=1 throws=5 nesting=2
[CALLS-INTERNAL] RSAPrivateKey buildRsaPrivateKey(String ... | /* static context
[FOCAL] public static RSAPrivateKey PopTokenBuilderUtils.encryptedKeyPemStringToRsaPrivateKey(String encryptedPrivateKeyPemString, String privateKeyPassword)
[THROWS-WHEN] IllegalArgumentException when StringUtils.isBlank(encryptedPrivateKeyPemString)
[THROWS-WHEN] IllegalArgumentException when !Strin... | /* static context
[FOCAL] public static RSAPrivateKey PopTokenBuilderUtils.encryptedKeyPemStringToRsaPrivateKey(String encryptedPrivateKeyPemString, String privateKeyPassword)
[THROWS-WHEN] IllegalArgumentException when StringUtils.isBlank(encryptedPrivateKeyPemString)
[THROWS-WHEN] IllegalArgumentException when !Strin... | true | ok | {"focal": {"class": "PopTokenBuilderUtils", "name": "encryptedKeyPemStringToRsaPrivateKey", "signature": "RSAPrivateKey encryptedKeyPemStringToRsaPrivateKey(String encryptedPrivateKeyPemString, String privateKeyPassword) throws PopPrivateKeyParseException", "start_line": 3, "modifiers": "public static", "params": [{"na... |
192381473_43 | class RequestIdentifier {
public static boolean isIndexRequest(@NonNull Request esRequest) {
// the path should contain /index/type/ or /index/type/id
// type shouldn't be _search
String[] pathFields = esRequest.getEndpoint().substring(1).split("/");
return (pathFields.length == Co... | esRequest = new Request(TestConstants.PUT_METHOD, TestConstants.WRONG_INDEX_PATTERN);
boolean result = RequestIdentifier.isIndexRequest(esRequest);
assertFalse(result);
}
} | [FOCAL] public static boolean RequestIdentifier.isIndexRequest(Request esRequest)
[CLASS] class RequestIdentifier
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] esRequest.getEndpoint().substring(1).split/1, esRequest.getEndpoint().substring/1, Request.getEndpoint/0, Constants.SEA... | /* static context
[FOCAL] public static boolean RequestIdentifier.isIndexRequest(Request esRequest)
[INPUTS] branches=- | result=esRequest
[COLLABORATORS] param esRequest:Request getEndpoint/0
[CALLS-EXTERNAL] esRequest.getEndpoint().substring(1).split/1, esRequest.getEndpoint().substring/1, Request.getEndpoint/0, Cons... | /* static context
[FOCAL] public static boolean RequestIdentifier.isIndexRequest(Request esRequest)
[INPUTS] branches=- | result=esRequest
[COLLABORATORS] param esRequest:Request getEndpoint/0
[CALLS-EXTERNAL] esRequest.getEndpoint().substring(1).split/1, esRequest.getEndpoint().substring/1, Request.getEndpoint/0, Cons... | true | ok | {"focal": {"class": "RequestIdentifier", "name": "isIndexRequest", "signature": "boolean isIndexRequest(Request esRequest)", "start_line": 3, "modifiers": "public static", "params": [{"name": "esRequest", "type": "Request"}], "return_type": "boolean"}, "class_info": {"name": "RequestIdentifier", "kind": "class", "modif... |
192457111_9 | class HCatClient {
public abstract String getMessageBusTopicName(String dbName, String tableName) throws HCatExceptionpublic abstract String getMessageBusTopicName(String dbName, String tableName) throws HCatException;
public abstract String getMessageBusTopicName(String dbName, String tableName) throws HCatException... | try {
HCatClient client = HCatClient.create(new Configuration(hcatConf));
String dbName = "testGetMessageBusTopicName_DBName";
String tableName = "testGetMessageBusTopicName_TableName";
client.dropDatabase(dbName, true, HCatClient.DropDBMode.CASCADE);
client.createDatabase(HCatCreateDB... | [FOCAL] public abstract String HCatClient.getMessageBusTopicName(String dbName, String tableName)
[CLASS] class HCatClient
[METRICS] loc=1 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[EXCEPTIONS] declares HCatException
[CLASS-MEMBERS] HCatClient create(Configuration conf); void initialize(Configuration conf); ... | class HCatClient {
public abstract String getMessageBusTopicName(String dbName, String tableName) throws HCatExceptionpublic abstract String getMessageBusTopicName(String dbName, String tableName) throws HCatException;
public abstract String getMessageBusTopicName(String dbName, String tableName) throws HCatException... | false | partial | {"focal": {"class": "HCatClient", "name": "getMessageBusTopicName", "signature": "String getMessageBusTopicName(String dbName, String tableName) throws HCatException", "start_line": 3, "modifiers": "public abstract", "params": [{"name": "dbName", "type": "String"}, {"name": "tableName", "type": "String"}], "return_type... | |
192508383_59 | class PmdSensor implements Sensor {
@Override
public void execute(SensorContext context) {
if (shouldExecuteOnProject()) {
for (RuleViolation violation : executor.execute()) {
pmdViolationRecorder.saveViolation(violation, context);
}
}
}
public ... |
// given
final RuleViolation pmdViolation = violation();
final Report report = report(pmdViolation);
when(executor.execute()).thenReturn(report);
when(report.iterator()).thenReturn(Iterators.forArray(pmdViolation));
// when
pmdSensor.execute(sensorContext);
... | [FOCAL] @Override public void PmdSensor.execute(SensorContext context)
[CLASS] class PmdSensor implements Sensor
[METRICS] loc=8 cc=3 branches=1 loops=1 returns=0 throws=0 nesting=2
[CALLS-INTERNAL] boolean shouldExecuteOnProject()
[CALLS-EXTERNAL] PmdExecutor.execute/0, PmdViolationRecorder.saveViolation/2
[FIELDS] re... | /* static context
[FOCAL] @Override public void PmdSensor.execute(SensorContext context)
[PATH1] if(shouldExecuteOnProject())=T -> foreach(RuleViolation violation : executor.execute())=T -> exit loop
[PATH2] if(shouldExecuteOnProject())=F
[PATH3] if(shouldExecuteOnProject())=T -> foreach(RuleViolation violation : execu... | /* static context
[FOCAL] @Override public void PmdSensor.execute(SensorContext context)
[PATH1] if(shouldExecuteOnProject())=T -> foreach(RuleViolation violation : executor.execute())=T -> exit loop
[PATH2] if(shouldExecuteOnProject())=F
[PATH3] if(shouldExecuteOnProject())=T -> foreach(RuleViolation violation : execu... | true | ok | {"focal": {"class": "PmdSensor", "name": "execute", "signature": "void execute(SensorContext context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "context", "type": "SensorContext"}], "return_type": "void"}, "class_info": {"name": "PmdSensor", "kind": "class", "modifiers": "", "superclass": ... |
192942452_46 | class ApplicationLifecycleManager {
public void ensureStopped() throws InterruptedException {
for (int i = 0; i < 30; i++) {
ApplicationStatus currentStatus = detailSupplier.get().applicationStatus();
switch (currentStatus) {
case RUNNING:
stop();... | Mockito.when(client.describeApplication(describeApplicationRequest))
.thenReturn(withStatus(ApplicationStatus.STOPPING));
try {
manager.ensureStopped();
Assert.fail("expected timeout waiting for application to finish starting");
} catch (IllegalStateException ... | [FOCAL] public void ApplicationLifecycleManager.ensureStopped()
[CLASS] class ApplicationLifecycleManager
[METRICS] loc=18 cc=5 branches=1 loops=1 returns=1 throws=2 nesting=2
[CALLS-INTERNAL] StopApplicationResponse stop()
[CALLS-EXTERNAL] detailSupplier.get().applicationStatus/0, detailSupplier.get/0, Thread.sleep/1
... | /* static context
[FOCAL] public void ApplicationLifecycleManager.ensureStopped()
[THROWS-WHEN] IllegalStateException when i < 30 && switch(currentStatus)=case RUNNING
[THROWS-WHEN] IllegalStateException when i < 30 && switch(currentStatus)=case STOPPING
[THROWS-WHEN] IllegalStateException when i < 30 && switch(current... | /* static context
[FOCAL] public void ApplicationLifecycleManager.ensureStopped()
[THROWS-WHEN] IllegalStateException when i < 30 && switch(currentStatus)=case RUNNING
[THROWS-WHEN] IllegalStateException when i < 30 && switch(currentStatus)=case STOPPING
[THROWS-WHEN] IllegalStateException when i < 30 && switch(current... | true | ok | {"focal": {"class": "ApplicationLifecycleManager", "name": "ensureStopped", "signature": "void ensureStopped() throws InterruptedException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "ApplicationLifecycleManager", "kind": "class", "modifiers": "", "superclass":... |
193047220_40 | class DefaultComponentsValidatorFactory implements ComponentsValidatorFactory {
@Override
public List<ComponentsValidator> create(FactoryOptions options) {
List<ComponentsValidator> validators = new ArrayList<>();
// skeletons
validators.add(new ComponentsHeadersValuesValidator(headerValidatorFactory.... | FactoryOptions options = new FactoryOptions(emptyMap());
List<ComponentsValidator> validators = validatorFactory.create(options);
assertThat(validators).hasSize(6);
assertThat(validators).hasOnlyElementsOfTypes(
ComponentsHeadersValuesValidator.class,
ComponentsParametersValuesValidator.... | [FOCAL] @Override public List<ComponentsValidator> DefaultComponentsValidatorFactory.create(FactoryOptions options)
[CLASS] class DefaultComponentsValidatorFactory implements ComponentsValidatorFactory
[METRICS] loc=24 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] void addComponentsCallbacksKeys... | /* static context
[FOCAL] @Override public List<ComponentsValidator> DefaultComponentsValidatorFactory.create(FactoryOptions options)
[COLLABORATORS] field headerValidatorFactory create/1; field parameterValidatorFactory create/1; field requestBodyValidatorFactory create/1; field responseValidatorFactory create/1; fiel... | /* static context
[FOCAL] @Override public List<ComponentsValidator> DefaultComponentsValidatorFactory.create(FactoryOptions options)
[COLLABORATORS] field headerValidatorFactory create/1; field parameterValidatorFactory create/1; field requestBodyValidatorFactory create/1; field responseValidatorFactory create/1; fiel... | true | ok | {"focal": {"class": "DefaultComponentsValidatorFactory", "name": "create", "signature": "List<ComponentsValidator> create(FactoryOptions options)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "options", "type": "FactoryOptions"}], "return_type": "List<ComponentsValidator>"}, "class_info": {"na... |
193065376_4 | class DeepCopySubstitution {
@Substitute
public static Object simpleDeepCopy(Object toCopy) {
return JsonUtils.cloneJson(toCopy);
}
}
class DeepCopySubstitutionTest {
@SuppressWarnings("unchecked")
@Test
void nominalSchemaDeepCopyShouldSucceed() {
| LinkedHashMap<String, Object> originalLinkedHashMap = new LinkedHashMap<>();
ArrayList<Integer> originalArrayList = new ArrayList<>(Arrays.asList(new Integer(10)));
originalLinkedHashMap.put("boolean", new Boolean(true));
originalLinkedHashMap.put("string", "original");
original... | [FOCAL] @Substitute public static Object DeepCopySubstitution.simpleDeepCopy(Object toCopy)
[CLASS] class DeepCopySubstitution
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] JsonUtils.cloneJson/1
[INPUTS] branches=- | result=toCopy
[DATAFLOW] toCopy@param->L3
[TEST] DeepCopySubsti... | /* static context
[FOCAL] @Substitute public static Object DeepCopySubstitution.simpleDeepCopy(Object toCopy)
[INPUTS] branches=- | result=toCopy
[CALLS-EXTERNAL] JsonUtils.cloneJson/1
*/
| /* static context
[FOCAL] @Substitute public static Object DeepCopySubstitution.simpleDeepCopy(Object toCopy)
[INPUTS] branches=- | result=toCopy
[CALLS-EXTERNAL] JsonUtils.cloneJson/1
*/
class DeepCopySubstitution {
@Substitute
public static Object simpleDeepCopy(Object toCopy) {
return JsonUtils.clon... | true | ok | {"focal": {"class": "DeepCopySubstitution", "name": "simpleDeepCopy", "signature": "Object simpleDeepCopy(Object toCopy)", "start_line": 3, "modifiers": "@Substitute public static", "params": [{"name": "toCopy", "type": "Object"}], "return_type": "Object"}, "class_info": {"name": "DeepCopySubstitution", "kind": "class"... |
193085253_6 | class LeaveRequestService {
public Optional<LeaveRequest> approve(UUID id) {
Optional<LeaveRequest> found = repo.findById(id);
found.ifPresent(lr -> lr.setStatus(Status.APPROVED));
return found;
}
public LeaveRequest request(String employee, LocalDate from, LocalDate to);
public Optional<LeaveRequest> deny(... | LeaveRequest saved = repository.save(new LeaveRequest("Alice", of(2019, 11, 30), of(2019, 12, 03), PENDING));
Optional<LeaveRequest> approved = service.approve(saved.getId());
verify(repository).findById(saved.getId());
assertThat(approved).isPresent();
assertThat(approved).get().isSameAs(saved);
assertThat... | [FOCAL] public Optional<LeaveRequest> LeaveRequestService.approve(UUID id)
[CLASS] class LeaveRequestService
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] repo.findById/1, Optional<LeaveRequest>.ifPresent/1, lr.setStatus/1
[INPUTS] branches=- | result=id
[COLLABORATORS] field rep... | /* static context
[FOCAL] public Optional<LeaveRequest> LeaveRequestService.approve(UUID id)
[INPUTS] branches=- | result=id
[COLLABORATORS] field repo findById/1; field lr setStatus/1
[CALLS-EXTERNAL] repo.findById/1, Optional<LeaveRequest>.ifPresent/1, lr.setStatus/1
*/
| /* static context
[FOCAL] public Optional<LeaveRequest> LeaveRequestService.approve(UUID id)
[INPUTS] branches=- | result=id
[COLLABORATORS] field repo findById/1; field lr setStatus/1
[CALLS-EXTERNAL] repo.findById/1, Optional<LeaveRequest>.ifPresent/1, lr.setStatus/1
*/
class LeaveRequestService {
public Optional<L... | true | ok | {"focal": {"class": "LeaveRequestService", "name": "approve", "signature": "Optional<LeaveRequest> approve(UUID id)", "start_line": 3, "modifiers": "public", "params": [{"name": "id", "type": "UUID"}], "return_type": "Optional<LeaveRequest>"}, "class_info": {"name": "LeaveRequestService", "kind": "class", "modifiers": ... |
193109862_14 | class DENOPTIMEdge implements Serializable {
public boolean sameAs(DENOPTIMEdge other, StringBuilder reason)
{
if (this.getSourceDAP() != other.getSourceDAP())
{
reason.append("Different source atom ("+this.getSourceDAP()+":"
+other.getSourceDAP()+"); ");
return false;
}
... | DENOPTIMEdge eA = new DENOPTIMEdge(0, 1, 0, 0, 1);
DENOPTIMEdge eB = new DENOPTIMEdge(0, 1, 0, 0, 2);
assertFalse(eA.sameAs(eB, reason));
}
} | [FOCAL] public boolean DENOPTIMEdge.sameAs(DENOPTIMEdge other, StringBuilder reason)
[CLASS] class DENOPTIMEdge implements Serializable
[METRICS] loc=36 cc=6 branches=5 loops=0 returns=6 throws=0 nesting=1
[CALLS-INTERNAL] String getSourceReaction(); String getTargetReaction(); int getBondType(); int getSourceDAP(); in... | /* static context
[FOCAL] public boolean DENOPTIMEdge.sameAs(DENOPTIMEdge other, StringBuilder reason)
[PATH1] if(this.getSourceDAP() != other.getSourceDAP())=F -> if(this.getTargetDAP() != other.getTargetDAP())=F -> if(!this.getSourceReaction().equals(other.getSourceReaction()))=F -> if(!this.getTargetReaction().equal... | /* static context
[FOCAL] public boolean DENOPTIMEdge.sameAs(DENOPTIMEdge other, StringBuilder reason)
[PATH1] if(this.getSourceDAP() != other.getSourceDAP())=F -> if(this.getTargetDAP() != other.getTargetDAP())=F -> if(!this.getSourceReaction().equals(other.getSourceReaction()))=F -> if(!this.getTargetReaction().equal... | true | ok | {"focal": {"class": "DENOPTIMEdge", "name": "sameAs", "signature": "boolean sameAs(DENOPTIMEdge other, StringBuilder reason)", "start_line": 3, "modifiers": "public", "params": [{"name": "other", "type": "DENOPTIMEdge"}, {"name": "reason", "type": "StringBuilder"}], "return_type": "boolean"}, "class_info": {"name": "DE... |
193272759_264 | class TrainingSetManager {
public synchronized void addTrainingSet(TrainingSet trainingSet)
{
trainingSet.setTrainingSetID(trainingSetIDCounter++);
trainingSets.add(trainingSet);
}
TrainingSetManager();
public void addTrainingSets(Collection<TrainingSet> trainingSets);
public synchronized TrainingSet acq... | TrainingSetManager manager = new TrainingSetManager();
manager.reset();
TrainingSet trainingSet = manager.acquireTrainingSet(0);
assertThat(trainingSet).isNull();
fillTrainingSetManager(manager, 10);
trainingSet = manager.acquireTrainingSet(0);
assertThat(trainingSet).isNotNull();
TrainingSet t... | [FOCAL] public synchronized void TrainingSetManager.addTrainingSet(TrainingSet trainingSet)
[CLASS] class TrainingSetManager
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] TrainingSet.setTrainingSetID/1, trainingSets.add/1
[COLLABORATORS] param trainingSet:TrainingSet setTrainingS... | /* static context
[FOCAL] public synchronized void TrainingSetManager.addTrainingSet(TrainingSet trainingSet)
[COLLABORATORS] param trainingSet:TrainingSet setTrainingSetID/1; field trainingSets add/1
[CALLS-EXTERNAL] TrainingSet.setTrainingSetID/1, trainingSets.add/1
*/
| /* static context
[FOCAL] public synchronized void TrainingSetManager.addTrainingSet(TrainingSet trainingSet)
[COLLABORATORS] param trainingSet:TrainingSet setTrainingSetID/1; field trainingSets add/1
[CALLS-EXTERNAL] TrainingSet.setTrainingSetID/1, trainingSets.add/1
*/
class TrainingSetManager {
public synchronized... | true | ok | {"focal": {"class": "TrainingSetManager", "name": "addTrainingSet", "signature": "void addTrainingSet(TrainingSet trainingSet)", "start_line": 3, "modifiers": "public synchronized", "params": [{"name": "trainingSet", "type": "TrainingSet"}], "return_type": "void"}, "class_info": {"name": "TrainingSetManager", "kind": "... |
193500053_6 | class GitMlRules {
static Map<String, List<String>> stripDuplicatePrefixes(Map<String, List<String>> fullList) {
// Create a prefix tree
var trie = mapToTrie(fullList);
// Prune it
var pruned = pruneEntry(trie);
// Restore the map from the tree
return trieToMap(pru... | assertEquals(Map.of("k/1", List.of("v1"),
"k/2a", List.of("v2")),
GitMlRules.stripDuplicatePrefixes(Map.of("k/1/aa", List.of("v1"),
"k/1/bb", List.of("v1"),
... | [FOCAL] static Map<String, List<String>> GitMlRules.stripDuplicatePrefixes(Map<String, List<String>> fullList)
[CLASS] class GitMlRules
[METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Map<String, List<String>> trieToMap(TrieEntry trie, String curPath); TrieEntry mapToTrie(Map<Stri... | /* static context
[FOCAL] static Map<String, List<String>> GitMlRules.stripDuplicatePrefixes(Map<String, List<String>> fullList)
[INPUTS] branches=- | result=fullList
[CALLS-INTERNAL] Map<String, List<String>> trieToMap(TrieEntry trie, String curPath); TrieEntry mapToTrie(Map<String, List<String>> list); TrieEntry prun... | /* static context
[FOCAL] static Map<String, List<String>> GitMlRules.stripDuplicatePrefixes(Map<String, List<String>> fullList)
[INPUTS] branches=- | result=fullList
[CALLS-INTERNAL] Map<String, List<String>> trieToMap(TrieEntry trie, String curPath); TrieEntry mapToTrie(Map<String, List<String>> list); TrieEntry prun... | true | ok | {"focal": {"class": "GitMlRules", "name": "stripDuplicatePrefixes", "signature": "Map<String, List<String>> stripDuplicatePrefixes(Map<String, List<String>> fullList)", "start_line": 3, "modifiers": "static", "params": [{"name": "fullList", "type": "Map<String, List<String>>"}], "return_type": "Map<String, List<String>... |
193582925_57 | class StorageCli extends SubcommandCli {
public static void testMain(String[] args) {
new StorageCli(args, true).processCmd();
}
private StorageCli(String[] args, boolean useByTest);
private static StorageClient openStorageClient(String host, int port, SslContext sslContext, ZooKeeperClient... | int numPartitions = 1;
IntegrationTestHelper helper = getIntegrationTestHelper(numPartitions);
Properties cfgProperties = createProperties(helper.getZkConnectString(), helper.getZnodePath(), helper.getSslSetup());
String cliConfigPath = IntegrationTestHelper.createYamlConfigFile(DIR_NAM... | [FOCAL] public static void StorageCli.testMain(String[] args)
[CLASS] class StorageCli extends SubcommandCli
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] new StorageCli(args, true).processCmd/0
[NEW] StorageCli
[DATAFLOW] args@param->L2
[CLASS-MEMBERS] StorageCli(String[] args, ... | /* static context
[FOCAL] public static void StorageCli.testMain(String[] args)
[NEW] StorageCli
[CALLS-EXTERNAL] new StorageCli(args, true).processCmd/0
*/
| /* static context
[FOCAL] public static void StorageCli.testMain(String[] args)
[NEW] StorageCli
[CALLS-EXTERNAL] new StorageCli(args, true).processCmd/0
*/
class StorageCli extends SubcommandCli {
public static void testMain(String[] args) {
new StorageCli(args, true).processCmd();
}
private St... | true | ok | {"focal": {"class": "StorageCli", "name": "testMain", "signature": "void testMain(String[] args)", "start_line": 3, "modifiers": "public static", "params": [{"name": "args", "type": "String[]"}], "return_type": "void"}, "class_info": {"name": "StorageCli", "kind": "class", "modifiers": "", "superclass": "SubcommandCli"... |
193657959_5 | class JWTFilter extends GenericFilterBean {
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
throws IOException, ServletException {
HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
String ... | MockHttpServletRequest request = new MockHttpServletRequest();
request.setRequestURI("/api/test");
MockHttpServletResponse response = new MockHttpServletResponse();
MockFilterChain filterChain = new MockFilterChain();
jwtFilter.doFilter(request, response, filterChain);
as... | [FOCAL] @Override public void JWTFilter.doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
[CLASS] class JWTFilter extends GenericFilterBean
[METRICS] loc=11 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] String resolveToken(HttpServletRequest reques... | /* static context
[FOCAL] @Override public void JWTFilter.doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
[PATH1] if(StringUtils.hasText(jwt) && this.tokenProvider.validateToken(jwt))=T
[PATH2] if(StringUtils.hasText(jwt) && this.tokenProvider.validateToken(jwt))=F
[INP... | /* static context
[FOCAL] @Override public void JWTFilter.doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
[PATH1] if(StringUtils.hasText(jwt) && this.tokenProvider.validateToken(jwt))=T
[PATH2] if(StringUtils.hasText(jwt) && this.tokenProvider.validateToken(jwt))=F
[INP... | true | ok | {"focal": {"class": "JWTFilter", "name": "doFilter", "signature": "void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "servletRequest", "type": "ServletRequest... |
193945625_21 | class ReadHandler extends BaseHandlerStd {
protected ProgressEvent<ResourceModel, CallbackContext> handleRequest(
final AmazonWebServicesClientProxy proxy,
final ResourceHandlerRequest<ResourceModel> request,
final CallbackContext callbackContext,
final ProxyClient<CloudFormationCli... | final CloudFormationClient client = getServiceClient();
final DescribeTypeResponse describeTypeResponse = DescribeTypeResponse.builder()
.arn("arn:aws:cloudformation:us-west-2:123456789012:type/resource/AWS-Demo-Resource/00000001")
.defaultVersionId("00000001")
.depr... | [FOCAL] protected ProgressEvent<ResourceModel, CallbackContext> ReadHandler.handleRequest(AmazonWebServicesClientProxy proxy, ResourceHandlerRequest<ResourceModel> request, CallbackContext callbackContext, ProxyClient<CloudFormationClient> proxyClient, Logger logger)
[CLASS] class ReadHandler extends BaseHandlerStd
[ME... | /* static context
[FOCAL] protected ProgressEvent<ResourceModel, CallbackContext> ReadHandler.handleRequest(AmazonWebServicesClientProxy proxy, ResourceHandlerRequest<ResourceModel> request, CallbackContext callbackContext, ProxyClient<CloudFormationClient> proxyClient, Logger logger)
[INPUTS] branches=- | result=callb... | /* static context
[FOCAL] protected ProgressEvent<ResourceModel, CallbackContext> ReadHandler.handleRequest(AmazonWebServicesClientProxy proxy, ResourceHandlerRequest<ResourceModel> request, CallbackContext callbackContext, ProxyClient<CloudFormationClient> proxyClient, Logger logger)
[INPUTS] branches=- | result=callb... | true | ok | {"focal": {"class": "ReadHandler", "name": "handleRequest", "signature": "ProgressEvent<ResourceModel, CallbackContext> handleRequest(AmazonWebServicesClientProxy proxy, ResourceHandlerRequest<ResourceModel> request, CallbackContext callbackContext, ProxyClient<CloudFormationClient> proxyClient, Logger logger)", "start... |
194059614_0 | class OAuthConsumerAppToExternal implements Function<OAuthConsumerAppDTO, AuthorizedAppDTO> {
@Override
public AuthorizedAppDTO apply(OAuthConsumerAppDTO oAuthConsumerAppDTO) {
AuthorizedAppDTO authorizedAppDTO = new AuthorizedAppDTO();
authorizedAppDTO.setAppId(oAuthConsumerAppDTO.getApplica... |
OAuthConsumerAppDTO oAuthConsumerAppDTO = new OAuthConsumerAppDTO();
oAuthConsumerAppDTO.setApplicationName("TestApp");
oAuthConsumerAppDTO.setOauthConsumerKey("TestConsumerKey");
AuthorizedAppDTO authorizedAppDTO = new OAuthConsumerAppToExternal().apply(oAuthConsumerAppDTO);
A... | [FOCAL] @Override public AuthorizedAppDTO OAuthConsumerAppToExternal.apply(OAuthConsumerAppDTO oAuthConsumerAppDTO)
[CLASS] class OAuthConsumerAppToExternal implements Function<OAuthConsumerAppDTO, AuthorizedAppDTO>
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] AuthorizedAppDTO.s... | /* static context
[FOCAL] @Override public AuthorizedAppDTO OAuthConsumerAppToExternal.apply(OAuthConsumerAppDTO oAuthConsumerAppDTO)
[COLLABORATORS] param oAuthConsumerAppDTO:OAuthConsumerAppDTO getApplicationName/0,getOauthConsumerKey/0
[NEW] AuthorizedAppDTO
[CALLS-EXTERNAL] AuthorizedAppDTO.setAppId/1, OAuthConsume... | /* static context
[FOCAL] @Override public AuthorizedAppDTO OAuthConsumerAppToExternal.apply(OAuthConsumerAppDTO oAuthConsumerAppDTO)
[COLLABORATORS] param oAuthConsumerAppDTO:OAuthConsumerAppDTO getApplicationName/0,getOauthConsumerKey/0
[NEW] AuthorizedAppDTO
[CALLS-EXTERNAL] AuthorizedAppDTO.setAppId/1, OAuthConsume... | true | ok | {"focal": {"class": "OAuthConsumerAppToExternal", "name": "apply", "signature": "AuthorizedAppDTO apply(OAuthConsumerAppDTO oAuthConsumerAppDTO)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "oAuthConsumerAppDTO", "type": "OAuthConsumerAppDTO"}], "return_type": "AuthorizedAppDTO"}, "class_info... |
194304228_11 | class StringValidateEncodeUtils {
public static String unicodeCodePoint2PercentHexString(int codePoint, String charsetName) {
if (!Character.isDefined(codePoint))
throw new IllegalArgumentException(
String.format("Given code point [U+%1$04X - %1$d] not assigned to an abstract character.", codePoi... | // From "Invalid code points" section of the UTF-8 Wikipedia article
// (http://en.wikipedia.org/wiki/UTF-8#Invalid_code_points):
// According to the UTF-8 definition (RFC 3629) the high and low
// surrogate halves used by UTF-16 (U+D800 through U+DFFF) are not
// legal Unicode values, and their UT... | [FOCAL] public static String StringValidateEncodeUtils.unicodeCodePoint2PercentHexString(int codePoint, String charsetName)
[CLASS] class StringValidateEncodeUtils
[METRICS] loc=30 cc=6 branches=3 loops=1 returns=1 throws=4 nesting=1
[CALLS-EXTERNAL] Character.isDefined/1, String.format/2, Character.getType/1, Charset.... | /* static context
[FOCAL] public static String StringValidateEncodeUtils.unicodeCodePoint2PercentHexString(int codePoint, String charsetName)
[THROWS-WHEN] IllegalArgumentException when !Character.isDefined(codePoint)
[THROWS-WHEN] IllegalArgumentException when Character.isDefined(codePoint) && Character.getType(codePo... | /* static context
[FOCAL] public static String StringValidateEncodeUtils.unicodeCodePoint2PercentHexString(int codePoint, String charsetName)
[THROWS-WHEN] IllegalArgumentException when !Character.isDefined(codePoint)
[THROWS-WHEN] IllegalArgumentException when Character.isDefined(codePoint) && Character.getType(codePo... | true | ok | {"focal": {"class": "StringValidateEncodeUtils", "name": "unicodeCodePoint2PercentHexString", "signature": "String unicodeCodePoint2PercentHexString(int codePoint, String charsetName)", "start_line": 3, "modifiers": "public static", "params": [{"name": "codePoint", "type": "int"}, {"name": "charsetName", "type": "Strin... |
194333585_127 | class IndexScrutinyTableOutput {
static String constructMetadataParamQuery(List<String> metadataSelectCols) {
String pkColsCsv = getPksCsv();
String query =
QueryUtil.constructSelectStatement(OUTPUT_METADATA_TABLE_NAME, metadataSelectCols,
pkColsCsv, null, true);... | String metadataParamQuery =
IndexScrutinyTableOutput
.constructMetadataParamQuery(Arrays.asList("INVALID_ROWS_QUERY_ALL"));
assertEquals(
"SELECT \"INVALID_ROWS_QUERY_ALL\" FROM PHOENIX_INDEX_SCRUTINY_METADATA WHERE (\"SOURCE_TABLE\",\"TARGET_TABLE\",\... | [FOCAL] static String IndexScrutinyTableOutput.constructMetadataParamQuery(List<String> metadataSelectCols)
[CLASS] class IndexScrutinyTableOutput
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String getPksCsv()
[CALLS-EXTERNAL] QueryUtil.constructSelectStatement/5, QueryUtil.con... | /* static context
[FOCAL] static String IndexScrutinyTableOutput.constructMetadataParamQuery(List<String> metadataSelectCols)
[INPUTS] branches=- | result=metadataSelectCols
[CALLS-INTERNAL] String getPksCsv()
[CALLS-EXTERNAL] QueryUtil.constructSelectStatement/5, QueryUtil.constructParameterizedInClause/2
*/
| /* static context
[FOCAL] static String IndexScrutinyTableOutput.constructMetadataParamQuery(List<String> metadataSelectCols)
[INPUTS] branches=- | result=metadataSelectCols
[CALLS-INTERNAL] String getPksCsv()
[CALLS-EXTERNAL] QueryUtil.constructSelectStatement/5, QueryUtil.constructParameterizedInClause/2
*/
class Ind... | true | ok | {"focal": {"class": "IndexScrutinyTableOutput", "name": "constructMetadataParamQuery", "signature": "String constructMetadataParamQuery(List<String> metadataSelectCols)", "start_line": 3, "modifiers": "static", "params": [{"name": "metadataSelectCols", "type": "List<String>"}], "return_type": "String"}, "class_info": {... |
194654807_4 | class InstallManager {
public Path install(BuildahConfiguration buildahConfiguration) throws IOException {
final LocationResolver locationResolver = this.locationResolverChain.getLocationResolver(buildahConfiguration);
return install(locationResolver.getBuildahName(), locationResolver.loadBuildahRe... |
// Given
when(locationResolverChain.getLocationResolver(any(BuildahConfiguration.class))).thenReturn(locationResolver);
when(locationResolver.getBuildahName()).thenReturn("hellobuildah.txt");
when(locationResolver.loadBuildahResource()).thenReturn(new ByteArrayInputStream("binaries/hel... | [FOCAL] public Path InstallManager.install(BuildahConfiguration buildahConfiguration)
[CLASS] class InstallManager
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Path install(String name, InputStream content, BuildahConfiguration buildahConfiguration)
[CALLS-EXTERNAL] LocationReso... | /* static context
[FOCAL] public Path InstallManager.install(BuildahConfiguration buildahConfiguration)
[INPUTS] branches=- | result=buildahConfiguration, locationResolverChain
[COLLABORATORS] field locationResolverChain:LocationResolverChain getLocationResolver/1
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] Path... | /* static context
[FOCAL] public Path InstallManager.install(BuildahConfiguration buildahConfiguration)
[INPUTS] branches=- | result=buildahConfiguration, locationResolverChain
[COLLABORATORS] field locationResolverChain:LocationResolverChain getLocationResolver/1
[EXCEPTIONS] declares IOException
[CALLS-INTERNAL] Path... | true | ok | {"focal": {"class": "InstallManager", "name": "install", "signature": "Path install(BuildahConfiguration buildahConfiguration) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "buildahConfiguration", "type": "BuildahConfiguration"}], "return_type": "Path"}, "class_info": {"name": "Instal... |
194726816_0 | class MultiSignaturePublicKey implements ByteSequence {
public static MultiSignaturePublicKey create(List<PublicKey> publicKeys, int threshold) {
byte[] multiSigPublicKeyBytes = new byte[publicKeys.size() * PUBLIC_KEY_LENGTH + 1];
int counter = 0;
for (PublicKey pk : publicKeys) {
... | MultiSignaturePublicKey multisigPubKey = MultiSignaturePublicKey.create(asList(PublicKey.fromHexString(PUBKEY1),
PublicKey.fromHexString(PUBKEY2), PublicKey.fromHexString(PUBKEY3)), 2);
assertThat(multisigPubKey.toString(), is(
"df2226d8633a4f392cca1c5d198ae10e99e1192b51... | [FOCAL] public static MultiSignaturePublicKey MultiSignaturePublicKey.create(List<PublicKey> publicKeys, int threshold)
[CLASS] class MultiSignaturePublicKey implements ByteSequence
[METRICS] loc=10 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] List<PublicKey>.size/0, PublicKey.toArray/0, System... | /* static context
[FOCAL] public static MultiSignaturePublicKey MultiSignaturePublicKey.create(List<PublicKey> publicKeys, int threshold)
[PATH1] foreach(PublicKey pk : publicKeys)=T -> exit loop -> return new MultiSignaturePublicKey(ByteArray.from(multiSigPublicKeyBytes))
[PATH2] foreach(PublicKey pk : publicKeys)=F -... | /* static context
[FOCAL] public static MultiSignaturePublicKey MultiSignaturePublicKey.create(List<PublicKey> publicKeys, int threshold)
[PATH1] foreach(PublicKey pk : publicKeys)=T -> exit loop -> return new MultiSignaturePublicKey(ByteArray.from(multiSigPublicKeyBytes))
[PATH2] foreach(PublicKey pk : publicKeys)=F -... | true | ok | {"focal": {"class": "MultiSignaturePublicKey", "name": "create", "signature": "MultiSignaturePublicKey create(List<PublicKey> publicKeys, int threshold)", "start_line": 3, "modifiers": "public static", "params": [{"name": "publicKeys", "type": "List<PublicKey>"}, {"name": "threshold", "type": "int"}], "return_type": "M... |
194776722_7 | class Line {
public boolean isVertical() {
return this.isVerticalLine;
}
public Line(Point p1, Point p2);
public Line(Point point, double slope);
public Line(double slope, double yIntercept);
public double perpendicularSlope();
public double evaluate(double x);
public Point... | // We correctly assign slope and intercept
Line base = new Line(-1, 2);
assertEquals(base.slope, -1);
assertEquals(base.intercept, 2);
assertFalse(base.isVertical());
// We convert from point slope to slope intercept properly
Point p1 = new Point(-1000, 1002);
... | [FOCAL] public boolean Line.isVertical()
[CLASS] class Line
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[FIELDS] read=isVerticalLine
[CLASS-MEMBERS] Line(Point p1, Point p2); Line(Point point, double slope); Line(double slope, double yIntercept); double perpendicularSlope(); double evaluate(dou... | /* static context
[FOCAL] public boolean Line.isVertical()
[FIELDS] read=isVerticalLine
*/
| /* static context
[FOCAL] public boolean Line.isVertical()
[FIELDS] read=isVerticalLine
*/
class Line {
public boolean isVertical() {
return this.isVerticalLine;
}
public Line(Point p1, Point p2);
public Line(Point point, double slope);
public Line(double slope, double yIntercept);
... | true | ok | {"focal": {"class": "Line", "name": "isVertical", "signature": "boolean isVertical()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "Line", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Line", "kin... |
194907949_1 | class OreSettingsYamlImpl implements ConfigurationSerializable, OreSettings {
@NotNull
@Override
public Ore getOre() {
return this.ore;
}
public OreSettingsYamlImpl(@NotNull final Ore ore);
public OreSettingsYamlImpl(@NotNull final Ore ore, @NotNull final Map<Setting, Double> setting... | for (Ore ore : Ore.values())
assertSame(ore, new OreSettingsYamlImpl(ore).getOre());
for (Ore ore : Ore.values())
assertSame(ore, new OreSettingsYamlImpl(ore, new HashMap<>()).getOre());
}
} | [FOCAL] @NotNull @Override public Ore OreSettingsYamlImpl.getOre()
[CLASS] class OreSettingsYamlImpl implements ConfigurationSerializable, OreSettings
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[FIELDS] read=ore
[CLASS-MEMBERS] OreSettingsYamlImpl(Ore ore); OreSettingsYamlImpl(Ore ore, Map<Set... | /* static context
[FOCAL] @NotNull @Override public Ore OreSettingsYamlImpl.getOre()
[FIELDS] read=ore
*/
| /* static context
[FOCAL] @NotNull @Override public Ore OreSettingsYamlImpl.getOre()
[FIELDS] read=ore
*/
class OreSettingsYamlImpl implements ConfigurationSerializable, OreSettings {
@NotNull
@Override
public Ore getOre() {
return this.ore;
}
public OreSettingsYamlImpl(@NotNull final Ore... | true | ok | {"focal": {"class": "OreSettingsYamlImpl", "name": "getOre", "signature": "Ore getOre()", "start_line": 3, "modifiers": "@NotNull @Override public", "params": [], "return_type": "Ore"}, "class_info": {"name": "OreSettingsYamlImpl", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "ConfigurationSerial... |
195077933_15 | class AccountController {
@GetMapping(path = "/list")
@Authorize(value = {
AuthConstant.AUTHORIZATION_SUPPORT_USER
})
public ListAccountResponse listAccounts(@RequestParam int offset, @RequestParam @Min(0) int limit) {
AccountList accountList = accountService.list(offset, limit);
... | // arrange mock
when(mailClient.send(any(EmailRequest.class))).thenReturn(BaseResponse.builder().message("email sent").build());
// first account
String name = "testAccount001";
String email = "test001@staffjoy.xyz";
String phoneNumber = "18001801236";
String sub... | [FOCAL] @GetMapping(path = "/list") @Authorize(value = { AuthConstant.AUTHORIZATION_SUPPORT_USER }) public ListAccountResponse AccountController.listAccounts(int offset, int limit)
[CLASS] class AccountController
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] accountService.list/2... | class AccountController {
@GetMapping(path = "/list")
@Authorize(value = {
AuthConstant.AUTHORIZATION_SUPPORT_USER
})
public ListAccountResponse listAccounts(@RequestParam int offset, @RequestParam @Min(0) int limit) {
AccountList accountList = accountService.list(offset, limit);
... | false | ok | {"focal": {"class": "AccountController", "name": "listAccounts", "signature": "ListAccountResponse listAccounts(int offset, int limit)", "start_line": 3, "modifiers": "@GetMapping(path = \"/list\") @Authorize(value = { AuthConstant.AUTHORIZATION_SUPPORT_USER }) public", "params": [{"name": "offset", "type": "int"}, {"n... | |
195297601_0 | class CurrencyConverter {
public BigDecimal convert(BigDecimal amount, String currencyFrom, String currencyTo) {
BigDecimal exchangeRate = currencyDto.getExchangeRate(currencyFrom, currencyTo);
return amount.multiply(exchangeRate);
}
public CurrencyConverter(CurrencyDto currencyDto);
public static Cur... | Assertions.assertEquals(converter.convert(BigDecimal.TEN, "EUR", "USD"), new BigDecimal("100"));
Assertions.assertTrue(currencyDto.isMethodCalled());
}
} | [FOCAL] public BigDecimal CurrencyConverter.convert(BigDecimal amount, String currencyFrom, String currencyTo)
[CLASS] class CurrencyConverter
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] HegiCurrencyDTO.getExchangeRate/2, BigDecimal.multiply/1
[FIELDS] read=currencyDto:HegiCurr... | /* static context
[FOCAL] public BigDecimal CurrencyConverter.convert(BigDecimal amount, String currencyFrom, String currencyTo)
[INPUTS] branches=- | result=amount, currencyFrom, currencyTo, currencyDto
[COLLABORATORS] field currencyDto:HegiCurrencyDTO getExchangeRate/2; param amount:BigDecimal multiply/1
[FIELDS] rea... | /* static context
[FOCAL] public BigDecimal CurrencyConverter.convert(BigDecimal amount, String currencyFrom, String currencyTo)
[INPUTS] branches=- | result=amount, currencyFrom, currencyTo, currencyDto
[COLLABORATORS] field currencyDto:HegiCurrencyDTO getExchangeRate/2; param amount:BigDecimal multiply/1
[FIELDS] rea... | true | ok | {"focal": {"class": "CurrencyConverter", "name": "convert", "signature": "BigDecimal convert(BigDecimal amount, String currencyFrom, String currencyTo)", "start_line": 3, "modifiers": "public", "params": [{"name": "amount", "type": "BigDecimal"}, {"name": "currencyFrom", "type": "String"}, {"name": "currencyTo", "type"... |
195330123_50 | class HBaseClient10 extends com.yahoo.ycsb.DB {
@Override
public Status scan(String table, String startkey, int recordcount,
Set<String> fields, Vector<HashMap<String, ByteIterator>> result) {
// if this is a "new" table, init HTable object. Else, use existing one
if (!tableName.equals(table)) {
... | // Fill with data
final String colStr = "row_number";
final byte[] col = Bytes.toBytes(colStr);
final int n = 10;
final List<Put> puts = new ArrayList<Put>(n);
for(int i = 0; i < n; i++) {
final byte[] key = Bytes.toBytes(String.format("%05d", i));
final byte[] value = java.nio.ByteB... | [FOCAL] @Override public Status HBaseClient10.scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String, ByteIterator>> result)
[CLASS] class HBaseClient10 extends com.yahoo.ycsb.DB
[METRICS] loc=79 cc=13 branches=7 loops=3 returns=3 throws=0 nesting=3
[CALLS-INTERNAL] void getHTabl... | /* static context
[FOCAL] @Override public Status HBaseClient10.scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String, ByteIterator>> result)
[PATH1] if(!tableName.equals(table))=T -> if(this.usePageFilter)=T -> if(fields == null)=F -> foreach(String field : fields)=T -> exit lo... | /* static context
[FOCAL] @Override public Status HBaseClient10.scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String, ByteIterator>> result)
[PATH1] if(!tableName.equals(table))=T -> if(this.usePageFilter)=T -> if(fields == null)=F -> foreach(String field : fields)=T -> exit lo... | true | ok | {"focal": {"class": "HBaseClient10", "name": "scan", "signature": "Status scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String, ByteIterator>> result)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "table", "type": "String"}, {"name": "startkey", "type"... |
195429957_0 | class OpenTracingUtil {
public static Span getSpan() {
Context c = Vertx.currentContext();
return c == null ? null : c.getLocal(ACTIVE_SPAN);
}
public static void setSpan(Span span);
public static void clearContext();
private Vertx vertx;
private MockTracer tracer;
}
class OpenTracingUtilTest {... | Span span = tracer.buildSpan("test").start();
vertx.runOnContext(ignored -> {
assertNull(OpenTracingUtil.getSpan());
Context context = Vertx.currentContext();
context.putLocal(ACTIVE_SPAN, span);
assertSame(span, OpenTracingUtil.getSpan());
});
}
} | [FOCAL] public static Span OpenTracingUtil.getSpan()
[CLASS] class OpenTracingUtil
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Vertx.currentContext/0, Context.getLocal/1
[DATAFLOW] c@L2->L3
[CLASS-MEMBERS] void setSpan(Span span); void clearContext()
[TEST] OpenTracingUtilTest:... | /* static context
[FOCAL] public static Span OpenTracingUtil.getSpan()
[CALLS-EXTERNAL] Vertx.currentContext/0, Context.getLocal/1
*/
| /* static context
[FOCAL] public static Span OpenTracingUtil.getSpan()
[CALLS-EXTERNAL] Vertx.currentContext/0, Context.getLocal/1
*/
class OpenTracingUtil {
public static Span getSpan() {
Context c = Vertx.currentContext();
return c == null ? null : c.getLocal(ACTIVE_SPAN);
}
public static void setSpan... | true | ok | {"focal": {"class": "OpenTracingUtil", "name": "getSpan", "signature": "Span getSpan()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Span"}, "class_info": {"name": "OpenTracingUtil", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "vertx", "... |
195650526_707 | class SignatureAlgorithmConverter {
static String toJavaName(String opensslName) {
if (opensslName == null) {
return null;
}
Matcher matcher = PATTERN.matcher(opensslName);
if (matcher.matches()) {
String group2 = matcher.group(2);
if (group2 != n... | assertEquals("SHA512withRSA", SignatureAlgorithmConverter.toJavaName("sha512WithRSAEncryption"));
}
} | [FOCAL] static String SignatureAlgorithmConverter.toJavaName(String opensslName)
[CLASS] class SignatureAlgorithmConverter
[METRICS] loc=16 cc=5 branches=4 loops=0 returns=4 throws=0 nesting=2
[CALLS-EXTERNAL] PATTERN.matcher/1, Matcher.matches/0, Matcher.group/1, String.toUpperCase/1, matcher.group(3).toUpperCase/1, m... | /* static context
[FOCAL] static String SignatureAlgorithmConverter.toJavaName(String opensslName)
[PATH1] if(opensslName == null)=F -> if(matcher.matches())=T -> if(group2 != null)=F -> if(matcher.group(4) != null)=T -> return matcher.group(7).toUpperCase(Locale.ROOT) + "with" + matcher.group(...
[PATH2] if(opensslNam... | /* static context
[FOCAL] static String SignatureAlgorithmConverter.toJavaName(String opensslName)
[PATH1] if(opensslName == null)=F -> if(matcher.matches())=T -> if(group2 != null)=F -> if(matcher.group(4) != null)=T -> return matcher.group(7).toUpperCase(Locale.ROOT) + "with" + matcher.group(...
[PATH2] if(opensslNam... | true | ok | {"focal": {"class": "SignatureAlgorithmConverter", "name": "toJavaName", "signature": "String toJavaName(String opensslName)", "start_line": 3, "modifiers": "static", "params": [{"name": "opensslName", "type": "String"}], "return_type": "String"}, "class_info": {"name": "SignatureAlgorithmConverter", "kind": "class", "... |
195708935_5 | class Parser {
public ParsedOutput parse(List<String> args) {
final Command commandName = this.findCommand(args);
fillShortAndLongOptions(commandName);
final Map<CommandFlag, Object> options = this.findOptions(args);
return new ParsedOutput(commandName, args, options);
}
public Parser(final ... | assertThrows(
NoCommandNameFound.class,
() -> {
ParsedOutput output = testParser.parse(new ArrayList<>(List.of("--update")));
});
}
} | [FOCAL] public ParsedOutput Parser.parse(List<String> args)
[CLASS] class Parser
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Command findCommand(List<String> args); Map<CommandFlag, Object> findOptions(List<String> args); void fillShortAndLongOptions(Command commandName)
[NEW] ... | /* static context
[FOCAL] public ParsedOutput Parser.parse(List<String> args)
[INPUTS] branches=- | result=args
[CALLS-INTERNAL] Command findCommand(List<String> args); Map<CommandFlag, Object> findOptions(List<String> args); void fillShortAndLongOptions(Command commandName)
[NEW] ParsedOutput
*/
| /* static context
[FOCAL] public ParsedOutput Parser.parse(List<String> args)
[INPUTS] branches=- | result=args
[CALLS-INTERNAL] Command findCommand(List<String> args); Map<CommandFlag, Object> findOptions(List<String> args); void fillShortAndLongOptions(Command commandName)
[NEW] ParsedOutput
*/
class Parser {
publ... | true | ok | {"focal": {"class": "Parser", "name": "parse", "signature": "ParsedOutput parse(List<String> args)", "start_line": 3, "modifiers": "public", "params": [{"name": "args", "type": "List<String>"}], "return_type": "ParsedOutput"}, "class_info": {"name": "Parser", "kind": "class", "modifiers": "", "superclass": null, "inter... |
196110471_5 | class Handy {
public static StringBuilder appendByteArrayAsHex(StringBuilder sb, byte[] ab, int of, int cb)
{
sb.ensureCapacity(sb.length() + cb * 2);
while (--cb >= 0)
{
int n = ab[of++];
sb.append(nibbleToChar(n >> 4))
.append(nibbleTo... | StringBuilder sb = new StringBuilder();
Assert.assertEquals(sb, appendByteArrayAsHex(sb, new byte[] {0x01, (byte) 0xFF, 0x78, 0x5A}, 1, 2));
Assert.assertEquals(sb.toString(), "FF78");
}
} | [FOCAL] public static StringBuilder Handy.appendByteArrayAsHex(StringBuilder sb, byte[] ab, int of, int cb)
[CLASS] class Handy
[METRICS] loc=11 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] char nibbleToChar(int n)
[CALLS-EXTERNAL] StringBuilder.ensureCapacity/1, StringBuilder.length/0, sb.appe... | /* static context
[FOCAL] public static StringBuilder Handy.appendByteArrayAsHex(StringBuilder sb, byte[] ab, int of, int cb)
[PATH1] while(--cb >= 0)=T -> exit loop -> return sb
[PATH2] while(--cb >= 0)=F -> return sb
[INPUTS] branches=cb | result=sb
[COLLABORATORS] param sb:StringBuilder ensureCapacity/1,length/0,app... | /* static context
[FOCAL] public static StringBuilder Handy.appendByteArrayAsHex(StringBuilder sb, byte[] ab, int of, int cb)
[PATH1] while(--cb >= 0)=T -> exit loop -> return sb
[PATH2] while(--cb >= 0)=F -> return sb
[INPUTS] branches=cb | result=sb
[COLLABORATORS] param sb:StringBuilder ensureCapacity/1,length/0,app... | true | ok | {"focal": {"class": "Handy", "name": "appendByteArrayAsHex", "signature": "StringBuilder appendByteArrayAsHex(StringBuilder sb, byte[] ab, int of, int cb)", "start_line": 3, "modifiers": "public static", "params": [{"name": "sb", "type": "StringBuilder"}, {"name": "ab", "type": "byte[]"}, {"name": "of", "type": "int"},... |
197006279_77 | class SphU {
public static Entry entry(String name) throws BlockException {
return Env.sph.entry(name, EntryType.OUT, 1, OBJECTS0);
}
public static Entry entry(Method method);
public static Entry entry(Method method, int count);
public static Entry entry(String name, int count);
public... | Method method = SphUTest.class.getMethod("testMethodEntryNormal");
Entry e = SphU.entry(method, 2);
assertNotNull(e);
assertTrue(StringUtil
.equalsIgnoreCase(e.resourceWrapper.getName(),
"com.alibaba.csp.sentinel.SphUTest:testMethodEntryNormal()"));
a... | [FOCAL] public static Entry SphU.entry(String name)
[CLASS] class SphU
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Env.sph.entry/4
[EXCEPTIONS] declares BlockException
[INPUTS] branches=- | result=name
[DATAFLOW] name@param->L2
[CLASS-MEMBERS] Entry entry(Method method); Entry ... | /* static context
[FOCAL] public static Entry SphU.entry(String name)
[INPUTS] branches=- | result=name
[EXCEPTIONS] declares BlockException
[CALLS-EXTERNAL] Env.sph.entry/4
*/
| /* static context
[FOCAL] public static Entry SphU.entry(String name)
[INPUTS] branches=- | result=name
[EXCEPTIONS] declares BlockException
[CALLS-EXTERNAL] Env.sph.entry/4
*/
class SphU {
public static Entry entry(String name) throws BlockException {
return Env.sph.entry(name, EntryType.OUT, 1, OBJECTS0)... | true | ok | {"focal": {"class": "SphU", "name": "entry", "signature": "Entry entry(String name) throws BlockException", "start_line": 3, "modifiers": "public static", "params": [{"name": "name", "type": "String"}], "return_type": "Entry"}, "class_info": {"name": "SphU", "kind": "class", "modifiers": "", "superclass": null, "interf... |
197192301_6 | class ArtifactTypeUtil {
public static ArtifactType discoverType(ContentHandle content, String contentType) throws InvalidArtifactTypeException {
boolean triedProto = false;
// If the content-type suggests it's protobuf, try that first.
if (contentType == null || contentType.toLowerCase().... | Assertions.assertThrows(InvalidArtifactTypeException.class, () -> {
ContentHandle content = resourceToContentHandle("example.txt");
ArtifactTypeUtil.discoverType(content, null);
});
}
} | [FOCAL] public static ArtifactType ArtifactTypeUtil.discoverType(ContentHandle content, String contentType)
[CLASS] class ArtifactTypeUtil
[METRICS] loc=76 cc=14 branches=11 loops=0 returns=10 throws=2 nesting=3
[CALLS-INTERNAL] ArtifactType tryProto(ContentHandle content); boolean tryGraphQL(ContentHandle content)
[CA... | /* static context
[FOCAL] public static ArtifactType ArtifactTypeUtil.discoverType(ContentHandle content, String contentType)
[THROWS-WHEN] InvalidArtifactTypeException when contentType == null || contentType.toLowerCase().contains("proto") && !(type != null) && try-body throws && !triedProto && !(type != null) && !try... | /* static context
[FOCAL] public static ArtifactType ArtifactTypeUtil.discoverType(ContentHandle content, String contentType)
[THROWS-WHEN] InvalidArtifactTypeException when contentType == null || contentType.toLowerCase().contains("proto") && !(type != null) && try-body throws && !triedProto && !(type != null) && !try... | true | ok | {"focal": {"class": "ArtifactTypeUtil", "name": "discoverType", "signature": "ArtifactType discoverType(ContentHandle content, String contentType) throws InvalidArtifactTypeException", "start_line": 3, "modifiers": "public static", "params": [{"name": "content", "type": "ContentHandle"}, {"name": "contentType", "type":... |
197277844_0 | class OAuthBearerTokenImpl implements OAuthBearerToken {
static String getPayload(String token) {
int first = token.indexOf('.');
int last = token.lastIndexOf('.');
return token.substring(first+1, last);
}
public OAuthBearerTokenImpl(String token);
private static String pars... | String payload = "eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJteXByb2plY3QiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlY3JldC5uYW1lIjoiZGVmYXVsdC10b2tlbi1ydHE2ayIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJkZWZhdWx0Iiwia3ViZX... | [FOCAL] static String OAuthBearerTokenImpl.getPayload(String token)
[CLASS] class OAuthBearerTokenImpl implements OAuthBearerToken
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] String.indexOf/1, String.lastIndexOf/1, String.substring/2
[INPUTS] branches=- | result=token
[DATAFLOW... | /* static context
[FOCAL] static String OAuthBearerTokenImpl.getPayload(String token)
[INPUTS] branches=- | result=token
[CALLS-EXTERNAL] String.indexOf/1, String.lastIndexOf/1, String.substring/2
*/
| /* static context
[FOCAL] static String OAuthBearerTokenImpl.getPayload(String token)
[INPUTS] branches=- | result=token
[CALLS-EXTERNAL] String.indexOf/1, String.lastIndexOf/1, String.substring/2
*/
class OAuthBearerTokenImpl implements OAuthBearerToken {
static String getPayload(String token) {
int first... | true | ok | {"focal": {"class": "OAuthBearerTokenImpl", "name": "getPayload", "signature": "String getPayload(String token)", "start_line": 3, "modifiers": "static", "params": [{"name": "token", "type": "String"}], "return_type": "String"}, "class_info": {"name": "OAuthBearerTokenImpl", "kind": "class", "modifiers": "", "superclas... |
197729287_0 | class Movie extends BaseObservable implements Serializable {
@Bindable
public String getTitle() {
return title;
}
@Ignore public Movie();
public Movie(String posterPath, boolean adult, String overview, String releaseDate, int id, String originalTitle, String originalLanguage, String titl... | final String mTitle = "Alita: Battle Angel";
Movie newMovie = new Movie();
newMovie.setTitle(mTitle);
assertEquals(newMovie.getTitle(), mTitle);
}
} | [FOCAL] @Bindable public String Movie.getTitle()
[CLASS] class Movie extends BaseObservable implements Serializable
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] Movie(); Movie(String posterPath, boolean adult, String overview, String releaseDate, int id, String originalTitle, Str... | /* static context
[FOCAL] @Bindable public String Movie.getTitle()
*/
| /* static context
[FOCAL] @Bindable public String Movie.getTitle()
*/
class Movie extends BaseObservable implements Serializable {
@Bindable
public String getTitle() {
return title;
}
@Ignore public Movie();
public Movie(String posterPath, boolean adult, String overview, String releaseDa... | true | ok | {"focal": {"class": "Movie", "name": "getTitle", "signature": "String getTitle()", "start_line": 3, "modifiers": "@Bindable public", "params": [], "return_type": "String"}, "class_info": {"name": "Movie", "kind": "class", "modifiers": "", "superclass": "BaseObservable", "interfaces": "Serializable", "fields": [], "memb... |
197782274_0 | class Contact implements Comparable<Contact> {
@Override
public int compareTo(Contact contact) {
String givenName1 = this.givenName == null ? "" : this.givenName.toLowerCase();
String givenName2 = contact == null ? ""
: (contact.givenName == null ? "" : contact.givenName.toLowerCase... | Contact contact1 = new Contact("id");
contact1.givenName = "givenName";
Contact contact2 = new Contact("id2");
assertThat(contact1.compareTo(contact2))
.isGreaterThan(0);
}
} | [FOCAL] @Override public int Contact.compareTo(Contact contact)
[CLASS] class Contact implements Comparable<Contact>
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] this.givenName.toLowerCase/0, contact.givenName.toLowerCase/0, String.compareTo/1
[FIELDS] read=givenName
[INPUTS] br... | /* static context
[FOCAL] @Override public int Contact.compareTo(Contact contact)
[INPUTS] branches=- | result=contact
[COLLABORATORS] field givenName toLowerCase/0
[FIELDS] read=givenName
[CALLS-EXTERNAL] this.givenName.toLowerCase/0, contact.givenName.toLowerCase/0, String.compareTo/1
*/
| /* static context
[FOCAL] @Override public int Contact.compareTo(Contact contact)
[INPUTS] branches=- | result=contact
[COLLABORATORS] field givenName toLowerCase/0
[FIELDS] read=givenName
[CALLS-EXTERNAL] this.givenName.toLowerCase/0, contact.givenName.toLowerCase/0, String.compareTo/1
*/
class Contact implements Comp... | true | ok | {"focal": {"class": "Contact", "name": "compareTo", "signature": "int compareTo(Contact contact)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "contact", "type": "Contact"}], "return_type": "int"}, "class_info": {"name": "Contact", "kind": "class", "modifiers": "", "superclass": null, "interfa... |
198181246_11 | class ServiceCombClient {
public List<ServiceInstance> getInstances(Microservice microservice, String revision) {
List<ServiceInstance> instanceList = new ArrayList<>();
Response response = null;
try {
Map<String, String> heades = Maps.newHashMap();
String CONSUMER_HEADER = "X-ConsumerId";
... | final int expectedCode = 200;
Response response = new Response();
response.setStatusCode(expectedCode);
String responseString = "{\n"
+ " \"instances\": [\n"
+ " {\n"
+ " \"instanceId\": \"1\",\n"
+ " \"serviceId\": \"2\",\n"
+ " \"version\": \"... | [FOCAL] public List<ServiceInstance> ServiceCombClient.getInstances(Microservice microservice, String revision)
[CLASS] class ServiceCombClient
[METRICS] loc=63 cc=11 branches=6 loops=1 returns=4 throws=0 nesting=4
[CALLS-INTERNAL] String addParam2URI(String path, String type, String revision, Microservice microservice... | /* static context
[FOCAL] public List<ServiceInstance> ServiceCombClient.getInstances(Microservice microservice, String revision)
[PATH1] if(response.getStatusCode() == HttpStatus.SC_OK)=T -> if(result == null || result.getInstances() == null)=F -> if(!StringUtils.isEmpty(response.getHeader(REVISION_HEADER)))=T -> fore... | /* static context
[FOCAL] public List<ServiceInstance> ServiceCombClient.getInstances(Microservice microservice, String revision)
[PATH1] if(response.getStatusCode() == HttpStatus.SC_OK)=T -> if(result == null || result.getInstances() == null)=F -> if(!StringUtils.isEmpty(response.getHeader(REVISION_HEADER)))=T -> fore... | true | ok | {"focal": {"class": "ServiceCombClient", "name": "getInstances", "signature": "List<ServiceInstance> getInstances(Microservice microservice, String revision)", "start_line": 3, "modifiers": "public", "params": [{"name": "microservice", "type": "Microservice"}, {"name": "revision", "type": "String"}], "return_type": "Li... |
198220069_27 | class FilterMessageSupport {
public List<ByteBuffer> filter(Consumer consumer, List<ByteBuffer> byteBuffers, FilterCallback filterCallback) throws JoyQueueException {
FilterPipeline<MessageFilter> filterPipeline = filterRuleCache.get(consumer.getId());
if (filterPipeline == null) {
filt... | // Consumer consumer, List<ByteBuffer> byteBuffers, FilterCallback filterCallback
List<ByteBuffer> byteBufferList = new LinkedList<>();
for (int i = 0; i < 10; i++) {
ByteBuffer allocate = ByteBuffer.allocate(100);
allocate.position(59);
allocate.putShort((sho... | [FOCAL] public List<ByteBuffer> FilterMessageSupport.filter(Consumer consumer, List<ByteBuffer> byteBuffers, FilterCallback filterCallback)
[CLASS] class FilterMessageSupport
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] FilterPipeline<MessageFilter> createFilterPipeline(Consumer... | /* static context
[FOCAL] public List<ByteBuffer> FilterMessageSupport.filter(Consumer consumer, List<ByteBuffer> byteBuffers, FilterCallback filterCallback)
[PATH1] if(filterPipeline == null)=T -> return result
[PATH2] if(filterPipeline == null)=F -> return result
[INPUTS] branches=consumer | result=byteBuffers, consu... | /* static context
[FOCAL] public List<ByteBuffer> FilterMessageSupport.filter(Consumer consumer, List<ByteBuffer> byteBuffers, FilterCallback filterCallback)
[PATH1] if(filterPipeline == null)=T -> return result
[PATH2] if(filterPipeline == null)=F -> return result
[INPUTS] branches=consumer | result=byteBuffers, consu... | true | ok | {"focal": {"class": "FilterMessageSupport", "name": "filter", "signature": "List<ByteBuffer> filter(Consumer consumer, List<ByteBuffer> byteBuffers, FilterCallback filterCallback) throws JoyQueueException", "start_line": 3, "modifiers": "public", "params": [{"name": "consumer", "type": "Consumer"}, {"name": "byteBuffer... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.