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
83583832_18
class NewPipe { public static String getNameOfService(int id) { try { //noinspection ConstantConditions return getService(id).getServiceInfo().getName(); } catch (Exception e) { System.err.println("Service id not known"); e.printStackTrace(); ...
assertEquals(NewPipe.getNameOfService(YouTube.getServiceId()), YouTube.getServiceInfo().getName()); } }
[FOCAL] public static String NewPipe.getNameOfService(int id) [CLASS] class NewPipe [METRICS] loc=10 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] StreamingService getService(int serviceId) [CALLS-EXTERNAL] getService(id).getServiceInfo().getName/0, getService(id).getServiceInfo/0, System.err.pr...
/* static context [FOCAL] public static String NewPipe.getNameOfService(int id) [PATH1] try-body throws -> return "<unknown>" [PATH2] return getService(id).getServiceInfo().getName() [INPUTS] branches=- | result=id [EXCEPTIONS] catches Exception e [CALLS-INTERNAL] StreamingService getService(int serviceId) [CALLS-EXTER...
/* static context [FOCAL] public static String NewPipe.getNameOfService(int id) [PATH1] try-body throws -> return "<unknown>" [PATH2] return getService(id).getServiceInfo().getName() [INPUTS] branches=- | result=id [EXCEPTIONS] catches Exception e [CALLS-INTERNAL] StreamingService getService(int serviceId) [CALLS-EXTER...
true
ok
{"focal": {"class": "NewPipe", "name": "getNameOfService", "signature": "String getNameOfService(int id)", "start_line": 3, "modifiers": "public static", "params": [{"name": "id", "type": "int"}], "return_type": "String"}, "class_info": {"name": "NewPipe", "kind": "class", "modifiers": "", "superclass": null, "interfac...
83664920_147
class ExperimentalIdentifierCheck extends DoubleDispatchVisitorCheck { @VisibleForTesting void setIdentifiersToExclude(String identifiersToExclude) { this.identifiersToExclude = identifiersToExclude; } @Override public void visitValue(ValueTree tree); @Override public void validateParameters(); privat...
try { ExperimentalIdentifierCheck check = new ExperimentalIdentifierCheck(); check.setIdentifiersToExclude("("); CssCheckVerifier.issuesOnCssFile(check, getTestFile("experimentalIdentifierUsage.css")).noMore(); } catch (IllegalStateException e) { assertThat(e.getMessage()).isEqualTo("Che...
[FOCAL] @VisibleForTesting void ExperimentalIdentifierCheck.setIdentifiersToExclude(String identifiersToExclude) [CLASS] class ExperimentalIdentifierCheck extends DoubleDispatchVisitorCheck [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [FIELDS] write=identifiersToExclude [STATE] identifiersToExcl...
/* static context [FOCAL] @VisibleForTesting void ExperimentalIdentifierCheck.setIdentifiersToExclude(String identifiersToExclude) [STATE] identifiersToExclude [FIELDS] write=identifiersToExclude */
/* static context [FOCAL] @VisibleForTesting void ExperimentalIdentifierCheck.setIdentifiersToExclude(String identifiersToExclude) [STATE] identifiersToExclude [FIELDS] write=identifiersToExclude */ class ExperimentalIdentifierCheck extends DoubleDispatchVisitorCheck { @VisibleForTesting void setIdentifiersToExclu...
true
ok
{"focal": {"class": "ExperimentalIdentifierCheck", "name": "setIdentifiersToExclude", "signature": "void setIdentifiersToExclude(String identifiersToExclude)", "start_line": 3, "modifiers": "@VisibleForTesting", "params": [{"name": "identifiersToExclude", "type": "String"}], "return_type": "void"}, "class_info": {"name...
83751371_7
class FailsafeS3Decorator extends S3Decorator { public static FailsafeS3Decorator decorate(AmazonS3 s3) { return decorate(s3, defaultCircuitBreaker()); } private FailsafeS3Decorator(AmazonS3 delegate, CircuitBreaker circuitBreaker); @Override protected AmazonS3 getDelegate(); @Override protected T cal...
AmazonS3 s3 = FailsafeS3Decorator.decorate(new NotAuthedS3Client()); for (int i = 0; i < 100; i++ ) { try { s3.getObjectMetadata("test-bucket", "test-key"); } catch (AmazonServiceException e) { assertThat(e.getStatusCode()).isEqualTo(403); } Thread.sleep(50); } } ...
[FOCAL] public static FailsafeS3Decorator FailsafeS3Decorator.decorate(AmazonS3 s3) [CLASS] class FailsafeS3Decorator extends S3Decorator [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] CircuitBreaker defaultCircuitBreaker(); FailsafeS3Decorator decorate(AmazonS3 s3, CircuitBreaker...
/* static context [FOCAL] public static FailsafeS3Decorator FailsafeS3Decorator.decorate(AmazonS3 s3) [INPUTS] branches=- | result=s3 [CALLS-INTERNAL] CircuitBreaker defaultCircuitBreaker(); FailsafeS3Decorator decorate(AmazonS3 s3, CircuitBreaker circuitBreaker) */
/* static context [FOCAL] public static FailsafeS3Decorator FailsafeS3Decorator.decorate(AmazonS3 s3) [INPUTS] branches=- | result=s3 [CALLS-INTERNAL] CircuitBreaker defaultCircuitBreaker(); FailsafeS3Decorator decorate(AmazonS3 s3, CircuitBreaker circuitBreaker) */ class FailsafeS3Decorator extends S3Decorator { pu...
true
ok
{"focal": {"class": "FailsafeS3Decorator", "name": "decorate", "signature": "FailsafeS3Decorator decorate(AmazonS3 s3)", "start_line": 3, "modifiers": "public static", "params": [{"name": "s3", "type": "AmazonS3"}], "return_type": "FailsafeS3Decorator"}, "class_info": {"name": "FailsafeS3Decorator", "kind": "class", "m...
83883701_21
class JavaFXToggleButtonElement extends JavaFXElement { @Override public boolean marathon_select(String value) { boolean selected = Boolean.parseBoolean(value); boolean current = ((ToggleButton) node).isSelected(); if (selected != current) { click(); } return...
RadioButton radioButtonNode = (RadioButton) getPrimaryStage().getScene().getRoot().lookup(".radio-button"); AssertJUnit.assertEquals(false, radioButtonNode.isSelected()); radioButton.marathon_select("true"); new Wait("Waiting for the radio button selection.") { @Override ...
[FOCAL] @Override public boolean JavaFXToggleButtonElement.marathon_select(String value) [CLASS] class JavaFXToggleButtonElement extends JavaFXElement [METRICS] loc=9 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] Boolean.parseBoolean/1, ((ToggleButton) node).isSelected/0, click/0 (inherited) [PA...
/* static context [FOCAL] @Override public boolean JavaFXToggleButtonElement.marathon_select(String value) [PATH1] if(selected != current)=T -> return true [PATH2] if(selected != current)=F -> return true [INPUTS] branches=value | result=- [CALLS-EXTERNAL] Boolean.parseBoolean/1, ((ToggleButton) node).isSelected/0, cli...
/* static context [FOCAL] @Override public boolean JavaFXToggleButtonElement.marathon_select(String value) [PATH1] if(selected != current)=T -> return true [PATH2] if(selected != current)=F -> return true [INPUTS] branches=value | result=- [CALLS-EXTERNAL] Boolean.parseBoolean/1, ((ToggleButton) node).isSelected/0, cli...
true
ok
{"focal": {"class": "JavaFXToggleButtonElement", "name": "marathon_select", "signature": "boolean marathon_select(String value)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "value", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "JavaFXToggleButtonElement", "kind": "cla...
83904496_5
class ReactiveExecutionStrategy extends ExecutionStrategy { @Override public ExecutionResult execute(ExecutionContext context, ExecutionParameters parameters) throws NonNullableFieldWasNullException { Map<String, List<Field>> fields = parameters.fields(); Object source = parameters.source(); ...
GraphQLObjectType innerType = newObject() .name("Inner") .field(newStringField("b").staticValue("foo")) .build(); GraphQLSchema schema = newQuerySchema(it -> it .field( newField("a", new GraphQLList(innerType)) ...
[FOCAL] @Override public ExecutionResult ReactiveExecutionStrategy.execute(ExecutionContext context, ExecutionParameters parameters) [CLASS] class ReactiveExecutionStrategy extends ExecutionStrategy [METRICS] loc=22 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] ExecutionParameters transformParam...
/* static context [FOCAL] @Override public ExecutionResult ReactiveExecutionStrategy.execute(ExecutionContext context, ExecutionParameters parameters) [INPUTS] branches=- | result=context, parameters [COLLABORATORS] param parameters:ExecutionParameters fields/0,source/0 [EXCEPTIONS] declares NonNullableFieldWasNullExce...
/* static context [FOCAL] @Override public ExecutionResult ReactiveExecutionStrategy.execute(ExecutionContext context, ExecutionParameters parameters) [INPUTS] branches=- | result=context, parameters [COLLABORATORS] param parameters:ExecutionParameters fields/0,source/0 [EXCEPTIONS] declares NonNullableFieldWasNullExce...
true
ok
{"focal": {"class": "ReactiveExecutionStrategy", "name": "execute", "signature": "ExecutionResult execute(ExecutionContext context, ExecutionParameters parameters) throws NonNullableFieldWasNullException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "context", "type": "ExecutionContext"}, {"na...
83932318_5
class PokeDataSource { public Observable<String> getPokemonStringObservable(String id) { return pokemonService.getPokemon(id) .map(new Function<Pokemon, String>() { @Override public String apply(@NonNull Pokemon pokemon) throws Exception { ...
PokeDataSource dataSource = new PokeDataSource(pokemonService); TestObserver<String> observer = new TestObserver<>(); dataSource.getPokemonStringObservable("12").subscribe(observer); RecordedRequest recordedRequest = getMockWebServer().takeRequest(); assertEquals("application/...
[FOCAL] public Observable<String> PokeDataSource.getPokemonStringObservable(String id) [CLASS] class PokeDataSource [METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String constructPokemon(Pokemon pokemon) [CALLS-EXTERNAL] pokemonService.getPokemon(id).map/1, PokemonService.getPokem...
/* static context [FOCAL] public Observable<String> PokeDataSource.getPokemonStringObservable(String id) [INPUTS] branches=- | result=id, pokemonService [COLLABORATORS] field pokemonService:PokemonService getPokemon/1 [CALLS-INTERNAL] String constructPokemon(Pokemon pokemon) [FIELDS] read=pokemonService:PokemonService ...
/* static context [FOCAL] public Observable<String> PokeDataSource.getPokemonStringObservable(String id) [INPUTS] branches=- | result=id, pokemonService [COLLABORATORS] field pokemonService:PokemonService getPokemon/1 [CALLS-INTERNAL] String constructPokemon(Pokemon pokemon) [FIELDS] read=pokemonService:PokemonService ...
true
ok
{"focal": {"class": "PokeDataSource", "name": "getPokemonStringObservable", "signature": "Observable<String> getPokemonStringObservable(String id)", "start_line": 3, "modifiers": "public", "params": [{"name": "id", "type": "String"}], "return_type": "Observable<String>"}, "class_info": {"name": "PokeDataSource", "kind"...
83938778_1
class MoveValidator { public static void throwIfInvalidMove(Matrix matrix, ScrambleMove move) { switch (move.move) { case SWAP: MatrixValidator.throwIfBadIndex(matrix, move.getArg(ScrambleConstants.Swap.X1), Plane.X); MatrixValidator.throwIfBadIndex(matrix, move.getArg(ScrambleConstants.Swap.Y1), Plane.Y...
Matrix testMatrix = getTestMatrix(MoveValidator.MIN_SIZE_FOR_SCRAMBLING); for(Map.Entry<ScrambleMoves, ScrambleMove> curEntry : validMoves.entrySet()){ MoveValidator.throwIfInvalidMove(testMatrix, curEntry.getValue()); MoveValidator.throwIfInvalidMove(testMatrix, curEntry.getValue(), curEntry.getKey()); ...
[FOCAL] public static void MoveValidator.throwIfInvalidMove(Matrix matrix, ScrambleMove move) [CLASS] class MoveValidator [METRICS] loc=46 cc=10 branches=4 loops=0 returns=0 throws=4 nesting=2 [CALLS-EXTERNAL] MatrixValidator.throwIfBadIndex/3, ScrambleMove.getArg/1 [NEW] IllegalArgumentException [EXCEPTIONS] throws Il...
/* static context [FOCAL] public static void MoveValidator.throwIfInvalidMove(Matrix matrix, ScrambleMove move) [THROWS-WHEN] IllegalArgumentException when switch(move.move)=case SWAP && ( move.getArg(ScrambleConstants.Swap.X1) == move.getArg(ScrambleConstants.Swap.X2) && move.getArg(ScrambleConstants.S... [THROWS-WHEN...
/* static context [FOCAL] public static void MoveValidator.throwIfInvalidMove(Matrix matrix, ScrambleMove move) [THROWS-WHEN] IllegalArgumentException when switch(move.move)=case SWAP && ( move.getArg(ScrambleConstants.Swap.X1) == move.getArg(ScrambleConstants.Swap.X2) && move.getArg(ScrambleConstants.S... [THROWS-WHEN...
true
ok
{"focal": {"class": "MoveValidator", "name": "throwIfInvalidMove", "signature": "void throwIfInvalidMove(Matrix matrix, ScrambleMove move)", "start_line": 3, "modifiers": "public static", "params": [{"name": "matrix", "type": "Matrix"}, {"name": "move", "type": "ScrambleMove"}], "return_type": "void"}, "class_info": {"...
84008299_43
class DateGenerator { public Date getExpirationDate() { Calendar c = Calendar.getInstance(); c.add(Calendar.DAY_OF_WEEK, 1); return c.getTime(); } } class DateGeneratorTest { @Test public void testExpirationDate() {
Calendar c = Calendar.getInstance(); c.add(Calendar.DAY_OF_WEEK, 1); DateGenerator dateGenerator = new DateGenerator(); Calendar c2 = Calendar.getInstance(); c2.setTime(dateGenerator.getExpirationDate()); assertEquals(c.get(Calendar.DAY_OF_WEEK), c2.get(Calendar.DAY_OF_...
[FOCAL] public Date DateGenerator.getExpirationDate() [CLASS] class DateGenerator [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Calendar.getInstance/0, Calendar.add/2, Calendar.getTime/0 [DATAFLOW] c@L2->L3,L4 [TEST] DateGeneratorTest: @Test public void testExpirationDate()
/* static context [FOCAL] public Date DateGenerator.getExpirationDate() [CALLS-EXTERNAL] Calendar.getInstance/0, Calendar.add/2, Calendar.getTime/0 */
/* static context [FOCAL] public Date DateGenerator.getExpirationDate() [CALLS-EXTERNAL] Calendar.getInstance/0, Calendar.add/2, Calendar.getTime/0 */ class DateGenerator { public Date getExpirationDate() { Calendar c = Calendar.getInstance(); c.add(Calendar.DAY_OF_WEEK, 1); return c.getTim...
true
ok
{"focal": {"class": "DateGenerator", "name": "getExpirationDate", "signature": "Date getExpirationDate()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Date"}, "class_info": {"name": "DateGenerator", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "member...
84059135_25
class StateBundle implements Parcelable { @Nullable public double[] getDoubleArray(@Nullable String key) { Object o = map.get(key); if(o == null) { return null; } try { return (double[]) o; } catch(ClassCastException e) { typeWarning(k...
StateBundle stateBundle = new StateBundle(); assertThat(stateBundle.getDoubleArray("key")).isNull(); } }
[FOCAL] @Nullable public double[] StateBundle.getDoubleArray(String key) [CLASS] class StateBundle implements Parcelable [METRICS] loc=13 cc=3 branches=1 loops=0 returns=3 throws=0 nesting=1 [CALLS-INTERNAL] void typeWarning(String key, Object value, String className, ClassCastException e) [CALLS-EXTERNAL] map.get/1 [E...
/* static context [FOCAL] @Nullable public double[] StateBundle.getDoubleArray(String key) [PATH1] if(o == null)=F -> try-body throws -> return null [PATH2] if(o == null)=T -> return null [PATH3] if(o == null)=F -> return (double[]) o [INPUTS] branches=key | result=key [COLLABORATORS] field map get/1 */
/* static context [FOCAL] @Nullable public double[] StateBundle.getDoubleArray(String key) [PATH1] if(o == null)=F -> try-body throws -> return null [PATH2] if(o == null)=T -> return null [PATH3] if(o == null)=F -> return (double[]) o [INPUTS] branches=key | result=key [COLLABORATORS] field map get/1 */ class StateBund...
true
ok
{"focal": {"class": "StateBundle", "name": "getDoubleArray", "signature": "double[] getDoubleArray(String key)", "start_line": 3, "modifiers": "@Nullable public", "params": [{"name": "key", "type": "String"}], "return_type": "double[]"}, "class_info": {"name": "StateBundle", "kind": "class", "modifiers": "", "superclas...
84142745_46
class UIManagerModuleConstants { public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ...
ViewManager mockViewManager = mock(ViewManager.class); List<ViewManager> viewManagers = Arrays.asList(mockViewManager); when(mockViewManager.getName()).thenReturn("SomeView"); when(mockViewManager.getNativeProps()) .thenReturn(MapBuilder.of("fooProp", "number")); UIManagerModule uiManagerMod...
[FOCAL] public static Map<String, Object> UIManagerModuleConstants.getConstants() [CLASS] class UIManagerModuleConstants [METRICS] loc=76 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] HashMap<String, Object>.put/2, MapBuilder.of/2, MapBuilder.of/6, ImageView.ScaleType.FIT_CENTER.ordinal/0, Image...
/* static context [FOCAL] public static Map<String, Object> UIManagerModuleConstants.getConstants() [NEW] HashMap<String, Object> [CALLS-EXTERNAL] HashMap<String, Object>.put/2, MapBuilder.of/2, MapBuilder.of/6, ImageView.ScaleType.FIT_CENTER.ordinal/0, ImageView.ScaleType.CENTER_CROP.ordinal/0, ImageView.ScaleType.CEN...
/* static context [FOCAL] public static Map<String, Object> UIManagerModuleConstants.getConstants() [NEW] HashMap<String, Object> [CALLS-EXTERNAL] HashMap<String, Object>.put/2, MapBuilder.of/2, MapBuilder.of/6, ImageView.ScaleType.FIT_CENTER.ordinal/0, ImageView.ScaleType.CENTER_CROP.ordinal/0, ImageView.ScaleType.CEN...
true
ok
{"focal": {"class": "UIManagerModuleConstants", "name": "getConstants", "signature": "Map<String, Object> getConstants()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Map<String, Object>"}, "class_info": {"name": "UIManagerModuleConstants", "kind": "class", "modifiers": "", "superclass"...
84190084_2
class MovieDetailsViewModel extends MovieViewModel { public void getMovieDetails(long movieId) { isMovieLoading.set(true); errorViewShowing.set(false); mMoviesRepository.getMovieDetails(movieId) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedule...
// given a movie repository setupRepository(); // when get movie details is called mDetailsViewModel.getMovieDetails(MOVIE_ID); // then verify that the repository makes api call verify(mMovieRepository).getMovieDetails(MOVIE_ID); // assert that the loading indi...
[FOCAL] public void MovieDetailsViewModel.getMovieDetails(long movieId) [CLASS] class MovieDetailsViewModel extends MovieViewModel [METRICS] loc=25 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] isMovieLoading.set/1, errorViewShowing.set/1, mMoviesRepository.getMovieDetails(movieId) .observeOn(An...
/* static context [FOCAL] public void MovieDetailsViewModel.getMovieDetails(long movieId) [COLLABORATORS] field isMovieLoading set/1; field errorViewShowing set/1; field mMoviesRepository getMovieDetails/1 [NEW] DisposableObserver<Movie> [CALLS-EXTERNAL] isMovieLoading.set/1, errorViewShowing.set/1, mMoviesRepository.g...
/* static context [FOCAL] public void MovieDetailsViewModel.getMovieDetails(long movieId) [COLLABORATORS] field isMovieLoading set/1; field errorViewShowing set/1; field mMoviesRepository getMovieDetails/1 [NEW] DisposableObserver<Movie> [CALLS-EXTERNAL] isMovieLoading.set/1, errorViewShowing.set/1, mMoviesRepository.g...
true
ok
{"focal": {"class": "MovieDetailsViewModel", "name": "getMovieDetails", "signature": "void getMovieDetails(long movieId)", "start_line": 3, "modifiers": "public", "params": [{"name": "movieId", "type": "long"}], "return_type": "void"}, "class_info": {"name": "MovieDetailsViewModel", "kind": "class", "modifiers": "", "s...
84210505_0
class RtmClientBuilder { URI createUri(String endpoint, String appKey) { if (Strings.isNullOrEmpty(endpoint)) { throw new IllegalArgumentException(); } Pattern verPattern = Pattern.compile("/(v\\d+)$"); Matcher m = verPattern.matcher(endpoint); String fullEndpoint = endpoint; if (!m.f...
RtmClientBuilder builder = new RtmClientBuilder("foo", "bar"); // legacy format assertThat( builder.createUri("ws://xxx.api.com/v1", "appkey").toString(), equalTo("ws://xxx.api.com/v1?appkey=appkey") ); // new format with slash assertThat( builder.createUri("ws://xxx.api...
[FOCAL] URI RtmClientBuilder.createUri(String endpoint, String appKey) [CLASS] class RtmClientBuilder [METRICS] loc=28 cc=5 branches=3 loops=0 returns=1 throws=2 nesting=2 [CALLS-EXTERNAL] Strings.isNullOrEmpty/1, Pattern.compile/1, Pattern.matcher/1, Matcher.find/0, String.endsWith/1, Matcher.group/1, LOG.warn/3, Stri...
/* static context [FOCAL] URI RtmClientBuilder.createUri(String endpoint, String appKey) [THROWS-WHEN] IllegalArgumentException when Strings.isNullOrEmpty(endpoint) [THROWS-WHEN] RuntimeException when !Strings.isNullOrEmpty(endpoint) && !m.find() && !fullEndpoint.endsWith("/") && try-body throws [THROWS-WHEN] RuntimeEx...
/* static context [FOCAL] URI RtmClientBuilder.createUri(String endpoint, String appKey) [THROWS-WHEN] IllegalArgumentException when Strings.isNullOrEmpty(endpoint) [THROWS-WHEN] RuntimeException when !Strings.isNullOrEmpty(endpoint) && !m.find() && !fullEndpoint.endsWith("/") && try-body throws [THROWS-WHEN] RuntimeEx...
true
ok
{"focal": {"class": "RtmClientBuilder", "name": "createUri", "signature": "URI createUri(String endpoint, String appKey)", "start_line": 3, "modifiers": "", "params": [{"name": "endpoint", "type": "String"}, {"name": "appKey", "type": "String"}], "return_type": "URI"}, "class_info": {"name": "RtmClientBuilder", "kind":...
84302839_8
class ReflectionUtils { public static Map<String, Type> getTypeParameters(Class<?> subclass, Class<?> superclass) { // Gather implemented interfaces and superclass. List<Type> genericSupertypes = Stream.concat( Stream.of(subclass.getGenericSuperclass()), Stream.of(subclass.getGeneri...
MyParameterizedClassC myParameterizedObject = new MyParameterizedClassC() { }; Map<String, Type> expectedTypeParameters = new HashMap<>(); expectedTypeParameters.put("A", Long.class); final Map<String, Type> typeParameters = ReflectionUtils.getTypeParameters( myP...
[FOCAL] public static Map<String, Type> ReflectionUtils.getTypeParameters(Class<?> subclass, Class<?> superclass) [CLASS] class ReflectionUtils [METRICS] loc=50 cc=10 branches=7 loops=2 returns=4 throws=0 nesting=6 [CALLS-INTERNAL] Map<String, Type> getTypeArguments(ParameterizedType type) [CALLS-EXTERNAL] Stream.conca...
/* static context [FOCAL] public static Map<String, Type> ReflectionUtils.getTypeParameters(Class<?> subclass, Class<?> superclass) [PATH1] foreach(Type supertype : genericSupertypes)=T -> if(supertype instanceof Class<?>)=F -> if(supertype instanceof ParameterizedType)=T -> if(!(rawType instanceof Class<?>))=F -> if(!...
/* static context [FOCAL] public static Map<String, Type> ReflectionUtils.getTypeParameters(Class<?> subclass, Class<?> superclass) [PATH1] foreach(Type supertype : genericSupertypes)=T -> if(supertype instanceof Class<?>)=F -> if(supertype instanceof ParameterizedType)=T -> if(!(rawType instanceof Class<?>))=F -> if(!...
true
ok
{"focal": {"class": "ReflectionUtils", "name": "getTypeParameters", "signature": "Map<String, Type> getTypeParameters(Class<?> subclass, Class<?> superclass)", "start_line": 3, "modifiers": "public static", "params": [{"name": "subclass", "type": "Class<?>"}, {"name": "superclass", "type": "Class<?>"}], "return_type": ...
84311940_42
class SearchUserExecutor implements RequestExecutor { @Override public GoPluginApiResponse execute() throws Exception { Map<String, String> requestParam = Util.GSON.fromJson(request.requestBody(), Map.class); String searchTerm = requestParam.get(SEARCH_TERM); List<AuthConfig> authConfig...
final GoPluginApiRequest request = mock(GoPluginApiRequest.class); mockPasswordFileWith("/var/etc/password_1.properties", "myname"); mockPasswordFileWith("/var/etc/password_2.properties", "yournamed", "bar", "myname"); mockPasswordFileWith("/var/etc/password_3.properties", "nameless", "...
[FOCAL] @Override public GoPluginApiResponse SearchUserExecutor.execute() [CLASS] class SearchUserExecutor implements RequestExecutor [METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Set<User> searchUsers(String searchTerm, List<AuthConfig> authConfigs) [CALLS-EXTERNAL] Util.GSON.f...
/* static context [FOCAL] @Override public GoPluginApiResponse SearchUserExecutor.execute() [COLLABORATORS] field request requestBody/0 [EXCEPTIONS] declares Exception [CALLS-INTERNAL] Set<User> searchUsers(String searchTerm, List<AuthConfig> authConfigs) [NEW] DefaultGoPluginApiResponse [CALLS-EXTERNAL] Util.GSON.from...
/* static context [FOCAL] @Override public GoPluginApiResponse SearchUserExecutor.execute() [COLLABORATORS] field request requestBody/0 [EXCEPTIONS] declares Exception [CALLS-INTERNAL] Set<User> searchUsers(String searchTerm, List<AuthConfig> authConfigs) [NEW] DefaultGoPluginApiResponse [CALLS-EXTERNAL] Util.GSON.from...
true
ok
{"focal": {"class": "SearchUserExecutor", "name": "execute", "signature": "GoPluginApiResponse execute() throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "GoPluginApiResponse"}, "class_info": {"name": "SearchUserExecutor", "kind": "class", "modifiers": "", "superclass": ...
84320045_0
class GraphicsBounds { public static Rectangle createBounds() { return new BufferedImage(800, 600, BufferedImage.TYPE_3BYTE_BGR) .createGraphics() .getDeviceConfiguration() .getBounds(); } public static void main(String[] args); } class GraphicsBoundsTest { @Test void createBounds() throws Excep...
assertThat(GraphicsBounds.createBounds()) .isEqualTo(new Rectangle(0, 0, 800, 600)); } }
[FOCAL] public static Rectangle GraphicsBounds.createBounds() [CLASS] class GraphicsBounds [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] new BufferedImage(800, 600, BufferedImage.TYPE_3BYTE_BGR)....getBounds/0, new BufferedImage(800, 600, BufferedImage.TYPE_3BYTE_BGR)....getDevic...
/* static context [FOCAL] public static Rectangle GraphicsBounds.createBounds() [NEW] BufferedImage [CALLS-EXTERNAL] new BufferedImage(800, 600, BufferedImage.TYPE_3BYTE_BGR)....getBounds/0, new BufferedImage(800, 600, BufferedImage.TYPE_3BYTE_BGR)....getDeviceConfiguration/0, new BufferedImage(800, 600, BufferedImage....
/* static context [FOCAL] public static Rectangle GraphicsBounds.createBounds() [NEW] BufferedImage [CALLS-EXTERNAL] new BufferedImage(800, 600, BufferedImage.TYPE_3BYTE_BGR)....getBounds/0, new BufferedImage(800, 600, BufferedImage.TYPE_3BYTE_BGR)....getDeviceConfiguration/0, new BufferedImage(800, 600, BufferedImage....
true
ok
{"focal": {"class": "GraphicsBounds", "name": "createBounds", "signature": "Rectangle createBounds()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Rectangle"}, "class_info": {"name": "GraphicsBounds", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": []...
84372863_7
class SequenceProgram implements Program { @Override public RelNode run(RelOptPlanner relOptPlanner, RelNode relNode, RelTraitSet relTraitSet, List<RelOptMaterialization> relOptMaterializationList, List<RelOptLattice> relOptLatticeList) { for (Program program : programs) { relNode = program.run(relO...
program = new SequenceProgram(); RelNode result = program.run(planner, inNode, relTraitSet, relOptMaterializationList, relOptLatticeList); Assert.assertSame(inNode, result); } }
[FOCAL] @Override public RelNode SequenceProgram.run(RelOptPlanner relOptPlanner, RelNode relNode, RelTraitSet relTraitSet, List<RelOptMaterialization> relOptMaterializationList, List<RelOptLattice> relOptLatticeList) [CLASS] class SequenceProgram implements Program [METRICS] loc=12 cc=2 branches=0 loops=1 returns=1 th...
/* static context [FOCAL] @Override public RelNode SequenceProgram.run(RelOptPlanner relOptPlanner, RelNode relNode, RelTraitSet relTraitSet, List<RelOptMaterialization> relOptMaterializationList, List<RelOptLattice> relOptLatticeList) [PATH1] foreach(Program program : programs)=T -> exit loop -> return relNode [PATH2]...
/* static context [FOCAL] @Override public RelNode SequenceProgram.run(RelOptPlanner relOptPlanner, RelNode relNode, RelTraitSet relTraitSet, List<RelOptMaterialization> relOptMaterializationList, List<RelOptLattice> relOptLatticeList) [PATH1] foreach(Program program : programs)=T -> exit loop -> return relNode [PATH2]...
true
ok
{"focal": {"class": "SequenceProgram", "name": "run", "signature": "RelNode run(RelOptPlanner relOptPlanner, RelNode relNode, RelTraitSet relTraitSet, List<RelOptMaterialization> relOptMaterializationList, List<RelOptLattice> relOptLatticeList)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "re...
84382452_2
class BankAccountService { public static TransferResult transfer(BankAccount to, BankAccount from, Money money) { BankAccount updatedFrom = from.withdrawTo(to, money); BankAccount updatedTo = to.depositFrom(from, money); return TransferResult.of(updatedTo, updatedFrom); } } class Bank...
Money initialMoney = Money.of(10000); BankAccount bankAccount1 = BankAccount.of(IdGenerator.generateId()).depositCash(initialMoney); BankAccount bankAccount2 = BankAccount.of(IdGenerator.generateId()).depositCash(initialMoney); System.out.println("bankAccount1 = " + bankAccount1.getBala...
[FOCAL] public static TransferResult BankAccountService.transfer(BankAccount to, BankAccount from, Money money) [CLASS] class BankAccountService [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] BankAccount.withdrawTo/2, BankAccount.depositFrom/2, TransferResult.of/2 [INPUTS] branche...
/* static context [FOCAL] public static TransferResult BankAccountService.transfer(BankAccount to, BankAccount from, Money money) [INPUTS] branches=- | result=from, money, to [COLLABORATORS] param from:BankAccount withdrawTo/2; param to:BankAccount depositFrom/2 [CALLS-EXTERNAL] BankAccount.withdrawTo/2, BankAccount.de...
/* static context [FOCAL] public static TransferResult BankAccountService.transfer(BankAccount to, BankAccount from, Money money) [INPUTS] branches=- | result=from, money, to [COLLABORATORS] param from:BankAccount withdrawTo/2; param to:BankAccount depositFrom/2 [CALLS-EXTERNAL] BankAccount.withdrawTo/2, BankAccount.de...
true
ok
{"focal": {"class": "BankAccountService", "name": "transfer", "signature": "TransferResult transfer(BankAccount to, BankAccount from, Money money)", "start_line": 3, "modifiers": "public static", "params": [{"name": "to", "type": "BankAccount"}, {"name": "from", "type": "BankAccount"}, {"name": "money", "type": "Money"...
84398452_82
class Config { public final Optional<Duration> poolValidationInterval() { return poolValidationInterval; } private Config(final String dataSourceSupplierClass, final String host, final int port, final String user, final Charset charset, final ScheduledExecutorService scheduler, final Optional<String>...
final Config c = Config.create(dataSourceSupplierClass, host, port, user); final Duration poolValidationInterval = Duration.ofSeconds(100); assertEquals(Optional.of(poolValidationInterval), c.poolValidationInterval(poolValidationInterval).poolValidationInterval()); } }
[FOCAL] public final Optional<Duration> Config.poolValidationInterval() [CLASS] class Config [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Config(String dataSourceSupplierClass, String host, int port, String user, Charset charset, ScheduledExecutorService scheduler, Optional<Strin...
/* static context [FOCAL] public final Optional<Duration> Config.poolValidationInterval() */
/* static context [FOCAL] public final Optional<Duration> Config.poolValidationInterval() */ class Config { public final Optional<Duration> poolValidationInterval() { return poolValidationInterval; } private Config(final String dataSourceSupplierClass, final String host, final int port, final String user, ...
true
ok
{"focal": {"class": "Config", "name": "poolValidationInterval", "signature": "Optional<Duration> poolValidationInterval()", "start_line": 3, "modifiers": "public final", "params": [], "return_type": "Optional<Duration>"}, "class_info": {"name": "Config", "kind": "class", "modifiers": "", "superclass": null, "interfaces...
84439902_1
class ChangeSets { public static void migrate(final ConnectionContext connectionContext, String fileName, String changeSetsToLoadSeparatedByComma) throws MintleafException { migrate(connectionContext, fileName, changeSetsToLoadSeparatedByComma.split(",")); } public static void applySource(final Co...
ChangeSets.migrate(testDb.getNewConnection(), "res:/Testddl.sql", new String[]{"create tables"}); Assert.assertTrue(testDbQueries.isTableExists("mintleaf.TABLE1")); Assert.assertTrue(testDbQueries.isTableExists("mintleaf.TABLE2")); ChangeSets.migrate(testDb.getNewConnection(), "res:/Te...
[FOCAL] public static void ChangeSets.migrate(ConnectionContext connectionContext, String fileName, String changeSetsToLoadSeparatedByComma) [CLASS] class ChangeSets [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void migrate(ConnectionContext connectionContext, String fileName, S...
/* static context [FOCAL] public static void ChangeSets.migrate(ConnectionContext connectionContext, String fileName, String changeSetsToLoadSeparatedByComma) [EXCEPTIONS] declares MintleafException [CALLS-INTERNAL] void migrate(ConnectionContext connectionContext, String fileName, String[] changeSetsToLoad) [CALLS-EXT...
/* static context [FOCAL] public static void ChangeSets.migrate(ConnectionContext connectionContext, String fileName, String changeSetsToLoadSeparatedByComma) [EXCEPTIONS] declares MintleafException [CALLS-INTERNAL] void migrate(ConnectionContext connectionContext, String fileName, String[] changeSetsToLoad) [CALLS-EXT...
true
ok
{"focal": {"class": "ChangeSets", "name": "migrate", "signature": "void migrate(ConnectionContext connectionContext, String fileName, String changeSetsToLoadSeparatedByComma) throws MintleafException", "start_line": 3, "modifiers": "public static", "params": [{"name": "connectionContext", "type": "ConnectionContext"}, ...
84466727_13
class VolumeRepository implements Closeable { PersistentVolumeClaim getClaim(VolumeRequest volumeRequest) { return claims.computeIfAbsent(volumeRequest, this::createClaim); } public VolumeRepository(KubernetesClient client); private PersistentVolumeClaim createClaim(VolumeRequest volumeRequest); @Over...
VolumeRequest request = VolumeRequest.volumeRequest("storage-class-name", "16Gi"); volumeRepository.getClaim(request); volumeRepository.getClaim(request); verify(pvcs, times(1)).create(any()); } }
[FOCAL] PersistentVolumeClaim VolumeRepository.getClaim(VolumeRequest volumeRequest) [CLASS] class VolumeRepository implements Closeable [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] claims.computeIfAbsent/2 [INPUTS] branches=- | result=volumeRequest [COLLABORATORS] field claims ...
/* static context [FOCAL] PersistentVolumeClaim VolumeRepository.getClaim(VolumeRequest volumeRequest) [INPUTS] branches=- | result=volumeRequest [COLLABORATORS] field claims computeIfAbsent/2 [CALLS-EXTERNAL] claims.computeIfAbsent/2 */
/* static context [FOCAL] PersistentVolumeClaim VolumeRepository.getClaim(VolumeRequest volumeRequest) [INPUTS] branches=- | result=volumeRequest [COLLABORATORS] field claims computeIfAbsent/2 [CALLS-EXTERNAL] claims.computeIfAbsent/2 */ class VolumeRepository implements Closeable { PersistentVolumeClaim getClaim(Vo...
true
ok
{"focal": {"class": "VolumeRepository", "name": "getClaim", "signature": "PersistentVolumeClaim getClaim(VolumeRequest volumeRequest)", "start_line": 3, "modifiers": "", "params": [{"name": "volumeRequest", "type": "VolumeRequest"}], "return_type": "PersistentVolumeClaim"}, "class_info": {"name": "VolumeRepository", "k...
84488372_5
class InMemoryBackend implements IStateHistoryBackend { @Override public StateInterval doSingularQuery(long t, int attributeQuark) throws TimeRangeException, AttributeNotFoundException { if (!checkValidTime(t)) { throw new TimeRangeException(ssid + " Time:" + t + ", Start:" + st...
try { StateInterval interval = fixture.doSingularQuery(0, 0); assertNotNull(interval); assertEquals(0, interval.getStart()); assertEquals(90, interval.getEnd()); assertEquals(0, ((IntegerStateValue) interval.getStateValue()).getValue()); } cat...
[FOCAL] @Override public StateInterval InMemoryBackend.doSingularQuery(long t, int attributeQuark) [CLASS] class InMemoryBackend implements IStateHistoryBackend [METRICS] loc=27 cc=5 branches=3 loops=1 returns=1 throws=2 nesting=4 [CALLS-INTERNAL] Iterator<StateInterval> serachforEndTime(TreeSet<StateInterval> tree, lo...
/* static context [FOCAL] @Override public StateInterval InMemoryBackend.doSingularQuery(long t, int attributeQuark) [THROWS-WHEN] TimeRangeException when !checkValidTime(t) [THROWS-WHEN] AttributeNotFoundException when checkValidTime(t) && iter.hasNext() && attributeMatches && !(entryStartTime <= t) [THROWS-WHEN] Attr...
/* static context [FOCAL] @Override public StateInterval InMemoryBackend.doSingularQuery(long t, int attributeQuark) [THROWS-WHEN] TimeRangeException when !checkValidTime(t) [THROWS-WHEN] AttributeNotFoundException when checkValidTime(t) && iter.hasNext() && attributeMatches && !(entryStartTime <= t) [THROWS-WHEN] Attr...
true
ok
{"focal": {"class": "InMemoryBackend", "name": "doSingularQuery", "signature": "StateInterval doSingularQuery(long t, int attributeQuark) throws TimeRangeException, AttributeNotFoundException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "t", "type": "long"}, {"name": "attributeQuark", "type":...
84506236_31
class Utils { public static boolean invokeSetterQuietly(Object obj, String setterName, Class<?> valueKlass, Object value) { if (obj == null) return false; try { invokeSetter(obj, setterName, valueKlass, value); return true; } catch (T...
ObjectWithSetter obj = new ObjectWithSetter(); assertTrue(Utils.invokeSetterQuietly(obj, "setValue", String.class, "foo")); assertEquals("happy path", "foo", obj.value); assertTrue(Utils.invokeSetterQuietly(obj, "setValue", String.class, null)); assertNull("can set null value",...
[FOCAL] public static boolean Utils.invokeSetterQuietly(Object obj, String setterName, Class<?> valueKlass, Object value) [CLASS] class Utils [METRICS] loc=15 cc=3 branches=1 loops=0 returns=3 throws=0 nesting=1 [CALLS-INTERNAL] void invokeSetter(Object obj, String setterName, Class<?> valueKlass, Object value) [EXCEPT...
/* static context [FOCAL] public static boolean Utils.invokeSetterQuietly(Object obj, String setterName, Class<?> valueKlass, Object value) [PATH1] if(obj == null)=F -> try-body throws -> return false [PATH2] if(obj == null)=T -> return false [PATH3] if(obj == null)=F -> return true [INPUTS] branches=obj | result=- [EX...
/* static context [FOCAL] public static boolean Utils.invokeSetterQuietly(Object obj, String setterName, Class<?> valueKlass, Object value) [PATH1] if(obj == null)=F -> try-body throws -> return false [PATH2] if(obj == null)=T -> return false [PATH3] if(obj == null)=F -> return true [INPUTS] branches=obj | result=- [EX...
true
ok
{"focal": {"class": "Utils", "name": "invokeSetterQuietly", "signature": "boolean invokeSetterQuietly(Object obj, String setterName, Class<?> valueKlass, Object value)", "start_line": 3, "modifiers": "public static", "params": [{"name": "obj", "type": "Object"}, {"name": "setterName", "type": "String"}, {"name": "value...
84521629_2
class AEMDataLayerInterceptorFilter implements Filter { boolean resourceHierarchyHasACycle(Resource resource) { String resourceType = resource.getResourceType(); Set<String> resourceTypeSet = new HashSet<>(); ResourceResolver resolver = resource.getResourceResolver(); while (resourceType != null) { if (r...
AEMDataLayerInterceptorFilter filter = context.getService(AEMDataLayerInterceptorFilter.class); context.currentPage("/test/page-with-cloud-config"); assertThat(filter.resourceHierarchyHasACycle(context.currentResource())).as("has a cycle should be false") .isFalse(); } }
[FOCAL] boolean AEMDataLayerInterceptorFilter.resourceHierarchyHasACycle(Resource resource) [CLASS] class AEMDataLayerInterceptorFilter implements Filter [METRICS] loc=18 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] Resource.getResourceType/0, Resource.getResourceResolver/0, Set<String>.contain...
/* static context [FOCAL] boolean AEMDataLayerInterceptorFilter.resourceHierarchyHasACycle(Resource resource) [PATH1] while(resourceType != null)=T -> if(resourceTypeSet.contains(resourceType))=F -> exit loop -> return false [PATH2] while(resourceType != null)=T -> if(resourceTypeSet.contains(resourceType))=T -> return...
/* static context [FOCAL] boolean AEMDataLayerInterceptorFilter.resourceHierarchyHasACycle(Resource resource) [PATH1] while(resourceType != null)=T -> if(resourceTypeSet.contains(resourceType))=F -> exit loop -> return false [PATH2] while(resourceType != null)=T -> if(resourceTypeSet.contains(resourceType))=T -> return...
true
ok
{"focal": {"class": "AEMDataLayerInterceptorFilter", "name": "resourceHierarchyHasACycle", "signature": "boolean resourceHierarchyHasACycle(Resource resource)", "start_line": 3, "modifiers": "", "params": [{"name": "resource", "type": "Resource"}], "return_type": "boolean"}, "class_info": {"name": "AEMDataLayerIntercep...
84603051_206
class ClusterFilters { public static ClusterFilter forNextInJoinOrder() { return NEXT_IN_JOIN_ORDER; } private ClusterFilters(); public static ClusterFilter forNext(); public static ClusterFilter forNode(ClusterNodeId nodeId); public static ClusterFilter forNode(ClusterNode node); ...
repeat(5, i -> { List<ClusterNode> nodesList = new ArrayList<>(); repeat(5, j -> nodesList.add(newNode(newNodeId(), i == j /* <- Local node. */, null, null, j))); ClusterNode expected; if (i == 4) { // If last is local then should take the first...
[FOCAL] public static ClusterFilter ClusterFilters.forNextInJoinOrder() [CLASS] class ClusterFilters [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] ClusterFilters(); ClusterFilter forNext(); ClusterFilter forNode(ClusterNodeId nodeId); ClusterFilter forNode(ClusterNode node); Clust...
/* static context [FOCAL] public static ClusterFilter ClusterFilters.forNextInJoinOrder() */
/* static context [FOCAL] public static ClusterFilter ClusterFilters.forNextInJoinOrder() */ class ClusterFilters { public static ClusterFilter forNextInJoinOrder() { return NEXT_IN_JOIN_ORDER; } private ClusterFilters(); public static ClusterFilter forNext(); public static ClusterFilter...
true
ok
{"focal": {"class": "ClusterFilters", "name": "forNextInJoinOrder", "signature": "ClusterFilter forNextInJoinOrder()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "ClusterFilter"}, "class_info": {"name": "ClusterFilters", "kind": "class", "modifiers": "", "superclass": null, "interfaces"...
84616200_110
class KetamaNodeLocator { public String getPrimary(final String key) { final List<String> rv = getNodesForKey(hash(key), 1); assert rv != null && rv.get(0) != null: "Found no node for key " + key; return rv.get(0); } public KetamaNodeLocator(final List<String> nodes); public ...
final int nodeSize = 5; final int keySize = 10000; final List<String> nodes = generateRandomStrings(nodeSize); final List<String> weightedNodes = new ArrayList<String>(nodes); weightedNodes.add(nodes.get(3)); // 20% for (int ix = 0; ix < 4; ix++) { weightedNodes.add(nodes...
[FOCAL] public String KetamaNodeLocator.getPrimary(String key) [CLASS] class KetamaNodeLocator [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] List<String> getNodesForKey(long hash, int listSize); long hash(String k) [CALLS-EXTERNAL] List<String>.get/1 [INPUTS] branches=- | result=...
/* static context [FOCAL] public String KetamaNodeLocator.getPrimary(String key) [INPUTS] branches=- | result=key [CALLS-INTERNAL] List<String> getNodesForKey(long hash, int listSize); long hash(String k) [CALLS-EXTERNAL] List<String>.get/1 */
/* static context [FOCAL] public String KetamaNodeLocator.getPrimary(String key) [INPUTS] branches=- | result=key [CALLS-INTERNAL] List<String> getNodesForKey(long hash, int listSize); long hash(String k) [CALLS-EXTERNAL] List<String>.get/1 */ class KetamaNodeLocator { public String getPrimary(final String key) { ...
true
ok
{"focal": {"class": "KetamaNodeLocator", "name": "getPrimary", "signature": "String getPrimary(String key)", "start_line": 3, "modifiers": "public", "params": [{"name": "key", "type": "String"}], "return_type": "String"}, "class_info": {"name": "KetamaNodeLocator", "kind": "class", "modifiers": "", "superclass": null, ...
84678166_0
class Config { public String getApiHost() { return apiHost; } public Config(String clientId, String secret, String apiHost, boolean useHttps, List<Scope> scopes, OkHttpClient httpClient, Ht...
Config c = newConfig("hostwithhttp.com:1234"); assertThat(c.getApiHost()).isEqualTo("hostwithhttp.com:1234"); assertThat( newConfig("http://example.com").getApiHost()).isEqualTo("example.com"); assertThat( newConfig("https://other.com:1234").getApiHost()).isEqualTo("other.com:1234"); } }
[FOCAL] public String Config.getApiHost() [CLASS] class Config [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Config(String clientId, String secret, String apiHost, boolean useHttps, List<Scope> scopes, OkHttpClient httpClient, HttpLoggingInterceptor.Level httpLoggingLevel); String...
/* static context [FOCAL] public String Config.getApiHost() */
/* static context [FOCAL] public String Config.getApiHost() */ class Config { public String getApiHost() { return apiHost; } public Config(String clientId, String secret, String apiHost, boolean useHttps, List<Scope> scopes, ...
true
ok
{"focal": {"class": "Config", "name": "getApiHost", "signature": "String getApiHost()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "Config", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "Config", ...
84742920_34
class PointDComparatorY extends PointDComparator { public int compareEpsilon(PointD a, PointD b) { return compareEpsilon(a, b, epsilon); } public PointDComparatorY(); public PointDComparatorY(double epsilon); @Override public int compare(PointD a, PointD b); public static int compar...
assertEquals(-1, PointDComparatorY.compareEpsilon(new PointD(1, 2), new PointD(1.1, 2), 0.01)); assertEquals(-1, PointDComparatorY.compareEpsilon(new PointD(1, 2), new PointD(1, 2.1), 0.01)); assertEquals(+1, PointDComparatorY.compareEpsilon(new PointD(1, 2), new PointD(0.9, 2), 0.01)); ...
[FOCAL] public int PointDComparatorY.compareEpsilon(PointD a, PointD b) [CLASS] class PointDComparatorY extends PointDComparator [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] int compareEpsilon(PointD a, PointD b, double epsilon) [INPUTS] branches=- | result=a, b [DATAFLOW] a@par...
/* static context [FOCAL] public int PointDComparatorY.compareEpsilon(PointD a, PointD b) [INPUTS] branches=- | result=a, b [CALLS-INTERNAL] int compareEpsilon(PointD a, PointD b, double epsilon) */
/* static context [FOCAL] public int PointDComparatorY.compareEpsilon(PointD a, PointD b) [INPUTS] branches=- | result=a, b [CALLS-INTERNAL] int compareEpsilon(PointD a, PointD b, double epsilon) */ class PointDComparatorY extends PointDComparator { public int compareEpsilon(PointD a, PointD b) { return co...
true
ok
{"focal": {"class": "PointDComparatorY", "name": "compareEpsilon", "signature": "int compareEpsilon(PointD a, PointD b)", "start_line": 3, "modifiers": "public", "params": [{"name": "a", "type": "PointD"}, {"name": "b", "type": "PointD"}], "return_type": "int"}, "class_info": {"name": "PointDComparatorY", "kind": "clas...
84750226_67
class AuctionRequestBuilder extends AbstractMarketDataRequestBuilder<Map<String, Auction>, AuctionRequestBuilder> implements IEXApiRestRequest<Map<String, Auction>>, IEXCloudV1RestRequest<Map<String, Auction>> { @Override public RestRequest<Map<String, Auction>> build() { return RestRequestBuilder.<Map...
final String symbol = "IBM"; final RestRequest<Map<String, Auction>> request = new AuctionRequestBuilder() .withSymbol(symbol) .build(); assertThat(request.getMethodType()).isEqualTo(MethodType.GET); assertThat(request.getPath()).isEqualTo("/deep/auction...
[FOCAL] @Override public RestRequest<Map<String, Auction>> AuctionRequestBuilder.build() [CLASS] class AuctionRequestBuilder extends AbstractMarketDataRequestBuilder<Map<String, Auction>, AuctionRequestBuilder> implements IEXApiRestRequest<Map<String, Auction>>, IEXCloudV1RestRequest<Map<String, Auction>> [METRICS] loc...
/* static context [FOCAL] @Override public RestRequest<Map<String, Auction>> AuctionRequestBuilder.build() [NEW] GenericType<Map<String, Auction>> [CALLS-EXTERNAL] RestRequestBuilder.<Map<String, Auction>>builder() .withP....build/0, RestRequestBuilder.<Map<String, Auction>>builder() .withP....addQueryParam/1, RestRequ...
/* static context [FOCAL] @Override public RestRequest<Map<String, Auction>> AuctionRequestBuilder.build() [NEW] GenericType<Map<String, Auction>> [CALLS-EXTERNAL] RestRequestBuilder.<Map<String, Auction>>builder() .withP....build/0, RestRequestBuilder.<Map<String, Auction>>builder() .withP....addQueryParam/1, RestRequ...
true
ok
{"focal": {"class": "AuctionRequestBuilder", "name": "build", "signature": "RestRequest<Map<String, Auction>> build()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "RestRequest<Map<String, Auction>>"}, "class_info": {"name": "AuctionRequestBuilder", "kind": "class", "modifiers": "", "...
84765740_2
class Config implements Runnable { static Config getConfig(String[] args) { Config config = new Config(); CommandLine.run(config, System.err, args); return config; } @Override public void run(); } class ConfigTest { @Test public void testCommand() {
String[] args = {"","train","task","tt"}; Config config = Config.getConfig(args); Assert.assertEquals(config.isTrain, false); Assert.assertEquals(config.task, "tt"); } }
[FOCAL] static Config Config.getConfig(String[] args) [CLASS] class Config implements Runnable [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] CommandLine.run/3 [NEW] Config [DATAFLOW] args@param->L4; config@L2->L4,L5 [CLASS-MEMBERS] void run() [TEST] ConfigTest: @Test public void ...
/* static context [FOCAL] static Config Config.getConfig(String[] args) [NEW] Config [CALLS-EXTERNAL] CommandLine.run/3 */
/* static context [FOCAL] static Config Config.getConfig(String[] args) [NEW] Config [CALLS-EXTERNAL] CommandLine.run/3 */ class Config implements Runnable { static Config getConfig(String[] args) { Config config = new Config(); CommandLine.run(config, System.err, args); return config; ...
true
ok
{"focal": {"class": "Config", "name": "getConfig", "signature": "Config getConfig(String[] args)", "start_line": 3, "modifiers": "static", "params": [{"name": "args", "type": "String[]"}], "return_type": "Config"}, "class_info": {"name": "Config", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Run...
84791542_0
class User { public boolean isReady() { return getStatus() == Status.READY; } public User(); public User(long id, String email, String nickname); public long getId(); public void setId(long id); public String getEmail(); public void setEmail(String email); public String ...
User user = new User(); user.enterRoom(1); assertEquals(false, user.isReady()); } }
[FOCAL] public boolean User.isReady() [CLASS] class User [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Status getStatus() [CLASS-MEMBERS] User(); User(long id, String email, String nickname); long getId(); void setId(long id); String getEmail(); void setEmail(String email); Strin...
/* static context [FOCAL] public boolean User.isReady() [CALLS-INTERNAL] Status getStatus() */
/* static context [FOCAL] public boolean User.isReady() [CALLS-INTERNAL] Status getStatus() */ class User { public boolean isReady() { return getStatus() == Status.READY; } public User(); public User(long id, String email, String nickname); public long getId(); public void setId(lon...
true
ok
{"focal": {"class": "User", "name": "isReady", "signature": "boolean isReady()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "User", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name": "User", "kind": "c...
84838073_0
class UserClass implements Serializable { public void setPassword(String password) throws UserException { int MIN_PASSWORD_LENGTH = 6; int MAX_PASSWORD_LENGTH = 16; if((password != null && !password.isEmpty()) && (password.length() < MIN_PASSWORD_LENGTH || ...
boolean isValid = false; UserClass userClass = new UserClass(); try { isValid = true; userClass.setPassword("nome"); } catch (UserException e) { isValid = false; e.printStackTrace(); } assertFalse(isValid); } }
[FOCAL] public void UserClass.setPassword(String password) [CLASS] class UserClass implements Serializable [METRICS] loc=20 cc=3 branches=2 loops=0 returns=0 throws=2 nesting=2 [CALLS-EXTERNAL] String.isEmpty/0, String.length/0 [NEW] UserException [FIELDS] write=password [EXCEPTIONS] declares UserException; throws User...
/* static context [FOCAL] public void UserClass.setPassword(String password) [THROWS-WHEN] UserException when ((password != null && !password.isEmpty()) && (password.length() < MIN_PASSWORD_LENGTH || password.length() > MAX_PAS... [THROWS-WHEN] UserException when !(((password != null && !password.isEmpty()) && (passwor...
/* static context [FOCAL] public void UserClass.setPassword(String password) [THROWS-WHEN] UserException when ((password != null && !password.isEmpty()) && (password.length() < MIN_PASSWORD_LENGTH || password.length() > MAX_PAS... [THROWS-WHEN] UserException when !(((password != null && !password.isEmpty()) && (passwor...
true
ok
{"focal": {"class": "UserClass", "name": "setPassword", "signature": "void setPassword(String password) throws UserException", "start_line": 3, "modifiers": "public", "params": [{"name": "password", "type": "String"}], "return_type": "void"}, "class_info": {"name": "UserClass", "kind": "class", "modifiers": "", "superc...
84880723_86
class Fullfill { @NotNull public static List<File> multiple( GeneratorEnvironment environment, @NotNull File templates[], File outputFolder, @NotNull File sourceFolder, String version) throws IOException, NoSuchAlgorithmException { List<File> result = new ArrayList<>(); CDepMa...
File templates[] = new File[]{ new File("../third_party/mini-firebase/cdep-manifest-app.yml"), new File("../third_party/mini-firebase/cdep-manifest-database.yml") }; File output = new File(".test-files/testMiniFirebase").getAbsoluteFile(); output.delete(); List<File> result = Fullfil...
[FOCAL] @NotNull public static List<File> Fullfill.multiple(GeneratorEnvironment environment, File templates, File outputFolder, File sourceFolder, String version) [CLASS] class Fullfill [METRICS] loc=131 cc=14 branches=10 loops=3 returns=9 throws=0 nesting=2 [CALLS-EXTERNAL] File.isDirectory/0, File.mkdirs/0, FileUtil...
/* static context [FOCAL] @NotNull public static List<File> Fullfill.multiple(GeneratorEnvironment environment, File templates, File outputFolder, File sourceFolder, String version) [INPUTS] branches=outputFolder, templates | result=- [COLLABORATORS] param sourceFolder:File getAbsolutePath/0 */
/* static context [FOCAL] @NotNull public static List<File> Fullfill.multiple(GeneratorEnvironment environment, File templates, File outputFolder, File sourceFolder, String version) [INPUTS] branches=outputFolder, templates | result=- [COLLABORATORS] param sourceFolder:File getAbsolutePath/0 */ class Fullfill { @Not...
true
ok
{"focal": {"class": "Fullfill", "name": "multiple", "signature": "List<File> multiple(GeneratorEnvironment environment, File templates, File outputFolder, File sourceFolder, String version) throws IOException, NoSuchAlgorithmException", "start_line": 3, "modifiers": "@NotNull public static", "params": [{"name": "enviro...
84974822_23
class TransformWithSerializerNodeImpl implements SerializeWithTransformerNode { @Override public String toString() { return this.transformationChain.transformToString(); } TransformWithSerializerNodeImpl(TransformationChain transformationChain); @Override public void to(OutputStream out); @Override public...
node.toString(); verify(transformationChain).transformToString(); } }
[FOCAL] @Override public String TransformWithSerializerNodeImpl.toString() [CLASS] class TransformWithSerializerNodeImpl implements SerializeWithTransformerNode [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] TransformationChain.transformToString/0 [FIELDS] read=transformationChain...
/* static context [FOCAL] @Override public String TransformWithSerializerNodeImpl.toString() [INPUTS] branches=- | result=transformationChain [COLLABORATORS] field transformationChain:TransformationChain transformToString/0 [FIELDS] read=transformationChain:TransformationChain [CALLS-EXTERNAL] TransformationChain.trans...
/* static context [FOCAL] @Override public String TransformWithSerializerNodeImpl.toString() [INPUTS] branches=- | result=transformationChain [COLLABORATORS] field transformationChain:TransformationChain transformToString/0 [FIELDS] read=transformationChain:TransformationChain [CALLS-EXTERNAL] TransformationChain.trans...
true
ok
{"focal": {"class": "TransformWithSerializerNodeImpl", "name": "toString", "signature": "String toString()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "TransformWithSerializerNodeImpl", "kind": "class", "modifiers": "", "superclass": null, "interfac...
85088788_0
class Calculator { public int add(int a, int b) { return a + b; } public int multiply(int a, int b); private Calculator underTest; } class CalculatorTest { private Calculator underTest; @Test public void add() throws Exception {
assertThat(underTest.add(3, 3), is(6)); } }
[FOCAL] public int Calculator.add(int a, int b) [CLASS] class Calculator [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [INPUTS] branches=- | result=a, b [DATAFLOW] a@param->L2; b@param->L2 [CLASS-MEMBERS] int multiply(int a, int b) [TEST] CalculatorTest: @Test public void add() throws Exception [...
/* static context [FOCAL] public int Calculator.add(int a, int b) [INPUTS] branches=- | result=a, b */
/* static context [FOCAL] public int Calculator.add(int a, int b) [INPUTS] branches=- | result=a, b */ class Calculator { public int add(int a, int b) { return a + b; } public int multiply(int a, int b); private Calculator underTest; } class CalculatorTest { private Calculator underTes...
true
ok
{"focal": {"class": "Calculator", "name": "add", "signature": "int add(int a, int b)", "start_line": 3, "modifiers": "public", "params": [{"name": "a", "type": "int"}, {"name": "b", "type": "int"}], "return_type": "int"}, "class_info": {"name": "Calculator", "kind": "class", "modifiers": "", "superclass": null, "interf...
85113353_16
class Artifact { public static Artifact fromPath(Path path) { String extension = com.google.common.io.Files.getFileExtension(path.toString()); if (Files.exists(path.resolve("WEB-INF"))) { if (Files.exists(path.resolve("WEB-INF/appengine-web.xml"))) { return new Artifact(ArtifactType.COMPAT_EXP...
int thrown = 0; for (Path p : invalidArtifacts) { try { Artifact.fromPath(p); } catch (IllegalArgumentException e) { thrown++; } } assertEquals(invalidArtifacts.size(), thrown); } }
[FOCAL] public static Artifact Artifact.fromPath(Path path) [CLASS] class Artifact [METRICS] loc=20 cc=5 branches=4 loops=0 returns=4 throws=1 nesting=3 [CALLS-EXTERNAL] com.google.common.io.Files.getFileExtension/1, Path.toString/0, Files.exists/1, Path.resolve/1, String.equalsIgnoreCase/1 [NEW] Artifact, IllegalArgum...
/* static context [FOCAL] public static Artifact Artifact.fromPath(Path path) [THROWS-WHEN] IllegalArgumentException when !(Files.exists(path.resolve("WEB-INF"))) && !extension.equalsIgnoreCase("war") && !extension.equalsIgnoreCase("jar") [PATH1] if(Files.exists(path.resolve("WEB-INF")))=F -> if(extension.equalsIgnoreC...
/* static context [FOCAL] public static Artifact Artifact.fromPath(Path path) [THROWS-WHEN] IllegalArgumentException when !(Files.exists(path.resolve("WEB-INF"))) && !extension.equalsIgnoreCase("war") && !extension.equalsIgnoreCase("jar") [PATH1] if(Files.exists(path.resolve("WEB-INF")))=F -> if(extension.equalsIgnoreC...
true
ok
{"focal": {"class": "Artifact", "name": "fromPath", "signature": "Artifact fromPath(Path path)", "start_line": 3, "modifiers": "public static", "params": [{"name": "path", "type": "Path"}], "return_type": "Artifact"}, "class_info": {"name": "Artifact", "kind": "class", "modifiers": "", "superclass": null, "interfaces":...
85172071_211
class MultivariateFactorization { @SuppressWarnings("unchecked") public static <Term extends AMonomial<Term>, Poly extends AMultivariatePolynomial<Term, Poly>> PolynomialFactorDecomposition<Poly> FactorInGF(final Poly polynomial) { if (canConvertToZp64(polynomial)) return Fa...
// todo: discover IntegersZp64 domain = new IntegersZp64(33554467); String[] vars = {"a", "b", "c", "d", "e", "f", "g"}; MultivariatePolynomialZp64 factors[] = { MultivariatePolynomialZp64.parse("25078271*b^5*c*d^2*e^2*f^6*g^3+22985...
[FOCAL] @SuppressWarnings("unchecked") public static PolynomialFactorDecomposition<Poly> MultivariateFactorization.FactorInGF(Poly polynomial) [CLASS] class MultivariateFactorization [METRICS] loc=9 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] PolynomialFactorDecomposition<Poly> Factor(Poly pol...
class MultivariateFactorization { @SuppressWarnings("unchecked") public static <Term extends AMonomial<Term>, Poly extends AMultivariatePolynomial<Term, Poly>> PolynomialFactorDecomposition<Poly> FactorInGF(final Poly polynomial) { if (canConvertToZp64(polynomial)) return Fa...
false
ok
{"focal": {"class": "MultivariateFactorization", "name": "FactorInGF", "signature": "PolynomialFactorDecomposition<Poly> FactorInGF(Poly polynomial)", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public static", "params": [{"name": "polynomial", "type": "Poly"}], "return_type": "PolynomialFactorDecom...
85184501_8
class IntFloatHashMap implements IntFloatMap { public boolean isHash() { return true; } public IntFloatHashMap(int size); public int size(); public int capacity(); public float averageOpsPerAccess(); private int collisionInspection(boolean countMultiple); public int collision...
assertTrue(new IntFloatHashMap(10).isHash()); } }
[FOCAL] public boolean IntFloatHashMap.isHash() [CLASS] class IntFloatHashMap implements IntFloatMap [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] IntFloatHashMap(int size); int size(); int capacity(); float averageOpsPerAccess(); int collisionInspection(boolean countMultiple); in...
/* static context [FOCAL] public boolean IntFloatHashMap.isHash() */
/* static context [FOCAL] public boolean IntFloatHashMap.isHash() */ class IntFloatHashMap implements IntFloatMap { public boolean isHash() { return true; } public IntFloatHashMap(int size); public int size(); public int capacity(); public float averageOpsPerAccess(); private int...
true
ok
{"focal": {"class": "IntFloatHashMap", "name": "isHash", "signature": "boolean isHash()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "IntFloatHashMap", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "IntFloatMap", "fields": [{"name": "DEL...
85229098_2
class DespesaService { public BigDecimal findTotalPagoMesAtual() { return findTotalAPagarMesAtual(true); } public List<Despesa> findAll(); public Page<Despesa> findAll(DespesaBuscaTO despesaBuscaTO); private PageRequest getPaginacaoOrdenada(DespesaBuscaTO despesaBuscaTO); @Transactiona...
despesaService.save(Despesa.builder() .data(LocalDate.now()) .valor(BigDecimal.valueOf(70)) .descricao("Conta de Luz") .categoria(Categoria.MORARIA) .paga(false) .build()); despesaService.save(Despesa.builde...
[FOCAL] public BigDecimal DespesaService.findTotalPagoMesAtual() [CLASS] class DespesaService [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] BigDecimal findTotalAPagarMesAtual(boolean pago) [CLASS-MEMBERS] List<Despesa> findAll(); Page<Despesa> findAll(DespesaBuscaTO despesaBuscaT...
/* static context [FOCAL] public BigDecimal DespesaService.findTotalPagoMesAtual() [CALLS-INTERNAL] BigDecimal findTotalAPagarMesAtual(boolean pago) */
/* static context [FOCAL] public BigDecimal DespesaService.findTotalPagoMesAtual() [CALLS-INTERNAL] BigDecimal findTotalAPagarMesAtual(boolean pago) */ class DespesaService { public BigDecimal findTotalPagoMesAtual() { return findTotalAPagarMesAtual(true); } public List<Despesa> findAll(); pub...
true
ok
{"focal": {"class": "DespesaService", "name": "findTotalPagoMesAtual", "signature": "BigDecimal findTotalPagoMesAtual()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "BigDecimal"}, "class_info": {"name": "DespesaService", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null,...
85239682_95
class RxUtils { public static <T> Observable<T> singleOrEmpty(Observable<? extends Collection<T>> collectionObservable) { return collectionObservable.toList().concatMap(lists -> { if (lists.size() > 1) { return Observable.error(new IllegalArgumentException("Observable contains m...
Observable<Foo> fooObservable = RxUtils.singleOrEmpty(Observable.empty()); assertThat(fooObservable.toList().toBlocking().single()).isEmpty(); } }
[FOCAL] public static Observable<T> RxUtils.singleOrEmpty(Observable<? extends Collection<T>> collectionObservable) [CLASS] class RxUtils [METRICS] loc=14 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=3 [CALLS-EXTERNAL] collectionObservable.toList().concatMap/1, Observable<? extends Collection<T>>.toList/0, lists....
/* static context [FOCAL] public static Observable<T> RxUtils.singleOrEmpty(Observable<? extends Collection<T>> collectionObservable) [INPUTS] branches=- | result=collectionObservable [COLLABORATORS] param collectionObservable:Observable<? extends Collection<T>> toList/0; field lists size/0,get/1 [NEW] IllegalArgumentE...
/* static context [FOCAL] public static Observable<T> RxUtils.singleOrEmpty(Observable<? extends Collection<T>> collectionObservable) [INPUTS] branches=- | result=collectionObservable [COLLABORATORS] param collectionObservable:Observable<? extends Collection<T>> toList/0; field lists size/0,get/1 [NEW] IllegalArgumentE...
true
ok
{"focal": {"class": "RxUtils", "name": "singleOrEmpty", "signature": "Observable<T> singleOrEmpty(Observable<? extends Collection<T>> collectionObservable)", "start_line": 3, "modifiers": "public static", "params": [{"name": "collectionObservable", "type": "Observable<? extends Collection<T>>"}], "return_type": "Observ...
85242760_0
class SpanBuilderR implements Tracer.SpanBuilder { @Override public Span start() { Span wspan = wrapped.start(); String spanId = UUID.randomUUID().toString(); wspan.setBaggageItem(BAGGAGE_SPANID_KEY, spanId); // shamelessly copied from io.jaegertracing.internal.JaegerTracer.Spa...
final String spanId = "some-span-id-" + System.currentTimeMillis(); final Map<String, String> parentBaggage = new HashMap<>(); parentBaggage.put(SpanBuilderR.BAGGAGE_SPANID_KEY, spanId); // setup mocks when(scopeManagerMock.activeSpan()).thenReturn(parentSpanMock); when(...
[FOCAL] @Override public Span SpanBuilderR.start() [CLASS] class SpanBuilderR implements Tracer.SpanBuilder [METRICS] loc=14 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] Tracer.SpanBuilder asChildOf(SpanContext spanContext) [CALLS-EXTERNAL] wrapped.start/0, UUID.randomUUID().toString/0, UUID.ra...
/* static context [FOCAL] @Override public Span SpanBuilderR.start() [PATH1] if(references.isEmpty() && !ignoreActiveSpan && null != scopeManager.activeSpan())=T -> return new SpanR(wspan, reporter, spanId, operationName, tags, references) [PATH2] if(references.isEmpty() && !ignoreActiveSpan && null != scopeManager.act...
/* static context [FOCAL] @Override public Span SpanBuilderR.start() [PATH1] if(references.isEmpty() && !ignoreActiveSpan && null != scopeManager.activeSpan())=T -> return new SpanR(wspan, reporter, spanId, operationName, tags, references) [PATH2] if(references.isEmpty() && !ignoreActiveSpan && null != scopeManager.act...
true
ok
{"focal": {"class": "SpanBuilderR", "name": "start", "signature": "Span start()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Span"}, "class_info": {"name": "SpanBuilderR", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Tracer.SpanBuilder", "fields": [{"name": "...
85416181_1
class MetricsCounter { @Schedule(minute = "*",second = "*/10",hour = "*") public void calculateMetrics() { System.out.println("."); this.successesPerSecond = ((double)(success.longValue() - this.lastSuccess))/10; this.lastSuccess = success.longValue(); this.overflowsPerSecond =...
this.cut.lastSuccess = 10; this.cut.success.set(40); this.cut.calculateMetrics(); assertThat(this.cut.successesPerSecond,is(3d)); assertThat(this.cut.lastSuccess,is(this.cut.success.longValue())); } }
[FOCAL] @Schedule(minute = "*",second = "*/10",hour = "*") public void MetricsCounter.calculateMetrics() [CLASS] class MetricsCounter [METRICS] loc=9 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] System.out.println/1, success.longValue/0, overflow.longValue/0 [FIELDS] read=lastOverflow, lastSucc...
/* static context [FOCAL] @Schedule(minute = "*",second = "* /10",hour = "*") public void MetricsCounter.calculateMetrics() [COLLABORATORS] field success longValue/0; field overflow longValue/0 [STATE] lastOverflow, lastSuccess, overflowsPerSecond, successesPerSecond [FIELDS] read=lastOverflow, lastSuccess | write=last...
/* static context [FOCAL] @Schedule(minute = "*",second = "* /10",hour = "*") public void MetricsCounter.calculateMetrics() [COLLABORATORS] field success longValue/0; field overflow longValue/0 [STATE] lastOverflow, lastSuccess, overflowsPerSecond, successesPerSecond [FIELDS] read=lastOverflow, lastSuccess | write=last...
true
ok
{"focal": {"class": "MetricsCounter", "name": "calculateMetrics", "signature": "void calculateMetrics()", "start_line": 3, "modifiers": "@Schedule(minute = \"*\",second = \"*/10\",hour = \"*\") public", "params": [], "return_type": "void"}, "class_info": {"name": "MetricsCounter", "kind": "class", "modifiers": "", "sup...
85416613_5
class VectorCommand { public static VectorCommand createVectorCommand(String svgCommandString) { SVGCommand cmd = SVGCommand.valueOf(svgCommandString.substring(0, 1)); String[] argsAsString = svgCommandString.substring(1).split(SVG_ARG_DELIMITER); float[] args = new float[argsAsString.length]; int i ...
// Absolute coordinates VectorCommand cubicToCommand = VectorCommand.createVectorCommand("C1,2,3,4,5,6"); Assert.assertTrue(cubicToCommand instanceof VectorCommand.CubicToCommand); Assert.assertEquals(VectorCommand.ArgFormat.ABSOLUTE, cubicToCommand.mArgFormat); Assert.assertEquals(6, cubicToCommand...
[FOCAL] public static VectorCommand VectorCommand.createVectorCommand(String svgCommandString) [CLASS] class VectorCommand [METRICS] loc=61 cc=14 branches=5 loops=1 returns=4 throws=5 nesting=2 [CALLS-INTERNAL] boolean checkArguments(SVGCommand command, float[] args) [CALLS-EXTERNAL] SVGCommand.valueOf/1, String.substr...
/* static context [FOCAL] public static VectorCommand VectorCommand.createVectorCommand(String svgCommandString) [THROWS-WHEN] IllegalArgumentException when foreach(String arg : argsAsString)=T && switch(cmd)=case M && !checkArguments(cmd, args) [THROWS-WHEN] IllegalArgumentException when foreach(String arg : argsAsStr...
/* static context [FOCAL] public static VectorCommand VectorCommand.createVectorCommand(String svgCommandString) [THROWS-WHEN] IllegalArgumentException when foreach(String arg : argsAsString)=T && switch(cmd)=case M && !checkArguments(cmd, args) [THROWS-WHEN] IllegalArgumentException when foreach(String arg : argsAsStr...
true
ok
{"focal": {"class": "VectorCommand", "name": "createVectorCommand", "signature": "VectorCommand createVectorCommand(String svgCommandString)", "start_line": 3, "modifiers": "public static", "params": [{"name": "svgCommandString", "type": "String"}], "return_type": "VectorCommand"}, "class_info": {"name": "VectorCommand...
85497373_2
class BooksActivityPresenter { public void loadBooks() { compositeDisposable.add(booksRepository.getBooks() .subscribeOn(Schedulers.io()) .observeOn(mainScheduler) .subscribeWith(new DisposableSingleObserver<List<Book>>() { @Override ...
when(booksRepository.getBooks()).thenReturn(Single.<List<Book>>error(new Throwable("boom"))); presenter.loadBooks(); verify(view).displayError(); } }
[FOCAL] public void BooksActivityPresenter.loadBooks() [CLASS] class BooksActivityPresenter [METRICS] loc=22 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] compositeDisposable.add/1, booksRepository.getBooks() .subscribeOn(Schedulers.io()) ....subscribeWith/1, booksRepository.getBooks() .subscrib...
/* static context [FOCAL] public void BooksActivityPresenter.loadBooks() [COLLABORATORS] field compositeDisposable add/1; field booksRepository:BooksRepository getBooks/0; field bookList isEmpty/0; field view:BooksActivityView displayNoBooks/0,displayBooks/1,displayError/0 [FIELDS] read=booksRepository:BooksRepository,...
/* static context [FOCAL] public void BooksActivityPresenter.loadBooks() [COLLABORATORS] field compositeDisposable add/1; field booksRepository:BooksRepository getBooks/0; field bookList isEmpty/0; field view:BooksActivityView displayNoBooks/0,displayBooks/1,displayError/0 [FIELDS] read=booksRepository:BooksRepository,...
true
ok
{"focal": {"class": "BooksActivityPresenter", "name": "loadBooks", "signature": "void loadBooks()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "BooksActivityPresenter", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name":...
85541447_3
class Activator { @Activate public void start(ActivatorConfiguration config) { String[] authorizableIds = config.pwdreset_authorizables(); Session session = null; try { ResourceResolver resolver = resolverFactory.getAdministrativeResourceResolver(null); UserMan...
when(mockResolverFactory.getAdministrativeResourceResolver(null)).thenThrow(new LoginException()); Activator activator = spy(createActivator()); activator.start(mockConfiguration); verify(mockAuthorizable, times(0)).changePassword(anyString()); verify(mockSession, times(0)).sav...
[FOCAL] @Activate public void Activator.start(ActivatorConfiguration config) [CLASS] class Activator [METRICS] loc=35 cc=7 branches=3 loops=1 returns=0 throws=0 nesting=5 [CALLS-EXTERNAL] ActivatorConfiguration.pwdreset_authorizables/0, resolverFactory.getAdministrativeResourceResolver/1, ResourceResolver.adaptTo/1, Us...
/* static context [FOCAL] @Activate public void Activator.start(ActivatorConfiguration config) [PATH1] foreach(String authorizable : authorizableIds)=T -> if(user != null)=T -> if(!userManager.isAutoSave())=T -> exit loop -> if(session != null)=T [PATH2] try-body throws -> if(session != null)=F [PATH3] foreach(String a...
/* static context [FOCAL] @Activate public void Activator.start(ActivatorConfiguration config) [PATH1] foreach(String authorizable : authorizableIds)=T -> if(user != null)=T -> if(!userManager.isAutoSave())=T -> exit loop -> if(session != null)=T [PATH2] try-body throws -> if(session != null)=F [PATH3] foreach(String a...
true
ok
{"focal": {"class": "Activator", "name": "start", "signature": "void start(ActivatorConfiguration config)", "start_line": 3, "modifiers": "@Activate public", "params": [{"name": "config", "type": "ActivatorConfiguration"}], "return_type": "void"}, "class_info": {"name": "Activator", "kind": "class", "modifiers": "", "s...
85686334_7
class Objects { static boolean equals(Object a, Object b) { return (a == null) ? (b == null) : a.equals(b); } static boolean deepEquals(Object a, Object b); static int hash(Object... values); static String toString(Object o); } class ObjectsTest { @Test public void equals_differentBooleanParams_returnFals...
// Given final boolean paramA = true; final boolean paramB = false; // When final boolean result = Objects.equals(paramA, paramB); // Then assertThat(result, is(false)); } }
[FOCAL] static boolean Objects.equals(Object a, Object b) [CLASS] class Objects [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Object.equals/1 [INPUTS] branches=- | result=a, b [DATAFLOW] a@param->L2; b@param->L2 [CLASS-MEMBERS] boolean deepEquals(Object a, Object b); int hash(Obj...
/* static context [FOCAL] static boolean Objects.equals(Object a, Object b) [INPUTS] branches=- | result=a, b [CALLS-EXTERNAL] Object.equals/1 */
/* static context [FOCAL] static boolean Objects.equals(Object a, Object b) [INPUTS] branches=- | result=a, b [CALLS-EXTERNAL] Object.equals/1 */ class Objects { static boolean equals(Object a, Object b) { return (a == null) ? (b == null) : a.equals(b); } static boolean deepEquals(Object a, Object b); static in...
true
ok
{"focal": {"class": "Objects", "name": "equals", "signature": "boolean equals(Object a, Object b)", "start_line": 3, "modifiers": "static", "params": [{"name": "a", "type": "Object"}, {"name": "b", "type": "Object"}], "return_type": "boolean"}, "class_info": {"name": "Objects", "kind": "class", "modifiers": "", "superc...
85692970_89
class NativeServerStart implements ServerStart { @Override public final void acceptNextClient() throws ClientConnectionFailedException { final Logging logging = loggingValue.get(); logging.debug("Accepting next client."); logging.trace("Checking ConnectorCore value .."); logging.trace("Requesting next Client...
// Arrange doThrow(ClientConnectionFailedException.class).when(connectorCore).handleNext(); serverStart.launch(); // Act serverStart.acceptNextClient(); // Assert fail(); } }
[FOCAL] @Override public final void NativeServerStart.acceptNextClient() [CLASS] class NativeServerStart implements ServerStart [METRICS] loc=9 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] loggingValue.get/0, Logging.debug/1, Logging.trace/1, connectorCoreValue.get().handleNext/0, connectorCore...
/* static context [FOCAL] @Override public final void NativeServerStart.acceptNextClient() [COLLABORATORS] field loggingValue get/0; field connectorCoreValue get/0 [EXCEPTIONS] declares ClientConnectionFailedException [CALLS-EXTERNAL] loggingValue.get/0, Logging.debug/1, Logging.trace/1, connectorCoreValue.get().handle...
/* static context [FOCAL] @Override public final void NativeServerStart.acceptNextClient() [COLLABORATORS] field loggingValue get/0; field connectorCoreValue get/0 [EXCEPTIONS] declares ClientConnectionFailedException [CALLS-EXTERNAL] loggingValue.get/0, Logging.debug/1, Logging.trace/1, connectorCoreValue.get().handle...
true
ok
{"focal": {"class": "NativeServerStart", "name": "acceptNextClient", "signature": "void acceptNextClient() throws ClientConnectionFailedException", "start_line": 3, "modifiers": "@Override public final", "params": [], "return_type": "void"}, "class_info": {"name": "NativeServerStart", "kind": "class", "modifiers": "", ...
85710339_5
class ExpandableGroup extends NestedGroup { public Group getGroup(int position) { if (position == 0) { return parent; } else { return children.get(position - 1); } } public ExpandableGroup(Group expandableItem); @Override public void add(Group group); ...
ExpandableGroup expandableGroup = new ExpandableGroup(parent); Section section = new Section(); int sectionSize = 5; for (int i = 0; i < sectionSize; i++) { section.add(new DummyItem()); } expandableGroup.add(section); Item lastItem = new DummyItem(); ...
[FOCAL] public Group ExpandableGroup.getGroup(int position) [CLASS] class ExpandableGroup extends NestedGroup [METRICS] loc=7 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] children.get/1 [FIELDS] read=parent:DummyExpandableItem [PATH1] if(position == 0)=T -> return parent [PATH2] if(position == ...
/* static context [FOCAL] public Group ExpandableGroup.getGroup(int position) [PATH1] if(position == 0)=T -> return parent [PATH2] if(position == 0)=F -> return children.get(position - 1) [INPUTS] branches=position | result=position, parent [COLLABORATORS] field children get/1 [FIELDS] read=parent:DummyExpandableItem [...
/* static context [FOCAL] public Group ExpandableGroup.getGroup(int position) [PATH1] if(position == 0)=T -> return parent [PATH2] if(position == 0)=F -> return children.get(position - 1) [INPUTS] branches=position | result=position, parent [COLLABORATORS] field children get/1 [FIELDS] read=parent:DummyExpandableItem [...
true
ok
{"focal": {"class": "ExpandableGroup", "name": "getGroup", "signature": "Group getGroup(int position)", "start_line": 3, "modifiers": "public", "params": [{"name": "position", "type": "int"}], "return_type": "Group"}, "class_info": {"name": "ExpandableGroup", "kind": "class", "modifiers": "", "superclass": "NestedGroup...
85713388_0
class Table implements Iterable<TableRow> { public static <T> T[] parse(final Class<T> rowType, final String[] headerAndRows) { return parse(rowType, headerAndRows, new SpockitoValueConverter()); } private Table(); private Table(final String headerString); public int getColumnCount(); ...
//when final Row[] rows = Table.parse(Row.class, new String[] { "| index | listOfInteger | emptyString |", "| 0 | [1;2;3;4;5;6] | |", "| 1 | [9;8;7;6;5;4] | '' |" }); //then assertEquals(2, rows.length,...
[FOCAL] public static T[] Table.parse(Class<T> rowType, String[] headerAndRows) [CLASS] class Table implements Iterable<TableRow> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] T[] parse(Class<T> rowType, String[] headerAndRows, ValueConverter valueConverter) [NEW] SpockitoValueCo...
/* static context [FOCAL] public static T[] Table.parse(Class<T> rowType, String[] headerAndRows) [INPUTS] branches=- | result=headerAndRows, rowType [CALLS-INTERNAL] T[] parse(Class<T> rowType, String[] headerAndRows, ValueConverter valueConverter) [NEW] SpockitoValueConverter */
/* static context [FOCAL] public static T[] Table.parse(Class<T> rowType, String[] headerAndRows) [INPUTS] branches=- | result=headerAndRows, rowType [CALLS-INTERNAL] T[] parse(Class<T> rowType, String[] headerAndRows, ValueConverter valueConverter) [NEW] SpockitoValueConverter */ class Table implements Iterable<TableR...
true
ok
{"focal": {"class": "Table", "name": "parse", "signature": "T[] parse(Class<T> rowType, String[] headerAndRows)", "start_line": 3, "modifiers": "public static", "params": [{"name": "rowType", "type": "Class<T>"}, {"name": "headerAndRows", "type": "String[]"}], "return_type": "T[]"}, "class_info": {"name": "Table", "kin...
85780482_11
class SimpleUploadDataStore implements UploadDataStore { @SuppressLint("CommitPrefEdits") @NonNull @Override public Observable<Job> update(@NonNull Status status) { return get(status.id()) .filter(job -> !Job.isInvalid(job)) .flatMap(job -> save(job.withStatus(st...
final Job test = createTestJob(); final String json = gson.toJson(test); final String key = SimpleUploadDataStore.jobIdKey(test.id()); final Set<String> keys = new HashSet<>(); keys.add(key); final SharedPreferences.Editor editor = sharedPreferences.edit(); edito...
[FOCAL] @SuppressLint("CommitPrefEdits") @NonNull @Override public Observable<Job> SimpleUploadDataStore.update(Status status) [CLASS] class SimpleUploadDataStore implements UploadDataStore [METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Observable<Job> get(String jobId); Observabl...
/* static context [FOCAL] @SuppressLint("CommitPrefEdits") @NonNull @Override public Observable<Job> SimpleUploadDataStore.update(Status status) [INPUTS] branches=- | result=status [COLLABORATORS] param status:Status id/0; field job withStatus/1 [CALLS-INTERNAL] Observable<Job> get(String jobId); Observable<Job> save(J...
/* static context [FOCAL] @SuppressLint("CommitPrefEdits") @NonNull @Override public Observable<Job> SimpleUploadDataStore.update(Status status) [INPUTS] branches=- | result=status [COLLABORATORS] param status:Status id/0; field job withStatus/1 [CALLS-INTERNAL] Observable<Job> get(String jobId); Observable<Job> save(J...
true
ok
{"focal": {"class": "SimpleUploadDataStore", "name": "update", "signature": "Observable<Job> update(Status status)", "start_line": 3, "modifiers": "@SuppressLint(\"CommitPrefEdits\") @NonNull @Override public", "params": [{"name": "status", "type": "Status"}], "return_type": "Observable<Job>"}, "class_info": {"name": "...
85830116_8
class DynamicInvokeEventAdaptor implements Function<NewtonEvent, Boolean>, Consumer<NewtonEvent> { @Override public void accept(NewtonEvent event) { apply(event); } public DynamicInvokeEventAdaptor(Object target, Class<? extends Annotation> annotation); @Override public Boolean apply(New...
Handler handler = new Handler(); new DynamicInvokeEventAdaptor(handler, EventHandler.class).accept(new Event1()); assertTrue(handler.event instanceof Event1); } }
[FOCAL] @Override public void DynamicInvokeEventAdaptor.accept(NewtonEvent event) [CLASS] class DynamicInvokeEventAdaptor implements Function<NewtonEvent, Boolean>, Consumer<NewtonEvent> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] Boolean apply(NewtonEvent event) [DATAFLOW] eve...
/* static context [FOCAL] @Override public void DynamicInvokeEventAdaptor.accept(NewtonEvent event) [CALLS-INTERNAL] Boolean apply(NewtonEvent event) */
/* static context [FOCAL] @Override public void DynamicInvokeEventAdaptor.accept(NewtonEvent event) [CALLS-INTERNAL] Boolean apply(NewtonEvent event) */ class DynamicInvokeEventAdaptor implements Function<NewtonEvent, Boolean>, Consumer<NewtonEvent> { @Override public void accept(NewtonEvent event) { a...
true
ok
{"focal": {"class": "DynamicInvokeEventAdaptor", "name": "accept", "signature": "void accept(NewtonEvent event)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "event", "type": "NewtonEvent"}], "return_type": "void"}, "class_info": {"name": "DynamicInvokeEventAdaptor", "kind": "class", "modifier...
85838297_0
class Signatures { public static String sign(String urlString, String algorithm, String secretKey) { if (algorithm != null && !algorithm.equals(HMAC_SHA256_ALGORITHM)) { throw new RuntimeException("Unsupported signature: " + algorithm); } if (secretKey == null) { thr...
String secretKey = "1234567890"; String requestUrl = "http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&AssociateTag=mytag-20&Operation=ItemLookup&ItemId=0679722769&ResponseGroup=Images,ItemAttributes,Offers,Reviews&Version=2013-08-01&Timestamp=2014-...
[FOCAL] public static String Signatures.sign(String urlString, String algorithm, String secretKey) [CLASS] class Signatures [METRICS] loc=39 cc=6 branches=3 loops=1 returns=1 throws=3 nesting=1 [CALLS-INTERNAL] String canonicalize(SortedMap<String, String> sortedParamMap); String hmac(Mac mac, String stringToSign); Str...
/* static context [FOCAL] public static String Signatures.sign(String urlString, String algorithm, String secretKey) [THROWS-WHEN] RuntimeException when algorithm != null && !algorithm.equals(HMAC_SHA256_ALGORITHM) [THROWS-WHEN] RuntimeException when !(algorithm != null && !algorithm.equals(HMAC_SHA256_ALGORITHM)) && s...
/* static context [FOCAL] public static String Signatures.sign(String urlString, String algorithm, String secretKey) [THROWS-WHEN] RuntimeException when algorithm != null && !algorithm.equals(HMAC_SHA256_ALGORITHM) [THROWS-WHEN] RuntimeException when !(algorithm != null && !algorithm.equals(HMAC_SHA256_ALGORITHM)) && s...
true
ok
{"focal": {"class": "Signatures", "name": "sign", "signature": "String sign(String urlString, String algorithm, String secretKey)", "start_line": 3, "modifiers": "public static", "params": [{"name": "urlString", "type": "String"}, {"name": "algorithm", "type": "String"}, {"name": "secretKey", "type": "String"}], "retur...
85860202_0
class NowPlayingPresenterImpl implements NowPlayingPresenter, NowPlayingResponseModel { @Override public void infoLoaded(List<MovieInfo> movieInfoList) { /* Note - translate internal business logic to presenter logic */ List<MovieViewInfo> movieViewInfoList = new ArrayList<>();...
// //Arrange // NowPlayingPresenterImpl nowPlayingPresenter = new NowPlayingPresenterImpl(mockNowPlayingViewModel, mockNowPlayingInteractor); List<MovieInfo> movieInfoList = new ArrayList<>(); movieInfoList.add(movieInfo); ArgumentCaptor<List<Mov...
[FOCAL] @Override public void NowPlayingPresenterImpl.infoLoaded(List<MovieInfo> movieInfoList) [CLASS] class NowPlayingPresenterImpl implements NowPlayingPresenter, NowPlayingResponseModel [METRICS] loc=12 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] List<MovieViewInfo>.add/1, nowPlayingViewMo...
/* static context [FOCAL] @Override public void NowPlayingPresenterImpl.infoLoaded(List<MovieInfo> movieInfoList) [PATH1] foreach(MovieInfo movieInfo : movieInfoList)=T -> exit loop [PATH2] foreach(MovieInfo movieInfo : movieInfoList)=F [INPUTS] branches=movieInfoList | result=- [COLLABORATORS] field nowPlayingViewMode...
/* static context [FOCAL] @Override public void NowPlayingPresenterImpl.infoLoaded(List<MovieInfo> movieInfoList) [PATH1] foreach(MovieInfo movieInfo : movieInfoList)=T -> exit loop [PATH2] foreach(MovieInfo movieInfo : movieInfoList)=F [INPUTS] branches=movieInfoList | result=- [COLLABORATORS] field nowPlayingViewMode...
true
ok
{"focal": {"class": "NowPlayingPresenterImpl", "name": "infoLoaded", "signature": "void infoLoaded(List<MovieInfo> movieInfoList)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "movieInfoList", "type": "List<MovieInfo>"}], "return_type": "void"}, "class_info": {"name": "NowPlayingPresenterImpl"...
85880302_5
class AppServerConfig implements ServerConfig { @Override public MetricsListener metricsListener() { return guiceValues.metricsListener; } protected AppServerConfig(Config appConfig, PropertiesRegistrationGuiceModule propertiesRegistrationGuiceModule); public AppServerConfig(Config appCo...
// given Config configNoReporters = TypesafeConfigUtil.loadConfigForAppIdAndEnvironment(APP_ID, "compiletimetest") .withValue("metrics.slf4j.reporting.enabled", ConfigValueFactory.fromAnyRef(false)) .withValue("metrics.graphite.repo...
[FOCAL] @Override public MetricsListener AppServerConfig.metricsListener() [CLASS] class AppServerConfig implements ServerConfig [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] AppServerConfig(Config appConfig, PropertiesRegistrationGuiceModule propertiesRegistrationGuiceModule); Ap...
/* static context [FOCAL] @Override public MetricsListener AppServerConfig.metricsListener() */
/* static context [FOCAL] @Override public MetricsListener AppServerConfig.metricsListener() */ class AppServerConfig implements ServerConfig { @Override public MetricsListener metricsListener() { return guiceValues.metricsListener; } protected AppServerConfig(Config appConfig, PropertiesRegi...
true
ok
{"focal": {"class": "AppServerConfig", "name": "metricsListener", "signature": "MetricsListener metricsListener()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "MetricsListener"}, "class_info": {"name": "AppServerConfig", "kind": "class", "modifiers": "", "superclass": null, "interfac...
85987914_7
class Cell implements Comparable<Cell>, Iterable<Cell> { public boolean withdraw(int requested) { int expectedCount = Math.min(requested / nominal, count); int expectedCash = expectedCount * nominal; boolean nextCellResult = true; if (requested != expectedCash) { nextCel...
Cell cell = new Cell(1, 100); Assert.assertFalse(cell.withdraw(101)); } }
[FOCAL] public boolean Cell.withdraw(int requested) [CLASS] class Cell implements Comparable<Cell>, Iterable<Cell> [METRICS] loc=13 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] Math.min/2, next.withdraw/1 [PATH1] if(requested != expectedCash)=T -> if(nextCellResult)=T -> return true [PATH2] if(...
/* static context [FOCAL] public boolean Cell.withdraw(int requested) [PATH1] if(requested != expectedCash)=T -> if(nextCellResult)=T -> return true [PATH2] if(requested != expectedCash)=F -> if(nextCellResult)=F -> return false [INPUTS] branches=requested | result=- [COLLABORATORS] field next withdraw/1 [CALLS-EXTERNA...
/* static context [FOCAL] public boolean Cell.withdraw(int requested) [PATH1] if(requested != expectedCash)=T -> if(nextCellResult)=T -> return true [PATH2] if(requested != expectedCash)=F -> if(nextCellResult)=F -> return false [INPUTS] branches=requested | result=- [COLLABORATORS] field next withdraw/1 [CALLS-EXTERNA...
true
ok
{"focal": {"class": "Cell", "name": "withdraw", "signature": "boolean withdraw(int requested)", "start_line": 3, "modifiers": "public", "params": [{"name": "requested", "type": "int"}], "return_type": "boolean"}, "class_info": {"name": "Cell", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Compara...
86001819_20
class GenbankSeqEntry extends SequenceEntry { public Long getOrgId() { return this.orgId; public Long getOrgId() { return this.orgId; } public Long getOrgId() { return this.orgId; GenbankSeqEntry(AbstractSequence sequence); public Long getOrgId() { return this.orgId; GenbankSeqEntry(AbstractSequence sequence, Map...
assertEquals("tests whether organism ids are extracted accurately", (Long) 4000000648L, proteinSeqEntries.get(0).getOrgId()); assertEquals("tests whether organism ids are extracted accurately", (Long) 4000002681L, proteinSeqEntries.get(1).getOrgId()); assertEquals("tests whether organism id...
[FOCAL] public Long GenbankSeqEntry.getOrgId() [CLASS] class GenbankSeqEntry extends SequenceEntry [METRICS] loc=1 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [FIELDS] read=orgId [CLASS-MEMBERS] GenbankSeqEntry(AbstractSequence sequence); GenbankSeqEntry(AbstractSequence sequence, Map<String, List<Qualifier>> ...
/* static context [FOCAL] public Long GenbankSeqEntry.getOrgId() [FIELDS] read=orgId */
/* static context [FOCAL] public Long GenbankSeqEntry.getOrgId() [FIELDS] read=orgId */ class GenbankSeqEntry extends SequenceEntry { public Long getOrgId() { return this.orgId; public Long getOrgId() { return this.orgId; } public Long getOrgId() { return this.orgId; GenbankSeqEntry(AbstractSequence sequence); publ...
true
ok
{"focal": {"class": "GenbankSeqEntry", "name": "getOrgId", "signature": "Long getOrgId()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "Long"}, "class_info": {"name": "GenbankSeqEntry", "kind": "class", "modifiers": "", "superclass": "SequenceEntry", "interfaces": null, "fields": [{"name": "pro...
86105877_10
class AfterExecuteDmlEvent extends ExecuteDmlEvent { @Override public int hashCode() { return Objects.hash(getStatement().hashCode(), getNumberOfRowsAffected()); } public AfterExecuteDmlEvent(Statement statement, long numberOfRowsAffected); public long getNumberOfRowsAffected(); @Override public boolean equ...
AfterExecuteDmlEvent afterExecuteDmlEventa1 = new AfterExecuteDmlEvent(Statement.of("a"), 1L); AfterExecuteDmlEvent afterExecuteDmlEventa1x = new AfterExecuteDmlEvent(Statement.of("a"), 1L); AfterExecuteDmlEvent afterExecuteDmlEventa2 = new AfterExecuteDmlEvent(Statement.of("a"), 2L); AfterExecuteDmlEvent aft...
[FOCAL] @Override public int AfterExecuteDmlEvent.hashCode() [CLASS] class AfterExecuteDmlEvent extends ExecuteDmlEvent [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] long getNumberOfRowsAffected() [CALLS-EXTERNAL] Objects.hash/2, getStatement().hashCode/0, getStatement/0 (inherit...
/* static context [FOCAL] @Override public int AfterExecuteDmlEvent.hashCode() [CALLS-INTERNAL] long getNumberOfRowsAffected() [CALLS-EXTERNAL] Objects.hash/2, getStatement().hashCode/0, getStatement/0 (inherited) */
/* static context [FOCAL] @Override public int AfterExecuteDmlEvent.hashCode() [CALLS-INTERNAL] long getNumberOfRowsAffected() [CALLS-EXTERNAL] Objects.hash/2, getStatement().hashCode/0, getStatement/0 (inherited) */ class AfterExecuteDmlEvent extends ExecuteDmlEvent { @Override public int hashCode() { return Obje...
true
ok
{"focal": {"class": "AfterExecuteDmlEvent", "name": "hashCode", "signature": "int hashCode()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "AfterExecuteDmlEvent", "kind": "class", "modifiers": "", "superclass": "ExecuteDmlEvent", "interfaces": null, "fie...
86106666_1
class HttpHeadersInjectAdapter implements TextMap { @Override public void put(String key, String value) { Collection<String> values = headers.get(key); if (values == null) { values = new ArrayList<>(1); headers.put(key, values); } try { value...
Map<String, Collection<String>> headers = new HashMap<>(); headers.put("x-header", Collections.unmodifiableList(Arrays.asList("123:123:123:1"))); HttpHeadersInjectAdapter adapter = new HttpHeadersInjectAdapter(headers); adapter.put("x-header", "123:456:456:1"); assertEquals(hea...
[FOCAL] @Override public void HttpHeadersInjectAdapter.put(String key, String value) [CLASS] class HttpHeadersInjectAdapter implements TextMap [METRICS] loc=26 cc=5 branches=3 loops=0 returns=0 throws=1 nesting=3 [CALLS-EXTERNAL] headers.get/1, headers.put/2, Collection<String>.add/1, List<String>.add/1, Set<String>.ad...
/* static context [FOCAL] @Override public void HttpHeadersInjectAdapter.put(String key, String value) [THROWS-WHEN] ex when values == null && try-body throws && !(values instanceof List) && !(values instanceof Set) [THROWS-WHEN] ex when !(values == null) && try-body throws && !(values instanceof List) && !(values inst...
/* static context [FOCAL] @Override public void HttpHeadersInjectAdapter.put(String key, String value) [THROWS-WHEN] ex when values == null && try-body throws && !(values instanceof List) && !(values instanceof Set) [THROWS-WHEN] ex when !(values == null) && try-body throws && !(values instanceof List) && !(values inst...
true
ok
{"focal": {"class": "HttpHeadersInjectAdapter", "name": "put", "signature": "void put(String key, String value)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "key", "type": "String"}, {"name": "value", "type": "String"}], "return_type": "void"}, "class_info": {"name": "HttpHeadersInjectAdapter...
86107810_13
class CpcFileServiceImpl implements CpcFileService { @Override public InputStreamResource getFileById(String fileId) { Metadata metadata = getMetadataById(fileId); if (isAnUnprocessedCpcFile(metadata)) { return new InputStreamResource(storageService.getFileByLocationId(metadata.getSubmissionLocator())); } ...
when(dbService.getMetadataById(anyString())).thenReturn(buildFakeMetadata(true, false, false)); when(storageService.getFileByLocationId("test")).thenReturn(new ByteArrayInputStream("1337".getBytes())); InputStreamResource outcome = objectUnderTest.getFileById("test"); verify(dbService, times(1)).getMetadataBy...
[FOCAL] @Override public InputStreamResource CpcFileServiceImpl.getFileById(String fileId) [CLASS] class CpcFileServiceImpl implements CpcFileService [METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] Metadata getMetadataById(String fileId); boolean isAnUnprocessedCpcFile(Metadata met...
/* static context [FOCAL] @Override public InputStreamResource CpcFileServiceImpl.getFileById(String fileId) [THROWS-WHEN] NoFileInDatabaseException when !isAnUnprocessedCpcFile(metadata) [PATH1] if(isAnUnprocessedCpcFile(metadata))=T -> return new InputStreamResource(storageService.getFileByLocationId(metadata... [PAT...
/* static context [FOCAL] @Override public InputStreamResource CpcFileServiceImpl.getFileById(String fileId) [THROWS-WHEN] NoFileInDatabaseException when !isAnUnprocessedCpcFile(metadata) [PATH1] if(isAnUnprocessedCpcFile(metadata))=T -> return new InputStreamResource(storageService.getFileByLocationId(metadata... [PAT...
true
ok
{"focal": {"class": "CpcFileServiceImpl", "name": "getFileById", "signature": "InputStreamResource getFileById(String fileId)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "fileId", "type": "String"}], "return_type": "InputStreamResource"}, "class_info": {"name": "CpcFileServiceImpl", "kind": ...
86108100_8
class IDLTools { public static boolean epsilonEqualsByteSequence(IDLSequence.Byte a, IDLSequence.Byte b, double epsilon) { return epsilonEqualsPrimitiveSequence(a::get, b::get, a, b, epsilon); } public static boolean equals(StringBuilder a, StringBuilder b); public static boolean epsilonEquals(do...
Byte a; Byte b; a = new Byte(10, "type_9"); b = new Byte(10, "type_9"); assertTrue("Sequences not equal", IDLTools.epsilonEqualsByteSequence(a, b, 0.0)); a = new Byte(5, "type_9"); b = new Byte(10, "type_9"); assertTrue("Sequences not equal", IDLTools.epsilonEqualsByteS...
[FOCAL] public static boolean IDLTools.epsilonEqualsByteSequence(IDLSequence.Byte a, IDLSequence.Byte b, double epsilon) [CLASS] class IDLTools [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] boolean epsilonEqualsPrimitiveSequence(DoubleProvider providerA, DoubleProvider providerB,...
/* static context [FOCAL] public static boolean IDLTools.epsilonEqualsByteSequence(IDLSequence.Byte a, IDLSequence.Byte b, double epsilon) [INPUTS] branches=- | result=a, b, epsilon [CALLS-INTERNAL] boolean epsilonEqualsPrimitiveSequence(DoubleProvider providerA, DoubleProvider providerB, IDLSequence a, IDLSequence b, ...
/* static context [FOCAL] public static boolean IDLTools.epsilonEqualsByteSequence(IDLSequence.Byte a, IDLSequence.Byte b, double epsilon) [INPUTS] branches=- | result=a, b, epsilon [CALLS-INTERNAL] boolean epsilonEqualsPrimitiveSequence(DoubleProvider providerA, DoubleProvider providerB, IDLSequence a, IDLSequence b, ...
true
ok
{"focal": {"class": "IDLTools", "name": "epsilonEqualsByteSequence", "signature": "boolean epsilonEqualsByteSequence(IDLSequence.Byte a, IDLSequence.Byte b, double epsilon)", "start_line": 3, "modifiers": "public static", "params": [{"name": "a", "type": "IDLSequence.Byte"}, {"name": "b", "type": "IDLSequence.Byte"}, {...
86205415_42
class TimeWheel { public boolean add(String id, Callable<?> func, Duration delay) { if (Objects.isNull(delay)) { log.warn("delay is null: id={}", id); return false; } if (Objects.isNull(func)) { log.warn("func is null: id={}", id); return false; } if (cacheTasks.containsK...
boolean result = timeWheel.add("id", () -> null, Duration.ofMillis(10000)); Assert.assertTrue(result); } }
[FOCAL] public boolean TimeWheel.add(String id, Callable<?> func, Duration delay) [CLASS] class TimeWheel [METRICS] loc=21 cc=5 branches=4 loops=0 returns=4 throws=0 nesting=1 [CALLS-INTERNAL] boolean insertWheel(String id, Duration delay) [CALLS-EXTERNAL] Objects.isNull/1, log.warn/2, cacheTasks.containsKey/1, log.war...
/* static context [FOCAL] public boolean TimeWheel.add(String id, Callable<?> func, Duration delay) [PATH1] if(Objects.isNull(delay))=F -> if(Objects.isNull(func))=F -> if(cacheTasks.containsKey(id))=F -> if(result)=T -> return result [PATH2] if(Objects.isNull(delay))=T -> return false [PATH3] if(Objects.isNull(delay))...
/* static context [FOCAL] public boolean TimeWheel.add(String id, Callable<?> func, Duration delay) [PATH1] if(Objects.isNull(delay))=F -> if(Objects.isNull(func))=F -> if(cacheTasks.containsKey(id))=F -> if(result)=T -> return result [PATH2] if(Objects.isNull(delay))=T -> return false [PATH3] if(Objects.isNull(delay))...
true
ok
{"focal": {"class": "TimeWheel", "name": "add", "signature": "boolean add(String id, Callable<?> func, Duration delay)", "start_line": 3, "modifiers": "public", "params": [{"name": "id", "type": "String"}, {"name": "func", "type": "Callable<?>"}, {"name": "delay", "type": "Duration"}], "return_type": "boolean"}, "class...
86230857_2
class SpeakerController { @DeleteMapping("/{id}") public ResponseEntity deleteSpeaker(@PathVariable long id) { speakerRepository.delete(id); return ResponseEntity.noContent().build(); } @GetMapping(path = "/{id}") public ResponseEntity<SpeakerResource> getSpeaker(@PathVariable long id)...
//Given Speaker speakerToDelete = given.speaker("TO_DELETE").company("COMPANY").save(); //When ResultActions actions = mockMvc.perform(RestDocumentationRequestBuilders.delete("/speakers/{id}", speakerToDelete.getId())) .andDo(print()); //Then actions.and...
[FOCAL] @DeleteMapping("/{id}") public ResponseEntity SpeakerController.deleteSpeaker(long id) [CLASS] class SpeakerController [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] SpeakerRepository.delete/1, ResponseEntity.noContent().build/0, ResponseEntity.noContent/0 [FIELDS] read=sp...
/* static context [FOCAL] @DeleteMapping("/{id}") public ResponseEntity SpeakerController.deleteSpeaker(long id) [COLLABORATORS] field speakerRepository:SpeakerRepository delete/1 [FIELDS] read=speakerRepository:SpeakerRepository [CALLS-EXTERNAL] SpeakerRepository.delete/1, ResponseEntity.noContent().build/0, ResponseE...
/* static context [FOCAL] @DeleteMapping("/{id}") public ResponseEntity SpeakerController.deleteSpeaker(long id) [COLLABORATORS] field speakerRepository:SpeakerRepository delete/1 [FIELDS] read=speakerRepository:SpeakerRepository [CALLS-EXTERNAL] SpeakerRepository.delete/1, ResponseEntity.noContent().build/0, ResponseE...
true
ok
{"focal": {"class": "SpeakerController", "name": "deleteSpeaker", "signature": "ResponseEntity deleteSpeaker(long id)", "start_line": 3, "modifiers": "@DeleteMapping(\"/{id}\") public", "params": [{"name": "id", "type": "long"}], "return_type": "ResponseEntity"}, "class_info": {"name": "SpeakerController", "kind": "cla...
86269383_2
class Tag { public int getEndIndex() { return mEndIndex; } private Tag(final Builder builder); public String getWord(); public int getStartIndex(); private static final String TEST_WORD; private static final int TEST_START_INDEX; private static final int TEST_END_INDEX; ...
// Given // When // Then assertEquals(TEST_END_INDEX, mTag.getEndIndex()); } }
[FOCAL] public int Tag.getEndIndex() [CLASS] class Tag [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Tag(Builder builder); String getWord(); int getStartIndex() [TEST] TagTest: @Test public void should_create_tag_with_given_end_index() [TEST-FIELDS] String TEST_WORD, int TEST_STAR...
/* static context [FOCAL] public int Tag.getEndIndex() */
/* static context [FOCAL] public int Tag.getEndIndex() */ class Tag { public int getEndIndex() { return mEndIndex; } private Tag(final Builder builder); public String getWord(); public int getStartIndex(); private static final String TEST_WORD; private static final int TEST_STAR...
true
ok
{"focal": {"class": "Tag", "name": "getEndIndex", "signature": "int getEndIndex()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "Tag", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "TEST_WORD", "type": "String", "mod...
86278665_1
class KubeHelper extends MultiInstProcessor { public static KubeOpt inst(String instanceId) { return multiInst("KUBE", instanceId); } public static void init(String instanceId, Logger log, String base64KubeConfig); } class KubeHelperTest extends MultiInstProcessor { @Test public void te...
KubeHelper.inst("").delete("ns-test", KubeRES.NAME_SPACE); Assert.assertFalse(KubeHelper.inst("").exist("ns-test", KubeRES.NAME_SPACE)); KubeHelper.inst("").create($.file.readAllByClassPath("ns-test.yaml", "UTF-8")); Assert.assertTrue(KubeHelper.inst("").exist("ns-test", KubeRES.NAME_SP...
[FOCAL] public static KubeOpt KubeHelper.inst(String instanceId) [CLASS] class KubeHelper extends MultiInstProcessor [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] multiInst/2 (inherited) [INPUTS] branches=- | result=instanceId [DATAFLOW] instanceId@param->L2 [CLASS-MEMBERS] void ...
/* static context [FOCAL] public static KubeOpt KubeHelper.inst(String instanceId) [INPUTS] branches=- | result=instanceId [CALLS-EXTERNAL] multiInst/2 (inherited) */
/* static context [FOCAL] public static KubeOpt KubeHelper.inst(String instanceId) [INPUTS] branches=- | result=instanceId [CALLS-EXTERNAL] multiInst/2 (inherited) */ class KubeHelper extends MultiInstProcessor { public static KubeOpt inst(String instanceId) { return multiInst("KUBE", instanceId); } ...
true
ok
{"focal": {"class": "KubeHelper", "name": "inst", "signature": "KubeOpt inst(String instanceId)", "start_line": 3, "modifiers": "public static", "params": [{"name": "instanceId", "type": "String"}], "return_type": "KubeOpt"}, "class_info": {"name": "KubeHelper", "kind": "class", "modifiers": "", "superclass": "MultiIns...
86291168_20
class SqlTaskSubmitter { protected final <R> void submitSqlStatementTask( CheckedSqlFunction<? super Statement, ? extends R> function, BiConsumer<? super R, ? super Throwable> callback ) { submit(new SqlStatementTask<>(function, wrapCallback(callback))); } protected fin...
addStages(submitter.submitSqlStatementTask(statement -> callCounter.addAndGet(1))); assertThat(callCounter.get(), is(3)); } }
[FOCAL] protected final void SqlTaskSubmitter.submitSqlStatementTask(CheckedSqlFunction<? super Statement, ? extends R> function, BiConsumer<? super R, ? super Throwable> callback) [CLASS] class SqlTaskSubmitter [METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] BiConsumer<? super R, ...
/* static context [FOCAL] protected final void SqlTaskSubmitter.submitSqlStatementTask(CheckedSqlFunction<? super Statement, ? extends R> function, BiConsumer<? super R, ? super Throwable> callback) [CALLS-INTERNAL] BiConsumer<? super R, ? super Throwable> wrapCallback(BiConsumer<? super R, ? super Throwable> callback)...
/* static context [FOCAL] protected final void SqlTaskSubmitter.submitSqlStatementTask(CheckedSqlFunction<? super Statement, ? extends R> function, BiConsumer<? super R, ? super Throwable> callback) [CALLS-INTERNAL] BiConsumer<? super R, ? super Throwable> wrapCallback(BiConsumer<? super R, ? super Throwable> callback)...
true
ok
{"focal": {"class": "SqlTaskSubmitter", "name": "submitSqlStatementTask", "signature": "void submitSqlStatementTask(CheckedSqlFunction<? super Statement, ? extends R> function, BiConsumer<? super R, ? super Throwable> callback)", "start_line": 3, "modifiers": "protected final", "params": [{"name": "function", "type": "...
86325095_0
class OptimisticAlexandriaMarkupClient { public AppInfo getAbout() { return unwrap(delegate.getAbout()); } public OptimisticAlexandriaMarkupClient(final URI alexandriaURI); public OptimisticAlexandriaMarkupClient(final String alexandriaURI); public OptimisticAlexandriaMarkupClient(final URI alexandri...
AppInfo about = client.getAbout(); assertThat(about.getVersion()).isNotEmpty(); } }
[FOCAL] public AppInfo OptimisticAlexandriaMarkupClient.getAbout() [CLASS] class OptimisticAlexandriaMarkupClient [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] T unwrap(RestResult<T> restResult) [CALLS-EXTERNAL] delegate.getAbout/0 [COLLABORATORS] field delegate getAbout/0 [CLASS...
/* static context [FOCAL] public AppInfo OptimisticAlexandriaMarkupClient.getAbout() [COLLABORATORS] field delegate getAbout/0 [CALLS-INTERNAL] T unwrap(RestResult<T> restResult) [CALLS-EXTERNAL] delegate.getAbout/0 */
/* static context [FOCAL] public AppInfo OptimisticAlexandriaMarkupClient.getAbout() [COLLABORATORS] field delegate getAbout/0 [CALLS-INTERNAL] T unwrap(RestResult<T> restResult) [CALLS-EXTERNAL] delegate.getAbout/0 */ class OptimisticAlexandriaMarkupClient { public AppInfo getAbout() { return unwrap(delegate.ge...
true
ok
{"focal": {"class": "OptimisticAlexandriaMarkupClient", "name": "getAbout", "signature": "AppInfo getAbout()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "AppInfo"}, "class_info": {"name": "OptimisticAlexandriaMarkupClient", "kind": "class", "modifiers": "", "superclass": null, "interfaces": n...
86331365_134
class Strings { public static String substr(String str, int start) { return StringUtils.substring(str, start); } private Strings(); public static Boolean isNullorEmpty(String string); public static int findString(String searchExpr, String exprIn); public static int findString(String ...
System.out.println("substr"); String str = "Juan Perez Benitez"; int start = 5; int charactersReturned = 5; String expResult = "Perez"; String result = Strings.substr(str, start, charactersReturned); assertEquals(expResult, result); start = 5; ...
[FOCAL] public static String Strings.substr(String str, int start) [CLASS] class Strings [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] StringUtils.substring/2 [INPUTS] branches=- | result=start, str [DATAFLOW] start@param->L2; str@param->L2 [CLASS-MEMBERS] Strings(); Boolean isNu...
/* static context [FOCAL] public static String Strings.substr(String str, int start) [INPUTS] branches=- | result=start, str [CALLS-EXTERNAL] StringUtils.substring/2 */
/* static context [FOCAL] public static String Strings.substr(String str, int start) [INPUTS] branches=- | result=start, str [CALLS-EXTERNAL] StringUtils.substring/2 */ class Strings { public static String substr(String str, int start) { return StringUtils.substring(str, start); } private Strings...
true
ok
{"focal": {"class": "Strings", "name": "substr", "signature": "String substr(String str, int start)", "start_line": 3, "modifiers": "public static", "params": [{"name": "str", "type": "String"}, {"name": "start", "type": "int"}], "return_type": "String"}, "class_info": {"name": "Strings", "kind": "class", "modifiers": ...
86339121_17
class ContinuousOplogFetcher implements OplogFetcher { @Override public OplogBatch fetch() throws StopReplicationException, RollbackReplicationException { if (state.isClosed()) { return FinishedOplogBatch.getInstance(); } try { return retrier.retry(() -> { try { if (state...
int oplogSize = 1000; List<OplogOperation> oplog = createInsertStream(this::createSimpleInsert) .limit(oplogSize) .collect(Collectors.toList()); oplogSupplier = () -> oplog; OplogOperation firstOp = oplog.get(0); ContinuousOplogFetcher fetcher = factory.createFetcher(firstOp.getHas...
[FOCAL] @Override public OplogBatch ContinuousOplogFetcher.fetch() [CLASS] class ContinuousOplogFetcher implements OplogFetcher [METRICS] loc=92 cc=7 branches=4 loops=0 returns=2 throws=4 nesting=4 [CALLS-INTERNAL] void close(); void postBatchChecks(MongoCursor<OplogOperation> cursor, List<OplogOperation> fetchedOps) [...
/* static context [FOCAL] @Override public OplogBatch ContinuousOplogFetcher.fetch() [THROWS-WHEN] StopReplicationException when !state.isClosed() && try-body throws [THROWS-WHEN] (StopReplicationException) cause when !state.isClosed() && try-body throws && cause != null && cause instanceof StopReplicationException [TH...
/* static context [FOCAL] @Override public OplogBatch ContinuousOplogFetcher.fetch() [THROWS-WHEN] StopReplicationException when !state.isClosed() && try-body throws [THROWS-WHEN] (StopReplicationException) cause when !state.isClosed() && try-body throws && cause != null && cause instanceof StopReplicationException [TH...
true
ok
{"focal": {"class": "ContinuousOplogFetcher", "name": "fetch", "signature": "OplogBatch fetch() throws StopReplicationException, RollbackReplicationException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "OplogBatch"}, "class_info": {"name": "ContinuousOplogFetcher", "kind": "class", ...
86369859_5
class ColliderUtils { public static boolean overlaping(float minA, float maxA, float minB, float maxB) { if (maxA < minA) { // swap values float a = maxA; maxA = minA; minA = a; } if (maxB < minB) { // swap values floa...
assertEquals("values arent overlaping, but method returns true.", false, ColliderUtils.overlaping(0, 1, 2, 3)); assertEquals("values arent overlaping, but method returns true.", false, ColliderUtils.overlaping(2, 3, 3.1f, 4)); assertEquals("values are overlaping, but method retur...
[FOCAL] public static boolean ColliderUtils.overlaping(float minA, float maxA, float minB, float maxB) [CLASS] class ColliderUtils [METRICS] loc=18 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=1 [PATH1] if(maxA < minA)=T -> if(maxB < minB)=T -> return minB <= maxA && minA <= maxB [PATH2] if(maxA < minA)=F -> if(m...
/* static context [FOCAL] public static boolean ColliderUtils.overlaping(float minA, float maxA, float minB, float maxB) [PATH1] if(maxA < minA)=T -> if(maxB < minB)=T -> return minB <= maxA && minA <= maxB [PATH2] if(maxA < minA)=F -> if(maxB < minB)=F -> return minB <= maxA && minA <= maxB [INPUTS] branches=maxA, max...
/* static context [FOCAL] public static boolean ColliderUtils.overlaping(float minA, float maxA, float minB, float maxB) [PATH1] if(maxA < minA)=T -> if(maxB < minB)=T -> return minB <= maxA && minA <= maxB [PATH2] if(maxA < minA)=F -> if(maxB < minB)=F -> return minB <= maxA && minA <= maxB [INPUTS] branches=maxA, max...
true
ok
{"focal": {"class": "ColliderUtils", "name": "overlaping", "signature": "boolean overlaping(float minA, float maxA, float minB, float maxB)", "start_line": 3, "modifiers": "public static", "params": [{"name": "minA", "type": "float"}, {"name": "maxA", "type": "float"}, {"name": "minB", "type": "float"}, {"name": "maxB"...
86398553_5
class Mockito { public static <T> When<T> when(T t){ return new When<T>(); } public static T mock(Class<T> t); @Mock private List mockList; } class MockitoTest { @Mock private List mockList; @Test public void testCallBack(){
when(mockList.get(Integer.MAX_VALUE)).thenAnswer(invocation -> { Object mock = invocation.getMock(); Object[] arguments = invocation.getArguments(); return new StringBuilder().append(mock).append(",").append(Arrays.asList(arguments)).toString(); }); System.ou...
[FOCAL] public static When<T> Mockito.when(T t) [CLASS] class Mockito [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] When<T> [INPUTS] branches=- | result=- | unused=t [CLASS-MEMBERS] T mock(Class<T> t) [TEST] MockitoTest: @Test public void testCallBack() [TEST-FIELDS] List mockList
/* static context [FOCAL] public static When<T> Mockito.when(T t) [INPUTS] branches=- | result=- | unused=t [NEW] When<T> */
/* static context [FOCAL] public static When<T> Mockito.when(T t) [INPUTS] branches=- | result=- | unused=t [NEW] When<T> */ class Mockito { public static <T> When<T> when(T t){ return new When<T>(); } public static T mock(Class<T> t); @Mock private List mockList; } class MockitoTest { ...
true
ok
{"focal": {"class": "Mockito", "name": "when", "signature": "When<T> when(T t)", "start_line": 3, "modifiers": "public static", "params": [{"name": "t", "type": "T"}], "return_type": "When<T>"}, "class_info": {"name": "Mockito", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name...
86400116_6
class AccessPointURI { public String getHosts() { return hosts; } AccessPointURI(String accessPointString); public String getAccessPointString(); public String getDriverType(); public String getAccountId(); public String getRegion(); private void validateAccessPointString(St...
AccessPointURI accessPointURI = new AccessPointURI(fullSchemaURI); assertThat(accessPointURI.getHosts()).isEqualTo("rocketmq.apache.org"); String multipleHostsURI = "oms:rocketmq://alice@rocketmq.apache.org,pulsar.apache.org:9091/us-east:default_space"; accessPointURI = new AccessPointU...
[FOCAL] public String AccessPointURI.getHosts() [CLASS] class AccessPointURI [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] AccessPointURI(String accessPointString); String getAccessPointString(); String getDriverType(); String getAccountId(); String getRegion(); void validateAcces...
/* static context [FOCAL] public String AccessPointURI.getHosts() */
/* static context [FOCAL] public String AccessPointURI.getHosts() */ class AccessPointURI { public String getHosts() { return hosts; } AccessPointURI(String accessPointString); public String getAccessPointString(); public String getDriverType(); public String getAccountId(); pub...
true
ok
{"focal": {"class": "AccessPointURI", "name": "getHosts", "signature": "String getHosts()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "AccessPointURI", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "fullSchemaUR...
86418271_0
class TwitterMessageProducer extends MessageProducerSupport { StatusListener getStatusListener() { return statusListener; } public TwitterMessageProducer(TwitterStream twitterStream, MessageChannel outputChannel); @Override protected void onInit(); @Override public void doStart(); @Override public v...
StatusListener statusListener = twitterMessageProducer.getStatusListener(); Status status = mock(Status.class); statusListener.onStatus(status); Message<?> statusMessage = outputChannel.receive(); assertSame(status, statusMessage.getPayload()); } }
[FOCAL] StatusListener TwitterMessageProducer.getStatusListener() [CLASS] class TwitterMessageProducer extends MessageProducerSupport [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] TwitterMessageProducer(TwitterStream twitterStream, MessageChannel outputChannel); void onInit(); voi...
/* static context [FOCAL] StatusListener TwitterMessageProducer.getStatusListener() */
/* static context [FOCAL] StatusListener TwitterMessageProducer.getStatusListener() */ class TwitterMessageProducer extends MessageProducerSupport { StatusListener getStatusListener() { return statusListener; } public TwitterMessageProducer(TwitterStream twitterStream, MessageChannel outputChannel); @Ov...
true
ok
{"focal": {"class": "TwitterMessageProducer", "name": "getStatusListener", "signature": "StatusListener getStatusListener()", "start_line": 3, "modifiers": "", "params": [], "return_type": "StatusListener"}, "class_info": {"name": "TwitterMessageProducer", "kind": "class", "modifiers": "", "superclass": "MessageProduce...
86422972_0
class EmailValidator { public static boolean isValidEmail(CharSequence email) { return email != null && EMAIL_PATTERN.matcher(email).matches(); } } class EmailValidatorTest { @Test public void isValidEmail() throws Exception {
assertThat(EmailValidator.isValidEmail("jaredsburrows@gmail.com")).isTrue(); } }
[FOCAL] public static boolean EmailValidator.isValidEmail(CharSequence email) [CLASS] class EmailValidator [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] EMAIL_PATTERN.matcher(email).matches/0, EMAIL_PATTERN.matcher/1 [INPUTS] branches=- | result=email [DATAFLOW] email@param->L2 [...
/* static context [FOCAL] public static boolean EmailValidator.isValidEmail(CharSequence email) [INPUTS] branches=- | result=email [CALLS-EXTERNAL] EMAIL_PATTERN.matcher(email).matches/0, EMAIL_PATTERN.matcher/1 */
/* static context [FOCAL] public static boolean EmailValidator.isValidEmail(CharSequence email) [INPUTS] branches=- | result=email [CALLS-EXTERNAL] EMAIL_PATTERN.matcher(email).matches/0, EMAIL_PATTERN.matcher/1 */ class EmailValidator { public static boolean isValidEmail(CharSequence email) { return email...
true
ok
{"focal": {"class": "EmailValidator", "name": "isValidEmail", "signature": "boolean isValidEmail(CharSequence email)", "start_line": 3, "modifiers": "public static", "params": [{"name": "email", "type": "CharSequence"}], "return_type": "boolean"}, "class_info": {"name": "EmailValidator", "kind": "class", "modifiers": "...
86461287_24
class JobServiceImpl implements JobService { @Override public long countNameDistinctly(long teamId) { return jobRepository.countNameDistinctly(teamId); } @Autowired public JobServiceImpl(JobRepository jobRepository); @Override public long countNameDistinctly(); @Autowired private JobRepository jobReposito...
assertEquals(0, jobService.countNameDistinctly()); TeamLampsDTO team = teamService.create(new TeamCreateDTO("Team 1")); LampDTO lampDTO = lampService.create(new LampCreateDTO("hueId", "Lampe 1", team.getId())); assertEquals(0, jobService.countNameDistinctly(team.getId())); LampUpdateDTO lampUpdateDTO...
[FOCAL] @Override public long JobServiceImpl.countNameDistinctly(long teamId) [CLASS] class JobServiceImpl implements JobService [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] JobRepository.countNameDistinctly/1 [FIELDS] read=jobRepository:JobRepository [INPUTS] branches=- | resul...
/* static context [FOCAL] @Override public long JobServiceImpl.countNameDistinctly(long teamId) [INPUTS] branches=- | result=teamId, jobRepository [COLLABORATORS] field jobRepository:JobRepository countNameDistinctly/1 [FIELDS] read=jobRepository:JobRepository [CALLS-EXTERNAL] JobRepository.countNameDistinctly/1 */
/* static context [FOCAL] @Override public long JobServiceImpl.countNameDistinctly(long teamId) [INPUTS] branches=- | result=teamId, jobRepository [COLLABORATORS] field jobRepository:JobRepository countNameDistinctly/1 [FIELDS] read=jobRepository:JobRepository [CALLS-EXTERNAL] JobRepository.countNameDistinctly/1 */ cla...
true
ok
{"focal": {"class": "JobServiceImpl", "name": "countNameDistinctly", "signature": "long countNameDistinctly(long teamId)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "teamId", "type": "long"}], "return_type": "long"}, "class_info": {"name": "JobServiceImpl", "kind": "class", "modifiers": "", ...
86607520_10
class MacroRemover extends EntryFilter { @Override public boolean test(Entry entry) { String entryName = entry.getName(); // Matches _VBA_PROJECT_CUR, VBA, ... :) if (!isMacro(entryName)) { return true; } LOGGER.info("Found Macros, removing them."); StringBuilder infos = new StringB...
Entry entry = mock(Entry.class); doReturn("_VBA_PROJECT_CUR").when(entry).getName(); assertFalse(instance.test(entry), "A macro entry should not be copied over"); BleachTestBase.assertThreatsFound(session, 1); reset(session); } }
[FOCAL] @Override public boolean MacroRemover.test(Entry entry) [CLASS] class MacroRemover extends EntryFilter [METRICS] loc=32 cc=4 branches=3 loops=0 returns=2 throws=0 nesting=2 [CALLS-INTERNAL] boolean isMacro(String entryName) [CALLS-EXTERNAL] Entry.getName/0, LOGGER.info/1, ((DirectoryEntry) entry).getEntryNames/...
/* static context [FOCAL] @Override public boolean MacroRemover.test(Entry entry) [PATH1] if(!isMacro(entryName))=F -> if(entry instanceof DirectoryEntry)=F -> if(entry instanceof DocumentEntry)=T -> return false [PATH2] if(!isMacro(entryName))=T -> return true [PATH3] if(!isMacro(entryName))=F -> if(entry instanceof D...
/* static context [FOCAL] @Override public boolean MacroRemover.test(Entry entry) [PATH1] if(!isMacro(entryName))=F -> if(entry instanceof DirectoryEntry)=F -> if(entry instanceof DocumentEntry)=T -> return false [PATH2] if(!isMacro(entryName))=T -> return true [PATH3] if(!isMacro(entryName))=F -> if(entry instanceof D...
true
ok
{"focal": {"class": "MacroRemover", "name": "test", "signature": "boolean test(Entry entry)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "entry", "type": "Entry"}], "return_type": "boolean"}, "class_info": {"name": "MacroRemover", "kind": "class", "modifiers": "", "superclass": "EntryFilter",...
86651310_0
class Altitude implements IWrappedInteger<Altitude>, Comparable<Altitude> { @Override public int compareTo(final Altitude that) { return Integer.compare(this.val, that.val); } public Altitude(final int val); @Override public int intValue(); @Override public boolean equals(final Object object); @Ov...
{ final Altitude a1 = new Altitude(0); final Altitude a2 = new Altitude(0); Assert.assertTrue(a1.compareTo(a2) == 0); } { final Altitude a1 = new Altitude(1); final Altitude a2 = new Altitude(2); Assert.assertTrue(a1.compareTo(a2) < 0); } { final Altitude ...
[FOCAL] @Override public int Altitude.compareTo(Altitude that) [CLASS] class Altitude implements IWrappedInteger<Altitude>, Comparable<Altitude> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Integer.compare/2 [FIELDS] read=val [INPUTS] branches=- | result=that [DATAFLOW] that@par...
/* static context [FOCAL] @Override public int Altitude.compareTo(Altitude that) [INPUTS] branches=- | result=that [FIELDS] read=val [CALLS-EXTERNAL] Integer.compare/2 */
/* static context [FOCAL] @Override public int Altitude.compareTo(Altitude that) [INPUTS] branches=- | result=that [FIELDS] read=val [CALLS-EXTERNAL] Integer.compare/2 */ class Altitude implements IWrappedInteger<Altitude>, Comparable<Altitude> { @Override public int compareTo(final Altitude that) { return Int...
true
ok
{"focal": {"class": "Altitude", "name": "compareTo", "signature": "int compareTo(Altitude that)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "that", "type": "Altitude"}], "return_type": "int"}, "class_info": {"name": "Altitude", "kind": "class", "modifiers": "", "superclass": null, "interface...
86653231_59
class FusionEngine extends LocationEngine implements LocationListener { @Override public Location getLastLocation() { final List<String> providers = locationManager.getAllProviders(); final long minTime = clock.getCurrentTimeInMillis() - RECENT_UPDATE_THRESHOLD_IN_MILLIS; Location bestLocation = null; ...
assertThat(fusionEngine.getLastLocation()).isNull(); } }
[FOCAL] @Override public Location FusionEngine.getLastLocation() [CLASS] class FusionEngine extends LocationEngine implements LocationListener [METRICS] loc=30 cc=6 branches=3 loops=1 returns=1 throws=0 nesting=5 [CALLS-EXTERNAL] LocationManager.getAllProviders/0, clock.getCurrentTimeInMillis/0, LocationManager.getLast...
/* static context [FOCAL] @Override public Location FusionEngine.getLastLocation() [PATH1] foreach(String provider : providers)=T -> if(location != null)=T -> if(time > minTime && accuracy < bestAccuracy)=F -> if(time < minTime && bestAccuracy == Float.MAX_VALUE && time > bestTime)=T -> exit loop -> return bestLocation...
/* static context [FOCAL] @Override public Location FusionEngine.getLastLocation() [PATH1] foreach(String provider : providers)=T -> if(location != null)=T -> if(time > minTime && accuracy < bestAccuracy)=F -> if(time < minTime && bestAccuracy == Float.MAX_VALUE && time > bestTime)=T -> exit loop -> return bestLocation...
true
ok
{"focal": {"class": "FusionEngine", "name": "getLastLocation", "signature": "Location getLastLocation()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Location"}, "class_info": {"name": "FusionEngine", "kind": "class", "modifiers": "", "superclass": "LocationEngine", "interfaces": "Lo...
86653876_0
class ResourceUtil { public static InputStream getResourceAsStream(String path) { if (StrUtil.startWithIgnoreCase(path, CLASSPATH_PRE)) { path = path.substring(CLASSPATH_PRE.length()); } return getClassLoader().getResourceAsStream(path); } public static String getAbsolutePath(String path); public static ...
InputStream resourceAsStream = ResourceUtil.getResourceAsStream("classpath:config/tio-quartz.properties"); Assert.assertNotNull(resourceAsStream); try { resourceAsStream.close(); } catch (IOException e) { //ignore } } }
[FOCAL] public static InputStream ResourceUtil.getResourceAsStream(String path) [CLASS] class ResourceUtil [METRICS] loc=6 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] ClassLoader getClassLoader() [CALLS-EXTERNAL] StrUtil.startWithIgnoreCase/2, String.substring/1, CLASSPATH_PRE.length/0, getCla...
/* static context [FOCAL] public static InputStream ResourceUtil.getResourceAsStream(String path) [PATH1] if(StrUtil.startWithIgnoreCase(path, CLASSPATH_PRE))=T -> return getClassLoader().getResourceAsStream(path) [PATH2] if(StrUtil.startWithIgnoreCase(path, CLASSPATH_PRE))=F -> return getClassLoader().getResourceAsStr...
/* static context [FOCAL] public static InputStream ResourceUtil.getResourceAsStream(String path) [PATH1] if(StrUtil.startWithIgnoreCase(path, CLASSPATH_PRE))=T -> return getClassLoader().getResourceAsStream(path) [PATH2] if(StrUtil.startWithIgnoreCase(path, CLASSPATH_PRE))=F -> return getClassLoader().getResourceAsStr...
true
ok
{"focal": {"class": "ResourceUtil", "name": "getResourceAsStream", "signature": "InputStream getResourceAsStream(String path)", "start_line": 3, "modifiers": "public static", "params": [{"name": "path", "type": "String"}], "return_type": "InputStream"}, "class_info": {"name": "ResourceUtil", "kind": "class", "modifiers...
86663812_36
class DiffUtils { public static <T> Patch<T> diff(List<T> original, List<T> revised, DiffAlgorithmListener progress) { return DiffUtils.diff(original, revised, new MyersDiff<>(), progress); } private DiffUtils(); public static Patch<T> diff(List<T> original, List<T> revised); public stat...
final Patch<String> patch = DiffUtils.diff(Arrays.asList("hhh"), Arrays. asList("hhh", "jjj", "kkk"), true); assertNotNull(patch); assertEquals(2, patch.getDeltas().size()); AbstractDelta<String> delta = patch.getDeltas().get(0); assertTrue(delta instanceof Equal...
[FOCAL] public static Patch<T> DiffUtils.diff(List<T> original, List<T> revised, DiffAlgorithmListener progress) [CLASS] class DiffUtils [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] DiffUtils.diff/4 [NEW] MyersDiff<> [INPUTS] branches=- | result=original, progress, revised [DATA...
/* static context [FOCAL] public static Patch<T> DiffUtils.diff(List<T> original, List<T> revised, DiffAlgorithmListener progress) [INPUTS] branches=- | result=original, progress, revised [NEW] MyersDiff<> [CALLS-EXTERNAL] DiffUtils.diff/4 */
/* static context [FOCAL] public static Patch<T> DiffUtils.diff(List<T> original, List<T> revised, DiffAlgorithmListener progress) [INPUTS] branches=- | result=original, progress, revised [NEW] MyersDiff<> [CALLS-EXTERNAL] DiffUtils.diff/4 */ class DiffUtils { public static <T> Patch<T> diff(List<T> original, List...
true
ok
{"focal": {"class": "DiffUtils", "name": "diff", "signature": "Patch<T> diff(List<T> original, List<T> revised, DiffAlgorithmListener progress)", "start_line": 3, "modifiers": "public static", "params": [{"name": "original", "type": "List<T>"}, {"name": "revised", "type": "List<T>"}, {"name": "progress", "type": "DiffA...
86707239_25
class Lex { @NonNull public static LexList list(@NonNull List<? extends CharSequence> items) { return list(items.toArray(new CharSequence[]{})); } public static void init(@NonNull Application app); public static void init(@NonNull Application app, @NonNull String openDelimiter, @NonNull St...
assertEquals("No items.", Lex.list(new CharSequence[]{}) .separator(", ") .twoItemSeparator(" and ") .lastItemSeparator(", and ") .emptyText("No items.") .make().toString()); } }
[FOCAL] @NonNull public static LexList Lex.list(List<? extends CharSequence> items) [CLASS] class Lex [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] LexList list(CharSequence... text) [CALLS-EXTERNAL] List<? extends CharSequence>.toArray/1 [INPUTS] branches=- | result=items [COLLA...
/* static context [FOCAL] @NonNull public static LexList Lex.list(List<? extends CharSequence> items) [INPUTS] branches=- | result=items [COLLABORATORS] param items:List<? extends CharSequence> toArray/1 [CALLS-INTERNAL] LexList list(CharSequence... text) [CALLS-EXTERNAL] List<? extends CharSequence>.toArray/1 */
/* static context [FOCAL] @NonNull public static LexList Lex.list(List<? extends CharSequence> items) [INPUTS] branches=- | result=items [COLLABORATORS] param items:List<? extends CharSequence> toArray/1 [CALLS-INTERNAL] LexList list(CharSequence... text) [CALLS-EXTERNAL] List<? extends CharSequence>.toArray/1 */ class...
true
ok
{"focal": {"class": "Lex", "name": "list", "signature": "LexList list(List<? extends CharSequence> items)", "start_line": 3, "modifiers": "@NonNull public static", "params": [{"name": "items", "type": "List<? extends CharSequence>"}], "return_type": "LexList"}, "class_info": {"name": "Lex", "kind": "class", "modifiers"...
86711482_3
class TokensReader { public Tokens read(final File file) throws Throwable { final Tokens tokens = new Tokens(); final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); final DocumentBuilder builder = factory.newDocumentBuilder(); final Document doc = builder.parse(new BOMInputStream(new F...
File file = temp.newFile("main", "results.xml"); FileUtils.copyURLToFile(getClass().getResource("/results/tokensSingle.xml"), file); Tokens tokens = sut.read(file); Assert.assertEquals(1, tokens.getTokens().size()); Assert.assertEquals(10, tokens.getComplexity()); Token token = tokens.getTokens().get(0); ...
[FOCAL] public Tokens TokensReader.read(File file) [CLASS] class TokensReader [METRICS] loc=31 cc=3 branches=0 loops=1 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] Node getChildByName(Node root, String name) [CALLS-EXTERNAL] DocumentBuilderFactory.newInstance/0, DocumentBuilderFactory.newDocumentBuilder/0, DocumentBui...
/* static context [FOCAL] public Tokens TokensReader.read(File file) [PATH1] for(i < list.getLength())=T -> try-body throws -> exit loop -> return tokens [PATH2] for(i < list.getLength())=F -> return tokens [INPUTS] branches=file | result=- [EXCEPTIONS] declares Throwable; catches Exception e [CALLS-INTERNAL] Node getC...
/* static context [FOCAL] public Tokens TokensReader.read(File file) [PATH1] for(i < list.getLength())=T -> try-body throws -> exit loop -> return tokens [PATH2] for(i < list.getLength())=F -> return tokens [INPUTS] branches=file | result=- [EXCEPTIONS] declares Throwable; catches Exception e [CALLS-INTERNAL] Node getC...
true
ok
{"focal": {"class": "TokensReader", "name": "read", "signature": "Tokens read(File file) throws Throwable", "start_line": 3, "modifiers": "public", "params": [{"name": "file", "type": "File"}], "return_type": "Tokens"}, "class_info": {"name": "TokensReader", "kind": "class", "modifiers": "", "superclass": null, "interf...
86808110_225
class ByQualifiedNameRegexMatcher implements CriteriaMatcher<Element, String> { @Override public boolean checkForMatchingCharacteristic(Element element, String toCheckFor) { if (element != null && toCheckFor != null) { String name = null; switch (element.getKind()) { ...
Element element = Mockito.mock(Element.class); Name nameOfElement = Mockito.mock(Name.class); Mockito.when(nameOfElement.toString()).thenReturn("XXX"); Mockito.when(element.getKind()).thenReturn(ElementKind.METHOD); Mockito.when(element.getSimpleName()).thenReturn(nameOfEleme...
[FOCAL] @Override public boolean ByQualifiedNameRegexMatcher.checkForMatchingCharacteristic(Element element, String toCheckFor) [CLASS] class ByQualifiedNameRegexMatcher implements CriteriaMatcher<Element, String> [METRICS] loc=31 cc=7 branches=2 loops=0 returns=2 throws=0 nesting=2 [CALLS-EXTERNAL] Element.getKind/0, ...
/* static context [FOCAL] @Override public boolean ByQualifiedNameRegexMatcher.checkForMatchingCharacteristic(Element element, String toCheckFor) [PATH1] if(element != null && toCheckFor != null)=T -> switch(element.getKind())=case CLASS -> return pattern.matcher(name).matches() [PATH2] if(element != null && toCheckFor...
/* static context [FOCAL] @Override public boolean ByQualifiedNameRegexMatcher.checkForMatchingCharacteristic(Element element, String toCheckFor) [PATH1] if(element != null && toCheckFor != null)=T -> switch(element.getKind())=case CLASS -> return pattern.matcher(name).matches() [PATH2] if(element != null && toCheckFor...
true
ok
{"focal": {"class": "ByQualifiedNameRegexMatcher", "name": "checkForMatchingCharacteristic", "signature": "boolean checkForMatchingCharacteristic(Element element, String toCheckFor)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "element", "type": "Element"}, {"name": "toCheckFor", "type": "Str...
86871676_13
class BookingServiceImpl implements BookingService { @Override public List<Booking> getBookingsByUser(String user) { try { List<BookingImpl> bookingImpls = bookingRepository.findByCustomerId(user); List<Booking> bookings = new ArrayList<Booking>(); for (Booking b : b...
when(bookingRepository.findByCustomerId(booking.getCustomerId())).thenReturn(singletonList(booking)); List<Booking> bookings = bookingService.getBookingsByUser(booking.getCustomerId()); assertThat(bookings, contains(booking)); } }
[FOCAL] @Override public List<Booking> BookingServiceImpl.getBookingsByUser(String user) [CLASS] class BookingServiceImpl implements BookingService [METRICS] loc=13 cc=3 branches=0 loops=1 returns=1 throws=1 nesting=2 [CALLS-EXTERNAL] BookingRepository.findByCustomerId/1, List<Booking>.add/1 [NEW] ArrayList<Booking>, R...
/* static context [FOCAL] @Override public List<Booking> BookingServiceImpl.getBookingsByUser(String user) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] foreach(Booking b : bookingImpls)=T -> exit loop -> return bookings [PATH2] try-body throws -> throw new RuntimeException(e) [PATH3] foreach(Booking b : ...
/* static context [FOCAL] @Override public List<Booking> BookingServiceImpl.getBookingsByUser(String user) [THROWS-WHEN] RuntimeException when try-body throws [PATH1] foreach(Booking b : bookingImpls)=T -> exit loop -> return bookings [PATH2] try-body throws -> throw new RuntimeException(e) [PATH3] foreach(Booking b : ...
true
ok
{"focal": {"class": "BookingServiceImpl", "name": "getBookingsByUser", "signature": "List<Booking> getBookingsByUser(String user)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "user", "type": "String"}], "return_type": "List<Booking>"}, "class_info": {"name": "BookingServiceImpl", "kind": "cla...
86918234_1
class Traceur { public static void enableLogging() { enableLogging(new TraceurConfig(true)); } private Traceur(); @SuppressWarnings({"unchecked", "rawtypes"}) public synchronized static void enableLogging(TraceurConfig config); public static synchronized void disableLogging(); public...
// Assumption - Shims are not filtered when filtering is disabled Traceur.enableLogging(new TraceurConfig(false)); try { StreamFactory.createNullPointerExceptionObservable().blockingFirst(); Assertions.failBecauseExceptionWasNotThrown(Throwable.class); } catch (Th...
[FOCAL] public static void Traceur.enableLogging() [CLASS] class Traceur [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-INTERNAL] void enableLogging(TraceurConfig config) [NEW] TraceurConfig [CLASS-MEMBERS] Traceur(); void enableLogging(TraceurConfig config); void disableLogging(); TraceurC...
/* static context [FOCAL] public static void Traceur.enableLogging() [CALLS-INTERNAL] void enableLogging(TraceurConfig config) [NEW] TraceurConfig */
/* static context [FOCAL] public static void Traceur.enableLogging() [CALLS-INTERNAL] void enableLogging(TraceurConfig config) [NEW] TraceurConfig */ class Traceur { public static void enableLogging() { enableLogging(new TraceurConfig(true)); } private Traceur(); @SuppressWarnings({"unchecke...
true
ok
{"focal": {"class": "Traceur", "name": "enableLogging", "signature": "void enableLogging()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "void"}, "class_info": {"name": "Traceur", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name":...
86987836_1
class DialogManagerImpl implements DialogManager { @Override public void dismissDialog(final int dialogId) { final Dialog dialog = mDialogInstances.get(dialogId); if (dialog != null) { dialog.dismiss(); mDialogInstances.remove(dialogId); mDialogConfigs.remove...
// setup the callback final DialogManagerCallback callback = createCallbackMock(); final Dialog dialogMock = createDialogMock(); when(callback.onCreateDialog(eq(KNOWN_DIALOG), isNull())).thenReturn(dialogMock); mDialogManager.setCallback(callback); mDialogManager.showDial...
[FOCAL] @Override public void DialogManagerImpl.dismissDialog(int dialogId) [CLASS] class DialogManagerImpl implements DialogManager [METRICS] loc=16 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] mDialogInstances.get/1, Dialog.dismiss/0, mDialogInstances.remove/1, mDialogConfigs.remove/1, mDialo...
/* static context [FOCAL] @Override public void DialogManagerImpl.dismissDialog(int dialogId) [PATH1] if(dialog != null)=T -> return [PATH2] if(dialog != null)=F -> if(dialogFragment != null)=T [PATH3] if(dialog != null)=F -> if(dialogFragment != null)=F [INPUTS] branches=dialogId | result=- [COLLABORATORS] field mDial...
/* static context [FOCAL] @Override public void DialogManagerImpl.dismissDialog(int dialogId) [PATH1] if(dialog != null)=T -> return [PATH2] if(dialog != null)=F -> if(dialogFragment != null)=T [PATH3] if(dialog != null)=F -> if(dialogFragment != null)=F [INPUTS] branches=dialogId | result=- [COLLABORATORS] field mDial...
true
ok
{"focal": {"class": "DialogManagerImpl", "name": "dismissDialog", "signature": "void dismissDialog(int dialogId)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "dialogId", "type": "int"}], "return_type": "void"}, "class_info": {"name": "DialogManagerImpl", "kind": "class", "modifiers": "", "sup...
87095183_2
class EmailCommandHandler { public EmailAggregate getByUUID(String uuid) { return EmailAggregate.from(uuid, eventSourcingService.getRelatedEvents(uuid)); } public EmailCommandHandler( EventSourcingService eventSourcingService, EventPublisher eventPublisher ); publ...
String uuid = "123"; Mockito.when(eventSourcingService.getAggregate(Mockito.anyString())) .thenReturn(new EventStream()); EmailAggregate byUUID = commandHandler.getByUUID(uuid); Assert.assertTrue(byUUID.getState().getEmail() == null); } }
[FOCAL] public EmailAggregate EmailCommandHandler.getByUUID(String uuid) [CLASS] class EmailCommandHandler [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] EmailAggregate.from/2, EventSourcingService.getRelatedEvents/1 [FIELDS] read=eventSourcingService:EventSourcingService [INPUTS]...
/* static context [FOCAL] public EmailAggregate EmailCommandHandler.getByUUID(String uuid) [INPUTS] branches=- | result=uuid, eventSourcingService [COLLABORATORS] field eventSourcingService:EventSourcingService getRelatedEvents/1 [FIELDS] read=eventSourcingService:EventSourcingService [CALLS-EXTERNAL] EmailAggregate.fr...
/* static context [FOCAL] public EmailAggregate EmailCommandHandler.getByUUID(String uuid) [INPUTS] branches=- | result=uuid, eventSourcingService [COLLABORATORS] field eventSourcingService:EventSourcingService getRelatedEvents/1 [FIELDS] read=eventSourcingService:EventSourcingService [CALLS-EXTERNAL] EmailAggregate.fr...
true
ok
{"focal": {"class": "EmailCommandHandler", "name": "getByUUID", "signature": "EmailAggregate getByUUID(String uuid)", "start_line": 3, "modifiers": "public", "params": [{"name": "uuid", "type": "String"}], "return_type": "EmailAggregate"}, "class_info": {"name": "EmailCommandHandler", "kind": "class", "modifiers": "", ...
87212987_55
class SymbolManager extends AnnotationManager<SymbolLayer, Symbol, SymbolOptions, OnSymbolDragListener, OnSymbolClickListener, OnSymbolLongClickListener> { @UiThread public List<Symbol> create(@NonNull String json) { return create(FeatureCollection.fromJson(json)); } @UiThread public SymbolManager(@NonNu...
symbolManager = new SymbolManager(mapView, mapboxMap, style, coreElementProvider, null, null, draggableAnnotationController); verify(symbolLayer, times(0)).setProperties(argThat(new PropertyValueMatcher(textRadialOffset(get("text-radial-offset"))))); SymbolOptions options = new SymbolOptions().withLatLng(n...
[FOCAL] @UiThread public List<Symbol> SymbolManager.create(String json) [CLASS] class SymbolManager extends AnnotationManager<SymbolLayer, Symbol, SymbolOptions, OnSymbolDragListener, OnSymbolClickListener, OnSymbolLongClickListener> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] ...
/* static context [FOCAL] @UiThread public List<Symbol> SymbolManager.create(String json) [INPUTS] branches=- | result=json [CALLS-INTERNAL] List<Symbol> create(FeatureCollection featureCollection) [CALLS-EXTERNAL] FeatureCollection.fromJson/1 */
/* static context [FOCAL] @UiThread public List<Symbol> SymbolManager.create(String json) [INPUTS] branches=- | result=json [CALLS-INTERNAL] List<Symbol> create(FeatureCollection featureCollection) [CALLS-EXTERNAL] FeatureCollection.fromJson/1 */ class SymbolManager extends AnnotationManager<SymbolLayer, Symbol, Symbol...
true
ok
{"focal": {"class": "SymbolManager", "name": "create", "signature": "List<Symbol> create(String json)", "start_line": 3, "modifiers": "@UiThread public", "params": [{"name": "json", "type": "String"}], "return_type": "List<Symbol>"}, "class_info": {"name": "SymbolManager", "kind": "class", "modifiers": "", "superclass"...
87220385_0
class TightCouplingProcessor { public List<View> generateView() { Assert.notNull(project, "Project must not be null"); Assert.notNull(projectEvent, "Event must not be null"); Assert.notNull(commit, "Commit must not be null"); Assert.notNull(commit, "Commit must contain files"); ...
MessageDigest md5 = java.security.MessageDigest.getInstance("MD5"); Commit commit = new Commit(Arrays.asList(new File("file1.txt"), new File("file2.txt"))); Project project = new Project("test"); project.setIdentity(1L); project.setOwner("test"); projec...
[FOCAL] public List<View> TightCouplingProcessor.generateView() [CLASS] class TightCouplingProcessor [METRICS] loc=32 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] List<List<String>> subsets(List<String> set); String generateKey(List<String> files) [CALLS-EXTERNAL] Assert.notNull/2, commit.getFi...
/* static context [FOCAL] public List<View> TightCouplingProcessor.generateView() [PATH1] if(commit.getFiles().size() == 0)=T -> return null [PATH2] if(commit.getFiles().size() == 0)=F -> return fileGroups.stream() .map(f -> { String key = generateKey(f); View v... [COLLABORATORS] field commit getFiles/0,getCreatedAt/0...
/* static context [FOCAL] public List<View> TightCouplingProcessor.generateView() [PATH1] if(commit.getFiles().size() == 0)=T -> return null [PATH2] if(commit.getFiles().size() == 0)=F -> return fileGroups.stream() .map(f -> { String key = generateKey(f); View v... [COLLABORATORS] field commit getFiles/0,getCreatedAt/0...
true
ok
{"focal": {"class": "TightCouplingProcessor", "name": "generateView", "signature": "List<View> generateView()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<View>"}, "class_info": {"name": "TightCouplingProcessor", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "...
87225655_0
class InvocationStatistics { public void addInvocation(Invocation invocation) { numberOfInvocations++; if (this.methodName != null) { this.methodName = invocation.getMethodName(); } this.recentDuration = invocation.getRecentDuration(); this.lastInvocationTimestam...
Invocation first = new Invocation(null, 15, null, 1); Invocation second = new Invocation(null, 15, null, 2); Invocation another = new Invocation(null, 30, null, 2); this.cut.addInvocation(first); this.cut.addInvocation(second); this.cut.addInvocation(another); lon...
[FOCAL] public void InvocationStatistics.addInvocation(Invocation invocation) [CLASS] class InvocationStatistics [METRICS] loc=14 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] void recalculate() [CALLS-EXTERNAL] Invocation.getMethodName/0, Invocation.getRecentDuration/0, Invocation.getCreationTi...
/* static context [FOCAL] public void InvocationStatistics.addInvocation(Invocation invocation) [PATH1] if(this.methodName != null)=T -> if(currentException != null)=T [PATH2] if(this.methodName != null)=F -> if(currentException != null)=F [INPUTS] branches=invocation | result=- [COLLABORATORS] param invocation:Invocat...
/* static context [FOCAL] public void InvocationStatistics.addInvocation(Invocation invocation) [PATH1] if(this.methodName != null)=T -> if(currentException != null)=T [PATH2] if(this.methodName != null)=F -> if(currentException != null)=F [INPUTS] branches=invocation | result=- [COLLABORATORS] param invocation:Invocat...
true
ok
{"focal": {"class": "InvocationStatistics", "name": "addInvocation", "signature": "void addInvocation(Invocation invocation)", "start_line": 3, "modifiers": "public", "params": [{"name": "invocation", "type": "Invocation"}], "return_type": "void"}, "class_info": {"name": "InvocationStatistics", "kind": "class", "modifi...
87289313_111
class AreIn extends KoryphePredicate<Collection<?>> { @JsonIgnore public Collection<?> getValues() { return allowedValues; } public AreIn(); public AreIn(final Collection<?> allowedValues); public AreIn(final Object... allowedValues); public void setValues(final Collection<?> a...
// Given final AreIn filter = new AreIn(VALUE1); // When final String json = JsonSerialiser.serialise(filter); // Then JsonSerialiser.assertEquals(String.format("{%n" + " \"class\" : \"uk.gov.gchq.koryphe.impl.predicate.AreIn\",%n" + " ...
[FOCAL] @JsonIgnore public Collection<?> AreIn.getValues() [CLASS] class AreIn extends KoryphePredicate<Collection<?>> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] AreIn(); AreIn(Collection<?> allowedValues); AreIn(Object... allowedValues); void setValues(Collection<?> allowedVal...
/* static context [FOCAL] @JsonIgnore public Collection<?> AreIn.getValues() */
/* static context [FOCAL] @JsonIgnore public Collection<?> AreIn.getValues() */ class AreIn extends KoryphePredicate<Collection<?>> { @JsonIgnore public Collection<?> getValues() { return allowedValues; } public AreIn(); public AreIn(final Collection<?> allowedValues); public AreIn(...
true
ok
{"focal": {"class": "AreIn", "name": "getValues", "signature": "Collection<?> getValues()", "start_line": 3, "modifiers": "@JsonIgnore public", "params": [], "return_type": "Collection<?>"}, "class_info": {"name": "AreIn", "kind": "class", "modifiers": "", "superclass": "KoryphePredicate<Collection<?>>", "interfaces": ...
87336871_1224
class AbstractOrganisationFinanceService extends BaseTransactionalService implements OrganisationFinanceService { @Override public ServiceResult<Boolean> isShowStateAidAgreement(long targetId, long organisationId) { return getStateAidEligibilityForCompetition(targetId).andOnSuccess(eligibility -> { ...
competition.setStateAid(true); when(organisationService.findById(organisationId)).thenReturn(serviceSuccess(organisation)); assertTrue((boolean) service.isShowStateAidAgreement(targetId, organisationId).getSuccess()); } }
[FOCAL] @Override public ServiceResult<Boolean> AbstractOrganisationFinanceService.isShowStateAidAgreement(long targetId, long organisationId) [CLASS] class AbstractOrganisationFinanceService extends BaseTransactionalService implements OrganisationFinanceService [METRICS] loc=9 cc=1 branches=0 loops=0 returns=1 throws=...
/* static context [FOCAL] @Override public ServiceResult<Boolean> AbstractOrganisationFinanceService.isShowStateAidAgreement(long targetId, long organisationId) [INPUTS] branches=- | result=organisationId, targetId [CALLS-INTERNAL] ServiceResult<Boolean> getStateAidEligibilityForCompetition(long targetId); ServiceResul...
/* static context [FOCAL] @Override public ServiceResult<Boolean> AbstractOrganisationFinanceService.isShowStateAidAgreement(long targetId, long organisationId) [INPUTS] branches=- | result=organisationId, targetId [CALLS-INTERNAL] ServiceResult<Boolean> getStateAidEligibilityForCompetition(long targetId); ServiceResul...
true
ok
{"focal": {"class": "AbstractOrganisationFinanceService", "name": "isShowStateAidAgreement", "signature": "ServiceResult<Boolean> isShowStateAidAgreement(long targetId, long organisationId)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "targetId", "type": "long"}, {"name": "organisationId", "t...
87392130_25
class OIDCCoreProtocolConfiguration extends AbstractOIDCFlowAwareProfileConfiguration implements InitializableComponent, AuthenticationProfileConfiguration { public void setPostAuthenticationFlows(@Nonnull @NonnullElements final Collection<String> flows) { Constraint.isNotNull(flows, "Collection of flows c...
Assert.assertTrue(config.getPostAuthenticationFlows().isEmpty()); Collection<String> flows = new ArrayList<String>(); flows.add("value"); config.setPostAuthenticationFlows(flows); Assert.assertTrue(config.getPostAuthenticationFlows().contains("value")); } }
[FOCAL] public void OIDCCoreProtocolConfiguration.setPostAuthenticationFlows(Collection<String> flows) [CLASS] class OIDCCoreProtocolConfiguration extends AbstractOIDCFlowAwareProfileConfiguration implements InitializableComponent, AuthenticationProfileConfiguration [METRICS] loc=5 cc=1 branches=0 loops=0 returns=0 thr...
/* static context [FOCAL] public void OIDCCoreProtocolConfiguration.setPostAuthenticationFlows(Collection<String> flows) [NEW] ArrayList<> [CALLS-EXTERNAL] Constraint.isNotNull/2, StringSupport.normalizeStringCollection/1 */
/* static context [FOCAL] public void OIDCCoreProtocolConfiguration.setPostAuthenticationFlows(Collection<String> flows) [NEW] ArrayList<> [CALLS-EXTERNAL] Constraint.isNotNull/2, StringSupport.normalizeStringCollection/1 */ class OIDCCoreProtocolConfiguration extends AbstractOIDCFlowAwareProfileConfiguration implement...
true
ok
{"focal": {"class": "OIDCCoreProtocolConfiguration", "name": "setPostAuthenticationFlows", "signature": "void setPostAuthenticationFlows(Collection<String> flows)", "start_line": 3, "modifiers": "public", "params": [{"name": "flows", "type": "Collection<String>"}], "return_type": "void"}, "class_info": {"name": "OIDCCo...
87402251_6
class GreetingService { public String greetFromRepoJpa() { Hello databaseSide = helloRepoJpa.save(new Hello(0, "Greetings from the paging and sorting database side")); Optional<Hello> byId = helloRepoJpa.findById(databaseSide.getId()); return byId.orElse(new Hello(-99, "not found")).getMessage();...
String message = "message"; Hello saveObject = new Hello(0, message); when(helloRepoJpaMock.save(any(Hello.class))).thenReturn(saveObject); when(helloRepoJpaMock.findById(saveObject.getId())).thenReturn(Optional.of(saveObject)); assertThat(greetingService.greetFromRepoJpa(), is(message)); verif...
[FOCAL] public String GreetingService.greetFromRepoJpa() [CLASS] class GreetingService [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] helloRepoJpa.save/1, helloRepoJpa.findById/1, Hello.getId/0, byId.orElse(new Hello(-99, "not found")).getMessage/0, Optional<Hello>.orElse/1 [NEW] ...
/* static context [FOCAL] public String GreetingService.greetFromRepoJpa() [COLLABORATORS] field helloRepoJpa save/1,findById/1 [NEW] Hello [CALLS-EXTERNAL] helloRepoJpa.save/1, helloRepoJpa.findById/1, Hello.getId/0, byId.orElse(new Hello(-99, "not found")).getMessage/0, Optional<Hello>.orElse/1 */
/* static context [FOCAL] public String GreetingService.greetFromRepoJpa() [COLLABORATORS] field helloRepoJpa save/1,findById/1 [NEW] Hello [CALLS-EXTERNAL] helloRepoJpa.save/1, helloRepoJpa.findById/1, Hello.getId/0, byId.orElse(new Hello(-99, "not found")).getMessage/0, Optional<Hello>.orElse/1 */ class GreetingServi...
true
ok
{"focal": {"class": "GreetingService", "name": "greetFromRepoJpa", "signature": "String greetFromRepoJpa()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "GreetingService", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"na...
87455763_63
class NavigationViewEventDispatcher { void onNavigationFinished() { if (navigationListener != null) { navigationListener.onNavigationFinished(); } } void initializeListeners( @NonNull NavigationViewOptions navigationViewOptions, @NonNull NavigationViewModel navigationViewModel...
NavigationViewEventDispatcher eventDispatcher = new NavigationViewEventDispatcher(); NavigationListener navigationListener = mock(NavigationListener.class); eventDispatcher.onNavigationFinished(); verify(navigationListener, times(0)).onNavigationFinished(); } }
[FOCAL] void NavigationViewEventDispatcher.onNavigationFinished() [CLASS] class NavigationViewEventDispatcher [METRICS] loc=5 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] navigationListener.onNavigationFinished/0 [PATH1] if(navigationListener != null)=T [PATH2] if(navigationListener != null)=F ...
/* static context [FOCAL] void NavigationViewEventDispatcher.onNavigationFinished() [PATH1] if(navigationListener != null)=T [PATH2] if(navigationListener != null)=F [COLLABORATORS] field navigationListener onNavigationFinished/0 [CALLS-EXTERNAL] navigationListener.onNavigationFinished/0 */
/* static context [FOCAL] void NavigationViewEventDispatcher.onNavigationFinished() [PATH1] if(navigationListener != null)=T [PATH2] if(navigationListener != null)=F [COLLABORATORS] field navigationListener onNavigationFinished/0 [CALLS-EXTERNAL] navigationListener.onNavigationFinished/0 */ class NavigationViewEventDis...
true
ok
{"focal": {"class": "NavigationViewEventDispatcher", "name": "onNavigationFinished", "signature": "void onNavigationFinished()", "start_line": 3, "modifiers": "", "params": [], "return_type": "void"}, "class_info": {"name": "NavigationViewEventDispatcher", "kind": "class", "modifiers": "", "superclass": null, "interfac...
87548125_15
class AbstractnessRule extends AbstractPackageAnalyzerRule implements PackageAnalyzerRule { @Override public void scanModel(final SensorContext context, final ActiveRule rule, final Model<Location> model) { final Integer maximum = Integer.valueOf(rule.param(PARAM_MAXIMUM)); for (final Package<Location> packageT...
final Model<Location> model = createModel(); subject.scanModel(sensorContext, activeRule, model); // Check one issue on packageA Assert.assertEquals(3, sensorContext.allIssues().size()); Map<String, Issue> issues = sensorContext.allIssues().stream().collect( Collectors.toMap(issue -> issue.primaryLocatio...
[FOCAL] @Override public void AbstractnessRule.scanModel(SensorContext context, ActiveRule rule, Model<Location> model) [CLASS] class AbstractnessRule extends AbstractPackageAnalyzerRule implements PackageAnalyzerRule [METRICS] loc=21 cc=3 branches=1 loops=1 returns=0 throws=0 nesting=2 [CALLS-EXTERNAL] Integer.valueOf...
/* static context [FOCAL] @Override public void AbstractnessRule.scanModel(SensorContext context, ActiveRule rule, Model<Location> model) [PATH1] foreach(Package<Location> packageToCheck : model.getPackages())=T -> if(abstractness > maximum)=T -> exit loop [PATH2] foreach(Package<Location> packageToCheck : model.getPac...
/* static context [FOCAL] @Override public void AbstractnessRule.scanModel(SensorContext context, ActiveRule rule, Model<Location> model) [PATH1] foreach(Package<Location> packageToCheck : model.getPackages())=T -> if(abstractness > maximum)=T -> exit loop [PATH2] foreach(Package<Location> packageToCheck : model.getPac...
true
ok
{"focal": {"class": "AbstractnessRule", "name": "scanModel", "signature": "void scanModel(SensorContext context, ActiveRule rule, Model<Location> model)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "context", "type": "SensorContext"}, {"name": "rule", "type": "ActiveRule"}, {"name": "model", ...
87556817_49
class TextMarkupDocumentReader { public TextMarkupDocument parseString(String text, final TextMarkupDocumentSection otherSection) { ImmutableList<TextMarkupDocumentSection> textMarkupDocumentSections = this.parseString(text, this.firstLevelElements, true, "////"); if (otherSection != null) { ...
TextMarkupDocument doc = textMarkupDocumentReader.parseString( "\n\n\r\n/*This is my comment that I want to ignore*/\n" + "//// " + TextMarkupDocumentReader.TAG_METADATA + " k1=v1 k2=v2\r\n" + "//// " + TextMarkupDocumentReader.TAG_METADATA + " k3=...
[FOCAL] public TextMarkupDocument TextMarkupDocumentReader.parseString(String text, TextMarkupDocumentSection otherSection) [CLASS] class TextMarkupDocumentReader [METRICS] loc=15 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] ImmutableList<TextMarkupDocumentSection> parseString(String text, Immu...
/* static context [FOCAL] public TextMarkupDocument TextMarkupDocumentReader.parseString(String text, TextMarkupDocumentSection otherSection) [PATH1] if(otherSection != null)=T -> if(thisSection != null)=T -> return new TextMarkupDocument(textMarkupDocumentSections) [PATH2] if(otherSection != null)=F -> return new Text...
/* static context [FOCAL] public TextMarkupDocument TextMarkupDocumentReader.parseString(String text, TextMarkupDocumentSection otherSection) [PATH1] if(otherSection != null)=T -> if(thisSection != null)=T -> return new TextMarkupDocument(textMarkupDocumentSections) [PATH2] if(otherSection != null)=F -> return new Text...
true
ok
{"focal": {"class": "TextMarkupDocumentReader", "name": "parseString", "signature": "TextMarkupDocument parseString(String text, TextMarkupDocumentSection otherSection)", "start_line": 3, "modifiers": "public", "params": [{"name": "text", "type": "String"}, {"name": "otherSection", "type": "TextMarkupDocumentSection"}]...
87590893_59
class MoreFutures { @Deprecated public static <V> V getDoneUnchecked(Future<V> future) { /* * We throw IllegalStateException, since the call could succeed later. Perhaps we "should" throw * IllegalArgumentException, since the call could succeed with a different argument. Those * exceptions' ...
ListeningExecutorService executorService = MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor()); CountDownLatch latch = new CountDownLatch(1); ListenableFuture<String> future = executorService.submit(() -> { latch.await(1, TimeUnit.MINUTES); ...
[FOCAL] @Deprecated public static V MoreFutures.getDoneUnchecked(Future<V> future) [CLASS] class MoreFutures [METRICS] loc=16 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] checkState/3 (inherited), Future<V>.isDone/0, Futures.getUnchecked/1 [INPUTS] branches=- | result=future [COLLABORATORS] par...
/* static context [FOCAL] @Deprecated public static V MoreFutures.getDoneUnchecked(Future<V> future) [INPUTS] branches=- | result=future [COLLABORATORS] param future:Future<V> isDone/0 [CALLS-EXTERNAL] checkState/3 (inherited), Future<V>.isDone/0, Futures.getUnchecked/1 */
/* static context [FOCAL] @Deprecated public static V MoreFutures.getDoneUnchecked(Future<V> future) [INPUTS] branches=- | result=future [COLLABORATORS] param future:Future<V> isDone/0 [CALLS-EXTERNAL] checkState/3 (inherited), Future<V>.isDone/0, Futures.getUnchecked/1 */ class MoreFutures { @Deprecated publi...
true
ok
{"focal": {"class": "MoreFutures", "name": "getDoneUnchecked", "signature": "V getDoneUnchecked(Future<V> future)", "start_line": 3, "modifiers": "@Deprecated public static", "params": [{"name": "future", "type": "Future<V>"}], "return_type": "V"}, "class_info": {"name": "MoreFutures", "kind": "class", "modifiers": "",...
87839153_1
class RoutersService { public void put(final RouterMeta routerMeta) { final JsonEventToLogger event = new JsonEventToLogger(this.getClass()); String logCorrelation = routerMeta.correlation; event.put("correlation", logCorrelation); try { String key = MessageFormat.forma...
//Arrange RouterMeta routerMeta = new RouterMeta(); routerMeta.groupId = "group-local"; routerMeta.localIP = "127.0.0.1"; routerMeta.version = "1"; String versionNewest = "2"; routerMeta.envId = "1"; routerMeta.zoneId = null; Environment env = new...
[FOCAL] public void RoutersService.put(RouterMeta routerMeta) [CLASS] class RoutersService [METRICS] loc=15 cc=2 branches=0 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] Set<Long> processEtagsFromRouters(RouterMeta routerMeta); void registerRouterAndUpdateTtl(RouterMeta routerMeta, JsonEventToLogger event, Stri...
/* static context [FOCAL] public void RoutersService.put(RouterMeta routerMeta) [PATH1] try-body throws [EXCEPTIONS] catches Exception e [CALLS-INTERNAL] Set<Long> processEtagsFromRouters(RouterMeta routerMeta); void registerRouterAndUpdateTtl(RouterMeta routerMeta, JsonEventToLogger event, String key); void updateRout...
/* static context [FOCAL] public void RoutersService.put(RouterMeta routerMeta) [PATH1] try-body throws [EXCEPTIONS] catches Exception e [CALLS-INTERNAL] Set<Long> processEtagsFromRouters(RouterMeta routerMeta); void registerRouterAndUpdateTtl(RouterMeta routerMeta, JsonEventToLogger event, String key); void updateRout...
true
ok
{"focal": {"class": "RoutersService", "name": "put", "signature": "void put(RouterMeta routerMeta)", "start_line": 3, "modifiers": "public", "params": [{"name": "routerMeta", "type": "RouterMeta"}], "return_type": "void"}, "class_info": {"name": "RoutersService", "kind": "class", "modifiers": "", "superclass": null, "i...
87859908_476
class CountedAspect { private Counter.Builder counter(ProceedingJoinPoint pjp, Counted counted) { Counter.Builder builder = Counter.builder(counted.value()).tags(tagsBasedOnJoinPoint.apply(pjp)); String description = counted.description(); if (!description.isEmpty()) { builder.d...
countedService.succeedWithMetrics(); Counter counter = meterRegistry.get("metric.success") .tag("method", "succeedWithMetrics") .tag("class", "io.micrometer.core.aop.CountedAspectTest$CountedService") .tag("extra", "tag") .tag("result", "s...
[FOCAL] private Counter.Builder CountedAspect.counter(ProceedingJoinPoint pjp, Counted counted) [CLASS] class CountedAspect [METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-EXTERNAL] Counter.builder(counted.value()).tags/1, Counter.builder/1, Counted.value/0, tagsBasedOnJoinPoint.apply/1, Cou...
/* static context [FOCAL] private Counter.Builder CountedAspect.counter(ProceedingJoinPoint pjp, Counted counted) [PATH1] if(!description.isEmpty())=T -> return builder [PATH2] if(!description.isEmpty())=F -> return builder [INPUTS] branches=counted | result=counted, pjp [COLLABORATORS] param counted:Counted value/0,de...
/* static context [FOCAL] private Counter.Builder CountedAspect.counter(ProceedingJoinPoint pjp, Counted counted) [PATH1] if(!description.isEmpty())=T -> return builder [PATH2] if(!description.isEmpty())=F -> return builder [INPUTS] branches=counted | result=counted, pjp [COLLABORATORS] param counted:Counted value/0,de...
true
ok
{"focal": {"class": "CountedAspect", "name": "counter", "signature": "Counter.Builder counter(ProceedingJoinPoint pjp, Counted counted)", "start_line": 3, "modifiers": "private", "params": [{"name": "pjp", "type": "ProceedingJoinPoint"}, {"name": "counted", "type": "Counted"}], "return_type": "Counter.Builder"}, "class...
87869865_3
class StringUtils { public static int skip_spaces_reverse(StringBuilder s, int pos) { return skip_char_reverse(s, " \t\n\r", pos); } static boolean contains(char c, String what); static int skip_char(StringBuilder s, String what, int pos); static int skip_char_reverse(StringBuilder s, String what, int pos); p...
System.out.println("skip_spaces_reverse"); assertEquals(15, StringUtils.skip_spaces_reverse(new StringBuilder("das ist ein Test"), 15)); assertEquals(10, StringUtils.skip_spaces_reverse(new StringBuilder("das ist ein \t Test"), 14)); assertEquals(10, StringUtils.skip_spaces_reverse...
[FOCAL] public static int StringUtils.skip_spaces_reverse(StringBuilder s, int pos) [CLASS] class StringUtils [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] int skip_char_reverse(StringBuilder s, String what, int pos) [INPUTS] branches=- | result=pos, s [DATAFLOW] pos@param->L2; s...
/* static context [FOCAL] public static int StringUtils.skip_spaces_reverse(StringBuilder s, int pos) [INPUTS] branches=- | result=pos, s [CALLS-INTERNAL] int skip_char_reverse(StringBuilder s, String what, int pos) */
/* static context [FOCAL] public static int StringUtils.skip_spaces_reverse(StringBuilder s, int pos) [INPUTS] branches=- | result=pos, s [CALLS-INTERNAL] int skip_char_reverse(StringBuilder s, String what, int pos) */ class StringUtils { public static int skip_spaces_reverse(StringBuilder s, int pos) { return skip...
true
ok
{"focal": {"class": "StringUtils", "name": "skip_spaces_reverse", "signature": "int skip_spaces_reverse(StringBuilder s, int pos)", "start_line": 3, "modifiers": "public static", "params": [{"name": "s", "type": "StringBuilder"}, {"name": "pos", "type": "int"}], "return_type": "int"}, "class_info": {"name": "StringUtil...
87910456_7
class Feature6LoWPANProtocol extends Feature { public boolean getNetworkNodeList(NetworkNodeListCallback callback) { Log.d("6lowpan","getNetworkNodeList: "+mRequestTimeout); if(mRequestTimeout !=null) return false; mNodeListCallback = callback; getParentNode().enableNot...
mFeature.getNetworkNodeList(mNodeListCallback); NetworkRequest cmd = new NetworkRequest(mFeature.getLastWriteData()); Assert.assertEquals(GET_NODE_LIST_CMD_ID,cmd.getCommandId()); Assert.assertEquals(6,cmd.getLength()); } }
[FOCAL] public boolean Feature6LoWPANProtocol.getNetworkNodeList(NetworkNodeListCallback callback) [CLASS] class Feature6LoWPANProtocol extends Feature [METRICS] loc=20 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] Log.d/2, getParentNode().enableNotification/1, getParentNode/0 (inherited), new N...
/* static context [FOCAL] public boolean Feature6LoWPANProtocol.getNetworkNodeList(NetworkNodeListCallback callback) [PATH1] if(mRequestTimeout !=null)=T -> return false [PATH2] if(mRequestTimeout !=null)=F -> return true [COLLABORATORS] field mNodeListCallback:Feature6LoWPANProtocol.NetworkNodeListCallback onRequestTi...
/* static context [FOCAL] public boolean Feature6LoWPANProtocol.getNetworkNodeList(NetworkNodeListCallback callback) [PATH1] if(mRequestTimeout !=null)=T -> return false [PATH2] if(mRequestTimeout !=null)=F -> return true [COLLABORATORS] field mNodeListCallback:Feature6LoWPANProtocol.NetworkNodeListCallback onRequestTi...
true
ok
{"focal": {"class": "Feature6LoWPANProtocol", "name": "getNetworkNodeList", "signature": "boolean getNetworkNodeList(NetworkNodeListCallback callback)", "start_line": 3, "modifiers": "public", "params": [{"name": "callback", "type": "NetworkNodeListCallback"}], "return_type": "boolean"}, "class_info": {"name": "Feature...