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
144786483_5
class CreateEngagement { public static JsonObject main(JsonObject args) { JsonObject response = new JsonObject(); EngagementStore store = new EngagementStore(args, "engagements"); String[] tags = new String[] {"java", "cloud"}; Engagement jfokus = new Engagement( "JFokus 2019", "S...
JsonObject args = new JsonObject(); JsonObject response = CreateEngagement.main(args); assertNotNull( response.getAsJsonPrimitive("id").getAsString()); // assertNotNull(greetings); // assertEquals("Hello! Welcome to OpenWhisk", greetings); } }
[FOCAL] public static JsonObject CreateEngagement.main(JsonObject args) [CLASS] class CreateEngagement [METRICS] loc=15 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Engagement.setTags/1, EngagementStore.persist/1, System.out.println/1, Engagement.get_id/0, Engagement.get_rev/0, JsonObject.addPr...
/* static context [FOCAL] public static JsonObject CreateEngagement.main(JsonObject args) [NEW] JsonObject, EngagementStore, Engagement, Date [CALLS-EXTERNAL] Engagement.setTags/1, EngagementStore.persist/1, System.out.println/1, Engagement.get_id/0, Engagement.get_rev/0, JsonObject.addProperty/2 */
/* static context [FOCAL] public static JsonObject CreateEngagement.main(JsonObject args) [NEW] JsonObject, EngagementStore, Engagement, Date [CALLS-EXTERNAL] Engagement.setTags/1, EngagementStore.persist/1, System.out.println/1, Engagement.get_id/0, Engagement.get_rev/0, JsonObject.addProperty/2 */ class CreateEngagem...
true
ok
{"focal": {"class": "CreateEngagement", "name": "main", "signature": "JsonObject main(JsonObject args)", "start_line": 3, "modifiers": "public static", "params": [{"name": "args", "type": "JsonObject"}], "return_type": "JsonObject"}, "class_info": {"name": "CreateEngagement", "kind": "class", "modifiers": "", "supercla...
144974148_1
class SingletonPool { @SuppressWarnings("unchecked") public static <I, T extends I> T get(Class<I> clazz, IFactory factory) throws Exception { if (clazz == null) { return null; } if (factory == null) { factory = RouterComponents.getDefaultFactory(); } ...
TestSingleton o1 = SingletonPool.get(TestSingleton.class, null); Assert.assertNotNull(o1); TestSingleton o2 = SingletonPool.get(TestSingleton.class, null); Assert.assertSame(o1, o2); } }
[FOCAL] @SuppressWarnings("unchecked") public static T SingletonPool.get(Class<I> clazz, IFactory factory) [CLASS] class SingletonPool [METRICS] loc=12 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] Object getInstance(Class clazz, IFactory factory) [CALLS-EXTERNAL] RouterComponents.getDefaultFact...
/* static context [FOCAL] @SuppressWarnings("unchecked") public static T SingletonPool.get(Class<I> clazz, IFactory factory) [PATH1] if(clazz == null)=F -> if(factory == null)=T -> return (T) instance [PATH2] if(clazz == null)=T -> return null [PATH3] if(clazz == null)=F -> if(factory == null)=F -> return (T) instance ...
/* static context [FOCAL] @SuppressWarnings("unchecked") public static T SingletonPool.get(Class<I> clazz, IFactory factory) [PATH1] if(clazz == null)=F -> if(factory == null)=T -> return (T) instance [PATH2] if(clazz == null)=T -> return null [PATH3] if(clazz == null)=F -> if(factory == null)=F -> return (T) instance ...
true
ok
{"focal": {"class": "SingletonPool", "name": "get", "signature": "T get(Class<I> clazz, IFactory factory) throws Exception", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public static", "params": [{"name": "clazz", "type": "Class<I>"}, {"name": "factory", "type": "IFactory"}], "return_type": "T"}, "c...
145032308_0
class DnsUntil { public static InetSocketAddress toIpAddress(String hostName, int port) { InetSocketAddress socketAddress; try { InetAddress address = InetAddress.getByName(hostName); String ipAddress = address.getHostAddress(); socketAddress = InetSocketAddress.createUnresolved(ipAddress, ...
InetSocketAddress inetSocketAddress = DnsUntil.toIpAddress("localhost", 8001); InetSocketAddress unresolved = InetSocketAddress.createUnresolved("127.0.0.1", 8001); Assert.assertTrue(unresolved.equals(inetSocketAddress)); } }
[FOCAL] public static InetSocketAddress DnsUntil.toIpAddress(String hostName, int port) [CLASS] class DnsUntil [METRICS] loc=12 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] InetAddress.getByName/1, InetAddress.getHostAddress/0, InetSocketAddress.createUnresolved/2 [NEW] RuntimeException [EXCEPT...
/* static context [FOCAL] public static InetSocketAddress DnsUntil.toIpAddress(String hostName, int port) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException(e) [PATH2] return socketAddress [INPUTS] branches=- | result=hostName, port [EXCEPTIONS] throws RuntimeExcep...
/* static context [FOCAL] public static InetSocketAddress DnsUntil.toIpAddress(String hostName, int port) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException(e) [PATH2] return socketAddress [INPUTS] branches=- | result=hostName, port [EXCEPTIONS] throws RuntimeExcep...
true
ok
{"focal": {"class": "DnsUntil", "name": "toIpAddress", "signature": "InetSocketAddress toIpAddress(String hostName, int port)", "start_line": 3, "modifiers": "public static", "params": [{"name": "hostName", "type": "String"}, {"name": "port", "type": "int"}], "return_type": "InetSocketAddress"}, "class_info": {"name": ...
145080847_2
class FileDescriptor implements Cloneable { public boolean matches(FileDescriptor other) { if (!StringUtils.equals(directory, other.directory)) { return false; } if (!StringUtils.equals(relativePath, other.relativePath)) { return false; } if (filename...
FileDescriptor descriptor1 = new FileDescriptor(); FileDescriptor descriptor2 = new FileDescriptor(); assertFalse(descriptor1.matches(descriptor2)); descriptor1.setDirectory("/Users/kai"); descriptor2.setDirectory("/Users/kai"); assertFalse(descriptor1.matches(descriptor2...
[FOCAL] public boolean FileDescriptor.matches(FileDescriptor other) [CLASS] class FileDescriptor implements Cloneable [METRICS] loc=14 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=1 [CALLS-EXTERNAL] StringUtils.equals/2, FilenameUtils.removeExtension(filename).trim().toLowerCase/0, FilenameUtils.removeExtension(f...
/* static context [FOCAL] public boolean FileDescriptor.matches(FileDescriptor other) [PATH1] if(!StringUtils.equals(directory, other.directory))=F -> if(!StringUtils.equals(relativePath, other.relativePath))=F -> if(filename == null || other.filename == null)=T -> return false [PATH2] if(!StringUtils.equals(directory,...
/* static context [FOCAL] public boolean FileDescriptor.matches(FileDescriptor other) [PATH1] if(!StringUtils.equals(directory, other.directory))=F -> if(!StringUtils.equals(relativePath, other.relativePath))=F -> if(filename == null || other.filename == null)=T -> return false [PATH2] if(!StringUtils.equals(directory,...
true
ok
{"focal": {"class": "FileDescriptor", "name": "matches", "signature": "boolean matches(FileDescriptor other)", "start_line": 3, "modifiers": "public", "params": [{"name": "other", "type": "FileDescriptor"}], "return_type": "boolean"}, "class_info": {"name": "FileDescriptor", "kind": "class", "modifiers": "", "superclas...
145101610_0
class OpeningBalanceEvent extends VanillaSignedMessage<OpeningBalanceEvent> implements Validable { public Map<Currency, Double> balances() { return balances; } public long balanceAddress(); public OpeningBalanceEvent balanceAddress(long balanceAccount); @Override public void validate(); }...
KeyPair kp7 = new KeyPair(7); BytesStore publicKey1 = kp7.publicKey; BytesStore secretKey1 = kp7.secretKey; OpeningBalanceEvent obe = new OpeningBalanceEvent() .protocol(1).messageType(1) .balanceAddress(DecentredUtil.toAddress(publicKey1)); obe.b...
[FOCAL] public Map<Currency, Double> OpeningBalanceEvent.balances() [CLASS] class OpeningBalanceEvent extends VanillaSignedMessage<OpeningBalanceEvent> implements Validable [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] long balanceAddress(); OpeningBalanceEvent balanceAddress(long...
/* static context [FOCAL] public Map<Currency, Double> OpeningBalanceEvent.balances() */
/* static context [FOCAL] public Map<Currency, Double> OpeningBalanceEvent.balances() */ class OpeningBalanceEvent extends VanillaSignedMessage<OpeningBalanceEvent> implements Validable { public Map<Currency, Double> balances() { return balances; } public long balanceAddress(); public OpeningB...
true
ok
{"focal": {"class": "OpeningBalanceEvent", "name": "balances", "signature": "Map<Currency, Double> balances()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Map<Currency, Double>"}, "class_info": {"name": "OpeningBalanceEvent", "kind": "class", "modifiers": "", "superclass": "VanillaSignedMessa...
145104488_35
class ApplicationTokenService { public TokenDetails getApplicationTokenDetails() { UserKey user = getRunOnBehalfOfUser(); return getApplicationTokenDetailsForUser(user); } @Autowired public ApplicationTokenService(OAuthClient oAuthClient, OidcAuthenticat...
onBehalfOfUsernameHolder.removeUser(); UserKey userKey1 = new UserKey("user1", "realm1"); onBehalfOfUsernameHolder.putUser(userKey1); TokenDetails tokenDetails = new TokenDetails(); tokenDetails.setAccessToken("access-token123"); tokenDetails.setRefreshToken("refresh-tok...
[FOCAL] public TokenDetails ApplicationTokenService.getApplicationTokenDetails() [CLASS] class ApplicationTokenService [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] TokenDetails getApplicationTokenDetailsForUser(UserKey user); UserKey getRunOnBehalfOfUser() [DATAFLOW] user@L2->L3...
/* static context [FOCAL] public TokenDetails ApplicationTokenService.getApplicationTokenDetails() [CALLS-INTERNAL] TokenDetails getApplicationTokenDetailsForUser(UserKey user); UserKey getRunOnBehalfOfUser() */
/* static context [FOCAL] public TokenDetails ApplicationTokenService.getApplicationTokenDetails() [CALLS-INTERNAL] TokenDetails getApplicationTokenDetailsForUser(UserKey user); UserKey getRunOnBehalfOfUser() */ class ApplicationTokenService { public TokenDetails getApplicationTokenDetails() { UserKey user...
true
ok
{"focal": {"class": "ApplicationTokenService", "name": "getApplicationTokenDetails", "signature": "TokenDetails getApplicationTokenDetails()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "TokenDetails"}, "class_info": {"name": "ApplicationTokenService", "kind": "class", "modifiers": "", "superc...
145126556_57
class PrivilegesGrantorLambda implements RequestHandler<SQSEvent, Response> { @Override public Response handleRequest(SQSEvent event, Context context) { logger = context.getLogger(); List<String> failedEvents = new ArrayList<>(); List<String> successfulTableNames = new ArrayList<>(); IMetaStoreClie...
SQSEvent event = new SQSEvent(); SQSEvent.SQSMessage record = new SQSEvent.SQSMessage(); record.setBody(createTableJson()); event.setRecords(Lists.newArrayList(record)); when(thriftHiveClientFactory.newInstance("thrift://uri:9083", "20000")) .thenThrow(new HiveClientException("init error"));...
[FOCAL] @Override public Response PrivilegesGrantorLambda.handleRequest(SQSEvent event, Context context) [CLASS] class PrivilegesGrantorLambda implements RequestHandler<SQSEvent, Response> [METRICS] loc=28 cc=4 branches=1 loops=1 returns=2 throws=0 nesting=2 [CALLS-INTERNAL] MessageDeserializer defaultMessageDeserializ...
/* static context [FOCAL] @Override public Response PrivilegesGrantorLambda.handleRequest(SQSEvent event, Context context) [PATH1] foreach(SQSEvent.SQSMessage record : event.getRecords())=T -> exit loop -> if(metaStoreClient != null)=T -> return createResponse(successfulTableNames, failedEvents) [PATH2] try-body throws...
/* static context [FOCAL] @Override public Response PrivilegesGrantorLambda.handleRequest(SQSEvent event, Context context) [PATH1] foreach(SQSEvent.SQSMessage record : event.getRecords())=T -> exit loop -> if(metaStoreClient != null)=T -> return createResponse(successfulTableNames, failedEvents) [PATH2] try-body throws...
true
ok
{"focal": {"class": "PrivilegesGrantorLambda", "name": "handleRequest", "signature": "Response handleRequest(SQSEvent event, Context context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "event", "type": "SQSEvent"}, {"name": "context", "type": "Context"}], "return_type": "Response"}, "class_...
145233455_12
class PartitionTableFactory { public static PartitionTable createPartitionTable(BlockDeviceDriver blockDevice) throws IOException { for(PartitionTableCreator creator : partitionTables) { PartitionTable table = creator.read(blockDevice); if(table != null) { return tab...
BlockDeviceDriver blockDevice = new FileBlockDeviceDriver( new URL("https://www.dropbox.com/s/w3x12zw6d6lc6x5/mbr_1_partition_hfs%2B.bin?dl=1")); blockDevice.init(); PartitionTable table = PartitionTableFactory.createPartitionTable(blockDevice); assertTrue(table instanc...
[FOCAL] public static PartitionTable PartitionTableFactory.createPartitionTable(BlockDeviceDriver blockDevice) [CLASS] class PartitionTableFactory [METRICS] loc=11 cc=3 branches=1 loops=1 returns=1 throws=1 nesting=2 [CALLS-EXTERNAL] PartitionTableCreator.read/1 [NEW] UnsupportedPartitionTableException [EXCEPTIONS] dec...
/* static context [FOCAL] public static PartitionTable PartitionTableFactory.createPartitionTable(BlockDeviceDriver blockDevice) [THROWS-WHEN] UnsupportedPartitionTableException when foreach(PartitionTableCreator creator : partitionTables)=T && !(table != null) [THROWS-WHEN] UnsupportedPartitionTableException when fore...
/* static context [FOCAL] public static PartitionTable PartitionTableFactory.createPartitionTable(BlockDeviceDriver blockDevice) [THROWS-WHEN] UnsupportedPartitionTableException when foreach(PartitionTableCreator creator : partitionTables)=T && !(table != null) [THROWS-WHEN] UnsupportedPartitionTableException when fore...
true
ok
{"focal": {"class": "PartitionTableFactory", "name": "createPartitionTable", "signature": "PartitionTable createPartitionTable(BlockDeviceDriver blockDevice) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "blockDevice", "type": "BlockDeviceDriver"}], "return_type": "PartitionTab...
145392451_3
class ZookeeperCompensationServiceImpl implements CompensationService { @Override public CommonPager<TccCompensationVO> listByPage(final CompensationQuery query) { CommonPager<TccCompensationVO> voCommonPager = new CommonPager<>(); final int currentPage = query.getPageParameter().getCurrentPage(); final int pa...
CompensationQuery query = new CompensationQuery(); query.setApplicationName("alipay-service"); PageParameter pageParameter = new PageParameter(1, 8); query.setPageParameter(pageParameter); final CommonPager<TccCompensationVO> pager = compensationService.listByPage(query); Assert.assertNotNull(pager.get...
[FOCAL] @Override public CommonPager<TccCompensationVO> ZookeeperCompensationServiceImpl.listByPage(CompensationQuery query) [CLASS] class ZookeeperCompensationServiceImpl implements CompensationService [METRICS] loc=40 cc=5 branches=3 loops=0 returns=1 throws=0 nesting=4 [CALLS-INTERNAL] List<TccCompensationVO> findAl...
/* static context [FOCAL] @Override public CommonPager<TccCompensationVO> ZookeeperCompensationServiceImpl.listByPage(CompensationQuery query) [PATH1] if(StringUtils.isBlank(query.getTransId()) && Objects.nonNull(query.getRetry()))=F -> if(StringUtils.isNoneBlank(query.getTransId()) && Objects.isNull(query.getRetry()))...
/* static context [FOCAL] @Override public CommonPager<TccCompensationVO> ZookeeperCompensationServiceImpl.listByPage(CompensationQuery query) [PATH1] if(StringUtils.isBlank(query.getTransId()) && Objects.nonNull(query.getRetry()))=F -> if(StringUtils.isNoneBlank(query.getTransId()) && Objects.isNull(query.getRetry()))...
true
ok
{"focal": {"class": "ZookeeperCompensationServiceImpl", "name": "listByPage", "signature": "CommonPager<TccCompensationVO> listByPage(CompensationQuery query)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "query", "type": "CompensationQuery"}], "return_type": "CommonPager<TccCompensationVO>"},...
145393952_0
class ListasDePuntos { public static ParDePuntos parMasCercano(List<Punto2D> lista){ ParDePuntos p = null; List<Punto2D> puntosX; List<Punto2D> puntosY; Comparator<Punto2D> ordX = new Comparator<Punto2D>(){ @Override public int compare(Punto2D p1, Punto2D p2) { return p1.getX().compareTo(p2.getX());...
List<Punto2D> lista = ListasDePuntos.getListaPuntosAleatoria(10000); ParDePuntos p1 = ListasDePuntos.parMasCercano(lista); ParDePuntos p2 = ListasDePuntos.parMasCercanoBase(0, lista.size(), lista); if(!p1.getDistancia().equals(p2.getDistancia())){ System.out.println(p1+","+p2); } assertTrue(p1.getDistanc...
[FOCAL] public static ParDePuntos ListasDePuntos.parMasCercano(List<Punto2D> lista) [CLASS] class ListasDePuntos [METRICS] loc=24 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] ParDePuntos masCercano(int i, int j, List<Punto2D> puntosX, List<Punto2D> puntosY, int umbral, Comparator<ParDePuntos> o...
/* static context [FOCAL] public static ParDePuntos ListasDePuntos.parMasCercano(List<Punto2D> lista) [INPUTS] branches=- | result=lista [COLLABORATORS] field p1 getX/0,getY/0; field p2 getX/0,getY/0; param lista:List<Punto2D> size/0 [CALLS-INTERNAL] ParDePuntos masCercano(int i, int j, List<Punto2D> puntosX, List<Punt...
/* static context [FOCAL] public static ParDePuntos ListasDePuntos.parMasCercano(List<Punto2D> lista) [INPUTS] branches=- | result=lista [COLLABORATORS] field p1 getX/0,getY/0; field p2 getX/0,getY/0; param lista:List<Punto2D> size/0 [CALLS-INTERNAL] ParDePuntos masCercano(int i, int j, List<Punto2D> puntosX, List<Punt...
true
ok
{"focal": {"class": "ListasDePuntos", "name": "parMasCercano", "signature": "ParDePuntos parMasCercano(List<Punto2D> lista)", "start_line": 3, "modifiers": "public static", "params": [{"name": "lista", "type": "List<Punto2D>"}], "return_type": "ParDePuntos"}, "class_info": {"name": "ListasDePuntos", "kind": "class", "m...
145452341_0
class UsageDataUtil { public static void processFile(FileItem file, UserInteractionEventCallback callback) throws IOException { log.debug(String.format("Parsing %s", file.getName())); if (file.getContentType().startsWith("application/zip")) { ZipInputStream zip = new ZipInputStream(file.getInputStream()); ...
final int[] countFiles = { 0 }; UsageDataUtil.processFile(zipItem, new UserInteractionEventCallback() { public boolean visit(UserInteractionEvent uie) { ++countFiles[0]; return true; } }); Assert.assertEquals(18015, countFiles[0]); } }
[FOCAL] public static void UsageDataUtil.processFile(FileItem file, UserInteractionEventCallback callback) [CLASS] class UsageDataUtil [METRICS] loc=26 cc=6 branches=4 loops=1 returns=0 throws=0 nesting=3 [CALLS-INTERNAL] void processStream(InputStream is, UserInteractionEventCallback callback, String uid) [CALLS-EXTER...
/* static context [FOCAL] public static void UsageDataUtil.processFile(FileItem file, UserInteractionEventCallback callback) [PATH1] if(file.getContentType().startsWith("application/zip"))=T -> if(firstDot == -1 || firstDot == 0)=T -> while((ze = zip.getNextEntry()) != null)=T -> if(ze.isDirectory())=F -> if(!ze.getNam...
/* static context [FOCAL] public static void UsageDataUtil.processFile(FileItem file, UserInteractionEventCallback callback) [PATH1] if(file.getContentType().startsWith("application/zip"))=T -> if(firstDot == -1 || firstDot == 0)=T -> while((ze = zip.getNextEntry()) != null)=T -> if(ze.isDirectory())=F -> if(!ze.getNam...
true
ok
{"focal": {"class": "UsageDataUtil", "name": "processFile", "signature": "void processFile(FileItem file, UserInteractionEventCallback callback) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "file", "type": "FileItem"}, {"name": "callback", "type": "UserInteractionEventCallback...
145659250_3
class CompositeException extends RuntimeException { @Override public String getMessage() { return message; } public CompositeException(Throwable... exceptions); public CompositeException(Iterable<? extends Throwable> errors); public List<Throwable> getExceptions(); @Override pub...
CompositeException compositeException = new CompositeException(ex1, ex2, ex3); assertEquals("3 exceptions occurred. ", compositeException.getMessage()); } }
[FOCAL] @Override public String CompositeException.getMessage() [CLASS] class CompositeException extends RuntimeException [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] CompositeException(Throwable... exceptions); CompositeException(Iterable<? extends Throwable> errors); List<Throw...
/* static context [FOCAL] @Override public String CompositeException.getMessage() */
/* static context [FOCAL] @Override public String CompositeException.getMessage() */ class CompositeException extends RuntimeException { @Override public String getMessage() { return message; } public CompositeException(Throwable... exceptions); public CompositeException(Iterable<? exten...
true
ok
{"focal": {"class": "CompositeException", "name": "getMessage", "signature": "String getMessage()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "CompositeException", "kind": "class", "modifiers": "", "superclass": "RuntimeException", "interfaces": nul...
145711148_0
class ByteBuddyProcessFunctionInvoker { public static <InT, OutT> ProcessFunctionInvoker<InT, OutT> create(StreamingLedgerSpec<InT, OutT> spec) { final ClassLoader userClassLoader = classLoader(spec); final Class<?> generatedClass = CACHE.findOrInsert(userClassLoader, spec, () -> generateAndLoadCla...
ProcessFunctionInvoker<String, Long> generatedCodeThatInvokesUserCode = ByteBuddyProcessFunctionInvoker.create(specification); arguments[0].value = Long.MAX_VALUE; generatedCodeThatInvokesUserCode.invoke("does not matter", context, arguments); assertThat(context.emitted...
[FOCAL] public static ProcessFunctionInvoker<InT, OutT> ByteBuddyProcessFunctionInvoker.create(StreamingLedgerSpec<InT, OutT> spec) [CLASS] class ByteBuddyProcessFunctionInvoker [METRICS] loc=11 cc=2 branches=0 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] Class<? extends ProcessFunctionInvoker<InT, OutT>> gene...
/* static context [FOCAL] public static ProcessFunctionInvoker<InT, OutT> ByteBuddyProcessFunctionInvoker.create(StreamingLedgerSpec<InT, OutT> spec) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException("Unable to create a new instance for " + spec.... [PATH2] return...
/* static context [FOCAL] public static ProcessFunctionInvoker<InT, OutT> ByteBuddyProcessFunctionInvoker.create(StreamingLedgerSpec<InT, OutT> spec) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] try-body throws -> throw new RuntimeException("Unable to create a new instance for " + spec.... [PATH2] return...
true
ok
{"focal": {"class": "ByteBuddyProcessFunctionInvoker", "name": "create", "signature": "ProcessFunctionInvoker<InT, OutT> create(StreamingLedgerSpec<InT, OutT> spec)", "start_line": 3, "modifiers": "public static", "params": [{"name": "spec", "type": "StreamingLedgerSpec<InT, OutT>"}], "return_type": "ProcessFunctionInv...
145861384_0
class OpenApi30SpecificationGenerator implements SpecificationGenerator { @Override public Specification getSpecification() { return Specification.OPENAPI_V3; } public OpenApi30SpecificationGenerator(); public OpenApi30SpecificationGenerator(OpenApi3Generator generator); @Override public String gen...
assertThat(generator.getSpecification()).isEqualTo(Specification.OPENAPI_V3); } }
[FOCAL] @Override public Specification OpenApi30SpecificationGenerator.getSpecification() [CLASS] class OpenApi30SpecificationGenerator implements SpecificationGenerator [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] OpenApi30SpecificationGenerator(); OpenApi30SpecificationGenerato...
/* static context [FOCAL] @Override public Specification OpenApi30SpecificationGenerator.getSpecification() */
/* static context [FOCAL] @Override public Specification OpenApi30SpecificationGenerator.getSpecification() */ class OpenApi30SpecificationGenerator implements SpecificationGenerator { @Override public Specification getSpecification() { return Specification.OPENAPI_V3; } public OpenApi30SpecificationGene...
true
ok
{"focal": {"class": "OpenApi30SpecificationGenerator", "name": "getSpecification", "signature": "Specification getSpecification()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Specification"}, "class_info": {"name": "OpenApi30SpecificationGenerator", "kind": "class", "modifiers": "",...
145862721_0
class ExampleAgent { static List<TransformDescriptor> readProbes(String probesFile) throws IOException { if (probesFile == null || probesFile.trim().length() == 0) { probesFile = DEFAULT_CONFIG; } File file = new File(probesFile); List<String> lines = null; if (file.exists()) { lines = Files.readAllLi...
List<TransformDescriptor> probes = ExampleAgent.readProbes(null); assertEquals(3, probes.size()); for (TransformDescriptor probe : probes) { assertEquals(TestProgram.class.getName(), probe.getTransformedClass()); assertNotNull(probe.getTransformedMethod()); assertNotNull(probe.getTransformedDescriptor())...
[FOCAL] static List<TransformDescriptor> ExampleAgent.readProbes(String probesFile) [CLASS] class ExampleAgent [METRICS] loc=13 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] probesFile.trim().length/0, String.trim/0, File.exists/0, Files.readAllLines/1, File.toPath/0, Utils.readFromStream/1, Exa...
/* static context [FOCAL] static List<TransformDescriptor> ExampleAgent.readProbes(String probesFile) [PATH1] if(probesFile == null || probesFile.trim().length() == 0)=T -> if(file.exists())=T -> return TransformDescriptor.from(lines) [PATH2] if(probesFile == null || probesFile.trim().length() == 0)=F -> if(file.exists...
/* static context [FOCAL] static List<TransformDescriptor> ExampleAgent.readProbes(String probesFile) [PATH1] if(probesFile == null || probesFile.trim().length() == 0)=T -> if(file.exists())=T -> return TransformDescriptor.from(lines) [PATH2] if(probesFile == null || probesFile.trim().length() == 0)=F -> if(file.exists...
true
ok
{"focal": {"class": "ExampleAgent", "name": "readProbes", "signature": "List<TransformDescriptor> readProbes(String probesFile) throws IOException", "start_line": 3, "modifiers": "static", "params": [{"name": "probesFile", "type": "String"}], "return_type": "List<TransformDescriptor>"}, "class_info": {"name": "ExampleA...
145960323_53
class QueueReader { public boolean hasRecordAvailable() { maybeReadNext(); return nextRecord != null; } public QueueReader(ToolOptions toolOptions); QueueReader(ToolOptions toolOptions, ChronicleQueue chronicleQueue); private static ChronicleQueue getChronicleQueue(ToolOpti...
when(tailer.readDocument(any(ReadMarshallable.class))).thenReturn(false); QueueReader reader = givenReader(); assertThat(reader.hasRecordAvailable()).isFalse(); } }
[FOCAL] public boolean QueueReader.hasRecordAvailable() [CLASS] class QueueReader [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] void maybeReadNext() [CLASS-MEMBERS] QueueReader(ToolOptions toolOptions); QueueReader(ToolOptions toolOptions, ChronicleQueue chronicleQueue); Chronicl...
/* static context [FOCAL] public boolean QueueReader.hasRecordAvailable() [CALLS-INTERNAL] void maybeReadNext() */
/* static context [FOCAL] public boolean QueueReader.hasRecordAvailable() [CALLS-INTERNAL] void maybeReadNext() */ class QueueReader { public boolean hasRecordAvailable() { maybeReadNext(); return nextRecord != null; } public QueueReader(ToolOptions toolOptions); QueueReader(Too...
true
ok
{"focal": {"class": "QueueReader", "name": "hasRecordAvailable", "signature": "boolean hasRecordAvailable()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "QueueReader", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name...
146009627_215
class EcmFileParticipantService { @Transactional(rollbackFor = Exception.class) public void inheritParticipantsFromAssignedObject(List<AcmParticipant> assignedObjectParticipants, List<AcmParticipant> originalAssignedObjectParticipants, AcmContainer acmContainer, boolean restricted) { if...
final Long objectId = 1L; final String participantLdapId = "userId2"; final String participantType = "write"; final String participantLdapId1 = "userId1"; final String participantType1 = "assignee"; final String participantLdapId2 = "userId2"; final String parti...
[FOCAL] @Transactional(rollbackFor = Exception.class) public void EcmFileParticipantService.inheritParticipantsFromAssignedObject(List<AcmParticipant> assignedObjectParticipants, List<AcmParticipant> originalAssignedObjectParticipants, AcmContainer acmContainer, boolean restricted) [CLASS] class EcmFileParticipantServi...
class EcmFileParticipantService { @Transactional(rollbackFor = Exception.class) public void inheritParticipantsFromAssignedObject(List<AcmParticipant> assignedObjectParticipants, List<AcmParticipant> originalAssignedObjectParticipants, AcmContainer acmContainer, boolean restricted) { if...
false
ok
{"focal": {"class": "EcmFileParticipantService", "name": "inheritParticipantsFromAssignedObject", "signature": "void inheritParticipantsFromAssignedObject(List<AcmParticipant> assignedObjectParticipants, List<AcmParticipant> originalAssignedObjectParticipants, AcmContainer acmContainer, boolean restricted)", "start_lin...
146066191_2
class GeeseService extends GeeseServiceImplBase { @Override public void getGeese(GetGeeseRequest request, StreamObserver<GeeseResponse> responseObserver) { GeeseResponse.Builder response = GeeseResponse.newBuilder(); int gooseWidth = Integer.max(request.getGooseWidth()...
InjectedFailureProvider fixtureFailureProvider = new InjectedFailureProvider(); fixtureFailureProvider.setFullFixtureEnabled(true); grpcServerRule.getServiceRegistry() .addService(new GeeseService((min, max) -> 0, index -> 0, fixtureFailureProvider)); ...
[FOCAL] @Override public void GeeseService.getGeese(GetGeeseRequest request, StreamObserver<GeeseResponse> responseObserver) [CLASS] class GeeseService extends GeeseServiceImplBase [METRICS] loc=13 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] GeeseLine generateGeeseLine(int lineWidth, int goose...
/* static context [FOCAL] @Override public void GeeseService.getGeese(GetGeeseRequest request, StreamObserver<GeeseResponse> responseObserver) [COLLABORATORS] param request:GetGeeseRequest getGooseWidth/0,getLinesCount/0,getLineWidth/0; param responseObserver:StreamObserver<GeeseResponse> onNext/1,onCompleted/0 [CALLS-...
/* static context [FOCAL] @Override public void GeeseService.getGeese(GetGeeseRequest request, StreamObserver<GeeseResponse> responseObserver) [COLLABORATORS] param request:GetGeeseRequest getGooseWidth/0,getLinesCount/0,getLineWidth/0; param responseObserver:StreamObserver<GeeseResponse> onNext/1,onCompleted/0 [CALLS-...
true
ok
{"focal": {"class": "GeeseService", "name": "getGeese", "signature": "void getGeese(GetGeeseRequest request, StreamObserver<GeeseResponse> responseObserver)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "GetGeeseRequest"}, {"name": "responseObserver", "type": "StreamObserver...
146223479_3
class SecretNotAllowedRule extends BaseTreeVisitor implements JavaFileScanner { boolean isSecret(String name) { return name.toLowerCase().contains("secret"); } @Override public void scanFile(JavaFileScannerContext context); @Override public void visitMethod(MethodTree tree); @Override public void visitVariable...
assertFalse(rule.isSecret("other")); } }
[FOCAL] boolean SecretNotAllowedRule.isSecret(String name) [CLASS] class SecretNotAllowedRule extends BaseTreeVisitor implements JavaFileScanner [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] name.toLowerCase().contains/1, String.toLowerCase/0 [INPUTS] branches=- | result=name [DA...
/* static context [FOCAL] boolean SecretNotAllowedRule.isSecret(String name) [INPUTS] branches=- | result=name [CALLS-EXTERNAL] name.toLowerCase().contains/1, String.toLowerCase/0 */
/* static context [FOCAL] boolean SecretNotAllowedRule.isSecret(String name) [INPUTS] branches=- | result=name [CALLS-EXTERNAL] name.toLowerCase().contains/1, String.toLowerCase/0 */ class SecretNotAllowedRule extends BaseTreeVisitor implements JavaFileScanner { boolean isSecret(String name) { return name.toLowerCa...
true
ok
{"focal": {"class": "SecretNotAllowedRule", "name": "isSecret", "signature": "boolean isSecret(String name)", "start_line": 3, "modifiers": "", "params": [{"name": "name", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "SecretNotAllowedRule", "kind": "class", "modifiers": "", "superclass": "BaseT...
146285827_105
class CrossOriginConfig { public boolean isEnabled() { return enabled; } private CrossOriginConfig(Builder builder); public static Builder builder(); public static Builder builder(Config config); public static Builder builder(CrossOriginConfig original); public static CrossOrigin...
Config node = testConfig.get("just-disabled"); assertThat(node, is(notNullValue())); assertThat(node.exists(), is(true)); CrossOriginConfig b = node.as(CrossOriginConfig::create).get(); assertThat(b.isEnabled(), is(false)); } }
[FOCAL] public boolean CrossOriginConfig.isEnabled() [CLASS] class CrossOriginConfig [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] CrossOriginConfig(Builder builder); Builder builder(); Builder builder(Config config); Builder builder(CrossOriginConfig original); CrossOriginConfig ...
/* static context [FOCAL] public boolean CrossOriginConfig.isEnabled() */
/* static context [FOCAL] public boolean CrossOriginConfig.isEnabled() */ class CrossOriginConfig { public boolean isEnabled() { return enabled; } private CrossOriginConfig(Builder builder); public static Builder builder(); public static Builder builder(Config config); public static ...
true
ok
{"focal": {"class": "CrossOriginConfig", "name": "isEnabled", "signature": "boolean isEnabled()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "CrossOriginConfig", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "YA...
146294560_3
class TechemHandlerFactory extends BaseThingHandlerFactory { @Override protected ThingHandler createHandler(Thing thing) { ThingTypeUID thingTypeUID = thing.getThingTypeUID(); if (thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV45) || thingTypeUID.equals(TechemB...
ThingImpl thing = new ThingImpl(THING_TYPE_TECHEM_HKV69, "00000"); ThingHandler handler = handlerFactory.createHandler(thing); Assertions.assertThat(handler).isNotNull(); } }
[FOCAL] @Override protected ThingHandler TechemHandlerFactory.createHandler(Thing thing) [CLASS] class TechemHandlerFactory extends BaseThingHandlerFactory [METRICS] loc=27 cc=5 branches=4 loops=0 returns=5 throws=0 nesting=4 [CALLS-EXTERNAL] Thing.getThingTypeUID/0, ThingTypeUID.equals/1, logger.debug/2, thing.getUID(...
/* static context [FOCAL] @Override protected ThingHandler TechemHandlerFactory.createHandler(Thing thing) [PATH1] if((thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV45) || thingTypeUID.equals(TechemBindingConstants.TH...)=F -> if((thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_WARM_WATER...
/* static context [FOCAL] @Override protected ThingHandler TechemHandlerFactory.createHandler(Thing thing) [PATH1] if((thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV45) || thingTypeUID.equals(TechemBindingConstants.TH...)=F -> if((thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_WARM_WATER...
true
ok
{"focal": {"class": "TechemHandlerFactory", "name": "createHandler", "signature": "ThingHandler createHandler(Thing thing)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "thing", "type": "Thing"}], "return_type": "ThingHandler"}, "class_info": {"name": "TechemHandlerFactory", "kind": "class"...
146386097_0
class FeaturePlugin implements Plugin { static FeatureGraph createFeatureGraph( JCTree.JCCompilationUnit compilationUnit, Context context) { FeatureGraph featureGraph = new FeatureGraph( compilationUnit.getSourceFile().getName(), compilationUnit.endPositions, com...
// ARRANGE TestCompilation compilation = TestCompilation.compile("Test.java", ""); // ACT FeatureGraph featureGraph = FeaturePlugin.createFeatureGraph(compilation.compilationUnit(), compilation.context()); // ASSERT assertThat(featureGraph.astNodes()).isEmpty(); } }
[FOCAL] static FeatureGraph FeaturePlugin.createFeatureGraph(JCTree.JCCompilationUnit compilationUnit, Context context) [CLASS] class FeaturePlugin implements Plugin [METRICS] loc=34 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] void checkSymbols(FeatureGraph graph); void linkCommentsToAstNodes(...
/* static context [FOCAL] static FeatureGraph FeaturePlugin.createFeatureGraph(JCTree.JCCompilationUnit compilationUnit, Context context) [INPUTS] branches=- | result=compilationUnit [COLLABORATORS] param compilationUnit:JCTree.JCCompilationUnit getSourceFile/0 [CALLS-INTERNAL] void checkSymbols(FeatureGraph graph); vo...
/* static context [FOCAL] static FeatureGraph FeaturePlugin.createFeatureGraph(JCTree.JCCompilationUnit compilationUnit, Context context) [INPUTS] branches=- | result=compilationUnit [COLLABORATORS] param compilationUnit:JCTree.JCCompilationUnit getSourceFile/0 [CALLS-INTERNAL] void checkSymbols(FeatureGraph graph); vo...
true
ok
{"focal": {"class": "FeaturePlugin", "name": "createFeatureGraph", "signature": "FeatureGraph createFeatureGraph(JCTree.JCCompilationUnit compilationUnit, Context context)", "start_line": 3, "modifiers": "static", "params": [{"name": "compilationUnit", "type": "JCTree.JCCompilationUnit"}, {"name": "context", "type": "C...
146510094_385
class DatePartition extends BasePartition implements JdbcFragmentMetadata { @Override public String toSqlConstraint(String quoteString, DbProduct dbProduct) { if (quoteString == null) { throw new RuntimeException("Quote string cannot be null"); } if (dbProduct == null) { ...
DatePartition partition = new DatePartition(COL_RAW, LocalDate.parse("2000-01-01"), null); String constraint = partition.toSqlConstraint(QUOTE, dbProduct); assertEquals( COL + " >= date'2000-01-01'", constraint ); } }
[FOCAL] @Override public String DatePartition.toSqlConstraint(String quoteString, DbProduct dbProduct) [CLASS] class DatePartition extends BasePartition implements JdbcFragmentMetadata [METRICS] loc=16 cc=3 branches=2 loops=0 returns=1 throws=2 nesting=1 [CALLS-EXTERNAL] String.format/2, generateRangeConstraint/2 (inhe...
/* static context [FOCAL] @Override public String DatePartition.toSqlConstraint(String quoteString, DbProduct dbProduct) [THROWS-WHEN] RuntimeException when quoteString == null [THROWS-WHEN] RuntimeException when !(quoteString == null) && dbProduct == null [PATH1] if(quoteString == null)=F -> if(dbProduct == null)=T ->...
/* static context [FOCAL] @Override public String DatePartition.toSqlConstraint(String quoteString, DbProduct dbProduct) [THROWS-WHEN] RuntimeException when quoteString == null [THROWS-WHEN] RuntimeException when !(quoteString == null) && dbProduct == null [PATH1] if(quoteString == null)=F -> if(dbProduct == null)=T ->...
true
ok
{"focal": {"class": "DatePartition", "name": "toSqlConstraint", "signature": "String toSqlConstraint(String quoteString, DbProduct dbProduct)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "quoteString", "type": "String"}, {"name": "dbProduct", "type": "DbProduct"}], "return_type": "String"}, "...
146525109_27
class InternalPhotosLibraryClient implements BackgroundResource { public final LeaveSharedAlbumResponse leaveSharedAlbum(String shareToken) { LeaveSharedAlbumRequest request = LeaveSharedAlbumRequest.newBuilder().setShareToken(shareToken).build(); return leaveSharedAlbum(request); } protected I...
StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockPhotosLibrary.addException(exception); try { String shareToken = "shareToken407816601"; client.leaveSharedAlbum(shareToken); Assert.fail("No exception raised"); } catch (InvalidArgumentExcepti...
[FOCAL] public final LeaveSharedAlbumResponse InternalPhotosLibraryClient.leaveSharedAlbum(String shareToken) [CLASS] class InternalPhotosLibraryClient implements BackgroundResource [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] LeaveSharedAlbumResponse leaveSharedAlbum(LeaveShare...
class InternalPhotosLibraryClient implements BackgroundResource { public final LeaveSharedAlbumResponse leaveSharedAlbum(String shareToken) { LeaveSharedAlbumRequest request = LeaveSharedAlbumRequest.newBuilder().setShareToken(shareToken).build(); return leaveSharedAlbum(request); } protected I...
false
ok
{"focal": {"class": "InternalPhotosLibraryClient", "name": "leaveSharedAlbum", "signature": "LeaveSharedAlbumResponse leaveSharedAlbum(String shareToken)", "start_line": 3, "modifiers": "public final", "params": [{"name": "shareToken", "type": "String"}], "return_type": "LeaveSharedAlbumResponse"}, "class_info": {"name...
146535797_375
class WearableRecyclerView extends RecyclerView { public void setEdgeItemsCenteringEnabled(boolean isEnabled) { mEdgeItemsCenteringEnabled = isEnabled; if (mEdgeItemsCenteringEnabled) { if (getChildCount() > 0) { setupCenteredPadding(); } else { ...
mActivityRule.runOnUiThread(new Runnable() { @Override public void run() { WearableRecyclerView wrv = (WearableRecyclerView) mActivityRule.getActivity().findViewById(R.id.wrv); wrv.setEdgeItemsCenteringEnabled(true); } ...
[FOCAL] public void WearableRecyclerView.setEdgeItemsCenteringEnabled(boolean isEnabled) [CLASS] class WearableRecyclerView extends RecyclerView [METRICS] loc=13 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=2 [CALLS-INTERNAL] void setupCenteredPadding(); void setupOriginalPadding() [CALLS-EXTERNAL] getChildCount/...
/* static context [FOCAL] public void WearableRecyclerView.setEdgeItemsCenteringEnabled(boolean isEnabled) [PATH1] if(mEdgeItemsCenteringEnabled)=T -> if(getChildCount() > 0)=T [PATH2] if(mEdgeItemsCenteringEnabled)=F [PATH3] if(mEdgeItemsCenteringEnabled)=T -> if(getChildCount() > 0)=F [INPUTS] branches=isEnabled | re...
/* static context [FOCAL] public void WearableRecyclerView.setEdgeItemsCenteringEnabled(boolean isEnabled) [PATH1] if(mEdgeItemsCenteringEnabled)=T -> if(getChildCount() > 0)=T [PATH2] if(mEdgeItemsCenteringEnabled)=F [PATH3] if(mEdgeItemsCenteringEnabled)=T -> if(getChildCount() > 0)=F [INPUTS] branches=isEnabled | re...
true
ok
{"focal": {"class": "WearableRecyclerView", "name": "setEdgeItemsCenteringEnabled", "signature": "void setEdgeItemsCenteringEnabled(boolean isEnabled)", "start_line": 3, "modifiers": "public", "params": [{"name": "isEnabled", "type": "boolean"}], "return_type": "void"}, "class_info": {"name": "WearableRecyclerView", "k...
146574601_1
class ReflectionHelper { public static void parseServiceMetadataString(String metadataField, Map<String, List<String>> metadata) { StringBuffer sb = new StringBuffer(metadataField); int dot = 0; int nextEquals = sb.indexOf(EQUALS_STRING, dot); while (nextEquals > 0) { S...
HashMap<String, List<String>> metadata = new HashMap<String, List<String>>(); ReflectionHelper.parseServiceMetadataString(GOOD_METADATA_2, metadata); Assert.assertEquals(metadata.get("key1").get(0), "value1"); Assert.assertEquals(metadata.get("key2").get(0), "value2"); ...
[FOCAL] public static void ReflectionHelper.parseServiceMetadataString(String metadataField, Map<String, List<String>> metadata) [CLASS] class ReflectionHelper [METRICS] loc=55 cc=7 branches=5 loops=1 returns=0 throws=1 nesting=3 [CALLS-EXTERNAL] StringBuffer.indexOf/2, StringBuffer.substring/2, StringBuffer.charAt/1, ...
class ReflectionHelper { public static void parseServiceMetadataString(String metadataField, Map<String, List<String>> metadata) { StringBuffer sb = new StringBuffer(metadataField); int dot = 0; int nextEquals = sb.indexOf(EQUALS_STRING, dot); while (nextEquals > 0) { S...
false
ok
{"focal": {"class": "ReflectionHelper", "name": "parseServiceMetadataString", "signature": "void parseServiceMetadataString(String metadataField, Map<String, List<String>> metadata)", "start_line": 3, "modifiers": "public static", "params": [{"name": "metadataField", "type": "String"}, {"name": "metadata", "type": "Map...
146578832_1
class ParallelWorldClassLoader extends ClassLoader implements Closeable { @Override protected URL findResource(String name) { URL u = getParent().getResource(prefix + name); if (u != null) { try { jars.add(new JarFile(new File(toJarUrl(u).toURI()))); } ca...
if (isJDK9()) return; URL resource = pwcl.getResource("javax/xml/ws/Service.class"); URL object = pwcl.getResource("java/lang/Object.class"); String resJar = resource.getPath().substring(0, resource.getPath().indexOf("!")); String rtJar = object.getPath().substring(0, object.getP...
[FOCAL] @Override protected URL ParallelWorldClassLoader.findResource(String name) [CLASS] class ParallelWorldClassLoader extends ClassLoader implements Closeable [METRICS] loc=14 cc=4 branches=1 loops=0 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] URL toJarUrl(URL res) [CALLS-EXTERNAL] getParent().getResource/1, getP...
/* static context [FOCAL] @Override protected URL ParallelWorldClassLoader.findResource(String name) [PATH1] if(u != null)=T -> try-body throws -> return u [PATH2] if(u != null)=F -> return u [INPUTS] branches=name | result=name [COLLABORATORS] field jars add/1 [EXCEPTIONS] catches URISyntaxException | IOException ex, ...
/* static context [FOCAL] @Override protected URL ParallelWorldClassLoader.findResource(String name) [PATH1] if(u != null)=T -> try-body throws -> return u [PATH2] if(u != null)=F -> return u [INPUTS] branches=name | result=name [COLLABORATORS] field jars add/1 [EXCEPTIONS] catches URISyntaxException | IOException ex, ...
true
ok
{"focal": {"class": "ParallelWorldClassLoader", "name": "findResource", "signature": "URL findResource(String name)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "name", "type": "String"}], "return_type": "URL"}, "class_info": {"name": "ParallelWorldClassLoader", "kind": "class", "modifiers...
146582041_0
class GlitchClient { public CredentialManager getCredentialManager() { return credentialManager; } private GlitchClient(OkHttpClient httpClient, Config config, Storage storage); public static Builder builder(); public Config getConfiguration(); public OkHttpClient getHttpClient(); ...
StepVerifier.create(CLIENT.getCredentialManager().valid(credential)) .expectSubscription() .expectNextMatches(validate -> validate.getUserId() == 120074641L && Objects.equals(validate.getLogin(), "sandalphon_ai") && ...
[FOCAL] public CredentialManager GlitchClient.getCredentialManager() [CLASS] class GlitchClient [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] GlitchClient(OkHttpClient httpClient, Config config, Storage storage); Builder builder(); Config getConfiguration(); OkHttpClient getHttpCl...
/* static context [FOCAL] public CredentialManager GlitchClient.getCredentialManager() */
/* static context [FOCAL] public CredentialManager GlitchClient.getCredentialManager() */ class GlitchClient { public CredentialManager getCredentialManager() { return credentialManager; } private GlitchClient(OkHttpClient httpClient, Config config, Storage storage); public static Builder bu...
true
ok
{"focal": {"class": "GlitchClient", "name": "getCredentialManager", "signature": "CredentialManager getCredentialManager()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "CredentialManager"}, "class_info": {"name": "GlitchClient", "kind": "class", "modifiers": "", "superclass": null, "interfaces...
146633589_41
class StringUtils { public static String stripEnd(final String str, final String stripChars) { int end; if (str == null || (end = str.length()) == 0) { return str; } if (stripChars == null) { while (end != 0 && Character.isWhitespace(str.charAt(end - 1))) { ...
Assert.assertEquals("foo", StringUtils.stripEnd("foo!", "!")); Assert.assertEquals(" foo", StringUtils.stripEnd(" foo ", " ")); Assert.assertEquals("!", StringUtils.stripEnd("!", "")); Assert.assertEquals("#", StringUtils.stripEnd("# ", null)); Assert.assertEquals("", StringU...
[FOCAL] public static String StringUtils.stripEnd(String str, String stripChars) [CLASS] class StringUtils [METRICS] loc=19 cc=6 branches=3 loops=2 returns=3 throws=0 nesting=3 [CALLS-EXTERNAL] String.length/0, Character.isWhitespace/1, String.charAt/1, String.isEmpty/0, String.indexOf/1, String.substring/2 [PATH1] if(...
/* static context [FOCAL] public static String StringUtils.stripEnd(String str, String stripChars) [PATH1] if(str == null || (end = str.length()) == 0)=F -> if(stripChars == null)=F -> if(stripChars.isEmpty())=F -> while(end != 0 && stripChars.indexOf(str.charAt(end - 1)) != INDEX_NOT_FOUND)=T -> exit loop -> return st...
/* static context [FOCAL] public static String StringUtils.stripEnd(String str, String stripChars) [PATH1] if(str == null || (end = str.length()) == 0)=F -> if(stripChars == null)=F -> if(stripChars.isEmpty())=F -> while(end != 0 && stripChars.indexOf(str.charAt(end - 1)) != INDEX_NOT_FOUND)=T -> exit loop -> return st...
true
ok
{"focal": {"class": "StringUtils", "name": "stripEnd", "signature": "String stripEnd(String str, String stripChars)", "start_line": 3, "modifiers": "public static", "params": [{"name": "str", "type": "String"}, {"name": "stripChars", "type": "String"}], "return_type": "String"}, "class_info": {"name": "StringUtils", "k...
146924987_18
class FastDatumReaderWriterUtil { public static <T> FastSpecificDatumReader<T> getFastSpecificDatumReader(Schema schema) { return (FastSpecificDatumReader<T>) getFastSpecificDatumReader(schema, schema); } private FastDatumReaderWriterUtil(); public static FastGenericDatumReader<T> getFastGenericDatumRea...
Schema testSchema = Schema.parse("{\"type\": \"record\", \"name\": \"test_record\", \"fields\":[]}"); FastSpecificDatumReader fastReader = FastDatumReaderWriterUtil.getFastSpecificDatumReader(testSchema); Assert.assertNotNull(fastReader); FastSpecificDatumReader newFastReader = FastDatumReaderWriterUtil...
[FOCAL] public static FastSpecificDatumReader<T> FastDatumReaderWriterUtil.getFastSpecificDatumReader(Schema schema) [CLASS] class FastDatumReaderWriterUtil [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] FastSpecificDatumReader<T> getFastSpecificDatumReader(Schema writerSchema, Sc...
/* static context [FOCAL] public static FastSpecificDatumReader<T> FastDatumReaderWriterUtil.getFastSpecificDatumReader(Schema schema) [INPUTS] branches=- | result=schema [CALLS-INTERNAL] FastSpecificDatumReader<T> getFastSpecificDatumReader(Schema writerSchema, Schema readerSchema) */
/* static context [FOCAL] public static FastSpecificDatumReader<T> FastDatumReaderWriterUtil.getFastSpecificDatumReader(Schema schema) [INPUTS] branches=- | result=schema [CALLS-INTERNAL] FastSpecificDatumReader<T> getFastSpecificDatumReader(Schema writerSchema, Schema readerSchema) */ class FastDatumReaderWriterUtil {...
true
ok
{"focal": {"class": "FastDatumReaderWriterUtil", "name": "getFastSpecificDatumReader", "signature": "FastSpecificDatumReader<T> getFastSpecificDatumReader(Schema schema)", "start_line": 3, "modifiers": "public static", "params": [{"name": "schema", "type": "Schema"}], "return_type": "FastSpecificDatumReader<T>"}, "clas...
146941185_237
class DataCollectionHelper { public void setAutomaticDataCollectionEnabled(boolean isEnabled) { // Update SharedPreferences, so that we preserve state across app restarts sharedPreferencesUtils.setBooleanPreference(AUTO_INIT_PREFERENCES, isEnabled); } @Inject public DataCollectionHelper( Firebase...
when(sharedPreferencesUtils.isPreferenceSet(DataCollectionHelper.AUTO_INIT_PREFERENCES)) .thenReturn(false); when(sharedPreferencesUtils.isManifestSet( DataCollectionHelper.MANIFEST_METADATA_AUTO_INIT_ENABLED)) .thenReturn(false); when(firebaseApp.isDataCollectionDefaultEnabled()...
[FOCAL] public void DataCollectionHelper.setAutomaticDataCollectionEnabled(boolean isEnabled) [CLASS] class DataCollectionHelper [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] SharedPreferencesUtils.setBooleanPreference/2 [FIELDS] read=sharedPreferencesUtils:SharedPreferencesUtils...
/* static context [FOCAL] public void DataCollectionHelper.setAutomaticDataCollectionEnabled(boolean isEnabled) [COLLABORATORS] field sharedPreferencesUtils:SharedPreferencesUtils setBooleanPreference/2 [FIELDS] read=sharedPreferencesUtils:SharedPreferencesUtils [CALLS-EXTERNAL] SharedPreferencesUtils.setBooleanPrefere...
/* static context [FOCAL] public void DataCollectionHelper.setAutomaticDataCollectionEnabled(boolean isEnabled) [COLLABORATORS] field sharedPreferencesUtils:SharedPreferencesUtils setBooleanPreference/2 [FIELDS] read=sharedPreferencesUtils:SharedPreferencesUtils [CALLS-EXTERNAL] SharedPreferencesUtils.setBooleanPrefere...
true
ok
{"focal": {"class": "DataCollectionHelper", "name": "setAutomaticDataCollectionEnabled", "signature": "void setAutomaticDataCollectionEnabled(boolean isEnabled)", "start_line": 3, "modifiers": "public", "params": [{"name": "isEnabled", "type": "boolean"}], "return_type": "void"}, "class_info": {"name": "DataCollectionH...
146983529_45
class StringField implements FieldType<String> { @Override public String convert(Object objValue) throws OperationException { if (objValue == null) { throw new OperationException(ErrorCode.DATATYPE_MISMATCH); } final String str = objValue.toString(); if (length > 0 ...
System.out.println("convert"); StringField instance; instance = new StringField(Types.STRING, "36"); UUID expectedResult = UUID.randomUUID(); assertEquals(expectedResult.toString(), instance.convert(expectedResult)); assertEquals(expectedResult.toString(), instance.conve...
[FOCAL] @Override public String StringField.convert(Object objValue) [CLASS] class StringField implements FieldType<String> [METRICS] loc=13 cc=3 branches=2 loops=0 returns=1 throws=2 nesting=1 [CALLS-EXTERNAL] Object.toString/0, String.length/0 [NEW] OperationException [EXCEPTIONS] declares OperationException; throws ...
/* static context [FOCAL] @Override public String StringField.convert(Object objValue) [THROWS-WHEN] OperationException when objValue == null [THROWS-WHEN] OperationException when !(objValue == null) && length > 0 && str.length() > length [PATH1] if(objValue == null)=F -> if(length > 0 && str.length() > length)=T -> th...
/* static context [FOCAL] @Override public String StringField.convert(Object objValue) [THROWS-WHEN] OperationException when objValue == null [THROWS-WHEN] OperationException when !(objValue == null) && length > 0 && str.length() > length [PATH1] if(objValue == null)=F -> if(length > 0 && str.length() > length)=T -> th...
true
ok
{"focal": {"class": "StringField", "name": "convert", "signature": "String convert(Object objValue) throws OperationException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "objValue", "type": "Object"}], "return_type": "String"}, "class_info": {"name": "StringField", "kind": "class", "modifier...
147038962_0
class LogTrackerRunnable implements Runnable { @Override public void run() { try { LogTrackerUtil.setContext(context); doRun(); } catch (LogTrackerException e) { Logger.warn("Context transfer failed", e); } catch (Exception e) { Logger.war...
doCallRealMethod().when(logTrackerRunnable).run(); logTrackerRunnable.run(); PowerMockito.verifyStatic(VerificationModeFactory.times(1)); LogTrackerUtil.setContext(any(Http.Context.class)); PowerMockito.verifyStatic(VerificationModeFactory.times(1)); LogTrackerUtil.clea...
[FOCAL] @Override public void LogTrackerRunnable.run() [CLASS] class LogTrackerRunnable implements Runnable [METRICS] loc=13 cc=3 branches=0 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] void doRun() [CALLS-EXTERNAL] LogTrackerUtil.setContext/1, Logger.warn/2, LogTrackerUtil.clearContext/0 [EXCEPTIONS] catches ...
/* static context [FOCAL] @Override public void LogTrackerRunnable.run() [PATH1] try-body throws [EXCEPTIONS] catches LogTrackerException e, Exception e [CALLS-INTERNAL] void doRun() [CALLS-EXTERNAL] LogTrackerUtil.setContext/1, Logger.warn/2, LogTrackerUtil.clearContext/0 */
/* static context [FOCAL] @Override public void LogTrackerRunnable.run() [PATH1] try-body throws [EXCEPTIONS] catches LogTrackerException e, Exception e [CALLS-INTERNAL] void doRun() [CALLS-EXTERNAL] LogTrackerUtil.setContext/1, Logger.warn/2, LogTrackerUtil.clearContext/0 */ class LogTrackerRunnable implements Runnabl...
true
ok
{"focal": {"class": "LogTrackerRunnable", "name": "run", "signature": "void run()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "LogTrackerRunnable", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Runnable", "fields": [{"name": "lo...
147102058_5
class ApplicationPropertiesSourceGenerator { public void generate() throws GeneratorException { Configuration freeMarkerConfiguration = new Configuration(); freeMarkerConfiguration.setClassForTemplateLoading(WebXmlSourceGenerator.class, "/templates/properties"); freeMarkerC...
ApplicationPropertiesSourceGenerator generator = getGenerator(); generator.generate(); Path propsPath = Files.find(resourceFolder.getRoot().toPath(), Integer.MAX_VALUE, (filePath, fileAttr) -> fileAttr.isRegularFile()) .filter(path -> path.toFile().getName().equa...
[FOCAL] public void ApplicationPropertiesSourceGenerator.generate() [CLASS] class ApplicationPropertiesSourceGenerator [METRICS] loc=31 cc=4 branches=1 loops=0 returns=0 throws=2 nesting=1 [CALLS-EXTERNAL] Configuration.setClassForTemplateLoading/2, Configuration.setDefaultEncoding/1, Configuration.getTemplate/1, IOExc...
/* static context [FOCAL] public void ApplicationPropertiesSourceGenerator.generate() [THROWS-WHEN] GeneratorException when try-body throws [THROWS-WHEN] GeneratorException when !this.resourceDirectory.exists() && try-body throws [THROWS-WHEN] GeneratorException when this.resourceDirectory.exists() && try-body throws [...
/* static context [FOCAL] public void ApplicationPropertiesSourceGenerator.generate() [THROWS-WHEN] GeneratorException when try-body throws [THROWS-WHEN] GeneratorException when !this.resourceDirectory.exists() && try-body throws [THROWS-WHEN] GeneratorException when this.resourceDirectory.exists() && try-body throws [...
true
ok
{"focal": {"class": "ApplicationPropertiesSourceGenerator", "name": "generate", "signature": "void generate() throws GeneratorException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "ApplicationPropertiesSourceGenerator", "kind": "class", "modifiers": "", "superc...
147162839_18
class JobExecutionService { public Collection<JobExecution> jobExecutions(Optional<String> jobNameRegexp, Optional<String> exitCode, int maxNumberOfExecutionsPerJobName) { logger.debug("Getting job execution...
Collection<JobExecution> jes = jobExecutionService.jobExecutions(empty(), Optional.of(ExitStatus.FAILED.getExitCode()), 1); Assertions.assertThat(jes).hasSize(2); Assertions.assertThat(jes).extracting(je -> je.getExitCode()).allMatch(s -> s.equals("FAILED")); } }
[FOCAL] public Collection<JobExecution> JobExecutionService.jobExecutions(Optional<String> jobNameRegexp, Optional<String> exitCode, int maxNumberOfExecutionsPerJobName) [CLASS] class JobExecutionService [METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] logger.debug/4, jobExecutionP...
/* static context [FOCAL] public Collection<JobExecution> JobExecutionService.jobExecutions(Optional<String> jobNameRegexp, Optional<String> exitCode, int maxNumberOfExecutionsPerJobName) [INPUTS] branches=- | result=exitCode, jobNameRegexp, maxNumberOfExecutionsPerJobName [COLLABORATORS] field jobExecutionProvider get...
/* static context [FOCAL] public Collection<JobExecution> JobExecutionService.jobExecutions(Optional<String> jobNameRegexp, Optional<String> exitCode, int maxNumberOfExecutionsPerJobName) [INPUTS] branches=- | result=exitCode, jobNameRegexp, maxNumberOfExecutionsPerJobName [COLLABORATORS] field jobExecutionProvider get...
true
ok
{"focal": {"class": "JobExecutionService", "name": "jobExecutions", "signature": "Collection<JobExecution> jobExecutions(Optional<String> jobNameRegexp, Optional<String> exitCode, int maxNumberOfExecutionsPerJobName)", "start_line": 3, "modifiers": "public", "params": [{"name": "jobNameRegexp", "type": "Optional<String...
147324963_118
class Peer extends PeerSocketHandler { public void startBlockChainDownload() { setDownloadData(true); // TODO: peer might still have blocks that we don't have, and even have a heavier // chain even if the chain block count is lower. final int blocksLeft = getPeerBlockHeightDifferenc...
Block b1 = createFakeBlock(blockStore, Block.BLOCK_HEIGHT_GENESIS).block; blockChain.add(b1); Block b2 = makeSolvedTestBlock(b1); blockChain.add(b2); connect(); fail.set(true); peer.addChainDownloadStartedEventListener(Threading.SAME_THREAD, new ChainDownloadStar...
[FOCAL] public void Peer.startBlockChainDownload() [CLASS] class Peer extends PeerSocketHandler [METRICS] loc=23 cc=4 branches=1 loops=1 returns=0 throws=0 nesting=2 [CALLS-INTERNAL] int getPeerBlockHeightDifference(); void blockChainDownloadLocked(Sha256Hash toHash); void setDownloadData(boolean downloadData) [CALLS-E...
class Peer extends PeerSocketHandler { public void startBlockChainDownload() { setDownloadData(true); // TODO: peer might still have blocks that we don't have, and even have a heavier // chain even if the chain block count is lower. final int blocksLeft = getPeerBlockHeightDifferenc...
false
ok
{"focal": {"class": "Peer", "name": "startBlockChainDownload", "signature": "void startBlockChainDownload()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "Peer", "kind": "class", "modifiers": "", "superclass": "PeerSocketHandler", "interfaces": null, "fields": [{...
147334432_0
class Banking { public static Double simpleInterest(Double principal, Double rateOfInterest, Integer years){ Objects.requireNonNull(principal, "Principal cannot be null"); Objects.requireNonNull(rateOfInterest, "Rate of interest cannot be null"); Objects.requireNonNull(years, "Year...
Double simpleInterest = Banking.simpleInterest(1000.0, 10.0, 2); assertThat(simpleInterest).isEqualTo(200.0); } }
[FOCAL] public static Double Banking.simpleInterest(Double principal, Double rateOfInterest, Integer years) [CLASS] class Banking [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Objects.requireNonNull/2 [INPUTS] branches=- | result=principal, rateOfInterest, years [DATAFLOW] princi...
/* static context [FOCAL] public static Double Banking.simpleInterest(Double principal, Double rateOfInterest, Integer years) [INPUTS] branches=- | result=principal, rateOfInterest, years [CALLS-EXTERNAL] Objects.requireNonNull/2 */
/* static context [FOCAL] public static Double Banking.simpleInterest(Double principal, Double rateOfInterest, Integer years) [INPUTS] branches=- | result=principal, rateOfInterest, years [CALLS-EXTERNAL] Objects.requireNonNull/2 */ class Banking { public static Double simpleInterest(Double principal, Dou...
true
ok
{"focal": {"class": "Banking", "name": "simpleInterest", "signature": "Double simpleInterest(Double principal, Double rateOfInterest, Integer years)", "start_line": 3, "modifiers": "public static", "params": [{"name": "principal", "type": "Double"}, {"name": "rateOfInterest", "type": "Double"}, {"name": "years", "type"...
147522483_135
class CombiningValidator implements Validator<T> { @Override public ValidationResult validate(T t) { for (Validator<T> validator : validators) { ValidationResult result = validator.validate(t); if (result.isErroneous()) { debugLog(t, validator); validationListeners.forEach(listener -> listener.onVali...
Validator<Token> combiningValidator = new CombiningValidator<>( TokenTestValidator.createValid(), TokenTestValidator.createInvalid(FIRST_ERROR_MESSAGE), TokenTestValidator.createInvalid(SECOND_ERROR_MESSAGE)); String error = combiningValidator.validate(TOKEN).getErrorDescription(); assertThat(error).isE...
[FOCAL] @Override public ValidationResult CombiningValidator.validate(T t) [CLASS] class CombiningValidator implements Validator<T> [METRICS] loc=12 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2 [CALLS-INTERNAL] ValidationResult createValidationResult(); void debugLog(T t, Validator<T> validator) [CALLS-EXTERNAL...
/* static context [FOCAL] @Override public ValidationResult CombiningValidator.validate(T t) [PATH1] foreach(Validator<T> validator : validators)=T -> if(result.isErroneous())=F -> exit loop -> return createValidationResult() [PATH2] foreach(Validator<T> validator : validators)=T -> if(result.isErroneous())=T -> return...
/* static context [FOCAL] @Override public ValidationResult CombiningValidator.validate(T t) [PATH1] foreach(Validator<T> validator : validators)=T -> if(result.isErroneous())=F -> exit loop -> return createValidationResult() [PATH2] foreach(Validator<T> validator : validators)=T -> if(result.isErroneous())=T -> return...
true
ok
{"focal": {"class": "CombiningValidator", "name": "validate", "signature": "ValidationResult validate(T t)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "t", "type": "T"}], "return_type": "ValidationResult"}, "class_info": {"name": "CombiningValidator", "kind": "class", "modifiers": "", "super...
147527545_2
class Parts_Picker_Get2 extends DataSource { @Override protected int getDataSourceKey() { return 1791; } Parts_Picker_Get2(IDataSourceCallback iDataSourceCallback, HttpDataSourceCredentials credentials, String serverName); Parts_Picker_Get2(IDataSourceCallback iDataSourceCallback, HttpDataSourceCred...
int expected = 1791; int output = new Parts_Picker_Get2(null, null, null).getDataSourceKey(); assertEquals(expected, output); } }
[FOCAL] @Override protected int Parts_Picker_Get2.getDataSourceKey() [CLASS] class Parts_Picker_Get2 extends DataSource [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Parts_Picker_Get2(IDataSourceCallback iDataSourceCallback, HttpDataSourceCredentials credentials, String serverName...
/* static context [FOCAL] @Override protected int Parts_Picker_Get2.getDataSourceKey() */
/* static context [FOCAL] @Override protected int Parts_Picker_Get2.getDataSourceKey() */ class Parts_Picker_Get2 extends DataSource { @Override protected int getDataSourceKey() { return 1791; } Parts_Picker_Get2(IDataSourceCallback iDataSourceCallback, HttpDataSourceCredentials credentials, String serv...
true
ok
{"focal": {"class": "Parts_Picker_Get2", "name": "getDataSourceKey", "signature": "int getDataSourceKey()", "start_line": 3, "modifiers": "@Override protected", "params": [], "return_type": "int"}, "class_info": {"name": "Parts_Picker_Get2", "kind": "class", "modifiers": "", "superclass": "DataSource", "interfaces": nu...
147637805_24
class InputCoverageFactory extends org.evosuite.coverage.io.input.InputCoverageFactory { protected void detectGoals(String className, String methodName, Class<?>[] argumentClasses ,Type[] argumentTypes, List<InputCoverageTestFitness> goals){ for (int i=0; i<argumentTypes.length;i++){ Type argTy...
Type type = Type.getType(Set.class); List<InputCoverageTestFitness> goals = new ArrayList<InputCoverageTestFitness>(); inputCoverageFactory.detectGoals("ClassA","method1",new Class[]{Set.class},new Type[]{type},goals); assert (goals.size() == 3); } }
[FOCAL] protected void InputCoverageFactory.detectGoals(String className, String methodName, Class<?>[] argumentClasses, Type[] argumentTypes, List<InputCoverageTestFitness> goals) [CLASS] class InputCoverageFactory extends org.evosuite.coverage.io.input.InputCoverageFactory [METRICS] loc=82 cc=22 branches=10 loops=2 r...
/* static context [FOCAL] protected void InputCoverageFactory.detectGoals(String className, String methodName, Class<?>[] argumentClasses, Type[] argumentTypes, List<InputCoverageTestFitness> goals) [PATH2] for(i<argumentTypes.length)=T -> if(typeSort == Type.OBJECT)=T -> if(ClassUtils.isPrimitiveWrapper(typeClass))=F ...
/* static context [FOCAL] protected void InputCoverageFactory.detectGoals(String className, String methodName, Class<?>[] argumentClasses, Type[] argumentTypes, List<InputCoverageTestFitness> goals) [PATH2] for(i<argumentTypes.length)=T -> if(typeSort == Type.OBJECT)=T -> if(ClassUtils.isPrimitiveWrapper(typeClass))=F ...
true
ok
{"focal": {"class": "InputCoverageFactory", "name": "detectGoals", "signature": "void detectGoals(String className, String methodName, Class<?>[] argumentClasses, Type[] argumentTypes, List<InputCoverageTestFitness> goals)", "start_line": 3, "modifiers": "protected", "params": [{"name": "className", "type": "String"}, ...
147747963_305
class FromInputStreamPublisher extends Publisher<byte[]> implements PublisherSource<byte[]> { @Override public void subscribe(final Subscriber<? super byte[]> subscriber) { subscribeInternal(subscriber); } FromInputStreamPublisher(final InputStream stream); @Override protected void hand...
initChunkedStream(smallBuff, ofAll(10), ofAll(10)); Subscriber sub = mock(Subscriber.class); doAnswer(inv -> { Subscription s = inv.getArgument(0); s.request(1); s.cancel(); return null; }).when(sub).onSubscribe(any()); doThrow(DE...
[FOCAL] @Override public void FromInputStreamPublisher.subscribe(Subscriber<? super byte[]> subscriber) [CLASS] class FromInputStreamPublisher extends Publisher<byte[]> implements PublisherSource<byte[]> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] subscribeInternal/1 (inherited...
/* static context [FOCAL] @Override public void FromInputStreamPublisher.subscribe(Subscriber<? super byte[]> subscriber) [CALLS-EXTERNAL] subscribeInternal/1 (inherited) */
/* static context [FOCAL] @Override public void FromInputStreamPublisher.subscribe(Subscriber<? super byte[]> subscriber) [CALLS-EXTERNAL] subscribeInternal/1 (inherited) */ class FromInputStreamPublisher extends Publisher<byte[]> implements PublisherSource<byte[]> { @Override public void subscribe(final Subsc...
true
ok
{"focal": {"class": "FromInputStreamPublisher", "name": "subscribe", "signature": "void subscribe(Subscriber<? super byte[]> subscriber)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "subscriber", "type": "Subscriber<? super byte[]>"}], "return_type": "void"}, "class_info": {"name": "FromInput...
147802356_777
class FP2Immutable { FP2Immutable sqr() { FP2 result = new FP2(fp2); result.sqr(); return new FP2Immutable(result); } FP2Immutable(FP2Immutable fp2Immutable); FP2Immutable(FP2 fp2); FP2Immutable(FP fpA, FP fpB); FP2Immutable(BIG big1, BIG big2); FP2Immutable(int c); FP2Immutabl...
assertEquals(XSQ, X.sqr()); } }
[FOCAL] FP2Immutable FP2Immutable.sqr() [CLASS] class FP2Immutable [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] FP2.sqr/0 [NEW] FP2, FP2Immutable [DATAFLOW] result@L2->L3,L4 [CLASS-MEMBERS] FP2Immutable(FP2Immutable fp2Immutable); FP2Immutable(FP2 fp2); FP2Immutable(FP fpA, FP f...
/* static context [FOCAL] FP2Immutable FP2Immutable.sqr() [NEW] FP2, FP2Immutable [CALLS-EXTERNAL] FP2.sqr/0 */
/* static context [FOCAL] FP2Immutable FP2Immutable.sqr() [NEW] FP2, FP2Immutable [CALLS-EXTERNAL] FP2.sqr/0 */ class FP2Immutable { FP2Immutable sqr() { FP2 result = new FP2(fp2); result.sqr(); return new FP2Immutable(result); } FP2Immutable(FP2Immutable fp2Immutable); FP2Immutable(FP2 fp2); ...
true
ok
{"focal": {"class": "FP2Immutable", "name": "sqr", "signature": "FP2Immutable sqr()", "start_line": 3, "modifiers": "", "params": [], "return_type": "FP2Immutable"}, "class_info": {"name": "FP2Immutable", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "P", "type": "BIG", "...
147809547_47
class LogManagerProperties extends Properties { static <T> T newObjectFrom(String name, Class<T> type) throws Exception { try { final Class<?> clazz = LogManagerProperties.findClass(name); //This check avoids additional side effects when the name parameter //is a literal...
try { Class<?> k = ErrorAuthenticator.class; jakarta.mail.Authenticator a; a = LogManagerProperties.newObjectFrom(k.getName(), Authenticator.class); assertEquals(k, a.getClass()); setPending(new ThreadDeath()); try { a = L...
[FOCAL] static T LogManagerProperties.newObjectFrom(String name, Class<T> type) [CLASS] class LogManagerProperties extends Properties [METRICS] loc=26 cc=7 branches=1 loops=0 returns=1 throws=4 nesting=3 [CALLS-INTERNAL] Exception paramOrError(InvocationTargetException ite); InvocationTargetException wrapOrThrow(Except...
/* static context [FOCAL] static T LogManagerProperties.newObjectFrom(String name, Class<T> type) [THROWS-WHEN] ClassNotFoundException when try-body throws [THROWS-WHEN] wrapOrThrow(EIIE) when try-body throws [THROWS-WHEN] ClassNotFoundException when type.isAssignableFrom(clazz) && try-body throws && throw paramOrError...
/* static context [FOCAL] static T LogManagerProperties.newObjectFrom(String name, Class<T> type) [THROWS-WHEN] ClassNotFoundException when try-body throws [THROWS-WHEN] wrapOrThrow(EIIE) when try-body throws [THROWS-WHEN] ClassNotFoundException when type.isAssignableFrom(clazz) && try-body throws && throw paramOrError...
true
ok
{"focal": {"class": "LogManagerProperties", "name": "newObjectFrom", "signature": "T newObjectFrom(String name, Class<T> type) throws Exception", "start_line": 3, "modifiers": "static", "params": [{"name": "name", "type": "String"}, {"name": "type", "type": "Class<T>"}], "return_type": "T"}, "class_info": {"name": "Log...
147922185_562
class IncidentDateExtensionUtils { @Nullable public static Date getValue( @Nonnull IBaseHasExtensions resource ) { return BaseExtensionUtils.getDateValue( URL, resource ); } private IncidentDateExtensionUtils(); public static void setValue( @Nonnull IBaseHasExtensions resource, @Null...
TestPlanDefinition planDefinition = new TestPlanDefinition(); final Date date = new Date(); IncidentDateExtensionUtils.setValue( planDefinition, date, TypeFactory::createType ); Assert.assertEquals( date, IncidentDateExtensionUtils.getValue( planDefinition ) ); } }
[FOCAL] @Nullable public static Date IncidentDateExtensionUtils.getValue(IBaseHasExtensions resource) [CLASS] class IncidentDateExtensionUtils [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] BaseExtensionUtils.getDateValue/2 [INPUTS] branches=- | result=resource [DATAFLOW] resource...
/* static context [FOCAL] @Nullable public static Date IncidentDateExtensionUtils.getValue(IBaseHasExtensions resource) [INPUTS] branches=- | result=resource [CALLS-EXTERNAL] BaseExtensionUtils.getDateValue/2 */
/* static context [FOCAL] @Nullable public static Date IncidentDateExtensionUtils.getValue(IBaseHasExtensions resource) [INPUTS] branches=- | result=resource [CALLS-EXTERNAL] BaseExtensionUtils.getDateValue/2 */ class IncidentDateExtensionUtils { @Nullable public static Date getValue( @Nonnull IBaseHasExtensio...
true
ok
{"focal": {"class": "IncidentDateExtensionUtils", "name": "getValue", "signature": "Date getValue(IBaseHasExtensions resource)", "start_line": 3, "modifiers": "@Nullable public static", "params": [{"name": "resource", "type": "IBaseHasExtensions"}], "return_type": "Date"}, "class_info": {"name": "IncidentDateExtensionU...
147965914_0
class AddressService extends BaseNodeAddressService { public AddressesExistsResponse addressesCheckExistenceAndRequestHistoryNode(AddressBulkRequest addressRequest) { List<Hash> addressHashes = addressRequest.getAddresses(); LinkedHashMap<String, Boolean> addressHashToFoundStatusMap = new LinkedHa...
AddressBulkRequest addressBulkRequest = AddressTestUtils.generateAddressBulkRequest( addressInLocalAddressesCollection.getHash()); AddressesExistsResponse actualResponse = addressService.addressesCheckExistenceAndRequestHistoryNode(addressBulkRequest); AddressesExistsResponse e...
[FOCAL] public AddressesExistsResponse AddressService.addressesCheckExistenceAndRequestHistoryNode(AddressBulkRequest addressRequest) [CLASS] class AddressService extends BaseNodeAddressService [METRICS] loc=26 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] String getHistoryNodeHttpAddress(); voi...
/* static context [FOCAL] public AddressesExistsResponse AddressService.addressesCheckExistenceAndRequestHistoryNode(AddressBulkRequest addressRequest) [PATH1] if(!addressHashes.isEmpty())=T -> return new AddressesExistsResponse(addressHashToFoundStatusMap) [PATH2] if(!addressHashes.isEmpty())=F -> return new Addresses...
/* static context [FOCAL] public AddressesExistsResponse AddressService.addressesCheckExistenceAndRequestHistoryNode(AddressBulkRequest addressRequest) [PATH1] if(!addressHashes.isEmpty())=T -> return new AddressesExistsResponse(addressHashToFoundStatusMap) [PATH2] if(!addressHashes.isEmpty())=F -> return new Addresses...
true
ok
{"focal": {"class": "AddressService", "name": "addressesCheckExistenceAndRequestHistoryNode", "signature": "AddressesExistsResponse addressesCheckExistenceAndRequestHistoryNode(AddressBulkRequest addressRequest)", "start_line": 3, "modifiers": "public", "params": [{"name": "addressRequest", "type": "AddressBulkRequest"...
147968892_2
class BucketBehaviorEventsService implements IBucketEventService<BehaviorEventsData, BucketBehaviorEventsData> { @Override public double getBucketSumScore(BucketBehaviorEventsData bucketBehaviorEventsData) { BucketBehaviorEventsCalculator bucketCalculator = new BucketBehaviorEventsCalculator(bucketBeha...
addBehaviorEvents(); for (int i = 0; i < 8; i++) { addFillingTheQuestionnaireEvent(UserType.MERCHANT); } for (int i = 0; i < 6; i++) { addFillingTheQuestionnaireEvent(UserType.MERCHANT); } double bucketSumScore = bucketBehaviorEventsService.getBu...
[FOCAL] @Override public double BucketBehaviorEventsService.getBucketSumScore(BucketBehaviorEventsData bucketBehaviorEventsData) [CLASS] class BucketBehaviorEventsService implements IBucketEventService<BehaviorEventsData, BucketBehaviorEventsData> [METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CA...
/* static context [FOCAL] @Override public double BucketBehaviorEventsService.getBucketSumScore(BucketBehaviorEventsData bucketBehaviorEventsData) [PATH1] if(bucketCalculator.decayScores(bucketBehaviorEventsData))=T -> return bucketCalculator.getBucketSumScore(bucketBehaviorEventsData) [PATH2] if(bucketCalculator.decay...
/* static context [FOCAL] @Override public double BucketBehaviorEventsService.getBucketSumScore(BucketBehaviorEventsData bucketBehaviorEventsData) [PATH1] if(bucketCalculator.decayScores(bucketBehaviorEventsData))=T -> return bucketCalculator.getBucketSumScore(bucketBehaviorEventsData) [PATH2] if(bucketCalculator.decay...
true
ok
{"focal": {"class": "BucketBehaviorEventsService", "name": "getBucketSumScore", "signature": "double getBucketSumScore(BucketBehaviorEventsData bucketBehaviorEventsData)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "bucketBehaviorEventsData", "type": "BucketBehaviorEventsData"}], "return_type...
147984736_17
class CategoryServiceImpl implements CategoryService { @Override @LogMethod("添加收益分类") public Category appendCategory(String userId, String name) { AssertUtils.throwIf(exists(userId, name), BeeErrorConsts.CATEGORY_EXISTS); Category category = new Category(); category.setCreateTime(Sy...
Assert.assertNotNull(categoryService.appendCategory(getUser().getId(), RandomUtil.randomString(6))); } }
[FOCAL] @Override @LogMethod("添加收益分类") public Category CategoryServiceImpl.appendCategory(String userId, String name) [CLASS] class CategoryServiceImpl implements CategoryService [METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] boolean exists(String userId, String name) [CALLS-EXTE...
/* static context [FOCAL] @Override @LogMethod("添加收益分类") public Category CategoryServiceImpl.appendCategory(String userId, String name) [COLLABORATORS] field categoryDAO save/1 [CALLS-INTERNAL] boolean exists(String userId, String name) [NEW] Category [CALLS-EXTERNAL] AssertUtils.throwIf/2, Category.setCreateTime/1, Sy...
/* static context [FOCAL] @Override @LogMethod("添加收益分类") public Category CategoryServiceImpl.appendCategory(String userId, String name) [COLLABORATORS] field categoryDAO save/1 [CALLS-INTERNAL] boolean exists(String userId, String name) [NEW] Category [CALLS-EXTERNAL] AssertUtils.throwIf/2, Category.setCreateTime/1, Sy...
true
ok
{"focal": {"class": "CategoryServiceImpl", "name": "appendCategory", "signature": "Category appendCategory(String userId, String name)", "start_line": 3, "modifiers": "@Override @LogMethod(\"添加收益分类\") public", "params": [{"name": "userId", "type": "String"}, {"name": "name", "type": "String"}], "return_type": "Category...
147999347_5
class ObjectiveC extends AbstractLanguage { @Nonnull @Override public String[] getFileSuffixes() { String[] suffixes = filterEmptyStrings(configuration.getStringArray(ObjectiveCPlugin.FILE_SUFFIXES_KEY)); if (suffixes.length == 0) { suffixes = StringUtils.split(ObjectiveCPlugin....
String[] languageSuffixes = {"h", "m"}; settings.setProperty(ObjectiveCPlugin.FILE_SUFFIXES_KEY, languageSuffixes); String[] actual = language.getFileSuffixes(); assertEquals(languageSuffixes, actual); } }
[FOCAL] @Nonnull @Override public String[] ObjectiveC.getFileSuffixes() [CLASS] class ObjectiveC extends AbstractLanguage [METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] String[] filterEmptyStrings(String[] suffixes) [CALLS-EXTERNAL] configuration.getStringArray/1, StringUtils.spli...
/* static context [FOCAL] @Nonnull @Override public String[] ObjectiveC.getFileSuffixes() [PATH1] if(suffixes.length == 0)=T -> return suffixes [PATH2] if(suffixes.length == 0)=F -> return suffixes [COLLABORATORS] field configuration getStringArray/1 [CALLS-INTERNAL] String[] filterEmptyStrings(String[] suffixes) [CALL...
/* static context [FOCAL] @Nonnull @Override public String[] ObjectiveC.getFileSuffixes() [PATH1] if(suffixes.length == 0)=T -> return suffixes [PATH2] if(suffixes.length == 0)=F -> return suffixes [COLLABORATORS] field configuration getStringArray/1 [CALLS-INTERNAL] String[] filterEmptyStrings(String[] suffixes) [CALL...
true
ok
{"focal": {"class": "ObjectiveC", "name": "getFileSuffixes", "signature": "String[] getFileSuffixes()", "start_line": 3, "modifiers": "@Nonnull @Override public", "params": [], "return_type": "String[]"}, "class_info": {"name": "ObjectiveC", "kind": "class", "modifiers": "", "superclass": "AbstractLanguage", "interface...
148116142_74
class MutableInt extends Number implements Comparable<MutableInt>, Mutable<Number> { @Override public Integer getValue() { return Integer.valueOf(value); } public MutableInt(); public MutableInt(int value); public MutableInt(Number value); public MutableInt(String value); @Override public void setValue...
MutableInt i = new MutableInt("1"); assertTrue(i.getValue() == 1); } }
[FOCAL] @Override public Integer MutableInt.getValue() [CLASS] class MutableInt extends Number implements Comparable<MutableInt>, Mutable<Number> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Integer.valueOf/1 [CLASS-MEMBERS] MutableInt(); MutableInt(int value); MutableInt(Number...
/* static context [FOCAL] @Override public Integer MutableInt.getValue() [CALLS-EXTERNAL] Integer.valueOf/1 */
/* static context [FOCAL] @Override public Integer MutableInt.getValue() [CALLS-EXTERNAL] Integer.valueOf/1 */ class MutableInt extends Number implements Comparable<MutableInt>, Mutable<Number> { @Override public Integer getValue() { return Integer.valueOf(value); } public MutableInt(); public MutableInt(int...
true
ok
{"focal": {"class": "MutableInt", "name": "getValue", "signature": "Integer getValue()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Integer"}, "class_info": {"name": "MutableInt", "kind": "class", "modifiers": "", "superclass": "Number", "interfaces": "Comparable<MutableInt>, Mutabl...
148428318_2
class DataTypeUtils { public static TypeInformation convertToArray(String arrayTypeString) { Matcher matcher = matchCompositeType(arrayTypeString); final String errorMsg = arrayTypeString + "convert to array type error!"; Preconditions.checkState(matcher.find(), errorMsg); String ...
String[] normalFieldNames = new String[] { "id", "name" }; TypeInformation[] normalTypes = new TypeInformation[] {Types.INT(), Types.STRING()}; RowTypeInfo rowTypeInfo = new RowTypeInfo(normalTypes, normalFieldNames); TypeInformation normalAtomicType = Types.OBJECT_ARRAY(Types.STRING());...
[FOCAL] public static TypeInformation DataTypeUtils.convertToArray(String arrayTypeString) [CLASS] class DataTypeUtils [METRICS] loc=19 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] Matcher matchCompositeType(String s); RowTypeInfo convertToRow(String rowTypeString); String normalizeType(String ...
/* static context [FOCAL] public static TypeInformation DataTypeUtils.convertToArray(String arrayTypeString) [PATH1] if(normalizedElementType.startsWith(ROW))=T -> return Types.OBJECT_ARRAY(elementType) [PATH2] if(normalizedElementType.startsWith(ROW))=F -> return Types.OBJECT_ARRAY(elementType) [INPUTS] branches=array...
/* static context [FOCAL] public static TypeInformation DataTypeUtils.convertToArray(String arrayTypeString) [PATH1] if(normalizedElementType.startsWith(ROW))=T -> return Types.OBJECT_ARRAY(elementType) [PATH2] if(normalizedElementType.startsWith(ROW))=F -> return Types.OBJECT_ARRAY(elementType) [INPUTS] branches=array...
true
ok
{"focal": {"class": "DataTypeUtils", "name": "convertToArray", "signature": "TypeInformation convertToArray(String arrayTypeString)", "start_line": 3, "modifiers": "public static", "params": [{"name": "arrayTypeString", "type": "String"}], "return_type": "TypeInformation"}, "class_info": {"name": "DataTypeUtils", "kind...
148473211_2
class Devon4jPackage { public static Devon4jPackage of(String root, String application, String component, String layer, String scope, String detail) { String[] roots; if (root == null) { roots = new String[0]; } else { roots = root.split(REGEX_PKG_SEPARATOR); } String[] details...
Assertions.assertThrows(IllegalArgumentException.class, () -> { String packageName = "...batch.api.impl"; Devon4jPackage.of(packageName); }); } }
[FOCAL] public static Devon4jPackage Devon4jPackage.of(String root, String application, String component, String layer, String scope, String detail) [CLASS] class Devon4jPackage [METRICS] loc=25 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] String.split/1, System.arraycopy/5 [NEW] Devon4jPackage...
/* static context [FOCAL] public static Devon4jPackage Devon4jPackage.of(String root, String application, String component, String layer, String scope, String detail) [PATH1] if(root == null)=T -> if(detail == null)=T -> return new Devon4jPackage(null, segments, root, detail, (i - 1)) [PATH2] if(root == null)=F -> if(d...
/* static context [FOCAL] public static Devon4jPackage Devon4jPackage.of(String root, String application, String component, String layer, String scope, String detail) [PATH1] if(root == null)=T -> if(detail == null)=T -> return new Devon4jPackage(null, segments, root, detail, (i - 1)) [PATH2] if(root == null)=F -> if(d...
true
ok
{"focal": {"class": "Devon4jPackage", "name": "of", "signature": "Devon4jPackage of(String root, String application, String component, String layer, String scope, String detail)", "start_line": 3, "modifiers": "public static", "params": [{"name": "root", "type": "String"}, {"name": "application", "type": "String"}, {"n...
148480967_24
class Workbench extends Control { public final WorkbenchDialog showDialog(WorkbenchDialog dialog) { DialogControl dialogControl = dialog.getDialogControl(); dialogControl.setWorkbench(this); showOverlay(dialogControl, dialog.isBlocking()); return dialog; } public Workbench(); private Workben...
robot.interact(() -> { when(mockDialog.isBlocking()).thenReturn(true); assertDialogNotShown(); WorkbenchDialog result = workbench.showDialog(mockDialog); assertDialogShown(result, true); verify(mockDialog, atLeastOnce()).isBlocking(); // call showOverlay(...) inside showDialog() ...
[FOCAL] public final WorkbenchDialog Workbench.showDialog(WorkbenchDialog dialog) [CLASS] class Workbench extends Control [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] boolean showOverlay(Region overlay, boolean blocking) [CALLS-EXTERNAL] WorkbenchDialog.getDialogControl/0, Dialo...
class Workbench extends Control { public final WorkbenchDialog showDialog(WorkbenchDialog dialog) { DialogControl dialogControl = dialog.getDialogControl(); dialogControl.setWorkbench(this); showOverlay(dialogControl, dialog.isBlocking()); return dialog; } public Workbench(); private Workben...
false
ok
{"focal": {"class": "Workbench", "name": "showDialog", "signature": "WorkbenchDialog showDialog(WorkbenchDialog dialog)", "start_line": 3, "modifiers": "public final", "params": [{"name": "dialog", "type": "WorkbenchDialog"}], "return_type": "WorkbenchDialog"}, "class_info": {"name": "Workbench", "kind": "class", "modi...
148614148_0
class CommandQueue { public void sendEvent(@Nonnull final T event) { if(event == null) { throw new IllegalArgumentException("Null value is not allowed as an event"); } if(!canEmitEvents()) { if(limit == -1 || queuedEvents.size() < limit) { // drop new events that don...
CommandQueue<Void> queue = new CommandQueue<>(); try { queue.sendEvent(null); Assert.fail(); } catch(IllegalArgumentException e) { // OK! } } }
[FOCAL] public void CommandQueue.sendEvent(T event) [CLASS] class CommandQueue [METRICS] loc=12 cc=4 branches=3 loops=0 returns=0 throws=1 nesting=2 [CALLS-INTERNAL] boolean canEmitEvents(); void sendCommandToReceiver(Receiver<T> receiver, T event) [CALLS-EXTERNAL] queuedEvents.size/0, queuedEvents.add/1 [NEW] IllegalA...
/* static context [FOCAL] public void CommandQueue.sendEvent(T event) [THROWS-WHEN] IllegalArgumentException when event == null [PATH1] if(event == null)=F -> if(!canEmitEvents())=T -> if(limit == -1 || queuedEvents.size() < limit)=T [PATH2] if(event == null)=T -> throw new IllegalArgumentException("Null value is not a...
/* static context [FOCAL] public void CommandQueue.sendEvent(T event) [THROWS-WHEN] IllegalArgumentException when event == null [PATH1] if(event == null)=F -> if(!canEmitEvents())=T -> if(limit == -1 || queuedEvents.size() < limit)=T [PATH2] if(event == null)=T -> throw new IllegalArgumentException("Null value is not a...
true
ok
{"focal": {"class": "CommandQueue", "name": "sendEvent", "signature": "void sendEvent(T event)", "start_line": 3, "modifiers": "public", "params": [{"name": "event", "type": "T"}], "return_type": "void"}, "class_info": {"name": "CommandQueue", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "f...
148617498_16
class ConsulConfigSource extends EnabledConfigSource { @Override public String getValue(String key) { if (key.startsWith(KEY_PREFIX)) { // in case we are about to configure ourselves we simply ignore that key return null; } TimedEntry entry = cache.get(k...
GetValue value = new GetValue(); value.setValue(Base64.getEncoder().encodeToString("hello".getBytes())); when(configSource.client.getKVValue(anyString())).thenReturn(new Response<GetValue>(value, 0L, true, 0L)); assertEquals("hello", configSource.getValue("test")); } }
[FOCAL] @Override public String ConsulConfigSource.getValue(String key) [CLASS] class ConsulConfigSource extends EnabledConfigSource [METRICS] loc=30 cc=6 branches=4 loops=0 returns=5 throws=0 nesting=3 [CALLS-INTERNAL] ConsulClient getClient(); String getPrefix() [CALLS-EXTERNAL] String.startsWith/1, cache.get/1, Time...
/* static context [FOCAL] @Override public String ConsulConfigSource.getValue(String key) [PATH1] if(key.startsWith(KEY_PREFIX))=F -> if(entry == null || entry.isExpired())=T -> try-body throws -> if(entry != null)=F -> if(value == null)=T -> return null [PATH2] if(key.startsWith(KEY_PREFIX))=F -> if(entry == null || e...
/* static context [FOCAL] @Override public String ConsulConfigSource.getValue(String key) [PATH1] if(key.startsWith(KEY_PREFIX))=F -> if(entry == null || entry.isExpired())=T -> try-body throws -> if(entry != null)=F -> if(value == null)=T -> return null [PATH2] if(key.startsWith(KEY_PREFIX))=F -> if(entry == null || e...
true
ok
{"focal": {"class": "ConsulConfigSource", "name": "getValue", "signature": "String getValue(String key)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "key", "type": "String"}], "return_type": "String"}, "class_info": {"name": "ConsulConfigSource", "kind": "class", "modifiers": "", "superclass"...
148707832_1
class App { public static String sha256hex(String input) { return DigestUtils.sha256Hex(input); } public static void main(String[] args); private String INPUT; } class AppTest { private String INPUT; @Test public void testHex() {
String expected = "8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92"; Assert.assertEquals(expected, App.sha256hex(INPUT)); } }
[FOCAL] public static String App.sha256hex(String input) [CLASS] class App [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] DigestUtils.sha256Hex/1 [INPUTS] branches=- | result=input [DATAFLOW] input@param->L2 [CLASS-MEMBERS] void main(String[] args) [TEST] AppTest: @Test public voi...
/* static context [FOCAL] public static String App.sha256hex(String input) [INPUTS] branches=- | result=input [CALLS-EXTERNAL] DigestUtils.sha256Hex/1 */
/* static context [FOCAL] public static String App.sha256hex(String input) [INPUTS] branches=- | result=input [CALLS-EXTERNAL] DigestUtils.sha256Hex/1 */ class App { public static String sha256hex(String input) { return DigestUtils.sha256Hex(input); } public static void main(String[] args); p...
true
ok
{"focal": {"class": "App", "name": "sha256hex", "signature": "String sha256hex(String input)", "start_line": 3, "modifiers": "public static", "params": [{"name": "input", "type": "String"}], "return_type": "String"}, "class_info": {"name": "App", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null,...
148862443_2
class HibernateUtils { public static SessionFactory getSessionFactory(@NonNull MetadataSources sources) { try { Metadata metadata = sources.getMetadataBuilder().build(); return metadata.getSessionFactoryBuilder().build(); } catch (Exception e) { if (sources.getServiceRegistry() != null) { ...
StandardServiceRegistry serviceRegistry = getServiceRegistry(); when(sources.getMetadataBuilder()).thenThrow(new RuntimeException()); assertThrows(RuntimeException.class, () -> HibernateUtils.getSessionFactory(sources)); assertTrue(((StandardServiceRegistryImpl) serviceRegistry).isActive()); when(s...
[FOCAL] public static SessionFactory HibernateUtils.getSessionFactory(MetadataSources sources) [CLASS] class HibernateUtils [METRICS] loc=11 cc=3 branches=1 loops=0 returns=1 throws=1 nesting=2 [CALLS-EXTERNAL] sources.getMetadataBuilder().build/0, MetadataSources.getMetadataBuilder/0, metadata.getSessionFactoryBuilder...
/* static context [FOCAL] public static SessionFactory HibernateUtils.getSessionFactory(MetadataSources sources) [THROWS-WHEN] e when try-body throws && sources.getServiceRegistry() != null [THROWS-WHEN] e when try-body throws && !(sources.getServiceRegistry() != null) [PATH1] try-body throws -> if(sources.getServiceRe...
/* static context [FOCAL] public static SessionFactory HibernateUtils.getSessionFactory(MetadataSources sources) [THROWS-WHEN] e when try-body throws && sources.getServiceRegistry() != null [THROWS-WHEN] e when try-body throws && !(sources.getServiceRegistry() != null) [PATH1] try-body throws -> if(sources.getServiceRe...
true
ok
{"focal": {"class": "HibernateUtils", "name": "getSessionFactory", "signature": "SessionFactory getSessionFactory(MetadataSources sources)", "start_line": 3, "modifiers": "public static", "params": [{"name": "sources", "type": "MetadataSources"}], "return_type": "SessionFactory"}, "class_info": {"name": "HibernateUtils...
148886237_185
class ListMailResources implements AdminCommand { public void execute(AdminCommandContext context) { final ActionReport report = context.getActionReport(); try { List<String> list = new ArrayList<String>(); Collection<MailResource> mailResources = domai...
createMailResource(); parameters = new ParameterMap(); org.glassfish.resources.mail.admin.cli.ListMailResources listCommand = habitat.getService(org.glassfish.resources.mail.admin.cli.ListMailResources.class); cr.getCommandInvocation("list-mail-resources", context.getActionReport(), adm...
[FOCAL] public void ListMailResources.execute(AdminCommandContext context) [CLASS] class ListMailResources implements AdminCommand [METRICS] loc=29 cc=5 branches=1 loops=2 returns=0 throws=0 nesting=3 [CALLS-EXTERNAL] AdminCommandContext.getActionReport/0, domain.getResources().getResources/1, domain.getResources/0, bi...
/* static context [FOCAL] public void ListMailResources.execute(AdminCommandContext context) [PATH1] foreach(MailResource mailResource : mailResources)=T -> if(bindableResourcesHelper.resourceExists(mailResource.getJndiName(), targetOperand))=T -> exit loop -> foreach(String jndiName : list)=F [PATH2] foreach(MailResou...
/* static context [FOCAL] public void ListMailResources.execute(AdminCommandContext context) [PATH1] foreach(MailResource mailResource : mailResources)=T -> if(bindableResourcesHelper.resourceExists(mailResource.getJndiName(), targetOperand))=T -> exit loop -> foreach(String jndiName : list)=F [PATH2] foreach(MailResou...
true
ok
{"focal": {"class": "ListMailResources", "name": "execute", "signature": "void execute(AdminCommandContext context)", "start_line": 3, "modifiers": "public", "params": [{"name": "context", "type": "AdminCommandContext"}], "return_type": "void"}, "class_info": {"name": "ListMailResources", "kind": "class", "modifiers": ...
148915786_0
class Slugifier { public static String run(String text) { if (text == null || text.length() == 0) { return ""; } String toReturn = ""; try { String normalizedText = normalize(text); normalizedText = normalizedText.replaceAll("[^\\w\\s\\-]", ""); ...
String slugifiedText = Slugifier.run("Lenovo Y520 i7-7700HQ 16GB 1TB+256SSD GTX1050 Win10 80WK004JTX"); assertEquals("", slugifiedText); } }
[FOCAL] public static String Slugifier.run(String text) [CLASS] class Slugifier [METRICS] loc=18 cc=3 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] String normalize(String input) [CALLS-EXTERNAL] String.length/0, String.replaceAll/2, String.toLowerCase/0, URLEncoder.encode/2, LOGGER.log/3 [EXCEPTIONS...
/* static context [FOCAL] public static String Slugifier.run(String text) [PATH1] if(text == null || text.length() == 0)=F -> try-body throws -> return toReturn [PATH2] if(text == null || text.length() == 0)=T -> return "" [INPUTS] branches=text | result=text [EXCEPTIONS] catches UnsupportedEncodingException e [CALLS-I...
/* static context [FOCAL] public static String Slugifier.run(String text) [PATH1] if(text == null || text.length() == 0)=F -> try-body throws -> return toReturn [PATH2] if(text == null || text.length() == 0)=T -> return "" [INPUTS] branches=text | result=text [EXCEPTIONS] catches UnsupportedEncodingException e [CALLS-I...
true
ok
{"focal": {"class": "Slugifier", "name": "run", "signature": "String run(String text)", "start_line": 3, "modifiers": "public static", "params": [{"name": "text", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Slugifier", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "...
148918310_11
class JsdUtil { static String flipName(String name) { int i = name.lastIndexOf('$'); if (i != -1) name = name.replace('$', '-'); else if ((i = name.lastIndexOf('-')) != -1) name = name.replace('-', '$'); else i = name.lastIndexOf('.'); return i == -1 ? Strings.flipFirstCap(name...
assertEquals("Cat", JsdUtil.flipName("cat")); assertEquals("Cat", JsdUtil.flipName("cat")); assertEquals("Cat", JsdUtil.flipName("cat")); assertEquals("CAT", JsdUtil.flipName("CAT")); assertEquals("CAT", JsdUtil.flipName("CAT")); assertEquals("CAT", JsdUtil.flipName("CAT")); assertEquals("...
[FOCAL] static String JsdUtil.flipName(String name) [CLASS] class JsdUtil [METRICS] loc=11 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] String.lastIndexOf/1, String.replace/2, Strings.flipFirstCap/1, String.substring/2, String.substring/1 [PATH1] if(i != -1)=F -> if((i = name.lastIndexOf('-')) ...
/* static context [FOCAL] static String JsdUtil.flipName(String name) [PATH1] if(i != -1)=F -> if((i = name.lastIndexOf('-')) != -1)=T -> return i == -1 ? Strings.flipFirstCap(name) : name.substring(0, i + 1) + S... [PATH2] if(i != -1)=T -> return i == -1 ? Strings.flipFirstCap(name) : name.substring(0, i + 1) + S... [...
/* static context [FOCAL] static String JsdUtil.flipName(String name) [PATH1] if(i != -1)=F -> if((i = name.lastIndexOf('-')) != -1)=T -> return i == -1 ? Strings.flipFirstCap(name) : name.substring(0, i + 1) + S... [PATH2] if(i != -1)=T -> return i == -1 ? Strings.flipFirstCap(name) : name.substring(0, i + 1) + S... [...
true
ok
{"focal": {"class": "JsdUtil", "name": "flipName", "signature": "String flipName(String name)", "start_line": 3, "modifiers": "static", "params": [{"name": "name", "type": "String"}], "return_type": "String"}, "class_info": {"name": "JsdUtil", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "f...
149088809_1
class Exchange implements Comparable<Exchange> { private Exchange(String name, boolean future, ZoneId zoneId, LocalTime[] marketTimes) { this.name = name; this.future = future; this.zoneId = zoneId; this.zoneOffset = LocalDateTime.now().atZone(zoneId).getOffset(); this.marke...
Exchangeable rm907 = Exchangeable.fromString("RM907"); assertTrue(rm907.exchange()==Exchange.CZCE); } }
[FOCAL] private Exchange.Exchange(String name, boolean future, ZoneId zoneId, LocalTime[] marketTimes) [CLASS] class Exchange implements Comparable<Exchange> [METRICS] loc=13 cc=3 branches=0 loops=2 returns=0 throws=0 nesting=2 [CALLS-EXTERNAL] LocalDateTime.now().atZone(zoneId).getOffset/0, LocalDateTime.now().atZone/...
/* static context [FOCAL] private Exchange.Exchange(String name, boolean future, ZoneId zoneId, LocalTime[] marketTimes) [PATH1] foreach(ExchangeContract contract : ExchangeContract.getContracts(name))=T -> foreach(String commodity : contract.getCommodities())=F -> exit loop [PATH2] foreach(ExchangeContract contract : ...
/* static context [FOCAL] private Exchange.Exchange(String name, boolean future, ZoneId zoneId, LocalTime[] marketTimes) [PATH1] foreach(ExchangeContract contract : ExchangeContract.getContracts(name))=T -> foreach(String commodity : contract.getCommodities())=F -> exit loop [PATH2] foreach(ExchangeContract contract : ...
true
ok
{"focal": {"class": "Exchange", "name": "Exchange", "signature": "Exchange(String name, boolean future, ZoneId zoneId, LocalTime[] marketTimes)", "start_line": 3, "modifiers": "private", "params": [{"name": "name", "type": "String"}, {"name": "future", "type": "boolean"}, {"name": "zoneId", "type": "ZoneId"}, {"name": ...
149123005_31
class Network { public void registerTask(final Runnable task, int startAt, TN fromNode) { Task<TN> sw = new Task<>(task); msgs.addMsg(new Envelope.SingleDestEnvelope<>(sw, fromNode, fromNode, time, startAt)); } public static BitSet chooseBadNodes(Random rd, int nodeCount, int nodesDown); public BitSet...
AtomicBoolean ab = new AtomicBoolean(); network.registerTask(() -> ab.set(true), 100, n0); network.runMs(99); Assert.assertFalse(ab.get()); network.runMs(1); Assert.assertTrue(ab.get()); Assert.assertEquals(0, network.msgs.size()); } }
[FOCAL] public void Network.registerTask(Runnable task, int startAt, TN fromNode) [CLASS] class Network [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] msgs.addMsg/1 [NEW] Task<>, Envelope.SingleDestEnvelope<> [COLLABORATORS] field msgs addMsg/1 [DATAFLOW] fromNode@param->L3; start...
/* static context [FOCAL] public void Network.registerTask(Runnable task, int startAt, TN fromNode) [COLLABORATORS] field msgs addMsg/1 [NEW] Task<>, Envelope.SingleDestEnvelope<> [CALLS-EXTERNAL] msgs.addMsg/1 */
/* static context [FOCAL] public void Network.registerTask(Runnable task, int startAt, TN fromNode) [COLLABORATORS] field msgs addMsg/1 [NEW] Task<>, Envelope.SingleDestEnvelope<> [CALLS-EXTERNAL] msgs.addMsg/1 */ class Network { public void registerTask(final Runnable task, int startAt, TN fromNode) { Task<TN> ...
true
ok
{"focal": {"class": "Network", "name": "registerTask", "signature": "void registerTask(Runnable task, int startAt, TN fromNode)", "start_line": 3, "modifiers": "public", "params": [{"name": "task", "type": "Runnable"}, {"name": "startAt", "type": "int"}, {"name": "fromNode", "type": "TN"}], "return_type": "void"}, "cla...
149263873_29
class RequerySetupUtils { @Nonnull public static EntityDataStore<Object> getDataStore() { SchemaModifier schemaModifier = new SchemaModifier(configuration); schemaModifier.createTables(TableCreationMode.CREATE_NOT_EXISTS); return new EntityDataStore<>(configuration); } @Nonnu...
EntityDataStore<Object> ds = RequerySetupUtils.getDataStore(); TagType tagType = randomTagType(); TagValue tagValue = randomTagValue(tagType); ds.insert(tagType); TagType retrieved = ds.findByKey(TagType.class, tagType.getTagTypeId()); assertEquals(tagType.getTagTypeId(...
[FOCAL] @Nonnull public static EntityDataStore<Object> RequerySetupUtils.getDataStore() [CLASS] class RequerySetupUtils [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] SchemaModifier.createTables/1 [NEW] SchemaModifier, EntityDataStore<> [DATAFLOW] schemaModifier@L4->L5 [CLASS-MEMB...
/* static context [FOCAL] @Nonnull public static EntityDataStore<Object> RequerySetupUtils.getDataStore() [NEW] SchemaModifier, EntityDataStore<> [CALLS-EXTERNAL] SchemaModifier.createTables/1 */
/* static context [FOCAL] @Nonnull public static EntityDataStore<Object> RequerySetupUtils.getDataStore() [NEW] SchemaModifier, EntityDataStore<> [CALLS-EXTERNAL] SchemaModifier.createTables/1 */ class RequerySetupUtils { @Nonnull public static EntityDataStore<Object> getDataStore() { SchemaModifier s...
true
ok
{"focal": {"class": "RequerySetupUtils", "name": "getDataStore", "signature": "EntityDataStore<Object> getDataStore()", "start_line": 3, "modifiers": "@Nonnull public static", "params": [], "return_type": "EntityDataStore<Object>"}, "class_info": {"name": "RequerySetupUtils", "kind": "class", "modifiers": "", "supercla...
149270308_1
class FlexboxLayout { void alignContent(double crossSize) { minCrossSize = 0; if (flexLines.size()==0)return; // if (flexLines.size() <= 1) { // if (flexLines.size() == 1) { // minCrossSize = flexLines.get(0).getMinCrossSize(); // } // return; ...
FlexboxLayout flexboxLayout = new FlexboxLayout(); flexboxLayout.setFlexDirection(FlexDirection.ROW); flexboxLayout.setFlexWrap(FlexWrap.WRAP); flexboxLayout.setAlignContent(AlignContent.FLEX_START); for (int i = 0; i < 3; i++) { DefaultFlexItem flexItemImpl = new Def...
[FOCAL] void FlexboxLayout.alignContent(double crossSize) [CLASS] class FlexboxLayout [METRICS] loc=61 cc=15 branches=2 loops=7 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] double getNewStartPosWithExtra(FlexLine flexLine, double crossStartPos, double extra); double getNewStartpossByAlignmentType(FlexLine flexLine, do...
/* static context [FOCAL] void FlexboxLayout.alignContent(double crossSize) [PATH1] if(flexLines.size()==0)=F -> foreach(FlexLine flexLine : flexLines)#1=T -> exit loop -> switch(alignContent)=case FLEX_START -> foreach(FlexLine flexLine : flexLines)#2=F [PATH3] if(flexLines.size()==0)=T -> return */
/* static context [FOCAL] void FlexboxLayout.alignContent(double crossSize) [PATH1] if(flexLines.size()==0)=F -> foreach(FlexLine flexLine : flexLines)#1=T -> exit loop -> switch(alignContent)=case FLEX_START -> foreach(FlexLine flexLine : flexLines)#2=F [PATH3] if(flexLines.size()==0)=T -> return */ class FlexboxLayou...
true
ok
{"focal": {"class": "FlexboxLayout", "name": "alignContent", "signature": "void alignContent(double crossSize)", "start_line": 3, "modifiers": "", "params": [{"name": "crossSize", "type": "double"}], "return_type": "void"}, "class_info": {"name": "FlexboxLayout", "kind": "class", "modifiers": "", "superclass": null, "i...
149281309_19
class QueryRequestNonPagedExecutor extends QueryRequestExecutor { @Override QueryResponse execute() { QueryResponse response = new QueryResponse(); List<PartitionResponse> result = new ArrayList<>(); for (Endpoint endpoint : queryRequest.getEndpoints()) { String host = endpo...
List<Endpoint> endpoints = new ArrayList<>(); SearchRequest searchRequest = mock(SearchRequest.class); Endpoint endpoint1 = mock(Endpoint.class); Endpoint endpoint2 = mock(Endpoint.class); endpoints.add(endpoint1); endpoints.add(endpoint2); LdapConnectionResult ld...
[FOCAL] @Override QueryResponse QueryRequestNonPagedExecutor.execute() [CLASS] class QueryRequestNonPagedExecutor extends QueryRequestExecutor [METRICS] loc=45 cc=5 branches=2 loops=1 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] RoundtripResult query(LdapConnection ldapConnection, String baseSearchPath) [CALLS-EXTERNA...
/* static context [FOCAL] @Override QueryResponse QueryRequestNonPagedExecutor.execute() [PATH1] foreach(Endpoint endpoint : queryRequest.getEndpoints())=T -> try-body throws -> if(!Utils.isEmpty(endpoint.getSecondaryHost()))=T -> exit loop -> return response [PATH2] foreach(Endpoint endpoint : queryRequest.getEndpoint...
/* static context [FOCAL] @Override QueryResponse QueryRequestNonPagedExecutor.execute() [PATH1] foreach(Endpoint endpoint : queryRequest.getEndpoints())=T -> try-body throws -> if(!Utils.isEmpty(endpoint.getSecondaryHost()))=T -> exit loop -> return response [PATH2] foreach(Endpoint endpoint : queryRequest.getEndpoint...
true
ok
{"focal": {"class": "QueryRequestNonPagedExecutor", "name": "execute", "signature": "QueryResponse execute()", "start_line": 3, "modifiers": "@Override", "params": [], "return_type": "QueryResponse"}, "class_info": {"name": "QueryRequestNonPagedExecutor", "kind": "class", "modifiers": "", "superclass": "QueryRequestExe...
149347972_9
class AppConfigBaseModel { public Object getCurrentValue(String value) { Method[] methods = getClass().getDeclaredMethods(); Object result = null; boolean foundMethod = false; for (Method method : methods) { String getMethod = "get" + value.substring(0, 1).to...
DerivedModelWithMethods model = new DerivedModelWithMethods(); model.setSimpleEnumField(SimpleEnum.Name); model.setComplexEnumField(ComplexEnum.Application); model.setStringField("Another test"); model.setLongField(92345); model.setIntField(-234); model.setBoolFie...
[FOCAL] public Object AppConfigBaseModel.getCurrentValue(String value) [CLASS] class AppConfigBaseModel [METRICS] loc=45 cc=9 branches=3 loops=2 returns=1 throws=0 nesting=4 [CALLS-EXTERNAL] getClass().getDeclaredMethods/0, getClass/0 (inherited), value.substring(0, 1).toUpperCase/0, String.substring/2, String.substrin...
/* static context [FOCAL] public Object AppConfigBaseModel.getCurrentValue(String value) [PATH1] foreach(Method method : methods)=T -> if(method.getName().equals(getMethod) || method.getName().equals(isMethod))=T -> try-body throws -> exit loop -> if(!foundMethod)=T -> foreach(Field field : fields)=T -> if(field.getNam...
/* static context [FOCAL] public Object AppConfigBaseModel.getCurrentValue(String value) [PATH1] foreach(Method method : methods)=T -> if(method.getName().equals(getMethod) || method.getName().equals(isMethod))=T -> try-body throws -> exit loop -> if(!foundMethod)=T -> foreach(Field field : fields)=T -> if(field.getNam...
true
ok
{"focal": {"class": "AppConfigBaseModel", "name": "getCurrentValue", "signature": "Object getCurrentValue(String value)", "start_line": 3, "modifiers": "public", "params": [{"name": "value", "type": "String"}], "return_type": "Object"}, "class_info": {"name": "AppConfigBaseModel", "kind": "class", "modifiers": "", "sup...
149351086_542
class VulnerabilityRepository implements Constants { public Map<String, Long> getNonProdInfoByEnv(String assetGroup, String severitylevel) { Map<String, Long> nonProdInfo = new HashMap<>(); StringBuilder urlToQuery = new StringBuilder(esUrl).append("/").append(assetGroup); urlToQuery.append("/").append(SEARCH)...
mockStatic(PacHttpUtils.class); when(PacHttpUtils.doHttpPost(anyString(), anyString())).thenThrow(new Exception()); ReflectionTestUtils.setField(vulnerabilityRepository, "esUrl", "dummyEsURL"); assertTrue(vulnerabilityRepository.getNonProdInfoByEnv("ag", "3").size() == 0); } }
[FOCAL] public Map<String, Long> VulnerabilityRepository.getNonProdInfoByEnv(String assetGroup, String severitylevel) [CLASS] class VulnerabilityRepository implements Constants [METRICS] loc=45 cc=3 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] new StringBuilder(esUrl).append("/").append/1, new Strin...
class VulnerabilityRepository implements Constants { public Map<String, Long> getNonProdInfoByEnv(String assetGroup, String severitylevel) { Map<String, Long> nonProdInfo = new HashMap<>(); StringBuilder urlToQuery = new StringBuilder(esUrl).append("/").append(assetGroup); urlToQuery.append("/").append(SEARCH)...
false
ok
{"focal": {"class": "VulnerabilityRepository", "name": "getNonProdInfoByEnv", "signature": "Map<String, Long> getNonProdInfoByEnv(String assetGroup, String severitylevel)", "start_line": 3, "modifiers": "public", "params": [{"name": "assetGroup", "type": "String"}, {"name": "severitylevel", "type": "String"}], "return_...
149579497_1
class JCTreeUtils { public boolean hasBody(final JCTree element) { Class bodyClass = JCTree.JCBlock.class; Class staClass = JCTree.JCStatement.class; Field[] declaredFields = element.getClass().getDeclaredFields(); return Arrays.stream(declaredFields) .filter(field ...
JCTree.JCBlock block = new JCTree.JCBlock(0, null) { }; class Method extends JCTree.JCMethodDecl { public Method(JCModifiers jcModifiers, Name name, JCExpression jcExpression, List<JCTypeParameter> list, JCVariableDecl jcVariableDecl, List<JCVariableDecl> list1, List<JCExpression> list2, JCBlock jcB...
[FOCAL] public boolean JCTreeUtils.hasBody(JCTree element) [CLASS] class JCTreeUtils [METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] element.getClass().getDeclaredFields/0, JCTree.getClass/0, Arrays.stream(declaredFields) .filter(field -> field.getN....isPresent/0, Arrays.stream(d...
/* static context [FOCAL] public boolean JCTreeUtils.hasBody(JCTree element) [INPUTS] branches=- | result=element [COLLABORATORS] param element:JCTree getClass/0; field field getName/0,getType/0 [CALLS-EXTERNAL] element.getClass().getDeclaredFields/0, JCTree.getClass/0, Arrays.stream(declaredFields) .filter(field -> fi...
/* static context [FOCAL] public boolean JCTreeUtils.hasBody(JCTree element) [INPUTS] branches=- | result=element [COLLABORATORS] param element:JCTree getClass/0; field field getName/0,getType/0 [CALLS-EXTERNAL] element.getClass().getDeclaredFields/0, JCTree.getClass/0, Arrays.stream(declaredFields) .filter(field -> fi...
true
ok
{"focal": {"class": "JCTreeUtils", "name": "hasBody", "signature": "boolean hasBody(JCTree element)", "start_line": 3, "modifiers": "public", "params": [{"name": "element", "type": "JCTree"}], "return_type": "boolean"}, "class_info": {"name": "JCTreeUtils", "kind": "class", "modifiers": "", "superclass": null, "interfa...
149598464_0
class StrUtil { public static String stringify(long byteNumber) { if (byteNumber / TB_IN_BYTES > 0) { return df.format((double) byteNumber / (double) TB_IN_BYTES) + "TB"; } else if (byteNumber / GB_IN_BYTES > 0) { return df.format((double) byteNumber / (double) GB_IN_BYTES) ...
assertEquals("1B", stringify(1)); assertEquals("1.00KB", stringify(1024)); assertEquals("1.00MB", stringify(1048576)); assertEquals("1.00GB", stringify(1073741824)); assertEquals("1.00TB", stringify(1099511627776L)); } }
[FOCAL] public static String StrUtil.stringify(long byteNumber) [CLASS] class StrUtil [METRICS] loc=13 cc=5 branches=4 loops=0 returns=5 throws=0 nesting=4 [CALLS-EXTERNAL] df.format/1, String.valueOf/1 [PATH1] if(byteNumber / TB_IN_BYTES > 0)=F -> if(byteNumber / GB_IN_BYTES > 0)=F -> if(byteNumber / MB_IN_BYTES > 0)=...
/* static context [FOCAL] public static String StrUtil.stringify(long byteNumber) [PATH1] if(byteNumber / TB_IN_BYTES > 0)=F -> if(byteNumber / GB_IN_BYTES > 0)=F -> if(byteNumber / MB_IN_BYTES > 0)=F -> if(byteNumber / KB_IN_BYTES > 0)=T -> return df.format((double) byteNumber / (double) KB_IN_BYTES) + "KB" [PATH2] if...
/* static context [FOCAL] public static String StrUtil.stringify(long byteNumber) [PATH1] if(byteNumber / TB_IN_BYTES > 0)=F -> if(byteNumber / GB_IN_BYTES > 0)=F -> if(byteNumber / MB_IN_BYTES > 0)=F -> if(byteNumber / KB_IN_BYTES > 0)=T -> return df.format((double) byteNumber / (double) KB_IN_BYTES) + "KB" [PATH2] if...
true
ok
{"focal": {"class": "StrUtil", "name": "stringify", "signature": "String stringify(long byteNumber)", "start_line": 3, "modifiers": "public static", "params": [{"name": "byteNumber", "type": "long"}], "return_type": "String"}, "class_info": {"name": "StrUtil", "kind": "class", "modifiers": "", "superclass": null, "inte...
149607740_66
class EmptyHeaders implements Headers<K, V, T> { @Override public V get(K name) { return null; } @Override public V get(K name, V defaultValue); @Override public V getAndRemove(K name); @Override public V getAndRemove(K name, V defaultValue); @Override public List<V> getAll(K name)...
assertNull(HEADERS.get("name1")); } }
[FOCAL] @Override public V EmptyHeaders.get(K name) [CLASS] class EmptyHeaders implements Headers<K, V, T> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [INPUTS] branches=- | result=- | unused=name [CLASS-MEMBERS] V get(K name, V defaultValue); V getAndRemove(K name); V getAndRemove(K name, V def...
/* static context [FOCAL] @Override public V EmptyHeaders.get(K name) [INPUTS] branches=- | result=- | unused=name */
/* static context [FOCAL] @Override public V EmptyHeaders.get(K name) [INPUTS] branches=- | result=- | unused=name */ class EmptyHeaders implements Headers<K, V, T> { @Override public V get(K name) { return null; } @Override public V get(K name, V defaultValue); @Override public V getAndRe...
true
ok
{"focal": {"class": "EmptyHeaders", "name": "get", "signature": "V get(K name)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "name", "type": "K"}], "return_type": "V"}, "class_info": {"name": "EmptyHeaders", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Headers<K, V, T>"...
149641877_6
class Publisher extends AbstractMojo { public void execute() throws MojoExecutionException { getLog().info("Starting Axway Publisher"); AxwayPublishingAdapter adapter = getAxwayPublishingAdapter(); PublicationReader publicationReader = getPublicationReader(); try { final...
final Publication publication = createPublication().setApis( Arrays.asList(new Api().setApiSpecification("api1").setApiConfig("config1"), new Api().setApiSpecification("spec2").setApiConfig("config2"), new Api().setApiSpecification("spec3").setApi...
[FOCAL] public void Publisher.execute() [CLASS] class Publisher extends AbstractMojo [METRICS] loc=16 cc=2 branches=0 loops=0 returns=0 throws=1 nesting=1 [CALLS-INTERNAL] AxwayPublishingAdapter getAxwayPublishingAdapter(); PublicationReader getPublicationReader(); String getStageConfigurationFile(); void initApis(List...
/* static context [FOCAL] public void Publisher.execute() [THROWS-WHEN] e when try-body throws [PATH1] try-body throws -> throw e [EXCEPTIONS] declares MojoExecutionException; throws throw e; catches AbstractPublishingPluginException e [CALLS-INTERNAL] AxwayPublishingAdapter getAxwayPublishingAdapter(); PublicationRead...
/* static context [FOCAL] public void Publisher.execute() [THROWS-WHEN] e when try-body throws [PATH1] try-body throws -> throw e [EXCEPTIONS] declares MojoExecutionException; throws throw e; catches AbstractPublishingPluginException e [CALLS-INTERNAL] AxwayPublishingAdapter getAxwayPublishingAdapter(); PublicationRead...
true
ok
{"focal": {"class": "Publisher", "name": "execute", "signature": "void execute() throws MojoExecutionException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "Publisher", "kind": "class", "modifiers": "", "superclass": "AbstractMojo", "interfaces": null, "fields":...
149663208_4
class CloudEventSerializer implements Serializer<CloudEvent> { @Override public void configure(Map<String, ?> configs, boolean isKey) { if (isKey) { throw new IllegalArgumentException("Cannot use CloudEventSerializer as key serializer"); } Object encodingConfig = configs.get...
CloudEventSerializer serializer = new CloudEventSerializer(); EventFormatProvider.getInstance().registerFormat(CSVFormat.INSTANCE); HashMap<String, Object> config = new HashMap<>(); config.put(CloudEventSerializer.ENCODING_CONFIG, "STRUCTURED"); config.put(CloudEventSerializer....
[FOCAL] @Override public void CloudEventSerializer.configure(Map<String, ?> configs, boolean isKey) [CLASS] class CloudEventSerializer implements Serializer<CloudEvent> [METRICS] loc=31 cc=10 branches=9 loops=0 returns=0 throws=5 nesting=3 [CALLS-EXTERNAL] Map<String, ?>.get/1, Encoding.valueOf/1, Encoding.class.getCan...
/* static context [FOCAL] @Override public void CloudEventSerializer.configure(Map<String, ?> configs, boolean isKey) [THROWS-WHEN] IllegalArgumentException when isKey [THROWS-WHEN] IllegalArgumentException when !isKey && encodingConfig instanceof String && this.encoding == Encoding.UNKNOWN [THROWS-WHEN] IllegalArgumen...
/* static context [FOCAL] @Override public void CloudEventSerializer.configure(Map<String, ?> configs, boolean isKey) [THROWS-WHEN] IllegalArgumentException when isKey [THROWS-WHEN] IllegalArgumentException when !isKey && encodingConfig instanceof String && this.encoding == Encoding.UNKNOWN [THROWS-WHEN] IllegalArgumen...
true
ok
{"focal": {"class": "CloudEventSerializer", "name": "configure", "signature": "void configure(Map<String, ?> configs, boolean isKey)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "configs", "type": "Map<String, ?>"}, {"name": "isKey", "type": "boolean"}], "return_type": "void"}, "class_info": ...
149708915_0
class PostService implements Service { private void getAllPosts(ServerRequest serverRequest, ServerResponse serverResponse) { serverResponse.send(EntityUtils.toJsonArray(this.posts.all())); } public PostService(PostRepository posts); @Override public void update(Routing.Rules rules); pri...
String path = "/posts"; WebTarget targetGetAll = client.target(URI.create("http://localhost:" + webServer.port() + path)); try (Response resGetAll = targetGetAll.request().accept(MediaType.APPLICATION_JSON_TYPE).get()) { assertEquals(200, resGetAll.getStatus()); List<Pos...
[FOCAL] private void PostService.getAllPosts(ServerRequest serverRequest, ServerResponse serverResponse) [CLASS] class PostService implements Service [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] ServerResponse.send/1, EntityUtils.toJsonArray/1, this.posts.all/0 [FIELDS] read=pos...
/* static context [FOCAL] private void PostService.getAllPosts(ServerRequest serverRequest, ServerResponse serverResponse) [INPUTS] branches=- | result=- | unused=serverRequest [COLLABORATORS] param serverResponse:ServerResponse send/1; field posts all/0 [FIELDS] read=posts [CALLS-EXTERNAL] ServerResponse.send/1, Entit...
/* static context [FOCAL] private void PostService.getAllPosts(ServerRequest serverRequest, ServerResponse serverResponse) [INPUTS] branches=- | result=- | unused=serverRequest [COLLABORATORS] param serverResponse:ServerResponse send/1; field posts all/0 [FIELDS] read=posts [CALLS-EXTERNAL] ServerResponse.send/1, Entit...
true
ok
{"focal": {"class": "PostService", "name": "getAllPosts", "signature": "void getAllPosts(ServerRequest serverRequest, ServerResponse serverResponse)", "start_line": 3, "modifiers": "private", "params": [{"name": "serverRequest", "type": "ServerRequest"}, {"name": "serverResponse", "type": "ServerResponse"}], "return_ty...
149732116_0
class ShopService { public List<Integer> getDelayMinutes() { return IntStream.range(0, MAX_INTERVAL_PERIODS) .map(period -> (period + 1) * DELAY_INTERVAL_MINUTES) .filter(this::isShopOpenInMinutes) .boxed() .collect(Collectors.toList()); } public Sh...
//when List<Integer> delayMinutes = shopService.getDelayMinutes(); //then assertTrue(delayMinutes.size() > 0); } }
[FOCAL] public List<Integer> ShopService.getDelayMinutes() [CLASS] class ShopService [METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] IntStream.range(0, MAX_INTERVAL_PERIODS) .map(period -> (....collect/1, IntStream.range(0, MAX_INTERVAL_PERIODS) .map(period -> (....boxed/0, IntStre...
/* static context [FOCAL] public List<Integer> ShopService.getDelayMinutes() [CALLS-EXTERNAL] IntStream.range(0, MAX_INTERVAL_PERIODS) .map(period -> (....collect/1, IntStream.range(0, MAX_INTERVAL_PERIODS) .map(period -> (....boxed/0, IntStream.range(0, MAX_INTERVAL_PERIODS) .map(period -> (....filter/1, IntStream.ran...
/* static context [FOCAL] public List<Integer> ShopService.getDelayMinutes() [CALLS-EXTERNAL] IntStream.range(0, MAX_INTERVAL_PERIODS) .map(period -> (....collect/1, IntStream.range(0, MAX_INTERVAL_PERIODS) .map(period -> (....boxed/0, IntStream.range(0, MAX_INTERVAL_PERIODS) .map(period -> (....filter/1, IntStream.ran...
true
ok
{"focal": {"class": "ShopService", "name": "getDelayMinutes", "signature": "List<Integer> getDelayMinutes()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<Integer>"}, "class_info": {"name": "ShopService", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [...
149851179_1
class JSONDataLoader { public ArrayList<Format> getFormats() throws IOException, JSONException { ArrayList<Format> formats = new ArrayList<>(); JSONObject jsonFormats = mLocalFileHelper.getJSONFormatsFile(); JSONArray formatData = jsonFormats.getJSONArray("data"); for (int i = 0; i ...
JSONDataLoader loader = new JSONDataLoader(helperMock); ArrayList<Format> formats = loader.getFormats(); assertNotNull(formats); assertEquals(5, formats.size()); Format format = formats.get(0); assertEquals(1, format.getId()); assertEquals("Standard", format.get...
[FOCAL] public ArrayList<Format> JSONDataLoader.getFormats() [CLASS] class JSONDataLoader [METRICS] loc=10 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] mLocalFileHelper.getJSONFormatsFile/0, JSONObject.getJSONArray/1, JSONArray.length/0, JSONArray.getJSONObject/1, ArrayList<Format>.add/1 [NEW] ...
/* static context [FOCAL] public ArrayList<Format> JSONDataLoader.getFormats() [PATH1] for(i < formatData.length())=T -> exit loop -> return formats [PATH2] for(i < formatData.length())=F -> return formats [COLLABORATORS] field mLocalFileHelper getJSONFormatsFile/0 [EXCEPTIONS] declares IOException, JSONException [NEW]...
/* static context [FOCAL] public ArrayList<Format> JSONDataLoader.getFormats() [PATH1] for(i < formatData.length())=T -> exit loop -> return formats [PATH2] for(i < formatData.length())=F -> return formats [COLLABORATORS] field mLocalFileHelper getJSONFormatsFile/0 [EXCEPTIONS] declares IOException, JSONException [NEW]...
true
ok
{"focal": {"class": "JSONDataLoader", "name": "getFormats", "signature": "ArrayList<Format> getFormats() throws IOException, JSONException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "ArrayList<Format>"}, "class_info": {"name": "JSONDataLoader", "kind": "class", "modifiers": "", "superclass":...
149970281_4
class Anime { public String getAnimeName() { return animeName; } public Anime(String animeDocument); private void setAnimeCover(); private void setAnimeName(); private void setAnimeDescription(); private void setAnimeEpisodeList(); public String getAnimeCover(); public Li...
assertThat(anime.getAnimeName().equals("One Piece"),is(true)); } }
[FOCAL] public String Anime.getAnimeName() [CLASS] class Anime [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Anime(String animeDocument); void setAnimeCover(); void setAnimeName(); void setAnimeDescription(); void setAnimeEpisodeList(); String getAnimeCover(); List<String> getAnim...
/* static context [FOCAL] public String Anime.getAnimeName() */
/* static context [FOCAL] public String Anime.getAnimeName() */ class Anime { public String getAnimeName() { return animeName; } public Anime(String animeDocument); private void setAnimeCover(); private void setAnimeName(); private void setAnimeDescription(); private void setAnim...
true
ok
{"focal": {"class": "Anime", "name": "getAnimeName", "signature": "String getAnimeName()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "Anime", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "anime", "type": "Anime...
150186815_7
class EventSourcedTopology { public static <K, C, E, A> InputStreams<K, C> addTopology(TopologyContext<K, C, E, A> ctx, final StreamsBuilder builder) { // Consume from topics final KStream<K, CommandRequest<K, C>> commandRequestStream = EventSourcedConsumer.commandRequestStream(ctx, builder); ...
TopologyContext<String, TestCommand, TestEvent, Optional<TestAggregate>> ctx = ctxBuilder.buildContext(); driver = new TestDriverInitializer().build(builder -> EventSourcedTopology.addTopology(ctx, builder)); TestContextDriver<String, TestCommand, TestEvent, Optional<TestAggregate>> ctxDriver =...
[FOCAL] public static InputStreams<K, C> EventSourcedTopology.addTopology(TopologyContext<K, C, E, A> ctx, StreamsBuilder builder) [CLASS] class EventSourcedTopology [METRICS] loc=34 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] DistributorContext<CommandId, CommandResponse<K>> getDistributorCon...
/* static context [FOCAL] public static InputStreams<K, C> EventSourcedTopology.addTopology(TopologyContext<K, C, E, A> ctx, StreamsBuilder builder) [INPUTS] branches=- | result=builder, ctx [CALLS-INTERNAL] DistributorContext<CommandId, CommandResponse<K>> getDistributorContext(TopologyContext<K, ?, ?, ?> ctx) [NEW] I...
/* static context [FOCAL] public static InputStreams<K, C> EventSourcedTopology.addTopology(TopologyContext<K, C, E, A> ctx, StreamsBuilder builder) [INPUTS] branches=- | result=builder, ctx [CALLS-INTERNAL] DistributorContext<CommandId, CommandResponse<K>> getDistributorContext(TopologyContext<K, ?, ?, ?> ctx) [NEW] I...
true
ok
{"focal": {"class": "EventSourcedTopology", "name": "addTopology", "signature": "InputStreams<K, C> addTopology(TopologyContext<K, C, E, A> ctx, StreamsBuilder builder)", "start_line": 3, "modifiers": "public static", "params": [{"name": "ctx", "type": "TopologyContext<K, C, E, A>"}, {"name": "builder", "type": "Stream...
150308585_73
class HostLogFilesRequestQueryConverter extends AbstractOperationHolderConverter<HostLogFilesRequest, SimpleFacetQuery> { @Override public SimpleFacetQuery convert(HostLogFilesRequest request) { SimpleFacetQuery facetQuery = new SimpleFacetQuery(); facetQuery.addCriteria(new SimpleStringCriteria(String.for...
// GIVEN HostLogFilesRequest request = new HostLogFilesQueryRequest(); request.setHostName("hostName"); request.setComponentName("componentName"); // WHEN SolrQuery query = new DefaultQueryParser().doConstructSolrQuery(underTest.convert(request)); // THEN assertEquals("?q=host%3A%28hostN...
[FOCAL] @Override public SimpleFacetQuery HostLogFilesRequestQueryConverter.convert(HostLogFilesRequest request) [CLASS] class HostLogFilesRequestQueryConverter extends AbstractOperationHolderConverter<HostLogFilesRequest, SimpleFacetQuery> [METRICS] loc=17 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EX...
/* static context [FOCAL] @Override public SimpleFacetQuery HostLogFilesRequestQueryConverter.convert(HostLogFilesRequest request) [PATH1] if(StringUtils.isNotEmpty(request.getComponentName()))=T -> return facetQuery [PATH2] if(StringUtils.isNotEmpty(request.getComponentName()))=F -> return facetQuery [INPUTS] branches...
/* static context [FOCAL] @Override public SimpleFacetQuery HostLogFilesRequestQueryConverter.convert(HostLogFilesRequest request) [PATH1] if(StringUtils.isNotEmpty(request.getComponentName()))=T -> return facetQuery [PATH2] if(StringUtils.isNotEmpty(request.getComponentName()))=F -> return facetQuery [INPUTS] branches...
true
ok
{"focal": {"class": "HostLogFilesRequestQueryConverter", "name": "convert", "signature": "SimpleFacetQuery convert(HostLogFilesRequest request)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "HostLogFilesRequest"}], "return_type": "SimpleFacetQuery"}, "class_info": {"name": "...
150309255_5
class TimelineWebServices { @GET @Produces({ MediaType.APPLICATION_JSON /* , MediaType.APPLICATION_XML */}) public AboutInfo about( @Context HttpServletRequest req, @Context HttpServletResponse res) { init(res); return new AboutInfo("AMS API"); } @Inject public TimelineWebServices(Timel...
WebResource r = resource(); ClientResponse response = r.path("ws").path("v1").path("timeline") .accept(MediaType.APPLICATION_JSON) .get(ClientResponse.class); assertEquals(MediaType.APPLICATION_JSON_TYPE, response.getType()); TimelineWebServices.AboutInfo about = response.getEntity(Tim...
[FOCAL] @GET @Produces({ MediaType.APPLICATION_JSON /* , MediaType.APPLICATION_XML */}) public AboutInfo TimelineWebServices.about(HttpServletRequest req, HttpServletResponse res) [CLASS] class TimelineWebServices [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] void init(HttpServle...
class TimelineWebServices { @GET @Produces({ MediaType.APPLICATION_JSON /* , MediaType.APPLICATION_XML */}) public AboutInfo about( @Context HttpServletRequest req, @Context HttpServletResponse res) { init(res); return new AboutInfo("AMS API"); } @Inject public TimelineWebServices(Timel...
false
ok
{"focal": {"class": "TimelineWebServices", "name": "about", "signature": "AboutInfo about(HttpServletRequest req, HttpServletResponse res)", "start_line": 3, "modifiers": "@GET @Produces({ MediaType.APPLICATION_JSON /* , MediaType.APPLICATION_XML */}) public", "params": [{"name": "req", "type": "HttpServletRequest"}, {...
150407753_2
class Item { public boolean collision(PaintView paintView) { return collision(paintView.getCircleX(), paintView.getCircleY(), paintView.getCircleRadius()); } Item(int posX, int posY, int radius); public int getX(); public int getY(); public int getRad...
SpeedupItem speedupItem = new SpeedupItem(0, 0, 10); assertThat(speedupItem.collision(21, 0, 10), is(false)); assertThat(speedupItem.collision(20, 0, 11), is(true)); } }
[FOCAL] public boolean Item.collision(PaintView paintView) [CLASS] class Item [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] boolean collision(int posX, int posY, int radius) [CALLS-EXTERNAL] PaintView.getCircleX/0, PaintView.getCircleY/0, PaintView.getCircleRadius/0 [INPUTS] bran...
/* static context [FOCAL] public boolean Item.collision(PaintView paintView) [INPUTS] branches=- | result=paintView [COLLABORATORS] param paintView:PaintView getCircleX/0,getCircleY/0,getCircleRadius/0 [CALLS-INTERNAL] boolean collision(int posX, int posY, int radius) [CALLS-EXTERNAL] PaintView.getCircleX/0, PaintView....
/* static context [FOCAL] public boolean Item.collision(PaintView paintView) [INPUTS] branches=- | result=paintView [COLLABORATORS] param paintView:PaintView getCircleX/0,getCircleY/0,getCircleRadius/0 [CALLS-INTERNAL] boolean collision(int posX, int posY, int radius) [CALLS-EXTERNAL] PaintView.getCircleX/0, PaintView....
true
ok
{"focal": {"class": "Item", "name": "collision", "signature": "boolean collision(PaintView paintView)", "start_line": 3, "modifiers": "public", "params": [{"name": "paintView", "type": "PaintView"}], "return_type": "boolean"}, "class_info": {"name": "Item", "kind": "class", "modifiers": "", "superclass": null, "interfa...
150411824_1
class PathParser { public static String[] parse(String path, ConfigOptions options) { return parse(path, options.getPathSeparator(), options.getKeyValidator()); } public static String[] parse(String path, char pathSeparator, Pattern keyValidator); } class PathParserTest { @Test public v...
String[] keys = PathParser.parse("root.parent.child", new ConfigOptions()); assertEquals(keys[0], "root"); assertEquals(keys[1], "parent"); assertEquals(keys[2], "child"); } }
[FOCAL] public static String[] PathParser.parse(String path, ConfigOptions options) [CLASS] class PathParser [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String[] parse(String path, char pathSeparator, Pattern keyValidator) [CALLS-EXTERNAL] ConfigOptions.getPathSeparator/0, Conf...
/* static context [FOCAL] public static String[] PathParser.parse(String path, ConfigOptions options) [INPUTS] branches=- | result=options, path [COLLABORATORS] param options:ConfigOptions getPathSeparator/0,getKeyValidator/0 [CALLS-INTERNAL] String[] parse(String path, char pathSeparator, Pattern keyValidator) [CALLS-...
/* static context [FOCAL] public static String[] PathParser.parse(String path, ConfigOptions options) [INPUTS] branches=- | result=options, path [COLLABORATORS] param options:ConfigOptions getPathSeparator/0,getKeyValidator/0 [CALLS-INTERNAL] String[] parse(String path, char pathSeparator, Pattern keyValidator) [CALLS-...
true
ok
{"focal": {"class": "PathParser", "name": "parse", "signature": "String[] parse(String path, ConfigOptions options)", "start_line": 3, "modifiers": "public static", "params": [{"name": "path", "type": "String"}, {"name": "options", "type": "ConfigOptions"}], "return_type": "String[]"}, "class_info": {"name": "PathParse...
150434337_86
class FMHMMListImp implements FMHMMList { public Map<Long, FMHMMNode> loopLoadForest(String cInputString) { Here: for (int i = StableData.INT_ZERO; i < cInputString.length(); i++) { if (linkedHashMap.containsKey(Long.valueOf(cInputString.charAt(i)))) { FMHMMNode fHHMMNode = linkedHashMap.get(Long.valueO...
fail("Not yet implemented"); } }
[FOCAL] public Map<Long, FMHMMNode> FMHMMListImp.loopLoadForest(String cInputString) [CLASS] class FMHMMListImp implements FMHMMList [METRICS] loc=20 cc=4 branches=2 loops=1 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] Map<Long, FMHMMNode> doNeroPostCognitive(FMHMMNode fFHMMNode, String cInputString, int i) [CALLS-EXT...
/* static context [FOCAL] public Map<Long, FMHMMNode> FMHMMListImp.loopLoadForest(String cInputString) [PATH1] for(i < cInputString.length())=T -> if(linkedHashMap.containsKey(Long.valueOf(cInputString.charAt(i))))=F -> if(i + StableData.INT_ONE < cInputString.length())=T -> exit loop -> return linkedHashMap [PATH2] fo...
/* static context [FOCAL] public Map<Long, FMHMMNode> FMHMMListImp.loopLoadForest(String cInputString) [PATH1] for(i < cInputString.length())=T -> if(linkedHashMap.containsKey(Long.valueOf(cInputString.charAt(i))))=F -> if(i + StableData.INT_ONE < cInputString.length())=T -> exit loop -> return linkedHashMap [PATH2] fo...
true
ok
{"focal": {"class": "FMHMMListImp", "name": "loopLoadForest", "signature": "Map<Long, FMHMMNode> loopLoadForest(String cInputString)", "start_line": 3, "modifiers": "public", "params": [{"name": "cInputString", "type": "String"}], "return_type": "Map<Long, FMHMMNode>"}, "class_info": {"name": "FMHMMListImp", "kind": "c...
150470825_0
class SaveService { public void saveContainer(Container c) throws Exception { connection.saveContainer(c); } public SaveService(DatabaseConnection connection); } class SaveServiceTest { @Test public void testSaving() {
Container c = new Container("c1"); SaveService s = new SaveService(new DatabaseConnectionMock()); String exceptionString = ""; Exception ex = null; try { s.saveContainer(c); } catch (Exception e) { ex = e; exceptionString = e.getMessag...
[FOCAL] public void SaveService.saveContainer(Container c) [CLASS] class SaveService [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] connection.saveContainer/1 [EXCEPTIONS] declares Exception [COLLABORATORS] field connection saveContainer/1 [DATAFLOW] c@param->L2 [CLASS-MEMBERS] Sa...
/* static context [FOCAL] public void SaveService.saveContainer(Container c) [COLLABORATORS] field connection saveContainer/1 [EXCEPTIONS] declares Exception [CALLS-EXTERNAL] connection.saveContainer/1 */
/* static context [FOCAL] public void SaveService.saveContainer(Container c) [COLLABORATORS] field connection saveContainer/1 [EXCEPTIONS] declares Exception [CALLS-EXTERNAL] connection.saveContainer/1 */ class SaveService { public void saveContainer(Container c) throws Exception { connection.saveContainer...
true
ok
{"focal": {"class": "SaveService", "name": "saveContainer", "signature": "void saveContainer(Container c) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "c", "type": "Container"}], "return_type": "void"}, "class_info": {"name": "SaveService", "kind": "class", "modifiers": "", "superclass...
150573009_0
class JsonAdapter { public static List<DataRecord> flattenJson(DataRecord dataRecord, String json, TargetModel targetModel) throws InvalidJSONException, ColumnFamilyNotFoundException, InvalidColumnException { List<DataRecord> dataRecordList = new ArrayList<>(); dataRecordList.add(dataRecord); boolean usePa...
// test to select some of the json elements by specifying their parent // paths // expected result is dataRecords for only the selected json elements // having column name with parent path i.e parentPath_colName TargetModel target = new HdfsTargetModel("test1", hdfsExplorer); List<DataRecord> result = Js...
[FOCAL] public static List<DataRecord> JsonAdapter.flattenJson(DataRecord dataRecord, String json, TargetModel targetModel) [CLASS] class JsonAdapter [METRICS] loc=25 cc=4 branches=2 loops=1 returns=2 throws=1 nesting=3 [CALLS-INTERNAL] Result flattenJson(List<DataRecord> dataRecordList, JsonObject object, boolean useP...
/* static context [FOCAL] public static List<DataRecord> JsonAdapter.flattenJson(DataRecord dataRecord, String json, TargetModel targetModel) [THROWS-WHEN] InvalidJSONException when !(jsonElement instanceof JsonObject) && !(jsonElement instanceof JsonArray) [PATH1] if(jsonElement instanceof JsonObject)=F -> if(jsonElem...
/* static context [FOCAL] public static List<DataRecord> JsonAdapter.flattenJson(DataRecord dataRecord, String json, TargetModel targetModel) [THROWS-WHEN] InvalidJSONException when !(jsonElement instanceof JsonObject) && !(jsonElement instanceof JsonArray) [PATH1] if(jsonElement instanceof JsonObject)=F -> if(jsonElem...
true
ok
{"focal": {"class": "JsonAdapter", "name": "flattenJson", "signature": "List<DataRecord> flattenJson(DataRecord dataRecord, String json, TargetModel targetModel) throws InvalidJSONException, ColumnFamilyNotFoundException, InvalidColumnException", "start_line": 3, "modifiers": "public static", "params": [{"name": "dataR...
150632370_4
class Kassapaate { public void ostaLounas(Matkakortti kortti) { kortti.osta(HINTA); myytyjaLounaita++; } public Kassapaate(); public void lataa(Matkakortti kortti, int summa); public int getMyytyjaLounaita(); Kassapaate kassa; Matkakortti kortti; } class KassapaateTe...
when(kortti.getSaldo()).thenReturn(4); kassa.ostaLounas(kortti); verify(kortti, times(1)).getSaldo(); verify(kortti, times(0)).osta(anyInt()); } }
[FOCAL] public void Kassapaate.ostaLounas(Matkakortti kortti) [CLASS] class Kassapaate [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] Matkakortti.osta/1 [COLLABORATORS] param kortti:Matkakortti osta/1 [DATAFLOW] kortti@param->L2 [CLASS-MEMBERS] Kassapaate(); void lataa(Matkakortti...
/* static context [FOCAL] public void Kassapaate.ostaLounas(Matkakortti kortti) [COLLABORATORS] param kortti:Matkakortti osta/1 [CALLS-EXTERNAL] Matkakortti.osta/1 */
/* static context [FOCAL] public void Kassapaate.ostaLounas(Matkakortti kortti) [COLLABORATORS] param kortti:Matkakortti osta/1 [CALLS-EXTERNAL] Matkakortti.osta/1 */ class Kassapaate { public void ostaLounas(Matkakortti kortti) { kortti.osta(HINTA); myytyjaLounaita++; } public Kassapaate...
true
ok
{"focal": {"class": "Kassapaate", "name": "ostaLounas", "signature": "void ostaLounas(Matkakortti kortti)", "start_line": 3, "modifiers": "public", "params": [{"name": "kortti", "type": "Matkakortti"}], "return_type": "void"}, "class_info": {"name": "Kassapaate", "kind": "class", "modifiers": "", "superclass": null, "i...
150673713_13
class Retryer { public T call(Callable<T> callable) { long startTime = System.currentTimeMillis(); long attemptNumbers = 0; while (true) { attemptNumbers++; final Attempt<T> attempt = attempt(callable, attemptNumbers, startTime); // on retry retryListeners.forEach(listener -> list...
AtomicInteger ato = new AtomicInteger(0); RetryBuilder.<Integer>newBuilder().retryIfResult(rs -> rs < 3).build() .call(ato::incrementAndGet); Assert.assertEquals(3, ato.get()); } }
[FOCAL] public T Retryer.call(Callable<T> callable) [CLASS] class Retryer [METRICS] loc=27 cc=4 branches=3 loops=1 returns=3 throws=0 nesting=3 [CALLS-INTERNAL] Attempt<T> attempt(Callable<T> callable, long attemptNumbers, long startTime) [CALLS-EXTERNAL] System.currentTimeMillis/0, retryListeners.forEach/1, listener.a...
/* static context [FOCAL] public T Retryer.call(Callable<T> callable) [PATH1] while(true)=T -> if(!retryPredicate.test(attempt))=T -> if(attempt.hasException())=T -> return null [PATH2] while(true)=T -> if(!retryPredicate.test(attempt))=T -> if(attempt.hasException())=F -> return attempt.getResult() [PATH3] while(true)...
/* static context [FOCAL] public T Retryer.call(Callable<T> callable) [PATH1] while(true)=T -> if(!retryPredicate.test(attempt))=T -> if(attempt.hasException())=T -> return null [PATH2] while(true)=T -> if(!retryPredicate.test(attempt))=T -> if(attempt.hasException())=F -> return attempt.getResult() [PATH3] while(true)...
true
ok
{"focal": {"class": "Retryer", "name": "call", "signature": "T call(Callable<T> callable)", "start_line": 3, "modifiers": "public", "params": [{"name": "callable", "type": "Callable<T>"}], "return_type": "T"}, "class_info": {"name": "Retryer", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "f...
150677892_59
class OpenSessionOptionBuilder { public OpenSessionOptionBuilder setCameraByIndex(final Integer cameraByIndex) { this.cameraByIndex = cameraByIndex; this.cameraBySerialNumber = null; return this; } public OpenSessionOptionBuilder setOpenSessionOnly(final boolean openSessionOnly); ...
final OpenSessionOption option = builder .setCameraBySerialNumber("adawda") .setCameraByIndex(5) .build(); Assertions.assertFalse(option.getCameraBySerialNumber().isPresent()); Assertions.assertTrue(option.getCameraByIndex().isPresent()); } }
[FOCAL] public OpenSessionOptionBuilder OpenSessionOptionBuilder.setCameraByIndex(Integer cameraByIndex) [CLASS] class OpenSessionOptionBuilder [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [FIELDS] write=cameraByIndex, cameraBySerialNumber [STATE] cameraByIndex, cameraBySerialNumber [DATAFLOW] c...
/* static context [FOCAL] public OpenSessionOptionBuilder OpenSessionOptionBuilder.setCameraByIndex(Integer cameraByIndex) [STATE] cameraByIndex, cameraBySerialNumber [FIELDS] write=cameraByIndex, cameraBySerialNumber */
/* static context [FOCAL] public OpenSessionOptionBuilder OpenSessionOptionBuilder.setCameraByIndex(Integer cameraByIndex) [STATE] cameraByIndex, cameraBySerialNumber [FIELDS] write=cameraByIndex, cameraBySerialNumber */ class OpenSessionOptionBuilder { public OpenSessionOptionBuilder setCameraByIndex(final Intege...
true
ok
{"focal": {"class": "OpenSessionOptionBuilder", "name": "setCameraByIndex", "signature": "OpenSessionOptionBuilder setCameraByIndex(Integer cameraByIndex)", "start_line": 3, "modifiers": "public", "params": [{"name": "cameraByIndex", "type": "Integer"}], "return_type": "OpenSessionOptionBuilder"}, "class_info": {"name"...
151122650_154
class AbstractRetry implements Function<Flux<S>, Publisher<Long>> { BackoffDelay calculateBackoff(IterationContext<T> retryContext, Instant timeoutInstant) { if (retryContext.iteration() > maxIterations) return RETRY_EXHAUSTED; BackoffDelay nextBackoff = backoff.apply(retryContext); Duration minBackoff = ne...
Instant timeoutInstant = Instant.now().plusSeconds(3); AbstractRetry<String, Integer> abstractRetry = new AbstractRetry<String, Integer>(2, Duration.ofSeconds(1), Backoff.fixed(Duration.ofMillis(600)), Jitter.NO_JITTER, null, null) { @Override public Publisher<Long> apply(Flux<Integer> intege...
[FOCAL] BackoffDelay AbstractRetry.calculateBackoff(IterationContext<T> retryContext, Instant timeoutInstant) [CLASS] class AbstractRetry implements Function<Flux<S>, Publisher<Long>> [METRICS] loc=21 cc=5 branches=4 loops=0 returns=3 throws=0 nesting=1 [CALLS-EXTERNAL] IterationContext<T>.iteration/0, Duration.apply/1...
/* static context [FOCAL] BackoffDelay AbstractRetry.calculateBackoff(IterationContext<T> retryContext, Instant timeoutInstant) [PATH1] if(retryContext.iteration() > maxIterations)=F -> if(maxBackoff != null)=T -> if(minBackoff != null)=T -> if(Instant.now(clock).plus(jitteredBackoff).isAfter(timeoutInstant))=T -> retu...
/* static context [FOCAL] BackoffDelay AbstractRetry.calculateBackoff(IterationContext<T> retryContext, Instant timeoutInstant) [PATH1] if(retryContext.iteration() > maxIterations)=F -> if(maxBackoff != null)=T -> if(minBackoff != null)=T -> if(Instant.now(clock).plus(jitteredBackoff).isAfter(timeoutInstant))=T -> retu...
true
ok
{"focal": {"class": "AbstractRetry", "name": "calculateBackoff", "signature": "BackoffDelay calculateBackoff(IterationContext<T> retryContext, Instant timeoutInstant)", "start_line": 3, "modifiers": "", "params": [{"name": "retryContext", "type": "IterationContext<T>"}, {"name": "timeoutInstant", "type": "Instant"}], "...
151233646_40
class FluxCsvParser { public void parseFluxResponse(@Nonnull final BufferedSource bufferedSource, @Nonnull final Cancellable cancellable, @Nonnull final FluxResponseConsumer consumer) throws IOException { Arguments.checkNotNull(bufferedSo...
String data = "#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string,double\n" + "#group,false,false,false,false,false,false,false,false,false,true\n" + "#default,_result,,,,,,,,,\n" + ",result,table,_start,_stop,_time...
[FOCAL] public void FluxCsvParser.parseFluxResponse(BufferedSource bufferedSource, Cancellable cancellable, FluxResponseConsumer consumer) [CLASS] class FluxCsvParser [METRICS] loc=102 cc=14 branches=12 loops=1 returns=1 throws=2 nesting=6 [CALLS-INTERNAL] FluxRecord parseRecord(int tableIndex, FluxTable table, CSVReco...
/* static context [FOCAL] public void FluxCsvParser.parseFluxResponse(BufferedSource bufferedSource, Cancellable cancellable, FluxResponseConsumer consumer) [THROWS-WHEN] FluxQueryException when foreach(CSVRecord csvRecord : parser)=T && !cancellable.isCancelled() && !(ERROR_RECORD_INDEX == recordNumber && csvRecord.ge...
/* static context [FOCAL] public void FluxCsvParser.parseFluxResponse(BufferedSource bufferedSource, Cancellable cancellable, FluxResponseConsumer consumer) [THROWS-WHEN] FluxQueryException when foreach(CSVRecord csvRecord : parser)=T && !cancellable.isCancelled() && !(ERROR_RECORD_INDEX == recordNumber && csvRecord.ge...
true
ok
{"focal": {"class": "FluxCsvParser", "name": "parseFluxResponse", "signature": "void parseFluxResponse(BufferedSource bufferedSource, Cancellable cancellable, FluxResponseConsumer consumer) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "bufferedSource", "type": "BufferedSource"}, {"na...
151435201_11
class ClassBuilder { public String build() throws Exception { LOG.debug("Class building started for the class %s", fluent.getKlass().getSimpleName()); var list = fluent.getNodes(); if (list.size() == 0) { throw new GeciException("There are no actual calls in the fluent structure...
var fluent = FluentBuilder.from(TestClass.class) .one("a") .optional("b") .oneOrMore("c") .zeroOrMore("d") .oneOf("a", "b"); var result = new ClassBuilder((FluentBuilderImpl) fluent).build(); assertEqualToFile(result...
[FOCAL] public String ClassBuilder.build() [CLASS] class ClassBuilder [METRICS] loc=19 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] Node getLastNode(List<Node> list); String build(Node node, String nextInterface); void writeStartMethod(JavaSource.Builder code); void writeWrapperClass(JavaSource...
/* static context [FOCAL] public String ClassBuilder.build() [THROWS-WHEN] GeciException when list.size() == 0 [PATH1] if(list.size() == 0)=T -> throw new GeciException("There are no actual calls in the fluent structur... [PATH2] if(list.size() == 0)=F -> return code.toString() [COLLABORATORS] field fluent getKlass/0,g...
/* static context [FOCAL] public String ClassBuilder.build() [THROWS-WHEN] GeciException when list.size() == 0 [PATH1] if(list.size() == 0)=T -> throw new GeciException("There are no actual calls in the fluent structur... [PATH2] if(list.size() == 0)=F -> return code.toString() [COLLABORATORS] field fluent getKlass/0,g...
true
ok
{"focal": {"class": "ClassBuilder", "name": "build", "signature": "String build() throws Exception", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "ClassBuilder", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [...
151476055_6
class MembershipService { public List<String> getAllMemberships() { Membership memberships = restService.makeCall(membershipServerUrl, membershipServerUri, Membership.class); memberships.getMemberships().replaceAll(String::toUpperCase); return memberships.getMemberships(); } @Inje...
ArrayList<String> opsMemberships; opsMemberships = new ArrayList<>(); opsMemberships.add("Application1"); opsMemberships.add("Application2"); opsMemberships.add("Application3"); HashMap<String, List<String>> node; node = new HashMap<>(); node.put("test",...
[FOCAL] public List<String> MembershipService.getAllMemberships() [CLASS] class MembershipService [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] RESTService.makeCall/3, memberships.getMemberships().replaceAll/1, Membership.getMemberships/0 [FIELDS] read=restService:RESTService [IN...
/* static context [FOCAL] public List<String> MembershipService.getAllMemberships() [INPUTS] branches=- | result=restService [COLLABORATORS] field restService:RESTService makeCall/3 [FIELDS] read=restService:RESTService [CALLS-EXTERNAL] RESTService.makeCall/3, memberships.getMemberships().replaceAll/1, Membership.getMe...
/* static context [FOCAL] public List<String> MembershipService.getAllMemberships() [INPUTS] branches=- | result=restService [COLLABORATORS] field restService:RESTService makeCall/3 [FIELDS] read=restService:RESTService [CALLS-EXTERNAL] RESTService.makeCall/3, memberships.getMemberships().replaceAll/1, Membership.getMe...
true
ok
{"focal": {"class": "MembershipService", "name": "getAllMemberships", "signature": "List<String> getAllMemberships()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<String>"}, "class_info": {"name": "MembershipService", "kind": "class", "modifiers": "", "superclass": null, "interfaces": nul...
151746922_0
class FilePermissionSample { static Acl mapPosixFilePermissionToCloudSearchAcl(Path pathToFile) throws IOException { // Id of the identity source for external user/group IDs. Shown here, // but may be omitted in the SDK as it is automatically applied // based on the `api.identitySourceId` configuration p...
Path path = createTestFileWithPosixPermissions( user("100"), group("200"), PosixFilePermission.OWNER_READ); Acl acl = FilePermissionSample.mapPosixFilePermissionToCloudSearchAcl(path); assertThat(acl.getReaders()).hasSize(1); List<String> userPrincipalNames = acl.getReaders().st...
[FOCAL] static Acl FilePermissionSample.mapPosixFilePermissionToCloudSearchAcl(Path pathToFile) [CLASS] class FilePermissionSample [METRICS] loc=66 cc=5 branches=4 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] Files.getFileAttributeView/3, new Acl.Builder().build/0, PosixFileAttributeView.readAttributes/0, Coll...
/* static context [FOCAL] static Acl FilePermissionSample.mapPosixFilePermissionToCloudSearchAcl(Path pathToFile) [PATH1] if(attributeView == null)=F -> if(permissions.contains(PosixFilePermission.OWNER_READ))=T -> if(permissions.contains(PosixFilePermission.GROUP_READ))=T -> if(permissions.contains(PosixFilePermission...
/* static context [FOCAL] static Acl FilePermissionSample.mapPosixFilePermissionToCloudSearchAcl(Path pathToFile) [PATH1] if(attributeView == null)=F -> if(permissions.contains(PosixFilePermission.OWNER_READ))=T -> if(permissions.contains(PosixFilePermission.GROUP_READ))=T -> if(permissions.contains(PosixFilePermission...
true
ok
{"focal": {"class": "FilePermissionSample", "name": "mapPosixFilePermissionToCloudSearchAcl", "signature": "Acl mapPosixFilePermissionToCloudSearchAcl(Path pathToFile) throws IOException", "start_line": 3, "modifiers": "static", "params": [{"name": "pathToFile", "type": "Path"}], "return_type": "Acl"}, "class_info": {"...
152002724_0
class SuselMetadataLoader { public <S> Metadata load(Class<S> serviceProvider) throws IOException, SuselMetadataNullException { var module = serviceProvider.getModule(); var metadata = perModuleMetadataCache.get(module); if (metadata != null) { return metadata; ...
SuselMetadataLoader loader = new SuselMetadataLoader(); var holder = loader.load(this.getClass()); assertNotNull(holder.properties().getProperty("com.example.MyServiceImpl_Refs"), "Susel properties should be loaded and 'com.example.MyServiceImpl_Refs' key should have a value");...
[FOCAL] public Metadata SuselMetadataLoader.load(Class<S> serviceProvider) [CLASS] class SuselMetadataLoader [METRICS] loc=30 cc=4 branches=2 loops=0 returns=2 throws=1 nesting=3 [CALLS-EXTERNAL] Class<S>.getModule/0, perModuleMetadataCache.get/1, serviceProvider.getModule().getResourceAsStream/1, var.load/1, perModule...
/* static context [FOCAL] public Metadata SuselMetadataLoader.load(Class<S> serviceProvider) [THROWS-WHEN] SuselMetadataNullException when !(metadata != null) && metadata == null && try-body throws [PATH1] if(metadata != null)=F -> if(metadata == null)=T -> try-body throws -> throw new SuselMetadataNullException(ex) [P...
/* static context [FOCAL] public Metadata SuselMetadataLoader.load(Class<S> serviceProvider) [THROWS-WHEN] SuselMetadataNullException when !(metadata != null) && metadata == null && try-body throws [PATH1] if(metadata != null)=F -> if(metadata == null)=T -> try-body throws -> throw new SuselMetadataNullException(ex) [P...
true
ok
{"focal": {"class": "SuselMetadataLoader", "name": "load", "signature": "Metadata load(Class<S> serviceProvider) throws IOException, SuselMetadataNullException", "start_line": 3, "modifiers": "public", "params": [{"name": "serviceProvider", "type": "Class<S>"}], "return_type": "Metadata"}, "class_info": {"name": "Susel...
152163398_0
class MyApi { public synchronized String getNow() { return sdf.format(new Date()); } public static void main(String[] args); private MyApi api; } class MyApiTest { private MyApi api; @Test public void getNow() {
String now = api.getNow(); //相等测试断言,getNow返回值的长度是19 assertEquals(now.length(), 19); } }
[FOCAL] public synchronized String MyApi.getNow() [CLASS] class MyApi [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] sdf.format/1 [NEW] Date [COLLABORATORS] field sdf format/1 [CLASS-MEMBERS] void main(String[] args) [TEST] MyApiTest: @Test public void getNow() [TEST-FIELDS] MyApi...
/* static context [FOCAL] public synchronized String MyApi.getNow() [COLLABORATORS] field sdf format/1 [NEW] Date [CALLS-EXTERNAL] sdf.format/1 */
/* static context [FOCAL] public synchronized String MyApi.getNow() [COLLABORATORS] field sdf format/1 [NEW] Date [CALLS-EXTERNAL] sdf.format/1 */ class MyApi { public synchronized String getNow() { return sdf.format(new Date()); } public static void main(String[] args); private MyApi api; } class MyAp...
true
ok
{"focal": {"class": "MyApi", "name": "getNow", "signature": "String getNow()", "start_line": 3, "modifiers": "public synchronized", "params": [], "return_type": "String"}, "class_info": {"name": "MyApi", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "api", "type": "MyApi"...
152242718_9
class GetLocalIP { protected static List<String> getIPFromInputStream(BufferedReader reader) { if (reader != null) { Set<String> allLines = new LinkedHashSet<>(); String line = null; try { while ((line = reader.readLine()) != null) { ...
BufferedReader br = mock(BufferedReader.class); //We want to return a bogus string first and then null so there is not an infinite loop when(br.readLine()).thenReturn("10.18.85.186","10.18.85.186",(String)null); List<String> returnVal = GetLocalIP.getIPFromInputStream(br); assert...
[FOCAL] protected static List<String> GetLocalIP.getIPFromInputStream(BufferedReader reader) [CLASS] class GetLocalIP [METRICS] loc=20 cc=5 branches=2 loops=1 returns=2 throws=0 nesting=4 [CALLS-EXTERNAL] BufferedReader.readLine/0, kIPPattern.matcher/1, Matcher.matches/0, Set<String>.add/1, IOException.printStackTrace/...
/* static context [FOCAL] protected static List<String> GetLocalIP.getIPFromInputStream(BufferedReader reader) [PATH1] if(reader != null)=T -> while((line = reader.readLine()) != null)=T -> if(matcher.matches())=T -> exit loop -> return allLines.stream().collect(Collectors.toList()) [PATH2] if(reader != null)=F -> retu...
/* static context [FOCAL] protected static List<String> GetLocalIP.getIPFromInputStream(BufferedReader reader) [PATH1] if(reader != null)=T -> while((line = reader.readLine()) != null)=T -> if(matcher.matches())=T -> exit loop -> return allLines.stream().collect(Collectors.toList()) [PATH2] if(reader != null)=F -> retu...
true
ok
{"focal": {"class": "GetLocalIP", "name": "getIPFromInputStream", "signature": "List<String> getIPFromInputStream(BufferedReader reader)", "start_line": 3, "modifiers": "protected static", "params": [{"name": "reader", "type": "BufferedReader"}], "return_type": "List<String>"}, "class_info": {"name": "GetLocalIP", "kin...
152358305_7
class UserMapper { public User userFromId(String id) { if (id == null) { return null; } User user = new User(); user.setId(id); return user; } public List<UserDTO> usersToUserDTOs(List<User> users); public UserDTO userToUserDTO(User user); public...
assertThat(userMapper.userFromId(DEFAULT_ID).getId()).isEqualTo(DEFAULT_ID); assertThat(userMapper.userFromId(null)).isNull(); } }
[FOCAL] public User UserMapper.userFromId(String id) [CLASS] class UserMapper [METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] User.setId/1 [NEW] User [PATH1] if(id == null)=T -> return null [PATH2] if(id == null)=F -> return user [INPUTS] branches=id | result=- [DATAFLOW] id@param-...
/* static context [FOCAL] public User UserMapper.userFromId(String id) [PATH1] if(id == null)=T -> return null [PATH2] if(id == null)=F -> return user [INPUTS] branches=id | result=- [NEW] User [CALLS-EXTERNAL] User.setId/1 */
/* static context [FOCAL] public User UserMapper.userFromId(String id) [PATH1] if(id == null)=T -> return null [PATH2] if(id == null)=F -> return user [INPUTS] branches=id | result=- [NEW] User [CALLS-EXTERNAL] User.setId/1 */ class UserMapper { public User userFromId(String id) { if (id == null) { ...
true
ok
{"focal": {"class": "UserMapper", "name": "userFromId", "signature": "User userFromId(String id)", "start_line": 3, "modifiers": "public", "params": [{"name": "id", "type": "String"}], "return_type": "User"}, "class_info": {"name": "UserMapper", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, ...
152415097_16
class ConnectionProperties { public static ConnectionProperties from(Properties properties) throws ConfigurationException { Class<? extends NativeConnectionProvider> nativeConnectionProviderClass = getClassOfType(properties, CONFIG_CONNECTION_NATIVE_CLASS, DEFAULT_CONNECTION_NATIVE_CLASS, NativeConnect...
Properties properties = new Properties(); properties.put("connection.native.decorator.class", NonOverridingProviderClass.class.getName()); assertThatExceptionOfType(ConfigurationException.class).isThrownBy(() -> ConnectionProperties.from(properties)); } }
[FOCAL] public static ConnectionProperties ConnectionProperties.from(Properties properties) [CLASS] class ConnectionProperties [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Class<? extends T> getClassOfType(Properties properties, String property, String defaultClass, Class<T> wan...
/* static context [FOCAL] public static ConnectionProperties ConnectionProperties.from(Properties properties) [INPUTS] branches=- | result=properties [EXCEPTIONS] declares ConfigurationException [CALLS-INTERNAL] Class<? extends T> getClassOfType(Properties properties, String property, String defaultClass, Class<T> want...
/* static context [FOCAL] public static ConnectionProperties ConnectionProperties.from(Properties properties) [INPUTS] branches=- | result=properties [EXCEPTIONS] declares ConfigurationException [CALLS-INTERNAL] Class<? extends T> getClassOfType(Properties properties, String property, String defaultClass, Class<T> want...
true
ok
{"focal": {"class": "ConnectionProperties", "name": "from", "signature": "ConnectionProperties from(Properties properties) throws ConfigurationException", "start_line": 3, "modifiers": "public static", "params": [{"name": "properties", "type": "Properties"}], "return_type": "ConnectionProperties"}, "class_info": {"name...
152559710_128
class PrintClientOrgan implements Runnable { @Override public void run() { // printuserorgan -u=1 -t=requests Optional<Client> client = manager.getClientByID(uid); if (!client.isPresent()) { outputStream.println("No client exists with that user ID"); return; ...
String[] inputs = {"-u", "1", "--notanoption"}; CommandLine.run(spyPrintClientOrgan, System.out, inputs); verify(spyPrintClientOrgan, times(0)).run(); } }
[FOCAL] @Override public void PrintClientOrgan.run() [CLASS] class PrintClientOrgan implements Runnable [METRICS] loc=15 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] manager.getClientByID/1, Optional<Client>.isPresent/0, outputStream.println/1, "requests".equals/1, "donations".equals/1, client....
/* static context [FOCAL] @Override public void PrintClientOrgan.run() [PATH1] if(!client.isPresent())=T -> return [PATH2] if(!client.isPresent())=F -> if("requests".equals(type) || "donations".equals(type))=T [PATH3] if(!client.isPresent())=F -> if("requests".equals(type) || "donations".equals(type))=F [COLLABORATORS]...
/* static context [FOCAL] @Override public void PrintClientOrgan.run() [PATH1] if(!client.isPresent())=T -> return [PATH2] if(!client.isPresent())=F -> if("requests".equals(type) || "donations".equals(type))=T [PATH3] if(!client.isPresent())=F -> if("requests".equals(type) || "donations".equals(type))=F [COLLABORATORS]...
true
ok
{"focal": {"class": "PrintClientOrgan", "name": "run", "signature": "void run()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "PrintClientOrgan", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Runnable", "fields": [{"name": "outCon...
152655369_33
class UrlUtils { public static boolean isHttpOrHttps(String url) { if (TextUtils.isEmpty(url)) { return false; } return url.startsWith("http:") || url.startsWith("https:"); } public static String normalize(@NonNull String input); public static boolean isUrl(String ...
assertFalse(UrlUtils.isHttpOrHttps(null)); assertFalse(UrlUtils.isHttpOrHttps("")); assertFalse(UrlUtils.isHttpOrHttps(" ")); assertFalse(UrlUtils.isHttpOrHttps("mozilla.org")); assertFalse(UrlUtils.isHttpOrHttps("httpstrf://example.org")); assertTrue(UrlUtils.isHttp...
[FOCAL] public static boolean UrlUtils.isHttpOrHttps(String url) [CLASS] class UrlUtils [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] TextUtils.isEmpty/1, String.startsWith/1 [PATH1] if(TextUtils.isEmpty(url))=T -> return false [PATH2] if(TextUtils.isEmpty(url))=F -> return url.s...
/* static context [FOCAL] public static boolean UrlUtils.isHttpOrHttps(String url) [PATH1] if(TextUtils.isEmpty(url))=T -> return false [PATH2] if(TextUtils.isEmpty(url))=F -> return url.startsWith("http:") || url.startsWith("https:") [INPUTS] branches=url | result=url [CALLS-EXTERNAL] TextUtils.isEmpty/1, String.start...
/* static context [FOCAL] public static boolean UrlUtils.isHttpOrHttps(String url) [PATH1] if(TextUtils.isEmpty(url))=T -> return false [PATH2] if(TextUtils.isEmpty(url))=F -> return url.startsWith("http:") || url.startsWith("https:") [INPUTS] branches=url | result=url [CALLS-EXTERNAL] TextUtils.isEmpty/1, String.start...
true
ok
{"focal": {"class": "UrlUtils", "name": "isHttpOrHttps", "signature": "boolean isHttpOrHttps(String url)", "start_line": 3, "modifiers": "public static", "params": [{"name": "url", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "UrlUtils", "kind": "class", "modifiers": "", "superclass": null, "in...
152871165_23
class BundleImpl implements Bundle { ClassLoader getLoader() { return loader; } BundleImpl(final Manifest manifest, final File file, final BundleContextImpl context, final Ripener.Configuration configuration, final long id, final Collection<String> includedResources...
assertNotNull(bundle.getLoader()); } }
[FOCAL] ClassLoader BundleImpl.getLoader() [CLASS] class BundleImpl implements Bundle [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] BundleImpl(Manifest manifest, File file, BundleContextImpl context, Ripener.Configuration configuration, long id, Collection<String> includedResource...
/* static context [FOCAL] ClassLoader BundleImpl.getLoader() */
/* static context [FOCAL] ClassLoader BundleImpl.getLoader() */ class BundleImpl implements Bundle { ClassLoader getLoader() { return loader; } BundleImpl(final Manifest manifest, final File file, final BundleContextImpl context, final Ripener.Configuration configuration, final lo...
true
ok
{"focal": {"class": "BundleImpl", "name": "getLoader", "signature": "ClassLoader getLoader()", "start_line": 3, "modifiers": "", "params": [], "return_type": "ClassLoader"}, "class_info": {"name": "BundleImpl", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Bundle", "fields": [{"name": "bundle", "...
153022185_1
class FakegenUtils { public static void inject(@NonNull Object target, @NonNull String fieldName, Object value) { Field field; try { field = target.getClass().getDeclaredField(fieldName); field.setAccessible(true); field.set(target, value); } catch (NoSu...
SimpleType simpleType = new SimpleType(); Throwable fakegenException = catchThrowable(() -> FakegenUtils.inject(simpleType, "namo", "Hello World")); assertThat(fakegenException) .isInstanceOf(FakegenException.class) .hasMessage("Could not find field `namo`, but ...
[FOCAL] public static void FakegenUtils.inject(Object target, String fieldName, Object value) [CLASS] class FakegenUtils [METRICS] loc=14 cc=3 branches=0 loops=0 returns=0 throws=2 nesting=1 [CALLS-EXTERNAL] target.getClass().getDeclaredField/1, Object.getClass/0, Field.setAccessible/1, Field.set/2, createExceptionMess...
/* static context [FOCAL] public static void FakegenUtils.inject(Object target, String fieldName, Object value) [THROWS-WHEN] FakegenException when try-body throws [PATH1] try-body throws -> throw new FakegenException(createExceptionMessage(target.getClass(), fiel... [PATH2] try-body throws -> throw new FakegenExceptio...
/* static context [FOCAL] public static void FakegenUtils.inject(Object target, String fieldName, Object value) [THROWS-WHEN] FakegenException when try-body throws [PATH1] try-body throws -> throw new FakegenException(createExceptionMessage(target.getClass(), fiel... [PATH2] try-body throws -> throw new FakegenExceptio...
true
ok
{"focal": {"class": "FakegenUtils", "name": "inject", "signature": "void inject(Object target, String fieldName, Object value)", "start_line": 3, "modifiers": "public static", "params": [{"name": "target", "type": "Object"}, {"name": "fieldName", "type": "String"}, {"name": "value", "type": "Object"}], "return_type": "...