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 |
|---|---|---|---|---|---|---|---|---|
213770342_10 | class CommonUtil {
public static Integer determinePriceCatForCPD(double price)
{
if (price >= 0 && price <= 3)
{
return 1;
}
if (price > 3 && price <= 5)
{
return 2;
}
if (price > 5)
{
return 3;
}
... | double d = 10.456;
assertEquals(3, (int) CommonUtil.determinePriceCatForCPD(d));
d = 005D;
assertEquals(2, (int) CommonUtil.determinePriceCatForCPD(d));
d = 0.69999999999999;
assertEquals(1, (int) CommonUtil.determinePriceCatForCPD(d));
d = 7.123456789;
as... | [FOCAL] public static Integer CommonUtil.determinePriceCatForCPD(double price)
[CLASS] class CommonUtil
[METRICS] loc=16 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=1
[PATH1] if(price >= 0 && price <= 3)=F -> if(price > 3 && price <= 5)=F -> if(price > 5)=T -> return 3
[PATH2] if(price >= 0 && price <= 3)=T -> r... | /* static context
[FOCAL] public static Integer CommonUtil.determinePriceCatForCPD(double price)
[PATH1] if(price >= 0 && price <= 3)=F -> if(price > 3 && price <= 5)=F -> if(price > 5)=T -> return 3
[PATH2] if(price >= 0 && price <= 3)=T -> return 1
[PATH3] if(price >= 0 && price <= 3)=F -> if(price > 3 && price <= 5)... | /* static context
[FOCAL] public static Integer CommonUtil.determinePriceCatForCPD(double price)
[PATH1] if(price >= 0 && price <= 3)=F -> if(price > 3 && price <= 5)=F -> if(price > 5)=T -> return 3
[PATH2] if(price >= 0 && price <= 3)=T -> return 1
[PATH3] if(price >= 0 && price <= 3)=F -> if(price > 3 && price <= 5)... | true | ok | {"focal": {"class": "CommonUtil", "name": "determinePriceCatForCPD", "signature": "Integer determinePriceCatForCPD(double price)", "start_line": 3, "modifiers": "public static", "params": [{"name": "price", "type": "double"}], "return_type": "Integer"}, "class_info": {"name": "CommonUtil", "kind": "class", "modifiers":... |
213777474_6 | class PointerItem extends BaseItem {
public Set<ContextItem> contextItems() {
HashSet<ContextItem> contextItems = new HashSet<>(context.size());
for (Map.Entry<String, AttributeValue> entry : context.entrySet()) {
contextItems.add(ContextItem.fromContext(entry.getKey(), partitionKey));
}
return... | Map<String, String> context = sampleContext();
PointerItem item = PointerItem.generate(context);
Set<ContextItem> expectedContextItems = new HashSet<>(context.size());
for (Map.Entry<String, String> entry : context.entrySet()) {
ContextItem i = ContextItem.fromContext(entry.getKey(), item.partitio... | [FOCAL] public Set<ContextItem> PointerItem.contextItems()
[CLASS] class PointerItem extends BaseItem
[METRICS] loc=7 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] context.size/0, context.entrySet/0, HashSet<ContextItem>.add/1, ContextItem.fromContext/2, Map.Entry<String, AttributeValue>.getKey/... | /* static context
[FOCAL] public Set<ContextItem> PointerItem.contextItems()
[PATH1] foreach(Map.Entry<String, AttributeValue> entry : context.entrySet())=T -> exit loop -> return contextItems
[PATH2] foreach(Map.Entry<String, AttributeValue> entry : context.entrySet())=F -> return contextItems
[COLLABORATORS] field co... | /* static context
[FOCAL] public Set<ContextItem> PointerItem.contextItems()
[PATH1] foreach(Map.Entry<String, AttributeValue> entry : context.entrySet())=T -> exit loop -> return contextItems
[PATH2] foreach(Map.Entry<String, AttributeValue> entry : context.entrySet())=F -> return contextItems
[COLLABORATORS] field co... | true | ok | {"focal": {"class": "PointerItem", "name": "contextItems", "signature": "Set<ContextItem> contextItems()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Set<ContextItem>"}, "class_info": {"name": "PointerItem", "kind": "class", "modifiers": "", "superclass": "BaseItem", "interfaces": null, "fiel... |
213825606_2 | class ZuulFiltersModule extends AbstractModule {
@VisibleForTesting
String[] findClassNames(AbstractConfiguration config) {
// Find individually-specified filter classes.
String[] filterClassNamesStrArray = config.getStringArray("zuul.filters.classes");
Stream<String> classNameStream =... | when(configuration.getStringArray(eq("zuul.filters.classes"))).thenReturn(new String[]{});
when(configuration.getStringArray(eq("zuul.filters.packages"))).thenReturn(new String[]{});
String[] classNames = module.findClassNames(configuration);
assertThat(classNames.length, equalTo(0));
... | [FOCAL] @VisibleForTesting String[] ZuulFiltersModule.findClassNames(AbstractConfiguration config)
[CLASS] class ZuulFiltersModule extends AbstractModule
[METRICS] loc=37 cc=4 branches=1 loops=1 returns=1 throws=1 nesting=2
[CALLS-EXTERNAL] AbstractConfiguration.getStringArray/1, Arrays.stream(filterClassNamesStrArray)... | /* static context
[FOCAL] @VisibleForTesting String[] ZuulFiltersModule.findClassNames(AbstractConfiguration config)
[THROWS-WHEN] RuntimeException when try-body throws
[PATH1] if(filterClassNames.length != 0)=T -> foreach(String location : filterClassNames)=T -> exit loop -> return filterClassNames
[PATH2] try-body th... | /* static context
[FOCAL] @VisibleForTesting String[] ZuulFiltersModule.findClassNames(AbstractConfiguration config)
[THROWS-WHEN] RuntimeException when try-body throws
[PATH1] if(filterClassNames.length != 0)=T -> foreach(String location : filterClassNames)=T -> exit loop -> return filterClassNames
[PATH2] try-body th... | true | ok | {"focal": {"class": "ZuulFiltersModule", "name": "findClassNames", "signature": "String[] findClassNames(AbstractConfiguration config)", "start_line": 3, "modifiers": "@VisibleForTesting", "params": [{"name": "config", "type": "AbstractConfiguration"}], "return_type": "String[]"}, "class_info": {"name": "ZuulFiltersMod... |
213981789_184 | class ActorProxyImpl implements ActorProxy, InvocationHandler {
@Override
public <T> Mono<T> invokeActorMethod(String methodName, Object data, TypeRef<T> type) {
return this.daprClient.invokeActorMethod(actorType, actorId.toString(), methodName, this.serialize(data))
.filter(s -> s.length > 0)
... | final DaprClient daprClient = mock(DaprClient.class);
when(daprClient.invokeActorMethod(anyString(), anyString(), anyString(), Mockito.isNotNull()))
.thenReturn(
Mono.just("{\n\t\t\"propertyA\": \"valueA\",\n\t\t\"propertyB\": \"valueB\"\n\t}".getBytes()));
final ActorProxy actorProxy = n... | [FOCAL] @Override public Mono<T> ActorProxyImpl.invokeActorMethod(String methodName, Object data, TypeRef<T> type)
[CLASS] class ActorProxyImpl implements ActorProxy, InvocationHandler
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] T deserialize(byte[] response, TypeRef<T> type); ... | /* static context
[FOCAL] @Override public Mono<T> ActorProxyImpl.invokeActorMethod(String methodName, Object data, TypeRef<T> type)
[INPUTS] branches=- | result=data, methodName, type
[COLLABORATORS] field daprClient invokeActorMethod/4; field actorId toString/0
[CALLS-INTERNAL] T deserialize(byte[] response, TypeRef<... | /* static context
[FOCAL] @Override public Mono<T> ActorProxyImpl.invokeActorMethod(String methodName, Object data, TypeRef<T> type)
[INPUTS] branches=- | result=data, methodName, type
[COLLABORATORS] field daprClient invokeActorMethod/4; field actorId toString/0
[CALLS-INTERNAL] T deserialize(byte[] response, TypeRef<... | true | ok | {"focal": {"class": "ActorProxyImpl", "name": "invokeActorMethod", "signature": "Mono<T> invokeActorMethod(String methodName, Object data, TypeRef<T> type)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "methodName", "type": "String"}, {"name": "data", "type": "Object"}, {"name": "type", "type"... |
214200976_3 | class RendezvousNodeRouter implements NodeRouter<N> {
@Override
public Optional<N> getNode(String nodeId) {
return strategy.getNode(nodeId, ring, hashFunction);
}
private RendezvousNodeRouter(
Collection<N> initialNodes, HashFunction hashFunction, RendezvousStrategy<N> strategy);
public static N... | NodeRouter<WeightedNode> router = createRendezvousRouter();
assertFalse(router.getNode("key").isPresent());
}
} | [FOCAL] @Override public Optional<N> RendezvousNodeRouter.getNode(String nodeId)
[CLASS] class RendezvousNodeRouter implements NodeRouter<N>
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] strategy.getNode/3
[INPUTS] branches=- | result=nodeId
[COLLABORATORS] field strategy getNode... | /* static context
[FOCAL] @Override public Optional<N> RendezvousNodeRouter.getNode(String nodeId)
[INPUTS] branches=- | result=nodeId
[COLLABORATORS] field strategy getNode/3
[CALLS-EXTERNAL] strategy.getNode/3
*/
| /* static context
[FOCAL] @Override public Optional<N> RendezvousNodeRouter.getNode(String nodeId)
[INPUTS] branches=- | result=nodeId
[COLLABORATORS] field strategy getNode/3
[CALLS-EXTERNAL] strategy.getNode/3
*/
class RendezvousNodeRouter implements NodeRouter<N> {
@Override
public Optional<N> getNode(String no... | true | ok | {"focal": {"class": "RendezvousNodeRouter", "name": "getNode", "signature": "Optional<N> getNode(String nodeId)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "nodeId", "type": "String"}], "return_type": "Optional<N>"}, "class_info": {"name": "RendezvousNodeRouter", "kind": "class", "modifiers"... |
214396571_4 | class StatusUtil {
public static String[] getRowData(DeploymentStatus deploymentStatus) {
if (deploymentStatus == null) {
return null;
}
String age = getAge(deploymentStatus.getAge());
String statusMsg = deploymentStatus.getServiceStatus() != null ? deploymentStatus.getS... | deploymentStatus.setAge(null);
assertNotNull(StatusUtil.getRowData(deploymentStatus));
}
} | [FOCAL] public static String[] StatusUtil.getRowData(DeploymentStatus deploymentStatus)
[CLASS] class StatusUtil
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] String getAge(DateTime dateTime)
[CALLS-EXTERNAL] DeploymentStatus.getAge/0, DeploymentStatus.getServiceStatus/0, deploy... | /* static context
[FOCAL] public static String[] StatusUtil.getRowData(DeploymentStatus deploymentStatus)
[PATH1] if(deploymentStatus == null)=T -> return null
[PATH2] if(deploymentStatus == null)=F -> return rowData
[INPUTS] branches=deploymentStatus | result=deploymentStatus
[COLLABORATORS] param deploymentStatus:Dep... | /* static context
[FOCAL] public static String[] StatusUtil.getRowData(DeploymentStatus deploymentStatus)
[PATH1] if(deploymentStatus == null)=T -> return null
[PATH2] if(deploymentStatus == null)=F -> return rowData
[INPUTS] branches=deploymentStatus | result=deploymentStatus
[COLLABORATORS] param deploymentStatus:Dep... | true | ok | {"focal": {"class": "StatusUtil", "name": "getRowData", "signature": "String[] getRowData(DeploymentStatus deploymentStatus)", "start_line": 3, "modifiers": "public static", "params": [{"name": "deploymentStatus", "type": "DeploymentStatus"}], "return_type": "String[]"}, "class_info": {"name": "StatusUtil", "kind": "cl... |
214418380_15 | class CgmesDLModel {
public PropertyBags getTerminals() {
LOG.info("Querying triple store for terminals");
return queryTripleStore(TERMINALS_QUERY_KEY);
}
public CgmesDLModel(TripleStore tripleStore);
public CgmesDLModel(TripleStore tripleStore, QueryCatalog queryCatalog);
priva... | assertEquals(terminals, cgmesDLModel.getTerminals());
removeQueryCatalogKey(CgmesDLModel.TERMINALS_QUERY_KEY);
assertEquals(new PropertyBags(), cgmesDLModel.getTerminals());
}
} | [FOCAL] public PropertyBags CgmesDLModel.getTerminals()
[CLASS] class CgmesDLModel
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] PropertyBags queryTripleStore(String queryKey)
[CALLS-EXTERNAL] LOG.info/1
[CLASS-MEMBERS] CgmesDLModel(TripleStore tripleStore); CgmesDLModel(TripleSt... | /* static context
[FOCAL] public PropertyBags CgmesDLModel.getTerminals()
[CALLS-INTERNAL] PropertyBags queryTripleStore(String queryKey)
[CALLS-EXTERNAL] LOG.info/1
*/
| /* static context
[FOCAL] public PropertyBags CgmesDLModel.getTerminals()
[CALLS-INTERNAL] PropertyBags queryTripleStore(String queryKey)
[CALLS-EXTERNAL] LOG.info/1
*/
class CgmesDLModel {
public PropertyBags getTerminals() {
LOG.info("Querying triple store for terminals");
return queryTripleStore... | true | ok | {"focal": {"class": "CgmesDLModel", "name": "getTerminals", "signature": "PropertyBags getTerminals()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "PropertyBags"}, "class_info": {"name": "CgmesDLModel", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name... |
215203638_16 | class NotificationFactory {
PushNotification handleMessage(@NonNull RemoteMessage message)
throws InvalidNotificationException {
return this.handleMessage(message.getData().get(MESSAGE_ID), message.getData().get(MESSAGE));
}
NotificationFactory(StorageClient storageClient);
Pus... | Map<String, String> baseMessage = generateBaseMessage();
baseMessage.remove(PushParser.CHALLENGE);
RemoteMessage remoteMessage = generateMockRemoteMessage(MESSAGE_ID, CORRECT_SECRET, baseMessage);
try {
notificationFactory.handleMessage(remoteMessage);
Assert.fai... | [FOCAL] PushNotification NotificationFactory.handleMessage(RemoteMessage message)
[CLASS] class NotificationFactory
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] PushNotification handleMessage(String messageId, String message)
[CALLS-EXTERNAL] message.getData().get/1, RemoteMessa... | /* static context
[FOCAL] PushNotification NotificationFactory.handleMessage(RemoteMessage message)
[INPUTS] branches=- | result=message
[COLLABORATORS] param message:RemoteMessage getData/0
[EXCEPTIONS] declares InvalidNotificationException
[CALLS-INTERNAL] PushNotification handleMessage(String messageId, String messa... | /* static context
[FOCAL] PushNotification NotificationFactory.handleMessage(RemoteMessage message)
[INPUTS] branches=- | result=message
[COLLABORATORS] param message:RemoteMessage getData/0
[EXCEPTIONS] declares InvalidNotificationException
[CALLS-INTERNAL] PushNotification handleMessage(String messageId, String messa... | true | ok | {"focal": {"class": "NotificationFactory", "name": "handleMessage", "signature": "PushNotification handleMessage(RemoteMessage message) throws InvalidNotificationException", "start_line": 3, "modifiers": "", "params": [{"name": "message", "type": "RemoteMessage"}], "return_type": "PushNotification"}, "class_info": {"na... |
215394390_112 | class BlockUtils {
public static boolean isNullRow(Block block, int row)
{
if (row > block.getRowCount() - 1) {
throw new RuntimeException("block has " + block.getRowCount()
+ " rows but requested to check " + row);
}
//If any column is non-null then ret... | Schema schema = SchemaBuilder.newBuilder()
.addField("col1", new ArrowType.Int(32, true))
.addField("col2", new ArrowType.Int(32, true))
.addField("col3", new ArrowType.Timestamp(org.apache.arrow.vector.types.TimeUnit.MILLISECOND, "UTC"))
.build();... | [FOCAL] public static boolean BlockUtils.isNullRow(Block block, int row)
[CLASS] class BlockUtils
[METRICS] loc=17 cc=4 branches=2 loops=1 returns=2 throws=1 nesting=2
[CALLS-EXTERNAL] Block.getRowCount/0, Block.getFieldReaders/0, FieldReader.setPosition/1, FieldReader.isSet/0
[NEW] RuntimeException
[EXCEPTIONS] throws... | /* static context
[FOCAL] public static boolean BlockUtils.isNullRow(Block block, int row)
[THROWS-WHEN] RuntimeException when row > block.getRowCount() - 1
[PATH1] if(row > block.getRowCount() - 1)=F -> foreach(FieldReader src : block.getFieldReaders())=T -> if(src.isSet())=F -> exit loop -> return true
[PATH2] if(row... | /* static context
[FOCAL] public static boolean BlockUtils.isNullRow(Block block, int row)
[THROWS-WHEN] RuntimeException when row > block.getRowCount() - 1
[PATH1] if(row > block.getRowCount() - 1)=F -> foreach(FieldReader src : block.getFieldReaders())=T -> if(src.isSet())=F -> exit loop -> return true
[PATH2] if(row... | true | ok | {"focal": {"class": "BlockUtils", "name": "isNullRow", "signature": "boolean isNullRow(Block block, int row)", "start_line": 3, "modifiers": "public static", "params": [{"name": "block", "type": "Block"}, {"name": "row", "type": "int"}], "return_type": "boolean"}, "class_info": {"name": "BlockUtils", "kind": "class", "... |
215496017_7 | class KonduitPythonUtils {
public static void insertBytesIntoPythonVariables(Data ret, PythonVariables outputs, String variable, PythonConfig pythonConfig) throws IOException {
PythonIO pythonIO = pythonConfig.getIoOutputs().get(variable);
Preconditions.checkState(pythonConfig.getIoOutputs().contai... | PythonIO lenOutput = PythonIO.builder()
.name("len_input")
.type(ValueType.INT64)
.pythonType("int")
.build();
PythonIO pythonInput = PythonIO.builder()
.type(ValueType.BYTES)
.pythonType("bytes")
... | [FOCAL] public static void KonduitPythonUtils.insertBytesIntoPythonVariables(Data ret, PythonVariables outputs, String variable, PythonConfig pythonConfig)
[CLASS] class KonduitPythonUtils
[METRICS] loc=51 cc=6 branches=2 loops=0 returns=0 throws=1 nesting=2
[CALLS-INTERNAL] T getWithType(PythonVariables getFrom, Strin... | /* static context
[FOCAL] public static void KonduitPythonUtils.insertBytesIntoPythonVariables(Data ret, PythonVariables outputs, String variable, PythonConfig pythonConfig)
[THROWS-WHEN] IllegalArgumentException when switch(byteOutputValueType)=default
[PATH1] switch(byteOutputValueType)=case IMAGE -> if(byteBuffer1.h... | /* static context
[FOCAL] public static void KonduitPythonUtils.insertBytesIntoPythonVariables(Data ret, PythonVariables outputs, String variable, PythonConfig pythonConfig)
[THROWS-WHEN] IllegalArgumentException when switch(byteOutputValueType)=default
[PATH1] switch(byteOutputValueType)=case IMAGE -> if(byteBuffer1.h... | true | ok | {"focal": {"class": "KonduitPythonUtils", "name": "insertBytesIntoPythonVariables", "signature": "void insertBytesIntoPythonVariables(Data ret, PythonVariables outputs, String variable, PythonConfig pythonConfig) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "ret", "type": "Dat... |
215605392_4 | class CreateHandler extends BaseHandler<CallbackContext> {
@Override
public ProgressEvent<ResourceModel, CallbackContext> handleRequest(
final AmazonWebServicesClientProxy proxy,
final ResourceHandlerRequest<ResourceModel> request,
final CallbackContext callbackContext,
... | CreateHandler createHandler = new CreateHandler(alertApiClient);
// do some before assertions
assertThat(model.getNrqlCondition().getId()).isNull();
assertThat(model.getNrqlCondition().getName()).isEqualTo("TestNRQLCondition");
// oh no, bad request! Throw an exception.
... | [FOCAL] @Override public ProgressEvent<ResourceModel, CallbackContext> CreateHandler.handleRequest(AmazonWebServicesClientProxy proxy, ResourceHandlerRequest<ResourceModel> request, CallbackContext callbackContext, Logger logger)
[CLASS] class CreateHandler extends BaseHandler<CallbackContext>
[METRICS] loc=37 cc=2 bra... | /* static context
[FOCAL] @Override public ProgressEvent<ResourceModel, CallbackContext> CreateHandler.handleRequest(AmazonWebServicesClientProxy proxy, ResourceHandlerRequest<ResourceModel> request, CallbackContext callbackContext, Logger logger)
[PATH1] try-body throws -> return ProgressEvent.<ResourceModel, Callback... | /* static context
[FOCAL] @Override public ProgressEvent<ResourceModel, CallbackContext> CreateHandler.handleRequest(AmazonWebServicesClientProxy proxy, ResourceHandlerRequest<ResourceModel> request, CallbackContext callbackContext, Logger logger)
[PATH1] try-body throws -> return ProgressEvent.<ResourceModel, Callback... | true | ok | {"focal": {"class": "CreateHandler", "name": "handleRequest", "signature": "ProgressEvent<ResourceModel, CallbackContext> handleRequest(AmazonWebServicesClientProxy proxy, ResourceHandlerRequest<ResourceModel> request, CallbackContext callbackContext, Logger logger)", "start_line": 3, "modifiers": "@Override public", "... |
215680638_2 | class CynosureController extends Controller {
@Action(method = HttpMethod.GET)
public ActionResult refresh_provider(HttpContext context) {
String path = context.Request.getParams().get("path");
logger.info("path:" + path);
JsonResult jsonResult = cynosureService.queryProviderOrConsumerL... | ConfigManager.getInstance().put(ConfigManager.KEY_ZKSTR,server.getConnectString());
ZkHelper zkHelper = ZkInstanceUtil.getInstance();
zkHelper.addPersistent("/root/data/a/data","{\"a\":1}");
zkHelper.addPersistent("/root/data/b/data","{\"a\":2}");
zkHelper.addPersistent("/root/d... | [FOCAL] @Action(method = HttpMethod.GET) public ActionResult CynosureController.refresh_provider(HttpContext context)
[CLASS] class CynosureController extends Controller
[METRICS] loc=16 cc=2 branches=0 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] context.Request.getParams().get/1, context.Request.getParams/0,... | /* static context
[FOCAL] @Action(method = HttpMethod.GET) public ActionResult CynosureController.refresh_provider(HttpContext context)
[PATH1] try-body throws -> return actionResult
[INPUTS] branches=- | result=context
[COLLABORATORS] field cynosureService queryProviderOrConsumerList/1
[EXCEPTIONS] catches Unsupported... | /* static context
[FOCAL] @Action(method = HttpMethod.GET) public ActionResult CynosureController.refresh_provider(HttpContext context)
[PATH1] try-body throws -> return actionResult
[INPUTS] branches=- | result=context
[COLLABORATORS] field cynosureService queryProviderOrConsumerList/1
[EXCEPTIONS] catches Unsupported... | true | ok | {"focal": {"class": "CynosureController", "name": "refresh_provider", "signature": "ActionResult refresh_provider(HttpContext context)", "start_line": 3, "modifiers": "@Action(method = HttpMethod.GET) public", "params": [{"name": "context", "type": "HttpContext"}], "return_type": "ActionResult"}, "class_info": {"name":... |
215805400_0 | class IDGenerator {
public static String newCeptaID() {
return String.format("CPTA-%s", UUID.randomUUID().toString());
}
}
class IDGeneratorTest {
@Test
public void testGeneratesUniqueIds() {
| List<String> ids = Arrays.asList(new String[1000]).parallelStream().map(i -> IDGenerator.newCeptaID())
.collect(Collectors.toList());
Assert.assertFalse(hasDuplicates(ids));
}
} | [FOCAL] public static String IDGenerator.newCeptaID()
[CLASS] class IDGenerator
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] String.format/2, UUID.randomUUID().toString/0, UUID.randomUUID/0
[TEST] IDGeneratorTest: @Test public void testGeneratesUniqueIds() | /* static context
[FOCAL] public static String IDGenerator.newCeptaID()
[CALLS-EXTERNAL] String.format/2, UUID.randomUUID().toString/0, UUID.randomUUID/0
*/
| /* static context
[FOCAL] public static String IDGenerator.newCeptaID()
[CALLS-EXTERNAL] String.format/2, UUID.randomUUID().toString/0, UUID.randomUUID/0
*/
class IDGenerator {
public static String newCeptaID() {
return String.format("CPTA-%s", UUID.randomUUID().toString());
}
}
class IDGeneratorTest... | true | ok | {"focal": {"class": "IDGenerator", "name": "newCeptaID", "signature": "String newCeptaID()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "String"}, "class_info": {"name": "IDGenerator", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": []}... |
215881965_0 | class StanfordCoreNLPService {
public Map<String, List<String>> extractEntities(final String text, final String entityTypes) throws RuntimeException {
final String[] entityTypeList = entityTypes.split((","));
boolean extractLocations = false;
final List<String> locationNerTagList = new ArrayList<String>(... | StanfordCoreNLPService svc = new StanfordCoreNLPService(StanfordCoreNLPService.createPipeline(null));
final String text = "ALBUQUERQUE, N.M. — A worldwide film production company is expanding to Albuquerque, according to Albuquerque Business First. The company, Production Resource Group, has worked on various ... | [FOCAL] public Map<String, List<String>> StanfordCoreNLPService.extractEntities(String text, String entityTypes)
[CLASS] class StanfordCoreNLPService
[METRICS] loc=53 cc=8 branches=5 loops=2 returns=1 throws=1 nesting=2
[CALLS-EXTERNAL] String.split/1, List<String>.add/1, Map<String, List<String>>.put/2, String.equals/... | /* static context
[FOCAL] public Map<String, List<String>> StanfordCoreNLPService.extractEntities(String text, String entityTypes)
[THROWS-WHEN] RuntimeException when foreach(String tag : entityTypeList)=T && tag.equals("location") && annotation.containsKey(CoreAnnotations.ExceptionAnnotation.class)
[THROWS-WHEN] Runti... | /* static context
[FOCAL] public Map<String, List<String>> StanfordCoreNLPService.extractEntities(String text, String entityTypes)
[THROWS-WHEN] RuntimeException when foreach(String tag : entityTypeList)=T && tag.equals("location") && annotation.containsKey(CoreAnnotations.ExceptionAnnotation.class)
[THROWS-WHEN] Runti... | true | ok | {"focal": {"class": "StanfordCoreNLPService", "name": "extractEntities", "signature": "Map<String, List<String>> extractEntities(String text, String entityTypes) throws RuntimeException", "start_line": 3, "modifiers": "public", "params": [{"name": "text", "type": "String"}, {"name": "entityTypes", "type": "String"}], "... |
215941972_171 | class GenericFilter implements Filter {
@Override
public Result invoke(Invoker<?> invoker, Invocation inv) throws RpcException {
if (inv.getMethodName().equals(Constants.$INVOKE)
&& inv.getArguments() != null
&& inv.getArguments().length == 3
&& !GenericS... |
Method genericInvoke = GenericService.class.getMethods()[0];
Map<String, Object> person = new HashMap<String, Object>();
person.put("name", "dubbo");
person.put("age", 10);
RpcInvocation invocation = new RpcInvocation("sayHi", genericInvoke.getParameterTypes()
... | [FOCAL] @Override public Result GenericFilter.invoke(Invoker<?> invoker, Invocation inv)
[CLASS] class GenericFilter implements Filter
[METRICS] loc=88 cc=22 branches=11 loops=2 returns=5 throws=6 nesting=7
[CALLS-EXTERNAL] inv.getMethodName().equals/1, Invocation.getMethodName/0, Invocation.getArguments/0, GenericServ... | /* static context
[FOCAL] @Override public Result GenericFilter.invoke(Invoker<?> invoker, Invocation inv)
[THROWS-WHEN] RpcException when (inv.getMethodName().equals(Constants.$INVOKE) && inv.getArguments() != null && inv.getArguments().length == 3 && !Ge... && try-body throws
[THROWS-WHEN] RpcException when (inv.getM... | /* static context
[FOCAL] @Override public Result GenericFilter.invoke(Invoker<?> invoker, Invocation inv)
[THROWS-WHEN] RpcException when (inv.getMethodName().equals(Constants.$INVOKE) && inv.getArguments() != null && inv.getArguments().length == 3 && !Ge... && try-body throws
[THROWS-WHEN] RpcException when (inv.getM... | true | ok | {"focal": {"class": "GenericFilter", "name": "invoke", "signature": "Result invoke(Invoker<?> invoker, Invocation inv) throws RpcException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "invoker", "type": "Invoker<?>"}, {"name": "inv", "type": "Invocation"}], "return_type": "Result"}, "class_in... |
215950115_181 | class ClientConfigHelper {
public Map<String, ConsumerGroupVo> getConfig() {
try {
InputStream inputStream = getConfigFileStream();
return getConfig(inputStream);
} catch (Exception ex) {
log.error("加载配置文件异常,异常信息:" + ex.getMessage(), ex);
throw new RuntimeException(ex);
}
}
public ClientConfigH... | try {
Map<String, ConsumerGroupVo> maps = ClientConfigHelper.getConfig(consumerError);
assertEquals("consumerError 解析异常", 1, maps.size());
} catch (Exception e) {
// TODO: handle exception
}
try {
Map<String, ConsumerGroupVo> maps = ClientConfigHelper.getConfig(consumerGroupError);
assertEquals("... | [FOCAL] public Map<String, ConsumerGroupVo> ClientConfigHelper.getConfig()
[CLASS] class ClientConfigHelper
[METRICS] loc=10 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-INTERNAL] InputStream getConfigFileStream(); Map<String, ConsumerGroupVo> getConfig(String xml)
[CALLS-EXTERNAL] log.error/2, Exception... | /* static context
[FOCAL] public Map<String, ConsumerGroupVo> ClientConfigHelper.getConfig()
[THROWS-WHEN] RuntimeException when try-body throws
[PATH1] try-body throws -> throw new RuntimeException(ex)
[PATH2] return getConfig(inputStream)
[EXCEPTIONS] throws RuntimeException; catches Exception ex
[CALLS-INTERNAL] Inp... | /* static context
[FOCAL] public Map<String, ConsumerGroupVo> ClientConfigHelper.getConfig()
[THROWS-WHEN] RuntimeException when try-body throws
[PATH1] try-body throws -> throw new RuntimeException(ex)
[PATH2] return getConfig(inputStream)
[EXCEPTIONS] throws RuntimeException; catches Exception ex
[CALLS-INTERNAL] Inp... | true | ok | {"focal": {"class": "ClientConfigHelper", "name": "getConfig", "signature": "Map<String, ConsumerGroupVo> getConfig()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Map<String, ConsumerGroupVo>"}, "class_info": {"name": "ClientConfigHelper", "kind": "class", "modifiers": "", "superclass": null,... |
216000802_8 | class RqueueConfig {
public String getProcessingQueueChannelName(String queueName) {
if (dbVersion == 1) {
return "rqueue-processing-channel::" + queueName;
}
return prefix + getProcessingQueueChannelSuffix() + getTaggedName(queueName);
}
public String getQueuesKey();
private String getSimpl... | assertEquals(
"rqueue-processing-channel::test",
rqueueConfigVersion1.getProcessingQueueChannelName("test"));
assertEquals(
"__rq::p-channel::test", rqueueConfigVersion2.getProcessingQueueChannelName("test"));
assertEquals(
"__rq::p-channel::{test}",
rqueueConfigVersi... | [FOCAL] public String RqueueConfig.getProcessingQueueChannelName(String queueName)
[CLASS] class RqueueConfig
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] String getProcessingQueueChannelSuffix(); String getTaggedName(String queueName)
[PATH1] if(dbVersion == 1)=T -> return "rqu... | /* static context
[FOCAL] public String RqueueConfig.getProcessingQueueChannelName(String queueName)
[PATH1] if(dbVersion == 1)=T -> return "rqueue-processing-channel::" + queueName
[PATH2] if(dbVersion == 1)=F -> return prefix + getProcessingQueueChannelSuffix() + getTaggedName(queueName)
[INPUTS] branches=- | result=... | /* static context
[FOCAL] public String RqueueConfig.getProcessingQueueChannelName(String queueName)
[PATH1] if(dbVersion == 1)=T -> return "rqueue-processing-channel::" + queueName
[PATH2] if(dbVersion == 1)=F -> return prefix + getProcessingQueueChannelSuffix() + getTaggedName(queueName)
[INPUTS] branches=- | result=... | true | ok | {"focal": {"class": "RqueueConfig", "name": "getProcessingQueueChannelName", "signature": "String getProcessingQueueChannelName(String queueName)", "start_line": 3, "modifiers": "public", "params": [{"name": "queueName", "type": "String"}], "return_type": "String"}, "class_info": {"name": "RqueueConfig", "kind": "class... |
216204232_22 | class JdbcSpitterRepository implements SpitterRepository {
public Spitter findOne(long id) {
return jdbcTemplate.queryForObject(
SELECT_SPITTER + " where id=?", new SpitterRowMapper(), id);
}
@Autowired public JdbcSpitterRepository(JdbcTemplate jdbcTemplate);
@CacheEvict(key="123", value = { "spittleCac... | assertSpitter(0, spitterRepository.findOne(1L));
assertSpitter(1, spitterRepository.findOne(2L));
assertSpitter(2, spitterRepository.findOne(3L));
assertSpitter(3, spitterRepository.findOne(4L));
}
} | [FOCAL] public Spitter JdbcSpitterRepository.findOne(long id)
[CLASS] class JdbcSpitterRepository implements SpitterRepository
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] jdbcTemplate.queryForObject/3
[NEW] SpitterRowMapper
[INPUTS] branches=- | result=id
[COLLABORATORS] field ... | /* static context
[FOCAL] public Spitter JdbcSpitterRepository.findOne(long id)
[INPUTS] branches=- | result=id
[COLLABORATORS] field jdbcTemplate queryForObject/3
[NEW] SpitterRowMapper
[CALLS-EXTERNAL] jdbcTemplate.queryForObject/3
*/
| /* static context
[FOCAL] public Spitter JdbcSpitterRepository.findOne(long id)
[INPUTS] branches=- | result=id
[COLLABORATORS] field jdbcTemplate queryForObject/3
[NEW] SpitterRowMapper
[CALLS-EXTERNAL] jdbcTemplate.queryForObject/3
*/
class JdbcSpitterRepository implements SpitterRepository {
public Spitter findOn... | true | ok | {"focal": {"class": "JdbcSpitterRepository", "name": "findOne", "signature": "Spitter findOne(long id)", "start_line": 3, "modifiers": "public", "params": [{"name": "id", "type": "long"}], "return_type": "Spitter"}, "class_info": {"name": "JdbcSpitterRepository", "kind": "class", "modifiers": "", "superclass": null, "i... |
216231037_5 | class HeroController {
@PostMapping("/hero/new")
public String addNewHero(@ModelAttribute("newHero") NewHeroModel newHeroModel) {
Hero hero = newHeroModel.getHero();
String repositoryName = newHeroModel.getRepository();
heroService.addHeroToRepository(hero, repositoryName);
retu... | NewHeroModel model = mock(NewHeroModel.class);
when(model.getRepository()).thenReturn(REPOSITORY);
when(model.getHero()).thenReturn(new Hero());
String view = subjectUnderTest.addNewHero(model);
assertThat(view).isEqualTo("redirect:/hero");
verify(heroService).addHeroToRe... | [FOCAL] @PostMapping("/hero/new") public String HeroController.addNewHero(NewHeroModel newHeroModel)
[CLASS] class HeroController
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] NewHeroModel.getHero/0, NewHeroModel.getRepository/0, HeroService.addHeroToRepository/2
[FIELDS] read=he... | /* static context
[FOCAL] @PostMapping("/hero/new") public String HeroController.addNewHero(NewHeroModel newHeroModel)
[COLLABORATORS] param newHeroModel:NewHeroModel getHero/0,getRepository/0; field heroService:HeroService addHeroToRepository/2
[FIELDS] read=heroService:HeroService
[CALLS-EXTERNAL] NewHeroModel.getHer... | /* static context
[FOCAL] @PostMapping("/hero/new") public String HeroController.addNewHero(NewHeroModel newHeroModel)
[COLLABORATORS] param newHeroModel:NewHeroModel getHero/0,getRepository/0; field heroService:HeroService addHeroToRepository/2
[FIELDS] read=heroService:HeroService
[CALLS-EXTERNAL] NewHeroModel.getHer... | true | ok | {"focal": {"class": "HeroController", "name": "addNewHero", "signature": "String addNewHero(NewHeroModel newHeroModel)", "start_line": 3, "modifiers": "@PostMapping(\"/hero/new\") public", "params": [{"name": "newHeroModel", "type": "NewHeroModel"}], "return_type": "String"}, "class_info": {"name": "HeroController", "k... |
216526613_4 | class RotationImpl implements Rotation {
@Override
public void rotate() {
locker.executeWithLock(this::doRotate);
}
@Inject @SuppressWarnings("checkstyle:ParameterNumber") // public RotationImpl(KeyGenerator generator, KeyRotationConfig config,
Juggler juggler, @Nullab... | // Fills the keystore
rotation.rotate();
Set<String> expiredIds = entries().all().stream().map(KeyAlias::getAlias).collect(Collectors.toSet());
assertThat(expiredIds).hasSize(2 * NUM_VALID);
when(timeSource.instant()).thenReturn(BASE_TIME.plus(VALIDITY_DT).plusSeconds(1));
... | [FOCAL] @Override public void RotationImpl.rotate()
[CLASS] class RotationImpl implements Rotation
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] RotationLocker.executeWithLock/1
[FIELDS] read=locker:RotationLocker
[COLLABORATORS] field locker:RotationLocker executeWithLock/1
[DAT... | /* static context
[FOCAL] @Override public void RotationImpl.rotate()
[COLLABORATORS] field locker:RotationLocker executeWithLock/1
[FIELDS] read=locker:RotationLocker
[CALLS-EXTERNAL] RotationLocker.executeWithLock/1
*/
| /* static context
[FOCAL] @Override public void RotationImpl.rotate()
[COLLABORATORS] field locker:RotationLocker executeWithLock/1
[FIELDS] read=locker:RotationLocker
[CALLS-EXTERNAL] RotationLocker.executeWithLock/1
*/
class RotationImpl implements Rotation {
@Override
public void rotate() {
locker.e... | true | ok | {"focal": {"class": "RotationImpl", "name": "rotate", "signature": "void rotate()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "RotationImpl", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Rotation", "fields": [{"name": "juggler"... |
216840838_64 | class StigmaExtractor {
@Nullable
public Stigma extractStigma(@Nonnull final RawStigmaToken stigmaToken) {
Assert.notNull(stigmaToken, "stigmaToken must not be null");
final JWT jwt;
try {
jwt = JWTParser.parse(stigmaToken.getValue());
} catch (ParseException e) {
... | // given
given(tokenDecrypter.decrypt(any(com.nimbusds.jwt.JWT.class))).willReturn(decryptedToken);
given(decryptedToken.isValid()).willReturn(false);
// when
final Stigma stigma = stigmaExtractor.extractStigma(STIGMA_TOKEN);
// then
assertThat(stigma).isNull();... | [FOCAL] @Nullable public Stigma StigmaExtractor.extractStigma(RawStigmaToken stigmaToken)
[CLASS] class StigmaExtractor
[METRICS] loc=36 cc=8 branches=6 loops=0 returns=4 throws=0 nesting=2
[CALLS-EXTERNAL] Assert.notNull/2, JWTParser.parse/1, RawStigmaToken.getValue/0, logger.isDebugEnabled/0, logger.debug/2, TokenDec... | /* static context
[FOCAL] @Nullable public Stigma StigmaExtractor.extractStigma(RawStigmaToken stigmaToken)
[PATH1] if(!decryptedToken.isValid())=F -> if(!parsedToken.isValid())=T -> if(logger.isDebugEnabled())#3=T -> return null
[PATH2] if(!decryptedToken.isValid())=F -> if(!parsedToken.isValid())=F -> if(logger.isTra... | /* static context
[FOCAL] @Nullable public Stigma StigmaExtractor.extractStigma(RawStigmaToken stigmaToken)
[PATH1] if(!decryptedToken.isValid())=F -> if(!parsedToken.isValid())=T -> if(logger.isDebugEnabled())#3=T -> return null
[PATH2] if(!decryptedToken.isValid())=F -> if(!parsedToken.isValid())=F -> if(logger.isTra... | true | ok | {"focal": {"class": "StigmaExtractor", "name": "extractStigma", "signature": "Stigma extractStigma(RawStigmaToken stigmaToken)", "start_line": 3, "modifiers": "@Nullable public", "params": [{"name": "stigmaToken", "type": "RawStigmaToken"}], "return_type": "Stigma"}, "class_info": {"name": "StigmaExtractor", "kind": "c... |
216898288_0 | class HeapMonitorPipeline {
public static DataStream<HeapAlert> computeHeapAlerts(DataStream<HeapMetrics> statsInput, ParameterTool params) {
return statsInput.flatMap(new AlertingFunction(params)).name("Create Alerts");
}
public static void main(String[] args);
private static Set<HeapAlert> testOutput;
}
cl... |
final String alertMask = "42";
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
HeapMetrics alert1 = testStats(0.42);
HeapMetrics regular1 = testStats(0.452);
HeapMetrics regular2 = testStats(0.245);
HeapMetrics alert2 = testStats(0.9423);
DataStreamSource<HeapMet... | [FOCAL] public static DataStream<HeapAlert> HeapMonitorPipeline.computeHeapAlerts(DataStream<HeapMetrics> statsInput, ParameterTool params)
[CLASS] class HeapMonitorPipeline
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] statsInput.flatMap(new AlertingFunction(params)).name/1, Dat... | /* static context
[FOCAL] public static DataStream<HeapAlert> HeapMonitorPipeline.computeHeapAlerts(DataStream<HeapMetrics> statsInput, ParameterTool params)
[INPUTS] branches=- | result=params, statsInput
[COLLABORATORS] param statsInput:DataStream<HeapMetrics> flatMap/1
[NEW] AlertingFunction
[CALLS-EXTERNAL] statsIn... | /* static context
[FOCAL] public static DataStream<HeapAlert> HeapMonitorPipeline.computeHeapAlerts(DataStream<HeapMetrics> statsInput, ParameterTool params)
[INPUTS] branches=- | result=params, statsInput
[COLLABORATORS] param statsInput:DataStream<HeapMetrics> flatMap/1
[NEW] AlertingFunction
[CALLS-EXTERNAL] statsIn... | true | ok | {"focal": {"class": "HeapMonitorPipeline", "name": "computeHeapAlerts", "signature": "DataStream<HeapAlert> computeHeapAlerts(DataStream<HeapMetrics> statsInput, ParameterTool params)", "start_line": 3, "modifiers": "public static", "params": [{"name": "statsInput", "type": "DataStream<HeapMetrics>"}, {"name": "params"... |
217054700_44 | class ByteUtil {
public static byte[] merge(byte[] ... byteArrays){
ByteArrayOutputStream outputStream = new ByteArrayOutputStream( );
try {
for(byte[] a: byteArrays ){
outputStream.write( a );
}
} catch (IOException e){
log.debug("Failed ... | String random1 = RandomStringUtils.random(50, true, true);
byte[] expResult = (random1).getBytes();
byte[] result = ByteUtil.merge(random1.getBytes(), new byte[0]);
Assertions.assertArrayEquals(expResult, result);
}
} | [FOCAL] public static byte[] ByteUtil.merge(byte[]... byteArrays)
[CLASS] class ByteUtil
[METRICS] loc=11 cc=3 branches=0 loops=1 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] ByteArrayOutputStream.write/1, log.debug/1, ByteArrayOutputStream.toByteArray/0
[NEW] ByteArrayOutputStream
[EXCEPTIONS] catches IOException e
[... | /* static context
[FOCAL] public static byte[] ByteUtil.merge(byte[]... byteArrays)
[PATH1] foreach(byte[] a : byteArrays)=T -> exit loop -> return outputStream.toByteArray( )
[PATH2] try-body throws -> return outputStream.toByteArray( )
[PATH3] foreach(byte[] a : byteArrays)=F -> return outputStream.toByteArray( )
[IN... | /* static context
[FOCAL] public static byte[] ByteUtil.merge(byte[]... byteArrays)
[PATH1] foreach(byte[] a : byteArrays)=T -> exit loop -> return outputStream.toByteArray( )
[PATH2] try-body throws -> return outputStream.toByteArray( )
[PATH3] foreach(byte[] a : byteArrays)=F -> return outputStream.toByteArray( )
[IN... | true | ok | {"focal": {"class": "ByteUtil", "name": "merge", "signature": "byte[] merge(byte[]... byteArrays)", "start_line": 3, "modifiers": "public static", "params": [{"name": "byteArrays", "type": "byte[]..."}], "return_type": "byte[]"}, "class_info": {"name": "ByteUtil", "kind": "class", "modifiers": "", "superclass": null, "... |
217157573_2 | class ClusteredCompositeBlobStore implements BlobStore, ThreadCachingBean {
@Override
public boolean removeListener(BlobStoreListener listener) {
Boolean result = listeners.remove(listener);
cache.get().values().forEach(entry->{entry.store.removeListener(listener);});
StoreAndConfig def... | bsAgg = EasyMock.createMock("bsAgg", BlobStoreAggregator.class);
tld = EasyMock.createMock("tld", TileLayerDispatcher.class);
testBlobStoreInfo = EasyMock.createMock("testBlobStoreInfo", BlobStoreInfo.class);
testBlobStore1 = EasyMock.createMock("testBlobStore1", BlobStore.class... | [FOCAL] @Override public boolean ClusteredCompositeBlobStore.removeListener(BlobStoreListener listener)
[CLASS] class ClusteredCompositeBlobStore implements BlobStore, ThreadCachingBean
[METRICS] loc=10 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1
[CALLS-EXTERNAL] listeners.remove/1, cache.get().values().forEac... | /* static context
[FOCAL] @Override public boolean ClusteredCompositeBlobStore.removeListener(BlobStoreListener listener)
[PATH1] if(Objects.nonNull(defaultEntry))=T -> return result
[PATH2] if(Objects.nonNull(defaultEntry))=F -> return result
[INPUTS] branches=- | result=listener
[COLLABORATORS] field listeners remove... | /* static context
[FOCAL] @Override public boolean ClusteredCompositeBlobStore.removeListener(BlobStoreListener listener)
[PATH1] if(Objects.nonNull(defaultEntry))=T -> return result
[PATH2] if(Objects.nonNull(defaultEntry))=F -> return result
[INPUTS] branches=- | result=listener
[COLLABORATORS] field listeners remove... | true | ok | {"focal": {"class": "ClusteredCompositeBlobStore", "name": "removeListener", "signature": "boolean removeListener(BlobStoreListener listener)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "listener", "type": "BlobStoreListener"}], "return_type": "boolean"}, "class_info": {"name": "ClusteredCom... |
217172162_0 | class UserServiceImpl implements UserService {
@Override
public List<User> getUsers() {
return userRepository.findAll();
}
@Autowired public UserServiceImpl(UserRepository userRepository);
@Override public User getUser(long id);
@Override public User addUser(String nickname, String e... | //expected
List<User> expected = new ArrayList<>();
expected.add(new User(1L, "user1", "user1@mail.com", "pass"));
expected.add(new User(2L, "user2", "user2@mail.com", "test"));
//actual
List<User> actual = userService.getUsers();
//assert
assertEquals(e... | [FOCAL] @Override public List<User> UserServiceImpl.getUsers()
[CLASS] class UserServiceImpl implements UserService
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] UserRepository.findAll/0
[FIELDS] read=userRepository:UserRepository
[INPUTS] branches=- | result=userRepository
[COLL... | /* static context
[FOCAL] @Override public List<User> UserServiceImpl.getUsers()
[INPUTS] branches=- | result=userRepository
[COLLABORATORS] field userRepository:UserRepository findAll/0
[FIELDS] read=userRepository:UserRepository
[CALLS-EXTERNAL] UserRepository.findAll/0
*/
| /* static context
[FOCAL] @Override public List<User> UserServiceImpl.getUsers()
[INPUTS] branches=- | result=userRepository
[COLLABORATORS] field userRepository:UserRepository findAll/0
[FIELDS] read=userRepository:UserRepository
[CALLS-EXTERNAL] UserRepository.findAll/0
*/
class UserServiceImpl implements UserService... | true | ok | {"focal": {"class": "UserServiceImpl", "name": "getUsers", "signature": "List<User> getUsers()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "List<User>"}, "class_info": {"name": "UserServiceImpl", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "UserService", "fie... |
217311696_5 | class DelegatingProperties extends Properties {
@Override
public Collection<Object> values() {
return environmentProperties.get().values();
}
public DelegatingProperties(Properties baseline);
private Properties buildNewEnvironment(Properties baseline);
@Override public synchronized Object get(Object key);
... | DelegatingProperties properties = propertiesWithRegularAndScopedKey("key", "key");
Collection<Object> values = properties.values();
assertThat(values).containsExactlyInAnyOrder("y");
}
} | [FOCAL] @Override public Collection<Object> DelegatingProperties.values()
[CLASS] class DelegatingProperties extends Properties
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] environmentProperties.get().values/0, environmentProperties.get/0
[COLLABORATORS] field environmentPropert... | /* static context
[FOCAL] @Override public Collection<Object> DelegatingProperties.values()
[COLLABORATORS] field environmentProperties get/0
[CALLS-EXTERNAL] environmentProperties.get().values/0, environmentProperties.get/0
*/
| /* static context
[FOCAL] @Override public Collection<Object> DelegatingProperties.values()
[COLLABORATORS] field environmentProperties get/0
[CALLS-EXTERNAL] environmentProperties.get().values/0, environmentProperties.get/0
*/
class DelegatingProperties extends Properties {
@Override
public Collection<Object> value... | true | ok | {"focal": {"class": "DelegatingProperties", "name": "values", "signature": "Collection<Object> values()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Collection<Object>"}, "class_info": {"name": "DelegatingProperties", "kind": "class", "modifiers": "", "superclass": "Properties", "in... |
217419171_3 | class SCMTriggerConverter extends SingleTypedConverter<SCMTrigger> {
@Override
public boolean convert(ConverterRequest request, ConverterResult result, Object target)
{
SCMTrigger scmTrigger = (SCMTrigger) target;
String cronValue = scmTrigger.getSpec();
ModelASTTrigger modelASTTr... | String projectName = Long.toString( System.currentTimeMillis() );
FreeStyleProject p = j.createFreeStyleProject( projectName );
SCMTrigger trigger = new SCMTrigger( "H */4 * * 1-5" );
p.addTrigger( trigger );
SCMTriggerConverter converter = j.jenkins
.getExtensionLi... | [FOCAL] @Override public boolean SCMTriggerConverter.convert(ConverterRequest request, ConverterResult result, Object target)
[CLASS] class SCMTriggerConverter extends SingleTypedConverter<SCMTrigger>
[METRICS] loc=14 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] SCMTrigger.getSpec/0, ModelASTTr... | /* static context
[FOCAL] @Override public boolean SCMTriggerConverter.convert(ConverterRequest request, ConverterResult result, Object target)
[INPUTS] branches=- | result=- | unused=request
[COLLABORATORS] param result:ConverterResult getModelASTPipelineDef/0
[NEW] ModelASTTrigger
[CALLS-EXTERNAL] SCMTrigger.getSpec/... | /* static context
[FOCAL] @Override public boolean SCMTriggerConverter.convert(ConverterRequest request, ConverterResult result, Object target)
[INPUTS] branches=- | result=- | unused=request
[COLLABORATORS] param result:ConverterResult getModelASTPipelineDef/0
[NEW] ModelASTTrigger
[CALLS-EXTERNAL] SCMTrigger.getSpec/... | true | ok | {"focal": {"class": "SCMTriggerConverter", "name": "convert", "signature": "boolean convert(ConverterRequest request, ConverterResult result, Object target)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "ConverterRequest"}, {"name": "result", "type": "ConverterResult"}, {"na... |
217479559_0 | class SimpleHttpsServer implements Callable<Integer> {
public void stop(int timeoutMillis) {
running = false;
if (debug) {
System.err.println("Stopping the HTTPS server (timeout " + timeoutMillis + " ms)");
}
httpsServer.stop(timeoutMillis);
}
public Integer cal... | PrintStream oldOut = System.out;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
SimpleHttpsServer server = new SimpleHttpsServer();
try {
System.setOut(new PrintStream(baos));
new CommandLine(server).execute("--port=7999");
String expected ... | [FOCAL] public void SimpleHttpsServer.stop(int timeoutMillis)
[CLASS] class SimpleHttpsServer implements Callable<Integer>
[METRICS] loc=7 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] System.err.println/1, httpsServer.stop/1
[PATH1] if(debug)=T
[PATH2] if(debug)=F
[COLLABORATORS] field httpsSer... | /* static context
[FOCAL] public void SimpleHttpsServer.stop(int timeoutMillis)
[PATH1] if(debug)=T
[PATH2] if(debug)=F
[COLLABORATORS] field httpsServer stop/1
[CALLS-EXTERNAL] System.err.println/1, httpsServer.stop/1
*/
| /* static context
[FOCAL] public void SimpleHttpsServer.stop(int timeoutMillis)
[PATH1] if(debug)=T
[PATH2] if(debug)=F
[COLLABORATORS] field httpsServer stop/1
[CALLS-EXTERNAL] System.err.println/1, httpsServer.stop/1
*/
class SimpleHttpsServer implements Callable<Integer> {
public void stop(int timeoutMillis) {
... | true | ok | {"focal": {"class": "SimpleHttpsServer", "name": "stop", "signature": "void stop(int timeoutMillis)", "start_line": 3, "modifiers": "public", "params": [{"name": "timeoutMillis", "type": "int"}], "return_type": "void"}, "class_info": {"name": "SimpleHttpsServer", "kind": "class", "modifiers": "", "superclass": null, "i... |
217587403_3 | class TextTranslations {
public static Component translate(Component text, Locale locale) {
return RENDERER.render(text, locale);
}
private TextTranslations();
public static SortedSet<String> getKeys();
public static Set<Locale> getLocales();
public static Locale getNearestLocale(Locale locale);
@... | final TranslatableComponent text = TranslatableComponent.of("entity.Creeper.name");
assertEquals(text, translate(text, US), "mojang translation did not pass-through");
}
} | [FOCAL] public static Component TextTranslations.translate(Component text, Locale locale)
[CLASS] class TextTranslations
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] RENDERER.render/2
[INPUTS] branches=- | result=locale, text
[DATAFLOW] locale@param->L2; text@param->L2
[CLASS-ME... | /* static context
[FOCAL] public static Component TextTranslations.translate(Component text, Locale locale)
[INPUTS] branches=- | result=locale, text
[CALLS-EXTERNAL] RENDERER.render/2
*/
| /* static context
[FOCAL] public static Component TextTranslations.translate(Component text, Locale locale)
[INPUTS] branches=- | result=locale, text
[CALLS-EXTERNAL] RENDERER.render/2
*/
class TextTranslations {
public static Component translate(Component text, Locale locale) {
return RENDERER.render(text, loca... | true | ok | {"focal": {"class": "TextTranslations", "name": "translate", "signature": "Component translate(Component text, Locale locale)", "start_line": 3, "modifiers": "public static", "params": [{"name": "text", "type": "Component"}, {"name": "locale", "type": "Locale"}], "return_type": "Component"}, "class_info": {"name": "Tex... |
218804581_3 | class StringUtil {
public static List<String> tokenize(String value,
String delimiters,
boolean trimTokens,
boolean ignoreEmptyTokens) {
List<String> tokens = new ArrayList<>();
if (value == nu... | List<String> result = StringUtil.tokenize(STR, DELIMITERS, false, false);
assertEquals(6, result.size());
assertEquals("a ", result.get(0));
assertEquals(" b", result.get(1));
assertEquals(" c ", result.get(2));
assertEquals("", result.get(3));
assertEquals("d", result.get(4));
assertEqu... | [FOCAL] public static List<String> StringUtil.tokenize(String value, String delimiters, boolean trimTokens, boolean ignoreEmptyTokens)
[CLASS] class StringUtil
[METRICS] loc=24 cc=5 branches=3 loops=1 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] String.split/1, String.trim/0, String.length/0, List<String>.add/1
[NEW] ... | /* static context
[FOCAL] public static List<String> StringUtil.tokenize(String value, String delimiters, boolean trimTokens, boolean ignoreEmptyTokens)
[PATH1] if(value == null)=F -> foreach(String token : st)=T -> if(trimTokens)=T -> if(!ignoreEmptyTokens || token.length() > 0)=T -> exit loop -> return tokens
[PATH2]... | /* static context
[FOCAL] public static List<String> StringUtil.tokenize(String value, String delimiters, boolean trimTokens, boolean ignoreEmptyTokens)
[PATH1] if(value == null)=F -> foreach(String token : st)=T -> if(trimTokens)=T -> if(!ignoreEmptyTokens || token.length() > 0)=T -> exit loop -> return tokens
[PATH2]... | true | ok | {"focal": {"class": "StringUtil", "name": "tokenize", "signature": "List<String> tokenize(String value, String delimiters, boolean trimTokens, boolean ignoreEmptyTokens)", "start_line": 3, "modifiers": "public static", "params": [{"name": "value", "type": "String"}, {"name": "delimiters", "type": "String"}, {"name": "t... |
218912806_9 | class TaskHandler {
public boolean completeTaskByTaskID(String taskID){
try {
processEngine.getTaskService()
.complete(taskID);
} catch (ActivitiObjectNotFoundException e) {
logger.info("[任务完成操作失败] " + e.getMessage());
return false;
}
... | // Assert.assertFalse(ts.completeTaskByTaskID("6666"));
Assert.assertTrue(ts.completeTaskByTaskID("25005"));
}
} | [FOCAL] public boolean TaskHandler.completeTaskByTaskID(String taskID)
[CLASS] class TaskHandler
[METRICS] loc=11 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] processEngine.getTaskService().complete/1, processEngine.getTaskService/0, Logger.info/1, ActivitiObjectNotFoundException.getMessage/0
[... | /* static context
[FOCAL] public boolean TaskHandler.completeTaskByTaskID(String taskID)
[PATH1] try-body throws -> return false
[PATH2] return true
[COLLABORATORS] field processEngine getTaskService/0
[EXCEPTIONS] catches ActivitiObjectNotFoundException e
[FIELDS] read=logger:Logger
[CALLS-EXTERNAL] processEngine.getT... | /* static context
[FOCAL] public boolean TaskHandler.completeTaskByTaskID(String taskID)
[PATH1] try-body throws -> return false
[PATH2] return true
[COLLABORATORS] field processEngine getTaskService/0
[EXCEPTIONS] catches ActivitiObjectNotFoundException e
[FIELDS] read=logger:Logger
[CALLS-EXTERNAL] processEngine.getT... | true | ok | {"focal": {"class": "TaskHandler", "name": "completeTaskByTaskID", "signature": "boolean completeTaskByTaskID(String taskID)", "start_line": 3, "modifiers": "public", "params": [{"name": "taskID", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "TaskHandler", "kind": "class", "modifiers": "", "sup... |
219180652_0 | class BlockState {
@Override
public String toString() {
StringJoiner sj = new StringJoiner(",");
for (Entry<String, String> e : getProperties().entrySet()){
sj.add(e.getKey() + "=" + e.getValue());
}
return getFullId() + "[" + sj.toString() + "]";
}
public BlockState(String id);
public BlockState... | BlockState blockState = new BlockState("someblock");
assertEquals("minecraft:someblock[]", blockState.toString());
blockState = blockState.with("testProp", "testVal");
assertEquals("minecraft:someblock[testProp=testVal]", blockState.toString());
blockState = blockState.with("testProp2", "testVal2");
Str... | [FOCAL] @Override public String BlockState.toString()
[CLASS] class BlockState
[METRICS] loc=9 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1
[CALLS-INTERNAL] Map<String, String> getProperties(); String getFullId()
[CALLS-EXTERNAL] getProperties().entrySet/0, StringJoiner.add/1, Entry<String, String>.getKey/0, En... | /* static context
[FOCAL] @Override public String BlockState.toString()
[PATH1] foreach(Entry<String, String> e : getProperties().entrySet())=T -> exit loop -> return getFullId() + "[" + sj.toString() + "]"
[PATH2] foreach(Entry<String, String> e : getProperties().entrySet())=F -> return getFullId() + "[" + sj.toString... | /* static context
[FOCAL] @Override public String BlockState.toString()
[PATH1] foreach(Entry<String, String> e : getProperties().entrySet())=T -> exit loop -> return getFullId() + "[" + sj.toString() + "]"
[PATH2] foreach(Entry<String, String> e : getProperties().entrySet())=F -> return getFullId() + "[" + sj.toString... | true | ok | {"focal": {"class": "BlockState", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "BlockState", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"nam... |
219454065_18 | class Recipient {
public void markNotified(@NonNull NotificationType type) {
Validate.notNull(type);
Optional.ofNullable(getNotifications().get(type))
.ifPresent(settings -> {
Validate.isTrue(settings.isActive());
settings.markNotified();
... | NotificationSettings backup = NotificationSettings.builder()
.active(false)
.frequency(Frequency.MONTHLY)
.build();
Recipient recipient = Recipient.builder()
.username(USERNAME)
.email(EMAIL)
.notification(No... | [FOCAL] public void Recipient.markNotified(NotificationType type)
[CLASS] class Recipient
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] Validate.notNull/1, Optional.ofNullable(getNotifications().get(type)).ifPresent/1, Optional.ofNullable/1, getNotifications().get/1, getNotificat... | /* static context
[FOCAL] public void Recipient.markNotified(NotificationType type)
[COLLABORATORS] field settings isActive/0,markNotified/0
[CALLS-EXTERNAL] Validate.notNull/1, Optional.ofNullable(getNotifications().get(type)).ifPresent/1, Optional.ofNullable/1, getNotifications().get/1, getNotifications/0 (inherited)... | /* static context
[FOCAL] public void Recipient.markNotified(NotificationType type)
[COLLABORATORS] field settings isActive/0,markNotified/0
[CALLS-EXTERNAL] Validate.notNull/1, Optional.ofNullable(getNotifications().get(type)).ifPresent/1, Optional.ofNullable/1, getNotifications().get/1, getNotifications/0 (inherited)... | true | ok | {"focal": {"class": "Recipient", "name": "markNotified", "signature": "void markNotified(NotificationType type)", "start_line": 3, "modifiers": "public", "params": [{"name": "type", "type": "NotificationType"}], "return_type": "void"}, "class_info": {"name": "Recipient", "kind": "class", "modifiers": "", "superclass": ... |
219701790_135 | class CosineProc extends AlphaSimilarityProc<CosineAlgorithm, CosineConfig> {
@Procedure(name = "gds.alpha.similarity.cosine.stream", mode = READ)
@Description(DESCRIPTION)
public Stream<SimilarityResult> cosineStream(
@Name(value = "graphName") Object graphNameOrConfig,
@Name(value = "conf... | runQueryWithResultConsumer(STATEMENT_STREAM, map("config", map("concurrency", 1, "topK", 0), "missingValue", 0),
results -> {
assertTrue(results.hasNext());
assert01(results.next());
assert02(results.next());
assert03(results.next());
... | [FOCAL] @Procedure(name = "gds.alpha.similarity.cosine.stream", mode = READ) @Description(DESCRIPTION) public Stream<SimilarityResult> CosineProc.cosineStream(Object graphNameOrConfig, Map<String, Object> configuration)
[CLASS] class CosineProc extends AlphaSimilarityProc<CosineAlgorithm, CosineConfig>
[METRICS] loc=8 ... | /* static context
[FOCAL] @Procedure(name = "gds.alpha.similarity.cosine.stream", mode = READ) @Description(DESCRIPTION) public Stream<SimilarityResult> CosineProc.cosineStream(Object graphNameOrConfig, Map<String, Object> configuration)
[INPUTS] branches=- | result=configuration, graphNameOrConfig
[CALLS-EXTERNAL] str... | /* static context
[FOCAL] @Procedure(name = "gds.alpha.similarity.cosine.stream", mode = READ) @Description(DESCRIPTION) public Stream<SimilarityResult> CosineProc.cosineStream(Object graphNameOrConfig, Map<String, Object> configuration)
[INPUTS] branches=- | result=configuration, graphNameOrConfig
[CALLS-EXTERNAL] str... | true | ok | {"focal": {"class": "CosineProc", "name": "cosineStream", "signature": "Stream<SimilarityResult> cosineStream(Object graphNameOrConfig, Map<String, Object> configuration)", "start_line": 3, "modifiers": "@Procedure(name = \"gds.alpha.similarity.cosine.stream\", mode = READ) @Description(DESCRIPTION) public", "params": ... |
220248572_1 | class FileUtil extends cn.hutool.core.io.FileUtil {
public static String getExtensionName(String filename) {
if ((filename != null) && (filename.length() > 0)) {
int dot = filename.lastIndexOf('.');
if ((dot >-1) && (dot < (filename.length() - 1))) {
return filename.... | Assert.assertEquals("foo", FileUtil.getExtensionName("foo"));
Assert.assertEquals("exe", FileUtil.getExtensionName("bar.exe"));
}
} | [FOCAL] public static String FileUtil.getExtensionName(String filename)
[CLASS] class FileUtil extends cn.hutool.core.io.FileUtil
[METRICS] loc=9 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=2
[CALLS-EXTERNAL] String.length/0, String.lastIndexOf/1, String.substring/1
[PATH1] if((filename != null) && (filename.len... | /* static context
[FOCAL] public static String FileUtil.getExtensionName(String filename)
[PATH1] if((filename != null) && (filename.length() > 0))=T -> if((dot >-1) && (dot < (filename.length() - 1)))=T -> return filename.substring(dot + 1)
[PATH2] if((filename != null) && (filename.length() > 0))=F -> return filename... | /* static context
[FOCAL] public static String FileUtil.getExtensionName(String filename)
[PATH1] if((filename != null) && (filename.length() > 0))=T -> if((dot >-1) && (dot < (filename.length() - 1)))=T -> return filename.substring(dot + 1)
[PATH2] if((filename != null) && (filename.length() > 0))=F -> return filename... | true | ok | {"focal": {"class": "FileUtil", "name": "getExtensionName", "signature": "String getExtensionName(String filename)", "start_line": 3, "modifiers": "public static", "params": [{"name": "filename", "type": "String"}], "return_type": "String"}, "class_info": {"name": "FileUtil", "kind": "class", "modifiers": "", "supercla... |
220262191_21 | class ShadowTrafficFilter extends OncePerRequestFilter {
@Override
protected boolean shouldNotFilter(HttpServletRequest request) throws ServletException {
String path = request.getRequestURI();
Map<String, String> headerKeyValueMap = new HashMap<>();
ShadowTrafficConfig shadowT... | when(shadowTrafficConfigHelper.getConfig()).thenReturn(config);
when(config.isEnabled()).thenReturn(true);
when(request.getRequestURI()).thenReturn("/hotels");
List<ShadowTrafficConfig.InclusionPattern> inclusionPatterns = new ArrayList<>();
inclusionPatterns.add(null);
... | [FOCAL] @Override protected boolean ShadowTrafficFilter.shouldNotFilter(HttpServletRequest request)
[CLASS] class ShadowTrafficFilter extends OncePerRequestFilter
[METRICS] loc=74 cc=16 branches=10 loops=3 returns=6 throws=0 nesting=8
[CALLS-EXTERNAL] HttpServletRequest.getRequestURI/0, ShadowTrafficConfigHelper.getCon... | /* static context
[FOCAL] @Override protected boolean ShadowTrafficFilter.shouldNotFilter(HttpServletRequest request)
[PATH1] if(shadowTrafficConfig == null || !shadowTrafficConfig.isEnabled())=F -> if(headerNames != null)=T -> while(headerNames.hasMoreElements())=T -> if(null != key)=T -> if((value != null && key.equa... | /* static context
[FOCAL] @Override protected boolean ShadowTrafficFilter.shouldNotFilter(HttpServletRequest request)
[PATH1] if(shadowTrafficConfig == null || !shadowTrafficConfig.isEnabled())=F -> if(headerNames != null)=T -> while(headerNames.hasMoreElements())=T -> if(null != key)=T -> if((value != null && key.equa... | true | ok | {"focal": {"class": "ShadowTrafficFilter", "name": "shouldNotFilter", "signature": "boolean shouldNotFilter(HttpServletRequest request) throws ServletException", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "request", "type": "HttpServletRequest"}], "return_type": "boolean"}, "class_info": {... |
221155810_2 | class KisiServiceImpl implements KisiService {
@Override
public List<KisiDto> getAll() {
List<Kisi> kisiler = kisiRepository.findAll();
List<KisiDto> kisiDtos = new ArrayList<>();
kisiler.forEach(it -> {
KisiDto kisiDto =new KisiDto();
kisiDto.setId(it.getId());... | Kisi kisi = new Kisi();
kisi.setId(1L);
kisi.setAdi("Test-Name");
kisi.setSoyadi("Test-Lastname");
when(kisiRepository.findAll()).thenReturn(Collections.singletonList(kisi));
List<KisiDto> kisiDtos = kisiService.getAll();
assertEquals(kisiDtos.size(), 1);
... | [FOCAL] @Override public List<KisiDto> KisiServiceImpl.getAll()
[CLASS] class KisiServiceImpl implements KisiService
[METRICS] loc=18 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] KisiRepository.findAll/0, List<Kisi>.forEach/1, KisiDto.setId/1, it.getId/0, KisiDto.setAdi/1, it.getAdi/0, KisiDto.... | /* static context
[FOCAL] @Override public List<KisiDto> KisiServiceImpl.getAll()
[COLLABORATORS] field kisiRepository:KisiRepository findAll/0; field it getId/0,getAdi/0,getSoyadi/0,getAdresleri/0
[FIELDS] read=kisiRepository:KisiRepository
[NEW] ArrayList<>, KisiDto
[CALLS-EXTERNAL] KisiRepository.findAll/0, List<Kis... | /* static context
[FOCAL] @Override public List<KisiDto> KisiServiceImpl.getAll()
[COLLABORATORS] field kisiRepository:KisiRepository findAll/0; field it getId/0,getAdi/0,getSoyadi/0,getAdresleri/0
[FIELDS] read=kisiRepository:KisiRepository
[NEW] ArrayList<>, KisiDto
[CALLS-EXTERNAL] KisiRepository.findAll/0, List<Kis... | true | ok | {"focal": {"class": "KisiServiceImpl", "name": "getAll", "signature": "List<KisiDto> getAll()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "List<KisiDto>"}, "class_info": {"name": "KisiServiceImpl", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "KisiService", "f... |
221881722_45 | class StochasticOscillatorK extends SingleValueIndicator {
public double getValue() {
return value;
}
public StochasticOscillatorK(TimeInterval interval);
public StochasticOscillatorK(int length, TimeInterval interval);
@Override protected boolean process(Candle candle, double value, boolean updating);
@Ov... |
StochasticOscillatorK ind = new StochasticOscillatorK(minutes(1));
double[][] values = new double[][]{
{44.98, 119.13, 119.50, 116.00},
{45.05, 116.75, 119.94, 116.00},
{45.11, 113.50, 118.44, 111.63},
{45.19, 111.56, 114.19, 110.06},
{45.12, 112.25, 112.81, 109.63},
{45.15, 110.00, 113.44... | [FOCAL] public double StochasticOscillatorK.getValue()
[CLASS] class StochasticOscillatorK extends SingleValueIndicator
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] StochasticOscillatorK(TimeInterval interval); StochasticOscillatorK(int length, TimeInterval interval); boolean pro... | /* static context
[FOCAL] public double StochasticOscillatorK.getValue()
*/
| /* static context
[FOCAL] public double StochasticOscillatorK.getValue()
*/
class StochasticOscillatorK extends SingleValueIndicator {
public double getValue() {
return value;
}
public StochasticOscillatorK(TimeInterval interval);
public StochasticOscillatorK(int length, TimeInterval interval);
@Override pr... | true | ok | {"focal": {"class": "StochasticOscillatorK", "name": "getValue", "signature": "double getValue()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "double"}, "class_info": {"name": "StochasticOscillatorK", "kind": "class", "modifiers": "", "superclass": "SingleValueIndicator", "interfaces": null, "... |
221992547_32 | class RandomCutForest {
public List<Neighbor> getNearNeighborsInSample(double[] point, double distanceThreshold) {
checkNotNull(point, "point must not be null");
checkArgument(distanceThreshold > 0, "distanceThreshold must be greater than 0");
if (!isOutputReady()) {
return Col... | assertThrows(NullPointerException.class, () -> forest.getNearNeighborsInSample(null, 101.1));
assertThrows(IllegalArgumentException.class,
() -> forest.getNearNeighborsInSample(new double[] { 1.1, 2.2 }, -101.1));
assertThrows(IllegalArgumentException.class,
() ->... | [FOCAL] public List<Neighbor> RandomCutForest.getNearNeighborsInSample(double[] point, double distanceThreshold)
[CLASS] class RandomCutForest
[METRICS] loc=13 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] S traverseForest(double[] point, Function<RandomCutTree, Visitor<R>> visitorFactory, Colle... | /* static context
[FOCAL] public List<Neighbor> RandomCutForest.getNearNeighborsInSample(double[] point, double distanceThreshold)
[PATH1] if(!isOutputReady())=T -> return Collections.emptyList()
[PATH2] if(!isOutputReady())=F -> return traverseForest(point, visitorFactory, Neighbor.collector())
[INPUTS] branches=- | r... | /* static context
[FOCAL] public List<Neighbor> RandomCutForest.getNearNeighborsInSample(double[] point, double distanceThreshold)
[PATH1] if(!isOutputReady())=T -> return Collections.emptyList()
[PATH2] if(!isOutputReady())=F -> return traverseForest(point, visitorFactory, Neighbor.collector())
[INPUTS] branches=- | r... | true | ok | {"focal": {"class": "RandomCutForest", "name": "getNearNeighborsInSample", "signature": "List<Neighbor> getNearNeighborsInSample(double[] point, double distanceThreshold)", "start_line": 3, "modifiers": "public", "params": [{"name": "point", "type": "double[]"}, {"name": "distanceThreshold", "type": "double"}], "return... |
222008690_16 | class CloverSerializerExtension extends JpsModelSerializerExtension {
@NotNull
@Override
public List<? extends JpsModulePropertiesSerializer<?>> getModulePropertiesSerializers() {
return Collections.emptyList();
}
@NotNull @Override public List<? extends JpsGlobalExtensionSerializer> getGl... | final List<? extends JpsModulePropertiesSerializer<?>> serializers =
new CloverSerializerExtension().getModulePropertiesSerializers();
assertEquals(0, serializers.size());
}
} | [FOCAL] @NotNull @Override public List<? extends JpsModulePropertiesSerializer<?>> CloverSerializerExtension.getModulePropertiesSerializers()
[CLASS] class CloverSerializerExtension extends JpsModelSerializerExtension
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Collections.empt... | /* static context
[FOCAL] @NotNull @Override public List<? extends JpsModulePropertiesSerializer<?>> CloverSerializerExtension.getModulePropertiesSerializers()
[CALLS-EXTERNAL] Collections.emptyList/0
*/
| /* static context
[FOCAL] @NotNull @Override public List<? extends JpsModulePropertiesSerializer<?>> CloverSerializerExtension.getModulePropertiesSerializers()
[CALLS-EXTERNAL] Collections.emptyList/0
*/
class CloverSerializerExtension extends JpsModelSerializerExtension {
@NotNull
@Override
public List<? ... | true | ok | {"focal": {"class": "CloverSerializerExtension", "name": "getModulePropertiesSerializers", "signature": "List<? extends JpsModulePropertiesSerializer<?>> getModulePropertiesSerializers()", "start_line": 3, "modifiers": "@NotNull @Override public", "params": [], "return_type": "List<? extends JpsModulePropertiesSerializ... |
222455446_0 | class UserService {
@Transactional(readOnly = true)
public UserResponse getUser(Integer userId) {
final Optional<TestUser> user = userRepository.findById(userId);
return user.map(UserService::toUserResponse).orElseThrow(NotFoundException::new);
}
@Inject public UserService(UserReposi... | // just sample test
final UserResponse user = userService.getUser(2);
assertEquals(Integer.valueOf(2), user.getId());
assertEquals("John Doe", user.getName());
}
} | [FOCAL] @Transactional(readOnly = true) public UserResponse UserService.getUser(Integer userId)
[CLASS] class UserService
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] UserRepository.findById/1, user.map(UserService::toUserResponse).orElseThrow/1, Optional<TestUser>.map/1
[FIELDS... | /* static context
[FOCAL] @Transactional(readOnly = true) public UserResponse UserService.getUser(Integer userId)
[INPUTS] branches=- | result=userId, userRepository
[COLLABORATORS] field userRepository:UserRepository findById/1
[FIELDS] read=userRepository:UserRepository
[CALLS-EXTERNAL] UserRepository.findById/1, use... | /* static context
[FOCAL] @Transactional(readOnly = true) public UserResponse UserService.getUser(Integer userId)
[INPUTS] branches=- | result=userId, userRepository
[COLLABORATORS] field userRepository:UserRepository findById/1
[FIELDS] read=userRepository:UserRepository
[CALLS-EXTERNAL] UserRepository.findById/1, use... | true | ok | {"focal": {"class": "UserService", "name": "getUser", "signature": "UserResponse getUser(Integer userId)", "start_line": 3, "modifiers": "@Transactional(readOnly = true) public", "params": [{"name": "userId", "type": "Integer"}], "return_type": "UserResponse"}, "class_info": {"name": "UserService", "kind": "class", "mo... |
222514148_1 | class ClassFileDetectorStream extends InputStream {
public boolean isClass() {
return isClass;
}
public ClassFileDetectorStream(String name, InputStream input);
@Override public int read(byte[] bytes);
@Override public int read(byte[] bytes, int offset, int length);
@Override public int read();
pr... | ByteArrayInputStream data = new ByteArrayInputStream(VALID_CLASS);
ClassFileDetectorStream detector = new ClassFileDetectorStream("Foo.class", data);
byte[] read = readAll(detector);
assertThat(detector.isClass()).isTrue();
assertThat(read).isEqualTo(VALID_CLASS);
}
} | [FOCAL] public boolean ClassFileDetectorStream.isClass()
[CLASS] class ClassFileDetectorStream extends InputStream
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] ClassFileDetectorStream(String name, InputStream input); int read(byte[] bytes); int read(byte[] bytes, int offset, int ... | /* static context
[FOCAL] public boolean ClassFileDetectorStream.isClass()
*/
| /* static context
[FOCAL] public boolean ClassFileDetectorStream.isClass()
*/
class ClassFileDetectorStream extends InputStream {
public boolean isClass() {
return isClass;
}
public ClassFileDetectorStream(String name, InputStream input);
@Override public int read(byte[] bytes);
@Override public int r... | true | ok | {"focal": {"class": "ClassFileDetectorStream", "name": "isClass", "signature": "boolean isClass()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "ClassFileDetectorStream", "kind": "class", "modifiers": "", "superclass": "InputStream", "interfaces": null, "field... |
222710815_0 | class ContextAssert extends AbstractAssert<ContextAssert, Context> {
public ContextAssert containsOnly(Context other) {
Map.Entry<Object, Object>[] otherArray = other.stream().toArray(ARRAY_GENERATOR);
//we use containsOnly and not containsExactlyInAnyOrder because we don't care about duplicates
iterables.asse... | assertThatExceptionOfType(AssertionError.class)
.isThrownBy(() -> Assertions.assertThat(Context.of(1, 10).stream()).containsOnly(new AbstractMap.SimpleEntry<>("foo", "bar")))
.withMessage("\nExpecting:\n <[1=10]>\nto contain only:\n <[foo=bar]>\nelements not found:" +
"\n <[foo=bar]>\nand elements no... | [FOCAL] public ContextAssert ContextAssert.containsOnly(Context other)
[CLASS] class ContextAssert extends AbstractAssert<ContextAssert, Context>
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] other.stream().toArray/1, Context.stream/0, iterables.assertContainsOnly/3
[COLLABORATOR... | /* static context
[FOCAL] public ContextAssert ContextAssert.containsOnly(Context other)
[COLLABORATORS] param other:Context stream/0; field iterables assertContainsOnly/3
[CALLS-EXTERNAL] other.stream().toArray/1, Context.stream/0, iterables.assertContainsOnly/3
*/
| /* static context
[FOCAL] public ContextAssert ContextAssert.containsOnly(Context other)
[COLLABORATORS] param other:Context stream/0; field iterables assertContainsOnly/3
[CALLS-EXTERNAL] other.stream().toArray/1, Context.stream/0, iterables.assertContainsOnly/3
*/
class ContextAssert extends AbstractAssert<ContextAss... | true | ok | {"focal": {"class": "ContextAssert", "name": "containsOnly", "signature": "ContextAssert containsOnly(Context other)", "start_line": 3, "modifiers": "public", "params": [{"name": "other", "type": "Context"}], "return_type": "ContextAssert"}, "class_info": {"name": "ContextAssert", "kind": "class", "modifiers": "", "sup... |
223482145_0 | class Handler implements RequestStreamHandler {
@Override
public void handleRequest(InputStream is, OutputStream os, Context context) throws IOException {
LambdaLogger logger = context.getLogger();
String input = Utils.toString(is);
try {
Request request = GSON.fromJson(inpu... | Context context = new MockContext();
Handler handler = new Handler();
Request request = new Request();
request.setInputImageUrl("https://djl-ai.s3.amazonaws.com/resources/images/kitten.jpg");
Gson gson = new Gson();
byte[] buf = gson.toJson(request).getBytes(StandardChar... | [FOCAL] @Override public void Handler.handleRequest(InputStream is, OutputStream os, Context context)
[CLASS] class Handler implements RequestStreamHandler
[METRICS] loc=28 cc=2 branches=0 loops=0 returns=0 throws=0 nesting=2
[CALLS-EXTERNAL] Context.getLogger/0, Utils.toString/1, GSON.fromJson/2, Request.getInputImage... | /* static context
[FOCAL] @Override public void Handler.handleRequest(InputStream is, OutputStream os, Context context)
[PATH1] try-body throws
[COLLABORATORS] param context:Context getLogger/0; param os:OutputStream write/1
[EXCEPTIONS] declares IOException; catches RuntimeException | ModelException | TranslateExcepti... | /* static context
[FOCAL] @Override public void Handler.handleRequest(InputStream is, OutputStream os, Context context)
[PATH1] try-body throws
[COLLABORATORS] param context:Context getLogger/0; param os:OutputStream write/1
[EXCEPTIONS] declares IOException; catches RuntimeException | ModelException | TranslateExcepti... | true | ok | {"focal": {"class": "Handler", "name": "handleRequest", "signature": "void handleRequest(InputStream is, OutputStream os, Context context) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "is", "type": "InputStream"}, {"name": "os", "type": "OutputStream"}, {"name": "context", ... |
223551095_1807 | class QueryImpl implements Query, ResourceInstance {
@Override
public Result execute()
throws UnsupportedPropertyException,
SystemException,
NoSuchResourceException,
NoSuchParentResourceException {
queryForResources();
return getResult(null);
}
public Quer... | ResourceDefinition resourceDefinition = createNiceMock(ResourceDefinition.class);
Map<Resource.Type, String> mapIds = new HashMap<>();
// expectations
expect(resourceDefinition.getType()).andReturn(Resource.Type.Cluster).anyTimes();
Set<SubResourceDefinition> setChildren = new HashSet<>();
set... | [FOCAL] @Override public Result QueryImpl.execute()
[CLASS] class QueryImpl implements Query, ResourceInstance
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Result getResult(Resource parentResource); void queryForResources()
[EXCEPTIONS] declares UnsupportedPropertyException, Sys... | /* static context
[FOCAL] @Override public Result QueryImpl.execute()
[EXCEPTIONS] declares UnsupportedPropertyException, SystemException, NoSuchResourceException, NoSuchParentResourceException
[CALLS-INTERNAL] Result getResult(Resource parentResource); void queryForResources()
*/
| /* static context
[FOCAL] @Override public Result QueryImpl.execute()
[EXCEPTIONS] declares UnsupportedPropertyException, SystemException, NoSuchResourceException, NoSuchParentResourceException
[CALLS-INTERNAL] Result getResult(Resource parentResource); void queryForResources()
*/
class QueryImpl implements Query, Reso... | true | ok | {"focal": {"class": "QueryImpl", "name": "execute", "signature": "Result execute() throws UnsupportedPropertyException, SystemException, NoSuchResourceException, NoSuchParentResourceException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Result"}, "class_info": {"name": "QueryImpl", ... |
224061261_10 | class ServletHandler extends XRayHandler {
@Override
public void handleResponse(Event event) {
HttpServletNetworkResponseEvent responseEvent = (HttpServletNetworkResponseEvent) event;
Segment currentSegment = getSegment();
// No need to log since a Context Missing Error will already be... | HttpServletNetworkRequestEvent requestEvent = new HttpServletNetworkRequestEvent(ORIGIN, 1, 1, "test", "test");
HttpServletNetworkResponseEvent responseEvent = new HttpServletNetworkResponseEvent(ORIGIN, requestEvent);
// Explicitly clear context
AWSXRay.clearTraceEntity();
Asse... | [FOCAL] @Override public void ServletHandler.handleResponse(Event event)
[CLASS] class ServletHandler extends XRayHandler
[METRICS] loc=37 cc=6 branches=3 loops=0 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] getSegment/0 (inherited), HttpServletNetworkResponseEvent.getStatusCode/0, Segment.setError/1, Segment.setThrot... | /* static context
[FOCAL] @Override public void ServletHandler.handleResponse(Event event)
[PATH1] if(currentSegment == null)=F -> switch(statusCode / 100)=case 4 -> if(statusCode == 429)=T
[PATH2] if(currentSegment == null)=T -> return
[PATH3] if(currentSegment == null)=F -> switch(statusCode / 100)=case 2
[PATH4] if(... | /* static context
[FOCAL] @Override public void ServletHandler.handleResponse(Event event)
[PATH1] if(currentSegment == null)=F -> switch(statusCode / 100)=case 4 -> if(statusCode == 429)=T
[PATH2] if(currentSegment == null)=T -> return
[PATH3] if(currentSegment == null)=F -> switch(statusCode / 100)=case 2
[PATH4] if(... | true | ok | {"focal": {"class": "ServletHandler", "name": "handleResponse", "signature": "void handleResponse(Event event)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "event", "type": "Event"}], "return_type": "void"}, "class_info": {"name": "ServletHandler", "kind": "class", "modifiers": "", "superclas... |
224235390_87 | class GenericRecordSerializer extends JsonSerializer<GenericRecord> {
@Override
public void serialize(final GenericRecord record,
final JsonGenerator gen,
final SerializerProvider serializers) throws IOException {
gen.writeRawValue(getJsonString(reco... |
Schema.Parser parser = new Schema.Parser();
Schema schema = parser.parse(SCHEMA);
GenericRecord record = new GenericData.Record(schema);
record.put("name", "kafka");
record.put("created", NOW.toEpochMilli());
Writer jsonWriter = new StringWriter();
JsonGenerator... | [FOCAL] @Override public void GenericRecordSerializer.serialize(GenericRecord record, JsonGenerator gen, SerializerProvider serializers)
[CLASS] class GenericRecordSerializer extends JsonSerializer<GenericRecord>
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] String getJsonString(... | /* static context
[FOCAL] @Override public void GenericRecordSerializer.serialize(GenericRecord record, JsonGenerator gen, SerializerProvider serializers)
[INPUTS] branches=- | result=- | unused=serializers
[COLLABORATORS] param gen:JsonGenerator writeRawValue/1; param record:GenericRecord getSchema/0
[EXCEPTIONS] decl... | /* static context
[FOCAL] @Override public void GenericRecordSerializer.serialize(GenericRecord record, JsonGenerator gen, SerializerProvider serializers)
[INPUTS] branches=- | result=- | unused=serializers
[COLLABORATORS] param gen:JsonGenerator writeRawValue/1; param record:GenericRecord getSchema/0
[EXCEPTIONS] decl... | true | ok | {"focal": {"class": "GenericRecordSerializer", "name": "serialize", "signature": "void serialize(GenericRecord record, JsonGenerator gen, SerializerProvider serializers) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "record", "type": "GenericRecord"}, {"name": "gen", "type":... |
224256826_30 | class AcknowledgeableWorkBufferTranslator implements Translator<List<Acknowledgeable<W>>, Acknowledgeable<W>> {
@Override
public Translation<List<Acknowledgeable<W>>, Acknowledgeable<W>> apply(List<Acknowledgeable<W>> buffer) {
List<Acknowledgeable<W>> nonCanceledBuffer = WorkBuffers.collectNonCanceled... | AcknowledgeableWorkBufferTranslator<TestWork> translator =
new AcknowledgeableWorkBufferTranslator<>(workReducer, TestWork::prepare, failureReference);
TestWork work = TestWork.create(WorkType.COMMIT, "URL");
AcknowledgeableTestWork acknowledgeableWork = new AcknowledgeableTestWork(... | [FOCAL] @Override public Translation<List<Acknowledgeable<W>>, Acknowledgeable<W>> AcknowledgeableWorkBufferTranslator.apply(List<Acknowledgeable<W>> buffer)
[CLASS] class AcknowledgeableWorkBufferTranslator implements Translator<List<Acknowledgeable<W>>, Acknowledgeable<W>>
[METRICS] loc=12 cc=2 branches=0 loops=0 ret... | /* static context
[FOCAL] @Override public Translation<List<Acknowledgeable<W>>, Acknowledgeable<W>> AcknowledgeableWorkBufferTranslator.apply(List<Acknowledgeable<W>> buffer)
[PATH1] try-body throws -> return Translation.noResult(buffer)
[PATH2] return tryTranslate(nonCanceledBuffer) .map(result -> Translation.withRes... | /* static context
[FOCAL] @Override public Translation<List<Acknowledgeable<W>>, Acknowledgeable<W>> AcknowledgeableWorkBufferTranslator.apply(List<Acknowledgeable<W>> buffer)
[PATH1] try-body throws -> return Translation.noResult(buffer)
[PATH2] return tryTranslate(nonCanceledBuffer) .map(result -> Translation.withRes... | true | ok | {"focal": {"class": "AcknowledgeableWorkBufferTranslator", "name": "apply", "signature": "Translation<List<Acknowledgeable<W>>, Acknowledgeable<W>> apply(List<Acknowledgeable<W>> buffer)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "buffer", "type": "List<Acknowledgeable<W>>"}], "return_type"... |
224537036_84 | class DelfiDeliveryService implements DeliveryService {
@Override
public DeliveryResponse getResources(InputPayload inputPayload, MessageHeaders headers) {
log.debug("Getting resources for following SRNs and headers : {}, {}", inputPayload, headers);
String authorizationToken = extractHeaderByName(headers... |
// given
ProcessingResult result1 = new ProcessingResult();
ProcessingResult result2 = new ProcessingResult();
when(dataProcessingJob.process(eq(SRN_1), eq(AUTH), eq(PARTITION)))
.thenReturn(processingResultCompletableFutureOne);
when(dataProcessingJob.process(eq(SRN_2), eq(AUTH), eq(PARTI... | [FOCAL] @Override public DeliveryResponse DelfiDeliveryService.getResources(InputPayload inputPayload, MessageHeaders headers)
[CLASS] class DelfiDeliveryService implements DeliveryService
[METRICS] loc=20 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] log.debug/3, extractHeaderByName/2 (inherite... | /* static context
[FOCAL] @Override public DeliveryResponse DelfiDeliveryService.getResources(InputPayload inputPayload, MessageHeaders headers)
[INPUTS] branches=- | result=headers, inputPayload, dataProcessingJob, resultDataConverter
[COLLABORATORS] field authenticationService:AuthenticationService checkAuthenticatio... | /* static context
[FOCAL] @Override public DeliveryResponse DelfiDeliveryService.getResources(InputPayload inputPayload, MessageHeaders headers)
[INPUTS] branches=- | result=headers, inputPayload, dataProcessingJob, resultDataConverter
[COLLABORATORS] field authenticationService:AuthenticationService checkAuthenticatio... | true | ok | {"focal": {"class": "DelfiDeliveryService", "name": "getResources", "signature": "DeliveryResponse getResources(InputPayload inputPayload, MessageHeaders headers)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "inputPayload", "type": "InputPayload"}, {"name": "headers", "type": "MessageHeaders"... |
224764811_71 | class SlayerPlugin extends Plugin {
@Subscribe
public void onGameTick(GameTick tick)
{
// update the lingering presence of npcs in the slayer xp consideration list
Iterator<NPCPresence> presenceIterator = lingeringPresences.iterator();
while (presenceIterator.hasNext())
{
NPCPresence presence = presenceI... | Widget npcDialog = mock(Widget.class);
when(npcDialog.getText()).thenReturn(TASK_ACTIVATESLAYERGEM_WILDERNESS);
when(client.getWidget(WidgetInfo.DIALOG_NPC_TEXT)).thenReturn(npcDialog);
slayerPlugin.onGameTick(GameTick.INSTANCE);
assertEquals("bandits", slayerPlugin.getCurrentTask().getTaskName());
assertE... | [FOCAL] @Subscribe public void SlayerPlugin.onGameTick(GameTick tick)
[CLASS] class SlayerPlugin extends Plugin
[METRICS] loc=90 cc=13 branches=11 loops=1 returns=0 throws=0 nesting=5
[CALLS-INTERNAL] void removeCounter(); void setTask(String name, int amt, int initAmt, boolean isNewAssignment, String location, int las... | class SlayerPlugin extends Plugin {
@Subscribe
public void onGameTick(GameTick tick)
{
// update the lingering presence of npcs in the slayer xp consideration list
Iterator<NPCPresence> presenceIterator = lingeringPresences.iterator();
while (presenceIterator.hasNext())
{
NPCPresence presence = presenceI... | false | ok | {"focal": {"class": "SlayerPlugin", "name": "onGameTick", "signature": "void onGameTick(GameTick tick)", "start_line": 3, "modifiers": "@Subscribe public", "params": [{"name": "tick", "type": "GameTick"}], "return_type": "void"}, "class_info": {"name": "SlayerPlugin", "kind": "class", "modifiers": "", "superclass": "Pl... | |
224846645_331 | class NativeSettingsImpl implements NativeSettings, Serializable {
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
NativeSettingsImpl that = (NativeSettings... | EqualsVerifier.forClass(NativeSettingsImpl.class).verify();
}
} | [FOCAL] @Override public boolean NativeSettingsImpl.equals(Object o)
[CLASS] class NativeSettingsImpl implements NativeSettings, Serializable
[METRICS] loc=12 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[CALLS-EXTERNAL] getClass/0 (inherited), Object.getClass/0, Objects.equals/2
[PATH1] if(this == o)=F -> if(o... | /* static context
[FOCAL] @Override public boolean NativeSettingsImpl.equals(Object o)
[PATH1] if(this == o)=F -> if(o == null || getClass() != o.getClass())=T -> return false
[PATH2] if(this == o)=T -> return true
[PATH3] if(this == o)=F -> if(o == null || getClass() != o.getClass())=F -> return Objects.equals(name, t... | /* static context
[FOCAL] @Override public boolean NativeSettingsImpl.equals(Object o)
[PATH1] if(this == o)=F -> if(o == null || getClass() != o.getClass())=T -> return false
[PATH2] if(this == o)=T -> return true
[PATH3] if(this == o)=F -> if(o == null || getClass() != o.getClass())=F -> return Objects.equals(name, t... | true | ok | {"focal": {"class": "NativeSettingsImpl", "name": "equals", "signature": "boolean equals(Object o)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "o", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "NativeSettingsImpl", "kind": "class", "modifiers": "", "superclass": null... |
225545609_1 | class PoolString implements CharSequence, java.io.Serializable {
public PoolString after(PoolString other) {
if (other.isEmpty()) {
return this;
}
Preconditions.checkArgument(other.base == base);
Preconditions.checkArgument(other.startIndex == startIndex);
if (other.endIndex == endIndex) {
return empt... | PoolString abcdef = PoolString.of("abcdef");
PoolString untilA = abcdef.until("a");
Assertions.assertThat(untilA).hasToString("");
Assertions.assertThat(abcdef.after(untilA)).hasToString("abcdef");
PoolString untilC = abcdef.until("c");
Assertions.assertThat(untilC).hasToString("ab");
Assertions.assertT... | [FOCAL] public PoolString PoolString.after(PoolString other)
[CLASS] class PoolString implements CharSequence, java.io.Serializable
[METRICS] loc=12 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1
[CALLS-EXTERNAL] PoolString.isEmpty/0, Preconditions.checkArgument/1
[NEW] PoolString
[PATH1] if(other.isEmpty())=F ->... | /* static context
[FOCAL] public PoolString PoolString.after(PoolString other)
[PATH1] if(other.isEmpty())=F -> if(other.endIndex == endIndex)=T -> return empty
[PATH2] if(other.isEmpty())=T -> return this
[PATH3] if(other.isEmpty())=F -> if(other.endIndex == endIndex)=F -> return new PoolString(base, other.endIndex, e... | /* static context
[FOCAL] public PoolString PoolString.after(PoolString other)
[PATH1] if(other.isEmpty())=F -> if(other.endIndex == endIndex)=T -> return empty
[PATH2] if(other.isEmpty())=T -> return this
[PATH3] if(other.isEmpty())=F -> if(other.endIndex == endIndex)=F -> return new PoolString(base, other.endIndex, e... | true | ok | {"focal": {"class": "PoolString", "name": "after", "signature": "PoolString after(PoolString other)", "start_line": 3, "modifiers": "public", "params": [{"name": "other", "type": "PoolString"}], "return_type": "PoolString"}, "class_info": {"name": "PoolString", "kind": "class", "modifiers": "", "superclass": null, "int... |
225818900_8 | class TaskHelper {
public static String createEndpointOptionsFromProperties(Map<String, String> props, String prefix) {
return props.keySet().stream()
.filter(k -> k.startsWith(prefix))
.map(k -> k.replace(prefix, "") + "=" + props.get(k))
.reduce((o1, o2) ->... | Map<String, String> props = new HashMap<String, String>() {
{
put("prefix.key1", "value1");
put("prefix.key2", "value2");
}
};
String result = TaskHelper.createEndpointOptionsFromProperties(props, "prefix.");
assertEquals("?key1=v... | [FOCAL] public static String TaskHelper.createEndpointOptionsFromProperties(Map<String, String> props, String prefix)
[CLASS] class TaskHelper
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] props.keySet().stream() .filter(k -> k.startsWith(prefix)....orElse/1, props.keySet().strea... | /* static context
[FOCAL] public static String TaskHelper.createEndpointOptionsFromProperties(Map<String, String> props, String prefix)
[INPUTS] branches=- | result=prefix, props
[COLLABORATORS] param props:Map<String, String> keySet/0,get/1; field k startsWith/1,replace/2; field result isEmpty/0
[CALLS-EXTERNAL] props... | /* static context
[FOCAL] public static String TaskHelper.createEndpointOptionsFromProperties(Map<String, String> props, String prefix)
[INPUTS] branches=- | result=prefix, props
[COLLABORATORS] param props:Map<String, String> keySet/0,get/1; field k startsWith/1,replace/2; field result isEmpty/0
[CALLS-EXTERNAL] props... | true | ok | {"focal": {"class": "TaskHelper", "name": "createEndpointOptionsFromProperties", "signature": "String createEndpointOptionsFromProperties(Map<String, String> props, String prefix)", "start_line": 3, "modifiers": "public static", "params": [{"name": "props", "type": "Map<String, String>"}, {"name": "prefix", "type": "St... |
226861344_62 | class MulBlockingQueue {
@SuppressWarnings("unchecked") public List<E> poll(BitSet queueIds)
throws InterruptedException {
ArrayList<E> re = new ArrayList<>(queueIds.cardinality());
for (int id = queueIds.nextSetBit(0); id >= 0; id = queueIds.nextSetBit(id + 1)) {
DalQueue dalqu... | MulBlockingQueue<Payload> mq = new MulBlockingQueue<>(1024);
BitSet indexs = new BitSet(2);
indexs.set(mq.register("eosgroup1"));
indexs.set(mq.register("eosgroup2"));
List<Payload> packets = mq.poll(indexs);
Assert.assertTrue(packets.isEmpty());
mq.put(new Paylo... | [FOCAL] @SuppressWarnings("unchecked") public List<E> MulBlockingQueue.poll(BitSet queueIds)
[CLASS] class MulBlockingQueue
[METRICS] loc=22 cc=5 branches=3 loops=1 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] void unReadyQueue(int id, DalQueue dalqueue)
[CALLS-EXTERNAL] BitSet.cardinality/0, BitSet.nextSetBit/1, dalq... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public List<E> MulBlockingQueue.poll(BitSet queueIds)
[PATH1] for(id >= 0)=T -> if(dalqueue == null)=F -> if(x != null)=T -> if(dalqueue.count.get() == 0)=T -> exit loop -> return re
[PATH2] for(id >= 0)=T -> if(dalqueue == null)=F -> if(x != null)=F -> if(dalque... | /* static context
[FOCAL] @SuppressWarnings("unchecked") public List<E> MulBlockingQueue.poll(BitSet queueIds)
[PATH1] for(id >= 0)=T -> if(dalqueue == null)=F -> if(x != null)=T -> if(dalqueue.count.get() == 0)=T -> exit loop -> return re
[PATH2] for(id >= 0)=T -> if(dalqueue == null)=F -> if(x != null)=F -> if(dalque... | true | ok | {"focal": {"class": "MulBlockingQueue", "name": "poll", "signature": "List<E> poll(BitSet queueIds) throws InterruptedException", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public", "params": [{"name": "queueIds", "type": "BitSet"}], "return_type": "List<E>"}, "class_info": {"name": "MulBlockingQue... |
227063129_281 | class RangerValidator {
List<RangerPolicy> getPolicies(final String serviceName, final String policyName) {
if(LOG.isDebugEnabled()) {
LOG.debug("==> RangerValidator.getPolicies(" + serviceName + ", " + policyName + ")");
}
List<RangerPolicy> policies = null;
try {
SearchFilter filter = new SearchFilte... |
// returns null when store returns null
String policyName = "aPolicy";
String serviceName = "aService";
SearchFilter filter = new SearchFilter();
filter.setParam(SearchFilter.POLICY_NAME, policyName);
filter.setParam(SearchFilter.SERVICE_NAME, serviceName);
when(_store.getPolicies(filter)).thenReturn(... | [FOCAL] List<RangerPolicy> RangerValidator.getPolicies(String serviceName, String policyName)
[CLASS] class RangerValidator
[METRICS] loc=24 cc=5 branches=3 loops=0 returns=1 throws=0 nesting=2
[CALLS-EXTERNAL] LOG.isDebugEnabled/0, LOG.debug/1, StringUtils.isNotBlank/1, SearchFilter.setParam/2, ServiceStore.getPolicie... | /* static context
[FOCAL] List<RangerPolicy> RangerValidator.getPolicies(String serviceName, String policyName)
[PATH1] if(LOG.isDebugEnabled())#1=T -> try-body throws -> if(LOG.isDebugEnabled())#2=T -> return policies
[PATH2] if(LOG.isDebugEnabled())#1=F -> if(StringUtils.isNotBlank(policyName))=T -> if(LOG.isDebugEna... | /* static context
[FOCAL] List<RangerPolicy> RangerValidator.getPolicies(String serviceName, String policyName)
[PATH1] if(LOG.isDebugEnabled())#1=T -> try-body throws -> if(LOG.isDebugEnabled())#2=T -> return policies
[PATH2] if(LOG.isDebugEnabled())#1=F -> if(StringUtils.isNotBlank(policyName))=T -> if(LOG.isDebugEna... | true | ok | {"focal": {"class": "RangerValidator", "name": "getPolicies", "signature": "List<RangerPolicy> getPolicies(String serviceName, String policyName)", "start_line": 3, "modifiers": "", "params": [{"name": "serviceName", "type": "String"}, {"name": "policyName", "type": "String"}], "return_type": "List<RangerPolicy>"}, "cl... |
227131980_94 | class TagUtils {
public static <T> MultivaluedMap<String, T> sanitizeHeaders(MultivaluedMap<String, T> headers) {
MultivaluedMap<String, T> sanitizedHeaders = new MultivaluedHashMap<>();
headers.forEach(
(key, value) -> {
if (AUTHORIZATION.equalsIgnoreCase(key)) {
sanitizedHead... | MultivaluedMap<String, String> headers = new MultivaluedHashMap<>();
headers.put(AUTHORIZATION, singletonList("1234"));
MultivaluedMap<String, ?> sanitizedHeaders = sanitizeHeaders(headers);
assertThat(sanitizedHeaders.getFirst(AUTHORIZATION)).isEqualTo("…");
}
} | [FOCAL] public static MultivaluedMap<String, T> TagUtils.sanitizeHeaders(MultivaluedMap<String, T> headers)
[CLASS] class TagUtils
[METRICS] loc=20 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] String sanitizeAuthorizationHeader(String header)
[CALLS-EXTERNAL] MultivaluedMap<String, T>.forEach/1... | /* static context
[FOCAL] public static MultivaluedMap<String, T> TagUtils.sanitizeHeaders(MultivaluedMap<String, T> headers)
[COLLABORATORS] param headers:MultivaluedMap<String, T> forEach/1; field value stream/0; field h toString/0
[CALLS-INTERNAL] String sanitizeAuthorizationHeader(String header)
[NEW] MultivaluedHa... | /* static context
[FOCAL] public static MultivaluedMap<String, T> TagUtils.sanitizeHeaders(MultivaluedMap<String, T> headers)
[COLLABORATORS] param headers:MultivaluedMap<String, T> forEach/1; field value stream/0; field h toString/0
[CALLS-INTERNAL] String sanitizeAuthorizationHeader(String header)
[NEW] MultivaluedHa... | true | ok | {"focal": {"class": "TagUtils", "name": "sanitizeHeaders", "signature": "MultivaluedMap<String, T> sanitizeHeaders(MultivaluedMap<String, T> headers)", "start_line": 3, "modifiers": "public static", "params": [{"name": "headers", "type": "MultivaluedMap<String, T>"}], "return_type": "MultivaluedMap<String, T>"}, "class... |
227144695_1 | class Jacobian {
public static double[][] approxJacobian(double[] x, Vector2VectorFunc func, double... arg)
{
final int n = x.length;
final double[] f0;
if (arg != null && arg.length > 0)
{
f0 = func.apply(x, arg);
}
else
{
f0 = fu... | final Vector2VectorFunc testFunc = (x, arg) -> x;
final double[] inputArr = new double[]{-1, -1, 2, 4, 5, 6, 8};
final double[][] fprime = Jacobian.approxJacobian(inputArr, testFunc);
for (int i = 0; i < fprime.length; i++)
{
for (int j = 0; j < fprime[0].length; j+... | [FOCAL] public static double[][] Jacobian.approxJacobian(double[] x, Vector2VectorFunc func, double... arg)
[CLASS] class Jacobian
[METRICS] loc=40 cc=6 branches=2 loops=3 returns=1 throws=0 nesting=3
[CALLS-EXTERNAL] Vector2VectorFunc.apply/2, Vector2VectorFunc.apply/1
[PATH1] if(arg != null && arg.length > 0)#1=T -> ... | /* static context
[FOCAL] public static double[][] Jacobian.approxJacobian(double[] x, Vector2VectorFunc func, double... arg)
[PATH1] if(arg != null && arg.length > 0)#1=T -> for(i < n)=T -> for(j < n)=F -> for(j < f0.length)=T -> if(arg != null && arg.length > 0)#2=T -> exit loop -> exit loop -> return jac
[PATH2] if(... | /* static context
[FOCAL] public static double[][] Jacobian.approxJacobian(double[] x, Vector2VectorFunc func, double... arg)
[PATH1] if(arg != null && arg.length > 0)#1=T -> for(i < n)=T -> for(j < n)=F -> for(j < f0.length)=T -> if(arg != null && arg.length > 0)#2=T -> exit loop -> exit loop -> return jac
[PATH2] if(... | true | ok | {"focal": {"class": "Jacobian", "name": "approxJacobian", "signature": "double[][] approxJacobian(double[] x, Vector2VectorFunc func, double... arg)", "start_line": 3, "modifiers": "public static", "params": [{"name": "x", "type": "double[]"}, {"name": "func", "type": "Vector2VectorFunc"}, {"name": "arg", "type": "doub... |
228257340_39 | class Purpose implements com.iabtcf.extras.gvl.Purpose {
@Override
public boolean getConsentable() {
return consentable;
}
@Override public int getId();
@Override public String getName();
@Override public String getDescription();
@Override public String getDescriptionLegal();
@... | Assert.assertTrue(purposeTen.getConsentable());
}
} | [FOCAL] @Override public boolean Purpose.getConsentable()
[CLASS] class Purpose implements com.iabtcf.extras.gvl.Purpose
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] int getId(); String getName(); String getDescription(); String getDescriptionLegal(); boolean getRightToObject()
[... | /* static context
[FOCAL] @Override public boolean Purpose.getConsentable()
*/
| /* static context
[FOCAL] @Override public boolean Purpose.getConsentable()
*/
class Purpose implements com.iabtcf.extras.gvl.Purpose {
@Override
public boolean getConsentable() {
return consentable;
}
@Override public int getId();
@Override public String getName();
@Override public St... | true | ok | {"focal": {"class": "Purpose", "name": "getConsentable", "signature": "boolean getConsentable()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "boolean"}, "class_info": {"name": "Purpose", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "com.iabtcf.extras.gvl.Purpos... |
228959889_0 | class Murmur3_128HashFunction implements HashFunction {
public byte[] hashBytes(byte[] var1) {
return newHasher().hashBytes(var1);
}
public Murmur3_128HashFunction(int seed);
public Hasher newHasher();
public byte[] hashBytes(byte[] var1, int var2, int var3);
}
class Murmur3_128HashFun... | final byte[] byteArray1 = new byte[]{1, 2, 3, 4, 5, 6, 7, 8};
final byte[] byteArray2 = new byte[]{1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8};
final byte[] byteArray3 = new byte[]{1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 9};
final byte[] expectedResult1 = new byte[]{-36, -65,... | [FOCAL] public byte[] Murmur3_128HashFunction.hashBytes(byte[] var1)
[CLASS] class Murmur3_128HashFunction implements HashFunction
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Hasher newHasher()
[CALLS-EXTERNAL] newHasher().hashBytes/1
[INPUTS] branches=- | result=var1
[DATAFLOW... | /* static context
[FOCAL] public byte[] Murmur3_128HashFunction.hashBytes(byte[] var1)
[INPUTS] branches=- | result=var1
[CALLS-INTERNAL] Hasher newHasher()
[CALLS-EXTERNAL] newHasher().hashBytes/1
*/
| /* static context
[FOCAL] public byte[] Murmur3_128HashFunction.hashBytes(byte[] var1)
[INPUTS] branches=- | result=var1
[CALLS-INTERNAL] Hasher newHasher()
[CALLS-EXTERNAL] newHasher().hashBytes/1
*/
class Murmur3_128HashFunction implements HashFunction {
public byte[] hashBytes(byte[] var1) {
return newH... | true | ok | {"focal": {"class": "Murmur3_128HashFunction", "name": "hashBytes", "signature": "byte[] hashBytes(byte[] var1)", "start_line": 3, "modifiers": "public", "params": [{"name": "var1", "type": "byte[]"}], "return_type": "byte[]"}, "class_info": {"name": "Murmur3_128HashFunction", "kind": "class", "modifiers": "", "supercl... |
229095535_2 | class LibraryUserDetailsService implements UserDetailsService, UserDetailsPasswordService {
@Override
public UserDetails updatePassword(UserDetails user, String newPassword) {
return userService
.findOneByEmail(user.getUsername())
.map(
u -> {
LOGGER.info(
... | User user =
new User("Hans", "Test", "test@example.com", "secret", Collections.singleton("USER"));
UserDetails userDetails = new AuthenticatedUser(user);
given(userService.findOneByEmail(any())).willReturn(Optional.of(user));
given(userService.save(any()))
.willReturn(
new U... | [FOCAL] @Override public UserDetails LibraryUserDetailsService.updatePassword(UserDetails user, String newPassword)
[CLASS] class LibraryUserDetailsService implements UserDetailsService, UserDetailsPasswordService
[METRICS] loc=17 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] userService .findOn... | /* static context
[FOCAL] @Override public UserDetails LibraryUserDetailsService.updatePassword(UserDetails user, String newPassword)
[INPUTS] branches=- | result=newPassword, user, userService
[COLLABORATORS] field userService:UserService findOneByEmail/1,save/1; param user:UserDetails getUsername/0,getPassword/0; fie... | /* static context
[FOCAL] @Override public UserDetails LibraryUserDetailsService.updatePassword(UserDetails user, String newPassword)
[INPUTS] branches=- | result=newPassword, user, userService
[COLLABORATORS] field userService:UserService findOneByEmail/1,save/1; param user:UserDetails getUsername/0,getPassword/0; fie... | true | ok | {"focal": {"class": "LibraryUserDetailsService", "name": "updatePassword", "signature": "UserDetails updatePassword(UserDetails user, String newPassword)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "user", "type": "UserDetails"}, {"name": "newPassword", "type": "String"}], "return_type": "Us... |
229869608_0 | class StingProcessor extends AbstractStandardProcessor {
@Nonnull
private String toFilename( @Nonnull final TypeElement typeElement )
{
return GeneratorUtil.getGeneratedClassName( typeElement, "", "" ).toString().replace( ".", "/" );
}
@Nonnull @Override protected String getIssueTrackerURL();
@Nonnull... | final List<String> expectedOutputs =
Collections.singletonList( toFilename( "expected", classname, "Sting_", "_Fragment.java" ) );
final List<JavaFileObject> javaFileObjects = inputs( classname );
javaFileObjects.addAll( inputs( additionalClassnames ) );
assertSuccessfulCompile( javaFileObjects, e... | [FOCAL] @Nonnull private String StingProcessor.toFilename(TypeElement typeElement)
[CLASS] class StingProcessor extends AbstractStandardProcessor
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] GeneratorUtil.getGeneratedClassName( typeElement, "", "" ....replace/2, GeneratorUtil.ge... | class StingProcessor extends AbstractStandardProcessor {
@Nonnull
private String toFilename( @Nonnull final TypeElement typeElement )
{
return GeneratorUtil.getGeneratedClassName( typeElement, "", "" ).toString().replace( ".", "/" );
}
@Nonnull @Override protected String getIssueTrackerURL();
@Nonnull... | false | ok | {"focal": {"class": "StingProcessor", "name": "toFilename", "signature": "String toFilename(TypeElement typeElement)", "start_line": 3, "modifiers": "@Nonnull private", "params": [{"name": "typeElement", "type": "TypeElement"}], "return_type": "String"}, "class_info": {"name": "StingProcessor", "kind": "class", "modifi... | |
230080058_1 | class MapUtils {
public static Map<String, Object> flatMap(@NonNull Map<String, Object> map, String joinKey) {
return recursiveFlat(map, joinKey, new ArrayList<>());
}
public static List<Map<String, Object>> flatMaps(@NonNull List<Map<String, Object>> maps, String joinKey);
public static List<... | String json = "{" +
" \"1\":\"value 1\"," +
" \"2\":{" +
" \"2.1\":{" +
" \"2.1.1\":\"value 2.1.1\"" +
" }" +
" }" +
"}";
Map<String, Object> map = JSONObject... | [FOCAL] public static Map<String, Object> MapUtils.flatMap(Map<String, Object> map, String joinKey)
[CLASS] class MapUtils
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Map<String, Object> recursiveFlat(Map<String, Object> map, String joinKey, List<String> path)
[NEW] ArrayList<>... | /* static context
[FOCAL] public static Map<String, Object> MapUtils.flatMap(Map<String, Object> map, String joinKey)
[INPUTS] branches=- | result=joinKey, map
[CALLS-INTERNAL] Map<String, Object> recursiveFlat(Map<String, Object> map, String joinKey, List<String> path)
[NEW] ArrayList<>
*/
| /* static context
[FOCAL] public static Map<String, Object> MapUtils.flatMap(Map<String, Object> map, String joinKey)
[INPUTS] branches=- | result=joinKey, map
[CALLS-INTERNAL] Map<String, Object> recursiveFlat(Map<String, Object> map, String joinKey, List<String> path)
[NEW] ArrayList<>
*/
class MapUtils {
public... | true | ok | {"focal": {"class": "MapUtils", "name": "flatMap", "signature": "Map<String, Object> flatMap(Map<String, Object> map, String joinKey)", "start_line": 3, "modifiers": "public static", "params": [{"name": "map", "type": "Map<String, Object>"}, {"name": "joinKey", "type": "String"}], "return_type": "Map<String, Object>"},... |
230236469_32 | class Script {
public Address getToAddress(NetworkParameters params) throws ScriptException {
return getToAddress(params, false);
}
private Script();
Script(List<ScriptChunk> chunks);
public Script(byte[] programBytes);
public Script(byte[] programBytes, long creationTimeSeconds);... | // P2PK
ECKey toKey = new ECKey();
Address toAddress = LegacyAddress.fromKey(TESTNET, toKey);
assertEquals(toAddress, ScriptBuilder.createP2PKOutputScript(toKey).getToAddress(TESTNET, true));
// pay to pubkey hash
assertEquals(toAddress, ScriptBuilder.createOutputScript(t... | [FOCAL] public Address Script.getToAddress(NetworkParameters params)
[CLASS] class Script
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] Address getToAddress(NetworkParameters params, boolean forcePayToPubKey)
[EXCEPTIONS] declares ScriptException
[INPUTS] branches=- | result=para... | /* static context
[FOCAL] public Address Script.getToAddress(NetworkParameters params)
[INPUTS] branches=- | result=params
[EXCEPTIONS] declares ScriptException
[CALLS-INTERNAL] Address getToAddress(NetworkParameters params, boolean forcePayToPubKey)
*/
| /* static context
[FOCAL] public Address Script.getToAddress(NetworkParameters params)
[INPUTS] branches=- | result=params
[EXCEPTIONS] declares ScriptException
[CALLS-INTERNAL] Address getToAddress(NetworkParameters params, boolean forcePayToPubKey)
*/
class Script {
public Address getToAddress(NetworkParameters ... | true | ok | {"focal": {"class": "Script", "name": "getToAddress", "signature": "Address getToAddress(NetworkParameters params) throws ScriptException", "start_line": 3, "modifiers": "public", "params": [{"name": "params", "type": "NetworkParameters"}], "return_type": "Address"}, "class_info": {"name": "Script", "kind": "class", "m... |
231329990_0 | class VertxTcpClientProvider implements NetworkProvider<TcpClientProperties> {
@Nonnull
@Override
public VertxTcpClient createNetwork(@Nonnull TcpClientProperties properties) {
VertxTcpClient client = new VertxTcpClient(properties.getId());
initClient(client, properties);
return c... | Vertx vertx = Vertx.vertx();
vertx.createNetServer()
.connectHandler(socket -> {
socket.write("tes");
socket.write("ttest");
})
.listen(12311);
VertxTcpClientProvider provider = new VertxTcpClientProvider(i... | [FOCAL] @Nonnull @Override public VertxTcpClient VertxTcpClientProvider.createNetwork(TcpClientProperties properties)
[CLASS] class VertxTcpClientProvider implements NetworkProvider<TcpClientProperties>
[METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] void initClient(VertxTcpClient ... | /* static context
[FOCAL] @Nonnull @Override public VertxTcpClient VertxTcpClientProvider.createNetwork(TcpClientProperties properties)
[INPUTS] branches=- | result=properties
[COLLABORATORS] param properties:TcpClientProperties getId/0
[CALLS-INTERNAL] void initClient(VertxTcpClient client, TcpClientProperties propert... | /* static context
[FOCAL] @Nonnull @Override public VertxTcpClient VertxTcpClientProvider.createNetwork(TcpClientProperties properties)
[INPUTS] branches=- | result=properties
[COLLABORATORS] param properties:TcpClientProperties getId/0
[CALLS-INTERNAL] void initClient(VertxTcpClient client, TcpClientProperties propert... | true | ok | {"focal": {"class": "VertxTcpClientProvider", "name": "createNetwork", "signature": "VertxTcpClient createNetwork(TcpClientProperties properties)", "start_line": 3, "modifiers": "@Nonnull @Override public", "params": [{"name": "properties", "type": "TcpClientProperties"}], "return_type": "VertxTcpClient"}, "class_info"... |
231519592_3 | class RefrigeratorInitCmdExe implements ExecutorI<Response, RefrigeratorInitCommand> {
@Override
public Response execute(RefrigeratorInitCommand cmd) {
refrigeratorMapper.truncate();
RefrigeratorRandomProfile refrigeratorRandomProfile = new RefrigeratorRandomProfile();
//先把大象全家都装进冰箱.... | Response response = refrigeratorInitCmdExe.execute(new RefrigeratorInitCommand());
assertTrue(response.isSuccess(),"业务执行失败");
}
} | [FOCAL] @Override public Response RefrigeratorInitCmdExe.execute(RefrigeratorInitCommand cmd)
[CLASS] class RefrigeratorInitCmdExe implements ExecutorI<Response, RefrigeratorInitCommand>
[METRICS] loc=19 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] refrigeratorMapper.truncate/0, refrigeratorMap... | /* static context
[FOCAL] @Override public Response RefrigeratorInitCmdExe.execute(RefrigeratorInitCommand cmd)
[INPUTS] branches=- | result=- | unused=cmd
[COLLABORATORS] field refrigeratorMapper truncate/0,save/1
[NEW] RefrigeratorRandomProfile
[CALLS-EXTERNAL] refrigeratorMapper.truncate/0, refrigeratorMapper.save/1... | /* static context
[FOCAL] @Override public Response RefrigeratorInitCmdExe.execute(RefrigeratorInitCommand cmd)
[INPUTS] branches=- | result=- | unused=cmd
[COLLABORATORS] field refrigeratorMapper truncate/0,save/1
[NEW] RefrigeratorRandomProfile
[CALLS-EXTERNAL] refrigeratorMapper.truncate/0, refrigeratorMapper.save/1... | true | ok | {"focal": {"class": "RefrigeratorInitCmdExe", "name": "execute", "signature": "Response execute(RefrigeratorInitCommand cmd)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "cmd", "type": "RefrigeratorInitCommand"}], "return_type": "Response"}, "class_info": {"name": "RefrigeratorInitCmdExe", "k... |
231533573_2 | class TubeBaseSessionFactory implements InnerSessionFactory {
public TubeBaseSessionFactory(final ClientFactory clientFactory,
final TubeClientConfig tubeClientConfig) throws TubeClientException {
super();
this.checkConfig(tubeClientConfig);
this.tubeClient... | TubeClientConfig config = mock(TubeClientConfig.class);
when(config.getMasterInfo()).thenReturn(new MasterInfo("192.168.1.1:18080"));
ClientFactory clientFactory = mock(ClientFactory.class);
PowerMockito.mockStatic(AddressUtils.class);
PowerMockito.when(AddressUtils.getLocalAddr... | [FOCAL] public TubeBaseSessionFactory.TubeBaseSessionFactory(ClientFactory clientFactory, TubeClientConfig tubeClientConfig)
[CLASS] class TubeBaseSessionFactory implements InnerSessionFactory
[METRICS] loc=24 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-INTERNAL] RpcServiceFactory getRpcServiceFactory()... | /* static context
[FOCAL] public TubeBaseSessionFactory.TubeBaseSessionFactory(ClientFactory clientFactory, TubeClientConfig tubeClientConfig)
[COLLABORATORS] param tubeClientConfig:TubeClientConfig getLinkStatsDurationMs/0,getLinkStatsForbiddenDurationMs/0,getLinkStatsMaxAllowedFailTimes/0,getLinkStatsMaxForbiddenRate... | /* static context
[FOCAL] public TubeBaseSessionFactory.TubeBaseSessionFactory(ClientFactory clientFactory, TubeClientConfig tubeClientConfig)
[COLLABORATORS] param tubeClientConfig:TubeClientConfig getLinkStatsDurationMs/0,getLinkStatsForbiddenDurationMs/0,getLinkStatsMaxAllowedFailTimes/0,getLinkStatsMaxForbiddenRate... | true | ok | {"focal": {"class": "TubeBaseSessionFactory", "name": "TubeBaseSessionFactory", "signature": "TubeBaseSessionFactory(ClientFactory clientFactory, TubeClientConfig tubeClientConfig) throws TubeClientException", "start_line": 3, "modifiers": "public", "params": [{"name": "clientFactory", "type": "ClientFactory"}, {"name"... |
232306581_4 | class Ut0Crc32 {
public static long crc32(byte[] data, int offset, int len) {
long crc = 0xFFFFFFFFL;
long[][] table = init(UT_CRC_32_SLICE_8_TABLE_THREAD_LOCAL.get());
/* Calculate byte-by-byte up to an 8-byte aligned address. After
this consume the input 8-bytes at a time. */
// In C code, it... | String str = "innodb";
byte[] bytes = str.getBytes();
assertThat(Ut0Crc32.crc32(bytes, 0, bytes.length), is(1090276284L));
assertThat(Ut0Crc32.crc32ByteByByte(bytes, 0, bytes.length), is(1090276284L));
}
} | [FOCAL] public static long Ut0Crc32.crc32(byte[] data, int offset, int len)
[CLASS] class Ut0Crc32
[METRICS] loc=38 cc=5 branches=0 loops=4 returns=1 throws=0 nesting=2
[CALLS-INTERNAL] long fromByteArray(byte[] bytes, int offset); long utCrc3264LowSw(long crc, long data, long[][] table); long utCrc328Sw(long crc, long... | /* static context
[FOCAL] public static long Ut0Crc32.crc32(byte[] data, int offset, int len)
[PATH1] while(len >= 128)=T -> for(i < 16)=F -> exit loop -> while(len >= 8)=F -> while(len > 0)=F -> return (~crc) & 0xFFFFFFFFL
[PATH2] while(len >= 128)=F -> while(len >= 8)=T -> exit loop -> while(len > 0)=T -> exit loop -... | /* static context
[FOCAL] public static long Ut0Crc32.crc32(byte[] data, int offset, int len)
[PATH1] while(len >= 128)=T -> for(i < 16)=F -> exit loop -> while(len >= 8)=F -> while(len > 0)=F -> return (~crc) & 0xFFFFFFFFL
[PATH2] while(len >= 128)=F -> while(len >= 8)=T -> exit loop -> while(len > 0)=T -> exit loop -... | true | ok | {"focal": {"class": "Ut0Crc32", "name": "crc32", "signature": "long crc32(byte[] data, int offset, int len)", "start_line": 3, "modifiers": "public static", "params": [{"name": "data", "type": "byte[]"}, {"name": "offset", "type": "int"}, {"name": "len", "type": "int"}], "return_type": "long"}, "class_info": {"name": "... |
232664319_8 | class CypherBasedMigration implements Migration {
List<String> getStatements() {
List<String> availableStatements = this.statements;
if (availableStatements == null) {
synchronized (this) {
availableStatements = this.statements;
if (availableStatements == null) {
this.statements = readStatements(... |
// Those are in eu.michael-simons.neo4j.neo4j-migrations:test-migrations
URL resource = CypherBasedMigrationTest.class.getResource("/some/changeset/V0002__create_new_data.cypher");
CypherBasedMigration migration = new CypherBasedMigration(resource);
List<String> statements = migration.getStatements();
asser... | [FOCAL] List<String> CypherBasedMigration.getStatements()
[CLASS] class CypherBasedMigration implements Migration
[METRICS] loc=14 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=3
[CALLS-INTERNAL] List<String> readStatements()
[FIELDS] read=statements | write=statements
[PATH1] if(availableStatements == null)#1=T -... | /* static context
[FOCAL] List<String> CypherBasedMigration.getStatements()
[PATH1] if(availableStatements == null)#1=T -> if(availableStatements == null)#2=T -> return availableStatements
[PATH2] if(availableStatements == null)#1=F -> return availableStatements
[PATH3] if(availableStatements == null)#1=T -> if(availab... | /* static context
[FOCAL] List<String> CypherBasedMigration.getStatements()
[PATH1] if(availableStatements == null)#1=T -> if(availableStatements == null)#2=T -> return availableStatements
[PATH2] if(availableStatements == null)#1=F -> return availableStatements
[PATH3] if(availableStatements == null)#1=T -> if(availab... | true | ok | {"focal": {"class": "CypherBasedMigration", "name": "getStatements", "signature": "List<String> getStatements()", "start_line": 3, "modifiers": "", "params": [], "return_type": "List<String>"}, "class_info": {"name": "CypherBasedMigration", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Migration"... |
232712706_9 | class EtcdMetaStore implements MetaStore {
@Override
public void watch(WatchType type, LongConsumer consumer) {
switch (type) {
case SCHEMAVERSION:
etcdClient.watch(SCHEMA_VERSION_PATH, false, consumer);
break;
case SCHEMATASK:
etcdClient.watch(TASK_LIST, true, consumer);
... | int parallel = 16;
CountDownLatch latch = new CountDownLatch(parallel);
ConcurrentHashMap<Integer, EtcdMetaStore> storeMap = new ConcurrentHashMap();
for (int i = 0; i < parallel; i++) {
EtcdMetaStore metaStore = new EtcdMetaStore();
Properties properties = IOUtil.loadResource("jim.properti... | [FOCAL] @Override public void EtcdMetaStore.watch(WatchType type, LongConsumer consumer)
[CLASS] class EtcdMetaStore implements MetaStore
[METRICS] loc=22 cc=6 branches=1 loops=0 returns=0 throws=0 nesting=1
[CALLS-EXTERNAL] etcdClient.watch/3
[PATH1] switch(type)=case SCHEMAVERSION
[PATH2] switch(type)=case SCHEMATASK... | /* static context
[FOCAL] @Override public void EtcdMetaStore.watch(WatchType type, LongConsumer consumer)
[PATH1] switch(type)=case SCHEMAVERSION
[PATH2] switch(type)=case SCHEMATASK
[PATH3] switch(type)=case PRIVERSION
[PATH4] switch(type)=case PRITASK
[PATH5] switch(type)=case INDEXTASK
[PATH6] switch(type)=default
... | /* static context
[FOCAL] @Override public void EtcdMetaStore.watch(WatchType type, LongConsumer consumer)
[PATH1] switch(type)=case SCHEMAVERSION
[PATH2] switch(type)=case SCHEMATASK
[PATH3] switch(type)=case PRIVERSION
[PATH4] switch(type)=case PRITASK
[PATH5] switch(type)=case INDEXTASK
[PATH6] switch(type)=default
... | true | ok | {"focal": {"class": "EtcdMetaStore", "name": "watch", "signature": "void watch(WatchType type, LongConsumer consumer)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "type", "type": "WatchType"}, {"name": "consumer", "type": "LongConsumer"}], "return_type": "void"}, "class_info": {"name": "EtcdM... |
233941256_356 | class DateRangeParser implements ConditionalValueParser {
public DateRange getRange(String dateRangeString) throws ParseException {
if (dateRangeString == null || dateRangeString.isEmpty())
throw new IllegalArgumentException("Passing empty Strings is not allowed");
String[] dateArr = d... | DateRange dateRange = dateRangeParser.getRange("Sep-Mar");
assertFalse(dateRange.isInRange(getCalendar(2014, Calendar.AUGUST, 31)));
assertTrue(dateRange.isInRange(getCalendar(2014, Calendar.SEPTEMBER, 1)));
assertTrue(dateRange.isInRange(getCalendar(2014, Calendar.DECEMBER, 24)));
... | [FOCAL] public DateRange DateRangeParser.getRange(String dateRangeString)
[CLASS] class DateRangeParser implements ConditionalValueParser
[METRICS] loc=20 cc=4 branches=3 loops=0 returns=2 throws=1 nesting=1
[CALLS-INTERNAL] ParsedCalendar parseDateString(String dateString)
[CALLS-EXTERNAL] String.isEmpty/0, String.spl... | /* static context
[FOCAL] public DateRange DateRangeParser.getRange(String dateRangeString)
[THROWS-WHEN] IllegalArgumentException when dateRangeString == null || dateRangeString.isEmpty()
[PATH1] if(dateRangeString == null || dateRangeString.isEmpty())=F -> if(dateArr.length > 2 || dateArr.length < 1)=F -> if(dateArr.... | /* static context
[FOCAL] public DateRange DateRangeParser.getRange(String dateRangeString)
[THROWS-WHEN] IllegalArgumentException when dateRangeString == null || dateRangeString.isEmpty()
[PATH1] if(dateRangeString == null || dateRangeString.isEmpty())=F -> if(dateArr.length > 2 || dateArr.length < 1)=F -> if(dateArr.... | true | ok | {"focal": {"class": "DateRangeParser", "name": "getRange", "signature": "DateRange getRange(String dateRangeString) throws ParseException", "start_line": 3, "modifiers": "public", "params": [{"name": "dateRangeString", "type": "String"}], "return_type": "DateRange"}, "class_info": {"name": "DateRangeParser", "kind": "c... |
234365176_2 | class SexpTokenizer {
public static List<Token> tokenize(InputStream in) throws SexpParserException, IOException {
return SexpTokenizer.tokenize(in);
}
private SexpTokenizer();
public static List<Token> tokenize(Reader in);
private void close();
private void flush();
private List<Token> getParsedTokens();
... | String testStr = "( defun \n test;no comments\n () \"hi ;no comment here \n there\") ;this is a comment";
StringReader input = new StringReader(testStr);
List<Token> expectedList = new ArrayList<>();
expectedList.add(new Token("(", 1));
expectedList.add(new Token("defun", 1));
expectedList.add(new Token("te... | [FOCAL] public static List<Token> SexpTokenizer.tokenize(InputStream in)
[CLASS] class SexpTokenizer
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] SexpTokenizer.tokenize/1
[EXCEPTIONS] declares SexpParserException, IOException
[INPUTS] branches=- | result=in
[DATAFLOW] in@param->... | /* static context
[FOCAL] public static List<Token> SexpTokenizer.tokenize(InputStream in)
[INPUTS] branches=- | result=in
[EXCEPTIONS] declares SexpParserException, IOException
[CALLS-EXTERNAL] SexpTokenizer.tokenize/1
*/
| /* static context
[FOCAL] public static List<Token> SexpTokenizer.tokenize(InputStream in)
[INPUTS] branches=- | result=in
[EXCEPTIONS] declares SexpParserException, IOException
[CALLS-EXTERNAL] SexpTokenizer.tokenize/1
*/
class SexpTokenizer {
public static List<Token> tokenize(InputStream in) throws SexpParserExcep... | true | ok | {"focal": {"class": "SexpTokenizer", "name": "tokenize", "signature": "List<Token> tokenize(InputStream in) throws SexpParserException, IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "in", "type": "InputStream"}], "return_type": "List<Token>"}, "class_info": {"name": "SexpTokenizer", "... |
234994470_5 | class AudioResource extends AbstractMediaResource<Audio> {
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path(ResourceDefinitions.Path.Common.SEARCH_FULL_PATH)
@Timed(name = MediaService.MetricsDefinitions.SearchAudio.TIMER_NAME, displayName =
METRICS_PREFIX + '.' + MediaService.MetricsDefinitions.SearchAu... | Client client = ClientBuilder.newClient();
WebTarget target =
client.target(
AUDIO_PATH + ResourceDefinitions.Path.Common.SEARCH_PATH + "/pink floyd");
List<Audio> audio = getResponseResult(target);
client.close();
assertEquals(145, audio.size());
}
} | [FOCAL] @GET @Produces(MediaType.APPLICATION_JSON) @Path(ResourceDefinitions.Path.Common.SEARCH_FULL_PATH) @Timed(name = Medi... Multi<Audio> AudioResource.searchAudio(String searchText)
[CLASS] class AudioResource extends AbstractMediaResource<Audio>
[METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=... | /* static context
[FOCAL] @GET @Produces(MediaType.APPLICATION_JSON) @Path(ResourceDefinitions.Path.Common.SEARCH_FULL_PATH) @Timed(name = Medi... Multi<Audio> AudioResource.searchAudio(String searchText)
[INPUTS] branches=- | result=searchText
[CALLS-EXTERNAL] getLogger().debug/2, getLogger/0 (inherited), createRespon... | /* static context
[FOCAL] @GET @Produces(MediaType.APPLICATION_JSON) @Path(ResourceDefinitions.Path.Common.SEARCH_FULL_PATH) @Timed(name = Medi... Multi<Audio> AudioResource.searchAudio(String searchText)
[INPUTS] branches=- | result=searchText
[CALLS-EXTERNAL] getLogger().debug/2, getLogger/0 (inherited), createRespon... | true | ok | {"focal": {"class": "AudioResource", "name": "searchAudio", "signature": "Multi<Audio> searchAudio(String searchText)", "start_line": 3, "modifiers": "@GET @Produces(MediaType.APPLICATION_JSON) @Path(ResourceDefinitions.Path.Common.SEARCH_FULL_PATH) @Timed(name = Medi...", "params": [{"name": "searchText", "type": "Str... |
235035304_9 | class MongoUriParser {
public static String[] getHosts(String mongoUri) {
Matcher m = MONGO_URI_PATTERN.matcher(mongoUri);
if (m.find()) {
return Optional.ofNullable(m.group(2))
.map(hosts -> hosts.split(","))
.orElseThrow(() -> new RuntimeException("unsupported mongo uri"));
} els... | String[] mongoHosts = MongoUriParser.getHosts("mongodb://us3r:P%40ssw0rd@mongo0.exmpl.com:27017/dbName?authSource=admin&authSource2=admin2");
assertEquals(1, mongoHosts.length);
assertEquals("mongo0.exmpl.com:27017", mongoHosts[0]);
}
} | [FOCAL] public static String[] MongoUriParser.getHosts(String mongoUri)
[CLASS] class MongoUriParser
[METRICS] loc=11 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] MONGO_URI_PATTERN.matcher/1, Matcher.find/0, Optional.ofNullable(m.group(2)) .map(hosts -> hosts.split....orElseThrow/1, Optional.of... | /* static context
[FOCAL] public static String[] MongoUriParser.getHosts(String mongoUri)
[THROWS-WHEN] RuntimeException when !m.find()
[PATH1] if(m.find())=T -> return Optional.ofNullable(m.group(2)) .map(hosts -> hosts.split(",")) .or...
[PATH2] if(m.find())=F -> throw new RuntimeException("unsupported mongo uri")
[I... | /* static context
[FOCAL] public static String[] MongoUriParser.getHosts(String mongoUri)
[THROWS-WHEN] RuntimeException when !m.find()
[PATH1] if(m.find())=T -> return Optional.ofNullable(m.group(2)) .map(hosts -> hosts.split(",")) .or...
[PATH2] if(m.find())=F -> throw new RuntimeException("unsupported mongo uri")
[I... | true | ok | {"focal": {"class": "MongoUriParser", "name": "getHosts", "signature": "String[] getHosts(String mongoUri)", "start_line": 3, "modifiers": "public static", "params": [{"name": "mongoUri", "type": "String"}], "return_type": "String[]"}, "class_info": {"name": "MongoUriParser", "kind": "class", "modifiers": "", "supercla... |
235406671_1 | class DifficultyCalculator {
public Difficulty getNextJobDifficulty(Miner miner) {
// when few shares have been submitted, use the starting difficulty
if (miner.getValidSharesSubmitted() < wait) {
return new Difficulty(startDiff);
}
// hashrate = hashes submitted / conn... | final BigInteger startDiff = BigInteger.valueOf(5000);
final DifficultyCalculator difficultyCalculator =
new DifficultyCalculator(1, 1, 5000L, 5);
for (int i = 0; i < 5; i++) {
final Miner miner = new Miner();
miner.setValidSharesSubmitted((long) i);
... | [FOCAL] public Difficulty DifficultyCalculator.getNextJobDifficulty(Miner miner)
[CLASS] class DifficultyCalculator
[METRICS] loc=14 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] Miner.getValidSharesSubmitted/0, miner.getHashesSubmitted().divide/1, Miner.getHashesSubmitted/0, BigInteger.valueOf/... | /* static context
[FOCAL] public Difficulty DifficultyCalculator.getNextJobDifficulty(Miner miner)
[PATH1] if(miner.getValidSharesSubmitted() < wait)=T -> return new Difficulty(startDiff)
[PATH2] if(miner.getValidSharesSubmitted() < wait)=F -> return new Difficulty(difficulty.max(minDiff))
[INPUTS] branches=miner | res... | /* static context
[FOCAL] public Difficulty DifficultyCalculator.getNextJobDifficulty(Miner miner)
[PATH1] if(miner.getValidSharesSubmitted() < wait)=T -> return new Difficulty(startDiff)
[PATH2] if(miner.getValidSharesSubmitted() < wait)=F -> return new Difficulty(difficulty.max(minDiff))
[INPUTS] branches=miner | res... | true | ok | {"focal": {"class": "DifficultyCalculator", "name": "getNextJobDifficulty", "signature": "Difficulty getNextJobDifficulty(Miner miner)", "start_line": 3, "modifiers": "public", "params": [{"name": "miner", "type": "Miner"}], "return_type": "Difficulty"}, "class_info": {"name": "DifficultyCalculator", "kind": "class", "... |
235577942_315 | class AuthorizationService {
public boolean hasManagerPrivilegeForDepartment(Long departmentId) {
UserContextRole userRole = userRoleFromContextService.getUserRoleInUnitId(departmentId);
return userRole.isHigherAuthorityTypeThan(UserContextRole.OKRMEMBER);
}
@Autowired public AuthorizationService(UserR... | mockCurrentUserRole(UserContextRole.OKRMANAGER);
boolean actual = authorizationService.hasManagerPrivilegeForDepartment(departmentId);
Assert.assertTrue(actual);
}
} | [FOCAL] public boolean AuthorizationService.hasManagerPrivilegeForDepartment(Long departmentId)
[CLASS] class AuthorizationService
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] UserRoleFromContextService.getUserRoleInUnitId/1, UserContextRole.isHigherAuthorityTypeThan/1
[FIELDS] ... | /* static context
[FOCAL] public boolean AuthorizationService.hasManagerPrivilegeForDepartment(Long departmentId)
[INPUTS] branches=- | result=departmentId, userRoleFromContextService
[COLLABORATORS] field userRoleFromContextService:UserRoleFromContextService getUserRoleInUnitId/1
[FIELDS] read=userRoleFromContextServi... | /* static context
[FOCAL] public boolean AuthorizationService.hasManagerPrivilegeForDepartment(Long departmentId)
[INPUTS] branches=- | result=departmentId, userRoleFromContextService
[COLLABORATORS] field userRoleFromContextService:UserRoleFromContextService getUserRoleInUnitId/1
[FIELDS] read=userRoleFromContextServi... | true | ok | {"focal": {"class": "AuthorizationService", "name": "hasManagerPrivilegeForDepartment", "signature": "boolean hasManagerPrivilegeForDepartment(Long departmentId)", "start_line": 3, "modifiers": "public", "params": [{"name": "departmentId", "type": "Long"}], "return_type": "boolean"}, "class_info": {"name": "Authorizati... |
235590282_3 | class UserMapper {
public List<User> userDTOsToUsers(List<UserDTO> userDTOs) {
return userDTOs.stream()
.filter(Objects::nonNull)
.map(this::userDTOToUser)
.collect(Collectors.toList());
}
public List<UserDTO> usersToUserDTOs(List<User> users);
public UserDT... | userDto.setAuthorities(null);
List<UserDTO> usersDto = new ArrayList<>();
usersDto.add(userDto);
List<User> users = userMapper.userDTOsToUsers(usersDto);
assertThat(users).isNotEmpty();
assertThat(users).size().isEqualTo(1);
assertThat(users.get(0).getAuthoriti... | [FOCAL] public List<User> UserMapper.userDTOsToUsers(List<UserDTO> userDTOs)
[CLASS] class UserMapper
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] userDTOs.stream() .filter(Objects::nonNull) .map(this::us....collect/1, userDTOs.stream() .filter(Objects::nonNull).map/1, userDTOs.... | /* static context
[FOCAL] public List<User> UserMapper.userDTOsToUsers(List<UserDTO> userDTOs)
[INPUTS] branches=- | result=userDTOs
[COLLABORATORS] param userDTOs:List<UserDTO> stream/0
[CALLS-EXTERNAL] userDTOs.stream() .filter(Objects::nonNull) .map(this::us....collect/1, userDTOs.stream() .filter(Objects::nonNull).... | /* static context
[FOCAL] public List<User> UserMapper.userDTOsToUsers(List<UserDTO> userDTOs)
[INPUTS] branches=- | result=userDTOs
[COLLABORATORS] param userDTOs:List<UserDTO> stream/0
[CALLS-EXTERNAL] userDTOs.stream() .filter(Objects::nonNull) .map(this::us....collect/1, userDTOs.stream() .filter(Objects::nonNull).... | true | ok | {"focal": {"class": "UserMapper", "name": "userDTOsToUsers", "signature": "List<User> userDTOsToUsers(List<UserDTO> userDTOs)", "start_line": 3, "modifiers": "public", "params": [{"name": "userDTOs", "type": "List<UserDTO>"}], "return_type": "List<User>"}, "class_info": {"name": "UserMapper", "kind": "class", "modifier... |
235957092_0 | class RLParamParser {
public RLParams getParams(String jsonStr) {
JSONObject jsonParams = new JSONObject(jsonStr);
RLParams params = new RLParams();
if (jsonParams.has("params")) {
JSONArray paramList = jsonParams.getJSONArray("params");
for (int i = 0; i < paramList... | RLParamParser parser = new RLParamParser();
RLParams params = parser.getParams("{\"params\" : [{\"type\": \"int_array\", \"name\": \"numc\", \"val\": [1,2,4]}]}");
List<Integer> numc = (List<Integer>) params.get("numc");
Integer[] expectedNumc = new Integer[]{1, 2, 4};
assertArra... | [FOCAL] public RLParams RLParamParser.getParams(String jsonStr)
[CLASS] class RLParamParser
[METRICS] loc=73 cc=16 branches=2 loops=5 returns=1 throws=1 nesting=4
[CALLS-EXTERNAL] JSONObject.has/1, JSONObject.getJSONArray/1, JSONArray.length/0, JSONArray.getJSONObject/1, JSONObject.getString/1, RLParams.add/2, JSONObje... | /* static context
[FOCAL] public RLParams RLParamParser.getParams(String jsonStr)
[THROWS-WHEN] JSONException when !jsonParams.has("params")
[PATH1] if(jsonParams.has("params"))=T -> for(i < paramList.length())=T -> switch(stringType)=case "string_array" -> for(j < jsonArray.length())#1=F -> exit loop -> return params
... | /* static context
[FOCAL] public RLParams RLParamParser.getParams(String jsonStr)
[THROWS-WHEN] JSONException when !jsonParams.has("params")
[PATH1] if(jsonParams.has("params"))=T -> for(i < paramList.length())=T -> switch(stringType)=case "string_array" -> for(j < jsonArray.length())#1=F -> exit loop -> return params
... | true | ok | {"focal": {"class": "RLParamParser", "name": "getParams", "signature": "RLParams getParams(String jsonStr)", "start_line": 3, "modifiers": "public", "params": [{"name": "jsonStr", "type": "String"}], "return_type": "RLParams"}, "class_info": {"name": "RLParamParser", "kind": "class", "modifiers": "", "superclass": null... |
235979171_1 | class RegistryActionFunction {
public Try<FileInputStream> tryStreamFileSubjects() {
File file = new File(this.config.getString("avro.subjects.yaml"));
return Try
.ofFailable(() -> new FileInputStream(file))
.onFailure((t) -> logger.error("Fail to load the yaml fil... | Config config = ConfigFactory
.parseResources("application-test.conf")
.withValue("avro.subjects.yaml", ConfigValueFactory.fromAnyRef("/totally/fake/path/to.yaml"));
service = new RegistryActionFunction(config);
Try<FileInputStream> triedInputStream = service.tr... | [FOCAL] public Try<FileInputStream> RegistryActionFunction.tryStreamFileSubjects()
[CLASS] class RegistryActionFunction
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] this.config.getString/1, Try .ofFailable(() -> new FileInputStream(file)).onFailure/1, Try.ofFailable/1, logger.er... | /* static context
[FOCAL] public Try<FileInputStream> RegistryActionFunction.tryStreamFileSubjects()
[COLLABORATORS] field config getString/1
[FIELDS] read=config
[NEW] File, FileInputStream
[CALLS-EXTERNAL] this.config.getString/1, Try .ofFailable(() -> new FileInputStream(file)).onFailure/1, Try.ofFailable/1, logger.... | /* static context
[FOCAL] public Try<FileInputStream> RegistryActionFunction.tryStreamFileSubjects()
[COLLABORATORS] field config getString/1
[FIELDS] read=config
[NEW] File, FileInputStream
[CALLS-EXTERNAL] this.config.getString/1, Try .ofFailable(() -> new FileInputStream(file)).onFailure/1, Try.ofFailable/1, logger.... | true | ok | {"focal": {"class": "RegistryActionFunction", "name": "tryStreamFileSubjects", "signature": "Try<FileInputStream> tryStreamFileSubjects()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Try<FileInputStream>"}, "class_info": {"name": "RegistryActionFunction", "kind": "class", "modifiers": "", "su... |
236336373_3 | class HeapPriorityQueue extends AbstractPriorityQueue<K,V> {
public Entry<K,V> removeMin() @Override
public Entry<K,V> removeMin() ;
public Entry<K,V> removeMin() public HeapPriorityQueue();
public Entry<K,V> removeMin() public HeapPriorityQueue(Comparator<K> comp);
public Entry<K,V> removeMin() protecte... | Integer[] arr = new Integer[] {35,26,15,24,33,4,12,1,23,21,2,5};
HeapPriorityQueue<Integer, String> pq = new HeapPriorityQueue<>();
for(Integer i : arr) pq.insert(i, Integer.toString(i));
assertEquals(1, pq.removeMin().getKey());
assertEquals(11, pq.size());
assertEquals(2, pq.min().getKey());
}
} | [FOCAL] public Entry<K,V> HeapPriorityQueue.removeMin()
[CLASS] class HeapPriorityQueue extends AbstractPriorityQueue<K,V>
[METRICS] loc=1 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CLASS-MEMBERS] Entry<K,V> removeMin(); Entry<K,V> removeMin(); Entry<K,V> removeMin(); int parent(int j); Entry<K,V> removeMin(... | /* static context
[FOCAL] public Entry<K,V> HeapPriorityQueue.removeMin()
*/
| /* static context
[FOCAL] public Entry<K,V> HeapPriorityQueue.removeMin()
*/
class HeapPriorityQueue extends AbstractPriorityQueue<K,V> {
public Entry<K,V> removeMin() @Override
public Entry<K,V> removeMin() ;
public Entry<K,V> removeMin() public HeapPriorityQueue();
public Entry<K,V> removeMin() public Hea... | true | partial | {"focal": {"class": "HeapPriorityQueue", "name": "removeMin", "signature": "Entry<K,V> removeMin()", "start_line": 4, "modifiers": "public", "params": [], "return_type": "Entry<K,V>"}, "class_info": {"name": "HeapPriorityQueue", "kind": "class", "modifiers": "", "superclass": "AbstractPriorityQueue<K,V>", "interfaces":... |
236431478_5 | class HelloSpringBoot {
@PostMapping("text")
public String text(@RequestBody String text){
return text;
}
@RequestMapping("string") @ResponseStatus(HttpStatus.OK) public String helloString();
@RequestMapping(value = "json") public Messages helloJson();
@GetMapping(value = "param") pub... | String string = "Hi,Spring Boot";
String result = this.restTemplate.postForObject("/hello/text", string, String.class);
assertThat(result).isEqualTo(string);
}
} | [FOCAL] @PostMapping("text") public String HelloSpringBoot.text(String text)
[CLASS] class HelloSpringBoot
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[INPUTS] branches=- | result=text
[DATAFLOW] text@param->L3
[CLASS-MEMBERS] String helloString(); Messages helloJson(); Messages param(String us... | /* static context
[FOCAL] @PostMapping("text") public String HelloSpringBoot.text(String text)
[INPUTS] branches=- | result=text
*/
| /* static context
[FOCAL] @PostMapping("text") public String HelloSpringBoot.text(String text)
[INPUTS] branches=- | result=text
*/
class HelloSpringBoot {
@PostMapping("text")
public String text(@RequestBody String text){
return text;
}
@RequestMapping("string") @ResponseStatus(HttpStatus.OK... | true | ok | {"focal": {"class": "HelloSpringBoot", "name": "text", "signature": "String text(String text)", "start_line": 3, "modifiers": "@PostMapping(\"text\") public", "params": [{"name": "text", "type": "String"}], "return_type": "String"}, "class_info": {"name": "HelloSpringBoot", "kind": "class", "modifiers": "", "superclass... |
237265610_7 | class FindMeetingQuery {
public Collection<TimeRange> query(Collection<Event> events, MeetingRequest request) {
throw new UnsupportedOperationException("TODO: Implement this method.");
}
private static final Collection<Event> NO_EVENTS;
private static final Collection<String> NO_ATTENDEES;
private stati... | // Have an event for each person, but have the first event be contained in the second event.
// This rules out using the method .contains for event A in event B.
// |--B--|
// Events : |----A----|
//
// Day : |---------------------|
// Option... | [FOCAL] public Collection<TimeRange> FindMeetingQuery.query(Collection<Event> events, MeetingRequest request)
[CLASS] class FindMeetingQuery
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=1 nesting=0
[NEW] UnsupportedOperationException
[EXCEPTIONS] throws UnsupportedOperationException
[THROWS-WHEN] Unsupporte... | /* static context
[FOCAL] public Collection<TimeRange> FindMeetingQuery.query(Collection<Event> events, MeetingRequest request)
[THROWS-WHEN] UnsupportedOperationException when always
[INPUTS] branches=- | result=- | unused=events, request
[EXCEPTIONS] throws UnsupportedOperationException
[NEW] UnsupportedOperationExce... | /* static context
[FOCAL] public Collection<TimeRange> FindMeetingQuery.query(Collection<Event> events, MeetingRequest request)
[THROWS-WHEN] UnsupportedOperationException when always
[INPUTS] branches=- | result=- | unused=events, request
[EXCEPTIONS] throws UnsupportedOperationException
[NEW] UnsupportedOperationExce... | true | ok | {"focal": {"class": "FindMeetingQuery", "name": "query", "signature": "Collection<TimeRange> query(Collection<Event> events, MeetingRequest request)", "start_line": 3, "modifiers": "public", "params": [{"name": "events", "type": "Collection<Event>"}, {"name": "request", "type": "MeetingRequest"}], "return_type": "Colle... |
238661958_7 | class PrescriptionController {
@PutMapping("/{id}")
public void update(@RequestHeader(Constants.GRANT_HEADER) PureGrant grant,
@PathVariable("id") String prescriptionId, @RequestBody Prescription prescription) {
if (StringUtils.isNotBlank(prescription.getId()) && !StringUtils.equals(prescriptionId, prescription... | String prescriptionId = this.prescriptions.iterator().next();
HttpHeaders headers = new HttpHeaders();
headers.set(Constants.GRANT_HEADER, this.registeredPhysician.getGrant());
HttpEntity<?> entity = new HttpEntity<>(headers);
ResponseEntity<Prescription> response;
// Get prescription
response = this.re... | [FOCAL] @PutMapping("/{id}") public void PrescriptionController.update(PureGrant grant, String prescriptionId, Prescription prescription)
[CLASS] class PrescriptionController
[METRICS] loc=8 cc=2 branches=1 loops=0 returns=0 throws=1 nesting=1
[CALLS-EXTERNAL] StringUtils.isNotBlank/1, Prescription.getId/0, StringUtils... | /* static context
[FOCAL] @PutMapping("/{id}") public void PrescriptionController.update(PureGrant grant, String prescriptionId, Prescription prescription)
[THROWS-WHEN] BadRequestException when StringUtils.isNotBlank(prescription.getId()) && !StringUtils.equals(prescriptionId, prescription.getId())
[PATH1] if(StringUt... | /* static context
[FOCAL] @PutMapping("/{id}") public void PrescriptionController.update(PureGrant grant, String prescriptionId, Prescription prescription)
[THROWS-WHEN] BadRequestException when StringUtils.isNotBlank(prescription.getId()) && !StringUtils.equals(prescriptionId, prescription.getId())
[PATH1] if(StringUt... | true | ok | {"focal": {"class": "PrescriptionController", "name": "update", "signature": "void update(PureGrant grant, String prescriptionId, Prescription prescription)", "start_line": 3, "modifiers": "@PutMapping(\"/{id}\") public", "params": [{"name": "grant", "type": "PureGrant"}, {"name": "prescriptionId", "type": "String"}, {... |
239025775_39 | class MoreBodyPublishers {
public static BodyPublisher ofObject(Object object, @Nullable MediaType mediaType) {
TypeRef<?> runtimeType = TypeRef.from(object.getClass());
Encoder encoder =
Encoder.getEncoder(runtimeType, mediaType)
.orElseThrow(() -> unsupportedConversion(runtimeType, medi... | var content = CharBuffer.wrap("<p>very important text</p>");
var body = ofObject(content, MediaType.parse("text/html"));
assertEquals(content, US_ASCII.decode(BodyCollector.collect(body)));
}
} | [FOCAL] public static BodyPublisher MoreBodyPublishers.ofObject(Object object, MediaType mediaType)
[CLASS] class MoreBodyPublishers
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] UnsupportedOperationException unsupportedConversion(TypeRef<?> type, MediaType mediaType)
[CALLS-EXTE... | /* static context
[FOCAL] public static BodyPublisher MoreBodyPublishers.ofObject(Object object, MediaType mediaType)
[INPUTS] branches=- | result=mediaType, object
[CALLS-INTERNAL] UnsupportedOperationException unsupportedConversion(TypeRef<?> type, MediaType mediaType)
[CALLS-EXTERNAL] TypeRef.from/1, Object.getClass... | /* static context
[FOCAL] public static BodyPublisher MoreBodyPublishers.ofObject(Object object, MediaType mediaType)
[INPUTS] branches=- | result=mediaType, object
[CALLS-INTERNAL] UnsupportedOperationException unsupportedConversion(TypeRef<?> type, MediaType mediaType)
[CALLS-EXTERNAL] TypeRef.from/1, Object.getClass... | true | ok | {"focal": {"class": "MoreBodyPublishers", "name": "ofObject", "signature": "BodyPublisher ofObject(Object object, MediaType mediaType)", "start_line": 3, "modifiers": "public static", "params": [{"name": "object", "type": "Object"}, {"name": "mediaType", "type": "MediaType"}], "return_type": "BodyPublisher"}, "class_in... |
239499581_3 | class SqlParserServiceImpl implements SqlParserService {
@Override
public List<SqlCreateTable> sqlTableParser(String ddlSql) throws Exception {
List<SqlCreateTable> result = new LinkedList<>();
SqlNodeList nodeList = SqlUtils.parseSql(ddlSql);
for (SqlNode sqlNode : nodeList) {
if (sqlNode instan... | String table = "CREATE TABLE tbl1 (\n" +
" `a` bigint,\n" +
" `date` date,\n" +
" h varchar, \n" +
" g as 2 * (a + 1), \n" +
" ts as toTimestamp(b, 'yyyy-MM-dd HH:mm:ss'), \n" +
" b varchar,\n" +
" proc as PROCTIME(), \n" +
" PRIMARY KEY (a, b)... | [FOCAL] @Override public List<SqlCreateTable> SqlParserServiceImpl.sqlTableParser(String ddlSql)
[CLASS] class SqlParserServiceImpl implements SqlParserService
[METRICS] loc=34 cc=6 branches=3 loops=2 returns=1 throws=0 nesting=4
[CALLS-EXTERNAL] SqlUtils.parseSql/1, List<SqlCreateTable>.add/1, ((SqlCreateTable) sqlNod... | /* static context
[FOCAL] @Override public List<SqlCreateTable> SqlParserServiceImpl.sqlTableParser(String ddlSql)
[PATH1] foreach(SqlNode sqlNode : nodeList)=T -> if(sqlNode instanceof SqlCreateTable)=T -> foreach(SqlNode sqlNode1 : columnList)=T -> if(sqlNode1 instanceof SqlTableColumn)=T -> if(sqlNode1 instanceof Sq... | /* static context
[FOCAL] @Override public List<SqlCreateTable> SqlParserServiceImpl.sqlTableParser(String ddlSql)
[PATH1] foreach(SqlNode sqlNode : nodeList)=T -> if(sqlNode instanceof SqlCreateTable)=T -> foreach(SqlNode sqlNode1 : columnList)=T -> if(sqlNode1 instanceof SqlTableColumn)=T -> if(sqlNode1 instanceof Sq... | true | ok | {"focal": {"class": "SqlParserServiceImpl", "name": "sqlTableParser", "signature": "List<SqlCreateTable> sqlTableParser(String ddlSql) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "ddlSql", "type": "String"}], "return_type": "List<SqlCreateTable>"}, "class_info": {"name": "Sq... |
240818625_0 | class ObjectOrderRandomizer {
public static JsonAdapter.Factory create() {
return new Factory(new Random());
}
public static JsonAdapter.Factory create(Random random);
}
class ObjectOrderRandomizerTest {
@Test public void createNoNulls() {
| try {
ObjectOrderRandomizer.create(null);
fail();
} catch (NullPointerException expected) {
}
}
} | [FOCAL] public static JsonAdapter.Factory ObjectOrderRandomizer.create()
[CLASS] class ObjectOrderRandomizer
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] Factory, Random
[CLASS-MEMBERS] JsonAdapter.Factory create(Random random)
[TEST] ObjectOrderRandomizerTest: @Test public void createNoNu... | /* static context
[FOCAL] public static JsonAdapter.Factory ObjectOrderRandomizer.create()
[NEW] Factory, Random
*/
| /* static context
[FOCAL] public static JsonAdapter.Factory ObjectOrderRandomizer.create()
[NEW] Factory, Random
*/
class ObjectOrderRandomizer {
public static JsonAdapter.Factory create() {
return new Factory(new Random());
}
public static JsonAdapter.Factory create(Random random);
}
class ObjectOrderRan... | true | ok | {"focal": {"class": "ObjectOrderRandomizer", "name": "create", "signature": "JsonAdapter.Factory create()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "JsonAdapter.Factory"}, "class_info": {"name": "ObjectOrderRandomizer", "kind": "class", "modifiers": "", "superclass": null, "interface... |
241565088_0 | class Gmp {
public static BigInteger exactDivide(BigInteger dividend, BigInteger divisor) {
if (divisor.signum() == 0) {
throw new ArithmeticException("BigInteger divide by zero");
}
return INSTANCE.get().exactDivImpl(dividend, divisor);
}
private Gmp();
public static void checkLoaded();
... | assertEquals(BigInteger.valueOf(1), exactDivide(BigInteger.valueOf(1), BigInteger.valueOf(1)));
assertEquals(BigInteger.valueOf(3), exactDivide(BigInteger.valueOf(9), BigInteger.valueOf(3)));
assertEquals(BigInteger.valueOf(4), exactDivide(BigInteger.valueOf(12), BigInteger.valueOf(3)));
Random rnd = ne... | [FOCAL] public static BigInteger Gmp.exactDivide(BigInteger dividend, BigInteger divisor)
[CLASS] class Gmp
[METRICS] loc=6 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] BigInteger.signum/0, INSTANCE.get().exactDivImpl/2, INSTANCE.get/0
[NEW] ArithmeticException
[EXCEPTIONS] throws ArithmeticExc... | /* static context
[FOCAL] public static BigInteger Gmp.exactDivide(BigInteger dividend, BigInteger divisor)
[THROWS-WHEN] ArithmeticException when divisor.signum() == 0
[PATH1] if(divisor.signum() == 0)=T -> throw new ArithmeticException("BigInteger divide by zero")
[PATH2] if(divisor.signum() == 0)=F -> return INSTANC... | /* static context
[FOCAL] public static BigInteger Gmp.exactDivide(BigInteger dividend, BigInteger divisor)
[THROWS-WHEN] ArithmeticException when divisor.signum() == 0
[PATH1] if(divisor.signum() == 0)=T -> throw new ArithmeticException("BigInteger divide by zero")
[PATH2] if(divisor.signum() == 0)=F -> return INSTANC... | true | ok | {"focal": {"class": "Gmp", "name": "exactDivide", "signature": "BigInteger exactDivide(BigInteger dividend, BigInteger divisor)", "start_line": 3, "modifiers": "public static", "params": [{"name": "dividend", "type": "BigInteger"}, {"name": "divisor", "type": "BigInteger"}], "return_type": "BigInteger"}, "class_info": ... |
242737551_29 | class TodoResource {
@PUT
@Path("/{id}")
@Transactional
@Operation(description = "Update a todo")
@APIResponses({
@APIResponse(responseCode = "204", description = "Todo updated"),
@APIResponse(responseCode = "400", description = "Invalid request data",
content = @Content(schema = @Schem... | Todo defaultTodo = TestTodos.newDefaultTodo();
ModifiedTodo modifiedTodo = new ModifiedTodo();
modifiedTodo.setTitle(defaultTodo.getTitle());
modifiedTodo.setDescription(null);
modifiedTodo.setDueDate(defaultTodo.getDueDate());
modifiedTodo.setDone(true);
Mockito.doReturn(Optional.empty())... | [FOCAL] @PUT @Path("/{id}") @Transactional @Operation(description = "Update a todo") @APIResponses({ @APIResponse(responseCod... Response TodoResource.updateTodo(Long todoId, ModifiedTodo modifiedTodo)
[CLASS] class TodoResource
[METRICS] loc=32 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] LOG.... | /* static context
[FOCAL] @PUT @Path("/{id}") @Transactional @Operation(description = "Update a todo") @APIResponses({ @APIResponse(responseCod... Response TodoResource.updateTodo(Long todoId, ModifiedTodo modifiedTodo)
[PATH1] if(!foundTodo.isPresent())=T -> return Response.status(Status.NOT_FOUND).build()
[PATH2] if(... | /* static context
[FOCAL] @PUT @Path("/{id}") @Transactional @Operation(description = "Update a todo") @APIResponses({ @APIResponse(responseCod... Response TodoResource.updateTodo(Long todoId, ModifiedTodo modifiedTodo)
[PATH1] if(!foundTodo.isPresent())=T -> return Response.status(Status.NOT_FOUND).build()
[PATH2] if(... | true | ok | {"focal": {"class": "TodoResource", "name": "updateTodo", "signature": "Response updateTodo(Long todoId, ModifiedTodo modifiedTodo)", "start_line": 3, "modifiers": "@PUT @Path(\"/{id}\") @Transactional @Operation(description = \"Update a todo\") @APIResponses({ @APIResponse(responseCod...", "params": [{"name": "todoId"... |
244294736_5 | class ConsulMetaDataCollector implements MetaDataCollector {
@Override
public String getConsumerMetaData(MetadataIdentifier key) {
return doGetMetaData(key);
}
@Override public URL getUrl();
@Override public void setUrl(URL url);
@Override public void init();
@Override public Strin... | MetadataIdentifier identifier = buildIdentifier(false);
Map<String, String> consumerParams = new HashMap<>();
consumerParams.put("k1", "v1");
consumerParams.put("k2", "1");
consumerParams.put("k3", "true");
String metadata = gson.toJson(consumerParams);
consulMet... | [FOCAL] @Override public String ConsulMetaDataCollector.getConsumerMetaData(MetadataIdentifier key)
[CLASS] class ConsulMetaDataCollector implements MetaDataCollector
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] String doGetMetaData(MetadataIdentifier key)
[INPUTS] branches=- | ... | /* static context
[FOCAL] @Override public String ConsulMetaDataCollector.getConsumerMetaData(MetadataIdentifier key)
[INPUTS] branches=- | result=key
[CALLS-INTERNAL] String doGetMetaData(MetadataIdentifier key)
*/
| /* static context
[FOCAL] @Override public String ConsulMetaDataCollector.getConsumerMetaData(MetadataIdentifier key)
[INPUTS] branches=- | result=key
[CALLS-INTERNAL] String doGetMetaData(MetadataIdentifier key)
*/
class ConsulMetaDataCollector implements MetaDataCollector {
@Override
public String getConsume... | true | ok | {"focal": {"class": "ConsulMetaDataCollector", "name": "getConsumerMetaData", "signature": "String getConsumerMetaData(MetadataIdentifier key)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "key", "type": "MetadataIdentifier"}], "return_type": "String"}, "class_info": {"name": "ConsulMetaDataCo... |
244419190_1 | class WeatherQueries {
public Iterable<Integer> getMaxTemperatures(LocalDate fromDate, LocalDate toDate, String location) throws IOException {
Iterable<DailyWeatherInfo> weatherInfos = weatherApi.pastWeather(fromDate, toDate, location);
return QueriesEager.map(weatherInfos, dwi -> dwi.getTempMaxC(... | // Arrange
final LocalDate fromDate = LocalDate.of(2020, 3, 1);
final LocalDate toDate = LocalDate.of(2020, 3, 5);
String location = "Lisbon";
WeatherQueries wq = new WeatherQueries(new MemoryWeatherApi());
// Act
Iterable<Integer> maxTemperatures = wq.getMaxTe... | [FOCAL] public Iterable<Integer> WeatherQueries.getMaxTemperatures(LocalDate fromDate, LocalDate toDate, String location)
[CLASS] class WeatherQueries
[METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] weatherApi.pastWeather/3, QueriesEager.map/2, dwi.getTempMaxC/0
[EXCEPTIONS] declar... | /* static context
[FOCAL] public Iterable<Integer> WeatherQueries.getMaxTemperatures(LocalDate fromDate, LocalDate toDate, String location)
[INPUTS] branches=- | result=fromDate, location, toDate
[COLLABORATORS] field weatherApi pastWeather/3; field dwi getTempMaxC/0
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] w... | /* static context
[FOCAL] public Iterable<Integer> WeatherQueries.getMaxTemperatures(LocalDate fromDate, LocalDate toDate, String location)
[INPUTS] branches=- | result=fromDate, location, toDate
[COLLABORATORS] field weatherApi pastWeather/3; field dwi getTempMaxC/0
[EXCEPTIONS] declares IOException
[CALLS-EXTERNAL] w... | true | ok | {"focal": {"class": "WeatherQueries", "name": "getMaxTemperatures", "signature": "Iterable<Integer> getMaxTemperatures(LocalDate fromDate, LocalDate toDate, String location) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "fromDate", "type": "LocalDate"}, {"name": "toDate", "type": "Loc... |
244941906_7 | class CouplingFilterUtils {
static boolean matchCoupling(final CouplingFilter filter, final MethodCoupling coupling) {
return matchString(filter.getSourcePackagePattern(), coupling.getSource().getPackageName()) &&
matchString(filter.getSourceClassPattern(), coupling.getSource().getSimpleClas... | assertThat(matchCoupling(new CouplingFilter.Builder().sourcePackage("[\\w\\.]+").build(), DEFAULT_COUPLING)).isTrue();
assertThat(matchCoupling(new CouplingFilter.Builder().sourcePackage("\\d+").build(), DEFAULT_COUPLING)).isFalse();
}
} | [FOCAL] static boolean CouplingFilterUtils.matchCoupling(CouplingFilter filter, MethodCoupling coupling)
[CLASS] class CouplingFilterUtils
[METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-INTERNAL] boolean matchString(Optional<Pattern> pattern, String string)
[CALLS-EXTERNAL] CouplingFilter.g... | /* static context
[FOCAL] static boolean CouplingFilterUtils.matchCoupling(CouplingFilter filter, MethodCoupling coupling)
[INPUTS] branches=- | result=coupling, filter
[COLLABORATORS] param filter:CouplingFilter getSourcePackagePattern/0,getSourceClassPattern/0,getSourceMethodPattern/0,getTargetPackagePattern/0,getTar... | /* static context
[FOCAL] static boolean CouplingFilterUtils.matchCoupling(CouplingFilter filter, MethodCoupling coupling)
[INPUTS] branches=- | result=coupling, filter
[COLLABORATORS] param filter:CouplingFilter getSourcePackagePattern/0,getSourceClassPattern/0,getSourceMethodPattern/0,getTargetPackagePattern/0,getTar... | true | ok | {"focal": {"class": "CouplingFilterUtils", "name": "matchCoupling", "signature": "boolean matchCoupling(CouplingFilter filter, MethodCoupling coupling)", "start_line": 3, "modifiers": "static", "params": [{"name": "filter", "type": "CouplingFilter"}, {"name": "coupling", "type": "MethodCoupling"}], "return_type": "bool... |
246041169_0 | class Elevator {
public boolean call(String button) {
int begin = getAFloor();
int end = getAFloor();
int buttonPressedFloor = getAFloor();
if (button.equalsIgnoreCase("Up")) // For Up
{
return (begin <= buttonPressedFloor && buttonPressedFloor < end) || (begi... |
Elevator lift = new Elevator();
int button = 3;
boolean expected = lift.call("Up");
Assertions.assertEquals(expected, true);
}
} | [FOCAL] public boolean Elevator.call(String button)
[CLASS] class Elevator
[METRICS] loc=16 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1
[CALLS-INTERNAL] int getAFloor()
[CALLS-EXTERNAL] String.equalsIgnoreCase/1
[PATH1] if(button.equalsIgnoreCase("Up"))=T -> return (begin <= buttonPressedFloor && buttonPressed... | /* static context
[FOCAL] public boolean Elevator.call(String button)
[PATH1] if(button.equalsIgnoreCase("Up"))=T -> return (begin <= buttonPressedFloor && buttonPressedFloor < end) || (begin...
[PATH2] if(button.equalsIgnoreCase("Up"))=F -> return (begin >= buttonPressedFloor && buttonPressedFloor > end) || (begin...
... | /* static context
[FOCAL] public boolean Elevator.call(String button)
[PATH1] if(button.equalsIgnoreCase("Up"))=T -> return (begin <= buttonPressedFloor && buttonPressedFloor < end) || (begin...
[PATH2] if(button.equalsIgnoreCase("Up"))=F -> return (begin >= buttonPressedFloor && buttonPressedFloor > end) || (begin...
... | true | ok | {"focal": {"class": "Elevator", "name": "call", "signature": "boolean call(String button)", "start_line": 3, "modifiers": "public", "params": [{"name": "button", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "Elevator", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "f... |
246630390_1 | class SensorisParquetSplittedUDFExample implements SplittedUDF {
@Override
public byte[] merge(Map<String, Object> keys, Iterator<byte[]> files) {
return ParquetHelper.mergeFiles(files);
}
@Override public Map<Map<String, Object>, byte[]> getSplittedKeys(
Map<MetadataName, String> map, byte[] bytes)... | List<byte[]> list = Arrays.asList(b1, b2);
Iterator<byte[]> it = list.iterator();
List<byte[]> list2 = Arrays.asList(b3, b4);
Iterator<byte[]> it2 = list2.iterator();
byte[] a1 = example.aggregate(new HashMap<>(), it);
byte[] a2 = example.aggregate(new HashMap<>(), it2);
Iterator<byte[]> ... | [FOCAL] @Override public byte[] SensorisParquetSplittedUDFExample.merge(Map<String, Object> keys, Iterator<byte[]> files)
[CLASS] class SensorisParquetSplittedUDFExample implements SplittedUDF
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] ParquetHelper.mergeFiles/1
[INPUTS] branc... | /* static context
[FOCAL] @Override public byte[] SensorisParquetSplittedUDFExample.merge(Map<String, Object> keys, Iterator<byte[]> files)
[INPUTS] branches=- | result=files | unused=keys
[CALLS-EXTERNAL] ParquetHelper.mergeFiles/1
*/
| /* static context
[FOCAL] @Override public byte[] SensorisParquetSplittedUDFExample.merge(Map<String, Object> keys, Iterator<byte[]> files)
[INPUTS] branches=- | result=files | unused=keys
[CALLS-EXTERNAL] ParquetHelper.mergeFiles/1
*/
class SensorisParquetSplittedUDFExample implements SplittedUDF {
@Override
publ... | true | ok | {"focal": {"class": "SensorisParquetSplittedUDFExample", "name": "merge", "signature": "byte[] merge(Map<String, Object> keys, Iterator<byte[]> files)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "keys", "type": "Map<String, Object>"}, {"name": "files", "type": "Iterator<byte[]>"}], "return_t... |
246677383_5 | class TransformationConfig {
public void buildExpressionNotation(String expressionBegin, String expressionEnd) {
this.expressionNotationBegin = expressionBegin;
this.expressionNotationEnd = expressionEnd;
String regexExpression = Pattern.quote(expressionNotationBegin) + EXPRESSION_PART + Pa... | TransformationConfig config = new TransformationConfig();
String expressionBegin = "[[";
String expressionEnd = "]]";
config.buildExpressionNotation(expressionBegin, expressionEnd);
assertEquals("Expression notation begin part is wrong after buildExpressionNotation()", expression... | [FOCAL] public void TransformationConfig.buildExpressionNotation(String expressionBegin, String expressionEnd)
[CLASS] class TransformationConfig
[METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0
[CALLS-EXTERNAL] Pattern.quote/1, Pattern.compile/1
[FIELDS] write=expressionNotationBegin, expressionNot... | /* static context
[FOCAL] public void TransformationConfig.buildExpressionNotation(String expressionBegin, String expressionEnd)
[STATE] expressionNotationBegin via getExpressionNotationBegin(), expressionNotationEnd via getExpressionNotationEnd()
[FIELDS] write=expressionNotationBegin, expressionNotationEnd
[CALLS-EXT... | /* static context
[FOCAL] public void TransformationConfig.buildExpressionNotation(String expressionBegin, String expressionEnd)
[STATE] expressionNotationBegin via getExpressionNotationBegin(), expressionNotationEnd via getExpressionNotationEnd()
[FIELDS] write=expressionNotationBegin, expressionNotationEnd
[CALLS-EXT... | true | ok | {"focal": {"class": "TransformationConfig", "name": "buildExpressionNotation", "signature": "void buildExpressionNotation(String expressionBegin, String expressionEnd)", "start_line": 3, "modifiers": "public", "params": [{"name": "expressionBegin", "type": "String"}, {"name": "expressionEnd", "type": "String"}], "retur... |
247595825_0 | class RedisEndpointAutoConfiguration {
@Bean
@ConditionalOnMissingBean
@ConditionalOnAvailableEndpoint
public RedisDescribeAvailableResourceEndpoint redisDescribeAvailableResourceEndpoint() {
return new RedisDescribeAvailableResourceEndpoint(aliCloudProperties,
redisProperties);
}
public RedisEndpointAut... | Object response = redisDescribeAvailableResourceEndpoint.describeAvailableResource("cn-hangzhou");
assertNotNull(response);
}
} | [FOCAL] @Bean @ConditionalOnMissingBean @ConditionalOnAvailableEndpoint public RedisDescribeAvailableResourceEndpoint RedisEndpointAutoConfiguration.redisDescribeAvailableResourceEndpoint()
[CLASS] class RedisEndpointAutoConfiguration
[METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[NEW] RedisDescr... | /* static context
[FOCAL] @Bean @ConditionalOnMissingBean @ConditionalOnAvailableEndpoint public RedisDescribeAvailableResourceEndpoint RedisEndpointAutoConfiguration.redisDescribeAvailableResourceEndpoint()
[NEW] RedisDescribeAvailableResourceEndpoint
*/
| /* static context
[FOCAL] @Bean @ConditionalOnMissingBean @ConditionalOnAvailableEndpoint public RedisDescribeAvailableResourceEndpoint RedisEndpointAutoConfiguration.redisDescribeAvailableResourceEndpoint()
[NEW] RedisDescribeAvailableResourceEndpoint
*/
class RedisEndpointAutoConfiguration {
@Bean
@ConditionalOnMi... | true | ok | {"focal": {"class": "RedisEndpointAutoConfiguration", "name": "redisDescribeAvailableResourceEndpoint", "signature": "RedisDescribeAvailableResourceEndpoint redisDescribeAvailableResourceEndpoint()", "start_line": 3, "modifiers": "@Bean @ConditionalOnMissingBean @ConditionalOnAvailableEndpoint public", "params": [], "r... |
248283523_3 | class RegionApi {
@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public RegionsDto getAllRegions() {
LOGGER.info("REGION GET ALL API");
var allRegions = service.getAllRegions();
var dtoList = new ArrayList<RegionDto>();
allRegions.forEach(region -> {
var d... |
var region1 = new RegionEntity();
region1.setRegionId(1);
region1.setRegionName("地域1");
region1.setCreationTimestamp(LocalDateTime.now());
var region2 = new RegionEntity();
region2.setRegionId(2);
region2.setRegionName("地域2");
region2.setCreationTimestam... | [FOCAL] @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) public RegionsDto RegionApi.getAllRegions()
[CLASS] class RegionApi
[METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] LOGGER.info/1, service.getAllRegions/0, var.forEach/1, var.add/1
[NEW] ArrayList<RegionDto>, RegionD... | /* static context
[FOCAL] @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) public RegionsDto RegionApi.getAllRegions()
[COLLABORATORS] field service getAllRegions/0
[NEW] ArrayList<RegionDto>, RegionDto, RegionsDto
[CALLS-EXTERNAL] LOGGER.info/1, service.getAllRegions/0, var.forEach/1, var.add/1
*/
| /* static context
[FOCAL] @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) public RegionsDto RegionApi.getAllRegions()
[COLLABORATORS] field service getAllRegions/0
[NEW] ArrayList<RegionDto>, RegionDto, RegionsDto
[CALLS-EXTERNAL] LOGGER.info/1, service.getAllRegions/0, var.forEach/1, var.add/1
*/
class Region... | true | ok | {"focal": {"class": "RegionApi", "name": "getAllRegions", "signature": "RegionsDto getAllRegions()", "start_line": 3, "modifiers": "@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) public", "params": [], "return_type": "RegionsDto"}, "class_info": {"name": "RegionApi", "kind": "class", "modifiers": "", "supercl... |
248529016_1 | class RetryHandlerUtils {
public static boolean isRetryHandlerMethod(Class<?> targetClass, Method method) {
if ("handle".equals(method.getName()) && method.getParameterCount() == 1 && method.isBridge() && method.isSynthetic()) {
//RetryHandler接口有泛型,需要特殊处理
return true;
}
... | Assertions.assertThat(RetryHandlerUtils.isRetryHandlerMethod(ObjectRetryHandler.class, getMethodByName(ObjectRetryHandler.class, "handle"))).isTrue();
Assertions.assertThat(RetryHandlerUtils.isRetryHandlerMethod(GenericRetryHandler.class, getMethodByName(GenericRetryHandler.class, "handle"))).isTrue();
... | [FOCAL] public static boolean RetryHandlerUtils.isRetryHandlerMethod(Class<?> targetClass, Method method)
[CLASS] class RetryHandlerUtils
[METRICS] loc=16 cc=4 branches=3 loops=0 returns=3 throws=0 nesting=1
[CALLS-INTERNAL] Type getRetryHandlerGenericInterface(Class<?> clazz)
[CALLS-EXTERNAL] "handle".equals/1, Method... | /* static context
[FOCAL] public static boolean RetryHandlerUtils.isRetryHandlerMethod(Class<?> targetClass, Method method)
[PATH1] if("handle".equals(method.getName()) && method.getParameterCount() == 1 && method.isBridge() && method.isSynthetic())=F -> if(interfaceType == null)=F -> if(interfaceType instanceof Parame... | /* static context
[FOCAL] public static boolean RetryHandlerUtils.isRetryHandlerMethod(Class<?> targetClass, Method method)
[PATH1] if("handle".equals(method.getName()) && method.getParameterCount() == 1 && method.isBridge() && method.isSynthetic())=F -> if(interfaceType == null)=F -> if(interfaceType instanceof Parame... | true | ok | {"focal": {"class": "RetryHandlerUtils", "name": "isRetryHandlerMethod", "signature": "boolean isRetryHandlerMethod(Class<?> targetClass, Method method)", "start_line": 3, "modifiers": "public static", "params": [{"name": "targetClass", "type": "Class<?>"}, {"name": "method", "type": "Method"}], "return_type": "boolean... |
248826224_5 | class Book {
public ISBN getIsbn() {
return isbn;
}
public Book(String isbn, String author, String name);
}
class BookTest {
@Test
void testConvert13to10() {
| Book b;
b = new Book("9780306406157", "", "");
assertEquals("0306406152", b.getIsbn().isbn10().toString());
b = new Book("9780596007126", "", "");
assertEquals("0596007124", b.getIsbn().isbn10().toString());
b = new Book("9781491950357", "", "");
assertEquals("1491950358", b.getIsbn().isbn10().toSt... | [FOCAL] public ISBN Book.getIsbn()
[CLASS] class Book
[METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CLASS-MEMBERS] Book(String isbn, String author, String name)
[TEST] BookTest: @Test void testConvert13to10() | /* static context
[FOCAL] public ISBN Book.getIsbn()
*/
| /* static context
[FOCAL] public ISBN Book.getIsbn()
*/
class Book {
public ISBN getIsbn() {
return isbn;
}
public Book(String isbn, String author, String name);
}
class BookTest {
@Test
void testConvert13to10() {
| true | ok | {"focal": {"class": "Book", "name": "getIsbn", "signature": "ISBN getIsbn()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "ISBN"}, "class_info": {"name": "Book", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Book", "kind": "constru... |
248828585_8 | class TokenProvider {
public boolean validateToken(String authToken) {
try {
Jwts.parser().setSigningKey(key).parseClaimsJws(authToken);
return true;
} catch (JwtException | IllegalArgumentException e) {
log.info("Invalid JWT token.");
log.trace("Inva... | boolean isTokenValid = tokenProvider.validateToken(createTokenWithDifferentSignature());
assertThat(isTokenValid).isEqualTo(false);
}
} | [FOCAL] public boolean TokenProvider.validateToken(String authToken)
[CLASS] class TokenProvider
[METRICS] loc=10 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1
[CALLS-EXTERNAL] Jwts.parser().setSigningKey(key).parseClaimsJws/1, Jwts.parser().setSigningKey/1, Jwts.parser/0, log.info/1, log.trace/2
[FIELDS] read=k... | /* static context
[FOCAL] public boolean TokenProvider.validateToken(String authToken)
[PATH1] try-body throws -> return false
[PATH2] return true
[EXCEPTIONS] catches JwtException | IllegalArgumentException e
[FIELDS] read=key:Key
[CALLS-EXTERNAL] Jwts.parser().setSigningKey(key).parseClaimsJws/1, Jwts.parser().setSig... | /* static context
[FOCAL] public boolean TokenProvider.validateToken(String authToken)
[PATH1] try-body throws -> return false
[PATH2] return true
[EXCEPTIONS] catches JwtException | IllegalArgumentException e
[FIELDS] read=key:Key
[CALLS-EXTERNAL] Jwts.parser().setSigningKey(key).parseClaimsJws/1, Jwts.parser().setSig... | true | ok | {"focal": {"class": "TokenProvider", "name": "validateToken", "signature": "boolean validateToken(String authToken)", "start_line": 3, "modifiers": "public", "params": [{"name": "authToken", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "TokenProvider", "kind": "class", "modifiers": "", "supercl... |
250091476_0 | class TokenFetcherService {
static String getPrincipalFromKeytab(String keytabLocation) {
try {
return Keytab
.read(new File(keytabLocation))
.getEntries().get(0)
.getPrincipalName()
.split("@")[0]
.replace('\\', '/');
} catch (Exception ex) {
thr... | String keytabLocation = "dummy.keytab";
String expectedPrincipalName = "somedomain/somehost";
String fullPrincipalName = expectedPrincipalName + "@somecompany.com";
Keytab kt = new Keytab();
KeytabEntry kte = new KeytabEntry(fullPrincipalName, 0,
new KerberosTime(), (byte) (0), new Encrypti... | [FOCAL] static String TokenFetcherService.getPrincipalFromKeytab(String keytabLocation)
[CLASS] class TokenFetcherService
[METRICS] loc=12 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1
[CALLS-EXTERNAL] Keytab .read(new File(keytabLocation)) .getEntries().get(....replace/2, Keytab .read(new File(keytabLocation)) ... | /* static context
[FOCAL] static String TokenFetcherService.getPrincipalFromKeytab(String keytabLocation)
[THROWS-WHEN] TokenServiceException when try-body throws
[PATH1] try-body throws -> throw new TokenServiceException(ex.getMessage(), ErrorCode.READ_KEYTAB_EX...
[PATH2] return Keytab .read(new File(keytabLocation))... | /* static context
[FOCAL] static String TokenFetcherService.getPrincipalFromKeytab(String keytabLocation)
[THROWS-WHEN] TokenServiceException when try-body throws
[PATH1] try-body throws -> throw new TokenServiceException(ex.getMessage(), ErrorCode.READ_KEYTAB_EX...
[PATH2] return Keytab .read(new File(keytabLocation))... | true | ok | {"focal": {"class": "TokenFetcherService", "name": "getPrincipalFromKeytab", "signature": "String getPrincipalFromKeytab(String keytabLocation)", "start_line": 3, "modifiers": "static", "params": [{"name": "keytabLocation", "type": "String"}], "return_type": "String"}, "class_info": {"name": "TokenFetcherService", "kin... |
251049092_17 | class OpenWeatherMapWeather implements Weather {
@Override
public List<WeatherCondition> getConditions() {
return Collections.unmodifiableList(new ArrayList<WeatherCondition>(this.conditions));
}
public OpenWeatherMapWeather(Context context);
public OpenWeatherMapWeather(Context context,... | OpenWeatherMapWeather weather = WeatherUtils.createOpenWeather(context);
List<WeatherCondition> conditions = weather.getConditions();
assertEquals(8, conditions.size());
assertEquals(289, conditions.get(0).getTemperature(TemperatureUnit.K).getHigh());
assertEquals(295, conditions... | [FOCAL] @Override public List<WeatherCondition> OpenWeatherMapWeather.getConditions()
[CLASS] class OpenWeatherMapWeather implements Weather
[METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0
[CALLS-EXTERNAL] Collections.unmodifiableList/1
[NEW] ArrayList<WeatherCondition>
[FIELDS] read=conditions
[CL... | /* static context
[FOCAL] @Override public List<WeatherCondition> OpenWeatherMapWeather.getConditions()
[FIELDS] read=conditions
[NEW] ArrayList<WeatherCondition>
[CALLS-EXTERNAL] Collections.unmodifiableList/1
*/
| /* static context
[FOCAL] @Override public List<WeatherCondition> OpenWeatherMapWeather.getConditions()
[FIELDS] read=conditions
[NEW] ArrayList<WeatherCondition>
[CALLS-EXTERNAL] Collections.unmodifiableList/1
*/
class OpenWeatherMapWeather implements Weather {
@Override
public List<WeatherCondition> getCondi... | true | ok | {"focal": {"class": "OpenWeatherMapWeather", "name": "getConditions", "signature": "List<WeatherCondition> getConditions()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "List<WeatherCondition>"}, "class_info": {"name": "OpenWeatherMapWeather", "kind": "class", "modifiers": "", "superc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.