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
111042175_0
class RecommendationVerticle extends AbstractVerticle { static String parseContainerIdFromHostname(String hostname) { return hostname.replaceAll("recommendation-v\\d+-", ""); } @Override public void start(); private void logging(RoutingContext ctx); private void timeout(RoutingContext ctx)...
assertThat(RecommendationVerticle.parseContainerIdFromHostname("recommendation-v1-abcdef"), equalTo("abcdef")); assertThat(RecommendationVerticle.parseContainerIdFromHostname("recommendation-v2-abcdef"), equalTo("abcdef")); assertThat(RecommendationVerticle.parseContainerIdFromHostname("recommen...
[FOCAL] static String RecommendationVerticle.parseContainerIdFromHostname(String hostname) [CLASS] class RecommendationVerticle extends AbstractVerticle [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] String.replaceAll/2 [INPUTS] branches=- | result=hostname [DATAFLOW] hostname@par...
/* static context [FOCAL] static String RecommendationVerticle.parseContainerIdFromHostname(String hostname) [INPUTS] branches=- | result=hostname [CALLS-EXTERNAL] String.replaceAll/2 */
/* static context [FOCAL] static String RecommendationVerticle.parseContainerIdFromHostname(String hostname) [INPUTS] branches=- | result=hostname [CALLS-EXTERNAL] String.replaceAll/2 */ class RecommendationVerticle extends AbstractVerticle { static String parseContainerIdFromHostname(String hostname) { re...
true
ok
{"focal": {"class": "RecommendationVerticle", "name": "parseContainerIdFromHostname", "signature": "String parseContainerIdFromHostname(String hostname)", "start_line": 3, "modifiers": "static", "params": [{"name": "hostname", "type": "String"}], "return_type": "String"}, "class_info": {"name": "RecommendationVerticle"...
111090962_7
class TextAndPosition { public List<Integer> match(String toMatch) { // For now, we do case-insensitive search... toMatch = toMatch.toLowerCase(); ArrayList<Integer> result= new ArrayList<>(); if (toMatch.length() == 0) return result; int found = 0; ...
List<Integer> res = textAndPosition.match("ghi"); assertEquals(Arrays.asList(11), res); } }
[FOCAL] public List<Integer> TextAndPosition.match(String toMatch) [CLASS] class TextAndPosition [METRICS] loc=14 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] int convertIndexToPos(int found) [CALLS-EXTERNAL] String.toLowerCase/0, String.length/0, content.indexOf/2, ArrayList<Integer>.add/1 [NE...
/* static context [FOCAL] public List<Integer> TextAndPosition.match(String toMatch) [PATH1] if(toMatch.length() == 0)=F -> while((found = content.indexOf(toMatch, found)) != -1)=T -> exit loop -> return result [PATH2] if(toMatch.length() == 0)=T -> return result [PATH3] if(toMatch.length() == 0)=F -> while((found = co...
/* static context [FOCAL] public List<Integer> TextAndPosition.match(String toMatch) [PATH1] if(toMatch.length() == 0)=F -> while((found = content.indexOf(toMatch, found)) != -1)=T -> exit loop -> return result [PATH2] if(toMatch.length() == 0)=T -> return result [PATH3] if(toMatch.length() == 0)=F -> while((found = co...
true
ok
{"focal": {"class": "TextAndPosition", "name": "match", "signature": "List<Integer> match(String toMatch)", "start_line": 3, "modifiers": "public", "params": [{"name": "toMatch", "type": "String"}], "return_type": "List<Integer>"}, "class_info": {"name": "TextAndPosition", "kind": "class", "modifiers": "", "superclass"...
111096014_345
class PartitionSpecCreatingDiffListener implements DiffListener { @Override public void onNewPartition(String partitionName, Partition partition) { addPartition(partition); } public PartitionSpecCreatingDiffListener(Configuration conf); @Override public void onDiffStart(TableAndMetadata source, Option...
Partition partition1 = new Partition(Lists.newArrayList("val1", "val2"), DB, TABLE, 1, 1, null, null); Partition partition2 = new Partition(Lists.newArrayList("val11", "val22"), DB, TABLE, 1, 1, null, null); listener.onDiffStart(source, replica); listener.onNewPartition("p1", partition1); listener.o...
[FOCAL] @Override public void PartitionSpecCreatingDiffListener.onNewPartition(String partitionName, Partition partition) [CLASS] class PartitionSpecCreatingDiffListener implements DiffListener [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void addPartition(Partition partition) [...
/* static context [FOCAL] @Override public void PartitionSpecCreatingDiffListener.onNewPartition(String partitionName, Partition partition) [INPUTS] branches=- | result=- | unused=partitionName [CALLS-INTERNAL] void addPartition(Partition partition) */
/* static context [FOCAL] @Override public void PartitionSpecCreatingDiffListener.onNewPartition(String partitionName, Partition partition) [INPUTS] branches=- | result=- | unused=partitionName [CALLS-INTERNAL] void addPartition(Partition partition) */ class PartitionSpecCreatingDiffListener implements DiffListener { ...
true
ok
{"focal": {"class": "PartitionSpecCreatingDiffListener", "name": "onNewPartition", "signature": "void onNewPartition(String partitionName, Partition partition)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "partitionName", "type": "String"}, {"name": "partition", "type": "Partition"}], "return...
111391133_89
class ContextFilter implements Filter { public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { Map<String, String> attachments = setCallChainContextMap(invocation); if (attachments != null) { attachments = new HashMap<String, String>(attachments); ...
URL url = URL.valueOf("test://test:11/test?group=dubbo&version=1.1"); Invoker<DemoService> invoker = new MyInvoker<DemoService>(url); Invocation invocation = new MockInvocation(); Result result = contextFilter.invoke(invoker, invocation); assertNull(RpcContext.getContext().getInv...
[FOCAL] public Result ContextFilter.invoke(Invoker<?> invoker, Invocation invocation) [CLASS] class ContextFilter implements Filter [METRICS] loc=39 cc=6 branches=4 loops=0 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] Map<String, String> setCallChainContextMap(Invocation invocation) [CALLS-EXTERNAL] Map<String, String...
/* static context [FOCAL] public Result ContextFilter.invoke(Invoker<?> invoker, Invocation invocation) [PATH1] if(attachments != null)#1=T -> if(attachments != null)#2=T -> if(RpcContext.getContext().getAttachments() != null)=T -> if(invocation instanceof RpcInvocation)=T -> return invoker.invoke(invocation) [PATH2] i...
/* static context [FOCAL] public Result ContextFilter.invoke(Invoker<?> invoker, Invocation invocation) [PATH1] if(attachments != null)#1=T -> if(attachments != null)#2=T -> if(RpcContext.getContext().getAttachments() != null)=T -> if(invocation instanceof RpcInvocation)=T -> return invoker.invoke(invocation) [PATH2] i...
true
ok
{"focal": {"class": "ContextFilter", "name": "invoke", "signature": "Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException", "start_line": 3, "modifiers": "public", "params": [{"name": "invoker", "type": "Invoker<?>"}, {"name": "invocation", "type": "Invocation"}], "return_type": "Result"}, "clas...
111433118_3
class GoogleAssistantAutoConfiguration { @Bean @ConditionalOnMissingBean(WebhookController.class) public WebhookController webhookController(SpeechRequestDispatcher dispatcher) { return new WebhookController(dispatcher); } private final ApplicationContextRunner contextRunner; } class GoogleAssistantAutoConfi...
this.contextRunner.withUserConfiguration(GoogleConfiguration.class) .run( context -> { SpeechRequestDispatcher dispatcher = context.getBean(SpeechRequestDispatcher.class); assertThat(context).hasSingleBean(WebhookController.class); assertThat(context.getBean(WebhookController.class)) ...
[FOCAL] @Bean @ConditionalOnMissingBean(WebhookController.class) public WebhookController GoogleAssistantAutoConfiguration.webhookController(SpeechRequestDispatcher dispatcher) [CLASS] class GoogleAssistantAutoConfiguration [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] WebhookController [IN...
/* static context [FOCAL] @Bean @ConditionalOnMissingBean(WebhookController.class) public WebhookController GoogleAssistantAutoConfiguration.webhookController(SpeechRequestDispatcher dispatcher) [INPUTS] branches=- | result=dispatcher [NEW] WebhookController */
/* static context [FOCAL] @Bean @ConditionalOnMissingBean(WebhookController.class) public WebhookController GoogleAssistantAutoConfiguration.webhookController(SpeechRequestDispatcher dispatcher) [INPUTS] branches=- | result=dispatcher [NEW] WebhookController */ class GoogleAssistantAutoConfiguration { @Bean @Conditi...
true
ok
{"focal": {"class": "GoogleAssistantAutoConfiguration", "name": "webhookController", "signature": "WebhookController webhookController(SpeechRequestDispatcher dispatcher)", "start_line": 3, "modifiers": "@Bean @ConditionalOnMissingBean(WebhookController.class) public", "params": [{"name": "dispatcher", "type": "SpeechR...
111445552_5
class DecoderUtil { public static String getUtf8FromByteBuffer(final ByteBuffer bb) { bb.rewind(); byte[] bytes; if (bb.hasArray()) { bytes = bb.array(); } else { bytes = new byte[bb.remaining()]; bb.get(bytes); ...
String testString = "asdlkfjajo3wjaf3o8ajlfija3lfijaslijfl83auj"; byte[] encodedBytes = testString.getBytes(StandardCharsets.UTF_8); ByteBuffer bb = ByteBuffer.wrap(encodedBytes); String decodedString = DecoderUtil.getUtf8FromByteBuffer(bb); Assert.assertEquals(testStrin...
[FOCAL] public static String DecoderUtil.getUtf8FromByteBuffer(ByteBuffer bb) [CLASS] class DecoderUtil [METRICS] loc=17 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] ByteBuffer.rewind/0, ByteBuffer.hasArray/0, ByteBuffer.array/0, ByteBuffer.remaining/0, ByteBuffer.get/1 [NEW] String [PATH1] if(...
/* static context [FOCAL] public static String DecoderUtil.getUtf8FromByteBuffer(ByteBuffer bb) [PATH1] if(bb.hasArray())=T -> return new String(bytes, StandardCharsets.UTF_8) [PATH2] if(bb.hasArray())=F -> return new String(bytes, StandardCharsets.UTF_8) [INPUTS] branches=bb | result=bb [COLLABORATORS] param bb:ByteBu...
/* static context [FOCAL] public static String DecoderUtil.getUtf8FromByteBuffer(ByteBuffer bb) [PATH1] if(bb.hasArray())=T -> return new String(bytes, StandardCharsets.UTF_8) [PATH2] if(bb.hasArray())=F -> return new String(bytes, StandardCharsets.UTF_8) [INPUTS] branches=bb | result=bb [COLLABORATORS] param bb:ByteBu...
true
ok
{"focal": {"class": "DecoderUtil", "name": "getUtf8FromByteBuffer", "signature": "String getUtf8FromByteBuffer(ByteBuffer bb)", "start_line": 3, "modifiers": "public static", "params": [{"name": "bb", "type": "ByteBuffer"}], "return_type": "String"}, "class_info": {"name": "DecoderUtil", "kind": "class", "modifiers": "...
111517878_42
class ShortString implements EncodableData { public static ShortString parse(ByteBuf buf) { int size = buf.readUnsignedByte(); byte[] data = new byte[size]; buf.readBytes(data); return new ShortString(size, data); } @SuppressFBWarnings("EI_EXPOSE_REP2") public ShortString...
ByteBuf buf = Unpooled.buffer(DEFAULT_DATA_STRING.length() + 1); DEFAULT_TEST_OBJECT.write(buf); ShortString parsedObject = ShortString.parse(buf); Assert.assertEquals(parsedObject, DEFAULT_TEST_OBJECT, "Encoding and decoding should match to same object"); } }
[FOCAL] public static ShortString ShortString.parse(ByteBuf buf) [CLASS] class ShortString implements EncodableData [METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] ByteBuf.readUnsignedByte/0, ByteBuf.readBytes/1 [NEW] ShortString [INPUTS] branches=- | result=buf [COLLABORATORS] par...
/* static context [FOCAL] public static ShortString ShortString.parse(ByteBuf buf) [INPUTS] branches=- | result=buf [COLLABORATORS] param buf:ByteBuf readUnsignedByte/0,readBytes/1 [NEW] ShortString [CALLS-EXTERNAL] ByteBuf.readUnsignedByte/0, ByteBuf.readBytes/1 */
/* static context [FOCAL] public static ShortString ShortString.parse(ByteBuf buf) [INPUTS] branches=- | result=buf [COLLABORATORS] param buf:ByteBuf readUnsignedByte/0,readBytes/1 [NEW] ShortString [CALLS-EXTERNAL] ByteBuf.readUnsignedByte/0, ByteBuf.readBytes/1 */ class ShortString implements EncodableData { pub...
true
ok
{"focal": {"class": "ShortString", "name": "parse", "signature": "ShortString parse(ByteBuf buf)", "start_line": 3, "modifiers": "public static", "params": [{"name": "buf", "type": "ByteBuf"}], "return_type": "ShortString"}, "class_info": {"name": "ShortString", "kind": "class", "modifiers": "", "superclass": null, "in...
111669949_29
class DefaultUserDetails implements UserDetails { @Override public boolean equals(Object obj) { return ObjectEquals.of(this) .equals(obj, (orgin, other) -> Objects.equals(orgin.getUsername(), other.getUsername())); } private List<String> authorities(); @Override public Coll...
UserDetails obj = DefaultUserDetails.builder() .username("jittagornp") .build(); boolean output = userDetails.equals(obj); boolean expected = true; assertThat(output).isEqualTo(expected); } }
[FOCAL] @Override public boolean DefaultUserDetails.equals(Object obj) [CLASS] class DefaultUserDetails implements UserDetails [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] ObjectEquals.of(this).equals/2, ObjectEquals.of/1, Objects.equals/2, orgin.getUsername/0, other.getUsername...
/* static context [FOCAL] @Override public boolean DefaultUserDetails.equals(Object obj) [INPUTS] branches=- | result=obj [COLLABORATORS] field orgin getUsername/0; field other getUsername/0 [CALLS-EXTERNAL] ObjectEquals.of(this).equals/2, ObjectEquals.of/1, Objects.equals/2, orgin.getUsername/0, other.getUsername/0 */...
/* static context [FOCAL] @Override public boolean DefaultUserDetails.equals(Object obj) [INPUTS] branches=- | result=obj [COLLABORATORS] field orgin getUsername/0; field other getUsername/0 [CALLS-EXTERNAL] ObjectEquals.of(this).equals/2, ObjectEquals.of/1, Objects.equals/2, orgin.getUsername/0, other.getUsername/0 */...
true
ok
{"focal": {"class": "DefaultUserDetails", "name": "equals", "signature": "boolean equals(Object obj)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "obj", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "DefaultUserDetails", "kind": "class", "modifiers": "", "superclass": ...
111690131_4
class Loan { public static Loan createTermLoan(double commitment, int riskTaking, Date maturity){ return new Loan(null, commitment, 0.00, riskTaking, maturity, null); } private Loan(CapitalStrategy capitalStrategy, double commitment, double outstanding, int riskTaking, Date maturity, Date expiry)...
Loan termLoan = Loan.createTermLoan(2.0, 1, Date.from(Instant.now())); assertNotNull(termLoan); System.out.println("Test term loan"); } }
[FOCAL] public static Loan Loan.createTermLoan(double commitment, int riskTaking, Date maturity) [CLASS] class Loan [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] Loan [INPUTS] branches=- | result=commitment, maturity, riskTaking [DATAFLOW] commitment@param->L2; maturity@param->L2; riskTakin...
/* static context [FOCAL] public static Loan Loan.createTermLoan(double commitment, int riskTaking, Date maturity) [INPUTS] branches=- | result=commitment, maturity, riskTaking [NEW] Loan */
/* static context [FOCAL] public static Loan Loan.createTermLoan(double commitment, int riskTaking, Date maturity) [INPUTS] branches=- | result=commitment, maturity, riskTaking [NEW] Loan */ class Loan { public static Loan createTermLoan(double commitment, int riskTaking, Date maturity){ return new Loan(nu...
true
ok
{"focal": {"class": "Loan", "name": "createTermLoan", "signature": "Loan createTermLoan(double commitment, int riskTaking, Date maturity)", "start_line": 3, "modifiers": "public static", "params": [{"name": "commitment", "type": "double"}, {"name": "riskTaking", "type": "int"}, {"name": "maturity", "type": "Date"}], "r...
111698811_1
class Utils { public static ArrayList<VideoStream> getSortedStreamVideosList(Context context, List<VideoStream> videoStreams, List<VideoStream> videoOnlyStreams, boolean ascendingOrder) { boolean showHigherResolutions = PreferenceManager.getDefaultSharedPreferences(context).getBoolean(context.getString(R.s...
List<VideoStream> result = Utils.getSortedStreamVideosList(MediaFormat.MPEG_4, true, videoStreamsTestList, videoOnlyStreamsTestList, true); List<String> expected = Arrays.asList("144p", "240p", "360p", "480p", "720p", "720p60", "1080p", "1080p60", "1440p60", "2160p", "2160p60"); //for (VideoStr...
[FOCAL] public static ArrayList<VideoStream> Utils.getSortedStreamVideosList(Context context, List<VideoStream> videoStreams, List<VideoStream> videoOnlyStreams, boolean ascendingOrder) [CLASS] class Utils [METRICS] loc=19 cc=4 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] ArrayList<VideoStream> getS...
/* static context [FOCAL] public static ArrayList<VideoStream> Utils.getSortedStreamVideosList(Context context, List<VideoStream> videoStreams, List<VideoStream> videoOnlyStreams, boolean ascendingOrder) [PATH1] switch(preferredFormatString)=case "WebM" -> return getSortedStreamVideosList(preferredFormat, showHigherRes...
/* static context [FOCAL] public static ArrayList<VideoStream> Utils.getSortedStreamVideosList(Context context, List<VideoStream> videoStreams, List<VideoStream> videoOnlyStreams, boolean ascendingOrder) [PATH1] switch(preferredFormatString)=case "WebM" -> return getSortedStreamVideosList(preferredFormat, showHigherRes...
true
ok
{"focal": {"class": "Utils", "name": "getSortedStreamVideosList", "signature": "ArrayList<VideoStream> getSortedStreamVideosList(Context context, List<VideoStream> videoStreams, List<VideoStream> videoOnlyStreams, boolean ascendingOrder)", "start_line": 3, "modifiers": "public static", "params": [{"name": "context", "t...
111825535_9
class WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); // IE issue, see https://github.com/jhipster/generator...
env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION); UndertowEmbeddedServletContainerFactory container = new UndertowEmbeddedServletContainerFactory(); webConfigurer.customize(container); assertThat(container.getMimeMappings().get("abs")).isEqualTo("audio/x-mpeg"); ...
[FOCAL] @Override public void WebConfigurer.customize(ConfigurableEmbeddedServletContainer container) [CLASS] class WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer [METRICS] loc=25 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] void setLocationForStaticAsset...
/* static context [FOCAL] @Override public void WebConfigurer.customize(ConfigurableEmbeddedServletContainer container) [PATH1] if((jHipsterProperties.getHttp().getVersion().equals(JHipsterProperties.Http.Version.V_2_0) && container instanceof Unde...)=T [PATH2] if((jHipsterProperties.getHttp().getVersion().equals(JHip...
/* static context [FOCAL] @Override public void WebConfigurer.customize(ConfigurableEmbeddedServletContainer container) [PATH1] if((jHipsterProperties.getHttp().getVersion().equals(JHipsterProperties.Http.Version.V_2_0) && container instanceof Unde...)=T [PATH2] if((jHipsterProperties.getHttp().getVersion().equals(JHip...
true
ok
{"focal": {"class": "WebConfigurer", "name": "customize", "signature": "void customize(ConfigurableEmbeddedServletContainer container)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "container", "type": "ConfigurableEmbeddedServletContainer"}], "return_type": "void"}, "class_info": {"name": "We...
111854037_474
class DefaultAudioSink implements AudioSink { @Override @SuppressWarnings("ReferenceEquality") public boolean handleBuffer(ByteBuffer buffer, long presentationTimeUs) throws InitializationException, WriteException { Assertions.checkArgument(inputBuffer == null || buffer == inputBuffer); if (pendin...
configureDefaultAudioSink( CHANNEL_COUNT_STEREO, /* trimStartFrames= */ TRIM_100_MS_FRAME_COUNT, /* trimEndFrames= */ TRIM_10_MS_FRAME_COUNT); defaultAudioSink.handleBuffer(createDefaultSilenceBuffer(), /* presentationTimeUs= */ 0); assertThat(arrayAudioBufferSink.output) .h...
[FOCAL] @Override @SuppressWarnings("ReferenceEquality") public boolean DefaultAudioSink.handleBuffer(ByteBuffer buffer, long presentationTimeUs) [CLASS] class DefaultAudioSink implements AudioSink [METRICS] loc=121 cc=22 branches=21 loops=0 returns=9 throws=0 nesting=4 [CALLS-INTERNAL] boolean drainAudioProcessorsToEn...
class DefaultAudioSink implements AudioSink { @Override @SuppressWarnings("ReferenceEquality") public boolean handleBuffer(ByteBuffer buffer, long presentationTimeUs) throws InitializationException, WriteException { Assertions.checkArgument(inputBuffer == null || buffer == inputBuffer); if (pendin...
false
ok
{"focal": {"class": "DefaultAudioSink", "name": "handleBuffer", "signature": "boolean handleBuffer(ByteBuffer buffer, long presentationTimeUs) throws InitializationException, WriteException", "start_line": 3, "modifiers": "@Override @SuppressWarnings(\"ReferenceEquality\") public", "params": [{"name": "buffer", "type":...
112094343_36
class RadioBrowser { public List<Station> listStationsBy(@NonNull final Paging paging, @NonNull final SearchMode searchMode, @NonNull final String searchTerm, final ListParameter...listParam) { ...
List<Station> stations = browser .listStationsBy(SearchMode.BYNAME, "pop") .limit(256) .collect(Collectors.toList()); assertThat(stations, notNullValue()); assertThat(stations, is(not(Collections.emptyList()))); } }
[FOCAL] public List<Station> RadioBrowser.listStationsBy(Paging paging, SearchMode searchMode, String searchTerm, ListParameter... listParam) [CLASS] class RadioBrowser [METRICS] loc=24 cc=2 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] Invocation.Builder builder(WebTarget in); void applyPaging(Pagin...
/* static context [FOCAL] public List<Station> RadioBrowser.listStationsBy(Paging paging, SearchMode searchMode, String searchTerm, ListParameter... listParam) [PATH1] return response.readEntity(new GenericType<List<Station>>() { }) [PATH2] try-body throws [INPUTS] branches=- | result=searchMode, searchTerm [COLLABORAT...
/* static context [FOCAL] public List<Station> RadioBrowser.listStationsBy(Paging paging, SearchMode searchMode, String searchTerm, ListParameter... listParam) [PATH1] return response.readEntity(new GenericType<List<Station>>() { }) [PATH2] try-body throws [INPUTS] branches=- | result=searchMode, searchTerm [COLLABORAT...
true
ok
{"focal": {"class": "RadioBrowser", "name": "listStationsBy", "signature": "List<Station> listStationsBy(Paging paging, SearchMode searchMode, String searchTerm, ListParameter... listParam)", "start_line": 3, "modifiers": "public", "params": [{"name": "paging", "type": "Paging"}, {"name": "searchMode", "type": "SearchM...
112101025_42
class RecordManager extends AbstractTransactionManager { public RecordManager( String fileName ) { this( fileName, DEFAULT_PAGE_SIZE ); } public RecordManager( String fileName ); public RecordManager( String fileName, int pageSize ); private void runReclaimer(); private boolean ...
assertEquals( 1, recordManager.getNbManagedTrees() ); Set<String> managedBTrees = recordManager.getManagedTrees(); assertEquals( 1, managedBTrees.size() ); assertTrue( managedBTrees.contains( "test" ) ); BTree<Long, String> btree1 = recordManager.getManagedTree( "test" ); ...
[FOCAL] public RecordManager.RecordManager(String fileName) [CLASS] class RecordManager extends AbstractTransactionManager [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [DATAFLOW] fileName@param->L3 [CLASS-MEMBERS] RecordManager(String fileName); RecordManager(String fileName, int pageSize); void...
class RecordManager extends AbstractTransactionManager { public RecordManager( String fileName ) { this( fileName, DEFAULT_PAGE_SIZE ); } public RecordManager( String fileName ); public RecordManager( String fileName, int pageSize ); private void runReclaimer(); private boolean ...
false
ok
{"focal": {"class": "RecordManager", "name": "RecordManager", "signature": "RecordManager(String fileName)", "start_line": 3, "modifiers": "public", "params": [{"name": "fileName", "type": "String"}], "return_type": null}, "class_info": {"name": "RecordManager", "kind": "class", "modifiers": "", "superclass": "Abstract...
112128651_0
class RouterFunctions { public static <T extends ServerResponse> RouterFunction<T> route(RequestPredicate predicate, HandlerFunction<T> handlerFunction) { Assert.notNull(predicate, "'predicate' must not be null"); Assert.notNull(handlerFunction, "'handlerFunction' must not be null"); return new DefaultRout...
HandlerFunction<ServerResponse> handlerFunction = request -> ServerResponse.ok().build(); RouterFunction<ServerResponse> routerFunction1 = request -> Mono.empty(); RouterFunction<ServerResponse> routerFunction2 = request -> Mono.just(handlerFunction); RouterFunction<ServerResponse> result = routerFunction1.and...
[FOCAL] public static RouterFunction<T> RouterFunctions.route(RequestPredicate predicate, HandlerFunction<T> handlerFunction) [CLASS] class RouterFunctions [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Assert.notNull/2 [NEW] DefaultRouterFunction<> [INPUTS] branches=- | result=ha...
/* static context [FOCAL] public static RouterFunction<T> RouterFunctions.route(RequestPredicate predicate, HandlerFunction<T> handlerFunction) [INPUTS] branches=- | result=handlerFunction, predicate [NEW] DefaultRouterFunction<> [CALLS-EXTERNAL] Assert.notNull/2 */
/* static context [FOCAL] public static RouterFunction<T> RouterFunctions.route(RequestPredicate predicate, HandlerFunction<T> handlerFunction) [INPUTS] branches=- | result=handlerFunction, predicate [NEW] DefaultRouterFunction<> [CALLS-EXTERNAL] Assert.notNull/2 */ class RouterFunctions { public static <T extends Se...
true
ok
{"focal": {"class": "RouterFunctions", "name": "route", "signature": "RouterFunction<T> route(RequestPredicate predicate, HandlerFunction<T> handlerFunction)", "start_line": 3, "modifiers": "public static", "params": [{"name": "predicate", "type": "RequestPredicate"}, {"name": "handlerFunction", "type": "HandlerFunctio...
112199510_3
class ProductServiceImpl implements ProductService { @Override public ProductInfo save(ProductInfo productInfo) { return repository.save(productInfo); } @Override public ProductInfo findOne(String productId); @Override public List<ProductInfo> findUpAll(); @Override public Page<Product...
ProductInfo productInfo = new ProductInfo(); productInfo.setProductId("123457"); productInfo.setProductName("皮皮虾"); productInfo.setProductPrice(new BigDecimal(3.2)); productInfo.setProductStock(100); productInfo.setProductDescription("很好吃的虾"); productInfo.setProdu...
[FOCAL] @Override public ProductInfo ProductServiceImpl.save(ProductInfo productInfo) [CLASS] class ProductServiceImpl implements ProductService [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] repository.save/1 [INPUTS] branches=- | result=productInfo [COLLABORATORS] field reposito...
/* static context [FOCAL] @Override public ProductInfo ProductServiceImpl.save(ProductInfo productInfo) [INPUTS] branches=- | result=productInfo [COLLABORATORS] field repository save/1 [CALLS-EXTERNAL] repository.save/1 */
/* static context [FOCAL] @Override public ProductInfo ProductServiceImpl.save(ProductInfo productInfo) [INPUTS] branches=- | result=productInfo [COLLABORATORS] field repository save/1 [CALLS-EXTERNAL] repository.save/1 */ class ProductServiceImpl implements ProductService { @Override public ProductInfo save(P...
true
ok
{"focal": {"class": "ProductServiceImpl", "name": "save", "signature": "ProductInfo save(ProductInfo productInfo)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "productInfo", "type": "ProductInfo"}], "return_type": "ProductInfo"}, "class_info": {"name": "ProductServiceImpl", "kind": "class", "...
112254161_6
class Bme680 implements AutoCloseable { private int concatBytes(final int msb, final int lsb, final boolean isSigned) { if (isSigned) { return (msb << 8) | (lsb & 0xff); // keep the sign of msb but not of lsb } else { return ((msb & 0xff) << 8) | (lsb & 0xff); } ...
byte msb = -12; // 244 byte lsb = 12; int i = concatBytes(msb, lsb, true); // should be 'true' according to c-driver assertThat(i, CoreMatchers.equalTo(-3060)); } }
[FOCAL] private int Bme680.concatBytes(int msb, int lsb, boolean isSigned) [CLASS] class Bme680 implements AutoCloseable [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [PATH1] if(isSigned)=T -> return (msb << 8) | (lsb & 0xff) [PATH2] if(isSigned)=F -> return ((msb & 0xff) << 8) | (lsb & 0xff) [IN...
/* static context [FOCAL] private int Bme680.concatBytes(int msb, int lsb, boolean isSigned) [PATH1] if(isSigned)=T -> return (msb << 8) | (lsb & 0xff) [PATH2] if(isSigned)=F -> return ((msb & 0xff) << 8) | (lsb & 0xff) [INPUTS] branches=isSigned | result=lsb, msb */
/* static context [FOCAL] private int Bme680.concatBytes(int msb, int lsb, boolean isSigned) [PATH1] if(isSigned)=T -> return (msb << 8) | (lsb & 0xff) [PATH2] if(isSigned)=F -> return ((msb & 0xff) << 8) | (lsb & 0xff) [INPUTS] branches=isSigned | result=lsb, msb */ class Bme680 implements AutoCloseable { private...
true
ok
{"focal": {"class": "Bme680", "name": "concatBytes", "signature": "int concatBytes(int msb, int lsb, boolean isSigned)", "start_line": 3, "modifiers": "private", "params": [{"name": "msb", "type": "int"}, {"name": "lsb", "type": "int"}, {"name": "isSigned", "type": "boolean"}], "return_type": "int"}, "class_info": {"na...
112291646_1
class AzureWebappPlugin implements Plugin<Project> { public void apply(Project project) { AzureWebAppExtension azureWebAppExtension = new AzureWebAppExtension(project); project.getExtensions().add(WEBAPP_EXTENSION_NAME, azureWebAppExtension); project.getTasks().create(DeployTask.TASK_NAME, ...
Project project = ProjectBuilder.builder().build(); project.getPluginManager().apply("lenala.azure.azurewebapp"); assertTrue(project.getTasks().findByPath("azureWebappDeploy") instanceof DeployTask); } }
[FOCAL] public void AzureWebappPlugin.apply(Project project) [CLASS] class AzureWebappPlugin implements Plugin<Project> [METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] project.getExtensions().add/2, Project.getExtensions/0, project.getTasks().create/3, Project.getTasks/0, task.setA...
/* static context [FOCAL] public void AzureWebappPlugin.apply(Project project) [COLLABORATORS] param project:Project getExtensions/0,getTasks/0; field task setAzureWebAppExtension/1 [NEW] AzureWebAppExtension [CALLS-EXTERNAL] project.getExtensions().add/2, Project.getExtensions/0, project.getTasks().create/3, Project.g...
/* static context [FOCAL] public void AzureWebappPlugin.apply(Project project) [COLLABORATORS] param project:Project getExtensions/0,getTasks/0; field task setAzureWebAppExtension/1 [NEW] AzureWebAppExtension [CALLS-EXTERNAL] project.getExtensions().add/2, Project.getExtensions/0, project.getTasks().create/3, Project.g...
true
ok
{"focal": {"class": "AzureWebappPlugin", "name": "apply", "signature": "void apply(Project project)", "start_line": 3, "modifiers": "public", "params": [{"name": "project", "type": "Project"}], "return_type": "void"}, "class_info": {"name": "AzureWebappPlugin", "kind": "class", "modifiers": "", "superclass": null, "int...
112424920_1
class PhoneUtil { public static String hiddenMiddlePhoneNum(String phoneNumber) throws IOException { if (!isPhoneNumber(phoneNumber)) { throw new IOException("phoneNumber invalid"); } return phoneNumber.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2"); } @SuppressLint...
String hiddenPhoneNumber = PhoneUtil.hiddenMiddlePhoneNum("1363442986"); Assert.assertEquals("", "136****986", hiddenPhoneNumber); } }
[FOCAL] public static String PhoneUtil.hiddenMiddlePhoneNum(String phoneNumber) [CLASS] class PhoneUtil [METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] boolean isPhoneNumber(String phoneNumber) [CALLS-EXTERNAL] String.replaceAll/2 [NEW] IOException [EXCEPTIONS] declares IOException...
/* static context [FOCAL] public static String PhoneUtil.hiddenMiddlePhoneNum(String phoneNumber) [THROWS-WHEN] IOException when !isPhoneNumber(phoneNumber) [PATH1] if(!isPhoneNumber(phoneNumber))=T -> throw new IOException("phoneNumber invalid") [PATH2] if(!isPhoneNumber(phoneNumber))=F -> return phoneNumber.replaceAl...
/* static context [FOCAL] public static String PhoneUtil.hiddenMiddlePhoneNum(String phoneNumber) [THROWS-WHEN] IOException when !isPhoneNumber(phoneNumber) [PATH1] if(!isPhoneNumber(phoneNumber))=T -> throw new IOException("phoneNumber invalid") [PATH2] if(!isPhoneNumber(phoneNumber))=F -> return phoneNumber.replaceAl...
true
ok
{"focal": {"class": "PhoneUtil", "name": "hiddenMiddlePhoneNum", "signature": "String hiddenMiddlePhoneNum(String phoneNumber) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "phoneNumber", "type": "String"}], "return_type": "String"}, "class_info": {"name": "PhoneUtil", "kind": ...
112428883_0
class CustomerServiceProxy { public Mono<Optional<GetCustomerResponse>> findCustomerById(String customerId) { Mono<ClientResponse> response = client .get() .uri(customerServiceUrl + "/customers/{customerId}", customerId) .exchange(); return response.flatMap(resp -> { ...
JSONObject json = new JSONObject(); json.put("customerId", 101); json.put("name", "Fred"); json.put("creditLimit", "12.34"); String expectedResponse = json.toString(); stubFor(get(urlEqualTo("/customers/101")) .willReturn(aResponse() .withStatus(200) ...
[FOCAL] public Mono<Optional<GetCustomerResponse>> CustomerServiceProxy.findCustomerById(String customerId) [CLASS] class CustomerServiceProxy [METRICS] loc=21 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] client .get() .uri(customerServiceUrl + "/customers/{cust....exchange/0, client .get().uri...
/* static context [FOCAL] public Mono<Optional<GetCustomerResponse>> CustomerServiceProxy.findCustomerById(String customerId) [INPUTS] branches=- | result=customerId [COLLABORATORS] field client get/0; field resp statusCode/0,bodyToMono/1 [NEW] UnknownProxyException [CALLS-EXTERNAL] client .get() .uri(customerServiceUr...
/* static context [FOCAL] public Mono<Optional<GetCustomerResponse>> CustomerServiceProxy.findCustomerById(String customerId) [INPUTS] branches=- | result=customerId [COLLABORATORS] field client get/0; field resp statusCode/0,bodyToMono/1 [NEW] UnknownProxyException [CALLS-EXTERNAL] client .get() .uri(customerServiceUr...
true
ok
{"focal": {"class": "CustomerServiceProxy", "name": "findCustomerById", "signature": "Mono<Optional<GetCustomerResponse>> findCustomerById(String customerId)", "start_line": 3, "modifiers": "public", "params": [{"name": "customerId", "type": "String"}], "return_type": "Mono<Optional<GetCustomerResponse>>"}, "class_info...
112444990_135
class ParametersConverter { public CameraParametersDecorator toPlatformParameters(Parameters parameters, CameraParametersDecorator output) { for (Parameters.Type storedType : parameters.storedTypes()) { applyParameter( ...
// Given Parameters input = new Parameters(); // When CameraParametersDecorator result = testee.toPlatformParameters( input, outputParameters ); // Then assertSame( result, outputParameters ...
[FOCAL] public CameraParametersDecorator ParametersConverter.toPlatformParameters(Parameters parameters, CameraParametersDecorator output) [CLASS] class ParametersConverter [METRICS] loc=12 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] void applyParameter(Parameters.Type type, Parameters input, ...
/* static context [FOCAL] public CameraParametersDecorator ParametersConverter.toPlatformParameters(Parameters parameters, CameraParametersDecorator output) [PATH1] foreach(Parameters.Type storedType : parameters.storedTypes())=T -> exit loop -> return output [PATH2] foreach(Parameters.Type storedType : parameters.stor...
/* static context [FOCAL] public CameraParametersDecorator ParametersConverter.toPlatformParameters(Parameters parameters, CameraParametersDecorator output) [PATH1] foreach(Parameters.Type storedType : parameters.storedTypes())=T -> exit loop -> return output [PATH2] foreach(Parameters.Type storedType : parameters.stor...
true
ok
{"focal": {"class": "ParametersConverter", "name": "toPlatformParameters", "signature": "CameraParametersDecorator toPlatformParameters(Parameters parameters, CameraParametersDecorator output)", "start_line": 3, "modifiers": "public", "params": [{"name": "parameters", "type": "Parameters"}, {"name": "output", "type": "...
112465036_7
class LoggingCallAdapterFactory extends CallAdapter.Factory { @Override public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { CallAdapter<?, ?> delegate = retrofit.nextCallAdapter(this, returnType, annotations); return new LoggingCallAdapter<>(delegate, logger); } ...
MockWebServer server = new MockWebServer(); final AtomicReference<Throwable> failureRef = new AtomicReference<>(); Retrofit retrofit = new Retrofit.Builder().baseUrl(server.url("/")) .addCallAdapterFactory( new LoggingCallAdapterFactory(new LoggingCallAdapterFactory.Logger() { ...
[FOCAL] @Override public CallAdapter<?, ?> LoggingCallAdapterFactory.get(Type returnType, Annotation[] annotations, Retrofit retrofit) [CLASS] class LoggingCallAdapterFactory extends CallAdapter.Factory [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Retrofit.nextCallAdapter/3 [NEW...
/* static context [FOCAL] @Override public CallAdapter<?, ?> LoggingCallAdapterFactory.get(Type returnType, Annotation[] annotations, Retrofit retrofit) [INPUTS] branches=- | result=annotations, retrofit, returnType [COLLABORATORS] param retrofit:Retrofit nextCallAdapter/3 [NEW] LoggingCallAdapter<> [CALLS-EXTERNAL] Re...
/* static context [FOCAL] @Override public CallAdapter<?, ?> LoggingCallAdapterFactory.get(Type returnType, Annotation[] annotations, Retrofit retrofit) [INPUTS] branches=- | result=annotations, retrofit, returnType [COLLABORATORS] param retrofit:Retrofit nextCallAdapter/3 [NEW] LoggingCallAdapter<> [CALLS-EXTERNAL] Re...
true
ok
{"focal": {"class": "LoggingCallAdapterFactory", "name": "get", "signature": "CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "returnType", "type": "Type"}, {"name": "annotations", "type": "Annotation[]"}, {"name...
112628388_4
class ConverterUtils { public static Object convertValueToType(Class<?> fieldType, String formattedValue, String columnName, int rowNum) { Object value = null; if (fieldType == String.class) { value = String.valueOf(formattedValue); } else if (fieldType == LocalDateTime.class) {...
assertEquals("Hello", convertValueToType(String.class, "Hello", "A", 1)); assertEquals("HELLO", convertValueToType(String.class, "HELLO", "A", 1)); assertEquals("1.0", convertValueToType(String.class, "1.0", "A", 1)); assertEquals("2019-01-01", convertValueToType(String.class, "2019-01-0...
[FOCAL] public static Object ConverterUtils.convertValueToType(Class<?> fieldType, String formattedValue, String columnName, int rowNum) [CLASS] class ConverterUtils [METRICS] loc=33 cc=11 branches=10 loops=0 returns=10 throws=0 nesting=10 [CALLS-EXTERNAL] String.valueOf/1, Converters.toLocalDateTime.convert/3, Convert...
/* static context [FOCAL] public static Object ConverterUtils.convertValueToType(Class<?> fieldType, String formattedValue, String columnName, int rowNum) [PATH1] if(fieldType == String.class)=F -> if(fieldType == LocalDateTime.class)=F -> if(fieldType == LocalDate.class)=F -> if(fieldType == java.sql.Date.class)=F -> ...
/* static context [FOCAL] public static Object ConverterUtils.convertValueToType(Class<?> fieldType, String formattedValue, String columnName, int rowNum) [PATH1] if(fieldType == String.class)=F -> if(fieldType == LocalDateTime.class)=F -> if(fieldType == LocalDate.class)=F -> if(fieldType == java.sql.Date.class)=F -> ...
true
ok
{"focal": {"class": "ConverterUtils", "name": "convertValueToType", "signature": "Object convertValueToType(Class<?> fieldType, String formattedValue, String columnName, int rowNum)", "start_line": 3, "modifiers": "public static", "params": [{"name": "fieldType", "type": "Class<?>"}, {"name": "formattedValue", "type": ...
112785414_2
class ProduceMediaTypeExpression extends AbstractMediaTypeExpression { public final boolean match(List<MediaType> acceptedMediaTypes) { boolean match = matchMediaType(acceptedMediaTypes); return (!isNegated() ? match : !match); } ProduceMediaTypeExpression(String expression); ProduceMediaTypeExpression(Me...
ProduceMediaTypeExpression expression = createExpression( MediaType.APPLICATION_JSON_VALUE); Assert.assertTrue(expression.match( Arrays.asList(MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON))); expression = createExpression(MediaType.APPLICATION_JSON_VALUE); Assert.assertFalse(expression.match(A...
[FOCAL] public final boolean ProduceMediaTypeExpression.match(List<MediaType> acceptedMediaTypes) [CLASS] class ProduceMediaTypeExpression extends AbstractMediaTypeExpression [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] boolean matchMediaType(List<MediaType> acceptedMediaTypes) ...
/* static context [FOCAL] public final boolean ProduceMediaTypeExpression.match(List<MediaType> acceptedMediaTypes) [INPUTS] branches=- | result=acceptedMediaTypes [CALLS-INTERNAL] boolean matchMediaType(List<MediaType> acceptedMediaTypes) [CALLS-EXTERNAL] isNegated/0 (inherited) */
/* static context [FOCAL] public final boolean ProduceMediaTypeExpression.match(List<MediaType> acceptedMediaTypes) [INPUTS] branches=- | result=acceptedMediaTypes [CALLS-INTERNAL] boolean matchMediaType(List<MediaType> acceptedMediaTypes) [CALLS-EXTERNAL] isNegated/0 (inherited) */ class ProduceMediaTypeExpression ext...
true
ok
{"focal": {"class": "ProduceMediaTypeExpression", "name": "match", "signature": "boolean match(List<MediaType> acceptedMediaTypes)", "start_line": 3, "modifiers": "public final", "params": [{"name": "acceptedMediaTypes", "type": "List<MediaType>"}], "return_type": "boolean"}, "class_info": {"name": "ProduceMediaTypeExp...
112941183_81
class UtilAll { public static int getPid() { RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean(); String name = runtime.getName(); // format: "pid@hostname" try { return Integer.parseInt(name.substring(0, name.indexOf('@'))); } catch (Exception e) { ...
assertThat(UtilAll.getPid()).isGreaterThan(0); } }
[FOCAL] public static int UtilAll.getPid() [CLASS] class UtilAll [METRICS] loc=9 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] ManagementFactory.getRuntimeMXBean/0, RuntimeMXBean.getName/0, Integer.parseInt/1, String.substring/2, String.indexOf/1 [EXCEPTIONS] catches Exception e [PATH1] try-body...
/* static context [FOCAL] public static int UtilAll.getPid() [PATH1] try-body throws -> return -1 [PATH2] return Integer.parseInt(name.substring(0, name.indexOf('@'))) [EXCEPTIONS] catches Exception e [CALLS-EXTERNAL] ManagementFactory.getRuntimeMXBean/0, RuntimeMXBean.getName/0, Integer.parseInt/1, String.substring/2,...
/* static context [FOCAL] public static int UtilAll.getPid() [PATH1] try-body throws -> return -1 [PATH2] return Integer.parseInt(name.substring(0, name.indexOf('@'))) [EXCEPTIONS] catches Exception e [CALLS-EXTERNAL] ManagementFactory.getRuntimeMXBean/0, RuntimeMXBean.getName/0, Integer.parseInt/1, String.substring/2,...
true
ok
{"focal": {"class": "UtilAll", "name": "getPid", "signature": "int getPid()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "int"}, "class_info": {"name": "UtilAll", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "currentStackTr...
112945272_3
class ChecksumHelper { protected byte[] validateAndStripChecksum(byte[] source) { // retrieve checksum int lastIndexOf = Bytes.lastIndexOf(source, (byte) SEPARATOR); if (lastIndexOf < 0) { throw new RuntimeException("no checksum was found on source: " + new String(source)); } long checkSum = Long.parseLo...
ChecksumHelper checksumHelper = new ChecksumHelper(); byte[] withChecksum = "foobarbaz#444082092".getBytes(); log.debug("withChecksum: " + new String(withChecksum)); assertNotNull(withChecksum); checksumHelper.validateAndStripChecksum(withChecksum); fail("should have thrown an exception by now"); } }
[FOCAL] protected byte[] ChecksumHelper.validateAndStripChecksum(byte[] source) [CLASS] class ChecksumHelper [METRICS] loc=17 cc=3 branches=2 loops=0 returns=1 throws=2 nesting=1 [CALLS-EXTERNAL] Bytes.lastIndexOf/2, Long.parseLong/1, Arrays.copyOfRange/3, CRC32.update/1, CRC32.getValue/0, Long.compare/2 [NEW] RuntimeE...
/* static context [FOCAL] protected byte[] ChecksumHelper.validateAndStripChecksum(byte[] source) [THROWS-WHEN] RuntimeException when lastIndexOf < 0 [THROWS-WHEN] RuntimeException when !(lastIndexOf < 0) && Long.compare(checkSum, calculatedCheckSum) != 0 [PATH1] if(lastIndexOf < 0)=F -> if(Long.compare(checkSum, calcu...
/* static context [FOCAL] protected byte[] ChecksumHelper.validateAndStripChecksum(byte[] source) [THROWS-WHEN] RuntimeException when lastIndexOf < 0 [THROWS-WHEN] RuntimeException when !(lastIndexOf < 0) && Long.compare(checkSum, calculatedCheckSum) != 0 [PATH1] if(lastIndexOf < 0)=F -> if(Long.compare(checkSum, calcu...
true
ok
{"focal": {"class": "ChecksumHelper", "name": "validateAndStripChecksum", "signature": "byte[] validateAndStripChecksum(byte[] source)", "start_line": 3, "modifiers": "protected", "params": [{"name": "source", "type": "byte[]"}], "return_type": "byte[]"}, "class_info": {"name": "ChecksumHelper", "kind": "class", "modif...
112975556_9
class ExtrasHandler { int remainingExtras() { return extras.size(); } ExtrasHandler(List<IndRecord> indRecords, Random random); void formExtras(List<HhRecord> hhRecs); List<Person> getPersonsFromExtras(RelationshipStatus relStatus, Sex sex, AgeRange ageRange, int count); List<Per...
Assert.assertNotNull(extrasHandler); Assert.assertEquals("Number of extras", extrasHandler.remainingExtras(), 145); } }
[FOCAL] int ExtrasHandler.remainingExtras() [CLASS] class ExtrasHandler [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] extras.size/0 [COLLABORATORS] field extras size/0 [CLASS-MEMBERS] ExtrasHandler(List<IndRecord> indRecords, Random random); void formExtras(List<HhRecord> hhRecs)...
/* static context [FOCAL] int ExtrasHandler.remainingExtras() [COLLABORATORS] field extras size/0 [CALLS-EXTERNAL] extras.size/0 */
/* static context [FOCAL] int ExtrasHandler.remainingExtras() [COLLABORATORS] field extras size/0 [CALLS-EXTERNAL] extras.size/0 */ class ExtrasHandler { int remainingExtras() { return extras.size(); } ExtrasHandler(List<IndRecord> indRecords, Random random); void formExtras(List<HhRecord>...
true
ok
{"focal": {"class": "ExtrasHandler", "name": "remainingExtras", "signature": "int remainingExtras()", "start_line": 3, "modifiers": "", "params": [], "return_type": "int"}, "class_info": {"name": "ExtrasHandler", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "extrasHandle...
113003835_0
class EasyPermissions { public static boolean hasPermissions(@NonNull Context context, @Size(min = 1) @NonNull String... perms) { // Always return true for SDK < M, let the system deal with the permissions if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {...
Application app = RuntimeEnvironment.application; String[] perms = new String[]{ Manifest.permission.READ_SMS, Manifest.permission.ACCESS_FINE_LOCATION }; // Wes should not have permissions before any are granted assertFalse(EasyPermissions.hasPe...
[FOCAL] public static boolean EasyPermissions.hasPermissions(Context context, String... perms) [CLASS] class EasyPermissions [METRICS] loc=25 cc=5 branches=3 loops=1 returns=3 throws=1 nesting=2 [CALLS-EXTERNAL] Log.w/2, ContextCompat.checkSelfPermission/2 [NEW] IllegalArgumentException [EXCEPTIONS] throws IllegalArgum...
/* static context [FOCAL] public static boolean EasyPermissions.hasPermissions(Context context, String... perms) [THROWS-WHEN] IllegalArgumentException when !(Build.VERSION.SDK_INT < Build.VERSION_CODES.M) && context == null [PATH1] if(Build.VERSION.SDK_INT < Build.VERSION_CODES.M)=F -> if(context == null)=F -> foreach...
/* static context [FOCAL] public static boolean EasyPermissions.hasPermissions(Context context, String... perms) [THROWS-WHEN] IllegalArgumentException when !(Build.VERSION.SDK_INT < Build.VERSION_CODES.M) && context == null [PATH1] if(Build.VERSION.SDK_INT < Build.VERSION_CODES.M)=F -> if(context == null)=F -> foreach...
true
ok
{"focal": {"class": "EasyPermissions", "name": "hasPermissions", "signature": "boolean hasPermissions(Context context, String... perms)", "start_line": 3, "modifiers": "public static", "params": [{"name": "context", "type": "Context"}, {"name": "perms", "type": "String..."}], "return_type": "boolean"}, "class_info": {"...
113079801_0
class Sh1106 implements Closeable { public void setContrast(int level) throws IOException, IllegalArgumentException { if (mI2cDevice == null) { throw new IllegalStateException("I2C Device not open"); } if (level < 0 || level > 255) { throw new IllegalArgumentExceptio...
mockStatic(BitmapHelper.class); mockStatic(Bitmap.class); Sh1106 sh1106 = new Sh1106(mI2c); int[] validValues = {0, 66, 255}; for (int validValue : validValues) { sh1106.setContrast(validValue); Mockito.verify(mI2c).writeRegByte(0x00, (byte) 0x81); ...
[FOCAL] public void Sh1106.setContrast(int level) [CLASS] class Sh1106 implements Closeable [METRICS] loc=11 cc=3 branches=2 loops=0 returns=0 throws=2 nesting=1 [CALLS-EXTERNAL] String.valueOf/1, mI2cDevice.writeRegByte/2 [NEW] IllegalStateException, IllegalArgumentException [EXCEPTIONS] declares IOException, IllegalA...
/* static context [FOCAL] public void Sh1106.setContrast(int level) [THROWS-WHEN] IllegalStateException when mI2cDevice == null [THROWS-WHEN] IllegalArgumentException when !(mI2cDevice == null) && level < 0 || level > 255 [PATH1] if(mI2cDevice == null)=F -> if(level < 0 || level > 255)=T -> throw new IllegalArgumentExc...
/* static context [FOCAL] public void Sh1106.setContrast(int level) [THROWS-WHEN] IllegalStateException when mI2cDevice == null [THROWS-WHEN] IllegalArgumentException when !(mI2cDevice == null) && level < 0 || level > 255 [PATH1] if(mI2cDevice == null)=F -> if(level < 0 || level > 255)=T -> throw new IllegalArgumentExc...
true
ok
{"focal": {"class": "Sh1106", "name": "setContrast", "signature": "void setContrast(int level) throws IOException, IllegalArgumentException", "start_line": 3, "modifiers": "public", "params": [{"name": "level", "type": "int"}], "return_type": "void"}, "class_info": {"name": "Sh1106", "kind": "class", "modifiers": "", "...
113164027_59
class MultiplicationServiceImpl implements MultiplicationService { @Transactional @Override public boolean checkAttempt(final MultiplicationResultAttempt attempt) { // Check if the user already exists for that alias Optional<User> user = userRepository.findByAlias(attempt.getUser().getAlias...
// given Multiplication multiplication = new Multiplication(50, 60); User user = new User("john_doe"); MultiplicationResultAttempt attempt = new MultiplicationResultAttempt( user, multiplication, 3010, false); MultiplicationSolvedEvent event = new MultiplicationSo...
[FOCAL] @Transactional @Override public boolean MultiplicationServiceImpl.checkAttempt(MultiplicationResultAttempt attempt) [CLASS] class MultiplicationServiceImpl implements MultiplicationService [METRICS] loc=33 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] UserRepository.findByAlias/1, attemp...
/* static context [FOCAL] @Transactional @Override public boolean MultiplicationServiceImpl.checkAttempt(MultiplicationResultAttempt attempt) [INPUTS] branches=- | result=attempt [COLLABORATORS] field userRepository:UserRepository findByAlias/1; param attempt:MultiplicationResultAttempt getUser/0,isCorrect/0,getResultA...
/* static context [FOCAL] @Transactional @Override public boolean MultiplicationServiceImpl.checkAttempt(MultiplicationResultAttempt attempt) [INPUTS] branches=- | result=attempt [COLLABORATORS] field userRepository:UserRepository findByAlias/1; param attempt:MultiplicationResultAttempt getUser/0,isCorrect/0,getResultA...
true
ok
{"focal": {"class": "MultiplicationServiceImpl", "name": "checkAttempt", "signature": "boolean checkAttempt(MultiplicationResultAttempt attempt)", "start_line": 3, "modifiers": "@Transactional @Override public", "params": [{"name": "attempt", "type": "MultiplicationResultAttempt"}], "return_type": "boolean"}, "class_in...
113194597_6
class Commands { public final static void main(String[] args) throws Exception { logger.debug(format("CM Client has been called with command line '%s'.", getArgsLogString(args))); CommandLine commandLine = new DefaultParser().parse(Helpers.getStandardParameters(true), args, true); if((co...
Commands.main(new String[] {"--help", "-t", "SOLMAN", "is-change-in-development"}); String help = IOUtils.toString(result.toByteArray(), "UTF-8"); assertThat(help, Matchers.containsString("usage: <CMD> [COMMON_OPTIONS] is-change-in-development")); } }
[FOCAL] public final static void Commands.main(String[] args) [CLASS] class Commands [METRICS] loc=55 cc=10 branches=5 loops=0 returns=3 throws=5 nesting=2 [CALLS-INTERNAL] BackendType getBackendType(CommandLine commandLine, String[] args); Exception handle(InvocationTargetException e); String getCommandName(CommandLin...
/* static context [FOCAL] public final static void Commands.main(String[] args) [THROWS-WHEN] CMCommandLineException when (commandLine.hasOption(CMOptions.HELP.getOpt()) && args.length <= 1) || args.length == 0 && args.length == 0 [THROWS-WHEN] e when !((commandLine.hasOption(CMOptions.HELP.getOpt()) && args.length <= ...
/* static context [FOCAL] public final static void Commands.main(String[] args) [THROWS-WHEN] CMCommandLineException when (commandLine.hasOption(CMOptions.HELP.getOpt()) && args.length <= 1) || args.length == 0 && args.length == 0 [THROWS-WHEN] e when !((commandLine.hasOption(CMOptions.HELP.getOpt()) && args.length <= ...
true
ok
{"focal": {"class": "Commands", "name": "main", "signature": "void main(String[] args) throws Exception", "start_line": 3, "modifiers": "public final static", "params": [{"name": "args", "type": "String[]"}], "return_type": "void"}, "class_info": {"name": "Commands", "kind": "class", "modifiers": "", "superclass": null...
113222463_311
class YamlDocGenerator { public String generate(String schemaName) { return generate(schemaName, schema); } public YamlDocGenerator(Map<String, Object> schema); private static String toStructureName(String reference); private static String getSimpleName(String reference); private static String toLoc...
Map<String, Object> schema = generateSchema(ReferencingObject.class); YamlDocGenerator generator = new YamlDocGenerator(schema); String markdown = generator.generate("start"); assertThat( markdown, containsString( String.join( "\n", "### Start"...
[FOCAL] public String YamlDocGenerator.generate(String schemaName) [CLASS] class YamlDocGenerator [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String generate(String reference, Map<String, Object> schema) [INPUTS] branches=- | result=schemaName [DATAFLOW] schemaName@param->L2 [C...
/* static context [FOCAL] public String YamlDocGenerator.generate(String schemaName) [INPUTS] branches=- | result=schemaName [CALLS-INTERNAL] String generate(String reference, Map<String, Object> schema) */
/* static context [FOCAL] public String YamlDocGenerator.generate(String schemaName) [INPUTS] branches=- | result=schemaName [CALLS-INTERNAL] String generate(String reference, Map<String, Object> schema) */ class YamlDocGenerator { public String generate(String schemaName) { return generate(schemaName, schema); ...
true
ok
{"focal": {"class": "YamlDocGenerator", "name": "generate", "signature": "String generate(String schemaName)", "start_line": 3, "modifiers": "public", "params": [{"name": "schemaName", "type": "String"}], "return_type": "String"}, "class_info": {"name": "YamlDocGenerator", "kind": "class", "modifiers": "", "superclass"...
113356740_1
class QueryResponseToProto { public static <T extends Message> T buildMessage(T message, Map<String, Object> fields) { @SuppressWarnings("unchecked") T populatedMessage = (T) buildMessage(message.toBuilder(), fields); return populatedMessage; } private QueryResponseToProto(); @SuppressWarnings("...
ProtoTruth.assertThat( QueryResponseToProto.buildMessage( TestProto.Proto1.getDefaultInstance(), ImmutableMap.of( "id", "abc", "intField", 123, "testProto", ...
[FOCAL] public static T QueryResponseToProto.buildMessage(T message, Map<String, Object> fields) [CLASS] class QueryResponseToProto [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Object buildMessage(Builder builder, Map<String, Object> fields) [CALLS-EXTERNAL] T.toBuilder/0 [INPUT...
/* static context [FOCAL] public static T QueryResponseToProto.buildMessage(T message, Map<String, Object> fields) [INPUTS] branches=- | result=fields, message [COLLABORATORS] param message:T toBuilder/0 [CALLS-INTERNAL] Object buildMessage(Builder builder, Map<String, Object> fields) [CALLS-EXTERNAL] T.toBuilder/0 */
/* static context [FOCAL] public static T QueryResponseToProto.buildMessage(T message, Map<String, Object> fields) [INPUTS] branches=- | result=fields, message [COLLABORATORS] param message:T toBuilder/0 [CALLS-INTERNAL] Object buildMessage(Builder builder, Map<String, Object> fields) [CALLS-EXTERNAL] T.toBuilder/0 */ ...
true
ok
{"focal": {"class": "QueryResponseToProto", "name": "buildMessage", "signature": "T buildMessage(T message, Map<String, Object> fields)", "start_line": 3, "modifiers": "public static", "params": [{"name": "message", "type": "T"}, {"name": "fields", "type": "Map<String, Object>"}], "return_type": "T"}, "class_info": {"n...
113375834_1255
class ExtraColumnsMetaDataProvider implements MetaDataProvider { @Override public Object getValue(String key) { Object value = null; if (myExtraColumns.containsKey(key)) { value = myExtraColumns.get(key); } else { value = myOriginal.ge...
EasyMockSupport support = new EasyMockSupport(); MetaDataProvider original = createProvider(support); Map<String, Object> extras = createExtraColumns(); support.replayAll(); ExtraColumnsMetaDataProvider provider = new ExtraColumnsMetaDataProvider(original, extras); as...
[FOCAL] @Override public Object ExtraColumnsMetaDataProvider.getValue(String key) [CLASS] class ExtraColumnsMetaDataProvider implements MetaDataProvider [METRICS] loc=15 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] myExtraColumns.containsKey/1, myExtraColumns.get/1, myOriginal.getValue/1 [PATH1...
/* static context [FOCAL] @Override public Object ExtraColumnsMetaDataProvider.getValue(String key) [PATH1] if(myExtraColumns.containsKey(key))=T -> return value [PATH2] if(myExtraColumns.containsKey(key))=F -> return value [INPUTS] branches=key | result=key [COLLABORATORS] field myExtraColumns containsKey/1,get/1; fie...
/* static context [FOCAL] @Override public Object ExtraColumnsMetaDataProvider.getValue(String key) [PATH1] if(myExtraColumns.containsKey(key))=T -> return value [PATH2] if(myExtraColumns.containsKey(key))=F -> return value [INPUTS] branches=key | result=key [COLLABORATORS] field myExtraColumns containsKey/1,get/1; fie...
true
ok
{"focal": {"class": "ExtraColumnsMetaDataProvider", "name": "getValue", "signature": "Object getValue(String key)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "key", "type": "String"}], "return_type": "Object"}, "class_info": {"name": "ExtraColumnsMetaDataProvider", "kind": "class", "modifier...
113380752_0
class RegistryServiceImpl implements RegistryService { @Override public API add(API api) { api.setId(UUID.randomUUID().toString()); jpaTemplate.tx( TransactionType.Required, entityManager -> { entityManager.persist(mapTo(api)); ...
API api = new API(); api.setContext("/simple"); api.setDescription("Simple API"); api.setName("Simple"); registryService.add(api); ClientDataSource dataSource = getDataSource(); try (Connection connection = dataSource.getConnection()) { try (Statemen...
[FOCAL] @Override public API RegistryServiceImpl.add(API api) [CLASS] class RegistryServiceImpl implements RegistryService [METRICS] loc=11 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] API.setId/1, UUID.randomUUID().toString/0, UUID.randomUUID/0, jpaTemplate.tx/2, entityManager.persist/1, mapTo...
/* static context [FOCAL] @Override public API RegistryServiceImpl.add(API api) [INPUTS] branches=- | result=api [COLLABORATORS] param api:API setId/1; field jpaTemplate tx/2; field entityManager persist/1,flush/0 [CALLS-EXTERNAL] API.setId/1, UUID.randomUUID().toString/0, UUID.randomUUID/0, jpaTemplate.tx/2, entityMan...
/* static context [FOCAL] @Override public API RegistryServiceImpl.add(API api) [INPUTS] branches=- | result=api [COLLABORATORS] param api:API setId/1; field jpaTemplate tx/2; field entityManager persist/1,flush/0 [CALLS-EXTERNAL] API.setId/1, UUID.randomUUID().toString/0, UUID.randomUUID/0, jpaTemplate.tx/2, entityMan...
true
ok
{"focal": {"class": "RegistryServiceImpl", "name": "add", "signature": "API add(API api)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "api", "type": "API"}], "return_type": "API"}, "class_info": {"name": "RegistryServiceImpl", "kind": "class", "modifiers": "", "superclass": null, "interfaces"...
113416930_1
class ThrowErrorTree extends PriorityTree { @Override protected void log(int priority, String tag, @NotNull String message, Throwable t) { if (skipLog(priority, tag, message, t)) { return; } if (t != null) { throw new LogPriorityExceededError(priority, getPriori...
ThrowErrorTree tree = new ThrowErrorTree(); Throwable testThrowable = new Throwable("test"); try { tree.log(Log.INFO, "tag", "message", testThrowable); fail("Expected LogPriorityExceededError"); } catch (LogPriorityExceededError e) { assertEquals(testT...
[FOCAL] @Override protected void ThrowErrorTree.log(int priority, String tag, String message, Throwable t) [CLASS] class ThrowErrorTree extends PriorityTree [METRICS] loc=12 cc=3 branches=2 loops=0 returns=1 throws=2 nesting=1 [CALLS-EXTERNAL] skipLog/4 (inherited), getPriorityFilter().getMinPriority/0, getPriorityFilt...
/* static context [FOCAL] @Override protected void ThrowErrorTree.log(int priority, String tag, String message, Throwable t) [THROWS-WHEN] LogPriorityExceededError when !skipLog(priority, tag, message, t) && t != null [THROWS-WHEN] LogPriorityExceededError when !skipLog(priority, tag, message, t) && !(t != null) [PATH1...
/* static context [FOCAL] @Override protected void ThrowErrorTree.log(int priority, String tag, String message, Throwable t) [THROWS-WHEN] LogPriorityExceededError when !skipLog(priority, tag, message, t) && t != null [THROWS-WHEN] LogPriorityExceededError when !skipLog(priority, tag, message, t) && !(t != null) [PATH1...
true
ok
{"focal": {"class": "ThrowErrorTree", "name": "log", "signature": "void log(int priority, String tag, String message, Throwable t)", "start_line": 3, "modifiers": "@Override protected", "params": [{"name": "priority", "type": "int"}, {"name": "tag", "type": "String"}, {"name": "message", "type": "String"}, {"name": "t"...
113425021_115
class Hasher { public Hasher putDouble(double d) { hasher.putDouble(d); return this; } public static Hasher of(HashFunction function); public HashCode hash(); public Hasher put(Hashable hashable); public Hasher putAll(Iterable<? extends Hashable> hashables); public Hasher putBoolean(boolean b); public Has...
assertThat(Hasher.of(HASH_FUNCTION).putDouble(0.0).putDouble(1.0).hash()) .isEqualTo(HASH_FUNCTION.newHasher().putDouble(0.0).putDouble(1.0).hash()); } }
[FOCAL] public Hasher Hasher.putDouble(double d) [CLASS] class Hasher [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] hasher.putDouble/1 [COLLABORATORS] field hasher putDouble/1 [DATAFLOW] d@param->L2 [CLASS-MEMBERS] Hasher of(HashFunction function); HashCode hash(); Hasher put(Has...
/* static context [FOCAL] public Hasher Hasher.putDouble(double d) [COLLABORATORS] field hasher putDouble/1 [CALLS-EXTERNAL] hasher.putDouble/1 */
/* static context [FOCAL] public Hasher Hasher.putDouble(double d) [COLLABORATORS] field hasher putDouble/1 [CALLS-EXTERNAL] hasher.putDouble/1 */ class Hasher { public Hasher putDouble(double d) { hasher.putDouble(d); return this; } public static Hasher of(HashFunction function); public HashCode hash(); pub...
true
ok
{"focal": {"class": "Hasher", "name": "putDouble", "signature": "Hasher putDouble(double d)", "start_line": 3, "modifiers": "public", "params": [{"name": "d", "type": "double"}], "return_type": "Hasher"}, "class_info": {"name": "Hasher", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields"...
113508911_0
class CertificateManager { public boolean hasNoCertificates() { return (certs == null || certs.length == 0); } CertificateManager(KeyStoreLoader loader); public void setPasswordRequestListener(KeyStoreEntryPasswordRequestListener passwordRequestListener); public void setKeyStoreRequestListe...
boolean hasNoCertificates = manager.hasNoCertificates(); assertFalse(hasNoCertificates); } }
[FOCAL] public boolean CertificateManager.hasNoCertificates() [CLASS] class CertificateManager [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] CertificateManager(KeyStoreLoader loader); void setPasswordRequestListener(KeyStoreEntryPasswordRequestListener passwordRequestListener); vo...
/* static context [FOCAL] public boolean CertificateManager.hasNoCertificates() */
/* static context [FOCAL] public boolean CertificateManager.hasNoCertificates() */ class CertificateManager { public boolean hasNoCertificates() { return (certs == null || certs.length == 0); } CertificateManager(KeyStoreLoader loader); public void setPasswordRequestListener(KeyStoreEntryPassw...
true
ok
{"focal": {"class": "CertificateManager", "name": "hasNoCertificates", "signature": "boolean hasNoCertificates()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "CertificateManager", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fiel...
113563925_18
class ScheduledActionHelpers { public static ScheduledAction getNextScheduledPayment(final @Nonnull LocalDate startOfTerm, final @Nonnull LocalDate fromDate, final @Nonnull LocalDate endOfTerm, ...
final LocalDate roughEndDate = ScheduledActionHelpers.getRoughEndDate(testCase.initialDisbursementDate, testCase.caseParameters); testCase.expectedResultContents.stream() .filter(x -> x.getAction() == Action.ACCEPT_PAYMENT) .forEach(expectedResultContents -> { final ScheduledAction nextSc...
[FOCAL] public static ScheduledAction ScheduledActionHelpers.getNextScheduledPayment(LocalDate startOfTerm, LocalDate fromDate, LocalDate endOfTerm, CaseParameters caseParameters) [CLASS] class ScheduledActionHelpers [METRICS] loc=12 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Stream<Scheduled...
/* static context [FOCAL] public static ScheduledAction ScheduledActionHelpers.getNextScheduledPayment(LocalDate startOfTerm, LocalDate fromDate, LocalDate endOfTerm, CaseParameters caseParameters) [INPUTS] branches=- | result=caseParameters, endOfTerm, fromDate, startOfTerm [COLLABORATORS] param fromDate:LocalDate isA...
/* static context [FOCAL] public static ScheduledAction ScheduledActionHelpers.getNextScheduledPayment(LocalDate startOfTerm, LocalDate fromDate, LocalDate endOfTerm, CaseParameters caseParameters) [INPUTS] branches=- | result=caseParameters, endOfTerm, fromDate, startOfTerm [COLLABORATORS] param fromDate:LocalDate isA...
true
ok
{"focal": {"class": "ScheduledActionHelpers", "name": "getNextScheduledPayment", "signature": "ScheduledAction getNextScheduledPayment(LocalDate startOfTerm, LocalDate fromDate, LocalDate endOfTerm, CaseParameters caseParameters)", "start_line": 3, "modifiers": "public static", "params": [{"name": "startOfTerm", "type"...
113564534_1
class ContactPointUtils { public static void process(final Cluster.Builder clusterBuilder, final String contactPoints) { final String[] splitContactPoints = contactPoints.split(","); for (final String contactPoint : splitContactPoints) { if (contactPoint.contains(":")) { final String[] address ...
final String contactPoints = "127.0.0.1:1234,127.0.0.2:2345,127.0.0.3:3456"; final Cluster.Builder clusterBuilder = Cluster.builder(); ContactPointUtils.process(clusterBuilder, contactPoints); final List<InetSocketAddress> addedClusterPoints = clusterBuilder.getContactPoints(); Assert.assertTrue(a...
[FOCAL] public static void ContactPointUtils.process(Cluster.Builder clusterBuilder, String contactPoints) [CLASS] class ContactPointUtils [METRICS] loc=16 cc=4 branches=1 loops=1 returns=0 throws=1 nesting=3 [CALLS-EXTERNAL] String.split/1, String.contains/1, Cluster.Builder.addContactPointsWithPorts/1, address[0].tri...
/* static context [FOCAL] public static void ContactPointUtils.process(Cluster.Builder clusterBuilder, String contactPoints) [THROWS-WHEN] IllegalArgumentException when foreach(String contactPoint : splitContactPoints)=T && !contactPoint.contains(":") && try-body throws [PATH1] foreach(String contactPoint : splitContac...
/* static context [FOCAL] public static void ContactPointUtils.process(Cluster.Builder clusterBuilder, String contactPoints) [THROWS-WHEN] IllegalArgumentException when foreach(String contactPoint : splitContactPoints)=T && !contactPoint.contains(":") && try-body throws [PATH1] foreach(String contactPoint : splitContac...
true
ok
{"focal": {"class": "ContactPointUtils", "name": "process", "signature": "void process(Cluster.Builder clusterBuilder, String contactPoints)", "start_line": 3, "modifiers": "public static", "params": [{"name": "clusterBuilder", "type": "Cluster.Builder"}, {"name": "contactPoints", "type": "String"}], "return_type": "vo...
113585452_0
class PahoRxMqttCallback implements RxMqttCallback, MqttCallbackExtended { public static PahoRxMqttCallback create( Consumer<Throwable> onConnectionLost, BiConsumer<Boolean, String> onConnectComplete) { return create( onConnectionLost, onConnectComplete, token -> { /* NOP */ }...
PahoRxMqttCallback rxMqttCallback = spy(PahoRxMqttCallback.create(cause -> {}, (recon, uri) -> {}, t -> {})); PahoRxMqttException exception = new PahoRxMqttException( new MqttException(MqttException.REASON_CODE_CONNECTION_LOST)); ArgumentCaptor<Throwable> onConnectionLostCauseArgumentCaptor = Argu...
[FOCAL] public static PahoRxMqttCallback PahoRxMqttCallback.create(Consumer<Throwable> onConnectionLost, BiConsumer<Boolean, String> onConnectComplete) [CLASS] class PahoRxMqttCallback implements RxMqttCallback, MqttCallbackExtended [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] P...
/* static context [FOCAL] public static PahoRxMqttCallback PahoRxMqttCallback.create(Consumer<Throwable> onConnectionLost, BiConsumer<Boolean, String> onConnectComplete) [INPUTS] branches=- | result=onConnectComplete, onConnectionLost [CALLS-INTERNAL] PahoRxMqttCallback create(Consumer<Throwable> onConnectionLost, BiCo...
/* static context [FOCAL] public static PahoRxMqttCallback PahoRxMqttCallback.create(Consumer<Throwable> onConnectionLost, BiConsumer<Boolean, String> onConnectComplete) [INPUTS] branches=- | result=onConnectComplete, onConnectionLost [CALLS-INTERNAL] PahoRxMqttCallback create(Consumer<Throwable> onConnectionLost, BiCo...
true
ok
{"focal": {"class": "PahoRxMqttCallback", "name": "create", "signature": "PahoRxMqttCallback create(Consumer<Throwable> onConnectionLost, BiConsumer<Boolean, String> onConnectComplete)", "start_line": 3, "modifiers": "public static", "params": [{"name": "onConnectionLost", "type": "Consumer<Throwable>"}, {"name": "onCo...
113597154_117
class MatchingServiceHealthCheckResource { @GET public Response performMatchingServiceHealthCheck() { final AggregatedMatchingServicesHealthCheckResult result = matchingServiceHealthCheckHandler.handle(); final Response.ResponseBuilder response = result.isHealthy() ? Response.ok() : Response.s...
final String failureDescription = "some-error-description"; AggregatedMatchingServicesHealthCheckResult result = new AggregatedMatchingServicesHealthCheckResult(); result.addResult(unhealthy(aMatchingServiceHealthCheckDetails().withDetails(failureDescription).build())); when(handler.hand...
[FOCAL] @GET public Response MatchingServiceHealthCheckResource.performMatchingServiceHealthCheck() [CLASS] class MatchingServiceHealthCheckResource [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] matchingServiceHealthCheckHandler.handle/0, AggregatedMatchingServicesHealthCheckResu...
/* static context [FOCAL] @GET public Response MatchingServiceHealthCheckResource.performMatchingServiceHealthCheck() [COLLABORATORS] field matchingServiceHealthCheckHandler handle/0 [CALLS-EXTERNAL] matchingServiceHealthCheckHandler.handle/0, AggregatedMatchingServicesHealthCheckResult.isHealthy/0, Response.ok/0, Resp...
/* static context [FOCAL] @GET public Response MatchingServiceHealthCheckResource.performMatchingServiceHealthCheck() [COLLABORATORS] field matchingServiceHealthCheckHandler handle/0 [CALLS-EXTERNAL] matchingServiceHealthCheckHandler.handle/0, AggregatedMatchingServicesHealthCheckResult.isHealthy/0, Response.ok/0, Resp...
true
ok
{"focal": {"class": "MatchingServiceHealthCheckResource", "name": "performMatchingServiceHealthCheck", "signature": "Response performMatchingServiceHealthCheck()", "start_line": 3, "modifiers": "@GET public", "params": [], "return_type": "Response"}, "class_info": {"name": "MatchingServiceHealthCheckResource", "kind": ...
113597875_26
class AsyncListenableFuture extends FiberAsync<V, ExecutionException> { public static <V> V get(ListenableFuture<V> future) throws ExecutionException, InterruptedException, SuspendExecution { if (Fiber.isCurrentFiber() && !future.isDone()) return new AsyncListenableFuture<>(future).run(); ...
final SettableFuture<String> fut = SettableFuture.create(); final Fiber<String> fiber = new Fiber<>(scheduler, new SuspendableCallable<String>() { @Override public String run() throws SuspendExecution, InterruptedException { try { String res =...
[FOCAL] public static V AsyncListenableFuture.get(ListenableFuture<V> future) [CLASS] class AsyncListenableFuture extends FiberAsync<V, ExecutionException> [METRICS] loc=6 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] Fiber.isCurrentFiber/0, ListenableFuture<V>.isDone/0, new AsyncListenableFutur...
/* static context [FOCAL] public static V AsyncListenableFuture.get(ListenableFuture<V> future) [PATH1] if(Fiber.isCurrentFiber() && !future.isDone())=T -> return new AsyncListenableFuture<>(future).run() [PATH2] if(Fiber.isCurrentFiber() && !future.isDone())=F -> return future.get() [INPUTS] branches=future | result=f...
/* static context [FOCAL] public static V AsyncListenableFuture.get(ListenableFuture<V> future) [PATH1] if(Fiber.isCurrentFiber() && !future.isDone())=T -> return new AsyncListenableFuture<>(future).run() [PATH2] if(Fiber.isCurrentFiber() && !future.isDone())=F -> return future.get() [INPUTS] branches=future | result=f...
true
ok
{"focal": {"class": "AsyncListenableFuture", "name": "get", "signature": "V get(ListenableFuture<V> future) throws ExecutionException, InterruptedException, SuspendExecution", "start_line": 3, "modifiers": "public static", "params": [{"name": "future", "type": "ListenableFuture<V>"}], "return_type": "V"}, "class_info":...
113689042_2
class GameBoard { public boolean addObstacle(Obstacle o) { return verifyObstacle(o) ? obstacles.add(o) : false; } public GameBoard(); public GameBoard(int map); private void initializeGameMap(int map); public boolean verifyObstacle(Obstacle o); public boolean addObstacle(MovingO...
assertTrue(board.addObstacle(new Obstacle(5, 10, 0, 0))); assertTrue(board.addObstacle(new Obstacle(25, 25, BOARD_SIZE - 25, BOARD_SIZE - 25))); verifyTaken(0, 0); verifyTaken(4, 9); verifyTaken(BOARD_SIZE - 25, BOARD_SIZE - 25); verifyTaken(BOARD_SIZE - 1, BOARD_SIZE -...
[FOCAL] public boolean GameBoard.addObstacle(Obstacle o) [CLASS] class GameBoard [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] boolean verifyObstacle(Obstacle o) [CALLS-EXTERNAL] obstacles.add/1 [INPUTS] branches=- | result=o [COLLABORATORS] field obstacles add/1 [DATAFLOW] o@par...
/* static context [FOCAL] public boolean GameBoard.addObstacle(Obstacle o) [INPUTS] branches=- | result=o [COLLABORATORS] field obstacles add/1 [CALLS-INTERNAL] boolean verifyObstacle(Obstacle o) [CALLS-EXTERNAL] obstacles.add/1 */
/* static context [FOCAL] public boolean GameBoard.addObstacle(Obstacle o) [INPUTS] branches=- | result=o [COLLABORATORS] field obstacles add/1 [CALLS-INTERNAL] boolean verifyObstacle(Obstacle o) [CALLS-EXTERNAL] obstacles.add/1 */ class GameBoard { public boolean addObstacle(Obstacle o) { return verifyObs...
true
ok
{"focal": {"class": "GameBoard", "name": "addObstacle", "signature": "boolean addObstacle(Obstacle o)", "start_line": 3, "modifiers": "public", "params": [{"name": "o", "type": "Obstacle"}], "return_type": "boolean"}, "class_info": {"name": "GameBoard", "kind": "class", "modifiers": "", "superclass": null, "interfaces"...
113726044_0
class Wordpath { public Vertex combine(int from, int length) { this.connect(from, length); if (wordnet.isNotContains(from, length)) { return wordnet.put(from, length); } else { return wordnet.getVertex(from, length); } } public Wordpath(Wordnet word...
String line = "我的中国心"; Wordpath wordPath = new Wordpath(new Wordnet(line.toCharArray())); wordPath.combine(0, 2); wordPath.combine(2, 3); Assert.assertEquals("我的 | 中国心", wordPath.toString()); } }
[FOCAL] public Vertex Wordpath.combine(int from, int length) [CLASS] class Wordpath [METRICS] loc=8 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] void connect(int from, int length) [CALLS-EXTERNAL] wordnet.isNotContains/2, wordnet.put/2, wordnet.getVertex/2 [PATH1] if(wordnet.isNotContains(from,...
/* static context [FOCAL] public Vertex Wordpath.combine(int from, int length) [PATH1] if(wordnet.isNotContains(from, length))=T -> return wordnet.put(from, length) [PATH2] if(wordnet.isNotContains(from, length))=F -> return wordnet.getVertex(from, length) [INPUTS] branches=from, length | result=from, length [COLLABORA...
/* static context [FOCAL] public Vertex Wordpath.combine(int from, int length) [PATH1] if(wordnet.isNotContains(from, length))=T -> return wordnet.put(from, length) [PATH2] if(wordnet.isNotContains(from, length))=F -> return wordnet.getVertex(from, length) [INPUTS] branches=from, length | result=from, length [COLLABORA...
true
ok
{"focal": {"class": "Wordpath", "name": "combine", "signature": "Vertex combine(int from, int length)", "start_line": 3, "modifiers": "public", "params": [{"name": "from", "type": "int"}, {"name": "length", "type": "int"}], "return_type": "Vertex"}, "class_info": {"name": "Wordpath", "kind": "class", "modifiers": "", "...
113899964_1
class LifoBlockingLimiter implements Limiter<ContextT> { @Override public Optional<Listener> acquire(ContextT context) { return tryAcquire(context).map(delegate -> new Listener() { @Override public void onSuccess() { delegate.onSuccess(); unblock(...
// Acquire all 4 available tokens List<Optional<Limiter.Listener>> listeners = acquireN(blockingLimiter, 4); // Schedule one to release in 250 msec Executors.newSingleThreadScheduledExecutor().schedule(() -> listeners.get(0).get().onSuccess(), 250, TimeUnit.MILLISECONDS); // Ne...
[FOCAL] @Override public Optional<Listener> LifoBlockingLimiter.acquire(ContextT context) [CLASS] class LifoBlockingLimiter implements Limiter<ContextT> [METRICS] loc=22 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Optional<Listener> tryAcquire(ContextT context); void unblock() [CALLS-EXTERNAL]...
/* static context [FOCAL] @Override public Optional<Listener> LifoBlockingLimiter.acquire(ContextT context) [INPUTS] branches=- | result=context [COLLABORATORS] field delegate onSuccess/0,onIgnore/0,onDropped/0 [CALLS-INTERNAL] Optional<Listener> tryAcquire(ContextT context); void unblock() [NEW] Listener [CALLS-EXTERN...
/* static context [FOCAL] @Override public Optional<Listener> LifoBlockingLimiter.acquire(ContextT context) [INPUTS] branches=- | result=context [COLLABORATORS] field delegate onSuccess/0,onIgnore/0,onDropped/0 [CALLS-INTERNAL] Optional<Listener> tryAcquire(ContextT context); void unblock() [NEW] Listener [CALLS-EXTERN...
true
ok
{"focal": {"class": "LifoBlockingLimiter", "name": "acquire", "signature": "Optional<Listener> acquire(ContextT context)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "context", "type": "ContextT"}], "return_type": "Optional<Listener>"}, "class_info": {"name": "LifoBlockingLimiter", "kind": "c...
114149111_1
class VirtualMetric extends AbstractMetric<V> { @Override public ImmutableList<MetricPoint<V>> getTimestampedValues() { return getTimestampedValues(Instant.now()); } VirtualMetric( String name, String description, String valueDisplayName, ImmutableSet<LabelDescriptor> labels, ...
assertThat(metric.getTimestampedValues(Instant.ofEpochMilli(1337))) .containsExactly( MetricPoint.create( metric, ImmutableList.of("label_value1"), Instant.ofEpochMilli(1337), "value1"), MetricPoint.create( metric, ImmutableList.of("label_value2"), Ins...
[FOCAL] @Override public ImmutableList<MetricPoint<V>> VirtualMetric.getTimestampedValues() [CLASS] class VirtualMetric extends AbstractMetric<V> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] ImmutableList<MetricPoint<V>> getTimestampedValues(Instant timestamp) [CALLS-EXTERNAL] I...
/* static context [FOCAL] @Override public ImmutableList<MetricPoint<V>> VirtualMetric.getTimestampedValues() [CALLS-INTERNAL] ImmutableList<MetricPoint<V>> getTimestampedValues(Instant timestamp) [CALLS-EXTERNAL] Instant.now/0 */
/* static context [FOCAL] @Override public ImmutableList<MetricPoint<V>> VirtualMetric.getTimestampedValues() [CALLS-INTERNAL] ImmutableList<MetricPoint<V>> getTimestampedValues(Instant timestamp) [CALLS-EXTERNAL] Instant.now/0 */ class VirtualMetric extends AbstractMetric<V> { @Override public ImmutableList<Metri...
true
ok
{"focal": {"class": "VirtualMetric", "name": "getTimestampedValues", "signature": "ImmutableList<MetricPoint<V>> getTimestampedValues()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "ImmutableList<MetricPoint<V>>"}, "class_info": {"name": "VirtualMetric", "kind": "class", "modifiers":...
114157177_36
class StrictMetricsEvaluator { public boolean eval(DataFile file) { // TODO: detect the case where a column is missing from the file using file's max field id. return visitor().eval(file); } public StrictMetricsEvaluator(Schema schema, Expression unbound); private MetricsEvalVisitor visitor(); pr...
boolean shouldRead = new StrictMetricsEvaluator(SCHEMA, notNull("all_nulls")).eval(FILE); Assert.assertFalse("Should not match: no non-null value in all null column", shouldRead); shouldRead = new StrictMetricsEvaluator(SCHEMA, notNull("some_nulls")).eval(FILE); Assert.assertFalse("Should not match: co...
[FOCAL] public boolean StrictMetricsEvaluator.eval(DataFile file) [CLASS] class StrictMetricsEvaluator [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] MetricsEvalVisitor visitor() [CALLS-EXTERNAL] visitor().eval/1 [INPUTS] branches=- | result=file [DATAFLOW] file@param->L3 [CLASS-M...
/* static context [FOCAL] public boolean StrictMetricsEvaluator.eval(DataFile file) [INPUTS] branches=- | result=file [CALLS-INTERNAL] MetricsEvalVisitor visitor() [CALLS-EXTERNAL] visitor().eval/1 */
/* static context [FOCAL] public boolean StrictMetricsEvaluator.eval(DataFile file) [INPUTS] branches=- | result=file [CALLS-INTERNAL] MetricsEvalVisitor visitor() [CALLS-EXTERNAL] visitor().eval/1 */ class StrictMetricsEvaluator { public boolean eval(DataFile file) { // TODO: detect the case where a column is m...
true
ok
{"focal": {"class": "StrictMetricsEvaluator", "name": "eval", "signature": "boolean eval(DataFile file)", "start_line": 3, "modifiers": "public", "params": [{"name": "file", "type": "DataFile"}], "return_type": "boolean"}, "class_info": {"name": "StrictMetricsEvaluator", "kind": "class", "modifiers": "", "superclass": ...
114263933_47
class SPPDecoder implements MALDecoder { @Override public UOctet decodeUOctet() throws MALException { return new UOctet((short) (read() & 0xFF)); } public SPPDecoder(final InputStream inputStream, final Map properties); @Override public Boolean decodeBoolean(); @Override public Boolean decodeNullableBoolean...
newBuffer(new byte[]{}); try { decoder.decodeUOctet(); fail("Expected exception, but none thrown."); } catch (MALException ex) { assertEquals(SPPDecoder.INSUFFICIENT_DATA, ex.getMessage()); } } }
[FOCAL] @Override public UOctet SPPDecoder.decodeUOctet() [CLASS] class SPPDecoder implements MALDecoder [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] byte read() [NEW] UOctet [EXCEPTIONS] declares MALException [CLASS-MEMBERS] SPPDecoder(InputStream inputStream, Map properties); ...
/* static context [FOCAL] @Override public UOctet SPPDecoder.decodeUOctet() [EXCEPTIONS] declares MALException [CALLS-INTERNAL] byte read() [NEW] UOctet */
/* static context [FOCAL] @Override public UOctet SPPDecoder.decodeUOctet() [EXCEPTIONS] declares MALException [CALLS-INTERNAL] byte read() [NEW] UOctet */ class SPPDecoder implements MALDecoder { @Override public UOctet decodeUOctet() throws MALException { return new UOctet((short) (read() & 0xFF)); } public ...
true
ok
{"focal": {"class": "SPPDecoder", "name": "decodeUOctet", "signature": "UOctet decodeUOctet() throws MALException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "UOctet"}, "class_info": {"name": "SPPDecoder", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "MALDecod...
114273718_0
class RequestSignature implements HttpRequestInterceptor { @Override public void process(HttpRequest request, HttpContext context) throws HttpException, IOException { try { this.messageSigner.sign(new Request(request)); } catch (GeneralSecurityException e) { throw new HttpException("Can't sign HTTP request...
HttpMessageSigner httpSignature = HttpMessageSigner.builder() .algorithm(Algorithm.RSA_SHA256) .keyMap(HashKeyMap.INSTANCE) .addHeaderToSign(HttpMessageSigner.REQUEST_TARGET) .addHeaderToSign("Date") .addHeaderToSign("Content-Length") .addHeaderToSign("Digest") .keyId("myKeyId").build(); ...
[FOCAL] @Override public void RequestSignature.process(HttpRequest request, HttpContext context) [CLASS] class RequestSignature implements HttpRequestInterceptor [METRICS] loc=8 cc=2 branches=0 loops=0 returns=0 throws=1 nesting=1 [CALLS-EXTERNAL] this.messageSigner.sign/1 [NEW] Request, HttpException [FIELDS] read=mes...
/* static context [FOCAL] @Override public void RequestSignature.process(HttpRequest request, HttpContext context) [THROWS-WHEN] HttpException when try-body throws [PATH1] try-body throws -> throw new HttpException("Can't sign HTTP request '" + request + "'", e) [INPUTS] branches=- | result=request | unused=context [CO...
/* static context [FOCAL] @Override public void RequestSignature.process(HttpRequest request, HttpContext context) [THROWS-WHEN] HttpException when try-body throws [PATH1] try-body throws -> throw new HttpException("Can't sign HTTP request '" + request + "'", e) [INPUTS] branches=- | result=request | unused=context [CO...
true
ok
{"focal": {"class": "RequestSignature", "name": "process", "signature": "void process(HttpRequest request, HttpContext context) throws HttpException, IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "request", "type": "HttpRequest"}, {"name": "context", "type": "HttpContext"}], "retur...
114312965_12
class HMSClient implements AutoCloseable { public Set<String> getAllTables(@NotNull String dbName, @Nullable String filter) throws TException { if (filter == null || filter.isEmpty()) { return new HashSet<>(client.get_all_tables(dbName)); } return client.get_all_tables(dbName) .stream() ...
try { client.createTable(TEST_TABLE); assertThat(client.getAllTables(TEST_DATABASE, null), contains(TEST_TABLE_NAME)); } catch (Exception e) { System.out.println(e.getMessage()); e.printStackTrace(); } finally { client.dropTable(TEST_DATABASE, TEST_TABLE_NAME); } } }
[FOCAL] public Set<String> HMSClient.getAllTables(String dbName, String filter) [CLASS] class HMSClient implements AutoCloseable [METRICS] loc=9 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] String.isEmpty/0, HMSClient.get_all_tables/1, client.get_all_tables(dbName) .stream() .filter(n -> n.ma.....
/* static context [FOCAL] public Set<String> HMSClient.getAllTables(String dbName, String filter) [PATH1] if(filter == null || filter.isEmpty())=T -> return new HashSet<>(client.get_all_tables(dbName)) [PATH2] if(filter == null || filter.isEmpty())=F -> return client.get_all_tables(dbName) .stream() .filter(n -> n.matc...
/* static context [FOCAL] public Set<String> HMSClient.getAllTables(String dbName, String filter) [PATH1] if(filter == null || filter.isEmpty())=T -> return new HashSet<>(client.get_all_tables(dbName)) [PATH2] if(filter == null || filter.isEmpty())=F -> return client.get_all_tables(dbName) .stream() .filter(n -> n.matc...
true
ok
{"focal": {"class": "HMSClient", "name": "getAllTables", "signature": "Set<String> getAllTables(String dbName, String filter) throws TException", "start_line": 3, "modifiers": "public", "params": [{"name": "dbName", "type": "String"}, {"name": "filter", "type": "String"}], "return_type": "Set<String>"}, "class_info": {...
114408926_0
class ScreenshotFileProvider { String cleanseTag(@NonNull String tag) { final String originalTag = tag; tag = tag.toLowerCase().replaceAll(" ", "_").replaceAll("[^A-Za-z0-9_]", ""); if (!originalTag.equals(tag)) { log("Cleansed Tag: [" + originalTag + "] -> [" + tag + "]"); ...
String cleansed = new ScreenshotFileProviderNoOp().cleanseTag("a b c * $ ! d"); assertThat(cleansed).isEqualTo("a_b_c____d"); } }
[FOCAL] String ScreenshotFileProvider.cleanseTag(String tag) [CLASS] class ScreenshotFileProvider [METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] tag.toLowerCase().replaceAll(" ", "_").replaceAll/2, tag.toLowerCase().replaceAll/2, String.toLowerCase/0, String.equals/1, log/1 (inher...
/* static context [FOCAL] String ScreenshotFileProvider.cleanseTag(String tag) [PATH1] if(!originalTag.equals(tag))=T -> return tag [PATH2] if(!originalTag.equals(tag))=F -> return tag [INPUTS] branches=tag | result=tag [CALLS-EXTERNAL] tag.toLowerCase().replaceAll(" ", "_").replaceAll/2, tag.toLowerCase().replaceAll/2...
/* static context [FOCAL] String ScreenshotFileProvider.cleanseTag(String tag) [PATH1] if(!originalTag.equals(tag))=T -> return tag [PATH2] if(!originalTag.equals(tag))=F -> return tag [INPUTS] branches=tag | result=tag [CALLS-EXTERNAL] tag.toLowerCase().replaceAll(" ", "_").replaceAll/2, tag.toLowerCase().replaceAll/2...
true
ok
{"focal": {"class": "ScreenshotFileProvider", "name": "cleanseTag", "signature": "String cleanseTag(String tag)", "start_line": 3, "modifiers": "", "params": [{"name": "tag", "type": "String"}], "return_type": "String"}, "class_info": {"name": "ScreenshotFileProvider", "kind": "class", "modifiers": "", "superclass": nu...
114418594_45
class Part4Backpressure { @Complexity(EASY) public static Flux<String> dropElementsOnBackpressure(Flux<String> upstream) { // TODO: apply backpressure to drop elements on downstream overwhelming // HINT: Flux#onBackpressureDrop throw new RuntimeException("Not implemented"); } ...
DirectProcessor<String> processor = DirectProcessor.create(); StepVerifier .create(dropElementsOnBackpressure(processor), 0) .expectSubscription() .then(() -> processor.onNext("")) .then(() -> processor.onNext("")) .thenRequ...
[FOCAL] @Complexity(EASY) public static Flux<String> Part4Backpressure.dropElementsOnBackpressure(Flux<String> upstream) [CLASS] class Part4Backpressure [METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=1 nesting=0 [NEW] RuntimeException [EXCEPTIONS] throws RuntimeException [THROWS-WHEN] RuntimeException when al...
/* static context [FOCAL] @Complexity(EASY) public static Flux<String> Part4Backpressure.dropElementsOnBackpressure(Flux<String> upstream) [THROWS-WHEN] RuntimeException when always [INPUTS] branches=- | result=- | unused=upstream [EXCEPTIONS] throws RuntimeException [NEW] RuntimeException */
/* static context [FOCAL] @Complexity(EASY) public static Flux<String> Part4Backpressure.dropElementsOnBackpressure(Flux<String> upstream) [THROWS-WHEN] RuntimeException when always [INPUTS] branches=- | result=- | unused=upstream [EXCEPTIONS] throws RuntimeException [NEW] RuntimeException */ class Part4Backpressure { ...
true
ok
{"focal": {"class": "Part4Backpressure", "name": "dropElementsOnBackpressure", "signature": "Flux<String> dropElementsOnBackpressure(Flux<String> upstream)", "start_line": 3, "modifiers": "@Complexity(EASY) public static", "params": [{"name": "upstream", "type": "Flux<String>"}], "return_type": "Flux<String>"}, "class_...
114489910_12
class OrderServiceImpl implements OrderService { @Override @Transactional(readOnly = true) public IngredientType getIngredientTypeByIngredientId(Long ingredientId) { return ingredientDAO.findById(ingredientId).orElseThrow(RuntimeException::new).getIngredientType(); } @Override @Transaction...
// given IngredientType ingredientType = new IngredientType(); Long ingredientId = 42L; Ingredient ingredient = new Ingredient(); ingredient.setId(ingredientId); ingredient.setIngredientType(ingredientType); when(ingredientDAO.findById(ingredientId)).thenReturn(O...
[FOCAL] @Override @Transactional(readOnly = true) public IngredientType OrderServiceImpl.getIngredientTypeByIngredientId(Long ingredientId) [CLASS] class OrderServiceImpl implements OrderService [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] ingredientDAO.findById(ingredientId).or...
/* static context [FOCAL] @Override @Transactional(readOnly = true) public IngredientType OrderServiceImpl.getIngredientTypeByIngredientId(Long ingredientId) [INPUTS] branches=- | result=ingredientId, ingredientDAO [COLLABORATORS] field ingredientDAO:IngredientDAO findById/1 [FIELDS] read=ingredientDAO:IngredientDAO [C...
/* static context [FOCAL] @Override @Transactional(readOnly = true) public IngredientType OrderServiceImpl.getIngredientTypeByIngredientId(Long ingredientId) [INPUTS] branches=- | result=ingredientId, ingredientDAO [COLLABORATORS] field ingredientDAO:IngredientDAO findById/1 [FIELDS] read=ingredientDAO:IngredientDAO [C...
true
ok
{"focal": {"class": "OrderServiceImpl", "name": "getIngredientTypeByIngredientId", "signature": "IngredientType getIngredientTypeByIngredientId(Long ingredientId)", "start_line": 3, "modifiers": "@Override @Transactional(readOnly = true) public", "params": [{"name": "ingredientId", "type": "Long"}], "return_type": "Ing...
114520717_207
class Listener4Assist implements ListenerAssist { public synchronized void taskEnd(DownloadTask task, EndCause cause, @Nullable Exception realCause) { Listener4Model model = modelHandler.removeOrCreate(task, task.getInfo()); if (assistExtend != null ...
when(handler.removeOrCreate(task, info)).thenReturn(model); assist.taskEnd(task, EndCause.COMPLETED, null); verify(callback).taskEnd(eq(task), eq(EndCause.COMPLETED), nullable(Exception.class), any(Listener4Assist.Listener4Model.class)); } }
[FOCAL] public synchronized void Listener4Assist.taskEnd(DownloadTask task, EndCause cause, Exception realCause) [CLASS] class Listener4Assist implements ListenerAssist [METRICS] loc=10 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] modelHandler.removeOrCreate/2, DownloadTask.getInfo/0, Listener4...
/* static context [FOCAL] public synchronized void Listener4Assist.taskEnd(DownloadTask task, EndCause cause, Exception realCause) [PATH1] if(assistExtend != null && assistExtend.dispatchTaskEnd(task, cause, realCause, model))=T -> return [PATH2] if(assistExtend != null && assistExtend.dispatchTaskEnd(task, cause, real...
/* static context [FOCAL] public synchronized void Listener4Assist.taskEnd(DownloadTask task, EndCause cause, Exception realCause) [PATH1] if(assistExtend != null && assistExtend.dispatchTaskEnd(task, cause, realCause, model))=T -> return [PATH2] if(assistExtend != null && assistExtend.dispatchTaskEnd(task, cause, real...
true
ok
{"focal": {"class": "Listener4Assist", "name": "taskEnd", "signature": "void taskEnd(DownloadTask task, EndCause cause, Exception realCause)", "start_line": 3, "modifiers": "public synchronized", "params": [{"name": "task", "type": "DownloadTask"}, {"name": "cause", "type": "EndCause"}, {"name": "realCause", "type": "E...
114649434_8
class CRC16 { public static int MCRF4XX(@NonNull final byte[] data, final int offset, final int length) { return CRC(0x1021, 0xFFFF, data, offset, length, true, true, 0x0000); } private CRC16(); public static int CCITT_Kermit(@NonNull final byte[] data, final int offset, final int length); public static int ...
final byte[] data = new byte[] { 'A' }; assertEquals(0x5C0A, CRC16.MCRF4XX(data, 0, 1)); } }
[FOCAL] public static int CRC16.MCRF4XX(byte[] data, int offset, int length) [CLASS] class CRC16 [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] int CRC(int poly, int init, byte[] data, int offset, int length, boolean refin, boolean refout, int xorout) [INPUTS] branches=- | result=...
/* static context [FOCAL] public static int CRC16.MCRF4XX(byte[] data, int offset, int length) [INPUTS] branches=- | result=data, length, offset [CALLS-INTERNAL] int CRC(int poly, int init, byte[] data, int offset, int length, boolean refin, boolean refout, int xorout) */
/* static context [FOCAL] public static int CRC16.MCRF4XX(byte[] data, int offset, int length) [INPUTS] branches=- | result=data, length, offset [CALLS-INTERNAL] int CRC(int poly, int init, byte[] data, int offset, int length, boolean refin, boolean refout, int xorout) */ class CRC16 { public static int MCRF4XX(@NonN...
true
ok
{"focal": {"class": "CRC16", "name": "MCRF4XX", "signature": "int MCRF4XX(byte[] data, int offset, int length)", "start_line": 3, "modifiers": "public static", "params": [{"name": "data", "type": "byte[]"}, {"name": "offset", "type": "int"}, {"name": "length", "type": "int"}], "return_type": "int"}, "class_info": {"nam...
114670580_2
class RemoteAccessOpHandler { <K, V, U> void onTableAccessReqMsg(final long opId, final TableAccessReqMsg msg) { final String origEvalId = msg.getOrigId(); final OpType opType = msg.getOpType(); final boolean replyRequired = msg.getReplyRequired(); final String tableId = msg.getTableId(); final ...
final long origOpId = 0; doAnswer(invocation -> { final Object[] arguments = invocation.getArguments(); final String origId = (String) arguments[0]; final String destId = (String) arguments[1]; final long opId = (long) arguments[2]; assertEquals("The origin ID should be kept same...
[FOCAL] void RemoteAccessOpHandler.onTableAccessReqMsg(long opId, TableAccessReqMsg msg) [CLASS] class RemoteAccessOpHandler [METRICS] loc=86 cc=8 branches=3 loops=0 returns=2 throws=1 nesting=2 [CALLS-INTERNAL] boolean registerOp(String tableId, TableComponents tableComponents); void redirectToMaster(long opId, TableA...
class RemoteAccessOpHandler { <K, V, U> void onTableAccessReqMsg(final long opId, final TableAccessReqMsg msg) { final String origEvalId = msg.getOrigId(); final OpType opType = msg.getOpType(); final boolean replyRequired = msg.getReplyRequired(); final String tableId = msg.getTableId(); final ...
false
ok
{"focal": {"class": "RemoteAccessOpHandler", "name": "onTableAccessReqMsg", "signature": "void onTableAccessReqMsg(long opId, TableAccessReqMsg msg)", "start_line": 3, "modifiers": "", "params": [{"name": "opId", "type": "long"}, {"name": "msg", "type": "TableAccessReqMsg"}], "return_type": "void"}, "class_info": {"nam...
114688767_69
class PathBidirRef extends Path { @Override public Path extract() { if (sptEntry == null || edgeTo == null) return this; if (sptEntry.adjNode != edgeTo.adjNode) throw new IllegalStateException("Locations of the 'to'- and 'from'-Edge has to be the same." + toString() + "...
Graph g = createGraph(); g.edge(1, 2, 10, false); g.edge(2, 3, 20, false); EdgeExplorer explorer = g.createEdgeExplorer(carOutEdges); EdgeIterator iter = explorer.setBaseNode(1); iter.next(); PathBidirRef pw = new PathBidirRef(g, new FastestWeighting(carEncoder));...
[FOCAL] @Override public Path PathBidirRef.extract() [CLASS] class PathBidirRef extends Path [METRICS] loc=40 cc=6 branches=3 loops=2 returns=2 throws=1 nesting=1 [CALLS-EXTERNAL] toString/0 (inherited), extractSW.start/0, EdgeIterator.Edge.isValid/1, processEdge/3 (inherited), setFromNode/1 (inherited), reverseOrder/0...
/* static context [FOCAL] @Override public Path PathBidirRef.extract() [THROWS-WHEN] IllegalStateException when !(sptEntry == null || edgeTo == null) && sptEntry.adjNode != edgeTo.adjNode [PATH1] if(sptEntry == null || edgeTo == null)=F -> if(sptEntry.adjNode != edgeTo.adjNode)=F -> if(switchFromAndToSPTEntry)=T -> whi...
/* static context [FOCAL] @Override public Path PathBidirRef.extract() [THROWS-WHEN] IllegalStateException when !(sptEntry == null || edgeTo == null) && sptEntry.adjNode != edgeTo.adjNode [PATH1] if(sptEntry == null || edgeTo == null)=F -> if(sptEntry.adjNode != edgeTo.adjNode)=F -> if(switchFromAndToSPTEntry)=T -> whi...
true
ok
{"focal": {"class": "PathBidirRef", "name": "extract", "signature": "Path extract()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Path"}, "class_info": {"name": "PathBidirRef", "kind": "class", "modifiers": "", "superclass": "Path", "interfaces": null, "fields": [{"name": "encodingMa...
114698912_0
class TopicFilter implements Predicate<String> { @Override public boolean test(String topicName) { int tc = 0; int fc = 0; while(true) { // begin of path part if( filter.charAt(fc) == '+') { fc++; // eat + // matches one path part, skip all up to / or end in topic while( (tc < ...
TopicFilter tf = new TopicFilter("aaa/ccc/bbb"); assertTrue( tf.test("aaa/ccc/bbb") ); assertFalse( tf.test("aaa/c/bbb") ); assertFalse( tf.test("aaa/ccccc/bbb") ); assertFalse( tf.test("aaa/ccccc/ccc") ); } }
[FOCAL] @Override public boolean TopicFilter.test(String topicName) [CLASS] class TopicFilter implements Predicate<String> [METRICS] loc=74 cc=11 branches=9 loops=3 returns=7 throws=0 nesting=3 [CALLS-EXTERNAL] filter.charAt/1, String.length/0, String.charAt/1, filter.length/0 [PATH1] while(true)#1=T -> if(filter.charA...
/* static context [FOCAL] @Override public boolean TopicFilter.test(String topicName) [PATH1] while(true)#1=T -> if(filter.charAt(fc) == '+')=F -> if(filter.charAt(fc) == '#')=F -> while(true)#2=T -> if((tc == topicName.length()) && ( fc == filter.length() ))#2=F -> if((tc == topicName.length()) || ( fc == filter.lengt...
/* static context [FOCAL] @Override public boolean TopicFilter.test(String topicName) [PATH1] while(true)#1=T -> if(filter.charAt(fc) == '+')=F -> if(filter.charAt(fc) == '#')=F -> while(true)#2=T -> if((tc == topicName.length()) && ( fc == filter.length() ))#2=F -> if((tc == topicName.length()) || ( fc == filter.lengt...
true
ok
{"focal": {"class": "TopicFilter", "name": "test", "signature": "boolean test(String topicName)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "topicName", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "TopicFilter", "kind": "class", "modifiers": "", "superclass": null, ...
114886091_6
class SignupFormValidator implements Validator { @Override public void validate(Object target, Errors errors) { SignupForm form = (SignupForm) target; validateUniqueEmail(form, errors); validateUniquePhone(form, errors); validateValidPhone(form, errors); validatePassword...
validator.validate(form, errors); verifyZeroInteractions(errors); } }
[FOCAL] @Override public void SignupFormValidator.validate(Object target, Errors errors) [CLASS] class SignupFormValidator implements Validator [METRICS] loc=8 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void validatePassword(SignupForm form, Errors errors); void validateUniqueEmail(SignupForm...
/* static context [FOCAL] @Override public void SignupFormValidator.validate(Object target, Errors errors) [CALLS-INTERNAL] void validatePassword(SignupForm form, Errors errors); void validateUniqueEmail(SignupForm form, Errors errors); void validateUniquePhone(SignupForm form, Errors errors); void validateValidPhone(S...
/* static context [FOCAL] @Override public void SignupFormValidator.validate(Object target, Errors errors) [CALLS-INTERNAL] void validatePassword(SignupForm form, Errors errors); void validateUniqueEmail(SignupForm form, Errors errors); void validateUniquePhone(SignupForm form, Errors errors); void validateValidPhone(S...
true
ok
{"focal": {"class": "SignupFormValidator", "name": "validate", "signature": "void validate(Object target, Errors errors)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "target", "type": "Object"}, {"name": "errors", "type": "Errors"}], "return_type": "void"}, "class_info": {"name": "SignupFormV...
114928169_21
class MsTeamsNotificationConfig { public boolean hasCustomContent() { return customContent; } @SuppressWarnings("unchecked") public MsTeamsNotificationConfig(Element e); public MsTeamsNotificationConfig(String token, Boolean enabled, BuildState states, boolea...
assertTrue(msteamsnotificationCustomContent.hasCustomContent()); } }
[FOCAL] public boolean MsTeamsNotificationConfig.hasCustomContent() [CLASS] class MsTeamsNotificationConfig [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] MsTeamsNotificationConfig(Element e); MsTeamsNotificationConfig(String token, Boolean enabled, BuildState states, boolean build...
/* static context [FOCAL] public boolean MsTeamsNotificationConfig.hasCustomContent() */
/* static context [FOCAL] public boolean MsTeamsNotificationConfig.hasCustomContent() */ class MsTeamsNotificationConfig { public boolean hasCustomContent() { return customContent; } @SuppressWarnings("unchecked") public MsTeamsNotificationConfig(Element e); public MsTeamsNotificationConfig(...
true
ok
{"focal": {"class": "MsTeamsNotificationConfig", "name": "hasCustomContent", "signature": "boolean hasCustomContent()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "MsTeamsNotificationConfig", "kind": "class", "modifiers": "", "superclass": null, "interfaces":...
115041372_2
class Casa { public int getGastoTotal() { int gasto = 0; Iterator<ComponenteElectrico> iterador = estufas.iterator(); while (iterador.hasNext()){ ComponenteElectrico estufa = iterador.next(); gasto = gasto + estufa.getConsumo(); } iterador = cerco...
Casa casa = new Casa(); ComponenteElectrico estufaDelBanio = new ComponenteElectrico("estufa"); estufaDelBanio.ambientes = 1; estufaDelBanio.precioKw = 10; estufaDelBanio.calorias = 1000; casa.estufas.add(estufaDelBanio); ComponenteElectrico losaComedor = new ...
[FOCAL] public int Casa.getGastoTotal() [CLASS] class Casa [METRICS] loc=27 cc=4 branches=0 loops=3 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] estufas.iterator/0, Iterator<ComponenteElectrico>.hasNext/0, Iterator<ComponenteElectrico>.next/0, ComponenteElectrico.getConsumo/0, cercos.iterator/0, losas.iterator/0 [PATH...
/* static context [FOCAL] public int Casa.getGastoTotal() [PATH1] while(iterador.hasNext())#1=T -> exit loop -> while(iterador.hasNext())#2=F -> while(iterador.hasNext())#3=F -> return gasto [PATH2] while(iterador.hasNext())#1=F -> while(iterador.hasNext())#2=T -> exit loop -> while(iterador.hasNext())#3=T -> exit loop...
/* static context [FOCAL] public int Casa.getGastoTotal() [PATH1] while(iterador.hasNext())#1=T -> exit loop -> while(iterador.hasNext())#2=F -> while(iterador.hasNext())#3=F -> return gasto [PATH2] while(iterador.hasNext())#1=F -> while(iterador.hasNext())#2=T -> exit loop -> while(iterador.hasNext())#3=T -> exit loop...
true
ok
{"focal": {"class": "Casa", "name": "getGastoTotal", "signature": "int getGastoTotal()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "Casa", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": []}, "ast": {"sexp": "(m...
115077083_1378
class OrchestrationStatusValidator { public void validateOrchestrationStatus(BuildingBlockExecution execution) { try { execution.setVariable(ORCHESTRATION_STATUS_VALIDATION_RESULT, null); String buildingBlockFlowName = execution.getFlowToBeCalled(); BuildingBlockDetail b...
String flowToBeCalled = "UnassignServiceInstanceBB"; execution.setVariable("flowToBeCalled", flowToBeCalled); execution.setVariable("aLaCarte", true); BuildingBlockDetail buildingBlockDetail = getBuildingBlockDetail("UnassignServiceInstanceBB", ResourceType.SERVICE, Orc...
[FOCAL] public void OrchestrationStatusValidator.validateOrchestrationStatus(BuildingBlockExecution execution) [CLASS] class OrchestrationStatusValidator [METRICS] loc=56 cc=12 branches=6 loops=0 returns=1 throws=3 nesting=2 [CALLS-INTERNAL] OrchestrationStatus getOrchestrationStatus(BuildingBlockExecution execution, S...
/* static context [FOCAL] public void OrchestrationStatusValidator.validateOrchestrationStatus(BuildingBlockExecution execution) [THROWS-WHEN] OrchestrationStatusValidationException when buildingBlockDetail == null [THROWS-WHEN] OrchestrationStatusValidationException when !(buildingBlockDetail == null) && !(buildingBlo...
/* static context [FOCAL] public void OrchestrationStatusValidator.validateOrchestrationStatus(BuildingBlockExecution execution) [THROWS-WHEN] OrchestrationStatusValidationException when buildingBlockDetail == null [THROWS-WHEN] OrchestrationStatusValidationException when !(buildingBlockDetail == null) && !(buildingBlo...
true
ok
{"focal": {"class": "OrchestrationStatusValidator", "name": "validateOrchestrationStatus", "signature": "void validateOrchestrationStatus(BuildingBlockExecution execution)", "start_line": 3, "modifiers": "public", "params": [{"name": "execution", "type": "BuildingBlockExecution"}], "return_type": "void"}, "class_info":...
115260386_8
class CourseDAOMemory implements CourseDAO { @Override public void save(Course course) { delete(course.getId()); course.setId(nextId()); courseList.add(course); } public CourseDAOMemory(); @Override public Course find(int courseId); @Override public void delete(int co...
Course course = new Course("TEST", "TEST", 1, 1); daoMemory.save(course); List<Course> all = daoMemory.findAll(); assertTrue(all.contains(course)); } }
[FOCAL] @Override public void CourseDAOMemory.save(Course course) [CLASS] class CourseDAOMemory implements CourseDAO [METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] int nextId(); void delete(int courseId) [CALLS-EXTERNAL] Course.getId/0, Course.setId/1, courseList.add/1 [COLLABORAT...
/* static context [FOCAL] @Override public void CourseDAOMemory.save(Course course) [COLLABORATORS] param course:Course getId/0,setId/1; field courseList add/1 [CALLS-INTERNAL] int nextId(); void delete(int courseId) [CALLS-EXTERNAL] Course.getId/0, Course.setId/1, courseList.add/1 */
/* static context [FOCAL] @Override public void CourseDAOMemory.save(Course course) [COLLABORATORS] param course:Course getId/0,setId/1; field courseList add/1 [CALLS-INTERNAL] int nextId(); void delete(int courseId) [CALLS-EXTERNAL] Course.getId/0, Course.setId/1, courseList.add/1 */ class CourseDAOMemory implements C...
true
ok
{"focal": {"class": "CourseDAOMemory", "name": "save", "signature": "void save(Course course)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "course", "type": "Course"}], "return_type": "void"}, "class_info": {"name": "CourseDAOMemory", "kind": "class", "modifiers": "", "superclass": null, "int...
115411826_3
class NodeTable { public synchronized Node addNode(Node n) { NodeEntry e = new NodeEntry(node.getId(), n); if (nodes.contains(e)) { nodes.forEach(nodeEntry -> { if (nodeEntry.equals(e)) { nodeEntry.touch(); } }); return null; } NodeEntry lastSeen = buckets[...
for (int i = 0; i < KademliaOptions.BUCKET_SIZE; i++) { TimeUnit.MILLISECONDS.sleep(10); addNode(new Node(ids.get(i), ips[i], 18888, 18888)); } Node lastSeen = nodeTable.addNode(new Node(ids.get(16), ips[16], 18888, 18888)); Assert.assertTrue(null != lastSeen); Assert.assertEquals(ips[15...
[FOCAL] public synchronized Node NodeTable.addNode(Node n) [CLASS] class NodeTable [METRICS] loc=19 cc=4 branches=3 loops=0 returns=3 throws=0 nesting=2 [CALLS-INTERNAL] int getBucketId(NodeEntry e) [CALLS-EXTERNAL] node.getId/0, nodes.contains/1, nodes.forEach/1, nodeEntry.equals/1, nodeEntry.touch/0, buckets[getBucke...
/* static context [FOCAL] public synchronized Node NodeTable.addNode(Node n) [PATH1] if(nodes.contains(e))=F -> if(lastSeen != null)=F -> if(!nodes.contains(e))=T -> return null [PATH2] if(nodes.contains(e))=F -> if(lastSeen != null)=T -> return lastSeen.getNode() [PATH3] if(nodes.contains(e))=T -> return null [PATH4] ...
/* static context [FOCAL] public synchronized Node NodeTable.addNode(Node n) [PATH1] if(nodes.contains(e))=F -> if(lastSeen != null)=F -> if(!nodes.contains(e))=T -> return null [PATH2] if(nodes.contains(e))=F -> if(lastSeen != null)=T -> return lastSeen.getNode() [PATH3] if(nodes.contains(e))=T -> return null [PATH4] ...
true
ok
{"focal": {"class": "NodeTable", "name": "addNode", "signature": "Node addNode(Node n)", "start_line": 3, "modifiers": "public synchronized", "params": [{"name": "n", "type": "Node"}], "return_type": "Node"}, "class_info": {"name": "NodeTable", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "...
115451647_15
class NativeRiJargon2Backend implements Jargon2Backend { @Override public boolean verifyEncoded(String encodedHash, int threads, byte[] secret, byte[] ad, byte[] password, Map<String, Object> options) { if (encodedHash == null) { throw new Jargon2BackendException("Encoded hash cannot be nul...
backend.verifyEncoded("$argon2i$v=19$m=65536,t=2,p=xxx$xxx$xxx", -1, null, null, password, null); } }
[FOCAL] @Override public boolean NativeRiJargon2Backend.verifyEncoded(String encodedHash, int threads, byte[] secret, byte[] ad, byte[] password, Map<String, Object> options) [CLASS] class NativeRiJargon2Backend implements Jargon2Backend [METRICS] loc=17 cc=4 branches=3 loops=0 returns=1 throws=2 nesting=1 [CALLS-INTER...
/* static context [FOCAL] @Override public boolean NativeRiJargon2Backend.verifyEncoded(String encodedHash, int threads, byte[] secret, byte[] ad, byte[] password, Map<String, Object> options) [THROWS-WHEN] Jargon2BackendException when encodedHash == null [THROWS-WHEN] Jargon2BackendException when !(encodedHash == null...
/* static context [FOCAL] @Override public boolean NativeRiJargon2Backend.verifyEncoded(String encodedHash, int threads, byte[] secret, byte[] ad, byte[] password, Map<String, Object> options) [THROWS-WHEN] Jargon2BackendException when encodedHash == null [THROWS-WHEN] Jargon2BackendException when !(encodedHash == null...
true
ok
{"focal": {"class": "NativeRiJargon2Backend", "name": "verifyEncoded", "signature": "boolean verifyEncoded(String encodedHash, int threads, byte[] secret, byte[] ad, byte[] password, Map<String, Object> options)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "encodedHash", "type": "String"}, {"...
115516500_316
class DnsNameResolver extends InetNameResolver { @Override public void close() { if (ch.isOpen()) { ch.close(); } } public DnsNameResolver( EventLoop eventLoop, ChannelFactory<? extends DatagramChannel> channelFactory, final DnsCache res...
final String overriddenIP = "12.34.12.34"; final TestDnsServer dnsServer2 = new TestDnsServer(new RecordStore() { @Override public Set<ResourceRecord> getRecords(QuestionRecord question) throws DnsException { ResourceRecordModifier rm = new ResourceRecordModifier(...
[FOCAL] @Override public void DnsNameResolver.close() [CLASS] class DnsNameResolver extends InetNameResolver [METRICS] loc=6 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] ch.isOpen/0, ch.close/0 [PATH1] if(ch.isOpen())=T [PATH2] if(ch.isOpen())=F [COLLABORATORS] field ch isOpen/0,close/0 [CLASS-...
class DnsNameResolver extends InetNameResolver { @Override public void close() { if (ch.isOpen()) { ch.close(); } } public DnsNameResolver( EventLoop eventLoop, ChannelFactory<? extends DatagramChannel> channelFactory, final DnsCache res...
false
ok
{"focal": {"class": "DnsNameResolver", "name": "close", "signature": "void close()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "void"}, "class_info": {"name": "DnsNameResolver", "kind": "class", "modifiers": "", "superclass": "InetNameResolver", "interfaces": null, "fields": [{"name...
115558016_1
class FindBookListsByAuthorInteractor implements FindBookListByAuthor { @Override public List<BookOutputData> getBooks(BookListByAuthorInputData bookListByAuthorInputData) { Optional<List<Book>> books = bookGateway.findByAuthor(bookListByAuthorInputData.getAuthor()); if (!books.isPresent()) { throw ...
BookListByAuthorInputData bookListByAuthorInputData = BookListByAuthorInputData.builder() .author(ROBERT_C_MARTIN) .build(); Optional<List<Book>> books = Optional.of(Collections.singletonList(cleanArchitectureBook)); when(bookGateway.findByAuthor(any(String.class))).thenReturn(books); ...
[FOCAL] @Override public List<BookOutputData> FindBookListsByAuthorInteractor.getBooks(BookListByAuthorInputData bookListByAuthorInputData) [CLASS] class FindBookListsByAuthorInteractor implements FindBookListByAuthor [METRICS] loc=10 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] BookGateway.fin...
/* static context [FOCAL] @Override public List<BookOutputData> FindBookListsByAuthorInteractor.getBooks(BookListByAuthorInputData bookListByAuthorInputData) [THROWS-WHEN] BooksNotFoundException when !books.isPresent() [PATH1] if(!books.isPresent())=T -> throw new BooksNotFoundException() [PATH2] if(!books.isPresent())...
/* static context [FOCAL] @Override public List<BookOutputData> FindBookListsByAuthorInteractor.getBooks(BookListByAuthorInputData bookListByAuthorInputData) [THROWS-WHEN] BooksNotFoundException when !books.isPresent() [PATH1] if(!books.isPresent())=T -> throw new BooksNotFoundException() [PATH2] if(!books.isPresent())...
true
ok
{"focal": {"class": "FindBookListsByAuthorInteractor", "name": "getBooks", "signature": "List<BookOutputData> getBooks(BookListByAuthorInputData bookListByAuthorInputData)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "bookListByAuthorInputData", "type": "BookListByAuthorInputData"}], "return_...
115569790_68
class JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(String text) { try { JSONObject message = new JSONObject(text); int version = message.optInt("version"); String method = message.optString("method"); Object id = message.opt("id");...
RequestHandler handler = mock(RequestHandler.class); final JSPackagerClient client = new JSPackagerClient("test_client", mSettings, createRH("methodValue", handler)); client.onMessage(ByteString.EMPTY); verify(handler, never()).onNotification(any()); verify(handler, never()).onRequest(any(), any(Re...
[FOCAL] @Override public void JSPackagerClient.onMessage(String text) [CLASS] class JSPackagerClient implements ReconnectingWebSocket.MessageCallback [METRICS] loc=37 cc=6 branches=4 loops=0 returns=3 throws=0 nesting=2 [CALLS-INTERNAL] void abortOnMessage(Object id, String reason) [CALLS-EXTERNAL] JSONObject.optInt/1,...
/* static context [FOCAL] @Override public void JSPackagerClient.onMessage(String text) [PATH1] if(version != PROTOCOL_VERSION)=F -> if(method == null)=F -> if(handler == null)=T -> return [PATH2] if(version != PROTOCOL_VERSION)=F -> if(method == null)=F -> if(handler == null)=F -> if(id == null)=T [PATH3] try-body thr...
/* static context [FOCAL] @Override public void JSPackagerClient.onMessage(String text) [PATH1] if(version != PROTOCOL_VERSION)=F -> if(method == null)=F -> if(handler == null)=T -> return [PATH2] if(version != PROTOCOL_VERSION)=F -> if(method == null)=F -> if(handler == null)=F -> if(id == null)=T [PATH3] try-body thr...
true
ok
{"focal": {"class": "JSPackagerClient", "name": "onMessage", "signature": "void onMessage(String text)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "text", "type": "String"}], "return_type": "void"}, "class_info": {"name": "JSPackagerClient", "kind": "class", "modifiers": "", "superclass": nu...
115604783_56
class SwicoBillInformation { public void setVatRate(BigDecimal vatRate) { this.vatRate = vatRate; } public String getInvoiceNumber(); public void setInvoiceNumber(String invoiceNumber); public LocalDate getInvoiceDate(); public void setInvoiceDate(LocalDate invoiceDate); public Str...
SwicoBillInformation billInformation = new SwicoBillInformation(); billInformation.setVatRate(BigDecimal.valueOf(7.7)); assertEquals(7.7, billInformation.getVatRate().doubleValue()); } }
[FOCAL] public void SwicoBillInformation.setVatRate(BigDecimal vatRate) [CLASS] class SwicoBillInformation [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [FIELDS] write=vatRate [STATE] vatRate via getVatRate() [DATAFLOW] vatRate@param->L2 [CLASS-MEMBERS] String getInvoiceNumber(); void setInvoiceN...
/* static context [FOCAL] public void SwicoBillInformation.setVatRate(BigDecimal vatRate) [STATE] vatRate via getVatRate() [FIELDS] write=vatRate */
/* static context [FOCAL] public void SwicoBillInformation.setVatRate(BigDecimal vatRate) [STATE] vatRate via getVatRate() [FIELDS] write=vatRate */ class SwicoBillInformation { public void setVatRate(BigDecimal vatRate) { this.vatRate = vatRate; } public String getInvoiceNumber(); public void...
true
ok
{"focal": {"class": "SwicoBillInformation", "name": "setVatRate", "signature": "void setVatRate(BigDecimal vatRate)", "start_line": 3, "modifiers": "public", "params": [{"name": "vatRate", "type": "BigDecimal"}], "return_type": "void"}, "class_info": {"name": "SwicoBillInformation", "kind": "class", "modifiers": "", "s...
115777140_0
class DataUtils { public static String eval(String statement, JsonObject data) { for (String key : data.getMap().keySet()) { DataItem dataItem = new DataItem(data.getJsonObject(key)); statement = eval(statement, dataItem); } return statement; } public stat...
DataItem dataItem = new DataItem() .setID("SHELVED_LIST") .setType(DataItem.Type.STRING) .setValue("100"); JsonObject data = new JsonObject().put(dataItem.getID(), dataItem.json()); String shelvedList = DataUtils.eval("${data.SHELVED_LIST}", data...
[FOCAL] public static String DataUtils.eval(String statement, JsonObject data) [CLASS] class DataUtils [METRICS] loc=9 cc=2 branches=0 loops=1 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] String eval(String statement, DataItem dataItem) [CALLS-EXTERNAL] data.getMap().keySet/0, JsonObject.getMap/0, JsonObject.getJsonOb...
/* static context [FOCAL] public static String DataUtils.eval(String statement, JsonObject data) [PATH1] foreach(String key : data.getMap().keySet())=T -> exit loop -> return statement [PATH2] foreach(String key : data.getMap().keySet())=F -> return statement [INPUTS] branches=data | result=data, statement [COLLABORATO...
/* static context [FOCAL] public static String DataUtils.eval(String statement, JsonObject data) [PATH1] foreach(String key : data.getMap().keySet())=T -> exit loop -> return statement [PATH2] foreach(String key : data.getMap().keySet())=F -> return statement [INPUTS] branches=data | result=data, statement [COLLABORATO...
true
ok
{"focal": {"class": "DataUtils", "name": "eval", "signature": "String eval(String statement, JsonObject data)", "start_line": 3, "modifiers": "public static", "params": [{"name": "statement", "type": "String"}, {"name": "data", "type": "JsonObject"}], "return_type": "String"}, "class_info": {"name": "DataUtils", "kind"...
115838569_1
class KarmaPlugin implements PluginProvider { @Override public String process(MessageUpdate update, String locale) { StringBuilder response = new StringBuilder(); try { if (canProcess(update.getMessage().getText()) && !update.isEdited()) { List<String> itens = Arrays...
karmaPlugin.process(getSimpleMessage("test--"), "en_US"); Assertions.assertEquals(0, karmaRepository.get("test")); } }
[FOCAL] @Override public String KarmaPlugin.process(MessageUpdate update, String locale) [CLASS] class KarmaPlugin implements PluginProvider [METRICS] loc=32 cc=4 branches=1 loops=1 returns=1 throws=0 nesting=4 [CALLS-INTERNAL] String processKarma(String operator, String target, String username, String locale); boolean...
/* static context [FOCAL] @Override public String KarmaPlugin.process(MessageUpdate update, String locale) [PATH1] if(canProcess(update.getMessage().getText()) && !update.isEdited())=T -> foreach(Map.Entry<String, String> entry : finalTargets.entrySet())=T -> exit loop -> return response.toString() [PATH2] try-body thr...
/* static context [FOCAL] @Override public String KarmaPlugin.process(MessageUpdate update, String locale) [PATH1] if(canProcess(update.getMessage().getText()) && !update.isEdited())=T -> foreach(Map.Entry<String, String> entry : finalTargets.entrySet())=T -> exit loop -> return response.toString() [PATH2] try-body thr...
true
ok
{"focal": {"class": "KarmaPlugin", "name": "process", "signature": "String process(MessageUpdate update, String locale)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "update", "type": "MessageUpdate"}, {"name": "locale", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Kar...
115869675_6
class ProductController { @RequestMapping(method = RequestMethod.GET) public Iterable<Product> getProducts(@RequestParam("category") long categoryId) { return productService.findProductsByCategoryId(categoryId); } @RequestMapping(path = "/{productId}", method = RequestMethod.GET) public Produc...
long categoryId = 1; List<Product> products = TestDataFactory.getProductList(5, categoryId); when(productService.findProductsByCategoryId(categoryId)).thenReturn(products); assertThat(productController.getProducts(categoryId)).isEqualTo(products); } }
[FOCAL] @RequestMapping(method = RequestMethod.GET) public Iterable<Product> ProductController.getProducts(long categoryId) [CLASS] class ProductController [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] ProductService.findProductsByCategoryId/1 [FIELDS] read=productService:Product...
/* static context [FOCAL] @RequestMapping(method = RequestMethod.GET) public Iterable<Product> ProductController.getProducts(long categoryId) [INPUTS] branches=- | result=categoryId, productService [COLLABORATORS] field productService:ProductService findProductsByCategoryId/1 [FIELDS] read=productService:ProductService...
/* static context [FOCAL] @RequestMapping(method = RequestMethod.GET) public Iterable<Product> ProductController.getProducts(long categoryId) [INPUTS] branches=- | result=categoryId, productService [COLLABORATORS] field productService:ProductService findProductsByCategoryId/1 [FIELDS] read=productService:ProductService...
true
ok
{"focal": {"class": "ProductController", "name": "getProducts", "signature": "Iterable<Product> getProducts(long categoryId)", "start_line": 3, "modifiers": "@RequestMapping(method = RequestMethod.GET) public", "params": [{"name": "categoryId", "type": "long"}], "return_type": "Iterable<Product>"}, "class_info": {"name...
115956753_2
class CdcChange { public String toTelegraf(String json) { return json == null ? null : toTelegraf(json.getBytes()); } public String toTelegraf(byte[] json); private String getTimeInS(JsonNode payload); private String getId(JsonNode afterNode); private String toUpdate(JsonNode beforeNod...
assertThat(cdcChange.toTelegraf("" + "{\n" + " \"before\": null,\n" + " \"after\": {\n" + " \"id\": 57,\n" + " \"name\": \"Florida dragons\"\n" + " },\n" + " \"source\": {\n" + ...
[FOCAL] public String CdcChange.toTelegraf(String json) [CLASS] class CdcChange [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String toTelegraf(byte[] json) [CALLS-EXTERNAL] String.getBytes/0 [INPUTS] branches=- | result=json [DATAFLOW] json@param->L2 [CLASS-MEMBERS] String toTel...
/* static context [FOCAL] public String CdcChange.toTelegraf(String json) [INPUTS] branches=- | result=json [CALLS-INTERNAL] String toTelegraf(byte[] json) [CALLS-EXTERNAL] String.getBytes/0 */
/* static context [FOCAL] public String CdcChange.toTelegraf(String json) [INPUTS] branches=- | result=json [CALLS-INTERNAL] String toTelegraf(byte[] json) [CALLS-EXTERNAL] String.getBytes/0 */ class CdcChange { public String toTelegraf(String json) { return json == null ? null : toTelegraf(json.getBytes()...
true
ok
{"focal": {"class": "CdcChange", "name": "toTelegraf", "signature": "String toTelegraf(String json)", "start_line": 3, "modifiers": "public", "params": [{"name": "json", "type": "String"}], "return_type": "String"}, "class_info": {"name": "CdcChange", "kind": "class", "modifiers": "", "superclass": null, "interfaces": ...
116011653_544
class OrderOtherServiceImpl implements OrderOtherService { @Override public Response getOrderPrice(String orderId, HttpHeaders headers) { Order order = orderOtherRepository.findById(UUID.fromString(orderId)); if (order == null) { return new Response<>(0, orderNotFound, "-1.0"); ...
Order order = new Order(); Mockito.when(orderOtherRepository.findById(Mockito.any(UUID.class))).thenReturn(order); Response result = orderOtherServiceImpl.getOrderPrice(UUID.randomUUID().toString(), headers); Assert.assertEquals(new Response<>(1, "Success", order.getPrice()), result); ...
[FOCAL] @Override public Response OrderOtherServiceImpl.getOrderPrice(String orderId, HttpHeaders headers) [CLASS] class OrderOtherServiceImpl implements OrderOtherService [METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] OrderOtherRepository.findById/1, UUID.fromString/1, OrderOthe...
/* static context [FOCAL] @Override public Response OrderOtherServiceImpl.getOrderPrice(String orderId, HttpHeaders headers) [PATH1] if(order == null)=T -> return new Response<>(0, orderNotFound, "-1.0") [PATH2] if(order == null)=F -> return new Response<>(1, success, order.getPrice()) [INPUTS] branches=orderId, orderO...
/* static context [FOCAL] @Override public Response OrderOtherServiceImpl.getOrderPrice(String orderId, HttpHeaders headers) [PATH1] if(order == null)=T -> return new Response<>(0, orderNotFound, "-1.0") [PATH2] if(order == null)=F -> return new Response<>(1, success, order.getPrice()) [INPUTS] branches=orderId, orderO...
true
ok
{"focal": {"class": "OrderOtherServiceImpl", "name": "getOrderPrice", "signature": "Response getOrderPrice(String orderId, HttpHeaders headers)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "orderId", "type": "String"}, {"name": "headers", "type": "HttpHeaders"}], "return_type": "Response"}, "...
116057862_2
class FluxWithSingle extends Flux<F> implements CorePublisherWithSingle<F, S> { public final @NotNull CompletableFuture<S> subscribeSingleFuture() { final SingleFutureSubscriber<F, S> singleFutureSubscriber = new SingleFutureSubscriber<>(this); final CompletableFuture<S> future = singleFutureSubscr...
final CountDownLatch cancelLatch = new CountDownLatch(1); final CountDownLatch completeLatch = new CountDownLatch(1); final Flux<? extends CharSequence> flux = Flux.<CharSequence>create(emitter -> { emitter.next(new StringBuilder("single")); emitter.next("next0"); ...
[FOCAL] public final @NotNull CompletableFuture<S> FluxWithSingle.subscribeSingleFuture() [CLASS] class FluxWithSingle extends Flux<F> implements CorePublisherWithSingle<F, S> [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] SingleFutureSubscriber<F, S>.getFutureBeforeSubscribe/0, S...
/* static context [FOCAL] public final @NotNull CompletableFuture<S> FluxWithSingle.subscribeSingleFuture() [NEW] SingleFutureSubscriber<> [CALLS-EXTERNAL] SingleFutureSubscriber<F, S>.getFutureBeforeSubscribe/0, SingleFutureSubscriber<F, S>.subscribe/0 */
/* static context [FOCAL] public final @NotNull CompletableFuture<S> FluxWithSingle.subscribeSingleFuture() [NEW] SingleFutureSubscriber<> [CALLS-EXTERNAL] SingleFutureSubscriber<F, S>.getFutureBeforeSubscribe/0, SingleFutureSubscriber<F, S>.subscribe/0 */ class FluxWithSingle extends Flux<F> implements CorePublisherWi...
true
ok
{"focal": {"class": "FluxWithSingle", "name": "subscribeSingleFuture", "signature": "CompletableFuture<S> subscribeSingleFuture()", "start_line": 3, "modifiers": "public final @NotNull", "params": [], "return_type": "CompletableFuture<S>"}, "class_info": {"name": "FluxWithSingle", "kind": "class", "modifiers": "", "sup...
116109319_16
class HypergeometricDistribution extends AbstractDiscreteDistribution { @Override public double probability(int x) { final double logProbability = logProbability(x); return logProbability == Double.NEGATIVE_INFINITY ? 0 : Math.exp(logProbability); } public HypergeometricDistribution(i...
final int n = 11; // population final int m = 4; // successes in population final int s = 0; // number of trials final HypergeometricDistribution dist = new HypergeometricDistribution(n, m, 0); for (int i = 1; i <= n; i++) { final double p = dist.probability(i); ...
[FOCAL] @Override public double HypergeometricDistribution.probability(int x) [CLASS] class HypergeometricDistribution extends AbstractDiscreteDistribution [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] double logProbability(int x) [CALLS-EXTERNAL] Math.exp/1 [INPUTS] branches=- |...
/* static context [FOCAL] @Override public double HypergeometricDistribution.probability(int x) [INPUTS] branches=- | result=x [CALLS-INTERNAL] double logProbability(int x) [CALLS-EXTERNAL] Math.exp/1 */
/* static context [FOCAL] @Override public double HypergeometricDistribution.probability(int x) [INPUTS] branches=- | result=x [CALLS-INTERNAL] double logProbability(int x) [CALLS-EXTERNAL] Math.exp/1 */ class HypergeometricDistribution extends AbstractDiscreteDistribution { @Override public double probability...
true
ok
{"focal": {"class": "HypergeometricDistribution", "name": "probability", "signature": "double probability(int x)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "x", "type": "int"}], "return_type": "double"}, "class_info": {"name": "HypergeometricDistribution", "kind": "class", "modifiers": "", ...
116160086_20
class UserPrincipalImpl implements UserPrincipal { public Long getCustomLongAttribute(String attributeName) { long attribute = 0; JSONObject jwt = getRawIdentityToken(); if (customAttributeExists(attributeName)) { attribute = jwt.optLong(attributeName); } return...
assertEquals(new Long(1L), userPrincipalImpl.getCustomLongAttribute("long")); assertEquals(new Long(0L), userPrincipalImpl.getCustomLongAttribute("nonExistentCustomAttribute")); } }
[FOCAL] public Long UserPrincipalImpl.getCustomLongAttribute(String attributeName) [CLASS] class UserPrincipalImpl implements UserPrincipal [METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] JSONObject getRawIdentityToken(); boolean customAttributeExists(String attributeName) [CALLS-E...
/* static context [FOCAL] public Long UserPrincipalImpl.getCustomLongAttribute(String attributeName) [PATH1] if(customAttributeExists(attributeName))=T -> return attribute [PATH2] if(customAttributeExists(attributeName))=F -> return attribute [INPUTS] branches=attributeName | result=attributeName [CALLS-INTERNAL] JSONO...
/* static context [FOCAL] public Long UserPrincipalImpl.getCustomLongAttribute(String attributeName) [PATH1] if(customAttributeExists(attributeName))=T -> return attribute [PATH2] if(customAttributeExists(attributeName))=F -> return attribute [INPUTS] branches=attributeName | result=attributeName [CALLS-INTERNAL] JSONO...
true
ok
{"focal": {"class": "UserPrincipalImpl", "name": "getCustomLongAttribute", "signature": "Long getCustomLongAttribute(String attributeName)", "start_line": 3, "modifiers": "public", "params": [{"name": "attributeName", "type": "String"}], "return_type": "Long"}, "class_info": {"name": "UserPrincipalImpl", "kind": "class...
116163042_0
class Name implements Supplier<String> { public static Name of(String name) { return new Name(name); } private Name(String value); @Override public String get(); @Override public boolean equals(Object o); @Override public int hashCode(); @Override public String toString(); } cl...
assertThrows(NullPointerException.class, () -> { Name.of(null); }); } }
[FOCAL] public static Name Name.of(String name) [CLASS] class Name implements Supplier<String> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] Name [INPUTS] branches=- | result=name [DATAFLOW] name@param->L2 [CLASS-MEMBERS] Name(String value); String get(); boolean equals(Object o); int hashC...
/* static context [FOCAL] public static Name Name.of(String name) [INPUTS] branches=- | result=name [NEW] Name */
/* static context [FOCAL] public static Name Name.of(String name) [INPUTS] branches=- | result=name [NEW] Name */ class Name implements Supplier<String> { public static Name of(String name) { return new Name(name); } private Name(String value); @Override public String get(); @Override pu...
true
ok
{"focal": {"class": "Name", "name": "of", "signature": "Name of(String name)", "start_line": 3, "modifiers": "public static", "params": [{"name": "name", "type": "String"}], "return_type": "Name"}, "class_info": {"name": "Name", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Supplier<String>", "fi...
116228237_17
class Certificate { private static boolean verify(String body, String signature, PublicKey publicKey) { try { Signature sign = Signature.getInstance("SHA1WithRSA"); sign.initVerify(publicKey); sign.update(body.getBytes("UTF-8")); return sign.verify(Base64.dec...
fail("Not yet implemented"); } }
[FOCAL] private static boolean Certificate.verify(String body, String signature, PublicKey publicKey) [CLASS] class Certificate [METRICS] loc=10 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] Signature.getInstance/1, Signature.initVerify/1, Signature.update/1, String.getBytes/1, Signature.verify/...
/* static context [FOCAL] private static boolean Certificate.verify(String body, String signature, PublicKey publicKey) [PATH1] try-body throws -> return false [PATH2] return sign.verify(Base64.decodeBase64(signature.getBytes("UTF-8"))) [INPUTS] branches=- | result=signature [EXCEPTIONS] catches Exception e [CALLS-EXTE...
/* static context [FOCAL] private static boolean Certificate.verify(String body, String signature, PublicKey publicKey) [PATH1] try-body throws -> return false [PATH2] return sign.verify(Base64.decodeBase64(signature.getBytes("UTF-8"))) [INPUTS] branches=- | result=signature [EXCEPTIONS] catches Exception e [CALLS-EXTE...
true
ok
{"focal": {"class": "Certificate", "name": "verify", "signature": "boolean verify(String body, String signature, PublicKey publicKey)", "start_line": 3, "modifiers": "private static", "params": [{"name": "body", "type": "String"}, {"name": "signature", "type": "String"}, {"name": "publicKey", "type": "PublicKey"}], "re...
116309308_53
class KoofrClient { public boolean fileExists(String path) throws IOException, InvalidTokenException { String url; try { url = getUriBuilder() .setPath(API_PATH_PREFIX + "/mounts/primary/files/info") .setParameter("path", path) .build() ...
server.enqueue(new MockResponse().setResponseCode(500).setBody("Internal error")); Exception caughtExc = null; try { client.fileExists("/path/to/file"); } catch (Exception exc) { caughtExc = exc; } Assert.assertNotNull(caughtExc); Assert.assertEquals( "Got error code: ...
[FOCAL] public boolean KoofrClient.fileExists(String path) [CLASS] class KoofrClient [METRICS] loc=32 cc=4 branches=2 loops=0 returns=2 throws=2 nesting=2 [CALLS-INTERNAL] Request.Builder getRequestBuilder(String url); Response getResponse(Request.Builder requestBuilder); URIBuilder getUriBuilder() [CALLS-EXTERNAL] get...
/* static context [FOCAL] public boolean KoofrClient.fileExists(String path) [THROWS-WHEN] IllegalStateException when try-body throws [THROWS-WHEN] IOException when !(code == 200) && !(code == 404) [PATH1] if(code == 200)=F -> if(code == 404)=T -> return false [PATH2] try-body throws -> throw new IllegalStateException(...
/* static context [FOCAL] public boolean KoofrClient.fileExists(String path) [THROWS-WHEN] IllegalStateException when try-body throws [THROWS-WHEN] IOException when !(code == 200) && !(code == 404) [PATH1] if(code == 200)=F -> if(code == 404)=T -> return false [PATH2] try-body throws -> throw new IllegalStateException(...
true
ok
{"focal": {"class": "KoofrClient", "name": "fileExists", "signature": "boolean fileExists(String path) throws IOException, InvalidTokenException", "start_line": 3, "modifiers": "public", "params": [{"name": "path", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "KoofrClient", "kind": "class", "mo...
116324279_0
class Util { public static int compare(@Nullable String s1, @Nullable String s2) { if (s1 == s2) { return 0; } else if ((s1 == null) && (s2 != null)) { return -1; } else if ((s1 != null) && (s2 == null)) { return 1; } return s1.compareTo(s...
assertTrue(Util.compare("foo", "bar") > 1); assertTrue(Util.compare("bar", "foo") < 1); assertEquals(0, Util.compare("foo", "foo")); assertEquals(-1, Util.compare(null, "foo")); assertEquals(1, Util.compare("foo", null)); assertEquals(0, Util.compare(null, null)); } ...
[FOCAL] public static int Util.compare(String s1, String s2) [CLASS] class Util [METRICS] loc=10 cc=4 branches=3 loops=0 returns=4 throws=0 nesting=3 [CALLS-EXTERNAL] String.compareTo/1 [PATH1] if(s1 == s2)=F -> if((s1 == null) && (s2 != null))=F -> if((s1 != null) && (s2 == null))=T -> return 1 [PATH2] if(s1 == s2)=T ...
/* static context [FOCAL] public static int Util.compare(String s1, String s2) [PATH1] if(s1 == s2)=F -> if((s1 == null) && (s2 != null))=F -> if((s1 != null) && (s2 == null))=T -> return 1 [PATH2] if(s1 == s2)=T -> return 0 [PATH3] if(s1 == s2)=F -> if((s1 == null) && (s2 != null))=T -> return -1 [PATH4] if(s1 == s2)=...
/* static context [FOCAL] public static int Util.compare(String s1, String s2) [PATH1] if(s1 == s2)=F -> if((s1 == null) && (s2 != null))=F -> if((s1 != null) && (s2 == null))=T -> return 1 [PATH2] if(s1 == s2)=T -> return 0 [PATH3] if(s1 == s2)=F -> if((s1 == null) && (s2 != null))=T -> return -1 [PATH4] if(s1 == s2)=...
true
ok
{"focal": {"class": "Util", "name": "compare", "signature": "int compare(String s1, String s2)", "start_line": 3, "modifiers": "public static", "params": [{"name": "s1", "type": "String"}, {"name": "s2", "type": "String"}], "return_type": "int"}, "class_info": {"name": "Util", "kind": "class", "modifiers": "", "supercl...
116500263_0
class ForecastUtil { public static Set<WeatherForecastPerDay> calculateWeatherForDays(WeatherForecastDbHelper.WeatherForecastRecord weatherForecastRecord) { Set<WeatherForecastPerDay> result = new HashSet<>(); Calendar forecastCalendar = Calendar.getInstance(); int initialYearForTheList = f...
//given createDetailedWeatherForecastForDayWithNegativeTemperatures(); //when Set<ForecastUtil.WeatherForecastPerDay> result = ForecastUtil.calculateWeatherForDays(weatherForecastRecord); //then assertEquals(1, result.size()); ForecastUtil.WeatherForecastPerDay ...
[FOCAL] public static Set<WeatherForecastPerDay> ForecastUtil.calculateWeatherForDays(WeatherForecastDbHelper.WeatherForecastRecord weatherForecastRecord) [CLASS] class ForecastUtil [METRICS] loc=31 cc=5 branches=3 loops=1 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] Map<Integer, List<DetailedWeatherForecast>> createW...
/* static context [FOCAL] public static Set<WeatherForecastPerDay> ForecastUtil.calculateWeatherForDays(WeatherForecastDbHelper.WeatherForecastRecord weatherForecastRecord) [PATH1] for(dayInYear < daysInList)=T -> if(dayInYear > 365)=T -> if((weatherList.get(dayInYear) == null) || (weatherList.get(dayInYear).size() < 3...
/* static context [FOCAL] public static Set<WeatherForecastPerDay> ForecastUtil.calculateWeatherForDays(WeatherForecastDbHelper.WeatherForecastRecord weatherForecastRecord) [PATH1] for(dayInYear < daysInList)=T -> if(dayInYear > 365)=T -> if((weatherList.get(dayInYear) == null) || (weatherList.get(dayInYear).size() < 3...
true
ok
{"focal": {"class": "ForecastUtil", "name": "calculateWeatherForDays", "signature": "Set<WeatherForecastPerDay> calculateWeatherForDays(WeatherForecastDbHelper.WeatherForecastRecord weatherForecastRecord)", "start_line": 3, "modifiers": "public static", "params": [{"name": "weatherForecastRecord", "type": "WeatherForec...
116522300_55
class V_000000 implements Migrateable { @Override public void executeMigration(Datastore datastore) { PriceList priceList = datastore.createQuery(PriceList.class).field("lotteryIdentifier").equal(German6aus49Lottery.IDENTIFIER).get(); if (priceList == null) { priceList = new PriceLi...
V_000000 cut = new V_000000(); cut.executeMigration(getDatastore()); PriceList priceList = getDatastore().createQuery(PriceList.class).field("lotteryIdentifier").equal(German6aus49Lottery.IDENTIFIER).get(); assertThat(priceList, notNullValue()); assertThat(priceList.getValidFrom(...
[FOCAL] @Override public void V_000000.executeMigration(Datastore datastore) [CLASS] class V_000000 implements Migrateable [METRICS] loc=17 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] ZonedDateTime getInitialDate() [CALLS-EXTERNAL] datastore.createQuery(PriceList.class).field("lotteryIden....g...
/* static context [FOCAL] @Override public void V_000000.executeMigration(Datastore datastore) [PATH1] if(priceList == null)=T [PATH2] if(priceList == null)=F [INPUTS] branches=datastore | result=- [COLLABORATORS] param datastore:Datastore createQuery/1,save/1 [CALLS-INTERNAL] ZonedDateTime getInitialDate() [NEW] Price...
/* static context [FOCAL] @Override public void V_000000.executeMigration(Datastore datastore) [PATH1] if(priceList == null)=T [PATH2] if(priceList == null)=F [INPUTS] branches=datastore | result=- [COLLABORATORS] param datastore:Datastore createQuery/1,save/1 [CALLS-INTERNAL] ZonedDateTime getInitialDate() [NEW] Price...
true
ok
{"focal": {"class": "V_000000", "name": "executeMigration", "signature": "void executeMigration(Datastore datastore)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "datastore", "type": "Datastore"}], "return_type": "void"}, "class_info": {"name": "V_000000", "kind": "class", "modifiers": "", "s...
116565956_0
class SubjectMapperDecorator implements SubjectMapper { @Override public List<SubjectDto> questionsToSubjectsDto(List<Question> questions) { Assert.notNull(questions, "Cannot map a null list of questions to a list of subject dtos"); Multimap<Subject, Question> multimap = Multimaps.index(questions, Questio...
Question q1 = new Question().id(1L).label("question1").subject(new Subject().id(1L)); Question q2 = new Question().id(2L).label("question2").subject(new Subject().id(1L)); Question q3 = new Question().id(3L).label("question3").subject(new Subject().id(2L)); List<SubjectDto> subjects = subjectMapper.que...
[FOCAL] @Override public List<SubjectDto> SubjectMapperDecorator.questionsToSubjectsDto(List<Question> questions) [CLASS] class SubjectMapperDecorator implements SubjectMapper [METRICS] loc=18 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Assert.notNull/2, Multimaps.index/2, multimap.keySet().st...
/* static context [FOCAL] @Override public List<SubjectDto> SubjectMapperDecorator.questionsToSubjectsDto(List<Question> questions) [INPUTS] branches=- | result=questions [COLLABORATORS] field delegate toDto/1; field questionMapper questionToQuestionDto/1 [CALLS-EXTERNAL] Assert.notNull/2, Multimaps.index/2, multimap.k...
/* static context [FOCAL] @Override public List<SubjectDto> SubjectMapperDecorator.questionsToSubjectsDto(List<Question> questions) [INPUTS] branches=- | result=questions [COLLABORATORS] field delegate toDto/1; field questionMapper questionToQuestionDto/1 [CALLS-EXTERNAL] Assert.notNull/2, Multimaps.index/2, multimap.k...
true
ok
{"focal": {"class": "SubjectMapperDecorator", "name": "questionsToSubjectsDto", "signature": "List<SubjectDto> questionsToSubjectsDto(List<Question> questions)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "questions", "type": "List<Question>"}], "return_type": "List<SubjectDto>"}, "class_info...
116678593_1
class CombinedVariablesSource extends VariablesSource { public static CombinedVariablesSource forSources(List<String> sourceNames, InstallHookLogger logger, InstallContext context) { List<VariablesSource> sources = new ArrayList<VariablesSource>(); for (String string : sourceNames) { if...
VariablesSource varSource1 = new VariablesSource("testsource1", new HashMap<String, String>() { { put("var1", "val1"); put("var2", "val2"); } }) { }; VariablesSource varSource...
[FOCAL] public static CombinedVariablesSource CombinedVariablesSource.forSources(List<String> sourceNames, InstallHookLogger logger, InstallContext context) [CLASS] class CombinedVariablesSource extends VariablesSource [METRICS] loc=21 cc=6 branches=4 loops=1 returns=1 throws=0 nesting=5 [CALLS-EXTERNAL] String.equals/...
/* static context [FOCAL] public static CombinedVariablesSource CombinedVariablesSource.forSources(List<String> sourceNames, InstallHookLogger logger, InstallContext context) [PATH1] foreach(String string : sourceNames)=T -> if(string.equals(OsEnvVarsSource.NAME))=F -> if(string.equals(SystemPropertiesVarsSource.NAME))...
/* static context [FOCAL] public static CombinedVariablesSource CombinedVariablesSource.forSources(List<String> sourceNames, InstallHookLogger logger, InstallContext context) [PATH1] foreach(String string : sourceNames)=T -> if(string.equals(OsEnvVarsSource.NAME))=F -> if(string.equals(SystemPropertiesVarsSource.NAME))...
true
ok
{"focal": {"class": "CombinedVariablesSource", "name": "forSources", "signature": "CombinedVariablesSource forSources(List<String> sourceNames, InstallHookLogger logger, InstallContext context)", "start_line": 3, "modifiers": "public static", "params": [{"name": "sourceNames", "type": "List<String>"}, {"name": "logger"...
116714930_15
class ProcessingPartition implements Closeable { protected long getLastCommittedOffset() { OffsetAndMetadata lastCommittedOffset; try { lastCommittedOffset = consumer.committed(topicPartition); } catch (KafkaException e) { throw new IllegalStateException("Unable to r...
when(consumer.committed(topicPartition)).thenReturn(null); partition.earliestBrokerOffset = 123L; doThrow(new KafkaException("unable to commit")).when(consumer).commitSync(anyMap()); partition.getLastCommittedOffset(); verify(consumer).commitSync(Collections.singletonMap(topicPa...
[FOCAL] protected long ProcessingPartition.getLastCommittedOffset() [CLASS] class ProcessingPartition implements Closeable [METRICS] loc=51 cc=8 branches=6 loops=0 returns=4 throws=1 nesting=2 [CALLS-INTERNAL] long getCommittedResetOffset(); long getEarliestOffset(); long getLatestOffset() [CALLS-EXTERNAL] Consumer<Str...
/* static context [FOCAL] protected long ProcessingPartition.getLastCommittedOffset() [THROWS-WHEN] IllegalStateException when try-body throws [PATH1] if(lastCommittedOffset == null)=F -> if(offset < startOffset)=F -> if(offset > endOffset)=T -> if(LOGGER.isWarnEnabled())=T -> return getCommittedResetOffset() [PATH2] i...
/* static context [FOCAL] protected long ProcessingPartition.getLastCommittedOffset() [THROWS-WHEN] IllegalStateException when try-body throws [PATH1] if(lastCommittedOffset == null)=F -> if(offset < startOffset)=F -> if(offset > endOffset)=T -> if(LOGGER.isWarnEnabled())=T -> return getCommittedResetOffset() [PATH2] i...
true
ok
{"focal": {"class": "ProcessingPartition", "name": "getLastCommittedOffset", "signature": "long getLastCommittedOffset()", "start_line": 3, "modifiers": "protected", "params": [], "return_type": "long"}, "class_info": {"name": "ProcessingPartition", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "C...
116999027_941
class CreatedQueryLogicCacheBean { public boolean add(String queryId, String userId, QueryLogic<?> logic, Connector cxn) { Triple value = new Triple(userId, logic, cxn); long updateTime = System.currentTimeMillis(); return cache.putIfAbsent(new Pair<>(queryId, updateTime), value) == null; ...
String queryId = "12345"; String userId = "me"; long timestamp = 1l; EasyMock.expect(System.currentTimeMillis()).andReturn(timestamp); PowerMock.replayAll(); boolean ret = qlCache.add(queryId, userId, queryLogic, conn); PowerMoc...
[FOCAL] public boolean CreatedQueryLogicCacheBean.add(String queryId, String userId, QueryLogic<?> logic, Connector cxn) [CLASS] class CreatedQueryLogicCacheBean [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] System.currentTimeMillis/0, cache.putIfAbsent/2 [NEW] Triple, Pair<> [IN...
/* static context [FOCAL] public boolean CreatedQueryLogicCacheBean.add(String queryId, String userId, QueryLogic<?> logic, Connector cxn) [INPUTS] branches=- | result=cxn, logic, queryId, userId [COLLABORATORS] field cache putIfAbsent/2 [NEW] Triple, Pair<> [CALLS-EXTERNAL] System.currentTimeMillis/0, cache.putIfAbsen...
/* static context [FOCAL] public boolean CreatedQueryLogicCacheBean.add(String queryId, String userId, QueryLogic<?> logic, Connector cxn) [INPUTS] branches=- | result=cxn, logic, queryId, userId [COLLABORATORS] field cache putIfAbsent/2 [NEW] Triple, Pair<> [CALLS-EXTERNAL] System.currentTimeMillis/0, cache.putIfAbsen...
true
ok
{"focal": {"class": "CreatedQueryLogicCacheBean", "name": "add", "signature": "boolean add(String queryId, String userId, QueryLogic<?> logic, Connector cxn)", "start_line": 3, "modifiers": "public", "params": [{"name": "queryId", "type": "String"}, {"name": "userId", "type": "String"}, {"name": "logic", "type": "Query...
117019016_55
class ProcessHTTPRecordingWithXSLT implements HTTPRecordingResultProcessor { public void process(HttpRecordingDocument result) throws IOException { try { final Transformer transformer = m_transformerFactory .newTransformer(new StreamSource(m_styleSheetInp...
final File badStyleSheetFile = new File(getDirectory(), "bad.xsl"); badStyleSheetFile.createNewFile(); final ProcessHTTPRecordingWithXSLT processor = new ProcessHTTPRecordingWithXSLT( new StyleSheetFile(badStyleSheetFile), m_out, m_logger); final HttpRecordingDocument emp...
[FOCAL] public void ProcessHTTPRecordingWithXSLT.process(HttpRecordingDocument result) [CLASS] class ProcessHTTPRecordingWithXSLT implements HTTPRecordingResultProcessor [METRICS] loc=21 cc=2 branches=0 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] m_transformerFactory.newTransformer/1, Transformer.setErrorList...
/* static context [FOCAL] public void ProcessHTTPRecordingWithXSLT.process(HttpRecordingDocument result) [PATH1] try-body throws [COLLABORATORS] field m_transformerFactory newTransformer/1,getErrorListener/0; param result:HttpRecordingDocument newXMLStreamReader/0; field m_output println/0; field m_styleSheetInputStrea...
/* static context [FOCAL] public void ProcessHTTPRecordingWithXSLT.process(HttpRecordingDocument result) [PATH1] try-body throws [COLLABORATORS] field m_transformerFactory newTransformer/1,getErrorListener/0; param result:HttpRecordingDocument newXMLStreamReader/0; field m_output println/0; field m_styleSheetInputStrea...
true
ok
{"focal": {"class": "ProcessHTTPRecordingWithXSLT", "name": "process", "signature": "void process(HttpRecordingDocument result) throws IOException", "start_line": 4, "modifiers": "public", "params": [{"name": "result", "type": "HttpRecordingDocument"}], "return_type": "void"}, "class_info": {"name": "ProcessHTTPRecordi...
117054584_7
class ZookeeperConfiguration implements GovernanceConfiguration { @Override public String getPath(String key) { return getNodePath(key, null); } @Override public void setUrl(URL url); @Override public URL getUrl(); @Override public void init(); @Override public String setConfig(Str...
assertEquals(Constants.PATH_SEPARATOR + Constants.DEFAULT_ROOT + Constants.PATH_SEPARATOR + "test_key", configuration.getPath("test_key")); try { configuration.getPath(null); fail("should throw IllegalArgumentException for null path"); } catch (IllegalArgu...
[FOCAL] @Override public String ZookeeperConfiguration.getPath(String key) [CLASS] class ZookeeperConfiguration implements GovernanceConfiguration [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String getNodePath(String path, String group) [INPUTS] branches=- | result=key [DATAFLO...
/* static context [FOCAL] @Override public String ZookeeperConfiguration.getPath(String key) [INPUTS] branches=- | result=key [CALLS-INTERNAL] String getNodePath(String path, String group) */
/* static context [FOCAL] @Override public String ZookeeperConfiguration.getPath(String key) [INPUTS] branches=- | result=key [CALLS-INTERNAL] String getNodePath(String path, String group) */ class ZookeeperConfiguration implements GovernanceConfiguration { @Override public String getPath(String key) { ...
true
ok
{"focal": {"class": "ZookeeperConfiguration", "name": "getPath", "signature": "String getPath(String key)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "key", "type": "String"}], "return_type": "String"}, "class_info": {"name": "ZookeeperConfiguration", "kind": "class", "modifiers": "", "super...
117060928_69
class JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(String text) { try { JSONObject message = new JSONObject(text); int version = message.optInt("version"); String method = message.optString("method"); Object id = message.opt("id");...
RequestHandler handler = mock(RequestHandler.class); final JSPackagerClient client = new JSPackagerClient("test_client", mSettings, createRH("methodValue", handler)); client.onMessage("{\"version\": 2, \"method\": \"methodValue\"}"); verify(handler).onNotification(eq(null)); verify(handler, never()...
[FOCAL] @Override public void JSPackagerClient.onMessage(String text) [CLASS] class JSPackagerClient implements ReconnectingWebSocket.MessageCallback [METRICS] loc=37 cc=6 branches=4 loops=0 returns=3 throws=0 nesting=2 [CALLS-INTERNAL] void abortOnMessage(Object id, String reason) [CALLS-EXTERNAL] JSONObject.optInt/1,...
/* static context [FOCAL] @Override public void JSPackagerClient.onMessage(String text) [PATH1] if(version != PROTOCOL_VERSION)=F -> if(method == null)=F -> if(handler == null)=T -> return [PATH2] if(version != PROTOCOL_VERSION)=F -> if(method == null)=F -> if(handler == null)=F -> if(id == null)=T [PATH3] try-body thr...
/* static context [FOCAL] @Override public void JSPackagerClient.onMessage(String text) [PATH1] if(version != PROTOCOL_VERSION)=F -> if(method == null)=F -> if(handler == null)=T -> return [PATH2] if(version != PROTOCOL_VERSION)=F -> if(method == null)=F -> if(handler == null)=F -> if(id == null)=T [PATH3] try-body thr...
true
ok
{"focal": {"class": "JSPackagerClient", "name": "onMessage", "signature": "void onMessage(String text)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "text", "type": "String"}], "return_type": "void"}, "class_info": {"name": "JSPackagerClient", "kind": "class", "modifiers": "", "superclass": nu...
117076526_0
class UsersService { public void add(@Valid User newUser) { em.persist(newUser); } public User isValid(String username, String password); public Set<User> getAll(); public boolean update(User updated); public void remove(Long id); public Optional<User> get(Long id); public List...
URL apiUrl = new URL(resource, "resources/users"); JsonObject user = Json.createObjectBuilder() .add("name", "Marcus") .add("email", "marcus_1982@jee8ng.org") .add("credential", credential("marcus", "1234")) .build(); Response init...
[FOCAL] public void UsersService.add(User newUser) [CLASS] class UsersService [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] em.persist/1 [COLLABORATORS] field em persist/1 [DATAFLOW] newUser@param->L2 [CLASS-MEMBERS] User isValid(String username, String password); Set<User> getAl...
/* static context [FOCAL] public void UsersService.add(User newUser) [COLLABORATORS] field em persist/1 [CALLS-EXTERNAL] em.persist/1 */
/* static context [FOCAL] public void UsersService.add(User newUser) [COLLABORATORS] field em persist/1 [CALLS-EXTERNAL] em.persist/1 */ class UsersService { public void add(@Valid User newUser) { em.persist(newUser); } public User isValid(String username, String password); public Set<User> ge...
true
ok
{"focal": {"class": "UsersService", "name": "add", "signature": "void add(User newUser)", "start_line": 3, "modifiers": "public", "params": [{"name": "newUser", "type": "User"}], "return_type": "void"}, "class_info": {"name": "UsersService", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fie...
117088815_195
class AbstractNotificationServiceImpl implements AbstractNotificationService<T> { @Transactional @Nonnull @Override public T updateNotificationState(@Nonnull final Long notificationId, @Nonnull final NotificationState notificationState) { assertNotificationIdNotNull(notificationId); Ass...
// Test data final Long notificationId = 1L; final NotificationState state = NotificationState.PROCESSING; // Reset resetAll(); // Replay replayAll(); // Run test scenario try { getService().updateNotificationState(null, state); ...
[FOCAL] @Transactional @Nonnull @Override public T AbstractNotificationServiceImpl.updateNotificationState(Long notificationId, NotificationState notificationState) [CLASS] class AbstractNotificationServiceImpl implements AbstractNotificationService<T> [METRICS] loc=16 cc=1 branches=0 loops=0 returns=1 throws=0 nesting...
/* static context [FOCAL] @Transactional @Nonnull @Override public T AbstractNotificationServiceImpl.updateNotificationState(Long notificationId, NotificationState notificationState) [INPUTS] branches=- | result=notificationId [CALLS-INTERNAL] AbstractNotificationRepository<T> getRepository(); Class<T> getInstanceClass...
/* static context [FOCAL] @Transactional @Nonnull @Override public T AbstractNotificationServiceImpl.updateNotificationState(Long notificationId, NotificationState notificationState) [INPUTS] branches=- | result=notificationId [CALLS-INTERNAL] AbstractNotificationRepository<T> getRepository(); Class<T> getInstanceClass...
true
ok
{"focal": {"class": "AbstractNotificationServiceImpl", "name": "updateNotificationState", "signature": "T updateNotificationState(Long notificationId, NotificationState notificationState)", "start_line": 3, "modifiers": "@Transactional @Nonnull @Override public", "params": [{"name": "notificationId", "type": "Long"}, {...
117128136_21
class JavaSystem extends SimpleSystemImpl { @Override public SimpleNode moveTo(String nodeQuery, String... keys) { SimpleNode javaSourceNode=new JavaSourceNode(this,nodeQuery,keys); optionalStartNode(javaSourceNode); return javaSourceNode; } @Override public SimpleSystem connect(String... connecti...
JavaSystem js = new JavaSystem(); JavaSourceNode jsn = (JavaSourceNode) js.moveTo( "../simplegraph-java/src/test/java/com/bitplan/simplegraph/java/TestJavaSystem.java"); debug = true; if (debug) { js.forAll(SimpleNode.printDebug); CompilationUnit cu = jsn.compilationUnit; cu.wa...
[FOCAL] @Override public SimpleNode JavaSystem.moveTo(String nodeQuery, String... keys) [CLASS] class JavaSystem extends SimpleSystemImpl [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] optionalStartNode/1 (inherited) [NEW] JavaSourceNode [INPUTS] branches=- | result=keys, nodeQuer...
/* static context [FOCAL] @Override public SimpleNode JavaSystem.moveTo(String nodeQuery, String... keys) [INPUTS] branches=- | result=keys, nodeQuery [NEW] JavaSourceNode [CALLS-EXTERNAL] optionalStartNode/1 (inherited) */
/* static context [FOCAL] @Override public SimpleNode JavaSystem.moveTo(String nodeQuery, String... keys) [INPUTS] branches=- | result=keys, nodeQuery [NEW] JavaSourceNode [CALLS-EXTERNAL] optionalStartNode/1 (inherited) */ class JavaSystem extends SimpleSystemImpl { @Override public SimpleNode moveTo(String nodeQ...
true
ok
{"focal": {"class": "JavaSystem", "name": "moveTo", "signature": "SimpleNode moveTo(String nodeQuery, String... keys)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "nodeQuery", "type": "String"}, {"name": "keys", "type": "String..."}], "return_type": "SimpleNode"}, "class_info": {"name": "Java...
117143344_15
class Lang { public static boolean isInteger(String s) { try { Integer.parseInt(s); } catch (NumberFormatException e) { return false; } return true; } public static String RPAD(String str, int len); public static String RPAD(String str, char c, int len); public static String LPAD...
assertEquals(true, Lang.isInteger("1")); assertEquals(false, Lang.isInteger("1.0")); assertEquals(false, Lang.isInteger("1f")); assertEquals(false, Lang.isInteger(null)); assertEquals(true, Lang.isInteger(String.valueOf(Integer.MAX_VALUE))); assertEquals(true, Lang.isInteger(String.valueOf(Integ...
[FOCAL] public static boolean Lang.isInteger(String s) [CLASS] class Lang [METRICS] loc=8 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] Integer.parseInt/1 [EXCEPTIONS] catches NumberFormatException e [PATH1] try-body throws -> return false [PATH2] return true [DATAFLOW] s@param->L3 [CLASS-MEMBER...
/* static context [FOCAL] public static boolean Lang.isInteger(String s) [PATH1] try-body throws -> return false [PATH2] return true [EXCEPTIONS] catches NumberFormatException e [CALLS-EXTERNAL] Integer.parseInt/1 */
/* static context [FOCAL] public static boolean Lang.isInteger(String s) [PATH1] try-body throws -> return false [PATH2] return true [EXCEPTIONS] catches NumberFormatException e [CALLS-EXTERNAL] Integer.parseInt/1 */ class Lang { public static boolean isInteger(String s) { try { Integer.parseInt(s); } ...
true
ok
{"focal": {"class": "Lang", "name": "isInteger", "signature": "boolean isInteger(String s)", "start_line": 3, "modifiers": "public static", "params": [{"name": "s", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "Lang", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fi...
117200555_0
class HoldingsController { @GetMapping public List<Holding> getHoldings(Principal principal) { User user = client.getUser(principal.getName()); String holdingsFromOkta = (String) user.getProfile().get(HOLDINGS_ATTRIBUTE_NAME); List<Holding> holdings = new LinkedList<>(); if (h...
String username = "joe.coder@example.com"; // define mocks Client client = mock(Client.class); User user = mock(User.class); UserProfile userProfile = mock(UserProfile.class); Principal principal = mock(Principal.class); // stub behaviour when(principal...
[FOCAL] @GetMapping public List<Holding> HoldingsController.getHoldings(Principal principal) [CLASS] class HoldingsController [METRICS] loc=18 cc=3 branches=1 loops=0 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] client.getUser/1, Principal.getName/0, user.getProfile().get/1, User.getProfile/0, mapper.readValue/2, logg...
/* static context [FOCAL] @GetMapping public List<Holding> HoldingsController.getHoldings(Principal principal) [PATH1] if(holdingsFromOkta != null)=T -> try-body throws -> return holdings [PATH2] if(holdingsFromOkta != null)=F -> return holdings [INPUTS] branches=principal | result=principal [COLLABORATORS] field clien...
/* static context [FOCAL] @GetMapping public List<Holding> HoldingsController.getHoldings(Principal principal) [PATH1] if(holdingsFromOkta != null)=T -> try-body throws -> return holdings [PATH2] if(holdingsFromOkta != null)=F -> return holdings [INPUTS] branches=principal | result=principal [COLLABORATORS] field clien...
true
ok
{"focal": {"class": "HoldingsController", "name": "getHoldings", "signature": "List<Holding> getHoldings(Principal principal)", "start_line": 3, "modifiers": "@GetMapping public", "params": [{"name": "principal", "type": "Principal"}], "return_type": "List<Holding>"}, "class_info": {"name": "HoldingsController", "kind"...
117255089_189
class WXUtils { public static float getFloat(Object value) { return getFloat(value, Float.NaN); } public static boolean isUiThread(); public static boolean isUndefined(float value); public static Float getFloat(Object value, @Nullable Float df); private static float transferWx(String stringWithWXPostf...
Float test_float = WXUtils.getFloat("100wx"); Float want = 100 * TEST_DENSITY * TEST_VIEW_PORT / TEST_SCREEN_WIDTH; assertEquals(test_float, want , 0.01); test_float = WXUtils.getFloat("100px"); want = 100F; assertEquals(test_float, want); test_float = WXUtils.g...
[FOCAL] public static float WXUtils.getFloat(Object value) [CLASS] class WXUtils [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Float getFloat(Object value, Float df) [INPUTS] branches=- | result=value [DATAFLOW] value@param->L2 [CLASS-MEMBERS] boolean isUiThread(); boolean isUnde...
/* static context [FOCAL] public static float WXUtils.getFloat(Object value) [INPUTS] branches=- | result=value [CALLS-INTERNAL] Float getFloat(Object value, Float df) */
/* static context [FOCAL] public static float WXUtils.getFloat(Object value) [INPUTS] branches=- | result=value [CALLS-INTERNAL] Float getFloat(Object value, Float df) */ class WXUtils { public static float getFloat(Object value) { return getFloat(value, Float.NaN); } public static boolean isUiThread(); p...
true
ok
{"focal": {"class": "WXUtils", "name": "getFloat", "signature": "float getFloat(Object value)", "start_line": 3, "modifiers": "public static", "params": [{"name": "value", "type": "Object"}], "return_type": "float"}, "class_info": {"name": "WXUtils", "kind": "class", "modifiers": "", "superclass": null, "interfaces": n...
117256380_1
class MathUtils { public static List<Integer> positive(List<Integer> vals) { return vals.stream().filter(val -> val > 0).collect(Collectors.toList()); } public static Integer sum(List<Integer> vals); public static List<Integer> negative(List<Integer> vals); private static List<Integer> ...
var positiveValues = MathUtils.positive(vals); assertEquals(positiveValues, List.of(2, 1, 3)); } }
[FOCAL] public static List<Integer> MathUtils.positive(List<Integer> vals) [CLASS] class MathUtils [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] vals.stream().filter(val -> val > 0).collect/1, vals.stream().filter/1, List<Integer>.stream/0, Collectors.toList/0 [INPUTS] branches=-...
/* static context [FOCAL] public static List<Integer> MathUtils.positive(List<Integer> vals) [INPUTS] branches=- | result=vals [COLLABORATORS] param vals:List<Integer> stream/0 [CALLS-EXTERNAL] vals.stream().filter(val -> val > 0).collect/1, vals.stream().filter/1, List<Integer>.stream/0, Collectors.toList/0 */
/* static context [FOCAL] public static List<Integer> MathUtils.positive(List<Integer> vals) [INPUTS] branches=- | result=vals [COLLABORATORS] param vals:List<Integer> stream/0 [CALLS-EXTERNAL] vals.stream().filter(val -> val > 0).collect/1, vals.stream().filter/1, List<Integer>.stream/0, Collectors.toList/0 */ class M...
true
ok
{"focal": {"class": "MathUtils", "name": "positive", "signature": "List<Integer> positive(List<Integer> vals)", "start_line": 3, "modifiers": "public static", "params": [{"name": "vals", "type": "List<Integer>"}], "return_type": "List<Integer>"}, "class_info": {"name": "MathUtils", "kind": "class", "modifiers": "", "su...
117353090_4
class Position { static Position calculateCentre(Disk m, Disk n, double angle) { angle = correctAngle(angle); if (angle == 0 || angle == 360) { return new Position(m.getPosition().x, m.getPosition().y + n.getRadius() + m.getRadius(), n.getPosition().z); } else if (0 < angle && a...
Position position = Position.calculateCentre(disk1, disk2, 90); assert position != null; double x = position.x; double y = position.y; double z = position.z; assertEquals(10.5, x); assertEquals(5, y); assertEquals(0, z); } }
[FOCAL] static Position Position.calculateCentre(Disk m, Disk n, double angle) [CLASS] class Position [METRICS] loc=36 cc=9 branches=8 loops=0 returns=9 throws=0 nesting=8 [CALLS-INTERNAL] double correctAngle(double angle) [CALLS-EXTERNAL] Disk.getPosition/0, Disk.getRadius/0, Math.cos/1, Math.toRadians/1, Math.sin/1 [...
/* static context [FOCAL] static Position Position.calculateCentre(Disk m, Disk n, double angle) [PATH1] if(angle == 0 || angle == 360)=F -> if(0 < angle && angle < 90)=F -> if(angle == 90)=F -> if(90 < angle && angle < 180)=F -> if(angle == 180)=F -> if(180 < angle && angle < 270)=F -> if(angle == 270)=F -> if(270 < a...
/* static context [FOCAL] static Position Position.calculateCentre(Disk m, Disk n, double angle) [PATH1] if(angle == 0 || angle == 360)=F -> if(0 < angle && angle < 90)=F -> if(angle == 90)=F -> if(90 < angle && angle < 180)=F -> if(angle == 180)=F -> if(180 < angle && angle < 270)=F -> if(angle == 270)=F -> if(270 < a...
true
ok
{"focal": {"class": "Position", "name": "calculateCentre", "signature": "Position calculateCentre(Disk m, Disk n, double angle)", "start_line": 3, "modifiers": "static", "params": [{"name": "m", "type": "Disk"}, {"name": "n", "type": "Disk"}, {"name": "angle", "type": "double"}], "return_type": "Position"}, "class_info...
117357780_257
class SoapDocumentService extends AbstractService implements DocumentService { @Override public long upload(String sid, Long docId, Long folderId, boolean release, String filename, String language, DataHandler content) throws Exception { validateSession(sid); if (docId != null) { checkout(sid, docId); ...
File file = new File("pom.xml"); long docId = docService.upload("xxxx", null, 4L, true, "document test.txt", "en", new DataHandler(new FileDataSource(file))); Assert.assertTrue(docId > 0L); long docId2 = docService.upload("xxxx", docId, null, true, "document test.txt", "en", new DataHandler(new FileDa...
[FOCAL] @Override public long SoapDocumentService.upload(String sid, Long docId, Long folderId, boolean release, String filename, String language, DataHandler content) [CLASS] class SoapDocumentService extends AbstractService implements DocumentService [METRICS] loc=22 cc=3 branches=2 loops=0 returns=2 throws=0 nesting...
/* static context [FOCAL] @Override public long SoapDocumentService.upload(String sid, Long docId, Long folderId, boolean release, String filename, String language, DataHandler content) [PATH1] if(docId != null)=F -> if(StringUtils.isEmpty(language))=T -> return create(sid, doc, content).getId() [PATH2] if(docId != nul...
/* static context [FOCAL] @Override public long SoapDocumentService.upload(String sid, Long docId, Long folderId, boolean release, String filename, String language, DataHandler content) [PATH1] if(docId != null)=F -> if(StringUtils.isEmpty(language))=T -> return create(sid, doc, content).getId() [PATH2] if(docId != nul...
true
ok
{"focal": {"class": "SoapDocumentService", "name": "upload", "signature": "long upload(String sid, Long docId, Long folderId, boolean release, String filename, String language, DataHandler content) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "sid", "type": "String"}, {"name"...