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 |
|---|---|---|---|---|---|---|---|---|
162657830_5 | class Strings {
public static String repeat(char value, int n) {
return new String(new char[n]).replace("\0", String.valueOf(value));
}
public static String zeros(int n);
public static boolean isEmpty(String s);
}
class StringsTest {
@Test
public void testRepeat() {
| Assertions.assertEquals(repeat('0', 0), "");
Assertions.assertEquals(repeat('1', 3), "111");
}
} | [FOCAL] public static String Strings.repeat(char value, int n)
[CLASS] class Strings
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] new String(new char[n]).replace/2, String.valueOf/1
[NEW] String
[INPUTS] branches=- | result=n, value
[DATAFLOW] n@param->L2; value@param->L2
[CLASS... | /* static context
[FOCAL] public static String Strings.repeat(char value, int n)
[INPUTS] branches=- | result=n, value
[NEW] String
[CALLS-EXTERNAL] new String(new char[n]).replace/2, String.valueOf/1
*/
| /* static context
[FOCAL] public static String Strings.repeat(char value, int n)
[INPUTS] branches=- | result=n, value
[NEW] String
[CALLS-EXTERNAL] new String(new char[n]).replace/2, String.valueOf/1
*/
class Strings {
public static String repeat(char value, int n) {
return new String(new char[n]).replace("\0",... | true | ok | {"focal": {"class": "Strings", "name": "repeat", "signature": "String repeat(char value, int n)", "start_line": 3, "modifiers": "public static", "params": [{"name": "value", "type": "char"}, {"name": "n", "type": "int"}], "return_type": "String"}, "class_info": {"name": "Strings", "kind": "class", "modifiers": "", "sup... |
162700032_23 | class NetworkingModule extends ReactContextBaseJavaModule {
@ReactMethod
/**
* @param timeout value of 0 results in no timeout
*/
public void sendRequest(
String method,
String url,
final int requestId,
ReadableArray headers,
ReadableMap data,
final String responseType,
... | RCTDeviceEventEmitter emitter = mock(RCTDeviceEventEmitter.class);
ReactApplicationContext context = mock(ReactApplicationContext.class);
when(context.getJSModule(any(Class.class))).thenReturn(emitter);
OkHttpClient httpClient = mock(OkHttpClient.class);
OkHttpClient.Builder clientBuilder = mock(Ok... | [FOCAL] @ReactMethod /** * @param timeout value of 0 results in no timeout */ public void NetworkingModule.sendRequest(String method, String url, int requestId, ReadableArray headers, ReadableMap data, String responseType, boolean useIncrementalUpdates, int timeout, boolean withCredentials)
[CLASS] class NetworkingModu... | class NetworkingModule extends ReactContextBaseJavaModule {
@ReactMethod
/**
* @param timeout value of 0 results in no timeout
*/
public void sendRequest(
String method,
String url,
final int requestId,
ReadableArray headers,
ReadableMap data,
final String responseType,
... | false | ok | {"focal": {"class": "NetworkingModule", "name": "sendRequest", "signature": "void sendRequest(String method, String url, int requestId, ReadableArray headers, ReadableMap data, String responseType, boolean useIncrementalUpdates, int timeout, boolean withCredentials)", "start_line": 3, "modifiers": "@ReactMethod /** * @... | |
162806930_1 | class StringUtils {
@Nonnull
@MustNotContainNull
public static List<String> extractJdepsModuleNames(@Nonnull final String text) {
final List<String> result = new ArrayList<>();
for (final String line : text.split("\\n")) {
final Matcher lineMatcher = PATTERN_MODULE_LINE.matcher(line);
if (lin... | final String text = IOUtils.resourceToString("jmods.out", StandardCharsets.UTF_8, StringUtilsTest.class.getClassLoader());
final List<String> modules = StringUtils.extractJdepsModuleNames(text);
assertArrayEquals(
new String[] {
"java.base",
"java.compiler",
"java... | [FOCAL] @Nonnull @MustNotContainNull public static List<String> StringUtils.extractJdepsModuleNames(String text)
[CLASS] class StringUtils
[METRICS] loc=15 cc=4 branches=2 loops=1 returns=1 throws=0 nesting=3
[CALLS-EXTERNAL] String.split/1, PATTERN_MODULE_LINE.matcher/1, Matcher.find/0, lineMatcher.group(2).trim/0, Ma... | /* static context
[FOCAL] @Nonnull @MustNotContainNull public static List<String> StringUtils.extractJdepsModuleNames(String text)
[PATH1] foreach(String line : text.split("\\n"))=T -> if(lineMatcher.find())=T -> if(!moduleName.contains(" "))=T -> exit loop -> return result
[PATH2] foreach(String line : text.split("\\n... | /* static context
[FOCAL] @Nonnull @MustNotContainNull public static List<String> StringUtils.extractJdepsModuleNames(String text)
[PATH1] foreach(String line : text.split("\\n"))=T -> if(lineMatcher.find())=T -> if(!moduleName.contains(" "))=T -> exit loop -> return result
[PATH2] foreach(String line : text.split("\\n... | true | ok | {"focal": {"class": "StringUtils", "name": "extractJdepsModuleNames", "signature": "List<String> extractJdepsModuleNames(String text)", "start_line": 3, "modifiers": "@Nonnull @MustNotContainNull public static", "params": [{"name": "text", "type": "String"}], "return_type": "List<String>"}, "class_info": {"name": "Stri... |
162897877_8 | class ByteSequenceMap implements SequenceMap<ByteBuffer> {
public void put(final ByteBuffer value, final long id)
{
if (value.remaining() > maxKeyLength)
{
throw new IllegalArgumentException("Key too long");
}
if (liveEntryCount > entryCountToTriggerRehash)
{... | map.put(SEARCH_TERM, ID);
assertSearchResult(map, SEARCH_TERM, ID);
}
} | [FOCAL] public void ByteSequenceMap.put(ByteBuffer value, long id)
[CLASS] class ByteSequenceMap implements SequenceMap<ByteBuffer>
[METRICS] loc=37 cc=7 branches=5 loops=1 returns=1 throws=1 nesting=3
[CALLS-INTERNAL] boolean isExistingEntryAt(ByteBuffer value, int entryIndex, int hashValue); boolean isValuePresent(in... | /* static context
[FOCAL] public void ByteSequenceMap.put(ByteBuffer value, long id)
[THROWS-WHEN] IllegalArgumentException when value.remaining() > maxKeyLength
[PATH1] if(value.remaining() > maxKeyLength)=F -> if(liveEntryCount > entryCountToTriggerRehash)=T -> if(!isValuePresent(entryIndex, dataBuffer) || existingEn... | /* static context
[FOCAL] public void ByteSequenceMap.put(ByteBuffer value, long id)
[THROWS-WHEN] IllegalArgumentException when value.remaining() > maxKeyLength
[PATH1] if(value.remaining() > maxKeyLength)=F -> if(liveEntryCount > entryCountToTriggerRehash)=T -> if(!isValuePresent(entryIndex, dataBuffer) || existingEn... | true | ok | {"focal": {"class": "ByteSequenceMap", "name": "put", "signature": "void put(ByteBuffer value, long id)", "start_line": 3, "modifiers": "public", "params": [{"name": "value", "type": "ByteBuffer"}, {"name": "id", "type": "long"}], "return_type": "void"}, "class_info": {"name": "ByteSequenceMap", "kind": "class", "modif... |
162913798_8 | class Plain implements Formatted {
@Override
public Text formatted() {
return this.glossary.definitions()
.sorted()
.map(Definition::text)
// @checkstyle BracketsStructure (3 lines)
.reduce((formatted, definition) -> new Joined(
new TextOf... | Assertions.assertThat(
new Plain(
new EmptyGlossary()
).formatted()
).isEqualTo(
new TextOf("No definitions found.")
);
}
} | [FOCAL] @Override public Text Plain.formatted()
[CLASS] class Plain implements Formatted
[METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] this.glossary.definitions() .sorted() .map(Definition::te....orElse/1, this.glossary.definitions() .sorted() .map(Definition::text).reduce/1, th... | /* static context
[FOCAL] @Override public Text Plain.formatted()
[COLLABORATORS] field glossary definitions/0
[FIELDS] read=glossary
[NEW] Joined, TextOf
[CALLS-EXTERNAL] this.glossary.definitions() .sorted() .map(Definition::te....orElse/1, this.glossary.definitions() .sorted() .map(Definition::text).reduce/1, this.g... | /* static context
[FOCAL] @Override public Text Plain.formatted()
[COLLABORATORS] field glossary definitions/0
[FIELDS] read=glossary
[NEW] Joined, TextOf
[CALLS-EXTERNAL] this.glossary.definitions() .sorted() .map(Definition::te....orElse/1, this.glossary.definitions() .sorted() .map(Definition::text).reduce/1, this.g... | true | ok | {"focal": {"class": "Plain", "name": "formatted", "signature": "Text formatted()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Text"}, "class_info": {"name": "Plain", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Formatted", "fields": [], "members": [{"name": "... |
162933940_1 | class MathUtils {
public static double average(double[] nums) {
if(nums.length == 0) {
return 0;
}
double sum = 0;
for(int i = 0; i < nums.length; i++) {
sum += nums[i];
}
return sum/nums.length;
}
private MathUtils();
public st... | assertEquals(6, MathUtils.average(6.0), 0.0001);
assertEquals(6, MathUtils.average(5.0, 7.0), 0.0001);
assertEquals(-6.0, MathUtils.average(-6.0), 0.0001);
assertEquals(-6, MathUtils.average(-5.0, -7.0), 0.0001);
assertEquals(0, MathUtils.average(0.0), 0.0001);
assertEqua... | [FOCAL] public static double MathUtils.average(double[] nums)
[CLASS] class MathUtils
[METRICS] loc=10 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=1
[PATH1] if(nums.length == 0)=F -> for(i < nums.length)=T -> exit loop -> return sum/nums.length
[PATH2] if(nums.length == 0)=T -> return 0
[PATH3] if(nums.length ==... | /* static context
[FOCAL] public static double MathUtils.average(double[] nums)
[PATH1] if(nums.length == 0)=F -> for(i < nums.length)=T -> exit loop -> return sum/nums.length
[PATH2] if(nums.length == 0)=T -> return 0
[PATH3] if(nums.length == 0)=F -> for(i < nums.length)=F -> return sum/nums.length
[INPUTS] branches=... | /* static context
[FOCAL] public static double MathUtils.average(double[] nums)
[PATH1] if(nums.length == 0)=F -> for(i < nums.length)=T -> exit loop -> return sum/nums.length
[PATH2] if(nums.length == 0)=T -> return 0
[PATH3] if(nums.length == 0)=F -> for(i < nums.length)=F -> return sum/nums.length
[INPUTS] branches=... | true | ok | {"focal": {"class": "MathUtils", "name": "average", "signature": "double average(double[] nums)", "start_line": 3, "modifiers": "public static", "params": [{"name": "nums", "type": "double[]"}], "return_type": "double"}, "class_info": {"name": "MathUtils", "kind": "class", "modifiers": "", "superclass": null, "interfac... |
163078506_3 | class Functions {
public static HKDFKeys hkdf_expand(
BytesValue srcNodeId,
BytesValue destNodeId,
BytesValue srcPrivKey,
BytesValue destPubKey,
BytesValue idNonce) {
BytesValue keyAgreement = deriveECDHKeyAgreement(srcPrivKey, destPubKey);
return hkdf_expand(srcNodeId, destNode... | BytesValue idNonce =
Bytes32.fromHexString("68b02a985ecb99cc2d10cf188879d93ae7684c4f4707770017b078c6497c5a5d");
Functions.HKDFKeys keys1 =
Functions.hkdf_expand(
nodeId1,
nodeId2,
testKey1,
BytesValue.wrap(ECKeyPair.create(testKey2.extractArray()).... | [FOCAL] public static HKDFKeys Functions.hkdf_expand(BytesValue srcNodeId, BytesValue destNodeId, BytesValue srcPrivKey, BytesValue destPubKey, BytesValue idNonce)
[CLASS] class Functions
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] BytesValue deriveECDHKeyAgreement(BytesValue s... | /* static context
[FOCAL] public static HKDFKeys Functions.hkdf_expand(BytesValue srcNodeId, BytesValue destNodeId, BytesValue srcPrivKey, BytesValue destPubKey, BytesValue idNonce)
[INPUTS] branches=- | result=destNodeId, destPubKey, idNonce, srcNodeId, srcPrivKey
[CALLS-INTERNAL] BytesValue deriveECDHKeyAgreement(Byt... | /* static context
[FOCAL] public static HKDFKeys Functions.hkdf_expand(BytesValue srcNodeId, BytesValue destNodeId, BytesValue srcPrivKey, BytesValue destPubKey, BytesValue idNonce)
[INPUTS] branches=- | result=destNodeId, destPubKey, idNonce, srcNodeId, srcPrivKey
[CALLS-INTERNAL] BytesValue deriveECDHKeyAgreement(Byt... | true | ok | {"focal": {"class": "Functions", "name": "hkdf_expand", "signature": "HKDFKeys hkdf_expand(BytesValue srcNodeId, BytesValue destNodeId, BytesValue srcPrivKey, BytesValue destPubKey, BytesValue idNonce)", "start_line": 3, "modifiers": "public static", "params": [{"name": "srcNodeId", "type": "BytesValue"}, {"name": "des... |
163079637_162 | class DateUtil extends AbstractCaller {
@Description("Returns the current date/time in the UTC time zone modified according to a pattern after applying time zone offset (DST aware).<br/>"
+ "If modified date time is on weekend and <code>skipWeekends</code> is <code>true</code> then the next working day... | for (int hoursDiff = -1; hoursDiff <= 1; hoursDiff += 1) {
for (int minutsDiff = -10; minutsDiff <= 10; minutsDiff += 10) {
long defaultOffsetSeconds = TimeUnit.HOURS.toSeconds(3);
long offsetSeconds = defaultOffsetSeconds + TimeUnit.HOURS.toSeconds(hoursDiff) + Tim... | [FOCAL] @Description("Returns the current date/time in the UTC time zone modified according to a pattern after applying time ... LocalDateTime DateUtil.getDateTimeByZoneId(String modifyPattern, boolean skipWeekends, String timeZoneId)
[CLASS] class DateUtil extends AbstractCaller
[METRICS] loc=12 cc=1 branches=0 loops=... | class DateUtil extends AbstractCaller {
@Description("Returns the current date/time in the UTC time zone modified according to a pattern after applying time zone offset (DST aware).<br/>"
+ "If modified date time is on weekend and <code>skipWeekends</code> is <code>true</code> then the next working day... | false | ok | {"focal": {"class": "DateUtil", "name": "getDateTimeByZoneId", "signature": "LocalDateTime getDateTimeByZoneId(String modifyPattern, boolean skipWeekends, String timeZoneId)", "start_line": 3, "modifiers": "@Description(\"Returns the current date/time in the UTC time zone modified according to a pattern after applying ... | |
163147839_94 | class ConfigurationStore implements Serializable {
public short getShort(String key, short defaultValue, String description,
ItemConstraint constraint)
throws NumberFormatException {
Objects.requireNonNull(key, "key is null");
ConfigurationItem configItem = configurationItems.ge... | short value = 2;
short result = store.getShort("testKeyshort", value);
assertEquals(result, value);
}
} | [FOCAL] public short ConfigurationStore.getShort(String key, short defaultValue, String description, ItemConstraint constraint)
[CLASS] class ConfigurationStore implements Serializable
[METRICS] loc=13 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] void setInt(String key, int value, String descri... | /* static context
[FOCAL] public short ConfigurationStore.getShort(String key, short defaultValue, String description, ItemConstraint constraint)
[PATH1] if(configItem == null)=T -> return defaultValue
[PATH2] if(configItem == null)=F -> return Short.parseShort(configItem.getValue())
[INPUTS] branches=key, configuratio... | /* static context
[FOCAL] public short ConfigurationStore.getShort(String key, short defaultValue, String description, ItemConstraint constraint)
[PATH1] if(configItem == null)=T -> return defaultValue
[PATH2] if(configItem == null)=F -> return Short.parseShort(configItem.getValue())
[INPUTS] branches=key, configuratio... | true | ok | {"focal": {"class": "ConfigurationStore", "name": "getShort", "signature": "short getShort(String key, short defaultValue, String description, ItemConstraint constraint) throws NumberFormatException", "start_line": 3, "modifiers": "public", "params": [{"name": "key", "type": "String"}, {"name": "defaultValue", "type": ... |
163179422_1 | class Identifiers {
public static Identifier withPath(Identifier base, String path) {
return transformer(base).path(path).apply();
}
private Identifiers();
public static Identifier withNamespace(Identifier base, String namespace);
public static Identifier prefixPath(Identifier base, String prefix);
public s... | Identifier base = new Identifier("foo:baz/qux");
assertEquals(new Identifier("foo:bar"), Identifiers.withPath(base, "bar"));
assertEquals(new Identifier("foo:bar/baz"), Identifiers.withPath(base, "bar/baz"),
"Multilevel path test failed");
}
} | [FOCAL] public static Identifier Identifiers.withPath(Identifier base, String path)
[CLASS] class Identifiers
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] IdentifierTransformer transformer(Identifier base)
[CALLS-EXTERNAL] transformer(base).path(path).apply/0, transformer(base).... | /* static context
[FOCAL] public static Identifier Identifiers.withPath(Identifier base, String path)
[INPUTS] branches=- | result=base, path
[CALLS-INTERNAL] IdentifierTransformer transformer(Identifier base)
[CALLS-EXTERNAL] transformer(base).path(path).apply/0, transformer(base).path/1
*/
| /* static context
[FOCAL] public static Identifier Identifiers.withPath(Identifier base, String path)
[INPUTS] branches=- | result=base, path
[CALLS-INTERNAL] IdentifierTransformer transformer(Identifier base)
[CALLS-EXTERNAL] transformer(base).path(path).apply/0, transformer(base).path/1
*/
class Identifiers {
publi... | true | ok | {"focal": {"class": "Identifiers", "name": "withPath", "signature": "Identifier withPath(Identifier base, String path)", "start_line": 3, "modifiers": "public static", "params": [{"name": "base", "type": "Identifier"}, {"name": "path", "type": "String"}], "return_type": "Identifier"}, "class_info": {"name": "Identifier... |
163244687_111 | class MixAll {
public static boolean compareAndIncreaseOnly(final AtomicLong target, final long value) {
long prev = target.get();
while (value > prev) {
boolean updated = target.compareAndSet(prev, value);
if (updated)
return true;
prev = target... | AtomicLong target = new AtomicLong(5);
assertThat(MixAll.compareAndIncreaseOnly(target, 6)).isTrue();
assertThat(target.get()).isEqualTo(6);
assertThat(MixAll.compareAndIncreaseOnly(target, 4)).isFalse();
assertThat(target.get()).isEqualTo(6);
}
} | [FOCAL] public static boolean MixAll.compareAndIncreaseOnly(AtomicLong target, long value)
[CLASS] class MixAll
[METRICS] loc=12 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] AtomicLong.get/0, AtomicLong.compareAndSet/2
[PATH1] while(value > prev)=T -> if(updated)=F -> exit loop -> return false
... | /* static context
[FOCAL] public static boolean MixAll.compareAndIncreaseOnly(AtomicLong target, long value)
[PATH1] while(value > prev)=T -> if(updated)=F -> exit loop -> return false
[PATH2] while(value > prev)=T -> if(updated)=T -> return true
[PATH3] while(value > prev)=F -> return false
[INPUTS] branches=target, v... | /* static context
[FOCAL] public static boolean MixAll.compareAndIncreaseOnly(AtomicLong target, long value)
[PATH1] while(value > prev)=T -> if(updated)=F -> exit loop -> return false
[PATH2] while(value > prev)=T -> if(updated)=T -> return true
[PATH3] while(value > prev)=F -> return false
[INPUTS] branches=target, v... | true | ok | {"focal": {"class": "MixAll", "name": "compareAndIncreaseOnly", "signature": "boolean compareAndIncreaseOnly(AtomicLong target, long value)", "start_line": 3, "modifiers": "public static", "params": [{"name": "target", "type": "AtomicLong"}, {"name": "value", "type": "long"}], "return_type": "boolean"}, "class_info": {... |
163387337_170 | class PreparedStatementProxy extends AbstractPreparedStatementProxy implements PreparedStatement, ParametersHolder {
@Override
public Map<Integer,ArrayList<Object>> getParameters() {
return parameters;
}
public PreparedStatementProxy(AbstractConnectionProxy connectionProxy, PreparedStatement ... | preparedStatementProxy.clearParameters();
preparedStatementProxy.setNull(1, JDBCType.DECIMAL.getVendorTypeNumber());
Assertions.assertEquals(Null.get(), preparedStatementProxy.getParamsByIndex(1).get(0));
preparedStatementProxy.clearParameters();
preparedStatementProxy.setNull(1... | [FOCAL] @Override public Map<Integer,ArrayList<Object>> PreparedStatementProxy.getParameters()
[CLASS] class PreparedStatementProxy extends AbstractPreparedStatementProxy implements PreparedStatement, ParametersHolder
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] PreparedStatement... | class PreparedStatementProxy extends AbstractPreparedStatementProxy implements PreparedStatement, ParametersHolder {
@Override
public Map<Integer,ArrayList<Object>> getParameters() {
return parameters;
}
public PreparedStatementProxy(AbstractConnectionProxy connectionProxy, PreparedStatement ... | false | ok | {"focal": {"class": "PreparedStatementProxy", "name": "getParameters", "signature": "Map<Integer,ArrayList<Object>> getParameters()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Map<Integer,ArrayList<Object>>"}, "class_info": {"name": "PreparedStatementProxy", "kind": "class", "modif... | |
163399836_3 | class HBaseClient {
public static HBaseClient getInstance() {
if (instance == null) {
synchronized (HBaseClient.class) {
if (instance == null) {
instance = new HBaseClient();
}
}
}
return instance;
}
privat... | HBaseClient client = HBaseClient.getInstance();
Assert.assertNotNull(client);
}
} | [FOCAL] public static HBaseClient HBaseClient.getInstance()
[CLASS] class HBaseClient
[METRICS] loc=10 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=3
[NEW] HBaseClient
[PATH1] if(instance == null)#1=T -> if(instance == null)#2=T -> return instance
[PATH2] if(instance == null)#1=F -> return instance
[PATH3] if(ins... | /* static context
[FOCAL] public static HBaseClient HBaseClient.getInstance()
[PATH1] if(instance == null)#1=T -> if(instance == null)#2=T -> return instance
[PATH2] if(instance == null)#1=F -> return instance
[PATH3] if(instance == null)#1=T -> if(instance == null)#2=F -> return instance
[NEW] HBaseClient
*/
| /* static context
[FOCAL] public static HBaseClient HBaseClient.getInstance()
[PATH1] if(instance == null)#1=T -> if(instance == null)#2=T -> return instance
[PATH2] if(instance == null)#1=F -> return instance
[PATH3] if(instance == null)#1=T -> if(instance == null)#2=F -> return instance
[NEW] HBaseClient
*/
class HBa... | true | ok | {"focal": {"class": "HBaseClient", "name": "getInstance", "signature": "HBaseClient getInstance()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "HBaseClient"}, "class_info": {"name": "HBaseClient", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "m... |
163474295_49 | class ApiArticleController {
@ApiOperation(value = "根据标签id查询文章", notes = "根据标签id查询文章")
@GetMapping("/tag/{tagId}")
public JsonData<Page<ArticleDto>> findArticleByTagId(@PathVariable String tagId,
@PageableDefault(sort = "create_at", direction = DESC) Pageable pa... | when(articleService.findArticleByTagId(anyString(), any())).thenReturn(null);
JsonData<Page<ArticleDto>> result = apiArticleController.findArticleByTagId("tagId", null);
Assertions.assertEquals(new JsonData<Page<ArticleDto>>(true, 0, "message", any()), result);
}
} | [FOCAL] @ApiOperation(value = "根据标签id查询文章", notes = "根据标签id查询文章") @GetMapping("/tag/{tagId}") public JsonData<Page<ArticleDto>> ApiArticleController.findArticleByTagId(String tagId, Pageable pageable)
[CLASS] class ApiArticleController
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL... | /* static context
[FOCAL] @ApiOperation(value = "根据标签id查询文章", notes = "根据标签id查询文章") @GetMapping("/tag/{tagId}") public JsonData<Page<ArticleDto>> ApiArticleController.findArticleByTagId(String tagId, Pageable pageable)
[INPUTS] branches=- | result=pageable, tagId, articleService
[COLLABORATORS] field articleService:Api... | /* static context
[FOCAL] @ApiOperation(value = "根据标签id查询文章", notes = "根据标签id查询文章") @GetMapping("/tag/{tagId}") public JsonData<Page<ArticleDto>> ApiArticleController.findArticleByTagId(String tagId, Pageable pageable)
[INPUTS] branches=- | result=pageable, tagId, articleService
[COLLABORATORS] field articleService:Api... | true | ok | {"focal": {"class": "ApiArticleController", "name": "findArticleByTagId", "signature": "JsonData<Page<ArticleDto>> findArticleByTagId(String tagId, Pageable pageable)", "start_line": 3, "modifiers": "@ApiOperation(value = \"根据标签id查询文章\", notes = \"根据标签id查询文章\") @GetMapping(\"/tag/{tagId}\") public", "params": [{"name":... |
163514144_9 | class TypeUtils {
@Nullable
public static ArgType replaceClassGenerics(RootNode root, ArgType instanceType, ArgType typeWithGeneric) {
if (typeWithGeneric == null) {
return null;
}
if (instanceType.isGeneric()) {
List<GenericInfo> generics = root.getClassGenerics(instanceType);
if (generics.isEmpty())... | // check classpath graph
List<GenericInfo> classGenerics = root.getClassGenerics(ArgType.object("java.util.ArrayList"));
assertThat(classGenerics, hasSize(1));
GenericInfo genericInfo = classGenerics.get(0);
assertThat(genericInfo.getGenericType(), is(ArgType.genericType("E")));
assertThat(genericInfo.getEx... | [FOCAL] @Nullable public static ArgType TypeUtils.replaceClassGenerics(RootNode root, ArgType instanceType, ArgType typeWithGeneric)
[CLASS] class TypeUtils
[METRICS] loc=28 cc=7 branches=5 loops=1 returns=6 throws=0 nesting=2
[CALLS-INTERNAL] ArgType replaceGenericUsingTypeMap(ArgType replaceType, Map<ArgType, ArgType... | /* static context
[FOCAL] @Nullable public static ArgType TypeUtils.replaceClassGenerics(RootNode root, ArgType instanceType, ArgType typeWithGeneric)
[PATH1] if(typeWithGeneric == null)=F -> if(instanceType.isGeneric())=T -> if(generics.isEmpty())=F -> if(actualTypes == null)=F -> if(genericParamsCount != generics.siz... | /* static context
[FOCAL] @Nullable public static ArgType TypeUtils.replaceClassGenerics(RootNode root, ArgType instanceType, ArgType typeWithGeneric)
[PATH1] if(typeWithGeneric == null)=F -> if(instanceType.isGeneric())=T -> if(generics.isEmpty())=F -> if(actualTypes == null)=F -> if(genericParamsCount != generics.siz... | true | ok | {"focal": {"class": "TypeUtils", "name": "replaceClassGenerics", "signature": "ArgType replaceClassGenerics(RootNode root, ArgType instanceType, ArgType typeWithGeneric)", "start_line": 3, "modifiers": "@Nullable public static", "params": [{"name": "root", "type": "RootNode"}, {"name": "instanceType", "type": "ArgType"... |
163566292_1 | class DocumentRegistry {
@Nullable
public SwaggerV2Documentation get(String serviceName) {
return storage.get(serviceName);
}
public static DocumentRegistry getInstance();
public void put(String serviceName, SwaggerV2Documentation swaggerV2Documentation);
}
class DocumentRegistryTest {
... | SwaggerV2Documentation swaggerV2Documentation = Mockito.mock(SwaggerV2Documentation.class);
DocumentRegistry.getInstance().put("foo", swaggerV2Documentation);
assertEquals(swaggerV2Documentation, DocumentRegistry.getInstance().get("foo"));
}
} | [FOCAL] @Nullable public SwaggerV2Documentation DocumentRegistry.get(String serviceName)
[CLASS] class DocumentRegistry
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] storage.get/1
[INPUTS] branches=- | result=serviceName
[COLLABORATORS] field storage get/1
[DATAFLOW] serviceName@... | /* static context
[FOCAL] @Nullable public SwaggerV2Documentation DocumentRegistry.get(String serviceName)
[INPUTS] branches=- | result=serviceName
[COLLABORATORS] field storage get/1
[CALLS-EXTERNAL] storage.get/1
*/
| /* static context
[FOCAL] @Nullable public SwaggerV2Documentation DocumentRegistry.get(String serviceName)
[INPUTS] branches=- | result=serviceName
[COLLABORATORS] field storage get/1
[CALLS-EXTERNAL] storage.get/1
*/
class DocumentRegistry {
@Nullable
public SwaggerV2Documentation get(String serviceName) {
... | true | ok | {"focal": {"class": "DocumentRegistry", "name": "get", "signature": "SwaggerV2Documentation get(String serviceName)", "start_line": 3, "modifiers": "@Nullable public", "params": [{"name": "serviceName", "type": "String"}], "return_type": "SwaggerV2Documentation"}, "class_info": {"name": "DocumentRegistry", "kind": "cla... |
163648692_206 | class AccessRightService {
@PreAuthorize("hasAuthority('VIEW_CLIENT_ACL_SUBJECTS')")
public List<AccessRightHolderDto> findAccessRightHolders(ClientId clientId, String memberNameOrGroupDescription,
XRoadObjectType subjectType, String instance, String memberClass, String memberGroupCode,
... | public void findAccessRightHoldersByInstance() throws Throwable {
List<AccessRightHolderDto> dtos = accessRightService.findAccessRightHolders(TestUtils.getM1Ss1ClientId(), null,
null, TestUtils.INSTANCE_EE, null, null, null);
assertEquals(4, dtos.size());
}
} | [FOCAL] @PreAuthorize("hasAuthority('VIEW_CLIENT_ACL_SUBJECTS')") public List<AccessRightHolderDto> AccessRightService.findAccessRightHolders(ClientId clientId, String memberNameOrGroupDescription, XRoadObjectType subjectType, String instance, String memberClass, String memberGroupCode, String subsystemCode)
[CLASS] cl... | /* static context
[FOCAL] @PreAuthorize("hasAuthority('VIEW_CLIENT_ACL_SUBJECTS')") public List<AccessRightHolderDto> AccessRightService.findAccessRightHolders(ClientId clientId, String memberNameOrGroupDescription, XRoadObjectType subjectType, String instance, String memberClass, String memberGroupCode, String subsyst... | /* static context
[FOCAL] @PreAuthorize("hasAuthority('VIEW_CLIENT_ACL_SUBJECTS')") public List<AccessRightHolderDto> AccessRightService.findAccessRightHolders(ClientId clientId, String memberNameOrGroupDescription, XRoadObjectType subjectType, String instance, String memberClass, String memberGroupCode, String subsyst... | true | ok | {"focal": {"class": "AccessRightService", "name": "findAccessRightHolders", "signature": "List<AccessRightHolderDto> findAccessRightHolders(ClientId clientId, String memberNameOrGroupDescription, XRoadObjectType subjectType, String instance, String memberClass, String memberGroupCode, String subsystemCode) throws Clien... |
163652398_6 | class GenericGermanyKnxProjectCharacteristics extends KnxProjectCharacteristics {
@Override
public boolean isPrimarySwitch(GroupAddress ga) {
// pre-select based on super
boolean isPotentialPrimary = super.isPrimarySwitch(ga);
if (!isPotentialPrimary) {
LOG.debug("Not a primary switch GA due to DPT mismatch... | assertTrue(characteristics.isPrimarySwitch(gaWithName("Licht Küche Ein/Aus")));
assertFalse(characteristics.isPrimarySwitch(gaWithName("Licht Küche Status Ein/Aus")));
assertFalse(characteristics.isPrimarySwitch(gaWithName("Rückmeldungen Schalten Licht")));
}
} | [FOCAL] @Override public boolean GenericGermanyKnxProjectCharacteristics.isPrimarySwitch(GroupAddress ga)
[CLASS] class GenericGermanyKnxProjectCharacteristics extends KnxProjectCharacteristics
[METRICS] loc=18 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[CALLS-INTERNAL] boolean containsStatusTerm(Set<String> ... | /* static context
[FOCAL] @Override public boolean GenericGermanyKnxProjectCharacteristics.isPrimarySwitch(GroupAddress ga)
[PATH1] if(!isPotentialPrimary)=F -> if(doc == null)=T -> return false
[PATH2] if(!isPotentialPrimary)=F -> if(doc == null)=F -> return !containsStatusTerm(doc.nameTerms)
[PATH3] if(!isPotentialPr... | /* static context
[FOCAL] @Override public boolean GenericGermanyKnxProjectCharacteristics.isPrimarySwitch(GroupAddress ga)
[PATH1] if(!isPotentialPrimary)=F -> if(doc == null)=T -> return false
[PATH2] if(!isPotentialPrimary)=F -> if(doc == null)=F -> return !containsStatusTerm(doc.nameTerms)
[PATH3] if(!isPotentialPr... | true | ok | {"focal": {"class": "GenericGermanyKnxProjectCharacteristics", "name": "isPrimarySwitch", "signature": "boolean isPrimarySwitch(GroupAddress ga)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "ga", "type": "GroupAddress"}], "return_type": "boolean"}, "class_info": {"name": "GenericGermanyKnxPro... |
163711177_0 | class StringUtil {
public static String format(String format, Object... arguments) {
return MessageFormatter.arrayFormat(format, arguments).getMessage();
}
public static String randomString(int length);
}
class StringUtilTest {
@Test
public void format() {
| String a = "A";
String placeholder = "{}";
String b = "B";
String c = "C";
assertEquals(a + b + c, StringUtil.format(a + placeholder + c, b));
}
} | [FOCAL] public static String StringUtil.format(String format, Object... arguments)
[CLASS] class StringUtil
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] MessageFormatter.arrayFormat(format, arguments).getMessage/0, MessageFormatter.arrayFormat/2
[INPUTS] branches=- | result=argu... | /* static context
[FOCAL] public static String StringUtil.format(String format, Object... arguments)
[INPUTS] branches=- | result=arguments, format
[CALLS-EXTERNAL] MessageFormatter.arrayFormat(format, arguments).getMessage/0, MessageFormatter.arrayFormat/2
*/
| /* static context
[FOCAL] public static String StringUtil.format(String format, Object... arguments)
[INPUTS] branches=- | result=arguments, format
[CALLS-EXTERNAL] MessageFormatter.arrayFormat(format, arguments).getMessage/0, MessageFormatter.arrayFormat/2
*/
class StringUtil {
public static String format(String for... | true | ok | {"focal": {"class": "StringUtil", "name": "format", "signature": "String format(String format, Object... arguments)", "start_line": 3, "modifiers": "public static", "params": [{"name": "format", "type": "String"}, {"name": "arguments", "type": "Object..."}], "return_type": "String"}, "class_info": {"name": "StringUtil"... |
163795687_31 | class RedisStorage implements IStorage {
@Override
public long getSequenceNumber() throws Exception {
return redisService.increaseAndGet(key("/sequence"), 1);
}
private Closeable lockStrategyRuntime(String strategyName);
private Closeable lockFactory();
private Closeable lockTask(Strin... | long s0 = this.storage.getSequenceNumber();
long s1 = this.storage.getSequenceNumber();
assertTrue(s0 < s1);
}
} | [FOCAL] @Override public long RedisStorage.getSequenceNumber()
[CLASS] class RedisStorage implements IStorage
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String key(String key)
[CALLS-EXTERNAL] redisService.increaseAndGet/2
[EXCEPTIONS] declares Exception
[COLLABORATORS] field ... | /* static context
[FOCAL] @Override public long RedisStorage.getSequenceNumber()
[COLLABORATORS] field redisService increaseAndGet/2
[EXCEPTIONS] declares Exception
[CALLS-INTERNAL] String key(String key)
[CALLS-EXTERNAL] redisService.increaseAndGet/2
*/
| /* static context
[FOCAL] @Override public long RedisStorage.getSequenceNumber()
[COLLABORATORS] field redisService increaseAndGet/2
[EXCEPTIONS] declares Exception
[CALLS-INTERNAL] String key(String key)
[CALLS-EXTERNAL] redisService.increaseAndGet/2
*/
class RedisStorage implements IStorage {
@Override
publi... | true | ok | {"focal": {"class": "RedisStorage", "name": "getSequenceNumber", "signature": "long getSequenceNumber() throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "long"}, "class_info": {"name": "RedisStorage", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "I... |
163808152_100 | class RouterFilter implements Filter {
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
HttpServletRequest httpServletRequest = (HttpServletRequest) request;
// 如果是 fetch 请求,则不做任何处理
if(RequestUtil.isFetch(httpServletR... | RouterFilter routerFilter = new RouterFilter();
MockHttpServletRequest request = new MockHttpServletRequest("GET", "/src/a.js");
request.setServletPath("/src/a.js");
MockHttpServletResponse response = new MockHttpServletResponse();
MockFilterChain chain = new MockFilterChain() {
@Override
public voi... | [FOCAL] @Override public void RouterFilter.doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
[CLASS] class RouterFilter implements Filter
[METRICS] loc=102 cc=12 branches=11 loops=0 returns=8 throws=0 nesting=3
[CALLS-INTERNAL] boolean isStaticResource(String filenameExtension); boolean need... | /* static context
[FOCAL] @Override public void RouterFilter.doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
[PATH3] if(RequestUtil.isFetch(httpServletRequest))=T -> return
[INPUTS] branches=request | result=-
[EXCEPTIONS] declares IOException, ServletException
*/
| /* static context
[FOCAL] @Override public void RouterFilter.doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
[PATH3] if(RequestUtil.isFetch(httpServletRequest))=T -> return
[INPUTS] branches=request | result=-
[EXCEPTIONS] declares IOException, ServletException
*/
class RouterFilter implem... | true | ok | {"focal": {"class": "RouterFilter", "name": "doFilter", "signature": "void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "ServletRequest"}, {"name": "response",... |
163840922_7 | class TabDelimitedCertificateFilter extends QwacCertificateFilter {
@Override
public String getEncodedTppQwacCert(HttpServletRequest httpRequest) {
if (httpRequest.getHeader(HEADER_NAME) == null) {
return null;
}
String certificateWithTabs = httpRequest.getHeader(HEADER_NAME);
return certifi... | HttpServletRequest mock = Mockito.mock(HttpServletRequest.class);
Mockito.when(mock.getHeader(Mockito.anyString())).thenReturn("string\twith\ttabs");
String stringWithoutTabs = tabDelimitedCertificateFilter.getEncodedTppQwacCert(mock);
assertEquals("stringwithtabs", stringWithoutTabs);
}
} | [FOCAL] @Override public String TabDelimitedCertificateFilter.getEncodedTppQwacCert(HttpServletRequest httpRequest)
[CLASS] class TabDelimitedCertificateFilter extends QwacCertificateFilter
[METRICS] loc=9 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] HttpServletRequest.getHeader/1, String.repla... | /* static context
[FOCAL] @Override public String TabDelimitedCertificateFilter.getEncodedTppQwacCert(HttpServletRequest httpRequest)
[PATH1] if(httpRequest.getHeader(HEADER_NAME) == null)=T -> return null
[PATH2] if(httpRequest.getHeader(HEADER_NAME) == null)=F -> return certificateWithTabs.replaceAll("\t", "")
[INPUT... | /* static context
[FOCAL] @Override public String TabDelimitedCertificateFilter.getEncodedTppQwacCert(HttpServletRequest httpRequest)
[PATH1] if(httpRequest.getHeader(HEADER_NAME) == null)=T -> return null
[PATH2] if(httpRequest.getHeader(HEADER_NAME) == null)=F -> return certificateWithTabs.replaceAll("\t", "")
[INPUT... | true | ok | {"focal": {"class": "TabDelimitedCertificateFilter", "name": "getEncodedTppQwacCert", "signature": "String getEncodedTppQwacCert(HttpServletRequest httpRequest)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "httpRequest", "type": "HttpServletRequest"}], "return_type": "String"}, "class_info": ... |
164034455_1 | class RandomUtils {
public static boolean getTrueWithProbability(double probability) {
probability *= 100;
int randomProbability = ThreadLocalRandom.current().nextInt(0, 100);
return probability > randomProbability;
}
public static void waitRandom(long minSeconds, long maxSeconds);
public static v... |
//given
double probability = 1.0;
//when
boolean output = RandomUtils.getTrueWithProbability(probability);
//then
assertTrue(output);
}
} | [FOCAL] public static boolean RandomUtils.getTrueWithProbability(double probability)
[CLASS] class RandomUtils
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] ThreadLocalRandom.current().nextInt/2, ThreadLocalRandom.current/0
[INPUTS] branches=- | result=probability
[DATAFLOW] prob... | /* static context
[FOCAL] public static boolean RandomUtils.getTrueWithProbability(double probability)
[INPUTS] branches=- | result=probability
[CALLS-EXTERNAL] ThreadLocalRandom.current().nextInt/2, ThreadLocalRandom.current/0
*/
| /* static context
[FOCAL] public static boolean RandomUtils.getTrueWithProbability(double probability)
[INPUTS] branches=- | result=probability
[CALLS-EXTERNAL] ThreadLocalRandom.current().nextInt/2, ThreadLocalRandom.current/0
*/
class RandomUtils {
public static boolean getTrueWithProbability(double probability) {... | true | ok | {"focal": {"class": "RandomUtils", "name": "getTrueWithProbability", "signature": "boolean getTrueWithProbability(double probability)", "start_line": 3, "modifiers": "public static", "params": [{"name": "probability", "type": "double"}], "return_type": "boolean"}, "class_info": {"name": "RandomUtils", "kind": "class", ... |
164079951_0 | class DepartmentController {
@GetMapping("/departments")
public List<Department> departments() {
return this.departmentDao.findAll();
}
public DepartmentController(DSLContext dsl, Configuration jooqConfiguration);
@GetMapping("/department/{no}") public Department findDepartment(@PathVariable("no") Str... | var typeRef = new ParameterizedTypeReference<List<Department>>() {
// nothing_here
};
var response = this.restTemplate.exchange("/departments", HttpMethod.GET, null,
typeRef);
List<Department> departments = response.getBody();
assertThat(departments.get(0).getId()).isEqualTo(1);
... | [FOCAL] @GetMapping("/departments") public List<Department> DepartmentController.departments()
[CLASS] class DepartmentController
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] this.departmentDao.findAll/0
[FIELDS] read=departmentDao
[COLLABORATORS] field departmentDao findAll/0
[... | /* static context
[FOCAL] @GetMapping("/departments") public List<Department> DepartmentController.departments()
[COLLABORATORS] field departmentDao findAll/0
[FIELDS] read=departmentDao
[CALLS-EXTERNAL] this.departmentDao.findAll/0
*/
| /* static context
[FOCAL] @GetMapping("/departments") public List<Department> DepartmentController.departments()
[COLLABORATORS] field departmentDao findAll/0
[FIELDS] read=departmentDao
[CALLS-EXTERNAL] this.departmentDao.findAll/0
*/
class DepartmentController {
@GetMapping("/departments")
public List<Department... | true | ok | {"focal": {"class": "DepartmentController", "name": "departments", "signature": "List<Department> departments()", "start_line": 3, "modifiers": "@GetMapping(\"/departments\") public", "params": [], "return_type": "List<Department>"}, "class_info": {"name": "DepartmentController", "kind": "class", "modifiers": "", "supe... |
164098851_3 | class TodoController {
@ApiOperation(value = "Retrieve all todos for a user by passing in his name", notes = "A list of matching todos is returned. Currently pagination is not supported.", response = Todo.class, responseContainer = "List", produces = "application/json")
@GetMapping("/users/{name}/todos")
public Lis... | List<Todo> mockList = Arrays.asList(new Todo(1, "Jack", "Learn Spring MVC", new Date(), false),
new Todo(2, "Jack", "Learn Struts", new Date(), false));
when(service.retrieveTodos(anyString())).thenReturn(mockList);
MvcResult result = mvc
.perform(MockMvcRequestBuilders.get("/users/Jack/todos").accept(Med... | [FOCAL] @ApiOperation(value = "Retrieve all todos for a user by passing in his name", notes = "A list of matching todos is re... List<Todo> TodoController.retrieveTodos(String name)
[CLASS] class TodoController
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] todoService.retrieveTod... | /* static context
[FOCAL] @ApiOperation(value = "Retrieve all todos for a user by passing in his name", notes = "A list of matching todos is re... List<Todo> TodoController.retrieveTodos(String name)
[INPUTS] branches=- | result=name
[COLLABORATORS] field todoService retrieveTodos/1
[CALLS-EXTERNAL] todoService.retriev... | /* static context
[FOCAL] @ApiOperation(value = "Retrieve all todos for a user by passing in his name", notes = "A list of matching todos is re... List<Todo> TodoController.retrieveTodos(String name)
[INPUTS] branches=- | result=name
[COLLABORATORS] field todoService retrieveTodos/1
[CALLS-EXTERNAL] todoService.retriev... | true | ok | {"focal": {"class": "TodoController", "name": "retrieveTodos", "signature": "List<Todo> retrieveTodos(String name)", "start_line": 3, "modifiers": "@ApiOperation(value = \"Retrieve all todos for a user by passing in his name\", notes = \"A list of matching todos is re...", "params": [{"name": "name", "type": "String"}]... |
164113249_6 | class AuthorizationFilter extends OncePerRequestFilter {
@Override
protected void doFilterInternal(HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse,
FilterChain filterChain
) throws ServletException, IOExc... | when(request.getHeader(HEADER_NAME))
.thenReturn(null);
filter.doFilterInternal(request, response, filterChain);
verify(claims, times(0)).getSubject();
}
} | [FOCAL] @Override protected void AuthorizationFilter.doFilterInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, FilterChain filterChain)
[CLASS] class AuthorizationFilter extends OncePerRequestFilter
[METRICS] loc=21 cc=3 branches=1 loops=0 returns=0 throws=0 nesting=2
[CALLS-INTER... | /* static context
[FOCAL] @Override protected void AuthorizationFilter.doFilterInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, FilterChain filterChain)
[PATH1] if(headerIsValid(header))=T -> try-body throws
[PATH2] if(headerIsValid(header))=F
[INPUTS] branches=httpServletRequest... | /* static context
[FOCAL] @Override protected void AuthorizationFilter.doFilterInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, FilterChain filterChain)
[PATH1] if(headerIsValid(header))=T -> try-body throws
[PATH2] if(headerIsValid(header))=F
[INPUTS] branches=httpServletRequest... | true | ok | {"focal": {"class": "AuthorizationFilter", "name": "doFilterInternal", "signature": "void doFilterInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, FilterChain filterChain) throws ServletException, IOException", "start_line": 3, "modifiers": "@Override protected", "params": [{"nam... |
164181730_0 | class FileProvider implements IPassive, ISeekableProvider, IPullableProvider, IPipeConnectionListener, IStreamTypeAwareProvider {
public IMessage pullMessage(IPipe pipe) throws IOException {
// there is no need for sync here, the readers use semaphore locks
if (this.pipe == pipe) {
if (... | // get dummy scope
WebScope scope = (WebScope) applicationContext.getBean("web.scope");
// test file fixture
File file = new File("target/test-classes/fixtures/test.flv");
// new file provider instance
FileProvider provider = new FileProvider(scope, file);
// data... | [FOCAL] public IMessage FileProvider.pullMessage(IPipe pipe)
[CLASS] class FileProvider implements IPassive, ISeekableProvider, IPullableProvider, IPipeConnectionListener, IStreamTypeAwareProvider
[METRICS] loc=45 cc=10 branches=5 loops=0 returns=2 throws=0 nesting=4
[CALLS-INTERNAL] void init()
[CALLS-EXTERNAL] reader... | /* static context
[FOCAL] public IMessage FileProvider.pullMessage(IPipe pipe)
[PATH1] if(this.pipe == pipe)=T -> if(reader == null)=T -> if(reader.hasMoreTags())=T -> if(tag != null)=T -> switch(tag.getDataType())=case Constants.TYPE_AUDIO_DATA -> return rtmpMsg
[PATH2] if(this.pipe == pipe)=T -> if(reader == null)=F ... | /* static context
[FOCAL] public IMessage FileProvider.pullMessage(IPipe pipe)
[PATH1] if(this.pipe == pipe)=T -> if(reader == null)=T -> if(reader.hasMoreTags())=T -> if(tag != null)=T -> switch(tag.getDataType())=case Constants.TYPE_AUDIO_DATA -> return rtmpMsg
[PATH2] if(this.pipe == pipe)=T -> if(reader == null)=F ... | true | ok | {"focal": {"class": "FileProvider", "name": "pullMessage", "signature": "IMessage pullMessage(IPipe pipe) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "pipe", "type": "IPipe"}], "return_type": "IMessage"}, "class_info": {"name": "FileProvider", "kind": "class", "modifiers": "", "supe... |
164305542_22 | class ProtoToAvroSchema {
public static String convert(ProtoDomain pd, String messageName)
throws IOException, StatusRuntimeException {
Descriptors.Descriptor descriptor = pd.getDescriptorByName(messageName);
if (descriptor == null) {
throw Status.fromCode(Status.Code.NOT_FOUND)
.withDe... | String node = getJsonNode("testComplexExtEnum");
final DescriptorProtos.FileDescriptorProto fileDescriptorProto =
TestComplexExtEnum.getDescriptor().getFile().toProto();
ProtoDomain protoDomain = ProtoDomain.builder().add(fileDescriptorProto).build();
String avroSchema =
ProtoToAvroSch... | [FOCAL] public static String ProtoToAvroSchema.convert(ProtoDomain pd, String messageName)
[CLASS] class ProtoToAvroSchema
[METRICS] loc=16 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] ProtoDomain.getDescriptorByName/1, Status.fromCode(Status.Code.NOT_FOUND) .withDescription(S....asRuntimeExcep... | /* static context
[FOCAL] public static String ProtoToAvroSchema.convert(ProtoDomain pd, String messageName)
[THROWS-WHEN] Status.fromCode(Status.Code.NOT_FOUND) .withDescription(String.form... when descriptor == null
[PATH1] if(descriptor == null)=T -> throw Status.fromCode(Status.Code.NOT_FOUND) .withDescription(Stri... | /* static context
[FOCAL] public static String ProtoToAvroSchema.convert(ProtoDomain pd, String messageName)
[THROWS-WHEN] Status.fromCode(Status.Code.NOT_FOUND) .withDescription(String.form... when descriptor == null
[PATH1] if(descriptor == null)=T -> throw Status.fromCode(Status.Code.NOT_FOUND) .withDescription(Stri... | true | ok | {"focal": {"class": "ProtoToAvroSchema", "name": "convert", "signature": "String convert(ProtoDomain pd, String messageName) throws IOException, StatusRuntimeException", "start_line": 3, "modifiers": "public static", "params": [{"name": "pd", "type": "ProtoDomain"}, {"name": "messageName", "type": "String"}], "return_t... |
164497122_3 | class RelationBuilder extends GeometryBuilder<Relation> {
public Geometry build(Relation entity) {
// Check whether the relation is a multipolygon
Map<String, String> tags = entity.getTags();
if (!"multipolygon".equals(tags.get("type"))) {
return null;
}
// Collect the members of the relat... | assertNull(RELATION_BUILDER.build(RELATION_0));
assertNull(RELATION_BUILDER.build(RELATION_1));
assertTrue(RELATION_BUILDER.build(RELATION_2) instanceof Polygon);
assertTrue(RELATION_BUILDER.build(RELATION_3) instanceof MultiPolygon);
assertTrue(RELATION_BUILDER.build(RELATION_4) instanceof MultiPol... | [FOCAL] public Geometry RelationBuilder.build(Relation entity)
[CLASS] class RelationBuilder extends GeometryBuilder<Relation>
[METRICS] loc=45 cc=4 branches=2 loops=0 returns=4 throws=0 nesting=1
[CALLS-EXTERNAL] Relation.getTags/0, "multipolygon".equals/1, Map<String, String>.get/1, entity.getMembers() .stream() .map... | /* static context
[FOCAL] public Geometry RelationBuilder.build(Relation entity)
[PATH1] if(!"multipolygon".equals(tags.get("type")))=F -> if(members.isEmpty())=F -> try-body throws -> return null
[PATH2] if(!"multipolygon".equals(tags.get("type")))=T -> return null
[PATH3] if(!"multipolygon".equals(tags.get("type")))=... | /* static context
[FOCAL] public Geometry RelationBuilder.build(Relation entity)
[PATH1] if(!"multipolygon".equals(tags.get("type")))=F -> if(members.isEmpty())=F -> try-body throws -> return null
[PATH2] if(!"multipolygon".equals(tags.get("type")))=T -> return null
[PATH3] if(!"multipolygon".equals(tags.get("type")))=... | true | ok | {"focal": {"class": "RelationBuilder", "name": "build", "signature": "Geometry build(Relation entity)", "start_line": 3, "modifiers": "public", "params": [{"name": "entity", "type": "Relation"}], "return_type": "Geometry"}, "class_info": {"name": "RelationBuilder", "kind": "class", "modifiers": "", "superclass": "Geome... |
164546163_13 | class ScanReadResult extends AbstractReadResult<T> {
@Override
protected Spliterator<T> spliterator() {
if (iterationStarted) {
throw new IllegalStateException("ScanReadResult can only be iterated once.");
}
iterationStarted = true;
return new ScanReadResultSpliterat... | Spliterator<Item> spliterator = build(initialRequest(), result(null)).spliterator().trySplit();
assertThat(spliterator).isNull();
}
} | [FOCAL] @Override protected Spliterator<T> ScanReadResult.spliterator()
[CLASS] class ScanReadResult extends AbstractReadResult<T>
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[NEW] IllegalStateException, ScanReadResultSpliterator
[EXCEPTIONS] throws IllegalStateException
[THROWS-WHEN] IllegalSt... | /* static context
[FOCAL] @Override protected Spliterator<T> ScanReadResult.spliterator()
[THROWS-WHEN] IllegalStateException when iterationStarted
[PATH1] if(iterationStarted)=T -> throw new IllegalStateException("ScanReadResult can only be iterated once.")
[PATH2] if(iterationStarted)=F -> return new ScanReadResultSp... | /* static context
[FOCAL] @Override protected Spliterator<T> ScanReadResult.spliterator()
[THROWS-WHEN] IllegalStateException when iterationStarted
[PATH1] if(iterationStarted)=T -> throw new IllegalStateException("ScanReadResult can only be iterated once.")
[PATH2] if(iterationStarted)=F -> return new ScanReadResultSp... | true | ok | {"focal": {"class": "ScanReadResult", "name": "spliterator", "signature": "Spliterator<T> spliterator()", "start_line": 3, "modifiers": "@Override protected", "params": [], "return_type": "Spliterator<T>"}, "class_info": {"name": "ScanReadResult", "kind": "class", "modifiers": "", "superclass": "AbstractReadResult<T>",... |
164875108_24 | class TracingProvider implements CorrelationDataProvider {
public TracingProvider(Tracer tracer) {
this.tracer = tracer;
}
public TracingProvider(Tracer tracer);
@Override public Map<String, ?> correlationDataFor(Message<?> message);
private MockTracer mockTracer;
}
class TracingProvi... | MockSpan span = mockTracer.buildSpan("test").start();
ScopeManager scopeManager = mockTracer.scopeManager();
try (final Scope ignored = scopeManager.activate(span)) {
Message<String> message = new GenericMessage<>("payload", MetaData.emptyInstance());
TracingProvider tra... | [FOCAL] public TracingProvider.TracingProvider(Tracer tracer)
[CLASS] class TracingProvider implements CorrelationDataProvider
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[FIELDS] write=tracer
[STATE] tracer
[DATAFLOW] tracer@param->L2
[CLASS-MEMBERS] TracingProvider(Tracer tracer); Map<String,... | /* static context
[FOCAL] public TracingProvider.TracingProvider(Tracer tracer)
[STATE] tracer
[FIELDS] write=tracer
*/
| /* static context
[FOCAL] public TracingProvider.TracingProvider(Tracer tracer)
[STATE] tracer
[FIELDS] write=tracer
*/
class TracingProvider implements CorrelationDataProvider {
public TracingProvider(Tracer tracer) {
this.tracer = tracer;
}
public TracingProvider(Tracer tracer);
@Override ... | true | ok | {"focal": {"class": "TracingProvider", "name": "TracingProvider", "signature": "TracingProvider(Tracer tracer)", "start_line": 3, "modifiers": "public", "params": [{"name": "tracer", "type": "Tracer"}], "return_type": null}, "class_info": {"name": "TracingProvider", "kind": "class", "modifiers": "", "superclass": null,... |
164962081_1 | class AnalyziedResult {
public int getStatusCode() {
return statusCode;
}
public AnalyziedResult(Builder builder);
public TsdbHttpStatus getHttpStatus();
public String getContent();
public HttpResponse getHttpResponse();
@Override public String toString();
private HttpRespon... | // get
HttpGet request = new HttpGet("http://localhost:4242");
try {
response = httpAsyncClient.execute(request, null);
assertTrue(response.getStatusLine().getStatusCode() == 200);
} catch (InterruptedException e) {
e.printStackTrace();
} catch... | [FOCAL] public int AnalyziedResult.getStatusCode()
[CLASS] class AnalyziedResult
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] AnalyziedResult(Builder builder); TsdbHttpStatus getHttpStatus(); String getContent(); HttpResponse getHttpResponse(); String toString()
[TEST] TestAnalyz... | /* static context
[FOCAL] public int AnalyziedResult.getStatusCode()
*/
| /* static context
[FOCAL] public int AnalyziedResult.getStatusCode()
*/
class AnalyziedResult {
public int getStatusCode() {
return statusCode;
}
public AnalyziedResult(Builder builder);
public TsdbHttpStatus getHttpStatus();
public String getContent();
public HttpResponse getHttpRes... | true | ok | {"focal": {"class": "AnalyziedResult", "name": "getStatusCode", "signature": "int getStatusCode()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "AnalyziedResult", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "respon... |
164972617_10 | class SimpleReadWriteLock {
public synchronized boolean tryWriteLock() {
if (!isFree()) {
return false;
} else {
status = -1;
return true;
}
}
public synchronized boolean tryReadLock();
public synchronized void releaseReadLock();
public s... | SimpleReadWriteLock lock = new SimpleReadWriteLock();
assertEquals(true, lock.tryWriteLock());
assertEquals(false, lock.tryWriteLock());
}
} | [FOCAL] public synchronized boolean SimpleReadWriteLock.tryWriteLock()
[CLASS] class SimpleReadWriteLock
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] boolean isFree()
[PATH1] if(!isFree())=T -> return false
[PATH2] if(!isFree())=F -> return true
[CLASS-MEMBERS] boolean tryReadLo... | /* static context
[FOCAL] public synchronized boolean SimpleReadWriteLock.tryWriteLock()
[PATH1] if(!isFree())=T -> return false
[PATH2] if(!isFree())=F -> return true
[CALLS-INTERNAL] boolean isFree()
*/
| /* static context
[FOCAL] public synchronized boolean SimpleReadWriteLock.tryWriteLock()
[PATH1] if(!isFree())=T -> return false
[PATH2] if(!isFree())=F -> return true
[CALLS-INTERNAL] boolean isFree()
*/
class SimpleReadWriteLock {
public synchronized boolean tryWriteLock() {
if (!isFree()) {
... | true | ok | {"focal": {"class": "SimpleReadWriteLock", "name": "tryWriteLock", "signature": "boolean tryWriteLock()", "start_line": 3, "modifiers": "public synchronized", "params": [], "return_type": "boolean"}, "class_info": {"name": "SimpleReadWriteLock", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, ... |
165007814_10 | class HttpClientDownloader extends AbstractDownloader {
@Override
public Page download(Request request, Task task) {
if (task == null || task.getSite() == null) {
throw new NullPointerException("task or site can not be null");
}
CloseableHttpResponse httpResponse = null;
... | HttpClientDownloader httpClientDownloader = new HttpClientDownloader();
Task task = Site.me().setDomain("localhost").setCycleRetryTimes(5).toTask();
Request request = new Request(PAGE_ALWAYS_NOT_EXISTS);
Page page = httpClientDownloader.download(request, task);
assertThat(page.is... | [FOCAL] @Override public Page HttpClientDownloader.download(Request request, Task task)
[CLASS] class HttpClientDownloader extends AbstractDownloader
[METRICS] loc=75 cc=8 branches=4 loops=0 returns=2 throws=1 nesting=3
[CALLS-INTERNAL] CloseableHttpClient getHttpClient(Site site); Page handleResponse(Request request, ... | /* static context
[FOCAL] @Override public Page HttpClientDownloader.download(Request request, Task task)
[THROWS-WHEN] NullPointerException when task == null || task.getSite() == null
[PATH1] if(task == null || task.getSite() == null)=F -> if(Integer.valueOf(page.getRawText().length()) < 280)=T -> try-body throws -> r... | /* static context
[FOCAL] @Override public Page HttpClientDownloader.download(Request request, Task task)
[THROWS-WHEN] NullPointerException when task == null || task.getSite() == null
[PATH1] if(task == null || task.getSite() == null)=F -> if(Integer.valueOf(page.getRawText().length()) < 280)=T -> try-body throws -> r... | true | ok | {"focal": {"class": "HttpClientDownloader", "name": "download", "signature": "Page download(Request request, Task task)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "Request"}, {"name": "task", "type": "Task"}], "return_type": "Page"}, "class_info": {"name": "HttpClientDown... |
165026546_174 | class ConflictDetectionResultConverter {
DiagnosisSet convertDiagnosisSet(int[] diagnosisSet) {
final List<DiagnosisElement> elements = Arrays.stream(diagnosisSet)
.mapToObj(this::convertDiagnosisElement)
.collect(Collectors.toList());
return new DiagnosisSet(elemen... | final TestModel expandedTestModel = mock(TestModel.class);
when(expandedTestModel.getForbiddenTupleLists()).thenReturn(Collections.emptyList());
when(expandedTestModel.getErrorTupleLists()).thenReturn(Arrays.asList(
new TupleList(10, new int[] {0}, Collections.singletonList(new i... | [FOCAL] DiagnosisSet ConflictDetectionResultConverter.convertDiagnosisSet(int[] diagnosisSet)
[CLASS] class ConflictDetectionResultConverter
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Arrays.stream(diagnosisSet) .mapToObj(this::convertDiagno....collect/1, Arrays.stream(diagnos... | /* static context
[FOCAL] DiagnosisSet ConflictDetectionResultConverter.convertDiagnosisSet(int[] diagnosisSet)
[INPUTS] branches=- | result=diagnosisSet
[NEW] DiagnosisSet
[CALLS-EXTERNAL] Arrays.stream(diagnosisSet) .mapToObj(this::convertDiagno....collect/1, Arrays.stream(diagnosisSet).mapToObj/1, Arrays.stream/1, C... | /* static context
[FOCAL] DiagnosisSet ConflictDetectionResultConverter.convertDiagnosisSet(int[] diagnosisSet)
[INPUTS] branches=- | result=diagnosisSet
[NEW] DiagnosisSet
[CALLS-EXTERNAL] Arrays.stream(diagnosisSet) .mapToObj(this::convertDiagno....collect/1, Arrays.stream(diagnosisSet).mapToObj/1, Arrays.stream/1, C... | true | ok | {"focal": {"class": "ConflictDetectionResultConverter", "name": "convertDiagnosisSet", "signature": "DiagnosisSet convertDiagnosisSet(int[] diagnosisSet)", "start_line": 3, "modifiers": "", "params": [{"name": "diagnosisSet", "type": "int[]"}], "return_type": "DiagnosisSet"}, "class_info": {"name": "ConflictDetectionRe... |
165063056_1 | class DiagramHandler {
public Handler<RoutingContext> createPost(String serviceName) {
return routingContext -> {
try {
FileFormat fileFormat;
String diagramSource;
MIMEHeader contentType = routingContext.parsedHeaders().contentType();
if (contentType != null && contentType.... | DiagramHandler diagramHandler = new DiagramHandler(mockDiagramService(Lists.newArrayList(FileFormat.SVG), null));
MockDiagramRequest mockDiagramRequest = new MockDiagramRequest();
mockDiagramRequest.setMethod(HttpMethod.POST);
mockDiagramRequest.addAccept("text/html");
mockDiagramRequest.setContentT... | [FOCAL] public Handler<RoutingContext> DiagramHandler.createPost(String serviceName)
[CLASS] class DiagramHandler
[METRICS] loc=34 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=3
[CALLS-INTERNAL] FileFormat getOutputFileFormatFromJsonRequest(String serviceName, RoutingContext routingContext, JsonObject jsonBody); ... | /* static context
[FOCAL] public Handler<RoutingContext> DiagramHandler.createPost(String serviceName)
[INPUTS] branches=- | result=serviceName
[COLLABORATORS] field routingContext parsedHeaders/0,getBodyAsString/0,fail/1
[CALLS-INTERNAL] FileFormat getOutputFileFormatFromJsonRequest(String serviceName, RoutingContext ... | /* static context
[FOCAL] public Handler<RoutingContext> DiagramHandler.createPost(String serviceName)
[INPUTS] branches=- | result=serviceName
[COLLABORATORS] field routingContext parsedHeaders/0,getBodyAsString/0,fail/1
[CALLS-INTERNAL] FileFormat getOutputFileFormatFromJsonRequest(String serviceName, RoutingContext ... | true | ok | {"focal": {"class": "DiagramHandler", "name": "createPost", "signature": "Handler<RoutingContext> createPost(String serviceName)", "start_line": 3, "modifiers": "public", "params": [{"name": "serviceName", "type": "String"}], "return_type": "Handler<RoutingContext>"}, "class_info": {"name": "DiagramHandler", "kind": "c... |
165292138_11 | class SchedulerJobResource {
@GET
@Path("/{projectName}/{exploratoryName}/{computationalName}")
@Produces(MediaType.APPLICATION_JSON)
public Response fetchSchedulerJobForComputationalResource(@Auth UserInfo userInfo,
@PathParam("exploratoryName") String exploratoryName,
@PathParam... | when(schedulerJobService.fetchSchedulerJobForComputationalResource(anyString(), anyString(), anyString(), anyString()))
.thenReturn(getSchedulerJobDTO());
final Response response = resources.getJerseyTest()
.target("/infrastructure_provision/exploratory_environment/schedu... | [FOCAL] @GET @Path("/{projectName}/{exploratoryName}/{computationalName}") @Produces(MediaType.APPLICATION_JSON) public Response SchedulerJobResource.fetchSchedulerJobForComputationalResource(UserInfo userInfo, String exploratoryName, String projectName, String computationalName)
[CLASS] class SchedulerJobResource
[MET... | /* static context
[FOCAL] @GET @Path("/{projectName}/{exploratoryName}/{computationalName}") @Produces(MediaType.APPLICATION_JSON) public Response SchedulerJobResource.fetchSchedulerJobForComputationalResource(UserInfo userInfo, String exploratoryName, String projectName, String computationalName)
[INPUTS] branches=- |... | /* static context
[FOCAL] @GET @Path("/{projectName}/{exploratoryName}/{computationalName}") @Produces(MediaType.APPLICATION_JSON) public Response SchedulerJobResource.fetchSchedulerJobForComputationalResource(UserInfo userInfo, String exploratoryName, String projectName, String computationalName)
[INPUTS] branches=- |... | true | ok | {"focal": {"class": "SchedulerJobResource", "name": "fetchSchedulerJobForComputationalResource", "signature": "Response fetchSchedulerJobForComputationalResource(UserInfo userInfo, String exploratoryName, String projectName, String computationalName)", "start_line": 3, "modifiers": "@GET @Path(\"/{projectName}/{explora... |
165543540_0 | class BonusService {
@Transactional
public void calculateBonus(Bonus bonus) {
if (bonusRepository.existsById(bonus.getId())) {
log.info("Bonus id {} already exists - ignored", bonus.getId());
} else {
bonusRepository.save(bonus);
}
}
@Autowired public BonusService(BonusRepository bonusRepository);
... | long countBefore = bonusRepository.count();
Bonus bonus = new Bonus(42L,
new Customer(23L, "Eberhard", "Wolff"),
new Date(0L), 42.0);
bonusService.calculateBonus(bonus);
assertThat(bonusRepository.count(), is(countBefore + 1));
assertThat(bonusRepository.findById(42L).get().getUpdated().getTime(), equ... | [FOCAL] @Transactional public void BonusService.calculateBonus(Bonus bonus)
[CLASS] class BonusService
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] BonusRepository.existsById/1, Bonus.getId/0, log.info/2, BonusRepository.save/1
[FIELDS] read=bonusRepository:BonusRepository
[PATH... | /* static context
[FOCAL] @Transactional public void BonusService.calculateBonus(Bonus bonus)
[PATH1] if(bonusRepository.existsById(bonus.getId()))=T
[PATH2] if(bonusRepository.existsById(bonus.getId()))=F
[INPUTS] branches=bonus, bonusRepository | result=-
[COLLABORATORS] field bonusRepository:BonusRepository existsBy... | /* static context
[FOCAL] @Transactional public void BonusService.calculateBonus(Bonus bonus)
[PATH1] if(bonusRepository.existsById(bonus.getId()))=T
[PATH2] if(bonusRepository.existsById(bonus.getId()))=F
[INPUTS] branches=bonus, bonusRepository | result=-
[COLLABORATORS] field bonusRepository:BonusRepository existsBy... | true | ok | {"focal": {"class": "BonusService", "name": "calculateBonus", "signature": "void calculateBonus(Bonus bonus)", "start_line": 3, "modifiers": "@Transactional public", "params": [{"name": "bonus", "type": "Bonus"}], "return_type": "void"}, "class_info": {"name": "BonusService", "kind": "class", "modifiers": "", "supercla... |
165549674_5 | class Base64BinaryType extends PrimitiveType<byte[]> implements IPrimitiveType<byte[]>, IBaseHasExtensions, IElement, Externalizable {
@Override
public byte[] getValue() {
return myValue;
}
public Base64BinaryType();
public Base64BinaryType(byte[] theBytes);
public Base64BinaryType(String theValue)... | String v = "dGhpcyBpcyB2YWxpZCBiYXNlNjQ=";
Base64BinaryType b64 = new Base64BinaryType(v);
Assertions.assertNotNull(b64);
Assertions.assertNotNull(b64.getValue());
Assertions.assertEquals(v, b64.asStringValue());
}
} | [FOCAL] @Override public byte[] Base64BinaryType.getValue()
[CLASS] class Base64BinaryType extends PrimitiveType<byte[]> implements IPrimitiveType<byte[]>, IBaseHasExtensions, IElement, Externalizable
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] Base64BinaryType(); Base64BinaryTy... | /* static context
[FOCAL] @Override public byte[] Base64BinaryType.getValue()
*/
| /* static context
[FOCAL] @Override public byte[] Base64BinaryType.getValue()
*/
class Base64BinaryType extends PrimitiveType<byte[]> implements IPrimitiveType<byte[]>, IBaseHasExtensions, IElement, Externalizable {
@Override
public byte[] getValue() {
return myValue;
}
public Base64BinaryType();
publi... | true | ok | {"focal": {"class": "Base64BinaryType", "name": "getValue", "signature": "byte[] getValue()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "byte[]"}, "class_info": {"name": "Base64BinaryType", "kind": "class", "modifiers": "", "superclass": "PrimitiveType<byte[]>", "interfaces": "IPrim... |
165671355_2 | class TurtleSoup {
public static double calculateHeadingToPoint(double currentHeading, int currentX, int currentY, int targetX,
int targetY) {
// throw new RuntimeException("implement me!");
if(currentX == targetX && currentY == targetY)
return 0.0;
double degreess = Math.atan2(targetY - currentY, targetX... | assertEquals(0.0, TurtleSoup.calculateHeadingToPoint(0.0, 0, 0, 0, 1), 0.001);
assertEquals(0.0, TurtleSoup.calculateHeadingToPoint(0.0, 0, 0, 0, 0), 0.001);
assertEquals(90.0, TurtleSoup.calculateHeadingToPoint(0.0, 0, 0, 1, 0), 0.001);
assertEquals(359.0, TurtleSoup.calculateHeadingToP... | [FOCAL] public static double TurtleSoup.calculateHeadingToPoint(double currentHeading, int currentX, int currentY, int targetX, int targetY)
[CLASS] class TurtleSoup
[METRICS] loc=16 cc=5 branches=4 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] Math.atan2/2
[PATH1] if(currentX == targetX && currentY == targetY)... | /* static context
[FOCAL] public static double TurtleSoup.calculateHeadingToPoint(double currentHeading, int currentX, int currentY, int targetX, int targetY)
[PATH1] if(currentX == targetX && currentY == targetY)=F -> if(degreess < 0)=T -> if(currentHeading < 0)=T -> if(ans < 0)=T -> return ans
[PATH2] if(currentX == ... | /* static context
[FOCAL] public static double TurtleSoup.calculateHeadingToPoint(double currentHeading, int currentX, int currentY, int targetX, int targetY)
[PATH1] if(currentX == targetX && currentY == targetY)=F -> if(degreess < 0)=T -> if(currentHeading < 0)=T -> if(ans < 0)=T -> return ans
[PATH2] if(currentX == ... | true | ok | {"focal": {"class": "TurtleSoup", "name": "calculateHeadingToPoint", "signature": "double calculateHeadingToPoint(double currentHeading, int currentX, int currentY, int targetX, int targetY)", "start_line": 3, "modifiers": "public static", "params": [{"name": "currentHeading", "type": "double"}, {"name": "currentX", "t... |
165758293_75 | class GlueMetastoreClientDelegate {
public org.apache.hadoop.hive.metastore.api.Partition getPartition(String dbName, String tblName, String partitionName)
throws TException {
checkArgument(StringUtils.isNotEmpty(dbName), "dbName cannot be null or empty");
checkArgument(StringUtils.isNotEmpty(tblName),... | when(glueClient.getPartition(any(GetPartitionRequest.class)))
.thenThrow(new EntityNotFoundException("Test exception: partition not found"));
metastoreClientDelegate.getPartition(testDb.getName(), testTbl.getName(), "testPart");
verify(glueClient, times(1)).getPartition(any(GetPartitionRequest.class))... | [FOCAL] public org.apache.hadoop.hive.metastore.api.Partition GlueMetastoreClientDelegate.getPartition(String dbName, String tblName, String partitionName)
[CLASS] class GlueMetastoreClientDelegate
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] List<String> partitionNameToVals(Str... | class GlueMetastoreClientDelegate {
public org.apache.hadoop.hive.metastore.api.Partition getPartition(String dbName, String tblName, String partitionName)
throws TException {
checkArgument(StringUtils.isNotEmpty(dbName), "dbName cannot be null or empty");
checkArgument(StringUtils.isNotEmpty(tblName),... | false | ok | {"focal": {"class": "GlueMetastoreClientDelegate", "name": "getPartition", "signature": "org.apache.hadoop.hive.metastore.api.Partition getPartition(String dbName, String tblName, String partitionName) throws TException", "start_line": 3, "modifiers": "public", "params": [{"name": "dbName", "type": "String"}, {"name": ... | |
165787430_1 | class FizzBuzzBazz {
public static ArrayList<Integer> fizzBuzzBazz(){
ArrayList<Integer> fizz = new ArrayList<Integer>();
int loopNumber;
System.out.println("Enter a whole number:");
//Create buffered reader in try catch so buffered reader auto closes.
try(BufferedReader rea... | ArrayList<Integer> fizzBuzzBazz = new ArrayList<Integer>();
ByteArrayInputStream in = new ByteArrayInputStream("a".getBytes());
System.setIn(in);
Exception e = assertThrows(NumberFormatException.class, () -> {FizzBuzzBazz.fizzBuzzBazz(); });
assertEquals("Error: Non-number entere... | [FOCAL] public static ArrayList<Integer> FizzBuzzBazz.fizzBuzzBazz()
[CLASS] class FizzBuzzBazz
[METRICS] loc=29 cc=5 branches=2 loops=0 returns=1 throws=3 nesting=4
[CALLS-INTERNAL] ArrayList<Integer> makeList(int loopNumber)
[CALLS-EXTERNAL] System.out.println/1, BufferedReader.readLine/0, String.length/0, Integer.pa... | /* static context
[FOCAL] public static ArrayList<Integer> FizzBuzzBazz.fizzBuzzBazz()
[PATH1] if(n.length() > 0)=T -> if(loopNumber<1)=T -> throw new NumberFormatException("Error: Number less than 1 entered") -> throw new NumberFormatException("Error: Non-number entered") -> return fizz
[PATH2] if(n.length() > 0)=F ->... | /* static context
[FOCAL] public static ArrayList<Integer> FizzBuzzBazz.fizzBuzzBazz()
[PATH1] if(n.length() > 0)=T -> if(loopNumber<1)=T -> throw new NumberFormatException("Error: Number less than 1 entered") -> throw new NumberFormatException("Error: Non-number entered") -> return fizz
[PATH2] if(n.length() > 0)=F ->... | true | ok | {"focal": {"class": "FizzBuzzBazz", "name": "fizzBuzzBazz", "signature": "ArrayList<Integer> fizzBuzzBazz()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "ArrayList<Integer>"}, "class_info": {"name": "FizzBuzzBazz", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null... |
165861304_3 | class TwitterSocialQueryResult implements SocialQueryResult {
public static List<SocialMessage> translate(List<Status> statuses) {
if (statuses == null) {
return null;
}
List<SocialMessage> socialMessages = statuses.stream().map(status -> {
SocialMessage message = new SocialMessage(status.ge... | String text = "Hello";
Date date = new Date();
int retweetCount = 5;
String language = "EN";
boolean isRetweeted = true;
int id = 8;
Status someStatus = new MockStatus(text, isRetweeted, date, id, retweetCount, language);
List<SocialMessage> translate = TwitterSocialQueryResult.translat... | [FOCAL] public static List<SocialMessage> TwitterSocialQueryResult.translate(List<Status> statuses)
[CLASS] class TwitterSocialQueryResult implements SocialQueryResult
[METRICS] loc=19 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] statuses.stream().map(status -> { SocialMessage message =....coll... | /* static context
[FOCAL] public static List<SocialMessage> TwitterSocialQueryResult.translate(List<Status> statuses)
[PATH1] if(statuses == null)=T -> return null
[PATH2] if(statuses == null)=F -> return socialMessages
[INPUTS] branches=statuses | result=statuses
[COLLABORATORS] param statuses:List<Status> stream/0; f... | /* static context
[FOCAL] public static List<SocialMessage> TwitterSocialQueryResult.translate(List<Status> statuses)
[PATH1] if(statuses == null)=T -> return null
[PATH2] if(statuses == null)=F -> return socialMessages
[INPUTS] branches=statuses | result=statuses
[COLLABORATORS] param statuses:List<Status> stream/0; f... | true | ok | {"focal": {"class": "TwitterSocialQueryResult", "name": "translate", "signature": "List<SocialMessage> translate(List<Status> statuses)", "start_line": 3, "modifiers": "public static", "params": [{"name": "statuses", "type": "List<Status>"}], "return_type": "List<SocialMessage>"}, "class_info": {"name": "TwitterSocialQ... |
165869297_0 | class CalcSoundex implements LevenshteinPhonetic {
@Override
public PhoneticWordDist getPhonetic(String word1, String word2) {
// return the distance
PhoneticWordDist phoneticWordDist = new PhoneticWordDist(word1, word2, null,null,-1) ;
try {
String phoneticWord1 = executeJavaStript(word1).toString();
St... | //File inputFile = new File("./data/dfFautePrediction.csv");
//File outputFile = new File("./data/dfFautePredictionSoundex.csv");
LevenshteinPhonetic calcSoundex = new CalcSoundex();
PhoneticWordDist phoneticWordDist = calcSoundex.getPhonetic("metphomie", "metformine");
assertEquals(phoneticWordDist.getPhonet... | [FOCAL] @Override public PhoneticWordDist CalcSoundex.getPhonetic(String word1, String word2)
[CLASS] class CalcSoundex implements LevenshteinPhonetic
[METRICS] loc=19 cc=2 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] Object executeJavaStript(String param)
[CALLS-EXTERNAL] executeJavaStript(word1).t... | /* static context
[FOCAL] @Override public PhoneticWordDist CalcSoundex.getPhonetic(String word1, String word2)
[PATH1] try-body throws -> return phoneticWordDist
[INPUTS] branches=- | result=word1, word2
[EXCEPTIONS] catches NoSuchMethodException | ScriptException | IOException e
[CALLS-INTERNAL] Object executeJavaStr... | /* static context
[FOCAL] @Override public PhoneticWordDist CalcSoundex.getPhonetic(String word1, String word2)
[PATH1] try-body throws -> return phoneticWordDist
[INPUTS] branches=- | result=word1, word2
[EXCEPTIONS] catches NoSuchMethodException | ScriptException | IOException e
[CALLS-INTERNAL] Object executeJavaStr... | true | ok | {"focal": {"class": "CalcSoundex", "name": "getPhonetic", "signature": "PhoneticWordDist getPhonetic(String word1, String word2)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "word1", "type": "String"}, {"name": "word2", "type": "String"}], "return_type": "PhoneticWordDist"}, "class_info": {"n... |
165964380_1 | class JsThunkFx implements JsThunk {
@Override
public <T> void setMember(Object scope, String member, T val)
{
JSObject jsObj = ((DomjnateJSObjectAccess)scope).__DomjnateGetJSObjectFromProxy();
jsObj.setMember(member, DomjnateFx.unwrapObject(val, this));
}
@Override public Object getConstru... | Fx.runBlankWebPageInFx((WebEngine engine) -> {
JSObject jsWin = (JSObject)engine.executeScript("window");
jsWin.setMember("fnobj", new Supplier<Integer>() {
@Override public Integer get()
{
return 9;
}});
Assert.assertEquals(9, jsWin.ev... | [FOCAL] @Override public void JsThunkFx.setMember(Object scope, String member, T val)
[CLASS] class JsThunkFx implements JsThunk
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] ((DomjnateJSObjectAccess)scope).__DomjnateGetJSObjectFromProxy/0, JSObject.setMember/2, DomjnateFx.unwrap... | /* static context
[FOCAL] @Override public void JsThunkFx.setMember(Object scope, String member, T val)
[CALLS-EXTERNAL] ((DomjnateJSObjectAccess)scope).__DomjnateGetJSObjectFromProxy/0, JSObject.setMember/2, DomjnateFx.unwrapObject/2
*/
| /* static context
[FOCAL] @Override public void JsThunkFx.setMember(Object scope, String member, T val)
[CALLS-EXTERNAL] ((DomjnateJSObjectAccess)scope).__DomjnateGetJSObjectFromProxy/0, JSObject.setMember/2, DomjnateFx.unwrapObject/2
*/
class JsThunkFx implements JsThunk {
@Override
public <T> void setMember(Ob... | true | ok | {"focal": {"class": "JsThunkFx", "name": "setMember", "signature": "void setMember(Object scope, String member, T val)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "scope", "type": "Object"}, {"name": "member", "type": "String"}, {"name": "val", "type": "T"}], "return_type": "void"}, "class_i... |
165997095_1 | class ElasticsearchEvolution {
public static ElasticsearchEvolutionConfig configure() {
return new ElasticsearchEvolutionConfig();
}
public ElasticsearchEvolution(ElasticsearchEvolutionConfig elasticsearchEvolutionConfig,
RestHighLevelClient restHighLevelClient);... | String indexName = "es_evolution";
int historyMaxQuerySize = 6;
ElasticsearchEvolution underTest = ElasticsearchEvolution.configure()
.setLocations(singletonList("classpath:es/ElasticsearchEvolutionTest/migrate_OK"))
.setHistoryIndex(indexName)
.se... | [FOCAL] public static ElasticsearchEvolutionConfig ElasticsearchEvolution.configure()
[CLASS] class ElasticsearchEvolution
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] ElasticsearchEvolutionConfig
[CLASS-MEMBERS] ElasticsearchEvolution(ElasticsearchEvolutionConfig elasticsearchEvolutionCon... | /* static context
[FOCAL] public static ElasticsearchEvolutionConfig ElasticsearchEvolution.configure()
[NEW] ElasticsearchEvolutionConfig
*/
| /* static context
[FOCAL] public static ElasticsearchEvolutionConfig ElasticsearchEvolution.configure()
[NEW] ElasticsearchEvolutionConfig
*/
class ElasticsearchEvolution {
public static ElasticsearchEvolutionConfig configure() {
return new ElasticsearchEvolutionConfig();
}
public ElasticsearchEv... | true | ok | {"focal": {"class": "ElasticsearchEvolution", "name": "configure", "signature": "ElasticsearchEvolutionConfig configure()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "ElasticsearchEvolutionConfig"}, "class_info": {"name": "ElasticsearchEvolution", "kind": "class", "modifiers": "", "sup... |
166023376_12 | class ReflectionUtils {
public Method getSetterMethodForField(final Class<?> fieldClass, final String fieldName, final Class<?> fieldType) {
final String cacheKey = "SetterMethod-" + fieldClass.getName() + '-' + fieldName;
return CACHE_MANAGER.getFromCache(cacheKey, Method.class).orElseGet(() -> {
... | // GIVEN
MutableToFoo mutableToFoo = createMutableToFoo(null);
Method idSetterMethod = underTest.getSetterMethodForField(MutableToFoo.class, LIST_FIELD_NAME, List.class);
// WHEN
ThrowingCallable actual = () ->
getMethod(underTest.getClass(), INVOKE_METHOD_NAME,... | [FOCAL] public Method ReflectionUtils.getSetterMethodForField(Class<?> fieldClass, String fieldName, Class<?> fieldType)
[CLASS] class ReflectionUtils
[METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] Class<?>.getName/0, CACHE_MANAGER.getFromCache(cacheKey, Method.class).orElseGet/1... | /* static context
[FOCAL] public Method ReflectionUtils.getSetterMethodForField(Class<?> fieldClass, String fieldName, Class<?> fieldType)
[INPUTS] branches=- | result=fieldClass, fieldName, fieldType
[COLLABORATORS] param fieldClass:Class<?> getName/0,getMethod/2
[NEW] MissingMethodException
[CALLS-EXTERNAL] Class<?>.... | /* static context
[FOCAL] public Method ReflectionUtils.getSetterMethodForField(Class<?> fieldClass, String fieldName, Class<?> fieldType)
[INPUTS] branches=- | result=fieldClass, fieldName, fieldType
[COLLABORATORS] param fieldClass:Class<?> getName/0,getMethod/2
[NEW] MissingMethodException
[CALLS-EXTERNAL] Class<?>.... | true | ok | {"focal": {"class": "ReflectionUtils", "name": "getSetterMethodForField", "signature": "Method getSetterMethodForField(Class<?> fieldClass, String fieldName, Class<?> fieldType)", "start_line": 3, "modifiers": "public", "params": [{"name": "fieldClass", "type": "Class<?>"}, {"name": "fieldName", "type": "String"}, {"na... |
166116543_0 | class DefaultJwtService implements JwtService {
@Override
public Optional<String> getSubFromToken(String token) {
try {
Jws<Claims> claimsJws = Jwts.parser().setSigningKey(secret).parseClaimsJws(token);
return Optional.ofNullable(claimsJws.getBody().getSubject());
} catc... | Optional<String> optional = jwtService.getSubFromToken("123");
assertThat(optional.isPresent(), is(false));
}
} | [FOCAL] @Override public Optional<String> DefaultJwtService.getSubFromToken(String token)
[CLASS] class DefaultJwtService implements JwtService
[METRICS] loc=9 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] Jwts.parser().setSigningKey(secret).parseClaimsJws/1, Jwts.parser().setSigningKey/1, Jwts.... | /* static context
[FOCAL] @Override public Optional<String> DefaultJwtService.getSubFromToken(String token)
[PATH1] try-body throws -> return Optional.empty()
[PATH2] return Optional.ofNullable(claimsJws.getBody().getSubject())
[INPUTS] branches=- | result=token
[EXCEPTIONS] catches Exception e
[CALLS-EXTERNAL] Jwts.pa... | /* static context
[FOCAL] @Override public Optional<String> DefaultJwtService.getSubFromToken(String token)
[PATH1] try-body throws -> return Optional.empty()
[PATH2] return Optional.ofNullable(claimsJws.getBody().getSubject())
[INPUTS] branches=- | result=token
[EXCEPTIONS] catches Exception e
[CALLS-EXTERNAL] Jwts.pa... | true | ok | {"focal": {"class": "DefaultJwtService", "name": "getSubFromToken", "signature": "Optional<String> getSubFromToken(String token)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "token", "type": "String"}], "return_type": "Optional<String>"}, "class_info": {"name": "DefaultJwtService", "kind": "c... |
166249209_1 | class FileFeedbackWrapper {
public Optional<Double> getGlobalAverageForLine(int line) {
List<LineExecution> filteredHistory = getLatestVersionAttributeForLine(line, new ArrayList<>(), l -> l.getPerformance().getRequestProfileHistory(), p -> p.getProfileStartTimestamp());
OptionalDouble average = fi... | Optional<Double> globalAverageForLine = fileFeedbackWrapper.getGlobalAverageForLine(1);
Assert.assertTrue(globalAverageForLine.isPresent());
Assert.assertEquals(100.0, globalAverageForLine.get(), 0.0);
globalAverageForLine = fileFeedbackWrapper.getGlobalAverageForLine(4);
Asse... | [FOCAL] public Optional<Double> FileFeedbackWrapper.getGlobalAverageForLine(int line)
[CLASS] class FileFeedbackWrapper
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] List<V> getLatestVersionAttributeForLine(int line, T valueIfNotPresent, Function<FileFeedbackLines, T> function, F... | /* static context
[FOCAL] public Optional<Double> FileFeedbackWrapper.getGlobalAverageForLine(int line)
[INPUTS] branches=- | result=line
[COLLABORATORS] field l getPerformance/0; field p getProfileStartTimestamp/0; field f getSampleTime/0
[CALLS-INTERNAL] List<V> getLatestVersionAttributeForLine(int line, T valueIfNot... | /* static context
[FOCAL] public Optional<Double> FileFeedbackWrapper.getGlobalAverageForLine(int line)
[INPUTS] branches=- | result=line
[COLLABORATORS] field l getPerformance/0; field p getProfileStartTimestamp/0; field f getSampleTime/0
[CALLS-INTERNAL] List<V> getLatestVersionAttributeForLine(int line, T valueIfNot... | true | ok | {"focal": {"class": "FileFeedbackWrapper", "name": "getGlobalAverageForLine", "signature": "Optional<Double> getGlobalAverageForLine(int line)", "start_line": 3, "modifiers": "public", "params": [{"name": "line", "type": "int"}], "return_type": "Optional<Double>"}, "class_info": {"name": "FileFeedbackWrapper", "kind": ... |
166365902_11 | class ObjectMapTool {
public static Float getFloat(Map param, String key) {
if (param == null || isEmpty(key)) {
return null;
}
Object v = param.get(key);
if (v == null) {
return null;
}
return parseFloat(v.toString());
}
public static Long parseLong(String input);
public static Double parseDoub... | Map<String, String> map = new HashMap<>();
map.put("float", "1.1");
assertEquals(Float.valueOf("1.1"), getFloat(map, "float"));
}
} | [FOCAL] public static Float ObjectMapTool.getFloat(Map param, String key)
[CLASS] class ObjectMapTool
[METRICS] loc=10 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[CALLS-INTERNAL] Float parseFloat(String input); boolean isEmpty(String input)
[CALLS-EXTERNAL] Map.get/1, Object.toString/0
[PATH1] if(param == nul... | /* static context
[FOCAL] public static Float ObjectMapTool.getFloat(Map param, String key)
[PATH1] if(param == null || isEmpty(key))=F -> if(v == null)=T -> return null
[PATH2] if(param == null || isEmpty(key))=F -> if(v == null)=F -> return parseFloat(v.toString())
[PATH3] if(param == null || isEmpty(key))=T -> retur... | /* static context
[FOCAL] public static Float ObjectMapTool.getFloat(Map param, String key)
[PATH1] if(param == null || isEmpty(key))=F -> if(v == null)=T -> return null
[PATH2] if(param == null || isEmpty(key))=F -> if(v == null)=F -> return parseFloat(v.toString())
[PATH3] if(param == null || isEmpty(key))=T -> retur... | true | ok | {"focal": {"class": "ObjectMapTool", "name": "getFloat", "signature": "Float getFloat(Map param, String key)", "start_line": 3, "modifiers": "public static", "params": [{"name": "param", "type": "Map"}, {"name": "key", "type": "String"}], "return_type": "Float"}, "class_info": {"name": "ObjectMapTool", "kind": "class",... |
166387176_29 | class Util {
public static <E> List<E> quotientList( final List<E> list, final int n, final int k ) {
if ( n <= 0 || k < 0 || k >= n ) {
throw new IllegalArgumentException( "n must be positive; k must be between 0 and n - 1" );
}
final int size = (list.size() + n - k - 1) / n;
... | List<String> beatles = Arrays.asList( "john", "paul", "george", "ringo" );
final List list0 = Util.quotientList( beatles, 3, 0 );
assertEquals( 2, list0.size() );
assertEquals( "john", list0.get( 0 ) );
assertEquals( "ringo", list0.get( 1 ) );
final List list1 = Util.quo... | [FOCAL] public static List<E> Util.quotientList(List<E> list, int n, int k)
[CLASS] class Util
[METRICS] loc=18 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] List<E>.size/0, List<E>.get/1
[NEW] IllegalArgumentException, AbstractList<E>
[EXCEPTIONS] throws IllegalArgumentException
[THROWS-WHEN] I... | class Util {
public static <E> List<E> quotientList( final List<E> list, final int n, final int k ) {
if ( n <= 0 || k < 0 || k >= n ) {
throw new IllegalArgumentException( "n must be positive; k must be between 0 and n - 1" );
}
final int size = (list.size() + n - k - 1) / n;
... | false | ok | {"focal": {"class": "Util", "name": "quotientList", "signature": "List<E> quotientList(List<E> list, int n, int k)", "start_line": 3, "modifiers": "public static", "params": [{"name": "list", "type": "List<E>"}, {"name": "n", "type": "int"}, {"name": "k", "type": "int"}], "return_type": "List<E>"}, "class_info": {"name... | |
166396744_4 | class Message {
public static byte[] encrypt(byte[] decrypted, SecretKeySpec aes) throws InvalidKeyException, IllegalArgumentException {
final ByteBuffer output = ByteBuffer.allocate(NONCE_SIZE + decrypted.length + OVERHEAD);
final Cipher cipher;
try {
cipher = Cipher.getInstanc... | System.out.println("MessageTest.encrypting a message: " + vector);
final byte[] want = Helper.combine(vector.getBytes("nonce"), vector.getBytes("ciphertext"));
final byte[] test = Message.encrypt(vector.getBytes("plaintext"), vector.getBytes("key"));
System.out.println("decrypted:");
... | [FOCAL] public static byte[] Message.encrypt(byte[] decrypted, SecretKeySpec aes)
[CLASS] class Message
[METRICS] loc=33 cc=6 branches=1 loops=0 returns=1 throws=5 nesting=2
[CALLS-EXTERNAL] ByteBuffer.allocate/1, Cipher.getInstance/1, IllegalBlockSizeException | BadPaddingException.getMessage/0, random.nextBytes/1, Ci... | /* static context
[FOCAL] public static byte[] Message.encrypt(byte[] decrypted, SecretKeySpec aes)
[THROWS-WHEN] IllegalArgumentException when try-body throws
[THROWS-WHEN] InvalidKeyException when try-body throws && aes.getAlgorithm() == ALGORITHM && aes.getEncoded().length > 16
[THROWS-WHEN] error when try-body thro... | /* static context
[FOCAL] public static byte[] Message.encrypt(byte[] decrypted, SecretKeySpec aes)
[THROWS-WHEN] IllegalArgumentException when try-body throws
[THROWS-WHEN] InvalidKeyException when try-body throws && aes.getAlgorithm() == ALGORITHM && aes.getEncoded().length > 16
[THROWS-WHEN] error when try-body thro... | true | ok | {"focal": {"class": "Message", "name": "encrypt", "signature": "byte[] encrypt(byte[] decrypted, SecretKeySpec aes) throws InvalidKeyException, IllegalArgumentException", "start_line": 3, "modifiers": "public static", "params": [{"name": "decrypted", "type": "byte[]"}, {"name": "aes", "type": "SecretKeySpec"}], "return... |
166411274_1 | class ZooKeeperGroupMembershipHandler implements GroupMembershipHandler, AutoCloseable {
@Override
public void watchEvent(String eventId, EventCallback callback) {
try {
final String path = "/proxy/events";
final String eventpath = "/proxy/events/" + eventId;
LOG.in... | try (TestingServer testingServer = new TestingServer(2229, tmpDir.newFolder());) {
testingServer.start();
try (ZooKeeperGroupMembershipHandler peer1 = new ZooKeeperGroupMembershipHandler(testingServer.getConnectString(),
6000, false /*acl */, peerId1, Collections.EMPT... | [FOCAL] @Override public void ZooKeeperGroupMembershipHandler.watchEvent(String eventId, EventCallback callback)
[CLASS] class ZooKeeperGroupMembershipHandler implements GroupMembershipHandler, AutoCloseable
[METRICS] loc=36 cc=2 branches=0 loops=0 returns=0 throws=1 nesting=4
[CALLS-EXTERNAL] LOG.info/1, watchedEvents... | /* static context
[FOCAL] @Override public void ZooKeeperGroupMembershipHandler.watchEvent(String eventId, EventCallback callback)
[THROWS-WHEN] RuntimeException when try-body throws
[PATH1] try-body throws -> throw new RuntimeException(ex)
[COLLABORATORS] field watchedEvents add/1; field pcce getData/0,getType/0; fiel... | /* static context
[FOCAL] @Override public void ZooKeeperGroupMembershipHandler.watchEvent(String eventId, EventCallback callback)
[THROWS-WHEN] RuntimeException when try-body throws
[PATH1] try-body throws -> throw new RuntimeException(ex)
[COLLABORATORS] field watchedEvents add/1; field pcce getData/0,getType/0; fiel... | true | ok | {"focal": {"class": "ZooKeeperGroupMembershipHandler", "name": "watchEvent", "signature": "void watchEvent(String eventId, EventCallback callback)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "eventId", "type": "String"}, {"name": "callback", "type": "EventCallback"}], "return_type": "void"},... |
166515022_733 | class DecimalAverageAggregation extends SqlAggregationFunction {
@VisibleForTesting
public static BigDecimal average(LongDecimalWithOverflowAndLongState state, DecimalType type)
{
BigDecimal sum = new BigDecimal(Decimals.decodeUnscaledValue(state.getLongDecimal()), type.getScale());
BigDeci... | addToState(state, TWO.pow(126));
addToState(state, TWO.pow(126));
addToState(state, TWO.pow(125));
assertEquals(state.getOverflow(), 1);
assertEquals(state.getLongDecimal(), unscaledDecimal(TWO.pow(125)));
addToState(state, TWO.pow(126).negate());
addToState(sta... | [FOCAL] @VisibleForTesting public static BigDecimal DecimalAverageAggregation.average(LongDecimalWithOverflowAndLongState state, DecimalType type)
[CLASS] class DecimalAverageAggregation extends SqlAggregationFunction
[METRICS] loc=13 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] Decimals.decode... | /* static context
[FOCAL] @VisibleForTesting public static BigDecimal DecimalAverageAggregation.average(LongDecimalWithOverflowAndLongState state, DecimalType type)
[PATH1] if(state.getOverflow() != 0)=T -> return sum.divide(count, type.getScale(), ROUND_HALF_UP)
[PATH2] if(state.getOverflow() != 0)=F -> return sum.div... | /* static context
[FOCAL] @VisibleForTesting public static BigDecimal DecimalAverageAggregation.average(LongDecimalWithOverflowAndLongState state, DecimalType type)
[PATH1] if(state.getOverflow() != 0)=T -> return sum.divide(count, type.getScale(), ROUND_HALF_UP)
[PATH2] if(state.getOverflow() != 0)=F -> return sum.div... | true | ok | {"focal": {"class": "DecimalAverageAggregation", "name": "average", "signature": "BigDecimal average(LongDecimalWithOverflowAndLongState state, DecimalType type)", "start_line": 3, "modifiers": "@VisibleForTesting public static", "params": [{"name": "state", "type": "LongDecimalWithOverflowAndLongState"}, {"name": "typ... |
166629127_1 | class TurtleSoup {
public static int calculatePolygonSidesFromAngle(double angle) {
throw new RuntimeException("implement me!");
}
public static void drawSquare(Turtle turtle, int sideLength);
public static double calculateRegularPolygonAngle(int sides);
public static void drawRegularPolyg... | assertEquals(3, TurtleSoup.calculatePolygonSidesFromAngle(60.0));
assertEquals(7, TurtleSoup.calculatePolygonSidesFromAngle(128.57));
assertEquals(5, TurtleSoup.calculatePolygonSidesFromAngle(108.0));
}
} | [FOCAL] public static int TurtleSoup.calculatePolygonSidesFromAngle(double angle)
[CLASS] class TurtleSoup
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=1 nesting=0
[NEW] RuntimeException
[EXCEPTIONS] throws RuntimeException
[THROWS-WHEN] RuntimeException when always
[INPUTS] branches=- | result=- | unused=a... | /* static context
[FOCAL] public static int TurtleSoup.calculatePolygonSidesFromAngle(double angle)
[THROWS-WHEN] RuntimeException when always
[INPUTS] branches=- | result=- | unused=angle
[EXCEPTIONS] throws RuntimeException
[NEW] RuntimeException
*/
| /* static context
[FOCAL] public static int TurtleSoup.calculatePolygonSidesFromAngle(double angle)
[THROWS-WHEN] RuntimeException when always
[INPUTS] branches=- | result=- | unused=angle
[EXCEPTIONS] throws RuntimeException
[NEW] RuntimeException
*/
class TurtleSoup {
public static int calculatePolygonSidesFromA... | true | ok | {"focal": {"class": "TurtleSoup", "name": "calculatePolygonSidesFromAngle", "signature": "int calculatePolygonSidesFromAngle(double angle)", "start_line": 3, "modifiers": "public static", "params": [{"name": "angle", "type": "double"}], "return_type": "int"}, "class_info": {"name": "TurtleSoup", "kind": "class", "modif... |
166637026_9 | class BucketWriter {
public synchronized void append(final Event event)
throws IOException, InterruptedException {
checkAndThrowInterruptedException();
// If idleFuture is not null, cancel it before we move forward to avoid a
// close call in the middle of the append.
if (idleFuture != null... | int maxBytes = 300;
MockHDFSWriter hdfsWriter = new MockHDFSWriter();
BucketWriter bucketWriter = new BucketWriter(
0, maxBytes, 0, 0, ctx, "/tmp", "file", "", ".tmp", null, null,
SequenceFile.CompressionType.NONE, hdfsWriter, timedRollerPool, proxy,
new SinkCounter("test-bucket-writ... | [FOCAL] public synchronized void BucketWriter.append(Event event)
[CLASS] class BucketWriter
[METRICS] loc=95 cc=15 branches=10 loops=0 returns=0 throws=2 nesting=4
[CALLS-INTERNAL] T callWithTimeout(CallRunner<T> callRunner); boolean shouldRotate(); void checkAndThrowInterruptedException(); void close(); void close(bo... | /* static context
[FOCAL] public synchronized void BucketWriter.append(Event event)
[THROWS-WHEN] BucketClosedException when idleFuture != null && !idleFuture.isDone() && try-body throws && !isOpen && closed
[THROWS-WHEN] e when idleFuture != null && !idleFuture.isDone() && try-body throws && !isOpen && !closed && shou... | /* static context
[FOCAL] public synchronized void BucketWriter.append(Event event)
[THROWS-WHEN] BucketClosedException when idleFuture != null && !idleFuture.isDone() && try-body throws && !isOpen && closed
[THROWS-WHEN] e when idleFuture != null && !idleFuture.isDone() && try-body throws && !isOpen && !closed && shou... | true | ok | {"focal": {"class": "BucketWriter", "name": "append", "signature": "void append(Event event) throws IOException, InterruptedException", "start_line": 3, "modifiers": "public synchronized", "params": [{"name": "event", "type": "Event"}], "return_type": "void"}, "class_info": {"name": "BucketWriter", "kind": "class", "mo... |
166956579_6 | class ConsumeMediaTypeExpression extends AbstractMediaTypeExpression {
public final boolean match(MediaType contentType) {
boolean match = getMediaType().includes(contentType);
return (!isNegated() ? match : !match);
}
ConsumeMediaTypeExpression(String expression);
ConsumeMediaType... | ConsumeMediaTypeExpression expression = createExpression(MediaType.ALL_VALUE);
Assert.assertTrue(expression.match(MediaType.APPLICATION_JSON_UTF8));
expression = createExpression(MediaType.APPLICATION_JSON_VALUE);
Assert.assertTrue(expression.match(MediaType.APPLICATION_JSON_UTF8));
... | [FOCAL] public final boolean ConsumeMediaTypeExpression.match(MediaType contentType)
[CLASS] class ConsumeMediaTypeExpression extends AbstractMediaTypeExpression
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] getMediaType().includes/1, getMediaType/0 (inherited), isNegated/0 (inhe... | /* static context
[FOCAL] public final boolean ConsumeMediaTypeExpression.match(MediaType contentType)
[INPUTS] branches=- | result=contentType
[CALLS-EXTERNAL] getMediaType().includes/1, getMediaType/0 (inherited), isNegated/0 (inherited)
*/
| /* static context
[FOCAL] public final boolean ConsumeMediaTypeExpression.match(MediaType contentType)
[INPUTS] branches=- | result=contentType
[CALLS-EXTERNAL] getMediaType().includes/1, getMediaType/0 (inherited), isNegated/0 (inherited)
*/
class ConsumeMediaTypeExpression extends AbstractMediaTypeExpression {
p... | true | ok | {"focal": {"class": "ConsumeMediaTypeExpression", "name": "match", "signature": "boolean match(MediaType contentType)", "start_line": 3, "modifiers": "public final", "params": [{"name": "contentType", "type": "MediaType"}], "return_type": "boolean"}, "class_info": {"name": "ConsumeMediaTypeExpression", "kind": "class",... |
167216638_260 | class OAuth2ApplicationScopeAliasesResolversImpl implements OAuth2ApplicationScopeAliasesResolvers {
@Override
public DataFetcher<OAuth2ApplicationScopeAliases> createOAuth2ApplicationScopeAliasesDataFetcher() {
return environment -> {
long companyId = util.getLongArg(environment, "companyI... | // Given
Map<String, Object> arguments = new HashMap<>();
arguments.put("companyId", COMPANY_ID);
arguments.put("userId", USER_ID);
arguments.put("userName", USER_NAME);
arguments.put("oAuth2ApplicationId", OAUTH2_APPLICATION_ID);
arguments.put("scopeAliasesList",... | [FOCAL] @Override public DataFetcher<OAuth2ApplicationScopeAliases> OAuth2ApplicationScopeAliasesResolversImpl.createOAuth2ApplicationScopeAliasesDataFetcher()
[CLASS] class OAuth2ApplicationScopeAliasesResolversImpl implements OAuth2ApplicationScopeAliasesResolvers
[METRICS] loc=17 cc=1 branches=0 loops=0 returns=1 th... | /* static context
[FOCAL] @Override public DataFetcher<OAuth2ApplicationScopeAliases> OAuth2ApplicationScopeAliasesResolversImpl.createOAuth2ApplicationScopeAliasesDataFetcher()
[COLLABORATORS] field util getLongArg/2,getLongArg/3,getDefaultUserId/0,getStringArg/2,getStringArrayArg/2; field oAuth2ApplicationScopeAliase... | /* static context
[FOCAL] @Override public DataFetcher<OAuth2ApplicationScopeAliases> OAuth2ApplicationScopeAliasesResolversImpl.createOAuth2ApplicationScopeAliasesDataFetcher()
[COLLABORATORS] field util getLongArg/2,getLongArg/3,getDefaultUserId/0,getStringArg/2,getStringArrayArg/2; field oAuth2ApplicationScopeAliase... | true | ok | {"focal": {"class": "OAuth2ApplicationScopeAliasesResolversImpl", "name": "createOAuth2ApplicationScopeAliasesDataFetcher", "signature": "DataFetcher<OAuth2ApplicationScopeAliases> createOAuth2ApplicationScopeAliasesDataFetcher()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "DataFetc... |
167261547_272 | class Acl {
public Set<Principal> getDeniedReaders() {
return getClonedCopy(deniedReaders, ImmutableSet.toImmutableSet());
}
private Acl(Builder builder);
public Set<Principal> getReaders();
public Set<Principal> getOwners();
public String getInheritFrom();
public String getInheritFromFragment();
... | Acl acl = new Acl.Builder()
.setReaders(user("AllowedUser1", "AllowedUser2"))
.setDeniedReaders(group("DeniedGroup"))
.setOwners(user("AllowedUser1"))
.build();
assertEquals(group("DeniedGroup"), acl.getDeniedReaders());
thrown.expect(UnsupportedOperationException.class);
... | [FOCAL] public Set<Principal> Acl.getDeniedReaders()
[CLASS] class Acl
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] T getClonedCopy(ImmutableSet<Principal> principals, Collector<Principal, ?, T> collector)
[CALLS-EXTERNAL] ImmutableSet.toImmutableSet/0
[CLASS-MEMBERS] Acl(Builde... | /* static context
[FOCAL] public Set<Principal> Acl.getDeniedReaders()
[CALLS-INTERNAL] T getClonedCopy(ImmutableSet<Principal> principals, Collector<Principal, ?, T> collector)
[CALLS-EXTERNAL] ImmutableSet.toImmutableSet/0
*/
| /* static context
[FOCAL] public Set<Principal> Acl.getDeniedReaders()
[CALLS-INTERNAL] T getClonedCopy(ImmutableSet<Principal> principals, Collector<Principal, ?, T> collector)
[CALLS-EXTERNAL] ImmutableSet.toImmutableSet/0
*/
class Acl {
public Set<Principal> getDeniedReaders() {
return getClonedCopy(deniedRea... | true | ok | {"focal": {"class": "Acl", "name": "getDeniedReaders", "signature": "Set<Principal> getDeniedReaders()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Set<Principal>"}, "class_info": {"name": "Acl", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "re... |
167412136_28 | class NewsViewModel extends ViewModel {
public void fetchNews() {
disposable.add(apiClient.fetchNews()
.doOnEvent((newsList, throwable) -> onLoading())
.compose(rxSingleSchedulers.applySchedulers())
.subscribe(this::onSuccess,
this::on... | // Mock API response
when(apiClient.fetchNews()).thenReturn(Single.just(new NewsList()));
viewModel.fetchNews();
verify(observer).onChanged(NewsListViewState.LOADING_STATE);
verify(observer).onChanged(NewsListViewState.SUCCESS_STATE);
}
} | [FOCAL] public void NewsViewModel.fetchNews()
[CLASS] class NewsViewModel extends ViewModel
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] void onLoading()
[CALLS-EXTERNAL] disposable.add/1, apiClient.fetchNews() .doOnEvent((newsList, throwable) ->....subscribe/2, apiClient.fetchN... | /* static context
[FOCAL] public void NewsViewModel.fetchNews()
[COLLABORATORS] field disposable add/1; field apiClient:NewsApiClient fetchNews/0; field rxSingleSchedulers applySchedulers/0
[CALLS-INTERNAL] void onLoading()
[FIELDS] read=apiClient:NewsApiClient
[CALLS-EXTERNAL] disposable.add/1, apiClient.fetchNews() .... | /* static context
[FOCAL] public void NewsViewModel.fetchNews()
[COLLABORATORS] field disposable add/1; field apiClient:NewsApiClient fetchNews/0; field rxSingleSchedulers applySchedulers/0
[CALLS-INTERNAL] void onLoading()
[FIELDS] read=apiClient:NewsApiClient
[CALLS-EXTERNAL] disposable.add/1, apiClient.fetchNews() .... | true | ok | {"focal": {"class": "NewsViewModel", "name": "fetchNews", "signature": "void fetchNews()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "NewsViewModel", "kind": "class", "modifiers": "", "superclass": "ViewModel", "interfaces": null, "fields": [{"name": "instantEx... |
167431476_86 | class ChatCommandsPlugin extends Plugin {
@Subscribe
public void onChatMessage(ChatMessage chatMessage)
{
if (chatMessage.getType() != ChatMessageType.SERVER && chatMessage.getType() != ChatMessageType.FILTERED)
{
return;
}
String message = chatMessage.getMessage();
Matcher matcher = KILLCOUNT_PATTERN... | when(client.getUsername()).thenReturn("Adam");
ChatMessage chatMessageEvent = new ChatMessage(null, SERVER, "", "Your Corporeal Beast kill count is: <col=ff0000>4</col>.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessageEvent);
verify(configManager).setConfiguration("killcount.adam", "corporeal beast", ... | [FOCAL] @Subscribe public void ChatCommandsPlugin.onChatMessage(ChatMessage chatMessage)
[CLASS] class ChatCommandsPlugin extends Plugin
[METRICS] loc=64 cc=9 branches=8 loops=0 returns=3 throws=0 nesting=2
[CALLS-INTERNAL] void matchPb(Matcher matcher); void setKc(String boss, int killcount)
[CALLS-EXTERNAL] ChatMessa... | /* static context
[FOCAL] @Subscribe public void ChatCommandsPlugin.onChatMessage(ChatMessage chatMessage)
[PATH1] if(chatMessage.getType() != ChatMessageType.SERVER && chatMessage.getType() != ChatMessageType.FILTERED)=F -> if(matcher.find())#1=F -> if(matcher.find())#2=T -> if(matcher.find())#3=F -> if(matcher.find()... | /* static context
[FOCAL] @Subscribe public void ChatCommandsPlugin.onChatMessage(ChatMessage chatMessage)
[PATH1] if(chatMessage.getType() != ChatMessageType.SERVER && chatMessage.getType() != ChatMessageType.FILTERED)=F -> if(matcher.find())#1=F -> if(matcher.find())#2=T -> if(matcher.find())#3=F -> if(matcher.find()... | true | ok | {"focal": {"class": "ChatCommandsPlugin", "name": "onChatMessage", "signature": "void onChatMessage(ChatMessage chatMessage)", "start_line": 3, "modifiers": "@Subscribe public", "params": [{"name": "chatMessage", "type": "ChatMessage"}], "return_type": "void"}, "class_info": {"name": "ChatCommandsPlugin", "kind": "clas... |
167468844_0 | class App {
public static List<URL> getResources(String name) throws IOException {
final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
return Collections.list(classLoader.getResources(name));
}
public static void main(String[] args);
}
class AppTest {
@Test
public void shouldSo... |
// act
final List<URL> resources = getResources("folder/subfolder");
// assert
assertFalse(resources.isEmpty());
assertTrue(resources.get(0).toString().contains("subfolder"));
}
} | [FOCAL] public static List<URL> App.getResources(String name)
[CLASS] class App
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Thread.currentThread().getContextClassLoader/0, Thread.currentThread/0, Collections.list/1, ClassLoader.getResources/1
[EXCEPTIONS] declares IOException
[... | /* static context
[FOCAL] public static List<URL> App.getResources(String name)
[INPUTS] branches=- | result=name
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] Thread.currentThread().getContextClassLoader/0, Thread.currentThread/0, Collections.list/1, ClassLoader.getResources/1
*/
| /* static context
[FOCAL] public static List<URL> App.getResources(String name)
[INPUTS] branches=- | result=name
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] Thread.currentThread().getContextClassLoader/0, Thread.currentThread/0, Collections.list/1, ClassLoader.getResources/1
*/
class App {
public static List<... | true | ok | {"focal": {"class": "App", "name": "getResources", "signature": "List<URL> getResources(String name) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "name", "type": "String"}], "return_type": "List<URL>"}, "class_info": {"name": "App", "kind": "class", "modifiers": "", "superclas... |
167492840_26 | class CellStsUtils {
public static String getIssuerName(String cellName, String namespace) {
if (StringUtils.isEmpty(namespace)) {
namespace = Constants.DEFAULT_NAMESPACE;
}
if (cellName.equals(Constants.COMPOSITE_CELL_NAME)) {
return new StringBuilder(cellName).app... |
Assert.assertEquals(CellStsUtils.getIssuerName("hr", "ns1"), new StringBuilder("hr")
.append(Constants.STS_SERVICE).append(".").append("ns1").toString());
}
} | [FOCAL] public static String CellStsUtils.getIssuerName(String cellName, String namespace)
[CLASS] class CellStsUtils
[METRICS] loc=13 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] StringUtils.isEmpty/1, String.equals/1, new StringBuilder(cellName).append(Constants.STS_SERVICE)....toString/0, ne... | /* static context
[FOCAL] public static String CellStsUtils.getIssuerName(String cellName, String namespace)
[PATH1] if(StringUtils.isEmpty(namespace))=T -> if(cellName.equals(Constants.COMPOSITE_CELL_NAME))=T -> return new StringBuilder(cellName).append(Constants.STS_SERVICE).append("....
[PATH2] if(StringUtils.isEmpt... | /* static context
[FOCAL] public static String CellStsUtils.getIssuerName(String cellName, String namespace)
[PATH1] if(StringUtils.isEmpty(namespace))=T -> if(cellName.equals(Constants.COMPOSITE_CELL_NAME))=T -> return new StringBuilder(cellName).append(Constants.STS_SERVICE).append("....
[PATH2] if(StringUtils.isEmpt... | true | ok | {"focal": {"class": "CellStsUtils", "name": "getIssuerName", "signature": "String getIssuerName(String cellName, String namespace)", "start_line": 3, "modifiers": "public static", "params": [{"name": "cellName", "type": "String"}, {"name": "namespace", "type": "String"}], "return_type": "String"}, "class_info": {"name"... |
167560273_3 | class Invariant {
boolean isNewYearEve(LocalDate date) {
return date.getDayOfMonth() == 31 && date.getMonthValue() == 12;
}
private Invariant cut;
}
class InvariantTest {
private Invariant cut;
@Test
public void _2018_08_31() {
| assertThat(cut.isNewYearEve(LocalDate.of(2018, 8, 31))).isFalse();
}
} | [FOCAL] boolean Invariant.isNewYearEve(LocalDate date)
[CLASS] class Invariant
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] LocalDate.getDayOfMonth/0, LocalDate.getMonthValue/0
[INPUTS] branches=- | result=date
[COLLABORATORS] param date:LocalDate getDayOfMonth/0,getMonthValue/0... | /* static context
[FOCAL] boolean Invariant.isNewYearEve(LocalDate date)
[INPUTS] branches=- | result=date
[COLLABORATORS] param date:LocalDate getDayOfMonth/0,getMonthValue/0
[CALLS-EXTERNAL] LocalDate.getDayOfMonth/0, LocalDate.getMonthValue/0
*/
| /* static context
[FOCAL] boolean Invariant.isNewYearEve(LocalDate date)
[INPUTS] branches=- | result=date
[COLLABORATORS] param date:LocalDate getDayOfMonth/0,getMonthValue/0
[CALLS-EXTERNAL] LocalDate.getDayOfMonth/0, LocalDate.getMonthValue/0
*/
class Invariant {
boolean isNewYearEve(LocalDate date) {
return ... | true | ok | {"focal": {"class": "Invariant", "name": "isNewYearEve", "signature": "boolean isNewYearEve(LocalDate date)", "start_line": 3, "modifiers": "", "params": [{"name": "date", "type": "LocalDate"}], "return_type": "boolean"}, "class_info": {"name": "Invariant", "kind": "class", "modifiers": "", "superclass": null, "interfa... |
167634307_0 | class EventRegistrationService {
@Transactional
public Person createPerson(String name) {
if (name == null || name.trim().length() == 0) {
throw new IllegalArgumentException("Person name cannot be empty!");
} else if (personRepository.existsById(name)) {
throw new IllegalArgumentException("Person has alrea... | assertEquals(0, service.getAllPersons().size());
String name = "Oscar";
try {
service.createPerson(name);
} catch (IllegalArgumentException e) {
// Check that no error occurred
fail();
}
List<Person> allPersons = service.getAllPersons();
assertEquals(1, allPersons.size());
assertEquals(name... | [FOCAL] @Transactional public Person EventRegistrationService.createPerson(String name)
[CLASS] class EventRegistrationService
[METRICS] loc=12 cc=3 branches=2 loops=0 returns=1 throws=2 nesting=2
[CALLS-EXTERNAL] name.trim().length/0, String.trim/0, PersonRepository.existsById/1, Person.setName/1, PersonRepository.sav... | /* static context
[FOCAL] @Transactional public Person EventRegistrationService.createPerson(String name)
[THROWS-WHEN] IllegalArgumentException when name == null || name.trim().length() == 0
[THROWS-WHEN] IllegalArgumentException when !(name == null || name.trim().length() == 0) && personRepository.existsById(name)
[P... | /* static context
[FOCAL] @Transactional public Person EventRegistrationService.createPerson(String name)
[THROWS-WHEN] IllegalArgumentException when name == null || name.trim().length() == 0
[THROWS-WHEN] IllegalArgumentException when !(name == null || name.trim().length() == 0) && personRepository.existsById(name)
[P... | true | ok | {"focal": {"class": "EventRegistrationService", "name": "createPerson", "signature": "Person createPerson(String name)", "start_line": 3, "modifiers": "@Transactional public", "params": [{"name": "name", "type": "String"}], "return_type": "Person"}, "class_info": {"name": "EventRegistrationService", "kind": "class", "m... |
167954168_7 | class UserRepository {
public Completable deleteUser() {
return Completable.fromAction(userDao::deleteAll);
}
@Inject UserRepository(UserDao userDao);
public Single<UserEntity> getUser();
public Completable putOrPostUser(String userName, String password);
@Mock
private UserDao u... | repo.deleteUser()
.test()
.assertComplete();
}
} | [FOCAL] public Completable UserRepository.deleteUser()
[CLASS] class UserRepository
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Completable.fromAction/1
[FIELDS] read=userDao:UserDao
[INPUTS] branches=- | result=userDao
[DATAFLOW] this.userDao@param->L2
[CLASS-MEMBERS] UserRepo... | /* static context
[FOCAL] public Completable UserRepository.deleteUser()
[INPUTS] branches=- | result=userDao
[FIELDS] read=userDao:UserDao
[CALLS-EXTERNAL] Completable.fromAction/1
*/
| /* static context
[FOCAL] public Completable UserRepository.deleteUser()
[INPUTS] branches=- | result=userDao
[FIELDS] read=userDao:UserDao
[CALLS-EXTERNAL] Completable.fromAction/1
*/
class UserRepository {
public Completable deleteUser() {
return Completable.fromAction(userDao::deleteAll);
}
@In... | true | ok | {"focal": {"class": "UserRepository", "name": "deleteUser", "signature": "Completable deleteUser()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Completable"}, "class_info": {"name": "UserRepository", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name":... |
168063420_0 | class CfSpringCloudConfigClientProcessor implements CfEnvProcessor {
@Override
public boolean accept(CfService service) {
return service.existsByTagIgnoreCase("configuration");
}
@Override public void process(CfCredentials cfCredentials, Map<String, Object> properties);
@Override public CfEnvProcessorPropertie... | boolean actual = configClientProcessor.accept(configServerService);
assertThat(actual).isTrue();
}
} | [FOCAL] @Override public boolean CfSpringCloudConfigClientProcessor.accept(CfService service)
[CLASS] class CfSpringCloudConfigClientProcessor implements CfEnvProcessor
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] CfService.existsByTagIgnoreCase/1
[INPUTS] branches=- | result=se... | /* static context
[FOCAL] @Override public boolean CfSpringCloudConfigClientProcessor.accept(CfService service)
[INPUTS] branches=- | result=service
[COLLABORATORS] param service:CfService existsByTagIgnoreCase/1
[CALLS-EXTERNAL] CfService.existsByTagIgnoreCase/1
*/
| /* static context
[FOCAL] @Override public boolean CfSpringCloudConfigClientProcessor.accept(CfService service)
[INPUTS] branches=- | result=service
[COLLABORATORS] param service:CfService existsByTagIgnoreCase/1
[CALLS-EXTERNAL] CfService.existsByTagIgnoreCase/1
*/
class CfSpringCloudConfigClientProcessor implements C... | true | ok | {"focal": {"class": "CfSpringCloudConfigClientProcessor", "name": "accept", "signature": "boolean accept(CfService service)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "service", "type": "CfService"}], "return_type": "boolean"}, "class_info": {"name": "CfSpringCloudConfigClientProcessor", "k... |
168190985_181 | class DeviceLowBatteryGenerator extends AlertGenerator {
@Override
protected void handleModelChanged(SubsystemContext<PlaceMonitorSubsystemModel> context, Model model, AlertScratchPad scratchPad) {
Map<String, Date> lowBatteries = context.model().getLowBatteryNotificationSent();
// remove all previo... | replay();
Map<String, Date> lowBattery = ImmutableMap.of(lock.getAddress().getRepresentation(), new Date());
model.setLowBatteryNotificationSent(lowBattery);
generator.handleModelChanged(context, model, scratchPad);
String key = AlertKeys.key(SmartHomeAlert.ALERTTYPE_DEV_WARN_BATTERY_LOW,... | [FOCAL] @Override protected void DeviceLowBatteryGenerator.handleModelChanged(SubsystemContext<PlaceMonitorSubsystemModel> context, Model model, AlertScratchPad scratchPad)
[CLASS] class DeviceLowBatteryGenerator extends AlertGenerator
[METRICS] loc=12 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNA... | /* static context
[FOCAL] @Override protected void DeviceLowBatteryGenerator.handleModelChanged(SubsystemContext<PlaceMonitorSubsystemModel> context, Model model, AlertScratchPad scratchPad)
[INPUTS] branches=- | result=- | unused=model
[COLLABORATORS] param context:SubsystemContext<PlaceMonitorSubsystemModel> model/0;... | /* static context
[FOCAL] @Override protected void DeviceLowBatteryGenerator.handleModelChanged(SubsystemContext<PlaceMonitorSubsystemModel> context, Model model, AlertScratchPad scratchPad)
[INPUTS] branches=- | result=- | unused=model
[COLLABORATORS] param context:SubsystemContext<PlaceMonitorSubsystemModel> model/0;... | true | ok | {"focal": {"class": "DeviceLowBatteryGenerator", "name": "handleModelChanged", "signature": "void handleModelChanged(SubsystemContext<PlaceMonitorSubsystemModel> context, Model model, AlertScratchPad scratchPad)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "context", "type": "SubsystemCont... |
168419532_1 | class ServiceHelper {
public static Properties getLocalProperties(String fileName) {
Properties properties = new Properties();
InputStream inputStream = ServiceHelper.class.getClassLoader().getResourceAsStream(fileName);
try {
properties.load(inputStream);
} catch (IOExc... |
String apikey = ServiceHelper.getLocalProperties("local.properties").getProperty("cloudant_apikey");
String host = ServiceHelper.getLocalProperties("local.properties").getProperty("cloudant_host");
// assertEquals("SOMETHING", apikey);
// assertEquals("SOMETHING", host);
}
} | [FOCAL] public static Properties ServiceHelper.getLocalProperties(String fileName)
[CLASS] class ServiceHelper
[METRICS] loc=10 cc=2 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] ServiceHelper.class.getClassLoader().getResourceAsStream/1, ServiceHelper.class.getClassLoader/0, Properties.load/1, IOExc... | /* static context
[FOCAL] public static Properties ServiceHelper.getLocalProperties(String fileName)
[PATH1] try-body throws -> return properties
[EXCEPTIONS] catches IOException e
[NEW] Properties
[CALLS-EXTERNAL] ServiceHelper.class.getClassLoader().getResourceAsStream/1, ServiceHelper.class.getClassLoader/0, Propert... | /* static context
[FOCAL] public static Properties ServiceHelper.getLocalProperties(String fileName)
[PATH1] try-body throws -> return properties
[EXCEPTIONS] catches IOException e
[NEW] Properties
[CALLS-EXTERNAL] ServiceHelper.class.getClassLoader().getResourceAsStream/1, ServiceHelper.class.getClassLoader/0, Propert... | true | ok | {"focal": {"class": "ServiceHelper", "name": "getLocalProperties", "signature": "Properties getLocalProperties(String fileName)", "start_line": 3, "modifiers": "public static", "params": [{"name": "fileName", "type": "String"}], "return_type": "Properties"}, "class_info": {"name": "ServiceHelper", "kind": "class", "mod... |
168531964_0 | class StringNaturalCompare implements Comparator<String> {
public int compare(String s1, String s2)
{
int result = strnatcmp0(s1, s2, true);
return(result);
}
private static int compareRight(String s1, int ind1, String s2, int ind2);
public static int compareLeft(String s1, int ind... | Comparator<String> comp = new StringNaturalCompare();
String str1 = "1";
String str2 = "2";
assertEquals("string natural comparison error for " + str1 + " " + str2, -1, comp.compare(str1, str2));
str1 = "u1";
str2 = "u2";
assertEquals("string natural comparison er... | [FOCAL] public int StringNaturalCompare.compare(String s1, String s2)
[CLASS] class StringNaturalCompare implements Comparator<String>
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] int strnatcmp0(String s1, String s2, boolean fold_case)
[INPUTS] branches=- | result=s1, s2
[DATAFL... | /* static context
[FOCAL] public int StringNaturalCompare.compare(String s1, String s2)
[INPUTS] branches=- | result=s1, s2
[CALLS-INTERNAL] int strnatcmp0(String s1, String s2, boolean fold_case)
*/
| /* static context
[FOCAL] public int StringNaturalCompare.compare(String s1, String s2)
[INPUTS] branches=- | result=s1, s2
[CALLS-INTERNAL] int strnatcmp0(String s1, String s2, boolean fold_case)
*/
class StringNaturalCompare implements Comparator<String> {
public int compare(String s1, String s2)
{
i... | true | ok | {"focal": {"class": "StringNaturalCompare", "name": "compare", "signature": "int compare(String s1, String s2)", "start_line": 3, "modifiers": "public", "params": [{"name": "s1", "type": "String"}, {"name": "s2", "type": "String"}], "return_type": "int"}, "class_info": {"name": "StringNaturalCompare", "kind": "class", ... |
168665843_2 | class BookController {
@PatchMapping("/books/{id}")
Book patch(@RequestBody Map<String, String> update, @PathVariable Long id) {
return repository.findById(id)
.map(x -> {
String author = update.get("author");
if (!StringUtils.isEmpty(author)) {... |
String patchInJson = "{\"price\":\"99.99\"}";
mockMvc.perform(patch("/books/1")
.content(patchInJson)
.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON))
.andExpect(status().isMethodNotAllowed());
verify(mockRepository, times(1)).find... | [FOCAL] @PatchMapping("/books/{id}") Book BookController.patch(Map<String, String> update, Long id)
[CLASS] class BookController
[METRICS] loc=22 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] repository.findById(id) .map(x -> { String author = updat....orElseGet/1, repository.findById(id).map/1,... | /* static context
[FOCAL] @PatchMapping("/books/{id}") Book BookController.patch(Map<String, String> update, Long id)
[INPUTS] branches=- | result=id, update
[COLLABORATORS] field repository findById/1,save/1; param update:Map<String, String> get/1,keySet/0; field x setAuthor/1
[NEW] BookUnSupportedFieldPatchException,... | /* static context
[FOCAL] @PatchMapping("/books/{id}") Book BookController.patch(Map<String, String> update, Long id)
[INPUTS] branches=- | result=id, update
[COLLABORATORS] field repository findById/1,save/1; param update:Map<String, String> get/1,keySet/0; field x setAuthor/1
[NEW] BookUnSupportedFieldPatchException,... | true | ok | {"focal": {"class": "BookController", "name": "patch", "signature": "Book patch(Map<String, String> update, Long id)", "start_line": 3, "modifiers": "@PatchMapping(\"/books/{id}\")", "params": [{"name": "update", "type": "Map<String, String>"}, {"name": "id", "type": "Long"}], "return_type": "Book"}, "class_info": {"na... |
169045057_4 | class EmployeeService {
public List<Employee> allInFRIR() {
return this.employeeRepository.findAll(EmployeeSpecifications.workInDepartmentFRIR);
}
public EmployeeService(EmployeeRepository employeeRepository);
public List<Employee> allOlderThen20();
public List<Employee> allOlderThen20In... | var inFrir = employeeService.allInFRIR();
Assert.assertTrue(inFrir.stream().allMatch(emp -> emp.getDepartment().getName().equals("FRIR")));
Assert.assertEquals(2, inFrir.size());
}
} | [FOCAL] public List<Employee> EmployeeService.allInFRIR()
[CLASS] class EmployeeService
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] this.employeeRepository.findAll/1
[FIELDS] read=employeeRepository
[COLLABORATORS] field employeeRepository findAll/1
[CLASS-MEMBERS] EmployeeServ... | /* static context
[FOCAL] public List<Employee> EmployeeService.allInFRIR()
[COLLABORATORS] field employeeRepository findAll/1
[FIELDS] read=employeeRepository
[CALLS-EXTERNAL] this.employeeRepository.findAll/1
*/
| /* static context
[FOCAL] public List<Employee> EmployeeService.allInFRIR()
[COLLABORATORS] field employeeRepository findAll/1
[FIELDS] read=employeeRepository
[CALLS-EXTERNAL] this.employeeRepository.findAll/1
*/
class EmployeeService {
public List<Employee> allInFRIR() {
return this.employeeRepository.fi... | true | ok | {"focal": {"class": "EmployeeService", "name": "allInFRIR", "signature": "List<Employee> allInFRIR()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<Employee>"}, "class_info": {"name": "EmployeeService", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"... |
169045197_5 | class RabbitMqBeanPostProcessor implements BeanPostProcessor {
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName)
throws BeansException {
if (bean instanceof SimpleRabbitListenerContainerFactory) {
SimpleRabbitListenerContainerFactory factory = (SimpleRabbitListen... | // given
Object object = new Object();
// when
Object result = rabbitMqBeanPostProcessor.postProcessBeforeInitialization(object, "object");
// then
assertThat(result).isNotNull();
assertThat(result).isSameAs(object);
}
} | [FOCAL] @Override public Object RabbitMqBeanPostProcessor.postProcessBeforeInitialization(Object bean, String beanName)
[CLASS] class RabbitMqBeanPostProcessor implements BeanPostProcessor
[METRICS] loc=12 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] void registerIdempotentInterceptor(SimpleRab... | /* static context
[FOCAL] @Override public Object RabbitMqBeanPostProcessor.postProcessBeforeInitialization(Object bean, String beanName)
[PATH1] if(bean instanceof SimpleRabbitListenerContainerFactory)=F -> if(bean instanceof AbstractMessageListenerContainer)=T -> return bean
[PATH2] if(bean instanceof SimpleRabbitLis... | /* static context
[FOCAL] @Override public Object RabbitMqBeanPostProcessor.postProcessBeforeInitialization(Object bean, String beanName)
[PATH1] if(bean instanceof SimpleRabbitListenerContainerFactory)=F -> if(bean instanceof AbstractMessageListenerContainer)=T -> return bean
[PATH2] if(bean instanceof SimpleRabbitLis... | true | ok | {"focal": {"class": "RabbitMqBeanPostProcessor", "name": "postProcessBeforeInitialization", "signature": "Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "bean", "type": "Object"}, {"name": "beanName", "ty... |
169102492_121 | class JobQueueBatch implements Serializable {
public void setCompletedStatus(UUID aggregatorID) {
if (this.status != JobStatus.RUNNING) {
throw new JobQueueFailure(jobID, batchID, String.format("Cannot complete. JobStatus: %s", this.status));
}
if (!this.patients.isEmpty() && (t... | final var job = Mockito.spy(createJobQueueBatch());
job.status = JobStatus.RUNNING;
job.patientIndex = 2;
job.setCompletedStatus(aggregatorID);
assertEquals(JobStatus.COMPLETED, job.getStatus());
assertFalse(job.getAggregatorID().isPresent());
assertNotNull(job.... | [FOCAL] public void JobQueueBatch.setCompletedStatus(UUID aggregatorID)
[CLASS] class JobQueueBatch implements Serializable
[METRICS] loc=15 cc=3 branches=2 loops=0 returns=0 throws=2 nesting=1
[CALLS-INTERNAL] List<String> getPatients(); Optional<Integer> getPatientIndex(); void setUpdateTime(); void verifyAggregatorI... | /* static context
[FOCAL] public void JobQueueBatch.setCompletedStatus(UUID aggregatorID)
[THROWS-WHEN] JobQueueFailure when this.status != JobStatus.RUNNING
[THROWS-WHEN] JobQueueFailure when !(this.status != JobStatus.RUNNING) && !this.patients.isEmpty() && (this.patientIndex == null || this.getPatients().size() != t... | /* static context
[FOCAL] public void JobQueueBatch.setCompletedStatus(UUID aggregatorID)
[THROWS-WHEN] JobQueueFailure when this.status != JobStatus.RUNNING
[THROWS-WHEN] JobQueueFailure when !(this.status != JobStatus.RUNNING) && !this.patients.isEmpty() && (this.patientIndex == null || this.getPatients().size() != t... | true | ok | {"focal": {"class": "JobQueueBatch", "name": "setCompletedStatus", "signature": "void setCompletedStatus(UUID aggregatorID)", "start_line": 3, "modifiers": "public", "params": [{"name": "aggregatorID", "type": "UUID"}], "return_type": "void"}, "class_info": {"name": "JobQueueBatch", "kind": "class", "modifiers": "", "s... |
169158153_22 | class BasicHistogramAggregator extends ConcurrentMonoidIntTable implements Aggregator {
@Override
public void apply(final String[] tags, final long value, final long timestamp) {
super.apply(tags, value, timestamp);
}
public BasicHistogramAggregator(final String metricId, final DistributionBucket buckets... | DistributionBucket bucket = new DistributionBucket(new long[]{0, 10, 100});
final BasicHistogramAggregator table = new BasicHistogramAggregator("test", bucket, 128);
final Object lock = new Object();
synchronized (table) {
new Thread(() -> {
for (int i = 0; i < 64; i++) {
table.a... | [FOCAL] @Override public void BasicHistogramAggregator.apply(String[] tags, long value, long timestamp)
[CLASS] class BasicHistogramAggregator extends ConcurrentMonoidIntTable implements Aggregator
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] ConcurrentMonoidIntTable.apply/3
[DA... | /* static context
[FOCAL] @Override public void BasicHistogramAggregator.apply(String[] tags, long value, long timestamp)
[CALLS-EXTERNAL] ConcurrentMonoidIntTable.apply/3
*/
| /* static context
[FOCAL] @Override public void BasicHistogramAggregator.apply(String[] tags, long value, long timestamp)
[CALLS-EXTERNAL] ConcurrentMonoidIntTable.apply/3
*/
class BasicHistogramAggregator extends ConcurrentMonoidIntTable implements Aggregator {
@Override
public void apply(final String[] tags, fin... | true | ok | {"focal": {"class": "BasicHistogramAggregator", "name": "apply", "signature": "void apply(String[] tags, long value, long timestamp)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "tags", "type": "String[]"}, {"name": "value", "type": "long"}, {"name": "timestamp", "type": "long"}], "return_typ... |
169246391_13 | class InfluxLineProtocolRecordReader implements RecordReader {
@Override
public Record nextRecord(final boolean coerceTypes, final boolean dropUnknownFields)
throws IOException, MalformedRecordException {
String protocol = reader.readLine();
return mapInlineProtocol(protocol, coer... |
String data = "weather,location=us\\ midwest temperature=82 1465839830100400200";
RecordReader recordReader = readerFactory.createRecordReader(variables, toInputData(data), -1,logger);
Record record = recordReader.nextRecord();
Map tags = (Map) record.getValue(InfluxLineProtocolRecord... | [FOCAL] @Override public Record InfluxLineProtocolRecordReader.nextRecord(boolean coerceTypes, boolean dropUnknownFields)
[CLASS] class InfluxLineProtocolRecordReader implements RecordReader
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Record mapInlineProtocol(String protocol, b... | /* static context
[FOCAL] @Override public Record InfluxLineProtocolRecordReader.nextRecord(boolean coerceTypes, boolean dropUnknownFields)
[INPUTS] branches=- | result=coerceTypes, dropUnknownFields
[COLLABORATORS] field reader readLine/0
[EXCEPTIONS] declares IOException, MalformedRecordException
[CALLS-INTERNAL] Rec... | /* static context
[FOCAL] @Override public Record InfluxLineProtocolRecordReader.nextRecord(boolean coerceTypes, boolean dropUnknownFields)
[INPUTS] branches=- | result=coerceTypes, dropUnknownFields
[COLLABORATORS] field reader readLine/0
[EXCEPTIONS] declares IOException, MalformedRecordException
[CALLS-INTERNAL] Rec... | true | ok | {"focal": {"class": "InfluxLineProtocolRecordReader", "name": "nextRecord", "signature": "Record nextRecord(boolean coerceTypes, boolean dropUnknownFields) throws IOException, MalformedRecordException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "coerceTypes", "type": "boolean"}, {"name": "dr... |
169292412_2 | class ListHelper {
public static int getDefaultResolutionIndex(final Context context,
final List<VideoStream> videoStreams) {
String defaultResolution = computeDefaultResolution(context,
R.string.default_resolution_key, R.string.default_resolu... | List<VideoStream> testList = Arrays.asList(
new VideoStream("", MediaFormat.MPEG_4, /**/ "720p"),
new VideoStream("", MediaFormat.v3GPP, /**/ "240p"),
new VideoStream("", MediaFormat.WEBM, /**/ "480p"),
new VideoStream("", MediaFormat.WEBM... | [FOCAL] public static int ListHelper.getDefaultResolutionIndex(Context context, List<VideoStream> videoStreams)
[CLASS] class ListHelper
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String computeDefaultResolution(Context context, int key, int value); int getDefaultResolutionWit... | /* static context
[FOCAL] public static int ListHelper.getDefaultResolutionIndex(Context context, List<VideoStream> videoStreams)
[INPUTS] branches=- | result=context, videoStreams
[CALLS-INTERNAL] String computeDefaultResolution(Context context, int key, int value); int getDefaultResolutionWithDefaultFormat(Context co... | /* static context
[FOCAL] public static int ListHelper.getDefaultResolutionIndex(Context context, List<VideoStream> videoStreams)
[INPUTS] branches=- | result=context, videoStreams
[CALLS-INTERNAL] String computeDefaultResolution(Context context, int key, int value); int getDefaultResolutionWithDefaultFormat(Context co... | true | ok | {"focal": {"class": "ListHelper", "name": "getDefaultResolutionIndex", "signature": "int getDefaultResolutionIndex(Context context, List<VideoStream> videoStreams)", "start_line": 3, "modifiers": "public static", "params": [{"name": "context", "type": "Context"}, {"name": "videoStreams", "type": "List<VideoStream>"}], ... |
169318041_2 | class StartupLogger {
String getStartingMessage() {
StringBuilder sb = new StringBuilder();
String sdnRx = getVersionOf(Node.class).map(v -> "SDN/RX v" + v).orElse("an unknown version of SDN/RX");
String sdC = getVersionOf(AbstractMappingContext.class).map(v -> "Spring Data Commons v" + v)
.orElse("an unkn... |
String message = new StartupLogger(Mode.IMPERATIVE).getStartingMessage();
assertThat(message).matches(
"Bootstrapping imperative Neo4j repositories based on an unknown version of SDN\\/RX with Spring Data Commons v2\\.\\d+\\.\\d+.RELEASE and Neo4j Driver v4\\.\\d+\\.\\d+(?:-.*)\\.");
}
} | [FOCAL] String StartupLogger.getStartingMessage()
[CLASS] class StartupLogger
[METRICS] loc=17 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Optional<String> getVersionOf(Class<?> clazz)
[CALLS-EXTERNAL] getVersionOf(Node.class).map(v -> "SDN/RX v" + v).orElse/1, getVersionOf(Node.class).map/1, ... | /* static context
[FOCAL] String StartupLogger.getStartingMessage()
[CALLS-INTERNAL] Optional<String> getVersionOf(Class<?> clazz)
[NEW] StringBuilder
[CALLS-EXTERNAL] getVersionOf(Node.class).map(v -> "SDN/RX v" + v).orElse/1, getVersionOf(Node.class).map/1, getVersionOf(AbstractMappingContext.class).map(v -> "Spri...... | /* static context
[FOCAL] String StartupLogger.getStartingMessage()
[CALLS-INTERNAL] Optional<String> getVersionOf(Class<?> clazz)
[NEW] StringBuilder
[CALLS-EXTERNAL] getVersionOf(Node.class).map(v -> "SDN/RX v" + v).orElse/1, getVersionOf(Node.class).map/1, getVersionOf(AbstractMappingContext.class).map(v -> "Spri...... | true | ok | {"focal": {"class": "StartupLogger", "name": "getStartingMessage", "signature": "String getStartingMessage()", "start_line": 3, "modifiers": "", "params": [], "return_type": "String"}, "class_info": {"name": "StartupLogger", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "member... |
169410903_89 | class BasicAuthPasswordVariableAccessor extends VariableAccessor {
@Override
public Map<AttributeType, SetVariableValidator> getVariableValidators() {
return variableValidators;
}
public BasicAuthPasswordVariableAccessor(Station station, StationStore stationStore);
@Override public Strin... | SetVariableValidator setVariableValidator = basicAuthPasswordVariableAccessor.getVariableValidators().get(AttributeType.ACTUAL);
CiString1000 invalidPassword = new CiString1000("12345");
SetVariableResult result = setVariableValidator.validate(attributePath(), invalidPassword);
assert... | [FOCAL] @Override public Map<AttributeType, SetVariableValidator> BasicAuthPasswordVariableAccessor.getVariableValidators()
[CLASS] class BasicAuthPasswordVariableAccessor extends VariableAccessor
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] BasicAuthPasswordVariableAccessor(Stat... | /* static context
[FOCAL] @Override public Map<AttributeType, SetVariableValidator> BasicAuthPasswordVariableAccessor.getVariableValidators()
*/
| /* static context
[FOCAL] @Override public Map<AttributeType, SetVariableValidator> BasicAuthPasswordVariableAccessor.getVariableValidators()
*/
class BasicAuthPasswordVariableAccessor extends VariableAccessor {
@Override
public Map<AttributeType, SetVariableValidator> getVariableValidators() {
return ... | true | ok | {"focal": {"class": "BasicAuthPasswordVariableAccessor", "name": "getVariableValidators", "signature": "Map<AttributeType, SetVariableValidator> getVariableValidators()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Map<AttributeType, SetVariableValidator>"}, "class_info": {"name": "B... |
169530455_2 | class Trie {
public TrieResult<T> getLastOnPath(CharSequence key) {
return getLastOnPath(key, 0);
}
protected Trie();
public Trie(boolean forward);
public TrieResult<T>[] getAll(CharSequence key, int from);
public int getCells();
public int getCellsPnt();
public int getCells... | Trie t = TrieLoadSaveHelper.load(Paths.get("src/test/resources/defaultTrie.dic"), TrieDataType.STRING);
TrieResult cs = t.getLastOnPath("트리케라톱스");
Assert.assertEquals("초식공룡", cs.getData());
t = TrieLoadSaveHelper.load(Paths.get("src/test/resources/defaultTrie.dic"), TrieDataType.STRING)... | [FOCAL] public TrieResult<T> Trie.getLastOnPath(CharSequence key)
[CLASS] class Trie
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] TrieResult<T> getLastOnPath(CharSequence key, int from)
[INPUTS] branches=- | result=key
[DATAFLOW] key@param->L2
[CLASS-MEMBERS] Trie(); Trie(boolea... | /* static context
[FOCAL] public TrieResult<T> Trie.getLastOnPath(CharSequence key)
[INPUTS] branches=- | result=key
[CALLS-INTERNAL] TrieResult<T> getLastOnPath(CharSequence key, int from)
*/
| /* static context
[FOCAL] public TrieResult<T> Trie.getLastOnPath(CharSequence key)
[INPUTS] branches=- | result=key
[CALLS-INTERNAL] TrieResult<T> getLastOnPath(CharSequence key, int from)
*/
class Trie {
public TrieResult<T> getLastOnPath(CharSequence key) {
return getLastOnPath(key, 0);
}
prote... | true | ok | {"focal": {"class": "Trie", "name": "getLastOnPath", "signature": "TrieResult<T> getLastOnPath(CharSequence key)", "start_line": 3, "modifiers": "public", "params": [{"name": "key", "type": "CharSequence"}], "return_type": "TrieResult<T>"}, "class_info": {"name": "Trie", "kind": "class", "modifiers": "", "superclass": ... |
169625797_41 | class StructureTreeRewriter {
public Node rewrite(Node root) throws RewriteException, RepositoryException {
logger.debug("Rewriting page's content tree rooted at {}", root.getPath());
/*
* Description of the algorithm:
* - traverse the tree rooted at root's parent in pre-order
... |
Node rootNode = context.resourceResolver().getResource(ROOTS_PATH + "/matches/jcr:content").adaptTo(Node.class);
StructureTreeRewriter rewriter = new StructureTreeRewriter(rules);
Node rewrittenNode = rewriter.rewrite(rootNode);
assertFalse(rewrittenNode.hasProperty("cq:designPath"));... | [FOCAL] public Node StructureTreeRewriter.rewrite(Node root)
[CLASS] class StructureTreeRewriter
[METRICS] loc=93 cc=12 branches=6 loops=3 returns=1 throws=0 nesting=6
[CALLS-INTERNAL] void addPaths(Set<String> paths, Set<Node> nodes)
[CALLS-EXTERNAL] logger.debug/2, Node.getPath/0, System.currentTimeMillis/0, Node.get... | class StructureTreeRewriter {
public Node rewrite(Node root) throws RewriteException, RepositoryException {
logger.debug("Rewriting page's content tree rooted at {}", root.getPath());
/*
* Description of the algorithm:
* - traverse the tree rooted at root's parent in pre-order
... | false | ok | {"focal": {"class": "StructureTreeRewriter", "name": "rewrite", "signature": "Node rewrite(Node root) throws RewriteException, RepositoryException", "start_line": 3, "modifiers": "public", "params": [{"name": "root", "type": "Node"}], "return_type": "Node"}, "class_info": {"name": "StructureTreeRewriter", "kind": "clas... | |
169697931_0 | class Evaluator {
public boolean evaluate(Evaluatable evaluatable, JsonNode node) {
return evaluatable.accept(new LogicEvaluator(new EvaluationContext(parseContext.parse(node), this)));
}
public Evaluator();
public Evaluator(ErrorHandlingStrategy errorHandlingStrategy);
final JsonNode n... | final Evaluator evaluator = new Evaluator();
Assert.assertTrue(
evaluator.evaluate(
Equals.builder()
.lhs(new ObjectValue("a"))
.rhs(new ObjectValue("a"))
.build()
... | [FOCAL] public boolean Evaluator.evaluate(Evaluatable evaluatable, JsonNode node)
[CLASS] class Evaluator
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Evaluatable.accept/1, parseContext.parse/1
[NEW] LogicEvaluator, EvaluationContext
[INPUTS] branches=- | result=evaluatable, nod... | /* static context
[FOCAL] public boolean Evaluator.evaluate(Evaluatable evaluatable, JsonNode node)
[INPUTS] branches=- | result=evaluatable, node
[COLLABORATORS] param evaluatable:Evaluatable accept/1; field parseContext parse/1
[NEW] LogicEvaluator, EvaluationContext
[CALLS-EXTERNAL] Evaluatable.accept/1, parseContex... | /* static context
[FOCAL] public boolean Evaluator.evaluate(Evaluatable evaluatable, JsonNode node)
[INPUTS] branches=- | result=evaluatable, node
[COLLABORATORS] param evaluatable:Evaluatable accept/1; field parseContext parse/1
[NEW] LogicEvaluator, EvaluationContext
[CALLS-EXTERNAL] Evaluatable.accept/1, parseContex... | true | ok | {"focal": {"class": "Evaluator", "name": "evaluate", "signature": "boolean evaluate(Evaluatable evaluatable, JsonNode node)", "start_line": 3, "modifiers": "public", "params": [{"name": "evaluatable", "type": "Evaluatable"}, {"name": "node", "type": "JsonNode"}], "return_type": "boolean"}, "class_info": {"name": "Evalu... |
169709790_3 | class RouteGuideService extends RouteGuideGrpc.RouteGuideImplBase {
@Override
public StreamObserver<RouteNote> routeChat(final StreamObserver<RouteNote> responseObserver) {
logger.info("RouteChat");
return new StreamObserver<RouteNote>() {
@Override
public void onNext(Ro... | Point p1 = Point.newBuilder().setLongitude(1).setLatitude(1).build();
Point p2 = Point.newBuilder().setLongitude(2).setLatitude(2).build();
RouteNote n1 = RouteNote.newBuilder().setLocation(p1).setMessage("m1").build();
RouteNote n2 = RouteNote.newBuilder().setLocation(p2).setMessage("m2... | [FOCAL] @Override public StreamObserver<RouteNote> RouteGuideService.routeChat(StreamObserver<RouteNote> responseObserver)
[CLASS] class RouteGuideService extends RouteGuideGrpc.RouteGuideImplBase
[METRICS] loc=28 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] List<RouteNote> getOrCreateNotes(Poi... | /* static context
[FOCAL] @Override public StreamObserver<RouteNote> RouteGuideService.routeChat(StreamObserver<RouteNote> responseObserver)
[INPUTS] branches=- | result=responseObserver
[COLLABORATORS] field note getLocation/0; param responseObserver:StreamObserver<RouteNote> onNext/1,onCompleted/0
[CALLS-INTERNAL] Li... | /* static context
[FOCAL] @Override public StreamObserver<RouteNote> RouteGuideService.routeChat(StreamObserver<RouteNote> responseObserver)
[INPUTS] branches=- | result=responseObserver
[COLLABORATORS] field note getLocation/0; param responseObserver:StreamObserver<RouteNote> onNext/1,onCompleted/0
[CALLS-INTERNAL] Li... | true | ok | {"focal": {"class": "RouteGuideService", "name": "routeChat", "signature": "StreamObserver<RouteNote> routeChat(StreamObserver<RouteNote> responseObserver)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "responseObserver", "type": "StreamObserver<RouteNote>"}], "return_type": "StreamObserver<Ro... |
169802047_99 | class Template {
public Template resolveBy(Resolver resolver, DeclaringComponent currentComponent) {
String replaced = content.replace("${this@templateName}", templateNameWithoutBrackets());
Matcher m = pattern.matcher(replaced);
if (!m.find()) return withContent(replaced);
StringB... | Entry<String, String> entry = System.getenv().entrySet().iterator().next();
String result = new Template("name", source, templatePattern, "${env@" + entry.getKey() + "}").
resolveBy(resolver(), root).getContent();
UnaryOperator<String> escape = v -> v.replaceAll("\\\\+", "/");
... | [FOCAL] public Template Template.resolveBy(Resolver resolver, DeclaringComponent currentComponent)
[CLASS] class Template
[METRICS] loc=13 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] String templateNameWithoutBrackets(); void doResolve(Matcher m, StringBuffer result, Resolver resolver, Declari... | /* static context
[FOCAL] public Template Template.resolveBy(Resolver resolver, DeclaringComponent currentComponent)
[PATH1] if(!m.find())=F -> do_while(m.find())=F -> return withContent(content)
[PATH2] if(!m.find())=T -> return withContent(replaced)
[COLLABORATORS] field pattern matcher/1
[CALLS-INTERNAL] String temp... | /* static context
[FOCAL] public Template Template.resolveBy(Resolver resolver, DeclaringComponent currentComponent)
[PATH1] if(!m.find())=F -> do_while(m.find())=F -> return withContent(content)
[PATH2] if(!m.find())=T -> return withContent(replaced)
[COLLABORATORS] field pattern matcher/1
[CALLS-INTERNAL] String temp... | true | ok | {"focal": {"class": "Template", "name": "resolveBy", "signature": "Template resolveBy(Resolver resolver, DeclaringComponent currentComponent)", "start_line": 3, "modifiers": "public", "params": [{"name": "resolver", "type": "Resolver"}, {"name": "currentComponent", "type": "DeclaringComponent"}], "return_type": "Templa... |
169815639_0 | class ApodDetailPresenter extends BasePresenter<ApodDetailContract.View> implements ApodDetailContract.Presenter {
@Override
public void fetchApodData() {
view.hideApod();
view.showProgressBar();
apodInteractor.getApodDataFromRemote(new ApodDetailsInteractor.onDetailsFetched() {
... | presenter.fetchApodData();
verify(interactor).getApodDataFromRemote(fetchDataCallbackCaptor.capture());
fetchDataCallbackCaptor.getValue().onSuccess(APOD_DATA);
}
} | [FOCAL] @Override public void ApodDetailPresenter.fetchApodData()
[CLASS] class ApodDetailPresenter extends BasePresenter<ApodDetailContract.View> implements ApodDetailContract.Presenter
[METRICS] loc=25 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] ApodDetailContract.View.hideApod/0, ApodDetail... | /* static context
[FOCAL] @Override public void ApodDetailPresenter.fetchApodData()
[COLLABORATORS] field view:ApodDetailContract.View hideApod/0,showProgressBar/0,hideProgressBar/0,showApod/0,showApodDetails/1,showDataFetchError/0; field apodInteractor getApodDataFromRemote/1; field cache:ImageCacheImpl saveHdUrl/1; f... | /* static context
[FOCAL] @Override public void ApodDetailPresenter.fetchApodData()
[COLLABORATORS] field view:ApodDetailContract.View hideApod/0,showProgressBar/0,hideProgressBar/0,showApod/0,showApodDetails/1,showDataFetchError/0; field apodInteractor getApodDataFromRemote/1; field cache:ImageCacheImpl saveHdUrl/1; f... | true | ok | {"focal": {"class": "ApodDetailPresenter", "name": "fetchApodData", "signature": "void fetchApodData()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "ApodDetailPresenter", "kind": "class", "modifiers": "", "superclass": "BasePresenter<ApodDetailContract... |
169872920_32 | class SeriesTableView extends Control {
public final ObservableList<Series<X, Y>> getData() {
return dataProperty().get();
}
public SeriesTableView();
public SeriesTableView(Series<X, Y> series);
public SeriesTableView(ObservableList<Series<X, Y>> seriesList);
public SeriesTableVie... | SeriesTableView<Number, Number> view = initSkin(new SeriesTableView<>(SERIES1));
TableView<?> tableView = getTableView(view);
assertEquals(SERIES1.getData().size(), tableView.getItems().size());
assertEquals(SERIES1.getData().get(0).getXValue(), getXColumn(view,... | [FOCAL] public final ObservableList<Series<X, Y>> SeriesTableView.getData()
[CLASS] class SeriesTableView extends Control
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] ObjectProperty<ObservableList<Series<X, Y>>> dataProperty()
[CALLS-EXTERNAL] dataProperty().get/0
[CLASS-MEMBERS... | /* static context
[FOCAL] public final ObservableList<Series<X, Y>> SeriesTableView.getData()
[CALLS-INTERNAL] ObjectProperty<ObservableList<Series<X, Y>>> dataProperty()
[CALLS-EXTERNAL] dataProperty().get/0
*/
| /* static context
[FOCAL] public final ObservableList<Series<X, Y>> SeriesTableView.getData()
[CALLS-INTERNAL] ObjectProperty<ObservableList<Series<X, Y>>> dataProperty()
[CALLS-EXTERNAL] dataProperty().get/0
*/
class SeriesTableView extends Control {
public final ObservableList<Series<X, Y>> getData() {
r... | true | ok | {"focal": {"class": "SeriesTableView", "name": "getData", "signature": "ObservableList<Series<X, Y>> getData()", "start_line": 3, "modifiers": "public final", "params": [], "return_type": "ObservableList<Series<X, Y>>"}, "class_info": {"name": "SeriesTableView", "kind": "class", "modifiers": "", "superclass": "Control"... |
169934394_1 | class DiffLineFilter extends AutomaticBean implements Filter {
@Override
public boolean accept(AuditEvent event) {
List<Edit> editList = fileEditMap.get(event.getFileName());
if (CollectionUtils.isEmpty(editList)) {
return false;
}
for (Edit edit : editList) {
... | String fileName = "test";
int lineNum = 10;
int beginB = 5;
int endB = 9;
LocalizedMessage message = PowerMockito.mock(LocalizedMessage.class);
PowerMockito.doReturn(EmptyLineSeparatorCheck.class.getName()).when(message).getSourceName();
AuditEvent event = Power... | [FOCAL] @Override public boolean DiffLineFilter.accept(AuditEvent event)
[CLASS] class DiffLineFilter extends AutomaticBean implements Filter
[METRICS] loc=16 cc=5 branches=3 loops=1 returns=4 throws=0 nesting=2
[CALLS-INTERNAL] boolean isEmptyLineSeparatorCheck(AuditEvent event)
[CALLS-EXTERNAL] fileEditMap.get/1, Aud... | /* static context
[FOCAL] @Override public boolean DiffLineFilter.accept(AuditEvent event)
[PATH1] if(CollectionUtils.isEmpty(editList))=F -> foreach(Edit edit : editList)=T -> if(edit.getBeginB() < event.getLine() && edit.getEndB() >= event.getLine())=F -> if(isEmptyLineSeparatorCheck(event) && event.getLine() == edit... | /* static context
[FOCAL] @Override public boolean DiffLineFilter.accept(AuditEvent event)
[PATH1] if(CollectionUtils.isEmpty(editList))=F -> foreach(Edit edit : editList)=T -> if(edit.getBeginB() < event.getLine() && edit.getEndB() >= event.getLine())=F -> if(isEmptyLineSeparatorCheck(event) && event.getLine() == edit... | true | ok | {"focal": {"class": "DiffLineFilter", "name": "accept", "signature": "boolean accept(AuditEvent event)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "event", "type": "AuditEvent"}], "return_type": "boolean"}, "class_info": {"name": "DiffLineFilter", "kind": "class", "modifiers": "", "superclas... |
169959995_13 | class Jogador {
public static JogadorBuilder builder() {
return new JogadorBuilder();
}
Jogador(String nome, String cidade, String pais, int gols, Posicao posicao);
public String getNome();
public String getCidade();
public String getPais();
public int getGols();
public Posi... | Jogador neymar = Jogador.builder().withNome("Neymar")
.withCidade("Salvador")
.withPais("Brasil").withGols(10)
.withPosicao(Posicao.ATAQUE).build();
assertNotNull(neymar);
}
} | [FOCAL] public static JogadorBuilder Jogador.builder()
[CLASS] class Jogador
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] JogadorBuilder
[CLASS-MEMBERS] Jogador(String nome, String cidade, String pais, int gols, Posicao posicao); String getNome(); String getCidade(); String getPais(); int ... | /* static context
[FOCAL] public static JogadorBuilder Jogador.builder()
[NEW] JogadorBuilder
*/
| /* static context
[FOCAL] public static JogadorBuilder Jogador.builder()
[NEW] JogadorBuilder
*/
class Jogador {
public static JogadorBuilder builder() {
return new JogadorBuilder();
}
Jogador(String nome, String cidade, String pais, int gols, Posicao posicao);
public String getNome();
... | true | ok | {"focal": {"class": "Jogador", "name": "builder", "signature": "JogadorBuilder builder()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "JogadorBuilder"}, "class_info": {"name": "Jogador", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "jogad... |
170136874_2 | class Address {
@Override
public String toString() {
return address;
}
public Address(PrivateKey privateKey);
public Address(PublicKey publicKey);
public Address(String address);
public static boolean isValid(String address);
public byte[] getBytes();
private final Str... | Assert.assertEquals(TEST_ADDRESS, new Address(TEST_PUB_KEY).toString());
}
} | [FOCAL] @Override public String Address.toString()
[CLASS] class Address
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] Address(PrivateKey privateKey); Address(PublicKey publicKey); Address(String address); boolean isValid(String address); byte[] getBytes()
[TEST] AddressTest: @Tes... | /* static context
[FOCAL] @Override public String Address.toString()
*/
| /* static context
[FOCAL] @Override public String Address.toString()
*/
class Address {
@Override
public String toString() {
return address;
}
public Address(PrivateKey privateKey);
public Address(PublicKey publicKey);
public Address(String address);
public static boolean isVal... | true | ok | {"focal": {"class": "Address", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "Address", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "TEST_PK", "type"... |
170551715_5 | class PathValue {
@Override
public String toString() {
return value;
}
public PathValue(final String value);
public Path resolvePath(@NotNull final PathResolver pathResolver);
@Override public boolean equals(final Object o);
@Override public int hashCode();
}
class PathValueTes... | Assertions.assertEquals("/test/toString", new PathValue("/test/toString").toString());
}
} | [FOCAL] @Override public String PathValue.toString()
[CLASS] class PathValue
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] PathValue(String value); Path resolvePath(PathResolver pathResolver); boolean equals(Object o); int hashCode()
[TEST] PathValueTest: @Test public void toStrin... | /* static context
[FOCAL] @Override public String PathValue.toString()
*/
| /* static context
[FOCAL] @Override public String PathValue.toString()
*/
class PathValue {
@Override
public String toString() {
return value;
}
public PathValue(final String value);
public Path resolvePath(@NotNull final PathResolver pathResolver);
@Override public boolean equals(fi... | true | ok | {"focal": {"class": "PathValue", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "PathValue", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name"... |
170565218_0 | class Password {
public static boolean longEnough(String password) {
return password.length() >= 8;
}
public static String generateSalt();
public static String hash(String password, String salt);
public static boolean containsUpperCase(String password);
public static boolean containsLo... | Assert.assertFalse(Password.longEnough(""));
}
} | [FOCAL] public static boolean Password.longEnough(String password)
[CLASS] class Password
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] String.length/0
[INPUTS] branches=- | result=password
[DATAFLOW] password@param->L2
[CLASS-MEMBERS] String generateSalt(); String hash(String pa... | /* static context
[FOCAL] public static boolean Password.longEnough(String password)
[INPUTS] branches=- | result=password
[CALLS-EXTERNAL] String.length/0
*/
| /* static context
[FOCAL] public static boolean Password.longEnough(String password)
[INPUTS] branches=- | result=password
[CALLS-EXTERNAL] String.length/0
*/
class Password {
public static boolean longEnough(String password) {
return password.length() >= 8;
}
public static String generateSalt();
... | true | ok | {"focal": {"class": "Password", "name": "longEnough", "signature": "boolean longEnough(String password)", "start_line": 3, "modifiers": "public static", "params": [{"name": "password", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "Password", "kind": "class", "modifiers": "", "superclass": null,... |
170829387_12 | class WebAuthn4jAuthenticator implements Authenticator {
public void authenticate(AuthenticationFlowContext context) {
LoginFormsProvider form = context.form();
Map<String, String> params = generateParameters(context.getRealm(), context.getUriInfo().getBaseUri());
context.getAuthenticationS... | // set up mock
List<String> publicKeyCredentialIds = new ArrayList<>();
publicKeyCredentialIds.add(getRandomString(32));
when(context.getUser().getAttribute(WebAuthnConstants.PUBKEY_CRED_ID_ATTR)).thenReturn(publicKeyCredentialIds);
// test
try {
authenticator.a... | [FOCAL] public void WebAuthn4jAuthenticator.authenticate(AuthenticationFlowContext context)
[CLASS] class WebAuthn4jAuthenticator implements Authenticator
[METRICS] loc=18 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-INTERNAL] Map<String, String> generateParameters(RealmModel realm, URI baseUri)
[CALLS-E... | /* static context
[FOCAL] public void WebAuthn4jAuthenticator.authenticate(AuthenticationFlowContext context)
[PATH1] if(user != null)=T
[PATH2] if(user != null)=F
[INPUTS] branches=context | result=-
[COLLABORATORS] param context:AuthenticationFlowContext form/0,getRealm/0,getUriInfo/0,getAuthenticationSession/0,getUs... | /* static context
[FOCAL] public void WebAuthn4jAuthenticator.authenticate(AuthenticationFlowContext context)
[PATH1] if(user != null)=T
[PATH2] if(user != null)=F
[INPUTS] branches=context | result=-
[COLLABORATORS] param context:AuthenticationFlowContext form/0,getRealm/0,getUriInfo/0,getAuthenticationSession/0,getUs... | true | ok | {"focal": {"class": "WebAuthn4jAuthenticator", "name": "authenticate", "signature": "void authenticate(AuthenticationFlowContext context)", "start_line": 3, "modifiers": "public", "params": [{"name": "context", "type": "AuthenticationFlowContext"}], "return_type": "void"}, "class_info": {"name": "WebAuthn4jAuthenticato... |
170883666_59 | class GrokPatternCompiler {
public GrokMatcher compile(final String expression) {
Objects.requireNonNull(expression, "expression can't be null");
LOG.info("Starting to compile grok matcher expression : {}", expression);
ArrayList<GrokPattern> patterns = new ArrayList<>();
final Str... | final GrokMatcher matcher = compiler.compile("%{ISO8601_TIMEZONE} %{LOGLEVEL} %{GREEDYDATA}");
Assert.assertNotNull(matcher);
Assert.assertNotNull(matcher.getGrokPattern("ISO8601_TIMEZONE"));
Assert.assertNotNull(matcher.getGrokPattern("LOGLEVEL"));
Assert.assertNotNull(matcher.g... | [FOCAL] public GrokMatcher GrokPatternCompiler.compile(String expression)
[CLASS] class GrokPatternCompiler
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String compileRegex(String expression, List<GrokPattern> patterns)
[CALLS-EXTERNAL] Objects.requireNonNull/2, LOG.info/2
[NEW]... | /* static context
[FOCAL] public GrokMatcher GrokPatternCompiler.compile(String expression)
[INPUTS] branches=- | result=expression
[CALLS-INTERNAL] String compileRegex(String expression, List<GrokPattern> patterns)
[NEW] ArrayList<>, GrokMatcher
[CALLS-EXTERNAL] Objects.requireNonNull/2, LOG.info/2
*/
| /* static context
[FOCAL] public GrokMatcher GrokPatternCompiler.compile(String expression)
[INPUTS] branches=- | result=expression
[CALLS-INTERNAL] String compileRegex(String expression, List<GrokPattern> patterns)
[NEW] ArrayList<>, GrokMatcher
[CALLS-EXTERNAL] Objects.requireNonNull/2, LOG.info/2
*/
class GrokPatter... | true | ok | {"focal": {"class": "GrokPatternCompiler", "name": "compile", "signature": "GrokMatcher compile(String expression)", "start_line": 3, "modifiers": "public", "params": [{"name": "expression", "type": "String"}], "return_type": "GrokMatcher"}, "class_info": {"name": "GrokPatternCompiler", "kind": "class", "modifiers": ""... |
171042873_88 | class MetricJob {
@ConditionalOnProperty(value = "scheduling.enabled", havingValue = "true")
@Scheduled(cron = "0 * * * * *")
@Retryable
public void send() {
List<Metric> metrics = metricService.collect();
metricService.send(metrics);
}
@Rule
public MockitoRule mockitoRule;... | final List<Metric> metrics =
List.of(
Metric.builder()
.name("metric1")
.time(1L)
.value(BigDecimal.ONE)
.build(),
Metric.builder()
.name("metric2")
... | [FOCAL] @ConditionalOnProperty(value = "scheduling.enabled", havingValue = "true") @Scheduled(cron = "0 * * * * *") @Retryabl... void MetricJob.send()
[CLASS] class MetricJob
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] MetricService.collect/0, MetricService.send/1
[FIELDS] read... | /* static context
[FOCAL] @ConditionalOnProperty(value = "scheduling.enabled", havingValue = "true") @Scheduled(cron = "0 * * * * *") @Retryabl... void MetricJob.send()
[COLLABORATORS] field metricService:MetricService collect/0,send/1
[FIELDS] read=metricService:MetricService
[CALLS-EXTERNAL] MetricService.collect/0, ... | /* static context
[FOCAL] @ConditionalOnProperty(value = "scheduling.enabled", havingValue = "true") @Scheduled(cron = "0 * * * * *") @Retryabl... void MetricJob.send()
[COLLABORATORS] field metricService:MetricService collect/0,send/1
[FIELDS] read=metricService:MetricService
[CALLS-EXTERNAL] MetricService.collect/0, ... | true | ok | {"focal": {"class": "MetricJob", "name": "send", "signature": "void send()", "start_line": 3, "modifiers": "@ConditionalOnProperty(value = \"scheduling.enabled\", havingValue = \"true\") @Scheduled(cron = \"0 * * * * *\") @Retryabl...", "params": [], "return_type": "void"}, "class_info": {"name": "MetricJob", "kind": "... |
171116174_14 | class JpaEntity implements IdentifiableEntity<ID> {
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!getClass().isInstance(o)) return false;
return getId() != null && getId().equals(((JpaEntity) o).getId());
}
@Override public String toString();
@Override public int hashCode();
... | for (int i = 0; i < 1000; i++) {
assertThat(x.equals(y)).isTrue();
}
}
} | [FOCAL] @Override public boolean JpaEntity.equals(Object o)
[CLASS] class JpaEntity implements IdentifiableEntity<ID>
[METRICS] loc=6 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[CALLS-EXTERNAL] getClass().isInstance/1, getClass/0 (inherited), getId/0 (inherited), getId().equals/1, ((JpaEntity) o).getId/0
[PAT... | /* static context
[FOCAL] @Override public boolean JpaEntity.equals(Object o)
[PATH1] if(this == o)=F -> if(!getClass().isInstance(o))=T -> return false
[PATH2] if(this == o)=T -> return true
[PATH3] if(this == o)=F -> if(!getClass().isInstance(o))=F -> return getId() != null && getId().equals(((JpaEntity) o).getId())
... | /* static context
[FOCAL] @Override public boolean JpaEntity.equals(Object o)
[PATH1] if(this == o)=F -> if(!getClass().isInstance(o))=T -> return false
[PATH2] if(this == o)=T -> return true
[PATH3] if(this == o)=F -> if(!getClass().isInstance(o))=F -> return getId() != null && getId().equals(((JpaEntity) o).getId())
... | true | ok | {"focal": {"class": "JpaEntity", "name": "equals", "signature": "boolean equals(Object o)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "o", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "JpaEntity", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "I... |
171132936_6 | class StringUtil {
public static String deleteCRLFOnce(String input) {
return input.replaceAll("((\r\n)|\n)[\\s\t ]*(\\1)+", "$1").replaceAll("^((\r\n)|\n)", "");
}
public static String getMiddleString(String text, String lStr, String rStr);
public static String str2HexStr(String str);
public static String hex... | assertEquals("fooBar", StringUtil.deleteCRLFOnce("fooBar"));
assertEquals("foo\nBar", StringUtil.deleteCRLFOnce("foo\n\nBar"));
}
} | [FOCAL] public static String StringUtil.deleteCRLFOnce(String input)
[CLASS] class StringUtil
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] input.replaceAll("((\r\n)|\n)[\\s\t ]*(\\1)+", "$1").replaceAll/2, String.replaceAll/2
[INPUTS] branches=- | result=input
[DATAFLOW] input@p... | /* static context
[FOCAL] public static String StringUtil.deleteCRLFOnce(String input)
[INPUTS] branches=- | result=input
[CALLS-EXTERNAL] input.replaceAll("((\r\n)|\n)[\\s\t ]*(\\1)+", "$1").replaceAll/2, String.replaceAll/2
*/
| /* static context
[FOCAL] public static String StringUtil.deleteCRLFOnce(String input)
[INPUTS] branches=- | result=input
[CALLS-EXTERNAL] input.replaceAll("((\r\n)|\n)[\\s\t ]*(\\1)+", "$1").replaceAll/2, String.replaceAll/2
*/
class StringUtil {
public static String deleteCRLFOnce(String input) {
return input.rep... | true | ok | {"focal": {"class": "StringUtil", "name": "deleteCRLFOnce", "signature": "String deleteCRLFOnce(String input)", "start_line": 3, "modifiers": "public static", "params": [{"name": "input", "type": "String"}], "return_type": "String"}, "class_info": {"name": "StringUtil", "kind": "class", "modifiers": "", "superclass": n... |
171867537_7 | class CORSFilter implements ContainerResponseFilter {
@Override
public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException {
responseContext.getHeaders().add("Access-Control-Allow-Origin", "*");
responseContext.getHeaders().add("Acces... |
// create the objects to be mocked
ContainerRequestContext requestContext = mock(ContainerRequestContext.class);
ContainerResponseContext responseContext = mock(ContainerResponseContext.class);
MultivaluedMap<String, Object> headers = new MultivaluedHashMap<>();
when(responseContext.getHeaders()).thenRet... | [FOCAL] @Override public void CORSFilter.filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext)
[CLASS] class CORSFilter implements ContainerResponseFilter
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] responseContext.getHeaders().add/2, Containe... | /* static context
[FOCAL] @Override public void CORSFilter.filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext)
[INPUTS] branches=- | result=- | unused=requestContext
[COLLABORATORS] param responseContext:ContainerResponseContext getHeaders/0
[EXCEPTIONS] declares IOException
[CALLS-... | /* static context
[FOCAL] @Override public void CORSFilter.filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext)
[INPUTS] branches=- | result=- | unused=requestContext
[COLLABORATORS] param responseContext:ContainerResponseContext getHeaders/0
[EXCEPTIONS] declares IOException
[CALLS-... | true | ok | {"focal": {"class": "CORSFilter", "name": "filter", "signature": "void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "requestContext", "type": "ContainerRequestContext"}, {"name": "respo... |
172090523_83 | class ParserWrapper implements Parser {
@Override
public <T extends Enum<T>> T getEnum(Class<T> enumClass) throws MatchbookSDKParsingException {
if (isNotNullValue()) {
try {
String value = jsonParser.getValueAsString().toUpperCase().replace('-', '_');
try {
... | doThrow(IOException.class).when(jsonParser).getValueAsString();
when(jsonParser.hasToken(JsonToken.VALUE_NULL)).thenReturn(false);
assertThatExceptionOfType(MatchbookSDKParsingException.class)
.isThrownBy(() -> unit.getEnum(TestEnum.class));
}
} | [FOCAL] @Override public T ParserWrapper.getEnum(Class<T> enumClass)
[CLASS] class ParserWrapper implements Parser
[METRICS] loc=16 cc=4 branches=1 loops=0 returns=3 throws=1 nesting=3
[CALLS-INTERNAL] boolean isNotNullValue()
[CALLS-EXTERNAL] jsonParser.getValueAsString().toUpperCase().replace/2, jsonParser.getValueAs... | /* static context
[FOCAL] @Override public T ParserWrapper.getEnum(Class<T> enumClass)
[THROWS-WHEN] MatchbookSDKParsingException when isNotNullValue() && try-body throws
[PATH1] if(isNotNullValue())=T -> try-body throws -> throw new MatchbookSDKParsingException(e)
[PATH2] if(isNotNullValue())=F -> return null
[PATH3] ... | /* static context
[FOCAL] @Override public T ParserWrapper.getEnum(Class<T> enumClass)
[THROWS-WHEN] MatchbookSDKParsingException when isNotNullValue() && try-body throws
[PATH1] if(isNotNullValue())=T -> try-body throws -> throw new MatchbookSDKParsingException(e)
[PATH2] if(isNotNullValue())=F -> return null
[PATH3] ... | true | ok | {"focal": {"class": "ParserWrapper", "name": "getEnum", "signature": "T getEnum(Class<T> enumClass) throws MatchbookSDKParsingException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "enumClass", "type": "Class<T>"}], "return_type": "T"}, "class_info": {"name": "ParserWrapper", "kind": "class",... |
172494483_1 | class CurrentUserHandlerMethodArgumentResolver implements
HandlerMethodArgumentResolver {
public boolean supportsParameter(MethodParameter methodParameter) {
return methodParameter.getParameterAnnotation(CurrentUser.class) != null
&& methodParameter.getParameterType().equals(User.class);
}
public Object re... | assertTrue(resolver.supportsParameter(validParam));
assertFalse(resolver.supportsParameter(notAnnotatedParam));
assertFalse(resolver.supportsParameter(wrongTypeParam));
}
} | [FOCAL] public boolean CurrentUserHandlerMethodArgumentResolver.supportsParameter(MethodParameter methodParameter)
[CLASS] class CurrentUserHandlerMethodArgumentResolver implements HandlerMethodArgumentResolver
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] MethodParameter.getPara... | /* static context
[FOCAL] public boolean CurrentUserHandlerMethodArgumentResolver.supportsParameter(MethodParameter methodParameter)
[INPUTS] branches=- | result=methodParameter
[COLLABORATORS] param methodParameter:MethodParameter getParameterAnnotation/1,getParameterType/0
[CALLS-EXTERNAL] MethodParameter.getParamete... | /* static context
[FOCAL] public boolean CurrentUserHandlerMethodArgumentResolver.supportsParameter(MethodParameter methodParameter)
[INPUTS] branches=- | result=methodParameter
[COLLABORATORS] param methodParameter:MethodParameter getParameterAnnotation/1,getParameterType/0
[CALLS-EXTERNAL] MethodParameter.getParamete... | true | ok | {"focal": {"class": "CurrentUserHandlerMethodArgumentResolver", "name": "supportsParameter", "signature": "boolean supportsParameter(MethodParameter methodParameter)", "start_line": 4, "modifiers": "public", "params": [{"name": "methodParameter", "type": "MethodParameter"}], "return_type": "boolean"}, "class_info": {"n... |
172695826_2 | class EDKeyPair implements IKeyPair {
@Override
public boolean verifySignature(byte[] message, byte[] sigBytes) {
try {
EdDSAEngine sgr = new EdDSAEngine(MessageDigest.getInstance("SHA-512"));
sgr.initVerify(new EdDSAPublicKey(new EdDSAPublicKeySpec(keySpec.getA(), ed25519)));
... | assertTrue(edKeyPair.verifySignature(message, B16.decode(expectedSig)));
}
} | [FOCAL] @Override public boolean EDKeyPair.verifySignature(byte[] message, byte[] sigBytes)
[CLASS] class EDKeyPair implements IKeyPair
[METRICS] loc=11 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] MessageDigest.getInstance/1, EdDSAEngine.initVerify/1, keySpec.getA/0, EdDSAEngine.update/1, EdDS... | /* static context
[FOCAL] @Override public boolean EDKeyPair.verifySignature(byte[] message, byte[] sigBytes)
[THROWS-WHEN] RuntimeException when try-body throws
[PATH1] try-body throws -> throw new RuntimeException(e)
[PATH2] return sgr.verify(sigBytes)
[INPUTS] branches=- | result=sigBytes
[COLLABORATORS] field keySp... | /* static context
[FOCAL] @Override public boolean EDKeyPair.verifySignature(byte[] message, byte[] sigBytes)
[THROWS-WHEN] RuntimeException when try-body throws
[PATH1] try-body throws -> throw new RuntimeException(e)
[PATH2] return sgr.verify(sigBytes)
[INPUTS] branches=- | result=sigBytes
[COLLABORATORS] field keySp... | true | ok | {"focal": {"class": "EDKeyPair", "name": "verifySignature", "signature": "boolean verifySignature(byte[] message, byte[] sigBytes)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "message", "type": "byte[]"}, {"name": "sigBytes", "type": "byte[]"}], "return_type": "boolean"}, "class_info": {"nam... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.